dlw-machine-setup 0.5.7 → 0.5.8

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/bin/installer.js +13 -2
  2. package/package.json +1 -1
package/bin/installer.js CHANGED
@@ -3845,6 +3845,13 @@ function configureSettings(claudeDir) {
3845
3845
  }
3846
3846
  }
3847
3847
  if (!settings.hooks) settings.hooks = {};
3848
+ const welcomeHook = {
3849
+ hooks: [{ type: "command", command: "node .claude/hooks/factory-welcome.cjs" }]
3850
+ };
3851
+ const immutableGuardHook = {
3852
+ matcher: "Write|Edit",
3853
+ hooks: [{ type: "command", command: "node .claude/hooks/factory-immutable-guard.cjs" }]
3854
+ };
3848
3855
  const stateAdvanceHook = {
3849
3856
  matcher: "Write|Edit",
3850
3857
  hooks: [{ type: "command", command: "node .claude/hooks/factory-state-advance.cjs" }]
@@ -3855,16 +3862,20 @@ function configureSettings(claudeDir) {
3855
3862
  const stateGuardHook = {
3856
3863
  hooks: [{ type: "command", command: "node .claude/hooks/factory-state-guard.cjs" }]
3857
3864
  };
3858
- for (const event of ["PostToolUse", "UserPromptSubmit"]) {
3865
+ for (const event of ["SessionStart", "PreToolUse", "PostToolUse", "UserPromptSubmit"]) {
3859
3866
  if (settings.hooks[event]) {
3860
3867
  settings.hooks[event] = settings.hooks[event].filter(
3861
3868
  (h) => !h.hooks?.some(
3862
- (hh) => hh.command?.includes("factory-state-advance") || hh.command?.includes("factory-context-monitor") || hh.command?.includes("factory-state-guard")
3869
+ (hh) => hh.command?.includes("factory-welcome") || hh.command?.includes("factory-immutable-guard") || hh.command?.includes("factory-state-advance") || hh.command?.includes("factory-context-monitor") || hh.command?.includes("factory-state-guard")
3863
3870
  )
3864
3871
  );
3865
3872
  if (settings.hooks[event].length === 0) delete settings.hooks[event];
3866
3873
  }
3867
3874
  }
3875
+ if (!settings.hooks.SessionStart) settings.hooks.SessionStart = [];
3876
+ settings.hooks.SessionStart.unshift(welcomeHook);
3877
+ if (!settings.hooks.PreToolUse) settings.hooks.PreToolUse = [];
3878
+ settings.hooks.PreToolUse.unshift(immutableGuardHook);
3868
3879
  if (!settings.hooks.PostToolUse) settings.hooks.PostToolUse = [];
3869
3880
  settings.hooks.PostToolUse.unshift(stateAdvanceHook);
3870
3881
  if (!settings.hooks.UserPromptSubmit) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dlw-machine-setup",
3
- "version": "0.5.7",
3
+ "version": "0.5.8",
4
4
  "description": "One-shot installer for The Machine toolchain",
5
5
  "bin": {
6
6
  "dlw-machine-setup": "bin/installer.js"