@kimuson/claude-code-viewer 0.4.10 → 0.4.12

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
@@ -856,6 +856,7 @@ import {
856
856
  } from "@anthropic-ai/claude-code";
857
857
  import { Command, Path as Path7 } from "@effect/platform";
858
858
  import { Data, Effect as Effect10 } from "effect";
859
+ var isNpxShimPath = (path) => /_npx[/\\].*node_modules[\\/]\.bin/.test(path);
859
860
  var ClaudeCodePathNotFoundError = class extends Data.TaggedError(
860
861
  "ClaudeCodePathNotFoundError"
861
862
  ) {
@@ -879,11 +880,12 @@ var resolveClaudeCodePath = Effect10.gen(function* () {
879
880
  )
880
881
  ).pipe(
881
882
  Effect10.map((output) => output.trim()),
883
+ // npx 実行時に `.npm/_npx/.../node_modules/.bin/claude` が最優先で解決されるのを防ぐ
882
884
  Effect10.map((output) => output === "" ? null : output),
883
885
  // 存在しない時、空文字になる模様
884
886
  Effect10.catchAll(() => Effect10.succeed(null))
885
887
  );
886
- if (whichClaude !== null) {
888
+ if (whichClaude !== null && !isNpxShimPath(whichClaude)) {
887
889
  return whichClaude;
888
890
  }
889
891
  const buildInClaude = yield* Command.string(
@@ -894,7 +896,7 @@ var resolveClaudeCodePath = Effect10.gen(function* () {
894
896
  // 存在しない時、空文字になる模様
895
897
  Effect10.catchAll(() => Effect10.succeed(null))
896
898
  );
897
- if (buildInClaude === null) {
899
+ if (buildInClaude === null || isNpxShimPath(buildInClaude)) {
898
900
  return yield* Effect10.fail(
899
901
  new ClaudeCodePathNotFoundError({
900
902
  message: "Claude Code CLI not found in any location"
@@ -6357,7 +6359,7 @@ import { z as z28 } from "zod";
6357
6359
  // package.json
6358
6360
  var package_default = {
6359
6361
  name: "@kimuson/claude-code-viewer",
6360
- version: "0.4.10",
6362
+ version: "0.4.11",
6361
6363
  type: "module",
6362
6364
  license: "MIT",
6363
6365
  repository: {