/** * `useToolAction` — the write, in code-land (blueprint §5.4). * * The same door as the read (`POST /apps/:appId/call`), the same guard-bound * caller, the same `ToolOutcome`. Every mount site in this repo already shapes * an action as one line — * `onAction={({action, payload}) => client.apps.call(appId, action, payload ?? {})}` * — and this is that line for code. * * Two laws it carries so the app author never has to: * - a non-ok outcome is a CONTAINED notice, never a crash (the renderer's * `runAction`, ui/tree/renderer.tsx); * - a SUCCESSFUL action refreshes the screen's queries (§6.3 law 2). */ import type { Json, ToolOutcome } from "../../core/index.js"; export interface ToolAction { /** Run it. Resolves with the outcome; never throws. */ run(args?: Json): Promise; /** A run is in flight (its query refresh included). */ pending: boolean; /** The last NON-OK outcome, for the contained notice — `blocked` says why, * `pending-approval` and `connect-required` carry their own affordance. A * success clears it. */ outcome: ToolOutcome | undefined; } export declare function useToolAction(ref: string): ToolAction;