/** * The entry loader (DES-TRIGGER-REGISTRY-001 ยง4.2). * * One file per entry, `packages/crew/watch/entries/.json`, versioned with crew. A violating * entry is REFUSED with a reason (listed in `GET /watch/health`) and every other entry still loads: * one bad file cannot turn watching off. Refused when: * - the JSON does not parse, or its id is not `[a-z0-9-]{3,48}` or differs from the file name; * - it names a check the check map does not have, or its params / threshold fail the check's schema; * - `emit.as` is anything but finding | flag | proposal (no allow-like value exists in the schema); * - a bus source names a type that is not a 4-segment `wicked...`. * * The operator may change only `enabled` and `threshold` of a shipped entry (settings `watch.entries`), * applied by {@link applyOverrides}; an override whose threshold fails the check's schema is ignored * and reported, never half-applied. */ import type { WatchSettings } from 'wicked-crew-api-types'; import type { LoadedEntry, WatchCheck } from './types.js'; /** The shipped entries directory: `packages/crew/watch/entries` (same depth from `src/` and `dist/`). */ export declare const SHIPPED_ENTRIES_DIR: string; export interface Refusal { id: string; reason: string; } export interface LoadResult { entries: LoadedEntry[]; refused: Refusal[]; } /** Validate one parsed entry against the schema and the check map. */ export declare function validateEntry(raw: unknown, fileId: string, checks: ReadonlyMap): LoadedEntry | Refusal; /** Load every `.json` in `dir`. A missing directory loads nothing and says so. */ export declare function loadEntries(dir: string, checks: ReadonlyMap): LoadResult; /** Why a settings override was not applied (reported in health, never half-applied). */ export interface OverrideProblem { id: string; reason: string; } /** The effective entries: the operator's `enabled` / `threshold` overrides on the shipped ones. */ export declare function applyOverrides(entries: readonly LoadedEntry[], settings: WatchSettings | undefined, checks: ReadonlyMap): { entries: LoadedEntry[]; problems: OverrideProblem[]; }; /** * Validate a `PUT /settings` `watch` patch against the loaded entries. Returns the error text for a * 400, or `null`. Only `enabled` and `threshold` of a KNOWN entry, and the boolean `llm`. */ export declare function validateWatchPatch(patch: unknown, entries: readonly LoadedEntry[], checks: ReadonlyMap): string | null; //# sourceMappingURL=loader.d.ts.map