@kimuson/claude-code-viewer 0.4.8 → 0.4.10

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
@@ -874,8 +874,8 @@ var resolveClaudeCodePath = Effect10.gen(function* () {
874
874
  Command.make("which", "claude").pipe(
875
875
  Command.env({
876
876
  PATH: pathEnv
877
- }),
878
- Command.runInShell(true)
877
+ })
878
+ // DO NOT Specify `runInShell(true)` here, it causes resolve node_modules/.bin/claude to be executed.
879
879
  )
880
880
  ).pipe(
881
881
  Effect10.map((output) => output.trim()),
@@ -886,26 +886,22 @@ var resolveClaudeCodePath = Effect10.gen(function* () {
886
886
  if (whichClaude !== null) {
887
887
  return whichClaude;
888
888
  }
889
- const projectClaudeCode = yield* Effect10.try(() => {
890
- const parts = __dirname.split("/");
891
- const packagePath = parts.slice(0, parts.indexOf("claude-code-viewer") + 1).join("/");
892
- return path.join(
893
- packagePath,
894
- "node_modules",
895
- "@anthropic-ai",
896
- "claude-code",
897
- "cli.js"
898
- );
899
- }).pipe(
900
- Effect10.catchAll(() => {
901
- return Effect10.fail(
902
- new ClaudeCodePathNotFoundError({
903
- message: "Claude Code CLI not found in any location"
904
- })
905
- );
906
- })
889
+ const buildInClaude = yield* Command.string(
890
+ Command.make("which", "claude").pipe(Command.runInShell(true))
891
+ ).pipe(
892
+ Effect10.map((output) => output.trim()),
893
+ Effect10.map((output) => output === "" ? null : output),
894
+ // 存在しない時、空文字になる模様
895
+ Effect10.catchAll(() => Effect10.succeed(null))
907
896
  );
908
- return projectClaudeCode;
897
+ if (buildInClaude === null) {
898
+ return yield* Effect10.fail(
899
+ new ClaudeCodePathNotFoundError({
900
+ message: "Claude Code CLI not found in any location"
901
+ })
902
+ );
903
+ }
904
+ return buildInClaude;
909
905
  });
910
906
  var Config = Effect10.gen(function* () {
911
907
  const claudeCodeExecutablePath = yield* resolveClaudeCodePath;
@@ -6361,7 +6357,7 @@ import { z as z28 } from "zod";
6361
6357
  // package.json
6362
6358
  var package_default = {
6363
6359
  name: "@kimuson/claude-code-viewer",
6364
- version: "0.4.8",
6360
+ version: "0.4.10",
6365
6361
  type: "module",
6366
6362
  license: "MIT",
6367
6363
  repository: {
@@ -6400,7 +6396,7 @@ var package_default = {
6400
6396
  "e2e:capture-snapshots": "./scripts/e2e/capture_snapshots.sh",
6401
6397
  "lingui:extract": "lingui extract --clean && node ./scripts/lingui-sort.js",
6402
6398
  "lingui:compile": "lingui compile --typescript",
6403
- postinstall: "lefthook install"
6399
+ prepare: "lefthook install"
6404
6400
  },
6405
6401
  dependencies: {
6406
6402
  "@anthropic-ai/claude-agent-sdk": "0.1.30",