@leanmcp/ui 0.2.1 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +88 -3
- package/dist/chunk-2HRO6CFU.js +138 -0
- package/dist/chunk-2HRO6CFU.js.map +1 -0
- package/dist/chunk-KX75VCMM.mjs +124 -0
- package/dist/chunk-KX75VCMM.mjs.map +1 -0
- package/dist/index.d.mts +105 -3
- package/dist/index.d.ts +105 -3
- package/dist/index.js +839 -665
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +520 -385
- package/dist/index.mjs.map +1 -1
- package/dist/server.d.mts +115 -1
- package/dist/server.d.ts +115 -1
- package/dist/server.js +48 -7
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +2 -1
- package/dist/server.mjs.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-3PV26V5F.js +0 -50
- package/dist/chunk-3PV26V5F.js.map +0 -1
- package/dist/chunk-WORZ46KI.mjs +0 -42
- package/dist/chunk-WORZ46KI.mjs.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunk2HRO6CFU_js = require('./chunk-2HRO6CFU.js');
|
|
4
|
+
var React26 = require('react');
|
|
5
5
|
var extApps = require('@modelcontextprotocol/ext-apps');
|
|
6
6
|
var lucideReact = require('lucide-react');
|
|
7
7
|
var nextThemes = require('next-themes');
|
|
@@ -49,7 +49,7 @@ function _interopNamespace(e) {
|
|
|
49
49
|
return Object.freeze(n);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
var
|
|
52
|
+
var React26__namespace = /*#__PURE__*/_interopNamespace(React26);
|
|
53
53
|
var DialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(DialogPrimitive);
|
|
54
54
|
var SelectPrimitive__namespace = /*#__PURE__*/_interopNamespace(SelectPrimitive);
|
|
55
55
|
var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespace(PopoverPrimitive);
|
|
@@ -64,30 +64,33 @@ var ScrollAreaPrimitive__namespace = /*#__PURE__*/_interopNamespace(ScrollAreaPr
|
|
|
64
64
|
var DropdownMenuPrimitive__namespace = /*#__PURE__*/_interopNamespace(DropdownMenuPrimitive);
|
|
65
65
|
var TooltipPrimitive__namespace = /*#__PURE__*/_interopNamespace(TooltipPrimitive);
|
|
66
66
|
|
|
67
|
-
var McpAppContext = /* @__PURE__ */
|
|
67
|
+
var McpAppContext = /* @__PURE__ */ React26.createContext(null);
|
|
68
68
|
function AppProvider({ appInfo, capabilities = {}, options = {
|
|
69
69
|
autoResize: true
|
|
70
70
|
}, onTeardown, children }) {
|
|
71
|
-
const [app, setApp] =
|
|
72
|
-
const [isConnected, setIsConnected] =
|
|
73
|
-
const [error, setError] =
|
|
74
|
-
const [hostContext, setHostContext] =
|
|
75
|
-
const [toolInput, setToolInput] =
|
|
76
|
-
const [toolInputPartial, setToolInputPartial] =
|
|
77
|
-
const [toolResult, setToolResult] =
|
|
78
|
-
const [toolCancelled, setToolCancelled] =
|
|
71
|
+
const [app, setApp] = React26.useState(null);
|
|
72
|
+
const [isConnected, setIsConnected] = React26.useState(false);
|
|
73
|
+
const [error, setError] = React26.useState(null);
|
|
74
|
+
const [hostContext, setHostContext] = React26.useState({});
|
|
75
|
+
const [toolInput, setToolInput] = React26.useState(null);
|
|
76
|
+
const [toolInputPartial, setToolInputPartial] = React26.useState(null);
|
|
77
|
+
const [toolResult, setToolResult] = React26.useState(null);
|
|
78
|
+
const [toolCancelled, setToolCancelled] = React26.useState({
|
|
79
79
|
cancelled: false
|
|
80
80
|
});
|
|
81
|
-
const stylesApplied =
|
|
82
|
-
const applyHostStyles =
|
|
81
|
+
const stylesApplied = React26.useRef(false);
|
|
82
|
+
const applyHostStyles = React26.useCallback((context) => {
|
|
83
83
|
if (context.theme) {
|
|
84
84
|
extApps.applyDocumentTheme(context.theme);
|
|
85
85
|
}
|
|
86
86
|
if (context.styles?.variables) {
|
|
87
87
|
extApps.applyHostStyleVariables(context.styles.variables);
|
|
88
88
|
}
|
|
89
|
+
if (context.styles?.css?.fonts) {
|
|
90
|
+
extApps.applyHostFonts(context.styles.css.fonts);
|
|
91
|
+
}
|
|
89
92
|
}, []);
|
|
90
|
-
|
|
93
|
+
React26.useEffect(() => {
|
|
91
94
|
let mounted = true;
|
|
92
95
|
let appInstance = null;
|
|
93
96
|
async function connect() {
|
|
@@ -156,7 +159,7 @@ function AppProvider({ appInfo, capabilities = {}, options = {
|
|
|
156
159
|
}
|
|
157
160
|
}
|
|
158
161
|
}
|
|
159
|
-
|
|
162
|
+
chunk2HRO6CFU_js.__name(connect, "connect");
|
|
160
163
|
connect();
|
|
161
164
|
return () => {
|
|
162
165
|
mounted = false;
|
|
@@ -170,7 +173,7 @@ function AppProvider({ appInfo, capabilities = {}, options = {
|
|
|
170
173
|
applyHostStyles,
|
|
171
174
|
onTeardown
|
|
172
175
|
]);
|
|
173
|
-
const callTool =
|
|
176
|
+
const callTool = React26.useCallback(async (name, args = {}) => {
|
|
174
177
|
if (!app) {
|
|
175
178
|
throw new Error("Not connected to host");
|
|
176
179
|
}
|
|
@@ -186,7 +189,7 @@ function AppProvider({ appInfo, capabilities = {}, options = {
|
|
|
186
189
|
}, [
|
|
187
190
|
app
|
|
188
191
|
]);
|
|
189
|
-
const sendMessage =
|
|
192
|
+
const sendMessage = React26.useCallback(async (text) => {
|
|
190
193
|
if (!app) {
|
|
191
194
|
console.warn("[AppProvider] Not connected - cannot send message");
|
|
192
195
|
return;
|
|
@@ -203,7 +206,7 @@ function AppProvider({ appInfo, capabilities = {}, options = {
|
|
|
203
206
|
}, [
|
|
204
207
|
app
|
|
205
208
|
]);
|
|
206
|
-
const sendLog =
|
|
209
|
+
const sendLog = React26.useCallback(async (level, data) => {
|
|
207
210
|
if (!app) {
|
|
208
211
|
console.log(`[MCP App] ${level}:`, data);
|
|
209
212
|
return;
|
|
@@ -215,7 +218,7 @@ function AppProvider({ appInfo, capabilities = {}, options = {
|
|
|
215
218
|
}, [
|
|
216
219
|
app
|
|
217
220
|
]);
|
|
218
|
-
const openLink =
|
|
221
|
+
const openLink = React26.useCallback(async (url) => {
|
|
219
222
|
if (!app) {
|
|
220
223
|
window.open(url, "_blank", "noopener,noreferrer");
|
|
221
224
|
return;
|
|
@@ -226,7 +229,7 @@ function AppProvider({ appInfo, capabilities = {}, options = {
|
|
|
226
229
|
}, [
|
|
227
230
|
app
|
|
228
231
|
]);
|
|
229
|
-
const requestDisplayMode =
|
|
232
|
+
const requestDisplayMode = React26.useCallback(async (mode) => {
|
|
230
233
|
if (!app) {
|
|
231
234
|
console.warn("[AppProvider] Not connected - cannot request display mode");
|
|
232
235
|
return "inline";
|
|
@@ -254,14 +257,14 @@ function AppProvider({ appInfo, capabilities = {}, options = {
|
|
|
254
257
|
requestDisplayMode
|
|
255
258
|
};
|
|
256
259
|
const theme = hostContext.theme ?? "light";
|
|
257
|
-
return /* @__PURE__ */
|
|
260
|
+
return /* @__PURE__ */ React26__namespace.default.createElement(McpAppContext.Provider, {
|
|
258
261
|
value
|
|
259
|
-
}, /* @__PURE__ */
|
|
262
|
+
}, /* @__PURE__ */ React26__namespace.default.createElement("div", {
|
|
260
263
|
className: "lui-root",
|
|
261
264
|
"data-theme": theme
|
|
262
265
|
}, children));
|
|
263
266
|
}
|
|
264
|
-
|
|
267
|
+
chunk2HRO6CFU_js.__name(AppProvider, "AppProvider");
|
|
265
268
|
var ssrDefaultContext = {
|
|
266
269
|
app: null,
|
|
267
270
|
isConnected: false,
|
|
@@ -273,41 +276,158 @@ var ssrDefaultContext = {
|
|
|
273
276
|
toolCancelled: {
|
|
274
277
|
cancelled: false
|
|
275
278
|
},
|
|
276
|
-
callTool: /* @__PURE__ */
|
|
279
|
+
callTool: /* @__PURE__ */ chunk2HRO6CFU_js.__name(async () => {
|
|
277
280
|
throw new Error("callTool not available during SSR");
|
|
278
281
|
}, "callTool"),
|
|
279
|
-
sendMessage: /* @__PURE__ */
|
|
282
|
+
sendMessage: /* @__PURE__ */ chunk2HRO6CFU_js.__name(async () => {
|
|
280
283
|
console.warn("sendMessage not available during SSR");
|
|
281
284
|
}, "sendMessage"),
|
|
282
|
-
sendLog: /* @__PURE__ */
|
|
285
|
+
sendLog: /* @__PURE__ */ chunk2HRO6CFU_js.__name(async () => {
|
|
283
286
|
console.warn("sendLog not available during SSR");
|
|
284
287
|
}, "sendLog"),
|
|
285
|
-
openLink: /* @__PURE__ */
|
|
288
|
+
openLink: /* @__PURE__ */ chunk2HRO6CFU_js.__name(async () => {
|
|
286
289
|
console.warn("openLink not available during SSR");
|
|
287
290
|
}, "openLink"),
|
|
288
|
-
requestDisplayMode: /* @__PURE__ */
|
|
291
|
+
requestDisplayMode: /* @__PURE__ */ chunk2HRO6CFU_js.__name(async () => {
|
|
289
292
|
console.warn("requestDisplayMode not available during SSR");
|
|
290
293
|
return "inline";
|
|
291
294
|
}, "requestDisplayMode")
|
|
292
295
|
};
|
|
293
296
|
function useMcpApp() {
|
|
294
|
-
const context =
|
|
297
|
+
const context = React26.useContext(McpAppContext);
|
|
295
298
|
if (!context) {
|
|
296
299
|
return ssrDefaultContext;
|
|
297
300
|
}
|
|
298
301
|
return context;
|
|
299
302
|
}
|
|
300
|
-
|
|
303
|
+
chunk2HRO6CFU_js.__name(useMcpApp, "useMcpApp");
|
|
304
|
+
var GptAppContext = /* @__PURE__ */ React26.createContext(null);
|
|
305
|
+
function GPTAppProvider({ appName, children }) {
|
|
306
|
+
const [isConnected, setIsConnected] = React26.useState(false);
|
|
307
|
+
const [error, setError] = React26.useState(null);
|
|
308
|
+
const [theme, setTheme] = React26.useState("light");
|
|
309
|
+
const [displayMode, setDisplayMode] = React26.useState("inline");
|
|
310
|
+
const [locale, setLocale] = React26.useState("en");
|
|
311
|
+
const [maxHeight, setMaxHeight] = React26.useState(600);
|
|
312
|
+
React26.useEffect(() => {
|
|
313
|
+
let mounted = true;
|
|
314
|
+
let checkAttempts = 0;
|
|
315
|
+
const maxAttempts = 50;
|
|
316
|
+
function checkConnection() {
|
|
317
|
+
if (!mounted) return;
|
|
318
|
+
if (window.openai) {
|
|
319
|
+
setIsConnected(true);
|
|
320
|
+
setError(null);
|
|
321
|
+
if (window.openai.theme) setTheme(window.openai.theme);
|
|
322
|
+
if (window.openai.displayMode) setDisplayMode(window.openai.displayMode);
|
|
323
|
+
if (window.openai.locale) setLocale(window.openai.locale);
|
|
324
|
+
if (window.openai.maxHeight) setMaxHeight(window.openai.maxHeight);
|
|
325
|
+
} else {
|
|
326
|
+
checkAttempts++;
|
|
327
|
+
if (checkAttempts < maxAttempts) {
|
|
328
|
+
setTimeout(checkConnection, 100);
|
|
329
|
+
} else {
|
|
330
|
+
setError(new Error("ChatGPT SDK not available"));
|
|
331
|
+
setIsConnected(false);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
chunk2HRO6CFU_js.__name(checkConnection, "checkConnection");
|
|
336
|
+
checkConnection();
|
|
337
|
+
return () => {
|
|
338
|
+
mounted = false;
|
|
339
|
+
};
|
|
340
|
+
}, [
|
|
341
|
+
appName
|
|
342
|
+
]);
|
|
343
|
+
const callTool = React26.useCallback(async (name, args = {}) => {
|
|
344
|
+
if (!window.openai?.callTool) {
|
|
345
|
+
throw new Error("ChatGPT SDK not available");
|
|
346
|
+
}
|
|
347
|
+
const result = await window.openai.callTool(name, args);
|
|
348
|
+
return result;
|
|
349
|
+
}, []);
|
|
350
|
+
const value = {
|
|
351
|
+
isConnected,
|
|
352
|
+
error,
|
|
353
|
+
theme,
|
|
354
|
+
displayMode,
|
|
355
|
+
locale,
|
|
356
|
+
maxHeight,
|
|
357
|
+
callTool
|
|
358
|
+
};
|
|
359
|
+
return /* @__PURE__ */ React26__namespace.default.createElement(GptAppContext.Provider, {
|
|
360
|
+
value
|
|
361
|
+
}, /* @__PURE__ */ React26__namespace.default.createElement("div", {
|
|
362
|
+
className: "lui-root",
|
|
363
|
+
"data-theme": theme
|
|
364
|
+
}, children));
|
|
365
|
+
}
|
|
366
|
+
chunk2HRO6CFU_js.__name(GPTAppProvider, "GPTAppProvider");
|
|
367
|
+
function useGptApp() {
|
|
368
|
+
const context = React26.useContext(GptAppContext);
|
|
369
|
+
if (!context) {
|
|
370
|
+
return {
|
|
371
|
+
isConnected: false,
|
|
372
|
+
error: new Error("GPTAppProvider not found"),
|
|
373
|
+
theme: "light",
|
|
374
|
+
displayMode: "inline",
|
|
375
|
+
locale: "en",
|
|
376
|
+
maxHeight: 600,
|
|
377
|
+
callTool: /* @__PURE__ */ chunk2HRO6CFU_js.__name(async () => {
|
|
378
|
+
throw new Error("Not connected to ChatGPT");
|
|
379
|
+
}, "callTool")
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
return context;
|
|
383
|
+
}
|
|
384
|
+
chunk2HRO6CFU_js.__name(useGptApp, "useGptApp");
|
|
385
|
+
function useGptTool(toolName) {
|
|
386
|
+
const { callTool, isConnected } = useGptApp();
|
|
387
|
+
const [result, setResult] = React26.useState(null);
|
|
388
|
+
const [loading, setLoading] = React26.useState(false);
|
|
389
|
+
const [error, setError] = React26.useState(null);
|
|
390
|
+
const call = React26.useCallback(async (args = {}) => {
|
|
391
|
+
if (!isConnected) {
|
|
392
|
+
setError(new Error("Not connected to ChatGPT"));
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
setLoading(true);
|
|
396
|
+
setError(null);
|
|
397
|
+
try {
|
|
398
|
+
const res = await callTool(toolName, args);
|
|
399
|
+
setResult(res);
|
|
400
|
+
return res;
|
|
401
|
+
} catch (err) {
|
|
402
|
+
setError(err);
|
|
403
|
+
throw err;
|
|
404
|
+
} finally {
|
|
405
|
+
setLoading(false);
|
|
406
|
+
}
|
|
407
|
+
}, [
|
|
408
|
+
callTool,
|
|
409
|
+
isConnected,
|
|
410
|
+
toolName
|
|
411
|
+
]);
|
|
412
|
+
return {
|
|
413
|
+
call,
|
|
414
|
+
result,
|
|
415
|
+
loading,
|
|
416
|
+
error,
|
|
417
|
+
isConnected
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
chunk2HRO6CFU_js.__name(useGptTool, "useGptTool");
|
|
301
421
|
var DEFAULT_CONTEXT = {
|
|
302
422
|
resultDisplay: {
|
|
303
423
|
display: "none"
|
|
304
424
|
},
|
|
305
425
|
showLoading: true
|
|
306
426
|
};
|
|
307
|
-
var ToolContext = /* @__PURE__ */
|
|
427
|
+
var ToolContext = /* @__PURE__ */ React26.createContext(DEFAULT_CONTEXT);
|
|
308
428
|
function ToolProvider({ defaults = {}, children }) {
|
|
309
|
-
const parentContext =
|
|
310
|
-
const value =
|
|
429
|
+
const parentContext = React26.useContext(ToolContext);
|
|
430
|
+
const value = React26.useMemo(() => ({
|
|
311
431
|
resultDisplay: defaults.resultDisplay ?? parentContext.resultDisplay,
|
|
312
432
|
onError: defaults.onError ?? parentContext.onError,
|
|
313
433
|
showLoading: defaults.showLoading ?? parentContext.showLoading
|
|
@@ -315,34 +435,34 @@ function ToolProvider({ defaults = {}, children }) {
|
|
|
315
435
|
defaults,
|
|
316
436
|
parentContext
|
|
317
437
|
]);
|
|
318
|
-
return /* @__PURE__ */
|
|
438
|
+
return /* @__PURE__ */ React26__namespace.createElement(ToolContext.Provider, {
|
|
319
439
|
value
|
|
320
440
|
}, children);
|
|
321
441
|
}
|
|
322
|
-
|
|
442
|
+
chunk2HRO6CFU_js.__name(ToolProvider, "ToolProvider");
|
|
323
443
|
function useToolContext() {
|
|
324
|
-
return
|
|
444
|
+
return React26.useContext(ToolContext);
|
|
325
445
|
}
|
|
326
|
-
|
|
327
|
-
var Toaster = /* @__PURE__ */
|
|
446
|
+
chunk2HRO6CFU_js.__name(useToolContext, "useToolContext");
|
|
447
|
+
var Toaster = /* @__PURE__ */ chunk2HRO6CFU_js.__name(({ ...props }) => {
|
|
328
448
|
const { theme = "system" } = nextThemes.useTheme();
|
|
329
|
-
return /* @__PURE__ */
|
|
449
|
+
return /* @__PURE__ */ React26__namespace.default.createElement(sonner.Toaster, {
|
|
330
450
|
theme,
|
|
331
451
|
className: "toaster group",
|
|
332
452
|
icons: {
|
|
333
|
-
success: /* @__PURE__ */
|
|
453
|
+
success: /* @__PURE__ */ React26__namespace.default.createElement(lucideReact.CircleCheckIcon, {
|
|
334
454
|
className: "size-4"
|
|
335
455
|
}),
|
|
336
|
-
info: /* @__PURE__ */
|
|
456
|
+
info: /* @__PURE__ */ React26__namespace.default.createElement(lucideReact.InfoIcon, {
|
|
337
457
|
className: "size-4"
|
|
338
458
|
}),
|
|
339
|
-
warning: /* @__PURE__ */
|
|
459
|
+
warning: /* @__PURE__ */ React26__namespace.default.createElement(lucideReact.TriangleAlertIcon, {
|
|
340
460
|
className: "size-4"
|
|
341
461
|
}),
|
|
342
|
-
error: /* @__PURE__ */
|
|
462
|
+
error: /* @__PURE__ */ React26__namespace.default.createElement(lucideReact.OctagonXIcon, {
|
|
343
463
|
className: "size-4"
|
|
344
464
|
}),
|
|
345
|
-
loading: /* @__PURE__ */
|
|
465
|
+
loading: /* @__PURE__ */ React26__namespace.default.createElement(lucideReact.Loader2Icon, {
|
|
346
466
|
className: "size-4 animate-spin"
|
|
347
467
|
})
|
|
348
468
|
},
|
|
@@ -358,7 +478,7 @@ var Toaster = /* @__PURE__ */ chunk3PV26V5F_js.__name(({ ...props }) => {
|
|
|
358
478
|
function cn(...inputs) {
|
|
359
479
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
360
480
|
}
|
|
361
|
-
|
|
481
|
+
chunk2HRO6CFU_js.__name(cn, "cn");
|
|
362
482
|
|
|
363
483
|
// src/components/ui/button.tsx
|
|
364
484
|
var buttonVariants = classVarianceAuthority.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", {
|
|
@@ -387,7 +507,7 @@ var buttonVariants = classVarianceAuthority.cva("inline-flex items-center justif
|
|
|
387
507
|
});
|
|
388
508
|
function Button({ className, variant = "default", size = "default", asChild = false, ...props }) {
|
|
389
509
|
const Comp = asChild ? reactSlot.Slot : "button";
|
|
390
|
-
return /* @__PURE__ */
|
|
510
|
+
return /* @__PURE__ */ React26__namespace.createElement(Comp, {
|
|
391
511
|
"data-slot": "button",
|
|
392
512
|
"data-variant": variant,
|
|
393
513
|
"data-size": size,
|
|
@@ -399,90 +519,90 @@ function Button({ className, variant = "default", size = "default", asChild = fa
|
|
|
399
519
|
...props
|
|
400
520
|
});
|
|
401
521
|
}
|
|
402
|
-
|
|
522
|
+
chunk2HRO6CFU_js.__name(Button, "Button");
|
|
403
523
|
function Dialog({ ...props }) {
|
|
404
|
-
return /* @__PURE__ */
|
|
524
|
+
return /* @__PURE__ */ React26__namespace.createElement(DialogPrimitive__namespace.Root, {
|
|
405
525
|
"data-slot": "dialog",
|
|
406
526
|
...props
|
|
407
527
|
});
|
|
408
528
|
}
|
|
409
|
-
|
|
529
|
+
chunk2HRO6CFU_js.__name(Dialog, "Dialog");
|
|
410
530
|
function DialogTrigger({ ...props }) {
|
|
411
|
-
return /* @__PURE__ */
|
|
531
|
+
return /* @__PURE__ */ React26__namespace.createElement(DialogPrimitive__namespace.Trigger, {
|
|
412
532
|
"data-slot": "dialog-trigger",
|
|
413
533
|
...props
|
|
414
534
|
});
|
|
415
535
|
}
|
|
416
|
-
|
|
536
|
+
chunk2HRO6CFU_js.__name(DialogTrigger, "DialogTrigger");
|
|
417
537
|
function DialogPortal({ ...props }) {
|
|
418
|
-
return /* @__PURE__ */
|
|
538
|
+
return /* @__PURE__ */ React26__namespace.createElement(DialogPrimitive__namespace.Portal, {
|
|
419
539
|
"data-slot": "dialog-portal",
|
|
420
540
|
...props
|
|
421
541
|
});
|
|
422
542
|
}
|
|
423
|
-
|
|
543
|
+
chunk2HRO6CFU_js.__name(DialogPortal, "DialogPortal");
|
|
424
544
|
function DialogClose({ ...props }) {
|
|
425
|
-
return /* @__PURE__ */
|
|
545
|
+
return /* @__PURE__ */ React26__namespace.createElement(DialogPrimitive__namespace.Close, {
|
|
426
546
|
"data-slot": "dialog-close",
|
|
427
547
|
...props
|
|
428
548
|
});
|
|
429
549
|
}
|
|
430
|
-
|
|
550
|
+
chunk2HRO6CFU_js.__name(DialogClose, "DialogClose");
|
|
431
551
|
function DialogOverlay({ className, ...props }) {
|
|
432
|
-
return /* @__PURE__ */
|
|
552
|
+
return /* @__PURE__ */ React26__namespace.createElement(DialogPrimitive__namespace.Overlay, {
|
|
433
553
|
"data-slot": "dialog-overlay",
|
|
434
554
|
className: cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50", className),
|
|
435
555
|
...props
|
|
436
556
|
});
|
|
437
557
|
}
|
|
438
|
-
|
|
558
|
+
chunk2HRO6CFU_js.__name(DialogOverlay, "DialogOverlay");
|
|
439
559
|
function DialogContent({ className, children, showCloseButton = true, ...props }) {
|
|
440
|
-
return /* @__PURE__ */
|
|
560
|
+
return /* @__PURE__ */ React26__namespace.createElement(DialogPortal, {
|
|
441
561
|
"data-slot": "dialog-portal"
|
|
442
|
-
}, /* @__PURE__ */
|
|
562
|
+
}, /* @__PURE__ */ React26__namespace.createElement(DialogOverlay, null), /* @__PURE__ */ React26__namespace.createElement(DialogPrimitive__namespace.Content, {
|
|
443
563
|
"data-slot": "dialog-content",
|
|
444
564
|
className: cn("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg", className),
|
|
445
565
|
...props
|
|
446
|
-
}, children, showCloseButton && /* @__PURE__ */
|
|
566
|
+
}, children, showCloseButton && /* @__PURE__ */ React26__namespace.createElement(DialogPrimitive__namespace.Close, {
|
|
447
567
|
"data-slot": "dialog-close",
|
|
448
568
|
className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
|
|
449
|
-
}, /* @__PURE__ */
|
|
569
|
+
}, /* @__PURE__ */ React26__namespace.createElement(lucideReact.XIcon, null), /* @__PURE__ */ React26__namespace.createElement("span", {
|
|
450
570
|
className: "sr-only"
|
|
451
571
|
}, "Close"))));
|
|
452
572
|
}
|
|
453
|
-
|
|
573
|
+
chunk2HRO6CFU_js.__name(DialogContent, "DialogContent");
|
|
454
574
|
function DialogHeader({ className, ...props }) {
|
|
455
|
-
return /* @__PURE__ */
|
|
575
|
+
return /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
456
576
|
"data-slot": "dialog-header",
|
|
457
577
|
className: cn("flex flex-col gap-2 text-center sm:text-left", className),
|
|
458
578
|
...props
|
|
459
579
|
});
|
|
460
580
|
}
|
|
461
|
-
|
|
581
|
+
chunk2HRO6CFU_js.__name(DialogHeader, "DialogHeader");
|
|
462
582
|
function DialogFooter({ className, ...props }) {
|
|
463
|
-
return /* @__PURE__ */
|
|
583
|
+
return /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
464
584
|
"data-slot": "dialog-footer",
|
|
465
585
|
className: cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className),
|
|
466
586
|
...props
|
|
467
587
|
});
|
|
468
588
|
}
|
|
469
|
-
|
|
589
|
+
chunk2HRO6CFU_js.__name(DialogFooter, "DialogFooter");
|
|
470
590
|
function DialogTitle({ className, ...props }) {
|
|
471
|
-
return /* @__PURE__ */
|
|
591
|
+
return /* @__PURE__ */ React26__namespace.createElement(DialogPrimitive__namespace.Title, {
|
|
472
592
|
"data-slot": "dialog-title",
|
|
473
593
|
className: cn("text-lg leading-none font-semibold", className),
|
|
474
594
|
...props
|
|
475
595
|
});
|
|
476
596
|
}
|
|
477
|
-
|
|
597
|
+
chunk2HRO6CFU_js.__name(DialogTitle, "DialogTitle");
|
|
478
598
|
function DialogDescription({ className, ...props }) {
|
|
479
|
-
return /* @__PURE__ */
|
|
599
|
+
return /* @__PURE__ */ React26__namespace.createElement(DialogPrimitive__namespace.Description, {
|
|
480
600
|
"data-slot": "dialog-description",
|
|
481
601
|
className: cn("text-muted-foreground text-sm", className),
|
|
482
602
|
...props
|
|
483
603
|
});
|
|
484
604
|
}
|
|
485
|
-
|
|
605
|
+
chunk2HRO6CFU_js.__name(DialogDescription, "DialogDescription");
|
|
486
606
|
function extractResultData(result) {
|
|
487
607
|
if ("structuredContent" in result && result.structuredContent) {
|
|
488
608
|
return result.structuredContent;
|
|
@@ -506,15 +626,15 @@ function extractResultData(result) {
|
|
|
506
626
|
}
|
|
507
627
|
return result;
|
|
508
628
|
}
|
|
509
|
-
|
|
629
|
+
chunk2HRO6CFU_js.__name(extractResultData, "extractResultData");
|
|
510
630
|
function useTool(toolName, options = {}) {
|
|
511
631
|
const { callTool } = useMcpApp();
|
|
512
|
-
const [state, setState] =
|
|
513
|
-
const [result, setResult] =
|
|
514
|
-
const [error, setError] =
|
|
515
|
-
const abortControllerRef =
|
|
516
|
-
const lastArgsRef =
|
|
517
|
-
const retryCountRef =
|
|
632
|
+
const [state, setState] = React26.useState("idle");
|
|
633
|
+
const [result, setResult] = React26.useState(null);
|
|
634
|
+
const [error, setError] = React26.useState(null);
|
|
635
|
+
const abortControllerRef = React26.useRef(null);
|
|
636
|
+
const lastArgsRef = React26.useRef(void 0);
|
|
637
|
+
const retryCountRef = React26.useRef(0);
|
|
518
638
|
const { defaultArgs, transform, retry, onStart, onSuccess, onError, onComplete } = options;
|
|
519
639
|
const retryConfig = typeof retry === "number" ? {
|
|
520
640
|
count: retry,
|
|
@@ -523,7 +643,7 @@ function useTool(toolName, options = {}) {
|
|
|
523
643
|
count: 0,
|
|
524
644
|
delay: 1e3
|
|
525
645
|
};
|
|
526
|
-
const executeCall =
|
|
646
|
+
const executeCall = React26.useCallback(async (args) => {
|
|
527
647
|
const mergedArgs = {
|
|
528
648
|
...defaultArgs,
|
|
529
649
|
...args
|
|
@@ -575,25 +695,25 @@ function useTool(toolName, options = {}) {
|
|
|
575
695
|
onError,
|
|
576
696
|
onComplete
|
|
577
697
|
]);
|
|
578
|
-
const call =
|
|
698
|
+
const call = React26.useCallback(async (args) => {
|
|
579
699
|
retryCountRef.current = 0;
|
|
580
700
|
return executeCall(args);
|
|
581
701
|
}, [
|
|
582
702
|
executeCall
|
|
583
703
|
]);
|
|
584
|
-
const mutate =
|
|
704
|
+
const mutate = React26.useCallback(async (args) => {
|
|
585
705
|
return call(args);
|
|
586
706
|
}, [
|
|
587
707
|
call
|
|
588
708
|
]);
|
|
589
|
-
const reset =
|
|
709
|
+
const reset = React26.useCallback(() => {
|
|
590
710
|
setState("idle");
|
|
591
711
|
setResult(null);
|
|
592
712
|
setError(null);
|
|
593
713
|
retryCountRef.current = 0;
|
|
594
714
|
abortControllerRef.current?.abort();
|
|
595
715
|
}, []);
|
|
596
|
-
const retryCall =
|
|
716
|
+
const retryCall = React26.useCallback(async () => {
|
|
597
717
|
if (lastArgsRef.current === void 0 && !defaultArgs) {
|
|
598
718
|
return null;
|
|
599
719
|
}
|
|
@@ -603,7 +723,7 @@ function useTool(toolName, options = {}) {
|
|
|
603
723
|
executeCall,
|
|
604
724
|
defaultArgs
|
|
605
725
|
]);
|
|
606
|
-
const abort =
|
|
726
|
+
const abort = React26.useCallback(() => {
|
|
607
727
|
abortControllerRef.current?.abort();
|
|
608
728
|
setState("idle");
|
|
609
729
|
}, []);
|
|
@@ -619,7 +739,7 @@ function useTool(toolName, options = {}) {
|
|
|
619
739
|
abort
|
|
620
740
|
};
|
|
621
741
|
}
|
|
622
|
-
|
|
742
|
+
chunk2HRO6CFU_js.__name(useTool, "useTool");
|
|
623
743
|
function ToolButton({ tool, args = {}, resultDisplay = "none", renderResult, resultDuration = 3e3, successMessage, errorMessage, onToolStart, onToolSuccess, onToolError, onToolComplete, loadingText, loadingIcon, disableWhileLoading = true, confirm, children, className, variant = "default", size = "default", disabled, asChild = false, ...props }) {
|
|
624
744
|
const toolConfig = typeof tool === "string" ? {
|
|
625
745
|
name: tool
|
|
@@ -636,8 +756,8 @@ function ToolButton({ tool, args = {}, resultDisplay = "none", renderResult, res
|
|
|
636
756
|
onError: onToolError,
|
|
637
757
|
onComplete: onToolComplete
|
|
638
758
|
});
|
|
639
|
-
const [showConfirm, setShowConfirm] =
|
|
640
|
-
const [showResult, setShowResult] =
|
|
759
|
+
const [showConfirm, setShowConfirm] = React26.useState(false);
|
|
760
|
+
const [showResult, setShowResult] = React26.useState(false);
|
|
641
761
|
const buttonState = {
|
|
642
762
|
loading,
|
|
643
763
|
state,
|
|
@@ -645,7 +765,7 @@ function ToolButton({ tool, args = {}, resultDisplay = "none", renderResult, res
|
|
|
645
765
|
error,
|
|
646
766
|
hasResult: result !== null || error !== null
|
|
647
767
|
};
|
|
648
|
-
const executeCall =
|
|
768
|
+
const executeCall = React26.useCallback(async () => {
|
|
649
769
|
try {
|
|
650
770
|
const res = await call();
|
|
651
771
|
if (resultDisplay === "toast") {
|
|
@@ -671,7 +791,7 @@ function ToolButton({ tool, args = {}, resultDisplay = "none", renderResult, res
|
|
|
671
791
|
errorMessage,
|
|
672
792
|
resultDuration
|
|
673
793
|
]);
|
|
674
|
-
const handleClick =
|
|
794
|
+
const handleClick = React26.useCallback(() => {
|
|
675
795
|
if (confirm) {
|
|
676
796
|
setShowConfirm(true);
|
|
677
797
|
} else {
|
|
@@ -681,7 +801,7 @@ function ToolButton({ tool, args = {}, resultDisplay = "none", renderResult, res
|
|
|
681
801
|
confirm,
|
|
682
802
|
executeCall
|
|
683
803
|
]);
|
|
684
|
-
const handleConfirm =
|
|
804
|
+
const handleConfirm = React26.useCallback(() => {
|
|
685
805
|
setShowConfirm(false);
|
|
686
806
|
executeCall();
|
|
687
807
|
}, [
|
|
@@ -693,31 +813,31 @@ function ToolButton({ tool, args = {}, resultDisplay = "none", renderResult, res
|
|
|
693
813
|
confirmText: "Confirm",
|
|
694
814
|
cancelText: "Cancel"
|
|
695
815
|
};
|
|
696
|
-
const renderChildren = /* @__PURE__ */
|
|
816
|
+
const renderChildren = /* @__PURE__ */ chunk2HRO6CFU_js.__name(() => {
|
|
697
817
|
if (typeof children === "function") {
|
|
698
818
|
return children(buttonState);
|
|
699
819
|
}
|
|
700
820
|
if (loading) {
|
|
701
|
-
return /* @__PURE__ */
|
|
821
|
+
return /* @__PURE__ */ React26__namespace.createElement(React26__namespace.Fragment, null, loadingIcon ?? /* @__PURE__ */ React26__namespace.createElement(lucideReact.Loader2, {
|
|
702
822
|
className: "animate-spin"
|
|
703
|
-
}), loadingText && /* @__PURE__ */
|
|
823
|
+
}), loadingText && /* @__PURE__ */ React26__namespace.createElement("span", null, loadingText), !loadingText && children);
|
|
704
824
|
}
|
|
705
825
|
if (showResult && resultDisplay === "inline") {
|
|
706
826
|
if (error) {
|
|
707
|
-
return /* @__PURE__ */
|
|
827
|
+
return /* @__PURE__ */ React26__namespace.createElement(React26__namespace.Fragment, null, /* @__PURE__ */ React26__namespace.createElement(lucideReact.X, {
|
|
708
828
|
className: "text-destructive"
|
|
709
|
-
}), /* @__PURE__ */
|
|
829
|
+
}), /* @__PURE__ */ React26__namespace.createElement("span", null, error.message));
|
|
710
830
|
}
|
|
711
831
|
if (renderResult) {
|
|
712
832
|
return renderResult(result);
|
|
713
833
|
}
|
|
714
|
-
return /* @__PURE__ */
|
|
834
|
+
return /* @__PURE__ */ React26__namespace.createElement(React26__namespace.Fragment, null, /* @__PURE__ */ React26__namespace.createElement(lucideReact.Check, {
|
|
715
835
|
className: "text-success"
|
|
716
|
-
}), /* @__PURE__ */
|
|
836
|
+
}), /* @__PURE__ */ React26__namespace.createElement("span", null, "Done"));
|
|
717
837
|
}
|
|
718
838
|
return children;
|
|
719
839
|
}, "renderChildren");
|
|
720
|
-
return /* @__PURE__ */
|
|
840
|
+
return /* @__PURE__ */ React26__namespace.createElement(React26__namespace.Fragment, null, /* @__PURE__ */ React26__namespace.createElement(Button, {
|
|
721
841
|
type: "button",
|
|
722
842
|
variant,
|
|
723
843
|
size,
|
|
@@ -726,116 +846,116 @@ function ToolButton({ tool, args = {}, resultDisplay = "none", renderResult, res
|
|
|
726
846
|
onClick: handleClick,
|
|
727
847
|
asChild,
|
|
728
848
|
...props
|
|
729
|
-
}, renderChildren()), confirm && /* @__PURE__ */
|
|
849
|
+
}, renderChildren()), confirm && /* @__PURE__ */ React26__namespace.createElement(Dialog, {
|
|
730
850
|
open: showConfirm,
|
|
731
851
|
onOpenChange: setShowConfirm
|
|
732
|
-
}, /* @__PURE__ */
|
|
852
|
+
}, /* @__PURE__ */ React26__namespace.createElement(DialogContent, null, /* @__PURE__ */ React26__namespace.createElement(DialogHeader, null, /* @__PURE__ */ React26__namespace.createElement(DialogTitle, null, confirmConfig.title), confirmConfig.description && /* @__PURE__ */ React26__namespace.createElement(DialogDescription, null, confirmConfig.description)), /* @__PURE__ */ React26__namespace.createElement(DialogFooter, null, /* @__PURE__ */ React26__namespace.createElement(Button, {
|
|
733
853
|
variant: "outline",
|
|
734
|
-
onClick: /* @__PURE__ */
|
|
735
|
-
}, confirmConfig.cancelText ?? "Cancel"), /* @__PURE__ */
|
|
854
|
+
onClick: /* @__PURE__ */ chunk2HRO6CFU_js.__name(() => setShowConfirm(false), "onClick")
|
|
855
|
+
}, confirmConfig.cancelText ?? "Cancel"), /* @__PURE__ */ React26__namespace.createElement(Button, {
|
|
736
856
|
variant: confirmConfig.confirmVariant ?? (variant === "destructive" ? "destructive" : "default"),
|
|
737
857
|
onClick: handleConfirm
|
|
738
858
|
}, confirmConfig.confirmText ?? "Confirm")))));
|
|
739
859
|
}
|
|
740
|
-
|
|
860
|
+
chunk2HRO6CFU_js.__name(ToolButton, "ToolButton");
|
|
741
861
|
function Select({ ...props }) {
|
|
742
|
-
return /* @__PURE__ */
|
|
862
|
+
return /* @__PURE__ */ React26__namespace.createElement(SelectPrimitive__namespace.Root, {
|
|
743
863
|
"data-slot": "select",
|
|
744
864
|
...props
|
|
745
865
|
});
|
|
746
866
|
}
|
|
747
|
-
|
|
867
|
+
chunk2HRO6CFU_js.__name(Select, "Select");
|
|
748
868
|
function SelectGroup({ ...props }) {
|
|
749
|
-
return /* @__PURE__ */
|
|
869
|
+
return /* @__PURE__ */ React26__namespace.createElement(SelectPrimitive__namespace.Group, {
|
|
750
870
|
"data-slot": "select-group",
|
|
751
871
|
...props
|
|
752
872
|
});
|
|
753
873
|
}
|
|
754
|
-
|
|
874
|
+
chunk2HRO6CFU_js.__name(SelectGroup, "SelectGroup");
|
|
755
875
|
function SelectValue({ ...props }) {
|
|
756
|
-
return /* @__PURE__ */
|
|
876
|
+
return /* @__PURE__ */ React26__namespace.createElement(SelectPrimitive__namespace.Value, {
|
|
757
877
|
"data-slot": "select-value",
|
|
758
878
|
...props
|
|
759
879
|
});
|
|
760
880
|
}
|
|
761
|
-
|
|
881
|
+
chunk2HRO6CFU_js.__name(SelectValue, "SelectValue");
|
|
762
882
|
function SelectTrigger({ className, size = "default", children, ...props }) {
|
|
763
|
-
return /* @__PURE__ */
|
|
883
|
+
return /* @__PURE__ */ React26__namespace.createElement(SelectPrimitive__namespace.Trigger, {
|
|
764
884
|
"data-slot": "select-trigger",
|
|
765
885
|
"data-size": size,
|
|
766
886
|
className: cn("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
767
887
|
...props
|
|
768
|
-
}, children, /* @__PURE__ */
|
|
888
|
+
}, children, /* @__PURE__ */ React26__namespace.createElement(SelectPrimitive__namespace.Icon, {
|
|
769
889
|
asChild: true
|
|
770
|
-
}, /* @__PURE__ */
|
|
890
|
+
}, /* @__PURE__ */ React26__namespace.createElement(lucideReact.ChevronDownIcon, {
|
|
771
891
|
className: "size-4 opacity-50"
|
|
772
892
|
})));
|
|
773
893
|
}
|
|
774
|
-
|
|
894
|
+
chunk2HRO6CFU_js.__name(SelectTrigger, "SelectTrigger");
|
|
775
895
|
function SelectContent({ className, children, position = "item-aligned", align = "center", ...props }) {
|
|
776
|
-
return /* @__PURE__ */
|
|
896
|
+
return /* @__PURE__ */ React26__namespace.createElement(SelectPrimitive__namespace.Portal, null, /* @__PURE__ */ React26__namespace.createElement(SelectPrimitive__namespace.Content, {
|
|
777
897
|
"data-slot": "select-content",
|
|
778
898
|
className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md", position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className),
|
|
779
899
|
position,
|
|
780
900
|
align,
|
|
781
901
|
...props
|
|
782
|
-
}, /* @__PURE__ */
|
|
902
|
+
}, /* @__PURE__ */ React26__namespace.createElement(SelectScrollUpButton, null), /* @__PURE__ */ React26__namespace.createElement(SelectPrimitive__namespace.Viewport, {
|
|
783
903
|
className: cn("p-1", position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1")
|
|
784
|
-
}, children), /* @__PURE__ */
|
|
904
|
+
}, children), /* @__PURE__ */ React26__namespace.createElement(SelectScrollDownButton, null)));
|
|
785
905
|
}
|
|
786
|
-
|
|
906
|
+
chunk2HRO6CFU_js.__name(SelectContent, "SelectContent");
|
|
787
907
|
function SelectLabel({ className, ...props }) {
|
|
788
|
-
return /* @__PURE__ */
|
|
908
|
+
return /* @__PURE__ */ React26__namespace.createElement(SelectPrimitive__namespace.Label, {
|
|
789
909
|
"data-slot": "select-label",
|
|
790
910
|
className: cn("text-muted-foreground px-2 py-1.5 text-xs", className),
|
|
791
911
|
...props
|
|
792
912
|
});
|
|
793
913
|
}
|
|
794
|
-
|
|
914
|
+
chunk2HRO6CFU_js.__name(SelectLabel, "SelectLabel");
|
|
795
915
|
function SelectItem({ className, children, ...props }) {
|
|
796
|
-
return /* @__PURE__ */
|
|
916
|
+
return /* @__PURE__ */ React26__namespace.createElement(SelectPrimitive__namespace.Item, {
|
|
797
917
|
"data-slot": "select-item",
|
|
798
918
|
className: cn("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className),
|
|
799
919
|
...props
|
|
800
|
-
}, /* @__PURE__ */
|
|
920
|
+
}, /* @__PURE__ */ React26__namespace.createElement("span", {
|
|
801
921
|
"data-slot": "select-item-indicator",
|
|
802
922
|
className: "absolute right-2 flex size-3.5 items-center justify-center"
|
|
803
|
-
}, /* @__PURE__ */
|
|
923
|
+
}, /* @__PURE__ */ React26__namespace.createElement(SelectPrimitive__namespace.ItemIndicator, null, /* @__PURE__ */ React26__namespace.createElement(lucideReact.CheckIcon, {
|
|
804
924
|
className: "size-4"
|
|
805
|
-
}))), /* @__PURE__ */
|
|
925
|
+
}))), /* @__PURE__ */ React26__namespace.createElement(SelectPrimitive__namespace.ItemText, null, children));
|
|
806
926
|
}
|
|
807
|
-
|
|
927
|
+
chunk2HRO6CFU_js.__name(SelectItem, "SelectItem");
|
|
808
928
|
function SelectSeparator({ className, ...props }) {
|
|
809
|
-
return /* @__PURE__ */
|
|
929
|
+
return /* @__PURE__ */ React26__namespace.createElement(SelectPrimitive__namespace.Separator, {
|
|
810
930
|
"data-slot": "select-separator",
|
|
811
931
|
className: cn("bg-border pointer-events-none -mx-1 my-1 h-px", className),
|
|
812
932
|
...props
|
|
813
933
|
});
|
|
814
934
|
}
|
|
815
|
-
|
|
935
|
+
chunk2HRO6CFU_js.__name(SelectSeparator, "SelectSeparator");
|
|
816
936
|
function SelectScrollUpButton({ className, ...props }) {
|
|
817
|
-
return /* @__PURE__ */
|
|
937
|
+
return /* @__PURE__ */ React26__namespace.createElement(SelectPrimitive__namespace.ScrollUpButton, {
|
|
818
938
|
"data-slot": "select-scroll-up-button",
|
|
819
939
|
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
820
940
|
...props
|
|
821
|
-
}, /* @__PURE__ */
|
|
941
|
+
}, /* @__PURE__ */ React26__namespace.createElement(lucideReact.ChevronUpIcon, {
|
|
822
942
|
className: "size-4"
|
|
823
943
|
}));
|
|
824
944
|
}
|
|
825
|
-
|
|
945
|
+
chunk2HRO6CFU_js.__name(SelectScrollUpButton, "SelectScrollUpButton");
|
|
826
946
|
function SelectScrollDownButton({ className, ...props }) {
|
|
827
|
-
return /* @__PURE__ */
|
|
947
|
+
return /* @__PURE__ */ React26__namespace.createElement(SelectPrimitive__namespace.ScrollDownButton, {
|
|
828
948
|
"data-slot": "select-scroll-down-button",
|
|
829
949
|
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
830
950
|
...props
|
|
831
|
-
}, /* @__PURE__ */
|
|
951
|
+
}, /* @__PURE__ */ React26__namespace.createElement(lucideReact.ChevronDownIcon, {
|
|
832
952
|
className: "size-4"
|
|
833
953
|
}));
|
|
834
954
|
}
|
|
835
|
-
|
|
955
|
+
chunk2HRO6CFU_js.__name(SelectScrollDownButton, "SelectScrollDownButton");
|
|
836
956
|
function ToolSelect({ onSelectTool, argName = "value", additionalArgs = {}, optionsTool, optionsArgs = {}, transformOptions, options: staticOptions = [], placeholder = "Select an option", loadingPlaceholder = "Loading...", emptyMessage = "No options available", value: controlledValue, defaultValue, onValueChange, onOptionsLoaded, onSelectionSuccess, onSelectionError, showSuccessToast = false, successMessage, className, disabled = false }) {
|
|
837
|
-
const [fetchedOptions, setFetchedOptions] =
|
|
838
|
-
const [internalValue, setInternalValue] =
|
|
957
|
+
const [fetchedOptions, setFetchedOptions] = React26.useState([]);
|
|
958
|
+
const [internalValue, setInternalValue] = React26.useState(defaultValue ?? "");
|
|
839
959
|
const optionsToolConfig = optionsTool ? typeof optionsTool === "string" ? {
|
|
840
960
|
name: optionsTool
|
|
841
961
|
} : optionsTool : null;
|
|
@@ -849,7 +969,7 @@ function ToolSelect({ onSelectTool, argName = "value", additionalArgs = {}, opti
|
|
|
849
969
|
}
|
|
850
970
|
});
|
|
851
971
|
const selectHook = useTool(selectToolConfig?.name ?? "", {
|
|
852
|
-
onSuccess: /* @__PURE__ */
|
|
972
|
+
onSuccess: /* @__PURE__ */ chunk2HRO6CFU_js.__name((result) => {
|
|
853
973
|
onSelectionSuccess?.(result);
|
|
854
974
|
if (showSuccessToast) {
|
|
855
975
|
const message = typeof successMessage === "function" ? successMessage(result) : successMessage ?? "Selection saved";
|
|
@@ -858,7 +978,7 @@ function ToolSelect({ onSelectTool, argName = "value", additionalArgs = {}, opti
|
|
|
858
978
|
}, "onSuccess"),
|
|
859
979
|
onError: onSelectionError
|
|
860
980
|
});
|
|
861
|
-
|
|
981
|
+
React26.useEffect(() => {
|
|
862
982
|
if (optionsToolConfig) {
|
|
863
983
|
optionsHook.call().then((result) => {
|
|
864
984
|
const options = transformOptions ? transformOptions(result) : result;
|
|
@@ -875,7 +995,7 @@ function ToolSelect({ onSelectTool, argName = "value", additionalArgs = {}, opti
|
|
|
875
995
|
...fetchedOptions
|
|
876
996
|
];
|
|
877
997
|
const value = controlledValue ?? internalValue;
|
|
878
|
-
const handleValueChange =
|
|
998
|
+
const handleValueChange = React26.useCallback((newValue) => {
|
|
879
999
|
setInternalValue(newValue);
|
|
880
1000
|
onValueChange?.(newValue);
|
|
881
1001
|
if (selectToolConfig) {
|
|
@@ -893,138 +1013,138 @@ function ToolSelect({ onSelectTool, argName = "value", additionalArgs = {}, opti
|
|
|
893
1013
|
]);
|
|
894
1014
|
const isLoading = optionsHook.loading || selectHook.loading;
|
|
895
1015
|
const hasError = optionsHook.error || selectHook.error;
|
|
896
|
-
return /* @__PURE__ */
|
|
1016
|
+
return /* @__PURE__ */ React26__namespace.createElement(Select, {
|
|
897
1017
|
value,
|
|
898
1018
|
onValueChange: handleValueChange,
|
|
899
1019
|
disabled: disabled || isLoading
|
|
900
|
-
}, /* @__PURE__ */
|
|
1020
|
+
}, /* @__PURE__ */ React26__namespace.createElement(SelectTrigger, {
|
|
901
1021
|
className: cn("w-full", className)
|
|
902
|
-
}, isLoading ? /* @__PURE__ */
|
|
1022
|
+
}, isLoading ? /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
903
1023
|
className: "flex items-center gap-2"
|
|
904
|
-
}, /* @__PURE__ */
|
|
1024
|
+
}, /* @__PURE__ */ React26__namespace.createElement(lucideReact.Loader2, {
|
|
905
1025
|
className: "h-4 w-4 animate-spin"
|
|
906
|
-
}), /* @__PURE__ */
|
|
1026
|
+
}), /* @__PURE__ */ React26__namespace.createElement("span", {
|
|
907
1027
|
className: "text-muted-foreground"
|
|
908
|
-
}, optionsHook.loading ? loadingPlaceholder : "Saving...")) : /* @__PURE__ */
|
|
1028
|
+
}, optionsHook.loading ? loadingPlaceholder : "Saving...")) : /* @__PURE__ */ React26__namespace.createElement(SelectValue, {
|
|
909
1029
|
placeholder
|
|
910
|
-
})), /* @__PURE__ */
|
|
1030
|
+
})), /* @__PURE__ */ React26__namespace.createElement(SelectContent, null, allOptions.length === 0 ? /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
911
1031
|
className: "py-6 text-center text-sm text-muted-foreground"
|
|
912
|
-
}, hasError ? "Error loading options" : emptyMessage) : allOptions.map((option) => /* @__PURE__ */
|
|
1032
|
+
}, hasError ? "Error loading options" : emptyMessage) : allOptions.map((option) => /* @__PURE__ */ React26__namespace.createElement(SelectItem, {
|
|
913
1033
|
key: option.value,
|
|
914
1034
|
value: option.value,
|
|
915
1035
|
disabled: option.disabled
|
|
916
|
-
}, /* @__PURE__ */
|
|
1036
|
+
}, /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
917
1037
|
className: "flex items-center gap-2"
|
|
918
|
-
}, option.icon, /* @__PURE__ */
|
|
1038
|
+
}, option.icon, /* @__PURE__ */ React26__namespace.createElement("div", null, /* @__PURE__ */ React26__namespace.createElement("div", null, option.label), option.description && /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
919
1039
|
className: "text-xs text-muted-foreground"
|
|
920
1040
|
}, option.description)))))));
|
|
921
1041
|
}
|
|
922
|
-
|
|
1042
|
+
chunk2HRO6CFU_js.__name(ToolSelect, "ToolSelect");
|
|
923
1043
|
function Input({ className, type, ...props }) {
|
|
924
|
-
return /* @__PURE__ */
|
|
1044
|
+
return /* @__PURE__ */ React26__namespace.createElement("input", {
|
|
925
1045
|
type,
|
|
926
1046
|
"data-slot": "input",
|
|
927
1047
|
className: cn("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", className),
|
|
928
1048
|
...props
|
|
929
1049
|
});
|
|
930
1050
|
}
|
|
931
|
-
|
|
1051
|
+
chunk2HRO6CFU_js.__name(Input, "Input");
|
|
932
1052
|
function Command({ className, ...props }) {
|
|
933
|
-
return /* @__PURE__ */
|
|
1053
|
+
return /* @__PURE__ */ React26__namespace.createElement(cmdk.Command, {
|
|
934
1054
|
"data-slot": "command",
|
|
935
1055
|
className: cn("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md", className),
|
|
936
1056
|
...props
|
|
937
1057
|
});
|
|
938
1058
|
}
|
|
939
|
-
|
|
1059
|
+
chunk2HRO6CFU_js.__name(Command, "Command");
|
|
940
1060
|
function CommandDialog({ title = "Command Palette", description = "Search for a command to run...", children, className, showCloseButton = true, ...props }) {
|
|
941
|
-
return /* @__PURE__ */
|
|
1061
|
+
return /* @__PURE__ */ React26__namespace.createElement(Dialog, props, /* @__PURE__ */ React26__namespace.createElement(DialogHeader, {
|
|
942
1062
|
className: "sr-only"
|
|
943
|
-
}, /* @__PURE__ */
|
|
1063
|
+
}, /* @__PURE__ */ React26__namespace.createElement(DialogTitle, null, title), /* @__PURE__ */ React26__namespace.createElement(DialogDescription, null, description)), /* @__PURE__ */ React26__namespace.createElement(DialogContent, {
|
|
944
1064
|
className: cn("overflow-hidden p-0", className),
|
|
945
1065
|
showCloseButton
|
|
946
|
-
}, /* @__PURE__ */
|
|
1066
|
+
}, /* @__PURE__ */ React26__namespace.createElement(Command, {
|
|
947
1067
|
className: "[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5"
|
|
948
1068
|
}, children)));
|
|
949
1069
|
}
|
|
950
|
-
|
|
1070
|
+
chunk2HRO6CFU_js.__name(CommandDialog, "CommandDialog");
|
|
951
1071
|
function CommandInput({ className, ...props }) {
|
|
952
|
-
return /* @__PURE__ */
|
|
1072
|
+
return /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
953
1073
|
"data-slot": "command-input-wrapper",
|
|
954
1074
|
className: "flex h-9 items-center gap-2 border-b px-3"
|
|
955
|
-
}, /* @__PURE__ */
|
|
1075
|
+
}, /* @__PURE__ */ React26__namespace.createElement(lucideReact.SearchIcon, {
|
|
956
1076
|
className: "size-4 shrink-0 opacity-50"
|
|
957
|
-
}), /* @__PURE__ */
|
|
1077
|
+
}), /* @__PURE__ */ React26__namespace.createElement(cmdk.Command.Input, {
|
|
958
1078
|
"data-slot": "command-input",
|
|
959
1079
|
className: cn("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50", className),
|
|
960
1080
|
...props
|
|
961
1081
|
}));
|
|
962
1082
|
}
|
|
963
|
-
|
|
1083
|
+
chunk2HRO6CFU_js.__name(CommandInput, "CommandInput");
|
|
964
1084
|
function CommandList({ className, ...props }) {
|
|
965
|
-
return /* @__PURE__ */
|
|
1085
|
+
return /* @__PURE__ */ React26__namespace.createElement(cmdk.Command.List, {
|
|
966
1086
|
"data-slot": "command-list",
|
|
967
1087
|
className: cn("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto", className),
|
|
968
1088
|
...props
|
|
969
1089
|
});
|
|
970
1090
|
}
|
|
971
|
-
|
|
1091
|
+
chunk2HRO6CFU_js.__name(CommandList, "CommandList");
|
|
972
1092
|
function CommandEmpty({ ...props }) {
|
|
973
|
-
return /* @__PURE__ */
|
|
1093
|
+
return /* @__PURE__ */ React26__namespace.createElement(cmdk.Command.Empty, {
|
|
974
1094
|
"data-slot": "command-empty",
|
|
975
1095
|
className: "py-6 text-center text-sm",
|
|
976
1096
|
...props
|
|
977
1097
|
});
|
|
978
1098
|
}
|
|
979
|
-
|
|
1099
|
+
chunk2HRO6CFU_js.__name(CommandEmpty, "CommandEmpty");
|
|
980
1100
|
function CommandGroup({ className, ...props }) {
|
|
981
|
-
return /* @__PURE__ */
|
|
1101
|
+
return /* @__PURE__ */ React26__namespace.createElement(cmdk.Command.Group, {
|
|
982
1102
|
"data-slot": "command-group",
|
|
983
1103
|
className: cn("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium", className),
|
|
984
1104
|
...props
|
|
985
1105
|
});
|
|
986
1106
|
}
|
|
987
|
-
|
|
1107
|
+
chunk2HRO6CFU_js.__name(CommandGroup, "CommandGroup");
|
|
988
1108
|
function CommandSeparator({ className, ...props }) {
|
|
989
|
-
return /* @__PURE__ */
|
|
1109
|
+
return /* @__PURE__ */ React26__namespace.createElement(cmdk.Command.Separator, {
|
|
990
1110
|
"data-slot": "command-separator",
|
|
991
1111
|
className: cn("bg-border -mx-1 h-px", className),
|
|
992
1112
|
...props
|
|
993
1113
|
});
|
|
994
1114
|
}
|
|
995
|
-
|
|
1115
|
+
chunk2HRO6CFU_js.__name(CommandSeparator, "CommandSeparator");
|
|
996
1116
|
function CommandItem({ className, ...props }) {
|
|
997
|
-
return /* @__PURE__ */
|
|
1117
|
+
return /* @__PURE__ */ React26__namespace.createElement(cmdk.Command.Item, {
|
|
998
1118
|
"data-slot": "command-item",
|
|
999
1119
|
className: cn("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
1000
1120
|
...props
|
|
1001
1121
|
});
|
|
1002
1122
|
}
|
|
1003
|
-
|
|
1123
|
+
chunk2HRO6CFU_js.__name(CommandItem, "CommandItem");
|
|
1004
1124
|
function CommandShortcut({ className, ...props }) {
|
|
1005
|
-
return /* @__PURE__ */
|
|
1125
|
+
return /* @__PURE__ */ React26__namespace.createElement("span", {
|
|
1006
1126
|
"data-slot": "command-shortcut",
|
|
1007
1127
|
className: cn("text-muted-foreground ml-auto text-xs tracking-widest", className),
|
|
1008
1128
|
...props
|
|
1009
1129
|
});
|
|
1010
1130
|
}
|
|
1011
|
-
|
|
1131
|
+
chunk2HRO6CFU_js.__name(CommandShortcut, "CommandShortcut");
|
|
1012
1132
|
function Popover({ ...props }) {
|
|
1013
|
-
return /* @__PURE__ */
|
|
1133
|
+
return /* @__PURE__ */ React26__namespace.createElement(PopoverPrimitive__namespace.Root, {
|
|
1014
1134
|
"data-slot": "popover",
|
|
1015
1135
|
...props
|
|
1016
1136
|
});
|
|
1017
1137
|
}
|
|
1018
|
-
|
|
1138
|
+
chunk2HRO6CFU_js.__name(Popover, "Popover");
|
|
1019
1139
|
function PopoverTrigger({ ...props }) {
|
|
1020
|
-
return /* @__PURE__ */
|
|
1140
|
+
return /* @__PURE__ */ React26__namespace.createElement(PopoverPrimitive__namespace.Trigger, {
|
|
1021
1141
|
"data-slot": "popover-trigger",
|
|
1022
1142
|
...props
|
|
1023
1143
|
});
|
|
1024
1144
|
}
|
|
1025
|
-
|
|
1145
|
+
chunk2HRO6CFU_js.__name(PopoverTrigger, "PopoverTrigger");
|
|
1026
1146
|
function PopoverContent({ className, align = "center", sideOffset = 4, ...props }) {
|
|
1027
|
-
return /* @__PURE__ */
|
|
1147
|
+
return /* @__PURE__ */ React26__namespace.createElement(PopoverPrimitive__namespace.Portal, null, /* @__PURE__ */ React26__namespace.createElement(PopoverPrimitive__namespace.Content, {
|
|
1028
1148
|
"data-slot": "popover-content",
|
|
1029
1149
|
align,
|
|
1030
1150
|
sideOffset,
|
|
@@ -1032,22 +1152,22 @@ function PopoverContent({ className, align = "center", sideOffset = 4, ...props
|
|
|
1032
1152
|
...props
|
|
1033
1153
|
}));
|
|
1034
1154
|
}
|
|
1035
|
-
|
|
1155
|
+
chunk2HRO6CFU_js.__name(PopoverContent, "PopoverContent");
|
|
1036
1156
|
function PopoverAnchor({ ...props }) {
|
|
1037
|
-
return /* @__PURE__ */
|
|
1157
|
+
return /* @__PURE__ */ React26__namespace.createElement(PopoverPrimitive__namespace.Anchor, {
|
|
1038
1158
|
"data-slot": "popover-anchor",
|
|
1039
1159
|
...props
|
|
1040
1160
|
});
|
|
1041
1161
|
}
|
|
1042
|
-
|
|
1162
|
+
chunk2HRO6CFU_js.__name(PopoverAnchor, "PopoverAnchor");
|
|
1043
1163
|
|
|
1044
1164
|
// src/mcp/ToolInput.tsx
|
|
1045
1165
|
function ToolInput({ searchTool, debounce = 300, minChars = 1, argName = "query", additionalArgs = {}, autocomplete = false, transformSuggestions, onSuggestionSelect, emptyMessage = "No results found", value: controlledValue, onChange, onSearchResults, onSearchError, showSearchIcon = true, showClearButton = true, showLoadingIndicator = true, className, placeholder = "Search...", disabled, ...props }) {
|
|
1046
|
-
const [internalValue, setInternalValue] =
|
|
1047
|
-
const [suggestions, setSuggestions] =
|
|
1048
|
-
const [isOpen, setIsOpen] =
|
|
1049
|
-
const debounceRef =
|
|
1050
|
-
const inputRef =
|
|
1166
|
+
const [internalValue, setInternalValue] = React26.useState("");
|
|
1167
|
+
const [suggestions, setSuggestions] = React26.useState([]);
|
|
1168
|
+
const [isOpen, setIsOpen] = React26.useState(false);
|
|
1169
|
+
const debounceRef = React26.useRef(null);
|
|
1170
|
+
const inputRef = React26.useRef(null);
|
|
1051
1171
|
const toolConfig = searchTool ? typeof searchTool === "string" ? {
|
|
1052
1172
|
name: searchTool
|
|
1053
1173
|
} : searchTool : null;
|
|
@@ -1056,7 +1176,7 @@ function ToolInput({ searchTool, debounce = 300, minChars = 1, argName = "query"
|
|
|
1056
1176
|
...toolConfig?.args,
|
|
1057
1177
|
...additionalArgs
|
|
1058
1178
|
},
|
|
1059
|
-
onSuccess: /* @__PURE__ */
|
|
1179
|
+
onSuccess: /* @__PURE__ */ chunk2HRO6CFU_js.__name((result) => {
|
|
1060
1180
|
onSearchResults?.(result);
|
|
1061
1181
|
if (autocomplete && transformSuggestions) {
|
|
1062
1182
|
const suggestions2 = transformSuggestions(result);
|
|
@@ -1069,7 +1189,7 @@ function ToolInput({ searchTool, debounce = 300, minChars = 1, argName = "query"
|
|
|
1069
1189
|
onError: onSearchError
|
|
1070
1190
|
});
|
|
1071
1191
|
const value = controlledValue ?? internalValue;
|
|
1072
|
-
const handleChange =
|
|
1192
|
+
const handleChange = React26.useCallback((e) => {
|
|
1073
1193
|
const newValue = e.target.value;
|
|
1074
1194
|
setInternalValue(newValue);
|
|
1075
1195
|
onChange?.(newValue);
|
|
@@ -1096,7 +1216,7 @@ function ToolInput({ searchTool, debounce = 300, minChars = 1, argName = "query"
|
|
|
1096
1216
|
debounce,
|
|
1097
1217
|
call
|
|
1098
1218
|
]);
|
|
1099
|
-
const handleClear =
|
|
1219
|
+
const handleClear = React26.useCallback(() => {
|
|
1100
1220
|
setInternalValue("");
|
|
1101
1221
|
onChange?.("");
|
|
1102
1222
|
setSuggestions([]);
|
|
@@ -1107,7 +1227,7 @@ function ToolInput({ searchTool, debounce = 300, minChars = 1, argName = "query"
|
|
|
1107
1227
|
onChange,
|
|
1108
1228
|
reset
|
|
1109
1229
|
]);
|
|
1110
|
-
const handleSelect =
|
|
1230
|
+
const handleSelect = React26.useCallback((suggestion) => {
|
|
1111
1231
|
setInternalValue(suggestion.label);
|
|
1112
1232
|
onChange?.(suggestion.label);
|
|
1113
1233
|
setIsOpen(false);
|
|
@@ -1116,18 +1236,18 @@ function ToolInput({ searchTool, debounce = 300, minChars = 1, argName = "query"
|
|
|
1116
1236
|
onChange,
|
|
1117
1237
|
onSuggestionSelect
|
|
1118
1238
|
]);
|
|
1119
|
-
|
|
1239
|
+
React26.useEffect(() => {
|
|
1120
1240
|
return () => {
|
|
1121
1241
|
if (debounceRef.current) {
|
|
1122
1242
|
clearTimeout(debounceRef.current);
|
|
1123
1243
|
}
|
|
1124
1244
|
};
|
|
1125
1245
|
}, []);
|
|
1126
|
-
const inputElement = /* @__PURE__ */
|
|
1246
|
+
const inputElement = /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
1127
1247
|
className: cn("relative", className)
|
|
1128
|
-
}, showSearchIcon && /* @__PURE__ */
|
|
1248
|
+
}, showSearchIcon && /* @__PURE__ */ React26__namespace.createElement(lucideReact.Search, {
|
|
1129
1249
|
className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"
|
|
1130
|
-
}), /* @__PURE__ */
|
|
1250
|
+
}), /* @__PURE__ */ React26__namespace.createElement(Input, {
|
|
1131
1251
|
ref: inputRef,
|
|
1132
1252
|
value,
|
|
1133
1253
|
onChange: handleChange,
|
|
@@ -1135,71 +1255,71 @@ function ToolInput({ searchTool, debounce = 300, minChars = 1, argName = "query"
|
|
|
1135
1255
|
disabled,
|
|
1136
1256
|
className: cn(showSearchIcon && "pl-9", (showClearButton || showLoadingIndicator) && "pr-9"),
|
|
1137
1257
|
...props
|
|
1138
|
-
}), /* @__PURE__ */
|
|
1258
|
+
}), /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
1139
1259
|
className: "absolute right-3 top-1/2 -translate-y-1/2 flex items-center gap-1"
|
|
1140
|
-
}, showLoadingIndicator && loading && /* @__PURE__ */
|
|
1260
|
+
}, showLoadingIndicator && loading && /* @__PURE__ */ React26__namespace.createElement(lucideReact.Loader2, {
|
|
1141
1261
|
className: "h-4 w-4 animate-spin text-muted-foreground"
|
|
1142
|
-
}), showClearButton && value && !loading && /* @__PURE__ */
|
|
1262
|
+
}), showClearButton && value && !loading && /* @__PURE__ */ React26__namespace.createElement("button", {
|
|
1143
1263
|
type: "button",
|
|
1144
1264
|
onClick: handleClear,
|
|
1145
1265
|
className: "h-4 w-4 text-muted-foreground hover:text-foreground transition-colors"
|
|
1146
|
-
}, /* @__PURE__ */
|
|
1266
|
+
}, /* @__PURE__ */ React26__namespace.createElement(lucideReact.X, {
|
|
1147
1267
|
className: "h-4 w-4"
|
|
1148
1268
|
}))));
|
|
1149
1269
|
if (!autocomplete) {
|
|
1150
1270
|
return inputElement;
|
|
1151
1271
|
}
|
|
1152
|
-
return /* @__PURE__ */
|
|
1272
|
+
return /* @__PURE__ */ React26__namespace.createElement(Popover, {
|
|
1153
1273
|
open: isOpen,
|
|
1154
1274
|
onOpenChange: setIsOpen
|
|
1155
|
-
}, /* @__PURE__ */
|
|
1275
|
+
}, /* @__PURE__ */ React26__namespace.createElement(PopoverTrigger, {
|
|
1156
1276
|
asChild: true
|
|
1157
|
-
}, inputElement), /* @__PURE__ */
|
|
1277
|
+
}, inputElement), /* @__PURE__ */ React26__namespace.createElement(PopoverContent, {
|
|
1158
1278
|
className: "p-0 w-[var(--radix-popover-trigger-width)]",
|
|
1159
1279
|
align: "start",
|
|
1160
|
-
onOpenAutoFocus: /* @__PURE__ */
|
|
1161
|
-
}, /* @__PURE__ */
|
|
1280
|
+
onOpenAutoFocus: /* @__PURE__ */ chunk2HRO6CFU_js.__name((e) => e.preventDefault(), "onOpenAutoFocus")
|
|
1281
|
+
}, /* @__PURE__ */ React26__namespace.createElement(Command, null, /* @__PURE__ */ React26__namespace.createElement(CommandList, null, /* @__PURE__ */ React26__namespace.createElement(CommandEmpty, null, emptyMessage), /* @__PURE__ */ React26__namespace.createElement(CommandGroup, null, suggestions.map((suggestion) => /* @__PURE__ */ React26__namespace.createElement(CommandItem, {
|
|
1162
1282
|
key: suggestion.value,
|
|
1163
1283
|
value: suggestion.value,
|
|
1164
|
-
onSelect: /* @__PURE__ */
|
|
1165
|
-
}, /* @__PURE__ */
|
|
1284
|
+
onSelect: /* @__PURE__ */ chunk2HRO6CFU_js.__name(() => handleSelect(suggestion), "onSelect")
|
|
1285
|
+
}, /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
1166
1286
|
className: "flex items-center gap-2"
|
|
1167
|
-
}, suggestion.icon, /* @__PURE__ */
|
|
1287
|
+
}, suggestion.icon, /* @__PURE__ */ React26__namespace.createElement("div", null, /* @__PURE__ */ React26__namespace.createElement("div", null, suggestion.label), suggestion.description && /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
1168
1288
|
className: "text-xs text-muted-foreground"
|
|
1169
1289
|
}, suggestion.description))))))))));
|
|
1170
1290
|
}
|
|
1171
|
-
|
|
1291
|
+
chunk2HRO6CFU_js.__name(ToolInput, "ToolInput");
|
|
1172
1292
|
function Label2({ className, ...props }) {
|
|
1173
|
-
return /* @__PURE__ */
|
|
1293
|
+
return /* @__PURE__ */ React26__namespace.createElement(LabelPrimitive__namespace.Root, {
|
|
1174
1294
|
"data-slot": "label",
|
|
1175
1295
|
className: cn("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", className),
|
|
1176
1296
|
...props
|
|
1177
1297
|
});
|
|
1178
1298
|
}
|
|
1179
|
-
|
|
1299
|
+
chunk2HRO6CFU_js.__name(Label2, "Label");
|
|
1180
1300
|
function Textarea({ className, ...props }) {
|
|
1181
|
-
return /* @__PURE__ */
|
|
1301
|
+
return /* @__PURE__ */ React26__namespace.createElement("textarea", {
|
|
1182
1302
|
"data-slot": "textarea",
|
|
1183
1303
|
className: cn("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", className),
|
|
1184
1304
|
...props
|
|
1185
1305
|
});
|
|
1186
1306
|
}
|
|
1187
|
-
|
|
1307
|
+
chunk2HRO6CFU_js.__name(Textarea, "Textarea");
|
|
1188
1308
|
function Checkbox({ className, ...props }) {
|
|
1189
|
-
return /* @__PURE__ */
|
|
1309
|
+
return /* @__PURE__ */ React26__namespace.createElement(CheckboxPrimitive__namespace.Root, {
|
|
1190
1310
|
"data-slot": "checkbox",
|
|
1191
1311
|
className: cn("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50", className),
|
|
1192
1312
|
...props
|
|
1193
|
-
}, /* @__PURE__ */
|
|
1313
|
+
}, /* @__PURE__ */ React26__namespace.createElement(CheckboxPrimitive__namespace.Indicator, {
|
|
1194
1314
|
"data-slot": "checkbox-indicator",
|
|
1195
1315
|
className: "grid place-content-center text-current transition-none"
|
|
1196
|
-
}, /* @__PURE__ */
|
|
1316
|
+
}, /* @__PURE__ */ React26__namespace.createElement(lucideReact.CheckIcon, {
|
|
1197
1317
|
className: "size-3.5"
|
|
1198
1318
|
})));
|
|
1199
1319
|
}
|
|
1200
|
-
|
|
1320
|
+
chunk2HRO6CFU_js.__name(Checkbox, "Checkbox");
|
|
1201
1321
|
function Slider({ className, defaultValue, value, min = 0, max = 100, ...props }) {
|
|
1202
|
-
const _values =
|
|
1322
|
+
const _values = React26__namespace.useMemo(() => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [
|
|
1203
1323
|
min,
|
|
1204
1324
|
max
|
|
1205
1325
|
], [
|
|
@@ -1208,7 +1328,7 @@ function Slider({ className, defaultValue, value, min = 0, max = 100, ...props }
|
|
|
1208
1328
|
min,
|
|
1209
1329
|
max
|
|
1210
1330
|
]);
|
|
1211
|
-
return /* @__PURE__ */
|
|
1331
|
+
return /* @__PURE__ */ React26__namespace.createElement(SliderPrimitive__namespace.Root, {
|
|
1212
1332
|
"data-slot": "slider",
|
|
1213
1333
|
defaultValue,
|
|
1214
1334
|
value,
|
|
@@ -1216,32 +1336,32 @@ function Slider({ className, defaultValue, value, min = 0, max = 100, ...props }
|
|
|
1216
1336
|
max,
|
|
1217
1337
|
className: cn("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col", className),
|
|
1218
1338
|
...props
|
|
1219
|
-
}, /* @__PURE__ */
|
|
1339
|
+
}, /* @__PURE__ */ React26__namespace.createElement(SliderPrimitive__namespace.Track, {
|
|
1220
1340
|
"data-slot": "slider-track",
|
|
1221
1341
|
className: cn("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5")
|
|
1222
|
-
}, /* @__PURE__ */
|
|
1342
|
+
}, /* @__PURE__ */ React26__namespace.createElement(SliderPrimitive__namespace.Range, {
|
|
1223
1343
|
"data-slot": "slider-range",
|
|
1224
1344
|
className: cn("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")
|
|
1225
1345
|
})), Array.from({
|
|
1226
1346
|
length: _values.length
|
|
1227
|
-
}, (_, index) => /* @__PURE__ */
|
|
1347
|
+
}, (_, index) => /* @__PURE__ */ React26__namespace.createElement(SliderPrimitive__namespace.Thumb, {
|
|
1228
1348
|
"data-slot": "slider-thumb",
|
|
1229
1349
|
key: index,
|
|
1230
1350
|
className: "border-primary ring-ring/50 block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"
|
|
1231
1351
|
})));
|
|
1232
1352
|
}
|
|
1233
|
-
|
|
1353
|
+
chunk2HRO6CFU_js.__name(Slider, "Slider");
|
|
1234
1354
|
function Switch({ className, ...props }) {
|
|
1235
|
-
return /* @__PURE__ */
|
|
1355
|
+
return /* @__PURE__ */ React26__namespace.createElement(SwitchPrimitive__namespace.Root, {
|
|
1236
1356
|
"data-slot": "switch",
|
|
1237
1357
|
className: cn("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50", className),
|
|
1238
1358
|
...props
|
|
1239
|
-
}, /* @__PURE__ */
|
|
1359
|
+
}, /* @__PURE__ */ React26__namespace.createElement(SwitchPrimitive__namespace.Thumb, {
|
|
1240
1360
|
"data-slot": "switch-thumb",
|
|
1241
1361
|
className: cn("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")
|
|
1242
1362
|
}));
|
|
1243
1363
|
}
|
|
1244
|
-
|
|
1364
|
+
chunk2HRO6CFU_js.__name(Switch, "Switch");
|
|
1245
1365
|
var alertVariants = classVarianceAuthority.cva("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current", {
|
|
1246
1366
|
variants: {
|
|
1247
1367
|
variant: {
|
|
@@ -1254,7 +1374,7 @@ var alertVariants = classVarianceAuthority.cva("relative w-full rounded-lg borde
|
|
|
1254
1374
|
}
|
|
1255
1375
|
});
|
|
1256
1376
|
function Alert({ className, variant, ...props }) {
|
|
1257
|
-
return /* @__PURE__ */
|
|
1377
|
+
return /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
1258
1378
|
"data-slot": "alert",
|
|
1259
1379
|
role: "alert",
|
|
1260
1380
|
className: cn(alertVariants({
|
|
@@ -1263,27 +1383,27 @@ function Alert({ className, variant, ...props }) {
|
|
|
1263
1383
|
...props
|
|
1264
1384
|
});
|
|
1265
1385
|
}
|
|
1266
|
-
|
|
1386
|
+
chunk2HRO6CFU_js.__name(Alert, "Alert");
|
|
1267
1387
|
function AlertTitle({ className, ...props }) {
|
|
1268
|
-
return /* @__PURE__ */
|
|
1388
|
+
return /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
1269
1389
|
"data-slot": "alert-title",
|
|
1270
1390
|
className: cn("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight", className),
|
|
1271
1391
|
...props
|
|
1272
1392
|
});
|
|
1273
1393
|
}
|
|
1274
|
-
|
|
1394
|
+
chunk2HRO6CFU_js.__name(AlertTitle, "AlertTitle");
|
|
1275
1395
|
function AlertDescription({ className, ...props }) {
|
|
1276
|
-
return /* @__PURE__ */
|
|
1396
|
+
return /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
1277
1397
|
"data-slot": "alert-description",
|
|
1278
1398
|
className: cn("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed", className),
|
|
1279
1399
|
...props
|
|
1280
1400
|
});
|
|
1281
1401
|
}
|
|
1282
|
-
|
|
1402
|
+
chunk2HRO6CFU_js.__name(AlertDescription, "AlertDescription");
|
|
1283
1403
|
function ToolForm({ toolName, fields: manualFields, autoSchema = false, submitText = "Submit", loadingText, onSuccess, onError, showResult = false, showSuccessToast = false, successMessage, resetOnSuccess = false, className, layout = "vertical" }) {
|
|
1284
1404
|
const { app, isConnected } = useMcpApp();
|
|
1285
1405
|
const { call, loading, result, error, reset } = useTool(toolName, {
|
|
1286
|
-
onSuccess: /* @__PURE__ */
|
|
1406
|
+
onSuccess: /* @__PURE__ */ chunk2HRO6CFU_js.__name((result2) => {
|
|
1287
1407
|
onSuccess?.(result2);
|
|
1288
1408
|
if (showSuccessToast) {
|
|
1289
1409
|
const message = typeof successMessage === "function" ? successMessage(result2) : successMessage ?? "Form submitted successfully";
|
|
@@ -1295,10 +1415,10 @@ function ToolForm({ toolName, fields: manualFields, autoSchema = false, submitTe
|
|
|
1295
1415
|
}, "onSuccess"),
|
|
1296
1416
|
onError
|
|
1297
1417
|
});
|
|
1298
|
-
const [fields, setFields] =
|
|
1299
|
-
const [schemaLoading, setSchemaLoading] =
|
|
1300
|
-
const [formData, setFormData] =
|
|
1301
|
-
const initializeFormData = /* @__PURE__ */
|
|
1418
|
+
const [fields, setFields] = React26.useState(manualFields ?? []);
|
|
1419
|
+
const [schemaLoading, setSchemaLoading] = React26.useState(autoSchema);
|
|
1420
|
+
const [formData, setFormData] = React26.useState({});
|
|
1421
|
+
const initializeFormData = /* @__PURE__ */ chunk2HRO6CFU_js.__name((fields2) => {
|
|
1302
1422
|
const initial = {};
|
|
1303
1423
|
fields2.forEach((field) => {
|
|
1304
1424
|
if (field.defaultValue !== void 0) {
|
|
@@ -1313,14 +1433,14 @@ function ToolForm({ toolName, fields: manualFields, autoSchema = false, submitTe
|
|
|
1313
1433
|
});
|
|
1314
1434
|
setFormData(initial);
|
|
1315
1435
|
}, "initializeFormData");
|
|
1316
|
-
const resetForm = /* @__PURE__ */
|
|
1436
|
+
const resetForm = /* @__PURE__ */ chunk2HRO6CFU_js.__name(() => {
|
|
1317
1437
|
initializeFormData(fields);
|
|
1318
1438
|
reset();
|
|
1319
1439
|
}, "resetForm");
|
|
1320
|
-
|
|
1440
|
+
React26.useEffect(() => {
|
|
1321
1441
|
if (autoSchema && app && isConnected) {
|
|
1322
1442
|
setSchemaLoading(true);
|
|
1323
|
-
const fetchSchema = /* @__PURE__ */
|
|
1443
|
+
const fetchSchema = /* @__PURE__ */ chunk2HRO6CFU_js.__name(async () => {
|
|
1324
1444
|
try {
|
|
1325
1445
|
console.warn("[ToolForm] Auto-schema not fully implemented, use manual fields");
|
|
1326
1446
|
if (manualFields) {
|
|
@@ -1345,7 +1465,7 @@ function ToolForm({ toolName, fields: manualFields, autoSchema = false, submitTe
|
|
|
1345
1465
|
manualFields,
|
|
1346
1466
|
toolName
|
|
1347
1467
|
]);
|
|
1348
|
-
const handleSubmit = /* @__PURE__ */
|
|
1468
|
+
const handleSubmit = /* @__PURE__ */ chunk2HRO6CFU_js.__name(async (e) => {
|
|
1349
1469
|
e.preventDefault();
|
|
1350
1470
|
const args = {};
|
|
1351
1471
|
fields.forEach((field) => {
|
|
@@ -1357,80 +1477,80 @@ function ToolForm({ toolName, fields: manualFields, autoSchema = false, submitTe
|
|
|
1357
1477
|
});
|
|
1358
1478
|
await call(args);
|
|
1359
1479
|
}, "handleSubmit");
|
|
1360
|
-
const handleChange = /* @__PURE__ */
|
|
1480
|
+
const handleChange = /* @__PURE__ */ chunk2HRO6CFU_js.__name((name, value) => {
|
|
1361
1481
|
setFormData((prev) => ({
|
|
1362
1482
|
...prev,
|
|
1363
1483
|
[name]: value
|
|
1364
1484
|
}));
|
|
1365
1485
|
}, "handleChange");
|
|
1366
|
-
const renderField = /* @__PURE__ */
|
|
1486
|
+
const renderField = /* @__PURE__ */ chunk2HRO6CFU_js.__name((field) => {
|
|
1367
1487
|
const value = formData[field.name];
|
|
1368
1488
|
switch (field.type) {
|
|
1369
1489
|
case "textarea":
|
|
1370
|
-
return /* @__PURE__ */
|
|
1490
|
+
return /* @__PURE__ */ React26__namespace.createElement(Textarea, {
|
|
1371
1491
|
id: field.name,
|
|
1372
1492
|
placeholder: field.placeholder,
|
|
1373
1493
|
value: value ?? "",
|
|
1374
|
-
onChange: /* @__PURE__ */
|
|
1494
|
+
onChange: /* @__PURE__ */ chunk2HRO6CFU_js.__name((e) => handleChange(field.name, e.target.value), "onChange"),
|
|
1375
1495
|
disabled: field.disabled || loading,
|
|
1376
1496
|
required: field.required
|
|
1377
1497
|
});
|
|
1378
1498
|
case "select":
|
|
1379
|
-
return /* @__PURE__ */
|
|
1499
|
+
return /* @__PURE__ */ React26__namespace.createElement(Select, {
|
|
1380
1500
|
value: value ?? "",
|
|
1381
|
-
onValueChange: /* @__PURE__ */
|
|
1501
|
+
onValueChange: /* @__PURE__ */ chunk2HRO6CFU_js.__name((v) => handleChange(field.name, v), "onValueChange"),
|
|
1382
1502
|
disabled: field.disabled || loading
|
|
1383
|
-
}, /* @__PURE__ */
|
|
1503
|
+
}, /* @__PURE__ */ React26__namespace.createElement(SelectTrigger, null, /* @__PURE__ */ React26__namespace.createElement(SelectValue, {
|
|
1384
1504
|
placeholder: field.placeholder ?? "Select..."
|
|
1385
|
-
})), /* @__PURE__ */
|
|
1505
|
+
})), /* @__PURE__ */ React26__namespace.createElement(SelectContent, null, field.options?.map((option) => /* @__PURE__ */ React26__namespace.createElement(SelectItem, {
|
|
1386
1506
|
key: option.value,
|
|
1387
1507
|
value: option.value
|
|
1388
1508
|
}, option.label))));
|
|
1389
1509
|
case "checkbox":
|
|
1390
|
-
return /* @__PURE__ */
|
|
1510
|
+
return /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
1391
1511
|
className: "flex items-center space-x-2"
|
|
1392
|
-
}, /* @__PURE__ */
|
|
1512
|
+
}, /* @__PURE__ */ React26__namespace.createElement(Checkbox, {
|
|
1393
1513
|
id: field.name,
|
|
1394
1514
|
checked: value ?? false,
|
|
1395
|
-
onCheckedChange: /* @__PURE__ */
|
|
1515
|
+
onCheckedChange: /* @__PURE__ */ chunk2HRO6CFU_js.__name((checked) => handleChange(field.name, checked), "onCheckedChange"),
|
|
1396
1516
|
disabled: field.disabled || loading
|
|
1397
|
-
}), /* @__PURE__ */
|
|
1517
|
+
}), /* @__PURE__ */ React26__namespace.createElement("label", {
|
|
1398
1518
|
htmlFor: field.name,
|
|
1399
1519
|
className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
1400
1520
|
}, field.label));
|
|
1401
1521
|
case "switch":
|
|
1402
|
-
return /* @__PURE__ */
|
|
1522
|
+
return /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
1403
1523
|
className: "flex items-center space-x-2"
|
|
1404
|
-
}, /* @__PURE__ */
|
|
1524
|
+
}, /* @__PURE__ */ React26__namespace.createElement(Switch, {
|
|
1405
1525
|
id: field.name,
|
|
1406
1526
|
checked: value ?? false,
|
|
1407
|
-
onCheckedChange: /* @__PURE__ */
|
|
1527
|
+
onCheckedChange: /* @__PURE__ */ chunk2HRO6CFU_js.__name((checked) => handleChange(field.name, checked), "onCheckedChange"),
|
|
1408
1528
|
disabled: field.disabled || loading
|
|
1409
|
-
}), /* @__PURE__ */
|
|
1529
|
+
}), /* @__PURE__ */ React26__namespace.createElement(Label2, {
|
|
1410
1530
|
htmlFor: field.name
|
|
1411
1531
|
}, field.label));
|
|
1412
1532
|
case "slider":
|
|
1413
|
-
return /* @__PURE__ */
|
|
1533
|
+
return /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
1414
1534
|
className: "space-y-2"
|
|
1415
|
-
}, /* @__PURE__ */
|
|
1535
|
+
}, /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
1416
1536
|
className: "flex justify-between text-sm"
|
|
1417
|
-
}, /* @__PURE__ */
|
|
1537
|
+
}, /* @__PURE__ */ React26__namespace.createElement("span", null, field.min ?? 0), /* @__PURE__ */ React26__namespace.createElement("span", null, value ?? field.min ?? 0), /* @__PURE__ */ React26__namespace.createElement("span", null, field.max ?? 100)), /* @__PURE__ */ React26__namespace.createElement(Slider, {
|
|
1418
1538
|
value: [
|
|
1419
1539
|
value ?? field.min ?? 0
|
|
1420
1540
|
],
|
|
1421
|
-
onValueChange: /* @__PURE__ */
|
|
1541
|
+
onValueChange: /* @__PURE__ */ chunk2HRO6CFU_js.__name(([v]) => handleChange(field.name, v), "onValueChange"),
|
|
1422
1542
|
min: field.min ?? 0,
|
|
1423
1543
|
max: field.max ?? 100,
|
|
1424
1544
|
step: field.step ?? 1,
|
|
1425
1545
|
disabled: field.disabled || loading
|
|
1426
1546
|
}));
|
|
1427
1547
|
case "number":
|
|
1428
|
-
return /* @__PURE__ */
|
|
1548
|
+
return /* @__PURE__ */ React26__namespace.createElement(Input, {
|
|
1429
1549
|
id: field.name,
|
|
1430
1550
|
type: "number",
|
|
1431
1551
|
placeholder: field.placeholder,
|
|
1432
1552
|
value: value ?? "",
|
|
1433
|
-
onChange: /* @__PURE__ */
|
|
1553
|
+
onChange: /* @__PURE__ */ chunk2HRO6CFU_js.__name((e) => handleChange(field.name, e.target.value), "onChange"),
|
|
1434
1554
|
min: field.min,
|
|
1435
1555
|
max: field.max,
|
|
1436
1556
|
step: field.step,
|
|
@@ -1438,64 +1558,64 @@ function ToolForm({ toolName, fields: manualFields, autoSchema = false, submitTe
|
|
|
1438
1558
|
required: field.required
|
|
1439
1559
|
});
|
|
1440
1560
|
default:
|
|
1441
|
-
return /* @__PURE__ */
|
|
1561
|
+
return /* @__PURE__ */ React26__namespace.createElement(Input, {
|
|
1442
1562
|
id: field.name,
|
|
1443
1563
|
type: field.type ?? "text",
|
|
1444
1564
|
placeholder: field.placeholder,
|
|
1445
1565
|
value: value ?? "",
|
|
1446
|
-
onChange: /* @__PURE__ */
|
|
1566
|
+
onChange: /* @__PURE__ */ chunk2HRO6CFU_js.__name((e) => handleChange(field.name, e.target.value), "onChange"),
|
|
1447
1567
|
disabled: field.disabled || loading,
|
|
1448
1568
|
required: field.required
|
|
1449
1569
|
});
|
|
1450
1570
|
}
|
|
1451
1571
|
}, "renderField");
|
|
1452
1572
|
if (schemaLoading) {
|
|
1453
|
-
return /* @__PURE__ */
|
|
1573
|
+
return /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
1454
1574
|
className: "flex items-center justify-center p-8"
|
|
1455
|
-
}, /* @__PURE__ */
|
|
1575
|
+
}, /* @__PURE__ */ React26__namespace.createElement(lucideReact.Loader2, {
|
|
1456
1576
|
className: "h-6 w-6 animate-spin text-muted-foreground"
|
|
1457
1577
|
}));
|
|
1458
1578
|
}
|
|
1459
|
-
return /* @__PURE__ */
|
|
1579
|
+
return /* @__PURE__ */ React26__namespace.createElement("form", {
|
|
1460
1580
|
className: cn("space-y-4", className),
|
|
1461
1581
|
onSubmit: handleSubmit
|
|
1462
|
-
}, /* @__PURE__ */
|
|
1582
|
+
}, /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
1463
1583
|
className: cn("space-y-4", layout === "horizontal" && "grid grid-cols-2 gap-4")
|
|
1464
|
-
}, fields.map((field) => /* @__PURE__ */
|
|
1584
|
+
}, fields.map((field) => /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
1465
1585
|
key: field.name,
|
|
1466
1586
|
className: "space-y-2"
|
|
1467
|
-
}, field.type !== "checkbox" && field.type !== "switch" && /* @__PURE__ */
|
|
1587
|
+
}, field.type !== "checkbox" && field.type !== "switch" && /* @__PURE__ */ React26__namespace.createElement(Label2, {
|
|
1468
1588
|
htmlFor: field.name
|
|
1469
|
-
}, field.label, field.required && /* @__PURE__ */
|
|
1589
|
+
}, field.label, field.required && /* @__PURE__ */ React26__namespace.createElement("span", {
|
|
1470
1590
|
className: "text-destructive ml-1"
|
|
1471
|
-
}, "*")), renderField(field), field.description && /* @__PURE__ */
|
|
1591
|
+
}, "*")), renderField(field), field.description && /* @__PURE__ */ React26__namespace.createElement("p", {
|
|
1472
1592
|
className: "text-sm text-muted-foreground"
|
|
1473
|
-
}, field.description)))), /* @__PURE__ */
|
|
1593
|
+
}, field.description)))), /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
1474
1594
|
className: "flex items-center gap-2"
|
|
1475
|
-
}, /* @__PURE__ */
|
|
1595
|
+
}, /* @__PURE__ */ React26__namespace.createElement(Button, {
|
|
1476
1596
|
type: "submit",
|
|
1477
1597
|
disabled: loading
|
|
1478
|
-
}, loading ? /* @__PURE__ */
|
|
1598
|
+
}, loading ? /* @__PURE__ */ React26__namespace.createElement(React26__namespace.Fragment, null, /* @__PURE__ */ React26__namespace.createElement(lucideReact.Loader2, {
|
|
1479
1599
|
className: "h-4 w-4 animate-spin mr-2"
|
|
1480
|
-
}), loadingText ?? "Submitting...") : submitText)), error && /* @__PURE__ */
|
|
1600
|
+
}), loadingText ?? "Submitting...") : submitText)), error && /* @__PURE__ */ React26__namespace.createElement(Alert, {
|
|
1481
1601
|
variant: "destructive"
|
|
1482
|
-
}, /* @__PURE__ */
|
|
1602
|
+
}, /* @__PURE__ */ React26__namespace.createElement(AlertDescription, null, error.message)), showResult && result !== null && /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
1483
1603
|
className: "rounded-md bg-muted p-4"
|
|
1484
|
-
}, /* @__PURE__ */
|
|
1604
|
+
}, /* @__PURE__ */ React26__namespace.createElement("pre", {
|
|
1485
1605
|
className: "text-sm overflow-auto"
|
|
1486
1606
|
}, JSON.stringify(result, null, 2))));
|
|
1487
1607
|
}
|
|
1488
|
-
|
|
1608
|
+
chunk2HRO6CFU_js.__name(ToolForm, "ToolForm");
|
|
1489
1609
|
function useResource(uri, options = {}) {
|
|
1490
1610
|
const { app, isConnected } = useMcpApp();
|
|
1491
1611
|
const { refreshInterval, subscribe = false, transform, skip = false } = options;
|
|
1492
|
-
const [data, setData] =
|
|
1493
|
-
const [loading, setLoading] =
|
|
1494
|
-
const [error, setError] =
|
|
1495
|
-
const [lastUpdated, setLastUpdated] =
|
|
1496
|
-
const intervalRef =
|
|
1497
|
-
const mountedRef =
|
|
1498
|
-
const fetchResource =
|
|
1612
|
+
const [data, setData] = React26.useState(null);
|
|
1613
|
+
const [loading, setLoading] = React26.useState(!skip);
|
|
1614
|
+
const [error, setError] = React26.useState(null);
|
|
1615
|
+
const [lastUpdated, setLastUpdated] = React26.useState(null);
|
|
1616
|
+
const intervalRef = React26.useRef(null);
|
|
1617
|
+
const mountedRef = React26.useRef(true);
|
|
1618
|
+
const fetchResource = React26.useCallback(async () => {
|
|
1499
1619
|
if (!app || !isConnected) {
|
|
1500
1620
|
throw new Error("Not connected to MCP host");
|
|
1501
1621
|
}
|
|
@@ -1548,12 +1668,12 @@ function useResource(uri, options = {}) {
|
|
|
1548
1668
|
uri,
|
|
1549
1669
|
transform
|
|
1550
1670
|
]);
|
|
1551
|
-
const refresh =
|
|
1671
|
+
const refresh = React26.useCallback(async () => {
|
|
1552
1672
|
return fetchResource();
|
|
1553
1673
|
}, [
|
|
1554
1674
|
fetchResource
|
|
1555
1675
|
]);
|
|
1556
|
-
|
|
1676
|
+
React26.useEffect(() => {
|
|
1557
1677
|
mountedRef.current = true;
|
|
1558
1678
|
if (!skip && isConnected) {
|
|
1559
1679
|
fetchResource().catch(() => {
|
|
@@ -1568,7 +1688,11 @@ function useResource(uri, options = {}) {
|
|
|
1568
1688
|
skip,
|
|
1569
1689
|
fetchResource
|
|
1570
1690
|
]);
|
|
1571
|
-
|
|
1691
|
+
React26.useEffect(() => {
|
|
1692
|
+
if (intervalRef.current) {
|
|
1693
|
+
clearInterval(intervalRef.current);
|
|
1694
|
+
intervalRef.current = null;
|
|
1695
|
+
}
|
|
1572
1696
|
if (refreshInterval && refreshInterval > 0 && isConnected && !skip) {
|
|
1573
1697
|
intervalRef.current = setInterval(() => {
|
|
1574
1698
|
fetchResource().catch(() => {
|
|
@@ -1587,7 +1711,7 @@ function useResource(uri, options = {}) {
|
|
|
1587
1711
|
skip,
|
|
1588
1712
|
fetchResource
|
|
1589
1713
|
]);
|
|
1590
|
-
|
|
1714
|
+
React26.useEffect(() => {
|
|
1591
1715
|
if (subscribe) {
|
|
1592
1716
|
console.warn("[useResource] Subscription support not yet implemented");
|
|
1593
1717
|
}
|
|
@@ -1602,46 +1726,46 @@ function useResource(uri, options = {}) {
|
|
|
1602
1726
|
lastUpdated
|
|
1603
1727
|
};
|
|
1604
1728
|
}
|
|
1605
|
-
|
|
1729
|
+
chunk2HRO6CFU_js.__name(useResource, "useResource");
|
|
1606
1730
|
function Skeleton({ className, ...props }) {
|
|
1607
|
-
return /* @__PURE__ */
|
|
1731
|
+
return /* @__PURE__ */ React26__namespace.default.createElement("div", {
|
|
1608
1732
|
"data-slot": "skeleton",
|
|
1609
1733
|
className: cn("bg-accent animate-pulse rounded-md", className),
|
|
1610
1734
|
...props
|
|
1611
1735
|
});
|
|
1612
1736
|
}
|
|
1613
|
-
|
|
1737
|
+
chunk2HRO6CFU_js.__name(Skeleton, "Skeleton");
|
|
1614
1738
|
|
|
1615
1739
|
// src/mcp/ResourceView.tsx
|
|
1616
1740
|
function DefaultLoading() {
|
|
1617
|
-
return /* @__PURE__ */
|
|
1741
|
+
return /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
1618
1742
|
className: "flex flex-col gap-3 p-4"
|
|
1619
|
-
}, /* @__PURE__ */
|
|
1743
|
+
}, /* @__PURE__ */ React26__namespace.createElement(Skeleton, {
|
|
1620
1744
|
className: "h-4 w-3/4"
|
|
1621
|
-
}), /* @__PURE__ */
|
|
1745
|
+
}), /* @__PURE__ */ React26__namespace.createElement(Skeleton, {
|
|
1622
1746
|
className: "h-4 w-1/2"
|
|
1623
|
-
}), /* @__PURE__ */
|
|
1747
|
+
}), /* @__PURE__ */ React26__namespace.createElement(Skeleton, {
|
|
1624
1748
|
className: "h-20 w-full"
|
|
1625
1749
|
}));
|
|
1626
1750
|
}
|
|
1627
|
-
|
|
1751
|
+
chunk2HRO6CFU_js.__name(DefaultLoading, "DefaultLoading");
|
|
1628
1752
|
function DefaultError({ error, onRetry }) {
|
|
1629
|
-
return /* @__PURE__ */
|
|
1753
|
+
return /* @__PURE__ */ React26__namespace.createElement(Alert, {
|
|
1630
1754
|
variant: "destructive"
|
|
1631
|
-
}, /* @__PURE__ */
|
|
1755
|
+
}, /* @__PURE__ */ React26__namespace.createElement(lucideReact.AlertCircle, {
|
|
1632
1756
|
className: "h-4 w-4"
|
|
1633
|
-
}), /* @__PURE__ */
|
|
1757
|
+
}), /* @__PURE__ */ React26__namespace.createElement(AlertTitle, null, "Error loading resource"), /* @__PURE__ */ React26__namespace.createElement(AlertDescription, {
|
|
1634
1758
|
className: "flex flex-col gap-2"
|
|
1635
|
-
}, /* @__PURE__ */
|
|
1759
|
+
}, /* @__PURE__ */ React26__namespace.createElement("span", null, error.message), /* @__PURE__ */ React26__namespace.createElement(Button, {
|
|
1636
1760
|
variant: "outline",
|
|
1637
1761
|
size: "sm",
|
|
1638
1762
|
onClick: onRetry,
|
|
1639
1763
|
className: "w-fit"
|
|
1640
|
-
}, /* @__PURE__ */
|
|
1764
|
+
}, /* @__PURE__ */ React26__namespace.createElement(lucideReact.RefreshCw, {
|
|
1641
1765
|
className: "h-4 w-4 mr-2"
|
|
1642
1766
|
}), "Retry")));
|
|
1643
1767
|
}
|
|
1644
|
-
|
|
1768
|
+
chunk2HRO6CFU_js.__name(DefaultError, "DefaultError");
|
|
1645
1769
|
function ResourceView({ uri, refreshInterval, subscribe, transform, loading: loadingContent, error: errorContent, children, className, skip = false }) {
|
|
1646
1770
|
const { data, loading, error, refresh, lastUpdated } = useResource(uri, {
|
|
1647
1771
|
refreshInterval,
|
|
@@ -1657,52 +1781,52 @@ function ResourceView({ uri, refreshInterval, subscribe, transform, loading: loa
|
|
|
1657
1781
|
};
|
|
1658
1782
|
if (loading && data === null) {
|
|
1659
1783
|
if (loadingContent) {
|
|
1660
|
-
return /* @__PURE__ */
|
|
1784
|
+
return /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
1661
1785
|
className
|
|
1662
1786
|
}, loadingContent);
|
|
1663
1787
|
}
|
|
1664
|
-
return /* @__PURE__ */
|
|
1788
|
+
return /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
1665
1789
|
className: cn("flex items-center justify-center p-8", className)
|
|
1666
|
-
}, /* @__PURE__ */
|
|
1790
|
+
}, /* @__PURE__ */ React26__namespace.createElement(lucideReact.Loader2, {
|
|
1667
1791
|
className: "h-8 w-8 animate-spin text-muted-foreground"
|
|
1668
1792
|
}));
|
|
1669
1793
|
}
|
|
1670
1794
|
if (error && data === null) {
|
|
1671
1795
|
if (errorContent) {
|
|
1672
1796
|
if (typeof errorContent === "function") {
|
|
1673
|
-
return /* @__PURE__ */
|
|
1797
|
+
return /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
1674
1798
|
className
|
|
1675
1799
|
}, errorContent(error, refresh));
|
|
1676
1800
|
}
|
|
1677
|
-
return /* @__PURE__ */
|
|
1801
|
+
return /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
1678
1802
|
className
|
|
1679
1803
|
}, errorContent);
|
|
1680
1804
|
}
|
|
1681
|
-
return /* @__PURE__ */
|
|
1805
|
+
return /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
1682
1806
|
className
|
|
1683
|
-
}, /* @__PURE__ */
|
|
1807
|
+
}, /* @__PURE__ */ React26__namespace.createElement(DefaultError, {
|
|
1684
1808
|
error,
|
|
1685
1809
|
onRetry: refresh
|
|
1686
1810
|
}));
|
|
1687
1811
|
}
|
|
1688
1812
|
if (data !== null) {
|
|
1689
|
-
return /* @__PURE__ */
|
|
1813
|
+
return /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
1690
1814
|
className
|
|
1691
1815
|
}, children(data, meta));
|
|
1692
1816
|
}
|
|
1693
|
-
return /* @__PURE__ */
|
|
1817
|
+
return /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
1694
1818
|
className
|
|
1695
|
-
}, loadingContent ?? /* @__PURE__ */
|
|
1819
|
+
}, loadingContent ?? /* @__PURE__ */ React26__namespace.createElement(DefaultLoading, null));
|
|
1696
1820
|
}
|
|
1697
|
-
|
|
1821
|
+
chunk2HRO6CFU_js.__name(ResourceView, "ResourceView");
|
|
1698
1822
|
function useToolStream(options = {}) {
|
|
1699
1823
|
const { toolInputPartial, toolInput, toolResult } = useMcpApp();
|
|
1700
1824
|
const { onPartial, onComplete } = options;
|
|
1701
|
-
const [partial, setPartial] =
|
|
1702
|
-
const [complete, setComplete] =
|
|
1703
|
-
const [isStreaming, setIsStreaming] =
|
|
1704
|
-
const [isComplete, setIsComplete] =
|
|
1705
|
-
|
|
1825
|
+
const [partial, setPartial] = React26.useState(null);
|
|
1826
|
+
const [complete, setComplete] = React26.useState(null);
|
|
1827
|
+
const [isStreaming, setIsStreaming] = React26.useState(false);
|
|
1828
|
+
const [isComplete, setIsComplete] = React26.useState(false);
|
|
1829
|
+
React26.useEffect(() => {
|
|
1706
1830
|
if (toolInputPartial) {
|
|
1707
1831
|
setPartial(toolInputPartial);
|
|
1708
1832
|
setIsStreaming(true);
|
|
@@ -1713,7 +1837,7 @@ function useToolStream(options = {}) {
|
|
|
1713
1837
|
toolInputPartial,
|
|
1714
1838
|
onPartial
|
|
1715
1839
|
]);
|
|
1716
|
-
|
|
1840
|
+
React26.useEffect(() => {
|
|
1717
1841
|
if (toolInput) {
|
|
1718
1842
|
setComplete(toolInput);
|
|
1719
1843
|
setIsStreaming(false);
|
|
@@ -1724,7 +1848,7 @@ function useToolStream(options = {}) {
|
|
|
1724
1848
|
toolInput,
|
|
1725
1849
|
onComplete
|
|
1726
1850
|
]);
|
|
1727
|
-
|
|
1851
|
+
React26.useEffect(() => {
|
|
1728
1852
|
if (toolResult && !toolResult.isError) {
|
|
1729
1853
|
setIsStreaming(false);
|
|
1730
1854
|
setIsComplete(true);
|
|
@@ -1739,13 +1863,13 @@ function useToolStream(options = {}) {
|
|
|
1739
1863
|
isComplete
|
|
1740
1864
|
};
|
|
1741
1865
|
}
|
|
1742
|
-
|
|
1866
|
+
chunk2HRO6CFU_js.__name(useToolStream, "useToolStream");
|
|
1743
1867
|
function Progress({ className, value, ...props }) {
|
|
1744
|
-
return /* @__PURE__ */
|
|
1868
|
+
return /* @__PURE__ */ React26__namespace.createElement(ProgressPrimitive__namespace.Root, {
|
|
1745
1869
|
"data-slot": "progress",
|
|
1746
1870
|
className: cn("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full", className),
|
|
1747
1871
|
...props
|
|
1748
|
-
}, /* @__PURE__ */
|
|
1872
|
+
}, /* @__PURE__ */ React26__namespace.createElement(ProgressPrimitive__namespace.Indicator, {
|
|
1749
1873
|
"data-slot": "progress-indicator",
|
|
1750
1874
|
className: "bg-primary h-full w-full flex-1 transition-all",
|
|
1751
1875
|
style: {
|
|
@@ -1753,7 +1877,7 @@ function Progress({ className, value, ...props }) {
|
|
|
1753
1877
|
}
|
|
1754
1878
|
}));
|
|
1755
1879
|
}
|
|
1756
|
-
|
|
1880
|
+
chunk2HRO6CFU_js.__name(Progress, "Progress");
|
|
1757
1881
|
|
|
1758
1882
|
// src/mcp/StreamingContent.tsx
|
|
1759
1883
|
function StreamingContent({ fallback, showProgress = false, progress: externalProgress, onPartial, onComplete, children, className, streamingStyle = "opacity" }) {
|
|
@@ -1764,106 +1888,106 @@ function StreamingContent({ fallback, showProgress = false, progress: externalPr
|
|
|
1764
1888
|
const data = complete ?? partial;
|
|
1765
1889
|
if (!data) {
|
|
1766
1890
|
if (fallback) {
|
|
1767
|
-
return /* @__PURE__ */
|
|
1891
|
+
return /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
1768
1892
|
className
|
|
1769
1893
|
}, fallback);
|
|
1770
1894
|
}
|
|
1771
|
-
return /* @__PURE__ */
|
|
1895
|
+
return /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
1772
1896
|
className: cn("flex items-center justify-center p-8", className)
|
|
1773
|
-
}, /* @__PURE__ */
|
|
1897
|
+
}, /* @__PURE__ */ React26__namespace.createElement(lucideReact.Loader2, {
|
|
1774
1898
|
className: "h-6 w-6 animate-spin text-muted-foreground"
|
|
1775
1899
|
}));
|
|
1776
1900
|
}
|
|
1777
1901
|
const streamingClasses = cn(streamingStyle === "opacity" && isStreaming && "opacity-70", streamingStyle === "blur" && isStreaming && "blur-[1px]");
|
|
1778
|
-
return /* @__PURE__ */
|
|
1902
|
+
return /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
1779
1903
|
className: cn("relative", className)
|
|
1780
|
-
}, showProgress && isStreaming && /* @__PURE__ */
|
|
1904
|
+
}, showProgress && isStreaming && /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
1781
1905
|
className: "absolute top-0 left-0 right-0 z-10"
|
|
1782
|
-
}, externalProgress !== void 0 ? /* @__PURE__ */
|
|
1906
|
+
}, externalProgress !== void 0 ? /* @__PURE__ */ React26__namespace.createElement(Progress, {
|
|
1783
1907
|
value: externalProgress,
|
|
1784
1908
|
className: "h-1"
|
|
1785
|
-
}) : /* @__PURE__ */
|
|
1909
|
+
}) : /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
1786
1910
|
className: "h-1 bg-primary/20 overflow-hidden"
|
|
1787
|
-
}, /* @__PURE__ */
|
|
1911
|
+
}, /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
1788
1912
|
className: "h-full w-1/3 bg-primary animate-[shimmer_1s_infinite]"
|
|
1789
|
-
}))), isStreaming && /* @__PURE__ */
|
|
1913
|
+
}))), isStreaming && /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
1790
1914
|
className: "absolute top-2 right-2 z-10"
|
|
1791
|
-
}, /* @__PURE__ */
|
|
1915
|
+
}, /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
1792
1916
|
className: "flex items-center gap-1 px-2 py-1 rounded-full bg-muted text-muted-foreground text-xs"
|
|
1793
|
-
}, /* @__PURE__ */
|
|
1917
|
+
}, /* @__PURE__ */ React26__namespace.createElement(lucideReact.Loader2, {
|
|
1794
1918
|
className: "h-3 w-3 animate-spin"
|
|
1795
|
-
}), /* @__PURE__ */
|
|
1919
|
+
}), /* @__PURE__ */ React26__namespace.createElement("span", null, "Streaming..."))), /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
1796
1920
|
className: cn("transition-all duration-200", streamingClasses)
|
|
1797
1921
|
}, children(data, isComplete)));
|
|
1798
1922
|
}
|
|
1799
|
-
|
|
1923
|
+
chunk2HRO6CFU_js.__name(StreamingContent, "StreamingContent");
|
|
1800
1924
|
function Table({ className, ...props }) {
|
|
1801
|
-
return /* @__PURE__ */
|
|
1925
|
+
return /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
1802
1926
|
"data-slot": "table-container",
|
|
1803
1927
|
className: "relative w-full overflow-x-auto"
|
|
1804
|
-
}, /* @__PURE__ */
|
|
1928
|
+
}, /* @__PURE__ */ React26__namespace.createElement("table", {
|
|
1805
1929
|
"data-slot": "table",
|
|
1806
1930
|
className: cn("w-full caption-bottom text-sm", className),
|
|
1807
1931
|
...props
|
|
1808
1932
|
}));
|
|
1809
1933
|
}
|
|
1810
|
-
|
|
1934
|
+
chunk2HRO6CFU_js.__name(Table, "Table");
|
|
1811
1935
|
function TableHeader({ className, ...props }) {
|
|
1812
|
-
return /* @__PURE__ */
|
|
1936
|
+
return /* @__PURE__ */ React26__namespace.createElement("thead", {
|
|
1813
1937
|
"data-slot": "table-header",
|
|
1814
1938
|
className: cn("[&_tr]:border-b", className),
|
|
1815
1939
|
...props
|
|
1816
1940
|
});
|
|
1817
1941
|
}
|
|
1818
|
-
|
|
1942
|
+
chunk2HRO6CFU_js.__name(TableHeader, "TableHeader");
|
|
1819
1943
|
function TableBody({ className, ...props }) {
|
|
1820
|
-
return /* @__PURE__ */
|
|
1944
|
+
return /* @__PURE__ */ React26__namespace.createElement("tbody", {
|
|
1821
1945
|
"data-slot": "table-body",
|
|
1822
1946
|
className: cn("[&_tr:last-child]:border-0", className),
|
|
1823
1947
|
...props
|
|
1824
1948
|
});
|
|
1825
1949
|
}
|
|
1826
|
-
|
|
1950
|
+
chunk2HRO6CFU_js.__name(TableBody, "TableBody");
|
|
1827
1951
|
function TableFooter({ className, ...props }) {
|
|
1828
|
-
return /* @__PURE__ */
|
|
1952
|
+
return /* @__PURE__ */ React26__namespace.createElement("tfoot", {
|
|
1829
1953
|
"data-slot": "table-footer",
|
|
1830
1954
|
className: cn("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0", className),
|
|
1831
1955
|
...props
|
|
1832
1956
|
});
|
|
1833
1957
|
}
|
|
1834
|
-
|
|
1958
|
+
chunk2HRO6CFU_js.__name(TableFooter, "TableFooter");
|
|
1835
1959
|
function TableRow({ className, ...props }) {
|
|
1836
|
-
return /* @__PURE__ */
|
|
1960
|
+
return /* @__PURE__ */ React26__namespace.createElement("tr", {
|
|
1837
1961
|
"data-slot": "table-row",
|
|
1838
1962
|
className: cn("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors", className),
|
|
1839
1963
|
...props
|
|
1840
1964
|
});
|
|
1841
1965
|
}
|
|
1842
|
-
|
|
1966
|
+
chunk2HRO6CFU_js.__name(TableRow, "TableRow");
|
|
1843
1967
|
function TableHead({ className, ...props }) {
|
|
1844
|
-
return /* @__PURE__ */
|
|
1968
|
+
return /* @__PURE__ */ React26__namespace.createElement("th", {
|
|
1845
1969
|
"data-slot": "table-head",
|
|
1846
1970
|
className: cn("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className),
|
|
1847
1971
|
...props
|
|
1848
1972
|
});
|
|
1849
1973
|
}
|
|
1850
|
-
|
|
1974
|
+
chunk2HRO6CFU_js.__name(TableHead, "TableHead");
|
|
1851
1975
|
function TableCell({ className, ...props }) {
|
|
1852
|
-
return /* @__PURE__ */
|
|
1976
|
+
return /* @__PURE__ */ React26__namespace.createElement("td", {
|
|
1853
1977
|
"data-slot": "table-cell",
|
|
1854
1978
|
className: cn("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className),
|
|
1855
1979
|
...props
|
|
1856
1980
|
});
|
|
1857
1981
|
}
|
|
1858
|
-
|
|
1982
|
+
chunk2HRO6CFU_js.__name(TableCell, "TableCell");
|
|
1859
1983
|
function TableCaption({ className, ...props }) {
|
|
1860
|
-
return /* @__PURE__ */
|
|
1984
|
+
return /* @__PURE__ */ React26__namespace.createElement("caption", {
|
|
1861
1985
|
"data-slot": "table-caption",
|
|
1862
1986
|
className: cn("text-muted-foreground mt-4 text-sm", className),
|
|
1863
1987
|
...props
|
|
1864
1988
|
});
|
|
1865
1989
|
}
|
|
1866
|
-
|
|
1990
|
+
chunk2HRO6CFU_js.__name(TableCaption, "TableCaption");
|
|
1867
1991
|
function getNestedValue(obj, path) {
|
|
1868
1992
|
return path.split(".").reduce((current, key) => {
|
|
1869
1993
|
if (current && typeof current === "object" && key in current) {
|
|
@@ -1872,7 +1996,7 @@ function getNestedValue(obj, path) {
|
|
|
1872
1996
|
return void 0;
|
|
1873
1997
|
}, obj);
|
|
1874
1998
|
}
|
|
1875
|
-
|
|
1999
|
+
chunk2HRO6CFU_js.__name(getNestedValue, "getNestedValue");
|
|
1876
2000
|
function ToolDataGrid({ dataTool, columns, transformData, rowActions = [], pagination = true, pageSizes = [
|
|
1877
2001
|
10,
|
|
1878
2002
|
25,
|
|
@@ -1885,28 +2009,28 @@ function ToolDataGrid({ dataTool, columns, transformData, rowActions = [], pagin
|
|
|
1885
2009
|
const toolConfig = typeof dataTool === "string" ? {
|
|
1886
2010
|
name: dataTool
|
|
1887
2011
|
} : dataTool;
|
|
1888
|
-
const [data, setData] =
|
|
2012
|
+
const [data, setData] = React26.useState({
|
|
1889
2013
|
rows: [],
|
|
1890
2014
|
total: 0
|
|
1891
2015
|
});
|
|
1892
|
-
const [paginationState, setPaginationState] =
|
|
2016
|
+
const [paginationState, setPaginationState] = React26.useState({
|
|
1893
2017
|
page: 1,
|
|
1894
2018
|
pageSize: defaultPageSize
|
|
1895
2019
|
});
|
|
1896
|
-
const [sortState, setSortState] =
|
|
2020
|
+
const [sortState, setSortState] = React26.useState(defaultSort ?? {
|
|
1897
2021
|
column: null,
|
|
1898
2022
|
direction: "asc"
|
|
1899
2023
|
});
|
|
1900
2024
|
const { call, loading, error } = useTool(toolConfig.name, {
|
|
1901
2025
|
defaultArgs: toolConfig.args,
|
|
1902
|
-
onSuccess: /* @__PURE__ */
|
|
2026
|
+
onSuccess: /* @__PURE__ */ chunk2HRO6CFU_js.__name((result) => {
|
|
1903
2027
|
const gridData = transformData ? transformData(result) : result;
|
|
1904
2028
|
setData(gridData);
|
|
1905
2029
|
onDataLoaded?.(gridData);
|
|
1906
2030
|
}, "onSuccess"),
|
|
1907
2031
|
onError
|
|
1908
2032
|
});
|
|
1909
|
-
const fetchData =
|
|
2033
|
+
const fetchData = React26.useCallback(() => {
|
|
1910
2034
|
const args = {};
|
|
1911
2035
|
if (pagination) {
|
|
1912
2036
|
args.page = paginationState.page;
|
|
@@ -1926,12 +2050,12 @@ function ToolDataGrid({ dataTool, columns, transformData, rowActions = [], pagin
|
|
|
1926
2050
|
paginationState,
|
|
1927
2051
|
sortState
|
|
1928
2052
|
]);
|
|
1929
|
-
const initialFetchDone =
|
|
1930
|
-
const prevStateRef =
|
|
2053
|
+
const initialFetchDone = React26__namespace.useRef(false);
|
|
2054
|
+
const prevStateRef = React26__namespace.useRef({
|
|
1931
2055
|
pagination: paginationState,
|
|
1932
2056
|
sort: sortState
|
|
1933
2057
|
});
|
|
1934
|
-
|
|
2058
|
+
React26.useEffect(() => {
|
|
1935
2059
|
if (!initialFetchDone.current) {
|
|
1936
2060
|
initialFetchDone.current = true;
|
|
1937
2061
|
fetchData();
|
|
@@ -1951,7 +2075,7 @@ function ToolDataGrid({ dataTool, columns, transformData, rowActions = [], pagin
|
|
|
1951
2075
|
paginationState,
|
|
1952
2076
|
sortState
|
|
1953
2077
|
]);
|
|
1954
|
-
|
|
2078
|
+
React26.useEffect(() => {
|
|
1955
2079
|
if (refreshInterval && refreshInterval > 0) {
|
|
1956
2080
|
const interval = setInterval(fetchData, refreshInterval);
|
|
1957
2081
|
return () => clearInterval(interval);
|
|
@@ -1960,19 +2084,19 @@ function ToolDataGrid({ dataTool, columns, transformData, rowActions = [], pagin
|
|
|
1960
2084
|
refreshInterval,
|
|
1961
2085
|
fetchData
|
|
1962
2086
|
]);
|
|
1963
|
-
const handleSort =
|
|
2087
|
+
const handleSort = React26.useCallback((column) => {
|
|
1964
2088
|
setSortState((prev) => ({
|
|
1965
2089
|
column,
|
|
1966
2090
|
direction: prev.column === column && prev.direction === "asc" ? "desc" : "asc"
|
|
1967
2091
|
}));
|
|
1968
2092
|
}, []);
|
|
1969
|
-
const handlePageChange =
|
|
2093
|
+
const handlePageChange = React26.useCallback((page) => {
|
|
1970
2094
|
setPaginationState((prev) => ({
|
|
1971
2095
|
...prev,
|
|
1972
2096
|
page
|
|
1973
2097
|
}));
|
|
1974
2098
|
}, []);
|
|
1975
|
-
const handlePageSizeChange =
|
|
2099
|
+
const handlePageSizeChange = React26.useCallback((pageSize) => {
|
|
1976
2100
|
setPaginationState({
|
|
1977
2101
|
page: 1,
|
|
1978
2102
|
pageSize: parseInt(pageSize, 10)
|
|
@@ -1981,135 +2105,135 @@ function ToolDataGrid({ dataTool, columns, transformData, rowActions = [], pagin
|
|
|
1981
2105
|
const totalPages = Math.ceil(data.total / paginationState.pageSize);
|
|
1982
2106
|
const canPreviousPage = paginationState.page > 1;
|
|
1983
2107
|
const canNextPage = paginationState.page < totalPages;
|
|
1984
|
-
const getSortIcon = /* @__PURE__ */
|
|
2108
|
+
const getSortIcon = /* @__PURE__ */ chunk2HRO6CFU_js.__name((column) => {
|
|
1985
2109
|
if (sortState.column !== column) {
|
|
1986
|
-
return /* @__PURE__ */
|
|
2110
|
+
return /* @__PURE__ */ React26__namespace.createElement(lucideReact.ArrowUpDown, {
|
|
1987
2111
|
className: "h-4 w-4"
|
|
1988
2112
|
});
|
|
1989
2113
|
}
|
|
1990
|
-
return sortState.direction === "asc" ? /* @__PURE__ */
|
|
2114
|
+
return sortState.direction === "asc" ? /* @__PURE__ */ React26__namespace.createElement(lucideReact.ArrowUp, {
|
|
1991
2115
|
className: "h-4 w-4"
|
|
1992
|
-
}) : /* @__PURE__ */
|
|
2116
|
+
}) : /* @__PURE__ */ React26__namespace.createElement(lucideReact.ArrowDown, {
|
|
1993
2117
|
className: "h-4 w-4"
|
|
1994
2118
|
});
|
|
1995
2119
|
}, "getSortIcon");
|
|
1996
|
-
const renderLoading = /* @__PURE__ */
|
|
2120
|
+
const renderLoading = /* @__PURE__ */ chunk2HRO6CFU_js.__name(() => {
|
|
1997
2121
|
if (loadingContent) return loadingContent;
|
|
1998
|
-
return /* @__PURE__ */
|
|
2122
|
+
return /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
1999
2123
|
className: "space-y-2"
|
|
2000
2124
|
}, Array.from({
|
|
2001
2125
|
length: 5
|
|
2002
|
-
}).map((_, i) => /* @__PURE__ */
|
|
2126
|
+
}).map((_, i) => /* @__PURE__ */ React26__namespace.createElement(Skeleton, {
|
|
2003
2127
|
key: i,
|
|
2004
2128
|
className: "h-12 w-full"
|
|
2005
2129
|
})));
|
|
2006
2130
|
}, "renderLoading");
|
|
2007
|
-
const renderEmpty = /* @__PURE__ */
|
|
2131
|
+
const renderEmpty = /* @__PURE__ */ chunk2HRO6CFU_js.__name(() => {
|
|
2008
2132
|
if (emptyContent) return emptyContent;
|
|
2009
|
-
return /* @__PURE__ */
|
|
2133
|
+
return /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
2010
2134
|
className: "flex flex-col items-center justify-center py-12 text-muted-foreground"
|
|
2011
|
-
}, /* @__PURE__ */
|
|
2135
|
+
}, /* @__PURE__ */ React26__namespace.createElement("p", {
|
|
2012
2136
|
className: "text-lg"
|
|
2013
|
-
}, "No data found"), /* @__PURE__ */
|
|
2137
|
+
}, "No data found"), /* @__PURE__ */ React26__namespace.createElement(Button, {
|
|
2014
2138
|
variant: "ghost",
|
|
2015
2139
|
size: "sm",
|
|
2016
2140
|
onClick: fetchData,
|
|
2017
2141
|
className: "mt-2"
|
|
2018
|
-
}, /* @__PURE__ */
|
|
2142
|
+
}, /* @__PURE__ */ React26__namespace.createElement(lucideReact.RefreshCw, {
|
|
2019
2143
|
className: "h-4 w-4 mr-2"
|
|
2020
2144
|
}), "Refresh"));
|
|
2021
2145
|
}, "renderEmpty");
|
|
2022
|
-
return /* @__PURE__ */
|
|
2146
|
+
return /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
2023
2147
|
className: cn("space-y-4", className)
|
|
2024
|
-
}, showRefresh && /* @__PURE__ */
|
|
2148
|
+
}, showRefresh && /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
2025
2149
|
className: "flex items-center justify-end gap-2"
|
|
2026
|
-
}, /* @__PURE__ */
|
|
2150
|
+
}, /* @__PURE__ */ React26__namespace.createElement(Button, {
|
|
2027
2151
|
variant: "outline",
|
|
2028
2152
|
size: "sm",
|
|
2029
2153
|
onClick: fetchData,
|
|
2030
2154
|
disabled: loading
|
|
2031
|
-
}, loading ? /* @__PURE__ */
|
|
2155
|
+
}, loading ? /* @__PURE__ */ React26__namespace.createElement(lucideReact.Loader2, {
|
|
2032
2156
|
className: "h-4 w-4 animate-spin"
|
|
2033
|
-
}) : /* @__PURE__ */
|
|
2157
|
+
}) : /* @__PURE__ */ React26__namespace.createElement(lucideReact.RefreshCw, {
|
|
2034
2158
|
className: "h-4 w-4"
|
|
2035
|
-
}), /* @__PURE__ */
|
|
2159
|
+
}), /* @__PURE__ */ React26__namespace.createElement("span", {
|
|
2036
2160
|
className: "ml-2"
|
|
2037
|
-
}, "Refresh"))), /* @__PURE__ */
|
|
2161
|
+
}, "Refresh"))), /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
2038
2162
|
className: "rounded-md border"
|
|
2039
|
-
}, loading && data.rows.length === 0 ? /* @__PURE__ */
|
|
2163
|
+
}, loading && data.rows.length === 0 ? /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
2040
2164
|
className: "p-4"
|
|
2041
|
-
}, renderLoading()) : data.rows.length === 0 ? renderEmpty() : /* @__PURE__ */
|
|
2165
|
+
}, renderLoading()) : data.rows.length === 0 ? renderEmpty() : /* @__PURE__ */ React26__namespace.createElement(Table, null, /* @__PURE__ */ React26__namespace.createElement(TableHeader, null, /* @__PURE__ */ React26__namespace.createElement(TableRow, null, columns.map((column) => /* @__PURE__ */ React26__namespace.createElement(TableHead, {
|
|
2042
2166
|
key: column.key,
|
|
2043
2167
|
style: {
|
|
2044
2168
|
width: column.width
|
|
2045
2169
|
},
|
|
2046
2170
|
className: cn(column.align === "center" && "text-center", column.align === "right" && "text-right", column.hideMobile && "hidden md:table-cell")
|
|
2047
|
-
}, column.sortable ? /* @__PURE__ */
|
|
2171
|
+
}, column.sortable ? /* @__PURE__ */ React26__namespace.createElement(Button, {
|
|
2048
2172
|
variant: "ghost",
|
|
2049
2173
|
size: "sm",
|
|
2050
|
-
onClick: /* @__PURE__ */
|
|
2174
|
+
onClick: /* @__PURE__ */ chunk2HRO6CFU_js.__name(() => handleSort(column.key), "onClick"),
|
|
2051
2175
|
className: "-ml-3"
|
|
2052
|
-
}, column.header, getSortIcon(column.key)) : column.header)), rowActions.length > 0 && /* @__PURE__ */
|
|
2176
|
+
}, column.header, getSortIcon(column.key)) : column.header)), rowActions.length > 0 && /* @__PURE__ */ React26__namespace.createElement(TableHead, {
|
|
2053
2177
|
className: "w-[100px]"
|
|
2054
|
-
}, "Actions"))), /* @__PURE__ */
|
|
2178
|
+
}, "Actions"))), /* @__PURE__ */ React26__namespace.createElement(TableBody, null, data.rows.map((row, index) => {
|
|
2055
2179
|
const key = getRowKey?.(row, index) ?? String(index);
|
|
2056
|
-
return /* @__PURE__ */
|
|
2180
|
+
return /* @__PURE__ */ React26__namespace.createElement(TableRow, {
|
|
2057
2181
|
key,
|
|
2058
|
-
onClick: /* @__PURE__ */
|
|
2182
|
+
onClick: /* @__PURE__ */ chunk2HRO6CFU_js.__name(() => onRowClick?.(row, index), "onClick"),
|
|
2059
2183
|
className: onRowClick ? "cursor-pointer" : void 0
|
|
2060
2184
|
}, columns.map((column) => {
|
|
2061
2185
|
const value = getNestedValue(row, column.key);
|
|
2062
|
-
return /* @__PURE__ */
|
|
2186
|
+
return /* @__PURE__ */ React26__namespace.createElement(TableCell, {
|
|
2063
2187
|
key: column.key,
|
|
2064
2188
|
className: cn(column.align === "center" && "text-center", column.align === "right" && "text-right", column.hideMobile && "hidden md:table-cell")
|
|
2065
2189
|
}, column.render ? column.render(value, row, index) : String(value ?? ""));
|
|
2066
|
-
}), rowActions.length > 0 && /* @__PURE__ */
|
|
2190
|
+
}), rowActions.length > 0 && /* @__PURE__ */ React26__namespace.createElement(TableCell, null, /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
2067
2191
|
className: "flex items-center gap-1"
|
|
2068
|
-
}, rowActions.filter((action) => !action.hidden?.(row)).map((action, actionIndex) => /* @__PURE__ */
|
|
2192
|
+
}, rowActions.filter((action) => !action.hidden?.(row)).map((action, actionIndex) => /* @__PURE__ */ React26__namespace.createElement(RowActionButton, {
|
|
2069
2193
|
key: actionIndex,
|
|
2070
2194
|
action,
|
|
2071
2195
|
row,
|
|
2072
2196
|
onRefresh: fetchData
|
|
2073
2197
|
})))));
|
|
2074
|
-
})))), pagination && data.total > 0 && /* @__PURE__ */
|
|
2198
|
+
})))), pagination && data.total > 0 && /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
2075
2199
|
className: "flex items-center justify-between"
|
|
2076
|
-
}, /* @__PURE__ */
|
|
2200
|
+
}, /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
2077
2201
|
className: "text-sm text-muted-foreground"
|
|
2078
|
-
}, "Showing ", (paginationState.page - 1) * paginationState.pageSize + 1, " to", " ", Math.min(paginationState.page * paginationState.pageSize, data.total), " of", " ", data.total, " results"), /* @__PURE__ */
|
|
2202
|
+
}, "Showing ", (paginationState.page - 1) * paginationState.pageSize + 1, " to", " ", Math.min(paginationState.page * paginationState.pageSize, data.total), " of", " ", data.total, " results"), /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
2079
2203
|
className: "flex items-center gap-4"
|
|
2080
|
-
}, /* @__PURE__ */
|
|
2204
|
+
}, /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
2081
2205
|
className: "flex items-center gap-2"
|
|
2082
|
-
}, /* @__PURE__ */
|
|
2206
|
+
}, /* @__PURE__ */ React26__namespace.createElement("span", {
|
|
2083
2207
|
className: "text-sm text-muted-foreground"
|
|
2084
|
-
}, "Rows per page"), /* @__PURE__ */
|
|
2208
|
+
}, "Rows per page"), /* @__PURE__ */ React26__namespace.createElement(Select, {
|
|
2085
2209
|
value: String(paginationState.pageSize),
|
|
2086
2210
|
onValueChange: handlePageSizeChange
|
|
2087
|
-
}, /* @__PURE__ */
|
|
2211
|
+
}, /* @__PURE__ */ React26__namespace.createElement(SelectTrigger, {
|
|
2088
2212
|
className: "w-[70px]"
|
|
2089
|
-
}, /* @__PURE__ */
|
|
2213
|
+
}, /* @__PURE__ */ React26__namespace.createElement(SelectValue, null)), /* @__PURE__ */ React26__namespace.createElement(SelectContent, null, pageSizes.map((size) => /* @__PURE__ */ React26__namespace.createElement(SelectItem, {
|
|
2090
2214
|
key: size,
|
|
2091
2215
|
value: String(size)
|
|
2092
|
-
}, size))))), /* @__PURE__ */
|
|
2216
|
+
}, size))))), /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
2093
2217
|
className: "flex items-center gap-2"
|
|
2094
|
-
}, /* @__PURE__ */
|
|
2218
|
+
}, /* @__PURE__ */ React26__namespace.createElement(Button, {
|
|
2095
2219
|
variant: "outline",
|
|
2096
2220
|
size: "sm",
|
|
2097
|
-
onClick: /* @__PURE__ */
|
|
2221
|
+
onClick: /* @__PURE__ */ chunk2HRO6CFU_js.__name(() => handlePageChange(paginationState.page - 1), "onClick"),
|
|
2098
2222
|
disabled: !canPreviousPage || loading
|
|
2099
|
-
}, /* @__PURE__ */
|
|
2223
|
+
}, /* @__PURE__ */ React26__namespace.createElement(lucideReact.ChevronLeft, {
|
|
2100
2224
|
className: "h-4 w-4"
|
|
2101
|
-
})), /* @__PURE__ */
|
|
2225
|
+
})), /* @__PURE__ */ React26__namespace.createElement("span", {
|
|
2102
2226
|
className: "text-sm"
|
|
2103
|
-
}, "Page ", paginationState.page, " of ", totalPages), /* @__PURE__ */
|
|
2227
|
+
}, "Page ", paginationState.page, " of ", totalPages), /* @__PURE__ */ React26__namespace.createElement(Button, {
|
|
2104
2228
|
variant: "outline",
|
|
2105
2229
|
size: "sm",
|
|
2106
|
-
onClick: /* @__PURE__ */
|
|
2230
|
+
onClick: /* @__PURE__ */ chunk2HRO6CFU_js.__name(() => handlePageChange(paginationState.page + 1), "onClick"),
|
|
2107
2231
|
disabled: !canNextPage || loading
|
|
2108
|
-
}, /* @__PURE__ */
|
|
2232
|
+
}, /* @__PURE__ */ React26__namespace.createElement(lucideReact.ChevronRight, {
|
|
2109
2233
|
className: "h-4 w-4"
|
|
2110
2234
|
}))))));
|
|
2111
2235
|
}
|
|
2112
|
-
|
|
2236
|
+
chunk2HRO6CFU_js.__name(ToolDataGrid, "ToolDataGrid");
|
|
2113
2237
|
function RowActionButton({ action, row, onRefresh }) {
|
|
2114
2238
|
if (!action.tool) {
|
|
2115
2239
|
throw new Error("ToolDataGrid: rowAction.tool is required");
|
|
@@ -2121,49 +2245,49 @@ function RowActionButton({ action, row, onRefresh }) {
|
|
|
2121
2245
|
id: row.id
|
|
2122
2246
|
};
|
|
2123
2247
|
const { call, loading } = useTool(toolConfig.name, {
|
|
2124
|
-
onSuccess: /* @__PURE__ */
|
|
2248
|
+
onSuccess: /* @__PURE__ */ chunk2HRO6CFU_js.__name((result) => {
|
|
2125
2249
|
action.onSuccess?.(result, row);
|
|
2126
2250
|
sonner.toast.success("Action completed");
|
|
2127
2251
|
onRefresh();
|
|
2128
2252
|
}, "onSuccess"),
|
|
2129
|
-
onError: /* @__PURE__ */
|
|
2253
|
+
onError: /* @__PURE__ */ chunk2HRO6CFU_js.__name((error) => {
|
|
2130
2254
|
sonner.toast.error(error.message);
|
|
2131
2255
|
}, "onError")
|
|
2132
2256
|
});
|
|
2133
|
-
const handleClick =
|
|
2257
|
+
const handleClick = React26.useCallback((e) => {
|
|
2134
2258
|
e.stopPropagation();
|
|
2135
2259
|
call(args);
|
|
2136
2260
|
}, [
|
|
2137
2261
|
call,
|
|
2138
2262
|
args
|
|
2139
2263
|
]);
|
|
2140
|
-
return /* @__PURE__ */
|
|
2264
|
+
return /* @__PURE__ */ React26__namespace.createElement(Button, {
|
|
2141
2265
|
variant: action.variant ?? "ghost",
|
|
2142
2266
|
size: "sm",
|
|
2143
2267
|
onClick: handleClick,
|
|
2144
2268
|
disabled: loading
|
|
2145
|
-
}, loading ? /* @__PURE__ */
|
|
2269
|
+
}, loading ? /* @__PURE__ */ React26__namespace.createElement(lucideReact.Loader2, {
|
|
2146
2270
|
className: "h-3 w-3 animate-spin"
|
|
2147
|
-
}) : /* @__PURE__ */
|
|
2271
|
+
}) : /* @__PURE__ */ React26__namespace.createElement(React26__namespace.Fragment, null, action.icon, /* @__PURE__ */ React26__namespace.createElement("span", {
|
|
2148
2272
|
className: action.icon ? "ml-1" : ""
|
|
2149
2273
|
}, action.label)));
|
|
2150
2274
|
}
|
|
2151
|
-
|
|
2152
|
-
var Button2 = /* @__PURE__ */
|
|
2275
|
+
chunk2HRO6CFU_js.__name(RowActionButton, "RowActionButton");
|
|
2276
|
+
var Button2 = /* @__PURE__ */ React26.forwardRef(({ className, variant = "primary", size = "md", loading = false, disabled, asChild = false, leftIcon, rightIcon, children, ...props }, ref) => {
|
|
2153
2277
|
const Comp = asChild ? reactSlot.Slot : "button";
|
|
2154
|
-
return /* @__PURE__ */
|
|
2278
|
+
return /* @__PURE__ */ React26__namespace.default.createElement(Comp, {
|
|
2155
2279
|
ref,
|
|
2156
2280
|
className: clsx.clsx("lui-button", `lui-button--${variant}`, `lui-button--${size}`, loading && "lui-button--loading", className),
|
|
2157
2281
|
disabled: disabled || loading,
|
|
2158
2282
|
...props
|
|
2159
|
-
}, loading && /* @__PURE__ */
|
|
2283
|
+
}, loading && /* @__PURE__ */ React26__namespace.default.createElement("span", {
|
|
2160
2284
|
className: "lui-button__spinner",
|
|
2161
2285
|
"aria-hidden": "true"
|
|
2162
|
-
}, /* @__PURE__ */
|
|
2286
|
+
}, /* @__PURE__ */ React26__namespace.default.createElement("svg", {
|
|
2163
2287
|
viewBox: "0 0 24 24",
|
|
2164
2288
|
fill: "none",
|
|
2165
2289
|
className: "lui-spinner-icon"
|
|
2166
|
-
}, /* @__PURE__ */
|
|
2290
|
+
}, /* @__PURE__ */ React26__namespace.default.createElement("circle", {
|
|
2167
2291
|
cx: "12",
|
|
2168
2292
|
cy: "12",
|
|
2169
2293
|
r: "10",
|
|
@@ -2172,11 +2296,11 @@ var Button2 = /* @__PURE__ */ React25.forwardRef(({ className, variant = "primar
|
|
|
2172
2296
|
strokeLinecap: "round",
|
|
2173
2297
|
strokeDasharray: "32",
|
|
2174
2298
|
strokeDashoffset: "12"
|
|
2175
|
-
}))), leftIcon && !loading && /* @__PURE__ */
|
|
2299
|
+
}))), leftIcon && !loading && /* @__PURE__ */ React26__namespace.default.createElement("span", {
|
|
2176
2300
|
className: "lui-button__icon"
|
|
2177
|
-
}, leftIcon), /* @__PURE__ */
|
|
2301
|
+
}, leftIcon), /* @__PURE__ */ React26__namespace.default.createElement("span", {
|
|
2178
2302
|
className: "lui-button__content"
|
|
2179
|
-
}, children), rightIcon && /* @__PURE__ */
|
|
2303
|
+
}, children), rightIcon && /* @__PURE__ */ React26__namespace.default.createElement("span", {
|
|
2180
2304
|
className: "lui-button__icon"
|
|
2181
2305
|
}, rightIcon));
|
|
2182
2306
|
});
|
|
@@ -2185,8 +2309,8 @@ Button2.displayName = "Button";
|
|
|
2185
2309
|
// src/mcp/ActionButton.tsx
|
|
2186
2310
|
function ActionButton({ toolName, toolArgs = {}, onToolSuccess, onToolError, showResult = false, renderResult, children, ...buttonProps }) {
|
|
2187
2311
|
const { call, loading, result, error } = useTool(toolName);
|
|
2188
|
-
const [hasResult, setHasResult] =
|
|
2189
|
-
const handleClick = /* @__PURE__ */
|
|
2312
|
+
const [hasResult, setHasResult] = React26.useState(false);
|
|
2313
|
+
const handleClick = /* @__PURE__ */ chunk2HRO6CFU_js.__name(async () => {
|
|
2190
2314
|
try {
|
|
2191
2315
|
const res = await call(toolArgs);
|
|
2192
2316
|
setHasResult(true);
|
|
@@ -2195,110 +2319,119 @@ function ActionButton({ toolName, toolArgs = {}, onToolSuccess, onToolError, sho
|
|
|
2195
2319
|
onToolError?.(err instanceof Error ? err : new Error(String(err)));
|
|
2196
2320
|
}
|
|
2197
2321
|
}, "handleClick");
|
|
2198
|
-
return /* @__PURE__ */
|
|
2322
|
+
return /* @__PURE__ */ React26__namespace.default.createElement("div", {
|
|
2199
2323
|
className: "lui-action-button-wrapper"
|
|
2200
|
-
}, /* @__PURE__ */
|
|
2324
|
+
}, /* @__PURE__ */ React26__namespace.default.createElement(Button2, {
|
|
2201
2325
|
...buttonProps,
|
|
2202
2326
|
loading,
|
|
2203
2327
|
onClick: handleClick
|
|
2204
|
-
}, children), showResult && hasResult && result !== null && /* @__PURE__ */
|
|
2328
|
+
}, children), showResult && hasResult && result !== null && /* @__PURE__ */ React26__namespace.default.createElement("div", {
|
|
2205
2329
|
className: "lui-action-button-result"
|
|
2206
|
-
}, renderResult ? renderResult(result) : /* @__PURE__ */
|
|
2330
|
+
}, renderResult ? renderResult(result) : /* @__PURE__ */ React26__namespace.default.createElement("pre", null, JSON.stringify(result, null, 2))), error && /* @__PURE__ */ React26__namespace.default.createElement("div", {
|
|
2207
2331
|
className: "lui-action-button-error"
|
|
2208
2332
|
}, error.message));
|
|
2209
2333
|
}
|
|
2210
|
-
|
|
2334
|
+
chunk2HRO6CFU_js.__name(ActionButton, "ActionButton");
|
|
2211
2335
|
function DefaultLoading2() {
|
|
2212
|
-
return /* @__PURE__ */
|
|
2336
|
+
return /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
2213
2337
|
className: "flex items-center justify-center p-8"
|
|
2214
|
-
}, /* @__PURE__ */
|
|
2338
|
+
}, /* @__PURE__ */ React26__namespace.createElement(lucideReact.Loader2, {
|
|
2215
2339
|
className: "h-6 w-6 animate-spin text-muted-foreground"
|
|
2216
2340
|
}));
|
|
2217
2341
|
}
|
|
2218
|
-
|
|
2342
|
+
chunk2HRO6CFU_js.__name(DefaultLoading2, "DefaultLoading");
|
|
2219
2343
|
function DefaultDisconnected() {
|
|
2220
|
-
return /* @__PURE__ */
|
|
2344
|
+
return /* @__PURE__ */ React26__namespace.createElement(Alert, null, /* @__PURE__ */ React26__namespace.createElement(lucideReact.WifiOff, {
|
|
2221
2345
|
className: "h-4 w-4"
|
|
2222
|
-
}), /* @__PURE__ */
|
|
2346
|
+
}), /* @__PURE__ */ React26__namespace.createElement(AlertDescription, null, "Waiting for connection to MCP host..."));
|
|
2223
2347
|
}
|
|
2224
|
-
|
|
2348
|
+
chunk2HRO6CFU_js.__name(DefaultDisconnected, "DefaultDisconnected");
|
|
2225
2349
|
function DefaultError2({ error }) {
|
|
2226
|
-
return /* @__PURE__ */
|
|
2350
|
+
return /* @__PURE__ */ React26__namespace.createElement(Alert, {
|
|
2227
2351
|
variant: "destructive"
|
|
2228
|
-
}, /* @__PURE__ */
|
|
2352
|
+
}, /* @__PURE__ */ React26__namespace.createElement(lucideReact.AlertCircle, {
|
|
2229
2353
|
className: "h-4 w-4"
|
|
2230
|
-
}), /* @__PURE__ */
|
|
2354
|
+
}), /* @__PURE__ */ React26__namespace.createElement(AlertDescription, null, "Connection error: ", error.message));
|
|
2231
2355
|
}
|
|
2232
|
-
|
|
2356
|
+
chunk2HRO6CFU_js.__name(DefaultError2, "DefaultError");
|
|
2233
2357
|
function RequireConnection({ loading: loadingContent, error: errorContent, disconnected: disconnectedContent, children, className }) {
|
|
2234
2358
|
const { isConnected, error, app } = useMcpApp();
|
|
2359
|
+
console.log("[RequireConnection] State:", {
|
|
2360
|
+
hasApp: !!app,
|
|
2361
|
+
isConnected,
|
|
2362
|
+
hasError: !!error
|
|
2363
|
+
});
|
|
2235
2364
|
if (!app && !error && !isConnected) {
|
|
2365
|
+
console.log("[RequireConnection] Rendering: Initial Loading");
|
|
2236
2366
|
if (loadingContent) {
|
|
2237
|
-
return /* @__PURE__ */
|
|
2367
|
+
return /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
2238
2368
|
className
|
|
2239
2369
|
}, loadingContent);
|
|
2240
2370
|
}
|
|
2241
|
-
return /* @__PURE__ */
|
|
2371
|
+
return /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
2242
2372
|
className
|
|
2243
|
-
}, /* @__PURE__ */
|
|
2373
|
+
}, /* @__PURE__ */ React26__namespace.createElement(DefaultLoading2, null));
|
|
2244
2374
|
}
|
|
2245
2375
|
if (error) {
|
|
2376
|
+
console.log("[RequireConnection] Rendering: Error");
|
|
2246
2377
|
if (errorContent) {
|
|
2247
2378
|
if (typeof errorContent === "function") {
|
|
2248
|
-
return /* @__PURE__ */
|
|
2379
|
+
return /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
2249
2380
|
className
|
|
2250
2381
|
}, errorContent(error));
|
|
2251
2382
|
}
|
|
2252
|
-
return /* @__PURE__ */
|
|
2383
|
+
return /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
2253
2384
|
className
|
|
2254
2385
|
}, errorContent);
|
|
2255
2386
|
}
|
|
2256
|
-
return /* @__PURE__ */
|
|
2387
|
+
return /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
2257
2388
|
className
|
|
2258
|
-
}, /* @__PURE__ */
|
|
2389
|
+
}, /* @__PURE__ */ React26__namespace.createElement(DefaultError2, {
|
|
2259
2390
|
error
|
|
2260
2391
|
}));
|
|
2261
2392
|
}
|
|
2262
2393
|
if (!isConnected) {
|
|
2394
|
+
console.log("[RequireConnection] Rendering: Disconnected/Loading");
|
|
2263
2395
|
if (disconnectedContent) {
|
|
2264
|
-
return /* @__PURE__ */
|
|
2396
|
+
return /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
2265
2397
|
className
|
|
2266
2398
|
}, disconnectedContent);
|
|
2267
2399
|
}
|
|
2268
2400
|
if (loadingContent) {
|
|
2269
|
-
return /* @__PURE__ */
|
|
2401
|
+
return /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
2270
2402
|
className
|
|
2271
2403
|
}, loadingContent);
|
|
2272
2404
|
}
|
|
2273
|
-
return /* @__PURE__ */
|
|
2405
|
+
return /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
2274
2406
|
className
|
|
2275
|
-
}, /* @__PURE__ */
|
|
2407
|
+
}, /* @__PURE__ */ React26__namespace.createElement(DefaultDisconnected, null));
|
|
2276
2408
|
}
|
|
2277
|
-
|
|
2409
|
+
console.log("[RequireConnection] Rendering: Children (Connected)");
|
|
2410
|
+
return /* @__PURE__ */ React26__namespace.createElement(React26__namespace.Fragment, null, children);
|
|
2278
2411
|
}
|
|
2279
|
-
|
|
2412
|
+
chunk2HRO6CFU_js.__name(RequireConnection, "RequireConnection");
|
|
2280
2413
|
function DefaultFallback({ error, onRetry }) {
|
|
2281
|
-
return /* @__PURE__ */
|
|
2414
|
+
return /* @__PURE__ */ React26__namespace.createElement(Alert, {
|
|
2282
2415
|
variant: "destructive"
|
|
2283
|
-
}, /* @__PURE__ */
|
|
2416
|
+
}, /* @__PURE__ */ React26__namespace.createElement(lucideReact.AlertCircle, {
|
|
2284
2417
|
className: "h-4 w-4"
|
|
2285
|
-
}), /* @__PURE__ */
|
|
2418
|
+
}), /* @__PURE__ */ React26__namespace.createElement(AlertTitle, null, "Something went wrong"), /* @__PURE__ */ React26__namespace.createElement(AlertDescription, {
|
|
2286
2419
|
className: "flex flex-col gap-3"
|
|
2287
|
-
}, /* @__PURE__ */
|
|
2420
|
+
}, /* @__PURE__ */ React26__namespace.createElement("p", {
|
|
2288
2421
|
className: "text-sm"
|
|
2289
|
-
}, error.message), /* @__PURE__ */
|
|
2422
|
+
}, error.message), /* @__PURE__ */ React26__namespace.createElement(Button, {
|
|
2290
2423
|
variant: "outline",
|
|
2291
2424
|
size: "sm",
|
|
2292
2425
|
onClick: onRetry,
|
|
2293
2426
|
className: "w-fit"
|
|
2294
|
-
}, /* @__PURE__ */
|
|
2427
|
+
}, /* @__PURE__ */ React26__namespace.createElement(lucideReact.RefreshCw, {
|
|
2295
2428
|
className: "h-4 w-4 mr-2"
|
|
2296
2429
|
}), "Try Again")));
|
|
2297
2430
|
}
|
|
2298
|
-
|
|
2299
|
-
var ToolErrorBoundary = class extends
|
|
2431
|
+
chunk2HRO6CFU_js.__name(DefaultFallback, "DefaultFallback");
|
|
2432
|
+
var ToolErrorBoundary = class extends React26.Component {
|
|
2300
2433
|
static {
|
|
2301
|
-
|
|
2434
|
+
chunk2HRO6CFU_js.__name(this, "ToolErrorBoundary");
|
|
2302
2435
|
}
|
|
2303
2436
|
constructor(props) {
|
|
2304
2437
|
super(props);
|
|
@@ -2321,7 +2454,7 @@ var ToolErrorBoundary = class extends React25.Component {
|
|
|
2321
2454
|
this.reset();
|
|
2322
2455
|
}
|
|
2323
2456
|
}
|
|
2324
|
-
reset = /* @__PURE__ */
|
|
2457
|
+
reset = /* @__PURE__ */ chunk2HRO6CFU_js.__name(() => {
|
|
2325
2458
|
this.setState({
|
|
2326
2459
|
hasError: false,
|
|
2327
2460
|
error: null
|
|
@@ -2337,7 +2470,7 @@ var ToolErrorBoundary = class extends React25.Component {
|
|
|
2337
2470
|
}
|
|
2338
2471
|
return fallback;
|
|
2339
2472
|
}
|
|
2340
|
-
return /* @__PURE__ */
|
|
2473
|
+
return /* @__PURE__ */ React26__namespace.createElement(DefaultFallback, {
|
|
2341
2474
|
error,
|
|
2342
2475
|
onRetry: this.reset
|
|
2343
2476
|
});
|
|
@@ -2347,9 +2480,9 @@ var ToolErrorBoundary = class extends React25.Component {
|
|
|
2347
2480
|
};
|
|
2348
2481
|
function useMessage() {
|
|
2349
2482
|
const { sendMessage: appSendMessage, isConnected } = useMcpApp();
|
|
2350
|
-
const [sending, setSending] =
|
|
2351
|
-
const [error, setError] =
|
|
2352
|
-
const send =
|
|
2483
|
+
const [sending, setSending] = React26.useState(false);
|
|
2484
|
+
const [error, setError] = React26.useState(null);
|
|
2485
|
+
const send = React26.useCallback(async (text) => {
|
|
2353
2486
|
if (!isConnected) {
|
|
2354
2487
|
console.warn("[useMessage] Not connected to host");
|
|
2355
2488
|
return;
|
|
@@ -2369,7 +2502,7 @@ function useMessage() {
|
|
|
2369
2502
|
appSendMessage,
|
|
2370
2503
|
isConnected
|
|
2371
2504
|
]);
|
|
2372
|
-
const sendContent =
|
|
2505
|
+
const sendContent = React26.useCallback(async (content) => {
|
|
2373
2506
|
if (!isConnected) {
|
|
2374
2507
|
console.warn("[useMessage] Not connected to host");
|
|
2375
2508
|
return;
|
|
@@ -2390,7 +2523,7 @@ function useMessage() {
|
|
|
2390
2523
|
appSendMessage,
|
|
2391
2524
|
isConnected
|
|
2392
2525
|
]);
|
|
2393
|
-
const requestTool =
|
|
2526
|
+
const requestTool = React26.useCallback(async (toolName, args) => {
|
|
2394
2527
|
let message = `Please call the "${toolName}" tool`;
|
|
2395
2528
|
if (args && Object.keys(args).length > 0) {
|
|
2396
2529
|
message += ` with arguments: ${JSON.stringify(args)}`;
|
|
@@ -2407,7 +2540,7 @@ function useMessage() {
|
|
|
2407
2540
|
error
|
|
2408
2541
|
};
|
|
2409
2542
|
}
|
|
2410
|
-
|
|
2543
|
+
chunk2HRO6CFU_js.__name(useMessage, "useMessage");
|
|
2411
2544
|
|
|
2412
2545
|
// src/mcp/useHostContext.ts
|
|
2413
2546
|
function useHostContext() {
|
|
@@ -2427,7 +2560,7 @@ function useHostContext() {
|
|
|
2427
2560
|
rawContext: hostContext
|
|
2428
2561
|
};
|
|
2429
2562
|
}
|
|
2430
|
-
|
|
2563
|
+
chunk2HRO6CFU_js.__name(useHostContext, "useHostContext");
|
|
2431
2564
|
|
|
2432
2565
|
// src/mcp/useToolResult.ts
|
|
2433
2566
|
function useToolResult() {
|
|
@@ -2456,7 +2589,7 @@ function useToolResult() {
|
|
|
2456
2589
|
textContent
|
|
2457
2590
|
};
|
|
2458
2591
|
}
|
|
2459
|
-
|
|
2592
|
+
chunk2HRO6CFU_js.__name(useToolResult, "useToolResult");
|
|
2460
2593
|
|
|
2461
2594
|
// src/mcp/useToolInput.ts
|
|
2462
2595
|
function useToolInput() {
|
|
@@ -2466,7 +2599,7 @@ function useToolInput() {
|
|
|
2466
2599
|
hasInput: toolInput !== null
|
|
2467
2600
|
};
|
|
2468
2601
|
}
|
|
2469
|
-
|
|
2602
|
+
chunk2HRO6CFU_js.__name(useToolInput, "useToolInput");
|
|
2470
2603
|
|
|
2471
2604
|
// src/mcp/useToolInputPartial.ts
|
|
2472
2605
|
function useToolInputPartial() {
|
|
@@ -2476,21 +2609,24 @@ function useToolInputPartial() {
|
|
|
2476
2609
|
isStreaming: toolInputPartial !== null
|
|
2477
2610
|
};
|
|
2478
2611
|
}
|
|
2479
|
-
|
|
2612
|
+
chunk2HRO6CFU_js.__name(useToolInputPartial, "useToolInputPartial");
|
|
2480
2613
|
function useToolSubscription(toolName, options = {}) {
|
|
2481
2614
|
const { interval = 1e4, enabled = true, args = {} } = options;
|
|
2482
2615
|
const toolHook = useTool(toolName);
|
|
2483
|
-
const intervalRef =
|
|
2484
|
-
const [isPolling, setIsPolling] =
|
|
2485
|
-
const stop =
|
|
2616
|
+
const intervalRef = React26.useRef(null);
|
|
2617
|
+
const [isPolling, setIsPolling] = React26.useState(false);
|
|
2618
|
+
const stop = React26.useCallback(() => {
|
|
2486
2619
|
if (intervalRef.current) {
|
|
2487
2620
|
clearInterval(intervalRef.current);
|
|
2488
2621
|
intervalRef.current = null;
|
|
2489
2622
|
}
|
|
2490
2623
|
setIsPolling(false);
|
|
2491
2624
|
}, []);
|
|
2492
|
-
const start =
|
|
2493
|
-
|
|
2625
|
+
const start = React26.useCallback(() => {
|
|
2626
|
+
if (intervalRef.current) {
|
|
2627
|
+
clearInterval(intervalRef.current);
|
|
2628
|
+
intervalRef.current = null;
|
|
2629
|
+
}
|
|
2494
2630
|
setIsPolling(true);
|
|
2495
2631
|
toolHook.call(args).catch(() => {
|
|
2496
2632
|
});
|
|
@@ -2501,16 +2637,15 @@ function useToolSubscription(toolName, options = {}) {
|
|
|
2501
2637
|
}, [
|
|
2502
2638
|
toolHook.call,
|
|
2503
2639
|
args,
|
|
2504
|
-
interval
|
|
2505
|
-
stop
|
|
2640
|
+
interval
|
|
2506
2641
|
]);
|
|
2507
|
-
const refresh =
|
|
2642
|
+
const refresh = React26.useCallback(async () => {
|
|
2508
2643
|
return toolHook.call(args);
|
|
2509
2644
|
}, [
|
|
2510
2645
|
toolHook.call,
|
|
2511
2646
|
args
|
|
2512
2647
|
]);
|
|
2513
|
-
|
|
2648
|
+
React26.useEffect(() => {
|
|
2514
2649
|
if (enabled) {
|
|
2515
2650
|
start();
|
|
2516
2651
|
}
|
|
@@ -2530,7 +2665,7 @@ function useToolSubscription(toolName, options = {}) {
|
|
|
2530
2665
|
refresh
|
|
2531
2666
|
};
|
|
2532
2667
|
}
|
|
2533
|
-
|
|
2668
|
+
chunk2HRO6CFU_js.__name(useToolSubscription, "useToolSubscription");
|
|
2534
2669
|
|
|
2535
2670
|
// src/types/mcp-types.ts
|
|
2536
2671
|
function normalizeToolBinding(tool) {
|
|
@@ -2541,7 +2676,7 @@ function normalizeToolBinding(tool) {
|
|
|
2541
2676
|
}
|
|
2542
2677
|
return tool;
|
|
2543
2678
|
}
|
|
2544
|
-
|
|
2679
|
+
chunk2HRO6CFU_js.__name(normalizeToolBinding, "normalizeToolBinding");
|
|
2545
2680
|
var DEFAULT_RESULT_CONFIG = {
|
|
2546
2681
|
display: "none",
|
|
2547
2682
|
autoDismiss: 5e3
|
|
@@ -2554,33 +2689,33 @@ var INITIAL_TOOL_STATE = {
|
|
|
2554
2689
|
hasResult: false
|
|
2555
2690
|
};
|
|
2556
2691
|
function CardTitle({ className, ...props }) {
|
|
2557
|
-
return /* @__PURE__ */
|
|
2692
|
+
return /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
2558
2693
|
"data-slot": "card-title",
|
|
2559
2694
|
className: cn("leading-none font-semibold", className),
|
|
2560
2695
|
...props
|
|
2561
2696
|
});
|
|
2562
2697
|
}
|
|
2563
|
-
|
|
2698
|
+
chunk2HRO6CFU_js.__name(CardTitle, "CardTitle");
|
|
2564
2699
|
function CardDescription({ className, ...props }) {
|
|
2565
|
-
return /* @__PURE__ */
|
|
2700
|
+
return /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
2566
2701
|
"data-slot": "card-description",
|
|
2567
2702
|
className: cn("text-muted-foreground text-sm", className),
|
|
2568
2703
|
...props
|
|
2569
2704
|
});
|
|
2570
2705
|
}
|
|
2571
|
-
|
|
2706
|
+
chunk2HRO6CFU_js.__name(CardDescription, "CardDescription");
|
|
2572
2707
|
var Form = reactHookForm.FormProvider;
|
|
2573
|
-
var FormFieldContext = /* @__PURE__ */
|
|
2574
|
-
var FormField = /* @__PURE__ */
|
|
2575
|
-
return /* @__PURE__ */
|
|
2708
|
+
var FormFieldContext = /* @__PURE__ */ React26__namespace.createContext({});
|
|
2709
|
+
var FormField = /* @__PURE__ */ chunk2HRO6CFU_js.__name(({ ...props }) => {
|
|
2710
|
+
return /* @__PURE__ */ React26__namespace.createElement(FormFieldContext.Provider, {
|
|
2576
2711
|
value: {
|
|
2577
2712
|
name: props.name
|
|
2578
2713
|
}
|
|
2579
|
-
}, /* @__PURE__ */
|
|
2714
|
+
}, /* @__PURE__ */ React26__namespace.createElement(reactHookForm.Controller, props));
|
|
2580
2715
|
}, "FormField");
|
|
2581
|
-
var useFormField = /* @__PURE__ */
|
|
2582
|
-
const fieldContext =
|
|
2583
|
-
const itemContext =
|
|
2716
|
+
var useFormField = /* @__PURE__ */ chunk2HRO6CFU_js.__name(() => {
|
|
2717
|
+
const fieldContext = React26__namespace.useContext(FormFieldContext);
|
|
2718
|
+
const itemContext = React26__namespace.useContext(FormItemContext);
|
|
2584
2719
|
const { getFieldState } = reactHookForm.useFormContext();
|
|
2585
2720
|
const formState = reactHookForm.useFormState({
|
|
2586
2721
|
name: fieldContext.name
|
|
@@ -2599,23 +2734,23 @@ var useFormField = /* @__PURE__ */ chunk3PV26V5F_js.__name(() => {
|
|
|
2599
2734
|
...fieldState
|
|
2600
2735
|
};
|
|
2601
2736
|
}, "useFormField");
|
|
2602
|
-
var FormItemContext = /* @__PURE__ */
|
|
2737
|
+
var FormItemContext = /* @__PURE__ */ React26__namespace.createContext({});
|
|
2603
2738
|
function FormItem({ className, ...props }) {
|
|
2604
|
-
const id =
|
|
2605
|
-
return /* @__PURE__ */
|
|
2739
|
+
const id = React26__namespace.useId();
|
|
2740
|
+
return /* @__PURE__ */ React26__namespace.createElement(FormItemContext.Provider, {
|
|
2606
2741
|
value: {
|
|
2607
2742
|
id
|
|
2608
2743
|
}
|
|
2609
|
-
}, /* @__PURE__ */
|
|
2744
|
+
}, /* @__PURE__ */ React26__namespace.createElement("div", {
|
|
2610
2745
|
"data-slot": "form-item",
|
|
2611
2746
|
className: cn("grid gap-2", className),
|
|
2612
2747
|
...props
|
|
2613
2748
|
}));
|
|
2614
2749
|
}
|
|
2615
|
-
|
|
2750
|
+
chunk2HRO6CFU_js.__name(FormItem, "FormItem");
|
|
2616
2751
|
function FormLabel({ className, ...props }) {
|
|
2617
2752
|
const { error, formItemId } = useFormField();
|
|
2618
|
-
return /* @__PURE__ */
|
|
2753
|
+
return /* @__PURE__ */ React26__namespace.createElement(Label2, {
|
|
2619
2754
|
"data-slot": "form-label",
|
|
2620
2755
|
"data-error": !!error,
|
|
2621
2756
|
className: cn("data-[error=true]:text-destructive", className),
|
|
@@ -2623,10 +2758,10 @@ function FormLabel({ className, ...props }) {
|
|
|
2623
2758
|
...props
|
|
2624
2759
|
});
|
|
2625
2760
|
}
|
|
2626
|
-
|
|
2761
|
+
chunk2HRO6CFU_js.__name(FormLabel, "FormLabel");
|
|
2627
2762
|
function FormControl({ ...props }) {
|
|
2628
2763
|
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
2629
|
-
return /* @__PURE__ */
|
|
2764
|
+
return /* @__PURE__ */ React26__namespace.createElement(reactSlot.Slot, {
|
|
2630
2765
|
"data-slot": "form-control",
|
|
2631
2766
|
id: formItemId,
|
|
2632
2767
|
"aria-describedby": !error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`,
|
|
@@ -2634,31 +2769,31 @@ function FormControl({ ...props }) {
|
|
|
2634
2769
|
...props
|
|
2635
2770
|
});
|
|
2636
2771
|
}
|
|
2637
|
-
|
|
2772
|
+
chunk2HRO6CFU_js.__name(FormControl, "FormControl");
|
|
2638
2773
|
function FormDescription({ className, ...props }) {
|
|
2639
2774
|
const { formDescriptionId } = useFormField();
|
|
2640
|
-
return /* @__PURE__ */
|
|
2775
|
+
return /* @__PURE__ */ React26__namespace.createElement("p", {
|
|
2641
2776
|
"data-slot": "form-description",
|
|
2642
2777
|
id: formDescriptionId,
|
|
2643
2778
|
className: cn("text-muted-foreground text-sm", className),
|
|
2644
2779
|
...props
|
|
2645
2780
|
});
|
|
2646
2781
|
}
|
|
2647
|
-
|
|
2782
|
+
chunk2HRO6CFU_js.__name(FormDescription, "FormDescription");
|
|
2648
2783
|
function FormMessage({ className, ...props }) {
|
|
2649
2784
|
const { error, formMessageId } = useFormField();
|
|
2650
2785
|
const body = error ? String(error?.message ?? "") : props.children;
|
|
2651
2786
|
if (!body) {
|
|
2652
2787
|
return null;
|
|
2653
2788
|
}
|
|
2654
|
-
return /* @__PURE__ */
|
|
2789
|
+
return /* @__PURE__ */ React26__namespace.createElement("p", {
|
|
2655
2790
|
"data-slot": "form-message",
|
|
2656
2791
|
id: formMessageId,
|
|
2657
2792
|
className: cn("text-destructive text-sm", className),
|
|
2658
2793
|
...props
|
|
2659
2794
|
}, body);
|
|
2660
2795
|
}
|
|
2661
|
-
|
|
2796
|
+
chunk2HRO6CFU_js.__name(FormMessage, "FormMessage");
|
|
2662
2797
|
var badgeVariants = classVarianceAuthority.cva("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden", {
|
|
2663
2798
|
variants: {
|
|
2664
2799
|
variant: {
|
|
@@ -2674,7 +2809,7 @@ var badgeVariants = classVarianceAuthority.cva("inline-flex items-center justify
|
|
|
2674
2809
|
});
|
|
2675
2810
|
function Badge({ className, variant, asChild = false, ...props }) {
|
|
2676
2811
|
const Comp = asChild ? reactSlot.Slot : "span";
|
|
2677
|
-
return /* @__PURE__ */
|
|
2812
|
+
return /* @__PURE__ */ React26__namespace.createElement(Comp, {
|
|
2678
2813
|
"data-slot": "badge",
|
|
2679
2814
|
className: cn(badgeVariants({
|
|
2680
2815
|
variant
|
|
@@ -2682,33 +2817,33 @@ function Badge({ className, variant, asChild = false, ...props }) {
|
|
|
2682
2817
|
...props
|
|
2683
2818
|
});
|
|
2684
2819
|
}
|
|
2685
|
-
|
|
2820
|
+
chunk2HRO6CFU_js.__name(Badge, "Badge");
|
|
2686
2821
|
function TabsList({ className, ...props }) {
|
|
2687
|
-
return /* @__PURE__ */
|
|
2822
|
+
return /* @__PURE__ */ React26__namespace.createElement(TabsPrimitive2__namespace.List, {
|
|
2688
2823
|
"data-slot": "tabs-list",
|
|
2689
2824
|
className: cn("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]", className),
|
|
2690
2825
|
...props
|
|
2691
2826
|
});
|
|
2692
2827
|
}
|
|
2693
|
-
|
|
2828
|
+
chunk2HRO6CFU_js.__name(TabsList, "TabsList");
|
|
2694
2829
|
function TabsTrigger({ className, ...props }) {
|
|
2695
|
-
return /* @__PURE__ */
|
|
2830
|
+
return /* @__PURE__ */ React26__namespace.createElement(TabsPrimitive2__namespace.Trigger, {
|
|
2696
2831
|
"data-slot": "tabs-trigger",
|
|
2697
2832
|
className: cn("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
2698
2833
|
...props
|
|
2699
2834
|
});
|
|
2700
2835
|
}
|
|
2701
|
-
|
|
2836
|
+
chunk2HRO6CFU_js.__name(TabsTrigger, "TabsTrigger");
|
|
2702
2837
|
function TabsContent({ className, ...props }) {
|
|
2703
|
-
return /* @__PURE__ */
|
|
2838
|
+
return /* @__PURE__ */ React26__namespace.createElement(TabsPrimitive2__namespace.Content, {
|
|
2704
2839
|
"data-slot": "tabs-content",
|
|
2705
2840
|
className: cn("flex-1 outline-none", className),
|
|
2706
2841
|
...props
|
|
2707
2842
|
});
|
|
2708
2843
|
}
|
|
2709
|
-
|
|
2844
|
+
chunk2HRO6CFU_js.__name(TabsContent, "TabsContent");
|
|
2710
2845
|
function Separator2({ className, orientation = "horizontal", decorative = true, ...props }) {
|
|
2711
|
-
return /* @__PURE__ */
|
|
2846
|
+
return /* @__PURE__ */ React26__namespace.createElement(SeparatorPrimitive__namespace.Root, {
|
|
2712
2847
|
"data-slot": "separator",
|
|
2713
2848
|
decorative,
|
|
2714
2849
|
orientation,
|
|
@@ -2716,69 +2851,69 @@ function Separator2({ className, orientation = "horizontal", decorative = true,
|
|
|
2716
2851
|
...props
|
|
2717
2852
|
});
|
|
2718
2853
|
}
|
|
2719
|
-
|
|
2854
|
+
chunk2HRO6CFU_js.__name(Separator2, "Separator");
|
|
2720
2855
|
function ScrollArea({ className, children, ...props }) {
|
|
2721
|
-
return /* @__PURE__ */
|
|
2856
|
+
return /* @__PURE__ */ React26__namespace.createElement(ScrollAreaPrimitive__namespace.Root, {
|
|
2722
2857
|
"data-slot": "scroll-area",
|
|
2723
2858
|
className: cn("relative", className),
|
|
2724
2859
|
...props
|
|
2725
|
-
}, /* @__PURE__ */
|
|
2860
|
+
}, /* @__PURE__ */ React26__namespace.createElement(ScrollAreaPrimitive__namespace.Viewport, {
|
|
2726
2861
|
"data-slot": "scroll-area-viewport",
|
|
2727
2862
|
className: "focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1"
|
|
2728
|
-
}, children), /* @__PURE__ */
|
|
2863
|
+
}, children), /* @__PURE__ */ React26__namespace.createElement(ScrollBar, null), /* @__PURE__ */ React26__namespace.createElement(ScrollAreaPrimitive__namespace.Corner, null));
|
|
2729
2864
|
}
|
|
2730
|
-
|
|
2865
|
+
chunk2HRO6CFU_js.__name(ScrollArea, "ScrollArea");
|
|
2731
2866
|
function ScrollBar({ className, orientation = "vertical", ...props }) {
|
|
2732
|
-
return /* @__PURE__ */
|
|
2867
|
+
return /* @__PURE__ */ React26__namespace.createElement(ScrollAreaPrimitive__namespace.ScrollAreaScrollbar, {
|
|
2733
2868
|
"data-slot": "scroll-area-scrollbar",
|
|
2734
2869
|
orientation,
|
|
2735
2870
|
className: cn("flex touch-none p-px transition-colors select-none", orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent", orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent", className),
|
|
2736
2871
|
...props
|
|
2737
|
-
}, /* @__PURE__ */
|
|
2872
|
+
}, /* @__PURE__ */ React26__namespace.createElement(ScrollAreaPrimitive__namespace.ScrollAreaThumb, {
|
|
2738
2873
|
"data-slot": "scroll-area-thumb",
|
|
2739
2874
|
className: "bg-border relative flex-1 rounded-full"
|
|
2740
2875
|
}));
|
|
2741
2876
|
}
|
|
2742
|
-
|
|
2877
|
+
chunk2HRO6CFU_js.__name(ScrollBar, "ScrollBar");
|
|
2743
2878
|
function DropdownMenu({ ...props }) {
|
|
2744
|
-
return /* @__PURE__ */
|
|
2879
|
+
return /* @__PURE__ */ React26__namespace.createElement(DropdownMenuPrimitive__namespace.Root, {
|
|
2745
2880
|
"data-slot": "dropdown-menu",
|
|
2746
2881
|
...props
|
|
2747
2882
|
});
|
|
2748
2883
|
}
|
|
2749
|
-
|
|
2884
|
+
chunk2HRO6CFU_js.__name(DropdownMenu, "DropdownMenu");
|
|
2750
2885
|
function DropdownMenuPortal({ ...props }) {
|
|
2751
|
-
return /* @__PURE__ */
|
|
2886
|
+
return /* @__PURE__ */ React26__namespace.createElement(DropdownMenuPrimitive__namespace.Portal, {
|
|
2752
2887
|
"data-slot": "dropdown-menu-portal",
|
|
2753
2888
|
...props
|
|
2754
2889
|
});
|
|
2755
2890
|
}
|
|
2756
|
-
|
|
2891
|
+
chunk2HRO6CFU_js.__name(DropdownMenuPortal, "DropdownMenuPortal");
|
|
2757
2892
|
function DropdownMenuTrigger({ ...props }) {
|
|
2758
|
-
return /* @__PURE__ */
|
|
2893
|
+
return /* @__PURE__ */ React26__namespace.createElement(DropdownMenuPrimitive__namespace.Trigger, {
|
|
2759
2894
|
"data-slot": "dropdown-menu-trigger",
|
|
2760
2895
|
...props
|
|
2761
2896
|
});
|
|
2762
2897
|
}
|
|
2763
|
-
|
|
2898
|
+
chunk2HRO6CFU_js.__name(DropdownMenuTrigger, "DropdownMenuTrigger");
|
|
2764
2899
|
function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
|
|
2765
|
-
return /* @__PURE__ */
|
|
2900
|
+
return /* @__PURE__ */ React26__namespace.createElement(DropdownMenuPrimitive__namespace.Portal, null, /* @__PURE__ */ React26__namespace.createElement(DropdownMenuPrimitive__namespace.Content, {
|
|
2766
2901
|
"data-slot": "dropdown-menu-content",
|
|
2767
2902
|
sideOffset,
|
|
2768
2903
|
className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md", className),
|
|
2769
2904
|
...props
|
|
2770
2905
|
}));
|
|
2771
2906
|
}
|
|
2772
|
-
|
|
2907
|
+
chunk2HRO6CFU_js.__name(DropdownMenuContent, "DropdownMenuContent");
|
|
2773
2908
|
function DropdownMenuGroup({ ...props }) {
|
|
2774
|
-
return /* @__PURE__ */
|
|
2909
|
+
return /* @__PURE__ */ React26__namespace.createElement(DropdownMenuPrimitive__namespace.Group, {
|
|
2775
2910
|
"data-slot": "dropdown-menu-group",
|
|
2776
2911
|
...props
|
|
2777
2912
|
});
|
|
2778
2913
|
}
|
|
2779
|
-
|
|
2914
|
+
chunk2HRO6CFU_js.__name(DropdownMenuGroup, "DropdownMenuGroup");
|
|
2780
2915
|
function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
|
|
2781
|
-
return /* @__PURE__ */
|
|
2916
|
+
return /* @__PURE__ */ React26__namespace.createElement(DropdownMenuPrimitive__namespace.Item, {
|
|
2782
2917
|
"data-slot": "dropdown-menu-item",
|
|
2783
2918
|
"data-inset": inset,
|
|
2784
2919
|
"data-variant": variant,
|
|
@@ -2786,127 +2921,127 @@ function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
|
|
|
2786
2921
|
...props
|
|
2787
2922
|
});
|
|
2788
2923
|
}
|
|
2789
|
-
|
|
2924
|
+
chunk2HRO6CFU_js.__name(DropdownMenuItem, "DropdownMenuItem");
|
|
2790
2925
|
function DropdownMenuCheckboxItem({ className, children, checked, ...props }) {
|
|
2791
|
-
return /* @__PURE__ */
|
|
2926
|
+
return /* @__PURE__ */ React26__namespace.createElement(DropdownMenuPrimitive__namespace.CheckboxItem, {
|
|
2792
2927
|
"data-slot": "dropdown-menu-checkbox-item",
|
|
2793
2928
|
className: cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
2794
2929
|
checked,
|
|
2795
2930
|
...props
|
|
2796
|
-
}, /* @__PURE__ */
|
|
2931
|
+
}, /* @__PURE__ */ React26__namespace.createElement("span", {
|
|
2797
2932
|
className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center"
|
|
2798
|
-
}, /* @__PURE__ */
|
|
2933
|
+
}, /* @__PURE__ */ React26__namespace.createElement(DropdownMenuPrimitive__namespace.ItemIndicator, null, /* @__PURE__ */ React26__namespace.createElement(lucideReact.CheckIcon, {
|
|
2799
2934
|
className: "size-4"
|
|
2800
2935
|
}))), children);
|
|
2801
2936
|
}
|
|
2802
|
-
|
|
2937
|
+
chunk2HRO6CFU_js.__name(DropdownMenuCheckboxItem, "DropdownMenuCheckboxItem");
|
|
2803
2938
|
function DropdownMenuRadioGroup({ ...props }) {
|
|
2804
|
-
return /* @__PURE__ */
|
|
2939
|
+
return /* @__PURE__ */ React26__namespace.createElement(DropdownMenuPrimitive__namespace.RadioGroup, {
|
|
2805
2940
|
"data-slot": "dropdown-menu-radio-group",
|
|
2806
2941
|
...props
|
|
2807
2942
|
});
|
|
2808
2943
|
}
|
|
2809
|
-
|
|
2944
|
+
chunk2HRO6CFU_js.__name(DropdownMenuRadioGroup, "DropdownMenuRadioGroup");
|
|
2810
2945
|
function DropdownMenuRadioItem({ className, children, ...props }) {
|
|
2811
|
-
return /* @__PURE__ */
|
|
2946
|
+
return /* @__PURE__ */ React26__namespace.createElement(DropdownMenuPrimitive__namespace.RadioItem, {
|
|
2812
2947
|
"data-slot": "dropdown-menu-radio-item",
|
|
2813
2948
|
className: cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
2814
2949
|
...props
|
|
2815
|
-
}, /* @__PURE__ */
|
|
2950
|
+
}, /* @__PURE__ */ React26__namespace.createElement("span", {
|
|
2816
2951
|
className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center"
|
|
2817
|
-
}, /* @__PURE__ */
|
|
2952
|
+
}, /* @__PURE__ */ React26__namespace.createElement(DropdownMenuPrimitive__namespace.ItemIndicator, null, /* @__PURE__ */ React26__namespace.createElement(lucideReact.CircleIcon, {
|
|
2818
2953
|
className: "size-2 fill-current"
|
|
2819
2954
|
}))), children);
|
|
2820
2955
|
}
|
|
2821
|
-
|
|
2956
|
+
chunk2HRO6CFU_js.__name(DropdownMenuRadioItem, "DropdownMenuRadioItem");
|
|
2822
2957
|
function DropdownMenuLabel({ className, inset, ...props }) {
|
|
2823
|
-
return /* @__PURE__ */
|
|
2958
|
+
return /* @__PURE__ */ React26__namespace.createElement(DropdownMenuPrimitive__namespace.Label, {
|
|
2824
2959
|
"data-slot": "dropdown-menu-label",
|
|
2825
2960
|
"data-inset": inset,
|
|
2826
2961
|
className: cn("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8", className),
|
|
2827
2962
|
...props
|
|
2828
2963
|
});
|
|
2829
2964
|
}
|
|
2830
|
-
|
|
2965
|
+
chunk2HRO6CFU_js.__name(DropdownMenuLabel, "DropdownMenuLabel");
|
|
2831
2966
|
function DropdownMenuSeparator({ className, ...props }) {
|
|
2832
|
-
return /* @__PURE__ */
|
|
2967
|
+
return /* @__PURE__ */ React26__namespace.createElement(DropdownMenuPrimitive__namespace.Separator, {
|
|
2833
2968
|
"data-slot": "dropdown-menu-separator",
|
|
2834
2969
|
className: cn("bg-border -mx-1 my-1 h-px", className),
|
|
2835
2970
|
...props
|
|
2836
2971
|
});
|
|
2837
2972
|
}
|
|
2838
|
-
|
|
2973
|
+
chunk2HRO6CFU_js.__name(DropdownMenuSeparator, "DropdownMenuSeparator");
|
|
2839
2974
|
function DropdownMenuShortcut({ className, ...props }) {
|
|
2840
|
-
return /* @__PURE__ */
|
|
2975
|
+
return /* @__PURE__ */ React26__namespace.createElement("span", {
|
|
2841
2976
|
"data-slot": "dropdown-menu-shortcut",
|
|
2842
2977
|
className: cn("text-muted-foreground ml-auto text-xs tracking-widest", className),
|
|
2843
2978
|
...props
|
|
2844
2979
|
});
|
|
2845
2980
|
}
|
|
2846
|
-
|
|
2981
|
+
chunk2HRO6CFU_js.__name(DropdownMenuShortcut, "DropdownMenuShortcut");
|
|
2847
2982
|
function DropdownMenuSub({ ...props }) {
|
|
2848
|
-
return /* @__PURE__ */
|
|
2983
|
+
return /* @__PURE__ */ React26__namespace.createElement(DropdownMenuPrimitive__namespace.Sub, {
|
|
2849
2984
|
"data-slot": "dropdown-menu-sub",
|
|
2850
2985
|
...props
|
|
2851
2986
|
});
|
|
2852
2987
|
}
|
|
2853
|
-
|
|
2988
|
+
chunk2HRO6CFU_js.__name(DropdownMenuSub, "DropdownMenuSub");
|
|
2854
2989
|
function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
|
|
2855
|
-
return /* @__PURE__ */
|
|
2990
|
+
return /* @__PURE__ */ React26__namespace.createElement(DropdownMenuPrimitive__namespace.SubTrigger, {
|
|
2856
2991
|
"data-slot": "dropdown-menu-sub-trigger",
|
|
2857
2992
|
"data-inset": inset,
|
|
2858
2993
|
className: cn("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
2859
2994
|
...props
|
|
2860
|
-
}, children, /* @__PURE__ */
|
|
2995
|
+
}, children, /* @__PURE__ */ React26__namespace.createElement(lucideReact.ChevronRightIcon, {
|
|
2861
2996
|
className: "ml-auto size-4"
|
|
2862
2997
|
}));
|
|
2863
2998
|
}
|
|
2864
|
-
|
|
2999
|
+
chunk2HRO6CFU_js.__name(DropdownMenuSubTrigger, "DropdownMenuSubTrigger");
|
|
2865
3000
|
function DropdownMenuSubContent({ className, ...props }) {
|
|
2866
|
-
return /* @__PURE__ */
|
|
3001
|
+
return /* @__PURE__ */ React26__namespace.createElement(DropdownMenuPrimitive__namespace.SubContent, {
|
|
2867
3002
|
"data-slot": "dropdown-menu-sub-content",
|
|
2868
3003
|
className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg", className),
|
|
2869
3004
|
...props
|
|
2870
3005
|
});
|
|
2871
3006
|
}
|
|
2872
|
-
|
|
3007
|
+
chunk2HRO6CFU_js.__name(DropdownMenuSubContent, "DropdownMenuSubContent");
|
|
2873
3008
|
function TooltipProvider({ delayDuration = 0, ...props }) {
|
|
2874
|
-
return /* @__PURE__ */
|
|
3009
|
+
return /* @__PURE__ */ React26__namespace.createElement(TooltipPrimitive__namespace.Provider, {
|
|
2875
3010
|
"data-slot": "tooltip-provider",
|
|
2876
3011
|
delayDuration,
|
|
2877
3012
|
...props
|
|
2878
3013
|
});
|
|
2879
3014
|
}
|
|
2880
|
-
|
|
3015
|
+
chunk2HRO6CFU_js.__name(TooltipProvider, "TooltipProvider");
|
|
2881
3016
|
function Tooltip({ ...props }) {
|
|
2882
|
-
return /* @__PURE__ */
|
|
3017
|
+
return /* @__PURE__ */ React26__namespace.createElement(TooltipProvider, null, /* @__PURE__ */ React26__namespace.createElement(TooltipPrimitive__namespace.Root, {
|
|
2883
3018
|
"data-slot": "tooltip",
|
|
2884
3019
|
...props
|
|
2885
3020
|
}));
|
|
2886
3021
|
}
|
|
2887
|
-
|
|
3022
|
+
chunk2HRO6CFU_js.__name(Tooltip, "Tooltip");
|
|
2888
3023
|
function TooltipTrigger({ ...props }) {
|
|
2889
|
-
return /* @__PURE__ */
|
|
3024
|
+
return /* @__PURE__ */ React26__namespace.createElement(TooltipPrimitive__namespace.Trigger, {
|
|
2890
3025
|
"data-slot": "tooltip-trigger",
|
|
2891
3026
|
...props
|
|
2892
3027
|
});
|
|
2893
3028
|
}
|
|
2894
|
-
|
|
3029
|
+
chunk2HRO6CFU_js.__name(TooltipTrigger, "TooltipTrigger");
|
|
2895
3030
|
function TooltipContent({ className, sideOffset = 0, children, ...props }) {
|
|
2896
|
-
return /* @__PURE__ */
|
|
3031
|
+
return /* @__PURE__ */ React26__namespace.createElement(TooltipPrimitive__namespace.Portal, null, /* @__PURE__ */ React26__namespace.createElement(TooltipPrimitive__namespace.Content, {
|
|
2897
3032
|
"data-slot": "tooltip-content",
|
|
2898
3033
|
sideOffset,
|
|
2899
3034
|
className: cn("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance", className),
|
|
2900
3035
|
...props
|
|
2901
|
-
}, children, /* @__PURE__ */
|
|
3036
|
+
}, children, /* @__PURE__ */ React26__namespace.createElement(TooltipPrimitive__namespace.Arrow, {
|
|
2902
3037
|
className: "bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"
|
|
2903
3038
|
})));
|
|
2904
3039
|
}
|
|
2905
|
-
|
|
3040
|
+
chunk2HRO6CFU_js.__name(TooltipContent, "TooltipContent");
|
|
2906
3041
|
function DataGrid({ data, columns, searchable = false, searchPlaceholder = "Search...", onRowClick, loading = false, emptyMessage = "No data", className }) {
|
|
2907
|
-
const [sorting, setSorting] =
|
|
2908
|
-
const [globalFilter, setGlobalFilter] =
|
|
2909
|
-
const tableColumns =
|
|
3042
|
+
const [sorting, setSorting] = React26.useState([]);
|
|
3043
|
+
const [globalFilter, setGlobalFilter] = React26.useState("");
|
|
3044
|
+
const tableColumns = React26.useMemo(() => columns.map((col) => ({
|
|
2910
3045
|
id: String(col.key),
|
|
2911
3046
|
accessorKey: col.key,
|
|
2912
3047
|
header: col.header,
|
|
@@ -2929,49 +3064,49 @@ function DataGrid({ data, columns, searchable = false, searchPlaceholder = "Sear
|
|
|
2929
3064
|
getSortedRowModel: reactTable.getSortedRowModel(),
|
|
2930
3065
|
getFilteredRowModel: reactTable.getFilteredRowModel()
|
|
2931
3066
|
});
|
|
2932
|
-
return /* @__PURE__ */
|
|
3067
|
+
return /* @__PURE__ */ React26__namespace.default.createElement("div", {
|
|
2933
3068
|
className: clsx.clsx("lui-datagrid", className)
|
|
2934
|
-
}, searchable && /* @__PURE__ */
|
|
3069
|
+
}, searchable && /* @__PURE__ */ React26__namespace.default.createElement("div", {
|
|
2935
3070
|
className: "lui-datagrid-search"
|
|
2936
|
-
}, /* @__PURE__ */
|
|
3071
|
+
}, /* @__PURE__ */ React26__namespace.default.createElement("input", {
|
|
2937
3072
|
type: "text",
|
|
2938
3073
|
value: globalFilter,
|
|
2939
|
-
onChange: /* @__PURE__ */
|
|
3074
|
+
onChange: /* @__PURE__ */ chunk2HRO6CFU_js.__name((e) => setGlobalFilter(e.target.value), "onChange"),
|
|
2940
3075
|
placeholder: searchPlaceholder,
|
|
2941
3076
|
className: "lui-datagrid-search-input"
|
|
2942
|
-
})), /* @__PURE__ */
|
|
3077
|
+
})), /* @__PURE__ */ React26__namespace.default.createElement("div", {
|
|
2943
3078
|
className: "lui-datagrid-container"
|
|
2944
|
-
}, /* @__PURE__ */
|
|
3079
|
+
}, /* @__PURE__ */ React26__namespace.default.createElement("table", {
|
|
2945
3080
|
className: "lui-datagrid-table"
|
|
2946
|
-
}, /* @__PURE__ */
|
|
3081
|
+
}, /* @__PURE__ */ React26__namespace.default.createElement("thead", null, table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ React26__namespace.default.createElement("tr", {
|
|
2947
3082
|
key: headerGroup.id
|
|
2948
|
-
}, headerGroup.headers.map((header) => /* @__PURE__ */
|
|
3083
|
+
}, headerGroup.headers.map((header) => /* @__PURE__ */ React26__namespace.default.createElement("th", {
|
|
2949
3084
|
key: header.id,
|
|
2950
3085
|
className: clsx.clsx("lui-datagrid-th", header.column.getCanSort() && "lui-datagrid-th--sortable"),
|
|
2951
3086
|
onClick: header.column.getToggleSortingHandler(),
|
|
2952
3087
|
style: {
|
|
2953
3088
|
width: header.column.getSize()
|
|
2954
3089
|
}
|
|
2955
|
-
}, /* @__PURE__ */
|
|
3090
|
+
}, /* @__PURE__ */ React26__namespace.default.createElement("div", {
|
|
2956
3091
|
className: "lui-datagrid-th-content"
|
|
2957
|
-
}, reactTable.flexRender(header.column.columnDef.header, header.getContext()), header.column.getIsSorted() && /* @__PURE__ */
|
|
3092
|
+
}, reactTable.flexRender(header.column.columnDef.header, header.getContext()), header.column.getIsSorted() && /* @__PURE__ */ React26__namespace.default.createElement("span", {
|
|
2958
3093
|
className: "lui-datagrid-sort-icon"
|
|
2959
|
-
}, header.column.getIsSorted() === "asc" ? "\u2191" : "\u2193"))))))), /* @__PURE__ */
|
|
3094
|
+
}, header.column.getIsSorted() === "asc" ? "\u2191" : "\u2193"))))))), /* @__PURE__ */ React26__namespace.default.createElement("tbody", null, loading ? /* @__PURE__ */ React26__namespace.default.createElement("tr", null, /* @__PURE__ */ React26__namespace.default.createElement("td", {
|
|
2960
3095
|
colSpan: columns.length,
|
|
2961
3096
|
className: "lui-datagrid-loading"
|
|
2962
|
-
}, "Loading...")) : table.getRowModel().rows.length === 0 ? /* @__PURE__ */
|
|
3097
|
+
}, "Loading...")) : table.getRowModel().rows.length === 0 ? /* @__PURE__ */ React26__namespace.default.createElement("tr", null, /* @__PURE__ */ React26__namespace.default.createElement("td", {
|
|
2963
3098
|
colSpan: columns.length,
|
|
2964
3099
|
className: "lui-datagrid-empty"
|
|
2965
|
-
}, emptyMessage)) : table.getRowModel().rows.map((row) => /* @__PURE__ */
|
|
3100
|
+
}, emptyMessage)) : table.getRowModel().rows.map((row) => /* @__PURE__ */ React26__namespace.default.createElement("tr", {
|
|
2966
3101
|
key: row.id,
|
|
2967
3102
|
className: clsx.clsx("lui-datagrid-row", onRowClick && "lui-datagrid-row--clickable"),
|
|
2968
|
-
onClick: /* @__PURE__ */
|
|
2969
|
-
}, row.getVisibleCells().map((cell) => /* @__PURE__ */
|
|
3103
|
+
onClick: /* @__PURE__ */ chunk2HRO6CFU_js.__name(() => onRowClick?.(row.original), "onClick")
|
|
3104
|
+
}, row.getVisibleCells().map((cell) => /* @__PURE__ */ React26__namespace.default.createElement("td", {
|
|
2970
3105
|
key: cell.id,
|
|
2971
3106
|
className: "lui-datagrid-td"
|
|
2972
3107
|
}, reactTable.flexRender(cell.column.columnDef.cell, cell.getContext())))))))));
|
|
2973
3108
|
}
|
|
2974
|
-
|
|
3109
|
+
chunk2HRO6CFU_js.__name(DataGrid, "DataGrid");
|
|
2975
3110
|
chart_js.Chart.register(chart_js.CategoryScale, chart_js.LinearScale, chart_js.PointElement, chart_js.LineElement, chart_js.BarElement, chart_js.ArcElement, chart_js.Title, chart_js.Tooltip, chart_js.Legend);
|
|
2976
3111
|
function Chart({ type, data, options, height = 300, width = "100%", className }) {
|
|
2977
3112
|
const defaultOptions = {
|
|
@@ -3025,29 +3160,29 @@ function Chart({ type, data, options, height = 300, width = "100%", className })
|
|
|
3025
3160
|
...options?.plugins
|
|
3026
3161
|
}
|
|
3027
3162
|
};
|
|
3028
|
-
return /* @__PURE__ */
|
|
3163
|
+
return /* @__PURE__ */ React26__namespace.default.createElement("div", {
|
|
3029
3164
|
className: clsx.clsx("lui-chart", className),
|
|
3030
3165
|
style: {
|
|
3031
3166
|
height,
|
|
3032
3167
|
width
|
|
3033
3168
|
}
|
|
3034
|
-
}, /* @__PURE__ */
|
|
3169
|
+
}, /* @__PURE__ */ React26__namespace.default.createElement(reactChartjs2.Chart, {
|
|
3035
3170
|
type,
|
|
3036
3171
|
data,
|
|
3037
3172
|
options: mergedOptions
|
|
3038
3173
|
}));
|
|
3039
3174
|
}
|
|
3040
|
-
|
|
3175
|
+
chunk2HRO6CFU_js.__name(Chart, "Chart");
|
|
3041
3176
|
function AppShell({ header, sidebar, footer, sidebarPosition = "left", sidebarWidth = 240, autoResize = true, padding = "md", className, children, ...props }) {
|
|
3042
|
-
const containerRef =
|
|
3177
|
+
const containerRef = React26.useRef(null);
|
|
3043
3178
|
const { app } = useMcpApp();
|
|
3044
|
-
|
|
3179
|
+
React26.useEffect(() => {
|
|
3045
3180
|
if (!autoResize || !containerRef.current) return;
|
|
3046
3181
|
if (!app) return;
|
|
3047
3182
|
let lastWidth = 0;
|
|
3048
3183
|
let lastHeight = 0;
|
|
3049
3184
|
let scheduled = false;
|
|
3050
|
-
const sendSizeChanged = /* @__PURE__ */
|
|
3185
|
+
const sendSizeChanged = /* @__PURE__ */ chunk2HRO6CFU_js.__name(() => {
|
|
3051
3186
|
if (scheduled) return;
|
|
3052
3187
|
scheduled = true;
|
|
3053
3188
|
requestAnimationFrame(() => {
|
|
@@ -3080,222 +3215,234 @@ function AppShell({ header, sidebar, footer, sidebarPosition = "left", sidebarWi
|
|
|
3080
3215
|
width: typeof sidebarWidth === "number" ? `${sidebarWidth}px` : sidebarWidth,
|
|
3081
3216
|
flexShrink: 0
|
|
3082
3217
|
};
|
|
3083
|
-
return /* @__PURE__ */
|
|
3218
|
+
return /* @__PURE__ */ React26__namespace.default.createElement("div", {
|
|
3084
3219
|
ref: containerRef,
|
|
3085
3220
|
className: clsx.clsx("lui-app-shell", `lui-app-shell--padding-${padding}`, className),
|
|
3086
3221
|
...props
|
|
3087
|
-
}, header && /* @__PURE__ */
|
|
3222
|
+
}, header && /* @__PURE__ */ React26__namespace.default.createElement("header", {
|
|
3088
3223
|
className: "lui-app-shell-header"
|
|
3089
|
-
}, header), /* @__PURE__ */
|
|
3224
|
+
}, header), /* @__PURE__ */ React26__namespace.default.createElement("div", {
|
|
3090
3225
|
className: "lui-app-shell-body"
|
|
3091
|
-
}, sidebar && sidebarPosition === "left" && /* @__PURE__ */
|
|
3226
|
+
}, sidebar && sidebarPosition === "left" && /* @__PURE__ */ React26__namespace.default.createElement("aside", {
|
|
3092
3227
|
className: "lui-app-shell-sidebar",
|
|
3093
3228
|
style: sidebarStyle
|
|
3094
|
-
}, sidebar), /* @__PURE__ */
|
|
3229
|
+
}, sidebar), /* @__PURE__ */ React26__namespace.default.createElement("main", {
|
|
3095
3230
|
className: "lui-app-shell-main"
|
|
3096
|
-
}, children), sidebar && sidebarPosition === "right" && /* @__PURE__ */
|
|
3231
|
+
}, children), sidebar && sidebarPosition === "right" && /* @__PURE__ */ React26__namespace.default.createElement("aside", {
|
|
3097
3232
|
className: "lui-app-shell-sidebar",
|
|
3098
3233
|
style: sidebarStyle
|
|
3099
|
-
}, sidebar)), footer && /* @__PURE__ */
|
|
3234
|
+
}, sidebar)), footer && /* @__PURE__ */ React26__namespace.default.createElement("footer", {
|
|
3100
3235
|
className: "lui-app-shell-footer"
|
|
3101
3236
|
}, footer));
|
|
3102
3237
|
}
|
|
3103
|
-
|
|
3238
|
+
chunk2HRO6CFU_js.__name(AppShell, "AppShell");
|
|
3104
3239
|
function Tabs2({ tabs, defaultValue, value, onValueChange, children, className }) {
|
|
3105
3240
|
const defaultTab = defaultValue || tabs[0]?.value;
|
|
3106
|
-
return /* @__PURE__ */
|
|
3241
|
+
return /* @__PURE__ */ React26__namespace.default.createElement(TabsPrimitive2__namespace.Root, {
|
|
3107
3242
|
className: clsx.clsx("lui-tabs", className),
|
|
3108
3243
|
defaultValue: defaultTab,
|
|
3109
3244
|
value,
|
|
3110
3245
|
onValueChange
|
|
3111
|
-
}, /* @__PURE__ */
|
|
3246
|
+
}, /* @__PURE__ */ React26__namespace.default.createElement(TabsPrimitive2__namespace.List, {
|
|
3112
3247
|
className: "lui-tabs-list"
|
|
3113
|
-
}, tabs.map((tab) => /* @__PURE__ */
|
|
3248
|
+
}, tabs.map((tab) => /* @__PURE__ */ React26__namespace.default.createElement(TabsPrimitive2__namespace.Trigger, {
|
|
3114
3249
|
key: tab.value,
|
|
3115
3250
|
value: tab.value,
|
|
3116
3251
|
disabled: tab.disabled,
|
|
3117
3252
|
className: "lui-tabs-trigger"
|
|
3118
3253
|
}, tab.label))), children);
|
|
3119
3254
|
}
|
|
3120
|
-
|
|
3255
|
+
chunk2HRO6CFU_js.__name(Tabs2, "Tabs");
|
|
3121
3256
|
function TabContent({ value, children, className }) {
|
|
3122
|
-
return /* @__PURE__ */
|
|
3257
|
+
return /* @__PURE__ */ React26__namespace.default.createElement(TabsPrimitive2__namespace.Content, {
|
|
3123
3258
|
value,
|
|
3124
3259
|
className: clsx.clsx("lui-tabs-content", className)
|
|
3125
3260
|
}, children);
|
|
3126
3261
|
}
|
|
3127
|
-
|
|
3262
|
+
chunk2HRO6CFU_js.__name(TabContent, "TabContent");
|
|
3128
3263
|
function Modal({ open, defaultOpen, onOpenChange, title, description, children, className, trigger }) {
|
|
3129
|
-
return /* @__PURE__ */
|
|
3264
|
+
return /* @__PURE__ */ React26__namespace.default.createElement(DialogPrimitive__namespace.Root, {
|
|
3130
3265
|
open,
|
|
3131
3266
|
defaultOpen,
|
|
3132
3267
|
onOpenChange
|
|
3133
|
-
}, trigger && /* @__PURE__ */
|
|
3268
|
+
}, trigger && /* @__PURE__ */ React26__namespace.default.createElement(DialogPrimitive__namespace.Trigger, {
|
|
3134
3269
|
asChild: true
|
|
3135
|
-
}, trigger), /* @__PURE__ */
|
|
3270
|
+
}, trigger), /* @__PURE__ */ React26__namespace.default.createElement(DialogPrimitive__namespace.Portal, null, /* @__PURE__ */ React26__namespace.default.createElement(DialogPrimitive__namespace.Overlay, {
|
|
3136
3271
|
className: "lui-modal-overlay"
|
|
3137
|
-
}), /* @__PURE__ */
|
|
3272
|
+
}), /* @__PURE__ */ React26__namespace.default.createElement(DialogPrimitive__namespace.Content, {
|
|
3138
3273
|
className: clsx.clsx("lui-modal-content", className)
|
|
3139
|
-
}, title && /* @__PURE__ */
|
|
3274
|
+
}, title && /* @__PURE__ */ React26__namespace.default.createElement(DialogPrimitive__namespace.Title, {
|
|
3140
3275
|
className: "lui-modal-title"
|
|
3141
|
-
}, title), description && /* @__PURE__ */
|
|
3276
|
+
}, title), description && /* @__PURE__ */ React26__namespace.default.createElement(DialogPrimitive__namespace.Description, {
|
|
3142
3277
|
className: "lui-modal-description"
|
|
3143
|
-
}, description), children, /* @__PURE__ */
|
|
3278
|
+
}, description), children, /* @__PURE__ */ React26__namespace.default.createElement(DialogPrimitive__namespace.Close, {
|
|
3144
3279
|
className: "lui-modal-close",
|
|
3145
3280
|
"aria-label": "Close"
|
|
3146
|
-
}, /* @__PURE__ */
|
|
3281
|
+
}, /* @__PURE__ */ React26__namespace.default.createElement(CloseIcon, null)))));
|
|
3147
3282
|
}
|
|
3148
|
-
|
|
3283
|
+
chunk2HRO6CFU_js.__name(Modal, "Modal");
|
|
3149
3284
|
function CloseIcon() {
|
|
3150
|
-
return /* @__PURE__ */
|
|
3285
|
+
return /* @__PURE__ */ React26__namespace.default.createElement("svg", {
|
|
3151
3286
|
width: "14",
|
|
3152
3287
|
height: "14",
|
|
3153
3288
|
viewBox: "0 0 14 14",
|
|
3154
3289
|
fill: "none"
|
|
3155
|
-
}, /* @__PURE__ */
|
|
3290
|
+
}, /* @__PURE__ */ React26__namespace.default.createElement("path", {
|
|
3156
3291
|
d: "M3.5 3.5L10.5 10.5M10.5 3.5L3.5 10.5",
|
|
3157
3292
|
stroke: "currentColor",
|
|
3158
3293
|
strokeWidth: "1.5",
|
|
3159
3294
|
strokeLinecap: "round"
|
|
3160
3295
|
}));
|
|
3161
3296
|
}
|
|
3162
|
-
|
|
3297
|
+
chunk2HRO6CFU_js.__name(CloseIcon, "CloseIcon");
|
|
3163
3298
|
function CodeBlock({ code, language = "text", showLineNumbers = false, copyable = true, className }) {
|
|
3164
|
-
const [copied, setCopied] =
|
|
3165
|
-
const handleCopy = /* @__PURE__ */
|
|
3299
|
+
const [copied, setCopied] = React26__namespace.default.useState(false);
|
|
3300
|
+
const handleCopy = /* @__PURE__ */ chunk2HRO6CFU_js.__name(async () => {
|
|
3166
3301
|
await navigator.clipboard.writeText(code);
|
|
3167
3302
|
setCopied(true);
|
|
3168
3303
|
setTimeout(() => setCopied(false), 2e3);
|
|
3169
3304
|
}, "handleCopy");
|
|
3170
|
-
return /* @__PURE__ */
|
|
3305
|
+
return /* @__PURE__ */ React26__namespace.default.createElement("div", {
|
|
3171
3306
|
className: clsx.clsx("lui-code-block", className)
|
|
3172
|
-
}, copyable && /* @__PURE__ */
|
|
3307
|
+
}, copyable && /* @__PURE__ */ React26__namespace.default.createElement("button", {
|
|
3173
3308
|
type: "button",
|
|
3174
3309
|
className: "lui-code-block-copy",
|
|
3175
3310
|
onClick: handleCopy,
|
|
3176
3311
|
"aria-label": copied ? "Copied!" : "Copy code"
|
|
3177
|
-
}, copied ? /* @__PURE__ */
|
|
3312
|
+
}, copied ? /* @__PURE__ */ React26__namespace.default.createElement("svg", {
|
|
3178
3313
|
viewBox: "0 0 24 24",
|
|
3179
3314
|
fill: "none",
|
|
3180
3315
|
stroke: "currentColor",
|
|
3181
3316
|
strokeWidth: "2"
|
|
3182
|
-
}, /* @__PURE__ */
|
|
3317
|
+
}, /* @__PURE__ */ React26__namespace.default.createElement("polyline", {
|
|
3183
3318
|
points: "20,6 9,17 4,12"
|
|
3184
|
-
})) : /* @__PURE__ */
|
|
3319
|
+
})) : /* @__PURE__ */ React26__namespace.default.createElement("svg", {
|
|
3185
3320
|
viewBox: "0 0 24 24",
|
|
3186
3321
|
fill: "none",
|
|
3187
3322
|
stroke: "currentColor",
|
|
3188
3323
|
strokeWidth: "2"
|
|
3189
|
-
}, /* @__PURE__ */
|
|
3324
|
+
}, /* @__PURE__ */ React26__namespace.default.createElement("rect", {
|
|
3190
3325
|
x: "9",
|
|
3191
3326
|
y: "9",
|
|
3192
3327
|
width: "13",
|
|
3193
3328
|
height: "13",
|
|
3194
3329
|
rx: "2",
|
|
3195
3330
|
ry: "2"
|
|
3196
|
-
}), /* @__PURE__ */
|
|
3331
|
+
}), /* @__PURE__ */ React26__namespace.default.createElement("path", {
|
|
3197
3332
|
d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"
|
|
3198
|
-
}))), /* @__PURE__ */
|
|
3333
|
+
}))), /* @__PURE__ */ React26__namespace.default.createElement(prismReactRenderer.Highlight, {
|
|
3199
3334
|
theme: prismReactRenderer.themes.nightOwl,
|
|
3200
3335
|
code: code.trim(),
|
|
3201
3336
|
language
|
|
3202
|
-
}, ({ className: hlClassName, style, tokens, getLineProps, getTokenProps }) => /* @__PURE__ */
|
|
3337
|
+
}, ({ className: hlClassName, style, tokens, getLineProps, getTokenProps }) => /* @__PURE__ */ React26__namespace.default.createElement("pre", {
|
|
3203
3338
|
className: clsx.clsx("lui-code-block-pre", hlClassName),
|
|
3204
3339
|
style
|
|
3205
|
-
}, tokens.map((line, i) => /* @__PURE__ */
|
|
3340
|
+
}, tokens.map((line, i) => /* @__PURE__ */ React26__namespace.default.createElement("div", {
|
|
3206
3341
|
key: i,
|
|
3207
3342
|
...getLineProps({
|
|
3208
3343
|
line
|
|
3209
3344
|
})
|
|
3210
|
-
}, showLineNumbers && /* @__PURE__ */
|
|
3345
|
+
}, showLineNumbers && /* @__PURE__ */ React26__namespace.default.createElement("span", {
|
|
3211
3346
|
className: "lui-code-block-line-number"
|
|
3212
|
-
}, i + 1), line.map((token, key) => /* @__PURE__ */
|
|
3347
|
+
}, i + 1), line.map((token, key) => /* @__PURE__ */ React26__namespace.default.createElement("span", {
|
|
3213
3348
|
key,
|
|
3214
3349
|
...getTokenProps({
|
|
3215
3350
|
token
|
|
3216
3351
|
})
|
|
3217
3352
|
})))))));
|
|
3218
3353
|
}
|
|
3219
|
-
|
|
3220
|
-
var Card2 = /* @__PURE__ */
|
|
3221
|
-
return /* @__PURE__ */
|
|
3354
|
+
chunk2HRO6CFU_js.__name(CodeBlock, "CodeBlock");
|
|
3355
|
+
var Card2 = /* @__PURE__ */ React26.forwardRef(({ className, variant = "default", padding = "md", interactive = false, children, ...props }, ref) => {
|
|
3356
|
+
return /* @__PURE__ */ React26__namespace.default.createElement("div", {
|
|
3222
3357
|
ref,
|
|
3223
3358
|
className: clsx.clsx("lui-card", `lui-card--${variant}`, `lui-card--padding-${padding}`, interactive && "lui-card--interactive", className),
|
|
3224
3359
|
...props
|
|
3225
3360
|
}, children);
|
|
3226
3361
|
});
|
|
3227
3362
|
Card2.displayName = "Card";
|
|
3228
|
-
var CardHeader2 = /* @__PURE__ */
|
|
3229
|
-
return /* @__PURE__ */
|
|
3363
|
+
var CardHeader2 = /* @__PURE__ */ React26.forwardRef(({ className, title, description, action, children, ...props }, ref) => {
|
|
3364
|
+
return /* @__PURE__ */ React26__namespace.default.createElement("div", {
|
|
3230
3365
|
ref,
|
|
3231
3366
|
className: clsx.clsx("lui-card-header", className),
|
|
3232
3367
|
...props
|
|
3233
|
-
}, (title || description) && /* @__PURE__ */
|
|
3368
|
+
}, (title || description) && /* @__PURE__ */ React26__namespace.default.createElement("div", {
|
|
3234
3369
|
className: "lui-card-header__text"
|
|
3235
|
-
}, title && /* @__PURE__ */
|
|
3370
|
+
}, title && /* @__PURE__ */ React26__namespace.default.createElement("h3", {
|
|
3236
3371
|
className: "lui-card-header__title"
|
|
3237
|
-
}, title), description && /* @__PURE__ */
|
|
3372
|
+
}, title), description && /* @__PURE__ */ React26__namespace.default.createElement("p", {
|
|
3238
3373
|
className: "lui-card-header__description"
|
|
3239
|
-
}, description)), action && /* @__PURE__ */
|
|
3374
|
+
}, description)), action && /* @__PURE__ */ React26__namespace.default.createElement("div", {
|
|
3240
3375
|
className: "lui-card-header__action"
|
|
3241
3376
|
}, action), children);
|
|
3242
3377
|
});
|
|
3243
3378
|
CardHeader2.displayName = "CardHeader";
|
|
3244
|
-
var CardContent2 = /* @__PURE__ */
|
|
3245
|
-
return /* @__PURE__ */
|
|
3379
|
+
var CardContent2 = /* @__PURE__ */ React26.forwardRef(({ className, children, ...props }, ref) => {
|
|
3380
|
+
return /* @__PURE__ */ React26__namespace.default.createElement("div", {
|
|
3246
3381
|
ref,
|
|
3247
3382
|
className: clsx.clsx("lui-card-content", className),
|
|
3248
3383
|
...props
|
|
3249
3384
|
}, children);
|
|
3250
3385
|
});
|
|
3251
3386
|
CardContent2.displayName = "CardContent";
|
|
3252
|
-
var CardFooter2 = /* @__PURE__ */
|
|
3253
|
-
return /* @__PURE__ */
|
|
3387
|
+
var CardFooter2 = /* @__PURE__ */ React26.forwardRef(({ className, children, ...props }, ref) => {
|
|
3388
|
+
return /* @__PURE__ */ React26__namespace.default.createElement("div", {
|
|
3254
3389
|
ref,
|
|
3255
3390
|
className: clsx.clsx("lui-card-footer", className),
|
|
3256
3391
|
...props
|
|
3257
3392
|
}, children);
|
|
3258
3393
|
});
|
|
3259
3394
|
CardFooter2.displayName = "CardFooter";
|
|
3260
|
-
var Input2 = /* @__PURE__ */
|
|
3395
|
+
var Input2 = /* @__PURE__ */ React26.forwardRef(({ className, label, helperText, error, size = "md", leftElement, rightElement, fullWidth = false, id, ...props }, ref) => {
|
|
3261
3396
|
const inputId = id || `input-${Math.random().toString(36).substr(2, 9)}`;
|
|
3262
3397
|
const hasError = Boolean(error);
|
|
3263
|
-
return /* @__PURE__ */
|
|
3398
|
+
return /* @__PURE__ */ React26__namespace.default.createElement("div", {
|
|
3264
3399
|
className: clsx.clsx("lui-input-wrapper", fullWidth && "lui-input-wrapper--full-width", className)
|
|
3265
|
-
}, label && /* @__PURE__ */
|
|
3400
|
+
}, label && /* @__PURE__ */ React26__namespace.default.createElement("label", {
|
|
3266
3401
|
htmlFor: inputId,
|
|
3267
3402
|
className: "lui-input-label"
|
|
3268
|
-
}, label), /* @__PURE__ */
|
|
3403
|
+
}, label), /* @__PURE__ */ React26__namespace.default.createElement("div", {
|
|
3269
3404
|
className: clsx.clsx("lui-input-container", `lui-input-container--${size}`, hasError && "lui-input-container--error", leftElement && "lui-input-container--has-left", rightElement && "lui-input-container--has-right")
|
|
3270
|
-
}, leftElement && /* @__PURE__ */
|
|
3405
|
+
}, leftElement && /* @__PURE__ */ React26__namespace.default.createElement("span", {
|
|
3271
3406
|
className: "lui-input-element lui-input-element--left"
|
|
3272
|
-
}, leftElement), /* @__PURE__ */
|
|
3407
|
+
}, leftElement), /* @__PURE__ */ React26__namespace.default.createElement("input", {
|
|
3273
3408
|
ref,
|
|
3274
3409
|
id: inputId,
|
|
3275
3410
|
className: "lui-input",
|
|
3276
3411
|
"aria-invalid": hasError,
|
|
3277
3412
|
"aria-describedby": error ? `${inputId}-error` : helperText ? `${inputId}-helper` : void 0,
|
|
3278
3413
|
...props
|
|
3279
|
-
}), rightElement && /* @__PURE__ */
|
|
3414
|
+
}), rightElement && /* @__PURE__ */ React26__namespace.default.createElement("span", {
|
|
3280
3415
|
className: "lui-input-element lui-input-element--right"
|
|
3281
|
-
}, rightElement)), (error || helperText) && /* @__PURE__ */
|
|
3416
|
+
}, rightElement)), (error || helperText) && /* @__PURE__ */ React26__namespace.default.createElement("p", {
|
|
3282
3417
|
id: error ? `${inputId}-error` : `${inputId}-helper`,
|
|
3283
3418
|
className: clsx.clsx("lui-input-message", error && "lui-input-message--error")
|
|
3284
3419
|
}, error || helperText));
|
|
3285
3420
|
});
|
|
3286
3421
|
Input2.displayName = "Input";
|
|
3287
3422
|
|
|
3423
|
+
Object.defineProperty(exports, "GPTApp", {
|
|
3424
|
+
enumerable: true,
|
|
3425
|
+
get: function () { return chunk2HRO6CFU_js.GPTApp; }
|
|
3426
|
+
});
|
|
3288
3427
|
Object.defineProperty(exports, "UIApp", {
|
|
3289
3428
|
enumerable: true,
|
|
3290
|
-
get: function () { return
|
|
3429
|
+
get: function () { return chunk2HRO6CFU_js.UIApp; }
|
|
3430
|
+
});
|
|
3431
|
+
Object.defineProperty(exports, "getGPTAppMetadata", {
|
|
3432
|
+
enumerable: true,
|
|
3433
|
+
get: function () { return chunk2HRO6CFU_js.getGPTAppMetadata; }
|
|
3434
|
+
});
|
|
3435
|
+
Object.defineProperty(exports, "getGPTAppUri", {
|
|
3436
|
+
enumerable: true,
|
|
3437
|
+
get: function () { return chunk2HRO6CFU_js.getGPTAppUri; }
|
|
3291
3438
|
});
|
|
3292
3439
|
Object.defineProperty(exports, "getUIAppMetadata", {
|
|
3293
3440
|
enumerable: true,
|
|
3294
|
-
get: function () { return
|
|
3441
|
+
get: function () { return chunk2HRO6CFU_js.getUIAppMetadata; }
|
|
3295
3442
|
});
|
|
3296
3443
|
Object.defineProperty(exports, "getUIAppUri", {
|
|
3297
3444
|
enumerable: true,
|
|
3298
|
-
get: function () { return
|
|
3445
|
+
get: function () { return chunk2HRO6CFU_js.getUIAppUri; }
|
|
3299
3446
|
});
|
|
3300
3447
|
Object.defineProperty(exports, "App", {
|
|
3301
3448
|
enumerable: true,
|
|
@@ -3305,6 +3452,30 @@ Object.defineProperty(exports, "PostMessageTransport", {
|
|
|
3305
3452
|
enumerable: true,
|
|
3306
3453
|
get: function () { return extApps.PostMessageTransport; }
|
|
3307
3454
|
});
|
|
3455
|
+
Object.defineProperty(exports, "RESOURCE_MIME_TYPE", {
|
|
3456
|
+
enumerable: true,
|
|
3457
|
+
get: function () { return extApps.RESOURCE_MIME_TYPE; }
|
|
3458
|
+
});
|
|
3459
|
+
Object.defineProperty(exports, "RESOURCE_URI_META_KEY", {
|
|
3460
|
+
enumerable: true,
|
|
3461
|
+
get: function () { return extApps.RESOURCE_URI_META_KEY; }
|
|
3462
|
+
});
|
|
3463
|
+
Object.defineProperty(exports, "applyDocumentTheme", {
|
|
3464
|
+
enumerable: true,
|
|
3465
|
+
get: function () { return extApps.applyDocumentTheme; }
|
|
3466
|
+
});
|
|
3467
|
+
Object.defineProperty(exports, "applyHostFonts", {
|
|
3468
|
+
enumerable: true,
|
|
3469
|
+
get: function () { return extApps.applyHostFonts; }
|
|
3470
|
+
});
|
|
3471
|
+
Object.defineProperty(exports, "applyHostStyleVariables", {
|
|
3472
|
+
enumerable: true,
|
|
3473
|
+
get: function () { return extApps.applyHostStyleVariables; }
|
|
3474
|
+
});
|
|
3475
|
+
Object.defineProperty(exports, "getDocumentTheme", {
|
|
3476
|
+
enumerable: true,
|
|
3477
|
+
get: function () { return extApps.getDocumentTheme; }
|
|
3478
|
+
});
|
|
3308
3479
|
Object.defineProperty(exports, "AppBridge", {
|
|
3309
3480
|
enumerable: true,
|
|
3310
3481
|
get: function () { return appBridge.AppBridge; }
|
|
@@ -3369,6 +3540,7 @@ exports.FormField = FormField;
|
|
|
3369
3540
|
exports.FormItem = FormItem;
|
|
3370
3541
|
exports.FormLabel = FormLabel;
|
|
3371
3542
|
exports.FormMessage = FormMessage;
|
|
3543
|
+
exports.GPTAppProvider = GPTAppProvider;
|
|
3372
3544
|
exports.INITIAL_TOOL_STATE = INITIAL_TOOL_STATE;
|
|
3373
3545
|
exports.Input = Input2;
|
|
3374
3546
|
exports.Label = Label2;
|
|
@@ -3428,6 +3600,8 @@ exports.buttonVariants = buttonVariants;
|
|
|
3428
3600
|
exports.cn = cn;
|
|
3429
3601
|
exports.normalizeToolBinding = normalizeToolBinding;
|
|
3430
3602
|
exports.useFormField = useFormField;
|
|
3603
|
+
exports.useGptApp = useGptApp;
|
|
3604
|
+
exports.useGptTool = useGptTool;
|
|
3431
3605
|
exports.useHostContext = useHostContext;
|
|
3432
3606
|
exports.useMcpApp = useMcpApp;
|
|
3433
3607
|
exports.useMessage = useMessage;
|