详情面板「头脑风暴会话id」行的 ▶ 改为续聊:规划终端还开着就把续聊提示词 打进去;终端关了但有会话 id 就 `claude --resume <id>` 带提示词恢复;没会话 才新开。属性行右侧按钮改为数组,续聊与关闭 tab 可并存。 Claude-Session: https://claude.ai/code/session_01KDcq9HcrVLs2c9tkRxasub
24 lines
984 B
TypeScript
24 lines
984 B
TypeScript
import { describe, expect, it, vi } from 'vitest'
|
|
import { buildCcCommand } from '../../src/cc/ccCommand'
|
|
|
|
vi.mock('../../src/cc/claudeBin', () => ({
|
|
resolveClaudeBin: () => 'claude',
|
|
}))
|
|
|
|
describe('buildCcCommand', () => {
|
|
it('appends the prompt as a positional arg for a fresh session', () => {
|
|
expect(buildCcCommand({ profilePath: '/p.json', prompt: 'hello' }))
|
|
.toBe('claude --dangerously-skip-permissions --settings \'/p.json\' \'hello\'')
|
|
})
|
|
|
|
it('resumes without a prompt when only a session id is given', () => {
|
|
expect(buildCcCommand({ profilePath: '/p.json', resumeSessionId: 'abc' }))
|
|
.toBe('claude --dangerously-skip-permissions --settings \'/p.json\' --resume abc')
|
|
})
|
|
|
|
it('resumes and hands the prompt to the restored session', () => {
|
|
expect(buildCcCommand({ profilePath: '/p.json', resumeSessionId: 'abc', prompt: 'go on' }))
|
|
.toBe('claude --dangerously-skip-permissions --settings \'/p.json\' --resume abc \'go on\'')
|
|
})
|
|
})
|