import { AgentActivitySession, AgentActivitySlashCommandPolicy, SessionRuntimeAvailability, AgentActivityComposerOptionsLoadStatus, AgentActivityUsage, CanonicalAgentSession } from '@tutti-os/agent-activity-core'; import { j as AgentGUIProvider, h as AgentGUINodeData, c as AgentGUIAgentTarget, l as AgentGUIProviderRailMode, m as AgentGUIProviderReadinessGate } from './types.d-J0XWegqK.js'; import { A as AgentHostAgentSessionCommand, a as AgentHostAgentSessionComposerSettings, c as AgentHostAgentSessionReasoningEffort, d as AgentHostAgentSessionSpeed, b as AgentHostAgentSessionPermissionConfig, e as AgentPromptContentBlock } from './agentSession.d-4jwjFmc1.js'; import { A as AgentApprovalItemVM, a as AgentAskUserQuestionVM, b as AgentConversationPromptVM, c as AgentConversationVM, g as WorkspaceAgentSessionDetailViewModel } from './workspaceLinkActions.d-gJPVQnM0.js'; import { WorkspaceUserProjectService } from '@tutti-os/workspace-user-project/contracts'; declare const APP_ERROR_CODES: readonly ["common.invalid_input", "common.approved_path_required", "common.unavailable", "common.unexpected", "session.not_found", "control_surface.unauthorized", "workspace.select_directory_failed", "workspace.select_files_failed", "workspace.ensure_directory_failed", "workspace.import_files_failed", "workspace.read_file_failed", "workspace.write_file_failed", "workspace.export_file_failed", "workspace.copy_path_failed", "workspace.host_unsupported", "workspace.runtime_artifact_unavailable", "runtime.guest_agent_lane_unavailable", "workspace.room_full", "workspace.room_delete_forbidden", "workspace.room_delete_not_found", "filesystem.create_directory_failed", "filesystem.read_file_bytes_failed", "filesystem.read_file_text_failed", "filesystem.write_file_text_failed", "filesystem.copy_entry_failed", "filesystem.move_entry_failed", "filesystem.rename_entry_failed", "filesystem.delete_entry_failed", "filesystem.read_directory_failed", "filesystem.stat_failed", "terminal.spawn_failed", "terminal.write_failed", "terminal.resize_failed", "terminal.close_failed", "terminal.attach_failed", "terminal.detach_failed", "terminal.snapshot_failed", "agent.list_models_failed", "agent.launch_failed", "agent.read_last_message_failed", "agent.provider_session_not_found", "agent.resume_session_not_local", "agent.resume_session_resolve_failed", "agent.settings_require_new_session", "task.suggest_title_failed", "persistence.unavailable", "persistence.quota_exceeded", "persistence.payload_too_large", "persistence.io_failed", "persistence.invalid_state", "persistence.invalid_node_id", "update.get_state_failed", "update.configure_failed", "update.check_failed", "update.download_failed", "update.install_failed", "PACKAGE_DOWNLOAD_INTERRUPTED", "PACKAGE_DOWNLOAD_HTTP_STATUS", "PACKAGE_DOWNLOAD_INVALID", "PACKAGE_DOWNLOAD_DISK_ERROR"]; type AppErrorCode = (typeof APP_ERROR_CODES)[number]; type AppErrorParamValue = boolean | number | string | null; type AppErrorParams = Record; interface AppErrorDescriptor { code: AppErrorCode; params?: AppErrorParams; debugMessage?: string; } type AgentAvailabilityStatus = "available" | "unavailable" | "unknown"; type AgentQuotaType = "session" | "weekly" | "monthly" | "daily" | "model" | "credits" | "cost"; interface AgentAvailabilityCheck { name: string; passed: boolean; detail?: string; } interface AgentAvailability { status: AgentAvailabilityStatus; detailsVisible: boolean; checks?: AgentAvailabilityCheck[]; } interface AgentUsageQuota { quotaType: AgentQuotaType; percentRemaining?: number; /** Exact provider-neutral balance when percent alone loses useful detail. */ amountRemaining?: number; amountLimit?: number; amountUnit?: "credits"; resetsAtUnixMs?: number; resetText?: string; dollarRemaining?: number; modelName?: string; } interface AgentCostUsage { dollarUsed: number; dollarLimit?: number; } interface AgentUsageSnapshot { quotas?: AgentUsageQuota[]; accountTier?: string; /** Provider-neutral billing mode used when an account has no quota rows. */ billingMode?: "subscription" | "api" | "coding_plan" | "provider_account"; /** Whether quota rows are complete, unavailable, or not applicable. */ quotaState?: "complete" | "unavailable" | "not_applicable"; costUsage?: AgentCostUsage; capturedAtUnixMs: number; } interface AgentProbeAttempt { strategy: string; success: boolean; errorCode?: string; errorMessage?: string; } interface AgentProbeError { code: string; message?: string; } interface AgentProbeProvider { /** Exact Agent Target identity that produced this result. */ agentTargetId?: string; provider: string; availability: AgentAvailability; usage?: AgentUsageSnapshot; attempts?: AgentProbeAttempt[]; lastError?: AgentProbeError; } interface AgentProbeSnapshot { workspaceId: string; roomId?: string; capturedAtUnixMs: number; providers: AgentProbeProvider[]; } interface AgentHostListWorkspaceAgentProbesInput { workspaceId: string; /** Compatibility input while carried call sites finish migrating from TSH room naming. */ roomId?: string; /** Preferred exact identity. Provider-only requests remain compatibility input. */ agentTargetIds?: string[]; providers?: string[]; includeUsage?: boolean; refresh?: boolean; } type AgentHostWorkspaceAgentProbesResult = AgentProbeSnapshot; type PersistWriteLevel = "full" | "no_scrollback" | "settings_only"; type PersistWriteFailureReason = "unavailable" | "quota" | "payload_too_large" | "io" | "unknown"; type PersistWriteResult = { ok: true; level: PersistWriteLevel; bytes: number; revision?: number; } | { ok: false; reason: PersistWriteFailureReason; error: AppErrorDescriptor; }; type WorkspaceAgentReadStateKind = "completed" | "failed"; interface WorkspaceAgentReadStateBucket { readIds: string[]; unreadIds: string[]; } interface WorkspaceAgentReadStateSnapshot { completed: WorkspaceAgentReadStateBucket; failed: WorkspaceAgentReadStateBucket; } interface ReadWorkspaceAgentReadStateInput { roomId: string; userId: string; } interface WriteWorkspaceAgentReadStateInput extends ReadWorkspaceAgentReadStateInput { kind: WorkspaceAgentReadStateKind; readIds: string[]; unreadIds: string[]; } interface AgentHostUserInfo { userId: string; email?: string; avatar?: string; avatarObjectKey?: string; name?: string; } interface AgentHostBatchUserInfoInput { userIds: string[]; } interface AgentHostBatchUserInfoResult { users: AgentHostUserInfo[]; } interface ReadWorkspaceFileResult { bytes: Uint8Array; } type AgentHostAsyncResult = Promise; type AgentHostRecord = Record; type AgentHostUnsubscribe = () => void; type AgentHostClipboardApi = { writeImage?: (input: { data: string; mimeType: "image/png"; }) => AgentHostAsyncResult; writeText: (text: string) => AgentHostAsyncResult; }; type AgentHostTerminalLoginHandle = { close: () => void; completion: Promise<"ready" | "timed_out" | "unavailable">; }; type AgentHostTerminalStartupAction = { type: "slash_command"; commandName: string; readyText: string; }; type AgentHostTerminalLoginApi = { supportedStartupActionTypes?: readonly AgentHostTerminalStartupAction["type"][]; run: (input: { agentTargetId: string; command: string; cwd?: string; startupAction?: AgentHostTerminalStartupAction; }) => AgentHostAsyncResult; }; type AgentHostDebugApi = { logRuntimeDiagnostics: (payload: unknown) => AgentHostAsyncResult | void; logTerminalDiagnostics?: (payload: unknown) => AgentHostAsyncResult | void; }; type AgentHostFilesystemApi = AgentHostRecord & { readFileText: (payload: { path?: string; uri?: string; }) => AgentHostAsyncResult<{ content: string; name?: string; path?: string; }>; }; type AgentHostMetaApi = AgentHostRecord & { appVersion?: string | null; isPackaged?: boolean; isTest?: boolean; mainPid?: number | null; platform?: string; workspaceId?: string; }; type AgentHostEnvironmentApi = AgentHostRecord & { getBaseUrl?: () => AgentHostAsyncResult; }; interface AgentHostQuickPrompt { id: string; title: string; content: string; version: number; createdAtUnixMs: number; updatedAtUnixMs: number; } interface AgentHostQuickPromptSnapshot { enabled: boolean; status: "idle" | "loading" | "ready" | "error"; prompts: readonly AgentHostQuickPrompt[]; error: string | null; revision: number; pendingMutationIds: readonly string[]; orderMutationPending?: boolean; } interface AgentHostQuickPromptsApi { ensureLoaded: (input?: { force?: boolean; }) => AgentHostAsyncResult; getSnapshot: () => AgentHostQuickPromptSnapshot; subscribe: (listener: (snapshot: AgentHostQuickPromptSnapshot) => void) => AgentHostUnsubscribe; create: (input: { title: string; content: string; }) => AgentHostAsyncResult; update: (input: { id: string; title: string; content: string; expectedVersion: number; }) => AgentHostAsyncResult; remove: (input: { id: string; expectedVersion: number; }) => AgentHostAsyncResult; move?: (input: { promptId: string; beforePromptId: string | null; expectedVersion: number; }) => AgentHostAsyncResult; } type AgentHostPersistenceApi = AgentHostRecord & { readWorkspaceAgentReadState: (input: ReadWorkspaceAgentReadStateInput) => AgentHostAsyncResult; writeWorkspaceAgentReadState: (input: WriteWorkspaceAgentReadStateInput) => AgentHostAsyncResult; }; type AgentHostToastHandle = { /** Settles the toast to a neutral, non-error, non-success tone. */ info: (title: string, description?: string) => void; /** Settles the toast to the destructive tone. */ reject: (title: string, description?: string) => void; /** Settles the toast to the success tone. */ resolve: (title: string, description?: string) => void; }; type AgentHostToastApi = AgentHostRecord & { error: (title: string, description?: string) => void; info?: (title: string, description?: string) => void; /** * Opens one toast that stays mounted across async work: it shows busy * (spinner, no auto-dismiss) until the returned handle settles it in * place, at which point it starts auto-dismissing like any other toast. */ loading?: (title: string) => AgentHostToastHandle; success?: (title: string, description?: string) => void; }; interface AgentHostSelectedFile { name?: string; path: string; } interface AgentHostSelectFilesInput { allowDirectories?: boolean; } interface AgentHostApplyWorkspaceGitPatchInput { allowBinary?: boolean; atomic?: boolean; cwd: string; diff: string; revert?: boolean; target?: "unstaged" | "staged" | "staged-and-unstaged"; } interface AgentHostApplyWorkspaceGitPatchResult { status: "success" | "partial-success" | "error"; appliedPaths: string[]; skippedPaths: string[]; conflictedPaths: string[]; errorCode?: "not-git-repo" | string; execOutput?: { command: string; stdout: string; stderr: string; }; } interface AgentHostResolveWorkspaceGitPatchSupportInput { cwd: string; } interface AgentHostResolveWorkspaceGitPatchSupportResult { supported: boolean; root?: string; errorCode?: "not-git-repo" | string; } interface AgentHostResolveSessionWorktreeSupportInput { agentTargetId: string; cwd: string; } interface AgentHostResolveSessionWorktreeSupportResult { supported: boolean; root?: string; errorCode?: "git-unavailable" | "not-git-repo" | "unsupported-repo-layout" | string; } type AgentHostWorkspaceApi = AgentHostRecord & { applyGitPatch?: (input: AgentHostApplyWorkspaceGitPatchInput) => AgentHostAsyncResult; resolveGitPatchSupport?: (input: AgentHostResolveWorkspaceGitPatchSupportInput) => AgentHostAsyncResult; resolveSessionWorktreeSupport?: (input: AgentHostResolveSessionWorktreeSupportInput) => AgentHostAsyncResult; copyPath?: (input: { path: string; }) => AgentHostAsyncResult; ensureDirectory: (input: { path: string; }) => AgentHostAsyncResult; readFile: (input: { path: string; }) => AgentHostAsyncResult; selectContextEntries?: () => AgentHostAsyncResult<{ entries: unknown[]; }>; selectDirectory: () => AgentHostAsyncResult<{ path: string; } | null>; selectFiles: (input?: AgentHostSelectFilesInput) => AgentHostAsyncResult; writeFileText: (input: { content: string; path: string; }) => AgentHostAsyncResult; }; interface AgentHostInputApi { account?: AgentHostAccountApi; agentTargetSetup?: AgentHostAgentTargetSetupApi; clipboard: AgentHostClipboardApi; debug?: AgentHostDebugApi; filesystem: AgentHostFilesystemApi; meta?: AgentHostMetaApi; onHostEvent?: (listener: (event: any) => void) => AgentHostUnsubscribe; persistence?: AgentHostPersistenceApi; quickPrompts?: AgentHostQuickPromptsApi; runtime?: AgentHostEnvironmentApi; terminalLogin?: AgentHostTerminalLoginApi; toast?: AgentHostToastApi; userProjects?: AgentHostUserProjectsApi; workspace: AgentHostWorkspaceApi; workspaceAgentProbes?: AgentHostWorkspaceAgentProbesApi; } type AgentHostAccountApi = AgentHostRecord & { batchGetUserInfo: (input: AgentHostBatchUserInfoInput) => AgentHostAsyncResult; ensureProfiles?: (input: any) => AgentHostAsyncResult; }; type AgentHostWorkspaceAgentProbesApi = AgentHostRecord & { list: (input: AgentHostListWorkspaceAgentProbesInput) => AgentHostAsyncResult; }; interface AgentHostAgentTargetInstallPlan { packageName: string; packageVersion: string; runner: "npm" | "pnpm" | "uv" | "binary"; planDigest: string; installRoot: string; } interface AgentHostAgentTargetSetupAction { actionId: string; clientActionId: string; kind: "install" | "authenticate"; status: "queued" | "running" | "succeeded" | "failed" | "interrupted"; phase: "preparing" | "installing" | "verifying" | "probing" | "activating" | "authenticating" | "complete"; errorCode: string | null; errorMessage: string | null; } interface AgentHostAgentTargetSetupSnapshot { agentTargetId: string; status: "ready" | "auth_required" | "not_installed" | "installing" | "authenticating" | "failed"; runtimeSource: "local" | "managed" | null; runtimeVersion: string | null; reason: string | null; authMethods: AgentHostAgentTargetAuthMethod[]; account: AgentHostAgentTargetAuthenticatedAccount | null; plan: AgentHostAgentTargetInstallPlan | null; action: AgentHostAgentTargetSetupAction | null; } interface AgentHostAgentTargetAuthenticatedAccount { id: string; displayName: string; authMethodId: string; organization: string | null; } interface AgentHostAgentTargetAuthMethod { id: string; name: string; description?: string | null; /** Provider-declared method kind (for example "terminal"). */ type?: string | null; /** Ready-to-run interactive sign-in launch command for terminal-type methods. */ terminalCommand?: string | null; /** Optional typed action submitted after the terminal runtime is ready. */ terminalStartupAction?: AgentHostTerminalStartupAction | null; } interface AgentHostAgentTargetSetupState { snapshot: AgentHostAgentTargetSetupSnapshot | null; loading: boolean; failed: boolean; } interface AgentHostAgentTargetSetupWatch { getSnapshot: () => AgentHostAgentTargetSetupState; subscribe: (listener: (state: AgentHostAgentTargetSetupState) => void) => AgentHostUnsubscribe; install: (input: { planDigest: string; clientActionId: string; }) => AgentHostAsyncResult; authenticate: (input: { methodId: string; clientActionId: string; }) => AgentHostAsyncResult; refresh: () => AgentHostAsyncResult; } type AgentHostAgentTargetSetupApi = AgentHostRecord & { watch: (input: { agentTargetId: string; }) => AgentHostAgentTargetSetupWatch; }; interface AgentHostUserProject { id: string; path: string; label: string; pinnedAtUnixMs: number; sectionKey?: string; createdAtUnixMs?: number; updatedAtUnixMs?: number; lastUsedAtUnixMs?: number; } type AgentHostUserProjectsApi = AgentHostRecord & { service?: WorkspaceUserProjectService; checkPath?: (input: { path: string; }) => AgentHostAsyncResult<{ exists: boolean; isDirectory: boolean; path: string; }>; create?: (input: { name: string; }) => AgentHostAsyncResult; getDefaultSelection?: () => AgentHostAsyncResult<{ path: string | null; } | null>; list: () => AgentHostAsyncResult<{ projects: AgentHostUserProject[]; }>; move?: (input: { beforeProjectId: string | null; projectId: string; }) => AgentHostAsyncResult; pin: (input: { pinned: boolean; projectId: string; }) => AgentHostAsyncResult; subscribe?: (listener: () => void) => AgentHostUnsubscribe; prepareSelection?: (input: { projectLocked: boolean; selectedPath: string | null; }) => AgentHostAsyncResult<{ isSelectedPathMissing: boolean; projects: AgentHostUserProject[]; selection: { kind: "clear"; suppressedPath: string; } | { kind: "none"; } | { kind: "select"; path: string; }; }>; remove?: (input: { path: string; }) => AgentHostAsyncResult; isNoProjectPath?: (input: { path: string; }) => boolean; rememberDefaultSelection?: (input: { path: string | null; }) => AgentHostAsyncResult; use: (input: { path: string; }) => AgentHostAsyncResult; }; interface AgentMessageMarkdownWorkspaceAppIcon { appId: string; iconUrl: string | null; workspaceId?: string | null; } type AgentSessionCommand = AgentHostAgentSessionCommand; type AgentSessionComposerSettings = AgentHostAgentSessionComposerSettings; type AgentSessionPermissionConfig = AgentHostAgentSessionPermissionConfig; type AgentSessionReasoningEffort = AgentHostAgentSessionReasoningEffort; type AgentSessionSpeed = AgentHostAgentSessionSpeed; type AgentGUIResolvedProvider = AgentGUIProvider | "unknown"; type AgentGUIConversationTitleFallback = "untitled-conversation" | null; type AgentGUIConversationTitleLeadingMentionKind = "agent" | "app" | "file" | "session" | "task"; interface AgentGUIConversationProjectSummary { id: string; path: string; label: string; sectionKey?: string; createdAtUnixMs?: number; updatedAtUnixMs?: number; lastUsedAtUnixMs?: number; pinnedAtUnixMs: number; } type AgentGUIConversationUserProject = Pick; type AgentGUIConversationFilter = { kind: "all"; } | { kind: "agentTarget"; agentTargetId: string; }; interface AgentGUIConversationSummary { id: string; userId?: string; agentTargetId?: string | null; provider: AgentGUIResolvedProvider; resumable?: boolean; title: string; titleLeadingMentionKind?: AgentGUIConversationTitleLeadingMentionKind | null; titleFallback?: AgentGUIConversationTitleFallback; status: AgentGUIConversationStatus; cwd: string; isolation?: AgentActivitySession["isolation"]; railSectionKey?: string; project?: AgentGUIConversationProjectSummary | null; pinnedAtUnixMs?: number | null; sortTimeUnixMs?: number; updatedAtUnixMs: number; hasUnreadCompletion?: boolean; unreadCompletionKey?: string | null; needsUserAction?: boolean; hiddenFromRail?: boolean; isTransient?: boolean; projectionSource?: "pending_activation" | "runtime_overlay"; isImported?: boolean; activeTurn?: AgentActivitySession["activeTurn"]; } type AgentGUIConversationStatus = "working" | "waiting" | "ready" | "completed" | "failed" | "canceled"; type AgentGUIApprovalRequest = AgentApprovalItemVM; interface AgentGUIInteractiveQuestion extends AgentAskUserQuestionVM { isOther?: boolean; } type AgentGUIInteractivePrompt = AgentGUIApprovalRequest | { kind: "ask-user"; agentSessionId?: string; turnId?: string; requestId: string; title: string; questions: AgentGUIInteractiveQuestion[]; } | Extract | Extract; type AgentGUIConversationRailRevealReason = "created" | "external-open"; interface AgentGUIConversationRailRevealRequest { agentSessionId: string; reason: AgentGUIConversationRailRevealReason; revision: number; } type AgentCapabilityUse = "browserUse" | "computerUse"; interface AgentSlashCommandCapability { aliases?: readonly string[]; capability: AgentCapabilityUse | "tutti"; kind: "capability"; name: string; } type AgentSlashCommandPolicy = AgentActivitySlashCommandPolicy; declare const AGENT_PASTED_TEXT_BLOCK_KIND = "pasted-text"; interface AgentGUISessionChrome { auth: { message: string; } | null; approval: AgentGUIApprovalRequest | null; recovery: { kind: "activating" | "failed" | "warning" | "agent-sharing-revoked" | "transport-connecting" | "transport-unavailable"; message: string; canRetry?: boolean; followupAction?: never; /** * The recovery only gates the currently displayed interaction. Keep * that prompt visible while rendering the recovery as inline chrome. */ interactionScoped?: boolean; } | { kind: "resume-unavailable"; message: string; followupAction: "continue-in-new-conversation"; canRetry?: never; } | null; rawState: (Pick & { goalControlStatus: "idle" | "pending_create" | "pending" | "accepted" | "succeeded" | "failed" | "unknown"; goalIsOptimistic: boolean; }) | null; } interface AgentGUIInlineNotice { id: string; message: string; tone: "warning" | "error"; autoDismissMs: number | null; } interface AgentGUIProjectConversationDeleteTarget { conversationCount: number; label: string; path: string; } interface AgentGUIComposerSettingOption { value: string; label: string; description?: string; consumptionMultiplier?: string; supportsImageInput?: boolean; /** Bound plan identity for options aggregated from model access plans. */ modelPlanId?: string | null; /** Display name of the plan (or provider) the option originates from. */ sourceName?: string; /** When the option takes effect after selection. */ effect?: "new_session" | "next_call"; } interface AgentGUIComposerModelCatalogTestimonyVM { /** Only an authoritative catalog may retire a remembered recent model. */ authoritative: boolean; /** Provider-native model discovery is still in flight. */ loading: boolean; /** Effective selected model used to recognize selected-only bootstrap echoes. */ effectiveModel: string | null; /** Narrow catalog provenance needed by local recent-model reconciliation. */ models: readonly { value: string; requested?: boolean; }[]; } interface AgentGUIComposerModelChoiceHistoryVM { /** Exact Agent Target identity; null fails closed and disables persistence. */ targetId: string | null; /** Null until the composer has any provider-native catalog testimony. */ catalog: AgentGUIComposerModelCatalogTestimonyVM | null; } interface AgentGUIProviderSkillOption { name: string; trigger: string; /** Stable daemon connector key used for host-owned setup navigation. */ connectorKey?: string; /** Presentation icon projected by the connector catalog. */ iconUrl?: string; /** Successful installation time used only for stable composer ordering. */ installedAtUnixMs?: number; /** Daemon-issued invocation contract; never infer this from provider id. */ invocation?: "promptItem" | "textTrigger"; sourceKind: "project" | "personal" | "bundled" | "plugin" | "system" | "tutti-injected" | "connector"; description?: string; pluginName?: string; path?: string; kind?: "skill" | "connector"; status?: "available" | "disabled" | "authRequired" | "setupRequired" | "unsupported"; } interface AgentComposerTextBlock { type: "text"; text: string; } interface AgentComposerImageBlock { type: "image"; id: string; name: string; mimeType: "image/png" | "image/jpeg" | "image/webp"; attachmentId?: string; data?: string; url?: string; path?: string; previewUrl: string; uploading?: boolean; uploadError?: string; } interface AgentComposerFileBlockBase { type: "file"; id: string; name: string; mimeType?: string; path?: string; hostPath?: string; url?: string; uri?: string; assetId?: string; uploadStatus?: string; sizeBytes?: number; uploading?: boolean; uploadError?: string; uploadErrorCode?: string; uploadRetryable?: boolean; } interface AgentComposerRegularFileBlock extends AgentComposerFileBlockBase { kind: "file"; text?: never; } interface AgentComposerPastedTextBlock extends AgentComposerFileBlockBase { kind: typeof AGENT_PASTED_TEXT_BLOCK_KIND; /** Empty only when a queued pasted-text attachment is restored by path. */ text: string; } /** Transcript text retained as visible, unsent composer context. */ interface AgentComposerQuoteBlock { type: "quote"; id: string; text: string; } type AgentComposerFileBlock = AgentComposerRegularFileBlock | AgentComposerPastedTextBlock; type AgentComposerAttachmentBlock = AgentComposerImageBlock | AgentComposerFileBlock; interface AgentComposerConnectorBlock { type: "connector"; connectorKey: string; } type AgentComposerSupplementaryBlock = AgentComposerAttachmentBlock | AgentComposerQuoteBlock | AgentComposerConnectorBlock; type AgentComposerDraftContent = [ AgentComposerTextBlock, ...AgentComposerSupplementaryBlock[] ]; /** One atomic, unsent composer message. */ type AgentComposerDraft = AgentComposerDraftContent; type AgentComposerDraftFile = Omit; interface AgentGUIComposerModelPlanVM { id: string; name: string; protocol?: string | null; } interface AgentGUIComposerSettingsVM { sessionSettings: AgentSessionComposerSettings | null; draftSettings: { codexSaverMode?: boolean; model: string | null; reasoningEffort: AgentSessionReasoningEffort | null; speed: AgentSessionSpeed | null; planMode: boolean; browserUse?: boolean; computerUse?: boolean; permissionModeId?: string | null; }; supportsModel: boolean; supportsCodexSaverMode?: boolean; supportsReasoningEffort: boolean; supportsSpeed: boolean; supportsPermissionMode?: boolean; supportsPlanMode: boolean; planExclusiveWithPermissionMode?: boolean; supportsBrowser?: boolean; supportsComputerUse?: boolean; permissionModeChangeDuringTurn?: boolean; slashCommandPolicy?: AgentSlashCommandPolicy | null; isSettingsLoading: boolean; /** Terminal composer-options failure with no cached catalog to render. */ composerOptionsError?: boolean; /** Activity-core request lifecycle for the target-scoped options catalog. */ composerOptionsLoadStatus?: AgentActivityComposerOptionsLoadStatus; /** Initial slash command and capability catalog request is in flight. */ isCapabilityOptionsLoading?: boolean; /** Local Connector Market projection is being loaded or refreshed. */ isConnectorOptionsLoading?: boolean; isModelOptionsLoading?: boolean; /** Device-local model recents/favorites identity and catalog testimony. */ modelChoiceHistory?: AgentGUIComposerModelChoiceHistoryVM; modelUnavailable: boolean; reasoningUnavailable: boolean; speedUnavailable: boolean; permissionModeUnavailable?: boolean; selectedModelValue?: string | null; /** Actual provider-resolved model while selectedModelValue remains inherited. */ effectiveModelValue?: string | null; selectedReasoningEffortValue?: AgentSessionReasoningEffort | null; selectedSpeedValue?: AgentSessionSpeed | null; selectedPermissionModeValue?: string | null; permissionConfig?: AgentSessionPermissionConfig | null; selectedProjectPath?: string | null; /** Persisted rail membership used to scope Agent-generated file mentions. */ selectedProjectSectionKey?: string | null; /** Resolve the durable default only before the home project intent is known. */ shouldApplyPreparedProjectSelection?: boolean; projectLocked?: boolean; projectPathIsRemote?: boolean; collapseModelOptionsToLatest?: boolean; modelPlan?: AgentGUIComposerModelPlanVM | null; modelSwitchTakesEffectNextTurn?: boolean; availableModels: AgentGUIComposerSettingOption[]; availableReasoningEfforts: AgentGUIComposerSettingOption[]; availableSpeeds: AgentGUIComposerSettingOption[]; availablePermissionModes?: AgentGUIComposerSettingOption[]; } interface AgentGUIQueuedPromptVM { id: string; content: AgentPromptContentBlock[]; /** 仅展示用文本(bundle 折叠成一个 chip);content 仍带展开后的文件。 */ displayPrompt?: string; createdAtUnixMs: number; } type AgentGUIQueueStatus = "active" | "paused_by_user"; interface AgentGUIShellViewModel { nodeId?: string | null; workspaceId: string; workspacePath?: string | null; currentUserId?: string | null; data: AgentGUINodeData; } interface AgentGUIRailViewModel { selectedAgentTarget: AgentGUIAgentTarget; agentTargets: readonly AgentGUIAgentTarget[]; agentTargetsLoading: boolean; /** How the rail composes its list — "exact" renders targets verbatim with no static injection. */ providerRailMode: AgentGUIProviderRailMode; /** Providers gated by the host (feature-gated) — rail renders coming-soon placeholders. */ comingSoonProviders: readonly AgentGUIProvider[]; conversationFilter: AgentGUIConversationFilter; conversations: AgentGUIConversationSummary[]; userProjects: AgentGUIConversationUserProject[]; activeConversation: AgentGUIConversationSummary | null; activeConversationId: string | null; revealRequest: AgentGUIConversationRailRevealRequest | null; isLoadingConversations: boolean; listError: string | null; } interface AgentGUIDetailViewModel { availability: "loading" | "ready" | "not_found" | "error"; isLoadingMessages: boolean; isLoadingOlderMessages: boolean; hasOlderMessages: boolean; usage: AgentActivityUsage | null; hasSentUserMessage: boolean; avoidGroupingEdits: boolean; conversation?: AgentConversationVM | null; conversationDetail: WorkspaceAgentSessionDetailViewModel | null; } type AgentGUIRuntimeBlockedReason = Extract["reason"]; type AgentGUIComposerRuntimeGate = { status: "ready"; reason: null; sessionRuntimeReason: null; } | { status: "blocked"; reason: "target_connection"; sessionRuntimeReason: null; } | { status: "blocked"; reason: "session_runtime"; sessionRuntimeReason: AgentGUIRuntimeBlockedReason; }; type AgentGUIComposerEditorBlockedReason = "collaborator_read_only" | "creating_conversation" | "interrupting" | "non_retryable_recovery" | "pending_approval" | "pending_interactive_prompt" | "provider_readiness" | "runtime_blocked" | "submitting"; type AgentGUIComposerSubmissionBlockedReason = AgentGUIComposerEditorBlockedReason | "activation_failed" | "activation_pending" | "agent_targets_loading" | "authentication_required" | "conversation_busy" | "resume_unavailable" | "settings_update_pending"; interface AgentGUIComposerGate { /** Canonical busy projection captured with the same gate snapshot. */ conversationBusy: boolean; /** A submitted prompt is waiting for its canonical Turn to appear. */ isAwaitingTurnStart?: boolean; /** * Runtime-dependent command availability used by Composer-adjacent * controls such as Stop and interactive responses. */ runtime: AgentGUIComposerRuntimeGate; editor: { status: "editable"; reason: null; } | { status: "blocked"; reason: AgentGUIComposerEditorBlockedReason; }; submission: { status: "ready"; reason: null; } | { status: "queue"; reason: "conversation_busy"; } | { status: "blocked"; reason: AgentGUIComposerSubmissionBlockedReason; }; } interface AgentGUIComposerViewModel { handoffAgentTargets: readonly AgentGUIAgentTarget[]; availableCommands: AgentSessionCommand[]; availableSkills: AgentGUIProviderSkillOption[]; draftPrompt: string; draftContent: AgentComposerDraft; isCreatingConversation: boolean; isSubmitting: boolean; isInterrupting: boolean; isCancelPending: boolean; /** The Engine can stop a pending prompt before its Turn is visible. */ hasPendingSubmitStopTarget?: boolean; promptImagesSupported: boolean; compactSupported: boolean | null; /** Provider goal exposes a real paused state and pause/resume controls. */ goalPauseSupported: boolean; gate: AgentGUIComposerGate; isTuttiModeActive: boolean; isTuttiModeUpdating: boolean; /** Effective Tutti outcome-quality and completion-speed preferences. */ tuttiModeEffect: number; tuttiModeSpeed: number; tuttiModeUpdateStatus: "idle" | "pending_create" | "updating" | "failed" | "uncertain"; composerSettings: AgentGUIComposerSettingsVM; queuedPrompts: AgentGUIQueuedPromptVM[]; queueStatus: AgentGUIQueueStatus; drainingQueuedPromptId: string | null; } interface AgentGUIInteractionViewModel { approvalDisabledReason: string | null; /** The visible prompt is the one exact pending question Composer can answer. */ canAnswerPendingInteractivePromptFromComposer?: boolean; interactivePromptDisabledReason: string | null; isRespondingApproval: boolean; isRespondingInteractivePrompt: boolean; pendingApproval: AgentGUIApprovalRequest | null; pendingInteractivePrompt: AgentGUIInteractivePrompt | null; sessionChrome: AgentGUISessionChrome; inlineNotice: AgentGUIInlineNotice | null; } interface AgentGUIReadinessViewModel { activeLiveState: "inactive" | "activating" | "active" | "failed"; activationError: string | null; providerReadinessGate: AgentGUIProviderReadinessGate | null; } interface AgentGUIOperationsViewModel { forkThroughTurnPendingTurnIds: readonly string[]; goalClearNoticeSequence: number; isDeletingConversation: boolean; isDeletingProjectConversations: boolean; isUserProjectMutationPending: boolean; pendingDeleteConversation: AgentGUIConversationSummary | null; pendingDeleteProjectConversations: AgentGUIProjectConversationDeleteTarget | null; } interface AgentGUINodeViewModel { shell: AgentGUIShellViewModel; rail: AgentGUIRailViewModel; detail: AgentGUIDetailViewModel; composer: AgentGUIComposerViewModel; interaction: AgentGUIInteractionViewModel; readiness: AgentGUIReadinessViewModel; operations: AgentGUIOperationsViewModel; } export type { AgentComposerDraft as A, AgentComposerDraftFile as a, AgentGUIComposerGate as b, AgentGUIComposerSettingsVM as c, AgentGUINodeViewModel as d, AgentGUIProviderSkillOption as e, AgentGUIQueueStatus as f, AgentGUIQueuedPromptVM as g, AgentHostInputApi as h, AgentMessageMarkdownWorkspaceAppIcon as i, AgentSessionCommand as j, AgentSlashCommandCapability as k, AgentUsageQuota as l };