UNPKG

@sema-agent/core

Version:

Stateless, task-oriented AI agent core

34 lines (33 loc) • 2.71 kB
export const CHILD_CLAMP_SEATS = Object.freeze(["handsReadOnly", "interactiveTools", "readFace", "writeFace", "readDenyPatterns"]); export const CHILD_CLAMP_SEATS_NOT_CARRIED = Object.freeze({ toolPolicy: "not a clamp a child spec copies: a parent's denies reach its children through the ancestor-constraint chain the child's own prepare folds, not by putting the parent's policy object on the child seat", shellGate: "travels on the inherited-gate lane (`InheritedGate.shellGate`, a trusted internals seat), not on the child spec — a spec-level copy would be a second source for the same clamp", permissionMode: "travels on the inherited-gate lane (`InheritedGate.permissionMode` / `permissionModeCeiling` — the parent's declared word and its LIVE seat): a child with no word of its own inherits that ceiling on every read, and a word it does declare is clamped under it; a spec-level copy would freeze the parent's word at spawn and be a second source for the same clamp", onAsk: "per-lane by construction: the delegation lane wraps the parent's approver with spawn provenance before it becomes the child's seat, and a lane with no approver must hand down none", hooks: "a deployment seat, not an inherited clamp — `tightenTaskSpec` refuses to merge two hook sets rather than composing them, so there is no tightening value to carry", excludeTools: "roster control rather than containment: the lanes that copy a parent's roster do so beside these seats, and the workflow lane authors its child roster from the governance baseline instead of the host's", deferTools: "roster control, same reading as `excludeTools` above", }); export const ENGINE_CHILD_SPEC_CONSTRUCTORS = Object.freeze([ "src/agents/subagent.ts#buildChildSpec", "src/agents/subagent.ts#observerSpec", "src/agents/subagent.ts#resumeSpec", "src/agents/teacher.ts#inheritedDeploymentConfig", "src/agents/verify.ts#verifierSpec", "src/agents/verify.ts#fixLegSpec", "src/orchestration/workflow-primitives.ts#workflowChildClamps", ]); export function childClampSeats(source) { return { ...(source.handsReadOnly === true ? { handsReadOnly: true } : {}), ...(source.interactiveTools === false ? { interactiveTools: false } : {}), ...(source.readFace === "roots" ? { readFace: "roots" } : {}), ...(source.writeFace === "roots" ? { writeFace: "roots" } : {}), ...(source.readDenyPatterns !== undefined && source.readDenyPatterns.length > 0 ? { readDenyPatterns: [...source.readDenyPatterns] } : {}), }; } export function engineHeadlessLegSeats() { return { interactiveTools: false, interactionPosture: "headless" }; }