/** * Page context gathering — captures the user's current browser context * to be sent alongside every assistant prompt for better AI awareness. */ interface ConversationContextShape { entityType?: string; entityId?: string; activeTab?: string; metadata?: Record; } /** * ★ A `type` alias, deliberately, not an `interface`. * * fe-libs' `PageContext` carries an index signature (`[key: string]: unknown`) * so products can add their own keys. TypeScript grants a type alias an * IMPLICIT index signature and an interface none, so declaring this as an * interface makes it un-assignable to the seam's `gatherPageContext` — with an * error that talks about index signatures rather than about the seam. * HealthyBowl's equivalent is a type alias for exactly this reason. */ export type PageContext = { currentUrl: string; currentPage: string; entityType?: string; entityId?: string; platform: string; version: string; viewportSize: string; }; /** * Human-readable names for VibeControls' top-level routes. * * ★ This is the label a USER would use for the page, not the route segment. It * reaches the model as "the user is on the Sessions page", so `sessions` → * `Sessions` is fine but `ai` → `AI` matters: the fallback title-caser would * produce "Ai", and an assistant that calls it that sounds like it has never * seen the product. * * Unlisted segments fall through to the title-caser, so a new route degrades to * something reasonable rather than to nothing. * * Each label is also seeded as `vibecontrols.assistant.page.` * (`config/assistantDisplayCopy.ts`) so the panel can SHOW it translated; the * English here is what the model is told. */ export declare const VIBECONTROLS_PAGE_LABELS: Readonly>; /** * What to CALL the page the user is on. * * Feeds the assistant's empty state ("Ask about Sessions…") and the shared * panel's live page label. Distinct from `gatherPageContext`, which produces * machine-readable context: this one is read by a human. */ export declare function describeCurrentPage(): string; /** * ★ The URL the assistant is told about: origin + path, nothing else (G87). * * `window.location.href` is NOT safe to forward. Straight after sign-in the * shell URL carries live tokens in its `#sso=` fragment, and share links carry * bearer tokens in their query string — and every assistant turn ships this * value through the gateway into the model's context. Entity resolution reads * `pathname` and `search` locally (below), so the fragment and the query are * dropped unconditionally rather than filtered by a deny-list that a new token * parameter would slip past. */ export declare function assistantSafeUrl(location: Pick): string; export declare function gatherPageContext(): PageContext; export declare function resolveVibeControlsConversationContext(pathname: string, search: string): ConversationContextShape; export {};