@kimuson/claude-code-viewer 0.7.2 → 0.7.4

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 (42) hide show
  1. package/dist/main.js +575 -505
  2. package/dist/main.js.map +4 -4
  3. package/dist/static/assets/{AuthProvider-Ds-c4CWc.js → AuthProvider-BuZnJ5E7.js} +2 -2
  4. package/dist/static/assets/NotFound-Dwvf0Bo3.js +1 -0
  5. package/dist/static/assets/ProtectedRoute-CTOJTf-s.js +1 -0
  6. package/dist/static/assets/card-5CIj0Vrs.js +1 -0
  7. package/dist/static/assets/createLucideIcon-CRmASjPp.js +1 -0
  8. package/dist/static/assets/{dist-CG2L4mx5.js → dist-B0PGU2Rq.js} +1 -1
  9. package/dist/static/assets/dist-DiNC9I1q.js +84 -0
  10. package/dist/static/assets/{eye-SsvAY8oF.js → eye-DomqS332.js} +1 -1
  11. package/dist/static/assets/{index-DNPVlDui.css → index-B5oyQ9A3.css} +1 -1
  12. package/dist/static/assets/index-PituKE8G.js +20 -0
  13. package/dist/static/assets/{input-B_6IT1CP.js → input-DxYncE22.js} +1 -1
  14. package/dist/static/assets/{label-Cw6sZ5kQ.js → label-BIlZTnVW.js} +1 -1
  15. package/dist/static/assets/{login-CKSjZM5v.js → login-BgVcUPOp.js} +1 -1
  16. package/dist/static/assets/markdown-parser-vendor-Dm3WZMeS.js +29 -0
  17. package/dist/static/assets/messages-CCdvpjPA.js +1 -0
  18. package/dist/static/assets/messages-CXMLmBXL.js +1 -0
  19. package/dist/static/assets/messages-D1gyj6vH.js +1 -0
  20. package/dist/static/assets/{projects-DH0K12HM.js → projects-BrdJ1LSG.js} +1 -1
  21. package/dist/static/assets/{refractor-vendor-B-OUwWR7.js → refractor-vendor-CoTYH44G.js} +1 -1
  22. package/dist/static/assets/{routes-CzLZwWu9.js → routes-BCc9450k.js} +1 -1
  23. package/dist/static/assets/session-BruJZygw.js +2 -0
  24. package/dist/static/assets/session-DXLe2gKP.js +13 -0
  25. package/dist/static/assets/session-DheVJS_-.js +1 -0
  26. package/dist/static/assets/{syntax-highlighter-vendor-CwGXx8v4.js → syntax-highlighter-vendor-E92u2I9N.js} +4 -4
  27. package/dist/static/assets/{xterm-vendor-DRG2K165.js → xterm-vendor-C7zPO6uk.js} +3 -3
  28. package/dist/static/index.html +11 -9
  29. package/dist/static/sw.js +1 -1
  30. package/package.json +11 -8
  31. package/dist/static/assets/ProtectedRoute-BTfjJdM-.js +0 -1
  32. package/dist/static/assets/card-DGrqtTaC.js +0 -1
  33. package/dist/static/assets/createLucideIcon-BL_meogc.js +0 -1
  34. package/dist/static/assets/dist-Cartj9I0.js +0 -84
  35. package/dist/static/assets/index-BD93fXJt.js +0 -20
  36. package/dist/static/assets/markdown-parser-vendor-D9j1a-bm.js +0 -29
  37. package/dist/static/assets/messages-BIF6nUZW.js +0 -1
  38. package/dist/static/assets/messages-BLphVEYK.js +0 -1
  39. package/dist/static/assets/messages-CuPsU53l.js +0 -1
  40. package/dist/static/assets/session-CvxVXyyO.js +0 -1
  41. package/dist/static/assets/session-TzwkQ1Zv.js +0 -12
  42. /package/dist/static/assets/{workbox-window.prod.es5-DaBTyiAs.js → workbox-window.prod.es5-DHdPsNjM.js} +0 -0
package/dist/main.js CHANGED
@@ -12,7 +12,7 @@ import { Effect as Effect73 } from "effect";
12
12
  // package.json
13
13
  var package_default = {
14
14
  name: "@kimuson/claude-code-viewer",
15
- version: "0.7.2",
15
+ version: "0.7.4",
16
16
  description: "A full-featured web-based Claude Code client that provides complete interactive functionality for managing Claude Code projects.",
17
17
  homepage: "https://github.com/d-kimuson/claude-code-viewer",
18
18
  license: "MIT",
@@ -49,6 +49,7 @@ var package_default = {
49
49
  "e2e:capture-snapshots": "./scripts/e2e/capture_snapshots.sh",
50
50
  "lingui:extract": "lingui extract --clean && node ./scripts/lingui-sort.js",
51
51
  "lingui:compile": "lingui compile --typescript",
52
+ release: "node scripts/release.ts",
52
53
  prepack: "pnpm build",
53
54
  prepare: "lefthook install"
54
55
  },
@@ -63,7 +64,7 @@ var package_default = {
63
64
  "@effect/rpc": "0.75.0",
64
65
  "@effect/sql": "0.51.0",
65
66
  "@effect/workflow": "0.18.0",
66
- "@hono/node-server": "1.19.12",
67
+ "@hono/node-server": "1.19.14",
67
68
  "@hono/zod-validator": "0.7.6",
68
69
  "@hookform/resolvers": "5.2.2",
69
70
  "@lingui/core": "5.9.4",
@@ -94,7 +95,7 @@ var package_default = {
94
95
  "drizzle-orm": "1.0.0-beta.20",
95
96
  effect: "3.21.0",
96
97
  "es-toolkit": "1.45.1",
97
- hono: "4.12.9",
98
+ hono: "4.12.12",
98
99
  jotai: "2.19.0",
99
100
  "lucide-react": "1.7.0",
100
101
  "parse-git-diff": "0.0.20",
@@ -126,6 +127,7 @@ var package_default = {
126
127
  "@tailwindcss/postcss": "4.2.2",
127
128
  "@tanstack/router-plugin": "1.167.12",
128
129
  "@tsconfig/strictest": "2.0.8",
130
+ "@types/inquirer": "9.0.9",
129
131
  "@types/node": "25.5.0",
130
132
  "@types/picomatch": "^4.0.3",
131
133
  "@types/react": "19.2.14",
@@ -135,10 +137,12 @@ var package_default = {
135
137
  "@types/ws": "8.18.1",
136
138
  "@typescript/native-preview": "7.0.0-dev.20260401.1",
137
139
  "@vitejs/plugin-react-swc": "4.3.0",
140
+ changelogithub: "14.0.0",
138
141
  dotenv: "17.4.0",
139
142
  "drizzle-kit": "1.0.0-beta.20",
140
143
  esbuild: "0.27.5",
141
144
  gatecheck: "0.0.1-beta.5",
145
+ inquirer: "13.3.0",
142
146
  jsdom: "^29.0.1",
143
147
  lefthook: "2.1.4",
144
148
  "npm-run-all2": "8.0.4",
@@ -146,13 +150,12 @@ var package_default = {
146
150
  oxlint: "^1.58.0",
147
151
  "oxlint-tsgolint": "^0.19.0",
148
152
  playwright: "1.59.1",
149
- "release-it": "19.2.4",
150
- "release-it-pnpm": "4.6.6",
151
153
  tailwindcss: "4.2.2",
152
154
  "tw-animate-css": "1.4.0",
153
- vite: "8.0.3",
155
+ vite: "8.0.8",
154
156
  "vite-plugin-pwa": "^1.2.0",
155
157
  vitest: "4.1.2",
158
+ webpack: "5.106.1",
156
159
  "workbox-build": "^7.4.0",
157
160
  "workbox-expiration": "^7.4.0",
158
161
  "workbox-precaching": "^7.4.0",
@@ -161,7 +164,7 @@ var package_default = {
161
164
  "workbox-window": "^7.4.0"
162
165
  },
163
166
  engines: {
164
- node: ">=22.13.0"
167
+ node: ">=24.0.0"
165
168
  },
166
169
  packageManager: "pnpm@10.28.1+sha512.7d7dbbca9e99447b7c3bf7a73286afaaf6be99251eb9498baefa7d406892f67b879adb3a1d7e687fc4ccc1a388c7175fbaae567a26ab44d1067b54fcb0d6a316",
167
170
  pnpm: {
@@ -250,6 +253,20 @@ var checkDeprecatedEnvs = Effect.gen(function* () {
250
253
  }
251
254
  });
252
255
 
256
+ // src/server/nodeVersionCheck.ts
257
+ var checkNodeVersion = () => {
258
+ const majorStr = process.version.slice(1).split(".")[0];
259
+ const major = Number(majorStr);
260
+ if (major < 24) {
261
+ process.stderr.write(
262
+ `Error: claude-code-viewer requires Node.js >=24.0.0, but you are running ${process.version}.
263
+ Please upgrade your Node.js version.
264
+ `
265
+ );
266
+ process.exit(1);
267
+ }
268
+ };
269
+
253
270
  // src/server/startServer.ts
254
271
  import { FileSystem as FileSystem24, Path as Path23 } from "@effect/platform";
255
272
  import { NodeContext as NodeContext2 } from "@effect/platform-node";
@@ -263,10 +280,10 @@ import { Layer as Layer6 } from "effect";
263
280
  // src/server/core/agent-session/infrastructure/AgentSessionRepository.ts
264
281
  import { FileSystem, Path as Path2 } from "@effect/platform";
265
282
  import { Context as Context3, Effect as Effect5, Layer as Layer4 } from "effect";
266
- import { z as z26 } from "zod";
283
+ import { z as z27 } from "zod";
267
284
 
268
285
  // src/lib/conversation-schema/index.ts
269
- import { z as z24 } from "zod";
286
+ import { z as z25 } from "zod";
270
287
 
271
288
  // src/lib/conversation-schema/entry/AgentNameEntrySchema.ts
272
289
  import { z } from "zod";
@@ -360,8 +377,8 @@ var AssistantMessageSchema = z9.object({
360
377
  role: z9.literal("assistant"),
361
378
  model: z9.string(),
362
379
  content: z9.array(AssistantMessageContentSchema),
363
- stop_reason: z9.string().nullable(),
364
- stop_sequence: z9.string().nullable(),
380
+ stop_reason: z9.string().nullable().optional(),
381
+ stop_sequence: z9.string().nullable().optional(),
365
382
  usage: z9.object({
366
383
  input_tokens: z9.number(),
367
384
  cache_creation_input_tokens: z9.number().optional(),
@@ -375,7 +392,7 @@ var AssistantMessageSchema = z9.object({
375
392
  server_tool_use: z9.object({
376
393
  web_search_requests: z9.number()
377
394
  }).optional()
378
- })
395
+ }).optional()
379
396
  });
380
397
 
381
398
  // src/lib/conversation-schema/entry/BaseEntrySchema.ts
@@ -408,207 +425,251 @@ var AssistantEntrySchema = BaseEntrySchema.extend({
408
425
  message: AssistantMessageSchema,
409
426
  // optional
410
427
  requestId: z11.string().optional(),
411
- isApiErrorMessage: z11.boolean().optional()
428
+ isApiErrorMessage: z11.boolean().optional(),
429
+ usage: z11.object({
430
+ input_tokens: z11.number(),
431
+ output_tokens: z11.number()
432
+ }).optional()
412
433
  });
413
434
 
414
- // src/lib/conversation-schema/entry/CustomTitleEntrySchema.ts
435
+ // src/lib/conversation-schema/entry/AttachmentEntrySchema.ts
415
436
  import { z as z12 } from "zod";
416
- var CustomTitleEntrySchema = z12.object({
417
- type: z12.literal("custom-title"),
418
- customTitle: z12.string(),
419
- sessionId: z12.string()
437
+ var AttachmentBaseEntrySchema = BaseEntrySchema.extend({
438
+ type: z12.literal("attachment"),
439
+ entrypoint: z12.string().optional(),
440
+ slug: z12.string().optional()
441
+ });
442
+ var DeferredToolsDeltaSchema = AttachmentBaseEntrySchema.extend({
443
+ attachment: z12.object({
444
+ type: z12.literal("deferred_tools_delta"),
445
+ addedNames: z12.array(z12.string()),
446
+ addedLines: z12.array(z12.string()),
447
+ removedNames: z12.array(z12.string())
448
+ })
449
+ });
450
+ var McpInstructionsDeltaSchema = AttachmentBaseEntrySchema.extend({
451
+ attachment: z12.object({
452
+ type: z12.literal("mcp_instructions_delta"),
453
+ addedNames: z12.array(z12.string()),
454
+ addedBlocks: z12.array(z12.string()),
455
+ removedNames: z12.array(z12.string())
456
+ })
457
+ });
458
+ var CompanionIntroSchema = AttachmentBaseEntrySchema.extend({
459
+ attachment: z12.object({
460
+ type: z12.literal("companion_intro"),
461
+ name: z12.string(),
462
+ species: z12.string()
463
+ })
464
+ });
465
+ var UnknownAttachmentSchema = AttachmentBaseEntrySchema.extend({
466
+ attachment: z12.object({ type: z12.string() }).loose()
420
467
  });
468
+ var AttachmentEntrySchema = z12.union([
469
+ DeferredToolsDeltaSchema,
470
+ McpInstructionsDeltaSchema,
471
+ CompanionIntroSchema,
472
+ UnknownAttachmentSchema
473
+ ]);
421
474
 
422
- // src/lib/conversation-schema/entry/FileHIstorySnapshotEntrySchema.ts
475
+ // src/lib/conversation-schema/entry/CustomTitleEntrySchema.ts
423
476
  import { z as z13 } from "zod";
424
- var FileHistorySnapshotEntrySchema = z13.object({
477
+ var CustomTitleEntrySchema = z13.object({
478
+ type: z13.literal("custom-title"),
479
+ customTitle: z13.string(),
480
+ sessionId: z13.string()
481
+ });
482
+
483
+ // src/lib/conversation-schema/entry/FileHIstorySnapshotEntrySchema.ts
484
+ import { z as z14 } from "zod";
485
+ var FileHistorySnapshotEntrySchema = z14.object({
425
486
  // discriminator
426
- type: z13.literal("file-history-snapshot"),
487
+ type: z14.literal("file-history-snapshot"),
427
488
  // required
428
- messageId: z13.string(),
429
- snapshot: z13.object({
430
- messageId: z13.string(),
431
- trackedFileBackups: z13.record(z13.string(), z13.unknown()),
432
- timestamp: z13.string()
489
+ messageId: z14.string(),
490
+ snapshot: z14.object({
491
+ messageId: z14.string(),
492
+ trackedFileBackups: z14.record(z14.string(), z14.unknown()),
493
+ timestamp: z14.string()
433
494
  }),
434
- isSnapshotUpdate: z13.boolean()
495
+ isSnapshotUpdate: z14.boolean()
435
496
  });
436
497
 
437
498
  // src/lib/conversation-schema/entry/LastPromptEntrySchema.ts
438
- import { z as z14 } from "zod";
439
- var LastPromptEntrySchema = z14.object({
440
- type: z14.literal("last-prompt"),
441
- lastPrompt: z14.string(),
442
- sessionId: z14.string()
499
+ import { z as z15 } from "zod";
500
+ var LastPromptEntrySchema = z15.object({
501
+ type: z15.literal("last-prompt"),
502
+ lastPrompt: z15.string(),
503
+ sessionId: z15.string()
443
504
  });
444
505
 
445
506
  // src/lib/conversation-schema/entry/PermissionModeEntrySchema.ts
446
- import { z as z15 } from "zod";
447
- var PermissionModeEntrySchema = z15.object({
448
- type: z15.literal("permission-mode"),
449
- permissionMode: z15.string(),
450
- sessionId: z15.string()
507
+ import { z as z16 } from "zod";
508
+ var PermissionModeEntrySchema = z16.object({
509
+ type: z16.literal("permission-mode"),
510
+ permissionMode: z16.string(),
511
+ sessionId: z16.string()
451
512
  });
452
513
 
453
514
  // src/lib/conversation-schema/entry/PrLinkEntrySchema.ts
454
- import { z as z16 } from "zod";
455
- var PrLinkEntrySchema = z16.object({
456
- type: z16.literal("pr-link"),
457
- sessionId: z16.string(),
458
- prNumber: z16.number(),
459
- prUrl: z16.string(),
460
- prRepository: z16.string(),
461
- timestamp: z16.iso.datetime()
515
+ import { z as z17 } from "zod";
516
+ var PrLinkEntrySchema = z17.object({
517
+ type: z17.literal("pr-link"),
518
+ sessionId: z17.string(),
519
+ prNumber: z17.number(),
520
+ prUrl: z17.string(),
521
+ prRepository: z17.string(),
522
+ timestamp: z17.iso.datetime()
462
523
  });
463
524
 
464
525
  // src/lib/conversation-schema/entry/ProgressEntrySchema.ts
465
- import { z as z17 } from "zod";
526
+ import { z as z18 } from "zod";
466
527
  var ProgressEntrySchema = BaseEntrySchema.extend({
467
528
  // discriminator
468
- type: z17.literal("progress"),
529
+ type: z18.literal("progress"),
469
530
  // required
470
- data: z17.record(z17.string(), z17.any()),
471
- toolUseID: z17.string().optional(),
472
- parentToolUseID: z17.string().optional()
531
+ data: z18.record(z18.string(), z18.any()),
532
+ toolUseID: z18.string().optional(),
533
+ parentToolUseID: z18.string().optional()
473
534
  });
474
535
 
475
536
  // src/lib/conversation-schema/entry/QueueOperationEntrySchema.ts
476
- import { z as z19 } from "zod";
537
+ import { z as z20 } from "zod";
477
538
 
478
539
  // src/lib/conversation-schema/content/DocumentContentSchema.ts
479
- import { z as z18 } from "zod";
480
- var DocumentContentSchema = z18.object({
481
- type: z18.literal("document"),
482
- source: z18.union([
483
- z18.object({
484
- media_type: z18.literal("text/plain"),
485
- type: z18.literal("text"),
486
- data: z18.string()
540
+ import { z as z19 } from "zod";
541
+ var DocumentContentSchema = z19.object({
542
+ type: z19.literal("document"),
543
+ source: z19.union([
544
+ z19.object({
545
+ media_type: z19.literal("text/plain"),
546
+ type: z19.literal("text"),
547
+ data: z19.string()
487
548
  }),
488
- z18.object({
489
- media_type: z18.enum(["application/pdf"]),
490
- type: z18.literal("base64"),
491
- data: z18.string()
549
+ z19.object({
550
+ media_type: z19.enum(["application/pdf"]),
551
+ type: z19.literal("base64"),
552
+ data: z19.string()
492
553
  })
493
554
  ])
494
555
  });
495
556
 
496
557
  // src/lib/conversation-schema/entry/QueueOperationEntrySchema.ts
497
- var QueueOperationContentSchema = z19.union([
498
- z19.string(),
558
+ var QueueOperationContentSchema = z20.union([
559
+ z20.string(),
499
560
  TextContentSchema,
500
561
  ToolResultContentSchema,
501
562
  ImageContentSchema,
502
563
  DocumentContentSchema
503
564
  ]);
504
- var QueueOperationEntrySchema = z19.union([
505
- z19.object({
506
- type: z19.literal("queue-operation"),
507
- operation: z19.literal("enqueue"),
508
- content: z19.union([z19.string(), z19.array(z19.union([z19.string(), QueueOperationContentSchema]))]).optional(),
509
- sessionId: z19.string(),
510
- timestamp: z19.iso.datetime()
565
+ var QueueOperationEntrySchema = z20.union([
566
+ z20.object({
567
+ type: z20.literal("queue-operation"),
568
+ operation: z20.literal("enqueue"),
569
+ content: z20.union([z20.string(), z20.array(z20.union([z20.string(), QueueOperationContentSchema]))]).optional(),
570
+ sessionId: z20.string(),
571
+ timestamp: z20.iso.datetime()
511
572
  }),
512
- z19.object({
513
- type: z19.literal("queue-operation"),
514
- operation: z19.literal("dequeue"),
515
- sessionId: z19.string(),
516
- timestamp: z19.iso.datetime()
573
+ z20.object({
574
+ type: z20.literal("queue-operation"),
575
+ operation: z20.literal("dequeue"),
576
+ sessionId: z20.string(),
577
+ timestamp: z20.iso.datetime()
517
578
  }),
518
- z19.object({
519
- type: z19.literal("queue-operation"),
520
- operation: z19.literal("remove"),
521
- sessionId: z19.string(),
522
- timestamp: z19.iso.datetime()
579
+ z20.object({
580
+ type: z20.literal("queue-operation"),
581
+ operation: z20.literal("remove"),
582
+ sessionId: z20.string(),
583
+ timestamp: z20.iso.datetime()
523
584
  }),
524
- z19.object({
525
- type: z19.literal("queue-operation"),
526
- operation: z19.literal("popAll"),
527
- sessionId: z19.string(),
528
- timestamp: z19.iso.datetime(),
529
- content: z19.string().optional()
585
+ z20.object({
586
+ type: z20.literal("queue-operation"),
587
+ operation: z20.literal("popAll"),
588
+ sessionId: z20.string(),
589
+ timestamp: z20.iso.datetime(),
590
+ content: z20.string().optional()
530
591
  })
531
592
  ]);
532
593
 
533
594
  // src/lib/conversation-schema/entry/SummaryEntrySchema.ts
534
- import { z as z20 } from "zod";
535
- var SummaryEntrySchema = z20.object({
536
- type: z20.literal("summary"),
537
- summary: z20.string(),
538
- leafUuid: z20.uuid()
595
+ import { z as z21 } from "zod";
596
+ var SummaryEntrySchema = z21.object({
597
+ type: z21.literal("summary"),
598
+ summary: z21.string(),
599
+ leafUuid: z21.uuid()
539
600
  });
540
601
 
541
602
  // src/lib/conversation-schema/entry/SystemEntrySchema.ts
542
- import { z as z21 } from "zod";
543
- var HookInfoSchema = z21.object({
544
- command: z21.string()
603
+ import { z as z22 } from "zod";
604
+ var HookInfoSchema = z22.object({
605
+ command: z22.string()
545
606
  });
546
607
  var SystemEntryWithContentSchema = BaseEntrySchema.extend({
547
- type: z21.literal("system"),
548
- content: z21.string(),
549
- toolUseID: z21.string(),
550
- level: z21.enum(["info"]),
551
- subtype: z21.undefined().optional()
608
+ type: z22.literal("system"),
609
+ content: z22.string(),
610
+ toolUseID: z22.string(),
611
+ level: z22.enum(["info"]),
612
+ subtype: z22.undefined().optional()
552
613
  });
553
614
  var StopHookSummaryEntrySchema = BaseEntrySchema.extend({
554
- type: z21.literal("system"),
555
- subtype: z21.literal("stop_hook_summary"),
556
- toolUseID: z21.string(),
557
- level: z21.enum(["info", "suggestion"]),
558
- slug: z21.string().optional(),
559
- hookCount: z21.number(),
560
- hookInfos: z21.array(HookInfoSchema),
561
- hookErrors: z21.array(z21.unknown()),
562
- preventedContinuation: z21.boolean(),
563
- stopReason: z21.string(),
564
- hasOutput: z21.boolean()
615
+ type: z22.literal("system"),
616
+ subtype: z22.literal("stop_hook_summary"),
617
+ toolUseID: z22.string(),
618
+ level: z22.enum(["info", "suggestion"]),
619
+ slug: z22.string().optional(),
620
+ hookCount: z22.number(),
621
+ hookInfos: z22.array(HookInfoSchema),
622
+ hookErrors: z22.array(z22.unknown()),
623
+ preventedContinuation: z22.boolean(),
624
+ stopReason: z22.string(),
625
+ hasOutput: z22.boolean()
565
626
  });
566
627
  var LocalCommandEntrySchema = BaseEntrySchema.extend({
567
- type: z21.literal("system"),
568
- subtype: z21.literal("local_command"),
569
- content: z21.string(),
570
- level: z21.enum(["info"])
628
+ type: z22.literal("system"),
629
+ subtype: z22.literal("local_command"),
630
+ content: z22.string(),
631
+ level: z22.enum(["info"])
571
632
  });
572
633
  var TurnDurationEntrySchema = BaseEntrySchema.extend({
573
- type: z21.literal("system"),
574
- subtype: z21.literal("turn_duration"),
575
- durationMs: z21.number(),
576
- slug: z21.string().optional()
634
+ type: z22.literal("system"),
635
+ subtype: z22.literal("turn_duration"),
636
+ durationMs: z22.number(),
637
+ slug: z22.string().optional()
577
638
  });
578
639
  var CompactBoundaryEntrySchema = BaseEntrySchema.extend({
579
- type: z21.literal("system"),
580
- subtype: z21.literal("compact_boundary"),
581
- content: z21.string(),
582
- level: z21.enum(["info"]),
583
- slug: z21.string().optional(),
584
- logicalParentUuid: z21.string().optional(),
585
- compactMetadata: z21.object({
586
- trigger: z21.string(),
587
- preTokens: z21.number()
640
+ type: z22.literal("system"),
641
+ subtype: z22.literal("compact_boundary"),
642
+ content: z22.string(),
643
+ level: z22.enum(["info"]),
644
+ slug: z22.string().optional(),
645
+ logicalParentUuid: z22.string().optional(),
646
+ compactMetadata: z22.object({
647
+ trigger: z22.string(),
648
+ preTokens: z22.number()
588
649
  }).optional()
589
650
  });
590
651
  var ApiErrorEntrySchema = BaseEntrySchema.extend({
591
- type: z21.literal("system"),
592
- subtype: z21.literal("api_error"),
593
- level: z21.enum(["error", "warning", "info"]),
594
- error: z21.object({
595
- status: z21.number().optional(),
596
- headers: z21.record(z21.string(), z21.unknown()).optional(),
597
- requestID: z21.string().nullable().optional(),
598
- error: z21.object({
599
- type: z21.string(),
600
- error: z21.object({
601
- type: z21.string(),
602
- message: z21.string()
652
+ type: z22.literal("system"),
653
+ subtype: z22.literal("api_error"),
654
+ level: z22.enum(["error", "warning", "info"]),
655
+ error: z22.object({
656
+ status: z22.number().optional(),
657
+ headers: z22.record(z22.string(), z22.unknown()).optional(),
658
+ requestID: z22.string().nullable().optional(),
659
+ error: z22.object({
660
+ type: z22.string(),
661
+ error: z22.object({
662
+ type: z22.string(),
663
+ message: z22.string()
603
664
  }).optional(),
604
- message: z21.string().optional()
665
+ message: z22.string().optional()
605
666
  }).optional()
606
667
  }),
607
- retryInMs: z21.number().optional(),
608
- retryAttempt: z21.number().optional(),
609
- maxRetries: z21.number().optional()
668
+ retryInMs: z22.number().optional(),
669
+ retryAttempt: z22.number().optional(),
670
+ maxRetries: z22.number().optional()
610
671
  });
611
- var SystemEntrySchema = z21.union([
672
+ var SystemEntrySchema = z22.union([
612
673
  StopHookSummaryEntrySchema,
613
674
  LocalCommandEntrySchema,
614
675
  TurnDurationEntrySchema,
@@ -619,32 +680,32 @@ var SystemEntrySchema = z21.union([
619
680
  ]);
620
681
 
621
682
  // src/lib/conversation-schema/entry/UserEntrySchema.ts
622
- import { z as z23 } from "zod";
683
+ import { z as z24 } from "zod";
623
684
 
624
685
  // src/lib/conversation-schema/message/UserMessageSchema.ts
625
- import { z as z22 } from "zod";
626
- var UserMessageContentSchema = z22.union([
627
- z22.string(),
686
+ import { z as z23 } from "zod";
687
+ var UserMessageContentSchema = z23.union([
688
+ z23.string(),
628
689
  TextContentSchema,
629
690
  ToolResultContentSchema,
630
691
  ImageContentSchema,
631
692
  DocumentContentSchema
632
693
  ]);
633
- var UserMessageSchema = z22.object({
634
- role: z22.literal("user"),
635
- content: z22.union([z22.string(), z22.array(z22.union([z22.string(), UserMessageContentSchema]))])
694
+ var UserMessageSchema = z23.object({
695
+ role: z23.literal("user"),
696
+ content: z23.union([z23.string(), z23.array(z23.union([z23.string(), UserMessageContentSchema]))])
636
697
  });
637
698
 
638
699
  // src/lib/conversation-schema/entry/UserEntrySchema.ts
639
700
  var UserEntrySchema = BaseEntrySchema.extend({
640
701
  // discriminator
641
- type: z23.literal("user"),
702
+ type: z24.literal("user"),
642
703
  // required
643
704
  message: UserMessageSchema
644
705
  });
645
706
 
646
707
  // src/lib/conversation-schema/index.ts
647
- var ConversationSchema = z24.union([
708
+ var ConversationSchema = z25.union([
648
709
  UserEntrySchema,
649
710
  AssistantEntrySchema,
650
711
  SummaryEntrySchema,
@@ -657,7 +718,8 @@ var ConversationSchema = z24.union([
657
718
  AgentSettingEntrySchema,
658
719
  PermissionModeEntrySchema,
659
720
  PrLinkEntrySchema,
660
- LastPromptEntrySchema
721
+ LastPromptEntrySchema,
722
+ AttachmentEntrySchema
661
723
  ]);
662
724
 
663
725
  // src/server/core/claude-code/functions/parseJsonl.ts
@@ -741,17 +803,17 @@ var CcvOptionsService = class extends Context.Tag("CcvOptionsService")() {
741
803
  import { Context as Context2, Effect as Effect3, Layer as Layer2, Ref as Ref2 } from "effect";
742
804
 
743
805
  // src/server/core/platform/schema.ts
744
- import { z as z25 } from "zod";
745
- var envSchema = z25.object({
806
+ import { z as z26 } from "zod";
807
+ var envSchema = z26.object({
746
808
  // Frameworks
747
- CCV_ENV: z25.enum(["development", "production", "test"]).optional().default("development"),
748
- NEXT_PHASE: z25.string().optional(),
749
- HOME: z25.string().optional(),
750
- PATH: z25.string().optional(),
751
- SHELL: z25.string().optional(),
752
- CCV_TERMINAL_SHELL: z25.string().optional(),
753
- CCV_TERMINAL_UNRESTRICTED: z25.string().optional(),
754
- CCV_TERMINAL_DISABLED: z25.string().optional()
809
+ CCV_ENV: z26.enum(["development", "production", "test"]).optional().default("development"),
810
+ NEXT_PHASE: z26.string().optional(),
811
+ HOME: z26.string().optional(),
812
+ PATH: z26.string().optional(),
813
+ SHELL: z26.string().optional(),
814
+ CCV_TERMINAL_SHELL: z26.string().optional(),
815
+ CCV_TERMINAL_UNRESTRICTED: z26.string().optional(),
816
+ CCV_TERMINAL_DISABLED: z26.string().optional()
755
817
  });
756
818
 
757
819
  // src/server/core/platform/services/EnvService.ts
@@ -969,7 +1031,7 @@ var LayerImpl4 = Effect5.gen(function* () {
969
1031
  if (firstLine === void 0 || firstLine.trim() === "") continue;
970
1032
  try {
971
1033
  const parsed = JSON.parse(firstLine);
972
- const sessionIdResult = z26.object({ sessionId: z26.string() }).safeParse(parsed);
1034
+ const sessionIdResult = z27.object({ sessionId: z27.string() }).safeParse(parsed);
973
1035
  if (sessionIdResult.success && sessionIdResult.data.sessionId === sessionId) {
974
1036
  yield* processFile(filePath, filename).pipe(Effect5.catchAll(() => Effect5.void));
975
1037
  }
@@ -1040,7 +1102,7 @@ var AgentSessionLayer = Layer6.mergeAll(AgentSessionRepository.Live);
1040
1102
  // src/server/core/claude-code/infrastructure/SessionAllowlistRepository.ts
1041
1103
  import { eq } from "drizzle-orm";
1042
1104
  import { Context as Context6, Effect as Effect8, Layer as Layer8 } from "effect";
1043
- import { z as z27 } from "zod";
1105
+ import { z as z28 } from "zod";
1044
1106
 
1045
1107
  // src/server/lib/db/DrizzleService.ts
1046
1108
  import { DatabaseSync } from "node:sqlite";
@@ -1153,7 +1215,7 @@ var DrizzleService = class extends Context5.Tag("DrizzleService")() {
1153
1215
  };
1154
1216
 
1155
1217
  // src/server/core/claude-code/infrastructure/SessionAllowlistRepository.ts
1156
- var allowlistSchema = z27.array(z27.string());
1218
+ var allowlistSchema = z28.array(z28.string());
1157
1219
  var LayerImpl6 = Effect8.gen(function* () {
1158
1220
  const { db } = yield* DrizzleService;
1159
1221
  const getAllowlist = (sessionId) => Effect8.sync(() => {
@@ -1195,7 +1257,7 @@ import {
1195
1257
  } from "@anthropic-ai/claude-agent-sdk";
1196
1258
  import { Context as Context8, Deferred, Effect as Effect10, Layer as Layer10, Ref as Ref3 } from "effect";
1197
1259
  import { ulid } from "ulid";
1198
- import { z as z28 } from "zod";
1260
+ import { z as z29 } from "zod";
1199
1261
 
1200
1262
  // src/server/core/events/services/EventBus.ts
1201
1263
  import { Context as Context7, Effect as Effect9, Layer as Layer9 } from "effect";
@@ -1303,18 +1365,18 @@ var LayerImpl7 = Effect10.gen(function* () {
1303
1365
  const createMcpServer = (options) => {
1304
1366
  const { turnId, projectId, sessionId } = options;
1305
1367
  const questionInputSchema = {
1306
- questions: z28.array(
1307
- z28.object({
1308
- question: z28.string().describe("The question to ask"),
1309
- header: z28.string().max(12).describe("Short label (max 12 chars)"),
1310
- options: z28.array(
1311
- z28.object({
1312
- label: z28.string().describe("Display text (1-5 words)"),
1313
- description: z28.string().describe("What this option means"),
1314
- preview: z28.string().optional().describe("Optional preview content")
1368
+ questions: z29.array(
1369
+ z29.object({
1370
+ question: z29.string().describe("The question to ask"),
1371
+ header: z29.string().max(12).describe("Short label (max 12 chars)"),
1372
+ options: z29.array(
1373
+ z29.object({
1374
+ label: z29.string().describe("Display text (1-5 words)"),
1375
+ description: z29.string().describe("What this option means"),
1376
+ preview: z29.string().optional().describe("Optional preview content")
1315
1377
  })
1316
1378
  ).min(2).max(4),
1317
- multiSelect: z28.boolean().default(false)
1379
+ multiSelect: z29.boolean().default(false)
1318
1380
  })
1319
1381
  ).min(1).max(4)
1320
1382
  };
@@ -1455,7 +1517,7 @@ import { Context as Context11, Effect as Effect14, Layer as Layer13 } from "effe
1455
1517
  import { FileSystem as FileSystem4, Path as Path5 } from "@effect/platform";
1456
1518
  import { count, eq as eq2 } from "drizzle-orm";
1457
1519
  import { Context as Context10, Effect as Effect13, Layer as Layer12, Option } from "effect";
1458
- import { z as z30 } from "zod";
1520
+ import { z as z31 } from "zod";
1459
1521
 
1460
1522
  // src/server/core/search/functions/extractSearchableText.ts
1461
1523
  var extractSearchableText = (conversation) => {
@@ -1616,21 +1678,26 @@ var aggregateTokenUsageAndCost = (fileContents) => {
1616
1678
  const conversations = parseJsonl(content);
1617
1679
  for (const conversation of conversations) {
1618
1680
  if (conversation.type === "assistant") {
1619
- const usage = conversation.message.usage;
1681
+ const messageUsage = conversation.message.usage;
1682
+ const entryUsage = conversation.usage;
1683
+ const inputTokens = messageUsage?.input_tokens ?? entryUsage?.input_tokens ?? 0;
1684
+ const outputTokens = messageUsage?.output_tokens ?? entryUsage?.output_tokens ?? 0;
1685
+ const cacheCreationInputTokens = messageUsage?.cache_creation_input_tokens ?? 0;
1686
+ const cacheReadInputTokens = messageUsage?.cache_read_input_tokens ?? 0;
1620
1687
  const modelName = conversation.message.model;
1621
1688
  const messageCost = calculateTokenCost(
1622
1689
  {
1623
- input_tokens: usage.input_tokens,
1624
- output_tokens: usage.output_tokens,
1625
- cache_creation_input_tokens: usage.cache_creation_input_tokens ?? 0,
1626
- cache_read_input_tokens: usage.cache_read_input_tokens ?? 0
1690
+ input_tokens: inputTokens,
1691
+ output_tokens: outputTokens,
1692
+ cache_creation_input_tokens: cacheCreationInputTokens,
1693
+ cache_read_input_tokens: cacheReadInputTokens
1627
1694
  },
1628
1695
  modelName
1629
1696
  );
1630
- totalInputTokens += usage.input_tokens;
1631
- totalOutputTokens += usage.output_tokens;
1632
- totalCacheCreationTokens += usage.cache_creation_input_tokens ?? 0;
1633
- totalCacheReadTokens += usage.cache_read_input_tokens ?? 0;
1697
+ totalInputTokens += inputTokens;
1698
+ totalOutputTokens += outputTokens;
1699
+ totalCacheCreationTokens += cacheCreationInputTokens;
1700
+ totalCacheReadTokens += cacheReadInputTokens;
1634
1701
  totalInputTokensUsd += messageCost.breakdown.inputTokensUsd;
1635
1702
  totalOutputTokensUsd += messageCost.breakdown.outputTokensUsd;
1636
1703
  totalCacheCreationUsd += messageCost.breakdown.cacheCreationUsd;
@@ -1762,26 +1829,26 @@ var decodeSessionId = (projectId, sessionId) => {
1762
1829
  var isRegularSessionFile = (filename) => filename.endsWith(".jsonl") && !filename.startsWith("agent-");
1763
1830
 
1764
1831
  // src/lib/claude-code/parseUserMessage.ts
1765
- import { z as z29 } from "zod";
1832
+ import { z as z30 } from "zod";
1766
1833
  var regExp = /<(?<tag>[^>]+)>(?<content>[\s\S]*?)<\/\k<tag>>/g;
1767
- var matchSchema = z29.object({
1768
- tag: z29.string(),
1769
- content: z29.string()
1770
- });
1771
- var parsedUserMessageSchema = z29.union([
1772
- z29.object({
1773
- kind: z29.literal("command"),
1774
- commandName: z29.string(),
1775
- commandArgs: z29.string().optional(),
1776
- commandMessage: z29.string().optional()
1834
+ var matchSchema = z30.object({
1835
+ tag: z30.string(),
1836
+ content: z30.string()
1837
+ });
1838
+ var parsedUserMessageSchema = z30.union([
1839
+ z30.object({
1840
+ kind: z30.literal("command"),
1841
+ commandName: z30.string(),
1842
+ commandArgs: z30.string().optional(),
1843
+ commandMessage: z30.string().optional()
1777
1844
  }),
1778
- z29.object({
1779
- kind: z29.literal("local-command"),
1780
- stdout: z29.string()
1845
+ z30.object({
1846
+ kind: z30.literal("local-command"),
1847
+ stdout: z30.string()
1781
1848
  }),
1782
- z29.object({
1783
- kind: z29.literal("text"),
1784
- content: z29.string()
1849
+ z30.object({
1850
+ kind: z30.literal("text"),
1851
+ content: z30.string()
1785
1852
  })
1786
1853
  ]);
1787
1854
  var parseUserMessage = (content) => {
@@ -1859,7 +1926,7 @@ var extractActualSessionId = (content) => {
1859
1926
  }
1860
1927
  try {
1861
1928
  const parsed = JSON.parse(firstLine);
1862
- const result = z30.object({ sessionId: z30.string() }).safeParse(parsed);
1929
+ const result = z31.object({ sessionId: z31.string() }).safeParse(parsed);
1863
1930
  if (result.success) {
1864
1931
  return result.data.sessionId;
1865
1932
  }
@@ -1890,8 +1957,8 @@ var LayerImpl9 = Effect13.gen(function* () {
1890
1957
  if (indexContent !== "") {
1891
1958
  try {
1892
1959
  const parsed = JSON.parse(indexContent);
1893
- const indexSchema = z30.object({
1894
- entries: z30.array(z30.looseObject({ projectPath: z30.string() }))
1960
+ const indexSchema = z31.object({
1961
+ entries: z31.array(z31.looseObject({ projectPath: z31.string() }))
1895
1962
  });
1896
1963
  const indexResult = indexSchema.safeParse(parsed);
1897
1964
  if (indexResult.success) {
@@ -2389,12 +2456,12 @@ var scanSkillFilesWithMetadata = (dirPath) => Effect16.gen(function* () {
2389
2456
  });
2390
2457
 
2391
2458
  // src/server/core/claude-code/models/ClaudeCodeVersion.ts
2392
- import { z as z31 } from "zod";
2459
+ import { z as z32 } from "zod";
2393
2460
  var versionRegex = /^(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)/;
2394
- var versionSchema = z31.object({
2395
- major: z31.string().transform((value) => Number.parseInt(value, 10)),
2396
- minor: z31.string().transform((value) => Number.parseInt(value, 10)),
2397
- patch: z31.string().transform((value) => Number.parseInt(value, 10))
2461
+ var versionSchema = z32.object({
2462
+ major: z32.string().transform((value) => Number.parseInt(value, 10)),
2463
+ minor: z32.string().transform((value) => Number.parseInt(value, 10)),
2464
+ patch: z32.string().transform((value) => Number.parseInt(value, 10))
2398
2465
  }).refine((data) => [data.major, data.minor, data.patch].every((value) => !Number.isNaN(value)));
2399
2466
  var fromCLIString = (versionOutput) => {
2400
2467
  const groups = versionOutput.trim().match(versionRegex)?.groups;
@@ -4134,16 +4201,16 @@ import { FileSystem as FileSystem9, Path as Path11 } from "@effect/platform";
4134
4201
  import { Context as Context23, Effect as Effect28, Fiber, Layer as Layer25, Ref as Ref6, Stream } from "effect";
4135
4202
 
4136
4203
  // src/server/core/events/functions/parseSessionFilePath.ts
4137
- import z32 from "zod";
4204
+ import z33 from "zod";
4138
4205
  var sessionFileRegExp = /(?<projectId>.*?)\/(?<sessionId>.*?)\.jsonl$/;
4139
4206
  var agentFileRegExp = /(?<projectId>.*?)\/agent-(?<agentSessionId>.*?)\.jsonl$/;
4140
- var sessionFileGroupSchema = z32.object({
4141
- projectId: z32.string(),
4142
- sessionId: z32.string()
4207
+ var sessionFileGroupSchema = z33.object({
4208
+ projectId: z33.string(),
4209
+ sessionId: z33.string()
4143
4210
  });
4144
- var agentFileGroupSchema = z32.object({
4145
- projectId: z32.string(),
4146
- agentSessionId: z32.string()
4211
+ var agentFileGroupSchema = z33.object({
4212
+ projectId: z33.string(),
4213
+ agentSessionId: z33.string()
4147
4214
  });
4148
4215
  var parseSessionFilePath = (filePath) => {
4149
4216
  const agentMatch = filePath.match(agentFileRegExp);
@@ -4792,7 +4859,10 @@ var LayerImpl22 = Effect33.gen(function* () {
4792
4859
  const getFileContentRoute = (options) => Effect33.gen(function* () {
4793
4860
  const { projectId, filePath } = options;
4794
4861
  const { project } = yield* projectRepository.getProject(projectId);
4795
- if (project.meta.projectPath === null) {
4862
+ const claudeProjectPath = project.claudeProjectPath;
4863
+ const sourceProjectPath = project.meta.projectPath;
4864
+ const projectRoot = filePath.startsWith(`${claudeProjectPath}/`) ? claudeProjectPath : sourceProjectPath;
4865
+ if (projectRoot === null) {
4796
4866
  return {
4797
4867
  response: {
4798
4868
  success: false,
@@ -4803,8 +4873,7 @@ var LayerImpl22 = Effect33.gen(function* () {
4803
4873
  status: 400
4804
4874
  };
4805
4875
  }
4806
- const projectPath = project.meta.projectPath;
4807
- const result = yield* getFileContentEffect(projectPath, filePath).pipe(
4876
+ const result = yield* getFileContentEffect(projectRoot, filePath).pipe(
4808
4877
  Effect33.provideService(Path15.Path, path),
4809
4878
  Effect33.provideService(FileSystem13.FileSystem, fs)
4810
4879
  );
@@ -5815,7 +5884,7 @@ import { FileSystem as FileSystem15 } from "@effect/platform";
5815
5884
  import { Context as Context28, Effect as Effect36, Layer as Layer30, Ref as Ref7 } from "effect";
5816
5885
  import { ulid as ulid5 } from "ulid";
5817
5886
  import webpush from "web-push";
5818
- import { z as z33 } from "zod";
5887
+ import { z as z34 } from "zod";
5819
5888
 
5820
5889
  // src/server/core/notification/services/pushError.ts
5821
5890
  var isRecord2 = (value) => typeof value === "object" && value !== null;
@@ -5856,9 +5925,9 @@ var formatPushError = (error) => {
5856
5925
  };
5857
5926
 
5858
5927
  // src/server/core/notification/services/NotificationService.ts
5859
- var vapidKeysSchema = z33.object({
5860
- publicKey: z33.string(),
5861
- privateKey: z33.string()
5928
+ var vapidKeysSchema = z34.object({
5929
+ publicKey: z34.string(),
5930
+ privateKey: z34.string()
5862
5931
  });
5863
5932
  var VAPID_KEYS_FILENAME = ".claude-code-viewer/vapid-keys.json";
5864
5933
  var DEFAULT_VAPID_SUBJECT = "mailto:noreply@example.com";
@@ -6178,25 +6247,25 @@ import { Context as Context32, Effect as Effect41, Layer as Layer34, Option as O
6178
6247
  // src/server/core/session/services/SessionMetaService.ts
6179
6248
  import { eq as eq6 } from "drizzle-orm";
6180
6249
  import { Context as Context31, Effect as Effect40, Layer as Layer33 } from "effect";
6181
- import { z as z34 } from "zod";
6250
+ import { z as z35 } from "zod";
6182
6251
  var parsedUserMessageOrNullSchema = parsedUserMessageSchema.nullable();
6183
- var costBreakdownSchema = z34.object({
6184
- inputTokensUsd: z34.number(),
6185
- outputTokensUsd: z34.number(),
6186
- cacheCreationUsd: z34.number(),
6187
- cacheReadUsd: z34.number()
6188
- });
6189
- var tokenUsageSchema = z34.object({
6190
- inputTokens: z34.number(),
6191
- outputTokens: z34.number(),
6192
- cacheCreationTokens: z34.number(),
6193
- cacheReadTokens: z34.number()
6194
- });
6195
- var prLinksSchema = z34.array(
6196
- z34.object({
6197
- prNumber: z34.number(),
6198
- prUrl: z34.string(),
6199
- prRepository: z34.string()
6252
+ var costBreakdownSchema = z35.object({
6253
+ inputTokensUsd: z35.number(),
6254
+ outputTokensUsd: z35.number(),
6255
+ cacheCreationUsd: z35.number(),
6256
+ cacheReadUsd: z35.number()
6257
+ });
6258
+ var tokenUsageSchema = z35.object({
6259
+ inputTokens: z35.number(),
6260
+ outputTokens: z35.number(),
6261
+ cacheCreationTokens: z35.number(),
6262
+ cacheReadTokens: z35.number()
6263
+ });
6264
+ var prLinksSchema = z35.array(
6265
+ z35.object({
6266
+ prNumber: z35.number(),
6267
+ prUrl: z35.string(),
6268
+ prRepository: z35.string()
6200
6269
  })
6201
6270
  );
6202
6271
  var defaultBreakdown = {
@@ -6466,40 +6535,40 @@ import { FileSystem as FileSystem18, Path as Path19 } from "@effect/platform";
6466
6535
  import { Context as Context34, Data as Data5, Effect as Effect43, Layer as Layer36 } from "effect";
6467
6536
 
6468
6537
  // src/server/core/scheduler/schema.ts
6469
- import { z as z35 } from "zod";
6470
- var concurrencyPolicySchema = z35.enum(["skip", "run"]);
6471
- var cronScheduleSchema = z35.object({
6472
- type: z35.literal("cron"),
6473
- expression: z35.string(),
6538
+ import { z as z36 } from "zod";
6539
+ var concurrencyPolicySchema = z36.enum(["skip", "run"]);
6540
+ var cronScheduleSchema = z36.object({
6541
+ type: z36.literal("cron"),
6542
+ expression: z36.string(),
6474
6543
  concurrencyPolicy: concurrencyPolicySchema
6475
6544
  });
6476
- var reservedScheduleSchema = z35.object({
6477
- type: z35.literal("reserved"),
6478
- reservedExecutionTime: z35.iso.datetime()
6545
+ var reservedScheduleSchema = z36.object({
6546
+ type: z36.literal("reserved"),
6547
+ reservedExecutionTime: z36.iso.datetime()
6479
6548
  });
6480
- var scheduleSchema = z35.discriminatedUnion("type", [
6549
+ var scheduleSchema = z36.discriminatedUnion("type", [
6481
6550
  cronScheduleSchema,
6482
6551
  reservedScheduleSchema
6483
6552
  ]);
6484
- var messageConfigSchema = z35.object({
6485
- content: z35.string(),
6486
- projectId: z35.string(),
6487
- sessionId: z35.uuid(),
6488
- resume: z35.boolean()
6489
- });
6490
- var jobStatusSchema = z35.enum(["success", "failed"]);
6491
- var schedulerJobSchema = z35.object({
6492
- id: z35.string(),
6493
- name: z35.string(),
6553
+ var messageConfigSchema = z36.object({
6554
+ content: z36.string(),
6555
+ projectId: z36.string(),
6556
+ sessionId: z36.uuid(),
6557
+ resume: z36.boolean()
6558
+ });
6559
+ var jobStatusSchema = z36.enum(["success", "failed"]);
6560
+ var schedulerJobSchema = z36.object({
6561
+ id: z36.string(),
6562
+ name: z36.string(),
6494
6563
  schedule: scheduleSchema,
6495
6564
  message: messageConfigSchema,
6496
- enabled: z35.boolean(),
6497
- createdAt: z35.iso.datetime(),
6498
- lastRunAt: z35.iso.datetime().nullable(),
6565
+ enabled: z36.boolean(),
6566
+ createdAt: z36.iso.datetime(),
6567
+ lastRunAt: z36.iso.datetime().nullable(),
6499
6568
  lastRunStatus: jobStatusSchema.nullable()
6500
6569
  });
6501
- var schedulerConfigSchema = z35.object({
6502
- jobs: z35.array(schedulerJobSchema)
6570
+ var schedulerConfigSchema = z36.object({
6571
+ jobs: z36.array(schedulerJobSchema)
6503
6572
  });
6504
6573
  var newSchedulerJobSchema = schedulerJobSchema.omit({
6505
6574
  id: true,
@@ -6507,7 +6576,7 @@ var newSchedulerJobSchema = schedulerJobSchema.omit({
6507
6576
  lastRunAt: true,
6508
6577
  lastRunStatus: true
6509
6578
  }).extend({
6510
- enabled: z35.boolean().default(true)
6579
+ enabled: z36.boolean().default(true)
6511
6580
  });
6512
6581
  var updateSchedulerJobSchema = schedulerJobSchema.partial().pick({
6513
6582
  name: true,
@@ -6871,17 +6940,17 @@ var SchedulerService = class extends Context35.Tag("SchedulerService")() {
6871
6940
  };
6872
6941
 
6873
6942
  // src/server/core/rate-limit/schema.ts
6874
- import { z as z36 } from "zod";
6875
- var RateLimitEntrySchema = z36.object({
6876
- type: z36.literal("assistant"),
6877
- error: z36.literal("rate_limit"),
6878
- isApiErrorMessage: z36.literal(true),
6879
- sessionId: z36.string(),
6880
- message: z36.object({
6881
- content: z36.array(
6882
- z36.object({
6883
- type: z36.literal("text"),
6884
- text: z36.string()
6943
+ import { z as z37 } from "zod";
6944
+ var RateLimitEntrySchema = z37.object({
6945
+ type: z37.literal("assistant"),
6946
+ error: z37.literal("rate_limit"),
6947
+ isApiErrorMessage: z37.literal(true),
6948
+ sessionId: z37.string(),
6949
+ message: z37.object({
6950
+ content: z37.array(
6951
+ z37.object({
6952
+ type: z37.literal("text"),
6953
+ text: z37.string()
6885
6954
  })
6886
6955
  )
6887
6956
  })
@@ -8978,38 +9047,38 @@ import { Context as Context42, Effect as Effect54, Layer as Layer44 } from "effe
8978
9047
  // src/server/core/tasks/services/TasksService.ts
8979
9048
  import { FileSystem as FileSystem22, Path as Path21 } from "@effect/platform";
8980
9049
  import { Context as Context41, Effect as Effect53, Layer as Layer43, Option as Option4 } from "effect";
8981
- import { z as z38 } from "zod";
9050
+ import { z as z39 } from "zod";
8982
9051
 
8983
9052
  // src/server/core/tasks/schema.ts
8984
- import { z as z37 } from "zod";
8985
- var TaskStatusSchema = z37.enum(["pending", "in_progress", "completed", "failed"]);
8986
- var TaskSchema = z37.object({
8987
- id: z37.string(),
8988
- subject: z37.string(),
8989
- description: z37.string().optional(),
9053
+ import { z as z38 } from "zod";
9054
+ var TaskStatusSchema = z38.enum(["pending", "in_progress", "completed", "failed"]);
9055
+ var TaskSchema = z38.object({
9056
+ id: z38.string(),
9057
+ subject: z38.string(),
9058
+ description: z38.string().optional(),
8990
9059
  status: TaskStatusSchema,
8991
- owner: z37.string().optional(),
8992
- blocks: z37.array(z37.string()).optional(),
8993
- blockedBy: z37.array(z37.string()).optional(),
8994
- metadata: z37.record(z37.string(), z37.any()).optional(),
8995
- activeForm: z37.string().optional()
8996
- });
8997
- var TaskCreateSchema = z37.object({
8998
- subject: z37.string(),
8999
- description: z37.string().optional(),
9000
- activeForm: z37.string().optional(),
9001
- metadata: z37.record(z37.string(), z37.any()).optional()
9002
- });
9003
- var TaskUpdateSchema = z37.object({
9004
- taskId: z37.string(),
9060
+ owner: z38.string().optional(),
9061
+ blocks: z38.array(z38.string()).optional(),
9062
+ blockedBy: z38.array(z38.string()).optional(),
9063
+ metadata: z38.record(z38.string(), z38.any()).optional(),
9064
+ activeForm: z38.string().optional()
9065
+ });
9066
+ var TaskCreateSchema = z38.object({
9067
+ subject: z38.string(),
9068
+ description: z38.string().optional(),
9069
+ activeForm: z38.string().optional(),
9070
+ metadata: z38.record(z38.string(), z38.any()).optional()
9071
+ });
9072
+ var TaskUpdateSchema = z38.object({
9073
+ taskId: z38.string(),
9005
9074
  status: TaskStatusSchema.optional(),
9006
- subject: z37.string().optional(),
9007
- description: z37.string().optional(),
9008
- activeForm: z37.string().optional(),
9009
- owner: z37.string().optional(),
9010
- addBlockedBy: z37.array(z37.string()).optional(),
9011
- addBlocks: z37.array(z37.string()).optional(),
9012
- metadata: z37.record(z37.string(), z37.any()).optional()
9075
+ subject: z38.string().optional(),
9076
+ description: z38.string().optional(),
9077
+ activeForm: z38.string().optional(),
9078
+ owner: z38.string().optional(),
9079
+ addBlockedBy: z38.array(z38.string()).optional(),
9080
+ addBlocks: z38.array(z38.string()).optional(),
9081
+ metadata: z38.record(z38.string(), z38.any()).optional()
9013
9082
  });
9014
9083
 
9015
9084
  // src/server/core/tasks/services/TasksService.ts
@@ -9136,11 +9205,11 @@ var TasksService = class extends Context41.Tag("TasksService")() {
9136
9205
  Effect53.runFork(
9137
9206
  Effect53.logWarning(`Invalid task file ${file}: ${parsed.error.message}`)
9138
9207
  );
9139
- const fallbackSchema = z38.object({
9140
- id: z38.string().optional(),
9141
- subject: z38.string().optional(),
9142
- title: z38.string().optional(),
9143
- status: z38.enum(["pending", "in_progress", "completed", "failed"]).optional()
9208
+ const fallbackSchema = z39.object({
9209
+ id: z39.string().optional(),
9210
+ subject: z39.string().optional(),
9211
+ title: z39.string().optional(),
9212
+ status: z39.enum(["pending", "in_progress", "completed", "failed"]).optional()
9144
9213
  });
9145
9214
  const fallbackParsed = fallbackSchema.safeParse(task);
9146
9215
  const fb = fallbackParsed.success ? fallbackParsed.data : {};
@@ -9150,7 +9219,7 @@ var TasksService = class extends Context41.Tag("TasksService")() {
9150
9219
  const fallbackTask = {
9151
9220
  id: taskId,
9152
9221
  subject: taskSubject,
9153
- description: `Validation Error: ${JSON.stringify(z38.treeifyError(parsed.error))}. Raw: ${JSON.stringify(task)}`,
9222
+ description: `Validation Error: ${JSON.stringify(z39.treeifyError(parsed.error))}. Raw: ${JSON.stringify(task)}`,
9154
9223
  status: validStatus,
9155
9224
  blocks: [],
9156
9225
  blockedBy: []
@@ -9760,24 +9829,24 @@ import { createMiddleware as createMiddleware3 } from "hono/factory";
9760
9829
  import prexit from "prexit";
9761
9830
 
9762
9831
  // src/lib/config/userConfig.ts
9763
- import z40 from "zod";
9832
+ import z41 from "zod";
9764
9833
 
9765
9834
  // src/lib/i18n/schema.ts
9766
- import z39 from "zod";
9767
- var localeSchema = z39.enum(["ja", "en", "zh_CN"]);
9835
+ import z40 from "zod";
9836
+ var localeSchema = z40.enum(["ja", "en", "zh_CN"]);
9768
9837
 
9769
9838
  // src/lib/config/userConfig.ts
9770
- var userConfigSchema = z40.object({
9771
- hideNoUserMessageSession: z40.boolean().optional().default(true),
9772
- unifySameTitleSession: z40.boolean().optional().default(false),
9773
- enterKeyBehavior: z40.enum(["shift-enter-send", "enter-send", "command-enter-send"]).optional().default("shift-enter-send"),
9839
+ var userConfigSchema = z41.object({
9840
+ hideNoUserMessageSession: z41.boolean().optional().default(true),
9841
+ unifySameTitleSession: z41.boolean().optional().default(false),
9842
+ enterKeyBehavior: z41.enum(["shift-enter-send", "enter-send", "command-enter-send"]).optional().default("shift-enter-send"),
9774
9843
  locale: localeSchema.optional().default("en"),
9775
- theme: z40.enum(["light", "dark", "system"]).optional().default("system"),
9776
- searchHotkey: z40.enum(["ctrl-k", "command-k"]).optional().default("command-k"),
9777
- findHotkey: z40.enum(["ctrl-f", "command-f"]).optional().default("command-f"),
9778
- autoScheduleContinueOnRateLimit: z40.boolean().optional().default(false),
9779
- modelChoices: z40.array(z40.string()).optional().default(["default", "haiku", "sonnet", "opus"]),
9780
- usageMode: z40.enum(["subscription", "api"]).optional()
9844
+ theme: z41.enum(["light", "dark", "system"]).optional().default("system"),
9845
+ searchHotkey: z41.enum(["ctrl-k", "command-k"]).optional().default("command-k"),
9846
+ findHotkey: z41.enum(["ctrl-f", "command-f"]).optional().default("command-f"),
9847
+ autoScheduleContinueOnRateLimit: z41.boolean().optional().default(false),
9848
+ modelChoices: z41.array(z41.string()).optional().default(["default", "haiku", "sonnet", "opus"]),
9849
+ usageMode: z41.enum(["subscription", "api"]).optional()
9781
9850
  });
9782
9851
  var defaultUserConfig = userConfigSchema.parse({});
9783
9852
 
@@ -9826,7 +9895,7 @@ import { zValidator } from "@hono/zod-validator";
9826
9895
  import { Effect as Effect59 } from "effect";
9827
9896
  import { Hono as Hono2 } from "hono";
9828
9897
  import { deleteCookie, getCookie as getCookie3, setCookie as setCookie2 } from "hono/cookie";
9829
- import { z as z41 } from "zod";
9898
+ import { z as z42 } from "zod";
9830
9899
  var safeEqual2 = (a, b) => {
9831
9900
  if (a.length !== b.length) return false;
9832
9901
  return timingSafeEqual2(Buffer.from(a, "utf-8"), Buffer.from(b, "utf-8"));
@@ -9834,7 +9903,7 @@ var safeEqual2 = (a, b) => {
9834
9903
  var authRoutes = Effect59.gen(function* () {
9835
9904
  const { getAuthState } = yield* AuthMiddleware;
9836
9905
  const { validSessionToken, authEnabled, authPassword } = yield* getAuthState;
9837
- return new Hono2().post("/login", zValidator("json", z41.object({ password: z41.string() })), (c) => {
9906
+ return new Hono2().post("/login", zValidator("json", z42.object({ password: z42.string() })), (c) => {
9838
9907
  const { password } = c.req.valid("json");
9839
9908
  if (!authEnabled) {
9840
9909
  return c.json(
@@ -9871,73 +9940,73 @@ var authRoutes = Effect59.gen(function* () {
9871
9940
  import { zValidator as zValidator2 } from "@hono/zod-validator";
9872
9941
  import { Effect as Effect61 } from "effect";
9873
9942
  import { Hono as Hono3 } from "hono";
9874
- import { z as z43 } from "zod";
9943
+ import { z as z44 } from "zod";
9875
9944
 
9876
9945
  // src/server/core/claude-code/schema.ts
9877
- import { z as z42 } from "zod";
9878
- var mediaTypeSchema = z42.enum(["image/png", "image/jpeg", "image/gif", "image/webp"]);
9879
- var imageBlockSchema = z42.object({
9880
- type: z42.literal("image"),
9881
- source: z42.object({
9882
- type: z42.literal("base64"),
9946
+ import { z as z43 } from "zod";
9947
+ var mediaTypeSchema = z43.enum(["image/png", "image/jpeg", "image/gif", "image/webp"]);
9948
+ var imageBlockSchema = z43.object({
9949
+ type: z43.literal("image"),
9950
+ source: z43.object({
9951
+ type: z43.literal("base64"),
9883
9952
  media_type: mediaTypeSchema,
9884
- data: z42.string()
9953
+ data: z43.string()
9885
9954
  })
9886
9955
  });
9887
- var documentBlockSchema = z42.object({
9888
- type: z42.literal("document"),
9889
- source: z42.union([
9890
- z42.object({
9891
- type: z42.literal("text"),
9892
- media_type: z42.enum(["text/plain"]),
9893
- data: z42.string()
9956
+ var documentBlockSchema = z43.object({
9957
+ type: z43.literal("document"),
9958
+ source: z43.union([
9959
+ z43.object({
9960
+ type: z43.literal("text"),
9961
+ media_type: z43.enum(["text/plain"]),
9962
+ data: z43.string()
9894
9963
  }),
9895
- z42.object({
9896
- type: z42.literal("base64"),
9897
- media_type: z42.enum(["application/pdf"]),
9898
- data: z42.string()
9964
+ z43.object({
9965
+ type: z43.literal("base64"),
9966
+ media_type: z43.enum(["application/pdf"]),
9967
+ data: z43.string()
9899
9968
  })
9900
9969
  ])
9901
9970
  });
9902
- var userMessageInputSchema = z42.object({
9903
- text: z42.string().min(1),
9904
- images: z42.array(imageBlockSchema).optional(),
9905
- documents: z42.array(documentBlockSchema).optional()
9906
- });
9907
- var sandboxNetworkConfigSchema = z42.object({
9908
- allowedDomains: z42.array(z42.string()).optional(),
9909
- allowUnixSockets: z42.array(z42.string()).optional(),
9910
- allowAllUnixSockets: z42.boolean().optional(),
9911
- allowLocalBinding: z42.boolean().optional(),
9912
- httpProxyPort: z42.number().optional(),
9913
- socksProxyPort: z42.number().optional()
9914
- });
9915
- var sandboxSettingsSchema = z42.object({
9916
- enabled: z42.boolean().optional(),
9917
- autoAllowBashIfSandboxed: z42.boolean().optional(),
9918
- allowUnsandboxedCommands: z42.boolean().optional(),
9971
+ var userMessageInputSchema = z43.object({
9972
+ text: z43.string().min(1),
9973
+ images: z43.array(imageBlockSchema).optional(),
9974
+ documents: z43.array(documentBlockSchema).optional()
9975
+ });
9976
+ var sandboxNetworkConfigSchema = z43.object({
9977
+ allowedDomains: z43.array(z43.string()).optional(),
9978
+ allowUnixSockets: z43.array(z43.string()).optional(),
9979
+ allowAllUnixSockets: z43.boolean().optional(),
9980
+ allowLocalBinding: z43.boolean().optional(),
9981
+ httpProxyPort: z43.number().optional(),
9982
+ socksProxyPort: z43.number().optional()
9983
+ });
9984
+ var sandboxSettingsSchema = z43.object({
9985
+ enabled: z43.boolean().optional(),
9986
+ autoAllowBashIfSandboxed: z43.boolean().optional(),
9987
+ allowUnsandboxedCommands: z43.boolean().optional(),
9919
9988
  network: sandboxNetworkConfigSchema.optional()
9920
9989
  });
9921
- var ccOptionsSchema = z42.object({
9922
- disallowedTools: z42.array(z42.string()).optional(),
9923
- settingSources: z42.array(z42.enum(["user", "project", "local"])).optional(),
9924
- systemPrompt: z42.union([
9925
- z42.string(),
9926
- z42.object({
9927
- type: z42.literal("preset"),
9928
- preset: z42.literal("claude_code"),
9929
- append: z42.string().optional()
9990
+ var ccOptionsSchema = z43.object({
9991
+ disallowedTools: z43.array(z43.string()).optional(),
9992
+ settingSources: z43.array(z43.enum(["user", "project", "local"])).optional(),
9993
+ systemPrompt: z43.union([
9994
+ z43.string(),
9995
+ z43.object({
9996
+ type: z43.literal("preset"),
9997
+ preset: z43.literal("claude_code"),
9998
+ append: z43.string().optional()
9930
9999
  })
9931
10000
  ]).optional(),
9932
- model: z42.string().optional(),
10001
+ model: z43.string().optional(),
9933
10002
  sandbox: sandboxSettingsSchema.optional(),
9934
- maxTurns: z42.number().optional(),
9935
- maxThinkingTokens: z42.number().optional(),
9936
- env: z42.record(z42.string(), z42.string().optional()).optional(),
9937
- maxBudgetUsd: z42.number().optional(),
9938
- effort: z42.enum(["low", "medium", "high", "max"]).optional(),
9939
- permissionMode: z42.enum(["acceptEdits", "bypassPermissions", "default", "plan"]).optional(),
9940
- agent: z42.string().optional()
10003
+ maxTurns: z43.number().optional(),
10004
+ maxThinkingTokens: z43.number().optional(),
10005
+ env: z43.record(z43.string(), z43.string().optional()).optional(),
10006
+ maxBudgetUsd: z43.number().optional(),
10007
+ effort: z43.enum(["low", "medium", "high", "max"]).optional(),
10008
+ permissionMode: z43.enum(["acceptEdits", "bypassPermissions", "default", "plan"]).optional(),
10009
+ agent: z43.string().optional()
9941
10010
  });
9942
10011
 
9943
10012
  // src/server/lib/effect/toEffectResponse.ts
@@ -9993,11 +10062,11 @@ var claudeCodeRoutes = Effect61.gen(function* () {
9993
10062
  "/session-processes",
9994
10063
  zValidator2(
9995
10064
  "json",
9996
- z43.object({
9997
- projectId: z43.string(),
9998
- sessionId: z43.uuid(),
10065
+ z44.object({
10066
+ projectId: z44.string(),
10067
+ sessionId: z44.uuid(),
9999
10068
  input: userMessageInputSchema,
10000
- resume: z43.boolean(),
10069
+ resume: z44.boolean(),
10001
10070
  ccOptions: ccOptionsSchema.optional()
10002
10071
  })
10003
10072
  ),
@@ -10017,10 +10086,10 @@ var claudeCodeRoutes = Effect61.gen(function* () {
10017
10086
  "/session-processes/:sessionProcessId/continue",
10018
10087
  zValidator2(
10019
10088
  "json",
10020
- z43.object({
10021
- projectId: z43.string(),
10089
+ z44.object({
10090
+ projectId: z44.string(),
10022
10091
  input: userMessageInputSchema,
10023
- baseSessionId: z43.string()
10092
+ baseSessionId: z44.string()
10024
10093
  })
10025
10094
  ),
10026
10095
  async (c) => {
@@ -10038,7 +10107,7 @@ var claudeCodeRoutes = Effect61.gen(function* () {
10038
10107
  }
10039
10108
  ).post(
10040
10109
  "/session-processes/:sessionProcessId/abort",
10041
- zValidator2("json", z43.object({ projectId: z43.string() })),
10110
+ zValidator2("json", z44.object({ projectId: z44.string() })),
10042
10111
  (c) => {
10043
10112
  const { sessionProcessId } = c.req.param();
10044
10113
  void Effect61.runFork(claudeCodeLifeCycleService.abortTask(sessionProcessId));
@@ -10060,11 +10129,11 @@ var claudeCodeRoutes = Effect61.gen(function* () {
10060
10129
  "/permission-response",
10061
10130
  zValidator2(
10062
10131
  "json",
10063
- z43.object({
10064
- permissionRequestId: z43.string(),
10065
- decision: z43.enum(["allow", "deny", "always_allow"]),
10066
- alwaysAllowRule: z43.string().optional(),
10067
- alwaysAllowScope: z43.enum(["session", "project"]).optional()
10132
+ z44.object({
10133
+ permissionRequestId: z44.string(),
10134
+ decision: z44.enum(["allow", "deny", "always_allow"]),
10135
+ alwaysAllowRule: z44.string().optional(),
10136
+ alwaysAllowScope: z44.enum(["session", "project"]).optional()
10068
10137
  })
10069
10138
  ),
10070
10139
  async (c) => {
@@ -10080,14 +10149,14 @@ var claudeCodeRoutes = Effect61.gen(function* () {
10080
10149
  "/question-response",
10081
10150
  zValidator2(
10082
10151
  "json",
10083
- z43.object({
10084
- questionRequestId: z43.string(),
10085
- answers: z43.record(z43.string(), z43.string()),
10086
- annotations: z43.record(
10087
- z43.string(),
10088
- z43.object({
10089
- notes: z43.string().optional(),
10090
- preview: z43.string().optional()
10152
+ z44.object({
10153
+ questionRequestId: z44.string(),
10154
+ answers: z44.record(z44.string(), z44.string()),
10155
+ annotations: z44.record(
10156
+ z44.string(),
10157
+ z44.object({
10158
+ notes: z44.string().optional(),
10159
+ preview: z44.string().optional()
10091
10160
  })
10092
10161
  )
10093
10162
  })
@@ -10105,10 +10174,10 @@ var claudeCodeRoutes = Effect61.gen(function* () {
10105
10174
  "/generate-permission-rule",
10106
10175
  zValidator2(
10107
10176
  "json",
10108
- z43.object({
10109
- toolName: z43.string(),
10110
- toolInput: z43.record(z43.string(), z43.unknown()),
10111
- projectId: z43.string()
10177
+ z44.object({
10178
+ toolName: z44.string(),
10179
+ toolInput: z44.record(z44.string(), z44.unknown()),
10180
+ projectId: z44.string()
10112
10181
  })
10113
10182
  ),
10114
10183
  async (c) => {
@@ -10141,16 +10210,16 @@ var featureFlagRoutes = Effect62.gen(function* () {
10141
10210
  import { zValidator as zValidator3 } from "@hono/zod-validator";
10142
10211
  import { Effect as Effect63 } from "effect";
10143
10212
  import { Hono as Hono5 } from "hono";
10144
- import { z as z44 } from "zod";
10213
+ import { z as z45 } from "zod";
10145
10214
  var fileSystemRoutes = Effect63.gen(function* () {
10146
10215
  const fileSystemController = yield* FileSystemController;
10147
10216
  return new Hono5().get(
10148
10217
  "/file-completion",
10149
10218
  zValidator3(
10150
10219
  "query",
10151
- z44.object({
10152
- projectId: z44.string(),
10153
- basePath: z44.string().optional().default("/")
10220
+ z45.object({
10221
+ projectId: z45.string(),
10222
+ basePath: z45.string().optional().default("/")
10154
10223
  })
10155
10224
  ),
10156
10225
  async (c) => {
@@ -10166,9 +10235,9 @@ var fileSystemRoutes = Effect63.gen(function* () {
10166
10235
  "/directory-browser",
10167
10236
  zValidator3(
10168
10237
  "query",
10169
- z44.object({
10170
- currentPath: z44.string().optional(),
10171
- showHidden: z44.string().optional().transform((val) => val === "true")
10238
+ z45.object({
10239
+ currentPath: z45.string().optional(),
10240
+ showHidden: z45.string().optional().transform((val) => val === "true")
10172
10241
  })
10173
10242
  ),
10174
10243
  async (c) => {
@@ -10187,12 +10256,12 @@ var fileSystemRoutes = Effect63.gen(function* () {
10187
10256
  import { zValidator as zValidator4 } from "@hono/zod-validator";
10188
10257
  import { Effect as Effect64 } from "effect";
10189
10258
  import { Hono as Hono6 } from "hono";
10190
- import { z as z45 } from "zod";
10191
- var pushSubscriptionSchema = z45.object({
10192
- endpoint: z45.string(),
10193
- keys: z45.object({
10194
- p256dh: z45.string(),
10195
- auth: z45.string()
10259
+ import { z as z46 } from "zod";
10260
+ var pushSubscriptionSchema = z46.object({
10261
+ endpoint: z46.string(),
10262
+ keys: z46.object({
10263
+ p256dh: z46.string(),
10264
+ auth: z46.string()
10196
10265
  })
10197
10266
  });
10198
10267
  var notificationRoutes = Effect64.gen(function* () {
@@ -10204,9 +10273,9 @@ var notificationRoutes = Effect64.gen(function* () {
10204
10273
  "/:sessionId/consume",
10205
10274
  zValidator4(
10206
10275
  "json",
10207
- z45.object({
10208
- types: z45.array(
10209
- z45.enum([
10276
+ z46.object({
10277
+ types: z46.array(
10278
+ z46.enum([
10210
10279
  "session_paused",
10211
10280
  "session_completed",
10212
10281
  "permission_requested",
@@ -10244,24 +10313,24 @@ var notificationRoutes = Effect64.gen(function* () {
10244
10313
  import { zValidator as zValidator5 } from "@hono/zod-validator";
10245
10314
  import { Effect as Effect65 } from "effect";
10246
10315
  import { Hono as Hono7 } from "hono";
10247
- import { z as z47 } from "zod";
10316
+ import { z as z48 } from "zod";
10248
10317
 
10249
10318
  // src/server/core/git/schema.ts
10250
- import { z as z46 } from "zod";
10251
- var CommitRequestSchema = z46.object({
10252
- files: z46.array(z46.string().min(1)).min(1),
10253
- message: z46.string().trim().min(1)
10254
- });
10255
- var CommitResultSuccessSchema = z46.object({
10256
- success: z46.literal(true),
10257
- commitSha: z46.string().length(40),
10258
- filesCommitted: z46.number().int().positive(),
10259
- message: z46.string()
10260
- });
10261
- var CommitResultErrorSchema = z46.object({
10262
- success: z46.literal(false),
10263
- error: z46.string(),
10264
- errorCode: z46.enum([
10319
+ import { z as z47 } from "zod";
10320
+ var CommitRequestSchema = z47.object({
10321
+ files: z47.array(z47.string().min(1)).min(1),
10322
+ message: z47.string().trim().min(1)
10323
+ });
10324
+ var CommitResultSuccessSchema = z47.object({
10325
+ success: z47.literal(true),
10326
+ commitSha: z47.string().length(40),
10327
+ filesCommitted: z47.number().int().positive(),
10328
+ message: z47.string()
10329
+ });
10330
+ var CommitResultErrorSchema = z47.object({
10331
+ success: z47.literal(false),
10332
+ error: z47.string(),
10333
+ errorCode: z47.enum([
10265
10334
  "EMPTY_MESSAGE",
10266
10335
  "NO_FILES",
10267
10336
  "PROJECT_NOT_FOUND",
@@ -10269,22 +10338,22 @@ var CommitResultErrorSchema = z46.object({
10269
10338
  "HOOK_FAILED",
10270
10339
  "GIT_COMMAND_ERROR"
10271
10340
  ]),
10272
- details: z46.string().optional()
10341
+ details: z47.string().optional()
10273
10342
  });
10274
- var CommitResultSchema = z46.discriminatedUnion("success", [
10343
+ var CommitResultSchema = z47.discriminatedUnion("success", [
10275
10344
  CommitResultSuccessSchema,
10276
10345
  CommitResultErrorSchema
10277
10346
  ]);
10278
- var PushResultSuccessSchema = z46.object({
10279
- success: z46.literal(true),
10280
- remote: z46.string(),
10281
- branch: z46.string(),
10282
- objectsPushed: z46.number().int().optional()
10283
- });
10284
- var PushResultErrorSchema = z46.object({
10285
- success: z46.literal(false),
10286
- error: z46.string(),
10287
- errorCode: z46.enum([
10347
+ var PushResultSuccessSchema = z47.object({
10348
+ success: z47.literal(true),
10349
+ remote: z47.string(),
10350
+ branch: z47.string(),
10351
+ objectsPushed: z47.number().int().optional()
10352
+ });
10353
+ var PushResultErrorSchema = z47.object({
10354
+ success: z47.literal(false),
10355
+ error: z47.string(),
10356
+ errorCode: z47.enum([
10288
10357
  "PROJECT_NOT_FOUND",
10289
10358
  "NOT_A_REPOSITORY",
10290
10359
  "NO_UPSTREAM",
@@ -10294,26 +10363,26 @@ var PushResultErrorSchema = z46.object({
10294
10363
  "TIMEOUT",
10295
10364
  "GIT_COMMAND_ERROR"
10296
10365
  ]),
10297
- details: z46.string().optional()
10366
+ details: z47.string().optional()
10298
10367
  });
10299
- var PushResultSchema = z46.discriminatedUnion("success", [
10368
+ var PushResultSchema = z47.discriminatedUnion("success", [
10300
10369
  PushResultSuccessSchema,
10301
10370
  PushResultErrorSchema
10302
10371
  ]);
10303
- var CommitAndPushResultSuccessSchema = z46.object({
10304
- success: z46.literal(true),
10305
- commitSha: z46.string().length(40),
10306
- filesCommitted: z46.number().int().positive(),
10307
- message: z46.string(),
10308
- remote: z46.string(),
10309
- branch: z46.string()
10310
- });
10311
- var CommitAndPushResultErrorSchema = z46.object({
10312
- success: z46.literal(false),
10313
- commitSucceeded: z46.boolean(),
10314
- commitSha: z46.string().length(40).optional(),
10315
- error: z46.string(),
10316
- errorCode: z46.enum([
10372
+ var CommitAndPushResultSuccessSchema = z47.object({
10373
+ success: z47.literal(true),
10374
+ commitSha: z47.string().length(40),
10375
+ filesCommitted: z47.number().int().positive(),
10376
+ message: z47.string(),
10377
+ remote: z47.string(),
10378
+ branch: z47.string()
10379
+ });
10380
+ var CommitAndPushResultErrorSchema = z47.object({
10381
+ success: z47.literal(false),
10382
+ commitSucceeded: z47.boolean(),
10383
+ commitSha: z47.string().length(40).optional(),
10384
+ error: z47.string(),
10385
+ errorCode: z47.enum([
10317
10386
  "EMPTY_MESSAGE",
10318
10387
  "NO_FILES",
10319
10388
  "PROJECT_NOT_FOUND",
@@ -10326,9 +10395,9 @@ var CommitAndPushResultErrorSchema = z46.object({
10326
10395
  "NETWORK_ERROR",
10327
10396
  "TIMEOUT"
10328
10397
  ]),
10329
- details: z46.string().optional()
10398
+ details: z47.string().optional()
10330
10399
  });
10331
- var CommitAndPushResultSchema = z46.discriminatedUnion("success", [
10400
+ var CommitAndPushResultSchema = z47.discriminatedUnion("success", [
10332
10401
  CommitAndPushResultSuccessSchema,
10333
10402
  CommitAndPushResultErrorSchema
10334
10403
  ]);
@@ -10347,7 +10416,7 @@ var projectRoutes = Effect65.gen(function* () {
10347
10416
  return response;
10348
10417
  }).get(
10349
10418
  "/:projectId",
10350
- zValidator5("query", z47.object({ cursor: z47.string().optional() })),
10419
+ zValidator5("query", z48.object({ cursor: z48.string().optional() })),
10351
10420
  async (c) => {
10352
10421
  const response = await effectToResponse(
10353
10422
  c,
@@ -10362,8 +10431,8 @@ var projectRoutes = Effect65.gen(function* () {
10362
10431
  "/",
10363
10432
  zValidator5(
10364
10433
  "json",
10365
- z47.object({
10366
- projectPath: z47.string().min(1, "Project path is required")
10434
+ z48.object({
10435
+ projectPath: z48.string().min(1, "Project path is required")
10367
10436
  })
10368
10437
  ),
10369
10438
  async (c) => {
@@ -10420,7 +10489,7 @@ var projectRoutes = Effect65.gen(function* () {
10420
10489
  return response;
10421
10490
  }).get(
10422
10491
  "/:projectId/agent-sessions/:agentId",
10423
- zValidator5("query", z47.object({ sessionId: z47.string().optional() })),
10492
+ zValidator5("query", z48.object({ sessionId: z48.string().optional() })),
10424
10493
  async (c) => {
10425
10494
  const projectId = c.req.param("projectId");
10426
10495
  const agentId = c.req.param("agentId");
@@ -10455,8 +10524,8 @@ var projectRoutes = Effect65.gen(function* () {
10455
10524
  "/:projectId/files",
10456
10525
  zValidator5(
10457
10526
  "query",
10458
- z47.object({
10459
- filePath: z47.string().min(1, "filePath is required")
10527
+ z48.object({
10528
+ filePath: z48.string().min(1, "filePath is required")
10460
10529
  })
10461
10530
  ),
10462
10531
  async (c) => {
@@ -10484,9 +10553,9 @@ var projectRoutes = Effect65.gen(function* () {
10484
10553
  "/:projectId/git/diff",
10485
10554
  zValidator5(
10486
10555
  "json",
10487
- z47.object({
10488
- fromRef: z47.string().min(1, "fromRef is required"),
10489
- toRef: z47.string().min(1, "toRef is required")
10556
+ z48.object({
10557
+ fromRef: z48.string().min(1, "fromRef is required"),
10558
+ toRef: z48.string().min(1, "toRef is required")
10490
10559
  })
10491
10560
  ),
10492
10561
  async (c) => {
@@ -10546,8 +10615,8 @@ var projectRoutes = Effect65.gen(function* () {
10546
10615
  "/:projectId/git/checkout",
10547
10616
  zValidator5(
10548
10617
  "json",
10549
- z47.object({
10550
- branchName: z47.string().min(1, "branchName is required")
10618
+ z48.object({
10619
+ branchName: z48.string().min(1, "branchName is required")
10551
10620
  })
10552
10621
  ),
10553
10622
  async (c) => {
@@ -10609,7 +10678,7 @@ var schedulerRoutes = Effect66.gen(function* () {
10609
10678
  import { zValidator as zValidator7 } from "@hono/zod-validator";
10610
10679
  import { Effect as Effect67 } from "effect";
10611
10680
  import { Hono as Hono9 } from "hono";
10612
- import { z as z48 } from "zod";
10681
+ import { z as z49 } from "zod";
10613
10682
  var searchRoutes = Effect67.gen(function* () {
10614
10683
  const searchController = yield* SearchController;
10615
10684
  const runtime = yield* getHonoRuntime;
@@ -10617,10 +10686,10 @@ var searchRoutes = Effect67.gen(function* () {
10617
10686
  "/",
10618
10687
  zValidator7(
10619
10688
  "query",
10620
- z48.object({
10621
- q: z48.string().min(2),
10622
- limit: z48.string().optional().transform((val) => val !== void 0 && val !== "" ? parseInt(val, 10) : void 0),
10623
- projectId: z48.string().optional()
10689
+ z49.object({
10690
+ q: z49.string().min(2),
10691
+ limit: z49.string().optional().transform((val) => val !== void 0 && val !== "" ? parseInt(val, 10) : void 0),
10692
+ projectId: z49.string().optional()
10624
10693
  })
10625
10694
  ),
10626
10695
  async (c) => {
@@ -10661,7 +10730,7 @@ import { zValidator as zValidator8 } from "@hono/zod-validator";
10661
10730
  import { Effect as Effect69 } from "effect";
10662
10731
  import { Hono as Hono11 } from "hono";
10663
10732
  import { HTTPException } from "hono/http-exception";
10664
- import { z as z49 } from "zod";
10733
+ import { z as z50 } from "zod";
10665
10734
  var getClaudeProjectsDirPath = Effect69.gen(function* () {
10666
10735
  const applicationContext = yield* ApplicationContext;
10667
10736
  const claudeCodePaths = yield* applicationContext.claudeCodePaths;
@@ -10674,9 +10743,9 @@ var tasksRoutes = Effect69.gen(function* () {
10674
10743
  "/",
10675
10744
  zValidator8(
10676
10745
  "query",
10677
- z49.object({
10678
- projectId: z49.string(),
10679
- sessionId: z49.string().optional()
10746
+ z50.object({
10747
+ projectId: z50.string(),
10748
+ sessionId: z50.string().optional()
10680
10749
  })
10681
10750
  ),
10682
10751
  async (c) => {
@@ -10705,9 +10774,9 @@ var tasksRoutes = Effect69.gen(function* () {
10705
10774
  "/",
10706
10775
  zValidator8(
10707
10776
  "query",
10708
- z49.object({
10709
- projectId: z49.string(),
10710
- sessionId: z49.string().optional()
10777
+ z50.object({
10778
+ projectId: z50.string(),
10779
+ sessionId: z50.string().optional()
10711
10780
  })
10712
10781
  ),
10713
10782
  zValidator8("json", TaskCreateSchema),
@@ -10738,9 +10807,9 @@ var tasksRoutes = Effect69.gen(function* () {
10738
10807
  "/:taskId",
10739
10808
  zValidator8(
10740
10809
  "query",
10741
- z49.object({
10742
- projectId: z49.string(),
10743
- sessionId: z49.string().optional()
10810
+ z50.object({
10811
+ projectId: z50.string(),
10812
+ sessionId: z50.string().optional()
10744
10813
  })
10745
10814
  ),
10746
10815
  zValidator8("json", TaskUpdateSchema.omit({ taskId: true })),
@@ -10858,7 +10927,7 @@ var withServerLogLevel = (verbose) => (effect) => effect.pipe(Logger.withMinimum
10858
10927
  // src/server/terminal/terminalWebSocket.ts
10859
10928
  import { Effect as Effect71, Runtime as Runtime5 } from "effect";
10860
10929
  import WebSocket, { WebSocketServer } from "ws";
10861
- import { z as z50 } from "zod";
10930
+ import { z as z51 } from "zod";
10862
10931
  var parseCookies = (cookieHeader) => {
10863
10932
  const result = {};
10864
10933
  if (cookieHeader === void 0 || cookieHeader === "") return result;
@@ -10870,12 +10939,12 @@ var parseCookies = (cookieHeader) => {
10870
10939
  }
10871
10940
  return result;
10872
10941
  };
10873
- var clientMessageSchema = z50.union([
10874
- z50.object({ type: z50.literal("input"), data: z50.string() }),
10875
- z50.object({ type: z50.literal("resize"), cols: z50.number(), rows: z50.number() }),
10876
- z50.object({ type: z50.literal("signal"), name: z50.string() }),
10877
- z50.object({ type: z50.literal("sync"), lastSeq: z50.number() }),
10878
- z50.object({ type: z50.literal("ping") })
10942
+ var clientMessageSchema = z51.union([
10943
+ z51.object({ type: z51.literal("input"), data: z51.string() }),
10944
+ z51.object({ type: z51.literal("resize"), cols: z51.number(), rows: z51.number() }),
10945
+ z51.object({ type: z51.literal("signal"), name: z51.string() }),
10946
+ z51.object({ type: z51.literal("sync"), lastSeq: z51.number() }),
10947
+ z51.object({ type: z51.literal("ping") })
10879
10948
  ]);
10880
10949
  var parseClientMessage = (payload) => {
10881
10950
  try {
@@ -11091,6 +11160,7 @@ var MainLayer = PresentationLayer.pipe(
11091
11160
  );
11092
11161
 
11093
11162
  // src/server/main.ts
11163
+ checkNodeVersion();
11094
11164
  var program = new Command3();
11095
11165
  program.name(package_default.name).version(package_default.version).description(package_default.description);
11096
11166
  program.option("-p, --port <port>", "port to listen on").option("-h, --hostname <hostname>", "hostname to listen on").option("-v, --verbose", "enable verbose debug logging").option("-P, --password <password>", "password to authenticate").option("-e, --executable <executable>", "path to claude code executable").option("--claude-dir <claude-dir>", "path to claude directory").option("--terminal-disabled", "disable the in-app terminal panel when enabled").option("--terminal-shell <path>", "shell executable for terminal sessions").option("--terminal-unrestricted", "disable restricted shell flags for bash sessions").option("--api-only", "run in API-only mode without Web UI").action(async (options) => {