mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-21 15:55:50 +00:00
feat: 全部类型问题解决
This commit is contained in:
@@ -346,8 +346,8 @@ export class StreamingToolExecutor {
|
||||
|
||||
const isErrorResult =
|
||||
update.message.type === 'user' &&
|
||||
Array.isArray(update.message.message.content) &&
|
||||
update.message.message.content.some(
|
||||
Array.isArray(update.message.message!.content) &&
|
||||
update.message.message!.content.some(
|
||||
_ => _.type === 'tool_result' && _.is_error === true,
|
||||
)
|
||||
|
||||
|
||||
@@ -815,7 +815,7 @@ async function checkPermissionsAndCallTool(
|
||||
tool,
|
||||
processedInput,
|
||||
toolUseID,
|
||||
assistantMessage.message.id,
|
||||
assistantMessage.message.id!,
|
||||
requestId,
|
||||
mcpServerType,
|
||||
mcpServerBaseUrl,
|
||||
@@ -1497,7 +1497,7 @@ async function checkPermissionsAndCallTool(
|
||||
toolUseContext,
|
||||
tool,
|
||||
toolUseID,
|
||||
assistantMessage.message.id,
|
||||
assistantMessage.message.id!,
|
||||
processedInput,
|
||||
toolOutput,
|
||||
requestId,
|
||||
|
||||
@@ -67,7 +67,7 @@ export async function* runPostToolUseHooks<Input extends AnyObject, Output>(
|
||||
// IMPORTANT: We emit a cancelled event per hook
|
||||
if (
|
||||
result.message?.type === 'attachment' &&
|
||||
result.message.attachment.type === 'hook_cancelled'
|
||||
result.message.attachment!.type === 'hook_cancelled'
|
||||
) {
|
||||
logEvent('tengu_post_tool_hooks_cancelled', {
|
||||
toolName: sanitizeToolNameForAnalytics(tool.name),
|
||||
@@ -96,7 +96,7 @@ export async function* runPostToolUseHooks<Input extends AnyObject, Output>(
|
||||
result.message &&
|
||||
!(
|
||||
result.message.type === 'attachment' &&
|
||||
result.message.attachment.type === 'hook_blocking_error'
|
||||
result.message.attachment!.type === 'hook_blocking_error'
|
||||
)
|
||||
) {
|
||||
yield { message: result.message as AttachmentMessage | ProgressMessage<HookProgress> }
|
||||
@@ -223,7 +223,7 @@ export async function* runPostToolUseFailureHooks<Input extends AnyObject>(
|
||||
// Check if we were aborted during hook execution
|
||||
if (
|
||||
result.message?.type === 'attachment' &&
|
||||
result.message.attachment.type === 'hook_cancelled'
|
||||
result.message.attachment!.type === 'hook_cancelled'
|
||||
) {
|
||||
logEvent('tengu_post_tool_failure_hooks_cancelled', {
|
||||
toolName: sanitizeToolNameForAnalytics(tool.name),
|
||||
@@ -248,7 +248,7 @@ export async function* runPostToolUseFailureHooks<Input extends AnyObject>(
|
||||
result.message &&
|
||||
!(
|
||||
result.message.type === 'attachment' &&
|
||||
result.message.attachment.type === 'hook_blocking_error'
|
||||
result.message.attachment!.type === 'hook_blocking_error'
|
||||
)
|
||||
) {
|
||||
yield { message: result.message as AttachmentMessage | ProgressMessage<HookProgress> }
|
||||
|
||||
Reference in New Issue
Block a user