@mcptoolshop/claude-sfx 1.1.0 → 1.1.2

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/CHANGELOG.md CHANGED
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.1.2] - 2026-03-29
11
+
12
+ ### Fixed
13
+ - Windows `\r` in hook command paths — `where claude-sfx` output now properly stripped of carriage returns, fixing hooks that silently failed on Windows
14
+
15
+ ## [1.1.1] - 2026-03-25
16
+
17
+ ### Added
18
+ - Quiet hours input validation — `setQuietHours()` now validates HH:MM format and throws `SfxError` with hint for malformed input
19
+ - `isValidTimeFormat()` exported for programmatic use
20
+ - 5 new tests for time validation (197 total)
21
+
10
22
  ## [1.1.0] - 2026-03-19
11
23
 
12
24
  ### Added
package/dist/config.d.ts CHANGED
@@ -30,6 +30,8 @@ export declare function saveConfig(config: SfxConfig): void;
30
30
  export declare function setMuted(muted: boolean): SfxConfig;
31
31
  export declare function setVolume(volume: number): SfxConfig;
32
32
  export declare function setProfile(profile: string): SfxConfig;
33
+ /** Validate a time string in HH:MM 24-hour format. Returns true if valid. */
34
+ export declare function isValidTimeFormat(time: string): boolean;
33
35
  export declare function setQuietHours(start: string, end: string): SfxConfig;
34
36
  export declare function clearQuietHours(): SfxConfig;
35
37
  export declare function isQuietTime(config: SfxConfig): boolean;
package/dist/config.js CHANGED
@@ -6,6 +6,7 @@
6
6
  import { readFileSync, writeFileSync, mkdirSync, existsSync } from "node:fs";
7
7
  import { join } from "node:path";
8
8
  import { homedir } from "node:os";
9
+ import { SfxError } from "./errors.js";
9
10
  // --- Config directory ---
10
11
  const CONFIG_DIR = join(homedir(), ".claude-sfx");
11
12
  const CONFIG_FILE = join(CONFIG_DIR, "config.json");
@@ -60,7 +61,28 @@ export function setProfile(profile) {
60
61
  saveConfig(cfg);
61
62
  return cfg;
62
63
  }
64
+ /** Validate a time string in HH:MM 24-hour format. Returns true if valid. */
65
+ export function isValidTimeFormat(time) {
66
+ if (!/^\d{1,2}:\d{2}$/.test(time))
67
+ return false;
68
+ const [h, m] = time.split(":").map(Number);
69
+ return h >= 0 && h <= 23 && m >= 0 && m <= 59;
70
+ }
63
71
  export function setQuietHours(start, end) {
72
+ if (!isValidTimeFormat(start)) {
73
+ throw new SfxError({
74
+ code: "CONFIG_INVALID_VALUE",
75
+ message: `Invalid quiet hours start time: "${start}"`,
76
+ hint: "Use HH:MM format in 24-hour time (e.g., 22:00)",
77
+ });
78
+ }
79
+ if (!isValidTimeFormat(end)) {
80
+ throw new SfxError({
81
+ code: "CONFIG_INVALID_VALUE",
82
+ message: `Invalid quiet hours end time: "${end}"`,
83
+ hint: "Use HH:MM format in 24-hour time (e.g., 07:00)",
84
+ });
85
+ }
64
86
  const cfg = loadConfig();
65
87
  cfg.quietHours = { start, end };
66
88
  saveConfig(cfg);
package/dist/hooks.js CHANGED
@@ -13,7 +13,7 @@ function resolveSfxBin() {
13
13
  // Try to find the globally/locally installed binary
14
14
  try {
15
15
  const which = process.platform === "win32"
16
- ? execSync("where claude-sfx", { encoding: "utf-8", stdio: ["pipe", "pipe", "ignore"] }).trim().split("\n")[0]
16
+ ? execSync("where claude-sfx", { encoding: "utf-8", stdio: ["pipe", "pipe", "ignore"] }).trim().split(/\r?\n/)[0].trim()
17
17
  : execSync("which claude-sfx", { encoding: "utf-8", stdio: ["pipe", "pipe", "ignore"] }).trim();
18
18
  if (which)
19
19
  return which;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcptoolshop/claude-sfx",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "Procedural audio feedback for Claude Code — UX for agentic coding",
5
5
  "type": "module",
6
6
  "bin": {