import * as react from 'react'; import { ReactNode, JSX } from 'react'; import { I18nRuntime } from '@tutti-os/ui-i18n-runtime'; import { AgentActivitySession, AgentActivityDeleteSessionInput, AgentActivityDeleteSessionResult, AgentActivityComposerOptions, AgentActivitySnapshot, AgentSessionEngine, AgentActivityMessageOrder, AgentActivityMessagePage, AgentActivitySendInput, AgentActivityRenameSessionInput, AgentActivitySetCollaborationAdoptionInput, AgentActivityCollaborationRun, AgentActivitySnapshotListener, AgentActivityComposerSettingOption } from '@tutti-os/agent-activity-core'; import { a as AgentHostAgentSessionComposerSettings } from './agentSession.d-4jwjFmc1.js'; import { e as AgentGUIProviderSkillOption, i as AgentMessageMarkdownWorkspaceAppIcon, a as AgentComposerDraftFile, l as AgentUsageQuota, d as AgentGUINodeViewModel, h as AgentHostInputApi } from './agentGuiNodeTypes.d-B2xk381A.js'; import { h as AgentGUINodeData, j as AgentGUIProvider, P as Point, c as AgentGUIAgentTarget, k as AgentGUIProviderRailAllPresentation, l as AgentGUIProviderRailMode, m as AgentGUIProviderReadinessGate, n as AgentGUITargetConnectionSource, g as AgentGUIInteractionReadinessSource, i as AgentGUIObservationGapSource, f as AgentGUIHomeSuggestionId, b as AgentGUIAgentOwnership, N as NodeFrame, d as AgentGUIAgentTargetInfoRenderer, a as AgentGUIAgentDirectorySnapshot, e as AgentGUIAllAgentsPresentation } from './types.d-J0XWegqK.js'; import { WorkspaceFileReferenceAdapter, WorkspaceFileReference, ReferenceProvenanceCatalog, ReferenceLocateTarget } from '@tutti-os/workspace-file-reference/contracts'; export { ReferenceProvenanceCatalog as AgentGUIReferenceProvenanceFilterCatalog } from '@tutti-os/workspace-file-reference/contracts'; import { A as AgentContextMentionItem } from './AgentMentionSearchContracts.d-BsdR0M3b.js'; import { WorkspaceFileEntry } from '@tutti-os/workspace-file-manager/services'; import { ReferenceSourceAggregator } from '@tutti-os/workspace-file-reference/core'; import { ReferenceSourcePickerProps } from '@tutti-os/workspace-file-reference/ui'; import { U as UiLanguage, g as UiTheme, c as AgentComposerProps, b as AgentComposerGitBranchLoader, e as AgentGUISessionLaunchMode, A as AgentComposerCapabilityMenuState, a as AgentComposerCapabilitySettingsTarget, d as AgentGUIEngagementEventSink, f as AgentProjectDropdownOptions } from './AgentComposer.types.d-DE7dMBEs.js'; import { c as AgentConversationVM, h as WorkspaceLinkAction } from './workspaceLinkActions.d-gJPVQnM0.js'; import { RichTextMentionService } from '@tutti-os/ui-rich-text/service'; import { d as AgentSideConversationState, a as AgentSideConversationRuntime } from './agentSideConversationRuntime.d-BFXPkyUD.js'; import { A as AgentGuiI18nLocale } from './runtime.d-Dwf44VKc.js'; import '@tutti-os/workspace-user-project/contracts'; import './planImplementationPresentation.d-BxVOLt6A.js'; import '@tiptap/core'; import './context-mention-provider.js'; import '@tutti-os/ui-rich-text/types'; import '@tutti-os/workspace-external-core/contracts'; import '@tutti-os/ui-rich-text/at-panel'; import '@tutti-os/workspace-user-project/i18n'; import '@tutti-os/workspace-user-project/ui'; import '@tutti-os/workspace-file-reference/react'; import '@tutti-os/workspace-issue-manager/core'; declare const APP_UPDATE_POLICIES: readonly ["off", "prompt", "auto"]; type AppUpdatePolicy = (typeof APP_UPDATE_POLICIES)[number]; interface AgentConversationRailUserProject { createdAtUnixMs: number; id: string; label: string; lastUsedAtUnixMs?: number; path: string; pinnedAtUnixMs: number; sectionKey: string; updatedAtUnixMs: number; } interface AgentConversationRailSessionPage { hasMore: boolean; nextCursor?: string; sessions: AgentActivitySession[]; totalCount: number; } interface AgentConversationRailSessionSection extends AgentConversationRailSessionPage { kind: "conversations" | "project"; sectionKey: string; userProject?: AgentConversationRailUserProject; } interface AgentConversationRailSessionSectionsResult { pinned?: AgentConversationRailSessionPage; sections: AgentConversationRailSessionSection[]; workspaceId: string; } interface AgentConversationRailListSessionsPageInput { agentTargetId?: string | null; cursor?: string; limit?: number; searchQuery?: string; signal?: AbortSignal; workspaceId: string; } interface AgentConversationRailSessionsPageResult { hasMore: boolean; nextCursor?: string; sessions: AgentActivitySession[]; workspaceId: string; } interface AgentConversationRailListSessionSectionsInput { agentTargetId?: string | null; limitPerSection?: number; signal?: AbortSignal; workspaceId: string; } interface AgentConversationRailListSessionSectionPageInput { agentTargetId?: string | null; cursor?: string; limit?: number; sectionKey: string; signal?: AbortSignal; workspaceId: string; } type AgentConversationRailListPinnedSessionsPageInput = Omit; interface AgentConversationRailSessionSectionScopeInput { agentTargetId?: string | null; excludePinned?: boolean; sectionKey: string; signal?: AbortSignal; workspaceId: string; } interface AgentConversationRailSessionSectionDeletionCandidates { agentTargetId?: string | null; excludePinned: boolean; sectionKey: string; sessionIds: string[]; workspaceId: string; } interface AgentConversationRailDeleteSessionsBatchInput { sessionIds: string[]; signal?: AbortSignal; workspaceId: string; } interface AgentConversationRailDeleteSessionsBatchResult { cleanupFailedSessionIds: string[]; removedMessages: number; removedSessionIds: string[]; removedSessions: number; } interface AgentActivityRuntimeListSessionMessagesInput { afterVersion?: number; beforeVersion?: number; cache?: boolean; agentSessionId: string; limit?: number; order?: AgentActivityMessageOrder; signal?: AbortSignal; workspaceId: string; } interface AgentActivityRuntimeListGeneratedFilesInput { agentTargetIds?: readonly string[]; cursor?: string; limit?: number; query?: string; sectionKey: string; signal?: AbortSignal; workspaceId: string; } type AgentActivityRuntimeListSessionsPageInput = AgentConversationRailListSessionsPageInput; type AgentActivityRuntimeSessionPageResult = AgentConversationRailSessionsPageResult; type AgentActivityRuntimeListSessionSectionsInput = AgentConversationRailListSessionSectionsInput; type AgentActivityRuntimeListSessionSectionPageInput = AgentConversationRailListSessionSectionPageInput; type AgentActivityRuntimeListPinnedSessionsPageInput = AgentConversationRailListPinnedSessionsPageInput; type AgentActivityRuntimeSessionSection = AgentConversationRailSessionSection; type AgentActivityRuntimeSessionPage = AgentConversationRailSessionPage; type AgentActivityRuntimeSessionSectionsResult = AgentConversationRailSessionSectionsResult; interface AgentActivityRuntimeGeneratedFile { label: string; path: string; } interface AgentActivityRuntimeGeneratedFileList { entries: AgentActivityRuntimeGeneratedFile[]; hasMore?: boolean; nextCursor?: string; workspaceId: string; } interface AgentActivityRuntimeEnsureSessionSynchronizedInput { afterVersion?: number; agentSessionId: string; onError?: (error: unknown) => void; workspaceId: string; } interface AgentActivityRuntimeSetSessionPinnedInput { agentSessionId: string; pinned: boolean; workspaceId: string; } interface AgentActivityRuntimeTrackSettingsProjectChangeInput { action: "clear" | "create_new" | "import_directory" | "select_existing"; agentSessionId: string | null; provider?: string | null; workspaceId: string; } interface AgentActivityRuntimeGetComposerOptionsInput { agentSessionId?: string | null; agentTargetId: string; cwd?: string | null; force?: boolean; waitForFreshModelCatalog?: boolean; provider?: string; section?: "full" | "core" | "capabilities" | "connectors"; settings?: AgentHostAgentSessionComposerSettings | null; workspaceId: string; } interface AgentActivityRuntimeTrackDraftComposerSettingsChangeInput { nextSettings: AgentHostAgentSessionComposerSettings; previousSettings: AgentHostAgentSessionComposerSettings; provider: string; workspaceId: string; } interface AgentActivityRuntimeDiagnosticInput { details?: Record; event: string; level?: "debug" | "info" | "warn" | "error"; source?: string; workspaceId?: string | null; } interface AgentActivityRuntimeReadSessionAttachmentInput { agentSessionId: string; attachmentId: string; workspaceId: string; } interface AgentActivityRuntimeReadPromptAssetInput { agentSessionId?: string | null; assetId?: string | null; hostPath?: string | null; kind?: string | null; mimeType: string; name?: string | null; path?: string | null; sha256?: string | null; uploadStatus?: string | null; uri?: string | null; workspaceId: string; } type AgentActivityRuntimePromptContentBlock = AgentActivitySendInput["content"][number] & { assetId?: string; hostPath?: string; kind?: string; path?: string; sizeBytes?: number; uploadStatus?: string; uri?: string; }; interface AgentActivityRuntimeUploadPromptContentInput { content: AgentActivityRuntimePromptContentBlock[]; workspaceId: string; } interface AgentActivityRuntimeUploadPromptContentResult { content: AgentActivityRuntimePromptContentBlock[]; } /** * Dedicated host boundary for turning an in-memory text paste into a prepared * prompt asset. The runtime owns persistence and returns one provider-readable * locator; AgentGUI must not infer this capability from generic file-upload * support. */ interface AgentActivityRuntimeStagePastedTextInput { name: string; text: string; workspaceId: string; } /** * A prepared long-text asset. Local hosts return a path; remote/shared hosts * return the same URL-backed attachment metadata used by ordinary prompt-file * upload. Exactly one of `path` and `url` must be present. */ type AgentActivityRuntimeStagePastedTextResult = { name: string; path: string; url?: never; assetId?: never; mimeType?: string; sizeBytes: number; uploadStatus?: never; uri?: never; } | { name: string; path?: never; url: string; assetId?: string; mimeType?: string; sizeBytes: number; uploadStatus?: string; uri?: string; }; type AgentActivityRuntimeSessionSectionScopeInput = AgentConversationRailSessionSectionScopeInput; type AgentActivityRuntimeSessionSectionDeletionCandidates = AgentConversationRailSessionSectionDeletionCandidates; type AgentActivityRuntimeDeleteSessionsBatchInput = AgentConversationRailDeleteSessionsBatchInput; type AgentActivityRuntimeDeleteSessionsBatchResult = AgentConversationRailDeleteSessionsBatchResult; interface AgentActivityRuntimeSessionAttachment { attachmentId: string; mimeType: string; name?: string; data: string; } interface AgentActivityRuntimePromptAsset { assetId?: string; hostPath?: string; kind?: string; mimeType: string; name?: string; path: string; uploadStatus?: string; uri?: string; data: string; } /** * Host runtime surface consumed by AgentGUI. Session lifecycle writes are * owned by the workspace {@link AgentSessionEngine}; this boundary contains * only the reads, metadata actions, uploads, diagnostics, and subscriptions * that remain host-owned. */ interface AgentGUIRuntime { /** * Stable identity of this runtime instance (e.g. a local origin vs a * shared/room origin). The runtime owns one session engine per workspace and * that engine verifies this origin as part of its injected identity. Runtime * consumers resolve only through the nearest React provider; module-global * runtime lookup and last-mounted fallback are forbidden. An absent origin * means the canonical local origin. */ origin?: string; /** * Enables the Codex-aligned in-memory conversation Activity View. Missing or * false fails closed so external hosts opt in explicitly. */ conversationActivityViewEnabled?: boolean; /** * Host query limits for the Conversation Rail. Omit when the backend accepts * AgentGUI's default limits. */ conversationRailQueryLimits?: { sectionRefreshLimitMax: number; }; /** * The session cwd is not resolvable on the local filesystem (e.g. a * shared/cloud sandbox not mounted locally), so AgentGUI must not run its * local stat-based "working directory missing" existence check — it would * always false-positive. Absent/false (default) => local, legacy behaviour. * Only that one guard is gated; project selection/listing is unaffected. */ projectPathIsRemote?: boolean; promptContentUploadSupport?: { file?: boolean; image?: boolean; }; /** Set false to suppress AgentGUI diagnostics in development consoles. */ devDiagnosticConsoleSink?: boolean; deleteSession(input: AgentActivityDeleteSessionInput): Promise; getSession(workspaceId: string, agentSessionId: string): Promise; getComposerOptions(input: AgentActivityRuntimeGetComposerOptionsInput): Promise; getSnapshot(workspaceId: string): AgentActivitySnapshot; getSessionEngine(workspaceId: string): AgentSessionEngine; listSessionMessages(input: AgentActivityRuntimeListSessionMessagesInput): Promise; listAgentGeneratedFiles?(input: AgentActivityRuntimeListGeneratedFilesInput): Promise; listSessionsPage?(input: AgentActivityRuntimeListSessionsPageInput): Promise; listSessionSections?(input: AgentActivityRuntimeListSessionSectionsInput): Promise; listSessionSectionPage?(input: AgentActivityRuntimeListSessionSectionPageInput): Promise; listSessionSectionDeletionCandidates?(input: AgentActivityRuntimeSessionSectionScopeInput): Promise; deleteSessionsBatch?(input: AgentActivityRuntimeDeleteSessionsBatchInput): Promise; listPinnedSessionsPage?(input: AgentActivityRuntimeListPinnedSessionsPageInput): Promise; load(workspaceId: string, signal?: AbortSignal): Promise; ensureSessionSynchronized?(input: AgentActivityRuntimeEnsureSessionSynchronizedInput): () => void; uploadPromptContent?(input: AgentActivityRuntimeUploadPromptContentInput): Promise; stagePastedText?(input: AgentActivityRuntimeStagePastedTextInput): Promise; readSessionAttachment?(input: AgentActivityRuntimeReadSessionAttachmentInput): Promise; readPromptAsset?(input: AgentActivityRuntimeReadPromptAssetInput): Promise; renameSession(input: AgentActivityRenameSessionInput): Promise; /** * Record whether a collaboration outcome was adopted. * Optional; hosts without support omit it and adoption controls stay hidden. */ setCollaborationAdoption?(input: AgentActivitySetCollaborationAdoptionInput): Promise; setSessionPinned(input: AgentActivityRuntimeSetSessionPinnedInput): Promise; trackSettingsProjectChange?(input: AgentActivityRuntimeTrackSettingsProjectChangeInput): Promise; trackDraftComposerSettingsChange?(input: AgentActivityRuntimeTrackDraftComposerSettingsChangeInput): Promise; reportDiagnostic?(input: AgentActivityRuntimeDiagnosticInput): Promise | void; subscribeSessionEvents(workspaceId: string, listener: (event: unknown) => void): () => void; subscribe(workspaceId: string, listener: AgentActivitySnapshotListener): () => void; } type AgentCustomModelEnabledByProvider = Record; type AgentCustomModelByProvider = Record; type AgentCustomModelOptionsByProvider = Record; declare const AGENT_PROVIDERS: readonly ["claude-code", "codex", "cursor", "tutti-agent", "nexight", "opencode", "openclaw"]; type AgentProvider = (typeof AGENT_PROVIDERS)[number]; type FocusNodeTargetZoom = number; declare const COMMAND_IDS: readonly ["commandCenter.toggle", "app.togglePrimarySidebar", "workspaceCanvas.createTerminal"]; type CommandId = (typeof COMMAND_IDS)[number]; type KeyChord = { code: string; altKey: boolean; ctrlKey: boolean; metaKey: boolean; shiftKey: boolean; }; type KeybindingOverrides = Partial>; declare const CANVAS_INPUT_MODES: readonly ["auto", "mouse", "trackpad"]; type CanvasInputMode = (typeof CANVAS_INPUT_MODES)[number]; declare const CANVAS_WHEEL_BEHAVIORS: readonly ["zoom", "pan"]; type CanvasWheelBehavior = (typeof CANVAS_WHEEL_BEHAVIORS)[number]; declare const CANVAS_WHEEL_ZOOM_MODIFIERS: readonly ["primary", "ctrl", "alt"]; type CanvasWheelZoomModifier = (typeof CANVAS_WHEEL_ZOOM_MODIFIERS)[number]; declare const STANDARD_WINDOW_SIZE_BUCKETS: readonly ["compact", "regular", "large"]; type StandardWindowSizeBucket = (typeof STANDARD_WINDOW_SIZE_BUCKETS)[number]; type QuickCommand = { id: string; title: string; kind: "terminal"; command: string; enabled: boolean; pinned: boolean; } | { id: string; title: string; kind: "url"; url: string; enabled: boolean; pinned: boolean; }; type QuickPhrase = { id: string; title: string; content: string; enabled: boolean; }; type AgentEnvRow = { id: string; key: string; value: string; enabled: boolean; }; type AgentEnvByProvider = Record; type TerminalProfileId = string | null; interface AgentSettings { language: UiLanguage; uiTheme: UiTheme; isPrimarySidebarCollapsed: boolean; defaultProvider: AgentProvider; agentProviderOrder: AgentProvider[]; agentFullAccess: boolean; defaultTerminalProfileId: TerminalProfileId; customModelEnabledByProvider: AgentCustomModelEnabledByProvider; customModelByProvider: AgentCustomModelByProvider; customModelOptionsByProvider: AgentCustomModelOptionsByProvider; quickCommands: QuickCommand[]; quickPhrases: QuickPhrase[]; agentEnvByProvider: AgentEnvByProvider; focusNodeOnClick: boolean; focusNodeTargetZoom: FocusNodeTargetZoom; focusNodeUseVisibleCanvasCenter: boolean; standbyBannerEnabled: boolean; standbyBannerShowTask: boolean; standbyBannerShowSpace: boolean; standbyBannerShowBranch: boolean; disableAppShortcutsWhenTerminalFocused: boolean; keybindings: KeybindingOverrides; canvasInputMode: CanvasInputMode; canvasWheelBehavior: CanvasWheelBehavior; canvasWheelZoomModifier: CanvasWheelZoomModifier; standardWindowSizeBucket: StandardWindowSizeBucket; defaultTerminalWindowScalePercent: number; terminalFontSize: number; terminalFontFamily: string | null; uiFontSize: number; avoidGroupingEdits: boolean; updatePolicy: AppUpdatePolicy; hideWorktreeMismatchDropWarning: boolean; } interface AgentGuiWorkbenchCommandBridge { instanceId: string; onConversationRailToggle?(conversationRailCollapsed: boolean): void; } interface DesktopSize { width: number; height: number; bottomInset?: number; } interface AgentSideConversationViewState extends AgentSideConversationState { conversation: AgentConversationVM | null; } interface AgentGUISideConversationPaneProps { active: AgentSideConversationViewState; availableSkills: readonly AgentGUIProviderSkillOption[]; composerProps: AgentComposerProps; conversationFlowLabels: { thinkingLabel: string; toolCallsLabel: (count: number) => string; processing: string; turnSummary: string; userMessageLocator: string; }; isVisible: boolean; loadingLabel: string; workspaceAppIcons: readonly AgentMessageMarkdownWorkspaceAppIcon[]; onClose(): void | Promise; onFocusChange(focused: boolean): void; onLinkAction?: (action: WorkspaceLinkAction) => void; } type AgentGUISideConversationSurfaceProps = Omit; interface AgentGUISideConversationProjection { sideAgentSessionId: string; sourceAgentSessionId: string; surfaceProps: AgentGUISideConversationSurfaceProps; close(): Promise; } interface AgentGUISideConversationIdentity { sideAgentSessionId: string; sourceAgentSessionId: string; } interface AgentGUISideConversationPresentation { getSnapshot(): AgentGUISideConversationProjection | null; getIdentitySnapshot(): AgentGUISideConversationIdentity | null; publish(projection: AgentGUISideConversationProjection | null): void; subscribe(listener: () => void): () => void; subscribeIdentity(listener: () => void): () => void; } type TuttiModePlanWorkflowStatus = "pending_review" | "in_progress" | "accepted" | "rejected" | "completed" | "failed" | "canceled"; type TuttiModePlanCheckpointKind = "configuration_review" | "task_review"; type TuttiModePlanCheckpointStatus = "pending" | "accepted" | "rejected" | "superseded" | "canceled"; interface TuttiModePlanReviewSnapshot { workflow: TuttiModePlanWorkflow; revisions: TuttiModePlanRevision[]; checkpoints: TuttiModePlanCheckpoint[]; } interface TuttiModePlanWorkflow { id: string; workspaceId: string; type: string; owner: string; triggerKind: string; sourceSessionId: string; sourceTurnId?: string | null; sourceToolCallId?: string | null; status: TuttiModePlanWorkflowStatus; currentRevisionId: string; } interface TuttiModePlanRevision { id: string; workflowId: string; sequence: number; schemaVersion: string; documentPath: string; sha256: string; producedByTurnId?: string | null; createdAtUnixMs: number; document: TuttiModePlanDocument; } interface TuttiModePlanDocument { schema: string; phase: "configuration" | "task_graph"; title: string; topicId: string; markdownBody: string; execution: TuttiModePlanExecution; budget: TuttiModePlanBudget; tasks: TuttiModePlanTask[]; } interface TuttiModePlanExecution { mode: "sequential" | "parallel"; reasoningIntensity: number; orchestrationIntensity: number; effect?: number | null; speed?: number | null; } interface TuttiModePlanBudget { mode: "auto" | "fixed"; tokenLimit: number; quotaWaterlinePercent: number; } interface TuttiModePlanTask { id: string; title: string; content: string; priority: "high" | "medium" | "low"; agentTargetId?: string | null; modelPlanId?: string | null; model?: string | null; permissionModeId?: string | null; reasoningEffort?: string | null; executionDirectory?: string | null; dependsOn: string[]; parallelizable?: boolean; autoAccept?: boolean; } interface TuttiModePlanCheckpoint { id: string; workflowId: string; kind: TuttiModePlanCheckpointKind; revisionId: string; status: TuttiModePlanCheckpointStatus; decidedBy?: string | null; decisionReason?: string | null; createdAtUnixMs: number; updatedAtUnixMs: number; decidedAtUnixMs?: number | null; } interface TuttiModePlanReviewUpdate { kind: "workflow_updated"; workspaceId: string; workflowId: string; sourceSessionId: string; checkpointId: string; changeKind: "proposal_created" | "revision_created" | "checkpoint_decided" | "operation_updated"; } interface TuttiModePlanReviewConnectionRestored { kind: "connection_restored"; workspaceId: string; } /** * A root turn of the source session settled. The host derives this from the * daemon's canonical turn fan-out and relays it as a read-repair trigger: a * plan proposed mid-turn announces itself through one workflow event, and if * that single event is lost no later workflow signal re-reads review state. */ interface TuttiModePlanReviewSessionSettled { kind: "session_settled"; workspaceId: string; sourceSessionId: string; } /** Cached assignment catalogs changed for exact Agent Targets. */ interface TuttiModePlanAssignmentOptionsInvalidated { kind: "assignment_options_invalidated"; workspaceId: string; agentTargetIds: readonly string[]; } type TuttiModePlanReviewInvalidation = TuttiModePlanReviewUpdate | TuttiModePlanReviewConnectionRestored | TuttiModePlanReviewSessionSettled | TuttiModePlanAssignmentOptionsInvalidated; interface TuttiModePlanTaskAssignmentInput { taskId: string; agentTargetId?: string | null; modelPlanId?: string | null; model?: string | null; permissionModeId?: string | null; reasoningEffort?: string | null; parallelizable?: boolean | null; autoAccept?: boolean | null; } interface TuttiModePlanReviewDecisionInput { workspaceId: string; workflowId: string; checkpointId: string; decision: "accepted" | "rejected" | "canceled"; decidedBy: string; reason?: string | null; /** Per-task overrides; only meaningful with an accepted task review. */ taskAssignments?: readonly TuttiModePlanTaskAssignmentInput[]; } interface TuttiModePlanAssignmentAgentOption { agentTargetId: string; label: string; } interface TuttiModePlanAssignmentAgentDetail { /** Provider-native models usable without a model plan. */ models: readonly AgentActivityComposerSettingOption[]; modelPlans: readonly { modelPlanId: string; label: string; models: readonly AgentActivityComposerSettingOption[]; }[]; permissionModes: readonly { id: string; label: string; }[]; reasoningEfforts: readonly AgentActivityComposerSettingOption[]; } interface TuttiPlanIssueTaskSnapshot { taskId: string; title: string; content: string; status: string; sortIndex: number; parallelizable: boolean; autoAccept: boolean; dependencyTaskIds: string[]; } /** Read-only snapshot of the Issue a session's accepted plan materialized. */ interface TuttiPlanIssueSnapshot { workflowId: string; sourceTurnId: string | null; issueId: string; topicId: string; title: string; /** Durable Issue execution gate; paused graphs are not active work. */ dispatchPaused: boolean; tasks: TuttiPlanIssueTaskSnapshot[]; } /** * An accepted plan whose create_issue operation durably failed. The * conversation must surface this instead of rendering nothing: there is no * pending checkpoint (the review panel is gone) and no Issue (the issue panel * never appears), so silence would hide the failure entirely. */ interface TuttiPlanIssueMaterializationFailure { workflowId: string; sourceTurnId: string | null; errorMessage: string | null; } type TuttiPlanIssueQueryResult = { kind: "issue"; issue: TuttiPlanIssueSnapshot; } | ({ kind: "materialization_failed"; } & TuttiPlanIssueMaterializationFailure) | null; /** * Source for the embedded plan-issue panel in the conversation. * The host resolves "the Issue this session's accepted plan created", relays * live issue updates, and exposes only daemon-owned product commands. Task * accept/rework actions remain source-Agent prompts rather than generic Issue * mutations. */ interface TuttiPlanIssueSource { getSessionPlanIssue(input: { workspaceId: string; sourceSessionId: string; }): Promise; subscribeIssueUpdates(workspaceId: string, listener: (update: { issueId: string; }) => void): () => void; /** * Stops the Issue's execution: pauses future dispatch and cancels every * running task run. Idempotent; the daemon owns the cascade. */ cancelExecution(input: { workspaceId: string; issueId: string; }): Promise; /** * Resolves the delegate agent session that ran (or is running) a task's * latest run, so a task card can jump straight into that conversation. * Null when the task has not launched yet. */ resolveTaskSession(input: { workspaceId: string; issueId: string; taskId: string; }): Promise<{ agentSessionId: string; } | null>; } /** * Option catalogs for per-task assignment editing. The desktop host reuses * its agent directory and composer capability catalogs; the panel never * hardcodes providers or modes. */ interface TuttiModePlanAssignmentOptionsSource { /** * Returns the last successful workspace directory, including stale data. * Hosts may omit this when they do not retain a query cache. */ readAgents?(input: { workspaceId: string; }): readonly TuttiModePlanAssignmentAgentOption[] | null; listAgents(input: { workspaceId: string; }): Promise; /** * Returns the last successful target catalog, including stale data, so a * refresh never replaces usable selectors with a loading placeholder. */ readAgentOptions?(input: { workspaceId: string; agentTargetId: string; }): TuttiModePlanAssignmentAgentDetail | null; loadAgentOptions(input: { workspaceId: string; agentTargetId: string; }): Promise; } interface TuttiModePlanReviewRuntime { listPending(input: { workspaceId: string; sourceSessionId: string; }): Promise; decide(input: TuttiModePlanReviewDecisionInput): Promise; subscribe(workspaceId: string, listener: (update: TuttiModePlanReviewInvalidation) => void): () => void; /** Optional; the panel degrades to read-only assignment display without it. */ assignmentOptions?: TuttiModePlanAssignmentOptionsSource; /** Optional; without it the embedded plan-issue panel never renders. */ planIssues?: TuttiPlanIssueSource; } type AgentGUIComposerAppendRequest = { agentSessionId?: string; connectorKey: string; files?: never; prompt?: never; sequence: number; } | { agentSessionId?: string; connectorKey?: never; files: readonly AgentComposerDraftFile[]; prompt?: string; sequence: number; } | { agentSessionId?: string; connectorKey?: never; files?: never; prompt: string; sequence: number; }; type AgentStatusSectionState = "available" | "unavailable" | "error"; type AgentStatusRequestReason = "slash-status" | "agent-info" | "agent-config"; interface AgentStatusQuery { /** Exact host-owned execution target identity. AgentGUI treats it as opaque. */ scopeKey: string; agentSessionId?: string | null; reason: AgentStatusRequestReason; forceRefresh?: boolean; } interface AgentStatusValue { agentSessionId?: string | null; /** Host-projected account or billing label for the active provider mode. */ accountLabel?: string | null; contextWindow?: { usedTokens?: number | null; totalTokens?: number | null; } | null; contextState: AgentStatusSectionState; quotas: readonly AgentUsageQuota[]; limitsState: AgentStatusSectionState; /** Stable host error code for the limits section. Raw provider text is forbidden. */ limitsErrorCode?: string | null; limitsCapturedAtUnixMs?: number | null; limitsStale?: boolean; } type AgentStatusRequestPhase = "idle" | "loading" | "ready" | "error"; interface AgentStatusControllerSnapshot { query: AgentStatusQuery | null; value: AgentStatusValue | null; phase: AgentStatusRequestPhase; isRefreshing: boolean; errorCode: string | null; } interface AgentStatusController { getSnapshot(): AgentStatusControllerSnapshot; subscribe(listener: () => void): () => void; open(query: AgentStatusQuery): void; close(): void; invalidate(scopeKey?: string): void; } /** Setup section requested by an AgentGUI remediation action. */ type AgentEnvPanelFocus = "detect" | "install" | "repair" | "upgrade" | "auth" | "network" | "registry"; interface OpenAgentEnvPanelInput { provider?: string | null; focus?: AgentEnvPanelFocus | null; } /** * Identifies who can remediate a visible error in the current AgentGUI view. * This is presentation-only host context; it does not alter canonical Turns * or provider error data. */ type AgentVisibleErrorPresentationScope = "local_owner" | "shared_caller"; interface AgentVisibleErrorOverride { message: string; /** Provider ids for which this product-owned override is valid. */ providers: readonly string[]; action?: { label: string; url: string; } | null; } /** * Product-owned structured errors whose copy may be supplied by a Host. * Environment/runtime errors remain canonical AgentGUI policy. */ type AgentVisibleErrorOverrideCode = "insufficient_credits"; type AgentVisibleErrorOverrides = Partial>; interface AgentGUIComposerDefaults { codexSaverMode?: boolean; model?: string | null; permissionModeId?: string | null; reasoningEffort?: string | null; speed?: string | null; } interface AgentGUIRememberComposerDefaultsInput { agentTargetId: string | null; provider: AgentGUINodeData["provider"]; defaults: AgentGUIComposerDefaults | null; } declare const rememberComposerDefaultsFields: readonly ["codexSaverMode", "model", "permissionModeId", "reasoningEffort", "speed"]; type AgentGUIComposerDefaultsField = (typeof rememberComposerDefaultsFields)[number]; interface AgentGUIRememberComposerDefaultsResult { acknowledgedFields: AgentGUIComposerDefaultsField[]; supersededFields: AgentGUIComposerDefaultsField[]; } interface AgentGUIPrefillPromptRequest { agentTargetId?: string | null; autoSubmit?: boolean; draftPrompt: string; model?: string | null; modelPlanId?: string | null; provider?: AgentGUIProvider; sequence: number; userProjectPath?: string | null; } interface AgentGUIOpenSessionRequest { agentSessionId: string; sequence: number; } interface AgentGUINodeIdentity { nodeId: string; workspaceId: string; currentUserId?: string | null; title: string; } interface AgentGUINodeWorkspace { path: string; fileReferenceAdapter?: WorkspaceFileReferenceAdapter | null; onRequestGitBranches?: AgentComposerGitBranchLoader | null; selectProjectDirectory?: () => Promise<{ path: string; } | null>; resolveExternalPromptEntries?: AgentComposerProps["resolveExternalPromptEntries"]; prepareExternalPromptFiles?: AgentComposerProps["prepareExternalPromptFiles"]; resolvePastedPath?: AgentComposerProps["resolvePastedPath"]; promptAssetLimit?: number | null; projectDirectorySourceAggregator?: ReferenceSourceAggregator | null; referenceSourceAggregator?: ReferenceSourceAggregator | null; resolveReferenceContentErrorAction?: ReferenceSourcePickerProps["resolveContentErrorAction"]; resolveReferenceEntryIconUrl?: (entry: WorkspaceFileEntry) => Promise; resolveMentionReferenceTarget?: AgentMentionReferenceTargetResolver | null; resolveReferenceInitialTarget?: AgentWorkspaceReferenceInitialTargetResolver | null; onFileReferencesAdded?: (input: { provider: AgentGUIProvider; references: readonly WorkspaceFileReference[]; }) => void | Promise; agentSettings: Pick; } interface AgentGUINodeFrameLayout { position: Point; width: number; height: number; desktopSize: DesktopSize; isMaximized?: boolean; isActive: boolean; /** Host-projected presentation visibility. Independent from node focus. */ isVisible?: boolean; embedded?: boolean; /** * Standalone windows preserve the middle conversation width and collapse * the conversation Rail before it can be compressed. Other surfaces retain * the default responsive policy. */ conversationRailAutoCollapseMode?: "preserve-middle-content"; } interface AgentGUINodeRuntimeRequests { composerAppend?: AgentGUIComposerAppendRequest | null; composerFocusSequence?: number | null; workbench?: AgentGuiWorkbenchCommandBridge | null; openSession?: AgentGUIOpenSessionRequest | null; prefillPrompt?: AgentGUIPrefillPromptRequest | null; /** On-demand status capability. Transport and owner resolution stay host-owned. */ agentStatusController?: AgentStatusController | null; } interface AgentGUINodeHostCapabilities { /** * Complete host-owned catalog for reference provenance filtering. Supplying * it explicitly opts the host into the dimensions declared by the catalog. * Omit it to keep filtering disabled unless the legacy Agent-only flag is * enabled. */ referenceProvenanceFilterCatalog?: ReferenceProvenanceCatalog | null; /** Legacy Tutti Agent-only opt-in. Prefer an explicit catalog in new hosts. */ referenceProvenanceFilterEnabled?: boolean; /** Host-owned experimental opt-in for current-Session composer history. */ sessionInputHistoryEnabled?: boolean; /** Host-owned experimental opt-in for Side and transcript selection actions. */ sideConversationEnabled?: boolean; /** Optional presentation-only bridge for rendering Side outside AgentGUI. */ sideConversationPresentation?: AgentGUISideConversationPresentation | null; /** Host-owned opt-in for launching self-owned local Sessions in git worktrees. */ sessionWorktreeEnabled?: boolean; /** Host-owned durable launch preference projection for this workspace. */ sessionLaunchModesByProjectSectionKey?: Readonly>; /** Host-owned experimental opt-in for the Codex saver-mode composer entry. */ codexSaverModeEntryEnabled?: boolean; capabilityMenuState?: AgentComposerCapabilityMenuState; /** * Keeps owner-supported Browser/Computer capability entries visible while * preventing this host from mutating device-owned capability settings. */ capabilityControlsReadOnly?: boolean; /** * Host-owned product copy and external action for structured run errors. * AgentGUI owns the generic card; product domains own product semantics. */ visibleErrorPresentationOverrides?: AgentVisibleErrorOverrides | null; /** * Presentation-only remediation authority for visible errors. Omission * retains local-owner behavior for backwards compatibility. */ visibleErrorPresentationScope?: AgentVisibleErrorPresentationScope; agentTargets?: readonly AgentGUIAgentTarget[]; agentTargetsLoading?: boolean; /** Complete presentation-only catalog for resolving Agent mention identity. */ mentionAgentTargets?: readonly AgentGUIAgentTarget[]; /** Launch-only targets for active-conversation handoff. */ handoffAgentTargets?: readonly AgentGUIAgentTarget[]; handoffAgentTargetsLoading?: boolean; /** Hidden by default; hosts may opt into ownership copy for collaborative products. */ showHandoffTargetOwnershipLabels?: boolean; providerRailAllPresentation?: AgentGUIProviderRailAllPresentation | null; providerRailMode?: AgentGUIProviderRailMode; comingSoonProviders?: readonly AgentGUIProvider[]; providerReadinessGates?: Partial> | null; /** Tutti-only presentation opt-in for placing usage refresh in the limits header. */ accountUsageRefreshInline?: boolean; /** Target-level connection for new-conversation and ordinary Composer admission. */ targetConnectionSource?: AgentGUITargetConnectionSource | null; /** * Host-owned write readiness keyed by exact pending Interaction identity. * When present for the displayed prompt, it takes precedence over target * connection and exact-Turn observation-gap presentation. */ interactionReadinessSource?: AgentGUIInteractionReadinessSource | null; /** Host-owned, ephemeral projection gap keyed by exact Session and Turn. */ observationGapSource?: AgentGUIObservationGapSource | null; defaultAgentTargetId?: string | null; providerAuthAccountLabels?: Partial>; mentionService?: RichTextMentionService; workspaceAppIcons?: readonly AgentMessageMarkdownWorkspaceAppIcon[]; disabledHomeSuggestions?: readonly AgentGUIHomeSuggestionId[]; } interface AgentGUINodeHostActions { /** Confirms that AgentGUI applied one host-issued composer append request. */ onComposerAppendHandled?: (sequence: number) => void; onLinkAction?: (action: WorkspaceLinkAction) => void; onHandoffConversation?: (input: { agentTargetId?: string | null; draftPrompt: string; provider: AgentGUIProvider; sourceAgentSessionId: string; userProjectPath?: string | null; }) => void | Promise; onCapabilitySettingsRequest?: (capability: AgentComposerCapabilitySettingsTarget) => void | Promise; onAgentProviderLogin?: (provider: AgentGUIProvider) => void; onAgentEnvPanelOpen?: (input?: OpenAgentEnvPanelInput) => void; /** * Notifies the Host when the exact target's config menu opens. Account and * Commerce refreshes remain Host-owned and must not enter Agent status. */ onAgentConfigMenuOpen?: (context: AgentGUIAgentConfigMenuContext) => void; onOpenConversationWindow?: (agentSessionId: string) => void; onClose: () => void; onResize: (frame: NodeFrame) => void; onUpdateNode: (updater: (current: AgentGUINodeData) => AgentGUINodeData) => void; onRememberComposerDefaults?: (input: AgentGUIRememberComposerDefaultsInput) => void | Promise; onSessionLaunchModePreferenceChange?: (input: { mode: AgentGUISessionLaunchMode; projectSectionKey: string; }) => void | Promise; isMuted?: boolean; onMinimize?: () => void; onToggleMaximize?: () => void; onShowMessage?: (message: string, tone?: "info" | "warning" | "error") => void; onEngagementEvent?: AgentGUIEngagementEventSink; /** * Reports live left-side rail layout width while the conversation rail is * being resized. Hosts with external chrome aligned to the rail can consume * this instead of observing package DOM/style mutations. */ onConversationRailLayoutChange?: (layout: AgentGUIConversationRailLayout) => void; } interface AgentGUIAgentConfigMenuContext { agentTargetId: string; provider: AgentGUIProvider; label: string; ownership?: AgentGUIAgentOwnership; /** The Host must render interactive account controls as ui-system menu items. */ presentation: "menu"; } interface AgentGUIConfigMenuPresentationContext { /** Interactive slot content must use ui-system DropdownMenuItem/Sub primitives. */ presentation: "menu"; } interface AgentGUINodeRenderSlots { /** Host-owned controls appended to the composer footer. */ composerFooterAccessory?: AgentGUIComposerFooterAccessoryRenderer; /** * Optional Host-owned information for an exact Agent target. AgentGUI owns * tooltip mechanics and invokes this renderer lazily for supported surfaces. */ agentTargetInfo?: AgentGUIAgentTargetInfoRenderer; /** * Optional Host chrome for the exact target's account/Commerce presentation. * Returning null preserves AgentGUI's provider account and quota content. * Interactive content must honor the supplied menu presentation contract. */ agentConfigAccount?: (context: AgentGUIAgentConfigMenuContext) => ReactNode; /** * Optional Host-owned system actions appended to the Agent config menu. * Actions must be ui-system DropdownMenuItem/Sub primitives. */ agentConfigSystemActions?: (context: AgentGUIConfigMenuPresentationContext) => ReactNode; projectDirectoryPickerHeaderActions?: ReferenceSourcePickerProps["renderHeaderActions"]; projectSelectOptions?: AgentProjectDropdownOptions; referencePickerSidebarActions?: (context: Parameters>[0] & { purpose: "directory" | "reference"; }) => ReactNode; providerRailEmpty?: AgentGUIAgentsEmptyRenderer; sidebarFooter?: (ctx: AgentGUISidebarFooterContext) => ReactNode; } interface AgentGUINodeProps { identity: AgentGUINodeIdentity; workspace: AgentGUINodeWorkspace; frame: AgentGUINodeFrameLayout; state: AgentGUINodeData; runtimeRequests: AgentGUINodeRuntimeRequests; hostCapabilities: AgentGUINodeHostCapabilities; hostActions: AgentGUINodeHostActions; renderSlots: AgentGUINodeRenderSlots; } type AgentGUIComposerFooterAccessoryContext = Pick; type AgentGUIComposerFooterAccessoryRenderer = (context: AgentGUIComposerFooterAccessoryContext) => ReactNode; type AgentMentionReferenceTargetResolver = (item: AgentContextMentionItem) => ReferenceLocateTarget | null; interface AgentWorkspaceReferenceInitialTargetInput { activeConversation: AgentGUINodeViewModel["rail"]["activeConversation"]; composerSelectedProjectPath: string | null; userProjects: AgentGUINodeViewModel["rail"]["userProjects"]; } type AgentWorkspaceReferenceInitialTargetResolver = (input: AgentWorkspaceReferenceInitialTargetInput) => ReferenceLocateTarget | null; interface AgentGUIConversationRailLayout { providerRailWidthPx: number; conversationRailWidthPx: number; leftPanelWidthPx: number; resizing: boolean; } interface AgentGUISidebarFooterContext { currentUserId?: string | null; activeConversation: AgentGUINodeViewModel["rail"]["activeConversation"]; } /** Renders the host-owned empty state for an exact provider rail. */ type AgentGUIAgentsEmptyRenderer = () => ReactNode; type AgentGUIPublicHostCapabilities = Omit; type AgentGUIPublicRenderSlots = Omit; interface AgentGUIProps extends Omit { agentDirectory: AgentGUIAgentDirectorySnapshot; /** * Complete host-owned identity catalog for rendered Agent mentions. Unlike * handoff, this directory may include unavailable targets because it does * not grant launch capability. */ mentionAgentDirectory?: AgentGUIAgentDirectorySnapshot; /** * Host-owned launch catalog for conversation handoff. When omitted, handoff * uses `agentDirectory`, preserving the single-runtime host contract. */ handoffAgentDirectory?: AgentGUIAgentDirectorySnapshot; allAgentsPresentation?: AgentGUIAllAgentsPresentation | null; renderAgentsEmpty?: AgentGUIAgentsEmptyRenderer; agentActivityRuntime: AgentGUIRuntime; agentSideConversationRuntime?: AgentSideConversationRuntime | null; agentHostApi?: AgentHostInputApi | null; tuttiModePlanReviewRuntime?: TuttiModePlanReviewRuntime | null; /** Starter entries to hide below the empty new-session composer. */ disabled?: readonly AgentGUIHomeSuggestionId[]; i18n?: I18nRuntime | null; locale?: AgentGuiI18nLocale; hostCapabilities: AgentGUIPublicHostCapabilities; renderSlots: AgentGUIPublicRenderSlots; } declare const AgentGUI: react.MemoExoticComponent<({ agentActivityRuntime, agentSideConversationRuntime, agentHostApi, tuttiModePlanReviewRuntime, agentDirectory, mentionAgentDirectory, handoffAgentDirectory, allAgentsPresentation, renderAgentsEmpty, disabled, i18n, locale, ...props }: AgentGUIProps) => JSX.Element>; export { AgentGUI, AgentGUIHomeSuggestionId, type AgentGUIProps };