/** ENG-216 — tool & approval humanization helpers. The approval/tool wire parts (01-core stream-parts) deliberately carry only `toolCallId` + `risk` + `approvalId`; no friendly name, description or arg formatting ever reaches the client. Chrome therefore humanizes at the render site: a host-supplied `ToolMeta` (VendoProvider `tools` prop) wins, and when it is absent these pure fallbacks prettify the raw id and args so end users never read a raw slug, a lifecycle string, or raw JSON. */ import { humanizeToolName, type Json, type JsonSchema } from "../../core/index.js"; /** Optional host-supplied friendly metadata for one tool (08-ui provider seam). Purely UI-side and additive — the host describes its own tools so chips and approvals read in human language; every field is optional and degrades to the formatting fallback below. */ export interface ToolMeta { /** Short display label, e.g. "Send email". */ label?: string; /** One-line description shown under the approval title. */ description?: string; /** Custom one-line argument summary for the tool chip. */ summarize?(args: Json): string | undefined; /** Display formatting for one approval-card field value (e.g. integer cents → "$500.00"). Return undefined to keep the raw value. Display-only: the raw args still drive the decision hash and the exact-input grant. */ formatField?(key: string, value: Json): string | undefined; } export type ToolMetaMap = Record; /** Beside {@link VENDO_TOOL_TITLES} in core since the engine writes consent sentences with the same prettifier; re-exported so every chrome caller keeps its one import site. */ export { humanizeToolName }; /** * The display title for a tool, most local authority first: the host's * in-code `ToolMeta.label`, then the descriptor's authored `title` (written by * sync's enrichment into `.vendo/tools.json`, correctable in * `.vendo/overrides.json` — the same label the MCP door puts on the wire), then * Vendo's own title for its own tools, then the prettified id. * * That third step exists because most surfaces have NO descriptor: the wire tool * part carries only a name, so a progress chip or an activity row prettified * `vendo_apps_open` into "Vendo apps open" — our namespace read out as words, the * §3 leak. The table is core's, the same one the descriptors author from, so * the two can never disagree. */ export declare function toolTitle(name: string, meta?: ToolMeta, descriptorTitle?: string): string; /** Display name for a toolkit slug: the known-brand table first (separator-less slugs like "googlecalendar" can't be recovered by splitting), then a separator-splitting proper-caser ("google_calendar" → "Google Calendar"). The brand-forward connect surfaces never show the raw slug. */ export declare function toolkitDisplayName(toolkit: string): string; /** The access line for a toolkit — a verb phrase the card wraps ("Connecting lets us …"). The generic fallback names the service and stops there: a guess at a specific permission would be worse than the honest general one. */ export declare function toolkitAccessCopy(toolkit: string): string; /** A tool's declared input properties, when the caller holds the descriptor. */ export type ArgProperties = Record | undefined; /** Read `inputSchema.properties` off a descriptor, or undefined when the surface has no schema to consult (the in-thread card synthesizes an empty one). */ export declare function argProperties(inputSchema: JsonSchema | undefined): ArgProperties; /** A boolean field answers a question ("Permanent?"), so it reads as an answer. `true` in front of a bank customer is the developer's literal, not the person's word; the raw literal stays on `CardFieldRow.raw` for dev mode. The KEY carries the meaning — this never invents a sentence around it. */ export declare const yesNo: (value: boolean) => string; /** * One argument value, as a person must read it — the consent surfaces' rule. * * Money is the only value whose raw form reads as a DIFFERENT number: a $47.50 * payment arrives as `4750` and reads as $4,750, on the one surface that gates * irreversible money movement. The unit comes from the HOST'S DECLARATION over * the tool's own input schema, never from the value's * magnitude — dressing a non-money integer as currency would be the same defect * pointing the other way. Undeclared money says so out loud rather than looking * like dollars. */ export declare function argValue(field: string, value: unknown, properties: ArgProperties): string; /** A plain-object argument map → humanized `{ label, value }` rows, in order. Non-object args (string / array / null) produce no rows — the caller keeps the server-formatted `inputPreview` string in that case. */ export declare function argFields(args: unknown): { label: string; value: string; }[]; /** A compact one-line arg summary for a tool chip — never raw JSON. */ export declare function summarizeArgs(args: unknown): string | undefined; /** Multi-line `Label: value` preview for the approval card, replacing raw JSON. Falls back to a plain string / prettified JSON for non-object args. */ export declare function previewArgs(args: unknown): string;