import { type WorkflowSkipState } from './workflow-state-store.js'; import type { RequestType } from '../artifacts/artifact-prerequisites.js'; export declare const SKIPPABLE_TYPES: ReadonlyArray; export type SkipArgs = { /** Request id this skip applies to. */ rid: string; /** Comma-separated gate names from the CLI; parsed to string[]. */ gatesRaw: string; /** Required, free-text justification. */ reason: string; /** Optional. When set, the apply is previewed but no state is written. */ dryRun?: boolean; /** Required for script callers (see Rule 3). */ iHaveReviewed?: boolean; /** Caller kind, derived from $PEAKS_CALLER_ID by the CLI. When omitted, * defaults to 'human' (the CLI's normal terminal path). */ callerKind?: 'human' | 'llm' | 'script'; }; export type CanSkipVerdict = { allowed: true; reason: null; sliceType: RequestType; callerKind: 'human' | 'llm' | 'script'; } | { allowed: false; reason: string; sliceType?: RequestType; }; export type ApplySkipResult = { applied: true; idempotent: false; skippedGates: string[]; rid: string; persistedTo: string; sliceType: RequestType; } | { applied: false; idempotent: true; skippedGates: string[]; rid: string; persistedTo: string | null; sliceType: RequestType; } | { applied: false; idempotent: false; skippedGates: string[]; rid: string; persistedTo: string | null; sliceType?: RequestType; reason: string; }; /** Parse the `--gates` CLI arg (e.g. "QA,slice-check") into string[]. */ export declare function parseGatesList(raw: string): string[]; /** * Determine the caller kind for Rule 3. CLI passes * `args.callerKind` directly when the user invoked the command * interactively; for script callers (CI / postinstall) the CLI * inspects `$PEAKS_CALLER_ID` and passes 'script'. */ export declare function detectCallerKind(envCallerId: string | undefined): 'human' | 'llm' | 'script'; /** * Pure three-rule classifier. Does NOT touch the filesystem; the * `currentState` argument is the result of a prior `readSkipState` * call (or null if no state file exists). The slice type is * read from the RD request artifact via `showRequestArtifact`. * * Returns a verdict; the caller is expected to either apply or * surface the rejection reason. Reasons are user-readable English * suitable for the `nextActions` envelope. */ export declare function canSkipSlice(projectRoot: string, sessionId: string, args: SkipArgs, currentState: WorkflowSkipState | null): Promise; /** * Apply a skip. Caller is expected to have already called * `canSkipSlice` and received `allowed: true`. The function is * still defensive — if the verdict is `allowed: false`, it returns * the rejection as `applied: false` without writing. */ export declare function applySkip(projectRoot: string, sessionId: string, args: SkipArgs): Promise; declare function sameStringSet(a: readonly string[], b: readonly string[]): boolean; /** Exposed for tests. */ export declare const _internal: { SKIPPABLE_TYPES: readonly RequestType[]; SCRIPT_CALLER_IDS: readonly string[]; sameStringSet: typeof sameStringSet; }; export {};