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.
- package/README.md +17 -12
- package/dist/cli.js +383 -152
- package/dist/cli.js.map +1 -1
- package/dist/daemon.js +238 -14064
- package/dist/daemon.js.map +1 -1
- package/dist/web/client/assets/AgentAvatar-JYijLvZ2.js +1 -0
- package/dist/web/client/assets/AgentTabs-DioGqUVR.js +1 -0
- package/dist/web/client/assets/Button-ByiV6fpd.js +1 -0
- package/dist/web/client/assets/ChatPane-DzEgOEqS.js +74 -0
- package/dist/web/client/assets/ConfigTabs-pY-V0Rie.js +1 -0
- package/dist/web/client/assets/FieldRow-CNKma5LE.js +1 -0
- package/dist/web/client/assets/MembersEditor-C6UpqDdV.js +1 -0
- package/dist/web/client/assets/SpawnTeamModal-BEkNCKXm.js +1 -0
- package/dist/web/client/assets/TemplatesTabs-Da7mg9FI.js +1 -0
- package/dist/web/client/assets/_id-BdKmo0gb.js +1 -0
- package/dist/web/client/assets/_id-LT6Ejjr0.js +1 -0
- package/dist/web/client/assets/_id-MR2XjWh0.js +1 -0
- package/dist/web/client/assets/_id-_6jIt0_-.js +1 -0
- package/dist/web/client/assets/agents-0arKbVYG.js +1 -0
- package/dist/web/client/assets/config-BSAVT-17.js +3 -0
- package/dist/web/client/assets/groups-BqTkhHes.js +1 -0
- package/dist/web/client/assets/inbox-ozoCXzr5.js +1 -0
- package/dist/web/client/assets/index-iayCEuU2.js +12 -0
- package/dist/web/client/assets/jsx-runtime-DGeXAQPT.js +1 -0
- package/dist/web/client/assets/login-D8lNr2SX.js +1 -0
- package/dist/web/client/assets/mcp-BLnngDsj.js +1 -0
- package/dist/web/client/assets/memory-D1GQjEvN.js +1 -0
- package/dist/web/client/assets/preload-helper-CvnapA2_.js +1 -0
- package/dist/web/client/assets/profile-groups-C2yJPTaE.js +1 -0
- package/dist/web/client/assets/profiles-BV7AAZjj.js +1 -0
- package/dist/web/client/assets/routes-DSHQLA7K.js +1 -0
- package/dist/web/client/assets/services-BbCJe1Du.js +1 -0
- package/dist/web/client/assets/skills-C6czKR5I.js +1 -0
- package/dist/web/client/assets/styles-C06axZZk.css +2 -0
- package/dist/web/client/assets/telegram-gE4j8gte.js +1 -0
- package/dist/web/client/assets/tokens-D2_O9ARe.js +1 -0
- package/dist/web/client/assets/triggers-WljnfEfJ.js +1 -0
- package/dist/web/client/assets/welcome-Dn-zvmBE.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-81NrHA5d.js +16 -0
- package/dist/web/server/assets/_id-BKev9H1p.js +12 -0
- package/dist/web/server/assets/_id-BNwlbWHP.js +24 -0
- package/dist/web/server/assets/_id-BqnDy_Ca.js +16 -0
- package/dist/web/server/assets/_id-CRqqi8IE.js +161 -0
- package/dist/web/server/assets/_id-CXg-Blec.js +367 -0
- package/dist/web/server/assets/_id-CnQflrRv.js +16 -0
- package/dist/web/server/assets/_id-D0ytyXGY.js +662 -0
- package/dist/web/server/assets/_id-D8duqgd5.js +27 -0
- package/dist/web/server/assets/_id-DDixKEud.js +467 -0
- package/dist/web/server/assets/_id-D_Ew11ED.js +28 -0
- package/dist/web/server/assets/_id-Sjw0zhA6.js +38 -0
- package/dist/web/server/assets/_tanstack-start-manifest_v-DBlFH2gg.js +178 -0
- package/dist/web/server/assets/agents-C7SBPN0M.js +210 -0
- package/dist/web/server/assets/agents-ChcAJUI5.js +14 -0
- package/dist/web/server/assets/agents-k5QURC4I.js +26 -0
- package/dist/web/server/assets/auth-DzRAMwVt.js +26 -0
- package/dist/web/server/assets/config-Bq3o924J.js +12 -0
- package/dist/web/server/assets/config-CHaCv89D.js +19 -0
- package/dist/web/server/assets/config-CdVjqjin.js +391 -0
- package/dist/web/server/assets/createServerRpc-CeKECg65.js +12 -0
- package/dist/web/server/assets/createSsrRpc-ZBGxhl8t.js +16 -0
- package/dist/web/server/assets/daemon-client-2NRMzlTr.js +96 -0
- package/dist/web/server/assets/empty-plugin-adapters-DKUlnwwl.js +5 -0
- package/dist/web/server/assets/groups-CbSwND2r.js +12 -0
- package/dist/web/server/assets/groups-CeRRlZaZ.js +150 -0
- package/dist/web/server/assets/groups-pk4CYSuf.js +21 -0
- package/dist/web/server/assets/inbox-Bxb3W04M.js +27 -0
- package/dist/web/server/assets/inbox-CkiSvD14.js +42 -0
- package/dist/web/server/assets/inbox-DU27iHv_.js +133 -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-BU_kKENi.js +268 -0
- package/dist/web/server/assets/mcp-BsFKEoXt.js +12 -0
- package/dist/web/server/assets/mcp-CKqwG4mt.js +12 -0
- package/dist/web/server/assets/memory-BaYnfm7K.js +28 -0
- package/dist/web/server/assets/memory-CQaqWnyM.js +284 -0
- package/dist/web/server/assets/memory-Ns2-Z31p.js +16 -0
- package/dist/web/server/assets/profile-groups-CiU06yN1.js +28 -0
- package/dist/web/server/assets/profile-groups-D21MYoLM.js +208 -0
- package/dist/web/server/assets/profile-groups-aoJleXHP.js +12 -0
- package/dist/web/server/assets/profiles-C6a3RKgu.js +26 -0
- package/dist/web/server/assets/profiles-CZ5NkmVw.js +12 -0
- package/dist/web/server/assets/profiles-LxcC_L6n.js +453 -0
- package/dist/web/server/assets/router-BpBZgRwn.js +460 -0
- package/dist/web/server/assets/routes-C61gBiXa.js +57 -0
- package/dist/web/server/assets/routes-Ce2VWrU9.js +33 -0
- package/dist/web/server/assets/routes-V9URcp1v.js +14 -0
- package/dist/web/server/assets/services-B91w2f-X.js +94 -0
- package/dist/web/server/assets/services-Ccc5s2bS.js +17 -0
- package/dist/web/server/assets/services-DhRiNeq0.js +12 -0
- package/dist/web/server/assets/skills-CFIWVg32.js +12 -0
- package/dist/web/server/assets/skills-CpsyR_WA.js +12 -0
- package/dist/web/server/assets/skills-dLyBZb3B.js +261 -0
- package/dist/web/server/assets/start-CYDpZ6cb.js +4 -0
- package/dist/web/server/assets/telegram-BdaUIjvs.js +12 -0
- package/dist/web/server/assets/telegram-DfAddLdv.js +583 -0
- package/dist/web/server/assets/telegram-T3l9KtiE.js +12 -0
- package/dist/web/server/assets/tokens-BCz3PSoT.js +12 -0
- package/dist/web/server/assets/tokens-CkKqrtk-.js +193 -0
- package/dist/web/server/assets/tokens-DdpnfV_Y.js +14 -0
- package/dist/web/server/assets/triggers-BcH_6PW1.js +26 -0
- package/dist/web/server/assets/triggers-BcTTwMfy.js +16 -0
- package/dist/web/server/assets/triggers-BzJG1nN5.js +191 -0
- package/dist/web/server/assets/welcome-CP4CZ9B6.js +85 -0
- package/dist/web/server/assets/wire-constants-Deb4NxBb.js +16 -0
- package/dist/web/server/server.js +5911 -0
- package/dist/web-server.js +42 -0
- package/dist/web-server.js.map +1 -0
- package/dist/worker.js +65 -2
- package/dist/worker.js.map +1 -1
- package/package.json +18 -12
|
@@ -0,0 +1,529 @@
|
|
|
1
|
+
import "./wire-constants-Deb4NxBb.js";
|
|
2
|
+
import { t as SpawnTeamModal } from "./SpawnTeamModal-dSN421k_.js";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { Link, useNavigate, useRouter } from "@tanstack/react-router";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/CreateGroupDialog.tsx
|
|
7
|
+
function CreateGroupDialog({ onClose }) {
|
|
8
|
+
const router = useRouter();
|
|
9
|
+
const [id, setId] = useState("");
|
|
10
|
+
const [name, setName] = useState("");
|
|
11
|
+
const [link, setLink] = useState("");
|
|
12
|
+
const [busy, setBusy] = useState(false);
|
|
13
|
+
const [err, setErr] = useState(null);
|
|
14
|
+
async function submit(e) {
|
|
15
|
+
e.preventDefault();
|
|
16
|
+
setErr(null);
|
|
17
|
+
if (!id.trim()) {
|
|
18
|
+
setErr("id is required");
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
setBusy(true);
|
|
22
|
+
try {
|
|
23
|
+
const body = { id: id.trim() };
|
|
24
|
+
if (name.trim()) body.name = name.trim();
|
|
25
|
+
if (link.trim()) body.link = link.trim();
|
|
26
|
+
const res = await fetch("/api/groups", {
|
|
27
|
+
method: "POST",
|
|
28
|
+
headers: { "content-type": "application/json" },
|
|
29
|
+
body: JSON.stringify(body)
|
|
30
|
+
});
|
|
31
|
+
if (!res.ok) {
|
|
32
|
+
const e = await res.json().catch(() => ({}));
|
|
33
|
+
throw new Error(e.error ?? `${res.status} ${res.statusText}`);
|
|
34
|
+
}
|
|
35
|
+
onClose();
|
|
36
|
+
await router.invalidate();
|
|
37
|
+
} catch (e) {
|
|
38
|
+
setErr(e.message);
|
|
39
|
+
setBusy(false);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return /* @__PURE__ */ jsx("div", {
|
|
43
|
+
onClick: onClose,
|
|
44
|
+
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/30 backdrop-blur-[1px]",
|
|
45
|
+
children: /* @__PURE__ */ jsxs("form", {
|
|
46
|
+
onSubmit: submit,
|
|
47
|
+
onClick: (e) => e.stopPropagation(),
|
|
48
|
+
className: "w-full max-w-md rounded-2xl border bg-card p-6 shadow-lg",
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ jsx("h3", {
|
|
51
|
+
className: "font-serif text-xl text-foreground mb-1",
|
|
52
|
+
children: "Create a new group"
|
|
53
|
+
}),
|
|
54
|
+
/* @__PURE__ */ jsxs("p", {
|
|
55
|
+
className: "text-sm text-muted-foreground mb-4",
|
|
56
|
+
children: [
|
|
57
|
+
"A group is a collaboration context — one filesystem root, one USER.md, one roster. The slot lives at ",
|
|
58
|
+
/* @__PURE__ */ jsx("code", {
|
|
59
|
+
className: "font-mono",
|
|
60
|
+
children: "~/.bazilion/groups/<slug>/"
|
|
61
|
+
}),
|
|
62
|
+
"."
|
|
63
|
+
]
|
|
64
|
+
}),
|
|
65
|
+
/* @__PURE__ */ jsxs("div", {
|
|
66
|
+
className: "grid grid-cols-2 gap-3 mb-3",
|
|
67
|
+
children: [/* @__PURE__ */ jsxs("label", {
|
|
68
|
+
className: "block text-sm",
|
|
69
|
+
children: ["ID (slug)", /* @__PURE__ */ jsx("input", {
|
|
70
|
+
type: "text",
|
|
71
|
+
value: id,
|
|
72
|
+
onChange: (e) => setId(e.target.value),
|
|
73
|
+
required: true,
|
|
74
|
+
pattern: "[a-z0-9][a-z0-9_-]*",
|
|
75
|
+
placeholder: "myproject",
|
|
76
|
+
autoFocus: true,
|
|
77
|
+
className: "mt-1 block w-full rounded-md border bg-background px-3 py-2 outline-none focus:ring-2 focus:ring-ring/30"
|
|
78
|
+
})]
|
|
79
|
+
}), /* @__PURE__ */ jsxs("label", {
|
|
80
|
+
className: "block text-sm",
|
|
81
|
+
children: [
|
|
82
|
+
"Name ",
|
|
83
|
+
/* @__PURE__ */ jsx("span", {
|
|
84
|
+
className: "text-muted-foreground font-normal",
|
|
85
|
+
children: "(optional)"
|
|
86
|
+
}),
|
|
87
|
+
/* @__PURE__ */ jsx("input", {
|
|
88
|
+
type: "text",
|
|
89
|
+
value: name,
|
|
90
|
+
onChange: (e) => setName(e.target.value),
|
|
91
|
+
className: "mt-1 block w-full rounded-md border bg-background px-3 py-2 outline-none focus:ring-2 focus:ring-ring/30"
|
|
92
|
+
})
|
|
93
|
+
]
|
|
94
|
+
})]
|
|
95
|
+
}),
|
|
96
|
+
/* @__PURE__ */ jsxs("label", {
|
|
97
|
+
className: "block text-sm mb-3",
|
|
98
|
+
children: [
|
|
99
|
+
"Link target",
|
|
100
|
+
" ",
|
|
101
|
+
/* @__PURE__ */ jsx("span", {
|
|
102
|
+
className: "text-muted-foreground font-normal",
|
|
103
|
+
children: "(optional, absolute path)"
|
|
104
|
+
}),
|
|
105
|
+
/* @__PURE__ */ jsx("input", {
|
|
106
|
+
type: "text",
|
|
107
|
+
value: link,
|
|
108
|
+
onChange: (e) => setLink(e.target.value),
|
|
109
|
+
placeholder: "/home/you/projects/myrepo",
|
|
110
|
+
className: "mt-1 block w-full rounded-md border bg-background px-3 py-2 outline-none focus:ring-2 focus:ring-ring/30"
|
|
111
|
+
}),
|
|
112
|
+
/* @__PURE__ */ jsx("span", {
|
|
113
|
+
className: "mt-1 block text-xs text-muted-foreground",
|
|
114
|
+
children: "Leave blank to create a fresh directory. Supply an absolute path to materialize the slot as a symlink to your existing project tree."
|
|
115
|
+
})
|
|
116
|
+
]
|
|
117
|
+
}),
|
|
118
|
+
err && /* @__PURE__ */ jsx("p", {
|
|
119
|
+
className: "mt-2 text-sm text-rose-700",
|
|
120
|
+
children: err
|
|
121
|
+
}),
|
|
122
|
+
/* @__PURE__ */ jsxs("div", {
|
|
123
|
+
className: "mt-5 flex justify-end gap-2",
|
|
124
|
+
children: [/* @__PURE__ */ jsx("button", {
|
|
125
|
+
type: "button",
|
|
126
|
+
onClick: onClose,
|
|
127
|
+
className: "rounded-md border px-3 py-2 text-sm text-foreground hover:bg-accent",
|
|
128
|
+
children: "Cancel"
|
|
129
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
130
|
+
type: "submit",
|
|
131
|
+
disabled: busy,
|
|
132
|
+
className: "rounded-md bg-primary px-3 py-2 text-sm font-medium text-primary-foreground disabled:opacity-50",
|
|
133
|
+
children: busy ? "Creating…" : "Create"
|
|
134
|
+
})]
|
|
135
|
+
})
|
|
136
|
+
]
|
|
137
|
+
})
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
//#endregion
|
|
141
|
+
//#region src/components/SpawnDialog.tsx
|
|
142
|
+
function SpawnDialog({ profileId, groupHint, groups, onClose }) {
|
|
143
|
+
const navigate = useNavigate();
|
|
144
|
+
const [name, setName] = useState("");
|
|
145
|
+
const [groupId, setGroupId] = useState(groupHint ?? "default");
|
|
146
|
+
const [busy, setBusy] = useState(false);
|
|
147
|
+
const [err, setErr] = useState(null);
|
|
148
|
+
async function submit(e) {
|
|
149
|
+
e.preventDefault();
|
|
150
|
+
setErr(null);
|
|
151
|
+
setBusy(true);
|
|
152
|
+
try {
|
|
153
|
+
const body = { profile: profileId };
|
|
154
|
+
if (name.trim()) body.name = name.trim();
|
|
155
|
+
if (groupId) body.groupId = groupId;
|
|
156
|
+
const res = await fetch("/api/agents", {
|
|
157
|
+
method: "POST",
|
|
158
|
+
headers: { "content-type": "application/json" },
|
|
159
|
+
body: JSON.stringify(body)
|
|
160
|
+
});
|
|
161
|
+
if (!res.ok) {
|
|
162
|
+
const e = await res.json().catch(() => ({}));
|
|
163
|
+
throw new Error(e.error ?? `${res.status} ${res.statusText}`);
|
|
164
|
+
}
|
|
165
|
+
const created = await res.json();
|
|
166
|
+
onClose();
|
|
167
|
+
await navigate({
|
|
168
|
+
to: "/",
|
|
169
|
+
search: { agent: created.id }
|
|
170
|
+
});
|
|
171
|
+
} catch (e) {
|
|
172
|
+
setErr(e.message);
|
|
173
|
+
setBusy(false);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return /* @__PURE__ */ jsx(Backdrop, {
|
|
177
|
+
onClose,
|
|
178
|
+
children: /* @__PURE__ */ jsxs("form", {
|
|
179
|
+
onSubmit: submit,
|
|
180
|
+
className: "w-full max-w-md rounded-2xl border bg-card p-6 shadow-lg",
|
|
181
|
+
onClick: (e) => e.stopPropagation(),
|
|
182
|
+
children: [
|
|
183
|
+
/* @__PURE__ */ jsx("h3", {
|
|
184
|
+
className: "font-serif text-xl text-foreground mb-1",
|
|
185
|
+
children: "Spawn a new agent"
|
|
186
|
+
}),
|
|
187
|
+
/* @__PURE__ */ jsxs("p", {
|
|
188
|
+
className: "text-sm text-muted-foreground mb-4",
|
|
189
|
+
children: ["Profile: ", /* @__PURE__ */ jsx("code", {
|
|
190
|
+
className: "font-mono",
|
|
191
|
+
children: profileId
|
|
192
|
+
})]
|
|
193
|
+
}),
|
|
194
|
+
/* @__PURE__ */ jsxs("label", {
|
|
195
|
+
className: "block text-sm text-foreground mb-3",
|
|
196
|
+
children: [
|
|
197
|
+
"Agent name",
|
|
198
|
+
" ",
|
|
199
|
+
/* @__PURE__ */ jsx("span", {
|
|
200
|
+
className: "text-muted-foreground font-normal",
|
|
201
|
+
children: "(optional — defaults to the profile's name)"
|
|
202
|
+
}),
|
|
203
|
+
/* @__PURE__ */ jsx("input", {
|
|
204
|
+
type: "text",
|
|
205
|
+
value: name,
|
|
206
|
+
onChange: (e) => setName(e.target.value),
|
|
207
|
+
autoFocus: true,
|
|
208
|
+
autoComplete: "off",
|
|
209
|
+
className: "mt-1 block w-full rounded-md border bg-background px-3 py-2 outline-none focus:ring-2 focus:ring-ring/30"
|
|
210
|
+
})
|
|
211
|
+
]
|
|
212
|
+
}),
|
|
213
|
+
/* @__PURE__ */ jsxs("label", {
|
|
214
|
+
className: "block text-sm text-foreground mb-3",
|
|
215
|
+
children: ["Group", /* @__PURE__ */ jsx("select", {
|
|
216
|
+
value: groupId,
|
|
217
|
+
onChange: (e) => setGroupId(e.target.value),
|
|
218
|
+
className: "mt-1 block w-full rounded-md border bg-background px-3 py-2 outline-none focus:ring-2 focus:ring-ring/30",
|
|
219
|
+
children: groups.map((g) => /* @__PURE__ */ jsxs("option", {
|
|
220
|
+
value: g.id,
|
|
221
|
+
children: [g.name, g.id === "default" ? " (default)" : ""]
|
|
222
|
+
}, g.id))
|
|
223
|
+
})]
|
|
224
|
+
}),
|
|
225
|
+
err && /* @__PURE__ */ jsx("p", {
|
|
226
|
+
className: "mt-2 text-sm text-rose-700",
|
|
227
|
+
children: err
|
|
228
|
+
}),
|
|
229
|
+
/* @__PURE__ */ jsxs("div", {
|
|
230
|
+
className: "mt-5 flex justify-end gap-2",
|
|
231
|
+
children: [/* @__PURE__ */ jsx("button", {
|
|
232
|
+
type: "button",
|
|
233
|
+
onClick: onClose,
|
|
234
|
+
className: "rounded-md border px-3 py-2 text-sm text-foreground hover:bg-accent",
|
|
235
|
+
children: "Cancel"
|
|
236
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
237
|
+
type: "submit",
|
|
238
|
+
disabled: busy,
|
|
239
|
+
className: "rounded-md bg-primary px-3 py-2 text-sm font-medium text-primary-foreground disabled:opacity-50",
|
|
240
|
+
children: busy ? "Creating…" : "Create"
|
|
241
|
+
})]
|
|
242
|
+
})
|
|
243
|
+
]
|
|
244
|
+
})
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
function Backdrop({ children, onClose }) {
|
|
248
|
+
return /* @__PURE__ */ jsx("div", {
|
|
249
|
+
onClick: onClose,
|
|
250
|
+
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/30 backdrop-blur-[1px]",
|
|
251
|
+
children
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
//#endregion
|
|
255
|
+
//#region src/components/Sidebar.tsx
|
|
256
|
+
var SIDEBAR_OPEN_GROUPS_COOKIE = "bz_sidebar_open_groups";
|
|
257
|
+
function writeOpenGroupsCookie(map) {
|
|
258
|
+
if (typeof document === "undefined") return;
|
|
259
|
+
const value = encodeURIComponent(JSON.stringify(map));
|
|
260
|
+
document.cookie = `${SIDEBAR_OPEN_GROUPS_COOKIE}=${value}; Path=/; Max-Age=31536000; SameSite=Lax`;
|
|
261
|
+
}
|
|
262
|
+
function Sidebar({ agents, groups, profiles, profileGroups, selectedAgentId, initialOpenGroups }) {
|
|
263
|
+
const router = useRouter();
|
|
264
|
+
const [spawnFor, setSpawnFor] = useState(null);
|
|
265
|
+
const [spawnTeamFor, setSpawnTeamFor] = useState(null);
|
|
266
|
+
const [createGroupOpen, setCreateGroupOpen] = useState(false);
|
|
267
|
+
const [menuOpen, setMenuOpen] = useState(false);
|
|
268
|
+
const [openGroups, setOpenGroups] = useState(() => initialOpenGroups ?? {});
|
|
269
|
+
async function rename(a) {
|
|
270
|
+
const next = window.prompt(`rename "${a.name}" to:`, a.name)?.trim();
|
|
271
|
+
if (!next || next === a.name) return;
|
|
272
|
+
const res = await fetch(`/api/agents/${a.id}`, {
|
|
273
|
+
method: "PATCH",
|
|
274
|
+
headers: { "content-type": "application/json" },
|
|
275
|
+
body: JSON.stringify({ name: next })
|
|
276
|
+
});
|
|
277
|
+
if (!res.ok) {
|
|
278
|
+
const body = await res.json().catch(() => null);
|
|
279
|
+
alert(body?.error ?? res.statusText);
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
await router.invalidate();
|
|
283
|
+
}
|
|
284
|
+
async function archive(a) {
|
|
285
|
+
if (!confirm(`archive "${a.name}"? (reversible — find under "show archived")`)) return;
|
|
286
|
+
const res = await fetch(`/api/agents/${a.id}/archive`, { method: "POST" });
|
|
287
|
+
if (!res.ok && res.status !== 204) {
|
|
288
|
+
alert(res.statusText);
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
await router.invalidate();
|
|
292
|
+
}
|
|
293
|
+
const sortedProfiles = [...profiles].sort((a, b) => {
|
|
294
|
+
if (a.id === "default") return -1;
|
|
295
|
+
if (b.id === "default") return 1;
|
|
296
|
+
return 0;
|
|
297
|
+
});
|
|
298
|
+
const sortedGroups = [...groups].sort((a, b) => {
|
|
299
|
+
if (a.id === "default") return -1;
|
|
300
|
+
if (b.id === "default") return 1;
|
|
301
|
+
return 0;
|
|
302
|
+
});
|
|
303
|
+
const agentsByGroup = /* @__PURE__ */ new Map();
|
|
304
|
+
for (const a of agents) {
|
|
305
|
+
const list = agentsByGroup.get(a.groupId) ?? [];
|
|
306
|
+
list.push(a);
|
|
307
|
+
agentsByGroup.set(a.groupId, list);
|
|
308
|
+
}
|
|
309
|
+
const selectedGroupId = agents.find((a) => a.id === selectedAgentId)?.groupId ?? null;
|
|
310
|
+
return /* @__PURE__ */ jsxs("aside", {
|
|
311
|
+
className: "flex h-full flex-col rounded-lg border bg-card overflow-hidden",
|
|
312
|
+
children: [
|
|
313
|
+
/* @__PURE__ */ jsxs("header", {
|
|
314
|
+
className: "flex items-center justify-between border-b px-3 py-2.5 bg-muted/30",
|
|
315
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
316
|
+
className: "font-serif text-base text-foreground",
|
|
317
|
+
children: "agents"
|
|
318
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
319
|
+
className: "relative",
|
|
320
|
+
children: [/* @__PURE__ */ jsx("button", {
|
|
321
|
+
type: "button",
|
|
322
|
+
onClick: () => setMenuOpen((v) => !v),
|
|
323
|
+
className: "rounded-md border px-2 py-1 text-xs text-muted-foreground hover:text-foreground hover:border-foreground/30",
|
|
324
|
+
children: "+ new ▾"
|
|
325
|
+
}), menuOpen && /* @__PURE__ */ jsxs("div", {
|
|
326
|
+
role: "menu",
|
|
327
|
+
className: "absolute right-0 top-[calc(100%+0.3rem)] z-20 min-w-[14rem] rounded-md border bg-popover p-1 shadow-md",
|
|
328
|
+
onMouseLeave: () => setMenuOpen(false),
|
|
329
|
+
children: [
|
|
330
|
+
profiles.length === 0 ? /* @__PURE__ */ jsxs("div", {
|
|
331
|
+
className: "px-3 py-2 text-sm text-muted-foreground",
|
|
332
|
+
children: [
|
|
333
|
+
"No profiles yet.",
|
|
334
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
335
|
+
/* @__PURE__ */ jsx("a", {
|
|
336
|
+
href: "/profiles",
|
|
337
|
+
className: "text-primary underline",
|
|
338
|
+
children: "Create one"
|
|
339
|
+
}),
|
|
340
|
+
" ",
|
|
341
|
+
"to spawn agents."
|
|
342
|
+
]
|
|
343
|
+
}) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
|
|
344
|
+
className: "px-3 pt-1 pb-0.5 text-[0.7em] uppercase tracking-wide text-muted-foreground",
|
|
345
|
+
children: "spawn agent from template"
|
|
346
|
+
}), sortedProfiles.map((p) => /* @__PURE__ */ jsxs("button", {
|
|
347
|
+
type: "button",
|
|
348
|
+
role: "menuitem",
|
|
349
|
+
onClick: () => {
|
|
350
|
+
setMenuOpen(false);
|
|
351
|
+
setSpawnFor({ profileId: p.id });
|
|
352
|
+
},
|
|
353
|
+
className: "flex w-full items-center justify-between rounded-sm px-3 py-1.5 text-sm hover:bg-accent",
|
|
354
|
+
children: [/* @__PURE__ */ jsx("span", { children: p.name || p.id }), p.id === "default" && /* @__PURE__ */ jsx("span", {
|
|
355
|
+
className: "rounded bg-muted px-1 text-[0.7em] text-muted-foreground",
|
|
356
|
+
children: "default"
|
|
357
|
+
})]
|
|
358
|
+
}, p.id))] }),
|
|
359
|
+
/* @__PURE__ */ jsx("div", { className: "my-1 h-px bg-border" }),
|
|
360
|
+
/* @__PURE__ */ jsx("div", {
|
|
361
|
+
className: "px-3 pt-1 pb-0.5 text-[0.7em] uppercase tracking-wide text-muted-foreground",
|
|
362
|
+
children: "spawn group from template"
|
|
363
|
+
}),
|
|
364
|
+
profileGroups.length === 0 ? /* @__PURE__ */ jsxs("div", {
|
|
365
|
+
className: "px-3 py-1.5 text-xs text-muted-foreground",
|
|
366
|
+
children: [
|
|
367
|
+
"No team templates yet.",
|
|
368
|
+
" ",
|
|
369
|
+
/* @__PURE__ */ jsx("a", {
|
|
370
|
+
href: "/profile-groups",
|
|
371
|
+
className: "text-primary underline",
|
|
372
|
+
children: "Create one"
|
|
373
|
+
}),
|
|
374
|
+
"."
|
|
375
|
+
]
|
|
376
|
+
}) : profileGroups.map((pg) => /* @__PURE__ */ jsxs("button", {
|
|
377
|
+
type: "button",
|
|
378
|
+
role: "menuitem",
|
|
379
|
+
disabled: pg.memberCount === 0,
|
|
380
|
+
title: pg.memberCount === 0 ? "add at least one member before spawning" : void 0,
|
|
381
|
+
onClick: () => {
|
|
382
|
+
setMenuOpen(false);
|
|
383
|
+
setSpawnTeamFor(pg);
|
|
384
|
+
},
|
|
385
|
+
className: "flex w-full items-center justify-between rounded-sm px-3 py-1.5 text-sm hover:bg-accent disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent",
|
|
386
|
+
children: [/* @__PURE__ */ jsx("span", { children: pg.name || pg.id }), /* @__PURE__ */ jsx("span", {
|
|
387
|
+
className: "font-mono text-[0.7em] text-muted-foreground",
|
|
388
|
+
children: pg.memberCount
|
|
389
|
+
})]
|
|
390
|
+
}, pg.id)),
|
|
391
|
+
/* @__PURE__ */ jsx("div", { className: "my-1 h-px bg-border" }),
|
|
392
|
+
/* @__PURE__ */ jsx("button", {
|
|
393
|
+
type: "button",
|
|
394
|
+
onClick: () => {
|
|
395
|
+
setMenuOpen(false);
|
|
396
|
+
setCreateGroupOpen(true);
|
|
397
|
+
},
|
|
398
|
+
className: "block w-full text-left rounded-sm px-3 py-1.5 text-xs text-muted-foreground hover:bg-accent",
|
|
399
|
+
children: "+ create group"
|
|
400
|
+
})
|
|
401
|
+
]
|
|
402
|
+
})]
|
|
403
|
+
})]
|
|
404
|
+
}),
|
|
405
|
+
/* @__PURE__ */ jsx("nav", {
|
|
406
|
+
className: "flex-1 overflow-y-auto p-1",
|
|
407
|
+
children: agents.length === 0 && groups.length === 0 ? /* @__PURE__ */ jsxs("div", {
|
|
408
|
+
className: "p-4 text-sm text-muted-foreground",
|
|
409
|
+
children: [
|
|
410
|
+
"No agents yet.",
|
|
411
|
+
" ",
|
|
412
|
+
/* @__PURE__ */ jsx("a", {
|
|
413
|
+
href: "/agents",
|
|
414
|
+
className: "text-primary underline",
|
|
415
|
+
children: "Spawn one"
|
|
416
|
+
}),
|
|
417
|
+
" ",
|
|
418
|
+
"to start chatting."
|
|
419
|
+
]
|
|
420
|
+
}) : sortedGroups.map((g) => {
|
|
421
|
+
const groupAgents = agentsByGroup.get(g.id) ?? [];
|
|
422
|
+
const containsSelected = selectedGroupId === g.id;
|
|
423
|
+
const stored = openGroups[g.id];
|
|
424
|
+
return /* @__PURE__ */ jsxs("details", {
|
|
425
|
+
open: stored !== void 0 ? stored : containsSelected || g.id === "default",
|
|
426
|
+
onToggle: (e) => {
|
|
427
|
+
const next = e.currentTarget.open;
|
|
428
|
+
if (openGroups[g.id] === next) return;
|
|
429
|
+
const merged = {
|
|
430
|
+
...openGroups,
|
|
431
|
+
[g.id]: next
|
|
432
|
+
};
|
|
433
|
+
writeOpenGroupsCookie(merged);
|
|
434
|
+
setOpenGroups(merged);
|
|
435
|
+
router.invalidate();
|
|
436
|
+
},
|
|
437
|
+
className: "group/details mb-1 last:mb-0",
|
|
438
|
+
children: [/* @__PURE__ */ jsxs("summary", {
|
|
439
|
+
className: "flex cursor-pointer list-none items-center gap-1.5 rounded-sm px-2 py-1.5 text-xs uppercase tracking-wide text-muted-foreground hover:bg-accent",
|
|
440
|
+
children: [
|
|
441
|
+
/* @__PURE__ */ jsx("span", {
|
|
442
|
+
className: "w-3 text-xs transition-transform group-open/details:rotate-90 inline-block",
|
|
443
|
+
children: "▸"
|
|
444
|
+
}),
|
|
445
|
+
/* @__PURE__ */ jsx("span", {
|
|
446
|
+
className: "flex-1 truncate font-semibold",
|
|
447
|
+
children: g.name
|
|
448
|
+
}),
|
|
449
|
+
/* @__PURE__ */ jsx("span", {
|
|
450
|
+
className: "font-mono text-xs rounded bg-muted px-1 min-w-[1.4em] text-center",
|
|
451
|
+
children: groupAgents.length
|
|
452
|
+
})
|
|
453
|
+
]
|
|
454
|
+
}), groupAgents.length === 0 ? /* @__PURE__ */ jsx("div", {
|
|
455
|
+
className: "pl-6 py-1 text-xs italic text-muted-foreground",
|
|
456
|
+
children: "no agents"
|
|
457
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
458
|
+
className: "pl-2",
|
|
459
|
+
children: groupAgents.map((a) => /* @__PURE__ */ jsxs("div", {
|
|
460
|
+
className: "group/row relative",
|
|
461
|
+
children: [/* @__PURE__ */ jsxs(Link, {
|
|
462
|
+
to: "/",
|
|
463
|
+
search: { agent: a.id },
|
|
464
|
+
className: `block rounded-sm border-l-2 px-3 py-1.5 pr-14 hover:bg-accent ${a.id === selectedAgentId ? "border-primary bg-accent" : "border-transparent"}`,
|
|
465
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
466
|
+
className: "flex items-center gap-1.5 truncate text-sm font-medium",
|
|
467
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
468
|
+
className: "truncate",
|
|
469
|
+
children: a.name
|
|
470
|
+
}), a.telegramTopicId !== null && /* @__PURE__ */ jsx("span", {
|
|
471
|
+
className: "text-xs",
|
|
472
|
+
title: `Telegram topic #${a.telegramTopicId}`,
|
|
473
|
+
"aria-label": `Bound to Telegram topic ${a.telegramTopicId}`,
|
|
474
|
+
children: "✈"
|
|
475
|
+
})]
|
|
476
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
477
|
+
className: "flex gap-2 font-mono text-[0.7em] text-muted-foreground",
|
|
478
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
479
|
+
className: "uppercase tracking-wide",
|
|
480
|
+
children: a.status
|
|
481
|
+
}), /* @__PURE__ */ jsx("code", { children: a.id.slice(0, 8) })]
|
|
482
|
+
})]
|
|
483
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
484
|
+
className: "absolute right-1 top-1 flex gap-0.5 opacity-0 transition-opacity group-hover/row:opacity-100 focus-within:opacity-100",
|
|
485
|
+
children: [/* @__PURE__ */ jsx("button", {
|
|
486
|
+
type: "button",
|
|
487
|
+
onClick: () => rename(a),
|
|
488
|
+
title: "rename",
|
|
489
|
+
"aria-label": `rename ${a.name}`,
|
|
490
|
+
className: "unstyled flex h-6 w-6 items-center justify-center rounded-sm text-mocha-light hover:bg-snow hover:text-sapphire",
|
|
491
|
+
children: "✎"
|
|
492
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
493
|
+
type: "button",
|
|
494
|
+
onClick: () => archive(a),
|
|
495
|
+
title: "archive",
|
|
496
|
+
"aria-label": `archive ${a.name}`,
|
|
497
|
+
className: "unstyled flex h-6 w-6 items-center justify-center rounded-sm text-mocha-light hover:bg-snow hover:text-[#9B3D3D]",
|
|
498
|
+
children: "×"
|
|
499
|
+
})]
|
|
500
|
+
})]
|
|
501
|
+
}, a.id))
|
|
502
|
+
})]
|
|
503
|
+
}, g.id);
|
|
504
|
+
})
|
|
505
|
+
}),
|
|
506
|
+
spawnFor && /* @__PURE__ */ jsx(SpawnDialog, {
|
|
507
|
+
profileId: spawnFor.profileId,
|
|
508
|
+
groupHint: spawnFor.groupHint,
|
|
509
|
+
groups: sortedGroups,
|
|
510
|
+
onClose: () => setSpawnFor(null)
|
|
511
|
+
}),
|
|
512
|
+
spawnTeamFor && /* @__PURE__ */ jsx(SpawnTeamModal, {
|
|
513
|
+
profileGroup: spawnTeamFor,
|
|
514
|
+
groups: sortedGroups,
|
|
515
|
+
onClose: () => setSpawnTeamFor(null),
|
|
516
|
+
onSpawned: (slug) => {
|
|
517
|
+
setSpawnTeamFor(null);
|
|
518
|
+
router.navigate({
|
|
519
|
+
to: "/groups/$id",
|
|
520
|
+
params: { id: slug }
|
|
521
|
+
});
|
|
522
|
+
}
|
|
523
|
+
}),
|
|
524
|
+
createGroupOpen && /* @__PURE__ */ jsx(CreateGroupDialog, { onClose: () => setCreateGroupOpen(false) })
|
|
525
|
+
]
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
//#endregion
|
|
529
|
+
export { Sidebar as n, SIDEBAR_OPEN_GROUPS_COOKIE as t };
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { t as Button } from "./Button-Dsnw22OF.js";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/SpawnTeamModal.tsx
|
|
5
|
+
function SpawnTeamModal({ profileGroup, groups, onClose, onSpawned }) {
|
|
6
|
+
const [groupSlug, setGroupSlug] = useState("");
|
|
7
|
+
const [userMd, setUserMd] = useState("");
|
|
8
|
+
const [err, setErr] = useState(null);
|
|
9
|
+
const [submitting, setSubmitting] = useState(false);
|
|
10
|
+
async function spawn() {
|
|
11
|
+
setErr(null);
|
|
12
|
+
if (!groupSlug.trim()) {
|
|
13
|
+
setErr("target group slug is required");
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
setSubmitting(true);
|
|
17
|
+
try {
|
|
18
|
+
const body = { groupSlug: groupSlug.trim() };
|
|
19
|
+
if (userMd) body.userMd = userMd;
|
|
20
|
+
const res = await fetch(`/api/profile-groups/${profileGroup.id}/spawn`, {
|
|
21
|
+
method: "POST",
|
|
22
|
+
headers: { "content-type": "application/json" },
|
|
23
|
+
body: JSON.stringify(body)
|
|
24
|
+
});
|
|
25
|
+
if (!res.ok) {
|
|
26
|
+
const e = await res.json().catch(() => null);
|
|
27
|
+
throw new Error(e?.error ?? res.statusText);
|
|
28
|
+
}
|
|
29
|
+
const result = await res.json();
|
|
30
|
+
if (result.orphanAgentIds && result.orphanAgentIds.length > 0) alert(`Spawn completed with warnings: ${result.orphanAgentIds.length} orphan agent dir(s) left on disk.`);
|
|
31
|
+
onSpawned(result.groupSlug);
|
|
32
|
+
} catch (e) {
|
|
33
|
+
setErr(e.message);
|
|
34
|
+
} finally {
|
|
35
|
+
setSubmitting(false);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return /* @__PURE__ */ jsx("div", {
|
|
39
|
+
role: "dialog",
|
|
40
|
+
"aria-modal": "true",
|
|
41
|
+
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50",
|
|
42
|
+
onClick: onClose,
|
|
43
|
+
onKeyDown: (e) => {
|
|
44
|
+
if (e.key === "Escape") onClose();
|
|
45
|
+
},
|
|
46
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
47
|
+
className: "card w-full max-w-lg",
|
|
48
|
+
onClick: (e) => e.stopPropagation(),
|
|
49
|
+
onKeyDown: (e) => e.stopPropagation(),
|
|
50
|
+
role: "document",
|
|
51
|
+
children: [
|
|
52
|
+
/* @__PURE__ */ jsxs("h3", { children: ["spawn team — ", profileGroup.name] }),
|
|
53
|
+
err && /* @__PURE__ */ jsx("div", {
|
|
54
|
+
className: "err",
|
|
55
|
+
children: err
|
|
56
|
+
}),
|
|
57
|
+
/* @__PURE__ */ jsxs("p", {
|
|
58
|
+
className: "muted",
|
|
59
|
+
children: [
|
|
60
|
+
"Spawns ",
|
|
61
|
+
profileGroup.memberCount,
|
|
62
|
+
" agent",
|
|
63
|
+
profileGroup.memberCount === 1 ? "" : "s",
|
|
64
|
+
" into the target group. If the group doesn't exist, it'll be created on the fly. Failures roll back the whole spawn."
|
|
65
|
+
]
|
|
66
|
+
}),
|
|
67
|
+
/* @__PURE__ */ jsxs("label", { children: [
|
|
68
|
+
"target group slug",
|
|
69
|
+
/* @__PURE__ */ jsx("input", {
|
|
70
|
+
value: groupSlug,
|
|
71
|
+
onChange: (e) => setGroupSlug(e.target.value),
|
|
72
|
+
list: "existing-groups",
|
|
73
|
+
required: true
|
|
74
|
+
}),
|
|
75
|
+
/* @__PURE__ */ jsx("datalist", {
|
|
76
|
+
id: "existing-groups",
|
|
77
|
+
children: groups.map((g) => /* @__PURE__ */ jsx("option", {
|
|
78
|
+
value: g.id,
|
|
79
|
+
children: g.name
|
|
80
|
+
}, g.id))
|
|
81
|
+
})
|
|
82
|
+
] }),
|
|
83
|
+
/* @__PURE__ */ jsxs("label", { children: ["override USER.md (optional — only takes effect on a freshly-created target group)", /* @__PURE__ */ jsx("textarea", {
|
|
84
|
+
rows: 3,
|
|
85
|
+
value: userMd,
|
|
86
|
+
onChange: (e) => setUserMd(e.target.value),
|
|
87
|
+
className: "font-mono text-[0.88em] leading-[1.55]"
|
|
88
|
+
})] }),
|
|
89
|
+
/* @__PURE__ */ jsxs("div", {
|
|
90
|
+
className: "mt-4 flex gap-2 justify-end",
|
|
91
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
92
|
+
variant: "ghost",
|
|
93
|
+
onClick: onClose,
|
|
94
|
+
children: "cancel"
|
|
95
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
96
|
+
variant: "primary",
|
|
97
|
+
onClick: spawn,
|
|
98
|
+
disabled: submitting,
|
|
99
|
+
children: submitting ? "spawning…" : "spawn team"
|
|
100
|
+
})]
|
|
101
|
+
})
|
|
102
|
+
]
|
|
103
|
+
})
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
//#endregion
|
|
107
|
+
export { SpawnTeamModal as t };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Link, useRouterState } from "@tanstack/react-router";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/TemplatesTabs.tsx
|
|
4
|
+
function TemplatesTabs() {
|
|
5
|
+
const pathname = useRouterState({ select: (s) => s.location.pathname });
|
|
6
|
+
return /* @__PURE__ */ jsx("nav", {
|
|
7
|
+
role: "tablist",
|
|
8
|
+
className: "-mb-px mb-5 flex gap-1 border-b border-frost",
|
|
9
|
+
children: [{
|
|
10
|
+
to: "/profiles",
|
|
11
|
+
label: "profiles",
|
|
12
|
+
match: (p) => p.startsWith("/profiles")
|
|
13
|
+
}, {
|
|
14
|
+
to: "/profile-groups",
|
|
15
|
+
label: "profile groups",
|
|
16
|
+
match: (p) => p.startsWith("/profile-groups")
|
|
17
|
+
}].map((t) => {
|
|
18
|
+
const active = t.match(pathname);
|
|
19
|
+
return /* @__PURE__ */ jsx(Link, {
|
|
20
|
+
to: t.to,
|
|
21
|
+
role: "tab",
|
|
22
|
+
"aria-selected": active,
|
|
23
|
+
className: `unstyled cursor-pointer border-b-2 bg-transparent px-4 py-2 text-[0.9em] font-medium transition-colors ${active ? "border-sapphire text-sapphire" : "border-transparent text-mocha hover:text-sapphire"}`,
|
|
24
|
+
children: t.label
|
|
25
|
+
}, t.to);
|
|
26
|
+
})
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { TemplatesTabs as t };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { t as createServerFn } from "../server.js";
|
|
2
|
+
import { t as createSsrRpc } from "./createSsrRpc-ZBGxhl8t.js";
|
|
3
|
+
import { createFileRoute, lazyRouteComponent, redirect } from "@tanstack/react-router";
|
|
4
|
+
//#region src/routes/agents/$id/index.tsx
|
|
5
|
+
var $$splitComponentImporter = () => import("./_id-D0ytyXGY.js");
|
|
6
|
+
var fetchAgent = createServerFn({ method: "POST" }).inputValidator((d) => d).handler(createSsrRpc("846c9081aed17057351730985f133b0aab67a5dabfca9562552829a90ff30849"));
|
|
7
|
+
var Route = createFileRoute("/agents/$id/")({
|
|
8
|
+
loader: async ({ params }) => {
|
|
9
|
+
const data = await fetchAgent({ 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 };
|