/** * Codex hook adapter。 * * Codex 通过 PermissionRequest hook 发起权限请求,payload 形状: * { * hook_event_name: 'PermissionRequest', * tool_name: '<工具名>', * tool_input: { description?: string, command?: string, ... }, * session_id: '', * ... * } * * 与 Claude Code 不同,Codex **没有**结构化的 AskUserQuestion hook 事件—— * Codex 把问题藏在 Stop 事件的 last_assistant_message 文本里, * 而非通过 PermissionRequest 以结构化方式发起。 * 因此 parseQuestions 对任意 Codex hook payload 均返回 null。 * * Codex 期望的 permission directive(hookSpecificOutput)形状: * { * hookSpecificOutput: { * hookEventName: 'PermissionRequest', * decision: { behavior: 'allow' | 'deny', message?: string } * } * } * * passthrough(放行)directive 形状(behavior='allow'): * { * hookSpecificOutput: { * hookEventName: 'PermissionRequest', * decision: { behavior: 'allow' } * } * } * * // TODO(dogfood): 验证 codex directive 形状(parseQuestions 总返回 null, * // formatAnswer 在当前版本不会被调用,但 passthrough 在 PermissionRequest 场景会被用到) * * 参考来源:x-desktop-app/src/island/main/bridge/adapters/CodexAdapter.ts * x-desktop-app/src/island/main/bridge/BridgeServer.ts codex 分支 */ import type { HookAskAdapter } from './types.js'; declare const codexAdapter: HookAskAdapter; export default codexAdapter; //# sourceMappingURL=codex.d.ts.map