@sema-agent/core
Version:
Stateless, task-oriented AI agent core
30 lines (29 loc) • 5.68 kB
JavaScript
import { assertNoRetiredKeys, assertNoRetiredToolPolicyKeys, RETIRED_HOOKS_REPLACEMENT } from "../retired-keys.js";
const RETIRED_RUNNER_DEPS_KEYS = {
hooks: RETIRED_HOOKS_REPLACEMENT,
loadProjectMemory: "the engine reads the project's instruction files itself: declare `TaskSpec.instructionFamily` (each level's file names and rules directory — the task root's level rides every leg, an accessed directory's comes with the access) and they reach the model as attachment frames, read through the hands under the Read tool's own admission; `TaskSpec.projectMemory: \"disabled\"` silences them",
probeInstructionSources: "the engine reads the task-root level of the declared family (`TaskSpec.instructionFamily`) on every load: a file edited since is sent whole again and one removed or emptied is withdrawn once, so there is nothing to probe — drop the seat",
legacyRewindBoundaryProbe: "the rewind refusal always names both possibilities (never existed / retired whole-tree era); a deployment that holds that era's table answers the question on its own surface",
peerAdmission: "the peer lane's knob table is `RunnerDeps.peerLane` (the same fields: admission gate, delivery budgets, listing window)",
builtinWorkflows: "the engine ships no built-in named workflows — the Workflow tool's `{name}` resolves only `RunnerDeps.workflowCatalog`; save any named workflow there (an official layer is one more `createDirectoryWorkflowLayer` of source `builtin`)",
"workflowScriptStore.resolveName": "saved workflows are `RunnerDeps.workflowCatalog` (`createWorkflowCatalog` over directory layers: the saved `<name>.js` files kept at the script store's root are its deployment layer, named by `meta.name`; a `.args.json` sidecar is not read — its arguments become a preset under a name of its own, as the catalog's `args_sidecar_retired` notice spells for each file); `workflowScriptStore` keeps per-run scripts only",
"workflowScriptStore.list": "the saved-workflow listing is `RunnerDeps.workflowCatalog`'s `list()`; `workflowScriptStore` keeps per-run scripts only",
graderEnvFactory: "the grader env reaches the repair loop as `RepairLoopConfig.graderEnv`, minted by the trusted control plane (`assertOracleIsolation` / `GraderEnv` unchanged)",
mcpImageResizer: "one image processor seat serves every image of a run: `RunnerDeps.imageProcessor` (an `ImageDownsampler`, or `false` for none; absent detects sharp once per process) — the MCP result, the Read tool, PDF pages, Bash data URIs, any tool's result, task images and attachments all pass the one admission with it",
mediaByteCapBytes: "the request's media budget is `RunnerDeps.mediaBudgetBase64Chars`, in base64 characters (the unit a provider counts; 0 or Infinity: none, else a whole number of at least twice `IMAGE_ADMISSION.request.hysteresisBase64Chars`)",
onMediaStripped: "the media a request leaves out is told to the person as the `context.media_removed` notice (reason `media_budget`, once per block per session) and to the operator as the `context.media_removed` trace frame (one per request)",
"hands.readImageDownsampler": "one image processor seat serves every image of a run: `RunnerDeps.imageProcessor` (an `ImageDownsampler`, or `false` for none; absent detects sharp once per process) — the Read tool's images ride it with every other carrier's",
"hands.readCyberReminder": "a Read result carries only the reminders about that read (an empty file, an offset past the end, a file already in context) — no standing content-safety tail, so there is nothing to switch; a deployment that wants that sentence states it in its own `appendSystemPrompt`",
promptProvider: "a deployment changes prompt text through overlays: register a `prompt.compose` handler on `RunnerDeps.mods` answering `{ overlays }` (role base `replace`, a brand line `add` to the role band, a behavior or scenario `add`, a core-behavior `replace` / `append` / `drop`), choose the role base per task with `TaskSpec.promptRole`, and dispose of an MCP server's instructions with a `prompt.section` registration answering `{ text }` / `{ text: null }`",
allowImageUrl: "a remote image URL is judged by the one egress guard (https, the private-network floor) and the deployment's host floor — declare a CDN list as `RunnerDeps.hostFloor.only` (it bounds every structured egress: the fetch tool, task images, MCP http, A2A, WebSearch's SearXNG backend), or send the image inline",
mcpRevocations: "one revocation seat serves every protocol: `RunnerDeps.protocolRevocations`, `revoked({ protocol, server | peer, fingerprint? })` — `protocol` is `\"mcp\"` (with `server`, and `fingerprint` when the spec declares one) or `\"a2a\"` (with `peer`); it is asked as each request leaves the engine, every hop of a redirect included",
memorySessionIncarnation: "the occupant behind a session id is a cell of the session row now — `SessionMetadata.incarnation` on the metadata `Session.getMetadata()` returns (forks also `forkedFromIncarnation`), with `SessionStore.headOf` (its `incarnation`) for by-id readers; put the token the old seat answered on your sessions instead. A deployment that drops the seat without surfacing the cell loses the axis: records bind by session id alone",
};
export function assertNoRetiredRunnerDeps(deps) {
assertNoRetiredKeys(deps, RETIRED_RUNNER_DEPS_KEYS, "RunnerDeps");
}
export function assertNoRetiredInheritedConstraints(internals) {
for (const constraint of internals?.inheritedGate?.parentConstraints ?? [])
if (constraint.policy !== undefined)
assertNoRetiredToolPolicyKeys(constraint.policy);
}