/** * What MCP results redact before a model or client sees them. The redaction * itself runs in `build-server.ts`; an opted-in action's advertised output * contract is derived through the same rules (`action-output-contract.ts`), * so both read them from here. Server logs that show a thrown value read it * through the same string check. */ /** * Replaces a string carrying an embed start reference, so a reader sees * that a value was hidden rather than finding its key missing. */ export declare const HIDDEN_EMBED_URL = "[hidden embed URL]"; /** Replaces a value already being serialized higher up the same result. */ export declare const CIRCULAR_RESULT = "[circular result]"; /** Keys removed from every result object, whatever their value. */ export declare const EMBED_RESULT_SENSITIVE_KEYS: ReadonlySet; /** Keys removed from an object that carries an embed routing signal. */ export declare function isEmbedCredentialKey(key: string): boolean; /** * Whether a URL's own path is the embed start route, which redeems a ticket * when loaded. It decides when to mint a session, which URL is the open link * and which start URL a view is handed, so it must not match a page that only * mentions the route. Model-visible output is checked more broadly, by * `redactEmbedCredentials` and `modelVisibleToolResponse`. */ export declare function isEmbedStartUrl(value: string): boolean; export declare const IMAGE_BYTES: RegExp; export declare const MAX_DECODE_ROUNDS = 8; /** One string as every check below reads it. */ export interface StringReading { /** * The string and each layer of percent, JavaScript string and HTML escaping * under it, to `MAX_DECODE_ROUNDS` layers deep. Each layer also contributes * its control-free spelling for ticket discovery and echo matching. */ layers: string[]; /** * Whether every layer could be inspected within the decoding and reference * work limits. Otherwise no check here can say what the string holds. */ complete: boolean; /** * Whether any layer carries a canonical embed URL/path or a ticket-bearing * relative embed reference. Ordinary route discussion and filenames survive. */ mentionsRoute: boolean; } export declare function readString(text: string): StringReading; /** * Text a model sees outside a result, such as an error message or a refusal. * The text is the whole output, so one that carries an embed reference or * cannot be fully inspected is hidden whole. */ export declare function redactEmbedText(text: string): string; /** * A thrown value, or text built from one, as a server log shows it: its name * and message, hidden whole as `redactEmbedText` hides text. It is the * thrower's data, and reading it may throw too, so one that cannot be read is * named only as such. */ export declare function describeThrownForLog(error: unknown): string;