mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-18 14:25:51 +00:00
feat: 完成第二版类型清理
This commit is contained in:
@@ -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,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
)!,
|
||||
|
||||
Reference in New Issue
Block a user