feat: 大规模清理 claude 的类型问题及依赖

This commit is contained in:
claude-code-best
2026-03-31 22:21:35 +08:00
parent 2c759fe6fa
commit 4c0a655a1c
38 changed files with 1154 additions and 718 deletions

View File

@@ -1,6 +1,6 @@
import { execFileSync } from 'child_process'
import { diffLines } from 'diff'
import { constants as fsConstants } from 'fs'
import { constants as fsConstants, type Dirent } from 'fs'
import {
copyFile,
mkdir,
@@ -120,7 +120,7 @@ const collectFromRemoteHost: (
}
const projectsDir = join(tempDir, 'projects')
let projectDirents: Awaited<ReturnType<typeof readdir>>
let projectDirents: Dirent<string>[]
try {
projectDirents = await readdir(projectsDir, { withFileTypes: true })
} catch {
@@ -146,7 +146,7 @@ const collectFromRemoteHost: (
}
// Copy session files (skip existing)
let files: Awaited<ReturnType<typeof readdir>>
let files: Dirent<string>[]
try {
files = await readdir(projectPath, { withFileTypes: true })
} catch {
@@ -895,7 +895,7 @@ async function summarizeTranscriptChunk(chunk: string): Promise<string> {
},
})
const text = extractTextContent(result.message.content)
const text = extractTextContent(result.message.content as readonly { readonly type: string }[])
return text || chunk.slice(0, 2000)
} catch {
// On error, just return truncated chunk
@@ -1038,7 +1038,7 @@ RESPOND WITH ONLY A VALID JSON OBJECT matching this schema:
},
})
const text = extractTextContent(result.message.content)
const text = extractTextContent(result.message.content as readonly { readonly type: string }[])
// Parse JSON from response
const jsonMatch = text.match(/\{[\s\S]*\}/)
@@ -1589,7 +1589,7 @@ async function generateSectionInsight(
},
})
const text = extractTextContent(result.message.content)
const text = extractTextContent(result.message.content as readonly { readonly type: string }[])
if (text) {
// Parse JSON from response
@@ -2755,7 +2755,7 @@ type LiteSessionInfo = {
async function scanAllSessions(): Promise<LiteSessionInfo[]> {
const projectsDir = getProjectsDir()
let dirents: Awaited<ReturnType<typeof readdir>>
let dirents: Dirent<string>[]
try {
dirents = await readdir(projectsDir, { withFileTypes: true })
} catch {