/** * Plan/Result split). * * Compares the current project state (filesystem + package.json) to the * last-refresh fingerprint and returns whether a plan refresh is * warranted. Five trigger rules, locked decision 1 excludes * devDependencies. * * The slice's "diff" is supplied as a `SliceDiff` object; when not * supplied, the detector scans the project directly (the same scan the * refresh plan performs). */ import { type ResultEnvelope } from 'peaks-loop-shared/result'; export type TriggerReason = 'new-dependency' | 'auth-surface-added' | 'hot-path-added' | 'manual-override' | 'no-change' | 'no-triggering-change'; export declare const REQUEST_ID_PATTERN: RegExp; export interface DetectTriggerArgs { readonly project: string; readonly rid: string; readonly sessionId: string; /** Optional slice diff — when provided, takes precedence over a fresh * filesystem scan. Shape mirrors the `peaks request diff --json` * output's `packageJson` field. */ readonly diff?: SliceDiff | null; /** When true, the caller is the slice workflow with `--refresh` set. * Forces triggered=true. Per PRD trigger table. */ readonly manualOverride?: boolean; } export interface SliceDiff { readonly packageJson?: { readonly dependencies?: { readonly added?: readonly string[]; readonly removed?: readonly string[]; readonly changed?: readonly string[]; }; readonly optionalDependencies?: { readonly added?: readonly string[]; readonly removed?: readonly string[]; readonly changed?: readonly string[]; }; readonly devDependencies?: { readonly added?: readonly string[]; readonly removed?: readonly string[]; readonly changed?: readonly string[]; }; }; readonly newFiles?: readonly string[]; readonly changedFiles?: readonly string[]; } export interface DetectTriggerData { readonly triggered: boolean; readonly reason: TriggerReason; } export declare function detectTrigger(args: DetectTriggerArgs): ResultEnvelope;