@braingrid/cli 0.2.32 → 0.2.34

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,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.2.34] - 2026-02-05
11
+
12
+ ### Fixed
13
+
14
+ - **Deep merge `.claude/settings.json` during setup**
15
+ - `updateClaudeSettings()` now deep-merges statusLine and hooks instead of overwriting
16
+ - Preserves user customizations (extra pipes, additional hooks, other event types)
17
+ - Updates TaskUpdate hook in-place without duplicating entries
18
+ - Gracefully handles malformed hooks (non-object) and PostToolUse (non-array)
19
+ - Removed stale `| bunx cc-safety-net --statusline` pipe from default settings
20
+
21
+ ## [0.2.33] - 2026-02-03
22
+
23
+ ### Changed
24
+
25
+ - **README documentation update**
26
+ - Updated "What gets installed" section to document all Claude Code setup files
27
+ - Added status line script (`.claude/statusline.sh`)
28
+ - Added hook script (`.claude/hooks/sync-braingrid-task.sh`)
29
+ - Added settings configuration (`.claude/settings.json`)
30
+
10
31
  ## [0.2.32] - 2026-02-03
11
32
 
12
33
  ### Added
package/README.md CHANGED
@@ -146,6 +146,9 @@ braingrid setup cursor --dry-run
146
146
  - **Claude Code integration:**
147
147
  - Commands in `.claude/commands/` (specify, breakdown, build, save-requirement)
148
148
  - Skills in `.claude/skills/braingrid-cli/`
149
+ - Status line script at `.claude/statusline.sh`
150
+ - Hook script at `.claude/hooks/sync-braingrid-task.sh` for task status sync
151
+ - Settings in `.claude/settings.json` (configures status line and hooks)
149
152
  - Content injected into `CLAUDE.md` (or creates it if it doesn't exist)
150
153
 
151
154
  - **Cursor integration:**
package/dist/cli.js CHANGED
@@ -222,7 +222,7 @@ async function axiosWithRetry(config2, options) {
222
222
 
223
223
  // src/build-config.ts
224
224
  var BUILD_ENV = true ? "production" : process.env.NODE_ENV === "test" ? "development" : "production";
225
- var CLI_VERSION = true ? "0.2.32" : "0.0.0-test";
225
+ var CLI_VERSION = true ? "0.2.34" : "0.0.0-test";
226
226
  var PRODUCTION_CONFIG = {
227
227
  apiUrl: "https://app.braingrid.ai",
228
228
  workosAuthUrl: "https://auth.braingrid.ai",
@@ -2687,25 +2687,39 @@ async function updateClaudeSettings(settingsPath = ".claude/settings.json", scri
2687
2687
  settings = JSON.parse(content2);
2688
2688
  } catch {
2689
2689
  }
2690
- settings.statusLine = {
2691
- type: "command",
2692
- command: scriptPath2,
2693
- padding: 0
2694
- };
2695
- settings.hooks = {
2696
- PostToolUse: [
2690
+ const existingStatusLine = settings.statusLine;
2691
+ if (existingStatusLine?.command?.includes(scriptPath2)) {
2692
+ } else {
2693
+ settings.statusLine = {
2694
+ type: "command",
2695
+ command: scriptPath2,
2696
+ padding: 0
2697
+ };
2698
+ }
2699
+ const ourHookEntry = {
2700
+ matcher: "TaskUpdate",
2701
+ hooks: [
2697
2702
  {
2698
- matcher: "TaskUpdate",
2699
- hooks: [
2700
- {
2701
- type: "command",
2702
- command: hookScriptPath,
2703
- timeout: 1e4
2704
- }
2705
- ]
2703
+ type: "command",
2704
+ command: hookScriptPath,
2705
+ timeout: 1e4
2706
2706
  }
2707
2707
  ]
2708
2708
  };
2709
+ const existingHooks = settings.hooks && typeof settings.hooks === "object" && !Array.isArray(settings.hooks) ? settings.hooks : {};
2710
+ const existingPostToolUse = Array.isArray(existingHooks.PostToolUse) ? existingHooks.PostToolUse : [];
2711
+ const taskUpdateIdx = existingPostToolUse.findIndex((e) => e.matcher === "TaskUpdate");
2712
+ let mergedPostToolUse;
2713
+ if (taskUpdateIdx >= 0) {
2714
+ mergedPostToolUse = [...existingPostToolUse];
2715
+ mergedPostToolUse[taskUpdateIdx] = ourHookEntry;
2716
+ } else {
2717
+ mergedPostToolUse = [...existingPostToolUse, ourHookEntry];
2718
+ }
2719
+ settings.hooks = {
2720
+ ...existingHooks,
2721
+ PostToolUse: mergedPostToolUse
2722
+ };
2709
2723
  const parentDir = path2.dirname(settingsPath);
2710
2724
  await fs2.mkdir(parentDir, { recursive: true });
2711
2725
  const content = JSON.stringify(settings, null, " ");