import { AgentActivityNeedsAttentionItem, AgentActivitySnapshot, AgentActivityCancelSessionInput, AgentActivityCancelSessionResult, AgentActivityCreateSessionInput, AgentActivitySession, AgentActivityDeleteSessionInput, AgentActivityDeleteSessionResult, AgentActivitySendInput, AgentActivityMessageOrder, AgentActivityMessagePage, AgentActivitySubmitInteractiveInput, AgentActivitySnapshotListener } from '@tutti-os/agent-activity-core';
export { AgentActivityAdapter, AgentActivityController, AgentActivityMessage, AgentActivityNeedsAttentionItem, AgentActivitySnapshot, selectNeedsAttentionCount, selectNeedsAttentionItems } from '@tutti-os/agent-activity-core';
import { m as WorkspaceAgentActivityListViewModel, g as AgentHostWorkspaceAgentSession, f as AgentHostWorkspaceAgentMessage, l as AgentHostWorkspaceAgentSnapshot, B as BuildWorkspaceAgentActivityListOptions, d as AgentHostRuntimeOpenclawGatewayWarmupResult, A as AgentHostBatchUserInfoInput, a as AgentHostBatchUserInfoResult, b as AgentHostDeleteWorkspaceAgentSessionInput, k as AgentHostWorkspaceAgentSessionSummaryInput, j as AgentHostWorkspaceAgentSessionSummary, e as AgentHostWorkspaceAgentListInput, i as AgentHostWorkspaceAgentSessionMessagesInput, h as AgentHostWorkspaceAgentSessionMessages, c as AgentHostManagedAgentsState } from './workspaceAgentActivityListViewModel-PvLQDj60.js';
import { PropsWithChildren, JSX } from 'react';
import { I18nRuntime } from '@tutti-os/ui-i18n-runtime';
import { WorkspaceFileReferenceAdapter, WorkspaceFileReference } from '@tutti-os/workspace-file-reference/contracts';
import { W as WorkspaceLinkAction } from './workspaceLinkActions-Bwa-phu8.js';
import { AgentRichTextAtProvider } from './agent-rich-text-at-provider.js';
export { AGENT_GUI_MENTION_PROVIDER_IDS, AgentGUIMentionProviderId } from './agent-rich-text-at-provider.js';
import { AgentGuiI18nLocale } from './i18n/index.js';
export { AgentGuiI18nProvider, agentGuiI18nModule, agentGuiI18nResources } from './i18n/index.js';
import '@tutti-os/workspace-issue-manager/core';

type AgentHostAgentSessionProvider = "claude-code" | "codex" | "nexight" | "gemini" | "hermes" | "openclaw";
type AgentHostAgentSessionPermissionModeSemantic = "ask-before-write" | "accept-edits" | "locked-down" | "auto" | "full-access" | "unconfigurable";
type AgentHostAgentSessionReasoningEffort = "minimal" | "low" | "medium" | "high" | "xhigh" | string;
interface AgentHostAgentSessionPermissionModeOption {
    id: string;
    label?: string;
    description?: string;
    semantic: AgentHostAgentSessionPermissionModeSemantic;
}
interface AgentHostAgentSessionPermissionConfig {
    configurable: boolean;
    defaultValue?: string | null;
    modes: AgentHostAgentSessionPermissionModeOption[];
}
interface AgentHostAgentSessionComposerSettings {
    model?: string | null;
    reasoningEffort?: AgentHostAgentSessionReasoningEffort | null;
    planMode?: boolean;
    permissionModeId?: string | null;
}
interface AgentHostAgentSession {
    workspaceId: string;
    agentSessionId: string;
    provider: AgentHostAgentSessionProvider;
    providerSessionId: string;
    resumable?: boolean;
    cwd?: string;
    status: "ready" | "working" | "canceled" | "failed" | "completed" | string;
    title?: string;
    pinnedAtUnixMs?: number | null;
    visible?: boolean;
    permissionModeId?: string;
    permissionConfig?: AgentHostAgentSessionPermissionConfig;
    settings?: AgentHostAgentSessionComposerSettings;
    createdAtUnixMs: number;
    updatedAtUnixMs: number;
}
interface AgentHostAgentSessionInteractivePrompt {
    kind: string;
    requestId?: string;
    toolName?: string;
    status?: string;
    input?: Record<string, unknown>;
    output?: Record<string, unknown>;
    error?: Record<string, unknown>;
    metadata?: Record<string, unknown>;
}
interface AgentHostAgentSessionState {
    workspaceId: string;
    agentSessionId: string;
    provider: AgentHostAgentSessionProvider;
    providerSessionId?: string;
    resumable?: boolean;
    status: AgentHostAgentSession["status"];
    permissionModeId?: string;
    permissionConfig?: AgentHostAgentSessionPermissionConfig;
    settings?: AgentHostAgentSessionComposerSettings;
    authState?: string;
    runtimeContext?: Record<string, unknown>;
    pinnedAtUnixMs?: number | null;
    pendingInteractive?: AgentHostAgentSessionInteractivePrompt | null;
    updatedAtUnixMs: number;
}
type AgentHostAgentSessionActivationMode = "new" | "existing";
type AgentHostAgentSessionActivationStatus = "attached" | "already_attached" | "failed";
interface AgentHostActivateAgentSessionResult {
    session: AgentHostAgentSession;
    activation: {
        mode: AgentHostAgentSessionActivationMode;
        status: AgentHostAgentSessionActivationStatus;
    };
    error?: {
        code: string;
        message: string;
        debugMessage?: string;
    };
}
interface AgentHostUnactivateAgentSessionResult {
    agentSessionId: string;
    buffered: boolean;
}
interface AgentHostUpdateAgentSessionSettingsResult {
    agentSessionId: string;
    settings: AgentHostAgentSessionComposerSettings;
}

type AgentAvailabilityStatus = "available" | "unavailable" | "unknown";
type AgentQuotaType = "session" | "weekly" | "monthly" | "daily" | "model" | "cost";
interface AgentAvailabilityCheck {
    name: string;
    passed: boolean;
    detail?: string;
}
interface AgentAvailability {
    status: AgentAvailabilityStatus;
    detailsVisible: boolean;
    checks?: AgentAvailabilityCheck[];
}
interface AgentUsageQuota {
    quotaType: AgentQuotaType;
    percentRemaining?: number;
    resetsAtUnixMs?: number;
    resetText?: string;
    dollarRemaining?: number;
    modelName?: string;
}
interface AgentCostUsage {
    dollarUsed: number;
    dollarLimit?: number;
}
interface AgentUsageSnapshot {
    quotas?: AgentUsageQuota[];
    accountTier?: string;
    costUsage?: AgentCostUsage;
    capturedAtUnixMs: number;
}
interface AgentProbeAttempt {
    strategy: string;
    success: boolean;
    errorCode?: string;
    errorMessage?: string;
}
interface AgentProbeError {
    code: string;
    message?: string;
}
interface AgentProbeProvider {
    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;
    providers?: string[];
    includeUsage?: boolean;
    refresh?: boolean;
}
type AgentHostWorkspaceAgentProbesResult = AgentProbeSnapshot;

declare const APP_UPDATE_POLICIES: readonly ["off", "prompt", "auto"];
type AppUpdatePolicy = (typeof APP_UPDATE_POLICIES)[number];

interface ReadWorkspaceFileResult {
    bytes: Uint8Array;
}

interface AgentActivitySnapshotProjection {
    view: WorkspaceAgentActivityListViewModel;
    sessionsById: Record<string, AgentHostWorkspaceAgentSession>;
    sessionMessagesById: Record<string, AgentHostWorkspaceAgentMessage[]>;
    needsAttentionCount: number;
    needsAttentionItems: AgentActivityNeedsAttentionItem[];
}
declare function buildAgentActivitySnapshotProjection(snapshot: AgentActivitySnapshot, options?: BuildWorkspaceAgentActivityListOptions): AgentActivitySnapshotProjection;
declare function agentHostSnapshotFromAgentActivitySnapshot(snapshot: AgentActivitySnapshot): AgentHostWorkspaceAgentSnapshot;

interface AgentActivityRuntimeListSessionMessagesInput {
    afterVersion?: number;
    beforeVersion?: number;
    agentSessionId: string;
    limit?: number;
    order?: AgentActivityMessageOrder;
    signal?: AbortSignal;
    workspaceId: string;
}
interface AgentActivityRuntimeEnsureSessionSynchronizedInput {
    afterVersion?: number;
    agentSessionId: string;
    onError?: (error: unknown) => void;
    workspaceId: string;
}
type AgentActivityRuntimeRetainSessionEventsInput = AgentActivityRuntimeEnsureSessionSynchronizedInput;
interface AgentActivityRuntimeSetSessionPinnedInput {
    agentSessionId: string;
    pinned: boolean;
    workspaceId: string;
}
interface AgentActivityRuntimeTrackSettingsProjectChangeInput {
    action: "clear" | "create_new" | "select_existing";
    agentSessionId: string;
    provider?: string | null;
    workspaceId: string;
}
interface AgentActivityRuntimeGetSessionControlStateInput {
    agentSessionId: string;
    workspaceId: string;
}
interface AgentActivityRuntimeGetComposerOptionsInput {
    cwd?: string | null;
    force?: boolean;
    provider?: string;
    settings?: AgentHostAgentSessionComposerSettings | null;
    workspaceId: string;
}
interface AgentActivityRuntimeUpdateSessionSettingsInput {
    agentSessionId: string;
    settings: AgentHostAgentSessionComposerSettings;
    workspaceId: string;
}
interface AgentActivityRuntimeTrackDraftComposerSettingsChangeInput {
    nextSettings: AgentHostAgentSessionComposerSettings;
    previousSettings: AgentHostAgentSessionComposerSettings;
    provider: string;
    workspaceId: string;
}
interface AgentActivityRuntimeWarmupOpenclawGatewayInput {
    workspaceId?: string | null;
}
interface AgentActivityRuntimeDiagnosticInput {
    details?: Record<string, unknown>;
    event: string;
    level?: "debug" | "info" | "warn" | "error";
    source?: string;
    workspaceId?: string | null;
}
interface AgentActivityRuntimeActivateSessionInput {
    agentSessionId: string;
    cwd?: string;
    initialContent?: AgentActivitySendInput["content"];
    mode: "existing" | "new";
    openclawGatewayReady?: boolean;
    provider?: string;
    settings?: AgentHostAgentSessionComposerSettings;
    title?: string;
    visible?: boolean;
    workspaceId: string;
}
interface AgentActivityRuntimeUnactivateSessionInput {
    agentSessionId: string;
    workspaceId: string;
}
interface AgentActivityRuntimeReadSessionAttachmentInput {
    agentSessionId: string;
    attachmentId: string;
    workspaceId: string;
}
interface AgentActivityRuntimeSessionAttachment {
    attachmentId: string;
    mimeType: string;
    name?: string;
    data: string;
}
interface AgentActivityRuntime {
    cancelSession(input: AgentActivityCancelSessionInput): Promise<AgentActivityCancelSessionResult>;
    createSession(input: AgentActivityCreateSessionInput): Promise<AgentActivitySession>;
    deleteSession(input: AgentActivityDeleteSessionInput): Promise<AgentActivityDeleteSessionResult>;
    activateSession(input: AgentActivityRuntimeActivateSessionInput): Promise<AgentHostActivateAgentSessionResult>;
    getSession(workspaceId: string, agentSessionId: string): Promise<AgentActivitySession>;
    getComposerOptions(input: AgentActivityRuntimeGetComposerOptionsInput): Promise<unknown>;
    updateSessionSettings(input: AgentActivityRuntimeUpdateSessionSettingsInput): Promise<AgentHostUpdateAgentSessionSettingsResult>;
    warmupOpenclawGateway?(input?: AgentActivityRuntimeWarmupOpenclawGatewayInput): Promise<AgentHostRuntimeOpenclawGatewayWarmupResult>;
    getSessionControlState(input: AgentActivityRuntimeGetSessionControlStateInput): Promise<AgentHostAgentSessionState>;
    getSnapshot(workspaceId: string): AgentActivitySnapshot;
    listSessionMessages(input: AgentActivityRuntimeListSessionMessagesInput): Promise<AgentActivityMessagePage>;
    load(workspaceId: string, signal?: AbortSignal): Promise<AgentActivitySnapshot>;
    ensureSessionSynchronized?(input: AgentActivityRuntimeEnsureSessionSynchronizedInput): () => void;
    /** @deprecated Use ensureSessionSynchronized. */
    retainSessionEvents(input: AgentActivityRuntimeRetainSessionEventsInput): () => void;
    sendInput(input: AgentActivitySendInput): Promise<AgentActivitySession>;
    readSessionAttachment?(input: AgentActivityRuntimeReadSessionAttachmentInput): Promise<AgentActivityRuntimeSessionAttachment>;
    setSessionPinned(input: AgentActivityRuntimeSetSessionPinnedInput): Promise<AgentActivitySession>;
    trackSettingsProjectChange?(input: AgentActivityRuntimeTrackSettingsProjectChangeInput): Promise<void>;
    trackDraftComposerSettingsChange?(input: AgentActivityRuntimeTrackDraftComposerSettingsChangeInput): Promise<void>;
    reportDiagnostic?(input: AgentActivityRuntimeDiagnosticInput): Promise<void> | void;
    unactivateSession(input: AgentActivityRuntimeUnactivateSessionInput): Promise<AgentHostUnactivateAgentSessionResult>;
    submitInteractive(input: AgentActivitySubmitInteractiveInput): Promise<unknown>;
    subscribeSessionEvents(workspaceId: string, listener: (event: unknown) => void): () => void;
    subscribe(workspaceId: string, listener: AgentActivitySnapshotListener): () => void;
}
interface AgentActivityRuntimeProviderProps extends PropsWithChildren {
    runtime?: AgentActivityRuntime | null;
}
declare function AgentActivityRuntimeProvider({ children, runtime }: AgentActivityRuntimeProviderProps): JSX.Element;
declare function useAgentActivityRuntime(): AgentActivityRuntime;
declare function useOptionalAgentActivityRuntime(): AgentActivityRuntime | null;
declare function useAgentActivitySnapshot(workspaceId: string): AgentActivitySnapshot;
declare function getAgentActivityRuntime(): AgentActivityRuntime;
declare function getOptionalAgentActivityRuntime(): AgentActivityRuntime | null;
declare function resetAgentActivityRuntimeForTests(): void;
declare function setAgentActivityRuntimeForTests(runtime: AgentActivityRuntime | null): void;

type AgentHostAsyncResult<T = any> = Promise<T>;
type AgentHostRecord = Record<string, unknown>;
type AgentHostUnsubscribe = () => void;
type AgentHostWorkspaceScopedInput<T extends {
    workspaceId?: string | null;
}> = Omit<T, "workspaceId"> & {
    workspaceId: string;
};
type AgentHostWorkspaceAgentsListInput = AgentHostWorkspaceScopedInput<AgentHostWorkspaceAgentListInput>;
type AgentHostWorkspaceAgentSessionMessagesRuntimeInput = AgentHostWorkspaceScopedInput<AgentHostWorkspaceAgentSessionMessagesInput>;
type AgentHostWorkspaceAgentSessionSummaryRuntimeInput = AgentHostWorkspaceScopedInput<AgentHostWorkspaceAgentSessionSummaryInput>;
type AgentHostDeleteWorkspaceAgentSessionRuntimeInput = AgentHostWorkspaceScopedInput<AgentHostDeleteWorkspaceAgentSessionInput>;
type AgentHostClipboardApi = {
    writeText: (text: string) => AgentHostAsyncResult<void>;
};
type AgentHostDebugApi = {
    logRuntimeDiagnostics: (payload: unknown) => AgentHostAsyncResult<void> | void;
    logTerminalDiagnostics?: (payload: unknown) => AgentHostAsyncResult<void> | 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<string>;
    warmupOpenclawGateway?: (input?: unknown) => AgentHostAsyncResult<unknown>;
};
interface AgentHostSelectedFile {
    name?: string;
    path: string;
}
type AgentHostWorkspaceApi = AgentHostRecord & {
    copyPath?: (input: {
        path: string;
    }) => AgentHostAsyncResult<void>;
    ensureDirectory: (input: {
        path: string;
    }) => AgentHostAsyncResult<void>;
    getPathForFile: (file: File) => string;
    readFile: (input: {
        path: string;
    }) => AgentHostAsyncResult<ReadWorkspaceFileResult>;
    selectContextEntries?: () => AgentHostAsyncResult<{
        entries: unknown[];
    }>;
    selectDirectory: () => AgentHostAsyncResult<{
        path: string;
    } | null>;
    selectFiles: () => AgentHostAsyncResult<AgentHostSelectedFile[]>;
    writeFileText: (input: {
        content: string;
        path: string;
    }) => AgentHostAsyncResult<unknown>;
};
interface AgentHostInputApi {
    account?: AgentHostAccountApi;
    agentGuiBatch?: AgentHostAgentGuiBatchApi;
    agentSessions?: AgentHostAgentSessionsApi;
    clipboard: AgentHostClipboardApi;
    debug?: AgentHostDebugApi;
    filesystem: AgentHostFilesystemApi;
    meta?: AgentHostMetaApi;
    onHostEvent?: (listener: (event: any) => void) => AgentHostUnsubscribe;
    runtime?: AgentHostEnvironmentApi;
    userProjects?: AgentHostUserProjectsApi;
    workspace: AgentHostWorkspaceApi;
    workspaceAgentProbes?: AgentHostWorkspaceAgentProbesApi;
    workspaceAgents?: AgentHostWorkspaceAgentsApi;
}
type AgentHostApi = AgentHostInputApi;
type AgentHostAccountApi = AgentHostRecord & {
    batchGetUserInfo: (input: AgentHostBatchUserInfoInput) => AgentHostAsyncResult<AgentHostBatchUserInfoResult>;
    ensureProfiles?: (input: any) => AgentHostAsyncResult<any>;
};
type AgentHostAgentGuiBatchApi = AgentHostRecord & {
    exportRun: (input: any) => AgentHostAsyncResult<any>;
};
type AgentHostWorkspaceAgentProbesApi = AgentHostRecord & {
    list: (input: AgentHostListWorkspaceAgentProbesInput) => AgentHostAsyncResult<AgentHostWorkspaceAgentProbesResult>;
};
type AgentProviderProbeListInput = AgentHostListWorkspaceAgentProbesInput;
type AgentProviderProbeListResult = AgentHostWorkspaceAgentProbesResult;
interface AgentHostUserProject {
    id: string;
    path: string;
    label: string;
    createdAtUnixMs?: number;
    updatedAtUnixMs?: number;
    lastUsedAtUnixMs?: number;
}
type AgentHostUserProjectsApi = AgentHostRecord & {
    checkPath?: (input: {
        path: string;
    }) => AgentHostAsyncResult<{
        exists: boolean;
        isDirectory: boolean;
        path: string;
    }>;
    create?: (input: {
        name: string;
    }) => AgentHostAsyncResult<AgentHostUserProject>;
    getDefaultSelection?: () => AgentHostAsyncResult<{
        path: string | null;
    } | null>;
    list: () => AgentHostAsyncResult<{
        projects: AgentHostUserProject[];
    }>;
    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<void>;
    isNoProjectPath?: (input: {
        path: string;
    }) => boolean;
    rememberDefaultSelection?: (input: {
        path: string | null;
    }) => AgentHostAsyncResult<void>;
    use: (input: {
        path: string;
    }) => AgentHostAsyncResult<AgentHostUserProject>;
};
type AgentHostAgentSessionsApi = AgentHostRecord & {
    activate: (input: any) => AgentHostAsyncResult<any>;
    /**
     * @deprecated AgentGUI production writes must use AgentActivityRuntime.cancelSession.
     */
    cancel: (input: any) => AgentHostAsyncResult<any>;
    /**
     * @deprecated AgentGUI production writes must use AgentActivityRuntime.sendInput.
     */
    exec: (input: any) => AgentHostAsyncResult<any>;
    getComposerOptions?: (input: any) => AgentHostAsyncResult<any>;
    getState: (input: any) => AgentHostAsyncResult<any>;
    onEvent?: (listener: (event: any) => void) => AgentHostUnsubscribe;
    /**
     * @deprecated AgentGUI production writes must use AgentActivityRuntime.setSessionPinned.
     */
    pinSession?: (input: any) => AgentHostAsyncResult<any>;
    /**
     * @deprecated AgentGUI production sync must use AgentActivityRuntime.ensureSessionSynchronized.
     */
    releaseEventStream?: (input?: any) => AgentHostAsyncResult;
    /**
     * @deprecated AgentGUI production sync must use AgentActivityRuntime.ensureSessionSynchronized.
     */
    retainEventStream?: (input: any) => AgentHostAsyncResult;
    /**
     * @deprecated AgentGUI production writes must use AgentActivityRuntime.submitInteractive.
     */
    submitInteractive: (input: any) => AgentHostAsyncResult<any>;
    /**
     * @deprecated AgentGUI production UI must derive events from AgentActivityRuntime snapshots.
     */
    trackSettingsProjectChange?: (input: {
        action: "clear" | "create_new" | "select_existing";
        agentSessionId: string;
        provider?: string | null;
    }) => AgentHostAsyncResult<void>;
    subscribeEvents: (input: any, listener: (event: any) => void) => AgentHostUnsubscribe;
    unactivate: (input: any) => AgentHostAsyncResult<any>;
    updateSettings: (input: any) => AgentHostAsyncResult<any>;
};
/**
 * @deprecated Legacy host DTO projection. AgentGUI production reads and writes
 * must use AgentActivityRuntime and AgentActivity* models.
 */
type AgentHostWorkspaceAgentsApi = AgentHostRecord & {
    /**
     * @deprecated Use AgentActivityRuntime.deleteSession.
     */
    deleteSession: (input: AgentHostDeleteWorkspaceAgentSessionRuntimeInput) => AgentHostAsyncResult<any>;
    /**
     * @deprecated Derive summaries from AgentActivitySnapshot/session messages.
     */
    getSessionSummary: (input: AgentHostWorkspaceAgentSessionSummaryRuntimeInput) => AgentHostAsyncResult<AgentHostWorkspaceAgentSessionSummary>;
    /**
     * @deprecated Use AgentActivityRuntime.load/getSnapshot.
     */
    list: (input: string | AgentHostWorkspaceAgentsListInput) => AgentHostAsyncResult<AgentHostWorkspaceAgentSnapshot>;
    /**
     * @deprecated Use AgentActivityRuntime.listSessionMessages.
     */
    listSessionMessages: (input: AgentHostWorkspaceAgentSessionMessagesRuntimeInput) => AgentHostAsyncResult<AgentHostWorkspaceAgentSessionMessages>;
};
interface AgentHostRuntimeApi {
    account?: AgentHostAccountApi;
    agentGuiBatch: AgentHostAgentGuiBatchApi;
    clipboard: AgentHostClipboardApi;
    debug?: AgentHostDebugApi;
    filesystem: AgentHostFilesystemApi;
    meta?: AgentHostMetaApi;
    onHostEvent?: (listener: (event: any) => void) => AgentHostUnsubscribe;
    runtime?: AgentHostEnvironmentApi;
    userProjects?: AgentHostUserProjectsApi;
    workspace: AgentHostWorkspaceApi;
    workspaceAgentProbes?: AgentHostWorkspaceAgentProbesApi;
}

type AgentCustomModelEnabledByProvider<TProvider extends string> = Record<TProvider, boolean>;
type AgentCustomModelByProvider<TProvider extends string> = Record<TProvider, string>;
type AgentCustomModelOptionsByProvider<TProvider extends string> = Record<TProvider, string[]>;

declare const AGENT_PROVIDERS: readonly ["claude-code", "codex", "nexight", "opencode", "gemini", "openclaw", "hermes"];
type AgentProvider = (typeof AGENT_PROVIDERS)[number];

type FocusNodeTargetZoom = number;

declare const UI_LANGUAGES: readonly ["en", "zh-CN"];
type UiLanguage = (typeof UI_LANGUAGES)[number];
declare const UI_THEMES: readonly ["system", "light", "dark"];
type UiTheme = (typeof UI_THEMES)[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<Record<CommandId, KeyChord | null>>;

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<AgentProvider, AgentEnvRow[]>;

type TerminalProfileId = string | null;
interface AgentSettings {
    language: UiLanguage;
    uiTheme: UiTheme;
    isPrimarySidebarCollapsed: boolean;
    defaultProvider: AgentProvider;
    agentProviderOrder: AgentProvider[];
    agentFullAccess: boolean;
    defaultTerminalProfileId: TerminalProfileId;
    customModelEnabledByProvider: AgentCustomModelEnabledByProvider<AgentProvider>;
    customModelByProvider: AgentCustomModelByProvider<AgentProvider>;
    customModelOptionsByProvider: AgentCustomModelOptionsByProvider<AgentProvider>;
    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 AgentGUINodeData {
    provider: AgentGUIProvider;
    lastActiveAgentSessionId: string | null;
    lastActiveConversationTitle?: string | null;
    conversationCount?: number | null;
    conversationRailWidthPx?: number | null;
    conversationRailCollapsed?: boolean | null;
    composerOverrides?: AgentHostAgentSessionComposerSettings | null;
    composerOverridesByProvider?: Partial<Record<AgentGUIProvider, AgentHostAgentSessionComposerSettings | null>> | null;
}
type AgentGUIProvider = Extract<AgentProvider, "claude-code" | "codex" | "nexight" | "gemini" | "hermes" | "openclaw">;
interface Size {
    width: number;
    height: number;
}
interface Point {
    x: number;
    y: number;
}
interface NodeFrame {
    position: Point;
    size: Size;
}

interface DesktopSize {
    width: number;
    height: number;
    bottomInset?: number;
}
/** Workspace-scoped agent probes for currently visible Agent GUI windows. */
interface WorkspaceDesktopAgentProbesState {
    snapshot: AgentProbeSnapshot | null;
    isLoadingAvailability: boolean;
    isLoadingUsage: boolean;
}
type WorkspaceDesktopAgentProbeDemandChange = (provider: AgentProvider | null, sourceId?: string) => void;

interface AgentMessageMarkdownWorkspaceAppIcon {
    appId: string;
    iconUrl: string | null;
    workspaceId?: string | null;
}

interface AgentGUINodeProps {
    nodeId: string;
    workspaceId: string;
    currentUserId?: string | null;
    workspacePath: string;
    workspaceFileReferenceAdapter?: WorkspaceFileReferenceAdapter | null;
    agentSettings: Pick<AgentSettings, "avoidGroupingEdits">;
    title: string;
    state: AgentGUINodeData;
    position: Point;
    width: number;
    height: number;
    desktopSize: DesktopSize;
    onLinkAction?: (action: WorkspaceLinkAction) => void;
    onAgentProviderLogin?: (provider: AgentProvider) => void;
    onWorkspaceFileReferencesAdded?: (input: {
        provider: AgentProvider;
        references: readonly WorkspaceFileReference[];
    }) => void | Promise<void>;
    onClose: () => void;
    onResize: (frame: NodeFrame) => void;
    onUpdateNode: (updater: (current: AgentGUINodeData) => AgentGUINodeData) => void;
    isMaximized?: boolean;
    isActive: boolean;
    composerFocusRequestSequence?: number | null;
    showProjectSelector?: boolean;
    isMuted?: boolean;
    onMinimize?: () => void;
    onToggleMaximize?: () => void;
    onShowMessage?: (message: string, tone?: "info" | "warning" | "error") => void;
    workspaceAgentProbes?: WorkspaceDesktopAgentProbesState | null;
    onAgentProbeDemandChange?: WorkspaceDesktopAgentProbeDemandChange;
    managedAgentsState?: AgentHostManagedAgentsState | null;
    richTextAtProviders?: readonly AgentRichTextAtProvider[];
    workspaceAppIcons?: readonly AgentMessageMarkdownWorkspaceAppIcon[];
    embedded?: boolean;
    previewMode?: boolean;
}

interface AgentGUIProps extends AgentGUINodeProps {
    agentActivityRuntime: AgentActivityRuntime;
    agentHostApi?: AgentHostInputApi | null;
    embedded?: boolean;
    i18n?: I18nRuntime<string> | null;
    locale?: AgentGuiI18nLocale;
}
declare function AgentGUI({ agentActivityRuntime, agentHostApi, i18n, locale, ...props }: AgentGUIProps): JSX.Element;

declare const agentGuiDockIconUrl: string;
declare const agentGuiDockIconUrls: {
    readonly "claude-code": string;
    readonly codex: string;
    readonly gemini: string;
    readonly hermes: string;
    readonly nexight: string;
    readonly openclaw: string;
};

interface AgentGUIExpandedWindowFrameInput {
    position: {
        x: number;
        y: number;
    };
    width: number;
    height: number;
    desktopSize: {
        width: number;
        height: number;
    };
    conversationRailWidthPx: number | null | undefined;
}
declare function shouldAutoCollapseAgentGUIConversationRail(containerWidthPx: number): boolean;
declare function resolveAgentGUIExpandedWindowFrame(input: AgentGUIExpandedWindowFrameInput): {
    position: {
        x: number;
        y: number;
    };
    size: {
        width: number;
        height: number;
    };
};

interface AgentActivityHostProviderProps extends PropsWithChildren {
    agentActivityRuntime?: AgentActivityRuntime | null;
    agentHostApi?: AgentHostInputApi | null;
}
declare function AgentActivityHostProvider({ agentActivityRuntime, agentHostApi, children }: AgentActivityHostProviderProps): JSX.Element;

export { AgentActivityHostProvider, type AgentActivityHostProviderProps, type AgentActivityRuntime, type AgentActivityRuntimeListSessionMessagesInput, AgentActivityRuntimeProvider, type AgentActivityRuntimeProviderProps, type AgentActivityRuntimeRetainSessionEventsInput, type AgentActivityRuntimeSetSessionPinnedInput, type AgentActivityRuntimeUpdateSessionSettingsInput, type AgentActivityRuntimeWarmupOpenclawGatewayInput, type AgentActivitySnapshotProjection, AgentGUI, type AgentGUIProps, AgentGuiI18nLocale, type AgentHostApi, type AgentHostInputApi, type AgentHostRuntimeApi, type AgentProbeProvider, type AgentProbeSnapshot, type AgentProviderProbeListInput, type AgentProviderProbeListResult, AgentRichTextAtProvider, type AgentUsageQuota, type AgentUsageSnapshot, agentGuiDockIconUrl, agentGuiDockIconUrls, agentHostSnapshotFromAgentActivitySnapshot, buildAgentActivitySnapshotProjection, getAgentActivityRuntime, getOptionalAgentActivityRuntime, resetAgentActivityRuntimeForTests, resolveAgentGUIExpandedWindowFrame, setAgentActivityRuntimeForTests, shouldAutoCollapseAgentGUIConversationRail, useAgentActivityRuntime, useAgentActivitySnapshot, useOptionalAgentActivityRuntime };
