mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-14 02:42:04 +08:00
fix: 修复 Codex AGENTS.md 标题匹配模式
- 支持 "Codex Code Guidelines" 和 "Codex Instructions" 两种标题 - 使用不区分大小写的正则匹配
This commit is contained in:
@@ -918,8 +918,11 @@ export async function handleClaudeRoutes(ctx: RouteContext): Promise<boolean> {
|
|||||||
const isCodex = target === 'codex';
|
const isCodex = target === 'codex';
|
||||||
const targetDir = isCodex ? join(homedir(), '.codex') : join(homedir(), '.claude');
|
const targetDir = isCodex ? join(homedir(), '.codex') : join(homedir(), '.claude');
|
||||||
const targetFile = isCodex ? join(targetDir, 'AGENTS.md') : join(targetDir, 'CLAUDE.md');
|
const targetFile = isCodex ? join(targetDir, 'AGENTS.md') : join(targetDir, 'CLAUDE.md');
|
||||||
const headerText = isCodex ? '# Codex Instructions\n\n' : '# Claude Instructions\n\n';
|
const headerText = isCodex ? '# Codex Code Guidelines\n\n' : '# Claude Instructions\n\n';
|
||||||
const headerPattern = isCodex ? /^# Codex Instructions\n\n?/ : /^# Claude Instructions\n\n?/;
|
// Match common header patterns for both tools
|
||||||
|
const headerPattern = isCodex
|
||||||
|
? /^#\s*(Codex\s*(Code\s*)?(Guidelines|Instructions))\n\n?/i
|
||||||
|
: /^#\s*Claude\s*Instructions\n\n?/i;
|
||||||
|
|
||||||
const chineseRefLine = `- **中文回复准则**: @${guidelinesRef}`;
|
const chineseRefLine = `- **中文回复准则**: @${guidelinesRef}`;
|
||||||
const chineseRefPattern = /^- \*\*中文回复准则\*\*:.*chinese-response\.md.*$/gm;
|
const chineseRefPattern = /^- \*\*中文回复准则\*\*:.*chinese-response\.md.*$/gm;
|
||||||
|
|||||||
Reference in New Issue
Block a user