bazilion 0.11.0 → 0.12.1

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 (69) hide show
  1. package/dist/cli.js +436 -149
  2. package/dist/cli.js.map +1 -1
  3. package/dist/daemon.js +1382 -232
  4. package/dist/daemon.js.map +1 -1
  5. package/dist/migrations/0001_init.sql +81 -0
  6. package/dist/web/client/assets/AgentTabs-R6gSjIj3.js +1 -0
  7. package/dist/web/client/assets/{ProductionTeamPolicyEditor-B6dbpuYy.js → ProductionTeamPolicyEditor-CSL3W7XM.js} +2 -2
  8. package/dist/web/client/assets/{ProfileCommunicationEditor-Bf8UvmZT.js → ProfileCommunicationEditor-CwU0QkmE.js} +1 -1
  9. package/dist/web/client/assets/{TeamTabs-sQBHChtd.js → TeamTabs-C1Hakkff.js} +1 -1
  10. package/dist/web/client/assets/{TemplatesTabs-DPsuwsWB.js → TemplatesTabs-klEydJ8-.js} +1 -1
  11. package/dist/web/client/assets/{_id-C9rkCclz.js → _id-BOC7ioJu.js} +1 -1
  12. package/dist/web/client/assets/{_id-DYASsGQ8.js → _id-CnVq-rED.js} +1 -1
  13. package/dist/web/client/assets/{_id-DE4IY5bL.js → _id-e4u7dmBb.js} +1 -1
  14. package/dist/web/client/assets/{_id-D65IzC8H.js → _id-wkjjWLz0.js} +1 -1
  15. package/dist/web/client/assets/{activity-C7o6-xHg.js → activity-uqhwzmiy.js} +1 -1
  16. package/dist/web/client/assets/{agents-UroO4d25.js → agents-B2usE-L_.js} +1 -1
  17. package/dist/web/client/assets/{agents-h8yWXQ2H.js → agents-FaQtkAWs.js} +1 -1
  18. package/dist/web/client/assets/{approvals-DKhF0YLC.js → approvals-DqLE6ttw.js} +1 -1
  19. package/dist/web/client/assets/attention-CkGozYnJ.js +1 -0
  20. package/dist/web/client/assets/attention-Gavt2yEp.js +1 -0
  21. package/dist/web/client/assets/chevron-down-CJk0zGNT.js +1 -0
  22. package/dist/web/client/assets/{config-q8JDresK.js → config-xrXoDEWM.js} +1 -1
  23. package/dist/web/client/assets/{context-CBucAoi6.js → context-ZWqx3uiC.js} +1 -1
  24. package/dist/web/client/assets/inbox-BoIvl9ZF.js +1 -0
  25. package/dist/web/client/assets/{index-DUXAevpZ.js → index-nb2MV8X1.js} +3 -3
  26. package/dist/web/client/assets/learning-6_oYn1l7.js +1 -0
  27. package/dist/web/client/assets/{login-CNAV9Wer.js → login-DM1ytxQL.js} +1 -1
  28. package/dist/web/client/assets/{mcp-BKdEFwHO.js → mcp-CetZbyUh.js} +1 -1
  29. package/dist/web/client/assets/{members-BDqZQh26.js → members-DdqWtwZd.js} +1 -1
  30. package/dist/web/client/assets/{memory-DVdEVr6L.js → memory-FNrxFHmC.js} +1 -1
  31. package/dist/web/client/assets/plus-C3GroITC.js +1 -0
  32. package/dist/web/client/assets/{policy-DdDctqvg.js → policy-BKPejYRI.js} +1 -1
  33. package/dist/web/client/assets/{routes-BEfALSZv.js → routes-CH1ZTTo-.js} +1 -1
  34. package/dist/web/client/assets/{services-DZP2ybzb.js → services-zk9SqN06.js} +1 -1
  35. package/dist/web/client/assets/{skills-DoeIjITs.js → skills-tXDpomHW.js} +1 -1
  36. package/dist/web/client/assets/styles-DMltY3su.css +2 -0
  37. package/dist/web/client/assets/{teams-W3j-UoJ9.js → teams-BZYjekBN.js} +1 -1
  38. package/dist/web/client/assets/{teams-DlHRnrQw.js → teams-D1c8zlxs.js} +1 -1
  39. package/dist/web/client/assets/{telegram-2OdeGv4E.js → telegram-DCe1CWMt.js} +1 -1
  40. package/dist/web/client/assets/{tokens-MuBfmgue.js → tokens-DAPjRS0N.js} +1 -1
  41. package/dist/web/client/assets/triggers-D8R-5guA.js +1 -0
  42. package/dist/web/client/assets/{welcome-CvNr5IMi.js → welcome-CuK0shDJ.js} +1 -1
  43. package/dist/web/server/assets/{AgentTabs-DoMDJBXH.js → AgentTabs-aXdsiiMp.js} +5 -0
  44. package/dist/web/server/assets/{_id-Cg7x6q3g.js → _id-BHYLL8M-.js} +2 -2
  45. package/dist/web/server/assets/{_id-DqON-59C.js → _id-FcHdSocl.js} +1 -1
  46. package/dist/web/server/assets/{_tanstack-start-manifest_v-BXauUXg6.js → _tanstack-start-manifest_v-fLsYERQ-.js} +76 -53
  47. package/dist/web/server/assets/attention-BW_6ddkj.js +11 -0
  48. package/dist/web/server/assets/attention-BxkTf337.js +14 -0
  49. package/dist/web/server/assets/attention-CM-Ks1N9.js +19 -0
  50. package/dist/web/server/assets/attention-w21GQIGH.js +264 -0
  51. package/dist/web/server/assets/{inbox-CUIyf9MT.js → inbox-BLUzA5sQ.js} +40 -3
  52. package/dist/web/server/assets/{inbox-B3-TRsNI.js → inbox-CzlKT9Wg.js} +5 -3
  53. package/dist/web/server/assets/{inbox-BardsGyy.js → inbox-ZvDNAjaM.js} +1 -1
  54. package/dist/web/server/assets/learning-8zav4pIT.js +33 -0
  55. package/dist/web/server/assets/learning-B7PBkvER.js +16 -0
  56. package/dist/web/server/assets/learning-Cq7K2heb.js +312 -0
  57. package/dist/web/server/assets/{router-C5_NjTsP.js → router-CQuj7553.js} +80 -47
  58. package/dist/web/server/assets/{triggers-CBl4yMyw.js → triggers-BZPl5CHs.js} +1 -1
  59. package/dist/web/server/assets/{triggers-_3rdhwSN.js → triggers-CSNNzRIi.js} +2 -2
  60. package/dist/web/server/server.js +11 -3
  61. package/dist/worker.js +166 -36
  62. package/dist/worker.js.map +1 -1
  63. package/package.json +6 -6
  64. package/dist/web/client/assets/AgentTabs-B3hq5a3e.js +0 -1
  65. package/dist/web/client/assets/chevron-down-BK6NPMMP.js +0 -1
  66. package/dist/web/client/assets/inbox-BwoRikj1.js +0 -1
  67. package/dist/web/client/assets/plus-b4yFXP0O.js +0 -1
  68. package/dist/web/client/assets/styles-BYM0UGdF.css +0 -2
  69. package/dist/web/client/assets/triggers-CX7RMQFQ.js +0 -1
@@ -0,0 +1,264 @@
1
+ import { t as Route } from "./attention-BxkTf337.js";
2
+ import { a as StatusBadge, i as SectionCard, n as PageHeader, r as PageShell, t as EmptyState } from "./Page-LENulSXY.js";
3
+ import { t as Button } from "./Button-Dsnw22OF.js";
4
+ import { useMemo, useState } from "react";
5
+ import { Link } from "@tanstack/react-router";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ //#region src/routes/attention/index.tsx?tsr-split=component
8
+ function AttentionCenter() {
9
+ const initial = Route.useLoaderData();
10
+ const [items, setItems] = useState(initial.list.items);
11
+ const [degraded, setDegraded] = useState(initial.list.degraded);
12
+ const [summary, setSummary] = useState(initial.summary);
13
+ const [state, setState] = useState("open");
14
+ const [kind, setKind] = useState("all");
15
+ const [severity, setSeverity] = useState("all");
16
+ const [busy, setBusy] = useState(null);
17
+ const [notice, setNotice] = useState(null);
18
+ const visible = useMemo(() => items.filter((item) => (state === "all" || (state === "open" ? item.acknowledgedAt === null : item.acknowledgedAt !== null)) && (kind === "all" || item.kind === kind) && (severity === "all" || item.severity === severity)), [
19
+ items,
20
+ kind,
21
+ severity,
22
+ state
23
+ ]);
24
+ async function refresh() {
25
+ const [listResponse, summaryResponse] = await Promise.all([fetch("/api/attention?state=all&limit=200"), fetch("/api/attention/summary")]);
26
+ if (!listResponse.ok || !summaryResponse.ok) throw new Error("Could not refresh the Attention Center");
27
+ const list = await listResponse.json();
28
+ setItems(list.items);
29
+ setDegraded(list.degraded);
30
+ setSummary(await summaryResponse.json());
31
+ }
32
+ async function acknowledge(item, value) {
33
+ setBusy(item.key);
34
+ setNotice(null);
35
+ try {
36
+ const response = await fetch(`/api/attention/${encodeURIComponent(item.key)}/${value ? "acknowledge" : "acknowledgement"}`, { method: value ? "POST" : "DELETE" });
37
+ const body = await response.json().catch(() => ({}));
38
+ if (!response.ok) throw new Error(body.error ?? `Update failed (${response.status})`);
39
+ await refresh();
40
+ } catch (error) {
41
+ setNotice(error instanceof Error ? error.message : String(error));
42
+ await refresh().catch(() => {});
43
+ } finally {
44
+ setBusy(null);
45
+ }
46
+ }
47
+ async function acknowledgeAll() {
48
+ setBusy("all");
49
+ setNotice(null);
50
+ try {
51
+ const response = await fetch("/api/attention/acknowledge-all", { method: "POST" });
52
+ const body = await response.json();
53
+ if (!response.ok) throw new Error(body.error ?? "Acknowledgement failed");
54
+ setNotice(`Acknowledged ${body.acknowledged} informational item(s). Approvals and lessons were left open.`);
55
+ await refresh();
56
+ } catch (error) {
57
+ setNotice(error instanceof Error ? error.message : String(error));
58
+ } finally {
59
+ setBusy(null);
60
+ }
61
+ }
62
+ return /* @__PURE__ */ jsxs(PageShell, {
63
+ size: "wide",
64
+ children: [
65
+ /* @__PURE__ */ jsx(PageHeader, {
66
+ eyebrow: "Operations",
67
+ title: "Attention Center",
68
+ description: "One queue for decisions and terminal signals. Resolve action-required work at its canonical source; acknowledge informational failures here.",
69
+ actions: /* @__PURE__ */ jsx(Button, {
70
+ variant: "ghost",
71
+ disabled: busy !== null,
72
+ onClick: () => void acknowledgeAll(),
73
+ children: "Acknowledge all informational items"
74
+ })
75
+ }),
76
+ /* @__PURE__ */ jsxs("div", {
77
+ className: "mb-5 grid gap-3 sm:grid-cols-3",
78
+ children: [
79
+ /* @__PURE__ */ jsx(Count, {
80
+ label: "Open",
81
+ value: summary.openTotal
82
+ }),
83
+ /* @__PURE__ */ jsx(Count, {
84
+ label: "Action required",
85
+ value: summary.bySeverity.action_required
86
+ }),
87
+ /* @__PURE__ */ jsx(Count, {
88
+ label: "Errors and warnings",
89
+ value: summary.bySeverity.error + summary.bySeverity.warning
90
+ })
91
+ ]
92
+ }),
93
+ (degraded.length > 0 || summary.degraded.length > 0) && /* @__PURE__ */ jsxs("div", {
94
+ role: "alert",
95
+ className: "mb-5 rounded-lg border border-coral/40 bg-coral/10 p-4 text-sm",
96
+ children: [
97
+ /* @__PURE__ */ jsx("strong", { children: "Partial results." }),
98
+ " ",
99
+ [...new Set([...degraded, ...summary.degraded].map((item) => item.kind))].join(", "),
100
+ " could not be loaded."
101
+ ]
102
+ }),
103
+ notice && /* @__PURE__ */ jsx("p", {
104
+ role: "status",
105
+ className: "mb-5 rounded-lg bg-muted px-4 py-3 text-sm",
106
+ children: notice
107
+ }),
108
+ /* @__PURE__ */ jsx(SectionCard, {
109
+ title: "Queue",
110
+ description: `${visible.length} matching item${visible.length === 1 ? "" : "s"}`,
111
+ actions: /* @__PURE__ */ jsxs("div", {
112
+ className: "flex flex-wrap gap-2",
113
+ children: [
114
+ /* @__PURE__ */ jsxs("select", {
115
+ "aria-label": "Queue state",
116
+ value: state,
117
+ onChange: (e) => setState(e.target.value),
118
+ children: [
119
+ /* @__PURE__ */ jsx("option", {
120
+ value: "open",
121
+ children: "Open"
122
+ }),
123
+ /* @__PURE__ */ jsx("option", {
124
+ value: "acknowledged",
125
+ children: "History"
126
+ }),
127
+ /* @__PURE__ */ jsx("option", {
128
+ value: "all",
129
+ children: "All"
130
+ })
131
+ ]
132
+ }),
133
+ /* @__PURE__ */ jsxs("select", {
134
+ "aria-label": "Severity",
135
+ value: severity,
136
+ onChange: (e) => setSeverity(e.target.value),
137
+ children: [
138
+ /* @__PURE__ */ jsx("option", {
139
+ value: "all",
140
+ children: "All severities"
141
+ }),
142
+ /* @__PURE__ */ jsx("option", {
143
+ value: "action_required",
144
+ children: "Action required"
145
+ }),
146
+ /* @__PURE__ */ jsx("option", {
147
+ value: "error",
148
+ children: "Errors"
149
+ }),
150
+ /* @__PURE__ */ jsx("option", {
151
+ value: "warning",
152
+ children: "Warnings"
153
+ })
154
+ ]
155
+ }),
156
+ /* @__PURE__ */ jsxs("select", {
157
+ "aria-label": "Kind",
158
+ value: kind,
159
+ onChange: (e) => setKind(e.target.value),
160
+ children: [
161
+ /* @__PURE__ */ jsx("option", {
162
+ value: "all",
163
+ children: "All kinds"
164
+ }),
165
+ /* @__PURE__ */ jsx("option", {
166
+ value: "communication_approval",
167
+ children: "Approvals"
168
+ }),
169
+ /* @__PURE__ */ jsx("option", {
170
+ value: "lesson_proposal",
171
+ children: "Lessons"
172
+ }),
173
+ /* @__PURE__ */ jsx("option", {
174
+ value: "review_failure",
175
+ children: "Review failures"
176
+ }),
177
+ /* @__PURE__ */ jsx("option", {
178
+ value: "trigger_failure",
179
+ children: "Trigger failures"
180
+ }),
181
+ /* @__PURE__ */ jsx("option", {
182
+ value: "agent_loop_break",
183
+ children: "Loop breaks"
184
+ })
185
+ ]
186
+ })
187
+ ]
188
+ }),
189
+ children: visible.length === 0 ? /* @__PURE__ */ jsx(EmptyState, {
190
+ title: state === "open" ? "Nothing needs attention" : "No matching history",
191
+ description: "The queue updates from Bazilion's canonical approvals, learning, triggers, and loop diagnostics."
192
+ }) : /* @__PURE__ */ jsx("div", {
193
+ className: "grid gap-3",
194
+ children: visible.map((item) => /* @__PURE__ */ jsx("article", {
195
+ className: "rounded-lg border border-border p-4",
196
+ children: /* @__PURE__ */ jsxs("div", {
197
+ className: "flex flex-wrap items-start gap-3",
198
+ children: [/* @__PURE__ */ jsxs("div", {
199
+ className: "min-w-0 flex-1",
200
+ children: [
201
+ /* @__PURE__ */ jsxs("div", {
202
+ className: "flex flex-wrap items-center gap-2",
203
+ children: [/* @__PURE__ */ jsx(StatusBadge, {
204
+ variant: item.severity === "action_required" ? "warning" : item.severity === "error" ? "danger" : "info",
205
+ children: item.severity.replace("_", " ")
206
+ }), /* @__PURE__ */ jsx("span", {
207
+ className: "text-xs text-muted-foreground",
208
+ children: item.kind.replaceAll("_", " ")
209
+ })]
210
+ }),
211
+ /* @__PURE__ */ jsx("h3", {
212
+ className: "mt-2 text-base",
213
+ children: item.title
214
+ }),
215
+ /* @__PURE__ */ jsx("p", {
216
+ className: "mt-1 text-sm text-muted-foreground",
217
+ children: item.diagnostic
218
+ }),
219
+ /* @__PURE__ */ jsxs("p", {
220
+ className: "mt-2 text-xs text-muted-foreground",
221
+ children: [
222
+ [item.agentName, item.teamName].filter(Boolean).join(" · ") || "System",
223
+ " · ",
224
+ /* @__PURE__ */ jsx("time", {
225
+ dateTime: new Date(item.occurredAt).toISOString(),
226
+ children: new Date(item.occurredAt).toLocaleString()
227
+ })
228
+ ]
229
+ })
230
+ ]
231
+ }), /* @__PURE__ */ jsxs("div", {
232
+ className: "flex shrink-0 flex-wrap gap-2",
233
+ children: [/* @__PURE__ */ jsx(Link, {
234
+ to: item.href,
235
+ className: "btn-primary",
236
+ children: item.kind === "communication_approval" ? "Review approval" : item.kind === "lesson_proposal" ? "Review lesson" : "Inspect source"
237
+ }), item.acknowledgeable && /* @__PURE__ */ jsx(Button, {
238
+ variant: "ghost",
239
+ disabled: busy === item.key,
240
+ onClick: () => void acknowledge(item, item.acknowledgedAt === null),
241
+ children: item.acknowledgedAt === null ? "Acknowledge" : "Restore to open"
242
+ })]
243
+ })]
244
+ })
245
+ }, item.key))
246
+ })
247
+ })
248
+ ]
249
+ });
250
+ }
251
+ function Count({ label, value }) {
252
+ return /* @__PURE__ */ jsxs("div", {
253
+ className: "card p-4",
254
+ children: [/* @__PURE__ */ jsx("div", {
255
+ className: "text-xs font-semibold uppercase text-muted-foreground",
256
+ children: label
257
+ }), /* @__PURE__ */ jsx("div", {
258
+ className: "mt-1 text-2xl font-semibold",
259
+ children: value
260
+ })]
261
+ });
262
+ }
263
+ //#endregion
264
+ export { AttentionCenter as component };
@@ -1,6 +1,6 @@
1
- import { t as Route } from "./inbox-BardsGyy.js";
1
+ import { t as Route } from "./inbox-ZvDNAjaM.js";
2
2
  import { r as PageShell } from "./Page-LENulSXY.js";
3
- import { t as AgentTabs } from "./AgentTabs-DoMDJBXH.js";
3
+ import { t as AgentTabs } from "./AgentTabs-aXdsiiMp.js";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  //#region src/routes/agents/$id/inbox.tsx?tsr-split=component
6
6
  function decodeText(payload) {
@@ -11,7 +11,7 @@ function decodeText(payload) {
11
11
  return payload;
12
12
  }
13
13
  function InboxPage() {
14
- const { resolved, messages, unreadCount, selected, agentNames } = Route.useLoaderData();
14
+ const { resolved, messages, unreadCount, selected, agentNames, loopBreaks } = Route.useLoaderData();
15
15
  const unreadOnly = Route.useSearch().unread === "1";
16
16
  const misaddressed = Boolean(selected && selected.toAgentId !== resolved.agent.id);
17
17
  function agentLabel(aid) {
@@ -122,6 +122,43 @@ function InboxPage() {
122
122
  }),
123
123
  " tool. An idle recipient's scheduler tick drains unread mail."
124
124
  ]
125
+ }),
126
+ /* @__PURE__ */ jsxs("div", {
127
+ className: "mt-6 rounded-lg border bg-card p-4",
128
+ children: [/* @__PURE__ */ jsx("h2", {
129
+ className: "mb-2 font-serif text-lg text-foreground",
130
+ children: "Loop circuit breaker"
131
+ }), loopBreaks.length === 0 ? /* @__PURE__ */ jsx("p", {
132
+ className: "text-xs text-muted-foreground",
133
+ children: "No agent-message chains stopped."
134
+ }) : /* @__PURE__ */ jsx("div", {
135
+ className: "space-y-3",
136
+ children: loopBreaks.map((event) => /* @__PURE__ */ jsxs("div", {
137
+ className: "border-t first:border-0 first:pt-0 pt-3 text-xs",
138
+ children: [/* @__PURE__ */ jsxs("div", {
139
+ className: "font-mono text-foreground",
140
+ children: [
141
+ agentLabel(event.fromAgentId),
142
+ " → ",
143
+ agentLabel(event.toAgentId)
144
+ ]
145
+ }), /* @__PURE__ */ jsxs("div", {
146
+ className: "mt-1 text-muted-foreground",
147
+ children: [
148
+ "stopped hop ",
149
+ event.attemptedHop,
150
+ " at limit ",
151
+ event.maxHops,
152
+ " · chain",
153
+ " ",
154
+ /* @__PURE__ */ jsx("code", { children: event.causalChainId.slice(0, 8) }),
155
+ " ·",
156
+ " ",
157
+ new Date(event.createdAt).toLocaleString()
158
+ ]
159
+ })]
160
+ }, event.id))
161
+ })]
125
162
  })
126
163
  ] })]
127
164
  })
@@ -17,10 +17,11 @@ var fetchInbox = createServerFn({ method: "POST" }).inputValidator((d) => d).han
17
17
  throw err;
18
18
  }
19
19
  const inboxQs = data.unreadOnly ? "?unread=1" : "";
20
- const [list, unread, allAgents] = await Promise.all([
20
+ const [list, unread, allAgents, loopBreaks] = await Promise.all([
21
21
  c.get(`/api/agents/${encodeURIComponent(resolved.agent.id)}/messages${inboxQs}`),
22
22
  c.get(`/api/agents/${encodeURIComponent(resolved.agent.id)}/messages?unread=1`),
23
- c.get("/api/agents?includeArchived=true")
23
+ c.get("/api/agents?includeArchived=true"),
24
+ c.get(`/api/agents/${encodeURIComponent(resolved.agent.id)}/loop-breaks?limit=10`)
24
25
  ]);
25
26
  let selected = null;
26
27
  if (data.selectedId) try {
@@ -35,7 +36,8 @@ var fetchInbox = createServerFn({ method: "POST" }).inputValidator((d) => d).han
35
36
  messages: [...list.messages].reverse(),
36
37
  unreadCount: unread.messages.length,
37
38
  selected,
38
- agentNames
39
+ agentNames,
40
+ loopBreaks: loopBreaks.events
39
41
  };
40
42
  });
41
43
  //#endregion
@@ -2,7 +2,7 @@ import { t as createServerFn } from "../server.js";
2
2
  import { t as createSsrRpc } from "./createSsrRpc-DFsIAfFd.js";
3
3
  import { createFileRoute, lazyRouteComponent, redirect } from "@tanstack/react-router";
4
4
  //#region src/routes/agents/$id/inbox.tsx
5
- var $$splitComponentImporter = () => import("./inbox-CUIyf9MT.js");
5
+ var $$splitComponentImporter = () => import("./inbox-BLUzA5sQ.js");
6
6
  var fetchInbox = createServerFn({ method: "POST" }).inputValidator((d) => d).handler(createSsrRpc("2cd8c6ec40e2e2d9518b5f127a518ecd83a2222d85665cc61d5144bcf59ed4fb"));
7
7
  var Route = createFileRoute("/agents/$id/inbox")({
8
8
  validateSearch: (s) => ({
@@ -0,0 +1,33 @@
1
+ import { t as createServerFn } from "../server.js";
2
+ import { t as createServerRpc } from "./createServerRpc-pU-IQV2Y.js";
3
+ import { n as daemonClient, r as ApiClientError } from "./daemon-client-2NRMzlTr.js";
4
+ //#region src/routes/agents/$id/learning.tsx?tss-serverfn-split
5
+ var fetchLearning_createServerFn_handler = createServerRpc({
6
+ id: "fcdd0f08b635c7c501caa840d01d1376ace6683e26cc5ac7dead28d7870f98b9",
7
+ name: "fetchLearning",
8
+ filename: "src/routes/agents/$id/learning.tsx"
9
+ }, (opts) => fetchLearning.__executeServer(opts));
10
+ var fetchLearning = createServerFn({ method: "POST" }).inputValidator((data) => data).handler(fetchLearning_createServerFn_handler, async ({ data }) => {
11
+ const client = daemonClient();
12
+ let resolved;
13
+ try {
14
+ resolved = await client.get(`/api/agents/${encodeURIComponent(data.id)}`);
15
+ } catch (error) {
16
+ if (error instanceof ApiClientError && error.status === 404) return null;
17
+ throw error;
18
+ }
19
+ const id = encodeURIComponent(resolved.agent.id);
20
+ const [config, reviews, proposals] = await Promise.all([
21
+ client.get(`/api/agents/${id}/review-config`),
22
+ client.get(`/api/agents/${id}/reviews`),
23
+ client.get(`/api/agents/${id}/lesson-proposals`)
24
+ ]);
25
+ return {
26
+ resolved,
27
+ config,
28
+ reviews: reviews.reviews,
29
+ proposals: proposals.proposals
30
+ };
31
+ });
32
+ //#endregion
33
+ export { fetchLearning_createServerFn_handler };
@@ -0,0 +1,16 @@
1
+ import { t as createServerFn } from "../server.js";
2
+ import { t as createSsrRpc } from "./createSsrRpc-DFsIAfFd.js";
3
+ import { createFileRoute, lazyRouteComponent, redirect } from "@tanstack/react-router";
4
+ //#region src/routes/agents/$id/learning.tsx
5
+ var $$splitComponentImporter = () => import("./learning-Cq7K2heb.js");
6
+ var fetchLearning = createServerFn({ method: "POST" }).inputValidator((data) => data).handler(createSsrRpc("fcdd0f08b635c7c501caa840d01d1376ace6683e26cc5ac7dead28d7870f98b9"));
7
+ var Route = createFileRoute("/agents/$id/learning")({
8
+ loader: async ({ params }) => {
9
+ const data = await fetchLearning({ 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 };