/** * `@guuey/agent-layout/react` — the Provider + primitives (guuey#403 §4). * React DOM only, by design: cross-platform semantics live in * `@guuey/chat`'s selection contract (portal's consult on the proposal). * * Engineering shape (ggui#633's scar, adopted): the active-panel state * lives in its OWN provider, separate from any chat/transcript state — * shells must never re-render per streaming token. The context value * changes ONLY on machine transitions; every callback identity is stable. */ import { type HTMLAttributes, type ReactNode } from "react"; import { type ActivePanel, type AgentModeInput } from "./machine.js"; import { type TonePair } from "./tones.js"; export interface AgentModeProviderProps { children: ReactNode; /** * The presentation mode — the SAME host-resolved value the surface * passes to ``; this lib rides the existing mode * machinery and adds none of its own (the ggui#633 binding rule: never * fixed-dark, never a second mode system). Default `"light"`, matching * the kit's own default. */ mode?: "light" | "dark"; /** * Tone override pair for the CURRENT mode (host-palette / app-theme * tiers — §2's tier chain). Validated against the perceptibility floor * at wiring time (reject-under-floor, explanatory throw). Base defaults * (the ggui#633 shipped pair + its dark mirror) apply when absent. */ tones?: TonePair; /** The follow fade in ms — default the founder-certified eased 150. */ transitionMs?: number; /** * The surface's identity mark (logo / brand node) for the working state * (founder (d)): shown with the built-in pulse while the agent has the * room but nothing is presented yet. */ identity?: ReactNode; /** * The whole standby/splash treatment, configured ONCE at the Provider * (guuey#430 — the founder's brand-configurable splash): replaces the * built-in identity+pulse for every ActivePane under this provider. * Per-pane `ActivePane.workingState` still wins over this. Consumers * supply their brand's splash (ggui console: blinking glyphs; guuey * surfaces: guuey's own design); absent → the built-in default. */ standby?: ReactNode; /** * The route-derived follow signal (ggui#633's scar: hand-wiring * per-link missed 20+ surfaces — sub-nav tabs, in-content links, * `router.push`). Pass your router's location key (`usePathname()`, * `useLocation().key`, …): ANY change dispatches `menuInteraction`. * The initial value dispatches nothing. */ navigationKey?: unknown; } export declare function AgentModeProvider({ children, mode, tones, transitionMs, identity, standby, navigationKey, }: AgentModeProviderProps): ReactNode; export interface UseAgentModeResult { activePanel: ActivePanel; /** A turn is in flight (submit → settled). */ streaming: boolean; /** The founder-(d) working-state window is open. */ pending: boolean; /** The raw machine door — `bindGuueyChat(dispatch)` wires a kit surface. */ dispatch: (input: AgentModeInput) => void; /** * The NEUTRAL panel setter (guuey#427): flips which panel has the room * and nothing else — `"agent"` never claims a submit happened (no * working state, no streaming). Submit intent goes through * `dispatch({ type: "agentSubmit" })` / `bindGuueyChat`. Escape hatch, * documented as rarely needed. */ setActivePanel: (panel: ActivePanel) => void; /** The <1024px overlay drawer (lib-owned state; Shell renders the toggle). */ drawerOpen: boolean; setDrawerOpen: (open: boolean) => void; } export declare function useAgentMode(): UseAgentModeResult; /** * The grid: sidebar column + pane. Below 1024px (the console family's own * sidebar boundary — one muscle memory across surfaces) the sidebar leaves * the grid and becomes an overlay drawer, and the follow is SUSPENDED — * the pane holds the lower (agent) tone (stylesheet-enforced; §4's ruled * degraded mode). The drawer toggle renders only at drawer widths. * * Children: an {@link AgentModeSidebar} (wrapping the two panels) and an * {@link ActivePane}. The wrapper is structural — the drawer must slide as * ONE element, so the two panels share a positioned parent (the §4 sketch * elides it; the contract is unchanged). */ export declare function AgentModeShell({ children, className, ...rest }: HTMLAttributes): ReactNode; /** The sidebar column: the two panels' shared, drawer-slidable parent. */ export declare function AgentModeSidebar({ children, className, ...rest }: HTMLAttributes): ReactNode; export interface SidebarPanelProps extends HTMLAttributes { section: "app" | "agent"; } /** * One sidebar section. `section="app"` wires `menuInteraction` on * pointer/focus interactions inside it (capture-phase — apps write ZERO * per-link wiring; this covers same-page clicks the route signal cannot * see). `section="agent"` hosts the agent surface and wires nothing — the * agent bridge speaks through the machine. */ export declare function SidebarPanel({ section, children, className, ...rest }: SidebarPanelProps): ReactNode; export interface ActivePaneProps extends HTMLAttributes { /** * Replaces the built-in working-state treatment (identity + pulse) shown * while the agent has the room and nothing is presented yet (founder * (d): NEVER hold prior page content on the agent ground). */ workingState?: ReactNode; } /** * The right pane: paints `--guuey-layout-pane-tone`, animates per the * transition token, honors `prefers-reduced-motion` (stylesheet: instant * snap). While the founder-(d) window is open the pane presents the * working state INSTEAD of its children — prior page content never sits * on the agent ground. */ export declare function ActivePane({ children, workingState, className, ...rest }: ActivePaneProps): ReactNode; export { bindGuueyChat } from "./bind.js"; export type { AgentModeInput, AgentModeState, ActivePanel } from "./machine.js"; export type { TonePair } from "./tones.js"; //# sourceMappingURL=react.d.ts.map