import { expect, test } from 'bun:test'; import { formatWorkflowCommand, parseWorkflowArgs, } from '../src/commandArgs.js'; test('schedule form round-trips literal prompts and resource paths through the CLI codec', () => { const inputs = { topic: `调研 AI's "agent"\n比较 --input depth=deep,不要把这句当作参数。`, source: 'C:\\用户\\研究 资料\\input.png', depth: 'light', requestText: '保留 $变量 和 `符号`', }; expect(parseWorkflowArgs(formatWorkflowCommand('research', inputs))).toEqual({ name: 'research', inputs, positional: [], }); }); test('legacy workflow command parsing remains unchanged', () => { expect( parseWorkflowArgs('research 人工智能 新闻 --input depth=light'), ).toEqual({ name: 'research', inputs: { depth: 'light' }, positional: ['人工智能', '新闻'], }); });