import { ReactElement, ReactNode } from 'react'; import { AgentSessionEngineState, AgentSessionEngine } from '@tutti-os/agent-activity-core'; import { WorkbenchFrame, WorkbenchHostDockEntry, WorkbenchHostLaunchRequest, WorkbenchHostNodeBodyContext, WorkbenchContribution } from '@tutti-os/workbench-surface'; import { AgentGuiWorkbenchProvider, AgentGuiWorkbenchState } from './workbench/types.js'; declare const AGENT_GUI_WORKBENCH_COMMAND_EVENT = "tutti:agent-gui-workbench-command"; type AgentGuiWorkbenchSessionAction = "rename" | "copy-markdown" | "copy-reference"; declare function isAgentGuiWorkbenchSessionAction(value: unknown): value is AgentGuiWorkbenchSessionAction; type AgentGuiWorkbenchCommand = { type: "new-conversation"; instanceId: string; } | { type: "conversation-rail-toggle"; conversationRailCollapsed: boolean; instanceId: string; } | { type: "session-action"; action: AgentGuiWorkbenchSessionAction; agentSessionId: string | null; instanceId: string; }; interface AgentGuiWorkbenchCommandBridge { instanceId: string; onConversationRailToggle?(conversationRailCollapsed: boolean): void; } declare function dispatchAgentGuiWorkbenchCommand(command: AgentGuiWorkbenchCommand): void; interface AgentGuiWorkbenchSessionMenuCopy { moreSessionActions: string; renameSession: string; copyAsMarkdown: string; copyAsReference: string; } /** * Open runtime metadata reported by an Agent Target. * * Built-in providers still use AgentProvider, while externally installed ACP * extensions use namespaced values such as `acp:gemini`. */ type AgentGUIProvider = string; type AgentGUIAgentAvailabilityStatus = "ready" | "checking" | "coming_soon" | "not_installed" | "auth_required" | "unavailable"; type AgentGUIAgentAvailabilityAction = "install" | "login" | "refresh"; interface AgentGUIAgentAvailability { status: AgentGUIAgentAvailabilityStatus; reason?: string | null; pendingAction?: AgentGUIAgentAvailabilityAction | null; } interface AgentGUIAgentOwner { userId?: string | null; name?: string | null; avatarUrl?: string | null; } /** Host-authoritative ownership classification for Agent directory entries. */ type AgentGUIAgentOwnership = "self" | "shared"; interface AgentGUISharedAgentQuota { unit: "runs" | "tokens"; remaining: number; limit?: number; resetAt?: string | null; } interface AgentGUISharedAgentConcurrency { active: number; limit: number; } interface AgentGUISharedAgentCostQuota { currency: string; remainingMicros: number; limitMicros?: number; } interface AgentGUISharedAgentAllowedModel { modelPlanId?: string | null; model: string; } interface AgentGUISharedAgentPolicyPermissions { consult: boolean; review: boolean; delegate: boolean; upgrade: boolean; } /** Credential-free access snapshot supplied by the shared-Agent control plane. */ interface AgentGUISharedAgentAccess { grantId: string; ownerUserId: string; ownerOnline: boolean; auditRequired: boolean; quota?: AgentGUISharedAgentQuota | null; concurrency?: AgentGUISharedAgentConcurrency | null; costQuota?: AgentGUISharedAgentCostQuota | null; allowedModels?: readonly AgentGUISharedAgentAllowedModel[] | null; policyPermissions?: AgentGUISharedAgentPolicyPermissions | null; } /** * Host-projected entry from the workspace `/agents` directory. * * `agentTargetId` is the only UI and launch identity. `provider` remains * execution metadata for provider-native composer/runtime policy and must not * be used to group, deduplicate, name, or select entries. */ interface AgentGUIAgent { agentTargetId: string; name: string; iconUrl: string; /** Single-color artwork rendered through the conversation rail CSS mask. */ maskIconUrl?: string | null; heroImageUrl?: string | null; description?: string | null; /** Host-resolved display name of the device that owns this Agent target. */ ownerDeviceLabel?: string | null; owner?: AgentGUIAgentOwner | null; ownership?: AgentGUIAgentOwnership | null; sharedAccess?: AgentGUISharedAgentAccess | null; availability: AgentGUIAgentAvailability; provider: AgentGUIProvider; /** * False when this exact target routes model access through a Host-owned * Model Plan, so the Runtime provider's native account usage is unrelated. * Omitted values preserve the ordinary provider account-usage behavior. */ providerAccountUsageApplicable?: boolean; setupKind?: "target_runtime" | null; } type AgentGUIAgentDirectoryStatus = "idle" | "loading" | "ready" | "error"; interface AgentGUIAgentDirectorySnapshot { agents: readonly AgentGUIAgent[]; capturedAtUnixMs: number | null; error: string | null; status: AgentGUIAgentDirectoryStatus; } interface AgentGUIAgentDirectoryPort { getSnapshot(): AgentGUIAgentDirectorySnapshot; subscribe(listener: () => void): () => void; } interface AgentGUIAgentTargetRef { kind: string; provider: AgentGUIProvider; [key: string]: unknown; } interface AgentGUIAgentTargetBadge { iconUrl: string; label?: string; } interface AgentGUIAgentTarget { targetId: string; agentTargetId?: string | null; provider: AgentGUIProvider; ref: AgentGUIAgentTargetRef; label: string; description?: string; iconUrl?: string | null; maskIconUrl?: string | null; heroImageUrl?: string | null; badge?: AgentGUIAgentTargetBadge | null; ownerLabel?: string; ownerDeviceLabel?: string; ownership?: AgentGUIAgentOwnership; availability?: AgentGUIAgentAvailability; /** Host projection of whether provider-native account usage applies here. */ providerAccountUsageApplicable?: boolean; disabled?: boolean; unavailableReason?: string; } /** * Product-neutral surfaces where a Host may enrich an exact Agent target. * AgentGUI owns the trigger, positioning, and interaction behavior; the Host * owns only the rendered information. */ type AgentGUIAgentTargetInfoSurface = "provider-rail" | "conversation-rail" | "workbench-header"; interface AgentGUIAgentTargetInfoRenderContext { surface: AgentGUIAgentTargetInfoSurface; target: AgentGUIAgentTarget; } /** * Renders Host-owned presentation for an exact Agent target. * * AgentGUI invokes this renderer lazily only while its tooltip content is * mounted. Returning null preserves the built-in target-label fallback. */ type AgentGUIAgentTargetInfoRenderer = (context: AgentGUIAgentTargetInfoRenderContext) => ReactElement | null; interface AgentGUIConversationRailLayout { providerRailWidthPx: number; conversationRailWidthPx: number; leftPanelWidthPx: number; resizing: boolean; } interface AgentGuiWorkbenchConversationIdentity { agentTargetId?: string | null; agentTitle?: string | null; iconUrl?: string | null; title: string | null; titleDisplayPrompt?: string | null; } declare function resolveAgentGuiWorkbenchConversationIdentity(input: { agents: readonly AgentGUIAgent[]; dockIconUrls?: Partial>; engineState: AgentSessionEngineState; workbenchState: AgentGuiWorkbenchState | null; }): AgentGuiWorkbenchConversationIdentity | null; declare function agentGuiWorkbenchConversationIdentitiesEqual(left: AgentGuiWorkbenchConversationIdentity | null, right: AgentGuiWorkbenchConversationIdentity | null): boolean; declare const agentGuiWorkbenchDefaultNodeFrame: WorkbenchFrame; declare const agentGuiWorkbenchDefaultUsableWidthRatio = 0.9; declare const agentGuiWorkbenchDefaultUsableHeightRatio = 0.9; declare const agentGuiWorkbenchCompactVisibleAreaRatio = 0.9; declare const agentGuiWorkbenchNewWindowCascadeOffset: { x: number; y: number; }; declare const agentGuiWorkbenchProviderRailWidthPx = 52; declare const agentGuiWorkbenchDefaultCopy: AgentGuiWorkbenchContributionCopy; type AgentGuiWorkbenchProviderAvailability = Partial>; type AgentGuiWorkbenchProviderAvailabilitySource = AgentGuiWorkbenchProviderAvailability | (() => AgentGuiWorkbenchProviderAvailability); interface BuildAgentGuiDockEntriesInput { agentDirectory: AgentGUIAgentDirectoryPort; defaultProvider?: AgentGuiWorkbenchProvider | null; dockEntryId?: string; dockIconUrls?: Partial>; label?: string; order?: number; providerAvailability?: AgentGuiWorkbenchProviderAvailabilitySource; resolveDockPopupIdentity?: CreateAgentGuiWorkbenchContributionInput["resolveDockPopupIdentity"]; resolveDockPopupTitle?: CreateAgentGuiWorkbenchContributionInput["resolveDockPopupTitle"]; sectionId?: string; unifiedDockIconUrl?: string; } declare function buildAgentGuiDockEntries(input: BuildAgentGuiDockEntriesInput): WorkbenchHostDockEntry[]; declare function resolveAgentGuiUnifiedDockLaunchPayload(input: Pick): { provider: AgentGuiWorkbenchProvider; agentTargetId?: string; }; declare function resolveAgentGuiWorkbenchDefaultLaunchFrame(input: { frame: WorkbenchFrame; request: Pick; }): WorkbenchFrame; declare function resolveAgentGuiWorkbenchContributionCopy(copy?: AgentGuiWorkbenchContributionCopyOverrides): AgentGuiWorkbenchContributionCopy; /** * Fired when the empty-hero "Import session" suggestion is chosen. The host * chrome (which owns the external-agent import wizard state) listens for this * and opens the wizard. */ declare const AGENT_GUI_WORKBENCH_OPEN_EXTERNAL_IMPORT_EVENT = "tutti:agent-gui-workbench-open-external-import"; interface AgentGuiWorkbenchContributionCopy { collapseConversationRail: string; close: string; expandConversationRail: string; fallbackAgentLabel: string; maximize: string; minimize: string; newConversation: string; nodeTitle: string; openDetachedWindow: string; restore: string; untitledConversation: string; sessionMenu?: AgentGuiWorkbenchSessionMenuCopy | null; } type AgentGuiWorkbenchContributionCopyOverrides = Partial; interface AgentGuiWorkbenchRenderBodyHelpers { agentDirectory: AgentGUIAgentDirectoryPort; agentTargetId: string | null; nodeTypeId: string; onConversationRailLayoutChange(layout: AgentGUIConversationRailLayout): void; onStateChange(state: AgentGuiWorkbenchState): void; provider: AgentGuiWorkbenchProvider | null; } interface CreateAgentGuiWorkbenchContributionInput { agentDirectory: AgentGUIAgentDirectoryPort; copy?: AgentGuiWorkbenchContributionCopyOverrides; defaultProvider?: AgentGuiWorkbenchProvider | null; dockIconUrls?: Partial>; dockSectionId?: string; frame?: WorkbenchFrame; id?: string; providerAvailability?: AgentGuiWorkbenchProviderAvailabilitySource; renderBody(context: WorkbenchHostNodeBodyContext, helpers: AgentGuiWorkbenchRenderBodyHelpers): ReactNode; resolveDockPopupTitle?: (state: AgentGuiWorkbenchState | null) => string | null; resolveDockPopupIdentity?: (state: AgentGuiWorkbenchState | null) => AgentGuiWorkbenchConversationIdentity | null; sessionEngine?: AgentSessionEngine; onOpenDetachedWindow?: (input: { agentSessionId?: string | null; agentTargetId?: string | null; provider: AgentGuiWorkbenchProvider; workspaceId: string; }) => void | Promise; unifiedDockIconUrl?: string; workspaceId: string; } declare function createAgentGuiWorkbenchContribution(input: CreateAgentGuiWorkbenchContributionInput): WorkbenchContribution; export { AGENT_GUI_WORKBENCH_COMMAND_EVENT as A, type BuildAgentGuiDockEntriesInput as B, type CreateAgentGuiWorkbenchContributionInput as C, resolveAgentGuiUnifiedDockLaunchPayload as D, resolveAgentGuiWorkbenchContributionCopy as E, resolveAgentGuiWorkbenchConversationIdentity as F, resolveAgentGuiWorkbenchDefaultLaunchFrame as G, AGENT_GUI_WORKBENCH_OPEN_EXTERNAL_IMPORT_EVENT as a, type AgentGUIAgentTarget as b, type AgentGUIAgentTargetInfoRenderer as c, type AgentGUIConversationRailLayout as d, type AgentGuiWorkbenchCommand as e, type AgentGuiWorkbenchCommandBridge as f, type AgentGuiWorkbenchContributionCopy as g, type AgentGuiWorkbenchContributionCopyOverrides as h, type AgentGuiWorkbenchConversationIdentity as i, type AgentGuiWorkbenchProviderAvailability as j, type AgentGuiWorkbenchProviderAvailabilitySource as k, type AgentGuiWorkbenchRenderBodyHelpers as l, type AgentGuiWorkbenchSessionAction as m, type AgentGuiWorkbenchSessionMenuCopy as n, agentGuiWorkbenchCompactVisibleAreaRatio as o, agentGuiWorkbenchConversationIdentitiesEqual as p, agentGuiWorkbenchDefaultCopy as q, agentGuiWorkbenchDefaultNodeFrame as r, agentGuiWorkbenchDefaultUsableHeightRatio as s, agentGuiWorkbenchDefaultUsableWidthRatio as t, agentGuiWorkbenchNewWindowCascadeOffset as u, agentGuiWorkbenchProviderRailWidthPx as v, buildAgentGuiDockEntries as w, createAgentGuiWorkbenchContribution as x, dispatchAgentGuiWorkbenchCommand as y, isAgentGuiWorkbenchSessionAction as z };