bazilion 0.52.0 → 0.53.0
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/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/web/client/assets/AddProviderDialog-CO_uijWF.js +1 -0
- package/dist/web/client/assets/AgentTemplateParts-Dl35c-Ux.js +1 -0
- package/dist/web/client/assets/ConfigPage-DiQiJXP6.js +1 -0
- package/dist/web/client/assets/ConfirmDialog-BVytx3kN.js +1 -0
- package/dist/web/client/assets/ConnectionsView-DDrBaiLg.js +1 -0
- package/dist/web/client/assets/Dialog-BTDzv3J5.js +1 -0
- package/dist/web/client/assets/ManagePage-xlePXXx5.js +1 -0
- package/dist/web/client/assets/SectionTabs-BMiRKFfb.js +1 -0
- package/dist/web/client/assets/Segmented-Co4n2C5X.js +1 -0
- package/dist/web/client/assets/SpawnDialog-ejwXnyxy.js +1 -0
- package/dist/web/client/assets/SpawnTeamModal-Cp-nAvIC.js +1 -0
- package/dist/web/client/assets/TeamForm-Cz9uDVvb.js +1 -0
- package/dist/web/client/assets/TeamThread-D8xqE_gb.js +1 -0
- package/dist/web/client/assets/UnsavedChangesGuard-DmT4nBQU.js +1 -0
- package/dist/web/client/assets/_id-DEQxwq2v.js +1 -0
- package/dist/web/client/assets/_id-DSRgpxEc.js +1 -0
- package/dist/web/client/assets/access-34_ShgHU.js +1 -0
- package/dist/web/client/assets/agent-actions--EO4yJ4Q.js +1 -0
- package/dist/web/client/assets/agents-C87yBHaR.js +1 -0
- package/dist/web/client/assets/agents-DvCSl1Ro.js +1 -0
- package/dist/web/client/assets/api-CoLs57oO.js +1 -0
- package/dist/web/client/assets/arrow-right-BhTWtC9z.js +1 -0
- package/dist/web/client/assets/attention-CteEeRvX.js +1 -0
- package/dist/web/client/assets/chevron-right-BqOIX9UM.js +1 -0
- package/dist/web/client/assets/config-XJuQeEP4.js +1 -0
- package/dist/web/client/assets/createLucideIcon-dN8ooBD1.js +1 -0
- package/dist/web/client/assets/download-Dj-1ltZb.js +1 -0
- package/dist/web/client/assets/file-text-DiP-LaEg.js +1 -0
- package/dist/web/client/assets/form-Bvr_f9lR.js +1 -0
- package/dist/web/client/assets/images-BKjyhYUc.js +1 -0
- package/dist/web/client/assets/index-J_Uqj4md.js +54 -0
- package/dist/web/client/assets/key-round-QpqZklz6.js +1 -0
- package/dist/web/client/assets/list-checks-BeyG5SVQ.js +1 -0
- package/dist/web/client/assets/login-076Bc601.js +1 -0
- package/dist/web/client/assets/manage-CsrV2hhK.js +1 -0
- package/dist/web/client/assets/mcp-8N0BqZ0G.js +1 -0
- package/dist/web/client/assets/message-square-DnpSOYv4.js +1 -0
- package/dist/web/client/assets/network-BC7rNaOC.js +1 -0
- package/dist/web/client/assets/parts-B0JBolvG.js +1 -0
- package/dist/web/client/assets/plus-DZ3KVo7E.js +1 -0
- package/dist/web/client/assets/routes-3HkZZOOe.js +76 -0
- package/dist/web/client/assets/skills-DiaqZRXT.js +1 -0
- package/dist/web/client/assets/square-terminal-hQZ6pexU.js +1 -0
- package/dist/web/client/assets/style-BtcFIkOS.js +7 -0
- package/dist/web/client/assets/styles-C7Ztw15K.css +2 -0
- package/dist/web/client/assets/system-YWlJ8ogO.js +1 -0
- package/dist/web/client/assets/teams-DQwceMvk.js +1 -0
- package/dist/web/client/assets/teams-DTC3plIH.js +1 -0
- package/dist/web/client/assets/telegram-D4wINntt.js +1 -0
- package/dist/web/client/assets/tools-CZeQ9pDx.js +1 -0
- package/dist/web/client/assets/use-resource-BaTkTGvG.js +1 -0
- package/dist/web/client/assets/welcome-CnxP_RCk.js +1 -0
- package/dist/web/client/assets/wrench-BrwBswfo.js +1 -0
- package/dist/web/server/assets/{AddProviderDialog-Tn4AskPm.js → AddProviderDialog-Di5crZUB.js} +105 -4
- package/dist/web/server/assets/AgentTemplateParts-Cqy7kSzx.js +269 -0
- package/dist/web/server/assets/{ConfigPage-DqDUujmt.js → ConfigPage-oXM3wyOU.js} +2 -2
- package/dist/web/server/assets/{ConnectionsView-DAG-zNBz.js → ConnectionsView-DZrLoNoW.js} +3 -3
- package/dist/web/server/assets/ManagePage-0LKHEcT_.js +29 -0
- package/dist/web/server/assets/{ModelMenu-DUY9aHkE.js → ModelMenu-BAZeARx6.js} +3 -3
- package/dist/web/server/assets/{Rail-BIC_4ptO.js → Rail-7JU6ly2O.js} +14 -104
- package/dist/web/server/assets/{SectionTabs-BGsrf-UQ.js → SectionTabs-CWQ5orUW.js} +9 -2
- package/dist/web/server/assets/{SpawnDialog-D_SMPCG_.js → SpawnDialog-CYkwzETs.js} +49 -57
- package/dist/web/server/assets/SpawnTeamModal-CCe6P82H.js +127 -0
- package/dist/web/server/assets/TeamForm-BzQmdhVi.js +141 -0
- package/dist/web/server/assets/{TeamThread-DuLlGDcw.js → TeamThread-SyQpUvz5.js} +1 -1
- package/dist/web/server/assets/_id-AcyGvFrE.js +400 -0
- package/dist/web/server/assets/{_id-DJnYgisy.js → _id-BGTgqsWm.js} +8 -4
- package/dist/web/server/assets/{_id-TVruGcOd.js → _id-BKzOw78O.js} +11 -3
- package/dist/web/server/assets/{_id-yN0z7VqE.js → _id-DPGzfmjG.js} +255 -203
- package/dist/web/server/assets/_id-DXm9W55C.js +16 -0
- package/dist/web/server/assets/_id-DojvxRZn.js +39 -0
- package/dist/web/server/assets/_tanstack-start-manifest_v-D7RvKGRH.js +285 -0
- package/dist/web/server/assets/{access-GMGed5O8.js → access-BJe-NduL.js} +2 -2
- package/dist/web/server/assets/access-CKSW7MFH.js +297 -0
- package/dist/web/server/assets/{access-C_pupPks.js → access-WWspT0v4.js} +2 -1
- package/dist/web/server/assets/agent-actions-CUDMCG0F.js +20 -0
- package/dist/web/server/assets/agents-1sjSvp5p.js +12 -0
- package/dist/web/server/assets/{agents-BnWgFo6o.js → agents-6d9WxbYF.js} +9 -6
- package/dist/web/server/assets/agents-DKVGUwD1.js +31 -0
- package/dist/web/server/assets/agents-DUI4Yjtg.js +13 -0
- package/dist/web/server/assets/agents-DsHeRaLq.js +327 -0
- package/dist/web/server/assets/agents-DtLDoZ_u.js +136 -0
- package/dist/web/server/assets/{attention-Cr7puThv.js → attention-B6sSDR_4.js} +2 -1
- package/dist/web/server/assets/{attention-DS3O9UmJ.js → attention-DefKwvgm.js} +2 -2
- package/dist/web/server/assets/attention-johfkM0_.js +203 -0
- package/dist/web/server/assets/{config-Q7livfa3.js → config-Clz57LuN.js} +33 -82
- package/dist/web/server/assets/{config-DjTGA4iZ.js → config-DYAaaE9Z.js} +2 -2
- package/dist/web/server/assets/{createSsrRpc-GCCF14VW.js → createSsrRpc-BijMHgqE.js} +1 -45
- package/dist/web/server/assets/form-BRQAsKKq.js +319 -0
- package/dist/web/server/assets/manage-Ppyi3Y5y.js +230 -0
- package/dist/web/server/assets/mcp-Ce6O8Qs2.js +378 -0
- package/dist/web/server/assets/{mcp-ZARSOxZW.js → mcp-DB38leWS.js} +2 -2
- package/dist/web/server/assets/parts-mabERIJZ.js +380 -0
- package/dist/web/server/assets/{router-Dh2-IvLL.js → router-C97bwlXi.js} +35 -30
- package/dist/web/server/assets/{routes-C9NawqcV.js → routes-C4aGqXfr.js} +52 -8
- package/dist/web/server/assets/{routes-CDskMy5C.js → routes-DuOShl4q.js} +1 -1
- package/dist/web/server/assets/{routes-BJIJWCIE.js → routes-IHMVKpDK.js} +2 -2
- package/dist/web/server/assets/{skills-StN15QhC.js → skills-B7sg0QKS.js} +2 -2
- package/dist/web/server/assets/{skills-h5aHa7Q8.js → skills-DWzlT_hC.js} +9 -1
- package/dist/web/server/assets/skills-hfTSwqsG.js +353 -0
- package/dist/web/server/assets/{style-GYDODk2F.js → style-BR7ufS6Z.js} +1 -1
- package/dist/web/server/assets/system-CNQpt3JB.js +145 -0
- package/dist/web/server/assets/{system-DtswhLW6.js → system-D3th6n2E.js} +4 -2
- package/dist/web/server/assets/{system-Dl-1RhoP.js → system-DaP0ol67.js} +2 -2
- package/dist/web/server/assets/{teams-CbIPKf99.js → teams-4cEZ4_rw.js} +4 -2
- package/dist/web/server/assets/{teams-BxnvFTyn.js → teams-70u1XQTr.js} +1 -3
- package/dist/web/server/assets/teams-BKHe67f3.js +176 -0
- package/dist/web/server/assets/{teams-YrmyutM4.js → teams-BopOP4x7.js} +8 -1
- package/dist/web/server/assets/teams-C3xwTz8-.js +219 -0
- package/dist/web/server/assets/{teams-5PMGvHuM.js → teams-CuKE5iAK.js} +2 -2
- package/dist/web/server/assets/{telegram-Cv0D4gyz.js → telegram-BnQADwnj.js} +2 -2
- package/dist/web/server/assets/telegram-BpmK-HHV.js +1059 -0
- package/dist/web/server/assets/{tools-ioJcPzMW.js → tools-BQeWn7Tj.js} +2 -2
- package/dist/web/server/assets/{tools-OfD22R-C.js → tools-CURTfG2q.js} +56 -217
- package/dist/web/server/assets/{welcome-FFEbrNT1.js → welcome-OiZCAIHZ.js} +3 -4
- package/dist/web/server/assets/{welcome-jxmpE_Jb.js → welcome-SNsE49JO.js} +2 -2
- package/dist/web/server/server.js +20 -20
- package/package.json +1 -1
- package/dist/web/client/assets/AddProviderDialog-BiGLKnu2.js +0 -1
- package/dist/web/client/assets/ConfigPage-DvBzy2MN.js +0 -1
- package/dist/web/client/assets/ConfirmDialog-CiZ5tk9R.js +0 -1
- package/dist/web/client/assets/ConnectionsView-Czkpm2JY.js +0 -1
- package/dist/web/client/assets/Dialog-s_kPtI-W.js +0 -1
- package/dist/web/client/assets/ModelMenu-BfUPoRjV.js +0 -1
- package/dist/web/client/assets/SectionTabs-DENNb6Nw.js +0 -1
- package/dist/web/client/assets/Segmented-Dh77vmpp.js +0 -1
- package/dist/web/client/assets/SkillFindings-Xng11qqx.js +0 -1
- package/dist/web/client/assets/SkillsPicker-hI3YXvib.js +0 -1
- package/dist/web/client/assets/SpawnDialog-CKWFQ6jk.js +0 -1
- package/dist/web/client/assets/Tabs-f6bHvCGn.js +0 -1
- package/dist/web/client/assets/TeamForm-kda1HYZG.js +0 -1
- package/dist/web/client/assets/TeamThread-2rm1JGSk.js +0 -1
- package/dist/web/client/assets/UnsavedChangesGuard-nx6dv2Yw.js +0 -1
- package/dist/web/client/assets/_id-B72mIpcE.js +0 -1
- package/dist/web/client/assets/_id-Bzavnza1.js +0 -1
- package/dist/web/client/assets/access-Yw9jODuk.js +0 -1
- package/dist/web/client/assets/agents-C9xoyL7o.js +0 -1
- package/dist/web/client/assets/agents-TviG16wx.js +0 -1
- package/dist/web/client/assets/api-HC_YzjBy.js +0 -1
- package/dist/web/client/assets/arrow-right-Gm_FDWJ_.js +0 -1
- package/dist/web/client/assets/attention-DmURtlJm.js +0 -1
- package/dist/web/client/assets/check-BjgKoGvU.js +0 -1
- package/dist/web/client/assets/chevron-right-CUZiA2aG.js +0 -1
- package/dist/web/client/assets/config-UZz_mjO5.js +0 -1
- package/dist/web/client/assets/createLucideIcon-C6gOo8sD.js +0 -1
- package/dist/web/client/assets/dist-BWppw70N.js +0 -41
- package/dist/web/client/assets/dist-D2dwY7MR.js +0 -1
- package/dist/web/client/assets/index-Df1oUtAP.js +0 -14
- package/dist/web/client/assets/link-Cbztlp_R.js +0 -1
- package/dist/web/client/assets/login-CPfdaqsV.js +0 -1
- package/dist/web/client/assets/mcp-FlYnNon0.js +0 -1
- package/dist/web/client/assets/parts-tIDBNsYA.js +0 -1
- package/dist/web/client/assets/plus-CWrKMtvA.js +0 -1
- package/dist/web/client/assets/routes-BZaWCoQj.js +0 -76
- package/dist/web/client/assets/save-f9O-CQia.js +0 -1
- package/dist/web/client/assets/skills-C7yDPC8s.js +0 -1
- package/dist/web/client/assets/style-DDuTFJUu.js +0 -7
- package/dist/web/client/assets/styles-BviXU81u.css +0 -2
- package/dist/web/client/assets/system-CL3Kz36L.js +0 -1
- package/dist/web/client/assets/teams-CQTEF5gV.js +0 -1
- package/dist/web/client/assets/teams-DQ7SqVyF.js +0 -1
- package/dist/web/client/assets/telegram-BLgxtGhZ.js +0 -1
- package/dist/web/client/assets/tools-pOQyGVYo.js +0 -1
- package/dist/web/client/assets/use-resource-C3MBZJop.js +0 -1
- package/dist/web/client/assets/welcome-Hr6JpMef.js +0 -1
- package/dist/web/client/assets/wrench-6BEIqKDn.js +0 -1
- package/dist/web/server/assets/SkillFindings-BdATze1A.js +0 -46
- package/dist/web/server/assets/SkillsPicker-DlqEfRWh.js +0 -67
- package/dist/web/server/assets/Tabs-BhF41MfQ.js +0 -20
- package/dist/web/server/assets/TeamForm-ilBaeLI4.js +0 -96
- package/dist/web/server/assets/_id-BsZcsabI.js +0 -383
- package/dist/web/server/assets/_id-D8Kj0F30.js +0 -18
- package/dist/web/server/assets/_id-QYifTM9w.js +0 -28
- package/dist/web/server/assets/_tanstack-start-manifest_v-D6zrzUC7.js +0 -223
- package/dist/web/server/assets/access-DKOpcHIJ.js +0 -232
- package/dist/web/server/assets/agents-B6OR3x99.js +0 -327
- package/dist/web/server/assets/agents-B7642eRO.js +0 -130
- package/dist/web/server/assets/agents-BJ-_oC2e.js +0 -14
- package/dist/web/server/assets/agents-CjV0w-Zy.js +0 -12
- package/dist/web/server/assets/agents-Dy_Q-9lG.js +0 -27
- package/dist/web/server/assets/attention-CLP4HYBz.js +0 -216
- package/dist/web/server/assets/mcp-BI-FD-JI.js +0 -250
- package/dist/web/server/assets/parts-B31PJkhi.js +0 -190
- package/dist/web/server/assets/skills-BqLq3ZXq.js +0 -275
- package/dist/web/server/assets/system-BtRA2HUs.js +0 -138
- package/dist/web/server/assets/teams-COaU0wN9.js +0 -108
- package/dist/web/server/assets/teams-Ca8W4mvl.js +0 -88
- package/dist/web/server/assets/telegram-Yx8nm6Ei.js +0 -984
- /package/dist/web/server/assets/{telegram-CGol0CKX2.js → telegram-CGol0CKX.js} +0 -0
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
import { C as api, T as errorMessage, u as Button } from "./workspace-DaitCM0t.js";
|
|
2
|
-
import { t as ConfirmDialog } from "./ConfirmDialog-DfaJ--A6.js";
|
|
3
|
-
import { i as ItemRow, l as StatusBadge, r as ItemList, s as SectionCard } from "./createSsrRpc-GCCF14VW.js";
|
|
4
|
-
import { t as Route } from "./access-GMGed5O8.js";
|
|
5
|
-
import { t as ConfigPage } from "./ConfigPage-DqDUujmt.js";
|
|
6
|
-
import { useState } from "react";
|
|
7
|
-
import { useRouter } from "@tanstack/react-router";
|
|
8
|
-
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
-
//#region src/routes/config/access.tsx?tsr-split=component
|
|
10
|
-
function when(timestamp) {
|
|
11
|
-
return new Date(timestamp).toISOString().slice(0, 16).replace("T", " ");
|
|
12
|
-
}
|
|
13
|
-
function AccessPage() {
|
|
14
|
-
const { tokens, sessions } = Route.useLoaderData();
|
|
15
|
-
const includeRevoked = Route.useSearch().all === 1;
|
|
16
|
-
const router = useRouter();
|
|
17
|
-
const [revokeToken, setRevokeToken] = useState(null);
|
|
18
|
-
const [revokeSession, setRevokeSession] = useState(null);
|
|
19
|
-
const usesToken = (token) => sessions.some((session) => session.current && session.tokenId === token?.id);
|
|
20
|
-
/** Revoking the session this browser uses signs it out. */
|
|
21
|
-
async function afterRevoke(signedOut) {
|
|
22
|
-
if (signedOut) window.location.assign("/login");
|
|
23
|
-
else await router.invalidate();
|
|
24
|
-
}
|
|
25
|
-
return /* @__PURE__ */ jsxs(ConfigPage, {
|
|
26
|
-
title: "Access",
|
|
27
|
-
description: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
28
|
-
"Every token has full access to the HTTP API, the CLI and browser login. The",
|
|
29
|
-
" ",
|
|
30
|
-
/* @__PURE__ */ jsx("code", {
|
|
31
|
-
className: "font-mono",
|
|
32
|
-
children: "bootstrap"
|
|
33
|
-
}),
|
|
34
|
-
" token from",
|
|
35
|
-
" ",
|
|
36
|
-
/* @__PURE__ */ jsx("code", {
|
|
37
|
-
className: "font-mono",
|
|
38
|
-
children: "~/.bazilion/auth.json"
|
|
39
|
-
}),
|
|
40
|
-
" cannot be revoked; mint a separate, revocable token for each other device."
|
|
41
|
-
] }),
|
|
42
|
-
children: [
|
|
43
|
-
/* @__PURE__ */ jsx(MintTokenForm, { onMinted: () => router.invalidate() }),
|
|
44
|
-
/* @__PURE__ */ jsx(SectionCard, {
|
|
45
|
-
title: "Tokens",
|
|
46
|
-
actions: /* @__PURE__ */ jsx("a", {
|
|
47
|
-
className: "ghost-btn",
|
|
48
|
-
href: includeRevoked ? "/config/access" : "/config/access?all=1",
|
|
49
|
-
children: includeRevoked ? "Hide revoked" : "Show revoked"
|
|
50
|
-
}),
|
|
51
|
-
children: tokens.length === 0 ? /* @__PURE__ */ jsx("p", {
|
|
52
|
-
className: "muted",
|
|
53
|
-
children: "No tokens yet; mint one above."
|
|
54
|
-
}) : /* @__PURE__ */ jsx(ItemList, { children: tokens.map((token) => {
|
|
55
|
-
const bootstrap = token.kind === "bootstrap";
|
|
56
|
-
const expired = token.expiresAt !== null && token.expiresAt <= Date.now();
|
|
57
|
-
return /* @__PURE__ */ jsx(ItemRow, {
|
|
58
|
-
title: token.label,
|
|
59
|
-
meta: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
60
|
-
/* @__PURE__ */ jsx(StatusBadge, {
|
|
61
|
-
variant: token.revokedAt || expired ? "neutral" : "success",
|
|
62
|
-
children: token.revokedAt ? "revoked" : expired ? "expired" : "active"
|
|
63
|
-
}),
|
|
64
|
-
/* @__PURE__ */ jsx("span", { children: bootstrap ? "bootstrap (auth.json)" : token.kind }),
|
|
65
|
-
/* @__PURE__ */ jsxs("span", { children: ["created ", when(token.createdAt)] }),
|
|
66
|
-
/* @__PURE__ */ jsxs("span", { children: ["last used ", token.lastUsedAt ? when(token.lastUsedAt) : "never"] }),
|
|
67
|
-
/* @__PURE__ */ jsxs("span", { children: ["expires ", token.expiresAt ? when(token.expiresAt) : "never"] }),
|
|
68
|
-
/* @__PURE__ */ jsx("code", { children: token.id })
|
|
69
|
-
] }),
|
|
70
|
-
actions: !token.revokedAt && !bootstrap && /* @__PURE__ */ jsx(Button, {
|
|
71
|
-
variant: "danger",
|
|
72
|
-
onClick: () => setRevokeToken(token),
|
|
73
|
-
children: "Revoke"
|
|
74
|
-
})
|
|
75
|
-
}, token.id);
|
|
76
|
-
}) })
|
|
77
|
-
}),
|
|
78
|
-
/* @__PURE__ */ jsx(SectionCard, {
|
|
79
|
-
title: "Browser sessions",
|
|
80
|
-
description: "A session ends after 30 days without use. Revoking a token also ends every session opened with it.",
|
|
81
|
-
children: sessions.length === 0 ? /* @__PURE__ */ jsx("p", {
|
|
82
|
-
className: "muted",
|
|
83
|
-
children: "No active browser sessions."
|
|
84
|
-
}) : /* @__PURE__ */ jsx(ItemList, { children: sessions.map((session) => /* @__PURE__ */ jsx(ItemRow, {
|
|
85
|
-
title: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
86
|
-
session.tokenLabel,
|
|
87
|
-
" ",
|
|
88
|
-
session.current && /* @__PURE__ */ jsx(StatusBadge, {
|
|
89
|
-
variant: "success",
|
|
90
|
-
children: "current"
|
|
91
|
-
})
|
|
92
|
-
] }),
|
|
93
|
-
meta: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
94
|
-
/* @__PURE__ */ jsxs("span", { children: ["last seen ", when(session.lastSeenAt)] }),
|
|
95
|
-
/* @__PURE__ */ jsxs("span", { children: ["expires ", when(session.expiresAt)] }),
|
|
96
|
-
/* @__PURE__ */ jsx("code", { children: session.id })
|
|
97
|
-
] }),
|
|
98
|
-
actions: /* @__PURE__ */ jsx(Button, {
|
|
99
|
-
variant: "danger",
|
|
100
|
-
onClick: () => setRevokeSession(session),
|
|
101
|
-
children: "Revoke"
|
|
102
|
-
})
|
|
103
|
-
}, session.id)) })
|
|
104
|
-
}),
|
|
105
|
-
/* @__PURE__ */ jsx(ConfirmDialog, {
|
|
106
|
-
open: revokeToken !== null,
|
|
107
|
-
title: `Revoke ${revokeToken?.label ?? ""}?`,
|
|
108
|
-
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
109
|
-
"This permanently revokes token ",
|
|
110
|
-
/* @__PURE__ */ jsx("code", {
|
|
111
|
-
className: "font-mono",
|
|
112
|
-
children: revokeToken?.id
|
|
113
|
-
}),
|
|
114
|
-
" and ends every browser session opened with it.",
|
|
115
|
-
usesToken(revokeToken) && " This includes the session you are using now."
|
|
116
|
-
] }),
|
|
117
|
-
confirmLabel: "Revoke token and sessions",
|
|
118
|
-
onConfirm: async () => {
|
|
119
|
-
if (!revokeToken) return;
|
|
120
|
-
await api(`/api/tokens/${encodeURIComponent(revokeToken.id)}`, { method: "DELETE" });
|
|
121
|
-
await afterRevoke(usesToken(revokeToken));
|
|
122
|
-
},
|
|
123
|
-
onOpenChange: (open) => {
|
|
124
|
-
if (!open) setRevokeToken(null);
|
|
125
|
-
}
|
|
126
|
-
}),
|
|
127
|
-
/* @__PURE__ */ jsx(ConfirmDialog, {
|
|
128
|
-
open: revokeSession !== null,
|
|
129
|
-
title: `Revoke the ${revokeSession?.tokenLabel ?? ""} browser session?`,
|
|
130
|
-
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
131
|
-
"This ends browser session ",
|
|
132
|
-
/* @__PURE__ */ jsx("code", {
|
|
133
|
-
className: "font-mono",
|
|
134
|
-
children: revokeSession?.id
|
|
135
|
-
}),
|
|
136
|
-
revokeSession?.current ? " and signs this browser out." : ". The token stays active for later logins."
|
|
137
|
-
] }),
|
|
138
|
-
confirmLabel: revokeSession?.current ? "Sign out this browser" : "Revoke session",
|
|
139
|
-
onConfirm: async () => {
|
|
140
|
-
if (!revokeSession) return;
|
|
141
|
-
await api(`/api/sessions/${encodeURIComponent(revokeSession.id)}`, { method: "DELETE" });
|
|
142
|
-
await afterRevoke(revokeSession.current);
|
|
143
|
-
},
|
|
144
|
-
onOpenChange: (open) => {
|
|
145
|
-
if (!open) setRevokeSession(null);
|
|
146
|
-
}
|
|
147
|
-
})
|
|
148
|
-
]
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
function MintTokenForm({ onMinted }) {
|
|
152
|
-
const [label, setLabel] = useState("");
|
|
153
|
-
const [expiresDays, setExpiresDays] = useState("");
|
|
154
|
-
const [created, setCreated] = useState(null);
|
|
155
|
-
const [error, setError] = useState(null);
|
|
156
|
-
const [busy, setBusy] = useState(false);
|
|
157
|
-
async function mint(event) {
|
|
158
|
-
event.preventDefault();
|
|
159
|
-
setError(null);
|
|
160
|
-
setBusy(true);
|
|
161
|
-
try {
|
|
162
|
-
const { token } = await api("/api/tokens", { body: {
|
|
163
|
-
label,
|
|
164
|
-
...expiresDays ? { expiresInDays: Number(expiresDays) } : {}
|
|
165
|
-
} });
|
|
166
|
-
setCreated(token);
|
|
167
|
-
setLabel("");
|
|
168
|
-
setExpiresDays("");
|
|
169
|
-
await onMinted();
|
|
170
|
-
} catch (cause) {
|
|
171
|
-
setError(errorMessage(cause));
|
|
172
|
-
} finally {
|
|
173
|
-
setBusy(false);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
return /* @__PURE__ */ jsxs(SectionCard, {
|
|
177
|
-
title: "Mint a new token",
|
|
178
|
-
children: [
|
|
179
|
-
/* @__PURE__ */ jsxs("form", {
|
|
180
|
-
onSubmit: (event) => void mint(event),
|
|
181
|
-
className: "flex flex-col items-stretch gap-x-3 sm:flex-row sm:items-end",
|
|
182
|
-
children: [
|
|
183
|
-
/* @__PURE__ */ jsxs("label", {
|
|
184
|
-
className: "sm:w-72",
|
|
185
|
-
children: ["Label", /* @__PURE__ */ jsx("input", {
|
|
186
|
-
type: "text",
|
|
187
|
-
value: label,
|
|
188
|
-
onChange: (event) => setLabel(event.target.value),
|
|
189
|
-
required: true,
|
|
190
|
-
placeholder: "e.g. laptop-tailscale",
|
|
191
|
-
autoComplete: "off"
|
|
192
|
-
})]
|
|
193
|
-
}),
|
|
194
|
-
/* @__PURE__ */ jsxs("label", {
|
|
195
|
-
className: "sm:w-40",
|
|
196
|
-
children: ["Expires in days", /* @__PURE__ */ jsx("input", {
|
|
197
|
-
type: "number",
|
|
198
|
-
min: 1,
|
|
199
|
-
value: expiresDays,
|
|
200
|
-
onChange: (event) => setExpiresDays(event.target.value),
|
|
201
|
-
placeholder: "never"
|
|
202
|
-
})]
|
|
203
|
-
}),
|
|
204
|
-
/* @__PURE__ */ jsx(Button, {
|
|
205
|
-
variant: "primary",
|
|
206
|
-
type: "submit",
|
|
207
|
-
disabled: busy,
|
|
208
|
-
className: "mb-[0.6rem]",
|
|
209
|
-
children: busy ? "Creating…" : "Create"
|
|
210
|
-
})
|
|
211
|
-
]
|
|
212
|
-
}),
|
|
213
|
-
created && /* @__PURE__ */ jsxs("div", {
|
|
214
|
-
className: "rounded-md border border-warning/25 bg-warning/10 p-3",
|
|
215
|
-
children: [/* @__PURE__ */ jsx("p", {
|
|
216
|
-
className: "mb-1 text-xs text-warning",
|
|
217
|
-
children: "Copy this token now; it cannot be shown again."
|
|
218
|
-
}), /* @__PURE__ */ jsx("pre", {
|
|
219
|
-
className: "whitespace-pre-wrap break-all font-mono text-xs",
|
|
220
|
-
children: created
|
|
221
|
-
})]
|
|
222
|
-
}),
|
|
223
|
-
error && /* @__PURE__ */ jsx("p", {
|
|
224
|
-
role: "alert",
|
|
225
|
-
className: "text-sm text-danger",
|
|
226
|
-
children: error
|
|
227
|
-
})
|
|
228
|
-
]
|
|
229
|
-
});
|
|
230
|
-
}
|
|
231
|
-
//#endregion
|
|
232
|
-
export { AccessPage as component };
|
|
@@ -1,327 +0,0 @@
|
|
|
1
|
-
import { C as api, T as errorMessage, u as Button } from "./workspace-DaitCM0t.js";
|
|
2
|
-
import { t as ConfirmDialog } from "./ConfirmDialog-DfaJ--A6.js";
|
|
3
|
-
import { t as UnsavedChangesGuard } from "./UnsavedChangesGuard-DrOvPV14.js";
|
|
4
|
-
import { n as ModelMenu } from "./ModelMenu-DUY9aHkE.js";
|
|
5
|
-
import { a as PageHeader, i as ItemRow, l as StatusBadge, o as PageShell, r as ItemList, s as SectionCard } from "./createSsrRpc-GCCF14VW.js";
|
|
6
|
-
import { t as Route } from "./agents-CjV0w-Zy.js";
|
|
7
|
-
import { n as SectionTabs, r as TEMPLATE_TABS } from "./SectionTabs-BGsrf-UQ.js";
|
|
8
|
-
import { t as Tabs } from "./Tabs-BhF41MfQ.js";
|
|
9
|
-
import { t as SkillsPicker } from "./SkillsPicker-DlqEfRWh.js";
|
|
10
|
-
import { useState } from "react";
|
|
11
|
-
import { useRouter } from "@tanstack/react-router";
|
|
12
|
-
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
-
//#region src/routes/templates/agents/index.tsx?tsr-split=component
|
|
14
|
-
function ProfilesPage() {
|
|
15
|
-
const { profiles, chatModels, skills, templates } = Route.useLoaderData();
|
|
16
|
-
const router = useRouter();
|
|
17
|
-
const [deleteTarget, setDeleteTarget] = useState(null);
|
|
18
|
-
return /* @__PURE__ */ jsxs(PageShell, {
|
|
19
|
-
size: "wide",
|
|
20
|
-
children: [
|
|
21
|
-
/* @__PURE__ */ jsx(PageHeader, {
|
|
22
|
-
eyebrow: "Templates",
|
|
23
|
-
title: "Agent templates",
|
|
24
|
-
description: "Reusable identity, model and skills for newly spawned agents."
|
|
25
|
-
}),
|
|
26
|
-
/* @__PURE__ */ jsx(SectionTabs, {
|
|
27
|
-
label: "Template kinds",
|
|
28
|
-
base: "/templates",
|
|
29
|
-
tabs: TEMPLATE_TABS
|
|
30
|
-
}),
|
|
31
|
-
/* @__PURE__ */ jsx(CreateProfileForm, {
|
|
32
|
-
chatModels,
|
|
33
|
-
skills,
|
|
34
|
-
templates,
|
|
35
|
-
onCreated: () => router.invalidate()
|
|
36
|
-
}),
|
|
37
|
-
/* @__PURE__ */ jsx(SectionCard, {
|
|
38
|
-
title: "Templates",
|
|
39
|
-
children: profiles.length === 0 ? /* @__PURE__ */ jsx("p", {
|
|
40
|
-
className: "muted",
|
|
41
|
-
children: "No Agent templates yet."
|
|
42
|
-
}) : /* @__PURE__ */ jsx(ItemList, { children: profiles.map((profile) => /* @__PURE__ */ jsx(ItemRow, {
|
|
43
|
-
title: /* @__PURE__ */ jsx("a", {
|
|
44
|
-
href: `/templates/agents/${encodeURIComponent(profile.id)}`,
|
|
45
|
-
children: profile.name
|
|
46
|
-
}),
|
|
47
|
-
meta: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
48
|
-
/* @__PURE__ */ jsx("code", { children: profile.id }),
|
|
49
|
-
/* @__PURE__ */ jsx("code", { children: profile.defaultModel }),
|
|
50
|
-
/* @__PURE__ */ jsxs("span", { children: [
|
|
51
|
-
profile.agentCount,
|
|
52
|
-
" agent",
|
|
53
|
-
profile.agentCount === 1 ? "" : "s"
|
|
54
|
-
] }),
|
|
55
|
-
/* @__PURE__ */ jsxs("span", { children: [
|
|
56
|
-
"skills:",
|
|
57
|
-
" ",
|
|
58
|
-
profile.skillsMode === "all" ? "all" : profile.defaultSkills.join(", ") || "none"
|
|
59
|
-
] })
|
|
60
|
-
] }),
|
|
61
|
-
actions: profile.agentCount === 0 ? /* @__PURE__ */ jsx(Button, {
|
|
62
|
-
variant: "danger",
|
|
63
|
-
onClick: () => setDeleteTarget(profile),
|
|
64
|
-
children: "Delete"
|
|
65
|
-
}) : /* @__PURE__ */ jsx(StatusBadge, {
|
|
66
|
-
title: `${profile.agentCount} agent(s) use this template`,
|
|
67
|
-
children: "In use"
|
|
68
|
-
})
|
|
69
|
-
}, profile.id)) })
|
|
70
|
-
}),
|
|
71
|
-
/* @__PURE__ */ jsx(ConfirmDialog, {
|
|
72
|
-
open: deleteTarget !== null,
|
|
73
|
-
title: `Delete Agent template ${deleteTarget?.name ?? ""}?`,
|
|
74
|
-
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
75
|
-
"This permanently deletes ",
|
|
76
|
-
/* @__PURE__ */ jsx("code", {
|
|
77
|
-
className: "font-mono",
|
|
78
|
-
children: deleteTarget?.id
|
|
79
|
-
}),
|
|
80
|
-
" and its files. Existing Agents keep their own copies."
|
|
81
|
-
] }),
|
|
82
|
-
confirmLabel: "Delete Agent template",
|
|
83
|
-
onConfirm: async () => {
|
|
84
|
-
if (!deleteTarget) return;
|
|
85
|
-
await api(`/api/profiles/${encodeURIComponent(deleteTarget.id)}`, { method: "DELETE" });
|
|
86
|
-
await router.invalidate();
|
|
87
|
-
},
|
|
88
|
-
onOpenChange: (open) => {
|
|
89
|
-
if (!open) setDeleteTarget(null);
|
|
90
|
-
}
|
|
91
|
-
})
|
|
92
|
-
]
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
var FILES = [
|
|
96
|
-
{
|
|
97
|
-
key: "soul",
|
|
98
|
-
label: "SOUL.md",
|
|
99
|
-
hint: "Persona, values and operating principles. Part of every session.",
|
|
100
|
-
rows: 16,
|
|
101
|
-
optional: false
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
key: "identity",
|
|
105
|
-
label: "IDENTITY.md",
|
|
106
|
-
hint: "Name, creature, vibe, emoji, avatar: filled in during the first-run ritual.",
|
|
107
|
-
rows: 12,
|
|
108
|
-
optional: false
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
key: "bootstrap",
|
|
112
|
-
label: "BOOTSTRAP.md",
|
|
113
|
-
hint: "The first-run ritual; the agent retires it once introductions are done.",
|
|
114
|
-
rows: 16,
|
|
115
|
-
optional: true
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
key: "agents",
|
|
119
|
-
label: "AGENTS.md",
|
|
120
|
-
hint: "The workspace operating manual: memory discipline, red lines, channel etiquette.",
|
|
121
|
-
rows: 16,
|
|
122
|
-
optional: true
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
key: "tools",
|
|
126
|
-
label: "TOOLS.md",
|
|
127
|
-
hint: "Agent-specific tool notes and environment facts beyond the tool descriptions.",
|
|
128
|
-
rows: 14,
|
|
129
|
-
optional: true
|
|
130
|
-
}
|
|
131
|
-
];
|
|
132
|
-
function CreateProfileForm({ chatModels, skills, templates, onCreated }) {
|
|
133
|
-
const initialFiles = () => ({
|
|
134
|
-
soul: templates.soul,
|
|
135
|
-
identity: templates.identity,
|
|
136
|
-
bootstrap: templates.bootstrap,
|
|
137
|
-
agents: templates.agents,
|
|
138
|
-
tools: templates.tools
|
|
139
|
-
});
|
|
140
|
-
const [tab, setTab] = useState("basics");
|
|
141
|
-
const [id, setId] = useState("");
|
|
142
|
-
const [name, setName] = useState("");
|
|
143
|
-
const [model, setModel] = useState("");
|
|
144
|
-
const [files, setFiles] = useState(initialFiles);
|
|
145
|
-
const [enabled, setEnabled] = useState({
|
|
146
|
-
soul: true,
|
|
147
|
-
identity: true,
|
|
148
|
-
bootstrap: true,
|
|
149
|
-
agents: true,
|
|
150
|
-
tools: true
|
|
151
|
-
});
|
|
152
|
-
const [skillsMode, setSkillsMode] = useState("all");
|
|
153
|
-
const [picked, setPicked] = useState(/* @__PURE__ */ new Set());
|
|
154
|
-
const [error, setError] = useState(null);
|
|
155
|
-
const [submitting, setSubmitting] = useState(false);
|
|
156
|
-
const starter = initialFiles();
|
|
157
|
-
const dirty = id.length > 0 || name.length > 0 || model.length > 0 || FILES.some((file) => files[file.key] !== starter[file.key] || !enabled[file.key]) || skillsMode !== "all" || picked.size > 0;
|
|
158
|
-
function toggleFile(key, on) {
|
|
159
|
-
setEnabled((current) => ({
|
|
160
|
-
...current,
|
|
161
|
-
[key]: on
|
|
162
|
-
}));
|
|
163
|
-
if (!on && tab === key) setTab("basics");
|
|
164
|
-
}
|
|
165
|
-
async function submit(event) {
|
|
166
|
-
event.preventDefault();
|
|
167
|
-
setError(null);
|
|
168
|
-
setSubmitting(true);
|
|
169
|
-
try {
|
|
170
|
-
await api("/api/profiles", { body: {
|
|
171
|
-
id: id.trim(),
|
|
172
|
-
name: name.trim() || void 0,
|
|
173
|
-
defaultModel: model,
|
|
174
|
-
skillsMode,
|
|
175
|
-
defaultSkills: skillsMode === "selected" ? Array.from(picked) : [],
|
|
176
|
-
soul: files.soul,
|
|
177
|
-
identity: files.identity,
|
|
178
|
-
bootstrap: enabled.bootstrap ? files.bootstrap : null,
|
|
179
|
-
agents: enabled.agents ? files.agents : null,
|
|
180
|
-
tools: enabled.tools ? files.tools : null
|
|
181
|
-
} });
|
|
182
|
-
setId("");
|
|
183
|
-
setName("");
|
|
184
|
-
setModel("");
|
|
185
|
-
setFiles(initialFiles());
|
|
186
|
-
setEnabled({
|
|
187
|
-
soul: true,
|
|
188
|
-
identity: true,
|
|
189
|
-
bootstrap: true,
|
|
190
|
-
agents: true,
|
|
191
|
-
tools: true
|
|
192
|
-
});
|
|
193
|
-
setPicked(/* @__PURE__ */ new Set());
|
|
194
|
-
setSkillsMode("all");
|
|
195
|
-
setTab("basics");
|
|
196
|
-
await onCreated();
|
|
197
|
-
} catch (cause) {
|
|
198
|
-
setError(errorMessage(cause));
|
|
199
|
-
} finally {
|
|
200
|
-
setSubmitting(false);
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
const file = FILES.find((entry) => entry.key === tab);
|
|
204
|
-
return /* @__PURE__ */ jsx(SectionCard, {
|
|
205
|
-
title: "Create an Agent template",
|
|
206
|
-
children: /* @__PURE__ */ jsxs("form", {
|
|
207
|
-
onSubmit: (event) => void submit(event),
|
|
208
|
-
children: [
|
|
209
|
-
/* @__PURE__ */ jsx(UnsavedChangesGuard, {
|
|
210
|
-
when: dirty && !submitting,
|
|
211
|
-
subject: "Agent template draft"
|
|
212
|
-
}),
|
|
213
|
-
error && /* @__PURE__ */ jsx("p", {
|
|
214
|
-
role: "alert",
|
|
215
|
-
className: "err",
|
|
216
|
-
children: error
|
|
217
|
-
}),
|
|
218
|
-
/* @__PURE__ */ jsx(Tabs, {
|
|
219
|
-
items: [
|
|
220
|
-
{
|
|
221
|
-
id: "basics",
|
|
222
|
-
label: "Basics"
|
|
223
|
-
},
|
|
224
|
-
...FILES.map((entry) => ({
|
|
225
|
-
id: entry.key,
|
|
226
|
-
label: entry.label.replace(".md", ""),
|
|
227
|
-
disabled: !enabled[entry.key]
|
|
228
|
-
})),
|
|
229
|
-
{
|
|
230
|
-
id: "skills",
|
|
231
|
-
label: "Skills"
|
|
232
|
-
}
|
|
233
|
-
],
|
|
234
|
-
active: tab,
|
|
235
|
-
onChange: setTab
|
|
236
|
-
}),
|
|
237
|
-
/* @__PURE__ */ jsxs("fieldset", {
|
|
238
|
-
className: "mb-5 rounded-md border border-frost p-3",
|
|
239
|
-
children: [
|
|
240
|
-
/* @__PURE__ */ jsx("legend", {
|
|
241
|
-
className: "px-1 text-[0.85em] font-medium text-mocha",
|
|
242
|
-
children: "Files to include"
|
|
243
|
-
}),
|
|
244
|
-
/* @__PURE__ */ jsx("div", {
|
|
245
|
-
className: "flex flex-wrap gap-x-5 gap-y-2 text-[0.9em]",
|
|
246
|
-
children: FILES.map((entry) => /* @__PURE__ */ jsxs("label", {
|
|
247
|
-
className: `m-0 inline-flex items-center gap-1.5 ${entry.optional ? "cursor-pointer" : "opacity-60"}`,
|
|
248
|
-
title: entry.optional ? void 0 : "always included",
|
|
249
|
-
children: [/* @__PURE__ */ jsx("input", {
|
|
250
|
-
type: "checkbox",
|
|
251
|
-
checked: enabled[entry.key],
|
|
252
|
-
disabled: !entry.optional,
|
|
253
|
-
onChange: (event) => toggleFile(entry.key, event.target.checked)
|
|
254
|
-
}), entry.label]
|
|
255
|
-
}, entry.key))
|
|
256
|
-
}),
|
|
257
|
-
/* @__PURE__ */ jsx("p", {
|
|
258
|
-
className: "muted mt-2 text-[0.8em]",
|
|
259
|
-
children: "Each spawned agent gets its own copy of the included files."
|
|
260
|
-
})
|
|
261
|
-
]
|
|
262
|
-
}),
|
|
263
|
-
tab === "basics" && /* @__PURE__ */ jsxs("div", { children: [
|
|
264
|
-
/* @__PURE__ */ jsxs("div", {
|
|
265
|
-
className: "grid gap-x-4 sm:grid-cols-2",
|
|
266
|
-
children: [/* @__PURE__ */ jsxs("label", { children: ["ID (slug)", /* @__PURE__ */ jsx("input", {
|
|
267
|
-
value: id,
|
|
268
|
-
onChange: (event) => setId(event.target.value),
|
|
269
|
-
required: true
|
|
270
|
-
})] }), /* @__PURE__ */ jsxs("label", { children: ["Name", /* @__PURE__ */ jsx("input", {
|
|
271
|
-
value: name,
|
|
272
|
-
onChange: (event) => setName(event.target.value)
|
|
273
|
-
})] })]
|
|
274
|
-
}),
|
|
275
|
-
/* @__PURE__ */ jsx(ModelMenu, {
|
|
276
|
-
label: "Default model",
|
|
277
|
-
value: model,
|
|
278
|
-
onChange: setModel,
|
|
279
|
-
models: chatModels,
|
|
280
|
-
required: true
|
|
281
|
-
}),
|
|
282
|
-
chatModels.length === 0 && /* @__PURE__ */ jsxs("p", {
|
|
283
|
-
className: "muted text-[0.85em]",
|
|
284
|
-
children: [
|
|
285
|
-
"Connect a provider under ",
|
|
286
|
-
/* @__PURE__ */ jsx("a", {
|
|
287
|
-
href: "/config",
|
|
288
|
-
children: "Setup"
|
|
289
|
-
}),
|
|
290
|
-
" first."
|
|
291
|
-
]
|
|
292
|
-
})
|
|
293
|
-
] }),
|
|
294
|
-
file && /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("p", {
|
|
295
|
-
className: "muted my-2 text-[0.85em]",
|
|
296
|
-
children: file.hint
|
|
297
|
-
}), /* @__PURE__ */ jsxs("label", { children: [file.label, /* @__PURE__ */ jsx("textarea", {
|
|
298
|
-
rows: file.rows,
|
|
299
|
-
value: files[file.key],
|
|
300
|
-
onChange: (event) => setFiles((current) => ({
|
|
301
|
-
...current,
|
|
302
|
-
[file.key]: event.target.value
|
|
303
|
-
})),
|
|
304
|
-
className: "font-mono text-[0.88em] leading-[1.55]"
|
|
305
|
-
})] })] }),
|
|
306
|
-
tab === "skills" && /* @__PURE__ */ jsx(SkillsPicker, {
|
|
307
|
-
mode: skillsMode,
|
|
308
|
-
onModeChange: setSkillsMode,
|
|
309
|
-
picked,
|
|
310
|
-
onPickedChange: setPicked,
|
|
311
|
-
skills
|
|
312
|
-
}),
|
|
313
|
-
/* @__PURE__ */ jsx("div", {
|
|
314
|
-
className: "mt-5",
|
|
315
|
-
children: /* @__PURE__ */ jsx(Button, {
|
|
316
|
-
variant: "primary",
|
|
317
|
-
type: "submit",
|
|
318
|
-
disabled: submitting || !id.trim() || !model,
|
|
319
|
-
children: submitting ? "Creating…" : "Create"
|
|
320
|
-
})
|
|
321
|
-
})
|
|
322
|
-
]
|
|
323
|
-
})
|
|
324
|
-
});
|
|
325
|
-
}
|
|
326
|
-
//#endregion
|
|
327
|
-
export { ProfilesPage as component };
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { T as errorMessage, d as AgentAvatar, u as Button } from "./workspace-DaitCM0t.js";
|
|
2
|
-
import { t as ConfirmDialog } from "./ConfirmDialog-DfaJ--A6.js";
|
|
3
|
-
import { a as unarchiveAgent, n as archiveAgent, r as deleteAgent, t as SpawnDialog } from "./SpawnDialog-D_SMPCG_.js";
|
|
4
|
-
import { a as PageHeader, i as ItemRow, l as StatusBadge, n as EmptyState, o as PageShell, r as ItemList, s as SectionCard } from "./createSsrRpc-GCCF14VW.js";
|
|
5
|
-
import { t as Route } from "./agents-BJ-_oC2e.js";
|
|
6
|
-
import { useState } from "react";
|
|
7
|
-
import { Link, useRouter } from "@tanstack/react-router";
|
|
8
|
-
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
-
//#region src/routes/agents/index.tsx?tsr-split=component
|
|
10
|
-
function AgentsPage() {
|
|
11
|
-
const { agents, profiles, teams } = Route.useLoaderData();
|
|
12
|
-
const showAll = Route.useSearch().all === 1;
|
|
13
|
-
const router = useRouter();
|
|
14
|
-
const [spawning, setSpawning] = useState(false);
|
|
15
|
-
const [pending, setPending] = useState(null);
|
|
16
|
-
const [error, setError] = useState(null);
|
|
17
|
-
async function restore(agent) {
|
|
18
|
-
setError(null);
|
|
19
|
-
try {
|
|
20
|
-
await unarchiveAgent(agent.id);
|
|
21
|
-
await router.invalidate();
|
|
22
|
-
} catch (cause) {
|
|
23
|
-
setError(errorMessage(cause));
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
return /* @__PURE__ */ jsxs(PageShell, {
|
|
27
|
-
size: "wide",
|
|
28
|
-
children: [
|
|
29
|
-
/* @__PURE__ */ jsx(PageHeader, {
|
|
30
|
-
eyebrow: "Workspace",
|
|
31
|
-
title: "Agents",
|
|
32
|
-
description: "Every Agent across your teams: spawn, archive, restore and delete. Open one to talk to it; its model, skills and schedules are in its side panel.",
|
|
33
|
-
actions: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("a", {
|
|
34
|
-
className: "ghost-btn",
|
|
35
|
-
href: showAll ? "/agents" : "/agents?all=1",
|
|
36
|
-
children: showAll ? "Hide archived" : "Show archived"
|
|
37
|
-
}), /* @__PURE__ */ jsx(Button, {
|
|
38
|
-
variant: "primary",
|
|
39
|
-
disabled: profiles.length === 0,
|
|
40
|
-
onClick: () => setSpawning(true),
|
|
41
|
-
children: "Spawn agent"
|
|
42
|
-
})] })
|
|
43
|
-
}),
|
|
44
|
-
error && /* @__PURE__ */ jsx("p", {
|
|
45
|
-
role: "alert",
|
|
46
|
-
className: "err",
|
|
47
|
-
children: error
|
|
48
|
-
}),
|
|
49
|
-
/* @__PURE__ */ jsx(SectionCard, {
|
|
50
|
-
title: showAll ? "All agents" : "Current agents",
|
|
51
|
-
description: showAll ? "Active and archived agents are shown together." : "Archived agents stay hidden until you choose to show them.",
|
|
52
|
-
children: agents.length === 0 ? /* @__PURE__ */ jsx(EmptyState, {
|
|
53
|
-
title: showAll ? "No agents yet" : "No current agents",
|
|
54
|
-
description: "Spawn an agent to give a team its first working member."
|
|
55
|
-
}) : /* @__PURE__ */ jsx(ItemList, { children: agents.map((agent) => /* @__PURE__ */ jsx(ItemRow, {
|
|
56
|
-
title: /* @__PURE__ */ jsxs("span", {
|
|
57
|
-
className: "flex min-w-0 items-center gap-2",
|
|
58
|
-
children: [
|
|
59
|
-
/* @__PURE__ */ jsx(AgentAvatar, {
|
|
60
|
-
identity: agent.identity,
|
|
61
|
-
size: 26
|
|
62
|
-
}),
|
|
63
|
-
/* @__PURE__ */ jsx(Link, {
|
|
64
|
-
to: "/",
|
|
65
|
-
search: { agent: agent.id },
|
|
66
|
-
className: "truncate",
|
|
67
|
-
children: agent.name
|
|
68
|
-
}),
|
|
69
|
-
/* @__PURE__ */ jsx(StatusBadge, {
|
|
70
|
-
variant: agent.status === "archived" ? "warning" : "success",
|
|
71
|
-
children: agent.status
|
|
72
|
-
})
|
|
73
|
-
]
|
|
74
|
-
}),
|
|
75
|
-
meta: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
76
|
-
(agent.identity?.creature || agent.identity?.vibe) && /* @__PURE__ */ jsx("span", { children: [agent.identity?.creature, agent.identity?.vibe].filter(Boolean).join(" · ") }),
|
|
77
|
-
/* @__PURE__ */ jsxs("span", { children: ["template ", /* @__PURE__ */ jsx("code", { children: agent.profileId })] }),
|
|
78
|
-
/* @__PURE__ */ jsxs("span", { children: ["team ", /* @__PURE__ */ jsx("code", { children: agent.teamId })] }),
|
|
79
|
-
/* @__PURE__ */ jsx("code", {
|
|
80
|
-
title: agent.id,
|
|
81
|
-
children: agent.id.slice(0, 8)
|
|
82
|
-
})
|
|
83
|
-
] }),
|
|
84
|
-
actions: /* @__PURE__ */ jsxs(Fragment$1, { children: [agent.status === "archived" ? /* @__PURE__ */ jsx(Button, {
|
|
85
|
-
variant: "ghost",
|
|
86
|
-
onClick: () => void restore(agent),
|
|
87
|
-
children: "Restore"
|
|
88
|
-
}) : /* @__PURE__ */ jsx(Button, {
|
|
89
|
-
variant: "ghost",
|
|
90
|
-
onClick: () => setPending({
|
|
91
|
-
kind: "archive",
|
|
92
|
-
agent
|
|
93
|
-
}),
|
|
94
|
-
children: "Archive"
|
|
95
|
-
}), /* @__PURE__ */ jsx(Button, {
|
|
96
|
-
variant: "danger",
|
|
97
|
-
onClick: () => setPending({
|
|
98
|
-
kind: "delete",
|
|
99
|
-
agent
|
|
100
|
-
}),
|
|
101
|
-
children: "Delete"
|
|
102
|
-
})] })
|
|
103
|
-
}, agent.id)) })
|
|
104
|
-
}),
|
|
105
|
-
spawning && /* @__PURE__ */ jsx(SpawnDialog, {
|
|
106
|
-
profiles,
|
|
107
|
-
teams,
|
|
108
|
-
onClose: () => setSpawning(false)
|
|
109
|
-
}),
|
|
110
|
-
/* @__PURE__ */ jsx(ConfirmDialog, {
|
|
111
|
-
open: pending !== null,
|
|
112
|
-
onOpenChange: (open) => {
|
|
113
|
-
if (!open) setPending(null);
|
|
114
|
-
},
|
|
115
|
-
title: pending?.kind === "delete" ? `Delete ${pending.agent.name} permanently?` : `Archive ${pending?.agent.name ?? "agent"}?`,
|
|
116
|
-
description: pending?.kind === "delete" ? /* @__PURE__ */ jsx("p", { children: "This permanently removes the Agent, its messages, triggers, skill attachments, sessions, and private on-disk directory. This cannot be undone." }) : /* @__PURE__ */ jsx("p", { children: "The Agent will stop appearing in current lists and cannot receive normal work. You can restore it later from “Show archived”." }),
|
|
117
|
-
confirmLabel: pending?.kind === "delete" ? "Delete permanently" : "Archive agent",
|
|
118
|
-
confirmVariant: pending?.kind === "delete" ? "danger" : "primary",
|
|
119
|
-
onConfirm: async () => {
|
|
120
|
-
if (!pending) return;
|
|
121
|
-
if (pending.kind === "delete") await deleteAgent(pending.agent.id);
|
|
122
|
-
else await archiveAgent(pending.agent.id);
|
|
123
|
-
await router.invalidate();
|
|
124
|
-
}
|
|
125
|
-
})
|
|
126
|
-
]
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
//#endregion
|
|
130
|
-
export { AgentsPage as component };
|