mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-17 13:55:50 +00:00
feat: 问就是封包
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user