From e354d54095995d99200cace32def0c2db0085f25 Mon Sep 17 00:00:00 2001 From: Michael Yong Date: Wed, 5 Aug 2026 10:58:38 -0700 Subject: [PATCH 01/21] feat: normalize provider subscription rate limits --- .../src/claude-code/adapter.test.ts | 57 +++++++++- .../agent-runtime/src/claude-code/schemas.ts | 36 +----- .../src/claude-code/translate-message.ts | 106 +++++++++++++++++- .../agent-runtime/src/codex/adapter.test.ts | 40 +++++-- .../src/codex/event-translation.ts | 99 ++++++++++++++++ packages/agent-runtime/src/codex/schemas.ts | 43 +++++++ .../agent-runtime/src/codex/visibility.ts | 2 +- packages/agent-runtime/src/runtime.ts | 59 ++++++---- packages/domain/src/provider-event.ts | 53 +++++++++ packages/domain/src/thread-event-scope.ts | 5 + packages/domain/test/provider-event.test.ts | 35 ++++++ packages/host-daemon-contract/src/commands.ts | 2 +- .../test/contract.test.ts | 12 +- 13 files changed, 473 insertions(+), 76 deletions(-) diff --git a/packages/agent-runtime/src/claude-code/adapter.test.ts b/packages/agent-runtime/src/claude-code/adapter.test.ts index c8997d39d3..c0062e84d8 100644 --- a/packages/agent-runtime/src/claude-code/adapter.test.ts +++ b/packages/agent-runtime/src/claude-code/adapter.test.ts @@ -2496,7 +2496,7 @@ describe("claude-code provider adapter", () => { ); }); - it("translateEvent ignores rate limit events", () => { + it("translateEvent preserves unknown Claude rate limit window keys", () => { const adapter = createClaudeCodeProviderAdapter(); const events = adapter.translateEvent({ @@ -2508,7 +2508,7 @@ describe("claude-code provider adapter", () => { type: "rate_limit_event", rate_limit_info: { status: "allowed", - rateLimitType: "five_hour", + rateLimitType: "seven_day_fable", overageStatus: "rejected", overageDisabledReason: "out_of_credits", }, @@ -2516,10 +2516,26 @@ describe("claude-code provider adapter", () => { }, }); - expect(events).toMatchObject([]); + expect(events).toEqual([ + expect.objectContaining({ + type: "provider/rateLimits/updated", + scope: threadScope(), + rateLimits: expect.objectContaining({ + providerId: "claude-code", + status: "allowed", + windows: [ + expect.objectContaining({ + providerKey: "seven_day_fable", + label: null, + modelIds: [], + }), + ], + }), + }), + ]); }); - it("translateEvent ignores primary rate limit rejections when overage is allowed", () => { + it("translateEvent keeps overage-covered rejections nonterminal", () => { const adapter = createClaudeCodeProviderAdapter(); const events = adapter.translateEvent({ @@ -2539,7 +2555,22 @@ describe("claude-code provider adapter", () => { }, }); - expect(events).toEqual([]); + expect(events).toEqual([ + expect.objectContaining({ + type: "provider/rateLimits/updated", + rateLimits: expect.objectContaining({ + status: "allowed", + overageStatus: "allowed", + windows: [ + expect.objectContaining({ + providerKey: "five_hour", + status: "blocked", + resetsAtMs: 1_781_120_400_000, + }), + ], + }), + }), + ]); }); it("translateEvent ignores task-updated system events from the SDK envelope", () => { @@ -2915,6 +2946,22 @@ describe("claude-code provider adapter", () => { }, }); + expect(events).toContainEqual( + expect.objectContaining({ + type: "provider/rateLimits/updated", + rateLimits: expect.objectContaining({ + status: "blocked", + kind: "subscription-window", + reachedReason: "five_hour", + windows: [ + expect.objectContaining({ + providerKey: "five_hour", + resetsAtMs: 12_345_000, + }), + ], + }), + }), + ); expect(events).toContainEqual( expect.objectContaining({ type: "provider/error", diff --git a/packages/agent-runtime/src/claude-code/schemas.ts b/packages/agent-runtime/src/claude-code/schemas.ts index c6031c61ba..1009bf180f 100644 --- a/packages/agent-runtime/src/claude-code/schemas.ts +++ b/packages/agent-runtime/src/claude-code/schemas.ts @@ -404,37 +404,13 @@ export type ClaudeResultMessage = z.infer; const claudeRateLimitInfoSchema = z .object({ - status: z.enum(["allowed", "allowed_warning", "rejected"]), + status: z.string().min(1), resetsAt: z.number().optional(), - rateLimitType: z - .enum([ - "five_hour", - "seven_day", - "seven_day_opus", - "seven_day_sonnet", - "overage", - ]) - .optional(), - overageStatus: z - .enum(["allowed", "allowed_warning", "rejected"]) - .optional(), - overageDisabledReason: z - .enum([ - "overage_not_provisioned", - "org_level_disabled", - "org_level_disabled_until", - "out_of_credits", - "seat_tier_level_disabled", - "member_level_disabled", - "seat_tier_zero_credit_limit", - "group_zero_credit_limit", - "member_zero_credit_limit", - "org_service_level_disabled", - "no_limits_configured", - "fetch_error", - "unknown", - ]) - .optional(), + // Claude adds provider-defined windows over time. Keep the raw key instead + // of rejecting new model families or account tiers. + rateLimitType: z.string().min(1).optional(), + overageStatus: z.string().min(1).optional(), + overageDisabledReason: z.string().min(1).optional(), }) .passthrough(); diff --git a/packages/agent-runtime/src/claude-code/translate-message.ts b/packages/agent-runtime/src/claude-code/translate-message.ts index 9a1bcc1688..da730255e9 100644 --- a/packages/agent-runtime/src/claude-code/translate-message.ts +++ b/packages/agent-runtime/src/claude-code/translate-message.ts @@ -1,5 +1,7 @@ import type { ProviderErrorInfo, + ProviderRateLimitState, + ProviderRateLimitStatus, ThreadEvent, ThreadEventItem, ThreadEventTokenUsageBreakdown, @@ -333,6 +335,101 @@ function buildClaudeRateLimitEventDetail( return details.join("; "); } +function normalizeClaudeRateLimitStatus( + status: string, +): ProviderRateLimitStatus { + switch (status) { + case "allowed": + return "allowed"; + case "allowed_warning": + return "warning"; + case "rejected": + return "blocked"; + default: + return "unknown"; + } +} + +function claudeRateLimitLabel(providerKey: string | undefined): string | null { + switch (providerKey) { + case "five_hour": + return "Five-hour limit"; + case "seven_day": + return "Weekly limit"; + case "seven_day_opus": + return "Weekly Opus limit"; + case "seven_day_sonnet": + return "Weekly Sonnet limit"; + case "seven_day_overage_included": + return "Weekly included overage"; + case "overage": + return "Overage"; + default: + return null; + } +} + +function normalizeClaudeOverageStatus( + status: string | undefined, +): ProviderRateLimitState["overageStatus"] { + switch (status) { + case undefined: + return null; + case "allowed": + return "allowed"; + case "allowed_warning": + return "warning"; + case "rejected": + return "rejected"; + default: + return "unavailable"; + } +} + +function normalizeClaudeRateLimits( + message: ClaudeRateLimitEvent, +): ProviderRateLimitState { + const info = message.rate_limit_info; + const windowStatus = normalizeClaudeRateLimitStatus(info.status); + const overageStatus = normalizeClaudeOverageStatus(info.overageStatus); + const status = + windowStatus === "blocked" && overageStatus === "allowed" + ? "allowed" + : windowStatus === "blocked" && overageStatus === "warning" + ? "warning" + : windowStatus; + const providerKey = info.rateLimitType ?? null; + + return { + providerId: "claude-code", + status, + kind: + providerKey === "overage" + ? "credits" + : providerKey === null + ? "unknown" + : "subscription-window", + windows: [ + { + providerKey, + label: claudeRateLimitLabel(info.rateLimitType), + status: windowStatus, + usedPercent: null, + resetsAtMs: info.resetsAt === undefined ? null : info.resetsAt * 1_000, + modelIds: [], + }, + ], + reachedReason: + windowStatus === "blocked" + ? (info.rateLimitType ?? "rate_limit_rejected") + : null, + overageStatus, + overageReason: info.overageDisabledReason ?? null, + observedAtMs: Date.now(), + source: "claude-rate-limit", + }; +} + function isHardClaudeRateLimitRejection( message: ClaudeRateLimitEvent, ): boolean { @@ -902,8 +999,15 @@ export function translateClaudeSdkMessage( }); } const message = parsedMessage.data; + events.push({ + type: "provider/rateLimits/updated", + threadId, + providerThreadId: "", + scope: threadScope(), + rateLimits: normalizeClaudeRateLimits(message), + }); if (!isHardClaudeRateLimitRejection(message)) { - return []; + return events; } const turnId = state.currentTurnId ?? null; events.push( diff --git a/packages/agent-runtime/src/codex/adapter.test.ts b/packages/agent-runtime/src/codex/adapter.test.ts index b491d1fce6..d1db20be24 100644 --- a/packages/agent-runtime/src/codex/adapter.test.ts +++ b/packages/agent-runtime/src/codex/adapter.test.ts @@ -5033,25 +5033,51 @@ describe("codex provider adapter", () => { expect(readyEvents).toEqual([]); }); - // -- translateEvent: unknown events -------------------------------------- + // -- translateEvent: account events -------------------------------------- - it("translateEvent returns empty for unhandled codex events", () => { + it("translateEvent preserves Codex subscription rate limits", () => { const adapter = createCodexProviderAdapter(); const events = adapter.translateEvent( codexEvent("account/rateLimits/updated", { rateLimits: { - limitId: null, - limitName: null, - primary: null, + limitId: "codex", + limitName: "Codex", + primary: { + usedPercent: 100, + windowDurationMins: 300, + resetsAt: 1_781_120_400, + }, secondary: null, credits: null, individualLimit: null, planType: null, - rateLimitReachedType: null, + rateLimitReachedType: "rate_limit_reached", }, }), ); - expect(events).toMatchObject([]); + expect(events).toEqual([ + expect.objectContaining({ + type: "provider/rateLimits/updated", + scope: threadScope(), + rateLimits: expect.objectContaining({ + providerId: "codex", + status: "blocked", + kind: "subscription-window", + reachedReason: "rate_limit_reached", + source: "codex-account", + windows: [ + { + providerKey: "primary", + label: "Current session", + status: "blocked", + usedPercent: 100, + resetsAtMs: 1_781_120_400_000, + modelIds: [], + }, + ], + }), + }), + ]); }); it("translateEvent ignores remote control status changes", () => { diff --git a/packages/agent-runtime/src/codex/event-translation.ts b/packages/agent-runtime/src/codex/event-translation.ts index 0db8cb977c..b588862363 100644 --- a/packages/agent-runtime/src/codex/event-translation.ts +++ b/packages/agent-runtime/src/codex/event-translation.ts @@ -1,6 +1,9 @@ import type { ProviderErrorCategory, ProviderErrorInfo, + ProviderRateLimitState, + ProviderRateLimitStatus, + ProviderRateLimitWindow, ThreadEvent, ThreadEventContextWindowUsage, ThreadEventWebFetchItem, @@ -30,6 +33,7 @@ import { type CodexHandledThreadItem, type CodexItemStatus, type CodexParsedUserInput, + type CodexRateLimitSnapshot, type CodexTurnStatus, } from "./schemas.js"; import { codexVisibilityMetadata } from "./visibility.js"; @@ -42,6 +46,91 @@ interface CodexLastTokenUsage { totalTokens: number; } +function clampRateLimitPercent(value: number): number { + return Math.min(100, Math.max(0, value)); +} + +function codexWindowStatus(usedPercent: number): ProviderRateLimitStatus { + if (usedPercent >= 100) return "blocked"; + if (usedPercent >= 90) return "warning"; + return "allowed"; +} + +function normalizeCodexRateLimitWindow( + key: "primary" | "secondary", + window: CodexRateLimitSnapshot["primary"], +): ProviderRateLimitWindow | null { + if (!window) return null; + const usedPercent = clampRateLimitPercent(window.usedPercent); + return { + providerKey: key, + label: key === "primary" ? "Current session" : "Weekly limit", + status: codexWindowStatus(usedPercent), + usedPercent, + resetsAtMs: window.resetsAt === null ? null : window.resetsAt * 1_000, + modelIds: [], + }; +} + +function normalizeCodexRateLimits( + snapshot: CodexRateLimitSnapshot, +): ProviderRateLimitState { + const windows = [ + normalizeCodexRateLimitWindow("primary", snapshot.primary), + normalizeCodexRateLimitWindow("secondary", snapshot.secondary), + ].filter((window): window is ProviderRateLimitWindow => window !== null); + + if (snapshot.individualLimit) { + const usedPercent = clampRateLimitPercent( + 100 - snapshot.individualLimit.remainingPercent, + ); + windows.push({ + providerKey: "individual-limit", + label: "Spend control", + status: codexWindowStatus(usedPercent), + usedPercent, + resetsAtMs: snapshot.individualLimit.resetsAt * 1_000, + modelIds: [], + }); + } + + const reachedReason = snapshot.rateLimitReachedType; + const kind = + reachedReason?.includes("credits_depleted") || + (snapshot.credits !== null && + !snapshot.credits.unlimited && + !snapshot.credits.hasCredits) + ? "credits" + : reachedReason?.includes("usage_limit_reached") || + snapshot.individualLimit !== null + ? "spend-control" + : snapshot.primary !== null || snapshot.secondary !== null + ? "subscription-window" + : "unknown"; + const status = + reachedReason !== null + ? "blocked" + : windows.some((window) => window.status === "blocked") + ? "blocked" + : windows.some((window) => window.status === "warning") + ? "warning" + : windows.length > 0 || snapshot.credits?.hasCredits === true + ? "allowed" + : "unknown"; + + return { + providerId: "codex", + status, + kind, + windows, + reachedReason, + overageStatus: null, + overageReason: null, + observedAtMs: Date.now(), + source: "codex-account", + }; +} + type CodexNormalizedWebItem = | ThreadEventWebSearchItem | ThreadEventWebFetchItem; @@ -598,6 +687,16 @@ export function translateCodexEvent( const handledEvent: CodexHandledEvent = parsed.data; switch (handledEvent.method) { + case "account/rateLimits/updated": + return [ + { + type: "provider/rateLimits/updated", + threadId: UNSTAMPED_THREAD_ID, + providerThreadId: "", + scope: threadScope(), + rateLimits: normalizeCodexRateLimits(handledEvent.params.rateLimits), + }, + ]; case "turn/started": return [ { diff --git a/packages/agent-runtime/src/codex/schemas.ts b/packages/agent-runtime/src/codex/schemas.ts index cd92c3fb9b..ea9ce0ec50 100644 --- a/packages/agent-runtime/src/codex/schemas.ts +++ b/packages/agent-runtime/src/codex/schemas.ts @@ -737,7 +737,50 @@ function createCodexEventSchema< }); } +const codexRateLimitWindowSchema = z + .object({ + usedPercent: z.number(), + windowDurationMins: z.number().nullable(), + resetsAt: z.number().nullable(), + }) + .passthrough(); + +const codexRateLimitSnapshotSchema = z + .object({ + limitId: z.string().nullable(), + limitName: z.string().nullable(), + primary: codexRateLimitWindowSchema.nullable(), + secondary: codexRateLimitWindowSchema.nullable(), + credits: z + .object({ + hasCredits: z.boolean(), + unlimited: z.boolean(), + balance: z.string().nullable(), + }) + .passthrough() + .nullable(), + individualLimit: z + .object({ + limit: z.string(), + used: z.string(), + remainingPercent: z.number(), + resetsAt: z.number(), + }) + .passthrough() + .nullable(), + planType: z.string().nullable(), + rateLimitReachedType: z.string().nullable(), + }) + .passthrough(); +export type CodexRateLimitSnapshot = z.infer< + typeof codexRateLimitSnapshotSchema +>; + export const codexHandledEventSchema = z.discriminatedUnion("method", [ + createCodexEventSchema( + "account/rateLimits/updated", + z.object({ rateLimits: codexRateLimitSnapshotSchema }).passthrough(), + ), createCodexEventSchema( "turn/started", z diff --git a/packages/agent-runtime/src/codex/visibility.ts b/packages/agent-runtime/src/codex/visibility.ts index 21838d6f78..cb77666831 100644 --- a/packages/agent-runtime/src/codex/visibility.ts +++ b/packages/agent-runtime/src/codex/visibility.ts @@ -115,7 +115,7 @@ const CODEX_SERVER_NOTIFICATION_METHODS = { const CODEX_NOTIFICATION_COVERAGE = { "account/login/completed": "unknown", - "account/rateLimits/updated": "noise", + "account/rateLimits/updated": "normalized", "account/updated": "unknown", "app/list/updated": "unknown", "command/exec/outputDelta": "unknown", diff --git a/packages/agent-runtime/src/runtime.ts b/packages/agent-runtime/src/runtime.ts index 017a72fd96..c6066ab0c7 100644 --- a/packages/agent-runtime/src/runtime.ts +++ b/packages/agent-runtime/src/runtime.ts @@ -866,39 +866,50 @@ function createAgentRuntimeInternal( sourceThreadId: args.sourceThreadId, }); - if (!resolvedBbThreadId) { + // Codex publishes account rate-limit snapshots without a thread id. + // Preserve the account-wide signal for every resident thread instead of + // dropping it when a multiplexed provider process owns several threads. + const targetThreadIds = resolvedBbThreadId + ? [resolvedBbThreadId] + : event.type === "provider/rateLimits/updated" + ? [...args.proc.identity.threadIds] + : []; + + if (targetThreadIds.length === 0) { options.onStderr?.( `Dropping unscoped provider event ${event.type}; no bb thread could be resolved`, ); continue; } - const stampedEvent = stampThreadEventScope({ - event, - providerThreadId: - threadIdentityRegistry.getProviderThreadId(resolvedBbThreadId), - threadId: resolvedBbThreadId, - }); + for (const targetThreadId of targetThreadIds) { + const stampedEvent = stampThreadEventScope({ + event, + providerThreadId: + threadIdentityRegistry.getProviderThreadId(targetThreadId), + threadId: targetThreadId, + }); - const replayResult = turnReplayFilter.observe(stampedEvent); - if (replayResult.kind === "drop-replayed-turn-start") { - options.onStderr?.( - `Dropping replayed turn/started on already completed turn "${replayResult.turnId}" in thread "${replayResult.threadId}".`, - ); - continue; - } + const replayResult = turnReplayFilter.observe(stampedEvent); + if (replayResult.kind === "drop-replayed-turn-start") { + options.onStderr?.( + `Dropping replayed turn/started on already completed turn "${replayResult.turnId}" in thread "${replayResult.threadId}".`, + ); + continue; + } - const normalizedEvent = normalizeProviderThreadNameEvent( - replayResult.event, - ); - turnState.observe(normalizedEvent); - backgroundWorkState.observe(normalizedEvent); - observeProviderSessionIdleState(normalizedEvent); - if (shouldRestartCodexThreadAfterEvent(normalizedEvent, args.proc)) { - codexThreadsRequiringAccountRestart.add(normalizedEvent.threadId); + const normalizedEvent = normalizeProviderThreadNameEvent( + replayResult.event, + ); + turnState.observe(normalizedEvent); + backgroundWorkState.observe(normalizedEvent); + observeProviderSessionIdleState(normalizedEvent); + if (shouldRestartCodexThreadAfterEvent(normalizedEvent, args.proc)) { + codexThreadsRequiringAccountRestart.add(normalizedEvent.threadId); + } + options.onEvent(normalizedEvent); + threadGoalState.observe(normalizedEvent); } - options.onEvent(normalizedEvent); - threadGoalState.observe(normalizedEvent); } } diff --git a/packages/domain/src/provider-event.ts b/packages/domain/src/provider-event.ts index 97d2974563..58692a84e6 100644 --- a/packages/domain/src/provider-event.ts +++ b/packages/domain/src/provider-event.ts @@ -78,6 +78,53 @@ export const providerErrorInfoSchema = z.object({ }); export type ProviderErrorInfo = z.infer; +export const providerRateLimitStatusSchema = z.enum([ + "allowed", + "warning", + "blocked", + "unknown", +]); +export type ProviderRateLimitStatus = z.infer< + typeof providerRateLimitStatusSchema +>; + +export const providerRateLimitWindowSchema = z.object({ + /** Opaque provider-issued key. New provider windows must not break parsing. */ + providerKey: z.string().min(1).nullable(), + label: z.string().min(1).nullable(), + status: providerRateLimitStatusSchema, + usedPercent: z.number().min(0).max(100).nullable(), + resetsAtMs: z.number().int().nonnegative().nullable(), + /** Provider model ids when supplied explicitly; never inferred from a key. */ + modelIds: z.array(z.string().min(1)), +}); +export type ProviderRateLimitWindow = z.infer< + typeof providerRateLimitWindowSchema +>; + +export const providerRateLimitStateSchema = z.object({ + providerId: z.string().min(1), + status: providerRateLimitStatusSchema, + kind: z.enum([ + "request-throttle", + "subscription-window", + "credits", + "spend-control", + "unknown", + ]), + windows: z.array(providerRateLimitWindowSchema), + reachedReason: z.string().min(1).nullable(), + overageStatus: z + .enum(["allowed", "warning", "rejected", "unavailable"]) + .nullable(), + overageReason: z.string().min(1).nullable(), + observedAtMs: z.number().int().nonnegative(), + source: z.enum(["codex-account", "claude-rate-limit", "http"]), +}); +export type ProviderRateLimitState = z.infer< + typeof providerRateLimitStateSchema +>; + export const threadEventFileChangeKindSchema = z.enum([ "add", "delete", @@ -541,6 +588,12 @@ const unscopedProviderEventSchema = z.discriminatedUnion("type", [ willRetry: z.boolean().optional(), errorInfo: providerErrorInfoSchema.optional(), }), + z.object({ + type: z.literal("provider/rateLimits/updated"), + threadId: z.string(), + providerThreadId: z.string(), + rateLimits: providerRateLimitStateSchema, + }), z.object({ type: z.literal("provider/warning"), threadId: z.string(), diff --git a/packages/domain/src/thread-event-scope.ts b/packages/domain/src/thread-event-scope.ts index 33e6c9386b..b54788de8e 100644 --- a/packages/domain/src/thread-event-scope.ts +++ b/packages/domain/src/thread-event-scope.ts @@ -127,6 +127,11 @@ export const threadEventScopeDefinitionByType = { rationale: "Provider diagnostics use thread scope for provider setup/session failures; in-turn failures use turn scope.", }, + "provider/rateLimits/updated": { + policy: "thread", + rationale: + "Subscription usage is account-scoped state that can affect multiple turns and threads.", + }, "provider/warning": { policy: "thread-or-turn", rationale: diff --git a/packages/domain/test/provider-event.test.ts b/packages/domain/test/provider-event.test.ts index 2cb2cb6711..494e5e6192 100644 --- a/packages/domain/test/provider-event.test.ts +++ b/packages/domain/test/provider-event.test.ts @@ -4,6 +4,41 @@ import { threadEventSchema, turnScope } from "../src/index.js"; const CLIENT_REQUEST_ID = "creq_23456789ab"; describe("provider event schema", () => { + it("preserves opaque provider rate-limit window keys", () => { + expect( + threadEventSchema.parse({ + type: "provider/rateLimits/updated", + threadId: "thr_123", + providerThreadId: "provider-thread-123", + scope: { kind: "thread" }, + rateLimits: { + providerId: "claude-code", + status: "blocked", + kind: "subscription-window", + windows: [ + { + providerKey: "seven_day_fable", + label: null, + status: "blocked", + usedPercent: null, + resetsAtMs: 1_781_120_400_000, + modelIds: [], + }, + ], + reachedReason: "seven_day_fable", + overageStatus: null, + overageReason: null, + observedAtMs: 1_781_000_000_000, + source: "claude-rate-limit", + }, + }), + ).toMatchObject({ + rateLimits: { + windows: [{ providerKey: "seven_day_fable" }], + }, + }); + }); + it("uses clientRequestId for accepted input and user-message items", () => { expect( threadEventSchema.parse({ diff --git a/packages/host-daemon-contract/src/commands.ts b/packages/host-daemon-contract/src/commands.ts index 17b65974d5..e984a4837d 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 = 75 as const; +export const HOST_DAEMON_PROTOCOL_VERSION = 76 as const; export { BRANCH_LIST_LIMIT_MAX, diff --git a/packages/host-daemon-contract/test/contract.test.ts b/packages/host-daemon-contract/test/contract.test.ts index 22a42b9905..f9f7648b9c 100644 --- a/packages/host-daemon-contract/test/contract.test.ts +++ b/packages/host-daemon-contract/test/contract.test.ts @@ -1036,13 +1036,11 @@ describe("host-daemon local schemas", () => { }); describe("host-daemon command schemas", () => { - // Version 75 makes Claude's sandbox network prompt grantable. A daemon on 74 - // drops the "localSettings" suggestion that carries the grant, so it sends a - // permission_grant subject with an empty profile and the user cannot allow - // the prompt. The fix lives in the daemon's Claude bridge, so the bump is - // what moves an enrolled machine onto it. - it("uses protocol version 75 for grantable sandbox network prompts", () => { - expect(HOST_DAEMON_PROTOCOL_VERSION).toBe(75); + // Version 76 adds model-scoped/duration-aware provider usage windows and + // structured account rate-limit events on top of version 75's grantable + // Claude sandbox network prompts. + it("uses protocol version 76 for provider usage and rate-limit events", () => { + expect(HOST_DAEMON_PROTOCOL_VERSION).toBe(76); }); it("binds Plan cancellation to a required turn id and typed result", () => { From 886393e763c908c48b4442c693c2ab4888430b31 Mon Sep 17 00:00:00 2001 From: Michael Yong Date: Wed, 5 Aug 2026 11:09:26 -0700 Subject: [PATCH 02/21] feat: add guarded rate limit continuation --- apps/server/src/internal/events.ts | 1 + apps/server/src/routes/threads/actions.ts | 30 +- .../threads/provider-rate-limit-recovery.ts | 432 ++++++++++++++++++ .../src/services/threads/thread-events.ts | 7 + .../provider-rate-limit-recovery.test.ts | 293 ++++++++++++ packages/db/src/data/events.ts | 22 +- packages/db/src/data/index.ts | 1 + packages/domain/src/thread-events.ts | 2 + packages/sdk/src/areas/threads.ts | 31 ++ packages/sdk/test/public-types.test.ts | 2 + packages/server-contract/src/api/threads.ts | 55 +++ packages/server-contract/src/public-api.ts | 18 + packages/thread-view/src/event-decode.ts | 2 + 13 files changed, 894 insertions(+), 2 deletions(-) create mode 100644 apps/server/src/services/threads/provider-rate-limit-recovery.ts create mode 100644 apps/server/test/services/threads/provider-rate-limit-recovery.test.ts diff --git a/apps/server/src/internal/events.ts b/apps/server/src/internal/events.ts index a133fab2b4..cc96c85da5 100644 --- a/apps/server/src/internal/events.ts +++ b/apps/server/src/internal/events.ts @@ -224,6 +224,7 @@ function resolveProviderIdentifiers(event: HostDaemonEventEnvelope["event"]): { case "thread/name/updated": case "provider/warning": case "provider/modelFallback": + case "provider/rateLimits/updated": return { providerThreadId: event.providerThreadId }; case "thread/compacted": return { providerThreadId: event.providerThreadId }; diff --git a/apps/server/src/routes/threads/actions.ts b/apps/server/src/routes/threads/actions.ts index 625b48a791..efb6fb5177 100644 --- a/apps/server/src/routes/threads/actions.ts +++ b/apps/server/src/routes/threads/actions.ts @@ -72,6 +72,10 @@ import { LIVE_DAEMON_COMMAND_TIMEOUT_MS, runLiveHostCommand, } from "../../services/hosts/live-command.js"; +import { + continueThreadAfterProviderRateLimit, + getProviderRateLimitRecoveryStatus, +} from "../../services/threads/provider-rate-limit-recovery.js"; function toQueuedMessageOrderResponse( result: ReorderQueuedThreadMessageResult, @@ -267,7 +271,7 @@ async function createQueuedMessageForThread( } export function registerThreadActionRoutes(app: Hono, deps: AppDeps): void { - const { post, patch, del } = typedRoutes(app, { + const { get, post, patch, del } = typedRoutes(app, { onValidationError: (msg) => new ApiError(400, "invalid_request", msg), }); const routes = publicApiRoutes.threads; @@ -294,6 +298,30 @@ export function registerThreadActionRoutes(app: Hono, deps: AppDeps): void { return context.json({ ok: true }); }); + get(routes.rateLimitRecovery, async (context) => { + const thread = requirePublicThread(deps.db, context.req.param("id")); + const environment = await requireThreadCommandEnvironment(deps, { + thread, + }); + return context.json( + getProviderRateLimitRecoveryStatus(deps, { environment, thread }), + ); + }); + + post(routes.continueAfterRateLimit, async (context, payload) => { + const thread = requirePublicThread(deps.db, context.req.param("id")); + const environment = await requireThreadCommandEnvironment(deps, { + thread, + }); + return context.json( + await continueThreadAfterProviderRateLimit(deps, { + environment, + expectedRequestId: payload.expectedRequestId, + thread, + }), + ); + }); + post(routes.createQueuedMessage, async (context, payload) => { const thread = requirePublicThread(deps.db, context.req.param("id")); const queuedMessage = await createQueuedMessageForThread(deps, { diff --git a/apps/server/src/services/threads/provider-rate-limit-recovery.ts b/apps/server/src/services/threads/provider-rate-limit-recovery.ts new file mode 100644 index 0000000000..06db50002a --- /dev/null +++ b/apps/server/src/services/threads/provider-rate-limit-recovery.ts @@ -0,0 +1,432 @@ +import { + getEnvironment, + getLastStoredTurnRequestEvent, + getLatestStoredEventRowByType, + getStoredTurnRequestEventForTurn, + getThread, + listStoredEventRowsInRange, + requireThreadLifecycleEventApplied, + type DbQueryConnection, +} from "@bb/db"; +import { + clientTurnRequestIdSchema, + resolvedThreadExecutionOptionsSchema, + threadScope, + type ClientTurnRequestId, + type Environment, + type PromptInput, + type ProviderRateLimitState, + type ResolvedThreadExecutionOptions, + type Thread, + type ThreadEvent, +} from "@bb/domain"; +import type { + ContinueAfterProviderRateLimitResponse, + ProviderRateLimitRecoveryReason, + ProviderRateLimitRecoveryStatus, +} from "@bb/server-contract"; +import { ApiError } from "../../errors.js"; +import type { LoggedPendingInteractionWorkSessionDeps } from "../../types.js"; +import { + prepareReadyThreadTurnCommand, + prepareReadyThreadTurnDispatch, + ensureThreadCanStartRequest, +} from "./thread-lifecycle.js"; +import { + appendPreparedClientTurnRequestedEventInTransaction, + appendThreadEventInTransaction, + createClientTurnRequestId, + parseStoredTurnRequestEvent, +} from "./thread-events.js"; +import { parseStoredEvent } from "./thread-data.js"; +import { resolvePermissionEscalation } from "./thread-runtime-config.js"; +import { requireReadyThreadEnvironment } from "./thread-turn-dispatch.js"; +import { applyLoggedThreadLifecycleEventInTransaction } from "./lifecycle-outcome.js"; +import { + LIVE_DAEMON_COMMAND_TIMEOUT_MS, + startLiveHostCommand, +} from "../hosts/live-command.js"; +import { + ensureThreadIsNotAwaitingUserInteraction, + ensureThreadIsWritable, +} from "./thread-send.js"; + +const CONTINUE_INPUT: PromptInput[] = [ + { + type: "text", + text: "Please continue.", + mentions: [], + visibility: "agent-only", + }, +]; + +const SAFE_EMPTY_TURN_EVENT_TYPES = new Set([ + "turn/started", + "turn/input/accepted", + "turn/completed", + "thread/tokenUsage/updated", + "thread/contextWindowUsage/updated", + "provider/error", + "provider/warning", + "provider/rateLimits/updated", + "system/error", +]); + +interface InternalRecoveryCandidate { + execution: ResolvedThreadExecutionOptions; + failedRequestId: ClientTurnRequestId; + rateLimits: ProviderRateLimitState; + resetsAtMs: number; + turnId: string; +} + +interface RecoveryInspection { + candidate: InternalRecoveryCandidate | null; + status: ProviderRateLimitRecoveryStatus; +} + +interface InspectRecoveryArgs { + db: DbQueryConnection; + environment: Environment; + thread: Thread; +} + +function scopeKey(environment: Environment, thread: Thread): string { + return `${environment.hostId}:${thread.providerId}`; +} + +function emptyInspection( + args: InspectRecoveryArgs, + reason: ProviderRateLimitRecoveryReason, + rateLimits: ProviderRateLimitState | null, +): RecoveryInspection { + return { + candidate: null, + status: { + reason, + scopeKey: scopeKey(args.environment, args.thread), + rateLimits, + candidate: null, + }, + }; +} + +function latestRateLimitState( + db: DbQueryConnection, + thread: Thread, +): ProviderRateLimitState | null { + const row = getLatestStoredEventRowByType(db, { + threadId: thread.id, + type: "provider/rateLimits/updated", + }); + if (!row) return null; + const event = parseStoredEvent(row); + if ( + event.type !== "provider/rateLimits/updated" || + event.rateLimits.providerId !== thread.providerId + ) { + return null; + } + return event.rateLimits; +} + +function recoveryResetAtMs(rateLimits: ProviderRateLimitState): number | null { + const blockedWindows = rateLimits.windows.filter( + (window) => window.status === "blocked", + ); + const relevantWindows = + blockedWindows.length > 0 ? blockedWindows : rateLimits.windows; + const resetTimes = relevantWindows.flatMap((window) => + window.resetsAtMs === null ? [] : [window.resetsAtMs], + ); + return resetTimes.length === 0 ? null : Math.max(...resetTimes); +} + +function eventBelongsToTurn(event: ThreadEvent, turnId: string): boolean { + return event.scope.kind === "turn" && event.scope.turnId === turnId; +} + +function hasOutputOrSideEffect( + events: readonly ThreadEvent[], + turnId: string, +): boolean { + return events.some( + (event) => + eventBelongsToTurn(event, turnId) && + !SAFE_EMPTY_TURN_EVENT_TYPES.has(event.type), + ); +} + +function inspectRecovery(args: InspectRecoveryArgs): RecoveryInspection { + const observedRateLimits = latestRateLimitState(args.db, args.thread); + if (args.thread.status !== "error") { + return emptyInspection(args, "thread-not-failed", observedRateLimits); + } + + const completedRow = getLatestStoredEventRowByType(args.db, { + threadId: args.thread.id, + type: "turn/completed", + }); + if (!completedRow || completedRow.turnId === null) { + return emptyInspection(args, "no-failed-turn", observedRateLimits); + } + const completedEvent = parseStoredEvent(completedRow); + if ( + completedEvent.type !== "turn/completed" || + completedEvent.status !== "failed" + ) { + return emptyInspection(args, "no-failed-turn", observedRateLimits); + } + const turnId = completedRow.turnId; + + const requestRow = getStoredTurnRequestEventForTurn(args.db, { + threadId: args.thread.id, + turnId, + }); + if (!requestRow) { + return emptyInspection(args, "input-not-accepted", observedRateLimits); + } + const request = parseStoredTurnRequestEvent(requestRow); + const latestRequestRow = getLastStoredTurnRequestEvent( + args.db, + args.thread.id, + ); + if (!latestRequestRow || latestRequestRow.sequence !== requestRow.sequence) { + return emptyInspection(args, "superseded", observedRateLimits); + } + + const rows = listStoredEventRowsInRange(args.db, { + threadId: args.thread.id, + seqStart: requestRow.sequence, + seqEnd: completedRow.sequence, + }); + const events = rows.map(parseStoredEvent); + const accepted = events.some( + (event) => + event.type === "turn/input/accepted" && + event.clientRequestId === request.requestId && + eventBelongsToTurn(event, turnId), + ); + if (!accepted) { + return emptyInspection(args, "input-not-accepted", observedRateLimits); + } + + const turnRateLimits = events + .filter( + ( + event, + ): event is Extract< + ThreadEvent, + { type: "provider/rateLimits/updated" } + > => + event.type === "provider/rateLimits/updated" && + event.rateLimits.providerId === args.thread.providerId, + ) + .at(-1)?.rateLimits; + if (!turnRateLimits || turnRateLimits.status !== "blocked") { + return emptyInspection(args, "no-rate-limit-state", observedRateLimits); + } + + const rateLimitErrors = events.filter( + (event): event is Extract => + event.type === "provider/error" && + event.errorInfo?.category === "rate-limit", + ); + if ( + rateLimitErrors.some((event) => event.willRetry === true) && + !rateLimitErrors.some((event) => event.willRetry !== true) + ) { + return emptyInspection(args, "provider-will-retry", turnRateLimits); + } + if (turnRateLimits.kind !== "subscription-window") { + return emptyInspection(args, "not-subscription-window", turnRateLimits); + } + + const resetsAtMs = recoveryResetAtMs(turnRateLimits); + if (resetsAtMs === null) { + return emptyInspection(args, "reset-unavailable", turnRateLimits); + } + if (hasOutputOrSideEffect(events, turnId)) { + return emptyInspection( + args, + "output-or-side-effect-observed", + turnRateLimits, + ); + } + + const execution = resolvedThreadExecutionOptionsSchema.safeParse( + request.execution, + ); + if (!execution.success) { + return emptyInspection(args, "execution-unavailable", turnRateLimits); + } + const failedRequestId = clientTurnRequestIdSchema.parse(request.requestId); + const candidate: InternalRecoveryCandidate = { + execution: execution.data, + failedRequestId, + rateLimits: turnRateLimits, + resetsAtMs, + turnId, + }; + return { + candidate, + status: { + reason: "eligible", + scopeKey: scopeKey(args.environment, args.thread), + rateLimits: turnRateLimits, + candidate: { + failedRequestId, + turnId, + scopeKey: scopeKey(args.environment, args.thread), + resetsAtMs, + rateLimits: turnRateLimits, + }, + }, + }; +} + +export function getProviderRateLimitRecoveryStatus( + deps: Pick, + args: { environment: Environment; thread: Thread }, +): ProviderRateLimitRecoveryStatus { + return inspectRecovery({ db: deps.db, ...args }).status; +} + +function unavailableRecoveryError(status: ProviderRateLimitRecoveryStatus) { + return new ApiError( + 409, + "rate_limit_recovery_unavailable", + "This thread is no longer safe to continue after its provider rate limit.", + { details: status }, + ); +} + +export async function continueThreadAfterProviderRateLimit( + deps: LoggedPendingInteractionWorkSessionDeps, + args: { + environment: Environment; + expectedRequestId: ClientTurnRequestId; + thread: Thread; + }, +): Promise { + ensureThreadIsWritable(args.thread); + ensureThreadIsNotAwaitingUserInteraction(deps, args.thread.id); + const readyEnvironment = requireReadyThreadEnvironment( + getEnvironment(deps.db, args.environment.id) ?? args.environment, + ); + const initial = inspectRecovery({ + db: deps.db, + environment: readyEnvironment, + thread: args.thread, + }); + if ( + !initial.candidate || + initial.candidate.failedRequestId !== args.expectedRequestId + ) { + throw unavailableRecoveryError(initial.status); + } + + const requestId = createClientTurnRequestId(); + const permissionEscalation = resolvePermissionEscalation({ + thread: args.thread, + initiator: "system", + }); + const command = await prepareReadyThreadTurnCommand(deps, { + thread: args.thread, + fork: null, + input: CONTINUE_INPUT, + requestId, + execution: initial.candidate.execution, + permissionEscalation, + environment: { + id: readyEnvironment.id, + hostId: readyEnvironment.hostId, + path: readyEnvironment.path, + status: readyEnvironment.status, + workspaceProvisionType: readyEnvironment.workspaceProvisionType, + }, + projectId: args.thread.projectId, + providerId: args.thread.providerId, + syncGeneratedTitle: false, + }); + + deps.db.transaction( + (tx) => { + const currentThread = getThread(tx, args.thread.id); + const currentEnvironment = getEnvironment(tx, readyEnvironment.id); + if (!currentThread || !currentEnvironment) { + throw unavailableRecoveryError(initial.status); + } + requireReadyThreadEnvironment(currentEnvironment); + ensureThreadIsWritable(currentThread); + ensureThreadCanStartRequest(currentThread); + const current = inspectRecovery({ + db: tx, + environment: currentEnvironment, + thread: currentThread, + }); + if ( + !current.candidate || + current.candidate.failedRequestId !== args.expectedRequestId + ) { + throw unavailableRecoveryError(current.status); + } + + appendPreparedClientTurnRequestedEventInTransaction(tx, { + threadId: currentThread.id, + environmentId: currentEnvironment.id, + type: "client/turn/requested", + continuationOfRequestId: args.expectedRequestId, + input: CONTINUE_INPUT, + execution: current.candidate.execution, + initiator: "system", + senderThreadId: null, + requestMethod: "turn/start", + source: "tell", + target: { kind: "new-turn" }, + requestId, + }); + appendThreadEventInTransaction(tx, { + threadId: currentThread.id, + environmentId: currentEnvironment.id, + type: "system/operation", + scope: threadScope(), + data: { + operation: "provider_rate_limit_recovery", + operationId: `provider-rate-limit-recovery:${args.expectedRequestId}`, + status: "completed", + message: "Continued after provider rate limit reset", + metadata: { + failedRequestId: args.expectedRequestId, + continuationRequestId: requestId, + }, + }, + }); + prepareReadyThreadTurnDispatch({ command, thread: currentThread }); + requireThreadLifecycleEventApplied( + applyLoggedThreadLifecycleEventInTransaction( + { db: tx, logger: deps.logger }, + { event: { type: "run.started" }, threadId: currentThread.id }, + ), + ); + }, + { behavior: "immediate" }, + ); + + deps.hub.notifyThread(args.thread.id, ["events-appended", "status-changed"], { + eventTypes: ["client/turn/requested", "system/operation"], + projectId: args.thread.projectId, + }); + startLiveHostCommand(deps, { + command: command.command, + hostId: readyEnvironment.hostId, + timeoutMs: LIVE_DAEMON_COMMAND_TIMEOUT_MS, + onError: ({ error }) => { + deps.logger.warn( + { err: error, threadId: args.thread.id }, + "Provider rate-limit continuation command failed", + ); + }, + }); + return { ok: true, requestId }; +} diff --git a/apps/server/src/services/threads/thread-events.ts b/apps/server/src/services/threads/thread-events.ts index b4c9d82443..28e74d560d 100644 --- a/apps/server/src/services/threads/thread-events.ts +++ b/apps/server/src/services/threads/thread-events.ts @@ -59,6 +59,7 @@ interface ThreadEventTransactionDeps { } export interface ClientTurnRequestedEventArgs { + continuationOfRequestId?: ClientTurnRequestId; environmentId: string | null; execution: ResolvedThreadExecutionOptions; initiator: ThreadTurnInitiator; @@ -242,6 +243,9 @@ function buildClientTurnRequestedEventData( return { ...buildClientTurnBaseEventData(args), requestId, + ...(args.continuationOfRequestId !== undefined + ? { continuationOfRequestId: args.continuationOfRequestId } + : {}), senderThreadId: args.senderThreadId, // Stamp the Family-B taxonomy fields when present. Omitted entirely for // non-system turns so legacy events keep parsing via the schema's optional @@ -665,6 +669,9 @@ export function parseStoredTurnRequestEvent( return { direction: event.direction, requestId: event.requestId, + ...(event.continuationOfRequestId !== undefined + ? { continuationOfRequestId: event.continuationOfRequestId } + : {}), source: event.source, initiator: event.initiator, senderThreadId: event.senderThreadId, diff --git a/apps/server/test/services/threads/provider-rate-limit-recovery.test.ts b/apps/server/test/services/threads/provider-rate-limit-recovery.test.ts new file mode 100644 index 0000000000..6cacd6a120 --- /dev/null +++ b/apps/server/test/services/threads/provider-rate-limit-recovery.test.ts @@ -0,0 +1,293 @@ +import { getThread, listEvents } from "@bb/db"; +import { + encodeClientTurnRequestIdNumber, + parseStoredThreadEvent, + threadScope, + turnScope, + type ProviderRateLimitState, +} from "@bb/domain"; +import { describe, expect, it } from "vitest"; +import { getProviderRateLimitRecoveryStatus } from "../../../src/services/threads/provider-rate-limit-recovery.js"; +import { listQueuedThreadCommands } from "../../helpers/commands.js"; +import { readJson } from "../../helpers/json.js"; +import { + seedEnvironment, + seedEvent, + seedHostSession, + seedProjectWithSource, + seedThread, +} from "../../helpers/seed.js"; +import { + withTestHarness, + type TestAppHarness, +} from "../../helpers/test-app.js"; + +const FAILED_REQUEST_ID = encodeClientTurnRequestIdNumber({ value: 41 }); +const RESET_AT_MS = Date.now() + 5 * 60 * 60 * 1_000; +const RATE_LIMITS: ProviderRateLimitState = { + providerId: "codex", + status: "blocked", + kind: "subscription-window", + windows: [ + { + providerKey: "primary", + label: "Current session", + status: "blocked", + usedPercent: 100, + resetsAtMs: RESET_AT_MS, + modelIds: [], + }, + ], + reachedReason: "rate_limit_reached", + overageStatus: null, + overageReason: null, + observedAtMs: Date.now(), + source: "codex-account", +}; + +function seedFailedRateLimitedTurn( + harness: TestAppHarness, + options: { withOutput?: boolean; willRetry?: boolean } = {}, +) { + const { host } = seedHostSession(harness.deps); + const { project } = seedProjectWithSource(harness.deps, { + hostId: host.id, + }); + const environment = seedEnvironment(harness.deps, { + hostId: host.id, + projectId: project.id, + }); + const thread = seedThread(harness.deps, { + environmentId: environment.id, + projectId: project.id, + providerId: "codex", + status: "error", + }); + const providerThreadId = "provider-thread-rate-limited"; + const turnId = "turn-rate-limited"; + seedEvent(harness.deps, { + threadId: thread.id, + environmentId: environment.id, + providerThreadId, + sequence: 1, + type: "thread/identity", + scope: threadScope(), + data: {}, + }); + seedEvent(harness.deps, { + threadId: thread.id, + environmentId: environment.id, + sequence: 2, + type: "client/turn/requested", + scope: threadScope(), + data: { + direction: "outbound", + requestId: FAILED_REQUEST_ID, + source: "tell", + initiator: "user", + senderThreadId: null, + input: [{ type: "text", text: "Finish the task", mentions: [] }], + target: { kind: "new-turn" }, + request: { method: "turn/start", params: {} }, + execution: { + model: "gpt-5", + serviceTier: "default", + reasoningLevel: "medium", + permissionMode: "full", + source: "client/turn/requested", + }, + }, + }); + seedEvent(harness.deps, { + threadId: thread.id, + environmentId: environment.id, + providerThreadId, + sequence: 3, + type: "turn/started", + scope: turnScope(turnId), + data: { providerThreadId }, + }); + seedEvent(harness.deps, { + threadId: thread.id, + environmentId: environment.id, + providerThreadId, + sequence: 4, + type: "turn/input/accepted", + scope: turnScope(turnId), + data: { providerThreadId, clientRequestId: FAILED_REQUEST_ID }, + }); + seedEvent(harness.deps, { + threadId: thread.id, + environmentId: environment.id, + providerThreadId, + sequence: 5, + type: "provider/rateLimits/updated", + scope: threadScope(), + data: { providerThreadId, rateLimits: RATE_LIMITS }, + }); + seedEvent(harness.deps, { + threadId: thread.id, + environmentId: environment.id, + providerThreadId, + sequence: 6, + type: "provider/error", + scope: turnScope(turnId), + data: { + providerThreadId, + message: "Usage limit reached", + ...(options.willRetry === undefined + ? {} + : { willRetry: options.willRetry }), + errorInfo: { + category: "rate-limit", + providerCode: "usage_limit_reached", + httpStatusCode: 429, + }, + }, + }); + let nextSequence = 7; + if (options.withOutput) { + seedEvent(harness.deps, { + threadId: thread.id, + environmentId: environment.id, + providerThreadId, + sequence: nextSequence, + type: "turn/plan/updated", + scope: turnScope(turnId), + data: { + providerThreadId, + plan: [{ step: "Started work", status: "active" }], + }, + }); + nextSequence += 1; + } + seedEvent(harness.deps, { + threadId: thread.id, + environmentId: environment.id, + providerThreadId, + sequence: nextSequence, + type: "turn/completed", + scope: turnScope(turnId), + data: { providerThreadId, status: "failed" }, + }); + return { environment, host, project, thread, turnId }; +} + +describe("provider rate-limit recovery", () => { + it("identifies an accepted, empty subscription-limited turn", async () => { + await withTestHarness(async (harness) => { + const fixture = seedFailedRateLimitedTurn(harness); + const status = getProviderRateLimitRecoveryStatus(harness.deps, { + environment: fixture.environment, + thread: fixture.thread, + }); + + expect(status).toEqual({ + reason: "eligible", + scopeKey: `${fixture.host.id}:codex`, + rateLimits: RATE_LIMITS, + candidate: { + failedRequestId: FAILED_REQUEST_ID, + turnId: fixture.turnId, + scopeKey: `${fixture.host.id}:codex`, + resetsAtMs: RESET_AT_MS, + rateLimits: RATE_LIMITS, + }, + }); + }); + }); + + it("fails closed after output and while the provider owns retries", async () => { + await withTestHarness(async (harness) => { + const outputFixture = seedFailedRateLimitedTurn(harness, { + withOutput: true, + }); + expect( + getProviderRateLimitRecoveryStatus(harness.deps, { + environment: outputFixture.environment, + thread: outputFixture.thread, + }).reason, + ).toBe("output-or-side-effect-observed"); + }); + + await withTestHarness(async (harness) => { + const retryFixture = seedFailedRateLimitedTurn(harness, { + willRetry: true, + }); + expect( + getProviderRateLimitRecoveryStatus(harness.deps, { + environment: retryFixture.environment, + thread: retryFixture.thread, + }).reason, + ).toBe("provider-will-retry"); + }); + }); + + it("starts one hidden system continuation with explicit lineage", async () => { + await withTestHarness(async (harness) => { + const fixture = seedFailedRateLimitedTurn(harness); + const response = await harness.app.request( + `/api/v1/threads/${fixture.thread.id}/rate-limit-recovery/continue`, + { + method: "POST", + headers: { "content-type": "application/json" }, + body: JSON.stringify({ expectedRequestId: FAILED_REQUEST_ID }), + }, + ); + expect(response.status).toBe(200); + const body = await readJson(response); + expect(body).toMatchObject({ ok: true }); + + const thread = getThread(harness.db, fixture.thread.id); + expect(thread?.status).toBe("active"); + const continuation = listEvents(harness.db, { + threadId: fixture.thread.id, + }) + .map((row) => + parseStoredThreadEvent({ + type: row.type, + data: JSON.parse(row.data) as Record, + providerThreadId: row.providerThreadId, + scope: + row.scopeKind === "turn" && row.turnId + ? turnScope(row.turnId) + : threadScope(), + threadId: row.threadId, + }), + ) + .find( + (event) => + event.type === "client/turn/requested" && + event.continuationOfRequestId === FAILED_REQUEST_ID, + ); + expect(continuation).toMatchObject({ + type: "client/turn/requested", + initiator: "system", + continuationOfRequestId: FAILED_REQUEST_ID, + input: [ + { + type: "text", + text: "Please continue.", + visibility: "agent-only", + }, + ], + }); + expect( + listQueuedThreadCommands(harness, "turn.submit", fixture.thread.id), + ).toHaveLength(1); + + const repeated = await harness.app.request( + `/api/v1/threads/${fixture.thread.id}/rate-limit-recovery/continue`, + { + method: "POST", + headers: { "content-type": "application/json" }, + body: JSON.stringify({ expectedRequestId: FAILED_REQUEST_ID }), + }, + ); + expect(repeated.status).toBe(409); + expect( + listQueuedThreadCommands(harness, "turn.submit", fixture.thread.id), + ).toHaveLength(1); + }); + }); +}); diff --git a/packages/db/src/data/events.ts b/packages/db/src/data/events.ts index 3a9ac0fd1a..955576c1fe 100644 --- a/packages/db/src/data/events.ts +++ b/packages/db/src/data/events.ts @@ -738,6 +738,11 @@ export interface FindStoredEventRowArgs { type: ThreadEventType; } +export interface GetLatestStoredEventRowByTypeArgs { + threadId: string; + type: ThreadEventType; +} + export interface ListStoredEventRowsInRangeArgs { seqEnd: number; seqStart: number; @@ -1099,8 +1104,23 @@ export function findStoredEventRow( ); } +export function getLatestStoredEventRowByType( + db: DbQueryConnection, + args: GetLatestStoredEventRowByTypeArgs, +): StoredEventRow | null { + return ( + db + .select(storedEventRowFields) + .from(events) + .where(and(eq(events.threadId, args.threadId), eq(events.type, args.type))) + .orderBy(desc(events.sequence)) + .limit(1) + .get() ?? null + ); +} + export function listStoredEventRowsInRange( - db: DbConnection, + db: DbQueryConnection, args: ListStoredEventRowsInRangeArgs, ): StoredEventRow[] { return db diff --git a/packages/db/src/data/index.ts b/packages/db/src/data/index.ts index 6ae3e5cd1a..310a92bbca 100644 --- a/packages/db/src/data/index.ts +++ b/packages/db/src/data/index.ts @@ -306,6 +306,7 @@ export { getLatestThreadOutputEventRow, getLatestThreadSystemErrorEventRow, getLatestThreadSequence, + getLatestStoredEventRowByType, insertEvents, listActiveBackgroundTaskCountsByThreadIds, listContextWindowUsageRows, diff --git a/packages/domain/src/thread-events.ts b/packages/domain/src/thread-events.ts index cc50df4780..73b0c2927d 100644 --- a/packages/domain/src/thread-events.ts +++ b/packages/domain/src/thread-events.ts @@ -132,6 +132,8 @@ export type ClientTurnLifecycleEventData = z.infer< export const turnRequestEventDataSchema = z.object({ direction: z.literal("outbound"), requestId: clientTurnRequestIdSchema, + /** Failed request resumed by a guarded system continuation, when present. */ + continuationOfRequestId: clientTurnRequestIdSchema.optional(), source: z.enum(["spawn", "tell"]), initiator: threadTurnInitiatorSchema, // Non-null only when initiator === "agent". The invariant is enforced by diff --git a/packages/sdk/src/areas/threads.ts b/packages/sdk/src/areas/threads.ts index 0eabbb7da1..03527f13d9 100644 --- a/packages/sdk/src/areas/threads.ts +++ b/packages/sdk/src/areas/threads.ts @@ -12,10 +12,12 @@ import { import { threadTabsResponseSchema } from "@bb/server-contract"; import type { CreateQueuedMessageRequest, + ContinueAfterProviderRateLimitResponse, CreateThreadRequest, ForkThreadRequest, DeleteThreadRequest, PromptHistoryResponse, + ProviderRateLimitRecoveryStatus, SendQueuedMessageResponse, ThreadArchiveAllResponse, ThreadChildSummaryResponse, @@ -108,6 +110,9 @@ export type ThreadOpenResult = ThreadOpenResponse; export type ThreadPaneActionResult = ThreadPaneActionResponse; export type ThreadDeleteResult = { ok: true }; export type ThreadSendResult = { ok: true }; +export type ThreadRateLimitRecoveryResult = ProviderRateLimitRecoveryStatus; +export type ThreadContinueAfterRateLimitResult = + ContinueAfterProviderRateLimitResponse; export type ThreadStopResult = { ok: true }; export type ThreadBannerActionResult = { ok: true }; export type ThreadUnarchiveResult = { ok: true }; @@ -181,6 +186,10 @@ export interface ThreadActionArgs { threadId: string; } +export interface ThreadContinueAfterRateLimitArgs extends ThreadActionArgs { + expectedRequestId: string; +} + export interface ThreadStatusArgs extends ThreadActionArgs { signal?: AbortSignal; } @@ -408,6 +417,9 @@ export interface ThreadsArea { archive(args: ThreadActionArgs): Promise; archiveAll(args: ThreadActionArgs): Promise; childSummary(args: ThreadStatusArgs): Promise; + continueAfterRateLimit( + args: ThreadContinueAfterRateLimitArgs, + ): Promise; cancelPlan(args: ThreadActionArgs): Promise; clearGoal(args: ThreadActionArgs): Promise; conversationOutline( @@ -432,6 +444,9 @@ export interface ThreadsArea { args: ThreadPromptHistoryArgs, ): Promise; queuedMessages: ThreadQueuedMessagesArea; + rateLimitRecovery( + args: ThreadStatusArgs, + ): Promise; reorderPinned(args: ThreadPinOrderArgs): Promise; search(args: ThreadSearchArgs): Promise; send(args: ThreadSendArgs): Promise; @@ -937,6 +952,22 @@ export function createThreadsArea(args: CreateSdkAreaArgs): ThreadsArea { }), ); }, + async rateLimitRecovery(input) { + return transport.readJson( + transport.api.v1.threads[":id"]["rate-limit-recovery"].$get( + { param: { id: input.threadId } }, + ...signalRequestArgs(input.signal), + ), + ); + }, + async continueAfterRateLimit(input) { + return transport.readJson( + transport.api.v1.threads[":id"]["rate-limit-recovery"].continue.$post({ + param: { id: input.threadId }, + json: { expectedRequestId: input.expectedRequestId }, + }), + ); + }, async output(input) { return transport.readJson( transport.api.v1.threads[":id"].output.$get( diff --git a/packages/sdk/test/public-types.test.ts b/packages/sdk/test/public-types.test.ts index 54c1e96d17..2c775840fd 100644 --- a/packages/sdk/test/public-types.test.ts +++ b/packages/sdk/test/public-types.test.ts @@ -351,6 +351,7 @@ type ExpectedThreadsKey = | "cancelPlan" | "childSummary" | "clearGoal" + | "continueAfterRateLimit" | "conversationOutline" | "defaultExecutionOptions" | "delete" @@ -367,6 +368,7 @@ type ExpectedThreadsKey = | "pin" | "promptHistory" | "queuedMessages" + | "rateLimitRecovery" | "reorderPinned" | "search" | "send" diff --git a/packages/server-contract/src/api/threads.ts b/packages/server-contract/src/api/threads.ts index 2111529dac..649c7ff721 100644 --- a/packages/server-contract/src/api/threads.ts +++ b/packages/server-contract/src/api/threads.ts @@ -1,6 +1,7 @@ import { z } from "zod"; import { activeThinkingSchema, + clientTurnRequestIdSchema, callerExecutionInputSourceSchema, environmentSchema, hostSchema, @@ -9,6 +10,7 @@ import { pendingInteractionSchema, permissionModeInputSchema, promptInputSchema, + providerRateLimitStateSchema, reasoningLevelSchema, resolvedThreadExecutionOptionsSchema, serviceTierSchema, @@ -216,6 +218,59 @@ export const sendMessageRequestSchema = z.object({ }); export type SendMessageRequest = z.infer; +export const providerRateLimitRecoveryReasonSchema = z.enum([ + "eligible", + "thread-not-failed", + "no-failed-turn", + "input-not-accepted", + "no-rate-limit-state", + "provider-will-retry", + "not-subscription-window", + "reset-unavailable", + "output-or-side-effect-observed", + "superseded", + "execution-unavailable", +]); +export type ProviderRateLimitRecoveryReason = z.infer< + typeof providerRateLimitRecoveryReasonSchema +>; + +export const providerRateLimitRecoveryCandidateSchema = z.object({ + failedRequestId: clientTurnRequestIdSchema, + turnId: z.string().min(1), + scopeKey: z.string().min(1), + resetsAtMs: z.number().int().nonnegative(), + rateLimits: providerRateLimitStateSchema, +}); +export type ProviderRateLimitRecoveryCandidate = z.infer< + typeof providerRateLimitRecoveryCandidateSchema +>; + +export const providerRateLimitRecoveryStatusSchema = z.object({ + reason: providerRateLimitRecoveryReasonSchema, + scopeKey: z.string().min(1), + rateLimits: providerRateLimitStateSchema.nullable(), + candidate: providerRateLimitRecoveryCandidateSchema.nullable(), +}); +export type ProviderRateLimitRecoveryStatus = z.infer< + typeof providerRateLimitRecoveryStatusSchema +>; + +export const continueAfterProviderRateLimitRequestSchema = z + .object({ expectedRequestId: clientTurnRequestIdSchema }) + .strict(); +export type ContinueAfterProviderRateLimitRequest = z.infer< + typeof continueAfterProviderRateLimitRequestSchema +>; + +export const continueAfterProviderRateLimitResponseSchema = z.object({ + ok: z.literal(true), + requestId: clientTurnRequestIdSchema, +}); +export type ContinueAfterProviderRateLimitResponse = z.infer< + typeof continueAfterProviderRateLimitResponseSchema +>; + export const sendQueuedMessageModeSchema = z.enum(["auto", "steer"]); export type SendQueuedMessageMode = z.infer; diff --git a/packages/server-contract/src/public-api.ts b/packages/server-contract/src/public-api.ts index 5ccf11632e..828b95e5e1 100644 --- a/packages/server-contract/src/public-api.ts +++ b/packages/server-contract/src/public-api.ts @@ -50,6 +50,8 @@ import type { CloseTerminalRequest, CommandListResponse, CopyProjectAttachmentsRequest, + ContinueAfterProviderRateLimitRequest, + ContinueAfterProviderRateLimitResponse, CreateHostJoinCodeRequest, CreateHostJoinCodeResponse, CreateTerminalRequest, @@ -182,6 +184,7 @@ import type { ThreadOpenResponse, ThreadPaneActionRequest, ThreadPaneActionResponse, + ProviderRateLimitRecoveryStatus, ThreadPendingInteractionsResponse, ThreadQueuedMessageListResponse, ThreadResponse, @@ -218,6 +221,7 @@ import { updateThreadTabsRequestSchema } from "./api/thread-tabs.js"; import { closeTerminalRequestSchema, copyProjectAttachmentsRequestSchema, + continueAfterProviderRateLimitRequestSchema, createFilePreviewRequestSchema, createThreadSectionRequestSchema, deleteThreadSectionRequestSchema, @@ -964,6 +968,20 @@ export const publicApiRoutes = { ), response: jsonResponse<{ ok: true }>(), }), + rateLimitRecovery: defineRoute({ + path: "/threads/:id/rate-limit-recovery", + method: "get", + request: noRequest(), + response: jsonResponse(), + }), + continueAfterRateLimit: defineRoute({ + path: "/threads/:id/rate-limit-recovery/continue", + method: "post", + request: jsonRequest( + continueAfterProviderRateLimitRequestSchema, + ), + response: jsonResponse(), + }), /** @deprecated App code uses dedicated composer queries. */ composerBootstrap: defineRoute({ path: "/threads/:id/composer-bootstrap", diff --git a/packages/thread-view/src/event-decode.ts b/packages/thread-view/src/event-decode.ts index fc4f7044f4..a19139c274 100644 --- a/packages/thread-view/src/event-decode.ts +++ b/packages/thread-view/src/event-decode.ts @@ -37,6 +37,7 @@ export function getEventProviderThreadId( case "provider/error": case "provider/warning": case "provider/modelFallback": + case "provider/rateLimits/updated": case "provider/unhandled": return decoded.providerThreadId; case "turn/completed": @@ -94,6 +95,7 @@ export function getEventParentToolCallId( case "provider/error": case "provider/warning": case "provider/modelFallback": + case "provider/rateLimits/updated": case "client/thread/start": case "client/turn/requested": case "client/turn/start": From 37cdf530c7ec1df92c1fc0fd22289572c8a780df Mon Sep 17 00:00:00 2001 From: Michael Yong Date: Wed, 5 Aug 2026 11:14:42 -0700 Subject: [PATCH 03/21] feat: expose manual rate limit recovery --- .../threads/provider-rate-limit-recovery.ts | 32 +++++--- .../provider-rate-limit-recovery.test.ts | 81 ++++++++++++++++++- packages/server-contract/src/api/threads.ts | 8 +- 3 files changed, 103 insertions(+), 18 deletions(-) diff --git a/apps/server/src/services/threads/provider-rate-limit-recovery.ts b/apps/server/src/services/threads/provider-rate-limit-recovery.ts index 06db50002a..f9fbc6a5b0 100644 --- a/apps/server/src/services/threads/provider-rate-limit-recovery.ts +++ b/apps/server/src/services/threads/provider-rate-limit-recovery.ts @@ -73,10 +73,11 @@ const SAFE_EMPTY_TURN_EVENT_TYPES = new Set([ ]); interface InternalRecoveryCandidate { + automatic: boolean; execution: ResolvedThreadExecutionOptions; failedRequestId: ClientTurnRequestId; rateLimits: ProviderRateLimitState; - resetsAtMs: number; + resetsAtMs: number | null; turnId: string; } @@ -105,6 +106,7 @@ function emptyInspection( status: { reason, scopeKey: scopeKey(args.environment, args.thread), + hostId: args.environment.hostId, rateLimits, candidate: null, }, @@ -238,14 +240,6 @@ function inspectRecovery(args: InspectRecoveryArgs): RecoveryInspection { ) { return emptyInspection(args, "provider-will-retry", turnRateLimits); } - if (turnRateLimits.kind !== "subscription-window") { - return emptyInspection(args, "not-subscription-window", turnRateLimits); - } - - const resetsAtMs = recoveryResetAtMs(turnRateLimits); - if (resetsAtMs === null) { - return emptyInspection(args, "reset-unavailable", turnRateLimits); - } if (hasOutputOrSideEffect(events, turnId)) { return emptyInspection( args, @@ -261,25 +255,37 @@ function inspectRecovery(args: InspectRecoveryArgs): RecoveryInspection { return emptyInspection(args, "execution-unavailable", turnRateLimits); } const failedRequestId = clientTurnRequestIdSchema.parse(request.requestId); + const currentBlockedRateLimits = + observedRateLimits?.status === "blocked" + ? observedRateLimits + : turnRateLimits; + const resetsAtMs = recoveryResetAtMs(currentBlockedRateLimits); + const automatic = + currentBlockedRateLimits.kind === "subscription-window" && + resetsAtMs !== null; const candidate: InternalRecoveryCandidate = { + automatic, execution: execution.data, failedRequestId, - rateLimits: turnRateLimits, + rateLimits: currentBlockedRateLimits, resetsAtMs, turnId, }; return { candidate, status: { - reason: "eligible", + reason: automatic ? "eligible" : "manual-only", scopeKey: scopeKey(args.environment, args.thread), - rateLimits: turnRateLimits, + hostId: args.environment.hostId, + rateLimits: observedRateLimits ?? turnRateLimits, candidate: { + automatic, failedRequestId, turnId, scopeKey: scopeKey(args.environment, args.thread), + hostId: args.environment.hostId, resetsAtMs, - rateLimits: turnRateLimits, + rateLimits: currentBlockedRateLimits, }, }, }; diff --git a/apps/server/test/services/threads/provider-rate-limit-recovery.test.ts b/apps/server/test/services/threads/provider-rate-limit-recovery.test.ts index 6cacd6a120..5321318e92 100644 --- a/apps/server/test/services/threads/provider-rate-limit-recovery.test.ts +++ b/apps/server/test/services/threads/provider-rate-limit-recovery.test.ts @@ -47,7 +47,11 @@ const RATE_LIMITS: ProviderRateLimitState = { function seedFailedRateLimitedTurn( harness: TestAppHarness, - options: { withOutput?: boolean; willRetry?: boolean } = {}, + options: { + rateLimits?: ProviderRateLimitState; + withOutput?: boolean; + willRetry?: boolean; + } = {}, ) { const { host } = seedHostSession(harness.deps); const { project } = seedProjectWithSource(harness.deps, { @@ -65,6 +69,7 @@ function seedFailedRateLimitedTurn( }); const providerThreadId = "provider-thread-rate-limited"; const turnId = "turn-rate-limited"; + const rateLimits = options.rateLimits ?? RATE_LIMITS; seedEvent(harness.deps, { threadId: thread.id, environmentId: environment.id, @@ -123,7 +128,7 @@ function seedFailedRateLimitedTurn( sequence: 5, type: "provider/rateLimits/updated", scope: threadScope(), - data: { providerThreadId, rateLimits: RATE_LIMITS }, + data: { providerThreadId, rateLimits }, }); seedEvent(harness.deps, { threadId: thread.id, @@ -185,11 +190,14 @@ describe("provider rate-limit recovery", () => { expect(status).toEqual({ reason: "eligible", scopeKey: `${fixture.host.id}:codex`, + hostId: fixture.host.id, rateLimits: RATE_LIMITS, candidate: { failedRequestId: FAILED_REQUEST_ID, turnId: fixture.turnId, scopeKey: `${fixture.host.id}:codex`, + hostId: fixture.host.id, + automatic: true, resetsAtMs: RESET_AT_MS, rateLimits: RATE_LIMITS, }, @@ -223,6 +231,75 @@ describe("provider rate-limit recovery", () => { }); }); + it("allows manual recovery for blocked limits without a reset time", async () => { + await withTestHarness(async (harness) => { + const creditsRateLimits: ProviderRateLimitState = { + ...RATE_LIMITS, + kind: "credits", + windows: [], + }; + const fixture = seedFailedRateLimitedTurn(harness, { + rateLimits: creditsRateLimits, + }); + + expect( + getProviderRateLimitRecoveryStatus(harness.deps, { + environment: fixture.environment, + thread: fixture.thread, + }), + ).toMatchObject({ + reason: "manual-only", + candidate: { + automatic: false, + resetsAtMs: null, + rateLimits: creditsRateLimits, + }, + }); + }); + }); + + it("keeps the safe candidate when a later observation reports allowed", async () => { + await withTestHarness(async (harness) => { + const fixture = seedFailedRateLimitedTurn(harness); + const allowedRateLimits: ProviderRateLimitState = { + ...RATE_LIMITS, + status: "allowed", + windows: RATE_LIMITS.windows.map((window) => ({ + ...window, + status: "allowed", + usedPercent: 0, + })), + observedAtMs: Date.now() + 1, + }; + seedEvent(harness.deps, { + threadId: fixture.thread.id, + environmentId: fixture.environment.id, + providerThreadId: "provider-thread-rate-limited", + sequence: 8, + type: "provider/rateLimits/updated", + scope: threadScope(), + data: { + providerThreadId: "provider-thread-rate-limited", + rateLimits: allowedRateLimits, + }, + }); + + expect( + getProviderRateLimitRecoveryStatus(harness.deps, { + environment: fixture.environment, + thread: fixture.thread, + }), + ).toMatchObject({ + reason: "eligible", + rateLimits: allowedRateLimits, + candidate: { + automatic: true, + rateLimits: RATE_LIMITS, + }, + }); + }); + }); + it("starts one hidden system continuation with explicit lineage", async () => { await withTestHarness(async (harness) => { const fixture = seedFailedRateLimitedTurn(harness); diff --git a/packages/server-contract/src/api/threads.ts b/packages/server-contract/src/api/threads.ts index 649c7ff721..2b0e6d1ab4 100644 --- a/packages/server-contract/src/api/threads.ts +++ b/packages/server-contract/src/api/threads.ts @@ -225,8 +225,7 @@ export const providerRateLimitRecoveryReasonSchema = z.enum([ "input-not-accepted", "no-rate-limit-state", "provider-will-retry", - "not-subscription-window", - "reset-unavailable", + "manual-only", "output-or-side-effect-observed", "superseded", "execution-unavailable", @@ -239,7 +238,9 @@ export const providerRateLimitRecoveryCandidateSchema = z.object({ failedRequestId: clientTurnRequestIdSchema, turnId: z.string().min(1), scopeKey: z.string().min(1), - resetsAtMs: z.number().int().nonnegative(), + hostId: z.string().min(1), + automatic: z.boolean(), + resetsAtMs: z.number().int().nonnegative().nullable(), rateLimits: providerRateLimitStateSchema, }); export type ProviderRateLimitRecoveryCandidate = z.infer< @@ -249,6 +250,7 @@ export type ProviderRateLimitRecoveryCandidate = z.infer< export const providerRateLimitRecoveryStatusSchema = z.object({ reason: providerRateLimitRecoveryReasonSchema, scopeKey: z.string().min(1), + hostId: z.string().min(1), rateLimits: providerRateLimitStateSchema.nullable(), candidate: providerRateLimitRecoveryCandidateSchema.nullable(), }); From 162431708be53f990385e6c44903261b59faaa97 Mon Sep 17 00:00:00 2001 From: Michael Yong Date: Wed, 5 Aug 2026 11:26:28 -0700 Subject: [PATCH 04/21] feat: add provider retry plugin --- .../src/services/plugins/builtin-registry.ts | 6 + .../services/plugins/builtin-plugins.test.ts | 1 + .../bundled-types/bb-plugin-sdk.d.ts | 181 +++++- plugins/provider-retry/app.test.tsx | 131 +++++ plugins/provider-retry/app.tsx | 226 +++++++ plugins/provider-retry/package.json | 42 ++ plugins/provider-retry/server.test.ts | 296 ++++++++++ plugins/provider-retry/server.ts | 106 ++++ plugins/provider-retry/src/cli.ts | 129 ++++ plugins/provider-retry/src/contract.ts | 60 ++ plugins/provider-retry/src/service.ts | 556 ++++++++++++++++++ plugins/provider-retry/tsconfig.json | 21 + plugins/provider-retry/vitest.config.ts | 10 + pnpm-lock.yaml | 40 ++ 14 files changed, 1800 insertions(+), 5 deletions(-) create mode 100644 plugins/provider-retry/app.test.tsx create mode 100644 plugins/provider-retry/app.tsx create mode 100644 plugins/provider-retry/package.json create mode 100644 plugins/provider-retry/server.test.ts create mode 100644 plugins/provider-retry/server.ts create mode 100644 plugins/provider-retry/src/cli.ts create mode 100644 plugins/provider-retry/src/contract.ts create mode 100644 plugins/provider-retry/src/service.ts create mode 100644 plugins/provider-retry/tsconfig.json create mode 100644 plugins/provider-retry/vitest.config.ts diff --git a/apps/server/src/services/plugins/builtin-registry.ts b/apps/server/src/services/plugins/builtin-registry.ts index 16b86099a2..74688485cc 100644 --- a/apps/server/src/services/plugins/builtin-registry.ts +++ b/apps/server/src/services/plugins/builtin-registry.ts @@ -72,6 +72,12 @@ export const BUILTIN_PLUGINS = [ defaultEnabled: true, category: "Interface", }, + { + name: "provider-retry", + pluginId: "provider-retry", + defaultEnabled: true, + category: "Agent interaction", + }, { name: "secrets", pluginId: "secrets", diff --git a/apps/server/test/services/plugins/builtin-plugins.test.ts b/apps/server/test/services/plugins/builtin-plugins.test.ts index 3853b59ff0..fbe0ca62e2 100644 --- a/apps/server/test/services/plugins/builtin-plugins.test.ts +++ b/apps/server/test/services/plugins/builtin-plugins.test.ts @@ -201,6 +201,7 @@ describe("builtin plugin reconciliation", () => { ["connect", "Smartphone"], ["custom-instructions", "EditFile"], ["inline-vis", "AppWindow"], + ["provider-retry", "ArrowReloadHorizontal"], ["secrets", "Lock"], ["side-chat", "SideChat"], ["workflows", "Workflow"], 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 ceebeb0d5e..c49f78cf69 100644 --- a/packages/plugin-sdk/bundled-types/bb-plugin-sdk.d.ts +++ b/packages/plugin-sdk/bundled-types/bb-plugin-sdk.d.ts @@ -139,7 +139,7 @@ declare const changedMessageSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{ id: z$1.ZodOptional; metadata: z$1.ZodOptional; - eventTypes: z$1.ZodOptional>>>>; + eventTypes: z$1.ZodOptional>>>>; hasPendingInteraction: z$1.ZodOptional; projectId: z$1.ZodOptional; }, z$1.core.$strict>>; @@ -1457,6 +1457,53 @@ declare const threadEventSchema: z$1.ZodPipe; httpStatusCode: z$1.ZodNullable; }, z$1.core.$strip>>; +}, z$1.core.$strip>, z$1.ZodObject<{ + type: z$1.ZodLiteral<"provider/rateLimits/updated">; + threadId: z$1.ZodString; + providerThreadId: z$1.ZodString; + rateLimits: z$1.ZodObject<{ + providerId: z$1.ZodString; + status: z$1.ZodEnum<{ + unknown: "unknown"; + allowed: "allowed"; + warning: "warning"; + blocked: "blocked"; + }>; + kind: z$1.ZodEnum<{ + unknown: "unknown"; + "request-throttle": "request-throttle"; + "subscription-window": "subscription-window"; + credits: "credits"; + "spend-control": "spend-control"; + }>; + windows: z$1.ZodArray; + label: z$1.ZodNullable; + status: z$1.ZodEnum<{ + unknown: "unknown"; + allowed: "allowed"; + warning: "warning"; + blocked: "blocked"; + }>; + usedPercent: z$1.ZodNullable; + resetsAtMs: z$1.ZodNullable; + modelIds: z$1.ZodArray; + }, z$1.core.$strip>>; + reachedReason: z$1.ZodNullable; + overageStatus: z$1.ZodNullable>; + overageReason: z$1.ZodNullable; + observedAtMs: z$1.ZodNumber; + source: z$1.ZodEnum<{ + "codex-account": "codex-account"; + "claude-rate-limit": "claude-rate-limit"; + http: "http"; + }>; + }, z$1.core.$strip>; }, z$1.core.$strip>, z$1.ZodObject<{ type: z$1.ZodLiteral<"provider/warning">; threadId: z$1.ZodString; @@ -1524,6 +1571,7 @@ declare const threadEventSchema: z$1.ZodPipe; requestId: z$1.ZodString; + continuationOfRequestId: z$1.ZodOptional; source: z$1.ZodEnum<{ spawn: "spawn"; tell: "tell"; @@ -2809,32 +2857,32 @@ declare const environmentDiffFileQuerySchema: z$1.ZodDiscriminatedUnion<[z$1.Zod target: z$1.ZodLiteral<"uncommitted">; path: z$1.ZodString; side: z$1.ZodEnum<{ - new: "new"; old: "old"; + new: "new"; }>; }, z$1.core.$strip>, z$1.ZodObject<{ target: z$1.ZodLiteral<"branch_committed">; mergeBaseRef: z$1.ZodString; path: z$1.ZodString; side: z$1.ZodEnum<{ - new: "new"; old: "old"; + new: "new"; }>; }, z$1.core.$strip>, z$1.ZodObject<{ target: z$1.ZodLiteral<"all">; mergeBaseRef: z$1.ZodString; path: z$1.ZodString; side: z$1.ZodEnum<{ - new: "new"; old: "old"; + new: "new"; }>; }, z$1.core.$strip>, z$1.ZodObject<{ target: z$1.ZodLiteral<"commit">; sha: z$1.ZodString; path: z$1.ZodString; side: z$1.ZodEnum<{ - new: "new"; old: "old"; + new: "new"; }>; }, z$1.core.$strip>], "target">; type EnvironmentDiffFileQuery = z$1.infer; @@ -8214,6 +8262,122 @@ declare const sendMessageRequestSchema: z$1.ZodObject<{ senderThreadId: z$1.ZodOptional; }, z$1.core.$strip>; type SendMessageRequest = z$1.infer; +declare const providerRateLimitRecoveryStatusSchema: z$1.ZodObject<{ + reason: z$1.ZodEnum<{ + eligible: "eligible"; + "thread-not-failed": "thread-not-failed"; + "no-failed-turn": "no-failed-turn"; + "input-not-accepted": "input-not-accepted"; + "no-rate-limit-state": "no-rate-limit-state"; + "provider-will-retry": "provider-will-retry"; + "manual-only": "manual-only"; + "output-or-side-effect-observed": "output-or-side-effect-observed"; + superseded: "superseded"; + "execution-unavailable": "execution-unavailable"; + }>; + scopeKey: z$1.ZodString; + hostId: z$1.ZodString; + rateLimits: z$1.ZodNullable; + kind: z$1.ZodEnum<{ + unknown: "unknown"; + "request-throttle": "request-throttle"; + "subscription-window": "subscription-window"; + credits: "credits"; + "spend-control": "spend-control"; + }>; + windows: z$1.ZodArray; + label: z$1.ZodNullable; + status: z$1.ZodEnum<{ + unknown: "unknown"; + warning: "warning"; + blocked: "blocked"; + allowed: "allowed"; + }>; + usedPercent: z$1.ZodNullable; + resetsAtMs: z$1.ZodNullable; + modelIds: z$1.ZodArray; + }, z$1.core.$strip>>; + reachedReason: z$1.ZodNullable; + overageStatus: z$1.ZodNullable>; + overageReason: z$1.ZodNullable; + observedAtMs: z$1.ZodNumber; + source: z$1.ZodEnum<{ + "codex-account": "codex-account"; + "claude-rate-limit": "claude-rate-limit"; + http: "http"; + }>; + }, z$1.core.$strip>>; + candidate: z$1.ZodNullable; + rateLimits: z$1.ZodObject<{ + providerId: z$1.ZodString; + status: z$1.ZodEnum<{ + unknown: "unknown"; + warning: "warning"; + blocked: "blocked"; + allowed: "allowed"; + }>; + kind: z$1.ZodEnum<{ + unknown: "unknown"; + "request-throttle": "request-throttle"; + "subscription-window": "subscription-window"; + credits: "credits"; + "spend-control": "spend-control"; + }>; + windows: z$1.ZodArray; + label: z$1.ZodNullable; + status: z$1.ZodEnum<{ + unknown: "unknown"; + warning: "warning"; + blocked: "blocked"; + allowed: "allowed"; + }>; + usedPercent: z$1.ZodNullable; + resetsAtMs: z$1.ZodNullable; + modelIds: z$1.ZodArray; + }, z$1.core.$strip>>; + reachedReason: z$1.ZodNullable; + overageStatus: z$1.ZodNullable>; + overageReason: z$1.ZodNullable; + observedAtMs: z$1.ZodNumber; + source: z$1.ZodEnum<{ + "codex-account": "codex-account"; + "claude-rate-limit": "claude-rate-limit"; + http: "http"; + }>; + }, z$1.core.$strip>; + }, z$1.core.$strip>>; +}, z$1.core.$strip>; +type ProviderRateLimitRecoveryStatus = z$1.infer; +declare const continueAfterProviderRateLimitResponseSchema: z$1.ZodObject<{ + ok: z$1.ZodLiteral; + requestId: z$1.ZodString; +}, z$1.core.$strip>; +type ContinueAfterProviderRateLimitResponse = z$1.infer; declare const createQueuedMessageRequestSchema: z$1.ZodObject<{ input: z$1.ZodArray; archiveAll(args: ThreadActionArgs): Promise; childSummary(args: ThreadStatusArgs): Promise; + continueAfterRateLimit(args: ThreadContinueAfterRateLimitArgs): Promise; cancelPlan(args: ThreadActionArgs): Promise; clearGoal(args: ThreadActionArgs): Promise; conversationOutline(args: ThreadStatusArgs): Promise; @@ -12231,6 +12401,7 @@ interface ThreadsArea { pin(args: ThreadActionArgs): Promise; promptHistory(args: ThreadPromptHistoryArgs): Promise; queuedMessages: ThreadQueuedMessagesArea; + rateLimitRecovery(args: ThreadStatusArgs): Promise; reorderPinned(args: ThreadPinOrderArgs): Promise; search(args: ThreadSearchArgs): Promise; send(args: ThreadSendArgs): Promise; diff --git a/plugins/provider-retry/app.test.tsx b/plugins/provider-retry/app.test.tsx new file mode 100644 index 0000000000..fef199d684 --- /dev/null +++ b/plugins/provider-retry/app.test.tsx @@ -0,0 +1,131 @@ +// @vitest-environment jsdom +import { cleanup, fireEvent, waitFor } from "@testing-library/react"; +import { afterEach, describe, expect, it, vi } from "vitest"; +import { loadPluginApp, renderSlot } from "@bb/plugin-sdk/testing/app"; +import type { ProviderRetryView } from "./src/contract.js"; + +const app = await loadPluginApp(() => import("./app")); +const banner = app.composerCustomizations[0]!.banners![0]!; + +const waitingView: ProviderRetryView = { + threadId: "thread-one", + failedRequestId: "request-one", + scopeKey: "host-one:claudeCode", + hostId: "host-one", + providerId: "claudeCode", + phase: "waiting-for-reset", + automatic: true, + dueAtMs: Date.parse("2026-08-05T15:12:00.000Z"), + resetsAtMs: Date.parse("2026-08-05T15:11:30.000Z"), + windowLabel: "Five-hour", + kind: "subscription-window", + reachedReason: "rate_limit_reached", + overageReason: null, + recoveryReason: "eligible", + refreshAvailable: true, + refreshError: null, + processLifetime: true, +}; + +afterEach(() => { + cleanup(); + vi.useRealTimers(); +}); + +describe("provider retry app", () => { + it("registers a bare thread composer banner", () => { + expect(app.composerCustomizations).toMatchObject([ + { + id: "provider-retry-status", + scopes: ["thread"], + banners: [{ id: "subscription-recovery", chrome: "bare" }], + }, + ]); + }); + + it("shows the reset and process-lifetime warning", async () => { + const slot = renderSlot( + banner, + {}, + { + composer: { scope: { kind: "thread", threadId: "thread-one" } }, + rpc: { + providerRetryStatus: () => ({ view: waitingView }), + providerRetryNow: () => ({ started: true, view: null }), + providerRetryCancel: () => ({ cancelled: true }), + providerRetryRefresh: () => ({ view: waitingView }), + }, + }, + ); + + expect( + await slot.findByText(/Claude Code five-hour usage limit reached/i), + ).toBeTruthy(); + expect( + slot.getByText(/while this bb server remains running/i), + ).toBeTruthy(); + expect(slot.getByRole("button", { name: "Refresh" })).toBeTruthy(); + expect(slot.getByRole("button", { name: "Retry now" })).toBeTruthy(); + expect(slot.getByRole("button", { name: "Cancel" })).toBeTruthy(); + }); + + it("reacts to backend signals and can continue immediately", async () => { + let current: ProviderRetryView | null = waitingView; + const slot = renderSlot( + banner, + {}, + { + composer: { scope: { kind: "thread", threadId: "thread-one" } }, + rpc: { + providerRetryStatus: () => ({ view: current }), + providerRetryNow: () => { + current = null; + return { started: true, view: null }; + }, + providerRetryCancel: () => ({ cancelled: true }), + providerRetryRefresh: () => ({ view: current }), + }, + }, + ); + fireEvent.click(await slot.findByRole("button", { name: "Retry now" })); + + await waitFor(() => expect(slot.container.childElementCount).toBe(0)); + expect(slot.rpcCalls.map((call) => call.method)).toContain( + "providerRetryNow", + ); + + current = { ...waitingView, phase: "waiting-for-host" }; + await slot.emitRealtime("provider-retry", { threadId: "thread-one" }); + expect(await slot.findByText(/when its host reconnects/i)).toBeTruthy(); + }); + + it("renders credit exhaustion without claiming an automatic reset", async () => { + const slot = renderSlot( + banner, + {}, + { + composer: { scope: { kind: "thread", threadId: "thread-one" } }, + rpc: { + providerRetryStatus: () => ({ + view: { + ...waitingView, + automatic: false, + dueAtMs: null, + resetsAtMs: null, + phase: "blocked", + kind: "credits", + windowLabel: null, + }, + }), + providerRetryNow: () => ({ started: true, view: null }), + providerRetryCancel: () => ({ cancelled: true }), + providerRetryRefresh: () => ({ view: waitingView }), + }, + }, + ); + + expect( + await slot.findByText(/There is no automatic reset time/i), + ).toBeTruthy(); + }); +}); diff --git a/plugins/provider-retry/app.tsx b/plugins/provider-retry/app.tsx new file mode 100644 index 0000000000..6c476085ba --- /dev/null +++ b/plugins/provider-retry/app.tsx @@ -0,0 +1,226 @@ +import { useCallback, useEffect, useRef, useState } from "react"; +import { Button } from "@bb/shared-ui/button"; +import { Icon } from "@bb/shared-ui/icon"; +import { + definePluginApp, + useComposerView, + useRealtime, + useRealtimeConnectionState, + useRpc, +} from "@bb/plugin-sdk/app"; +import type { providerRetryRpcContract } from "./src/contract.js"; +import type { ProviderRetryView } from "./src/contract.js"; + +const REALTIME_CHANNEL = "provider-retry"; + +function providerLabel(providerId: string): string { + switch (providerId) { + case "codex": + return "Codex"; + case "claudeCode": + return "Claude Code"; + default: + return providerId; + } +} + +function resetLabel(dueAtMs: number): string { + return new Intl.DateTimeFormat(undefined, { + weekday: "short", + hour: "numeric", + minute: "2-digit", + }).format(new Date(dueAtMs)); +} + +function limitDescription(view: ProviderRetryView): string { + const provider = providerLabel(view.providerId); + const window = view.windowLabel ? ` ${view.windowLabel.toLowerCase()}` : ""; + if (view.phase === "unsafe") { + return `${provider}${window} usage limit reached, but bb cannot safely continue this turn because output or other work may already have occurred.`; + } + if (view.phase === "blocked") { + const reason = view.reachedReason ?? view.overageReason; + return `${provider} ${view.kind.replaceAll("-", " ")} limit reached${reason ? ` (${reason.replaceAll("_", " ")})` : ""}. There is no automatic reset time.`; + } + if (view.phase === "waiting-for-host") { + return `${provider}${window} usage limit reset passed. This thread will continue when its host reconnects, while this bb server remains running.`; + } + if (view.phase === "releasing") { + return `${provider}${window} usage is available. Continuing this thread…`; + } + if (view.dueAtMs !== null) { + return `${provider}${window} usage limit reached. This thread will continue ${resetLabel(view.dueAtMs)} while this bb server remains running.`; + } + return `${provider}${window} usage limit reached.`; +} + +function payloadThreadId(payload: unknown): string | null { + if (typeof payload !== "object" || payload === null) return null; + const threadId = (payload as { threadId?: unknown }).threadId; + return typeof threadId === "string" ? threadId : null; +} + +function ProviderRetryBanner() { + const composerView = useComposerView(); + if (composerView.scope.kind !== "thread") return null; + return ( + + ); +} + +function ProviderRetryBannerForThread({ threadId }: { threadId: string }) { + const rpc = useRpc(); + const connection = useRealtimeConnectionState(); + const previousConnection = useRef(connection); + const [view, setView] = useState(null); + const [busy, setBusy] = useState<"cancel" | "now" | "refresh" | null>(null); + const [actionError, setActionError] = useState(null); + const [, setClockTick] = useState(0); + + const load = useCallback(async () => { + const result = await rpc.call("providerRetryStatus", { threadId }); + setView(result.view); + }, [rpc, threadId]); + + useEffect(() => { + void load().catch(() => undefined); + }, [load]); + + useRealtime( + REALTIME_CHANNEL, + useCallback( + (payload) => { + if (payloadThreadId(payload) === threadId) { + void load().catch(() => undefined); + } + }, + [load, threadId], + ), + ); + + useEffect(() => { + const reconnected = + connection === "connected" && previousConnection.current !== "connected"; + previousConnection.current = connection; + if (reconnected) void load().catch(() => undefined); + }, [connection, load]); + + useEffect(() => { + if (view?.phase !== "waiting-for-reset" || view.dueAtMs === null) return; + const interval = window.setInterval( + () => setClockTick((tick) => tick + 1), + 1_000, + ); + return () => window.clearInterval(interval); + }, [view?.dueAtMs, view?.phase]); + + const runAction = useCallback( + async (action: "cancel" | "now" | "refresh") => { + setBusy(action); + setActionError(null); + try { + if (action === "cancel") { + await rpc.call("providerRetryCancel", { threadId }); + setView(null); + } else if (action === "now") { + const result = await rpc.call("providerRetryNow", { threadId }); + setView(result.view); + if (!result.started) { + setActionError("This turn is no longer safe to continue."); + } + } else { + const result = await rpc.call("providerRetryRefresh", { threadId }); + setView(result.view); + } + } catch (error) { + setActionError(error instanceof Error ? error.message : String(error)); + } finally { + setBusy(null); + } + }, + [rpc, threadId], + ); + + if (view === null) return null; + const canRefresh = + view.providerId === "codex" || view.providerId === "claudeCode"; + const canRetry = view.failedRequestId !== null && view.phase !== "releasing"; + + return ( +
+
+ +

{limitDescription(view)}

+
+ {view.refreshError === null ? null : ( +

+ Refresh unavailable: {view.refreshError} +

+ )} + {actionError === null ? null : ( +

+ {actionError} +

+ )} +
+ {canRefresh ? ( + + ) : null} + {canRetry ? ( + + ) : null} + +
+
+ ); +} + +export default definePluginApp((app) => { + app.composer.customize({ + id: "provider-retry-status", + scopes: ["thread"], + banners: [ + { + id: "subscription-recovery", + chrome: "bare", + component: ProviderRetryBanner, + }, + ], + }); +}); diff --git a/plugins/provider-retry/package.json b/plugins/provider-retry/package.json new file mode 100644 index 0000000000..8f2981f9e8 --- /dev/null +++ b/plugins/provider-retry/package.json @@ -0,0 +1,42 @@ +{ + "name": "bb-plugin-provider-retry", + "version": "0.1.0", + "private": true, + "type": "module", + "description": "Continue safe turns after Codex and Claude Code subscription limits reset.", + "engines": { + "bb": ">=0.0" + }, + "bb": { + "name": "Provider retry", + "description": "Continue safe turns after Codex and Claude Code subscription limits reset.", + "branding": { + "icon": "ArrowReloadHorizontal" + }, + "server": "./server.ts", + "app": "./app.tsx" + }, + "keywords": [ + "bb-plugin" + ], + "scripts": { + "test": "vitest run --config vitest.config.ts", + "typecheck": "tsc --noEmit" + }, + "dependencies": { + "@bb/shared-ui": "workspace:*", + "zod": "^4.3.6" + }, + "devDependencies": { + "@bb/plugin-sdk": "workspace:*", + "@testing-library/react": "^16.3.2", + "@types/node": "^22.0.0", + "@types/react": "^19.0.0", + "jsdom": "^29.0.1", + "react": "^19.0.0", + "react-dom": "^19.0.0", + "typescript": "npm:@typescript/typescript6@^6.0.2", + "typescript-7": "npm:typescript@^7.0.2", + "vitest": "^4.1.1" + } +} diff --git a/plugins/provider-retry/server.test.ts b/plugins/provider-retry/server.test.ts new file mode 100644 index 0000000000..0ac65fe999 --- /dev/null +++ b/plugins/provider-retry/server.test.ts @@ -0,0 +1,296 @@ +import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; +import { + createFakePluginHost, + makeThreadResponse, +} from "@bb/plugin-sdk/testing"; +import plugin from "./server.js"; +import { RELEASE_PACE_MS, RESET_BUFFER_MS } from "./src/service.js"; + +const NOW_MS = Date.parse("2026-08-05T12:00:00.000Z"); +const RESET_AT_MS = NOW_MS + 5 * 60 * 60 * 1_000; + +function rateLimits(status: "allowed" | "blocked" = "blocked") { + return { + providerId: "codex", + status, + kind: "subscription-window", + windows: [ + { + providerKey: "primary", + label: "Current session", + status, + usedPercent: status === "blocked" ? 100 : 25, + resetsAtMs: RESET_AT_MS, + modelIds: [], + }, + ], + reachedReason: status === "blocked" ? "rate_limit_reached" : null, + overageStatus: null, + overageReason: null, + observedAtMs: NOW_MS, + source: "codex-account", + } as const; +} + +function eligibleStatus(threadId: string) { + const limits = rateLimits(); + return { + reason: "eligible", + scopeKey: "host-one:codex", + hostId: "host-one", + rateLimits: limits, + candidate: { + failedRequestId: `request-${threadId}`, + turnId: `turn-${threadId}`, + scopeKey: "host-one:codex", + hostId: "host-one", + automatic: true, + resetsAtMs: RESET_AT_MS, + rateLimits: limits, + }, + } as const; +} + +function manualStatus(threadId: string) { + const limits = { + ...rateLimits(), + kind: "credits" as const, + windows: [], + }; + return { + reason: "manual-only", + scopeKey: "host-one:codex", + hostId: "host-one", + rateLimits: limits, + candidate: { + failedRequestId: `request-${threadId}`, + turnId: `turn-${threadId}`, + scopeKey: "host-one:codex", + hostId: "host-one", + automatic: false, + resetsAtMs: null, + rateLimits: limits, + }, + } as const; +} + +async function flushPromises() { + await Promise.resolve(); + await Promise.resolve(); +} + +beforeEach(() => { + vi.useFakeTimers(); + vi.setSystemTime(NOW_MS); + vi.spyOn(Math, "random").mockReturnValue(0); +}); + +afterEach(() => { + vi.restoreAllMocks(); + vi.useRealTimers(); +}); + +describe("provider retry scheduler", () => { + it("waits for the reset buffer and paces threads sharing one account", async () => { + const continueAfterRateLimit = vi.fn(async () => ({ + ok: true as const, + requestId: "continuation-request", + })); + const host = createFakePluginHost({ + pluginId: "provider-retry", + sdk: { + threads: { + rateLimitRecovery: async ({ threadId }) => eligibleStatus(threadId), + continueAfterRateLimit, + }, + }, + }); + await plugin(host.bb); + + for (const threadId of ["thread-b", "thread-a"]) { + await host.harness.emitThreadEvent("thread.failed", { + thread: makeThreadResponse({ id: threadId, status: "error" }), + error: "Usage limit reached", + }); + } + + await vi.advanceTimersByTimeAsync(5 * 60 * 60 * 1_000 + RESET_BUFFER_MS); + expect(continueAfterRateLimit).toHaveBeenCalledTimes(1); + expect(continueAfterRateLimit).toHaveBeenLastCalledWith({ + threadId: "thread-a", + expectedRequestId: "request-thread-a", + }); + + await vi.advanceTimersByTimeAsync(RELEASE_PACE_MS); + expect(continueAfterRateLimit).toHaveBeenCalledTimes(2); + expect(continueAfterRateLimit).toHaveBeenLastCalledWith({ + threadId: "thread-b", + expectedRequestId: "request-thread-b", + }); + await host.harness.dispose(); + }); + + it("keeps credit exhaustion manual but allows Retry now", async () => { + const continueAfterRateLimit = vi.fn(async () => ({ + ok: true as const, + requestId: "continuation-request", + })); + const host = createFakePluginHost({ + pluginId: "provider-retry", + sdk: { + threads: { + rateLimitRecovery: async ({ threadId }) => manualStatus(threadId), + continueAfterRateLimit, + }, + }, + }); + await plugin(host.bb); + await host.harness.emitThreadEvent("thread.failed", { + thread: makeThreadResponse({ id: "thread-credits", status: "error" }), + error: "Credits exhausted", + }); + + expect( + await host.harness.callRpc("providerRetryStatus", { + threadId: "thread-credits", + }), + ).toMatchObject({ + view: { + phase: "blocked", + automatic: false, + dueAtMs: null, + kind: "credits", + }, + }); + expect( + await host.harness.callRpc("providerRetryNow", { + threadId: "thread-credits", + }), + ).toEqual({ started: true, view: null }); + expect(continueAfterRateLimit).toHaveBeenCalledOnce(); + await host.harness.dispose(); + }); + + it("refreshes usage and releases all waiting threads early", async () => { + const continueAfterRateLimit = vi.fn(async () => ({ + ok: true as const, + requestId: "continuation-request", + })); + const host = createFakePluginHost({ + pluginId: "provider-retry", + sdk: { + system: { + usageLimits: async () => ({ + codex: { + status: "ok" as const, + accountEmail: null, + planLabel: "Plus", + windows: [ + { + label: "Current session", + usedPercent: 20, + resetsAt: new Date(RESET_AT_MS).toISOString(), + }, + ], + }, + claudeCode: { status: "unauthenticated" as const }, + cursor: { status: "unauthenticated" as const }, + }), + }, + threads: { + rateLimitRecovery: async ({ threadId }) => eligibleStatus(threadId), + continueAfterRateLimit, + }, + }, + }); + await plugin(host.bb); + for (const threadId of ["thread-a", "thread-b"]) { + await host.harness.emitThreadEvent("thread.failed", { + thread: makeThreadResponse({ id: threadId, status: "error" }), + error: "Usage limit reached", + }); + } + + await host.harness.callRpc("providerRetryRefresh", { + threadId: "thread-a", + }); + await vi.advanceTimersByTimeAsync(0); + expect(continueAfterRateLimit).toHaveBeenCalledTimes(1); + await vi.advanceTimersByTimeAsync(RELEASE_PACE_MS); + expect(continueAfterRateLimit).toHaveBeenCalledTimes(2); + await host.harness.dispose(); + }); + + it("retains a job while the host is unavailable and retries on host change", async () => { + const continueAfterRateLimit = vi + .fn() + .mockRejectedValueOnce(new Error("Host is not connected")) + .mockResolvedValueOnce({ ok: true, requestId: "continuation-request" }); + const subscription = { hostChanged: null as (() => void) | null }; + const host = createFakePluginHost({ + pluginId: "provider-retry", + sdk: { + subscribe: ({ event, callback }) => { + if (event === "host:changed") { + subscription.hostChanged = () => + callback({ + type: "changed", + entity: "host", + id: "host-one", + changes: ["host-connected"], + }); + } + return () => undefined; + }, + threads: { + rateLimitRecovery: async ({ threadId }) => eligibleStatus(threadId), + continueAfterRateLimit, + }, + }, + }); + await plugin(host.bb); + const running = host.harness.runService("provider-retry-scheduler"); + await host.harness.emitThreadEvent("thread.failed", { + thread: makeThreadResponse({ id: "thread-host", status: "error" }), + error: "Usage limit reached", + }); + await vi.advanceTimersByTimeAsync(5 * 60 * 60 * 1_000 + RESET_BUFFER_MS); + + expect( + await host.harness.callRpc("providerRetryStatus", { + threadId: "thread-host", + }), + ).toMatchObject({ view: { phase: "waiting-for-host" } }); + expect(subscription.hostChanged).not.toBeNull(); + subscription.hostChanged?.(); + await vi.advanceTimersByTimeAsync(0); + expect(continueAfterRateLimit).toHaveBeenCalledTimes(2); + + running.controller.abort(); + await running.done; + await host.harness.dispose(); + }); + + it("clears in-memory timers when the plugin is disposed", async () => { + const continueAfterRateLimit = vi.fn(); + const host = createFakePluginHost({ + pluginId: "provider-retry", + sdk: { + threads: { + rateLimitRecovery: async ({ threadId }) => eligibleStatus(threadId), + continueAfterRateLimit, + }, + }, + }); + await plugin(host.bb); + await host.harness.emitThreadEvent("thread.failed", { + thread: makeThreadResponse({ id: "thread-dispose", status: "error" }), + error: "Usage limit reached", + }); + await host.harness.dispose(); + + await vi.advanceTimersByTimeAsync(6 * 60 * 60 * 1_000); + await flushPromises(); + expect(continueAfterRateLimit).not.toHaveBeenCalled(); + }); +}); diff --git a/plugins/provider-retry/server.ts b/plugins/provider-retry/server.ts new file mode 100644 index 0000000000..e620d1c3fa --- /dev/null +++ b/plugins/provider-retry/server.ts @@ -0,0 +1,106 @@ +import type { BbPluginApi } from "@bb/plugin-sdk"; +import { registerProviderRetryCli } from "./src/cli.js"; +import { providerRetryRpcContract } from "./src/contract.js"; +import { ProviderRetryService } from "./src/service.js"; + +function waitForAbort(signal: AbortSignal): Promise { + if (signal.aborted) return Promise.resolve(); + return new Promise((resolve) => { + signal.addEventListener("abort", () => resolve(), { once: true }); + }); +} + +function logFailure(bb: BbPluginApi, operation: string, error: unknown): void { + bb.log.warn( + `${operation}: ${error instanceof Error ? error.message : String(error)}`, + ); +} + +export default async function plugin(bb: BbPluginApi) { + const service = new ProviderRetryService(bb); + bb.onDispose(() => service.dispose()); + + bb.rpc.register(providerRetryRpcContract, { + async providerRetryStatus({ threadId }) { + return { view: service.status(threadId) }; + }, + async providerRetryNow({ threadId }) { + const started = await service.retryNow(threadId); + return { started, view: service.status(threadId) }; + }, + providerRetryCancel({ threadId }) { + return { cancelled: service.cancel(threadId) }; + }, + async providerRetryRefresh({ threadId }) { + return { view: await service.refresh(threadId) }; + }, + }); + registerProviderRetryCli(bb, service); + + bb.events.on("thread.failed", async ({ thread }) => { + try { + await service.reconcile(thread.id); + } catch (error) { + logFailure( + bb, + `Could not inspect provider retry for ${thread.id}`, + error, + ); + } + }); + bb.events.on("thread.active", ({ thread }) => service.supersede(thread.id)); + bb.events.on("thread.idle", ({ thread }) => service.supersede(thread.id)); + bb.events.on("thread.archived", ({ thread }) => service.supersede(thread.id)); + bb.events.on("thread.deleted", ({ thread }) => service.supersede(thread.id)); + + bb.background.service("provider-retry-scheduler", { + async start(signal) { + const unsubscribeThread = bb.sdk.subscribe({ + event: "thread:changed", + callback: (event) => { + if (event.id === undefined || service.status(event.id) === null) + return; + void service + .reconcile(event.id) + .catch((error) => + logFailure( + bb, + `Could not refresh provider retry for ${event.id}`, + error, + ), + ); + }, + }); + const unsubscribeHost = bb.sdk.subscribe({ + event: "host:changed", + callback: (event) => { + if (event.id !== undefined) service.hostChanged(event.id); + }, + }); + const unsubscribeConnection = bb.sdk.subscribe({ + event: "realtime:connection", + callback: (event) => { + if (event.state !== "connected" || !event.reconnected) return; + for (const view of service.list()) { + void service + .reconcile(view.threadId) + .catch((error) => + logFailure( + bb, + `Could not reconcile provider retry for ${view.threadId}`, + error, + ), + ); + } + }, + }); + try { + await waitForAbort(signal); + } finally { + unsubscribeConnection(); + unsubscribeHost(); + unsubscribeThread(); + } + }, + }); +} diff --git a/plugins/provider-retry/src/cli.ts b/plugins/provider-retry/src/cli.ts new file mode 100644 index 0000000000..0c3015a80d --- /dev/null +++ b/plugins/provider-retry/src/cli.ts @@ -0,0 +1,129 @@ +import type { BbPluginApi, PluginCliContext } from "@bb/plugin-sdk"; +import type { ProviderRetryView } from "./contract.js"; +import type { ProviderRetryService } from "./service.js"; + +function jsonResult(value: unknown) { + return { exitCode: 0, stdout: `${JSON.stringify(value, null, 2)}\n` }; +} + +function textView(view: ProviderRetryView): string { + const due = + view.dueAtMs === null + ? "no automatic reset" + : new Date(view.dueAtMs).toISOString(); + return `${view.threadId}\t${view.phase}\t${view.providerId}\t${due}`; +} + +function requestedThreadId( + argv: string[], + context: PluginCliContext, +): string | null { + return ( + argv.find((value) => !value.startsWith("--")) ?? context.threadId ?? null + ); +} + +function missingThreadId() { + return { + exitCode: 2, + stderr: "A thread id is required (or run the command from a bb thread).\n", + }; +} + +export function registerProviderRetryCli( + bb: BbPluginApi, + service: ProviderRetryService, +): void { + bb.cli.register({ + name: "provider-retry", + summary: "Inspect and control subscription rate-limit recovery", + commands: [ + { + name: "status", + summary: "Show pending provider retries", + usage: "bb provider-retry status [thread-id] [--json]", + }, + { + name: "now", + summary: "Continue a safe rate-limited thread now", + usage: "bb provider-retry now [--json]", + }, + { + name: "refresh", + summary: "Refresh provider subscription usage", + usage: "bb provider-retry refresh [--json]", + }, + { + name: "cancel", + summary: "Cancel a pending automatic continuation", + usage: "bb provider-retry cancel [--json]", + }, + ], + async run(argv, context) { + const [command, ...args] = argv; + const json = args.includes("--json"); + if (command === "status") { + const threadId = requestedThreadId(args, context); + const views = + threadId === null + ? service.list() + : [service.status(threadId)].filter( + (view): view is ProviderRetryView => view !== null, + ); + if (json) return jsonResult({ retries: views }); + return { + exitCode: 0, + stdout: + views.length === 0 + ? "No provider retries are pending.\n" + : `${views.map(textView).join("\n")}\n`, + }; + } + + const threadId = requestedThreadId(args, context); + if (threadId === null) return missingThreadId(); + if (command === "now") { + const started = await service.retryNow(threadId); + if (json) + return jsonResult({ started, view: service.status(threadId) }); + return { + exitCode: started ? 0 : 1, + stdout: started ? `Continued ${threadId}.\n` : "", + stderr: started + ? "" + : `Thread ${threadId} is not currently safe to continue.\n`, + }; + } + if (command === "refresh") { + const view = await service.refresh(threadId); + if (json) return jsonResult({ view }); + return { + exitCode: view?.refreshError ? 1 : 0, + stdout: + view === null + ? `No provider retry is pending for ${threadId}.\n` + : `${textView(view)}\n`, + stderr: view?.refreshError ? `${view.refreshError}\n` : "", + }; + } + if (command === "cancel") { + const cancelled = service.cancel(threadId); + if (json) return jsonResult({ cancelled }); + return { + exitCode: cancelled ? 0 : 1, + stdout: cancelled + ? `Cancelled provider retry for ${threadId}.\n` + : "", + stderr: cancelled + ? "" + : `No cancellable provider retry exists for ${threadId}.\n`, + }; + } + return { + exitCode: 2, + stderr: + "Usage: bb provider-retry [thread-id] [--json]\n", + }; + }, + }); +} diff --git a/plugins/provider-retry/src/contract.ts b/plugins/provider-retry/src/contract.ts new file mode 100644 index 0000000000..d3e86ce39f --- /dev/null +++ b/plugins/provider-retry/src/contract.ts @@ -0,0 +1,60 @@ +import { defineRpcContract } from "@bb/plugin-sdk"; +import { z } from "zod"; + +export const providerRetryPhaseSchema = z.enum([ + "waiting-for-reset", + "waiting-for-host", + "releasing", + "blocked", + "unsafe", +]); +export type ProviderRetryPhase = z.infer; + +export const providerRetryViewSchema = z + .object({ + threadId: z.string().min(1), + failedRequestId: z.string().min(1).nullable(), + scopeKey: z.string().min(1), + hostId: z.string().min(1), + providerId: z.string().min(1), + phase: providerRetryPhaseSchema, + automatic: z.boolean(), + dueAtMs: z.number().int().nonnegative().nullable(), + resetsAtMs: z.number().int().nonnegative().nullable(), + windowLabel: z.string().min(1).nullable(), + kind: z.string().min(1), + reachedReason: z.string().min(1).nullable(), + overageReason: z.string().min(1).nullable(), + recoveryReason: z.string().min(1), + refreshAvailable: z.boolean(), + refreshError: z.string().min(1).nullable(), + processLifetime: z.literal(true), + }) + .strict(); +export type ProviderRetryView = z.infer; + +const threadInput = z.object({ threadId: z.string().min(1) }).strict(); + +export const providerRetryRpcContract = defineRpcContract({ + providerRetryStatus: { + input: threadInput, + output: z.object({ view: providerRetryViewSchema.nullable() }).strict(), + }, + providerRetryNow: { + input: threadInput, + output: z + .object({ + started: z.boolean(), + view: providerRetryViewSchema.nullable(), + }) + .strict(), + }, + providerRetryCancel: { + input: threadInput, + output: z.object({ cancelled: z.boolean() }).strict(), + }, + providerRetryRefresh: { + input: threadInput, + output: z.object({ view: providerRetryViewSchema.nullable() }).strict(), + }, +}); diff --git a/plugins/provider-retry/src/service.ts b/plugins/provider-retry/src/service.ts new file mode 100644 index 0000000000..faa72daaeb --- /dev/null +++ b/plugins/provider-retry/src/service.ts @@ -0,0 +1,556 @@ +import type { BbPluginApi } from "@bb/plugin-sdk"; +import type { ProviderRetryPhase, ProviderRetryView } from "./contract.js"; + +type RecoveryStatus = Awaited< + ReturnType +>; +type RecoveryCandidate = NonNullable; +type ProviderUsageResponse = Awaited< + ReturnType +>; +type ProviderUsage = ProviderUsageResponse[keyof ProviderUsageResponse]; + +export const RESET_BUFFER_MS = 15_000; +export const RESET_JITTER_MS = 30_000; +export const RELEASE_PACE_MS = 1_000; +export const HOST_RETRY_MS = 30_000; +const MAX_TIMER_DELAY_MS = 2_147_000_000; +const REALTIME_CHANNEL = "provider-retry"; + +export interface ProviderRetrySources { + now(): number; + random(): number; +} + +interface WaitingEntry { + view: ProviderRetryView; + candidate: RecoveryCandidate | null; +} + +interface ScopeQueue { + releasing: boolean; + threadIds: Set; + timer: ReturnType | null; +} + +function errorMessage(error: unknown): string { + return error instanceof Error ? error.message : String(error); +} + +function refreshSupported(providerId: string): boolean { + return providerId === "codex" || providerId === "claudeCode"; +} + +function usageForProvider( + usage: ProviderUsageResponse, + providerId: string, +): ProviderUsage | null { + switch (providerId) { + case "codex": + return usage.codex; + case "claudeCode": + return usage.claudeCode; + default: + return null; + } +} + +function blockedWindowLabel(status: RecoveryStatus): string | null { + const windows = status.rateLimits?.windows ?? []; + const window = + windows.find((candidate) => candidate.status === "blocked") ?? windows[0]; + return window?.label ?? window?.providerKey ?? null; +} + +function recoveryView(args: { + candidate: RecoveryCandidate | null; + dueAtMs: number | null; + phase: ProviderRetryPhase; + status: RecoveryStatus; + threadId: string; +}): ProviderRetryView { + const rateLimits = args.status.rateLimits ?? args.candidate?.rateLimits; + return { + threadId: args.threadId, + failedRequestId: args.candidate?.failedRequestId ?? null, + scopeKey: args.status.scopeKey, + hostId: args.status.hostId, + providerId: rateLimits?.providerId ?? "unknown", + phase: args.phase, + automatic: args.candidate?.automatic ?? false, + dueAtMs: args.dueAtMs, + resetsAtMs: args.candidate?.resetsAtMs ?? null, + windowLabel: blockedWindowLabel(args.status), + kind: rateLimits?.kind ?? "unknown", + reachedReason: rateLimits?.reachedReason ?? null, + overageReason: rateLimits?.overageReason ?? null, + recoveryReason: args.status.reason, + refreshAvailable: refreshSupported(rateLimits?.providerId ?? "unknown"), + refreshError: null, + processLifetime: true, + }; +} + +function unsafeRecovery(status: RecoveryStatus): boolean { + return ( + status.rateLimits?.status === "blocked" && + [ + "input-not-accepted", + "output-or-side-effect-observed", + "execution-unavailable", + ].includes(status.reason) + ); +} + +function refreshFailureMessage(usage: ProviderUsage): string | null { + switch (usage.status) { + case "ok": + return null; + case "not_installed": + return "The provider CLI is not installed on this host."; + case "unauthenticated": + return "The provider CLI is not signed in on this host."; + case "expired": + return "The provider credentials on this host have expired."; + case "error": + return usage.message; + } +} + +function latestUsageResetAtMs(usage: ProviderUsage): number | null { + if (usage.status !== "ok") return null; + const timestamps = usage.windows.flatMap((window) => { + if (window.resetsAt === null) return []; + const timestamp = Date.parse(window.resetsAt); + return Number.isFinite(timestamp) ? [timestamp] : []; + }); + return timestamps.length === 0 ? null : Math.max(...timestamps); +} + +function usageIsAllowed(usage: ProviderUsage): boolean { + return ( + usage.status === "ok" && + usage.windows.length > 0 && + usage.windows.every((window) => window.usedPercent < 100) + ); +} + +export class ProviderRetryService { + private readonly entries = new Map(); + private readonly scopes = new Map(); + private readonly reconcileLocks = new Map>(); + private readonly releaseLocks = new Map>(); + private disposed = false; + + constructor( + private readonly bb: BbPluginApi, + private readonly sources: ProviderRetrySources = { + now: () => Date.now(), + random: () => Math.random(), + }, + ) {} + + list(): ProviderRetryView[] { + return [...this.entries.values()] + .map((entry) => entry.view) + .sort((a, b) => a.threadId.localeCompare(b.threadId)); + } + + status(threadId: string): ProviderRetryView | null { + return this.entries.get(threadId)?.view ?? null; + } + + async reconcile(threadId: string): Promise { + const previous = this.reconcileLocks.get(threadId) ?? Promise.resolve(); + const next = previous + .catch(() => undefined) + .then(() => this.reconcileDirect(threadId)); + const lock = next.then(() => undefined); + this.reconcileLocks.set(threadId, lock); + try { + return await next; + } finally { + if (this.reconcileLocks.get(threadId) === lock) { + this.reconcileLocks.delete(threadId); + } + } + } + + private async reconcileDirect( + threadId: string, + ): Promise { + if (this.disposed) return null; + const status = await this.bb.sdk.threads.rateLimitRecovery({ threadId }); + const candidate = status.candidate; + if (candidate === null) { + if (unsafeRecovery(status)) { + this.upsert(threadId, { + candidate: null, + view: recoveryView({ + candidate: null, + dueAtMs: null, + phase: "unsafe", + status, + threadId, + }), + }); + return this.status(threadId); + } + this.remove(threadId); + return null; + } + + const existing = this.entries.get(threadId); + let dueAtMs: number | null = null; + let phase: ProviderRetryPhase = "blocked"; + if (candidate.automatic && candidate.resetsAtMs !== null) { + const sameCandidate = + existing?.candidate?.failedRequestId === candidate.failedRequestId && + existing.candidate.resetsAtMs === candidate.resetsAtMs; + if (status.rateLimits?.status === "allowed") { + dueAtMs = this.sources.now(); + } else if (sameCandidate && existing.view.phase === "waiting-for-host") { + dueAtMs = existing.view.dueAtMs; + phase = "waiting-for-host"; + } else if (sameCandidate && existing.view.dueAtMs !== null) { + dueAtMs = existing.view.dueAtMs; + } else { + dueAtMs = + candidate.resetsAtMs + + RESET_BUFFER_MS + + Math.floor(this.sources.random() * RESET_JITTER_MS); + } + if (phase !== "waiting-for-host") phase = "waiting-for-reset"; + } + this.upsert(threadId, { + candidate, + view: recoveryView({ candidate, dueAtMs, phase, status, threadId }), + }); + return this.status(threadId); + } + + async retryNow(threadId: string): Promise { + if (!this.entries.has(threadId)) await this.reconcile(threadId); + const entry = this.entries.get(threadId); + if (entry?.candidate === null || entry === undefined) return false; + return this.release(threadId); + } + + cancel(threadId: string): boolean { + const entry = this.entries.get(threadId); + if (!entry || entry.view.phase === "releasing") return false; + this.remove(threadId); + return true; + } + + supersede(threadId: string): void { + const entry = this.entries.get(threadId); + if (entry?.view.phase === "releasing") return; + this.remove(threadId); + } + + hostChanged(hostId: string): void { + const now = this.sources.now(); + const scopeKeys = new Set(); + for (const entry of this.entries.values()) { + if ( + entry.view.hostId === hostId && + entry.view.phase === "waiting-for-host" + ) { + entry.view = { ...entry.view, dueAtMs: now }; + scopeKeys.add(entry.view.scopeKey); + this.publish(entry.view.threadId); + } + } + for (const scopeKey of scopeKeys) this.schedule(scopeKey); + } + + async refresh(threadId: string): Promise { + if (!this.entries.has(threadId)) await this.reconcile(threadId); + const entry = this.entries.get(threadId); + if (!entry) return null; + if (!refreshSupported(entry.view.providerId)) { + entry.view = { + ...entry.view, + refreshAvailable: false, + refreshError: "Usage refresh is unavailable for this provider.", + }; + this.publish(threadId); + return entry.view; + } + + let usage: ProviderUsage | null = null; + try { + const response = await this.bb.sdk.system.usageLimits({ + hostId: entry.view.hostId, + }); + usage = usageForProvider(response, entry.view.providerId); + } catch (error) { + this.setScopeRefreshError(entry.view.scopeKey, errorMessage(error)); + return this.status(threadId); + } + if (usage === null) { + this.setScopeRefreshError( + entry.view.scopeKey, + "Usage refresh is unavailable for this provider.", + ); + return this.status(threadId); + } + + const failure = refreshFailureMessage(usage); + if (failure !== null) { + this.setScopeRefreshError(entry.view.scopeKey, failure); + return this.status(threadId); + } + this.setScopeRefreshError(entry.view.scopeKey, null); + if (usageIsAllowed(usage)) { + this.releaseScopeEarly(entry.view.scopeKey); + return this.status(threadId); + } + const resetAtMs = latestUsageResetAtMs(usage); + if (resetAtMs !== null) { + this.rescheduleScope(entry.view.scopeKey, resetAtMs); + } + return this.status(threadId); + } + + private setScopeRefreshError(scopeKey: string, error: string | null): void { + const scope = this.scopes.get(scopeKey); + if (!scope) return; + for (const threadId of scope.threadIds) { + const entry = this.entries.get(threadId); + if (!entry) continue; + entry.view = { + ...entry.view, + refreshAvailable: error === null, + refreshError: error, + }; + this.publish(threadId); + } + } + + private releaseScopeEarly(scopeKey: string): void { + const scope = this.scopes.get(scopeKey); + if (!scope) return; + const now = this.sources.now(); + for (const threadId of scope.threadIds) { + const entry = this.entries.get(threadId); + if (!entry?.candidate) continue; + entry.view = { + ...entry.view, + automatic: true, + dueAtMs: now, + phase: "waiting-for-reset", + }; + this.publish(threadId); + } + this.schedule(scopeKey); + } + + private rescheduleScope(scopeKey: string, resetAtMs: number): void { + const scope = this.scopes.get(scopeKey); + if (!scope) return; + const dueAtMs = + resetAtMs + + RESET_BUFFER_MS + + Math.floor(this.sources.random() * RESET_JITTER_MS); + for (const threadId of scope.threadIds) { + const entry = this.entries.get(threadId); + if (!entry?.candidate?.automatic) continue; + entry.view = { ...entry.view, dueAtMs, resetsAtMs: resetAtMs }; + this.publish(threadId); + } + this.schedule(scopeKey); + } + + private upsert(threadId: string, entry: WaitingEntry): void { + const previousScopeKey = this.entries.get(threadId)?.view.scopeKey; + if (previousScopeKey && previousScopeKey !== entry.view.scopeKey) { + this.removeFromScope(threadId, previousScopeKey); + } + this.entries.set(threadId, entry); + const scope = this.ensureScope(entry.view.scopeKey); + scope.threadIds.add(threadId); + this.publish(threadId); + this.schedule(entry.view.scopeKey); + } + + private ensureScope(scopeKey: string): ScopeQueue { + const existing = this.scopes.get(scopeKey); + if (existing) return existing; + const created: ScopeQueue = { + releasing: false, + threadIds: new Set(), + timer: null, + }; + this.scopes.set(scopeKey, created); + return created; + } + + private remove(threadId: string): void { + const entry = this.entries.get(threadId); + if (!entry) return; + this.entries.delete(threadId); + this.removeFromScope(threadId, entry.view.scopeKey); + this.publish(threadId); + } + + private removeFromScope(threadId: string, scopeKey: string): void { + const scope = this.scopes.get(scopeKey); + if (!scope) return; + scope.threadIds.delete(threadId); + if (scope.threadIds.size === 0) { + if (scope.timer !== null) clearTimeout(scope.timer); + this.scopes.delete(scopeKey); + return; + } + this.schedule(scopeKey); + } + + private publish(threadId: string): void { + this.bb.realtime.publish(REALTIME_CHANNEL, { threadId }); + } + + private schedule(scopeKey: string): void { + const scope = this.scopes.get(scopeKey); + if (!scope || this.disposed) return; + if (scope.timer !== null) { + clearTimeout(scope.timer); + scope.timer = null; + } + if (scope.releasing) return; + const dueAtMs = [...scope.threadIds] + .map((threadId) => this.entries.get(threadId)?.view.dueAtMs ?? null) + .filter((value): value is number => value !== null) + .sort((a, b) => a - b)[0]; + if (dueAtMs === undefined) return; + const delay = Math.min( + MAX_TIMER_DELAY_MS, + Math.max(0, dueAtMs - this.sources.now()), + ); + scope.timer = setTimeout(() => { + scope.timer = null; + void this.runScope(scopeKey); + }, delay); + } + + private async runScope(scopeKey: string): Promise { + const scope = this.scopes.get(scopeKey); + if (!scope || scope.releasing || this.disposed) return; + const dueThreadId = [...scope.threadIds] + .map((threadId) => this.entries.get(threadId)) + .filter( + (entry): entry is WaitingEntry => + entry !== undefined && + entry.candidate !== null && + entry.view.dueAtMs !== null && + entry.view.dueAtMs <= this.sources.now(), + ) + .sort( + (a, b) => + (a.view.dueAtMs ?? 0) - (b.view.dueAtMs ?? 0) || + a.view.threadId.localeCompare(b.view.threadId), + )[0]?.view.threadId; + if (dueThreadId === undefined) { + this.schedule(scopeKey); + return; + } + + scope.releasing = true; + try { + await this.release(dueThreadId); + const nextDueAtMs = this.sources.now() + RELEASE_PACE_MS; + for (const threadId of scope.threadIds) { + const entry = this.entries.get(threadId); + if ( + entry !== undefined && + entry.view.dueAtMs !== null && + entry.view.dueAtMs <= this.sources.now() + ) { + entry.view = { ...entry.view, dueAtMs: nextDueAtMs }; + this.publish(threadId); + } + } + } finally { + scope.releasing = false; + this.schedule(scopeKey); + } + } + + private release(threadId: string): Promise { + const existing = this.releaseLocks.get(threadId); + if (existing) return existing; + const release = this.releaseDirect(threadId).finally(() => { + if (this.releaseLocks.get(threadId) === release) { + this.releaseLocks.delete(threadId); + } + }); + this.releaseLocks.set(threadId, release); + return release; + } + + private async releaseDirect(threadId: string): Promise { + const entry = this.entries.get(threadId); + if (!entry?.candidate || this.disposed) return false; + const failedRequestId = entry.candidate.failedRequestId; + entry.view = { ...entry.view, phase: "releasing" }; + this.publish(threadId); + try { + const status = await this.bb.sdk.threads.rateLimitRecovery({ threadId }); + if (status.candidate?.failedRequestId !== failedRequestId) { + this.remove(threadId); + return false; + } + await this.bb.sdk.threads.continueAfterRateLimit({ + threadId, + expectedRequestId: failedRequestId, + }); + this.remove(threadId); + return true; + } catch (error) { + this.bb.log.warn( + `Provider retry for thread ${threadId} could not start: ${errorMessage(error)}`, + ); + let status: RecoveryStatus | null = null; + try { + status = await this.bb.sdk.threads.rateLimitRecovery({ threadId }); + } catch (inspectionError) { + this.bb.log.warn( + `Provider retry status refresh for thread ${threadId} failed: ${errorMessage(inspectionError)}`, + ); + } + if (status?.candidate?.failedRequestId !== failedRequestId) { + this.remove(threadId); + return false; + } + const current = this.entries.get(threadId); + if (!current) return false; + current.candidate = status.candidate; + current.view = { + ...recoveryView({ + candidate: status.candidate, + dueAtMs: this.sources.now() + HOST_RETRY_MS, + phase: "waiting-for-host", + status, + threadId, + }), + refreshError: current.view.refreshError, + }; + this.publish(threadId); + this.schedule(current.view.scopeKey); + return false; + } + } + + dispose(): void { + if (this.disposed) return; + this.disposed = true; + for (const scope of this.scopes.values()) { + if (scope.timer !== null) clearTimeout(scope.timer); + } + this.scopes.clear(); + this.entries.clear(); + this.reconcileLocks.clear(); + this.releaseLocks.clear(); + } +} diff --git a/plugins/provider-retry/tsconfig.json b/plugins/provider-retry/tsconfig.json new file mode 100644 index 0000000000..23bc8c9375 --- /dev/null +++ b/plugins/provider-retry/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "strict": true, + "target": "ES2022", + "module": "ESNext", + "moduleResolution": "bundler", + "jsx": "react-jsx", + "lib": ["ES2022", "DOM"], + "noEmit": true, + "skipLibCheck": true, + "types": ["node"] + }, + "include": [ + "server.ts", + "server.test.ts", + "app.tsx", + "app.test.tsx", + "src/**/*.ts", + "vitest.config.ts" + ] +} diff --git a/plugins/provider-retry/vitest.config.ts b/plugins/provider-retry/vitest.config.ts new file mode 100644 index 0000000000..ec9adf166a --- /dev/null +++ b/plugins/provider-retry/vitest.config.ts @@ -0,0 +1,10 @@ +import { defineWorkspaceTestConfig } from "../../vitest.shared.js"; + +export default defineWorkspaceTestConfig({ + test: { + silent: "passed-only", + name: "bb-plugin-provider-retry", + include: ["**/*.test.{ts,tsx}"], + exclude: ["node_modules/**"], + }, +}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1347d938b7..b53b1630a9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2686,6 +2686,46 @@ importers: specifier: ^4.1.1 version: 4.1.1(@opentelemetry/api@1.9.1)(@types/node@22.19.10)(jsdom@29.0.1(@noble/hashes@2.0.1))(msw@2.12.14(@types/node@22.19.10)(@typescript/typescript6@6.0.2))(vite@8.0.12(@types/node@22.19.10)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.23.1)(yaml@2.9.0)) + plugins/provider-retry: + dependencies: + '@bb/shared-ui': + specifier: workspace:* + version: link:../../packages/shared-ui + zod: + specifier: 4.3.6 + version: 4.3.6 + devDependencies: + '@bb/plugin-sdk': + specifier: workspace:* + version: link:../../packages/plugin-sdk + '@testing-library/react': + specifier: ^16.3.2 + version: 16.3.2(@testing-library/dom@10.4.1)(@types/react-dom@19.2.3(@types/react@19.2.13))(@types/react@19.2.13)(react-dom@19.2.4(react@19.2.4))(react@19.2.4) + '@types/node': + specifier: ^22.0.0 + version: 22.19.10 + '@types/react': + specifier: ^19.0.0 + version: 19.2.13 + jsdom: + specifier: ^29.0.1 + version: 29.0.1(@noble/hashes@2.0.1) + react: + specifier: ^19.0.0 + version: 19.2.4 + react-dom: + specifier: ^19.0.0 + version: 19.2.4(react@19.2.4) + typescript: + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' + typescript-7: + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 + vitest: + specifier: ^4.1.1 + version: 4.1.1(@opentelemetry/api@1.9.1)(@types/node@22.19.10)(jsdom@29.0.1(@noble/hashes@2.0.1))(msw@2.12.14(@types/node@22.19.10)(@typescript/typescript6@6.0.2))(vite@8.0.12(@types/node@22.19.10)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.23.1)(yaml@2.9.0)) + plugins/secrets: dependencies: '@bb/shared-ui': From 585c56fba6a05cf885d5c4d24c1d8fc1a8cf698b Mon Sep 17 00:00:00 2001 From: Michael Yong Date: Wed, 5 Aug 2026 11:32:58 -0700 Subject: [PATCH 05/21] feat: add provider rate limit retry commands --- .../command-output/thread-actions.test.ts | 68 +++++++++++++++++++ apps/cli/src/commands/thread/actions.ts | 37 ++++++++++ apps/server/src/routes/threads/actions.ts | 2 +- .../skills/builtin-skills/bb-cli/SKILL.md | 11 +++ .../threads/provider-rate-limit-recovery.ts | 12 ++-- .../provider-rate-limit-recovery.test.ts | 32 +++++++-- .../bundled-types/bb-plugin-sdk.d.ts | 26 +++---- packages/sdk/src/areas/threads.ts | 4 +- packages/server-contract/src/api/threads.ts | 2 +- .../src/generated/plugin-sdk-dts.generated.ts | 2 +- .../src/generated/templates.generated.ts | 6 +- .../src/templates/bb-guide-plugins.md | 9 +++ .../src/templates/bb-guide-providers.md | 25 +++++++ .../src/templates/bb-guide-threads.md | 10 +++ plugins/provider-retry/server.test.ts | 4 +- plugins/provider-retry/src/service.ts | 2 +- 16 files changed, 217 insertions(+), 35 deletions(-) diff --git a/apps/cli/src/__tests__/command-output/thread-actions.test.ts b/apps/cli/src/__tests__/command-output/thread-actions.test.ts index 99944619e4..1aa601b631 100644 --- a/apps/cli/src/__tests__/command-output/thread-actions.test.ts +++ b/apps/cli/src/__tests__/command-output/thread-actions.test.ts @@ -285,6 +285,74 @@ describe("bb thread action command output", () => { expect(stopPost).toHaveBeenCalledTimes(1); }); + it("bb thread retry continues the current safe failed request", async () => { + const statusGet = vi.fn(async () => ({ + reason: "eligible", + scopeKey: "host-1:codex", + hostId: "host-1", + rateLimits: null, + candidate: { + failedRequestId: "request-failed-1", + turnId: "turn-failed-1", + scopeKey: "host-1:codex", + hostId: "host-1", + automatic: true, + resetsAtMs: 123, + rateLimits: { + providerId: "codex", + status: "blocked", + kind: "subscription-window", + windows: [], + reachedReason: null, + overageStatus: null, + overageReason: null, + observedAtMs: 1, + source: "codex-account", + }, + }, + })); + const continuePost = vi.fn(async () => ({ + ok: true, + requestId: "request-continuation-1", + })); + stubServerApi({ + "v1.threads.:id.rate-limit-recovery.$get": statusGet, + "v1.threads.:id.rate-limit-recovery.continue.$post": continuePost, + }); + + await runCommand(["thread", "retry", "thread-retry-1"], register); + + expect(statusGet).toHaveBeenCalledWith({ + param: { id: "thread-retry-1" }, + }); + expect(continuePost).toHaveBeenCalledWith({ + param: { id: "thread-retry-1" }, + json: { failedRequestId: "request-failed-1" }, + }); + expect(collectLogLines(vi.mocked(console.log))).toContain( + "Thread thread-retry-1 continued after provider rate limit", + ); + }); + + it("bb thread retry fails closed when the server finds no safe candidate", async () => { + stubServerApi({ + "v1.threads.:id.rate-limit-recovery.$get": vi.fn(async () => ({ + reason: "output-or-side-effect-observed", + scopeKey: "host-1:codex", + hostId: "host-1", + rateLimits: null, + candidate: null, + })), + }); + + await expect( + runCommand(["thread", "retry", "thread-unsafe"], register), + ).rejects.toThrow("process.exit:1"); + expect(collectLogLines(vi.mocked(console.error))).toContain( + "Error: Thread thread-unsafe cannot be safely continued after a provider rate limit (output-or-side-effect-observed).", + ); + }); + it("bb thread stop lets the server no-op when the thread is in error", async () => { const get = vi.fn(async () => fixtures.makeThread({ diff --git a/apps/cli/src/commands/thread/actions.ts b/apps/cli/src/commands/thread/actions.ts index 50ea5ffc76..23aa336cd5 100644 --- a/apps/cli/src/commands/thread/actions.ts +++ b/apps/cli/src/commands/thread/actions.ts @@ -77,6 +77,10 @@ interface ThreadStopCommandOptions { json?: boolean; } +interface ThreadRetryCommandOptions extends ThreadStopCommandOptions { + requestId?: string; +} + type ThreadBannerActionCommandOptions = ThreadStopCommandOptions; type ThreadTellDeliveryMode = "auto" | "queue" | "steer"; @@ -404,6 +408,39 @@ export function registerActionsCommands( ), ); + parent + .command("retry [id]") + .description("Continue a safe turn after a provider subscription limit") + .option("--self", "Target the current thread (from BB_THREAD_ID)") + .option( + "--request-id ", + "Require this failed client request id before continuing", + ) + .option("--json", "Print machine-readable JSON output") + .action( + action( + async (id: string | undefined, opts: ThreadRetryCommandOptions) => { + const threadId = requireThreadIdOrSelf(id, opts); + const sdk = createCliBbSdk(getUrl()); + const status = await sdk.threads.rateLimitRecovery({ threadId }); + const failedRequestId = + opts.requestId ?? status.candidate?.failedRequestId; + if (failedRequestId === undefined) { + throw new Error( + `Thread ${threadId} cannot be safely continued after a provider rate limit (${status.reason}).`, + ); + } + const result = await sdk.threads.continueAfterRateLimit({ + threadId, + failedRequestId, + }); + const output = { threadId, failedRequestId, ...result }; + if (outputJson(opts, output)) return; + console.log(`Thread ${threadId} continued after provider rate limit`); + }, + ), + ); + parent .command("stop [id]") .description("Stop an active or starting thread") diff --git a/apps/server/src/routes/threads/actions.ts b/apps/server/src/routes/threads/actions.ts index efb6fb5177..b28d3c3c35 100644 --- a/apps/server/src/routes/threads/actions.ts +++ b/apps/server/src/routes/threads/actions.ts @@ -316,7 +316,7 @@ export function registerThreadActionRoutes(app: Hono, deps: AppDeps): void { return context.json( await continueThreadAfterProviderRateLimit(deps, { environment, - expectedRequestId: payload.expectedRequestId, + failedRequestId: payload.failedRequestId, thread, }), ); 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 697e58d126..6ac92e7a5d 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 @@ -371,6 +371,17 @@ For review or fix pipelines, get the environment ID from - For failed threads, inspect `bb thread show --json` and `bb thread log ` before deciding whether to retry, clarify, or update the user. +- The default Provider retry plugin automatically waits for structured Codex + and Claude Code subscription-window resets when the failed turn was accepted + but produced no output or possible side effects. Its timers last only while + the current bb server/plugin process is running. Inspect it with + `bb provider-retry status [thread-id]`; use the same command's `refresh`, + `now`, and `cancel` subcommands to control the wait. `bb settings usage` + reads current provider usage directly from the machine. +- Use `bb thread retry [id] [--request-id ]` for the same guarded core + continuation when no plugin timer remains. It sends agent-only “Please + continue.” on the existing provider conversation and fails closed after + output, possible side effects, a newer request, or provider-owned retry. - For interrupted or stopped threads, inspect first. If the user stopped the thread, treat that as intentional unless they ask you to continue. - Use `bb thread stop ` when a thread is stuck or no longer needed. diff --git a/apps/server/src/services/threads/provider-rate-limit-recovery.ts b/apps/server/src/services/threads/provider-rate-limit-recovery.ts index f9fbc6a5b0..7ef124f481 100644 --- a/apps/server/src/services/threads/provider-rate-limit-recovery.ts +++ b/apps/server/src/services/threads/provider-rate-limit-recovery.ts @@ -311,7 +311,7 @@ export async function continueThreadAfterProviderRateLimit( deps: LoggedPendingInteractionWorkSessionDeps, args: { environment: Environment; - expectedRequestId: ClientTurnRequestId; + failedRequestId: ClientTurnRequestId; thread: Thread; }, ): Promise { @@ -327,7 +327,7 @@ export async function continueThreadAfterProviderRateLimit( }); if ( !initial.candidate || - initial.candidate.failedRequestId !== args.expectedRequestId + initial.candidate.failedRequestId !== args.failedRequestId ) { throw unavailableRecoveryError(initial.status); } @@ -373,7 +373,7 @@ export async function continueThreadAfterProviderRateLimit( }); if ( !current.candidate || - current.candidate.failedRequestId !== args.expectedRequestId + current.candidate.failedRequestId !== args.failedRequestId ) { throw unavailableRecoveryError(current.status); } @@ -382,7 +382,7 @@ export async function continueThreadAfterProviderRateLimit( threadId: currentThread.id, environmentId: currentEnvironment.id, type: "client/turn/requested", - continuationOfRequestId: args.expectedRequestId, + continuationOfRequestId: args.failedRequestId, input: CONTINUE_INPUT, execution: current.candidate.execution, initiator: "system", @@ -399,11 +399,11 @@ export async function continueThreadAfterProviderRateLimit( scope: threadScope(), data: { operation: "provider_rate_limit_recovery", - operationId: `provider-rate-limit-recovery:${args.expectedRequestId}`, + operationId: `provider-rate-limit-recovery:${args.failedRequestId}`, status: "completed", message: "Continued after provider rate limit reset", metadata: { - failedRequestId: args.expectedRequestId, + failedRequestId: args.failedRequestId, continuationRequestId: requestId, }, }, diff --git a/apps/server/test/services/threads/provider-rate-limit-recovery.test.ts b/apps/server/test/services/threads/provider-rate-limit-recovery.test.ts index 5321318e92..1a05e7f852 100644 --- a/apps/server/test/services/threads/provider-rate-limit-recovery.test.ts +++ b/apps/server/test/services/threads/provider-rate-limit-recovery.test.ts @@ -308,7 +308,7 @@ describe("provider rate-limit recovery", () => { { method: "POST", headers: { "content-type": "application/json" }, - body: JSON.stringify({ expectedRequestId: FAILED_REQUEST_ID }), + body: JSON.stringify({ failedRequestId: FAILED_REQUEST_ID }), }, ); expect(response.status).toBe(200); @@ -349,16 +349,38 @@ describe("provider rate-limit recovery", () => { }, ], }); - expect( - listQueuedThreadCommands(harness, "turn.submit", fixture.thread.id), - ).toHaveLength(1); + const [command] = listQueuedThreadCommands( + harness, + "turn.submit", + fixture.thread.id, + ); + expect(command).toMatchObject({ + type: "turn.submit", + target: { mode: "start" }, + input: [ + { + type: "text", + text: "Please continue.", + visibility: "agent-only", + }, + ], + options: { + model: "gpt-5", + serviceTier: "default", + reasoningLevel: "medium", + permissionMode: "full", + }, + resumeContext: { + providerThreadId: "provider-thread-rate-limited", + }, + }); const repeated = await harness.app.request( `/api/v1/threads/${fixture.thread.id}/rate-limit-recovery/continue`, { method: "POST", headers: { "content-type": "application/json" }, - body: JSON.stringify({ expectedRequestId: FAILED_REQUEST_ID }), + body: JSON.stringify({ failedRequestId: FAILED_REQUEST_ID }), }, ); expect(repeated.status).toBe(409); 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 c49f78cf69..1bf788d63b 100644 --- a/packages/plugin-sdk/bundled-types/bb-plugin-sdk.d.ts +++ b/packages/plugin-sdk/bundled-types/bb-plugin-sdk.d.ts @@ -2857,32 +2857,32 @@ declare const environmentDiffFileQuerySchema: z$1.ZodDiscriminatedUnion<[z$1.Zod target: z$1.ZodLiteral<"uncommitted">; path: z$1.ZodString; side: z$1.ZodEnum<{ - old: "old"; new: "new"; + old: "old"; }>; }, z$1.core.$strip>, z$1.ZodObject<{ target: z$1.ZodLiteral<"branch_committed">; mergeBaseRef: z$1.ZodString; path: z$1.ZodString; side: z$1.ZodEnum<{ - old: "old"; new: "new"; + old: "old"; }>; }, z$1.core.$strip>, z$1.ZodObject<{ target: z$1.ZodLiteral<"all">; mergeBaseRef: z$1.ZodString; path: z$1.ZodString; side: z$1.ZodEnum<{ - old: "old"; new: "new"; + old: "old"; }>; }, z$1.core.$strip>, z$1.ZodObject<{ target: z$1.ZodLiteral<"commit">; sha: z$1.ZodString; path: z$1.ZodString; side: z$1.ZodEnum<{ - old: "old"; new: "new"; + old: "old"; }>; }, z$1.core.$strip>], "target">; type EnvironmentDiffFileQuery = z$1.infer; @@ -3098,10 +3098,10 @@ declare const environmentPullRequestResponseSchema: z$1.ZodDiscriminatedUnion<[z mergeability: z$1.ZodObject<{ state: z$1.ZodEnum<{ unknown: "unknown"; + blocked: "blocked"; draft: "draft"; mergeable: "mergeable"; conflicts: "conflicts"; - blocked: "blocked"; }>; mergeStateStatus: z$1.ZodNullable>; }, z$1.core.$strict>; attention: z$1.ZodEnum<{ + blocked: "blocked"; none: "none"; merged: "merged"; draft: "draft"; @@ -3127,7 +3128,6 @@ declare const environmentPullRequestResponseSchema: z$1.ZodDiscriminatedUnion<[z changes_requested: "changes_requested"; review_requested: "review_requested"; conflicts: "conflicts"; - blocked: "blocked"; checks_failed: "checks_failed"; checks_pending: "checks_pending"; ready_to_merge: "ready_to_merge"; @@ -8282,8 +8282,8 @@ declare const providerRateLimitRecoveryStatusSchema: z$1.ZodObject<{ status: z$1.ZodEnum<{ unknown: "unknown"; warning: "warning"; - blocked: "blocked"; allowed: "allowed"; + blocked: "blocked"; }>; kind: z$1.ZodEnum<{ unknown: "unknown"; @@ -8298,8 +8298,8 @@ declare const providerRateLimitRecoveryStatusSchema: z$1.ZodObject<{ status: z$1.ZodEnum<{ unknown: "unknown"; warning: "warning"; - blocked: "blocked"; allowed: "allowed"; + blocked: "blocked"; }>; usedPercent: z$1.ZodNullable; resetsAtMs: z$1.ZodNullable; @@ -8308,9 +8308,9 @@ declare const providerRateLimitRecoveryStatusSchema: z$1.ZodObject<{ reachedReason: z$1.ZodNullable; overageStatus: z$1.ZodNullable>; overageReason: z$1.ZodNullable; observedAtMs: z$1.ZodNumber; @@ -8332,8 +8332,8 @@ declare const providerRateLimitRecoveryStatusSchema: z$1.ZodObject<{ status: z$1.ZodEnum<{ unknown: "unknown"; warning: "warning"; - blocked: "blocked"; allowed: "allowed"; + blocked: "blocked"; }>; kind: z$1.ZodEnum<{ unknown: "unknown"; @@ -8348,8 +8348,8 @@ declare const providerRateLimitRecoveryStatusSchema: z$1.ZodObject<{ status: z$1.ZodEnum<{ unknown: "unknown"; warning: "warning"; - blocked: "blocked"; allowed: "allowed"; + blocked: "blocked"; }>; usedPercent: z$1.ZodNullable; resetsAtMs: z$1.ZodNullable; @@ -8358,9 +8358,9 @@ declare const providerRateLimitRecoveryStatusSchema: z$1.ZodObject<{ reachedReason: z$1.ZodNullable; overageStatus: z$1.ZodNullable>; overageReason: z$1.ZodNullable; observedAtMs: z$1.ZodNumber; @@ -12230,7 +12230,7 @@ interface ThreadActionArgs { threadId: string; } interface ThreadContinueAfterRateLimitArgs extends ThreadActionArgs { - expectedRequestId: string; + failedRequestId: string; } interface ThreadStatusArgs extends ThreadActionArgs { signal?: AbortSignal; diff --git a/packages/sdk/src/areas/threads.ts b/packages/sdk/src/areas/threads.ts index 03527f13d9..5e3ac3294d 100644 --- a/packages/sdk/src/areas/threads.ts +++ b/packages/sdk/src/areas/threads.ts @@ -187,7 +187,7 @@ export interface ThreadActionArgs { } export interface ThreadContinueAfterRateLimitArgs extends ThreadActionArgs { - expectedRequestId: string; + failedRequestId: string; } export interface ThreadStatusArgs extends ThreadActionArgs { @@ -964,7 +964,7 @@ export function createThreadsArea(args: CreateSdkAreaArgs): ThreadsArea { return transport.readJson( transport.api.v1.threads[":id"]["rate-limit-recovery"].continue.$post({ param: { id: input.threadId }, - json: { expectedRequestId: input.expectedRequestId }, + json: { failedRequestId: input.failedRequestId }, }), ); }, diff --git a/packages/server-contract/src/api/threads.ts b/packages/server-contract/src/api/threads.ts index 2b0e6d1ab4..7603a5432c 100644 --- a/packages/server-contract/src/api/threads.ts +++ b/packages/server-contract/src/api/threads.ts @@ -259,7 +259,7 @@ export type ProviderRateLimitRecoveryStatus = z.infer< >; export const continueAfterProviderRateLimitRequestSchema = z - .object({ expectedRequestId: clientTurnRequestIdSchema }) + .object({ failedRequestId: clientTurnRequestIdSchema }) .strict(); export type ContinueAfterProviderRateLimitRequest = z.infer< typeof continueAfterProviderRateLimitRequestSchema diff --git a/packages/templates/src/generated/plugin-sdk-dts.generated.ts b/packages/templates/src/generated/plugin-sdk-dts.generated.ts index bac851b518..86e975b06b 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;\n}, z$1.core.$strict>;\ntype AppSettings = z$1.infer;\n\ndeclare const appKeybindingOverridesSchema: z$1.ZodArray;\n shortcut: z$1.ZodNullable>;\n}, z$1.core.$strict>>;\ntype AppKeybindingOverrides = z$1.infer;\n\ndeclare const appThemeSchema: z$1.ZodObject<{\n themeId: z$1.ZodString;\n customCss: z$1.ZodNullable;\n faviconColor: z$1.ZodEnum<{\n default: \"default\";\n red: \"red\";\n orange: \"orange\";\n yellow: \"yellow\";\n green: \"green\";\n teal: \"teal\";\n blue: \"blue\";\n purple: \"purple\";\n pink: \"pink\";\n }>;\n}, z$1.core.$strip>;\ntype AppTheme = z$1.infer;\n/**\n * The complete appearance selection a client sends when changing the palette\n * and/or favicon tint. The server validates `themeId` (built-in id or an\n * existing custom theme) and resolves the CSS from disk for custom themes.\n * Callers changing only one facet must carry the other facet forward explicitly.\n */\ndeclare const appThemeSelectionSchema: z$1.ZodObject<{\n themeId: z$1.ZodString;\n faviconColor: z$1.ZodEnum<{\n default: \"default\";\n red: \"red\";\n orange: \"orange\";\n yellow: \"yellow\";\n green: \"green\";\n teal: \"teal\";\n blue: \"blue\";\n purple: \"purple\";\n pink: \"pink\";\n }>;\n}, z$1.core.$strip>;\ntype AppThemeSelection = z$1.infer;\n\ndeclare const changedMessageSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"changed\">;\n entity: z$1.ZodLiteral<\"thread\">;\n id: z$1.ZodOptional;\n metadata: z$1.ZodOptional;\n eventTypes: z$1.ZodOptional>>>>;\n hasPendingInteraction: z$1.ZodOptional;\n projectId: z$1.ZodOptional;\n }, z$1.core.$strict>>;\n changes: z$1.ZodReadonly>>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"changed\">;\n entity: z$1.ZodLiteral<\"project\">;\n id: z$1.ZodOptional;\n changes: z$1.ZodReadonly>>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"changed\">;\n entity: z$1.ZodLiteral<\"environment\">;\n id: z$1.ZodOptional;\n changes: z$1.ZodReadonly>>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"changed\">;\n entity: z$1.ZodLiteral<\"host\">;\n id: z$1.ZodOptional;\n changes: z$1.ZodReadonly>>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"changed\">;\n entity: z$1.ZodLiteral<\"system\">;\n changes: z$1.ZodReadonly>>;\n}, z$1.core.$strict>], \"entity\">;\ntype ChangedMessage = z$1.infer;\n\ndeclare const environmentSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n name: z$1.ZodNullable;\n projectId: z$1.ZodString;\n hostId: z$1.ZodString;\n path: z$1.ZodNullable;\n managed: z$1.ZodBoolean;\n isGitRepo: z$1.ZodBoolean;\n isWorktree: z$1.ZodBoolean;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n branchName: z$1.ZodNullable;\n baseBranch: z$1.ZodNullable;\n defaultBranch: z$1.ZodNullable;\n mergeBaseBranch: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n error: \"error\";\n provisioning: \"provisioning\";\n ready: \"ready\";\n retiring: \"retiring\";\n destroying: \"destroying\";\n destroyed: \"destroyed\";\n }>;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype Environment = z$1.infer;\n\n/**\n * User-opt-in experiments (the Settings → Experiments toggles). Distinct from\n * `FeatureFlags`: flags are operator-set via env at server start, experiments\n * are user-toggled at runtime and persisted server-side so server-owned\n * policy (e.g. skill injection) can honor them.\n *\n * Every experiment defaults to off — opting in is the point.\n */\ndeclare const experimentsSchema: z$1.ZodObject<{\n claudeCodeMockCliTraffic: z$1.ZodBoolean;\n toolsHub: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype Experiments = z$1.infer;\n\ndeclare const hostSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n name: z$1.ZodString;\n type: z$1.ZodEnum<{\n persistent: \"persistent\";\n }>;\n status: z$1.ZodEnum<{\n connected: \"connected\";\n disconnected: \"disconnected\";\n }>;\n maxPermissionMode: z$1.ZodEnum<{\n full: \"full\";\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n }>;\n lastSeenAt: z$1.ZodNullable;\n lastRejectedProtocolVersion: z$1.ZodNullable;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype Host = z$1.infer;\n\ninterface JsonObject {\n [key: string]: JsonValue$1;\n}\ntype JsonValue$1 = string | number | boolean | null | JsonValue$1[] | JsonObject;\n\ndeclare const pendingInteractionResolutionSchema: z$1.ZodUnion;\n grantedPermissions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"allow_for_session\">;\n grantedPermissions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"deny\">;\n}, z$1.core.$strip>], \"decision\">, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"user_answer\">;\n answers: z$1.ZodRecord;\n freeText: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin_submitted\">;\n}, z$1.core.$strip>]>;\ntype PendingInteractionResolution = z$1.infer;\ndeclare const providerPendingInteractionSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n status: z$1.ZodEnum<{\n interrupted: \"interrupted\";\n pending: \"pending\";\n resolving: \"resolving\";\n resolved: \"resolved\";\n }>;\n statusReason: z$1.ZodNullable;\n createdAt: z$1.ZodNumber;\n expiresAt: z$1.ZodOptional>;\n resolvedAt: z$1.ZodNullable;\n turnId: z$1.ZodString;\n providerId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n providerRequestId: z$1.ZodString;\n origin: z$1.ZodOptional;\n providerId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n providerRequestId: z$1.ZodString;\n }, z$1.core.$strip>>;\n payload: z$1.ZodUnion;\n subject: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n itemId: z$1.ZodString;\n command: z$1.ZodString;\n cwd: z$1.ZodNullable;\n actions: z$1.ZodArray;\n command: z$1.ZodString;\n name: z$1.ZodString;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"listFiles\">;\n command: z$1.ZodString;\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"search\">;\n command: z$1.ZodString;\n query: z$1.ZodNullable;\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"unknown\">;\n command: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">>;\n sessionGrant: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"file_change\">;\n itemId: z$1.ZodString;\n writeScope: z$1.ZodNullable;\n sessionGrant: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"permission_grant\">;\n itemId: z$1.ZodString;\n toolName: z$1.ZodNullable;\n permissions: z$1.ZodObject<{\n network: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>;\n }, z$1.core.$strip>], \"kind\">;\n reason: z$1.ZodNullable;\n availableDecisions: z$1.ZodArray>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"user_question\">;\n questions: z$1.ZodArray;\n multiSelect: z$1.ZodBoolean;\n options: z$1.ZodOptional;\n }, z$1.core.$strip>>>;\n allowFreeText: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>]>;\n resolution: z$1.ZodNullable;\n grantedPermissions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"allow_for_session\">;\n grantedPermissions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"deny\">;\n }, z$1.core.$strip>], \"decision\">, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"user_answer\">;\n answers: z$1.ZodRecord;\n freeText: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>]>>;\n}, z$1.core.$strip>;\ntype ProviderPendingInteraction = z$1.infer;\ndeclare const pluginPendingInteractionSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n status: z$1.ZodEnum<{\n interrupted: \"interrupted\";\n pending: \"pending\";\n resolving: \"resolving\";\n resolved: \"resolved\";\n }>;\n statusReason: z$1.ZodNullable;\n createdAt: z$1.ZodNumber;\n expiresAt: z$1.ZodOptional>;\n resolvedAt: z$1.ZodNullable;\n turnId: z$1.ZodNullable;\n origin: z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n rendererId: z$1.ZodString;\n }, z$1.core.$strip>;\n payload: z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n title: z$1.ZodString;\n data: z$1.ZodType>;\n }, z$1.core.$strip>;\n resolution: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype PluginPendingInteraction = z$1.infer;\ntype PendingInteraction = ProviderPendingInteraction | PluginPendingInteraction;\n\ndeclare const projectSourceSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n projectId: z$1.ZodString;\n isDefault: z$1.ZodBoolean;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n type: z$1.ZodLiteral<\"local_path\">;\n hostId: z$1.ZodString;\n path: z$1.ZodString;\n}, z$1.core.$strip>;\ntype ProjectSource = z$1.infer;\n\ndeclare const 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;\ndeclare const serviceTierSchema: z$1.ZodEnum<{\n default: \"default\";\n fast: \"fast\";\n}>;\ntype ServiceTier = z$1.infer;\ndeclare const permissionModeSchema: z$1.ZodEnum<{\n full: \"full\";\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n}>;\ntype PermissionMode = z$1.infer;\ndeclare const promptInputSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n}, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n}, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n}, z$1.core.$strip>], \"type\">;\ntype PromptInput = z$1.infer;\ndeclare const resolvedThreadExecutionOptionsSchema: z$1.ZodObject<{\n seq: z$1.ZodOptional;\n model: z$1.ZodString;\n serviceTier: z$1.ZodEnum<{\n default: \"default\";\n fast: \"fast\";\n }>;\n reasoningLevel: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n permissionMode: z$1.ZodEnum<{\n full: \"full\";\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n }>;\n source: z$1.ZodEnum<{\n \"client/thread/start\": \"client/thread/start\";\n \"client/turn/requested\": \"client/turn/requested\";\n \"client/turn/start\": \"client/turn/start\";\n }>;\n}, z$1.core.$strip>;\ntype ResolvedThreadExecutionOptions = z$1.infer;\ndeclare const projectExecutionDefaultsSchema: z$1.ZodObject<{\n providerId: z$1.ZodString;\n model: z$1.ZodString;\n serviceTier: z$1.ZodEnum<{\n default: \"default\";\n fast: \"fast\";\n }>;\n reasoningLevel: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n permissionMode: z$1.ZodEnum<{\n full: \"full\";\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n }>;\n}, z$1.core.$strip>;\ntype ProjectExecutionDefaults = z$1.infer;\n\n/** All thread events — provider-originated or system-originated. */\ndeclare const threadEventSchema: z$1.ZodPipe;\n threadId: z$1.ZodString;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"thread/identity\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"turn/started\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"turn/completed\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n }>;\n error: z$1.ZodOptional>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"turn/input/accepted\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n clientRequestId: z$1.ZodString;\n scope: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"turn\">;\n turnId: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">;\n}, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"thread/name/updated\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n threadName: z$1.ZodString;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"thread/compacted\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"thread/goal/updated\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n objective: z$1.ZodString;\n status: z$1.ZodEnum<{\n active: \"active\";\n paused: \"paused\";\n budgetLimited: \"budgetLimited\";\n complete: \"complete\";\n }>;\n tokenBudget: z$1.ZodNullable;\n tokensUsed: z$1.ZodNumber;\n timeUsedSeconds: z$1.ZodNumber;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"thread/goal/cleared\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/started\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n item: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"userMessage\">;\n id: z$1.ZodString;\n content: z$1.ZodArray;\n text: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">>;\n clientRequestId: z$1.ZodOptional;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"agentMessage\">;\n id: z$1.ZodString;\n text: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"commandExecution\">;\n id: z$1.ZodString;\n command: z$1.ZodString;\n cwd: z$1.ZodString;\n status: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\n }>;\n approvalStatus: z$1.ZodNullable>;\n aggregatedOutput: z$1.ZodOptional;\n exitCode: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n truncation: z$1.ZodOptional>;\n result: z$1.ZodOptional>;\n resultText: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"fileChange\">;\n id: z$1.ZodString;\n changes: z$1.ZodArray;\n movePath: z$1.ZodOptional;\n diff: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n status: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\n }>;\n approvalStatus: z$1.ZodNullable>;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"webSearch\">;\n id: z$1.ZodString;\n queries: z$1.ZodArray;\n resultText: z$1.ZodNullable;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"webFetch\">;\n id: z$1.ZodString;\n url: z$1.ZodString;\n prompt: z$1.ZodNullable;\n pattern: z$1.ZodNullable;\n resultText: z$1.ZodNullable;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"imageView\">;\n id: z$1.ZodString;\n path: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"toolCall\">;\n id: z$1.ZodString;\n server: z$1.ZodOptional;\n tool: z$1.ZodString;\n arguments: z$1.ZodOptional>;\n statusLabels: z$1.ZodOptional>;\n status: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\n }>;\n result: z$1.ZodOptional;\n error: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n truncation: z$1.ZodOptional>;\n result: z$1.ZodOptional>;\n resultText: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"reasoning\">;\n id: z$1.ZodString;\n summary: z$1.ZodArray;\n content: z$1.ZodArray;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"plan\">;\n id: z$1.ZodString;\n text: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"contextCompaction\">;\n id: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"backgroundTask\">;\n id: z$1.ZodString;\n taskType: z$1.ZodString;\n description: z$1.ZodString;\n status: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\n }>;\n taskStatus: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n paused: \"paused\";\n pending: \"pending\";\n running: \"running\";\n killed: \"killed\";\n stopped: \"stopped\";\n }>;\n skipTranscript: z$1.ZodBoolean;\n workflowName: z$1.ZodOptional;\n workflow: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray;\n model: z$1.ZodString;\n attempt: z$1.ZodNumber;\n cached: z$1.ZodBoolean;\n lastProgressAt: z$1.ZodNumber;\n phaseIndex: z$1.ZodOptional;\n phaseTitle: z$1.ZodOptional;\n agentType: z$1.ZodOptional;\n isolation: z$1.ZodOptional;\n queuedAt: z$1.ZodOptional;\n startedAt: z$1.ZodOptional;\n lastToolName: z$1.ZodOptional;\n lastToolSummary: z$1.ZodOptional;\n promptPreview: z$1.ZodOptional;\n resultPreview: z$1.ZodOptional;\n error: z$1.ZodOptional;\n tokens: z$1.ZodOptional;\n toolCalls: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodOptional>;\n summary: z$1.ZodOptional;\n error: z$1.ZodOptional;\n outputFile: z$1.ZodOptional;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/completed\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n item: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"userMessage\">;\n id: z$1.ZodString;\n content: z$1.ZodArray;\n text: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">>;\n clientRequestId: z$1.ZodOptional;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"agentMessage\">;\n id: z$1.ZodString;\n text: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"commandExecution\">;\n id: z$1.ZodString;\n command: z$1.ZodString;\n cwd: z$1.ZodString;\n status: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\n }>;\n approvalStatus: z$1.ZodNullable>;\n aggregatedOutput: z$1.ZodOptional;\n exitCode: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n truncation: z$1.ZodOptional>;\n result: z$1.ZodOptional>;\n resultText: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"fileChange\">;\n id: z$1.ZodString;\n changes: z$1.ZodArray;\n movePath: z$1.ZodOptional;\n diff: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n status: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\n }>;\n approvalStatus: z$1.ZodNullable>;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"webSearch\">;\n id: z$1.ZodString;\n queries: z$1.ZodArray;\n resultText: z$1.ZodNullable;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"webFetch\">;\n id: z$1.ZodString;\n url: z$1.ZodString;\n prompt: z$1.ZodNullable;\n pattern: z$1.ZodNullable;\n resultText: z$1.ZodNullable;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"imageView\">;\n id: z$1.ZodString;\n path: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"toolCall\">;\n id: z$1.ZodString;\n server: z$1.ZodOptional;\n tool: z$1.ZodString;\n arguments: z$1.ZodOptional>;\n statusLabels: z$1.ZodOptional>;\n status: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\n }>;\n result: z$1.ZodOptional;\n error: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n truncation: z$1.ZodOptional>;\n result: z$1.ZodOptional>;\n resultText: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"reasoning\">;\n id: z$1.ZodString;\n summary: z$1.ZodArray;\n content: z$1.ZodArray;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"plan\">;\n id: z$1.ZodString;\n text: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"contextCompaction\">;\n id: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"backgroundTask\">;\n id: z$1.ZodString;\n taskType: z$1.ZodString;\n description: z$1.ZodString;\n status: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\n }>;\n taskStatus: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n paused: \"paused\";\n pending: \"pending\";\n running: \"running\";\n killed: \"killed\";\n stopped: \"stopped\";\n }>;\n skipTranscript: z$1.ZodBoolean;\n workflowName: z$1.ZodOptional;\n workflow: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray;\n model: z$1.ZodString;\n attempt: z$1.ZodNumber;\n cached: z$1.ZodBoolean;\n lastProgressAt: z$1.ZodNumber;\n phaseIndex: z$1.ZodOptional;\n phaseTitle: z$1.ZodOptional;\n agentType: z$1.ZodOptional;\n isolation: z$1.ZodOptional;\n queuedAt: z$1.ZodOptional;\n startedAt: z$1.ZodOptional;\n lastToolName: z$1.ZodOptional;\n lastToolSummary: z$1.ZodOptional;\n promptPreview: z$1.ZodOptional;\n resultPreview: z$1.ZodOptional;\n error: z$1.ZodOptional;\n tokens: z$1.ZodOptional;\n toolCalls: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodOptional>;\n summary: z$1.ZodOptional;\n error: z$1.ZodOptional;\n outputFile: z$1.ZodOptional;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/agentMessage/delta\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n itemId: z$1.ZodString;\n delta: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/commandExecution/outputDelta\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n itemId: z$1.ZodString;\n delta: z$1.ZodString;\n reset: z$1.ZodOptional;\n parentToolCallId: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/fileChange/outputDelta\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n itemId: z$1.ZodString;\n delta: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/reasoning/summaryTextDelta\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n itemId: z$1.ZodString;\n delta: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/reasoning/textDelta\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n itemId: z$1.ZodString;\n delta: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/plan/delta\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n itemId: z$1.ZodString;\n delta: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/mcpToolCall/progress\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n itemId: z$1.ZodString;\n message: z$1.ZodOptional;\n parentToolCallId: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/toolCall/progress\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n itemId: z$1.ZodString;\n message: z$1.ZodOptional;\n parentToolCallId: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/backgroundTask/progress\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n item: z$1.ZodObject<{\n type: z$1.ZodLiteral<\"backgroundTask\">;\n id: z$1.ZodString;\n taskType: z$1.ZodString;\n description: z$1.ZodString;\n status: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\n }>;\n taskStatus: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n paused: \"paused\";\n pending: \"pending\";\n running: \"running\";\n killed: \"killed\";\n stopped: \"stopped\";\n }>;\n skipTranscript: z$1.ZodBoolean;\n workflowName: z$1.ZodOptional;\n workflow: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray;\n model: z$1.ZodString;\n attempt: z$1.ZodNumber;\n cached: z$1.ZodBoolean;\n lastProgressAt: z$1.ZodNumber;\n phaseIndex: z$1.ZodOptional;\n phaseTitle: z$1.ZodOptional;\n agentType: z$1.ZodOptional;\n isolation: z$1.ZodOptional;\n queuedAt: z$1.ZodOptional;\n startedAt: z$1.ZodOptional;\n lastToolName: z$1.ZodOptional;\n lastToolSummary: z$1.ZodOptional;\n promptPreview: z$1.ZodOptional;\n resultPreview: z$1.ZodOptional;\n error: z$1.ZodOptional;\n tokens: z$1.ZodOptional;\n toolCalls: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodOptional>;\n summary: z$1.ZodOptional;\n error: z$1.ZodOptional;\n outputFile: z$1.ZodOptional;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/backgroundTask/completed\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n item: z$1.ZodObject<{\n type: z$1.ZodLiteral<\"backgroundTask\">;\n id: z$1.ZodString;\n taskType: z$1.ZodString;\n description: z$1.ZodString;\n status: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\n }>;\n taskStatus: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n paused: \"paused\";\n pending: \"pending\";\n running: \"running\";\n killed: \"killed\";\n stopped: \"stopped\";\n }>;\n skipTranscript: z$1.ZodBoolean;\n workflowName: z$1.ZodOptional;\n workflow: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray;\n model: z$1.ZodString;\n attempt: z$1.ZodNumber;\n cached: z$1.ZodBoolean;\n lastProgressAt: z$1.ZodNumber;\n phaseIndex: z$1.ZodOptional;\n phaseTitle: z$1.ZodOptional;\n agentType: z$1.ZodOptional;\n isolation: z$1.ZodOptional;\n queuedAt: z$1.ZodOptional;\n startedAt: z$1.ZodOptional;\n lastToolName: z$1.ZodOptional;\n lastToolSummary: z$1.ZodOptional;\n promptPreview: z$1.ZodOptional;\n resultPreview: z$1.ZodOptional;\n error: z$1.ZodOptional;\n tokens: z$1.ZodOptional;\n toolCalls: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodOptional>;\n summary: z$1.ZodOptional;\n error: z$1.ZodOptional;\n outputFile: z$1.ZodOptional;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"thread/tokenUsage/updated\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n tokenUsage: z$1.ZodObject<{\n total: z$1.ZodObject<{\n totalTokens: z$1.ZodNumber;\n inputTokens: z$1.ZodNumber;\n cachedInputTokens: z$1.ZodNumber;\n outputTokens: z$1.ZodNumber;\n reasoningOutputTokens: z$1.ZodNumber;\n }, z$1.core.$strip>;\n last: z$1.ZodObject<{\n totalTokens: z$1.ZodNumber;\n inputTokens: z$1.ZodNumber;\n cachedInputTokens: z$1.ZodNumber;\n outputTokens: z$1.ZodNumber;\n reasoningOutputTokens: z$1.ZodNumber;\n }, z$1.core.$strip>;\n modelContextWindow: z$1.ZodNullable;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"thread/contextWindowUsage/updated\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n contextWindowUsage: z$1.ZodObject<{\n usedTokens: z$1.ZodNullable;\n modelContextWindow: z$1.ZodNullable;\n estimated: z$1.ZodBoolean;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"turn/plan/updated\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n plan: z$1.ZodArray>;\n }, z$1.core.$strip>>;\n explanation: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"turn/diff/updated\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n diff: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"provider/error\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n message: z$1.ZodString;\n detail: z$1.ZodOptional;\n willRetry: z$1.ZodOptional;\n errorInfo: z$1.ZodOptional;\n providerCode: z$1.ZodNullable;\n httpStatusCode: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"provider/warning\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n category: z$1.ZodEnum<{\n deprecation: \"deprecation\";\n config: \"config\";\n general: \"general\";\n }>;\n summary: z$1.ZodOptional;\n details: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"provider/modelFallback\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n originalModel: z$1.ZodString;\n fallbackModel: z$1.ZodString;\n reason: z$1.ZodEnum<{\n refusal: \"refusal\";\n provider: \"provider\";\n }>;\n message: z$1.ZodString;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"provider/unhandled\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n providerId: z$1.ZodString;\n rawType: z$1.ZodString;\n rawEvent: z$1.ZodObject<{\n jsonrpc: z$1.ZodLiteral<\"2.0\">;\n id: z$1.ZodOptional>;\n method: z$1.ZodString;\n params: z$1.ZodOptional>>;\n }, z$1.core.$strip>;\n parentToolCallId: z$1.ZodOptional;\n}, z$1.core.$strip>], \"type\">, z$1.ZodObject<{\n scope: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"turn\">;\n turnId: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">;\n}, z$1.core.$strip>>, z$1.ZodIntersection;\n threadId: z$1.ZodString;\n direction: z$1.ZodLiteral<\"outbound\">;\n source: z$1.ZodEnum<{\n spawn: \"spawn\";\n tell: \"tell\";\n }>;\n initiator: z$1.ZodEnum<{\n system: \"system\";\n user: \"user\";\n agent: \"agent\";\n }>;\n request: z$1.ZodObject<{\n method: z$1.ZodEnum<{\n \"thread/start\": \"thread/start\";\n \"turn/start\": \"turn/start\";\n }>;\n params: z$1.ZodRecord;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"client/turn/requested\">;\n threadId: z$1.ZodString;\n direction: z$1.ZodLiteral<\"outbound\">;\n requestId: z$1.ZodString;\n source: z$1.ZodEnum<{\n spawn: \"spawn\";\n tell: \"tell\";\n }>;\n initiator: z$1.ZodEnum<{\n system: \"system\";\n user: \"user\";\n agent: \"agent\";\n }>;\n senderThreadId: z$1.ZodNullable;\n systemMessageKind: z$1.ZodOptional>;\n systemMessageSubject: z$1.ZodOptional;\n threadId: z$1.ZodString;\n threadName: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread-batch\">;\n count: z$1.ZodNumber;\n }, z$1.core.$strip>], \"kind\">>>;\n input: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n inputGroups: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>>>;\n target: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread-start\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"new-turn\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"auto\">;\n expectedTurnId: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"steer\">;\n expectedTurnId: z$1.ZodNullable;\n }, z$1.core.$strip>], \"kind\">;\n request: z$1.ZodObject<{\n method: z$1.ZodEnum<{\n \"thread/start\": \"thread/start\";\n \"turn/start\": \"turn/start\";\n }>;\n params: z$1.ZodRecord;\n }, z$1.core.$strip>;\n execution: z$1.ZodObject<{\n seq: z$1.ZodOptional;\n model: z$1.ZodString;\n serviceTier: z$1.ZodEnum<{\n default: \"default\";\n fast: \"fast\";\n }>;\n reasoningLevel: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n source: z$1.ZodEnum<{\n \"client/thread/start\": \"client/thread/start\";\n \"client/turn/requested\": \"client/turn/requested\";\n \"client/turn/start\": \"client/turn/start\";\n }>;\n permissionMode: z$1.ZodEnum<{\n readonly: \"readonly\";\n full: \"full\";\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n \"workspace-write\": \"workspace-write\";\n }>;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"client/turn/start\">;\n threadId: z$1.ZodString;\n direction: z$1.ZodLiteral<\"outbound\">;\n source: z$1.ZodEnum<{\n spawn: \"spawn\";\n tell: \"tell\";\n }>;\n initiator: z$1.ZodEnum<{\n system: \"system\";\n user: \"user\";\n agent: \"agent\";\n }>;\n request: z$1.ZodObject<{\n method: z$1.ZodEnum<{\n \"thread/start\": \"thread/start\";\n \"turn/start\": \"turn/start\";\n }>;\n params: z$1.ZodRecord;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"system/error\">;\n threadId: z$1.ZodString;\n code: z$1.ZodOptional;\n message: z$1.ZodString;\n detail: z$1.ZodOptional;\n reconnectAttempt: z$1.ZodOptional;\n reconnectTotal: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"system/manager/user_message\">;\n threadId: z$1.ZodString;\n text: z$1.ZodString;\n toolCallId: z$1.ZodOptional;\n turnId: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"system/thread/interrupted\">;\n threadId: z$1.ZodString;\n reason: z$1.ZodEnum<{\n \"manual-stop\": \"manual-stop\";\n \"host-daemon-restarted\": \"host-daemon-restarted\";\n \"provider-turn-idle\": \"provider-turn-idle\";\n }>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"system/operation\">;\n threadId: z$1.ZodString;\n operation: z$1.ZodString;\n status: z$1.ZodString;\n message: z$1.ZodString;\n operationId: z$1.ZodString;\n metadata: z$1.ZodOptional>>>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"system/permissionGrant/lifecycle\">;\n threadId: z$1.ZodString;\n interactionId: z$1.ZodString;\n providerId: z$1.ZodString;\n providerRequestId: z$1.ZodString;\n status: z$1.ZodEnum<{\n interrupted: \"interrupted\";\n pending: \"pending\";\n resolving: \"resolving\";\n resolved: \"resolved\";\n }>;\n resolution: z$1.ZodDefault;\n grantedPermissions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"allow_for_session\">;\n grantedPermissions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"deny\">;\n }, z$1.core.$strip>], \"decision\">>>;\n statusReason: z$1.ZodDefault>;\n subject: z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"permission_grant\">;\n itemId: z$1.ZodString;\n toolName: z$1.ZodNullable;\n permissions: z$1.ZodObject<{\n network: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"system/userQuestion/lifecycle\">;\n threadId: z$1.ZodString;\n interactionId: z$1.ZodString;\n providerId: z$1.ZodString;\n providerRequestId: z$1.ZodString;\n status: z$1.ZodEnum<{\n interrupted: \"interrupted\";\n pending: \"pending\";\n resolving: \"resolving\";\n resolved: \"resolved\";\n }>;\n resolution: z$1.ZodDefault;\n answers: z$1.ZodRecord;\n freeText: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>>;\n statusReason: z$1.ZodDefault>;\n payload: z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"user_question\">;\n questions: z$1.ZodArray;\n multiSelect: z$1.ZodBoolean;\n options: z$1.ZodOptional;\n }, z$1.core.$strip>>>;\n allowFreeText: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"system/thread-provisioning\">;\n threadId: z$1.ZodString;\n provisioningId: z$1.ZodString;\n status: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n active: \"active\";\n cancelled: \"cancelled\";\n }>;\n environmentId: z$1.ZodString;\n entries: z$1.ZodArray;\n key: z$1.ZodString;\n text: z$1.ZodString;\n startedAt: z$1.ZodOptional;\n status: z$1.ZodOptional>;\n metadata: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"system/provider-turn-watchdog\">;\n threadId: z$1.ZodString;\n reason: z$1.ZodLiteral<\"provider-turn-idle\">;\n thresholdMs: z$1.ZodNumber;\n elapsedMs: z$1.ZodNumber;\n activeTurnId: z$1.ZodString;\n activeTurnStartedAt: z$1.ZodNumber;\n lastActivityEventSequence: z$1.ZodNumber;\n lastActivityEventType: z$1.ZodString;\n lastActivityEventAt: z$1.ZodNumber;\n providerId: z$1.ZodString;\n providerThreadId: z$1.ZodNullable;\n firedAt: z$1.ZodNumber;\n}, z$1.core.$strip>]>, z$1.ZodObject<{\n scope: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"turn\">;\n turnId: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">;\n}, z$1.core.$strip>>]>>;\ntype ThreadEvent = z$1.infer;\ntype ThreadEventType = ThreadEvent[\"type\"];\n\ndeclare const providerInfoSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n displayName: z$1.ZodString;\n logoUrl: z$1.ZodNullable;\n capabilities: z$1.ZodObject<{\n supportsArchive: z$1.ZodBoolean;\n supportsRename: z$1.ZodBoolean;\n supportsServiceTier: z$1.ZodBoolean;\n supportsUserQuestion: z$1.ZodBoolean;\n supportsFork: z$1.ZodBoolean;\n supportedPermissionModes: z$1.ZodArray>;\n }, z$1.core.$strip>;\n composerActions: z$1.ZodArray;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plan\">;\n command: z$1.ZodObject<{\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n trailingText: z$1.ZodString;\n }, z$1.core.$strip>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"goal\">;\n command: z$1.ZodObject<{\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n trailingText: z$1.ZodString;\n }, z$1.core.$strip>;\n }, z$1.core.$strip>], \"kind\">>;\n available: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype ProviderInfo = z$1.infer;\n\ndeclare const threadEventScopeSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n}, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"turn\">;\n turnId: z$1.ZodString;\n}, z$1.core.$strip>], \"kind\">;\ntype ThreadEventScope = z$1.infer;\n\ntype ThreadEventByType = {\n [TType in ThreadEventType]: Extract;\n};\ntype ThreadEventForType = ThreadEventByType[TType];\ntype StoredThreadEventDataFromEvent = Omit;\ninterface ThreadEventRowBase {\n id: string;\n scope: ThreadEventScope;\n threadId: string;\n seq: number;\n createdAt: number;\n}\ntype ThreadEventRowFromEvent = ThreadEventRowBase & {\n type: TEvent[\"type\"];\n data: StoredThreadEventDataFromEvent;\n};\ntype ThreadEventRowOfType = ThreadEventRowFromEvent>;\ntype ThreadEventRow = {\n [TType in ThreadEventType]: ThreadEventRowOfType;\n}[ThreadEventType];\n\ndeclare const threadStatusSchema: z$1.ZodEnum<{\n error: \"error\";\n active: \"active\";\n starting: \"starting\";\n idle: \"idle\";\n stopping: \"stopping\";\n}>;\ntype ThreadStatus = z$1.infer;\n\ndeclare const threadTimelinePendingTodosSchema: z$1.ZodObject<{\n sourceSeq: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n items: z$1.ZodArray;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype ThreadTimelinePendingTodos = z$1.infer;\n\ndeclare const threadQueuedMessageSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n content: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n model: z$1.ZodString;\n reasoningLevel: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n permissionMode: z$1.ZodEnum<{\n full: \"full\";\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n }>;\n serviceTier: z$1.ZodEnum<{\n default: \"default\";\n fast: \"fast\";\n }>;\n groupWithNext: z$1.ZodBoolean;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype ThreadQueuedMessage = z$1.infer;\n\ndeclare const 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;\n workspace: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"unmanaged\">;\n path: z$1.ZodNullable;\n branch: z$1.ZodOptional;\n name: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"new\">;\n baseBranch: z$1.ZodString;\n }, z$1.core.$strict>], \"kind\">>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"managed-worktree\">;\n baseBranch: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"named\">;\n name: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"default\">;\n }, z$1.core.$strip>], \"kind\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"personal\">;\n }, z$1.core.$strip>], \"type\">;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"project-default\">;\n}, z$1.core.$strip>], \"type\">;\ntype CreateThreadEnvironmentArgs = z$1.infer;\ndeclare const workspaceFileListResponseSchema: z$1.ZodObject<{\n files: z$1.ZodArray>;\n truncated: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype WorkspaceFileListResponse = z$1.infer;\ndeclare const workspacePathListResponseSchema: z$1.ZodObject<{\n paths: z$1.ZodArray;\n path: z$1.ZodString;\n name: z$1.ZodString;\n score: z$1.ZodNumber;\n positions: z$1.ZodArray;\n }, z$1.core.$strip>>;\n truncated: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype WorkspacePathListResponse = z$1.infer;\n\ndeclare const createProjectSourceRequestSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n hostId: z$1.ZodString;\n type: z$1.ZodLiteral<\"local_path\">;\n path: z$1.ZodPipe>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n hostId: z$1.ZodString;\n type: z$1.ZodLiteral<\"clone\">;\n targetPath: z$1.ZodOptional>>;\n remoteUrl: z$1.ZodOptional;\n}, z$1.core.$strict>], \"type\">;\ntype CreateProjectSourceRequest = z$1.infer;\ndeclare const createProjectRequestSchema: z$1.ZodObject<{\n name: z$1.ZodString;\n source: z$1.ZodObject<{\n hostId: z$1.ZodString;\n type: z$1.ZodLiteral<\"local_path\">;\n path: z$1.ZodPipe>;\n }, z$1.core.$strict>;\n}, z$1.core.$strip>;\ntype CreateProjectRequest = z$1.infer;\ndeclare const threadSectionSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n name: z$1.ZodString;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n}, z$1.core.$strict>;\ntype ThreadSectionResponse = z$1.infer;\ndeclare const createThreadSectionRequestSchema: z$1.ZodObject<{\n name: z$1.ZodString;\n}, z$1.core.$strict>;\ntype CreateThreadSectionRequest = z$1.infer;\ndeclare const updateThreadSectionRequestSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n name: z$1.ZodString;\n}, z$1.core.$strict>;\ntype UpdateThreadSectionRequest = z$1.infer;\ndeclare const deleteThreadSectionRequestSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n}, z$1.core.$strict>;\ntype DeleteThreadSectionRequest = z$1.infer;\ndeclare const threadSectionMutationResponseSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n name: z$1.ZodString;\n updatedThreadCount: z$1.ZodNumber;\n}, z$1.core.$strict>;\ntype ThreadSectionMutationResponse = z$1.infer;\ndeclare const reorderProjectRequestSchema: z$1.ZodObject<{\n previousProjectId: z$1.ZodNullable;\n nextProjectId: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype ReorderProjectRequest = z$1.infer;\ndeclare const projectListQuerySchema: z$1.ZodObject<{\n include: z$1.ZodOptional;\n includePersonal: z$1.ZodOptional>;\n}, z$1.core.$strip>;\ntype ProjectListQuery = z$1.infer;\ndeclare const projectFilesQuerySchema: z$1.ZodObject<{\n query: z$1.ZodOptional>;\n limit: z$1.ZodOptional>;\n hostId: z$1.ZodOptional;\n environmentId: z$1.ZodOptional, z$1.ZodOptional>>;\n}, z$1.core.$strip>;\ntype ProjectFilesQuery = z$1.infer;\ndeclare const projectPathsQuerySchema: z$1.ZodObject<{\n query: z$1.ZodOptional>;\n limit: z$1.ZodOptional>;\n includeFiles: z$1.ZodEnum<{\n true: \"true\";\n false: \"false\";\n }>;\n includeDirectories: z$1.ZodEnum<{\n true: \"true\";\n false: \"false\";\n }>;\n hostId: z$1.ZodOptional;\n environmentId: z$1.ZodOptional, z$1.ZodOptional>>;\n}, z$1.core.$strip>;\ntype ProjectPathsQuery = z$1.infer;\ndeclare const projectFileContentQuerySchema: z$1.ZodObject<{\n path: z$1.ZodString;\n hostId: z$1.ZodOptional;\n environmentId: z$1.ZodOptional, z$1.ZodOptional>>;\n}, z$1.core.$strip>;\ntype ProjectFileContentQuery = z$1.infer;\ndeclare const projectBranchesQuerySchema: z$1.ZodObject<{\n query: z$1.ZodOptional;\n limit: z$1.ZodOptional;\n hostId: z$1.ZodString;\n selectedBranch: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype ProjectBranchesQuery = z$1.infer;\ndeclare const projectBranchesResponseSchema: z$1.ZodObject<{\n branches: z$1.ZodArray;\n branchesTruncated: z$1.ZodBoolean;\n checkout: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"branch\">;\n branchName: z$1.ZodString;\n headSha: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"detached\">;\n headSha: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unborn\">;\n branchName: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unknown\">;\n reason: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">;\n defaultBranch: z$1.ZodNullable;\n defaultBranchRelation: z$1.ZodNullable>;\n hasUncommittedChanges: z$1.ZodBoolean;\n operation: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"none\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"merge\">;\n hasConflicts: z$1.ZodBoolean;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"rebase\">;\n hasConflicts: z$1.ZodBoolean;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"cherry-pick\">;\n hasConflicts: z$1.ZodBoolean;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"revert\">;\n hasConflicts: z$1.ZodBoolean;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unknown\">;\n reason: z$1.ZodString;\n hasConflicts: z$1.ZodBoolean;\n }, z$1.core.$strip>], \"kind\">;\n originDefaultBranch: z$1.ZodNullable;\n remoteBranches: z$1.ZodArray;\n remoteBranchesTruncated: z$1.ZodBoolean;\n selectedBranch: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n defaultWorktreeBaseBranch: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype ProjectBranchesResponse = z$1.infer;\ndeclare const promptHistoryQuerySchema: z$1.ZodObject<{\n limit: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype PromptHistoryQuery = z$1.infer;\ndeclare const promptHistoryResponseSchema: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n}, z$1.core.$strip>>;\ntype PromptHistoryResponse = z$1.infer;\ndeclare const updateProjectRequestSchema: z$1.ZodObject<{\n name: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype UpdateProjectRequest = z$1.infer;\ndeclare const updateProjectSourceRequestSchema: z$1.ZodObject<{\n type: z$1.ZodLiteral<\"local_path\">;\n path: z$1.ZodOptional>>;\n isDefault: z$1.ZodOptional>;\n}, z$1.core.$strict>;\ntype UpdateProjectSourceRequest = z$1.infer;\ndeclare const commandListResponseSchema: z$1.ZodObject<{\n commands: z$1.ZodArray;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n description: z$1.ZodNullable;\n argumentHint: z$1.ZodNullable;\n pluginId: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype CommandListResponse = z$1.infer;\n/** Query for the complete command catalog available to a project and provider. */\ndeclare const projectCommandsQuerySchema: z$1.ZodObject<{\n provider: z$1.ZodString;\n hostId: z$1.ZodOptional;\n environmentId: z$1.ZodOptional, z$1.ZodOptional>>;\n}, z$1.core.$strict>;\ntype ProjectCommandsQuery = z$1.infer;\ndeclare const skillListResponseSchema: z$1.ZodObject<{\n skills: z$1.ZodArray;\n provider: z$1.ZodNullable>;\n scope: z$1.ZodEnum<{\n plugin: \"plugin\";\n \"bb-builtin\": \"bb-builtin\";\n \"bb-user\": \"bb-user\";\n \"bb-project\": \"bb-project\";\n \"claude-user\": \"claude-user\";\n \"claude-project\": \"claude-project\";\n \"codex-user\": \"codex-user\";\n \"codex-project\": \"codex-project\";\n }>;\n pluginId: z$1.ZodNullable;\n filePath: z$1.ZodString;\n manageable: z$1.ZodBoolean;\n registrySkillId: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype SkillListResponse = z$1.infer;\ndeclare const skillContentResponseSchema: z$1.ZodObject<{\n content: z$1.ZodString;\n revision: z$1.ZodString;\n}, z$1.core.$strip>;\ntype SkillContentResponse = z$1.infer;\ndeclare const skillFilesResponseSchema: z$1.ZodObject<{\n files: z$1.ZodArray;\n truncated: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype SkillFilesResponse = z$1.infer;\ndeclare const projectResponseSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodEnum<{\n personal: \"personal\";\n standard: \"standard\";\n }>;\n name: z$1.ZodString;\n gitRemoteUrl: z$1.ZodNullable;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n sources: z$1.ZodArray;\n hostId: z$1.ZodString;\n path: z$1.ZodString;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype ProjectResponse = z$1.infer;\ndeclare const projectWithThreadsResponseSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodEnum<{\n personal: \"personal\";\n standard: \"standard\";\n }>;\n name: z$1.ZodString;\n gitRemoteUrl: z$1.ZodNullable;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n sources: z$1.ZodArray;\n hostId: z$1.ZodString;\n path: z$1.ZodString;\n }, z$1.core.$strip>>;\n threads: z$1.ZodArray;\n providerId: z$1.ZodString;\n title: z$1.ZodNullable;\n titleFallback: z$1.ZodNullable;\n sectionId: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n error: \"error\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n }>;\n parentThreadId: z$1.ZodNullable;\n sourceThreadId: z$1.ZodNullable;\n originKind: z$1.ZodNullable>;\n childOrigin: z$1.ZodNullable>;\n originPluginId: z$1.ZodNullable;\n visibility: z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>;\n archivedAt: z$1.ZodNullable;\n pinnedAt: z$1.ZodNullable;\n deletedAt: z$1.ZodNullable;\n lastReadAt: z$1.ZodNullable;\n latestAttentionAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n runtime: z$1.ZodObject<{\n displayStatus: z$1.ZodEnum<{\n error: \"error\";\n provisioning: \"provisioning\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n \"host-reconnecting\": \"host-reconnecting\";\n \"waiting-for-host\": \"waiting-for-host\";\n }>;\n hostReconnectGraceExpiresAt: z$1.ZodNullable;\n }, z$1.core.$strip>;\n activity: z$1.ZodObject<{\n activeWorkflowCount: z$1.ZodNumber;\n activeBackgroundAgentCount: z$1.ZodNumber;\n activeBackgroundCommandCount: z$1.ZodNumber;\n activePlanModeCount: z$1.ZodNumber;\n activeGoalCount: z$1.ZodNumber;\n }, z$1.core.$strip>;\n pinSortKey: z$1.ZodNullable;\n hasPendingInteraction: z$1.ZodBoolean;\n environmentHostId: z$1.ZodNullable;\n environmentName: z$1.ZodNullable;\n environmentBranchName: z$1.ZodNullable;\n environmentWorkspaceDisplayKind: z$1.ZodEnum<{\n \"managed-worktree\": \"managed-worktree\";\n \"unmanaged-worktree\": \"unmanaged-worktree\";\n other: \"other\";\n }>;\n }, z$1.core.$strip>>;\n defaultExecutionOptions: z$1.ZodNullable;\n reasoningLevel: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n permissionMode: z$1.ZodEnum<{\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n full: \"full\";\n }>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype ProjectWithThreadsResponse = z$1.infer;\ndeclare const uploadedPromptAttachmentSchema: z$1.ZodObject<{\n type: z$1.ZodEnum<{\n localImage: \"localImage\";\n localFile: \"localFile\";\n }>;\n path: z$1.ZodString;\n name: z$1.ZodString;\n mimeType: z$1.ZodOptional;\n sizeBytes: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype UploadedPromptAttachment = z$1.infer;\ndeclare const copyProjectAttachmentsRequestSchema: z$1.ZodObject<{\n sourceProjectId: z$1.ZodString;\n paths: z$1.ZodArray;\n}, z$1.core.$strict>;\ntype CopyProjectAttachmentsRequest = z$1.infer;\n\ndeclare const registrySkillSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n source: z$1.ZodString;\n skillId: z$1.ZodString;\n name: z$1.ZodString;\n installs: z$1.ZodNumber;\n stars: z$1.ZodNullable;\n installUrl: z$1.ZodNullable;\n url: z$1.ZodString;\n topic: z$1.ZodNullable;\n summary: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype RegistrySkill = z$1.infer;\ndeclare const registrySkillsPageSchema: z$1.ZodObject<{\n skills: z$1.ZodArray;\n installUrl: z$1.ZodNullable;\n url: z$1.ZodString;\n topic: z$1.ZodNullable;\n summary: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n pagination: z$1.ZodObject<{\n page: z$1.ZodNumber;\n perPage: z$1.ZodNumber;\n total: z$1.ZodNumber;\n hasMore: z$1.ZodBoolean;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>;\ntype RegistrySkillsPage = z$1.infer;\ndeclare const registryRepositoryStarsSchema: z$1.ZodObject<{\n stars: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype RegistryRepositoryStars = z$1.infer;\ndeclare const registrySkillDetailSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n source: z$1.ZodString;\n skillId: z$1.ZodString;\n hash: z$1.ZodNullable;\n files: z$1.ZodNullable>>;\n}, z$1.core.$strip>;\ntype RegistrySkillDetail = z$1.infer;\ndeclare const registrySkillInstallResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n filePath: z$1.ZodString;\n}, z$1.core.$strip>;\ntype RegistrySkillInstallResponse = z$1.infer;\n\ndeclare const updateEnvironmentRequestSchema: z$1.ZodObject<{\n mergeBaseBranch: z$1.ZodOptional>;\n name: z$1.ZodOptional>;\n}, z$1.core.$strip>;\ntype UpdateEnvironmentRequest = z$1.infer;\n/**\n * Query for searching paths in an environment's workspace. Unlike the\n * project-scoped variant this needs no `environmentId` — the environment is\n * the route param — and is project-agnostic, so it works for projectless\n * (personal) environments too.\n */\ndeclare const environmentPathsQuerySchema: z$1.ZodObject<{\n query: z$1.ZodOptional;\n limit: z$1.ZodOptional;\n includeFiles: z$1.ZodEnum<{\n true: \"true\";\n false: \"false\";\n }>;\n includeDirectories: z$1.ZodEnum<{\n true: \"true\";\n false: \"false\";\n }>;\n}, z$1.core.$strip>;\ntype EnvironmentPathsQuery = z$1.infer;\ndeclare const environmentDiffBranchesQuerySchema: z$1.ZodObject<{\n query: z$1.ZodOptional;\n limit: z$1.ZodOptional;\n selectedBranch: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype EnvironmentDiffBranchesQuery = z$1.infer;\ndeclare const environmentDiffBranchesResponseSchema: z$1.ZodObject<{\n branches: z$1.ZodArray;\n branchesTruncated: z$1.ZodBoolean;\n remoteBranches: z$1.ZodArray;\n remoteBranchesTruncated: z$1.ZodBoolean;\n selectedBranch: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype EnvironmentDiffBranchesResponse = z$1.infer;\ndeclare const environmentStatusQuerySchema: z$1.ZodObject<{\n mergeBaseBranch: z$1.ZodOptional>;\n}, z$1.core.$strip>;\ntype EnvironmentStatusQuery = z$1.infer;\ndeclare const environmentDiffQuerySchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n target: z$1.ZodLiteral<\"uncommitted\">;\n}, z$1.core.$strip>, z$1.ZodObject<{\n target: z$1.ZodLiteral<\"branch_committed\">;\n mergeBaseBranch: z$1.ZodPipe;\n}, z$1.core.$strip>, z$1.ZodObject<{\n target: z$1.ZodLiteral<\"all\">;\n mergeBaseBranch: z$1.ZodPipe;\n}, z$1.core.$strip>, z$1.ZodObject<{\n target: z$1.ZodLiteral<\"commit\">;\n sha: z$1.ZodString;\n}, z$1.core.$strip>], \"target\">;\ntype EnvironmentDiffQuery = z$1.infer;\n/**\n * Query for fetching a single file's contents at one side of a diff target.\n * Used by the diff card to reparse the card's patch with full old/new contents\n * so `@pierre/diffs` can render expand-context buttons between hunks.\n *\n * For `branch_committed` / `all`, callers pass the resolved merge-base SHA\n * (`mergeBaseRef`, surfaced by `workspace.diff`) rather than the branch name\n * — the diff itself was computed against that SHA, so reading the old side\n * from the same SHA keeps the file content aligned with the hunk line\n * numbers. Reading from the branch tip is wrong whenever the branch has\n * moved past the merge-base since the file existed there.\n */\ndeclare const environmentDiffFileQuerySchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n target: z$1.ZodLiteral<\"uncommitted\">;\n path: z$1.ZodString;\n side: z$1.ZodEnum<{\n new: \"new\";\n old: \"old\";\n }>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n target: z$1.ZodLiteral<\"branch_committed\">;\n mergeBaseRef: z$1.ZodString;\n path: z$1.ZodString;\n side: z$1.ZodEnum<{\n new: \"new\";\n old: \"old\";\n }>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n target: z$1.ZodLiteral<\"all\">;\n mergeBaseRef: z$1.ZodString;\n path: z$1.ZodString;\n side: z$1.ZodEnum<{\n new: \"new\";\n old: \"old\";\n }>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n target: z$1.ZodLiteral<\"commit\">;\n sha: z$1.ZodString;\n path: z$1.ZodString;\n side: z$1.ZodEnum<{\n new: \"new\";\n old: \"old\";\n }>;\n}, z$1.core.$strip>], \"target\">;\ntype EnvironmentDiffFileQuery = z$1.infer;\ndeclare const environmentDiffFileResponseSchema: z$1.ZodObject<{\n path: z$1.ZodString;\n content: z$1.ZodString;\n contentEncoding: z$1.ZodEnum<{\n utf8: \"utf8\";\n base64: \"base64\";\n }>;\n mimeType: z$1.ZodOptional;\n sizeBytes: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype EnvironmentDiffFileResponse = z$1.infer;\ndeclare const environmentArchiveThreadsResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n archivedThreadIds: z$1.ZodArray;\n}, z$1.core.$strip>;\ntype EnvironmentArchiveThreadsResponse = z$1.infer;\ndeclare const pullRequestMergeMethodSchema: z$1.ZodEnum<{\n merge: \"merge\";\n rebase: \"rebase\";\n squash: \"squash\";\n}>;\ntype PullRequestMergeMethod = z$1.infer;\ndeclare const commitActionResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n action: z$1.ZodLiteral<\"commit\">;\n message: z$1.ZodString;\n commitSha: z$1.ZodString;\n commitSubject: z$1.ZodString;\n}, z$1.core.$strip>;\ntype CommitActionResponse = z$1.infer;\ndeclare const squashMergeActionResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n action: z$1.ZodLiteral<\"squash_merge\">;\n merged: z$1.ZodBoolean;\n message: z$1.ZodString;\n commitSha: z$1.ZodString;\n commitSubject: z$1.ZodString;\n}, z$1.core.$strip>;\ntype SquashMergeActionResponse = z$1.infer;\ndeclare const pullRequestReadyActionResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n action: z$1.ZodLiteral<\"pull_request_ready\">;\n message: z$1.ZodString;\n}, z$1.core.$strip>;\ntype PullRequestReadyActionResponse = z$1.infer;\ndeclare const pullRequestMergeActionResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n action: z$1.ZodLiteral<\"pull_request_merge\">;\n method: z$1.ZodEnum<{\n merge: \"merge\";\n rebase: \"rebase\";\n squash: \"squash\";\n }>;\n message: z$1.ZodString;\n}, z$1.core.$strip>;\ntype PullRequestMergeActionResponse = z$1.infer;\ndeclare const pullRequestDraftActionResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n action: z$1.ZodLiteral<\"pull_request_draft\">;\n message: z$1.ZodString;\n}, z$1.core.$strip>;\ntype PullRequestDraftActionResponse = z$1.infer;\ndeclare const environmentStatusResponseSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n workspace: z$1.ZodObject<{\n workingTree: z$1.ZodObject<{\n insertions: z$1.ZodNumber;\n deletions: z$1.ZodNumber;\n files: z$1.ZodArray;\n insertions: z$1.ZodNullable;\n deletions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n hasUncommittedChanges: z$1.ZodBoolean;\n state: z$1.ZodEnum<{\n clean: \"clean\";\n untracked: \"untracked\";\n dirty_uncommitted: \"dirty_uncommitted\";\n committed_unmerged: \"committed_unmerged\";\n dirty_and_committed_unmerged: \"dirty_and_committed_unmerged\";\n }>;\n }, z$1.core.$strip>;\n checkout: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"branch\">;\n branchName: z$1.ZodString;\n headSha: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"detached\">;\n headSha: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unborn\">;\n branchName: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unknown\">;\n reason: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">;\n branch: z$1.ZodObject<{\n currentBranch: z$1.ZodNullable;\n defaultBranch: z$1.ZodString;\n }, z$1.core.$strip>;\n mergeBase: z$1.ZodNullable;\n insertions: z$1.ZodNullable;\n deletions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n mergeBaseBranch: z$1.ZodString;\n baseRef: z$1.ZodNullable;\n aheadCount: z$1.ZodNumber;\n behindCount: z$1.ZodNumber;\n hasCommittedUnmergedChanges: z$1.ZodBoolean;\n commits: z$1.ZodArray>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"not_applicable\">;\n reason: z$1.ZodEnum<{\n non_git_environment: \"non_git_environment\";\n }>;\n message: z$1.ZodString;\n}, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"unavailable\">;\n failure: z$1.ZodObject<{\n code: z$1.ZodEnum<{\n unknown: \"unknown\";\n path_not_found: \"path_not_found\";\n not_git_repo: \"not_git_repo\";\n not_worktree: \"not_worktree\";\n workspace_type_mismatch: \"workspace_type_mismatch\";\n permission_denied: \"permission_denied\";\n unknown_environment: \"unknown_environment\";\n }>;\n workspacePath: z$1.ZodString;\n message: z$1.ZodString;\n }, z$1.core.$strict>;\n}, z$1.core.$strict>], \"outcome\">;\n/**\n * Structured pull-request lookup outcome. \"absent\" is a real answer — the\n * host checked and the branch has no PR (non-git environments resolve to\n * \"absent\" without a daemon call). \"unavailable\" means the lookup itself\n * failed (gh missing, not authenticated, timeout, unreachable workspace), so\n * callers must not render it as \"no PR exists\".\n */\ndeclare const environmentPullRequestResponseSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n pullRequest: z$1.ZodObject<{\n number: z$1.ZodNumber;\n title: z$1.ZodString;\n state: z$1.ZodEnum<{\n merged: \"merged\";\n draft: \"draft\";\n open: \"open\";\n closed: \"closed\";\n }>;\n url: z$1.ZodString;\n baseRefName: z$1.ZodString;\n headRefName: z$1.ZodString;\n updatedAt: z$1.ZodString;\n checks: z$1.ZodObject<{\n state: z$1.ZodEnum<{\n unknown: \"unknown\";\n pending: \"pending\";\n passing: \"passing\";\n failing: \"failing\";\n no_checks: \"no_checks\";\n }>;\n totalCount: z$1.ZodNumber;\n passedCount: z$1.ZodNumber;\n failedCount: z$1.ZodNumber;\n pendingCount: z$1.ZodNumber;\n }, z$1.core.$strict>;\n review: z$1.ZodObject<{\n state: z$1.ZodEnum<{\n none: \"none\";\n approved: \"approved\";\n changes_requested: \"changes_requested\";\n review_required: \"review_required\";\n review_requested: \"review_requested\";\n }>;\n reviewRequestCount: z$1.ZodNumber;\n }, z$1.core.$strict>;\n mergeability: z$1.ZodObject<{\n state: z$1.ZodEnum<{\n unknown: \"unknown\";\n draft: \"draft\";\n mergeable: \"mergeable\";\n conflicts: \"conflicts\";\n blocked: \"blocked\";\n }>;\n mergeStateStatus: z$1.ZodNullable>;\n mergeable: z$1.ZodNullable>;\n }, z$1.core.$strict>;\n attention: z$1.ZodEnum<{\n none: \"none\";\n merged: \"merged\";\n draft: \"draft\";\n closed: \"closed\";\n changes_requested: \"changes_requested\";\n review_requested: \"review_requested\";\n conflicts: \"conflicts\";\n blocked: \"blocked\";\n checks_failed: \"checks_failed\";\n checks_pending: \"checks_pending\";\n ready_to_merge: \"ready_to_merge\";\n }>;\n }, z$1.core.$strict>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"absent\">;\n}, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"unavailable\">;\n message: z$1.ZodString;\n}, z$1.core.$strict>], \"outcome\">;\ntype EnvironmentPullRequestResponse = z$1.infer;\ndeclare const environmentDiffResponseSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n diff: z$1.ZodObject<{\n diff: z$1.ZodString;\n truncated: z$1.ZodBoolean;\n shortstat: z$1.ZodString;\n files: z$1.ZodString;\n mergeBaseRef: z$1.ZodNullable;\n }, z$1.core.$strip>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"not_applicable\">;\n reason: z$1.ZodEnum<{\n non_git_environment: \"non_git_environment\";\n }>;\n message: z$1.ZodString;\n}, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"unavailable\">;\n failure: z$1.ZodObject<{\n code: z$1.ZodEnum<{\n unknown: \"unknown\";\n path_not_found: \"path_not_found\";\n not_git_repo: \"not_git_repo\";\n not_worktree: \"not_worktree\";\n workspace_type_mismatch: \"workspace_type_mismatch\";\n permission_denied: \"permission_denied\";\n unknown_environment: \"unknown_environment\";\n }>;\n workspacePath: z$1.ZodString;\n message: z$1.ZodString;\n }, z$1.core.$strict>;\n}, z$1.core.$strict>], \"outcome\">;\ntype EnvironmentDiffResponse = z$1.infer;\ndeclare const environmentDiffFilesResponseSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n files: z$1.ZodArray;\n changeKind: z$1.ZodEnum<{\n deleted: \"deleted\";\n added: \"added\";\n modified: \"modified\";\n renamed: \"renamed\";\n copied: \"copied\";\n type_changed: \"type_changed\";\n }>;\n additions: z$1.ZodNumber;\n deletions: z$1.ZodNumber;\n binary: z$1.ZodBoolean;\n origin: z$1.ZodEnum<{\n untracked: \"untracked\";\n tracked: \"tracked\";\n }>;\n loadMode: z$1.ZodEnum<{\n auto: \"auto\";\n on_demand: \"on_demand\";\n too_large: \"too_large\";\n }>;\n }, z$1.core.$strip>>;\n shortstat: z$1.ZodString;\n mergeBaseRef: z$1.ZodNullable;\n initialPatches: z$1.ZodArray>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"not_applicable\">;\n reason: z$1.ZodEnum<{\n non_git_environment: \"non_git_environment\";\n too_many_files: \"too_many_files\";\n }>;\n message: z$1.ZodString;\n}, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"unavailable\">;\n failure: z$1.ZodObject<{\n code: z$1.ZodEnum<{\n unknown: \"unknown\";\n path_not_found: \"path_not_found\";\n not_git_repo: \"not_git_repo\";\n not_worktree: \"not_worktree\";\n workspace_type_mismatch: \"workspace_type_mismatch\";\n permission_denied: \"permission_denied\";\n unknown_environment: \"unknown_environment\";\n }>;\n workspacePath: z$1.ZodString;\n message: z$1.ZodString;\n }, z$1.core.$strict>;\n}, z$1.core.$strict>], \"outcome\">;\ntype EnvironmentDiffFilesResponse = z$1.infer;\ndeclare const environmentDiffPatchResponseSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n patches: z$1.ZodArray>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"not_applicable\">;\n reason: z$1.ZodEnum<{\n non_git_environment: \"non_git_environment\";\n }>;\n message: z$1.ZodString;\n}, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"unavailable\">;\n failure: z$1.ZodObject<{\n code: z$1.ZodEnum<{\n unknown: \"unknown\";\n path_not_found: \"path_not_found\";\n not_git_repo: \"not_git_repo\";\n not_worktree: \"not_worktree\";\n workspace_type_mismatch: \"workspace_type_mismatch\";\n permission_denied: \"permission_denied\";\n unknown_environment: \"unknown_environment\";\n }>;\n workspacePath: z$1.ZodString;\n message: z$1.ZodString;\n }, z$1.core.$strict>;\n}, z$1.core.$strict>], \"outcome\">;\ntype EnvironmentDiffPatchResponse = z$1.infer;\n/**\n * Body for `POST /diff/patch`: the diff target plus the list of new paths whose\n * patches the client wants. A POST (not GET) because the repeated `paths` array\n * cannot survive flat query parsing. The client supplies only new paths; the\n * server re-derives each file's rename/copy pairing (`previousPath`) from its\n * own TOC.\n */\ndeclare const environmentDiffPatchRequestSchema: z$1.ZodObject<{\n target: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"uncommitted\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"branch_committed\">;\n mergeBaseBranch: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"all\">;\n mergeBaseBranch: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"commit\">;\n sha: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">;\n paths: z$1.ZodArray;\n}, z$1.core.$strict>;\ntype EnvironmentDiffPatchRequest = z$1.infer;\ntype EnvironmentStatusResponse = z$1.infer;\n\ndeclare const providerUsageResponseSchema: z$1.ZodObject<{\n codex: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n status: z$1.ZodLiteral<\"ok\">;\n accountEmail: z$1.ZodNullable;\n planLabel: z$1.ZodNullable;\n windows: z$1.ZodArray;\n cost: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"not_installed\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"unauthenticated\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"expired\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"error\">;\n message: z$1.ZodString;\n planLabel: z$1.ZodDefault>;\n accountEmail: z$1.ZodDefault>;\n }, z$1.core.$strip>], \"status\">;\n claudeCode: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n status: z$1.ZodLiteral<\"ok\">;\n accountEmail: z$1.ZodNullable;\n planLabel: z$1.ZodNullable;\n windows: z$1.ZodArray;\n cost: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"not_installed\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"unauthenticated\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"expired\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"error\">;\n message: z$1.ZodString;\n planLabel: z$1.ZodDefault>;\n accountEmail: z$1.ZodDefault>;\n }, z$1.core.$strip>], \"status\">;\n cursor: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n status: z$1.ZodLiteral<\"ok\">;\n accountEmail: z$1.ZodNullable;\n planLabel: z$1.ZodNullable;\n windows: z$1.ZodArray;\n cost: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"not_installed\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"unauthenticated\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"expired\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"error\">;\n message: z$1.ZodString;\n planLabel: z$1.ZodDefault>;\n accountEmail: z$1.ZodDefault>;\n }, z$1.core.$strip>], \"status\">;\n}, z$1.core.$strip>;\ntype ProviderUsageResponse = z$1.infer;\ndeclare const discoverReposResultSchema: z$1.ZodObject<{\n repos: z$1.ZodArray;\n agentSeen: z$1.ZodBoolean;\n agentSeenAt: z$1.ZodNullable;\n }, z$1.core.$strict>>;\n truncated: z$1.ZodBoolean;\n}, z$1.core.$strict>;\ntype DiscoverReposResult = z$1.infer;\ntype HostDaemonCommandTransport = \"settled\" | \"onlineRpc\";\ntype HostDaemonCommandEnvironmentLane = \"read\" | \"write\";\ntype HostDaemonFlushEventsBeforeResult = boolean | \"when-initiated\";\ninterface HostDaemonCommandDescriptor {\n type: Type;\n schema: Schema;\n resultSchema: ResultSchema;\n transport: Transport;\n retryable: Retryable;\n flushEventsBeforeResult: HostDaemonFlushEventsBeforeResult;\n envLane: HostDaemonCommandEnvironmentLane | null;\n}\ndeclare const hostDaemonCommandRegistry: {\n \"thread.start\": HostDaemonCommandDescriptor<\"thread.start\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n threadId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n projectId: z$1.ZodString;\n providerId: z$1.ZodString;\n acpLaunchSpec: z$1.ZodOptional;\n env: z$1.ZodRecord;\n cwd: z$1.ZodOptional;\n modelCli: z$1.ZodOptional;\n selectFlag: z$1.ZodOptional;\n primaryModels: z$1.ZodArray;\n }, z$1.core.$strict>, z$1.ZodTransform<{\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n } | undefined, {\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n }>>>;\n reasoningCli: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n nativeReasoning: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n permissionCli: z$1.ZodOptional>;\n workspaceWrite: z$1.ZodOptional>;\n readonly: z$1.ZodOptional>;\n insertAfterArgs: z$1.ZodOptional;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n options: z$1.ZodIntersection;\n reasoningLevel: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n claudeCodePermissionMode: z$1.ZodOptional>;\n claudeCodeMockCliTraffic: z$1.ZodOptional>;\n workflowsEnabled: z$1.ZodBoolean;\n memoryEnabled: z$1.ZodOptional;\n providerSubagentsEnabled: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n permissionMode: z$1.ZodLiteral<\"accept-edits\">;\n permissionScope: z$1.ZodLiteral<\"workspace\">;\n approvalReviewer: z$1.ZodLiteral<\"user\">;\n permissionEscalation: z$1.ZodEnum<{\n ask: \"ask\";\n deny: \"deny\";\n }>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n permissionMode: z$1.ZodLiteral<\"auto\">;\n permissionScope: z$1.ZodLiteral<\"workspace\">;\n approvalReviewer: z$1.ZodLiteral<\"automatic\">;\n permissionEscalation: z$1.ZodEnum<{\n ask: \"ask\";\n deny: \"deny\";\n }>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n permissionMode: z$1.ZodLiteral<\"full\">;\n permissionScope: z$1.ZodLiteral<\"full\">;\n approvalReviewer: z$1.ZodNull;\n permissionEscalation: z$1.ZodNull;\n }, z$1.core.$strip>], \"permissionMode\">>;\n instructions: z$1.ZodString;\n dynamicTools: z$1.ZodArray>;\n injectedSkillSources: z$1.ZodArray;\n treeHash: z$1.ZodString;\n entryPath: z$1.ZodString;\n sourceType: z$1.ZodEnum<{\n builtin: \"builtin\";\n \"data-dir\": \"data-dir\";\n }>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n name: z$1.ZodString;\n description: z$1.ZodString;\n kind: z$1.ZodLiteral<\"workspace-path\">;\n sourceType: z$1.ZodLiteral<\"project\">;\n sourceRootPath: z$1.ZodString;\n skillFilePath: z$1.ZodString;\n }, z$1.core.$strict>], \"kind\">>;\n disallowedTools: z$1.ZodOptional>;\n instructionMode: z$1.ZodEnum<{\n replace: \"replace\";\n append: \"append\";\n }>;\n type: z$1.ZodLiteral<\"thread.start\">;\n requestId: z$1.ZodString;\n input: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n builtin: \"builtin\";\n project: \"project\";\n user: \"user\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n inputGroups: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n builtin: \"builtin\";\n project: \"project\";\n user: \"user\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>>>;\n threadStoragePath: z$1.ZodOptional;\n fork: z$1.ZodOptional>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n providerThreadId: z$1.ZodString;\n }, z$1.core.$strip>, \"settled\", false>;\n \"turn.submit\": HostDaemonCommandDescriptor<\"turn.submit\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n threadId: z$1.ZodString;\n type: z$1.ZodLiteral<\"turn.submit\">;\n requestId: z$1.ZodString;\n input: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n builtin: \"builtin\";\n project: \"project\";\n user: \"user\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n inputGroups: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n builtin: \"builtin\";\n project: \"project\";\n user: \"user\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>>>;\n options: z$1.ZodIntersection;\n reasoningLevel: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n claudeCodePermissionMode: z$1.ZodOptional>;\n claudeCodeMockCliTraffic: z$1.ZodOptional>;\n workflowsEnabled: z$1.ZodBoolean;\n memoryEnabled: z$1.ZodOptional;\n providerSubagentsEnabled: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n permissionMode: z$1.ZodLiteral<\"accept-edits\">;\n permissionScope: z$1.ZodLiteral<\"workspace\">;\n approvalReviewer: z$1.ZodLiteral<\"user\">;\n permissionEscalation: z$1.ZodEnum<{\n ask: \"ask\";\n deny: \"deny\";\n }>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n permissionMode: z$1.ZodLiteral<\"auto\">;\n permissionScope: z$1.ZodLiteral<\"workspace\">;\n approvalReviewer: z$1.ZodLiteral<\"automatic\">;\n permissionEscalation: z$1.ZodEnum<{\n ask: \"ask\";\n deny: \"deny\";\n }>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n permissionMode: z$1.ZodLiteral<\"full\">;\n permissionScope: z$1.ZodLiteral<\"full\">;\n approvalReviewer: z$1.ZodNull;\n permissionEscalation: z$1.ZodNull;\n }, z$1.core.$strip>], \"permissionMode\">>;\n acpLaunchSpec: z$1.ZodOptional;\n env: z$1.ZodRecord;\n cwd: z$1.ZodOptional;\n modelCli: z$1.ZodOptional;\n selectFlag: z$1.ZodOptional;\n primaryModels: z$1.ZodArray;\n }, z$1.core.$strict>, z$1.ZodTransform<{\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n } | undefined, {\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n }>>>;\n reasoningCli: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n nativeReasoning: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n permissionCli: z$1.ZodOptional>;\n workspaceWrite: z$1.ZodOptional>;\n readonly: z$1.ZodOptional>;\n insertAfterArgs: z$1.ZodOptional;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n resumeContext: z$1.ZodObject<{\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n instructionMode: z$1.ZodEnum<{\n replace: \"replace\";\n append: \"append\";\n }>;\n projectId: z$1.ZodString;\n providerId: z$1.ZodString;\n acpLaunchSpec: z$1.ZodOptional;\n env: z$1.ZodRecord;\n cwd: z$1.ZodOptional;\n modelCli: z$1.ZodOptional;\n selectFlag: z$1.ZodOptional;\n primaryModels: z$1.ZodArray;\n }, z$1.core.$strict>, z$1.ZodTransform<{\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n } | undefined, {\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n }>>>;\n reasoningCli: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n nativeReasoning: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n permissionCli: z$1.ZodOptional>;\n workspaceWrite: z$1.ZodOptional>;\n readonly: z$1.ZodOptional>;\n insertAfterArgs: z$1.ZodOptional;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n instructions: z$1.ZodString;\n dynamicTools: z$1.ZodArray>;\n injectedSkillSources: z$1.ZodArray;\n treeHash: z$1.ZodString;\n entryPath: z$1.ZodString;\n sourceType: z$1.ZodEnum<{\n builtin: \"builtin\";\n \"data-dir\": \"data-dir\";\n }>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n name: z$1.ZodString;\n description: z$1.ZodString;\n kind: z$1.ZodLiteral<\"workspace-path\">;\n sourceType: z$1.ZodLiteral<\"project\">;\n sourceRootPath: z$1.ZodString;\n skillFilePath: z$1.ZodString;\n }, z$1.core.$strict>], \"kind\">>;\n disallowedTools: z$1.ZodOptional>;\n providerThreadId: z$1.ZodString;\n }, z$1.core.$strict>;\n target: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n mode: z$1.ZodLiteral<\"start\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n mode: z$1.ZodLiteral<\"auto\">;\n expectedTurnId: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n mode: z$1.ZodLiteral<\"steer\">;\n expectedTurnId: z$1.ZodNullable;\n }, z$1.core.$strip>], \"mode\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n appliedAs: z$1.ZodEnum<{\n steer: \"steer\";\n \"new-turn\": \"new-turn\";\n }>;\n }, z$1.core.$strip>, \"settled\", false>;\n \"thread.stop\": HostDaemonCommandDescriptor<\"thread.stop\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n threadId: z$1.ZodString;\n type: z$1.ZodLiteral<\"thread.stop\">;\n }, z$1.core.$strict>, z$1.ZodObject<{}, z$1.core.$strip>, \"settled\", false>;\n \"thread.goal.clear\": HostDaemonCommandDescriptor<\"thread.goal.clear\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n threadId: z$1.ZodString;\n type: z$1.ZodLiteral<\"thread.goal.clear\">;\n options: z$1.ZodIntersection;\n reasoningLevel: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n claudeCodePermissionMode: z$1.ZodOptional>;\n claudeCodeMockCliTraffic: z$1.ZodOptional>;\n workflowsEnabled: z$1.ZodBoolean;\n memoryEnabled: z$1.ZodOptional;\n providerSubagentsEnabled: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n permissionMode: z$1.ZodLiteral<\"accept-edits\">;\n permissionScope: z$1.ZodLiteral<\"workspace\">;\n approvalReviewer: z$1.ZodLiteral<\"user\">;\n permissionEscalation: z$1.ZodEnum<{\n ask: \"ask\";\n deny: \"deny\";\n }>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n permissionMode: z$1.ZodLiteral<\"auto\">;\n permissionScope: z$1.ZodLiteral<\"workspace\">;\n approvalReviewer: z$1.ZodLiteral<\"automatic\">;\n permissionEscalation: z$1.ZodEnum<{\n ask: \"ask\";\n deny: \"deny\";\n }>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n permissionMode: z$1.ZodLiteral<\"full\">;\n permissionScope: z$1.ZodLiteral<\"full\">;\n approvalReviewer: z$1.ZodNull;\n permissionEscalation: z$1.ZodNull;\n }, z$1.core.$strip>], \"permissionMode\">>;\n acpLaunchSpec: z$1.ZodOptional;\n env: z$1.ZodRecord;\n cwd: z$1.ZodOptional;\n modelCli: z$1.ZodOptional;\n selectFlag: z$1.ZodOptional;\n primaryModels: z$1.ZodArray;\n }, z$1.core.$strict>, z$1.ZodTransform<{\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n } | undefined, {\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n }>>>;\n reasoningCli: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n nativeReasoning: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n permissionCli: z$1.ZodOptional>;\n workspaceWrite: z$1.ZodOptional>;\n readonly: z$1.ZodOptional>;\n insertAfterArgs: z$1.ZodOptional;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n resumeContext: z$1.ZodObject<{\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n instructionMode: z$1.ZodEnum<{\n replace: \"replace\";\n append: \"append\";\n }>;\n projectId: z$1.ZodString;\n providerId: z$1.ZodString;\n acpLaunchSpec: z$1.ZodOptional;\n env: z$1.ZodRecord;\n cwd: z$1.ZodOptional;\n modelCli: z$1.ZodOptional;\n selectFlag: z$1.ZodOptional;\n primaryModels: z$1.ZodArray;\n }, z$1.core.$strict>, z$1.ZodTransform<{\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n } | undefined, {\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n }>>>;\n reasoningCli: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n nativeReasoning: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n permissionCli: z$1.ZodOptional>;\n workspaceWrite: z$1.ZodOptional>;\n readonly: z$1.ZodOptional>;\n insertAfterArgs: z$1.ZodOptional;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n instructions: z$1.ZodString;\n dynamicTools: z$1.ZodArray>;\n injectedSkillSources: z$1.ZodArray;\n treeHash: z$1.ZodString;\n entryPath: z$1.ZodString;\n sourceType: z$1.ZodEnum<{\n builtin: \"builtin\";\n \"data-dir\": \"data-dir\";\n }>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n name: z$1.ZodString;\n description: z$1.ZodString;\n kind: z$1.ZodLiteral<\"workspace-path\">;\n sourceType: z$1.ZodLiteral<\"project\">;\n sourceRootPath: z$1.ZodString;\n skillFilePath: z$1.ZodString;\n }, z$1.core.$strict>], \"kind\">>;\n disallowedTools: z$1.ZodOptional>;\n providerThreadId: z$1.ZodString;\n }, z$1.core.$strict>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n cleared: z$1.ZodBoolean;\n }, z$1.core.$strict>, \"settled\", false>;\n \"thread.plan.cancel\": HostDaemonCommandDescriptor<\"thread.plan.cancel\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n threadId: z$1.ZodString;\n type: z$1.ZodLiteral<\"thread.plan.cancel\">;\n expectedTurnId: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n cancelled: z$1.ZodBoolean;\n }, z$1.core.$strict>, \"settled\", false>;\n \"thread.rename\": HostDaemonCommandDescriptor<\"thread.rename\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n threadId: z$1.ZodString;\n type: z$1.ZodLiteral<\"thread.rename\">;\n title: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{}, z$1.core.$strip>, \"settled\", false>;\n \"thread.archive\": HostDaemonCommandDescriptor<\"thread.archive\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n threadId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"thread.archive\">;\n providerId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{}, z$1.core.$strip>, \"settled\", false>;\n \"thread.unarchive\": HostDaemonCommandDescriptor<\"thread.unarchive\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n threadId: z$1.ZodString;\n type: z$1.ZodLiteral<\"thread.unarchive\">;\n providerId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{}, z$1.core.$strip>, \"settled\", false>;\n \"interactive.resolve\": HostDaemonCommandDescriptor<\"interactive.resolve\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n threadId: z$1.ZodString;\n type: z$1.ZodLiteral<\"interactive.resolve\">;\n interactionId: z$1.ZodString;\n providerId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n providerRequestId: z$1.ZodString;\n resolution: z$1.ZodUnion;\n grantedPermissions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"allow_for_session\">;\n grantedPermissions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"deny\">;\n }, z$1.core.$strip>], \"decision\">, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"user_answer\">;\n answers: z$1.ZodRecord;\n freeText: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin_submitted\">;\n }, z$1.core.$strip>]>;\n }, z$1.core.$strict>, z$1.ZodObject<{}, z$1.core.$strip>, \"settled\", false>;\n \"codex.inference.complete\": HostDaemonCommandDescriptor<\"codex.inference.complete\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"codex.inference.complete\">;\n model: z$1.ZodString;\n reasoningEffort: z$1.ZodLiteral<\"none\">;\n prompt: z$1.ZodString;\n outputSchema: z$1.ZodType>;\n timeoutMs: z$1.ZodNumber;\n }, z$1.core.$strict>, z$1.ZodObject<{\n model: z$1.ZodString;\n value: z$1.ZodType>;\n }, z$1.core.$strip>, \"settled\", false>;\n \"codex.voice.transcribe\": HostDaemonCommandDescriptor<\"codex.voice.transcribe\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"codex.voice.transcribe\">;\n model: z$1.ZodString;\n audioBase64: z$1.ZodString;\n mimeType: z$1.ZodString;\n filename: z$1.ZodString;\n prompt: z$1.ZodNullable;\n timeoutMs: z$1.ZodNumber;\n }, z$1.core.$strict>, z$1.ZodObject<{\n model: z$1.ZodString;\n text: z$1.ZodString;\n }, z$1.core.$strip>, \"settled\", false>;\n \"environment.provision\": HostDaemonCommandDescriptor<\"environment.provision\", z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n environmentId: z$1.ZodString;\n type: z$1.ZodLiteral<\"environment.provision\">;\n initiator: z$1.ZodNullable>;\n workspaceProvisionType: z$1.ZodLiteral<\"unmanaged\">;\n path: z$1.ZodString;\n checkout: z$1.ZodOptional;\n name: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"new\">;\n name: z$1.ZodString;\n baseBranch: z$1.ZodString;\n }, z$1.core.$strict>], \"kind\">>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodString;\n type: z$1.ZodLiteral<\"environment.provision\">;\n initiator: z$1.ZodNullable>;\n sourcePath: z$1.ZodString;\n targetPath: z$1.ZodString;\n branchName: z$1.ZodString;\n baseBranch: z$1.ZodNullable;\n setupTimeoutMs: z$1.ZodNumber;\n workspaceProvisionType: z$1.ZodLiteral<\"managed-worktree\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodString;\n type: z$1.ZodLiteral<\"environment.provision\">;\n initiator: z$1.ZodNullable>;\n workspaceProvisionType: z$1.ZodLiteral<\"personal\">;\n targetPath: z$1.ZodString;\n }, z$1.core.$strict>], \"workspaceProvisionType\">, z$1.ZodObject<{\n path: z$1.ZodString;\n isGitRepo: z$1.ZodBoolean;\n isWorktree: z$1.ZodBoolean;\n branchName: z$1.ZodNullable;\n defaultBranch: z$1.ZodNullable;\n transcript: z$1.ZodArray;\n key: z$1.ZodString;\n text: z$1.ZodString;\n startedAt: z$1.ZodOptional;\n status: z$1.ZodOptional>;\n metadata: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, \"settled\", false>;\n \"project.clone\": HostDaemonCommandDescriptor<\"project.clone\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"project.clone\">;\n remoteUrl: z$1.ZodString;\n projectSlug: z$1.ZodString;\n targetPath: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodObject<{\n path: z$1.ZodString;\n gitRemoteUrl: z$1.ZodNullable;\n }, z$1.core.$strict>, \"settled\", false>;\n \"environment.provision.cancel\": HostDaemonCommandDescriptor<\"environment.provision.cancel\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n type: z$1.ZodLiteral<\"environment.provision.cancel\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n aborted: z$1.ZodBoolean;\n }, z$1.core.$strip>, \"settled\", false>;\n \"environment.destroy\": HostDaemonCommandDescriptor<\"environment.destroy\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"environment.destroy\">;\n }, z$1.core.$strict>, z$1.ZodObject<{}, z$1.core.$strip>, \"settled\", false>;\n \"workspace.commit\": HostDaemonCommandDescriptor<\"workspace.commit\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.commit\">;\n message: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n commitSha: z$1.ZodString;\n commitSubject: z$1.ZodString;\n }, z$1.core.$strip>, \"settled\", false>;\n \"workspace.squash_merge\": HostDaemonCommandDescriptor<\"workspace.squash_merge\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.squash_merge\">;\n targetBranch: z$1.ZodString;\n commitMessage: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n commitSha: z$1.ZodString;\n commitSubject: z$1.ZodString;\n merged: z$1.ZodBoolean;\n }, z$1.core.$strip>, \"settled\", false>;\n \"workspace.pull_request_action\": HostDaemonCommandDescriptor<\"workspace.pull_request_action\", z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.pull_request_action\">;\n operation: z$1.ZodLiteral<\"ready\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.pull_request_action\">;\n operation: z$1.ZodLiteral<\"draft\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.pull_request_action\">;\n operation: z$1.ZodLiteral<\"merge\">;\n method: z$1.ZodEnum<{\n merge: \"merge\";\n squash: \"squash\";\n rebase: \"rebase\";\n }>;\n }, z$1.core.$strict>], \"operation\">, z$1.ZodObject<{}, z$1.core.$strict>, \"settled\", false>;\n \"host.list_files\": HostDaemonCommandDescriptor<\"host.list_files\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.list_files\">;\n path: z$1.ZodString;\n query: z$1.ZodOptional;\n limit: z$1.ZodNumber;\n }, z$1.core.$strip>, z$1.ZodObject<{\n files: z$1.ZodArray>;\n truncated: z$1.ZodBoolean;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"host.list_paths\": HostDaemonCommandDescriptor<\"host.list_paths\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.list_paths\">;\n path: z$1.ZodString;\n query: z$1.ZodOptional;\n limit: z$1.ZodNumber;\n includeFiles: z$1.ZodBoolean;\n includeDirectories: z$1.ZodBoolean;\n }, z$1.core.$strip>, z$1.ZodObject<{\n paths: z$1.ZodArray;\n path: z$1.ZodString;\n name: z$1.ZodString;\n score: z$1.ZodNumber;\n positions: z$1.ZodArray;\n }, z$1.core.$strip>>;\n truncated: z$1.ZodBoolean;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"host.mkdir\": HostDaemonCommandDescriptor<\"host.mkdir\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.mkdir\">;\n path: z$1.ZodString;\n rootPath: z$1.ZodOptional;\n recursive: z$1.ZodBoolean;\n }, z$1.core.$strict>, z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n }, z$1.core.$strict>, \"onlineRpc\", false>;\n \"host.move_path\": HostDaemonCommandDescriptor<\"host.move_path\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.move_path\">;\n sourcePath: z$1.ZodString;\n destinationPath: z$1.ZodString;\n rootPath: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n }, z$1.core.$strict>, \"onlineRpc\", false>;\n \"host.remove_path\": HostDaemonCommandDescriptor<\"host.remove_path\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.remove_path\">;\n path: z$1.ZodString;\n rootPath: z$1.ZodOptional;\n recursive: z$1.ZodBoolean;\n }, z$1.core.$strict>, z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n }, z$1.core.$strict>, \"onlineRpc\", false>;\n \"host.browse_directory\": HostDaemonCommandDescriptor<\"host.browse_directory\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.browse_directory\">;\n path: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n directory: z$1.ZodString;\n parent: z$1.ZodNullable;\n entries: z$1.ZodArray;\n name: z$1.ZodString;\n path: z$1.ZodString;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"host.paths_exist\": HostDaemonCommandDescriptor<\"host.paths_exist\", z$1.ZodObject<{\n paths: z$1.ZodPipe, z$1.ZodTransform>;\n type: z$1.ZodLiteral<\"host.paths_exist\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n existence: z$1.ZodRecord;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"project.inspect\": HostDaemonCommandDescriptor<\"project.inspect\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"project.inspect\">;\n path: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n path: z$1.ZodString;\n gitRemoteUrl: z$1.ZodNullable;\n }, z$1.core.$strict>, \"onlineRpc\", true>;\n \"project.clone_default_path\": HostDaemonCommandDescriptor<\"project.clone_default_path\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"project.clone_default_path\">;\n projectSlug: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n path: z$1.ZodString;\n }, z$1.core.$strict>, \"onlineRpc\", true>;\n \"host.pick_folder\": HostDaemonCommandDescriptor<\"host.pick_folder\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.pick_folder\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, \"onlineRpc\", false>;\n \"host.caffeinate\": HostDaemonCommandDescriptor<\"host.caffeinate\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.caffeinate\">;\n enabled: z$1.ZodBoolean;\n }, z$1.core.$strict>, z$1.ZodObject<{\n enabled: z$1.ZodBoolean;\n supported: z$1.ZodBoolean;\n }, z$1.core.$strict>, \"onlineRpc\", false>;\n \"connect-tunnel.ensure-identity\": HostDaemonCommandDescriptor<\"connect-tunnel.ensure-identity\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"connect-tunnel.ensure-identity\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n label: z$1.ZodString;\n baseDomain: z$1.ZodString;\n }, z$1.core.$strict>, \"onlineRpc\", true>;\n \"host.list_commands\": HostDaemonCommandDescriptor<\"host.list_commands\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.list_commands\">;\n providerId: z$1.ZodString;\n cwd: z$1.ZodNullable;\n }, z$1.core.$strict>, z$1.ZodObject<{\n commands: z$1.ZodArray;\n origin: z$1.ZodEnum<{\n project: \"project\";\n user: \"user\";\n }>;\n description: z$1.ZodNullable;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"host.list_skills\": HostDaemonCommandDescriptor<\"host.list_skills\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.list_skills\">;\n providerId: z$1.ZodString;\n cwd: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n skills: z$1.ZodArray;\n filePath: z$1.ZodString;\n rootKind: z$1.ZodEnum<{\n plugin: \"plugin\";\n \"bb-project\": \"bb-project\";\n \"bb-data-dir\": \"bb-data-dir\";\n \"bb-builtin\": \"bb-builtin\";\n \"provider-project\": \"provider-project\";\n \"provider-user\": \"provider-user\";\n }>;\n linked: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"host.delete_skill\": HostDaemonCommandDescriptor<\"host.delete_skill\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.delete_skill\">;\n scope: z$1.ZodEnum<{\n \"bb-project\": \"bb-project\";\n \"bb-user\": \"bb-user\";\n \"claude-user\": \"claude-user\";\n \"claude-project\": \"claude-project\";\n \"codex-user\": \"codex-user\";\n \"codex-project\": \"codex-project\";\n }>;\n name: z$1.ZodString;\n cwd: z$1.ZodNullable;\n rootPath: z$1.ZodNullable;\n }, z$1.core.$strict>, z$1.ZodObject<{\n deletedPath: z$1.ZodString;\n }, z$1.core.$strip>, \"onlineRpc\", false>;\n \"host.write_skill\": HostDaemonCommandDescriptor<\"host.write_skill\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.write_skill\">;\n scope: z$1.ZodEnum<{\n \"bb-project\": \"bb-project\";\n \"bb-user\": \"bb-user\";\n }>;\n name: z$1.ZodString;\n cwd: z$1.ZodNullable;\n content: z$1.ZodString;\n expectedSha256: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"written\">;\n filePath: z$1.ZodString;\n sha256: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"conflict\">;\n currentSha256: z$1.ZodNullable;\n }, z$1.core.$strip>], \"outcome\">, \"onlineRpc\", false>;\n \"host.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>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n installations: z$1.ZodArray>;\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;\n }, z$1.core.$strict>, z$1.ZodObject<{\n entries: z$1.ZodArray;\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;\n selectedBranch: z$1.ZodOptional;\n limit: z$1.ZodNumber;\n }, z$1.core.$strip>, z$1.ZodObject<{\n branches: z$1.ZodArray;\n branchesTruncated: z$1.ZodBoolean;\n checkout: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"branch\">;\n branchName: z$1.ZodString;\n headSha: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"detached\">;\n headSha: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unborn\">;\n branchName: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unknown\">;\n reason: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">;\n defaultBranch: z$1.ZodNullable;\n defaultBranchRelation: z$1.ZodNullable>;\n hasUncommittedChanges: z$1.ZodBoolean;\n operation: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"none\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"merge\">;\n hasConflicts: z$1.ZodBoolean;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"rebase\">;\n hasConflicts: z$1.ZodBoolean;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"cherry-pick\">;\n hasConflicts: z$1.ZodBoolean;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"revert\">;\n hasConflicts: z$1.ZodBoolean;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unknown\">;\n reason: z$1.ZodString;\n hasConflicts: z$1.ZodBoolean;\n }, z$1.core.$strip>], \"kind\">;\n originDefaultBranch: z$1.ZodNullable;\n remoteBranches: z$1.ZodArray;\n remoteBranchesTruncated: z$1.ZodBoolean;\n selectedBranch: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"host.file_metadata\": HostDaemonCommandDescriptor<\"host.file_metadata\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.file_metadata\">;\n path: z$1.ZodString;\n rootPath: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodObject<{\n path: z$1.ZodString;\n modifiedAtMs: z$1.ZodNumber;\n sizeBytes: z$1.ZodNumber;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"host.read_file\": HostDaemonCommandDescriptor<\"host.read_file\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.read_file\">;\n path: z$1.ZodString;\n rootPath: z$1.ZodOptional;\n ref: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n path: z$1.ZodString;\n content: z$1.ZodString;\n contentEncoding: z$1.ZodEnum<{\n base64: \"base64\";\n utf8: \"utf8\";\n }>;\n mimeType: z$1.ZodOptional;\n sizeBytes: z$1.ZodNumber;\n modifiedAtMs: z$1.ZodOptional;\n sha256: z$1.ZodString;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"host.read_file_relative\": HostDaemonCommandDescriptor<\"host.read_file_relative\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.read_file_relative\">;\n rootPath: z$1.ZodString;\n path: z$1.ZodString;\n dotfiles: z$1.ZodEnum<{\n deny: \"deny\";\n allow: \"allow\";\n }>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n path: z$1.ZodString;\n content: z$1.ZodString;\n contentEncoding: z$1.ZodEnum<{\n base64: \"base64\";\n utf8: \"utf8\";\n }>;\n mimeType: z$1.ZodOptional;\n sizeBytes: z$1.ZodNumber;\n modifiedAtMs: z$1.ZodOptional;\n sha256: z$1.ZodString;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"host.write_file\": HostDaemonCommandDescriptor<\"host.write_file\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.write_file\">;\n path: z$1.ZodString;\n rootPath: z$1.ZodOptional;\n content: z$1.ZodString;\n contentEncoding: z$1.ZodEnum<{\n base64: \"base64\";\n utf8: \"utf8\";\n }>;\n createParents: z$1.ZodBoolean;\n expectedSha256: z$1.ZodOptional>;\n mode: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"written\">;\n sha256: z$1.ZodString;\n sizeBytes: z$1.ZodNumber;\n }, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"conflict\">;\n currentSha256: z$1.ZodNullable;\n }, z$1.core.$strict>], \"outcome\">, \"onlineRpc\", false>;\n \"provider.list_models\": HostDaemonCommandDescriptor<\"provider.list_models\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"provider.list_models\">;\n providerId: z$1.ZodString;\n acpLaunchSpec: z$1.ZodOptional;\n env: z$1.ZodRecord;\n cwd: z$1.ZodOptional;\n modelCli: z$1.ZodOptional;\n selectFlag: z$1.ZodOptional;\n primaryModels: z$1.ZodArray;\n }, z$1.core.$strict>, z$1.ZodTransform<{\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n } | undefined, {\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n }>>>;\n reasoningCli: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n nativeReasoning: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n permissionCli: z$1.ZodOptional>;\n workspaceWrite: z$1.ZodOptional>;\n readonly: z$1.ZodOptional>;\n insertAfterArgs: z$1.ZodOptional;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n models: z$1.ZodArray;\n description: z$1.ZodString;\n }, z$1.core.$strip>>;\n defaultReasoningEffort: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n isDefault: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n selectedOnlyModels: z$1.ZodArray;\n description: z$1.ZodString;\n }, z$1.core.$strip>>;\n defaultReasoningEffort: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n isDefault: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"known_acp_agents.status\": HostDaemonCommandDescriptor<\"known_acp_agents.status\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"known_acp_agents.status\">;\n agents: z$1.ZodArray>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n agents: z$1.ZodArray;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>, \"onlineRpc\", true>;\n \"provider.usage\": HostDaemonCommandDescriptor<\"provider.usage\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"provider.usage\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n codex: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n status: z$1.ZodLiteral<\"ok\">;\n accountEmail: z$1.ZodNullable;\n planLabel: z$1.ZodNullable;\n windows: z$1.ZodArray;\n cost: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"not_installed\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"unauthenticated\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"expired\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"error\">;\n message: z$1.ZodString;\n planLabel: z$1.ZodDefault>;\n accountEmail: z$1.ZodDefault>;\n }, z$1.core.$strip>], \"status\">;\n claudeCode: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n status: z$1.ZodLiteral<\"ok\">;\n accountEmail: z$1.ZodNullable;\n planLabel: z$1.ZodNullable;\n windows: z$1.ZodArray;\n cost: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"not_installed\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"unauthenticated\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"expired\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"error\">;\n message: z$1.ZodString;\n planLabel: z$1.ZodDefault>;\n accountEmail: z$1.ZodDefault>;\n }, z$1.core.$strip>], \"status\">;\n cursor: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n status: z$1.ZodLiteral<\"ok\">;\n accountEmail: z$1.ZodNullable;\n planLabel: z$1.ZodNullable;\n windows: z$1.ZodArray;\n cost: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"not_installed\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"unauthenticated\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"expired\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"error\">;\n message: z$1.ZodString;\n planLabel: z$1.ZodDefault>;\n accountEmail: z$1.ZodDefault>;\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;\n agentSeen: z$1.ZodBoolean;\n agentSeenAt: z$1.ZodNullable;\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.ZodObject<{\n displayName: z$1.ZodString;\n executableName: z$1.ZodString;\n executablePath: z$1.ZodNullable;\n installed: z$1.ZodBoolean;\n installSource: z$1.ZodEnum<{\n notInstalled: \"notInstalled\";\n npmGlobal: \"npmGlobal\";\n external: \"external\";\n }>;\n currentVersion: z$1.ZodNullable;\n latestVersion: z$1.ZodNullable;\n minimumSupportedVersion: z$1.ZodNullable;\n npmPackageName: z$1.ZodNullable;\n npmGlobalPackageVersion: z$1.ZodNullable;\n installAction: z$1.ZodNullable;\n label: z$1.ZodEnum<{\n Install: \"Install\";\n Update: \"Update\";\n }>;\n commandKind: z$1.ZodEnum<{\n exec: \"exec\";\n shell: \"shell\";\n }>;\n command: z$1.ZodString;\n }, z$1.core.$strip>>;\n needsUpdate: z$1.ZodBoolean;\n versionUnsupported: z$1.ZodBoolean;\n }, z$1.core.$strip>>, \"onlineRpc\", true>;\n \"provider_cli.install\": HostDaemonCommandDescriptor<\"provider_cli.install\", z$1.ZodObject<{\n provider: z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>;\n actionKind: z$1.ZodEnum<{\n install: \"install\";\n update: \"update\";\n }>;\n type: z$1.ZodLiteral<\"provider_cli.install\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n events: z$1.ZodArray;\n provider: z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>;\n command: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"output\">;\n provider: z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>;\n stream: z$1.ZodEnum<{\n stdout: \"stdout\";\n stderr: \"stderr\";\n }>;\n text: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"completed\">;\n provider: z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>;\n exitCode: z$1.ZodNullable;\n signal: z$1.ZodNullable;\n success: z$1.ZodBoolean;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"error\">;\n provider: z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>;\n message: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">>;\n }, z$1.core.$strict>, \"onlineRpc\", false>;\n \"workspace.status\": HostDaemonCommandDescriptor<\"workspace.status\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.status\">;\n mergeBaseBranch: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n workspaceStatus: z$1.ZodObject<{\n workingTree: z$1.ZodObject<{\n insertions: z$1.ZodNumber;\n deletions: z$1.ZodNumber;\n files: z$1.ZodArray;\n insertions: z$1.ZodNullable;\n deletions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n hasUncommittedChanges: z$1.ZodBoolean;\n state: z$1.ZodEnum<{\n clean: \"clean\";\n untracked: \"untracked\";\n dirty_uncommitted: \"dirty_uncommitted\";\n committed_unmerged: \"committed_unmerged\";\n dirty_and_committed_unmerged: \"dirty_and_committed_unmerged\";\n }>;\n }, z$1.core.$strip>;\n checkout: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"branch\">;\n branchName: z$1.ZodString;\n headSha: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"detached\">;\n headSha: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unborn\">;\n branchName: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unknown\">;\n reason: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">;\n branch: z$1.ZodObject<{\n currentBranch: z$1.ZodNullable;\n defaultBranch: z$1.ZodString;\n }, z$1.core.$strip>;\n mergeBase: z$1.ZodNullable;\n insertions: z$1.ZodNullable;\n deletions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n mergeBaseBranch: z$1.ZodString;\n baseRef: z$1.ZodNullable;\n aheadCount: z$1.ZodNumber;\n behindCount: z$1.ZodNumber;\n hasCommittedUnmergedChanges: z$1.ZodBoolean;\n commits: z$1.ZodArray>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"unavailable\">;\n failure: z$1.ZodObject<{\n code: z$1.ZodEnum<{\n unknown: \"unknown\";\n path_not_found: \"path_not_found\";\n not_git_repo: \"not_git_repo\";\n not_worktree: \"not_worktree\";\n workspace_type_mismatch: \"workspace_type_mismatch\";\n permission_denied: \"permission_denied\";\n unknown_environment: \"unknown_environment\";\n }>;\n workspacePath: z$1.ZodString;\n message: z$1.ZodString;\n }, z$1.core.$strict>;\n }, z$1.core.$strict>], \"outcome\">, \"onlineRpc\", true>;\n \"workspace.diff\": HostDaemonCommandDescriptor<\"workspace.diff\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.diff\">;\n target: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"uncommitted\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"branch_committed\">;\n mergeBaseBranch: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"all\">;\n mergeBaseBranch: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"commit\">;\n sha: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">;\n maxDiffBytes: z$1.ZodNumber;\n maxFileListBytes: z$1.ZodNumber;\n }, z$1.core.$strict>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n diff: z$1.ZodObject<{\n diff: z$1.ZodString;\n truncated: z$1.ZodBoolean;\n shortstat: z$1.ZodString;\n files: z$1.ZodString;\n mergeBaseRef: z$1.ZodNullable;\n }, z$1.core.$strip>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"unavailable\">;\n failure: z$1.ZodObject<{\n code: z$1.ZodEnum<{\n unknown: \"unknown\";\n path_not_found: \"path_not_found\";\n not_git_repo: \"not_git_repo\";\n not_worktree: \"not_worktree\";\n workspace_type_mismatch: \"workspace_type_mismatch\";\n permission_denied: \"permission_denied\";\n unknown_environment: \"unknown_environment\";\n }>;\n workspacePath: z$1.ZodString;\n message: z$1.ZodString;\n }, z$1.core.$strict>;\n }, z$1.core.$strict>], \"outcome\">, \"onlineRpc\", true>;\n \"workspace.diffFiles\": HostDaemonCommandDescriptor<\"workspace.diffFiles\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.diffFiles\">;\n target: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"uncommitted\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"branch_committed\">;\n mergeBaseBranch: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"all\">;\n mergeBaseBranch: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"commit\">;\n sha: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">;\n }, z$1.core.$strict>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n files: z$1.ZodArray;\n statusLetter: z$1.ZodEnum<{\n M: \"M\";\n A: \"A\";\n D: \"D\";\n R: \"R\";\n C: \"C\";\n T: \"T\";\n }>;\n additions: z$1.ZodNumber;\n deletions: z$1.ZodNumber;\n binary: z$1.ZodBoolean;\n origin: z$1.ZodEnum<{\n untracked: \"untracked\";\n tracked: \"tracked\";\n }>;\n }, z$1.core.$strip>>;\n shortstat: z$1.ZodString;\n mergeBaseRef: z$1.ZodNullable;\n }, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"unavailable\">;\n failure: z$1.ZodObject<{\n code: z$1.ZodEnum<{\n unknown: \"unknown\";\n path_not_found: \"path_not_found\";\n not_git_repo: \"not_git_repo\";\n not_worktree: \"not_worktree\";\n workspace_type_mismatch: \"workspace_type_mismatch\";\n permission_denied: \"permission_denied\";\n unknown_environment: \"unknown_environment\";\n }>;\n workspacePath: z$1.ZodString;\n message: z$1.ZodString;\n }, z$1.core.$strict>;\n }, z$1.core.$strict>], \"outcome\">, \"onlineRpc\", true>;\n \"workspace.diffPatch\": HostDaemonCommandDescriptor<\"workspace.diffPatch\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.diffPatch\">;\n target: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"uncommitted\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"branch_committed\">;\n mergeBaseBranch: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"all\">;\n mergeBaseBranch: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"commit\">;\n sha: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">;\n paths: z$1.ZodArray;\n maxBytesPerFile: z$1.ZodNumber;\n }, z$1.core.$strict>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n patches: z$1.ZodArray>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"unavailable\">;\n failure: z$1.ZodObject<{\n code: z$1.ZodEnum<{\n unknown: \"unknown\";\n path_not_found: \"path_not_found\";\n not_git_repo: \"not_git_repo\";\n not_worktree: \"not_worktree\";\n workspace_type_mismatch: \"workspace_type_mismatch\";\n permission_denied: \"permission_denied\";\n unknown_environment: \"unknown_environment\";\n }>;\n workspacePath: z$1.ZodString;\n message: z$1.ZodString;\n }, z$1.core.$strict>;\n }, z$1.core.$strict>], \"outcome\">, \"onlineRpc\", true>;\n \"workspace.pull_request\": HostDaemonCommandDescriptor<\"workspace.pull_request\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.pull_request\">;\n }, z$1.core.$strict>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n pullRequest: z$1.ZodObject<{\n number: z$1.ZodNumber;\n title: z$1.ZodString;\n state: z$1.ZodEnum<{\n OPEN: \"OPEN\";\n CLOSED: \"CLOSED\";\n MERGED: \"MERGED\";\n }>;\n url: z$1.ZodString;\n isDraft: z$1.ZodBoolean;\n baseRefName: z$1.ZodString;\n headRefName: z$1.ZodString;\n updatedAt: z$1.ZodString;\n checks: z$1.ZodArray;\n conclusion: z$1.ZodNullable>;\n url: z$1.ZodNullable;\n }, z$1.core.$strict>>;\n reviewDecision: z$1.ZodNullable>;\n reviewRequestCount: z$1.ZodNumber;\n mergeStateStatus: z$1.ZodNullable>;\n mergeable: z$1.ZodNullable>;\n }, z$1.core.$strict>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"absent\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"unavailable\">;\n message: z$1.ZodString;\n }, z$1.core.$strict>], \"outcome\">, \"onlineRpc\", true>;\n};\ntype HostDaemonCommandRegistry = typeof hostDaemonCommandRegistry;\ntype AnyHostDaemonCommandDescriptor = HostDaemonCommandRegistry[keyof HostDaemonCommandRegistry];\ntype HostDaemonCommandDescriptorForTransport = Extract;\ntype HostDaemonResultSchemaMapForTransport = {\n [Descriptor in HostDaemonCommandDescriptorForTransport as Descriptor[\"type\"]]: Descriptor[\"resultSchema\"];\n};\ntype HostDaemonOnlineRpcResultSchemaMap = HostDaemonResultSchemaMapForTransport<\"onlineRpc\">;\ntype HostDaemonOnlineRpcResultByType = {\n [K in keyof HostDaemonOnlineRpcResultSchemaMap]: z$1.infer;\n};\n\ndeclare const pickFolderResponseSchema: z$1.ZodObject<{\n path: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype PickFolderResponse = z$1.infer;\ndeclare const pathsExistRequestSchema: z$1.ZodObject<{\n paths: z$1.ZodPipe, z$1.ZodTransform>;\n}, z$1.core.$strip>;\ntype PathsExistRequest = z$1.infer;\ndeclare const pathsExistResponseSchema: z$1.ZodObject<{\n existence: z$1.ZodRecord;\n}, z$1.core.$strip>;\ntype PathsExistResponse = z$1.infer;\ndeclare const providerCliStatusResponseSchema: z$1.ZodRecord, z$1.ZodObject<{\n displayName: z$1.ZodString;\n executableName: z$1.ZodString;\n executablePath: z$1.ZodNullable;\n installed: z$1.ZodBoolean;\n installSource: z$1.ZodEnum<{\n notInstalled: \"notInstalled\";\n npmGlobal: \"npmGlobal\";\n external: \"external\";\n }>;\n currentVersion: z$1.ZodNullable;\n latestVersion: z$1.ZodNullable;\n minimumSupportedVersion: z$1.ZodNullable;\n npmPackageName: z$1.ZodNullable;\n npmGlobalPackageVersion: z$1.ZodNullable;\n installAction: z$1.ZodNullable;\n label: z$1.ZodEnum<{\n Install: \"Install\";\n Update: \"Update\";\n }>;\n commandKind: z$1.ZodEnum<{\n exec: \"exec\";\n shell: \"shell\";\n }>;\n command: z$1.ZodString;\n }, z$1.core.$strip>>;\n needsUpdate: z$1.ZodBoolean;\n versionUnsupported: z$1.ZodBoolean;\n}, z$1.core.$strip>>;\ntype ProviderCliStatusResponse = z$1.infer;\ndeclare const providerCliInstallRequestSchema: z$1.ZodObject<{\n provider: z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>;\n actionKind: z$1.ZodEnum<{\n install: \"install\";\n update: \"update\";\n }>;\n}, z$1.core.$strip>;\ntype ProviderCliInstallRequest = z$1.infer;\ndeclare const providerCliInstallEventSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"started\">;\n provider: z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>;\n command: z$1.ZodString;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"output\">;\n provider: z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>;\n stream: z$1.ZodEnum<{\n stdout: \"stdout\";\n stderr: \"stderr\";\n }>;\n text: z$1.ZodString;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"completed\">;\n provider: z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>;\n exitCode: z$1.ZodNullable;\n signal: z$1.ZodNullable;\n success: z$1.ZodBoolean;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"error\">;\n provider: z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>;\n message: z$1.ZodString;\n}, z$1.core.$strip>], \"type\">;\ntype ProviderCliInstallEvent = z$1.infer;\n\ninterface CreateFilePreviewResponse {\n baseUrl: string;\n expiresAtMs: number;\n}\ntype HostFileReadResponse = HostDaemonOnlineRpcResultByType[\"host.read_file\"];\ntype HostFileWriteResponse = HostDaemonOnlineRpcResultByType[\"host.write_file\"];\ntype HostFileListResponse = HostDaemonOnlineRpcResultByType[\"host.list_files\"];\ntype HostPathListResponse = HostDaemonOnlineRpcResultByType[\"host.list_paths\"];\ntype HostMkdirResponse = HostDaemonOnlineRpcResultByType[\"host.mkdir\"];\ntype HostMovePathResponse = HostDaemonOnlineRpcResultByType[\"host.move_path\"];\ntype HostRemovePathResponse = HostDaemonOnlineRpcResultByType[\"host.remove_path\"];\n\n/**\n * Query for `GET /hosts/:id/directory`, the interactive path browser's\n * single-level directory read. `path` is an absolute directory on the host;\n * omitting it lists the host's home directory (the daemon resolves it, since a\n * remote caller cannot know the host's home).\n */\ndeclare const hostDirectoryQuerySchema: z$1.ZodObject<{\n path: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype HostDirectoryQuery = z$1.infer;\ndeclare const hostDirectoryListingSchema: z$1.ZodObject<{\n directory: z$1.ZodString;\n parent: z$1.ZodNullable;\n entries: z$1.ZodArray;\n name: z$1.ZodString;\n path: z$1.ZodString;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype HostDirectoryListing = z$1.infer;\n/** Project name is sent so the daemon can derive its host-local checkout path. */\ndeclare const hostCloneDefaultPathQuerySchema: z$1.ZodObject<{\n projectId: z$1.ZodString;\n}, z$1.core.$strip>;\ntype HostCloneDefaultPathQuery = z$1.infer;\ndeclare const hostCloneDefaultPathResponseSchema: z$1.ZodObject<{\n path: z$1.ZodString;\n}, z$1.core.$strict>;\ntype HostCloneDefaultPathResponse = z$1.infer;\ndeclare const createHostJoinCodeResponseSchema: z$1.ZodObject<{\n joinCode: z$1.ZodString;\n hostId: z$1.ZodString;\n expiresAt: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype CreateHostJoinCodeResponse = z$1.infer;\ndeclare const updateHostRequestSchema: z$1.ZodObject<{\n name: z$1.ZodString;\n}, z$1.core.$strict>;\ntype UpdateHostRequest = z$1.infer;\ndeclare const hostRetryUpdateResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n}, z$1.core.$strict>;\ntype HostRetryUpdateResponse = z$1.infer;\ntype HostPathsExistRequest = PathsExistRequest;\ntype HostPathsExistResponse = PathsExistResponse;\ndeclare const hostPickFolderRequestSchema: z$1.ZodObject<{\n clientHostId: z$1.ZodString;\n}, z$1.core.$strict>;\ntype HostPickFolderRequest = z$1.infer;\ntype HostPickFolderResponse = PickFolderResponse;\ntype HostProviderCliStatusResponse = ProviderCliStatusResponse;\ntype HostProviderCliInstallRequest = ProviderCliInstallRequest;\ntype HostProviderCliInstallEvent = ProviderCliInstallEvent;\n\ndeclare const pluginUpdateCheckEntrySchema: z$1.ZodObject<{\n id: z$1.ZodString;\n outcome: z$1.ZodEnum<{\n unavailable: \"unavailable\";\n incompatible: \"incompatible\";\n current: \"current\";\n \"update-available\": \"update-available\";\n pinned: \"pinned\";\n }>;\n devMode: z$1.ZodOptional>;\n installed: z$1.ZodObject<{\n version: z$1.ZodString;\n display: z$1.ZodString;\n }, z$1.core.$strip>;\n candidate: z$1.ZodOptional>;\n blocked: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n detail: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype PluginUpdateCheckEntry = z$1.infer;\ndeclare const pluginApplyUpdateResultSchema: z$1.ZodObject<{\n applied: z$1.ZodBoolean;\n from: z$1.ZodObject<{\n version: z$1.ZodString;\n display: z$1.ZodString;\n }, z$1.core.$strip>;\n to: z$1.ZodOptional>;\n outcome: z$1.ZodEnum<{\n current: \"current\";\n updated: \"updated\";\n \"rolled-back\": \"rolled-back\";\n }>;\n detail: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype PluginApplyUpdateResult$1 = z$1.infer;\ndeclare const pluginSourceDetailSchema: z$1.ZodObject<{\n requested: z$1.ZodString;\n resolved: z$1.ZodString;\n integrity: z$1.ZodOptional;\n registry: z$1.ZodOptional;\n engines: z$1.ZodObject<{\n bb: z$1.ZodOptional;\n bbPluginSdk: z$1.ZodOptional;\n }, z$1.core.$strip>;\n installedAt: z$1.ZodOptional;\n history: z$1.ZodArray>;\n}, z$1.core.$strip>;\ntype PluginSourceDetail = z$1.infer;\ndeclare const installedPluginSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n source: z$1.ZodString;\n rootDir: z$1.ZodString;\n version: z$1.ZodString;\n provenance: z$1.ZodEnum<{\n builtin: \"builtin\";\n direct: \"direct\";\n catalog: \"catalog\";\n }>;\n isOrphanedBuiltin: z$1.ZodBoolean;\n catalogEntryId: z$1.ZodOptional;\n sourceDisplay: z$1.ZodString;\n updateState: z$1.ZodObject<{\n outcome: z$1.ZodOptional>;\n availableVersion: z$1.ZodOptional;\n blockedVersion: z$1.ZodOptional;\n blockedReasons: z$1.ZodOptional>;\n lastCheckAt: z$1.ZodOptional;\n lastFailure: z$1.ZodOptional>;\n }, z$1.core.$strip>;\n enabled: z$1.ZodBoolean;\n description: z$1.ZodNullable;\n name: z$1.ZodNullable;\n icon: z$1.ZodNullable;\n iconUrl: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n error: \"error\";\n running: \"running\";\n missing: \"missing\";\n incompatible: \"incompatible\";\n disabled: \"disabled\";\n degraded: \"degraded\";\n \"needs-configuration\": \"needs-configuration\";\n }>;\n statusDetail: z$1.ZodNullable;\n handlerStats: z$1.ZodObject<{\n count: z$1.ZodNumber;\n totalMs: z$1.ZodNumber;\n maxMs: z$1.ZodNumber;\n errorCount: z$1.ZodNumber;\n }, z$1.core.$strip>;\n services: z$1.ZodArray;\n }, z$1.core.$strip>>;\n schedules: z$1.ZodArray;\n lastStatus: z$1.ZodNullable>;\n lastError: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n cliCommand: z$1.ZodNullable>;\n capabilities: z$1.ZodDefault;\n id: z$1.ZodString;\n label: z$1.ZodString;\n detail: z$1.ZodNullable;\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;\n hash: z$1.ZodString;\n sdkMajor: z$1.ZodNumber;\n sdkVersion: z$1.ZodString;\n compatible: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>;\n logoUrl: z$1.ZodNullable;\n logoDarkUrl: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype InstalledPlugin = z$1.infer;\ndeclare const pluginListResponseSchema: z$1.ZodObject<{\n plugins: z$1.ZodArray;\n isOrphanedBuiltin: z$1.ZodBoolean;\n catalogEntryId: z$1.ZodOptional;\n sourceDisplay: z$1.ZodString;\n updateState: z$1.ZodObject<{\n outcome: z$1.ZodOptional>;\n availableVersion: z$1.ZodOptional;\n blockedVersion: z$1.ZodOptional;\n blockedReasons: z$1.ZodOptional>;\n lastCheckAt: z$1.ZodOptional;\n lastFailure: z$1.ZodOptional>;\n }, z$1.core.$strip>;\n enabled: z$1.ZodBoolean;\n description: z$1.ZodNullable;\n name: z$1.ZodNullable;\n icon: z$1.ZodNullable;\n iconUrl: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n error: \"error\";\n running: \"running\";\n missing: \"missing\";\n incompatible: \"incompatible\";\n disabled: \"disabled\";\n degraded: \"degraded\";\n \"needs-configuration\": \"needs-configuration\";\n }>;\n statusDetail: z$1.ZodNullable;\n handlerStats: z$1.ZodObject<{\n count: z$1.ZodNumber;\n totalMs: z$1.ZodNumber;\n maxMs: z$1.ZodNumber;\n errorCount: z$1.ZodNumber;\n }, z$1.core.$strip>;\n services: z$1.ZodArray;\n }, z$1.core.$strip>>;\n schedules: z$1.ZodArray;\n lastStatus: z$1.ZodNullable>;\n lastError: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n cliCommand: z$1.ZodNullable>;\n capabilities: z$1.ZodDefault;\n id: z$1.ZodString;\n label: z$1.ZodString;\n detail: z$1.ZodNullable;\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;\n hash: z$1.ZodString;\n sdkMajor: z$1.ZodNumber;\n sdkVersion: z$1.ZodString;\n compatible: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>;\n logoUrl: z$1.ZodNullable;\n logoDarkUrl: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype PluginListResponse = z$1.infer;\ndeclare const pluginReloadResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n plugins: z$1.ZodArray;\n isOrphanedBuiltin: z$1.ZodBoolean;\n catalogEntryId: z$1.ZodOptional;\n sourceDisplay: z$1.ZodString;\n updateState: z$1.ZodObject<{\n outcome: z$1.ZodOptional>;\n availableVersion: z$1.ZodOptional;\n blockedVersion: z$1.ZodOptional;\n blockedReasons: z$1.ZodOptional>;\n lastCheckAt: z$1.ZodOptional;\n lastFailure: z$1.ZodOptional>;\n }, z$1.core.$strip>;\n enabled: z$1.ZodBoolean;\n description: z$1.ZodNullable;\n name: z$1.ZodNullable;\n icon: z$1.ZodNullable;\n iconUrl: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n error: \"error\";\n running: \"running\";\n missing: \"missing\";\n incompatible: \"incompatible\";\n disabled: \"disabled\";\n degraded: \"degraded\";\n \"needs-configuration\": \"needs-configuration\";\n }>;\n statusDetail: z$1.ZodNullable;\n handlerStats: z$1.ZodObject<{\n count: z$1.ZodNumber;\n totalMs: z$1.ZodNumber;\n maxMs: z$1.ZodNumber;\n errorCount: z$1.ZodNumber;\n }, z$1.core.$strip>;\n services: z$1.ZodArray;\n }, z$1.core.$strip>>;\n schedules: z$1.ZodArray;\n lastStatus: z$1.ZodNullable>;\n lastError: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n cliCommand: z$1.ZodNullable>;\n capabilities: z$1.ZodDefault;\n id: z$1.ZodString;\n label: z$1.ZodString;\n detail: z$1.ZodNullable;\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;\n hash: z$1.ZodString;\n sdkMajor: z$1.ZodNumber;\n sdkVersion: z$1.ZodString;\n compatible: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>;\n logoUrl: z$1.ZodNullable;\n logoDarkUrl: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype PluginReloadResponse = z$1.infer;\ndeclare const pluginRemoveResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n}, z$1.core.$strip>;\ntype PluginRemoveResponse = z$1.infer;\ndeclare const pluginSettingsResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n schema: z$1.ZodRecord;\n secret: z$1.ZodOptional>;\n default: z$1.ZodOptional;\n label: z$1.ZodString;\n description: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"boolean\">;\n default: z$1.ZodOptional;\n label: z$1.ZodString;\n description: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"select\">;\n options: z$1.ZodArray;\n default: z$1.ZodOptional;\n label: z$1.ZodString;\n description: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"project\">;\n default: z$1.ZodOptional;\n label: z$1.ZodString;\n description: z$1.ZodOptional;\n }, z$1.core.$strict>], \"type\">>;\n values: z$1.ZodRecord>>;\n}, z$1.core.$strip>;\ntype PluginSettingsResponse = z$1.infer;\ndeclare const pluginTokenResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n token: z$1.ZodString;\n}, z$1.core.$strip>;\ntype PluginTokenResponse = z$1.infer;\ndeclare const pluginCatalogStatusSchema: z$1.ZodObject<{\n pluginCount: z$1.ZodNumber;\n includedPluginCount: z$1.ZodNumber;\n optionalPluginCount: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype PluginCatalogStatus = z$1.infer;\ndeclare const pluginCatalogSearchResultSchema: z$1.ZodObject<{\n entryId: z$1.ZodString;\n pluginId: z$1.ZodString;\n displayName: z$1.ZodString;\n description: z$1.ZodString;\n icon: z$1.ZodNullable;\n category: z$1.ZodString;\n source: z$1.ZodString;\n installed: z$1.ZodBoolean;\n compatible: z$1.ZodBoolean;\n incompatibleReason: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype PluginCatalogSearchResult$1 = z$1.infer;\n\ndeclare const systemExecutionOptionsResponseSchema: z$1.ZodObject<{\n providers: z$1.ZodArray;\n capabilities: z$1.ZodObject<{\n supportsArchive: z$1.ZodBoolean;\n supportsRename: z$1.ZodBoolean;\n supportsServiceTier: z$1.ZodBoolean;\n supportsUserQuestion: z$1.ZodBoolean;\n supportsFork: z$1.ZodBoolean;\n supportedPermissionModes: z$1.ZodArray>;\n }, z$1.core.$strip>;\n composerActions: z$1.ZodArray;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plan\">;\n command: z$1.ZodObject<{\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n trailingText: z$1.ZodString;\n }, z$1.core.$strip>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"goal\">;\n command: z$1.ZodObject<{\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n trailingText: z$1.ZodString;\n }, z$1.core.$strip>;\n }, z$1.core.$strip>], \"kind\">>;\n available: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n permissionCeiling: z$1.ZodEnum<{\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n full: \"full\";\n }>;\n models: z$1.ZodArray;\n description: z$1.ZodString;\n }, z$1.core.$strip>>;\n defaultReasoningEffort: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n isDefault: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n selectedOnlyModels: z$1.ZodArray;\n description: z$1.ZodString;\n }, z$1.core.$strip>>;\n defaultReasoningEffort: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n isDefault: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n modelLoadError: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype SystemExecutionOptionsResponse = z$1.infer;\ndeclare const systemExecutionOptionsQuerySchema: z$1.ZodObject<{\n providerId: z$1.ZodOptional;\n hostId: z$1.ZodOptional;\n environmentId: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype SystemExecutionOptionsQuery = z$1.infer;\n/** Omission preserves the existing behavior of reading the primary machine. */\ndeclare const systemUsageLimitsQuerySchema: z$1.ZodObject<{\n hostId: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype SystemUsageLimitsQuery = z$1.infer;\ndeclare const systemVoiceTranscriptionResponseSchema: z$1.ZodObject<{\n text: z$1.ZodString;\n}, z$1.core.$strip>;\ntype SystemVoiceTranscriptionResponse = z$1.infer;\ndeclare const onboardingAgentOverviewSchema: z$1.ZodObject<{\n agents: z$1.ZodArray;\n planLabel: z$1.ZodNullable;\n accountEmail: z$1.ZodNullable;\n canInstall: z$1.ZodBoolean;\n loginCommand: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype OnboardingAgentOverview = z$1.infer;\n/** Omission reads the primary machine, matching the usage-limits route. */\ndeclare const systemOnboardingReposQuerySchema: z$1.ZodObject<{\n hostId: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype SystemOnboardingReposQuery = z$1.infer;\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;\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;\n }, z$1.core.$strict>;\n keybindings: z$1.ZodArray;\n desktopOnly: z$1.ZodBoolean;\n shortcut: z$1.ZodObject<{\n key: z$1.ZodString;\n mod: z$1.ZodBoolean;\n meta: z$1.ZodBoolean;\n control: z$1.ZodBoolean;\n alt: z$1.ZodBoolean;\n shift: z$1.ZodBoolean;\n }, z$1.core.$strict>;\n when: z$1.ZodObject<{\n all: z$1.ZodArray>;\n none: z$1.ZodArray>;\n }, z$1.core.$strict>;\n }, z$1.core.$strict>>;\n defaultKeybindings: z$1.ZodArray;\n desktopOnly: z$1.ZodBoolean;\n shortcut: z$1.ZodObject<{\n key: z$1.ZodString;\n mod: z$1.ZodBoolean;\n meta: z$1.ZodBoolean;\n control: z$1.ZodBoolean;\n alt: z$1.ZodBoolean;\n shift: z$1.ZodBoolean;\n }, z$1.core.$strict>;\n when: z$1.ZodObject<{\n all: z$1.ZodArray>;\n none: z$1.ZodArray>;\n }, z$1.core.$strict>;\n }, z$1.core.$strict>>;\n keybindingOverrides: z$1.ZodArray;\n shortcut: z$1.ZodNullable>;\n }, z$1.core.$strict>>;\n experiments: z$1.ZodObject<{\n claudeCodeMockCliTraffic: z$1.ZodBoolean;\n toolsHub: z$1.ZodBoolean;\n }, z$1.core.$strip>;\n appearance: z$1.ZodObject<{\n themeId: z$1.ZodString;\n customCss: z$1.ZodNullable;\n faviconColor: z$1.ZodEnum<{\n default: \"default\";\n red: \"red\";\n orange: \"orange\";\n yellow: \"yellow\";\n green: \"green\";\n teal: \"teal\";\n blue: \"blue\";\n purple: \"purple\";\n pink: \"pink\";\n }>;\n }, z$1.core.$strip>;\n customThemes: z$1.ZodArray;\n pluginThemes: z$1.ZodArray;\n }, z$1.core.$strip>>;\n featureFlags: z$1.ZodObject<{\n placeholder: z$1.ZodBoolean;\n timelineWindowEventBudget: z$1.ZodNumber;\n }, z$1.core.$strip>;\n hostDaemonPort: z$1.ZodNullable;\n primaryHostId: z$1.ZodNullable;\n primaryHostPlatform: z$1.ZodNullable>;\n voiceTranscriptionEnabled: z$1.ZodBoolean;\n dataDir: z$1.ZodString;\n}, z$1.core.$strip>;\ntype SystemConfigResponse = z$1.infer;\ndeclare const systemAttentionResponseSchema: z$1.ZodObject<{\n hasAttention: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype SystemAttentionResponse = z$1.infer;\n/**\n * Theme catalog: the on-disk custom-theme directory plus the discovered custom\n * themes and the active palette. Drives `bb theme list` / `bb theme dir`.\n */\ndeclare const themeCatalogResponseSchema: z$1.ZodObject<{\n dir: z$1.ZodString;\n custom: z$1.ZodArray;\n plugins: z$1.ZodArray;\n }, z$1.core.$strip>>;\n active: z$1.ZodObject<{\n themeId: z$1.ZodString;\n customCss: z$1.ZodNullable;\n faviconColor: z$1.ZodEnum<{\n default: \"default\";\n red: \"red\";\n orange: \"orange\";\n yellow: \"yellow\";\n green: \"green\";\n teal: \"teal\";\n blue: \"blue\";\n purple: \"purple\";\n pink: \"pink\";\n }>;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>;\ntype ThemeCatalogResponse = z$1.infer;\ndeclare const systemVersionResponseSchema: z$1.ZodObject<{\n currentVersion: z$1.ZodString;\n latestVersion: z$1.ZodNullable;\n source: z$1.ZodLiteral<\"npm\">;\n updateAvailable: z$1.ZodBoolean;\n isDevelopment: z$1.ZodBoolean;\n upgradeCommand: z$1.ZodString;\n}, z$1.core.$strip>;\ntype SystemVersionResponse = z$1.infer;\ndeclare const systemConfigReloadResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n}, z$1.core.$strip>;\ndeclare const systemCliSkillsStatusResponseSchema: z$1.ZodObject<{\n machines: z$1.ZodArray;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype SystemCliSkillsStatusResponse = z$1.infer;\n/** The machines to copy the built-in bb CLI skills onto. */\ndeclare const systemInstallCliSkillsRequestSchema: z$1.ZodObject<{\n hostIds: z$1.ZodArray;\n}, z$1.core.$strip>;\ntype SystemInstallCliSkillsRequest = z$1.infer;\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;\n hostId: z$1.ZodString;\n hostName: z$1.ZodString;\n installations: z$1.ZodArray>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n ok: z$1.ZodLiteral;\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;\ntype SystemConfigReloadResponse = z$1.infer;\n\ndeclare const terminalSessionSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodNullable;\n environmentId: z$1.ZodNullable;\n hostId: z$1.ZodString;\n title: z$1.ZodString;\n initialCwd: z$1.ZodString;\n cols: z$1.ZodNumber;\n rows: z$1.ZodNumber;\n status: z$1.ZodEnum<{\n starting: \"starting\";\n disconnected: \"disconnected\";\n running: \"running\";\n exited: \"exited\";\n }>;\n exitCode: z$1.ZodNullable;\n closeReason: z$1.ZodNullable>;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n lastUserInputAt: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype TerminalSession = z$1.infer;\ndeclare const terminalListResponseSchema: z$1.ZodObject<{\n sessions: z$1.ZodArray;\n environmentId: z$1.ZodNullable;\n hostId: z$1.ZodString;\n title: z$1.ZodString;\n initialCwd: z$1.ZodString;\n cols: z$1.ZodNumber;\n rows: z$1.ZodNumber;\n status: z$1.ZodEnum<{\n starting: \"starting\";\n disconnected: \"disconnected\";\n running: \"running\";\n exited: \"exited\";\n }>;\n exitCode: z$1.ZodNullable;\n closeReason: z$1.ZodNullable>;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n lastUserInputAt: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype TerminalListResponse = z$1.infer;\ndeclare const createTerminalRequestSchema: z$1.ZodObject<{\n cols: z$1.ZodNumber;\n rows: z$1.ZodNumber;\n start: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodObject<{\n mode: z$1.ZodLiteral<\"command\">;\n command: z$1.ZodString;\n }, z$1.core.$strict>], \"mode\">>;\n target: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"environment\">;\n environmentId: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"host_path\">;\n hostId: z$1.ZodString;\n cwd: z$1.ZodNullable;\n }, z$1.core.$strict>], \"kind\">;\n title: z$1.ZodOptional;\n}, z$1.core.$strict>;\ntype CreateTerminalRequest = z$1.infer;\ndeclare const updateTerminalRequestSchema: z$1.ZodObject<{\n title: z$1.ZodString;\n}, z$1.core.$strict>;\ntype UpdateTerminalRequest = z$1.infer;\ndeclare const terminalInputRequestSchema: z$1.ZodObject<{\n dataBase64: z$1.ZodString;\n}, z$1.core.$strict>;\ntype TerminalInputRequest = z$1.infer;\ndeclare const terminalResizeRequestSchema: z$1.ZodObject<{\n cols: z$1.ZodNumber;\n rows: z$1.ZodNumber;\n}, z$1.core.$strict>;\ntype TerminalResizeRequest = z$1.infer;\ndeclare const terminalOutputQuerySchema: z$1.ZodObject<{\n sinceSeq: z$1.ZodOptional>;\n tailBytes: z$1.ZodOptional>;\n limitChunks: z$1.ZodOptional>;\n}, z$1.core.$strict>;\ntype TerminalOutputQuery = z$1.infer;\ndeclare const terminalOutputResponseSchema: z$1.ZodObject<{\n chunks: z$1.ZodArray>;\n nextSeq: z$1.ZodNumber;\n truncated: z$1.ZodBoolean;\n}, z$1.core.$strict>;\ntype TerminalOutputResponse = z$1.infer;\n\ndeclare const timelineRowStatusSchema: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n}>;\ntype TimelineRowStatus = z$1.infer;\ndeclare const timelineRowBaseSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype TimelineRowBase = z$1.infer;\ndeclare const timelineConversationRowSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"conversation\">;\n text: z$1.ZodString;\n attachments: z$1.ZodNullable;\n localImagePaths: z$1.ZodArray;\n localFilePaths: z$1.ZodArray;\n }, z$1.core.$strip>>;\n role: z$1.ZodLiteral<\"user\">;\n initiator: z$1.ZodEnum<{\n user: \"user\";\n agent: \"agent\";\n system: \"system\";\n }>;\n senderThreadId: z$1.ZodNullable;\n systemMessageKind: z$1.ZodEnum<{\n \"ownership-assigned\": \"ownership-assigned\";\n \"ownership-removed\": \"ownership-removed\";\n \"child-needs-attention\": \"child-needs-attention\";\n \"child-completed\": \"child-completed\";\n \"child-failed\": \"child-failed\";\n \"child-interrupted\": \"child-interrupted\";\n \"child-outcome-batch\": \"child-outcome-batch\";\n unlabeled: \"unlabeled\";\n }>;\n systemMessageSubject: z$1.ZodNullable;\n threadId: z$1.ZodString;\n threadName: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread-batch\">;\n count: z$1.ZodNumber;\n }, z$1.core.$strip>], \"kind\">>;\n turnRequest: z$1.ZodObject<{\n kind: z$1.ZodEnum<{\n message: \"message\";\n steer: \"steer\";\n }>;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n accepted: \"accepted\";\n }>;\n }, z$1.core.$strip>;\n mentions: z$1.ZodArray, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"conversation\">;\n text: z$1.ZodString;\n attachments: z$1.ZodNullable;\n localImagePaths: z$1.ZodArray;\n localFilePaths: z$1.ZodArray;\n }, z$1.core.$strip>>;\n role: z$1.ZodLiteral<\"assistant\">;\n turnRequest: z$1.ZodNull;\n}, z$1.core.$strip>], \"role\">;\ntype TimelineConversationRow = z$1.infer;\ndeclare const timelineSystemRowSchema: z$1.ZodUnion;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"system\">;\n title: z$1.ZodString;\n detail: z$1.ZodNullable;\n status: z$1.ZodNullable>;\n systemKind: z$1.ZodEnum<{\n error: \"error\";\n debug: \"debug\";\n reconnect: \"reconnect\";\n }>;\n}, z$1.core.$strip>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"system\">;\n title: z$1.ZodString;\n detail: z$1.ZodNullable;\n status: z$1.ZodNullable>;\n systemKind: z$1.ZodLiteral<\"operation\">;\n operationKind: z$1.ZodEnum<{\n generic: \"generic\";\n compaction: \"compaction\";\n \"thread-provisioning\": \"thread-provisioning\";\n \"thread-interrupted\": \"thread-interrupted\";\n \"provider-unhandled\": \"provider-unhandled\";\n warning: \"warning\";\n deprecation: \"deprecation\";\n }>;\n completedAt: z$1.ZodNullable;\n}, z$1.core.$strip>, z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"system\">;\n title: z$1.ZodString;\n detail: z$1.ZodNullable;\n systemKind: z$1.ZodLiteral<\"operation\">;\n operationKind: z$1.ZodLiteral<\"parent-change\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n parentChange: z$1.ZodObject<{\n action: z$1.ZodEnum<{\n assign: \"assign\";\n release: \"release\";\n transfer: \"transfer\";\n }>;\n previousParentThreadId: z$1.ZodNullable;\n previousParentThreadTitle: z$1.ZodNullable;\n nextParentThreadId: z$1.ZodNullable;\n nextParentThreadTitle: z$1.ZodNullable;\n }, z$1.core.$strip>;\n completedAt: z$1.ZodNullable;\n}, z$1.core.$strip>], \"operationKind\">]>;\ntype TimelineSystemRow = z$1.infer;\ninterface TimelineWorkRowBase extends TimelineRowBase {\n kind: \"work\";\n status: TimelineRowStatus;\n}\ndeclare const timelineCommandWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"command\">;\n callId: z$1.ZodString;\n command: z$1.ZodString;\n cwd: z$1.ZodNullable;\n source: z$1.ZodNullable;\n output: z$1.ZodString;\n exitCode: z$1.ZodNullable;\n completedAt: z$1.ZodNullable;\n approvalStatus: z$1.ZodNullable>;\n activityIntents: z$1.ZodArray;\n command: z$1.ZodString;\n name: z$1.ZodString;\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"list_files\">;\n command: z$1.ZodString;\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"search\">;\n command: z$1.ZodString;\n query: z$1.ZodNullable;\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"unknown\">;\n command: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">>;\n}, z$1.core.$strip>;\ntype TimelineCommandWorkRow = z$1.infer;\ndeclare const timelineToolWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"tool\">;\n callId: z$1.ZodString;\n toolName: z$1.ZodString;\n toolArgs: z$1.ZodNullable>>>;\n statusLabels: z$1.ZodOptional>;\n output: z$1.ZodString;\n completedAt: z$1.ZodNullable;\n approvalStatus: z$1.ZodNullable>;\n activityIntents: z$1.ZodArray;\n command: z$1.ZodString;\n name: z$1.ZodString;\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"list_files\">;\n command: z$1.ZodString;\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"search\">;\n command: z$1.ZodString;\n query: z$1.ZodNullable;\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"unknown\">;\n command: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">>;\n}, z$1.core.$strip>;\ntype TimelineToolWorkRow = z$1.infer;\ndeclare const timelineFileChangeWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"file-change\">;\n callId: z$1.ZodString;\n change: z$1.ZodObject<{\n path: z$1.ZodString;\n kind: z$1.ZodNullable;\n movePath: z$1.ZodNullable;\n diff: z$1.ZodNullable;\n diffStats: z$1.ZodObject<{\n added: z$1.ZodNumber;\n removed: z$1.ZodNumber;\n }, z$1.core.$strip>;\n }, z$1.core.$strip>;\n stdout: z$1.ZodNullable;\n stderr: z$1.ZodNullable;\n approvalStatus: z$1.ZodNullable>;\n}, z$1.core.$strip>;\ntype TimelineFileChangeWorkRow = z$1.infer;\ndeclare const timelineWebSearchWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"web-search\">;\n callId: z$1.ZodString;\n queries: z$1.ZodArray;\n completedAt: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype TimelineWebSearchWorkRow = z$1.infer;\ndeclare const timelineWebFetchWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"web-fetch\">;\n callId: z$1.ZodString;\n url: z$1.ZodString;\n prompt: z$1.ZodNullable;\n pattern: z$1.ZodNullable;\n completedAt: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype TimelineWebFetchWorkRow = z$1.infer;\ndeclare const timelineImageViewWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"image-view\">;\n callId: z$1.ZodString;\n path: z$1.ZodString;\n completedAt: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype TimelineImageViewWorkRow = z$1.infer;\ndeclare const timelineApprovalWorkRowSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"approval\">;\n interactionId: z$1.ZodString;\n target: z$1.ZodObject<{\n itemId: z$1.ZodString;\n toolName: z$1.ZodNullable;\n }, z$1.core.$strip>;\n approvalKind: z$1.ZodLiteral<\"file-edit\">;\n lifecycle: z$1.ZodEnum<{\n denied: \"denied\";\n waiting: \"waiting\";\n }>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"approval\">;\n interactionId: z$1.ZodString;\n target: z$1.ZodObject<{\n itemId: z$1.ZodString;\n toolName: z$1.ZodNullable;\n }, z$1.core.$strip>;\n approvalKind: z$1.ZodLiteral<\"permission-grant\">;\n lifecycle: z$1.ZodEnum<{\n pending: \"pending\";\n interrupted: \"interrupted\";\n denied: \"denied\";\n resolving: \"resolving\";\n granted: \"granted\";\n }>;\n grantScope: z$1.ZodNullable>;\n statusReason: z$1.ZodNullable;\n}, z$1.core.$strip>], \"approvalKind\">;\ntype TimelineApprovalWorkRow = z$1.infer;\ndeclare const timelineQuestionWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"question\">;\n interactionId: z$1.ZodString;\n lifecycle: z$1.ZodEnum<{\n pending: \"pending\";\n interrupted: \"interrupted\";\n resolving: \"resolving\";\n answered: \"answered\";\n }>;\n questions: z$1.ZodArray;\n multiSelect: z$1.ZodBoolean;\n options: z$1.ZodOptional;\n }, z$1.core.$strip>>>;\n allowFreeText: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n answers: z$1.ZodNullable;\n freeText: z$1.ZodOptional;\n }, z$1.core.$strip>>>;\n statusReason: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype TimelineQuestionWorkRow = z$1.infer;\ninterface TimelineDelegationWorkRow extends TimelineWorkRowBase {\n workKind: \"delegation\";\n callId: string;\n toolName: string;\n subagentType: string | null;\n description: string | null;\n output: string;\n completedAt: number | null;\n childRows: TimelineRow[];\n}\n/**\n * A provider background task — a dynamic workflow (Claude Code Workflow tool)\n * or a backgrounded shell command (Bash run_in_background), discriminated by\n * `taskType`. The row outlives its spawning turn: progress and terminal state\n * arrive via thread-scoped events folded into this single row. `workflow` is\n * the merged phase/agent tree, present only for workflows; null for shell\n * commands and for workflows the provider reported no progress records for\n * (degraded rendering falls back to description + summary).\n */\ndeclare const timelineWorkflowWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"workflow\">;\n itemId: z$1.ZodString;\n taskType: z$1.ZodString;\n workflowName: z$1.ZodNullable;\n description: z$1.ZodString;\n taskStatus: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n running: \"running\";\n paused: \"paused\";\n failed: \"failed\";\n killed: \"killed\";\n stopped: \"stopped\";\n }>;\n workflow: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray;\n model: z$1.ZodString;\n attempt: z$1.ZodNumber;\n cached: z$1.ZodBoolean;\n lastProgressAt: z$1.ZodNumber;\n phaseIndex: z$1.ZodOptional;\n phaseTitle: z$1.ZodOptional;\n agentType: z$1.ZodOptional;\n isolation: z$1.ZodOptional;\n queuedAt: z$1.ZodOptional;\n startedAt: z$1.ZodOptional;\n lastToolName: z$1.ZodOptional;\n lastToolSummary: z$1.ZodOptional;\n promptPreview: z$1.ZodOptional;\n resultPreview: z$1.ZodOptional;\n error: z$1.ZodOptional;\n tokens: z$1.ZodOptional;\n toolCalls: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodNullable>;\n summary: z$1.ZodNullable;\n error: z$1.ZodNullable;\n completedAt: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype TimelineWorkflowWorkRow = z$1.infer;\ntype TimelineWorkRow = TimelineCommandWorkRow | TimelineToolWorkRow | TimelineFileChangeWorkRow | TimelineWebSearchWorkRow | TimelineWebFetchWorkRow | TimelineImageViewWorkRow | TimelineApprovalWorkRow | TimelineQuestionWorkRow | TimelineDelegationWorkRow | TimelineWorkflowWorkRow;\ninterface TimelineTurnRow extends TimelineRowBase {\n kind: \"turn\";\n turnId: string;\n status: TimelineRowStatus;\n summaryCount: number;\n completedAt: number | null;\n children: TimelineRow[] | null;\n}\ntype TimelineSourceRow = TimelineConversationRow | TimelineWorkRow | TimelineSystemRow;\ntype TimelineRow = TimelineSourceRow | TimelineTurnRow;\n\ndeclare const createExecutionInputSourcesSchema: z$1.ZodObject<{\n providerId: z$1.ZodOptional>;\n model: z$1.ZodOptional>;\n serviceTier: z$1.ZodOptional>;\n reasoningLevel: z$1.ZodOptional>;\n permissionMode: z$1.ZodOptional>;\n}, z$1.core.$strict>;\ntype CreateExecutionInputSources = z$1.infer;\ndeclare const createThreadRequestSchema: z$1.ZodObject<{\n projectId: z$1.ZodString;\n providerId: z$1.ZodOptional;\n origin: z$1.ZodEnum<{\n plugin: \"plugin\";\n app: \"app\";\n cli: \"cli\";\n sdk: \"sdk\";\n }>;\n originPluginId: z$1.ZodOptional;\n visibility: z$1.ZodOptional>;\n title: z$1.ZodOptional;\n input: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n model: z$1.ZodOptional;\n serviceTier: z$1.ZodOptional>;\n reasoningLevel: z$1.ZodOptional>;\n permissionMode: z$1.ZodOptional, z$1.ZodLiteral<\"workspace-write\">]>, z$1.ZodTransform<\"auto\" | \"accept-edits\" | \"full\", \"auto\" | \"accept-edits\" | \"full\" | \"workspace-write\">>>;\n executionInputSources: z$1.ZodOptional>;\n model: z$1.ZodOptional>;\n serviceTier: z$1.ZodOptional>;\n reasoningLevel: z$1.ZodOptional>;\n permissionMode: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n environment: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"reuse\">;\n environmentId: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host\">;\n hostId: z$1.ZodOptional;\n workspace: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"unmanaged\">;\n path: z$1.ZodNullable;\n branch: z$1.ZodOptional;\n name: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"new\">;\n baseBranch: z$1.ZodString;\n }, z$1.core.$strict>], \"kind\">>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"managed-worktree\">;\n baseBranch: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"named\">;\n name: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"default\">;\n }, z$1.core.$strip>], \"kind\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"personal\">;\n }, z$1.core.$strip>], \"type\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"project-default\">;\n }, z$1.core.$strip>], \"type\">;\n parentThreadId: z$1.ZodOptional;\n sectionId: z$1.ZodOptional>;\n sourceThreadId: z$1.ZodOptional;\n sourceSeqEnd: z$1.ZodOptional;\n startedOnBehalfOf: z$1.ZodDefault;\n senderThreadId: z$1.ZodString;\n }, z$1.core.$strip>>>;\n originKind: z$1.ZodDefault>>;\n childOrigin: z$1.ZodDefault>>;\n}, z$1.core.$strip>;\ntype CreateThreadRequest = z$1.infer;\ndeclare const forkThreadRequestSchema: z$1.ZodObject<{\n sourceThreadId: z$1.ZodString;\n sourceSeqEnd: z$1.ZodOptional;\n input: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>>;\n agentContextSeed: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">, z$1.ZodObject<{\n visibility: z$1.ZodLiteral<\"agent-only\">;\n }, z$1.core.$strip>>>>;\n title: z$1.ZodOptional;\n permissionMode: z$1.ZodOptional, z$1.ZodLiteral<\"workspace-write\">]>, z$1.ZodTransform<\"auto\" | \"accept-edits\" | \"full\", \"auto\" | \"accept-edits\" | \"full\" | \"workspace-write\">>>;\n visibility: z$1.ZodDefault>;\n workspace: z$1.ZodDefault>;\n origin: z$1.ZodDefault>;\n originPluginId: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype ForkThreadRequest = z$1.infer;\ndeclare const sendMessageRequestSchema: z$1.ZodObject<{\n input: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n model: z$1.ZodOptional;\n serviceTier: z$1.ZodOptional>;\n reasoningLevel: z$1.ZodOptional>;\n permissionMode: z$1.ZodOptional, z$1.ZodLiteral<\"workspace-write\">]>, z$1.ZodTransform<\"auto\" | \"accept-edits\" | \"full\", \"auto\" | \"accept-edits\" | \"full\" | \"workspace-write\">>>;\n executionInputSources: z$1.ZodOptional>;\n serviceTier: z$1.ZodOptional>;\n reasoningLevel: z$1.ZodOptional>;\n permissionMode: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n mode: z$1.ZodEnum<{\n steer: \"steer\";\n start: \"start\";\n auto: \"auto\";\n \"queue-if-active\": \"queue-if-active\";\n \"steer-if-active\": \"steer-if-active\";\n }>;\n senderThreadId: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype SendMessageRequest = z$1.infer;\ndeclare const createQueuedMessageRequestSchema: z$1.ZodObject<{\n input: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n model: z$1.ZodOptional;\n serviceTier: z$1.ZodOptional>;\n reasoningLevel: z$1.ZodOptional>;\n permissionMode: z$1.ZodOptional, z$1.ZodLiteral<\"workspace-write\">]>, z$1.ZodTransform<\"auto\" | \"accept-edits\" | \"full\", \"auto\" | \"accept-edits\" | \"full\" | \"workspace-write\">>>;\n executionInputSources: z$1.ZodOptional>;\n serviceTier: z$1.ZodOptional>;\n reasoningLevel: z$1.ZodOptional>;\n permissionMode: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n senderThreadId: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype CreateQueuedMessageRequest = z$1.infer;\ndeclare const updateQueuedMessageRequestSchema: z$1.ZodObject<{\n expectedUpdatedAt: z$1.ZodNumber;\n input: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n}, z$1.core.$strip>;\ntype UpdateQueuedMessageRequest = z$1.infer;\ndeclare const sendQueuedMessageRequestSchema: z$1.ZodObject<{\n mode: z$1.ZodEnum<{\n steer: \"steer\";\n auto: \"auto\";\n }>;\n}, z$1.core.$strip>;\ntype SendQueuedMessageRequest = z$1.infer;\ndeclare const reorderQueuedMessageRequestSchema: z$1.ZodObject<{\n previousQueuedMessageId: z$1.ZodNullable;\n nextQueuedMessageId: z$1.ZodNullable;\n groupBoundaryQueuedMessageId: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype ReorderQueuedMessageRequest = z$1.infer;\ndeclare const setQueuedMessageGroupBoundaryRequestSchema: z$1.ZodObject<{\n expectedGroupedPrefixQueuedMessageIds: z$1.ZodArray;\n groupBoundaryQueuedMessageId: z$1.ZodString;\n}, z$1.core.$strip>;\ntype SetQueuedMessageGroupBoundaryRequest = z$1.infer;\ndeclare const sendQueuedMessageResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n queuedMessage: z$1.ZodObject<{\n id: z$1.ZodString;\n content: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n model: z$1.ZodString;\n reasoningLevel: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n permissionMode: z$1.ZodEnum<{\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n full: \"full\";\n }>;\n serviceTier: z$1.ZodEnum<{\n default: \"default\";\n fast: \"fast\";\n }>;\n groupWithNext: z$1.ZodBoolean;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>;\ntype SendQueuedMessageResponse = z$1.infer;\ndeclare const threadListResponseSchema: z$1.ZodArray;\n providerId: z$1.ZodString;\n title: z$1.ZodNullable;\n titleFallback: z$1.ZodNullable;\n sectionId: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n error: \"error\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n }>;\n parentThreadId: z$1.ZodNullable;\n sourceThreadId: z$1.ZodNullable;\n originKind: z$1.ZodNullable>;\n childOrigin: z$1.ZodNullable>;\n originPluginId: z$1.ZodNullable;\n visibility: z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>;\n archivedAt: z$1.ZodNullable;\n pinnedAt: z$1.ZodNullable;\n deletedAt: z$1.ZodNullable;\n lastReadAt: z$1.ZodNullable;\n latestAttentionAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n runtime: z$1.ZodObject<{\n displayStatus: z$1.ZodEnum<{\n error: \"error\";\n provisioning: \"provisioning\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n \"host-reconnecting\": \"host-reconnecting\";\n \"waiting-for-host\": \"waiting-for-host\";\n }>;\n hostReconnectGraceExpiresAt: z$1.ZodNullable;\n }, z$1.core.$strip>;\n activity: z$1.ZodObject<{\n activeWorkflowCount: z$1.ZodNumber;\n activeBackgroundAgentCount: z$1.ZodNumber;\n activeBackgroundCommandCount: z$1.ZodNumber;\n activePlanModeCount: z$1.ZodNumber;\n activeGoalCount: z$1.ZodNumber;\n }, z$1.core.$strip>;\n pinSortKey: z$1.ZodNullable;\n hasPendingInteraction: z$1.ZodBoolean;\n environmentHostId: z$1.ZodNullable;\n environmentName: z$1.ZodNullable;\n environmentBranchName: z$1.ZodNullable;\n environmentWorkspaceDisplayKind: z$1.ZodEnum<{\n \"managed-worktree\": \"managed-worktree\";\n \"unmanaged-worktree\": \"unmanaged-worktree\";\n other: \"other\";\n }>;\n}, z$1.core.$strip>>;\ntype ThreadListResponse = z$1.infer;\ndeclare const threadSearchResponseSchema: z$1.ZodObject<{\n active: z$1.ZodObject<{\n total: z$1.ZodNumber;\n results: z$1.ZodArray;\n providerId: z$1.ZodString;\n title: z$1.ZodNullable;\n titleFallback: z$1.ZodNullable;\n sectionId: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n error: \"error\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n }>;\n parentThreadId: z$1.ZodNullable;\n sourceThreadId: z$1.ZodNullable;\n originKind: z$1.ZodNullable>;\n childOrigin: z$1.ZodNullable>;\n originPluginId: z$1.ZodNullable;\n visibility: z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>;\n archivedAt: z$1.ZodNullable;\n pinnedAt: z$1.ZodNullable;\n deletedAt: z$1.ZodNullable;\n lastReadAt: z$1.ZodNullable;\n latestAttentionAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n runtime: z$1.ZodObject<{\n displayStatus: z$1.ZodEnum<{\n error: \"error\";\n provisioning: \"provisioning\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n \"host-reconnecting\": \"host-reconnecting\";\n \"waiting-for-host\": \"waiting-for-host\";\n }>;\n hostReconnectGraceExpiresAt: z$1.ZodNullable;\n }, z$1.core.$strip>;\n activity: z$1.ZodObject<{\n activeWorkflowCount: z$1.ZodNumber;\n activeBackgroundAgentCount: z$1.ZodNumber;\n activeBackgroundCommandCount: z$1.ZodNumber;\n activePlanModeCount: z$1.ZodNumber;\n activeGoalCount: z$1.ZodNumber;\n }, z$1.core.$strip>;\n pinSortKey: z$1.ZodNullable;\n hasPendingInteraction: z$1.ZodBoolean;\n environmentHostId: z$1.ZodNullable;\n environmentName: z$1.ZodNullable;\n environmentBranchName: z$1.ZodNullable;\n environmentWorkspaceDisplayKind: z$1.ZodEnum<{\n \"managed-worktree\": \"managed-worktree\";\n \"unmanaged-worktree\": \"unmanaged-worktree\";\n other: \"other\";\n }>;\n }, z$1.core.$strip>;\n matches: z$1.ZodArray;\n text: z$1.ZodString;\n highlightRanges: z$1.ZodArray>;\n sourceSeq: z$1.ZodNullable;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>;\n archived: z$1.ZodObject<{\n total: z$1.ZodNumber;\n results: z$1.ZodArray;\n providerId: z$1.ZodString;\n title: z$1.ZodNullable;\n titleFallback: z$1.ZodNullable;\n sectionId: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n error: \"error\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n }>;\n parentThreadId: z$1.ZodNullable;\n sourceThreadId: z$1.ZodNullable;\n originKind: z$1.ZodNullable>;\n childOrigin: z$1.ZodNullable>;\n originPluginId: z$1.ZodNullable;\n visibility: z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>;\n archivedAt: z$1.ZodNullable;\n pinnedAt: z$1.ZodNullable;\n deletedAt: z$1.ZodNullable;\n lastReadAt: z$1.ZodNullable;\n latestAttentionAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n runtime: z$1.ZodObject<{\n displayStatus: z$1.ZodEnum<{\n error: \"error\";\n provisioning: \"provisioning\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n \"host-reconnecting\": \"host-reconnecting\";\n \"waiting-for-host\": \"waiting-for-host\";\n }>;\n hostReconnectGraceExpiresAt: z$1.ZodNullable;\n }, z$1.core.$strip>;\n activity: z$1.ZodObject<{\n activeWorkflowCount: z$1.ZodNumber;\n activeBackgroundAgentCount: z$1.ZodNumber;\n activeBackgroundCommandCount: z$1.ZodNumber;\n activePlanModeCount: z$1.ZodNumber;\n activeGoalCount: z$1.ZodNumber;\n }, z$1.core.$strip>;\n pinSortKey: z$1.ZodNullable;\n hasPendingInteraction: z$1.ZodBoolean;\n environmentHostId: z$1.ZodNullable;\n environmentName: z$1.ZodNullable;\n environmentBranchName: z$1.ZodNullable;\n environmentWorkspaceDisplayKind: z$1.ZodEnum<{\n \"managed-worktree\": \"managed-worktree\";\n \"unmanaged-worktree\": \"unmanaged-worktree\";\n other: \"other\";\n }>;\n }, z$1.core.$strip>;\n matches: z$1.ZodArray;\n text: z$1.ZodString;\n highlightRanges: z$1.ZodArray>;\n sourceSeq: z$1.ZodNullable;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>;\n}, z$1.core.$strict>;\ntype ThreadSearchResponse = z$1.infer;\ndeclare const threadResponseSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n projectId: z$1.ZodString;\n environmentId: z$1.ZodNullable;\n providerId: z$1.ZodString;\n title: z$1.ZodNullable;\n titleFallback: z$1.ZodNullable;\n sectionId: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n error: \"error\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n }>;\n parentThreadId: z$1.ZodNullable;\n sourceThreadId: z$1.ZodNullable;\n originKind: z$1.ZodNullable>;\n childOrigin: z$1.ZodNullable>;\n originPluginId: z$1.ZodNullable;\n visibility: z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>;\n archivedAt: z$1.ZodNullable;\n pinnedAt: z$1.ZodNullable;\n deletedAt: z$1.ZodNullable;\n lastReadAt: z$1.ZodNullable;\n latestAttentionAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n runtime: z$1.ZodObject<{\n displayStatus: z$1.ZodEnum<{\n error: \"error\";\n provisioning: \"provisioning\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n \"host-reconnecting\": \"host-reconnecting\";\n \"waiting-for-host\": \"waiting-for-host\";\n }>;\n hostReconnectGraceExpiresAt: z$1.ZodNullable;\n }, z$1.core.$strip>;\n canSpawnChild: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype ThreadResponse = z$1.infer;\ndeclare const threadGetQuerySchema: z$1.ZodObject<{\n include: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype ThreadGetQuery = z$1.infer;\ndeclare const threadWithIncludesResponseSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n projectId: z$1.ZodString;\n environmentId: z$1.ZodNullable;\n providerId: z$1.ZodString;\n title: z$1.ZodNullable;\n titleFallback: z$1.ZodNullable;\n sectionId: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n error: \"error\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n }>;\n parentThreadId: z$1.ZodNullable;\n sourceThreadId: z$1.ZodNullable;\n originKind: z$1.ZodNullable>;\n childOrigin: z$1.ZodNullable>;\n originPluginId: z$1.ZodNullable;\n visibility: z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>;\n archivedAt: z$1.ZodNullable;\n pinnedAt: z$1.ZodNullable;\n deletedAt: z$1.ZodNullable;\n lastReadAt: z$1.ZodNullable;\n latestAttentionAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n runtime: z$1.ZodObject<{\n displayStatus: z$1.ZodEnum<{\n error: \"error\";\n provisioning: \"provisioning\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n \"host-reconnecting\": \"host-reconnecting\";\n \"waiting-for-host\": \"waiting-for-host\";\n }>;\n hostReconnectGraceExpiresAt: z$1.ZodNullable;\n }, z$1.core.$strip>;\n canSpawnChild: z$1.ZodBoolean;\n environment: z$1.ZodOptional;\n projectId: z$1.ZodString;\n hostId: z$1.ZodString;\n path: z$1.ZodNullable;\n managed: z$1.ZodBoolean;\n isGitRepo: z$1.ZodBoolean;\n isWorktree: z$1.ZodBoolean;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n branchName: z$1.ZodNullable;\n baseBranch: z$1.ZodNullable;\n defaultBranch: z$1.ZodNullable;\n mergeBaseBranch: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n error: \"error\";\n provisioning: \"provisioning\";\n ready: \"ready\";\n retiring: \"retiring\";\n destroying: \"destroying\";\n destroyed: \"destroyed\";\n }>;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n }, z$1.core.$strip>>>;\n host: z$1.ZodOptional;\n status: z$1.ZodEnum<{\n disconnected: \"disconnected\";\n connected: \"connected\";\n }>;\n maxPermissionMode: z$1.ZodEnum<{\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n full: \"full\";\n }>;\n lastSeenAt: z$1.ZodNullable;\n lastRejectedProtocolVersion: z$1.ZodNullable;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n }, z$1.core.$strip>>>;\n}, z$1.core.$strip>;\ntype ThreadWithIncludesResponse = z$1.infer;\ndeclare const threadPendingInteractionsResponseSchema: z$1.ZodArray;\n statusReason: z$1.ZodNullable;\n createdAt: z$1.ZodNumber;\n expiresAt: z$1.ZodOptional>;\n resolvedAt: z$1.ZodNullable;\n turnId: z$1.ZodString;\n providerId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n providerRequestId: z$1.ZodString;\n origin: z$1.ZodOptional;\n providerId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n providerRequestId: z$1.ZodString;\n }, z$1.core.$strip>>;\n payload: z$1.ZodUnion;\n subject: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n itemId: z$1.ZodString;\n command: z$1.ZodString;\n cwd: z$1.ZodNullable;\n actions: z$1.ZodArray;\n command: z$1.ZodString;\n name: z$1.ZodString;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"listFiles\">;\n command: z$1.ZodString;\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"search\">;\n command: z$1.ZodString;\n query: z$1.ZodNullable;\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"unknown\">;\n command: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">>;\n sessionGrant: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"file_change\">;\n itemId: z$1.ZodString;\n writeScope: z$1.ZodNullable;\n sessionGrant: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"permission_grant\">;\n itemId: z$1.ZodString;\n toolName: z$1.ZodNullable;\n permissions: z$1.ZodObject<{\n network: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>;\n }, z$1.core.$strip>], \"kind\">;\n reason: z$1.ZodNullable;\n availableDecisions: z$1.ZodArray>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"user_question\">;\n questions: z$1.ZodArray;\n multiSelect: z$1.ZodBoolean;\n options: z$1.ZodOptional;\n }, z$1.core.$strip>>>;\n allowFreeText: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>]>;\n resolution: z$1.ZodNullable;\n grantedPermissions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"allow_for_session\">;\n grantedPermissions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"deny\">;\n }, z$1.core.$strip>], \"decision\">, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"user_answer\">;\n answers: z$1.ZodRecord;\n freeText: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>]>>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n interrupted: \"interrupted\";\n resolving: \"resolving\";\n resolved: \"resolved\";\n }>;\n statusReason: z$1.ZodNullable;\n createdAt: z$1.ZodNumber;\n expiresAt: z$1.ZodOptional>;\n resolvedAt: z$1.ZodNullable;\n turnId: z$1.ZodNullable;\n origin: z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n rendererId: z$1.ZodString;\n }, z$1.core.$strip>;\n payload: z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n title: z$1.ZodString;\n data: z$1.ZodType>;\n }, z$1.core.$strip>;\n resolution: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>]>>;\ntype ThreadPendingInteractionsResponse = z$1.infer;\ndeclare const threadQueuedMessageListResponseSchema: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n model: z$1.ZodString;\n reasoningLevel: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n permissionMode: z$1.ZodEnum<{\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n full: \"full\";\n }>;\n serviceTier: z$1.ZodEnum<{\n default: \"default\";\n fast: \"fast\";\n }>;\n groupWithNext: z$1.ZodBoolean;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n}, z$1.core.$strip>>;\ntype ThreadQueuedMessageListResponse = z$1.infer;\ndeclare const threadChildSummaryResponseSchema: z$1.ZodObject<{\n nonDeletedChildCount: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype ThreadChildSummaryResponse = z$1.infer;\ndeclare const deleteThreadRequestSchema: z$1.ZodObject<{\n childThreadsConfirmed: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype DeleteThreadRequest = z$1.infer;\ndeclare const updateThreadRequestSchema: z$1.ZodObject<{\n title: z$1.ZodOptional>;\n sectionId: z$1.ZodOptional>;\n parentThreadId: z$1.ZodOptional>;\n model: z$1.ZodOptional>;\n reasoningLevel: z$1.ZodOptional>>;\n visibility: z$1.ZodOptional>;\n}, z$1.core.$strip>;\ntype UpdateThreadRequest = z$1.infer;\ndeclare const reorderPinnedThreadRequestSchema: z$1.ZodObject<{\n previousThreadId: z$1.ZodNullable;\n nextThreadId: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype ReorderPinnedThreadRequest = z$1.infer;\n/**\n * Requested placement for a thread opened in the app's split layout. Edge\n * placements add panes through the eighth pane; at the cap they replace the\n * focused pane. `replace` always replaces the focused pane.\n */\ndeclare const threadOpenSplitSchema: z$1.ZodEnum<{\n right: \"right\";\n down: \"down\";\n left: \"left\";\n top: \"top\";\n replace: \"replace\";\n}>;\ntype ThreadOpenSplit = z$1.infer;\n/** Optional secondary-panel file to open with a thread. */\ndeclare const threadOpenFileSchema: z$1.ZodObject<{\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n path: z$1.ZodString;\n lineNumber: z$1.ZodNullable;\n}, z$1.core.$strict>;\ntype ThreadOpenFile = z$1.infer;\n/** Response for POST /threads/:id/open: how many connected clients received it. */\ndeclare const threadOpenResponseSchema: z$1.ZodObject<{\n delivered: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype ThreadOpenResponse = z$1.infer;\n/** Presentation action for one thread pane in each connected app window. */\ndeclare const threadPaneActionSchema: z$1.ZodEnum<{\n maximize: \"maximize\";\n restore: \"restore\";\n toggle: \"toggle\";\n}>;\ntype ThreadPaneAction = z$1.infer;\n/** Number of connected app clients that received the pane action. */\ndeclare const threadPaneActionResponseSchema: z$1.ZodObject<{\n delivered: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype ThreadPaneActionResponse = z$1.infer;\ndeclare const threadArchiveAllResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n archivedThreadIds: z$1.ZodArray;\n}, z$1.core.$strip>;\ntype ThreadArchiveAllResponse = z$1.infer;\ndeclare const threadListQuerySchema: z$1.ZodObject<{\n projectId: z$1.ZodOptional;\n parentThreadId: z$1.ZodOptional;\n sourceThreadId: z$1.ZodOptional;\n archived: z$1.ZodOptional>;\n sectionId: z$1.ZodOptional;\n unsectioned: z$1.ZodOptional>;\n hasParent: z$1.ZodOptional>;\n originKind: z$1.ZodOptional>;\n originPluginId: z$1.ZodOptional;\n childOrigin: z$1.ZodOptional>;\n includeHidden: z$1.ZodOptional>;\n limit: z$1.ZodOptional;\n offset: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype ThreadListQuery = z$1.infer;\ndeclare const threadSearchQuerySchema: z$1.ZodObject<{\n query: z$1.ZodString;\n limitPerGroup: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype ThreadSearchQuery = z$1.infer;\ndeclare const threadTimelineQuerySchema: z$1.ZodObject<{\n includeNestedRows: z$1.ZodOptional>;\n segmentLimit: z$1.ZodOptional;\n beforeAnchorSeq: z$1.ZodOptional;\n beforeAnchorId: z$1.ZodOptional;\n summaryOnly: z$1.ZodOptional>;\n afterSequence: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype ThreadTimelineQuery = z$1.infer;\ndeclare const timelineTurnSummaryDetailsQuerySchema: z$1.ZodObject<{\n turnId: z$1.ZodString;\n sourceSeqStart: z$1.ZodString;\n sourceSeqEnd: z$1.ZodString;\n}, z$1.core.$strip>;\ntype TimelineTurnSummaryDetailsQuery = z$1.infer;\ndeclare const threadStorageFilesQuerySchema: z$1.ZodObject<{\n query: z$1.ZodOptional;\n limit: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype ThreadStorageFilesQuery = z$1.infer;\ndeclare const threadStoragePathsQuerySchema: z$1.ZodObject<{\n query: z$1.ZodOptional;\n limit: z$1.ZodOptional;\n includeFiles: z$1.ZodEnum<{\n true: \"true\";\n false: \"false\";\n }>;\n includeDirectories: z$1.ZodEnum<{\n true: \"true\";\n false: \"false\";\n }>;\n}, z$1.core.$strip>;\ntype ThreadStoragePathsQuery = z$1.infer;\ndeclare const timelineTurnSummaryDetailsResponseSchema: z$1.ZodObject<{\n rows: z$1.ZodArray>>;\n}, z$1.core.$strip>;\ntype TimelineTurnSummaryDetailsResponse = z$1.infer;\ndeclare const threadTimelineResponseSchema: z$1.ZodObject<{\n rows: z$1.ZodArray>>;\n activePromptMode: z$1.ZodNullable;\n providerId: z$1.ZodEnum<{\n \"claude-code\": \"claude-code\";\n codex: \"codex\";\n }>;\n prompt: z$1.ZodString;\n }, z$1.core.$strict>>;\n activeThinking: z$1.ZodNullable>;\n activeWorkflows: z$1.ZodArray;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"workflow\">;\n itemId: z$1.ZodString;\n taskType: z$1.ZodString;\n workflowName: z$1.ZodNullable;\n description: z$1.ZodString;\n taskStatus: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n running: \"running\";\n paused: \"paused\";\n failed: \"failed\";\n killed: \"killed\";\n stopped: \"stopped\";\n }>;\n workflow: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray;\n model: z$1.ZodString;\n attempt: z$1.ZodNumber;\n cached: z$1.ZodBoolean;\n lastProgressAt: z$1.ZodNumber;\n phaseIndex: z$1.ZodOptional;\n phaseTitle: z$1.ZodOptional;\n agentType: z$1.ZodOptional;\n isolation: z$1.ZodOptional;\n queuedAt: z$1.ZodOptional;\n startedAt: z$1.ZodOptional;\n lastToolName: z$1.ZodOptional;\n lastToolSummary: z$1.ZodOptional;\n promptPreview: z$1.ZodOptional;\n resultPreview: z$1.ZodOptional;\n error: z$1.ZodOptional;\n tokens: z$1.ZodOptional;\n toolCalls: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodNullable>;\n summary: z$1.ZodNullable;\n error: z$1.ZodNullable;\n completedAt: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n activeBackgroundCommands: z$1.ZodArray;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"workflow\">;\n itemId: z$1.ZodString;\n taskType: z$1.ZodString;\n workflowName: z$1.ZodNullable;\n description: z$1.ZodString;\n taskStatus: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n running: \"running\";\n paused: \"paused\";\n failed: \"failed\";\n killed: \"killed\";\n stopped: \"stopped\";\n }>;\n workflow: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray;\n model: z$1.ZodString;\n attempt: z$1.ZodNumber;\n cached: z$1.ZodBoolean;\n lastProgressAt: z$1.ZodNumber;\n phaseIndex: z$1.ZodOptional;\n phaseTitle: z$1.ZodOptional;\n agentType: z$1.ZodOptional;\n isolation: z$1.ZodOptional;\n queuedAt: z$1.ZodOptional;\n startedAt: z$1.ZodOptional;\n lastToolName: z$1.ZodOptional;\n lastToolSummary: z$1.ZodOptional;\n promptPreview: z$1.ZodOptional;\n resultPreview: z$1.ZodOptional;\n error: z$1.ZodOptional;\n tokens: z$1.ZodOptional;\n toolCalls: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodNullable>;\n summary: z$1.ZodNullable;\n error: z$1.ZodNullable;\n completedAt: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n pendingTodos: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n goal: z$1.ZodNullable;\n tokenBudget: z$1.ZodNullable;\n tokensUsed: z$1.ZodNumber;\n timeUsedSeconds: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n modelFallback: z$1.ZodNullable;\n message: z$1.ZodString;\n }, z$1.core.$strip>>;\n contextWindowUsage: z$1.ZodOptional>;\n timelinePage: z$1.ZodObject<{\n kind: z$1.ZodEnum<{\n latest: \"latest\";\n older: \"older\";\n }>;\n segmentLimit: z$1.ZodNumber;\n returnedSegmentCount: z$1.ZodNumber;\n hasOlderRows: z$1.ZodBoolean;\n olderCursor: z$1.ZodNullable>;\n }, z$1.core.$strict>;\n maxSeq: z$1.ZodNumber;\n delta: z$1.ZodOptional>>;\n rowOrder: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype ThreadTimelineResponse = z$1.infer;\ndeclare const threadConversationOutlineResponseSchema: z$1.ZodObject<{\n items: z$1.ZodArray;\n preview: z$1.ZodString;\n attachmentSummary: z$1.ZodNullable>;\n }, z$1.core.$strict>>;\n maxSeq: z$1.ZodNumber;\n}, z$1.core.$strict>;\ntype ThreadConversationOutlineResponse = z$1.infer;\ndeclare const threadStorageFileListResponseSchema: z$1.ZodObject<{\n files: z$1.ZodArray>;\n truncated: z$1.ZodBoolean;\n storageRootPath: z$1.ZodString;\n}, z$1.core.$strip>;\ntype ThreadStorageFileListResponse = z$1.infer;\ndeclare const threadStoragePathListResponseSchema: z$1.ZodObject<{\n paths: z$1.ZodArray;\n path: z$1.ZodString;\n name: z$1.ZodString;\n score: z$1.ZodNumber;\n positions: z$1.ZodArray;\n }, z$1.core.$strip>>;\n truncated: z$1.ZodBoolean;\n storageRootPath: z$1.ZodString;\n}, z$1.core.$strip>;\ntype ThreadStoragePathListResponse = z$1.infer;\n\ndeclare const threadTabsResponseSchema: z$1.ZodObject<{\n revision: z$1.ZodNumber;\n tabs: z$1.ZodArray;\n }, z$1.core.$strict>, z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"git-diff\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n actionId: z$1.ZodString;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"plugin-panel\">;\n paramsJson: z$1.ZodNullable;\n pluginId: z$1.ZodString;\n title: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"workspace-file-preview\">;\n lineRange: z$1.ZodNullable>;\n path: z$1.ZodString;\n projectId: z$1.ZodNullable;\n source: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"working-tree\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"head\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"merge-base\">;\n ref: z$1.ZodString;\n }, z$1.core.$strict>], \"kind\">;\n statusLabel: z$1.ZodNullable>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"host-file-preview\">;\n lineRange: z$1.ZodNullable>;\n path: z$1.ZodString;\n threadId: z$1.ZodNullable;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable;\n id: z$1.ZodString;\n isPinned: z$1.ZodBoolean;\n kind: z$1.ZodLiteral<\"thread-storage-file-preview\">;\n lineRange: z$1.ZodNullable>;\n path: z$1.ZodString;\n threadId: z$1.ZodNullable;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"browser\">;\n title: z$1.ZodNullable;\n url: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"new-tab\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"side-chat\">;\n sourceMessageText: z$1.ZodString;\n sourceSeqEnd: z$1.ZodNullable;\n threadId: z$1.ZodNullable;\n title: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"terminal\">;\n terminalId: z$1.ZodString;\n }, z$1.core.$strict>], \"kind\">>;\n}, z$1.core.$strict>;\ntype ThreadTabsResponse = z$1.infer;\ndeclare const updateThreadTabsRequestSchema: z$1.ZodObject<{\n expectedRevision: z$1.ZodNumber;\n tabs: z$1.ZodArray;\n }, z$1.core.$strict>, z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"git-diff\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n actionId: z$1.ZodString;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"plugin-panel\">;\n paramsJson: z$1.ZodNullable;\n pluginId: z$1.ZodString;\n title: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"workspace-file-preview\">;\n lineRange: z$1.ZodNullable>;\n path: z$1.ZodString;\n projectId: z$1.ZodNullable;\n source: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"working-tree\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"head\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"merge-base\">;\n ref: z$1.ZodString;\n }, z$1.core.$strict>], \"kind\">;\n statusLabel: z$1.ZodNullable>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"host-file-preview\">;\n lineRange: z$1.ZodNullable>;\n path: z$1.ZodString;\n threadId: z$1.ZodNullable;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable;\n id: z$1.ZodString;\n isPinned: z$1.ZodBoolean;\n kind: z$1.ZodLiteral<\"thread-storage-file-preview\">;\n lineRange: z$1.ZodNullable>;\n path: z$1.ZodString;\n threadId: z$1.ZodNullable;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"browser\">;\n title: z$1.ZodNullable;\n url: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"new-tab\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"side-chat\">;\n sourceMessageText: z$1.ZodString;\n sourceSeqEnd: z$1.ZodNullable;\n threadId: z$1.ZodNullable;\n title: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"terminal\">;\n terminalId: z$1.ZodString;\n }, z$1.core.$strict>], \"kind\">>;\n}, z$1.core.$strict>;\ntype UpdateThreadTabsRequest = z$1.infer;\n\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 {\n readonly \"~standard\": {\n readonly version: 1;\n readonly vendor: string;\n readonly validate: (value: unknown) => StandardSchemaV1Result | Promise>;\n readonly types?: {\n readonly input: Input;\n readonly output: Output;\n };\n };\n}\ntype StandardSchemaV1Result = {\n readonly value: Output;\n readonly issues?: undefined;\n} | {\n readonly issues: readonly StandardSchemaV1Issue[];\n};\ninterface StandardSchemaV1Issue {\n readonly message: string;\n readonly path?: PropertyKey | readonly (PropertyKey | {\n readonly key: PropertyKey;\n })[];\n}\ntype StandardSchemaV1InferInput = NonNullable[\"input\"];\ntype StandardSchemaV1InferOutput = NonNullable[\"output\"];\ninterface PluginRpcMethodContract {\n readonly input: InputSchema;\n readonly output: OutputSchema;\n}\ntype PluginRpcContract = Readonly>;\n/** Define a shared RPC contract while preserving exact method/schema types. */\ndeclare function defineRpcContract(contract: Contract): Contract;\ntype PluginRpcHandlers = {\n [Method in keyof Contract]: (input: StandardSchemaV1InferOutput) => StandardSchemaV1InferInput | Promise>;\n};\ntype PluginRpcCallInput = StandardSchemaV1InferInput;\ntype PluginRpcCallArgs = null extends PluginRpcCallInput ? [input?: PluginRpcCallInput] : [input: PluginRpcCallInput];\ntype PluginRpcResult = StandardSchemaV1InferOutput;\n\n/**\n * The `@bb/plugin-sdk/app` contract (plugin design §5.2) — pure types with no\n * side effects. The BB app imports these to keep its real implementation in\n * sync (`satisfies PluginSdkApp`). Plugin authors import the same shapes through\n * `@bb/plugin-sdk/app`.\n *\n * Per-slot props are versioned contracts: additive-only within an SDK major.\n */\n/** Props passed to a `homepageSection` component. */\ninterface PluginHomepageSectionProps {\n /** Project in view on the compose surface; null when none is selected. */\n projectId: string | null;\n}\n/**\n * Props passed to a `settingsSection` component.\n *\n * Deliberately empty in V1; versioned additive like the other slot props.\n */\ninterface PluginSettingsSectionProps {\n}\n/** Props passed to a `navPanel` component (it owns its whole route). */\ninterface PluginNavPanelProps {\n /**\n * The route remainder after the panel root, \"\" at the root. The panel's\n * route is `/plugins///*`, so a deep link like\n * `/plugins/notes/notes/work/ideas.md` renders the panel with\n * `subPath: \"work/ideas.md\"`. Navigate within the panel via\n * `useBbNavigate().toPluginPanel(path, { subPath })` — browser\n * back/forward then walks panel-internal history.\n */\n subPath: string;\n}\n/** Props passed to a panel tab opened by a `threadPanelAction`. */\ninterface PluginThreadPanelProps {\n threadId: string;\n /**\n * The JSON value the action's `openPanel` call passed (round-tripped\n * through persistence, so the tab restores across reloads); null when the\n * action opened the panel without params.\n */\n params: JsonValue | null;\n}\ninterface PluginPendingInteractionView {\n id: string;\n threadId: string;\n title: string;\n payload: JsonValue;\n createdAt: number;\n expiresAt: number | null;\n}\ninterface PluginPendingInteractionProps {\n interaction: PluginPendingInteractionView;\n submit(value: JsonValue): Promise;\n cancel(): Promise;\n}\n/**\n * Props for a `sidebarFooterAction` — host-rendered (no plugin component).\n * Deliberately empty; the registration's `run` carries the behavior.\n */\ninterface PluginSidebarFooterActionProps {\n}\n/**\n * 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>;\n /** Original directive source text (useful for diagnostics / crash fallback). */\n source: string;\n message: PluginMessageDirectiveMessage;\n /**\n * Opens a worktree-relative file in the host's workspace file viewer. Null\n * when the message surface has no workspace viewer available.\n */\n openWorkspaceFile: PluginMessageDirectiveOpenWorkspaceFile | null;\n}\ninterface PluginHomepageSectionRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n title: string;\n component: ComponentType;\n}\ninterface PluginSettingsSectionRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Optional host-rendered section heading. */\n title?: string;\n /**\n * Optional one-line host-rendered subheading under `title`, in the built-in\n * SettingsSection idiom (ignored when `title` is absent).\n */\n description?: string;\n component: ComponentType;\n}\ninterface PluginNavPanelRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n title: string;\n /** Icon hint (BB icon name); unknown names fall back to a generic icon. */\n icon: string;\n /** URL segment under `/plugins//`; letters, digits, `-`, `_`. */\n path: string;\n component: ComponentType;\n /**\n * Optional component rendered on the right side of the shared title bar\n * (e.g. a sync button or a count). Contained separately from the body: a\n * throwing headerContent is hidden without breaking the title bar.\n */\n headerContent?: ComponentType;\n}\n/** Context handed to a `threadPanelAction`'s `run`. */\ninterface PluginThreadPanelActionContext {\n /** The thread whose panel launcher invoked the action. */\n threadId: string;\n /**\n * Open a tab in the thread's side panel rendering this action's\n * `component`. `title` labels the tab (default: the action's `title`);\n * `params` must be JSON-serializable — it is persisted with the tab and\n * reaches the component as its `params` prop. Opening with params\n * identical to an already-open tab of this action focuses that tab\n * (updating its title) instead of duplicating it. May be called more than\n * once (different params ⇒ multiple tabs) or not at all.\n */\n openPanel(options?: {\n title?: string;\n params?: JsonValue;\n }): void;\n}\ninterface PluginThreadPanelActionRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Label of the action row in the panel's new-tab launcher. */\n title: string;\n /**\n * Icon hint (BB icon name) used when the plugin ships no logo; the\n * launcher row and opened tabs prefer the plugin's logo.\n */\n icon?: string;\n /** Rendered inside every panel tab this action opens. */\n component: ComponentType;\n /**\n * How the host frames the tab content. \"padded\" (default) wraps the\n * component in the panel's scroll container with standard padding —\n * right for document-like content. \"flush\" gives the component the full\n * tab area (no padding, definite height, no host scrolling) — right for\n * app-like content that manages its own layout, such as\n * `ThreadChat`.\n */\n layout?: \"padded\" | \"flush\";\n /**\n * Runs when the user activates the action: call your RPC methods, show a\n * toast, and/or open panel tabs via `context.openPanel`. Omitted =\n * immediately open a panel tab with defaults. Errors (sync or async) are\n * contained and logged; they never break the launcher.\n */\n run?(context: PluginThreadPanelActionContext): void | Promise;\n}\ninterface PluginPendingInteractionRegistration {\n /** Matches `rendererId` passed to `bb.ui.requestInput`. */\n id: string;\n component: ComponentType;\n}\n/** Context handed to a `sidebarFooterAction`'s `run`. */\ninterface PluginSidebarFooterActionContext {\n /**\n * Navigate to this plugin's detail page in Tools, where declarative settings\n * and `settingsSection` slots render.\n */\n openSettings(): void;\n}\n/**\n * An icon button in the app sidebar footer (next to Settings / bug report).\n * Host-rendered for consistent chrome — plugins supply icon, label, and\n * `run` behavior only.\n */\ninterface PluginSidebarFooterActionRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Tooltip and accessible label for the icon button. */\n title: string;\n /** Icon hint (BB icon name); unknown names fall back to a generic icon. */\n icon: string;\n /**\n * Runs when the user activates the action (e.g. call `openSettings()`,\n * open a panel via other surfaces, toast). Errors (sync or async) are\n * contained and logged; they never break the sidebar.\n */\n run(context: PluginSidebarFooterActionContext): void | Promise;\n}\n/**\n * 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;\n setRead(threadId: string, read: boolean): Promise;\n /** Silent rename — no dialog. For inline editing in your own row. */\n rename(threadId: string, title: string): Promise;\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;\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) => 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;\n}\n/**\n * Register this plugin as a viewer/editor for file extensions. The user\n * picks (and can set as default) an opener per extension via the file tab's\n * \"Open with\" menu; matching files opened in the panel then render\n * `component` in a plugin tab instead of the built-in preview. Applies to\n * working-tree, host, and thread-storage files — never to git-ref snapshots\n * (diff views always use the built-in preview). The built-in preview stays\n * one menu click away, and a missing/disabled opener falls back to it.\n */\ninterface PluginFileOpenerRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Label in the \"Open with\" menu (e.g. \"Notes editor\"). */\n title: string;\n /** Lowercase extensions without the dot (e.g. [\"md\", \"mdx\"]). */\n extensions: readonly string[];\n component: ComponentType;\n}\n/**\n * Register a leaf message directive rendered inside assistant (and nested\n * agent) message Markdown. `id` is the directive name: `inline-vis` matches\n * `::inline-vis{file=\"demo.html\"}`.\n */\ninterface PluginMessageDirectiveRegistration {\n /**\n * The directive name. Lowercase kebab-case beginning with a letter.\n */\n id: string;\n component: ComponentType;\n}\n/**\n * A narrow, stable reference to one rendered chat message — NOT an internal\n * timeline row. `sourceSeqEnd` is the last source event sequence the message\n * covers, the anchor the server accepts for provider-history forks.\n */\ninterface ThreadChatMessageReference {\n id: string;\n threadId: string;\n role: \"user\" | \"assistant\";\n /** Visible text of the message. */\n text: string;\n sourceSeqEnd: number;\n}\ninterface PluginMessageActionThreadPanelOptions {\n /** A `threadPanelAction` id registered by this same plugin. */\n actionId: string;\n title?: string;\n params?: JsonValue;\n}\n/** Context handed to a `messageAction`'s `run`. */\ninterface PluginMessageActionContext {\n /** The thread whose timeline surfaced the action. */\n threadId: string;\n message: ThreadChatMessageReference;\n /**\n * Present only when the action was invoked from the text-selection menu;\n * the exact text the user highlighted inside `message`.\n */\n selectedText?: string;\n /**\n * Open one of this plugin's `threadPanelAction` components in the current\n * thread's side panel — the registration-callback equivalent of\n * `useBbNavigate().openThreadPanel`. Returns true when the host\n * accepted (the action id exists and the surface has a panel); false\n * otherwise.\n */\n openPanel(options: PluginMessageActionThreadPanelOptions): boolean;\n}\n/**\n * An action on chat messages: an icon button in the per-message action bar\n * (user and assistant messages) and an entry in the assistant-message\n * text-selection menu. Host-rendered chrome — the plugin supplies title,\n * icon hint, and `run` behavior only.\n */\ninterface PluginMessageActionRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Tooltip / menu label for the action. */\n title: string;\n /** Icon hint (BB icon name); unknown names fall back to a generic icon. */\n icon?: string;\n /**\n * Runs when the user activates the action. Errors (sync or async) are\n * contained and logged; they never break the timeline.\n */\n run(context: PluginMessageActionContext): void | Promise;\n}\ninterface PluginAppSlots {\n homepageSection(registration: PluginHomepageSectionRegistration): void;\n settingsSection(registration: PluginSettingsSectionRegistration): void;\n navPanel(registration: PluginNavPanelRegistration): void;\n threadPanelAction(registration: PluginThreadPanelActionRegistration): void;\n pendingInteraction(registration: PluginPendingInteractionRegistration): void;\n sidebarFooterAction(registration: PluginSidebarFooterActionRegistration): void;\n /**\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;\n/**\n * Trusted same-origin JavaScript/TypeScript mounted once per active frontend\n * generation in each bb app window or browser tab.\n */\ninterface PluginContentScriptRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /**\n * Install behavior into the bb app shell. The host awaits a returned\n * promise, contains failures, and calls the returned disposer exactly once.\n */\n mount(context: PluginContentScriptContext): void | PluginContentScriptDisposer | Promise;\n}\n/** 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 {\n /**\n * Invoke one of the plugin's `bb.rpc` methods (POST\n * /api/v1/plugins/<id>/rpc/<method>). Resolves with the method's\n * inferred output; rejects with an `Error` carrying the server's message,\n * stable `code`, and validation `issues` when present.\n */\n call>(method: Method, ...args: PluginRpcCallArgs): Promise>;\n}\ninterface PluginSettingsState {\n /**\n * Effective non-secret setting values (secret settings are excluded —\n * read them server-side). Undefined while loading or unavailable.\n */\n values: Record | undefined;\n isLoading: boolean;\n}\n/** State of the app's shared realtime connection to the bb server. */\ntype PluginRealtimeConnectionState = \"connecting\" | \"connected\" | \"reconnecting\";\n/** Where `useComposer()` writes. */\ntype PluginComposerScope = {\n kind: \"thread\";\n threadId: string;\n} | {\n kind: \"queued-message\";\n threadId: string;\n queuedMessageId: string;\n} | {\n kind: \"side-chat\";\n projectId: string;\n parentThreadId: string;\n tabId: string;\n childThreadId: string | null;\n} | {\n kind: \"new-thread\";\n /** Root compose's effective selected project; null only while unresolved. */\n projectId: string | null;\n};\n/** One plugin-owned composer customization registration. */\ninterface ComposerCustomization {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Composer kinds where this customization is active; omit for all kinds. */\n scopes?: readonly PluginComposerScope[\"kind\"][];\n actions?: readonly {\n id: string;\n component: ComponentType;\n }[];\n banners?: readonly {\n id: string;\n /** Host chrome around the banner. Defaults to `\"card\"`. */\n chrome?: \"card\" | \"bare\";\n component: ComponentType;\n }[];\n plusMenu?: readonly ComposerPlusMenuItem[];\n richText?: ComposerRichTextSpec;\n}\n/** Host-rendered menu row in the composer's `+` menu. */\ninterface ComposerPlusMenuItem {\n id: string;\n label: string;\n /** BB icon name; unknown names fall back to the generic plugin icon. */\n icon?: string;\n /** Accessible description for the host-rendered row. */\n description?: string;\n disabled?: boolean | ((view: ComposerView) => boolean);\n run(context: {\n composer: PluginComposerApi;\n view: ComposerView;\n }): void | Promise;\n}\n/** Reactive read-side of the composer a plugin surface is mounted in. */\ninterface ComposerView {\n scope: PluginComposerScope;\n layout: \"expanded\" | \"compact\" | \"zen\";\n draft: {\n text: string;\n isEmpty: boolean;\n attachmentCount: number;\n };\n run: {\n isRunning: boolean;\n isSubmitting: boolean;\n };\n}\ninterface ComposerRichTextSpec {\n /** Content-derived paint: match ranges receive `className`; text is never mutated. */\n effects?: readonly {\n id: string;\n /** Plain-text offsets into the current structured draft. */\n match(text: string): readonly {\n from: number;\n to: number;\n }[];\n className: string;\n }[];\n /** Debounced, read-only observation of the structured draft. */\n onDraftChange?(draft: ComposerStructuredDraft, view: ComposerView): void;\n}\ninterface ComposerStructuredDraft {\n text: string;\n mentions: readonly {\n from: number;\n to: number;\n provider: string;\n id: string;\n label: string;\n }[];\n}\n/** Host-rendered paint applied to the editable composer text. */\ninterface PluginComposerTextEffect {\n className: string;\n}\n/** Host-rendered status that temporarily replaces a thread's draft glyph. */\ninterface PluginComposerThreadRowStatus {\n /** BB icon-name hint; unknown names fall back to the generic plugin icon. */\n icon: string;\n /** Accessible label for the status glyph. */\n label: string;\n /**\n * Semantic host treatment for the status glyph. `running` automatically\n * shimmers; terminal `success` and `error` tones are static. Defaults to the\n * neutral tone.\n */\n tone?: \"default\" | \"running\" | \"success\" | \"error\";\n}\n/** An @-mention pill bound to one of the calling plugin's mention providers. */\ninterface PluginComposerMention {\n /** Mention provider id registered by THIS plugin via `bb.ui.registerMentionProvider`. */\n provider: string;\n /** Item id your provider's `resolve` will receive at send time. */\n id: string;\n /** Pill text shown in the composer. */\n label: string;\n}\n/**\n * Programmatic access to the chat composer draft — the same shared draft the\n * built-in \"Add to chat\" affordances (file preview, diff, terminal selections)\n * write to. While a queued message is being edited, writes land in that\n * message's inline editor. In a side chat, writes land in the visible side-chat\n * draft. Otherwise, inside a thread context writes land in that thread's draft;\n * anywhere else (nav panel, homepage section) they seed the new-thread composer\n * draft, which persists until the user sends or clears it.\n */\ninterface PluginComposerApi {\n scope: PluginComposerScope;\n /** Current plain text for this composer scope. */\n readonly text: string;\n /**\n * Replace the draft's plain text. Attachments are preserved. Inline mentions\n * outside the changed range are preserved and rebased; mentions overlapped\n * by the replacement are removed because their text representation changed.\n */\n setText(next: string): void;\n /**\n * Replace the draft's plain text from the latest committed value. Uses the\n * same structured-state reconciliation as `setText`.\n */\n updateText(updater: (current: string) => string): void;\n /** Clear plain text without clearing independently attached files. */\n clear(): void;\n /**\n * Apply a host-rendered effect to this composer's editable text, or clear it.\n * Effects are scoped to the calling plugin and automatically clear when the\n * slot unmounts or its composer scope changes.\n */\n setTextEffect(effect: PluginComposerTextEffect | null): void;\n /**\n * Lock or unlock editing for this composer. Locks are scoped to the calling\n * plugin and automatically release when the slot unmounts or its composer\n * scope changes.\n */\n setInputLock(locked: boolean): void;\n /**\n * Append text to the draft as a `> ` blockquote block and focus the\n * composer. Blank text is a no-op. This is the \"reference this selection\n * in chat\" primitive.\n */\n addQuote(text: string): void;\n /**\n * Insert an @-mention pill that resolves through this plugin's mention\n * provider at send time — the durable way to reference an entity whose\n * content should be fetched fresh when the message is sent.\n */\n insertMention(mention: PluginComposerMention): void;\n /** Focus the composer caret at the end of the draft. */\n focus(): void;\n}\n/**\n * A consumer-supplied action on the messages of one `ThreadChat` instance,\n * rendered in the embedded timeline's per-message action bar alongside the\n * native and slot-registered actions. Unlike the `messageAction` slot this is\n * scoped to the rendering component, not registered globally.\n */\ninterface ThreadChatMessageAction {\n /** Unique within this ThreadChat instance; letters, digits, `-`, `_`. */\n id: string;\n /** Tooltip / menu label for the action. */\n title: string;\n /** Icon hint (BB icon name); unknown names fall back to a generic icon. */\n icon?: string;\n /**\n * Message roles the action applies to. Omitted = both user and assistant\n * messages.\n */\n roles?: readonly (\"user\" | \"assistant\")[];\n /**\n * Runs when the user activates the action. Errors (sync or async) are\n * contained and logged; they never break the timeline.\n */\n run(message: ThreadChatMessageReference): void | Promise;\n}\n/**\n * Props of the host-owned `ThreadChat` component — one thread's chat\n * (timeline, and for the composer variants the full send/queue/draft\n * engine), rendered by the BB app inside a plugin slot. This is the\n * deliberate exception to the no-host-components rule (§5.5): a stable\n * product capability, not a UI kit. Versioned additive like slot props;\n * internal timeline rows, query hooks, and prompt-box configuration are\n * deliberately not exposed.\n */\ninterface ThreadChatProps {\n threadId: string;\n /**\n * \"full\" (default) is the page presentation (centered reading width);\n * \"compact\" is the side-panel presentation; \"timeline\" renders the\n * transcript without a composer.\n */\n variant?: \"full\" | \"compact\" | \"timeline\";\n /**\n * \"contained\" (default) fills and scrolls inside a bounded parent;\n * \"document\" grows with its content and defers scrolling to the page.\n */\n layout?: \"contained\" | \"document\";\n /** Bump to focus the composer (ignored by `variant: \"timeline\"`). */\n focusRequest?: number;\n /**\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;\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(): PluginRpcClient;\n useRealtime(channel: string, handler: (payload: unknown) => void): void;\n /**\n * Observe the same shared connection that delivers `useRealtime` signals.\n * Use a subsequent transition to `connected` to reconcile server state that\n * may have changed while ephemeral signals could not be delivered. The first\n * connection can transition from `connecting` and is not a reconnection.\n */\n useRealtimeConnectionState(): PluginRealtimeConnectionState;\n useSettings(): PluginSettingsState;\n useBbContext(): BbContext;\n useBbNavigate(): BbNavigate;\n useComposer(): PluginComposerApi;\n /**\n * The 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;\n /**\n * The host-owned chat-message markdown renderer (see\n * {@link MarkdownProps}).\n */\n Markdown: ComponentType;\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;\n useComposerView(): ComposerView;\n}\n\ninterface EnvironmentActionArgs {\n environmentId: string;\n}\ninterface EnvironmentGetArgs extends EnvironmentActionArgs {\n signal?: AbortSignal;\n}\ntype EnvironmentMergeBaseBranchUpdateValue = Exclude;\ntype EnvironmentNameUpdateValue = Exclude;\ninterface EnvironmentMergeBaseBranchUpdate {\n mergeBaseBranch: EnvironmentMergeBaseBranchUpdateValue;\n name?: EnvironmentNameUpdateValue;\n}\ninterface EnvironmentNameUpdate {\n mergeBaseBranch?: EnvironmentMergeBaseBranchUpdateValue;\n name: EnvironmentNameUpdateValue;\n}\ntype EnvironmentUpdateFields = EnvironmentMergeBaseBranchUpdate | EnvironmentNameUpdate;\ntype EnvironmentUpdateArgs = EnvironmentUpdateFields & {\n environmentId: string;\n};\ninterface EnvironmentStatusArgs extends EnvironmentStatusQuery {\n environmentId: string;\n signal?: AbortSignal;\n}\ntype EnvironmentDiffArgs = EnvironmentDiffQuery & {\n environmentId: string;\n signal?: AbortSignal;\n};\ntype EnvironmentDiffFileArgs = EnvironmentDiffFileQuery & {\n environmentId: string;\n signal?: AbortSignal;\n};\ninterface EnvironmentDiffBranchesArgs extends EnvironmentDiffBranchesQuery {\n environmentId: string;\n signal?: AbortSignal;\n}\ninterface EnvironmentCommitArgs {\n environmentId: string;\n}\ninterface EnvironmentSquashMergeArgs {\n environmentId: string;\n mergeBaseBranch: string;\n}\ninterface EnvironmentPullRequestMergeArgs {\n environmentId: string;\n method: PullRequestMergeMethod;\n}\ntype EnvironmentDiffPatchArgs = EnvironmentDiffPatchRequest & {\n environmentId: string;\n signal?: AbortSignal;\n};\ninterface EnvironmentPathsArgs extends EnvironmentPathsQuery {\n environmentId: string;\n signal?: AbortSignal;\n}\ntype EnvironmentArchiveThreadsResult = EnvironmentArchiveThreadsResponse;\ntype EnvironmentCommitResult = CommitActionResponse;\ntype EnvironmentDiffResult = EnvironmentDiffResponse;\ntype EnvironmentDiffBranchesResult = EnvironmentDiffBranchesResponse;\ntype EnvironmentDiffFileResult = EnvironmentDiffFileResponse;\ntype EnvironmentDiffFilesResult = EnvironmentDiffFilesResponse;\ntype EnvironmentDiffPatchResult = EnvironmentDiffPatchResponse;\ntype EnvironmentGetResult = Environment;\ntype EnvironmentMarkPullRequestDraftResult = PullRequestDraftActionResponse;\ntype EnvironmentMarkPullRequestReadyResult = PullRequestReadyActionResponse;\ntype EnvironmentMergePullRequestResult = PullRequestMergeActionResponse;\ntype EnvironmentPathsResult = WorkspacePathListResponse;\ntype EnvironmentPullRequestResult = EnvironmentPullRequestResponse;\ntype EnvironmentSquashMergeResult = SquashMergeActionResponse;\ntype EnvironmentStatusResult = EnvironmentStatusResponse;\ntype EnvironmentUpdateResult = Environment;\ninterface EnvironmentsArea {\n archiveThreads(args: EnvironmentActionArgs): Promise;\n commit(args: EnvironmentCommitArgs): Promise;\n diff(args: EnvironmentDiffArgs): Promise;\n diffBranches(args: EnvironmentDiffBranchesArgs): Promise;\n diffFile(args: EnvironmentDiffFileArgs): Promise;\n diffFiles(args: EnvironmentDiffArgs): Promise;\n diffPatch(args: EnvironmentDiffPatchArgs): Promise;\n get(args: EnvironmentGetArgs): Promise;\n pullRequest(args: EnvironmentGetArgs): Promise;\n markPullRequestDraft(args: EnvironmentActionArgs): Promise;\n markPullRequestReady(args: EnvironmentActionArgs): Promise;\n mergePullRequest(args: EnvironmentPullRequestMergeArgs): Promise;\n paths(args: EnvironmentPathsArgs): Promise;\n squashMerge(args: EnvironmentSquashMergeArgs): Promise;\n status(args: EnvironmentStatusArgs): Promise;\n update(args: EnvironmentUpdateArgs): Promise;\n}\n\n/**\n * Host file primitives. `hostId` may be omitted to target the server's\n * primary (local) host. `rootPath`, when set, confines the target beneath\n * that absolute root on the host (symlink-safe).\n */\ninterface FileReadArgs {\n hostId?: string;\n path: string;\n rootPath?: string;\n signal?: AbortSignal;\n}\ninterface FileWriteArgs {\n hostId?: string;\n path: string;\n rootPath?: string;\n content: string;\n /** Defaults to \"utf8\". */\n contentEncoding?: \"utf8\" | \"base64\";\n /** Defaults to false. */\n createParents?: boolean;\n /**\n * Optimistic-concurrency guard: omitted → unconditional write; a hash →\n * write only when the current content hashes to it (use `read().sha256`);\n * null → create-only. A failed guard resolves to the `conflict` outcome.\n */\n expectedSha256?: string | null;\n /** POSIX permission bits used when creating a file (for example 0o600). */\n mode?: number;\n}\ninterface FileListArgs {\n hostId?: string;\n path: string;\n query?: string;\n limit?: number;\n signal?: AbortSignal;\n}\ninterface PathListArgs extends FileListArgs {\n includeFiles: boolean;\n includeDirectories: boolean;\n}\ninterface FileMkdirArgs {\n hostId?: string;\n path: string;\n rootPath?: string;\n recursive?: boolean;\n}\ninterface FileMoveArgs {\n hostId?: string;\n sourcePath: string;\n destinationPath: string;\n rootPath?: string;\n}\ninterface FileRemoveArgs {\n hostId?: string;\n path: string;\n rootPath?: string;\n recursive?: boolean;\n}\ninterface FilePreviewArgs {\n hostId?: string;\n rootPath: string;\n signal?: AbortSignal;\n ttlMs?: number;\n}\ntype FileReadResult = HostFileReadResponse;\ntype FileWriteResult = HostFileWriteResponse;\ntype FileListResult = HostFileListResponse;\ntype PathListResult = HostPathListResponse;\ntype FileMkdirResult = HostMkdirResponse;\ntype FileMoveResult = HostMovePathResponse;\ntype FileRemoveResult = HostRemovePathResponse;\ntype FilePreviewResult = CreateFilePreviewResponse;\ninterface FilesArea {\n read(args: FileReadArgs): Promise;\n write(args: FileWriteArgs): Promise;\n list(args: FileListArgs): Promise;\n listPaths(args: PathListArgs): Promise;\n mkdir(args: FileMkdirArgs): Promise;\n move(args: FileMoveArgs): Promise;\n remove(args: FileRemoveArgs): Promise;\n createPreview(args: FilePreviewArgs): Promise;\n}\n\ninterface GuideRenderArgs {\n chapter?: string;\n}\ninterface GuideRenderResult {\n chapter?: string;\n content: string;\n}\ninterface GuideArea {\n render(args?: GuideRenderArgs): GuideRenderResult;\n}\n\ninterface HostGetArgs {\n hostId: string;\n signal?: AbortSignal;\n}\ninterface HostDeleteArgs {\n hostId: string;\n}\ninterface HostUpdateArgs extends UpdateHostRequest {\n hostId: string;\n}\ninterface HostRetryUpdateArgs {\n hostId: string;\n}\ninterface HostDirectoryArgs extends HostDirectoryQuery {\n hostId: string;\n signal?: AbortSignal;\n}\ninterface HostCloneDefaultPathArgs extends HostCloneDefaultPathQuery {\n hostId: string;\n signal?: AbortSignal;\n}\ninterface HostPathsExistArgs extends HostPathsExistRequest {\n hostId: string;\n signal?: AbortSignal;\n}\ninterface HostPickFolderArgs extends HostPickFolderRequest {\n hostId: string;\n signal?: AbortSignal;\n}\ninterface HostProviderCliInstallArgs extends HostProviderCliInstallRequest {\n hostId: string;\n}\ninterface HostListArgs {\n signal?: AbortSignal;\n}\ntype HostCreateJoinCodeResult = CreateHostJoinCodeResponse;\ntype HostDeleteResult = {\n ok: true;\n};\ntype HostDirectoryResult = HostDirectoryListing;\ntype HostGetResult = Host;\ntype HostCloneDefaultPathResult = HostCloneDefaultPathResponse;\ntype HostProviderCliInstallResult = HostProviderCliInstallEvent[];\ntype HostListResult = Host[];\ntype HostPathsExistResult = HostPathsExistResponse;\ntype HostPickFolderResult = HostPickFolderResponse;\ntype HostProviderCliStatusResult = HostProviderCliStatusResponse;\ntype HostRetryUpdateResult = HostRetryUpdateResponse;\ntype HostUpdateResult = Host;\ninterface HostsArea {\n createJoinCode(): Promise;\n delete(args: HostDeleteArgs): Promise;\n directory(args: HostDirectoryArgs): Promise;\n get(args: HostGetArgs): Promise;\n cloneDefaultPath(args: HostCloneDefaultPathArgs): Promise;\n installProviderCli(args: HostProviderCliInstallArgs): Promise;\n list(args?: HostListArgs): Promise;\n pathsExist(args: HostPathsExistArgs): Promise;\n pickFolder(args: HostPickFolderArgs): Promise;\n providerCliStatus(args: HostGetArgs): Promise;\n retryUpdate(args: HostRetryUpdateArgs): Promise;\n update(args: HostUpdateArgs): Promise;\n}\n\ninterface ProjectListArgs {\n include?: ProjectListQuery[\"include\"];\n /** Include the singleton personal project. Defaults to false for compatibility. */\n includePersonal?: boolean;\n signal?: AbortSignal;\n}\ninterface ProjectCreateArgs extends CreateProjectRequest {\n}\ninterface ProjectGetArgs {\n projectId: string;\n signal?: AbortSignal;\n}\ninterface ProjectUpdateArgs extends UpdateProjectRequest {\n projectId: string;\n}\ninterface ProjectDeleteArgs {\n projectId: string;\n}\ninterface ProjectReorderArgs extends ReorderProjectRequest {\n projectId: string;\n}\ninterface ProjectPromptHistoryArgs extends PromptHistoryQuery {\n projectId: string;\n signal?: AbortSignal;\n}\n/** Select one project workspace source, or omit both for the primary host. */\ntype ProjectWorkspaceRoutingArgs = {\n environmentId: string;\n hostId?: never;\n} | {\n environmentId?: never;\n hostId: string;\n} | {\n environmentId?: never;\n hostId?: never;\n};\ntype ProjectFilesArgs = ProjectWorkspaceRoutingArgs & Omit & {\n projectId: string;\n signal?: AbortSignal;\n};\ntype ProjectPathsArgs = ProjectWorkspaceRoutingArgs & Omit & {\n projectId: string;\n signal?: AbortSignal;\n};\ntype ProjectCommandsArgs = ProjectWorkspaceRoutingArgs & Omit & {\n projectId: string;\n signal?: AbortSignal;\n};\ntype ProjectFileContentArgs = ProjectWorkspaceRoutingArgs & Omit & {\n projectId: string;\n signal?: AbortSignal;\n};\ninterface ProjectBranchesArgs extends ProjectBranchesQuery {\n projectId: string;\n signal?: AbortSignal;\n}\ninterface ProjectDefaultExecutionOptionsArgs {\n projectId: string;\n signal?: AbortSignal;\n}\ninterface ProjectAttachmentFileLike {\n arrayBuffer(): Promise;\n readonly name: string;\n readonly type?: string;\n}\ninterface ProjectAttachmentUploadArgsBase {\n /** MIME override. Omit to use the File/Blob type, when available. */\n mimeType?: string;\n projectId: string;\n}\n/**\n * Upload bytes owned by this SDK client. A bare Blob/byte buffer needs an\n * explicit filename; File-like values can supply their own name.\n */\ntype ProjectAttachmentUploadArgs = ProjectAttachmentUploadArgsBase & ({\n clientFile: ProjectAttachmentFileLike;\n filename?: string;\n} | {\n clientFile: ArrayBuffer | Blob | Uint8Array;\n filename: string;\n});\ninterface ProjectAttachmentReadArgs {\n path: string;\n projectId: string;\n signal?: AbortSignal;\n}\ninterface ProjectAttachmentCopyArgs extends CopyProjectAttachmentsRequest {\n projectId: string;\n}\ntype ProjectSourceAddArgs = CreateProjectSourceRequest & {\n projectId: string;\n};\ninterface ProjectSourceUpdateArgs extends UpdateProjectSourceRequest {\n projectId: string;\n sourceId: string;\n}\ninterface ProjectSourceDeleteArgs {\n projectId: string;\n sourceId: string;\n}\ntype ProjectBranchesResult = ProjectBranchesResponse;\ninterface ProjectAttachmentReadResult {\n bytes: Uint8Array;\n mimeType: string;\n sizeBytes: number;\n}\ntype ProjectAttachmentUploadResult = UploadedPromptAttachment;\ntype ProjectCommandsResult = CommandListResponse;\ntype ProjectCreateResult = ProjectResponse;\ntype ProjectDefaultExecutionOptionsResult = ProjectExecutionDefaults | null;\ntype ProjectDeleteResult = {\n ok: true;\n};\ninterface ProjectFileContentResult {\n /** UTF-8 text or base64, as selected by `contentEncoding`. */\n content: string;\n contentEncoding: \"utf8\" | \"base64\";\n mimeType: string;\n sizeBytes: number;\n}\ntype ProjectFilesResult = WorkspaceFileListResponse;\ntype ProjectGetResult = ProjectResponse;\ntype ProjectListResult = ProjectResponse[] | ProjectWithThreadsResponse[];\ntype ProjectPathsResult = WorkspacePathListResponse;\ntype ProjectPromptHistoryResult = PromptHistoryResponse;\ntype ProjectReorderResult = ProjectResponse[];\ntype ProjectSourceAddResult = ProjectSource;\ntype ProjectSourceDeleteResult = {\n ok: true;\n};\ntype ProjectSourceUpdateResult = ProjectSource;\ntype ProjectUpdateResult = ProjectResponse;\ninterface ProjectSourcesArea {\n add(args: ProjectSourceAddArgs): Promise;\n delete(args: ProjectSourceDeleteArgs): Promise;\n update(args: ProjectSourceUpdateArgs): Promise;\n}\ninterface ProjectAttachmentsArea {\n copy(args: ProjectAttachmentCopyArgs): Promise;\n read(args: ProjectAttachmentReadArgs): Promise;\n upload(args: ProjectAttachmentUploadArgs): Promise;\n}\ninterface ProjectsArea {\n attachments: ProjectAttachmentsArea;\n branches(args: ProjectBranchesArgs): Promise;\n commands(args: ProjectCommandsArgs): Promise;\n create(args: ProjectCreateArgs): Promise;\n defaultExecutionOptions(args: ProjectDefaultExecutionOptionsArgs): Promise;\n delete(args: ProjectDeleteArgs): Promise;\n fileContent(args: ProjectFileContentArgs): Promise;\n files(args: ProjectFilesArgs): Promise;\n get(args: ProjectGetArgs): Promise;\n list(args?: ProjectListArgs): Promise;\n paths(args: ProjectPathsArgs): Promise;\n promptHistory(args: ProjectPromptHistoryArgs): Promise;\n reorder(args: ProjectReorderArgs): Promise;\n sources: ProjectSourcesArea;\n update(args: ProjectUpdateArgs): Promise;\n}\n\n/** Select exactly one provider-discovery host source, or omit both for primary. */\ntype ProviderHostRoutingArgs = {\n environmentId: string;\n hostId?: never;\n} | {\n environmentId?: never;\n hostId: string;\n} | {\n environmentId?: never;\n hostId?: never;\n};\ntype ProviderListArgs = ProviderHostRoutingArgs & {\n signal?: AbortSignal;\n};\ntype ProviderModelsArgs = ProviderHostRoutingArgs & {\n providerId?: string;\n signal?: AbortSignal;\n};\ntype ProviderListResult = ProviderInfo[];\ntype ProviderModelsResult = SystemExecutionOptionsResponse;\ninterface ProvidersArea {\n /** List providers on the environment host, explicit host, or primary host. */\n list(args?: ProviderListArgs): Promise;\n /** List models on the environment host, explicit host, or primary host. */\n models(args?: ProviderModelsArgs): Promise;\n}\n\ninterface PluginIdArgs {\n pluginId: string;\n}\n/** Install directly from a path:, git:, npm:, or builtin: source spec. */\ninterface PluginInstallArgs {\n source: string;\n}\n/** Install an entry from BB's official catalog. */\ninterface PluginCatalogInstallArgs {\n entryId: string;\n}\ninterface PluginReloadArgs {\n pluginId?: string;\n}\ninterface PluginSettingsUpdateArgs extends PluginIdArgs {\n values: Record;\n}\ninterface PluginTokenArgs extends PluginIdArgs {\n rotate?: boolean;\n}\ninterface PluginCheckUpdatesArgs {\n pluginId?: string;\n signal?: AbortSignal;\n}\ninterface PluginRpcArgs extends PluginIdArgs {\n input?: JsonValue$1;\n method: string;\n outputSchema: z$1.ZodType;\n}\ninterface PluginCatalogSearchArgs {\n query: string;\n signal?: AbortSignal;\n}\ninterface PluginCatalogStatusArgs {\n signal?: AbortSignal;\n}\ninterface PluginGetSettingsArgs extends PluginIdArgs {\n signal?: AbortSignal;\n}\ninterface PluginGetSourceArgs extends PluginIdArgs {\n signal?: AbortSignal;\n}\ninterface PluginListArgs {\n signal?: AbortSignal;\n}\ninterface PluginListUpdateResultsArgs {\n signal?: AbortSignal;\n}\ntype PluginDisableResult = InstalledPlugin;\ntype PluginEnableResult = InstalledPlugin;\ntype PluginGetSettingsResult = PluginSettingsResponse;\ntype PluginInstallResult = InstalledPlugin;\ntype PluginListResult = PluginListResponse;\ntype PluginReloadResult = PluginReloadResponse;\ntype PluginRemoveResult = PluginRemoveResponse;\ntype PluginTokenResult = PluginTokenResponse;\ntype PluginUpdateSettingsResult = PluginSettingsResponse;\ntype PluginGetSourceResult = PluginSourceDetail;\ntype PluginCheckUpdatesResult = PluginUpdateCheckEntry[];\ntype PluginApplyUpdateResult = PluginApplyUpdateResult$1;\ntype PluginCatalogStatusResult = PluginCatalogStatus;\ntype PluginCatalogSearchResult = PluginCatalogSearchResult$1[];\ninterface PluginCatalogArea {\n install(args: PluginCatalogInstallArgs): Promise;\n search(args: PluginCatalogSearchArgs): Promise;\n status(args?: PluginCatalogStatusArgs): Promise;\n}\ninterface PluginsArea {\n applyUpdate(args: PluginIdArgs): Promise;\n callRpc(args: PluginRpcArgs): Promise;\n checkUpdates(args?: PluginCheckUpdatesArgs): Promise;\n catalog: PluginCatalogArea;\n disable(args: PluginIdArgs): Promise;\n enable(args: PluginIdArgs): Promise;\n getSettings(args: PluginGetSettingsArgs): Promise;\n getSource(args: PluginGetSourceArgs): Promise;\n install(args: PluginInstallArgs): Promise;\n list(args?: PluginListArgs): Promise;\n listUpdateResults(args?: PluginListUpdateResultsArgs): Promise;\n reload(args?: PluginReloadArgs): Promise;\n remove(args: PluginIdArgs): Promise;\n token(args: PluginTokenArgs): Promise;\n updateSettings(args: PluginSettingsUpdateArgs): Promise;\n}\n\ntype BbRealtimeUnsubscribe = () => void;\ntype BbRealtimeEventName = \"thread:changed\" | \"project:changed\" | \"environment:changed\" | \"host:changed\" | \"system:changed\" | \"system:config-changed\" | \"realtime:connection\";\ntype ThreadRealtimeEvent = Extract;\ntype ProjectRealtimeEvent = Extract;\ntype EnvironmentRealtimeEvent = Extract;\ntype HostRealtimeEvent = Extract;\ntype SystemRealtimeEvent = Extract;\ntype BbRealtimeConnectionState = \"connecting\" | \"connected\" | \"disconnected\";\ninterface BbRealtimeConnectionEvent {\n reconnectDelayMs: number | null;\n reconnected: boolean;\n state: BbRealtimeConnectionState;\n}\n/**\n * Entity-changed events are delivered as one shared object to every matching\n * listener; their payload types are readonly so a listener cannot mutate what\n * the next listener receives.\n */\ninterface BbRealtimeEventMap {\n \"thread:changed\": ThreadRealtimeEvent;\n \"project:changed\": ProjectRealtimeEvent;\n \"environment:changed\": EnvironmentRealtimeEvent;\n \"host:changed\": HostRealtimeEvent;\n \"system:changed\": SystemRealtimeEvent;\n \"system:config-changed\": SystemRealtimeEvent;\n \"realtime:connection\": BbRealtimeConnectionEvent;\n}\ntype BbRealtimeCallback = (event: BbRealtimeEventMap[TEventName]) => void;\ninterface ThreadRealtimeSubscribeArgs {\n callback: BbRealtimeCallback<\"thread:changed\">;\n event: \"thread:changed\";\n threadId?: string;\n}\ninterface ProjectRealtimeSubscribeArgs {\n callback: BbRealtimeCallback<\"project:changed\">;\n event: \"project:changed\";\n projectId?: string;\n}\ninterface EnvironmentRealtimeSubscribeArgs {\n callback: BbRealtimeCallback<\"environment:changed\">;\n environmentId?: string;\n event: \"environment:changed\";\n}\ninterface HostRealtimeSubscribeArgs {\n callback: BbRealtimeCallback<\"host:changed\">;\n event: \"host:changed\";\n hostId?: string;\n}\ninterface SystemRealtimeSubscribeArgs {\n callback: BbRealtimeCallback<\"system:changed\">;\n event: \"system:changed\";\n}\ninterface SystemConfigRealtimeSubscribeArgs {\n callback: BbRealtimeCallback<\"system:config-changed\">;\n event: \"system:config-changed\";\n}\n/**\n * Connection listeners are pure observers — they never open or hold the\n * socket. A listener registered while a socket already exists receives the\n * latest connection event as a snapshot on the next microtask, so a status\n * UI mounted after connect still learns the current state.\n */\ninterface RealtimeConnectionSubscribeArgs {\n callback: BbRealtimeCallback<\"realtime:connection\">;\n event: \"realtime:connection\";\n}\ntype BbRealtimeSubscribeArgsUnion = ThreadRealtimeSubscribeArgs | ProjectRealtimeSubscribeArgs | EnvironmentRealtimeSubscribeArgs | HostRealtimeSubscribeArgs | SystemRealtimeSubscribeArgs | SystemConfigRealtimeSubscribeArgs | RealtimeConnectionSubscribeArgs;\ntype BbRealtimeSubscribeArgs = Extract;\ninterface BbRealtime {\n subscribe(args: BbRealtimeSubscribeArgs): BbRealtimeUnsubscribe;\n}\n\ninterface StatusGetArgs {\n projectId?: string;\n signal?: AbortSignal;\n threadId?: string;\n}\ninterface StatusThreadSummary {\n environmentId: string | null;\n id: string;\n parentThreadId: string | null;\n pinnedAt: number | null;\n projectId: string;\n status: ThreadStatus;\n title: string | null;\n}\ntype StatusProject = ProjectResponse;\ntype StatusChildThreads = ThreadListResponse;\ninterface StatusResult {\n childThreads: StatusChildThreads | null;\n pendingTodos: ThreadTimelinePendingTodos | null;\n project: StatusProject | null;\n thread: StatusThreadSummary | null;\n}\ninterface StatusArea {\n get(args?: StatusGetArgs): Promise;\n}\n\ninterface SkillWorkspaceArgs {\n projectId: string;\n environmentId: string | null;\n}\ninterface SkillListArgs extends SkillWorkspaceArgs {\n signal?: AbortSignal;\n}\ninterface SkillIdentityArgs extends SkillListArgs {\n skillId: string;\n}\ninterface SkillContentArgs extends SkillIdentityArgs {\n path: string;\n}\ninterface SkillUpdateArgs extends SkillWorkspaceArgs {\n skillId: string;\n content: string;\n revision: string;\n}\ninterface SkillDeleteArgs extends SkillWorkspaceArgs {\n skillId: string;\n}\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;\n get(args: RegistrySkillIdArgs): Promise;\n install(args: RegistrySkillInstallArgs): Promise;\n repositoryStars(args: RegistryRepositoryArgs): Promise;\n search(args?: RegistrySkillsSearchArgs): Promise;\n}\ninterface SkillsArea {\n getContent(args: SkillContentArgs): Promise;\n list(args: SkillListArgs): Promise;\n listFiles(args: SkillIdentityArgs): Promise;\n registry: SkillsRegistryArea;\n remove(args: SkillDeleteArgs): Promise<{\n deletedPath: string;\n }>;\n update(args: SkillUpdateArgs): Promise<{\n filePath: string;\n revision: string;\n }>;\n}\n\ntype ThemeGetResult = AppTheme;\ntype ThemeCatalogResult = ThemeCatalogResponse;\ntype ThemeSetInput = AppThemeSelection;\ntype ThemeSetResult = AppTheme;\ninterface ThemeCatalogArgs {\n signal?: AbortSignal;\n}\ninterface ThemeGetArgs {\n signal?: AbortSignal;\n}\ninterface ThemeArea {\n /** The active app palette, resolved server-side (built-in id or custom CSS). */\n get(args?: ThemeGetArgs): Promise;\n /** The custom-theme directory plus discovered themes and the active palette. */\n catalog(args?: ThemeCatalogArgs): Promise;\n /** Set the complete app appearance selection in one request. */\n set(selection: ThemeSetInput): Promise;\n /**\n * Activate a palette by id while preserving the active favicon color. This\n * compatibility shorthand reads the active appearance before writing the\n * complete selection; prefer the object form when both values are known.\n */\n set(themeId: string): Promise;\n}\n\ninterface SystemAttentionArgs {\n signal?: AbortSignal;\n}\ninterface SystemConfigArgs {\n signal?: AbortSignal;\n}\ninterface SystemExecutionOptionsArgs extends SystemExecutionOptionsQuery {\n signal?: AbortSignal;\n}\ninterface SystemUsageLimitsArgs extends SystemUsageLimitsQuery {\n signal?: AbortSignal;\n}\ninterface SystemVersionArgs {\n force?: boolean;\n signal?: AbortSignal;\n}\ninterface SystemVoiceTranscriptionArgs {\n file: Blob;\n prompt?: string;\n signal?: AbortSignal;\n}\ntype SystemAttentionResult = SystemAttentionResponse;\ntype SystemConfigResult = SystemConfigResponse;\ntype SystemExecutionOptionsResult = SystemExecutionOptionsResponse;\ntype SystemReloadConfigResult = SystemConfigReloadResponse;\ntype 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;\n config(args?: SystemConfigArgs): Promise;\n executionOptions(args?: SystemExecutionOptionsArgs): Promise;\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;\n installCliSkills(args: SystemInstallCliSkillsArgs): Promise;\n reloadConfig(): Promise;\n transcribeVoice(args: SystemVoiceTranscriptionArgs): Promise;\n updateExperiments(args: Experiments): Promise;\n updateGeneralSettings(args: AppSettings): Promise;\n updateKeyboardSettings(args: AppKeybindingOverrides): Promise;\n /** 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;\n /** Candidate projects discovered on the host, ranked for onboarding. */\n onboardingRepos(args?: SystemOnboardingArgs): Promise;\n usageLimits(args?: SystemUsageLimitsArgs): Promise;\n version(args?: SystemVersionArgs): Promise;\n}\n\ninterface TerminalThreadScope {\n cwd?: never;\n environmentId?: never;\n hostId?: never;\n kind: \"thread\";\n threadId: string;\n}\ninterface TerminalEnvironmentScope {\n environmentId: string;\n cwd?: never;\n hostId?: never;\n kind: \"environment\";\n threadId?: never;\n}\ninterface TerminalHostPathListScope {\n /** Optional exact initial working-directory filter on the selected host. */\n cwd?: string;\n environmentId?: never;\n hostId: string;\n kind: \"host_path\";\n threadId?: never;\n}\ninterface TerminalHostPathCreateScope {\n /** Null starts in the selected host's home directory. */\n cwd: string | null;\n environmentId?: never;\n hostId: string;\n kind: \"host_path\";\n threadId?: never;\n}\ntype TerminalListScope = TerminalThreadScope | TerminalEnvironmentScope | TerminalHostPathListScope;\ntype TerminalCreateScope = TerminalThreadScope | TerminalEnvironmentScope | TerminalHostPathCreateScope;\ninterface TerminalListArgs {\n signal?: AbortSignal;\n scope: TerminalListScope;\n}\ninterface TerminalCreateArgs {\n cols: number;\n rows: number;\n scope: TerminalCreateScope;\n start?: CreateTerminalRequest[\"start\"];\n title?: string;\n}\ninterface TerminalTargetArgs {\n terminalId: string;\n}\ninterface TerminalGetArgs extends TerminalTargetArgs {\n signal?: AbortSignal;\n}\ninterface TerminalRenameArgs extends TerminalTargetArgs {\n title: UpdateTerminalRequest[\"title\"];\n}\ninterface TerminalCloseArgs extends TerminalTargetArgs {\n mode: \"force\" | \"if-clean\";\n}\ninterface TerminalInputArgs extends TerminalTargetArgs {\n dataBase64: TerminalInputRequest[\"dataBase64\"];\n}\ninterface TerminalResizeArgs extends TerminalTargetArgs {\n cols: TerminalResizeRequest[\"cols\"];\n rows: TerminalResizeRequest[\"rows\"];\n}\ninterface TerminalOutputArgs extends TerminalTargetArgs {\n limitChunks?: TerminalOutputQuery[\"limitChunks\"];\n signal?: AbortSignal;\n sinceSeq?: TerminalOutputQuery[\"sinceSeq\"];\n tailBytes?: TerminalOutputQuery[\"tailBytes\"];\n}\ntype TerminalRestartArgs = TerminalTargetArgs;\ntype TerminalListResult = TerminalListResponse;\ntype TerminalCreateResult = TerminalSession;\ntype TerminalGetResult = TerminalSession;\ntype TerminalRenameResult = TerminalSession;\ntype TerminalCloseResult = TerminalSession;\ntype TerminalInputResult = TerminalSession;\ntype TerminalResizeResult = TerminalSession;\ntype TerminalOutputResult = TerminalOutputResponse;\ntype TerminalRestartResult = TerminalSession;\ninterface TerminalsArea {\n close(args: TerminalCloseArgs): Promise;\n create(args: TerminalCreateArgs): Promise;\n get(args: TerminalGetArgs): Promise;\n input(args: TerminalInputArgs): Promise;\n list(args: TerminalListArgs): Promise;\n output(args: TerminalOutputArgs): Promise;\n rename(args: TerminalRenameArgs): Promise;\n /**\n * Replace a terminal with a shell at the same scope, size, and title.\n * The original command is not replayed because terminal sessions do not\n * persist launch commands. The replacement has a new terminal ID.\n */\n restart(args: TerminalRestartArgs): Promise;\n resize(args: TerminalResizeArgs): Promise;\n}\n\ninterface ThreadListArgs {\n archived?: boolean;\n 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 {\n childOrigin?: CreateThreadRequest[\"childOrigin\"];\n origin?: CreateThreadRequest[\"origin\"];\n originKind?: CreateThreadRequest[\"originKind\"];\n startedOnBehalfOf?: CreateThreadRequest[\"startedOnBehalfOf\"];\n}\ntype ThreadSpawnArgs = ThreadSpawnBaseArgs & ({\n input: CreateThreadRequest[\"input\"];\n prompt?: never;\n} | {\n input?: never;\n prompt: string;\n});\ninterface ThreadForkArgs extends Omit {\n origin?: ForkThreadRequest[\"origin\"];\n visibility?: ForkThreadRequest[\"visibility\"];\n workspace?: ForkThreadRequest[\"workspace\"];\n}\ninterface ThreadUpdateArgs extends UpdateThreadRequest {\n threadId: string;\n}\ninterface ThreadDeleteArgs extends DeleteThreadRequest {\n threadId: string;\n}\ninterface ThreadSendArgs extends SendMessageRequest {\n threadId: string;\n}\ninterface ThreadActionArgs {\n threadId: string;\n}\ninterface ThreadStatusArgs extends ThreadActionArgs {\n signal?: AbortSignal;\n}\ninterface ThreadPromptHistoryArgs extends PromptHistoryQuery {\n signal?: AbortSignal;\n threadId: string;\n}\ninterface ThreadPinOrderArgs extends ReorderPinnedThreadRequest {\n threadId: string;\n}\ninterface ThreadQueuedMessageArgs {\n signal?: AbortSignal;\n threadId: string;\n}\ninterface ThreadQueuedMessageCreateArgs extends CreateQueuedMessageRequest {\n threadId: string;\n}\ninterface ThreadQueuedMessageUpdateArgs extends ThreadQueuedMessageTargetArgs, UpdateQueuedMessageRequest {\n}\ninterface ThreadQueuedMessageTargetArgs {\n queuedMessageId: string;\n threadId: string;\n}\ninterface ThreadQueuedMessageSendArgs extends ThreadQueuedMessageTargetArgs, SendQueuedMessageRequest {\n}\ninterface ThreadQueuedMessageReorderArgs extends ThreadQueuedMessageTargetArgs, ReorderQueuedMessageRequest {\n}\ninterface ThreadQueuedMessageGroupBoundaryArgs extends SetQueuedMessageGroupBoundaryRequest {\n threadId: string;\n}\ninterface ThreadStorageFilesArgs extends ThreadStorageFilesQuery {\n signal?: AbortSignal;\n threadId: string;\n}\ninterface ThreadStoragePathsArgs extends ThreadStoragePathsQuery {\n signal?: AbortSignal;\n threadId: string;\n}\ninterface ThreadTimelineTurnSummaryDetailsArgs extends TimelineTurnSummaryDetailsQuery {\n signal?: AbortSignal;\n threadId: string;\n}\ninterface ThreadTabsUpdateArgs extends UpdateThreadTabsRequest {\n threadId: string;\n}\ninterface ThreadOpenArgs {\n threadId: string;\n split?: ThreadOpenSplit;\n file: ThreadOpenFile | null;\n}\ninterface ThreadPaneActionArgs {\n action: ThreadPaneAction;\n threadId: string;\n}\ninterface ThreadEventsListArgs {\n afterSeq?: string;\n limit?: string;\n signal?: AbortSignal;\n threadId: string;\n}\ninterface ThreadEventWaitArgs {\n afterSeq?: string;\n signal?: AbortSignal;\n threadId: string;\n type: string;\n waitMs: string;\n}\ninterface ThreadTimelineArgs extends ThreadTimelineQuery {\n signal?: AbortSignal;\n threadId: string;\n}\ninterface ThreadOutputArgs {\n signal?: AbortSignal;\n threadId: string;\n}\ninterface ThreadInteractionListArgs {\n signal?: AbortSignal;\n threadId: string;\n}\ninterface ThreadInteractionTargetArgs {\n interactionId: string;\n threadId: string;\n}\ninterface ThreadInteractionGetArgs extends ThreadInteractionTargetArgs {\n signal?: AbortSignal;\n}\ninterface ThreadInteractionResolveArgs extends ThreadInteractionTargetArgs {\n resolution: PendingInteractionResolution;\n}\ninterface ThreadInteractionRespondArgs extends ThreadInteractionTargetArgs {\n value: JsonValue$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;\n matched: true;\n target: Extract;\n threadId: string;\n} | {\n matched: true;\n target: Extract;\n thread: ThreadGetResult;\n threadId: string;\n};\ninterface ThreadInteractionsArea {\n cancel(args: ThreadInteractionTargetArgs): Promise;\n get(args: ThreadInteractionGetArgs): Promise;\n list(args: ThreadInteractionListArgs): Promise;\n resolve(args: ThreadInteractionResolveArgs): Promise;\n respond(args: ThreadInteractionRespondArgs): Promise;\n}\ninterface ThreadEventsArea {\n list(args: ThreadEventsListArgs): Promise;\n wait(args: ThreadEventWaitArgs): Promise;\n}\ninterface ThreadQueuedMessagesArea {\n create(args: ThreadQueuedMessageCreateArgs): Promise;\n delete(args: ThreadQueuedMessageTargetArgs): Promise;\n list(args: ThreadQueuedMessageArgs): Promise;\n reorder(args: ThreadQueuedMessageReorderArgs): Promise;\n send(args: ThreadQueuedMessageSendArgs): Promise;\n setGroupBoundary(args: ThreadQueuedMessageGroupBoundaryArgs): Promise;\n update(args: ThreadQueuedMessageUpdateArgs): Promise;\n}\ninterface ThreadTabsArea {\n get(args: ThreadStatusArgs): Promise;\n update(args: ThreadTabsUpdateArgs): Promise;\n}\ninterface ThreadsArea {\n archive(args: ThreadActionArgs): Promise;\n archiveAll(args: ThreadActionArgs): Promise;\n childSummary(args: ThreadStatusArgs): Promise;\n cancelPlan(args: ThreadActionArgs): Promise;\n clearGoal(args: ThreadActionArgs): Promise;\n conversationOutline(args: ThreadStatusArgs): Promise;\n defaultExecutionOptions(args: ThreadStatusArgs): Promise;\n delete(args: ThreadDeleteArgs): Promise;\n events: ThreadEventsArea;\n fork(args: ThreadForkArgs): Promise;\n get(args: ThreadGetArgs): Promise;\n interactions: ThreadInteractionsArea;\n list(args?: ThreadListArgs): Promise;\n markRead(args: ThreadActionArgs): Promise;\n markUnread(args: ThreadActionArgs): Promise;\n open(args: ThreadOpenArgs): Promise;\n paneAction(args: ThreadPaneActionArgs): Promise;\n output(args: ThreadOutputArgs): Promise;\n pin(args: ThreadActionArgs): Promise;\n promptHistory(args: ThreadPromptHistoryArgs): Promise;\n queuedMessages: ThreadQueuedMessagesArea;\n reorderPinned(args: ThreadPinOrderArgs): Promise;\n search(args: ThreadSearchArgs): Promise;\n send(args: ThreadSendArgs): Promise;\n spawn(args: ThreadSpawnArgs): Promise;\n stop(args: ThreadActionArgs): Promise;\n tabs: ThreadTabsArea;\n timeline(args: ThreadTimelineArgs): Promise;\n timelineTurnSummaryDetails(args: ThreadTimelineTurnSummaryDetailsArgs): Promise;\n storageFiles(args: ThreadStorageFilesArgs): Promise;\n storagePaths(args: ThreadStoragePathsArgs): Promise;\n unarchive(args: ThreadActionArgs): Promise;\n unpin(args: ThreadActionArgs): Promise;\n update(args: ThreadUpdateArgs): Promise;\n wait(args: ThreadWaitArgs): Promise;\n}\n\ntype ThreadSectionCreateResult = ThreadSectionResponse;\ntype ThreadSectionUpdateResult = ThreadSectionMutationResponse;\ntype ThreadSectionDeleteResult = ThreadSectionMutationResponse;\ntype ThreadSectionListResult = ThreadSectionResponse[];\ninterface ThreadSectionListArgs {\n signal?: AbortSignal;\n}\ninterface ThreadSectionsArea {\n create(args: CreateThreadSectionRequest): Promise;\n delete(args: DeleteThreadSectionRequest): Promise;\n list(args?: ThreadSectionListArgs): Promise;\n update(args: UpdateThreadSectionRequest): Promise;\n}\n\ninterface BbSdk extends BbRealtime {\n environments: EnvironmentsArea;\n files: FilesArea;\n guide: GuideArea;\n hosts: HostsArea;\n projects: ProjectsArea;\n plugins: PluginsArea;\n providers: ProvidersArea;\n skills: SkillsArea;\n status: StatusArea;\n system: SystemArea;\n terminals: TerminalsArea;\n theme: ThemeArea;\n threadSections: ThreadSectionsArea;\n threads: ThreadsArea;\n}\n\n/**\n * The backend plugin API contract — the `bb` object handed to a plugin's\n * `server.ts` factory (`export default function plugin(bb: BbPluginApi)`).\n *\n * Types only: the implementation lives in the BB server\n * (apps/server/src/services/plugins/plugin-api.ts), which imports these\n * shapes so the contract and the implementation cannot drift. Plugin authors\n * import them type-only (`import type { BbPluginApi } from\n * \"@bb/plugin-sdk\"`); the import is erased when BB loads the file.\n *\n * Runtime classes stay host-side. NeedsConfigurationError in particular is\n * matched by NAME, so plugin code needs no runtime import:\n * `throw Object.assign(new Error(msg), { name: \"NeedsConfigurationError\" })`.\n */\ninterface PluginLogger {\n debug(message: string): void;\n info(message: string): void;\n warn(message: string): void;\n error(message: string): void;\n}\n/**\n * Declarative settings descriptors (`bb.settings.define`). Deliberately plain\n * data — not zod — so the host can render settings forms and the CLI can\n * parse values without executing plugin code.\n */\ntype PluginSettingDescriptor = {\n type: \"string\";\n label: string;\n description?: string;\n /** Stored in a 0600 file under /plugins//secrets/, never in the db or sent to the frontend. */\n secret?: true;\n default?: string;\n} | {\n type: \"boolean\";\n label: string;\n description?: string;\n default?: boolean;\n} | {\n type: \"select\";\n label: string;\n description?: string;\n options: string[];\n default?: string;\n} | {\n type: \"project\";\n label: string;\n description?: string;\n default?: string;\n};\ntype PluginSettingDescriptors = Record;\ntype PluginSettingValue = string | boolean;\n/** `default` present → non-optional value; absent → `T | undefined`. */\ntype PluginSettingsValues> = {\n [K in keyof Ds]: Ds[K] extends {\n default: string | boolean;\n } ? PluginSettingValueOf : PluginSettingValueOf | undefined;\n};\ntype PluginSettingValueOf = D extends {\n type: \"boolean\";\n} ? boolean : string;\ninterface PluginSettingsHandle> {\n /** Load-safe: callable inside the factory. */\n get(): Promise>;\n /** Fires after values change through the settings route/CLI. */\n onChange(listener: (next: PluginSettingsValues, prev: PluginSettingsValues) => void): void;\n}\ninterface PluginSettings {\n define>(descriptors: Ds): PluginSettingsHandle;\n}\ninterface PluginKvStorage {\n get(key: string): Promise;\n set(key: string, value: unknown): Promise;\n delete(key: string): Promise;\n list(prefix?: string): Promise;\n}\ninterface PluginStorage {\n /** Namespaced JSON key-value rows in bb.db; values ≤256KB each. */\n kv: PluginKvStorage;\n /**\n * Open (or reuse the path of) the plugin's own SQLite database at\n * /plugins//data.db — the server's better-sqlite3, WAL mode,\n * busy_timeout 5000. Handles are host-tracked and closed on\n * dispose/reload; a closed handle throws on use.\n */\n database(): Database.Database;\n /**\n * Ordered-statement migration helper: statement index = migration id in a\n * `_bb_migrations` table; unapplied statements run in one transaction.\n * Append-only — never reorder or edit shipped statements.\n */\n migrate(db: Database.Database, statements: string[]): void;\n}\n/**\n * Thread lifecycle events a plugin can observe (design §4.5). Observe-only:\n * handlers run fire-and-forget after the transition is applied and can never\n * block or veto it. `thread` is the same public DTO GET /threads/:id serves.\n */\ninterface PluginThreadEventPayloads {\n /** Fired after a thread row is created. */\n \"thread.created\": {\n thread: ThreadResponse;\n };\n /** Fired when a thread transitions into `active`. */\n \"thread.active\": {\n thread: ThreadResponse;\n };\n /** Fired when a thread transitions into `idle`. `lastAssistantText` is\n * assembled the same way GET /threads/:id/output is. */\n \"thread.idle\": {\n thread: ThreadResponse;\n lastAssistantText: string | null;\n };\n /** Fired when a thread transitions into `error`. `error` is the latest\n * system/error event message, when one exists. */\n \"thread.failed\": {\n thread: ThreadResponse;\n error: string | null;\n };\n /** Fired after a thread is archived (including cascade archives). */\n \"thread.archived\": {\n thread: ThreadResponse;\n };\n /** Fired after a thread is soft-deleted. */\n \"thread.deleted\": {\n thread: ThreadResponse;\n };\n}\ntype PluginThreadEventName = keyof PluginThreadEventPayloads;\ntype PluginThreadEventHandler = (payload: PluginThreadEventPayloads[E]) => void | Promise;\ntype PluginHttpAuthMode = \"local\" | \"token\" | \"none\";\ntype PluginHttpHandler = (context: Context) => Response | Promise;\ninterface PluginHttp {\n /**\n * Register an HTTP route, mounted at\n * `/api/v1/plugins//http/`. Auth modes (default \"local\"):\n * - \"local\": Origin/Host must be a local BB app origin; non-GET requires\n * content-type application/json (forces a CORS preflight).\n * - \"token\": requires the per-plugin token (`bb plugin token `) via\n * the x-bb-plugin-token header or ?token=.\n * - \"none\": no checks — only for signature-verified webhooks.\n */\n route(method: string, path: string, handler: PluginHttpHandler, opts?: {\n auth?: PluginHttpAuthMode;\n }): void;\n}\ninterface PluginRpc {\n /**\n * Register a Standard Schema-driven rpc contract and its inferred handlers,\n * served at POST\n * `/api/v1/plugins//rpc/` with \"local\" auth semantics. The\n * host validates input before invocation and output before strict JSON\n * serialization. The response is `{ ok: true, result }` or\n * `{ ok: false, error: { code, message, issues? } }`.\n */\n register(contract: Contract, handlers: PluginRpcHandlers): void;\n}\ninterface PluginRealtime {\n /**\n * Broadcast an ephemeral `plugin-signal` WS message\n * `{ pluginId, channel, payload }` to every connected client (V1 has no\n * per-channel subscriptions). `payload` must be JSON-serializable;\n * `undefined` is normalized to `null`. Nothing is persisted.\n */\n publish(channel: string, payload: unknown): void;\n}\ninterface PluginBackground {\n /**\n * Register a long-lived background service. `start` runs after the\n * factory completes and should resolve when `signal` aborts\n * (dispose/reload/disable/shutdown). A crash restarts it with capped\n * exponential backoff; throwing NeedsConfigurationError marks the plugin\n * `needs-configuration` and stops restarting until the next load.\n */\n service(name: string, service: {\n start(signal: AbortSignal): void | Promise;\n }): void;\n /**\n * Register a cron schedule (5-field expression, server-local time). The\n * durable row keyed (pluginId, name) is upserted at load; the periodic\n * sweep claims due rows with a CAS on next_run_at, but only while this\n * plugin is loaded. Failures land in last_status/last_error, visible in\n * `bb plugin list`.\n */\n schedule(name: string, cron: string, fn: () => void | Promise): void;\n}\ninterface PluginCliCommandInfo {\n name: string;\n summary: string;\n usage: string;\n}\n/** Context forwarded from the invoking CLI when known; all fields optional. */\ninterface PluginCliContext {\n cwd?: string;\n threadId?: string;\n projectId?: string;\n /** Aborted when the invoking CLI HTTP request disconnects. */\n signal?: AbortSignal;\n}\ntype PluginInteractionCancelReason = \"user\" | \"request-aborted\" | \"thread-stopped\" | \"thread-deleted\" | \"plugin-disposed\" | \"server-restarted\" | \"timeout\";\ntype PluginInteractionResult = {\n outcome: \"submitted\";\n value: JsonValue;\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 …`): lowercase [a-z0-9-]+, and not\n * a core bb command (see RESERVED_BB_CLI_COMMANDS in the server). */\n name: string;\n summary: string;\n /** Subcommand metadata rendered in help and the plugin-commands skill\n * without executing plugin code. Parsing argv is plugin-owned. */\n commands?: PluginCliCommandInfo[];\n run(argv: string[], ctx: PluginCliContext): PluginCliResult | Promise;\n}\ninterface PluginCli {\n /**\n * Register this plugin's `bb` subcommand. One registration per factory\n * execution; a repeated call is rejected. Core bb commands always win\n * name collisions; reserved names are rejected at registration.\n */\n register(registration: PluginCliRegistration): void;\n}\n/** Per-turn context handed to bb.agents context providers (design §4.4). */\n/** MCP-style content parts a native tool may return (design §4.4). */\ntype PluginAgentToolContentPart = {\n type: \"text\";\n text: string;\n} | {\n type: \"image\";\n data: string;\n mimeType: string;\n};\ntype PluginAgentToolResult = string | {\n content: PluginAgentToolContentPart[];\n isError?: boolean;\n};\n/** Per-call context handed to a native tool's execute (design §4.4). */\ninterface PluginAgentToolContext {\n threadId: string;\n projectId: string;\n /** The tool-call request's abort signal (aborts if the daemon round-trip\n * is torn down mid-call). */\n signal: AbortSignal;\n}\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;\n}\n/** Per-resolution selection returned by {@link PluginAgents.configure}. */\ninterface PluginAgentConfiguration {\n /** Tool names registered by this plugin, or {@link PluginAgentToolSelection}\n * entries to also override a tool's advertised parameter schema for this\n * resolution. Duplicate or unknown names, or an invalid override, reject\n * this plugin's complete selection for the resolution. */\n tools: Array;\n /** Skill frontmatter names from this plugin's manifest skill roots.\n * Duplicate or unknown names reject this plugin's complete selection. */\n skills: string[];\n /** Optional dynamic instructions. Output is truncated to 4096 characters. */\n instructions?: string;\n}\ninterface PluginAgents {\n /**\n * Select this plugin's statically registered tools and manifest skills for\n * each thread/session resolution, with optional dynamic instructions. The\n * callback is synchronous and runs at `thread.start` / `turn.submit`; it\n * never rebuilds registrations. Exactly one callback may be registered per\n * factory execution. A throw, malformed result, duplicate id, unknown id,\n * or more than 256 tool/skill ids fails closed for this plugin only.\n *\n * Tools take effect when the provider session is next started or resumed;\n * an already-running session is not hot-mutated. Instructions are resolved\n * for the next turn. Skill changes follow BB's environment runtime policy:\n * a busy runtime keeps its current catalog until a safe relaunch. Side 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(tool: PluginAgentToolRegistrationBase & {\n parameters: Schema;\n execute(params: z.output, ctx: PluginAgentToolContext): PluginAgentToolResult | Promise;\n }): void;\n registerTool(tool: PluginAgentToolRegistrationBase & {\n /** Raw JSON-schema escape hatch; params arrive unvalidated. */\n parameters: Record;\n execute(params: unknown, ctx: PluginAgentToolContext): PluginAgentToolResult | Promise;\n }): void;\n /**\n * Contribute a dynamic section appended to thread instructions. The\n * provider runs when a thread's runtime command config is resolved\n * (thread.start / turn.submit); return null to contribute nothing for\n * that resolution. Must be synchronous and fast — it sits on the\n * thread-start path. Output longer than 4096 characters is truncated; a\n * throwing provider is logged against the plugin and contributes nothing.\n * A repeated registration within one factory execution is rejected.\n */\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 \":\"). */\n id: string;\n /** Section label shown above this provider's rows in the mention menu. */\n label: string;\n /**\n * Composer trigger characters this provider should answer. Omit to use the\n * default `@` mention trigger. Valid triggers are `@`, `#`, `$`, `!`, and `~`.\n */\n triggers?: readonly PluginMentionTrigger[];\n /**\n * Runs server-side as the user types after one of this provider's triggers\n * in the composer. Each call is time-boxed (2s) and failure-isolated: a slow\n * or throwing provider contributes an empty list — it can never break the\n * mention menu.\n */\n search(ctx: PluginMentionSearchContext): PluginMentionItem[] | Promise;\n /**\n * Resolves one picked item into agent context, called once per unique\n * item at message send time. The returned `context` is attached to the\n * message as an agent-visible (user-hidden) prompt input. Throwing blocks\n * the send with a visible error.\n */\n resolve(itemId: string): {\n context: string;\n } | Promise<{\n context: string;\n }>;\n}\ninterface PluginUi {\n /** Block until the app submits or cancels a plugin-owned composer form. */\n requestInput(request: PluginInteractionRequest, options?: {\n signal?: AbortSignal;\n }): Promise;\n /**\n * Register a mention provider for the shipped app's composer (design §4.9).\n * Providers default to the `@` trigger and may opt into `#`, `$`, `!`, or\n * `~` with `triggers`. Items group under `label` in the mention menu; a\n * picked item becomes a `{ kind: \"plugin\" }` mention resource whose context\n * is resolved once at send time. Multiple providers per plugin; ids must be\n * unique within the plugin.\n */\n registerMentionProvider(provider: PluginMentionProviderRegistration): void;\n}\ninterface PluginEvents {\n /**\n * Add a thread lifecycle listener. Multiple listeners for the same event are\n * additive and run independently in registration order.\n */\n on(event: E, handler: PluginThreadEventHandler): void;\n}\ninterface PluginServerApi {\n /**\n * This BB server's own loopback base URL (e.g. \"http://127.0.0.1:38886\"),\n * which serves the SPA + /api + /ws. For plugins that proxy or relay\n * traffic back to the server itself (e.g. a tunnel). Bind-gated like\n * `bb.sdk`: reading it before the server is listening throws, so prefer\n * reading it from handlers, services, and timers.\n */\n readonly loopbackBaseUrl: string;\n}\ninterface PluginSharedPortTunnelIdentity {\n /** Gate routing label assigned to this machine. */\n label: string;\n /** Gate apex without a scheme, e.g. \"getbb.app\". */\n baseDomain: string;\n}\ninterface PluginHosts {\n /**\n * Ensure this enrolled host has a gate label and return its read-only public\n * identity. The daemon chooses the trusted gate and desired label; plugins\n * cannot influence either credential-bearing destination.\n */\n ensureSharedPortTunnel(hostId: string): Promise;\n /**\n * Replace this plugin's desired shared-loopback ports for one host. The\n * server aggregates declarations, owns generations, and delivers the\n * resulting set to that host's daemon. Tunnel identity is deliberately not\n * accepted here: it is owned by the daemon's trusted enrollment.\n */\n declareSharedPorts(hostId: string, ports: readonly number[]): void;\n}\ninterface PluginStatusApi {\n /**\n * Mark this plugin `needs-configuration` (with a message shown in\n * `bb plugin list` and the UI) instead of failing — e.g. a factory or\n * service that finds no API key configured. Cleared on the next load;\n * saving settings does not auto-reload in V1, so ask the user to\n * `bb plugin reload ` after configuring.\n */\n needsConfiguration(message: string): void;\n}\n/**\n * The API object handed to a plugin's factory (design §4). Implemented by\n * the BB server; this contract is what plugin `server.ts` files compile\n * against.\n */\ninterface BbPluginApi {\n /** The plugin's own id (namespaces storage, routes, commands). */\n readonly pluginId: string;\n /** Leveled, plugin-scoped logger. */\n readonly log: PluginLogger;\n /** Declarative settings (design §4.2). */\n readonly settings: PluginSettings;\n /** Namespaced KV + per-plugin database (design §4.3). */\n readonly storage: PluginStorage;\n /** HTTP routes under /api/v1/plugins//http/* (design §4.6). */\n readonly http: PluginHttp;\n /** RPC methods under /api/v1/plugins//rpc/ (design §4.6). */\n readonly rpc: PluginRpc;\n /** Ephemeral push to connected frontends (design §4.7). */\n readonly realtime: PluginRealtime;\n /** Long-lived services + cron schedules (design §4.8). */\n readonly background: PluginBackground;\n /** Agent-facing `bb` CLI subcommand (design §4.4). */\n readonly cli: PluginCli;\n /** Per-turn agent context contributions (design §4.4). */\n readonly agents: PluginAgents;\n /** Host-rendered UI contributions (design §4.9). */\n readonly ui: PluginUi;\n /** Additive plugin lifecycle listeners (design §4.5). */\n readonly events: PluginEvents;\n /** Plugin-reported status (needs-configuration). */\n readonly status: PluginStatusApi;\n /** Read-only facts about the running server (loopback base URL). */\n readonly server: PluginServerApi;\n /** Server-to-daemon host control-plane declarations. */\n readonly hosts: PluginHosts;\n /**\n * The full BB SDK, bound to this server over loopback (design §4.1).\n * Bind-gated: reading this before the host binds the SDK throws. The real\n * server binds it before loading plugins, so it is available from the\n * moment factories run there — but isolated harnesses may not, so prefer\n * using it from handlers, services, and timers for portability.\n * `threads.spawn` defaults `origin` to \"plugin\" and `originPluginId` to\n * this plugin's id so spawned threads are attributed automatically.\n */\n readonly sdk: BbSdk;\n /**\n * Register cleanup to run on reload/disable/shutdown. Hooks run LIFO.\n * The sanctioned place to clear timers and close connections.\n */\n onDispose(hook: () => void | Promise): void;\n}\n\nexport { PLUGIN_CLI_OUTPUT_MAX_BYTES, defineRpcContract };\nexport type { BbContext, BbNavigate, BbPluginApi, ComposerCustomization, ComposerPlusMenuItem, ComposerRichTextSpec, ComposerStructuredDraft, ComposerView, JsonValue, 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;\n}, z$1.core.$strict>;\ntype AppSettings = z$1.infer;\n\ndeclare const appKeybindingOverridesSchema: z$1.ZodArray;\n shortcut: z$1.ZodNullable>;\n}, z$1.core.$strict>>;\ntype AppKeybindingOverrides = z$1.infer;\n\ndeclare const appThemeSchema: z$1.ZodObject<{\n themeId: z$1.ZodString;\n customCss: z$1.ZodNullable;\n faviconColor: z$1.ZodEnum<{\n default: \"default\";\n red: \"red\";\n orange: \"orange\";\n yellow: \"yellow\";\n green: \"green\";\n teal: \"teal\";\n blue: \"blue\";\n purple: \"purple\";\n pink: \"pink\";\n }>;\n}, z$1.core.$strip>;\ntype AppTheme = z$1.infer;\n/**\n * The complete appearance selection a client sends when changing the palette\n * and/or favicon tint. The server validates `themeId` (built-in id or an\n * existing custom theme) and resolves the CSS from disk for custom themes.\n * Callers changing only one facet must carry the other facet forward explicitly.\n */\ndeclare const appThemeSelectionSchema: z$1.ZodObject<{\n themeId: z$1.ZodString;\n faviconColor: z$1.ZodEnum<{\n default: \"default\";\n red: \"red\";\n orange: \"orange\";\n yellow: \"yellow\";\n green: \"green\";\n teal: \"teal\";\n blue: \"blue\";\n purple: \"purple\";\n pink: \"pink\";\n }>;\n}, z$1.core.$strip>;\ntype AppThemeSelection = z$1.infer;\n\ndeclare const changedMessageSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"changed\">;\n entity: z$1.ZodLiteral<\"thread\">;\n id: z$1.ZodOptional;\n metadata: z$1.ZodOptional;\n eventTypes: z$1.ZodOptional>>>>;\n hasPendingInteraction: z$1.ZodOptional;\n projectId: z$1.ZodOptional;\n }, z$1.core.$strict>>;\n changes: z$1.ZodReadonly>>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"changed\">;\n entity: z$1.ZodLiteral<\"project\">;\n id: z$1.ZodOptional;\n changes: z$1.ZodReadonly>>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"changed\">;\n entity: z$1.ZodLiteral<\"environment\">;\n id: z$1.ZodOptional;\n changes: z$1.ZodReadonly>>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"changed\">;\n entity: z$1.ZodLiteral<\"host\">;\n id: z$1.ZodOptional;\n changes: z$1.ZodReadonly>>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"changed\">;\n entity: z$1.ZodLiteral<\"system\">;\n changes: z$1.ZodReadonly>>;\n}, z$1.core.$strict>], \"entity\">;\ntype ChangedMessage = z$1.infer;\n\ndeclare const environmentSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n name: z$1.ZodNullable;\n projectId: z$1.ZodString;\n hostId: z$1.ZodString;\n path: z$1.ZodNullable;\n managed: z$1.ZodBoolean;\n isGitRepo: z$1.ZodBoolean;\n isWorktree: z$1.ZodBoolean;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n branchName: z$1.ZodNullable;\n baseBranch: z$1.ZodNullable;\n defaultBranch: z$1.ZodNullable;\n mergeBaseBranch: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n error: \"error\";\n provisioning: \"provisioning\";\n ready: \"ready\";\n retiring: \"retiring\";\n destroying: \"destroying\";\n destroyed: \"destroyed\";\n }>;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype Environment = z$1.infer;\n\n/**\n * User-opt-in experiments (the Settings → Experiments toggles). Distinct from\n * `FeatureFlags`: flags are operator-set via env at server start, experiments\n * are user-toggled at runtime and persisted server-side so server-owned\n * policy (e.g. skill injection) can honor them.\n *\n * Every experiment defaults to off — opting in is the point.\n */\ndeclare const experimentsSchema: z$1.ZodObject<{\n claudeCodeMockCliTraffic: z$1.ZodBoolean;\n toolsHub: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype Experiments = z$1.infer;\n\ndeclare const hostSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n name: z$1.ZodString;\n type: z$1.ZodEnum<{\n persistent: \"persistent\";\n }>;\n status: z$1.ZodEnum<{\n connected: \"connected\";\n disconnected: \"disconnected\";\n }>;\n maxPermissionMode: z$1.ZodEnum<{\n full: \"full\";\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n }>;\n lastSeenAt: z$1.ZodNullable;\n lastRejectedProtocolVersion: z$1.ZodNullable;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype Host = z$1.infer;\n\ninterface JsonObject {\n [key: string]: JsonValue$1;\n}\ntype JsonValue$1 = string | number | boolean | null | JsonValue$1[] | JsonObject;\n\ndeclare const pendingInteractionResolutionSchema: z$1.ZodUnion;\n grantedPermissions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"allow_for_session\">;\n grantedPermissions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"deny\">;\n}, z$1.core.$strip>], \"decision\">, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"user_answer\">;\n answers: z$1.ZodRecord;\n freeText: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin_submitted\">;\n}, z$1.core.$strip>]>;\ntype PendingInteractionResolution = z$1.infer;\ndeclare const providerPendingInteractionSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n status: z$1.ZodEnum<{\n interrupted: \"interrupted\";\n pending: \"pending\";\n resolving: \"resolving\";\n resolved: \"resolved\";\n }>;\n statusReason: z$1.ZodNullable;\n createdAt: z$1.ZodNumber;\n expiresAt: z$1.ZodOptional>;\n resolvedAt: z$1.ZodNullable;\n turnId: z$1.ZodString;\n providerId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n providerRequestId: z$1.ZodString;\n origin: z$1.ZodOptional;\n providerId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n providerRequestId: z$1.ZodString;\n }, z$1.core.$strip>>;\n payload: z$1.ZodUnion;\n subject: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n itemId: z$1.ZodString;\n command: z$1.ZodString;\n cwd: z$1.ZodNullable;\n actions: z$1.ZodArray;\n command: z$1.ZodString;\n name: z$1.ZodString;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"listFiles\">;\n command: z$1.ZodString;\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"search\">;\n command: z$1.ZodString;\n query: z$1.ZodNullable;\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"unknown\">;\n command: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">>;\n sessionGrant: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"file_change\">;\n itemId: z$1.ZodString;\n writeScope: z$1.ZodNullable;\n sessionGrant: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"permission_grant\">;\n itemId: z$1.ZodString;\n toolName: z$1.ZodNullable;\n permissions: z$1.ZodObject<{\n network: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>;\n }, z$1.core.$strip>], \"kind\">;\n reason: z$1.ZodNullable;\n availableDecisions: z$1.ZodArray>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"user_question\">;\n questions: z$1.ZodArray;\n multiSelect: z$1.ZodBoolean;\n options: z$1.ZodOptional;\n }, z$1.core.$strip>>>;\n allowFreeText: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>]>;\n resolution: z$1.ZodNullable;\n grantedPermissions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"allow_for_session\">;\n grantedPermissions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"deny\">;\n }, z$1.core.$strip>], \"decision\">, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"user_answer\">;\n answers: z$1.ZodRecord;\n freeText: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>]>>;\n}, z$1.core.$strip>;\ntype ProviderPendingInteraction = z$1.infer;\ndeclare const pluginPendingInteractionSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n status: z$1.ZodEnum<{\n interrupted: \"interrupted\";\n pending: \"pending\";\n resolving: \"resolving\";\n resolved: \"resolved\";\n }>;\n statusReason: z$1.ZodNullable;\n createdAt: z$1.ZodNumber;\n expiresAt: z$1.ZodOptional>;\n resolvedAt: z$1.ZodNullable;\n turnId: z$1.ZodNullable;\n origin: z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n rendererId: z$1.ZodString;\n }, z$1.core.$strip>;\n payload: z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n title: z$1.ZodString;\n data: z$1.ZodType>;\n }, z$1.core.$strip>;\n resolution: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype PluginPendingInteraction = z$1.infer;\ntype PendingInteraction = ProviderPendingInteraction | PluginPendingInteraction;\n\ndeclare const projectSourceSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n projectId: z$1.ZodString;\n isDefault: z$1.ZodBoolean;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n type: z$1.ZodLiteral<\"local_path\">;\n hostId: z$1.ZodString;\n path: z$1.ZodString;\n}, z$1.core.$strip>;\ntype ProjectSource = z$1.infer;\n\ndeclare const 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;\ndeclare const serviceTierSchema: z$1.ZodEnum<{\n default: \"default\";\n fast: \"fast\";\n}>;\ntype ServiceTier = z$1.infer;\ndeclare const permissionModeSchema: z$1.ZodEnum<{\n full: \"full\";\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n}>;\ntype PermissionMode = z$1.infer;\ndeclare const promptInputSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n}, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n}, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n}, z$1.core.$strip>], \"type\">;\ntype PromptInput = z$1.infer;\ndeclare const resolvedThreadExecutionOptionsSchema: z$1.ZodObject<{\n seq: z$1.ZodOptional;\n model: z$1.ZodString;\n serviceTier: z$1.ZodEnum<{\n default: \"default\";\n fast: \"fast\";\n }>;\n reasoningLevel: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n permissionMode: z$1.ZodEnum<{\n full: \"full\";\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n }>;\n source: z$1.ZodEnum<{\n \"client/thread/start\": \"client/thread/start\";\n \"client/turn/requested\": \"client/turn/requested\";\n \"client/turn/start\": \"client/turn/start\";\n }>;\n}, z$1.core.$strip>;\ntype ResolvedThreadExecutionOptions = z$1.infer;\ndeclare const projectExecutionDefaultsSchema: z$1.ZodObject<{\n providerId: z$1.ZodString;\n model: z$1.ZodString;\n serviceTier: z$1.ZodEnum<{\n default: \"default\";\n fast: \"fast\";\n }>;\n reasoningLevel: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n permissionMode: z$1.ZodEnum<{\n full: \"full\";\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n }>;\n}, z$1.core.$strip>;\ntype ProjectExecutionDefaults = z$1.infer;\n\n/** All thread events — provider-originated or system-originated. */\ndeclare const threadEventSchema: z$1.ZodPipe;\n threadId: z$1.ZodString;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"thread/identity\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"turn/started\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"turn/completed\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n }>;\n error: z$1.ZodOptional>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"turn/input/accepted\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n clientRequestId: z$1.ZodString;\n scope: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"turn\">;\n turnId: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">;\n}, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"thread/name/updated\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n threadName: z$1.ZodString;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"thread/compacted\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"thread/goal/updated\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n objective: z$1.ZodString;\n status: z$1.ZodEnum<{\n active: \"active\";\n paused: \"paused\";\n budgetLimited: \"budgetLimited\";\n complete: \"complete\";\n }>;\n tokenBudget: z$1.ZodNullable;\n tokensUsed: z$1.ZodNumber;\n timeUsedSeconds: z$1.ZodNumber;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"thread/goal/cleared\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/started\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n item: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"userMessage\">;\n id: z$1.ZodString;\n content: z$1.ZodArray;\n text: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">>;\n clientRequestId: z$1.ZodOptional;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"agentMessage\">;\n id: z$1.ZodString;\n text: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"commandExecution\">;\n id: z$1.ZodString;\n command: z$1.ZodString;\n cwd: z$1.ZodString;\n status: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\n }>;\n approvalStatus: z$1.ZodNullable>;\n aggregatedOutput: z$1.ZodOptional;\n exitCode: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n truncation: z$1.ZodOptional>;\n result: z$1.ZodOptional>;\n resultText: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"fileChange\">;\n id: z$1.ZodString;\n changes: z$1.ZodArray;\n movePath: z$1.ZodOptional;\n diff: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n status: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\n }>;\n approvalStatus: z$1.ZodNullable>;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"webSearch\">;\n id: z$1.ZodString;\n queries: z$1.ZodArray;\n resultText: z$1.ZodNullable;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"webFetch\">;\n id: z$1.ZodString;\n url: z$1.ZodString;\n prompt: z$1.ZodNullable;\n pattern: z$1.ZodNullable;\n resultText: z$1.ZodNullable;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"imageView\">;\n id: z$1.ZodString;\n path: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"toolCall\">;\n id: z$1.ZodString;\n server: z$1.ZodOptional;\n tool: z$1.ZodString;\n arguments: z$1.ZodOptional>;\n statusLabels: z$1.ZodOptional>;\n status: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\n }>;\n result: z$1.ZodOptional;\n error: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n truncation: z$1.ZodOptional>;\n result: z$1.ZodOptional>;\n resultText: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"reasoning\">;\n id: z$1.ZodString;\n summary: z$1.ZodArray;\n content: z$1.ZodArray;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"plan\">;\n id: z$1.ZodString;\n text: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"contextCompaction\">;\n id: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"backgroundTask\">;\n id: z$1.ZodString;\n taskType: z$1.ZodString;\n description: z$1.ZodString;\n status: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\n }>;\n taskStatus: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n paused: \"paused\";\n pending: \"pending\";\n running: \"running\";\n killed: \"killed\";\n stopped: \"stopped\";\n }>;\n skipTranscript: z$1.ZodBoolean;\n workflowName: z$1.ZodOptional;\n workflow: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray;\n model: z$1.ZodString;\n attempt: z$1.ZodNumber;\n cached: z$1.ZodBoolean;\n lastProgressAt: z$1.ZodNumber;\n phaseIndex: z$1.ZodOptional;\n phaseTitle: z$1.ZodOptional;\n agentType: z$1.ZodOptional;\n isolation: z$1.ZodOptional;\n queuedAt: z$1.ZodOptional;\n startedAt: z$1.ZodOptional;\n lastToolName: z$1.ZodOptional;\n lastToolSummary: z$1.ZodOptional;\n promptPreview: z$1.ZodOptional;\n resultPreview: z$1.ZodOptional;\n error: z$1.ZodOptional;\n tokens: z$1.ZodOptional;\n toolCalls: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodOptional>;\n summary: z$1.ZodOptional;\n error: z$1.ZodOptional;\n outputFile: z$1.ZodOptional;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/completed\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n item: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"userMessage\">;\n id: z$1.ZodString;\n content: z$1.ZodArray;\n text: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">>;\n clientRequestId: z$1.ZodOptional;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"agentMessage\">;\n id: z$1.ZodString;\n text: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"commandExecution\">;\n id: z$1.ZodString;\n command: z$1.ZodString;\n cwd: z$1.ZodString;\n status: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\n }>;\n approvalStatus: z$1.ZodNullable>;\n aggregatedOutput: z$1.ZodOptional;\n exitCode: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n truncation: z$1.ZodOptional>;\n result: z$1.ZodOptional>;\n resultText: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"fileChange\">;\n id: z$1.ZodString;\n changes: z$1.ZodArray;\n movePath: z$1.ZodOptional;\n diff: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n status: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\n }>;\n approvalStatus: z$1.ZodNullable>;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"webSearch\">;\n id: z$1.ZodString;\n queries: z$1.ZodArray;\n resultText: z$1.ZodNullable;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"webFetch\">;\n id: z$1.ZodString;\n url: z$1.ZodString;\n prompt: z$1.ZodNullable;\n pattern: z$1.ZodNullable;\n resultText: z$1.ZodNullable;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"imageView\">;\n id: z$1.ZodString;\n path: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"toolCall\">;\n id: z$1.ZodString;\n server: z$1.ZodOptional;\n tool: z$1.ZodString;\n arguments: z$1.ZodOptional>;\n statusLabels: z$1.ZodOptional>;\n status: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\n }>;\n result: z$1.ZodOptional;\n error: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n truncation: z$1.ZodOptional>;\n result: z$1.ZodOptional>;\n resultText: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"reasoning\">;\n id: z$1.ZodString;\n summary: z$1.ZodArray;\n content: z$1.ZodArray;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"plan\">;\n id: z$1.ZodString;\n text: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"contextCompaction\">;\n id: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"backgroundTask\">;\n id: z$1.ZodString;\n taskType: z$1.ZodString;\n description: z$1.ZodString;\n status: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\n }>;\n taskStatus: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n paused: \"paused\";\n pending: \"pending\";\n running: \"running\";\n killed: \"killed\";\n stopped: \"stopped\";\n }>;\n skipTranscript: z$1.ZodBoolean;\n workflowName: z$1.ZodOptional;\n workflow: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray;\n model: z$1.ZodString;\n attempt: z$1.ZodNumber;\n cached: z$1.ZodBoolean;\n lastProgressAt: z$1.ZodNumber;\n phaseIndex: z$1.ZodOptional;\n phaseTitle: z$1.ZodOptional;\n agentType: z$1.ZodOptional;\n isolation: z$1.ZodOptional;\n queuedAt: z$1.ZodOptional;\n startedAt: z$1.ZodOptional;\n lastToolName: z$1.ZodOptional;\n lastToolSummary: z$1.ZodOptional;\n promptPreview: z$1.ZodOptional;\n resultPreview: z$1.ZodOptional;\n error: z$1.ZodOptional;\n tokens: z$1.ZodOptional;\n toolCalls: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodOptional>;\n summary: z$1.ZodOptional;\n error: z$1.ZodOptional;\n outputFile: z$1.ZodOptional;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/agentMessage/delta\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n itemId: z$1.ZodString;\n delta: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/commandExecution/outputDelta\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n itemId: z$1.ZodString;\n delta: z$1.ZodString;\n reset: z$1.ZodOptional;\n parentToolCallId: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/fileChange/outputDelta\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n itemId: z$1.ZodString;\n delta: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/reasoning/summaryTextDelta\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n itemId: z$1.ZodString;\n delta: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/reasoning/textDelta\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n itemId: z$1.ZodString;\n delta: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/plan/delta\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n itemId: z$1.ZodString;\n delta: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/mcpToolCall/progress\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n itemId: z$1.ZodString;\n message: z$1.ZodOptional;\n parentToolCallId: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/toolCall/progress\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n itemId: z$1.ZodString;\n message: z$1.ZodOptional;\n parentToolCallId: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/backgroundTask/progress\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n item: z$1.ZodObject<{\n type: z$1.ZodLiteral<\"backgroundTask\">;\n id: z$1.ZodString;\n taskType: z$1.ZodString;\n description: z$1.ZodString;\n status: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\n }>;\n taskStatus: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n paused: \"paused\";\n pending: \"pending\";\n running: \"running\";\n killed: \"killed\";\n stopped: \"stopped\";\n }>;\n skipTranscript: z$1.ZodBoolean;\n workflowName: z$1.ZodOptional;\n workflow: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray;\n model: z$1.ZodString;\n attempt: z$1.ZodNumber;\n cached: z$1.ZodBoolean;\n lastProgressAt: z$1.ZodNumber;\n phaseIndex: z$1.ZodOptional;\n phaseTitle: z$1.ZodOptional;\n agentType: z$1.ZodOptional;\n isolation: z$1.ZodOptional;\n queuedAt: z$1.ZodOptional;\n startedAt: z$1.ZodOptional;\n lastToolName: z$1.ZodOptional;\n lastToolSummary: z$1.ZodOptional;\n promptPreview: z$1.ZodOptional;\n resultPreview: z$1.ZodOptional;\n error: z$1.ZodOptional;\n tokens: z$1.ZodOptional;\n toolCalls: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodOptional>;\n summary: z$1.ZodOptional;\n error: z$1.ZodOptional;\n outputFile: z$1.ZodOptional;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/backgroundTask/completed\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n item: z$1.ZodObject<{\n type: z$1.ZodLiteral<\"backgroundTask\">;\n id: z$1.ZodString;\n taskType: z$1.ZodString;\n description: z$1.ZodString;\n status: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\n }>;\n taskStatus: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n paused: \"paused\";\n pending: \"pending\";\n running: \"running\";\n killed: \"killed\";\n stopped: \"stopped\";\n }>;\n skipTranscript: z$1.ZodBoolean;\n workflowName: z$1.ZodOptional;\n workflow: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray;\n model: z$1.ZodString;\n attempt: z$1.ZodNumber;\n cached: z$1.ZodBoolean;\n lastProgressAt: z$1.ZodNumber;\n phaseIndex: z$1.ZodOptional;\n phaseTitle: z$1.ZodOptional;\n agentType: z$1.ZodOptional;\n isolation: z$1.ZodOptional;\n queuedAt: z$1.ZodOptional;\n startedAt: z$1.ZodOptional;\n lastToolName: z$1.ZodOptional;\n lastToolSummary: z$1.ZodOptional;\n promptPreview: z$1.ZodOptional;\n resultPreview: z$1.ZodOptional;\n error: z$1.ZodOptional;\n tokens: z$1.ZodOptional;\n toolCalls: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodOptional>;\n summary: z$1.ZodOptional;\n error: z$1.ZodOptional;\n outputFile: z$1.ZodOptional;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"thread/tokenUsage/updated\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n tokenUsage: z$1.ZodObject<{\n total: z$1.ZodObject<{\n totalTokens: z$1.ZodNumber;\n inputTokens: z$1.ZodNumber;\n cachedInputTokens: z$1.ZodNumber;\n outputTokens: z$1.ZodNumber;\n reasoningOutputTokens: z$1.ZodNumber;\n }, z$1.core.$strip>;\n last: z$1.ZodObject<{\n totalTokens: z$1.ZodNumber;\n inputTokens: z$1.ZodNumber;\n cachedInputTokens: z$1.ZodNumber;\n outputTokens: z$1.ZodNumber;\n reasoningOutputTokens: z$1.ZodNumber;\n }, z$1.core.$strip>;\n modelContextWindow: z$1.ZodNullable;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"thread/contextWindowUsage/updated\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n contextWindowUsage: z$1.ZodObject<{\n usedTokens: z$1.ZodNullable;\n modelContextWindow: z$1.ZodNullable;\n estimated: z$1.ZodBoolean;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"turn/plan/updated\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n plan: z$1.ZodArray>;\n }, z$1.core.$strip>>;\n explanation: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"turn/diff/updated\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n diff: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"provider/error\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n message: z$1.ZodString;\n detail: z$1.ZodOptional;\n willRetry: z$1.ZodOptional;\n errorInfo: z$1.ZodOptional;\n providerCode: z$1.ZodNullable;\n httpStatusCode: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"provider/rateLimits/updated\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n rateLimits: z$1.ZodObject<{\n providerId: z$1.ZodString;\n status: z$1.ZodEnum<{\n unknown: \"unknown\";\n allowed: \"allowed\";\n warning: \"warning\";\n blocked: \"blocked\";\n }>;\n kind: z$1.ZodEnum<{\n unknown: \"unknown\";\n \"request-throttle\": \"request-throttle\";\n \"subscription-window\": \"subscription-window\";\n credits: \"credits\";\n \"spend-control\": \"spend-control\";\n }>;\n windows: z$1.ZodArray;\n label: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n unknown: \"unknown\";\n allowed: \"allowed\";\n warning: \"warning\";\n blocked: \"blocked\";\n }>;\n usedPercent: z$1.ZodNullable;\n resetsAtMs: z$1.ZodNullable;\n modelIds: z$1.ZodArray;\n }, z$1.core.$strip>>;\n reachedReason: z$1.ZodNullable;\n overageStatus: z$1.ZodNullable>;\n overageReason: z$1.ZodNullable;\n observedAtMs: z$1.ZodNumber;\n source: z$1.ZodEnum<{\n \"codex-account\": \"codex-account\";\n \"claude-rate-limit\": \"claude-rate-limit\";\n http: \"http\";\n }>;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"provider/warning\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n category: z$1.ZodEnum<{\n deprecation: \"deprecation\";\n config: \"config\";\n general: \"general\";\n }>;\n summary: z$1.ZodOptional;\n details: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"provider/modelFallback\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n originalModel: z$1.ZodString;\n fallbackModel: z$1.ZodString;\n reason: z$1.ZodEnum<{\n refusal: \"refusal\";\n provider: \"provider\";\n }>;\n message: z$1.ZodString;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"provider/unhandled\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n providerId: z$1.ZodString;\n rawType: z$1.ZodString;\n rawEvent: z$1.ZodObject<{\n jsonrpc: z$1.ZodLiteral<\"2.0\">;\n id: z$1.ZodOptional>;\n method: z$1.ZodString;\n params: z$1.ZodOptional>>;\n }, z$1.core.$strip>;\n parentToolCallId: z$1.ZodOptional;\n}, z$1.core.$strip>], \"type\">, z$1.ZodObject<{\n scope: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"turn\">;\n turnId: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">;\n}, z$1.core.$strip>>, z$1.ZodIntersection;\n threadId: z$1.ZodString;\n direction: z$1.ZodLiteral<\"outbound\">;\n source: z$1.ZodEnum<{\n spawn: \"spawn\";\n tell: \"tell\";\n }>;\n initiator: z$1.ZodEnum<{\n system: \"system\";\n user: \"user\";\n agent: \"agent\";\n }>;\n request: z$1.ZodObject<{\n method: z$1.ZodEnum<{\n \"thread/start\": \"thread/start\";\n \"turn/start\": \"turn/start\";\n }>;\n params: z$1.ZodRecord;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"client/turn/requested\">;\n threadId: z$1.ZodString;\n direction: z$1.ZodLiteral<\"outbound\">;\n requestId: z$1.ZodString;\n continuationOfRequestId: z$1.ZodOptional;\n source: z$1.ZodEnum<{\n spawn: \"spawn\";\n tell: \"tell\";\n }>;\n initiator: z$1.ZodEnum<{\n system: \"system\";\n user: \"user\";\n agent: \"agent\";\n }>;\n senderThreadId: z$1.ZodNullable;\n systemMessageKind: z$1.ZodOptional>;\n systemMessageSubject: z$1.ZodOptional;\n threadId: z$1.ZodString;\n threadName: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread-batch\">;\n count: z$1.ZodNumber;\n }, z$1.core.$strip>], \"kind\">>>;\n input: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n inputGroups: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>>>;\n target: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread-start\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"new-turn\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"auto\">;\n expectedTurnId: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"steer\">;\n expectedTurnId: z$1.ZodNullable;\n }, z$1.core.$strip>], \"kind\">;\n request: z$1.ZodObject<{\n method: z$1.ZodEnum<{\n \"thread/start\": \"thread/start\";\n \"turn/start\": \"turn/start\";\n }>;\n params: z$1.ZodRecord;\n }, z$1.core.$strip>;\n execution: z$1.ZodObject<{\n seq: z$1.ZodOptional;\n model: z$1.ZodString;\n serviceTier: z$1.ZodEnum<{\n default: \"default\";\n fast: \"fast\";\n }>;\n reasoningLevel: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n source: z$1.ZodEnum<{\n \"client/thread/start\": \"client/thread/start\";\n \"client/turn/requested\": \"client/turn/requested\";\n \"client/turn/start\": \"client/turn/start\";\n }>;\n permissionMode: z$1.ZodEnum<{\n readonly: \"readonly\";\n full: \"full\";\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n \"workspace-write\": \"workspace-write\";\n }>;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"client/turn/start\">;\n threadId: z$1.ZodString;\n direction: z$1.ZodLiteral<\"outbound\">;\n source: z$1.ZodEnum<{\n spawn: \"spawn\";\n tell: \"tell\";\n }>;\n initiator: z$1.ZodEnum<{\n system: \"system\";\n user: \"user\";\n agent: \"agent\";\n }>;\n request: z$1.ZodObject<{\n method: z$1.ZodEnum<{\n \"thread/start\": \"thread/start\";\n \"turn/start\": \"turn/start\";\n }>;\n params: z$1.ZodRecord;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"system/error\">;\n threadId: z$1.ZodString;\n code: z$1.ZodOptional;\n message: z$1.ZodString;\n detail: z$1.ZodOptional;\n reconnectAttempt: z$1.ZodOptional;\n reconnectTotal: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"system/manager/user_message\">;\n threadId: z$1.ZodString;\n text: z$1.ZodString;\n toolCallId: z$1.ZodOptional;\n turnId: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"system/thread/interrupted\">;\n threadId: z$1.ZodString;\n reason: z$1.ZodEnum<{\n \"manual-stop\": \"manual-stop\";\n \"host-daemon-restarted\": \"host-daemon-restarted\";\n \"provider-turn-idle\": \"provider-turn-idle\";\n }>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"system/operation\">;\n threadId: z$1.ZodString;\n operation: z$1.ZodString;\n status: z$1.ZodString;\n message: z$1.ZodString;\n operationId: z$1.ZodString;\n metadata: z$1.ZodOptional>>>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"system/permissionGrant/lifecycle\">;\n threadId: z$1.ZodString;\n interactionId: z$1.ZodString;\n providerId: z$1.ZodString;\n providerRequestId: z$1.ZodString;\n status: z$1.ZodEnum<{\n interrupted: \"interrupted\";\n pending: \"pending\";\n resolving: \"resolving\";\n resolved: \"resolved\";\n }>;\n resolution: z$1.ZodDefault;\n grantedPermissions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"allow_for_session\">;\n grantedPermissions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"deny\">;\n }, z$1.core.$strip>], \"decision\">>>;\n statusReason: z$1.ZodDefault>;\n subject: z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"permission_grant\">;\n itemId: z$1.ZodString;\n toolName: z$1.ZodNullable;\n permissions: z$1.ZodObject<{\n network: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"system/userQuestion/lifecycle\">;\n threadId: z$1.ZodString;\n interactionId: z$1.ZodString;\n providerId: z$1.ZodString;\n providerRequestId: z$1.ZodString;\n status: z$1.ZodEnum<{\n interrupted: \"interrupted\";\n pending: \"pending\";\n resolving: \"resolving\";\n resolved: \"resolved\";\n }>;\n resolution: z$1.ZodDefault;\n answers: z$1.ZodRecord;\n freeText: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>>;\n statusReason: z$1.ZodDefault>;\n payload: z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"user_question\">;\n questions: z$1.ZodArray;\n multiSelect: z$1.ZodBoolean;\n options: z$1.ZodOptional;\n }, z$1.core.$strip>>>;\n allowFreeText: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"system/thread-provisioning\">;\n threadId: z$1.ZodString;\n provisioningId: z$1.ZodString;\n status: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n active: \"active\";\n cancelled: \"cancelled\";\n }>;\n environmentId: z$1.ZodString;\n entries: z$1.ZodArray;\n key: z$1.ZodString;\n text: z$1.ZodString;\n startedAt: z$1.ZodOptional;\n status: z$1.ZodOptional>;\n metadata: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"system/provider-turn-watchdog\">;\n threadId: z$1.ZodString;\n reason: z$1.ZodLiteral<\"provider-turn-idle\">;\n thresholdMs: z$1.ZodNumber;\n elapsedMs: z$1.ZodNumber;\n activeTurnId: z$1.ZodString;\n activeTurnStartedAt: z$1.ZodNumber;\n lastActivityEventSequence: z$1.ZodNumber;\n lastActivityEventType: z$1.ZodString;\n lastActivityEventAt: z$1.ZodNumber;\n providerId: z$1.ZodString;\n providerThreadId: z$1.ZodNullable;\n firedAt: z$1.ZodNumber;\n}, z$1.core.$strip>]>, z$1.ZodObject<{\n scope: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"turn\">;\n turnId: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">;\n}, z$1.core.$strip>>]>>;\ntype ThreadEvent = z$1.infer;\ntype ThreadEventType = ThreadEvent[\"type\"];\n\ndeclare const providerInfoSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n displayName: z$1.ZodString;\n logoUrl: z$1.ZodNullable;\n capabilities: z$1.ZodObject<{\n supportsArchive: z$1.ZodBoolean;\n supportsRename: z$1.ZodBoolean;\n supportsServiceTier: z$1.ZodBoolean;\n supportsUserQuestion: z$1.ZodBoolean;\n supportsFork: z$1.ZodBoolean;\n supportedPermissionModes: z$1.ZodArray>;\n }, z$1.core.$strip>;\n composerActions: z$1.ZodArray;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plan\">;\n command: z$1.ZodObject<{\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n trailingText: z$1.ZodString;\n }, z$1.core.$strip>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"goal\">;\n command: z$1.ZodObject<{\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n trailingText: z$1.ZodString;\n }, z$1.core.$strip>;\n }, z$1.core.$strip>], \"kind\">>;\n available: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype ProviderInfo = z$1.infer;\n\ndeclare const threadEventScopeSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n}, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"turn\">;\n turnId: z$1.ZodString;\n}, z$1.core.$strip>], \"kind\">;\ntype ThreadEventScope = z$1.infer;\n\ntype ThreadEventByType = {\n [TType in ThreadEventType]: Extract;\n};\ntype ThreadEventForType = ThreadEventByType[TType];\ntype StoredThreadEventDataFromEvent = Omit;\ninterface ThreadEventRowBase {\n id: string;\n scope: ThreadEventScope;\n threadId: string;\n seq: number;\n createdAt: number;\n}\ntype ThreadEventRowFromEvent = ThreadEventRowBase & {\n type: TEvent[\"type\"];\n data: StoredThreadEventDataFromEvent;\n};\ntype ThreadEventRowOfType = ThreadEventRowFromEvent>;\ntype ThreadEventRow = {\n [TType in ThreadEventType]: ThreadEventRowOfType;\n}[ThreadEventType];\n\ndeclare const threadStatusSchema: z$1.ZodEnum<{\n error: \"error\";\n active: \"active\";\n starting: \"starting\";\n idle: \"idle\";\n stopping: \"stopping\";\n}>;\ntype ThreadStatus = z$1.infer;\n\ndeclare const threadTimelinePendingTodosSchema: z$1.ZodObject<{\n sourceSeq: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n items: z$1.ZodArray;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype ThreadTimelinePendingTodos = z$1.infer;\n\ndeclare const threadQueuedMessageSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n content: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n model: z$1.ZodString;\n reasoningLevel: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n permissionMode: z$1.ZodEnum<{\n full: \"full\";\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n }>;\n serviceTier: z$1.ZodEnum<{\n default: \"default\";\n fast: \"fast\";\n }>;\n groupWithNext: z$1.ZodBoolean;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype ThreadQueuedMessage = z$1.infer;\n\ndeclare const 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;\n workspace: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"unmanaged\">;\n path: z$1.ZodNullable;\n branch: z$1.ZodOptional;\n name: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"new\">;\n baseBranch: z$1.ZodString;\n }, z$1.core.$strict>], \"kind\">>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"managed-worktree\">;\n baseBranch: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"named\">;\n name: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"default\">;\n }, z$1.core.$strip>], \"kind\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"personal\">;\n }, z$1.core.$strip>], \"type\">;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"project-default\">;\n}, z$1.core.$strip>], \"type\">;\ntype CreateThreadEnvironmentArgs = z$1.infer;\ndeclare const workspaceFileListResponseSchema: z$1.ZodObject<{\n files: z$1.ZodArray>;\n truncated: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype WorkspaceFileListResponse = z$1.infer;\ndeclare const workspacePathListResponseSchema: z$1.ZodObject<{\n paths: z$1.ZodArray;\n path: z$1.ZodString;\n name: z$1.ZodString;\n score: z$1.ZodNumber;\n positions: z$1.ZodArray;\n }, z$1.core.$strip>>;\n truncated: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype WorkspacePathListResponse = z$1.infer;\n\ndeclare const createProjectSourceRequestSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n hostId: z$1.ZodString;\n type: z$1.ZodLiteral<\"local_path\">;\n path: z$1.ZodPipe>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n hostId: z$1.ZodString;\n type: z$1.ZodLiteral<\"clone\">;\n targetPath: z$1.ZodOptional>>;\n remoteUrl: z$1.ZodOptional;\n}, z$1.core.$strict>], \"type\">;\ntype CreateProjectSourceRequest = z$1.infer;\ndeclare const createProjectRequestSchema: z$1.ZodObject<{\n name: z$1.ZodString;\n source: z$1.ZodObject<{\n hostId: z$1.ZodString;\n type: z$1.ZodLiteral<\"local_path\">;\n path: z$1.ZodPipe>;\n }, z$1.core.$strict>;\n}, z$1.core.$strip>;\ntype CreateProjectRequest = z$1.infer;\ndeclare const threadSectionSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n name: z$1.ZodString;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n}, z$1.core.$strict>;\ntype ThreadSectionResponse = z$1.infer;\ndeclare const createThreadSectionRequestSchema: z$1.ZodObject<{\n name: z$1.ZodString;\n}, z$1.core.$strict>;\ntype CreateThreadSectionRequest = z$1.infer;\ndeclare const updateThreadSectionRequestSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n name: z$1.ZodString;\n}, z$1.core.$strict>;\ntype UpdateThreadSectionRequest = z$1.infer;\ndeclare const deleteThreadSectionRequestSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n}, z$1.core.$strict>;\ntype DeleteThreadSectionRequest = z$1.infer;\ndeclare const threadSectionMutationResponseSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n name: z$1.ZodString;\n updatedThreadCount: z$1.ZodNumber;\n}, z$1.core.$strict>;\ntype ThreadSectionMutationResponse = z$1.infer;\ndeclare const reorderProjectRequestSchema: z$1.ZodObject<{\n previousProjectId: z$1.ZodNullable;\n nextProjectId: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype ReorderProjectRequest = z$1.infer;\ndeclare const projectListQuerySchema: z$1.ZodObject<{\n include: z$1.ZodOptional;\n includePersonal: z$1.ZodOptional>;\n}, z$1.core.$strip>;\ntype ProjectListQuery = z$1.infer;\ndeclare const projectFilesQuerySchema: z$1.ZodObject<{\n query: z$1.ZodOptional>;\n limit: z$1.ZodOptional>;\n hostId: z$1.ZodOptional;\n environmentId: z$1.ZodOptional, z$1.ZodOptional>>;\n}, z$1.core.$strip>;\ntype ProjectFilesQuery = z$1.infer;\ndeclare const projectPathsQuerySchema: z$1.ZodObject<{\n query: z$1.ZodOptional>;\n limit: z$1.ZodOptional>;\n includeFiles: z$1.ZodEnum<{\n true: \"true\";\n false: \"false\";\n }>;\n includeDirectories: z$1.ZodEnum<{\n true: \"true\";\n false: \"false\";\n }>;\n hostId: z$1.ZodOptional;\n environmentId: z$1.ZodOptional, z$1.ZodOptional>>;\n}, z$1.core.$strip>;\ntype ProjectPathsQuery = z$1.infer;\ndeclare const projectFileContentQuerySchema: z$1.ZodObject<{\n path: z$1.ZodString;\n hostId: z$1.ZodOptional;\n environmentId: z$1.ZodOptional, z$1.ZodOptional>>;\n}, z$1.core.$strip>;\ntype ProjectFileContentQuery = z$1.infer;\ndeclare const projectBranchesQuerySchema: z$1.ZodObject<{\n query: z$1.ZodOptional;\n limit: z$1.ZodOptional;\n hostId: z$1.ZodString;\n selectedBranch: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype ProjectBranchesQuery = z$1.infer;\ndeclare const projectBranchesResponseSchema: z$1.ZodObject<{\n branches: z$1.ZodArray;\n branchesTruncated: z$1.ZodBoolean;\n checkout: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"branch\">;\n branchName: z$1.ZodString;\n headSha: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"detached\">;\n headSha: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unborn\">;\n branchName: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unknown\">;\n reason: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">;\n defaultBranch: z$1.ZodNullable;\n defaultBranchRelation: z$1.ZodNullable>;\n hasUncommittedChanges: z$1.ZodBoolean;\n operation: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"none\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"merge\">;\n hasConflicts: z$1.ZodBoolean;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"rebase\">;\n hasConflicts: z$1.ZodBoolean;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"cherry-pick\">;\n hasConflicts: z$1.ZodBoolean;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"revert\">;\n hasConflicts: z$1.ZodBoolean;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unknown\">;\n reason: z$1.ZodString;\n hasConflicts: z$1.ZodBoolean;\n }, z$1.core.$strip>], \"kind\">;\n originDefaultBranch: z$1.ZodNullable;\n remoteBranches: z$1.ZodArray;\n remoteBranchesTruncated: z$1.ZodBoolean;\n selectedBranch: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n defaultWorktreeBaseBranch: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype ProjectBranchesResponse = z$1.infer;\ndeclare const promptHistoryQuerySchema: z$1.ZodObject<{\n limit: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype PromptHistoryQuery = z$1.infer;\ndeclare const promptHistoryResponseSchema: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n}, z$1.core.$strip>>;\ntype PromptHistoryResponse = z$1.infer;\ndeclare const updateProjectRequestSchema: z$1.ZodObject<{\n name: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype UpdateProjectRequest = z$1.infer;\ndeclare const updateProjectSourceRequestSchema: z$1.ZodObject<{\n type: z$1.ZodLiteral<\"local_path\">;\n path: z$1.ZodOptional>>;\n isDefault: z$1.ZodOptional>;\n}, z$1.core.$strict>;\ntype UpdateProjectSourceRequest = z$1.infer;\ndeclare const commandListResponseSchema: z$1.ZodObject<{\n commands: z$1.ZodArray;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n description: z$1.ZodNullable;\n argumentHint: z$1.ZodNullable;\n pluginId: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype CommandListResponse = z$1.infer;\n/** Query for the complete command catalog available to a project and provider. */\ndeclare const projectCommandsQuerySchema: z$1.ZodObject<{\n provider: z$1.ZodString;\n hostId: z$1.ZodOptional;\n environmentId: z$1.ZodOptional, z$1.ZodOptional>>;\n}, z$1.core.$strict>;\ntype ProjectCommandsQuery = z$1.infer;\ndeclare const skillListResponseSchema: z$1.ZodObject<{\n skills: z$1.ZodArray;\n provider: z$1.ZodNullable>;\n scope: z$1.ZodEnum<{\n plugin: \"plugin\";\n \"bb-builtin\": \"bb-builtin\";\n \"bb-user\": \"bb-user\";\n \"bb-project\": \"bb-project\";\n \"claude-user\": \"claude-user\";\n \"claude-project\": \"claude-project\";\n \"codex-user\": \"codex-user\";\n \"codex-project\": \"codex-project\";\n }>;\n pluginId: z$1.ZodNullable;\n filePath: z$1.ZodString;\n manageable: z$1.ZodBoolean;\n registrySkillId: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype SkillListResponse = z$1.infer;\ndeclare const skillContentResponseSchema: z$1.ZodObject<{\n content: z$1.ZodString;\n revision: z$1.ZodString;\n}, z$1.core.$strip>;\ntype SkillContentResponse = z$1.infer;\ndeclare const skillFilesResponseSchema: z$1.ZodObject<{\n files: z$1.ZodArray;\n truncated: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype SkillFilesResponse = z$1.infer;\ndeclare const projectResponseSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodEnum<{\n personal: \"personal\";\n standard: \"standard\";\n }>;\n name: z$1.ZodString;\n gitRemoteUrl: z$1.ZodNullable;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n sources: z$1.ZodArray;\n hostId: z$1.ZodString;\n path: z$1.ZodString;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype ProjectResponse = z$1.infer;\ndeclare const projectWithThreadsResponseSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodEnum<{\n personal: \"personal\";\n standard: \"standard\";\n }>;\n name: z$1.ZodString;\n gitRemoteUrl: z$1.ZodNullable;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n sources: z$1.ZodArray;\n hostId: z$1.ZodString;\n path: z$1.ZodString;\n }, z$1.core.$strip>>;\n threads: z$1.ZodArray;\n providerId: z$1.ZodString;\n title: z$1.ZodNullable;\n titleFallback: z$1.ZodNullable;\n sectionId: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n error: \"error\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n }>;\n parentThreadId: z$1.ZodNullable;\n sourceThreadId: z$1.ZodNullable;\n originKind: z$1.ZodNullable>;\n childOrigin: z$1.ZodNullable>;\n originPluginId: z$1.ZodNullable;\n visibility: z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>;\n archivedAt: z$1.ZodNullable;\n pinnedAt: z$1.ZodNullable;\n deletedAt: z$1.ZodNullable;\n lastReadAt: z$1.ZodNullable;\n latestAttentionAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n runtime: z$1.ZodObject<{\n displayStatus: z$1.ZodEnum<{\n error: \"error\";\n provisioning: \"provisioning\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n \"host-reconnecting\": \"host-reconnecting\";\n \"waiting-for-host\": \"waiting-for-host\";\n }>;\n hostReconnectGraceExpiresAt: z$1.ZodNullable;\n }, z$1.core.$strip>;\n activity: z$1.ZodObject<{\n activeWorkflowCount: z$1.ZodNumber;\n activeBackgroundAgentCount: z$1.ZodNumber;\n activeBackgroundCommandCount: z$1.ZodNumber;\n activePlanModeCount: z$1.ZodNumber;\n activeGoalCount: z$1.ZodNumber;\n }, z$1.core.$strip>;\n pinSortKey: z$1.ZodNullable;\n hasPendingInteraction: z$1.ZodBoolean;\n environmentHostId: z$1.ZodNullable;\n environmentName: z$1.ZodNullable;\n environmentBranchName: z$1.ZodNullable;\n environmentWorkspaceDisplayKind: z$1.ZodEnum<{\n \"managed-worktree\": \"managed-worktree\";\n \"unmanaged-worktree\": \"unmanaged-worktree\";\n other: \"other\";\n }>;\n }, z$1.core.$strip>>;\n defaultExecutionOptions: z$1.ZodNullable;\n reasoningLevel: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n permissionMode: z$1.ZodEnum<{\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n full: \"full\";\n }>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype ProjectWithThreadsResponse = z$1.infer;\ndeclare const uploadedPromptAttachmentSchema: z$1.ZodObject<{\n type: z$1.ZodEnum<{\n localImage: \"localImage\";\n localFile: \"localFile\";\n }>;\n path: z$1.ZodString;\n name: z$1.ZodString;\n mimeType: z$1.ZodOptional;\n sizeBytes: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype UploadedPromptAttachment = z$1.infer;\ndeclare const copyProjectAttachmentsRequestSchema: z$1.ZodObject<{\n sourceProjectId: z$1.ZodString;\n paths: z$1.ZodArray;\n}, z$1.core.$strict>;\ntype CopyProjectAttachmentsRequest = z$1.infer;\n\ndeclare const registrySkillSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n source: z$1.ZodString;\n skillId: z$1.ZodString;\n name: z$1.ZodString;\n installs: z$1.ZodNumber;\n stars: z$1.ZodNullable;\n installUrl: z$1.ZodNullable;\n url: z$1.ZodString;\n topic: z$1.ZodNullable;\n summary: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype RegistrySkill = z$1.infer;\ndeclare const registrySkillsPageSchema: z$1.ZodObject<{\n skills: z$1.ZodArray;\n installUrl: z$1.ZodNullable;\n url: z$1.ZodString;\n topic: z$1.ZodNullable;\n summary: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n pagination: z$1.ZodObject<{\n page: z$1.ZodNumber;\n perPage: z$1.ZodNumber;\n total: z$1.ZodNumber;\n hasMore: z$1.ZodBoolean;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>;\ntype RegistrySkillsPage = z$1.infer;\ndeclare const registryRepositoryStarsSchema: z$1.ZodObject<{\n stars: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype RegistryRepositoryStars = z$1.infer;\ndeclare const registrySkillDetailSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n source: z$1.ZodString;\n skillId: z$1.ZodString;\n hash: z$1.ZodNullable;\n files: z$1.ZodNullable>>;\n}, z$1.core.$strip>;\ntype RegistrySkillDetail = z$1.infer;\ndeclare const registrySkillInstallResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n filePath: z$1.ZodString;\n}, z$1.core.$strip>;\ntype RegistrySkillInstallResponse = z$1.infer;\n\ndeclare const updateEnvironmentRequestSchema: z$1.ZodObject<{\n mergeBaseBranch: z$1.ZodOptional>;\n name: z$1.ZodOptional>;\n}, z$1.core.$strip>;\ntype UpdateEnvironmentRequest = z$1.infer;\n/**\n * Query for searching paths in an environment's workspace. Unlike the\n * project-scoped variant this needs no `environmentId` — the environment is\n * the route param — and is project-agnostic, so it works for projectless\n * (personal) environments too.\n */\ndeclare const environmentPathsQuerySchema: z$1.ZodObject<{\n query: z$1.ZodOptional;\n limit: z$1.ZodOptional;\n includeFiles: z$1.ZodEnum<{\n true: \"true\";\n false: \"false\";\n }>;\n includeDirectories: z$1.ZodEnum<{\n true: \"true\";\n false: \"false\";\n }>;\n}, z$1.core.$strip>;\ntype EnvironmentPathsQuery = z$1.infer;\ndeclare const environmentDiffBranchesQuerySchema: z$1.ZodObject<{\n query: z$1.ZodOptional;\n limit: z$1.ZodOptional;\n selectedBranch: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype EnvironmentDiffBranchesQuery = z$1.infer;\ndeclare const environmentDiffBranchesResponseSchema: z$1.ZodObject<{\n branches: z$1.ZodArray;\n branchesTruncated: z$1.ZodBoolean;\n remoteBranches: z$1.ZodArray;\n remoteBranchesTruncated: z$1.ZodBoolean;\n selectedBranch: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype EnvironmentDiffBranchesResponse = z$1.infer;\ndeclare const environmentStatusQuerySchema: z$1.ZodObject<{\n mergeBaseBranch: z$1.ZodOptional>;\n}, z$1.core.$strip>;\ntype EnvironmentStatusQuery = z$1.infer;\ndeclare const environmentDiffQuerySchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n target: z$1.ZodLiteral<\"uncommitted\">;\n}, z$1.core.$strip>, z$1.ZodObject<{\n target: z$1.ZodLiteral<\"branch_committed\">;\n mergeBaseBranch: z$1.ZodPipe;\n}, z$1.core.$strip>, z$1.ZodObject<{\n target: z$1.ZodLiteral<\"all\">;\n mergeBaseBranch: z$1.ZodPipe;\n}, z$1.core.$strip>, z$1.ZodObject<{\n target: z$1.ZodLiteral<\"commit\">;\n sha: z$1.ZodString;\n}, z$1.core.$strip>], \"target\">;\ntype EnvironmentDiffQuery = z$1.infer;\n/**\n * Query for fetching a single file's contents at one side of a diff target.\n * Used by the diff card to reparse the card's patch with full old/new contents\n * so `@pierre/diffs` can render expand-context buttons between hunks.\n *\n * For `branch_committed` / `all`, callers pass the resolved merge-base SHA\n * (`mergeBaseRef`, surfaced by `workspace.diff`) rather than the branch name\n * — the diff itself was computed against that SHA, so reading the old side\n * from the same SHA keeps the file content aligned with the hunk line\n * numbers. Reading from the branch tip is wrong whenever the branch has\n * moved past the merge-base since the file existed there.\n */\ndeclare const environmentDiffFileQuerySchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n target: z$1.ZodLiteral<\"uncommitted\">;\n path: z$1.ZodString;\n side: z$1.ZodEnum<{\n new: \"new\";\n old: \"old\";\n }>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n target: z$1.ZodLiteral<\"branch_committed\">;\n mergeBaseRef: z$1.ZodString;\n path: z$1.ZodString;\n side: z$1.ZodEnum<{\n new: \"new\";\n old: \"old\";\n }>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n target: z$1.ZodLiteral<\"all\">;\n mergeBaseRef: z$1.ZodString;\n path: z$1.ZodString;\n side: z$1.ZodEnum<{\n new: \"new\";\n old: \"old\";\n }>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n target: z$1.ZodLiteral<\"commit\">;\n sha: z$1.ZodString;\n path: z$1.ZodString;\n side: z$1.ZodEnum<{\n new: \"new\";\n old: \"old\";\n }>;\n}, z$1.core.$strip>], \"target\">;\ntype EnvironmentDiffFileQuery = z$1.infer;\ndeclare const environmentDiffFileResponseSchema: z$1.ZodObject<{\n path: z$1.ZodString;\n content: z$1.ZodString;\n contentEncoding: z$1.ZodEnum<{\n utf8: \"utf8\";\n base64: \"base64\";\n }>;\n mimeType: z$1.ZodOptional;\n sizeBytes: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype EnvironmentDiffFileResponse = z$1.infer;\ndeclare const environmentArchiveThreadsResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n archivedThreadIds: z$1.ZodArray;\n}, z$1.core.$strip>;\ntype EnvironmentArchiveThreadsResponse = z$1.infer;\ndeclare const pullRequestMergeMethodSchema: z$1.ZodEnum<{\n merge: \"merge\";\n rebase: \"rebase\";\n squash: \"squash\";\n}>;\ntype PullRequestMergeMethod = z$1.infer;\ndeclare const commitActionResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n action: z$1.ZodLiteral<\"commit\">;\n message: z$1.ZodString;\n commitSha: z$1.ZodString;\n commitSubject: z$1.ZodString;\n}, z$1.core.$strip>;\ntype CommitActionResponse = z$1.infer;\ndeclare const squashMergeActionResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n action: z$1.ZodLiteral<\"squash_merge\">;\n merged: z$1.ZodBoolean;\n message: z$1.ZodString;\n commitSha: z$1.ZodString;\n commitSubject: z$1.ZodString;\n}, z$1.core.$strip>;\ntype SquashMergeActionResponse = z$1.infer;\ndeclare const pullRequestReadyActionResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n action: z$1.ZodLiteral<\"pull_request_ready\">;\n message: z$1.ZodString;\n}, z$1.core.$strip>;\ntype PullRequestReadyActionResponse = z$1.infer;\ndeclare const pullRequestMergeActionResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n action: z$1.ZodLiteral<\"pull_request_merge\">;\n method: z$1.ZodEnum<{\n merge: \"merge\";\n rebase: \"rebase\";\n squash: \"squash\";\n }>;\n message: z$1.ZodString;\n}, z$1.core.$strip>;\ntype PullRequestMergeActionResponse = z$1.infer;\ndeclare const pullRequestDraftActionResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n action: z$1.ZodLiteral<\"pull_request_draft\">;\n message: z$1.ZodString;\n}, z$1.core.$strip>;\ntype PullRequestDraftActionResponse = z$1.infer;\ndeclare const environmentStatusResponseSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n workspace: z$1.ZodObject<{\n workingTree: z$1.ZodObject<{\n insertions: z$1.ZodNumber;\n deletions: z$1.ZodNumber;\n files: z$1.ZodArray;\n insertions: z$1.ZodNullable;\n deletions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n hasUncommittedChanges: z$1.ZodBoolean;\n state: z$1.ZodEnum<{\n clean: \"clean\";\n untracked: \"untracked\";\n dirty_uncommitted: \"dirty_uncommitted\";\n committed_unmerged: \"committed_unmerged\";\n dirty_and_committed_unmerged: \"dirty_and_committed_unmerged\";\n }>;\n }, z$1.core.$strip>;\n checkout: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"branch\">;\n branchName: z$1.ZodString;\n headSha: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"detached\">;\n headSha: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unborn\">;\n branchName: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unknown\">;\n reason: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">;\n branch: z$1.ZodObject<{\n currentBranch: z$1.ZodNullable;\n defaultBranch: z$1.ZodString;\n }, z$1.core.$strip>;\n mergeBase: z$1.ZodNullable;\n insertions: z$1.ZodNullable;\n deletions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n mergeBaseBranch: z$1.ZodString;\n baseRef: z$1.ZodNullable;\n aheadCount: z$1.ZodNumber;\n behindCount: z$1.ZodNumber;\n hasCommittedUnmergedChanges: z$1.ZodBoolean;\n commits: z$1.ZodArray>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"not_applicable\">;\n reason: z$1.ZodEnum<{\n non_git_environment: \"non_git_environment\";\n }>;\n message: z$1.ZodString;\n}, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"unavailable\">;\n failure: z$1.ZodObject<{\n code: z$1.ZodEnum<{\n unknown: \"unknown\";\n path_not_found: \"path_not_found\";\n not_git_repo: \"not_git_repo\";\n not_worktree: \"not_worktree\";\n workspace_type_mismatch: \"workspace_type_mismatch\";\n permission_denied: \"permission_denied\";\n unknown_environment: \"unknown_environment\";\n }>;\n workspacePath: z$1.ZodString;\n message: z$1.ZodString;\n }, z$1.core.$strict>;\n}, z$1.core.$strict>], \"outcome\">;\n/**\n * Structured pull-request lookup outcome. \"absent\" is a real answer — the\n * host checked and the branch has no PR (non-git environments resolve to\n * \"absent\" without a daemon call). \"unavailable\" means the lookup itself\n * failed (gh missing, not authenticated, timeout, unreachable workspace), so\n * callers must not render it as \"no PR exists\".\n */\ndeclare const environmentPullRequestResponseSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n pullRequest: z$1.ZodObject<{\n number: z$1.ZodNumber;\n title: z$1.ZodString;\n state: z$1.ZodEnum<{\n merged: \"merged\";\n draft: \"draft\";\n open: \"open\";\n closed: \"closed\";\n }>;\n url: z$1.ZodString;\n baseRefName: z$1.ZodString;\n headRefName: z$1.ZodString;\n updatedAt: z$1.ZodString;\n checks: z$1.ZodObject<{\n state: z$1.ZodEnum<{\n unknown: \"unknown\";\n pending: \"pending\";\n passing: \"passing\";\n failing: \"failing\";\n no_checks: \"no_checks\";\n }>;\n totalCount: z$1.ZodNumber;\n passedCount: z$1.ZodNumber;\n failedCount: z$1.ZodNumber;\n pendingCount: z$1.ZodNumber;\n }, z$1.core.$strict>;\n review: z$1.ZodObject<{\n state: z$1.ZodEnum<{\n none: \"none\";\n approved: \"approved\";\n changes_requested: \"changes_requested\";\n review_required: \"review_required\";\n review_requested: \"review_requested\";\n }>;\n reviewRequestCount: z$1.ZodNumber;\n }, z$1.core.$strict>;\n mergeability: z$1.ZodObject<{\n state: z$1.ZodEnum<{\n unknown: \"unknown\";\n blocked: \"blocked\";\n draft: \"draft\";\n mergeable: \"mergeable\";\n conflicts: \"conflicts\";\n }>;\n mergeStateStatus: z$1.ZodNullable>;\n mergeable: z$1.ZodNullable>;\n }, z$1.core.$strict>;\n attention: z$1.ZodEnum<{\n blocked: \"blocked\";\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 checks_failed: \"checks_failed\";\n checks_pending: \"checks_pending\";\n ready_to_merge: \"ready_to_merge\";\n }>;\n }, z$1.core.$strict>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"absent\">;\n}, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"unavailable\">;\n message: z$1.ZodString;\n}, z$1.core.$strict>], \"outcome\">;\ntype EnvironmentPullRequestResponse = z$1.infer;\ndeclare const environmentDiffResponseSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n diff: z$1.ZodObject<{\n diff: z$1.ZodString;\n truncated: z$1.ZodBoolean;\n shortstat: z$1.ZodString;\n files: z$1.ZodString;\n mergeBaseRef: z$1.ZodNullable;\n }, z$1.core.$strip>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"not_applicable\">;\n reason: z$1.ZodEnum<{\n non_git_environment: \"non_git_environment\";\n }>;\n message: z$1.ZodString;\n}, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"unavailable\">;\n failure: z$1.ZodObject<{\n code: z$1.ZodEnum<{\n unknown: \"unknown\";\n path_not_found: \"path_not_found\";\n not_git_repo: \"not_git_repo\";\n not_worktree: \"not_worktree\";\n workspace_type_mismatch: \"workspace_type_mismatch\";\n permission_denied: \"permission_denied\";\n unknown_environment: \"unknown_environment\";\n }>;\n workspacePath: z$1.ZodString;\n message: z$1.ZodString;\n }, z$1.core.$strict>;\n}, z$1.core.$strict>], \"outcome\">;\ntype EnvironmentDiffResponse = z$1.infer;\ndeclare const environmentDiffFilesResponseSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n files: z$1.ZodArray;\n changeKind: z$1.ZodEnum<{\n deleted: \"deleted\";\n added: \"added\";\n modified: \"modified\";\n renamed: \"renamed\";\n copied: \"copied\";\n type_changed: \"type_changed\";\n }>;\n additions: z$1.ZodNumber;\n deletions: z$1.ZodNumber;\n binary: z$1.ZodBoolean;\n origin: z$1.ZodEnum<{\n untracked: \"untracked\";\n tracked: \"tracked\";\n }>;\n loadMode: z$1.ZodEnum<{\n auto: \"auto\";\n on_demand: \"on_demand\";\n too_large: \"too_large\";\n }>;\n }, z$1.core.$strip>>;\n shortstat: z$1.ZodString;\n mergeBaseRef: z$1.ZodNullable;\n initialPatches: z$1.ZodArray>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"not_applicable\">;\n reason: z$1.ZodEnum<{\n non_git_environment: \"non_git_environment\";\n too_many_files: \"too_many_files\";\n }>;\n message: z$1.ZodString;\n}, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"unavailable\">;\n failure: z$1.ZodObject<{\n code: z$1.ZodEnum<{\n unknown: \"unknown\";\n path_not_found: \"path_not_found\";\n not_git_repo: \"not_git_repo\";\n not_worktree: \"not_worktree\";\n workspace_type_mismatch: \"workspace_type_mismatch\";\n permission_denied: \"permission_denied\";\n unknown_environment: \"unknown_environment\";\n }>;\n workspacePath: z$1.ZodString;\n message: z$1.ZodString;\n }, z$1.core.$strict>;\n}, z$1.core.$strict>], \"outcome\">;\ntype EnvironmentDiffFilesResponse = z$1.infer;\ndeclare const environmentDiffPatchResponseSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n patches: z$1.ZodArray>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"not_applicable\">;\n reason: z$1.ZodEnum<{\n non_git_environment: \"non_git_environment\";\n }>;\n message: z$1.ZodString;\n}, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"unavailable\">;\n failure: z$1.ZodObject<{\n code: z$1.ZodEnum<{\n unknown: \"unknown\";\n path_not_found: \"path_not_found\";\n not_git_repo: \"not_git_repo\";\n not_worktree: \"not_worktree\";\n workspace_type_mismatch: \"workspace_type_mismatch\";\n permission_denied: \"permission_denied\";\n unknown_environment: \"unknown_environment\";\n }>;\n workspacePath: z$1.ZodString;\n message: z$1.ZodString;\n }, z$1.core.$strict>;\n}, z$1.core.$strict>], \"outcome\">;\ntype EnvironmentDiffPatchResponse = z$1.infer;\n/**\n * Body for `POST /diff/patch`: the diff target plus the list of new paths whose\n * patches the client wants. A POST (not GET) because the repeated `paths` array\n * cannot survive flat query parsing. The client supplies only new paths; the\n * server re-derives each file's rename/copy pairing (`previousPath`) from its\n * own TOC.\n */\ndeclare const environmentDiffPatchRequestSchema: z$1.ZodObject<{\n target: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"uncommitted\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"branch_committed\">;\n mergeBaseBranch: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"all\">;\n mergeBaseBranch: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"commit\">;\n sha: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">;\n paths: z$1.ZodArray;\n}, z$1.core.$strict>;\ntype EnvironmentDiffPatchRequest = z$1.infer;\ntype EnvironmentStatusResponse = z$1.infer;\n\ndeclare const providerUsageResponseSchema: z$1.ZodObject<{\n codex: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n status: z$1.ZodLiteral<\"ok\">;\n accountEmail: z$1.ZodNullable;\n planLabel: z$1.ZodNullable;\n windows: z$1.ZodArray;\n cost: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"not_installed\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"unauthenticated\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"expired\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"error\">;\n message: z$1.ZodString;\n planLabel: z$1.ZodDefault>;\n accountEmail: z$1.ZodDefault>;\n }, z$1.core.$strip>], \"status\">;\n claudeCode: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n status: z$1.ZodLiteral<\"ok\">;\n accountEmail: z$1.ZodNullable;\n planLabel: z$1.ZodNullable;\n windows: z$1.ZodArray;\n cost: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"not_installed\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"unauthenticated\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"expired\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"error\">;\n message: z$1.ZodString;\n planLabel: z$1.ZodDefault>;\n accountEmail: z$1.ZodDefault>;\n }, z$1.core.$strip>], \"status\">;\n cursor: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n status: z$1.ZodLiteral<\"ok\">;\n accountEmail: z$1.ZodNullable;\n planLabel: z$1.ZodNullable;\n windows: z$1.ZodArray;\n cost: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"not_installed\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"unauthenticated\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"expired\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"error\">;\n message: z$1.ZodString;\n planLabel: z$1.ZodDefault>;\n accountEmail: z$1.ZodDefault>;\n }, z$1.core.$strip>], \"status\">;\n}, z$1.core.$strip>;\ntype ProviderUsageResponse = z$1.infer;\ndeclare const discoverReposResultSchema: z$1.ZodObject<{\n repos: z$1.ZodArray;\n agentSeen: z$1.ZodBoolean;\n agentSeenAt: z$1.ZodNullable;\n }, z$1.core.$strict>>;\n truncated: z$1.ZodBoolean;\n}, z$1.core.$strict>;\ntype DiscoverReposResult = z$1.infer;\ntype HostDaemonCommandTransport = \"settled\" | \"onlineRpc\";\ntype HostDaemonCommandEnvironmentLane = \"read\" | \"write\";\ntype HostDaemonFlushEventsBeforeResult = boolean | \"when-initiated\";\ninterface HostDaemonCommandDescriptor {\n type: Type;\n schema: Schema;\n resultSchema: ResultSchema;\n transport: Transport;\n retryable: Retryable;\n flushEventsBeforeResult: HostDaemonFlushEventsBeforeResult;\n envLane: HostDaemonCommandEnvironmentLane | null;\n}\ndeclare const hostDaemonCommandRegistry: {\n \"thread.start\": HostDaemonCommandDescriptor<\"thread.start\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n threadId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n projectId: z$1.ZodString;\n providerId: z$1.ZodString;\n acpLaunchSpec: z$1.ZodOptional;\n env: z$1.ZodRecord;\n cwd: z$1.ZodOptional;\n modelCli: z$1.ZodOptional;\n selectFlag: z$1.ZodOptional;\n primaryModels: z$1.ZodArray;\n }, z$1.core.$strict>, z$1.ZodTransform<{\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n } | undefined, {\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n }>>>;\n reasoningCli: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n nativeReasoning: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n permissionCli: z$1.ZodOptional>;\n workspaceWrite: z$1.ZodOptional>;\n readonly: z$1.ZodOptional>;\n insertAfterArgs: z$1.ZodOptional;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n options: z$1.ZodIntersection;\n reasoningLevel: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n claudeCodePermissionMode: z$1.ZodOptional>;\n claudeCodeMockCliTraffic: z$1.ZodOptional>;\n workflowsEnabled: z$1.ZodBoolean;\n memoryEnabled: z$1.ZodOptional;\n providerSubagentsEnabled: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n permissionMode: z$1.ZodLiteral<\"accept-edits\">;\n permissionScope: z$1.ZodLiteral<\"workspace\">;\n approvalReviewer: z$1.ZodLiteral<\"user\">;\n permissionEscalation: z$1.ZodEnum<{\n ask: \"ask\";\n deny: \"deny\";\n }>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n permissionMode: z$1.ZodLiteral<\"auto\">;\n permissionScope: z$1.ZodLiteral<\"workspace\">;\n approvalReviewer: z$1.ZodLiteral<\"automatic\">;\n permissionEscalation: z$1.ZodEnum<{\n ask: \"ask\";\n deny: \"deny\";\n }>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n permissionMode: z$1.ZodLiteral<\"full\">;\n permissionScope: z$1.ZodLiteral<\"full\">;\n approvalReviewer: z$1.ZodNull;\n permissionEscalation: z$1.ZodNull;\n }, z$1.core.$strip>], \"permissionMode\">>;\n instructions: z$1.ZodString;\n dynamicTools: z$1.ZodArray>;\n injectedSkillSources: z$1.ZodArray;\n treeHash: z$1.ZodString;\n entryPath: z$1.ZodString;\n sourceType: z$1.ZodEnum<{\n builtin: \"builtin\";\n \"data-dir\": \"data-dir\";\n }>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n name: z$1.ZodString;\n description: z$1.ZodString;\n kind: z$1.ZodLiteral<\"workspace-path\">;\n sourceType: z$1.ZodLiteral<\"project\">;\n sourceRootPath: z$1.ZodString;\n skillFilePath: z$1.ZodString;\n }, z$1.core.$strict>], \"kind\">>;\n disallowedTools: z$1.ZodOptional>;\n instructionMode: z$1.ZodEnum<{\n replace: \"replace\";\n append: \"append\";\n }>;\n type: z$1.ZodLiteral<\"thread.start\">;\n requestId: z$1.ZodString;\n input: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n builtin: \"builtin\";\n project: \"project\";\n user: \"user\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n inputGroups: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n builtin: \"builtin\";\n project: \"project\";\n user: \"user\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>>>;\n threadStoragePath: z$1.ZodOptional;\n fork: z$1.ZodOptional>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n providerThreadId: z$1.ZodString;\n }, z$1.core.$strip>, \"settled\", false>;\n \"turn.submit\": HostDaemonCommandDescriptor<\"turn.submit\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n threadId: z$1.ZodString;\n type: z$1.ZodLiteral<\"turn.submit\">;\n requestId: z$1.ZodString;\n input: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n builtin: \"builtin\";\n project: \"project\";\n user: \"user\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n inputGroups: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n builtin: \"builtin\";\n project: \"project\";\n user: \"user\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>>>;\n options: z$1.ZodIntersection;\n reasoningLevel: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n claudeCodePermissionMode: z$1.ZodOptional>;\n claudeCodeMockCliTraffic: z$1.ZodOptional>;\n workflowsEnabled: z$1.ZodBoolean;\n memoryEnabled: z$1.ZodOptional;\n providerSubagentsEnabled: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n permissionMode: z$1.ZodLiteral<\"accept-edits\">;\n permissionScope: z$1.ZodLiteral<\"workspace\">;\n approvalReviewer: z$1.ZodLiteral<\"user\">;\n permissionEscalation: z$1.ZodEnum<{\n ask: \"ask\";\n deny: \"deny\";\n }>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n permissionMode: z$1.ZodLiteral<\"auto\">;\n permissionScope: z$1.ZodLiteral<\"workspace\">;\n approvalReviewer: z$1.ZodLiteral<\"automatic\">;\n permissionEscalation: z$1.ZodEnum<{\n ask: \"ask\";\n deny: \"deny\";\n }>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n permissionMode: z$1.ZodLiteral<\"full\">;\n permissionScope: z$1.ZodLiteral<\"full\">;\n approvalReviewer: z$1.ZodNull;\n permissionEscalation: z$1.ZodNull;\n }, z$1.core.$strip>], \"permissionMode\">>;\n acpLaunchSpec: z$1.ZodOptional;\n env: z$1.ZodRecord;\n cwd: z$1.ZodOptional;\n modelCli: z$1.ZodOptional;\n selectFlag: z$1.ZodOptional;\n primaryModels: z$1.ZodArray;\n }, z$1.core.$strict>, z$1.ZodTransform<{\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n } | undefined, {\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n }>>>;\n reasoningCli: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n nativeReasoning: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n permissionCli: z$1.ZodOptional>;\n workspaceWrite: z$1.ZodOptional>;\n readonly: z$1.ZodOptional>;\n insertAfterArgs: z$1.ZodOptional;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n resumeContext: z$1.ZodObject<{\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n instructionMode: z$1.ZodEnum<{\n replace: \"replace\";\n append: \"append\";\n }>;\n projectId: z$1.ZodString;\n providerId: z$1.ZodString;\n acpLaunchSpec: z$1.ZodOptional;\n env: z$1.ZodRecord;\n cwd: z$1.ZodOptional;\n modelCli: z$1.ZodOptional;\n selectFlag: z$1.ZodOptional;\n primaryModels: z$1.ZodArray;\n }, z$1.core.$strict>, z$1.ZodTransform<{\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n } | undefined, {\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n }>>>;\n reasoningCli: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n nativeReasoning: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n permissionCli: z$1.ZodOptional>;\n workspaceWrite: z$1.ZodOptional>;\n readonly: z$1.ZodOptional>;\n insertAfterArgs: z$1.ZodOptional;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n instructions: z$1.ZodString;\n dynamicTools: z$1.ZodArray>;\n injectedSkillSources: z$1.ZodArray;\n treeHash: z$1.ZodString;\n entryPath: z$1.ZodString;\n sourceType: z$1.ZodEnum<{\n builtin: \"builtin\";\n \"data-dir\": \"data-dir\";\n }>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n name: z$1.ZodString;\n description: z$1.ZodString;\n kind: z$1.ZodLiteral<\"workspace-path\">;\n sourceType: z$1.ZodLiteral<\"project\">;\n sourceRootPath: z$1.ZodString;\n skillFilePath: z$1.ZodString;\n }, z$1.core.$strict>], \"kind\">>;\n disallowedTools: z$1.ZodOptional>;\n providerThreadId: z$1.ZodString;\n }, z$1.core.$strict>;\n target: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n mode: z$1.ZodLiteral<\"start\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n mode: z$1.ZodLiteral<\"auto\">;\n expectedTurnId: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n mode: z$1.ZodLiteral<\"steer\">;\n expectedTurnId: z$1.ZodNullable;\n }, z$1.core.$strip>], \"mode\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n appliedAs: z$1.ZodEnum<{\n steer: \"steer\";\n \"new-turn\": \"new-turn\";\n }>;\n }, z$1.core.$strip>, \"settled\", false>;\n \"thread.stop\": HostDaemonCommandDescriptor<\"thread.stop\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n threadId: z$1.ZodString;\n type: z$1.ZodLiteral<\"thread.stop\">;\n }, z$1.core.$strict>, z$1.ZodObject<{}, z$1.core.$strip>, \"settled\", false>;\n \"thread.goal.clear\": HostDaemonCommandDescriptor<\"thread.goal.clear\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n threadId: z$1.ZodString;\n type: z$1.ZodLiteral<\"thread.goal.clear\">;\n options: z$1.ZodIntersection;\n reasoningLevel: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n claudeCodePermissionMode: z$1.ZodOptional>;\n claudeCodeMockCliTraffic: z$1.ZodOptional>;\n workflowsEnabled: z$1.ZodBoolean;\n memoryEnabled: z$1.ZodOptional;\n providerSubagentsEnabled: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n permissionMode: z$1.ZodLiteral<\"accept-edits\">;\n permissionScope: z$1.ZodLiteral<\"workspace\">;\n approvalReviewer: z$1.ZodLiteral<\"user\">;\n permissionEscalation: z$1.ZodEnum<{\n ask: \"ask\";\n deny: \"deny\";\n }>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n permissionMode: z$1.ZodLiteral<\"auto\">;\n permissionScope: z$1.ZodLiteral<\"workspace\">;\n approvalReviewer: z$1.ZodLiteral<\"automatic\">;\n permissionEscalation: z$1.ZodEnum<{\n ask: \"ask\";\n deny: \"deny\";\n }>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n permissionMode: z$1.ZodLiteral<\"full\">;\n permissionScope: z$1.ZodLiteral<\"full\">;\n approvalReviewer: z$1.ZodNull;\n permissionEscalation: z$1.ZodNull;\n }, z$1.core.$strip>], \"permissionMode\">>;\n acpLaunchSpec: z$1.ZodOptional;\n env: z$1.ZodRecord;\n cwd: z$1.ZodOptional;\n modelCli: z$1.ZodOptional;\n selectFlag: z$1.ZodOptional;\n primaryModels: z$1.ZodArray;\n }, z$1.core.$strict>, z$1.ZodTransform<{\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n } | undefined, {\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n }>>>;\n reasoningCli: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n nativeReasoning: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n permissionCli: z$1.ZodOptional>;\n workspaceWrite: z$1.ZodOptional>;\n readonly: z$1.ZodOptional>;\n insertAfterArgs: z$1.ZodOptional;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n resumeContext: z$1.ZodObject<{\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n instructionMode: z$1.ZodEnum<{\n replace: \"replace\";\n append: \"append\";\n }>;\n projectId: z$1.ZodString;\n providerId: z$1.ZodString;\n acpLaunchSpec: z$1.ZodOptional;\n env: z$1.ZodRecord;\n cwd: z$1.ZodOptional;\n modelCli: z$1.ZodOptional;\n selectFlag: z$1.ZodOptional;\n primaryModels: z$1.ZodArray;\n }, z$1.core.$strict>, z$1.ZodTransform<{\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n } | undefined, {\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n }>>>;\n reasoningCli: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n nativeReasoning: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n permissionCli: z$1.ZodOptional>;\n workspaceWrite: z$1.ZodOptional>;\n readonly: z$1.ZodOptional>;\n insertAfterArgs: z$1.ZodOptional;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n instructions: z$1.ZodString;\n dynamicTools: z$1.ZodArray>;\n injectedSkillSources: z$1.ZodArray;\n treeHash: z$1.ZodString;\n entryPath: z$1.ZodString;\n sourceType: z$1.ZodEnum<{\n builtin: \"builtin\";\n \"data-dir\": \"data-dir\";\n }>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n name: z$1.ZodString;\n description: z$1.ZodString;\n kind: z$1.ZodLiteral<\"workspace-path\">;\n sourceType: z$1.ZodLiteral<\"project\">;\n sourceRootPath: z$1.ZodString;\n skillFilePath: z$1.ZodString;\n }, z$1.core.$strict>], \"kind\">>;\n disallowedTools: z$1.ZodOptional>;\n providerThreadId: z$1.ZodString;\n }, z$1.core.$strict>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n cleared: z$1.ZodBoolean;\n }, z$1.core.$strict>, \"settled\", false>;\n \"thread.plan.cancel\": HostDaemonCommandDescriptor<\"thread.plan.cancel\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n threadId: z$1.ZodString;\n type: z$1.ZodLiteral<\"thread.plan.cancel\">;\n expectedTurnId: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n cancelled: z$1.ZodBoolean;\n }, z$1.core.$strict>, \"settled\", false>;\n \"thread.rename\": HostDaemonCommandDescriptor<\"thread.rename\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n threadId: z$1.ZodString;\n type: z$1.ZodLiteral<\"thread.rename\">;\n title: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{}, z$1.core.$strip>, \"settled\", false>;\n \"thread.archive\": HostDaemonCommandDescriptor<\"thread.archive\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n threadId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"thread.archive\">;\n providerId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{}, z$1.core.$strip>, \"settled\", false>;\n \"thread.unarchive\": HostDaemonCommandDescriptor<\"thread.unarchive\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n threadId: z$1.ZodString;\n type: z$1.ZodLiteral<\"thread.unarchive\">;\n providerId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{}, z$1.core.$strip>, \"settled\", false>;\n \"interactive.resolve\": HostDaemonCommandDescriptor<\"interactive.resolve\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n threadId: z$1.ZodString;\n type: z$1.ZodLiteral<\"interactive.resolve\">;\n interactionId: z$1.ZodString;\n providerId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n providerRequestId: z$1.ZodString;\n resolution: z$1.ZodUnion;\n grantedPermissions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"allow_for_session\">;\n grantedPermissions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"deny\">;\n }, z$1.core.$strip>], \"decision\">, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"user_answer\">;\n answers: z$1.ZodRecord;\n freeText: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin_submitted\">;\n }, z$1.core.$strip>]>;\n }, z$1.core.$strict>, z$1.ZodObject<{}, z$1.core.$strip>, \"settled\", false>;\n \"codex.inference.complete\": HostDaemonCommandDescriptor<\"codex.inference.complete\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"codex.inference.complete\">;\n model: z$1.ZodString;\n reasoningEffort: z$1.ZodLiteral<\"none\">;\n prompt: z$1.ZodString;\n outputSchema: z$1.ZodType>;\n timeoutMs: z$1.ZodNumber;\n }, z$1.core.$strict>, z$1.ZodObject<{\n model: z$1.ZodString;\n value: z$1.ZodType>;\n }, z$1.core.$strip>, \"settled\", false>;\n \"codex.voice.transcribe\": HostDaemonCommandDescriptor<\"codex.voice.transcribe\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"codex.voice.transcribe\">;\n model: z$1.ZodString;\n audioBase64: z$1.ZodString;\n mimeType: z$1.ZodString;\n filename: z$1.ZodString;\n prompt: z$1.ZodNullable;\n timeoutMs: z$1.ZodNumber;\n }, z$1.core.$strict>, z$1.ZodObject<{\n model: z$1.ZodString;\n text: z$1.ZodString;\n }, z$1.core.$strip>, \"settled\", false>;\n \"environment.provision\": HostDaemonCommandDescriptor<\"environment.provision\", z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n environmentId: z$1.ZodString;\n type: z$1.ZodLiteral<\"environment.provision\">;\n initiator: z$1.ZodNullable>;\n workspaceProvisionType: z$1.ZodLiteral<\"unmanaged\">;\n path: z$1.ZodString;\n checkout: z$1.ZodOptional;\n name: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"new\">;\n name: z$1.ZodString;\n baseBranch: z$1.ZodString;\n }, z$1.core.$strict>], \"kind\">>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodString;\n type: z$1.ZodLiteral<\"environment.provision\">;\n initiator: z$1.ZodNullable>;\n sourcePath: z$1.ZodString;\n targetPath: z$1.ZodString;\n branchName: z$1.ZodString;\n baseBranch: z$1.ZodNullable;\n setupTimeoutMs: z$1.ZodNumber;\n workspaceProvisionType: z$1.ZodLiteral<\"managed-worktree\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodString;\n type: z$1.ZodLiteral<\"environment.provision\">;\n initiator: z$1.ZodNullable>;\n workspaceProvisionType: z$1.ZodLiteral<\"personal\">;\n targetPath: z$1.ZodString;\n }, z$1.core.$strict>], \"workspaceProvisionType\">, z$1.ZodObject<{\n path: z$1.ZodString;\n isGitRepo: z$1.ZodBoolean;\n isWorktree: z$1.ZodBoolean;\n branchName: z$1.ZodNullable;\n defaultBranch: z$1.ZodNullable;\n transcript: z$1.ZodArray;\n key: z$1.ZodString;\n text: z$1.ZodString;\n startedAt: z$1.ZodOptional;\n status: z$1.ZodOptional>;\n metadata: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, \"settled\", false>;\n \"project.clone\": HostDaemonCommandDescriptor<\"project.clone\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"project.clone\">;\n remoteUrl: z$1.ZodString;\n projectSlug: z$1.ZodString;\n targetPath: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodObject<{\n path: z$1.ZodString;\n gitRemoteUrl: z$1.ZodNullable;\n }, z$1.core.$strict>, \"settled\", false>;\n \"environment.provision.cancel\": HostDaemonCommandDescriptor<\"environment.provision.cancel\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n type: z$1.ZodLiteral<\"environment.provision.cancel\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n aborted: z$1.ZodBoolean;\n }, z$1.core.$strip>, \"settled\", false>;\n \"environment.destroy\": HostDaemonCommandDescriptor<\"environment.destroy\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"environment.destroy\">;\n }, z$1.core.$strict>, z$1.ZodObject<{}, z$1.core.$strip>, \"settled\", false>;\n \"workspace.commit\": HostDaemonCommandDescriptor<\"workspace.commit\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.commit\">;\n message: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n commitSha: z$1.ZodString;\n commitSubject: z$1.ZodString;\n }, z$1.core.$strip>, \"settled\", false>;\n \"workspace.squash_merge\": HostDaemonCommandDescriptor<\"workspace.squash_merge\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.squash_merge\">;\n targetBranch: z$1.ZodString;\n commitMessage: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n commitSha: z$1.ZodString;\n commitSubject: z$1.ZodString;\n merged: z$1.ZodBoolean;\n }, z$1.core.$strip>, \"settled\", false>;\n \"workspace.pull_request_action\": HostDaemonCommandDescriptor<\"workspace.pull_request_action\", z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.pull_request_action\">;\n operation: z$1.ZodLiteral<\"ready\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.pull_request_action\">;\n operation: z$1.ZodLiteral<\"draft\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.pull_request_action\">;\n operation: z$1.ZodLiteral<\"merge\">;\n method: z$1.ZodEnum<{\n merge: \"merge\";\n squash: \"squash\";\n rebase: \"rebase\";\n }>;\n }, z$1.core.$strict>], \"operation\">, z$1.ZodObject<{}, z$1.core.$strict>, \"settled\", false>;\n \"host.list_files\": HostDaemonCommandDescriptor<\"host.list_files\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.list_files\">;\n path: z$1.ZodString;\n query: z$1.ZodOptional;\n limit: z$1.ZodNumber;\n }, z$1.core.$strip>, z$1.ZodObject<{\n files: z$1.ZodArray>;\n truncated: z$1.ZodBoolean;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"host.list_paths\": HostDaemonCommandDescriptor<\"host.list_paths\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.list_paths\">;\n path: z$1.ZodString;\n query: z$1.ZodOptional;\n limit: z$1.ZodNumber;\n includeFiles: z$1.ZodBoolean;\n includeDirectories: z$1.ZodBoolean;\n }, z$1.core.$strip>, z$1.ZodObject<{\n paths: z$1.ZodArray;\n path: z$1.ZodString;\n name: z$1.ZodString;\n score: z$1.ZodNumber;\n positions: z$1.ZodArray;\n }, z$1.core.$strip>>;\n truncated: z$1.ZodBoolean;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"host.mkdir\": HostDaemonCommandDescriptor<\"host.mkdir\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.mkdir\">;\n path: z$1.ZodString;\n rootPath: z$1.ZodOptional;\n recursive: z$1.ZodBoolean;\n }, z$1.core.$strict>, z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n }, z$1.core.$strict>, \"onlineRpc\", false>;\n \"host.move_path\": HostDaemonCommandDescriptor<\"host.move_path\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.move_path\">;\n sourcePath: z$1.ZodString;\n destinationPath: z$1.ZodString;\n rootPath: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n }, z$1.core.$strict>, \"onlineRpc\", false>;\n \"host.remove_path\": HostDaemonCommandDescriptor<\"host.remove_path\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.remove_path\">;\n path: z$1.ZodString;\n rootPath: z$1.ZodOptional;\n recursive: z$1.ZodBoolean;\n }, z$1.core.$strict>, z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n }, z$1.core.$strict>, \"onlineRpc\", false>;\n \"host.browse_directory\": HostDaemonCommandDescriptor<\"host.browse_directory\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.browse_directory\">;\n path: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n directory: z$1.ZodString;\n parent: z$1.ZodNullable;\n entries: z$1.ZodArray;\n name: z$1.ZodString;\n path: z$1.ZodString;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"host.paths_exist\": HostDaemonCommandDescriptor<\"host.paths_exist\", z$1.ZodObject<{\n paths: z$1.ZodPipe, z$1.ZodTransform>;\n type: z$1.ZodLiteral<\"host.paths_exist\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n existence: z$1.ZodRecord;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"project.inspect\": HostDaemonCommandDescriptor<\"project.inspect\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"project.inspect\">;\n path: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n path: z$1.ZodString;\n gitRemoteUrl: z$1.ZodNullable;\n }, z$1.core.$strict>, \"onlineRpc\", true>;\n \"project.clone_default_path\": HostDaemonCommandDescriptor<\"project.clone_default_path\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"project.clone_default_path\">;\n projectSlug: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n path: z$1.ZodString;\n }, z$1.core.$strict>, \"onlineRpc\", true>;\n \"host.pick_folder\": HostDaemonCommandDescriptor<\"host.pick_folder\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.pick_folder\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, \"onlineRpc\", false>;\n \"host.caffeinate\": HostDaemonCommandDescriptor<\"host.caffeinate\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.caffeinate\">;\n enabled: z$1.ZodBoolean;\n }, z$1.core.$strict>, z$1.ZodObject<{\n enabled: z$1.ZodBoolean;\n supported: z$1.ZodBoolean;\n }, z$1.core.$strict>, \"onlineRpc\", false>;\n \"connect-tunnel.ensure-identity\": HostDaemonCommandDescriptor<\"connect-tunnel.ensure-identity\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"connect-tunnel.ensure-identity\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n label: z$1.ZodString;\n baseDomain: z$1.ZodString;\n }, z$1.core.$strict>, \"onlineRpc\", true>;\n \"host.list_commands\": HostDaemonCommandDescriptor<\"host.list_commands\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.list_commands\">;\n providerId: z$1.ZodString;\n cwd: z$1.ZodNullable;\n }, z$1.core.$strict>, z$1.ZodObject<{\n commands: z$1.ZodArray;\n origin: z$1.ZodEnum<{\n project: \"project\";\n user: \"user\";\n }>;\n description: z$1.ZodNullable;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"host.list_skills\": HostDaemonCommandDescriptor<\"host.list_skills\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.list_skills\">;\n providerId: z$1.ZodString;\n cwd: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n skills: z$1.ZodArray;\n filePath: z$1.ZodString;\n rootKind: z$1.ZodEnum<{\n plugin: \"plugin\";\n \"bb-project\": \"bb-project\";\n \"bb-data-dir\": \"bb-data-dir\";\n \"bb-builtin\": \"bb-builtin\";\n \"provider-project\": \"provider-project\";\n \"provider-user\": \"provider-user\";\n }>;\n linked: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"host.delete_skill\": HostDaemonCommandDescriptor<\"host.delete_skill\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.delete_skill\">;\n scope: z$1.ZodEnum<{\n \"bb-project\": \"bb-project\";\n \"bb-user\": \"bb-user\";\n \"claude-user\": \"claude-user\";\n \"claude-project\": \"claude-project\";\n \"codex-user\": \"codex-user\";\n \"codex-project\": \"codex-project\";\n }>;\n name: z$1.ZodString;\n cwd: z$1.ZodNullable;\n rootPath: z$1.ZodNullable;\n }, z$1.core.$strict>, z$1.ZodObject<{\n deletedPath: z$1.ZodString;\n }, z$1.core.$strip>, \"onlineRpc\", false>;\n \"host.write_skill\": HostDaemonCommandDescriptor<\"host.write_skill\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.write_skill\">;\n scope: z$1.ZodEnum<{\n \"bb-project\": \"bb-project\";\n \"bb-user\": \"bb-user\";\n }>;\n name: z$1.ZodString;\n cwd: z$1.ZodNullable;\n content: z$1.ZodString;\n expectedSha256: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"written\">;\n filePath: z$1.ZodString;\n sha256: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"conflict\">;\n currentSha256: z$1.ZodNullable;\n }, z$1.core.$strip>], \"outcome\">, \"onlineRpc\", false>;\n \"host.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>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n installations: z$1.ZodArray>;\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;\n }, z$1.core.$strict>, z$1.ZodObject<{\n entries: z$1.ZodArray;\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;\n selectedBranch: z$1.ZodOptional;\n limit: z$1.ZodNumber;\n }, z$1.core.$strip>, z$1.ZodObject<{\n branches: z$1.ZodArray;\n branchesTruncated: z$1.ZodBoolean;\n checkout: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"branch\">;\n branchName: z$1.ZodString;\n headSha: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"detached\">;\n headSha: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unborn\">;\n branchName: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unknown\">;\n reason: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">;\n defaultBranch: z$1.ZodNullable;\n defaultBranchRelation: z$1.ZodNullable>;\n hasUncommittedChanges: z$1.ZodBoolean;\n operation: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"none\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"merge\">;\n hasConflicts: z$1.ZodBoolean;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"rebase\">;\n hasConflicts: z$1.ZodBoolean;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"cherry-pick\">;\n hasConflicts: z$1.ZodBoolean;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"revert\">;\n hasConflicts: z$1.ZodBoolean;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unknown\">;\n reason: z$1.ZodString;\n hasConflicts: z$1.ZodBoolean;\n }, z$1.core.$strip>], \"kind\">;\n originDefaultBranch: z$1.ZodNullable;\n remoteBranches: z$1.ZodArray;\n remoteBranchesTruncated: z$1.ZodBoolean;\n selectedBranch: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"host.file_metadata\": HostDaemonCommandDescriptor<\"host.file_metadata\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.file_metadata\">;\n path: z$1.ZodString;\n rootPath: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodObject<{\n path: z$1.ZodString;\n modifiedAtMs: z$1.ZodNumber;\n sizeBytes: z$1.ZodNumber;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"host.read_file\": HostDaemonCommandDescriptor<\"host.read_file\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.read_file\">;\n path: z$1.ZodString;\n rootPath: z$1.ZodOptional;\n ref: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n path: z$1.ZodString;\n content: z$1.ZodString;\n contentEncoding: z$1.ZodEnum<{\n base64: \"base64\";\n utf8: \"utf8\";\n }>;\n mimeType: z$1.ZodOptional;\n sizeBytes: z$1.ZodNumber;\n modifiedAtMs: z$1.ZodOptional;\n sha256: z$1.ZodString;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"host.read_file_relative\": HostDaemonCommandDescriptor<\"host.read_file_relative\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.read_file_relative\">;\n rootPath: z$1.ZodString;\n path: z$1.ZodString;\n dotfiles: z$1.ZodEnum<{\n deny: \"deny\";\n allow: \"allow\";\n }>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n path: z$1.ZodString;\n content: z$1.ZodString;\n contentEncoding: z$1.ZodEnum<{\n base64: \"base64\";\n utf8: \"utf8\";\n }>;\n mimeType: z$1.ZodOptional;\n sizeBytes: z$1.ZodNumber;\n modifiedAtMs: z$1.ZodOptional;\n sha256: z$1.ZodString;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"host.write_file\": HostDaemonCommandDescriptor<\"host.write_file\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.write_file\">;\n path: z$1.ZodString;\n rootPath: z$1.ZodOptional;\n content: z$1.ZodString;\n contentEncoding: z$1.ZodEnum<{\n base64: \"base64\";\n utf8: \"utf8\";\n }>;\n createParents: z$1.ZodBoolean;\n expectedSha256: z$1.ZodOptional>;\n mode: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"written\">;\n sha256: z$1.ZodString;\n sizeBytes: z$1.ZodNumber;\n }, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"conflict\">;\n currentSha256: z$1.ZodNullable;\n }, z$1.core.$strict>], \"outcome\">, \"onlineRpc\", false>;\n \"provider.list_models\": HostDaemonCommandDescriptor<\"provider.list_models\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"provider.list_models\">;\n providerId: z$1.ZodString;\n acpLaunchSpec: z$1.ZodOptional;\n env: z$1.ZodRecord;\n cwd: z$1.ZodOptional;\n modelCli: z$1.ZodOptional;\n selectFlag: z$1.ZodOptional;\n primaryModels: z$1.ZodArray;\n }, z$1.core.$strict>, z$1.ZodTransform<{\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n } | undefined, {\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n }>>>;\n reasoningCli: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n nativeReasoning: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n permissionCli: z$1.ZodOptional>;\n workspaceWrite: z$1.ZodOptional>;\n readonly: z$1.ZodOptional>;\n insertAfterArgs: z$1.ZodOptional;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n models: z$1.ZodArray;\n description: z$1.ZodString;\n }, z$1.core.$strip>>;\n defaultReasoningEffort: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n isDefault: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n selectedOnlyModels: z$1.ZodArray;\n description: z$1.ZodString;\n }, z$1.core.$strip>>;\n defaultReasoningEffort: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n isDefault: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"known_acp_agents.status\": HostDaemonCommandDescriptor<\"known_acp_agents.status\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"known_acp_agents.status\">;\n agents: z$1.ZodArray>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n agents: z$1.ZodArray;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>, \"onlineRpc\", true>;\n \"provider.usage\": HostDaemonCommandDescriptor<\"provider.usage\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"provider.usage\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n codex: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n status: z$1.ZodLiteral<\"ok\">;\n accountEmail: z$1.ZodNullable;\n planLabel: z$1.ZodNullable;\n windows: z$1.ZodArray;\n cost: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"not_installed\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"unauthenticated\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"expired\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"error\">;\n message: z$1.ZodString;\n planLabel: z$1.ZodDefault>;\n accountEmail: z$1.ZodDefault>;\n }, z$1.core.$strip>], \"status\">;\n claudeCode: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n status: z$1.ZodLiteral<\"ok\">;\n accountEmail: z$1.ZodNullable;\n planLabel: z$1.ZodNullable;\n windows: z$1.ZodArray;\n cost: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"not_installed\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"unauthenticated\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"expired\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"error\">;\n message: z$1.ZodString;\n planLabel: z$1.ZodDefault>;\n accountEmail: z$1.ZodDefault>;\n }, z$1.core.$strip>], \"status\">;\n cursor: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n status: z$1.ZodLiteral<\"ok\">;\n accountEmail: z$1.ZodNullable;\n planLabel: z$1.ZodNullable;\n windows: z$1.ZodArray;\n cost: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"not_installed\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"unauthenticated\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"expired\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"error\">;\n message: z$1.ZodString;\n planLabel: z$1.ZodDefault>;\n accountEmail: z$1.ZodDefault>;\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;\n agentSeen: z$1.ZodBoolean;\n agentSeenAt: z$1.ZodNullable;\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.ZodObject<{\n displayName: z$1.ZodString;\n executableName: z$1.ZodString;\n executablePath: z$1.ZodNullable;\n installed: z$1.ZodBoolean;\n installSource: z$1.ZodEnum<{\n notInstalled: \"notInstalled\";\n npmGlobal: \"npmGlobal\";\n external: \"external\";\n }>;\n currentVersion: z$1.ZodNullable;\n latestVersion: z$1.ZodNullable;\n minimumSupportedVersion: z$1.ZodNullable;\n npmPackageName: z$1.ZodNullable;\n npmGlobalPackageVersion: z$1.ZodNullable;\n installAction: z$1.ZodNullable;\n label: z$1.ZodEnum<{\n Install: \"Install\";\n Update: \"Update\";\n }>;\n commandKind: z$1.ZodEnum<{\n exec: \"exec\";\n shell: \"shell\";\n }>;\n command: z$1.ZodString;\n }, z$1.core.$strip>>;\n needsUpdate: z$1.ZodBoolean;\n versionUnsupported: z$1.ZodBoolean;\n }, z$1.core.$strip>>, \"onlineRpc\", true>;\n \"provider_cli.install\": HostDaemonCommandDescriptor<\"provider_cli.install\", z$1.ZodObject<{\n provider: z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>;\n actionKind: z$1.ZodEnum<{\n install: \"install\";\n update: \"update\";\n }>;\n type: z$1.ZodLiteral<\"provider_cli.install\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n events: z$1.ZodArray;\n provider: z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>;\n command: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"output\">;\n provider: z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>;\n stream: z$1.ZodEnum<{\n stdout: \"stdout\";\n stderr: \"stderr\";\n }>;\n text: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"completed\">;\n provider: z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>;\n exitCode: z$1.ZodNullable;\n signal: z$1.ZodNullable;\n success: z$1.ZodBoolean;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"error\">;\n provider: z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>;\n message: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">>;\n }, z$1.core.$strict>, \"onlineRpc\", false>;\n \"workspace.status\": HostDaemonCommandDescriptor<\"workspace.status\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.status\">;\n mergeBaseBranch: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n workspaceStatus: z$1.ZodObject<{\n workingTree: z$1.ZodObject<{\n insertions: z$1.ZodNumber;\n deletions: z$1.ZodNumber;\n files: z$1.ZodArray;\n insertions: z$1.ZodNullable;\n deletions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n hasUncommittedChanges: z$1.ZodBoolean;\n state: z$1.ZodEnum<{\n clean: \"clean\";\n untracked: \"untracked\";\n dirty_uncommitted: \"dirty_uncommitted\";\n committed_unmerged: \"committed_unmerged\";\n dirty_and_committed_unmerged: \"dirty_and_committed_unmerged\";\n }>;\n }, z$1.core.$strip>;\n checkout: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"branch\">;\n branchName: z$1.ZodString;\n headSha: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"detached\">;\n headSha: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unborn\">;\n branchName: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unknown\">;\n reason: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">;\n branch: z$1.ZodObject<{\n currentBranch: z$1.ZodNullable;\n defaultBranch: z$1.ZodString;\n }, z$1.core.$strip>;\n mergeBase: z$1.ZodNullable;\n insertions: z$1.ZodNullable;\n deletions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n mergeBaseBranch: z$1.ZodString;\n baseRef: z$1.ZodNullable;\n aheadCount: z$1.ZodNumber;\n behindCount: z$1.ZodNumber;\n hasCommittedUnmergedChanges: z$1.ZodBoolean;\n commits: z$1.ZodArray>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"unavailable\">;\n failure: z$1.ZodObject<{\n code: z$1.ZodEnum<{\n unknown: \"unknown\";\n path_not_found: \"path_not_found\";\n not_git_repo: \"not_git_repo\";\n not_worktree: \"not_worktree\";\n workspace_type_mismatch: \"workspace_type_mismatch\";\n permission_denied: \"permission_denied\";\n unknown_environment: \"unknown_environment\";\n }>;\n workspacePath: z$1.ZodString;\n message: z$1.ZodString;\n }, z$1.core.$strict>;\n }, z$1.core.$strict>], \"outcome\">, \"onlineRpc\", true>;\n \"workspace.diff\": HostDaemonCommandDescriptor<\"workspace.diff\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.diff\">;\n target: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"uncommitted\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"branch_committed\">;\n mergeBaseBranch: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"all\">;\n mergeBaseBranch: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"commit\">;\n sha: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">;\n maxDiffBytes: z$1.ZodNumber;\n maxFileListBytes: z$1.ZodNumber;\n }, z$1.core.$strict>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n diff: z$1.ZodObject<{\n diff: z$1.ZodString;\n truncated: z$1.ZodBoolean;\n shortstat: z$1.ZodString;\n files: z$1.ZodString;\n mergeBaseRef: z$1.ZodNullable;\n }, z$1.core.$strip>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"unavailable\">;\n failure: z$1.ZodObject<{\n code: z$1.ZodEnum<{\n unknown: \"unknown\";\n path_not_found: \"path_not_found\";\n not_git_repo: \"not_git_repo\";\n not_worktree: \"not_worktree\";\n workspace_type_mismatch: \"workspace_type_mismatch\";\n permission_denied: \"permission_denied\";\n unknown_environment: \"unknown_environment\";\n }>;\n workspacePath: z$1.ZodString;\n message: z$1.ZodString;\n }, z$1.core.$strict>;\n }, z$1.core.$strict>], \"outcome\">, \"onlineRpc\", true>;\n \"workspace.diffFiles\": HostDaemonCommandDescriptor<\"workspace.diffFiles\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.diffFiles\">;\n target: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"uncommitted\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"branch_committed\">;\n mergeBaseBranch: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"all\">;\n mergeBaseBranch: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"commit\">;\n sha: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">;\n }, z$1.core.$strict>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n files: z$1.ZodArray;\n statusLetter: z$1.ZodEnum<{\n M: \"M\";\n A: \"A\";\n D: \"D\";\n R: \"R\";\n C: \"C\";\n T: \"T\";\n }>;\n additions: z$1.ZodNumber;\n deletions: z$1.ZodNumber;\n binary: z$1.ZodBoolean;\n origin: z$1.ZodEnum<{\n untracked: \"untracked\";\n tracked: \"tracked\";\n }>;\n }, z$1.core.$strip>>;\n shortstat: z$1.ZodString;\n mergeBaseRef: z$1.ZodNullable;\n }, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"unavailable\">;\n failure: z$1.ZodObject<{\n code: z$1.ZodEnum<{\n unknown: \"unknown\";\n path_not_found: \"path_not_found\";\n not_git_repo: \"not_git_repo\";\n not_worktree: \"not_worktree\";\n workspace_type_mismatch: \"workspace_type_mismatch\";\n permission_denied: \"permission_denied\";\n unknown_environment: \"unknown_environment\";\n }>;\n workspacePath: z$1.ZodString;\n message: z$1.ZodString;\n }, z$1.core.$strict>;\n }, z$1.core.$strict>], \"outcome\">, \"onlineRpc\", true>;\n \"workspace.diffPatch\": HostDaemonCommandDescriptor<\"workspace.diffPatch\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.diffPatch\">;\n target: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"uncommitted\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"branch_committed\">;\n mergeBaseBranch: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"all\">;\n mergeBaseBranch: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"commit\">;\n sha: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">;\n paths: z$1.ZodArray;\n maxBytesPerFile: z$1.ZodNumber;\n }, z$1.core.$strict>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n patches: z$1.ZodArray>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"unavailable\">;\n failure: z$1.ZodObject<{\n code: z$1.ZodEnum<{\n unknown: \"unknown\";\n path_not_found: \"path_not_found\";\n not_git_repo: \"not_git_repo\";\n not_worktree: \"not_worktree\";\n workspace_type_mismatch: \"workspace_type_mismatch\";\n permission_denied: \"permission_denied\";\n unknown_environment: \"unknown_environment\";\n }>;\n workspacePath: z$1.ZodString;\n message: z$1.ZodString;\n }, z$1.core.$strict>;\n }, z$1.core.$strict>], \"outcome\">, \"onlineRpc\", true>;\n \"workspace.pull_request\": HostDaemonCommandDescriptor<\"workspace.pull_request\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.pull_request\">;\n }, z$1.core.$strict>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n pullRequest: z$1.ZodObject<{\n number: z$1.ZodNumber;\n title: z$1.ZodString;\n state: z$1.ZodEnum<{\n OPEN: \"OPEN\";\n CLOSED: \"CLOSED\";\n MERGED: \"MERGED\";\n }>;\n url: z$1.ZodString;\n isDraft: z$1.ZodBoolean;\n baseRefName: z$1.ZodString;\n headRefName: z$1.ZodString;\n updatedAt: z$1.ZodString;\n checks: z$1.ZodArray;\n conclusion: z$1.ZodNullable>;\n url: z$1.ZodNullable;\n }, z$1.core.$strict>>;\n reviewDecision: z$1.ZodNullable>;\n reviewRequestCount: z$1.ZodNumber;\n mergeStateStatus: z$1.ZodNullable>;\n mergeable: z$1.ZodNullable>;\n }, z$1.core.$strict>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"absent\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"unavailable\">;\n message: z$1.ZodString;\n }, z$1.core.$strict>], \"outcome\">, \"onlineRpc\", true>;\n};\ntype HostDaemonCommandRegistry = typeof hostDaemonCommandRegistry;\ntype AnyHostDaemonCommandDescriptor = HostDaemonCommandRegistry[keyof HostDaemonCommandRegistry];\ntype HostDaemonCommandDescriptorForTransport = Extract;\ntype HostDaemonResultSchemaMapForTransport = {\n [Descriptor in HostDaemonCommandDescriptorForTransport as Descriptor[\"type\"]]: Descriptor[\"resultSchema\"];\n};\ntype HostDaemonOnlineRpcResultSchemaMap = HostDaemonResultSchemaMapForTransport<\"onlineRpc\">;\ntype HostDaemonOnlineRpcResultByType = {\n [K in keyof HostDaemonOnlineRpcResultSchemaMap]: z$1.infer;\n};\n\ndeclare const pickFolderResponseSchema: z$1.ZodObject<{\n path: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype PickFolderResponse = z$1.infer;\ndeclare const pathsExistRequestSchema: z$1.ZodObject<{\n paths: z$1.ZodPipe, z$1.ZodTransform>;\n}, z$1.core.$strip>;\ntype PathsExistRequest = z$1.infer;\ndeclare const pathsExistResponseSchema: z$1.ZodObject<{\n existence: z$1.ZodRecord;\n}, z$1.core.$strip>;\ntype PathsExistResponse = z$1.infer;\ndeclare const providerCliStatusResponseSchema: z$1.ZodRecord, z$1.ZodObject<{\n displayName: z$1.ZodString;\n executableName: z$1.ZodString;\n executablePath: z$1.ZodNullable;\n installed: z$1.ZodBoolean;\n installSource: z$1.ZodEnum<{\n notInstalled: \"notInstalled\";\n npmGlobal: \"npmGlobal\";\n external: \"external\";\n }>;\n currentVersion: z$1.ZodNullable;\n latestVersion: z$1.ZodNullable;\n minimumSupportedVersion: z$1.ZodNullable;\n npmPackageName: z$1.ZodNullable;\n npmGlobalPackageVersion: z$1.ZodNullable;\n installAction: z$1.ZodNullable;\n label: z$1.ZodEnum<{\n Install: \"Install\";\n Update: \"Update\";\n }>;\n commandKind: z$1.ZodEnum<{\n exec: \"exec\";\n shell: \"shell\";\n }>;\n command: z$1.ZodString;\n }, z$1.core.$strip>>;\n needsUpdate: z$1.ZodBoolean;\n versionUnsupported: z$1.ZodBoolean;\n}, z$1.core.$strip>>;\ntype ProviderCliStatusResponse = z$1.infer;\ndeclare const providerCliInstallRequestSchema: z$1.ZodObject<{\n provider: z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>;\n actionKind: z$1.ZodEnum<{\n install: \"install\";\n update: \"update\";\n }>;\n}, z$1.core.$strip>;\ntype ProviderCliInstallRequest = z$1.infer;\ndeclare const providerCliInstallEventSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"started\">;\n provider: z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>;\n command: z$1.ZodString;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"output\">;\n provider: z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>;\n stream: z$1.ZodEnum<{\n stdout: \"stdout\";\n stderr: \"stderr\";\n }>;\n text: z$1.ZodString;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"completed\">;\n provider: z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>;\n exitCode: z$1.ZodNullable;\n signal: z$1.ZodNullable;\n success: z$1.ZodBoolean;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"error\">;\n provider: z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>;\n message: z$1.ZodString;\n}, z$1.core.$strip>], \"type\">;\ntype ProviderCliInstallEvent = z$1.infer;\n\ninterface CreateFilePreviewResponse {\n baseUrl: string;\n expiresAtMs: number;\n}\ntype HostFileReadResponse = HostDaemonOnlineRpcResultByType[\"host.read_file\"];\ntype HostFileWriteResponse = HostDaemonOnlineRpcResultByType[\"host.write_file\"];\ntype HostFileListResponse = HostDaemonOnlineRpcResultByType[\"host.list_files\"];\ntype HostPathListResponse = HostDaemonOnlineRpcResultByType[\"host.list_paths\"];\ntype HostMkdirResponse = HostDaemonOnlineRpcResultByType[\"host.mkdir\"];\ntype HostMovePathResponse = HostDaemonOnlineRpcResultByType[\"host.move_path\"];\ntype HostRemovePathResponse = HostDaemonOnlineRpcResultByType[\"host.remove_path\"];\n\n/**\n * Query for `GET /hosts/:id/directory`, the interactive path browser's\n * single-level directory read. `path` is an absolute directory on the host;\n * omitting it lists the host's home directory (the daemon resolves it, since a\n * remote caller cannot know the host's home).\n */\ndeclare const hostDirectoryQuerySchema: z$1.ZodObject<{\n path: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype HostDirectoryQuery = z$1.infer;\ndeclare const hostDirectoryListingSchema: z$1.ZodObject<{\n directory: z$1.ZodString;\n parent: z$1.ZodNullable;\n entries: z$1.ZodArray;\n name: z$1.ZodString;\n path: z$1.ZodString;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype HostDirectoryListing = z$1.infer;\n/** Project name is sent so the daemon can derive its host-local checkout path. */\ndeclare const hostCloneDefaultPathQuerySchema: z$1.ZodObject<{\n projectId: z$1.ZodString;\n}, z$1.core.$strip>;\ntype HostCloneDefaultPathQuery = z$1.infer;\ndeclare const hostCloneDefaultPathResponseSchema: z$1.ZodObject<{\n path: z$1.ZodString;\n}, z$1.core.$strict>;\ntype HostCloneDefaultPathResponse = z$1.infer;\ndeclare const createHostJoinCodeResponseSchema: z$1.ZodObject<{\n joinCode: z$1.ZodString;\n hostId: z$1.ZodString;\n expiresAt: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype CreateHostJoinCodeResponse = z$1.infer;\ndeclare const updateHostRequestSchema: z$1.ZodObject<{\n name: z$1.ZodString;\n}, z$1.core.$strict>;\ntype UpdateHostRequest = z$1.infer;\ndeclare const hostRetryUpdateResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n}, z$1.core.$strict>;\ntype HostRetryUpdateResponse = z$1.infer;\ntype HostPathsExistRequest = PathsExistRequest;\ntype HostPathsExistResponse = PathsExistResponse;\ndeclare const hostPickFolderRequestSchema: z$1.ZodObject<{\n clientHostId: z$1.ZodString;\n}, z$1.core.$strict>;\ntype HostPickFolderRequest = z$1.infer;\ntype HostPickFolderResponse = PickFolderResponse;\ntype HostProviderCliStatusResponse = ProviderCliStatusResponse;\ntype HostProviderCliInstallRequest = ProviderCliInstallRequest;\ntype HostProviderCliInstallEvent = ProviderCliInstallEvent;\n\ndeclare const pluginUpdateCheckEntrySchema: z$1.ZodObject<{\n id: z$1.ZodString;\n outcome: z$1.ZodEnum<{\n unavailable: \"unavailable\";\n incompatible: \"incompatible\";\n current: \"current\";\n \"update-available\": \"update-available\";\n pinned: \"pinned\";\n }>;\n devMode: z$1.ZodOptional>;\n installed: z$1.ZodObject<{\n version: z$1.ZodString;\n display: z$1.ZodString;\n }, z$1.core.$strip>;\n candidate: z$1.ZodOptional>;\n blocked: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n detail: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype PluginUpdateCheckEntry = z$1.infer;\ndeclare const pluginApplyUpdateResultSchema: z$1.ZodObject<{\n applied: z$1.ZodBoolean;\n from: z$1.ZodObject<{\n version: z$1.ZodString;\n display: z$1.ZodString;\n }, z$1.core.$strip>;\n to: z$1.ZodOptional>;\n outcome: z$1.ZodEnum<{\n current: \"current\";\n updated: \"updated\";\n \"rolled-back\": \"rolled-back\";\n }>;\n detail: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype PluginApplyUpdateResult$1 = z$1.infer;\ndeclare const pluginSourceDetailSchema: z$1.ZodObject<{\n requested: z$1.ZodString;\n resolved: z$1.ZodString;\n integrity: z$1.ZodOptional;\n registry: z$1.ZodOptional;\n engines: z$1.ZodObject<{\n bb: z$1.ZodOptional;\n bbPluginSdk: z$1.ZodOptional;\n }, z$1.core.$strip>;\n installedAt: z$1.ZodOptional;\n history: z$1.ZodArray>;\n}, z$1.core.$strip>;\ntype PluginSourceDetail = z$1.infer;\ndeclare const installedPluginSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n source: z$1.ZodString;\n rootDir: z$1.ZodString;\n version: z$1.ZodString;\n provenance: z$1.ZodEnum<{\n builtin: \"builtin\";\n direct: \"direct\";\n catalog: \"catalog\";\n }>;\n isOrphanedBuiltin: z$1.ZodBoolean;\n catalogEntryId: z$1.ZodOptional;\n sourceDisplay: z$1.ZodString;\n updateState: z$1.ZodObject<{\n outcome: z$1.ZodOptional>;\n availableVersion: z$1.ZodOptional;\n blockedVersion: z$1.ZodOptional;\n blockedReasons: z$1.ZodOptional>;\n lastCheckAt: z$1.ZodOptional;\n lastFailure: z$1.ZodOptional>;\n }, z$1.core.$strip>;\n enabled: z$1.ZodBoolean;\n description: z$1.ZodNullable;\n name: z$1.ZodNullable;\n icon: z$1.ZodNullable;\n iconUrl: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n error: \"error\";\n running: \"running\";\n missing: \"missing\";\n incompatible: \"incompatible\";\n disabled: \"disabled\";\n degraded: \"degraded\";\n \"needs-configuration\": \"needs-configuration\";\n }>;\n statusDetail: z$1.ZodNullable;\n handlerStats: z$1.ZodObject<{\n count: z$1.ZodNumber;\n totalMs: z$1.ZodNumber;\n maxMs: z$1.ZodNumber;\n errorCount: z$1.ZodNumber;\n }, z$1.core.$strip>;\n services: z$1.ZodArray;\n }, z$1.core.$strip>>;\n schedules: z$1.ZodArray;\n lastStatus: z$1.ZodNullable>;\n lastError: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n cliCommand: z$1.ZodNullable>;\n capabilities: z$1.ZodDefault;\n id: z$1.ZodString;\n label: z$1.ZodString;\n detail: z$1.ZodNullable;\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;\n hash: z$1.ZodString;\n sdkMajor: z$1.ZodNumber;\n sdkVersion: z$1.ZodString;\n compatible: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>;\n logoUrl: z$1.ZodNullable;\n logoDarkUrl: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype InstalledPlugin = z$1.infer;\ndeclare const pluginListResponseSchema: z$1.ZodObject<{\n plugins: z$1.ZodArray;\n isOrphanedBuiltin: z$1.ZodBoolean;\n catalogEntryId: z$1.ZodOptional;\n sourceDisplay: z$1.ZodString;\n updateState: z$1.ZodObject<{\n outcome: z$1.ZodOptional>;\n availableVersion: z$1.ZodOptional;\n blockedVersion: z$1.ZodOptional;\n blockedReasons: z$1.ZodOptional>;\n lastCheckAt: z$1.ZodOptional;\n lastFailure: z$1.ZodOptional>;\n }, z$1.core.$strip>;\n enabled: z$1.ZodBoolean;\n description: z$1.ZodNullable;\n name: z$1.ZodNullable;\n icon: z$1.ZodNullable;\n iconUrl: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n error: \"error\";\n running: \"running\";\n missing: \"missing\";\n incompatible: \"incompatible\";\n disabled: \"disabled\";\n degraded: \"degraded\";\n \"needs-configuration\": \"needs-configuration\";\n }>;\n statusDetail: z$1.ZodNullable;\n handlerStats: z$1.ZodObject<{\n count: z$1.ZodNumber;\n totalMs: z$1.ZodNumber;\n maxMs: z$1.ZodNumber;\n errorCount: z$1.ZodNumber;\n }, z$1.core.$strip>;\n services: z$1.ZodArray;\n }, z$1.core.$strip>>;\n schedules: z$1.ZodArray;\n lastStatus: z$1.ZodNullable>;\n lastError: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n cliCommand: z$1.ZodNullable>;\n capabilities: z$1.ZodDefault;\n id: z$1.ZodString;\n label: z$1.ZodString;\n detail: z$1.ZodNullable;\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;\n hash: z$1.ZodString;\n sdkMajor: z$1.ZodNumber;\n sdkVersion: z$1.ZodString;\n compatible: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>;\n logoUrl: z$1.ZodNullable;\n logoDarkUrl: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype PluginListResponse = z$1.infer;\ndeclare const pluginReloadResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n plugins: z$1.ZodArray;\n isOrphanedBuiltin: z$1.ZodBoolean;\n catalogEntryId: z$1.ZodOptional;\n sourceDisplay: z$1.ZodString;\n updateState: z$1.ZodObject<{\n outcome: z$1.ZodOptional>;\n availableVersion: z$1.ZodOptional;\n blockedVersion: z$1.ZodOptional;\n blockedReasons: z$1.ZodOptional>;\n lastCheckAt: z$1.ZodOptional;\n lastFailure: z$1.ZodOptional>;\n }, z$1.core.$strip>;\n enabled: z$1.ZodBoolean;\n description: z$1.ZodNullable;\n name: z$1.ZodNullable;\n icon: z$1.ZodNullable;\n iconUrl: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n error: \"error\";\n running: \"running\";\n missing: \"missing\";\n incompatible: \"incompatible\";\n disabled: \"disabled\";\n degraded: \"degraded\";\n \"needs-configuration\": \"needs-configuration\";\n }>;\n statusDetail: z$1.ZodNullable;\n handlerStats: z$1.ZodObject<{\n count: z$1.ZodNumber;\n totalMs: z$1.ZodNumber;\n maxMs: z$1.ZodNumber;\n errorCount: z$1.ZodNumber;\n }, z$1.core.$strip>;\n services: z$1.ZodArray;\n }, z$1.core.$strip>>;\n schedules: z$1.ZodArray;\n lastStatus: z$1.ZodNullable>;\n lastError: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n cliCommand: z$1.ZodNullable>;\n capabilities: z$1.ZodDefault;\n id: z$1.ZodString;\n label: z$1.ZodString;\n detail: z$1.ZodNullable;\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;\n hash: z$1.ZodString;\n sdkMajor: z$1.ZodNumber;\n sdkVersion: z$1.ZodString;\n compatible: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>;\n logoUrl: z$1.ZodNullable;\n logoDarkUrl: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype PluginReloadResponse = z$1.infer;\ndeclare const pluginRemoveResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n}, z$1.core.$strip>;\ntype PluginRemoveResponse = z$1.infer;\ndeclare const pluginSettingsResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n schema: z$1.ZodRecord;\n secret: z$1.ZodOptional>;\n default: z$1.ZodOptional;\n label: z$1.ZodString;\n description: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"boolean\">;\n default: z$1.ZodOptional;\n label: z$1.ZodString;\n description: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"select\">;\n options: z$1.ZodArray;\n default: z$1.ZodOptional;\n label: z$1.ZodString;\n description: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"project\">;\n default: z$1.ZodOptional;\n label: z$1.ZodString;\n description: z$1.ZodOptional;\n }, z$1.core.$strict>], \"type\">>;\n values: z$1.ZodRecord>>;\n}, z$1.core.$strip>;\ntype PluginSettingsResponse = z$1.infer;\ndeclare const pluginTokenResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n token: z$1.ZodString;\n}, z$1.core.$strip>;\ntype PluginTokenResponse = z$1.infer;\ndeclare const pluginCatalogStatusSchema: z$1.ZodObject<{\n pluginCount: z$1.ZodNumber;\n includedPluginCount: z$1.ZodNumber;\n optionalPluginCount: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype PluginCatalogStatus = z$1.infer;\ndeclare const pluginCatalogSearchResultSchema: z$1.ZodObject<{\n entryId: z$1.ZodString;\n pluginId: z$1.ZodString;\n displayName: z$1.ZodString;\n description: z$1.ZodString;\n icon: z$1.ZodNullable;\n category: z$1.ZodString;\n source: z$1.ZodString;\n installed: z$1.ZodBoolean;\n compatible: z$1.ZodBoolean;\n incompatibleReason: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype PluginCatalogSearchResult$1 = z$1.infer;\n\ndeclare const systemExecutionOptionsResponseSchema: z$1.ZodObject<{\n providers: z$1.ZodArray;\n capabilities: z$1.ZodObject<{\n supportsArchive: z$1.ZodBoolean;\n supportsRename: z$1.ZodBoolean;\n supportsServiceTier: z$1.ZodBoolean;\n supportsUserQuestion: z$1.ZodBoolean;\n supportsFork: z$1.ZodBoolean;\n supportedPermissionModes: z$1.ZodArray>;\n }, z$1.core.$strip>;\n composerActions: z$1.ZodArray;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plan\">;\n command: z$1.ZodObject<{\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n trailingText: z$1.ZodString;\n }, z$1.core.$strip>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"goal\">;\n command: z$1.ZodObject<{\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n trailingText: z$1.ZodString;\n }, z$1.core.$strip>;\n }, z$1.core.$strip>], \"kind\">>;\n available: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n permissionCeiling: z$1.ZodEnum<{\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n full: \"full\";\n }>;\n models: z$1.ZodArray;\n description: z$1.ZodString;\n }, z$1.core.$strip>>;\n defaultReasoningEffort: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n isDefault: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n selectedOnlyModels: z$1.ZodArray;\n description: z$1.ZodString;\n }, z$1.core.$strip>>;\n defaultReasoningEffort: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n isDefault: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n modelLoadError: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype SystemExecutionOptionsResponse = z$1.infer;\ndeclare const systemExecutionOptionsQuerySchema: z$1.ZodObject<{\n providerId: z$1.ZodOptional;\n hostId: z$1.ZodOptional;\n environmentId: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype SystemExecutionOptionsQuery = z$1.infer;\n/** Omission preserves the existing behavior of reading the primary machine. */\ndeclare const systemUsageLimitsQuerySchema: z$1.ZodObject<{\n hostId: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype SystemUsageLimitsQuery = z$1.infer;\ndeclare const systemVoiceTranscriptionResponseSchema: z$1.ZodObject<{\n text: z$1.ZodString;\n}, z$1.core.$strip>;\ntype SystemVoiceTranscriptionResponse = z$1.infer;\ndeclare const onboardingAgentOverviewSchema: z$1.ZodObject<{\n agents: z$1.ZodArray;\n planLabel: z$1.ZodNullable;\n accountEmail: z$1.ZodNullable;\n canInstall: z$1.ZodBoolean;\n loginCommand: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype OnboardingAgentOverview = z$1.infer;\n/** Omission reads the primary machine, matching the usage-limits route. */\ndeclare const systemOnboardingReposQuerySchema: z$1.ZodObject<{\n hostId: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype SystemOnboardingReposQuery = z$1.infer;\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;\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;\n }, z$1.core.$strict>;\n keybindings: z$1.ZodArray;\n desktopOnly: z$1.ZodBoolean;\n shortcut: z$1.ZodObject<{\n key: z$1.ZodString;\n mod: z$1.ZodBoolean;\n meta: z$1.ZodBoolean;\n control: z$1.ZodBoolean;\n alt: z$1.ZodBoolean;\n shift: z$1.ZodBoolean;\n }, z$1.core.$strict>;\n when: z$1.ZodObject<{\n all: z$1.ZodArray>;\n none: z$1.ZodArray>;\n }, z$1.core.$strict>;\n }, z$1.core.$strict>>;\n defaultKeybindings: z$1.ZodArray;\n desktopOnly: z$1.ZodBoolean;\n shortcut: z$1.ZodObject<{\n key: z$1.ZodString;\n mod: z$1.ZodBoolean;\n meta: z$1.ZodBoolean;\n control: z$1.ZodBoolean;\n alt: z$1.ZodBoolean;\n shift: z$1.ZodBoolean;\n }, z$1.core.$strict>;\n when: z$1.ZodObject<{\n all: z$1.ZodArray>;\n none: z$1.ZodArray>;\n }, z$1.core.$strict>;\n }, z$1.core.$strict>>;\n keybindingOverrides: z$1.ZodArray;\n shortcut: z$1.ZodNullable>;\n }, z$1.core.$strict>>;\n experiments: z$1.ZodObject<{\n claudeCodeMockCliTraffic: z$1.ZodBoolean;\n toolsHub: z$1.ZodBoolean;\n }, z$1.core.$strip>;\n appearance: z$1.ZodObject<{\n themeId: z$1.ZodString;\n customCss: z$1.ZodNullable;\n faviconColor: z$1.ZodEnum<{\n default: \"default\";\n red: \"red\";\n orange: \"orange\";\n yellow: \"yellow\";\n green: \"green\";\n teal: \"teal\";\n blue: \"blue\";\n purple: \"purple\";\n pink: \"pink\";\n }>;\n }, z$1.core.$strip>;\n customThemes: z$1.ZodArray;\n pluginThemes: z$1.ZodArray;\n }, z$1.core.$strip>>;\n featureFlags: z$1.ZodObject<{\n placeholder: z$1.ZodBoolean;\n timelineWindowEventBudget: z$1.ZodNumber;\n }, z$1.core.$strip>;\n hostDaemonPort: z$1.ZodNullable;\n primaryHostId: z$1.ZodNullable;\n primaryHostPlatform: z$1.ZodNullable>;\n voiceTranscriptionEnabled: z$1.ZodBoolean;\n dataDir: z$1.ZodString;\n}, z$1.core.$strip>;\ntype SystemConfigResponse = z$1.infer;\ndeclare const systemAttentionResponseSchema: z$1.ZodObject<{\n hasAttention: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype SystemAttentionResponse = z$1.infer;\n/**\n * Theme catalog: the on-disk custom-theme directory plus the discovered custom\n * themes and the active palette. Drives `bb theme list` / `bb theme dir`.\n */\ndeclare const themeCatalogResponseSchema: z$1.ZodObject<{\n dir: z$1.ZodString;\n custom: z$1.ZodArray;\n plugins: z$1.ZodArray;\n }, z$1.core.$strip>>;\n active: z$1.ZodObject<{\n themeId: z$1.ZodString;\n customCss: z$1.ZodNullable;\n faviconColor: z$1.ZodEnum<{\n default: \"default\";\n red: \"red\";\n orange: \"orange\";\n yellow: \"yellow\";\n green: \"green\";\n teal: \"teal\";\n blue: \"blue\";\n purple: \"purple\";\n pink: \"pink\";\n }>;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>;\ntype ThemeCatalogResponse = z$1.infer;\ndeclare const systemVersionResponseSchema: z$1.ZodObject<{\n currentVersion: z$1.ZodString;\n latestVersion: z$1.ZodNullable;\n source: z$1.ZodLiteral<\"npm\">;\n updateAvailable: z$1.ZodBoolean;\n isDevelopment: z$1.ZodBoolean;\n upgradeCommand: z$1.ZodString;\n}, z$1.core.$strip>;\ntype SystemVersionResponse = z$1.infer;\ndeclare const systemConfigReloadResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n}, z$1.core.$strip>;\ndeclare const systemCliSkillsStatusResponseSchema: z$1.ZodObject<{\n machines: z$1.ZodArray;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype SystemCliSkillsStatusResponse = z$1.infer;\n/** The machines to copy the built-in bb CLI skills onto. */\ndeclare const systemInstallCliSkillsRequestSchema: z$1.ZodObject<{\n hostIds: z$1.ZodArray;\n}, z$1.core.$strip>;\ntype SystemInstallCliSkillsRequest = z$1.infer;\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;\n hostId: z$1.ZodString;\n hostName: z$1.ZodString;\n installations: z$1.ZodArray>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n ok: z$1.ZodLiteral;\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;\ntype SystemConfigReloadResponse = z$1.infer;\n\ndeclare const terminalSessionSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodNullable;\n environmentId: z$1.ZodNullable;\n hostId: z$1.ZodString;\n title: z$1.ZodString;\n initialCwd: z$1.ZodString;\n cols: z$1.ZodNumber;\n rows: z$1.ZodNumber;\n status: z$1.ZodEnum<{\n starting: \"starting\";\n disconnected: \"disconnected\";\n running: \"running\";\n exited: \"exited\";\n }>;\n exitCode: z$1.ZodNullable;\n closeReason: z$1.ZodNullable>;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n lastUserInputAt: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype TerminalSession = z$1.infer;\ndeclare const terminalListResponseSchema: z$1.ZodObject<{\n sessions: z$1.ZodArray;\n environmentId: z$1.ZodNullable;\n hostId: z$1.ZodString;\n title: z$1.ZodString;\n initialCwd: z$1.ZodString;\n cols: z$1.ZodNumber;\n rows: z$1.ZodNumber;\n status: z$1.ZodEnum<{\n starting: \"starting\";\n disconnected: \"disconnected\";\n running: \"running\";\n exited: \"exited\";\n }>;\n exitCode: z$1.ZodNullable;\n closeReason: z$1.ZodNullable>;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n lastUserInputAt: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype TerminalListResponse = z$1.infer;\ndeclare const createTerminalRequestSchema: z$1.ZodObject<{\n cols: z$1.ZodNumber;\n rows: z$1.ZodNumber;\n start: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodObject<{\n mode: z$1.ZodLiteral<\"command\">;\n command: z$1.ZodString;\n }, z$1.core.$strict>], \"mode\">>;\n target: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"environment\">;\n environmentId: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"host_path\">;\n hostId: z$1.ZodString;\n cwd: z$1.ZodNullable;\n }, z$1.core.$strict>], \"kind\">;\n title: z$1.ZodOptional;\n}, z$1.core.$strict>;\ntype CreateTerminalRequest = z$1.infer;\ndeclare const updateTerminalRequestSchema: z$1.ZodObject<{\n title: z$1.ZodString;\n}, z$1.core.$strict>;\ntype UpdateTerminalRequest = z$1.infer;\ndeclare const terminalInputRequestSchema: z$1.ZodObject<{\n dataBase64: z$1.ZodString;\n}, z$1.core.$strict>;\ntype TerminalInputRequest = z$1.infer;\ndeclare const terminalResizeRequestSchema: z$1.ZodObject<{\n cols: z$1.ZodNumber;\n rows: z$1.ZodNumber;\n}, z$1.core.$strict>;\ntype TerminalResizeRequest = z$1.infer;\ndeclare const terminalOutputQuerySchema: z$1.ZodObject<{\n sinceSeq: z$1.ZodOptional>;\n tailBytes: z$1.ZodOptional>;\n limitChunks: z$1.ZodOptional>;\n}, z$1.core.$strict>;\ntype TerminalOutputQuery = z$1.infer;\ndeclare const terminalOutputResponseSchema: z$1.ZodObject<{\n chunks: z$1.ZodArray>;\n nextSeq: z$1.ZodNumber;\n truncated: z$1.ZodBoolean;\n}, z$1.core.$strict>;\ntype TerminalOutputResponse = z$1.infer;\n\ndeclare const timelineRowStatusSchema: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n}>;\ntype TimelineRowStatus = z$1.infer;\ndeclare const timelineRowBaseSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype TimelineRowBase = z$1.infer;\ndeclare const timelineConversationRowSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"conversation\">;\n text: z$1.ZodString;\n attachments: z$1.ZodNullable;\n localImagePaths: z$1.ZodArray;\n localFilePaths: z$1.ZodArray;\n }, z$1.core.$strip>>;\n role: z$1.ZodLiteral<\"user\">;\n initiator: z$1.ZodEnum<{\n user: \"user\";\n agent: \"agent\";\n system: \"system\";\n }>;\n senderThreadId: z$1.ZodNullable;\n systemMessageKind: z$1.ZodEnum<{\n \"ownership-assigned\": \"ownership-assigned\";\n \"ownership-removed\": \"ownership-removed\";\n \"child-needs-attention\": \"child-needs-attention\";\n \"child-completed\": \"child-completed\";\n \"child-failed\": \"child-failed\";\n \"child-interrupted\": \"child-interrupted\";\n \"child-outcome-batch\": \"child-outcome-batch\";\n unlabeled: \"unlabeled\";\n }>;\n systemMessageSubject: z$1.ZodNullable;\n threadId: z$1.ZodString;\n threadName: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread-batch\">;\n count: z$1.ZodNumber;\n }, z$1.core.$strip>], \"kind\">>;\n turnRequest: z$1.ZodObject<{\n kind: z$1.ZodEnum<{\n message: \"message\";\n steer: \"steer\";\n }>;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n accepted: \"accepted\";\n }>;\n }, z$1.core.$strip>;\n mentions: z$1.ZodArray, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"conversation\">;\n text: z$1.ZodString;\n attachments: z$1.ZodNullable;\n localImagePaths: z$1.ZodArray;\n localFilePaths: z$1.ZodArray;\n }, z$1.core.$strip>>;\n role: z$1.ZodLiteral<\"assistant\">;\n turnRequest: z$1.ZodNull;\n}, z$1.core.$strip>], \"role\">;\ntype TimelineConversationRow = z$1.infer;\ndeclare const timelineSystemRowSchema: z$1.ZodUnion;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"system\">;\n title: z$1.ZodString;\n detail: z$1.ZodNullable;\n status: z$1.ZodNullable>;\n systemKind: z$1.ZodEnum<{\n error: \"error\";\n debug: \"debug\";\n reconnect: \"reconnect\";\n }>;\n}, z$1.core.$strip>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"system\">;\n title: z$1.ZodString;\n detail: z$1.ZodNullable;\n status: z$1.ZodNullable>;\n systemKind: z$1.ZodLiteral<\"operation\">;\n operationKind: z$1.ZodEnum<{\n generic: \"generic\";\n compaction: \"compaction\";\n \"thread-provisioning\": \"thread-provisioning\";\n \"thread-interrupted\": \"thread-interrupted\";\n \"provider-unhandled\": \"provider-unhandled\";\n warning: \"warning\";\n deprecation: \"deprecation\";\n }>;\n completedAt: z$1.ZodNullable;\n}, z$1.core.$strip>, z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"system\">;\n title: z$1.ZodString;\n detail: z$1.ZodNullable;\n systemKind: z$1.ZodLiteral<\"operation\">;\n operationKind: z$1.ZodLiteral<\"parent-change\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n parentChange: z$1.ZodObject<{\n action: z$1.ZodEnum<{\n assign: \"assign\";\n release: \"release\";\n transfer: \"transfer\";\n }>;\n previousParentThreadId: z$1.ZodNullable;\n previousParentThreadTitle: z$1.ZodNullable;\n nextParentThreadId: z$1.ZodNullable;\n nextParentThreadTitle: z$1.ZodNullable;\n }, z$1.core.$strip>;\n completedAt: z$1.ZodNullable;\n}, z$1.core.$strip>], \"operationKind\">]>;\ntype TimelineSystemRow = z$1.infer;\ninterface TimelineWorkRowBase extends TimelineRowBase {\n kind: \"work\";\n status: TimelineRowStatus;\n}\ndeclare const timelineCommandWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"command\">;\n callId: z$1.ZodString;\n command: z$1.ZodString;\n cwd: z$1.ZodNullable;\n source: z$1.ZodNullable;\n output: z$1.ZodString;\n exitCode: z$1.ZodNullable;\n completedAt: z$1.ZodNullable;\n approvalStatus: z$1.ZodNullable>;\n activityIntents: z$1.ZodArray;\n command: z$1.ZodString;\n name: z$1.ZodString;\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"list_files\">;\n command: z$1.ZodString;\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"search\">;\n command: z$1.ZodString;\n query: z$1.ZodNullable;\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"unknown\">;\n command: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">>;\n}, z$1.core.$strip>;\ntype TimelineCommandWorkRow = z$1.infer;\ndeclare const timelineToolWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"tool\">;\n callId: z$1.ZodString;\n toolName: z$1.ZodString;\n toolArgs: z$1.ZodNullable>>>;\n statusLabels: z$1.ZodOptional>;\n output: z$1.ZodString;\n completedAt: z$1.ZodNullable;\n approvalStatus: z$1.ZodNullable>;\n activityIntents: z$1.ZodArray;\n command: z$1.ZodString;\n name: z$1.ZodString;\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"list_files\">;\n command: z$1.ZodString;\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"search\">;\n command: z$1.ZodString;\n query: z$1.ZodNullable;\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"unknown\">;\n command: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">>;\n}, z$1.core.$strip>;\ntype TimelineToolWorkRow = z$1.infer;\ndeclare const timelineFileChangeWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"file-change\">;\n callId: z$1.ZodString;\n change: z$1.ZodObject<{\n path: z$1.ZodString;\n kind: z$1.ZodNullable;\n movePath: z$1.ZodNullable;\n diff: z$1.ZodNullable;\n diffStats: z$1.ZodObject<{\n added: z$1.ZodNumber;\n removed: z$1.ZodNumber;\n }, z$1.core.$strip>;\n }, z$1.core.$strip>;\n stdout: z$1.ZodNullable;\n stderr: z$1.ZodNullable;\n approvalStatus: z$1.ZodNullable>;\n}, z$1.core.$strip>;\ntype TimelineFileChangeWorkRow = z$1.infer;\ndeclare const timelineWebSearchWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"web-search\">;\n callId: z$1.ZodString;\n queries: z$1.ZodArray;\n completedAt: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype TimelineWebSearchWorkRow = z$1.infer;\ndeclare const timelineWebFetchWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"web-fetch\">;\n callId: z$1.ZodString;\n url: z$1.ZodString;\n prompt: z$1.ZodNullable;\n pattern: z$1.ZodNullable;\n completedAt: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype TimelineWebFetchWorkRow = z$1.infer;\ndeclare const timelineImageViewWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"image-view\">;\n callId: z$1.ZodString;\n path: z$1.ZodString;\n completedAt: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype TimelineImageViewWorkRow = z$1.infer;\ndeclare const timelineApprovalWorkRowSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"approval\">;\n interactionId: z$1.ZodString;\n target: z$1.ZodObject<{\n itemId: z$1.ZodString;\n toolName: z$1.ZodNullable;\n }, z$1.core.$strip>;\n approvalKind: z$1.ZodLiteral<\"file-edit\">;\n lifecycle: z$1.ZodEnum<{\n denied: \"denied\";\n waiting: \"waiting\";\n }>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"approval\">;\n interactionId: z$1.ZodString;\n target: z$1.ZodObject<{\n itemId: z$1.ZodString;\n toolName: z$1.ZodNullable;\n }, z$1.core.$strip>;\n approvalKind: z$1.ZodLiteral<\"permission-grant\">;\n lifecycle: z$1.ZodEnum<{\n pending: \"pending\";\n interrupted: \"interrupted\";\n denied: \"denied\";\n resolving: \"resolving\";\n granted: \"granted\";\n }>;\n grantScope: z$1.ZodNullable>;\n statusReason: z$1.ZodNullable;\n}, z$1.core.$strip>], \"approvalKind\">;\ntype TimelineApprovalWorkRow = z$1.infer;\ndeclare const timelineQuestionWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"question\">;\n interactionId: z$1.ZodString;\n lifecycle: z$1.ZodEnum<{\n pending: \"pending\";\n interrupted: \"interrupted\";\n resolving: \"resolving\";\n answered: \"answered\";\n }>;\n questions: z$1.ZodArray;\n multiSelect: z$1.ZodBoolean;\n options: z$1.ZodOptional;\n }, z$1.core.$strip>>>;\n allowFreeText: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n answers: z$1.ZodNullable;\n freeText: z$1.ZodOptional;\n }, z$1.core.$strip>>>;\n statusReason: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype TimelineQuestionWorkRow = z$1.infer;\ninterface TimelineDelegationWorkRow extends TimelineWorkRowBase {\n workKind: \"delegation\";\n callId: string;\n toolName: string;\n subagentType: string | null;\n description: string | null;\n output: string;\n completedAt: number | null;\n childRows: TimelineRow[];\n}\n/**\n * A provider background task — a dynamic workflow (Claude Code Workflow tool)\n * or a backgrounded shell command (Bash run_in_background), discriminated by\n * `taskType`. The row outlives its spawning turn: progress and terminal state\n * arrive via thread-scoped events folded into this single row. `workflow` is\n * the merged phase/agent tree, present only for workflows; null for shell\n * commands and for workflows the provider reported no progress records for\n * (degraded rendering falls back to description + summary).\n */\ndeclare const timelineWorkflowWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"workflow\">;\n itemId: z$1.ZodString;\n taskType: z$1.ZodString;\n workflowName: z$1.ZodNullable;\n description: z$1.ZodString;\n taskStatus: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n running: \"running\";\n paused: \"paused\";\n failed: \"failed\";\n killed: \"killed\";\n stopped: \"stopped\";\n }>;\n workflow: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray;\n model: z$1.ZodString;\n attempt: z$1.ZodNumber;\n cached: z$1.ZodBoolean;\n lastProgressAt: z$1.ZodNumber;\n phaseIndex: z$1.ZodOptional;\n phaseTitle: z$1.ZodOptional;\n agentType: z$1.ZodOptional;\n isolation: z$1.ZodOptional;\n queuedAt: z$1.ZodOptional;\n startedAt: z$1.ZodOptional;\n lastToolName: z$1.ZodOptional;\n lastToolSummary: z$1.ZodOptional;\n promptPreview: z$1.ZodOptional;\n resultPreview: z$1.ZodOptional;\n error: z$1.ZodOptional;\n tokens: z$1.ZodOptional;\n toolCalls: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodNullable>;\n summary: z$1.ZodNullable;\n error: z$1.ZodNullable;\n completedAt: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype TimelineWorkflowWorkRow = z$1.infer;\ntype TimelineWorkRow = TimelineCommandWorkRow | TimelineToolWorkRow | TimelineFileChangeWorkRow | TimelineWebSearchWorkRow | TimelineWebFetchWorkRow | TimelineImageViewWorkRow | TimelineApprovalWorkRow | TimelineQuestionWorkRow | TimelineDelegationWorkRow | TimelineWorkflowWorkRow;\ninterface TimelineTurnRow extends TimelineRowBase {\n kind: \"turn\";\n turnId: string;\n status: TimelineRowStatus;\n summaryCount: number;\n completedAt: number | null;\n children: TimelineRow[] | null;\n}\ntype TimelineSourceRow = TimelineConversationRow | TimelineWorkRow | TimelineSystemRow;\ntype TimelineRow = TimelineSourceRow | TimelineTurnRow;\n\ndeclare const createExecutionInputSourcesSchema: z$1.ZodObject<{\n providerId: z$1.ZodOptional>;\n model: z$1.ZodOptional>;\n serviceTier: z$1.ZodOptional>;\n reasoningLevel: z$1.ZodOptional>;\n permissionMode: z$1.ZodOptional>;\n}, z$1.core.$strict>;\ntype CreateExecutionInputSources = z$1.infer;\ndeclare const createThreadRequestSchema: z$1.ZodObject<{\n projectId: z$1.ZodString;\n providerId: z$1.ZodOptional;\n origin: z$1.ZodEnum<{\n plugin: \"plugin\";\n app: \"app\";\n cli: \"cli\";\n sdk: \"sdk\";\n }>;\n originPluginId: z$1.ZodOptional;\n visibility: z$1.ZodOptional>;\n title: z$1.ZodOptional;\n input: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n model: z$1.ZodOptional;\n serviceTier: z$1.ZodOptional>;\n reasoningLevel: z$1.ZodOptional>;\n permissionMode: z$1.ZodOptional, z$1.ZodLiteral<\"workspace-write\">]>, z$1.ZodTransform<\"auto\" | \"accept-edits\" | \"full\", \"auto\" | \"accept-edits\" | \"full\" | \"workspace-write\">>>;\n executionInputSources: z$1.ZodOptional>;\n model: z$1.ZodOptional>;\n serviceTier: z$1.ZodOptional>;\n reasoningLevel: z$1.ZodOptional>;\n permissionMode: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n environment: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"reuse\">;\n environmentId: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host\">;\n hostId: z$1.ZodOptional;\n workspace: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"unmanaged\">;\n path: z$1.ZodNullable;\n branch: z$1.ZodOptional;\n name: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"new\">;\n baseBranch: z$1.ZodString;\n }, z$1.core.$strict>], \"kind\">>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"managed-worktree\">;\n baseBranch: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"named\">;\n name: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"default\">;\n }, z$1.core.$strip>], \"kind\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"personal\">;\n }, z$1.core.$strip>], \"type\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"project-default\">;\n }, z$1.core.$strip>], \"type\">;\n parentThreadId: z$1.ZodOptional;\n sectionId: z$1.ZodOptional>;\n sourceThreadId: z$1.ZodOptional;\n sourceSeqEnd: z$1.ZodOptional;\n startedOnBehalfOf: z$1.ZodDefault;\n senderThreadId: z$1.ZodString;\n }, z$1.core.$strip>>>;\n originKind: z$1.ZodDefault>>;\n childOrigin: z$1.ZodDefault>>;\n}, z$1.core.$strip>;\ntype CreateThreadRequest = z$1.infer;\ndeclare const forkThreadRequestSchema: z$1.ZodObject<{\n sourceThreadId: z$1.ZodString;\n sourceSeqEnd: z$1.ZodOptional;\n input: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>>;\n agentContextSeed: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">, z$1.ZodObject<{\n visibility: z$1.ZodLiteral<\"agent-only\">;\n }, z$1.core.$strip>>>>;\n title: z$1.ZodOptional;\n permissionMode: z$1.ZodOptional, z$1.ZodLiteral<\"workspace-write\">]>, z$1.ZodTransform<\"auto\" | \"accept-edits\" | \"full\", \"auto\" | \"accept-edits\" | \"full\" | \"workspace-write\">>>;\n visibility: z$1.ZodDefault>;\n workspace: z$1.ZodDefault>;\n origin: z$1.ZodDefault>;\n originPluginId: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype ForkThreadRequest = z$1.infer;\ndeclare const sendMessageRequestSchema: z$1.ZodObject<{\n input: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n model: z$1.ZodOptional;\n serviceTier: z$1.ZodOptional>;\n reasoningLevel: z$1.ZodOptional>;\n permissionMode: z$1.ZodOptional, z$1.ZodLiteral<\"workspace-write\">]>, z$1.ZodTransform<\"auto\" | \"accept-edits\" | \"full\", \"auto\" | \"accept-edits\" | \"full\" | \"workspace-write\">>>;\n executionInputSources: z$1.ZodOptional>;\n serviceTier: z$1.ZodOptional>;\n reasoningLevel: z$1.ZodOptional>;\n permissionMode: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n mode: z$1.ZodEnum<{\n steer: \"steer\";\n start: \"start\";\n auto: \"auto\";\n \"queue-if-active\": \"queue-if-active\";\n \"steer-if-active\": \"steer-if-active\";\n }>;\n senderThreadId: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype SendMessageRequest = z$1.infer;\ndeclare const providerRateLimitRecoveryStatusSchema: z$1.ZodObject<{\n reason: z$1.ZodEnum<{\n eligible: \"eligible\";\n \"thread-not-failed\": \"thread-not-failed\";\n \"no-failed-turn\": \"no-failed-turn\";\n \"input-not-accepted\": \"input-not-accepted\";\n \"no-rate-limit-state\": \"no-rate-limit-state\";\n \"provider-will-retry\": \"provider-will-retry\";\n \"manual-only\": \"manual-only\";\n \"output-or-side-effect-observed\": \"output-or-side-effect-observed\";\n superseded: \"superseded\";\n \"execution-unavailable\": \"execution-unavailable\";\n }>;\n scopeKey: z$1.ZodString;\n hostId: z$1.ZodString;\n rateLimits: z$1.ZodNullable;\n kind: z$1.ZodEnum<{\n unknown: \"unknown\";\n \"request-throttle\": \"request-throttle\";\n \"subscription-window\": \"subscription-window\";\n credits: \"credits\";\n \"spend-control\": \"spend-control\";\n }>;\n windows: z$1.ZodArray;\n label: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n unknown: \"unknown\";\n warning: \"warning\";\n allowed: \"allowed\";\n blocked: \"blocked\";\n }>;\n usedPercent: z$1.ZodNullable;\n resetsAtMs: z$1.ZodNullable;\n modelIds: z$1.ZodArray;\n }, z$1.core.$strip>>;\n reachedReason: z$1.ZodNullable;\n overageStatus: z$1.ZodNullable>;\n overageReason: z$1.ZodNullable;\n observedAtMs: z$1.ZodNumber;\n source: z$1.ZodEnum<{\n \"codex-account\": \"codex-account\";\n \"claude-rate-limit\": \"claude-rate-limit\";\n http: \"http\";\n }>;\n }, z$1.core.$strip>>;\n candidate: z$1.ZodNullable;\n rateLimits: z$1.ZodObject<{\n providerId: z$1.ZodString;\n status: z$1.ZodEnum<{\n unknown: \"unknown\";\n warning: \"warning\";\n allowed: \"allowed\";\n blocked: \"blocked\";\n }>;\n kind: z$1.ZodEnum<{\n unknown: \"unknown\";\n \"request-throttle\": \"request-throttle\";\n \"subscription-window\": \"subscription-window\";\n credits: \"credits\";\n \"spend-control\": \"spend-control\";\n }>;\n windows: z$1.ZodArray;\n label: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n unknown: \"unknown\";\n warning: \"warning\";\n allowed: \"allowed\";\n blocked: \"blocked\";\n }>;\n usedPercent: z$1.ZodNullable;\n resetsAtMs: z$1.ZodNullable;\n modelIds: z$1.ZodArray;\n }, z$1.core.$strip>>;\n reachedReason: z$1.ZodNullable;\n overageStatus: z$1.ZodNullable>;\n overageReason: z$1.ZodNullable;\n observedAtMs: z$1.ZodNumber;\n source: z$1.ZodEnum<{\n \"codex-account\": \"codex-account\";\n \"claude-rate-limit\": \"claude-rate-limit\";\n http: \"http\";\n }>;\n }, z$1.core.$strip>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype ProviderRateLimitRecoveryStatus = z$1.infer;\ndeclare const continueAfterProviderRateLimitResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n requestId: z$1.ZodString;\n}, z$1.core.$strip>;\ntype ContinueAfterProviderRateLimitResponse = z$1.infer;\ndeclare const createQueuedMessageRequestSchema: z$1.ZodObject<{\n input: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n model: z$1.ZodOptional;\n serviceTier: z$1.ZodOptional>;\n reasoningLevel: z$1.ZodOptional>;\n permissionMode: z$1.ZodOptional, z$1.ZodLiteral<\"workspace-write\">]>, z$1.ZodTransform<\"auto\" | \"accept-edits\" | \"full\", \"auto\" | \"accept-edits\" | \"full\" | \"workspace-write\">>>;\n executionInputSources: z$1.ZodOptional>;\n serviceTier: z$1.ZodOptional>;\n reasoningLevel: z$1.ZodOptional>;\n permissionMode: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n senderThreadId: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype CreateQueuedMessageRequest = z$1.infer;\ndeclare const updateQueuedMessageRequestSchema: z$1.ZodObject<{\n expectedUpdatedAt: z$1.ZodNumber;\n input: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n}, z$1.core.$strip>;\ntype UpdateQueuedMessageRequest = z$1.infer;\ndeclare const sendQueuedMessageRequestSchema: z$1.ZodObject<{\n mode: z$1.ZodEnum<{\n steer: \"steer\";\n auto: \"auto\";\n }>;\n}, z$1.core.$strip>;\ntype SendQueuedMessageRequest = z$1.infer;\ndeclare const reorderQueuedMessageRequestSchema: z$1.ZodObject<{\n previousQueuedMessageId: z$1.ZodNullable;\n nextQueuedMessageId: z$1.ZodNullable;\n groupBoundaryQueuedMessageId: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype ReorderQueuedMessageRequest = z$1.infer;\ndeclare const setQueuedMessageGroupBoundaryRequestSchema: z$1.ZodObject<{\n expectedGroupedPrefixQueuedMessageIds: z$1.ZodArray;\n groupBoundaryQueuedMessageId: z$1.ZodString;\n}, z$1.core.$strip>;\ntype SetQueuedMessageGroupBoundaryRequest = z$1.infer;\ndeclare const sendQueuedMessageResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n queuedMessage: z$1.ZodObject<{\n id: z$1.ZodString;\n content: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n model: z$1.ZodString;\n reasoningLevel: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n permissionMode: z$1.ZodEnum<{\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n full: \"full\";\n }>;\n serviceTier: z$1.ZodEnum<{\n default: \"default\";\n fast: \"fast\";\n }>;\n groupWithNext: z$1.ZodBoolean;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>;\ntype SendQueuedMessageResponse = z$1.infer;\ndeclare const threadListResponseSchema: z$1.ZodArray;\n providerId: z$1.ZodString;\n title: z$1.ZodNullable;\n titleFallback: z$1.ZodNullable;\n sectionId: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n error: \"error\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n }>;\n parentThreadId: z$1.ZodNullable;\n sourceThreadId: z$1.ZodNullable;\n originKind: z$1.ZodNullable>;\n childOrigin: z$1.ZodNullable>;\n originPluginId: z$1.ZodNullable;\n visibility: z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>;\n archivedAt: z$1.ZodNullable;\n pinnedAt: z$1.ZodNullable;\n deletedAt: z$1.ZodNullable;\n lastReadAt: z$1.ZodNullable;\n latestAttentionAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n runtime: z$1.ZodObject<{\n displayStatus: z$1.ZodEnum<{\n error: \"error\";\n provisioning: \"provisioning\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n \"host-reconnecting\": \"host-reconnecting\";\n \"waiting-for-host\": \"waiting-for-host\";\n }>;\n hostReconnectGraceExpiresAt: z$1.ZodNullable;\n }, z$1.core.$strip>;\n activity: z$1.ZodObject<{\n activeWorkflowCount: z$1.ZodNumber;\n activeBackgroundAgentCount: z$1.ZodNumber;\n activeBackgroundCommandCount: z$1.ZodNumber;\n activePlanModeCount: z$1.ZodNumber;\n activeGoalCount: z$1.ZodNumber;\n }, z$1.core.$strip>;\n pinSortKey: z$1.ZodNullable;\n hasPendingInteraction: z$1.ZodBoolean;\n environmentHostId: z$1.ZodNullable;\n environmentName: z$1.ZodNullable;\n environmentBranchName: z$1.ZodNullable;\n environmentWorkspaceDisplayKind: z$1.ZodEnum<{\n \"managed-worktree\": \"managed-worktree\";\n \"unmanaged-worktree\": \"unmanaged-worktree\";\n other: \"other\";\n }>;\n}, z$1.core.$strip>>;\ntype ThreadListResponse = z$1.infer;\ndeclare const threadSearchResponseSchema: z$1.ZodObject<{\n active: z$1.ZodObject<{\n total: z$1.ZodNumber;\n results: z$1.ZodArray;\n providerId: z$1.ZodString;\n title: z$1.ZodNullable;\n titleFallback: z$1.ZodNullable;\n sectionId: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n error: \"error\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n }>;\n parentThreadId: z$1.ZodNullable;\n sourceThreadId: z$1.ZodNullable;\n originKind: z$1.ZodNullable>;\n childOrigin: z$1.ZodNullable>;\n originPluginId: z$1.ZodNullable;\n visibility: z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>;\n archivedAt: z$1.ZodNullable;\n pinnedAt: z$1.ZodNullable;\n deletedAt: z$1.ZodNullable;\n lastReadAt: z$1.ZodNullable;\n latestAttentionAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n runtime: z$1.ZodObject<{\n displayStatus: z$1.ZodEnum<{\n error: \"error\";\n provisioning: \"provisioning\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n \"host-reconnecting\": \"host-reconnecting\";\n \"waiting-for-host\": \"waiting-for-host\";\n }>;\n hostReconnectGraceExpiresAt: z$1.ZodNullable;\n }, z$1.core.$strip>;\n activity: z$1.ZodObject<{\n activeWorkflowCount: z$1.ZodNumber;\n activeBackgroundAgentCount: z$1.ZodNumber;\n activeBackgroundCommandCount: z$1.ZodNumber;\n activePlanModeCount: z$1.ZodNumber;\n activeGoalCount: z$1.ZodNumber;\n }, z$1.core.$strip>;\n pinSortKey: z$1.ZodNullable;\n hasPendingInteraction: z$1.ZodBoolean;\n environmentHostId: z$1.ZodNullable;\n environmentName: z$1.ZodNullable;\n environmentBranchName: z$1.ZodNullable;\n environmentWorkspaceDisplayKind: z$1.ZodEnum<{\n \"managed-worktree\": \"managed-worktree\";\n \"unmanaged-worktree\": \"unmanaged-worktree\";\n other: \"other\";\n }>;\n }, z$1.core.$strip>;\n matches: z$1.ZodArray;\n text: z$1.ZodString;\n highlightRanges: z$1.ZodArray>;\n sourceSeq: z$1.ZodNullable;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>;\n archived: z$1.ZodObject<{\n total: z$1.ZodNumber;\n results: z$1.ZodArray;\n providerId: z$1.ZodString;\n title: z$1.ZodNullable;\n titleFallback: z$1.ZodNullable;\n sectionId: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n error: \"error\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n }>;\n parentThreadId: z$1.ZodNullable;\n sourceThreadId: z$1.ZodNullable;\n originKind: z$1.ZodNullable>;\n childOrigin: z$1.ZodNullable>;\n originPluginId: z$1.ZodNullable;\n visibility: z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>;\n archivedAt: z$1.ZodNullable;\n pinnedAt: z$1.ZodNullable;\n deletedAt: z$1.ZodNullable;\n lastReadAt: z$1.ZodNullable;\n latestAttentionAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n runtime: z$1.ZodObject<{\n displayStatus: z$1.ZodEnum<{\n error: \"error\";\n provisioning: \"provisioning\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n \"host-reconnecting\": \"host-reconnecting\";\n \"waiting-for-host\": \"waiting-for-host\";\n }>;\n hostReconnectGraceExpiresAt: z$1.ZodNullable;\n }, z$1.core.$strip>;\n activity: z$1.ZodObject<{\n activeWorkflowCount: z$1.ZodNumber;\n activeBackgroundAgentCount: z$1.ZodNumber;\n activeBackgroundCommandCount: z$1.ZodNumber;\n activePlanModeCount: z$1.ZodNumber;\n activeGoalCount: z$1.ZodNumber;\n }, z$1.core.$strip>;\n pinSortKey: z$1.ZodNullable;\n hasPendingInteraction: z$1.ZodBoolean;\n environmentHostId: z$1.ZodNullable;\n environmentName: z$1.ZodNullable;\n environmentBranchName: z$1.ZodNullable;\n environmentWorkspaceDisplayKind: z$1.ZodEnum<{\n \"managed-worktree\": \"managed-worktree\";\n \"unmanaged-worktree\": \"unmanaged-worktree\";\n other: \"other\";\n }>;\n }, z$1.core.$strip>;\n matches: z$1.ZodArray;\n text: z$1.ZodString;\n highlightRanges: z$1.ZodArray>;\n sourceSeq: z$1.ZodNullable;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>;\n}, z$1.core.$strict>;\ntype ThreadSearchResponse = z$1.infer;\ndeclare const threadResponseSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n projectId: z$1.ZodString;\n environmentId: z$1.ZodNullable;\n providerId: z$1.ZodString;\n title: z$1.ZodNullable;\n titleFallback: z$1.ZodNullable;\n sectionId: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n error: \"error\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n }>;\n parentThreadId: z$1.ZodNullable;\n sourceThreadId: z$1.ZodNullable;\n originKind: z$1.ZodNullable>;\n childOrigin: z$1.ZodNullable>;\n originPluginId: z$1.ZodNullable;\n visibility: z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>;\n archivedAt: z$1.ZodNullable;\n pinnedAt: z$1.ZodNullable;\n deletedAt: z$1.ZodNullable;\n lastReadAt: z$1.ZodNullable;\n latestAttentionAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n runtime: z$1.ZodObject<{\n displayStatus: z$1.ZodEnum<{\n error: \"error\";\n provisioning: \"provisioning\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n \"host-reconnecting\": \"host-reconnecting\";\n \"waiting-for-host\": \"waiting-for-host\";\n }>;\n hostReconnectGraceExpiresAt: z$1.ZodNullable;\n }, z$1.core.$strip>;\n canSpawnChild: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype ThreadResponse = z$1.infer;\ndeclare const threadGetQuerySchema: z$1.ZodObject<{\n include: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype ThreadGetQuery = z$1.infer;\ndeclare const threadWithIncludesResponseSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n projectId: z$1.ZodString;\n environmentId: z$1.ZodNullable;\n providerId: z$1.ZodString;\n title: z$1.ZodNullable;\n titleFallback: z$1.ZodNullable;\n sectionId: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n error: \"error\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n }>;\n parentThreadId: z$1.ZodNullable;\n sourceThreadId: z$1.ZodNullable;\n originKind: z$1.ZodNullable>;\n childOrigin: z$1.ZodNullable>;\n originPluginId: z$1.ZodNullable;\n visibility: z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>;\n archivedAt: z$1.ZodNullable;\n pinnedAt: z$1.ZodNullable;\n deletedAt: z$1.ZodNullable;\n lastReadAt: z$1.ZodNullable;\n latestAttentionAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n runtime: z$1.ZodObject<{\n displayStatus: z$1.ZodEnum<{\n error: \"error\";\n provisioning: \"provisioning\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n \"host-reconnecting\": \"host-reconnecting\";\n \"waiting-for-host\": \"waiting-for-host\";\n }>;\n hostReconnectGraceExpiresAt: z$1.ZodNullable;\n }, z$1.core.$strip>;\n canSpawnChild: z$1.ZodBoolean;\n environment: z$1.ZodOptional;\n projectId: z$1.ZodString;\n hostId: z$1.ZodString;\n path: z$1.ZodNullable;\n managed: z$1.ZodBoolean;\n isGitRepo: z$1.ZodBoolean;\n isWorktree: z$1.ZodBoolean;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n branchName: z$1.ZodNullable;\n baseBranch: z$1.ZodNullable;\n defaultBranch: z$1.ZodNullable;\n mergeBaseBranch: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n error: \"error\";\n provisioning: \"provisioning\";\n ready: \"ready\";\n retiring: \"retiring\";\n destroying: \"destroying\";\n destroyed: \"destroyed\";\n }>;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n }, z$1.core.$strip>>>;\n host: z$1.ZodOptional;\n status: z$1.ZodEnum<{\n disconnected: \"disconnected\";\n connected: \"connected\";\n }>;\n maxPermissionMode: z$1.ZodEnum<{\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n full: \"full\";\n }>;\n lastSeenAt: z$1.ZodNullable;\n lastRejectedProtocolVersion: z$1.ZodNullable;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n }, z$1.core.$strip>>>;\n}, z$1.core.$strip>;\ntype ThreadWithIncludesResponse = z$1.infer;\ndeclare const threadPendingInteractionsResponseSchema: z$1.ZodArray;\n statusReason: z$1.ZodNullable;\n createdAt: z$1.ZodNumber;\n expiresAt: z$1.ZodOptional>;\n resolvedAt: z$1.ZodNullable;\n turnId: z$1.ZodString;\n providerId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n providerRequestId: z$1.ZodString;\n origin: z$1.ZodOptional;\n providerId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n providerRequestId: z$1.ZodString;\n }, z$1.core.$strip>>;\n payload: z$1.ZodUnion;\n subject: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n itemId: z$1.ZodString;\n command: z$1.ZodString;\n cwd: z$1.ZodNullable;\n actions: z$1.ZodArray;\n command: z$1.ZodString;\n name: z$1.ZodString;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"listFiles\">;\n command: z$1.ZodString;\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"search\">;\n command: z$1.ZodString;\n query: z$1.ZodNullable;\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"unknown\">;\n command: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">>;\n sessionGrant: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"file_change\">;\n itemId: z$1.ZodString;\n writeScope: z$1.ZodNullable;\n sessionGrant: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"permission_grant\">;\n itemId: z$1.ZodString;\n toolName: z$1.ZodNullable;\n permissions: z$1.ZodObject<{\n network: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>;\n }, z$1.core.$strip>], \"kind\">;\n reason: z$1.ZodNullable;\n availableDecisions: z$1.ZodArray>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"user_question\">;\n questions: z$1.ZodArray;\n multiSelect: z$1.ZodBoolean;\n options: z$1.ZodOptional;\n }, z$1.core.$strip>>>;\n allowFreeText: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>]>;\n resolution: z$1.ZodNullable;\n grantedPermissions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"allow_for_session\">;\n grantedPermissions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"deny\">;\n }, z$1.core.$strip>], \"decision\">, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"user_answer\">;\n answers: z$1.ZodRecord;\n freeText: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>]>>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n interrupted: \"interrupted\";\n resolving: \"resolving\";\n resolved: \"resolved\";\n }>;\n statusReason: z$1.ZodNullable;\n createdAt: z$1.ZodNumber;\n expiresAt: z$1.ZodOptional>;\n resolvedAt: z$1.ZodNullable;\n turnId: z$1.ZodNullable;\n origin: z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n rendererId: z$1.ZodString;\n }, z$1.core.$strip>;\n payload: z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n title: z$1.ZodString;\n data: z$1.ZodType>;\n }, z$1.core.$strip>;\n resolution: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>]>>;\ntype ThreadPendingInteractionsResponse = z$1.infer;\ndeclare const threadQueuedMessageListResponseSchema: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n model: z$1.ZodString;\n reasoningLevel: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n permissionMode: z$1.ZodEnum<{\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n full: \"full\";\n }>;\n serviceTier: z$1.ZodEnum<{\n default: \"default\";\n fast: \"fast\";\n }>;\n groupWithNext: z$1.ZodBoolean;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n}, z$1.core.$strip>>;\ntype ThreadQueuedMessageListResponse = z$1.infer;\ndeclare const threadChildSummaryResponseSchema: z$1.ZodObject<{\n nonDeletedChildCount: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype ThreadChildSummaryResponse = z$1.infer;\ndeclare const deleteThreadRequestSchema: z$1.ZodObject<{\n childThreadsConfirmed: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype DeleteThreadRequest = z$1.infer;\ndeclare const updateThreadRequestSchema: z$1.ZodObject<{\n title: z$1.ZodOptional>;\n sectionId: z$1.ZodOptional>;\n parentThreadId: z$1.ZodOptional>;\n model: z$1.ZodOptional>;\n reasoningLevel: z$1.ZodOptional>>;\n visibility: z$1.ZodOptional>;\n}, z$1.core.$strip>;\ntype UpdateThreadRequest = z$1.infer;\ndeclare const reorderPinnedThreadRequestSchema: z$1.ZodObject<{\n previousThreadId: z$1.ZodNullable;\n nextThreadId: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype ReorderPinnedThreadRequest = z$1.infer;\n/**\n * Requested placement for a thread opened in the app's split layout. Edge\n * placements add panes through the eighth pane; at the cap they replace the\n * focused pane. `replace` always replaces the focused pane.\n */\ndeclare const threadOpenSplitSchema: z$1.ZodEnum<{\n right: \"right\";\n down: \"down\";\n left: \"left\";\n top: \"top\";\n replace: \"replace\";\n}>;\ntype ThreadOpenSplit = z$1.infer;\n/** Optional secondary-panel file to open with a thread. */\ndeclare const threadOpenFileSchema: z$1.ZodObject<{\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n path: z$1.ZodString;\n lineNumber: z$1.ZodNullable;\n}, z$1.core.$strict>;\ntype ThreadOpenFile = z$1.infer;\n/** Response for POST /threads/:id/open: how many connected clients received it. */\ndeclare const threadOpenResponseSchema: z$1.ZodObject<{\n delivered: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype ThreadOpenResponse = z$1.infer;\n/** Presentation action for one thread pane in each connected app window. */\ndeclare const threadPaneActionSchema: z$1.ZodEnum<{\n maximize: \"maximize\";\n restore: \"restore\";\n toggle: \"toggle\";\n}>;\ntype ThreadPaneAction = z$1.infer;\n/** Number of connected app clients that received the pane action. */\ndeclare const threadPaneActionResponseSchema: z$1.ZodObject<{\n delivered: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype ThreadPaneActionResponse = z$1.infer;\ndeclare const threadArchiveAllResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n archivedThreadIds: z$1.ZodArray;\n}, z$1.core.$strip>;\ntype ThreadArchiveAllResponse = z$1.infer;\ndeclare const threadListQuerySchema: z$1.ZodObject<{\n projectId: z$1.ZodOptional;\n parentThreadId: z$1.ZodOptional;\n sourceThreadId: z$1.ZodOptional;\n archived: z$1.ZodOptional>;\n sectionId: z$1.ZodOptional;\n unsectioned: z$1.ZodOptional>;\n hasParent: z$1.ZodOptional>;\n originKind: z$1.ZodOptional>;\n originPluginId: z$1.ZodOptional;\n childOrigin: z$1.ZodOptional>;\n includeHidden: z$1.ZodOptional>;\n limit: z$1.ZodOptional;\n offset: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype ThreadListQuery = z$1.infer;\ndeclare const threadSearchQuerySchema: z$1.ZodObject<{\n query: z$1.ZodString;\n limitPerGroup: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype ThreadSearchQuery = z$1.infer;\ndeclare const threadTimelineQuerySchema: z$1.ZodObject<{\n includeNestedRows: z$1.ZodOptional>;\n segmentLimit: z$1.ZodOptional;\n beforeAnchorSeq: z$1.ZodOptional;\n beforeAnchorId: z$1.ZodOptional;\n summaryOnly: z$1.ZodOptional>;\n afterSequence: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype ThreadTimelineQuery = z$1.infer;\ndeclare const timelineTurnSummaryDetailsQuerySchema: z$1.ZodObject<{\n turnId: z$1.ZodString;\n sourceSeqStart: z$1.ZodString;\n sourceSeqEnd: z$1.ZodString;\n}, z$1.core.$strip>;\ntype TimelineTurnSummaryDetailsQuery = z$1.infer;\ndeclare const threadStorageFilesQuerySchema: z$1.ZodObject<{\n query: z$1.ZodOptional;\n limit: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype ThreadStorageFilesQuery = z$1.infer;\ndeclare const threadStoragePathsQuerySchema: z$1.ZodObject<{\n query: z$1.ZodOptional;\n limit: z$1.ZodOptional;\n includeFiles: z$1.ZodEnum<{\n true: \"true\";\n false: \"false\";\n }>;\n includeDirectories: z$1.ZodEnum<{\n true: \"true\";\n false: \"false\";\n }>;\n}, z$1.core.$strip>;\ntype ThreadStoragePathsQuery = z$1.infer;\ndeclare const timelineTurnSummaryDetailsResponseSchema: z$1.ZodObject<{\n rows: z$1.ZodArray>>;\n}, z$1.core.$strip>;\ntype TimelineTurnSummaryDetailsResponse = z$1.infer;\ndeclare const threadTimelineResponseSchema: z$1.ZodObject<{\n rows: z$1.ZodArray>>;\n activePromptMode: z$1.ZodNullable;\n providerId: z$1.ZodEnum<{\n \"claude-code\": \"claude-code\";\n codex: \"codex\";\n }>;\n prompt: z$1.ZodString;\n }, z$1.core.$strict>>;\n activeThinking: z$1.ZodNullable>;\n activeWorkflows: z$1.ZodArray;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"workflow\">;\n itemId: z$1.ZodString;\n taskType: z$1.ZodString;\n workflowName: z$1.ZodNullable;\n description: z$1.ZodString;\n taskStatus: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n running: \"running\";\n paused: \"paused\";\n failed: \"failed\";\n killed: \"killed\";\n stopped: \"stopped\";\n }>;\n workflow: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray;\n model: z$1.ZodString;\n attempt: z$1.ZodNumber;\n cached: z$1.ZodBoolean;\n lastProgressAt: z$1.ZodNumber;\n phaseIndex: z$1.ZodOptional;\n phaseTitle: z$1.ZodOptional;\n agentType: z$1.ZodOptional;\n isolation: z$1.ZodOptional;\n queuedAt: z$1.ZodOptional;\n startedAt: z$1.ZodOptional;\n lastToolName: z$1.ZodOptional;\n lastToolSummary: z$1.ZodOptional;\n promptPreview: z$1.ZodOptional;\n resultPreview: z$1.ZodOptional;\n error: z$1.ZodOptional;\n tokens: z$1.ZodOptional;\n toolCalls: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodNullable>;\n summary: z$1.ZodNullable;\n error: z$1.ZodNullable;\n completedAt: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n activeBackgroundCommands: z$1.ZodArray;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"workflow\">;\n itemId: z$1.ZodString;\n taskType: z$1.ZodString;\n workflowName: z$1.ZodNullable;\n description: z$1.ZodString;\n taskStatus: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n running: \"running\";\n paused: \"paused\";\n failed: \"failed\";\n killed: \"killed\";\n stopped: \"stopped\";\n }>;\n workflow: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray;\n model: z$1.ZodString;\n attempt: z$1.ZodNumber;\n cached: z$1.ZodBoolean;\n lastProgressAt: z$1.ZodNumber;\n phaseIndex: z$1.ZodOptional;\n phaseTitle: z$1.ZodOptional;\n agentType: z$1.ZodOptional;\n isolation: z$1.ZodOptional;\n queuedAt: z$1.ZodOptional;\n startedAt: z$1.ZodOptional;\n lastToolName: z$1.ZodOptional;\n lastToolSummary: z$1.ZodOptional;\n promptPreview: z$1.ZodOptional;\n resultPreview: z$1.ZodOptional;\n error: z$1.ZodOptional;\n tokens: z$1.ZodOptional;\n toolCalls: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodNullable>;\n summary: z$1.ZodNullable;\n error: z$1.ZodNullable;\n completedAt: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n pendingTodos: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n goal: z$1.ZodNullable;\n tokenBudget: z$1.ZodNullable;\n tokensUsed: z$1.ZodNumber;\n timeUsedSeconds: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n modelFallback: z$1.ZodNullable;\n message: z$1.ZodString;\n }, z$1.core.$strip>>;\n contextWindowUsage: z$1.ZodOptional>;\n timelinePage: z$1.ZodObject<{\n kind: z$1.ZodEnum<{\n latest: \"latest\";\n older: \"older\";\n }>;\n segmentLimit: z$1.ZodNumber;\n returnedSegmentCount: z$1.ZodNumber;\n hasOlderRows: z$1.ZodBoolean;\n olderCursor: z$1.ZodNullable>;\n }, z$1.core.$strict>;\n maxSeq: z$1.ZodNumber;\n delta: z$1.ZodOptional>>;\n rowOrder: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype ThreadTimelineResponse = z$1.infer;\ndeclare const threadConversationOutlineResponseSchema: z$1.ZodObject<{\n items: z$1.ZodArray;\n preview: z$1.ZodString;\n attachmentSummary: z$1.ZodNullable>;\n }, z$1.core.$strict>>;\n maxSeq: z$1.ZodNumber;\n}, z$1.core.$strict>;\ntype ThreadConversationOutlineResponse = z$1.infer;\ndeclare const threadStorageFileListResponseSchema: z$1.ZodObject<{\n files: z$1.ZodArray>;\n truncated: z$1.ZodBoolean;\n storageRootPath: z$1.ZodString;\n}, z$1.core.$strip>;\ntype ThreadStorageFileListResponse = z$1.infer;\ndeclare const threadStoragePathListResponseSchema: z$1.ZodObject<{\n paths: z$1.ZodArray;\n path: z$1.ZodString;\n name: z$1.ZodString;\n score: z$1.ZodNumber;\n positions: z$1.ZodArray;\n }, z$1.core.$strip>>;\n truncated: z$1.ZodBoolean;\n storageRootPath: z$1.ZodString;\n}, z$1.core.$strip>;\ntype ThreadStoragePathListResponse = z$1.infer;\n\ndeclare const threadTabsResponseSchema: z$1.ZodObject<{\n revision: z$1.ZodNumber;\n tabs: z$1.ZodArray;\n }, z$1.core.$strict>, z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"git-diff\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n actionId: z$1.ZodString;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"plugin-panel\">;\n paramsJson: z$1.ZodNullable;\n pluginId: z$1.ZodString;\n title: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"workspace-file-preview\">;\n lineRange: z$1.ZodNullable>;\n path: z$1.ZodString;\n projectId: z$1.ZodNullable;\n source: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"working-tree\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"head\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"merge-base\">;\n ref: z$1.ZodString;\n }, z$1.core.$strict>], \"kind\">;\n statusLabel: z$1.ZodNullable>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"host-file-preview\">;\n lineRange: z$1.ZodNullable>;\n path: z$1.ZodString;\n threadId: z$1.ZodNullable;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable;\n id: z$1.ZodString;\n isPinned: z$1.ZodBoolean;\n kind: z$1.ZodLiteral<\"thread-storage-file-preview\">;\n lineRange: z$1.ZodNullable>;\n path: z$1.ZodString;\n threadId: z$1.ZodNullable;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"browser\">;\n title: z$1.ZodNullable;\n url: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"new-tab\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"side-chat\">;\n sourceMessageText: z$1.ZodString;\n sourceSeqEnd: z$1.ZodNullable;\n threadId: z$1.ZodNullable;\n title: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"terminal\">;\n terminalId: z$1.ZodString;\n }, z$1.core.$strict>], \"kind\">>;\n}, z$1.core.$strict>;\ntype ThreadTabsResponse = z$1.infer;\ndeclare const updateThreadTabsRequestSchema: z$1.ZodObject<{\n expectedRevision: z$1.ZodNumber;\n tabs: z$1.ZodArray;\n }, z$1.core.$strict>, z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"git-diff\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n actionId: z$1.ZodString;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"plugin-panel\">;\n paramsJson: z$1.ZodNullable;\n pluginId: z$1.ZodString;\n title: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"workspace-file-preview\">;\n lineRange: z$1.ZodNullable>;\n path: z$1.ZodString;\n projectId: z$1.ZodNullable;\n source: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"working-tree\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"head\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"merge-base\">;\n ref: z$1.ZodString;\n }, z$1.core.$strict>], \"kind\">;\n statusLabel: z$1.ZodNullable>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"host-file-preview\">;\n lineRange: z$1.ZodNullable>;\n path: z$1.ZodString;\n threadId: z$1.ZodNullable;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable;\n id: z$1.ZodString;\n isPinned: z$1.ZodBoolean;\n kind: z$1.ZodLiteral<\"thread-storage-file-preview\">;\n lineRange: z$1.ZodNullable>;\n path: z$1.ZodString;\n threadId: z$1.ZodNullable;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"browser\">;\n title: z$1.ZodNullable;\n url: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"new-tab\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"side-chat\">;\n sourceMessageText: z$1.ZodString;\n sourceSeqEnd: z$1.ZodNullable;\n threadId: z$1.ZodNullable;\n title: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"terminal\">;\n terminalId: z$1.ZodString;\n }, z$1.core.$strict>], \"kind\">>;\n}, z$1.core.$strict>;\ntype UpdateThreadTabsRequest = z$1.infer;\n\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 {\n readonly \"~standard\": {\n readonly version: 1;\n readonly vendor: string;\n readonly validate: (value: unknown) => StandardSchemaV1Result | Promise>;\n readonly types?: {\n readonly input: Input;\n readonly output: Output;\n };\n };\n}\ntype StandardSchemaV1Result = {\n readonly value: Output;\n readonly issues?: undefined;\n} | {\n readonly issues: readonly StandardSchemaV1Issue[];\n};\ninterface StandardSchemaV1Issue {\n readonly message: string;\n readonly path?: PropertyKey | readonly (PropertyKey | {\n readonly key: PropertyKey;\n })[];\n}\ntype StandardSchemaV1InferInput = NonNullable[\"input\"];\ntype StandardSchemaV1InferOutput = NonNullable[\"output\"];\ninterface PluginRpcMethodContract {\n readonly input: InputSchema;\n readonly output: OutputSchema;\n}\ntype PluginRpcContract = Readonly>;\n/** Define a shared RPC contract while preserving exact method/schema types. */\ndeclare function defineRpcContract(contract: Contract): Contract;\ntype PluginRpcHandlers = {\n [Method in keyof Contract]: (input: StandardSchemaV1InferOutput) => StandardSchemaV1InferInput | Promise>;\n};\ntype PluginRpcCallInput = StandardSchemaV1InferInput;\ntype PluginRpcCallArgs = null extends PluginRpcCallInput ? [input?: PluginRpcCallInput] : [input: PluginRpcCallInput];\ntype PluginRpcResult = StandardSchemaV1InferOutput;\n\n/**\n * The `@bb/plugin-sdk/app` contract (plugin design §5.2) — pure types with no\n * side effects. The BB app imports these to keep its real implementation in\n * sync (`satisfies PluginSdkApp`). Plugin authors import the same shapes through\n * `@bb/plugin-sdk/app`.\n *\n * Per-slot props are versioned contracts: additive-only within an SDK major.\n */\n/** Props passed to a `homepageSection` component. */\ninterface PluginHomepageSectionProps {\n /** Project in view on the compose surface; null when none is selected. */\n projectId: string | null;\n}\n/**\n * Props passed to a `settingsSection` component.\n *\n * Deliberately empty in V1; versioned additive like the other slot props.\n */\ninterface PluginSettingsSectionProps {\n}\n/** Props passed to a `navPanel` component (it owns its whole route). */\ninterface PluginNavPanelProps {\n /**\n * The route remainder after the panel root, \"\" at the root. The panel's\n * route is `/plugins///*`, so a deep link like\n * `/plugins/notes/notes/work/ideas.md` renders the panel with\n * `subPath: \"work/ideas.md\"`. Navigate within the panel via\n * `useBbNavigate().toPluginPanel(path, { subPath })` — browser\n * back/forward then walks panel-internal history.\n */\n subPath: string;\n}\n/** Props passed to a panel tab opened by a `threadPanelAction`. */\ninterface PluginThreadPanelProps {\n threadId: string;\n /**\n * The JSON value the action's `openPanel` call passed (round-tripped\n * through persistence, so the tab restores across reloads); null when the\n * action opened the panel without params.\n */\n params: JsonValue | null;\n}\ninterface PluginPendingInteractionView {\n id: string;\n threadId: string;\n title: string;\n payload: JsonValue;\n createdAt: number;\n expiresAt: number | null;\n}\ninterface PluginPendingInteractionProps {\n interaction: PluginPendingInteractionView;\n submit(value: JsonValue): Promise;\n cancel(): Promise;\n}\n/**\n * Props for a `sidebarFooterAction` — host-rendered (no plugin component).\n * Deliberately empty; the registration's `run` carries the behavior.\n */\ninterface PluginSidebarFooterActionProps {\n}\n/**\n * 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>;\n /** Original directive source text (useful for diagnostics / crash fallback). */\n source: string;\n message: PluginMessageDirectiveMessage;\n /**\n * Opens a worktree-relative file in the host's workspace file viewer. Null\n * when the message surface has no workspace viewer available.\n */\n openWorkspaceFile: PluginMessageDirectiveOpenWorkspaceFile | null;\n}\ninterface PluginHomepageSectionRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n title: string;\n component: ComponentType;\n}\ninterface PluginSettingsSectionRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Optional host-rendered section heading. */\n title?: string;\n /**\n * Optional one-line host-rendered subheading under `title`, in the built-in\n * SettingsSection idiom (ignored when `title` is absent).\n */\n description?: string;\n component: ComponentType;\n}\ninterface PluginNavPanelRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n title: string;\n /** Icon hint (BB icon name); unknown names fall back to a generic icon. */\n icon: string;\n /** URL segment under `/plugins//`; letters, digits, `-`, `_`. */\n path: string;\n component: ComponentType;\n /**\n * Optional component rendered on the right side of the shared title bar\n * (e.g. a sync button or a count). Contained separately from the body: a\n * throwing headerContent is hidden without breaking the title bar.\n */\n headerContent?: ComponentType;\n}\n/** Context handed to a `threadPanelAction`'s `run`. */\ninterface PluginThreadPanelActionContext {\n /** The thread whose panel launcher invoked the action. */\n threadId: string;\n /**\n * Open a tab in the thread's side panel rendering this action's\n * `component`. `title` labels the tab (default: the action's `title`);\n * `params` must be JSON-serializable — it is persisted with the tab and\n * reaches the component as its `params` prop. Opening with params\n * identical to an already-open tab of this action focuses that tab\n * (updating its title) instead of duplicating it. May be called more than\n * once (different params ⇒ multiple tabs) or not at all.\n */\n openPanel(options?: {\n title?: string;\n params?: JsonValue;\n }): void;\n}\ninterface PluginThreadPanelActionRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Label of the action row in the panel's new-tab launcher. */\n title: string;\n /**\n * Icon hint (BB icon name) used when the plugin ships no logo; the\n * launcher row and opened tabs prefer the plugin's logo.\n */\n icon?: string;\n /** Rendered inside every panel tab this action opens. */\n component: ComponentType;\n /**\n * How the host frames the tab content. \"padded\" (default) wraps the\n * component in the panel's scroll container with standard padding —\n * right for document-like content. \"flush\" gives the component the full\n * tab area (no padding, definite height, no host scrolling) — right for\n * app-like content that manages its own layout, such as\n * `ThreadChat`.\n */\n layout?: \"padded\" | \"flush\";\n /**\n * Runs when the user activates the action: call your RPC methods, show a\n * toast, and/or open panel tabs via `context.openPanel`. Omitted =\n * immediately open a panel tab with defaults. Errors (sync or async) are\n * contained and logged; they never break the launcher.\n */\n run?(context: PluginThreadPanelActionContext): void | Promise;\n}\ninterface PluginPendingInteractionRegistration {\n /** Matches `rendererId` passed to `bb.ui.requestInput`. */\n id: string;\n component: ComponentType;\n}\n/** Context handed to a `sidebarFooterAction`'s `run`. */\ninterface PluginSidebarFooterActionContext {\n /**\n * Navigate to this plugin's detail page in Tools, where declarative settings\n * and `settingsSection` slots render.\n */\n openSettings(): void;\n}\n/**\n * An icon button in the app sidebar footer (next to Settings / bug report).\n * Host-rendered for consistent chrome — plugins supply icon, label, and\n * `run` behavior only.\n */\ninterface PluginSidebarFooterActionRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Tooltip and accessible label for the icon button. */\n title: string;\n /** Icon hint (BB icon name); unknown names fall back to a generic icon. */\n icon: string;\n /**\n * Runs when the user activates the action (e.g. call `openSettings()`,\n * open a panel via other surfaces, toast). Errors (sync or async) are\n * contained and logged; they never break the sidebar.\n */\n run(context: PluginSidebarFooterActionContext): void | Promise;\n}\n/**\n * 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;\n setRead(threadId: string, read: boolean): Promise;\n /** Silent rename — no dialog. For inline editing in your own row. */\n rename(threadId: string, title: string): Promise;\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;\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) => 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;\n}\n/**\n * Register this plugin as a viewer/editor for file extensions. The user\n * picks (and can set as default) an opener per extension via the file tab's\n * \"Open with\" menu; matching files opened in the panel then render\n * `component` in a plugin tab instead of the built-in preview. Applies to\n * working-tree, host, and thread-storage files — never to git-ref snapshots\n * (diff views always use the built-in preview). The built-in preview stays\n * one menu click away, and a missing/disabled opener falls back to it.\n */\ninterface PluginFileOpenerRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Label in the \"Open with\" menu (e.g. \"Notes editor\"). */\n title: string;\n /** Lowercase extensions without the dot (e.g. [\"md\", \"mdx\"]). */\n extensions: readonly string[];\n component: ComponentType;\n}\n/**\n * Register a leaf message directive rendered inside assistant (and nested\n * agent) message Markdown. `id` is the directive name: `inline-vis` matches\n * `::inline-vis{file=\"demo.html\"}`.\n */\ninterface PluginMessageDirectiveRegistration {\n /**\n * The directive name. Lowercase kebab-case beginning with a letter.\n */\n id: string;\n component: ComponentType;\n}\n/**\n * A narrow, stable reference to one rendered chat message — NOT an internal\n * timeline row. `sourceSeqEnd` is the last source event sequence the message\n * covers, the anchor the server accepts for provider-history forks.\n */\ninterface ThreadChatMessageReference {\n id: string;\n threadId: string;\n role: \"user\" | \"assistant\";\n /** Visible text of the message. */\n text: string;\n sourceSeqEnd: number;\n}\ninterface PluginMessageActionThreadPanelOptions {\n /** A `threadPanelAction` id registered by this same plugin. */\n actionId: string;\n title?: string;\n params?: JsonValue;\n}\n/** Context handed to a `messageAction`'s `run`. */\ninterface PluginMessageActionContext {\n /** The thread whose timeline surfaced the action. */\n threadId: string;\n message: ThreadChatMessageReference;\n /**\n * Present only when the action was invoked from the text-selection menu;\n * the exact text the user highlighted inside `message`.\n */\n selectedText?: string;\n /**\n * Open one of this plugin's `threadPanelAction` components in the current\n * thread's side panel — the registration-callback equivalent of\n * `useBbNavigate().openThreadPanel`. Returns true when the host\n * accepted (the action id exists and the surface has a panel); false\n * otherwise.\n */\n openPanel(options: PluginMessageActionThreadPanelOptions): boolean;\n}\n/**\n * An action on chat messages: an icon button in the per-message action bar\n * (user and assistant messages) and an entry in the assistant-message\n * text-selection menu. Host-rendered chrome — the plugin supplies title,\n * icon hint, and `run` behavior only.\n */\ninterface PluginMessageActionRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Tooltip / menu label for the action. */\n title: string;\n /** Icon hint (BB icon name); unknown names fall back to a generic icon. */\n icon?: string;\n /**\n * Runs when the user activates the action. Errors (sync or async) are\n * contained and logged; they never break the timeline.\n */\n run(context: PluginMessageActionContext): void | Promise;\n}\ninterface PluginAppSlots {\n homepageSection(registration: PluginHomepageSectionRegistration): void;\n settingsSection(registration: PluginSettingsSectionRegistration): void;\n navPanel(registration: PluginNavPanelRegistration): void;\n threadPanelAction(registration: PluginThreadPanelActionRegistration): void;\n pendingInteraction(registration: PluginPendingInteractionRegistration): void;\n sidebarFooterAction(registration: PluginSidebarFooterActionRegistration): void;\n /**\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;\n/**\n * Trusted same-origin JavaScript/TypeScript mounted once per active frontend\n * generation in each bb app window or browser tab.\n */\ninterface PluginContentScriptRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /**\n * Install behavior into the bb app shell. The host awaits a returned\n * promise, contains failures, and calls the returned disposer exactly once.\n */\n mount(context: PluginContentScriptContext): void | PluginContentScriptDisposer | Promise;\n}\n/** 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 {\n /**\n * Invoke one of the plugin's `bb.rpc` methods (POST\n * /api/v1/plugins/<id>/rpc/<method>). Resolves with the method's\n * inferred output; rejects with an `Error` carrying the server's message,\n * stable `code`, and validation `issues` when present.\n */\n call>(method: Method, ...args: PluginRpcCallArgs): Promise>;\n}\ninterface PluginSettingsState {\n /**\n * Effective non-secret setting values (secret settings are excluded —\n * read them server-side). Undefined while loading or unavailable.\n */\n values: Record | undefined;\n isLoading: boolean;\n}\n/** State of the app's shared realtime connection to the bb server. */\ntype PluginRealtimeConnectionState = \"connecting\" | \"connected\" | \"reconnecting\";\n/** Where `useComposer()` writes. */\ntype PluginComposerScope = {\n kind: \"thread\";\n threadId: string;\n} | {\n kind: \"queued-message\";\n threadId: string;\n queuedMessageId: string;\n} | {\n kind: \"side-chat\";\n projectId: string;\n parentThreadId: string;\n tabId: string;\n childThreadId: string | null;\n} | {\n kind: \"new-thread\";\n /** Root compose's effective selected project; null only while unresolved. */\n projectId: string | null;\n};\n/** One plugin-owned composer customization registration. */\ninterface ComposerCustomization {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Composer kinds where this customization is active; omit for all kinds. */\n scopes?: readonly PluginComposerScope[\"kind\"][];\n actions?: readonly {\n id: string;\n component: ComponentType;\n }[];\n banners?: readonly {\n id: string;\n /** Host chrome around the banner. Defaults to `\"card\"`. */\n chrome?: \"card\" | \"bare\";\n component: ComponentType;\n }[];\n plusMenu?: readonly ComposerPlusMenuItem[];\n richText?: ComposerRichTextSpec;\n}\n/** Host-rendered menu row in the composer's `+` menu. */\ninterface ComposerPlusMenuItem {\n id: string;\n label: string;\n /** BB icon name; unknown names fall back to the generic plugin icon. */\n icon?: string;\n /** Accessible description for the host-rendered row. */\n description?: string;\n disabled?: boolean | ((view: ComposerView) => boolean);\n run(context: {\n composer: PluginComposerApi;\n view: ComposerView;\n }): void | Promise;\n}\n/** Reactive read-side of the composer a plugin surface is mounted in. */\ninterface ComposerView {\n scope: PluginComposerScope;\n layout: \"expanded\" | \"compact\" | \"zen\";\n draft: {\n text: string;\n isEmpty: boolean;\n attachmentCount: number;\n };\n run: {\n isRunning: boolean;\n isSubmitting: boolean;\n };\n}\ninterface ComposerRichTextSpec {\n /** Content-derived paint: match ranges receive `className`; text is never mutated. */\n effects?: readonly {\n id: string;\n /** Plain-text offsets into the current structured draft. */\n match(text: string): readonly {\n from: number;\n to: number;\n }[];\n className: string;\n }[];\n /** Debounced, read-only observation of the structured draft. */\n onDraftChange?(draft: ComposerStructuredDraft, view: ComposerView): void;\n}\ninterface ComposerStructuredDraft {\n text: string;\n mentions: readonly {\n from: number;\n to: number;\n provider: string;\n id: string;\n label: string;\n }[];\n}\n/** Host-rendered paint applied to the editable composer text. */\ninterface PluginComposerTextEffect {\n className: string;\n}\n/** Host-rendered status that temporarily replaces a thread's draft glyph. */\ninterface PluginComposerThreadRowStatus {\n /** BB icon-name hint; unknown names fall back to the generic plugin icon. */\n icon: string;\n /** Accessible label for the status glyph. */\n label: string;\n /**\n * Semantic host treatment for the status glyph. `running` automatically\n * shimmers; terminal `success` and `error` tones are static. Defaults to the\n * neutral tone.\n */\n tone?: \"default\" | \"running\" | \"success\" | \"error\";\n}\n/** An @-mention pill bound to one of the calling plugin's mention providers. */\ninterface PluginComposerMention {\n /** Mention provider id registered by THIS plugin via `bb.ui.registerMentionProvider`. */\n provider: string;\n /** Item id your provider's `resolve` will receive at send time. */\n id: string;\n /** Pill text shown in the composer. */\n label: string;\n}\n/**\n * Programmatic access to the chat composer draft — the same shared draft the\n * built-in \"Add to chat\" affordances (file preview, diff, terminal selections)\n * write to. While a queued message is being edited, writes land in that\n * message's inline editor. In a side chat, writes land in the visible side-chat\n * draft. Otherwise, inside a thread context writes land in that thread's draft;\n * anywhere else (nav panel, homepage section) they seed the new-thread composer\n * draft, which persists until the user sends or clears it.\n */\ninterface PluginComposerApi {\n scope: PluginComposerScope;\n /** Current plain text for this composer scope. */\n readonly text: string;\n /**\n * Replace the draft's plain text. Attachments are preserved. Inline mentions\n * outside the changed range are preserved and rebased; mentions overlapped\n * by the replacement are removed because their text representation changed.\n */\n setText(next: string): void;\n /**\n * Replace the draft's plain text from the latest committed value. Uses the\n * same structured-state reconciliation as `setText`.\n */\n updateText(updater: (current: string) => string): void;\n /** Clear plain text without clearing independently attached files. */\n clear(): void;\n /**\n * Apply a host-rendered effect to this composer's editable text, or clear it.\n * Effects are scoped to the calling plugin and automatically clear when the\n * slot unmounts or its composer scope changes.\n */\n setTextEffect(effect: PluginComposerTextEffect | null): void;\n /**\n * Lock or unlock editing for this composer. Locks are scoped to the calling\n * plugin and automatically release when the slot unmounts or its composer\n * scope changes.\n */\n setInputLock(locked: boolean): void;\n /**\n * Append text to the draft as a `> ` blockquote block and focus the\n * composer. Blank text is a no-op. This is the \"reference this selection\n * in chat\" primitive.\n */\n addQuote(text: string): void;\n /**\n * Insert an @-mention pill that resolves through this plugin's mention\n * provider at send time — the durable way to reference an entity whose\n * content should be fetched fresh when the message is sent.\n */\n insertMention(mention: PluginComposerMention): void;\n /** Focus the composer caret at the end of the draft. */\n focus(): void;\n}\n/**\n * A consumer-supplied action on the messages of one `ThreadChat` instance,\n * rendered in the embedded timeline's per-message action bar alongside the\n * native and slot-registered actions. Unlike the `messageAction` slot this is\n * scoped to the rendering component, not registered globally.\n */\ninterface ThreadChatMessageAction {\n /** Unique within this ThreadChat instance; letters, digits, `-`, `_`. */\n id: string;\n /** Tooltip / menu label for the action. */\n title: string;\n /** Icon hint (BB icon name); unknown names fall back to a generic icon. */\n icon?: string;\n /**\n * Message roles the action applies to. Omitted = both user and assistant\n * messages.\n */\n roles?: readonly (\"user\" | \"assistant\")[];\n /**\n * Runs when the user activates the action. Errors (sync or async) are\n * contained and logged; they never break the timeline.\n */\n run(message: ThreadChatMessageReference): void | Promise;\n}\n/**\n * Props of the host-owned `ThreadChat` component — one thread's chat\n * (timeline, and for the composer variants the full send/queue/draft\n * engine), rendered by the BB app inside a plugin slot. This is the\n * deliberate exception to the no-host-components rule (§5.5): a stable\n * product capability, not a UI kit. Versioned additive like slot props;\n * internal timeline rows, query hooks, and prompt-box configuration are\n * deliberately not exposed.\n */\ninterface ThreadChatProps {\n threadId: string;\n /**\n * \"full\" (default) is the page presentation (centered reading width);\n * \"compact\" is the side-panel presentation; \"timeline\" renders the\n * transcript without a composer.\n */\n variant?: \"full\" | \"compact\" | \"timeline\";\n /**\n * \"contained\" (default) fills and scrolls inside a bounded parent;\n * \"document\" grows with its content and defers scrolling to the page.\n */\n layout?: \"contained\" | \"document\";\n /** Bump to focus the composer (ignored by `variant: \"timeline\"`). */\n focusRequest?: number;\n /**\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;\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(): PluginRpcClient;\n useRealtime(channel: string, handler: (payload: unknown) => void): void;\n /**\n * Observe the same shared connection that delivers `useRealtime` signals.\n * Use a subsequent transition to `connected` to reconcile server state that\n * may have changed while ephemeral signals could not be delivered. The first\n * connection can transition from `connecting` and is not a reconnection.\n */\n useRealtimeConnectionState(): PluginRealtimeConnectionState;\n useSettings(): PluginSettingsState;\n useBbContext(): BbContext;\n useBbNavigate(): BbNavigate;\n useComposer(): PluginComposerApi;\n /**\n * The 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;\n /**\n * The host-owned chat-message markdown renderer (see\n * {@link MarkdownProps}).\n */\n Markdown: ComponentType;\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;\n useComposerView(): ComposerView;\n}\n\ninterface EnvironmentActionArgs {\n environmentId: string;\n}\ninterface EnvironmentGetArgs extends EnvironmentActionArgs {\n signal?: AbortSignal;\n}\ntype EnvironmentMergeBaseBranchUpdateValue = Exclude;\ntype EnvironmentNameUpdateValue = Exclude;\ninterface EnvironmentMergeBaseBranchUpdate {\n mergeBaseBranch: EnvironmentMergeBaseBranchUpdateValue;\n name?: EnvironmentNameUpdateValue;\n}\ninterface EnvironmentNameUpdate {\n mergeBaseBranch?: EnvironmentMergeBaseBranchUpdateValue;\n name: EnvironmentNameUpdateValue;\n}\ntype EnvironmentUpdateFields = EnvironmentMergeBaseBranchUpdate | EnvironmentNameUpdate;\ntype EnvironmentUpdateArgs = EnvironmentUpdateFields & {\n environmentId: string;\n};\ninterface EnvironmentStatusArgs extends EnvironmentStatusQuery {\n environmentId: string;\n signal?: AbortSignal;\n}\ntype EnvironmentDiffArgs = EnvironmentDiffQuery & {\n environmentId: string;\n signal?: AbortSignal;\n};\ntype EnvironmentDiffFileArgs = EnvironmentDiffFileQuery & {\n environmentId: string;\n signal?: AbortSignal;\n};\ninterface EnvironmentDiffBranchesArgs extends EnvironmentDiffBranchesQuery {\n environmentId: string;\n signal?: AbortSignal;\n}\ninterface EnvironmentCommitArgs {\n environmentId: string;\n}\ninterface EnvironmentSquashMergeArgs {\n environmentId: string;\n mergeBaseBranch: string;\n}\ninterface EnvironmentPullRequestMergeArgs {\n environmentId: string;\n method: PullRequestMergeMethod;\n}\ntype EnvironmentDiffPatchArgs = EnvironmentDiffPatchRequest & {\n environmentId: string;\n signal?: AbortSignal;\n};\ninterface EnvironmentPathsArgs extends EnvironmentPathsQuery {\n environmentId: string;\n signal?: AbortSignal;\n}\ntype EnvironmentArchiveThreadsResult = EnvironmentArchiveThreadsResponse;\ntype EnvironmentCommitResult = CommitActionResponse;\ntype EnvironmentDiffResult = EnvironmentDiffResponse;\ntype EnvironmentDiffBranchesResult = EnvironmentDiffBranchesResponse;\ntype EnvironmentDiffFileResult = EnvironmentDiffFileResponse;\ntype EnvironmentDiffFilesResult = EnvironmentDiffFilesResponse;\ntype EnvironmentDiffPatchResult = EnvironmentDiffPatchResponse;\ntype EnvironmentGetResult = Environment;\ntype EnvironmentMarkPullRequestDraftResult = PullRequestDraftActionResponse;\ntype EnvironmentMarkPullRequestReadyResult = PullRequestReadyActionResponse;\ntype EnvironmentMergePullRequestResult = PullRequestMergeActionResponse;\ntype EnvironmentPathsResult = WorkspacePathListResponse;\ntype EnvironmentPullRequestResult = EnvironmentPullRequestResponse;\ntype EnvironmentSquashMergeResult = SquashMergeActionResponse;\ntype EnvironmentStatusResult = EnvironmentStatusResponse;\ntype EnvironmentUpdateResult = Environment;\ninterface EnvironmentsArea {\n archiveThreads(args: EnvironmentActionArgs): Promise;\n commit(args: EnvironmentCommitArgs): Promise;\n diff(args: EnvironmentDiffArgs): Promise;\n diffBranches(args: EnvironmentDiffBranchesArgs): Promise;\n diffFile(args: EnvironmentDiffFileArgs): Promise;\n diffFiles(args: EnvironmentDiffArgs): Promise;\n diffPatch(args: EnvironmentDiffPatchArgs): Promise;\n get(args: EnvironmentGetArgs): Promise;\n pullRequest(args: EnvironmentGetArgs): Promise;\n markPullRequestDraft(args: EnvironmentActionArgs): Promise;\n markPullRequestReady(args: EnvironmentActionArgs): Promise;\n mergePullRequest(args: EnvironmentPullRequestMergeArgs): Promise;\n paths(args: EnvironmentPathsArgs): Promise;\n squashMerge(args: EnvironmentSquashMergeArgs): Promise;\n status(args: EnvironmentStatusArgs): Promise;\n update(args: EnvironmentUpdateArgs): Promise;\n}\n\n/**\n * Host file primitives. `hostId` may be omitted to target the server's\n * primary (local) host. `rootPath`, when set, confines the target beneath\n * that absolute root on the host (symlink-safe).\n */\ninterface FileReadArgs {\n hostId?: string;\n path: string;\n rootPath?: string;\n signal?: AbortSignal;\n}\ninterface FileWriteArgs {\n hostId?: string;\n path: string;\n rootPath?: string;\n content: string;\n /** Defaults to \"utf8\". */\n contentEncoding?: \"utf8\" | \"base64\";\n /** Defaults to false. */\n createParents?: boolean;\n /**\n * Optimistic-concurrency guard: omitted → unconditional write; a hash →\n * write only when the current content hashes to it (use `read().sha256`);\n * null → create-only. A failed guard resolves to the `conflict` outcome.\n */\n expectedSha256?: string | null;\n /** POSIX permission bits used when creating a file (for example 0o600). */\n mode?: number;\n}\ninterface FileListArgs {\n hostId?: string;\n path: string;\n query?: string;\n limit?: number;\n signal?: AbortSignal;\n}\ninterface PathListArgs extends FileListArgs {\n includeFiles: boolean;\n includeDirectories: boolean;\n}\ninterface FileMkdirArgs {\n hostId?: string;\n path: string;\n rootPath?: string;\n recursive?: boolean;\n}\ninterface FileMoveArgs {\n hostId?: string;\n sourcePath: string;\n destinationPath: string;\n rootPath?: string;\n}\ninterface FileRemoveArgs {\n hostId?: string;\n path: string;\n rootPath?: string;\n recursive?: boolean;\n}\ninterface FilePreviewArgs {\n hostId?: string;\n rootPath: string;\n signal?: AbortSignal;\n ttlMs?: number;\n}\ntype FileReadResult = HostFileReadResponse;\ntype FileWriteResult = HostFileWriteResponse;\ntype FileListResult = HostFileListResponse;\ntype PathListResult = HostPathListResponse;\ntype FileMkdirResult = HostMkdirResponse;\ntype FileMoveResult = HostMovePathResponse;\ntype FileRemoveResult = HostRemovePathResponse;\ntype FilePreviewResult = CreateFilePreviewResponse;\ninterface FilesArea {\n read(args: FileReadArgs): Promise;\n write(args: FileWriteArgs): Promise;\n list(args: FileListArgs): Promise;\n listPaths(args: PathListArgs): Promise;\n mkdir(args: FileMkdirArgs): Promise;\n move(args: FileMoveArgs): Promise;\n remove(args: FileRemoveArgs): Promise;\n createPreview(args: FilePreviewArgs): Promise;\n}\n\ninterface GuideRenderArgs {\n chapter?: string;\n}\ninterface GuideRenderResult {\n chapter?: string;\n content: string;\n}\ninterface GuideArea {\n render(args?: GuideRenderArgs): GuideRenderResult;\n}\n\ninterface HostGetArgs {\n hostId: string;\n signal?: AbortSignal;\n}\ninterface HostDeleteArgs {\n hostId: string;\n}\ninterface HostUpdateArgs extends UpdateHostRequest {\n hostId: string;\n}\ninterface HostRetryUpdateArgs {\n hostId: string;\n}\ninterface HostDirectoryArgs extends HostDirectoryQuery {\n hostId: string;\n signal?: AbortSignal;\n}\ninterface HostCloneDefaultPathArgs extends HostCloneDefaultPathQuery {\n hostId: string;\n signal?: AbortSignal;\n}\ninterface HostPathsExistArgs extends HostPathsExistRequest {\n hostId: string;\n signal?: AbortSignal;\n}\ninterface HostPickFolderArgs extends HostPickFolderRequest {\n hostId: string;\n signal?: AbortSignal;\n}\ninterface HostProviderCliInstallArgs extends HostProviderCliInstallRequest {\n hostId: string;\n}\ninterface HostListArgs {\n signal?: AbortSignal;\n}\ntype HostCreateJoinCodeResult = CreateHostJoinCodeResponse;\ntype HostDeleteResult = {\n ok: true;\n};\ntype HostDirectoryResult = HostDirectoryListing;\ntype HostGetResult = Host;\ntype HostCloneDefaultPathResult = HostCloneDefaultPathResponse;\ntype HostProviderCliInstallResult = HostProviderCliInstallEvent[];\ntype HostListResult = Host[];\ntype HostPathsExistResult = HostPathsExistResponse;\ntype HostPickFolderResult = HostPickFolderResponse;\ntype HostProviderCliStatusResult = HostProviderCliStatusResponse;\ntype HostRetryUpdateResult = HostRetryUpdateResponse;\ntype HostUpdateResult = Host;\ninterface HostsArea {\n createJoinCode(): Promise;\n delete(args: HostDeleteArgs): Promise;\n directory(args: HostDirectoryArgs): Promise;\n get(args: HostGetArgs): Promise;\n cloneDefaultPath(args: HostCloneDefaultPathArgs): Promise;\n installProviderCli(args: HostProviderCliInstallArgs): Promise;\n list(args?: HostListArgs): Promise;\n pathsExist(args: HostPathsExistArgs): Promise;\n pickFolder(args: HostPickFolderArgs): Promise;\n providerCliStatus(args: HostGetArgs): Promise;\n retryUpdate(args: HostRetryUpdateArgs): Promise;\n update(args: HostUpdateArgs): Promise;\n}\n\ninterface ProjectListArgs {\n include?: ProjectListQuery[\"include\"];\n /** Include the singleton personal project. Defaults to false for compatibility. */\n includePersonal?: boolean;\n signal?: AbortSignal;\n}\ninterface ProjectCreateArgs extends CreateProjectRequest {\n}\ninterface ProjectGetArgs {\n projectId: string;\n signal?: AbortSignal;\n}\ninterface ProjectUpdateArgs extends UpdateProjectRequest {\n projectId: string;\n}\ninterface ProjectDeleteArgs {\n projectId: string;\n}\ninterface ProjectReorderArgs extends ReorderProjectRequest {\n projectId: string;\n}\ninterface ProjectPromptHistoryArgs extends PromptHistoryQuery {\n projectId: string;\n signal?: AbortSignal;\n}\n/** Select one project workspace source, or omit both for the primary host. */\ntype ProjectWorkspaceRoutingArgs = {\n environmentId: string;\n hostId?: never;\n} | {\n environmentId?: never;\n hostId: string;\n} | {\n environmentId?: never;\n hostId?: never;\n};\ntype ProjectFilesArgs = ProjectWorkspaceRoutingArgs & Omit & {\n projectId: string;\n signal?: AbortSignal;\n};\ntype ProjectPathsArgs = ProjectWorkspaceRoutingArgs & Omit & {\n projectId: string;\n signal?: AbortSignal;\n};\ntype ProjectCommandsArgs = ProjectWorkspaceRoutingArgs & Omit & {\n projectId: string;\n signal?: AbortSignal;\n};\ntype ProjectFileContentArgs = ProjectWorkspaceRoutingArgs & Omit & {\n projectId: string;\n signal?: AbortSignal;\n};\ninterface ProjectBranchesArgs extends ProjectBranchesQuery {\n projectId: string;\n signal?: AbortSignal;\n}\ninterface ProjectDefaultExecutionOptionsArgs {\n projectId: string;\n signal?: AbortSignal;\n}\ninterface ProjectAttachmentFileLike {\n arrayBuffer(): Promise;\n readonly name: string;\n readonly type?: string;\n}\ninterface ProjectAttachmentUploadArgsBase {\n /** MIME override. Omit to use the File/Blob type, when available. */\n mimeType?: string;\n projectId: string;\n}\n/**\n * Upload bytes owned by this SDK client. A bare Blob/byte buffer needs an\n * explicit filename; File-like values can supply their own name.\n */\ntype ProjectAttachmentUploadArgs = ProjectAttachmentUploadArgsBase & ({\n clientFile: ProjectAttachmentFileLike;\n filename?: string;\n} | {\n clientFile: ArrayBuffer | Blob | Uint8Array;\n filename: string;\n});\ninterface ProjectAttachmentReadArgs {\n path: string;\n projectId: string;\n signal?: AbortSignal;\n}\ninterface ProjectAttachmentCopyArgs extends CopyProjectAttachmentsRequest {\n projectId: string;\n}\ntype ProjectSourceAddArgs = CreateProjectSourceRequest & {\n projectId: string;\n};\ninterface ProjectSourceUpdateArgs extends UpdateProjectSourceRequest {\n projectId: string;\n sourceId: string;\n}\ninterface ProjectSourceDeleteArgs {\n projectId: string;\n sourceId: string;\n}\ntype ProjectBranchesResult = ProjectBranchesResponse;\ninterface ProjectAttachmentReadResult {\n bytes: Uint8Array;\n mimeType: string;\n sizeBytes: number;\n}\ntype ProjectAttachmentUploadResult = UploadedPromptAttachment;\ntype ProjectCommandsResult = CommandListResponse;\ntype ProjectCreateResult = ProjectResponse;\ntype ProjectDefaultExecutionOptionsResult = ProjectExecutionDefaults | null;\ntype ProjectDeleteResult = {\n ok: true;\n};\ninterface ProjectFileContentResult {\n /** UTF-8 text or base64, as selected by `contentEncoding`. */\n content: string;\n contentEncoding: \"utf8\" | \"base64\";\n mimeType: string;\n sizeBytes: number;\n}\ntype ProjectFilesResult = WorkspaceFileListResponse;\ntype ProjectGetResult = ProjectResponse;\ntype ProjectListResult = ProjectResponse[] | ProjectWithThreadsResponse[];\ntype ProjectPathsResult = WorkspacePathListResponse;\ntype ProjectPromptHistoryResult = PromptHistoryResponse;\ntype ProjectReorderResult = ProjectResponse[];\ntype ProjectSourceAddResult = ProjectSource;\ntype ProjectSourceDeleteResult = {\n ok: true;\n};\ntype ProjectSourceUpdateResult = ProjectSource;\ntype ProjectUpdateResult = ProjectResponse;\ninterface ProjectSourcesArea {\n add(args: ProjectSourceAddArgs): Promise;\n delete(args: ProjectSourceDeleteArgs): Promise;\n update(args: ProjectSourceUpdateArgs): Promise;\n}\ninterface ProjectAttachmentsArea {\n copy(args: ProjectAttachmentCopyArgs): Promise;\n read(args: ProjectAttachmentReadArgs): Promise;\n upload(args: ProjectAttachmentUploadArgs): Promise;\n}\ninterface ProjectsArea {\n attachments: ProjectAttachmentsArea;\n branches(args: ProjectBranchesArgs): Promise;\n commands(args: ProjectCommandsArgs): Promise;\n create(args: ProjectCreateArgs): Promise;\n defaultExecutionOptions(args: ProjectDefaultExecutionOptionsArgs): Promise;\n delete(args: ProjectDeleteArgs): Promise;\n fileContent(args: ProjectFileContentArgs): Promise;\n files(args: ProjectFilesArgs): Promise;\n get(args: ProjectGetArgs): Promise;\n list(args?: ProjectListArgs): Promise;\n paths(args: ProjectPathsArgs): Promise;\n promptHistory(args: ProjectPromptHistoryArgs): Promise;\n reorder(args: ProjectReorderArgs): Promise;\n sources: ProjectSourcesArea;\n update(args: ProjectUpdateArgs): Promise;\n}\n\n/** Select exactly one provider-discovery host source, or omit both for primary. */\ntype ProviderHostRoutingArgs = {\n environmentId: string;\n hostId?: never;\n} | {\n environmentId?: never;\n hostId: string;\n} | {\n environmentId?: never;\n hostId?: never;\n};\ntype ProviderListArgs = ProviderHostRoutingArgs & {\n signal?: AbortSignal;\n};\ntype ProviderModelsArgs = ProviderHostRoutingArgs & {\n providerId?: string;\n signal?: AbortSignal;\n};\ntype ProviderListResult = ProviderInfo[];\ntype ProviderModelsResult = SystemExecutionOptionsResponse;\ninterface ProvidersArea {\n /** List providers on the environment host, explicit host, or primary host. */\n list(args?: ProviderListArgs): Promise;\n /** List models on the environment host, explicit host, or primary host. */\n models(args?: ProviderModelsArgs): Promise;\n}\n\ninterface PluginIdArgs {\n pluginId: string;\n}\n/** Install directly from a path:, git:, npm:, or builtin: source spec. */\ninterface PluginInstallArgs {\n source: string;\n}\n/** Install an entry from BB's official catalog. */\ninterface PluginCatalogInstallArgs {\n entryId: string;\n}\ninterface PluginReloadArgs {\n pluginId?: string;\n}\ninterface PluginSettingsUpdateArgs extends PluginIdArgs {\n values: Record;\n}\ninterface PluginTokenArgs extends PluginIdArgs {\n rotate?: boolean;\n}\ninterface PluginCheckUpdatesArgs {\n pluginId?: string;\n signal?: AbortSignal;\n}\ninterface PluginRpcArgs extends PluginIdArgs {\n input?: JsonValue$1;\n method: string;\n outputSchema: z$1.ZodType;\n}\ninterface PluginCatalogSearchArgs {\n query: string;\n signal?: AbortSignal;\n}\ninterface PluginCatalogStatusArgs {\n signal?: AbortSignal;\n}\ninterface PluginGetSettingsArgs extends PluginIdArgs {\n signal?: AbortSignal;\n}\ninterface PluginGetSourceArgs extends PluginIdArgs {\n signal?: AbortSignal;\n}\ninterface PluginListArgs {\n signal?: AbortSignal;\n}\ninterface PluginListUpdateResultsArgs {\n signal?: AbortSignal;\n}\ntype PluginDisableResult = InstalledPlugin;\ntype PluginEnableResult = InstalledPlugin;\ntype PluginGetSettingsResult = PluginSettingsResponse;\ntype PluginInstallResult = InstalledPlugin;\ntype PluginListResult = PluginListResponse;\ntype PluginReloadResult = PluginReloadResponse;\ntype PluginRemoveResult = PluginRemoveResponse;\ntype PluginTokenResult = PluginTokenResponse;\ntype PluginUpdateSettingsResult = PluginSettingsResponse;\ntype PluginGetSourceResult = PluginSourceDetail;\ntype PluginCheckUpdatesResult = PluginUpdateCheckEntry[];\ntype PluginApplyUpdateResult = PluginApplyUpdateResult$1;\ntype PluginCatalogStatusResult = PluginCatalogStatus;\ntype PluginCatalogSearchResult = PluginCatalogSearchResult$1[];\ninterface PluginCatalogArea {\n install(args: PluginCatalogInstallArgs): Promise;\n search(args: PluginCatalogSearchArgs): Promise;\n status(args?: PluginCatalogStatusArgs): Promise;\n}\ninterface PluginsArea {\n applyUpdate(args: PluginIdArgs): Promise;\n callRpc(args: PluginRpcArgs): Promise;\n checkUpdates(args?: PluginCheckUpdatesArgs): Promise;\n catalog: PluginCatalogArea;\n disable(args: PluginIdArgs): Promise;\n enable(args: PluginIdArgs): Promise;\n getSettings(args: PluginGetSettingsArgs): Promise;\n getSource(args: PluginGetSourceArgs): Promise;\n install(args: PluginInstallArgs): Promise;\n list(args?: PluginListArgs): Promise;\n listUpdateResults(args?: PluginListUpdateResultsArgs): Promise;\n reload(args?: PluginReloadArgs): Promise;\n remove(args: PluginIdArgs): Promise;\n token(args: PluginTokenArgs): Promise;\n updateSettings(args: PluginSettingsUpdateArgs): Promise;\n}\n\ntype BbRealtimeUnsubscribe = () => void;\ntype BbRealtimeEventName = \"thread:changed\" | \"project:changed\" | \"environment:changed\" | \"host:changed\" | \"system:changed\" | \"system:config-changed\" | \"realtime:connection\";\ntype ThreadRealtimeEvent = Extract;\ntype ProjectRealtimeEvent = Extract;\ntype EnvironmentRealtimeEvent = Extract;\ntype HostRealtimeEvent = Extract;\ntype SystemRealtimeEvent = Extract;\ntype BbRealtimeConnectionState = \"connecting\" | \"connected\" | \"disconnected\";\ninterface BbRealtimeConnectionEvent {\n reconnectDelayMs: number | null;\n reconnected: boolean;\n state: BbRealtimeConnectionState;\n}\n/**\n * Entity-changed events are delivered as one shared object to every matching\n * listener; their payload types are readonly so a listener cannot mutate what\n * the next listener receives.\n */\ninterface BbRealtimeEventMap {\n \"thread:changed\": ThreadRealtimeEvent;\n \"project:changed\": ProjectRealtimeEvent;\n \"environment:changed\": EnvironmentRealtimeEvent;\n \"host:changed\": HostRealtimeEvent;\n \"system:changed\": SystemRealtimeEvent;\n \"system:config-changed\": SystemRealtimeEvent;\n \"realtime:connection\": BbRealtimeConnectionEvent;\n}\ntype BbRealtimeCallback = (event: BbRealtimeEventMap[TEventName]) => void;\ninterface ThreadRealtimeSubscribeArgs {\n callback: BbRealtimeCallback<\"thread:changed\">;\n event: \"thread:changed\";\n threadId?: string;\n}\ninterface ProjectRealtimeSubscribeArgs {\n callback: BbRealtimeCallback<\"project:changed\">;\n event: \"project:changed\";\n projectId?: string;\n}\ninterface EnvironmentRealtimeSubscribeArgs {\n callback: BbRealtimeCallback<\"environment:changed\">;\n environmentId?: string;\n event: \"environment:changed\";\n}\ninterface HostRealtimeSubscribeArgs {\n callback: BbRealtimeCallback<\"host:changed\">;\n event: \"host:changed\";\n hostId?: string;\n}\ninterface SystemRealtimeSubscribeArgs {\n callback: BbRealtimeCallback<\"system:changed\">;\n event: \"system:changed\";\n}\ninterface SystemConfigRealtimeSubscribeArgs {\n callback: BbRealtimeCallback<\"system:config-changed\">;\n event: \"system:config-changed\";\n}\n/**\n * Connection listeners are pure observers — they never open or hold the\n * socket. A listener registered while a socket already exists receives the\n * latest connection event as a snapshot on the next microtask, so a status\n * UI mounted after connect still learns the current state.\n */\ninterface RealtimeConnectionSubscribeArgs {\n callback: BbRealtimeCallback<\"realtime:connection\">;\n event: \"realtime:connection\";\n}\ntype BbRealtimeSubscribeArgsUnion = ThreadRealtimeSubscribeArgs | ProjectRealtimeSubscribeArgs | EnvironmentRealtimeSubscribeArgs | HostRealtimeSubscribeArgs | SystemRealtimeSubscribeArgs | SystemConfigRealtimeSubscribeArgs | RealtimeConnectionSubscribeArgs;\ntype BbRealtimeSubscribeArgs = Extract;\ninterface BbRealtime {\n subscribe(args: BbRealtimeSubscribeArgs): BbRealtimeUnsubscribe;\n}\n\ninterface StatusGetArgs {\n projectId?: string;\n signal?: AbortSignal;\n threadId?: string;\n}\ninterface StatusThreadSummary {\n environmentId: string | null;\n id: string;\n parentThreadId: string | null;\n pinnedAt: number | null;\n projectId: string;\n status: ThreadStatus;\n title: string | null;\n}\ntype StatusProject = ProjectResponse;\ntype StatusChildThreads = ThreadListResponse;\ninterface StatusResult {\n childThreads: StatusChildThreads | null;\n pendingTodos: ThreadTimelinePendingTodos | null;\n project: StatusProject | null;\n thread: StatusThreadSummary | null;\n}\ninterface StatusArea {\n get(args?: StatusGetArgs): Promise;\n}\n\ninterface SkillWorkspaceArgs {\n projectId: string;\n environmentId: string | null;\n}\ninterface SkillListArgs extends SkillWorkspaceArgs {\n signal?: AbortSignal;\n}\ninterface SkillIdentityArgs extends SkillListArgs {\n skillId: string;\n}\ninterface SkillContentArgs extends SkillIdentityArgs {\n path: string;\n}\ninterface SkillUpdateArgs extends SkillWorkspaceArgs {\n skillId: string;\n content: string;\n revision: string;\n}\ninterface SkillDeleteArgs extends SkillWorkspaceArgs {\n skillId: string;\n}\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;\n get(args: RegistrySkillIdArgs): Promise;\n install(args: RegistrySkillInstallArgs): Promise;\n repositoryStars(args: RegistryRepositoryArgs): Promise;\n search(args?: RegistrySkillsSearchArgs): Promise;\n}\ninterface SkillsArea {\n getContent(args: SkillContentArgs): Promise;\n list(args: SkillListArgs): Promise;\n listFiles(args: SkillIdentityArgs): Promise;\n registry: SkillsRegistryArea;\n remove(args: SkillDeleteArgs): Promise<{\n deletedPath: string;\n }>;\n update(args: SkillUpdateArgs): Promise<{\n filePath: string;\n revision: string;\n }>;\n}\n\ntype ThemeGetResult = AppTheme;\ntype ThemeCatalogResult = ThemeCatalogResponse;\ntype ThemeSetInput = AppThemeSelection;\ntype ThemeSetResult = AppTheme;\ninterface ThemeCatalogArgs {\n signal?: AbortSignal;\n}\ninterface ThemeGetArgs {\n signal?: AbortSignal;\n}\ninterface ThemeArea {\n /** The active app palette, resolved server-side (built-in id or custom CSS). */\n get(args?: ThemeGetArgs): Promise;\n /** The custom-theme directory plus discovered themes and the active palette. */\n catalog(args?: ThemeCatalogArgs): Promise;\n /** Set the complete app appearance selection in one request. */\n set(selection: ThemeSetInput): Promise;\n /**\n * Activate a palette by id while preserving the active favicon color. This\n * compatibility shorthand reads the active appearance before writing the\n * complete selection; prefer the object form when both values are known.\n */\n set(themeId: string): Promise;\n}\n\ninterface SystemAttentionArgs {\n signal?: AbortSignal;\n}\ninterface SystemConfigArgs {\n signal?: AbortSignal;\n}\ninterface SystemExecutionOptionsArgs extends SystemExecutionOptionsQuery {\n signal?: AbortSignal;\n}\ninterface SystemUsageLimitsArgs extends SystemUsageLimitsQuery {\n signal?: AbortSignal;\n}\ninterface SystemVersionArgs {\n force?: boolean;\n signal?: AbortSignal;\n}\ninterface SystemVoiceTranscriptionArgs {\n file: Blob;\n prompt?: string;\n signal?: AbortSignal;\n}\ntype SystemAttentionResult = SystemAttentionResponse;\ntype SystemConfigResult = SystemConfigResponse;\ntype SystemExecutionOptionsResult = SystemExecutionOptionsResponse;\ntype SystemReloadConfigResult = SystemConfigReloadResponse;\ntype 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;\n config(args?: SystemConfigArgs): Promise;\n executionOptions(args?: SystemExecutionOptionsArgs): Promise;\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;\n installCliSkills(args: SystemInstallCliSkillsArgs): Promise;\n reloadConfig(): Promise;\n transcribeVoice(args: SystemVoiceTranscriptionArgs): Promise;\n updateExperiments(args: Experiments): Promise;\n updateGeneralSettings(args: AppSettings): Promise;\n updateKeyboardSettings(args: AppKeybindingOverrides): Promise;\n /** 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;\n /** Candidate projects discovered on the host, ranked for onboarding. */\n onboardingRepos(args?: SystemOnboardingArgs): Promise;\n usageLimits(args?: SystemUsageLimitsArgs): Promise;\n version(args?: SystemVersionArgs): Promise;\n}\n\ninterface TerminalThreadScope {\n cwd?: never;\n environmentId?: never;\n hostId?: never;\n kind: \"thread\";\n threadId: string;\n}\ninterface TerminalEnvironmentScope {\n environmentId: string;\n cwd?: never;\n hostId?: never;\n kind: \"environment\";\n threadId?: never;\n}\ninterface TerminalHostPathListScope {\n /** Optional exact initial working-directory filter on the selected host. */\n cwd?: string;\n environmentId?: never;\n hostId: string;\n kind: \"host_path\";\n threadId?: never;\n}\ninterface TerminalHostPathCreateScope {\n /** Null starts in the selected host's home directory. */\n cwd: string | null;\n environmentId?: never;\n hostId: string;\n kind: \"host_path\";\n threadId?: never;\n}\ntype TerminalListScope = TerminalThreadScope | TerminalEnvironmentScope | TerminalHostPathListScope;\ntype TerminalCreateScope = TerminalThreadScope | TerminalEnvironmentScope | TerminalHostPathCreateScope;\ninterface TerminalListArgs {\n signal?: AbortSignal;\n scope: TerminalListScope;\n}\ninterface TerminalCreateArgs {\n cols: number;\n rows: number;\n scope: TerminalCreateScope;\n start?: CreateTerminalRequest[\"start\"];\n title?: string;\n}\ninterface TerminalTargetArgs {\n terminalId: string;\n}\ninterface TerminalGetArgs extends TerminalTargetArgs {\n signal?: AbortSignal;\n}\ninterface TerminalRenameArgs extends TerminalTargetArgs {\n title: UpdateTerminalRequest[\"title\"];\n}\ninterface TerminalCloseArgs extends TerminalTargetArgs {\n mode: \"force\" | \"if-clean\";\n}\ninterface TerminalInputArgs extends TerminalTargetArgs {\n dataBase64: TerminalInputRequest[\"dataBase64\"];\n}\ninterface TerminalResizeArgs extends TerminalTargetArgs {\n cols: TerminalResizeRequest[\"cols\"];\n rows: TerminalResizeRequest[\"rows\"];\n}\ninterface TerminalOutputArgs extends TerminalTargetArgs {\n limitChunks?: TerminalOutputQuery[\"limitChunks\"];\n signal?: AbortSignal;\n sinceSeq?: TerminalOutputQuery[\"sinceSeq\"];\n tailBytes?: TerminalOutputQuery[\"tailBytes\"];\n}\ntype TerminalRestartArgs = TerminalTargetArgs;\ntype TerminalListResult = TerminalListResponse;\ntype TerminalCreateResult = TerminalSession;\ntype TerminalGetResult = TerminalSession;\ntype TerminalRenameResult = TerminalSession;\ntype TerminalCloseResult = TerminalSession;\ntype TerminalInputResult = TerminalSession;\ntype TerminalResizeResult = TerminalSession;\ntype TerminalOutputResult = TerminalOutputResponse;\ntype TerminalRestartResult = TerminalSession;\ninterface TerminalsArea {\n close(args: TerminalCloseArgs): Promise;\n create(args: TerminalCreateArgs): Promise;\n get(args: TerminalGetArgs): Promise;\n input(args: TerminalInputArgs): Promise;\n list(args: TerminalListArgs): Promise;\n output(args: TerminalOutputArgs): Promise;\n rename(args: TerminalRenameArgs): Promise;\n /**\n * Replace a terminal with a shell at the same scope, size, and title.\n * The original command is not replayed because terminal sessions do not\n * persist launch commands. The replacement has a new terminal ID.\n */\n restart(args: TerminalRestartArgs): Promise;\n resize(args: TerminalResizeArgs): Promise;\n}\n\ninterface ThreadListArgs {\n archived?: boolean;\n 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 ThreadRateLimitRecoveryResult = ProviderRateLimitRecoveryStatus;\ntype ThreadContinueAfterRateLimitResult = ContinueAfterProviderRateLimitResponse;\ntype ThreadStopResult = {\n ok: true;\n};\ntype ThreadBannerActionResult = {\n ok: true;\n};\ntype ThreadUnarchiveResult = {\n ok: true;\n};\ntype ThreadArchiveAllResult = ThreadArchiveAllResponse;\ntype ThreadReadStateResult = ThreadResponse;\ntype ThreadPinOrderResult = ThreadListResponse;\ntype ThreadPromptHistoryResult = PromptHistoryResponse;\ntype ThreadQueuedMessagesResult = ThreadQueuedMessageListResponse;\ntype ThreadQueuedMessageCreateResult = ThreadQueuedMessage;\ntype ThreadQueuedMessageUpdateResult = ThreadQueuedMessage;\ntype ThreadQueuedMessageDeleteResult = {\n ok: true;\n};\ntype ThreadQueuedMessageReorderResult = ThreadQueuedMessageListResponse;\ntype ThreadQueuedMessageSendResult = SendQueuedMessageResponse;\ntype ThreadQueuedMessageGroupBoundaryResult = ThreadQueuedMessageListResponse;\ntype ThreadTabsResult = ThreadTabsResponse;\ntype ThreadTabsUpdateResult = ThreadTabsResponse;\ntype ThreadStorageFilesResult = ThreadStorageFileListResponse;\ntype ThreadStoragePathsResult = ThreadStoragePathListResponse;\ntype ThreadChildSummaryResult = ThreadChildSummaryResponse;\ntype ThreadDefaultExecutionOptionsResult = ResolvedThreadExecutionOptions | null;\ntype ThreadConversationOutlineResult = ThreadConversationOutlineResponse;\ntype ThreadTimelineTurnSummaryDetailsResult = TimelineTurnSummaryDetailsResponse;\ninterface ThreadSpawnBaseArgs extends Omit {\n childOrigin?: CreateThreadRequest[\"childOrigin\"];\n origin?: CreateThreadRequest[\"origin\"];\n originKind?: CreateThreadRequest[\"originKind\"];\n startedOnBehalfOf?: CreateThreadRequest[\"startedOnBehalfOf\"];\n}\ntype ThreadSpawnArgs = ThreadSpawnBaseArgs & ({\n input: CreateThreadRequest[\"input\"];\n prompt?: never;\n} | {\n input?: never;\n prompt: string;\n});\ninterface ThreadForkArgs extends Omit {\n origin?: ForkThreadRequest[\"origin\"];\n visibility?: ForkThreadRequest[\"visibility\"];\n workspace?: ForkThreadRequest[\"workspace\"];\n}\ninterface ThreadUpdateArgs extends UpdateThreadRequest {\n threadId: string;\n}\ninterface ThreadDeleteArgs extends DeleteThreadRequest {\n threadId: string;\n}\ninterface ThreadSendArgs extends SendMessageRequest {\n threadId: string;\n}\ninterface ThreadActionArgs {\n threadId: string;\n}\ninterface ThreadContinueAfterRateLimitArgs extends ThreadActionArgs {\n failedRequestId: 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;\n matched: true;\n target: Extract;\n threadId: string;\n} | {\n matched: true;\n target: Extract;\n thread: ThreadGetResult;\n threadId: string;\n};\ninterface ThreadInteractionsArea {\n cancel(args: ThreadInteractionTargetArgs): Promise;\n get(args: ThreadInteractionGetArgs): Promise;\n list(args: ThreadInteractionListArgs): Promise;\n resolve(args: ThreadInteractionResolveArgs): Promise;\n respond(args: ThreadInteractionRespondArgs): Promise;\n}\ninterface ThreadEventsArea {\n list(args: ThreadEventsListArgs): Promise;\n wait(args: ThreadEventWaitArgs): Promise;\n}\ninterface ThreadQueuedMessagesArea {\n create(args: ThreadQueuedMessageCreateArgs): Promise;\n delete(args: ThreadQueuedMessageTargetArgs): Promise;\n list(args: ThreadQueuedMessageArgs): Promise;\n reorder(args: ThreadQueuedMessageReorderArgs): Promise;\n send(args: ThreadQueuedMessageSendArgs): Promise;\n setGroupBoundary(args: ThreadQueuedMessageGroupBoundaryArgs): Promise;\n update(args: ThreadQueuedMessageUpdateArgs): Promise;\n}\ninterface ThreadTabsArea {\n get(args: ThreadStatusArgs): Promise;\n update(args: ThreadTabsUpdateArgs): Promise;\n}\ninterface ThreadsArea {\n archive(args: ThreadActionArgs): Promise;\n archiveAll(args: ThreadActionArgs): Promise;\n childSummary(args: ThreadStatusArgs): Promise;\n continueAfterRateLimit(args: ThreadContinueAfterRateLimitArgs): Promise;\n cancelPlan(args: ThreadActionArgs): Promise;\n clearGoal(args: ThreadActionArgs): Promise;\n conversationOutline(args: ThreadStatusArgs): Promise;\n defaultExecutionOptions(args: ThreadStatusArgs): Promise;\n delete(args: ThreadDeleteArgs): Promise;\n events: ThreadEventsArea;\n fork(args: ThreadForkArgs): Promise;\n get(args: ThreadGetArgs): Promise;\n interactions: ThreadInteractionsArea;\n list(args?: ThreadListArgs): Promise;\n markRead(args: ThreadActionArgs): Promise;\n markUnread(args: ThreadActionArgs): Promise;\n open(args: ThreadOpenArgs): Promise;\n paneAction(args: ThreadPaneActionArgs): Promise;\n output(args: ThreadOutputArgs): Promise;\n pin(args: ThreadActionArgs): Promise;\n promptHistory(args: ThreadPromptHistoryArgs): Promise;\n queuedMessages: ThreadQueuedMessagesArea;\n rateLimitRecovery(args: ThreadStatusArgs): Promise;\n reorderPinned(args: ThreadPinOrderArgs): Promise;\n search(args: ThreadSearchArgs): Promise;\n send(args: ThreadSendArgs): Promise;\n spawn(args: ThreadSpawnArgs): Promise;\n stop(args: ThreadActionArgs): Promise;\n tabs: ThreadTabsArea;\n timeline(args: ThreadTimelineArgs): Promise;\n timelineTurnSummaryDetails(args: ThreadTimelineTurnSummaryDetailsArgs): Promise;\n storageFiles(args: ThreadStorageFilesArgs): Promise;\n storagePaths(args: ThreadStoragePathsArgs): Promise;\n unarchive(args: ThreadActionArgs): Promise;\n unpin(args: ThreadActionArgs): Promise;\n update(args: ThreadUpdateArgs): Promise;\n wait(args: ThreadWaitArgs): Promise;\n}\n\ntype ThreadSectionCreateResult = ThreadSectionResponse;\ntype ThreadSectionUpdateResult = ThreadSectionMutationResponse;\ntype ThreadSectionDeleteResult = ThreadSectionMutationResponse;\ntype ThreadSectionListResult = ThreadSectionResponse[];\ninterface ThreadSectionListArgs {\n signal?: AbortSignal;\n}\ninterface ThreadSectionsArea {\n create(args: CreateThreadSectionRequest): Promise;\n delete(args: DeleteThreadSectionRequest): Promise;\n list(args?: ThreadSectionListArgs): Promise;\n update(args: UpdateThreadSectionRequest): Promise;\n}\n\ninterface BbSdk extends BbRealtime {\n environments: EnvironmentsArea;\n files: FilesArea;\n guide: GuideArea;\n hosts: HostsArea;\n projects: ProjectsArea;\n plugins: PluginsArea;\n providers: ProvidersArea;\n skills: SkillsArea;\n status: StatusArea;\n system: SystemArea;\n terminals: TerminalsArea;\n theme: ThemeArea;\n threadSections: ThreadSectionsArea;\n threads: ThreadsArea;\n}\n\n/**\n * The backend plugin API contract — the `bb` object handed to a plugin's\n * `server.ts` factory (`export default function plugin(bb: BbPluginApi)`).\n *\n * Types only: the implementation lives in the BB server\n * (apps/server/src/services/plugins/plugin-api.ts), which imports these\n * shapes so the contract and the implementation cannot drift. Plugin authors\n * import them type-only (`import type { BbPluginApi } from\n * \"@bb/plugin-sdk\"`); the import is erased when BB loads the file.\n *\n * Runtime classes stay host-side. NeedsConfigurationError in particular is\n * matched by NAME, so plugin code needs no runtime import:\n * `throw Object.assign(new Error(msg), { name: \"NeedsConfigurationError\" })`.\n */\ninterface PluginLogger {\n debug(message: string): void;\n info(message: string): void;\n warn(message: string): void;\n error(message: string): void;\n}\n/**\n * Declarative settings descriptors (`bb.settings.define`). Deliberately plain\n * data — not zod — so the host can render settings forms and the CLI can\n * parse values without executing plugin code.\n */\ntype PluginSettingDescriptor = {\n type: \"string\";\n label: string;\n description?: string;\n /** Stored in a 0600 file under /plugins//secrets/, never in the db or sent to the frontend. */\n secret?: true;\n default?: string;\n} | {\n type: \"boolean\";\n label: string;\n description?: string;\n default?: boolean;\n} | {\n type: \"select\";\n label: string;\n description?: string;\n options: string[];\n default?: string;\n} | {\n type: \"project\";\n label: string;\n description?: string;\n default?: string;\n};\ntype PluginSettingDescriptors = Record;\ntype PluginSettingValue = string | boolean;\n/** `default` present → non-optional value; absent → `T | undefined`. */\ntype PluginSettingsValues> = {\n [K in keyof Ds]: Ds[K] extends {\n default: string | boolean;\n } ? PluginSettingValueOf : PluginSettingValueOf | undefined;\n};\ntype PluginSettingValueOf = D extends {\n type: \"boolean\";\n} ? boolean : string;\ninterface PluginSettingsHandle> {\n /** Load-safe: callable inside the factory. */\n get(): Promise>;\n /** Fires after values change through the settings route/CLI. */\n onChange(listener: (next: PluginSettingsValues, prev: PluginSettingsValues) => void): void;\n}\ninterface PluginSettings {\n define>(descriptors: Ds): PluginSettingsHandle;\n}\ninterface PluginKvStorage {\n get(key: string): Promise;\n set(key: string, value: unknown): Promise;\n delete(key: string): Promise;\n list(prefix?: string): Promise;\n}\ninterface PluginStorage {\n /** Namespaced JSON key-value rows in bb.db; values ≤256KB each. */\n kv: PluginKvStorage;\n /**\n * Open (or reuse the path of) the plugin's own SQLite database at\n * /plugins//data.db — the server's better-sqlite3, WAL mode,\n * busy_timeout 5000. Handles are host-tracked and closed on\n * dispose/reload; a closed handle throws on use.\n */\n database(): Database.Database;\n /**\n * Ordered-statement migration helper: statement index = migration id in a\n * `_bb_migrations` table; unapplied statements run in one transaction.\n * Append-only — never reorder or edit shipped statements.\n */\n migrate(db: Database.Database, statements: string[]): void;\n}\n/**\n * Thread lifecycle events a plugin can observe (design §4.5). Observe-only:\n * handlers run fire-and-forget after the transition is applied and can never\n * block or veto it. `thread` is the same public DTO GET /threads/:id serves.\n */\ninterface PluginThreadEventPayloads {\n /** Fired after a thread row is created. */\n \"thread.created\": {\n thread: ThreadResponse;\n };\n /** Fired when a thread transitions into `active`. */\n \"thread.active\": {\n thread: ThreadResponse;\n };\n /** Fired when a thread transitions into `idle`. `lastAssistantText` is\n * assembled the same way GET /threads/:id/output is. */\n \"thread.idle\": {\n thread: ThreadResponse;\n lastAssistantText: string | null;\n };\n /** Fired when a thread transitions into `error`. `error` is the latest\n * system/error event message, when one exists. */\n \"thread.failed\": {\n thread: ThreadResponse;\n error: string | null;\n };\n /** Fired after a thread is archived (including cascade archives). */\n \"thread.archived\": {\n thread: ThreadResponse;\n };\n /** Fired after a thread is soft-deleted. */\n \"thread.deleted\": {\n thread: ThreadResponse;\n };\n}\ntype PluginThreadEventName = keyof PluginThreadEventPayloads;\ntype PluginThreadEventHandler = (payload: PluginThreadEventPayloads[E]) => void | Promise;\ntype PluginHttpAuthMode = \"local\" | \"token\" | \"none\";\ntype PluginHttpHandler = (context: Context) => Response | Promise;\ninterface PluginHttp {\n /**\n * Register an HTTP route, mounted at\n * `/api/v1/plugins//http/`. Auth modes (default \"local\"):\n * - \"local\": Origin/Host must be a local BB app origin; non-GET requires\n * content-type application/json (forces a CORS preflight).\n * - \"token\": requires the per-plugin token (`bb plugin token `) via\n * the x-bb-plugin-token header or ?token=.\n * - \"none\": no checks — only for signature-verified webhooks.\n */\n route(method: string, path: string, handler: PluginHttpHandler, opts?: {\n auth?: PluginHttpAuthMode;\n }): void;\n}\ninterface PluginRpc {\n /**\n * Register a Standard Schema-driven rpc contract and its inferred handlers,\n * served at POST\n * `/api/v1/plugins//rpc/` with \"local\" auth semantics. The\n * host validates input before invocation and output before strict JSON\n * serialization. The response is `{ ok: true, result }` or\n * `{ ok: false, error: { code, message, issues? } }`.\n */\n register(contract: Contract, handlers: PluginRpcHandlers): void;\n}\ninterface PluginRealtime {\n /**\n * Broadcast an ephemeral `plugin-signal` WS message\n * `{ pluginId, channel, payload }` to every connected client (V1 has no\n * per-channel subscriptions). `payload` must be JSON-serializable;\n * `undefined` is normalized to `null`. Nothing is persisted.\n */\n publish(channel: string, payload: unknown): void;\n}\ninterface PluginBackground {\n /**\n * Register a long-lived background service. `start` runs after the\n * factory completes and should resolve when `signal` aborts\n * (dispose/reload/disable/shutdown). A crash restarts it with capped\n * exponential backoff; throwing NeedsConfigurationError marks the plugin\n * `needs-configuration` and stops restarting until the next load.\n */\n service(name: string, service: {\n start(signal: AbortSignal): void | Promise;\n }): void;\n /**\n * Register a cron schedule (5-field expression, server-local time). The\n * durable row keyed (pluginId, name) is upserted at load; the periodic\n * sweep claims due rows with a CAS on next_run_at, but only while this\n * plugin is loaded. Failures land in last_status/last_error, visible in\n * `bb plugin list`.\n */\n schedule(name: string, cron: string, fn: () => void | Promise): void;\n}\ninterface PluginCliCommandInfo {\n name: string;\n summary: string;\n usage: string;\n}\n/** Context forwarded from the invoking CLI when known; all fields optional. */\ninterface PluginCliContext {\n cwd?: string;\n threadId?: string;\n projectId?: string;\n /** Aborted when the invoking CLI HTTP request disconnects. */\n signal?: AbortSignal;\n}\ntype PluginInteractionCancelReason = \"user\" | \"request-aborted\" | \"thread-stopped\" | \"thread-deleted\" | \"plugin-disposed\" | \"server-restarted\" | \"timeout\";\ntype PluginInteractionResult = {\n outcome: \"submitted\";\n value: JsonValue;\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 …`): lowercase [a-z0-9-]+, and not\n * a core bb command (see RESERVED_BB_CLI_COMMANDS in the server). */\n name: string;\n summary: string;\n /** Subcommand metadata rendered in help and the plugin-commands skill\n * without executing plugin code. Parsing argv is plugin-owned. */\n commands?: PluginCliCommandInfo[];\n run(argv: string[], ctx: PluginCliContext): PluginCliResult | Promise;\n}\ninterface PluginCli {\n /**\n * Register this plugin's `bb` subcommand. One registration per factory\n * execution; a repeated call is rejected. Core bb commands always win\n * name collisions; reserved names are rejected at registration.\n */\n register(registration: PluginCliRegistration): void;\n}\n/** Per-turn context handed to bb.agents context providers (design §4.4). */\n/** MCP-style content parts a native tool may return (design §4.4). */\ntype PluginAgentToolContentPart = {\n type: \"text\";\n text: string;\n} | {\n type: \"image\";\n data: string;\n mimeType: string;\n};\ntype PluginAgentToolResult = string | {\n content: PluginAgentToolContentPart[];\n isError?: boolean;\n};\n/** Per-call context handed to a native tool's execute (design §4.4). */\ninterface PluginAgentToolContext {\n threadId: string;\n projectId: string;\n /** The tool-call request's abort signal (aborts if the daemon round-trip\n * is torn down mid-call). */\n signal: AbortSignal;\n}\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;\n}\n/** Per-resolution selection returned by {@link PluginAgents.configure}. */\ninterface PluginAgentConfiguration {\n /** Tool names registered by this plugin, or {@link PluginAgentToolSelection}\n * entries to also override a tool's advertised parameter schema for this\n * resolution. Duplicate or unknown names, or an invalid override, reject\n * this plugin's complete selection for the resolution. */\n tools: Array;\n /** Skill frontmatter names from this plugin's manifest skill roots.\n * Duplicate or unknown names reject this plugin's complete selection. */\n skills: string[];\n /** Optional dynamic instructions. Output is truncated to 4096 characters. */\n instructions?: string;\n}\ninterface PluginAgents {\n /**\n * Select this plugin's statically registered tools and manifest skills for\n * each thread/session resolution, with optional dynamic instructions. The\n * callback is synchronous and runs at `thread.start` / `turn.submit`; it\n * never rebuilds registrations. Exactly one callback may be registered per\n * factory execution. A throw, malformed result, duplicate id, unknown id,\n * or more than 256 tool/skill ids fails closed for this plugin only.\n *\n * Tools take effect when the provider session is next started or resumed;\n * an already-running session is not hot-mutated. Instructions are resolved\n * for the next turn. Skill changes follow BB's environment runtime policy:\n * a busy runtime keeps its current catalog until a safe relaunch. Side 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(tool: PluginAgentToolRegistrationBase & {\n parameters: Schema;\n execute(params: z.output, ctx: PluginAgentToolContext): PluginAgentToolResult | Promise;\n }): void;\n registerTool(tool: PluginAgentToolRegistrationBase & {\n /** Raw JSON-schema escape hatch; params arrive unvalidated. */\n parameters: Record;\n execute(params: unknown, ctx: PluginAgentToolContext): PluginAgentToolResult | Promise;\n }): void;\n /**\n * Contribute a dynamic section appended to thread instructions. The\n * provider runs when a thread's runtime command config is resolved\n * (thread.start / turn.submit); return null to contribute nothing for\n * that resolution. Must be synchronous and fast — it sits on the\n * thread-start path. Output longer than 4096 characters is truncated; a\n * throwing provider is logged against the plugin and contributes nothing.\n * A repeated registration within one factory execution is rejected.\n */\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 \":\"). */\n id: string;\n /** Section label shown above this provider's rows in the mention menu. */\n label: string;\n /**\n * Composer trigger characters this provider should answer. Omit to use the\n * default `@` mention trigger. Valid triggers are `@`, `#`, `$`, `!`, and `~`.\n */\n triggers?: readonly PluginMentionTrigger[];\n /**\n * Runs server-side as the user types after one of this provider's triggers\n * in the composer. Each call is time-boxed (2s) and failure-isolated: a slow\n * or throwing provider contributes an empty list — it can never break the\n * mention menu.\n */\n search(ctx: PluginMentionSearchContext): PluginMentionItem[] | Promise;\n /**\n * Resolves one picked item into agent context, called once per unique\n * item at message send time. The returned `context` is attached to the\n * message as an agent-visible (user-hidden) prompt input. Throwing blocks\n * the send with a visible error.\n */\n resolve(itemId: string): {\n context: string;\n } | Promise<{\n context: string;\n }>;\n}\ninterface PluginUi {\n /** Block until the app submits or cancels a plugin-owned composer form. */\n requestInput(request: PluginInteractionRequest, options?: {\n signal?: AbortSignal;\n }): Promise;\n /**\n * Register a mention provider for the shipped app's composer (design §4.9).\n * Providers default to the `@` trigger and may opt into `#`, `$`, `!`, or\n * `~` with `triggers`. Items group under `label` in the mention menu; a\n * picked item becomes a `{ kind: \"plugin\" }` mention resource whose context\n * is resolved once at send time. Multiple providers per plugin; ids must be\n * unique within the plugin.\n */\n registerMentionProvider(provider: PluginMentionProviderRegistration): void;\n}\ninterface PluginEvents {\n /**\n * Add a thread lifecycle listener. Multiple listeners for the same event are\n * additive and run independently in registration order.\n */\n on(event: E, handler: PluginThreadEventHandler): void;\n}\ninterface PluginServerApi {\n /**\n * This BB server's own loopback base URL (e.g. \"http://127.0.0.1:38886\"),\n * which serves the SPA + /api + /ws. For plugins that proxy or relay\n * traffic back to the server itself (e.g. a tunnel). Bind-gated like\n * `bb.sdk`: reading it before the server is listening throws, so prefer\n * reading it from handlers, services, and timers.\n */\n readonly loopbackBaseUrl: string;\n}\ninterface PluginSharedPortTunnelIdentity {\n /** Gate routing label assigned to this machine. */\n label: string;\n /** Gate apex without a scheme, e.g. \"getbb.app\". */\n baseDomain: string;\n}\ninterface PluginHosts {\n /**\n * Ensure this enrolled host has a gate label and return its read-only public\n * identity. The daemon chooses the trusted gate and desired label; plugins\n * cannot influence either credential-bearing destination.\n */\n ensureSharedPortTunnel(hostId: string): Promise;\n /**\n * Replace this plugin's desired shared-loopback ports for one host. The\n * server aggregates declarations, owns generations, and delivers the\n * resulting set to that host's daemon. Tunnel identity is deliberately not\n * accepted here: it is owned by the daemon's trusted enrollment.\n */\n declareSharedPorts(hostId: string, ports: readonly number[]): void;\n}\ninterface PluginStatusApi {\n /**\n * Mark this plugin `needs-configuration` (with a message shown in\n * `bb plugin list` and the UI) instead of failing — e.g. a factory or\n * service that finds no API key configured. Cleared on the next load;\n * saving settings does not auto-reload in V1, so ask the user to\n * `bb plugin reload ` after configuring.\n */\n needsConfiguration(message: string): void;\n}\n/**\n * The API object handed to a plugin's factory (design §4). Implemented by\n * the BB server; this contract is what plugin `server.ts` files compile\n * against.\n */\ninterface BbPluginApi {\n /** The plugin's own id (namespaces storage, routes, commands). */\n readonly pluginId: string;\n /** Leveled, plugin-scoped logger. */\n readonly log: PluginLogger;\n /** Declarative settings (design §4.2). */\n readonly settings: PluginSettings;\n /** Namespaced KV + per-plugin database (design §4.3). */\n readonly storage: PluginStorage;\n /** HTTP routes under /api/v1/plugins//http/* (design §4.6). */\n readonly http: PluginHttp;\n /** RPC methods under /api/v1/plugins//rpc/ (design §4.6). */\n readonly rpc: PluginRpc;\n /** Ephemeral push to connected frontends (design §4.7). */\n readonly realtime: PluginRealtime;\n /** Long-lived services + cron schedules (design §4.8). */\n readonly background: PluginBackground;\n /** Agent-facing `bb` CLI subcommand (design §4.4). */\n readonly cli: PluginCli;\n /** Per-turn agent context contributions (design §4.4). */\n readonly agents: PluginAgents;\n /** Host-rendered UI contributions (design §4.9). */\n readonly ui: PluginUi;\n /** Additive plugin lifecycle listeners (design §4.5). */\n readonly events: PluginEvents;\n /** Plugin-reported status (needs-configuration). */\n readonly status: PluginStatusApi;\n /** Read-only facts about the running server (loopback base URL). */\n readonly server: PluginServerApi;\n /** Server-to-daemon host control-plane declarations. */\n readonly hosts: PluginHosts;\n /**\n * The full BB SDK, bound to this server over loopback (design §4.1).\n * Bind-gated: reading this before the host binds the SDK throws. The real\n * server binds it before loading plugins, so it is available from the\n * moment factories run there — but isolated harnesses may not, so prefer\n * using it from handlers, services, and timers for portability.\n * `threads.spawn` defaults `origin` to \"plugin\" and `originPluginId` to\n * this plugin's id so spawned threads are attributed automatically.\n */\n readonly sdk: BbSdk;\n /**\n * Register cleanup to run on reload/disable/shutdown. Hooks run LIFO.\n * The sanctioned place to clear timers and close connections.\n */\n onDispose(hook: () => void | Promise): void;\n}\n\nexport { PLUGIN_CLI_OUTPUT_MAX_BYTES, defineRpcContract };\nexport type { BbContext, BbNavigate, BbPluginApi, ComposerCustomization, ComposerPlusMenuItem, ComposerRichTextSpec, ComposerStructuredDraft, ComposerView, JsonValue, 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 {\n readonly \"~standard\": {\n readonly version: 1;\n readonly vendor: string;\n readonly validate: (value: unknown) => StandardSchemaV1Result | Promise>;\n readonly types?: {\n readonly input: Input;\n readonly output: Output;\n };\n };\n}\ntype StandardSchemaV1Result = {\n readonly value: Output;\n readonly issues?: undefined;\n} | {\n readonly issues: readonly StandardSchemaV1Issue[];\n};\ninterface StandardSchemaV1Issue {\n readonly message: string;\n readonly path?: PropertyKey | readonly (PropertyKey | {\n readonly key: PropertyKey;\n })[];\n}\ntype StandardSchemaV1InferInput = NonNullable[\"input\"];\ntype StandardSchemaV1InferOutput = NonNullable[\"output\"];\ninterface PluginRpcMethodContract {\n readonly input: InputSchema;\n readonly output: OutputSchema;\n}\ntype PluginRpcContract = Readonly>;\ntype PluginRpcHandlers = {\n [Method in keyof Contract]: (input: StandardSchemaV1InferOutput) => StandardSchemaV1InferInput | Promise>;\n};\ntype PluginRpcCallInput = StandardSchemaV1InferInput;\ntype PluginRpcCallArgs = null extends PluginRpcCallInput ? [input?: PluginRpcCallInput] : [input: PluginRpcCallInput];\ntype PluginRpcResult = StandardSchemaV1InferOutput;\n\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;\ndeclare const serviceTierSchema: z.ZodEnum<{\n default: \"default\";\n fast: \"fast\";\n}>;\ntype ServiceTier = z.infer;\ndeclare const permissionModeSchema: z.ZodEnum<{\n full: \"full\";\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n}>;\ntype PermissionMode = z.infer;\ndeclare const promptInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{\n visibility: z.ZodOptional>;\n type: z.ZodLiteral<\"text\">;\n text: z.ZodString;\n mentions: z.ZodDefault, z.ZodDiscriminatedUnion<[z.ZodObject<{\n kind: z.ZodLiteral<\"thread\">;\n threadId: z.ZodString;\n projectId: z.ZodOptional;\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;\n }, z.core.$strip>, z.ZodObject<{\n kind: z.ZodLiteral<\"plugin\">;\n pluginId: z.ZodString;\n icon: z.ZodOptional>;\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>;\n type: z.ZodLiteral<\"image\">;\n url: z.ZodString;\n}, z.core.$strip>, z.ZodObject<{\n visibility: z.ZodOptional>;\n type: z.ZodLiteral<\"localImage\">;\n path: z.ZodString;\n}, z.core.$strip>, z.ZodObject<{\n visibility: z.ZodOptional>;\n type: z.ZodLiteral<\"localFile\">;\n path: z.ZodString;\n name: z.ZodOptional;\n sizeBytes: z.ZodOptional;\n mimeType: z.ZodOptional;\n}, z.core.$strip>], \"type\">;\ntype PromptInput = z.infer;\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;\n workspace: z.ZodDiscriminatedUnion<[z.ZodObject<{\n type: z.ZodLiteral<\"unmanaged\">;\n path: z.ZodNullable;\n branch: z.ZodOptional;\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;\n\ndeclare const createExecutionInputSourcesSchema: z.ZodObject<{\n providerId: z.ZodOptional>;\n model: z.ZodOptional>;\n serviceTier: z.ZodOptional>;\n reasoningLevel: z.ZodOptional>;\n permissionMode: z.ZodOptional>;\n}, z.core.$strict>;\ntype CreateExecutionInputSources = z.infer;\n\n/**\n * A value that survives a JSON round trip without coercion or data loss.\n *\n * Host boundaries still validate values at runtime because TypeScript cannot\n * exclude non-finite numbers and plugin bundles can bypass static types.\n */\ntype JsonValue = string | number | boolean | null | JsonValue[] | {\n [key: string]: JsonValue;\n};\n\n/**\n * The `@bb/plugin-sdk/app` contract (plugin design §5.2) — pure types with no\n * side effects. The BB app imports these to keep its real implementation in\n * sync (`satisfies PluginSdkApp`). Plugin authors import the same shapes through\n * `@bb/plugin-sdk/app`.\n *\n * Per-slot props are versioned contracts: additive-only within an SDK major.\n */\n/** Props passed to a `homepageSection` component. */\ninterface PluginHomepageSectionProps {\n /** Project in view on the compose surface; null when none is selected. */\n projectId: string | null;\n}\n/**\n * Props passed to a `settingsSection` component.\n *\n * Deliberately empty in V1; versioned additive like the other slot props.\n */\ninterface PluginSettingsSectionProps {\n}\n/** Props passed to a `navPanel` component (it owns its whole route). */\ninterface PluginNavPanelProps {\n /**\n * The route remainder after the panel root, \"\" at the root. The panel's\n * route is `/plugins///*`, so a deep link like\n * `/plugins/notes/notes/work/ideas.md` renders the panel with\n * `subPath: \"work/ideas.md\"`. Navigate within the panel via\n * `useBbNavigate().toPluginPanel(path, { subPath })` — browser\n * back/forward then walks panel-internal history.\n */\n subPath: string;\n}\n/** Props passed to a panel tab opened by a `threadPanelAction`. */\ninterface PluginThreadPanelProps {\n threadId: string;\n /**\n * The JSON value the action's `openPanel` call passed (round-tripped\n * through persistence, so the tab restores across reloads); null when the\n * action opened the panel without params.\n */\n params: JsonValue | null;\n}\ninterface PluginPendingInteractionView {\n id: string;\n threadId: string;\n title: string;\n payload: JsonValue;\n createdAt: number;\n expiresAt: number | null;\n}\ninterface PluginPendingInteractionProps {\n interaction: PluginPendingInteractionView;\n submit(value: JsonValue): Promise;\n cancel(): Promise;\n}\n/**\n * Props for a `sidebarFooterAction` — host-rendered (no plugin component).\n * Deliberately empty; the registration's `run` carries the behavior.\n */\ninterface PluginSidebarFooterActionProps {\n}\n/**\n * 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>;\n /** Original directive source text (useful for diagnostics / crash fallback). */\n source: string;\n message: PluginMessageDirectiveMessage;\n /**\n * Opens a worktree-relative file in the host's workspace file viewer. Null\n * when the message surface has no workspace viewer available.\n */\n openWorkspaceFile: PluginMessageDirectiveOpenWorkspaceFile | null;\n}\ninterface PluginHomepageSectionRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n title: string;\n component: ComponentType;\n}\ninterface PluginSettingsSectionRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Optional host-rendered section heading. */\n title?: string;\n /**\n * Optional one-line host-rendered subheading under `title`, in the built-in\n * SettingsSection idiom (ignored when `title` is absent).\n */\n description?: string;\n component: ComponentType;\n}\ninterface PluginNavPanelRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n title: string;\n /** Icon hint (BB icon name); unknown names fall back to a generic icon. */\n icon: string;\n /** URL segment under `/plugins//`; letters, digits, `-`, `_`. */\n path: string;\n component: ComponentType;\n /**\n * Optional component rendered on the right side of the shared title bar\n * (e.g. a sync button or a count). Contained separately from the body: a\n * throwing headerContent is hidden without breaking the title bar.\n */\n headerContent?: ComponentType;\n}\n/** Context handed to a `threadPanelAction`'s `run`. */\ninterface PluginThreadPanelActionContext {\n /** The thread whose panel launcher invoked the action. */\n threadId: string;\n /**\n * Open a tab in the thread's side panel rendering this action's\n * `component`. `title` labels the tab (default: the action's `title`);\n * `params` must be JSON-serializable — it is persisted with the tab and\n * reaches the component as its `params` prop. Opening with params\n * identical to an already-open tab of this action focuses that tab\n * (updating its title) instead of duplicating it. May be called more than\n * once (different params ⇒ multiple tabs) or not at all.\n */\n openPanel(options?: {\n title?: string;\n params?: JsonValue;\n }): void;\n}\ninterface PluginThreadPanelActionRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Label of the action row in the panel's new-tab launcher. */\n title: string;\n /**\n * Icon hint (BB icon name) used when the plugin ships no logo; the\n * launcher row and opened tabs prefer the plugin's logo.\n */\n icon?: string;\n /** Rendered inside every panel tab this action opens. */\n component: ComponentType;\n /**\n * How the host frames the tab content. \"padded\" (default) wraps the\n * component in the panel's scroll container with standard padding —\n * right for document-like content. \"flush\" gives the component the full\n * tab area (no padding, definite height, no host scrolling) — right for\n * app-like content that manages its own layout, such as\n * `ThreadChat`.\n */\n layout?: \"padded\" | \"flush\";\n /**\n * Runs when the user activates the action: call your RPC methods, show a\n * toast, and/or open panel tabs via `context.openPanel`. Omitted =\n * immediately open a panel tab with defaults. Errors (sync or async) are\n * contained and logged; they never break the launcher.\n */\n run?(context: PluginThreadPanelActionContext): void | Promise;\n}\ninterface PluginPendingInteractionRegistration {\n /** Matches `rendererId` passed to `bb.ui.requestInput`. */\n id: string;\n component: ComponentType;\n}\n/** Context handed to a `sidebarFooterAction`'s `run`. */\ninterface PluginSidebarFooterActionContext {\n /**\n * Navigate to this plugin's detail page in Tools, where declarative settings\n * and `settingsSection` slots render.\n */\n openSettings(): void;\n}\n/**\n * An icon button in the app sidebar footer (next to Settings / bug report).\n * Host-rendered for consistent chrome — plugins supply icon, label, and\n * `run` behavior only.\n */\ninterface PluginSidebarFooterActionRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Tooltip and accessible label for the icon button. */\n title: string;\n /** Icon hint (BB icon name); unknown names fall back to a generic icon. */\n icon: string;\n /**\n * Runs when the user activates the action (e.g. call `openSettings()`,\n * open a panel via other surfaces, toast). Errors (sync or async) are\n * contained and logged; they never break the sidebar.\n */\n run(context: PluginSidebarFooterActionContext): void | Promise;\n}\n/**\n * 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;\n setRead(threadId: string, read: boolean): Promise;\n /** Silent rename — no dialog. For inline editing in your own row. */\n rename(threadId: string, title: string): Promise;\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;\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) => 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;\n}\n/**\n * Register this plugin as a viewer/editor for file extensions. The user\n * picks (and can set as default) an opener per extension via the file tab's\n * \"Open with\" menu; matching files opened in the panel then render\n * `component` in a plugin tab instead of the built-in preview. Applies to\n * working-tree, host, and thread-storage files — never to git-ref snapshots\n * (diff views always use the built-in preview). The built-in preview stays\n * one menu click away, and a missing/disabled opener falls back to it.\n */\ninterface PluginFileOpenerRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Label in the \"Open with\" menu (e.g. \"Notes editor\"). */\n title: string;\n /** Lowercase extensions without the dot (e.g. [\"md\", \"mdx\"]). */\n extensions: readonly string[];\n component: ComponentType;\n}\n/**\n * Register a leaf message directive rendered inside assistant (and nested\n * agent) message Markdown. `id` is the directive name: `inline-vis` matches\n * `::inline-vis{file=\"demo.html\"}`.\n */\ninterface PluginMessageDirectiveRegistration {\n /**\n * The directive name. Lowercase kebab-case beginning with a letter.\n */\n id: string;\n component: ComponentType;\n}\n/**\n * A narrow, stable reference to one rendered chat message — NOT an internal\n * timeline row. `sourceSeqEnd` is the last source event sequence the message\n * covers, the anchor the server accepts for provider-history forks.\n */\ninterface ThreadChatMessageReference {\n id: string;\n threadId: string;\n role: \"user\" | \"assistant\";\n /** Visible text of the message. */\n text: string;\n sourceSeqEnd: number;\n}\ninterface PluginMessageActionThreadPanelOptions {\n /** A `threadPanelAction` id registered by this same plugin. */\n actionId: string;\n title?: string;\n params?: JsonValue;\n}\n/** Context handed to a `messageAction`'s `run`. */\ninterface PluginMessageActionContext {\n /** The thread whose timeline surfaced the action. */\n threadId: string;\n message: ThreadChatMessageReference;\n /**\n * Present only when the action was invoked from the text-selection menu;\n * the exact text the user highlighted inside `message`.\n */\n selectedText?: string;\n /**\n * Open one of this plugin's `threadPanelAction` components in the current\n * thread's side panel — the registration-callback equivalent of\n * `useBbNavigate().openThreadPanel`. Returns true when the host\n * accepted (the action id exists and the surface has a panel); false\n * otherwise.\n */\n openPanel(options: PluginMessageActionThreadPanelOptions): boolean;\n}\n/**\n * An action on chat messages: an icon button in the per-message action bar\n * (user and assistant messages) and an entry in the assistant-message\n * text-selection menu. Host-rendered chrome — the plugin supplies title,\n * icon hint, and `run` behavior only.\n */\ninterface PluginMessageActionRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Tooltip / menu label for the action. */\n title: string;\n /** Icon hint (BB icon name); unknown names fall back to a generic icon. */\n icon?: string;\n /**\n * Runs when the user activates the action. Errors (sync or async) are\n * contained and logged; they never break the timeline.\n */\n run(context: PluginMessageActionContext): void | Promise;\n}\ninterface PluginAppSlots {\n homepageSection(registration: PluginHomepageSectionRegistration): void;\n settingsSection(registration: PluginSettingsSectionRegistration): void;\n navPanel(registration: PluginNavPanelRegistration): void;\n threadPanelAction(registration: PluginThreadPanelActionRegistration): void;\n pendingInteraction(registration: PluginPendingInteractionRegistration): void;\n sidebarFooterAction(registration: PluginSidebarFooterActionRegistration): void;\n /**\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;\n/**\n * Trusted same-origin JavaScript/TypeScript mounted once per active frontend\n * generation in each bb app window or browser tab.\n */\ninterface PluginContentScriptRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /**\n * Install behavior into the bb app shell. The host awaits a returned\n * promise, contains failures, and calls the returned disposer exactly once.\n */\n mount(context: PluginContentScriptContext): void | PluginContentScriptDisposer | Promise;\n}\n/** 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 {\n /**\n * Invoke one of the plugin's `bb.rpc` methods (POST\n * /api/v1/plugins/<id>/rpc/<method>). Resolves with the method's\n * inferred output; rejects with an `Error` carrying the server's message,\n * stable `code`, and validation `issues` when present.\n */\n call>(method: Method, ...args: PluginRpcCallArgs): Promise>;\n}\ninterface PluginSettingsState {\n /**\n * Effective non-secret setting values (secret settings are excluded —\n * read them server-side). Undefined while loading or unavailable.\n */\n values: Record | undefined;\n isLoading: boolean;\n}\n/** State of the app's shared realtime connection to the bb server. */\ntype PluginRealtimeConnectionState = \"connecting\" | \"connected\" | \"reconnecting\";\n/** Where `useComposer()` writes. */\ntype PluginComposerScope = {\n kind: \"thread\";\n threadId: string;\n} | {\n kind: \"queued-message\";\n threadId: string;\n queuedMessageId: string;\n} | {\n kind: \"side-chat\";\n projectId: string;\n parentThreadId: string;\n tabId: string;\n childThreadId: string | null;\n} | {\n kind: \"new-thread\";\n /** Root compose's effective selected project; null only while unresolved. */\n projectId: string | null;\n};\n/** One plugin-owned composer customization registration. */\ninterface ComposerCustomization {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Composer kinds where this customization is active; omit for all kinds. */\n scopes?: readonly PluginComposerScope[\"kind\"][];\n actions?: readonly {\n id: string;\n component: ComponentType;\n }[];\n banners?: readonly {\n id: string;\n /** Host chrome around the banner. Defaults to `\"card\"`. */\n chrome?: \"card\" | \"bare\";\n component: ComponentType;\n }[];\n plusMenu?: readonly ComposerPlusMenuItem[];\n richText?: ComposerRichTextSpec;\n}\n/** Host-rendered menu row in the composer's `+` menu. */\ninterface ComposerPlusMenuItem {\n id: string;\n label: string;\n /** BB icon name; unknown names fall back to the generic plugin icon. */\n icon?: string;\n /** Accessible description for the host-rendered row. */\n description?: string;\n disabled?: boolean | ((view: ComposerView) => boolean);\n run(context: {\n composer: PluginComposerApi;\n view: ComposerView;\n }): void | Promise;\n}\n/** Reactive read-side of the composer a plugin surface is mounted in. */\ninterface ComposerView {\n scope: PluginComposerScope;\n layout: \"expanded\" | \"compact\" | \"zen\";\n draft: {\n text: string;\n isEmpty: boolean;\n attachmentCount: number;\n };\n run: {\n isRunning: boolean;\n isSubmitting: boolean;\n };\n}\ninterface ComposerRichTextSpec {\n /** Content-derived paint: match ranges receive `className`; text is never mutated. */\n effects?: readonly {\n id: string;\n /** Plain-text offsets into the current structured draft. */\n match(text: string): readonly {\n from: number;\n to: number;\n }[];\n className: string;\n }[];\n /** Debounced, read-only observation of the structured draft. */\n onDraftChange?(draft: ComposerStructuredDraft, view: ComposerView): void;\n}\ninterface ComposerStructuredDraft {\n text: string;\n mentions: readonly {\n from: number;\n to: number;\n provider: string;\n id: string;\n label: string;\n }[];\n}\n/** Host-rendered paint applied to the editable composer text. */\ninterface PluginComposerTextEffect {\n className: string;\n}\n/** Host-rendered status that temporarily replaces a thread's draft glyph. */\ninterface PluginComposerThreadRowStatus {\n /** BB icon-name hint; unknown names fall back to the generic plugin icon. */\n icon: string;\n /** Accessible label for the status glyph. */\n label: string;\n /**\n * Semantic host treatment for the status glyph. `running` automatically\n * shimmers; terminal `success` and `error` tones are static. Defaults to the\n * neutral tone.\n */\n tone?: \"default\" | \"running\" | \"success\" | \"error\";\n}\n/** An @-mention pill bound to one of the calling plugin's mention providers. */\ninterface PluginComposerMention {\n /** Mention provider id registered by THIS plugin via `bb.ui.registerMentionProvider`. */\n provider: string;\n /** Item id your provider's `resolve` will receive at send time. */\n id: string;\n /** Pill text shown in the composer. */\n label: string;\n}\n/**\n * Programmatic access to the chat composer draft — the same shared draft the\n * built-in \"Add to chat\" affordances (file preview, diff, terminal selections)\n * write to. While a queued message is being edited, writes land in that\n * message's inline editor. In a side chat, writes land in the visible side-chat\n * draft. Otherwise, inside a thread context writes land in that thread's draft;\n * anywhere else (nav panel, homepage section) they seed the new-thread composer\n * draft, which persists until the user sends or clears it.\n */\ninterface PluginComposerApi {\n scope: PluginComposerScope;\n /** Current plain text for this composer scope. */\n readonly text: string;\n /**\n * Replace the draft's plain text. Attachments are preserved. Inline mentions\n * outside the changed range are preserved and rebased; mentions overlapped\n * by the replacement are removed because their text representation changed.\n */\n setText(next: string): void;\n /**\n * Replace the draft's plain text from the latest committed value. Uses the\n * same structured-state reconciliation as `setText`.\n */\n updateText(updater: (current: string) => string): void;\n /** Clear plain text without clearing independently attached files. */\n clear(): void;\n /**\n * Apply a host-rendered effect to this composer's editable text, or clear it.\n * Effects are scoped to the calling plugin and automatically clear when the\n * slot unmounts or its composer scope changes.\n */\n setTextEffect(effect: PluginComposerTextEffect | null): void;\n /**\n * Lock or unlock editing for this composer. Locks are scoped to the calling\n * plugin and automatically release when the slot unmounts or its composer\n * scope changes.\n */\n setInputLock(locked: boolean): void;\n /**\n * Append text to the draft as a `> ` blockquote block and focus the\n * composer. Blank text is a no-op. This is the \"reference this selection\n * in chat\" primitive.\n */\n addQuote(text: string): void;\n /**\n * Insert an @-mention pill that resolves through this plugin's mention\n * provider at send time — the durable way to reference an entity whose\n * content should be fetched fresh when the message is sent.\n */\n insertMention(mention: PluginComposerMention): void;\n /** Focus the composer caret at the end of the draft. */\n focus(): void;\n}\n/**\n * A consumer-supplied action on the messages of one `ThreadChat` instance,\n * rendered in the embedded timeline's per-message action bar alongside the\n * native and slot-registered actions. Unlike the `messageAction` slot this is\n * scoped to the rendering component, not registered globally.\n */\ninterface ThreadChatMessageAction {\n /** Unique within this ThreadChat instance; letters, digits, `-`, `_`. */\n id: string;\n /** Tooltip / menu label for the action. */\n title: string;\n /** Icon hint (BB icon name); unknown names fall back to a generic icon. */\n icon?: string;\n /**\n * Message roles the action applies to. Omitted = both user and assistant\n * messages.\n */\n roles?: readonly (\"user\" | \"assistant\")[];\n /**\n * Runs when the user activates the action. Errors (sync or async) are\n * contained and logged; they never break the timeline.\n */\n run(message: ThreadChatMessageReference): void | Promise;\n}\n/**\n * Props of the host-owned `ThreadChat` component — one thread's chat\n * (timeline, and for the composer variants the full send/queue/draft\n * engine), rendered by the BB app inside a plugin slot. This is the\n * deliberate exception to the no-host-components rule (§5.5): a stable\n * product capability, not a UI kit. Versioned additive like slot props;\n * internal timeline rows, query hooks, and prompt-box configuration are\n * deliberately not exposed.\n */\ninterface ThreadChatProps {\n threadId: string;\n /**\n * \"full\" (default) is the page presentation (centered reading width);\n * \"compact\" is the side-panel presentation; \"timeline\" renders the\n * transcript without a composer.\n */\n variant?: \"full\" | \"compact\" | \"timeline\";\n /**\n * \"contained\" (default) fills and scrolls inside a bounded parent;\n * \"document\" grows with its content and defers scrolling to the page.\n */\n layout?: \"contained\" | \"document\";\n /** Bump to focus the composer (ignored by `variant: \"timeline\"`). */\n focusRequest?: number;\n /**\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;\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(): PluginRpcClient;\n useRealtime(channel: string, handler: (payload: unknown) => void): void;\n /**\n * Observe the same shared connection that delivers `useRealtime` signals.\n * Use a subsequent transition to `connected` to reconcile server state that\n * may have changed while ephemeral signals could not be delivered. The first\n * connection can transition from `connecting` and is not a reconnection.\n */\n useRealtimeConnectionState(): PluginRealtimeConnectionState;\n useSettings(): PluginSettingsState;\n useBbContext(): BbContext;\n useBbNavigate(): BbNavigate;\n useComposer(): PluginComposerApi;\n /**\n * The 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;\n /**\n * The host-owned chat-message markdown renderer (see\n * {@link MarkdownProps}).\n */\n Markdown: ComponentType;\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;\n useComposerView(): ComposerView;\n}\n\ndeclare const definePluginApp: (setup: PluginAppSetup) => PluginAppDefinition;\ndeclare const ThreadChat: react.ComponentType;\ndeclare const Markdown: react.ComponentType;\ndeclare const experimental_NewThreadComposer: react.ComponentType;\ndeclare const useRpc: , StandardSchemaV1>>>>() => PluginRpcClient;\ndeclare const useRealtime: (channel: string, handler: (payload: unknown) => void) => void;\ndeclare const useRealtimeConnectionState: () => PluginRealtimeConnectionState;\ndeclare const useSettings: () => PluginSettingsState;\ndeclare const useBbContext: () => BbContext;\ndeclare const useBbNavigate: () => BbNavigate;\ndeclare const useComposer: () => PluginComposerApi;\ndeclare const useComposerView: () => ComposerView;\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 aa7b049d9b..252cba6057 100644 --- a/packages/templates/src/generated/templates.generated.ts +++ b/packages/templates/src/generated/templates.generated.ts @@ -83,7 +83,7 @@ export const templateDefinitions = [ }, { "id": "bbGuidePlugins", - "body": "Plugin commands\n\nA bb plugin is a TypeScript package that extends the bb server in-process:\nbackground services, cron schedules, HTTP/RPC endpoints, thread lifecycle\nhandlers, settings, storage — and `bb` CLI subcommands that agents and humans\nrun like any other command. Plugins are full-trust code inside the server.\n\nPlugins are on by default. Builtin plugins (`builtin:`) ship with bb;\nuser-installed plugins come from `bb plugin install` or the official store.\nPlugin state lives under `/plugins//` (per-plugin SQLite file,\nsecrets, logs).\n\nThe builtin Custom instructions plugin adds a multiline editor under Settings\n→ Custom instructions. Saved text is persisted on this bb host and included in\nagent task instructions; blank text contributes nothing.\n\nThe builtin Workflows plugin runs durable provider-independent JavaScript\norchestration. It is disabled on fresh installations; enable `workflows` under\nExtensions → Plugins or run `bb plugin enable workflows` before using:\n\n bb workflows validate (--script ''|--source ''|\n --file |--name )\n bb workflows run (--script ''|--source ''|\n --file |--name )\n [--args ''] [--resume ]\n bb workflows status \n bb workflows history [--cursor ] [--limit <1-100>]\n bb workflows list [--limit <1-50>]\n bb workflows stop \n\nCommands must run from a BB project thread. Workflows has six plugin\nsettings, configurable with `bb plugin config workflows set `:\n`maxActiveRuns` (default 4, range 1–32), `maxConcurrentAgents` (8, 1–64),\n`maxAgentCalls` (100, 1–1000), `totalRunTimeoutMs` (86400000, 60000–604800000),\n`retentionDays` (30, 1–3650), and `maxNotificationBytes` (16384,\n1024–262144). `maxActiveRuns` applies live; the other five are snapshotted for\neach new run. Settings changes do not require a plugin reload.\n\n`status` is a bounded polling summary, and `list` returns only compact run\nsummaries. Detailed run and call records are paged JSONL: redirect `history`\ninto `$BB_THREAD_STORAGE` before inspecting it, and continue with the final\npage record's `nextCursor`. The invoking shell writes\nthat file on the thread's execution host, so this works the same on local and\nremote hosts without granting the plugin arbitrary filesystem access. Use `bb\nprovider list --environment \"$BB_ENVIRONMENT_ID\" --json` and then `bb provider\nmodels --environment \"$BB_ENVIRONMENT_ID\" --json` before writing\nan explicit selection; never guess ACP model IDs.\n\nThe Memory plugin is an opt-in install, bundled with the app:\n`bb plugin install memory`. Once installed, it injects a compact global and\ncurrent-project memory index into agent context and progressively discloses\nfull records through CLI-only commands. Because its store works across\nproviders, we recommend disabling provider-native memory under Settings →\nProviders to avoid duplicate or conflicting stores. Settings → Memory lists\nevery global and project memory and supports version-checked edits and soft\ndeletion.\n\n bb memory catalog [--scope project|global|all] [--json]\n bb memory search [--scope project|global|all] [--json]\n bb memory get [--scope project|global|all] [--json]\n bb memory add --scope project|global --name --summary \n --details --reason [--kind ]\n [--tag ]... [--importance <0-100>] [--pinned] [--json]\n bb memory update --expected-version [fields...] [--json]\n bb memory forget --expected-version --reason [--json]\n bb memory history [--scope project|global|all] [--limit 1-100] [--json]\n\nProject writes use the invoking CLI's current project. Global writes require\nthe explicit `--scope global` flag.\n\nThe Docs plugin is an opt-in official plugin bundled with the app:\n`bb plugin install docs`. Read-only discovery remains direct, while edits use\na manifest-backed local workspace:\n\n bb docs vaults [--json]\n bb docs list [--vault ] [--json]\n bb docs read [--vault ]\n bb docs pull [--folder] [--vault ] [--into ]\n bb docs pull --all [--vault ] [--into ]\n bb docs status [workspace-dir] [--delete] [--diff] [--json]\n bb docs push [workspace-dir] [--delete] [--dry-run] [--diff] [--json]\n\nPull preserves vault-relative paths and writes `.bb-docs-state.json`; edit the\nordinary files and leave that state file untouched. Push uses pulled SHA-256\nversions as compare-and-swap guards. Concurrent changes stop with exit 3.\nLocal file and empty-directory deletions are warnings unless `--delete` is\nexplicit; a pulled folder root is retained, so pull its parent or the whole\nvault to remove that folder. Use `--workspace-host ` when a standalone\nCLI's working directory is on a non-primary host. Direct `write`, `mkdir`,\n`move`, and `remove` remain only as deprecated compatibility commands.\n\nThe Tasks plugin is an opt-in official plugin bundled with the app:\n`bb plugin install tasks`. It adds a task tracker, agent delegation,\nand the `bb tasks` command. Common agent operations are:\n\n bb tasks show [--json]\n bb tasks list [--project ] [filters...] [--sort manual|priority|due] [--limit 1-500] [--cursor ] [--json]\n bb tasks comment (--body | --body-file ) [--json]\n bb tasks attachment add --file [--json]\n bb tasks attachment get --out [--json]\n bb tasks attach [--json]\n bb tasks update --status in_review [--json]\n bb tasks update (--parent | --no-parent) [--json]\n\nRun `bb tasks --help` for project, folder, task, label, attachment, and demo-data\ncommands, plus preset management, delegation, and attached-thread inspection.\nDelegated threads are attached automatically; use `bb tasks attach` only when\nwork started outside Tasks. Task update resolves both task keys and IDs for\n`--parent`; use `--no-parent` to promote a subtask to the top level. File paths\nin tasks commands resolve on the invoking machine (the thread's machine inside\nan agent thread, otherwise the server's); pass `--machine ` to\ntarget another enrolled machine.\nTask lists default to 100 rows. JSON pages include `nextCursor`; human pages\nprint the exact continuation option when more rows exist. Cursors are bound to\nthe filters, sort, and task-list revision. Any add, removal, reorder, update,\nlabel-link/name change, active-thread change, or project-prefix change invalidates an\noutstanding cursor; restart without `--cursor` instead of accepting a mixed\nsnapshot.\n\nThe builtin Secrets plugin provides a secure credential form and guarded\ndotenv reconciliation:\n\n bb secret request --write-env \n [--purpose ] [--describe ]...\n\nThe command blocks until the user submits or cancels the form. Secret values\nnever appear in command arguments, model-visible output, or persisted\ninteraction data; success prints only the path, variable names, and\nadded/updated/unchanged counts.\n\n bb plugin search Search BB's official plugins (bundled with\n the app)\n bb plugin install Install a bundled official plugin by name\n (github, docs, memory, tasks,\n t3sidebar), a local\n path, builtin:,\n git:@, or\n npm:[@]\n (npm: needs npm on PATH; installs prompt —\n pass --yes to skip). Managed git:/npm:\n installs refuse engines.bb / engines.bbPluginSdk\n mismatches, manifest/artifact identity\n mismatches, and ids reserved by bundled plugins\n Omitted npm specs, ranges, dist-tags, and git\n branches track; exact npm versions, git tags,\n and git commits are pinned\n bb plugin outdated Check installed plugins for compatible\n updates (table; --json for raw results).\n Columns: installed, latest compatible,\n blocked newer (incompatible releases not\n selected), status. Dev builds (bb 0.0.0)\n annotate that engines.bb is not enforced\n bb plugin update | --all Apply compatible updates for one plugin or\n every tracking plugin with an update. Same\n full-trust confirmation as\n install (--yes skips; non-TTY refuses without\n --yes). Use outdated to preview; pinned\n installs stay put\n bb plugin list Status, services, schedules, handler timings\n bb plugin source [--json] Show requested/resolved source, engine ranges,\n install time, and recent activation history\n bb plugin enable|disable Load or unload an installed plugin\n bb plugin reload [id] Re-run factories against current sources\n bb plugin config [set | unset ]\n Show or change a plugin's declared settings\n bb plugin logs [-n N] [-f] Print (or follow) a plugin's bb.log output\n bb plugin run [args...] Run the plugin's CLI command explicitly\n bb plugin token [--rotate] Print the token for auth:\"token\" HTTP\n routes; --rotate generates a new token,\n invalidating the old one\n bb plugin remove Uninstall (managed git:/npm: files deleted;\n builtin removals are remembered)\n bb plugin new [--app] Scaffold a new plugin (no server required;\n --app adds a frontend entry, app.tsx, plus a\n typecheck-only tsconfig.json)\n bb plugin build [path] Compile the plugin into dist/ — the backend\n bundle (server.js, server.meta.json) and,\n when bb.app is declared, the frontend bundle\n (app.js, app.css, app.meta.json). Each\n *.meta.json is stamped with SDK major/version,\n artifactFormatVersion, pluginId, pluginVersion,\n and builtWith (bb + plugin SDK versions); no\n server required\n bb plugin dev [path] Watch a plugin's sources (default: cwd) and\n on every change rebuild its frontend bundle\n (if it declares bb.app) and reload the\n plugin; Ctrl+C to stop\n\nBB Official plugins\n\nBB's official plugins — GitHub, Docs, Memory, Tasks, and T3 Sidebar — ship\nbundled inside the app itself. They appear in Extensions → Plugins → Browse\nand install with one click from the local bundled copy: no network, no\ndownload, no separate release. Install from the CLI by bare name\n(`bb plugin install github`, `bb plugin install docs`,\n`bb plugin install memory`, `bb plugin install tasks`, or\n`bb plugin install t3sidebar`). Installed official plugins are pinned to the\nbundled copy and update automatically when the BB app updates.\n\nFor direct git:/npm: installs, updates are manual: `bb plugin outdated`\nchecks tracking sources and `bb plugin update` applies compatible candidates.\nReinstalling an already-installed managed plugin is refused — use\n`bb plugin update`. A failed activation restores the pre-update snapshot and\nleaves the latest failure visible as needing attention. Exact npm versions,\ngit tags and commits, path sources, and bundled official plugins are pinned;\nnpm ranges/omitted specs/dist-tags and git branches track compatible updates.\n\n`bb plugin search ` matches id, display name, description, and\ncategory across the bundled official plugins (status: installed / compatible\n/ requires newer bb). Install an official plugin by its bare name. Direct\n`path:`, `npm:`, `git:`, and `builtin:` sources—and path-like\nsyntax—continue to bypass official-plugin resolution.\n\nBuilds are automatic once installed. Git installs run `npm install`\n(lifecycle scripts disabled), then compile both bundles — so a git plugin may\ndepend on third-party packages. node_modules is kept, because bundling cannot\ninline data files a dependency reads at runtime. A committed dist/ is always\nreplaced by the bundles bb builds. Path installs compile dist/ at install time\nfrom dependencies you have already installed. A build failure fails the\ninstall. npm packages must ship a metadata-validated prebuilt app or the\ninstall is refused. The server rebuilds source-built apps after a bb upgrade.\n\nInstalling or updating a git plugin requires `npm` on PATH. Checking for\nupdates does not: a check reads the candidate's manifest and stops, so\npolling never resolves a dependency tree or builds. A candidate that fails to\nbuild is reported as available and fails when you apply it.\n\nbb ships no build toolchain. The first time a git or path plugin is built on\na machine, bb downloads a pinned esbuild + Tailwind set into\n`/plugins/toolchain-/` and reuses it afterwards. Installing\na prebuilt npm plugin never triggers that download.\n\nTo build a plugin yourself — in CI, or to check it compiles without a running\nbb — depend on the published `bb-app` package and call the CLI:\n\n```jsonc\n// your plugin's package.json\n\"devDependencies\": { \"bb-app\": \"^0.35.1\" },\n\"scripts\": { \"build\": \"bb plugin build\" }\n```\n\n`bb plugin build` talks to no server. Depending on `bb-app@X` builds with\nexactly that release's shim configuration, so the bundle cannot be built\nagainst a mismatched host runtime. Cache the toolchain directory in CI to skip\nthe download on later runs. Only `bb plugin dev` needs a running bb, because\nit reloads the installed plugin after each rebuild.\n\nThe backend half is prebuilt too: when a builtin/official/git/npm install\nships a dist/server.js built for the running SDK major, the server loads it\ninstead of the TypeScript source. Path installs always load server.ts from\nsource, so `bb plugin dev`/reload see edits immediately.\n\n`bb plugin dev` is the edit loop: it requires the directory to already be\ninstalled as a plugin (`bb plugin install .` first), ignores dist/,\nnode_modules/, and .git/, batches saves, and prints one line per cycle. A\nbuild or reload failure prints the error and keeps watching (a failed build\nskips that cycle's reload). Reloads reach open app pages live — changed\nfrontend bundles re-import and their UI slots remount without a page\nrefresh.\n\nFrontend entries (app.tsx) default-export `definePluginApp` from\n`@bb/plugin-sdk/app` and register UI slots: homepageSection (root compose),\nsettingsSection (per-plugin settings page below the host-rendered settings\nform; no props in V1, optional host-rendered title),\nnavPanel (own sidebar entry + /plugins///* route; the remainder\narrives as the component's subPath prop for panel-internal deep links; the\nhost always renders the shared plugin title bar and the component owns a\nzero-padding full-bleed body, including its scrolling),\nthreadPanelAction\n(an entry in the thread right panel's new-tab Actions list whose run() can\nopen closable panel tabs with recursive `JsonValue` params; restored\ncomponents read `JsonValue | null`), pendingInteraction (temporarily replace a thread composer with a\nplugin form), fileOpener (register as a per-extension file viewer/editor;\nusers pick defaults under Settings → File openers and can right-click a\nfile link for a one-off choice), and messageDirective (replace a leaf\n`::name{k=\"v\"}` block inside assistant / nested-agent Markdown with a plugin\ncomponent; unknown, disabled, incomplete, code-fenced, or crashing\ndirectives fall back to the original source; components receive a nullable\nopenWorkspaceFile(path) callback for opening a worktree-relative file in the\nhost workspace viewer and a nullable\nopenThreadPanel({ actionId, title?, params? }) callback for opening one of the\nsame plugin's thread-panel actions). Hooks:\nuseRpc, useRealtime, useRealtimeConnectionState (the shared realtime socket's\nconnecting/connected/reconnecting lifecycle; reconcile on later connected\ntransitions, not the initial connection), useSettings (secrets excluded),\nuseBbContext,\nuseBbNavigate, useComposer (read/replace/update/clear scoped composer text,\napply a class-based text effect, lock input, quote selections, insert mention\npills, and focus the composer), and useComposerView (reactive bound scope,\nlayout, draft, and run state). Plain-text edits preserve attachments and\nreconcile only inline mentions overlapped by the edit. Define RPC methods with `defineRpcContract`\nand Standard Schema-compatible input/output validators (Zod works directly),\nregister via `bb.rpc.register(contract, handlers)`, then use a type-only\nbackend contract import with `useRpc()` for exact frontend\nmethod/input/result inference. The server validates both schemas and rejects\nnon-JSON results (including cyclic and non-finite values) with structured\nerror codes. Components are vendored shadcn source the plugin owns (the\nshadcn model): `bb plugin new --app` pre-vendors a starter set into\ncomponents/ui/ and `npx shadcn add @bb/` pulls more from the BB\ncomponent registry (the full stock shadcn set, version-matched to the\nrunning BB via the pinned ref in components.json). `import { toast } from\n\"sonner\"` reaches the host toaster; react, the portaling radix families,\nsonner, vaul, and @pierre/diffs (the app's syntax-highlighted diff\nrenderer) are runtime-shimmed (never bundled), everything else\nbundles from the plugin's node_modules (`npm install` for authors; BB installs\nrelease packages with their declared production dependencies). A crashing slot collapses to a\n\"plugin crashed\" chip without\ntouching the rest of the app. Installed plugins and their declared settings\n(same data as `bb plugin config`) also appear under Extensions → Plugins.\n\nPlugin CLI commands: a plugin can register one top-level subcommand (for\nexample `bb github …`). Unknown `bb` commands are looked up against installed\nplugins and proxied to the server, so plugin commands work exactly like core\ncommands; core command names always win. Inside agent threads the generated\n`plugin-commands` skill lists the available plugin commands.\n\nSettings changes do not auto-reload a plugin — run `bb plugin reload `\nafter configuring. Add --json to plugin commands for machine-readable output.\nPlugin CLI stdout plus stderr is capped at 1,048,576 UTF-8 bytes from the\nshared `@bb/plugin-sdk` constant. Results above the ceiling are rejected in\nfull with a structured `plugin_cli_output_too_large` error; output is never\nsilently clipped. Page growing collections and use file/streaming commands for\nlarge content.\n\nAuthoring a plugin\n\nThe loop: `bb plugin new ` scaffolds `./bb-plugin-` (add --app\nfor a frontend entry); `bb plugin install .` registers it; `bb plugin dev`\nwatches and reloads on every save. The manifest is package.json: required\n`bb.name` and `bb.description` human identity, required `bb.branding` with at\nleast `icon` or `logo.light`, `bb.server`\n(backend entry, loaded as TypeScript — no build step), optional `bb.app`\n(frontend entry), optional `bb.skills` (static skill directories auto-imported\ninto agent threads unless filtered by `bb.agents.configure`; default\n`skills/`), `engines.bb` (supported bb range),\nand optional `engines.bbPluginSdk` (supported plugin SDK range; scaffold\nwrites `\"^0.4.1\"` for SDK 0.4.1). The plugin id is the package name minus\n`bb-plugin-`.\n\nPlugins can contribute palettes with `bb.themes`: an array of\n`{ id, name, description?, css }`, where `css` is a plugin-relative `.css`\nfile. Loaded plugin palettes appear in Settings → Appearance and `bb theme\nlist`; their selectable id is `plugin::`. Disabling or\nremoving the owning plugin makes bb fall back to the default palette.\n\nBranding is explicit. Declare `bb.branding.icon` as either the plugin's\ncanonical BB icon name or a plugin-relative compact SVG such as\n`./assets/icon.svg`. BB validates and hash-serves path-shaped SVGs, then\nrenders them as masks that inherit the surrounding text color. Compact chrome\nprefers the manifest icon, then a contribution's local icon hint, and finally\nZap. Roomy surfaces reuse the same icon when no logo override is declared.\n\nAdd `bb.branding.logo.light` only for intentionally different rich/full-size\nidentity artwork; optional `bb.branding.logo.dark` is preferred in dark mode.\nLogo paths must be plugin-relative `.svg`, `.png`, or `.webp` files. Root logo\nfiles are not auto-detected, and a dark logo requires a light logo. Logo-only\nmanifests remain supported for compatibility, so at least an icon or light logo\nis required. Do not duplicate the same artwork across fields. BB rejects nulls,\nempty strings, missing or escaping assets, and unsupported extensions. Reload\nthe plugin to pick up branding changes.\n\nThe backend entry default-exports a factory receiving the full plugin API:\n\n import type { BbPluginApi } from \"@bb/plugin-sdk\";\n export default async function plugin(bb: BbPluginApi) { ... }\n\nThe import is type-only and erased at load; the scaffold ships the full API\nas bundled .d.ts in types/ (tsconfig maps @bb/plugin-sdk to them), so\n`npm install && npx tsc --noEmit` typechecks anywhere — no bb checkout\nneeded. Confused, or need a symbol the types don't explain? Clone the repo:\nhttps://github.com/get-bb/bb. The API in\none line each — bb.log (plugin-scoped logger behind `bb plugin logs`);\nbb.settings.define (declarative settings incl. secrets, editable via\n`bb plugin config`); bb.storage.kv (JSON rows ≤256KB) and\nbb.storage.database()+migrate (the plugin's own database); bb.sdk (the full\nbb SDK — handlers/services only, not the factory; spawned threads are\nattributed to the plugin; `visibility: \"hidden\"` creates directly addressable\nbackground workers omitted from sidebar organization and unread/pending\nfavicon attention, with other behavior unchanged; a child thread inherits\nits parent's visibility and still notifies that parent);\nbb.events.on (observe thread.created/idle/failed/deleted);\nbb.http.route (routes under /api/v1/plugins//http/* with\nlocal/token/none auth); defineRpcContract + bb.rpc.register (Standard\nSchema-validated frontend data plane with inferred backend handlers and\ntype-only frontend method/input/result inference);\nbb.realtime.publish (ephemeral signals to open app pages);\nbb.background.service (long-lived, AbortSignal, restart w/ backoff) and\nbb.background.schedule (durable cron rows); bb.cli.register (a top-level\n`bb ` command agents run through bash, with a shared 1 MiB combined\nstdout/stderr ceiling and atomic structured over-limit errors); bb.agents.registerTool\n(static native tools with zod or JSON-schema parameters) and\nbb.agents.configure (one synchronous per-resolution callback selecting this\nplugin's own tool/skill ids and optional dynamic instructions; tools apply on\nthe next provider session start/resume, while busy skill runtimes defer catalog\nchanges); bb.ui\nregisterMentionProvider (host-rendered UI — no\nfrontend bundle needed); bb.status.needsConfiguration (report\n\"unconfigured\" instead of crashing); bb.onDispose (LIFO cleanup on\nreload/disable/shutdown).\n\nFrontend entries register React slots (homepageSection, settingsSection,\nnavPanel, threadPanelAction, fileOpener, messageDirective) and composer\ncustomizations via `app.composer.customize({ actions, plusMenu, banners,\nrichText })`; action/banner components use `useComposer()` and\n`useComposerView()`, while the host renders plus-menu rows and editor\ndecorations. The deprecated pre-1.0 `slots.composerAccessory` footer API was\nremoved; migrate controls to actions or the plus menu and larger content to\nbanners. Register all frontend surfaces via\ndefinePluginApp, use the hooks\nlisted above, and render vendored components; styling is Tailwind against\nthe host theme's tokens only (semantic classes like bg-background and\ntw-animate-css utilities compile in plugin builds).\n\nFor the complete authoring reference — exact signatures, working snippets\nfor every surface, the reload lifecycle, testing tips, and gotchas — use\nthe built-in `bb-plugin-authoring` skill (agents: it loads on demand;\nhumans: apps/server/src/services/skills/builtin-skills/bb-plugin-authoring/\nin a checkout). The builtin `inline-vis` plugin renders\n`::inline-vis{file=\"demo.html\" height=\"480\"}` through the sidebar's\npath-shaped, sandboxed worktree HTML iframe preview; `height` is optional.\nIts card header includes an open-in-sidebar action for the source HTML file.\nThe `plugins/` directory contains every bundled plugin: the auto-installed\nbuiltins and the store-only BB Official GitHub, Docs, Memory, Tasks, and T3\nSidebar plugins. The `examples/plugins/` reference plugins\ncover slack-bot (webhook bot), agent-enrichment (agent surfaces), and\ncomposer-customization (all composer regions).", + "body": "Plugin commands\n\nA bb plugin is a TypeScript package that extends the bb server in-process:\nbackground services, cron schedules, HTTP/RPC endpoints, thread lifecycle\nhandlers, settings, storage — and `bb` CLI subcommands that agents and humans\nrun like any other command. Plugins are full-trust code inside the server.\n\nPlugins are on by default. Builtin plugins (`builtin:`) ship with bb;\nuser-installed plugins come from `bb plugin install` or the official store.\nPlugin state lives under `/plugins//` (per-plugin SQLite file,\nsecrets, logs).\n\nThe builtin Custom instructions plugin adds a multiline editor under Settings\n→ Custom instructions. Saved text is persisted on this bb host and included in\nagent task instructions; blank text contributes nothing.\n\nThe default-enabled builtin Provider retry plugin continues safe Codex and\nClaude Code turns after a structured subscription window resets. It keeps its\ntimers in memory, coordinates waits by machine/provider subscription, and adds\na composer banner with Refresh, Retry now, and Cancel controls. A server restart\nor plugin reload clears pending timers without changing the original failed\nthread. Inspect it with `bb provider-retry status`; use the `refresh`, `now`,\nand `cancel` subcommands to control it. See `bb guide providers` for the safety\nrules.\n\nThe builtin Workflows plugin runs durable provider-independent JavaScript\norchestration. It is disabled on fresh installations; enable `workflows` under\nExtensions → Plugins or run `bb plugin enable workflows` before using:\n\n bb workflows validate (--script ''|--source ''|\n --file |--name )\n bb workflows run (--script ''|--source ''|\n --file |--name )\n [--args ''] [--resume ]\n bb workflows status \n bb workflows history [--cursor ] [--limit <1-100>]\n bb workflows list [--limit <1-50>]\n bb workflows stop \n\nCommands must run from a BB project thread. Workflows has six plugin\nsettings, configurable with `bb plugin config workflows set `:\n`maxActiveRuns` (default 4, range 1–32), `maxConcurrentAgents` (8, 1–64),\n`maxAgentCalls` (100, 1–1000), `totalRunTimeoutMs` (86400000, 60000–604800000),\n`retentionDays` (30, 1–3650), and `maxNotificationBytes` (16384,\n1024–262144). `maxActiveRuns` applies live; the other five are snapshotted for\neach new run. Settings changes do not require a plugin reload.\n\n`status` is a bounded polling summary, and `list` returns only compact run\nsummaries. Detailed run and call records are paged JSONL: redirect `history`\ninto `$BB_THREAD_STORAGE` before inspecting it, and continue with the final\npage record's `nextCursor`. The invoking shell writes\nthat file on the thread's execution host, so this works the same on local and\nremote hosts without granting the plugin arbitrary filesystem access. Use `bb\nprovider list --environment \"$BB_ENVIRONMENT_ID\" --json` and then `bb provider\nmodels --environment \"$BB_ENVIRONMENT_ID\" --json` before writing\nan explicit selection; never guess ACP model IDs.\n\nThe Memory plugin is an opt-in install, bundled with the app:\n`bb plugin install memory`. Once installed, it injects a compact global and\ncurrent-project memory index into agent context and progressively discloses\nfull records through CLI-only commands. Because its store works across\nproviders, we recommend disabling provider-native memory under Settings →\nProviders to avoid duplicate or conflicting stores. Settings → Memory lists\nevery global and project memory and supports version-checked edits and soft\ndeletion.\n\n bb memory catalog [--scope project|global|all] [--json]\n bb memory search [--scope project|global|all] [--json]\n bb memory get [--scope project|global|all] [--json]\n bb memory add --scope project|global --name --summary \n --details --reason [--kind ]\n [--tag ]... [--importance <0-100>] [--pinned] [--json]\n bb memory update --expected-version [fields...] [--json]\n bb memory forget --expected-version --reason [--json]\n bb memory history [--scope project|global|all] [--limit 1-100] [--json]\n\nProject writes use the invoking CLI's current project. Global writes require\nthe explicit `--scope global` flag.\n\nThe Docs plugin is an opt-in official plugin bundled with the app:\n`bb plugin install docs`. Read-only discovery remains direct, while edits use\na manifest-backed local workspace:\n\n bb docs vaults [--json]\n bb docs list [--vault ] [--json]\n bb docs read [--vault ]\n bb docs pull [--folder] [--vault ] [--into ]\n bb docs pull --all [--vault ] [--into ]\n bb docs status [workspace-dir] [--delete] [--diff] [--json]\n bb docs push [workspace-dir] [--delete] [--dry-run] [--diff] [--json]\n\nPull preserves vault-relative paths and writes `.bb-docs-state.json`; edit the\nordinary files and leave that state file untouched. Push uses pulled SHA-256\nversions as compare-and-swap guards. Concurrent changes stop with exit 3.\nLocal file and empty-directory deletions are warnings unless `--delete` is\nexplicit; a pulled folder root is retained, so pull its parent or the whole\nvault to remove that folder. Use `--workspace-host ` when a standalone\nCLI's working directory is on a non-primary host. Direct `write`, `mkdir`,\n`move`, and `remove` remain only as deprecated compatibility commands.\n\nThe Tasks plugin is an opt-in official plugin bundled with the app:\n`bb plugin install tasks`. It adds a task tracker, agent delegation,\nand the `bb tasks` command. Common agent operations are:\n\n bb tasks show [--json]\n bb tasks list [--project ] [filters...] [--sort manual|priority|due] [--limit 1-500] [--cursor ] [--json]\n bb tasks comment (--body | --body-file ) [--json]\n bb tasks attachment add --file [--json]\n bb tasks attachment get --out [--json]\n bb tasks attach [--json]\n bb tasks update --status in_review [--json]\n bb tasks update (--parent | --no-parent) [--json]\n\nRun `bb tasks --help` for project, folder, task, label, attachment, and demo-data\ncommands, plus preset management, delegation, and attached-thread inspection.\nDelegated threads are attached automatically; use `bb tasks attach` only when\nwork started outside Tasks. Task update resolves both task keys and IDs for\n`--parent`; use `--no-parent` to promote a subtask to the top level. File paths\nin tasks commands resolve on the invoking machine (the thread's machine inside\nan agent thread, otherwise the server's); pass `--machine ` to\ntarget another enrolled machine.\nTask lists default to 100 rows. JSON pages include `nextCursor`; human pages\nprint the exact continuation option when more rows exist. Cursors are bound to\nthe filters, sort, and task-list revision. Any add, removal, reorder, update,\nlabel-link/name change, active-thread change, or project-prefix change invalidates an\noutstanding cursor; restart without `--cursor` instead of accepting a mixed\nsnapshot.\n\nThe builtin Secrets plugin provides a secure credential form and guarded\ndotenv reconciliation:\n\n bb secret request --write-env \n [--purpose ] [--describe ]...\n\nThe command blocks until the user submits or cancels the form. Secret values\nnever appear in command arguments, model-visible output, or persisted\ninteraction data; success prints only the path, variable names, and\nadded/updated/unchanged counts.\n\n bb plugin search Search BB's official plugins (bundled with\n the app)\n bb plugin install Install a bundled official plugin by name\n (github, docs, memory, tasks,\n t3sidebar), a local\n path, builtin:,\n git:@, or\n npm:[@]\n (npm: needs npm on PATH; installs prompt —\n pass --yes to skip). Managed git:/npm:\n installs refuse engines.bb / engines.bbPluginSdk\n mismatches, manifest/artifact identity\n mismatches, and ids reserved by bundled plugins\n Omitted npm specs, ranges, dist-tags, and git\n branches track; exact npm versions, git tags,\n and git commits are pinned\n bb plugin outdated Check installed plugins for compatible\n updates (table; --json for raw results).\n Columns: installed, latest compatible,\n blocked newer (incompatible releases not\n selected), status. Dev builds (bb 0.0.0)\n annotate that engines.bb is not enforced\n bb plugin update | --all Apply compatible updates for one plugin or\n every tracking plugin with an update. Same\n full-trust confirmation as\n install (--yes skips; non-TTY refuses without\n --yes). Use outdated to preview; pinned\n installs stay put\n bb plugin list Status, services, schedules, handler timings\n bb plugin source [--json] Show requested/resolved source, engine ranges,\n install time, and recent activation history\n bb plugin enable|disable Load or unload an installed plugin\n bb plugin reload [id] Re-run factories against current sources\n bb plugin config [set | unset ]\n Show or change a plugin's declared settings\n bb plugin logs [-n N] [-f] Print (or follow) a plugin's bb.log output\n bb plugin run [args...] Run the plugin's CLI command explicitly\n bb plugin token [--rotate] Print the token for auth:\"token\" HTTP\n routes; --rotate generates a new token,\n invalidating the old one\n bb plugin remove Uninstall (managed git:/npm: files deleted;\n builtin removals are remembered)\n bb plugin new [--app] Scaffold a new plugin (no server required;\n --app adds a frontend entry, app.tsx, plus a\n typecheck-only tsconfig.json)\n bb plugin build [path] Compile the plugin into dist/ — the backend\n bundle (server.js, server.meta.json) and,\n when bb.app is declared, the frontend bundle\n (app.js, app.css, app.meta.json). Each\n *.meta.json is stamped with SDK major/version,\n artifactFormatVersion, pluginId, pluginVersion,\n and builtWith (bb + plugin SDK versions); no\n server required\n bb plugin dev [path] Watch a plugin's sources (default: cwd) and\n on every change rebuild its frontend bundle\n (if it declares bb.app) and reload the\n plugin; Ctrl+C to stop\n\nBB Official plugins\n\nBB's official plugins — GitHub, Docs, Memory, Tasks, and T3 Sidebar — ship\nbundled inside the app itself. They appear in Extensions → Plugins → Browse\nand install with one click from the local bundled copy: no network, no\ndownload, no separate release. Install from the CLI by bare name\n(`bb plugin install github`, `bb plugin install docs`,\n`bb plugin install memory`, `bb plugin install tasks`, or\n`bb plugin install t3sidebar`). Installed official plugins are pinned to the\nbundled copy and update automatically when the BB app updates.\n\nFor direct git:/npm: installs, updates are manual: `bb plugin outdated`\nchecks tracking sources and `bb plugin update` applies compatible candidates.\nReinstalling an already-installed managed plugin is refused — use\n`bb plugin update`. A failed activation restores the pre-update snapshot and\nleaves the latest failure visible as needing attention. Exact npm versions,\ngit tags and commits, path sources, and bundled official plugins are pinned;\nnpm ranges/omitted specs/dist-tags and git branches track compatible updates.\n\n`bb plugin search ` matches id, display name, description, and\ncategory across the bundled official plugins (status: installed / compatible\n/ requires newer bb). Install an official plugin by its bare name. Direct\n`path:`, `npm:`, `git:`, and `builtin:` sources—and path-like\nsyntax—continue to bypass official-plugin resolution.\n\nBuilds are automatic once installed. Git installs run `npm install`\n(lifecycle scripts disabled), then compile both bundles — so a git plugin may\ndepend on third-party packages. node_modules is kept, because bundling cannot\ninline data files a dependency reads at runtime. A committed dist/ is always\nreplaced by the bundles bb builds. Path installs compile dist/ at install time\nfrom dependencies you have already installed. A build failure fails the\ninstall. npm packages must ship a metadata-validated prebuilt app or the\ninstall is refused. The server rebuilds source-built apps after a bb upgrade.\n\nInstalling or updating a git plugin requires `npm` on PATH. Checking for\nupdates does not: a check reads the candidate's manifest and stops, so\npolling never resolves a dependency tree or builds. A candidate that fails to\nbuild is reported as available and fails when you apply it.\n\nbb ships no build toolchain. The first time a git or path plugin is built on\na machine, bb downloads a pinned esbuild + Tailwind set into\n`/plugins/toolchain-/` and reuses it afterwards. Installing\na prebuilt npm plugin never triggers that download.\n\nTo build a plugin yourself — in CI, or to check it compiles without a running\nbb — depend on the published `bb-app` package and call the CLI:\n\n```jsonc\n// your plugin's package.json\n\"devDependencies\": { \"bb-app\": \"^0.35.1\" },\n\"scripts\": { \"build\": \"bb plugin build\" }\n```\n\n`bb plugin build` talks to no server. Depending on `bb-app@X` builds with\nexactly that release's shim configuration, so the bundle cannot be built\nagainst a mismatched host runtime. Cache the toolchain directory in CI to skip\nthe download on later runs. Only `bb plugin dev` needs a running bb, because\nit reloads the installed plugin after each rebuild.\n\nThe backend half is prebuilt too: when a builtin/official/git/npm install\nships a dist/server.js built for the running SDK major, the server loads it\ninstead of the TypeScript source. Path installs always load server.ts from\nsource, so `bb plugin dev`/reload see edits immediately.\n\n`bb plugin dev` is the edit loop: it requires the directory to already be\ninstalled as a plugin (`bb plugin install .` first), ignores dist/,\nnode_modules/, and .git/, batches saves, and prints one line per cycle. A\nbuild or reload failure prints the error and keeps watching (a failed build\nskips that cycle's reload). Reloads reach open app pages live — changed\nfrontend bundles re-import and their UI slots remount without a page\nrefresh.\n\nFrontend entries (app.tsx) default-export `definePluginApp` from\n`@bb/plugin-sdk/app` and register UI slots: homepageSection (root compose),\nsettingsSection (per-plugin settings page below the host-rendered settings\nform; no props in V1, optional host-rendered title),\nnavPanel (own sidebar entry + /plugins///* route; the remainder\narrives as the component's subPath prop for panel-internal deep links; the\nhost always renders the shared plugin title bar and the component owns a\nzero-padding full-bleed body, including its scrolling),\nthreadPanelAction\n(an entry in the thread right panel's new-tab Actions list whose run() can\nopen closable panel tabs with recursive `JsonValue` params; restored\ncomponents read `JsonValue | null`), pendingInteraction (temporarily replace a thread composer with a\nplugin form), fileOpener (register as a per-extension file viewer/editor;\nusers pick defaults under Settings → File openers and can right-click a\nfile link for a one-off choice), and messageDirective (replace a leaf\n`::name{k=\"v\"}` block inside assistant / nested-agent Markdown with a plugin\ncomponent; unknown, disabled, incomplete, code-fenced, or crashing\ndirectives fall back to the original source; components receive a nullable\nopenWorkspaceFile(path) callback for opening a worktree-relative file in the\nhost workspace viewer and a nullable\nopenThreadPanel({ actionId, title?, params? }) callback for opening one of the\nsame plugin's thread-panel actions). Hooks:\nuseRpc, useRealtime, useRealtimeConnectionState (the shared realtime socket's\nconnecting/connected/reconnecting lifecycle; reconcile on later connected\ntransitions, not the initial connection), useSettings (secrets excluded),\nuseBbContext,\nuseBbNavigate, useComposer (read/replace/update/clear scoped composer text,\napply a class-based text effect, lock input, quote selections, insert mention\npills, and focus the composer), and useComposerView (reactive bound scope,\nlayout, draft, and run state). Plain-text edits preserve attachments and\nreconcile only inline mentions overlapped by the edit. Define RPC methods with `defineRpcContract`\nand Standard Schema-compatible input/output validators (Zod works directly),\nregister via `bb.rpc.register(contract, handlers)`, then use a type-only\nbackend contract import with `useRpc()` for exact frontend\nmethod/input/result inference. The server validates both schemas and rejects\nnon-JSON results (including cyclic and non-finite values) with structured\nerror codes. Components are vendored shadcn source the plugin owns (the\nshadcn model): `bb plugin new --app` pre-vendors a starter set into\ncomponents/ui/ and `npx shadcn add @bb/` pulls more from the BB\ncomponent registry (the full stock shadcn set, version-matched to the\nrunning BB via the pinned ref in components.json). `import { toast } from\n\"sonner\"` reaches the host toaster; react, the portaling radix families,\nsonner, vaul, and @pierre/diffs (the app's syntax-highlighted diff\nrenderer) are runtime-shimmed (never bundled), everything else\nbundles from the plugin's node_modules (`npm install` for authors; BB installs\nrelease packages with their declared production dependencies). A crashing slot collapses to a\n\"plugin crashed\" chip without\ntouching the rest of the app. Installed plugins and their declared settings\n(same data as `bb plugin config`) also appear under Extensions → Plugins.\n\nPlugin CLI commands: a plugin can register one top-level subcommand (for\nexample `bb github …`). Unknown `bb` commands are looked up against installed\nplugins and proxied to the server, so plugin commands work exactly like core\ncommands; core command names always win. Inside agent threads the generated\n`plugin-commands` skill lists the available plugin commands.\n\nSettings changes do not auto-reload a plugin — run `bb plugin reload `\nafter configuring. Add --json to plugin commands for machine-readable output.\nPlugin CLI stdout plus stderr is capped at 1,048,576 UTF-8 bytes from the\nshared `@bb/plugin-sdk` constant. Results above the ceiling are rejected in\nfull with a structured `plugin_cli_output_too_large` error; output is never\nsilently clipped. Page growing collections and use file/streaming commands for\nlarge content.\n\nAuthoring a plugin\n\nThe loop: `bb plugin new ` scaffolds `./bb-plugin-` (add --app\nfor a frontend entry); `bb plugin install .` registers it; `bb plugin dev`\nwatches and reloads on every save. The manifest is package.json: required\n`bb.name` and `bb.description` human identity, required `bb.branding` with at\nleast `icon` or `logo.light`, `bb.server`\n(backend entry, loaded as TypeScript — no build step), optional `bb.app`\n(frontend entry), optional `bb.skills` (static skill directories auto-imported\ninto agent threads unless filtered by `bb.agents.configure`; default\n`skills/`), `engines.bb` (supported bb range),\nand optional `engines.bbPluginSdk` (supported plugin SDK range; scaffold\nwrites `\"^0.4.1\"` for SDK 0.4.1). The plugin id is the package name minus\n`bb-plugin-`.\n\nPlugins can contribute palettes with `bb.themes`: an array of\n`{ id, name, description?, css }`, where `css` is a plugin-relative `.css`\nfile. Loaded plugin palettes appear in Settings → Appearance and `bb theme\nlist`; their selectable id is `plugin::`. Disabling or\nremoving the owning plugin makes bb fall back to the default palette.\n\nBranding is explicit. Declare `bb.branding.icon` as either the plugin's\ncanonical BB icon name or a plugin-relative compact SVG such as\n`./assets/icon.svg`. BB validates and hash-serves path-shaped SVGs, then\nrenders them as masks that inherit the surrounding text color. Compact chrome\nprefers the manifest icon, then a contribution's local icon hint, and finally\nZap. Roomy surfaces reuse the same icon when no logo override is declared.\n\nAdd `bb.branding.logo.light` only for intentionally different rich/full-size\nidentity artwork; optional `bb.branding.logo.dark` is preferred in dark mode.\nLogo paths must be plugin-relative `.svg`, `.png`, or `.webp` files. Root logo\nfiles are not auto-detected, and a dark logo requires a light logo. Logo-only\nmanifests remain supported for compatibility, so at least an icon or light logo\nis required. Do not duplicate the same artwork across fields. BB rejects nulls,\nempty strings, missing or escaping assets, and unsupported extensions. Reload\nthe plugin to pick up branding changes.\n\nThe backend entry default-exports a factory receiving the full plugin API:\n\n import type { BbPluginApi } from \"@bb/plugin-sdk\";\n export default async function plugin(bb: BbPluginApi) { ... }\n\nThe import is type-only and erased at load; the scaffold ships the full API\nas bundled .d.ts in types/ (tsconfig maps @bb/plugin-sdk to them), so\n`npm install && npx tsc --noEmit` typechecks anywhere — no bb checkout\nneeded. Confused, or need a symbol the types don't explain? Clone the repo:\nhttps://github.com/get-bb/bb. The API in\none line each — bb.log (plugin-scoped logger behind `bb plugin logs`);\nbb.settings.define (declarative settings incl. secrets, editable via\n`bb plugin config`); bb.storage.kv (JSON rows ≤256KB) and\nbb.storage.database()+migrate (the plugin's own database); bb.sdk (the full\nbb SDK — handlers/services only, not the factory; spawned threads are\nattributed to the plugin; `visibility: \"hidden\"` creates directly addressable\nbackground workers omitted from sidebar organization and unread/pending\nfavicon attention, with other behavior unchanged; a child thread inherits\nits parent's visibility and still notifies that parent);\nbb.events.on (observe thread.created/idle/failed/deleted);\nbb.http.route (routes under /api/v1/plugins//http/* with\nlocal/token/none auth); defineRpcContract + bb.rpc.register (Standard\nSchema-validated frontend data plane with inferred backend handlers and\ntype-only frontend method/input/result inference);\nbb.realtime.publish (ephemeral signals to open app pages);\nbb.background.service (long-lived, AbortSignal, restart w/ backoff) and\nbb.background.schedule (durable cron rows); bb.cli.register (a top-level\n`bb ` command agents run through bash, with a shared 1 MiB combined\nstdout/stderr ceiling and atomic structured over-limit errors); bb.agents.registerTool\n(static native tools with zod or JSON-schema parameters) and\nbb.agents.configure (one synchronous per-resolution callback selecting this\nplugin's own tool/skill ids and optional dynamic instructions; tools apply on\nthe next provider session start/resume, while busy skill runtimes defer catalog\nchanges); bb.ui\nregisterMentionProvider (host-rendered UI — no\nfrontend bundle needed); bb.status.needsConfiguration (report\n\"unconfigured\" instead of crashing); bb.onDispose (LIFO cleanup on\nreload/disable/shutdown).\n\nFrontend entries register React slots (homepageSection, settingsSection,\nnavPanel, threadPanelAction, fileOpener, messageDirective) and composer\ncustomizations via `app.composer.customize({ actions, plusMenu, banners,\nrichText })`; action/banner components use `useComposer()` and\n`useComposerView()`, while the host renders plus-menu rows and editor\ndecorations. The deprecated pre-1.0 `slots.composerAccessory` footer API was\nremoved; migrate controls to actions or the plus menu and larger content to\nbanners. Register all frontend surfaces via\ndefinePluginApp, use the hooks\nlisted above, and render vendored components; styling is Tailwind against\nthe host theme's tokens only (semantic classes like bg-background and\ntw-animate-css utilities compile in plugin builds).\n\nFor the complete authoring reference — exact signatures, working snippets\nfor every surface, the reload lifecycle, testing tips, and gotchas — use\nthe built-in `bb-plugin-authoring` skill (agents: it loads on demand;\nhumans: apps/server/src/services/skills/builtin-skills/bb-plugin-authoring/\nin a checkout). The builtin `inline-vis` plugin renders\n`::inline-vis{file=\"demo.html\" height=\"480\"}` through the sidebar's\npath-shaped, sandboxed worktree HTML iframe preview; `height` is optional.\nIts card header includes an open-in-sidebar action for the source HTML file.\nThe `plugins/` directory contains every bundled plugin: the auto-installed\nbuiltins and the store-only BB Official GitHub, Docs, Memory, Tasks, and T3\nSidebar plugins. The `examples/plugins/` reference plugins\ncover slack-bot (webhook bot), agent-enrichment (agent surfaces), and\ncomposer-customization (all composer regions).", "fileName": "bb-guide-plugins.md", "kind": "instruction", "title": "bb Guide — Plugins", @@ -105,7 +105,7 @@ export const templateDefinitions = [ }, { "id": "bbGuideProviders", - "body": "Provider commands\n\nProviders are agent backends (e.g., codex, claude-code). Each supports different models.\n\n bb provider list [--machine | --environment ]\n List available providers\n bb provider models [providerId] [--machine | --environment ]\n List models for a provider\n\nUse these before spawning threads if you are unsure which provider or model to use.\n`--host` is an alias for `--machine`. Machine and environment selectors are\nmutually exclusive because an environment already selects its machine. When no\nselector is supplied, both commands intentionally inspect the primary machine.\nWhen provider and model are omitted from bb thread spawn, the project's\nremembered defaults apply. If the project has no remembered choice, bb uses\nthe explicitly requested provider or Codex, then resolves the model marked\ndefault by that provider on the target machine (falling back to the first\ncatalog model when none is marked).\n\nProvider-native memory can be controlled on the separate Settings → Providers\n→ Codex and Settings → Providers → Claude Code pages. Codex memory controls\nboth recall (`memories.use_memories`) and future generation\n(`memories.generate_memories`). Claude Code memory controls native auto-memory\nreads and writes (`autoMemoryEnabled`). Both preferences default on and apply\nwhen a provider thread is started, resumed, or forked; they do not interrupt\nan active turn. These settings are separate from bb's optional Memory plugin,\nan official plugin bundled with the app.\n\nProvider-native subagents can also be disabled on those provider pages. For\nCodex, bb turns off the native multi-agent feature and caps V2 sessions at the\nroot thread so remote session policy cannot start a child. For Claude Code, bb\nremoves the native Task tool. The preferences default off and apply\nwhen a provider thread is started, resumed, or forked; they do not modify the\nprovider's global configuration.\n\nClaude Code's native Workflow tool can be disabled separately on its provider\npage. This preference also defaults off and applies to newly started, resumed,\nor forked provider sessions.\n\nKnown ACP agents can appear automatically when their CLI is installed on the\nhost. For example, opencode, omp, Grok Build's grok CLI, or Hermes' hermes CLI\non PATH appears as provider acp-opencode, acp-omp, acp-grok, or\nacp-hermes-agent.\n\nCustom ACP agents are configured in the app data-dir config.json under\ncustomAcpAgents. bb derives provider id acp- from each slug id. Edit the JSON\nand run bb-app config refresh; there is no set/unset CLI surface for this list.\nCustom config wins if it uses the same provider id as a known ACP agent; for\nexample, override acp-opencode with id opencode. Use modelCli for CLI model\nlisting/selection, reasoningCli for launch-time reasoning flags, and\nnativeReasoning for ACP session/set_config_option reasoning. Optional logo\naccepts an SVG, PNG, or WebP path; relative paths resolve from the bb data dir.", + "body": "Provider commands\n\nProviders are agent backends (e.g., codex, claude-code). Each supports different models.\n\n bb provider list [--machine | --environment ]\n List available providers\n bb provider models [providerId] [--machine | --environment ]\n List models for a provider\n\nUse these before spawning threads if you are unsure which provider or model to use.\n`--host` is an alias for `--machine`. Machine and environment selectors are\nmutually exclusive because an environment already selects its machine. When no\nselector is supplied, both commands intentionally inspect the primary machine.\nWhen provider and model are omitted from bb thread spawn, the project's\nremembered defaults apply. If the project has no remembered choice, bb uses\nthe explicitly requested provider or Codex, then resolves the model marked\ndefault by that provider on the target machine (falling back to the first\ncatalog model when none is marked).\n\nProvider-native memory can be controlled on the separate Settings → Providers\n→ Codex and Settings → Providers → Claude Code pages. Codex memory controls\nboth recall (`memories.use_memories`) and future generation\n(`memories.generate_memories`). Claude Code memory controls native auto-memory\nreads and writes (`autoMemoryEnabled`). Both preferences default on and apply\nwhen a provider thread is started, resumed, or forked; they do not interrupt\nan active turn. These settings are separate from bb's optional Memory plugin,\nan official plugin bundled with the app.\n\nProvider-native subagents can also be disabled on those provider pages. For\nCodex, bb turns off the native multi-agent feature and caps V2 sessions at the\nroot thread so remote session policy cannot start a child. For Claude Code, bb\nremoves the native Task tool. The preferences default off and apply\nwhen a provider thread is started, resumed, or forked; they do not modify the\nprovider's global configuration.\n\nSubscription limit recovery\n\nThe default-enabled builtin Provider retry plugin recognizes structured Codex\nand Claude Code subscription windows. If a provider terminally rejects an\naccepted turn before it produces output or possible side effects, the plugin\nwaits in memory until the reported reset plus a short buffer, then starts one\nagent-only `Please continue.` turn on the existing provider conversation.\nThreads sharing a machine/provider subscription are released one at a time.\nProvider-native retries remain authoritative while the provider reports that it\nwill retry on its own.\n\n bb settings usage [--machine ] Read live provider usage\n bb provider-retry status [thread-id] [--json] Inspect in-memory waits\n bb provider-retry refresh [--json] Refresh live usage\n bb provider-retry now [--json] Continue now if still safe\n bb provider-retry cancel [--json] Cancel automatic continuation\n bb thread retry [id] [--request-id ] Guarded core continuation\n\nTimed waits exist only while the current bb server/plugin process remains\nrunning. Disabling/reloading the plugin or restarting the server clears them;\nthe original failed thread remains available for `bb thread retry`. Credit and\nspend-control exhaustion without a reset time is shown but never blindly\nretried. Use Refresh after adding credits or changing limits, or Retry now when\nthe user explicitly wants another safe attempt.\n\nClaude Code's native Workflow tool can be disabled separately on its provider\npage. This preference also defaults off and applies to newly started, resumed,\nor forked provider sessions.\n\nKnown ACP agents can appear automatically when their CLI is installed on the\nhost. For example, opencode, omp, Grok Build's grok CLI, or Hermes' hermes CLI\non PATH appears as provider acp-opencode, acp-omp, acp-grok, or\nacp-hermes-agent.\n\nCustom ACP agents are configured in the app data-dir config.json under\ncustomAcpAgents. bb derives provider id acp- from each slug id. Edit the JSON\nand run bb-app config refresh; there is no set/unset CLI surface for this list.\nCustom config wins if it uses the same provider id as a known ACP agent; for\nexample, override acp-opencode with id opencode. Use modelCli for CLI model\nlisting/selection, reasoningCli for launch-time reasoning flags, and\nnativeReasoning for ACP session/set_config_option reasoning. Optional logo\naccepts an SVG, PNG, or WebP path; relative paths resolve from the bb data dir.", "fileName": "bb-guide-providers.md", "kind": "instruction", "title": "bb Guide — Providers", @@ -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 --prompt \"...\" [options]\n\n --prompt Initial prompt (required)\n --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\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 retry [id] Continue a safe subscription-limited turn\n --self Target current thread\n --request-id <id> Require an exact failed request id\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\n `thread retry` is only for a terminal provider subscription-limit failure.\n The server requires accepted input, no assistant output or possible side\n effects, and no newer request. It starts an agent-only system turn containing\n `Please continue.` on the existing provider conversation; it does not resend\n the original prompt or create another user message. The default Provider retry\n plugin invokes this guard automatically for timed limits.\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-plugins.md b/packages/templates/src/templates/bb-guide-plugins.md index 839d6063d2..7069ead609 100644 --- a/packages/templates/src/templates/bb-guide-plugins.md +++ b/packages/templates/src/templates/bb-guide-plugins.md @@ -21,6 +21,15 @@ The builtin Custom instructions plugin adds a multiline editor under Settings → Custom instructions. Saved text is persisted on this bb host and included in agent task instructions; blank text contributes nothing. +The default-enabled builtin Provider retry plugin continues safe Codex and +Claude Code turns after a structured subscription window resets. It keeps its +timers in memory, coordinates waits by machine/provider subscription, and adds +a composer banner with Refresh, Retry now, and Cancel controls. A server restart +or plugin reload clears pending timers without changing the original failed +thread. Inspect it with `bb provider-retry status`; use the `refresh`, `now`, +and `cancel` subcommands to control it. See `bb guide providers` for the safety +rules. + The builtin Workflows plugin runs durable provider-independent JavaScript orchestration. It is disabled on fresh installations; enable `workflows` under Extensions → Plugins or run `bb plugin enable workflows` before using: diff --git a/packages/templates/src/templates/bb-guide-providers.md b/packages/templates/src/templates/bb-guide-providers.md index 75d1590c54..3d1be02b6e 100644 --- a/packages/templates/src/templates/bb-guide-providers.md +++ b/packages/templates/src/templates/bb-guide-providers.md @@ -40,6 +40,31 @@ removes the native Task tool. The preferences default off and apply when a provider thread is started, resumed, or forked; they do not modify the provider's global configuration. +Subscription limit recovery + +The default-enabled builtin Provider retry plugin recognizes structured Codex +and Claude Code subscription windows. If a provider terminally rejects an +accepted turn before it produces output or possible side effects, the plugin +waits in memory until the reported reset plus a short buffer, then starts one +agent-only `Please continue.` turn on the existing provider conversation. +Threads sharing a machine/provider subscription are released one at a time. +Provider-native retries remain authoritative while the provider reports that it +will retry on its own. + + bb settings usage [--machine <id-or-name>] Read live provider usage + bb provider-retry status [thread-id] [--json] Inspect in-memory waits + bb provider-retry refresh <thread-id> [--json] Refresh live usage + bb provider-retry now <thread-id> [--json] Continue now if still safe + bb provider-retry cancel <thread-id> [--json] Cancel automatic continuation + bb thread retry [id] [--request-id <id>] Guarded core continuation + +Timed waits exist only while the current bb server/plugin process remains +running. Disabling/reloading the plugin or restarting the server clears them; +the original failed thread remains available for `bb thread retry`. Credit and +spend-control exhaustion without a reset time is shown but never blindly +retried. Use Refresh after adding credits or changing limits, or Retry now when +the user explicitly wants another safe attempt. + Claude Code's native Workflow tool can be disabled separately on its provider page. This preference also defaults off and applies to newly started, resumed, or forked provider sessions. diff --git a/packages/templates/src/templates/bb-guide-threads.md b/packages/templates/src/templates/bb-guide-threads.md index 1b033cd807..f5126dcfe4 100644 --- a/packages/templates/src/templates/bb-guide-threads.md +++ b/packages/templates/src/templates/bb-guide-threads.md @@ -160,10 +160,20 @@ Messaging: is free. bb thread stop [id] Stop an active or provisioning thread + bb thread retry [id] Continue a safe subscription-limited turn + --self Target current thread + --request-id <id> Require an exact failed request id bb thread cancel-plan [id] Exit the provider's active Plan mode bb thread clear-goal [id] Clear the provider's active Goal --self Target current thread + `thread retry` is only for a terminal provider subscription-limit failure. + The server requires accepted input, no assistant output or possible side + effects, and no newer request. It starts an agent-only system turn containing + `Please continue.` on the existing provider conversation; it does not resend + the original prompt or create another user message. The default Provider retry + plugin invokes this guard automatically for timed limits. + Ownership: bb thread update [id] Update thread metadata diff --git a/plugins/provider-retry/server.test.ts b/plugins/provider-retry/server.test.ts index 0ac65fe999..15d38d6abf 100644 --- a/plugins/provider-retry/server.test.ts +++ b/plugins/provider-retry/server.test.ts @@ -118,14 +118,14 @@ describe("provider retry scheduler", () => { expect(continueAfterRateLimit).toHaveBeenCalledTimes(1); expect(continueAfterRateLimit).toHaveBeenLastCalledWith({ threadId: "thread-a", - expectedRequestId: "request-thread-a", + failedRequestId: "request-thread-a", }); await vi.advanceTimersByTimeAsync(RELEASE_PACE_MS); expect(continueAfterRateLimit).toHaveBeenCalledTimes(2); expect(continueAfterRateLimit).toHaveBeenLastCalledWith({ threadId: "thread-b", - expectedRequestId: "request-thread-b", + failedRequestId: "request-thread-b", }); await host.harness.dispose(); }); diff --git a/plugins/provider-retry/src/service.ts b/plugins/provider-retry/src/service.ts index faa72daaeb..f85ef922dc 100644 --- a/plugins/provider-retry/src/service.ts +++ b/plugins/provider-retry/src/service.ts @@ -503,7 +503,7 @@ export class ProviderRetryService { } await this.bb.sdk.threads.continueAfterRateLimit({ threadId, - expectedRequestId: failedRequestId, + failedRequestId, }); this.remove(threadId); return true; From a90f95978f9c18fde04f3b2f9486ce78a6ed6419 Mon Sep 17 00:00:00 2001 From: Michael Yong <wrong92@gmail.com> Date: Wed, 5 Aug 2026 11:34:59 -0700 Subject: [PATCH 06/21] test: register provider retry in plugin catalog --- .../services/plugin-catalog/plugin-catalog-routes.test.ts | 4 ++-- apps/server/test/services/plugins/official-plugins.test.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/server/test/services/plugin-catalog/plugin-catalog-routes.test.ts b/apps/server/test/services/plugin-catalog/plugin-catalog-routes.test.ts index 014f3afd2c..00360ff4cc 100644 --- a/apps/server/test/services/plugin-catalog/plugin-catalog-routes.test.ts +++ b/apps/server/test/services/plugin-catalog/plugin-catalog-routes.test.ts @@ -30,8 +30,8 @@ describe("plugin catalog routes", () => { const status = await app.request("/plugin-catalog"); await expect(status.json()).resolves.toMatchObject({ catalog: { - pluginCount: 13, - includedPluginCount: 8, + pluginCount: 14, + includedPluginCount: 9, optionalPluginCount: 5, }, }); diff --git a/apps/server/test/services/plugins/official-plugins.test.ts b/apps/server/test/services/plugins/official-plugins.test.ts index 82ed7e96d0..b35cb21c84 100644 --- a/apps/server/test/services/plugins/official-plugins.test.ts +++ b/apps/server/test/services/plugins/official-plugins.test.ts @@ -94,6 +94,7 @@ describe("official plugin registry invariants", () => { github: "Developer tools", "inline-vis": "Interface", memory: "Context & knowledge", + "provider-retry": "Agent interaction", secrets: "Developer tools", "side-chat": "Agent interaction", t3sidebar: "Interface", From 792bc50ca4a51375d9f293d83ae5e6d58a5936f7 Mon Sep 17 00:00:00 2001 From: Michael Yong <wrong92@gmail.com> Date: Wed, 5 Aug 2026 11:36:14 -0700 Subject: [PATCH 07/21] fix: report provider retry cancellation races --- plugins/provider-retry/app.test.tsx | 24 ++++++++++++++++++++++++ plugins/provider-retry/app.tsx | 21 ++++++++------------- 2 files changed, 32 insertions(+), 13 deletions(-) diff --git a/plugins/provider-retry/app.test.tsx b/plugins/provider-retry/app.test.tsx index fef199d684..47b12938cb 100644 --- a/plugins/provider-retry/app.test.tsx +++ b/plugins/provider-retry/app.test.tsx @@ -128,4 +128,28 @@ describe("provider retry app", () => { await slot.findByText(/There is no automatic reset time/i), ).toBeTruthy(); }); + + it("keeps the banner when cancellation loses to an in-progress release", async () => { + const slot = renderSlot( + banner, + {}, + { + composer: { scope: { kind: "thread", threadId: "thread-one" } }, + rpc: { + providerRetryStatus: () => ({ view: waitingView }), + providerRetryNow: () => ({ started: true, view: null }), + providerRetryCancel: () => ({ cancelled: false }), + providerRetryRefresh: () => ({ view: waitingView }), + }, + }, + ); + + fireEvent.click(await slot.findByRole("button", { name: "Cancel" })); + expect( + await slot.findByText("This continuation is already in progress."), + ).toBeTruthy(); + expect( + slot.getByRole("region", { name: "Provider usage recovery" }), + ).toBeTruthy(); + }); }); diff --git a/plugins/provider-retry/app.tsx b/plugins/provider-retry/app.tsx index 6c476085ba..fa4ed723fe 100644 --- a/plugins/provider-retry/app.tsx +++ b/plugins/provider-retry/app.tsx @@ -75,7 +75,6 @@ function ProviderRetryBannerForThread({ threadId }: { threadId: string }) { const [view, setView] = useState<ProviderRetryView | null>(null); const [busy, setBusy] = useState<"cancel" | "now" | "refresh" | null>(null); const [actionError, setActionError] = useState<string | null>(null); - const [, setClockTick] = useState(0); const load = useCallback(async () => { const result = await rpc.call("providerRetryStatus", { threadId }); @@ -105,23 +104,19 @@ function ProviderRetryBannerForThread({ threadId }: { threadId: string }) { if (reconnected) void load().catch(() => undefined); }, [connection, load]); - useEffect(() => { - if (view?.phase !== "waiting-for-reset" || view.dueAtMs === null) return; - const interval = window.setInterval( - () => setClockTick((tick) => tick + 1), - 1_000, - ); - return () => window.clearInterval(interval); - }, [view?.dueAtMs, view?.phase]); - const runAction = useCallback( async (action: "cancel" | "now" | "refresh") => { setBusy(action); setActionError(null); try { if (action === "cancel") { - await rpc.call("providerRetryCancel", { threadId }); - setView(null); + const result = await rpc.call("providerRetryCancel", { threadId }); + if (result.cancelled) { + setView(null); + } else { + await load(); + setActionError("This continuation is already in progress."); + } } else if (action === "now") { const result = await rpc.call("providerRetryNow", { threadId }); setView(result.view); @@ -138,7 +133,7 @@ function ProviderRetryBannerForThread({ threadId }: { threadId: string }) { setBusy(null); } }, - [rpc, threadId], + [load, rpc, threadId], ); if (view === null) return null; From 7d118f674957064eff9f74086fcc7781f3235ee7 Mon Sep 17 00:00:00 2001 From: Michael Yong <wrong92@gmail.com> Date: Wed, 5 Aug 2026 12:08:57 -0700 Subject: [PATCH 08/21] fix: make provider retry opt in --- .../src/services/plugins/builtin-registry.ts | 2 +- .../skills/builtin-skills/bb-cli/SKILL.md | 7 +++--- .../services/plugins/builtin-plugins.test.ts | 25 +++++++++++++++++++ .../src/generated/templates.generated.ts | 6 ++--- .../src/templates/bb-guide-plugins.md | 5 ++-- .../src/templates/bb-guide-providers.md | 17 +++++++------ .../src/templates/bb-guide-threads.md | 4 +-- 7 files changed, 47 insertions(+), 19 deletions(-) diff --git a/apps/server/src/services/plugins/builtin-registry.ts b/apps/server/src/services/plugins/builtin-registry.ts index 74688485cc..a97cb52604 100644 --- a/apps/server/src/services/plugins/builtin-registry.ts +++ b/apps/server/src/services/plugins/builtin-registry.ts @@ -75,7 +75,7 @@ export const BUILTIN_PLUGINS = [ { name: "provider-retry", pluginId: "provider-retry", - defaultEnabled: true, + defaultEnabled: false, category: "Agent interaction", }, { 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 6ac92e7a5d..81d79bef8b 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 @@ -371,9 +371,10 @@ For review or fix pipelines, get the environment ID from - For failed threads, inspect `bb thread show <id> --json` and `bb thread log <id>` before deciding whether to retry, clarify, or update the user. -- The default Provider retry plugin automatically waits for structured Codex - and Claude Code subscription-window resets when the failed turn was accepted - but produced no output or possible side effects. Its timers last only while +- The opt-in Provider retry plugin automatically waits for structured Codex and + Claude Code subscription-window resets when the failed turn was accepted but + produced no output or possible side effects. Enable it with `bb plugin enable +provider-retry` or under Extensions → Plugins. Its timers last only while the current bb server/plugin process is running. Inspect it with `bb provider-retry status [thread-id]`; use the same command's `refresh`, `now`, and `cancel` subcommands to control the wait. `bb settings usage` diff --git a/apps/server/test/services/plugins/builtin-plugins.test.ts b/apps/server/test/services/plugins/builtin-plugins.test.ts index fbe0ca62e2..3a00b32318 100644 --- a/apps/server/test/services/plugins/builtin-plugins.test.ts +++ b/apps/server/test/services/plugins/builtin-plugins.test.ts @@ -398,6 +398,31 @@ describe("builtin plugin reconciliation", () => { ]); }); + it("ships Provider retry disabled on a fresh database", async () => { + const providerRetry = BUILTIN_PLUGINS.find( + (builtin) => builtin.name === "provider-retry", + ); + expect(providerRetry?.defaultEnabled).toBe(false); + + service = createService({ + db, + dataDir: join(workDir, "data"), + builtinName: "provider-retry", + defaultEnabled: providerRetry?.defaultEnabled, + rootDir: resolveBuiltinPluginRootPath("provider-retry"), + }); + await service.start(); + + expect(service.list()).toMatchObject([ + { + id: "provider-retry", + source: "builtin:provider-retry", + enabled: false, + status: "disabled", + }, + ]); + }); + it("loads the builtin connect plugin like other builtins", async () => { service = createService({ db, diff --git a/packages/templates/src/generated/templates.generated.ts b/packages/templates/src/generated/templates.generated.ts index 252cba6057..2ff69e87ad 100644 --- a/packages/templates/src/generated/templates.generated.ts +++ b/packages/templates/src/generated/templates.generated.ts @@ -83,7 +83,7 @@ export const templateDefinitions = [ }, { "id": "bbGuidePlugins", - "body": "Plugin commands\n\nA bb plugin is a TypeScript package that extends the bb server in-process:\nbackground services, cron schedules, HTTP/RPC endpoints, thread lifecycle\nhandlers, settings, storage — and `bb` CLI subcommands that agents and humans\nrun like any other command. Plugins are full-trust code inside the server.\n\nPlugins are on by default. Builtin plugins (`builtin:<name>`) ship with bb;\nuser-installed plugins come from `bb plugin install` or the official store.\nPlugin state lives under `<bb-data-dir>/plugins/<id>/` (per-plugin SQLite file,\nsecrets, logs).\n\nThe builtin Custom instructions plugin adds a multiline editor under Settings\n→ Custom instructions. Saved text is persisted on this bb host and included in\nagent task instructions; blank text contributes nothing.\n\nThe default-enabled builtin Provider retry plugin continues safe Codex and\nClaude Code turns after a structured subscription window resets. It keeps its\ntimers in memory, coordinates waits by machine/provider subscription, and adds\na composer banner with Refresh, Retry now, and Cancel controls. A server restart\nor plugin reload clears pending timers without changing the original failed\nthread. Inspect it with `bb provider-retry status`; use the `refresh`, `now`,\nand `cancel` subcommands to control it. See `bb guide providers` for the safety\nrules.\n\nThe builtin Workflows plugin runs durable provider-independent JavaScript\norchestration. It is disabled on fresh installations; enable `workflows` under\nExtensions → Plugins or run `bb plugin enable workflows` before using:\n\n bb workflows validate (--script '<javascript>'|--source '<javascript>'|\n --file <path>|--name <name>)\n bb workflows run (--script '<javascript>'|--source '<javascript>'|\n --file <path>|--name <name>)\n [--args '<json>'] [--resume <run-id>]\n bb workflows status <run-id>\n bb workflows history <run-id> [--cursor <call-index>] [--limit <1-100>]\n bb workflows list [--limit <1-50>]\n bb workflows stop <run-id>\n\nCommands must run from a BB project thread. Workflows has six plugin\nsettings, configurable with `bb plugin config workflows set <key> <value>`:\n`maxActiveRuns` (default 4, range 1–32), `maxConcurrentAgents` (8, 1–64),\n`maxAgentCalls` (100, 1–1000), `totalRunTimeoutMs` (86400000, 60000–604800000),\n`retentionDays` (30, 1–3650), and `maxNotificationBytes` (16384,\n1024–262144). `maxActiveRuns` applies live; the other five are snapshotted for\neach new run. Settings changes do not require a plugin reload.\n\n`status` is a bounded polling summary, and `list` returns only compact run\nsummaries. Detailed run and call records are paged JSONL: redirect `history`\ninto `$BB_THREAD_STORAGE` before inspecting it, and continue with the final\npage record's `nextCursor`. The invoking shell writes\nthat file on the thread's execution host, so this works the same on local and\nremote hosts without granting the plugin arbitrary filesystem access. Use `bb\nprovider list --environment \"$BB_ENVIRONMENT_ID\" --json` and then `bb provider\nmodels <provider-id> --environment \"$BB_ENVIRONMENT_ID\" --json` before writing\nan explicit selection; never guess ACP model IDs.\n\nThe Memory plugin is an opt-in install, bundled with the app:\n`bb plugin install memory`. Once installed, it injects a compact global and\ncurrent-project memory index into agent context and progressively discloses\nfull records through CLI-only commands. Because its store works across\nproviders, we recommend disabling provider-native memory under Settings →\nProviders to avoid duplicate or conflicting stores. Settings → Memory lists\nevery global and project memory and supports version-checked edits and soft\ndeletion.\n\n bb memory catalog [--scope project|global|all] [--json]\n bb memory search <query> [--scope project|global|all] [--json]\n bb memory get <id> [--scope project|global|all] [--json]\n bb memory add --scope project|global --name <name> --summary <text>\n --details <text> --reason <text> [--kind <kind>]\n [--tag <tag>]... [--importance <0-100>] [--pinned] [--json]\n bb memory update <id> --expected-version <n> [fields...] [--json]\n bb memory forget <id> --expected-version <n> --reason <text> [--json]\n bb memory history <id> [--scope project|global|all] [--limit 1-100] [--json]\n\nProject writes use the invoking CLI's current project. Global writes require\nthe explicit `--scope global` flag.\n\nThe Docs plugin is an opt-in official plugin bundled with the app:\n`bb plugin install docs`. Read-only discovery remains direct, while edits use\na manifest-backed local workspace:\n\n bb docs vaults [--json]\n bb docs list [--vault <id>] [--json]\n bb docs read <path> [--vault <id>]\n bb docs pull <path> [--folder] [--vault <id>] [--into <dir>]\n bb docs pull --all [--vault <id>] [--into <dir>]\n bb docs status [workspace-dir] [--delete] [--diff] [--json]\n bb docs push [workspace-dir] [--delete] [--dry-run] [--diff] [--json]\n\nPull preserves vault-relative paths and writes `.bb-docs-state.json`; edit the\nordinary files and leave that state file untouched. Push uses pulled SHA-256\nversions as compare-and-swap guards. Concurrent changes stop with exit 3.\nLocal file and empty-directory deletions are warnings unless `--delete` is\nexplicit; a pulled folder root is retained, so pull its parent or the whole\nvault to remove that folder. Use `--workspace-host <id>` when a standalone\nCLI's working directory is on a non-primary host. Direct `write`, `mkdir`,\n`move`, and `remove` remain only as deprecated compatibility commands.\n\nThe Tasks plugin is an opt-in official plugin bundled with the app:\n`bb plugin install tasks`. It adds a task tracker, agent delegation,\nand the `bb tasks` command. Common agent operations are:\n\n bb tasks show <key-or-id> [--json]\n bb tasks list [--project <prefix-or-id>] [filters...] [--sort manual|priority|due] [--limit 1-500] [--cursor <opaque>] [--json]\n bb tasks comment <key-or-id> (--body <markdown> | --body-file <path>) [--json]\n bb tasks attachment add <key-or-comment-id> --file <path> [--json]\n bb tasks attachment get <attachment-id> --out <path> [--json]\n bb tasks attach <key-or-id> [--json]\n bb tasks update <key-or-id> --status in_review [--json]\n bb tasks update <key-or-id> (--parent <parent-key-or-id> | --no-parent) [--json]\n\nRun `bb tasks --help` for project, folder, task, label, attachment, and demo-data\ncommands, plus preset management, delegation, and attached-thread inspection.\nDelegated threads are attached automatically; use `bb tasks attach` only when\nwork started outside Tasks. Task update resolves both task keys and IDs for\n`--parent`; use `--no-parent` to promote a subtask to the top level. File paths\nin tasks commands resolve on the invoking machine (the thread's machine inside\nan agent thread, otherwise the server's); pass `--machine <id-or-name>` to\ntarget another enrolled machine.\nTask lists default to 100 rows. JSON pages include `nextCursor`; human pages\nprint the exact continuation option when more rows exist. Cursors are bound to\nthe filters, sort, and task-list revision. Any add, removal, reorder, update,\nlabel-link/name change, active-thread change, or project-prefix change invalidates an\noutstanding cursor; restart without `--cursor` instead of accepting a mixed\nsnapshot.\n\nThe builtin Secrets plugin provides a secure credential form and guarded\ndotenv reconciliation:\n\n bb secret request <NAME...> --write-env <path>\n [--purpose <text>] [--describe <NAME> <text>]...\n\nThe command blocks until the user submits or cancels the form. Secret values\nnever appear in command arguments, model-visible output, or persisted\ninteraction data; success prints only the path, variable names, and\nadded/updated/unchanged counts.\n\n bb plugin search <query> Search BB's official plugins (bundled with\n the app)\n bb plugin install <entry> Install a bundled official plugin by name\n (github, docs, memory, tasks,\n t3sidebar), a local\n path, builtin:<name>,\n git:<url>@<ref>, or\n npm:<package>[@<version|tag|range>]\n (npm: needs npm on PATH; installs prompt —\n pass --yes to skip). Managed git:/npm:\n installs refuse engines.bb / engines.bbPluginSdk\n mismatches, manifest/artifact identity\n mismatches, and ids reserved by bundled plugins\n Omitted npm specs, ranges, dist-tags, and git\n branches track; exact npm versions, git tags,\n and git commits are pinned\n bb plugin outdated Check installed plugins for compatible\n updates (table; --json for raw results).\n Columns: installed, latest compatible,\n blocked newer (incompatible releases not\n selected), status. Dev builds (bb 0.0.0)\n annotate that engines.bb is not enforced\n bb plugin update <id> | --all Apply compatible updates for one plugin or\n every tracking plugin with an update. Same\n full-trust confirmation as\n install (--yes skips; non-TTY refuses without\n --yes). Use outdated to preview; pinned\n installs stay put\n bb plugin list Status, services, schedules, handler timings\n bb plugin source <id> [--json] Show requested/resolved source, engine ranges,\n install time, and recent activation history\n bb plugin enable|disable <id> Load or unload an installed plugin\n bb plugin reload [id] Re-run factories against current sources\n bb plugin config <id> [set <key> <value> | unset <key>]\n Show or change a plugin's declared settings\n bb plugin logs <id> [-n N] [-f] Print (or follow) a plugin's bb.log output\n bb plugin run <id> [args...] Run the plugin's CLI command explicitly\n bb plugin token <id> [--rotate] Print the token for auth:\"token\" HTTP\n routes; --rotate generates a new token,\n invalidating the old one\n bb plugin remove <id> Uninstall (managed git:/npm: files deleted;\n builtin removals are remembered)\n bb plugin new <name> [--app] Scaffold a new plugin (no server required;\n --app adds a frontend entry, app.tsx, plus a\n typecheck-only tsconfig.json)\n bb plugin build [path] Compile the plugin into dist/ — the backend\n bundle (server.js, server.meta.json) and,\n when bb.app is declared, the frontend bundle\n (app.js, app.css, app.meta.json). Each\n *.meta.json is stamped with SDK major/version,\n artifactFormatVersion, pluginId, pluginVersion,\n and builtWith (bb + plugin SDK versions); no\n server required\n bb plugin dev [path] Watch a plugin's sources (default: cwd) and\n on every change rebuild its frontend bundle\n (if it declares bb.app) and reload the\n plugin; Ctrl+C to stop\n\nBB Official plugins\n\nBB's official plugins — GitHub, Docs, Memory, Tasks, and T3 Sidebar — ship\nbundled inside the app itself. They appear in Extensions → Plugins → Browse\nand install with one click from the local bundled copy: no network, no\ndownload, no separate release. Install from the CLI by bare name\n(`bb plugin install github`, `bb plugin install docs`,\n`bb plugin install memory`, `bb plugin install tasks`, or\n`bb plugin install t3sidebar`). Installed official plugins are pinned to the\nbundled copy and update automatically when the BB app updates.\n\nFor direct git:/npm: installs, updates are manual: `bb plugin outdated`\nchecks tracking sources and `bb plugin update` applies compatible candidates.\nReinstalling an already-installed managed plugin is refused — use\n`bb plugin update`. A failed activation restores the pre-update snapshot and\nleaves the latest failure visible as needing attention. Exact npm versions,\ngit tags and commits, path sources, and bundled official plugins are pinned;\nnpm ranges/omitted specs/dist-tags and git branches track compatible updates.\n\n`bb plugin search <query>` matches id, display name, description, and\ncategory across the bundled official plugins (status: installed / compatible\n/ requires newer bb). Install an official plugin by its bare name. Direct\n`path:`, `npm:`, `git:`, and `builtin:` sources—and path-like\nsyntax—continue to bypass official-plugin resolution.\n\nBuilds are automatic once installed. Git installs run `npm install`\n(lifecycle scripts disabled), then compile both bundles — so a git plugin may\ndepend on third-party packages. node_modules is kept, because bundling cannot\ninline data files a dependency reads at runtime. A committed dist/ is always\nreplaced by the bundles bb builds. Path installs compile dist/ at install time\nfrom dependencies you have already installed. A build failure fails the\ninstall. npm packages must ship a metadata-validated prebuilt app or the\ninstall is refused. The server rebuilds source-built apps after a bb upgrade.\n\nInstalling or updating a git plugin requires `npm` on PATH. Checking for\nupdates does not: a check reads the candidate's manifest and stops, so\npolling never resolves a dependency tree or builds. A candidate that fails to\nbuild is reported as available and fails when you apply it.\n\nbb ships no build toolchain. The first time a git or path plugin is built on\na machine, bb downloads a pinned esbuild + Tailwind set into\n`<dataDir>/plugins/toolchain-<versions>/` and reuses it afterwards. Installing\na prebuilt npm plugin never triggers that download.\n\nTo build a plugin yourself — in CI, or to check it compiles without a running\nbb — depend on the published `bb-app` package and call the CLI:\n\n```jsonc\n// your plugin's package.json\n\"devDependencies\": { \"bb-app\": \"^0.35.1\" },\n\"scripts\": { \"build\": \"bb plugin build\" }\n```\n\n`bb plugin build` talks to no server. Depending on `bb-app@X` builds with\nexactly that release's shim configuration, so the bundle cannot be built\nagainst a mismatched host runtime. Cache the toolchain directory in CI to skip\nthe download on later runs. Only `bb plugin dev` needs a running bb, because\nit reloads the installed plugin after each rebuild.\n\nThe backend half is prebuilt too: when a builtin/official/git/npm install\nships a dist/server.js built for the running SDK major, the server loads it\ninstead of the TypeScript source. Path installs always load server.ts from\nsource, so `bb plugin dev`/reload see edits immediately.\n\n`bb plugin dev` is the edit loop: it requires the directory to already be\ninstalled as a plugin (`bb plugin install .` first), ignores dist/,\nnode_modules/, and .git/, batches saves, and prints one line per cycle. A\nbuild or reload failure prints the error and keeps watching (a failed build\nskips that cycle's reload). Reloads reach open app pages live — changed\nfrontend bundles re-import and their UI slots remount without a page\nrefresh.\n\nFrontend entries (app.tsx) default-export `definePluginApp` from\n`@bb/plugin-sdk/app` and register UI slots: homepageSection (root compose),\nsettingsSection (per-plugin settings page below the host-rendered settings\nform; no props in V1, optional host-rendered title),\nnavPanel (own sidebar entry + /plugins/<id>/<path>/* route; the remainder\narrives as the component's subPath prop for panel-internal deep links; the\nhost always renders the shared plugin title bar and the component owns a\nzero-padding full-bleed body, including its scrolling),\nthreadPanelAction\n(an entry in the thread right panel's new-tab Actions list whose run() can\nopen closable panel tabs with recursive `JsonValue` params; restored\ncomponents read `JsonValue | null`), pendingInteraction (temporarily replace a thread composer with a\nplugin form), fileOpener (register as a per-extension file viewer/editor;\nusers pick defaults under Settings → File openers and can right-click a\nfile link for a one-off choice), and messageDirective (replace a leaf\n`::name{k=\"v\"}` block inside assistant / nested-agent Markdown with a plugin\ncomponent; unknown, disabled, incomplete, code-fenced, or crashing\ndirectives fall back to the original source; components receive a nullable\nopenWorkspaceFile(path) callback for opening a worktree-relative file in the\nhost workspace viewer and a nullable\nopenThreadPanel({ actionId, title?, params? }) callback for opening one of the\nsame plugin's thread-panel actions). Hooks:\nuseRpc, useRealtime, useRealtimeConnectionState (the shared realtime socket's\nconnecting/connected/reconnecting lifecycle; reconcile on later connected\ntransitions, not the initial connection), useSettings (secrets excluded),\nuseBbContext,\nuseBbNavigate, useComposer (read/replace/update/clear scoped composer text,\napply a class-based text effect, lock input, quote selections, insert mention\npills, and focus the composer), and useComposerView (reactive bound scope,\nlayout, draft, and run state). Plain-text edits preserve attachments and\nreconcile only inline mentions overlapped by the edit. Define RPC methods with `defineRpcContract`\nand Standard Schema-compatible input/output validators (Zod works directly),\nregister via `bb.rpc.register(contract, handlers)`, then use a type-only\nbackend contract import with `useRpc<typeof contract>()` for exact frontend\nmethod/input/result inference. The server validates both schemas and rejects\nnon-JSON results (including cyclic and non-finite values) with structured\nerror codes. Components are vendored shadcn source the plugin owns (the\nshadcn model): `bb plugin new --app` pre-vendors a starter set into\ncomponents/ui/ and `npx shadcn add @bb/<name>` pulls more from the BB\ncomponent registry (the full stock shadcn set, version-matched to the\nrunning BB via the pinned ref in components.json). `import { toast } from\n\"sonner\"` reaches the host toaster; react, the portaling radix families,\nsonner, vaul, and @pierre/diffs (the app's syntax-highlighted diff\nrenderer) are runtime-shimmed (never bundled), everything else\nbundles from the plugin's node_modules (`npm install` for authors; BB installs\nrelease packages with their declared production dependencies). A crashing slot collapses to a\n\"plugin <id> crashed\" chip without\ntouching the rest of the app. Installed plugins and their declared settings\n(same data as `bb plugin config`) also appear under Extensions → Plugins.\n\nPlugin CLI commands: a plugin can register one top-level subcommand (for\nexample `bb github …`). Unknown `bb` commands are looked up against installed\nplugins and proxied to the server, so plugin commands work exactly like core\ncommands; core command names always win. Inside agent threads the generated\n`plugin-commands` skill lists the available plugin commands.\n\nSettings changes do not auto-reload a plugin — run `bb plugin reload <id>`\nafter configuring. Add --json to plugin commands for machine-readable output.\nPlugin CLI stdout plus stderr is capped at 1,048,576 UTF-8 bytes from the\nshared `@bb/plugin-sdk` constant. Results above the ceiling are rejected in\nfull with a structured `plugin_cli_output_too_large` error; output is never\nsilently clipped. Page growing collections and use file/streaming commands for\nlarge content.\n\nAuthoring a plugin\n\nThe loop: `bb plugin new <name>` scaffolds `./bb-plugin-<name>` (add --app\nfor a frontend entry); `bb plugin install .` registers it; `bb plugin dev`\nwatches and reloads on every save. The manifest is package.json: required\n`bb.name` and `bb.description` human identity, required `bb.branding` with at\nleast `icon` or `logo.light`, `bb.server`\n(backend entry, loaded as TypeScript — no build step), optional `bb.app`\n(frontend entry), optional `bb.skills` (static skill directories auto-imported\ninto agent threads unless filtered by `bb.agents.configure`; default\n`skills/`), `engines.bb` (supported bb range),\nand optional `engines.bbPluginSdk` (supported plugin SDK range; scaffold\nwrites `\"^0.4.1\"` for SDK 0.4.1). The plugin id is the package name minus\n`bb-plugin-`.\n\nPlugins can contribute palettes with `bb.themes`: an array of\n`{ id, name, description?, css }`, where `css` is a plugin-relative `.css`\nfile. Loaded plugin palettes appear in Settings → Appearance and `bb theme\nlist`; their selectable id is `plugin:<plugin-id>:<theme-id>`. Disabling or\nremoving the owning plugin makes bb fall back to the default palette.\n\nBranding is explicit. Declare `bb.branding.icon` as either the plugin's\ncanonical BB icon name or a plugin-relative compact SVG such as\n`./assets/icon.svg`. BB validates and hash-serves path-shaped SVGs, then\nrenders them as masks that inherit the surrounding text color. Compact chrome\nprefers the manifest icon, then a contribution's local icon hint, and finally\nZap. Roomy surfaces reuse the same icon when no logo override is declared.\n\nAdd `bb.branding.logo.light` only for intentionally different rich/full-size\nidentity artwork; optional `bb.branding.logo.dark` is preferred in dark mode.\nLogo paths must be plugin-relative `.svg`, `.png`, or `.webp` files. Root logo\nfiles are not auto-detected, and a dark logo requires a light logo. Logo-only\nmanifests remain supported for compatibility, so at least an icon or light logo\nis required. Do not duplicate the same artwork across fields. BB rejects nulls,\nempty strings, missing or escaping assets, and unsupported extensions. Reload\nthe plugin to pick up branding changes.\n\nThe backend entry default-exports a factory receiving the full plugin API:\n\n import type { BbPluginApi } from \"@bb/plugin-sdk\";\n export default async function plugin(bb: BbPluginApi) { ... }\n\nThe import is type-only and erased at load; the scaffold ships the full API\nas bundled .d.ts in types/ (tsconfig maps @bb/plugin-sdk to them), so\n`npm install && npx tsc --noEmit` typechecks anywhere — no bb checkout\nneeded. Confused, or need a symbol the types don't explain? Clone the repo:\nhttps://github.com/get-bb/bb. The API in\none line each — bb.log (plugin-scoped logger behind `bb plugin logs`);\nbb.settings.define (declarative settings incl. secrets, editable via\n`bb plugin config`); bb.storage.kv (JSON rows ≤256KB) and\nbb.storage.database()+migrate (the plugin's own database); bb.sdk (the full\nbb SDK — handlers/services only, not the factory; spawned threads are\nattributed to the plugin; `visibility: \"hidden\"` creates directly addressable\nbackground workers omitted from sidebar organization and unread/pending\nfavicon attention, with other behavior unchanged; a child thread inherits\nits parent's visibility and still notifies that parent);\nbb.events.on (observe thread.created/idle/failed/deleted);\nbb.http.route (routes under /api/v1/plugins/<id>/http/* with\nlocal/token/none auth); defineRpcContract + bb.rpc.register (Standard\nSchema-validated frontend data plane with inferred backend handlers and\ntype-only frontend method/input/result inference);\nbb.realtime.publish (ephemeral signals to open app pages);\nbb.background.service (long-lived, AbortSignal, restart w/ backoff) and\nbb.background.schedule (durable cron rows); bb.cli.register (a top-level\n`bb <name>` command agents run through bash, with a shared 1 MiB combined\nstdout/stderr ceiling and atomic structured over-limit errors); bb.agents.registerTool\n(static native tools with zod or JSON-schema parameters) and\nbb.agents.configure (one synchronous per-resolution callback selecting this\nplugin's own tool/skill ids and optional dynamic instructions; tools apply on\nthe next provider session start/resume, while busy skill runtimes defer catalog\nchanges); bb.ui\nregisterMentionProvider (host-rendered UI — no\nfrontend bundle needed); bb.status.needsConfiguration (report\n\"unconfigured\" instead of crashing); bb.onDispose (LIFO cleanup on\nreload/disable/shutdown).\n\nFrontend entries register React slots (homepageSection, settingsSection,\nnavPanel, threadPanelAction, fileOpener, messageDirective) and composer\ncustomizations via `app.composer.customize({ actions, plusMenu, banners,\nrichText })`; action/banner components use `useComposer()` and\n`useComposerView()`, while the host renders plus-menu rows and editor\ndecorations. The deprecated pre-1.0 `slots.composerAccessory` footer API was\nremoved; migrate controls to actions or the plus menu and larger content to\nbanners. Register all frontend surfaces via\ndefinePluginApp, use the hooks\nlisted above, and render vendored components; styling is Tailwind against\nthe host theme's tokens only (semantic classes like bg-background and\ntw-animate-css utilities compile in plugin builds).\n\nFor the complete authoring reference — exact signatures, working snippets\nfor every surface, the reload lifecycle, testing tips, and gotchas — use\nthe built-in `bb-plugin-authoring` skill (agents: it loads on demand;\nhumans: apps/server/src/services/skills/builtin-skills/bb-plugin-authoring/\nin a checkout). The builtin `inline-vis` plugin renders\n`::inline-vis{file=\"demo.html\" height=\"480\"}` through the sidebar's\npath-shaped, sandboxed worktree HTML iframe preview; `height` is optional.\nIts card header includes an open-in-sidebar action for the source HTML file.\nThe `plugins/` directory contains every bundled plugin: the auto-installed\nbuiltins and the store-only BB Official GitHub, Docs, Memory, Tasks, and T3\nSidebar plugins. The `examples/plugins/` reference plugins\ncover slack-bot (webhook bot), agent-enrichment (agent surfaces), and\ncomposer-customization (all composer regions).", + "body": "Plugin commands\n\nA bb plugin is a TypeScript package that extends the bb server in-process:\nbackground services, cron schedules, HTTP/RPC endpoints, thread lifecycle\nhandlers, settings, storage — and `bb` CLI subcommands that agents and humans\nrun like any other command. Plugins are full-trust code inside the server.\n\nPlugins are on by default. Builtin plugins (`builtin:<name>`) ship with bb;\nuser-installed plugins come from `bb plugin install` or the official store.\nPlugin state lives under `<bb-data-dir>/plugins/<id>/` (per-plugin SQLite file,\nsecrets, logs).\n\nThe builtin Custom instructions plugin adds a multiline editor under Settings\n→ Custom instructions. Saved text is persisted on this bb host and included in\nagent task instructions; blank text contributes nothing.\n\nThe opt-in builtin Provider retry plugin continues safe Codex and Claude Code\nturns after a structured subscription window resets. Enable it under\nExtensions → Plugins or run `bb plugin enable provider-retry`. It keeps its\ntimers in memory, coordinates waits by machine/provider subscription, and adds\na composer banner with Refresh, Retry now, and Cancel controls. A server restart\nor plugin reload clears pending timers without changing the original failed\nthread. Inspect it with `bb provider-retry status`; use the `refresh`, `now`,\nand `cancel` subcommands to control it. See `bb guide providers` for the safety\nrules.\n\nThe builtin Workflows plugin runs durable provider-independent JavaScript\norchestration. It is disabled on fresh installations; enable `workflows` under\nExtensions → Plugins or run `bb plugin enable workflows` before using:\n\n bb workflows validate (--script '<javascript>'|--source '<javascript>'|\n --file <path>|--name <name>)\n bb workflows run (--script '<javascript>'|--source '<javascript>'|\n --file <path>|--name <name>)\n [--args '<json>'] [--resume <run-id>]\n bb workflows status <run-id>\n bb workflows history <run-id> [--cursor <call-index>] [--limit <1-100>]\n bb workflows list [--limit <1-50>]\n bb workflows stop <run-id>\n\nCommands must run from a BB project thread. Workflows has six plugin\nsettings, configurable with `bb plugin config workflows set <key> <value>`:\n`maxActiveRuns` (default 4, range 1–32), `maxConcurrentAgents` (8, 1–64),\n`maxAgentCalls` (100, 1–1000), `totalRunTimeoutMs` (86400000, 60000–604800000),\n`retentionDays` (30, 1–3650), and `maxNotificationBytes` (16384,\n1024–262144). `maxActiveRuns` applies live; the other five are snapshotted for\neach new run. Settings changes do not require a plugin reload.\n\n`status` is a bounded polling summary, and `list` returns only compact run\nsummaries. Detailed run and call records are paged JSONL: redirect `history`\ninto `$BB_THREAD_STORAGE` before inspecting it, and continue with the final\npage record's `nextCursor`. The invoking shell writes\nthat file on the thread's execution host, so this works the same on local and\nremote hosts without granting the plugin arbitrary filesystem access. Use `bb\nprovider list --environment \"$BB_ENVIRONMENT_ID\" --json` and then `bb provider\nmodels <provider-id> --environment \"$BB_ENVIRONMENT_ID\" --json` before writing\nan explicit selection; never guess ACP model IDs.\n\nThe Memory plugin is an opt-in install, bundled with the app:\n`bb plugin install memory`. Once installed, it injects a compact global and\ncurrent-project memory index into agent context and progressively discloses\nfull records through CLI-only commands. Because its store works across\nproviders, we recommend disabling provider-native memory under Settings →\nProviders to avoid duplicate or conflicting stores. Settings → Memory lists\nevery global and project memory and supports version-checked edits and soft\ndeletion.\n\n bb memory catalog [--scope project|global|all] [--json]\n bb memory search <query> [--scope project|global|all] [--json]\n bb memory get <id> [--scope project|global|all] [--json]\n bb memory add --scope project|global --name <name> --summary <text>\n --details <text> --reason <text> [--kind <kind>]\n [--tag <tag>]... [--importance <0-100>] [--pinned] [--json]\n bb memory update <id> --expected-version <n> [fields...] [--json]\n bb memory forget <id> --expected-version <n> --reason <text> [--json]\n bb memory history <id> [--scope project|global|all] [--limit 1-100] [--json]\n\nProject writes use the invoking CLI's current project. Global writes require\nthe explicit `--scope global` flag.\n\nThe Docs plugin is an opt-in official plugin bundled with the app:\n`bb plugin install docs`. Read-only discovery remains direct, while edits use\na manifest-backed local workspace:\n\n bb docs vaults [--json]\n bb docs list [--vault <id>] [--json]\n bb docs read <path> [--vault <id>]\n bb docs pull <path> [--folder] [--vault <id>] [--into <dir>]\n bb docs pull --all [--vault <id>] [--into <dir>]\n bb docs status [workspace-dir] [--delete] [--diff] [--json]\n bb docs push [workspace-dir] [--delete] [--dry-run] [--diff] [--json]\n\nPull preserves vault-relative paths and writes `.bb-docs-state.json`; edit the\nordinary files and leave that state file untouched. Push uses pulled SHA-256\nversions as compare-and-swap guards. Concurrent changes stop with exit 3.\nLocal file and empty-directory deletions are warnings unless `--delete` is\nexplicit; a pulled folder root is retained, so pull its parent or the whole\nvault to remove that folder. Use `--workspace-host <id>` when a standalone\nCLI's working directory is on a non-primary host. Direct `write`, `mkdir`,\n`move`, and `remove` remain only as deprecated compatibility commands.\n\nThe Tasks plugin is an opt-in official plugin bundled with the app:\n`bb plugin install tasks`. It adds a task tracker, agent delegation,\nand the `bb tasks` command. Common agent operations are:\n\n bb tasks show <key-or-id> [--json]\n bb tasks list [--project <prefix-or-id>] [filters...] [--sort manual|priority|due] [--limit 1-500] [--cursor <opaque>] [--json]\n bb tasks comment <key-or-id> (--body <markdown> | --body-file <path>) [--json]\n bb tasks attachment add <key-or-comment-id> --file <path> [--json]\n bb tasks attachment get <attachment-id> --out <path> [--json]\n bb tasks attach <key-or-id> [--json]\n bb tasks update <key-or-id> --status in_review [--json]\n bb tasks update <key-or-id> (--parent <parent-key-or-id> | --no-parent) [--json]\n\nRun `bb tasks --help` for project, folder, task, label, attachment, and demo-data\ncommands, plus preset management, delegation, and attached-thread inspection.\nDelegated threads are attached automatically; use `bb tasks attach` only when\nwork started outside Tasks. Task update resolves both task keys and IDs for\n`--parent`; use `--no-parent` to promote a subtask to the top level. File paths\nin tasks commands resolve on the invoking machine (the thread's machine inside\nan agent thread, otherwise the server's); pass `--machine <id-or-name>` to\ntarget another enrolled machine.\nTask lists default to 100 rows. JSON pages include `nextCursor`; human pages\nprint the exact continuation option when more rows exist. Cursors are bound to\nthe filters, sort, and task-list revision. Any add, removal, reorder, update,\nlabel-link/name change, active-thread change, or project-prefix change invalidates an\noutstanding cursor; restart without `--cursor` instead of accepting a mixed\nsnapshot.\n\nThe builtin Secrets plugin provides a secure credential form and guarded\ndotenv reconciliation:\n\n bb secret request <NAME...> --write-env <path>\n [--purpose <text>] [--describe <NAME> <text>]...\n\nThe command blocks until the user submits or cancels the form. Secret values\nnever appear in command arguments, model-visible output, or persisted\ninteraction data; success prints only the path, variable names, and\nadded/updated/unchanged counts.\n\n bb plugin search <query> Search BB's official plugins (bundled with\n the app)\n bb plugin install <entry> Install a bundled official plugin by name\n (github, docs, memory, tasks,\n t3sidebar), a local\n path, builtin:<name>,\n git:<url>@<ref>, or\n npm:<package>[@<version|tag|range>]\n (npm: needs npm on PATH; installs prompt —\n pass --yes to skip). Managed git:/npm:\n installs refuse engines.bb / engines.bbPluginSdk\n mismatches, manifest/artifact identity\n mismatches, and ids reserved by bundled plugins\n Omitted npm specs, ranges, dist-tags, and git\n branches track; exact npm versions, git tags,\n and git commits are pinned\n bb plugin outdated Check installed plugins for compatible\n updates (table; --json for raw results).\n Columns: installed, latest compatible,\n blocked newer (incompatible releases not\n selected), status. Dev builds (bb 0.0.0)\n annotate that engines.bb is not enforced\n bb plugin update <id> | --all Apply compatible updates for one plugin or\n every tracking plugin with an update. Same\n full-trust confirmation as\n install (--yes skips; non-TTY refuses without\n --yes). Use outdated to preview; pinned\n installs stay put\n bb plugin list Status, services, schedules, handler timings\n bb plugin source <id> [--json] Show requested/resolved source, engine ranges,\n install time, and recent activation history\n bb plugin enable|disable <id> Load or unload an installed plugin\n bb plugin reload [id] Re-run factories against current sources\n bb plugin config <id> [set <key> <value> | unset <key>]\n Show or change a plugin's declared settings\n bb plugin logs <id> [-n N] [-f] Print (or follow) a plugin's bb.log output\n bb plugin run <id> [args...] Run the plugin's CLI command explicitly\n bb plugin token <id> [--rotate] Print the token for auth:\"token\" HTTP\n routes; --rotate generates a new token,\n invalidating the old one\n bb plugin remove <id> Uninstall (managed git:/npm: files deleted;\n builtin removals are remembered)\n bb plugin new <name> [--app] Scaffold a new plugin (no server required;\n --app adds a frontend entry, app.tsx, plus a\n typecheck-only tsconfig.json)\n bb plugin build [path] Compile the plugin into dist/ — the backend\n bundle (server.js, server.meta.json) and,\n when bb.app is declared, the frontend bundle\n (app.js, app.css, app.meta.json). Each\n *.meta.json is stamped with SDK major/version,\n artifactFormatVersion, pluginId, pluginVersion,\n and builtWith (bb + plugin SDK versions); no\n server required\n bb plugin dev [path] Watch a plugin's sources (default: cwd) and\n on every change rebuild its frontend bundle\n (if it declares bb.app) and reload the\n plugin; Ctrl+C to stop\n\nBB Official plugins\n\nBB's official plugins — GitHub, Docs, Memory, Tasks, and T3 Sidebar — ship\nbundled inside the app itself. They appear in Extensions → Plugins → Browse\nand install with one click from the local bundled copy: no network, no\ndownload, no separate release. Install from the CLI by bare name\n(`bb plugin install github`, `bb plugin install docs`,\n`bb plugin install memory`, `bb plugin install tasks`, or\n`bb plugin install t3sidebar`). Installed official plugins are pinned to the\nbundled copy and update automatically when the BB app updates.\n\nFor direct git:/npm: installs, updates are manual: `bb plugin outdated`\nchecks tracking sources and `bb plugin update` applies compatible candidates.\nReinstalling an already-installed managed plugin is refused — use\n`bb plugin update`. A failed activation restores the pre-update snapshot and\nleaves the latest failure visible as needing attention. Exact npm versions,\ngit tags and commits, path sources, and bundled official plugins are pinned;\nnpm ranges/omitted specs/dist-tags and git branches track compatible updates.\n\n`bb plugin search <query>` matches id, display name, description, and\ncategory across the bundled official plugins (status: installed / compatible\n/ requires newer bb). Install an official plugin by its bare name. Direct\n`path:`, `npm:`, `git:`, and `builtin:` sources—and path-like\nsyntax—continue to bypass official-plugin resolution.\n\nBuilds are automatic once installed. Git installs run `npm install`\n(lifecycle scripts disabled), then compile both bundles — so a git plugin may\ndepend on third-party packages. node_modules is kept, because bundling cannot\ninline data files a dependency reads at runtime. A committed dist/ is always\nreplaced by the bundles bb builds. Path installs compile dist/ at install time\nfrom dependencies you have already installed. A build failure fails the\ninstall. npm packages must ship a metadata-validated prebuilt app or the\ninstall is refused. The server rebuilds source-built apps after a bb upgrade.\n\nInstalling or updating a git plugin requires `npm` on PATH. Checking for\nupdates does not: a check reads the candidate's manifest and stops, so\npolling never resolves a dependency tree or builds. A candidate that fails to\nbuild is reported as available and fails when you apply it.\n\nbb ships no build toolchain. The first time a git or path plugin is built on\na machine, bb downloads a pinned esbuild + Tailwind set into\n`<dataDir>/plugins/toolchain-<versions>/` and reuses it afterwards. Installing\na prebuilt npm plugin never triggers that download.\n\nTo build a plugin yourself — in CI, or to check it compiles without a running\nbb — depend on the published `bb-app` package and call the CLI:\n\n```jsonc\n// your plugin's package.json\n\"devDependencies\": { \"bb-app\": \"^0.35.1\" },\n\"scripts\": { \"build\": \"bb plugin build\" }\n```\n\n`bb plugin build` talks to no server. Depending on `bb-app@X` builds with\nexactly that release's shim configuration, so the bundle cannot be built\nagainst a mismatched host runtime. Cache the toolchain directory in CI to skip\nthe download on later runs. Only `bb plugin dev` needs a running bb, because\nit reloads the installed plugin after each rebuild.\n\nThe backend half is prebuilt too: when a builtin/official/git/npm install\nships a dist/server.js built for the running SDK major, the server loads it\ninstead of the TypeScript source. Path installs always load server.ts from\nsource, so `bb plugin dev`/reload see edits immediately.\n\n`bb plugin dev` is the edit loop: it requires the directory to already be\ninstalled as a plugin (`bb plugin install .` first), ignores dist/,\nnode_modules/, and .git/, batches saves, and prints one line per cycle. A\nbuild or reload failure prints the error and keeps watching (a failed build\nskips that cycle's reload). Reloads reach open app pages live — changed\nfrontend bundles re-import and their UI slots remount without a page\nrefresh.\n\nFrontend entries (app.tsx) default-export `definePluginApp` from\n`@bb/plugin-sdk/app` and register UI slots: homepageSection (root compose),\nsettingsSection (per-plugin settings page below the host-rendered settings\nform; no props in V1, optional host-rendered title),\nnavPanel (own sidebar entry + /plugins/<id>/<path>/* route; the remainder\narrives as the component's subPath prop for panel-internal deep links; the\nhost always renders the shared plugin title bar and the component owns a\nzero-padding full-bleed body, including its scrolling),\nthreadPanelAction\n(an entry in the thread right panel's new-tab Actions list whose run() can\nopen closable panel tabs with recursive `JsonValue` params; restored\ncomponents read `JsonValue | null`), pendingInteraction (temporarily replace a thread composer with a\nplugin form), fileOpener (register as a per-extension file viewer/editor;\nusers pick defaults under Settings → File openers and can right-click a\nfile link for a one-off choice), and messageDirective (replace a leaf\n`::name{k=\"v\"}` block inside assistant / nested-agent Markdown with a plugin\ncomponent; unknown, disabled, incomplete, code-fenced, or crashing\ndirectives fall back to the original source; components receive a nullable\nopenWorkspaceFile(path) callback for opening a worktree-relative file in the\nhost workspace viewer and a nullable\nopenThreadPanel({ actionId, title?, params? }) callback for opening one of the\nsame plugin's thread-panel actions). Hooks:\nuseRpc, useRealtime, useRealtimeConnectionState (the shared realtime socket's\nconnecting/connected/reconnecting lifecycle; reconcile on later connected\ntransitions, not the initial connection), useSettings (secrets excluded),\nuseBbContext,\nuseBbNavigate, useComposer (read/replace/update/clear scoped composer text,\napply a class-based text effect, lock input, quote selections, insert mention\npills, and focus the composer), and useComposerView (reactive bound scope,\nlayout, draft, and run state). Plain-text edits preserve attachments and\nreconcile only inline mentions overlapped by the edit. Define RPC methods with `defineRpcContract`\nand Standard Schema-compatible input/output validators (Zod works directly),\nregister via `bb.rpc.register(contract, handlers)`, then use a type-only\nbackend contract import with `useRpc<typeof contract>()` for exact frontend\nmethod/input/result inference. The server validates both schemas and rejects\nnon-JSON results (including cyclic and non-finite values) with structured\nerror codes. Components are vendored shadcn source the plugin owns (the\nshadcn model): `bb plugin new --app` pre-vendors a starter set into\ncomponents/ui/ and `npx shadcn add @bb/<name>` pulls more from the BB\ncomponent registry (the full stock shadcn set, version-matched to the\nrunning BB via the pinned ref in components.json). `import { toast } from\n\"sonner\"` reaches the host toaster; react, the portaling radix families,\nsonner, vaul, and @pierre/diffs (the app's syntax-highlighted diff\nrenderer) are runtime-shimmed (never bundled), everything else\nbundles from the plugin's node_modules (`npm install` for authors; BB installs\nrelease packages with their declared production dependencies). A crashing slot collapses to a\n\"plugin <id> crashed\" chip without\ntouching the rest of the app. Installed plugins and their declared settings\n(same data as `bb plugin config`) also appear under Extensions → Plugins.\n\nPlugin CLI commands: a plugin can register one top-level subcommand (for\nexample `bb github …`). Unknown `bb` commands are looked up against installed\nplugins and proxied to the server, so plugin commands work exactly like core\ncommands; core command names always win. Inside agent threads the generated\n`plugin-commands` skill lists the available plugin commands.\n\nSettings changes do not auto-reload a plugin — run `bb plugin reload <id>`\nafter configuring. Add --json to plugin commands for machine-readable output.\nPlugin CLI stdout plus stderr is capped at 1,048,576 UTF-8 bytes from the\nshared `@bb/plugin-sdk` constant. Results above the ceiling are rejected in\nfull with a structured `plugin_cli_output_too_large` error; output is never\nsilently clipped. Page growing collections and use file/streaming commands for\nlarge content.\n\nAuthoring a plugin\n\nThe loop: `bb plugin new <name>` scaffolds `./bb-plugin-<name>` (add --app\nfor a frontend entry); `bb plugin install .` registers it; `bb plugin dev`\nwatches and reloads on every save. The manifest is package.json: required\n`bb.name` and `bb.description` human identity, required `bb.branding` with at\nleast `icon` or `logo.light`, `bb.server`\n(backend entry, loaded as TypeScript — no build step), optional `bb.app`\n(frontend entry), optional `bb.skills` (static skill directories auto-imported\ninto agent threads unless filtered by `bb.agents.configure`; default\n`skills/`), `engines.bb` (supported bb range),\nand optional `engines.bbPluginSdk` (supported plugin SDK range; scaffold\nwrites `\"^0.4.1\"` for SDK 0.4.1). The plugin id is the package name minus\n`bb-plugin-`.\n\nPlugins can contribute palettes with `bb.themes`: an array of\n`{ id, name, description?, css }`, where `css` is a plugin-relative `.css`\nfile. Loaded plugin palettes appear in Settings → Appearance and `bb theme\nlist`; their selectable id is `plugin:<plugin-id>:<theme-id>`. Disabling or\nremoving the owning plugin makes bb fall back to the default palette.\n\nBranding is explicit. Declare `bb.branding.icon` as either the plugin's\ncanonical BB icon name or a plugin-relative compact SVG such as\n`./assets/icon.svg`. BB validates and hash-serves path-shaped SVGs, then\nrenders them as masks that inherit the surrounding text color. Compact chrome\nprefers the manifest icon, then a contribution's local icon hint, and finally\nZap. Roomy surfaces reuse the same icon when no logo override is declared.\n\nAdd `bb.branding.logo.light` only for intentionally different rich/full-size\nidentity artwork; optional `bb.branding.logo.dark` is preferred in dark mode.\nLogo paths must be plugin-relative `.svg`, `.png`, or `.webp` files. Root logo\nfiles are not auto-detected, and a dark logo requires a light logo. Logo-only\nmanifests remain supported for compatibility, so at least an icon or light logo\nis required. Do not duplicate the same artwork across fields. BB rejects nulls,\nempty strings, missing or escaping assets, and unsupported extensions. Reload\nthe plugin to pick up branding changes.\n\nThe backend entry default-exports a factory receiving the full plugin API:\n\n import type { BbPluginApi } from \"@bb/plugin-sdk\";\n export default async function plugin(bb: BbPluginApi) { ... }\n\nThe import is type-only and erased at load; the scaffold ships the full API\nas bundled .d.ts in types/ (tsconfig maps @bb/plugin-sdk to them), so\n`npm install && npx tsc --noEmit` typechecks anywhere — no bb checkout\nneeded. Confused, or need a symbol the types don't explain? Clone the repo:\nhttps://github.com/get-bb/bb. The API in\none line each — bb.log (plugin-scoped logger behind `bb plugin logs`);\nbb.settings.define (declarative settings incl. secrets, editable via\n`bb plugin config`); bb.storage.kv (JSON rows ≤256KB) and\nbb.storage.database()+migrate (the plugin's own database); bb.sdk (the full\nbb SDK — handlers/services only, not the factory; spawned threads are\nattributed to the plugin; `visibility: \"hidden\"` creates directly addressable\nbackground workers omitted from sidebar organization and unread/pending\nfavicon attention, with other behavior unchanged; a child thread inherits\nits parent's visibility and still notifies that parent);\nbb.events.on (observe thread.created/idle/failed/deleted);\nbb.http.route (routes under /api/v1/plugins/<id>/http/* with\nlocal/token/none auth); defineRpcContract + bb.rpc.register (Standard\nSchema-validated frontend data plane with inferred backend handlers and\ntype-only frontend method/input/result inference);\nbb.realtime.publish (ephemeral signals to open app pages);\nbb.background.service (long-lived, AbortSignal, restart w/ backoff) and\nbb.background.schedule (durable cron rows); bb.cli.register (a top-level\n`bb <name>` command agents run through bash, with a shared 1 MiB combined\nstdout/stderr ceiling and atomic structured over-limit errors); bb.agents.registerTool\n(static native tools with zod or JSON-schema parameters) and\nbb.agents.configure (one synchronous per-resolution callback selecting this\nplugin's own tool/skill ids and optional dynamic instructions; tools apply on\nthe next provider session start/resume, while busy skill runtimes defer catalog\nchanges); bb.ui\nregisterMentionProvider (host-rendered UI — no\nfrontend bundle needed); bb.status.needsConfiguration (report\n\"unconfigured\" instead of crashing); bb.onDispose (LIFO cleanup on\nreload/disable/shutdown).\n\nFrontend entries register React slots (homepageSection, settingsSection,\nnavPanel, threadPanelAction, fileOpener, messageDirective) and composer\ncustomizations via `app.composer.customize({ actions, plusMenu, banners,\nrichText })`; action/banner components use `useComposer()` and\n`useComposerView()`, while the host renders plus-menu rows and editor\ndecorations. The deprecated pre-1.0 `slots.composerAccessory` footer API was\nremoved; migrate controls to actions or the plus menu and larger content to\nbanners. Register all frontend surfaces via\ndefinePluginApp, use the hooks\nlisted above, and render vendored components; styling is Tailwind against\nthe host theme's tokens only (semantic classes like bg-background and\ntw-animate-css utilities compile in plugin builds).\n\nFor the complete authoring reference — exact signatures, working snippets\nfor every surface, the reload lifecycle, testing tips, and gotchas — use\nthe built-in `bb-plugin-authoring` skill (agents: it loads on demand;\nhumans: apps/server/src/services/skills/builtin-skills/bb-plugin-authoring/\nin a checkout). The builtin `inline-vis` plugin renders\n`::inline-vis{file=\"demo.html\" height=\"480\"}` through the sidebar's\npath-shaped, sandboxed worktree HTML iframe preview; `height` is optional.\nIts card header includes an open-in-sidebar action for the source HTML file.\nThe `plugins/` directory contains every bundled plugin: the auto-installed\nbuiltins and the store-only BB Official GitHub, Docs, Memory, Tasks, and T3\nSidebar plugins. The `examples/plugins/` reference plugins\ncover slack-bot (webhook bot), agent-enrichment (agent surfaces), and\ncomposer-customization (all composer regions).", "fileName": "bb-guide-plugins.md", "kind": "instruction", "title": "bb Guide — Plugins", @@ -105,7 +105,7 @@ export const templateDefinitions = [ }, { "id": "bbGuideProviders", - "body": "Provider commands\n\nProviders are agent backends (e.g., codex, claude-code). Each supports different models.\n\n bb provider list [--machine <id-or-name> | --environment <id>]\n List available providers\n bb provider models [providerId] [--machine <id-or-name> | --environment <id>]\n List models for a provider\n\nUse these before spawning threads if you are unsure which provider or model to use.\n`--host` is an alias for `--machine`. Machine and environment selectors are\nmutually exclusive because an environment already selects its machine. When no\nselector is supplied, both commands intentionally inspect the primary machine.\nWhen provider and model are omitted from bb thread spawn, the project's\nremembered defaults apply. If the project has no remembered choice, bb uses\nthe explicitly requested provider or Codex, then resolves the model marked\ndefault by that provider on the target machine (falling back to the first\ncatalog model when none is marked).\n\nProvider-native memory can be controlled on the separate Settings → Providers\n→ Codex and Settings → Providers → Claude Code pages. Codex memory controls\nboth recall (`memories.use_memories`) and future generation\n(`memories.generate_memories`). Claude Code memory controls native auto-memory\nreads and writes (`autoMemoryEnabled`). Both preferences default on and apply\nwhen a provider thread is started, resumed, or forked; they do not interrupt\nan active turn. These settings are separate from bb's optional Memory plugin,\nan official plugin bundled with the app.\n\nProvider-native subagents can also be disabled on those provider pages. For\nCodex, bb turns off the native multi-agent feature and caps V2 sessions at the\nroot thread so remote session policy cannot start a child. For Claude Code, bb\nremoves the native Task tool. The preferences default off and apply\nwhen a provider thread is started, resumed, or forked; they do not modify the\nprovider's global configuration.\n\nSubscription limit recovery\n\nThe default-enabled builtin Provider retry plugin recognizes structured Codex\nand Claude Code subscription windows. If a provider terminally rejects an\naccepted turn before it produces output or possible side effects, the plugin\nwaits in memory until the reported reset plus a short buffer, then starts one\nagent-only `Please continue.` turn on the existing provider conversation.\nThreads sharing a machine/provider subscription are released one at a time.\nProvider-native retries remain authoritative while the provider reports that it\nwill retry on its own.\n\n bb settings usage [--machine <id-or-name>] Read live provider usage\n bb provider-retry status [thread-id] [--json] Inspect in-memory waits\n bb provider-retry refresh <thread-id> [--json] Refresh live usage\n bb provider-retry now <thread-id> [--json] Continue now if still safe\n bb provider-retry cancel <thread-id> [--json] Cancel automatic continuation\n bb thread retry [id] [--request-id <id>] Guarded core continuation\n\nTimed waits exist only while the current bb server/plugin process remains\nrunning. Disabling/reloading the plugin or restarting the server clears them;\nthe original failed thread remains available for `bb thread retry`. Credit and\nspend-control exhaustion without a reset time is shown but never blindly\nretried. Use Refresh after adding credits or changing limits, or Retry now when\nthe user explicitly wants another safe attempt.\n\nClaude Code's native Workflow tool can be disabled separately on its provider\npage. This preference also defaults off and applies to newly started, resumed,\nor forked provider sessions.\n\nKnown ACP agents can appear automatically when their CLI is installed on the\nhost. For example, opencode, omp, Grok Build's grok CLI, or Hermes' hermes CLI\non PATH appears as provider acp-opencode, acp-omp, acp-grok, or\nacp-hermes-agent.\n\nCustom ACP agents are configured in the app data-dir config.json under\ncustomAcpAgents. bb derives provider id acp-<id> from each slug id. Edit the JSON\nand run bb-app config refresh; there is no set/unset CLI surface for this list.\nCustom config wins if it uses the same provider id as a known ACP agent; for\nexample, override acp-opencode with id opencode. Use modelCli for CLI model\nlisting/selection, reasoningCli for launch-time reasoning flags, and\nnativeReasoning for ACP session/set_config_option reasoning. Optional logo\naccepts an SVG, PNG, or WebP path; relative paths resolve from the bb data dir.", + "body": "Provider commands\n\nProviders are agent backends (e.g., codex, claude-code). Each supports different models.\n\n bb provider list [--machine <id-or-name> | --environment <id>]\n List available providers\n bb provider models [providerId] [--machine <id-or-name> | --environment <id>]\n List models for a provider\n\nUse these before spawning threads if you are unsure which provider or model to use.\n`--host` is an alias for `--machine`. Machine and environment selectors are\nmutually exclusive because an environment already selects its machine. When no\nselector is supplied, both commands intentionally inspect the primary machine.\nWhen provider and model are omitted from bb thread spawn, the project's\nremembered defaults apply. If the project has no remembered choice, bb uses\nthe explicitly requested provider or Codex, then resolves the model marked\ndefault by that provider on the target machine (falling back to the first\ncatalog model when none is marked).\n\nProvider-native memory can be controlled on the separate Settings → Providers\n→ Codex and Settings → Providers → Claude Code pages. Codex memory controls\nboth recall (`memories.use_memories`) and future generation\n(`memories.generate_memories`). Claude Code memory controls native auto-memory\nreads and writes (`autoMemoryEnabled`). Both preferences default on and apply\nwhen a provider thread is started, resumed, or forked; they do not interrupt\nan active turn. These settings are separate from bb's optional Memory plugin,\nan official plugin bundled with the app.\n\nProvider-native subagents can also be disabled on those provider pages. For\nCodex, bb turns off the native multi-agent feature and caps V2 sessions at the\nroot thread so remote session policy cannot start a child. For Claude Code, bb\nremoves the native Task tool. The preferences default off and apply\nwhen a provider thread is started, resumed, or forked; they do not modify the\nprovider's global configuration.\n\nSubscription limit recovery\n\nThe opt-in builtin Provider retry plugin recognizes structured Codex and Claude\nCode subscription windows. Enable it under Extensions → Plugins or run\n`bb plugin enable provider-retry`. If a provider terminally rejects an accepted\nturn before it produces output or possible side effects, the plugin waits in\nmemory until the reported reset plus a short buffer, then starts one agent-only\n`Please continue.` turn on the existing provider conversation. Threads sharing\na machine/provider subscription are released one at a time. Provider-native\nretries remain authoritative while the provider reports that it will retry on\nits own.\n\n bb settings usage [--machine <id-or-name>] Read live provider usage\n bb provider-retry status [thread-id] [--json] Inspect in-memory waits\n bb provider-retry refresh <thread-id> [--json] Refresh live usage\n bb provider-retry now <thread-id> [--json] Continue now if still safe\n bb provider-retry cancel <thread-id> [--json] Cancel automatic continuation\n bb thread retry [id] [--request-id <id>] Guarded core continuation\n\nTimed waits exist only while the current bb server/plugin process remains\nrunning. Disabling/reloading the plugin or restarting the server clears them;\nthe original failed thread remains available for `bb thread retry`. Credit and\nspend-control exhaustion without a reset time is shown but never blindly\nretried. Use Refresh after adding credits or changing limits, or Retry now when\nthe user explicitly wants another safe attempt.\n\nClaude Code's native Workflow tool can be disabled separately on its provider\npage. This preference also defaults off and applies to newly started, resumed,\nor forked provider sessions.\n\nKnown ACP agents can appear automatically when their CLI is installed on the\nhost. For example, opencode, omp, Grok Build's grok CLI, or Hermes' hermes CLI\non PATH appears as provider acp-opencode, acp-omp, acp-grok, or\nacp-hermes-agent.\n\nCustom ACP agents are configured in the app data-dir config.json under\ncustomAcpAgents. bb derives provider id acp-<id> from each slug id. Edit the JSON\nand run bb-app config refresh; there is no set/unset CLI surface for this list.\nCustom config wins if it uses the same provider id as a known ACP agent; for\nexample, override acp-opencode with id opencode. Use modelCli for CLI model\nlisting/selection, reasoningCli for launch-time reasoning flags, and\nnativeReasoning for ACP session/set_config_option reasoning. Optional logo\naccepts an SVG, PNG, or WebP path; relative paths resolve from the bb data dir.", "fileName": "bb-guide-providers.md", "kind": "instruction", "title": "bb Guide — Providers", @@ -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 retry [id] Continue a safe subscription-limited turn\n --self Target current thread\n --request-id <id> Require an exact failed request id\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\n `thread retry` is only for a terminal provider subscription-limit failure.\n The server requires accepted input, no assistant output or possible side\n effects, and no newer request. It starts an agent-only system turn containing\n `Please continue.` on the existing provider conversation; it does not resend\n the original prompt or create another user message. The default Provider retry\n plugin invokes this guard automatically for timed limits.\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\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 retry [id] Continue a safe subscription-limited turn\n --self Target current thread\n --request-id <id> Require an exact failed request id\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\n `thread retry` is only for a terminal provider subscription-limit failure.\n The server requires accepted input, no assistant output or possible side\n effects, and no newer request. It starts an agent-only system turn containing\n `Please continue.` on the existing provider conversation; it does not resend\n the original prompt or create another user message. When enabled, the Provider\n retry plugin invokes this guard automatically for timed limits.\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-plugins.md b/packages/templates/src/templates/bb-guide-plugins.md index 7069ead609..eef405ce15 100644 --- a/packages/templates/src/templates/bb-guide-plugins.md +++ b/packages/templates/src/templates/bb-guide-plugins.md @@ -21,8 +21,9 @@ The builtin Custom instructions plugin adds a multiline editor under Settings → Custom instructions. Saved text is persisted on this bb host and included in agent task instructions; blank text contributes nothing. -The default-enabled builtin Provider retry plugin continues safe Codex and -Claude Code turns after a structured subscription window resets. It keeps its +The opt-in builtin Provider retry plugin continues safe Codex and Claude Code +turns after a structured subscription window resets. Enable it under +Extensions → Plugins or run `bb plugin enable provider-retry`. It keeps its timers in memory, coordinates waits by machine/provider subscription, and adds a composer banner with Refresh, Retry now, and Cancel controls. A server restart or plugin reload clears pending timers without changing the original failed diff --git a/packages/templates/src/templates/bb-guide-providers.md b/packages/templates/src/templates/bb-guide-providers.md index 3d1be02b6e..06e390cec4 100644 --- a/packages/templates/src/templates/bb-guide-providers.md +++ b/packages/templates/src/templates/bb-guide-providers.md @@ -42,14 +42,15 @@ provider's global configuration. Subscription limit recovery -The default-enabled builtin Provider retry plugin recognizes structured Codex -and Claude Code subscription windows. If a provider terminally rejects an -accepted turn before it produces output or possible side effects, the plugin -waits in memory until the reported reset plus a short buffer, then starts one -agent-only `Please continue.` turn on the existing provider conversation. -Threads sharing a machine/provider subscription are released one at a time. -Provider-native retries remain authoritative while the provider reports that it -will retry on its own. +The opt-in builtin Provider retry plugin recognizes structured Codex and Claude +Code subscription windows. Enable it under Extensions → Plugins or run +`bb plugin enable provider-retry`. If a provider terminally rejects an accepted +turn before it produces output or possible side effects, the plugin waits in +memory until the reported reset plus a short buffer, then starts one agent-only +`Please continue.` turn on the existing provider conversation. Threads sharing +a machine/provider subscription are released one at a time. Provider-native +retries remain authoritative while the provider reports that it will retry on +its own. bb settings usage [--machine <id-or-name>] Read live provider usage bb provider-retry status [thread-id] [--json] Inspect in-memory waits diff --git a/packages/templates/src/templates/bb-guide-threads.md b/packages/templates/src/templates/bb-guide-threads.md index f5126dcfe4..23071aa472 100644 --- a/packages/templates/src/templates/bb-guide-threads.md +++ b/packages/templates/src/templates/bb-guide-threads.md @@ -171,8 +171,8 @@ Messaging: The server requires accepted input, no assistant output or possible side effects, and no newer request. It starts an agent-only system turn containing `Please continue.` on the existing provider conversation; it does not resend - the original prompt or create another user message. The default Provider retry - plugin invokes this guard automatically for timed limits. + the original prompt or create another user message. When enabled, the Provider + retry plugin invokes this guard automatically for timed limits. Ownership: From 7f388f1f4861f17bb040f7eef362bd1fa3710c77 Mon Sep 17 00:00:00 2001 From: Michael Yong <wrong92@gmail.com> Date: Wed, 5 Aug 2026 12:25:52 -0700 Subject: [PATCH 09/21] fix: toggle plugins from settings details --- .../settings/PluginsSettingsSection.test.tsx | 68 +++++++++++++++++++ .../settings/PluginsSettingsSection.tsx | 65 ++++++++++++------ 2 files changed, 112 insertions(+), 21 deletions(-) diff --git a/apps/app/src/components/settings/PluginsSettingsSection.test.tsx b/apps/app/src/components/settings/PluginsSettingsSection.test.tsx index 0abb632f0c..7ee1b8f2cd 100644 --- a/apps/app/src/components/settings/PluginsSettingsSection.test.tsx +++ b/apps/app/src/components/settings/PluginsSettingsSection.test.tsx @@ -263,6 +263,71 @@ function rowPlugin( } describe("PluginSettingsDetail settings gating", () => { + it("enables a disabled plugin from its detail page without duplicating its status", async () => { + const requests: RecordedRequest[] = []; + vi.stubGlobal( + "fetch", + vi.fn(async (url: string, init?: RequestInit) => { + requests.push({ url, init }); + return jsonOk({ + ok: true, + plugin: serverPlugin({ enabled: true, status: "running" }), + }); + }), + ); + const { wrapper } = createQueryClientTestHarness(); + render( + <MemoryRouter> + <PluginSettingsDetail + plugin={{ ...rowPlugin("disabled"), enabled: false }} + /> + </MemoryRouter>, + { wrapper }, + ); + + expect(screen.getAllByText("disabled")).toHaveLength(1); + const toggle = screen.getByRole("switch", { name: "Enable linear" }); + expect(toggle.getAttribute("aria-checked")).toBe("false"); + fireEvent.click(toggle); + + await vi.waitFor(() => { + expect(requests).toContainEqual({ + url: "/api/v1/plugins/linear/enable", + init: expect.objectContaining({ method: "POST" }), + }); + }); + }); + + it("disables a running plugin from its detail page", async () => { + const requests: RecordedRequest[] = []; + vi.stubGlobal( + "fetch", + vi.fn(async (url: string, init?: RequestInit) => { + requests.push({ url, init }); + return jsonOk({ + ok: true, + plugin: serverPlugin({ enabled: false, status: "disabled" }), + }); + }), + ); + const { wrapper } = createQueryClientTestHarness(); + render( + <MemoryRouter> + <PluginSettingsDetail plugin={rowPlugin("running")} /> + </MemoryRouter>, + { wrapper }, + ); + + fireEvent.click(screen.getByRole("switch", { name: "Disable linear" })); + + await vi.waitFor(() => { + expect(requests).toContainEqual({ + url: "/api/v1/plugins/linear/disable", + init: expect.objectContaining({ method: "POST" }), + }); + }); + }); + it("renders the settings form for a needs-configuration plugin (regression: the plugin that most needs configuring must be configurable)", async () => { vi.stubGlobal( "fetch", @@ -376,6 +441,9 @@ describe("PluginSettingsDetail settings gating", () => { expect(await screen.findByText("Remote access")).toBeDefined(); expect(screen.getByText("Custom connect settings")).toBeDefined(); + expect( + screen.getByRole("switch", { name: "Disable connect" }), + ).toBeDefined(); expect(screen.queryByText("This plugin declares no settings.")).toBeNull(); }); }); diff --git a/apps/app/src/components/settings/PluginsSettingsSection.tsx b/apps/app/src/components/settings/PluginsSettingsSection.tsx index 6d484d5589..eced21d87d 100644 --- a/apps/app/src/components/settings/PluginsSettingsSection.tsx +++ b/apps/app/src/components/settings/PluginsSettingsSection.tsx @@ -33,6 +33,7 @@ import { } from "@/hooks/cache-owners/plugin-cache-owner"; import { removePlugin, + setPluginEnabled, updatePluginSettings, usePluginList, usePluginSettingsView, @@ -545,7 +546,20 @@ function RemovePluginSection({ plugin }: { plugin: PluginListItem }) { /** Exported for tests (status gating of the settings form). */ export function PluginSettingsDetail({ plugin }: { plugin: PluginListItem }) { + const queryClient = useQueryClient(); const { settingsSections } = usePluginSlots(); + const name = plugin.name ?? plugin.id; + const toggle = useMutation({ + mutationFn: (enabled: boolean) => + setPluginEnabled(fetch, plugin.id, enabled), + onError: (error, enabled) => { + appToast.error(`${enabled ? "Enabling" : "Disabling"} ${name} failed`, { + description: pluginAdminErrorMessage(error), + }); + }, + onSettled: () => invalidatePluginList({ queryClient }), + }); + const enabled = toggle.isPending ? toggle.variables : plugin.enabled; const hasSettingsSections = settingsSections.some( (section) => section.pluginId === plugin.id, ); @@ -553,7 +567,6 @@ export function PluginSettingsDetail({ plugin }: { plugin: PluginListItem }) { plugin.enabled && PLUGIN_STATUSES_WITH_SETTINGS.includes(plugin.status); const showDeclarativeSettingsCard = plugin.hasSettings || !settingsAvailable || !hasSettingsSections; - const name = plugin.name ?? plugin.id; const isRunning = plugin.status === "running"; const hasUpdateSurfaces = pluginHasUpdateSurfaces(plugin); const frontendDiagnostics = useSyncExternalStore( @@ -578,6 +591,14 @@ export function PluginSettingsDetail({ plugin }: { plugin: PluginListItem }) { : plugin.provenance === "direct" ? `v${plugin.version} · direct install` : null; + const lifecycleControl = ( + <Switch + checked={enabled} + disabled={toggle.isPending} + aria-label={`${enabled ? "Disable" : "Enable"} ${name}`} + onCheckedChange={(next) => toggle.mutate(next)} + /> + ); return ( <div className="space-y-6" data-testid={`plugin-detail-${plugin.id}`}> {frontendFailure !== null && frontendFailure !== undefined ? ( @@ -592,29 +613,31 @@ export function PluginSettingsDetail({ plugin }: { plugin: PluginListItem }) { : {frontendFailure.message} </div> ) : null} - {sectionOwnsHeader ? null : ( + {sectionOwnsHeader ? ( + <div className="flex justify-end">{lifecycleControl}</div> + ) : ( <div className="space-y-3"> <div> - <div className="flex min-w-0 flex-wrap items-center gap-2"> - <PluginIcon pluginId={plugin.id} icon={plugin.icon} /> - <h2 className="text-sm font-semibold text-foreground">{name}</h2> - {/* The version + status pills read as diagnostics; a running, - configurable plugin doesn't need them on its settings page. */} - {!isRunning ? ( - <> - <span className="text-xs text-muted-foreground"> - v{plugin.version} - </span> - <Pill variant={statusPillVariant(plugin.status)} size="sm"> - {plugin.status} - </Pill> - {!plugin.enabled ? ( - <Pill variant="outline" size="sm"> - disabled + <div className="flex min-w-0 items-start justify-between gap-3"> + <div className="flex min-w-0 flex-wrap items-center gap-2"> + <PluginIcon pluginId={plugin.id} icon={plugin.icon} /> + <h2 className="text-sm font-semibold text-foreground"> + {name} + </h2> + {/* The version + status pill reads as diagnostics; a running, + configurable plugin doesn't need it on its settings page. */} + {!isRunning ? ( + <> + <span className="text-xs text-muted-foreground"> + v{plugin.version} + </span> + <Pill variant={statusPillVariant(plugin.status)} size="sm"> + {plugin.status} </Pill> - ) : null} - </> - ) : null} + </> + ) : null} + </div> + {lifecycleControl} </div> {isRunning && provenanceLine !== null ? ( <p className="mt-0.5 text-xs leading-snug text-subtle-foreground/75"> From d6dbe458c13a0bb5f6fc48c1ee1288a0fe438d01 Mon Sep 17 00:00:00 2001 From: Michael Yong <wrong92@gmail.com> Date: Wed, 5 Aug 2026 14:54:42 -0700 Subject: [PATCH 10/21] fix: keep plugin settings identity stable --- .../settings/PluginsSettingsSection.test.tsx | 30 +++++++++++++++++-- .../settings/PluginsSettingsSection.tsx | 16 ++-------- 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/apps/app/src/components/settings/PluginsSettingsSection.test.tsx b/apps/app/src/components/settings/PluginsSettingsSection.test.tsx index 7ee1b8f2cd..ff26ffadba 100644 --- a/apps/app/src/components/settings/PluginsSettingsSection.test.tsx +++ b/apps/app/src/components/settings/PluginsSettingsSection.test.tsx @@ -263,7 +263,7 @@ function rowPlugin( } describe("PluginSettingsDetail settings gating", () => { - it("enables a disabled plugin from its detail page without duplicating its status", async () => { + it("keeps a no-settings plugin's identity stable while enabling it", async () => { const requests: RecordedRequest[] = []; vi.stubGlobal( "fetch", @@ -276,16 +276,26 @@ describe("PluginSettingsDetail settings gating", () => { }), ); const { wrapper } = createQueryClientTestHarness(); - render( + const description = "Continues safe turns after provider limits reset."; + const { rerender } = render( <MemoryRouter> <PluginSettingsDetail - plugin={{ ...rowPlugin("disabled"), enabled: false }} + plugin={{ + ...rowPlugin("disabled"), + description, + enabled: false, + hasSettings: false, + }} /> </MemoryRouter>, { wrapper }, ); expect(screen.getAllByText("disabled")).toHaveLength(1); + expect(screen.getByText(description)).toBeDefined(); + expect( + screen.queryByText("Enable this plugin to edit its settings."), + ).toBeNull(); const toggle = screen.getByRole("switch", { name: "Enable linear" }); expect(toggle.getAttribute("aria-checked")).toBe("false"); fireEvent.click(toggle); @@ -296,6 +306,20 @@ describe("PluginSettingsDetail settings gating", () => { init: expect.objectContaining({ method: "POST" }), }); }); + + rerender( + <MemoryRouter> + <PluginSettingsDetail + plugin={{ + ...rowPlugin("running"), + description, + hasSettings: false, + }} + /> + </MemoryRouter>, + ); + expect(screen.getByText(description)).toBeDefined(); + expect(screen.queryByText("This plugin declares no settings.")).toBeNull(); }); it("disables a running plugin from its detail page", async () => { diff --git a/apps/app/src/components/settings/PluginsSettingsSection.tsx b/apps/app/src/components/settings/PluginsSettingsSection.tsx index eced21d87d..e033e120be 100644 --- a/apps/app/src/components/settings/PluginsSettingsSection.tsx +++ b/apps/app/src/components/settings/PluginsSettingsSection.tsx @@ -565,8 +565,6 @@ export function PluginSettingsDetail({ plugin }: { plugin: PluginListItem }) { ); const settingsAvailable = plugin.enabled && PLUGIN_STATUSES_WITH_SETTINGS.includes(plugin.status); - const showDeclarativeSettingsCard = - plugin.hasSettings || !settingsAvailable || !hasSettingsSections; const isRunning = plugin.status === "running"; const hasUpdateSurfaces = pluginHasUpdateSurfaces(plugin); const frontendDiagnostics = useSyncExternalStore( @@ -644,9 +642,7 @@ export function PluginSettingsDetail({ plugin }: { plugin: PluginListItem }) { {provenanceLine} </p> ) : null} - {!isRunning && - plugin.description !== null && - plugin.description.length > 0 ? ( + {plugin.description !== null && plugin.description.length > 0 ? ( <p className="mt-0.5 text-xs leading-snug text-subtle-foreground/75"> {plugin.description} </p> @@ -659,16 +655,10 @@ export function PluginSettingsDetail({ plugin }: { plugin: PluginListItem }) { </div> <PluginUpdateBanner plugin={plugin} /> <PluginUpdatesSourceCard plugin={plugin} /> - {showDeclarativeSettingsCard ? ( + {plugin.hasSettings ? ( <div className="rounded-lg border border-border bg-card px-4 py-3.5"> {settingsAvailable ? ( - plugin.hasSettings ? ( - <PluginSettingsForm pluginId={plugin.id} /> - ) : ( - <p className="text-xs text-muted-foreground"> - This plugin declares no settings. - </p> - ) + <PluginSettingsForm pluginId={plugin.id} /> ) : ( <p className="text-xs text-muted-foreground"> {plugin.enabled From ae292269255f87c83f50117364861fecf04a641e Mon Sep 17 00:00:00 2001 From: Michael Yong <wrong92@gmail.com> Date: Wed, 5 Aug 2026 15:27:28 -0700 Subject: [PATCH 11/21] fix: stabilize plugin settings detail states --- .../settings/PluginsSettingsSection.test.tsx | 154 +++++++++++++----- .../settings/PluginsSettingsSection.tsx | 150 ++++++++--------- 2 files changed, 183 insertions(+), 121 deletions(-) diff --git a/apps/app/src/components/settings/PluginsSettingsSection.test.tsx b/apps/app/src/components/settings/PluginsSettingsSection.test.tsx index ff26ffadba..8d3980bb5f 100644 --- a/apps/app/src/components/settings/PluginsSettingsSection.test.tsx +++ b/apps/app/src/components/settings/PluginsSettingsSection.test.tsx @@ -25,7 +25,6 @@ import { } from "@/lib/plugin-slots"; import { PluginSettingsDetail, - PluginSettingsDetailSection, PluginSettingsForm, PluginsSettingsSection, } from "./PluginsSettingsSection"; @@ -49,13 +48,6 @@ function jsonOk(body: unknown): Response { }); } -function responseJson(body: unknown): Response { - return new Response(JSON.stringify(body), { - status: 200, - headers: { "content-type": "application/json" }, - }); -} - function systemConfig(): SystemConfigResponse { return { generalSettings: defaultAppSettings, @@ -174,6 +166,31 @@ describe("PluginSettingsForm", () => { values: { apiKey: "sk-123" }, }); }); + + it("keeps the schema visible but disables every control when read-only", async () => { + vi.stubGlobal( + "fetch", + vi.fn(() => Promise.resolve(jsonOk(SETTINGS_VIEW))), + ); + + const { wrapper } = createQueryClientTestHarness(); + render(<PluginSettingsForm pluginId="demo" disabled />, { wrapper }); + + const greeting = (await screen.findByLabelText( + "Greeting", + )) as HTMLInputElement; + const enabled = screen.getByLabelText("Enabled") as HTMLButtonElement; + const save = screen.getByRole("button", { + name: /save settings/i, + }) as HTMLButtonElement; + const form = greeting.closest("form"); + + expect(greeting.disabled).toBe(true); + expect(enabled.disabled).toBe(true); + expect(save.disabled).toBe(true); + expect(form?.getAttribute("aria-disabled")).toBe("true"); + expect(form?.className).toContain("opacity-50"); + }); }); describe("PluginsSettingsSection", () => { @@ -292,10 +309,12 @@ describe("PluginSettingsDetail settings gating", () => { ); expect(screen.getAllByText("disabled")).toHaveLength(1); + expect(screen.getByText("v0.1.0")).toBeDefined(); expect(screen.getByText(description)).toBeDefined(); expect( screen.queryByText("Enable this plugin to edit its settings."), ).toBeNull(); + expect(screen.queryByText("This plugin declares no settings.")).toBeNull(); const toggle = screen.getByRole("switch", { name: "Enable linear" }); expect(toggle.getAttribute("aria-checked")).toBe("false"); fireEvent.click(toggle); @@ -318,7 +337,55 @@ describe("PluginSettingsDetail settings gating", () => { /> </MemoryRouter>, ); + expect(screen.getByText("v0.1.0")).toBeDefined(); + expect(screen.getByText("running")).toBeDefined(); expect(screen.getByText(description)).toBeDefined(); + expect(screen.getByText("This plugin declares no settings.")).toBeDefined(); + }); + + it("hides declared settings while disabled", () => { + const fetchSpy = vi.fn(() => Promise.resolve(jsonOk(SETTINGS_VIEW))); + vi.stubGlobal("fetch", fetchSpy); + const { wrapper } = createQueryClientTestHarness(); + render( + <MemoryRouter> + <PluginSettingsDetail + plugin={{ ...rowPlugin("disabled"), enabled: false }} + /> + </MemoryRouter>, + { wrapper }, + ); + + expect(screen.queryByLabelText("Greeting")).toBeNull(); + expect(fetchSpy).not.toHaveBeenCalled(); + }); + + it("waits for an enabled frontend bundle before declaring that it has no settings", () => { + const { wrapper } = createQueryClientTestHarness(); + render( + <MemoryRouter> + <PluginSettingsDetail + plugin={{ + ...rowPlugin("running"), + hasSettings: false, + app: { + hasApp: true, + bundle: { + jsUrl: "/api/v1/plugins/linear/app.js", + cssUrl: null, + hash: "linear-app", + sdkMajor: 0, + sdkVersion: "0.4.1", + compatible: true, + }, + }, + }} + /> + </MemoryRouter>, + { wrapper }, + ); + + expect(screen.getByText("v0.1.0")).toBeDefined(); expect(screen.queryByText("This plugin declares no settings.")).toBeNull(); }); @@ -367,7 +434,7 @@ describe("PluginSettingsDetail settings gating", () => { expect(await screen.findByLabelText("Greeting")).toBeTruthy(); }); - it("renders no form for an errored plugin (no schema exists server-side)", () => { + it("renders the preserved form read-only for an errored plugin", async () => { const fetchSpy = vi.fn(() => Promise.resolve(jsonOk(SETTINGS_VIEW))); vi.stubGlobal("fetch", fetchSpy); const { wrapper } = createQueryClientTestHarness(); @@ -377,9 +444,12 @@ describe("PluginSettingsDetail settings gating", () => { </MemoryRouter>, { wrapper }, ); - expect(screen.queryByLabelText("Greeting")).toBeNull(); + const greeting = (await screen.findByLabelText( + "Greeting", + )) as HTMLInputElement; + expect(greeting.disabled).toBe(true); expect(screen.queryByRole("button", { name: "Remove" })).toBeNull(); - expect(fetchSpy).not.toHaveBeenCalled(); + expect(fetchSpy).toHaveBeenCalled(); }); it("removes a stale builtin plugin from its detail page", async () => { @@ -418,7 +488,7 @@ describe("PluginSettingsDetail settings gating", () => { }); }); - it("renders a slot-only settings page", async () => { + it("shows a slot-only settings section beneath the stable header only while enabled", () => { function ConnectSettings() { return <div>Custom connect settings</div>; } @@ -433,37 +503,47 @@ describe("PluginSettingsDetail settings gating", () => { fileOpeners: [], messageDirectives: [], }); - vi.stubGlobal( - "fetch", - vi.fn(async (input: RequestInfo | URL) => { - const rawUrl = - typeof input === "string" - ? input - : input instanceof URL - ? input.href - : input.url; - const path = new URL(rawUrl, "http://localhost").pathname; - if (path === "/api/v1/system/config") { - return responseJson(systemConfig()); - } - if (path === "/api/v1/plugins") { - return responseJson({ - plugins: [serverPlugin({ id: "connect", hasSettings: false })], - }); - } - return new Response("not found", { status: 404 }); - }), - ); - const { wrapper } = createQueryClientTestHarness(); - render( + const description = "Give this host remote access."; + const { rerender } = render( <MemoryRouter> - <PluginSettingsDetailSection pluginId="connect" /> + <PluginSettingsDetail + plugin={{ + ...rowPlugin("disabled"), + id: "connect", + enabled: false, + hasSettings: false, + description, + }} + /> </MemoryRouter>, { wrapper }, ); - expect(await screen.findByText("Remote access")).toBeDefined(); + expect(screen.getByText("connect")).toBeDefined(); + expect(screen.getByText("v0.1.0")).toBeDefined(); + expect(screen.getByText(description)).toBeDefined(); + expect(screen.queryByText("Remote access")).toBeNull(); + expect(screen.queryByText("Custom connect settings")).toBeNull(); + expect(screen.queryByText("This plugin declares no settings.")).toBeNull(); + + rerender( + <MemoryRouter> + <PluginSettingsDetail + plugin={{ + ...rowPlugin("running"), + id: "connect", + hasSettings: false, + description, + }} + /> + </MemoryRouter>, + ); + + expect(screen.getByText("connect")).toBeDefined(); + expect(screen.getByText("v0.1.0")).toBeDefined(); + expect(screen.getByText(description)).toBeDefined(); + expect(screen.getByText("Remote access")).toBeDefined(); expect(screen.getByText("Custom connect settings")).toBeDefined(); expect( screen.getByRole("switch", { name: "Disable connect" }), diff --git a/apps/app/src/components/settings/PluginsSettingsSection.tsx b/apps/app/src/components/settings/PluginsSettingsSection.tsx index e033e120be..137e0538c1 100644 --- a/apps/app/src/components/settings/PluginsSettingsSection.tsx +++ b/apps/app/src/components/settings/PluginsSettingsSection.tsx @@ -59,7 +59,6 @@ import { InstalledPluginsTab } from "./plugins/InstalledPluginsTab"; import { PluginUpdateBanner, PluginUpdatesSourceCard, - pluginHasUpdateSurfaces, } from "./plugins/PluginUpdatesCard"; /** @@ -563,31 +562,24 @@ export function PluginSettingsDetail({ plugin }: { plugin: PluginListItem }) { const hasSettingsSections = settingsSections.some( (section) => section.pluginId === plugin.id, ); - const settingsAvailable = - plugin.enabled && PLUGIN_STATUSES_WITH_SETTINGS.includes(plugin.status); - const isRunning = plugin.status === "running"; - const hasUpdateSurfaces = pluginHasUpdateSurfaces(plugin); + const settingsContentVisible = enabled && plugin.enabled; + const pluginSurfacesAvailable = + settingsContentVisible && + PLUGIN_STATUSES_WITH_SETTINGS.includes(plugin.status); const frontendDiagnostics = useSyncExternalStore( subscribePluginFrontendDiagnostics, getPluginFrontendDiagnostics, getPluginFrontendDiagnostics, ); - const frontendFailure = frontendDiagnostics.get(plugin.id)?.lastFailure; - // A running plugin whose only surface is a settingsSection lets that - // section own the chrome (its own SettingsSection title + description), so - // the diagnostic header (version + status pill + manifest description) - // doesn't stack a second heading above it — unless the plugin update - // surfaces render here too, which need the header for context. - const sectionOwnsHeader = - isRunning && - hasSettingsSections && - !plugin.hasSettings && - !hasUpdateSurfaces; + const frontendDiagnostic = frontendDiagnostics.get(plugin.id); + const frontendFailure = frontendDiagnostic?.lastFailure; + const frontendSettingsPending = + plugin.app.bundle !== null && frontendDiagnostic === undefined; const provenanceLine = plugin.provenance === "catalog" - ? `v${plugin.version} · official catalog` + ? "official catalog" : plugin.provenance === "direct" - ? `v${plugin.version} · direct install` + ? "direct install" : null; const lifecycleControl = ( <Switch @@ -599,78 +591,68 @@ export function PluginSettingsDetail({ plugin }: { plugin: PluginListItem }) { ); return ( <div className="space-y-6" data-testid={`plugin-detail-${plugin.id}`}> - {frontendFailure !== null && frontendFailure !== undefined ? ( - <div - className="rounded-lg border border-destructive/30 bg-destructive/5 px-4 py-3 text-xs text-destructive" - role="alert" - > - Frontend {frontendFailure.phase} failure - {frontendFailure.scriptId === null - ? "" - : ` in content script “${frontendFailure.scriptId}”`} - : {frontendFailure.message} + <div className="space-y-3"> + <div> + <div className="flex min-w-0 items-start justify-between gap-3"> + <div className="flex min-w-0 flex-wrap items-center gap-2"> + <PluginIcon pluginId={plugin.id} icon={plugin.icon} /> + <h2 className="text-sm font-semibold text-foreground">{name}</h2> + <span className="text-xs text-muted-foreground"> + v{plugin.version} + </span> + <Pill variant={statusPillVariant(plugin.status)} size="sm"> + {plugin.status} + </Pill> + </div> + {lifecycleControl} + </div> + {provenanceLine !== null ? ( + <p className="mt-0.5 text-xs leading-snug text-subtle-foreground/75"> + {provenanceLine} + </p> + ) : null} + {plugin.description !== null && plugin.description.length > 0 ? ( + <p className="mt-0.5 text-xs leading-snug text-subtle-foreground/75"> + {plugin.description} + </p> + ) : null} + {plugin.statusDetail !== null && plugin.statusDetail.length > 0 ? ( + <p className="mt-0.5 text-xs leading-snug text-subtle-foreground/75"> + {plugin.statusDetail} + </p> + ) : null} </div> - ) : null} - {sectionOwnsHeader ? ( - <div className="flex justify-end">{lifecycleControl}</div> - ) : ( - <div className="space-y-3"> - <div> - <div className="flex min-w-0 items-start justify-between gap-3"> - <div className="flex min-w-0 flex-wrap items-center gap-2"> - <PluginIcon pluginId={plugin.id} icon={plugin.icon} /> - <h2 className="text-sm font-semibold text-foreground"> - {name} - </h2> - {/* The version + status pill reads as diagnostics; a running, - configurable plugin doesn't need it on its settings page. */} - {!isRunning ? ( - <> - <span className="text-xs text-muted-foreground"> - v{plugin.version} - </span> - <Pill variant={statusPillVariant(plugin.status)} size="sm"> - {plugin.status} - </Pill> - </> - ) : null} + {settingsContentVisible ? ( + <> + {frontendFailure !== null && frontendFailure !== undefined ? ( + <div + className="rounded-lg border border-destructive/30 bg-destructive/5 px-4 py-3 text-xs text-destructive" + role="alert" + > + Frontend {frontendFailure.phase} failure + {frontendFailure.scriptId === null + ? "" + : ` in content script “${frontendFailure.scriptId}”`} + : {frontendFailure.message} </div> - {lifecycleControl} - </div> - {isRunning && provenanceLine !== null ? ( - <p className="mt-0.5 text-xs leading-snug text-subtle-foreground/75"> - {provenanceLine} - </p> - ) : null} - {plugin.description !== null && plugin.description.length > 0 ? ( - <p className="mt-0.5 text-xs leading-snug text-subtle-foreground/75"> - {plugin.description} - </p> ) : null} - {plugin.statusDetail !== null && plugin.statusDetail.length > 0 ? ( - <p className="mt-0.5 text-xs leading-snug text-subtle-foreground/75"> - {plugin.statusDetail} - </p> - ) : null} - </div> - <PluginUpdateBanner plugin={plugin} /> - <PluginUpdatesSourceCard plugin={plugin} /> - {plugin.hasSettings ? ( - <div className="rounded-lg border border-border bg-card px-4 py-3.5"> - {settingsAvailable ? ( + <PluginUpdateBanner plugin={plugin} /> + <PluginUpdatesSourceCard plugin={plugin} /> + {plugin.hasSettings ? ( + <div className="rounded-lg border border-border bg-card px-4 py-3.5"> <PluginSettingsForm pluginId={plugin.id} /> - ) : ( + </div> + ) : !hasSettingsSections && !frontendSettingsPending ? ( + <div className="rounded-lg border border-border bg-card px-4 py-3.5"> <p className="text-xs text-muted-foreground"> - {plugin.enabled - ? `Settings are unavailable while the plugin is ${plugin.status}.` - : "Enable this plugin to edit its settings."} + This plugin declares no settings. </p> - )} - </div> - ) : null} - </div> - )} - {settingsAvailable ? ( + </div> + ) : null} + </> + ) : null} + </div> + {pluginSurfacesAvailable ? ( <PluginSettingsSections pluginId={plugin.id} /> ) : null} {plugin.provenance !== "builtin" || plugin.isOrphanedBuiltin ? ( From 8d304663ee893c865433bdbbfbc2fe85c9b58895 Mon Sep 17 00:00:00 2001 From: Michael Yong <wrong92@gmail.com> Date: Wed, 5 Aug 2026 15:31:08 -0700 Subject: [PATCH 12/21] fix: remove redundant plugin settings headings --- .../plugin/PluginSettingsSections.tsx | 54 +++++++++++-------- .../settings/PluginsSettingsSection.test.tsx | 10 +++- plugins/connect/app.test.tsx | 4 ++ plugins/connect/app.tsx | 1 - plugins/custom-instructions/app.test.tsx | 4 ++ plugins/custom-instructions/app.tsx | 1 - 6 files changed, 49 insertions(+), 25 deletions(-) diff --git a/apps/app/src/components/plugin/PluginSettingsSections.tsx b/apps/app/src/components/plugin/PluginSettingsSections.tsx index d1242e41f5..92b9101ab0 100644 --- a/apps/app/src/components/plugin/PluginSettingsSections.tsx +++ b/apps/app/src/components/plugin/PluginSettingsSections.tsx @@ -29,27 +29,39 @@ function PluginSettingsSectionList({ }) { return ( <div className="space-y-6" data-testid="plugin-settings-sections"> - {sections.map((section) => ( - <ResourceDetailConfigurationSection - key={`${section.pluginId}/${section.id}/${section.generation}`} - label={section.title ?? "Plugin settings"} - > - <ResourceDetailPanel surface="recessed" className="px-3 py-3"> - {section.description !== undefined ? ( - <p className="mb-3 text-xs leading-snug text-subtle-foreground/75"> - {section.description} - </p> - ) : null} - <PluginSlotMount - pluginId={section.pluginId} - slotKind="settingsSection" - slotId={section.id} - > - <section.component /> - </PluginSlotMount> - </ResourceDetailPanel> - </ResourceDetailConfigurationSection> - ))} + {sections.map((section) => { + const key = `${section.pluginId}/${section.id}/${section.generation}`; + return section.title === undefined ? ( + <PluginSettingsSectionPanel key={key} section={section} /> + ) : ( + <ResourceDetailConfigurationSection key={key} label={section.title}> + <PluginSettingsSectionPanel section={section} /> + </ResourceDetailConfigurationSection> + ); + })} </div> ); } + +function PluginSettingsSectionPanel({ + section, +}: { + section: PluginSettingsSectionSlot; +}) { + return ( + <ResourceDetailPanel surface="recessed" className="px-3 py-3"> + {section.description !== undefined ? ( + <p className="mb-3 text-xs leading-snug text-subtle-foreground/75"> + {section.description} + </p> + ) : null} + <PluginSlotMount + pluginId={section.pluginId} + slotKind="settingsSection" + slotId={section.id} + > + <section.component /> + </PluginSlotMount> + </ResourceDetailPanel> + ); +} diff --git a/apps/app/src/components/settings/PluginsSettingsSection.test.tsx b/apps/app/src/components/settings/PluginsSettingsSection.test.tsx index 8d3980bb5f..ccc2fa0b9c 100644 --- a/apps/app/src/components/settings/PluginsSettingsSection.test.tsx +++ b/apps/app/src/components/settings/PluginsSettingsSection.test.tsx @@ -495,7 +495,11 @@ describe("PluginSettingsDetail settings gating", () => { setPluginSlotRegistrations("connect", { homepageSections: [], settingsSections: [ - { id: "remote", title: "Remote access", component: ConnectSettings }, + { + id: "remote", + description: "Configure remote access.", + component: ConnectSettings, + }, ], navPanels: [], threadPanelActions: [], @@ -543,7 +547,9 @@ describe("PluginSettingsDetail settings gating", () => { expect(screen.getByText("connect")).toBeDefined(); expect(screen.getByText("v0.1.0")).toBeDefined(); expect(screen.getByText(description)).toBeDefined(); - expect(screen.getByText("Remote access")).toBeDefined(); + expect(screen.queryByText("Remote access")).toBeNull(); + expect(screen.queryByText("Plugin settings")).toBeNull(); + expect(screen.getByText("Configure remote access.")).toBeDefined(); expect(screen.getByText("Custom connect settings")).toBeDefined(); expect( screen.getByRole("switch", { name: "Disable connect" }), diff --git a/plugins/connect/app.test.tsx b/plugins/connect/app.test.tsx index bbf3fbbb2e..673be1087d 100644 --- a/plugins/connect/app.test.tsx +++ b/plugins/connect/app.test.tsx @@ -54,6 +54,10 @@ const connected = (overrides: Partial<ConnectStatus> = {}) => }); describe("connect settings section", () => { + it("uses the plugin page header instead of declaring a second title", () => { + expect(app.settingsSections[0]?.title).toBeUndefined(); + }); + it("auto-submits a normalized 4-4 code and applies live paired status", async () => { let currentStatus = status(); const slot = renderSlot( diff --git a/plugins/connect/app.tsx b/plugins/connect/app.tsx index 16105ba07f..0fdb8fec92 100644 --- a/plugins/connect/app.tsx +++ b/plugins/connect/app.tsx @@ -1172,7 +1172,6 @@ function ConnectSettingsSection() { export default definePluginApp((app) => { app.slots.settingsSection({ id: "remote-access", - title: "Remote access", description: "Use this bb from any device, anywhere — powered by getbb.app.", component: ConnectSettingsSection, diff --git a/plugins/custom-instructions/app.test.tsx b/plugins/custom-instructions/app.test.tsx index c0c94cb064..886f158a4b 100644 --- a/plugins/custom-instructions/app.test.tsx +++ b/plugins/custom-instructions/app.test.tsx @@ -8,6 +8,10 @@ const app = await loadPluginApp(() => import("./app")); afterEach(cleanup); describe("custom instructions settings", () => { + it("uses the plugin page header instead of declaring a second title", () => { + expect(app.settingsSections[0]?.title).toBeUndefined(); + }); + it("loads and autosaves only the latest debounced instructions", async () => { const slot = renderSlot( app.settingsSections[0]!, diff --git a/plugins/custom-instructions/app.tsx b/plugins/custom-instructions/app.tsx index d20fbb0b6c..f6f0379e04 100644 --- a/plugins/custom-instructions/app.tsx +++ b/plugins/custom-instructions/app.tsx @@ -136,7 +136,6 @@ function CustomInstructionsSettings() { export default definePluginApp((app) => { app.slots.settingsSection({ id: "custom-instructions", - title: "Custom instructions", description: "Give agents extra instructions and context for tasks on this bb host.", component: CustomInstructionsSettings, From 1795dae71d17c9e3460c23a1bbb24f00873421d9 Mon Sep 17 00:00:00 2001 From: Michael Yong <wrong92@gmail.com> Date: Wed, 5 Aug 2026 15:45:41 -0700 Subject: [PATCH 13/21] fix: trim provider retry scope --- .../settings/PluginsSettingsSection.test.tsx | 39 ++-------- .../command-output/thread-actions.test.ts | 2 - .../skills/builtin-skills/bb-cli/SKILL.md | 6 +- .../threads/provider-rate-limit-recovery.ts | 2 - .../provider-rate-limit-recovery.test.ts | 2 - packages/domain/src/provider-event.ts | 10 +-- .../test/contract.test.ts | 8 +- .../bundled-types/bb-plugin-sdk.d.ts | 68 ++++++++--------- packages/server-contract/src/api/threads.ts | 2 - .../src/generated/plugin-sdk-dts.generated.ts | 2 +- plugins/provider-retry/app.test.tsx | 6 +- plugins/provider-retry/app.tsx | 4 +- plugins/provider-retry/server.test.ts | 74 ++++++++++++++++--- plugins/provider-retry/src/contract.ts | 2 - plugins/provider-retry/src/service.ts | 8 +- 15 files changed, 118 insertions(+), 117 deletions(-) diff --git a/apps/app/src/components/settings/PluginsSettingsSection.test.tsx b/apps/app/src/components/settings/PluginsSettingsSection.test.tsx index ccc2fa0b9c..567516c782 100644 --- a/apps/app/src/components/settings/PluginsSettingsSection.test.tsx +++ b/apps/app/src/components/settings/PluginsSettingsSection.test.tsx @@ -166,31 +166,6 @@ describe("PluginSettingsForm", () => { values: { apiKey: "sk-123" }, }); }); - - it("keeps the schema visible but disables every control when read-only", async () => { - vi.stubGlobal( - "fetch", - vi.fn(() => Promise.resolve(jsonOk(SETTINGS_VIEW))), - ); - - const { wrapper } = createQueryClientTestHarness(); - render(<PluginSettingsForm pluginId="demo" disabled />, { wrapper }); - - const greeting = (await screen.findByLabelText( - "Greeting", - )) as HTMLInputElement; - const enabled = screen.getByLabelText("Enabled") as HTMLButtonElement; - const save = screen.getByRole("button", { - name: /save settings/i, - }) as HTMLButtonElement; - const form = greeting.closest("form"); - - expect(greeting.disabled).toBe(true); - expect(enabled.disabled).toBe(true); - expect(save.disabled).toBe(true); - expect(form?.getAttribute("aria-disabled")).toBe("true"); - expect(form?.className).toContain("opacity-50"); - }); }); describe("PluginsSettingsSection", () => { @@ -434,22 +409,22 @@ describe("PluginSettingsDetail settings gating", () => { expect(await screen.findByLabelText("Greeting")).toBeTruthy(); }); - it("renders the preserved form read-only for an errored plugin", async () => { + it("shows the no-settings state for an enabled errored plugin", () => { const fetchSpy = vi.fn(() => Promise.resolve(jsonOk(SETTINGS_VIEW))); vi.stubGlobal("fetch", fetchSpy); const { wrapper } = createQueryClientTestHarness(); render( <MemoryRouter> - <PluginSettingsDetail plugin={rowPlugin("error")} /> + <PluginSettingsDetail + plugin={{ ...rowPlugin("error"), hasSettings: false }} + /> </MemoryRouter>, { wrapper }, ); - const greeting = (await screen.findByLabelText( - "Greeting", - )) as HTMLInputElement; - expect(greeting.disabled).toBe(true); + expect(screen.queryByLabelText("Greeting")).toBeNull(); + expect(screen.getByText("This plugin declares no settings.")).toBeDefined(); expect(screen.queryByRole("button", { name: "Remove" })).toBeNull(); - expect(fetchSpy).toHaveBeenCalled(); + expect(fetchSpy).not.toHaveBeenCalled(); }); it("removes a stale builtin plugin from its detail page", async () => { diff --git a/apps/cli/src/__tests__/command-output/thread-actions.test.ts b/apps/cli/src/__tests__/command-output/thread-actions.test.ts index 1aa601b631..b678c28795 100644 --- a/apps/cli/src/__tests__/command-output/thread-actions.test.ts +++ b/apps/cli/src/__tests__/command-output/thread-actions.test.ts @@ -294,8 +294,6 @@ describe("bb thread action command output", () => { candidate: { failedRequestId: "request-failed-1", turnId: "turn-failed-1", - scopeKey: "host-1:codex", - hostId: "host-1", automatic: true, resetsAtMs: 123, rateLimits: { 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 81d79bef8b..80af58cffd 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 @@ -373,9 +373,9 @@ For review or fix pipelines, get the environment ID from user. - The opt-in Provider retry plugin automatically waits for structured Codex and Claude Code subscription-window resets when the failed turn was accepted but - produced no output or possible side effects. Enable it with `bb plugin enable -provider-retry` or under Extensions → Plugins. Its timers last only while - the current bb server/plugin process is running. Inspect it with + produced no output or possible side effects. Enable it with + `bb plugin enable provider-retry` or under Extensions → Plugins. Its timers + last only while the current bb server/plugin process is running. Inspect it with `bb provider-retry status [thread-id]`; use the same command's `refresh`, `now`, and `cancel` subcommands to control the wait. `bb settings usage` reads current provider usage directly from the machine. diff --git a/apps/server/src/services/threads/provider-rate-limit-recovery.ts b/apps/server/src/services/threads/provider-rate-limit-recovery.ts index 7ef124f481..6a3994ba88 100644 --- a/apps/server/src/services/threads/provider-rate-limit-recovery.ts +++ b/apps/server/src/services/threads/provider-rate-limit-recovery.ts @@ -282,8 +282,6 @@ function inspectRecovery(args: InspectRecoveryArgs): RecoveryInspection { automatic, failedRequestId, turnId, - scopeKey: scopeKey(args.environment, args.thread), - hostId: args.environment.hostId, resetsAtMs, rateLimits: currentBlockedRateLimits, }, diff --git a/apps/server/test/services/threads/provider-rate-limit-recovery.test.ts b/apps/server/test/services/threads/provider-rate-limit-recovery.test.ts index 1a05e7f852..4c45777465 100644 --- a/apps/server/test/services/threads/provider-rate-limit-recovery.test.ts +++ b/apps/server/test/services/threads/provider-rate-limit-recovery.test.ts @@ -195,8 +195,6 @@ describe("provider rate-limit recovery", () => { candidate: { failedRequestId: FAILED_REQUEST_ID, turnId: fixture.turnId, - scopeKey: `${fixture.host.id}:codex`, - hostId: fixture.host.id, automatic: true, resetsAtMs: RESET_AT_MS, rateLimits: RATE_LIMITS, diff --git a/packages/domain/src/provider-event.ts b/packages/domain/src/provider-event.ts index 58692a84e6..f3c6dff35b 100644 --- a/packages/domain/src/provider-event.ts +++ b/packages/domain/src/provider-event.ts @@ -105,13 +105,7 @@ export type ProviderRateLimitWindow = z.infer< export const providerRateLimitStateSchema = z.object({ providerId: z.string().min(1), status: providerRateLimitStatusSchema, - kind: z.enum([ - "request-throttle", - "subscription-window", - "credits", - "spend-control", - "unknown", - ]), + kind: z.enum(["subscription-window", "credits", "spend-control", "unknown"]), windows: z.array(providerRateLimitWindowSchema), reachedReason: z.string().min(1).nullable(), overageStatus: z @@ -119,7 +113,7 @@ export const providerRateLimitStateSchema = z.object({ .nullable(), overageReason: z.string().min(1).nullable(), observedAtMs: z.number().int().nonnegative(), - source: z.enum(["codex-account", "claude-rate-limit", "http"]), + source: z.enum(["codex-account", "claude-rate-limit"]), }); export type ProviderRateLimitState = z.infer< typeof providerRateLimitStateSchema diff --git a/packages/host-daemon-contract/test/contract.test.ts b/packages/host-daemon-contract/test/contract.test.ts index f9f7648b9c..86ea74d3a5 100644 --- a/packages/host-daemon-contract/test/contract.test.ts +++ b/packages/host-daemon-contract/test/contract.test.ts @@ -1036,10 +1036,10 @@ describe("host-daemon local schemas", () => { }); describe("host-daemon command schemas", () => { - // Version 76 adds model-scoped/duration-aware provider usage windows and - // structured account rate-limit events on top of version 75's grantable - // Claude sandbox network prompts. - it("uses protocol version 76 for provider usage and rate-limit events", () => { + // Version 76 adds structured provider account rate-limit events to runtime + // session messages on top of version 75's grantable Claude sandbox network + // prompts. Daemons on protocol 75 cannot send the new event shape. + it("uses protocol version 76 for provider rate-limit events", () => { expect(HOST_DAEMON_PROTOCOL_VERSION).toBe(76); }); 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 1bf788d63b..1df20e7177 100644 --- a/packages/plugin-sdk/bundled-types/bb-plugin-sdk.d.ts +++ b/packages/plugin-sdk/bundled-types/bb-plugin-sdk.d.ts @@ -1471,7 +1471,6 @@ declare const threadEventSchema: z$1.ZodPipe<z$1.ZodUnknown, z$1.ZodUnion<readon }>; kind: z$1.ZodEnum<{ unknown: "unknown"; - "request-throttle": "request-throttle"; "subscription-window": "subscription-window"; credits: "credits"; "spend-control": "spend-control"; @@ -1501,7 +1500,6 @@ declare const threadEventSchema: z$1.ZodPipe<z$1.ZodUnknown, z$1.ZodUnion<readon source: z$1.ZodEnum<{ "codex-account": "codex-account"; "claude-rate-limit": "claude-rate-limit"; - http: "http"; }>; }, z$1.core.$strip>; }, z$1.core.$strip>, z$1.ZodObject<{ @@ -2577,8 +2575,8 @@ type SkillFilesResponse = z$1.infer<typeof skillFilesResponseSchema>; declare const projectResponseSchema: z$1.ZodObject<{ id: z$1.ZodString; kind: z$1.ZodEnum<{ - personal: "personal"; standard: "standard"; + personal: "personal"; }>; name: z$1.ZodString; gitRemoteUrl: z$1.ZodNullable<z$1.ZodString>; @@ -2599,8 +2597,8 @@ type ProjectResponse = z$1.infer<typeof projectResponseSchema>; declare const projectWithThreadsResponseSchema: z$1.ZodObject<{ id: z$1.ZodString; kind: z$1.ZodEnum<{ - personal: "personal"; standard: "standard"; + personal: "personal"; }>; name: z$1.ZodString; gitRemoteUrl: z$1.ZodNullable<z$1.ZodString>; @@ -2700,8 +2698,8 @@ declare const projectWithThreadsResponseSchema: z$1.ZodObject<{ ultra: "ultra"; }>; permissionMode: z$1.ZodEnum<{ - auto: "auto"; "accept-edits": "accept-edits"; + auto: "auto"; full: "full"; }>; }, z$1.core.$strip>>; @@ -2890,8 +2888,8 @@ declare const environmentDiffFileResponseSchema: z$1.ZodObject<{ path: z$1.ZodString; content: z$1.ZodString; contentEncoding: z$1.ZodEnum<{ - utf8: "utf8"; base64: "base64"; + utf8: "utf8"; }>; mimeType: z$1.ZodOptional<z$1.ZodString>; sizeBytes: z$1.ZodNumber; @@ -3120,8 +3118,8 @@ declare const environmentPullRequestResponseSchema: z$1.ZodDiscriminatedUnion<[z }>>; }, z$1.core.$strict>; attention: z$1.ZodEnum<{ - blocked: "blocked"; none: "none"; + blocked: "blocked"; merged: "merged"; draft: "draft"; closed: "closed"; @@ -3564,8 +3562,8 @@ declare const hostDaemonCommandRegistry: { }, z$1.core.$strict>], "kind">>; disallowedTools: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>; instructionMode: z$1.ZodEnum<{ - replace: "replace"; append: "append"; + replace: "replace"; }>; type: z$1.ZodLiteral<"thread.start">; requestId: z$1.ZodString; @@ -4053,8 +4051,8 @@ declare const hostDaemonCommandRegistry: { }>; }, z$1.core.$strip>; instructionMode: z$1.ZodEnum<{ - replace: "replace"; append: "append"; + replace: "replace"; }>; projectId: z$1.ZodString; providerId: z$1.ZodString; @@ -4349,8 +4347,8 @@ declare const hostDaemonCommandRegistry: { }>; }, z$1.core.$strip>; instructionMode: z$1.ZodEnum<{ - replace: "replace"; append: "append"; + replace: "replace"; }>; projectId: z$1.ZodString; providerId: z$1.ZodString; @@ -5353,9 +5351,9 @@ declare const hostDaemonCommandRegistry: { executablePath: z$1.ZodNullable<z$1.ZodString>; installed: z$1.ZodBoolean; installSource: z$1.ZodEnum<{ + external: "external"; notInstalled: "notInstalled"; npmGlobal: "npmGlobal"; - external: "external"; }>; currentVersion: z$1.ZodNullable<z$1.ZodString>; latestVersion: z$1.ZodNullable<z$1.ZodString>; @@ -5528,13 +5526,13 @@ declare const hostDaemonCommandRegistry: { outcome: z$1.ZodLiteral<"unavailable">; failure: z$1.ZodObject<{ code: z$1.ZodEnum<{ - unknown: "unknown"; path_not_found: "path_not_found"; not_git_repo: "not_git_repo"; not_worktree: "not_worktree"; workspace_type_mismatch: "workspace_type_mismatch"; permission_denied: "permission_denied"; unknown_environment: "unknown_environment"; + unknown: "unknown"; }>; workspacePath: z$1.ZodString; message: z$1.ZodString; @@ -5578,13 +5576,13 @@ declare const hostDaemonCommandRegistry: { outcome: z$1.ZodLiteral<"unavailable">; failure: z$1.ZodObject<{ code: z$1.ZodEnum<{ - unknown: "unknown"; path_not_found: "path_not_found"; not_git_repo: "not_git_repo"; not_worktree: "not_worktree"; workspace_type_mismatch: "workspace_type_mismatch"; permission_denied: "permission_denied"; unknown_environment: "unknown_environment"; + unknown: "unknown"; }>; workspacePath: z$1.ZodString; message: z$1.ZodString; @@ -5640,13 +5638,13 @@ declare const hostDaemonCommandRegistry: { outcome: z$1.ZodLiteral<"unavailable">; failure: z$1.ZodObject<{ code: z$1.ZodEnum<{ - unknown: "unknown"; path_not_found: "path_not_found"; not_git_repo: "not_git_repo"; not_worktree: "not_worktree"; workspace_type_mismatch: "workspace_type_mismatch"; permission_denied: "permission_denied"; unknown_environment: "unknown_environment"; + unknown: "unknown"; }>; workspacePath: z$1.ZodString; message: z$1.ZodString; @@ -5688,13 +5686,13 @@ declare const hostDaemonCommandRegistry: { outcome: z$1.ZodLiteral<"unavailable">; failure: z$1.ZodObject<{ code: z$1.ZodEnum<{ - unknown: "unknown"; path_not_found: "path_not_found"; not_git_repo: "not_git_repo"; not_worktree: "not_worktree"; workspace_type_mismatch: "workspace_type_mismatch"; permission_denied: "permission_denied"; unknown_environment: "unknown_environment"; + unknown: "unknown"; }>; workspacePath: z$1.ZodString; message: z$1.ZodString; @@ -5812,9 +5810,9 @@ declare const providerCliStatusResponseSchema: z$1.ZodRecord<z$1.ZodEnum<{ executablePath: z$1.ZodNullable<z$1.ZodString>; installed: z$1.ZodBoolean; installSource: z$1.ZodEnum<{ + external: "external"; notInstalled: "notInstalled"; npmGlobal: "npmGlobal"; - external: "external"; }>; currentVersion: z$1.ZodNullable<z$1.ZodString>; latestVersion: z$1.ZodNullable<z$1.ZodString>; @@ -6404,8 +6402,8 @@ declare const systemExecutionOptionsResponseSchema: z$1.ZodObject<{ supportsUserQuestion: z$1.ZodBoolean; supportsFork: z$1.ZodBoolean; supportedPermissionModes: z$1.ZodArray<z$1.ZodEnum<{ - auto: "auto"; "accept-edits": "accept-edits"; + auto: "auto"; full: "full"; }>>; }, z$1.core.$strip>; @@ -6436,8 +6434,8 @@ declare const systemExecutionOptionsResponseSchema: z$1.ZodObject<{ available: z$1.ZodBoolean; }, z$1.core.$strip>>; permissionCeiling: z$1.ZodEnum<{ - auto: "auto"; "accept-edits": "accept-edits"; + auto: "auto"; full: "full"; }>; models: z$1.ZodArray<z$1.ZodObject<{ @@ -7867,10 +7865,10 @@ declare const createThreadRequestSchema: z$1.ZodObject<{ ultra: "ultra"; }>>; permissionMode: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodUnion<readonly [z$1.ZodEnum<{ - auto: "auto"; "accept-edits": "accept-edits"; + auto: "auto"; full: "full"; - }>, z$1.ZodLiteral<"workspace-write">]>, z$1.ZodTransform<"auto" | "accept-edits" | "full", "auto" | "accept-edits" | "full" | "workspace-write">>>; + }>, z$1.ZodLiteral<"workspace-write">]>, z$1.ZodTransform<"accept-edits" | "auto" | "full", "accept-edits" | "auto" | "full" | "workspace-write">>>; executionInputSources: z$1.ZodOptional<z$1.ZodObject<{ providerId: z$1.ZodOptional<z$1.ZodEnum<{ explicit: "explicit"; @@ -8111,10 +8109,10 @@ declare const forkThreadRequestSchema: z$1.ZodObject<{ }, z$1.core.$strip>>>>; 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"; + auto: "auto"; full: "full"; - }>, z$1.ZodLiteral<"workspace-write">]>, z$1.ZodTransform<"auto" | "accept-edits" | "full", "auto" | "accept-edits" | "full" | "workspace-write">>>; + }>, z$1.ZodLiteral<"workspace-write">]>, z$1.ZodTransform<"accept-edits" | "auto" | "full", "accept-edits" | "auto" | "full" | "workspace-write">>>; visibility: z$1.ZodDefault<z$1.ZodEnum<{ visible: "visible"; hidden: "hidden"; @@ -8230,10 +8228,10 @@ declare const sendMessageRequestSchema: z$1.ZodObject<{ ultra: "ultra"; }>>; permissionMode: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodUnion<readonly [z$1.ZodEnum<{ - auto: "auto"; "accept-edits": "accept-edits"; + auto: "auto"; full: "full"; - }>, z$1.ZodLiteral<"workspace-write">]>, z$1.ZodTransform<"auto" | "accept-edits" | "full", "auto" | "accept-edits" | "full" | "workspace-write">>>; + }>, z$1.ZodLiteral<"workspace-write">]>, z$1.ZodTransform<"accept-edits" | "auto" | "full", "accept-edits" | "auto" | "full" | "workspace-write">>>; executionInputSources: z$1.ZodOptional<z$1.ZodObject<{ model: z$1.ZodOptional<z$1.ZodEnum<{ explicit: "explicit"; @@ -8287,7 +8285,6 @@ declare const providerRateLimitRecoveryStatusSchema: z$1.ZodObject<{ }>; kind: z$1.ZodEnum<{ unknown: "unknown"; - "request-throttle": "request-throttle"; "subscription-window": "subscription-window"; credits: "credits"; "spend-control": "spend-control"; @@ -8317,14 +8314,11 @@ declare const providerRateLimitRecoveryStatusSchema: z$1.ZodObject<{ source: z$1.ZodEnum<{ "codex-account": "codex-account"; "claude-rate-limit": "claude-rate-limit"; - http: "http"; }>; }, z$1.core.$strip>>; candidate: z$1.ZodNullable<z$1.ZodObject<{ failedRequestId: z$1.ZodString; turnId: z$1.ZodString; - scopeKey: z$1.ZodString; - hostId: z$1.ZodString; automatic: z$1.ZodBoolean; resetsAtMs: z$1.ZodNullable<z$1.ZodNumber>; rateLimits: z$1.ZodObject<{ @@ -8337,7 +8331,6 @@ declare const providerRateLimitRecoveryStatusSchema: z$1.ZodObject<{ }>; kind: z$1.ZodEnum<{ unknown: "unknown"; - "request-throttle": "request-throttle"; "subscription-window": "subscription-window"; credits: "credits"; "spend-control": "spend-control"; @@ -8367,7 +8360,6 @@ declare const providerRateLimitRecoveryStatusSchema: z$1.ZodObject<{ source: z$1.ZodEnum<{ "codex-account": "codex-account"; "claude-rate-limit": "claude-rate-limit"; - http: "http"; }>; }, z$1.core.$strip>; }, z$1.core.$strip>>; @@ -8476,10 +8468,10 @@ declare const createQueuedMessageRequestSchema: z$1.ZodObject<{ ultra: "ultra"; }>>; permissionMode: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodUnion<readonly [z$1.ZodEnum<{ - auto: "auto"; "accept-edits": "accept-edits"; + auto: "auto"; full: "full"; - }>, z$1.ZodLiteral<"workspace-write">]>, z$1.ZodTransform<"auto" | "accept-edits" | "full", "auto" | "accept-edits" | "full" | "workspace-write">>>; + }>, z$1.ZodLiteral<"workspace-write">]>, z$1.ZodTransform<"accept-edits" | "auto" | "full", "accept-edits" | "auto" | "full" | "workspace-write">>>; executionInputSources: z$1.ZodOptional<z$1.ZodObject<{ model: z$1.ZodOptional<z$1.ZodEnum<{ explicit: "explicit"; @@ -8701,8 +8693,8 @@ declare const sendQueuedMessageResponseSchema: z$1.ZodObject<{ ultra: "ultra"; }>; permissionMode: z$1.ZodEnum<{ - auto: "auto"; "accept-edits": "accept-edits"; + auto: "auto"; full: "full"; }>; serviceTier: z$1.ZodEnum<{ @@ -9071,9 +9063,9 @@ declare const threadWithIncludesResponseSchema: z$1.ZodObject<{ isGitRepo: z$1.ZodBoolean; isWorktree: z$1.ZodBoolean; workspaceProvisionType: z$1.ZodEnum<{ - unmanaged: "unmanaged"; - "managed-worktree": "managed-worktree"; personal: "personal"; + "managed-worktree": "managed-worktree"; + unmanaged: "unmanaged"; }>; branchName: z$1.ZodNullable<z$1.ZodString>; baseBranch: z$1.ZodNullable<z$1.ZodString>; @@ -9101,8 +9093,8 @@ declare const threadWithIncludesResponseSchema: z$1.ZodObject<{ connected: "connected"; }>; maxPermissionMode: z$1.ZodEnum<{ - auto: "auto"; "accept-edits": "accept-edits"; + auto: "auto"; full: "full"; }>; lastSeenAt: z$1.ZodNullable<z$1.ZodNumber>; @@ -9372,8 +9364,8 @@ declare const threadQueuedMessageListResponseSchema: z$1.ZodArray<z$1.ZodObject< ultra: "ultra"; }>; permissionMode: z$1.ZodEnum<{ - auto: "auto"; "accept-edits": "accept-edits"; + auto: "auto"; full: "full"; }>; serviceTier: z$1.ZodEnum<{ @@ -9741,8 +9733,8 @@ declare const threadTimelineResponseSchema: z$1.ZodObject<{ originalModel: z$1.ZodString; fallbackModel: z$1.ZodString; reason: z$1.ZodEnum<{ - refusal: "refusal"; provider: "provider"; + refusal: "refusal"; }>; message: z$1.ZodString; }, z$1.core.$strip>>; diff --git a/packages/server-contract/src/api/threads.ts b/packages/server-contract/src/api/threads.ts index 7603a5432c..142fa80c93 100644 --- a/packages/server-contract/src/api/threads.ts +++ b/packages/server-contract/src/api/threads.ts @@ -237,8 +237,6 @@ export type ProviderRateLimitRecoveryReason = z.infer< export const providerRateLimitRecoveryCandidateSchema = z.object({ failedRequestId: clientTurnRequestIdSchema, turnId: z.string().min(1), - scopeKey: z.string().min(1), - hostId: z.string().min(1), automatic: z.boolean(), resetsAtMs: z.number().int().nonnegative().nullable(), rateLimits: providerRateLimitStateSchema, diff --git a/packages/templates/src/generated/plugin-sdk-dts.generated.ts b/packages/templates/src/generated/plugin-sdk-dts.generated.ts index 86e975b06b..db90a0ee54 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/rateLimits/updated\" | \"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/rateLimits/updated\" | \"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 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 interrupted: \"interrupted\";\n pending: \"pending\";\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 interrupted: \"interrupted\";\n pending: \"pending\";\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 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>, 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 completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\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 completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\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 completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\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 completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\n }>;\n taskStatus: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n paused: \"paused\";\n pending: \"pending\";\n running: \"running\";\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 failed: \"failed\";\n running: \"running\";\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 completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\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 completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\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 completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\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 completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\n }>;\n taskStatus: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n paused: \"paused\";\n pending: \"pending\";\n running: \"running\";\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 failed: \"failed\";\n running: \"running\";\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 completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\n }>;\n taskStatus: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n paused: \"paused\";\n pending: \"pending\";\n running: \"running\";\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 failed: \"failed\";\n running: \"running\";\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 completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\n }>;\n taskStatus: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n paused: \"paused\";\n pending: \"pending\";\n running: \"running\";\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 failed: \"failed\";\n running: \"running\";\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 completed: \"completed\";\n failed: \"failed\";\n active: \"active\";\n pending: \"pending\";\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/rateLimits/updated\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n rateLimits: z$1.ZodObject<{\n providerId: z$1.ZodString;\n status: z$1.ZodEnum<{\n unknown: \"unknown\";\n allowed: \"allowed\";\n warning: \"warning\";\n blocked: \"blocked\";\n }>;\n kind: z$1.ZodEnum<{\n unknown: \"unknown\";\n \"request-throttle\": \"request-throttle\";\n \"subscription-window\": \"subscription-window\";\n credits: \"credits\";\n \"spend-control\": \"spend-control\";\n }>;\n windows: z$1.ZodArray<z$1.ZodObject<{\n providerKey: z$1.ZodNullable<z$1.ZodString>;\n label: z$1.ZodNullable<z$1.ZodString>;\n status: z$1.ZodEnum<{\n unknown: \"unknown\";\n allowed: \"allowed\";\n warning: \"warning\";\n blocked: \"blocked\";\n }>;\n usedPercent: z$1.ZodNullable<z$1.ZodNumber>;\n resetsAtMs: z$1.ZodNullable<z$1.ZodNumber>;\n modelIds: z$1.ZodArray<z$1.ZodString>;\n }, z$1.core.$strip>>;\n reachedReason: z$1.ZodNullable<z$1.ZodString>;\n overageStatus: z$1.ZodNullable<z$1.ZodEnum<{\n allowed: \"allowed\";\n warning: \"warning\";\n rejected: \"rejected\";\n unavailable: \"unavailable\";\n }>>;\n overageReason: z$1.ZodNullable<z$1.ZodString>;\n observedAtMs: z$1.ZodNumber;\n source: z$1.ZodEnum<{\n \"codex-account\": \"codex-account\";\n \"claude-rate-limit\": \"claude-rate-limit\";\n http: \"http\";\n }>;\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 continuationOfRequestId: z$1.ZodOptional<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 interrupted: \"interrupted\";\n pending: \"pending\";\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 interrupted: \"interrupted\";\n pending: \"pending\";\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 completed: \"completed\";\n pending: \"pending\";\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 utf8: \"utf8\";\n base64: \"base64\";\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 blocked: \"blocked\";\n draft: \"draft\";\n mergeable: \"mergeable\";\n conflicts: \"conflicts\";\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 blocked: \"blocked\";\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 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 replace: \"replace\";\n append: \"append\";\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 replace: \"replace\";\n append: \"append\";\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 replace: \"replace\";\n append: \"append\";\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 }, 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 notInstalled: \"notInstalled\";\n npmGlobal: \"npmGlobal\";\n external: \"external\";\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 unknown: \"unknown\";\n path_not_found: \"path_not_found\";\n not_git_repo: \"not_git_repo\";\n not_worktree: \"not_worktree\";\n workspace_type_mismatch: \"workspace_type_mismatch\";\n permission_denied: \"permission_denied\";\n unknown_environment: \"unknown_environment\";\n }>;\n workspacePath: z$1.ZodString;\n message: z$1.ZodString;\n }, z$1.core.$strict>;\n }, z$1.core.$strict>], \"outcome\">, \"onlineRpc\", true>;\n \"workspace.diff\": HostDaemonCommandDescriptor<\"workspace.diff\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.diff\">;\n target: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"uncommitted\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"branch_committed\">;\n mergeBaseBranch: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"all\">;\n mergeBaseBranch: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"commit\">;\n sha: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">;\n maxDiffBytes: z$1.ZodNumber;\n maxFileListBytes: z$1.ZodNumber;\n }, z$1.core.$strict>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n diff: z$1.ZodObject<{\n diff: z$1.ZodString;\n truncated: z$1.ZodBoolean;\n shortstat: z$1.ZodString;\n files: z$1.ZodString;\n mergeBaseRef: z$1.ZodNullable<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 unknown: \"unknown\";\n path_not_found: \"path_not_found\";\n not_git_repo: \"not_git_repo\";\n not_worktree: \"not_worktree\";\n workspace_type_mismatch: \"workspace_type_mismatch\";\n permission_denied: \"permission_denied\";\n unknown_environment: \"unknown_environment\";\n }>;\n workspacePath: z$1.ZodString;\n message: z$1.ZodString;\n }, z$1.core.$strict>;\n }, z$1.core.$strict>], \"outcome\">, \"onlineRpc\", true>;\n \"workspace.diffFiles\": HostDaemonCommandDescriptor<\"workspace.diffFiles\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.diffFiles\">;\n target: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"uncommitted\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"branch_committed\">;\n mergeBaseBranch: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"all\">;\n mergeBaseBranch: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"commit\">;\n sha: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">;\n }, z$1.core.$strict>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n files: z$1.ZodArray<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 unknown: \"unknown\";\n path_not_found: \"path_not_found\";\n not_git_repo: \"not_git_repo\";\n not_worktree: \"not_worktree\";\n workspace_type_mismatch: \"workspace_type_mismatch\";\n permission_denied: \"permission_denied\";\n unknown_environment: \"unknown_environment\";\n }>;\n workspacePath: z$1.ZodString;\n message: z$1.ZodString;\n }, z$1.core.$strict>;\n }, z$1.core.$strict>], \"outcome\">, \"onlineRpc\", true>;\n \"workspace.diffPatch\": HostDaemonCommandDescriptor<\"workspace.diffPatch\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.diffPatch\">;\n target: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"uncommitted\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"branch_committed\">;\n mergeBaseBranch: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"all\">;\n mergeBaseBranch: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"commit\">;\n sha: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">;\n paths: z$1.ZodArray<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 unknown: \"unknown\";\n path_not_found: \"path_not_found\";\n not_git_repo: \"not_git_repo\";\n not_worktree: \"not_worktree\";\n workspace_type_mismatch: \"workspace_type_mismatch\";\n permission_denied: \"permission_denied\";\n unknown_environment: \"unknown_environment\";\n }>;\n workspacePath: z$1.ZodString;\n message: z$1.ZodString;\n }, z$1.core.$strict>;\n }, z$1.core.$strict>], \"outcome\">, \"onlineRpc\", true>;\n \"workspace.pull_request\": HostDaemonCommandDescriptor<\"workspace.pull_request\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.pull_request\">;\n }, z$1.core.$strict>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n pullRequest: z$1.ZodObject<{\n number: z$1.ZodNumber;\n title: z$1.ZodString;\n state: z$1.ZodEnum<{\n OPEN: \"OPEN\";\n CLOSED: \"CLOSED\";\n MERGED: \"MERGED\";\n }>;\n url: z$1.ZodString;\n isDraft: z$1.ZodBoolean;\n baseRefName: z$1.ZodString;\n headRefName: z$1.ZodString;\n updatedAt: z$1.ZodString;\n checks: z$1.ZodArray<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 notInstalled: \"notInstalled\";\n npmGlobal: \"npmGlobal\";\n external: \"external\";\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 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 providerRateLimitRecoveryStatusSchema: z$1.ZodObject<{\n reason: z$1.ZodEnum<{\n eligible: \"eligible\";\n \"thread-not-failed\": \"thread-not-failed\";\n \"no-failed-turn\": \"no-failed-turn\";\n \"input-not-accepted\": \"input-not-accepted\";\n \"no-rate-limit-state\": \"no-rate-limit-state\";\n \"provider-will-retry\": \"provider-will-retry\";\n \"manual-only\": \"manual-only\";\n \"output-or-side-effect-observed\": \"output-or-side-effect-observed\";\n superseded: \"superseded\";\n \"execution-unavailable\": \"execution-unavailable\";\n }>;\n scopeKey: z$1.ZodString;\n hostId: z$1.ZodString;\n rateLimits: z$1.ZodNullable<z$1.ZodObject<{\n providerId: z$1.ZodString;\n status: z$1.ZodEnum<{\n unknown: \"unknown\";\n warning: \"warning\";\n allowed: \"allowed\";\n blocked: \"blocked\";\n }>;\n kind: z$1.ZodEnum<{\n unknown: \"unknown\";\n \"request-throttle\": \"request-throttle\";\n \"subscription-window\": \"subscription-window\";\n credits: \"credits\";\n \"spend-control\": \"spend-control\";\n }>;\n windows: z$1.ZodArray<z$1.ZodObject<{\n providerKey: z$1.ZodNullable<z$1.ZodString>;\n label: z$1.ZodNullable<z$1.ZodString>;\n status: z$1.ZodEnum<{\n unknown: \"unknown\";\n warning: \"warning\";\n allowed: \"allowed\";\n blocked: \"blocked\";\n }>;\n usedPercent: z$1.ZodNullable<z$1.ZodNumber>;\n resetsAtMs: z$1.ZodNullable<z$1.ZodNumber>;\n modelIds: z$1.ZodArray<z$1.ZodString>;\n }, z$1.core.$strip>>;\n reachedReason: z$1.ZodNullable<z$1.ZodString>;\n overageStatus: z$1.ZodNullable<z$1.ZodEnum<{\n warning: \"warning\";\n allowed: \"allowed\";\n rejected: \"rejected\";\n unavailable: \"unavailable\";\n }>>;\n overageReason: z$1.ZodNullable<z$1.ZodString>;\n observedAtMs: z$1.ZodNumber;\n source: z$1.ZodEnum<{\n \"codex-account\": \"codex-account\";\n \"claude-rate-limit\": \"claude-rate-limit\";\n http: \"http\";\n }>;\n }, z$1.core.$strip>>;\n candidate: z$1.ZodNullable<z$1.ZodObject<{\n failedRequestId: z$1.ZodString;\n turnId: z$1.ZodString;\n scopeKey: z$1.ZodString;\n hostId: z$1.ZodString;\n automatic: z$1.ZodBoolean;\n resetsAtMs: z$1.ZodNullable<z$1.ZodNumber>;\n rateLimits: z$1.ZodObject<{\n providerId: z$1.ZodString;\n status: z$1.ZodEnum<{\n unknown: \"unknown\";\n warning: \"warning\";\n allowed: \"allowed\";\n blocked: \"blocked\";\n }>;\n kind: z$1.ZodEnum<{\n unknown: \"unknown\";\n \"request-throttle\": \"request-throttle\";\n \"subscription-window\": \"subscription-window\";\n credits: \"credits\";\n \"spend-control\": \"spend-control\";\n }>;\n windows: z$1.ZodArray<z$1.ZodObject<{\n providerKey: z$1.ZodNullable<z$1.ZodString>;\n label: z$1.ZodNullable<z$1.ZodString>;\n status: z$1.ZodEnum<{\n unknown: \"unknown\";\n warning: \"warning\";\n allowed: \"allowed\";\n blocked: \"blocked\";\n }>;\n usedPercent: z$1.ZodNullable<z$1.ZodNumber>;\n resetsAtMs: z$1.ZodNullable<z$1.ZodNumber>;\n modelIds: z$1.ZodArray<z$1.ZodString>;\n }, z$1.core.$strip>>;\n reachedReason: z$1.ZodNullable<z$1.ZodString>;\n overageStatus: z$1.ZodNullable<z$1.ZodEnum<{\n warning: \"warning\";\n allowed: \"allowed\";\n rejected: \"rejected\";\n unavailable: \"unavailable\";\n }>>;\n overageReason: z$1.ZodNullable<z$1.ZodString>;\n observedAtMs: z$1.ZodNumber;\n source: z$1.ZodEnum<{\n \"codex-account\": \"codex-account\";\n \"claude-rate-limit\": \"claude-rate-limit\";\n http: \"http\";\n }>;\n }, z$1.core.$strip>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype ProviderRateLimitRecoveryStatus = z$1.infer<typeof providerRateLimitRecoveryStatusSchema>;\ndeclare const continueAfterProviderRateLimitResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\n requestId: z$1.ZodString;\n}, z$1.core.$strip>;\ntype ContinueAfterProviderRateLimitResponse = z$1.infer<typeof continueAfterProviderRateLimitResponseSchema>;\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 ThreadRateLimitRecoveryResult = ProviderRateLimitRecoveryStatus;\ntype ThreadContinueAfterRateLimitResult = ContinueAfterProviderRateLimitResponse;\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 ThreadContinueAfterRateLimitArgs extends ThreadActionArgs {\n failedRequestId: 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 continueAfterRateLimit(args: ThreadContinueAfterRateLimitArgs): Promise<ThreadContinueAfterRateLimitResult>;\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 rateLimitRecovery(args: ThreadStatusArgs): Promise<ThreadRateLimitRecoveryResult>;\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/rateLimits/updated\" | \"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/rateLimits/updated\" | \"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 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 interrupted: \"interrupted\";\n pending: \"pending\";\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 interrupted: \"interrupted\";\n pending: \"pending\";\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 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>, 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 completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\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 completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\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 completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\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 completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\n }>;\n taskStatus: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n paused: \"paused\";\n pending: \"pending\";\n running: \"running\";\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 failed: \"failed\";\n running: \"running\";\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 completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\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 completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\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 completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\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 completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\n }>;\n taskStatus: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n paused: \"paused\";\n pending: \"pending\";\n running: \"running\";\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 failed: \"failed\";\n running: \"running\";\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 completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\n }>;\n taskStatus: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n paused: \"paused\";\n pending: \"pending\";\n running: \"running\";\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 failed: \"failed\";\n running: \"running\";\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 completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\n }>;\n taskStatus: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n paused: \"paused\";\n pending: \"pending\";\n running: \"running\";\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 failed: \"failed\";\n running: \"running\";\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 completed: \"completed\";\n failed: \"failed\";\n active: \"active\";\n pending: \"pending\";\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/rateLimits/updated\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n rateLimits: z$1.ZodObject<{\n providerId: z$1.ZodString;\n status: z$1.ZodEnum<{\n unknown: \"unknown\";\n allowed: \"allowed\";\n warning: \"warning\";\n blocked: \"blocked\";\n }>;\n kind: z$1.ZodEnum<{\n unknown: \"unknown\";\n \"subscription-window\": \"subscription-window\";\n credits: \"credits\";\n \"spend-control\": \"spend-control\";\n }>;\n windows: z$1.ZodArray<z$1.ZodObject<{\n providerKey: z$1.ZodNullable<z$1.ZodString>;\n label: z$1.ZodNullable<z$1.ZodString>;\n status: z$1.ZodEnum<{\n unknown: \"unknown\";\n allowed: \"allowed\";\n warning: \"warning\";\n blocked: \"blocked\";\n }>;\n usedPercent: z$1.ZodNullable<z$1.ZodNumber>;\n resetsAtMs: z$1.ZodNullable<z$1.ZodNumber>;\n modelIds: z$1.ZodArray<z$1.ZodString>;\n }, z$1.core.$strip>>;\n reachedReason: z$1.ZodNullable<z$1.ZodString>;\n overageStatus: z$1.ZodNullable<z$1.ZodEnum<{\n allowed: \"allowed\";\n warning: \"warning\";\n rejected: \"rejected\";\n unavailable: \"unavailable\";\n }>>;\n overageReason: z$1.ZodNullable<z$1.ZodString>;\n observedAtMs: z$1.ZodNumber;\n source: z$1.ZodEnum<{\n \"codex-account\": \"codex-account\";\n \"claude-rate-limit\": \"claude-rate-limit\";\n }>;\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 continuationOfRequestId: z$1.ZodOptional<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 interrupted: \"interrupted\";\n pending: \"pending\";\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 interrupted: \"interrupted\";\n pending: \"pending\";\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 completed: \"completed\";\n pending: \"pending\";\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 standard: \"standard\";\n personal: \"personal\";\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 standard: \"standard\";\n personal: \"personal\";\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 \"accept-edits\": \"accept-edits\";\n auto: \"auto\";\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 blocked: \"blocked\";\n draft: \"draft\";\n mergeable: \"mergeable\";\n conflicts: \"conflicts\";\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 blocked: \"blocked\";\n merged: \"merged\";\n draft: \"draft\";\n closed: \"closed\";\n changes_requested: \"changes_requested\";\n review_requested: \"review_requested\";\n conflicts: \"conflicts\";\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 }, 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 \"accept-edits\": \"accept-edits\";\n auto: \"auto\";\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 \"accept-edits\": \"accept-edits\";\n auto: \"auto\";\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 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 \"accept-edits\": \"accept-edits\";\n auto: \"auto\";\n full: \"full\";\n }>, z$1.ZodLiteral<\"workspace-write\">]>, z$1.ZodTransform<\"accept-edits\" | \"auto\" | \"full\", \"accept-edits\" | \"auto\" | \"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 \"accept-edits\": \"accept-edits\";\n auto: \"auto\";\n full: \"full\";\n }>, z$1.ZodLiteral<\"workspace-write\">]>, z$1.ZodTransform<\"accept-edits\" | \"auto\" | \"full\", \"accept-edits\" | \"auto\" | \"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 \"accept-edits\": \"accept-edits\";\n auto: \"auto\";\n full: \"full\";\n }>, z$1.ZodLiteral<\"workspace-write\">]>, z$1.ZodTransform<\"accept-edits\" | \"auto\" | \"full\", \"accept-edits\" | \"auto\" | \"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 providerRateLimitRecoveryStatusSchema: z$1.ZodObject<{\n reason: z$1.ZodEnum<{\n eligible: \"eligible\";\n \"thread-not-failed\": \"thread-not-failed\";\n \"no-failed-turn\": \"no-failed-turn\";\n \"input-not-accepted\": \"input-not-accepted\";\n \"no-rate-limit-state\": \"no-rate-limit-state\";\n \"provider-will-retry\": \"provider-will-retry\";\n \"manual-only\": \"manual-only\";\n \"output-or-side-effect-observed\": \"output-or-side-effect-observed\";\n superseded: \"superseded\";\n \"execution-unavailable\": \"execution-unavailable\";\n }>;\n scopeKey: z$1.ZodString;\n hostId: z$1.ZodString;\n rateLimits: z$1.ZodNullable<z$1.ZodObject<{\n providerId: z$1.ZodString;\n status: z$1.ZodEnum<{\n unknown: \"unknown\";\n warning: \"warning\";\n allowed: \"allowed\";\n blocked: \"blocked\";\n }>;\n kind: z$1.ZodEnum<{\n unknown: \"unknown\";\n \"subscription-window\": \"subscription-window\";\n credits: \"credits\";\n \"spend-control\": \"spend-control\";\n }>;\n windows: z$1.ZodArray<z$1.ZodObject<{\n providerKey: z$1.ZodNullable<z$1.ZodString>;\n label: z$1.ZodNullable<z$1.ZodString>;\n status: z$1.ZodEnum<{\n unknown: \"unknown\";\n warning: \"warning\";\n allowed: \"allowed\";\n blocked: \"blocked\";\n }>;\n usedPercent: z$1.ZodNullable<z$1.ZodNumber>;\n resetsAtMs: z$1.ZodNullable<z$1.ZodNumber>;\n modelIds: z$1.ZodArray<z$1.ZodString>;\n }, z$1.core.$strip>>;\n reachedReason: z$1.ZodNullable<z$1.ZodString>;\n overageStatus: z$1.ZodNullable<z$1.ZodEnum<{\n warning: \"warning\";\n allowed: \"allowed\";\n rejected: \"rejected\";\n unavailable: \"unavailable\";\n }>>;\n overageReason: z$1.ZodNullable<z$1.ZodString>;\n observedAtMs: z$1.ZodNumber;\n source: z$1.ZodEnum<{\n \"codex-account\": \"codex-account\";\n \"claude-rate-limit\": \"claude-rate-limit\";\n }>;\n }, z$1.core.$strip>>;\n candidate: z$1.ZodNullable<z$1.ZodObject<{\n failedRequestId: z$1.ZodString;\n turnId: z$1.ZodString;\n automatic: z$1.ZodBoolean;\n resetsAtMs: z$1.ZodNullable<z$1.ZodNumber>;\n rateLimits: z$1.ZodObject<{\n providerId: z$1.ZodString;\n status: z$1.ZodEnum<{\n unknown: \"unknown\";\n warning: \"warning\";\n allowed: \"allowed\";\n blocked: \"blocked\";\n }>;\n kind: z$1.ZodEnum<{\n unknown: \"unknown\";\n \"subscription-window\": \"subscription-window\";\n credits: \"credits\";\n \"spend-control\": \"spend-control\";\n }>;\n windows: z$1.ZodArray<z$1.ZodObject<{\n providerKey: z$1.ZodNullable<z$1.ZodString>;\n label: z$1.ZodNullable<z$1.ZodString>;\n status: z$1.ZodEnum<{\n unknown: \"unknown\";\n warning: \"warning\";\n allowed: \"allowed\";\n blocked: \"blocked\";\n }>;\n usedPercent: z$1.ZodNullable<z$1.ZodNumber>;\n resetsAtMs: z$1.ZodNullable<z$1.ZodNumber>;\n modelIds: z$1.ZodArray<z$1.ZodString>;\n }, z$1.core.$strip>>;\n reachedReason: z$1.ZodNullable<z$1.ZodString>;\n overageStatus: z$1.ZodNullable<z$1.ZodEnum<{\n warning: \"warning\";\n allowed: \"allowed\";\n rejected: \"rejected\";\n unavailable: \"unavailable\";\n }>>;\n overageReason: z$1.ZodNullable<z$1.ZodString>;\n observedAtMs: z$1.ZodNumber;\n source: z$1.ZodEnum<{\n \"codex-account\": \"codex-account\";\n \"claude-rate-limit\": \"claude-rate-limit\";\n }>;\n }, z$1.core.$strip>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype ProviderRateLimitRecoveryStatus = z$1.infer<typeof providerRateLimitRecoveryStatusSchema>;\ndeclare const continueAfterProviderRateLimitResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\n requestId: z$1.ZodString;\n}, z$1.core.$strip>;\ntype ContinueAfterProviderRateLimitResponse = z$1.infer<typeof continueAfterProviderRateLimitResponseSchema>;\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 \"accept-edits\": \"accept-edits\";\n auto: \"auto\";\n full: \"full\";\n }>, z$1.ZodLiteral<\"workspace-write\">]>, z$1.ZodTransform<\"accept-edits\" | \"auto\" | \"full\", \"accept-edits\" | \"auto\" | \"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 \"accept-edits\": \"accept-edits\";\n auto: \"auto\";\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 personal: \"personal\";\n \"managed-worktree\": \"managed-worktree\";\n unmanaged: \"unmanaged\";\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 \"accept-edits\": \"accept-edits\";\n auto: \"auto\";\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 \"accept-edits\": \"accept-edits\";\n auto: \"auto\";\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 provider: \"provider\";\n refusal: \"refusal\";\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 ThreadRateLimitRecoveryResult = ProviderRateLimitRecoveryStatus;\ntype ThreadContinueAfterRateLimitResult = ContinueAfterProviderRateLimitResponse;\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 ThreadContinueAfterRateLimitArgs extends ThreadActionArgs {\n failedRequestId: 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 continueAfterRateLimit(args: ThreadContinueAfterRateLimitArgs): Promise<ThreadContinueAfterRateLimitResult>;\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 rateLimitRecovery(args: ThreadStatusArgs): Promise<ThreadRateLimitRecoveryResult>;\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/plugins/provider-retry/app.test.tsx b/plugins/provider-retry/app.test.tsx index 47b12938cb..e68dc5678d 100644 --- a/plugins/provider-retry/app.test.tsx +++ b/plugins/provider-retry/app.test.tsx @@ -10,9 +10,9 @@ const banner = app.composerCustomizations[0]!.banners![0]!; const waitingView: ProviderRetryView = { threadId: "thread-one", failedRequestId: "request-one", - scopeKey: "host-one:claudeCode", + scopeKey: "host-one:claude-code", hostId: "host-one", - providerId: "claudeCode", + providerId: "claude-code", phase: "waiting-for-reset", automatic: true, dueAtMs: Date.parse("2026-08-05T15:12:00.000Z"), @@ -22,9 +22,7 @@ const waitingView: ProviderRetryView = { reachedReason: "rate_limit_reached", overageReason: null, recoveryReason: "eligible", - refreshAvailable: true, refreshError: null, - processLifetime: true, }; afterEach(() => { diff --git a/plugins/provider-retry/app.tsx b/plugins/provider-retry/app.tsx index fa4ed723fe..d09f01855e 100644 --- a/plugins/provider-retry/app.tsx +++ b/plugins/provider-retry/app.tsx @@ -17,7 +17,7 @@ function providerLabel(providerId: string): string { switch (providerId) { case "codex": return "Codex"; - case "claudeCode": + case "claude-code": return "Claude Code"; default: return providerId; @@ -138,7 +138,7 @@ function ProviderRetryBannerForThread({ threadId }: { threadId: string }) { if (view === null) return null; const canRefresh = - view.providerId === "codex" || view.providerId === "claudeCode"; + view.providerId === "codex" || view.providerId === "claude-code"; const canRetry = view.failedRequestId !== null && view.phase !== "releasing"; return ( diff --git a/plugins/provider-retry/server.test.ts b/plugins/provider-retry/server.test.ts index 15d38d6abf..4bb3952dbf 100644 --- a/plugins/provider-retry/server.test.ts +++ b/plugins/provider-retry/server.test.ts @@ -9,9 +9,12 @@ import { RELEASE_PACE_MS, RESET_BUFFER_MS } from "./src/service.js"; const NOW_MS = Date.parse("2026-08-05T12:00:00.000Z"); const RESET_AT_MS = NOW_MS + 5 * 60 * 60 * 1_000; -function rateLimits(status: "allowed" | "blocked" = "blocked") { +function rateLimits( + status: "allowed" | "blocked" = "blocked", + providerId: "claude-code" | "codex" = "codex", +) { return { - providerId: "codex", + providerId, status, kind: "subscription-window", windows: [ @@ -32,18 +35,19 @@ function rateLimits(status: "allowed" | "blocked" = "blocked") { } as const; } -function eligibleStatus(threadId: string) { - const limits = rateLimits(); +function eligibleStatus( + threadId: string, + providerId: "claude-code" | "codex" = "codex", +) { + const limits = rateLimits("blocked", providerId); return { reason: "eligible", - scopeKey: "host-one:codex", + scopeKey: `host-one:${providerId}`, hostId: "host-one", rateLimits: limits, candidate: { failedRequestId: `request-${threadId}`, turnId: `turn-${threadId}`, - scopeKey: "host-one:codex", - hostId: "host-one", automatic: true, resetsAtMs: RESET_AT_MS, rateLimits: limits, @@ -65,8 +69,6 @@ function manualStatus(threadId: string) { candidate: { failedRequestId: `request-${threadId}`, turnId: `turn-${threadId}`, - scopeKey: "host-one:codex", - hostId: "host-one", automatic: false, resetsAtMs: null, rateLimits: limits, @@ -221,6 +223,60 @@ describe("provider retry scheduler", () => { await host.harness.dispose(); }); + it("refreshes Claude usage using the canonical provider id", async () => { + const continueAfterRateLimit = vi.fn(async () => ({ + ok: true as const, + requestId: "continuation-request", + })); + const host = createFakePluginHost({ + pluginId: "provider-retry", + sdk: { + system: { + usageLimits: async () => ({ + codex: { status: "unauthenticated" as const }, + claudeCode: { + status: "ok" as const, + accountEmail: null, + planLabel: "Max", + windows: [ + { + label: "Five-hour", + usedPercent: 20, + resetsAt: new Date(RESET_AT_MS).toISOString(), + }, + ], + }, + cursor: { status: "unauthenticated" as const }, + }), + }, + threads: { + rateLimitRecovery: async ({ threadId }) => + eligibleStatus(threadId, "claude-code"), + continueAfterRateLimit, + }, + }, + }); + await plugin(host.bb); + await host.harness.emitThreadEvent("thread.failed", { + thread: makeThreadResponse({ id: "thread-claude", status: "error" }), + error: "Usage limit reached", + }); + + await expect( + host.harness.callRpc("providerRetryStatus", { + threadId: "thread-claude", + }), + ).resolves.toMatchObject({ + view: { providerId: "claude-code" }, + }); + await host.harness.callRpc("providerRetryRefresh", { + threadId: "thread-claude", + }); + await vi.advanceTimersByTimeAsync(0); + expect(continueAfterRateLimit).toHaveBeenCalledOnce(); + await host.harness.dispose(); + }); + it("retains a job while the host is unavailable and retries on host change", async () => { const continueAfterRateLimit = vi .fn() diff --git a/plugins/provider-retry/src/contract.ts b/plugins/provider-retry/src/contract.ts index d3e86ce39f..375a9e923d 100644 --- a/plugins/provider-retry/src/contract.ts +++ b/plugins/provider-retry/src/contract.ts @@ -26,9 +26,7 @@ export const providerRetryViewSchema = z reachedReason: z.string().min(1).nullable(), overageReason: z.string().min(1).nullable(), recoveryReason: z.string().min(1), - refreshAvailable: z.boolean(), refreshError: z.string().min(1).nullable(), - processLifetime: z.literal(true), }) .strict(); export type ProviderRetryView = z.infer<typeof providerRetryViewSchema>; diff --git a/plugins/provider-retry/src/service.ts b/plugins/provider-retry/src/service.ts index f85ef922dc..ff55e56ae8 100644 --- a/plugins/provider-retry/src/service.ts +++ b/plugins/provider-retry/src/service.ts @@ -38,7 +38,7 @@ function errorMessage(error: unknown): string { } function refreshSupported(providerId: string): boolean { - return providerId === "codex" || providerId === "claudeCode"; + return providerId === "codex" || providerId === "claude-code"; } function usageForProvider( @@ -48,7 +48,7 @@ function usageForProvider( switch (providerId) { case "codex": return usage.codex; - case "claudeCode": + case "claude-code": return usage.claudeCode; default: return null; @@ -85,9 +85,7 @@ function recoveryView(args: { reachedReason: rateLimits?.reachedReason ?? null, overageReason: rateLimits?.overageReason ?? null, recoveryReason: args.status.reason, - refreshAvailable: refreshSupported(rateLimits?.providerId ?? "unknown"), refreshError: null, - processLifetime: true, }; } @@ -272,7 +270,6 @@ export class ProviderRetryService { if (!refreshSupported(entry.view.providerId)) { entry.view = { ...entry.view, - refreshAvailable: false, refreshError: "Usage refresh is unavailable for this provider.", }; this.publish(threadId); @@ -322,7 +319,6 @@ export class ProviderRetryService { if (!entry) continue; entry.view = { ...entry.view, - refreshAvailable: error === null, refreshError: error, }; this.publish(threadId); From a5b9018fb6735c1538db07e48280f0b14bb35a96 Mon Sep 17 00:00:00 2001 From: Michael Yong <wrong92@gmail.com> Date: Wed, 5 Aug 2026 15:49:11 -0700 Subject: [PATCH 14/21] fix: hide running plugin status pill --- .../components/settings/PluginsSettingsSection.test.tsx | 2 +- .../src/components/settings/PluginsSettingsSection.tsx | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/app/src/components/settings/PluginsSettingsSection.test.tsx b/apps/app/src/components/settings/PluginsSettingsSection.test.tsx index 567516c782..eb14f10060 100644 --- a/apps/app/src/components/settings/PluginsSettingsSection.test.tsx +++ b/apps/app/src/components/settings/PluginsSettingsSection.test.tsx @@ -313,7 +313,7 @@ describe("PluginSettingsDetail settings gating", () => { </MemoryRouter>, ); expect(screen.getByText("v0.1.0")).toBeDefined(); - expect(screen.getByText("running")).toBeDefined(); + expect(screen.queryByText("running")).toBeNull(); expect(screen.getByText(description)).toBeDefined(); expect(screen.getByText("This plugin declares no settings.")).toBeDefined(); }); diff --git a/apps/app/src/components/settings/PluginsSettingsSection.tsx b/apps/app/src/components/settings/PluginsSettingsSection.tsx index 137e0538c1..e067053ed1 100644 --- a/apps/app/src/components/settings/PluginsSettingsSection.tsx +++ b/apps/app/src/components/settings/PluginsSettingsSection.tsx @@ -600,9 +600,11 @@ export function PluginSettingsDetail({ plugin }: { plugin: PluginListItem }) { <span className="text-xs text-muted-foreground"> v{plugin.version} </span> - <Pill variant={statusPillVariant(plugin.status)} size="sm"> - {plugin.status} - </Pill> + {plugin.status === "running" ? null : ( + <Pill variant={statusPillVariant(plugin.status)} size="sm"> + {plugin.status} + </Pill> + )} </div> {lifecycleControl} </div> From ff818cf896c1afc2246c84380d6f8ed340aed116 Mon Sep 17 00:00:00 2001 From: Michael Yong <wrong92@gmail.com> Date: Thu, 6 Aug 2026 10:15:08 -0700 Subject: [PATCH 15/21] fix(provider-retry): fail closed before recovery --- .../threads/provider-rate-limit-recovery.ts | 38 ++++- .../provider-rate-limit-recovery.test.ts | 152 +++++++++++++++--- packages/db/src/data/events.ts | 27 ++++ packages/db/src/data/index.ts | 2 + packages/server-contract/src/api/threads.ts | 1 + 5 files changed, 192 insertions(+), 28 deletions(-) diff --git a/apps/server/src/services/threads/provider-rate-limit-recovery.ts b/apps/server/src/services/threads/provider-rate-limit-recovery.ts index 6a3994ba88..ce599b03d9 100644 --- a/apps/server/src/services/threads/provider-rate-limit-recovery.ts +++ b/apps/server/src/services/threads/provider-rate-limit-recovery.ts @@ -2,6 +2,7 @@ import { getEnvironment, getLastStoredTurnRequestEvent, getLatestStoredEventRowByType, + getRootStoredTurnStartedSequence, getStoredTurnRequestEventForTurn, getThread, listStoredEventRowsInRange, @@ -50,6 +51,7 @@ import { ensureThreadIsNotAwaitingUserInteraction, ensureThreadIsWritable, } from "./thread-send.js"; +import { applyLoggedEnvironmentLifecycleEvent } from "../environments/lifecycle-outcome.js"; const CONTINUE_INPUT: PromptInput[] = [ { @@ -197,9 +199,17 @@ function inspectRecovery(args: InspectRecoveryArgs): RecoveryInspection { return emptyInspection(args, "superseded", observedRateLimits); } + const turnStartedSequence = getRootStoredTurnStartedSequence(args.db, { + threadId: args.thread.id, + turnId, + }); + if (turnStartedSequence === null) { + return emptyInspection(args, "no-failed-turn", observedRateLimits); + } + const rows = listStoredEventRowsInRange(args.db, { threadId: args.thread.id, - seqStart: requestRow.sequence, + seqStart: turnStartedSequence, seqEnd: completedRow.sequence, }); const events = rows.map(parseStoredEvent); @@ -234,11 +244,17 @@ function inspectRecovery(args: InspectRecoveryArgs): RecoveryInspection { event.type === "provider/error" && event.errorInfo?.category === "rate-limit", ); - if ( - rateLimitErrors.some((event) => event.willRetry === true) && - !rateLimitErrors.some((event) => event.willRetry !== true) - ) { - return emptyInspection(args, "provider-will-retry", turnRateLimits); + const hasTerminalRateLimitError = rateLimitErrors.some( + (event) => event.willRetry !== true, + ); + if (!hasTerminalRateLimitError) { + return emptyInspection( + args, + rateLimitErrors.length > 0 + ? "provider-will-retry" + : "no-terminal-rate-limit-error", + turnRateLimits, + ); } if (hasOutputOrSideEffect(events, turnId)) { return emptyInspection( @@ -315,8 +331,16 @@ export async function continueThreadAfterProviderRateLimit( ): Promise<ContinueAfterProviderRateLimitResponse> { ensureThreadIsWritable(args.thread); ensureThreadIsNotAwaitingUserInteraction(deps, args.thread.id); + const currentEnvironment = + getEnvironment(deps.db, args.environment.id) ?? args.environment; + if (currentEnvironment.status === "retiring") { + applyLoggedEnvironmentLifecycleEvent(deps, { + environmentId: currentEnvironment.id, + event: { type: "retire.cancelled" }, + }); + } const readyEnvironment = requireReadyThreadEnvironment( - getEnvironment(deps.db, args.environment.id) ?? args.environment, + getEnvironment(deps.db, args.environment.id) ?? currentEnvironment, ); const initial = inspectRecovery({ db: deps.db, diff --git a/apps/server/test/services/threads/provider-rate-limit-recovery.test.ts b/apps/server/test/services/threads/provider-rate-limit-recovery.test.ts index 4c45777465..2bd9bda71b 100644 --- a/apps/server/test/services/threads/provider-rate-limit-recovery.test.ts +++ b/apps/server/test/services/threads/provider-rate-limit-recovery.test.ts @@ -1,4 +1,4 @@ -import { getThread, listEvents } from "@bb/db"; +import { getEnvironment, getThread, listEvents } from "@bb/db"; import { encodeClientTurnRequestIdNumber, parseStoredThreadEvent, @@ -23,6 +23,7 @@ import { } from "../../helpers/test-app.js"; const FAILED_REQUEST_ID = encodeClientTurnRequestIdNumber({ value: 41 }); +const STEER_REQUEST_ID = encodeClientTurnRequestIdNumber({ value: 42 }); const RESET_AT_MS = Date.now() + 5 * 60 * 60 * 1_000; const RATE_LIMITS: ProviderRateLimitState = { providerId: "codex", @@ -48,8 +49,11 @@ const RATE_LIMITS: ProviderRateLimitState = { function seedFailedRateLimitedTurn( harness: TestAppHarness, options: { + environmentStatus?: "ready" | "retiring"; rateLimits?: ProviderRateLimitState; + steeredAfterOutput?: boolean; withOutput?: boolean; + withoutRateLimitError?: boolean; willRetry?: boolean; } = {}, ) { @@ -60,6 +64,7 @@ function seedFailedRateLimitedTurn( const environment = seedEnvironment(harness.deps, { hostId: host.id, projectId: project.id, + status: options.environmentStatus, }); const thread = seedThread(harness.deps, { environmentId: environment.id, @@ -121,36 +126,90 @@ function seedFailedRateLimitedTurn( scope: turnScope(turnId), data: { providerThreadId, clientRequestId: FAILED_REQUEST_ID }, }); + let nextSequence = 5; + if (options.steeredAfterOutput) { + seedEvent(harness.deps, { + threadId: thread.id, + environmentId: environment.id, + providerThreadId, + sequence: nextSequence, + type: "turn/plan/updated", + scope: turnScope(turnId), + data: { + providerThreadId, + plan: [{ step: "Started work", status: "active" }], + }, + }); + nextSequence += 1; + seedEvent(harness.deps, { + threadId: thread.id, + environmentId: environment.id, + sequence: nextSequence, + type: "client/turn/requested", + scope: threadScope(), + data: { + direction: "outbound", + requestId: STEER_REQUEST_ID, + source: "tell", + initiator: "user", + senderThreadId: null, + input: [{ type: "text", text: "Also run tests", mentions: [] }], + target: { kind: "steer", expectedTurnId: turnId }, + request: { method: "turn/start", params: {} }, + execution: { + model: "gpt-5", + serviceTier: "default", + reasoningLevel: "medium", + permissionMode: "full", + source: "client/turn/requested", + }, + }, + }); + nextSequence += 1; + seedEvent(harness.deps, { + threadId: thread.id, + environmentId: environment.id, + providerThreadId, + sequence: nextSequence, + type: "turn/input/accepted", + scope: turnScope(turnId), + data: { providerThreadId, clientRequestId: STEER_REQUEST_ID }, + }); + nextSequence += 1; + } seedEvent(harness.deps, { threadId: thread.id, environmentId: environment.id, providerThreadId, - sequence: 5, + sequence: nextSequence, type: "provider/rateLimits/updated", scope: threadScope(), data: { providerThreadId, rateLimits }, }); - seedEvent(harness.deps, { - threadId: thread.id, - environmentId: environment.id, - providerThreadId, - sequence: 6, - type: "provider/error", - scope: turnScope(turnId), - data: { + nextSequence += 1; + if (!options.withoutRateLimitError) { + seedEvent(harness.deps, { + threadId: thread.id, + environmentId: environment.id, providerThreadId, - message: "Usage limit reached", - ...(options.willRetry === undefined - ? {} - : { willRetry: options.willRetry }), - errorInfo: { - category: "rate-limit", - providerCode: "usage_limit_reached", - httpStatusCode: 429, + sequence: nextSequence, + type: "provider/error", + scope: turnScope(turnId), + data: { + providerThreadId, + message: "Usage limit reached", + ...(options.willRetry === undefined + ? {} + : { willRetry: options.willRetry }), + errorInfo: { + category: "rate-limit", + providerCode: "usage_limit_reached", + httpStatusCode: 429, + }, }, - }, - }); - let nextSequence = 7; + }); + nextSequence += 1; + } if (options.withOutput) { seedEvent(harness.deps, { threadId: thread.id, @@ -229,6 +288,36 @@ describe("provider rate-limit recovery", () => { }); }); + it("fails closed when a steer follows earlier output in the same turn", async () => { + await withTestHarness(async (harness) => { + const fixture = seedFailedRateLimitedTurn(harness, { + steeredAfterOutput: true, + }); + + expect( + getProviderRateLimitRecoveryStatus(harness.deps, { + environment: fixture.environment, + thread: fixture.thread, + }).reason, + ).toBe("output-or-side-effect-observed"); + }); + }); + + it("requires a terminal rate-limit error from the failed turn", async () => { + await withTestHarness(async (harness) => { + const fixture = seedFailedRateLimitedTurn(harness, { + withoutRateLimitError: true, + }); + + expect( + getProviderRateLimitRecoveryStatus(harness.deps, { + environment: fixture.environment, + thread: fixture.thread, + }).reason, + ).toBe("no-terminal-rate-limit-error"); + }); + }); + it("allows manual recovery for blocked limits without a reset time", async () => { await withTestHarness(async (harness) => { const creditsRateLimits: ProviderRateLimitState = { @@ -387,4 +476,25 @@ describe("provider rate-limit recovery", () => { ).toHaveLength(1); }); }); + + it("revives a retiring environment before continuing", async () => { + await withTestHarness(async (harness) => { + const fixture = seedFailedRateLimitedTurn(harness, { + environmentStatus: "retiring", + }); + const response = await harness.app.request( + `/api/v1/threads/${fixture.thread.id}/rate-limit-recovery/continue`, + { + method: "POST", + headers: { "content-type": "application/json" }, + body: JSON.stringify({ failedRequestId: FAILED_REQUEST_ID }), + }, + ); + + expect(response.status).toBe(200); + expect(getEnvironment(harness.db, fixture.environment.id)?.status).toBe( + "ready", + ); + }); + }); }); diff --git a/packages/db/src/data/events.ts b/packages/db/src/data/events.ts index 955576c1fe..f107edcb32 100644 --- a/packages/db/src/data/events.ts +++ b/packages/db/src/data/events.ts @@ -808,6 +808,11 @@ export interface GetStoredTurnRequestEventForTurnArgs { turnId: string; } +export interface GetRootStoredTurnStartedSequenceArgs { + threadId: string; + turnId: string; +} + export interface ListStoredThreadProvisioningRowsByProvisioningIdArgs { provisioningId: string; threadId: string; @@ -1915,6 +1920,28 @@ export function hasRootStoredTurnStarted( return row !== undefined; } +export function getRootStoredTurnStartedSequence( + db: DbQueryConnection, + args: GetRootStoredTurnStartedSequenceArgs, +): number | null { + const row = db + .select({ sequence: events.sequence }) + .from(events) + .where( + and( + eq(events.threadId, args.threadId), + eq(events.type, "turn/started"), + eq(events.turnId, args.turnId), + isRootTurnStartedEventData, + ), + ) + .orderBy(events.sequence) + .limit(1) + .get(); + + return row?.sequence ?? null; +} + export function listRecentStoredEventRows( db: DbConnection, args: ListRecentStoredEventRowsArgs, diff --git a/packages/db/src/data/index.ts b/packages/db/src/data/index.ts index 310a92bbca..e794a597dd 100644 --- a/packages/db/src/data/index.ts +++ b/packages/db/src/data/index.ts @@ -300,6 +300,7 @@ export { hasRootStoredTurnStarted, hasStoredTurnStarted, getLastStoredProviderThreadId, + getRootStoredTurnStartedSequence, getStoredProviderThreadIdAtOrBeforeSequence, getLastStoredTurnRequestEvent, getStoredTurnRequestEventForTurn, @@ -361,6 +362,7 @@ export type { CompletedStoredTurnRow, FindStoredClientTurnRequestSequenceByRequestIdArgs, GetStoredTurnRequestEventForTurnArgs, + GetRootStoredTurnStartedSequenceArgs, GetLatestThreadInterruptedReasonArgs, GetLatestThreadSequenceArgs, HasStoredTurnStartedArgs, diff --git a/packages/server-contract/src/api/threads.ts b/packages/server-contract/src/api/threads.ts index 142fa80c93..5749df5378 100644 --- a/packages/server-contract/src/api/threads.ts +++ b/packages/server-contract/src/api/threads.ts @@ -224,6 +224,7 @@ export const providerRateLimitRecoveryReasonSchema = z.enum([ "no-failed-turn", "input-not-accepted", "no-rate-limit-state", + "no-terminal-rate-limit-error", "provider-will-retry", "manual-only", "output-or-side-effect-observed", From 22efde0849c7aae1eee4c7c633996764855372b1 Mon Sep 17 00:00:00 2001 From: Michael Yong <wrong92@gmail.com> Date: Thu, 6 Aug 2026 10:19:46 -0700 Subject: [PATCH 16/21] fix(agent-runtime): preserve sparse rate limit state --- .../command-output/thread-actions.test.ts | 2 - .../provider-rate-limit-recovery.test.ts | 6 - .../src/claude-code/adapter.test.ts | 1 - .../src/claude-code/translate-message.ts | 4 - .../agent-runtime/src/codex/adapter.test.ts | 131 +++++++++++++++++- packages/agent-runtime/src/codex/adapter.ts | 13 +- .../src/codex/event-translation.ts | 106 +++++++++++--- packages/agent-runtime/src/runtime.ts | 9 +- packages/domain/src/provider-event.ts | 5 - packages/domain/test/provider-event.test.ts | 4 - plugins/provider-retry/server.test.ts | 4 - 11 files changed, 225 insertions(+), 60 deletions(-) diff --git a/apps/cli/src/__tests__/command-output/thread-actions.test.ts b/apps/cli/src/__tests__/command-output/thread-actions.test.ts index b678c28795..18c63b42d6 100644 --- a/apps/cli/src/__tests__/command-output/thread-actions.test.ts +++ b/apps/cli/src/__tests__/command-output/thread-actions.test.ts @@ -304,8 +304,6 @@ describe("bb thread action command output", () => { reachedReason: null, overageStatus: null, overageReason: null, - observedAtMs: 1, - source: "codex-account", }, }, })); diff --git a/apps/server/test/services/threads/provider-rate-limit-recovery.test.ts b/apps/server/test/services/threads/provider-rate-limit-recovery.test.ts index 2bd9bda71b..2613dcb22e 100644 --- a/apps/server/test/services/threads/provider-rate-limit-recovery.test.ts +++ b/apps/server/test/services/threads/provider-rate-limit-recovery.test.ts @@ -34,16 +34,12 @@ const RATE_LIMITS: ProviderRateLimitState = { providerKey: "primary", label: "Current session", status: "blocked", - usedPercent: 100, resetsAtMs: RESET_AT_MS, - modelIds: [], }, ], reachedReason: "rate_limit_reached", overageStatus: null, overageReason: null, - observedAtMs: Date.now(), - source: "codex-account", }; function seedFailedRateLimitedTurn( @@ -354,9 +350,7 @@ describe("provider rate-limit recovery", () => { windows: RATE_LIMITS.windows.map((window) => ({ ...window, status: "allowed", - usedPercent: 0, })), - observedAtMs: Date.now() + 1, }; seedEvent(harness.deps, { threadId: fixture.thread.id, diff --git a/packages/agent-runtime/src/claude-code/adapter.test.ts b/packages/agent-runtime/src/claude-code/adapter.test.ts index c0062e84d8..b4c97f0e74 100644 --- a/packages/agent-runtime/src/claude-code/adapter.test.ts +++ b/packages/agent-runtime/src/claude-code/adapter.test.ts @@ -2527,7 +2527,6 @@ describe("claude-code provider adapter", () => { expect.objectContaining({ providerKey: "seven_day_fable", label: null, - modelIds: [], }), ], }), diff --git a/packages/agent-runtime/src/claude-code/translate-message.ts b/packages/agent-runtime/src/claude-code/translate-message.ts index da730255e9..f5f19aa321 100644 --- a/packages/agent-runtime/src/claude-code/translate-message.ts +++ b/packages/agent-runtime/src/claude-code/translate-message.ts @@ -414,9 +414,7 @@ function normalizeClaudeRateLimits( providerKey, label: claudeRateLimitLabel(info.rateLimitType), status: windowStatus, - usedPercent: null, resetsAtMs: info.resetsAt === undefined ? null : info.resetsAt * 1_000, - modelIds: [], }, ], reachedReason: @@ -425,8 +423,6 @@ function normalizeClaudeRateLimits( : null, overageStatus, overageReason: info.overageDisabledReason ?? null, - observedAtMs: Date.now(), - source: "claude-rate-limit", }; } diff --git a/packages/agent-runtime/src/codex/adapter.test.ts b/packages/agent-runtime/src/codex/adapter.test.ts index d1db20be24..b1cf530825 100644 --- a/packages/agent-runtime/src/codex/adapter.test.ts +++ b/packages/agent-runtime/src/codex/adapter.test.ts @@ -5064,15 +5064,12 @@ describe("codex provider adapter", () => { status: "blocked", kind: "subscription-window", reachedReason: "rate_limit_reached", - source: "codex-account", windows: [ { providerKey: "primary", label: "Current session", status: "blocked", - usedPercent: 100, resetsAtMs: 1_781_120_400_000, - modelIds: [], }, ], }), @@ -5080,6 +5077,134 @@ describe("codex provider adapter", () => { ]); }); + it("uses Codex's reached reason before credit and spend metadata", () => { + const adapter = createCodexProviderAdapter(); + const [event] = adapter.translateEvent( + codexEvent("account/rateLimits/updated", { + rateLimits: { + limitId: "codex", + limitName: "Codex", + primary: { + usedPercent: 100, + windowDurationMins: 300, + resetsAt: 1_781_120_400, + }, + secondary: null, + credits: { + hasCredits: false, + unlimited: false, + balance: "0", + }, + individualLimit: { + limit: "100", + used: "100", + remainingPercent: 0, + resetsAt: 1_781_120_400, + }, + planType: "pro", + rateLimitReachedType: "rate_limit_reached", + }, + }), + ); + + expect(event).toMatchObject({ + type: "provider/rateLimits/updated", + rateLimits: { + status: "blocked", + kind: "subscription-window", + reachedReason: "rate_limit_reached", + }, + }); + }); + + it("merges sparse Codex rolling rate-limit updates", () => { + const adapter = createCodexProviderAdapter(); + adapter.translateEvent( + codexEvent("account/rateLimits/updated", { + rateLimits: { + limitId: "codex", + limitName: "Codex", + primary: { + usedPercent: 20, + windowDurationMins: 300, + resetsAt: 1_781_120_400, + }, + secondary: { + usedPercent: 100, + windowDurationMins: 10_080, + resetsAt: 1_781_720_400, + }, + credits: null, + individualLimit: null, + planType: "pro", + rateLimitReachedType: "rate_limit_reached", + }, + }), + ); + + const [sparseEvent] = adapter.translateEvent( + codexEvent("account/rateLimits/updated", { + rateLimits: { + limitId: null, + limitName: null, + primary: { + usedPercent: 25, + windowDurationMins: 300, + resetsAt: 1_781_120_400, + }, + secondary: null, + credits: null, + individualLimit: null, + planType: null, + rateLimitReachedType: null, + }, + }), + ); + expect(sparseEvent).toMatchObject({ + type: "provider/rateLimits/updated", + rateLimits: { + status: "blocked", + kind: "subscription-window", + reachedReason: "rate_limit_reached", + windows: [ + { providerKey: "primary", status: "allowed" }, + { + providerKey: "secondary", + status: "blocked", + resetsAtMs: 1_781_720_400_000, + }, + ], + }, + }); + + const [resetEvent] = adapter.translateEvent( + codexEvent("account/rateLimits/updated", { + rateLimits: { + limitId: null, + limitName: null, + primary: null, + secondary: { + usedPercent: 30, + windowDurationMins: 10_080, + resetsAt: 1_781_720_400, + }, + credits: null, + individualLimit: null, + planType: null, + rateLimitReachedType: null, + }, + }), + ); + expect(resetEvent).toMatchObject({ + type: "provider/rateLimits/updated", + rateLimits: { + status: "allowed", + kind: "subscription-window", + reachedReason: null, + }, + }); + }); + it("translateEvent ignores remote control status changes", () => { const adapter = createCodexProviderAdapter(); const events = adapter.translateEvent({ diff --git a/packages/agent-runtime/src/codex/adapter.ts b/packages/agent-runtime/src/codex/adapter.ts index ea4d9a0999..c37dc6b5f3 100644 --- a/packages/agent-runtime/src/codex/adapter.ts +++ b/packages/agent-runtime/src/codex/adapter.ts @@ -62,7 +62,10 @@ import type { ProviderRuntimeEvent, } from "../runtime-json-rpc.js"; import type { AgentRuntimeSkillRoot } from "../types.js"; -import { translateCodexEvent } from "./event-translation.js"; +import { + createCodexEventTranslationState, + translateCodexEvent, +} from "./event-translation.js"; import { buildCodexInteractiveResponse, decodeCodexInteractiveRequest, @@ -1093,6 +1096,7 @@ export function createCodexProviderAdapter( opts?.additionalWorkspaceWriteRoots ?? []; const providerInfo = getBuiltInAgentProviderInfo("codex"); const capabilities = providerInfo.capabilities; + const eventTranslationState = createCodexEventTranslationState(); const nativeTurnStartClientRequestIdsByProviderThreadId = new Map< string, ClientTurnRequestId[] @@ -2086,9 +2090,10 @@ export function createCodexProviderAdapter( return applyRecoveredCommandOutput(subAgentActivityEvents); } - const translatedEvents = translateCodexEvent(event).flatMap( - attachAcceptedUserMessageCorrelation, - ); + const translatedEvents = translateCodexEvent( + event, + eventTranslationState, + ).flatMap(attachAcceptedUserMessageCorrelation); const parentLinkedEvents = attachCodexDelegationParentLinks(translatedEvents); const completedSubAgentEvents = diff --git a/packages/agent-runtime/src/codex/event-translation.ts b/packages/agent-runtime/src/codex/event-translation.ts index b588862363..773f284dfb 100644 --- a/packages/agent-runtime/src/codex/event-translation.ts +++ b/packages/agent-runtime/src/codex/event-translation.ts @@ -46,6 +46,14 @@ interface CodexLastTokenUsage { totalTokens: number; } +export interface CodexEventTranslationState { + rateLimits: CodexRateLimitSnapshot | null; +} + +export function createCodexEventTranslationState(): CodexEventTranslationState { + return { rateLimits: null }; +} + function clampRateLimitPercent(value: number): number { return Math.min(100, Math.max(0, value)); } @@ -66,12 +74,63 @@ function normalizeCodexRateLimitWindow( providerKey: key, label: key === "primary" ? "Current session" : "Weekly limit", status: codexWindowStatus(usedPercent), - usedPercent, resetsAtMs: window.resetsAt === null ? null : window.resetsAt * 1_000, - modelIds: [], }; } +function codexReachedReasonIsActive( + snapshot: CodexRateLimitSnapshot, + reachedReason: string, +): boolean { + if (reachedReason === "rate_limit_reached") { + return [snapshot.primary, snapshot.secondary].some( + (window) => window !== null && window.usedPercent >= 100, + ); + } + if (reachedReason.includes("credits_depleted")) { + return ( + snapshot.credits !== null && + !snapshot.credits.unlimited && + !snapshot.credits.hasCredits + ); + } + if (reachedReason.includes("usage_limit_reached")) { + return ( + snapshot.individualLimit !== null && + snapshot.individualLimit.remainingPercent <= 0 + ); + } + return false; +} + +function mergeCodexRateLimitSnapshot( + previous: CodexRateLimitSnapshot | null, + update: CodexRateLimitSnapshot, +): CodexRateLimitSnapshot { + if (previous === null) { + return update; + } + + const merged: CodexRateLimitSnapshot = { + limitId: update.limitId ?? previous.limitId, + limitName: update.limitName ?? previous.limitName, + primary: update.primary ?? previous.primary, + secondary: update.secondary ?? previous.secondary, + credits: update.credits ?? previous.credits, + individualLimit: update.individualLimit ?? previous.individualLimit, + planType: update.planType ?? previous.planType, + rateLimitReachedType: update.rateLimitReachedType, + }; + if ( + merged.rateLimitReachedType === null && + previous.rateLimitReachedType !== null && + codexReachedReasonIsActive(merged, previous.rateLimitReachedType) + ) { + merged.rateLimitReachedType = previous.rateLimitReachedType; + } + return merged; +} + function normalizeCodexRateLimits( snapshot: CodexRateLimitSnapshot, ): ProviderRateLimitState { @@ -88,25 +147,29 @@ function normalizeCodexRateLimits( providerKey: "individual-limit", label: "Spend control", status: codexWindowStatus(usedPercent), - usedPercent, resetsAtMs: snapshot.individualLimit.resetsAt * 1_000, - modelIds: [], }); } const reachedReason = snapshot.rateLimitReachedType; const kind = - reachedReason?.includes("credits_depleted") || - (snapshot.credits !== null && - !snapshot.credits.unlimited && - !snapshot.credits.hasCredits) - ? "credits" - : reachedReason?.includes("usage_limit_reached") || - snapshot.individualLimit !== null - ? "spend-control" - : snapshot.primary !== null || snapshot.secondary !== null - ? "subscription-window" - : "unknown"; + reachedReason === "rate_limit_reached" + ? "subscription-window" + : reachedReason?.includes("credits_depleted") + ? "credits" + : reachedReason?.includes("usage_limit_reached") + ? "spend-control" + : reachedReason !== null + ? "unknown" + : snapshot.credits !== null && + !snapshot.credits.unlimited && + !snapshot.credits.hasCredits + ? "credits" + : snapshot.individualLimit !== null + ? "spend-control" + : snapshot.primary !== null || snapshot.secondary !== null + ? "subscription-window" + : "unknown"; const status = reachedReason !== null ? "blocked" @@ -126,8 +189,6 @@ function normalizeCodexRateLimits( reachedReason, overageStatus: null, overageReason: null, - observedAtMs: Date.now(), - source: "codex-account", }; } @@ -666,6 +727,7 @@ function translateCodexItem( export function translateCodexEvent( event: ProviderRuntimeEvent, + state: CodexEventTranslationState, ): ThreadEvent[] { const envelope = codexBridgeEnvelopeSchema.safeParse(event); if (!envelope.success) { @@ -687,16 +749,22 @@ export function translateCodexEvent( const handledEvent: CodexHandledEvent = parsed.data; switch (handledEvent.method) { - case "account/rateLimits/updated": + case "account/rateLimits/updated": { + const rateLimits = mergeCodexRateLimitSnapshot( + state.rateLimits, + handledEvent.params.rateLimits, + ); + state.rateLimits = rateLimits; return [ { type: "provider/rateLimits/updated", threadId: UNSTAMPED_THREAD_ID, providerThreadId: "", scope: threadScope(), - rateLimits: normalizeCodexRateLimits(handledEvent.params.rateLimits), + rateLimits: normalizeCodexRateLimits(rateLimits), }, ]; + } case "turn/started": return [ { diff --git a/packages/agent-runtime/src/runtime.ts b/packages/agent-runtime/src/runtime.ts index c6066ab0c7..0cdcb36837 100644 --- a/packages/agent-runtime/src/runtime.ts +++ b/packages/agent-runtime/src/runtime.ts @@ -866,14 +866,7 @@ function createAgentRuntimeInternal( sourceThreadId: args.sourceThreadId, }); - // Codex publishes account rate-limit snapshots without a thread id. - // Preserve the account-wide signal for every resident thread instead of - // dropping it when a multiplexed provider process owns several threads. - const targetThreadIds = resolvedBbThreadId - ? [resolvedBbThreadId] - : event.type === "provider/rateLimits/updated" - ? [...args.proc.identity.threadIds] - : []; + const targetThreadIds = resolvedBbThreadId ? [resolvedBbThreadId] : []; if (targetThreadIds.length === 0) { options.onStderr?.( diff --git a/packages/domain/src/provider-event.ts b/packages/domain/src/provider-event.ts index f3c6dff35b..c1652ab630 100644 --- a/packages/domain/src/provider-event.ts +++ b/packages/domain/src/provider-event.ts @@ -93,10 +93,7 @@ export const providerRateLimitWindowSchema = z.object({ providerKey: z.string().min(1).nullable(), label: z.string().min(1).nullable(), status: providerRateLimitStatusSchema, - usedPercent: z.number().min(0).max(100).nullable(), resetsAtMs: z.number().int().nonnegative().nullable(), - /** Provider model ids when supplied explicitly; never inferred from a key. */ - modelIds: z.array(z.string().min(1)), }); export type ProviderRateLimitWindow = z.infer< typeof providerRateLimitWindowSchema @@ -112,8 +109,6 @@ export const providerRateLimitStateSchema = z.object({ .enum(["allowed", "warning", "rejected", "unavailable"]) .nullable(), overageReason: z.string().min(1).nullable(), - observedAtMs: z.number().int().nonnegative(), - source: z.enum(["codex-account", "claude-rate-limit"]), }); export type ProviderRateLimitState = z.infer< typeof providerRateLimitStateSchema diff --git a/packages/domain/test/provider-event.test.ts b/packages/domain/test/provider-event.test.ts index 494e5e6192..ddab97a8e4 100644 --- a/packages/domain/test/provider-event.test.ts +++ b/packages/domain/test/provider-event.test.ts @@ -20,16 +20,12 @@ describe("provider event schema", () => { providerKey: "seven_day_fable", label: null, status: "blocked", - usedPercent: null, resetsAtMs: 1_781_120_400_000, - modelIds: [], }, ], reachedReason: "seven_day_fable", overageStatus: null, overageReason: null, - observedAtMs: 1_781_000_000_000, - source: "claude-rate-limit", }, }), ).toMatchObject({ diff --git a/plugins/provider-retry/server.test.ts b/plugins/provider-retry/server.test.ts index 4bb3952dbf..49c1f37e99 100644 --- a/plugins/provider-retry/server.test.ts +++ b/plugins/provider-retry/server.test.ts @@ -22,16 +22,12 @@ function rateLimits( providerKey: "primary", label: "Current session", status, - usedPercent: status === "blocked" ? 100 : 25, resetsAtMs: RESET_AT_MS, - modelIds: [], }, ], reachedReason: status === "blocked" ? "rate_limit_reached" : null, overageStatus: null, overageReason: null, - observedAtMs: NOW_MS, - source: "codex-account", } as const; } From a390aa5e84c68335272ccd4a93bb17862cffb87c Mon Sep 17 00:00:00 2001 From: Michael Yong <wrong92@gmail.com> Date: Thu, 6 Aug 2026 10:22:13 -0700 Subject: [PATCH 17/21] fix(provider-retry): harden scheduler state --- plugins/provider-retry/server.test.ts | 214 +++++++++++++++++++++++++- plugins/provider-retry/server.ts | 7 +- plugins/provider-retry/src/service.ts | 33 +++- 3 files changed, 240 insertions(+), 14 deletions(-) diff --git a/plugins/provider-retry/server.test.ts b/plugins/provider-retry/server.test.ts index 49c1f37e99..b309f23211 100644 --- a/plugins/provider-retry/server.test.ts +++ b/plugins/provider-retry/server.test.ts @@ -4,7 +4,11 @@ import { makeThreadResponse, } from "@bb/plugin-sdk/testing"; import plugin from "./server.js"; -import { RELEASE_PACE_MS, RESET_BUFFER_MS } from "./src/service.js"; +import { + ProviderRetryService, + RELEASE_PACE_MS, + RESET_BUFFER_MS, +} from "./src/service.js"; const NOW_MS = Date.parse("2026-08-05T12:00:00.000Z"); const RESET_AT_MS = NOW_MS + 5 * 60 * 60 * 1_000; @@ -89,6 +93,27 @@ afterEach(() => { }); describe("provider retry scheduler", () => { + it("does not create an unhandled rejection when reconciliation fails", async () => { + const host = createFakePluginHost({ + pluginId: "provider-retry", + sdk: { + threads: { + rateLimitRecovery: async () => { + throw new Error("status unavailable"); + }, + }, + }, + }); + const service = new ProviderRetryService(host.bb); + + await expect(service.reconcile("thread-error")).rejects.toThrow( + "status unavailable", + ); + await flushPromises(); + service.dispose(); + await host.harness.dispose(); + }); + it("waits for the reset buffer and paces threads sharing one account", async () => { const continueAfterRateLimit = vi.fn(async () => ({ ok: true as const, @@ -219,6 +244,178 @@ describe("provider retry scheduler", () => { await host.harness.dispose(); }); + it("does not promote a manual-only candidate during usage refresh", async () => { + const continueAfterRateLimit = vi.fn(); + const host = createFakePluginHost({ + pluginId: "provider-retry", + sdk: { + system: { + usageLimits: async () => ({ + codex: { + status: "ok" as const, + accountEmail: null, + planLabel: "Plus", + windows: [ + { + label: "Current session", + usedPercent: 20, + resetsAt: new Date(RESET_AT_MS).toISOString(), + }, + ], + }, + claudeCode: { status: "unauthenticated" as const }, + cursor: { status: "unauthenticated" as const }, + }), + }, + threads: { + rateLimitRecovery: async ({ threadId }) => manualStatus(threadId), + continueAfterRateLimit, + }, + }, + }); + await plugin(host.bb); + await host.harness.emitThreadEvent("thread.failed", { + thread: makeThreadResponse({ id: "thread-manual", status: "error" }), + error: "Credits exhausted", + }); + + expect( + await host.harness.callRpc("providerRetryRefresh", { + threadId: "thread-manual", + }), + ).toMatchObject({ + view: { phase: "blocked", automatic: false, dueAtMs: null }, + }); + await vi.advanceTimersByTimeAsync(0); + expect(continueAfterRateLimit).not.toHaveBeenCalled(); + await host.harness.dispose(); + }); + + it("reschedules from blocked usage windows instead of later allowed windows", async () => { + const blockedResetAtMs = NOW_MS + 60 * 60 * 1_000; + const allowedResetAtMs = NOW_MS + 7 * 24 * 60 * 60 * 1_000; + const host = createFakePluginHost({ + pluginId: "provider-retry", + sdk: { + system: { + usageLimits: async () => ({ + codex: { + status: "ok" as const, + accountEmail: null, + planLabel: "Plus", + windows: [ + { + label: "Current session", + usedPercent: 100, + resetsAt: new Date(blockedResetAtMs).toISOString(), + }, + { + label: "Weekly", + usedPercent: 20, + resetsAt: new Date(allowedResetAtMs).toISOString(), + }, + ], + }, + claudeCode: { status: "unauthenticated" as const }, + cursor: { status: "unauthenticated" as const }, + }), + }, + threads: { + rateLimitRecovery: async ({ threadId }) => eligibleStatus(threadId), + }, + }, + }); + await plugin(host.bb); + await host.harness.emitThreadEvent("thread.failed", { + thread: makeThreadResponse({ id: "thread-reset", status: "error" }), + error: "Usage limit reached", + }); + + expect( + await host.harness.callRpc("providerRetryRefresh", { + threadId: "thread-reset", + }), + ).toMatchObject({ + view: { + resetsAtMs: blockedResetAtMs, + dueAtMs: blockedResetAtMs + RESET_BUFFER_MS, + }, + }); + await host.harness.dispose(); + }); + + it("keeps release state sticky while continuation is in flight", async () => { + let finishContinuation: () => void = () => { + throw new Error("Continuation was not started"); + }; + const continueAfterRateLimit = vi.fn( + () => + new Promise<{ ok: true; requestId: string }>((resolve) => { + finishContinuation = () => + resolve({ ok: true, requestId: "continuation-request" }); + }), + ); + const host = createFakePluginHost({ + pluginId: "provider-retry", + sdk: { + system: { + usageLimits: async () => ({ + codex: { + status: "ok" as const, + accountEmail: null, + planLabel: "Plus", + windows: [ + { + label: "Current session", + usedPercent: 20, + resetsAt: new Date(RESET_AT_MS).toISOString(), + }, + ], + }, + claudeCode: { status: "unauthenticated" as const }, + cursor: { status: "unauthenticated" as const }, + }), + }, + threads: { + rateLimitRecovery: async ({ threadId }) => eligibleStatus(threadId), + continueAfterRateLimit, + }, + }, + }); + await plugin(host.bb); + await host.harness.emitThreadEvent("thread.failed", { + thread: makeThreadResponse({ id: "thread-release", status: "error" }), + error: "Usage limit reached", + }); + + const retry = host.harness.callRpc("providerRetryNow", { + threadId: "thread-release", + }); + await flushPromises(); + await host.harness.emitThreadEvent("thread.failed", { + thread: makeThreadResponse({ id: "thread-release", status: "error" }), + error: "Usage limit reached", + }); + await host.harness.callRpc("providerRetryRefresh", { + threadId: "thread-release", + }); + + await expect( + host.harness.callRpc("providerRetryCancel", { + threadId: "thread-release", + }), + ).resolves.toEqual({ cancelled: false }); + await expect( + host.harness.callRpc("providerRetryStatus", { + threadId: "thread-release", + }), + ).resolves.toMatchObject({ view: { phase: "releasing" } }); + + finishContinuation(); + await expect(retry).resolves.toEqual({ started: true, view: null }); + await host.harness.dispose(); + }); + it("refreshes Claude usage using the canonical provider id", async () => { const continueAfterRateLimit = vi.fn(async () => ({ ok: true as const, @@ -278,18 +475,22 @@ describe("provider retry scheduler", () => { .fn() .mockRejectedValueOnce(new Error("Host is not connected")) .mockResolvedValueOnce({ ok: true, requestId: "continuation-request" }); - const subscription = { hostChanged: null as (() => void) | null }; + const subscription = { + hostChanged: null as + | ((changes: Array<"host-connected" | "host-disconnected">) => void) + | null, + }; const host = createFakePluginHost({ pluginId: "provider-retry", sdk: { subscribe: ({ event, callback }) => { if (event === "host:changed") { - subscription.hostChanged = () => + subscription.hostChanged = (changes) => callback({ type: "changed", entity: "host", id: "host-one", - changes: ["host-connected"], + changes, }); } return () => undefined; @@ -314,7 +515,10 @@ describe("provider retry scheduler", () => { }), ).toMatchObject({ view: { phase: "waiting-for-host" } }); expect(subscription.hostChanged).not.toBeNull(); - subscription.hostChanged?.(); + subscription.hostChanged?.(["host-disconnected"]); + await vi.advanceTimersByTimeAsync(0); + expect(continueAfterRateLimit).toHaveBeenCalledTimes(1); + subscription.hostChanged?.(["host-connected"]); await vi.advanceTimersByTimeAsync(0); expect(continueAfterRateLimit).toHaveBeenCalledTimes(2); diff --git a/plugins/provider-retry/server.ts b/plugins/provider-retry/server.ts index e620d1c3fa..daa442807e 100644 --- a/plugins/provider-retry/server.ts +++ b/plugins/provider-retry/server.ts @@ -74,7 +74,12 @@ export default async function plugin(bb: BbPluginApi) { const unsubscribeHost = bb.sdk.subscribe({ event: "host:changed", callback: (event) => { - if (event.id !== undefined) service.hostChanged(event.id); + if ( + event.id !== undefined && + event.changes.includes("host-connected") + ) { + service.hostChanged(event.id); + } }, }); const unsubscribeConnection = bb.sdk.subscribe({ diff --git a/plugins/provider-retry/src/service.ts b/plugins/provider-retry/src/service.ts index ff55e56ae8..c562969222 100644 --- a/plugins/provider-retry/src/service.ts +++ b/plugins/provider-retry/src/service.ts @@ -117,7 +117,12 @@ function refreshFailureMessage(usage: ProviderUsage): string | null { function latestUsageResetAtMs(usage: ProviderUsage): number | null { if (usage.status !== "ok") return null; - const timestamps = usage.windows.flatMap((window) => { + const blockedWindows = usage.windows.filter( + (window) => window.usedPercent >= 100, + ); + const relevantWindows = + blockedWindows.length > 0 ? blockedWindows : usage.windows; + const timestamps = relevantWindows.flatMap((window) => { if (window.resetsAt === null) return []; const timestamp = Date.parse(window.resetsAt); return Number.isFinite(timestamp) ? [timestamp] : []; @@ -163,7 +168,10 @@ export class ProviderRetryService { const next = previous .catch(() => undefined) .then(() => this.reconcileDirect(threadId)); - const lock = next.then(() => undefined); + const lock = next.then( + () => undefined, + () => undefined, + ); this.reconcileLocks.set(threadId, lock); try { return await next; @@ -179,6 +187,10 @@ export class ProviderRetryService { ): Promise<ProviderRetryView | null> { if (this.disposed) return null; const status = await this.bb.sdk.threads.rateLimitRecovery({ threadId }); + const existing = this.entries.get(threadId); + if (existing?.view.phase === "releasing") { + return existing.view; + } const candidate = status.candidate; if (candidate === null) { if (unsafeRecovery(status)) { @@ -198,7 +210,6 @@ export class ProviderRetryService { return null; } - const existing = this.entries.get(threadId); let dueAtMs: number | null = null; let phase: ProviderRetryPhase = "blocked"; if (candidate.automatic && candidate.resetsAtMs !== null) { @@ -267,6 +278,7 @@ export class ProviderRetryService { if (!this.entries.has(threadId)) await this.reconcile(threadId); const entry = this.entries.get(threadId); if (!entry) return null; + if (entry.view.phase === "releasing") return entry.view; if (!refreshSupported(entry.view.providerId)) { entry.view = { ...entry.view, @@ -316,7 +328,7 @@ export class ProviderRetryService { if (!scope) return; for (const threadId of scope.threadIds) { const entry = this.entries.get(threadId); - if (!entry) continue; + if (!entry || entry.view.phase === "releasing") continue; entry.view = { ...entry.view, refreshError: error, @@ -331,10 +343,11 @@ export class ProviderRetryService { const now = this.sources.now(); for (const threadId of scope.threadIds) { const entry = this.entries.get(threadId); - if (!entry?.candidate) continue; + if (!entry?.candidate?.automatic || entry.view.phase === "releasing") { + continue; + } entry.view = { ...entry.view, - automatic: true, dueAtMs: now, phase: "waiting-for-reset", }; @@ -352,7 +365,9 @@ export class ProviderRetryService { Math.floor(this.sources.random() * RESET_JITTER_MS); for (const threadId of scope.threadIds) { const entry = this.entries.get(threadId); - if (!entry?.candidate?.automatic) continue; + if (!entry?.candidate?.automatic || entry.view.phase === "releasing") { + continue; + } entry.view = { ...entry.view, dueAtMs, resetsAtMs: resetAtMs }; this.publish(threadId); } @@ -438,7 +453,8 @@ export class ProviderRetryService { .filter( (entry): entry is WaitingEntry => entry !== undefined && - entry.candidate !== null && + entry.candidate?.automatic === true && + entry.view.phase !== "releasing" && entry.view.dueAtMs !== null && entry.view.dueAtMs <= this.sources.now(), ) @@ -460,6 +476,7 @@ export class ProviderRetryService { const entry = this.entries.get(threadId); if ( entry !== undefined && + entry.view.phase !== "releasing" && entry.view.dueAtMs !== null && entry.view.dueAtMs <= this.sources.now() ) { From e840b24d0fe1853c4bf92c0d857f8aa2b74d3f54 Mon Sep 17 00:00:00 2001 From: Michael Yong <wrong92@gmail.com> Date: Thu, 6 Aug 2026 10:25:00 -0700 Subject: [PATCH 18/21] fix(app): stabilize plugin settings lifecycle --- .../settings/PluginsSettingsSection.test.tsx | 97 ++++++++++++++++++- .../settings/PluginsSettingsSection.tsx | 19 +++- .../hooks/cache-owners/plugin-cache-owner.ts | 6 +- 3 files changed, 115 insertions(+), 7 deletions(-) diff --git a/apps/app/src/components/settings/PluginsSettingsSection.test.tsx b/apps/app/src/components/settings/PluginsSettingsSection.test.tsx index eb14f10060..c99760b60d 100644 --- a/apps/app/src/components/settings/PluginsSettingsSection.test.tsx +++ b/apps/app/src/components/settings/PluginsSettingsSection.test.tsx @@ -25,6 +25,7 @@ import { } from "@/lib/plugin-slots"; import { PluginSettingsDetail, + PluginSettingsDetailSection, PluginSettingsForm, PluginsSettingsSection, } from "./PluginsSettingsSection"; @@ -409,24 +410,114 @@ describe("PluginSettingsDetail settings gating", () => { expect(await screen.findByLabelText("Greeting")).toBeTruthy(); }); - it("shows the no-settings state for an enabled errored plugin", () => { + it("shows unavailable settings for an enabled errored plugin", () => { const fetchSpy = vi.fn(() => Promise.resolve(jsonOk(SETTINGS_VIEW))); vi.stubGlobal("fetch", fetchSpy); const { wrapper } = createQueryClientTestHarness(); render( <MemoryRouter> <PluginSettingsDetail - plugin={{ ...rowPlugin("error"), hasSettings: false }} + plugin={{ + ...rowPlugin("error"), + hasSettings: false, + app: { + hasApp: true, + bundle: { + jsUrl: "/api/v1/plugins/linear/app.js", + cssUrl: null, + hash: "stale-linear-app", + sdkMajor: 0, + sdkVersion: "0.4.1", + compatible: true, + }, + }, + }} /> </MemoryRouter>, { wrapper }, ); expect(screen.queryByLabelText("Greeting")).toBeNull(); - expect(screen.getByText("This plugin declares no settings.")).toBeDefined(); + expect( + screen.getByText("Settings are unavailable while the plugin is error."), + ).toBeDefined(); + expect(screen.queryByText("This plugin declares no settings.")).toBeNull(); expect(screen.queryByRole("button", { name: "Remove" })).toBeNull(); expect(fetchSpy).not.toHaveBeenCalled(); }); + it("keeps the optimistic toggle state until the plugin list refetches", async () => { + const requests: RecordedRequest[] = []; + let finishListRefetch: (response: Response) => void = () => { + throw new Error("Plugin list refetch did not start"); + }; + const listRefetch = new Promise<Response>((resolve) => { + finishListRefetch = resolve; + }); + vi.stubGlobal( + "fetch", + vi.fn(async (url: string, init?: RequestInit) => { + requests.push({ url, init }); + if (init?.method === "POST") { + return jsonOk({ + ok: true, + plugin: serverPlugin({ enabled: true, status: "running" }), + }); + } + return listRefetch; + }), + ); + const { wrapper, queryClient } = createQueryClientTestHarness(); + queryClient.setQueryData(pluginListQueryKey(true), { + plugins: [ + { + ...rowPlugin("disabled"), + enabled: false, + hasSettings: false, + }, + ], + }); + render( + <MemoryRouter> + <PluginSettingsDetailSection pluginId="linear" /> + </MemoryRouter>, + { wrapper }, + ); + + fireEvent.click(screen.getByRole("switch", { name: "Enable linear" })); + await vi.waitFor(() => { + expect(requests.some((request) => request.init?.method === "POST")).toBe( + true, + ); + expect( + requests.some((request) => request.init?.method !== "POST"), + ).toBe(true); + }); + + const pendingSwitch = screen.getByRole("switch", { + name: "Disable linear", + }); + expect(pendingSwitch.getAttribute("aria-checked")).toBe("true"); + expect((pendingSwitch as HTMLButtonElement).disabled).toBe(true); + + finishListRefetch( + jsonOk({ + plugins: [ + serverPlugin({ + enabled: true, + status: "running", + hasSettings: false, + }), + ], + }), + ); + await vi.waitFor(() => { + const settledSwitch = screen.getByRole("switch", { + name: "Disable linear", + }); + expect((settledSwitch as HTMLButtonElement).disabled).toBe(false); + }); + }); + it("removes a stale builtin plugin from its detail page", async () => { const requests: RecordedRequest[] = []; vi.stubGlobal( diff --git a/apps/app/src/components/settings/PluginsSettingsSection.tsx b/apps/app/src/components/settings/PluginsSettingsSection.tsx index e067053ed1..26c72c76b0 100644 --- a/apps/app/src/components/settings/PluginsSettingsSection.tsx +++ b/apps/app/src/components/settings/PluginsSettingsSection.tsx @@ -574,7 +574,9 @@ export function PluginSettingsDetail({ plugin }: { plugin: PluginListItem }) { const frontendDiagnostic = frontendDiagnostics.get(plugin.id); const frontendFailure = frontendDiagnostic?.lastFailure; const frontendSettingsPending = - plugin.app.bundle !== null && frontendDiagnostic === undefined; + plugin.status === "running" && + plugin.app.bundle !== null && + frontendDiagnostic === undefined; const provenanceLine = plugin.provenance === "catalog" ? "official catalog" @@ -640,10 +642,23 @@ export function PluginSettingsDetail({ plugin }: { plugin: PluginListItem }) { ) : null} <PluginUpdateBanner plugin={plugin} /> <PluginUpdatesSourceCard plugin={plugin} /> - {plugin.hasSettings ? ( + {!pluginSurfacesAvailable ? ( + <div className="rounded-lg border border-border bg-card px-4 py-3.5"> + <p className="text-xs text-muted-foreground"> + Settings are unavailable while the plugin is {plugin.status}. + </p> + </div> + ) : plugin.hasSettings ? ( <div className="rounded-lg border border-border bg-card px-4 py-3.5"> <PluginSettingsForm pluginId={plugin.id} /> </div> + ) : frontendFailure !== null && frontendFailure !== undefined ? ( + <div className="rounded-lg border border-border bg-card px-4 py-3.5"> + <p className="text-xs text-muted-foreground"> + Plugin settings are unavailable because its frontend did not + load. + </p> + </div> ) : !hasSettingsSections && !frontendSettingsPending ? ( <div className="rounded-lg border border-border bg-card px-4 py-3.5"> <p className="text-xs text-muted-foreground"> diff --git a/apps/app/src/hooks/cache-owners/plugin-cache-owner.ts b/apps/app/src/hooks/cache-owners/plugin-cache-owner.ts index 862ab477d4..03a4ab1257 100644 --- a/apps/app/src/hooks/cache-owners/plugin-cache-owner.ts +++ b/apps/app/src/hooks/cache-owners/plugin-cache-owner.ts @@ -61,8 +61,10 @@ export function applyInstalledPlugin(args: { * realtime `plugins-changed` broadcast covers other windows; this gives the * acting window an immediate refresh. */ -export function invalidatePluginList(args: { queryClient: QueryClient }): void { - void args.queryClient.invalidateQueries({ +export function invalidatePluginList(args: { + queryClient: QueryClient; +}): Promise<void> { + return args.queryClient.invalidateQueries({ queryKey: allPluginListQueryKeyPrefix(), }); } From 49b6aff3e102e788817620a0ce19baa01f6a2d30 Mon Sep 17 00:00:00 2001 From: Michael Yong <wrong92@gmail.com> Date: Thu, 6 Aug 2026 10:26:34 -0700 Subject: [PATCH 19/21] docs(provider-retry): document opt-in recovery --- docs/configuration.md | 16 ++ .../bundled-types/bb-plugin-sdk.d.ts | 152 ++++++++---------- .../src/generated/plugin-sdk-dts.generated.ts | 2 +- 3 files changed, 83 insertions(+), 87 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index ebb8466498..edfcea2846 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -547,6 +547,22 @@ database, host-managed settings/storage/schedules, secrets, and registration. A failed activation restores that snapshot and records the latest failure on the plugin so it can be surfaced as needing attention. +### Provider retry plugin + +The builtin Provider retry plugin is disabled on fresh installations. Enable +it under Extensions → Plugins or with `bb plugin enable provider-retry`. It +automatically waits for structured Codex and Claude Code subscription-window +resets only when the failed turn was accepted, the provider has stopped its own +retries, and no output or possible side effects were observed. Recovery sends +one agent-only `Please continue.` turn on the existing provider conversation. + +Pending waits are coordinated by machine/provider subscription and live only +in the current server/plugin process. Restarting bb, reloading the plugin, or +disabling it clears the timers without changing the original failed thread. +Inspect or control them with `bb provider-retry status`, `refresh`, `now`, and +`cancel`; `bb thread retry` remains the guarded manual recovery path. Credit or +spend-control exhaustion without a reset time is never retried automatically. + ### Workflows plugin The builtin Workflows plugin is disabled on fresh installations. Enable it 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 1df20e7177..cfee8a589c 100644 --- a/packages/plugin-sdk/bundled-types/bb-plugin-sdk.d.ts +++ b/packages/plugin-sdk/bundled-types/bb-plugin-sdk.d.ts @@ -313,8 +313,8 @@ declare const providerPendingInteractionSchema: z$1.ZodObject<{ id: z$1.ZodString; threadId: z$1.ZodString; status: z$1.ZodEnum<{ - interrupted: "interrupted"; pending: "pending"; + interrupted: "interrupted"; resolving: "resolving"; resolved: "resolved"; }>; @@ -451,8 +451,8 @@ declare const pluginPendingInteractionSchema: z$1.ZodObject<{ id: z$1.ZodString; threadId: z$1.ZodString; status: z$1.ZodEnum<{ - interrupted: "interrupted"; pending: "pending"; + interrupted: "interrupted"; resolving: "resolving"; resolved: "resolved"; }>; @@ -699,8 +699,8 @@ declare const threadEventSchema: z$1.ZodPipe<z$1.ZodUnknown, z$1.ZodUnion<readon providerThreadId: z$1.ZodString; objective: z$1.ZodString; status: z$1.ZodEnum<{ - active: "active"; paused: "paused"; + active: "active"; budgetLimited: "budgetLimited"; complete: "complete"; }>; @@ -744,10 +744,10 @@ declare const threadEventSchema: z$1.ZodPipe<z$1.ZodUnknown, z$1.ZodUnion<readon command: z$1.ZodString; cwd: z$1.ZodString; status: z$1.ZodEnum<{ + pending: "pending"; completed: "completed"; failed: "failed"; interrupted: "interrupted"; - pending: "pending"; }>; approvalStatus: z$1.ZodNullable<z$1.ZodEnum<{ waiting_for_approval: "waiting_for_approval"; @@ -791,10 +791,10 @@ declare const threadEventSchema: z$1.ZodPipe<z$1.ZodUnknown, z$1.ZodUnion<readon diff: z$1.ZodOptional<z$1.ZodString>; }, z$1.core.$strip>>; status: z$1.ZodEnum<{ + pending: "pending"; completed: "completed"; failed: "failed"; interrupted: "interrupted"; - pending: "pending"; }>; approvalStatus: z$1.ZodNullable<z$1.ZodEnum<{ waiting_for_approval: "waiting_for_approval"; @@ -831,10 +831,10 @@ declare const threadEventSchema: z$1.ZodPipe<z$1.ZodUnknown, z$1.ZodUnion<readon completed: z$1.ZodString; }, z$1.core.$strip>>; status: z$1.ZodEnum<{ + pending: "pending"; completed: "completed"; failed: "failed"; interrupted: "interrupted"; - pending: "pending"; }>; result: z$1.ZodOptional<z$1.ZodUnknown>; error: z$1.ZodOptional<z$1.ZodString>; @@ -881,17 +881,17 @@ declare const threadEventSchema: z$1.ZodPipe<z$1.ZodUnknown, z$1.ZodUnion<readon taskType: z$1.ZodString; description: z$1.ZodString; status: z$1.ZodEnum<{ + pending: "pending"; completed: "completed"; failed: "failed"; interrupted: "interrupted"; - pending: "pending"; }>; taskStatus: z$1.ZodEnum<{ - completed: "completed"; - failed: "failed"; - paused: "paused"; pending: "pending"; running: "running"; + paused: "paused"; + completed: "completed"; + failed: "failed"; killed: "killed"; stopped: "stopped"; }>; @@ -907,8 +907,8 @@ declare const threadEventSchema: z$1.ZodPipe<z$1.ZodUnknown, z$1.ZodUnion<readon index: z$1.ZodNumber; label: z$1.ZodString; state: z$1.ZodEnum<{ - failed: "failed"; running: "running"; + failed: "failed"; queued: "queued"; done: "done"; skipped: "skipped"; @@ -976,10 +976,10 @@ declare const threadEventSchema: z$1.ZodPipe<z$1.ZodUnknown, z$1.ZodUnion<readon command: z$1.ZodString; cwd: z$1.ZodString; status: z$1.ZodEnum<{ + pending: "pending"; completed: "completed"; failed: "failed"; interrupted: "interrupted"; - pending: "pending"; }>; approvalStatus: z$1.ZodNullable<z$1.ZodEnum<{ waiting_for_approval: "waiting_for_approval"; @@ -1023,10 +1023,10 @@ declare const threadEventSchema: z$1.ZodPipe<z$1.ZodUnknown, z$1.ZodUnion<readon diff: z$1.ZodOptional<z$1.ZodString>; }, z$1.core.$strip>>; status: z$1.ZodEnum<{ + pending: "pending"; completed: "completed"; failed: "failed"; interrupted: "interrupted"; - pending: "pending"; }>; approvalStatus: z$1.ZodNullable<z$1.ZodEnum<{ waiting_for_approval: "waiting_for_approval"; @@ -1063,10 +1063,10 @@ declare const threadEventSchema: z$1.ZodPipe<z$1.ZodUnknown, z$1.ZodUnion<readon completed: z$1.ZodString; }, z$1.core.$strip>>; status: z$1.ZodEnum<{ + pending: "pending"; completed: "completed"; failed: "failed"; interrupted: "interrupted"; - pending: "pending"; }>; result: z$1.ZodOptional<z$1.ZodUnknown>; error: z$1.ZodOptional<z$1.ZodString>; @@ -1113,17 +1113,17 @@ declare const threadEventSchema: z$1.ZodPipe<z$1.ZodUnknown, z$1.ZodUnion<readon taskType: z$1.ZodString; description: z$1.ZodString; status: z$1.ZodEnum<{ + pending: "pending"; completed: "completed"; failed: "failed"; interrupted: "interrupted"; - pending: "pending"; }>; taskStatus: z$1.ZodEnum<{ - completed: "completed"; - failed: "failed"; - paused: "paused"; pending: "pending"; running: "running"; + paused: "paused"; + completed: "completed"; + failed: "failed"; killed: "killed"; stopped: "stopped"; }>; @@ -1139,8 +1139,8 @@ declare const threadEventSchema: z$1.ZodPipe<z$1.ZodUnknown, z$1.ZodUnion<readon index: z$1.ZodNumber; label: z$1.ZodString; state: z$1.ZodEnum<{ - failed: "failed"; running: "running"; + failed: "failed"; queued: "queued"; done: "done"; skipped: "skipped"; @@ -1242,17 +1242,17 @@ declare const threadEventSchema: z$1.ZodPipe<z$1.ZodUnknown, z$1.ZodUnion<readon taskType: z$1.ZodString; description: z$1.ZodString; status: z$1.ZodEnum<{ + pending: "pending"; completed: "completed"; failed: "failed"; interrupted: "interrupted"; - pending: "pending"; }>; taskStatus: z$1.ZodEnum<{ - completed: "completed"; - failed: "failed"; - paused: "paused"; pending: "pending"; running: "running"; + paused: "paused"; + completed: "completed"; + failed: "failed"; killed: "killed"; stopped: "stopped"; }>; @@ -1268,8 +1268,8 @@ declare const threadEventSchema: z$1.ZodPipe<z$1.ZodUnknown, z$1.ZodUnion<readon index: z$1.ZodNumber; label: z$1.ZodString; state: z$1.ZodEnum<{ - failed: "failed"; running: "running"; + failed: "failed"; queued: "queued"; done: "done"; skipped: "skipped"; @@ -1314,17 +1314,17 @@ declare const threadEventSchema: z$1.ZodPipe<z$1.ZodUnknown, z$1.ZodUnion<readon taskType: z$1.ZodString; description: z$1.ZodString; status: z$1.ZodEnum<{ + pending: "pending"; completed: "completed"; failed: "failed"; interrupted: "interrupted"; - pending: "pending"; }>; taskStatus: z$1.ZodEnum<{ - completed: "completed"; - failed: "failed"; - paused: "paused"; pending: "pending"; running: "running"; + paused: "paused"; + completed: "completed"; + failed: "failed"; killed: "killed"; stopped: "stopped"; }>; @@ -1340,8 +1340,8 @@ declare const threadEventSchema: z$1.ZodPipe<z$1.ZodUnknown, z$1.ZodUnion<readon index: z$1.ZodNumber; label: z$1.ZodString; state: z$1.ZodEnum<{ - failed: "failed"; running: "running"; + failed: "failed"; queued: "queued"; done: "done"; skipped: "skipped"; @@ -1413,10 +1413,10 @@ declare const threadEventSchema: z$1.ZodPipe<z$1.ZodUnknown, z$1.ZodUnion<readon plan: z$1.ZodArray<z$1.ZodObject<{ step: z$1.ZodString; status: z$1.ZodOptional<z$1.ZodEnum<{ + pending: "pending"; completed: "completed"; failed: "failed"; active: "active"; - pending: "pending"; }>>; }, z$1.core.$strip>>; explanation: z$1.ZodOptional<z$1.ZodString>; @@ -1484,9 +1484,7 @@ declare const threadEventSchema: z$1.ZodPipe<z$1.ZodUnknown, z$1.ZodUnion<readon warning: "warning"; blocked: "blocked"; }>; - usedPercent: z$1.ZodNullable<z$1.ZodNumber>; resetsAtMs: z$1.ZodNullable<z$1.ZodNumber>; - modelIds: z$1.ZodArray<z$1.ZodString>; }, z$1.core.$strip>>; reachedReason: z$1.ZodNullable<z$1.ZodString>; overageStatus: z$1.ZodNullable<z$1.ZodEnum<{ @@ -1496,11 +1494,6 @@ declare const threadEventSchema: z$1.ZodPipe<z$1.ZodUnknown, z$1.ZodUnion<readon unavailable: "unavailable"; }>>; overageReason: z$1.ZodNullable<z$1.ZodString>; - observedAtMs: z$1.ZodNumber; - source: z$1.ZodEnum<{ - "codex-account": "codex-account"; - "claude-rate-limit": "claude-rate-limit"; - }>; }, z$1.core.$strip>; }, z$1.core.$strip>, z$1.ZodObject<{ type: z$1.ZodLiteral<"provider/warning">; @@ -1865,8 +1858,8 @@ declare const threadEventSchema: z$1.ZodPipe<z$1.ZodUnknown, z$1.ZodUnion<readon providerId: z$1.ZodString; providerRequestId: z$1.ZodString; status: z$1.ZodEnum<{ - interrupted: "interrupted"; pending: "pending"; + interrupted: "interrupted"; resolving: "resolving"; resolved: "resolved"; }>; @@ -1917,8 +1910,8 @@ declare const threadEventSchema: z$1.ZodPipe<z$1.ZodUnknown, z$1.ZodUnion<readon providerId: z$1.ZodString; providerRequestId: z$1.ZodString; status: z$1.ZodEnum<{ - interrupted: "interrupted"; pending: "pending"; + interrupted: "interrupted"; resolving: "resolving"; resolved: "resolved"; }>; @@ -2087,8 +2080,8 @@ declare const threadTimelinePendingTodosSchema: z$1.ZodObject<{ id: z$1.ZodString; text: z$1.ZodString; status: z$1.ZodEnum<{ - completed: "completed"; pending: "pending"; + completed: "completed"; in_progress: "in_progress"; }>; }, z$1.core.$strip>>; @@ -2403,9 +2396,9 @@ declare const projectBranchesResponseSchema: z$1.ZodObject<{ selectedBranch: z$1.ZodNullable<z$1.ZodObject<{ name: z$1.ZodString; kind: z$1.ZodEnum<{ + missing: "missing"; local: "local"; remote: "remote"; - missing: "missing"; }>; }, z$1.core.$strip>>; defaultWorktreeBaseBranch: z$1.ZodNullable<z$1.ZodString>; @@ -2542,8 +2535,8 @@ declare const skillListResponseSchema: z$1.ZodObject<{ name: z$1.ZodString; description: z$1.ZodNullable<z$1.ZodString>; provider: z$1.ZodNullable<z$1.ZodEnum<{ - "claude-code": "claude-code"; codex: "codex"; + "claude-code": "claude-code"; }>>; scope: z$1.ZodEnum<{ plugin: "plugin"; @@ -2575,8 +2568,8 @@ type SkillFilesResponse = z$1.infer<typeof skillFilesResponseSchema>; declare const projectResponseSchema: z$1.ZodObject<{ id: z$1.ZodString; kind: z$1.ZodEnum<{ - standard: "standard"; personal: "personal"; + standard: "standard"; }>; name: z$1.ZodString; gitRemoteUrl: z$1.ZodNullable<z$1.ZodString>; @@ -2597,8 +2590,8 @@ type ProjectResponse = z$1.infer<typeof projectResponseSchema>; declare const projectWithThreadsResponseSchema: z$1.ZodObject<{ id: z$1.ZodString; kind: z$1.ZodEnum<{ - standard: "standard"; personal: "personal"; + standard: "standard"; }>; name: z$1.ZodString; gitRemoteUrl: z$1.ZodNullable<z$1.ZodString>; @@ -2698,8 +2691,8 @@ declare const projectWithThreadsResponseSchema: z$1.ZodObject<{ ultra: "ultra"; }>; permissionMode: z$1.ZodEnum<{ - "accept-edits": "accept-edits"; auto: "auto"; + "accept-edits": "accept-edits"; full: "full"; }>; }, z$1.core.$strip>>; @@ -2815,9 +2808,9 @@ declare const environmentDiffBranchesResponseSchema: z$1.ZodObject<{ selectedBranch: z$1.ZodNullable<z$1.ZodObject<{ name: z$1.ZodString; kind: z$1.ZodEnum<{ + missing: "missing"; local: "local"; remote: "remote"; - missing: "missing"; }>; }, z$1.core.$strip>>; }, z$1.core.$strip>; @@ -2888,8 +2881,8 @@ declare const environmentDiffFileResponseSchema: z$1.ZodObject<{ path: z$1.ZodString; content: z$1.ZodString; contentEncoding: z$1.ZodEnum<{ - base64: "base64"; utf8: "utf8"; + base64: "base64"; }>; mimeType: z$1.ZodOptional<z$1.ZodString>; sizeBytes: z$1.ZodNumber; @@ -3118,8 +3111,8 @@ declare const environmentPullRequestResponseSchema: z$1.ZodDiscriminatedUnion<[z }>>; }, z$1.core.$strict>; attention: z$1.ZodEnum<{ - none: "none"; blocked: "blocked"; + none: "none"; merged: "merged"; draft: "draft"; closed: "closed"; @@ -6058,8 +6051,8 @@ declare const installedPluginSchema: z$1.ZodObject<{ status: z$1.ZodEnum<{ error: "error"; running: "running"; - missing: "missing"; incompatible: "incompatible"; + missing: "missing"; disabled: "disabled"; degraded: "degraded"; "needs-configuration": "needs-configuration"; @@ -6162,8 +6155,8 @@ declare const pluginListResponseSchema: z$1.ZodObject<{ status: z$1.ZodEnum<{ error: "error"; running: "running"; - missing: "missing"; incompatible: "incompatible"; + missing: "missing"; disabled: "disabled"; degraded: "degraded"; "needs-configuration": "needs-configuration"; @@ -6268,8 +6261,8 @@ declare const pluginReloadResponseSchema: z$1.ZodObject<{ status: z$1.ZodEnum<{ error: "error"; running: "running"; - missing: "missing"; incompatible: "incompatible"; + missing: "missing"; disabled: "disabled"; degraded: "degraded"; "needs-configuration": "needs-configuration"; @@ -6402,8 +6395,8 @@ declare const systemExecutionOptionsResponseSchema: z$1.ZodObject<{ supportsUserQuestion: z$1.ZodBoolean; supportsFork: z$1.ZodBoolean; supportedPermissionModes: z$1.ZodArray<z$1.ZodEnum<{ - "accept-edits": "accept-edits"; auto: "auto"; + "accept-edits": "accept-edits"; full: "full"; }>>; }, z$1.core.$strip>; @@ -6434,8 +6427,8 @@ declare const systemExecutionOptionsResponseSchema: z$1.ZodObject<{ available: z$1.ZodBoolean; }, z$1.core.$strip>>; permissionCeiling: z$1.ZodEnum<{ - "accept-edits": "accept-edits"; auto: "auto"; + "accept-edits": "accept-edits"; full: "full"; }>; models: z$1.ZodArray<z$1.ZodObject<{ @@ -6942,8 +6935,8 @@ declare const systemCliSkillsStatusResponseSchema: z$1.ZodObject<{ hostName: z$1.ZodString; status: z$1.ZodEnum<{ unknown: "unknown"; - missing: "missing"; installed: "installed"; + missing: "missing"; outdated: "outdated"; }>; }, z$1.core.$strip>>; @@ -6988,9 +6981,9 @@ declare const terminalSessionSchema: z$1.ZodObject<{ cols: z$1.ZodNumber; rows: z$1.ZodNumber; status: z$1.ZodEnum<{ + running: "running"; starting: "starting"; disconnected: "disconnected"; - running: "running"; exited: "exited"; }>; exitCode: z$1.ZodNullable<z$1.ZodNumber>; @@ -7019,9 +7012,9 @@ declare const terminalListResponseSchema: z$1.ZodObject<{ cols: z$1.ZodNumber; rows: z$1.ZodNumber; status: z$1.ZodEnum<{ + running: "running"; starting: "starting"; disconnected: "disconnected"; - running: "running"; exited: "exited"; }>; exitCode: z$1.ZodNullable<z$1.ZodNumber>; @@ -7865,10 +7858,10 @@ declare const createThreadRequestSchema: z$1.ZodObject<{ ultra: "ultra"; }>>; permissionMode: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodUnion<readonly [z$1.ZodEnum<{ - "accept-edits": "accept-edits"; auto: "auto"; + "accept-edits": "accept-edits"; full: "full"; - }>, z$1.ZodLiteral<"workspace-write">]>, z$1.ZodTransform<"accept-edits" | "auto" | "full", "accept-edits" | "auto" | "full" | "workspace-write">>>; + }>, z$1.ZodLiteral<"workspace-write">]>, z$1.ZodTransform<"auto" | "accept-edits" | "full", "auto" | "accept-edits" | "full" | "workspace-write">>>; executionInputSources: z$1.ZodOptional<z$1.ZodObject<{ providerId: z$1.ZodOptional<z$1.ZodEnum<{ explicit: "explicit"; @@ -8109,10 +8102,10 @@ declare const forkThreadRequestSchema: z$1.ZodObject<{ }, z$1.core.$strip>>>>; title: z$1.ZodOptional<z$1.ZodString>; permissionMode: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodUnion<readonly [z$1.ZodEnum<{ - "accept-edits": "accept-edits"; auto: "auto"; + "accept-edits": "accept-edits"; full: "full"; - }>, z$1.ZodLiteral<"workspace-write">]>, z$1.ZodTransform<"accept-edits" | "auto" | "full", "accept-edits" | "auto" | "full" | "workspace-write">>>; + }>, 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"; @@ -8228,10 +8221,10 @@ declare const sendMessageRequestSchema: z$1.ZodObject<{ ultra: "ultra"; }>>; permissionMode: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodUnion<readonly [z$1.ZodEnum<{ - "accept-edits": "accept-edits"; auto: "auto"; + "accept-edits": "accept-edits"; full: "full"; - }>, z$1.ZodLiteral<"workspace-write">]>, z$1.ZodTransform<"accept-edits" | "auto" | "full", "accept-edits" | "auto" | "full" | "workspace-write">>>; + }>, z$1.ZodLiteral<"workspace-write">]>, z$1.ZodTransform<"auto" | "accept-edits" | "full", "auto" | "accept-edits" | "full" | "workspace-write">>>; executionInputSources: z$1.ZodOptional<z$1.ZodObject<{ model: z$1.ZodOptional<z$1.ZodEnum<{ explicit: "explicit"; @@ -8267,6 +8260,7 @@ declare const providerRateLimitRecoveryStatusSchema: z$1.ZodObject<{ "no-failed-turn": "no-failed-turn"; "input-not-accepted": "input-not-accepted"; "no-rate-limit-state": "no-rate-limit-state"; + "no-terminal-rate-limit-error": "no-terminal-rate-limit-error"; "provider-will-retry": "provider-will-retry"; "manual-only": "manual-only"; "output-or-side-effect-observed": "output-or-side-effect-observed"; @@ -8298,9 +8292,7 @@ declare const providerRateLimitRecoveryStatusSchema: z$1.ZodObject<{ allowed: "allowed"; blocked: "blocked"; }>; - usedPercent: z$1.ZodNullable<z$1.ZodNumber>; resetsAtMs: z$1.ZodNullable<z$1.ZodNumber>; - modelIds: z$1.ZodArray<z$1.ZodString>; }, z$1.core.$strip>>; reachedReason: z$1.ZodNullable<z$1.ZodString>; overageStatus: z$1.ZodNullable<z$1.ZodEnum<{ @@ -8310,11 +8302,6 @@ declare const providerRateLimitRecoveryStatusSchema: z$1.ZodObject<{ unavailable: "unavailable"; }>>; overageReason: z$1.ZodNullable<z$1.ZodString>; - observedAtMs: z$1.ZodNumber; - source: z$1.ZodEnum<{ - "codex-account": "codex-account"; - "claude-rate-limit": "claude-rate-limit"; - }>; }, z$1.core.$strip>>; candidate: z$1.ZodNullable<z$1.ZodObject<{ failedRequestId: z$1.ZodString; @@ -8344,9 +8331,7 @@ declare const providerRateLimitRecoveryStatusSchema: z$1.ZodObject<{ allowed: "allowed"; blocked: "blocked"; }>; - usedPercent: z$1.ZodNullable<z$1.ZodNumber>; resetsAtMs: z$1.ZodNullable<z$1.ZodNumber>; - modelIds: z$1.ZodArray<z$1.ZodString>; }, z$1.core.$strip>>; reachedReason: z$1.ZodNullable<z$1.ZodString>; overageStatus: z$1.ZodNullable<z$1.ZodEnum<{ @@ -8356,11 +8341,6 @@ declare const providerRateLimitRecoveryStatusSchema: z$1.ZodObject<{ unavailable: "unavailable"; }>>; overageReason: z$1.ZodNullable<z$1.ZodString>; - observedAtMs: z$1.ZodNumber; - source: z$1.ZodEnum<{ - "codex-account": "codex-account"; - "claude-rate-limit": "claude-rate-limit"; - }>; }, z$1.core.$strip>; }, z$1.core.$strip>>; }, z$1.core.$strip>; @@ -8468,10 +8448,10 @@ declare const createQueuedMessageRequestSchema: z$1.ZodObject<{ ultra: "ultra"; }>>; permissionMode: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodUnion<readonly [z$1.ZodEnum<{ - "accept-edits": "accept-edits"; auto: "auto"; + "accept-edits": "accept-edits"; full: "full"; - }>, z$1.ZodLiteral<"workspace-write">]>, z$1.ZodTransform<"accept-edits" | "auto" | "full", "accept-edits" | "auto" | "full" | "workspace-write">>>; + }>, z$1.ZodLiteral<"workspace-write">]>, z$1.ZodTransform<"auto" | "accept-edits" | "full", "auto" | "accept-edits" | "full" | "workspace-write">>>; executionInputSources: z$1.ZodOptional<z$1.ZodObject<{ model: z$1.ZodOptional<z$1.ZodEnum<{ explicit: "explicit"; @@ -8693,8 +8673,8 @@ declare const sendQueuedMessageResponseSchema: z$1.ZodObject<{ ultra: "ultra"; }>; permissionMode: z$1.ZodEnum<{ - "accept-edits": "accept-edits"; auto: "auto"; + "accept-edits": "accept-edits"; full: "full"; }>; serviceTier: z$1.ZodEnum<{ @@ -9063,9 +9043,9 @@ declare const threadWithIncludesResponseSchema: z$1.ZodObject<{ isGitRepo: z$1.ZodBoolean; isWorktree: z$1.ZodBoolean; workspaceProvisionType: z$1.ZodEnum<{ - personal: "personal"; - "managed-worktree": "managed-worktree"; unmanaged: "unmanaged"; + "managed-worktree": "managed-worktree"; + personal: "personal"; }>; branchName: z$1.ZodNullable<z$1.ZodString>; baseBranch: z$1.ZodNullable<z$1.ZodString>; @@ -9093,8 +9073,8 @@ declare const threadWithIncludesResponseSchema: z$1.ZodObject<{ connected: "connected"; }>; maxPermissionMode: z$1.ZodEnum<{ - "accept-edits": "accept-edits"; auto: "auto"; + "accept-edits": "accept-edits"; full: "full"; }>; lastSeenAt: z$1.ZodNullable<z$1.ZodNumber>; @@ -9364,8 +9344,8 @@ declare const threadQueuedMessageListResponseSchema: z$1.ZodArray<z$1.ZodObject< ultra: "ultra"; }>; permissionMode: z$1.ZodEnum<{ - "accept-edits": "accept-edits"; auto: "auto"; + "accept-edits": "accept-edits"; full: "full"; }>; serviceTier: z$1.ZodEnum<{ @@ -9541,8 +9521,8 @@ declare const threadTimelineResponseSchema: z$1.ZodObject<{ activePromptMode: z$1.ZodNullable<z$1.ZodObject<{ mode: z$1.ZodLiteral<"plan">; providerId: z$1.ZodEnum<{ - "claude-code": "claude-code"; codex: "codex"; + "claude-code": "claude-code"; }>; prompt: z$1.ZodString; }, z$1.core.$strict>>; @@ -9718,8 +9698,8 @@ declare const threadTimelineResponseSchema: z$1.ZodObject<{ updatedAt: z$1.ZodNumber; objective: z$1.ZodString; status: z$1.ZodEnum<{ - active: "active"; paused: "paused"; + active: "active"; budgetLimited: "budgetLimited"; complete: "complete"; }>; @@ -9733,8 +9713,8 @@ declare const threadTimelineResponseSchema: z$1.ZodObject<{ originalModel: z$1.ZodString; fallbackModel: z$1.ZodString; reason: z$1.ZodEnum<{ - provider: "provider"; refusal: "refusal"; + provider: "provider"; }>; message: z$1.ZodString; }, z$1.core.$strip>>; diff --git a/packages/templates/src/generated/plugin-sdk-dts.generated.ts b/packages/templates/src/generated/plugin-sdk-dts.generated.ts index db90a0ee54..808ce27ca2 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/rateLimits/updated\" | \"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/rateLimits/updated\" | \"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 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 interrupted: \"interrupted\";\n pending: \"pending\";\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 interrupted: \"interrupted\";\n pending: \"pending\";\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 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>, 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 completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\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 completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\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 completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\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 completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\n }>;\n taskStatus: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n paused: \"paused\";\n pending: \"pending\";\n running: \"running\";\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 failed: \"failed\";\n running: \"running\";\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 completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\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 completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\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 completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\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 completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\n }>;\n taskStatus: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n paused: \"paused\";\n pending: \"pending\";\n running: \"running\";\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 failed: \"failed\";\n running: \"running\";\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 completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\n }>;\n taskStatus: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n paused: \"paused\";\n pending: \"pending\";\n running: \"running\";\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 failed: \"failed\";\n running: \"running\";\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 completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n pending: \"pending\";\n }>;\n taskStatus: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n paused: \"paused\";\n pending: \"pending\";\n running: \"running\";\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 failed: \"failed\";\n running: \"running\";\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 completed: \"completed\";\n failed: \"failed\";\n active: \"active\";\n pending: \"pending\";\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/rateLimits/updated\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n rateLimits: z$1.ZodObject<{\n providerId: z$1.ZodString;\n status: z$1.ZodEnum<{\n unknown: \"unknown\";\n allowed: \"allowed\";\n warning: \"warning\";\n blocked: \"blocked\";\n }>;\n kind: z$1.ZodEnum<{\n unknown: \"unknown\";\n \"subscription-window\": \"subscription-window\";\n credits: \"credits\";\n \"spend-control\": \"spend-control\";\n }>;\n windows: z$1.ZodArray<z$1.ZodObject<{\n providerKey: z$1.ZodNullable<z$1.ZodString>;\n label: z$1.ZodNullable<z$1.ZodString>;\n status: z$1.ZodEnum<{\n unknown: \"unknown\";\n allowed: \"allowed\";\n warning: \"warning\";\n blocked: \"blocked\";\n }>;\n usedPercent: z$1.ZodNullable<z$1.ZodNumber>;\n resetsAtMs: z$1.ZodNullable<z$1.ZodNumber>;\n modelIds: z$1.ZodArray<z$1.ZodString>;\n }, z$1.core.$strip>>;\n reachedReason: z$1.ZodNullable<z$1.ZodString>;\n overageStatus: z$1.ZodNullable<z$1.ZodEnum<{\n allowed: \"allowed\";\n warning: \"warning\";\n rejected: \"rejected\";\n unavailable: \"unavailable\";\n }>>;\n overageReason: z$1.ZodNullable<z$1.ZodString>;\n observedAtMs: z$1.ZodNumber;\n source: z$1.ZodEnum<{\n \"codex-account\": \"codex-account\";\n \"claude-rate-limit\": \"claude-rate-limit\";\n }>;\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 continuationOfRequestId: z$1.ZodOptional<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 interrupted: \"interrupted\";\n pending: \"pending\";\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 interrupted: \"interrupted\";\n pending: \"pending\";\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 completed: \"completed\";\n pending: \"pending\";\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 standard: \"standard\";\n personal: \"personal\";\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 standard: \"standard\";\n personal: \"personal\";\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 \"accept-edits\": \"accept-edits\";\n auto: \"auto\";\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 blocked: \"blocked\";\n draft: \"draft\";\n mergeable: \"mergeable\";\n conflicts: \"conflicts\";\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 blocked: \"blocked\";\n merged: \"merged\";\n draft: \"draft\";\n closed: \"closed\";\n changes_requested: \"changes_requested\";\n review_requested: \"review_requested\";\n conflicts: \"conflicts\";\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 }, 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 \"accept-edits\": \"accept-edits\";\n auto: \"auto\";\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 \"accept-edits\": \"accept-edits\";\n auto: \"auto\";\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 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 \"accept-edits\": \"accept-edits\";\n auto: \"auto\";\n full: \"full\";\n }>, z$1.ZodLiteral<\"workspace-write\">]>, z$1.ZodTransform<\"accept-edits\" | \"auto\" | \"full\", \"accept-edits\" | \"auto\" | \"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 \"accept-edits\": \"accept-edits\";\n auto: \"auto\";\n full: \"full\";\n }>, z$1.ZodLiteral<\"workspace-write\">]>, z$1.ZodTransform<\"accept-edits\" | \"auto\" | \"full\", \"accept-edits\" | \"auto\" | \"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 \"accept-edits\": \"accept-edits\";\n auto: \"auto\";\n full: \"full\";\n }>, z$1.ZodLiteral<\"workspace-write\">]>, z$1.ZodTransform<\"accept-edits\" | \"auto\" | \"full\", \"accept-edits\" | \"auto\" | \"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 providerRateLimitRecoveryStatusSchema: z$1.ZodObject<{\n reason: z$1.ZodEnum<{\n eligible: \"eligible\";\n \"thread-not-failed\": \"thread-not-failed\";\n \"no-failed-turn\": \"no-failed-turn\";\n \"input-not-accepted\": \"input-not-accepted\";\n \"no-rate-limit-state\": \"no-rate-limit-state\";\n \"provider-will-retry\": \"provider-will-retry\";\n \"manual-only\": \"manual-only\";\n \"output-or-side-effect-observed\": \"output-or-side-effect-observed\";\n superseded: \"superseded\";\n \"execution-unavailable\": \"execution-unavailable\";\n }>;\n scopeKey: z$1.ZodString;\n hostId: z$1.ZodString;\n rateLimits: z$1.ZodNullable<z$1.ZodObject<{\n providerId: z$1.ZodString;\n status: z$1.ZodEnum<{\n unknown: \"unknown\";\n warning: \"warning\";\n allowed: \"allowed\";\n blocked: \"blocked\";\n }>;\n kind: z$1.ZodEnum<{\n unknown: \"unknown\";\n \"subscription-window\": \"subscription-window\";\n credits: \"credits\";\n \"spend-control\": \"spend-control\";\n }>;\n windows: z$1.ZodArray<z$1.ZodObject<{\n providerKey: z$1.ZodNullable<z$1.ZodString>;\n label: z$1.ZodNullable<z$1.ZodString>;\n status: z$1.ZodEnum<{\n unknown: \"unknown\";\n warning: \"warning\";\n allowed: \"allowed\";\n blocked: \"blocked\";\n }>;\n usedPercent: z$1.ZodNullable<z$1.ZodNumber>;\n resetsAtMs: z$1.ZodNullable<z$1.ZodNumber>;\n modelIds: z$1.ZodArray<z$1.ZodString>;\n }, z$1.core.$strip>>;\n reachedReason: z$1.ZodNullable<z$1.ZodString>;\n overageStatus: z$1.ZodNullable<z$1.ZodEnum<{\n warning: \"warning\";\n allowed: \"allowed\";\n rejected: \"rejected\";\n unavailable: \"unavailable\";\n }>>;\n overageReason: z$1.ZodNullable<z$1.ZodString>;\n observedAtMs: z$1.ZodNumber;\n source: z$1.ZodEnum<{\n \"codex-account\": \"codex-account\";\n \"claude-rate-limit\": \"claude-rate-limit\";\n }>;\n }, z$1.core.$strip>>;\n candidate: z$1.ZodNullable<z$1.ZodObject<{\n failedRequestId: z$1.ZodString;\n turnId: z$1.ZodString;\n automatic: z$1.ZodBoolean;\n resetsAtMs: z$1.ZodNullable<z$1.ZodNumber>;\n rateLimits: z$1.ZodObject<{\n providerId: z$1.ZodString;\n status: z$1.ZodEnum<{\n unknown: \"unknown\";\n warning: \"warning\";\n allowed: \"allowed\";\n blocked: \"blocked\";\n }>;\n kind: z$1.ZodEnum<{\n unknown: \"unknown\";\n \"subscription-window\": \"subscription-window\";\n credits: \"credits\";\n \"spend-control\": \"spend-control\";\n }>;\n windows: z$1.ZodArray<z$1.ZodObject<{\n providerKey: z$1.ZodNullable<z$1.ZodString>;\n label: z$1.ZodNullable<z$1.ZodString>;\n status: z$1.ZodEnum<{\n unknown: \"unknown\";\n warning: \"warning\";\n allowed: \"allowed\";\n blocked: \"blocked\";\n }>;\n usedPercent: z$1.ZodNullable<z$1.ZodNumber>;\n resetsAtMs: z$1.ZodNullable<z$1.ZodNumber>;\n modelIds: z$1.ZodArray<z$1.ZodString>;\n }, z$1.core.$strip>>;\n reachedReason: z$1.ZodNullable<z$1.ZodString>;\n overageStatus: z$1.ZodNullable<z$1.ZodEnum<{\n warning: \"warning\";\n allowed: \"allowed\";\n rejected: \"rejected\";\n unavailable: \"unavailable\";\n }>>;\n overageReason: z$1.ZodNullable<z$1.ZodString>;\n observedAtMs: z$1.ZodNumber;\n source: z$1.ZodEnum<{\n \"codex-account\": \"codex-account\";\n \"claude-rate-limit\": \"claude-rate-limit\";\n }>;\n }, z$1.core.$strip>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype ProviderRateLimitRecoveryStatus = z$1.infer<typeof providerRateLimitRecoveryStatusSchema>;\ndeclare const continueAfterProviderRateLimitResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\n requestId: z$1.ZodString;\n}, z$1.core.$strip>;\ntype ContinueAfterProviderRateLimitResponse = z$1.infer<typeof continueAfterProviderRateLimitResponseSchema>;\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 \"accept-edits\": \"accept-edits\";\n auto: \"auto\";\n full: \"full\";\n }>, z$1.ZodLiteral<\"workspace-write\">]>, z$1.ZodTransform<\"accept-edits\" | \"auto\" | \"full\", \"accept-edits\" | \"auto\" | \"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 \"accept-edits\": \"accept-edits\";\n auto: \"auto\";\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 personal: \"personal\";\n \"managed-worktree\": \"managed-worktree\";\n unmanaged: \"unmanaged\";\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 \"accept-edits\": \"accept-edits\";\n auto: \"auto\";\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 \"accept-edits\": \"accept-edits\";\n auto: \"auto\";\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 provider: \"provider\";\n refusal: \"refusal\";\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 ThreadRateLimitRecoveryResult = ProviderRateLimitRecoveryStatus;\ntype ThreadContinueAfterRateLimitResult = ContinueAfterProviderRateLimitResponse;\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 ThreadContinueAfterRateLimitArgs extends ThreadActionArgs {\n failedRequestId: 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 continueAfterRateLimit(args: ThreadContinueAfterRateLimitArgs): Promise<ThreadContinueAfterRateLimitResult>;\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 rateLimitRecovery(args: ThreadStatusArgs): Promise<ThreadRateLimitRecoveryResult>;\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/rateLimits/updated\" | \"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/rateLimits/updated\" | \"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 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/rateLimits/updated\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n rateLimits: z$1.ZodObject<{\n providerId: z$1.ZodString;\n status: z$1.ZodEnum<{\n unknown: \"unknown\";\n allowed: \"allowed\";\n warning: \"warning\";\n blocked: \"blocked\";\n }>;\n kind: z$1.ZodEnum<{\n unknown: \"unknown\";\n \"subscription-window\": \"subscription-window\";\n credits: \"credits\";\n \"spend-control\": \"spend-control\";\n }>;\n windows: z$1.ZodArray<z$1.ZodObject<{\n providerKey: z$1.ZodNullable<z$1.ZodString>;\n label: z$1.ZodNullable<z$1.ZodString>;\n status: z$1.ZodEnum<{\n unknown: \"unknown\";\n allowed: \"allowed\";\n warning: \"warning\";\n blocked: \"blocked\";\n }>;\n resetsAtMs: z$1.ZodNullable<z$1.ZodNumber>;\n }, z$1.core.$strip>>;\n reachedReason: z$1.ZodNullable<z$1.ZodString>;\n overageStatus: z$1.ZodNullable<z$1.ZodEnum<{\n allowed: \"allowed\";\n warning: \"warning\";\n rejected: \"rejected\";\n unavailable: \"unavailable\";\n }>>;\n overageReason: z$1.ZodNullable<z$1.ZodString>;\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 continuationOfRequestId: z$1.ZodOptional<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 missing: \"missing\";\n local: \"local\";\n remote: \"remote\";\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 codex: \"codex\";\n \"claude-code\": \"claude-code\";\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 missing: \"missing\";\n local: \"local\";\n remote: \"remote\";\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 utf8: \"utf8\";\n base64: \"base64\";\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 blocked: \"blocked\";\n draft: \"draft\";\n mergeable: \"mergeable\";\n conflicts: \"conflicts\";\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 blocked: \"blocked\";\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 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 }, 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 incompatible: \"incompatible\";\n missing: \"missing\";\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 incompatible: \"incompatible\";\n missing: \"missing\";\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 incompatible: \"incompatible\";\n missing: \"missing\";\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 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 installed: \"installed\";\n missing: \"missing\";\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 running: \"running\";\n starting: \"starting\";\n disconnected: \"disconnected\";\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 running: \"running\";\n starting: \"starting\";\n disconnected: \"disconnected\";\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 providerRateLimitRecoveryStatusSchema: z$1.ZodObject<{\n reason: z$1.ZodEnum<{\n eligible: \"eligible\";\n \"thread-not-failed\": \"thread-not-failed\";\n \"no-failed-turn\": \"no-failed-turn\";\n \"input-not-accepted\": \"input-not-accepted\";\n \"no-rate-limit-state\": \"no-rate-limit-state\";\n \"no-terminal-rate-limit-error\": \"no-terminal-rate-limit-error\";\n \"provider-will-retry\": \"provider-will-retry\";\n \"manual-only\": \"manual-only\";\n \"output-or-side-effect-observed\": \"output-or-side-effect-observed\";\n superseded: \"superseded\";\n \"execution-unavailable\": \"execution-unavailable\";\n }>;\n scopeKey: z$1.ZodString;\n hostId: z$1.ZodString;\n rateLimits: z$1.ZodNullable<z$1.ZodObject<{\n providerId: z$1.ZodString;\n status: z$1.ZodEnum<{\n unknown: \"unknown\";\n warning: \"warning\";\n allowed: \"allowed\";\n blocked: \"blocked\";\n }>;\n kind: z$1.ZodEnum<{\n unknown: \"unknown\";\n \"subscription-window\": \"subscription-window\";\n credits: \"credits\";\n \"spend-control\": \"spend-control\";\n }>;\n windows: z$1.ZodArray<z$1.ZodObject<{\n providerKey: z$1.ZodNullable<z$1.ZodString>;\n label: z$1.ZodNullable<z$1.ZodString>;\n status: z$1.ZodEnum<{\n unknown: \"unknown\";\n warning: \"warning\";\n allowed: \"allowed\";\n blocked: \"blocked\";\n }>;\n resetsAtMs: z$1.ZodNullable<z$1.ZodNumber>;\n }, z$1.core.$strip>>;\n reachedReason: z$1.ZodNullable<z$1.ZodString>;\n overageStatus: z$1.ZodNullable<z$1.ZodEnum<{\n warning: \"warning\";\n allowed: \"allowed\";\n rejected: \"rejected\";\n unavailable: \"unavailable\";\n }>>;\n overageReason: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strip>>;\n candidate: z$1.ZodNullable<z$1.ZodObject<{\n failedRequestId: z$1.ZodString;\n turnId: z$1.ZodString;\n automatic: z$1.ZodBoolean;\n resetsAtMs: z$1.ZodNullable<z$1.ZodNumber>;\n rateLimits: z$1.ZodObject<{\n providerId: z$1.ZodString;\n status: z$1.ZodEnum<{\n unknown: \"unknown\";\n warning: \"warning\";\n allowed: \"allowed\";\n blocked: \"blocked\";\n }>;\n kind: z$1.ZodEnum<{\n unknown: \"unknown\";\n \"subscription-window\": \"subscription-window\";\n credits: \"credits\";\n \"spend-control\": \"spend-control\";\n }>;\n windows: z$1.ZodArray<z$1.ZodObject<{\n providerKey: z$1.ZodNullable<z$1.ZodString>;\n label: z$1.ZodNullable<z$1.ZodString>;\n status: z$1.ZodEnum<{\n unknown: \"unknown\";\n warning: \"warning\";\n allowed: \"allowed\";\n blocked: \"blocked\";\n }>;\n resetsAtMs: z$1.ZodNullable<z$1.ZodNumber>;\n }, z$1.core.$strip>>;\n reachedReason: z$1.ZodNullable<z$1.ZodString>;\n overageStatus: z$1.ZodNullable<z$1.ZodEnum<{\n warning: \"warning\";\n allowed: \"allowed\";\n rejected: \"rejected\";\n unavailable: \"unavailable\";\n }>>;\n overageReason: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strip>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype ProviderRateLimitRecoveryStatus = z$1.infer<typeof providerRateLimitRecoveryStatusSchema>;\ndeclare const continueAfterProviderRateLimitResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\n requestId: z$1.ZodString;\n}, z$1.core.$strip>;\ntype ContinueAfterProviderRateLimitResponse = z$1.infer<typeof continueAfterProviderRateLimitResponseSchema>;\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 codex: \"codex\";\n \"claude-code\": \"claude-code\";\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 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>>;\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 ThreadRateLimitRecoveryResult = ProviderRateLimitRecoveryStatus;\ntype ThreadContinueAfterRateLimitResult = ContinueAfterProviderRateLimitResponse;\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 ThreadContinueAfterRateLimitArgs extends ThreadActionArgs {\n failedRequestId: 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 continueAfterRateLimit(args: ThreadContinueAfterRateLimitArgs): Promise<ThreadContinueAfterRateLimitResult>;\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 rateLimitRecovery(args: ThreadStatusArgs): Promise<ThreadRateLimitRecoveryResult>;\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"; From 587cda502e1892ce8325ed43b24cae7c4b0f865f Mon Sep 17 00:00:00 2001 From: Michael Yong <wrong92@gmail.com> Date: Thu, 6 Aug 2026 15:44:53 -0700 Subject: [PATCH 20/21] fix(agent-runtime): hydrate Codex rate limits --- .../agent-runtime/src/codex/adapter.test.ts | 87 +++++++++---------- packages/agent-runtime/src/codex/adapter.ts | 21 +++++ .../src/codex/event-translation.ts | 41 +++++---- packages/agent-runtime/src/codex/schemas.ts | 85 +++++++++++------- .../agent-runtime/src/provider-adapter.ts | 13 +++ .../src/runtime-provider-process.ts | 15 ++++ .../src/runtime.command-contract.test.ts | 13 +++ .../src/runtime.process-lifecycle.test.ts | 49 +++++++++++ 8 files changed, 231 insertions(+), 93 deletions(-) diff --git a/packages/agent-runtime/src/codex/adapter.test.ts b/packages/agent-runtime/src/codex/adapter.test.ts index b1cf530825..717cfdca17 100644 --- a/packages/agent-runtime/src/codex/adapter.test.ts +++ b/packages/agent-runtime/src/codex/adapter.test.ts @@ -5117,49 +5117,48 @@ describe("codex provider adapter", () => { }); }); - it("merges sparse Codex rolling rate-limit updates", () => { + it("hydrates Codex rate limits before merging truly sparse rolling updates", () => { const adapter = createCodexProviderAdapter(); - adapter.translateEvent( - codexEvent("account/rateLimits/updated", { - rateLimits: { - limitId: "codex", - limitName: "Codex", - primary: { - usedPercent: 20, - windowDurationMins: 300, - resetsAt: 1_781_120_400, - }, - secondary: { - usedPercent: 100, - windowDurationMins: 10_080, - resetsAt: 1_781_720_400, - }, - credits: null, - individualLimit: null, - planType: "pro", - rateLimitReachedType: "rate_limit_reached", - }, - }), - ); + const requests = adapter.buildPostInitializeRequests?.() ?? []; + expect(requests).toHaveLength(1); + const [rateLimitRead] = requests; + if (rateLimitRead === undefined) { + throw new Error("Expected a Codex rate-limit hydration request"); + } + expect(rateLimitRead).toMatchObject({ + plan: { kind: "request", method: "account/rateLimits/read" }, + required: false, + }); + rateLimitRead.onResult({ + rateLimits: { + limitId: "codex", + limitName: "Codex", + primary: { + usedPercent: 20, + resetsAt: 1_781_120_400, + }, + secondary: { + usedPercent: 100, + windowDurationMins: 10_080, + resetsAt: 1_781_720_400, + }, + planType: "pro", + rateLimitReachedType: "rate_limit_reached", + }, + }); - const [sparseEvent] = adapter.translateEvent( - codexEvent("account/rateLimits/updated", { + const [sparseEvent] = adapter.translateEvent({ + jsonrpc: "2.0", + method: "account/rateLimits/updated", + params: { rateLimits: { - limitId: null, - limitName: null, primary: { usedPercent: 25, - windowDurationMins: 300, resetsAt: 1_781_120_400, }, - secondary: null, - credits: null, - individualLimit: null, - planType: null, - rateLimitReachedType: null, }, - }), - ); + }, + }); expect(sparseEvent).toMatchObject({ type: "provider/rateLimits/updated", rateLimits: { @@ -5177,24 +5176,18 @@ describe("codex provider adapter", () => { }, }); - const [resetEvent] = adapter.translateEvent( - codexEvent("account/rateLimits/updated", { + const [resetEvent] = adapter.translateEvent({ + jsonrpc: "2.0", + method: "account/rateLimits/updated", + params: { rateLimits: { - limitId: null, - limitName: null, - primary: null, secondary: { usedPercent: 30, - windowDurationMins: 10_080, resetsAt: 1_781_720_400, }, - credits: null, - individualLimit: null, - planType: null, - rateLimitReachedType: null, }, - }), - ); + }, + }); expect(resetEvent).toMatchObject({ type: "provider/rateLimits/updated", rateLimits: { diff --git a/packages/agent-runtime/src/codex/adapter.ts b/packages/agent-runtime/src/codex/adapter.ts index c37dc6b5f3..eaf6d809f9 100644 --- a/packages/agent-runtime/src/codex/adapter.ts +++ b/packages/agent-runtime/src/codex/adapter.ts @@ -63,6 +63,7 @@ import type { } from "../runtime-json-rpc.js"; import type { AgentRuntimeSkillRoot } from "../types.js"; import { + applyCodexRateLimitUpdate, createCodexEventTranslationState, translateCodexEvent, } from "./event-translation.js"; @@ -72,6 +73,7 @@ import { } from "./interactive-requests.js"; import { codexBridgeEnvelopeSchema, + codexRateLimitReadResponseSchema, codexRawResponseItemCompletedParamsSchema, codexThreadClosedParamsSchema, } from "./schemas.js"; @@ -1862,6 +1864,25 @@ export function createCodexProviderAdapter( args: opts?.processArgs ?? ["app-server"], }, + buildPostInitializeRequests() { + return [ + { + plan: { + kind: "request", + method: "account/rateLimits/read", + }, + required: false, + onResult(result: unknown) { + const response = codexRateLimitReadResponseSchema.parse(result); + applyCodexRateLimitUpdate( + eventTranslationState, + response.rateLimits, + ); + }, + }, + ]; + }, + buildCommandPlan(command: AdapterCommand): ProviderCommandPlan { switch (command.type) { case "initialize": diff --git a/packages/agent-runtime/src/codex/event-translation.ts b/packages/agent-runtime/src/codex/event-translation.ts index 773f284dfb..d9cd73beb6 100644 --- a/packages/agent-runtime/src/codex/event-translation.ts +++ b/packages/agent-runtime/src/codex/event-translation.ts @@ -34,6 +34,7 @@ import { type CodexItemStatus, type CodexParsedUserInput, type CodexRateLimitSnapshot, + type CodexRateLimitSnapshotUpdate, type CodexTurnStatus, } from "./schemas.js"; import { codexVisibilityMetadata } from "./visibility.js"; @@ -105,25 +106,23 @@ function codexReachedReasonIsActive( function mergeCodexRateLimitSnapshot( previous: CodexRateLimitSnapshot | null, - update: CodexRateLimitSnapshot, + update: CodexRateLimitSnapshotUpdate, ): CodexRateLimitSnapshot { - if (previous === null) { - return update; - } - const merged: CodexRateLimitSnapshot = { - limitId: update.limitId ?? previous.limitId, - limitName: update.limitName ?? previous.limitName, - primary: update.primary ?? previous.primary, - secondary: update.secondary ?? previous.secondary, - credits: update.credits ?? previous.credits, - individualLimit: update.individualLimit ?? previous.individualLimit, - planType: update.planType ?? previous.planType, - rateLimitReachedType: update.rateLimitReachedType, + limitId: update.limitId ?? previous?.limitId ?? null, + limitName: update.limitName ?? previous?.limitName ?? null, + primary: update.primary ?? previous?.primary ?? null, + secondary: update.secondary ?? previous?.secondary ?? null, + credits: update.credits ?? previous?.credits ?? null, + individualLimit: + update.individualLimit ?? previous?.individualLimit ?? null, + planType: update.planType ?? previous?.planType ?? null, + rateLimitReachedType: update.rateLimitReachedType ?? null, }; if ( merged.rateLimitReachedType === null && - previous.rateLimitReachedType !== null && + previous?.rateLimitReachedType !== null && + previous?.rateLimitReachedType !== undefined && codexReachedReasonIsActive(merged, previous.rateLimitReachedType) ) { merged.rateLimitReachedType = previous.rateLimitReachedType; @@ -131,6 +130,15 @@ function mergeCodexRateLimitSnapshot( return merged; } +export function applyCodexRateLimitUpdate( + state: CodexEventTranslationState, + update: CodexRateLimitSnapshotUpdate, +): CodexRateLimitSnapshot { + const rateLimits = mergeCodexRateLimitSnapshot(state.rateLimits, update); + state.rateLimits = rateLimits; + return rateLimits; +} + function normalizeCodexRateLimits( snapshot: CodexRateLimitSnapshot, ): ProviderRateLimitState { @@ -750,11 +758,10 @@ export function translateCodexEvent( const handledEvent: CodexHandledEvent = parsed.data; switch (handledEvent.method) { case "account/rateLimits/updated": { - const rateLimits = mergeCodexRateLimitSnapshot( - state.rateLimits, + const rateLimits = applyCodexRateLimitUpdate( + state, handledEvent.params.rateLimits, ); - state.rateLimits = rateLimits; return [ { type: "provider/rateLimits/updated", diff --git a/packages/agent-runtime/src/codex/schemas.ts b/packages/agent-runtime/src/codex/schemas.ts index ea9ce0ec50..909bcd8bf7 100644 --- a/packages/agent-runtime/src/codex/schemas.ts +++ b/packages/agent-runtime/src/codex/schemas.ts @@ -740,46 +740,73 @@ function createCodexEventSchema< const codexRateLimitWindowSchema = z .object({ usedPercent: z.number(), - windowDurationMins: z.number().nullable(), - resetsAt: z.number().nullable(), + windowDurationMins: z.number().nullable().optional(), + resetsAt: z.number().nullable().optional(), + }) + .passthrough() + .transform((window) => ({ + usedPercent: window.usedPercent, + windowDurationMins: window.windowDurationMins ?? null, + resetsAt: window.resetsAt ?? null, + })); + +const codexCreditsSnapshotSchema = z + .object({ + hasCredits: z.boolean(), + unlimited: z.boolean(), + balance: z.string().nullable().optional(), + }) + .passthrough() + .transform((credits) => ({ + hasCredits: credits.hasCredits, + unlimited: credits.unlimited, + balance: credits.balance ?? null, + })); + +const codexSpendControlLimitSnapshotSchema = z + .object({ + limit: z.string(), + used: z.string(), + remainingPercent: z.number(), + resetsAt: z.number(), }) .passthrough(); -const codexRateLimitSnapshotSchema = z +export const codexRateLimitSnapshotUpdateSchema = z .object({ - limitId: z.string().nullable(), - limitName: z.string().nullable(), - primary: codexRateLimitWindowSchema.nullable(), - secondary: codexRateLimitWindowSchema.nullable(), - credits: z - .object({ - hasCredits: z.boolean(), - unlimited: z.boolean(), - balance: z.string().nullable(), - }) - .passthrough() - .nullable(), - individualLimit: z - .object({ - limit: z.string(), - used: z.string(), - remainingPercent: z.number(), - resetsAt: z.number(), - }) - .passthrough() - .nullable(), - planType: z.string().nullable(), - rateLimitReachedType: z.string().nullable(), + limitId: z.string().nullable().optional(), + limitName: z.string().nullable().optional(), + primary: codexRateLimitWindowSchema.nullable().optional(), + secondary: codexRateLimitWindowSchema.nullable().optional(), + credits: codexCreditsSnapshotSchema.nullable().optional(), + individualLimit: codexSpendControlLimitSnapshotSchema.nullable().optional(), + planType: z.string().nullable().optional(), + rateLimitReachedType: z.string().nullable().optional(), }) .passthrough(); -export type CodexRateLimitSnapshot = z.infer< - typeof codexRateLimitSnapshotSchema +export type CodexRateLimitSnapshotUpdate = z.infer< + typeof codexRateLimitSnapshotUpdateSchema >; +export interface CodexRateLimitSnapshot { + limitId: string | null; + limitName: string | null; + primary: z.output<typeof codexRateLimitWindowSchema> | null; + secondary: z.output<typeof codexRateLimitWindowSchema> | null; + credits: z.output<typeof codexCreditsSnapshotSchema> | null; + individualLimit: z.output<typeof codexSpendControlLimitSnapshotSchema> | null; + planType: string | null; + rateLimitReachedType: string | null; +} + +export const codexRateLimitReadResponseSchema = z + .object({ rateLimits: codexRateLimitSnapshotUpdateSchema }) + .passthrough(); + export const codexHandledEventSchema = z.discriminatedUnion("method", [ createCodexEventSchema( "account/rateLimits/updated", - z.object({ rateLimits: codexRateLimitSnapshotSchema }).passthrough(), + z.object({ rateLimits: codexRateLimitSnapshotUpdateSchema }).passthrough(), ), createCodexEventSchema( "turn/started", diff --git a/packages/agent-runtime/src/provider-adapter.ts b/packages/agent-runtime/src/provider-adapter.ts index 8339f50394..6da39c3574 100644 --- a/packages/agent-runtime/src/provider-adapter.ts +++ b/packages/agent-runtime/src/provider-adapter.ts @@ -61,6 +61,12 @@ export type ProviderCommandPlan = | ProviderRequestCommandPlan | ProviderNoopCommandPlan; +export interface ProviderPostInitializeRequest { + plan: ProviderRequestCommandPlan; + required: boolean; + onResult(result: unknown): void; +} + export type ProviderInteractiveResponse = | boolean | number @@ -250,6 +256,13 @@ export interface ProviderAdapter { process: { command: string; args: string[]; env?: Record<string, string> }; buildCommandPlan(command: AdapterCommand): ProviderCommandPlan; + /** + * Optional provider-specific reads performed after the protocol initialize + * request and before any thread work starts. Best-effort requests let newer + * providers hydrate adapter-local state without making older provider + * versions unusable when they do not implement the read. + */ + buildPostInitializeRequests?(): readonly ProviderPostInitializeRequest[]; /** * Called immediately before a turn/start request is sent. Some providers * emit turn/started before the request promise resolves, so adapters that diff --git a/packages/agent-runtime/src/runtime-provider-process.ts b/packages/agent-runtime/src/runtime-provider-process.ts index 78c6f21986..345ab83d57 100644 --- a/packages/agent-runtime/src/runtime-provider-process.ts +++ b/packages/agent-runtime/src/runtime-provider-process.ts @@ -183,6 +183,21 @@ export class RuntimeProviderProcessManager { }); } + for (const request of adapter.buildPostInitializeRequests?.() ?? []) { + try { + const result = await sendJsonRpcRequest({ + child: providerProcess.child, + message: request.plan, + pending: providerProcess.pending, + getNextId: this.args.getNextRequestId, + resultSchema: ignoredJsonRpcResultSchema, + }); + request.onResult(result); + } catch (error) { + if (request.required) throw error; + } + } + const providerSkillRoots = filterSkillRootsForProvider({ providerId: args.providerId, skillRoots: this.args.skillRoots, diff --git a/packages/agent-runtime/src/runtime.command-contract.test.ts b/packages/agent-runtime/src/runtime.command-contract.test.ts index a2f5a1edb7..2150ed4c21 100644 --- a/packages/agent-runtime/src/runtime.command-contract.test.ts +++ b/packages/agent-runtime/src/runtime.command-contract.test.ts @@ -478,6 +478,11 @@ rl.on("line", (line) => { return; } + if (message.method === "account/rateLimits/read") { + send({ jsonrpc: "2.0", id: message.id, result: { rateLimits: {} } }); + return; + } + if (message.method === "thread/start") { send({ jsonrpc: "2.0", @@ -572,6 +577,10 @@ rl.on("line", (line) => { send({ jsonrpc: "2.0", id: message.id, result: {} }); return; } + if (message.method === "account/rateLimits/read") { + send({ jsonrpc: "2.0", id: message.id, result: { rateLimits: {} } }); + return; + } if (message.method === "thread/start") { fs.writeFileSync(threadStartLogPath, JSON.stringify(message.params), "utf8"); send({ @@ -794,6 +803,10 @@ rl.on("line", (line) => { send({ jsonrpc: "2.0", id: message.id, result: {} }); return; } + if (message.method === "account/rateLimits/read") { + send({ jsonrpc: "2.0", id: message.id, result: { rateLimits: {} } }); + return; + } if (message.method === "thread/start") { send({ jsonrpc: "2.0", diff --git a/packages/agent-runtime/src/runtime.process-lifecycle.test.ts b/packages/agent-runtime/src/runtime.process-lifecycle.test.ts index 40b056e5b7..b4757375bc 100644 --- a/packages/agent-runtime/src/runtime.process-lifecycle.test.ts +++ b/packages/agent-runtime/src/runtime.process-lifecycle.test.ts @@ -1241,6 +1241,55 @@ rl.on("line", (line) => { await runtime.shutdown(); }); + it("continues startup when an optional post-initialize read is unsupported", async () => { + const unsupportedReadScript = join(tmpDir, "unsupported-startup-read.cjs"); + writeFileSync( + unsupportedReadScript, + `const readline = require("readline").createInterface({ input: process.stdin }); + readline.on("line", (line) => { + const msg = JSON.parse(line); + if (msg.method === "initialize") { + process.stdout.write(JSON.stringify({ jsonrpc: "2.0", id: msg.id, result: {} }) + "\\n"); + return; + } + if (msg.method === "account/rateLimits/read") { + process.stdout.write(JSON.stringify({ + jsonrpc: "2.0", + id: msg.id, + error: { code: -32601, message: "Method not found" } + }) + "\\n"); + } + });`, + ); + const onResult = vi.fn(); + const baseAdapter = createFakeAdapter(unsupportedReadScript); + const adapter: ProviderAdapter = { + ...baseAdapter, + buildPostInitializeRequests: () => [ + { + plan: { kind: "request", method: "account/rateLimits/read" }, + required: false, + onResult, + }, + ], + }; + const runtime = createAgentRuntimeWithAdapters({ + workspacePath: tmpDir, + onEvent: () => {}, + onToolCall: async () => ({ + contentItems: [{ type: "inputText", text: "ok" }], + success: true, + }), + adapterFactory: () => adapter, + }); + + await expect( + runtime.ensureProvider({ providerId: "fake" }), + ).resolves.toBeUndefined(); + expect(onResult).not.toHaveBeenCalled(); + await runtime.shutdown(); + }); + it("fails fast when provider crashes during initialize", async () => { const crashOnInitScript = join(tmpDir, "crash-on-init.cjs"); writeFileSync( From 825ed792015584ad47f15d501eed516fcc9bf9db Mon Sep 17 00:00:00 2001 From: Michael Yong <wrong92@gmail.com> Date: Thu, 6 Aug 2026 15:49:16 -0700 Subject: [PATCH 21/21] fix(provider-retry): stop retrying continuation failures --- plugins/provider-retry/app.test.tsx | 31 +++++++++++ plugins/provider-retry/app.tsx | 9 ++- plugins/provider-retry/server.test.ts | 68 ++++++++++++++++++++++- plugins/provider-retry/src/cli.ts | 6 ++ plugins/provider-retry/src/contract.ts | 2 + plugins/provider-retry/src/service.ts | 77 ++++++++++++++++++-------- 6 files changed, 169 insertions(+), 24 deletions(-) diff --git a/plugins/provider-retry/app.test.tsx b/plugins/provider-retry/app.test.tsx index e68dc5678d..0fb91fe243 100644 --- a/plugins/provider-retry/app.test.tsx +++ b/plugins/provider-retry/app.test.tsx @@ -22,6 +22,7 @@ const waitingView: ProviderRetryView = { reachedReason: "rate_limit_reached", overageReason: null, recoveryReason: "eligible", + continuationError: null, refreshError: null, }; @@ -127,6 +128,36 @@ describe("provider retry app", () => { ).toBeTruthy(); }); + it("explains when automatic continuation stops after an error", async () => { + const failedView: ProviderRetryView = { + ...waitingView, + phase: "retry-failed", + dueAtMs: null, + continuationError: "This thread is awaiting user interaction", + }; + const slot = renderSlot( + banner, + {}, + { + composer: { scope: { kind: "thread", threadId: "thread-one" } }, + rpc: { + providerRetryStatus: () => ({ view: failedView }), + providerRetryNow: () => ({ started: false, view: failedView }), + providerRetryCancel: () => ({ cancelled: true }), + providerRetryRefresh: () => ({ view: failedView }), + }, + }, + ); + + expect( + await slot.findByText(/bb could not continue automatically/i), + ).toBeTruthy(); + expect( + slot.getByText(/This thread is awaiting user interaction/i), + ).toBeTruthy(); + expect(slot.getByRole("button", { name: "Retry now" })).toBeTruthy(); + }); + it("keeps the banner when cancellation loses to an in-progress release", async () => { const slot = renderSlot( banner, diff --git a/plugins/provider-retry/app.tsx b/plugins/provider-retry/app.tsx index d09f01855e..91b6c95b9a 100644 --- a/plugins/provider-retry/app.tsx +++ b/plugins/provider-retry/app.tsx @@ -45,6 +45,9 @@ function limitDescription(view: ProviderRetryView): string { if (view.phase === "waiting-for-host") { return `${provider}${window} usage limit reset passed. This thread will continue when its host reconnects, while this bb server remains running.`; } + if (view.phase === "retry-failed") { + return `${provider}${window} usage is available, but bb could not continue automatically${view.continuationError ? `: ${view.continuationError}` : ""}. Resolve the issue, then retry.`; + } if (view.phase === "releasing") { return `${provider}${window} usage is available. Continuing this thread…`; } @@ -120,7 +123,11 @@ function ProviderRetryBannerForThread({ threadId }: { threadId: string }) { } else if (action === "now") { const result = await rpc.call("providerRetryNow", { threadId }); setView(result.view); - if (!result.started) { + if ( + !result.started && + result.view?.phase !== "retry-failed" && + result.view?.phase !== "waiting-for-host" + ) { setActionError("This turn is no longer safe to continue."); } } else { diff --git a/plugins/provider-retry/server.test.ts b/plugins/provider-retry/server.test.ts index b309f23211..2fcfa3de41 100644 --- a/plugins/provider-retry/server.test.ts +++ b/plugins/provider-retry/server.test.ts @@ -473,7 +473,12 @@ describe("provider retry scheduler", () => { it("retains a job while the host is unavailable and retries on host change", async () => { const continueAfterRateLimit = vi .fn() - .mockRejectedValueOnce(new Error("Host is not connected")) + .mockRejectedValueOnce( + Object.assign(new Error("Host is not connected"), { + code: "host_unavailable", + status: 502, + }), + ) .mockResolvedValueOnce({ ok: true, requestId: "continuation-request" }); const subscription = { hostChanged: null as @@ -514,6 +519,8 @@ describe("provider retry scheduler", () => { threadId: "thread-host", }), ).toMatchObject({ view: { phase: "waiting-for-host" } }); + await vi.advanceTimersByTimeAsync(24 * 60 * 60 * 1_000); + expect(continueAfterRateLimit).toHaveBeenCalledTimes(1); expect(subscription.hostChanged).not.toBeNull(); subscription.hostChanged?.(["host-disconnected"]); await vi.advanceTimersByTimeAsync(0); @@ -527,6 +534,65 @@ describe("provider retry scheduler", () => { await host.harness.dispose(); }); + it("stops automatic retries after a non-host continuation failure", async () => { + const continueAfterRateLimit = vi.fn(async () => { + throw Object.assign( + new Error("This thread is awaiting user interaction"), + { + code: "awaiting_user_interaction", + status: 409, + }, + ); + }); + const host = createFakePluginHost({ + pluginId: "provider-retry", + sdk: { + threads: { + rateLimitRecovery: async ({ threadId }) => eligibleStatus(threadId), + continueAfterRateLimit, + }, + }, + }); + await plugin(host.bb); + await host.harness.emitThreadEvent("thread.failed", { + thread: makeThreadResponse({ id: "thread-failed", status: "error" }), + error: "Usage limit reached", + }); + await vi.advanceTimersByTimeAsync(5 * 60 * 60 * 1_000 + RESET_BUFFER_MS); + + await expect( + host.harness.callRpc("providerRetryStatus", { + threadId: "thread-failed", + }), + ).resolves.toMatchObject({ + view: { + phase: "retry-failed", + dueAtMs: null, + continuationError: "This thread is awaiting user interaction", + }, + }); + expect(continueAfterRateLimit).toHaveBeenCalledOnce(); + + await vi.advanceTimersByTimeAsync(24 * 60 * 60 * 1_000); + await host.harness.emitThreadEvent("thread.failed", { + thread: makeThreadResponse({ id: "thread-failed", status: "error" }), + error: "Usage limit reached", + }); + await vi.advanceTimersByTimeAsync(0); + expect(continueAfterRateLimit).toHaveBeenCalledOnce(); + + await expect( + host.harness.callRpc("providerRetryNow", { + threadId: "thread-failed", + }), + ).resolves.toMatchObject({ + started: false, + view: { phase: "retry-failed" }, + }); + expect(continueAfterRateLimit).toHaveBeenCalledTimes(2); + await host.harness.dispose(); + }); + it("clears in-memory timers when the plugin is disposed", async () => { const continueAfterRateLimit = vi.fn(); const host = createFakePluginHost({ diff --git a/plugins/provider-retry/src/cli.ts b/plugins/provider-retry/src/cli.ts index 0c3015a80d..40109f866c 100644 --- a/plugins/provider-retry/src/cli.ts +++ b/plugins/provider-retry/src/cli.ts @@ -7,6 +7,12 @@ function jsonResult(value: unknown) { } function textView(view: ProviderRetryView): string { + if (view.phase === "waiting-for-host") { + return `${view.threadId}\t${view.phase}\t${view.providerId}\twaiting for host`; + } + if (view.phase === "retry-failed") { + return `${view.threadId}\t${view.phase}\t${view.providerId}\t${view.continuationError ?? "automatic continuation failed"}`; + } const due = view.dueAtMs === null ? "no automatic reset" diff --git a/plugins/provider-retry/src/contract.ts b/plugins/provider-retry/src/contract.ts index 375a9e923d..73000105b3 100644 --- a/plugins/provider-retry/src/contract.ts +++ b/plugins/provider-retry/src/contract.ts @@ -4,6 +4,7 @@ import { z } from "zod"; export const providerRetryPhaseSchema = z.enum([ "waiting-for-reset", "waiting-for-host", + "retry-failed", "releasing", "blocked", "unsafe", @@ -26,6 +27,7 @@ export const providerRetryViewSchema = z reachedReason: z.string().min(1).nullable(), overageReason: z.string().min(1).nullable(), recoveryReason: z.string().min(1), + continuationError: z.string().min(1).nullable(), refreshError: z.string().min(1).nullable(), }) .strict(); diff --git a/plugins/provider-retry/src/service.ts b/plugins/provider-retry/src/service.ts index c562969222..05ffad34c7 100644 --- a/plugins/provider-retry/src/service.ts +++ b/plugins/provider-retry/src/service.ts @@ -13,7 +13,6 @@ type ProviderUsage = ProviderUsageResponse[keyof ProviderUsageResponse]; export const RESET_BUFFER_MS = 15_000; export const RESET_JITTER_MS = 30_000; export const RELEASE_PACE_MS = 1_000; -export const HOST_RETRY_MS = 30_000; const MAX_TIMER_DELAY_MS = 2_147_000_000; const REALTIME_CHANNEL = "provider-retry"; @@ -37,6 +36,15 @@ function errorMessage(error: unknown): string { return error instanceof Error ? error.message : String(error); } +function isHostUnavailableError(error: unknown): boolean { + return ( + typeof error === "object" && + error !== null && + "code" in error && + error.code === "host_unavailable" + ); +} + function refreshSupported(providerId: string): boolean { return providerId === "codex" || providerId === "claude-code"; } @@ -85,6 +93,7 @@ function recoveryView(args: { reachedReason: rateLimits?.reachedReason ?? null, overageReason: rateLimits?.overageReason ?? null, recoveryReason: args.status.reason, + continuationError: null, refreshError: null, }; } @@ -212,15 +221,19 @@ export class ProviderRetryService { let dueAtMs: number | null = null; let phase: ProviderRetryPhase = "blocked"; - if (candidate.automatic && candidate.resetsAtMs !== null) { - const sameCandidate = - existing?.candidate?.failedRequestId === candidate.failedRequestId && - existing.candidate.resetsAtMs === candidate.resetsAtMs; - if (status.rateLimits?.status === "allowed") { - dueAtMs = this.sources.now(); - } else if (sameCandidate && existing.view.phase === "waiting-for-host") { + let continuationError: string | null = null; + const sameCandidate = + existing?.candidate?.failedRequestId === candidate.failedRequestId && + existing.candidate.resetsAtMs === candidate.resetsAtMs; + if (sameCandidate && existing.view.phase === "retry-failed") { + phase = "retry-failed"; + continuationError = existing.view.continuationError; + } else if (candidate.automatic && candidate.resetsAtMs !== null) { + if (sameCandidate && existing.view.phase === "waiting-for-host") { dueAtMs = existing.view.dueAtMs; phase = "waiting-for-host"; + } else if (status.rateLimits?.status === "allowed") { + dueAtMs = this.sources.now(); } else if (sameCandidate && existing.view.dueAtMs !== null) { dueAtMs = existing.view.dueAtMs; } else { @@ -229,11 +242,12 @@ export class ProviderRetryService { RESET_BUFFER_MS + Math.floor(this.sources.random() * RESET_JITTER_MS); } - if (phase !== "waiting-for-host") phase = "waiting-for-reset"; + if (phase === "blocked") phase = "waiting-for-reset"; } + const view = recoveryView({ candidate, dueAtMs, phase, status, threadId }); this.upsert(threadId, { candidate, - view: recoveryView({ candidate, dueAtMs, phase, status, threadId }), + view: { ...view, continuationError }, }); return this.status(threadId); } @@ -343,7 +357,11 @@ export class ProviderRetryService { const now = this.sources.now(); for (const threadId of scope.threadIds) { const entry = this.entries.get(threadId); - if (!entry?.candidate?.automatic || entry.view.phase === "releasing") { + if ( + !entry?.candidate?.automatic || + entry.view.phase === "releasing" || + entry.view.phase === "retry-failed" + ) { continue; } entry.view = { @@ -365,7 +383,11 @@ export class ProviderRetryService { Math.floor(this.sources.random() * RESET_JITTER_MS); for (const threadId of scope.threadIds) { const entry = this.entries.get(threadId); - if (!entry?.candidate?.automatic || entry.view.phase === "releasing") { + if ( + !entry?.candidate?.automatic || + entry.view.phase === "releasing" || + entry.view.phase === "retry-failed" + ) { continue; } entry.view = { ...entry.view, dueAtMs, resetsAtMs: resetAtMs }; @@ -532,25 +554,36 @@ export class ProviderRetryService { `Provider retry status refresh for thread ${threadId} failed: ${errorMessage(inspectionError)}`, ); } - if (status?.candidate?.failedRequestId !== failedRequestId) { + if ( + status !== null && + status.candidate?.failedRequestId !== failedRequestId + ) { this.remove(threadId); return false; } const current = this.entries.get(threadId); if (!current) return false; - current.candidate = status.candidate; + if (status !== null) current.candidate = status.candidate; + const waitingForHost = + current.candidate?.automatic === true && isHostUnavailableError(error); + const refreshedView = + status === null + ? current.view + : recoveryView({ + candidate: status.candidate, + dueAtMs: null, + phase: waitingForHost ? "waiting-for-host" : "retry-failed", + status, + threadId, + }); current.view = { - ...recoveryView({ - candidate: status.candidate, - dueAtMs: this.sources.now() + HOST_RETRY_MS, - phase: "waiting-for-host", - status, - threadId, - }), + ...refreshedView, + dueAtMs: null, + phase: waitingForHost ? "waiting-for-host" : "retry-failed", + continuationError: waitingForHost ? null : errorMessage(error), refreshError: current.view.refreshError, }; this.publish(threadId); - this.schedule(current.view.scopeKey); return false; } }