@umang-boss/claudemon 2.0.0 → 2.0.1

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/doctor.ts CHANGED
@@ -180,6 +180,16 @@ async function checkSkill(): Promise<CheckResult> {
180
180
  // ── Check 7: Hook Script Executable ──────────────────────────
181
181
 
182
182
  async function checkHookScript(): Promise<CheckResult> {
183
+ // Windows doesn't use Unix file permissions
184
+ if (process.platform === "win32") {
185
+ try {
186
+ await access(HOOK_SCRIPT, fsConstants.F_OK);
187
+ return { label: "Hook script", passed: true, detail: "found (Windows — no chmod needed)" };
188
+ } catch {
189
+ return { label: "Hook script", passed: false, detail: "not found" };
190
+ }
191
+ }
192
+
183
193
  try {
184
194
  await access(HOOK_SCRIPT, fsConstants.X_OK);
185
195
  return { label: "Hook script", passed: true, detail: "executable" };
@@ -197,6 +207,29 @@ async function checkHookScript(): Promise<CheckResult> {
197
207
  }
198
208
  }
199
209
 
210
+ // ── Check 7b: jq Installed ──────────────────────────────────
211
+
212
+ async function checkJq(): Promise<CheckResult> {
213
+ try {
214
+ const result = spawnSync("jq", ["--version"], { stdio: "pipe" });
215
+ if (result.error) throw result.error;
216
+ const output = result.stdout?.toString().trim();
217
+ return { label: "jq", passed: true, detail: output || "installed" };
218
+ } catch {
219
+ const installHint =
220
+ process.platform === "darwin"
221
+ ? "brew install jq"
222
+ : process.platform === "win32"
223
+ ? "winget install jqlang.jq"
224
+ : "sudo apt install jq";
225
+ return {
226
+ label: "jq",
227
+ passed: false,
228
+ detail: `not found — required for status line. Install: ${installHint}`,
229
+ };
230
+ }
231
+ }
232
+
200
233
  // ── Check 8: State Manager Load ──────────────────────────────
201
234
 
202
235
  async function checkStateManager(): Promise<CheckResult> {
@@ -354,6 +387,7 @@ export async function doctor(): Promise<void> {
354
387
  const checks: CheckResult[] = [
355
388
  await checkVersion(),
356
389
  await checkBun(),
390
+ await checkJq(),
357
391
  await checkStateDir(),
358
392
  await checkStateFile(),
359
393
  await checkMcpServer(),
package/cli/install.ts CHANGED
@@ -58,10 +58,29 @@ async function checkPrerequisites(): Promise<boolean> {
58
58
  ok("Claude Code directory: ~/.claude/");
59
59
  } catch {
60
60
  fail("Claude Code not found. Install Claude Code first: https://claude.ai/download");
61
- console.error(" Expected directory: ~/.claude/");
61
+ const homeHint = process.platform === "win32" ? "%USERPROFILE%\\.claude\\" : "~/.claude/";
62
+ console.error(` Expected directory: ${homeHint}`);
62
63
  allGood = false;
63
64
  }
64
65
 
66
+ // Check jq (non-blocking — needed for status line but not core functionality)
67
+ try {
68
+ const jqResult = spawnSync("jq", ["--version"], { stdio: "pipe" });
69
+ if (!jqResult.error) {
70
+ ok(`jq: ${jqResult.stdout?.toString().trim()}`);
71
+ } else {
72
+ throw new Error("no jq");
73
+ }
74
+ } catch {
75
+ const installHint =
76
+ process.platform === "darwin"
77
+ ? "brew install jq"
78
+ : process.platform === "win32"
79
+ ? "winget install jqlang.jq"
80
+ : "sudo apt install jq";
81
+ console.error(` \u26A0 jq not found (status line won't work). Install: ${installHint}`);
82
+ }
83
+
65
84
  return allGood;
66
85
  }
67
86
 
@@ -200,6 +219,10 @@ async function installSkill(): Promise<void> {
200
219
  // ── Step 7: Set Script Permissions ───────────────────────────
201
220
 
202
221
  async function setScriptPermissions(): Promise<void> {
222
+ if (process.platform === "win32") {
223
+ ok("Scripts: permissions not needed on Windows");
224
+ return;
225
+ }
203
226
  await chmod(HOOK_SCRIPT, 0o755);
204
227
  ok("Hook script: post-tool-use.sh set executable");
205
228
  await chmod(STOP_HOOK_SCRIPT, 0o755);
package/cli/shared.ts CHANGED
@@ -46,9 +46,9 @@ export interface ClaudeSettings {
46
46
 
47
47
  // ── Constants ────────────────────────────────────────────────
48
48
 
49
- const HOME = process.env["HOME"];
49
+ const HOME = process.env["HOME"] || process.env["USERPROFILE"];
50
50
  if (!HOME) {
51
- console.error("Error: HOME environment variable is not set.");
51
+ console.error("Error: HOME (or USERPROFILE on Windows) environment variable is not set.");
52
52
  process.exit(1);
53
53
  }
54
54
 
@@ -81,7 +81,10 @@ export const SERVER_ENTRY_JS_LEGACY = `${PROJECT_DIR}/dist/src/server/index.js`;
81
81
  /** Find the best runtime — Bun (fastest) > bundled node > legacy node */
82
82
  export function getRuntime(): { command: string; serverEntry: string } {
83
83
  // Prefer bun (fastest — native TS, ~120ms startup)
84
- const bunCandidates = [`${HOME}/.bun/bin/bun`, "/usr/local/bin/bun", "/usr/bin/bun"];
84
+ const bunCandidates =
85
+ process.platform === "win32"
86
+ ? [`${HOME}\\.bun\\bin\\bun.exe`, `${HOME}/.bun/bin/bun.exe`, `${HOME}/.bun/bin/bun`]
87
+ : [`${HOME}/.bun/bin/bun`, "/usr/local/bin/bun", "/usr/bin/bun"];
85
88
  for (const p of bunCandidates) {
86
89
  if (existsSync(p)) {
87
90
  return { command: p, serverEntry: SERVER_ENTRY_TS };
package/dist/award-xp.mjs CHANGED
@@ -59,7 +59,7 @@ var BADGES = [
59
59
  }
60
60
  ];
61
61
  function getStateDir() {
62
- return `${process.env["HOME"] ?? "~"}/.claudemon`;
62
+ return `${process.env["HOME"] ?? process.env["USERPROFILE"] ?? "~"}/.claudemon`;
63
63
  }
64
64
  function getStateFile() {
65
65
  return `${getStateDir()}/state.json`;