import { ConfirmActionCopy } from '@12-apps/ui/copy'; import { OnboardingStore, OnboardingStateSnapshot } from '@12-apps/onboarding'; import { a as AiHostGuide, d as AiProvider, b as AiCapability, f as AiHostBrand } from '../guide-CrzdsdNf.js'; export { A as AiConnectPromptSpec, g as AiHostConfigureStage, h as AiHostLink, i as aiConnectPrompt, p as providerForHostId } from '../guide-CrzdsdNf.js'; export { A as AI_CAPABILITIES, a as AI_CONNECT_PROMPT, b as AI_HOST_GUIDES, c as AI_PERMISSION_MODEL, E as EN_US_AI_CAPABILITIES, d as EN_US_AI_CONNECT_PROMPT, e as EN_US_AI_HOST_GUIDES, f as EN_US_AI_PERMISSION_MODEL, P as PT_BR_AI_CAPABILITIES, g as PT_BR_AI_CONNECT_PROMPT, h as PT_BR_AI_HOST_GUIDES, i as PT_BR_AI_PERMISSION_MODEL } from '../locales-Cv0Pecvu.js'; /** * Every word the AI-integration screens render, as REQUIRED host config * (FUT-760). * * These components used to take `capabilities` / `permissionModel` / `hosts` as * OPTIONAL props defaulting to this package's own pt-BR, and to compile the rest * of their sentences in outright. `guide.ts` even said so — "these are the * shared defaults" — which is the anti-pattern named exactly: a host that * configured nothing shipped one product's Portuguese, and nothing failed to * say so. * * Split per screen rather than one flat map, because three of them * (`AiLanding`, `AiCapabilities`, `AiStatusBoard`, `HostSelectStep`) are * exported standalone and a host mounting only one should not have to supply * words for screens it never renders. */ /** The marketing block's headline and its supporting line. */ interface AiCapabilitiesCopy { heading: string; subheading: string; } /** One reassurance chip on the landing: an icon's label and its caption. */ interface AiTrustPoint { /** Stable id — maps to the icon in the component. */ id: string; label: string; caption: string; } interface AiLandingCopy { /** Small line above the headline. */ eyebrow: string; /** * The headline, in the three runs it renders as: lead, the EMPHASISED * middle (drawn in the accent colour), then the tail. `titleTail` was the * only one a host could set, so two thirds of this product's headline — * `Conecte` and `assistentes de IA` — shipped as literals around it. */ titleLead: string; titleEmphasis: string; /** The headline's last run, after the emphasised middle. */ titleTail: string; /** The paragraph under the headline. */ lede: string; /** The reassurance strip. Order is the order rendered. */ trust: readonly AiTrustPoint[]; /** The call to action that starts the guided flow. */ start: string; } /** The wizard's step labels, in the order the stepper shows them. */ interface AiFlowStepLabels { select: string; copyUrl: string; configure: string; connect: string; install: string; confirm: string; } /** The wizard's navigation words and each step's own sentences. */ interface AiFlowCopy { /** The stepper's labels. Not sentences, but still the host's words. */ steps: AiFlowStepLabels; back: string; next: string; advance: string; finish: string; copyUrl: string; copied: string; copyMessage: string; /** The copy-the-URL step's heading. Names the host's own noun for a tenant. */ copyUrlTitle: string; /** Under the MCP URL: what this value is and what happens on copy. */ urlCaption: string; /** Under the paste-in prompt: what the assistant will do with it. */ promptCaption: string; /** The "ask the assistant to connect" step heading. */ askTitle: string; /** The one-click install step's body, for a host with a published plugin. */ installBody: string; /** The install button on that step. */ installAction: string; /** Heading over the paste-in message on the manual path. */ pasteTitle: string; /** Caption under the paste-in message on the install path. */ pasteInstallCaption: string; /** Confirmation once a host reports in. */ connectedTo(hostLabel: string): string; waitingTitle: string; waitingBody(hostLabel: string): string; testNow: string; } interface AiStatusBoardCopy { instructions: string; connected: string; notConnected: string; connect: string; disconnect: string; disconnectTitle: string; disconnectBody: string; disconnectConfirm: string; /** Shown when the disconnect write fails without a reason of its own. */ disconnectError: string; boardTitle: string; boardCaption: string; /** * The confirmation popup's own furniture — its cancel button and fallbacks. * `@12-apps/ui` stopped shipping defaults for these (FUT-760), so the words * arrive here rather than from the design system's Portuguese. */ confirmAction: ConfirmActionCopy; } /** * The one-line summary of a connection's recency. * * Functions rather than strings because the number is interpolated and the * plural rule is the host language's, not this package's. */ interface AiConnectionSummaryCopy { /** Active within the last minute — no number to interpolate. */ activeNow: string; activeMinutes(minutes: number): string; activeHours(hours: number): string; activeDays(days: number): string; /** Connected, but too long ago to state a recency for. */ configured: string; /** Appended after a host's name: `Claude Conectado`. */ connectedSuffix: string; /** Several assistants at once, from an already-joined list of names. */ connectedSeveral(names: string): string; /** Connected, but the provider was never attributed to a known assistant. */ connectedGeneric: string; } interface AiHostSelectCopy { /** The step's own heading, above the host tiles. */ heading: string; /** Why the owner is picking, under the host tiles. */ caption: string; } interface AiConnectGuideCopy { /** The label on the MCP URL field. Names the host's own noun for a tenant. */ urlLabel: string; /** Above the MCP URL field. */ urlHint: string; /** Lead-in to the vendor's official connector docs link. */ moreInfo: string; connectOn(hostLabel: string): string; } interface AiOnboardingCopy { title: string; /** The reveal toggle in the configured state, and its collapsed twin. */ editLabel: string; collapseLabel: string; } /** Every screen's words, for a host mounting the whole flow. */ interface McpAiCopy { capabilities: AiCapabilitiesCopy; landing: AiLandingCopy; flow: AiFlowCopy; statusBoard: AiStatusBoardCopy; summary: AiConnectionSummaryCopy; hostSelect: AiHostSelectCopy; connectGuide: AiConnectGuideCopy; onboarding: AiOnboardingCopy; } /** * Revoke a host's access. Returning a promise holds the confirmation popup in * its pending state until the write settles, and a rejection keeps it open * carrying the reason — so the owner sees the disconnect finish or fail. */ type DisconnectHandler = (hostId: string) => void | Promise; /** One assistant's connection state. */ interface HostStatus { host: AiHostGuide; connected: boolean; /** Freeform activity line for a connected host (e.g. "ativo há 3 min"). */ detail?: string; } /** * The completed-state status board for the AI integration: every assistant as a * box — green when connected, red when still to connect (with a "Conectar" * button that re-enters the guided flow for that host). Each connection is * attributed to its provider (derived from the OAuth client + confirmed by * `announceAiConnection`), so several assistants can show connected at once. * * A connected box carries two more controls, because the pill it used to show * alone was a dead end in both directions: "{copy.instructions}" re-enters the host's * setup steps (previously reachable only from a RED card, so an all-green board * hid them entirely), and "Desconectar" — when the app passes `onDisconnect` — * revokes access, which nothing in the UI could do at all. */ declare function AiStatusBoard({ statuses, onConnect, onDisconnect, copy, }: { statuses: readonly HostStatus[]; onConnect: (hostId: string) => void; /** Revoke this host's access. Omit to render a read-only board. */ onDisconnect?: DisconnectHandler; copy: AiStatusBoardCopy; }): React.JSX.Element; /** * Pure helpers + the connection type shared by the AI-onboarding flow steps * (`ai-flow-steps.tsx`) and the orchestration/status board (`ai-steps.tsx`), * kept here so neither JSX module has to import the other (no import cycle). */ /** The live connection surfaced from the server (empty list when none). */ interface AiConnection { clientName: string | null; /** * The provider this connection is attributed to (derived server-side from the * OAuth client's redirect URIs / confirmed by `announceAiConnection`). `null` * for a legacy connection recorded before attribution existed — matched * best-effort to whichever host the owner is connecting. */ host: AiProvider | null; lastActiveAt: Date; } /** Props for the reusable AI-connect onboarding flow. */ interface AiIntegrationOnboardingProps { /** Persistence seam — the app wires this to its own backend (server actions). */ store: OnboardingStore; /** The MCP endpoint URL to paste (derived by the app from its public origin). */ endpointUrl: string; /** The owner's saved progress (null → first run / landing). */ initialState: OnboardingStateSnapshot | null; /** The live MCP connections (one per connected assistant; empty when none). */ connections: readonly AiConnection[]; /** * The onboarding namespace this flow's progress is stored under — the key * `@12-apps/onboarding` reads and writes, and the one the host's own * `featureKeys` allow-list has to contain. * * REQUIRED, on the same grounds as `hosts` and `copy` below. It defaulted to * `"ai_integration"`, which is one adopter's key: a host whose backend * declares `ai` or `mcp_connect` and says nothing here writes to a namespace * its own API rejects, so the wizard loses every step it saves and resumes * from nothing. Nothing warns, because a silent default is indistinguishable * from a deliberate one — and the failure only shows up as a refresh that * forgets, which reads as a bug in the host's persistence rather than as a * key nobody chose. */ featureKey: string; /** Show the dev-only "reset onboarding" button. @default false */ devReset?: boolean; /** * Assistants offered in the flow, with their step-by-step instructions. * * REQUIRED since FUT-760. These used to default to this package's own pt-BR * walkthrough, so a host that said nothing shipped one product's Portuguese * and had no field to decline it. `PT_BR_AI_HOST_GUIDES(platformName)` is that * exact content, now chosen by name. */ hosts: readonly AiHostGuide[]; /** Capability cards on the landing. REQUIRED — see `hosts`. */ capabilities: readonly AiCapability[]; /** Permission reassurance copy on the landing. REQUIRED — see `hosts`. */ permissionModel: string; /** Every sentence the screens render. REQUIRED — see `hosts`. */ copy: McpAiCopy; /** * Message the owner pastes into the assistant on the Conectar step. * * REQUIRED, with no default, because the useful version of it names TOOLS — * one to register the connection, one to read something real — and this * package neither defines nor serves any. It shipped a constant naming two * tools from one adopter's surface, so another host handed its owner a prompt * that called two things that did not exist, and the confirm step then waited * forever for a registration that could never happen. Build it with * `aiConnectPrompt({ … })`. */ connectPrompt: string; /** * Re-check the live connection on the verify step's "Testar conexão" button — * apps pass a router refresh (e.g. Next's `router.refresh`). @default a full * `window.location.reload()`. */ onRetest?: () => void; /** * Revoke a connected assistant's access, from the completed status board. The * host ID is the board's card, NOT the connection — `claude` and * `claude-desktop` share one provider, so the app resolves which stored * connection it owns (`providerForHostId`) and revokes that. Omitted → the * board stays read-only, which is the pre-existing behavior. */ onDisconnect?: DisconnectHandler; } /** * URL-free, persisted onboarding for the AI/MCP integration — a five-step wizard * (pick an assistant, copy the store URL, configure the connector, connect, then * verify) whose position + chosen assistant are saved via `@12-apps/onboarding`, so * a refresh resumes exactly where the owner left off. The live MCP connection * signal drives the verify step and the completed status board. * * App-agnostic: the app supplies the persistence `store`, the `endpointUrl`, the * `featureKey` its own onboarding API serves, the live `connections` (one per * connected assistant), and every word on screen (`hosts`, `capabilities`, * `permissionModel`, `copy`). Nothing here has a default, because each of those * is a fact only the host holds and a default for it is silently wrong rather * than loudly missing. */ declare function AiIntegrationOnboarding({ store, endpointUrl, initialState, connections, featureKey, devReset, hosts, capabilities, permissionModel, connectPrompt, onRetest, onDisconnect, copy, }: AiIntegrationOnboardingProps): React.JSX.Element; /** * Homepage-style marketing landing for the AI integration (shown before the * owner starts): a hero, the permission reassurance, a trust/feature strip, and * the capability highlights. `onStart` begins the guided flow. `permissionModel` * and `capabilities` are REQUIRED host copy — the package ships no default * sentence (FUT-760). */ declare function AiLanding({ onStart, permissionModel, capabilities, copy, capabilitiesCopy, }: { onStart: () => void; permissionModel: string; capabilities: readonly AiCapability[]; copy: AiLandingCopy; capabilitiesCopy: AiCapabilitiesCopy; }): React.JSX.Element; /** * Marketing block for the AI integration: a headline + a responsive grid of * capability cards. Shown on the onboarding landing (before the owner starts) to * sell the feature — "here's what the assistant does for you". `capabilities` * and `copy` are REQUIRED host copy — the package ships no default sentence * (FUT-760). */ declare function AiCapabilities({ capabilities, copy, }: { capabilities: readonly AiCapability[]; copy: AiCapabilitiesCopy; }): React.JSX.Element; /** * Step 1 of the guided AI connect flow: the owner picks a single assistant * (Claude.ai, Claude Desktop, ChatGPT, Codex) from a card grid. Picking a card * advances straight to the next step — no separate "Próximo" button. Selection * is controlled (persisted by the onboarding flow) so a refresh resumes with the * same assistant highlighted. */ declare function HostSelectStep({ hosts, selectedId, onSelect, copy, }: { hosts: readonly AiHostGuide[]; selectedId: string | null; onSelect: (hostId: string) => void; copy: AiHostSelectCopy; }): React.JSX.Element; /** * The store's MCP endpoint URL with a blue "Copiar" button (the display-only * field defers the copy to this button). Controlled: `copied` flips the label to * "Copiado" and `onCopy` fires after the clipboard write — the wizard uses it to * unlock the "Próximo" button on the Copiar-URL step. */ declare function EndpointCopyBlock({ endpointUrl, copied, onCopy, flowCopy, copy, }: { endpointUrl: string; copied: boolean; onCopy: () => void; flowCopy: AiFlowCopy; copy: AiConnectGuideCopy; }): React.JSX.Element; /** * A copyable multi-line message block (preserves line breaks). Used on the * Conectar step for the prompt the owner pastes into the assistant so it * identifies itself and calls a tool (which registers the connection). */ declare function PromptCopyBlock({ title, caption, message, flowCopy, }: { title: string; caption: string; message: string; flowCopy: AiFlowCopy; }): React.JSX.Element; /** The brand mark + "Conectar no " header shared by the connect sub-steps. */ declare function HostConnectHeader({ host, copy, }: { host: AiHostGuide; copy: AiConnectGuideCopy; }): React.JSX.Element; /** * The primary direct-link button to a host's connector settings (nothing when it * has none). `onOpen` fires after the link opens so the Configurar step can * unlock its "Próximo" only once the owner has actually gone to the connectors. */ declare function HostOpenButton({ host, onOpen, }: { host: AiHostGuide; onOpen?: () => void; }): React.JSX.Element | null; /** * A numbered slice of a host's connect steps. `start` keeps the numbering * continuous when the steps are split across wizard stages (e.g. the Conectar * stage continues at 4 after Configurar showed 1–3). */ declare function HostStepList({ steps, start, }: { steps: readonly string[]; start?: number; }): React.JSX.Element; /** * The store's MCP endpoint URL. Client component because the copy interaction * needs the browser clipboard — the `@12-apps/ui` Code component provides the copy * affordance (`copyable`). Pass `copyable={false}` for a display-only field when * an external control owns the copy action (e.g. the connect flow's blue Copiar * button, which also gates the following steps on the copy). */ declare function McpEndpointUrl({ url, copyable, }: { url: string; copyable?: boolean; }): React.JSX.Element; /** A round brand chip: the vendor accent + a simple glyph. */ declare function HostBrandAvatar({ brand, size, }: { brand: AiHostBrand; size?: number; }): React.JSX.Element; /** The icon for a capability card, by capability id (falls back to a sparkle). */ declare function CapabilityIcon({ id, fontSize, }: { id: string; fontSize?: number; }): React.JSX.Element; /** One entry of a landing's trust/feature strip. */ interface FeatureBadgeItem { icon: React.ReactNode; label: string; caption: string; } /** * One item of an onboarding landing's trust/feature strip: a paper icon tile * (primary-coloured glyph) with a two-line label + caption. */ declare function FeatureBadge({ icon, label, caption }: FeatureBadgeItem): React.JSX.Element; /** * The pt-BR pack for the AI-integration screens — a NAMED constant a host * passes by hand, never a default. * * The filename is what exempts this file from the copy-portability gate: * Portuguese may ship, it may not be silent. Every sentence is VERBATIM what * the components used to render, so a host adopting it sees no change on * screen — what changes is that the words are chosen in a diff. */ declare const PT_BR_MCP_AI_COPY: McpAiCopy; /** * The en-US pack for the AI-integration screens — a NAMED constant a host * passes by hand, never a default. * * `statusBoard.confirmAction` composes `@12-apps/ui`'s own English pack rather * than restating it, exactly as the pt-BR side composes the Portuguese one. * * The assistant NAMES (Claude, ChatGPT, Codex) are products, not words: they * are spelled the same in every language, and `hostLabel` arrives as an * argument so a sentence can place it where its own grammar wants. */ declare const EN_US_MCP_AI_COPY: McpAiCopy; declare const MCP_AI_COPY: { readonly "pt-BR": McpAiCopy; readonly "en-US": McpAiCopy; }; export { AiCapabilities, type AiCapabilitiesCopy, AiCapability, type AiConnectGuideCopy, type AiConnection, type AiConnectionSummaryCopy, type AiFlowCopy, AiHostBrand, AiHostGuide, type AiHostSelectCopy, AiIntegrationOnboarding, type AiIntegrationOnboardingProps, AiLanding, type AiLandingCopy, type AiOnboardingCopy, AiProvider, AiStatusBoard, type AiStatusBoardCopy, type AiTrustPoint, CapabilityIcon, type DisconnectHandler, EN_US_MCP_AI_COPY, EndpointCopyBlock, FeatureBadge, type FeatureBadgeItem, HostBrandAvatar, HostConnectHeader, HostOpenButton, HostSelectStep, type HostStatus, HostStepList, MCP_AI_COPY, type McpAiCopy, McpEndpointUrl, PT_BR_MCP_AI_COPY, PromptCopyBlock };