import { M as MicroMcpServer } from './server-Dwo9LOxh.js'; export { a as McpServerOptions, T as Transport, e as errorResult, r as rpcError, t as textResult } from './server-Dwo9LOxh.js'; export { T as ToolHost, a as ToolRegistry } from './tool-host-BqJRPr_T.js'; export { InProcessTransport, RelayChannel, RelayTransport, attachInProcess, attachRelay } from './mcp/index.js'; export { C as CallToolResult, e as ContentBlock, I as InitializeResult, J as JsonObject, d as JsonRpcMessage, f as JsonRpcNotification, g as JsonRpcRequest, h as JsonValue, M as MCP_PROTOCOL_VERSION, R as RegisterToolOptions, c as ServerCapabilities, S as ServerInfo, i as ToolCallContext, T as ToolDefinition, a as ToolHandler } from './types-ITRQFAir.js'; export { HumanPlusDisposition, HumanPlusEvent, HumanPlusEventPage, HumanPlusEventQuery, HumanPlusEventStore, MemoryHumanPlusEventStore, NewHumanPlusEvent } from './human-plus/index.js'; export { TuiBridgeOptions, TuiSurfaceRegistryLike, registerTuiBridge } from './bridges/tui.js'; export { B as Bridge, a as BridgeFactory } from './types-D_TzdBsK.js'; import { FormFieldDescriptor } from './bridges/forms.js'; export { FormBridgeAdapter, FormBridgeOptions, registerFormBridge } from './bridges/forms.js'; export { SheetsBridgeAdapter, SheetsBridgeOptions, registerSheetsBridge } from './bridges/sheets.js'; export { SheetsAdapterOptions, SheetsCellHighlight, SheetsCellHighlightMap, SheetsHighlightOptions, UseSheetsAdapterResult, WorkbookLike, useSheetsActivityHighlights, useSheetsAdapter } from './sheets-adapter.js'; export { CodeBridgeAdapter, CodeBridgeOptions, registerCodeBridge } from './bridges/code.js'; export { ChartsBridgeAdapter, ChartsBridgeOptions, registerChartsBridge } from './bridges/charts.js'; export { GridBridgeAdapter, GridBridgeOptions, GridFilter, GridPagination, GridSort, GridState, registerGridBridge } from './bridges/grid.js'; export { SceneBridgeAdapter, SceneBridgeOptions, SceneCamera, SceneObject, SceneObjectKind, SceneState, registerSceneBridge } from './bridges/scene.js'; export { ScreenCreateSpec, ScreenSnapshot, ScreensAdapterCommit, ScreensAdapterResult, ScreensBridgeAdapter, ScreensBridgeOptions, registerScreensBridge } from './bridges/screens.js'; export { SlidesBridgeAdapter, SlidesBridgeOptions, registerSlidesBridge } from './bridges/slides.js'; export { MapBridgeAdapter, MapBridgeOptions, registerMapBridge } from './bridges/map.js'; export { GitBridgeAdapter, GitBridgeOptions, GitProposal, registerGitBridge } from './bridges/git.js'; export { FilesBridgeAdapter, FilesBridgeOptions, registerFilesBridge } from './bridges/files.js'; export { TerminalBridge, TerminalBridgeAdapter, TerminalBridgeOptions, TerminalRef, TerminalShell, registerTerminalBridge } from './bridges/terminal.js'; import { NavigationBridgeAdapter } from './bridges/navigation.js'; export { NavigationBridgeOptions, NavigationConfirmRequest, PageAction, PageReadout, PageSnapshot, registerNavigationBridge } from './bridges/navigation.js'; export { CatalogBridgeAdapter, CatalogBridgeOptions, CatalogCheckoutArgs, CatalogPrice, CatalogProduct, registerCatalogBridge } from './bridges/catalog.js'; export { FeatureDefinition, FeatureGrant, FeaturesBridgeAdapter, FeaturesBridgeOptions, registerFeaturesBridge } from './bridges/features.js'; export { PASSKEY_BRIDGE_TOOLS, PasskeyBridgeAdapter, PasskeyBridgeOptions, PasskeyProposal, PasskeySummaryLike, PasskeySupport, PasskeySurfaceState, registerPasskeyBridge } from './bridges/passkeys.js'; export { DocAdapter, DocBridgeOptions, DocOpTool, registerDocBridge } from './bridges/doc.js'; export { CmsBridgeOptions, CmsOp, cmsReducer, registerCmsBridge } from './bridges/cms.js'; export { SCREEN_TEXT_NODE_TYPE, ScreenDocBridgeOptions, ScreenDocNode, ScreenDocOp, registerScreenDocBridge } from './bridges/screen-doc.js'; import { RelayState } from './sharing/index.js'; export { SseRelayOptions, SseRelayTransport, attachSseRelay } from './sharing/index.js'; import { S as SessionDescriptor } from './token-BZ8doMam.js'; export { b as buildShareConfig, a as buildShareUrl, c as createSessionDescriptor, d as describeSession, r as readSessionFromUrl } from './token-BZ8doMam.js'; import { AutoActivityEvent } from '@particle-academy/fancy-auto-common'; export { ActivityFilter, AutoActivityEvent as AgentActivityEvent, AutoActivityListener as AgentActivityListener, AutoTarget as AgentTarget, AutoTargetKind as AgentTargetKind, UndoEntry, clearStack as clearUndoStack, emitActivity, onActivity, pushUndoEntry, readActivityHistory, readHistory as readUndoHistory, redoOne, resetActivityRegistry, resetAllUndoStacks, undoOne } from '@particle-academy/fancy-auto-common'; import * as react from 'react'; import { ReactNode, CSSProperties } from 'react'; export { ActivityAgent, ActivityResolverContext, ActivityTargetResolver, ToolHandler as ActivityWrappedHandler, useAgentActivity, useAgentActivityForScreen, wrapToolWithActivity } from './presence/index.js'; export { AttachHeuristicsSinkOptions, CollectBatch, HeuristicsEvent, attachHeuristicsSink, mapActivityToEvent as mapActivityToHeuristicsEvent } from './heuristics/sink.js'; export { UndoToolsOptions, ensureUndoToolsRegistered, registerUndoTools, useUndoStack } from './undo/index.js'; export { CLAUDE_CONNECTORS_URL, CONNECTOR_GLYPHS, CONNECTOR_TARGETS, ClaudeMark, ConnectorButtons, ConnectorButtonsProps, ConnectorClient, ConnectorMechanism, ConnectorServer, ConnectorTargetMeta, CursorMark, DesktopMark, ManualMcpConfig, VscodeMark, WrenchMark, buildCursorDeeplink, buildManualConfig, buildManualConfigSnippet, buildVscodeDeeplink, connectorHref, encodeBase64Json, slugifyServerName } from './connectors/index.js'; export { D as DEFAULT_MCPB_ENTRY_POINT, b as MCPB_MANIFEST_VERSION, c as MCPB_MIN_NODE, M as McpbManifestInput, a as McpbTool, d as buildMcpbManifest, e as buildMcpbProxyStub } from './mcpb-BXOrsRnv.js'; import '@particle-academy/fancy-sheets'; import '@particle-academy/fancy-slides'; import '@particle-academy/fancy-doc-commons'; /** * A page's contribution to the shared tool surface. * * Return the disposer that withdraws it — typically the `Bridge`'s own * `dispose`, or the function `registerTool` returns. Returning nothing is * allowed (the original `extraBridges` was typed that way) but means the * contribution can never be withdrawn. */ type BridgeContribution = (server: MicroMcpServer) => (() => void) | void; /** * The registry behind **"site tools always; page tools while mounted"**. * * `useCoBrowseSession` already had an `extraBridges` hook and already called it. * What that shape could not express is a tool surface that CHANGES under the * agent mid-session, because the callback is invoked exactly once while the * server is being built: * * - a page that mounts later never gets a chance to contribute; * - a page that unmounts cannot withdraw, so the agent keeps a tool aimed at * a surface that is gone and only finds out by calling it. * * Both are silent. Nothing errors; the agent just never sees the tools, or sees * dead ones. So contributions live in a registry that is applied when a server * appears, re-applied if it is replaced, and withdrawn when the page unmounts — * rather than a callback captured at construction. * * Withdrawal needs no notification machinery of its own: a bridge's disposer * unregisters its tools, `ToolRegistry` fires `onToolsChanged`, and * `MicroMcpServer` broadcasts `notifications/tools/list_changed`. That was * verified before this was written — a grep for `unregisterTool` reads as * "nothing unregisters", which is a false negative, because bridges use the * disposer `registerTool` returns. */ declare class BridgeContributions { private readonly contributions; private readonly applied; private server; /** * Contribute bridges for as long as the returned disposer is uncalled. * * Applies immediately when a server is already live, and is held for the next * one otherwise — so a page need not know whether sharing has started. */ add(contribute: BridgeContribution): () => void; /** Attach a server and apply every live contribution to it. */ bind(server: MicroMcpServer): void; /** * Detach the current server, withdrawing what was applied to it. Contributions * themselves are KEPT: a session can be stopped and restarted under a page * that never unmounted, and its tools must come back rather than silently * vanish. */ unbind(): void; private apply; private withdraw; } /** A thing the human did, surfaced so the connected agent stays aware. */ type CoBrowseUserEvent = { kind: "navigation"; url: string; title?: string; revision?: number; } | { kind: "scroll"; y: number; revision?: number; } | { kind: "form"; handle: string; value?: unknown; masked?: boolean; revision?: number; } | { kind: "click"; handle: string; label?: string; revision?: number; }; type UseCoBrowseSessionOptions = { /** * The navigation adapter (Inertia + DOM in the sandbox). MUST be stable — * its methods should read live state via refs, since the bridge captures it * once on mount. Memoize it. */ adapter: NavigationBridgeAdapter; /** Identity for the agent's presence (cursor/log color + name). */ agent?: { id: string; name?: string; color?: string; }; /** * Which activity events this session forwards to its agent. * * Only needed when a page runs MORE THAN ONE session — site co-browse plus * the agent playground, say. The activity bus is global to the page, so * without a filter each relay forwards the other's traffic and every agent * sees every other agent's navigations. * * Omitted forwards everything, which is right for the single-session case. */ activityFilter?: (event: AutoActivityEvent) => boolean; /** Relay base path. Default "/agent-relay" (the generic frame broker). */ relayBaseUrl?: string; /** MCP server info advertised to the agent. */ info?: { name: string; version: string; instructions?: string; }; /** * Register extra bridges (forms/screens/…) on the same server, once, at * construction. * * For a surface that comes and goes with navigation use * {@link CoBrowseSession.contributeBridges} instead: this callback fires * exactly once while the server is built, so a page mounted afterwards can * never contribute through it, and one that unmounts can never withdraw. */ extraBridges?: (server: MicroMcpServer) => void; /** CSRF token for the relay register/unregister POSTs. */ csrfToken?: () => string | null | undefined; /** Stage submit + destructive clicks for human confirm. Default true. */ pendingMode?: boolean; }; type CoBrowseSession = { server: MicroMcpServer | null; /** * Contribute bridges for as long as the returned disposer is uncalled — * "site tools always; page tools while mounted". * * Call it from a page's mount effect and return its disposer: * * ```tsx * useEffect(() => contributeBridges((server) => * registerArtboardBridge(server, { adapter }).dispose), []); * ``` * * Safe to call before sharing starts — the contribution is applied to the * server as soon as one exists, and re-applied if the session is restarted. */ contributeBridges: (contribute: BridgeContribution) => () => void; session: SessionDescriptor | null; relayState: RelayState; /** * True once at least one remote agent is actually attached to the session. * * Distinct from `relayState === "open"`, which only says the BROWSER reached * the relay — true the moment sharing starts, before the link has been handed * to anyone. A UI that keys "Agent is driving" off the relay state therefore * announces a driver who does not exist, and stays silent when a real one * arrives. */ agentConnected: boolean; /** How many remote agents are attached (0 when nobody has joined). */ agentCount: number; startShare: () => Promise; stopShare: () => void; /** * Report a human action so the connected agent is notified. Emits a * `source:"user"` activity event, which the SSE relay forwards to the agent * as a `notifications/agent_activity` frame. */ observeUser: (event: CoBrowseUserEvent) => void; }; /** * Site-wide co-browsing session: one persistent in-page `MicroMcpServer` running * the navigation bridge, joinable by an external agent over the relay. Mount it * once at the app root; render `` to show the agent + a Stop * control. The host wires `observeUser(...)` to navigation/scroll/form listeners * so the agent sees what the human does. */ declare function useCoBrowseSession(options: UseCoBrowseSessionOptions): CoBrowseSession; type AgentActivity = { id: string; /** Wall-clock timestamp; component formats it. */ at: number; /** "tool" for MCP tool invocations, "message" for chat, "info" for status. */ kind: "tool" | "message" | "info" | "error"; /** Short label, e.g. "whiteboard_add_sticky" or "Agent". */ source: string; /** Body text. */ text: string; /** Optional structured payload, rendered as collapsed JSON. */ detail?: unknown; /** * The call's arguments. Rendered inline next to the tool name so the feed * reads as `tool(args) → result` — the point being that the agent's * reasoning is legible AS IT HAPPENS, not reconstructable afterwards from a * details pane nobody opens. */ args?: unknown; /** What the call returned. */ result?: unknown; /** Round-trip time in ms. Rendered as `· 142ms`. */ durationMs?: number; /** * Lifecycle. A row can appear as `pending` the moment a call starts and be * replaced by the settled row, which is what makes this a STREAM rather than * a log. Defaults to `ok`, or `error` when `kind === "error"`. */ status?: "pending" | "ok" | "error"; }; type AgentPanelProps = { /** The agent's identity (name + color appears in the header). */ agent?: { name?: string; color?: string; }; /** Activity stream. Most recent at the end. */ activity: AgentActivity[]; /** Optional chat composer — pass an onSubmit to enable. */ onSubmit?: (message: string) => void; /** Disabled while a request is in flight. */ busy?: boolean; /** Right-rail header actions. */ actions?: ReactNode; className?: string; style?: CSSProperties; }; /** * AgentPanel — sidebar showing the agent's identity, a tool-and-chat log, * and an optional input composer. Pure presentational: hosts feed it the * activity stream from their own state (typically the MCP transport log). */ declare function AgentPanel({ agent, activity, onSubmit, busy, actions, className, style }: AgentPanelProps): react.JSX.Element; type AgentCursorProps = { x: number; y: number; name?: string; color?: string; /** Optional caption shown under the name (e.g. current tool). */ status?: string; className?: string; style?: CSSProperties; }; /** * AgentCursor — on-canvas presence marker for the agent. Drop it inside * (or alongside) a fancy-whiteboard at screen coords matching * the agent's reported position. */ declare function AgentCursor({ x, y, name, color, status, className, style }: AgentCursorProps): react.JSX.Element; type AgentActivityHighlightProps = { /** Bounds of the highlighted item in the parent's coord system. */ x: number; y: number; width: number; height: number; /** Trigger token — change it (e.g. set to Date.now()) to re-fire the pulse. */ pulseKey?: string | number; /** Highlight tint. */ color?: string; /** Pulse duration in ms. Defaults 1200. */ duration?: number; className?: string; style?: CSSProperties; }; /** * AgentActivityHighlight — short pulsing outline that flashes around an * item the agent just touched. Position the parent so this can be placed * absolutely matching the item's bounds. */ declare function AgentActivityHighlight({ x, y, width, height, pulseKey, color, duration, className, style, }: AgentActivityHighlightProps): react.JSX.Element | null; type BridgedFormProps = { /** Stable id for this form. Used by agents in `form_*` tool calls. */ id: string; /** Human title (also surfaced as the bridge title). */ title?: string; /** Optional fancy-screens screen id this form lives in. */ screenId?: string; /** Field descriptors — drives the agent-facing schema. */ fields: FormFieldDescriptor[]; /** Controlled values. */ values: Record; /** Setter — hosts pass their setState. */ onChange: (next: Record) => void; /** Optional submit handler. */ onSubmit?: () => Promise<{ ok: boolean; values?: Record; error?: string; }>; /** The MicroMcpServer the bridge registers against. Pass null/undefined * to render without a bridge (useful for stories / non-shared use). */ server?: MicroMcpServer | null; /** Identity used in activity events. */ agent?: { id: string; name?: string; color?: string; }; children: ReactNode; }; /** * BridgedForm — wraps a react-fancy form (or any controlled inputs) * with a `registerFormBridge` lifecycle. Children render the actual form * using `values` + `onChange`; this component only manages the bridge. * * Hosts use it like: * * * onChange({ ...values, email: v })} /> * ... * * * Agents can then call form_describe, form_set_value, form_submit, etc. */ declare function BridgedForm({ id, title, screenId, fields, values, onChange, onSubmit, server, agent, children, }: BridgedFormProps): react.JSX.Element; /** * Loose shape of the fancy-screens system context — kept here so this * component doesn't hard-import `@particle-academy/fancy-screens`. */ type ScreenSystemLike = { registry: Map; updateScreen: (id: string, patch: { agentActivity?: unknown; }) => void; }; type ScreensActivityBridgeProps = { /** The value returned by `useScreenSystem()` from fancy-screens. */ system: ScreenSystemLike; /** ms to wait after the last activity before clearing the screen's badge. Default 1500. */ fadeMs?: number; }; /** * ScreensActivityBridge — subscribe to the in-process activity registry * and patch each event into the matching screen's `agentActivity` field. * Fade-out clears the badge after `fadeMs`. * * Use it once near the root of your app, ABOVE every : * * const system = useScreenSystem(); * <> * * … * … * * * Renders nothing; pure side-effect component. */ declare function ScreensActivityBridge({ system, fadeMs }: ScreensActivityBridgeProps): null; type ShareControlsProps = { /** The active session, or null when not sharing yet. */ session: SessionDescriptor | null; onStart: () => void; onStop: () => void; /** Optional connection-state badge text. */ status?: string; /** * True once an agent has actually connected to the session. * * Flips the panel from "here is how to connect" to "here is what the agent is * doing" — the paste-this-prompt UI is dead weight the moment it has been * pasted, and what the human needs then is visibility. */ agentConnected?: boolean; /** * What the agent has done, newest last. Reuses `AgentActivity` from * `AgentPanel` rather than a second shape, so a host already collecting * presence events can pass the same array to both. */ activity?: AgentActivity[]; /** Override the URL base used in the share URL. */ shareBaseUrl?: string; className?: string; style?: CSSProperties; }; /** * ShareControls — the host-facing UI for turning sharing on/off and * surfacing the resulting connection details (URL / JSON / cURL). */ declare function ShareControls({ session, onStart, onStop, status, agentConnected, activity, shareBaseUrl, className, style, }: ShareControlsProps): react.JSX.Element; /** * Build a copy-paste natural-language prompt to hand directly to an AI agent. * Agents handed a bare URL tend to try to *open it in a browser* — this spells * out that the link is a live MCP co-browsing session it should drive over MCP * tools (via the zero-install relay client), never visit. */ declare function buildAgentPrompt(url: string): string; type CoBrowsePresenceProps = { /** The session from `useCoBrowseSession`. */ session: CoBrowseSession; /** Public MCP/connect URL shown to the user (for ConnectorButtons), optional. */ connectUrl?: string; /** Base URL used to build the shareable session link. */ shareBaseUrl?: string; className?: string; }; /** * The human's view of a site-wide co-browsing session: a "Let an agent drive" * starter, the share/connect surface until an agent arrives, a live log of what * it is doing once one has, and a Stop / take-back-control button. * * Staged-action confirms are rendered by the HOST (via the navigation adapter's * `confirm`), so this component stays presentation-only. */ declare function CoBrowsePresence({ session, connectUrl, shareBaseUrl, className }: CoBrowsePresenceProps): react.JSX.Element; declare namespace CoBrowsePresence { var displayName: string; } type CoBrowseCursorLayerProps = { /** Render the overlay only while a session is live. Default true. */ active?: boolean; /** Stacking order of the overlay. Default just under the max. */ zIndex?: number; /** * Retire the cursor after this long without a tool call. Default 15s; * `0` keeps it on screen indefinitely. * * A cursor that sits still is not neutral — it reads as "the agent is * broken", which is worse than showing nothing. Continuous presence belongs * in the activity log; the cursor is for *motion*. */ idleAfterMs?: number; }; /** * Page-wide agent presence for co-browsing — the missing "all actors present" * half of Human+ UX. A fixed, click-through overlay (portaled to ) that * shows the connected agent as a live cursor + pings/highlights the element it * just acted on, gliding between targets. Same visual language as the whiteboard * demo's agent cursor, but mapped from the navigation bridge's STABLE HANDLES * (the agent has no real mouse) — each tool reports the acted element's viewport * rect in `meta.rect` (see `NavigationBridgeAdapter.rectFor`). * * Mount it once near the app root (e.g. in your CoBrowseProvider), gated on an * active session. SSR-safe: renders null on the server / until the first action. */ declare function CoBrowseCursorLayer({ active, zIndex, idleAfterMs, }: CoBrowseCursorLayerProps): react.ReactPortal | null; declare namespace CoBrowseCursorLayer { var displayName: string; } type SimulateUsersButtonProps = { /** Endpoint that injects the fake active users. Default `/active-users/simulate`. */ endpoint?: string; /** How many fake users to simulate (sent as `count`). Default `10`. */ count?: number; /** Button label. Default `Simulate {count} active users`. */ label?: string; /** * CSRF token sent as `X-CSRF-TOKEN`. If omitted, falls back to a * `` on the page (the Laravel default). */ csrfToken?: string; /** Called after a successful trigger. */ onTriggered?: () => void; /** Called if the request fails. */ onError?: (error: unknown) => void; className?: string; style?: CSSProperties; }; /** * A button that asks the host to inject N **fake** active users (injected * dummies, not real accounts) so the live ActiveUser stream / presence overlay * has something to animate in a demo. POSTs `{ count }` to `endpoint`. * * Self-contained (inline styles, no react-fancy dependency) so it drops into any * host. The fakes + their staggered activity are produced server-side; this * button only triggers them. */ declare function SimulateUsersButton({ endpoint, count, label, csrfToken, onTriggered, onError, className, style, }: SimulateUsersButtonProps): react.JSX.Element; export { type AgentActivity, AgentActivityHighlight, type AgentActivityHighlightProps, AgentCursor, type AgentCursorProps, AgentPanel, type AgentPanelProps, type BridgeContribution, BridgeContributions, BridgedForm, type BridgedFormProps, CoBrowseCursorLayer, type CoBrowseCursorLayerProps, CoBrowsePresence, type CoBrowsePresenceProps, type CoBrowseSession, type CoBrowseUserEvent, FormFieldDescriptor, MicroMcpServer, NavigationBridgeAdapter, RelayState, ScreensActivityBridge, type ScreensActivityBridgeProps, SessionDescriptor, ShareControls, type ShareControlsProps, SimulateUsersButton, type SimulateUsersButtonProps, type UseCoBrowseSessionOptions, buildAgentPrompt, useCoBrowseSession };