/** * sdk/skillfm-local/src/guard/prompt-context.ts * * V2 SAFE — UserPromptSubmit hint emitter (PRD §2.4). * * Called via `skillfm-guard prompt-context` from Claude Code's * UserPromptSubmit hook. Reads stdin JSON, scans the user prompt for * SkillFM trigger keywords, and emits an L4 Agent Voice hint to stdout. * Claude Code prepends stdout as additional system context before the * LLM sees the user message. * * Failure model: completely silent if anything goes wrong (fail-open). * stdout is consumed by Claude Code, so any noise becomes injected text — * we'd rather emit nothing than emit a stack trace into the agent context. */ export interface MatchedIntent { /** Which SkillFM tool the agent should reach for first. */ primary_tool: 'skillfm_checkup' | 'skillfm_show_my_usage'; /** The keyword phrase that matched (for explanation in the hint). */ matched_phrase: string; /** Rough categorization for analytics; not surfaced in hint. */ category: 'health' | 'usage' | 'savings' | 'performance'; } /** * Scan a user prompt for the highest-priority SkillFM trigger. * Rules are evaluated in order; first match wins. Returns null if none match. */ export declare function detectIntent(prompt: string): MatchedIntent | null; /** * Render the system-context hint that Claude Code will prepend to the user * message. Format intentionally compact (≤ 400 chars) — UserPromptSubmit * fires on every prompt and bloated hints inflate context cost. */ export declare function renderHint(intent: MatchedIntent): string; export interface PromptContextInput { prompt?: unknown; user_prompt?: unknown; session_id?: unknown; } /** * Pure function (testable): given the parsed UserPromptSubmit payload, * return the hint string to emit to stdout, or null to stay silent. * Claude Code accepts: * - any non-empty stdout → prepended as additional context * - empty stdout → no-op */ export declare function buildHookOutput(payload: PromptContextInput): string | null; //# sourceMappingURL=prompt-context.d.ts.map