feat: 完成第二版类型清理

This commit is contained in:
claude-code-best
2026-03-31 23:03:47 +08:00
parent 4c0a655a1c
commit d7a729ca68
604 changed files with 595 additions and 953 deletions

View File

@@ -253,7 +253,7 @@ function getNextImagePasteId(messages: Message[]): number {
let maxId = 0
for (const message of messages) {
if (message.type === 'user' && message.imagePasteIds) {
for (const id of message.imagePasteIds) {
for (const id of message.imagePasteIds as number[]) {
if (id > maxId) maxId = id
}
}
@@ -354,8 +354,8 @@ export async function* runToolUse(
tool = fallbackTool
}
}
const messageId = assistantMessage.message.id
const requestId = assistantMessage.requestId
const messageId = assistantMessage.message.id as string
const requestId = assistantMessage.requestId as string | undefined
const mcpServerType = getMcpServerType(
toolName,
toolUseContext.options.mcpClients,
@@ -548,7 +548,7 @@ function streamedCheckPermissionsAndCallTool(
})
stream.enqueue({
message: createProgressMessage({
toolUseID: progress.toolUseID,
toolUseID: progress.toolUseID as string,
parentToolUseID: toolUseID,
data: progress.data,
}),
@@ -822,8 +822,8 @@ async function checkPermissionsAndCallTool(
att.durationMs !== undefined
) {
preToolHookInfos.push({
command: att.command,
durationMs: att.durationMs,
command: att.command as string,
durationMs: att.durationMs as number,
})
}
}
@@ -1506,8 +1506,8 @@ async function checkPermissionsAndCallTool(
att.durationMs !== undefined
) {
postToolHookInfos.push({
command: att.command,
durationMs: att.durationMs,
command: att.command as string,
durationMs: att.durationMs as number,
})
}
}
@@ -1522,8 +1522,8 @@ async function checkPermissionsAndCallTool(
att.durationMs !== undefined
) {
postToolHookInfos.push({
command: att.command,
durationMs: att.durationMs,
command: att.command as string,
durationMs: att.durationMs as number,
})
}
}

View File

@@ -130,7 +130,7 @@ async function* runToolsSerially(
for await (const update of runToolUse(
toolUse,
assistantMessages.find(_ =>
_.message.content.some(
Array.isArray(_.message.content) && _.message.content.some(
_ => _.type === 'tool_use' && _.id === toolUse.id,
),
)!,
@@ -163,7 +163,7 @@ async function* runToolsConcurrently(
yield* runToolUse(
toolUse,
assistantMessages.find(_ =>
_.message.content.some(
Array.isArray(_.message.content) && _.message.content.some(
_ => _.type === 'tool_use' && _.id === toolUse.id,
),
)!,