@sema-agent/core
Version:
Stateless, task-oriented AI agent core
25 lines (24 loc) • 1.59 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.
*/
/**
* 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;
};