/** * Fire an action to the agent. Fire-and-forget — no response, no pending state. * * Every action is an event: it lands on the GguiSession's consume buffer and * the agent receives it on its next turn (via `ggui_consume`). The action * entry's optional `nextStep` names the tool the agent SHOULD invoke in * response — advisory only; the agent owns the call decision. Component code * is identical either way: call `useAction(name)(payload)` and treat * `nextStep` as informational (use it to inform button labels, icons, copy). * * RUNTIME DEDUP (backstop, not a feature). Same-`(name, payload)` calls within * one event-loop task are coalesced — the first wins, subsequent duplicates * are suppressed. This is the structural defense against LLM-generated * nested-interactive components where a Checkbox `onChange` and an outer * `Card as={Clickable}` `onClick` both wire to the same `useAction` binding; * the inner gesture bubbles to the outer handler, so without dedup one user * click would fire the action twice (a toggle would run back-to-back and the * user's change would disappear). **Do not rely on this as a feature** — wire * each `useAction` callback to exactly ONE interactive surface; the dedup * exists only because the LLM's source code can be wrong in subtle ways and * the runtime is the only place that can see the actual event-bubble path. * See `dispatch-dedup.ts` for the full failure-mode rationale. * * NEVER SILENT. When the dedup fires, a `console.warn` is emitted in BOTH dev * and prod with the full diagnostic. The suppression is always visible in * browser DevTools; operators investigating a "the second click does nothing" * report see the warning immediately. A structured observer also exists as * `WireConfig.onDispatchSuppressed`, but the first-party renderers never set * it — it is reachable only from a hand-built `WireConfig` (see its * docstring), so the console signal is what operators get in practice. * * @param actionName - Action name from the action contract * @returns Stable callback that dispatches the action */ export declare function useAction(actionName: string): (data: T) => void; //# sourceMappingURL=useAction.d.ts.map