@hasna/hooks 0.1.0 → 0.2.0

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 (111) hide show
  1. package/LICENSE +191 -0
  2. package/README.md +41 -6
  3. package/bin/index.js +138 -102
  4. package/dist/index.js +91 -42
  5. package/hooks/hook-agentmessages/CLAUDE.md +1 -1
  6. package/hooks/hook-agentmessages/LICENSE +191 -21
  7. package/hooks/hook-agentmessages/README.md +3 -3
  8. package/hooks/hook-agentmessages/package.json +5 -5
  9. package/hooks/hook-autoformat/README.md +1 -1
  10. package/hooks/hook-autoformat/package.json +1 -1
  11. package/hooks/hook-autoformat/tsconfig.json +25 -0
  12. package/hooks/hook-autostage/README.md +1 -1
  13. package/hooks/hook-autostage/package.json +1 -1
  14. package/hooks/hook-branchprotect/README.md +2 -2
  15. package/hooks/hook-branchprotect/package.json +4 -4
  16. package/hooks/hook-branchprotect/src/cli.ts +1 -1
  17. package/hooks/hook-branchprotect/tsconfig.json +25 -0
  18. package/hooks/hook-checkbugs/LICENSE +191 -21
  19. package/hooks/hook-checkbugs/README.md +5 -5
  20. package/hooks/hook-checkbugs/package.json +4 -4
  21. package/hooks/hook-checkbugs/src/cli.ts +2 -2
  22. package/hooks/hook-checkbugs/tsconfig.json +15 -0
  23. package/hooks/hook-checkdocs/README.md +5 -5
  24. package/hooks/hook-checkdocs/package.json +4 -4
  25. package/hooks/hook-checkdocs/src/cli.ts +2 -2
  26. package/hooks/hook-checkdocs/tsconfig.json +15 -0
  27. package/hooks/hook-checkfiles/LICENSE +191 -21
  28. package/hooks/hook-checkfiles/README.md +5 -5
  29. package/hooks/hook-checkfiles/package.json +4 -4
  30. package/hooks/hook-checkfiles/src/cli.ts +2 -2
  31. package/hooks/hook-checkfiles/tsconfig.json +15 -0
  32. package/hooks/hook-checklint/LICENSE +191 -21
  33. package/hooks/hook-checklint/README.md +5 -5
  34. package/hooks/hook-checklint/package.json +4 -4
  35. package/hooks/hook-checklint/src/cli.ts +2 -2
  36. package/hooks/hook-checklint/tsconfig.json +15 -0
  37. package/hooks/hook-checkpoint/README.md +2 -2
  38. package/hooks/hook-checkpoint/package.json +4 -4
  39. package/hooks/hook-checkpoint/src/cli.ts +1 -1
  40. package/hooks/hook-checkpoint/tsconfig.json +25 -0
  41. package/hooks/hook-checksecurity/LICENSE +191 -21
  42. package/hooks/hook-checksecurity/README.md +8 -8
  43. package/hooks/hook-checksecurity/package.json +4 -4
  44. package/hooks/hook-checksecurity/src/cli.ts +2 -2
  45. package/hooks/hook-checksecurity/tsconfig.json +15 -0
  46. package/hooks/hook-checktasks/README.md +5 -5
  47. package/hooks/hook-checktasks/package.json +4 -4
  48. package/hooks/hook-checktasks/src/cli.ts +2 -2
  49. package/hooks/hook-checktasks/tsconfig.json +20 -0
  50. package/hooks/hook-checktests/LICENSE +191 -21
  51. package/hooks/hook-checktests/README.md +5 -5
  52. package/hooks/hook-checktests/package.json +4 -4
  53. package/hooks/hook-checktests/src/cli.ts +2 -2
  54. package/hooks/hook-checktests/tsconfig.json +15 -0
  55. package/hooks/hook-commandlog/README.md +1 -1
  56. package/hooks/hook-commandlog/package.json +1 -1
  57. package/hooks/hook-contextrefresh/README.md +2 -2
  58. package/hooks/hook-contextrefresh/package.json +4 -4
  59. package/hooks/hook-contextrefresh/src/cli.ts +1 -1
  60. package/hooks/hook-contextrefresh/tsconfig.json +25 -0
  61. package/hooks/hook-costwatch/README.md +1 -1
  62. package/hooks/hook-costwatch/package.json +1 -1
  63. package/hooks/hook-desktopnotify/README.md +1 -1
  64. package/hooks/hook-desktopnotify/package.json +1 -1
  65. package/hooks/hook-desktopnotify/tsconfig.json +25 -0
  66. package/hooks/hook-envsetup/README.md +1 -1
  67. package/hooks/hook-envsetup/package.json +1 -1
  68. package/hooks/hook-envsetup/tsconfig.json +25 -0
  69. package/hooks/hook-errornotify/README.md +1 -1
  70. package/hooks/hook-errornotify/package.json +1 -1
  71. package/hooks/hook-gitguard/README.md +2 -2
  72. package/hooks/hook-gitguard/package.json +4 -4
  73. package/hooks/hook-gitguard/src/cli.ts +1 -1
  74. package/hooks/hook-gitguard/tsconfig.json +25 -0
  75. package/hooks/hook-packageage/README.md +2 -2
  76. package/hooks/hook-packageage/package.json +4 -4
  77. package/hooks/hook-packageage/src/cli.ts +1 -1
  78. package/hooks/hook-packageage/tsconfig.json +25 -0
  79. package/hooks/hook-permissionguard/README.md +1 -1
  80. package/hooks/hook-permissionguard/package.json +1 -1
  81. package/hooks/hook-permissionguard/tsconfig.json +25 -0
  82. package/hooks/hook-phonenotify/README.md +2 -2
  83. package/hooks/hook-phonenotify/package.json +4 -4
  84. package/hooks/hook-phonenotify/src/cli.ts +1 -1
  85. package/hooks/hook-phonenotify/tsconfig.json +25 -0
  86. package/hooks/hook-precompact/README.md +2 -2
  87. package/hooks/hook-precompact/package.json +4 -4
  88. package/hooks/hook-precompact/src/cli.ts +1 -1
  89. package/hooks/hook-precompact/tsconfig.json +25 -0
  90. package/hooks/hook-promptguard/README.md +1 -1
  91. package/hooks/hook-promptguard/package.json +1 -1
  92. package/hooks/hook-protectfiles/README.md +1 -1
  93. package/hooks/hook-protectfiles/package.json +1 -1
  94. package/hooks/hook-protectfiles/tsconfig.json +25 -0
  95. package/hooks/hook-sessionlog/README.md +1 -1
  96. package/hooks/hook-sessionlog/package.json +1 -1
  97. package/hooks/hook-slacknotify/README.md +1 -1
  98. package/hooks/hook-slacknotify/package.json +1 -1
  99. package/hooks/hook-soundnotify/README.md +1 -1
  100. package/hooks/hook-soundnotify/package.json +1 -1
  101. package/hooks/hook-taskgate/README.md +1 -1
  102. package/hooks/hook-taskgate/package.json +1 -1
  103. package/hooks/hook-tddguard/README.md +1 -1
  104. package/hooks/hook-tddguard/package.json +1 -1
  105. package/package.json +18 -4
  106. package/.claude/settings.json +0 -24
  107. package/.npmrc.example +0 -2
  108. package/AGENTS.md +0 -54
  109. package/CLAUDE.md +0 -70
  110. package/CONTRIBUTING.md +0 -45
  111. package/hooks/hook-agentmessages/bin/cli.ts +0 -125
package/dist/index.js CHANGED
@@ -76,7 +76,7 @@ var HOOKS = [
76
76
  {
77
77
  name: "checkbugs",
78
78
  displayName: "Check Bugs",
79
- description: "Checks for bugs via Codex headless agent",
79
+ description: "Checks for bugs via headless agent",
80
80
  version: "0.1.6",
81
81
  category: "Code Quality",
82
82
  event: "PostToolUse",
@@ -106,7 +106,7 @@ var HOOKS = [
106
106
  {
107
107
  name: "checksecurity",
108
108
  displayName: "Check Security",
109
- description: "Runs security checks via Claude and Codex headless agents",
109
+ description: "Runs security checks via headless agents",
110
110
  version: "0.1.6",
111
111
  category: "Security",
112
112
  event: "PostToolUse",
@@ -331,30 +331,60 @@ import { homedir } from "os";
331
331
  import { fileURLToPath } from "url";
332
332
  var __dirname2 = dirname(fileURLToPath(import.meta.url));
333
333
  var HOOKS_DIR = existsSync(join(__dirname2, "..", "..", "hooks", "hook-gitguard")) ? join(__dirname2, "..", "..", "hooks") : join(__dirname2, "..", "hooks");
334
- function getSettingsPath(scope = "global") {
334
+ function normalizeHookName(name) {
335
+ return name.startsWith("hook-") ? name : `hook-${name}`;
336
+ }
337
+ function shortHookName(name) {
338
+ return normalizeHookName(name).replace("hook-", "");
339
+ }
340
+ function removeHookEntries(entries, hookCommand) {
341
+ return entries.filter((entry) => !entry.hooks?.some((h) => h.command === hookCommand));
342
+ }
343
+ var EVENT_MAP = {
344
+ claude: {
345
+ PreToolUse: "PreToolUse",
346
+ PostToolUse: "PostToolUse",
347
+ Stop: "Stop",
348
+ Notification: "Notification"
349
+ },
350
+ gemini: {
351
+ PreToolUse: "BeforeTool",
352
+ PostToolUse: "AfterTool",
353
+ Stop: "AfterAgent",
354
+ Notification: "Notification"
355
+ }
356
+ };
357
+ function getTargetSettingsDir(target) {
358
+ if (target === "gemini")
359
+ return ".gemini";
360
+ return ".claude";
361
+ }
362
+ function getSettingsPath(scope = "global", target = "claude") {
363
+ const dir = getTargetSettingsDir(target);
335
364
  if (scope === "project") {
336
- return join(process.cwd(), ".claude", "settings.json");
365
+ return join(process.cwd(), dir, "settings.json");
337
366
  }
338
- return join(homedir(), ".claude", "settings.json");
367
+ return join(homedir(), dir, "settings.json");
339
368
  }
340
369
  function getHookPath(name) {
341
- const hookName = name.startsWith("hook-") ? name : `hook-${name}`;
342
- return join(HOOKS_DIR, hookName);
370
+ return join(HOOKS_DIR, normalizeHookName(name));
343
371
  }
344
372
  function hookExists(name) {
345
373
  return existsSync(getHookPath(name));
346
374
  }
347
- function readSettings(scope = "global") {
348
- const path = getSettingsPath(scope);
375
+ function readSettings(scope = "global", target = "claude") {
376
+ const path = getSettingsPath(scope, target);
349
377
  try {
350
378
  if (existsSync(path)) {
351
379
  return JSON.parse(readFileSync(path, "utf-8"));
352
380
  }
353
- } catch {}
381
+ } catch (error) {
382
+ console.warn(`[hooks] Failed to read settings at ${path}: ${error instanceof Error ? error.message : String(error)}`);
383
+ }
354
384
  return {};
355
385
  }
356
- function writeSettings(settings, scope = "global") {
357
- const path = getSettingsPath(scope);
386
+ function writeSettings(settings, scope = "global", target = "claude") {
387
+ const path = getSettingsPath(scope, target);
358
388
  const dir = dirname(path);
359
389
  if (!existsSync(dir)) {
360
390
  mkdirSync(dir, { recursive: true });
@@ -362,40 +392,51 @@ function writeSettings(settings, scope = "global") {
362
392
  writeFileSync(path, JSON.stringify(settings, null, 2) + `
363
393
  `);
364
394
  }
365
- function installHook(name, options = {}) {
366
- const { scope = "global", overwrite = false } = options;
367
- const hookName = name.startsWith("hook-") ? name : `hook-${name}`;
368
- const shortName = hookName.replace("hook-", "");
395
+ function getTargetEventName(internalEvent, target) {
396
+ return EVENT_MAP[target]?.[internalEvent] || internalEvent;
397
+ }
398
+ function installForTarget(name, scope, overwrite, target) {
399
+ const shortName = shortHookName(name);
369
400
  if (!hookExists(shortName)) {
370
- return { hook: shortName, success: false, error: `Hook '${shortName}' not found` };
401
+ return { hook: shortName, success: false, error: `Hook '${shortName}' not found`, target };
371
402
  }
372
- const registered = getRegisteredHooks(scope);
403
+ const registered = getRegisteredHooksForTarget(scope, target);
373
404
  if (registered.includes(shortName) && !overwrite) {
374
- return { hook: shortName, success: false, error: "Already installed. Use --overwrite to replace.", scope };
405
+ return { hook: shortName, success: false, error: "Already installed. Use --overwrite to replace.", scope, target };
375
406
  }
376
407
  try {
377
- registerHook(shortName, scope);
378
- return { hook: shortName, success: true, scope };
408
+ registerHook(shortName, scope, target);
409
+ return { hook: shortName, success: true, scope, target };
379
410
  } catch (error) {
380
411
  return {
381
412
  hook: shortName,
382
413
  success: false,
383
- error: error instanceof Error ? error.message : "Unknown error"
414
+ error: error instanceof Error ? error.message : "Unknown error",
415
+ target
384
416
  };
385
417
  }
386
418
  }
387
- function registerHook(name, scope = "global") {
419
+ function installHook(name, options = {}) {
420
+ const { scope = "global", overwrite = false, target = "claude" } = options;
421
+ if (target === "all") {
422
+ const claudeResult = installForTarget(name, scope, overwrite, "claude");
423
+ installForTarget(name, scope, overwrite, "gemini");
424
+ return { ...claudeResult, target: "all" };
425
+ }
426
+ return installForTarget(name, scope, overwrite, target);
427
+ }
428
+ function registerHook(name, scope = "global", target = "claude") {
388
429
  const meta = getHook(name);
389
430
  if (!meta)
390
431
  return;
391
- const settings = readSettings(scope);
432
+ const settings = readSettings(scope, target);
392
433
  if (!settings.hooks)
393
434
  settings.hooks = {};
394
- const eventKey = meta.event;
435
+ const eventKey = getTargetEventName(meta.event, target);
395
436
  if (!settings.hooks[eventKey])
396
437
  settings.hooks[eventKey] = [];
397
438
  const hookCommand = `hooks run ${name}`;
398
- settings.hooks[eventKey] = settings.hooks[eventKey].filter((entry2) => !entry2.hooks?.some((h) => h.command === hookCommand));
439
+ settings.hooks[eventKey] = removeHookEntries(settings.hooks[eventKey], hookCommand);
399
440
  const entry = {
400
441
  hooks: [{ type: "command", command: hookCommand }]
401
442
  };
@@ -403,33 +444,33 @@ function registerHook(name, scope = "global") {
403
444
  entry.matcher = meta.matcher;
404
445
  }
405
446
  settings.hooks[eventKey].push(entry);
406
- writeSettings(settings, scope);
447
+ writeSettings(settings, scope, target);
407
448
  }
408
- function unregisterHook(name, scope = "global") {
449
+ function unregisterHook(name, scope = "global", target = "claude") {
409
450
  const meta = getHook(name);
410
451
  if (!meta)
411
452
  return;
412
- const settings = readSettings(scope);
453
+ const settings = readSettings(scope, target);
413
454
  if (!settings.hooks)
414
455
  return;
415
- const eventKey = meta.event;
456
+ const eventKey = getTargetEventName(meta.event, target);
416
457
  if (!settings.hooks[eventKey])
417
458
  return;
418
459
  const hookCommand = `hooks run ${name}`;
419
- settings.hooks[eventKey] = settings.hooks[eventKey].filter((entry) => !entry.hooks?.some((h) => h.command === hookCommand));
460
+ settings.hooks[eventKey] = removeHookEntries(settings.hooks[eventKey], hookCommand);
420
461
  if (settings.hooks[eventKey].length === 0) {
421
462
  delete settings.hooks[eventKey];
422
463
  }
423
464
  if (Object.keys(settings.hooks).length === 0) {
424
465
  delete settings.hooks;
425
466
  }
426
- writeSettings(settings, scope);
467
+ writeSettings(settings, scope, target);
427
468
  }
428
469
  function installHooks(names, options = {}) {
429
470
  return names.map((name) => installHook(name, options));
430
471
  }
431
- function getRegisteredHooks(scope = "global") {
432
- const settings = readSettings(scope);
472
+ function getRegisteredHooksForTarget(scope = "global", target = "claude") {
473
+ const settings = readSettings(scope, target);
433
474
  if (!settings.hooks)
434
475
  return [];
435
476
  const registered = [];
@@ -447,17 +488,25 @@ function getRegisteredHooks(scope = "global") {
447
488
  }
448
489
  return [...new Set(registered)];
449
490
  }
450
- function getInstalledHooks(scope = "global") {
451
- return getRegisteredHooks(scope);
491
+ function getRegisteredHooks(scope = "global") {
492
+ return getRegisteredHooksForTarget(scope, "claude");
493
+ }
494
+ var getInstalledHooks = getRegisteredHooks;
495
+ function removeHook(name, scope = "global", target = "claude") {
496
+ const shortName = shortHookName(name);
497
+ if (target === "all") {
498
+ const claudeRemoved = removeHookForTarget(shortName, scope, "claude");
499
+ const geminiRemoved = removeHookForTarget(shortName, scope, "gemini");
500
+ return claudeRemoved || geminiRemoved;
501
+ }
502
+ return removeHookForTarget(shortName, scope, target);
452
503
  }
453
- function removeHook(name, scope = "global") {
454
- const hookName = name.startsWith("hook-") ? name : `hook-${name}`;
455
- const shortName = hookName.replace("hook-", "");
456
- const registered = getRegisteredHooks(scope);
457
- if (!registered.includes(shortName)) {
504
+ function removeHookForTarget(name, scope, target) {
505
+ const registered = getRegisteredHooksForTarget(scope, target);
506
+ if (!registered.includes(name)) {
458
507
  return false;
459
508
  }
460
- unregisterHook(shortName, scope);
509
+ unregisterHook(name, scope, target);
461
510
  return true;
462
511
  }
463
512
  export {
@@ -6,7 +6,7 @@ Instructions for working with hook-agentmessages codebase.
6
6
 
7
7
  **hook-agentmessages** is a Claude Code hook package that integrates with service-message for automatic agent registration and message notifications.
8
8
 
9
- - **Package:** `@hasnaxyz/hook-agentmessages`
9
+ - **Package:** `@hasna/hook-agentmessages`
10
10
  - **CLI command:** `hook-agentmessages`
11
11
  - **Hooks location:** `~/.claude/settings.json`
12
12
 
@@ -1,21 +1,191 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Hasna
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to the Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by the Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding any notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ Copyright 2025 Hasna
180
+
181
+ Licensed under the Apache License, Version 2.0 (the "License");
182
+ you may not use this file except in compliance with the License.
183
+ You may obtain a copy of the License at
184
+
185
+ http://www.apache.org/licenses/LICENSE-2.0
186
+
187
+ Unless required by applicable law or agreed to in writing, software
188
+ distributed under the License is distributed on an "AS IS" BASIS,
189
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
190
+ See the License for the specific language governing permissions and
191
+ limitations under the License.
@@ -8,7 +8,7 @@ Automatically registers projects and sessions when Claude Code starts, and check
8
8
 
9
9
  ```bash
10
10
  # Install globally
11
- bun install -g @hasnaxyz/hook-agentmessages
11
+ bun install -g @hasna/hook-agentmessages
12
12
 
13
13
  # Install hooks into Claude Code
14
14
  hook-agentmessages install
@@ -99,9 +99,9 @@ The hook is designed to be lightweight:
99
99
  ## Requirements
100
100
 
101
101
  - Bun runtime
102
- - service-message (`@hasnaxyz/service-message`) installed and initialized
102
+ - service-message (`@hasna/service-message`) installed and initialized
103
103
  - Claude Code with hooks support
104
104
 
105
105
  ## License
106
106
 
107
- MIT
107
+ Apache-2.0
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "@hasnaxyz/hook-agentmessages",
2
+ "name": "@hasna/hook-agentmessages",
3
3
  "version": "0.2.1",
4
4
  "type": "module",
5
5
  "description": "Claude Code hook for service-message integration - auto-registers agents, sessions, and checks messages",
@@ -8,11 +8,11 @@
8
8
  },
9
9
  "repository": {
10
10
  "type": "git",
11
- "url": "git+https://github.com/hasnaxyz/hook-agentmessages.git"
11
+ "url": "git+https://github.com/hasna/hooks.git"
12
12
  },
13
- "homepage": "https://github.com/hasnaxyz/hook-agentmessages#readme",
13
+ "homepage": "https://github.com/hasna/hooks#readme",
14
14
  "publishConfig": {
15
- "access": "restricted",
15
+ "access": "public",
16
16
  "registry": "https://registry.npmjs.org/"
17
17
  },
18
18
  "scripts": {
@@ -27,5 +27,5 @@
27
27
  "typescript": "^5.7.2"
28
28
  },
29
29
  "author": "Hasna",
30
- "license": "MIT"
30
+ "license": "Apache-2.0"
31
31
  }
@@ -36,4 +36,4 @@ If both Biome and Prettier configs exist, Biome takes priority (it's faster).
36
36
 
37
37
  ## License
38
38
 
39
- MIT
39
+ Apache-2.0
@@ -37,7 +37,7 @@
37
37
  "cli"
38
38
  ],
39
39
  "author": "Hasna",
40
- "license": "MIT",
40
+ "license": "Apache-2.0",
41
41
  "repository": {
42
42
  "type": "git",
43
43
  "url": "https://github.com/hasna/open-hooks.git"
@@ -0,0 +1,25 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ESNext",
4
+ "module": "ESNext",
5
+ "lib": ["ESNext"],
6
+ "moduleResolution": "bundler",
7
+ "allowImportingTsExtensions": true,
8
+ "strict": true,
9
+ "esModuleInterop": true,
10
+ "skipLibCheck": true,
11
+ "forceConsistentCasingInFileNames": true,
12
+ "resolveJsonModule": true,
13
+ "isolatedModules": true,
14
+ "noEmit": true,
15
+ "noUnusedLocals": true,
16
+ "noUnusedParameters": true,
17
+ "declaration": true,
18
+ "declarationMap": true,
19
+ "outDir": "./dist",
20
+ "rootDir": "./src",
21
+ "types": ["bun-types"]
22
+ },
23
+ "include": ["src/**/*"],
24
+ "exclude": ["node_modules", "dist"]
25
+ }
@@ -67,4 +67,4 @@ Activity is logged to stderr:
67
67
 
68
68
  ## License
69
69
 
70
- MIT
70
+ Apache-2.0
@@ -8,5 +8,5 @@
8
8
  "typecheck": "tsc --noEmit"
9
9
  },
10
10
  "author": "Hasna",
11
- "license": "MIT"
11
+ "license": "Apache-2.0"
12
12
  }
@@ -9,7 +9,7 @@ Forces a feature branch workflow by blocking all Write/Edit/NotebookEdit operati
9
9
  ## Installation
10
10
 
11
11
  ```bash
12
- bun install -g @hasnaxyz/hook-branchprotect
12
+ bun install -g @hasna/hook-branchprotect
13
13
  hook-branchprotect install
14
14
  ```
15
15
 
@@ -22,4 +22,4 @@ hook-branchprotect install
22
22
 
23
23
  ## License
24
24
 
25
- MIT
25
+ Apache-2.0
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "@hasnaxyz/hook-branchprotect",
2
+ "name": "@hasna/hook-branchprotect",
3
3
  "version": "0.1.0",
4
4
  "description": "Claude Code hook that prevents editing files on main/master branch",
5
5
  "type": "module",
@@ -24,13 +24,13 @@
24
24
  },
25
25
  "keywords": ["claude-code", "claude", "hook", "branch", "protection", "git", "cli"],
26
26
  "author": "Hasna",
27
- "license": "MIT",
27
+ "license": "Apache-2.0",
28
28
  "repository": {
29
29
  "type": "git",
30
- "url": "https://github.com/hasnaxyz/hook-branchprotect.git"
30
+ "url": "https://github.com/hasna/hooks.git"
31
31
  },
32
32
  "publishConfig": {
33
- "access": "restricted",
33
+ "access": "public",
34
34
  "registry": "https://registry.npmjs.org/"
35
35
  },
36
36
  "engines": { "node": ">=18", "bun": ">=1.0" },
@@ -52,7 +52,7 @@ function install(): void {
52
52
 
53
53
  settings.hooks.PreToolUse.push({
54
54
  matcher: "Write|Edit|NotebookEdit",
55
- hooks: [{ type: "command", command: `bunx @hasnaxyz/${HOOK_NAME}` }],
55
+ hooks: [{ type: "command", command: `bunx @hasna/${HOOK_NAME}` }],
56
56
  });
57
57
 
58
58
  writeSettings(settings);
@@ -0,0 +1,25 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ESNext",
4
+ "module": "ESNext",
5
+ "lib": ["ESNext"],
6
+ "moduleResolution": "bundler",
7
+ "allowImportingTsExtensions": true,
8
+ "strict": true,
9
+ "esModuleInterop": true,
10
+ "skipLibCheck": true,
11
+ "forceConsistentCasingInFileNames": true,
12
+ "resolveJsonModule": true,
13
+ "isolatedModules": true,
14
+ "noEmit": true,
15
+ "noUnusedLocals": true,
16
+ "noUnusedParameters": true,
17
+ "declaration": true,
18
+ "declarationMap": true,
19
+ "outDir": "./dist",
20
+ "rootDir": "./src",
21
+ "types": ["bun-types"]
22
+ },
23
+ "include": ["src/**/*"],
24
+ "exclude": ["node_modules", "dist"]
25
+ }