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

@@ -132,11 +132,11 @@ function useCanUseTool(setToolUseConfirmQueue, setToolPermissionContext) {
if (ctx.resolveIfAborted(resolve)) {
return;
}
if (raceResult.type === "result" && raceResult.result.matches && raceResult.result.confidence === "high" && feature("BASH_CLASSIFIER")) {
if ((raceResult as any).type === "result" && (raceResult as any).result.matches && (raceResult as any).result.confidence === "high" && feature("BASH_CLASSIFIER")) {
consumeSpeculativeClassifierCheck((input as {
command: string;
}).command);
const matchedRule = raceResult.result.matchedDescription ?? undefined;
const matchedRule = (raceResult as any).result.matchedDescription ?? undefined;
if (matchedRule) {
setClassifierApproval(toolUseID, matchedRule);
}
@@ -150,7 +150,7 @@ function useCanUseTool(setToolUseConfirmQueue, setToolPermissionContext) {
decisionReason: {
type: "classifier" as const,
classifier: "bash_allow" as const,
reason: `Allowed by prompt rule: "${raceResult.result.matchedDescription}"`
reason: `Allowed by prompt rule: "${(raceResult as any).result.matchedDescription}"`
}
}));
return;

View File

@@ -370,7 +370,7 @@ export function useReplBridge(messages: Message[], setMessages: (action: React.S
// Dispatch incoming control_response messages to registered handlers
function handlePermissionResponse(msg_0: SDKControlResponse): void {
const requestId = msg_0.response?.request_id;
const requestId = (msg_0 as any).response?.request_id;
if (!requestId) return;
const handler = pendingPermissionHandlers.get(requestId);
if (!handler) {
@@ -379,7 +379,7 @@ export function useReplBridge(messages: Message[], setMessages: (action: React.S
}
pendingPermissionHandlers.delete(requestId);
// Extract the permission decision from the control_response payload
const inner = msg_0.response;
const inner = (msg_0 as any).response;
if (inner.subtype === 'success' && inner.response && isBridgePermissionResponse(inner.response)) {
handler(inner.response);
}

View File

@@ -225,9 +225,9 @@ export function useVoiceIntegration({
const voiceState = feature('VOICE_MODE') ?
// biome-ignore lint/correctness/useHookAtTopLevel: feature() is a compile-time constant
useVoiceState(s => s.voiceState) : 'idle' as const;
const voiceInterimTranscript = feature('VOICE_MODE') ?
const voiceInterimTranscript: string = feature('VOICE_MODE') ?
// biome-ignore lint/correctness/useHookAtTopLevel: feature() is a compile-time constant
useVoiceState(s_0 => s_0.voiceInterimTranscript) : '';
useVoiceState(s_0 => s_0.voiceInterimTranscript) as string : '';
// Set the voice anchor for focus mode (where recording starts via terminal
// focus, not key hold). Key-hold sets the anchor in stripTrailing.