feat: 问就是封包

This commit is contained in:
claude-code-best
2026-03-31 23:32:58 +08:00
parent d7a729ca68
commit dd9cd782a7
67 changed files with 423 additions and 172 deletions

View File

@@ -551,7 +551,7 @@ export function extractDiscoveredToolNames(messages: Message[]): Set<string> {
// check rather than isCompactBoundaryMessage — utils/messages.ts imports
// from this file, so importing back would be circular.
if (msg.type === 'system' && msg.subtype === 'compact_boundary') {
const carried = msg.compactMetadata?.preCompactDiscoveredTools
const carried = (msg as any).compactMetadata?.preCompactDiscoveredTools as string[] | undefined
if (carried) {
for (const name of carried) discoveredTools.add(name)
carriedFromBoundary += carried.length
@@ -658,8 +658,8 @@ export function getDeferredToolsDelta(
attachmentTypesSeen.add(msg.attachment.type)
if (msg.attachment.type !== 'deferred_tools_delta') continue
dtdCount++
for (const n of msg.attachment.addedNames) announced.add(n)
for (const n of msg.attachment.removedNames) announced.delete(n)
for (const n of (msg.attachment as any).addedNames) announced.add(n)
for (const n of (msg.attachment as any).removedNames) announced.delete(n)
}
const deferred: Tool[] = tools.filter(isDeferredTool)