/** * ask-host-ai — 宿主 AI 层(WorkBuddy / TRAE / Qoder) * 通过文件协议与用户当前使用的 AI 工具通信 * * 协议: * 1. CLI 写入 ~/.speccore/.ai-request.json * 2. 宿主 AI 检测文件变更,读取后处理 * 3. 宿主 AI 写入 ~/.speccore/.ai-response.json * 4. CLI 轮询读取响应(最多等待 15 秒) */ /** * 检测当前运行环境中的 AI 工具 */ export type HostAiTool = 'workbuddy' | 'trae' | 'qoder' | 'none'; /** 判断当前是否在 AI 工具上下文(WorkBuddy/TRAE/Qoder 调用,非纯终端) */ export declare function isAiContext(): boolean; export declare function detectHostAi(): HostAiTool; /** * 通过文件协议发送请求给宿主 AI * * 宿主 AI(WorkBuddy 等)需要设置文件监听: * 监控 ~/.speccore/.ai-request.json 的变更 * 读取 → 用 AI 处理 → 写入 ~/.speccore/.ai-response.json */ export declare function askHostAi(type: 'ask' | 'dev' | 'welcome', input: string, context?: Record): Promise; /** * WorkBuddy 环境下的特殊处理: * 通过 stdout 输出特殊标记,让 WorkBuddy agent 识别并响应 * * 标记格式: <>...<> * WorkBuddy agent 检测到后,用其 AI 能力处理并输出结果 */ export declare function emitWorkBuddySignal(type: string, input: string, context: Record): void; export declare function tryHostAi(type: 'ask' | 'dev' | 'welcome', input: string, context?: Record): Promise; //# sourceMappingURL=ask-host-ai.d.ts.map