/** * The write-approval gate: which rta_* tools are reads, free writes, or * credit-spending writes, and what the `tools/pre-execute` listener answers. * * | Tier | readOnly | writeApproval:true | writeApproval:false | * |---------------|----------|--------------------|---------------------| * | read | allow | allow | allow | * | write-free | deny | ask | allow | * | write-costly | deny | ask | ask (always) | * * @module dsh-realtimeavatar/gate */ import type { ResolvedRtaConfig } from './config.js'; export type ToolTier = 'read' | 'write-free' | 'write-costly'; /** Every rta_* tool and its tier. Reads include the free, idempotent session release. */ export declare const TOOL_TIERS: { readonly rta_status: "read"; readonly rta_balance: "read"; readonly rta_capacity: "read"; readonly rta_avatars: "read"; readonly rta_avatar: "read"; readonly rta_clips: "read"; readonly rta_assets: "read"; readonly rta_usage: "read"; readonly rta_docs: "read"; readonly rta_quickstart: "read"; readonly rta_session_release: "read"; readonly rta_asset_remote: "write-free"; readonly rta_avatar_update: "write-free"; readonly rta_avatar_delete: "write-free"; readonly rta_avatar_create: "write-costly"; readonly rta_loop_set: "write-costly"; readonly rta_clips_set: "write-costly"; readonly rta_session_mint: "write-costly"; }; export type RtaToolName = keyof typeof TOOL_TIERS; export declare const TOOL_NAMES: RtaToolName[]; export declare function tierOf(name: string): ToolTier | undefined; export declare function isWriteTool(name: string): boolean; /** Verdict a pre-execute listener returns (or it calls next() to waterfall). */ export type Verdict = { kind: 'allow' | 'deny' | 'ask'; reason?: string; }; /** Human-readable reason for an approval prompt, redacted, ≤ ~300 chars. */ export declare function describeWrite(name: string, args: unknown): string; /** Decide for one execution. Returns null when the tool is not ours (waterfall). */ export declare function decide(cfg: ResolvedRtaConfig, name: string, args: unknown): Verdict | null;