@sema-agent/core
Version:
Stateless, task-oriented AI agent core
31 lines (30 loc) • 2.08 kB
TypeScript
/**
* The per-tool `_meta` declarations a server makes in its tools/list entry that the engine reads at intake: a result-size
* threshold (`anthropic/maxResultSizeChars`) and the requirement that a call be put to a person
* (`anthropic/requiresUserInteraction`). Pure readers over the entry's `_meta` — the intake (`mcp.ts`) stamps what they answer
* on the mounted tool.
*/
/**
* The size of a remote result's text the engine carries when the remote declared none: CC's MCP base declares 1e5 and the first-party floor
* is 50K, so min(1e5, 50K). One number with two readers — the offload wrapper of a remote-peer mount (a result past it is offloaded) and the
* host's MCP read ports (a text block past it is cut, `truncated: true`) — so the model's and the host's bound cannot drift apart.
*/
export declare const MCP_REMOTE_RESULT_MAX_CHARS = 50000;
/**
* F4-② (CC :320015/:320061): resolve a server's self-declared per-tool result-size threshold from its
* `_meta`. Non-numeric/non-finite/non-positive → undefined (declaration ignored); valid → capped at
* {@link MCP_META_RESULT_SIZE_CAP}. Exported for tests.
*/
export declare function resolveMcpDeclaredResultSize(meta: Record<string, unknown> | undefined): number | undefined;
/**
* A server's own per-tool declaration that a call must be put to a person, read from its `_meta` by the reference
* implementation's rule: the boolean `true` declares it, nothing else does. `declared` is the seat fact the intake stamps on
* the mounted tool. A PRESENT value that is not a boolean (the string "true", the number 1, an object, null) is a declaration
* the server wrote and this reader cannot honour: `advisory` is the sentence for the operator warning lane saying so (the tool
* stays mounted and reads as undeclared), instead of letting a typo quietly read as "no interaction required". `false` and
* absence are well-formed and say nothing. Exported for tests.
*/
export declare function resolveMcpRequiresUserInteraction(meta: unknown): {
declared: boolean;
advisory?: string;
};