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.
Files changed (118) hide show
  1. package/README.md +14 -9
  2. package/dist/cli.js +365 -140
  3. package/dist/cli.js.map +1 -1
  4. package/dist/daemon.js +4452 -16989
  5. package/dist/daemon.js.map +1 -1
  6. package/dist/web/client/assets/AgentAvatar-Cq7PVBE_.js +1 -0
  7. package/dist/web/client/assets/AgentTabs-M5K8emJ8.js +1 -0
  8. package/dist/web/client/assets/Button-BefUtjMZ.js +1 -0
  9. package/dist/web/client/assets/ChatPane-C8zQfpzH.js +74 -0
  10. package/dist/web/client/assets/ConfigTabs-DRqAymcN.js +1 -0
  11. package/dist/web/client/assets/FieldRow-BqWnxZiX.js +1 -0
  12. package/dist/web/client/assets/MembersEditor-B-47GLUb.js +1 -0
  13. package/dist/web/client/assets/SpawnTeamModal-DiiC7Nc0.js +1 -0
  14. package/dist/web/client/assets/TemplatesTabs-DB4KERTQ.js +1 -0
  15. package/dist/web/client/assets/_id-B7gv1aPQ.js +1 -0
  16. package/dist/web/client/assets/_id-C7d1AqS0.js +1 -0
  17. package/dist/web/client/assets/_id-DhiwjC8u.js +1 -0
  18. package/dist/web/client/assets/_id-p8lUuNFm.js +1 -0
  19. package/dist/web/client/assets/agents-v8G-wt0M.js +1 -0
  20. package/dist/web/client/assets/config-BdmYpS_y.js +3 -0
  21. package/dist/web/client/assets/groups-DiY_ExGM.js +1 -0
  22. package/dist/web/client/assets/inbox-DtfVx246.js +1 -0
  23. package/dist/web/client/assets/index-BQUL6oyH.js +12 -0
  24. package/dist/web/client/assets/login-CVS70W9g.js +1 -0
  25. package/dist/web/client/assets/mcp-BDLQq8OZ.js +1 -0
  26. package/dist/web/client/assets/memory-6GGuAXwx.js +1 -0
  27. package/dist/web/client/assets/profile-groups-BA8rwZMA.js +1 -0
  28. package/dist/web/client/assets/profiles-C0aAcPZg.js +1 -0
  29. package/dist/web/client/assets/routes-DgAhnKFw.js +1 -0
  30. package/dist/web/client/assets/services-BZ86QEah.js +1 -0
  31. package/dist/web/client/assets/skills-mv_NNNwo.js +1 -0
  32. package/dist/web/client/assets/styles-CmqUskDu.css +2 -0
  33. package/dist/web/client/assets/telegram-5f9WXs3x.js +1 -0
  34. package/dist/web/client/assets/tokens-DHiYsFUh.js +1 -0
  35. package/dist/web/client/assets/triggers-CjC8Ljrz.js +1 -0
  36. package/dist/web/client/assets/welcome-C-Cu-ziL.js +1 -0
  37. package/dist/web/client/assets/wire-constants-BkT5-597.js +1 -0
  38. package/dist/web/client/baziu.svg +8 -0
  39. package/dist/web/server/assets/AgentAvatar-8gTAy_tP.js +37 -0
  40. package/dist/web/server/assets/AgentTabs-BOjTN7QF.js +34 -0
  41. package/dist/web/server/assets/Button-Dsnw22OF.js +17 -0
  42. package/dist/web/server/assets/ChatPane-BvpswYvF.js +1084 -0
  43. package/dist/web/server/assets/ConfigTabs-CyuxzesF.js +41 -0
  44. package/dist/web/server/assets/FieldRow-DwyqycWI.js +94 -0
  45. package/dist/web/server/assets/MembersEditor-BWQztvrX.js +131 -0
  46. package/dist/web/server/assets/Sidebar-DmEiewRN.js +529 -0
  47. package/dist/web/server/assets/SpawnTeamModal-dSN421k_.js +107 -0
  48. package/dist/web/server/assets/TemplatesTabs---7h5GYa.js +30 -0
  49. package/dist/web/server/assets/_id-BZ-YCWSw.js +16 -0
  50. package/dist/web/server/assets/_id-Bm4-_AP-.js +367 -0
  51. package/dist/web/server/assets/_id-C78M9_j9.js +12 -0
  52. package/dist/web/server/assets/_id-CGZbudCl.js +28 -0
  53. package/dist/web/server/assets/_id-CHNm7EAd.js +161 -0
  54. package/dist/web/server/assets/_id-CrQbC5L8.js +16 -0
  55. package/dist/web/server/assets/_id-Crcw2HhT.js +38 -0
  56. package/dist/web/server/assets/_id-CvIGhq4U.js +16 -0
  57. package/dist/web/server/assets/_id-DF3pfi9M.js +27 -0
  58. package/dist/web/server/assets/_id-Dc8P9sy2.js +24 -0
  59. package/dist/web/server/assets/_id-GJk3EYTT.js +662 -0
  60. package/dist/web/server/assets/_id-pd4S7LTi.js +467 -0
  61. package/dist/web/server/assets/_tanstack-start-manifest_v-CPyKYMJg.js +174 -0
  62. package/dist/web/server/assets/agents-70EwQJR6.js +210 -0
  63. package/dist/web/server/assets/agents-Ds4lcREv.js +26 -0
  64. package/dist/web/server/assets/agents-K4Smhnq3.js +14 -0
  65. package/dist/web/server/assets/auth-DpAGLHpA.js +26 -0
  66. package/dist/web/server/assets/config-CMXUx_IF.js +19 -0
  67. package/dist/web/server/assets/config-DQbCsY_l.js +382 -0
  68. package/dist/web/server/assets/config-DxCGYgR9.js +12 -0
  69. package/dist/web/server/assets/createServerRpc-CBTntoKx.js +12 -0
  70. package/dist/web/server/assets/createSsrRpc-DHBVUN8O.js +16 -0
  71. package/dist/web/server/assets/daemon-client-2NRMzlTr.js +96 -0
  72. package/dist/web/server/assets/empty-plugin-adapters-Bos_V2s-.js +5 -0
  73. package/dist/web/server/assets/groups-CXVew7BP.js +150 -0
  74. package/dist/web/server/assets/groups-Cms8cvH5.js +12 -0
  75. package/dist/web/server/assets/groups-Dmcvw5ya.js +21 -0
  76. package/dist/web/server/assets/inbox-0QfwsrGo.js +27 -0
  77. package/dist/web/server/assets/inbox-8HybA2Ws.js +133 -0
  78. package/dist/web/server/assets/inbox-B7UWoICA.js +42 -0
  79. package/dist/web/server/assets/login-CNznncgA.js +58 -0
  80. package/dist/web/server/assets/login-CQybKk7Y.js +74 -0
  81. package/dist/web/server/assets/mcp-42BrkI1I.js +12 -0
  82. package/dist/web/server/assets/mcp-DIa0kIOf.js +268 -0
  83. package/dist/web/server/assets/mcp-DsTjY3uz.js +12 -0
  84. package/dist/web/server/assets/memory-BfrMp8iY.js +284 -0
  85. package/dist/web/server/assets/memory-Dr0lOM2y.js +28 -0
  86. package/dist/web/server/assets/memory-EEgLDfCj.js +16 -0
  87. package/dist/web/server/assets/profile-groups-BW5gU-fG.js +12 -0
  88. package/dist/web/server/assets/profile-groups-B_kIT6BU.js +208 -0
  89. package/dist/web/server/assets/profile-groups-C5isDI2t.js +28 -0
  90. package/dist/web/server/assets/profiles-BP1v-jna.js +453 -0
  91. package/dist/web/server/assets/profiles-BbPTpmyq.js +26 -0
  92. package/dist/web/server/assets/profiles-Cy5auEj8.js +12 -0
  93. package/dist/web/server/assets/router-CL100-Ly.js +460 -0
  94. package/dist/web/server/assets/routes-CzJLQxcS.js +14 -0
  95. package/dist/web/server/assets/routes-D2H1Hnoh.js +57 -0
  96. package/dist/web/server/assets/routes-Dzk8jvIo.js +33 -0
  97. package/dist/web/server/assets/services-Bgj6M2gC.js +12 -0
  98. package/dist/web/server/assets/services-DEgYsWJ4.js +17 -0
  99. package/dist/web/server/assets/services-DFenjiw0.js +94 -0
  100. package/dist/web/server/assets/skills-BASIP_rT.js +12 -0
  101. package/dist/web/server/assets/skills-C-JPRCHh.js +12 -0
  102. package/dist/web/server/assets/skills-DZXN680t.js +261 -0
  103. package/dist/web/server/assets/start-cOXH7eTI.js +4 -0
  104. package/dist/web/server/assets/telegram-BbvqVWxa.js +583 -0
  105. package/dist/web/server/assets/telegram-Bq49AtnP.js +12 -0
  106. package/dist/web/server/assets/telegram-sUckI94O.js +12 -0
  107. package/dist/web/server/assets/tokens-BERRE0wB.js +14 -0
  108. package/dist/web/server/assets/tokens-CImgxhDI.js +193 -0
  109. package/dist/web/server/assets/tokens-Dwn00iV7.js +12 -0
  110. package/dist/web/server/assets/triggers-DtexqbNH.js +16 -0
  111. package/dist/web/server/assets/triggers-TyIjwSYn.js +26 -0
  112. package/dist/web/server/assets/triggers-_iSeahif.js +191 -0
  113. package/dist/web/server/assets/welcome-BkQ9NC5K.js +81 -0
  114. package/dist/web/server/assets/wire-constants-Deb4NxBb.js +16 -0
  115. package/dist/web/server/server.js +5899 -0
  116. package/dist/web-server.js +42 -0
  117. package/dist/web-server.js.map +1 -0
  118. package/package.json +10 -4
@@ -0,0 +1,193 @@
1
+ import { t as Route } from "./tokens-BERRE0wB.js";
2
+ import { t as ConfigTabs } from "./ConfigTabs-CyuxzesF.js";
3
+ import { useState } from "react";
4
+ import { useRouter } from "@tanstack/react-router";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ //#region src/routes/config/tokens.tsx?tsr-split=component
7
+ function fmtTs(ts) {
8
+ return new Date(ts).toISOString().slice(0, 16).replace("T", " ");
9
+ }
10
+ function TokensPage() {
11
+ const { tokens } = Route.useLoaderData();
12
+ const { all } = Route.useSearch();
13
+ const includeRevoked = all === "1";
14
+ const router = useRouter();
15
+ const [label, setLabel] = useState("");
16
+ const [created, setCreated] = useState(null);
17
+ const [err, setErr] = useState(null);
18
+ const [busy, setBusy] = useState(false);
19
+ async function mint(e) {
20
+ e.preventDefault();
21
+ setErr(null);
22
+ setBusy(true);
23
+ try {
24
+ const res = await fetch("/api/tokens", {
25
+ method: "POST",
26
+ headers: { "content-type": "application/json" },
27
+ body: JSON.stringify({ label })
28
+ });
29
+ if (!res.ok) {
30
+ const j = await res.json().catch(() => ({}));
31
+ throw new Error(j.error ?? `${res.status} ${res.statusText}`);
32
+ }
33
+ setCreated((await res.json()).token);
34
+ setLabel("");
35
+ await router.invalidate();
36
+ } catch (e) {
37
+ setErr(e.message);
38
+ } finally {
39
+ setBusy(false);
40
+ }
41
+ }
42
+ async function revoke(id) {
43
+ await fetch(`/api/tokens/${id}`, { method: "DELETE" });
44
+ await router.invalidate();
45
+ }
46
+ return /* @__PURE__ */ jsxs("main", {
47
+ className: "mx-auto max-w-5xl px-6 py-8",
48
+ children: [
49
+ /* @__PURE__ */ jsx("h1", {
50
+ className: "font-serif text-3xl text-foreground mb-2",
51
+ children: "config"
52
+ }),
53
+ /* @__PURE__ */ jsx(ConfigTabs, { active: "tokens" }),
54
+ /* @__PURE__ */ jsxs("p", {
55
+ className: "text-muted-foreground text-sm mb-6",
56
+ children: [
57
+ "Per-client credentials for the HTTP API and CLI. The row labelled",
58
+ " ",
59
+ /* @__PURE__ */ jsx("code", {
60
+ className: "font-mono",
61
+ children: "bootstrap"
62
+ }),
63
+ " is the loopback token in",
64
+ " ",
65
+ /* @__PURE__ */ jsx("code", {
66
+ className: "font-mono",
67
+ children: "~/.bazilion/auth.json"
68
+ }),
69
+ " — revoking it locks the local CLI out, so it can't be revoked from this page. Mint additional tokens here for Tailscale/LAN clients (mobile, remote machines); revoke any of those at any time."
70
+ ]
71
+ }),
72
+ /* @__PURE__ */ jsxs("section", {
73
+ className: "rounded-lg border bg-card p-5 mb-6",
74
+ children: [
75
+ /* @__PURE__ */ jsx("h3", {
76
+ className: "font-serif text-xl mb-3",
77
+ children: "Mint a new token"
78
+ }),
79
+ /* @__PURE__ */ jsxs("form", {
80
+ onSubmit: mint,
81
+ className: "flex gap-2 items-end mb-3",
82
+ children: [/* @__PURE__ */ jsxs("label", {
83
+ className: "text-sm",
84
+ children: ["Label", /* @__PURE__ */ jsx("input", {
85
+ type: "text",
86
+ value: label,
87
+ onChange: (e) => setLabel(e.target.value),
88
+ required: true,
89
+ placeholder: "e.g. laptop-tailscale",
90
+ autoComplete: "off",
91
+ className: "block mt-1 rounded-md border bg-background px-3 py-2 text-sm w-72"
92
+ })]
93
+ }), /* @__PURE__ */ jsx("button", {
94
+ type: "submit",
95
+ disabled: busy,
96
+ className: "rounded-md bg-primary px-3 py-2 text-sm font-medium text-primary-foreground disabled:opacity-50",
97
+ children: busy ? "creating…" : "create"
98
+ })]
99
+ }),
100
+ created && /* @__PURE__ */ jsxs("div", {
101
+ className: "rounded-md border border-amber-200 bg-amber-50 p-3",
102
+ children: [/* @__PURE__ */ jsx("p", {
103
+ className: "text-xs text-amber-800 mb-1",
104
+ children: "copy this token now — it is not recoverable later."
105
+ }), /* @__PURE__ */ jsx("pre", {
106
+ className: "font-mono text-xs whitespace-pre-wrap break-all",
107
+ children: created
108
+ })]
109
+ }),
110
+ err && /* @__PURE__ */ jsx("p", {
111
+ className: "text-sm text-rose-700",
112
+ children: err
113
+ })
114
+ ]
115
+ }),
116
+ /* @__PURE__ */ jsx("div", {
117
+ className: "mb-3",
118
+ children: /* @__PURE__ */ jsxs("label", {
119
+ className: "text-sm flex items-center gap-2",
120
+ children: [/* @__PURE__ */ jsx("input", {
121
+ type: "checkbox",
122
+ checked: includeRevoked,
123
+ onChange: (e) => {
124
+ window.location.assign(e.target.checked ? "/config/tokens?all=1" : "/config/tokens");
125
+ }
126
+ }), "show revoked"]
127
+ })
128
+ }),
129
+ /* @__PURE__ */ jsxs("table", {
130
+ className: "w-full text-sm",
131
+ children: [/* @__PURE__ */ jsx("thead", {
132
+ className: "text-left text-muted-foreground border-b",
133
+ children: /* @__PURE__ */ jsxs("tr", { children: [
134
+ /* @__PURE__ */ jsx("th", {
135
+ className: "py-2",
136
+ children: "label"
137
+ }),
138
+ /* @__PURE__ */ jsx("th", { children: "id" }),
139
+ /* @__PURE__ */ jsx("th", { children: "state" }),
140
+ /* @__PURE__ */ jsx("th", { children: "created" }),
141
+ /* @__PURE__ */ jsx("th", { children: "last used" }),
142
+ /* @__PURE__ */ jsx("th", {})
143
+ ] })
144
+ }), /* @__PURE__ */ jsxs("tbody", { children: [tokens.length === 0 && /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", {
145
+ colSpan: 6,
146
+ className: "py-6 text-center text-muted-foreground italic",
147
+ children: "no tokens yet — mint one above"
148
+ }) }), tokens.map((t) => {
149
+ const isBootstrap = t.label === "bootstrap";
150
+ return /* @__PURE__ */ jsxs("tr", {
151
+ className: "border-b last:border-0 hover:bg-accent/30",
152
+ children: [
153
+ /* @__PURE__ */ jsxs("td", {
154
+ className: "py-2",
155
+ children: [t.label, isBootstrap && /* @__PURE__ */ jsx("span", {
156
+ className: "ml-2 text-[0.7em] uppercase tracking-wide text-muted-foreground",
157
+ children: "auth.json"
158
+ })]
159
+ }),
160
+ /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx("code", {
161
+ className: "font-mono text-xs",
162
+ children: t.id
163
+ }) }),
164
+ /* @__PURE__ */ jsx("td", { children: t.revokedAt ? /* @__PURE__ */ jsx("span", {
165
+ className: "text-muted-foreground",
166
+ children: "revoked"
167
+ }) : /* @__PURE__ */ jsx("span", {
168
+ className: "text-emerald-700",
169
+ children: "active"
170
+ }) }),
171
+ /* @__PURE__ */ jsx("td", {
172
+ className: "text-muted-foreground text-xs",
173
+ children: fmtTs(t.createdAt)
174
+ }),
175
+ /* @__PURE__ */ jsx("td", {
176
+ className: "text-muted-foreground text-xs",
177
+ children: t.lastUsedAt ? fmtTs(t.lastUsedAt) : "(never)"
178
+ }),
179
+ /* @__PURE__ */ jsx("td", { children: !t.revokedAt && !isBootstrap && /* @__PURE__ */ jsx("button", {
180
+ type: "button",
181
+ onClick: () => revoke(t.id),
182
+ className: "rounded-md border px-2 py-1 text-xs text-rose-700 hover:bg-rose-50",
183
+ children: "revoke"
184
+ }) })
185
+ ]
186
+ }, t.id);
187
+ })] })]
188
+ })
189
+ ]
190
+ });
191
+ }
192
+ //#endregion
193
+ export { TokensPage 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/tokens.tsx?tss-serverfn-split
5
+ var fetchTokens_createServerFn_handler = createServerRpc({
6
+ id: "46e35c9f1afc79423cb49703b454ef684344db08ec19775efd70a8768c7837f1",
7
+ name: "fetchTokens",
8
+ filename: "src/routes/config/tokens.tsx"
9
+ }, (opts) => fetchTokens.__executeServer(opts));
10
+ var fetchTokens = createServerFn({ method: "POST" }).inputValidator((d) => d).handler(fetchTokens_createServerFn_handler, ({ data }) => daemonClient().get(`/api/tokens${data.all ? "?includeRevoked=1" : ""}`));
11
+ //#endregion
12
+ export { fetchTokens_createServerFn_handler };
@@ -0,0 +1,16 @@
1
+ import { t as createServerFn } from "../server.js";
2
+ import { t as createSsrRpc } from "./createSsrRpc-DHBVUN8O.js";
3
+ import { createFileRoute, lazyRouteComponent, redirect } from "@tanstack/react-router";
4
+ //#region src/routes/agents/$id/triggers.tsx
5
+ var $$splitComponentImporter = () => import("./triggers-_iSeahif.js");
6
+ var fetchTriggers = createServerFn({ method: "POST" }).inputValidator((d) => d).handler(createSsrRpc("57ebf437fdb3fcfc63b176e796a55f04bdfec0b230059673196e98d413d15c4d"));
7
+ var Route = createFileRoute("/agents/$id/triggers")({
8
+ loader: async ({ params }) => {
9
+ const data = await fetchTriggers({ data: { id: params.id } });
10
+ if (!data) throw redirect({ to: "/agents" });
11
+ return data;
12
+ },
13
+ component: lazyRouteComponent($$splitComponentImporter, "component")
14
+ });
15
+ //#endregion
16
+ export { Route as t };
@@ -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, r as ApiClientError } from "./daemon-client-2NRMzlTr.js";
4
+ //#region src/routes/agents/$id/triggers.tsx?tss-serverfn-split
5
+ var fetchTriggers_createServerFn_handler = createServerRpc({
6
+ id: "57ebf437fdb3fcfc63b176e796a55f04bdfec0b230059673196e98d413d15c4d",
7
+ name: "fetchTriggers",
8
+ filename: "src/routes/agents/$id/triggers.tsx"
9
+ }, (opts) => fetchTriggers.__executeServer(opts));
10
+ var fetchTriggers = createServerFn({ method: "POST" }).inputValidator((d) => d).handler(fetchTriggers_createServerFn_handler, async ({ data }) => {
11
+ const c = daemonClient();
12
+ let resolved;
13
+ try {
14
+ resolved = await c.get(`/api/agents/${encodeURIComponent(data.id)}`);
15
+ } catch (err) {
16
+ if (err instanceof ApiClientError && err.status === 404) return null;
17
+ throw err;
18
+ }
19
+ const { triggers } = await c.get(`/api/agents/${encodeURIComponent(resolved.agent.id)}/triggers`);
20
+ return {
21
+ resolved,
22
+ triggers
23
+ };
24
+ });
25
+ //#endregion
26
+ export { fetchTriggers_createServerFn_handler };
@@ -0,0 +1,191 @@
1
+ import { t as Route } from "./triggers-DtexqbNH.js";
2
+ import { t as AgentTabs } from "./AgentTabs-BOjTN7QF.js";
3
+ import { useState } from "react";
4
+ import { useRouter } from "@tanstack/react-router";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ //#region src/routes/agents/$id/triggers.tsx?tsr-split=component
7
+ function TriggersPage() {
8
+ const { resolved, triggers } = Route.useLoaderData();
9
+ const router = useRouter();
10
+ async function toggle(t) {
11
+ await fetch(`/api/triggers/${t.id}`, {
12
+ method: "PATCH",
13
+ headers: { "content-type": "application/json" },
14
+ body: JSON.stringify({ enabled: !t.enabled })
15
+ });
16
+ await router.invalidate();
17
+ }
18
+ async function del(id) {
19
+ if (!confirm("delete this trigger?")) return;
20
+ await fetch(`/api/triggers/${id}`, { method: "DELETE" });
21
+ await router.invalidate();
22
+ }
23
+ return /* @__PURE__ */ jsxs("div", { children: [
24
+ /* @__PURE__ */ jsx("header", {
25
+ className: "mb-6",
26
+ children: /* @__PURE__ */ jsx("h1", { children: resolved.agent.name })
27
+ }),
28
+ /* @__PURE__ */ jsx(AgentTabs, {
29
+ agentId: resolved.agent.id,
30
+ active: "triggers",
31
+ archived: resolved.agent.status === "archived"
32
+ }),
33
+ /* @__PURE__ */ jsx(AddTriggerForm, {
34
+ agentId: resolved.agent.id,
35
+ onAdded: () => router.invalidate()
36
+ }),
37
+ /* @__PURE__ */ jsx("h3", {
38
+ className: "mb-3 mt-6 font-body text-[0.85em] font-semibold uppercase tracking-wider text-mocha-light",
39
+ children: "Active triggers"
40
+ }),
41
+ triggers.length === 0 ? /* @__PURE__ */ jsx("p", {
42
+ className: "muted",
43
+ children: "no triggers yet — add one above."
44
+ }) : /* @__PURE__ */ jsxs("table", { children: [/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
45
+ /* @__PURE__ */ jsx("th", { children: "id" }),
46
+ /* @__PURE__ */ jsx("th", { children: "kind" }),
47
+ /* @__PURE__ */ jsx("th", { children: "spec" }),
48
+ /* @__PURE__ */ jsx("th", { children: "message" }),
49
+ /* @__PURE__ */ jsx("th", { children: "last fired" }),
50
+ /* @__PURE__ */ jsx("th", {})
51
+ ] }) }), /* @__PURE__ */ jsx("tbody", { children: triggers.map((t) => {
52
+ const spec = t.kind === "interval" ? `every ${t.intervalSec}s` : t.cronExpr;
53
+ const last = t.lastFiredAt ? new Date(t.lastFiredAt).toLocaleString() : "(never)";
54
+ return /* @__PURE__ */ jsxs("tr", {
55
+ className: t.enabled ? "" : "opacity-60",
56
+ children: [
57
+ /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsxs("code", { children: [t.id.slice(0, 8), "…"] }) }),
58
+ /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx("span", {
59
+ className: "inline-block rounded-sm border border-frost bg-ivory px-2 py-0.5 font-mono text-[0.8em] text-mocha",
60
+ children: t.kind
61
+ }) }),
62
+ /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx("code", { children: spec }) }),
63
+ /* @__PURE__ */ jsx("td", { children: t.message.length > 60 ? `${t.message.slice(0, 60)}…` : t.message }),
64
+ /* @__PURE__ */ jsx("td", {
65
+ className: "text-[0.82em] text-mocha-light",
66
+ children: last
67
+ }),
68
+ /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsxs("div", {
69
+ className: "flex gap-1.5",
70
+ children: [/* @__PURE__ */ jsx("button", {
71
+ type: "button",
72
+ className: "ghost-btn",
73
+ onClick: () => toggle(t),
74
+ children: t.enabled ? "disable" : "enable"
75
+ }), /* @__PURE__ */ jsx("button", {
76
+ type: "button",
77
+ className: "ghost-btn",
78
+ onClick: () => del(t.id),
79
+ children: "delete"
80
+ })]
81
+ }) })
82
+ ]
83
+ }, t.id);
84
+ }) })] })
85
+ ] });
86
+ }
87
+ function AddTriggerForm({ agentId, onAdded }) {
88
+ const [kind, setKind] = useState("interval");
89
+ const [intervalSec, setIntervalSec] = useState(300);
90
+ const [cronExpr, setCronExpr] = useState("");
91
+ const [message, setMessage] = useState("");
92
+ const [err, setErr] = useState(null);
93
+ const [submitting, setSubmitting] = useState(false);
94
+ async function submit(e) {
95
+ e.preventDefault();
96
+ setErr(null);
97
+ if (!message.trim()) {
98
+ setErr("message is required");
99
+ return;
100
+ }
101
+ if (kind === "interval" && (!Number.isFinite(intervalSec) || intervalSec <= 0)) {
102
+ setErr("interval must be a positive number");
103
+ return;
104
+ }
105
+ if (kind === "cron" && !cronExpr.trim()) {
106
+ setErr("cron expression is required");
107
+ return;
108
+ }
109
+ setSubmitting(true);
110
+ try {
111
+ const body = {
112
+ kind,
113
+ message: message.trim()
114
+ };
115
+ if (kind === "interval") body.intervalSec = intervalSec;
116
+ else body.cronExpr = cronExpr.trim();
117
+ const res = await fetch(`/api/agents/${encodeURIComponent(agentId)}/triggers`, {
118
+ method: "POST",
119
+ headers: { "content-type": "application/json" },
120
+ body: JSON.stringify(body)
121
+ });
122
+ if (!res.ok) {
123
+ const e2 = await res.json().catch(() => null);
124
+ throw new Error(e2?.error ?? res.statusText);
125
+ }
126
+ setMessage("");
127
+ setCronExpr("");
128
+ setIntervalSec(300);
129
+ onAdded();
130
+ } catch (e2) {
131
+ setErr(e2.message);
132
+ } finally {
133
+ setSubmitting(false);
134
+ }
135
+ }
136
+ return /* @__PURE__ */ jsxs("form", {
137
+ className: "card",
138
+ onSubmit: submit,
139
+ children: [
140
+ /* @__PURE__ */ jsx("h3", { children: "Add trigger" }),
141
+ /* @__PURE__ */ jsxs("div", {
142
+ className: "mb-3 flex gap-3",
143
+ children: [/* @__PURE__ */ jsxs("label", {
144
+ className: "m-0 inline-flex cursor-pointer items-center gap-1",
145
+ children: [/* @__PURE__ */ jsx("input", {
146
+ type: "radio",
147
+ checked: kind === "interval",
148
+ onChange: () => setKind("interval")
149
+ }), "interval (every N seconds)"]
150
+ }), /* @__PURE__ */ jsxs("label", {
151
+ className: "m-0 inline-flex cursor-pointer items-center gap-1",
152
+ children: [/* @__PURE__ */ jsx("input", {
153
+ type: "radio",
154
+ checked: kind === "cron",
155
+ onChange: () => setKind("cron")
156
+ }), "cron (5-field)"]
157
+ })]
158
+ }),
159
+ kind === "interval" ? /* @__PURE__ */ jsxs("label", { children: ["interval (seconds)", /* @__PURE__ */ jsx("input", {
160
+ type: "number",
161
+ min: 1,
162
+ value: intervalSec,
163
+ onChange: (e) => setIntervalSec(Number(e.target.value))
164
+ })] }) : /* @__PURE__ */ jsxs("label", { children: ["cron expression (minute hour dom month dow)", /* @__PURE__ */ jsx("input", {
165
+ type: "text",
166
+ placeholder: "*/15 * * * *",
167
+ value: cronExpr,
168
+ onChange: (e) => setCronExpr(e.target.value)
169
+ })] }),
170
+ /* @__PURE__ */ jsxs("label", { children: ["message", /* @__PURE__ */ jsx("textarea", {
171
+ placeholder: "e.g. check your inbox and act on anything new",
172
+ value: message,
173
+ onChange: (e) => setMessage(e.target.value),
174
+ className: "font-mono text-[0.9em] min-h-[80px]"
175
+ })] }),
176
+ /* @__PURE__ */ jsxs("div", {
177
+ className: "mt-3 flex items-center gap-3",
178
+ children: [/* @__PURE__ */ jsx("button", {
179
+ type: "submit",
180
+ disabled: submitting,
181
+ children: submitting ? "adding…" : "add"
182
+ }), err && /* @__PURE__ */ jsx("span", {
183
+ className: "text-[0.85em] text-[#9B3D3D]",
184
+ children: err
185
+ })]
186
+ })
187
+ ]
188
+ });
189
+ }
190
+ //#endregion
191
+ export { TriggersPage as component };
@@ -0,0 +1,81 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ //#region src/routes/welcome.tsx?tsr-split=component
3
+ function WelcomePage() {
4
+ return /* @__PURE__ */ jsx("div", {
5
+ className: "mx-auto max-w-2xl",
6
+ children: /* @__PURE__ */ jsxs("div", {
7
+ className: "card",
8
+ children: [
9
+ /* @__PURE__ */ jsx("h1", { children: "Welcome to bazilion" }),
10
+ /* @__PURE__ */ jsxs("p", {
11
+ className: "muted my-3",
12
+ children: [
13
+ "Before you can spawn agents, pick a provider and give it at least one model. Once you do, a ",
14
+ /* @__PURE__ */ jsx("code", { children: "default" }),
15
+ " profile (and a ",
16
+ /* @__PURE__ */ jsx("code", { children: "default" }),
17
+ " group directory) are created automatically and the rest of the app unlocks."
18
+ ]
19
+ }),
20
+ /* @__PURE__ */ jsxs("ol", {
21
+ className: "my-5 space-y-4",
22
+ children: [
23
+ /* @__PURE__ */ jsxs(Step, {
24
+ n: 1,
25
+ children: [
26
+ /* @__PURE__ */ jsx("strong", { children: "Configure credentials." }),
27
+ " Head to the",
28
+ " ",
29
+ /* @__PURE__ */ jsx("a", {
30
+ href: "/config",
31
+ children: "providers tab"
32
+ }),
33
+ " and set the API key or local URL for the service you want to use (Anthropic, OpenAI, Ollama, LMStudio, …)."
34
+ ]
35
+ }),
36
+ /* @__PURE__ */ jsxs(Step, {
37
+ n: 2,
38
+ children: [
39
+ /* @__PURE__ */ jsx("strong", { children: "Enable the provider + add a model." }),
40
+ " Flip the provider's toggle on and list at least one concrete model name (e.g. ",
41
+ /* @__PURE__ */ jsx("code", { children: "claude-opus-4-8" }),
42
+ " or",
43
+ " ",
44
+ /* @__PURE__ */ jsx("code", { children: "llama3.2" }),
45
+ ")."
46
+ ]
47
+ }),
48
+ /* @__PURE__ */ jsxs(Step, {
49
+ n: 3,
50
+ children: [
51
+ /* @__PURE__ */ jsx("strong", { children: "Start chatting." }),
52
+ " You'll be redirected to the home page automatically, where a ",
53
+ /* @__PURE__ */ jsx("code", { children: "default" }),
54
+ " profile is waiting for a first spawn."
55
+ ]
56
+ })
57
+ ]
58
+ }),
59
+ /* @__PURE__ */ jsx("a", {
60
+ href: "/config",
61
+ className: "inline-flex items-center gap-2 rounded-md bg-sapphire px-4 py-2 text-[0.92em] font-semibold text-snow no-underline transition-colors hover:bg-sapphire-deep",
62
+ children: "Go to config →"
63
+ })
64
+ ]
65
+ })
66
+ });
67
+ }
68
+ function Step({ n, children }) {
69
+ return /* @__PURE__ */ jsxs("li", {
70
+ className: "grid grid-cols-[2rem_1fr] gap-3 border-t border-frost pt-3 first:border-t-0 first:pt-0",
71
+ children: [/* @__PURE__ */ jsx("span", {
72
+ className: "text-center font-display text-xl text-sapphire",
73
+ children: n
74
+ }), /* @__PURE__ */ jsx("div", {
75
+ className: "text-[0.92em] leading-relaxed text-mocha",
76
+ children
77
+ })]
78
+ });
79
+ }
80
+ //#endregion
81
+ export { WelcomePage as component };
@@ -0,0 +1,16 @@
1
+ //#region src/lib/wire-constants.ts
2
+ /** Stable id for the auto-seeded `default` profile. */
3
+ var DEFAULT_PROFILE_ID = "default";
4
+ /** Stable id for the auto-seeded `default` group. */
5
+ var DEFAULT_GROUP_ID = "default";
6
+ /** Mirrors the daemon's REASONING_LEVELS (apps/daemon/src/core). */
7
+ var REASONING_LEVELS = [
8
+ "off",
9
+ "minimal",
10
+ "low",
11
+ "medium",
12
+ "high",
13
+ "xhigh"
14
+ ];
15
+ //#endregion
16
+ export { DEFAULT_PROFILE_ID as n, REASONING_LEVELS as r, DEFAULT_GROUP_ID as t };