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

@@ -16,7 +16,7 @@ const HEADROOM = 3;
import { logForDebugging } from '../utils/debug.js';
import { sleep } from '../utils/sleep.js';
import { renderableSearchText } from '../utils/transcriptSearch.js';
import { isNavigableMessage, type MessageActionsNav, type MessageActionsState, type NavigableMessage, stripSystemReminders, toolCallOf } from './messageActions.js';
import { isNavigableMessage, type MessageActionsNav, type MessageActionsState, type NavigableMessage, type NavigableType, stripSystemReminders, toolCallOf } from './messageActions.js';
// Fallback extractor: lower + cache here for callers without the
// Messages.tsx tool-lookup path (tests, static contexts). Messages.tsx
@@ -151,7 +151,7 @@ function computeStickyPromptText(msg: RenderableMessage): string | null {
raw = block.text;
} else if (msg.type === 'attachment' && msg.attachment.type === 'queued_command' && msg.attachment.commandMode !== 'task-notification' && !msg.attachment.isMeta) {
const p = msg.attachment.prompt;
raw = typeof p === 'string' ? p : p.flatMap(b => b.type === 'text' ? [b.text] : []).join('\n');
raw = typeof p === 'string' ? p : (p as any[]).flatMap(b => b.type === 'text' ? [b.text] : []).join('\n');
}
if (raw === null) return null;
const t = stripSystemReminders(raw);
@@ -345,7 +345,7 @@ export function VirtualMessageList({
useImperativeHandle(cursorNavRef, (): MessageActionsNav => {
const select = (m: NavigableMessage) => setCursor?.({
uuid: m.uuid,
msgType: m.type,
msgType: m.type as NavigableType,
expanded: false,
toolName: toolCallOf(m)?.name
});