claudekit-cli 4.3.1-dev.19 → 4.3.1-dev.20
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/bin/postinstall-hook-restore.cjs +41 -0
- package/cli-manifest.json +2 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -8,6 +8,13 @@ const { spawnSync } = require("node:child_process");
|
|
|
8
8
|
|
|
9
9
|
const MAX_SETTINGS_BYTES = 5 * 1024 * 1024;
|
|
10
10
|
const SAFE_KIT_NAMES = new Set(["engineer", "marketing"]);
|
|
11
|
+
const COMPLETE_HOOK_SENTINELS = new Set(["session-init", "session-state", "subagent-init"]);
|
|
12
|
+
const LEGACY_SPARSE_HOOK_SENTINELS = new Set([
|
|
13
|
+
"descriptive-name",
|
|
14
|
+
"privacy-block",
|
|
15
|
+
"scout-block",
|
|
16
|
+
"simplify-gate",
|
|
17
|
+
]);
|
|
11
18
|
|
|
12
19
|
function getHomeDir() {
|
|
13
20
|
return process.env.CK_TEST_HOME || os.homedir();
|
|
@@ -65,6 +72,35 @@ function installedHookCommands(config) {
|
|
|
65
72
|
);
|
|
66
73
|
}
|
|
67
74
|
|
|
75
|
+
function hasInstalledKit(config) {
|
|
76
|
+
return Object.keys(config?.kits || {}).some((kitName) => normalizeKitName(kitName));
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function hasLegacySparseCkHooks(settings, config) {
|
|
80
|
+
if (!hasInstalledKit(config)) return false;
|
|
81
|
+
|
|
82
|
+
const hookNames = new Set();
|
|
83
|
+
for (const command of collectHookCommands(settings)) {
|
|
84
|
+
const hookName = extractCkHookName(command);
|
|
85
|
+
if (hookName) hookNames.add(hookName);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const hasKnownSparseHook = [...LEGACY_SPARSE_HOOK_SENTINELS].some((hookName) =>
|
|
89
|
+
hookNames.has(hookName),
|
|
90
|
+
);
|
|
91
|
+
if (!hasKnownSparseHook) return false;
|
|
92
|
+
|
|
93
|
+
const disabledHooks = new Set(
|
|
94
|
+
Object.entries(config?.hooks || {})
|
|
95
|
+
.filter(([, enabled]) => enabled === false)
|
|
96
|
+
.map(([name]) => name),
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
return [...COMPLETE_HOOK_SENTINELS].some(
|
|
100
|
+
(hookName) => !disabledHooks.has(hookName) && !hookNames.has(hookName),
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
68
104
|
function countMissingCkHookRegistrations(claudeDir) {
|
|
69
105
|
const settings = readJsonFile(path.join(claudeDir, "settings.json"));
|
|
70
106
|
const config = readJsonFile(path.join(claudeDir, ".ck.json"));
|
|
@@ -83,6 +119,11 @@ function countMissingCkHookRegistrations(claudeDir) {
|
|
|
83
119
|
if (hookName && disabledHooks.has(hookName)) continue;
|
|
84
120
|
if (!existingCommands.has(normalizeCommand(command))) missing++;
|
|
85
121
|
}
|
|
122
|
+
|
|
123
|
+
if (missing === 0 && installedHookCommands(config).length === 0) {
|
|
124
|
+
return hasLegacySparseCkHooks(settings, config) ? 1 : 0;
|
|
125
|
+
}
|
|
126
|
+
|
|
86
127
|
return missing;
|
|
87
128
|
}
|
|
88
129
|
|
package/cli-manifest.json
CHANGED
package/dist/index.js
CHANGED
|
@@ -63852,7 +63852,7 @@ var package_default;
|
|
|
63852
63852
|
var init_package = __esm(() => {
|
|
63853
63853
|
package_default = {
|
|
63854
63854
|
name: "claudekit-cli",
|
|
63855
|
-
version: "4.3.1-dev.
|
|
63855
|
+
version: "4.3.1-dev.20",
|
|
63856
63856
|
description: "CLI tool for bootstrapping and updating ClaudeKit projects",
|
|
63857
63857
|
type: "module",
|
|
63858
63858
|
repository: {
|