bazilion 0.5.1 → 0.7.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.
Files changed (122) hide show
  1. package/README.md +17 -12
  2. package/dist/cli.js +383 -152
  3. package/dist/cli.js.map +1 -1
  4. package/dist/daemon.js +238 -14064
  5. package/dist/daemon.js.map +1 -1
  6. package/dist/web/client/assets/AgentAvatar-JYijLvZ2.js +1 -0
  7. package/dist/web/client/assets/AgentTabs-DioGqUVR.js +1 -0
  8. package/dist/web/client/assets/Button-ByiV6fpd.js +1 -0
  9. package/dist/web/client/assets/ChatPane-DzEgOEqS.js +74 -0
  10. package/dist/web/client/assets/ConfigTabs-pY-V0Rie.js +1 -0
  11. package/dist/web/client/assets/FieldRow-CNKma5LE.js +1 -0
  12. package/dist/web/client/assets/MembersEditor-C6UpqDdV.js +1 -0
  13. package/dist/web/client/assets/SpawnTeamModal-BEkNCKXm.js +1 -0
  14. package/dist/web/client/assets/TemplatesTabs-Da7mg9FI.js +1 -0
  15. package/dist/web/client/assets/_id-BdKmo0gb.js +1 -0
  16. package/dist/web/client/assets/_id-LT6Ejjr0.js +1 -0
  17. package/dist/web/client/assets/_id-MR2XjWh0.js +1 -0
  18. package/dist/web/client/assets/_id-_6jIt0_-.js +1 -0
  19. package/dist/web/client/assets/agents-0arKbVYG.js +1 -0
  20. package/dist/web/client/assets/config-BSAVT-17.js +3 -0
  21. package/dist/web/client/assets/groups-BqTkhHes.js +1 -0
  22. package/dist/web/client/assets/inbox-ozoCXzr5.js +1 -0
  23. package/dist/web/client/assets/index-iayCEuU2.js +12 -0
  24. package/dist/web/client/assets/jsx-runtime-DGeXAQPT.js +1 -0
  25. package/dist/web/client/assets/login-D8lNr2SX.js +1 -0
  26. package/dist/web/client/assets/mcp-BLnngDsj.js +1 -0
  27. package/dist/web/client/assets/memory-D1GQjEvN.js +1 -0
  28. package/dist/web/client/assets/preload-helper-CvnapA2_.js +1 -0
  29. package/dist/web/client/assets/profile-groups-C2yJPTaE.js +1 -0
  30. package/dist/web/client/assets/profiles-BV7AAZjj.js +1 -0
  31. package/dist/web/client/assets/routes-DSHQLA7K.js +1 -0
  32. package/dist/web/client/assets/services-BbCJe1Du.js +1 -0
  33. package/dist/web/client/assets/skills-C6czKR5I.js +1 -0
  34. package/dist/web/client/assets/styles-C06axZZk.css +2 -0
  35. package/dist/web/client/assets/telegram-gE4j8gte.js +1 -0
  36. package/dist/web/client/assets/tokens-D2_O9ARe.js +1 -0
  37. package/dist/web/client/assets/triggers-WljnfEfJ.js +1 -0
  38. package/dist/web/client/assets/welcome-Dn-zvmBE.js +1 -0
  39. package/dist/web/client/assets/wire-constants-BkT5-597.js +1 -0
  40. package/dist/web/client/baziu.svg +8 -0
  41. package/dist/web/server/assets/AgentAvatar-8gTAy_tP.js +37 -0
  42. package/dist/web/server/assets/AgentTabs-BOjTN7QF.js +34 -0
  43. package/dist/web/server/assets/Button-Dsnw22OF.js +17 -0
  44. package/dist/web/server/assets/ChatPane-BvpswYvF.js +1084 -0
  45. package/dist/web/server/assets/ConfigTabs-CyuxzesF.js +41 -0
  46. package/dist/web/server/assets/FieldRow-DwyqycWI.js +94 -0
  47. package/dist/web/server/assets/MembersEditor-BWQztvrX.js +131 -0
  48. package/dist/web/server/assets/Sidebar-DmEiewRN.js +529 -0
  49. package/dist/web/server/assets/SpawnTeamModal-dSN421k_.js +107 -0
  50. package/dist/web/server/assets/TemplatesTabs---7h5GYa.js +30 -0
  51. package/dist/web/server/assets/_id-81NrHA5d.js +16 -0
  52. package/dist/web/server/assets/_id-BKev9H1p.js +12 -0
  53. package/dist/web/server/assets/_id-BNwlbWHP.js +24 -0
  54. package/dist/web/server/assets/_id-BqnDy_Ca.js +16 -0
  55. package/dist/web/server/assets/_id-CRqqi8IE.js +161 -0
  56. package/dist/web/server/assets/_id-CXg-Blec.js +367 -0
  57. package/dist/web/server/assets/_id-CnQflrRv.js +16 -0
  58. package/dist/web/server/assets/_id-D0ytyXGY.js +662 -0
  59. package/dist/web/server/assets/_id-D8duqgd5.js +27 -0
  60. package/dist/web/server/assets/_id-DDixKEud.js +467 -0
  61. package/dist/web/server/assets/_id-D_Ew11ED.js +28 -0
  62. package/dist/web/server/assets/_id-Sjw0zhA6.js +38 -0
  63. package/dist/web/server/assets/_tanstack-start-manifest_v-DBlFH2gg.js +178 -0
  64. package/dist/web/server/assets/agents-C7SBPN0M.js +210 -0
  65. package/dist/web/server/assets/agents-ChcAJUI5.js +14 -0
  66. package/dist/web/server/assets/agents-k5QURC4I.js +26 -0
  67. package/dist/web/server/assets/auth-DzRAMwVt.js +26 -0
  68. package/dist/web/server/assets/config-Bq3o924J.js +12 -0
  69. package/dist/web/server/assets/config-CHaCv89D.js +19 -0
  70. package/dist/web/server/assets/config-CdVjqjin.js +391 -0
  71. package/dist/web/server/assets/createServerRpc-CeKECg65.js +12 -0
  72. package/dist/web/server/assets/createSsrRpc-ZBGxhl8t.js +16 -0
  73. package/dist/web/server/assets/daemon-client-2NRMzlTr.js +96 -0
  74. package/dist/web/server/assets/empty-plugin-adapters-DKUlnwwl.js +5 -0
  75. package/dist/web/server/assets/groups-CbSwND2r.js +12 -0
  76. package/dist/web/server/assets/groups-CeRRlZaZ.js +150 -0
  77. package/dist/web/server/assets/groups-pk4CYSuf.js +21 -0
  78. package/dist/web/server/assets/inbox-Bxb3W04M.js +27 -0
  79. package/dist/web/server/assets/inbox-CkiSvD14.js +42 -0
  80. package/dist/web/server/assets/inbox-DU27iHv_.js +133 -0
  81. package/dist/web/server/assets/login-CNznncgA.js +58 -0
  82. package/dist/web/server/assets/login-CQybKk7Y.js +74 -0
  83. package/dist/web/server/assets/mcp-BU_kKENi.js +268 -0
  84. package/dist/web/server/assets/mcp-BsFKEoXt.js +12 -0
  85. package/dist/web/server/assets/mcp-CKqwG4mt.js +12 -0
  86. package/dist/web/server/assets/memory-BaYnfm7K.js +28 -0
  87. package/dist/web/server/assets/memory-CQaqWnyM.js +284 -0
  88. package/dist/web/server/assets/memory-Ns2-Z31p.js +16 -0
  89. package/dist/web/server/assets/profile-groups-CiU06yN1.js +28 -0
  90. package/dist/web/server/assets/profile-groups-D21MYoLM.js +208 -0
  91. package/dist/web/server/assets/profile-groups-aoJleXHP.js +12 -0
  92. package/dist/web/server/assets/profiles-C6a3RKgu.js +26 -0
  93. package/dist/web/server/assets/profiles-CZ5NkmVw.js +12 -0
  94. package/dist/web/server/assets/profiles-LxcC_L6n.js +453 -0
  95. package/dist/web/server/assets/router-BpBZgRwn.js +460 -0
  96. package/dist/web/server/assets/routes-C61gBiXa.js +57 -0
  97. package/dist/web/server/assets/routes-Ce2VWrU9.js +33 -0
  98. package/dist/web/server/assets/routes-V9URcp1v.js +14 -0
  99. package/dist/web/server/assets/services-B91w2f-X.js +94 -0
  100. package/dist/web/server/assets/services-Ccc5s2bS.js +17 -0
  101. package/dist/web/server/assets/services-DhRiNeq0.js +12 -0
  102. package/dist/web/server/assets/skills-CFIWVg32.js +12 -0
  103. package/dist/web/server/assets/skills-CpsyR_WA.js +12 -0
  104. package/dist/web/server/assets/skills-dLyBZb3B.js +261 -0
  105. package/dist/web/server/assets/start-CYDpZ6cb.js +4 -0
  106. package/dist/web/server/assets/telegram-BdaUIjvs.js +12 -0
  107. package/dist/web/server/assets/telegram-DfAddLdv.js +583 -0
  108. package/dist/web/server/assets/telegram-T3l9KtiE.js +12 -0
  109. package/dist/web/server/assets/tokens-BCz3PSoT.js +12 -0
  110. package/dist/web/server/assets/tokens-CkKqrtk-.js +193 -0
  111. package/dist/web/server/assets/tokens-DdpnfV_Y.js +14 -0
  112. package/dist/web/server/assets/triggers-BcH_6PW1.js +26 -0
  113. package/dist/web/server/assets/triggers-BcTTwMfy.js +16 -0
  114. package/dist/web/server/assets/triggers-BzJG1nN5.js +191 -0
  115. package/dist/web/server/assets/welcome-CP4CZ9B6.js +85 -0
  116. package/dist/web/server/assets/wire-constants-Deb4NxBb.js +16 -0
  117. package/dist/web/server/server.js +5911 -0
  118. package/dist/web-server.js +42 -0
  119. package/dist/web-server.js.map +1 -0
  120. package/dist/worker.js +65 -2
  121. package/dist/worker.js.map +1 -1
  122. package/package.json +18 -12
@@ -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-ZBGxhl8t.js";
5
+ import { t as Route$4 } from "./routes-V9URcp1v.js";
6
+ import { t as Route$5 } from "./skills-CpsyR_WA.js";
7
+ import { t as Route$6 } from "./profiles-CZ5NkmVw.js";
8
+ import { t as Route$7 } from "./profile-groups-aoJleXHP.js";
9
+ import { t as Route$8 } from "./groups-CbSwND2r.js";
10
+ import { t as Route$9 } from "./config-Bq3o924J.js";
11
+ import { t as Route$10 } from "./agents-ChcAJUI5.js";
12
+ import { t as Route$11 } from "./_id-BqnDy_Ca.js";
13
+ import { t as Route$12 } from "./_id-BKev9H1p.js";
14
+ import { t as Route$13 } from "./tokens-DdpnfV_Y.js";
15
+ import { t as Route$14 } from "./services-Ccc5s2bS.js";
16
+ import { t as Route$15 } from "./mcp-CKqwG4mt.js";
17
+ import { t as Route$16 } from "./_id-CnQflrRv.js";
18
+ import { t as Route$17 } from "./_id-81NrHA5d.js";
19
+ import { t as Route$18 } from "./memory-Ns2-Z31p.js";
20
+ import { t as Route$19 } from "./telegram-T3l9KtiE.js";
21
+ import { t as Route$20 } from "./triggers-BcTTwMfy.js";
22
+ import { t as Route$21 } from "./inbox-Bxb3W04M.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-C06axZZk.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-CP4CZ9B6.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,57 @@
1
+ import { i as getCookie, t as createServerFn } from "../server.js";
2
+ import { t as createServerRpc } from "./createServerRpc-CeKECg65.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-V9URcp1v.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,14 @@
1
+ import { t as createServerFn } from "../server.js";
2
+ import { t as createSsrRpc } from "./createSsrRpc-ZBGxhl8t.js";
3
+ import { createFileRoute, lazyRouteComponent } from "@tanstack/react-router";
4
+ //#region src/routes/index.tsx
5
+ var $$splitComponentImporter = () => import("./routes-Ce2VWrU9.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,94 @@
1
+ import { t as Route } from "./services-Ccc5s2bS.js";
2
+ import { t as ConfigTabs } from "./ConfigTabs-CyuxzesF.js";
3
+ import { t as FieldRow } from "./FieldRow-DwyqycWI.js";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ //#region src/routes/config/services.tsx?tsr-split=component
6
+ var UNGROUPED_LABEL = "Other";
7
+ /**
8
+ * Bucket services into groups while preserving the order each group first
9
+ * appears in the daemon's SERVICES list. Cards without a `group` field land
10
+ * in an "Other" bucket at the end.
11
+ */
12
+ function groupServices(services) {
13
+ const buckets = /* @__PURE__ */ new Map();
14
+ for (const s of services) {
15
+ const key = s.group ?? UNGROUPED_LABEL;
16
+ const bucket = buckets.get(key) ?? [];
17
+ bucket.push(s);
18
+ buckets.set(key, bucket);
19
+ }
20
+ const entries = Array.from(buckets, ([group, items]) => ({
21
+ group,
22
+ items
23
+ }));
24
+ if (entries.length > 1) entries.sort((a, b) => {
25
+ if (a.group === UNGROUPED_LABEL) return 1;
26
+ if (b.group === UNGROUPED_LABEL) return -1;
27
+ return 0;
28
+ });
29
+ return entries;
30
+ }
31
+ function ServicesPage() {
32
+ const { services } = Route.useLoaderData();
33
+ const grouped = groupServices(services);
34
+ return /* @__PURE__ */ jsxs("main", {
35
+ className: "mx-auto max-w-5xl px-6 py-8",
36
+ children: [
37
+ /* @__PURE__ */ jsx("h1", {
38
+ className: "font-serif text-3xl text-foreground mb-2",
39
+ children: "config"
40
+ }),
41
+ /* @__PURE__ */ jsx(ConfigTabs, { active: "services" }),
42
+ /* @__PURE__ */ jsxs("p", {
43
+ className: "text-muted-foreground text-sm mb-6",
44
+ children: [
45
+ "Configuration for non-LLM integrations — web search, crawlers, and similar. Fields marked as secrets are encrypted in the ",
46
+ /* @__PURE__ */ jsx("code", {
47
+ className: "font-mono",
48
+ children: "secrets"
49
+ }),
50
+ " ",
51
+ "table; plaintext URLs and IDs live in the ",
52
+ /* @__PURE__ */ jsx("code", {
53
+ className: "font-mono",
54
+ children: "config"
55
+ }),
56
+ " ",
57
+ "table."
58
+ ]
59
+ }),
60
+ services.length === 0 && /* @__PURE__ */ jsx("p", {
61
+ className: "text-muted-foreground italic",
62
+ children: "(no services registered)"
63
+ }),
64
+ grouped.map(({ group, items }) => /* @__PURE__ */ jsxs("section", {
65
+ className: "mb-6",
66
+ children: [/* @__PURE__ */ jsx("h2", {
67
+ className: "mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",
68
+ children: group
69
+ }), items.map((s) => /* @__PURE__ */ jsxs("section", {
70
+ className: "rounded-lg border bg-card p-5 mb-3",
71
+ children: [
72
+ /* @__PURE__ */ jsxs("header", {
73
+ className: "flex items-center gap-2 mb-3",
74
+ children: [/* @__PURE__ */ jsx("span", {
75
+ className: "font-mono font-semibold",
76
+ children: s.id
77
+ }), /* @__PURE__ */ jsxs("span", {
78
+ className: "text-muted-foreground text-sm",
79
+ children: ["· ", s.displayName]
80
+ })]
81
+ }),
82
+ s.hint && /* @__PURE__ */ jsx("p", {
83
+ className: "text-xs text-muted-foreground mb-2",
84
+ children: s.hint
85
+ }),
86
+ s.fields.map((f) => /* @__PURE__ */ jsx(FieldRow, { field: f }, f.envVar))
87
+ ]
88
+ }, s.id))]
89
+ }, group))
90
+ ]
91
+ });
92
+ }
93
+ //#endregion
94
+ export { ServicesPage as component };
@@ -0,0 +1,17 @@
1
+ import { t as createServerFn } from "../server.js";
2
+ import { t as createSsrRpc } from "./createSsrRpc-ZBGxhl8t.js";
3
+ import { createFileRoute, lazyRouteComponent } from "@tanstack/react-router";
4
+ //#region src/routes/config/services.tsx
5
+ var $$splitComponentImporter = () => import("./services-B91w2f-X.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 };
@@ -0,0 +1,12 @@
1
+ import { t as createServerFn } from "../server.js";
2
+ import { t as createServerRpc } from "./createServerRpc-CeKECg65.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 };