/** * §9.9 — who an automation runs as, and whether it may still run at all: the ONE * sponsorship read, the run context built from it, and the fire-time gate every * firing passes before a single tool call. */ import type { AutomationRecord, RunContext } from "@vendoai/core"; import type { EngineBase } from "./engine-context.js"; import { type Sponsorship } from "./sponsorship.js"; import type { InternalRunRecord } from "./types.js"; export type SponsorshipGateDeps = { base: EngineBase; }; export interface SponsorshipGateAccess { /** The ONE sponsorship read every gate goes through. */ sponsorshipState(automationId: string): Promise<{ kind: "none"; } | { kind: "erased"; } | { kind: "row"; row: Sponsorship; }>; /** Every sponsorship row for these records, in ONE query. */ sponsorshipsFor(records: readonly AutomationRecord[]): Promise>; /** The run's context before any seam is consulted. */ baseRunContext(run: InternalRunRecord, subject: string): RunContext; /** §9.9 — the run's identity is its SPONSOR. */ runContext(run: InternalRunRecord, subject: string): Promise; /** §9.9's fire-time gate, in ONE place. */ sponsorshipRefusal(record: AutomationRecord): Promise<{ reason: NonNullable; summary: string; } | undefined>; } export declare const createSponsorshipGate: (deps: SponsorshipGateDeps) => SponsorshipGateAccess; //# sourceMappingURL=sponsorship-gate.d.ts.map