/** * Feature gates and shared helpers for the S2 event kernel. * Keeps the kernel from silently accepting DSL it cannot implement safely. */ import type { Budget, Phase, Taskflow } from "../schema.ts"; import { type UsageStats } from "../usage.ts"; import type { RunState } from "../store.ts"; /** Linear-time placeholder detection for untrusted DSL strings. * * A placeholder body is a non-empty Taskflow-style path made only of the * identifier/path characters accepted by interpolation. Resetting on a nested * opening brace keeps the scan O(n), even for adversarial strings containing * thousands of `{` characters. JSON object braces are ignored because their * bodies contain quotes, colons, commas, or whitespace. */ export declare function containsInterpolationPlaceholder(value: string): boolean; /** * If the definition needs imperative-only features, return a short reason. * When set, executeTaskflow must NOT enter the event kernel (even if enabled). */ export declare function kernelUnsupportedReason(def: Taskflow): string | undefined; /** Dependency satisfaction matching imperative runtime (join + optional). */ export declare function depsSatisfied(phase: Phase, phases: Record, byId: Map): { ok: boolean; skipReason?: string; }; /** Clamp child budget to the parent's remaining run-wide allowance. */ export declare function clampSubFlowBudget(sub: Taskflow, parentBudget: Budget | undefined, spent?: UsageStats): Taskflow; /** Check a kernel phase's in-flight retry attempts against the run-wide cap. * The driver has not folded the current phase into state yet, so callers must * supply the cumulative usage of attempts made so far. Prior completed phase * usage comes from state; the current running placeholder is excluded. */ export declare function kernelAttemptsOverBudget(state: RunState, phaseId: string, attemptUsage: readonly UsageStats[]): boolean; //# sourceMappingURL=kernel-policy.d.ts.map