import type { ActionEntry } from "../agent/production-agent.js"; import type { McpApprovalMessages } from "../localization/mcp-approval-messages.js"; import { type McpApprovalTime } from "./approval-time.js"; import type { McpApprovalPriorRun } from "./execute-action-call.js"; /** One argument of the call, as a person reads it. */ export interface McpApprovalField { label: string; /** As the call wrote it. */ value: string; /** Set when `value` names a point in time, to show in the reader's zone. */ time?: McpApprovalTime; /** * Set when `value` is a date-time with no zone: `zone` says how the action * reads it (`calendar`: in the calendar's own zone), or `none` when the * action declares nothing, so the page never shows it as the reader's time. */ wallTime?: { at: number; zone: "none" | "calendar"; }; /** Set when `value` is one of the schema's choices: that choice in words. */ choice?: string; /** Set when `value` is a time zone, to show by its name in the reader's language. */ timeZone?: string; } /** * What a reviewer sees about an MCP call that waits for approval. Built only * from the action's own definition and the arguments the server stored with * the grant: never from text the calling agent wrote about the call. */ export interface McpApprovalSummary { title: string; /** Every email address the call names under a recipient-like argument. */ recipients: string[]; /** * Every argument, each value whole, except one the summary already shows: * the call's one recipient argument when it holds nothing but addresses, * or a zone a time below shows. `details` keeps them. */ fields: McpApprovalField[]; /** The stored arguments, indented; undefined unless `stored`. */ details: string | undefined; arguments: "stored" | "not-stored" | "unreadable"; /** * The server cut the arguments to store them, so the fields, recipients * and details above are not the whole call. */ cut: boolean; } export declare function humanizeIdentifier(identifier: string): string; export declare function summarizeMcpApproval(input: { entry: ActionEntry | undefined; actionName: string; argumentsJson: string | null; labels: { yes: string; no: string; }; }): McpApprovalSummary; /** * `time` in the reader's zone, followed by the time as the call wrote it * when the call's zone reads differently (`formatRequestedTime`). Without a * reader zone, the call's own zone is the only honest choice. */ export declare function describeApprovalTime(time: McpApprovalTime, input: { readerZone: string | undefined; locale: string; messages: Pick; style?: "time" | "date-time"; }): string; /** A field that names no time, as a person reads it. */ export declare function describeFieldValue(field: McpApprovalField, locale: string): string; /** A wall time as written, with how the action reads its missing zone. */ export declare function describeWallTime(wallTime: NonNullable, locale: string, messages: Pick): string; /** * The text of the in-client approval prompt: the same summary the review page * shows, built from the stored arguments, never from the agent's own words. * A form shows what fits in a short text and says what it leaves out, with * the review page's link when the page shows more. */ export declare function mcpApprovalPromptText(input: { summary: McpApprovalSummary; priorRun: McpApprovalPriorRun | undefined; messages: McpApprovalMessages; locale: string; readerZone: string | undefined; mode: "form" | "url"; reviewUrl: string; }): string;