✨ feat(vscode): 「改动」面板加审查勾 + deepseek 增量生成文件改动说明
右栏 diff 头部加一组按钮:
- 审查对勾:与左树同一状态源,勾上则文件路径标题置灰
- ✨ 一键调 deepseek 生成该文件「一句话改动目的」
增量复用会话:首个文件开新 cc 会话并把 sessionId 记到
.spx/pr-file-summaries.json,后续文件 --resume 接上去,省去每次重新
理解 PR 的开销;resume 失败则丢弃旧 id 重开一次。说明也落盘(跨 push
保留),重载后仍显示。
- spawnClaude 增 resumeSessionId(--resume)
- 新增 prFileSummaryStore;handler handleGeneratePrFileSummary
用 jsdiff 拼 unified diff 喂模型
- 依赖 diff(jsdiff)
This commit is contained in:
@@ -234,14 +234,16 @@ export async function spawnClaude(opts: {
|
||||
images?: ClaudeImage[]
|
||||
profilePath?: string
|
||||
bare?: boolean
|
||||
/** 续会话:传入则 `--resume <id>`,让本次 `-p` 接在该会话之后(复用上下文,省 token)。 */
|
||||
resumeSessionId?: string
|
||||
}): Promise<ClaudeResult> {
|
||||
const timeoutMs = opts.timeoutMs ?? DEFAULT_TIMEOUT_MS
|
||||
const hasImages = !!opts.images && opts.images.length > 0
|
||||
|
||||
if (!hasImages) {
|
||||
return spawnClaudeText(opts.prompt, opts.cwd, timeoutMs, opts.profilePath, opts.bare)
|
||||
return spawnClaudeText(opts.prompt, opts.cwd, timeoutMs, opts.profilePath, opts.bare, opts.resumeSessionId)
|
||||
}
|
||||
return spawnClaudeStreamed(opts.prompt, opts.cwd, timeoutMs, opts.images!, opts.profilePath, opts.bare)
|
||||
return spawnClaudeStreamed(opts.prompt, opts.cwd, timeoutMs, opts.images!, opts.profilePath, opts.bare, opts.resumeSessionId)
|
||||
}
|
||||
|
||||
function spawnClaudeText(
|
||||
@@ -250,11 +252,13 @@ function spawnClaudeText(
|
||||
timeoutMs: number,
|
||||
profilePath?: string,
|
||||
bare?: boolean,
|
||||
resumeSessionId?: string,
|
||||
): Promise<ClaudeResult> {
|
||||
const args = [
|
||||
...(bare ? ['--bare'] : []),
|
||||
'--dangerously-skip-permissions',
|
||||
...(profilePath ? ['--settings', profilePath] : []),
|
||||
...(resumeSessionId ? ['--resume', resumeSessionId] : []),
|
||||
'-p',
|
||||
prompt,
|
||||
'--output-format',
|
||||
@@ -361,6 +365,7 @@ function spawnClaudeStreamed(
|
||||
images: ClaudeImage[],
|
||||
profilePath?: string,
|
||||
bare?: boolean,
|
||||
resumeSessionId?: string,
|
||||
): Promise<ClaudeResult> {
|
||||
// Local Claude Code v2.1.143 enforces that --input-format=stream-json must
|
||||
// be paired with --output-format=stream-json (the friendlier `--output-format
|
||||
@@ -370,6 +375,7 @@ function spawnClaudeStreamed(
|
||||
...(bare ? ['--bare'] : []),
|
||||
'--dangerously-skip-permissions',
|
||||
...(profilePath ? ['--settings', profilePath] : []),
|
||||
...(resumeSessionId ? ['--resume', resumeSessionId] : []),
|
||||
'-p',
|
||||
'--input-format',
|
||||
'stream-json',
|
||||
|
||||
Reference in New Issue
Block a user