/** * Trigger-based skill auto-invoke. * * A skill may declare a list of trigger phrases in its frontmatter. When the * user message contains one of those phrases, the agent can: * - inject the skill body as additional context for this turn (`mode: hint`) * - rewrite the user message through the skill's prompt (`mode: replace`) * * We default to `hint` because it is non-destructive: the user's literal * intent is preserved and the skill body becomes a guidance block the model * can choose to follow. `replace` is reserved for skills that explicitly * opt-in via a frontmatter flag (not yet wired — future extension). * * Anti-spam guard: * - skills with `disableModelInvocation: true` never auto-invoke * - scoring must clear a non-trivial threshold (≥4) to avoid one-word * coincidences ("buy" / "long") firing trade-signal in random chatter * - longer trigger phrases score higher; multi-token matches score more * than single-word matches */ import type { LoadedSkill } from './types.js'; export interface SkillMatch { skill: LoadedSkill; score: number; triggers: string[]; } export declare function matchSkillTriggers(input: string, skills: LoadedSkill[]): SkillMatch[]; /** * Format a matched-skills hint block to append to the system prompt for a * single turn. Reads as a soft suggestion to the model — not a rewrite. * * Provenance matters here: human-authored skills (bundled/user/project) are * trusted procedure, but `learned`/auto-generated skills are distilled from * prior session content — which can include tool, MCP, or web output an * attacker influenced. Their bodies are therefore framed as untrusted data so * an embedded instruction can't hijack the turn via the system prompt. */ export declare function formatSkillHints(matches: SkillMatch[]): string;