claude-prism 0.5.1 → 0.5.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/lib/installer.mjs +15 -17
- package/package.json +1 -1
package/lib/installer.mjs
CHANGED
|
@@ -41,16 +41,10 @@ export async function init(projectDir, options = {}) {
|
|
|
41
41
|
if (hooks) {
|
|
42
42
|
mkdirSync(hooksDir, { recursive: true });
|
|
43
43
|
|
|
44
|
-
// Copy runner scripts (executable wrappers Claude Code calls)
|
|
45
|
-
const runnersDir = join(TEMPLATES_DIR, 'runners');
|
|
46
|
-
copyFileSync(join(runnersDir, 'commit-guard.mjs'), join(hooksDir, 'commit-guard.mjs'));
|
|
47
|
-
copyFileSync(join(runnersDir, 'debug-loop.mjs'), join(hooksDir, 'debug-loop.mjs'));
|
|
48
|
-
copyFileSync(join(runnersDir, 'test-tracker.mjs'), join(hooksDir, 'test-tracker.mjs'));
|
|
49
|
-
copyFileSync(join(runnersDir, 'scope-guard.mjs'), join(hooksDir, 'scope-guard.mjs'));
|
|
50
|
-
|
|
51
44
|
// Copy unified pipeline runners
|
|
52
|
-
|
|
45
|
+
const runnersDir = join(TEMPLATES_DIR, 'runners');
|
|
53
46
|
copyFileSync(join(runnersDir, 'pre-tool.mjs'), join(hooksDir, 'pre-tool.mjs'));
|
|
47
|
+
copyFileSync(join(runnersDir, 'post-tool.mjs'), join(hooksDir, 'post-tool.mjs'));
|
|
54
48
|
copyFileSync(join(runnersDir, 'user-prompt.mjs'), join(hooksDir, 'user-prompt.mjs'));
|
|
55
49
|
|
|
56
50
|
// Copy rule logic files
|
|
@@ -117,10 +111,8 @@ export function check(projectDir) {
|
|
|
117
111
|
const rules = existsSync(claudeMdPath)
|
|
118
112
|
&& readFileSync(claudeMdPath, 'utf8').includes('<!-- PRISM:START -->');
|
|
119
113
|
|
|
120
|
-
const hooks = existsSync(join(claudeDir, 'hooks', '
|
|
121
|
-
&& existsSync(join(claudeDir, 'hooks', '
|
|
122
|
-
&& existsSync(join(claudeDir, 'hooks', 'test-tracker.mjs'))
|
|
123
|
-
&& existsSync(join(claudeDir, 'hooks', 'scope-guard.mjs'));
|
|
114
|
+
const hooks = existsSync(join(claudeDir, 'hooks', 'pre-tool.mjs'))
|
|
115
|
+
&& existsSync(join(claudeDir, 'hooks', 'post-tool.mjs'));
|
|
124
116
|
|
|
125
117
|
const config = existsSync(join(projectDir, '.claude-prism.json'));
|
|
126
118
|
|
|
@@ -164,7 +156,7 @@ export function uninstall(projectDir) {
|
|
|
164
156
|
}
|
|
165
157
|
|
|
166
158
|
// 3. Remove prism hooks
|
|
167
|
-
for (const hook of ['commit-guard.mjs', 'debug-loop.mjs', 'test-tracker.mjs', 'scope-guard.mjs', 'user-prompt.mjs']) {
|
|
159
|
+
for (const hook of ['commit-guard.mjs', 'debug-loop.mjs', 'test-tracker.mjs', 'scope-guard.mjs', 'pre-tool.mjs', 'post-tool.mjs', 'user-prompt.mjs']) {
|
|
168
160
|
const p = join(claudeDir, 'hooks', hook);
|
|
169
161
|
if (existsSync(p)) rmSync(p);
|
|
170
162
|
}
|
|
@@ -182,7 +174,7 @@ export function uninstall(projectDir) {
|
|
|
182
174
|
if (settings.hooks) {
|
|
183
175
|
for (const [event, hookList] of Object.entries(settings.hooks)) {
|
|
184
176
|
settings.hooks[event] = hookList.filter(
|
|
185
|
-
h => !h.hooks?.some(hh => hh.command?.includes('commit-guard') || hh.command?.includes('debug-loop') || hh.command?.includes('test-tracker') || hh.command?.includes('scope-guard') || hh.command?.includes('user-prompt'))
|
|
177
|
+
h => !h.hooks?.some(hh => hh.command?.includes('commit-guard') || hh.command?.includes('debug-loop') || hh.command?.includes('test-tracker') || hh.command?.includes('scope-guard') || hh.command?.includes('pre-tool') || hh.command?.includes('post-tool') || hh.command?.includes('user-prompt'))
|
|
186
178
|
);
|
|
187
179
|
if (settings.hooks[event].length === 0) delete settings.hooks[event];
|
|
188
180
|
}
|
|
@@ -234,6 +226,12 @@ export async function update(projectDir) {
|
|
|
234
226
|
if (existsSync(p)) rmSync(p);
|
|
235
227
|
}
|
|
236
228
|
|
|
229
|
+
// Migration: remove legacy individual runners (now using unified pipeline runners)
|
|
230
|
+
for (const runner of ['commit-guard.mjs', 'debug-loop.mjs', 'test-tracker.mjs', 'scope-guard.mjs']) {
|
|
231
|
+
const p = join(claudeDir, 'hooks', runner);
|
|
232
|
+
if (existsSync(p)) rmSync(p);
|
|
233
|
+
}
|
|
234
|
+
|
|
237
235
|
// Remove old config so init creates a fresh one
|
|
238
236
|
if (existsSync(configPath)) rmSync(configPath);
|
|
239
237
|
|
|
@@ -271,7 +269,7 @@ export function doctor(projectDir, options = {}) {
|
|
|
271
269
|
}
|
|
272
270
|
|
|
273
271
|
// Check hooks
|
|
274
|
-
for (const hook of ['
|
|
272
|
+
for (const hook of ['pre-tool.mjs', 'post-tool.mjs']) {
|
|
275
273
|
if (!existsSync(join(claudeDir, 'hooks', hook))) {
|
|
276
274
|
issues.push(`Missing hook: ${hook}`);
|
|
277
275
|
fixes.push('Run `prism update` to restore missing files');
|
|
@@ -474,7 +472,7 @@ export function dryRun(projectDir, options = {}) {
|
|
|
474
472
|
|
|
475
473
|
// Hooks
|
|
476
474
|
if (hooks) {
|
|
477
|
-
const hookFiles = ['
|
|
475
|
+
const hookFiles = ['pre-tool.mjs', 'post-tool.mjs', 'user-prompt.mjs'];
|
|
478
476
|
for (const hook of hookFiles) {
|
|
479
477
|
const target = join(claudeDir, 'hooks', hook);
|
|
480
478
|
actions.push({
|
|
@@ -484,7 +482,7 @@ export function dryRun(projectDir, options = {}) {
|
|
|
484
482
|
});
|
|
485
483
|
}
|
|
486
484
|
|
|
487
|
-
const ruleFiles = ['commit-guard.mjs', 'debug-loop.mjs', 'test-tracker.mjs', 'scope-guard.mjs', 'turn-reporter.mjs'];
|
|
485
|
+
const ruleFiles = ['commit-guard.mjs', 'debug-loop.mjs', 'test-tracker.mjs', 'scope-guard.mjs', 'turn-reporter.mjs', 'alignment.mjs'];
|
|
488
486
|
for (const rule of ruleFiles) {
|
|
489
487
|
const target = join(claudeDir, 'rules', rule);
|
|
490
488
|
actions.push({
|