UNPKG

@code-yeongyu/senpi

Version:

Coding agent CLI with read, bash, edit, write tools and session management

22 lines • 1.05 kB
import { randomUUID } from "node:crypto"; import { resolveExecutionPipeline } from "./pipeline-config.js"; /** * Bind the execution scope. The loop has one pipeline, the prepared one, so nothing is installed for it; naming * `prepared` still refuses to replace a ToolHost the session was built with. Receipts are written only through an * explicitly configured `Agent.onExecutionPipeline` sink: this binding installs no default writer. */ export function bindPipelineWitness(agent, manager, root, config = resolveExecutionPipeline()) { let owner; let scope; agent.getExecutionScope = () => { const current = manager.getSessionId(); if (owner !== current || scope === undefined) { owner = current; scope = { id: randomUUID(), root: root() }; } return scope; }; if (config.named && agent.toolHost !== undefined) throw new Error("SENPI_EXECUTION_PIPELINE=prepared cannot replace the ToolHost this session was built with"); } //# sourceMappingURL=pipeline-witness.js.map