UNPKG

@sema-agent/core

Version:

Stateless, task-oriented AI agent core

371 lines (370 loc) • 28.6 kB
import type { A2aServerSpec, McpServerSpec, RunnerDeps, TaskSpec } from "./types.js"; import { type ToolAxesSurface } from "./mcp-server-spec.js"; import type { ToolPolicy } from "./tool-policy.js"; /** The closed set of administratively lockable configuration keys. Adding a member is a deliberate * edit HERE (tsc forces the registry row), never a free-form string. */ export type LockedKey = "mcp" | "a2a" | "toolPolicy" | "compliancePosture" | "retentionPolicy"; /** * The closed locked-key registry: each key names the exact `TaskSpec` fields it guards. Keys whose * field set is EMPTY guard deployment-only surfaces (`compliancePosture` rides * `RunnerDeps.compliancePostureResolver`, `retentionPolicy` rides `RunnerDeps.retentionPolicy`) — * there is structurally no untrusted spec field to refuse, so for those the lock is a declaration * consumed elsewhere (the retention startup validation keys off `retentionPolicy` being locked; the * server control plane reads the declaration for its own sync gate). `satisfies` keeps the row set * and the {@link LockedKey} union in lockstep — tsc refuses a key without a row and a row without a * key. */ export declare const LOCKED_KEY_REGISTRY: { readonly mcp: { readonly specFields: readonly ["mcp"]; }; readonly a2a: { readonly specFields: readonly ["a2a"]; }; readonly toolPolicy: { readonly specFields: readonly ["toolPolicy", "basePolicyForResumeEdit"]; }; readonly compliancePosture: { readonly specFields: readonly []; }; readonly retentionPolicy: { readonly specFields: readonly []; }; }; /** A deployment's lock declaration ({@link RunnerDeps.lockedConfig}). Config-time, trusted. */ export interface LockedConfig { /** The keys this deployment locks. Wire-validated against {@link LOCKED_KEY_REGISTRY} at the * preflight door — an unknown member is a loud `config.locked_registry` refusal, never a no-op. */ keys: readonly LockedKey[]; } /** The preflight's resolved snapshot — the ONLY thing downstream task assembly reads for the * guarded slots (never the raw `spec.mcp` / `spec.a2a` / `spec.toolPolicy` fields). */ export interface LockedPreflight { /** The validated lock set (empty when the deployment declares none). */ lockedKeys: ReadonlySet<LockedKey>; /** Effective MCP server list for this task: a validated, frozen SNAPSHOT of `spec.mcp` when the * key is unlocked (the receipt {@link receivePeerDeclarations}, judged by `validatedMcpEntries` — the content-class and `toolAxes` declarations * are read once and judged here, so no mint site downstream can be handed a different value than the door * approved); with `mcp` locked a spec-supplied value has already been refused, so this is always * `undefined` (core has no deployment-level MCP seat — a locked deployment mounts no * task-supplied servers). */ mcp: TaskSpec["mcp"]; /** The task's A2A peers: a frozen SNAPSHOT of `spec.a2a` whose `toolAxes` were judged here by the same reader and with the same * disposition as an MCP server's (a declaration that does not fit refused the whole prepare), each peer carrying the reader's plain * copy; `undefined` when the spec declares no peer (absent or empty) or `a2a` is locked (a declared list has already been refused). Read once, here: the peers dialed are the peers judged. */ a2a: TaskSpec["a2a"]; /** Effective caller tool policy: the same `spec.toolPolicy ?? deps.toolPolicy` slot the gate has * always enforced, resolved ONCE here. With `toolPolicy` locked, the deployment's own * `deps.toolPolicy` is the whole answer (a spec-supplied policy has already been refused). */ toolPolicy: ToolPolicy | undefined; /** Where {@link toolPolicy} came from, as the chain layer this leg hands its children names it: the task's own seat * (`taskPolicy`) when the resolution took it, else the deployment's (`deploymentPolicy`); absent when there is none. */ toolPolicyKind: "taskPolicy" | "deploymentPolicy" | undefined; /** F-012: the effective resume-edit re-adjudication OVERRIDE, resolved lock-aware in * the SAME slot as {@link toolPolicy}. With `toolPolicy` locked, a spec-supplied * `basePolicyForResumeEdit` has already been refused wholesale, so this is the deployment's own * `deps.basePolicyForResumeEdit` (or undefined — the caller-policy fallback then applies at the use * site). Unlocked: `spec.basePolicyForResumeEdit ?? deps.basePolicyForResumeEdit`. */ basePolicyForResumeEdit: ToolPolicy | undefined; } /** * Validate a deployment's lock declaration against the closed registry. Fail-loud on any unknown * key (`config.locked_registry`): a security control that doesn't parse must refuse to arm, not * degrade to "that key silently unlocked". Exported for deployments that want the check at their * own startup; the task-preparation preflight runs it on every leg regardless (a mis-declared lock * then fails the first prepare instead of silently guarding nothing — and, on a resume, the screen before * the claim, which calls the same preflight). * * Total over the declaration: anything but `undefined` (no locks) or plain data whose `keys` is a list of registry names — `null`, a * list, a primitive, a `keys` that is absent or not a list, a declaration that is not plain data (a Proxy, a `Set` of keys, a class * instance, a getter that throws), an element that is not a string, a string that is not a registry name — is the same coded refusal * naming `RunnerDeps.lockedConfig` and the member (an element by its index), never a TypeError and never "no locks". The declaration is * read once, by the one declaration reading. */ export declare function resolveLockedKeys(config: LockedConfig | undefined): ReadonlySet<LockedKey>; /** * design/378 — turn a caller-owned MCP entry list into FROZEN PLAIN DATA, reading every own property * exactly once. * * WHY A COPY. `McpServerSpec.contentOrigin` decides whether a server's tools mark the session's * memory, and the entry objects travel a long way: the preparation door validates them, then * `materializeMcpTools` connects them, then every mid-task refresh re-reads the same object. A value * read off a LIVE object is only true for as long as the object holds still, and the fail-open * direction is the reachable one — so both boundaries consume data instead. * * The read discipline is the load-bearing part, and it is why the copy is made in the pass that reads * rather than "read the property, then copy the object": a getter answering ALTERNATING LEGAL values would * satisfy any number of re-reads (`"external"` to a validator, `"local"` to a mint site), and no * vocabulary guard anywhere has purchase on a legal value. One pass evaluates every member EXACTLY ONCE * and materializes the result as plain data; every later reader — validator, connect, refresh — then sees * the same byte. Frozen so nothing downstream rewrites it. * * Plain data, stated: an entry IS plain data, to its whole depth, or it is refused whole. The entry is read * by the one declaration reading ({@link receiveDeclaration} — the engine's one receipt of a caller's object, * in its declaration mode): every own member read once off its captured descriptor, every level copied, every * copied container frozen; an object the entry reaches through two members is read once, and both hold the one * copy. So a server's `transport` with its `args` / `env` / `headers`, `allowTools`, `toolFaces`, `toolAxes` * and a peer's `headers` and `allowSkills` are the copy's own, and a host that edits its own nested object after * the door (a header value, an `allowSkills.push`) reaches nothing the engine holds: the dial, a refresh and a * re-dial all work from this copy, on both surfaces. The axes are then judged on that copy by their own reader * ({@link judgeEntryToolAxes}), and an MCP server's faces by theirs ({@link judgeEntryToolFaces}). * * There is no third outcome between "copied whole" and "refused": a value the copy cannot carry whole is a * declaration the engine cannot read — a Proxy at any level, an object whose prototype is neither * `Object.prototype` nor null (a class instance, a map, `process.env`, a record built on a prototype or in another * realm, whose members a copy would drop or could not tell from its own), a function, a structure that contains * itself, a getter that throws (whatever it throws), a nesting too deep to read, a list element that is not a * string, a member named `__proto__`, an entry that is not an object. Each is refused as `config.invalid_argument` * naming the declarer and the member where reading stopped (`toolFaces.write_file`, `allowTools[2]`), never as the * raw error the host's code threw, and never by handing the host's object on: a member some of whose getters have * already run would be read again downstream, and could answer differently. The door refuses the whole prepare and * a library entrance the whole call, with this one sentence either way. * * Exported because the SECOND boundary needs the identical guarantee: `materializeMcpTools` is public * and a library caller reaches it without passing any door, so it snapshots its own input through * this same function (idempotent over an already-frozen entry). One spelling, both entrances. */ export declare function snapshotMcpEntries(entries: readonly McpServerSpec[]): McpServerSpec[]; /** * The refusal of a declaration the engine cannot read (`config.invalid_argument`). `declarer` is the entry's own name as the engine captured * it ({@link capturedName}) — absent when there was none to capture — so a consumer that holds the refused entry by a name (the A2A * entrance's warning, its collision check) takes it from here and never reads the caller's object again. */ export type DeclarationRefusal = Error & { code: "config.invalid_argument"; declarer?: string; }; /** * The name a refused entry is held under by a consumer that holds it by a name (the A2A entrance): the refusal's own `declarer`, read as * own data — never through anything the refusal's prototype carries — or `undefined` (the consumer names the entry by its place). */ export declare function refusedDeclarer(refusal: unknown): string | undefined; /** * One entry of EITHER surface that declares `toolAxes` (an MCP server, an A2A peer) as frozen plain data, read by the discipline * {@link snapshotMcpEntries} states: the entry and everything in it read once by the one declaration reading and copied to its whole * depth, or the entry refused ({@link DeclarationRefusal}), naming the member where reading stopped. The A2A peer's door and its * materialization snapshot through this same function, so the two surfaces' declarations reach the one judge ({@link judgeEntryToolAxes}) * read the same way; `at` is the surface the entry sits on, which only decides what the refusal calls the declarer. */ export declare function snapshotDeclaredEntry<E extends McpServerSpec | A2aServerSpec>(entry: E, at: ToolAxesSurface): E; /** * The door half: the content class a task's entries declare is judged HERE, on the snapshot, and an * off-vocabulary value refuses the whole prepare (`config.mcp_content_class`). Folding it to a class * instead would be a silent downgrade — the deployment believes its declaration is in force while * every call keeps writing a one-way durable mark, which fixing the configuration later cannot undo. * The library entrance deliberately does NOT run this check (it has no prepare semantics to refuse): * a value that reaches a mint site around this door is caught by the classifier's own vocabulary * guard, which answers `"external"`. * * The same door judges `toolAxes` through its one reader (`readToolAxes`, via {@link judgeEntryToolAxes}) on every * MCP server and every A2A peer alike: a declaration that does not fit refuses the whole prepare (`config.invalid_argument`), * and the entry then carries the reader's plain copy of the axes rather than the caller's live object. Unlike the content * class, the library entrances ask this question too (per server, `materializeMcpTools`; per peer, `materializeA2aTools`). * An MCP server's `toolFaces` is judged the same way, through its one reader (`readToolFaces`, via {@link judgeEntryToolFaces}), and refuses * under the code of a face the engine cannot carry (`config.tool_face_invalid`, the code a caller tool's bad face has at the caller door), not * the generic one: the entry's own plain-data receipt (above) and the `toolAxes` leg keep `config.invalid_argument`. */ /** What every question about ONE snapshot MCP entry answers: the entry (carrying the reader's own copy of whatever was judged) or the coded * refusal that names the server and the member. The one answer shape of {@link judgeMcpEntryDeclarations} and of each leg it runs. */ export type McpEntryJudgment = { ok: true; entry: McpServerSpec; } | { ok: false; error: Error & { code: string; }; }; /** * The `toolAxes` question for ONE snapshot entry of either surface (`at`: an MCP server, an A2A peer) — asked by the preparation door (a * refusal ends the prepare) and by each materialization entrance (a refusal fails that server's or that peer's dial), so there is one * reading, one copy and one sentence whichever surface and whichever time it is asked. `ok: true` carries the entry with the reader's * PLAIN COPY of the axes in place of the caller's object: what was judged is the very value the connect and every refresh read, not a * live object that could answer differently later. The copy is frozen with the entry — a tool that shallow-copies a server * (`mountedMcp()`) to customise its axes must not rewrite what the parent reads. `ok: false` carries the coded refusal * (`config.invalid_argument`) naming the declarer, the tool (or skill) and the member, never a value — and, for an A2A peer not * registered inside, the whole peer's way down (asked after the registration is judged, so `boundary` is one of its words here). */ export declare function judgeEntryToolAxes<E extends McpServerSpec | A2aServerSpec>(copy: E, at: ToolAxesSurface): { ok: true; entry: E; } | { ok: false; error: Error & { code: string; }; }; /** * The registration question for ONE snapshot A2A peer — `boundary`, `fingerprint`, `displayName`, `ownerTeam` — asked where its * `toolAxes` are ({@link judgeEntryToolAxes}): by the preparation door (a refusal ends the prepare) and by the materialization entrance * (a refusal fails that peer's dial). The answer is the `member` group of the shared registration check (`a2aRegistrationProblems`, * `@sema-agent/primitives` — the check a settings contract asks too): `boundary` is one of its two words; `fingerprint` a string holding * a visible character, of at most 128 characters (the MCP member's bound); the two names the same, of at most 160. Any other value is refused * (`config.invalid_argument`), never read as absent: a word the engine cannot read in `boundary` would otherwise become outside without * anyone being told, and a stamp read as absent would leave an inside registration unbound. What `"inside"` asks of the rest of the * declaration (the check's `inside` group) is the dial's question (a2a.ts), not this one's: a missing member there refuses the peer and * spares its siblings, also at a door. */ export declare function judgeA2aEntryRegistration(copy: A2aServerSpec): { ok: true; } | { ok: false; error: Error & { code: string; }; }; /** * The `toolFaces` question for ONE snapshot entry of an MCP server — asked by the preparation door and by the materialization entrance exactly * as {@link judgeEntryToolAxes} asks its own, so the engine reads a face declaration one way (`readToolFaces`) and the mount consumes the copy * that way gave it, never the caller's object: a mistyped member, an axis word written as a face member, a member of the wrong kind or an empty * tool name is a refusal here, not a protection dropped in silence or a throw at the listing. `ok: true` carries the entry with the reader's * frozen copy in place of the declaration (an empty record declares nothing and leaves no key); `ok: false` carries the coded refusal * (`config.tool_face_invalid`) naming the server, the tool and the member. */ export declare function judgeEntryToolFaces(copy: McpServerSpec): McpEntryJudgment; /** * The `sessionMetaKey` question for ONE snapshot MCP entry — asked by the door and the materialization entrance like its siblings, through * the one judge ({@link judgeSessionMetaKey}); a key that cannot ride refuses under `config.invalid_argument`, naming the server and the key. * The entry is unchanged (a string is already the engine's own copy). */ export declare function judgeEntrySessionMetaKey(copy: McpServerSpec): McpEntryJudgment; /** * The `callerMeta` question for ONE snapshot MCP entry — asked by the door and the materialization entrance like its siblings, through the * one judge ({@link judgeCallerMeta}); a value other than `true` / `false` refuses under `config.invalid_argument`, naming the server and the * value's kind. The entry is unchanged. */ export declare function judgeEntryCallerMeta(copy: McpServerSpec): McpEntryJudgment; /** * The reserved-name question for ONE snapshot MCP entry, asked after its `toolAxes` and `toolFaces` were read: a declaration keyed by a * reserved face word ({@link MCP_FACE_WORDS}) names a face of the server, never a tool — no tool of the server is ever mounted under that * name, so the declaration could never be in force. Each face refuses through its own leg's one mint (`toolAxes` the generic * `config.invalid_argument`, `toolFaces` its `config.tool_face_invalid`), naming the server and the word. */ export declare function judgeEntryReservedKeys(copy: McpServerSpec): McpEntryJudgment; /** * The transport-kind question for ONE snapshot MCP entry: a transport that is a record names its `kind`, and the kind is a word of * {@link MCP_TRANSPORT_KINDS}, spelled exactly (`"Host"`, `""`, `"sse"` are no kind). The kind decides how the engine dials the server (a child * process, an HTTP endpoint, the host's own pipe), so a word outside the set is refused rather than dialed as one of them. Refuses under * `config.invalid_argument`, naming the server and the shape of the word (never its text) beside the closed words. An entry whose transport is * no record is not judged here: the dial refuses it for its own reason, that server alone. Any other entry is unchanged. */ export declare function judgeEntryTransportKind(copy: McpServerSpec): McpEntryJudgment; /** * The host-transport question for ONE snapshot MCP entry: a `{ kind: "host" }` transport carries no member beyond its kind (its host seat * carries its own pieces — a reference, a principal header, a command or a url would be declared and never in force), and its server * cannot opt in to `elicitation` (the server behind a host's pipe is the host's own code: a question it has for the user goes through the * host's own interface, and the engine advertises no elicitation for it). Either refuses under * `config.invalid_argument`, naming the server and the member. Any other entry is unchanged. */ export declare function judgeEntryHostTransport(copy: McpServerSpec): McpEntryJudgment; /** * Everything a snapshot MCP entry declares beyond its plain data, judged: its `toolAxes` ({@link judgeEntryToolAxes}), its `toolFaces` * ({@link judgeEntryToolFaces}), the keys of both against the reserved face words ({@link judgeEntryReservedKeys}), its `sessionMetaKey` * ({@link judgeEntrySessionMetaKey}), its `callerMeta` ({@link judgeEntryCallerMeta}), its transport kind ({@link judgeEntryTransportKind}), its host transport ({@link judgeEntryHostTransport}) — * in that order, the first refusal is the answer. * * The questions both entrances ask of a server's snapshot — the task's door (after its content class, {@link admitTaskMcpCopy}) and the library * entrance (`materializeMcpTools`, which refuses that server alone): a part of it (the host transport alone) would leave the others unasked. A * transport that is a record answers `ok: true` only when its kind is a word of {@link MCP_TRANSPORT_KINDS}; a `{ kind: "host" }` row also carries * its kind alone and the server does not opt in to `elicitation`; otherwise `ok: false` with the coded refusal (`config.invalid_argument`) naming * the server and the member. A row of another transport is judged on the other declarations only. A caller outside the engine asks * {@link judgeMcpEntryDeclarations}, which takes the entry as the door does before it asks these. */ export declare function judgeMcpEntryCopy(copy: McpServerSpec): McpEntryJudgment; /** * The name-bound question for ONE snapshot MCP entry (`config.tool_name_too_long`): a server's name rides every roster row of its tools * (`origin.peer`, `cardId`), so it is held to the roster's wire name bound ({@link TOOL_WIRE_NAME_MAX_CHARS}). Asked by the task's door where * it has always been asked — before any server connects, after the leg's session is acquired (`prepareProtocolTools`) — and by * {@link judgeMcpEntryDeclarations}, so the root judge answers it too. The entry is unchanged. */ export declare function judgeEntryNameBound(copy: McpServerSpec): McpEntryJudgment; /** * ONE MCP server declaration, judged as a task's door judges it — what a caller outside the engine asks before it merges declarations of its own * into a task's `TaskSpec.mcp` (a request door, a resume reader), so a server the task would be refused for is refused where it was declared: * the receipt the engine takes with the spec (plain data, a `name`, no retired value member, a credential reference that is one), the content * class, the declarations beyond plain data ({@link judgeMcpEntryCopy}) and the name bound ({@link judgeEntryNameBound}) — the first refusal is * the answer, the same code and sentence the task's terminal would carry. Not asked (the pairing with the deployment, or with the other * entries): whether the deployment's peer seat answers a declared credential reference, and whether two names collide. Never throws; the * entry handed in is not changed. `ok: true` carries the engine's frozen copy, as judged. */ export declare function judgeMcpEntryDeclarations(entry: McpServerSpec): McpEntryJudgment; /** What the one question about ONE snapshot A2A peer answers — {@link McpEntryJudgment}'s twin for the other surface. */ export type A2aEntryJudgment = { ok: true; entry: A2aServerSpec; } | { ok: false; error: Error & { code: string; }; }; /** * ONE A2A peer declaration, judged as a task's door judges it — the {@link judgeMcpEntryDeclarations} of the A2A surface, for the same callers: * the receipt the engine takes with the spec (plain data, a `name`, no retired value member such as a `headers` record, a credential * reference that is one), then its registration ({@link judgeA2aEntryRegistration}) and its `toolAxes` ({@link judgeEntryToolAxes}) — the * first refusal is the answer. Not asked: the deployment's * peer seat for a declared reference, and name collisions. Never throws; the entry handed in is not changed. */ export declare function judgeA2aEntryDeclarations(entry: A2aServerSpec): A2aEntryJudgment; /** * The door's A2A half over one declared list, in one call — the A2A sibling of {@link snapshotAndValidateMcpEntries}: the list read once * ({@link declaredEntriesOf}), each peer snapshotted to frozen plain data and its `toolAxes` judged — a peer whose declaration does not fit * refuses the whole list. For a list received outside a task's own spec (`where` names it in the list-level sentence). */ export declare function snapshotAndValidateA2aEntries(declared: unknown, where?: string): A2aServerSpec[]; /** One received thing: what the receipt read, or the refusal it raised — kept, raised by the door where it would have been raised. */ export type Received<T> = { readonly read: T; } | { readonly refused: unknown; }; /** * What the door receives of a task, read once: the deployment's lock set, then the declared MCP servers and A2A peers — each list read * once, each entry copied (frozen plain data) or refused on its own (the door raises the refusals in the order it judges entries). A list * is absent when the task declares none, when its key is locked (the door refuses a locked list without reading it), or when the lock * declaration was refused (nothing past it is read). Taken where the engine takes the spec ({@link receivePeerDeclarations}). */ export interface ReceivedPeerDeclarations { readonly locks: Received<ReadonlySet<LockedKey>>; readonly mcp?: Received<readonly Received<McpServerSpec>[]>; readonly a2a?: Received<readonly Received<A2aServerSpec>[]>; } /** One read taken now: its value, or what it threw — kept for the door that raises it. */ export declare const receiving: <T>(read: () => T) => Received<T>; /** What was received, or its refusal raised. */ export declare const received: <T>(r: Received<T>) => T; /** * The door's receipt — the lock set, `spec.mcp`, `spec.a2a` — taken once at the moment the engine takes the spec * (`Runner.runTaskStream`, as part of the leg's receipt, runner/leg-receipt.ts): the leg holds the references this copy names from then * on (peer-seat.ts) and its door judges this same copy ({@link preflightLockedConfig}), so what a leg holds and what it dials are one * read. Never throws. */ export declare function receivePeerDeclarations(spec: Pick<TaskSpec, "mcp" | "a2a">, deps: Pick<RunnerDeps, "lockedConfig">): ReceivedPeerDeclarations; /** The copies a receipt holds, as a keeper's declarations (a refused entry names nothing: the door refuses its leg before anything is dialled). */ export declare function receivedDeclarations(receipt: ReceivedPeerDeclarations): { readonly mcp?: readonly McpServerSpec[]; readonly a2a?: readonly A2aServerSpec[]; }; /** * The door's MCP half over one declared list, in one call: the list read once ({@link declaredEntriesOf}), each server snapshotted to frozen * plain data ({@link snapshotMcpEntries}), its content class and its per-tool declarations judged ({@link validatedMcpEntries}) — a server * whose declaration does not fit refuses the whole list. The same steps the task's own list takes (received when the engine takes the spec, * {@link receivePeerDeclarations}, judged at its prepare), for a list received elsewhere: an agent definition's `AgentDefinition.mcp` where * the definition is received (`where` names that field in the list-level sentence; every per-server sentence is the same). */ export declare function snapshotAndValidateMcpEntries(declared: unknown, where?: string): McpServerSpec[]; /** * The single preflight resolver: validate the lock declaration, refuse a spec that tries to occupy * a locked slot (`config.locked_key`, two-state — the whole prepare is rejected, nothing is * silently dropped or merged), and produce the resolved snapshot downstream assembly consumes. * Runs BEFORE any side effect of task preparation — and, on a resume, before the claim: the resume's * screen calls this same function (inside its refusal channel) and hands the leg its judged copies * of the lists THIS resume handed (the row records none), so the leg's prepare judges engine-owned plain data and dials what was judged. * Each door is entered with the word of the input it judges ({@link enterConfigDoor}). */ export declare function preflightLockedConfig(spec: Pick<TaskSpec, "mcp" | "a2a" | "toolPolicy" | "basePolicyForResumeEdit">, deps: Pick<RunnerDeps, "lockedConfig" | "toolPolicy" | "basePolicyForResumeEdit" | "peerSeat">, receipt?: ReceivedPeerDeclarations): LockedPreflight; /** * The two caller policies a prepare resolves to: the task's own seat over the deployment's, or the deployment's alone * under a `toolPolicy` lock — one resolution, read by the preflight above (which a resume enters before its claim). */ export declare function callerPolicySeats(spec: Pick<TaskSpec, "toolPolicy" | "basePolicyForResumeEdit">, deps: Pick<RunnerDeps, "toolPolicy" | "basePolicyForResumeEdit">, toolPolicyLocked: boolean): Pick<LockedPreflight, "toolPolicy" | "basePolicyForResumeEdit">;