/** * The shape of tool arguments: whether a parameter is present and of the * right kind. * * `shell-arg.ts` lives alongside this module — it's about the **value** * (`lines`, `mode`, `pattern`) that goes into the command. This one is * about the **shape**: whether a required parameter arrived at all, and * whether it's a string, an array of strings, or an object. * * Without this check, a malformed argument shape doesn't produce a clean * rejection — it surfaces as an internal crash such as `Cannot read * properties of undefined (reading 'path')` when `ssh_file_write` is called * without `files`, or `finalCommand.substring is not a function` for * `command: 42`. That text doesn't say what's wrong, so an agent falls back * to `ssh_exec` instead. * * The schema doesn't save us from this: MCP validates the request envelope, * and `arguments` comes through as-is — `oneOf` in the schema stays a * description for the client, not a guard. * * Rejection messages are kept in the same format as `shell-arg.ts`: what was * expected and what arrived. An empty list is also a rejection: "write zero * files" isn't work done, it's a lost call the caller needs to know about. */ /** A required string: a destination path, a directory, a file name */ export declare function requireText(value: unknown, name: string, example: string): string; /** * A required string or array of strings — the shape declared via `oneOf` * for `command` and `path`. Always returns an array: the caller doesn't * need to repeat the shape parsing itself. */ export declare function requireTextList(value: unknown, name: string, example: string): string[]; /** * A required object or array of objects — the shape of `files` for * `ssh_file_write`. Required fields on each entry are checked right here: * without this check, the code further down would hit the very * `undefined.path` this module exists to prevent. */ export declare function requireEntryList(value: unknown, name: string, required: readonly F[], example: string): Array & Record>;