hookloom 1.2.0 → 1.3.1
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/dist/{check-CRZ6Rgdo.mjs → check-DUtMm88w.mjs} +3 -3
- package/dist/check-fL0W2EGm.mjs +1 -0
- package/dist/cli.mjs +21 -6
- package/dist/{command-line-OrJYMqHx.mjs → command-line-rI6Nk-jn.mjs} +1 -1
- package/dist/dispatcher.mjs +7 -7
- package/dist/examples/blocked-fetch.mjs +2 -2
- package/dist/examples/browser-close.mjs +2 -2
- package/dist/examples/dash-guard.mjs +2 -2
- package/dist/examples/default-branch-health.mjs +5 -5
- package/dist/examples/dewrap.mjs +973 -0
- package/dist/examples/github-rate-limit.mjs +5 -3
- package/dist/examples/issue-comment-guard.mjs +3 -3
- package/dist/examples/private-reference-guard.mjs +3 -3
- package/dist/examples/repository-metadata.mjs +1 -1
- package/dist/{hook-DIS0wk_5.mjs → hook-ClJcbzby.mjs} +2 -2
- package/dist/{permission-rule-BVXyOtut.mjs → permission-rule-BxFEjGo0.mjs} +1 -1
- package/dist/{private-references-CUZqASjK.mjs → private-references-B0qyQ0dB.mjs} +2 -2
- package/dist/{schema-EYih4WFo.mjs → schema-ByVW3IRJ.mjs} +1 -1
- package/dist/{schema-Dl9EJYyt.mjs → schema-Dfw94F_X.mjs} +1 -2
- package/dist/{schemas-B4KRDIno.mjs → schemas-BDlKVNhe.mjs} +132 -1
- package/dist/{shell-4WSaabze.mjs → shell-BWP1aDQb.mjs} +67 -2
- package/dist/{state-Db3zojdV.mjs → state-Br7wFToE.mjs} +1 -1
- package/package.json +1 -1
- package/dist/check-ySa9Ce1V.mjs +0 -1
- package/dist/events-CHsq0Cl4.mjs +0 -132
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as permissionRuleProblem } from "./permission-rule-
|
|
2
|
-
import {
|
|
3
|
-
import { t as handlersOf } from "./schema-
|
|
1
|
+
import { r as permissionRuleProblem } from "./permission-rule-BxFEjGo0.mjs";
|
|
2
|
+
import { g as eventContract, v as harnesses } from "./schemas-BDlKVNhe.mjs";
|
|
3
|
+
import { t as handlersOf } from "./schema-Dfw94F_X.mjs";
|
|
4
4
|
// src/registry/check.ts
|
|
5
5
|
/**
|
|
6
6
|
* The rules a registry must meet for a harness to be able to run it, beyond its shape.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as checkRegistry } from "./check-DUtMm88w.mjs";
|
package/dist/cli.mjs
CHANGED
|
@@ -2,19 +2,18 @@
|
|
|
2
2
|
import { isDeepStrictEqual, parseArgs } from "node:util";
|
|
3
3
|
import { accessSync, constants, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
4
4
|
import { delimiter, dirname, extname, isAbsolute, join, resolve } from "node:path";
|
|
5
|
-
import { r as
|
|
6
|
-
import { n as isRecord } from "./shell-
|
|
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
|
+
import { n as isRecord } from "./shell-BWP1aDQb.mjs";
|
|
7
7
|
import { a as registryPath, i as configurationDirectory, r as claudeDirectory, t as atomicWrite } from "./files-CBn-xAo2.mjs";
|
|
8
8
|
import { createHash } from "node:crypto";
|
|
9
|
-
import { t as checkRegistry } from "./check-
|
|
10
|
-
import {
|
|
11
|
-
import { n as parseRegistry } from "./schema-Dl9EJYyt.mjs";
|
|
9
|
+
import { t as checkRegistry } from "./check-DUtMm88w.mjs";
|
|
10
|
+
import { n as parseRegistry } from "./schema-Dfw94F_X.mjs";
|
|
12
11
|
import { n as withLock } from "./lock-8b6urUtv.mjs";
|
|
13
12
|
import { execFile, spawn } from "node:child_process";
|
|
14
13
|
import { createInterface } from "node:readline";
|
|
15
14
|
import { homedir, tmpdir } from "node:os";
|
|
16
15
|
import { once } from "node:events";
|
|
17
|
-
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-rI6Nk-jn.mjs";
|
|
18
17
|
// src/examples/catalogue.ts
|
|
19
18
|
const BOTH = ["claude", "codex"];
|
|
20
19
|
const LOCAL_SECONDS = 10;
|
|
@@ -87,6 +86,22 @@ const examples = [
|
|
|
87
86
|
timeout: LOCAL_SECONDS
|
|
88
87
|
}]
|
|
89
88
|
},
|
|
89
|
+
{
|
|
90
|
+
name: "dewrap",
|
|
91
|
+
summary: "After an edit, join hard-wrapped Markdown paragraphs and comments into single lines. Changes your files.",
|
|
92
|
+
needs: [],
|
|
93
|
+
registrations: [{
|
|
94
|
+
event: "PostToolUse",
|
|
95
|
+
harnesses: ["claude"],
|
|
96
|
+
matcher: "Edit|Write",
|
|
97
|
+
timeout: LOCAL_SECONDS
|
|
98
|
+
}, {
|
|
99
|
+
event: "PostToolUse",
|
|
100
|
+
harnesses: ["codex"],
|
|
101
|
+
matcher: "apply_patch",
|
|
102
|
+
timeout: LOCAL_SECONDS
|
|
103
|
+
}]
|
|
104
|
+
},
|
|
90
105
|
{
|
|
91
106
|
name: "private-reference-guard",
|
|
92
107
|
summary: "Refuse to name a private GitHub repository in a public one.",
|
|
@@ -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.3.1";
|
|
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
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { text } from "node:stream/consumers";
|
|
2
|
-
import {
|
|
2
|
+
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
6
|
import { a as registryPath, n as cacheDirectory, r as claudeDirectory, t as atomicWrite } from "./files-CBn-xAo2.mjs";
|
|
7
7
|
import { createHash } from "node:crypto";
|
|
8
|
-
import { a as stringField, i as parsePayload, n as isRecord, o as toolInput, r as namedField } from "./shell-
|
|
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-
|
|
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-rI6Nk-jn.mjs";
|
|
10
|
+
import { a as sessionKey, i as removeOlderThan, n as readRecord, o as writeRecord, r as records, t as digest } from "./state-Br7wFToE.mjs";
|
|
11
11
|
import { spawn } from "node:child_process";
|
|
12
12
|
import { t as withoutHarnessMessages } from "./prompt-text-A_jEvJei.mjs";
|
|
13
|
-
import { t as handlersOf } from "./schema-
|
|
14
|
-
import { n as permissionRuleMatches, t as parsePermissionRule } from "./permission-rule-
|
|
13
|
+
import { t as handlersOf } from "./schema-Dfw94F_X.mjs";
|
|
14
|
+
import { n as permissionRuleMatches, t as parsePermissionRule } from "./permission-rule-BxFEjGo0.mjs";
|
|
15
15
|
import { fileURLToPath } from "node:url";
|
|
16
16
|
// src/registry/load.ts
|
|
17
17
|
/**
|
|
@@ -20,7 +20,7 @@ import { fileURLToPath } from "node:url";
|
|
|
20
20
|
const MEMO_PREFIX = "registry-";
|
|
21
21
|
var RegistryError = class extends Error {};
|
|
22
22
|
async function validate(text, path) {
|
|
23
|
-
const [{ parseRegistry }, { checkRegistry }] = await Promise.all([import("./schema-
|
|
23
|
+
const [{ parseRegistry }, { checkRegistry }] = await Promise.all([import("./schema-ByVW3IRJ.mjs"), import("./check-fL0W2EGm.mjs")]);
|
|
24
24
|
const registry = parseRegistry(JSON.parse(text));
|
|
25
25
|
const problems = checkRegistry(registry);
|
|
26
26
|
if (problems.length > 0) throw new RegistryError(`${path} cannot run:\n${problems.map((problem) => `${problem.harness} ${problem.event}: ${problem.message}`).join("\n")}`);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as stringField } from "../shell-
|
|
2
|
-
import { a as shellCommand, i as main, n as context, o as toolOutput } from "../hook-
|
|
1
|
+
import { a as stringField } from "../shell-BWP1aDQb.mjs";
|
|
2
|
+
import { a as shellCommand, i as main, n as context, o as toolOutput } from "../hook-ClJcbzby.mjs";
|
|
3
3
|
// src/examples/blocked-fetch.ts
|
|
4
4
|
/**
|
|
5
5
|
* After a page fetch is refused or blocked, reminds the agent to try a browser before reporting the page unreadable. Never blocks.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { closeSync, existsSync, fstatSync, openSync, readSync } from "node:fs";
|
|
2
|
-
import { a as stringField, n as isRecord } from "../shell-
|
|
2
|
+
import { a as stringField, n as isRecord } from "../shell-BWP1aDQb.mjs";
|
|
3
3
|
import { t as withoutHarnessMessages } from "../prompt-text-A_jEvJei.mjs";
|
|
4
|
-
import { i as main } from "../hook-
|
|
4
|
+
import { i as main } from "../hook-ClJcbzby.mjs";
|
|
5
5
|
// src/examples/transcript.ts
|
|
6
6
|
/**
|
|
7
7
|
* Reads a Claude Code transcript: which records are the user's own requests, and which are the harness's.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { readFileSync, statSync } from "node:fs";
|
|
2
|
-
import { a as stringField, n as isRecord, o as toolInput, t as splitCommand } from "../shell-
|
|
2
|
+
import { a as stringField, n as isRecord, o as toolInput, t as splitCommand } from "../shell-BWP1aDQb.mjs";
|
|
3
3
|
import { basename, extname, resolve } from "node:path";
|
|
4
4
|
import { homedir } from "node:os";
|
|
5
|
-
import { a as shellCommand, i as main, r as deny } from "../hook-
|
|
5
|
+
import { a as shellCommand, i as main, r as deny } from "../hook-ClJcbzby.mjs";
|
|
6
6
|
// src/examples/codex-patch.ts
|
|
7
7
|
/**
|
|
8
8
|
* Rebuilds the file contents a Codex `apply_patch` call would produce, so a hook can judge a patch as whole files before and after.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { c as number, f as string, l as object, n as array, p as union } from "../schemas-BDlKVNhe.mjs";
|
|
1
2
|
import { execFileSync } from "node:child_process";
|
|
2
3
|
import { join } from "node:path";
|
|
3
|
-
import { n as readRecord, o as writeRecord, t as digest } from "../state-
|
|
4
|
-
import { a as stringField } from "../shell-
|
|
4
|
+
import { n as readRecord, o as writeRecord, t as digest } from "../state-Br7wFToE.mjs";
|
|
5
|
+
import { a as stringField } from "../shell-BWP1aDQb.mjs";
|
|
5
6
|
import { n as withLock, t as LockedError } from "../lock-8b6urUtv.mjs";
|
|
6
|
-
import { c as number, f as string, l as object, n as array, p as union } from "../schemas-B4KRDIno.mjs";
|
|
7
7
|
import { n as cacheDirectory } from "../files-CBn-xAo2.mjs";
|
|
8
|
-
import { i as main, n as context } from "../hook-
|
|
9
|
-
import { o as originRepository } from "../private-references-
|
|
8
|
+
import { i as main, n as context } from "../hook-ClJcbzby.mjs";
|
|
9
|
+
import { o as originRepository } from "../private-references-B0qyQ0dB.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.
|