/** * validation.ts, the door the declarative DSL is checked at. * * The rule this file exists to enforce: a trigger definition is DATA. There is * no probe kind that evaluates a JS expression, no extract kind that runs code, * and no fire action that composes a new command at fire time. The SDK has no * JS sandbox, and a config-driven unattended watcher is not the place to add * one, so anything that smells like code is rejected here rather than defended * against later. * * Probes are argv-form: a command probe takes `command` plus an `args` array * and is spawned without a shell, so no extracted value can ever become a shell * metacharacter. Nothing in a probe is interpolated at run time. */ import type { TriggerDefinition, TriggerExtract, TriggerFireAction, TriggerProbe, TriggerRule, TriggerSpec } from './types.js'; export declare class TriggerDefinitionError extends Error { readonly field: string; constructor(field: string, message: string); } /** * Rejects anything non-serialisable anywhere in a definition subtree. A * function on any field is the exact shape "arbitrary JS" would arrive in. */ export declare function assertPlainData(value: unknown, field: string, depth?: number): void; export declare function validateRegexSource(pattern: string, field: string, flags?: string | undefined): RegExp; export declare function validateProbe(input: unknown, field?: string): TriggerProbe; /** * argv validation shared by command probes, stream commands, on-exit commands * and action grants. No shell is ever involved, so the only thing that matters * is that the executable name is a real single token and every arg is a string. */ export declare function validateArgv(command: unknown, args: unknown, field: string): { command: string; args: string[]; }; export declare function validateExtract(input: unknown, field?: string): TriggerExtract; export declare function validateRule(input: unknown, field?: string, depth?: number): TriggerRule; export declare function validateAction(input: unknown, field?: string): TriggerFireAction; export declare function validateSpec(input: unknown, field?: string): TriggerSpec; export declare function validateDefinition(input: unknown): TriggerDefinition; //# sourceMappingURL=validation.d.ts.map