import type { MissCode } from "./contract.js"; import { type Filing, type LookRecord } from "./evidence.js"; import type { ToolResult } from "./host.js"; /** One read or look that could not give the model what it asked for, for the host's rows. */ export type MissEvent = { readonly conversationId: string; /** `read` or `vision.see`, or the tool whose result held the image (`CallContext.tool`). */ readonly tool: string; readonly source: string; readonly ask?: string; readonly code: MissCode; /** The first line of the cause, as the model reads it. */ readonly reason: string; /** The eyes' model, when eyes were asked. */ readonly model?: string; /** Where the failed look was filed, or null when the sink filed nothing (an image no door named has no receipt). */ readonly receipt: string | null; /** The failed look as it was filed, whether or not the sink filed it: `status` failed, a `body` that says why, and in * `facts` its `key` and what the eyes charged (`cost_usd` null when the price is unknown, absent when a request * threw and may have been billed). A host files it like any look it keeps, so what a failed look cost is counted. * Absent when the host's own setup failed before any look was made. */ readonly record?: LookRecord; }; /** Why a look did not happen: the code, the cause in one line, and the eyes' model when eyes were asked. `setup` is set * when the host's own callbacks failed before any look was made: the event then carries no record. */ export type Miss = { readonly code: MissCode; readonly reason: string; readonly model?: string; readonly setup?: true; }; /** What the model can do about each miss. */ export declare const MISS_ACTION: Readonly>; /** A line with every http(s) and ws(s) link in it cut to its origin and path: a link's query, fragment and credentials * (a signed link's signature, a token) never reach a result, a receipt or an event. A link may stand inside a word, * quoted or bracketed or after `url=`, and its slashes may be escaped as JSON writes them (`https:\/\/`): it starts at * its scheme and ends before the quotes and punctuation that close it, and it is parsed as a URL, never matched. */ export declare const linkSafe: (line: string) => string; /** The first line of an error's message, its links cut to origin and path and any absolute file path to its last part, bounded. */ export declare const firstLine: (error: unknown, max?: number) => string; /** A refusal of the arguments: one line, `isError: true`. */ export declare const refusal: (text: string) => ToolResult; /** File a miss as a failed look and tell the host, with the record it filed. The receipt path, or null. */ export declare function reportMiss(filing: Filing, tool: string, record: LookRecord, miss: Miss): Promise;