/** * ask — SpecCore 万能 AI 入口引擎 * 四种模式:命令解释(explain) / 任务指引(guide) / 意图匹配(match) / 复杂编排(pipeline) */ /** ask 模式 */ export type AskMode = 'explain' | 'guide' | 'match' | 'pipeline' | 'ambiguous'; /** 命令知识条目 */ export interface CommandKnowledge { name: string; aliases: string[]; description: string; usage: string; examples: string[]; related: string[]; triggers: string[]; } /** Pipeline 步骤 */ export interface PipelineStep { order: number; command: string; args: string; explanation: string; dependsOn?: number; } /** Pipeline 计划 */ export interface PipelinePlan { steps: PipelineStep[]; input: string; confirm: boolean; } /** Ask 结果 */ export interface AskResult { mode: AskMode; summary: string; detail: string; commands: string[]; pipeline?: PipelinePlan; /** AI 模式下可直接执行的命令(自动而非打印给人) */ autoExec?: { command: string; args: string; confirm?: boolean; }; } /** Ask 引擎选项 */ export interface AskEngineOptions { /** 显式 speccore 调用(来自 /spec-ask Skill),跳过意图域确认 */ explicit?: boolean; } declare const COMMAND_KB: CommandKnowledge[]; declare const WORKFLOWS: Record; /** 判断问句属于哪种模式 */ export declare function classifyMode(input: string): AskMode; /** * 理解用户意图并自我检查 * 返回结构化分析:AI理解了什么?命令匹配度?是否有遗漏? */ export interface IntentUnderstanding { /** AI 理解的用户意图摘要 */ what: string; /** 匹配到的命令列表 */ commands: string[]; /** 置信度 (0-100) */ confidence: number; /** 是否有分歧/不确定的地方 */ gaps: string[]; /** 是否应该进入确认流程 */ needsConfirm: boolean; /** 来源:llm/host/rules */ source: string; } export declare function understandIntent(input: string): Promise; /** * 🧠 SynthesizeIntent — 智能意图合成层 * * 理解 → 参数提取 → 上下文补全 → 命令匹配 → 自检纠错 → 仅模糊点时确认 * * 核心原则: * - AI 能自己推断的,不打扰用户 * - 缺了参数但能从上下文补的,自动补上并告诉用户 * - 只有真正歧义的才和用户确认 */ export interface SynthesizedIntent { /** AI 理解 */ what: string; /** 来源 */ source: string; /** 最终理解的结果(含理解说明) */ result: AskResult; /** AI 自动补充的内容 */ autoFilled: { field: string; value: string; reason: string; }[]; /** 无法确定、需要用户澄清的问题 */ questions: string[]; /** 是否需要用户确认 */ needsConfirm: boolean; /** 置信度 0-100 */ confidence: number; /** 最终将执行的完整命令列表 */ finalCommands: { command: string; args: string; explanation: string; }[]; } export declare function synthesizeIntent(input: string): Promise; export declare function askEngine(input: string, options?: AskEngineOptions): Promise; /** 从用户输入中提取时间 → YYYY-MM-DD HH:mm:ss */ export declare function extractTime(input: string): string; export { COMMAND_KB, WORKFLOWS }; //# sourceMappingURL=ask-engine.d.ts.map