/** * design/98 §E.1 (S8b) — the MEMBRANE adapter: extract the bound primitive functions FROM a trusted * {@link WorkflowRunContext} and assemble a flat, sterile {@link WorkflowPrimitives} record. A * {@link WorkflowScriptRunner} receives ONLY this record — the host `ctx` object (with its prototype chain * into the host realm) structurally never enters the runner, so a script cannot walk * `ctx.constructor.constructor(...)` to escape (the chain is unreachable: there is no `ctx`). * * Two modes: * - **governed** (`governance` set) — for an LLM-AUTHORED script: the `agent` primitive runs the untrusted * spec through {@link buildGovernedChildSpec} (default-deny whitelist + baseline + model allowlist + clamp) * BEFORE `ctx.agent`. The script can ONLY tighten the deployment governance, never escape it. * - **trusted-dev** (no `governance`) — for a developer-authored script: the `agent` primitive passes the * full `TaskSpec` straight through (the author IS the deployment). */ import type { Model } from "../internal/llm.js"; import type { TaskSpec, WorkflowGovernanceBaseline } from "../core/types.js"; import type { WorkflowAgentHandle, WorkflowRunContext } from "./workflow.js"; import type { WorkflowPrimitives } from "./workflow-script-runner.js"; import { type WorkflowChildCaps } from "./workflow-governance.js"; /** What an LLM-authored workflow needs to GOVERN each spawned sub-agent (design/98 §2.5). */ export interface WorkflowGovernance { baseline: WorkflowGovernanceBaseline; models?: Record; caps?: WorkflowChildCaps; } /** * Build the flat {@link WorkflowPrimitives} a {@link WorkflowScriptRunner} runs the script against. The * `agent` primitive is GOVERNED when `governance` is set (LLM-authored), else a trusted pass-through. */ export declare function buildWorkflowPrimitives(ctx: WorkflowRunContext, governance?: WorkflowGovernance, onAgentSpawn?: (handle: WorkflowAgentHandle) => void, parentThinking?: () => TaskSpec["thinking"], parentPrincipal?: string): WorkflowPrimitives; //# sourceMappingURL=workflow-primitives.d.ts.map