/** * Prompt-reactive reuse policy — the single source of truth for the runtime * "plugin reuse nudge". * * The plugin-productivity guidance in `core/tools/plugins.ts` and * `core/tools/propose-plugin.ts` ships as static `promptGuidelines` folded into * the system prompt once at session build. That text is never re-surfaced when * the work actually shows an actionable cue, so the model tends to repeat the * same advice by hand instead of reaching for the plugin layer. * * This module holds the reactive policy that fixes that: * - {@link REUSE_NUDGES} the curated cue → nudge table * - {@link matchReuseNudges} scan runtime text (tool output, turn text) for cues * - the armed registry nudges that fired this process, so the plugin * layer can surface them even when no tool asked * - {@link isAutonomousPluginSystemEnabled} * the one enablement gate shared with the * tool-attach path in main.ts (settings.json * `enablePluginTools`) * * The extension in `./nudges.ts` wires this policy to tool/turn events; the * policy itself stays pure and independently testable. * * Conservative by construction: the patterns are specific (a false positive * becoming a nag is the real risk), each nudge fires at most once per category * per session, and every nudge points back at the plugin layer rather than * re-stating advice. */ /** A single reactive reuse cue and the plugin-facing nudge it arms. */ export interface ReuseNudge { /** Stable id, also used as the de-dupe key so a nudge fires once per session. */ id: string; /** Human-facing category label (grouping for the one-per-category cap). */ category: string; /** Specific cue matched against runtime text. Kept tight to avoid false positives. */ pattern: RegExp; /** The reusable-facing note injected into the turn; always points at the plugin layer. */ snippet: string; } /** Record that a nudge fired this session so the plugin layer can surface it. */ export declare function armReuseNudge(nudge: ReuseNudge): void; /** Reuse nudges that have fired this session, in insertion order. */ export declare function getArmedReuseNudges(): ReuseNudge[]; /** Reset the armed registry (called on session start). */ export declare function clearArmedReuseNudges(): void; /** * Scan a blob of runtime text (tool output, turn text, user prompt) and return * every reuse nudge whose cue matches. Pure — arming/de-duping is the caller's * job. */ export declare function matchReuseNudges(text: string | undefined | null): ReuseNudge[]; /** * The one enablement gate for the whole autonomous plugin system. * * Reads settings.json `enablePluginTools` (default false) — the same setting * that gates whether the plugin lifecycle tools are attached to the top-level * agent in main.ts. Keeping both the tool surface and the reactive nudge behind * a single flag is the "whole autonomous plugin system, off by default" switch. */ export declare function isAutonomousPluginSystemEnabled(cwd: string): boolean; //# sourceMappingURL=policy.d.ts.map