export declare const CHAT_FIRST_MODE_STORAGE_KEY = "agent-native:chat-first-mode:v1"; export declare const CHAT_FIRST_APP_LAYOUT_STORAGE_KEY = "agent-native:chat-first-app-layout:v1"; export declare const CHAT_FIRST_SURFACE_TABS_STORAGE_KEY = "agent-native:chat-first-surface-tabs:v1"; export declare const CHAT_FIRST_SURFACE_WIDTH_STORAGE_KEY = "agent-native:chat-first-surface-width:v2"; export declare const CHAT_FIRST_SURFACE_PANEL_STORAGE_KEY = "agent-native:chat-first-surface-panel:v1"; export declare const CHAT_FIRST_MODE_CHANGED_EVENT = "agentNative:chatFirstModeChanged"; export declare const CHAT_FIRST_OPEN_APP_EVENT = "agentNative:openApp"; export declare const CHAT_FIRST_OPEN_BROWSER_EVENT = "agentNative:openBrowser"; export declare const CHAT_FIRST_WATCH_SESSION_EVENT = "agentNative:watchSession"; export type ChatFirstOpenAppDetail = { app?: string; path?: string; url?: string; view?: string; }; export type ChatFirstOpenBrowserDetail = { url?: string; title?: string; }; export type ChatFirstSessionKind = "code-agent" | "agent-chat" | "external"; export interface ChatFirstSessionReference { sessionId: string; title?: string; kind?: ChatFirstSessionKind; goalId?: string; sourceSessionId?: string; } export type ChatFirstSessionWatchState = { target: ChatFirstSessionReference | null; }; export interface ChatFirstSessionWatchStore { getSnapshot: () => ChatFirstSessionWatchState; subscribe: (listener: () => void) => () => void; hasSubscribers: () => boolean; open: (target: ChatFirstSessionReference) => void; close: () => void; } export type ChatFirstSurfaceKind = "app" | "browser" | "terminal" | "diff" | "files" | "side-chat" | "agents"; export type ChatFirstAppSurfacePlacement = "main" | "side"; export interface ChatFirstSurfaceTab { id: string; kind: ChatFirstSurfaceKind; title: string; appId?: string; placement?: ChatFirstAppSurfacePlacement; path?: string; view?: string; url?: string; session?: ChatFirstSessionReference; disabledReason?: string; } export type ChatFirstAgentActivityStatus = "queued" | "running" | "paused" | "needs-approval" | "completed" | "errored" | "recent" | "unknown"; export interface ChatFirstAgentActivity { sessionId: string; title: string; subtitle?: string; status: ChatFirstAgentActivityStatus; updatedAt?: string | number; progressPercent?: number; goalId?: string; } export interface ChatFirstSurfaceTabsState { tabs: ChatFirstSurfaceTab[]; activeTabId: string | null; } export interface ChatFirstSurfaceTabsStore { getSnapshot: () => ChatFirstSurfaceTabsState; subscribe: (listener: () => void) => () => void; open: (tab: ChatFirstSurfaceTab) => void; activate: (tabId: string) => void; close: (tabId: string) => void; closeOthers: (tabId: string) => void; closeToRight: (tabId: string) => void; closeAll: () => void; } export interface ChatFirstSurfacePanelState { open: boolean; } export interface ChatFirstSurfacePanelStore { getSnapshot: () => ChatFirstSurfacePanelState; subscribe: (listener: () => void) => () => void; setOpen: (open: boolean) => void; toggle: () => void; } export declare const CHAT_FIRST_SURFACE_CATALOG: readonly { kind: ChatFirstSurfaceKind; label: string; description: string; availability: "both" | "desktop" | "deferred"; disabledReason?: string; }[]; export declare function chatFirstSurfaceTabId(kind: ChatFirstSurfaceKind, value: string): string; export declare const CHAT_FIRST_SURFACE_WIDTH_DEFAULT = 380; export declare const CHAT_FIRST_SURFACE_WIDTH_MIN = 320; export declare const CHAT_FIRST_DEFAULT_APP_IDS: readonly ["content", "design", "mail", "calendar", "clips"]; export declare function clampChatFirstSurfaceWidth(value: number, viewportWidth?: number): number; export declare function readChatFirstSurfaceWidth(scope?: string, storage?: StringStorage | null): number; export declare function writeChatFirstSurfaceWidth(width: number, scope?: string, storage?: StringStorage | null): { ok: true; } | { ok: false; reason: "unavailable" | "write-failed"; }; export declare function useChatFirstSurfaceResize(scope?: string): { width: number; isResizing: boolean; onPointerDown: (event: { clientX: number; preventDefault: () => void; }) => void; }; export declare function getChatFirstSurfacePanelStore(scope?: string): ChatFirstSurfacePanelStore; export declare function useChatFirstSurfacePanel(scope?: string): { open: boolean; setOpen: (open: boolean) => void; toggle: () => void; }; export interface ChatFirstSessionWatchDelivery { delivered: boolean; reason?: "empty-detail" | "no-listener"; } export type ChatFirstBrowserResolution = { status: "ready"; target: { url: string; title?: string; openExternally?: boolean; }; } | { status: "unresolved"; reason: "empty-detail" | "invalid-url"; }; export type ChatFirstAppSource = "workspace" | "builtin" | "connected"; export interface ChatFirstAppRegistration { id: string; name?: string; /** Mounted workspace app, first-party built-in, or connected remote agent. */ source?: ChatFirstAppSource; enabled?: boolean; url?: string | null; devUrl?: string | null; path?: string | null; homePath?: string | null; } export interface ChatFirstAppTarget { appId: string; path?: string; view?: string; } export type ChatFirstAppResolution = { status: "ready"; target: ChatFirstAppTarget; } | { status: "unresolved"; reason: "empty-detail" | "unknown-app" | "invalid-url"; }; export interface ChatFirstOpenAppDelivery { delivered: boolean; reason?: "empty-detail" | "no-listener"; } export interface ChatFirstAppLayoutPreference { pinnedIds: string[]; orderedIds: string[]; } export interface ChatFirstModeReadResult { enabled: boolean; availability: "available" | "unavailable"; } type StringStorage = Pick; export declare function readChatFirstModeState(storage?: StringStorage | null): ChatFirstModeReadResult; export declare function readChatFirstMode(storage?: StringStorage | null): boolean; export declare function writeChatFirstMode(enabled: boolean, storage?: StringStorage | null): { ok: true; } | { ok: false; reason: "unavailable" | "write-failed"; }; export declare function readChatFirstAppLayout(storage?: StringStorage | null): ChatFirstAppLayoutPreference; export declare function writeChatFirstAppLayout(layout: ChatFirstAppLayoutPreference, storage?: StringStorage | null): { ok: true; } | { ok: false; reason: "unavailable" | "write-failed"; }; export declare function orderChatFirstAppIds(appIds: readonly string[], layout: ChatFirstAppLayoutPreference, preferredAppIds?: readonly string[]): string[]; export declare function resolveChatFirstBrowserTarget(detail: ChatFirstOpenBrowserDetail): ChatFirstBrowserResolution; type ChatFirstOpenAppListener = (detail: ChatFirstOpenAppDetail) => void; type ChatFirstOpenBrowserListener = (detail: ChatFirstOpenBrowserDetail) => void; export declare function resolveChatFirstSessionId(value: unknown): string | null; export declare function normalizeChatFirstSessionReference(value: unknown): ChatFirstSessionReference | null; export declare function getChatFirstSessionWatchStore(): ChatFirstSessionWatchStore; export declare function useChatFirstSessionWatch(): ChatFirstSessionWatchState; export declare function subscribeChatFirstSessionWatch(listener: (target: ChatFirstSessionReference) => void): () => void; export declare function emitChatFirstSessionWatch(detail: unknown): ChatFirstSessionWatchDelivery; export declare function closeChatFirstSessionWatch(): void; export declare function getChatFirstSurfaceTabsStore(scope?: string): ChatFirstSurfaceTabsStore; export declare function useChatFirstSurfaceTabs(scope?: string): ChatFirstSurfaceTabsState; export declare function subscribeChatFirstOpenApp(listener: ChatFirstOpenAppListener): () => void; export declare function emitChatFirstOpenApp(detail: ChatFirstOpenAppDetail): ChatFirstOpenAppDelivery; export declare function subscribeChatFirstOpenBrowser(listener: ChatFirstOpenBrowserListener): () => void; export declare function emitChatFirstOpenBrowser(detail: ChatFirstOpenBrowserDetail): ChatFirstOpenAppDelivery; export declare function shouldOpenChatFirstBrowserExternally(value: string): boolean; export declare function resolveChatFirstAppTarget(detail: ChatFirstOpenAppDetail, apps: readonly ChatFirstAppRegistration[], options?: { currentOrigin?: string; }): ChatFirstAppResolution; export {};