@hasna/hooks 0.0.1 → 0.0.3

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 (64) hide show
  1. package/.hooks/index.ts +6 -0
  2. package/bin/index.js +1 -1
  3. package/dist/index.js +366 -0
  4. package/hooks/hook-agentmessages/bin/cli.ts +125 -0
  5. package/package.json +2 -2
  6. package/hooks/hook-agentmessages/src/check-messages.ts +0 -151
  7. package/hooks/hook-agentmessages/src/install.ts +0 -126
  8. package/hooks/hook-agentmessages/src/session-start.ts +0 -255
  9. package/hooks/hook-agentmessages/src/uninstall.ts +0 -89
  10. package/hooks/hook-branchprotect/src/cli.ts +0 -126
  11. package/hooks/hook-branchprotect/src/hook.ts +0 -88
  12. package/hooks/hook-branchprotect/tsconfig.json +0 -25
  13. package/hooks/hook-checkbugs/src/cli.ts +0 -628
  14. package/hooks/hook-checkbugs/src/hook.ts +0 -335
  15. package/hooks/hook-checkbugs/tsconfig.json +0 -15
  16. package/hooks/hook-checkdocs/src/cli.ts +0 -628
  17. package/hooks/hook-checkdocs/src/hook.ts +0 -310
  18. package/hooks/hook-checkdocs/tsconfig.json +0 -15
  19. package/hooks/hook-checkfiles/src/cli.ts +0 -545
  20. package/hooks/hook-checkfiles/src/hook.ts +0 -321
  21. package/hooks/hook-checkfiles/tsconfig.json +0 -15
  22. package/hooks/hook-checklint/src/cli-patch.ts +0 -32
  23. package/hooks/hook-checklint/src/cli.ts +0 -667
  24. package/hooks/hook-checklint/src/hook.ts +0 -473
  25. package/hooks/hook-checklint/tsconfig.json +0 -15
  26. package/hooks/hook-checkpoint/src/cli.ts +0 -191
  27. package/hooks/hook-checkpoint/src/hook.ts +0 -207
  28. package/hooks/hook-checkpoint/tsconfig.json +0 -25
  29. package/hooks/hook-checksecurity/src/cli.ts +0 -601
  30. package/hooks/hook-checksecurity/src/hook.ts +0 -334
  31. package/hooks/hook-checksecurity/tsconfig.json +0 -15
  32. package/hooks/hook-checktasks/src/cli.ts +0 -578
  33. package/hooks/hook-checktasks/src/hook.ts +0 -308
  34. package/hooks/hook-checktasks/tsconfig.json +0 -20
  35. package/hooks/hook-checktests/src/cli.ts +0 -627
  36. package/hooks/hook-checktests/src/hook.ts +0 -334
  37. package/hooks/hook-checktests/tsconfig.json +0 -15
  38. package/hooks/hook-contextrefresh/src/cli.ts +0 -152
  39. package/hooks/hook-contextrefresh/src/hook.ts +0 -148
  40. package/hooks/hook-contextrefresh/tsconfig.json +0 -25
  41. package/hooks/hook-gitguard/src/cli.ts +0 -159
  42. package/hooks/hook-gitguard/src/hook.ts +0 -129
  43. package/hooks/hook-gitguard/tsconfig.json +0 -25
  44. package/hooks/hook-packageage/src/cli.ts +0 -165
  45. package/hooks/hook-packageage/src/hook.ts +0 -177
  46. package/hooks/hook-packageage/tsconfig.json +0 -25
  47. package/hooks/hook-phonenotify/src/cli.ts +0 -196
  48. package/hooks/hook-phonenotify/src/hook.ts +0 -139
  49. package/hooks/hook-phonenotify/tsconfig.json +0 -25
  50. package/hooks/hook-precompact/src/cli.ts +0 -168
  51. package/hooks/hook-precompact/src/hook.ts +0 -122
  52. package/hooks/hook-precompact/tsconfig.json +0 -25
  53. package/src/cli/components/App.tsx +0 -191
  54. package/src/cli/components/CategorySelect.tsx +0 -37
  55. package/src/cli/components/DataTable.tsx +0 -133
  56. package/src/cli/components/Header.tsx +0 -18
  57. package/src/cli/components/HookSelect.tsx +0 -29
  58. package/src/cli/components/InstallProgress.tsx +0 -105
  59. package/src/cli/components/SearchView.tsx +0 -86
  60. package/src/cli/index.tsx +0 -218
  61. package/src/index.ts +0 -31
  62. package/src/lib/installer.ts +0 -288
  63. package/src/lib/registry.ts +0 -205
  64. package/tsconfig.json +0 -17
@@ -1,205 +0,0 @@
1
- /**
2
- * Hook registry - metadata about all available hooks
3
- */
4
-
5
- export interface HookMeta {
6
- name: string;
7
- displayName: string;
8
- description: string;
9
- version: string;
10
- category: string;
11
- event: "PreToolUse" | "PostToolUse" | "Stop" | "Notification";
12
- matcher: string;
13
- tags: string[];
14
- }
15
-
16
- export const CATEGORIES = [
17
- "Git Safety",
18
- "Code Quality",
19
- "Security",
20
- "Notifications",
21
- "Context Management",
22
- ] as const;
23
-
24
- export type Category = (typeof CATEGORIES)[number];
25
-
26
- export const HOOKS: HookMeta[] = [
27
- // Git Safety
28
- {
29
- name: "gitguard",
30
- displayName: "Git Guard",
31
- description: "Blocks destructive git operations like reset --hard, push --force, clean -f",
32
- version: "0.1.0",
33
- category: "Git Safety",
34
- event: "PreToolUse",
35
- matcher: "Bash",
36
- tags: ["git", "safety", "destructive", "guard"],
37
- },
38
- {
39
- name: "branchprotect",
40
- displayName: "Branch Protect",
41
- description: "Prevents editing files directly on main/master branch",
42
- version: "0.1.0",
43
- category: "Git Safety",
44
- event: "PreToolUse",
45
- matcher: "Write|Edit|NotebookEdit",
46
- tags: ["git", "branch", "protection", "main"],
47
- },
48
- {
49
- name: "checkpoint",
50
- displayName: "Checkpoint",
51
- description: "Creates shadow git snapshots before file modifications for easy rollback",
52
- version: "0.1.0",
53
- category: "Git Safety",
54
- event: "PreToolUse",
55
- matcher: "Write|Edit|NotebookEdit",
56
- tags: ["git", "snapshot", "rollback", "backup"],
57
- },
58
-
59
- // Code Quality
60
- {
61
- name: "checktests",
62
- displayName: "Check Tests",
63
- description: "Checks for missing tests after file edits",
64
- version: "0.1.6",
65
- category: "Code Quality",
66
- event: "PostToolUse",
67
- matcher: "Edit|Write|NotebookEdit",
68
- tags: ["tests", "coverage", "quality"],
69
- },
70
- {
71
- name: "checklint",
72
- displayName: "Check Lint",
73
- description: "Runs linting after file edits and creates tasks for errors",
74
- version: "0.1.7",
75
- category: "Code Quality",
76
- event: "PostToolUse",
77
- matcher: "Edit|Write|NotebookEdit",
78
- tags: ["lint", "style", "quality"],
79
- },
80
- {
81
- name: "checkfiles",
82
- displayName: "Check Files",
83
- description: "Runs headless agent to review files and create tasks",
84
- version: "0.1.4",
85
- category: "Code Quality",
86
- event: "PostToolUse",
87
- matcher: "Edit|Write|NotebookEdit",
88
- tags: ["review", "files", "quality"],
89
- },
90
- {
91
- name: "checkbugs",
92
- displayName: "Check Bugs",
93
- description: "Checks for bugs via Codex headless agent",
94
- version: "0.1.6",
95
- category: "Code Quality",
96
- event: "PostToolUse",
97
- matcher: "Edit|Write|NotebookEdit",
98
- tags: ["bugs", "analysis", "quality"],
99
- },
100
- {
101
- name: "checkdocs",
102
- displayName: "Check Docs",
103
- description: "Checks for missing documentation and creates tasks",
104
- version: "0.2.1",
105
- category: "Code Quality",
106
- event: "PostToolUse",
107
- matcher: "Edit|Write|NotebookEdit",
108
- tags: ["docs", "documentation", "quality"],
109
- },
110
- {
111
- name: "checktasks",
112
- displayName: "Check Tasks",
113
- description: "Validates task completion and tracks progress",
114
- version: "1.0.8",
115
- category: "Code Quality",
116
- event: "PostToolUse",
117
- matcher: "Edit|Write|NotebookEdit",
118
- tags: ["tasks", "tracking", "quality"],
119
- },
120
-
121
- // Security
122
- {
123
- name: "checksecurity",
124
- displayName: "Check Security",
125
- description: "Runs security checks via Claude and Codex headless agents",
126
- version: "0.1.6",
127
- category: "Security",
128
- event: "PostToolUse",
129
- matcher: "Edit|Write|NotebookEdit",
130
- tags: ["security", "audit", "vulnerabilities"],
131
- },
132
- {
133
- name: "packageage",
134
- displayName: "Package Age",
135
- description: "Checks package age before install to prevent typosquatting",
136
- version: "0.1.1",
137
- category: "Security",
138
- event: "PreToolUse",
139
- matcher: "Bash",
140
- tags: ["npm", "packages", "typosquatting", "supply-chain"],
141
- },
142
-
143
- // Notifications
144
- {
145
- name: "phonenotify",
146
- displayName: "Phone Notify",
147
- description: "Sends push notifications to phone via ntfy.sh",
148
- version: "0.1.0",
149
- category: "Notifications",
150
- event: "Stop",
151
- matcher: "",
152
- tags: ["notification", "phone", "push", "ntfy"],
153
- },
154
- {
155
- name: "agentmessages",
156
- displayName: "Agent Messages",
157
- description: "Inter-agent messaging integration for service-message",
158
- version: "0.1.0",
159
- category: "Notifications",
160
- event: "Stop",
161
- matcher: "",
162
- tags: ["messaging", "agents", "inter-agent"],
163
- },
164
-
165
- // Context Management
166
- {
167
- name: "contextrefresh",
168
- displayName: "Context Refresh",
169
- description: "Re-injects important context every N prompts to prevent drift",
170
- version: "0.1.0",
171
- category: "Context Management",
172
- event: "Notification",
173
- matcher: "",
174
- tags: ["context", "memory", "prompts", "refresh"],
175
- },
176
- {
177
- name: "precompact",
178
- displayName: "Pre-Compact",
179
- description: "Saves session state before context compaction",
180
- version: "0.1.0",
181
- category: "Context Management",
182
- event: "Notification",
183
- matcher: "",
184
- tags: ["context", "compaction", "state", "backup"],
185
- },
186
- ];
187
-
188
- export function getHooksByCategory(category: Category): HookMeta[] {
189
- return HOOKS.filter((h) => h.category === category);
190
- }
191
-
192
- export function searchHooks(query: string): HookMeta[] {
193
- const q = query.toLowerCase();
194
- return HOOKS.filter(
195
- (h) =>
196
- h.name.toLowerCase().includes(q) ||
197
- h.displayName.toLowerCase().includes(q) ||
198
- h.description.toLowerCase().includes(q) ||
199
- h.tags.some((t) => t.includes(q))
200
- );
201
- }
202
-
203
- export function getHook(name: string): HookMeta | undefined {
204
- return HOOKS.find((h) => h.name === name);
205
- }
package/tsconfig.json DELETED
@@ -1,17 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2022",
4
- "module": "ESNext",
5
- "moduleResolution": "bundler",
6
- "esModuleInterop": true,
7
- "strict": true,
8
- "skipLibCheck": true,
9
- "declaration": true,
10
- "outDir": "./dist",
11
- "rootDir": "./src",
12
- "jsx": "react-jsx",
13
- "types": ["bun-types", "react"]
14
- },
15
- "include": ["src/**/*"],
16
- "exclude": ["node_modules", "dist", "bin", "hooks", "temp"]
17
- }