hookloom 1.3.1 → 1.4.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.
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/README.md +1 -1
- package/dist/cli.mjs +2 -2
- package/dist/{command-line-rI6Nk-jn.mjs → command-line-C5c459G4.mjs} +1 -1
- package/dist/dispatcher.mjs +3 -3
- package/dist/examples/default-branch-health.mjs +3 -3
- package/dist/examples/private-reference-guard.mjs +2 -2
- package/dist/{files-CBn-xAo2.mjs → files-BMqdejj8.mjs} +6 -2
- package/dist/{private-references-B0qyQ0dB.mjs → private-references-ncBUpC_g.mjs} +1 -1
- package/dist/{state-Br7wFToE.mjs → state-BcAcEJRr.mjs} +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ codex plugin add hookloom@hookloom
|
|
|
32
32
|
|
|
33
33
|
## The registry
|
|
34
34
|
|
|
35
|
-
The registry is `hookloom/registry.json` in your configuration directory (`~/.config` unless `XDG_CONFIG_HOME` is set, `%APPDATA%` on Windows). `HOOKLOOM_REGISTRY` names another file.
|
|
35
|
+
The registry is `hookloom/registry.json` in your configuration directory (`~/.config` unless `XDG_CONFIG_HOME` is set, `%APPDATA%` on Windows). `HOOKLOOM_REGISTRY` names another file; a leading `~/` there means your home directory, so a settings file shared between machines can set it.
|
|
36
36
|
|
|
37
37
|
```json
|
|
38
38
|
{
|
package/dist/cli.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { accessSync, constants, existsSync, mkdirSync, mkdtempSync, readFileSync
|
|
|
4
4
|
import { delimiter, dirname, extname, isAbsolute, join, resolve } from "node:path";
|
|
5
5
|
import { c as number, d as strictObject, f as string, g as eventContract, l as object, m as unknown, n as array, r as boolean, s as looseObject, t as _enum, u as record$1, v as harnesses } from "./schemas-BDlKVNhe.mjs";
|
|
6
6
|
import { n as isRecord } from "./shell-BWP1aDQb.mjs";
|
|
7
|
-
import { a as registryPath, i as configurationDirectory, r as claudeDirectory, t as atomicWrite } from "./files-
|
|
7
|
+
import { a as registryPath, i as configurationDirectory, r as claudeDirectory, t as atomicWrite } from "./files-BMqdejj8.mjs";
|
|
8
8
|
import { createHash } from "node:crypto";
|
|
9
9
|
import { t as checkRegistry } from "./check-DUtMm88w.mjs";
|
|
10
10
|
import { n as parseRegistry } from "./schema-Dfw94F_X.mjs";
|
|
@@ -13,7 +13,7 @@ import { execFile, spawn } from "node:child_process";
|
|
|
13
13
|
import { createInterface } from "node:readline";
|
|
14
14
|
import { homedir, tmpdir } from "node:os";
|
|
15
15
|
import { once } from "node:events";
|
|
16
|
-
import { n as invocation, r as version, t as claudeUsesPowerShell } from "./command-line-
|
|
16
|
+
import { n as invocation, r as version, t as claudeUsesPowerShell } from "./command-line-C5c459G4.mjs";
|
|
17
17
|
// src/examples/catalogue.ts
|
|
18
18
|
const BOTH = ["claude", "codex"];
|
|
19
19
|
const LOCAL_SECONDS = 10;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
2
|
import { delimiter, join } from "node:path";
|
|
3
3
|
// src/version.ts
|
|
4
|
-
const version = "1.
|
|
4
|
+
const version = "1.4.0";
|
|
5
5
|
// src/dispatch/command-line.ts
|
|
6
6
|
/**
|
|
7
7
|
* The program and arguments with which each harness runs a command hook on each platform.
|
package/dist/dispatcher.mjs
CHANGED
|
@@ -3,11 +3,11 @@ import { g as eventContract, v as harnesses } from "./schemas-BDlKVNhe.mjs";
|
|
|
3
3
|
import { closeSync, existsSync, fstatSync, globSync, openSync, readFileSync, readSync, readdirSync, rmSync, statSync } from "node:fs";
|
|
4
4
|
import { homedir } from "node:os";
|
|
5
5
|
import { dirname, join, resolve } from "node:path";
|
|
6
|
-
import { a as registryPath, n as cacheDirectory, r as claudeDirectory, t as atomicWrite } from "./files-
|
|
6
|
+
import { a as registryPath, n as cacheDirectory, r as claudeDirectory, t as atomicWrite } from "./files-BMqdejj8.mjs";
|
|
7
7
|
import { createHash } from "node:crypto";
|
|
8
8
|
import { a as stringField, i as parsePayload, n as isRecord, o as toolInput, r as namedField } from "./shell-BWP1aDQb.mjs";
|
|
9
|
-
import { n as invocation, r as version } from "./command-line-
|
|
10
|
-
import { a as sessionKey, i as removeOlderThan, n as readRecord, o as writeRecord, r as records, t as digest } from "./state-
|
|
9
|
+
import { n as invocation, r as version } from "./command-line-C5c459G4.mjs";
|
|
10
|
+
import { a as sessionKey, i as removeOlderThan, n as readRecord, o as writeRecord, r as records, t as digest } from "./state-BcAcEJRr.mjs";
|
|
11
11
|
import { spawn } from "node:child_process";
|
|
12
12
|
import { t as withoutHarnessMessages } from "./prompt-text-A_jEvJei.mjs";
|
|
13
13
|
import { t as handlersOf } from "./schema-Dfw94F_X.mjs";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { c as number, f as string, l as object, n as array, p as union } from "../schemas-BDlKVNhe.mjs";
|
|
2
2
|
import { execFileSync } from "node:child_process";
|
|
3
3
|
import { join } from "node:path";
|
|
4
|
-
import { n as readRecord, o as writeRecord, t as digest } from "../state-
|
|
4
|
+
import { n as readRecord, o as writeRecord, t as digest } from "../state-BcAcEJRr.mjs";
|
|
5
5
|
import { a as stringField } from "../shell-BWP1aDQb.mjs";
|
|
6
6
|
import { n as withLock, t as LockedError } from "../lock-8b6urUtv.mjs";
|
|
7
|
-
import { n as cacheDirectory } from "../files-
|
|
7
|
+
import { n as cacheDirectory } from "../files-BMqdejj8.mjs";
|
|
8
8
|
import { i as main, n as context } from "../hook-ClJcbzby.mjs";
|
|
9
|
-
import { o as originRepository } from "../private-references-
|
|
9
|
+
import { o as originRepository } from "../private-references-ncBUpC_g.mjs";
|
|
10
10
|
// src/examples/pressure.ts
|
|
11
11
|
/**
|
|
12
12
|
* Throttles a notice by how much it matters: pressure runs from 0 to 1, derived from a hook's own measurements, and the higher it is the sooner a session is told again.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
import { a as stringField, o as toolInput } from "../shell-BWP1aDQb.mjs";
|
|
4
|
-
import { n as cacheDirectory } from "../files-
|
|
4
|
+
import { n as cacheDirectory } from "../files-BMqdejj8.mjs";
|
|
5
5
|
import { a as shellCommand, i as main, r as deny } from "../hook-ClJcbzby.mjs";
|
|
6
|
-
import { a as gh, i as existingDirectory, n as Lookups, o as originRepository, r as addedPrivateReferences, s as repositoryWrites, t as ESCAPE } from "../private-references-
|
|
6
|
+
import { a as gh, i as existingDirectory, n as Lookups, o as originRepository, r as addedPrivateReferences, s as repositoryWrites, t as ESCAPE } from "../private-references-ncBUpC_g.mjs";
|
|
7
7
|
// src/examples/private-reference-guard.ts
|
|
8
8
|
/**
|
|
9
9
|
* Before a tool call, refuses to put the name of a private repository into a public one, through a file edit, a commit message or a `gh` write. Prefixing the command with `PRIVATE_REF_OK=1` lets a deliberate reference through.
|
|
@@ -14,9 +14,13 @@ function base(env, windows, xdg, fallback) {
|
|
|
14
14
|
function configurationDirectory(env) {
|
|
15
15
|
return join(base(env, "APPDATA", "XDG_CONFIG_HOME", [".config"]), "hookloom");
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
function fromHome(path) {
|
|
18
|
+
return path.startsWith("~/") ? join(homedir(), path.slice(2)) : path;
|
|
19
|
+
}
|
|
20
|
+
/** The registry file: `HOOKLOOM_REGISTRY` when set, where a leading `~/` means the home directory, otherwise `registry.json` in the configuration directory. */
|
|
18
21
|
function registryPath(env) {
|
|
19
|
-
|
|
22
|
+
const named = env["HOOKLOOM_REGISTRY"];
|
|
23
|
+
return named === void 0 ? join(configurationDirectory(env), "registry.json") : fromHome(named);
|
|
20
24
|
}
|
|
21
25
|
/** Cached results and session state, all of which may be deleted at any time: `HOOKLOOM_CACHE_DIR` overrides it. */
|
|
22
26
|
function cacheDirectory(env) {
|
|
@@ -2,7 +2,7 @@ import { execFileSync } from "node:child_process";
|
|
|
2
2
|
import { readFileSync } from "node:fs";
|
|
3
3
|
import { dirname, resolve } from "node:path";
|
|
4
4
|
import { n as isRecord, t as splitCommand } from "./shell-BWP1aDQb.mjs";
|
|
5
|
-
import { t as atomicWrite } from "./files-
|
|
5
|
+
import { t as atomicWrite } from "./files-BMqdejj8.mjs";
|
|
6
6
|
// src/examples/private-references.ts
|
|
7
7
|
/**
|
|
8
8
|
* Finds text going into a public GitHub repository that names a private one.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
import { readFileSync, readdirSync, rmSync, statSync } from "node:fs";
|
|
3
3
|
import { join } from "node:path";
|
|
4
|
-
import { t as atomicWrite } from "./files-
|
|
4
|
+
import { t as atomicWrite } from "./files-BMqdejj8.mjs";
|
|
5
5
|
import { a as stringField, n as isRecord } from "./shell-BWP1aDQb.mjs";
|
|
6
6
|
// src/dispatch/state.ts
|
|
7
7
|
/**
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hookloom",
|
|
3
3
|
"description": "One hook registry for Claude Code and Codex: a plugin that dispatches every lifecycle event to your hooks, with a CLI to set up, migrate and roll back",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.4.0",
|
|
5
5
|
"author": "Joseph Mearman <joseph@mearman.co.uk>",
|
|
6
6
|
"bin": {
|
|
7
|
-
"hookloom": "
|
|
7
|
+
"hookloom": "dist/cli.mjs"
|
|
8
8
|
},
|
|
9
9
|
"devDependencies": {
|
|
10
10
|
"@anthropic-ai/claude-code": "2.1.330",
|