/** * Shape of the answer ssh_file_list gives: a directory taken apart into * fields rather than handed over as the output of `ls`. * * The tool is what a caller reaches for right after writing a file, to see * the mode and the owner that were applied. Prose makes that caller parse a * table whose columns move between servers — the very work the tools exist * to take off them. */ import type { Tool } from '@modelcontextprotocol/sdk/types.js'; import { type Legend } from './legend.js'; type OutputSchema = NonNullable; export type EntryType = 'file' | 'dir' | 'symlink' | 'other'; export interface ListEntry { /** Named as it was asked for: a name in the directory, a path below it when recursive */ name: string; type: EntryType; /** Bytes, as the server counted them */ size: number; /** Access rights the way chmod takes them: "644", "4755" */ mode: string; owner: string; group: string; /** Modification time in seconds since epoch */ mtime: number; /** Where a symlink points, verbatim; null for everything else */ target: string | null; } /** The answer of one listing */ export interface ListSummary { /** The directory that was listed, after the tilde and the path rules */ path: string; entries: ListEntry[]; /** * Directories the listing was not allowed to enter. What they hold is * unknown: a listing short by exactly the interesting directory reads as a * complete one. */ unreadable: string[]; /** The answer hit the output limit, so the list ends earlier than the directory does */ truncated: boolean; legend: Legend; } /** * The answer, legend included. Built here so that a listing of one file and a * listing of a thousand explain their words the same way. */ export declare function listSummary(path: string, entries: ListEntry[], unreadable: string[], truncated: boolean): ListSummary; export declare const LIST_OUTPUT_SCHEMA: OutputSchema; export {};