agentfootprint
Version:
The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.
31 lines (30 loc) • 1.73 kB
TypeScript
/**
* connectionRefusals — the two arms of `mcpClient` refuse to be mixed, at
* CONSTRUCTION, in words that name where the behaviour went.
*
* ── Why refuse rather than ignore ────────────────────────────────────────────
* `mcpClient({ connection })` hands over a client somebody else built, so this
* library builds no transport on that arm — and every option consumed INSIDE a
* transport therefore has nothing to act on. `retryOnThrottle` is the sharp
* one: it is ON by default, it is consumed by `retryingFetch` around the
* transport's `fetch`, and accepting it here would leave a caller holding an
* option that NAMES a behaviour which no longer happens. A knob that lies about
* what it does is worse than one that is absent, so these throw.
*
* The type union refuses the same combinations at compile time
* (`McpConnectionOptions` declares each of them `?: undefined`). This is the
* runtime half, and it is not redundant: excess-property checking does not
* survive a spread, and JavaScript callers have no compiler at all.
*
* Pattern: pure guard. Role: Layer-3 tool integration.
*/
import type { McpClientOptions, McpConnectionOptions } from './types.js';
/**
* Refuse a mixed or malformed options object before anything connects.
*
* @param opts what the caller passed, before any defaulting
* @param name the client's logical name, so a multi-server app knows which one
* @throws naming the two options that cannot travel together, or the member the
* connection is missing
*/
export declare function refuseConflictingOptions(opts: McpClientOptions | McpConnectionOptions, name: string): void;