@grindxp/cli 0.1.7 → 0.1.9

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 (57) hide show
  1. package/dist/index.js +766 -134
  2. package/dist/web/client/assets/Copy.es-Bs4NgJu-.js +1 -0
  3. package/dist/web/client/assets/Sword.es-2Xm7T3t2.js +1 -0
  4. package/dist/web/client/assets/geist-cyrillic-wght-normal-CHSlOQsW.woff2 +0 -0
  5. package/dist/web/client/assets/geist-latin-ext-wght-normal-DMtmJ5ZE.woff2 +0 -0
  6. package/dist/web/client/assets/geist-latin-wght-normal-Dm3htQBi.woff2 +0 -0
  7. package/dist/web/client/assets/index-6XDcqRbL.js +42 -0
  8. package/dist/web/client/assets/index-BXM1N6tm.js +1 -0
  9. package/dist/web/client/assets/index-B_KMiE38.js +1 -0
  10. package/dist/web/client/assets/index-CGj2rOLm.js +1 -0
  11. package/dist/web/client/assets/index-CS5BuFbt.js +1 -0
  12. package/dist/web/client/assets/index-CYsASiu-.js +1 -0
  13. package/dist/web/client/assets/index-DAvwM0SX.js +1 -0
  14. package/dist/web/client/assets/index-DCBFp5DJ.js +1 -0
  15. package/dist/web/client/assets/index-DjKt1qNz.js +1 -0
  16. package/dist/web/client/assets/index-PIcFs1vr.js +1 -0
  17. package/dist/web/client/assets/instrument-serif-latin-400-italic-DKMiL14s.woff2 +0 -0
  18. package/dist/web/client/assets/instrument-serif-latin-400-italic-u__WvvIK.woff +0 -0
  19. package/dist/web/client/assets/instrument-serif-latin-400-normal-BVbkICAY.woff +0 -0
  20. package/dist/web/client/assets/instrument-serif-latin-400-normal-DnYpCC2O.woff2 +0 -0
  21. package/dist/web/client/assets/instrument-serif-latin-ext-400-italic-C9HzH3YL.woff2 +0 -0
  22. package/dist/web/client/assets/instrument-serif-latin-ext-400-italic-D7-lnxEk.woff +0 -0
  23. package/dist/web/client/assets/instrument-serif-latin-ext-400-normal-C2je3j2s.woff2 +0 -0
  24. package/dist/web/client/assets/instrument-serif-latin-ext-400-normal-CFCUzsTy.woff +0 -0
  25. package/dist/web/client/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
  26. package/dist/web/client/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
  27. package/dist/web/client/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  28. package/dist/web/client/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  29. package/dist/web/client/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
  30. package/dist/web/client/assets/main-BI1EOhmt.js +18 -0
  31. package/dist/web/client/assets/styles-7TpWqjrh.css +1 -0
  32. package/dist/web/client/favicon.ico +0 -0
  33. package/dist/web/server/assets/_tanstack-start-manifest_v-B_rvI8DG.js +4 -0
  34. package/dist/web/server/assets/agent.functions-BL3upUNr.js +19541 -0
  35. package/dist/web/server/assets/data.functions-DZmdFOMQ.js +285 -0
  36. package/dist/web/server/assets/index-4SxmUYH6.js +14 -0
  37. package/dist/web/server/assets/index-B2ULpkv2.js +4587 -0
  38. package/dist/web/server/assets/index-BGBMycx-.js +2275 -0
  39. package/dist/web/server/assets/index-BL8u2X7w.js +14 -0
  40. package/dist/web/server/assets/index-BQUCDamI.js +5924 -0
  41. package/dist/web/server/assets/index-BRRsXrOi.js +14 -0
  42. package/dist/web/server/assets/index-BiD7uOOh.js +14 -0
  43. package/dist/web/server/assets/index-CB8UtTN8.js +66 -0
  44. package/dist/web/server/assets/index-D2yaimYL.js +14 -0
  45. package/dist/web/server/assets/index-D3RUqTdb.js +14 -0
  46. package/dist/web/server/assets/index-DTB2dYCz.js +1426 -0
  47. package/dist/web/server/assets/index-DfU25rnD.js +477 -0
  48. package/dist/web/server/assets/index-SHH7zSKt.js +66 -0
  49. package/dist/web/server/assets/router-CXyGzWDS.js +589 -0
  50. package/dist/web/server/assets/sessions-UCWtijHE.js +438 -0
  51. package/dist/web/server/assets/start-HYkvq4Ni.js +4 -0
  52. package/dist/web/server/assets/token-DGoahKjI.js +86 -0
  53. package/dist/web/server/assets/token-util-BopJPy-I.js +451 -0
  54. package/dist/web/server/assets/token-util-Bw35afYM.js +30 -0
  55. package/dist/web/server/assets/vault.server-CscY5Z8e.js +19357 -0
  56. package/dist/web/server/server.js +4889 -0
  57. package/package.json +53 -51
@@ -0,0 +1,589 @@
1
+ import { createRootRouteWithContext, Outlet, HeadContent, Scripts, createFileRoute, Link, redirect, lazyRouteComponent, createRouter } from "@tanstack/react-router";
2
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
3
+ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
4
+ import { useState } from "react";
5
+ import { HouseIcon, ChatCircleIcon, ScrollIcon, TreeStructureIcon, SparkleIcon, LightningIcon, ChartLineIcon, PlugsConnectedIcon } from "@phosphor-icons/react";
6
+ import { clsx } from "clsx";
7
+ import { twMerge } from "tailwind-merge";
8
+ import { T as TSS_SERVER_FUNCTION, g as getServerFnById, c as createServerFn } from "../server.js";
9
+ import { g as getVaultContext, a as getUserById } from "./vault.server-CscY5Z8e.js";
10
+ let context;
11
+ function getContext() {
12
+ if (context) {
13
+ return context;
14
+ }
15
+ const queryClient = new QueryClient();
16
+ context = {
17
+ queryClient
18
+ };
19
+ return context;
20
+ }
21
+ function TanStackQueryProvider({ children }) {
22
+ const { queryClient } = getContext();
23
+ return /* @__PURE__ */ jsx(QueryClientProvider, { client: queryClient, children });
24
+ }
25
+ const appCss = "/assets/styles-7TpWqjrh.css";
26
+ const geistLatinWoff2 = "/assets/geist-latin-wght-normal-Dm3htQBi.woff2";
27
+ const jetbrainsMonoLatinWoff2 = "/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2";
28
+ const instrumentSerifWoff2 = "/assets/instrument-serif-latin-400-normal-DnYpCC2O.woff2";
29
+ const instrumentSerifItalicWoff2 = "/assets/instrument-serif-latin-400-italic-DKMiL14s.woff2";
30
+ const Route$b = createRootRouteWithContext()({
31
+ head: () => ({
32
+ meta: [
33
+ { charSet: "utf-8" },
34
+ { name: "viewport", content: "width=device-width, initial-scale=1" },
35
+ { name: "theme-color", content: "#0d0d12" },
36
+ { title: "GRIND - Your Life, Your Grind" }
37
+ ],
38
+ links: [
39
+ {
40
+ rel: "preload",
41
+ href: geistLatinWoff2,
42
+ as: "font",
43
+ type: "font/woff2",
44
+ crossOrigin: "anonymous"
45
+ },
46
+ {
47
+ rel: "preload",
48
+ href: jetbrainsMonoLatinWoff2,
49
+ as: "font",
50
+ type: "font/woff2",
51
+ crossOrigin: "anonymous"
52
+ },
53
+ {
54
+ rel: "preload",
55
+ href: instrumentSerifWoff2,
56
+ as: "font",
57
+ type: "font/woff2",
58
+ crossOrigin: "anonymous"
59
+ },
60
+ {
61
+ rel: "preload",
62
+ href: instrumentSerifItalicWoff2,
63
+ as: "font",
64
+ type: "font/woff2",
65
+ crossOrigin: "anonymous"
66
+ },
67
+ { rel: "stylesheet", href: appCss }
68
+ ]
69
+ }),
70
+ shellComponent: RootShell,
71
+ component: RootComponent
72
+ });
73
+ function RootShell({ children }) {
74
+ return /* @__PURE__ */ jsxs("html", { lang: "en", className: "dark", children: [
75
+ /* @__PURE__ */ jsx("head", { children: /* @__PURE__ */ jsx(HeadContent, {}) }),
76
+ /* @__PURE__ */ jsxs("body", { className: "min-h-screen bg-background text-foreground antialiased", children: [
77
+ children,
78
+ /* @__PURE__ */ jsx(Scripts, {})
79
+ ] })
80
+ ] });
81
+ }
82
+ function RootComponent() {
83
+ return /* @__PURE__ */ jsx(TanStackQueryProvider, { children: /* @__PURE__ */ jsx(Outlet, {}) });
84
+ }
85
+ function cn(...inputs) {
86
+ return twMerge(clsx(inputs));
87
+ }
88
+ const createSsrRpc = (functionId, importer) => {
89
+ const url = "/_serverFn/" + functionId;
90
+ const serverFnMeta = { id: functionId };
91
+ const fn = async (...args) => {
92
+ const serverFn = await getServerFnById(functionId);
93
+ return serverFn(...args);
94
+ };
95
+ return Object.assign(fn, {
96
+ url,
97
+ serverFnMeta,
98
+ [TSS_SERVER_FUNCTION]: true
99
+ });
100
+ };
101
+ const SIDEBAR_COOKIE = "grind@sidebar_open";
102
+ const getSidebarPref = createServerFn({
103
+ method: "GET"
104
+ }).handler(createSsrRpc("5ae2bb0c4c003d915f9054a906ac04c5e5445504bc009ebe1b0909b118638f63"));
105
+ const getDashboardData = createServerFn({
106
+ method: "GET"
107
+ }).handler(createSsrRpc("cbb2f7cdf3f3a605c4dfa620eb06a3cf071dae878f19986d68e6ef770b13f7fa"));
108
+ const getConversations = createServerFn({
109
+ method: "GET"
110
+ }).handler(createSsrRpc("beec9fd37fa775f9a6fdc16dd643e042dbc9e24c2b45f88ddc7b529513bd4661"));
111
+ function validateLoadConvInput(data) {
112
+ if (typeof data !== "object" || data === null) throw new Error("Invalid input");
113
+ const raw = data;
114
+ const conversationId = raw["conversationId"];
115
+ if (typeof conversationId !== "string") throw new Error("conversationId is required");
116
+ return {
117
+ conversationId
118
+ };
119
+ }
120
+ const loadConversationMessages = createServerFn({
121
+ method: "POST"
122
+ }).inputValidator(validateLoadConvInput).handler(createSsrRpc("ca03005c412458a0bc657c061b4f332f92b1ff4b8c19f40ffaf334bca75a0749"));
123
+ const getCompanionInfo = createServerFn({
124
+ method: "GET"
125
+ }).handler(createSsrRpc("184ce16af80e6368f2fae4eb2360630a351114a8cc3ee5800b1a08e02b9dd7e9"));
126
+ const getPromptHistoryEntries = createServerFn({
127
+ method: "GET"
128
+ }).handler(createSsrRpc("9a5dc52f000f13d22209e6a0728000f0667bc09e1ac65adb09228596aa34819b"));
129
+ function validateAppendPromptInput(data) {
130
+ if (typeof data !== "object" || data === null) throw new Error("Invalid input");
131
+ const raw = data;
132
+ const content = raw["content"];
133
+ if (typeof content !== "string" || !content.trim()) throw new Error("content is required");
134
+ return {
135
+ content: content.trim()
136
+ };
137
+ }
138
+ const appendPromptHistoryEntry = createServerFn({
139
+ method: "POST"
140
+ }).inputValidator(validateAppendPromptInput).handler(createSsrRpc("0106759db375e1456f62d4c1efe7094c3733545535507409fcecd70d465fd501"));
141
+ const Route$a = createFileRoute("/app")({
142
+ loader: () => getSidebarPref(),
143
+ component: AppLayout
144
+ });
145
+ const navGroups = [
146
+ {
147
+ label: "Core",
148
+ items: [
149
+ { to: "/app", label: "Dashboard", icon: HouseIcon },
150
+ { to: "/app/chat", label: "Chat", icon: ChatCircleIcon },
151
+ { to: "/app/quests", label: "Quests", icon: ScrollIcon, soon: true },
152
+ { to: "/app/skills", label: "Skills", icon: TreeStructureIcon, soon: true }
153
+ ]
154
+ },
155
+ {
156
+ label: "Automate",
157
+ items: [
158
+ { to: "/app/companion", label: "Companion", icon: SparkleIcon, soon: true },
159
+ { to: "/app/forge", label: "Forge", icon: LightningIcon, soon: true },
160
+ { to: "/app/analytics", label: "Analytics", icon: ChartLineIcon, soon: true },
161
+ { to: "/app/integrations", label: "Integrations", icon: PlugsConnectedIcon, soon: true }
162
+ ]
163
+ }
164
+ ];
165
+ const mobileNavItems = [
166
+ { to: "/app", label: "Home", icon: HouseIcon },
167
+ { to: "/app/chat", label: "Chat", icon: ChatCircleIcon },
168
+ { to: "/app/quests", label: "Quests", icon: ScrollIcon, soon: true },
169
+ { to: "/app/skills", label: "Skills", icon: TreeStructureIcon, soon: true }
170
+ ];
171
+ function SidebarNav() {
172
+ return /* @__PURE__ */ jsx(Fragment, { children: navGroups.map((group, groupIndex) => /* @__PURE__ */ jsxs("div", { className: groupIndex > 0 ? "mt-4" : "", children: [
173
+ /* @__PURE__ */ jsx("p", { className: "mb-1 px-3 text-[10px] font-semibold uppercase tracking-widest text-sidebar-foreground/35", children: group.label }),
174
+ /* @__PURE__ */ jsx("div", { className: "space-y-0.5", children: group.items.map(({ to, label, icon: IconComponent, soon }) => /* @__PURE__ */ jsxs(
175
+ Link,
176
+ {
177
+ to,
178
+ activeOptions: { exact: to === "/app" },
179
+ className: "flex items-center gap-3 rounded-md px-3 py-2 text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground active:bg-sidebar-accent/70 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring [&[aria-current]]:hover:bg-sidebar-accent [&[aria-current]]:hover:text-sidebar-primary",
180
+ activeProps: {
181
+ className: "flex items-center gap-3 rounded-md px-3 py-2 text-sm bg-sidebar-accent text-sidebar-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring"
182
+ },
183
+ children: [
184
+ /* @__PURE__ */ jsx(IconComponent, { size: 18, weight: "regular" }),
185
+ label,
186
+ soon && /* @__PURE__ */ jsx("span", { className: "ml-auto shrink-0 rounded px-1.5 py-px text-[9px] font-semibold uppercase tracking-wider bg-amber-500/10 border border-amber-500/20 text-amber-500/70", children: "Soon" })
187
+ ]
188
+ },
189
+ to
190
+ )) })
191
+ ] }, group.label)) });
192
+ }
193
+ function MobileBottomNav() {
194
+ return /* @__PURE__ */ jsx(
195
+ "nav",
196
+ {
197
+ "aria-label": "Primary",
198
+ className: "fixed inset-x-0 bottom-0 z-50 border-t border-sidebar-border bg-sidebar/95 backdrop-blur supports-[backdrop-filter]:bg-sidebar/90 md:hidden",
199
+ style: { paddingBottom: "env(safe-area-inset-bottom)" },
200
+ children: /* @__PURE__ */ jsx("div", { className: "grid h-14 grid-cols-4", children: mobileNavItems.map(({ to, label, icon: IconComponent, soon }) => /* @__PURE__ */ jsxs(
201
+ Link,
202
+ {
203
+ to,
204
+ activeOptions: { exact: to === "/app" },
205
+ className: "flex flex-col items-center justify-center gap-1 text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground active:bg-sidebar-accent/70 [&[aria-current]]:hover:bg-sidebar-accent [&[aria-current]]:hover:text-sidebar-primary [touch-action:manipulation] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring focus-visible:ring-offset-2 focus-visible:ring-offset-sidebar",
206
+ activeProps: {
207
+ className: "flex flex-col items-center justify-center gap-1 text-sidebar-primary [touch-action:manipulation] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring focus-visible:ring-offset-2 focus-visible:ring-offset-sidebar"
208
+ },
209
+ children: [
210
+ /* @__PURE__ */ jsxs("span", { className: "relative", children: [
211
+ /* @__PURE__ */ jsx(IconComponent, { "aria-hidden": "true", size: 18, weight: "regular" }),
212
+ soon && /* @__PURE__ */ jsx(
213
+ "span",
214
+ {
215
+ className: "absolute -right-1 -top-1 block h-1.5 w-1.5 rounded-[1px] bg-amber-500/70",
216
+ "aria-hidden": "true"
217
+ }
218
+ )
219
+ ] }),
220
+ /* @__PURE__ */ jsx("span", { className: "text-[11px] font-medium leading-none", children: label })
221
+ ]
222
+ },
223
+ to
224
+ )) })
225
+ }
226
+ );
227
+ }
228
+ function DesktopSidebar({ open, onToggle }) {
229
+ return (
230
+ // data-open drives ALL states — sidebar wrapper is the single source of truth.
231
+ // group/sidebar-wrapper → hover peek; group/toggle → button hover/focus for icon.
232
+ /* @__PURE__ */ jsxs(
233
+ "div",
234
+ {
235
+ "data-open": open,
236
+ className: "group/sidebar-wrapper relative hidden h-full shrink-0 md:block z-30",
237
+ children: [
238
+ /* @__PURE__ */ jsxs(
239
+ "button",
240
+ {
241
+ onClick: onToggle,
242
+ className: cn(
243
+ "group/toggle absolute left-full top-3 ml-3 z-40 flex h-8 w-8 items-center justify-center rounded-md",
244
+ "text-sidebar-foreground/60 transition-colors duration-150",
245
+ "hover:bg-sidebar-accent hover:text-sidebar-foreground",
246
+ "bg-sidebar border border-sidebar-border shadow-sm",
247
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",
248
+ "group-data-[open=true]/sidebar-wrapper:text-sidebar-foreground"
249
+ ),
250
+ "aria-label": open ? "Close sidebar" : "Open sidebar",
251
+ "aria-expanded": open,
252
+ children: [
253
+ /* @__PURE__ */ jsx("div", { className: "absolute -inset-y-4 -left-6 -right-6", "aria-hidden": "true" }),
254
+ /* @__PURE__ */ jsxs(
255
+ "svg",
256
+ {
257
+ xmlns: "http://www.w3.org/2000/svg",
258
+ width: "18",
259
+ height: "18",
260
+ fill: "currentColor",
261
+ viewBox: "0 0 256 256",
262
+ "aria-hidden": "true",
263
+ children: [
264
+ /* @__PURE__ */ jsx("path", { d: "M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,56H80V200H40ZM216,200H96V56H216V200Z" }),
265
+ /* @__PURE__ */ jsx(
266
+ "path",
267
+ {
268
+ d: "M40,56H80V200H40Z",
269
+ className: cn(
270
+ "transition-[clip-path] duration-200 ease-out motion-reduce:transition-none",
271
+ "[clip-path:inset(0_62%_0_0)]",
272
+ "group-hover/toggle:[clip-path:inset(0_32%_0_0)]",
273
+ "group-focus-visible/toggle:[clip-path:inset(0_32%_0_0)]",
274
+ "group-data-[open=true]/sidebar-wrapper:[clip-path:inset(0_0%_0_0)]",
275
+ "group-data-[open=true]/sidebar-wrapper:group-hover/toggle:![clip-path:inset(0_62%_0_0)]",
276
+ "group-data-[open=true]/sidebar-wrapper:group-focus-visible/toggle:![clip-path:inset(0_62%_0_0)]"
277
+ )
278
+ }
279
+ )
280
+ ]
281
+ }
282
+ )
283
+ ]
284
+ }
285
+ ),
286
+ /* @__PURE__ */ jsxs(
287
+ "aside",
288
+ {
289
+ className: cn(
290
+ "flex absolute left-0 z-20 w-56 flex-col overflow-hidden",
291
+ "bg-sidebar border-r border-sidebar-border",
292
+ "transition-all duration-300 ease-out",
293
+ // ── Closed (default) ──────────────────────────────────────────────
294
+ "-translate-x-full opacity-0 pointer-events-none",
295
+ "top-14 h-[calc(100vh-3.5rem)]",
296
+ // ── Peek ──────────────────────────────────────────────────────────
297
+ "group-hover/sidebar-wrapper:translate-x-0 group-hover/sidebar-wrapper:opacity-100 group-hover/sidebar-wrapper:pointer-events-auto",
298
+ "group-hover/sidebar-wrapper:rounded-br-xl group-hover/sidebar-wrapper:border-b group-hover/sidebar-wrapper:shadow-2xl",
299
+ "group-focus-visible/toggle:translate-x-0 group-focus-visible/toggle:opacity-100 group-focus-visible/toggle:pointer-events-auto",
300
+ "group-focus-visible/toggle:rounded-br-xl group-focus-visible/toggle:border-b group-focus-visible/toggle:shadow-2xl",
301
+ "focus-within:translate-x-0 focus-within:opacity-100 focus-within:pointer-events-auto",
302
+ "focus-within:rounded-br-xl focus-within:border-b focus-within:shadow-2xl",
303
+ // ── Pinned (data-open=true on wrapper) ───────────────────────────
304
+ "group-data-[open=true]/sidebar-wrapper:!top-0 group-data-[open=true]/sidebar-wrapper:!h-full",
305
+ "group-data-[open=true]/sidebar-wrapper:!translate-x-0 group-data-[open=true]/sidebar-wrapper:!opacity-100 group-data-[open=true]/sidebar-wrapper:!pointer-events-auto",
306
+ "group-data-[open=true]/sidebar-wrapper:!rounded-none group-data-[open=true]/sidebar-wrapper:!border-b-0 group-data-[open=true]/sidebar-wrapper:!shadow-none"
307
+ ),
308
+ "aria-label": "Primary navigation",
309
+ children: [
310
+ /* @__PURE__ */ jsx("div", { className: "flex h-14 shrink-0 items-center border-b border-sidebar-border px-4", children: /* @__PURE__ */ jsx(
311
+ Link,
312
+ {
313
+ to: "/",
314
+ className: "font-mono text-sm font-medium tracking-[0.2em] text-sidebar-foreground transition-colors duration-150 hover:text-grind-orange rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",
315
+ children: "GRIND"
316
+ }
317
+ ) }),
318
+ /* @__PURE__ */ jsx("nav", { className: "h-[calc(100%-3rem)] overflow-y-auto px-3 py-3", children: /* @__PURE__ */ jsx(SidebarNav, {}) })
319
+ ]
320
+ }
321
+ )
322
+ ]
323
+ }
324
+ )
325
+ );
326
+ }
327
+ function AppLayout() {
328
+ const initialOpen = Route$a.useLoaderData();
329
+ const [sidebarOpen, setSidebarOpen] = useState(initialOpen);
330
+ const handleToggle = () => {
331
+ const next = !sidebarOpen;
332
+ setSidebarOpen(next);
333
+ document.cookie = `${SIDEBAR_COOKIE}=${next}; path=/; max-age=31536000; SameSite=Lax`;
334
+ };
335
+ return (
336
+ // data-sidebar-open drives the grid column width; CSS transitions it smoothly.
337
+ /* @__PURE__ */ jsxs(
338
+ "div",
339
+ {
340
+ "data-sidebar-open": sidebarOpen,
341
+ className: cn(
342
+ "group/layout grid h-screen w-full overflow-hidden bg-background",
343
+ "transition-[grid-template-columns] duration-300 ease-out",
344
+ "md:grid-cols-[0px_1fr] md:data-[sidebar-open=true]:grid-cols-[14rem_1fr]"
345
+ ),
346
+ children: [
347
+ /* @__PURE__ */ jsx(DesktopSidebar, { open: sidebarOpen, onToggle: handleToggle }),
348
+ /* @__PURE__ */ jsx("main", { className: "relative z-10 overflow-hidden pb-[calc(3.5rem+env(safe-area-inset-bottom))] md:pb-0", children: /* @__PURE__ */ jsx(Outlet, {}) }),
349
+ /* @__PURE__ */ jsx(MobileBottomNav, {})
350
+ ]
351
+ }
352
+ )
353
+ );
354
+ }
355
+ const Route$9 = createFileRoute("/")({
356
+ beforeLoad: () => {
357
+ throw redirect({ to: "/app" });
358
+ }
359
+ });
360
+ const $$splitErrorComponentImporter$1 = () => import("./index-CB8UtTN8.js");
361
+ const $$splitComponentImporter$7 = () => import("./index-DfU25rnD.js");
362
+ const Route$8 = createFileRoute("/app/")({
363
+ loader: () => getDashboardData(),
364
+ component: lazyRouteComponent($$splitComponentImporter$7, "component"),
365
+ errorComponent: lazyRouteComponent($$splitErrorComponentImporter$1, "errorComponent")
366
+ });
367
+ const Route$7 = createFileRoute("/api/health")({
368
+ server: {
369
+ handlers: {
370
+ GET: async () => {
371
+ try {
372
+ const { db, userId } = getVaultContext();
373
+ const user = await getUserById(db, userId);
374
+ if (!user) {
375
+ return Response.json(
376
+ { initialized: true },
377
+ {
378
+ headers: { "Access-Control-Allow-Origin": "*" }
379
+ }
380
+ );
381
+ }
382
+ return Response.json(
383
+ {
384
+ initialized: true,
385
+ user: {
386
+ displayName: user.displayName,
387
+ level: user.level,
388
+ totalXp: user.totalXp
389
+ }
390
+ },
391
+ { headers: { "Access-Control-Allow-Origin": "*" } }
392
+ );
393
+ } catch {
394
+ return Response.json(
395
+ { initialized: false },
396
+ {
397
+ headers: { "Access-Control-Allow-Origin": "*" }
398
+ }
399
+ );
400
+ }
401
+ }
402
+ }
403
+ }
404
+ });
405
+ const $$splitComponentImporter$6 = () => import("./index-D3RUqTdb.js");
406
+ const Route$6 = createFileRoute("/app/skills/")({
407
+ component: lazyRouteComponent($$splitComponentImporter$6, "component")
408
+ });
409
+ const $$splitComponentImporter$5 = () => import("./index-4SxmUYH6.js");
410
+ const Route$5 = createFileRoute("/app/quests/")({
411
+ component: lazyRouteComponent($$splitComponentImporter$5, "component")
412
+ });
413
+ const $$splitComponentImporter$4 = () => import("./index-BRRsXrOi.js");
414
+ const Route$4 = createFileRoute("/app/integrations/")({
415
+ component: lazyRouteComponent($$splitComponentImporter$4, "component")
416
+ });
417
+ const $$splitComponentImporter$3 = () => import("./index-BL8u2X7w.js");
418
+ const Route$3 = createFileRoute("/app/forge/")({
419
+ component: lazyRouteComponent($$splitComponentImporter$3, "component")
420
+ });
421
+ const $$splitComponentImporter$2 = () => import("./index-D2yaimYL.js");
422
+ const Route$2 = createFileRoute("/app/companion/")({
423
+ component: lazyRouteComponent($$splitComponentImporter$2, "component")
424
+ });
425
+ function ChatMessagesSkeleton() {
426
+ return /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
427
+ /* @__PURE__ */ jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx("div", { className: "h-10 w-2/5 rounded-2xl rounded-tr-sm bg-muted animate-pulse" }) }),
428
+ /* @__PURE__ */ jsx("div", { className: "flex justify-start", children: /* @__PURE__ */ jsxs("div", { className: "w-4/5 rounded-2xl rounded-tl-sm border border-border/50 bg-card px-4 py-3 space-y-2", children: [
429
+ /* @__PURE__ */ jsx("div", { className: "h-3 w-full rounded bg-muted animate-pulse" }),
430
+ /* @__PURE__ */ jsx("div", { className: "h-3 w-5/6 rounded bg-muted animate-pulse" }),
431
+ /* @__PURE__ */ jsx("div", { className: "h-3 w-3/4 rounded bg-muted animate-pulse" })
432
+ ] }) }),
433
+ /* @__PURE__ */ jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx("div", { className: "h-10 w-1/3 rounded-2xl rounded-tr-sm bg-muted animate-pulse" }) }),
434
+ /* @__PURE__ */ jsx("div", { className: "flex justify-start", children: /* @__PURE__ */ jsxs("div", { className: "w-3/5 rounded-2xl rounded-tl-sm border border-border/50 bg-card px-4 py-3 space-y-2", children: [
435
+ /* @__PURE__ */ jsx("div", { className: "h-3 w-full rounded bg-muted animate-pulse" }),
436
+ /* @__PURE__ */ jsx("div", { className: "h-3 w-4/5 rounded bg-muted animate-pulse" })
437
+ ] }) }),
438
+ /* @__PURE__ */ jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx("div", { className: "h-10 w-1/2 rounded-2xl rounded-tr-sm bg-muted animate-pulse" }) })
439
+ ] });
440
+ }
441
+ const $$splitErrorComponentImporter = () => import("./index-SHH7zSKt.js");
442
+ const $$splitComponentImporter$1 = () => import("./index-DTB2dYCz.js");
443
+ function ChatPageSkeleton() {
444
+ return /* @__PURE__ */ jsxs("div", { className: "flex h-full overflow-hidden", children: [
445
+ /* @__PURE__ */ jsx("div", { className: "hidden md:flex", children: /* @__PURE__ */ jsxs("aside", { className: "flex w-52 shrink-0 flex-col border-r border-border bg-sidebar", children: [
446
+ /* @__PURE__ */ jsx("div", { className: "flex h-14 items-center justify-end px-3", children: /* @__PURE__ */ jsx("div", { className: "h-8 w-24 rounded-md bg-muted animate-pulse" }) }),
447
+ /* @__PURE__ */ jsx("div", { className: "flex-1 px-2 pt-2 pb-3 space-y-0.5", children: [75, 60, 80, 55].map((w, i) => /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1 rounded-md px-3 py-2", children: [
448
+ /* @__PURE__ */ jsx("div", { className: "h-3 rounded bg-muted animate-pulse", style: {
449
+ width: `${w}%`
450
+ } }),
451
+ /* @__PURE__ */ jsx("div", { className: "h-2.5 w-10 rounded bg-muted animate-pulse" })
452
+ ] }, i)) })
453
+ ] }) }),
454
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
455
+ /* @__PURE__ */ jsxs("header", { className: "flex h-14 shrink-0 items-center gap-3 border-b border-border px-5", children: [
456
+ /* @__PURE__ */ jsx("div", { className: "h-8 w-8 rounded-full bg-muted animate-pulse" }),
457
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
458
+ /* @__PURE__ */ jsx("div", { className: "h-3.5 w-20 rounded bg-muted animate-pulse" }),
459
+ /* @__PURE__ */ jsx("div", { className: "h-2.5 w-28 rounded bg-muted animate-pulse" })
460
+ ] })
461
+ ] }),
462
+ /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-hidden px-4 py-4", children: /* @__PURE__ */ jsx(ChatMessagesSkeleton, {}) }),
463
+ /* @__PURE__ */ jsxs("div", { className: "shrink-0 border-t border-border p-3", children: [
464
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 rounded-xl border border-border bg-card p-2", children: [
465
+ /* @__PURE__ */ jsx("div", { className: "flex-1 h-9" }),
466
+ /* @__PURE__ */ jsx("div", { className: "h-8 w-8 rounded-lg bg-muted animate-pulse" })
467
+ ] }),
468
+ /* @__PURE__ */ jsx("p", { "aria-hidden": "true", className: "mt-1.5 text-center text-[10px] text-muted-foreground", children: "⌘ Return to send · Enter for newline" })
469
+ ] })
470
+ ] })
471
+ ] });
472
+ }
473
+ const Route$1 = createFileRoute("/app/chat/")({
474
+ validateSearch: (search) => ({
475
+ c: typeof search["c"] === "string" ? search["c"] : void 0
476
+ }),
477
+ loader: () => Promise.all([getConversations(), getCompanionInfo(), getPromptHistoryEntries()]).then(([conversations, companion, promptHistory]) => ({
478
+ conversations,
479
+ companion,
480
+ promptHistory
481
+ })),
482
+ staleTime: Infinity,
483
+ pendingComponent: ChatPageSkeleton,
484
+ pendingMs: 0,
485
+ pendingMinMs: 0,
486
+ component: lazyRouteComponent($$splitComponentImporter$1, "component"),
487
+ errorComponent: lazyRouteComponent($$splitErrorComponentImporter, "errorComponent")
488
+ });
489
+ const $$splitComponentImporter = () => import("./index-BiD7uOOh.js");
490
+ const Route = createFileRoute("/app/analytics/")({
491
+ component: lazyRouteComponent($$splitComponentImporter, "component")
492
+ });
493
+ const AppRoute = Route$a.update({
494
+ id: "/app",
495
+ path: "/app",
496
+ getParentRoute: () => Route$b
497
+ });
498
+ const IndexRoute = Route$9.update({
499
+ id: "/",
500
+ path: "/",
501
+ getParentRoute: () => Route$b
502
+ });
503
+ const AppIndexRoute = Route$8.update({
504
+ id: "/",
505
+ path: "/",
506
+ getParentRoute: () => AppRoute
507
+ });
508
+ const ApiHealthRoute = Route$7.update({
509
+ id: "/api/health",
510
+ path: "/api/health",
511
+ getParentRoute: () => Route$b
512
+ });
513
+ const AppSkillsIndexRoute = Route$6.update({
514
+ id: "/skills/",
515
+ path: "/skills/",
516
+ getParentRoute: () => AppRoute
517
+ });
518
+ const AppQuestsIndexRoute = Route$5.update({
519
+ id: "/quests/",
520
+ path: "/quests/",
521
+ getParentRoute: () => AppRoute
522
+ });
523
+ const AppIntegrationsIndexRoute = Route$4.update({
524
+ id: "/integrations/",
525
+ path: "/integrations/",
526
+ getParentRoute: () => AppRoute
527
+ });
528
+ const AppForgeIndexRoute = Route$3.update({
529
+ id: "/forge/",
530
+ path: "/forge/",
531
+ getParentRoute: () => AppRoute
532
+ });
533
+ const AppCompanionIndexRoute = Route$2.update({
534
+ id: "/companion/",
535
+ path: "/companion/",
536
+ getParentRoute: () => AppRoute
537
+ });
538
+ const AppChatIndexRoute = Route$1.update({
539
+ id: "/chat/",
540
+ path: "/chat/",
541
+ getParentRoute: () => AppRoute
542
+ });
543
+ const AppAnalyticsIndexRoute = Route.update({
544
+ id: "/analytics/",
545
+ path: "/analytics/",
546
+ getParentRoute: () => AppRoute
547
+ });
548
+ const AppRouteChildren = {
549
+ AppIndexRoute,
550
+ AppAnalyticsIndexRoute,
551
+ AppChatIndexRoute,
552
+ AppCompanionIndexRoute,
553
+ AppForgeIndexRoute,
554
+ AppIntegrationsIndexRoute,
555
+ AppQuestsIndexRoute,
556
+ AppSkillsIndexRoute
557
+ };
558
+ const AppRouteWithChildren = AppRoute._addFileChildren(AppRouteChildren);
559
+ const rootRouteChildren = {
560
+ IndexRoute,
561
+ AppRoute: AppRouteWithChildren,
562
+ ApiHealthRoute
563
+ };
564
+ const routeTree = Route$b._addFileChildren(rootRouteChildren)._addFileTypes();
565
+ function getRouter() {
566
+ const router2 = createRouter({
567
+ routeTree,
568
+ context: getContext(),
569
+ scrollRestoration: true,
570
+ defaultPreload: "intent",
571
+ defaultPreloadStaleTime: 0
572
+ });
573
+ return router2;
574
+ }
575
+ const router = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
576
+ __proto__: null,
577
+ getRouter
578
+ }, Symbol.toStringTag, { value: "Module" }));
579
+ export {
580
+ ChatMessagesSkeleton as C,
581
+ Route$8 as R,
582
+ createSsrRpc as a,
583
+ Route$1 as b,
584
+ cn as c,
585
+ appendPromptHistoryEntry as d,
586
+ getConversations as g,
587
+ loadConversationMessages as l,
588
+ router as r
589
+ };