/** * Org sections spec 9.1 / 13.1 P3.2: the ONE reader of `run_config.completion`. * The field is either a legacy string ('boss' | 'dag', unchanged) or, for a * sections org, the object `{mode, protocol?}` (the protocol is optional and * ignored; older definitions carry 'sections-v1'). Every runtime reader goes * through here (a source-scan test enforces it), so no caller can flatten the * object into a string or read `.mode` off a string. */ export type CompletionMode = 'boss' | 'dag'; export interface CompletionPolicy { /** The completion mode; 'boss' when unset or not a recognised value. */ mode: CompletionMode; /** The discriminator an object carries; null for a legacy string or when unset. */ protocol: string | null; } type RunConfigLike = { completion?: unknown; } | null | undefined; /** Pure: reads `runConfig.completion` only. */ export declare function completionPolicy(runConfig: RunConfigLike): CompletionPolicy; export declare const completionMode: (runConfig: RunConfigLike) => CompletionMode; export declare const completionProtocol: (runConfig: RunConfigLike) => string | null; /** True when `completion` is the object form, whatever is inside it. */ export declare const completionIsObject: (runConfig: RunConfigLike) => boolean; /** What the dashboard shows: a legacy value is echoed verbatim (unset is * 'boss'), an object shows its `mode`, never the object itself. */ export declare function completionDisplay(runConfig: RunConfigLike): unknown; /** The dashboard Config tab sends `completion` as a string or null. Map it * onto the saved value: an object keeps its protocol and takes the new mode, * null is refused (it would delete the discriminator); a legacy value is * applied as before (`null` clears it). */ export declare function patchCompletion(runConfig: RunConfigLike, value: unknown): { ok: true; value: unknown; } | { ok: false; problem: string; }; export {}; //# sourceMappingURL=completion-accessor.d.ts.map