@kimuson/claude-code-viewer 0.5.5 → 0.5.7

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/dist/main.js CHANGED
@@ -7,7 +7,7 @@ import { Effect as Effect49 } from "effect";
7
7
  // package.json
8
8
  var package_default = {
9
9
  name: "@kimuson/claude-code-viewer",
10
- version: "0.5.5",
10
+ version: "0.5.7",
11
11
  description: "A full-featured web-based Claude Code client that provides complete interactive functionality for managing Claude Code projects.",
12
12
  type: "module",
13
13
  license: "MIT",
@@ -51,89 +51,89 @@ var package_default = {
51
51
  prepare: "lefthook install"
52
52
  },
53
53
  dependencies: {
54
- "@anthropic-ai/claude-agent-sdk": "0.2.2",
54
+ "@anthropic-ai/claude-agent-sdk": "0.2.19",
55
55
  "@anthropic-ai/claude-code": "2.0.24",
56
56
  "@anthropic-ai/sdk": "0.71.2",
57
- "@effect/cluster": "0.55.0",
58
- "@effect/experimental": "0.57.11",
59
- "@effect/platform": "0.93.6",
60
- "@effect/platform-node": "0.103.0",
61
- "@effect/rpc": "0.72.2",
62
- "@effect/sql": "0.48.6",
63
- "@effect/workflow": "0.15.1",
64
- "@hono/node-server": "1.19.5",
57
+ "@effect/cluster": "0.56.1",
58
+ "@effect/experimental": "0.58.0",
59
+ "@effect/platform": "0.94.2",
60
+ "@effect/platform-node": "0.104.1",
61
+ "@effect/rpc": "0.73.0",
62
+ "@effect/sql": "0.49.0",
63
+ "@effect/workflow": "0.16.0",
64
+ "@hono/node-server": "1.19.9",
65
65
  "@hono/zod-validator": "0.7.6",
66
- "@lingui/core": "5.5.1",
67
- "@lingui/react": "5.5.1",
68
- "@radix-ui/react-avatar": "1.1.10",
66
+ "@lingui/core": "5.9.0",
67
+ "@lingui/react": "5.9.0",
68
+ "@radix-ui/react-avatar": "1.1.11",
69
69
  "@radix-ui/react-checkbox": "1.3.3",
70
70
  "@radix-ui/react-collapsible": "1.1.12",
71
71
  "@radix-ui/react-dialog": "1.1.15",
72
72
  "@radix-ui/react-hover-card": "1.1.15",
73
73
  "@radix-ui/react-popover": "1.1.15",
74
74
  "@radix-ui/react-select": "2.2.6",
75
- "@radix-ui/react-slot": "1.2.3",
75
+ "@radix-ui/react-slot": "1.2.4",
76
76
  "@radix-ui/react-tabs": "1.1.13",
77
77
  "@radix-ui/react-tooltip": "1.2.8",
78
- "@tailwindcss/vite": "4.1.16",
79
- "@tanstack/react-devtools": "0.7.8",
80
- "@tanstack/react-query": "5.90.5",
81
- "@tanstack/react-router": "1.133.32",
82
- "@tanstack/react-router-devtools": "1.133.32",
78
+ "@tailwindcss/vite": "4.1.18",
79
+ "@tanstack/react-devtools": "0.9.2",
80
+ "@tanstack/react-query": "5.90.20",
81
+ "@tanstack/react-router": "1.156.0",
82
+ "@tanstack/react-router-devtools": "1.156.0",
83
83
  "class-variance-authority": "0.7.1",
84
84
  clsx: "2.1.1",
85
85
  commander: "^14.0.2",
86
86
  "date-fns": "4.1.0",
87
- effect: "3.19.9",
88
- "es-toolkit": "1.41.0",
89
- hono: "4.10.3",
90
- jotai: "2.15.0",
91
- "lucide-react": "0.548.0",
87
+ effect: "3.19.15",
88
+ "es-toolkit": "1.44.0",
89
+ hono: "4.11.5",
90
+ jotai: "2.16.2",
91
+ "lucide-react": "0.563.0",
92
92
  minisearch: "7.2.0",
93
93
  "parse-git-diff": "0.0.19",
94
94
  prexit: "2.3.0",
95
- react: "19.2.0",
96
- "react-dom": "19.2.0",
97
- "react-error-boundary": "6.0.0",
95
+ react: "19.2.3",
96
+ "react-dom": "19.2.3",
97
+ "react-error-boundary": "6.1.0",
98
98
  "react-markdown": "10.1.0",
99
- "react-syntax-highlighter": "15.6.6",
99
+ "react-syntax-highlighter": "16.1.0",
100
100
  "remark-gfm": "4.0.1",
101
101
  sonner: "2.0.7",
102
- "tailwind-merge": "3.3.1",
103
- ulid: "3.0.1",
104
- zod: "4.1.13"
102
+ "tailwind-merge": "3.4.0",
103
+ ulid: "3.0.2",
104
+ zod: "4.3.6"
105
105
  },
106
106
  devDependencies: {
107
- "@biomejs/biome": "2.3.1",
108
- "@effect/language-service": "0.60.0",
109
- "@lingui/cli": "5.5.1",
110
- "@lingui/conf": "5.5.1",
111
- "@lingui/format-json": "5.5.1",
112
- "@lingui/loader": "5.5.1",
113
- "@lingui/vite-plugin": "5.5.1",
114
- "@tailwindcss/postcss": "4.1.16",
115
- "@tanstack/router-plugin": "1.133.32",
116
- "@tsconfig/strictest": "2.0.6",
117
- "@types/node": "24.9.1",
118
- "@types/react": "19.2.2",
119
- "@types/react-dom": "19.2.2",
107
+ "@biomejs/biome": "2.3.12",
108
+ "@effect/language-service": "0.72.0",
109
+ "@lingui/cli": "5.9.0",
110
+ "@lingui/conf": "5.9.0",
111
+ "@lingui/format-json": "5.9.0",
112
+ "@lingui/loader": "5.9.0",
113
+ "@lingui/vite-plugin": "5.9.0",
114
+ "@tailwindcss/postcss": "4.1.18",
115
+ "@tanstack/router-plugin": "1.156.0",
116
+ "@tsconfig/strictest": "2.0.8",
117
+ "@types/node": "25.0.10",
118
+ "@types/react": "19.2.9",
119
+ "@types/react-dom": "19.2.3",
120
120
  "@types/react-syntax-highlighter": "15.5.13",
121
- "@vitejs/plugin-react-swc": "4.2.0",
121
+ "@vitejs/plugin-react-swc": "4.2.2",
122
122
  dotenv: "17.2.3",
123
- esbuild: "0.25.11",
124
- lefthook: "2.0.8",
123
+ esbuild: "0.27.2",
124
+ lefthook: "2.0.15",
125
125
  "npm-run-all2": "8.0.4",
126
- playwright: "1.56.1",
127
- "release-it": "19.0.5",
126
+ playwright: "1.58.0",
127
+ "release-it": "19.2.4",
128
128
  "release-it-pnpm": "4.6.6",
129
- tailwindcss: "4.1.16",
130
- tsx: "4.20.6",
129
+ tailwindcss: "4.1.18",
130
+ tsx: "4.21.0",
131
131
  "tw-animate-css": "1.4.0",
132
132
  typescript: "5.9.3",
133
- vite: "7.1.12",
134
- vitest: "4.0.3"
133
+ vite: "7.3.1",
134
+ vitest: "4.0.18"
135
135
  },
136
- packageManager: "pnpm@10.18.3+sha512.bbd16e6d7286fd7e01f6b3c0b3c932cda2965c06a908328f74663f10a9aea51f1129eea615134bf992831b009eabe167ecb7008b597f40ff9bc75946aadfb08d"
136
+ packageManager: "pnpm@10.28.1+sha512.7d7dbbca9e99447b7c3bf7a73286afaaf6be99251eb9498baefa7d406892f67b879adb3a1d7e687fc4ccc1a388c7175fbaae567a26ab44d1067b54fcb0d6a316"
137
137
  };
138
138
 
139
139
  // src/server/core/platform/services/DeprecatedEnvDetector.ts
@@ -229,7 +229,7 @@ import { FileSystem, Path } from "@effect/platform";
229
229
  import { Context, Effect as Effect2, Layer } from "effect";
230
230
 
231
231
  // src/lib/conversation-schema/index.ts
232
- import { z as z16 } from "zod";
232
+ import { z as z17 } from "zod";
233
233
 
234
234
  // src/lib/conversation-schema/entry/AssistantEntrySchema.ts
235
235
  import { z as z8 } from "zod";
@@ -336,7 +336,8 @@ var BaseEntrySchema = z7.object({
336
336
  toolUseResult: z7.unknown().optional(),
337
337
  // スキーマがツールごとに異なりすぎるし利用もしなそうなので unknown
338
338
  gitBranch: z7.string().optional(),
339
- isCompactSummary: z7.boolean().optional()
339
+ isCompactSummary: z7.boolean().optional(),
340
+ agentId: z7.string().optional()
340
341
  });
341
342
 
342
343
  // src/lib/conversation-schema/entry/AssistantEntrySchema.ts
@@ -365,156 +366,203 @@ var FileHistorySnapshotEntrySchema = z9.object({
365
366
  isSnapshotUpdate: z9.boolean()
366
367
  });
367
368
 
369
+ // src/lib/conversation-schema/entry/ProgressEntrySchema.ts
370
+ import { z as z10 } from "zod";
371
+ var ProgressEntrySchema = BaseEntrySchema.extend({
372
+ // discriminator
373
+ type: z10.literal("progress"),
374
+ // required
375
+ data: z10.record(z10.string(), z10.any()),
376
+ toolUseID: z10.string().optional(),
377
+ parentToolUseID: z10.string().optional()
378
+ });
379
+
368
380
  // src/lib/conversation-schema/entry/QueueOperationEntrySchema.ts
369
- import { z as z11 } from "zod";
381
+ import { z as z12 } from "zod";
370
382
 
371
383
  // src/lib/conversation-schema/content/DocumentContentSchema.ts
372
- import { z as z10 } from "zod";
373
- var DocumentContentSchema = z10.object({
374
- type: z10.literal("document"),
375
- source: z10.union([
376
- z10.object({
377
- media_type: z10.literal("text/plain"),
378
- type: z10.literal("text"),
379
- data: z10.string()
384
+ import { z as z11 } from "zod";
385
+ var DocumentContentSchema = z11.object({
386
+ type: z11.literal("document"),
387
+ source: z11.union([
388
+ z11.object({
389
+ media_type: z11.literal("text/plain"),
390
+ type: z11.literal("text"),
391
+ data: z11.string()
380
392
  }),
381
- z10.object({
382
- media_type: z10.enum(["application/pdf"]),
383
- type: z10.literal("base64"),
384
- data: z10.string()
393
+ z11.object({
394
+ media_type: z11.enum(["application/pdf"]),
395
+ type: z11.literal("base64"),
396
+ data: z11.string()
385
397
  })
386
398
  ])
387
399
  });
388
400
 
389
401
  // src/lib/conversation-schema/entry/QueueOperationEntrySchema.ts
390
- var QueueOperationContentSchema = z11.union([
391
- z11.string(),
402
+ var QueueOperationContentSchema = z12.union([
403
+ z12.string(),
392
404
  TextContentSchema,
393
405
  ToolResultContentSchema,
394
406
  ImageContentSchema,
395
407
  DocumentContentSchema
396
408
  ]);
397
- var QueueOperationEntrySchema = z11.union([
398
- z11.object({
399
- type: z11.literal("queue-operation"),
400
- operation: z11.literal("enqueue"),
401
- content: z11.union([
402
- z11.string(),
403
- z11.array(z11.union([z11.string(), QueueOperationContentSchema]))
409
+ var QueueOperationEntrySchema = z12.union([
410
+ z12.object({
411
+ type: z12.literal("queue-operation"),
412
+ operation: z12.literal("enqueue"),
413
+ content: z12.union([
414
+ z12.string(),
415
+ z12.array(z12.union([z12.string(), QueueOperationContentSchema]))
404
416
  ]),
405
- sessionId: z11.string(),
406
- timestamp: z11.iso.datetime()
417
+ sessionId: z12.string(),
418
+ timestamp: z12.iso.datetime()
407
419
  }),
408
- z11.object({
409
- type: z11.literal("queue-operation"),
410
- operation: z11.literal("dequeue"),
411
- sessionId: z11.string(),
412
- timestamp: z11.iso.datetime()
420
+ z12.object({
421
+ type: z12.literal("queue-operation"),
422
+ operation: z12.literal("dequeue"),
423
+ sessionId: z12.string(),
424
+ timestamp: z12.iso.datetime()
413
425
  }),
414
- z11.object({
415
- type: z11.literal("queue-operation"),
416
- operation: z11.literal("remove"),
417
- sessionId: z11.string(),
418
- timestamp: z11.iso.datetime()
426
+ z12.object({
427
+ type: z12.literal("queue-operation"),
428
+ operation: z12.literal("remove"),
429
+ sessionId: z12.string(),
430
+ timestamp: z12.iso.datetime()
419
431
  }),
420
- z11.object({
421
- type: z11.literal("queue-operation"),
422
- operation: z11.literal("popAll"),
423
- sessionId: z11.string(),
424
- timestamp: z11.iso.datetime(),
425
- content: z11.string().optional()
432
+ z12.object({
433
+ type: z12.literal("queue-operation"),
434
+ operation: z12.literal("popAll"),
435
+ sessionId: z12.string(),
436
+ timestamp: z12.iso.datetime(),
437
+ content: z12.string().optional()
426
438
  })
427
439
  ]);
428
440
 
429
441
  // src/lib/conversation-schema/entry/SummaryEntrySchema.ts
430
- import { z as z12 } from "zod";
431
- var SummaryEntrySchema = z12.object({
432
- type: z12.literal("summary"),
433
- summary: z12.string(),
434
- leafUuid: z12.string().uuid()
442
+ import { z as z13 } from "zod";
443
+ var SummaryEntrySchema = z13.object({
444
+ type: z13.literal("summary"),
445
+ summary: z13.string(),
446
+ leafUuid: z13.string().uuid()
435
447
  });
436
448
 
437
449
  // src/lib/conversation-schema/entry/SystemEntrySchema.ts
438
- import { z as z13 } from "zod";
439
- var HookInfoSchema = z13.object({
440
- command: z13.string()
450
+ import { z as z14 } from "zod";
451
+ var HookInfoSchema = z14.object({
452
+ command: z14.string()
441
453
  });
442
454
  var SystemEntryWithContentSchema = BaseEntrySchema.extend({
443
- type: z13.literal("system"),
444
- content: z13.string(),
445
- toolUseID: z13.string(),
446
- level: z13.enum(["info"]),
447
- subtype: z13.undefined().optional()
455
+ type: z14.literal("system"),
456
+ content: z14.string(),
457
+ toolUseID: z14.string(),
458
+ level: z14.enum(["info"]),
459
+ subtype: z14.undefined().optional()
448
460
  });
449
461
  var StopHookSummaryEntrySchema = BaseEntrySchema.extend({
450
- type: z13.literal("system"),
451
- subtype: z13.literal("stop_hook_summary"),
452
- toolUseID: z13.string(),
453
- level: z13.enum(["info", "suggestion"]),
454
- slug: z13.string().optional(),
455
- hookCount: z13.number(),
456
- hookInfos: z13.array(HookInfoSchema),
457
- hookErrors: z13.array(z13.unknown()),
458
- preventedContinuation: z13.boolean(),
459
- stopReason: z13.string(),
460
- hasOutput: z13.boolean()
462
+ type: z14.literal("system"),
463
+ subtype: z14.literal("stop_hook_summary"),
464
+ toolUseID: z14.string(),
465
+ level: z14.enum(["info", "suggestion"]),
466
+ slug: z14.string().optional(),
467
+ hookCount: z14.number(),
468
+ hookInfos: z14.array(HookInfoSchema),
469
+ hookErrors: z14.array(z14.unknown()),
470
+ preventedContinuation: z14.boolean(),
471
+ stopReason: z14.string(),
472
+ hasOutput: z14.boolean()
461
473
  });
462
474
  var LocalCommandEntrySchema = BaseEntrySchema.extend({
463
- type: z13.literal("system"),
464
- subtype: z13.literal("local_command"),
465
- content: z13.string(),
466
- level: z13.enum(["info"])
475
+ type: z14.literal("system"),
476
+ subtype: z14.literal("local_command"),
477
+ content: z14.string(),
478
+ level: z14.enum(["info"])
467
479
  });
468
480
  var TurnDurationEntrySchema = BaseEntrySchema.extend({
469
- type: z13.literal("system"),
470
- subtype: z13.literal("turn_duration"),
471
- durationMs: z13.number(),
472
- slug: z13.string().optional()
481
+ type: z14.literal("system"),
482
+ subtype: z14.literal("turn_duration"),
483
+ durationMs: z14.number(),
484
+ slug: z14.string().optional()
485
+ });
486
+ var CompactBoundaryEntrySchema = BaseEntrySchema.extend({
487
+ type: z14.literal("system"),
488
+ subtype: z14.literal("compact_boundary"),
489
+ content: z14.string(),
490
+ level: z14.enum(["info"]),
491
+ slug: z14.string().optional(),
492
+ logicalParentUuid: z14.string().optional(),
493
+ compactMetadata: z14.object({
494
+ trigger: z14.string(),
495
+ preTokens: z14.number()
496
+ }).optional()
473
497
  });
474
- var SystemEntrySchema = z13.union([
498
+ var ApiErrorEntrySchema = BaseEntrySchema.extend({
499
+ type: z14.literal("system"),
500
+ subtype: z14.literal("api_error"),
501
+ level: z14.enum(["error", "warning", "info"]),
502
+ error: z14.object({
503
+ status: z14.number().optional(),
504
+ headers: z14.record(z14.string(), z14.unknown()).optional(),
505
+ requestID: z14.string().nullable().optional(),
506
+ error: z14.object({
507
+ type: z14.string(),
508
+ error: z14.object({
509
+ type: z14.string(),
510
+ message: z14.string()
511
+ }).optional(),
512
+ message: z14.string().optional()
513
+ }).optional()
514
+ }),
515
+ retryInMs: z14.number().optional(),
516
+ retryAttempt: z14.number().optional(),
517
+ maxRetries: z14.number().optional()
518
+ });
519
+ var SystemEntrySchema = z14.union([
475
520
  StopHookSummaryEntrySchema,
476
521
  LocalCommandEntrySchema,
477
522
  TurnDurationEntrySchema,
523
+ CompactBoundaryEntrySchema,
524
+ ApiErrorEntrySchema,
478
525
  SystemEntryWithContentSchema
479
526
  // Must be last (catch-all for undefined subtype)
480
527
  ]);
481
528
 
482
529
  // src/lib/conversation-schema/entry/UserEntrySchema.ts
483
- import { z as z15 } from "zod";
530
+ import { z as z16 } from "zod";
484
531
 
485
532
  // src/lib/conversation-schema/message/UserMessageSchema.ts
486
- import { z as z14 } from "zod";
487
- var UserMessageContentSchema = z14.union([
488
- z14.string(),
533
+ import { z as z15 } from "zod";
534
+ var UserMessageContentSchema = z15.union([
535
+ z15.string(),
489
536
  TextContentSchema,
490
537
  ToolResultContentSchema,
491
538
  ImageContentSchema,
492
539
  DocumentContentSchema
493
540
  ]);
494
- var UserMessageSchema = z14.object({
495
- role: z14.literal("user"),
496
- content: z14.union([
497
- z14.string(),
498
- z14.array(z14.union([z14.string(), UserMessageContentSchema]))
541
+ var UserMessageSchema = z15.object({
542
+ role: z15.literal("user"),
543
+ content: z15.union([
544
+ z15.string(),
545
+ z15.array(z15.union([z15.string(), UserMessageContentSchema]))
499
546
  ])
500
547
  });
501
548
 
502
549
  // src/lib/conversation-schema/entry/UserEntrySchema.ts
503
550
  var UserEntrySchema = BaseEntrySchema.extend({
504
551
  // discriminator
505
- type: z15.literal("user"),
552
+ type: z16.literal("user"),
506
553
  // required
507
554
  message: UserMessageSchema
508
555
  });
509
556
 
510
557
  // src/lib/conversation-schema/index.ts
511
- var ConversationSchema = z16.union([
558
+ var ConversationSchema = z17.union([
512
559
  UserEntrySchema,
513
560
  AssistantEntrySchema,
514
561
  SummaryEntrySchema,
515
562
  SystemEntrySchema,
516
563
  FileHistorySnapshotEntrySchema,
517
- QueueOperationEntrySchema
564
+ QueueOperationEntrySchema,
565
+ ProgressEntrySchema
518
566
  ]);
519
567
 
520
568
  // src/server/core/claude-code/functions/parseJsonl.ts
@@ -550,8 +598,20 @@ var encodeProjectIdFromSessionFilePath = (sessionFilePath) => {
550
598
  var LayerImpl = Effect2.gen(function* () {
551
599
  const fs = yield* FileSystem.FileSystem;
552
600
  const path = yield* Path.Path;
553
- const getAgentSessionByAgentId = (projectId, agentId) => Effect2.gen(function* () {
601
+ const getAgentSessionByAgentId = (projectId, agentId, sessionId) => Effect2.gen(function* () {
554
602
  const projectPath = decodeProjectId(projectId);
603
+ if (sessionId) {
604
+ const newPath = path.resolve(
605
+ projectPath,
606
+ sessionId,
607
+ "subagents",
608
+ `agent-${agentId}.jsonl`
609
+ );
610
+ if (yield* fs.exists(newPath)) {
611
+ const content2 = yield* fs.readFileString(newPath);
612
+ return parseJsonl(content2);
613
+ }
614
+ }
555
615
  const agentFilePath = path.resolve(projectPath, `agent-${agentId}.jsonl`);
556
616
  const exists = yield* fs.exists(agentFilePath);
557
617
  if (!exists) {
@@ -578,10 +638,11 @@ import { Context as Context2, Effect as Effect3, Layer as Layer2 } from "effect"
578
638
  var LayerImpl2 = Effect3.gen(function* () {
579
639
  const repository = yield* AgentSessionRepository;
580
640
  const getAgentSession = (params) => Effect3.gen(function* () {
581
- const { projectId, agentId } = params;
641
+ const { projectId, agentId, sessionId } = params;
582
642
  const conversations = yield* repository.getAgentSessionByAgentId(
583
643
  projectId,
584
- agentId
644
+ agentId,
645
+ sessionId
585
646
  );
586
647
  if (conversations === null) {
587
648
  return {
@@ -707,7 +768,7 @@ import { Context as Context7, Effect as Effect9, Layer as Layer9, Option as Opti
707
768
  // src/server/core/project/services/ProjectMetaService.ts
708
769
  import { FileSystem as FileSystem3, Path as Path4 } from "@effect/platform";
709
770
  import { Context as Context6, Effect as Effect8, Layer as Layer8, Option, Ref as Ref3 } from "effect";
710
- import { z as z18 } from "zod";
771
+ import { z as z19 } from "zod";
711
772
 
712
773
  // src/server/lib/storage/FileCacheStorage/index.ts
713
774
  import { Context as Context5, Effect as Effect7, Layer as Layer7, Ref as Ref2, Runtime } from "effect";
@@ -715,7 +776,7 @@ import { Context as Context5, Effect as Effect7, Layer as Layer7, Ref as Ref2, R
715
776
  // src/server/lib/storage/FileCacheStorage/PersistentService.ts
716
777
  import { FileSystem as FileSystem2, Path as Path3 } from "@effect/platform";
717
778
  import { Context as Context4, Effect as Effect6, Layer as Layer6 } from "effect";
718
- import { z as z17 } from "zod";
779
+ import { z as z18 } from "zod";
719
780
 
720
781
  // src/server/lib/config/paths.ts
721
782
  import { homedir as homedir2 } from "node:os";
@@ -727,7 +788,7 @@ var claudeCodeViewerCacheDirPath = resolve(
727
788
  );
728
789
 
729
790
  // src/server/lib/storage/FileCacheStorage/PersistentService.ts
730
- var saveSchema = z17.array(z17.tuple([z17.string(), z17.unknown()]));
791
+ var saveSchema = z18.array(z18.tuple([z18.string(), z18.unknown()]));
731
792
  var LayerImpl5 = Effect6.gen(function* () {
732
793
  const path = yield* Path3.Path;
733
794
  const getCacheFilePath = (key) => path.resolve(claudeCodeViewerCacheDirPath, `${key}.json`);
@@ -840,7 +901,7 @@ var makeFileCacheStorageLayer = (storageKey, schema) => Layer7.effect(
840
901
  );
841
902
 
842
903
  // src/server/core/project/services/ProjectMetaService.ts
843
- var ProjectPathSchema = z18.string().nullable();
904
+ var ProjectPathSchema = z19.string().nullable();
844
905
  var LayerImpl6 = Effect8.gen(function* () {
845
906
  const fs = yield* FileSystem3.FileSystem;
846
907
  const path = yield* Path4.Path;
@@ -1102,12 +1163,12 @@ var scanSkillFilesRecursively = (dirPath) => Effect10.gen(function* () {
1102
1163
  });
1103
1164
 
1104
1165
  // src/server/core/claude-code/models/ClaudeCodeVersion.ts
1105
- import { z as z19 } from "zod";
1166
+ import { z as z20 } from "zod";
1106
1167
  var versionRegex = /^(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)/;
1107
- var versionSchema = z19.object({
1108
- major: z19.string().transform((value) => Number.parseInt(value, 10)),
1109
- minor: z19.string().transform((value) => Number.parseInt(value, 10)),
1110
- patch: z19.string().transform((value) => Number.parseInt(value, 10))
1168
+ var versionSchema = z20.object({
1169
+ major: z20.string().transform((value) => Number.parseInt(value, 10)),
1170
+ minor: z20.string().transform((value) => Number.parseInt(value, 10)),
1171
+ patch: z20.string().transform((value) => Number.parseInt(value, 10))
1111
1172
  }).refine(
1112
1173
  (data) => [data.major, data.minor, data.patch].every((value) => !Number.isNaN(value))
1113
1174
  );
@@ -1745,26 +1806,26 @@ import { FileSystem as FileSystem9, Path as Path11 } from "@effect/platform";
1745
1806
  import { Context as Context16, Effect as Effect21, Layer as Layer18, Option as Option3 } from "effect";
1746
1807
 
1747
1808
  // src/server/core/claude-code/functions/parseUserMessage.ts
1748
- import { z as z20 } from "zod";
1809
+ import { z as z21 } from "zod";
1749
1810
  var regExp = /<(?<tag>[^>]+)>(?<content>\s*[^<]*?\s*)<\/\k<tag>>/g;
1750
- var matchSchema = z20.object({
1751
- tag: z20.string(),
1752
- content: z20.string()
1811
+ var matchSchema = z21.object({
1812
+ tag: z21.string(),
1813
+ content: z21.string()
1753
1814
  });
1754
- var parsedUserMessageSchema = z20.union([
1755
- z20.object({
1756
- kind: z20.literal("command"),
1757
- commandName: z20.string(),
1758
- commandArgs: z20.string().optional(),
1759
- commandMessage: z20.string().optional()
1815
+ var parsedUserMessageSchema = z21.union([
1816
+ z21.object({
1817
+ kind: z21.literal("command"),
1818
+ commandName: z21.string(),
1819
+ commandArgs: z21.string().optional(),
1820
+ commandMessage: z21.string().optional()
1760
1821
  }),
1761
- z20.object({
1762
- kind: z20.literal("local-command"),
1763
- stdout: z20.string()
1822
+ z21.object({
1823
+ kind: z21.literal("local-command"),
1824
+ stdout: z21.string()
1764
1825
  }),
1765
- z20.object({
1766
- kind: z20.literal("text"),
1767
- content: z20.string()
1826
+ z21.object({
1827
+ kind: z21.literal("text"),
1828
+ content: z21.string()
1768
1829
  })
1769
1830
  ]);
1770
1831
  var parseUserMessage = (content) => {
@@ -2059,36 +2120,53 @@ import { Effect as Effect19 } from "effect";
2059
2120
  var getAgentSessionFilesForSession = (projectPath, sessionId) => Effect19.gen(function* () {
2060
2121
  const fs = yield* FileSystem7.FileSystem;
2061
2122
  const path = yield* Path9.Path;
2062
- const entries = yield* fs.readDirectory(projectPath);
2063
- const agentFiles = entries.filter(
2064
- (filename) => filename.startsWith("agent-") && filename.endsWith(".jsonl")
2065
- );
2066
- const matchingFilePaths = [];
2067
- for (const agentFile of agentFiles) {
2068
- const filePath = path.join(projectPath, agentFile);
2069
- const maybeMatches = yield* Effect19.gen(function* () {
2070
- const content = yield* fs.readFileString(filePath);
2071
- const firstLine = content.split("\n")[0];
2072
- if (!firstLine || firstLine.trim() === "") {
2123
+ const isValidAgentFile = (filePath, expectedSessionId) => Effect19.gen(function* () {
2124
+ const content = yield* fs.readFileString(filePath);
2125
+ const firstLine = content.split("\n")[0];
2126
+ if (!firstLine || firstLine.trim() === "") {
2127
+ return false;
2128
+ }
2129
+ try {
2130
+ const firstLineData = JSON.parse(firstLine);
2131
+ if (typeof firstLineData !== "object" || firstLineData === null) {
2073
2132
  return false;
2074
2133
  }
2075
- try {
2076
- const firstLineData = JSON.parse(firstLine);
2077
- if (typeof firstLineData === "object" && firstLineData !== null && "sessionId" in firstLineData && firstLineData.sessionId === sessionId) {
2078
- return true;
2079
- }
2080
- } catch {
2081
- return false;
2134
+ if (expectedSessionId !== void 0) {
2135
+ return "sessionId" in firstLineData && firstLineData.sessionId === expectedSessionId;
2082
2136
  }
2137
+ return "sessionId" in firstLineData;
2138
+ } catch {
2083
2139
  return false;
2084
- }).pipe(
2085
- Effect19.catchAll(() => Effect19.succeed(false))
2086
- // On any error, skip this file
2087
- );
2088
- if (maybeMatches) {
2140
+ }
2141
+ }).pipe(Effect19.catchAll(() => Effect19.succeed(false)));
2142
+ const matchingFilePaths = [];
2143
+ const rootEntries = yield* fs.readDirectory(projectPath);
2144
+ const rootAgentFiles = rootEntries.filter(
2145
+ (filename) => filename.startsWith("agent-") && filename.endsWith(".jsonl")
2146
+ );
2147
+ for (const agentFile of rootAgentFiles) {
2148
+ const filePath = path.join(projectPath, agentFile);
2149
+ if (yield* isValidAgentFile(filePath, sessionId)) {
2089
2150
  matchingFilePaths.push(filePath);
2090
2151
  }
2091
2152
  }
2153
+ const subagentsDir = path.join(projectPath, sessionId, "subagents");
2154
+ const subagentsDirExists = yield* fs.exists(subagentsDir);
2155
+ if (subagentsDirExists) {
2156
+ const subagentEntries = yield* fs.readDirectory(subagentsDir).pipe(
2157
+ Effect19.catchAll(() => Effect19.succeed([]))
2158
+ // Handle permission or other errors gracefully
2159
+ );
2160
+ const subagentFiles = subagentEntries.filter(
2161
+ (filename) => filename.startsWith("agent-") && filename.endsWith(".jsonl")
2162
+ );
2163
+ for (const agentFile of subagentFiles) {
2164
+ const filePath = path.join(subagentsDir, agentFile);
2165
+ if (yield* isValidAgentFile(filePath, void 0)) {
2166
+ matchingFilePaths.push(filePath);
2167
+ }
2168
+ }
2169
+ }
2092
2170
  return matchingFilePaths;
2093
2171
  });
2094
2172
 
@@ -2219,7 +2297,7 @@ var SessionMetaService = class extends Context15.Tag("SessionMetaService")() {
2219
2297
  }
2220
2298
  }
2221
2299
  const fileContents = [content, ...agentContents];
2222
- const { totalCost } = aggregateTokenUsageAndCost(fileContents);
2300
+ const { totalCost, modelName } = aggregateTokenUsageAndCost(fileContents);
2223
2301
  const sessionMeta = {
2224
2302
  messageCount: lines.length,
2225
2303
  firstUserMessage,
@@ -2227,7 +2305,8 @@ var SessionMetaService = class extends Context15.Tag("SessionMetaService")() {
2227
2305
  totalUsd: totalCost.totalUsd,
2228
2306
  breakdown: totalCost.breakdown,
2229
2307
  tokenUsage: totalCost.tokenUsage
2230
- }
2308
+ },
2309
+ modelName
2231
2310
  };
2232
2311
  yield* Ref7.update(sessionMetaCacheRef, (cache) => {
2233
2312
  cache.set(sessionId, sessionMeta);
@@ -2333,7 +2412,8 @@ var LayerImpl13 = Effect21.gen(function* () {
2333
2412
  cacheCreationTokens: 0,
2334
2413
  cacheReadTokens: 0
2335
2414
  }
2336
- }
2415
+ },
2416
+ modelName: null
2337
2417
  },
2338
2418
  conversations: virtualConversation.conversations,
2339
2419
  lastModifiedAt: lastConversation !== void 0 ? new Date(lastConversation.timestamp) : /* @__PURE__ */ new Date()
@@ -2449,7 +2529,8 @@ var LayerImpl13 = Effect21.gen(function* () {
2449
2529
  cacheCreationTokens: 0,
2450
2530
  cacheReadTokens: 0
2451
2531
  }
2452
- }
2532
+ },
2533
+ modelName: null
2453
2534
  }
2454
2535
  };
2455
2536
  }).sort((a, b) => {
@@ -2568,17 +2649,28 @@ var fallbackSdkMessage = (message) => {
2568
2649
  plugins: []
2569
2650
  };
2570
2651
  }
2652
+ if (message.subtype === "hook_response") {
2653
+ return {
2654
+ ...message
2655
+ };
2656
+ }
2571
2657
  return message;
2572
2658
  }
2573
2659
  if (message.type === "result") {
2574
2660
  if (message.subtype === "success") {
2575
2661
  return {
2576
- ...message
2662
+ ...message,
2663
+ modelUsage: {
2664
+ ...message.modelUsage
2665
+ }
2577
2666
  };
2578
2667
  }
2579
2668
  return {
2580
2669
  ...message,
2581
- errors: []
2670
+ errors: [],
2671
+ modelUsage: {
2672
+ ...message.modelUsage
2673
+ }
2582
2674
  };
2583
2675
  }
2584
2676
  return message;
@@ -3019,6 +3111,10 @@ var LayerImpl15 = Effect24.gen(function* () {
3019
3111
  baseSessionId,
3020
3112
  [virtualConversation]
3021
3113
  );
3114
+ yield* eventBusService.emit("virtualConversationUpdated", {
3115
+ projectId: sessionProcess.def.projectId,
3116
+ sessionId: baseSessionId
3117
+ });
3022
3118
  sessionProcess.def.setNextMessage(input);
3023
3119
  return {
3024
3120
  sessionProcess,
@@ -3072,7 +3168,7 @@ var LayerImpl15 = Effect24.gen(function* () {
3072
3168
  return "break";
3073
3169
  }
3074
3170
  if (processState.type === "paused") {
3075
- yield* Effect24.die(
3171
+ return yield* Effect24.die(
3076
3172
  new Error("Illegal state: paused is not expected")
3077
3173
  );
3078
3174
  }
@@ -3125,6 +3221,10 @@ var LayerImpl15 = Effect24.gen(function* () {
3125
3221
  sessionFileCreatedPromise.resolve({
3126
3222
  sessionId: message.session_id
3127
3223
  });
3224
+ yield* eventBusService.emit("virtualConversationUpdated", {
3225
+ projectId: processState.def.projectId,
3226
+ sessionId: message.session_id
3227
+ });
3128
3228
  yield* virtualConversationDatabase.deleteVirtualConversations(
3129
3229
  message.session_id
3130
3230
  );
@@ -3481,12 +3581,24 @@ var LayerImpl17 = Effect27.gen(function* () {
3481
3581
  })
3482
3582
  );
3483
3583
  };
3584
+ const onVirtualConversationUpdated = (event) => {
3585
+ Effect27.runFork(
3586
+ typeSafeSSE.writeSSE("virtualConversationUpdated", {
3587
+ projectId: event.projectId,
3588
+ sessionId: event.sessionId
3589
+ })
3590
+ );
3591
+ };
3484
3592
  yield* eventBus.on("sessionListChanged", onSessionListChanged);
3485
3593
  yield* eventBus.on("sessionChanged", onSessionChanged);
3486
3594
  yield* eventBus.on("agentSessionChanged", onAgentSessionChanged);
3487
3595
  yield* eventBus.on("sessionProcessChanged", onSessionProcessChanged);
3488
3596
  yield* eventBus.on("heartbeat", onHeartbeat);
3489
3597
  yield* eventBus.on("permissionRequested", onPermissionRequested);
3598
+ yield* eventBus.on(
3599
+ "virtualConversationUpdated",
3600
+ onVirtualConversationUpdated
3601
+ );
3490
3602
  const { connectionPromise } = adaptInternalEventToSSE(rawStream, {
3491
3603
  timeout: 5 * 60 * 1e3,
3492
3604
  cleanUp: async () => {
@@ -3501,6 +3613,10 @@ var LayerImpl17 = Effect27.gen(function* () {
3501
3613
  );
3502
3614
  yield* eventBus.off("heartbeat", onHeartbeat);
3503
3615
  yield* eventBus.off("permissionRequested", onPermissionRequested);
3616
+ yield* eventBus.off(
3617
+ "virtualConversationUpdated",
3618
+ onVirtualConversationUpdated
3619
+ );
3504
3620
  })
3505
3621
  );
3506
3622
  }
@@ -3523,16 +3639,16 @@ import { Path as Path12 } from "@effect/platform";
3523
3639
  import { Context as Context22, Effect as Effect28, Layer as Layer24, Ref as Ref9 } from "effect";
3524
3640
 
3525
3641
  // src/server/core/events/functions/parseSessionFilePath.ts
3526
- import z21 from "zod";
3642
+ import z22 from "zod";
3527
3643
  var sessionFileRegExp = /(?<projectId>.*?)\/(?<sessionId>.*?)\.jsonl$/;
3528
3644
  var agentFileRegExp = /(?<projectId>.*?)\/agent-(?<agentSessionId>.*?)\.jsonl$/;
3529
- var sessionFileGroupSchema = z21.object({
3530
- projectId: z21.string(),
3531
- sessionId: z21.string()
3645
+ var sessionFileGroupSchema = z22.object({
3646
+ projectId: z22.string(),
3647
+ sessionId: z22.string()
3532
3648
  });
3533
- var agentFileGroupSchema = z21.object({
3534
- projectId: z21.string(),
3535
- agentSessionId: z21.string()
3649
+ var agentFileGroupSchema = z22.object({
3650
+ projectId: z22.string(),
3651
+ agentSessionId: z22.string()
3536
3652
  });
3537
3653
  var parseSessionFilePath = (filePath) => {
3538
3654
  const agentMatch = filePath.match(agentFileRegExp);
@@ -3630,7 +3746,7 @@ var FileWatcherService = class extends Context22.Tag("FileWatcherService")() {
3630
3746
  yield* Ref9.set(debounceTimersRef, currentTimers);
3631
3747
  })
3632
3748
  );
3633
- }, 300);
3749
+ }, 100);
3634
3750
  timers.set(debounceKey, newTimer);
3635
3751
  yield* Ref9.set(debounceTimersRef, timers);
3636
3752
  })
@@ -4267,12 +4383,12 @@ import { Context as Context26, Data as Data4, Duration, Effect as Effect32, Eith
4267
4383
  import { Context as Context25, Effect as Effect31, Layer as Layer27, Ref as Ref10 } from "effect";
4268
4384
 
4269
4385
  // src/server/core/platform/schema.ts
4270
- import { z as z22 } from "zod";
4271
- var envSchema = z22.object({
4386
+ import { z as z23 } from "zod";
4387
+ var envSchema = z23.object({
4272
4388
  // Frameworks
4273
- NODE_ENV: z22.enum(["development", "production", "test"]).optional().default("development"),
4274
- NEXT_PHASE: z22.string().optional(),
4275
- PATH: z22.string().optional()
4389
+ NODE_ENV: z23.enum(["development", "production", "test"]).optional().default("development"),
4390
+ NEXT_PHASE: z23.string().optional(),
4391
+ PATH: z23.string().optional()
4276
4392
  });
4277
4393
 
4278
4394
  // src/server/core/platform/services/EnvService.ts
@@ -5144,39 +5260,39 @@ import { FileSystem as FileSystem12, Path as Path16 } from "@effect/platform";
5144
5260
  import { Context as Context29, Data as Data5, Effect as Effect36, Layer as Layer31 } from "effect";
5145
5261
 
5146
5262
  // src/server/core/scheduler/schema.ts
5147
- import { z as z23 } from "zod";
5148
- var concurrencyPolicySchema = z23.enum(["skip", "run"]);
5149
- var cronScheduleSchema = z23.object({
5150
- type: z23.literal("cron"),
5151
- expression: z23.string(),
5263
+ import { z as z24 } from "zod";
5264
+ var concurrencyPolicySchema = z24.enum(["skip", "run"]);
5265
+ var cronScheduleSchema = z24.object({
5266
+ type: z24.literal("cron"),
5267
+ expression: z24.string(),
5152
5268
  concurrencyPolicy: concurrencyPolicySchema
5153
5269
  });
5154
- var reservedScheduleSchema = z23.object({
5155
- type: z23.literal("reserved"),
5156
- reservedExecutionTime: z23.iso.datetime()
5270
+ var reservedScheduleSchema = z24.object({
5271
+ type: z24.literal("reserved"),
5272
+ reservedExecutionTime: z24.iso.datetime()
5157
5273
  });
5158
- var scheduleSchema = z23.discriminatedUnion("type", [
5274
+ var scheduleSchema = z24.discriminatedUnion("type", [
5159
5275
  cronScheduleSchema,
5160
5276
  reservedScheduleSchema
5161
5277
  ]);
5162
- var messageConfigSchema = z23.object({
5163
- content: z23.string(),
5164
- projectId: z23.string(),
5165
- baseSessionId: z23.string().nullable()
5278
+ var messageConfigSchema = z24.object({
5279
+ content: z24.string(),
5280
+ projectId: z24.string(),
5281
+ baseSessionId: z24.string().nullable()
5166
5282
  });
5167
- var jobStatusSchema = z23.enum(["success", "failed"]);
5168
- var schedulerJobSchema = z23.object({
5169
- id: z23.string(),
5170
- name: z23.string(),
5283
+ var jobStatusSchema = z24.enum(["success", "failed"]);
5284
+ var schedulerJobSchema = z24.object({
5285
+ id: z24.string(),
5286
+ name: z24.string(),
5171
5287
  schedule: scheduleSchema,
5172
5288
  message: messageConfigSchema,
5173
- enabled: z23.boolean(),
5174
- createdAt: z23.string().datetime(),
5175
- lastRunAt: z23.string().datetime().nullable(),
5289
+ enabled: z24.boolean(),
5290
+ createdAt: z24.string().datetime(),
5291
+ lastRunAt: z24.string().datetime().nullable(),
5176
5292
  lastRunStatus: jobStatusSchema.nullable()
5177
5293
  });
5178
- var schedulerConfigSchema = z23.object({
5179
- jobs: z23.array(schedulerJobSchema)
5294
+ var schedulerConfigSchema = z24.object({
5295
+ jobs: z24.array(schedulerJobSchema)
5180
5296
  });
5181
5297
  var newSchedulerJobSchema = schedulerJobSchema.omit({
5182
5298
  id: true,
@@ -5184,7 +5300,7 @@ var newSchedulerJobSchema = schedulerJobSchema.omit({
5184
5300
  lastRunAt: true,
5185
5301
  lastRunStatus: true
5186
5302
  }).extend({
5187
- enabled: z23.boolean().default(true)
5303
+ enabled: z24.boolean().default(true)
5188
5304
  });
5189
5305
  var updateSchedulerJobSchema = schedulerJobSchema.partial().pick({
5190
5306
  name: true,
@@ -5853,6 +5969,7 @@ var SearchController = class extends Context33.Tag("SearchController")() {
5853
5969
  };
5854
5970
 
5855
5971
  // src/server/core/session/presentation/SessionController.ts
5972
+ import { FileSystem as FileSystem14 } from "@effect/platform";
5856
5973
  import { Context as Context34, Effect as Effect43, Layer as Layer36 } from "effect";
5857
5974
 
5858
5975
  // src/server/core/session/services/ExportService.ts
@@ -6648,6 +6765,8 @@ var generateSessionHtml = (session, projectId) => Effect42.gen(function* () {
6648
6765
  // src/server/core/session/presentation/SessionController.ts
6649
6766
  var LayerImpl28 = Effect43.gen(function* () {
6650
6767
  const sessionRepository = yield* SessionRepository;
6768
+ const fs = yield* FileSystem14.FileSystem;
6769
+ const eventBus = yield* EventBus;
6651
6770
  const getSession = (options) => Effect43.gen(function* () {
6652
6771
  const { projectId, sessionId } = options;
6653
6772
  const { session } = yield* sessionRepository.getSession(
@@ -6677,9 +6796,41 @@ var LayerImpl28 = Effect43.gen(function* () {
6677
6796
  response: { html }
6678
6797
  };
6679
6798
  });
6799
+ const deleteSession = (options) => Effect43.gen(function* () {
6800
+ const { projectId, sessionId } = options;
6801
+ const sessionPath = decodeSessionId(projectId, sessionId);
6802
+ const exists = yield* fs.exists(sessionPath);
6803
+ if (!exists) {
6804
+ return {
6805
+ status: 404,
6806
+ response: { error: "Session not found" }
6807
+ };
6808
+ }
6809
+ const deleteResult = yield* fs.remove(sessionPath).pipe(
6810
+ Effect43.map(() => ({ success: true, error: null })),
6811
+ Effect43.catchAll(
6812
+ (error) => Effect43.succeed({
6813
+ success: false,
6814
+ error: `Failed to delete session: ${error.message}`
6815
+ })
6816
+ )
6817
+ );
6818
+ if (!deleteResult.success) {
6819
+ return {
6820
+ status: 500,
6821
+ response: { error: deleteResult.error }
6822
+ };
6823
+ }
6824
+ yield* eventBus.emit("sessionListChanged", { projectId });
6825
+ return {
6826
+ status: 200,
6827
+ response: { success: true }
6828
+ };
6829
+ });
6680
6830
  return {
6681
6831
  getSession,
6682
- exportSessionHtml
6832
+ exportSessionHtml,
6833
+ deleteSession
6683
6834
  };
6684
6835
  });
6685
6836
  var SessionController = class extends Context34.Tag("SessionController")() {
@@ -6847,65 +6998,65 @@ import { Effect as Effect47, Runtime as Runtime3 } from "effect";
6847
6998
  import { deleteCookie, getCookie as getCookie3, setCookie as setCookie2 } from "hono/cookie";
6848
6999
  import { streamSSE } from "hono/streaming";
6849
7000
  import prexit from "prexit";
6850
- import { z as z28 } from "zod";
7001
+ import { z as z29 } from "zod";
6851
7002
 
6852
7003
  // src/server/core/claude-code/schema.ts
6853
- import { z as z24 } from "zod";
6854
- var mediaTypeSchema = z24.enum([
7004
+ import { z as z25 } from "zod";
7005
+ var mediaTypeSchema = z25.enum([
6855
7006
  "image/png",
6856
7007
  "image/jpeg",
6857
7008
  "image/gif",
6858
7009
  "image/webp"
6859
7010
  ]);
6860
- var imageBlockSchema = z24.object({
6861
- type: z24.literal("image"),
6862
- source: z24.object({
6863
- type: z24.literal("base64"),
7011
+ var imageBlockSchema = z25.object({
7012
+ type: z25.literal("image"),
7013
+ source: z25.object({
7014
+ type: z25.literal("base64"),
6864
7015
  media_type: mediaTypeSchema,
6865
- data: z24.string()
7016
+ data: z25.string()
6866
7017
  })
6867
7018
  });
6868
- var documentBlockSchema = z24.object({
6869
- type: z24.literal("document"),
6870
- source: z24.union([
6871
- z24.object({
6872
- type: z24.literal("text"),
6873
- media_type: z24.enum(["text/plain"]),
6874
- data: z24.string()
7019
+ var documentBlockSchema = z25.object({
7020
+ type: z25.literal("document"),
7021
+ source: z25.union([
7022
+ z25.object({
7023
+ type: z25.literal("text"),
7024
+ media_type: z25.enum(["text/plain"]),
7025
+ data: z25.string()
6875
7026
  }),
6876
- z24.object({
6877
- type: z24.literal("base64"),
6878
- media_type: z24.enum(["application/pdf"]),
6879
- data: z24.string()
7027
+ z25.object({
7028
+ type: z25.literal("base64"),
7029
+ media_type: z25.enum(["application/pdf"]),
7030
+ data: z25.string()
6880
7031
  })
6881
7032
  ])
6882
7033
  });
6883
- var userMessageInputSchema = z24.object({
6884
- text: z24.string().min(1),
6885
- images: z24.array(imageBlockSchema).optional(),
6886
- documents: z24.array(documentBlockSchema).optional()
7034
+ var userMessageInputSchema = z25.object({
7035
+ text: z25.string().min(1),
7036
+ images: z25.array(imageBlockSchema).optional(),
7037
+ documents: z25.array(documentBlockSchema).optional()
6887
7038
  });
6888
7039
 
6889
7040
  // src/server/core/git/schema.ts
6890
- import { z as z25 } from "zod";
6891
- var CommitRequestSchema = z25.object({
6892
- projectId: z25.string().min(1),
6893
- files: z25.array(z25.string().min(1)).min(1),
6894
- message: z25.string().trim().min(1)
7041
+ import { z as z26 } from "zod";
7042
+ var CommitRequestSchema = z26.object({
7043
+ projectId: z26.string().min(1),
7044
+ files: z26.array(z26.string().min(1)).min(1),
7045
+ message: z26.string().trim().min(1)
6895
7046
  });
6896
- var PushRequestSchema = z25.object({
6897
- projectId: z25.string().min(1)
7047
+ var PushRequestSchema = z26.object({
7048
+ projectId: z26.string().min(1)
6898
7049
  });
6899
- var CommitResultSuccessSchema = z25.object({
6900
- success: z25.literal(true),
6901
- commitSha: z25.string().length(40),
6902
- filesCommitted: z25.number().int().positive(),
6903
- message: z25.string()
7050
+ var CommitResultSuccessSchema = z26.object({
7051
+ success: z26.literal(true),
7052
+ commitSha: z26.string().length(40),
7053
+ filesCommitted: z26.number().int().positive(),
7054
+ message: z26.string()
6904
7055
  });
6905
- var CommitResultErrorSchema = z25.object({
6906
- success: z25.literal(false),
6907
- error: z25.string(),
6908
- errorCode: z25.enum([
7056
+ var CommitResultErrorSchema = z26.object({
7057
+ success: z26.literal(false),
7058
+ error: z26.string(),
7059
+ errorCode: z26.enum([
6909
7060
  "EMPTY_MESSAGE",
6910
7061
  "NO_FILES",
6911
7062
  "PROJECT_NOT_FOUND",
@@ -6913,22 +7064,22 @@ var CommitResultErrorSchema = z25.object({
6913
7064
  "HOOK_FAILED",
6914
7065
  "GIT_COMMAND_ERROR"
6915
7066
  ]),
6916
- details: z25.string().optional()
7067
+ details: z26.string().optional()
6917
7068
  });
6918
- var CommitResultSchema = z25.discriminatedUnion("success", [
7069
+ var CommitResultSchema = z26.discriminatedUnion("success", [
6919
7070
  CommitResultSuccessSchema,
6920
7071
  CommitResultErrorSchema
6921
7072
  ]);
6922
- var PushResultSuccessSchema = z25.object({
6923
- success: z25.literal(true),
6924
- remote: z25.string(),
6925
- branch: z25.string(),
6926
- objectsPushed: z25.number().int().optional()
7073
+ var PushResultSuccessSchema = z26.object({
7074
+ success: z26.literal(true),
7075
+ remote: z26.string(),
7076
+ branch: z26.string(),
7077
+ objectsPushed: z26.number().int().optional()
6927
7078
  });
6928
- var PushResultErrorSchema = z25.object({
6929
- success: z25.literal(false),
6930
- error: z25.string(),
6931
- errorCode: z25.enum([
7079
+ var PushResultErrorSchema = z26.object({
7080
+ success: z26.literal(false),
7081
+ error: z26.string(),
7082
+ errorCode: z26.enum([
6932
7083
  "PROJECT_NOT_FOUND",
6933
7084
  "NOT_A_REPOSITORY",
6934
7085
  "NO_UPSTREAM",
@@ -6938,26 +7089,26 @@ var PushResultErrorSchema = z25.object({
6938
7089
  "TIMEOUT",
6939
7090
  "GIT_COMMAND_ERROR"
6940
7091
  ]),
6941
- details: z25.string().optional()
7092
+ details: z26.string().optional()
6942
7093
  });
6943
- var PushResultSchema = z25.discriminatedUnion("success", [
7094
+ var PushResultSchema = z26.discriminatedUnion("success", [
6944
7095
  PushResultSuccessSchema,
6945
7096
  PushResultErrorSchema
6946
7097
  ]);
6947
- var CommitAndPushResultSuccessSchema = z25.object({
6948
- success: z25.literal(true),
6949
- commitSha: z25.string().length(40),
6950
- filesCommitted: z25.number().int().positive(),
6951
- message: z25.string(),
6952
- remote: z25.string(),
6953
- branch: z25.string()
7098
+ var CommitAndPushResultSuccessSchema = z26.object({
7099
+ success: z26.literal(true),
7100
+ commitSha: z26.string().length(40),
7101
+ filesCommitted: z26.number().int().positive(),
7102
+ message: z26.string(),
7103
+ remote: z26.string(),
7104
+ branch: z26.string()
6954
7105
  });
6955
- var CommitAndPushResultErrorSchema = z25.object({
6956
- success: z25.literal(false),
6957
- commitSucceeded: z25.boolean(),
6958
- commitSha: z25.string().length(40).optional(),
6959
- error: z25.string(),
6960
- errorCode: z25.enum([
7106
+ var CommitAndPushResultErrorSchema = z26.object({
7107
+ success: z26.literal(false),
7108
+ commitSucceeded: z26.boolean(),
7109
+ commitSha: z26.string().length(40).optional(),
7110
+ error: z26.string(),
7111
+ errorCode: z26.enum([
6961
7112
  "EMPTY_MESSAGE",
6962
7113
  "NO_FILES",
6963
7114
  "PROJECT_NOT_FOUND",
@@ -6970,29 +7121,29 @@ var CommitAndPushResultErrorSchema = z25.object({
6970
7121
  "NETWORK_ERROR",
6971
7122
  "TIMEOUT"
6972
7123
  ]),
6973
- details: z25.string().optional()
7124
+ details: z26.string().optional()
6974
7125
  });
6975
- var CommitAndPushResultSchema = z25.discriminatedUnion("success", [
7126
+ var CommitAndPushResultSchema = z26.discriminatedUnion("success", [
6976
7127
  CommitAndPushResultSuccessSchema,
6977
7128
  CommitAndPushResultErrorSchema
6978
7129
  ]);
6979
7130
 
6980
7131
  // src/server/lib/config/config.ts
6981
- import z27 from "zod";
7132
+ import z28 from "zod";
6982
7133
 
6983
7134
  // src/lib/i18n/schema.ts
6984
- import z26 from "zod";
6985
- var localeSchema = z26.enum(["ja", "en", "zh_CN"]);
7135
+ import z27 from "zod";
7136
+ var localeSchema = z27.enum(["ja", "en", "zh_CN"]);
6986
7137
 
6987
7138
  // src/server/lib/config/config.ts
6988
- var userConfigSchema = z27.object({
6989
- hideNoUserMessageSession: z27.boolean().optional().default(true),
6990
- unifySameTitleSession: z27.boolean().optional().default(false),
6991
- enterKeyBehavior: z27.enum(["shift-enter-send", "enter-send", "command-enter-send"]).optional().default("shift-enter-send"),
6992
- permissionMode: z27.enum(["acceptEdits", "bypassPermissions", "default", "plan"]).optional().default("default"),
7139
+ var userConfigSchema = z28.object({
7140
+ hideNoUserMessageSession: z28.boolean().optional().default(true),
7141
+ unifySameTitleSession: z28.boolean().optional().default(false),
7142
+ enterKeyBehavior: z28.enum(["shift-enter-send", "enter-send", "command-enter-send"]).optional().default("shift-enter-send"),
7143
+ permissionMode: z28.enum(["acceptEdits", "bypassPermissions", "default", "plan"]).optional().default("default"),
6993
7144
  locale: localeSchema.optional().default("en"),
6994
- theme: z27.enum(["light", "dark", "system"]).optional().default("system"),
6995
- searchHotkey: z27.enum(["ctrl-k", "command-k"]).optional().default("command-k")
7145
+ theme: z28.enum(["light", "dark", "system"]).optional().default("system"),
7146
+ searchHotkey: z28.enum(["ctrl-k", "command-k"]).optional().default("command-k")
6996
7147
  });
6997
7148
  var defaultUserConfig = userConfigSchema.parse({});
6998
7149
 
@@ -7079,7 +7230,7 @@ var routes = (app, options) => Effect47.gen(function* () {
7079
7230
  await next();
7080
7231
  }).post(
7081
7232
  "/api/auth/login",
7082
- zValidator("json", z28.object({ password: z28.string() })),
7233
+ zValidator("json", z29.object({ password: z29.string() })),
7083
7234
  async (c) => {
7084
7235
  const { password } = c.req.valid("json");
7085
7236
  if (!authEnabled) {
@@ -7133,7 +7284,7 @@ var routes = (app, options) => Effect47.gen(function* () {
7133
7284
  return response;
7134
7285
  }).get(
7135
7286
  "/api/projects/:projectId",
7136
- zValidator("query", z28.object({ cursor: z28.string().optional() })),
7287
+ zValidator("query", z29.object({ cursor: z29.string().optional() })),
7137
7288
  async (c) => {
7138
7289
  const response = await effectToResponse(
7139
7290
  c,
@@ -7148,8 +7299,8 @@ var routes = (app, options) => Effect47.gen(function* () {
7148
7299
  "/api/projects",
7149
7300
  zValidator(
7150
7301
  "json",
7151
- z28.object({
7152
- projectPath: z28.string().min(1, "Project path is required")
7302
+ z29.object({
7303
+ projectPath: z29.string().min(1, "Project path is required")
7153
7304
  })
7154
7305
  ),
7155
7306
  async (c) => {
@@ -7184,17 +7335,29 @@ var routes = (app, options) => Effect47.gen(function* () {
7184
7335
  );
7185
7336
  return response;
7186
7337
  }
7187
- ).get("/api/projects/:projectId/agent-sessions/:agentId", async (c) => {
7188
- const { projectId, agentId } = c.req.param();
7338
+ ).delete("/api/projects/:projectId/sessions/:sessionId", async (c) => {
7189
7339
  const response = await effectToResponse(
7190
7340
  c,
7191
- agentSessionController.getAgentSession({
7192
- projectId,
7193
- agentId
7194
- }).pipe(Effect47.provide(runtime))
7341
+ sessionController.deleteSession({ ...c.req.param() }).pipe(Effect47.provide(runtime))
7195
7342
  );
7196
7343
  return response;
7197
- }).get("/api/projects/:projectId/git/current-revisions", async (c) => {
7344
+ }).get(
7345
+ "/api/projects/:projectId/agent-sessions/:agentId",
7346
+ zValidator("query", z29.object({ sessionId: z29.string().optional() })),
7347
+ async (c) => {
7348
+ const { projectId, agentId } = c.req.param();
7349
+ const { sessionId } = c.req.valid("query");
7350
+ const response = await effectToResponse(
7351
+ c,
7352
+ agentSessionController.getAgentSession({
7353
+ projectId,
7354
+ agentId,
7355
+ sessionId
7356
+ }).pipe(Effect47.provide(runtime))
7357
+ );
7358
+ return response;
7359
+ }
7360
+ ).get("/api/projects/:projectId/git/current-revisions", async (c) => {
7198
7361
  const response = await effectToResponse(
7199
7362
  c,
7200
7363
  gitController.getCurrentRevisions({
@@ -7206,9 +7369,9 @@ var routes = (app, options) => Effect47.gen(function* () {
7206
7369
  "/api/projects/:projectId/git/diff",
7207
7370
  zValidator(
7208
7371
  "json",
7209
- z28.object({
7210
- fromRef: z28.string().min(1, "fromRef is required"),
7211
- toRef: z28.string().min(1, "toRef is required")
7372
+ z29.object({
7373
+ fromRef: z29.string().min(1, "fromRef is required"),
7374
+ toRef: z29.string().min(1, "toRef is required")
7212
7375
  })
7213
7376
  ),
7214
7377
  async (c) => {
@@ -7298,10 +7461,10 @@ var routes = (app, options) => Effect47.gen(function* () {
7298
7461
  "/api/cc/session-processes",
7299
7462
  zValidator(
7300
7463
  "json",
7301
- z28.object({
7302
- projectId: z28.string(),
7464
+ z29.object({
7465
+ projectId: z29.string(),
7303
7466
  input: userMessageInputSchema,
7304
- baseSessionId: z28.string().optional()
7467
+ baseSessionId: z29.string().optional()
7305
7468
  })
7306
7469
  ),
7307
7470
  async (c) => {
@@ -7317,10 +7480,10 @@ var routes = (app, options) => Effect47.gen(function* () {
7317
7480
  "/api/cc/session-processes/:sessionProcessId/continue",
7318
7481
  zValidator(
7319
7482
  "json",
7320
- z28.object({
7321
- projectId: z28.string(),
7483
+ z29.object({
7484
+ projectId: z29.string(),
7322
7485
  input: userMessageInputSchema,
7323
- baseSessionId: z28.string()
7486
+ baseSessionId: z29.string()
7324
7487
  })
7325
7488
  ),
7326
7489
  async (c) => {
@@ -7335,7 +7498,7 @@ var routes = (app, options) => Effect47.gen(function* () {
7335
7498
  }
7336
7499
  ).post(
7337
7500
  "/api/cc/session-processes/:sessionProcessId/abort",
7338
- zValidator("json", z28.object({ projectId: z28.string() })),
7501
+ zValidator("json", z29.object({ projectId: z29.string() })),
7339
7502
  async (c) => {
7340
7503
  const { sessionProcessId } = c.req.param();
7341
7504
  void Effect47.runFork(
@@ -7347,9 +7510,9 @@ var routes = (app, options) => Effect47.gen(function* () {
7347
7510
  "/api/cc/permission-response",
7348
7511
  zValidator(
7349
7512
  "json",
7350
- z28.object({
7351
- permissionRequestId: z28.string(),
7352
- decision: z28.enum(["allow", "deny"])
7513
+ z29.object({
7514
+ permissionRequestId: z29.string(),
7515
+ decision: z29.enum(["allow", "deny"])
7353
7516
  })
7354
7517
  ),
7355
7518
  async (c) => {
@@ -7416,9 +7579,9 @@ var routes = (app, options) => Effect47.gen(function* () {
7416
7579
  "/api/fs/file-completion",
7417
7580
  zValidator(
7418
7581
  "query",
7419
- z28.object({
7420
- projectId: z28.string(),
7421
- basePath: z28.string().optional().default("/api/")
7582
+ z29.object({
7583
+ projectId: z29.string(),
7584
+ basePath: z29.string().optional().default("/api/")
7422
7585
  })
7423
7586
  ),
7424
7587
  async (c) => {
@@ -7434,9 +7597,9 @@ var routes = (app, options) => Effect47.gen(function* () {
7434
7597
  "/api/fs/directory-browser",
7435
7598
  zValidator(
7436
7599
  "query",
7437
- z28.object({
7438
- currentPath: z28.string().optional(),
7439
- showHidden: z28.string().optional().transform((val) => val === "true")
7600
+ z29.object({
7601
+ currentPath: z29.string().optional(),
7602
+ showHidden: z29.string().optional().transform((val) => val === "true")
7440
7603
  })
7441
7604
  ),
7442
7605
  async (c) => {
@@ -7452,10 +7615,10 @@ var routes = (app, options) => Effect47.gen(function* () {
7452
7615
  "/api/search",
7453
7616
  zValidator(
7454
7617
  "query",
7455
- z28.object({
7456
- q: z28.string().min(2),
7457
- limit: z28.string().optional().transform((val) => val ? parseInt(val, 10) : void 0),
7458
- projectId: z28.string().optional()
7618
+ z29.object({
7619
+ q: z29.string().min(2),
7620
+ limit: z29.string().optional().transform((val) => val ? parseInt(val, 10) : void 0),
7621
+ projectId: z29.string().optional()
7459
7622
  })
7460
7623
  ),
7461
7624
  async (c) => {