@kimuson/claude-code-viewer 0.7.3 → 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 (39) hide show
  1. package/dist/main.js +65 -24
  2. package/dist/main.js.map +3 -3
  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/{projects-DH0K12HM.js → projects-BrdJ1LSG.js} +1 -1
  18. package/dist/static/assets/{refractor-vendor-B-OUwWR7.js → refractor-vendor-CoTYH44G.js} +1 -1
  19. package/dist/static/assets/{routes-CzLZwWu9.js → routes-BCc9450k.js} +1 -1
  20. package/dist/static/assets/session-BruJZygw.js +2 -0
  21. package/dist/static/assets/session-DXLe2gKP.js +13 -0
  22. package/dist/static/assets/session-DheVJS_-.js +1 -0
  23. package/dist/static/assets/{syntax-highlighter-vendor-CwGXx8v4.js → syntax-highlighter-vendor-E92u2I9N.js} +4 -4
  24. package/dist/static/assets/{xterm-vendor-DRG2K165.js → xterm-vendor-C7zPO6uk.js} +3 -3
  25. package/dist/static/index.html +11 -9
  26. package/dist/static/sw.js +1 -1
  27. package/package.json +11 -8
  28. package/dist/static/assets/ProtectedRoute-BTfjJdM-.js +0 -1
  29. package/dist/static/assets/card-DGrqtTaC.js +0 -1
  30. package/dist/static/assets/createLucideIcon-BL_meogc.js +0 -1
  31. package/dist/static/assets/dist-Cartj9I0.js +0 -84
  32. package/dist/static/assets/index-Bmg7UpkS.js +0 -20
  33. package/dist/static/assets/markdown-parser-vendor-D9j1a-bm.js +0 -29
  34. package/dist/static/assets/session-DItKrSkz.js +0 -12
  35. package/dist/static/assets/session-DdZMHc5j.js +0 -1
  36. /package/dist/static/assets/{messages-BugsdlC4.js → messages-CCdvpjPA.js} +0 -0
  37. /package/dist/static/assets/{messages-C9GGR_pN.js → messages-CXMLmBXL.js} +0 -0
  38. /package/dist/static/assets/{messages-CXGVSZXJ.js → messages-D1gyj6vH.js} +0 -0
  39. /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.3",
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";
@@ -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,7 +425,11 @@ 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
435
  // src/lib/conversation-schema/entry/AttachmentEntrySchema.ts
@@ -434,9 +455,21 @@ var McpInstructionsDeltaSchema = AttachmentBaseEntrySchema.extend({
434
455
  removedNames: z12.array(z12.string())
435
456
  })
436
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()
467
+ });
437
468
  var AttachmentEntrySchema = z12.union([
438
469
  DeferredToolsDeltaSchema,
439
- McpInstructionsDeltaSchema
470
+ McpInstructionsDeltaSchema,
471
+ CompanionIntroSchema,
472
+ UnknownAttachmentSchema
440
473
  ]);
441
474
 
442
475
  // src/lib/conversation-schema/entry/CustomTitleEntrySchema.ts
@@ -1645,21 +1678,26 @@ var aggregateTokenUsageAndCost = (fileContents) => {
1645
1678
  const conversations = parseJsonl(content);
1646
1679
  for (const conversation of conversations) {
1647
1680
  if (conversation.type === "assistant") {
1648
- 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;
1649
1687
  const modelName = conversation.message.model;
1650
1688
  const messageCost = calculateTokenCost(
1651
1689
  {
1652
- input_tokens: usage.input_tokens,
1653
- output_tokens: usage.output_tokens,
1654
- cache_creation_input_tokens: usage.cache_creation_input_tokens ?? 0,
1655
- 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
1656
1694
  },
1657
1695
  modelName
1658
1696
  );
1659
- totalInputTokens += usage.input_tokens;
1660
- totalOutputTokens += usage.output_tokens;
1661
- totalCacheCreationTokens += usage.cache_creation_input_tokens ?? 0;
1662
- totalCacheReadTokens += usage.cache_read_input_tokens ?? 0;
1697
+ totalInputTokens += inputTokens;
1698
+ totalOutputTokens += outputTokens;
1699
+ totalCacheCreationTokens += cacheCreationInputTokens;
1700
+ totalCacheReadTokens += cacheReadInputTokens;
1663
1701
  totalInputTokensUsd += messageCost.breakdown.inputTokensUsd;
1664
1702
  totalOutputTokensUsd += messageCost.breakdown.outputTokensUsd;
1665
1703
  totalCacheCreationUsd += messageCost.breakdown.cacheCreationUsd;
@@ -4821,7 +4859,10 @@ var LayerImpl22 = Effect33.gen(function* () {
4821
4859
  const getFileContentRoute = (options) => Effect33.gen(function* () {
4822
4860
  const { projectId, filePath } = options;
4823
4861
  const { project } = yield* projectRepository.getProject(projectId);
4824
- 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) {
4825
4866
  return {
4826
4867
  response: {
4827
4868
  success: false,
@@ -4832,8 +4873,7 @@ var LayerImpl22 = Effect33.gen(function* () {
4832
4873
  status: 400
4833
4874
  };
4834
4875
  }
4835
- const projectPath = project.meta.projectPath;
4836
- const result = yield* getFileContentEffect(projectPath, filePath).pipe(
4876
+ const result = yield* getFileContentEffect(projectRoot, filePath).pipe(
4837
4877
  Effect33.provideService(Path15.Path, path),
4838
4878
  Effect33.provideService(FileSystem13.FileSystem, fs)
4839
4879
  );
@@ -11120,6 +11160,7 @@ var MainLayer = PresentationLayer.pipe(
11120
11160
  );
11121
11161
 
11122
11162
  // src/server/main.ts
11163
+ checkNodeVersion();
11123
11164
  var program = new Command3();
11124
11165
  program.name(package_default.name).version(package_default.version).description(package_default.description);
11125
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) => {