/** * grants.ts, pre-registered, digest-pinned action grants. * * A firing trigger runs an agent turn or a grant registered here. It never * composes a new command at fire time: arbitrary shell on an unattended event * is the one path with no person in the loop. A grant closes that gap by moving * the human moment forward, the exact argv is written down and confirmed while * a person is present, hashed, and the hash is what the trigger carries. * * At fire time the digest is recomputed from the stored grant and must match * the digest recorded on the trigger byte for byte. Editing the grant after the * fact therefore breaks every trigger pinned to it, which is the intended * behaviour: the operator re-confirms rather than silently inheriting a * different command than the one they approved. */ import type { TriggerActionGrant } from './types.js'; export declare function computeGrantDigest(grant: Pick): string; export interface RegisterGrantInput { readonly id: string; readonly description: string; readonly command: string; readonly args?: readonly string[] | undefined; readonly cwd?: string | undefined; /** Who confirmed it. Recorded so the approval has a name attached. */ readonly confirmedBy: string; readonly now?: number | undefined; } export declare function createActionGrant(input: RegisterGrantInput): TriggerActionGrant; export type GrantVerification = { readonly ok: true; readonly grant: TriggerActionGrant; } | { readonly ok: false; readonly reason: string; }; /** * Verifies a pinned grant at fire time. Three ways to fail, all refusals: * the grant is gone, its stored digest no longer matches its own contents * (edited on disk), or the trigger's pin does not match the grant. */ export declare function verifyGrant(grants: readonly TriggerActionGrant[], grantId: string, pinnedDigest: string): GrantVerification; //# sourceMappingURL=grants.d.ts.map