@getcatalystiq/agent-plane-ui 0.1.17 → 0.1.19
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/dist/{chunk-P4N2P42X.js → chunk-OOBDCC6Q.js} +75 -2
- package/dist/{chunk-4XBBDUSZ.cjs → chunk-VBGYWQUF.cjs} +81 -0
- package/dist/editor.cjs +291 -21
- package/dist/editor.d.cts +50 -1
- package/dist/editor.d.ts +50 -1
- package/dist/editor.js +271 -2
- package/dist/index.cjs +570 -622
- package/dist/index.js +11 -87
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkVBGYWQUF_cjs = require('./chunk-VBGYWQUF.cjs');
|
|
4
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
-
var
|
|
5
|
+
var React = require('react');
|
|
6
6
|
var swr = require('swr');
|
|
7
7
|
var ReactMarkdown = require('react-markdown');
|
|
8
8
|
var cmdk = require('cmdk');
|
|
@@ -29,7 +29,7 @@ function _interopNamespace(e) {
|
|
|
29
29
|
return Object.freeze(n);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
33
33
|
var ReactMarkdown__default = /*#__PURE__*/_interopDefault(ReactMarkdown);
|
|
34
34
|
var Popover__namespace = /*#__PURE__*/_interopNamespace(Popover);
|
|
35
35
|
var remarkGfm__default = /*#__PURE__*/_interopDefault(remarkGfm);
|
|
@@ -50,12 +50,12 @@ function Select({ className = "", ...props }) {
|
|
|
50
50
|
] }) })
|
|
51
51
|
] });
|
|
52
52
|
}
|
|
53
|
-
var Textarea =
|
|
53
|
+
var Textarea = React__namespace.forwardRef(
|
|
54
54
|
({ className, ...props }, ref) => {
|
|
55
55
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
56
56
|
"textarea",
|
|
57
57
|
{
|
|
58
|
-
className:
|
|
58
|
+
className: chunkVBGYWQUF_cjs.cn(
|
|
59
59
|
"flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
|
|
60
60
|
className
|
|
61
61
|
),
|
|
@@ -66,20 +66,12 @@ var Textarea = React3__namespace.forwardRef(
|
|
|
66
66
|
}
|
|
67
67
|
);
|
|
68
68
|
Textarea.displayName = "Textarea";
|
|
69
|
-
function FormField({ label, children, error, hint }) {
|
|
70
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
|
|
71
|
-
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-xs font-medium text-muted-foreground", children: label }),
|
|
72
|
-
children,
|
|
73
|
-
hint && !error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground mt-1", children: hint }),
|
|
74
|
-
error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-destructive mt-1", children: error })
|
|
75
|
-
] });
|
|
76
|
-
}
|
|
77
69
|
function FormError({ error }) {
|
|
78
70
|
if (!error) return null;
|
|
79
71
|
return /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-destructive", children: error });
|
|
80
72
|
}
|
|
81
73
|
function SectionHeader({ title, children, className }) {
|
|
82
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
74
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkVBGYWQUF_cjs.cn("flex items-center justify-between mb-3", className), children: [
|
|
83
75
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold", children: title }),
|
|
84
76
|
children
|
|
85
77
|
] });
|
|
@@ -103,13 +95,13 @@ function DetailPageHeader({ backHref, backLabel, title, actions, badge, subtitle
|
|
|
103
95
|
] });
|
|
104
96
|
}
|
|
105
97
|
function MetricCard({ label, children, className }) {
|
|
106
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
107
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
108
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
98
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.Card, { className, children: [
|
|
99
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.CardHeader, { className: "pb-2", children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.CardTitle, { className: "text-sm font-medium text-muted-foreground", children: label }) }),
|
|
100
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.CardContent, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-2xl font-bold", children }) })
|
|
109
101
|
] });
|
|
110
102
|
}
|
|
111
103
|
function AdminTable({ children, footer, className }) {
|
|
112
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
104
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkVBGYWQUF_cjs.cn("rounded-lg border border-border", className), children: [
|
|
113
105
|
/* @__PURE__ */ jsxRuntime.jsx("table", { className: "w-full text-sm", children }),
|
|
114
106
|
footer
|
|
115
107
|
] });
|
|
@@ -118,10 +110,10 @@ function AdminTableHead({ children }) {
|
|
|
118
110
|
return /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsx("tr", { className: "border-b border-border bg-muted/50", children }) });
|
|
119
111
|
}
|
|
120
112
|
function Th({ children, className, align = "left" }) {
|
|
121
|
-
return /* @__PURE__ */ jsxRuntime.jsx("th", { className:
|
|
113
|
+
return /* @__PURE__ */ jsxRuntime.jsx("th", { className: chunkVBGYWQUF_cjs.cn("p-3 font-medium", align === "right" ? "text-right" : "text-left", className), children });
|
|
122
114
|
}
|
|
123
115
|
function AdminTableRow({ children, className }) {
|
|
124
|
-
return /* @__PURE__ */ jsxRuntime.jsx("tr", { className:
|
|
116
|
+
return /* @__PURE__ */ jsxRuntime.jsx("tr", { className: chunkVBGYWQUF_cjs.cn("border-b border-border hover:bg-muted/30 transition-colors", className), children });
|
|
125
117
|
}
|
|
126
118
|
function EmptyRow({ colSpan, children = "No results found" }) {
|
|
127
119
|
return /* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan, className: "p-8 text-center text-muted-foreground", children }) });
|
|
@@ -164,7 +156,7 @@ function PaginationBar({
|
|
|
164
156
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between px-3 py-2 border-t border-border bg-muted/20 text-sm", children: [
|
|
165
157
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-muted-foreground", children: [
|
|
166
158
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Rows per page:" }),
|
|
167
|
-
PAGE_SIZE_OPTIONS.map((ps) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
159
|
+
PAGE_SIZE_OPTIONS.map((ps) => /* @__PURE__ */ jsxRuntime.jsx(React__namespace.default.Fragment, { children: renderLink(
|
|
168
160
|
buildHref(1, ps),
|
|
169
161
|
ps,
|
|
170
162
|
`px-2 py-0.5 rounded text-xs ${pageSize === ps ? "bg-primary text-primary-foreground font-medium" : "hover:bg-muted"}`
|
|
@@ -195,7 +187,7 @@ function parsePaginationParams(pageParam, pageSizeParam, defaultPageSize = 20) {
|
|
|
195
187
|
return { page, pageSize, offset };
|
|
196
188
|
}
|
|
197
189
|
function Tabs({ tabs, defaultTab = 0 }) {
|
|
198
|
-
const [active, setActive] =
|
|
190
|
+
const [active, setActive] = React.useState(defaultTab);
|
|
199
191
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
200
192
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-4", children: tabs.map((tab, i) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
201
193
|
"button",
|
|
@@ -212,71 +204,6 @@ function Tabs({ tabs, defaultTab = 0 }) {
|
|
|
212
204
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "pt-6", children: tabs[active]?.content })
|
|
213
205
|
] });
|
|
214
206
|
}
|
|
215
|
-
function Dialog({ open, onOpenChange, children }) {
|
|
216
|
-
React3__namespace.useEffect(() => {
|
|
217
|
-
if (!open) return;
|
|
218
|
-
function onKeyDown(e) {
|
|
219
|
-
if (e.key === "Escape") onOpenChange(false);
|
|
220
|
-
}
|
|
221
|
-
document.addEventListener("keydown", onKeyDown);
|
|
222
|
-
return () => document.removeEventListener("keydown", onKeyDown);
|
|
223
|
-
}, [open, onOpenChange]);
|
|
224
|
-
React3__namespace.useEffect(() => {
|
|
225
|
-
if (!open) return;
|
|
226
|
-
const prev = document.body.style.overflow;
|
|
227
|
-
document.body.style.overflow = "hidden";
|
|
228
|
-
return () => {
|
|
229
|
-
document.body.style.overflow = prev;
|
|
230
|
-
};
|
|
231
|
-
}, [open]);
|
|
232
|
-
if (!open) return null;
|
|
233
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "fixed inset-0 z-50 flex items-center justify-center", children: [
|
|
234
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
235
|
-
"div",
|
|
236
|
-
{
|
|
237
|
-
className: "absolute inset-0 bg-black/60 animate-dialog-overlay",
|
|
238
|
-
onClick: () => onOpenChange(false)
|
|
239
|
-
}
|
|
240
|
-
),
|
|
241
|
-
children
|
|
242
|
-
] });
|
|
243
|
-
}
|
|
244
|
-
function DialogContent({ className, children, ...props }) {
|
|
245
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
246
|
-
"div",
|
|
247
|
-
{
|
|
248
|
-
className: chunk4XBBDUSZ_cjs.cn(
|
|
249
|
-
"relative z-10 w-full bg-background border border-border rounded-xl shadow-2xl mx-4 max-h-[85vh] overflow-y-auto animate-dialog-content",
|
|
250
|
-
className
|
|
251
|
-
),
|
|
252
|
-
onClick: (e) => e.stopPropagation(),
|
|
253
|
-
...props,
|
|
254
|
-
children
|
|
255
|
-
}
|
|
256
|
-
);
|
|
257
|
-
}
|
|
258
|
-
function DialogHeader({ className, children, ...props }) {
|
|
259
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunk4XBBDUSZ_cjs.cn("px-6 pt-6 pb-0", className), ...props, children });
|
|
260
|
-
}
|
|
261
|
-
function DialogBody({ className, children, ...props }) {
|
|
262
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunk4XBBDUSZ_cjs.cn("px-6 py-4", className), ...props, children });
|
|
263
|
-
}
|
|
264
|
-
function DialogFooter({ className, children, ...props }) {
|
|
265
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
266
|
-
"div",
|
|
267
|
-
{
|
|
268
|
-
className: chunk4XBBDUSZ_cjs.cn("flex items-center justify-end gap-2 px-6 py-4 border-t border-border bg-muted/30 rounded-b-xl", className),
|
|
269
|
-
...props,
|
|
270
|
-
children
|
|
271
|
-
}
|
|
272
|
-
);
|
|
273
|
-
}
|
|
274
|
-
function DialogTitle({ className, children, ...props }) {
|
|
275
|
-
return /* @__PURE__ */ jsxRuntime.jsx("h2", { className: chunk4XBBDUSZ_cjs.cn("text-base font-semibold", className), ...props, children });
|
|
276
|
-
}
|
|
277
|
-
function DialogDescription({ className, children, ...props }) {
|
|
278
|
-
return /* @__PURE__ */ jsxRuntime.jsx("p", { className: chunk4XBBDUSZ_cjs.cn("text-sm text-muted-foreground mt-1", className), ...props, children });
|
|
279
|
-
}
|
|
280
207
|
function ConfirmDialog({
|
|
281
208
|
open,
|
|
282
209
|
onOpenChange,
|
|
@@ -289,20 +216,20 @@ function ConfirmDialog({
|
|
|
289
216
|
onConfirm,
|
|
290
217
|
variant = "destructive"
|
|
291
218
|
}) {
|
|
292
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContent, { className: "max-w-sm", children: [
|
|
293
|
-
/* @__PURE__ */ jsxRuntime.jsx(DialogHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { children: title }) }),
|
|
294
|
-
/* @__PURE__ */ jsxRuntime.jsxs(DialogBody, { children: [
|
|
219
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.DialogContent, { className: "max-w-sm", children: [
|
|
220
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.DialogHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.DialogTitle, { children: title }) }),
|
|
221
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.DialogBody, { children: [
|
|
295
222
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-muted-foreground", children }),
|
|
296
223
|
error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-destructive mt-3", children: error })
|
|
297
224
|
] }),
|
|
298
|
-
/* @__PURE__ */ jsxRuntime.jsxs(DialogFooter, { children: [
|
|
299
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
300
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
225
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.DialogFooter, { children: [
|
|
226
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { size: "sm", variant: "outline", onClick: () => onOpenChange(false), disabled: loading, children: "Cancel" }),
|
|
227
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { size: "sm", variant, onClick: onConfirm, disabled: loading, children: loading ? loadingLabel : confirmLabel })
|
|
301
228
|
] })
|
|
302
229
|
] }) });
|
|
303
230
|
}
|
|
304
231
|
function CopyButton({ text, className = "" }) {
|
|
305
|
-
const [copied, setCopied] =
|
|
232
|
+
const [copied, setCopied] = React.useState(false);
|
|
306
233
|
async function handleCopy() {
|
|
307
234
|
await navigator.clipboard.writeText(text);
|
|
308
235
|
setCopied(true);
|
|
@@ -329,7 +256,7 @@ function CopyButton({ text, className = "" }) {
|
|
|
329
256
|
}
|
|
330
257
|
function RunStatusBadge({ status }) {
|
|
331
258
|
const variant = status === "completed" ? "default" : status === "running" ? "secondary" : status === "failed" || status === "timed_out" ? "destructive" : "outline";
|
|
332
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
259
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Badge, { variant, children: status.replace("_", " ") });
|
|
333
260
|
}
|
|
334
261
|
var STYLES = {
|
|
335
262
|
schedule: "bg-blue-500/10 text-blue-400",
|
|
@@ -354,8 +281,8 @@ function LocalDate({ value, fallback = "\u2014" }) {
|
|
|
354
281
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: new Date(value).toLocaleString() });
|
|
355
282
|
}
|
|
356
283
|
function DashboardPage({ initialData, chartComponent: ChartComponent }) {
|
|
357
|
-
const { LinkComponent, basePath } =
|
|
358
|
-
const { data, error, isLoading } =
|
|
284
|
+
const { LinkComponent, basePath } = chunkVBGYWQUF_cjs.useNavigation();
|
|
285
|
+
const { data, error, isLoading } = chunkVBGYWQUF_cjs.useApi(
|
|
359
286
|
"dashboard",
|
|
360
287
|
async (client) => {
|
|
361
288
|
const [stats2, daily_stats2] = await Promise.all([
|
|
@@ -374,10 +301,10 @@ function DashboardPage({ initialData, chartComponent: ChartComponent }) {
|
|
|
374
301
|
}
|
|
375
302
|
if (isLoading || !data) {
|
|
376
303
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
|
|
377
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-4 gap-4", children: Array.from({ length: 4 }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
304
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-4 gap-4", children: Array.from({ length: 4 }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Skeleton, { className: "h-24 rounded-lg" }, i)) }),
|
|
378
305
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
379
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
380
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
306
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Skeleton, { className: "h-64 rounded-lg" }),
|
|
307
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Skeleton, { className: "h-64 rounded-lg" })
|
|
381
308
|
] })
|
|
382
309
|
] });
|
|
383
310
|
}
|
|
@@ -405,12 +332,12 @@ var SOURCES = [
|
|
|
405
332
|
];
|
|
406
333
|
var VALID_SOURCES = SOURCES.filter((s) => s.value).map((s) => s.value);
|
|
407
334
|
function RunListPage({ initialData }) {
|
|
408
|
-
const { LinkComponent, basePath } =
|
|
409
|
-
const [page, setPage] =
|
|
410
|
-
const [pageSize, setPageSize] =
|
|
411
|
-
const [sourceFilter, setSourceFilter] =
|
|
335
|
+
const { LinkComponent, basePath } = chunkVBGYWQUF_cjs.useNavigation();
|
|
336
|
+
const [page, setPage] = React.useState(1);
|
|
337
|
+
const [pageSize, setPageSize] = React.useState(20);
|
|
338
|
+
const [sourceFilter, setSourceFilter] = React.useState(null);
|
|
412
339
|
const cacheKey = `runs-${page}-${pageSize}-${sourceFilter || "all"}`;
|
|
413
|
-
const { data, error, isLoading } =
|
|
340
|
+
const { data, error, isLoading } = chunkVBGYWQUF_cjs.useApi(
|
|
414
341
|
cacheKey,
|
|
415
342
|
(client) => {
|
|
416
343
|
return client.runs.list({
|
|
@@ -421,12 +348,12 @@ function RunListPage({ initialData }) {
|
|
|
421
348
|
},
|
|
422
349
|
initialData ? { fallbackData: initialData } : void 0
|
|
423
350
|
);
|
|
424
|
-
const handleSourceChange =
|
|
351
|
+
const handleSourceChange = React.useCallback((e) => {
|
|
425
352
|
const value = e.target.value;
|
|
426
353
|
setSourceFilter(VALID_SOURCES.includes(value) ? value : null);
|
|
427
354
|
setPage(1);
|
|
428
355
|
}, []);
|
|
429
|
-
const handlePaginationNavigate =
|
|
356
|
+
const handlePaginationNavigate = React.useCallback((href) => {
|
|
430
357
|
const url = new URL(href, "http://localhost");
|
|
431
358
|
const p = parseInt(url.searchParams.get("page") || "1", 10);
|
|
432
359
|
const ps = parseInt(url.searchParams.get("pageSize") || "20", 10);
|
|
@@ -441,8 +368,8 @@ function RunListPage({ initialData }) {
|
|
|
441
368
|
}
|
|
442
369
|
if (isLoading || !data) {
|
|
443
370
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
444
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
445
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
371
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Skeleton, { className: "h-9 w-40" }),
|
|
372
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Skeleton, { className: "h-96 rounded-lg" })
|
|
446
373
|
] });
|
|
447
374
|
}
|
|
448
375
|
const runs = data.data;
|
|
@@ -602,10 +529,10 @@ function buildConversation(events) {
|
|
|
602
529
|
return items;
|
|
603
530
|
}
|
|
604
531
|
function TranscriptViewer({ transcript, prompt }) {
|
|
605
|
-
const conversation =
|
|
606
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
607
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
608
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
532
|
+
const conversation = React.useMemo(() => buildConversation(transcript), [transcript]);
|
|
533
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.Card, { children: [
|
|
534
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.CardHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.CardTitle, { className: "text-base", children: "Transcript" }) }),
|
|
535
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.CardContent, { className: "space-y-3", children: [
|
|
609
536
|
prompt && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-md border border-border bg-muted/20 px-4 py-3", children: [
|
|
610
537
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs font-medium text-muted-foreground mb-1", children: "Prompt" }),
|
|
611
538
|
/* @__PURE__ */ jsxRuntime.jsx("pre", { className: "text-xs font-mono whitespace-pre-wrap", children: prompt })
|
|
@@ -635,7 +562,7 @@ function ConversationView({ items }) {
|
|
|
635
562
|
}) });
|
|
636
563
|
}
|
|
637
564
|
function A2AIncomingItem({ item }) {
|
|
638
|
-
const [expanded, setExpanded] =
|
|
565
|
+
const [expanded, setExpanded] = React.useState(false);
|
|
639
566
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-md border border-border bg-muted/30 overflow-hidden", children: [
|
|
640
567
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
641
568
|
"button",
|
|
@@ -643,7 +570,7 @@ function A2AIncomingItem({ item }) {
|
|
|
643
570
|
onClick: () => setExpanded(!expanded),
|
|
644
571
|
className: "w-full flex items-center gap-2 px-4 py-2 text-left hover:bg-muted/50 transition-colors",
|
|
645
572
|
children: [
|
|
646
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
573
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Badge, { variant: "outline", className: "text-[10px]", children: "A2A incoming" }),
|
|
647
574
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs text-muted-foreground", children: [
|
|
648
575
|
"to ",
|
|
649
576
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-foreground", children: item.sender })
|
|
@@ -661,10 +588,10 @@ function A2AIncomingItem({ item }) {
|
|
|
661
588
|
] });
|
|
662
589
|
}
|
|
663
590
|
function SystemItem({ item }) {
|
|
664
|
-
const [expanded, setExpanded] =
|
|
591
|
+
const [expanded, setExpanded] = React.useState(false);
|
|
665
592
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-md border border-border bg-muted/30 overflow-hidden", children: [
|
|
666
593
|
/* @__PURE__ */ jsxRuntime.jsxs("button", { onClick: () => setExpanded(!expanded), className: "w-full flex items-center gap-2 px-4 py-2 text-left hover:bg-muted/50 transition-colors", children: [
|
|
667
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
594
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Badge, { variant: "outline", className: "text-[10px]", children: "system" }),
|
|
668
595
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs text-muted-foreground flex-1", children: [
|
|
669
596
|
"Model: ",
|
|
670
597
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono", children: item.model }),
|
|
@@ -690,7 +617,7 @@ function SystemItem({ item }) {
|
|
|
690
617
|
] });
|
|
691
618
|
}
|
|
692
619
|
function AssistantItem({ item }) {
|
|
693
|
-
const [expanded, setExpanded] =
|
|
620
|
+
const [expanded, setExpanded] = React.useState(false);
|
|
694
621
|
const preview = item.text?.split("\n")[0]?.slice(0, 120) ?? "";
|
|
695
622
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-md border border-border overflow-hidden", children: [
|
|
696
623
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -699,7 +626,7 @@ function AssistantItem({ item }) {
|
|
|
699
626
|
onClick: () => setExpanded(!expanded),
|
|
700
627
|
className: "w-full flex items-center gap-2 px-4 py-2 text-left hover:bg-muted/30 transition-colors",
|
|
701
628
|
children: [
|
|
702
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
629
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Badge, { variant: "outline", className: "text-[10px]", children: "assistant" }),
|
|
703
630
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground truncate flex-1", children: preview }),
|
|
704
631
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground flex-shrink-0", children: expanded ? "\u25B2" : "\u25BC" })
|
|
705
632
|
]
|
|
@@ -709,7 +636,7 @@ function AssistantItem({ item }) {
|
|
|
709
636
|
] });
|
|
710
637
|
}
|
|
711
638
|
function ToolItem({ item }) {
|
|
712
|
-
const [expanded, setExpanded] =
|
|
639
|
+
const [expanded, setExpanded] = React.useState(false);
|
|
713
640
|
const hasOutput = item.toolOutput && item.toolOutput.length > 0;
|
|
714
641
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-md border border-border overflow-hidden", children: [
|
|
715
642
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -718,9 +645,9 @@ function ToolItem({ item }) {
|
|
|
718
645
|
onClick: () => setExpanded(!expanded),
|
|
719
646
|
className: "w-full flex items-center gap-2 px-4 py-2 text-left hover:bg-muted/30 transition-colors",
|
|
720
647
|
children: [
|
|
721
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
648
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Badge, { variant: "secondary", className: "text-[10px]", children: "tool" }),
|
|
722
649
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium font-mono", children: item.toolName }),
|
|
723
|
-
hasOutput && /* @__PURE__ */ jsxRuntime.jsx(
|
|
650
|
+
hasOutput && /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Badge, { variant: "outline", className: "text-[10px] ml-auto", children: "has output" }),
|
|
724
651
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: expanded ? "\u25B2" : "\u25BC" })
|
|
725
652
|
]
|
|
726
653
|
}
|
|
@@ -759,18 +686,18 @@ function ResultItem({ item }) {
|
|
|
759
686
|
}
|
|
760
687
|
function ErrorItem({ item }) {
|
|
761
688
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-md border border-destructive/30 bg-destructive/5 px-4 py-3", children: [
|
|
762
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
689
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Badge, { variant: "destructive", className: "text-[10px]", children: "error" }) }),
|
|
763
690
|
/* @__PURE__ */ jsxRuntime.jsx("pre", { className: "mt-1 text-xs font-mono text-destructive whitespace-pre-wrap", children: item.error })
|
|
764
691
|
] });
|
|
765
692
|
}
|
|
766
693
|
function RunDetailPage({ runId, initialData, initialTranscript }) {
|
|
767
694
|
const { mutate } = swr.useSWRConfig();
|
|
768
|
-
const { data: run, error, isLoading } =
|
|
695
|
+
const { data: run, error, isLoading } = chunkVBGYWQUF_cjs.useApi(
|
|
769
696
|
`run-${runId}`,
|
|
770
697
|
(client) => client.runs.get(runId),
|
|
771
698
|
initialData ? { fallbackData: initialData } : void 0
|
|
772
699
|
);
|
|
773
|
-
const { data: transcript } =
|
|
700
|
+
const { data: transcript } = chunkVBGYWQUF_cjs.useApi(
|
|
774
701
|
run?.transcript_blob_url ? `transcript-${runId}` : null,
|
|
775
702
|
(client) => client.runs.transcriptArray(runId),
|
|
776
703
|
initialTranscript ? { fallbackData: initialTranscript } : void 0
|
|
@@ -783,14 +710,14 @@ function RunDetailPage({ runId, initialData, initialTranscript }) {
|
|
|
783
710
|
}
|
|
784
711
|
if (isLoading || !run) {
|
|
785
712
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
|
|
786
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-4 gap-4", children: Array.from({ length: 4 }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
787
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
713
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-4 gap-4", children: Array.from({ length: 4 }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Skeleton, { className: "h-24 rounded-lg" }, i)) }),
|
|
714
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Skeleton, { className: "h-96 rounded-lg" })
|
|
788
715
|
] });
|
|
789
716
|
}
|
|
790
717
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
|
|
791
718
|
(run.status === "running" || run.status === "pending") && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsxRuntime.jsx(CancelRunButton, { runId: run.id, onCancelled: () => mutate(`run-${runId}`) }) }),
|
|
792
719
|
run.triggered_by === "a2a" && run.requested_by_key_name && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
|
|
793
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
720
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Badge, { variant: "outline", className: "text-[10px]", children: "A2A" }),
|
|
794
721
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
795
722
|
"Requested by ",
|
|
796
723
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-foreground", children: run.requested_by_key_name })
|
|
@@ -821,15 +748,15 @@ function RunDetailPage({ runId, initialData, initialTranscript }) {
|
|
|
821
748
|
] })
|
|
822
749
|
] })
|
|
823
750
|
] }),
|
|
824
|
-
run.error_messages && run.error_messages.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
825
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
826
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
827
|
-
run.error_type && /* @__PURE__ */ jsxRuntime.jsx(
|
|
751
|
+
run.error_messages && run.error_messages.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.Card, { children: [
|
|
752
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.CardHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.CardTitle, { className: "text-base text-destructive", children: "Errors" }) }),
|
|
753
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.CardContent, { className: "space-y-2", children: [
|
|
754
|
+
run.error_type && /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Badge, { variant: "destructive", children: run.error_type }),
|
|
828
755
|
run.error_messages.map((msg, i) => /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "whitespace-pre-wrap text-sm text-destructive font-mono bg-destructive/10 rounded-md p-3", children: msg }, i))
|
|
829
756
|
] })
|
|
830
757
|
] }),
|
|
831
758
|
/* @__PURE__ */ jsxRuntime.jsx(TranscriptViewer, { transcript: transcript || [], prompt: run.prompt }),
|
|
832
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
759
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Card, { children: /* @__PURE__ */ jsxRuntime.jsxs("details", { children: [
|
|
833
760
|
/* @__PURE__ */ jsxRuntime.jsxs("summary", { className: "flex items-center justify-between px-6 py-4 cursor-pointer list-none hover:bg-muted/30 transition-colors rounded-xl", children: [
|
|
834
761
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base font-semibold", children: "Metadata" }),
|
|
835
762
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: "\\u25BC" })
|
|
@@ -854,9 +781,9 @@ function RunDetailPage({ runId, initialData, initialTranscript }) {
|
|
|
854
781
|
] });
|
|
855
782
|
}
|
|
856
783
|
function CancelRunButton({ runId, onCancelled }) {
|
|
857
|
-
const [open, setOpen] =
|
|
858
|
-
const [cancelling, setCancelling] =
|
|
859
|
-
const client =
|
|
784
|
+
const [open, setOpen] = React.useState(false);
|
|
785
|
+
const [cancelling, setCancelling] = React.useState(false);
|
|
786
|
+
const client = chunkVBGYWQUF_cjs.useAgentPlaneClient();
|
|
860
787
|
async function handleConfirm() {
|
|
861
788
|
setCancelling(true);
|
|
862
789
|
try {
|
|
@@ -870,7 +797,7 @@ function CancelRunButton({ runId, onCancelled }) {
|
|
|
870
797
|
}
|
|
871
798
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
872
799
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
873
|
-
|
|
800
|
+
chunkVBGYWQUF_cjs.Button,
|
|
874
801
|
{
|
|
875
802
|
variant: "destructive",
|
|
876
803
|
size: "sm",
|
|
@@ -878,15 +805,15 @@ function CancelRunButton({ runId, onCancelled }) {
|
|
|
878
805
|
children: "Stop Run"
|
|
879
806
|
}
|
|
880
807
|
),
|
|
881
|
-
/* @__PURE__ */ jsxRuntime.jsx(Dialog, { open, onOpenChange: setOpen, children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContent, { className: "max-w-sm", children: [
|
|
882
|
-
/* @__PURE__ */ jsxRuntime.jsxs(DialogHeader, { children: [
|
|
883
|
-
/* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { children: "Stop this run?" }),
|
|
884
|
-
/* @__PURE__ */ jsxRuntime.jsx(DialogDescription, { children: "This will terminate the sandbox immediately." })
|
|
808
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Dialog, { open, onOpenChange: setOpen, children: /* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.DialogContent, { className: "max-w-sm", children: [
|
|
809
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.DialogHeader, { children: [
|
|
810
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.DialogTitle, { children: "Stop this run?" }),
|
|
811
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.DialogDescription, { children: "This will terminate the sandbox immediately." })
|
|
885
812
|
] }),
|
|
886
|
-
/* @__PURE__ */ jsxRuntime.jsxs(DialogFooter, { children: [
|
|
887
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
813
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.DialogFooter, { children: [
|
|
814
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { variant: "outline", size: "sm", onClick: () => setOpen(false), disabled: cancelling, children: "Cancel" }),
|
|
888
815
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
889
|
-
|
|
816
|
+
chunkVBGYWQUF_cjs.Button,
|
|
890
817
|
{
|
|
891
818
|
variant: "destructive",
|
|
892
819
|
size: "sm",
|
|
@@ -902,23 +829,23 @@ function CancelRunButton({ runId, onCancelled }) {
|
|
|
902
829
|
var emptyForm = { name: "", slug: "", description: "", base_url: "", mcp_endpoint_path: "/mcp" };
|
|
903
830
|
function McpServerListPage({ initialData }) {
|
|
904
831
|
const { mutate } = swr.useSWRConfig();
|
|
905
|
-
const client =
|
|
906
|
-
const { data: servers, error, isLoading } =
|
|
832
|
+
const client = chunkVBGYWQUF_cjs.useAgentPlaneClient();
|
|
833
|
+
const { data: servers, error, isLoading } = chunkVBGYWQUF_cjs.useApi(
|
|
907
834
|
"mcp-servers",
|
|
908
835
|
(c) => c.customConnectors.listServers(),
|
|
909
836
|
initialData ? { fallbackData: initialData } : void 0
|
|
910
837
|
);
|
|
911
|
-
const [showCreate, setShowCreate] =
|
|
912
|
-
const [creating, setCreating] =
|
|
913
|
-
const [createForm, setCreateForm] =
|
|
914
|
-
const [createError, setCreateError] =
|
|
915
|
-
const [editTarget, setEditTarget] =
|
|
916
|
-
const [editing, setEditing] =
|
|
917
|
-
const [editForm, setEditForm] =
|
|
918
|
-
const [editError, setEditError] =
|
|
919
|
-
const [deleteTarget, setDeleteTarget] =
|
|
920
|
-
const [deleting, setDeleting] =
|
|
921
|
-
const [deleteError, setDeleteError] =
|
|
838
|
+
const [showCreate, setShowCreate] = React.useState(false);
|
|
839
|
+
const [creating, setCreating] = React.useState(false);
|
|
840
|
+
const [createForm, setCreateForm] = React.useState(emptyForm);
|
|
841
|
+
const [createError, setCreateError] = React.useState("");
|
|
842
|
+
const [editTarget, setEditTarget] = React.useState(null);
|
|
843
|
+
const [editing, setEditing] = React.useState(false);
|
|
844
|
+
const [editForm, setEditForm] = React.useState({ name: "", description: "" });
|
|
845
|
+
const [editError, setEditError] = React.useState("");
|
|
846
|
+
const [deleteTarget, setDeleteTarget] = React.useState(null);
|
|
847
|
+
const [deleting, setDeleting] = React.useState(false);
|
|
848
|
+
const [deleteError, setDeleteError] = React.useState("");
|
|
922
849
|
async function handleCreate() {
|
|
923
850
|
setCreating(true);
|
|
924
851
|
setCreateError("");
|
|
@@ -973,10 +900,10 @@ function McpServerListPage({ initialData }) {
|
|
|
973
900
|
] }) });
|
|
974
901
|
}
|
|
975
902
|
if (isLoading || !servers) {
|
|
976
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
903
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Skeleton, { className: "h-96 rounded-lg" });
|
|
977
904
|
}
|
|
978
905
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
|
|
979
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
906
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { variant: "outline", size: "sm", onClick: () => setShowCreate(true), children: "+ New Connector" }) }),
|
|
980
907
|
/* @__PURE__ */ jsxRuntime.jsxs(AdminTable, { children: [
|
|
981
908
|
/* @__PURE__ */ jsxRuntime.jsxs(AdminTableHead, { children: [
|
|
982
909
|
/* @__PURE__ */ jsxRuntime.jsx(Th, { children: "Name" }),
|
|
@@ -1003,12 +930,12 @@ function McpServerListPage({ initialData }) {
|
|
|
1003
930
|
) }),
|
|
1004
931
|
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "p-3 font-mono text-xs text-muted-foreground", children: s.slug }),
|
|
1005
932
|
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "p-3 font-mono text-xs text-muted-foreground truncate max-w-xs", title: s.base_url, children: s.base_url }),
|
|
1006
|
-
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "p-3", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
933
|
+
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "p-3", children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Badge, { variant: s.client_id ? "default" : "secondary", children: s.client_id ? "Registered" : "No DCR" }) }),
|
|
1007
934
|
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "p-3 text-right", children: s.connection_count }),
|
|
1008
935
|
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "p-3 text-right text-green-500", children: s.active_count }),
|
|
1009
936
|
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "p-3 text-muted-foreground text-xs", children: new Date(s.created_at).toLocaleDateString() }),
|
|
1010
937
|
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "p-3 text-right", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1011
|
-
|
|
938
|
+
chunkVBGYWQUF_cjs.Button,
|
|
1012
939
|
{
|
|
1013
940
|
variant: "destructive",
|
|
1014
941
|
size: "sm",
|
|
@@ -1021,29 +948,29 @@ function McpServerListPage({ initialData }) {
|
|
|
1021
948
|
servers.length === 0 && /* @__PURE__ */ jsxRuntime.jsx(EmptyRow, { colSpan: 8, children: 'No custom connectors registered. Click "+ New Connector" to add one.' })
|
|
1022
949
|
] })
|
|
1023
950
|
] }),
|
|
1024
|
-
/* @__PURE__ */ jsxRuntime.jsx(Dialog, { open: showCreate, onOpenChange: setShowCreate, children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContent, { className: "max-w-lg", children: [
|
|
1025
|
-
/* @__PURE__ */ jsxRuntime.jsx(DialogHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { children: "Register Connector" }) }),
|
|
1026
|
-
/* @__PURE__ */ jsxRuntime.jsxs(DialogBody, { className: "space-y-3", children: [
|
|
951
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Dialog, { open: showCreate, onOpenChange: setShowCreate, children: /* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.DialogContent, { className: "max-w-lg", children: [
|
|
952
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.DialogHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.DialogTitle, { children: "Register Connector" }) }),
|
|
953
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.DialogBody, { className: "space-y-3", children: [
|
|
1027
954
|
createError && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-destructive", children: createError }),
|
|
1028
|
-
/* @__PURE__ */ jsxRuntime.jsx(FormField, { label: "Name", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1029
|
-
/* @__PURE__ */ jsxRuntime.jsx(FormField, { label: "Slug", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1030
|
-
/* @__PURE__ */ jsxRuntime.jsx(FormField, { label: "Description", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1031
|
-
/* @__PURE__ */ jsxRuntime.jsx(FormField, { label: "Base URL", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1032
|
-
/* @__PURE__ */ jsxRuntime.jsx(FormField, { label: "MCP Endpoint Path", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
955
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.FormField, { label: "Name", children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Input, { value: createForm.name, onChange: (e) => setCreateForm({ ...createForm, name: e.target.value }), placeholder: "My MCP Server" }) }),
|
|
956
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.FormField, { label: "Slug", children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Input, { value: createForm.slug, onChange: (e) => setCreateForm({ ...createForm, slug: e.target.value }), placeholder: "my-mcp-server" }) }),
|
|
957
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.FormField, { label: "Description", children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Input, { value: createForm.description, onChange: (e) => setCreateForm({ ...createForm, description: e.target.value }), placeholder: "What this connector does" }) }),
|
|
958
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.FormField, { label: "Base URL", children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Input, { value: createForm.base_url, onChange: (e) => setCreateForm({ ...createForm, base_url: e.target.value }), placeholder: "https://my-server.example.com" }) }),
|
|
959
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.FormField, { label: "MCP Endpoint Path", children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Input, { value: createForm.mcp_endpoint_path, onChange: (e) => setCreateForm({ ...createForm, mcp_endpoint_path: e.target.value }), placeholder: "/mcp" }) })
|
|
1033
960
|
] }),
|
|
1034
|
-
/* @__PURE__ */ jsxRuntime.jsxs(DialogFooter, { children: [
|
|
1035
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1036
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
961
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.DialogFooter, { children: [
|
|
962
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { variant: "outline", onClick: () => setShowCreate(false), children: "Cancel" }),
|
|
963
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { onClick: handleCreate, disabled: creating || !createForm.name || !createForm.base_url, children: creating ? "Creating..." : "Create" })
|
|
1037
964
|
] })
|
|
1038
965
|
] }) }),
|
|
1039
|
-
/* @__PURE__ */ jsxRuntime.jsx(Dialog, { open: !!editTarget, onOpenChange: (open) => {
|
|
966
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Dialog, { open: !!editTarget, onOpenChange: (open) => {
|
|
1040
967
|
if (!open) setEditTarget(null);
|
|
1041
|
-
}, children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContent, { className: "max-w-lg", children: [
|
|
1042
|
-
/* @__PURE__ */ jsxRuntime.jsx(DialogHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { children: "Edit Connector" }) }),
|
|
1043
|
-
/* @__PURE__ */ jsxRuntime.jsxs(DialogBody, { className: "space-y-3", children: [
|
|
968
|
+
}, children: /* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.DialogContent, { className: "max-w-lg", children: [
|
|
969
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.DialogHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.DialogTitle, { children: "Edit Connector" }) }),
|
|
970
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.DialogBody, { className: "space-y-3", children: [
|
|
1044
971
|
editError && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-destructive", children: editError }),
|
|
1045
|
-
/* @__PURE__ */ jsxRuntime.jsx(FormField, { label: "Name", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1046
|
-
/* @__PURE__ */ jsxRuntime.jsx(FormField, { label: "Description", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
972
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.FormField, { label: "Name", children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Input, { value: editForm.name, onChange: (e) => setEditForm({ ...editForm, name: e.target.value }) }) }),
|
|
973
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.FormField, { label: "Description", children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Input, { value: editForm.description, onChange: (e) => setEditForm({ ...editForm, description: e.target.value }) }) }),
|
|
1047
974
|
editTarget && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-xs text-muted-foreground space-y-1", children: [
|
|
1048
975
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
1049
976
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: "Slug:" }),
|
|
@@ -1062,9 +989,9 @@ function McpServerListPage({ initialData }) {
|
|
|
1062
989
|
] })
|
|
1063
990
|
] })
|
|
1064
991
|
] }),
|
|
1065
|
-
/* @__PURE__ */ jsxRuntime.jsxs(DialogFooter, { children: [
|
|
1066
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1067
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
992
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.DialogFooter, { children: [
|
|
993
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { variant: "outline", onClick: () => setEditTarget(null), children: "Cancel" }),
|
|
994
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { onClick: handleEdit, disabled: editing || !editForm.name, children: editing ? "Saving..." : "Save" })
|
|
1068
995
|
] })
|
|
1069
996
|
] }) }),
|
|
1070
997
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -1094,20 +1021,20 @@ function McpServerListPage({ initialData }) {
|
|
|
1094
1021
|
}
|
|
1095
1022
|
function PluginMarketplaceListPage({ initialData }) {
|
|
1096
1023
|
const { mutate } = swr.useSWRConfig();
|
|
1097
|
-
const client =
|
|
1098
|
-
const { LinkComponent, basePath } =
|
|
1099
|
-
const { data: marketplaces, error, isLoading } =
|
|
1024
|
+
const client = chunkVBGYWQUF_cjs.useAgentPlaneClient();
|
|
1025
|
+
const { LinkComponent, basePath } = chunkVBGYWQUF_cjs.useNavigation();
|
|
1026
|
+
const { data: marketplaces, error, isLoading } = chunkVBGYWQUF_cjs.useApi(
|
|
1100
1027
|
"plugin-marketplaces",
|
|
1101
1028
|
(c) => c.pluginMarketplaces.list(),
|
|
1102
1029
|
initialData ? { fallbackData: initialData } : void 0
|
|
1103
1030
|
);
|
|
1104
|
-
const [showAdd, setShowAdd] =
|
|
1105
|
-
const [adding, setAdding] =
|
|
1106
|
-
const [addError, setAddError] =
|
|
1107
|
-
const [newMarketplace, setNewMarketplace] =
|
|
1108
|
-
const [deleteTarget, setDeleteTarget] =
|
|
1109
|
-
const [deleting, setDeleting] =
|
|
1110
|
-
const [deleteError, setDeleteError] =
|
|
1031
|
+
const [showAdd, setShowAdd] = React.useState(false);
|
|
1032
|
+
const [adding, setAdding] = React.useState(false);
|
|
1033
|
+
const [addError, setAddError] = React.useState("");
|
|
1034
|
+
const [newMarketplace, setNewMarketplace] = React.useState({ name: "", github_repo: "" });
|
|
1035
|
+
const [deleteTarget, setDeleteTarget] = React.useState(null);
|
|
1036
|
+
const [deleting, setDeleting] = React.useState(false);
|
|
1037
|
+
const [deleteError, setDeleteError] = React.useState("");
|
|
1111
1038
|
function resetAddForm() {
|
|
1112
1039
|
setNewMarketplace({ name: "", github_repo: "" });
|
|
1113
1040
|
setAddError("");
|
|
@@ -1147,26 +1074,26 @@ function PluginMarketplaceListPage({ initialData }) {
|
|
|
1147
1074
|
] }) });
|
|
1148
1075
|
}
|
|
1149
1076
|
if (isLoading || !marketplaces) {
|
|
1150
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1077
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Skeleton, { className: "h-96 rounded-lg" });
|
|
1151
1078
|
}
|
|
1152
1079
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
|
|
1153
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1154
|
-
/* @__PURE__ */ jsxRuntime.jsx(Dialog, { open: showAdd, onOpenChange: (v) => {
|
|
1080
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { variant: "outline", size: "sm", onClick: () => setShowAdd(true), children: "+ Add Marketplace" }) }),
|
|
1081
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Dialog, { open: showAdd, onOpenChange: (v) => {
|
|
1155
1082
|
setShowAdd(v);
|
|
1156
1083
|
if (!v) resetAddForm();
|
|
1157
|
-
}, children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContent, { className: "max-w-md", children: [
|
|
1158
|
-
/* @__PURE__ */ jsxRuntime.jsx(DialogHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { children: "Add Marketplace" }) }),
|
|
1159
|
-
/* @__PURE__ */ jsxRuntime.jsxs(DialogBody, { className: "space-y-3", children: [
|
|
1160
|
-
/* @__PURE__ */ jsxRuntime.jsx(FormField, { label: "Name", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1161
|
-
|
|
1084
|
+
}, children: /* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.DialogContent, { className: "max-w-md", children: [
|
|
1085
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.DialogHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.DialogTitle, { children: "Add Marketplace" }) }),
|
|
1086
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.DialogBody, { className: "space-y-3", children: [
|
|
1087
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.FormField, { label: "Name", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1088
|
+
chunkVBGYWQUF_cjs.Input,
|
|
1162
1089
|
{
|
|
1163
1090
|
value: newMarketplace.name,
|
|
1164
1091
|
onChange: (e) => setNewMarketplace({ ...newMarketplace, name: e.target.value }),
|
|
1165
1092
|
placeholder: "My Marketplace"
|
|
1166
1093
|
}
|
|
1167
1094
|
) }),
|
|
1168
|
-
/* @__PURE__ */ jsxRuntime.jsx(FormField, { label: "GitHub Repo", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1169
|
-
|
|
1095
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.FormField, { label: "GitHub Repo", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1096
|
+
chunkVBGYWQUF_cjs.Input,
|
|
1170
1097
|
{
|
|
1171
1098
|
value: newMarketplace.github_repo,
|
|
1172
1099
|
onChange: (e) => setNewMarketplace({ ...newMarketplace, github_repo: e.target.value }),
|
|
@@ -1175,12 +1102,12 @@ function PluginMarketplaceListPage({ initialData }) {
|
|
|
1175
1102
|
) }),
|
|
1176
1103
|
/* @__PURE__ */ jsxRuntime.jsx(FormError, { error: addError })
|
|
1177
1104
|
] }),
|
|
1178
|
-
/* @__PURE__ */ jsxRuntime.jsxs(DialogFooter, { children: [
|
|
1179
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1105
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.DialogFooter, { children: [
|
|
1106
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { variant: "outline", size: "sm", onClick: () => {
|
|
1180
1107
|
setShowAdd(false);
|
|
1181
1108
|
resetAddForm();
|
|
1182
1109
|
}, children: "Cancel" }),
|
|
1183
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1110
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { size: "sm", onClick: handleAdd, disabled: adding || !newMarketplace.name || !newMarketplace.github_repo, children: adding ? "Adding..." : "Add Marketplace" })
|
|
1184
1111
|
] })
|
|
1185
1112
|
] }) }),
|
|
1186
1113
|
/* @__PURE__ */ jsxRuntime.jsxs(AdminTable, { children: [
|
|
@@ -1202,7 +1129,7 @@ function PluginMarketplaceListPage({ initialData }) {
|
|
|
1202
1129
|
children: m.name
|
|
1203
1130
|
}
|
|
1204
1131
|
),
|
|
1205
|
-
m.is_owned && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1132
|
+
m.is_owned && /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Badge, { variant: "secondary", className: "ml-2 text-xs", children: "Owned" })
|
|
1206
1133
|
] }),
|
|
1207
1134
|
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "p-3", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1208
1135
|
"a",
|
|
@@ -1214,10 +1141,10 @@ function PluginMarketplaceListPage({ initialData }) {
|
|
|
1214
1141
|
children: m.github_repo
|
|
1215
1142
|
}
|
|
1216
1143
|
) }),
|
|
1217
|
-
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "p-3 text-right", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1144
|
+
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "p-3 text-right", children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Badge, { variant: m.agent_count > 0 ? "default" : "secondary", children: m.agent_count }) }),
|
|
1218
1145
|
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "p-3 text-muted-foreground text-xs", children: new Date(m.created_at).toLocaleDateString() }),
|
|
1219
1146
|
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "p-3 text-right", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1220
|
-
|
|
1147
|
+
chunkVBGYWQUF_cjs.Button,
|
|
1221
1148
|
{
|
|
1222
1149
|
variant: "destructive",
|
|
1223
1150
|
size: "sm",
|
|
@@ -1257,20 +1184,20 @@ function PluginMarketplaceListPage({ initialData }) {
|
|
|
1257
1184
|
}
|
|
1258
1185
|
function PluginMarketplaceDetailPage({ marketplaceId, initialData, initialPlugins }) {
|
|
1259
1186
|
const { mutate } = swr.useSWRConfig();
|
|
1260
|
-
const client =
|
|
1261
|
-
const { LinkComponent, basePath } =
|
|
1262
|
-
const { data: marketplace, error, isLoading } =
|
|
1187
|
+
const client = chunkVBGYWQUF_cjs.useAgentPlaneClient();
|
|
1188
|
+
const { LinkComponent, basePath } = chunkVBGYWQUF_cjs.useNavigation();
|
|
1189
|
+
const { data: marketplace, error, isLoading } = chunkVBGYWQUF_cjs.useApi(
|
|
1263
1190
|
`marketplace-${marketplaceId}`,
|
|
1264
1191
|
(c) => c.pluginMarketplaces.get(marketplaceId),
|
|
1265
1192
|
initialData ? { fallbackData: initialData } : void 0
|
|
1266
1193
|
);
|
|
1267
|
-
const { data: plugins } =
|
|
1194
|
+
const { data: plugins } = chunkVBGYWQUF_cjs.useApi(
|
|
1268
1195
|
`marketplace-${marketplaceId}-plugins`,
|
|
1269
1196
|
(c) => c.pluginMarketplaces.listPlugins(marketplaceId),
|
|
1270
1197
|
initialPlugins ? { fallbackData: initialPlugins } : void 0
|
|
1271
1198
|
);
|
|
1272
|
-
const [tokenInput, setTokenInput] =
|
|
1273
|
-
const [savingToken, setSavingToken] =
|
|
1199
|
+
const [tokenInput, setTokenInput] = React.useState("");
|
|
1200
|
+
const [savingToken, setSavingToken] = React.useState(false);
|
|
1274
1201
|
async function handleSaveToken() {
|
|
1275
1202
|
setSavingToken(true);
|
|
1276
1203
|
try {
|
|
@@ -1290,14 +1217,14 @@ function PluginMarketplaceDetailPage({ marketplaceId, initialData, initialPlugin
|
|
|
1290
1217
|
}
|
|
1291
1218
|
if (isLoading || !marketplace) {
|
|
1292
1219
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
|
|
1293
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1294
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1295
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1220
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Skeleton, { className: "h-12 w-64" }),
|
|
1221
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Skeleton, { className: "h-32 rounded-lg" }),
|
|
1222
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Skeleton, { className: "h-64 rounded-lg" })
|
|
1296
1223
|
] });
|
|
1297
1224
|
}
|
|
1298
1225
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
|
|
1299
1226
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
1300
|
-
marketplace.has_token && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1227
|
+
marketplace.has_token && /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Badge, { variant: "secondary", children: "Owned" }),
|
|
1301
1228
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1302
1229
|
"a",
|
|
1303
1230
|
{
|
|
@@ -1309,13 +1236,13 @@ function PluginMarketplaceDetailPage({ marketplaceId, initialData, initialPlugin
|
|
|
1309
1236
|
}
|
|
1310
1237
|
)
|
|
1311
1238
|
] }),
|
|
1312
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1313
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1314
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1239
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.Card, { children: [
|
|
1240
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.CardHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.CardTitle, { className: "text-base", children: "GitHub Token" }) }),
|
|
1241
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.CardContent, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
|
|
1315
1242
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: marketplace.has_token ? "A GitHub token is configured. You can update it below." : "Add a GitHub personal access token to enable write access and private repo support." }),
|
|
1316
1243
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2", children: [
|
|
1317
1244
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1318
|
-
|
|
1245
|
+
chunkVBGYWQUF_cjs.Input,
|
|
1319
1246
|
{
|
|
1320
1247
|
type: "password",
|
|
1321
1248
|
placeholder: "ghp_...",
|
|
@@ -1324,30 +1251,30 @@ function PluginMarketplaceDetailPage({ marketplaceId, initialData, initialPlugin
|
|
|
1324
1251
|
className: "flex-1"
|
|
1325
1252
|
}
|
|
1326
1253
|
),
|
|
1327
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1254
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { size: "sm", onClick: handleSaveToken, disabled: savingToken || !tokenInput, children: savingToken ? "Saving..." : marketplace.has_token ? "Update Token" : "Save Token" })
|
|
1328
1255
|
] })
|
|
1329
1256
|
] }) })
|
|
1330
1257
|
] }),
|
|
1331
1258
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
1332
1259
|
/* @__PURE__ */ jsxRuntime.jsx(SectionHeader, { title: "Plugins" }),
|
|
1333
|
-
!plugins ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1260
|
+
!plugins ? /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Skeleton, { className: "h-48 rounded-lg" }) : plugins.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: "No plugins found in this marketplace." }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4", children: plugins.map((plugin) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1334
1261
|
LinkComponent,
|
|
1335
1262
|
{
|
|
1336
1263
|
href: `${basePath}/plugin-marketplaces/${marketplaceId}/plugins/${plugin.name}`,
|
|
1337
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1338
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1264
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.Card, { className: "hover:border-primary/50 transition-colors cursor-pointer h-full", children: [
|
|
1265
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.CardHeader, { className: "pb-2", children: /* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.CardTitle, { className: "text-sm font-medium flex items-center justify-between", children: [
|
|
1339
1266
|
plugin.displayName,
|
|
1340
1267
|
plugin.version && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs text-muted-foreground font-normal", children: [
|
|
1341
1268
|
"v",
|
|
1342
1269
|
plugin.version
|
|
1343
1270
|
] })
|
|
1344
1271
|
] }) }),
|
|
1345
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1272
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.CardContent, { children: [
|
|
1346
1273
|
plugin.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground mb-3", children: plugin.description }),
|
|
1347
1274
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-1.5", children: [
|
|
1348
|
-
plugin.hasAgents && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1349
|
-
plugin.hasSkills && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1350
|
-
plugin.hasMcpJson && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1275
|
+
plugin.hasAgents && /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Badge, { variant: "secondary", className: "text-xs", children: "Agents" }),
|
|
1276
|
+
plugin.hasSkills && /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Badge, { variant: "secondary", className: "text-xs", children: "Skills" }),
|
|
1277
|
+
plugin.hasMcpJson && /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Badge, { variant: "secondary", className: "text-xs", children: "MCP" })
|
|
1351
1278
|
] })
|
|
1352
1279
|
] })
|
|
1353
1280
|
] })
|
|
@@ -1366,13 +1293,13 @@ function AgentsTab({
|
|
|
1366
1293
|
return /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground py-4", children: "No agents defined in this plugin." });
|
|
1367
1294
|
}
|
|
1368
1295
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: agents.map((agent) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1369
|
-
|
|
1296
|
+
chunkVBGYWQUF_cjs.Card,
|
|
1370
1297
|
{
|
|
1371
1298
|
className: `cursor-pointer transition-colors hover:border-primary/50 ${selectedFilename === agent.filename ? "border-primary ring-1 ring-primary/30" : ""}`,
|
|
1372
1299
|
onClick: () => onSelectAgent(agent.filename),
|
|
1373
1300
|
children: [
|
|
1374
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1375
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1301
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.CardHeader, { className: "pb-2", children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.CardTitle, { className: "text-sm font-medium", children: agent.name }) }),
|
|
1302
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.CardContent, { children: [
|
|
1376
1303
|
agent.description ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: agent.description }) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground italic", children: "No description" }),
|
|
1377
1304
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground/60 mt-2 font-mono", children: agent.filename })
|
|
1378
1305
|
] })
|
|
@@ -1390,13 +1317,13 @@ function SkillsTab({
|
|
|
1390
1317
|
return /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground py-4", children: "No skills defined in this plugin." });
|
|
1391
1318
|
}
|
|
1392
1319
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4", children: skills.map((skill) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1393
|
-
|
|
1320
|
+
chunkVBGYWQUF_cjs.Card,
|
|
1394
1321
|
{
|
|
1395
1322
|
className: `cursor-pointer transition-colors hover:border-primary/50 ${selectedSkill === skill ? "border-primary ring-1 ring-primary/30" : ""}`,
|
|
1396
1323
|
onClick: () => onSelectSkill(skill),
|
|
1397
1324
|
children: [
|
|
1398
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1399
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1325
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.CardHeader, { className: "pb-2", children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.CardTitle, { className: "text-sm font-medium", children: skill }) }),
|
|
1326
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.CardContent, { children: /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-muted-foreground font-mono", children: [
|
|
1400
1327
|
"skills/",
|
|
1401
1328
|
skill,
|
|
1402
1329
|
"/"
|
|
@@ -1416,13 +1343,13 @@ function ConnectorsTab({
|
|
|
1416
1343
|
return /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground py-4", children: "No connectors defined in this plugin." });
|
|
1417
1344
|
}
|
|
1418
1345
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1419
|
-
|
|
1346
|
+
chunkVBGYWQUF_cjs.Card,
|
|
1420
1347
|
{
|
|
1421
1348
|
className: `cursor-pointer transition-colors hover:border-primary/50 ${selected ? "border-primary ring-1 ring-primary/30" : ""}`,
|
|
1422
1349
|
onClick: onSelectConnector,
|
|
1423
1350
|
children: [
|
|
1424
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1425
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1351
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.CardHeader, { className: "pb-2", children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.CardTitle, { className: "text-sm font-medium", children: ".mcp.json" }) }),
|
|
1352
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.CardContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: "This plugin includes an MCP connector configuration that will be suggested to agents using it." }) })
|
|
1426
1353
|
]
|
|
1427
1354
|
}
|
|
1428
1355
|
);
|
|
@@ -1444,8 +1371,8 @@ function FileEditorInline({
|
|
|
1444
1371
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1445
1372
|
saveError && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-destructive", children: saveError }),
|
|
1446
1373
|
saveSuccess && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-green-500", children: saveSuccess }),
|
|
1447
|
-
!readOnly && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1448
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1374
|
+
!readOnly && /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { size: "sm", onClick: onSave, disabled: saving, className: "h-7 text-xs", children: saving ? "Saving..." : "Save" }),
|
|
1375
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { size: "sm", variant: "ghost", onClick: onClose, className: "h-7 text-xs", children: "Close" })
|
|
1449
1376
|
] })
|
|
1450
1377
|
] }),
|
|
1451
1378
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1461,21 +1388,21 @@ function FileEditorInline({
|
|
|
1461
1388
|
] });
|
|
1462
1389
|
}
|
|
1463
1390
|
function PluginDetailPage({ marketplaceId, pluginName }) {
|
|
1464
|
-
const { LinkComponent, basePath } =
|
|
1465
|
-
const client =
|
|
1466
|
-
const { data: plugin, error, isLoading } =
|
|
1391
|
+
const { LinkComponent, basePath } = chunkVBGYWQUF_cjs.useNavigation();
|
|
1392
|
+
const client = chunkVBGYWQUF_cjs.useAgentPlaneClient();
|
|
1393
|
+
const { data: plugin, error, isLoading } = chunkVBGYWQUF_cjs.useApi(
|
|
1467
1394
|
`marketplace-${marketplaceId}-plugin-${pluginName}`,
|
|
1468
1395
|
(c) => c.pluginMarketplaces.getPlugin(marketplaceId, pluginName)
|
|
1469
1396
|
);
|
|
1470
|
-
const [editorState, setEditorState] =
|
|
1471
|
-
const [pluginFiles, setPluginFiles] =
|
|
1472
|
-
const [filesLoading, setFilesLoading] =
|
|
1473
|
-
const [filesError, setFilesError] =
|
|
1474
|
-
const [editedContent, setEditedContent] =
|
|
1475
|
-
const [saving, setSaving] =
|
|
1476
|
-
const [saveError, setSaveError] =
|
|
1477
|
-
const [saveSuccess, setSaveSuccess] =
|
|
1478
|
-
const fetchFiles =
|
|
1397
|
+
const [editorState, setEditorState] = React.useState(null);
|
|
1398
|
+
const [pluginFiles, setPluginFiles] = React.useState(null);
|
|
1399
|
+
const [filesLoading, setFilesLoading] = React.useState(false);
|
|
1400
|
+
const [filesError, setFilesError] = React.useState("");
|
|
1401
|
+
const [editedContent, setEditedContent] = React.useState(/* @__PURE__ */ new Map());
|
|
1402
|
+
const [saving, setSaving] = React.useState(false);
|
|
1403
|
+
const [saveError, setSaveError] = React.useState("");
|
|
1404
|
+
const [saveSuccess, setSaveSuccess] = React.useState("");
|
|
1405
|
+
const fetchFiles = React.useCallback(async () => {
|
|
1479
1406
|
if (pluginFiles) return pluginFiles;
|
|
1480
1407
|
setFilesLoading(true);
|
|
1481
1408
|
setFilesError("");
|
|
@@ -1490,7 +1417,7 @@ function PluginDetailPage({ marketplaceId, pluginName }) {
|
|
|
1490
1417
|
setFilesLoading(false);
|
|
1491
1418
|
}
|
|
1492
1419
|
}, [client, marketplaceId, pluginName, pluginFiles]);
|
|
1493
|
-
const handleSelectAgent =
|
|
1420
|
+
const handleSelectAgent = React.useCallback(async (filename) => {
|
|
1494
1421
|
if (editorState?.type === "agent" && editorState.identifier === filename) {
|
|
1495
1422
|
setEditorState(null);
|
|
1496
1423
|
return;
|
|
@@ -1502,7 +1429,7 @@ function PluginDetailPage({ marketplaceId, pluginName }) {
|
|
|
1502
1429
|
setEditorState({ type: "agent", identifier: filename });
|
|
1503
1430
|
}
|
|
1504
1431
|
}, [editorState, fetchFiles]);
|
|
1505
|
-
const handleSelectSkill =
|
|
1432
|
+
const handleSelectSkill = React.useCallback(async (skill) => {
|
|
1506
1433
|
if (editorState?.type === "skill" && editorState.identifier === skill) {
|
|
1507
1434
|
setEditorState(null);
|
|
1508
1435
|
return;
|
|
@@ -1514,7 +1441,7 @@ function PluginDetailPage({ marketplaceId, pluginName }) {
|
|
|
1514
1441
|
setEditorState({ type: "skill", identifier: skill });
|
|
1515
1442
|
}
|
|
1516
1443
|
}, [editorState, fetchFiles]);
|
|
1517
|
-
const handleSelectConnector =
|
|
1444
|
+
const handleSelectConnector = React.useCallback(async () => {
|
|
1518
1445
|
if (editorState?.type === "connector") {
|
|
1519
1446
|
setEditorState(null);
|
|
1520
1447
|
return;
|
|
@@ -1607,9 +1534,9 @@ function PluginDetailPage({ marketplaceId, pluginName }) {
|
|
|
1607
1534
|
}
|
|
1608
1535
|
if (isLoading || !plugin) {
|
|
1609
1536
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
|
|
1610
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1611
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1612
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1537
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Skeleton, { className: "h-8 w-48" }),
|
|
1538
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Skeleton, { className: "h-4 w-96" }),
|
|
1539
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Skeleton, { className: "h-64 rounded-lg" })
|
|
1613
1540
|
] });
|
|
1614
1541
|
}
|
|
1615
1542
|
const readOnly = pluginFiles ? !pluginFiles.isOwned : true;
|
|
@@ -1626,7 +1553,7 @@ function PluginDetailPage({ marketplaceId, pluginName }) {
|
|
|
1626
1553
|
selectedFilename: editorState?.type === "agent" ? editorState.identifier : null
|
|
1627
1554
|
}
|
|
1628
1555
|
),
|
|
1629
|
-
editorState?.type === "agent" && editorFile && (filesLoading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-4", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1556
|
+
editorState?.type === "agent" && editorFile && (filesLoading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-4", children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Skeleton, { className: "h-[400px] rounded-md" }) }) : filesError ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-4 text-sm text-destructive", children: filesError }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1630
1557
|
FileEditorInline,
|
|
1631
1558
|
{
|
|
1632
1559
|
filePath: editorFile.path,
|
|
@@ -1653,7 +1580,7 @@ function PluginDetailPage({ marketplaceId, pluginName }) {
|
|
|
1653
1580
|
selectedSkill: editorState?.type === "skill" ? editorState.identifier : null
|
|
1654
1581
|
}
|
|
1655
1582
|
),
|
|
1656
|
-
editorState?.type === "skill" && editorFile && (filesLoading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-4", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1583
|
+
editorState?.type === "skill" && editorFile && (filesLoading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-4", children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Skeleton, { className: "h-[400px] rounded-md" }) }) : filesError ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-4 text-sm text-destructive", children: filesError }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1657
1584
|
FileEditorInline,
|
|
1658
1585
|
{
|
|
1659
1586
|
filePath: editorFile.path,
|
|
@@ -1681,7 +1608,7 @@ function PluginDetailPage({ marketplaceId, pluginName }) {
|
|
|
1681
1608
|
selected: editorState?.type === "connector"
|
|
1682
1609
|
}
|
|
1683
1610
|
),
|
|
1684
|
-
editorState?.type === "connector" && editorFile && (filesLoading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-4", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1611
|
+
editorState?.type === "connector" && editorFile && (filesLoading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-4", children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Skeleton, { className: "h-[400px] rounded-md" }) }) : filesError ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-4 text-sm text-destructive", children: filesError }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1685
1612
|
FileEditorInline,
|
|
1686
1613
|
{
|
|
1687
1614
|
filePath: editorFile.path,
|
|
@@ -1702,11 +1629,11 @@ function PluginDetailPage({ marketplaceId, pluginName }) {
|
|
|
1702
1629
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
1703
1630
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
1704
1631
|
/* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-semibold", children: plugin.displayName }),
|
|
1705
|
-
plugin.version && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1632
|
+
plugin.version && /* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.Badge, { variant: "outline", children: [
|
|
1706
1633
|
"v",
|
|
1707
1634
|
plugin.version
|
|
1708
1635
|
] }),
|
|
1709
|
-
pluginFiles && (pluginFiles.isOwned ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1636
|
+
pluginFiles && (pluginFiles.isOwned ? /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Badge, { variant: "secondary", children: "Editable" }) : /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Badge, { variant: "outline", children: "Read-only" }))
|
|
1710
1637
|
] }),
|
|
1711
1638
|
plugin.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground mt-1", children: plugin.description })
|
|
1712
1639
|
] }),
|
|
@@ -1716,12 +1643,12 @@ function PluginDetailPage({ marketplaceId, pluginName }) {
|
|
|
1716
1643
|
var TIMEZONES = typeof Intl !== "undefined" && Intl.supportedValuesOf ? Intl.supportedValuesOf("timeZone") : ["UTC"];
|
|
1717
1644
|
function SettingsPage({ initialData, hideDangerZone }) {
|
|
1718
1645
|
const { mutate } = swr.useSWRConfig();
|
|
1719
|
-
const { data: tenantData, error: tenantError, isLoading: tenantLoading } =
|
|
1646
|
+
const { data: tenantData, error: tenantError, isLoading: tenantLoading } = chunkVBGYWQUF_cjs.useApi(
|
|
1720
1647
|
"settings-tenant",
|
|
1721
1648
|
(c) => c.tenants.getMe(),
|
|
1722
1649
|
initialData ? { fallbackData: initialData.tenant } : void 0
|
|
1723
1650
|
);
|
|
1724
|
-
const { data: apiKeysData, error: apiKeysError, isLoading: apiKeysLoading } =
|
|
1651
|
+
const { data: apiKeysData, error: apiKeysError, isLoading: apiKeysLoading } = chunkVBGYWQUF_cjs.useApi(
|
|
1725
1652
|
"settings-keys",
|
|
1726
1653
|
(c) => c.keys.list ? c.keys.list() : Promise.resolve([]),
|
|
1727
1654
|
initialData ? { fallbackData: initialData.api_keys } : void 0
|
|
@@ -1737,8 +1664,8 @@ function SettingsPage({ initialData, hideDangerZone }) {
|
|
|
1737
1664
|
}
|
|
1738
1665
|
if (isLoading || !data) {
|
|
1739
1666
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
|
|
1740
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1741
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1667
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Skeleton, { className: "h-48 rounded-lg" }),
|
|
1668
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Skeleton, { className: "h-64 rounded-lg" })
|
|
1742
1669
|
] });
|
|
1743
1670
|
}
|
|
1744
1671
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
|
|
@@ -1754,13 +1681,13 @@ function SettingsPage({ initialData, hideDangerZone }) {
|
|
|
1754
1681
|
] });
|
|
1755
1682
|
}
|
|
1756
1683
|
function CompanyForm({ tenant, onSaved }) {
|
|
1757
|
-
const client =
|
|
1758
|
-
const fileInputRef =
|
|
1759
|
-
const [name, setName] =
|
|
1760
|
-
const [budget, setBudget] =
|
|
1761
|
-
const [timezone, setTimezone] =
|
|
1762
|
-
const [logoUrl, setLogoUrl] =
|
|
1763
|
-
const [saving, setSaving] =
|
|
1684
|
+
const client = chunkVBGYWQUF_cjs.useAgentPlaneClient();
|
|
1685
|
+
const fileInputRef = React.useRef(null);
|
|
1686
|
+
const [name, setName] = React.useState(tenant.name);
|
|
1687
|
+
const [budget, setBudget] = React.useState(tenant.monthly_budget_usd.toString());
|
|
1688
|
+
const [timezone, setTimezone] = React.useState(tenant.timezone);
|
|
1689
|
+
const [logoUrl, setLogoUrl] = React.useState(tenant.logo_url ?? "");
|
|
1690
|
+
const [saving, setSaving] = React.useState(false);
|
|
1764
1691
|
const isDirty = name !== tenant.name || budget !== tenant.monthly_budget_usd.toString() || timezone !== tenant.timezone || (logoUrl || "") !== (tenant.logo_url ?? "");
|
|
1765
1692
|
async function handleSave() {
|
|
1766
1693
|
setSaving(true);
|
|
@@ -1784,8 +1711,8 @@ function CompanyForm({ tenant, onSaved }) {
|
|
|
1784
1711
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
1785
1712
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: "Upload a logo for your company. Recommended size: 256x256px." }),
|
|
1786
1713
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1787
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1788
|
-
logoUrl && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1714
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { size: "sm", variant: "outline", onClick: () => fileInputRef.current?.click(), children: "Upload image" }),
|
|
1715
|
+
logoUrl && /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { size: "sm", variant: "outline", onClick: () => setLogoUrl(""), children: "Remove" }),
|
|
1789
1716
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1790
1717
|
"input",
|
|
1791
1718
|
{
|
|
@@ -1810,14 +1737,14 @@ function CompanyForm({ tenant, onSaved }) {
|
|
|
1810
1737
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg border border-muted-foreground/25 p-5", children: [
|
|
1811
1738
|
/* @__PURE__ */ jsxRuntime.jsx(SectionHeader, { title: "Company Details" }),
|
|
1812
1739
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-4", children: [
|
|
1813
|
-
/* @__PURE__ */ jsxRuntime.jsx(FormField, { label: "Name", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1814
|
-
/* @__PURE__ */ jsxRuntime.jsx(FormField, { label: "Slug", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1815
|
-
/* @__PURE__ */ jsxRuntime.jsx(FormField, { label: "Status", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center h-9", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1816
|
-
/* @__PURE__ */ jsxRuntime.jsx(FormField, { label: "Timezone", children: /* @__PURE__ */ jsxRuntime.jsx(Select, { value: timezone, onChange: (e) => setTimezone(e.target.value), children: TIMEZONES.map((tz) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: tz, children: tz.replace(/_/g, " ") }, tz)) }) }),
|
|
1817
|
-
/* @__PURE__ */ jsxRuntime.jsx(FormField, { label: "Monthly Budget (USD)", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
1740
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.FormField, { label: "Name", children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Input, { value: name, onChange: (e) => setName(e.target.value) }) }),
|
|
1741
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.FormField, { label: "Slug", children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Input, { value: tenant.slug, readOnly: true, disabled: true, className: "opacity-60" }) }),
|
|
1742
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.FormField, { label: "Status", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center h-9", children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Badge, { variant: tenant.status === "active" ? "default" : "destructive", children: tenant.status }) }) }),
|
|
1743
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.FormField, { label: "Timezone", children: /* @__PURE__ */ jsxRuntime.jsx(Select, { value: timezone, onChange: (e) => setTimezone(e.target.value), children: TIMEZONES.map((tz) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: tz, children: tz.replace(/_/g, " ") }, tz)) }) }),
|
|
1744
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.FormField, { label: "Monthly Budget (USD)", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
1818
1745
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground text-sm", children: "$" }),
|
|
1819
1746
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1820
|
-
|
|
1747
|
+
chunkVBGYWQUF_cjs.Input,
|
|
1821
1748
|
{
|
|
1822
1749
|
type: "number",
|
|
1823
1750
|
step: "0.01",
|
|
@@ -1829,18 +1756,18 @@ function CompanyForm({ tenant, onSaved }) {
|
|
|
1829
1756
|
] }) })
|
|
1830
1757
|
] })
|
|
1831
1758
|
] }),
|
|
1832
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1759
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { onClick: handleSave, disabled: saving || !isDirty, size: "sm", children: saving ? "Saving..." : "Save Changes" }) })
|
|
1833
1760
|
] });
|
|
1834
1761
|
}
|
|
1835
1762
|
function ApiKeysSection({ initialKeys, onChanged }) {
|
|
1836
|
-
const client =
|
|
1837
|
-
const [creating, setCreating] =
|
|
1838
|
-
const [newKeyName, setNewKeyName] =
|
|
1839
|
-
const [showCreate, setShowCreate] =
|
|
1840
|
-
const [rawKey, setRawKey] =
|
|
1841
|
-
const [revokeTarget, setRevokeTarget] =
|
|
1842
|
-
const [revoking, setRevoking] =
|
|
1843
|
-
const [revokeError, setRevokeError] =
|
|
1763
|
+
const client = chunkVBGYWQUF_cjs.useAgentPlaneClient();
|
|
1764
|
+
const [creating, setCreating] = React.useState(false);
|
|
1765
|
+
const [newKeyName, setNewKeyName] = React.useState("default");
|
|
1766
|
+
const [showCreate, setShowCreate] = React.useState(false);
|
|
1767
|
+
const [rawKey, setRawKey] = React.useState(null);
|
|
1768
|
+
const [revokeTarget, setRevokeTarget] = React.useState(null);
|
|
1769
|
+
const [revoking, setRevoking] = React.useState(false);
|
|
1770
|
+
const [revokeError, setRevokeError] = React.useState("");
|
|
1844
1771
|
async function handleCreate() {
|
|
1845
1772
|
setCreating(true);
|
|
1846
1773
|
try {
|
|
@@ -1870,17 +1797,17 @@ function ApiKeysSection({ initialKeys, onChanged }) {
|
|
|
1870
1797
|
const activeKeys = initialKeys.filter((k) => !k.revoked_at);
|
|
1871
1798
|
const revokedKeys = initialKeys.filter((k) => k.revoked_at);
|
|
1872
1799
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg border border-muted-foreground/25 p-5", children: [
|
|
1873
|
-
/* @__PURE__ */ jsxRuntime.jsx(SectionHeader, { title: "API Keys", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1800
|
+
/* @__PURE__ */ jsxRuntime.jsx(SectionHeader, { title: "API Keys", children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { variant: "outline", size: "sm", onClick: () => setShowCreate(!showCreate), children: showCreate ? "Cancel" : "+ New Key" }) }),
|
|
1874
1801
|
rawKey && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-4 p-3 rounded-lg border border-yellow-500/50 bg-yellow-500/10", children: [
|
|
1875
1802
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium mb-1", children: "New API key created \u2014 copy it now, it won't be shown again:" }),
|
|
1876
1803
|
/* @__PURE__ */ jsxRuntime.jsx("code", { className: "block text-xs font-mono bg-black/20 p-2 rounded break-all select-all", children: rawKey }),
|
|
1877
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1804
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { size: "sm", variant: "outline", className: "mt-2", onClick: () => setRawKey(null), children: "Dismiss" })
|
|
1878
1805
|
] }),
|
|
1879
1806
|
showCreate && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-4 flex gap-2 items-end", children: [
|
|
1880
1807
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
|
|
1881
1808
|
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-xs font-medium text-muted-foreground", children: "Key Name" }),
|
|
1882
1809
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1883
|
-
|
|
1810
|
+
chunkVBGYWQUF_cjs.Input,
|
|
1884
1811
|
{
|
|
1885
1812
|
value: newKeyName,
|
|
1886
1813
|
onChange: (e) => setNewKeyName(e.target.value),
|
|
@@ -1889,7 +1816,7 @@ function ApiKeysSection({ initialKeys, onChanged }) {
|
|
|
1889
1816
|
}
|
|
1890
1817
|
)
|
|
1891
1818
|
] }),
|
|
1892
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1819
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { size: "sm", onClick: handleCreate, disabled: creating, children: creating ? "Creating..." : "Create" })
|
|
1893
1820
|
] }),
|
|
1894
1821
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-lg border border-border", children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "w-full text-sm", children: [
|
|
1895
1822
|
/* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { className: "border-b border-border bg-muted/50", children: [
|
|
@@ -1907,11 +1834,11 @@ function ApiKeysSection({ initialKeys, onChanged }) {
|
|
|
1907
1834
|
k.key_prefix,
|
|
1908
1835
|
"..."
|
|
1909
1836
|
] }),
|
|
1910
|
-
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "p-3", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1837
|
+
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "p-3", children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Badge, { variant: "default", children: "active" }) }),
|
|
1911
1838
|
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "p-3 text-muted-foreground text-xs", children: k.last_used_at ? new Date(k.last_used_at).toLocaleString() : "never" }),
|
|
1912
1839
|
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "p-3 text-muted-foreground text-xs", children: new Date(k.created_at).toLocaleDateString() }),
|
|
1913
1840
|
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "p-3 text-right", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1914
|
-
|
|
1841
|
+
chunkVBGYWQUF_cjs.Button,
|
|
1915
1842
|
{
|
|
1916
1843
|
size: "sm",
|
|
1917
1844
|
variant: "destructive",
|
|
@@ -1926,7 +1853,7 @@ function ApiKeysSection({ initialKeys, onChanged }) {
|
|
|
1926
1853
|
k.key_prefix,
|
|
1927
1854
|
"..."
|
|
1928
1855
|
] }),
|
|
1929
|
-
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "p-3", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1856
|
+
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "p-3", children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Badge, { variant: "destructive", children: "revoked" }) }),
|
|
1930
1857
|
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "p-3 text-muted-foreground text-xs", children: k.last_used_at ? new Date(k.last_used_at).toLocaleString() : "never" }),
|
|
1931
1858
|
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "p-3 text-muted-foreground text-xs", children: new Date(k.created_at).toLocaleDateString() }),
|
|
1932
1859
|
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "p-3" })
|
|
@@ -1959,11 +1886,11 @@ function ApiKeysSection({ initialKeys, onChanged }) {
|
|
|
1959
1886
|
] });
|
|
1960
1887
|
}
|
|
1961
1888
|
function DangerZone({ tenantId, tenantName }) {
|
|
1962
|
-
const client =
|
|
1963
|
-
const { onNavigate, basePath } =
|
|
1964
|
-
const [open, setOpen] =
|
|
1965
|
-
const [deleting, setDeleting] =
|
|
1966
|
-
const [error, setError] =
|
|
1889
|
+
const client = chunkVBGYWQUF_cjs.useAgentPlaneClient();
|
|
1890
|
+
const { onNavigate, basePath } = chunkVBGYWQUF_cjs.useNavigation();
|
|
1891
|
+
const [open, setOpen] = React.useState(false);
|
|
1892
|
+
const [deleting, setDeleting] = React.useState(false);
|
|
1893
|
+
const [error, setError] = React.useState("");
|
|
1967
1894
|
async function handleDelete() {
|
|
1968
1895
|
setDeleting(true);
|
|
1969
1896
|
setError("");
|
|
@@ -1983,7 +1910,7 @@ function DangerZone({ tenantId, tenantName }) {
|
|
|
1983
1910
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-destructive", children: "Danger Zone" }),
|
|
1984
1911
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground mt-1", children: "Permanently delete this company and all its agents, runs, sessions, and API keys." })
|
|
1985
1912
|
] }),
|
|
1986
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1913
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { size: "sm", variant: "destructive", onClick: () => setOpen(true), children: "Delete Company" })
|
|
1987
1914
|
] }),
|
|
1988
1915
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1989
1916
|
ConfirmDialog,
|
|
@@ -2043,15 +1970,15 @@ var TAG_TITLES = {
|
|
|
2043
1970
|
"image-generation": "Image Generation"
|
|
2044
1971
|
};
|
|
2045
1972
|
function ModelSelector({ value, onChange, disabled }) {
|
|
2046
|
-
const client =
|
|
2047
|
-
const [open, setOpen] =
|
|
2048
|
-
const [models, setModels] =
|
|
2049
|
-
const [loading, setLoading] =
|
|
2050
|
-
const [error, setError] =
|
|
2051
|
-
const [search, setSearch] =
|
|
2052
|
-
const [providerFilter, setProviderFilter] =
|
|
2053
|
-
const hasFetchedRef =
|
|
2054
|
-
|
|
1973
|
+
const client = chunkVBGYWQUF_cjs.useAgentPlaneClient();
|
|
1974
|
+
const [open, setOpen] = React.useState(false);
|
|
1975
|
+
const [models, setModels] = React.useState(null);
|
|
1976
|
+
const [loading, setLoading] = React.useState(false);
|
|
1977
|
+
const [error, setError] = React.useState(false);
|
|
1978
|
+
const [search, setSearch] = React.useState("");
|
|
1979
|
+
const [providerFilter, setProviderFilter] = React.useState("all");
|
|
1980
|
+
const hasFetchedRef = React.useRef(false);
|
|
1981
|
+
React.useEffect(() => {
|
|
2055
1982
|
if (!open || hasFetchedRef.current) return;
|
|
2056
1983
|
hasFetchedRef.current = true;
|
|
2057
1984
|
let cancelled = false;
|
|
@@ -2072,12 +1999,12 @@ function ModelSelector({ value, onChange, disabled }) {
|
|
|
2072
1999
|
cancelled = true;
|
|
2073
2000
|
};
|
|
2074
2001
|
}, [open, client]);
|
|
2075
|
-
const providers =
|
|
2002
|
+
const providers = React.useMemo(() => {
|
|
2076
2003
|
if (!models) return [];
|
|
2077
2004
|
const set = new Set(models.map((m) => m.provider));
|
|
2078
2005
|
return Array.from(set).sort();
|
|
2079
2006
|
}, [models]);
|
|
2080
|
-
const grouped =
|
|
2007
|
+
const grouped = React.useMemo(() => {
|
|
2081
2008
|
if (!models) return {};
|
|
2082
2009
|
let filtered = models;
|
|
2083
2010
|
if (providerFilter !== "all") {
|
|
@@ -2093,7 +2020,7 @@ function ModelSelector({ value, onChange, disabled }) {
|
|
|
2093
2020
|
}, [models, providerFilter]);
|
|
2094
2021
|
const selectedModel = models?.find((m) => m.id === value);
|
|
2095
2022
|
const displayName = selectedModel?.name || value || "Select model...";
|
|
2096
|
-
const searchMatchesAny =
|
|
2023
|
+
const searchMatchesAny = React.useMemo(() => {
|
|
2097
2024
|
if (!search || !models) return true;
|
|
2098
2025
|
const lower = search.toLowerCase();
|
|
2099
2026
|
return models.some(
|
|
@@ -2247,11 +2174,11 @@ function ModelSelector({ value, onChange, disabled }) {
|
|
|
2247
2174
|
] });
|
|
2248
2175
|
}
|
|
2249
2176
|
function AddAgentDialog({ onCreated }) {
|
|
2250
|
-
const client =
|
|
2251
|
-
const [open, setOpen] =
|
|
2252
|
-
const [saving, setSaving] =
|
|
2253
|
-
const [error, setError] =
|
|
2254
|
-
const [form, setForm] =
|
|
2177
|
+
const client = chunkVBGYWQUF_cjs.useAgentPlaneClient();
|
|
2178
|
+
const [open, setOpen] = React.useState(false);
|
|
2179
|
+
const [saving, setSaving] = React.useState(false);
|
|
2180
|
+
const [error, setError] = React.useState("");
|
|
2181
|
+
const [form, setForm] = React.useState({
|
|
2255
2182
|
name: "",
|
|
2256
2183
|
description: "",
|
|
2257
2184
|
model: "claude-sonnet-4-6",
|
|
@@ -2299,15 +2226,15 @@ function AddAgentDialog({ onCreated }) {
|
|
|
2299
2226
|
}
|
|
2300
2227
|
}
|
|
2301
2228
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2302
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2303
|
-
/* @__PURE__ */ jsxRuntime.jsx(Dialog, { open, onOpenChange: (v) => {
|
|
2229
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { variant: "outline", size: "sm", onClick: () => setOpen(true), children: "+ New Agent" }),
|
|
2230
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Dialog, { open, onOpenChange: (v) => {
|
|
2304
2231
|
setOpen(v);
|
|
2305
2232
|
if (!v) resetForm();
|
|
2306
|
-
}, children: /* @__PURE__ */ jsxRuntime.jsx(DialogContent, { className: "max-w-md", children: /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: handleSubmit, children: [
|
|
2307
|
-
/* @__PURE__ */ jsxRuntime.jsx(DialogHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { children: "Add Agent" }) }),
|
|
2308
|
-
/* @__PURE__ */ jsxRuntime.jsxs(DialogBody, { className: "space-y-3", children: [
|
|
2309
|
-
/* @__PURE__ */ jsxRuntime.jsx(FormField, { label: "Name", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2310
|
-
|
|
2233
|
+
}, children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.DialogContent, { className: "max-w-md", children: /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: handleSubmit, children: [
|
|
2234
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.DialogHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.DialogTitle, { children: "Add Agent" }) }),
|
|
2235
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.DialogBody, { className: "space-y-3", children: [
|
|
2236
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.FormField, { label: "Name", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2237
|
+
chunkVBGYWQUF_cjs.Input,
|
|
2311
2238
|
{
|
|
2312
2239
|
value: form.name,
|
|
2313
2240
|
onChange: (e) => setForm((f) => ({ ...f, name: e.target.value })),
|
|
@@ -2315,28 +2242,28 @@ function AddAgentDialog({ onCreated }) {
|
|
|
2315
2242
|
required: true
|
|
2316
2243
|
}
|
|
2317
2244
|
) }),
|
|
2318
|
-
/* @__PURE__ */ jsxRuntime.jsx(FormField, { label: "Description", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2319
|
-
|
|
2245
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.FormField, { label: "Description", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2246
|
+
chunkVBGYWQUF_cjs.Input,
|
|
2320
2247
|
{
|
|
2321
2248
|
value: form.description,
|
|
2322
2249
|
onChange: (e) => setForm((f) => ({ ...f, description: e.target.value })),
|
|
2323
2250
|
placeholder: "What does this agent do?"
|
|
2324
2251
|
}
|
|
2325
2252
|
) }),
|
|
2326
|
-
/* @__PURE__ */ jsxRuntime.jsx(FormField, { label: "Model", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2253
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.FormField, { label: "Model", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2327
2254
|
ModelSelector,
|
|
2328
2255
|
{
|
|
2329
2256
|
value: form.model,
|
|
2330
2257
|
onChange: (modelId) => setForm((f) => ({
|
|
2331
2258
|
...f,
|
|
2332
2259
|
model: modelId,
|
|
2333
|
-
runner:
|
|
2334
|
-
permission_mode:
|
|
2260
|
+
runner: chunkVBGYWQUF_cjs.supportsClaudeRunner(modelId) ? f.runner : "vercel-ai-sdk",
|
|
2261
|
+
permission_mode: chunkVBGYWQUF_cjs.supportsClaudeRunner(modelId) ? f.permission_mode : "bypassPermissions"
|
|
2335
2262
|
}))
|
|
2336
2263
|
}
|
|
2337
2264
|
) }),
|
|
2338
2265
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
|
|
2339
|
-
/* @__PURE__ */ jsxRuntime.jsx(FormField, { label: "Runner", children:
|
|
2266
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.FormField, { label: "Runner", children: chunkVBGYWQUF_cjs.supportsClaudeRunner(form.model) ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2340
2267
|
Select,
|
|
2341
2268
|
{
|
|
2342
2269
|
value: form.runner || "claude-agent-sdk",
|
|
@@ -2347,12 +2274,12 @@ function AddAgentDialog({ onCreated }) {
|
|
|
2347
2274
|
]
|
|
2348
2275
|
}
|
|
2349
2276
|
) : /* @__PURE__ */ jsxRuntime.jsx(Select, { value: "vercel-ai-sdk", disabled: true, children: /* @__PURE__ */ jsxRuntime.jsx("option", { value: "vercel-ai-sdk", children: "Vercel AI SDK" }) }) }),
|
|
2350
|
-
/* @__PURE__ */ jsxRuntime.jsx(FormField, { label: "Permission Mode", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2277
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.FormField, { label: "Permission Mode", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2351
2278
|
Select,
|
|
2352
2279
|
{
|
|
2353
2280
|
value: form.permission_mode,
|
|
2354
2281
|
onChange: (e) => setForm((f) => ({ ...f, permission_mode: e.target.value })),
|
|
2355
|
-
disabled: !
|
|
2282
|
+
disabled: !chunkVBGYWQUF_cjs.supportsClaudeRunner(form.model) || form.runner === "vercel-ai-sdk",
|
|
2356
2283
|
children: [
|
|
2357
2284
|
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "default", children: "default" }),
|
|
2358
2285
|
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "acceptEdits", children: "acceptEdits" }),
|
|
@@ -2363,8 +2290,8 @@ function AddAgentDialog({ onCreated }) {
|
|
|
2363
2290
|
) })
|
|
2364
2291
|
] }),
|
|
2365
2292
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-3 gap-3", children: [
|
|
2366
|
-
/* @__PURE__ */ jsxRuntime.jsx(FormField, { label: "Max Turns", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2367
|
-
|
|
2293
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.FormField, { label: "Max Turns", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2294
|
+
chunkVBGYWQUF_cjs.Input,
|
|
2368
2295
|
{
|
|
2369
2296
|
type: "number",
|
|
2370
2297
|
min: "1",
|
|
@@ -2374,10 +2301,10 @@ function AddAgentDialog({ onCreated }) {
|
|
|
2374
2301
|
required: true
|
|
2375
2302
|
}
|
|
2376
2303
|
) }),
|
|
2377
|
-
/* @__PURE__ */ jsxRuntime.jsx(FormField, { label: "Max Budget", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
2304
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.FormField, { label: "Max Budget", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
2378
2305
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground", children: "$" }),
|
|
2379
2306
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2380
|
-
|
|
2307
|
+
chunkVBGYWQUF_cjs.Input,
|
|
2381
2308
|
{
|
|
2382
2309
|
type: "number",
|
|
2383
2310
|
step: "0.01",
|
|
@@ -2390,9 +2317,9 @@ function AddAgentDialog({ onCreated }) {
|
|
|
2390
2317
|
}
|
|
2391
2318
|
)
|
|
2392
2319
|
] }) }),
|
|
2393
|
-
/* @__PURE__ */ jsxRuntime.jsx(FormField, { label: "Max Runtime", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
2320
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.FormField, { label: "Max Runtime", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
2394
2321
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2395
|
-
|
|
2322
|
+
chunkVBGYWQUF_cjs.Input,
|
|
2396
2323
|
{
|
|
2397
2324
|
type: "number",
|
|
2398
2325
|
min: "1",
|
|
@@ -2408,21 +2335,21 @@ function AddAgentDialog({ onCreated }) {
|
|
|
2408
2335
|
] }),
|
|
2409
2336
|
/* @__PURE__ */ jsxRuntime.jsx(FormError, { error })
|
|
2410
2337
|
] }),
|
|
2411
|
-
/* @__PURE__ */ jsxRuntime.jsxs(DialogFooter, { children: [
|
|
2412
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2338
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.DialogFooter, { children: [
|
|
2339
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { type: "button", variant: "outline", size: "sm", onClick: () => {
|
|
2413
2340
|
setOpen(false);
|
|
2414
2341
|
resetForm();
|
|
2415
2342
|
}, children: "Cancel" }),
|
|
2416
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2343
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { type: "submit", size: "sm", disabled: saving, children: saving ? "Creating..." : "Create Agent" })
|
|
2417
2344
|
] })
|
|
2418
2345
|
] }) }) })
|
|
2419
2346
|
] });
|
|
2420
2347
|
}
|
|
2421
2348
|
function DeleteAgentButton({ agentId, agentName, onDeleted }) {
|
|
2422
|
-
const client =
|
|
2423
|
-
const [open, setOpen] =
|
|
2424
|
-
const [deleting, setDeleting] =
|
|
2425
|
-
const [error, setError] =
|
|
2349
|
+
const client = chunkVBGYWQUF_cjs.useAgentPlaneClient();
|
|
2350
|
+
const [open, setOpen] = React.useState(false);
|
|
2351
|
+
const [deleting, setDeleting] = React.useState(false);
|
|
2352
|
+
const [error, setError] = React.useState("");
|
|
2426
2353
|
async function handleDelete() {
|
|
2427
2354
|
setDeleting(true);
|
|
2428
2355
|
setError("");
|
|
@@ -2438,7 +2365,7 @@ function DeleteAgentButton({ agentId, agentName, onDeleted }) {
|
|
|
2438
2365
|
}
|
|
2439
2366
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2440
2367
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2441
|
-
|
|
2368
|
+
chunkVBGYWQUF_cjs.Button,
|
|
2442
2369
|
{
|
|
2443
2370
|
size: "sm",
|
|
2444
2371
|
variant: "ghost",
|
|
@@ -2468,20 +2395,20 @@ function DeleteAgentButton({ agentId, agentName, onDeleted }) {
|
|
|
2468
2395
|
] });
|
|
2469
2396
|
}
|
|
2470
2397
|
function AgentListPage() {
|
|
2471
|
-
const { LinkComponent, basePath } =
|
|
2398
|
+
const { LinkComponent, basePath } = chunkVBGYWQUF_cjs.useNavigation();
|
|
2472
2399
|
const { mutate } = swr.useSWRConfig();
|
|
2473
|
-
const { data, error, isLoading } =
|
|
2400
|
+
const { data, error, isLoading } = chunkVBGYWQUF_cjs.useApi(
|
|
2474
2401
|
"agents",
|
|
2475
2402
|
(client) => client.agents.list()
|
|
2476
2403
|
);
|
|
2477
2404
|
const agents = data?.data ?? [];
|
|
2478
|
-
const invalidate =
|
|
2405
|
+
const invalidate = React.useCallback(() => {
|
|
2479
2406
|
mutate("agents");
|
|
2480
2407
|
}, [mutate]);
|
|
2481
2408
|
if (isLoading) {
|
|
2482
2409
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
2483
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2484
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2", children: [1, 2, 3].map((i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2410
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Skeleton, { className: "h-9 w-32" }),
|
|
2411
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2", children: [1, 2, 3].map((i) => /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Skeleton, { className: "h-12 w-full" }, i)) })
|
|
2485
2412
|
] });
|
|
2486
2413
|
}
|
|
2487
2414
|
if (error) {
|
|
@@ -2506,11 +2433,11 @@ function AgentListPage() {
|
|
|
2506
2433
|
agents.map((a) => /* @__PURE__ */ jsxRuntime.jsxs(AdminTableRow, { children: [
|
|
2507
2434
|
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "p-3 font-medium", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2508
2435
|
/* @__PURE__ */ jsxRuntime.jsx(LinkComponent, { href: `${basePath}/agents/${a.id}`, className: "text-primary hover:underline", children: a.name }),
|
|
2509
|
-
a.a2a_enabled && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2436
|
+
a.a2a_enabled && /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Badge, { className: "text-[10px] px-1.5 py-0 bg-indigo-500/10 text-indigo-400 border-indigo-500/20", children: "A2A" })
|
|
2510
2437
|
] }) }),
|
|
2511
2438
|
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "p-3 text-muted-foreground text-xs max-w-xs truncate", title: a.description ?? void 0, children: a.description ?? "\u2014" }),
|
|
2512
2439
|
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "p-3 font-mono text-xs text-muted-foreground", children: a.model }),
|
|
2513
|
-
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "p-3", children: a.composio_toolkits.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-1 flex-wrap", children: a.composio_toolkits.map((t) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2440
|
+
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "p-3", children: a.composio_toolkits.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-1 flex-wrap", children: a.composio_toolkits.map((t) => /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Badge, { variant: "secondary", className: "text-xs", children: t }, t)) }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground text-xs", children: "\u2014" }) }),
|
|
2514
2441
|
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "p-3 text-right", children: (a.skills ?? []).length }),
|
|
2515
2442
|
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "p-3 text-right", children: (a.plugins ?? []).length }),
|
|
2516
2443
|
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "p-3 text-right", children: /* @__PURE__ */ jsxRuntime.jsx(DeleteAgentButton, { agentId: a.id, agentName: a.name, onDeleted: invalidate }) })
|
|
@@ -2521,20 +2448,20 @@ function AgentListPage() {
|
|
|
2521
2448
|
] });
|
|
2522
2449
|
}
|
|
2523
2450
|
function AgentEditForm({ agent, onSaved }) {
|
|
2524
|
-
const client =
|
|
2525
|
-
const [name, setName] =
|
|
2526
|
-
const [description, setDescription] =
|
|
2527
|
-
const [model, setModel] =
|
|
2528
|
-
const [runner, setRunner] =
|
|
2529
|
-
const [permissionMode, setPermissionMode] =
|
|
2530
|
-
const [maxTurns, setMaxTurns] =
|
|
2531
|
-
const [maxBudget, setMaxBudget] =
|
|
2532
|
-
const [maxRuntime, setMaxRuntime] =
|
|
2533
|
-
const [soulMd, setSoulMd] =
|
|
2534
|
-
const [identityMd, setIdentityMd] =
|
|
2535
|
-
const [saving, setSaving] =
|
|
2451
|
+
const client = chunkVBGYWQUF_cjs.useAgentPlaneClient();
|
|
2452
|
+
const [name, setName] = React.useState(agent.name);
|
|
2453
|
+
const [description, setDescription] = React.useState(agent.description ?? "");
|
|
2454
|
+
const [model, setModel] = React.useState(agent.model);
|
|
2455
|
+
const [runner, setRunner] = React.useState(agent.runner ?? "");
|
|
2456
|
+
const [permissionMode, setPermissionMode] = React.useState(agent.permission_mode);
|
|
2457
|
+
const [maxTurns, setMaxTurns] = React.useState(agent.max_turns.toString());
|
|
2458
|
+
const [maxBudget, setMaxBudget] = React.useState(agent.max_budget_usd.toString());
|
|
2459
|
+
const [maxRuntime, setMaxRuntime] = React.useState(Math.floor(agent.max_runtime_seconds / 60).toString());
|
|
2460
|
+
const [soulMd, setSoulMd] = React.useState(agent.soul_md ?? "");
|
|
2461
|
+
const [identityMd, setIdentityMd] = React.useState(agent.identity_md ?? "");
|
|
2462
|
+
const [saving, setSaving] = React.useState(false);
|
|
2536
2463
|
const isDirty = name !== agent.name || description !== (agent.description ?? "") || model !== agent.model || runner !== (agent.runner ?? "") || permissionMode !== agent.permission_mode || maxTurns !== agent.max_turns.toString() || maxBudget !== agent.max_budget_usd.toString() || maxRuntime !== Math.floor(agent.max_runtime_seconds / 60).toString() || soulMd !== (agent.soul_md ?? "") || identityMd !== (agent.identity_md ?? "");
|
|
2537
|
-
const [error, setError] =
|
|
2464
|
+
const [error, setError] = React.useState("");
|
|
2538
2465
|
async function handleSave() {
|
|
2539
2466
|
setSaving(true);
|
|
2540
2467
|
setError("");
|
|
@@ -2561,13 +2488,13 @@ function AgentEditForm({ agent, onSaved }) {
|
|
|
2561
2488
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg border border-muted-foreground/25 p-5", children: [
|
|
2562
2489
|
/* @__PURE__ */ jsxRuntime.jsxs(SectionHeader, { title: "Details", children: [
|
|
2563
2490
|
error && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-destructive mr-2", children: error }),
|
|
2564
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2491
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { onClick: handleSave, disabled: saving || !isDirty, size: "sm", children: saving ? "Saving..." : "Save Changes" })
|
|
2565
2492
|
] }),
|
|
2566
2493
|
/* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
2567
2494
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-12 gap-4", children: [
|
|
2568
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-2", children: /* @__PURE__ */ jsxRuntime.jsx(FormField, { label: "Name", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2569
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-4", children: /* @__PURE__ */ jsxRuntime.jsx(FormField, { label: "Description", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2570
|
-
|
|
2495
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-2", children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.FormField, { label: "Name", children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Input, { value: name, onChange: (e) => setName(e.target.value), disabled: saving }) }) }),
|
|
2496
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-4", children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.FormField, { label: "Description", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2497
|
+
chunkVBGYWQUF_cjs.Input,
|
|
2571
2498
|
{
|
|
2572
2499
|
value: description,
|
|
2573
2500
|
onChange: (e) => setDescription(e.target.value),
|
|
@@ -2575,47 +2502,44 @@ function AgentEditForm({ agent, onSaved }) {
|
|
|
2575
2502
|
disabled: saving
|
|
2576
2503
|
}
|
|
2577
2504
|
) }) }),
|
|
2578
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-3", children: /* @__PURE__ */ jsxRuntime.jsx(FormField, { label: "Model", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2505
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-3", children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.FormField, { label: "Model", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2579
2506
|
ModelSelector,
|
|
2580
2507
|
{
|
|
2581
2508
|
value: model,
|
|
2582
2509
|
disabled: saving,
|
|
2583
2510
|
onChange: (modelId) => {
|
|
2584
2511
|
setModel(modelId);
|
|
2585
|
-
if (!
|
|
2512
|
+
if (!chunkVBGYWQUF_cjs.supportsClaudeRunner(modelId)) {
|
|
2586
2513
|
setRunner("vercel-ai-sdk");
|
|
2587
2514
|
setPermissionMode("bypassPermissions");
|
|
2588
2515
|
}
|
|
2589
2516
|
}
|
|
2590
2517
|
}
|
|
2591
2518
|
) }) }),
|
|
2592
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-3", children: /* @__PURE__ */ jsxRuntime.jsx(FormField, { label: "Runner", children:
|
|
2519
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-3", children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.FormField, { label: "Runner", children: chunkVBGYWQUF_cjs.supportsClaudeRunner(model) ? /* @__PURE__ */ jsxRuntime.jsxs(Select, { value: runner || "claude-agent-sdk", onChange: (e) => setRunner(e.target.value === "claude-agent-sdk" ? "" : e.target.value), disabled: saving, children: [
|
|
2593
2520
|
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "claude-agent-sdk", children: "Claude SDK" }),
|
|
2594
2521
|
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "vercel-ai-sdk", children: "AI SDK" })
|
|
2595
2522
|
] }) : /* @__PURE__ */ jsxRuntime.jsx(Select, { value: "vercel-ai-sdk", disabled: true, children: /* @__PURE__ */ jsxRuntime.jsx("option", { value: "vercel-ai-sdk", children: "AI SDK" }) }) }) })
|
|
2596
2523
|
] }),
|
|
2597
2524
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-12 gap-4", children: [
|
|
2598
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-2", children: /* @__PURE__ */ jsxRuntime.jsx(FormField, { label: "Max Turns", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2599
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-2", children: /* @__PURE__ */ jsxRuntime.jsx(FormField, { label: "Max Budget", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
2525
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-2", children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.FormField, { label: "Max Turns", children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Input, { type: "number", min: "1", max: "1000", value: maxTurns, onChange: (e) => setMaxTurns(e.target.value), disabled: saving }) }) }),
|
|
2526
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-2", children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.FormField, { label: "Max Budget", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
2600
2527
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground", children: "$" }),
|
|
2601
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2528
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Input, { type: "number", step: "0.01", min: "0.01", max: "100", value: maxBudget, onChange: (e) => setMaxBudget(e.target.value), className: "pl-6", disabled: saving })
|
|
2602
2529
|
] }) }) }),
|
|
2603
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-2", children: /* @__PURE__ */ jsxRuntime.jsx(FormField, { label: "Max Runtime", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
2604
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2530
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-2", children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.FormField, { label: "Max Runtime", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
2531
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Input, { type: "number", min: "1", max: "60", value: maxRuntime, onChange: (e) => setMaxRuntime(e.target.value), className: "pr-10", disabled: saving }),
|
|
2605
2532
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute right-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground", children: "min" })
|
|
2606
2533
|
] }) }) }),
|
|
2607
|
-
|
|
2534
|
+
chunkVBGYWQUF_cjs.supportsClaudeRunner(model) && (runner === "" || runner === "claude-agent-sdk") && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-3", children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.FormField, { label: "Permission Mode", children: /* @__PURE__ */ jsxRuntime.jsxs(Select, { value: permissionMode, onChange: (e) => setPermissionMode(e.target.value), disabled: saving, children: [
|
|
2608
2535
|
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "default", children: "default" }),
|
|
2609
2536
|
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "acceptEdits", children: "acceptEdits" }),
|
|
2610
2537
|
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "bypassPermissions", children: "bypassPermissions" }),
|
|
2611
2538
|
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "plan", children: "plan" })
|
|
2612
2539
|
] }) }) })
|
|
2613
|
-
] })
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
/* @__PURE__ */ jsxRuntime.jsx(SectionHeader, { title: "Identity" }),
|
|
2617
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-4", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
2618
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsxs(FormField, { label: "SOUL.md", children: [
|
|
2540
|
+
] }),
|
|
2541
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
2542
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.FormField, { label: "SOUL.md", children: [
|
|
2619
2543
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2620
2544
|
Textarea,
|
|
2621
2545
|
{
|
|
@@ -2632,7 +2556,7 @@ function AgentEditForm({ agent, onSaved }) {
|
|
|
2632
2556
|
" words"
|
|
2633
2557
|
] })
|
|
2634
2558
|
] }) }),
|
|
2635
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsxs(FormField, { label: "IDENTITY.md", children: [
|
|
2559
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.FormField, { label: "IDENTITY.md", children: [
|
|
2636
2560
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2637
2561
|
Textarea,
|
|
2638
2562
|
{
|
|
@@ -2649,23 +2573,23 @@ function AgentEditForm({ agent, onSaved }) {
|
|
|
2649
2573
|
" words"
|
|
2650
2574
|
] })
|
|
2651
2575
|
] }) })
|
|
2652
|
-
] })
|
|
2653
|
-
] })
|
|
2576
|
+
] })
|
|
2577
|
+
] }) })
|
|
2654
2578
|
] });
|
|
2655
2579
|
}
|
|
2656
2580
|
function ToolkitMultiselect({ value, onChange }) {
|
|
2657
|
-
const client =
|
|
2658
|
-
const [open, setOpen] =
|
|
2659
|
-
const [search, setSearch] =
|
|
2660
|
-
const [toolkits, setToolkits] =
|
|
2661
|
-
const [loading, setLoading] =
|
|
2662
|
-
const containerRef =
|
|
2663
|
-
const searchRef =
|
|
2664
|
-
|
|
2581
|
+
const client = chunkVBGYWQUF_cjs.useAgentPlaneClient();
|
|
2582
|
+
const [open, setOpen] = React.useState(false);
|
|
2583
|
+
const [search, setSearch] = React.useState("");
|
|
2584
|
+
const [toolkits, setToolkits] = React.useState([]);
|
|
2585
|
+
const [loading, setLoading] = React.useState(true);
|
|
2586
|
+
const containerRef = React.useRef(null);
|
|
2587
|
+
const searchRef = React.useRef(null);
|
|
2588
|
+
React.useEffect(() => {
|
|
2665
2589
|
client.composio.toolkits().then((data) => setToolkits(data)).catch(() => {
|
|
2666
2590
|
}).finally(() => setLoading(false));
|
|
2667
2591
|
}, [client]);
|
|
2668
|
-
|
|
2592
|
+
React.useEffect(() => {
|
|
2669
2593
|
function handleClick(e) {
|
|
2670
2594
|
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
2671
2595
|
setOpen(false);
|
|
@@ -2675,7 +2599,7 @@ function ToolkitMultiselect({ value, onChange }) {
|
|
|
2675
2599
|
document.addEventListener("mousedown", handleClick);
|
|
2676
2600
|
return () => document.removeEventListener("mousedown", handleClick);
|
|
2677
2601
|
}, []);
|
|
2678
|
-
|
|
2602
|
+
React.useEffect(() => {
|
|
2679
2603
|
searchRef.current?.focus();
|
|
2680
2604
|
}, []);
|
|
2681
2605
|
const filtered = toolkits.filter((t) => {
|
|
@@ -2780,13 +2704,13 @@ function ToolsModal({
|
|
|
2780
2704
|
onOpenChange,
|
|
2781
2705
|
onSave
|
|
2782
2706
|
}) {
|
|
2783
|
-
const client =
|
|
2784
|
-
const [tools, setTools] =
|
|
2785
|
-
const [loading, setLoading] =
|
|
2786
|
-
const [search, setSearch] =
|
|
2787
|
-
const [selected, setSelected] =
|
|
2788
|
-
const [saving, setSaving] =
|
|
2789
|
-
const fetchTools =
|
|
2707
|
+
const client = chunkVBGYWQUF_cjs.useAgentPlaneClient();
|
|
2708
|
+
const [tools, setTools] = React.useState([]);
|
|
2709
|
+
const [loading, setLoading] = React.useState(false);
|
|
2710
|
+
const [search, setSearch] = React.useState("");
|
|
2711
|
+
const [selected, setSelected] = React.useState(/* @__PURE__ */ new Set());
|
|
2712
|
+
const [saving, setSaving] = React.useState(false);
|
|
2713
|
+
const fetchTools = React.useCallback(async () => {
|
|
2790
2714
|
setLoading(true);
|
|
2791
2715
|
try {
|
|
2792
2716
|
const data = await client.composio.tools(toolkit);
|
|
@@ -2795,7 +2719,7 @@ function ToolsModal({
|
|
|
2795
2719
|
setLoading(false);
|
|
2796
2720
|
}
|
|
2797
2721
|
}, [toolkit, client]);
|
|
2798
|
-
|
|
2722
|
+
React.useEffect(() => {
|
|
2799
2723
|
if (open) {
|
|
2800
2724
|
fetchTools();
|
|
2801
2725
|
setSearch("");
|
|
@@ -2838,20 +2762,20 @@ function ToolsModal({
|
|
|
2838
2762
|
setSaving(false);
|
|
2839
2763
|
}
|
|
2840
2764
|
}
|
|
2841
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContent, { className: "max-w-lg", children: [
|
|
2842
|
-
/* @__PURE__ */ jsxRuntime.jsxs(DialogHeader, { children: [
|
|
2843
|
-
/* @__PURE__ */ jsxRuntime.jsxs(DialogTitle, { className: "capitalize flex items-center gap-2", children: [
|
|
2765
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.DialogContent, { className: "max-w-lg", children: [
|
|
2766
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.DialogHeader, { children: [
|
|
2767
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.DialogTitle, { className: "capitalize flex items-center gap-2", children: [
|
|
2844
2768
|
toolkitLogo && /* @__PURE__ */ jsxRuntime.jsx("img", { src: toolkitLogo, alt: "", className: "w-5 h-5 rounded-sm object-contain flex-shrink-0" }),
|
|
2845
2769
|
toolkit,
|
|
2846
2770
|
" Tools"
|
|
2847
2771
|
] }),
|
|
2848
|
-
!loading && /* @__PURE__ */ jsxRuntime.jsxs(DialogDescription, { children: [
|
|
2772
|
+
!loading && /* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.DialogDescription, { children: [
|
|
2849
2773
|
tools.length,
|
|
2850
2774
|
" tools available"
|
|
2851
2775
|
] })
|
|
2852
2776
|
] }),
|
|
2853
|
-
/* @__PURE__ */ jsxRuntime.jsxs(DialogBody, { className: "space-y-3", children: [
|
|
2854
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2777
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.DialogBody, { className: "space-y-3", children: [
|
|
2778
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Input, { placeholder: "Search tools...", value: search, onChange: (e) => setSearch(e.target.value), className: "h-8 text-sm" }),
|
|
2855
2779
|
loading ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground py-4 text-center", children: "Loading tools..." }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2856
2780
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between text-xs text-muted-foreground", children: [
|
|
2857
2781
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: selected.size === 0 ? "All tools (no filter)" : `${selected.size} / ${tools.length} selected` }),
|
|
@@ -2869,9 +2793,9 @@ function ToolsModal({
|
|
|
2869
2793
|
] })
|
|
2870
2794
|
] })
|
|
2871
2795
|
] }),
|
|
2872
|
-
/* @__PURE__ */ jsxRuntime.jsxs(DialogFooter, { children: [
|
|
2873
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2874
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2796
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.DialogFooter, { children: [
|
|
2797
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { size: "sm", variant: "outline", onClick: () => onOpenChange(false), children: "Cancel" }),
|
|
2798
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { size: "sm", onClick: handleSave, disabled: saving || loading, children: saving ? "Saving..." : "Save" })
|
|
2875
2799
|
] })
|
|
2876
2800
|
] }) });
|
|
2877
2801
|
}
|
|
@@ -2885,14 +2809,14 @@ function McpToolsModal({
|
|
|
2885
2809
|
onOpenChange,
|
|
2886
2810
|
onSave
|
|
2887
2811
|
}) {
|
|
2888
|
-
const client =
|
|
2889
|
-
const [tools, setTools] =
|
|
2890
|
-
const [loading, setLoading] =
|
|
2891
|
-
const [search, setSearch] =
|
|
2892
|
-
const [selected, setSelected] =
|
|
2893
|
-
const [saving, setSaving] =
|
|
2894
|
-
const [error, setError] =
|
|
2895
|
-
const fetchTools =
|
|
2812
|
+
const client = chunkVBGYWQUF_cjs.useAgentPlaneClient();
|
|
2813
|
+
const [tools, setTools] = React.useState([]);
|
|
2814
|
+
const [loading, setLoading] = React.useState(false);
|
|
2815
|
+
const [search, setSearch] = React.useState("");
|
|
2816
|
+
const [selected, setSelected] = React.useState(/* @__PURE__ */ new Set());
|
|
2817
|
+
const [saving, setSaving] = React.useState(false);
|
|
2818
|
+
const [error, setError] = React.useState("");
|
|
2819
|
+
const fetchTools = React.useCallback(async () => {
|
|
2896
2820
|
setLoading(true);
|
|
2897
2821
|
setError("");
|
|
2898
2822
|
try {
|
|
@@ -2904,7 +2828,7 @@ function McpToolsModal({
|
|
|
2904
2828
|
setLoading(false);
|
|
2905
2829
|
}
|
|
2906
2830
|
}, [agentId, mcpServerId, client]);
|
|
2907
|
-
|
|
2831
|
+
React.useEffect(() => {
|
|
2908
2832
|
if (open) {
|
|
2909
2833
|
fetchTools();
|
|
2910
2834
|
setSearch("");
|
|
@@ -2945,20 +2869,20 @@ function McpToolsModal({
|
|
|
2945
2869
|
setSaving(false);
|
|
2946
2870
|
}
|
|
2947
2871
|
}
|
|
2948
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContent, { className: "max-w-lg", children: [
|
|
2949
|
-
/* @__PURE__ */ jsxRuntime.jsxs(DialogHeader, { children: [
|
|
2950
|
-
/* @__PURE__ */ jsxRuntime.jsxs(DialogTitle, { className: "flex items-center gap-2", children: [
|
|
2872
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.DialogContent, { className: "max-w-lg", children: [
|
|
2873
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.DialogHeader, { children: [
|
|
2874
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.DialogTitle, { className: "flex items-center gap-2", children: [
|
|
2951
2875
|
serverLogo && /* @__PURE__ */ jsxRuntime.jsx("img", { src: serverLogo, alt: "", className: "w-5 h-5 rounded-sm object-contain flex-shrink-0" }),
|
|
2952
2876
|
serverName,
|
|
2953
2877
|
" Tools"
|
|
2954
2878
|
] }),
|
|
2955
|
-
!loading && !error && /* @__PURE__ */ jsxRuntime.jsxs(DialogDescription, { children: [
|
|
2879
|
+
!loading && !error && /* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.DialogDescription, { children: [
|
|
2956
2880
|
tools.length,
|
|
2957
2881
|
" tools available"
|
|
2958
2882
|
] })
|
|
2959
2883
|
] }),
|
|
2960
|
-
/* @__PURE__ */ jsxRuntime.jsxs(DialogBody, { className: "space-y-3", children: [
|
|
2961
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2884
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.DialogBody, { className: "space-y-3", children: [
|
|
2885
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Input, { placeholder: "Search tools...", value: search, onChange: (e) => setSearch(e.target.value), className: "h-8 text-sm" }),
|
|
2962
2886
|
loading ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground py-4 text-center", children: "Loading tools..." }) : error ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-destructive py-4 text-center", children: error }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2963
2887
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between text-xs text-muted-foreground", children: [
|
|
2964
2888
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: selected.size === 0 ? "All tools (no filter)" : `${selected.size} / ${tools.length} selected` }),
|
|
@@ -2976,38 +2900,38 @@ function McpToolsModal({
|
|
|
2976
2900
|
] })
|
|
2977
2901
|
] })
|
|
2978
2902
|
] }),
|
|
2979
|
-
/* @__PURE__ */ jsxRuntime.jsxs(DialogFooter, { children: [
|
|
2980
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2981
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2903
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.DialogFooter, { children: [
|
|
2904
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { size: "sm", variant: "outline", onClick: () => onOpenChange(false), children: "Cancel" }),
|
|
2905
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { size: "sm", onClick: handleSave, disabled: saving || loading, children: saving ? "Saving..." : "Save" })
|
|
2982
2906
|
] })
|
|
2983
2907
|
] }) });
|
|
2984
2908
|
}
|
|
2985
2909
|
function AgentConnectorsManager({ agentId, toolkits: initialToolkits, composioAllowedTools: initialAllowedTools, onChanged }) {
|
|
2986
|
-
const client =
|
|
2987
|
-
const [localToolkits, setLocalToolkits] =
|
|
2988
|
-
const [connectors, setConnectors] =
|
|
2989
|
-
const [loading, setLoading] =
|
|
2990
|
-
const [showAdd, setShowAdd] =
|
|
2991
|
-
const [pendingToolkits, setPendingToolkits] =
|
|
2992
|
-
const [applyingToolkits, setApplyingToolkits] =
|
|
2993
|
-
const [confirmDelete, setConfirmDelete] =
|
|
2994
|
-
const [deleting, setDeleting] =
|
|
2995
|
-
const [apiKeys, setApiKeys] =
|
|
2996
|
-
const [saving, setSaving] =
|
|
2997
|
-
const [errors, setErrors] =
|
|
2998
|
-
const [allowedTools, setAllowedTools] =
|
|
2999
|
-
const [toolCounts, setToolCounts] =
|
|
3000
|
-
const [toolsModalToolkit, setToolsModalToolkit] =
|
|
3001
|
-
const mcpOauthHandlerRef =
|
|
3002
|
-
const composioOauthHandlerRef =
|
|
3003
|
-
const [mcpConnections, setMcpConnections] =
|
|
3004
|
-
const [mcpServers, setMcpServers] =
|
|
3005
|
-
const [mcpLoading, setMcpLoading] =
|
|
3006
|
-
const [mcpConnecting, setMcpConnecting] =
|
|
3007
|
-
const [confirmMcpDisconnect, setConfirmMcpDisconnect] =
|
|
3008
|
-
const [mcpDisconnecting, setMcpDisconnecting] =
|
|
3009
|
-
const [mcpToolsModal, setMcpToolsModal] =
|
|
3010
|
-
const loadComposio =
|
|
2910
|
+
const client = chunkVBGYWQUF_cjs.useAgentPlaneClient();
|
|
2911
|
+
const [localToolkits, setLocalToolkits] = React.useState(initialToolkits);
|
|
2912
|
+
const [connectors, setConnectors] = React.useState([]);
|
|
2913
|
+
const [loading, setLoading] = React.useState(true);
|
|
2914
|
+
const [showAdd, setShowAdd] = React.useState(false);
|
|
2915
|
+
const [pendingToolkits, setPendingToolkits] = React.useState(initialToolkits);
|
|
2916
|
+
const [applyingToolkits, setApplyingToolkits] = React.useState(false);
|
|
2917
|
+
const [confirmDelete, setConfirmDelete] = React.useState(null);
|
|
2918
|
+
const [deleting, setDeleting] = React.useState(false);
|
|
2919
|
+
const [apiKeys, setApiKeys] = React.useState({});
|
|
2920
|
+
const [saving, setSaving] = React.useState({});
|
|
2921
|
+
const [errors, setErrors] = React.useState({});
|
|
2922
|
+
const [allowedTools, setAllowedTools] = React.useState(initialAllowedTools);
|
|
2923
|
+
const [toolCounts, setToolCounts] = React.useState({});
|
|
2924
|
+
const [toolsModalToolkit, setToolsModalToolkit] = React.useState(null);
|
|
2925
|
+
const mcpOauthHandlerRef = React.useRef(null);
|
|
2926
|
+
const composioOauthHandlerRef = React.useRef(null);
|
|
2927
|
+
const [mcpConnections, setMcpConnections] = React.useState([]);
|
|
2928
|
+
const [mcpServers, setMcpServers] = React.useState([]);
|
|
2929
|
+
const [mcpLoading, setMcpLoading] = React.useState(true);
|
|
2930
|
+
const [mcpConnecting, setMcpConnecting] = React.useState(null);
|
|
2931
|
+
const [confirmMcpDisconnect, setConfirmMcpDisconnect] = React.useState(null);
|
|
2932
|
+
const [mcpDisconnecting, setMcpDisconnecting] = React.useState(false);
|
|
2933
|
+
const [mcpToolsModal, setMcpToolsModal] = React.useState(null);
|
|
2934
|
+
const loadComposio = React.useCallback(async () => {
|
|
3011
2935
|
setLoading(true);
|
|
3012
2936
|
try {
|
|
3013
2937
|
const data = await client.connectors.list(agentId);
|
|
@@ -3016,7 +2940,7 @@ function AgentConnectorsManager({ agentId, toolkits: initialToolkits, composioAl
|
|
|
3016
2940
|
setLoading(false);
|
|
3017
2941
|
}
|
|
3018
2942
|
}, [agentId, client]);
|
|
3019
|
-
const loadMcp =
|
|
2943
|
+
const loadMcp = React.useCallback(async () => {
|
|
3020
2944
|
setMcpLoading(true);
|
|
3021
2945
|
try {
|
|
3022
2946
|
const data = await client.customConnectors.list(agentId);
|
|
@@ -3026,13 +2950,13 @@ function AgentConnectorsManager({ agentId, toolkits: initialToolkits, composioAl
|
|
|
3026
2950
|
}
|
|
3027
2951
|
}, [agentId, client]);
|
|
3028
2952
|
const toolkitsKey = localToolkits.join(",");
|
|
3029
|
-
|
|
2953
|
+
React.useEffect(() => {
|
|
3030
2954
|
loadComposio();
|
|
3031
2955
|
}, [loadComposio, toolkitsKey]);
|
|
3032
|
-
|
|
2956
|
+
React.useEffect(() => {
|
|
3033
2957
|
loadMcp();
|
|
3034
2958
|
}, [loadMcp]);
|
|
3035
|
-
|
|
2959
|
+
React.useEffect(() => {
|
|
3036
2960
|
return () => {
|
|
3037
2961
|
if (mcpOauthHandlerRef.current) {
|
|
3038
2962
|
window.removeEventListener("message", mcpOauthHandlerRef.current);
|
|
@@ -3044,7 +2968,7 @@ function AgentConnectorsManager({ agentId, toolkits: initialToolkits, composioAl
|
|
|
3044
2968
|
}
|
|
3045
2969
|
};
|
|
3046
2970
|
}, []);
|
|
3047
|
-
|
|
2971
|
+
React.useEffect(() => {
|
|
3048
2972
|
if (localToolkits.length === 0) return;
|
|
3049
2973
|
let cancelled = false;
|
|
3050
2974
|
for (const slug of localToolkits) {
|
|
@@ -3230,7 +3154,7 @@ function AgentConnectorsManager({ agentId, toolkits: initialToolkits, composioAl
|
|
|
3230
3154
|
),
|
|
3231
3155
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg border border-muted-foreground/25 p-5", children: [
|
|
3232
3156
|
/* @__PURE__ */ jsxRuntime.jsx(SectionHeader, { title: "Connectors", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3233
|
-
|
|
3157
|
+
chunkVBGYWQUF_cjs.Button,
|
|
3234
3158
|
{
|
|
3235
3159
|
size: "sm",
|
|
3236
3160
|
variant: "outline",
|
|
@@ -3249,11 +3173,11 @@ function AgentConnectorsManager({ agentId, toolkits: initialToolkits, composioAl
|
|
|
3249
3173
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [
|
|
3250
3174
|
s.logo_url && /* @__PURE__ */ jsxRuntime.jsx("img", { src: s.logo_url, alt: "", className: "w-5 h-5 rounded-sm object-contain flex-shrink-0" }),
|
|
3251
3175
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium truncate", children: s.name }),
|
|
3252
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3176
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Badge, { variant: "outline", className: "text-xs flex-shrink-0 ml-auto", children: s.slug })
|
|
3253
3177
|
] }),
|
|
3254
3178
|
s.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground truncate", children: s.description }),
|
|
3255
3179
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3256
|
-
|
|
3180
|
+
chunkVBGYWQUF_cjs.Button,
|
|
3257
3181
|
{
|
|
3258
3182
|
size: "sm",
|
|
3259
3183
|
variant: "outline",
|
|
@@ -3265,8 +3189,8 @@ function AgentConnectorsManager({ agentId, toolkits: initialToolkits, composioAl
|
|
|
3265
3189
|
)
|
|
3266
3190
|
] }, s.id)) }),
|
|
3267
3191
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
3268
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3269
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3192
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { size: "sm", variant: "ghost", onClick: () => setShowAdd(false), children: "Cancel" }),
|
|
3193
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { size: "sm", onClick: handleApplyAdd, disabled: applyingToolkits, children: applyingToolkits ? "Saving..." : "Apply" })
|
|
3270
3194
|
] })
|
|
3271
3195
|
] }),
|
|
3272
3196
|
isAllLoading ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: "Loading..." }) : isEmpty ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: "No connectors added. Click Add to configure connectors." }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-3 gap-3", children: [
|
|
@@ -3274,7 +3198,7 @@ function AgentConnectorsManager({ agentId, toolkits: initialToolkits, composioAl
|
|
|
3274
3198
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
3275
3199
|
c.logo && /* @__PURE__ */ jsxRuntime.jsx("img", { src: c.logo, alt: "", className: "w-5 h-5 rounded-sm object-contain flex-shrink-0" }),
|
|
3276
3200
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium truncate flex-1", children: c.name }),
|
|
3277
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3201
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Badge, { variant: schemeBadgeVariant(c.authScheme ?? c.auth_scheme), className: "text-xs flex-shrink-0", children: c.authScheme ?? c.auth_scheme }),
|
|
3278
3202
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3279
3203
|
"button",
|
|
3280
3204
|
{
|
|
@@ -3306,7 +3230,7 @@ function AgentConnectorsManager({ agentId, toolkits: initialToolkits, composioAl
|
|
|
3306
3230
|
(c.authScheme ?? c.auth_scheme) === "API_KEY" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1 mt-auto", children: [
|
|
3307
3231
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
3308
3232
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3309
|
-
|
|
3233
|
+
chunkVBGYWQUF_cjs.Input,
|
|
3310
3234
|
{
|
|
3311
3235
|
type: "password",
|
|
3312
3236
|
placeholder: c.connected || c.connectionStatus === "ACTIVE" ? "Update API key\u2026" : "Enter API key\u2026",
|
|
@@ -3316,7 +3240,7 @@ function AgentConnectorsManager({ agentId, toolkits: initialToolkits, composioAl
|
|
|
3316
3240
|
}
|
|
3317
3241
|
),
|
|
3318
3242
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3319
|
-
|
|
3243
|
+
chunkVBGYWQUF_cjs.Button,
|
|
3320
3244
|
{
|
|
3321
3245
|
size: "sm",
|
|
3322
3246
|
variant: "outline",
|
|
@@ -3329,14 +3253,14 @@ function AgentConnectorsManager({ agentId, toolkits: initialToolkits, composioAl
|
|
|
3329
3253
|
] }),
|
|
3330
3254
|
/* @__PURE__ */ jsxRuntime.jsx(FormError, { error: errors[c.slug] })
|
|
3331
3255
|
] }),
|
|
3332
|
-
((c.authScheme ?? c.auth_scheme) === "OAUTH2" || (c.authScheme ?? c.auth_scheme) === "OAUTH1") && c.connectionStatus !== "ACTIVE" && !c.connected && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3333
|
-
((c.authScheme ?? c.auth_scheme) === "OAUTH2" || (c.authScheme ?? c.auth_scheme) === "OAUTH1") && (c.connectionStatus === "ACTIVE" || c.connected) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3256
|
+
((c.authScheme ?? c.auth_scheme) === "OAUTH2" || (c.authScheme ?? c.auth_scheme) === "OAUTH1") && c.connectionStatus !== "ACTIVE" && !c.connected && /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { size: "sm", variant: "outline", className: "h-7 text-xs w-full mt-auto", onClick: () => handleComposioOauth(c.slug), children: "Connect" }),
|
|
3257
|
+
((c.authScheme ?? c.auth_scheme) === "OAUTH2" || (c.authScheme ?? c.auth_scheme) === "OAUTH1") && (c.connectionStatus === "ACTIVE" || c.connected) && /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { size: "sm", variant: "ghost", className: "h-7 text-xs text-muted-foreground w-full mt-auto", onClick: () => handleComposioOauth(c.slug), children: "Reconnect" })
|
|
3334
3258
|
] }, `composio-${c.slug}`)),
|
|
3335
3259
|
mcpConnections.map((c) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg border border-border p-3 flex flex-col gap-2", children: [
|
|
3336
3260
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
3337
3261
|
c.server_logo_url && /* @__PURE__ */ jsxRuntime.jsx("img", { src: c.server_logo_url, alt: "", className: "w-5 h-5 rounded-sm object-contain flex-shrink-0" }),
|
|
3338
3262
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium truncate flex-1", children: c.server_name }),
|
|
3339
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3263
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Badge, { variant: "outline", className: "text-xs flex-shrink-0", children: c.server_slug }),
|
|
3340
3264
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3341
3265
|
"button",
|
|
3342
3266
|
{
|
|
@@ -3359,7 +3283,7 @@ function AgentConnectorsManager({ agentId, toolkits: initialToolkits, composioAl
|
|
|
3359
3283
|
}
|
|
3360
3284
|
),
|
|
3361
3285
|
(c.status === "expired" || c.status === "failed") && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3362
|
-
|
|
3286
|
+
chunkVBGYWQUF_cjs.Button,
|
|
3363
3287
|
{
|
|
3364
3288
|
size: "sm",
|
|
3365
3289
|
variant: "ghost",
|
|
@@ -3407,7 +3331,7 @@ function AgentConnectorsManager({ agentId, toolkits: initialToolkits, composioAl
|
|
|
3407
3331
|
)
|
|
3408
3332
|
] });
|
|
3409
3333
|
}
|
|
3410
|
-
var CodeEditor =
|
|
3334
|
+
var CodeEditor = React.lazy(() => import('./code-editor-ZYP54YUT.cjs'));
|
|
3411
3335
|
function buildTree(files) {
|
|
3412
3336
|
const rootFiles = [];
|
|
3413
3337
|
const dirMap = /* @__PURE__ */ new Map();
|
|
@@ -3478,49 +3402,49 @@ function FileTreeEditor({
|
|
|
3478
3402
|
newFileTemplate = { filename: "SKILL.md", content: "---\nname: New Skill\ndescription: Describe when this skill should be triggered\n---\n\n# Instructions\n\nDescribe what this skill does...\n" },
|
|
3479
3403
|
savedVersion
|
|
3480
3404
|
}) {
|
|
3481
|
-
const [files, setFiles] =
|
|
3482
|
-
const [selectedPath, setSelectedPath] =
|
|
3405
|
+
const [files, setFiles] = React.useState(initialFiles);
|
|
3406
|
+
const [selectedPath, setSelectedPath] = React.useState(
|
|
3483
3407
|
initialFiles.length > 0 ? initialFiles[0].path : null
|
|
3484
3408
|
);
|
|
3485
|
-
const [saving, setSaving] =
|
|
3486
|
-
const [expanded, setExpanded] =
|
|
3409
|
+
const [saving, setSaving] = React.useState(false);
|
|
3410
|
+
const [expanded, setExpanded] = React.useState(() => {
|
|
3487
3411
|
const { rootDirs } = buildTree(initialFiles);
|
|
3488
3412
|
return collectAllDirPaths(rootDirs);
|
|
3489
3413
|
});
|
|
3490
|
-
const [showAddFolder, setShowAddFolder] =
|
|
3491
|
-
const [newFolderName, setNewFolderName] =
|
|
3492
|
-
const [addingFileInDir, setAddingFileInDir] =
|
|
3493
|
-
const [newFileName, setNewFileName] =
|
|
3494
|
-
const [savedSnapshot, setSavedSnapshot] =
|
|
3495
|
-
|
|
3414
|
+
const [showAddFolder, setShowAddFolder] = React.useState(false);
|
|
3415
|
+
const [newFolderName, setNewFolderName] = React.useState("");
|
|
3416
|
+
const [addingFileInDir, setAddingFileInDir] = React.useState(null);
|
|
3417
|
+
const [newFileName, setNewFileName] = React.useState("");
|
|
3418
|
+
const [savedSnapshot, setSavedSnapshot] = React.useState(() => JSON.stringify(initialFiles));
|
|
3419
|
+
React.useEffect(() => {
|
|
3496
3420
|
const snap = JSON.stringify(initialFiles);
|
|
3497
3421
|
setSavedSnapshot(snap);
|
|
3498
3422
|
setFiles(initialFiles);
|
|
3499
3423
|
const { rootDirs } = buildTree(initialFiles);
|
|
3500
3424
|
setExpanded(collectAllDirPaths(rootDirs));
|
|
3501
3425
|
}, [initialFiles]);
|
|
3502
|
-
|
|
3426
|
+
React.useEffect(() => {
|
|
3503
3427
|
if (savedVersion !== void 0 && savedVersion > 0) {
|
|
3504
3428
|
setSavedSnapshot(JSON.stringify(files));
|
|
3505
3429
|
}
|
|
3506
3430
|
}, [savedVersion]);
|
|
3507
|
-
const onChangeRef =
|
|
3431
|
+
const onChangeRef = React.useRef(onChange);
|
|
3508
3432
|
onChangeRef.current = onChange;
|
|
3509
|
-
|
|
3433
|
+
React.useEffect(() => {
|
|
3510
3434
|
if (onChangeRef.current && JSON.stringify(files) !== savedSnapshot) {
|
|
3511
3435
|
onChangeRef.current(files);
|
|
3512
3436
|
}
|
|
3513
3437
|
}, [files, savedSnapshot]);
|
|
3514
|
-
const isDirty =
|
|
3438
|
+
const isDirty = React.useMemo(
|
|
3515
3439
|
() => JSON.stringify(files) !== savedSnapshot,
|
|
3516
3440
|
[files, savedSnapshot]
|
|
3517
3441
|
);
|
|
3518
|
-
const tree =
|
|
3519
|
-
const activeFile =
|
|
3442
|
+
const tree = React.useMemo(() => buildTree(files), [files]);
|
|
3443
|
+
const activeFile = React.useMemo(
|
|
3520
3444
|
() => selectedPath ? files.find((f) => f.path === selectedPath) ?? null : null,
|
|
3521
3445
|
[files, selectedPath]
|
|
3522
3446
|
);
|
|
3523
|
-
const handleEditorChange =
|
|
3447
|
+
const handleEditorChange = React.useCallback((value) => {
|
|
3524
3448
|
if (readOnly || !selectedPath) return;
|
|
3525
3449
|
setFiles((prev) => prev.map((f) => f.path === selectedPath ? { ...f, content: value } : f));
|
|
3526
3450
|
}, [readOnly, selectedPath]);
|
|
@@ -3635,7 +3559,7 @@ function FileTreeEditor({
|
|
|
3635
3559
|
}),
|
|
3636
3560
|
!readOnly && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { paddingLeft: `${(depth + 1) * 16 + 8}px` }, className: "py-1 pr-2", children: addingFileInDir === node.fullPath ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-1", children: [
|
|
3637
3561
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3638
|
-
|
|
3562
|
+
chunkVBGYWQUF_cjs.Input,
|
|
3639
3563
|
{
|
|
3640
3564
|
value: newFileName,
|
|
3641
3565
|
onChange: (e) => setNewFileName(e.target.value),
|
|
@@ -3645,7 +3569,7 @@ function FileTreeEditor({
|
|
|
3645
3569
|
autoFocus: true
|
|
3646
3570
|
}
|
|
3647
3571
|
),
|
|
3648
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3572
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { onClick: () => addFileInDir(node.fullPath), size: "sm", className: "h-6 text-xs px-2", children: "+" })
|
|
3649
3573
|
] }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
3650
3574
|
"button",
|
|
3651
3575
|
{
|
|
@@ -3664,10 +3588,10 @@ function FileTreeEditor({
|
|
|
3664
3588
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-3", children: [
|
|
3665
3589
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
3666
3590
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold", children: title }),
|
|
3667
|
-
isDirty && !readOnly && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3668
|
-
readOnly && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3591
|
+
isDirty && !readOnly && /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Badge, { variant: "destructive", className: "text-xs", children: "Unsaved changes" }),
|
|
3592
|
+
readOnly && /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Badge, { variant: "secondary", className: "text-xs", children: "Read-only" })
|
|
3669
3593
|
] }),
|
|
3670
|
-
!readOnly && !hideSave && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3594
|
+
!readOnly && !hideSave && /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { onClick: handleSave, disabled: saving || !isDirty, size: "sm", children: saving ? "Saving..." : saveLabel })
|
|
3671
3595
|
] }),
|
|
3672
3596
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-4 min-h-[500px]", children: [
|
|
3673
3597
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-64 shrink-0 border border-border rounded-md overflow-hidden", children: [
|
|
@@ -3687,7 +3611,7 @@ function FileTreeEditor({
|
|
|
3687
3611
|
] }),
|
|
3688
3612
|
showAddFolder && !readOnly && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-2 border-b border-border flex gap-1", children: [
|
|
3689
3613
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3690
|
-
|
|
3614
|
+
chunkVBGYWQUF_cjs.Input,
|
|
3691
3615
|
{
|
|
3692
3616
|
value: newFolderName,
|
|
3693
3617
|
onChange: (e) => setNewFolderName(e.target.value),
|
|
@@ -3697,7 +3621,7 @@ function FileTreeEditor({
|
|
|
3697
3621
|
autoFocus: true
|
|
3698
3622
|
}
|
|
3699
3623
|
),
|
|
3700
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3624
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { onClick: addFolder, size: "sm", className: "h-7 text-xs px-2", children: "Add" })
|
|
3701
3625
|
] }),
|
|
3702
3626
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-sm overflow-y-auto", children: [
|
|
3703
3627
|
tree.rootFiles.map((file) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -3729,7 +3653,7 @@ function FileTreeEditor({
|
|
|
3729
3653
|
] }),
|
|
3730
3654
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 border border-border rounded-md overflow-hidden", children: activeFile ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "h-full flex flex-col", children: [
|
|
3731
3655
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-1.5 bg-muted/50 border-b border-border text-xs text-muted-foreground", children: activeFile.path }),
|
|
3732
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3656
|
+
/* @__PURE__ */ jsxRuntime.jsx(React.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 animate-pulse bg-muted/50" }), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3733
3657
|
CodeEditor,
|
|
3734
3658
|
{
|
|
3735
3659
|
value: activeFile.content,
|
|
@@ -3745,8 +3669,8 @@ function FileTreeEditor({
|
|
|
3745
3669
|
] });
|
|
3746
3670
|
}
|
|
3747
3671
|
function AgentSkillManager({ agentId, initialSkills, onSaved }) {
|
|
3748
|
-
const client =
|
|
3749
|
-
const initialFiles =
|
|
3672
|
+
const client = chunkVBGYWQUF_cjs.useAgentPlaneClient();
|
|
3673
|
+
const initialFiles = React.useMemo(
|
|
3750
3674
|
() => initialSkills.flatMap(
|
|
3751
3675
|
(s) => s.files.map((f) => ({
|
|
3752
3676
|
path: s.folder === "(root)" ? f.path : `${s.folder}/${f.path}`,
|
|
@@ -3755,7 +3679,7 @@ function AgentSkillManager({ agentId, initialSkills, onSaved }) {
|
|
|
3755
3679
|
),
|
|
3756
3680
|
[initialSkills]
|
|
3757
3681
|
);
|
|
3758
|
-
const handleSave =
|
|
3682
|
+
const handleSave = React.useCallback(async (files) => {
|
|
3759
3683
|
const folderMap = /* @__PURE__ */ new Map();
|
|
3760
3684
|
for (const file of files) {
|
|
3761
3685
|
const slashIdx = file.path.lastIndexOf("/");
|
|
@@ -3791,25 +3715,25 @@ function AgentSkillManager({ agentId, initialSkills, onSaved }) {
|
|
|
3791
3715
|
);
|
|
3792
3716
|
}
|
|
3793
3717
|
function AgentPluginManager({ agentId, initialPlugins, onSaved }) {
|
|
3794
|
-
const client =
|
|
3795
|
-
const [plugins, setPlugins] =
|
|
3796
|
-
const [saving, setSaving] =
|
|
3797
|
-
const [dialogOpen, setDialogOpen] =
|
|
3798
|
-
const [marketplaces, setMarketplaces] =
|
|
3799
|
-
const [selectedMarketplace, setSelectedMarketplace] =
|
|
3800
|
-
const [availablePlugins, setAvailablePlugins] =
|
|
3801
|
-
const [loadingPlugins, setLoadingPlugins] =
|
|
3802
|
-
const [marketplaceNames, setMarketplaceNames] =
|
|
3803
|
-
const savedSnapshot =
|
|
3804
|
-
|
|
3718
|
+
const client = chunkVBGYWQUF_cjs.useAgentPlaneClient();
|
|
3719
|
+
const [plugins, setPlugins] = React.useState(initialPlugins);
|
|
3720
|
+
const [saving, setSaving] = React.useState(false);
|
|
3721
|
+
const [dialogOpen, setDialogOpen] = React.useState(false);
|
|
3722
|
+
const [marketplaces, setMarketplaces] = React.useState([]);
|
|
3723
|
+
const [selectedMarketplace, setSelectedMarketplace] = React.useState(null);
|
|
3724
|
+
const [availablePlugins, setAvailablePlugins] = React.useState([]);
|
|
3725
|
+
const [loadingPlugins, setLoadingPlugins] = React.useState(false);
|
|
3726
|
+
const [marketplaceNames, setMarketplaceNames] = React.useState({});
|
|
3727
|
+
const savedSnapshot = React.useRef(JSON.stringify(initialPlugins));
|
|
3728
|
+
React.useEffect(() => {
|
|
3805
3729
|
savedSnapshot.current = JSON.stringify(initialPlugins);
|
|
3806
3730
|
setPlugins(initialPlugins);
|
|
3807
3731
|
}, [initialPlugins]);
|
|
3808
|
-
const isDirty =
|
|
3732
|
+
const isDirty = React.useMemo(
|
|
3809
3733
|
() => JSON.stringify(plugins) !== savedSnapshot.current,
|
|
3810
3734
|
[plugins]
|
|
3811
3735
|
);
|
|
3812
|
-
|
|
3736
|
+
React.useEffect(() => {
|
|
3813
3737
|
client.pluginMarketplaces.list().then((data) => {
|
|
3814
3738
|
setMarketplaces(data);
|
|
3815
3739
|
const names = {};
|
|
@@ -3818,7 +3742,7 @@ function AgentPluginManager({ agentId, initialPlugins, onSaved }) {
|
|
|
3818
3742
|
}).catch(() => {
|
|
3819
3743
|
});
|
|
3820
3744
|
}, [client]);
|
|
3821
|
-
const loadPluginsForMarketplace =
|
|
3745
|
+
const loadPluginsForMarketplace = React.useCallback(async (marketplaceId) => {
|
|
3822
3746
|
setSelectedMarketplace(marketplaceId);
|
|
3823
3747
|
setLoadingPlugins(true);
|
|
3824
3748
|
setAvailablePlugins([]);
|
|
@@ -3864,10 +3788,10 @@ function AgentPluginManager({ agentId, initialPlugins, onSaved }) {
|
|
|
3864
3788
|
}
|
|
3865
3789
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg border border-muted-foreground/25 p-5", children: [
|
|
3866
3790
|
/* @__PURE__ */ jsxRuntime.jsx(SectionHeader, { title: "Plugins", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
3867
|
-
isDirty && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3791
|
+
isDirty && /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Badge, { variant: "destructive", className: "text-xs", children: "Unsaved changes" }),
|
|
3868
3792
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2", children: [
|
|
3869
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3870
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3793
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { variant: "outline", size: "sm", onClick: () => setDialogOpen(true), children: "Add Plugins" }),
|
|
3794
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { onClick: handleSave, disabled: saving || !isDirty, size: "sm", children: saving ? "Saving..." : "Save Plugins" })
|
|
3871
3795
|
] })
|
|
3872
3796
|
] }) }),
|
|
3873
3797
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
@@ -3884,7 +3808,7 @@ function AgentPluginManager({ agentId, initialPlugins, onSaved }) {
|
|
|
3884
3808
|
] })
|
|
3885
3809
|
] }),
|
|
3886
3810
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3887
|
-
|
|
3811
|
+
chunkVBGYWQUF_cjs.Button,
|
|
3888
3812
|
{
|
|
3889
3813
|
variant: "ghost",
|
|
3890
3814
|
size: "sm",
|
|
@@ -3897,11 +3821,11 @@ function AgentPluginManager({ agentId, initialPlugins, onSaved }) {
|
|
|
3897
3821
|
},
|
|
3898
3822
|
`${p.marketplace_id}:${p.plugin_name}`
|
|
3899
3823
|
)) }),
|
|
3900
|
-
/* @__PURE__ */ jsxRuntime.jsx(Dialog, { open: dialogOpen, onOpenChange: setDialogOpen, children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContent, { className: "max-w-lg max-h-[80vh] flex flex-col", children: [
|
|
3901
|
-
/* @__PURE__ */ jsxRuntime.jsx(DialogHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { children: "Add Plugins" }) }),
|
|
3902
|
-
/* @__PURE__ */ jsxRuntime.jsx(DialogBody, { className: "flex-1 overflow-hidden flex flex-col gap-3", children: marketplaces.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: "No plugin marketplaces registered. Add one from the Plugin Marketplaces page first." }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3824
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Dialog, { open: dialogOpen, onOpenChange: setDialogOpen, children: /* @__PURE__ */ jsxRuntime.jsxs(chunkVBGYWQUF_cjs.DialogContent, { className: "max-w-lg max-h-[80vh] flex flex-col", children: [
|
|
3825
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.DialogHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.DialogTitle, { children: "Add Plugins" }) }),
|
|
3826
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.DialogBody, { className: "flex-1 overflow-hidden flex flex-col gap-3", children: marketplaces.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: "No plugin marketplaces registered. Add one from the Plugin Marketplaces page first." }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3903
3827
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-2 flex-wrap", children: marketplaces.map((m) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3904
|
-
|
|
3828
|
+
chunkVBGYWQUF_cjs.Button,
|
|
3905
3829
|
{
|
|
3906
3830
|
size: "sm",
|
|
3907
3831
|
variant: selectedMarketplace === m.id ? "default" : "outline",
|
|
@@ -3928,9 +3852,9 @@ function AgentPluginManager({ agentId, initialPlugins, onSaved }) {
|
|
|
3928
3852
|
] }),
|
|
3929
3853
|
ap.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground truncate", children: ap.description }),
|
|
3930
3854
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-1 mt-1", children: [
|
|
3931
|
-
ap.hasAgents && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3932
|
-
ap.hasSkills && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3933
|
-
ap.hasMcpJson && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3855
|
+
ap.hasAgents && /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Badge, { variant: "secondary", className: "text-[10px] px-1 py-0", children: "Agents" }),
|
|
3856
|
+
ap.hasSkills && /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Badge, { variant: "secondary", className: "text-[10px] px-1 py-0", children: "Skills" }),
|
|
3857
|
+
ap.hasMcpJson && /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Badge, { variant: "secondary", className: "text-[10px] px-1 py-0", children: "MCP" })
|
|
3934
3858
|
] })
|
|
3935
3859
|
] }),
|
|
3936
3860
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: `w-4 h-4 rounded border flex items-center justify-center shrink-0 ${enabled ? "bg-primary border-primary text-primary-foreground" : "border-muted-foreground"}`, children: enabled && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs", children: "\u2713" }) })
|
|
@@ -3940,20 +3864,20 @@ function AgentPluginManager({ agentId, initialPlugins, onSaved }) {
|
|
|
3940
3864
|
);
|
|
3941
3865
|
}) })
|
|
3942
3866
|
] }) }),
|
|
3943
|
-
/* @__PURE__ */ jsxRuntime.jsx(DialogFooter, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3867
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.DialogFooter, { children: /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { size: "sm", onClick: () => setDialogOpen(false), children: "Done" }) })
|
|
3944
3868
|
] }) })
|
|
3945
3869
|
] })
|
|
3946
3870
|
] });
|
|
3947
3871
|
}
|
|
3948
3872
|
function AgentRuns({ agentId }) {
|
|
3949
|
-
const { LinkComponent, basePath } =
|
|
3950
|
-
const { data, error, isLoading } =
|
|
3873
|
+
const { LinkComponent, basePath } = chunkVBGYWQUF_cjs.useNavigation();
|
|
3874
|
+
const { data, error, isLoading } = chunkVBGYWQUF_cjs.useApi(
|
|
3951
3875
|
`agent-runs-${agentId}`,
|
|
3952
3876
|
(client) => client.runs.list({ agent_id: agentId, limit: 50 })
|
|
3953
3877
|
);
|
|
3954
3878
|
const runs = data?.data ?? [];
|
|
3955
3879
|
if (isLoading) {
|
|
3956
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2", children: [1, 2, 3].map((i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3880
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2", children: [1, 2, 3].map((i) => /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Skeleton, { className: "h-10 w-full" }, i)) });
|
|
3957
3881
|
}
|
|
3958
3882
|
if (error) {
|
|
3959
3883
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-destructive text-sm py-4 text-center", children: [
|
|
@@ -4005,16 +3929,16 @@ function AgentA2aInfo({
|
|
|
4005
3929
|
initialTags,
|
|
4006
3930
|
onChanged
|
|
4007
3931
|
}) {
|
|
4008
|
-
const client =
|
|
4009
|
-
const [enabled, setEnabled] =
|
|
4010
|
-
const [toggling, setToggling] =
|
|
4011
|
-
const [detailsOpen, setDetailsOpen] =
|
|
4012
|
-
const [cardPreview, setCardPreview] =
|
|
4013
|
-
const [loading, setLoading] =
|
|
4014
|
-
const [tags, setTags] =
|
|
4015
|
-
const [tagInput, setTagInput] =
|
|
4016
|
-
const [savingTags, setSavingTags] =
|
|
4017
|
-
const inputRef =
|
|
3932
|
+
const client = chunkVBGYWQUF_cjs.useAgentPlaneClient();
|
|
3933
|
+
const [enabled, setEnabled] = React.useState(initialEnabled);
|
|
3934
|
+
const [toggling, setToggling] = React.useState(false);
|
|
3935
|
+
const [detailsOpen, setDetailsOpen] = React.useState(false);
|
|
3936
|
+
const [cardPreview, setCardPreview] = React.useState(null);
|
|
3937
|
+
const [loading, setLoading] = React.useState(false);
|
|
3938
|
+
const [tags, setTags] = React.useState(initialTags);
|
|
3939
|
+
const [tagInput, setTagInput] = React.useState("");
|
|
3940
|
+
const [savingTags, setSavingTags] = React.useState(false);
|
|
3941
|
+
const inputRef = React.useRef(null);
|
|
4018
3942
|
const endpointUrl = `${baseUrl}/api/a2a/${tenantSlug}/${agentSlug}`;
|
|
4019
3943
|
const jsonRpcUrl = `${baseUrl}/api/a2a/${tenantSlug}/${agentSlug}/jsonrpc`;
|
|
4020
3944
|
const agentCardUrl = `${baseUrl}/api/a2a/${tenantSlug}/${agentSlug}/.well-known/agent-card.json`;
|
|
@@ -4174,7 +4098,7 @@ function AgentA2aInfo({
|
|
|
4174
4098
|
] })
|
|
4175
4099
|
] }),
|
|
4176
4100
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
4177
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4101
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { variant: "outline", size: "sm", onClick: fetchAgentCard, disabled: loading, children: loading ? "Loading..." : cardPreview ? "Hide Agent Card" : "Agent Card" }),
|
|
4178
4102
|
cardPreview && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-3 relative", children: [
|
|
4179
4103
|
/* @__PURE__ */ jsxRuntime.jsx("pre", { className: "rounded bg-muted p-4 text-xs font-mono text-foreground overflow-x-auto max-h-96", children: cardPreview }),
|
|
4180
4104
|
/* @__PURE__ */ jsxRuntime.jsx(CopyButton, { text: cardPreview, className: "absolute top-2 right-2" })
|
|
@@ -4185,21 +4109,21 @@ function AgentA2aInfo({
|
|
|
4185
4109
|
] });
|
|
4186
4110
|
}
|
|
4187
4111
|
function AgentDetailPage({ agentId, a2aBaseUrl, tenantSlug }) {
|
|
4188
|
-
const { LinkComponent, basePath } =
|
|
4112
|
+
const { LinkComponent, basePath } = chunkVBGYWQUF_cjs.useNavigation();
|
|
4189
4113
|
const { mutate } = swr.useSWRConfig();
|
|
4190
4114
|
const cacheKey = `agent-${agentId}`;
|
|
4191
|
-
const { data: agent, error, isLoading } =
|
|
4115
|
+
const { data: agent, error, isLoading } = chunkVBGYWQUF_cjs.useApi(
|
|
4192
4116
|
cacheKey,
|
|
4193
4117
|
(client) => client.agents.get(agentId)
|
|
4194
4118
|
);
|
|
4195
|
-
const invalidate =
|
|
4119
|
+
const invalidate = React.useCallback(() => {
|
|
4196
4120
|
mutate(cacheKey);
|
|
4197
4121
|
}, [mutate, cacheKey]);
|
|
4198
4122
|
if (isLoading) {
|
|
4199
4123
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
|
|
4200
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4201
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-6 gap-4", children: [1, 2, 3, 4, 5, 6].map((i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4202
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4124
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Skeleton, { className: "h-9 w-40" }),
|
|
4125
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-6 gap-4", children: [1, 2, 3, 4, 5, 6].map((i) => /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Skeleton, { className: "h-20" }, i)) }),
|
|
4126
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Skeleton, { className: "h-64 w-full" })
|
|
4203
4127
|
] });
|
|
4204
4128
|
}
|
|
4205
4129
|
if (error) {
|
|
@@ -4213,7 +4137,7 @@ function AgentDetailPage({ agentId, a2aBaseUrl, tenantSlug }) {
|
|
|
4213
4137
|
LinkComponent,
|
|
4214
4138
|
{
|
|
4215
4139
|
href: `${basePath}/agents/${agentId}/playground`,
|
|
4216
|
-
className:
|
|
4140
|
+
className: chunkVBGYWQUF_cjs.buttonVariants({ variant: "outline", size: "sm" }),
|
|
4217
4141
|
children: "Open Playground"
|
|
4218
4142
|
}
|
|
4219
4143
|
) }),
|
|
@@ -4336,19 +4260,19 @@ function ScheduleCard({
|
|
|
4336
4260
|
schedule,
|
|
4337
4261
|
timezone
|
|
4338
4262
|
}) {
|
|
4339
|
-
const [frequency, setFrequency] =
|
|
4340
|
-
const [time, setTime] =
|
|
4341
|
-
const [dayOfWeek, setDayOfWeek] =
|
|
4342
|
-
const [prompt, setPrompt] =
|
|
4343
|
-
const [enabled, setEnabled] =
|
|
4344
|
-
const [name, setName] =
|
|
4263
|
+
const [frequency, setFrequency] = React.useState(schedule.frequency);
|
|
4264
|
+
const [time, setTime] = React.useState(formatTimeForInput(schedule.time));
|
|
4265
|
+
const [dayOfWeek, setDayOfWeek] = React.useState(schedule.day_of_week ?? 1);
|
|
4266
|
+
const [prompt, setPrompt] = React.useState(schedule.prompt ?? "");
|
|
4267
|
+
const [enabled, setEnabled] = React.useState(schedule.enabled);
|
|
4268
|
+
const [name, setName] = React.useState(schedule.name ?? "");
|
|
4345
4269
|
const showTimePicker = ["daily", "weekdays", "weekly"].includes(frequency);
|
|
4346
4270
|
const showDayPicker = frequency === "weekly";
|
|
4347
4271
|
const canEnable = frequency !== "manual";
|
|
4348
4272
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded border border-muted-foreground/15 p-4 space-y-3", children: [
|
|
4349
4273
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-3", children: [
|
|
4350
4274
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4351
|
-
|
|
4275
|
+
chunkVBGYWQUF_cjs.Input,
|
|
4352
4276
|
{
|
|
4353
4277
|
value: name,
|
|
4354
4278
|
onChange: (e) => setName(e.target.value),
|
|
@@ -4377,7 +4301,7 @@ function ScheduleCard({
|
|
|
4377
4301
|
] }) })
|
|
4378
4302
|
] }),
|
|
4379
4303
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
4380
|
-
/* @__PURE__ */ jsxRuntime.jsx(FormField, { label: "Frequency", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4304
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.FormField, { label: "Frequency", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4381
4305
|
Select,
|
|
4382
4306
|
{
|
|
4383
4307
|
value: frequency,
|
|
@@ -4390,15 +4314,15 @@ function ScheduleCard({
|
|
|
4390
4314
|
children: FREQUENCIES.map((f) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: f.value, children: f.label }, f.value))
|
|
4391
4315
|
}
|
|
4392
4316
|
) }),
|
|
4393
|
-
showTimePicker && /* @__PURE__ */ jsxRuntime.jsx(FormField, { label: `Time (${timezone})`, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4394
|
-
|
|
4317
|
+
showTimePicker && /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.FormField, { label: `Time (${timezone})`, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4318
|
+
chunkVBGYWQUF_cjs.Input,
|
|
4395
4319
|
{
|
|
4396
4320
|
type: "time",
|
|
4397
4321
|
value: time,
|
|
4398
4322
|
onChange: (e) => setTime(e.target.value)
|
|
4399
4323
|
}
|
|
4400
4324
|
) }),
|
|
4401
|
-
showDayPicker && /* @__PURE__ */ jsxRuntime.jsx(FormField, { label: "Day of Week", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4325
|
+
showDayPicker && /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.FormField, { label: "Day of Week", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4402
4326
|
Select,
|
|
4403
4327
|
{
|
|
4404
4328
|
value: dayOfWeek.toString(),
|
|
@@ -4407,7 +4331,7 @@ function ScheduleCard({
|
|
|
4407
4331
|
}
|
|
4408
4332
|
) })
|
|
4409
4333
|
] }),
|
|
4410
|
-
frequency !== "manual" && /* @__PURE__ */ jsxRuntime.jsx(FormField, { label: "Prompt", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4334
|
+
frequency !== "manual" && /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.FormField, { label: "Prompt", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4411
4335
|
Textarea,
|
|
4412
4336
|
{
|
|
4413
4337
|
value: prompt,
|
|
@@ -4444,7 +4368,7 @@ function MarkdownContent({ children }) {
|
|
|
4444
4368
|
) });
|
|
4445
4369
|
}
|
|
4446
4370
|
function CollapsibleJson({ data, maxHeight = "12rem" }) {
|
|
4447
|
-
const [expanded, setExpanded] =
|
|
4371
|
+
const [expanded, setExpanded] = React.useState(false);
|
|
4448
4372
|
const json = typeof data === "string" ? data : JSON.stringify(data, null, 2);
|
|
4449
4373
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
4450
4374
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4592,36 +4516,36 @@ function renderEvent(event, idx) {
|
|
|
4592
4516
|
}
|
|
4593
4517
|
var TERMINAL_STATUSES = /* @__PURE__ */ new Set(["completed", "failed", "cancelled", "timed_out"]);
|
|
4594
4518
|
function PlaygroundPage({ agentId }) {
|
|
4595
|
-
const client =
|
|
4596
|
-
const { LinkComponent, basePath } =
|
|
4597
|
-
const { data: agent, error: agentError, isLoading } =
|
|
4519
|
+
const client = chunkVBGYWQUF_cjs.useAgentPlaneClient();
|
|
4520
|
+
const { LinkComponent, basePath } = chunkVBGYWQUF_cjs.useNavigation();
|
|
4521
|
+
const { data: agent, error: agentError, isLoading } = chunkVBGYWQUF_cjs.useApi(
|
|
4598
4522
|
`agent-${agentId}`,
|
|
4599
4523
|
(c) => c.agents.get(agentId)
|
|
4600
4524
|
);
|
|
4601
|
-
const [prompt, setPrompt] =
|
|
4602
|
-
const [events, setEvents] =
|
|
4603
|
-
const [streamingText, setStreamingText] =
|
|
4604
|
-
const [running, setRunning] =
|
|
4605
|
-
const [polling, setPolling] =
|
|
4606
|
-
const [error, setError] =
|
|
4607
|
-
const [sessionId, setSessionId] =
|
|
4608
|
-
const sessionIdRef =
|
|
4609
|
-
const abortRef =
|
|
4610
|
-
const runIdRef =
|
|
4611
|
-
const streamRef =
|
|
4612
|
-
const scrollRef =
|
|
4613
|
-
const textareaRef =
|
|
4614
|
-
|
|
4525
|
+
const [prompt, setPrompt] = React.useState("");
|
|
4526
|
+
const [events, setEvents] = React.useState([]);
|
|
4527
|
+
const [streamingText, setStreamingText] = React.useState("");
|
|
4528
|
+
const [running, setRunning] = React.useState(false);
|
|
4529
|
+
const [polling, setPolling] = React.useState(false);
|
|
4530
|
+
const [error, setError] = React.useState(null);
|
|
4531
|
+
const [sessionId, setSessionId] = React.useState(null);
|
|
4532
|
+
const sessionIdRef = React.useRef(null);
|
|
4533
|
+
const abortRef = React.useRef(null);
|
|
4534
|
+
const runIdRef = React.useRef(null);
|
|
4535
|
+
const streamRef = React.useRef(null);
|
|
4536
|
+
const scrollRef = React.useRef(null);
|
|
4537
|
+
const textareaRef = React.useRef(null);
|
|
4538
|
+
React.useEffect(() => {
|
|
4615
4539
|
const el = scrollRef.current;
|
|
4616
4540
|
if (el) el.scrollTop = el.scrollHeight;
|
|
4617
4541
|
}, [events, streamingText]);
|
|
4618
|
-
|
|
4542
|
+
React.useEffect(() => {
|
|
4619
4543
|
return () => {
|
|
4620
4544
|
abortRef.current?.abort();
|
|
4621
4545
|
streamRef.current?.abort();
|
|
4622
4546
|
};
|
|
4623
4547
|
}, []);
|
|
4624
|
-
const pollForFinalResult =
|
|
4548
|
+
const pollForFinalResult = React.useCallback(async (runId) => {
|
|
4625
4549
|
setPolling(true);
|
|
4626
4550
|
let delay = 3e3;
|
|
4627
4551
|
const maxDelay = 1e4;
|
|
@@ -4677,7 +4601,7 @@ function PlaygroundPage({ agentId }) {
|
|
|
4677
4601
|
streamRef.current = null;
|
|
4678
4602
|
}
|
|
4679
4603
|
}, [client]);
|
|
4680
|
-
const consumeStream =
|
|
4604
|
+
const consumeStream = React.useCallback(async (stream) => {
|
|
4681
4605
|
streamRef.current = stream;
|
|
4682
4606
|
let handedOffToPoll = false;
|
|
4683
4607
|
try {
|
|
@@ -4715,7 +4639,7 @@ function PlaygroundPage({ agentId }) {
|
|
|
4715
4639
|
}
|
|
4716
4640
|
}
|
|
4717
4641
|
}, [pollForFinalResult]);
|
|
4718
|
-
const handleSend =
|
|
4642
|
+
const handleSend = React.useCallback(async () => {
|
|
4719
4643
|
if (!prompt.trim() || running) return;
|
|
4720
4644
|
const messageText = prompt.trim();
|
|
4721
4645
|
setPrompt("");
|
|
@@ -4786,13 +4710,13 @@ function PlaygroundPage({ agentId }) {
|
|
|
4786
4710
|
if (isLoading) {
|
|
4787
4711
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col h-[calc(100vh-6rem)]", children: [
|
|
4788
4712
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 mb-4", children: [
|
|
4789
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4790
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4713
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Skeleton, { className: "h-8 w-24" }),
|
|
4714
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Skeleton, { className: "h-4 w-40" })
|
|
4791
4715
|
] }),
|
|
4792
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4716
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Skeleton, { className: "flex-1 rounded-lg" }),
|
|
4793
4717
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-4 space-y-2", children: [
|
|
4794
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4795
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4718
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Skeleton, { className: "h-24 w-full rounded-lg" }),
|
|
4719
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Skeleton, { className: "h-8 w-20" })
|
|
4796
4720
|
] })
|
|
4797
4721
|
] });
|
|
4798
4722
|
}
|
|
@@ -4823,7 +4747,7 @@ function PlaygroundPage({ agentId }) {
|
|
|
4823
4747
|
]
|
|
4824
4748
|
}
|
|
4825
4749
|
),
|
|
4826
|
-
(sessionId || events.length > 0) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4750
|
+
(sessionId || events.length > 0) && /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { onClick: handleNewChat, variant: "outline", size: "sm", disabled: running, children: "New Chat" }),
|
|
4827
4751
|
sessionId && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs text-muted-foreground font-mono", children: [
|
|
4828
4752
|
"Session: ",
|
|
4829
4753
|
sessionId.slice(0, 12),
|
|
@@ -4861,8 +4785,8 @@ function PlaygroundPage({ agentId }) {
|
|
|
4861
4785
|
}
|
|
4862
4786
|
),
|
|
4863
4787
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
4864
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4865
|
-
running && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4788
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { onClick: handleSend, disabled: running || !prompt.trim(), size: "sm", children: running ? "Running\u2026" : sessionId ? "Send" : "Run" }),
|
|
4789
|
+
running && /* @__PURE__ */ jsxRuntime.jsx(chunkVBGYWQUF_cjs.Button, { onClick: handleStop, variant: "outline", size: "sm", children: "Stop" }),
|
|
4866
4790
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground ml-1", children: "\u2318+Enter to send" })
|
|
4867
4791
|
] })
|
|
4868
4792
|
] })
|
|
@@ -4871,71 +4795,103 @@ function PlaygroundPage({ agentId }) {
|
|
|
4871
4795
|
|
|
4872
4796
|
Object.defineProperty(exports, "AgentPlaneProvider", {
|
|
4873
4797
|
enumerable: true,
|
|
4874
|
-
get: function () { return
|
|
4798
|
+
get: function () { return chunkVBGYWQUF_cjs.AgentPlaneProvider; }
|
|
4875
4799
|
});
|
|
4876
4800
|
Object.defineProperty(exports, "Badge", {
|
|
4877
4801
|
enumerable: true,
|
|
4878
|
-
get: function () { return
|
|
4802
|
+
get: function () { return chunkVBGYWQUF_cjs.Badge; }
|
|
4879
4803
|
});
|
|
4880
4804
|
Object.defineProperty(exports, "Button", {
|
|
4881
4805
|
enumerable: true,
|
|
4882
|
-
get: function () { return
|
|
4806
|
+
get: function () { return chunkVBGYWQUF_cjs.Button; }
|
|
4883
4807
|
});
|
|
4884
4808
|
Object.defineProperty(exports, "Card", {
|
|
4885
4809
|
enumerable: true,
|
|
4886
|
-
get: function () { return
|
|
4810
|
+
get: function () { return chunkVBGYWQUF_cjs.Card; }
|
|
4887
4811
|
});
|
|
4888
4812
|
Object.defineProperty(exports, "CardContent", {
|
|
4889
4813
|
enumerable: true,
|
|
4890
|
-
get: function () { return
|
|
4814
|
+
get: function () { return chunkVBGYWQUF_cjs.CardContent; }
|
|
4891
4815
|
});
|
|
4892
4816
|
Object.defineProperty(exports, "CardDescription", {
|
|
4893
4817
|
enumerable: true,
|
|
4894
|
-
get: function () { return
|
|
4818
|
+
get: function () { return chunkVBGYWQUF_cjs.CardDescription; }
|
|
4895
4819
|
});
|
|
4896
4820
|
Object.defineProperty(exports, "CardHeader", {
|
|
4897
4821
|
enumerable: true,
|
|
4898
|
-
get: function () { return
|
|
4822
|
+
get: function () { return chunkVBGYWQUF_cjs.CardHeader; }
|
|
4899
4823
|
});
|
|
4900
4824
|
Object.defineProperty(exports, "CardTitle", {
|
|
4901
4825
|
enumerable: true,
|
|
4902
|
-
get: function () { return
|
|
4826
|
+
get: function () { return chunkVBGYWQUF_cjs.CardTitle; }
|
|
4827
|
+
});
|
|
4828
|
+
Object.defineProperty(exports, "Dialog", {
|
|
4829
|
+
enumerable: true,
|
|
4830
|
+
get: function () { return chunkVBGYWQUF_cjs.Dialog; }
|
|
4831
|
+
});
|
|
4832
|
+
Object.defineProperty(exports, "DialogBody", {
|
|
4833
|
+
enumerable: true,
|
|
4834
|
+
get: function () { return chunkVBGYWQUF_cjs.DialogBody; }
|
|
4835
|
+
});
|
|
4836
|
+
Object.defineProperty(exports, "DialogContent", {
|
|
4837
|
+
enumerable: true,
|
|
4838
|
+
get: function () { return chunkVBGYWQUF_cjs.DialogContent; }
|
|
4839
|
+
});
|
|
4840
|
+
Object.defineProperty(exports, "DialogDescription", {
|
|
4841
|
+
enumerable: true,
|
|
4842
|
+
get: function () { return chunkVBGYWQUF_cjs.DialogDescription; }
|
|
4843
|
+
});
|
|
4844
|
+
Object.defineProperty(exports, "DialogFooter", {
|
|
4845
|
+
enumerable: true,
|
|
4846
|
+
get: function () { return chunkVBGYWQUF_cjs.DialogFooter; }
|
|
4847
|
+
});
|
|
4848
|
+
Object.defineProperty(exports, "DialogHeader", {
|
|
4849
|
+
enumerable: true,
|
|
4850
|
+
get: function () { return chunkVBGYWQUF_cjs.DialogHeader; }
|
|
4851
|
+
});
|
|
4852
|
+
Object.defineProperty(exports, "DialogTitle", {
|
|
4853
|
+
enumerable: true,
|
|
4854
|
+
get: function () { return chunkVBGYWQUF_cjs.DialogTitle; }
|
|
4855
|
+
});
|
|
4856
|
+
Object.defineProperty(exports, "FormField", {
|
|
4857
|
+
enumerable: true,
|
|
4858
|
+
get: function () { return chunkVBGYWQUF_cjs.FormField; }
|
|
4903
4859
|
});
|
|
4904
4860
|
Object.defineProperty(exports, "Input", {
|
|
4905
4861
|
enumerable: true,
|
|
4906
|
-
get: function () { return
|
|
4862
|
+
get: function () { return chunkVBGYWQUF_cjs.Input; }
|
|
4907
4863
|
});
|
|
4908
4864
|
Object.defineProperty(exports, "Skeleton", {
|
|
4909
4865
|
enumerable: true,
|
|
4910
|
-
get: function () { return
|
|
4866
|
+
get: function () { return chunkVBGYWQUF_cjs.Skeleton; }
|
|
4911
4867
|
});
|
|
4912
4868
|
Object.defineProperty(exports, "badgeVariants", {
|
|
4913
4869
|
enumerable: true,
|
|
4914
|
-
get: function () { return
|
|
4870
|
+
get: function () { return chunkVBGYWQUF_cjs.badgeVariants; }
|
|
4915
4871
|
});
|
|
4916
4872
|
Object.defineProperty(exports, "buttonVariants", {
|
|
4917
4873
|
enumerable: true,
|
|
4918
|
-
get: function () { return
|
|
4874
|
+
get: function () { return chunkVBGYWQUF_cjs.buttonVariants; }
|
|
4919
4875
|
});
|
|
4920
4876
|
Object.defineProperty(exports, "cn", {
|
|
4921
4877
|
enumerable: true,
|
|
4922
|
-
get: function () { return
|
|
4878
|
+
get: function () { return chunkVBGYWQUF_cjs.cn; }
|
|
4923
4879
|
});
|
|
4924
4880
|
Object.defineProperty(exports, "useAgentPlaneClient", {
|
|
4925
4881
|
enumerable: true,
|
|
4926
|
-
get: function () { return
|
|
4882
|
+
get: function () { return chunkVBGYWQUF_cjs.useAgentPlaneClient; }
|
|
4927
4883
|
});
|
|
4928
4884
|
Object.defineProperty(exports, "useApi", {
|
|
4929
4885
|
enumerable: true,
|
|
4930
|
-
get: function () { return
|
|
4886
|
+
get: function () { return chunkVBGYWQUF_cjs.useApi; }
|
|
4931
4887
|
});
|
|
4932
4888
|
Object.defineProperty(exports, "useAuthError", {
|
|
4933
4889
|
enumerable: true,
|
|
4934
|
-
get: function () { return
|
|
4890
|
+
get: function () { return chunkVBGYWQUF_cjs.useAuthError; }
|
|
4935
4891
|
});
|
|
4936
4892
|
Object.defineProperty(exports, "useNavigation", {
|
|
4937
4893
|
enumerable: true,
|
|
4938
|
-
get: function () { return
|
|
4894
|
+
get: function () { return chunkVBGYWQUF_cjs.useNavigation; }
|
|
4939
4895
|
});
|
|
4940
4896
|
exports.AdminTable = AdminTable;
|
|
4941
4897
|
exports.AdminTableHead = AdminTableHead;
|
|
@@ -4953,16 +4909,8 @@ exports.ConfirmDialog = ConfirmDialog;
|
|
|
4953
4909
|
exports.CopyButton = CopyButton;
|
|
4954
4910
|
exports.DashboardPage = DashboardPage;
|
|
4955
4911
|
exports.DetailPageHeader = DetailPageHeader;
|
|
4956
|
-
exports.Dialog = Dialog;
|
|
4957
|
-
exports.DialogBody = DialogBody;
|
|
4958
|
-
exports.DialogContent = DialogContent;
|
|
4959
|
-
exports.DialogDescription = DialogDescription;
|
|
4960
|
-
exports.DialogFooter = DialogFooter;
|
|
4961
|
-
exports.DialogHeader = DialogHeader;
|
|
4962
|
-
exports.DialogTitle = DialogTitle;
|
|
4963
4912
|
exports.EmptyRow = EmptyRow;
|
|
4964
4913
|
exports.FormError = FormError;
|
|
4965
|
-
exports.FormField = FormField;
|
|
4966
4914
|
exports.LocalDate = LocalDate;
|
|
4967
4915
|
exports.McpServerListPage = McpServerListPage;
|
|
4968
4916
|
exports.MetricCard = MetricCard;
|