bazilion 0.27.0 → 0.51.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 +651 -309
- package/dist/cli.js.map +1 -1
- package/dist/daemon.js +2105 -997
- package/dist/daemon.js.map +1 -1
- package/dist/web/client/assets/AddProviderDialog-Diic36c_.js +1 -0
- package/dist/web/client/assets/ConfigPage-pupvtSCX.js +1 -0
- package/dist/web/client/assets/ConfirmDialog-GFDcHI1L.js +1 -0
- package/dist/web/client/assets/ConnectionsView-y1CeY-6U.js +1 -0
- package/dist/web/client/assets/Dialog-bg86_x4v.js +1 -0
- package/dist/web/client/assets/FieldRow-B8eIni5r.js +1 -0
- package/dist/web/client/assets/ModelSelect-DvCLUmkW.js +1 -0
- package/dist/web/client/assets/SectionTabs-D4ezA6U4.js +1 -0
- package/dist/web/client/assets/Segmented-Dh77vmpp.js +1 -0
- package/dist/web/client/assets/SkillFindings-BzLO1lNA.js +1 -0
- package/dist/web/client/assets/SkillsPicker-hI3YXvib.js +1 -0
- package/dist/web/client/assets/SpawnDialog-YJX6UMBC.js +1 -0
- package/dist/web/client/assets/Tabs-f6bHvCGn.js +1 -0
- package/dist/web/client/assets/TeamForm-kda1HYZG.js +1 -0
- package/dist/web/client/assets/TeamThread-DFvbakHo.js +1 -0
- package/dist/web/client/assets/UnsavedChangesGuard-DBJikVgc.js +1 -0
- package/dist/web/client/assets/_id-BjNtLwak.js +1 -0
- package/dist/web/client/assets/_id-BklaQf3z.js +1 -0
- package/dist/web/client/assets/agents-D9cUF2d9.js +1 -0
- package/dist/web/client/assets/agents-wuBlzx4e.js +1 -0
- package/dist/web/client/assets/api-HC_YzjBy.js +1 -0
- package/dist/web/client/assets/arrow-right-Gm_FDWJ_.js +1 -0
- package/dist/web/client/assets/attention-8ZkSLl2e.js +1 -0
- package/dist/web/client/assets/check-BjgKoGvU.js +1 -0
- package/dist/web/client/assets/config-Con_BbSh.js +1 -0
- package/dist/web/client/assets/createLucideIcon-C6gOo8sD.js +1 -0
- package/dist/web/client/assets/index-Br9qkGM-.js +54 -0
- package/dist/web/client/assets/link-Cbztlp_R.js +1 -0
- package/dist/web/client/assets/login-llnOKSJc.js +1 -0
- package/dist/web/client/assets/mcp-zIUguMSI.js +1 -0
- package/dist/web/client/assets/plus-CWrKMtvA.js +1 -0
- package/dist/web/client/assets/routes-BY5uqJ2n.js +76 -0
- package/dist/web/client/assets/save-f9O-CQia.js +1 -0
- package/dist/web/client/assets/services-esLrcTwe.js +1 -0
- package/dist/web/client/assets/skills-DzYXksM0.js +1 -0
- package/dist/web/client/assets/style-Cdzqt_TJ.js +7 -0
- package/dist/web/client/assets/styles-BRSS6yrm.css +2 -0
- package/dist/web/client/assets/system-CsI66nyZ.js +1 -0
- package/dist/web/client/assets/teams-CHE_zpxS.js +1 -0
- package/dist/web/client/assets/teams-dxG9OESG.js +1 -0
- package/dist/web/client/assets/telegram-C3dGndJV.js +1 -0
- package/dist/web/client/assets/tokens-CNNH-Wr9.js +1 -0
- package/dist/web/client/assets/use-resource-BjnxgGvh.js +1 -0
- package/dist/web/client/assets/welcome-C8EOtc8P.js +1 -0
- package/dist/web/server/assets/AddProviderDialog-CR6TRYdZ.js +910 -0
- package/dist/web/server/assets/{ConfigPage-CGld_wCK.js → ConfigPage-CIh3ohea.js} +4 -4
- package/dist/web/server/assets/ConfirmDialog-B79K2KEW.js +52 -0
- package/dist/web/server/assets/ConnectionsView-BIMYdp9C.js +710 -0
- package/dist/web/server/assets/{ConfirmDialog-LdVlEanK.js → Dialog-CVqpXxuN.js} +3 -50
- package/dist/web/server/assets/{FieldRow-Dah2KKqo.js → FieldRow-CHVhX2rS.js} +4 -4
- package/dist/web/server/assets/{ModelSelect-Vwro6OkL.js → ModelSelect-DrZrdndo.js} +7 -7
- package/dist/web/server/assets/Rail-Cg-efcpA.js +698 -0
- package/dist/web/server/assets/{SectionTabs-CqFg9Vwx.js → SectionTabs-DrcgVeZd.js} +4 -18
- package/dist/web/server/assets/Segmented-3ZLdqa5U.js +18 -0
- package/dist/web/server/assets/{SkillFindings-Bd6e81Wu.js → SkillFindings-DSDiL6hn.js} +1 -1
- package/dist/web/server/assets/{SpawnDialog-BGNaMfFb.js → SpawnDialog-BUUlLxE9.js} +25 -7
- package/dist/web/server/assets/{TeamForm-C93tpn9r.js → TeamForm-CvQAs2FA.js} +1 -1
- package/dist/web/server/assets/TeamThread-5CjVPcDr.js +190 -0
- package/dist/web/server/assets/{UnsavedChangesGuard-Dm4a27_5.js → UnsavedChangesGuard-CyF2Z9p1.js} +8 -4
- package/dist/web/server/assets/{TeamPolicyEditor-BHS3J0R9.js → _id-0fEWiVZX.js} +114 -263
- package/dist/web/server/assets/{_id-B0x1ffz3.js → _id-8bsYEcGg.js} +2 -2
- package/dist/web/server/assets/{_id-sW6zXrTP.js → _id-BvAaRSUW.js} +2 -2
- package/dist/web/server/assets/{_id-lOVnT5sS.js → _id-Dg6M_qfr.js} +6 -6
- package/dist/web/server/assets/{_id-ByiXeIPS.js → _id-Dji7xr9C.js} +2 -2
- package/dist/web/server/assets/{_id-Bdf_Rg62.js → _id-TVruGcOd.js} +1 -1
- package/dist/web/server/assets/_tanstack-start-manifest_v-sxiIH4M7.js +214 -0
- package/dist/web/server/assets/{agents-D4tqK1kH.js → agents-BDA5yYZ2.js} +14 -15
- package/dist/web/server/assets/{agents-Cn9GkXFX.js → agents-BTDxmp-F.js} +2 -2
- package/dist/web/server/assets/{agents-BNPkidbH.js → agents-BnWgFo6o.js} +1 -1
- package/dist/web/server/assets/{agents-lOqc6VGd.js → agents-DM7guWF2.js} +2 -2
- package/dist/web/server/assets/{agents-DycxHDt8.js → agents-DktqUffG.js} +10 -10
- package/dist/web/server/assets/{agents-BK8OmB8g.js → agents-xgZ9rsac.js} +2 -2
- package/dist/web/server/assets/{attention-DULVjdmF.js → attention-CHQEQiZl.js} +2 -2
- package/dist/web/server/assets/{attention-YWnLKA2E.js → attention-Cr7puThv.js} +1 -1
- package/dist/web/server/assets/{attention-BIm455bC.js → attention-De3-ehuf.js} +6 -6
- package/dist/web/server/assets/{auth-DiN92ydD.js → auth-dJnrFW6y.js} +1 -1
- package/dist/web/server/assets/config-DOp28gcy.js +1067 -0
- package/dist/web/server/assets/config-DzgkbBoD.js +17 -0
- package/dist/web/server/assets/config-X7qWbbpH.js +20 -0
- package/dist/web/server/assets/{Page-CMSYKXWJ.js → createSsrRpc-CcLbajrF.js} +17 -2
- package/dist/web/server/assets/{daemon-client-DL2ik2Em.js → daemon-client-B_ZRIIrT.js} +2 -1
- package/dist/web/server/assets/{mcp-BwmpNQPN.js → mcp-C97uAZe1.js} +1 -1
- package/dist/web/server/assets/{mcp-B09_O05r.js → mcp-CO_tycXU.js} +9 -9
- package/dist/web/server/assets/{mcp-CqdTfXcn.js → mcp-D3OCoHtO.js} +2 -2
- package/dist/web/server/assets/router-Cs2Ak4II.js +892 -0
- package/dist/web/server/assets/routes-BSNOKE-C.js +7647 -0
- package/dist/web/server/assets/routes-BVwqgZGI.js +16 -0
- package/dist/web/server/assets/routes-CO4l-GJ0.js +57 -0
- package/dist/web/server/assets/{services-Q9HYQXXB.js → services-DZLxUSG8.js} +2 -2
- package/dist/web/server/assets/{services-BLvAvb8g.js → services-DsHRLL8q.js} +1 -1
- package/dist/web/server/assets/{services-tCfB1B83.js → services-DsvpaF3L.js} +4 -4
- package/dist/web/server/assets/{skills-BZg_txbf.js → skills-CggQJk6a.js} +2 -2
- package/dist/web/server/assets/{skills-C7fqRPna.js → skills-DKYV7PTk.js} +11 -11
- package/dist/web/server/assets/{skills-C_g8IKag.js → skills-h5aHa7Q8.js} +1 -1
- package/dist/web/server/assets/style-GYDODk2F.js +178 -0
- package/dist/web/server/assets/system-CZ2qzBz3.js +138 -0
- package/dist/web/server/assets/system-DsJfpBPl.js +12 -0
- package/dist/web/server/assets/system-DtswhLW62.js +18 -0
- package/dist/web/server/assets/{teams-BS-oweRl.js → teams-B6PzNcoy.js} +23 -15
- package/dist/web/server/assets/{teams-D4CaU76n.js → teams-B6lBhvdL.js} +2 -2
- package/dist/web/server/assets/{teams-BHkhnt6b.js → teams-Bp2tERZe.js} +2 -2
- package/dist/web/server/assets/{teams-DX2HmKqi.js → teams-BxnvFTyn.js} +1 -1
- package/dist/web/server/assets/{teams-BSflKBP8.js → teams-C-8iz-uV.js} +6 -6
- package/dist/web/server/assets/{teams-CNyB5nM9.js → teams-YrmyutM4.js} +1 -1
- package/dist/web/server/assets/{telegram-CrJiygCX.js → telegram-CXrP3hMp.js} +6 -6
- package/dist/web/server/assets/{telegram-BUdnc8oF.js → telegram-D2RZriz_.js} +2 -2
- package/dist/web/server/assets/{telegram-C4v1HhyJ.js → telegram-Gy7_9yih.js} +1 -1
- package/dist/web/server/assets/{tokens-DqldzPUq.js → tokens-C-oDTqnp.js} +2 -2
- package/dist/web/server/assets/{tokens-B1twAJdd.js → tokens-CEdl8puR.js} +1 -1
- package/dist/web/server/assets/{tokens-DdjEyALj.js → tokens-DSLwQ1Pw.js} +10 -10
- package/dist/web/server/assets/use-resource-ChQozXVI.js +63 -0
- package/dist/web/server/assets/welcome-BLw1G6SS.js +318 -0
- package/dist/web/server/assets/welcome-ByAkvHSP.js +26 -0
- package/dist/web/server/assets/welcome-CxXMI4HI.js +15 -0
- package/dist/web/server/assets/workspace-DeEYMPDX.js +658 -0
- package/dist/web/server/server.js +30 -74
- package/dist/worker.js +78 -36
- package/dist/worker.js.map +1 -1
- package/package.json +1 -1
- package/dist/web/client/assets/AgentAvatar-DWx-bM6n.js +0 -1
- package/dist/web/client/assets/ChatPane-DOV_HJg-.js +0 -72
- package/dist/web/client/assets/ConfigPage-Dfu9DzFX.js +0 -1
- package/dist/web/client/assets/ConfirmDialog-536ziJ5P.js +0 -1
- package/dist/web/client/assets/FieldRow-z1JqCdqn.js +0 -1
- package/dist/web/client/assets/ModelSelect-CvOHjUyB.js +0 -1
- package/dist/web/client/assets/ResultCard-X4nTbjYY.js +0 -1
- package/dist/web/client/assets/SectionTabs-DXHzXmmb.js +0 -1
- package/dist/web/client/assets/SkillFindings-8LX6bYf_.js +0 -1
- package/dist/web/client/assets/SkillsPicker-Cr87y_W-.js +0 -1
- package/dist/web/client/assets/SpawnDialog-DoZl-yes.js +0 -1
- package/dist/web/client/assets/SpawnTeamModal-C638hEoN.js +0 -1
- package/dist/web/client/assets/Tabs-D0LgBNIk.js +0 -1
- package/dist/web/client/assets/TeamForm-C-WzvOl4.js +0 -1
- package/dist/web/client/assets/TeamPolicyEditor-CSKBx0oK.js +0 -7
- package/dist/web/client/assets/UnsavedChangesGuard-GC-vzw7h.js +0 -1
- package/dist/web/client/assets/_id-BKLynswT.js +0 -1
- package/dist/web/client/assets/_id-BYM_NORr.js +0 -1
- package/dist/web/client/assets/_id-Cxa98a9m.js +0 -1
- package/dist/web/client/assets/_id-D4hV1U1t.js +0 -1
- package/dist/web/client/assets/agent-actions-CXQCoxKO.js +0 -1
- package/dist/web/client/assets/agents-BxPS1_Bp.js +0 -1
- package/dist/web/client/assets/agents-GozAWW-l.js +0 -1
- package/dist/web/client/assets/attention-Cz9rZcrr.js +0 -1
- package/dist/web/client/assets/chevron-right-CPAb1zac.js +0 -1
- package/dist/web/client/assets/config-9vv9Lipb.js +0 -3
- package/dist/web/client/assets/inbox-DHLArXxl.js +0 -1
- package/dist/web/client/assets/index-1YXquAq8.js +0 -52
- package/dist/web/client/assets/jsx-runtime-bzQ4Vb5N.js +0 -1
- package/dist/web/client/assets/learning-PvtXm8Ne.js +0 -1
- package/dist/web/client/assets/login-DIJpNQFo.js +0 -1
- package/dist/web/client/assets/mcp-pKBL0xIf.js +0 -1
- package/dist/web/client/assets/members-DHWsgsEs.js +0 -1
- package/dist/web/client/assets/memory-CEVppPyU.js +0 -1
- package/dist/web/client/assets/plus-BaIRdB10.js +0 -1
- package/dist/web/client/assets/policy-DEh4BLSw.js +0 -1
- package/dist/web/client/assets/preload-helper-eUUcpe2S.js +0 -1
- package/dist/web/client/assets/results-DgJPjEZF.js +0 -1
- package/dist/web/client/assets/review-BbshafTQ.js +0 -1
- package/dist/web/client/assets/route-Ccb8v41z.js +0 -1
- package/dist/web/client/assets/route-D1d6kCEV.js +0 -1
- package/dist/web/client/assets/routes-g7V4ru7T.js +0 -1
- package/dist/web/client/assets/services-B2f7e5jV.js +0 -1
- package/dist/web/client/assets/settings-B6elpcYm.js +0 -1
- package/dist/web/client/assets/skills-CngE7TF8.js +0 -1
- package/dist/web/client/assets/styles-xUnZ-ep_.css +0 -2
- package/dist/web/client/assets/teams-BdJZXOan.js +0 -1
- package/dist/web/client/assets/teams-c496ISsT.js +0 -1
- package/dist/web/client/assets/telegram-B_-hK6EC.js +0 -1
- package/dist/web/client/assets/tokens-CKz8gx4-.js +0 -1
- package/dist/web/client/assets/triggers-DCEPciGW.js +0 -1
- package/dist/web/client/assets/welcome-D-zVOLGA.js +0 -1
- package/dist/web/server/assets/AgentAvatar-8gTAy_tP.js +0 -37
- package/dist/web/server/assets/ChatPane-De_FPEoD.js +0 -1887
- package/dist/web/server/assets/ResultCard-CZn1w4KA.js +0 -97
- package/dist/web/server/assets/Sidebar-puq47KyR.js +0 -430
- package/dist/web/server/assets/SpawnTeamModal-C6GbfScI.js +0 -97
- package/dist/web/server/assets/_id-BR6tnR6I.js +0 -23
- package/dist/web/server/assets/_id-Bm611NQz.js +0 -13
- package/dist/web/server/assets/_id-D5UCoyES.js +0 -359
- package/dist/web/server/assets/_id-DHx5UmmL.js +0 -12
- package/dist/web/server/assets/_id-DLpGmOVm.js +0 -19
- package/dist/web/server/assets/_id-Y5ctILG2.js +0 -13
- package/dist/web/server/assets/_id-dDA0pdVo.js +0 -54
- package/dist/web/server/assets/_tanstack-start-manifest_v-B8u80HjK.js +0 -292
- package/dist/web/server/assets/agent-actions-BBdFVdoa.js +0 -20
- package/dist/web/server/assets/api-WWxPqx67.js +0 -85
- package/dist/web/server/assets/config-BNEgu7WG.js +0 -798
- package/dist/web/server/assets/config-C1VB28se.js +0 -12
- package/dist/web/server/assets/config-TdVqnqNL.js +0 -25
- package/dist/web/server/assets/createSsrRpc-6LHNEsSK.js +0 -16
- package/dist/web/server/assets/inbox-4Vj5jTT8.js +0 -245
- package/dist/web/server/assets/inbox-D4IqUv3l.js +0 -38
- package/dist/web/server/assets/inbox-Dle24AfV.js +0 -23
- package/dist/web/server/assets/learning-BScq7VbO.js +0 -12
- package/dist/web/server/assets/learning-CBWFEnhg.js +0 -263
- package/dist/web/server/assets/learning-DWAKevhF.js +0 -25
- package/dist/web/server/assets/members-B8QBF6TF.js +0 -12
- package/dist/web/server/assets/members-DsF02Wp7.js +0 -12
- package/dist/web/server/assets/members-tWZA9b15.js +0 -36
- package/dist/web/server/assets/memory-BNN0b-0x.js +0 -12
- package/dist/web/server/assets/memory-CTl1E1Rm.js +0 -267
- package/dist/web/server/assets/memory-CV5uCBb2.js +0 -12
- package/dist/web/server/assets/policy-C9M6zV6w.js +0 -79
- package/dist/web/server/assets/policy-h-6NpU3m.js +0 -19
- package/dist/web/server/assets/policy-xEw9X0DK.js +0 -12
- package/dist/web/server/assets/results-D3A3UA4d.js +0 -182
- package/dist/web/server/assets/results-D6Ui5S8D.js +0 -12
- package/dist/web/server/assets/results-DWmxvfyn.js +0 -15
- package/dist/web/server/assets/review-CyQky-WQ.js +0 -40
- package/dist/web/server/assets/review-Sq0GGcPV.js +0 -322
- package/dist/web/server/assets/review-XWbSF8cF.js +0 -12
- package/dist/web/server/assets/route-BErtkz6t.js +0 -19
- package/dist/web/server/assets/route-CLoV-An_.js +0 -48
- package/dist/web/server/assets/route-WQ19JkBa.js +0 -19
- package/dist/web/server/assets/route-dEK_2GLj.js +0 -203
- package/dist/web/server/assets/route-iHTkhO81.js +0 -16
- package/dist/web/server/assets/route-zs8uUQtB.js +0 -16
- package/dist/web/server/assets/router-BI9gmY3S.js +0 -751
- package/dist/web/server/assets/routes-081s4n24.js +0 -45
- package/dist/web/server/assets/routes-CWo5WPsr.js +0 -15
- package/dist/web/server/assets/routes-Cqp1ufHm.js +0 -56
- package/dist/web/server/assets/settings-CVaGv-xF.js +0 -12
- package/dist/web/server/assets/settings-D9viV-86.js +0 -561
- package/dist/web/server/assets/settings-DaZNZ_CC.js +0 -27
- package/dist/web/server/assets/triggers-B7LW784F.js +0 -214
- package/dist/web/server/assets/triggers-C5sMCZXv2.js +0 -12
- package/dist/web/server/assets/triggers-DMfVdImD.js +0 -12
- package/dist/web/server/assets/welcome-D0d38Pzx.js +0 -93
- package/dist/web/client/assets/{TeamPolicyEditor-DLioOiRN.css → style-DLioOiRN.css} +0 -0
- package/dist/web/server/assets/{start-DTX6aKCi.js → start-DhW7sy23.js} +1 -1
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { i as errorMessage, n as api, o as Button, r as apiFetch, t as ApiError } from "./api-WWxPqx67.js";
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
3
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
//#region src/components/ResultCard.tsx
|
|
5
|
-
var PREVIEW_IMAGE = [
|
|
6
|
-
"image/png",
|
|
7
|
-
"image/jpeg",
|
|
8
|
-
"image/gif",
|
|
9
|
-
"image/webp"
|
|
10
|
-
];
|
|
11
|
-
var PREVIEW_TEXT = ["text/plain", "text/markdown"];
|
|
12
|
-
/** A saved result: name, size, download and, for images and text, a preview. */
|
|
13
|
-
function ResultCard({ resultId, result: preloaded, showPreview = false }) {
|
|
14
|
-
const [result, setResult] = useState(preloaded ?? null);
|
|
15
|
-
const [error, setError] = useState("");
|
|
16
|
-
const [text, setText] = useState(null);
|
|
17
|
-
const [imageOpen, setImageOpen] = useState(false);
|
|
18
|
-
const path = `/api/results/${encodeURIComponent(resultId)}`;
|
|
19
|
-
useEffect(() => {
|
|
20
|
-
if (preloaded) return;
|
|
21
|
-
const controller = new AbortController();
|
|
22
|
-
api(path, { signal: controller.signal }).then((body) => setResult(body.result)).catch((cause) => {
|
|
23
|
-
if (controller.signal.aborted) return;
|
|
24
|
-
setError(cause instanceof ApiError && cause.status === 404 ? "This saved file is unavailable (it may have been deleted)." : errorMessage(cause));
|
|
25
|
-
});
|
|
26
|
-
return () => controller.abort();
|
|
27
|
-
}, [path, preloaded]);
|
|
28
|
-
async function toggleText() {
|
|
29
|
-
if (text !== null) return setText(null);
|
|
30
|
-
setError("");
|
|
31
|
-
try {
|
|
32
|
-
setText(await (await apiFetch(`${path}/preview`)).text());
|
|
33
|
-
} catch (cause) {
|
|
34
|
-
setError(errorMessage(cause));
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
const image = result && PREVIEW_IMAGE.includes(result.mimeType) && result.byteLength <= 10 * 1024 * 1024;
|
|
38
|
-
const textual = result && PREVIEW_TEXT.includes(result.mimeType) && result.byteLength <= 256 * 1024;
|
|
39
|
-
return /* @__PURE__ */ jsxs("section", {
|
|
40
|
-
className: "my-3 rounded-lg border border-fawn bg-ivory p-3 text-chocolate",
|
|
41
|
-
"aria-label": "Saved result",
|
|
42
|
-
children: [result ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
43
|
-
/* @__PURE__ */ jsx("p", {
|
|
44
|
-
className: "m-0 break-all font-semibold",
|
|
45
|
-
children: result.name
|
|
46
|
-
}),
|
|
47
|
-
/* @__PURE__ */ jsxs("p", {
|
|
48
|
-
className: "my-1 text-sm text-mocha-light",
|
|
49
|
-
children: [
|
|
50
|
-
result.byteLength < 1024 ? `${result.byteLength} B` : `${(result.byteLength / 1024).toFixed(1)} KiB`,
|
|
51
|
-
" · ",
|
|
52
|
-
result.mimeType,
|
|
53
|
-
result.imageModel && ` · generated with ${result.imageModel}`
|
|
54
|
-
]
|
|
55
|
-
}),
|
|
56
|
-
/* @__PURE__ */ jsxs("div", {
|
|
57
|
-
className: "flex flex-wrap gap-2",
|
|
58
|
-
children: [
|
|
59
|
-
/* @__PURE__ */ jsx("a", {
|
|
60
|
-
className: "ghost-btn",
|
|
61
|
-
href: `${path}/download`,
|
|
62
|
-
download: result.name,
|
|
63
|
-
children: "Download"
|
|
64
|
-
}),
|
|
65
|
-
image && !showPreview && result.imageModel === null && /* @__PURE__ */ jsx(Button, {
|
|
66
|
-
variant: "ghost",
|
|
67
|
-
onClick: () => setImageOpen((open) => !open),
|
|
68
|
-
children: imageOpen ? "Close preview" : "Preview"
|
|
69
|
-
}),
|
|
70
|
-
textual && /* @__PURE__ */ jsx(Button, {
|
|
71
|
-
variant: "ghost",
|
|
72
|
-
onClick: () => void toggleText(),
|
|
73
|
-
children: text !== null ? "Close preview" : "Preview"
|
|
74
|
-
})
|
|
75
|
-
]
|
|
76
|
-
}),
|
|
77
|
-
image && (showPreview || result.imageModel !== null || imageOpen) && /* @__PURE__ */ jsx("img", {
|
|
78
|
-
src: `${path}/preview`,
|
|
79
|
-
alt: result.name,
|
|
80
|
-
className: "mt-3 max-h-80 max-w-full object-contain"
|
|
81
|
-
}),
|
|
82
|
-
text !== null && /* @__PURE__ */ jsx("pre", {
|
|
83
|
-
className: "mt-3 max-h-80 overflow-auto whitespace-pre-wrap break-words text-sm",
|
|
84
|
-
children: text
|
|
85
|
-
})
|
|
86
|
-
] }) : !error ? /* @__PURE__ */ jsx("p", {
|
|
87
|
-
role: "status",
|
|
88
|
-
children: "Loading saved result…"
|
|
89
|
-
}) : null, error && /* @__PURE__ */ jsx("p", {
|
|
90
|
-
role: "alert",
|
|
91
|
-
className: "mt-2 text-sm text-danger",
|
|
92
|
-
children: error
|
|
93
|
-
})]
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
//#endregion
|
|
97
|
-
export { ResultCard as t };
|
|
@@ -1,430 +0,0 @@
|
|
|
1
|
-
import { n as DEFAULT_TEAM_ID, t as DEFAULT_PROFILE_ID } from "./entities-Dn2xzKIw.js";
|
|
2
|
-
import { i as errorMessage, o as Button } from "./api-WWxPqx67.js";
|
|
3
|
-
import { n as Dialog$1, r as DialogActions, t as ConfirmDialog } from "./ConfirmDialog-LdVlEanK.js";
|
|
4
|
-
import { r as renameAgent, t as archiveAgent } from "./agent-actions-BBdFVdoa.js";
|
|
5
|
-
import { t as SpawnDialog } from "./SpawnDialog-BGNaMfFb.js";
|
|
6
|
-
import { t as SpawnTeamModal } from "./SpawnTeamModal-C6GbfScI.js";
|
|
7
|
-
import { t as TeamForm } from "./TeamForm-C93tpn9r.js";
|
|
8
|
-
import { useRef, useState } from "react";
|
|
9
|
-
import { Link, useRouter } from "@tanstack/react-router";
|
|
10
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
-
import { Archive, Bot, ChevronDown, ChevronRight, Pencil, Plus, Send, UsersRound } from "lucide-react";
|
|
12
|
-
import { DropdownMenu } from "radix-ui";
|
|
13
|
-
//#region src/components/Sidebar.tsx
|
|
14
|
-
var SIDEBAR_OPEN_GROUPS_COOKIE = "bz_sidebar_open_groups";
|
|
15
|
-
function writeOpenGroupsCookie(map) {
|
|
16
|
-
document.cookie = `${SIDEBAR_OPEN_GROUPS_COOKIE}=${encodeURIComponent(JSON.stringify(map))}; Path=/; Max-Age=31536000; SameSite=Lax`;
|
|
17
|
-
}
|
|
18
|
-
var MENU_ITEM = "flex min-h-8 w-full cursor-pointer items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-sm text-foreground outline-none transition-colors data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50";
|
|
19
|
-
var MENU_LABEL = "flex items-center gap-1.5 px-2.5 pb-1 pt-1 text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground";
|
|
20
|
-
function Sidebar({ agents, teams, profiles, teamTemplates, selectedAgentId, initialOpenGroups }) {
|
|
21
|
-
const router = useRouter();
|
|
22
|
-
const [spawnProfile, setSpawnProfile] = useState(null);
|
|
23
|
-
const [spawnTemplate, setSpawnTemplate] = useState(null);
|
|
24
|
-
const [createTeamOpen, setCreateTeamOpen] = useState(false);
|
|
25
|
-
const [createTeamBusy, setCreateTeamBusy] = useState(false);
|
|
26
|
-
const [renameTarget, setRenameTarget] = useState(null);
|
|
27
|
-
const [archiveTarget, setArchiveTarget] = useState(null);
|
|
28
|
-
const [openGroups, setOpenGroups] = useState(initialOpenGroups);
|
|
29
|
-
const newButton = useRef(null);
|
|
30
|
-
const refocusNewButton = () => window.requestAnimationFrame(() => newButton.current?.focus());
|
|
31
|
-
const sortedProfiles = [...profiles].sort((a, b) => Number(b.id === DEFAULT_PROFILE_ID) - Number(a.id === DEFAULT_PROFILE_ID));
|
|
32
|
-
const sortedTeams = [...teams].sort((a, b) => Number(b.id === DEFAULT_TEAM_ID) - Number(a.id === DEFAULT_TEAM_ID));
|
|
33
|
-
const agentsByTeam = /* @__PURE__ */ new Map();
|
|
34
|
-
for (const agent of agents) agentsByTeam.set(agent.teamId, [...agentsByTeam.get(agent.teamId) ?? [], agent]);
|
|
35
|
-
const selectedTeamId = agents.find((agent) => agent.id === selectedAgentId)?.teamId ?? null;
|
|
36
|
-
return /* @__PURE__ */ jsxs("aside", {
|
|
37
|
-
className: "flex h-full flex-col overflow-hidden rounded-2xl border border-border bg-card shadow-baziu-sm",
|
|
38
|
-
children: [
|
|
39
|
-
/* @__PURE__ */ jsxs("header", {
|
|
40
|
-
className: "flex items-center justify-between gap-3 border-b border-border bg-muted/30 px-3 py-2.5",
|
|
41
|
-
children: [/* @__PURE__ */ jsxs("div", {
|
|
42
|
-
className: "min-w-0",
|
|
43
|
-
children: [/* @__PURE__ */ jsxs("div", {
|
|
44
|
-
className: "flex items-center gap-2 text-sm font-semibold text-foreground",
|
|
45
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
46
|
-
className: "flex size-7 items-center justify-center rounded-lg bg-accent text-accent-foreground",
|
|
47
|
-
children: /* @__PURE__ */ jsx(Bot, {
|
|
48
|
-
className: "size-4",
|
|
49
|
-
"aria-hidden": "true"
|
|
50
|
-
})
|
|
51
|
-
}), /* @__PURE__ */ jsx("span", { children: "Agents" })]
|
|
52
|
-
}), /* @__PURE__ */ jsxs("p", {
|
|
53
|
-
className: "mt-0.5 truncate pl-9 text-xs text-muted-foreground",
|
|
54
|
-
children: [
|
|
55
|
-
agents.length,
|
|
56
|
-
" agent",
|
|
57
|
-
agents.length === 1 ? "" : "s",
|
|
58
|
-
" across ",
|
|
59
|
-
teams.length,
|
|
60
|
-
" team",
|
|
61
|
-
teams.length === 1 ? "" : "s"
|
|
62
|
-
]
|
|
63
|
-
})]
|
|
64
|
-
}), /* @__PURE__ */ jsxs(DropdownMenu.Root, {
|
|
65
|
-
modal: false,
|
|
66
|
-
children: [/* @__PURE__ */ jsx(DropdownMenu.Trigger, {
|
|
67
|
-
asChild: true,
|
|
68
|
-
children: /* @__PURE__ */ jsxs("button", {
|
|
69
|
-
ref: newButton,
|
|
70
|
-
type: "button",
|
|
71
|
-
"aria-label": "Create a new Agent or Team",
|
|
72
|
-
className: "unstyled group inline-flex h-8 items-center gap-1 rounded-lg border border-border bg-card px-2.5 text-xs font-semibold text-foreground shadow-baziu-sm transition-colors hover:border-primary/30 hover:bg-accent hover:text-accent-foreground",
|
|
73
|
-
children: [
|
|
74
|
-
/* @__PURE__ */ jsx(Plus, {
|
|
75
|
-
className: "size-3.5",
|
|
76
|
-
"aria-hidden": "true"
|
|
77
|
-
}),
|
|
78
|
-
"New",
|
|
79
|
-
/* @__PURE__ */ jsx(ChevronDown, {
|
|
80
|
-
className: "size-3.5 text-muted-foreground transition-transform group-data-[state=open]:rotate-180",
|
|
81
|
-
"aria-hidden": "true"
|
|
82
|
-
})
|
|
83
|
-
]
|
|
84
|
-
})
|
|
85
|
-
}), /* @__PURE__ */ jsx(DropdownMenu.Portal, { children: /* @__PURE__ */ jsxs(DropdownMenu.Content, {
|
|
86
|
-
align: "end",
|
|
87
|
-
sideOffset: 6,
|
|
88
|
-
className: "z-50 w-60 rounded-xl border border-border bg-popover p-1.5 text-popover-foreground shadow-baziu-lg outline-none",
|
|
89
|
-
children: [
|
|
90
|
-
/* @__PURE__ */ jsxs(DropdownMenu.Label, {
|
|
91
|
-
className: MENU_LABEL,
|
|
92
|
-
children: [/* @__PURE__ */ jsx(Bot, {
|
|
93
|
-
className: "size-3",
|
|
94
|
-
"aria-hidden": "true"
|
|
95
|
-
}), "Agent templates"]
|
|
96
|
-
}),
|
|
97
|
-
sortedProfiles.length === 0 ? /* @__PURE__ */ jsx(DropdownMenu.Item, {
|
|
98
|
-
asChild: true,
|
|
99
|
-
className: MENU_ITEM,
|
|
100
|
-
children: /* @__PURE__ */ jsx("a", {
|
|
101
|
-
href: "/templates/agents",
|
|
102
|
-
children: "Create an Agent template"
|
|
103
|
-
})
|
|
104
|
-
}) : sortedProfiles.map((profile) => /* @__PURE__ */ jsxs(DropdownMenu.Item, {
|
|
105
|
-
className: MENU_ITEM,
|
|
106
|
-
onSelect: () => setSpawnProfile(profile.id),
|
|
107
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
108
|
-
className: "min-w-0 flex-1 truncate",
|
|
109
|
-
children: profile.name || profile.id
|
|
110
|
-
}), profile.id === "default" && /* @__PURE__ */ jsx("span", {
|
|
111
|
-
className: "rounded-full border border-border bg-muted px-1.5 py-0.5 text-xs font-semibold text-muted-foreground",
|
|
112
|
-
children: "Default"
|
|
113
|
-
})]
|
|
114
|
-
}, profile.id)),
|
|
115
|
-
/* @__PURE__ */ jsx(DropdownMenu.Separator, { className: "my-1.5 h-px bg-border" }),
|
|
116
|
-
/* @__PURE__ */ jsxs(DropdownMenu.Label, {
|
|
117
|
-
className: MENU_LABEL,
|
|
118
|
-
children: [/* @__PURE__ */ jsx(UsersRound, {
|
|
119
|
-
className: "size-3",
|
|
120
|
-
"aria-hidden": "true"
|
|
121
|
-
}), "Team templates"]
|
|
122
|
-
}),
|
|
123
|
-
teamTemplates.length === 0 ? /* @__PURE__ */ jsx(DropdownMenu.Item, {
|
|
124
|
-
asChild: true,
|
|
125
|
-
className: MENU_ITEM,
|
|
126
|
-
children: /* @__PURE__ */ jsx("a", {
|
|
127
|
-
href: "/templates/teams",
|
|
128
|
-
children: "Create a Team template"
|
|
129
|
-
})
|
|
130
|
-
}) : teamTemplates.map((template) => /* @__PURE__ */ jsxs(DropdownMenu.Item, {
|
|
131
|
-
className: MENU_ITEM,
|
|
132
|
-
disabled: template.slots.length === 0,
|
|
133
|
-
title: template.slots.length === 0 ? "Add at least one member before spawning" : void 0,
|
|
134
|
-
onSelect: () => setSpawnTemplate(template),
|
|
135
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
136
|
-
className: "min-w-0 flex-1 truncate",
|
|
137
|
-
children: template.name || template.id
|
|
138
|
-
}), /* @__PURE__ */ jsx("span", {
|
|
139
|
-
className: "inline-flex min-w-6 items-center justify-center rounded-full bg-muted px-1.5 font-mono text-xs text-muted-foreground",
|
|
140
|
-
children: template.slots.length
|
|
141
|
-
})]
|
|
142
|
-
}, template.id)),
|
|
143
|
-
/* @__PURE__ */ jsx(DropdownMenu.Separator, { className: "my-1.5 h-px bg-border" }),
|
|
144
|
-
/* @__PURE__ */ jsxs(DropdownMenu.Item, {
|
|
145
|
-
className: MENU_ITEM,
|
|
146
|
-
onSelect: () => setCreateTeamOpen(true),
|
|
147
|
-
children: [/* @__PURE__ */ jsx(Plus, {
|
|
148
|
-
className: "size-3.5",
|
|
149
|
-
"aria-hidden": "true"
|
|
150
|
-
}), "Create a team"]
|
|
151
|
-
})
|
|
152
|
-
]
|
|
153
|
-
}) })]
|
|
154
|
-
})]
|
|
155
|
-
}),
|
|
156
|
-
/* @__PURE__ */ jsx("nav", {
|
|
157
|
-
className: "flex-1 overflow-y-auto p-1.5",
|
|
158
|
-
"aria-label": "Teams and agents",
|
|
159
|
-
children: agents.length === 0 ? /* @__PURE__ */ jsxs("div", {
|
|
160
|
-
className: "m-1 flex flex-col items-center rounded-xl border border-dashed border-border bg-muted/30 px-4 py-6 text-center",
|
|
161
|
-
children: [
|
|
162
|
-
/* @__PURE__ */ jsx("p", {
|
|
163
|
-
className: "text-sm font-semibold text-foreground",
|
|
164
|
-
children: "No agents yet"
|
|
165
|
-
}),
|
|
166
|
-
/* @__PURE__ */ jsx("p", {
|
|
167
|
-
className: "mt-1 text-xs leading-5 text-muted-foreground",
|
|
168
|
-
children: "Your default Team is ready. Spawn the first agent to start a conversation."
|
|
169
|
-
}),
|
|
170
|
-
sortedProfiles[0] ? /* @__PURE__ */ jsx(Button, {
|
|
171
|
-
variant: "primary",
|
|
172
|
-
className: "mt-3",
|
|
173
|
-
onClick: () => setSpawnProfile(sortedProfiles[0]?.id ?? "default"),
|
|
174
|
-
children: "Spawn first agent"
|
|
175
|
-
}) : /* @__PURE__ */ jsx("a", {
|
|
176
|
-
href: "/templates/agents",
|
|
177
|
-
className: "mt-3 text-xs font-semibold",
|
|
178
|
-
children: "Create an Agent template"
|
|
179
|
-
})
|
|
180
|
-
]
|
|
181
|
-
}) : sortedTeams.map((team) => {
|
|
182
|
-
const teamAgents = agentsByTeam.get(team.id) ?? [];
|
|
183
|
-
const containsSelected = selectedTeamId === team.id;
|
|
184
|
-
const open = openGroups[team.id] ?? (containsSelected || team.id === "default");
|
|
185
|
-
return /* @__PURE__ */ jsxs("details", {
|
|
186
|
-
open,
|
|
187
|
-
onToggle: (event) => {
|
|
188
|
-
const next = event.currentTarget.open;
|
|
189
|
-
if (next === open) return;
|
|
190
|
-
const merged = {
|
|
191
|
-
...openGroups,
|
|
192
|
-
[team.id]: next
|
|
193
|
-
};
|
|
194
|
-
writeOpenGroupsCookie(merged);
|
|
195
|
-
setOpenGroups(merged);
|
|
196
|
-
},
|
|
197
|
-
className: "group/details mb-1 last:mb-0",
|
|
198
|
-
children: [/* @__PURE__ */ jsxs("summary", {
|
|
199
|
-
className: `flex min-h-8 cursor-pointer list-none items-center gap-1.5 rounded-lg px-2 py-1.5 text-sm transition-colors hover:bg-accent hover:text-accent-foreground ${containsSelected ? "bg-muted/60 text-foreground" : "text-muted-foreground"}`,
|
|
200
|
-
children: [
|
|
201
|
-
/* @__PURE__ */ jsx(ChevronRight, {
|
|
202
|
-
className: "size-3.5 shrink-0 transition-transform group-open/details:rotate-90",
|
|
203
|
-
"aria-hidden": "true"
|
|
204
|
-
}),
|
|
205
|
-
/* @__PURE__ */ jsx("span", {
|
|
206
|
-
className: "flex size-5 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground",
|
|
207
|
-
children: /* @__PURE__ */ jsx(UsersRound, {
|
|
208
|
-
className: "size-3",
|
|
209
|
-
"aria-hidden": "true"
|
|
210
|
-
})
|
|
211
|
-
}),
|
|
212
|
-
/* @__PURE__ */ jsx("span", {
|
|
213
|
-
className: "min-w-0 flex-1 truncate font-medium",
|
|
214
|
-
children: team.name
|
|
215
|
-
}),
|
|
216
|
-
team.id === "default" && /* @__PURE__ */ jsx("span", {
|
|
217
|
-
className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground",
|
|
218
|
-
children: "Default"
|
|
219
|
-
}),
|
|
220
|
-
/* @__PURE__ */ jsx("span", {
|
|
221
|
-
className: "inline-flex min-w-6 items-center justify-center rounded-full border border-border bg-card px-1.5 font-mono text-xs text-muted-foreground",
|
|
222
|
-
children: teamAgents.length
|
|
223
|
-
})
|
|
224
|
-
]
|
|
225
|
-
}), teamAgents.length === 0 ? /* @__PURE__ */ jsx("div", {
|
|
226
|
-
className: "py-2 pl-12 pr-2 text-xs text-muted-foreground",
|
|
227
|
-
children: "No agents in this team"
|
|
228
|
-
}) : /* @__PURE__ */ jsx("div", {
|
|
229
|
-
className: "space-y-0.5 py-0.5 pl-2",
|
|
230
|
-
children: teamAgents.map((agent) => /* @__PURE__ */ jsx(AgentRow, {
|
|
231
|
-
agent,
|
|
232
|
-
selected: agent.id === selectedAgentId,
|
|
233
|
-
onRename: () => setRenameTarget(agent),
|
|
234
|
-
onArchive: () => setArchiveTarget(agent)
|
|
235
|
-
}, agent.id))
|
|
236
|
-
})]
|
|
237
|
-
}, team.id);
|
|
238
|
-
})
|
|
239
|
-
}),
|
|
240
|
-
spawnProfile && /* @__PURE__ */ jsx(SpawnDialog, {
|
|
241
|
-
profiles: sortedProfiles,
|
|
242
|
-
teams: sortedTeams,
|
|
243
|
-
profileId: spawnProfile,
|
|
244
|
-
onClose: () => {
|
|
245
|
-
setSpawnProfile(null);
|
|
246
|
-
refocusNewButton();
|
|
247
|
-
}
|
|
248
|
-
}),
|
|
249
|
-
spawnTemplate && /* @__PURE__ */ jsx(SpawnTeamModal, {
|
|
250
|
-
template: spawnTemplate,
|
|
251
|
-
teams: sortedTeams,
|
|
252
|
-
onClose: () => {
|
|
253
|
-
setSpawnTemplate(null);
|
|
254
|
-
refocusNewButton();
|
|
255
|
-
},
|
|
256
|
-
onSpawned: (slug) => {
|
|
257
|
-
setSpawnTemplate(null);
|
|
258
|
-
router.navigate({
|
|
259
|
-
to: "/teams/$id",
|
|
260
|
-
params: { id: slug }
|
|
261
|
-
});
|
|
262
|
-
}
|
|
263
|
-
}),
|
|
264
|
-
createTeamOpen && /* @__PURE__ */ jsx(Dialog$1, {
|
|
265
|
-
title: "Create a team",
|
|
266
|
-
description: "A Team is one workspace with its own USER.md, members and shared memory.",
|
|
267
|
-
busy: createTeamBusy,
|
|
268
|
-
onClose: () => {
|
|
269
|
-
setCreateTeamOpen(false);
|
|
270
|
-
refocusNewButton();
|
|
271
|
-
},
|
|
272
|
-
children: /* @__PURE__ */ jsx(TeamForm, {
|
|
273
|
-
onBusyChange: setCreateTeamBusy,
|
|
274
|
-
onCreated: async () => {
|
|
275
|
-
setCreateTeamOpen(false);
|
|
276
|
-
await router.invalidate();
|
|
277
|
-
},
|
|
278
|
-
extraActions: (busy) => /* @__PURE__ */ jsx(Button, {
|
|
279
|
-
variant: "ghost",
|
|
280
|
-
disabled: busy,
|
|
281
|
-
onClick: () => setCreateTeamOpen(false),
|
|
282
|
-
children: "Cancel"
|
|
283
|
-
})
|
|
284
|
-
})
|
|
285
|
-
}),
|
|
286
|
-
renameTarget && /* @__PURE__ */ jsx(RenameAgentDialog, {
|
|
287
|
-
agent: renameTarget,
|
|
288
|
-
onClose: () => setRenameTarget(null),
|
|
289
|
-
onRenamed: () => router.invalidate()
|
|
290
|
-
}),
|
|
291
|
-
/* @__PURE__ */ jsx(ConfirmDialog, {
|
|
292
|
-
open: archiveTarget !== null,
|
|
293
|
-
onOpenChange: (open) => {
|
|
294
|
-
if (!open) setArchiveTarget(null);
|
|
295
|
-
},
|
|
296
|
-
title: `Archive ${archiveTarget?.name ?? "agent"}?`,
|
|
297
|
-
description: /* @__PURE__ */ jsx("p", { children: "The Agent will stop appearing in this sidebar and cannot receive normal work. You can restore it later from the Agents page with “Show archived”." }),
|
|
298
|
-
confirmLabel: "Archive agent",
|
|
299
|
-
confirmVariant: "primary",
|
|
300
|
-
onConfirm: async () => {
|
|
301
|
-
if (!archiveTarget) return;
|
|
302
|
-
await archiveAgent(archiveTarget.id);
|
|
303
|
-
await router.invalidate();
|
|
304
|
-
}
|
|
305
|
-
})
|
|
306
|
-
]
|
|
307
|
-
});
|
|
308
|
-
}
|
|
309
|
-
function AgentRow({ agent, selected, onRename, onArchive }) {
|
|
310
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
311
|
-
className: "relative rounded-lg",
|
|
312
|
-
children: [/* @__PURE__ */ jsxs(Link, {
|
|
313
|
-
to: "/",
|
|
314
|
-
search: { agent: agent.id },
|
|
315
|
-
"aria-current": selected ? "page" : void 0,
|
|
316
|
-
className: `block min-h-11 rounded-lg border border-transparent py-1.5 pl-2.5 pr-[4.6rem] transition-colors hover:bg-accent/70 ${selected ? "border-primary/20 bg-accent text-accent-foreground shadow-baziu-sm" : "text-foreground"}`,
|
|
317
|
-
children: [/* @__PURE__ */ jsxs("div", {
|
|
318
|
-
className: "flex items-center gap-1.5 text-sm font-medium",
|
|
319
|
-
children: [
|
|
320
|
-
/* @__PURE__ */ jsx("span", {
|
|
321
|
-
className: `size-1.5 shrink-0 rounded-full ${selected ? "bg-primary" : "bg-border"}`,
|
|
322
|
-
"aria-hidden": "true"
|
|
323
|
-
}),
|
|
324
|
-
/* @__PURE__ */ jsx("span", {
|
|
325
|
-
className: "min-w-0 flex-1 truncate",
|
|
326
|
-
children: agent.name
|
|
327
|
-
}),
|
|
328
|
-
agent.telegramTopicId !== null && /* @__PURE__ */ jsx("span", {
|
|
329
|
-
className: "shrink-0 text-primary",
|
|
330
|
-
title: `Telegram topic #${agent.telegramTopicId}`,
|
|
331
|
-
role: "img",
|
|
332
|
-
"aria-label": `Bound to Telegram topic ${agent.telegramTopicId}`,
|
|
333
|
-
children: /* @__PURE__ */ jsx(Send, {
|
|
334
|
-
className: "size-3",
|
|
335
|
-
"aria-hidden": "true"
|
|
336
|
-
})
|
|
337
|
-
})
|
|
338
|
-
]
|
|
339
|
-
}), /* @__PURE__ */ jsxs("div", {
|
|
340
|
-
className: "mt-0.5 flex gap-2 pl-3 font-mono text-xs text-muted-foreground",
|
|
341
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
342
|
-
className: "uppercase tracking-wide",
|
|
343
|
-
children: agent.status
|
|
344
|
-
}), /* @__PURE__ */ jsx("span", { children: agent.id.slice(0, 8) })]
|
|
345
|
-
})]
|
|
346
|
-
}), /* @__PURE__ */ jsxs("div", {
|
|
347
|
-
className: "absolute right-1 top-1/2 z-10 flex -translate-y-1/2 gap-0.5",
|
|
348
|
-
children: [/* @__PURE__ */ jsx("button", {
|
|
349
|
-
type: "button",
|
|
350
|
-
onClick: onRename,
|
|
351
|
-
title: "Rename",
|
|
352
|
-
"aria-label": `Rename ${agent.name}`,
|
|
353
|
-
className: "unstyled flex size-8 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-card hover:text-primary focus-visible:bg-card",
|
|
354
|
-
children: /* @__PURE__ */ jsx(Pencil, {
|
|
355
|
-
className: "size-3.5",
|
|
356
|
-
"aria-hidden": "true"
|
|
357
|
-
})
|
|
358
|
-
}), /* @__PURE__ */ jsx("button", {
|
|
359
|
-
type: "button",
|
|
360
|
-
onClick: onArchive,
|
|
361
|
-
title: "Archive",
|
|
362
|
-
"aria-label": `Archive ${agent.name}`,
|
|
363
|
-
className: "unstyled flex size-8 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive focus-visible:bg-destructive/10 focus-visible:text-destructive",
|
|
364
|
-
children: /* @__PURE__ */ jsx(Archive, {
|
|
365
|
-
className: "size-3.5",
|
|
366
|
-
"aria-hidden": "true"
|
|
367
|
-
})
|
|
368
|
-
})]
|
|
369
|
-
})]
|
|
370
|
-
});
|
|
371
|
-
}
|
|
372
|
-
function RenameAgentDialog({ agent, onClose, onRenamed }) {
|
|
373
|
-
const [name, setName] = useState(agent.name);
|
|
374
|
-
const [busy, setBusy] = useState(false);
|
|
375
|
-
const [error, setError] = useState(null);
|
|
376
|
-
const unchanged = !name.trim() || name.trim() === agent.name;
|
|
377
|
-
async function submit(event) {
|
|
378
|
-
event.preventDefault();
|
|
379
|
-
if (unchanged) return;
|
|
380
|
-
setBusy(true);
|
|
381
|
-
setError(null);
|
|
382
|
-
try {
|
|
383
|
-
await renameAgent(agent.id, name.trim());
|
|
384
|
-
await onRenamed();
|
|
385
|
-
onClose();
|
|
386
|
-
} catch (cause) {
|
|
387
|
-
setError(errorMessage(cause));
|
|
388
|
-
setBusy(false);
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
return /* @__PURE__ */ jsx(Dialog$1, {
|
|
392
|
-
title: `Rename ${agent.name}`,
|
|
393
|
-
description: "This changes the display name only; the Agent ID and history stay the same.",
|
|
394
|
-
busy,
|
|
395
|
-
onClose,
|
|
396
|
-
className: "max-w-md",
|
|
397
|
-
children: /* @__PURE__ */ jsxs("form", {
|
|
398
|
-
onSubmit: (event) => void submit(event),
|
|
399
|
-
children: [
|
|
400
|
-
/* @__PURE__ */ jsxs("label", { children: ["Agent name", /* @__PURE__ */ jsx("input", {
|
|
401
|
-
autoFocus: true,
|
|
402
|
-
value: name,
|
|
403
|
-
onChange: (event) => setName(event.target.value),
|
|
404
|
-
maxLength: 120
|
|
405
|
-
})] }),
|
|
406
|
-
error && /* @__PURE__ */ jsx("p", {
|
|
407
|
-
role: "alert",
|
|
408
|
-
className: "mt-3 text-sm text-danger",
|
|
409
|
-
children: error
|
|
410
|
-
}),
|
|
411
|
-
/* @__PURE__ */ jsx("div", {
|
|
412
|
-
className: "mt-4",
|
|
413
|
-
children: /* @__PURE__ */ jsxs(DialogActions, { children: [/* @__PURE__ */ jsx(Button, {
|
|
414
|
-
variant: "ghost",
|
|
415
|
-
disabled: busy,
|
|
416
|
-
onClick: onClose,
|
|
417
|
-
children: "Cancel"
|
|
418
|
-
}), /* @__PURE__ */ jsx(Button, {
|
|
419
|
-
variant: "primary",
|
|
420
|
-
type: "submit",
|
|
421
|
-
disabled: busy || unchanged,
|
|
422
|
-
children: busy ? "Renaming…" : "Rename agent"
|
|
423
|
-
})] })
|
|
424
|
-
})
|
|
425
|
-
]
|
|
426
|
-
})
|
|
427
|
-
});
|
|
428
|
-
}
|
|
429
|
-
//#endregion
|
|
430
|
-
export { Sidebar as n, SIDEBAR_OPEN_GROUPS_COOKIE as t };
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { i as errorMessage, n as api, o as Button } from "./api-WWxPqx67.js";
|
|
2
|
-
import { n as Dialog, r as DialogActions } from "./ConfirmDialog-LdVlEanK.js";
|
|
3
|
-
import { useState } from "react";
|
|
4
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
//#region src/components/SpawnTeamModal.tsx
|
|
6
|
-
/** Spawn a Team template's Agents and allow edges into a new or existing Team. */
|
|
7
|
-
function SpawnTeamModal({ template, teams, initialTeamId = "", onClose, onSpawned }) {
|
|
8
|
-
const [teamId, setTeamId] = useState(initialTeamId);
|
|
9
|
-
const [userMd, setUserMd] = useState("");
|
|
10
|
-
const [error, setError] = useState(null);
|
|
11
|
-
const [busy, setBusy] = useState(false);
|
|
12
|
-
const target = teamId.trim();
|
|
13
|
-
const existing = teams.some((team) => team.id === target);
|
|
14
|
-
async function spawn(event) {
|
|
15
|
-
event.preventDefault();
|
|
16
|
-
setBusy(true);
|
|
17
|
-
setError(null);
|
|
18
|
-
try {
|
|
19
|
-
await api(`/api/team-templates/${encodeURIComponent(template.id)}/spawn`, { body: {
|
|
20
|
-
teamId: target,
|
|
21
|
-
...userMd && !existing ? { userMd } : {}
|
|
22
|
-
} });
|
|
23
|
-
onSpawned(target);
|
|
24
|
-
} catch (cause) {
|
|
25
|
-
setError(errorMessage(cause));
|
|
26
|
-
} finally {
|
|
27
|
-
setBusy(false);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return /* @__PURE__ */ jsx(Dialog, {
|
|
31
|
-
title: `Spawn team: ${template.name}`,
|
|
32
|
-
description: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
33
|
-
"Creates ",
|
|
34
|
-
template.slots.length,
|
|
35
|
-
" Agent",
|
|
36
|
-
template.slots.length === 1 ? "" : "s",
|
|
37
|
-
" and",
|
|
38
|
-
" ",
|
|
39
|
-
template.edges.length,
|
|
40
|
-
" allow edge",
|
|
41
|
-
template.edges.length === 1 ? "" : "s",
|
|
42
|
-
". An unknown slug creates a new ",
|
|
43
|
-
template.policyMode,
|
|
44
|
-
" Team; an existing Team keeps its mode."
|
|
45
|
-
] }),
|
|
46
|
-
busy,
|
|
47
|
-
onClose,
|
|
48
|
-
children: /* @__PURE__ */ jsxs("form", {
|
|
49
|
-
onSubmit: (event) => void spawn(event),
|
|
50
|
-
children: [
|
|
51
|
-
/* @__PURE__ */ jsxs("label", { children: [
|
|
52
|
-
"Target Team slug",
|
|
53
|
-
/* @__PURE__ */ jsx("input", {
|
|
54
|
-
value: teamId,
|
|
55
|
-
onChange: (event) => setTeamId(event.target.value),
|
|
56
|
-
list: "spawn-team-targets",
|
|
57
|
-
required: true
|
|
58
|
-
}),
|
|
59
|
-
/* @__PURE__ */ jsx("datalist", {
|
|
60
|
-
id: "spawn-team-targets",
|
|
61
|
-
children: teams.map((team) => /* @__PURE__ */ jsx("option", {
|
|
62
|
-
value: team.id,
|
|
63
|
-
children: team.name
|
|
64
|
-
}, team.id))
|
|
65
|
-
})
|
|
66
|
-
] }),
|
|
67
|
-
!existing && /* @__PURE__ */ jsxs("label", { children: ["Starter USER.md (new Team only; defaults to the template's)", /* @__PURE__ */ jsx("textarea", {
|
|
68
|
-
rows: 3,
|
|
69
|
-
value: userMd,
|
|
70
|
-
onChange: (event) => setUserMd(event.target.value),
|
|
71
|
-
className: "font-mono text-[0.88em] leading-[1.55]"
|
|
72
|
-
})] }),
|
|
73
|
-
error && /* @__PURE__ */ jsx("p", {
|
|
74
|
-
role: "alert",
|
|
75
|
-
className: "err mt-2",
|
|
76
|
-
children: error
|
|
77
|
-
}),
|
|
78
|
-
/* @__PURE__ */ jsx("div", {
|
|
79
|
-
className: "mt-4",
|
|
80
|
-
children: /* @__PURE__ */ jsxs(DialogActions, { children: [/* @__PURE__ */ jsx(Button, {
|
|
81
|
-
variant: "ghost",
|
|
82
|
-
disabled: busy,
|
|
83
|
-
onClick: onClose,
|
|
84
|
-
children: "Cancel"
|
|
85
|
-
}), /* @__PURE__ */ jsx(Button, {
|
|
86
|
-
variant: "primary",
|
|
87
|
-
type: "submit",
|
|
88
|
-
disabled: busy || !target || template.slots.length === 0,
|
|
89
|
-
children: busy ? "Spawning…" : "Spawn team"
|
|
90
|
-
})] })
|
|
91
|
-
})
|
|
92
|
-
]
|
|
93
|
-
})
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
//#endregion
|
|
97
|
-
export { SpawnTeamModal as t };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { t as Route } from "./_id-Y5ctILG2.js";
|
|
2
|
-
import { t as ChatPane } from "./ChatPane-De_FPEoD.js";
|
|
3
|
-
import { getRouteApi } from "@tanstack/react-router";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
//#region src/routes/agents/$id/index.tsx?tsr-split=component
|
|
6
|
-
var agentRoute = getRouteApi("/agents/$id");
|
|
7
|
-
function AgentChatPage() {
|
|
8
|
-
const { agent } = agentRoute.useLoaderData();
|
|
9
|
-
const { messages, head } = Route.useLoaderData();
|
|
10
|
-
const { conversation } = Route.useSearch();
|
|
11
|
-
return /* @__PURE__ */ jsx("div", {
|
|
12
|
-
className: "h-[70vh]",
|
|
13
|
-
children: /* @__PURE__ */ jsx(ChatPane, {
|
|
14
|
-
agentId: agent.id,
|
|
15
|
-
agentName: agent.name,
|
|
16
|
-
initialMessages: messages,
|
|
17
|
-
initialSessionHead: head,
|
|
18
|
-
openConversationId: conversation
|
|
19
|
-
})
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
//#endregion
|
|
23
|
-
export { AgentChatPage as component };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { n as createServerFn } from "../server.js";
|
|
2
|
-
import { t as createSsrRpc } from "./createSsrRpc-6LHNEsSK.js";
|
|
3
|
-
import { createFileRoute, lazyRouteComponent } from "@tanstack/react-router";
|
|
4
|
-
//#region src/routes/teams/$id/index.tsx
|
|
5
|
-
var $$splitComponentImporter = () => import("./_id-D5UCoyES.js");
|
|
6
|
-
var fetchContext = createServerFn({ method: "GET" }).validator((data) => data).handler(createSsrRpc("d821ed23cd43821db345683976465a24f170589df68088bb55f750bfe15c26f4"));
|
|
7
|
-
var Route = createFileRoute("/teams/$id/")({
|
|
8
|
-
loader: ({ params }) => fetchContext({ data: { id: params.id } }),
|
|
9
|
-
component: lazyRouteComponent($$splitComponentImporter, "component")
|
|
10
|
-
});
|
|
11
|
-
/** An empty Team offers its Team templates; the spawn itself is the shared spawn dialog. */
|
|
12
|
-
//#endregion
|
|
13
|
-
export { Route as t };
|