@sema-agent/core
Version:
Stateless, task-oriented AI agent core
39 lines (38 loc) • 3.02 kB
TypeScript
import type { ToolAxesSurface } from "./mcp-server-spec.js";
/**
* Per surface, the words a sentence about its declaration uses: what the keys are called, what the declarer is called (and, where the
* surface says so, the most of its name a refusal prints — the sentence leads with the name, ahead of the fix, so on a surface whose
* refusal a reader cuts it is short), and what the refusal of a declaration says of it — what the engine did with it, why it is refused
* whole and, where a lowering is not the skill's to declare, whose it is (in no apostrophe: a reader that redacts the line before it cuts
* would pair one with a quote a caller's name opened, and take the fix out with it). An MCP server's caller may vouch a tool down, so
* its declaration is that caller's trust root; an A2A peer's skill only raises, and what its calls ask is the deployment's to set.
*/
export declare const TOOL_AXES_SURFACES: {
readonly mcp: {
readonly key: "tool";
readonly declarer: "MCP server";
readonly refused: "the engine cannot read";
readonly standing: "A per-tool safety-axis declaration is the caller's trust root for the approval gate";
};
readonly a2a: {
readonly key: "skill";
readonly declarer: "A2A peer";
readonly nameMax: 32;
readonly refused: "the engine does not take";
readonly standing: "A declaration on an A2A peer only raises the question its calls ask";
readonly afterLowering: "The deployment sets what calls to a peer ask (\"boundary\").";
};
};
/** Whether `at` is one of the surfaces ({@link ToolAxesSurface}) — an own key of the one table the declarer words live in. */
export declare function isToolAxesSurface(at: unknown): at is ToolAxesSurface;
/** The surfaces as a refusal lists them (`"mcp" | "a2a"`), read off the same table. */
export declare const toolAxesSurfaceList: () => string;
/** A declarer's name (a server's, a peer's) as every sentence about its declaration spells it: quoted, bounded, total — the entry's
* published identity (the engine mints it into every tool name it mounts). A name longer than the part read is spelled from that part
* alone, with no closing quote and the cut marked, so its spelling never looks whole. A name that is no string is named by its kind
* (`callerText`, which reads only the value's kind and length and so can never throw while a sentence is built). */
export declare const declarerNameOf: (name: unknown) => string;
/** How a sentence names one entry: the surface's declarer word (the row `declarerWord` in mcp-server-spec.ts reads) and, when there is
* one, its name (`MCP server "db"`) — never a value. The one composition: the declaration receipt's refusals, the entry a person's
* notice names for a variable held for a peer (taken in by a receipt, or declared by the host, secret-env.ts `declarePeerHeldEnv`). */
export declare function declarationSubject(at: ToolAxesSurface, declarer: string | undefined): string;