@umang-boss/claudemon 1.1.2 → 1.1.3

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/cli/shared.ts CHANGED
@@ -5,6 +5,7 @@
5
5
 
6
6
  import { resolve, dirname } from "node:path";
7
7
  import { fileURLToPath } from "node:url";
8
+ import { existsSync } from "node:fs";
8
9
 
9
10
  // ── Config shape interfaces ──────────────────────────────────
10
11
 
@@ -53,7 +54,13 @@ if (!HOME) {
53
54
  export const CLI_HOME = HOME;
54
55
  const __filename = fileURLToPath(import.meta.url);
55
56
  const __dirname = dirname(__filename);
56
- export const PROJECT_DIR = resolve(dirname(__dirname));
57
+
58
+ // Resolve project root — works from both src (cli/) and compiled (dist/cli/)
59
+ let projectDir = resolve(dirname(__dirname));
60
+ if (projectDir.endsWith("/dist") || projectDir.endsWith("\\dist")) {
61
+ projectDir = resolve(projectDir, "..");
62
+ }
63
+ export const PROJECT_DIR = projectDir;
57
64
  export const CLAUDE_DIR = `${HOME}/.claude`;
58
65
  export const CLAUDE_CONFIG = `${HOME}/.claude.json`;
59
66
  export const CLAUDE_SETTINGS = `${CLAUDE_DIR}/settings.json`;
@@ -70,8 +77,6 @@ export const SERVER_ENTRY_JS = `${PROJECT_DIR}/dist/src/server/index.js`;
70
77
 
71
78
  /** Find the best runtime and server entry — prefers bun (fast), falls back to node (compiled JS) */
72
79
  export function getRuntime(): { command: string; serverEntry: string } {
73
- const { existsSync } = require("node:fs") as { existsSync: (p: string) => boolean };
74
-
75
80
  // Check for bun (can run .ts directly)
76
81
  const bunCandidates = [`${HOME}/.bun/bin/bun`, "/usr/local/bin/bun", "/usr/bin/bun"];
77
82
  for (const p of bunCandidates) {
@@ -4,6 +4,7 @@
4
4
  */
5
5
  import { resolve, dirname } from "node:path";
6
6
  import { fileURLToPath } from "node:url";
7
+ import { existsSync } from "node:fs";
7
8
  // ── Constants ────────────────────────────────────────────────
8
9
  const HOME = process.env["HOME"];
9
10
  if (!HOME) {
@@ -13,7 +14,12 @@ if (!HOME) {
13
14
  export const CLI_HOME = HOME;
14
15
  const __filename = fileURLToPath(import.meta.url);
15
16
  const __dirname = dirname(__filename);
16
- export const PROJECT_DIR = resolve(dirname(__dirname));
17
+ // Resolve project root — works from both src (cli/) and compiled (dist/cli/)
18
+ let projectDir = resolve(dirname(__dirname));
19
+ if (projectDir.endsWith("/dist") || projectDir.endsWith("\\dist")) {
20
+ projectDir = resolve(projectDir, "..");
21
+ }
22
+ export const PROJECT_DIR = projectDir;
17
23
  export const CLAUDE_DIR = `${HOME}/.claude`;
18
24
  export const CLAUDE_CONFIG = `${HOME}/.claude.json`;
19
25
  export const CLAUDE_SETTINGS = `${CLAUDE_DIR}/settings.json`;
@@ -29,7 +35,6 @@ export const SERVER_ENTRY_TS = `${PROJECT_DIR}/src/server/index.ts`;
29
35
  export const SERVER_ENTRY_JS = `${PROJECT_DIR}/dist/src/server/index.js`;
30
36
  /** Find the best runtime and server entry — prefers bun (fast), falls back to node (compiled JS) */
31
37
  export function getRuntime() {
32
- const { existsSync } = require("node:fs");
33
38
  // Check for bun (can run .ts directly)
34
39
  const bunCandidates = [`${HOME}/.bun/bin/bun`, "/usr/local/bin/bun", "/usr/bin/bun"];
35
40
  for (const p of bunCandidates) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umang-boss/claudemon",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "Pokemon Gen 1 coding companion for Claude Code — Gotta code 'em all!",
5
5
  "type": "module",
6
6
  "main": "dist/src/server/index.js",