agentfootprint
Version:
The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.
77 lines • 3.29 kB
TypeScript
/**
* errors — the pool's two refusals, each one fixed sentence.
*
* Pattern: typed errors whose message reaches the model and whose fields reach
* the app.
* Role: A refusal comes before the `tools/call` is sent, and says so
* (`sent: false`) for the record of what that attempt did. Control
* requests made on the way — the `initialize` of a replacement client,
* a revalidating `tools/list` — may already have reached the server;
* `sent` describes the `tools/call` only.
*
* A message is a fixed sentence per reason. It names no identity, no key, no
* session and no count: the counts ride typed fields the app reads, and the
* original error of a failed open rides `cause`, for the app, never composed
* into the message.
*/
/** Why a pool refused, by name. */
export type McpPoolRefusal = 'no-identity' | 'incomplete-identity' | 'identity-mismatch' | 'init-timeout' | 'init-failed' | 'stale-tools' | 'binding-changed' | 'request-unmatched' | 'lease-expired' | 'closed';
/** The sentence each refusal reaches the model as. */
export declare const MCP_POOL_REFUSAL_SENTENCES: Readonly<Record<McpPoolRefusal, string>>;
/**
* The pool refused before the `tools/call` was sent — by `reason`.
*
* `init-failed` keeps the open's own error as `cause`, for the app; its text is
* never in the message.
*/
export declare class McpPoolRefusedError extends Error {
readonly reason: McpPoolRefusal;
/** The pool's name: the server. */
readonly server: string;
readonly code: "ERR_MCP_POOL_REFUSED";
/** The `tools/call` was not sent. Control requests on the way may have been. */
readonly sent: false;
constructor(reason: McpPoolRefusal,
/** The pool's name: the server. */
server: string, options?: {
readonly cause?: unknown;
});
}
/** Which budget was full. */
export type McpPoolLimit = 'pool' | 'principal' | 'ending' | 'operations';
/** The one sentence a full pool reaches the model as. */
export declare const POOL_FULL_SENTENCE = "The connection pool for this server was full, so the tool call was not sent.";
/**
* A budget was full, so the work was refused at once — there is no queue. Its
* scope is the `tools/call`, as with `sent: false`. The counts ride typed fields.
*/
export declare class PoolFullError extends Error {
/** The pool's name: the server. */
readonly server: string;
/** Which budget was full. */
readonly limit: McpPoolLimit;
/** That budget's size. */
readonly max: number;
/** Busy clients when it was refused. */
readonly busy: number;
/** Clients being ended when it was refused. */
readonly ending: number;
/** Operations charged when it was refused. */
readonly operations: number;
readonly code: "ERR_MCP_POOL_FULL";
readonly sent: false;
constructor(
/** The pool's name: the server. */
server: string,
/** Which budget was full. */
limit: McpPoolLimit,
/** That budget's size. */
max: number,
/** Busy clients when it was refused. */
busy: number,
/** Clients being ended when it was refused. */
ending: number,
/** Operations charged when it was refused. */
operations: number);
}
//# sourceMappingURL=errors.d.ts.map