claude-session-dashboard 0.4.5 → 0.5.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 (45) hide show
  1. package/dist/client/assets/{_dashboard-Job6DOd1.js → _dashboard-ChSI7O-o.js} +1 -1
  2. package/dist/client/assets/{_sessionId-CIFXqjVa.js → _sessionId-DxfkocLt.js} +2 -2
  3. package/dist/client/assets/app-BAZLXX_G.css +1 -0
  4. package/dist/client/assets/createServerFn-DJjqV8Yc.js +1 -0
  5. package/dist/client/assets/index-BHwOAB5a.js +1 -0
  6. package/dist/client/assets/main-DMwMzWYr.js +69 -0
  7. package/dist/client/assets/{sessions.queries-ClgzoOt4.js → sessions.queries-D7WObk5d.js} +1 -1
  8. package/dist/client/assets/settings-BM0TBEkW.js +1 -0
  9. package/dist/client/assets/settings.types-BNSfIfFX.js +1 -0
  10. package/dist/client/assets/stats-wLUGXFpZ.js +4 -0
  11. package/dist/client/assets/useSessionCost-BPqnyONZ.js +37 -0
  12. package/dist/server/assets/{_dashboard-61fpMMMe.js → _dashboard-DZJZ9oYy.js} +7 -6
  13. package/dist/server/assets/{_sessionId-B_O50OfN.js → _sessionId-znGcd1Dj.js} +40 -11
  14. package/dist/server/assets/_tanstack-start-manifest_v-BNorjuP4.js +4 -0
  15. package/dist/server/assets/{app-info.api-CdaWsxHl.js → app-info.api-CrHplh0q.js} +31 -16
  16. package/dist/server/assets/{createServerRpc-Bd3B-Ah9.js → createServerRpc-D_-6bKnO.js} +1 -1
  17. package/dist/server/assets/{createSsrRpc-CVg2UDl0.js → createSsrRpc-OFLSk08e.js} +2 -3
  18. package/dist/server/assets/{index-BYcFI9Ho.js → index-BnvjnlZM.js} +27 -10
  19. package/dist/server/assets/{project-analytics.api-QnhRRs7T.js → project-analytics.api-6b5TIBNn.js} +10 -8
  20. package/dist/server/assets/{router-BvYNknMb.js → router-DAepjaOj.js} +6 -6
  21. package/dist/server/assets/{session-detail.api-8plxSeB0.js → session-detail.api-BQts3iQn.js} +38 -33
  22. package/dist/server/assets/{session-parser-DxLcS8VW.js → session-parser-DKZZMuh6.js} +122 -30
  23. package/dist/server/assets/{session-scanner-DRGzVO2T.js → session-scanner-CECpfGFh.js} +4 -4
  24. package/dist/server/assets/{sessions.api-DRmOjipJ.js → sessions.api-CQ-Lrk5S.js} +10 -8
  25. package/dist/server/assets/{sessions.queries-CvAnVbE8.js → sessions.queries-MfPgj6cK.js} +1 -1
  26. package/dist/server/assets/{settings-Ct2BZGxb.js → settings-DsLaw8yg.js} +11 -10
  27. package/dist/server/assets/{settings.api-C9L2GoIE.js → settings.api-Cq5KPUxN.js} +8 -7
  28. package/dist/server/assets/{settings.queries-BVEZA-1G.js → settings.queries-CMWxUDF-.js} +2 -2
  29. package/dist/server/assets/{settings.types-DntadCHo.js → settings.types-CphWe-HW.js} +10 -1
  30. package/dist/server/assets/{stats-CZEpvzmd.js → stats-DKbhSePW.js} +9 -9
  31. package/dist/server/assets/{stats.api-CH-wTCGE.js → stats.api-tIZqhk4B.js} +10 -8
  32. package/dist/server/assets/{useSessionCost-CyWBuljV.js → useSessionCost-iQEg4FRM.js} +2 -2
  33. package/dist/server/server.js +456 -817
  34. package/package.json +3 -2
  35. package/LICENSE +0 -21
  36. package/README.md +0 -194
  37. package/dist/client/assets/app-CkRVT69z.css +0 -1
  38. package/dist/client/assets/createServerFn-6SJrpRCO.js +0 -1
  39. package/dist/client/assets/index-DDr2smLW.js +0 -1
  40. package/dist/client/assets/main-B6FohBFQ.js +0 -69
  41. package/dist/client/assets/settings-DQD2EaIq.js +0 -1
  42. package/dist/client/assets/settings.types-LYd9Z8Y1.js +0 -1
  43. package/dist/client/assets/stats-CrWQ_y2R.js +0 -4
  44. package/dist/client/assets/useSessionCost-Drt0v6oj.js +0 -37
  45. package/dist/server/assets/_tanstack-start-manifest_v-Dva5sIpS.js +0 -4
@@ -1,18 +1,19 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useMatches, Link, Outlet } from "@tanstack/react-router";
3
3
  import { useQuery, queryOptions } from "@tanstack/react-query";
4
- import { a as activeSessionsQuery } from "./sessions.queries-CvAnVbE8.js";
5
- import { c as createSsrRpc } from "./createSsrRpc-CVg2UDl0.js";
4
+ import { a as activeSessionsQuery } from "./sessions.queries-MfPgj6cK.js";
5
+ import { c as createSsrRpc } from "./createSsrRpc-OFLSk08e.js";
6
6
  import { c as createServerFn } from "../server.js";
7
7
  import "zod";
8
- import "@tanstack/history";
9
- import "@tanstack/router-core/ssr/client";
10
- import "@tanstack/router-core";
11
8
  import "node:async_hooks";
12
- import "@tanstack/router-core/ssr/server";
13
9
  import "h3-v2";
10
+ import "@tanstack/router-core";
14
11
  import "tiny-invariant";
15
12
  import "seroval";
13
+ import "@tanstack/history";
14
+ import "@tanstack/router-core/ssr/client";
15
+ import "@tanstack/router-core/ssr/server";
16
+ import "react";
16
17
  import "@tanstack/react-router/ssr/server";
17
18
  function ActiveSessionsBadge() {
18
19
  const { data: activeSessions } = useQuery(activeSessionsQuery);
@@ -1,26 +1,26 @@
1
1
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
2
  import { Link } from "@tanstack/react-router";
3
3
  import { queryOptions, useQuery } from "@tanstack/react-query";
4
- import { c as createSsrRpc } from "./createSsrRpc-CVg2UDl0.js";
4
+ import { c as createSsrRpc } from "./createSsrRpc-OFLSk08e.js";
5
5
  import { c as createServerFn } from "../server.js";
6
6
  import { useRef, useCallback, useState, useEffect, useMemo } from "react";
7
7
  import { format } from "date-fns";
8
8
  import { a as formatDuration, f as formatTokenCount, e as formatDateTime, c as formatUSD } from "./format-DIZHV7IJ.js";
9
9
  import { ResponsiveContainer, AreaChart, YAxis, Tooltip, ReferenceLine, Area } from "recharts";
10
- import { s as settingsQuery } from "./settings.queries-BVEZA-1G.js";
11
- import { g as getMergedPricing, c as calculateSessionCost, u as useSessionCost, E as ExportDropdown, d as downloadFile, e as sessionToJSON } from "./useSessionCost-CyWBuljV.js";
12
- import { a as activeSessionsQuery } from "./sessions.queries-CvAnVbE8.js";
13
- import { c as Route, u as usePrivacy } from "./router-BvYNknMb.js";
14
- import "@tanstack/history";
15
- import "@tanstack/router-core/ssr/client";
16
- import "@tanstack/router-core";
10
+ import { s as settingsQuery } from "./settings.queries-CMWxUDF-.js";
11
+ import { g as getMergedPricing, c as calculateSessionCost, u as useSessionCost, E as ExportDropdown, d as downloadFile, e as sessionToJSON } from "./useSessionCost-iQEg4FRM.js";
12
+ import { a as activeSessionsQuery } from "./sessions.queries-MfPgj6cK.js";
13
+ import { c as Route, u as usePrivacy } from "./router-DAepjaOj.js";
17
14
  import "node:async_hooks";
18
- import "@tanstack/router-core/ssr/server";
19
15
  import "h3-v2";
16
+ import "@tanstack/router-core";
20
17
  import "tiny-invariant";
21
18
  import "seroval";
19
+ import "@tanstack/history";
20
+ import "@tanstack/router-core/ssr/client";
21
+ import "@tanstack/router-core/ssr/server";
22
22
  import "@tanstack/react-router/ssr/server";
23
- import "./settings.types-DntadCHo.js";
23
+ import "./settings.types-CphWe-HW.js";
24
24
  import "zod";
25
25
  const getSessionDetail = createServerFn({
26
26
  method: "GET"
@@ -1540,6 +1540,35 @@ function useIsSessionActive(sessionId) {
1540
1540
  const { data: activeSessions } = useQuery(activeSessionsQuery);
1541
1541
  return activeSessions?.some((s) => s.sessionId === sessionId) ?? false;
1542
1542
  }
1543
+ function SessionIdDisplay({ sessionId }) {
1544
+ const [copied, setCopied] = useState(false);
1545
+ const timerRef = useRef(void 0);
1546
+ useEffect(() => {
1547
+ return () => clearTimeout(timerRef.current);
1548
+ }, []);
1549
+ async function handleCopy() {
1550
+ try {
1551
+ await navigator.clipboard.writeText(`claude --resume ${sessionId}`);
1552
+ setCopied(true);
1553
+ clearTimeout(timerRef.current);
1554
+ timerRef.current = setTimeout(() => setCopied(false), 2e3);
1555
+ } catch {
1556
+ }
1557
+ }
1558
+ return /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1.5 font-mono text-xs text-gray-600", children: [
1559
+ /* @__PURE__ */ jsx("span", { children: sessionId }),
1560
+ /* @__PURE__ */ jsx(
1561
+ "button",
1562
+ {
1563
+ type: "button",
1564
+ onClick: handleCopy,
1565
+ className: "rounded px-1 py-0.5 text-gray-500 hover:bg-gray-800 hover:text-gray-300",
1566
+ title: "Copy resume command",
1567
+ children: copied ? "Copied!" : "Copy"
1568
+ }
1569
+ )
1570
+ ] });
1571
+ }
1543
1572
  function SessionDetailPage() {
1544
1573
  const {
1545
1574
  sessionId
@@ -1599,7 +1628,7 @@ function SessionDetailPage() {
1599
1628
  label: "Export Session (JSON)",
1600
1629
  onClick: () => downloadFile(sessionToJSON(detail), `session-${sessionId.slice(0, 8)}.json`, "application/json")
1601
1630
  }] }),
1602
- /* @__PURE__ */ jsx("span", { className: "font-mono text-xs text-gray-600", children: sessionId.slice(0, 8) })
1631
+ /* @__PURE__ */ jsx(SessionIdDisplay, { sessionId })
1603
1632
  ] })
1604
1633
  ] }),
1605
1634
  /* @__PURE__ */ jsxs("div", { className: "mt-6 grid grid-cols-1 gap-4 md:grid-cols-2", children: [
@@ -0,0 +1,4 @@
1
+ const tsrStartManifest = () => ({ "routes": { "__root__": { "filePath": "/home/runner/work/claude-session-dashboard/claude-session-dashboard/apps/web/src/routes/__root.tsx", "children": ["/", "/_dashboard"], "preloads": ["/assets/main-DMwMzWYr.js"] }, "/_dashboard": { "filePath": "/home/runner/work/claude-session-dashboard/claude-session-dashboard/apps/web/src/routes/_dashboard.tsx", "children": ["/_dashboard/settings", "/_dashboard/stats", "/_dashboard/sessions/$sessionId", "/_dashboard/sessions/"], "preloads": ["/assets/_dashboard-ChSI7O-o.js", "/assets/createServerFn-DJjqV8Yc.js", "/assets/sessions.queries-D7WObk5d.js"] }, "/_dashboard/settings": { "filePath": "/home/runner/work/claude-session-dashboard/claude-session-dashboard/apps/web/src/routes/_dashboard/settings.tsx", "preloads": ["/assets/settings-BM0TBEkW.js", "/assets/settings.types-BNSfIfFX.js"] }, "/_dashboard/stats": { "filePath": "/home/runner/work/claude-session-dashboard/claude-session-dashboard/apps/web/src/routes/_dashboard/stats.tsx", "preloads": ["/assets/stats-wLUGXFpZ.js", "/assets/format-Bsprb3az.js", "/assets/useSessionCost-BPqnyONZ.js", "/assets/settings.types-BNSfIfFX.js"] }, "/_dashboard/sessions/$sessionId": { "filePath": "/home/runner/work/claude-session-dashboard/claude-session-dashboard/apps/web/src/routes/_dashboard/sessions/$sessionId.tsx", "preloads": ["/assets/_sessionId-DxfkocLt.js", "/assets/format-Bsprb3az.js", "/assets/useSessionCost-BPqnyONZ.js", "/assets/settings.types-BNSfIfFX.js"] }, "/_dashboard/sessions/": { "filePath": "/home/runner/work/claude-session-dashboard/claude-session-dashboard/apps/web/src/routes/_dashboard/sessions/index.tsx", "preloads": ["/assets/index-BHwOAB5a.js", "/assets/format-Bsprb3az.js"] } }, "clientEntry": "/assets/main-DMwMzWYr.js" });
2
+ export {
3
+ tsrStartManifest
4
+ };
@@ -1,18 +1,41 @@
1
- import { c as createServerRpc } from "./createServerRpc-Bd3B-Ah9.js";
1
+ import { c as createServerRpc } from "./createServerRpc-D_-6bKnO.js";
2
2
  import * as fs from "node:fs";
3
+ import * as os from "node:os";
3
4
  import * as path from "node:path";
5
+ import { fileURLToPath } from "node:url";
4
6
  import { c as createServerFn } from "../server.js";
5
- import "@tanstack/history";
6
- import "@tanstack/router-core/ssr/client";
7
- import "@tanstack/router-core";
8
7
  import "node:async_hooks";
9
- import "@tanstack/router-core/ssr/server";
10
8
  import "h3-v2";
9
+ import "@tanstack/router-core";
11
10
  import "tiny-invariant";
12
11
  import "seroval";
12
+ import "@tanstack/history";
13
+ import "@tanstack/router-core/ssr/client";
14
+ import "@tanstack/router-core/ssr/server";
15
+ import "react";
16
+ import "@tanstack/react-router";
13
17
  import "react/jsx-runtime";
14
18
  import "@tanstack/react-router/ssr/server";
15
- import "@tanstack/react-router";
19
+ function readVersionFromPackageJson() {
20
+ const candidates = [new URL("../../../package.json", import.meta.url), new URL("../../../../package.json", import.meta.url)];
21
+ for (const candidate of candidates) {
22
+ try {
23
+ const pkgPath = fileURLToPath(candidate);
24
+ const raw = fs.readFileSync(pkgPath, "utf-8");
25
+ const pkg = JSON.parse(raw);
26
+ if (pkg.version) return pkg.version;
27
+ } catch {
28
+ }
29
+ }
30
+ try {
31
+ const pkgPath = path.resolve(process.cwd(), "package.json");
32
+ const raw = fs.readFileSync(pkgPath, "utf-8");
33
+ const pkg = JSON.parse(raw);
34
+ if (pkg.version) return pkg.version;
35
+ } catch {
36
+ }
37
+ return "unknown";
38
+ }
16
39
  const getAppInfo_createServerFn_handler = createServerRpc({
17
40
  id: "04ac41a7e3e644815167d098c2d6c3375d00a72a11e5af0d37033ba771081ba9",
18
41
  name: "getAppInfo",
@@ -21,17 +44,9 @@ const getAppInfo_createServerFn_handler = createServerRpc({
21
44
  const getAppInfo = createServerFn({
22
45
  method: "GET"
23
46
  }).handler(getAppInfo_createServerFn_handler, async () => {
24
- let version = "unknown";
25
- try {
26
- const pkgPath = path.resolve(process.cwd(), "package.json");
27
- const raw = fs.readFileSync(pkgPath, "utf-8");
28
- const pkg = JSON.parse(raw);
29
- version = pkg.version ?? "unknown";
30
- } catch {
31
- }
32
47
  return {
33
- version,
34
- appPath: process.cwd(),
48
+ version: readVersionFromPackageJson(),
49
+ appPath: path.join(os.homedir(), ".claude"),
35
50
  nodeEnv: "production"
36
51
  };
37
52
  });
@@ -1,5 +1,5 @@
1
1
  import { T as TSS_SERVER_FUNCTION } from "../server.js";
2
- const createServerRpc = (serverFnMeta, splitImportFn) => {
2
+ var createServerRpc = (serverFnMeta, splitImportFn) => {
3
3
  const url = "/_serverFn/" + serverFnMeta.id;
4
4
  return Object.assign(splitImportFn, {
5
5
  url,
@@ -1,10 +1,9 @@
1
1
  import { T as TSS_SERVER_FUNCTION, g as getServerFnById } from "../server.js";
2
- const createSsrRpc = (functionId, importer) => {
2
+ var createSsrRpc = (functionId, importer) => {
3
3
  const url = "/_serverFn/" + functionId;
4
4
  const serverFnMeta = { id: functionId };
5
5
  const fn = async (...args) => {
6
- const serverFn = await getServerFnById(functionId);
7
- return serverFn(...args);
6
+ return (await getServerFnById(functionId))(...args);
8
7
  };
9
8
  return Object.assign(fn, {
10
9
  url,
@@ -1,23 +1,38 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useState, useEffect, useRef, useCallback, useMemo } from "react";
3
3
  import { useQuery } from "@tanstack/react-query";
4
4
  import { Link, useNavigate } from "@tanstack/react-router";
5
- import { p as paginatedSessionListQuery, a as activeSessionsQuery } from "./sessions.queries-CvAnVbE8.js";
5
+ import { p as paginatedSessionListQuery, a as activeSessionsQuery } from "./sessions.queries-MfPgj6cK.js";
6
6
  import { a as formatDuration, b as formatRelativeTime, d as formatBytes } from "./format-DIZHV7IJ.js";
7
- import { u as usePrivacy, b as Route } from "./router-BvYNknMb.js";
8
- import "./createSsrRpc-CVg2UDl0.js";
7
+ import { u as usePrivacy, b as Route } from "./router-DAepjaOj.js";
8
+ import "./createSsrRpc-OFLSk08e.js";
9
9
  import "../server.js";
10
- import "@tanstack/history";
11
- import "@tanstack/router-core/ssr/client";
12
- import "@tanstack/router-core";
13
10
  import "node:async_hooks";
14
- import "@tanstack/router-core/ssr/server";
15
11
  import "h3-v2";
12
+ import "@tanstack/router-core";
16
13
  import "tiny-invariant";
17
14
  import "seroval";
15
+ import "@tanstack/history";
16
+ import "@tanstack/router-core/ssr/client";
17
+ import "@tanstack/router-core/ssr/server";
18
18
  import "@tanstack/react-router/ssr/server";
19
19
  import "zod";
20
20
  import "date-fns";
21
+ const PLATFORM_STYLES = {
22
+ windows: "bg-blue-950 text-blue-400 border border-blue-800",
23
+ wsl: "bg-purple-950 text-purple-400 border border-purple-800"
24
+ };
25
+ const DEFAULT_STYLE = "bg-gray-800 text-gray-400 border border-gray-700";
26
+ function SourceBadge({ sourceLabel, platform, className }) {
27
+ const platformStyle = platform ? PLATFORM_STYLES[platform] ?? DEFAULT_STYLE : DEFAULT_STYLE;
28
+ return /* @__PURE__ */ jsx(
29
+ "span",
30
+ {
31
+ className: `inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${platformStyle}${className ? ` ${className}` : ""}`,
32
+ children: sourceLabel
33
+ }
34
+ );
35
+ }
21
36
  function StatusBadge({ isActive }) {
22
37
  if (isActive) {
23
38
  return /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1.5 rounded-full bg-emerald-500/15 px-2.5 py-0.5 text-xs font-medium text-emerald-400", children: [
@@ -62,7 +77,8 @@ function SessionCard({ session }) {
62
77
  /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
63
78
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
64
79
  /* @__PURE__ */ jsx("h3", { className: "truncate text-sm font-semibold text-gray-100", children: displayName }),
65
- /* @__PURE__ */ jsx(StatusBadge, { isActive: session.isActive })
80
+ /* @__PURE__ */ jsx(StatusBadge, { isActive: session.isActive }),
81
+ session.sourceLabel && /* @__PURE__ */ jsx(SourceBadge, { sourceLabel: session.sourceLabel, platform: session.sourcePlatform })
66
82
  ] }),
67
83
  displayBranch && /* @__PURE__ */ jsx("p", { className: "mt-1 truncate text-xs text-gray-500", children: /* @__PURE__ */ jsx("span", { className: "font-mono", children: displayBranch }) })
68
84
  ] }),
@@ -75,7 +91,8 @@ function SessionCard({ session }) {
75
91
  " msgs"
76
92
  ] }),
77
93
  session.model && /* @__PURE__ */ jsx("span", { title: "Model", className: "truncate font-mono text-gray-500", children: session.model.replace(/^claude-/, "").split("-202")[0] }),
78
- /* @__PURE__ */ jsx("span", { title: "File size", className: "text-gray-500", children: formatBytes(session.fileSizeBytes) })
94
+ /* @__PURE__ */ jsx("span", { title: "File size", className: "text-gray-500", children: formatBytes(session.fileSizeBytes) }),
95
+ /* @__PURE__ */ jsx("span", { title: "Session ID", className: "font-mono text-gray-500", children: session.sessionId.slice(0, 8) })
79
96
  ] }),
80
97
  displayCwd && /* @__PURE__ */ jsx("p", { className: "mt-2 truncate text-xs font-mono text-gray-600", children: displayCwd })
81
98
  ]
@@ -1,22 +1,24 @@
1
- import { c as createServerRpc } from "./createServerRpc-Bd3B-Ah9.js";
2
- import { a as scanAllSessions } from "./session-scanner-DRGzVO2T.js";
1
+ import { c as createServerRpc } from "./createServerRpc-D_-6bKnO.js";
2
+ import { s as scanAllSessions } from "./session-scanner-CECpfGFh.js";
3
3
  import { c as createServerFn } from "../server.js";
4
4
  import "node:fs";
5
5
  import "node:path";
6
- import "./session-parser-DxLcS8VW.js";
6
+ import "./session-parser-DKZZMuh6.js";
7
7
  import "node:os";
8
+ import "node:fs/promises";
8
9
  import "node:readline";
9
- import "@tanstack/history";
10
- import "@tanstack/router-core/ssr/client";
11
- import "@tanstack/router-core";
12
10
  import "node:async_hooks";
13
- import "@tanstack/router-core/ssr/server";
14
11
  import "h3-v2";
12
+ import "@tanstack/router-core";
15
13
  import "tiny-invariant";
16
14
  import "seroval";
15
+ import "@tanstack/history";
16
+ import "@tanstack/router-core/ssr/client";
17
+ import "@tanstack/router-core/ssr/server";
18
+ import "react";
19
+ import "@tanstack/react-router";
17
20
  import "react/jsx-runtime";
18
21
  import "@tanstack/react-router/ssr/server";
19
- import "@tanstack/react-router";
20
22
  function aggregateProjectAnalytics(allSessions) {
21
23
  const projectMap = /* @__PURE__ */ new Map();
22
24
  for (const session of allSessions) {
@@ -146,7 +146,7 @@ function useTheme() {
146
146
  }
147
147
  return ctx;
148
148
  }
149
- const appCss = "/assets/app-CkRVT69z.css";
149
+ const appCss = "/assets/app-BAZLXX_G.css";
150
150
  const queryClient = new QueryClient({
151
151
  defaultOptions: {
152
152
  queries: {
@@ -203,7 +203,7 @@ function RootDocument({ children }) {
203
203
  ] })
204
204
  ] });
205
205
  }
206
- const $$splitComponentImporter$4 = () => import("./_dashboard-61fpMMMe.js");
206
+ const $$splitComponentImporter$4 = () => import("./_dashboard-DZJZ9oYy.js");
207
207
  const Route$5 = createFileRoute("/_dashboard")({
208
208
  component: lazyRouteComponent($$splitComponentImporter$4, "component")
209
209
  });
@@ -212,7 +212,7 @@ const Route$4 = createFileRoute("/")({
212
212
  throw redirect({ to: "/sessions" });
213
213
  }
214
214
  });
215
- const $$splitComponentImporter$3 = () => import("./stats-CZEpvzmd.js");
215
+ const $$splitComponentImporter$3 = () => import("./stats-DKbhSePW.js");
216
216
  const statsSearchSchema = z.object({
217
217
  tab: z.enum(["overview", "projects"]).default("overview").catch("overview")
218
218
  });
@@ -220,11 +220,11 @@ const Route$3 = createFileRoute("/_dashboard/stats")({
220
220
  validateSearch: statsSearchSchema,
221
221
  component: lazyRouteComponent($$splitComponentImporter$3, "component")
222
222
  });
223
- const $$splitComponentImporter$2 = () => import("./settings-Ct2BZGxb.js");
223
+ const $$splitComponentImporter$2 = () => import("./settings-DsLaw8yg.js");
224
224
  const Route$2 = createFileRoute("/_dashboard/settings")({
225
225
  component: lazyRouteComponent($$splitComponentImporter$2, "component")
226
226
  });
227
- const $$splitComponentImporter$1 = () => import("./index-BYcFI9Ho.js");
227
+ const $$splitComponentImporter$1 = () => import("./index-BnvjnlZM.js");
228
228
  const sessionsSearchSchema = z.object({
229
229
  page: z.number().int().min(1).default(1).catch(1),
230
230
  pageSize: z.number().int().min(5).max(100).default(5).catch(5),
@@ -236,7 +236,7 @@ const Route$1 = createFileRoute("/_dashboard/sessions/")({
236
236
  validateSearch: sessionsSearchSchema,
237
237
  component: lazyRouteComponent($$splitComponentImporter$1, "component")
238
238
  });
239
- const $$splitComponentImporter = () => import("./_sessionId-B_O50OfN.js");
239
+ const $$splitComponentImporter = () => import("./_sessionId-znGcd1Dj.js");
240
240
  const searchSchema = z.object({
241
241
  project: z.string().optional()
242
242
  });
@@ -1,40 +1,34 @@
1
- import { c as createServerRpc } from "./createServerRpc-Bd3B-Ah9.js";
1
+ import { c as createServerRpc } from "./createServerRpc-D_-6bKnO.js";
2
+ import { a as getDataSources, b as getProjectsDirFor, d as decodeProjectDirName, e as extractProjectName, p as parseDetail } from "./session-parser-DKZZMuh6.js";
2
3
  import * as path from "node:path";
3
4
  import * as fs from "node:fs";
4
- import { e as extractProjectName, p as parseDetail, a as getProjectsDir, d as decodeProjectDirName } from "./session-parser-DxLcS8VW.js";
5
5
  import { c as createServerFn } from "../server.js";
6
6
  import "node:os";
7
+ import "node:fs/promises";
7
8
  import "node:readline";
8
- import "@tanstack/history";
9
- import "@tanstack/router-core/ssr/client";
10
- import "@tanstack/router-core";
11
9
  import "node:async_hooks";
12
- import "@tanstack/router-core/ssr/server";
13
10
  import "h3-v2";
11
+ import "@tanstack/router-core";
14
12
  import "tiny-invariant";
15
13
  import "seroval";
14
+ import "@tanstack/history";
15
+ import "@tanstack/router-core/ssr/client";
16
+ import "@tanstack/router-core/ssr/server";
17
+ import "react";
18
+ import "@tanstack/react-router";
16
19
  import "react/jsx-runtime";
17
20
  import "@tanstack/react-router/ssr/server";
18
- import "@tanstack/react-router";
19
- const getSessionDetail_createServerFn_handler = createServerRpc({
20
- id: "71794080473579a94431392ab409ebd02772f6a9f6a08386cadbb8c0d3cf804a",
21
- name: "getSessionDetail",
22
- filename: "src/features/session-detail/session-detail.api.ts"
23
- }, (opts) => getSessionDetail.__executeServer(opts));
24
- const getSessionDetail = createServerFn({
25
- method: "GET"
26
- }).inputValidator((input) => input).handler(getSessionDetail_createServerFn_handler, async ({
27
- data
28
- }) => {
29
- const filePath = findSessionFile(data.sessionId, data.projectPath);
30
- if (!filePath) {
31
- throw new Error(`Session not found: ${data.sessionId}`);
21
+ async function findSessionFile(sessionId, projectPath) {
22
+ const sources = await getDataSources();
23
+ for (const source of sources) {
24
+ if (!source.available) continue;
25
+ const result = findInSource(sessionId, projectPath, source);
26
+ if (result) return result;
32
27
  }
33
- const projectName = extractProjectName(data.projectPath);
34
- return parseDetail(filePath.path, data.sessionId, data.projectPath, projectName);
35
- });
36
- function findSessionFile(sessionId, projectPath) {
37
- const projectsDir = getProjectsDir();
28
+ return null;
29
+ }
30
+ function findInSource(sessionId, projectPath, source) {
31
+ const projectsDir = getProjectsDirFor(source);
38
32
  let entries;
39
33
  try {
40
34
  entries = fs.readdirSync(projectsDir);
@@ -46,24 +40,35 @@ function findSessionFile(sessionId, projectPath) {
46
40
  if (decoded === projectPath || dirName === projectPath) {
47
41
  const filePath = path.join(projectsDir, dirName, `${sessionId}.jsonl`);
48
42
  if (fs.existsSync(filePath)) {
49
- return {
50
- path: filePath,
51
- dirName
52
- };
43
+ return { path: filePath, dirName };
53
44
  }
54
45
  }
55
46
  }
56
47
  for (const dirName of entries) {
57
48
  const filePath = path.join(projectsDir, dirName, `${sessionId}.jsonl`);
58
49
  if (fs.existsSync(filePath)) {
59
- return {
60
- path: filePath,
61
- dirName
62
- };
50
+ return { path: filePath, dirName };
63
51
  }
64
52
  }
65
53
  return null;
66
54
  }
55
+ const getSessionDetail_createServerFn_handler = createServerRpc({
56
+ id: "71794080473579a94431392ab409ebd02772f6a9f6a08386cadbb8c0d3cf804a",
57
+ name: "getSessionDetail",
58
+ filename: "src/features/session-detail/session-detail.api.ts"
59
+ }, (opts) => getSessionDetail.__executeServer(opts));
60
+ const getSessionDetail = createServerFn({
61
+ method: "GET"
62
+ }).inputValidator((input) => input).handler(getSessionDetail_createServerFn_handler, async ({
63
+ data
64
+ }) => {
65
+ const filePath = await findSessionFile(data.sessionId, data.projectPath);
66
+ if (!filePath) {
67
+ throw new Error(`Session not found: ${data.sessionId}`);
68
+ }
69
+ const projectName = extractProjectName(data.projectPath);
70
+ return parseDetail(filePath.path, data.sessionId, data.projectPath, projectName);
71
+ });
67
72
  export {
68
73
  getSessionDetail_createServerFn_handler
69
74
  };