mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-06-03 02:55:39 +08:00
feature: Ask User Question implementation for Claude Code & upgrade claude agent sdk to 0.1.71 to support the tool
This commit is contained in:
25
src/components/chat/tools/configs/permissionPanelRegistry.ts
Normal file
25
src/components/chat/tools/configs/permissionPanelRegistry.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import type { ComponentType } from 'react';
|
||||
import type { PendingPermissionRequest } from '../../types/types';
|
||||
|
||||
export interface PermissionPanelProps {
|
||||
request: PendingPermissionRequest;
|
||||
onDecision: (
|
||||
requestIds: string | string[],
|
||||
decision: { allow?: boolean; message?: string; updatedInput?: unknown },
|
||||
) => void;
|
||||
}
|
||||
|
||||
const registry: Record<string, ComponentType<PermissionPanelProps>> = {};
|
||||
|
||||
export function registerPermissionPanel(
|
||||
toolName: string,
|
||||
component: ComponentType<PermissionPanelProps>,
|
||||
): void {
|
||||
registry[toolName] = component;
|
||||
}
|
||||
|
||||
export function getPermissionPanel(
|
||||
toolName: string,
|
||||
): ComponentType<PermissionPanelProps> | null {
|
||||
return registry[toolName] || null;
|
||||
}
|
||||
Reference in New Issue
Block a user