@claude-sessions/web 0.1.9 → 0.2.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/build/client/_app/immutable/assets/0.C5R9o71K.css +1 -0
- package/build/client/_app/immutable/assets/0.C5R9o71K.css.br +0 -0
- package/build/client/_app/immutable/assets/0.C5R9o71K.css.gz +0 -0
- package/build/client/_app/immutable/chunks/AZ94Ipj9.js +70 -0
- package/build/client/_app/immutable/chunks/AZ94Ipj9.js.br +0 -0
- package/build/client/_app/immutable/chunks/AZ94Ipj9.js.gz +0 -0
- package/build/client/_app/immutable/chunks/B0Rw2QtT.js +1 -0
- package/build/client/_app/immutable/chunks/B0Rw2QtT.js.br +0 -0
- package/build/client/_app/immutable/chunks/B0Rw2QtT.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{akEBbnuI.js → CTEGPjQ0.js} +2 -2
- package/build/client/_app/immutable/chunks/CTEGPjQ0.js.br +0 -0
- package/build/client/_app/immutable/chunks/CTEGPjQ0.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{DVqJsTXH.js → DtBUhGYl.js} +1 -1
- package/build/client/_app/immutable/chunks/DtBUhGYl.js.br +0 -0
- package/build/client/_app/immutable/chunks/DtBUhGYl.js.gz +0 -0
- package/build/client/_app/immutable/entry/{app.BrFSuCuw.js → app.Tdjn1QRv.js} +2 -2
- package/build/client/_app/immutable/entry/app.Tdjn1QRv.js.br +0 -0
- package/build/client/_app/immutable/entry/app.Tdjn1QRv.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.Bg54jm38.js +1 -0
- package/build/client/_app/immutable/entry/start.Bg54jm38.js.br +0 -0
- package/build/client/_app/immutable/entry/start.Bg54jm38.js.gz +0 -0
- package/build/client/_app/immutable/nodes/0.C7I1GVwu.js +1 -0
- package/build/client/_app/immutable/nodes/0.C7I1GVwu.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.C7I1GVwu.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{1.Dy2lJ-WY.js → 1._fFmd_Oa.js} +1 -1
- package/build/client/_app/immutable/nodes/1._fFmd_Oa.js.br +0 -0
- package/build/client/_app/immutable/nodes/1._fFmd_Oa.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.Bipq5Y0j.js +5 -0
- package/build/client/_app/immutable/nodes/2.Bipq5Y0j.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.Bipq5Y0j.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{3.BGtShXcH.js → 3.1hPDKy38.js} +1 -1
- package/build/client/_app/immutable/nodes/3.1hPDKy38.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.1hPDKy38.js.gz +0 -0
- package/build/client/_app/version.json +1 -1
- package/build/client/_app/version.json.br +0 -0
- package/build/client/_app/version.json.gz +0 -0
- package/build/server/chunks/{0-CJnJjLuU.js → 0-DpTw60jY.js} +3 -3
- package/build/server/chunks/{0-CJnJjLuU.js.map → 0-DpTw60jY.js.map} +1 -1
- package/build/server/chunks/{1-CRuXk6Te.js → 1-BVtTx74E.js} +2 -2
- package/build/server/chunks/{1-CRuXk6Te.js.map → 1-BVtTx74E.js.map} +1 -1
- package/build/server/chunks/{2-S-DySAd8.js → 2-BticKSpj.js} +3 -3
- package/build/server/chunks/{2-S-DySAd8.js.map → 2-BticKSpj.js.map} +1 -1
- package/build/server/chunks/{3-B4MAWY85.js → 3-CJCLLqah.js} +3 -3
- package/build/server/chunks/{3-B4MAWY85.js.map → 3-CJCLLqah.js.map} +1 -1
- package/build/server/chunks/_page.svelte-CvpJooH0.js +251 -0
- package/build/server/chunks/_page.svelte-CvpJooH0.js.map +1 -0
- package/build/server/chunks/{_page.svelte-BWLtdblA.js → _page.svelte-DtNoAi5E.js} +3 -3
- package/build/server/chunks/_page.svelte-DtNoAi5E.js.map +1 -0
- package/build/server/chunks/{_server.ts-YwtnEMzH.js → _server.ts--eFftXL8.js} +2 -2
- package/build/server/chunks/{_server.ts-YwtnEMzH.js.map → _server.ts--eFftXL8.js.map} +1 -1
- package/build/server/chunks/{_server.ts-BxagrnO0.js → _server.ts-Ba06VInL.js} +2 -2
- package/build/server/chunks/{_server.ts-BxagrnO0.js.map → _server.ts-Ba06VInL.js.map} +1 -1
- package/build/server/chunks/{_server.ts-BCmGQeSo.js → _server.ts-BeGbYAxp.js} +2 -2
- package/build/server/chunks/{_server.ts-BCmGQeSo.js.map → _server.ts-BeGbYAxp.js.map} +1 -1
- package/build/server/chunks/{_server.ts-Bxa6aZc2.js → _server.ts-CItQm-c0.js} +2 -2
- package/build/server/chunks/{_server.ts-Bxa6aZc2.js.map → _server.ts-CItQm-c0.js.map} +1 -1
- package/build/server/chunks/{_server.ts-Bh90MAYF.js → _server.ts-D5QHZHdW.js} +2 -2
- package/build/server/chunks/{_server.ts-Bh90MAYF.js.map → _server.ts-D5QHZHdW.js.map} +1 -1
- package/build/server/chunks/{_server.ts-BcbZpFD0.js → _server.ts-DOubCuv_.js} +2 -2
- package/build/server/chunks/{_server.ts-BcbZpFD0.js.map → _server.ts-DOubCuv_.js.map} +1 -1
- package/build/server/chunks/{_server.ts-HlacJ7sM.js → _server.ts-DbFLHBXs.js} +2 -2
- package/build/server/chunks/{_server.ts-HlacJ7sM.js.map → _server.ts-DbFLHBXs.js.map} +1 -1
- package/build/server/chunks/{_server.ts-C-rL3Szt.js → _server.ts-Dm4tHhgU.js} +2 -2
- package/build/server/chunks/{_server.ts-C-rL3Szt.js.map → _server.ts-Dm4tHhgU.js.map} +1 -1
- package/build/server/chunks/_server.ts-DpPxqRIt.js +22 -0
- package/build/server/chunks/_server.ts-DpPxqRIt.js.map +1 -0
- package/build/server/chunks/{_server.ts-BzmUdix3.js → _server.ts-EZkpVixA.js} +2 -2
- package/build/server/chunks/{_server.ts-BzmUdix3.js.map → _server.ts-EZkpVixA.js.map} +1 -1
- package/build/server/chunks/{_server.ts-CY9T4t0H.js → _server.ts-Q6Irw5Rq.js} +2 -2
- package/build/server/chunks/{_server.ts-CY9T4t0H.js.map → _server.ts-Q6Irw5Rq.js.map} +1 -1
- package/build/server/chunks/{_server.ts-CmUCnNll.js → _server.ts-qvVoLJ7q.js} +2 -2
- package/build/server/chunks/{_server.ts-CmUCnNll.js.map → _server.ts-qvVoLJ7q.js.map} +1 -1
- package/build/server/chunks/{index2-DY0iJkqO.js → index2-DBHILTIZ.js} +197 -3
- package/build/server/chunks/index2-DBHILTIZ.js.map +1 -0
- package/build/server/index.js +1 -1
- package/build/server/index.js.map +1 -1
- package/build/server/manifest.js +17 -17
- package/build/server/manifest.js.map +1 -1
- package/package.json +2 -2
- package/build/client/_app/immutable/assets/0.Bn90K0hQ.css +0 -1
- package/build/client/_app/immutable/assets/0.Bn90K0hQ.css.br +0 -0
- package/build/client/_app/immutable/assets/0.Bn90K0hQ.css.gz +0 -0
- package/build/client/_app/immutable/chunks/BmgUV-OZ.js +0 -70
- package/build/client/_app/immutable/chunks/BmgUV-OZ.js.br +0 -0
- package/build/client/_app/immutable/chunks/BmgUV-OZ.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DIdnLQ2J.js +0 -1
- package/build/client/_app/immutable/chunks/DIdnLQ2J.js.br +0 -0
- package/build/client/_app/immutable/chunks/DIdnLQ2J.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DVqJsTXH.js.br +0 -0
- package/build/client/_app/immutable/chunks/DVqJsTXH.js.gz +0 -0
- package/build/client/_app/immutable/chunks/akEBbnuI.js.br +0 -0
- package/build/client/_app/immutable/chunks/akEBbnuI.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.BrFSuCuw.js.br +0 -0
- package/build/client/_app/immutable/entry/app.BrFSuCuw.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.CoWVGtze.js +0 -1
- package/build/client/_app/immutable/entry/start.CoWVGtze.js.br +0 -2
- package/build/client/_app/immutable/entry/start.CoWVGtze.js.gz +0 -0
- package/build/client/_app/immutable/nodes/0.CBmF4jwI.js +0 -1
- package/build/client/_app/immutable/nodes/0.CBmF4jwI.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.CBmF4jwI.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.Dy2lJ-WY.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.Dy2lJ-WY.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.B3l3mhPg.js +0 -5
- package/build/client/_app/immutable/nodes/2.B3l3mhPg.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.B3l3mhPg.js.gz +0 -0
- package/build/client/_app/immutable/nodes/3.BGtShXcH.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.BGtShXcH.js.gz +0 -0
- package/build/server/chunks/_page.svelte-BWLtdblA.js.map +0 -1
- package/build/server/chunks/_page.svelte-BlgbAbC7.js +0 -170
- package/build/server/chunks/_page.svelte-BlgbAbC7.js.map +0 -1
- package/build/server/chunks/_server.ts-DsueDvyv.js +0 -70
- package/build/server/chunks/_server.ts-DsueDvyv.js.map +0 -1
- package/build/server/chunks/index2-DY0iJkqO.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_server.ts-
|
|
1
|
+
{"version":3,"file":"_server.ts-CItQm-c0.js","sources":["../../../.svelte-kit/adapter-node/entries/endpoints/api/message/_server.ts.js"],"sourcesContent":["import { error, json } from \"@sveltejs/kit\";\nimport { Effect } from \"effect\";\nimport { g as getSessionsDir, d as deleteMessage } from \"../../../../chunks/index2.js\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\nconst updateCustomTitle = (projectName, sessionId, messageUuid, newTitle) => Effect.gen(function* () {\n const filePath = path.join(getSessionsDir(), projectName, `${sessionId}.jsonl`);\n const content = yield* Effect.tryPromise(() => fs.readFile(filePath, \"utf-8\"));\n const lines = content.trim().split(\"\\n\").filter(Boolean);\n const messages = lines.map((line) => JSON.parse(line));\n const targetIndex = messages.findIndex((m) => m.uuid === messageUuid);\n if (targetIndex === -1) {\n return { success: false, error: \"Message not found\" };\n }\n const msg = messages[targetIndex];\n if (msg.type !== \"custom-title\") {\n return { success: false, error: \"Message is not a custom-title type\" };\n }\n msg.customTitle = newTitle;\n const newContent = messages.map((m) => JSON.stringify(m)).join(\"\\n\") + \"\\n\";\n yield* Effect.tryPromise(() => fs.writeFile(filePath, newContent, \"utf-8\"));\n return { success: true };\n});\nconst DELETE = async ({ url }) => {\n const projectName = url.searchParams.get(\"project\");\n const sessionId = url.searchParams.get(\"session\");\n const messageUuid = url.searchParams.get(\"uuid\");\n if (!projectName || !sessionId || !messageUuid) {\n throw error(400, \"project, session, and uuid parameters required\");\n }\n const result = await Effect.runPromise(deleteMessage(projectName, sessionId, messageUuid));\n return json(result);\n};\nconst PATCH = async ({ url, request }) => {\n const projectName = url.searchParams.get(\"project\");\n const sessionId = url.searchParams.get(\"session\");\n const messageUuid = url.searchParams.get(\"uuid\");\n if (!projectName || !sessionId || !messageUuid) {\n throw error(400, \"project, session, and uuid parameters required\");\n }\n const body = await request.json();\n const { customTitle } = body;\n if (!customTitle) {\n throw error(400, \"customTitle is required\");\n }\n const result = await Effect.runPromise(\n updateCustomTitle(projectName, sessionId, messageUuid, customTitle)\n );\n return json(result);\n};\nexport {\n DELETE,\n PATCH\n};\n"],"names":[],"mappings":"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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as json } from './index-CoD1IJuy.js';
|
|
2
2
|
import { Effect } from 'effect';
|
|
3
|
-
import { m as moveSession } from './index2-
|
|
3
|
+
import { m as moveSession } from './index2-DBHILTIZ.js';
|
|
4
4
|
import 'fs';
|
|
5
5
|
import 'os';
|
|
6
6
|
import 'path';
|
|
@@ -24,4 +24,4 @@ const POST = async ({ request }) => {
|
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
export { POST };
|
|
27
|
-
//# sourceMappingURL=_server.ts-
|
|
27
|
+
//# sourceMappingURL=_server.ts-D5QHZHdW.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_server.ts-
|
|
1
|
+
{"version":3,"file":"_server.ts-D5QHZHdW.js","sources":["../../../.svelte-kit/adapter-node/entries/endpoints/api/session/move/_server.ts.js"],"sourcesContent":["import { json } from \"@sveltejs/kit\";\nimport { Effect } from \"effect\";\nimport { m as moveSession } from \"../../../../../chunks/index2.js\";\nconst POST = async ({ request }) => {\n const body = await request.json();\n if (!body.sourceProject || !body.sessionId || !body.targetProject) {\n return json({ success: false, error: \"Missing required parameters\" }, { status: 400 });\n }\n if (body.sourceProject === body.targetProject) {\n return json(\n { success: false, error: \"Source and target projects are the same\" },\n { status: 400 }\n );\n }\n const result = await Effect.runPromise(\n moveSession(body.sourceProject, body.sessionId, body.targetProject)\n );\n return json(result);\n};\nexport {\n POST\n};\n"],"names":[],"mappings":";;;;;;;;AAGK,MAAC,IAAI,GAAG,OAAO,EAAE,OAAO,EAAE,KAAK;AACpC,EAAE,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,IAAI,EAAE;AACnC,EAAE,IAAI,CAAC,IAAI,CAAC,aAAa,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE;AACrE,IAAI,OAAO,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,6BAA6B,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;AAC1F,EAAE;AACF,EAAE,IAAI,IAAI,CAAC,aAAa,KAAK,IAAI,CAAC,aAAa,EAAE;AACjD,IAAI,OAAO,IAAI;AACf,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,yCAAyC,EAAE;AAC1E,MAAM,EAAE,MAAM,EAAE,GAAG;AACnB,KAAK;AACL,EAAE;AACF,EAAE,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,UAAU;AACxC,IAAI,WAAW,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,aAAa;AACtE,GAAG;AACH,EAAE,OAAO,IAAI,CAAC,MAAM,CAAC;AACrB;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as json } from './index-CoD1IJuy.js';
|
|
2
2
|
import { Effect } from 'effect';
|
|
3
|
-
import { l as listProjects } from './index2-
|
|
3
|
+
import { l as listProjects } from './index2-DBHILTIZ.js';
|
|
4
4
|
import 'fs';
|
|
5
5
|
import 'os';
|
|
6
6
|
import 'path';
|
|
@@ -12,4 +12,4 @@ const GET = async () => {
|
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
export { GET };
|
|
15
|
-
//# sourceMappingURL=_server.ts-
|
|
15
|
+
//# sourceMappingURL=_server.ts-DOubCuv_.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_server.ts-
|
|
1
|
+
{"version":3,"file":"_server.ts-DOubCuv_.js","sources":["../../../.svelte-kit/adapter-node/entries/endpoints/api/projects/_server.ts.js"],"sourcesContent":["import { json } from \"@sveltejs/kit\";\nimport { Effect } from \"effect\";\nimport { l as listProjects } from \"../../../../chunks/index2.js\";\nconst GET = async () => {\n const projects = await Effect.runPromise(listProjects);\n return json(projects);\n};\nexport {\n GET\n};\n"],"names":[],"mappings":";;;;;;;;AAGK,MAAC,GAAG,GAAG,YAAY;AACxB,EAAE,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC;AACxD,EAAE,OAAO,IAAI,CAAC,QAAQ,CAAC;AACvB;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as json } from './index-CoD1IJuy.js';
|
|
2
2
|
import { Effect } from 'effect';
|
|
3
|
-
import { p as previewCleanup, c as clearSessions } from './index2-
|
|
3
|
+
import { p as previewCleanup, c as clearSessions } from './index2-DBHILTIZ.js';
|
|
4
4
|
import 'fs';
|
|
5
5
|
import 'os';
|
|
6
6
|
import 'path';
|
|
@@ -27,4 +27,4 @@ const POST = async ({ request }) => {
|
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
export { GET, POST };
|
|
30
|
-
//# sourceMappingURL=_server.ts-
|
|
30
|
+
//# sourceMappingURL=_server.ts-DbFLHBXs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_server.ts-
|
|
1
|
+
{"version":3,"file":"_server.ts-DbFLHBXs.js","sources":["../../../.svelte-kit/adapter-node/entries/endpoints/api/cleanup/_server.ts.js"],"sourcesContent":["import { json } from \"@sveltejs/kit\";\nimport { Effect } from \"effect\";\nimport { p as previewCleanup, c as clearSessions } from \"../../../../chunks/index2.js\";\nconst GET = async ({ url }) => {\n const projectName = url.searchParams.get(\"project\") ?? void 0;\n const result = await Effect.runPromise(previewCleanup(projectName));\n return json(result);\n};\nconst POST = async ({ request }) => {\n const body = await request.json();\n const result = await Effect.runPromise(\n clearSessions({\n projectName: body.project,\n clearEmpty: body.clearEmpty,\n clearInvalid: body.clearInvalid,\n skipWithTodos: body.skipWithTodos,\n clearOrphanAgents: body.clearOrphanAgents,\n clearOrphanTodos: body.clearOrphanTodos\n })\n );\n return json(result);\n};\nexport {\n GET,\n POST\n};\n"],"names":[],"mappings":";;;;;;;;AAGK,MAAC,GAAG,GAAG,OAAO,EAAE,GAAG,EAAE,KAAK;AAC/B,EAAE,MAAM,WAAW,GAAG,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,MAAM;AAC/D,EAAE,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;AACrE,EAAE,OAAO,IAAI,CAAC,MAAM,CAAC;AACrB;AACK,MAAC,IAAI,GAAG,OAAO,EAAE,OAAO,EAAE,KAAK;AACpC,EAAE,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,IAAI,EAAE;AACnC,EAAE,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,UAAU;AACxC,IAAI,aAAa,CAAC;AAClB,MAAM,WAAW,EAAE,IAAI,CAAC,OAAO;AAC/B,MAAM,UAAU,EAAE,IAAI,CAAC,UAAU;AACjC,MAAM,YAAY,EAAE,IAAI,CAAC,YAAY;AACrC,MAAM,aAAa,EAAE,IAAI,CAAC,aAAa;AACvC,MAAM,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;AAC/C,MAAM,gBAAgB,EAAE,IAAI,CAAC;AAC7B,KAAK;AACL,GAAG;AACH,EAAE,OAAO,IAAI,CAAC,MAAM,CAAC;AACrB;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { e as error, j as json } from './index-CoD1IJuy.js';
|
|
2
2
|
import { Effect } from 'effect';
|
|
3
|
-
import {
|
|
3
|
+
import { f as getSessionFiles } from './index2-DBHILTIZ.js';
|
|
4
4
|
import 'fs';
|
|
5
5
|
import 'os';
|
|
6
6
|
import 'path';
|
|
@@ -17,4 +17,4 @@ const GET = async ({ url }) => {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
export { GET };
|
|
20
|
-
//# sourceMappingURL=_server.ts-
|
|
20
|
+
//# sourceMappingURL=_server.ts-Dm4tHhgU.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_server.ts-
|
|
1
|
+
{"version":3,"file":"_server.ts-Dm4tHhgU.js","sources":["../../../.svelte-kit/adapter-node/entries/endpoints/api/session/files/_server.ts.js"],"sourcesContent":["import { error, json } from \"@sveltejs/kit\";\nimport { Effect } from \"effect\";\nimport { f as getSessionFiles } from \"../../../../../chunks/index2.js\";\nconst GET = async ({ url }) => {\n const projectName = url.searchParams.get(\"project\");\n const sessionId = url.searchParams.get(\"id\");\n if (!projectName || !sessionId) {\n throw error(400, \"project and id parameters required\");\n }\n const result = await Effect.runPromise(getSessionFiles(projectName, sessionId));\n return json(result);\n};\nexport {\n GET\n};\n"],"names":[],"mappings":";;;;;;;;AAGK,MAAC,GAAG,GAAG,OAAO,EAAE,GAAG,EAAE,KAAK;AAC/B,EAAE,MAAM,WAAW,GAAG,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC;AACrD,EAAE,MAAM,SAAS,GAAG,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC;AAC9C,EAAE,IAAI,CAAC,WAAW,IAAI,CAAC,SAAS,EAAE;AAClC,IAAI,MAAM,KAAK,CAAC,GAAG,EAAE,oCAAoC,CAAC;AAC1D,EAAE;AACF,EAAE,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,eAAe,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;AACjF,EAAE,OAAO,IAAI,CAAC,MAAM,CAAC;AACrB;;;;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { e as error, j as json } from './index-CoD1IJuy.js';
|
|
2
|
+
import { Effect } from 'effect';
|
|
3
|
+
import { a as loadProjectTreeData } from './index2-DBHILTIZ.js';
|
|
4
|
+
import 'fs';
|
|
5
|
+
import 'os';
|
|
6
|
+
import 'path';
|
|
7
|
+
import 'fs/promises';
|
|
8
|
+
|
|
9
|
+
const GET = async ({ url }) => {
|
|
10
|
+
const projectName = url.searchParams.get("project");
|
|
11
|
+
if (!projectName) {
|
|
12
|
+
throw error(400, "project parameter required");
|
|
13
|
+
}
|
|
14
|
+
const result = await Effect.runPromise(loadProjectTreeData(projectName));
|
|
15
|
+
if (!result) {
|
|
16
|
+
throw error(404, "Project not found");
|
|
17
|
+
}
|
|
18
|
+
return json(result.sessions);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export { GET };
|
|
22
|
+
//# sourceMappingURL=_server.ts-DpPxqRIt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_server.ts-DpPxqRIt.js","sources":["../../../.svelte-kit/adapter-node/entries/endpoints/api/project/expand/_server.ts.js"],"sourcesContent":["import { error, json } from \"@sveltejs/kit\";\nimport { Effect } from \"effect\";\nimport { a as loadProjectTreeData } from \"../../../../../chunks/index2.js\";\nconst GET = async ({ url }) => {\n const projectName = url.searchParams.get(\"project\");\n if (!projectName) {\n throw error(400, \"project parameter required\");\n }\n const result = await Effect.runPromise(loadProjectTreeData(projectName));\n if (!result) {\n throw error(404, \"Project not found\");\n }\n return json(result.sessions);\n};\nexport {\n GET\n};\n"],"names":[],"mappings":";;;;;;;;AAGK,MAAC,GAAG,GAAG,OAAO,EAAE,GAAG,EAAE,KAAK;AAC/B,EAAE,MAAM,WAAW,GAAG,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC;AACrD,EAAE,IAAI,CAAC,WAAW,EAAE;AACpB,IAAI,MAAM,KAAK,CAAC,GAAG,EAAE,4BAA4B,CAAC;AAClD,EAAE;AACF,EAAE,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC;AAC1E,EAAE,IAAI,CAAC,MAAM,EAAE;AACf,IAAI,MAAM,KAAK,CAAC,GAAG,EAAE,mBAAmB,CAAC;AACzC,EAAE;AACF,EAAE,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;AAC9B;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { e as error, j as json } from './index-CoD1IJuy.js';
|
|
2
2
|
import { Effect } from 'effect';
|
|
3
|
-
import { e as deleteSession, r as readSession } from './index2-
|
|
3
|
+
import { e as deleteSession, r as readSession } from './index2-DBHILTIZ.js';
|
|
4
4
|
import 'fs';
|
|
5
5
|
import 'os';
|
|
6
6
|
import 'path';
|
|
@@ -26,4 +26,4 @@ const DELETE = async ({ url }) => {
|
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
export { DELETE, GET };
|
|
29
|
-
//# sourceMappingURL=_server.ts-
|
|
29
|
+
//# sourceMappingURL=_server.ts-EZkpVixA.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_server.ts-
|
|
1
|
+
{"version":3,"file":"_server.ts-EZkpVixA.js","sources":["../../../.svelte-kit/adapter-node/entries/endpoints/api/session/_server.ts.js"],"sourcesContent":["import { error, json } from \"@sveltejs/kit\";\nimport { Effect } from \"effect\";\nimport { r as readSession, e as deleteSession } from \"../../../../chunks/index2.js\";\nconst GET = async ({ url }) => {\n const projectName = url.searchParams.get(\"project\");\n const sessionId = url.searchParams.get(\"id\");\n if (!projectName || !sessionId) {\n throw error(400, \"project and id parameters required\");\n }\n const messages = await Effect.runPromise(readSession(projectName, sessionId));\n return json(messages);\n};\nconst DELETE = async ({ url }) => {\n const projectName = url.searchParams.get(\"project\");\n const sessionId = url.searchParams.get(\"id\");\n if (!projectName || !sessionId) {\n throw error(400, \"project and id parameters required\");\n }\n const result = await Effect.runPromise(deleteSession(projectName, sessionId));\n return json(result);\n};\nexport {\n DELETE,\n GET\n};\n"],"names":[],"mappings":";;;;;;;;AAGK,MAAC,GAAG,GAAG,OAAO,EAAE,GAAG,EAAE,KAAK;AAC/B,EAAE,MAAM,WAAW,GAAG,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC;AACrD,EAAE,MAAM,SAAS,GAAG,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC;AAC9C,EAAE,IAAI,CAAC,WAAW,IAAI,CAAC,SAAS,EAAE;AAClC,IAAI,MAAM,KAAK,CAAC,GAAG,EAAE,oCAAoC,CAAC;AAC1D,EAAE;AACF,EAAE,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;AAC/E,EAAE,OAAO,IAAI,CAAC,QAAQ,CAAC;AACvB;AACK,MAAC,MAAM,GAAG,OAAO,EAAE,GAAG,EAAE,KAAK;AAClC,EAAE,MAAM,WAAW,GAAG,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC;AACrD,EAAE,MAAM,SAAS,GAAG,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC;AAC9C,EAAE,IAAI,CAAC,WAAW,IAAI,CAAC,SAAS,EAAE;AAClC,IAAI,MAAM,KAAK,CAAC,GAAG,EAAE,oCAAoC,CAAC;AAC1D,EAAE;AACF,EAAE,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,aAAa,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;AAC/E,EAAE,OAAO,IAAI,CAAC,MAAM,CAAC;AACrB;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { e as error, j as json } from './index-CoD1IJuy.js';
|
|
2
2
|
import { Effect } from 'effect';
|
|
3
|
-
import {
|
|
3
|
+
import { h as renameSession } from './index2-DBHILTIZ.js';
|
|
4
4
|
import 'fs';
|
|
5
5
|
import 'os';
|
|
6
6
|
import 'path';
|
|
@@ -18,4 +18,4 @@ const POST = async ({ request }) => {
|
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
export { POST };
|
|
21
|
-
//# sourceMappingURL=_server.ts-
|
|
21
|
+
//# sourceMappingURL=_server.ts-Q6Irw5Rq.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_server.ts-
|
|
1
|
+
{"version":3,"file":"_server.ts-Q6Irw5Rq.js","sources":["../../../.svelte-kit/adapter-node/entries/endpoints/api/session/rename/_server.ts.js"],"sourcesContent":["import { error, json } from \"@sveltejs/kit\";\nimport { Effect } from \"effect\";\nimport { h as renameSession } from \"../../../../../chunks/index2.js\";\nconst POST = async ({ request }) => {\n const body = await request.json();\n if (!body.project || !body.id || !body.title) {\n throw error(400, \"project, id, and title required\");\n }\n const result = await Effect.runPromise(\n renameSession(body.project, body.id, body.title, body.summary)\n );\n return json(result);\n};\nexport {\n POST\n};\n"],"names":[],"mappings":";;;;;;;;AAGK,MAAC,IAAI,GAAG,OAAO,EAAE,OAAO,EAAE,KAAK;AACpC,EAAE,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,IAAI,EAAE;AACnC,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;AAChD,IAAI,MAAM,KAAK,CAAC,GAAG,EAAE,iCAAiC,CAAC;AACvD,EAAE;AACF,EAAE,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,UAAU;AACxC,IAAI,aAAa,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO;AACjE,GAAG;AACH,EAAE,OAAO,IAAI,CAAC,MAAM,CAAC;AACrB;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { e as error, j as json } from './index-CoD1IJuy.js';
|
|
2
2
|
import { Effect } from 'effect';
|
|
3
|
-
import {
|
|
3
|
+
import { i as splitSession } from './index2-DBHILTIZ.js';
|
|
4
4
|
import 'fs';
|
|
5
5
|
import 'os';
|
|
6
6
|
import 'path';
|
|
@@ -17,4 +17,4 @@ const POST = async ({ request }) => {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
export { POST };
|
|
20
|
-
//# sourceMappingURL=_server.ts-
|
|
20
|
+
//# sourceMappingURL=_server.ts-qvVoLJ7q.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_server.ts-
|
|
1
|
+
{"version":3,"file":"_server.ts-qvVoLJ7q.js","sources":["../../../.svelte-kit/adapter-node/entries/endpoints/api/session/split/_server.ts.js"],"sourcesContent":["import { error, json } from \"@sveltejs/kit\";\nimport { Effect } from \"effect\";\nimport { i as splitSession } from \"../../../../../chunks/index2.js\";\nconst POST = async ({ request }) => {\n const body = await request.json();\n const { project, sessionId, messageUuid } = body;\n if (!project || !sessionId || !messageUuid) {\n throw error(400, \"project, sessionId, and messageUuid are required\");\n }\n const result = await Effect.runPromise(splitSession(project, sessionId, messageUuid));\n return json(result);\n};\nexport {\n POST\n};\n"],"names":[],"mappings":";;;;;;;;AAGK,MAAC,IAAI,GAAG,OAAO,EAAE,OAAO,EAAE,KAAK;AACpC,EAAE,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,IAAI,EAAE;AACnC,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,IAAI;AAClD,EAAE,IAAI,CAAC,OAAO,IAAI,CAAC,SAAS,IAAI,CAAC,WAAW,EAAE;AAC9C,IAAI,MAAM,KAAK,CAAC,GAAG,EAAE,kDAAkD,CAAC;AACxE,EAAE;AACF,EAAE,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC,OAAO,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;AACvF,EAAE,OAAO,IAAI,CAAC,MAAM,CAAC;AACrB;;;;"}
|
|
@@ -690,7 +690,8 @@ var splitSession = (projectName, sessionId, splitAtMessageUuid) => Effect.gen(fu
|
|
|
690
690
|
return { success: false, error: "Cannot split at first message" };
|
|
691
691
|
}
|
|
692
692
|
const newSessionId = crypto.randomUUID();
|
|
693
|
-
const
|
|
693
|
+
const summaryMessages = allMessages.filter((m) => m.type === "summary");
|
|
694
|
+
const summaryMessage = summaryMessages.length > 0 ? summaryMessages[summaryMessages.length - 1] : null;
|
|
694
695
|
const splitMessage = allMessages[splitIndex];
|
|
695
696
|
const shouldDuplicate = isContinuationSummary(splitMessage);
|
|
696
697
|
let remainingMessages;
|
|
@@ -979,6 +980,199 @@ var searchSessions = (query, options = {}) => Effect.gen(function* () {
|
|
|
979
980
|
return dateB - dateA;
|
|
980
981
|
});
|
|
981
982
|
});
|
|
983
|
+
var loadSessionTreeDataInternal = (projectName, sessionId, summariesByTargetSession) => Effect.gen(function* () {
|
|
984
|
+
const projectPath = path4.join(getSessionsDir(), projectName);
|
|
985
|
+
const filePath = path4.join(projectPath, `${sessionId}.jsonl`);
|
|
986
|
+
const content = yield* Effect.tryPromise(() => fs4.readFile(filePath, "utf-8"));
|
|
987
|
+
const lines = content.trim().split("\n").filter(Boolean);
|
|
988
|
+
const messages = lines.map((line) => JSON.parse(line));
|
|
989
|
+
let summaries;
|
|
990
|
+
if (summariesByTargetSession) {
|
|
991
|
+
summaries = [...summariesByTargetSession.get(sessionId) ?? []];
|
|
992
|
+
} else {
|
|
993
|
+
summaries = [];
|
|
994
|
+
const sessionUuids = /* @__PURE__ */ new Set();
|
|
995
|
+
for (const msg of messages) {
|
|
996
|
+
if (msg.uuid && typeof msg.uuid === "string") {
|
|
997
|
+
sessionUuids.add(msg.uuid);
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
const projectFiles = yield* Effect.tryPromise(() => fs4.readdir(projectPath));
|
|
1001
|
+
const allJsonlFiles = projectFiles.filter((f) => f.endsWith(".jsonl"));
|
|
1002
|
+
for (const file of allJsonlFiles) {
|
|
1003
|
+
try {
|
|
1004
|
+
const otherFilePath = path4.join(projectPath, file);
|
|
1005
|
+
const otherContent = yield* Effect.tryPromise(() => fs4.readFile(otherFilePath, "utf-8"));
|
|
1006
|
+
const otherLines = otherContent.trim().split("\n").filter(Boolean);
|
|
1007
|
+
for (const line of otherLines) {
|
|
1008
|
+
try {
|
|
1009
|
+
const msg = JSON.parse(line);
|
|
1010
|
+
if (msg.type === "summary" && typeof msg.summary === "string" && typeof msg.leafUuid === "string" && sessionUuids.has(msg.leafUuid)) {
|
|
1011
|
+
const targetMsg = messages.find((m) => m.uuid === msg.leafUuid);
|
|
1012
|
+
summaries.push({
|
|
1013
|
+
summary: msg.summary,
|
|
1014
|
+
leafUuid: msg.leafUuid,
|
|
1015
|
+
timestamp: targetMsg?.timestamp ?? msg.timestamp
|
|
1016
|
+
});
|
|
1017
|
+
}
|
|
1018
|
+
} catch {
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
} catch {
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
summaries.reverse();
|
|
1026
|
+
let lastCompactBoundaryUuid;
|
|
1027
|
+
for (let i = messages.length - 1; i >= 0; i--) {
|
|
1028
|
+
const msg = messages[i];
|
|
1029
|
+
if (msg.type === "system" && msg.subtype === "compact_boundary") {
|
|
1030
|
+
lastCompactBoundaryUuid = msg.uuid;
|
|
1031
|
+
break;
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
const customTitle = void 0;
|
|
1035
|
+
const firstUserMsgForTitle = messages.find((m) => m.type === "user");
|
|
1036
|
+
const title = firstUserMsgForTitle ? extractTitle(extractTextContent(firstUserMsgForTitle.message)) : summaries.length > 0 ? "[Summary Only]" : `Session ${sessionId.slice(0, 8)}`;
|
|
1037
|
+
const userAssistantMessages = messages.filter(
|
|
1038
|
+
(m) => m.type === "user" || m.type === "assistant"
|
|
1039
|
+
);
|
|
1040
|
+
const firstMessage = userAssistantMessages[0];
|
|
1041
|
+
const lastMessage = userAssistantMessages[userAssistantMessages.length - 1];
|
|
1042
|
+
const linkedAgentIds = yield* findLinkedAgents(projectName, sessionId);
|
|
1043
|
+
const agents = [];
|
|
1044
|
+
for (const agentId of linkedAgentIds) {
|
|
1045
|
+
const agentPath = path4.join(projectPath, `${agentId}.jsonl`);
|
|
1046
|
+
try {
|
|
1047
|
+
const agentContent = yield* Effect.tryPromise(() => fs4.readFile(agentPath, "utf-8"));
|
|
1048
|
+
const agentLines = agentContent.trim().split("\n").filter(Boolean);
|
|
1049
|
+
const agentMsgs = agentLines.map((l) => JSON.parse(l));
|
|
1050
|
+
const agentUserAssistant = agentMsgs.filter(
|
|
1051
|
+
(m) => m.type === "user" || m.type === "assistant"
|
|
1052
|
+
);
|
|
1053
|
+
let agentName;
|
|
1054
|
+
const firstAgentMsg = agentMsgs.find((m) => m.type === "user");
|
|
1055
|
+
if (firstAgentMsg) {
|
|
1056
|
+
const text = extractTextContent(firstAgentMsg.message);
|
|
1057
|
+
if (text) {
|
|
1058
|
+
agentName = extractTitle(text);
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
agents.push({
|
|
1062
|
+
id: agentId,
|
|
1063
|
+
name: agentName,
|
|
1064
|
+
messageCount: agentUserAssistant.length
|
|
1065
|
+
});
|
|
1066
|
+
} catch {
|
|
1067
|
+
agents.push({
|
|
1068
|
+
id: agentId,
|
|
1069
|
+
messageCount: 0
|
|
1070
|
+
});
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
const todos = yield* findLinkedTodos(sessionId, linkedAgentIds);
|
|
1074
|
+
return {
|
|
1075
|
+
id: sessionId,
|
|
1076
|
+
projectName,
|
|
1077
|
+
title,
|
|
1078
|
+
customTitle,
|
|
1079
|
+
lastSummary: summaries[0]?.summary,
|
|
1080
|
+
messageCount: userAssistantMessages.length > 0 ? userAssistantMessages.length : summaries.length > 0 ? 1 : 0,
|
|
1081
|
+
createdAt: firstMessage?.timestamp ?? void 0,
|
|
1082
|
+
updatedAt: lastMessage?.timestamp ?? void 0,
|
|
1083
|
+
summaries,
|
|
1084
|
+
agents,
|
|
1085
|
+
todos,
|
|
1086
|
+
lastCompactBoundaryUuid
|
|
1087
|
+
};
|
|
1088
|
+
});
|
|
1089
|
+
var loadProjectTreeData = (projectName) => Effect.gen(function* () {
|
|
1090
|
+
const project = (yield* listProjects).find((p) => p.name === projectName);
|
|
1091
|
+
if (!project) {
|
|
1092
|
+
return null;
|
|
1093
|
+
}
|
|
1094
|
+
const projectPath = path4.join(getSessionsDir(), projectName);
|
|
1095
|
+
const files = yield* Effect.tryPromise(() => fs4.readdir(projectPath));
|
|
1096
|
+
const sessionFiles = files.filter((f) => f.endsWith(".jsonl") && !f.startsWith("agent-"));
|
|
1097
|
+
const globalUuidMap = /* @__PURE__ */ new Map();
|
|
1098
|
+
const allSummaries = [];
|
|
1099
|
+
const allJsonlFiles = files.filter((f) => f.endsWith(".jsonl"));
|
|
1100
|
+
yield* Effect.all(
|
|
1101
|
+
allJsonlFiles.map(
|
|
1102
|
+
(file) => Effect.gen(function* () {
|
|
1103
|
+
const filePath = path4.join(projectPath, file);
|
|
1104
|
+
const fileSessionId = file.replace(".jsonl", "");
|
|
1105
|
+
try {
|
|
1106
|
+
const content = yield* Effect.tryPromise(() => fs4.readFile(filePath, "utf-8"));
|
|
1107
|
+
const lines = content.trim().split("\n").filter(Boolean);
|
|
1108
|
+
for (const line of lines) {
|
|
1109
|
+
try {
|
|
1110
|
+
const msg = JSON.parse(line);
|
|
1111
|
+
if (msg.uuid && typeof msg.uuid === "string") {
|
|
1112
|
+
globalUuidMap.set(msg.uuid, {
|
|
1113
|
+
sessionId: fileSessionId,
|
|
1114
|
+
timestamp: msg.timestamp
|
|
1115
|
+
});
|
|
1116
|
+
}
|
|
1117
|
+
if (msg.messageId && typeof msg.messageId === "string") {
|
|
1118
|
+
globalUuidMap.set(msg.messageId, {
|
|
1119
|
+
sessionId: fileSessionId,
|
|
1120
|
+
timestamp: msg.snapshot?.timestamp
|
|
1121
|
+
});
|
|
1122
|
+
}
|
|
1123
|
+
if (msg.type === "summary" && typeof msg.summary === "string") {
|
|
1124
|
+
allSummaries.push({
|
|
1125
|
+
summary: msg.summary,
|
|
1126
|
+
leafUuid: msg.leafUuid,
|
|
1127
|
+
timestamp: msg.timestamp
|
|
1128
|
+
});
|
|
1129
|
+
}
|
|
1130
|
+
} catch {
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
} catch {
|
|
1134
|
+
}
|
|
1135
|
+
})
|
|
1136
|
+
),
|
|
1137
|
+
{ concurrency: 20 }
|
|
1138
|
+
);
|
|
1139
|
+
const summariesByTargetSession = /* @__PURE__ */ new Map();
|
|
1140
|
+
for (const summaryData of allSummaries) {
|
|
1141
|
+
if (summaryData.leafUuid) {
|
|
1142
|
+
const targetInfo = globalUuidMap.get(summaryData.leafUuid);
|
|
1143
|
+
if (targetInfo) {
|
|
1144
|
+
const targetSessionId = targetInfo.sessionId;
|
|
1145
|
+
if (!summariesByTargetSession.has(targetSessionId)) {
|
|
1146
|
+
summariesByTargetSession.set(targetSessionId, []);
|
|
1147
|
+
}
|
|
1148
|
+
summariesByTargetSession.get(targetSessionId).push({
|
|
1149
|
+
summary: summaryData.summary,
|
|
1150
|
+
leafUuid: summaryData.leafUuid,
|
|
1151
|
+
timestamp: targetInfo.timestamp ?? summaryData.timestamp
|
|
1152
|
+
});
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
const sessions = yield* Effect.all(
|
|
1157
|
+
sessionFiles.map((file) => {
|
|
1158
|
+
const sessionId = file.replace(".jsonl", "");
|
|
1159
|
+
return loadSessionTreeDataInternal(projectName, sessionId, summariesByTargetSession);
|
|
1160
|
+
}),
|
|
1161
|
+
{ concurrency: 10 }
|
|
1162
|
+
);
|
|
1163
|
+
const sortedSessions = sessions.sort((a, b) => {
|
|
1164
|
+
const dateA = a.updatedAt ? new Date(a.updatedAt).getTime() : 0;
|
|
1165
|
+
const dateB = b.updatedAt ? new Date(b.updatedAt).getTime() : 0;
|
|
1166
|
+
return dateB - dateA;
|
|
1167
|
+
});
|
|
1168
|
+
return {
|
|
1169
|
+
name: project.name,
|
|
1170
|
+
displayName: project.displayName,
|
|
1171
|
+
path: project.path,
|
|
1172
|
+
sessionCount: sessions.length,
|
|
1173
|
+
sessions: sortedSessions
|
|
1174
|
+
};
|
|
1175
|
+
});
|
|
982
1176
|
|
|
983
|
-
export {
|
|
984
|
-
//# sourceMappingURL=index2-
|
|
1177
|
+
export { loadProjectTreeData as a, listSessions as b, clearSessions as c, deleteMessage as d, deleteSession as e, getSessionFiles as f, getSessionsDir as g, renameSession as h, splitSession as i, listProjects as l, moveSession as m, previewCleanup as p, readSession as r, searchSessions as s };
|
|
1178
|
+
//# sourceMappingURL=index2-DBHILTIZ.js.map
|