mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-18 22:35:51 +00:00
feat: 全部类型问题解决
This commit is contained in:
@@ -117,7 +117,7 @@ export function createApiQueryHook<TResult>(
|
||||
type: 'success',
|
||||
queryName: config.name,
|
||||
result,
|
||||
messageId: response.message.id,
|
||||
messageId: response.message.id ?? '',
|
||||
model,
|
||||
uuid,
|
||||
},
|
||||
|
||||
@@ -327,7 +327,7 @@ export function groupHooksByEventAndMatcher(
|
||||
const eventGroup = grouped[hookEvent]
|
||||
if (!eventGroup) continue
|
||||
|
||||
for (const matcher of matchers) {
|
||||
for (const matcher of (matchers ?? [])) {
|
||||
const matcherKey = matcher.matcher || ''
|
||||
|
||||
// Only PluginHookMatcher has pluginRoot; HookCallbackMatcher (internal
|
||||
|
||||
@@ -41,10 +41,10 @@ function formatRecentMessages(messages: Message[]): string {
|
||||
.filter(m => m.type === 'user' || m.type === 'assistant')
|
||||
.map(m => {
|
||||
const role = m.type === 'user' ? 'User' : 'Assistant'
|
||||
const content = m.message.content
|
||||
const content = m.message!.content
|
||||
if (typeof content === 'string')
|
||||
return `${role}: ${content.slice(0, 500)}`
|
||||
const text = content
|
||||
const text = (content ?? [])
|
||||
.filter(
|
||||
(b): b is Extract<typeof b, { type: 'text' }> => b.type === 'text',
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user