/** * `useToolQuery` — the guarded read, in code-land (blueprint §5.4). * * There is no per-query HTTP endpoint and this does not add one: a read goes * through the door that already exists, `POST /apps/:appId/call`, which lands * on the guard-bound `AppCaller`. No second door, no second query path. * * The semantics: a non-ok outcome contributes NO data and sets * `dataUnavailable`, an "ok" answer that happens to be empty is an ANSWER, and * each distinct miss is reported once. §6.4: a failed load must never read as * "you have no spending". * * Total. A network failure is an unavailable read, not an exception. */ import { type Json, type ToolOutcome } from "../../core/index.js"; export interface ToolQuery { /** The tool's output, or `undefined` — which means "not arrived", never * "empty". Empty is `[]` / `{}` / `0`, and it arrives as itself. */ data: T | undefined; /** A read is in flight (the first one, or a refetch). */ loading: boolean; /** The read settled without data: refused, errored, or unreachable. Distinct * from an empty answer, so a screen can say "we could not load this" * instead of "you have nothing". */ dataUnavailable: boolean; /** The non-ok outcome behind `dataUnavailable`, so a refusal that has an * affordance (`connect-required`, `pending-approval`) can render one. * `undefined` whenever the last read succeeded. */ outcome: ToolOutcome | undefined; /** Read again. Never throws. */ refetch(): Promise; } export declare function useToolQuery(ref: string, args?: Json): ToolQuery;