export interface KeywordSuggestion { /** Stable id derived from (keyword + target SKILL path). */ suggestion_id: string; /** The N-gram that should be added as a trigger.keyword. */ keyword: string; /** Absolute path to the SKILL.md whose frontmatter we'll patch. */ target_skill_path: string; /** Display name of the target SKILL — for the user confirmation prompt. */ target_skill_name: string; /** Number of route_miss observations of this keyword in window. */ miss_count: number; /** Number of overlapping tokens between keyword and the target SKILL's existing * triggers/description. ≥ OVERLAP_THRESHOLD by construction. */ overlap_score: number; /** First time the miss was seen (in window). */ first_seen: string; } export interface MineOpts { workspace: string; orgSlug: string; /** Override "now" for deterministic tests. */ now?: string; /** Override window — defaults to 30. */ windowDays?: number; /** Override min observation count — defaults to 3. */ minCount?: number; /** Directory roots to scan for existing SKILL.md candidates. Default = /.agents. */ skillRoots?: string[]; } export interface SuggestionRejection { suggestion_id: string; ts: string; reason?: string; } export interface ApplyKeywordSuggestionInput { workspace: string; orgSlug: string; suggestion: KeywordSuggestion; } export declare function mineFrequentKeywords(opts: MineOpts): Promise; /** * v1.3.3 §4.3 — a one-line, suggest-only summary of pending keyword-routing * suggestions, for inlining into the morning brief. Returns null when there's * nothing to suggest (or the miner can't run). NEVER auto-applies — the user * acts via `solosquad cron freq [--apply ]`. */ export declare function freqSuggestionLine(workspace: string, orgSlug: string): Promise; /** * Apply a confirmed keyword suggestion. Frontmatter-only patch (§3.4): * - read SKILL.md, parse frontmatter * - append keyword to triggers.keyword (dedup, sorted by insertion order) * - re-emit the file; body untouched at the byte level * - rebuildRoutes() so the new keyword is live */ export declare function applyKeywordSuggestion(input: ApplyKeywordSuggestionInput): Promise; /** Record a user rejection so the same (keyword, skill) pair stays out of the * proposal pipeline for the cooldown window. */ export declare function recordKeywordRejection(args: { workspace: string; orgSlug: string; suggestion_id: string; reason?: string; now?: string; }): void;