UNPKG

@sema-agent/core

Version:

Stateless, task-oriented AI agent core

16 lines (15 loc) • 1.53 kB
import { type RetiredNameView } from "../tool-name-aliases.js"; import { type ToolPolicy } from "../tool-policy.js"; import { type PolicyNameLayer } from "../retired-tool-name-account.js"; import type { PolicyNameFinding } from "./sub-agent-deny-lists.js"; import type { RunnerDeps } from "../runner-deps.js"; /** `p` matched under `view`: its `check` and `wholeToolRefusals` are handed the call of a successor under the old names too — nothing * else of the call (its face, its binding) and nothing else of the policy changes. The same instance when the view reads nothing. */ export declare function policyUnderRetiredView(p: ToolPolicy, view: RetiredNameView): ToolPolicy; /** A rule CONTENT on a retired name the leg reads as `successor` was read in the written name's grammar when the policy was built * (`bash(git:*)` is a parameter rule, `Bash(git:*)` a command rule): read as the successor it would guard nothing, so it is refused as * the retired name it is, as before #1781. */ export declare function retiredContentRefusal(field: "deny" | "ask" | "allow", entry: string, successor: string, layer: PolicyNameLayer): PolicyNameFinding; /** The operator's advisory, once per leg, on the name audit's seat and code (`onError`, phase `"config"`): each old name this leg's rules * write and read as its successor. Nothing when there is none; a throwing sink never faults prepare. */ export declare function tellReadAsSuccessor(onError: RunnerDeps["onError"], readings: readonly string[], sessionId: string): void;