MCPcopy
hub / github.com/codeaashu/claude-code / ToolSelector

Function ToolSelector

src/components/agents/ToolSelector.tsx:97–541  ·  view source on GitHub ↗
(t0)

Source from the content-addressed store, hash-verified

95 })).sort((a, b) => a.serverName.localeCompare(b.serverName));
96}
97export function ToolSelector(t0) {
98 const $ = _c(69);
99 const {
100 tools,
101 initialTools,
102 onComplete,
103 onCancel
104 } = t0;
105 let t1;
106 if ($[0] !== tools) {
107 t1 = filterToolsForAgent({
108 tools,
109 isBuiltIn: false,
110 isAsync: false
111 });
112 $[0] = tools;
113 $[1] = t1;
114 } else {
115 t1 = $[1];
116 }
117 const customAgentTools = t1;
118 let t2;
119 if ($[2] !== customAgentTools || $[3] !== initialTools) {
120 t2 = !initialTools || initialTools.includes("*") ? customAgentTools.map(_temp) : initialTools;
121 $[2] = customAgentTools;
122 $[3] = initialTools;
123 $[4] = t2;
124 } else {
125 t2 = $[4];
126 }
127 const expandedInitialTools = t2;
128 const [selectedTools, setSelectedTools] = useState(expandedInitialTools);
129 const [focusIndex, setFocusIndex] = useState(0);
130 const [showIndividualTools, setShowIndividualTools] = useState(false);
131 let t3;
132 if ($[5] !== customAgentTools) {
133 t3 = new Set(customAgentTools.map(_temp2));
134 $[5] = customAgentTools;
135 $[6] = t3;
136 } else {
137 t3 = $[6];
138 }
139 const toolNames = t3;
140 let t4;
141 if ($[7] !== selectedTools || $[8] !== toolNames) {
142 let t5;
143 if ($[10] !== toolNames) {
144 t5 = name => toolNames.has(name);
145 $[10] = toolNames;
146 $[11] = t5;
147 } else {
148 t5 = $[11];
149 }
150 t4 = selectedTools.filter(t5);
151 $[7] = selectedTools;
152 $[8] = toolNames;
153 $[9] = t4;
154 } else {

Callers

nothing calls this directly

Calls 14

filterToolsForAgentFunction · 0.85
getToolBucketsFunction · 0.85
isMcpToolFunction · 0.85
countFunction · 0.85
getMcpServerBucketsFunction · 0.85
pluralFunction · 0.85
mcpInfoFromStringFunction · 0.85
useKeybindingFunction · 0.85
forEachMethod · 0.80
preventDefaultMethod · 0.80
maxMethod · 0.80
onCancelFunction · 0.50

Tested by

no test coverage detected