@braingrid/cli 0.2.33 → 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 +11 -0
- package/dist/cli.js +30 -16
- package/dist/cli.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,17 @@ 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
|
+
|
|
10
21
|
## [0.2.33] - 2026-02-03
|
|
11
22
|
|
|
12
23
|
### Changed
|
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.
|
|
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
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
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
|
-
|
|
2699
|
-
|
|
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, " ");
|