bazilion 0.5.0 → 0.6.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/README.md +14 -9
- package/dist/cli.js +365 -140
- package/dist/cli.js.map +1 -1
- package/dist/daemon.js +4452 -16989
- package/dist/daemon.js.map +1 -1
- package/dist/web/client/assets/AgentAvatar-Cq7PVBE_.js +1 -0
- package/dist/web/client/assets/AgentTabs-M5K8emJ8.js +1 -0
- package/dist/web/client/assets/Button-BefUtjMZ.js +1 -0
- package/dist/web/client/assets/ChatPane-C8zQfpzH.js +74 -0
- package/dist/web/client/assets/ConfigTabs-DRqAymcN.js +1 -0
- package/dist/web/client/assets/FieldRow-BqWnxZiX.js +1 -0
- package/dist/web/client/assets/MembersEditor-B-47GLUb.js +1 -0
- package/dist/web/client/assets/SpawnTeamModal-DiiC7Nc0.js +1 -0
- package/dist/web/client/assets/TemplatesTabs-DB4KERTQ.js +1 -0
- package/dist/web/client/assets/_id-B7gv1aPQ.js +1 -0
- package/dist/web/client/assets/_id-C7d1AqS0.js +1 -0
- package/dist/web/client/assets/_id-DhiwjC8u.js +1 -0
- package/dist/web/client/assets/_id-p8lUuNFm.js +1 -0
- package/dist/web/client/assets/agents-v8G-wt0M.js +1 -0
- package/dist/web/client/assets/config-BdmYpS_y.js +3 -0
- package/dist/web/client/assets/groups-DiY_ExGM.js +1 -0
- package/dist/web/client/assets/inbox-DtfVx246.js +1 -0
- package/dist/web/client/assets/index-BQUL6oyH.js +12 -0
- package/dist/web/client/assets/login-CVS70W9g.js +1 -0
- package/dist/web/client/assets/mcp-BDLQq8OZ.js +1 -0
- package/dist/web/client/assets/memory-6GGuAXwx.js +1 -0
- package/dist/web/client/assets/profile-groups-BA8rwZMA.js +1 -0
- package/dist/web/client/assets/profiles-C0aAcPZg.js +1 -0
- package/dist/web/client/assets/routes-DgAhnKFw.js +1 -0
- package/dist/web/client/assets/services-BZ86QEah.js +1 -0
- package/dist/web/client/assets/skills-mv_NNNwo.js +1 -0
- package/dist/web/client/assets/styles-CmqUskDu.css +2 -0
- package/dist/web/client/assets/telegram-5f9WXs3x.js +1 -0
- package/dist/web/client/assets/tokens-DHiYsFUh.js +1 -0
- package/dist/web/client/assets/triggers-CjC8Ljrz.js +1 -0
- package/dist/web/client/assets/welcome-C-Cu-ziL.js +1 -0
- package/dist/web/client/assets/wire-constants-BkT5-597.js +1 -0
- package/dist/web/client/baziu.svg +8 -0
- package/dist/web/server/assets/AgentAvatar-8gTAy_tP.js +37 -0
- package/dist/web/server/assets/AgentTabs-BOjTN7QF.js +34 -0
- package/dist/web/server/assets/Button-Dsnw22OF.js +17 -0
- package/dist/web/server/assets/ChatPane-BvpswYvF.js +1084 -0
- package/dist/web/server/assets/ConfigTabs-CyuxzesF.js +41 -0
- package/dist/web/server/assets/FieldRow-DwyqycWI.js +94 -0
- package/dist/web/server/assets/MembersEditor-BWQztvrX.js +131 -0
- package/dist/web/server/assets/Sidebar-DmEiewRN.js +529 -0
- package/dist/web/server/assets/SpawnTeamModal-dSN421k_.js +107 -0
- package/dist/web/server/assets/TemplatesTabs---7h5GYa.js +30 -0
- package/dist/web/server/assets/_id-BZ-YCWSw.js +16 -0
- package/dist/web/server/assets/_id-Bm4-_AP-.js +367 -0
- package/dist/web/server/assets/_id-C78M9_j9.js +12 -0
- package/dist/web/server/assets/_id-CGZbudCl.js +28 -0
- package/dist/web/server/assets/_id-CHNm7EAd.js +161 -0
- package/dist/web/server/assets/_id-CrQbC5L8.js +16 -0
- package/dist/web/server/assets/_id-Crcw2HhT.js +38 -0
- package/dist/web/server/assets/_id-CvIGhq4U.js +16 -0
- package/dist/web/server/assets/_id-DF3pfi9M.js +27 -0
- package/dist/web/server/assets/_id-Dc8P9sy2.js +24 -0
- package/dist/web/server/assets/_id-GJk3EYTT.js +662 -0
- package/dist/web/server/assets/_id-pd4S7LTi.js +467 -0
- package/dist/web/server/assets/_tanstack-start-manifest_v-CPyKYMJg.js +174 -0
- package/dist/web/server/assets/agents-70EwQJR6.js +210 -0
- package/dist/web/server/assets/agents-Ds4lcREv.js +26 -0
- package/dist/web/server/assets/agents-K4Smhnq3.js +14 -0
- package/dist/web/server/assets/auth-DpAGLHpA.js +26 -0
- package/dist/web/server/assets/config-CMXUx_IF.js +19 -0
- package/dist/web/server/assets/config-DQbCsY_l.js +382 -0
- package/dist/web/server/assets/config-DxCGYgR9.js +12 -0
- package/dist/web/server/assets/createServerRpc-CBTntoKx.js +12 -0
- package/dist/web/server/assets/createSsrRpc-DHBVUN8O.js +16 -0
- package/dist/web/server/assets/daemon-client-2NRMzlTr.js +96 -0
- package/dist/web/server/assets/empty-plugin-adapters-Bos_V2s-.js +5 -0
- package/dist/web/server/assets/groups-CXVew7BP.js +150 -0
- package/dist/web/server/assets/groups-Cms8cvH5.js +12 -0
- package/dist/web/server/assets/groups-Dmcvw5ya.js +21 -0
- package/dist/web/server/assets/inbox-0QfwsrGo.js +27 -0
- package/dist/web/server/assets/inbox-8HybA2Ws.js +133 -0
- package/dist/web/server/assets/inbox-B7UWoICA.js +42 -0
- package/dist/web/server/assets/login-CNznncgA.js +58 -0
- package/dist/web/server/assets/login-CQybKk7Y.js +74 -0
- package/dist/web/server/assets/mcp-42BrkI1I.js +12 -0
- package/dist/web/server/assets/mcp-DIa0kIOf.js +268 -0
- package/dist/web/server/assets/mcp-DsTjY3uz.js +12 -0
- package/dist/web/server/assets/memory-BfrMp8iY.js +284 -0
- package/dist/web/server/assets/memory-Dr0lOM2y.js +28 -0
- package/dist/web/server/assets/memory-EEgLDfCj.js +16 -0
- package/dist/web/server/assets/profile-groups-BW5gU-fG.js +12 -0
- package/dist/web/server/assets/profile-groups-B_kIT6BU.js +208 -0
- package/dist/web/server/assets/profile-groups-C5isDI2t.js +28 -0
- package/dist/web/server/assets/profiles-BP1v-jna.js +453 -0
- package/dist/web/server/assets/profiles-BbPTpmyq.js +26 -0
- package/dist/web/server/assets/profiles-Cy5auEj8.js +12 -0
- package/dist/web/server/assets/router-CL100-Ly.js +460 -0
- package/dist/web/server/assets/routes-CzJLQxcS.js +14 -0
- package/dist/web/server/assets/routes-D2H1Hnoh.js +57 -0
- package/dist/web/server/assets/routes-Dzk8jvIo.js +33 -0
- package/dist/web/server/assets/services-Bgj6M2gC.js +12 -0
- package/dist/web/server/assets/services-DEgYsWJ4.js +17 -0
- package/dist/web/server/assets/services-DFenjiw0.js +94 -0
- package/dist/web/server/assets/skills-BASIP_rT.js +12 -0
- package/dist/web/server/assets/skills-C-JPRCHh.js +12 -0
- package/dist/web/server/assets/skills-DZXN680t.js +261 -0
- package/dist/web/server/assets/start-cOXH7eTI.js +4 -0
- package/dist/web/server/assets/telegram-BbvqVWxa.js +583 -0
- package/dist/web/server/assets/telegram-Bq49AtnP.js +12 -0
- package/dist/web/server/assets/telegram-sUckI94O.js +12 -0
- package/dist/web/server/assets/tokens-BERRE0wB.js +14 -0
- package/dist/web/server/assets/tokens-CImgxhDI.js +193 -0
- package/dist/web/server/assets/tokens-Dwn00iV7.js +12 -0
- package/dist/web/server/assets/triggers-DtexqbNH.js +16 -0
- package/dist/web/server/assets/triggers-TyIjwSYn.js +26 -0
- package/dist/web/server/assets/triggers-_iSeahif.js +191 -0
- package/dist/web/server/assets/welcome-BkQ9NC5K.js +81 -0
- package/dist/web/server/assets/wire-constants-Deb4NxBb.js +16 -0
- package/dist/web/server/server.js +5899 -0
- package/dist/web-server.js +42 -0
- package/dist/web-server.js.map +1 -0
- package/package.json +10 -4
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { t as createServerFn } from "../server.js";
|
|
2
|
+
import { t as createServerRpc } from "./createServerRpc-CBTntoKx.js";
|
|
3
|
+
import { n as daemonClient } from "./daemon-client-2NRMzlTr.js";
|
|
4
|
+
//#region src/routes/profiles/index.tsx?tss-serverfn-split
|
|
5
|
+
var fetchProfiles_createServerFn_handler = createServerRpc({
|
|
6
|
+
id: "d3850ae8e275fc6af55540b50dd3cc6e84712ae5b9621a8a79b24514a1271cfb",
|
|
7
|
+
name: "fetchProfiles",
|
|
8
|
+
filename: "src/routes/profiles/index.tsx"
|
|
9
|
+
}, (opts) => fetchProfiles.__executeServer(opts));
|
|
10
|
+
var fetchProfiles = createServerFn({ method: "GET" }).handler(fetchProfiles_createServerFn_handler, async () => {
|
|
11
|
+
const c = daemonClient();
|
|
12
|
+
const [profiles, models, skills, templates] = await Promise.all([
|
|
13
|
+
c.get("/api/profiles"),
|
|
14
|
+
c.get("/api/config/available-models"),
|
|
15
|
+
c.get("/api/skills"),
|
|
16
|
+
c.get("/api/profiles/_/templates")
|
|
17
|
+
]);
|
|
18
|
+
return {
|
|
19
|
+
profiles,
|
|
20
|
+
modelGroups: models.groups,
|
|
21
|
+
skills,
|
|
22
|
+
templates
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
//#endregion
|
|
26
|
+
export { fetchProfiles_createServerFn_handler };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { t as createServerFn } from "../server.js";
|
|
2
|
+
import { t as createSsrRpc } from "./createSsrRpc-DHBVUN8O.js";
|
|
3
|
+
import { createFileRoute, lazyRouteComponent } from "@tanstack/react-router";
|
|
4
|
+
//#region src/routes/profiles/index.tsx
|
|
5
|
+
var $$splitComponentImporter = () => import("./profiles-BP1v-jna.js");
|
|
6
|
+
var fetchProfiles = createServerFn({ method: "GET" }).handler(createSsrRpc("d3850ae8e275fc6af55540b50dd3cc6e84712ae5b9621a8a79b24514a1271cfb"));
|
|
7
|
+
var Route = createFileRoute("/profiles/")({
|
|
8
|
+
loader: () => fetchProfiles(),
|
|
9
|
+
component: lazyRouteComponent($$splitComponentImporter, "component")
|
|
10
|
+
});
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Route as t };
|
|
@@ -0,0 +1,460 @@
|
|
|
1
|
+
import { i as getCookie, t as createServerFn } from "../server.js";
|
|
2
|
+
import { t as DAEMON_BASE_URL } from "./daemon-client-2NRMzlTr.js";
|
|
3
|
+
import { n as BaziuLogo, r as PawIcon, t as Route$3 } from "./login-CNznncgA.js";
|
|
4
|
+
import { t as createSsrRpc } from "./createSsrRpc-DHBVUN8O.js";
|
|
5
|
+
import { t as Route$4 } from "./routes-CzJLQxcS.js";
|
|
6
|
+
import { t as Route$5 } from "./skills-C-JPRCHh.js";
|
|
7
|
+
import { t as Route$6 } from "./profiles-Cy5auEj8.js";
|
|
8
|
+
import { t as Route$7 } from "./profile-groups-BW5gU-fG.js";
|
|
9
|
+
import { t as Route$8 } from "./groups-Cms8cvH5.js";
|
|
10
|
+
import { t as Route$9 } from "./config-DxCGYgR9.js";
|
|
11
|
+
import { t as Route$10 } from "./agents-K4Smhnq3.js";
|
|
12
|
+
import { t as Route$11 } from "./_id-CrQbC5L8.js";
|
|
13
|
+
import { t as Route$12 } from "./_id-C78M9_j9.js";
|
|
14
|
+
import { t as Route$13 } from "./tokens-BERRE0wB.js";
|
|
15
|
+
import { t as Route$14 } from "./services-DEgYsWJ4.js";
|
|
16
|
+
import { t as Route$15 } from "./mcp-42BrkI1I.js";
|
|
17
|
+
import { t as Route$16 } from "./_id-BZ-YCWSw.js";
|
|
18
|
+
import { t as Route$17 } from "./_id-CvIGhq4U.js";
|
|
19
|
+
import { t as Route$18 } from "./memory-EEgLDfCj.js";
|
|
20
|
+
import { t as Route$19 } from "./telegram-Bq49AtnP.js";
|
|
21
|
+
import { t as Route$20 } from "./triggers-DtexqbNH.js";
|
|
22
|
+
import { t as Route$21 } from "./inbox-0QfwsrGo.js";
|
|
23
|
+
import { useEffect, useState } from "react";
|
|
24
|
+
import { HeadContent, Link, Outlet, Scripts, createFileRoute, createRootRoute, createRouter, lazyRouteComponent, redirect, useRouterState } from "@tanstack/react-router";
|
|
25
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
26
|
+
import { Monitor, Moon, Sun } from "lucide-react";
|
|
27
|
+
//#region src/components/Footer.tsx
|
|
28
|
+
function Footer() {
|
|
29
|
+
return /* @__PURE__ */ jsxs("footer", {
|
|
30
|
+
className: "mt-16 border-t border-frost py-6 text-center text-[0.82em] text-fawn",
|
|
31
|
+
children: ["dedicated to Baziu", /* @__PURE__ */ jsx(PawIcon, { className: "ml-1 inline-block h-3 w-3 align-[-1px] opacity-40" })]
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/components/ThemeToggle.tsx
|
|
36
|
+
var STORAGE_KEY = "baziu-theme";
|
|
37
|
+
var ICONS = {
|
|
38
|
+
system: Monitor,
|
|
39
|
+
light: Sun,
|
|
40
|
+
dark: Moon
|
|
41
|
+
};
|
|
42
|
+
var NEXT = {
|
|
43
|
+
system: "light",
|
|
44
|
+
light: "dark",
|
|
45
|
+
dark: "system"
|
|
46
|
+
};
|
|
47
|
+
function readMode() {
|
|
48
|
+
if (typeof window === "undefined") return "system";
|
|
49
|
+
const v = window.localStorage.getItem(STORAGE_KEY);
|
|
50
|
+
return v === "light" || v === "dark" || v === "system" ? v : "system";
|
|
51
|
+
}
|
|
52
|
+
function applyMode(mode) {
|
|
53
|
+
const sysDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
54
|
+
const dark = mode === "dark" || mode === "system" && sysDark;
|
|
55
|
+
document.documentElement.classList.toggle("dark", dark);
|
|
56
|
+
}
|
|
57
|
+
function ThemeToggle() {
|
|
58
|
+
const [mode, setMode] = useState("system");
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
setMode(readMode());
|
|
61
|
+
}, []);
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
if (mode !== "system") return;
|
|
64
|
+
const mq = window.matchMedia("(prefers-color-scheme: dark)");
|
|
65
|
+
const onChange = () => applyMode("system");
|
|
66
|
+
mq.addEventListener("change", onChange);
|
|
67
|
+
return () => mq.removeEventListener("change", onChange);
|
|
68
|
+
}, [mode]);
|
|
69
|
+
const cycle = () => {
|
|
70
|
+
const next = NEXT[mode];
|
|
71
|
+
setMode(next);
|
|
72
|
+
window.localStorage.setItem(STORAGE_KEY, next);
|
|
73
|
+
applyMode(next);
|
|
74
|
+
};
|
|
75
|
+
const Icon = ICONS[mode];
|
|
76
|
+
const label = `Theme: ${mode}`;
|
|
77
|
+
return /* @__PURE__ */ jsx("button", {
|
|
78
|
+
type: "button",
|
|
79
|
+
onClick: cycle,
|
|
80
|
+
className: "unstyled rounded-md p-1.5 text-mocha transition-colors hover:bg-sapphire-glow hover:text-sapphire",
|
|
81
|
+
title: label,
|
|
82
|
+
"aria-label": label,
|
|
83
|
+
children: /* @__PURE__ */ jsx(Icon, { className: "h-4 w-4" })
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
//#endregion
|
|
87
|
+
//#region src/components/TopNav.tsx
|
|
88
|
+
var NAV_LINKS = [
|
|
89
|
+
{
|
|
90
|
+
to: "/profiles",
|
|
91
|
+
label: "templates"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
to: "/agents",
|
|
95
|
+
label: "agents"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
to: "/groups",
|
|
99
|
+
label: "groups"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
to: "/skills",
|
|
103
|
+
label: "skills"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
to: "/config",
|
|
107
|
+
label: "config"
|
|
108
|
+
}
|
|
109
|
+
];
|
|
110
|
+
function TopNav() {
|
|
111
|
+
return /* @__PURE__ */ jsxs("nav", {
|
|
112
|
+
className: "flex flex-wrap items-center gap-y-1 gap-x-1 border-b border-frost py-5",
|
|
113
|
+
children: [
|
|
114
|
+
/* @__PURE__ */ jsxs(Link, {
|
|
115
|
+
to: "/",
|
|
116
|
+
className: "logo group mr-6 flex items-center gap-[0.45rem] text-charcoal",
|
|
117
|
+
children: [/* @__PURE__ */ jsx(BaziuLogo, { className: "logo-paw h-[28px] w-[28px] transition-transform duration-300 group-hover:rotate-[-8deg] group-hover:scale-[1.08]" }), /* @__PURE__ */ jsx("span", {
|
|
118
|
+
className: "font-display text-[1.35rem] tracking-[-0.02em]",
|
|
119
|
+
children: "bazilion"
|
|
120
|
+
})]
|
|
121
|
+
}),
|
|
122
|
+
NAV_LINKS.map((link) => /* @__PURE__ */ jsx(Link, {
|
|
123
|
+
to: link.to,
|
|
124
|
+
className: "rounded-sm px-3 py-1.5 text-[0.92em] font-medium text-mocha transition-colors hover:bg-sapphire-glow hover:text-sapphire",
|
|
125
|
+
children: link.label
|
|
126
|
+
}, link.to)),
|
|
127
|
+
/* @__PURE__ */ jsx("div", {
|
|
128
|
+
className: "ml-auto",
|
|
129
|
+
children: /* @__PURE__ */ jsx(ThemeToggle, {})
|
|
130
|
+
})
|
|
131
|
+
]
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
//#endregion
|
|
135
|
+
//#region src/lib/auth.ts
|
|
136
|
+
var fetchAuthState = createServerFn({ method: "GET" }).handler(createSsrRpc("a5d3825fc69573bb55bab6df578c750ebb0240dd394c3acee3adea02918a5dc2"));
|
|
137
|
+
var PUBLIC_PATHS = new Set(["/login"]);
|
|
138
|
+
var SETUP_OPEN_PREFIXES = ["/welcome", "/config"];
|
|
139
|
+
function isSetupOpen(path) {
|
|
140
|
+
for (const prefix of SETUP_OPEN_PREFIXES) if (path === prefix || path.startsWith(`${prefix}/`)) return true;
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
143
|
+
//#endregion
|
|
144
|
+
//#region src/styles.css?url
|
|
145
|
+
var styles_default = "/assets/styles-CmqUskDu.css";
|
|
146
|
+
//#endregion
|
|
147
|
+
//#region src/routes/__root.tsx
|
|
148
|
+
var THEME_INIT_SCRIPT = `(function(){try{var t=localStorage.getItem('baziu-theme');var sd=window.matchMedia&&window.matchMedia('(prefers-color-scheme: dark)').matches;var d=t==='dark'||((t===null||t==='system')&&sd);document.documentElement.classList.toggle('dark',d);}catch(e){}})();`;
|
|
149
|
+
var Route$2 = createRootRoute({
|
|
150
|
+
beforeLoad: async ({ location }) => {
|
|
151
|
+
const path = location.pathname;
|
|
152
|
+
if (PUBLIC_PATHS.has(path)) return;
|
|
153
|
+
if (path.startsWith("/api/")) return;
|
|
154
|
+
const auth = await fetchAuthState();
|
|
155
|
+
if (!auth.authed) throw redirect({
|
|
156
|
+
to: "/login",
|
|
157
|
+
search: {}
|
|
158
|
+
});
|
|
159
|
+
if (!isSetupOpen(path) && !auth.setupComplete) throw redirect({ to: "/welcome" });
|
|
160
|
+
},
|
|
161
|
+
head: () => ({
|
|
162
|
+
meta: [
|
|
163
|
+
{ charSet: "utf-8" },
|
|
164
|
+
{
|
|
165
|
+
name: "viewport",
|
|
166
|
+
content: "width=device-width, initial-scale=1"
|
|
167
|
+
},
|
|
168
|
+
{ title: "bazilion" }
|
|
169
|
+
],
|
|
170
|
+
links: [
|
|
171
|
+
{
|
|
172
|
+
rel: "icon",
|
|
173
|
+
type: "image/svg+xml",
|
|
174
|
+
href: "/baziu.svg"
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
rel: "preconnect",
|
|
178
|
+
href: "https://fonts.googleapis.com"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
rel: "preconnect",
|
|
182
|
+
href: "https://fonts.gstatic.com",
|
|
183
|
+
crossOrigin: ""
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
rel: "stylesheet",
|
|
187
|
+
href: "https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=DM+Sans:ital,opsz,wght@0,9..40,300..700;1,9..40,300..700&family=JetBrains+Mono:wght@400;500&display=swap"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
rel: "stylesheet",
|
|
191
|
+
href: styles_default
|
|
192
|
+
}
|
|
193
|
+
]
|
|
194
|
+
}),
|
|
195
|
+
component: RootComponent,
|
|
196
|
+
notFoundComponent: NotFound
|
|
197
|
+
});
|
|
198
|
+
function NotFound() {
|
|
199
|
+
const pathname = useRouterState({ select: (s) => s.location.pathname });
|
|
200
|
+
return /* @__PURE__ */ jsx("div", {
|
|
201
|
+
className: "mx-auto max-w-2xl",
|
|
202
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
203
|
+
className: "card",
|
|
204
|
+
children: [
|
|
205
|
+
/* @__PURE__ */ jsx("h1", { children: "Not found" }),
|
|
206
|
+
/* @__PURE__ */ jsxs("p", {
|
|
207
|
+
className: "muted my-3",
|
|
208
|
+
children: [
|
|
209
|
+
"Nothing lives at ",
|
|
210
|
+
/* @__PURE__ */ jsx("code", { children: pathname }),
|
|
211
|
+
"."
|
|
212
|
+
]
|
|
213
|
+
}),
|
|
214
|
+
/* @__PURE__ */ jsx(Link, {
|
|
215
|
+
to: "/",
|
|
216
|
+
children: "Back to home"
|
|
217
|
+
})
|
|
218
|
+
]
|
|
219
|
+
})
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
function RootComponent() {
|
|
223
|
+
const pathname = useRouterState({ select: (s) => s.location.pathname });
|
|
224
|
+
const isLogin = pathname === "/login";
|
|
225
|
+
const isHome = pathname === "/";
|
|
226
|
+
return /* @__PURE__ */ jsxs("html", {
|
|
227
|
+
lang: "en",
|
|
228
|
+
"data-layout": isHome ? "home" : "page",
|
|
229
|
+
suppressHydrationWarning: true,
|
|
230
|
+
children: [/* @__PURE__ */ jsxs("head", { children: [/* @__PURE__ */ jsx("script", { dangerouslySetInnerHTML: { __html: THEME_INIT_SCRIPT } }), /* @__PURE__ */ jsx(HeadContent, {})] }), /* @__PURE__ */ jsxs("body", {
|
|
231
|
+
"data-layout": isHome ? "home" : "page",
|
|
232
|
+
children: [isLogin ? /* @__PURE__ */ jsx(Outlet, {}) : isHome ? /* @__PURE__ */ jsxs("div", {
|
|
233
|
+
className: "flex h-dvh flex-col px-6",
|
|
234
|
+
children: [/* @__PURE__ */ jsx(TopNav, {}), /* @__PURE__ */ jsx("main", {
|
|
235
|
+
className: "min-h-0 flex-1 overflow-hidden",
|
|
236
|
+
children: /* @__PURE__ */ jsx(Outlet, {})
|
|
237
|
+
})]
|
|
238
|
+
}) : /* @__PURE__ */ jsxs("div", {
|
|
239
|
+
className: "flex min-h-dvh flex-col px-6 pb-12",
|
|
240
|
+
children: [
|
|
241
|
+
/* @__PURE__ */ jsx(TopNav, {}),
|
|
242
|
+
/* @__PURE__ */ jsx("main", {
|
|
243
|
+
className: "mt-8 flex-1",
|
|
244
|
+
children: /* @__PURE__ */ jsx(Outlet, {})
|
|
245
|
+
}),
|
|
246
|
+
/* @__PURE__ */ jsx(Footer, {})
|
|
247
|
+
]
|
|
248
|
+
}), /* @__PURE__ */ jsx(Scripts, {})]
|
|
249
|
+
})]
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
//#endregion
|
|
253
|
+
//#region src/routes/welcome.tsx
|
|
254
|
+
var $$splitComponentImporter = () => import("./welcome-BkQ9NC5K.js");
|
|
255
|
+
var Route$1 = createFileRoute("/welcome")({
|
|
256
|
+
beforeLoad: async () => {
|
|
257
|
+
if ((await fetchAuthState()).setupComplete) throw redirect({ to: "/" });
|
|
258
|
+
},
|
|
259
|
+
component: lazyRouteComponent($$splitComponentImporter, "component")
|
|
260
|
+
});
|
|
261
|
+
//#endregion
|
|
262
|
+
//#region src/routes/api/$.ts
|
|
263
|
+
var STRIP_REQUEST_HEADERS = new Set([
|
|
264
|
+
"host",
|
|
265
|
+
"connection",
|
|
266
|
+
"keep-alive",
|
|
267
|
+
"proxy-authenticate",
|
|
268
|
+
"proxy-authorization",
|
|
269
|
+
"te",
|
|
270
|
+
"trailer",
|
|
271
|
+
"transfer-encoding",
|
|
272
|
+
"upgrade",
|
|
273
|
+
"cookie"
|
|
274
|
+
]);
|
|
275
|
+
var STRIP_RESPONSE_HEADERS = new Set([
|
|
276
|
+
"connection",
|
|
277
|
+
"keep-alive",
|
|
278
|
+
"proxy-authenticate",
|
|
279
|
+
"proxy-authorization",
|
|
280
|
+
"te",
|
|
281
|
+
"trailer",
|
|
282
|
+
"transfer-encoding",
|
|
283
|
+
"upgrade"
|
|
284
|
+
]);
|
|
285
|
+
async function proxy(request) {
|
|
286
|
+
const incoming = new URL(request.url);
|
|
287
|
+
const target = `${DAEMON_BASE_URL}${incoming.pathname}${incoming.search}`;
|
|
288
|
+
const headers = new Headers();
|
|
289
|
+
for (const [k, v] of request.headers) if (!STRIP_REQUEST_HEADERS.has(k.toLowerCase())) headers.set(k, v);
|
|
290
|
+
if (!headers.has("authorization")) {
|
|
291
|
+
const token = getCookie("bz_token");
|
|
292
|
+
if (token) headers.set("authorization", `Bearer ${token}`);
|
|
293
|
+
}
|
|
294
|
+
headers.set("origin", DAEMON_BASE_URL);
|
|
295
|
+
const init = {
|
|
296
|
+
method: request.method,
|
|
297
|
+
headers,
|
|
298
|
+
redirect: "manual"
|
|
299
|
+
};
|
|
300
|
+
if (request.method !== "GET" && request.method !== "HEAD") {
|
|
301
|
+
init.body = request.body;
|
|
302
|
+
init.duplex = "half";
|
|
303
|
+
}
|
|
304
|
+
const upstream = await fetch(target, init);
|
|
305
|
+
const respHeaders = new Headers();
|
|
306
|
+
for (const [k, v] of upstream.headers) if (!STRIP_RESPONSE_HEADERS.has(k.toLowerCase())) respHeaders.set(k, v);
|
|
307
|
+
return new Response(upstream.body, {
|
|
308
|
+
status: upstream.status,
|
|
309
|
+
statusText: upstream.statusText,
|
|
310
|
+
headers: respHeaders
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
var Route = createFileRoute("/api/$")({ server: { handlers: {
|
|
314
|
+
GET: ({ request }) => proxy(request),
|
|
315
|
+
POST: ({ request }) => proxy(request),
|
|
316
|
+
PUT: ({ request }) => proxy(request),
|
|
317
|
+
PATCH: ({ request }) => proxy(request),
|
|
318
|
+
DELETE: ({ request }) => proxy(request)
|
|
319
|
+
} } });
|
|
320
|
+
//#endregion
|
|
321
|
+
//#region src/routeTree.gen.ts
|
|
322
|
+
var WelcomeRoute = Route$1.update({
|
|
323
|
+
id: "/welcome",
|
|
324
|
+
path: "/welcome",
|
|
325
|
+
getParentRoute: () => Route$2
|
|
326
|
+
});
|
|
327
|
+
var LoginRoute = Route$3.update({
|
|
328
|
+
id: "/login",
|
|
329
|
+
path: "/login",
|
|
330
|
+
getParentRoute: () => Route$2
|
|
331
|
+
});
|
|
332
|
+
var IndexRoute = Route$4.update({
|
|
333
|
+
id: "/",
|
|
334
|
+
path: "/",
|
|
335
|
+
getParentRoute: () => Route$2
|
|
336
|
+
});
|
|
337
|
+
var SkillsIndexRoute = Route$5.update({
|
|
338
|
+
id: "/skills/",
|
|
339
|
+
path: "/skills/",
|
|
340
|
+
getParentRoute: () => Route$2
|
|
341
|
+
});
|
|
342
|
+
var ProfilesIndexRoute = Route$6.update({
|
|
343
|
+
id: "/profiles/",
|
|
344
|
+
path: "/profiles/",
|
|
345
|
+
getParentRoute: () => Route$2
|
|
346
|
+
});
|
|
347
|
+
var ProfileGroupsIndexRoute = Route$7.update({
|
|
348
|
+
id: "/profile-groups/",
|
|
349
|
+
path: "/profile-groups/",
|
|
350
|
+
getParentRoute: () => Route$2
|
|
351
|
+
});
|
|
352
|
+
var GroupsIndexRoute = Route$8.update({
|
|
353
|
+
id: "/groups/",
|
|
354
|
+
path: "/groups/",
|
|
355
|
+
getParentRoute: () => Route$2
|
|
356
|
+
});
|
|
357
|
+
var ConfigIndexRoute = Route$9.update({
|
|
358
|
+
id: "/config/",
|
|
359
|
+
path: "/config/",
|
|
360
|
+
getParentRoute: () => Route$2
|
|
361
|
+
});
|
|
362
|
+
var AgentsIndexRoute = Route$10.update({
|
|
363
|
+
id: "/agents/",
|
|
364
|
+
path: "/agents/",
|
|
365
|
+
getParentRoute: () => Route$2
|
|
366
|
+
});
|
|
367
|
+
var ProfilesIdRoute = Route$11.update({
|
|
368
|
+
id: "/profiles/$id",
|
|
369
|
+
path: "/profiles/$id",
|
|
370
|
+
getParentRoute: () => Route$2
|
|
371
|
+
});
|
|
372
|
+
var ProfileGroupsIdRoute = Route$12.update({
|
|
373
|
+
id: "/profile-groups/$id",
|
|
374
|
+
path: "/profile-groups/$id",
|
|
375
|
+
getParentRoute: () => Route$2
|
|
376
|
+
});
|
|
377
|
+
var ConfigTokensRoute = Route$13.update({
|
|
378
|
+
id: "/config/tokens",
|
|
379
|
+
path: "/config/tokens",
|
|
380
|
+
getParentRoute: () => Route$2
|
|
381
|
+
});
|
|
382
|
+
var ConfigServicesRoute = Route$14.update({
|
|
383
|
+
id: "/config/services",
|
|
384
|
+
path: "/config/services",
|
|
385
|
+
getParentRoute: () => Route$2
|
|
386
|
+
});
|
|
387
|
+
var ConfigMcpRoute = Route$15.update({
|
|
388
|
+
id: "/config/mcp",
|
|
389
|
+
path: "/config/mcp",
|
|
390
|
+
getParentRoute: () => Route$2
|
|
391
|
+
});
|
|
392
|
+
var ApiSplatRoute = Route.update({
|
|
393
|
+
id: "/api/$",
|
|
394
|
+
path: "/api/$",
|
|
395
|
+
getParentRoute: () => Route$2
|
|
396
|
+
});
|
|
397
|
+
var GroupsIdIndexRoute = Route$16.update({
|
|
398
|
+
id: "/groups/$id/",
|
|
399
|
+
path: "/groups/$id/",
|
|
400
|
+
getParentRoute: () => Route$2
|
|
401
|
+
});
|
|
402
|
+
var AgentsIdIndexRoute = Route$17.update({
|
|
403
|
+
id: "/agents/$id/",
|
|
404
|
+
path: "/agents/$id/",
|
|
405
|
+
getParentRoute: () => Route$2
|
|
406
|
+
});
|
|
407
|
+
var GroupsIdMemoryRoute = Route$18.update({
|
|
408
|
+
id: "/groups/$id/memory",
|
|
409
|
+
path: "/groups/$id/memory",
|
|
410
|
+
getParentRoute: () => Route$2
|
|
411
|
+
});
|
|
412
|
+
var ConfigIntegrationsTelegramRoute = Route$19.update({
|
|
413
|
+
id: "/config/integrations/telegram",
|
|
414
|
+
path: "/config/integrations/telegram",
|
|
415
|
+
getParentRoute: () => Route$2
|
|
416
|
+
});
|
|
417
|
+
var AgentsIdTriggersRoute = Route$20.update({
|
|
418
|
+
id: "/agents/$id/triggers",
|
|
419
|
+
path: "/agents/$id/triggers",
|
|
420
|
+
getParentRoute: () => Route$2
|
|
421
|
+
});
|
|
422
|
+
var rootRouteChildren = {
|
|
423
|
+
IndexRoute,
|
|
424
|
+
LoginRoute,
|
|
425
|
+
WelcomeRoute,
|
|
426
|
+
ApiSplatRoute,
|
|
427
|
+
ConfigMcpRoute,
|
|
428
|
+
ConfigServicesRoute,
|
|
429
|
+
ConfigTokensRoute,
|
|
430
|
+
ProfileGroupsIdRoute,
|
|
431
|
+
ProfilesIdRoute,
|
|
432
|
+
AgentsIndexRoute,
|
|
433
|
+
ConfigIndexRoute,
|
|
434
|
+
GroupsIndexRoute,
|
|
435
|
+
ProfileGroupsIndexRoute,
|
|
436
|
+
ProfilesIndexRoute,
|
|
437
|
+
SkillsIndexRoute,
|
|
438
|
+
AgentsIdInboxRoute: Route$21.update({
|
|
439
|
+
id: "/agents/$id/inbox",
|
|
440
|
+
path: "/agents/$id/inbox",
|
|
441
|
+
getParentRoute: () => Route$2
|
|
442
|
+
}),
|
|
443
|
+
AgentsIdTriggersRoute,
|
|
444
|
+
ConfigIntegrationsTelegramRoute,
|
|
445
|
+
GroupsIdMemoryRoute,
|
|
446
|
+
AgentsIdIndexRoute,
|
|
447
|
+
GroupsIdIndexRoute
|
|
448
|
+
};
|
|
449
|
+
var routeTree = Route$2._addFileChildren(rootRouteChildren)._addFileTypes();
|
|
450
|
+
//#endregion
|
|
451
|
+
//#region src/router.tsx
|
|
452
|
+
function getRouter() {
|
|
453
|
+
return createRouter({
|
|
454
|
+
routeTree,
|
|
455
|
+
scrollRestoration: true,
|
|
456
|
+
defaultPreload: "intent"
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
//#endregion
|
|
460
|
+
export { getRouter };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { t as createServerFn } from "../server.js";
|
|
2
|
+
import { t as createSsrRpc } from "./createSsrRpc-DHBVUN8O.js";
|
|
3
|
+
import { createFileRoute, lazyRouteComponent } from "@tanstack/react-router";
|
|
4
|
+
//#region src/routes/index.tsx
|
|
5
|
+
var $$splitComponentImporter = () => import("./routes-Dzk8jvIo.js");
|
|
6
|
+
var fetchHomeData = createServerFn({ method: "POST" }).inputValidator((d) => d).handler(createSsrRpc("26dbbcbe40063e8aedfd343cf1dfd4dfe5589f24591c0ba35e80c611d7c57c7c"));
|
|
7
|
+
var Route = createFileRoute("/")({
|
|
8
|
+
validateSearch: (s) => ({ agent: typeof s.agent === "string" ? s.agent : void 0 }),
|
|
9
|
+
loaderDeps: ({ search }) => ({ agentId: search.agent }),
|
|
10
|
+
loader: ({ deps }) => fetchHomeData({ data: { agentId: deps.agentId } }),
|
|
11
|
+
component: lazyRouteComponent($$splitComponentImporter, "component")
|
|
12
|
+
});
|
|
13
|
+
//#endregion
|
|
14
|
+
export { Route as t };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { i as getCookie, t as createServerFn } from "../server.js";
|
|
2
|
+
import { t as createServerRpc } from "./createServerRpc-CBTntoKx.js";
|
|
3
|
+
import { n as daemonClient, r as ApiClientError } from "./daemon-client-2NRMzlTr.js";
|
|
4
|
+
import { t as SIDEBAR_OPEN_GROUPS_COOKIE } from "./Sidebar-DmEiewRN.js";
|
|
5
|
+
//#region src/routes/index.tsx?tss-serverfn-split
|
|
6
|
+
function parseOpenGroupsCookie(raw) {
|
|
7
|
+
if (!raw) return {};
|
|
8
|
+
try {
|
|
9
|
+
const decoded = raw.includes("%") ? decodeURIComponent(raw) : raw;
|
|
10
|
+
const parsed = JSON.parse(decoded);
|
|
11
|
+
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
12
|
+
const out = {};
|
|
13
|
+
for (const [k, v] of Object.entries(parsed)) if (typeof v === "boolean") out[k] = v;
|
|
14
|
+
return out;
|
|
15
|
+
}
|
|
16
|
+
} catch {}
|
|
17
|
+
return {};
|
|
18
|
+
}
|
|
19
|
+
var fetchHomeData_createServerFn_handler = createServerRpc({
|
|
20
|
+
id: "26dbbcbe40063e8aedfd343cf1dfd4dfe5589f24591c0ba35e80c611d7c57c7c",
|
|
21
|
+
name: "fetchHomeData",
|
|
22
|
+
filename: "src/routes/index.tsx"
|
|
23
|
+
}, (opts) => fetchHomeData.__executeServer(opts));
|
|
24
|
+
var fetchHomeData = createServerFn({ method: "POST" }).inputValidator((d) => d).handler(fetchHomeData_createServerFn_handler, async ({ data }) => {
|
|
25
|
+
const client = daemonClient();
|
|
26
|
+
const [agents, profiles, profileGroups, groups] = await Promise.all([
|
|
27
|
+
client.get("/api/agents?includeArchived=false"),
|
|
28
|
+
client.get("/api/profiles"),
|
|
29
|
+
client.get("/api/profile-groups"),
|
|
30
|
+
client.get("/api/groups")
|
|
31
|
+
]);
|
|
32
|
+
const initialOpenGroups = parseOpenGroupsCookie(getCookie(SIDEBAR_OPEN_GROUPS_COOKIE));
|
|
33
|
+
let selected = null;
|
|
34
|
+
if (data.agentId) try {
|
|
35
|
+
const resolved = await client.get(`/api/agents/${encodeURIComponent(data.agentId)}`);
|
|
36
|
+
if (resolved.agent.status !== "archived") {
|
|
37
|
+
const [msgs, head] = await Promise.all([client.get(`/api/agents/${encodeURIComponent(resolved.agent.id)}/sessions/messages`), client.get(`/api/agents/${encodeURIComponent(resolved.agent.id)}/sessions/head`)]);
|
|
38
|
+
selected = {
|
|
39
|
+
resolved,
|
|
40
|
+
initialMessages: msgs.messages,
|
|
41
|
+
sessionHead: head
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
} catch (err) {
|
|
45
|
+
if (!(err instanceof ApiClientError) || err.status !== 404) throw err;
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
agents,
|
|
49
|
+
profiles,
|
|
50
|
+
profileGroups,
|
|
51
|
+
groups,
|
|
52
|
+
selected,
|
|
53
|
+
initialOpenGroups
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
//#endregion
|
|
57
|
+
export { fetchHomeData_createServerFn_handler };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { t as Route } from "./routes-CzJLQxcS.js";
|
|
2
|
+
import { t as ChatPane } from "./ChatPane-BvpswYvF.js";
|
|
3
|
+
import { n as Sidebar } from "./Sidebar-DmEiewRN.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
//#region src/routes/index.tsx?tsr-split=component
|
|
6
|
+
function HomePage() {
|
|
7
|
+
const data = Route.useLoaderData();
|
|
8
|
+
const selectedAgentId = data.selected?.resolved.agent.id ?? null;
|
|
9
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
10
|
+
className: "grid h-full grid-cols-1 gap-3 py-3 sm:grid-cols-[16rem_minmax(0,1fr)]",
|
|
11
|
+
children: [/* @__PURE__ */ jsx(Sidebar, {
|
|
12
|
+
agents: data.agents,
|
|
13
|
+
groups: data.groups,
|
|
14
|
+
profiles: data.profiles,
|
|
15
|
+
profileGroups: data.profileGroups,
|
|
16
|
+
selectedAgentId,
|
|
17
|
+
initialOpenGroups: data.initialOpenGroups
|
|
18
|
+
}), /* @__PURE__ */ jsx("main", {
|
|
19
|
+
className: "overflow-hidden",
|
|
20
|
+
children: data.selected ? /* @__PURE__ */ jsx(ChatPane, {
|
|
21
|
+
agentId: data.selected.resolved.agent.id,
|
|
22
|
+
agentName: data.selected.resolved.agent.name,
|
|
23
|
+
initialMessages: data.selected.initialMessages,
|
|
24
|
+
initialSessionHead: data.selected.sessionHead
|
|
25
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
26
|
+
className: "flex h-full items-center justify-center rounded-lg border border-dashed bg-card text-muted-foreground",
|
|
27
|
+
children: data.agents.length === 0 ? "No agents yet." : "Pick an agent on the left to start chatting."
|
|
28
|
+
})
|
|
29
|
+
})]
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { HomePage as component };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { t as createServerFn } from "../server.js";
|
|
2
|
+
import { t as createServerRpc } from "./createServerRpc-CBTntoKx.js";
|
|
3
|
+
import { n as daemonClient } from "./daemon-client-2NRMzlTr.js";
|
|
4
|
+
//#region src/routes/config/services.tsx?tss-serverfn-split
|
|
5
|
+
var fetchServices_createServerFn_handler = createServerRpc({
|
|
6
|
+
id: "6afd81bef0ee381d6e3641cd8e269968429c874e2f9d56c8f818cc9d180ee477",
|
|
7
|
+
name: "fetchServices",
|
|
8
|
+
filename: "src/routes/config/services.tsx"
|
|
9
|
+
}, (opts) => fetchServices.__executeServer(opts));
|
|
10
|
+
var fetchServices = createServerFn({ method: "GET" }).handler(fetchServices_createServerFn_handler, () => daemonClient().get("/api/config/services"));
|
|
11
|
+
//#endregion
|
|
12
|
+
export { fetchServices_createServerFn_handler };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { t as createServerFn } from "../server.js";
|
|
2
|
+
import { t as createSsrRpc } from "./createSsrRpc-DHBVUN8O.js";
|
|
3
|
+
import { createFileRoute, lazyRouteComponent } from "@tanstack/react-router";
|
|
4
|
+
//#region src/routes/config/services.tsx
|
|
5
|
+
var $$splitComponentImporter = () => import("./services-DFenjiw0.js");
|
|
6
|
+
var fetchServices = createServerFn({ method: "GET" }).handler(createSsrRpc("6afd81bef0ee381d6e3641cd8e269968429c874e2f9d56c8f818cc9d180ee477"));
|
|
7
|
+
var Route = createFileRoute("/config/services")({
|
|
8
|
+
loader: () => fetchServices(),
|
|
9
|
+
component: lazyRouteComponent($$splitComponentImporter, "component")
|
|
10
|
+
});
|
|
11
|
+
/**
|
|
12
|
+
* Bucket services into groups while preserving the order each group first
|
|
13
|
+
* appears in the daemon's SERVICES list. Cards without a `group` field land
|
|
14
|
+
* in an "Other" bucket at the end.
|
|
15
|
+
*/
|
|
16
|
+
//#endregion
|
|
17
|
+
export { Route as t };
|