@usevalt/cli 0.6.0 → 0.6.1

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.
Files changed (2) hide show
  1. package/dist/index.js +24 -4
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -499,16 +499,36 @@ var doctorCommand = new Command5("doctor").description("Check Valt configuration
499
499
  warn("Signing keys: not configured (using ephemeral keys \u2014 certificates will not survive restart)");
500
500
  issues++;
501
501
  }
502
+ const EXPECTED_HOOKS = [
503
+ "SessionStart",
504
+ "PreToolUse",
505
+ "PostToolUse",
506
+ "PostToolUseFailure",
507
+ "SubagentStart",
508
+ "SubagentStop",
509
+ "UserPromptSubmit",
510
+ "SessionEnd"
511
+ ];
502
512
  const hooksPath = `${process.env["HOME"] ?? "~"}/.claude/hooks.json`;
503
513
  try {
504
514
  const { existsSync: exists, readFileSync: read } = await import("fs");
505
515
  if (exists(hooksPath)) {
506
516
  const hooksContent = read(hooksPath, "utf-8");
507
- const hookCount = (hooksContent.match(/valt/g) ?? []).length;
508
- if (hookCount >= 3) {
509
- success(`Claude Code hooks: ${dim(hooksPath)} (${hookCount} hooks)`);
517
+ const hooksConfig = JSON.parse(hooksContent);
518
+ const registeredHooks = hooksConfig.hooks ?? {};
519
+ const presentHooks = EXPECTED_HOOKS.filter((name) => {
520
+ const hookEntries = registeredHooks[name];
521
+ return Array.isArray(hookEntries) && JSON.stringify(hookEntries).includes("valt");
522
+ });
523
+ const missingHooks = EXPECTED_HOOKS.filter((h) => !presentHooks.includes(h));
524
+ if (missingHooks.length === 0) {
525
+ success(`Claude Code hooks: all ${EXPECTED_HOOKS.length} registered`);
526
+ } else if (presentHooks.length === 0) {
527
+ info("Claude Code hooks: not installed. Run `valt setup` to enable.");
510
528
  } else {
511
- warn("Claude Code hooks: partially configured. Run `valt setup`.");
529
+ warn(
530
+ `Claude Code hooks: ${presentHooks.length}/${EXPECTED_HOOKS.length} registered. Missing: ${missingHooks.join(", ")}. Run \`valt setup\` to update.`
531
+ );
512
532
  issues++;
513
533
  }
514
534
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usevalt/cli",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Valt CLI — trust layer for AI-assisted development",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -39,8 +39,8 @@
39
39
  "tsup": "^8.4.0",
40
40
  "typescript": "^5.7.0",
41
41
  "vitest": "^3.2.0",
42
- "@usevalt/eslint-config": "0.0.0",
43
- "@usevalt/typescript-config": "0.0.0"
42
+ "@usevalt/typescript-config": "0.0.0",
43
+ "@usevalt/eslint-config": "0.0.0"
44
44
  },
45
45
  "scripts": {
46
46
  "build": "tsup",