/** * Shape of the summary for tools that put data somewhere: ssh_file_write, * ssh_upload, ssh_download. * * The four verification outcomes are the whole point. In the text they are a * tail of the line — " (sha256 verified)", " (NOT verified: …)" or nothing at * all — and the last one, "nobody asked for a check", looks exactly like an * ordinary line about a written file. Absence of a check must not read as a * check that passed. */ import type { Tool } from '@modelcontextprotocol/sdk/types.js'; import { type Legend } from './legend.js'; type OutputSchema = NonNullable; export type VerifiedOutcome = 'verified' | 'mismatched' | 'unavailable' | 'skipped'; /** * The owner is set by `chown`, and under a regular user it refuses on a name * that isn't its own. Worded once for both tools that take an owner. */ export declare const OWNER_NEEDS_SUDO = "owner was NOT applied: chown needs sudo \u2014 the file belongs to the connecting user"; export interface FileSummary { /** Where the data went on the server, after the tilde and the rules were applied */ path: string; written: boolean; verified: VerifiedOutcome; /** * Why the outcome is what it is: what the check had nothing to work with, * or what the write failed on. `null` when there is nothing to explain. */ reason: string | null; /** Size of what travelled; `null` — nobody counted it */ bytes: number | null; } /** The answer of one call that wrote or transferred data */ export interface FilesSummary { files: FileSummary[]; legend: Legend; } /** * The answer, legend included. Building it here is what keeps a batch of * twenty files from carrying twenty copies of the same sentence — and keeps * a single file from arriving without one. */ export declare function filesSummary(files: FileSummary[]): FilesSummary; /** A file that landed, with the verification outcome as ssh_file_write words it */ export declare function writtenFile(path: string, verification: { status: VerifiedOutcome; reason?: string; }, bytes: number | null): FileSummary; /** * A file that travelled, with the verification outcome as the transfer words it. * * A transfer says it in two values instead of three: `verified: false` means * either "there was nothing to check with" — and then it carries the reason — * or "the caller asked for no check". */ export declare function transferredFile(path: string, transfer: { verified: boolean; verifyNote?: string; }, bytes: number | null): FileSummary; /** * A file whose copy on the server differed from the source. * * The replacement never happened, so `written` is false: the outcome travels * with the failure flag, because a call that ends this way did no work. */ export declare function mismatchedFile(path: string, reason: string): FileSummary; /** A file that never landed: the reason is the failure itself, not a missing check */ export declare function failedFile(path: string, reason: string): FileSummary; export declare const FILES_OUTPUT_SCHEMA: OutputSchema; export {};