hookloom 1.0.0 → 1.0.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-C4-tOQXQ.mjs +1 -0
- package/dist/{check-D6B_qnUy.mjs → check-DiQUS1CB.mjs} +1 -1
- package/dist/cli.mjs +28 -22
- package/dist/{command-line-BBETAyPT.mjs → command-line-ByzwzoIt.mjs} +1 -1
- package/dist/dispatcher.mjs +3 -3
- package/dist/{schema-ChV-yJDT.mjs → schema-78xAlSN_.mjs} +9 -1
- package/dist/{schema-Bvs-uwjo.mjs → schema-DR7G3z1u.mjs} +1 -1
- package/package.json +1 -1
- package/dist/check-nhb0tW8i.mjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as checkRegistry } from "./check-DiQUS1CB.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as permissionRuleProblem } from "./permission-rule-DXm-Jvfg.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { h as harnesses, m as eventContract, t as handlersOf } from "./schema-78xAlSN_.mjs";
|
|
3
3
|
// src/registry/check.ts
|
|
4
4
|
/**
|
|
5
5
|
* The rules a registry must meet for a harness to be able to run it, beyond its shape.
|
package/dist/cli.mjs
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
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 { a as array, c as
|
|
6
|
-
import { c as registryPath, i as atomicWrite, n as invocation, o as claudeDirectory, r as version, s as configurationDirectory, t as claudeUsesPowerShell } from "./command-line-
|
|
5
|
+
import { a as array, c as number, d as strictObject, f as string, h as harnesses, i as _enum, l as object, m as eventContract, n as parseRegistry, o as boolean, p as unknown, s as looseObject, u as record$1 } from "./schema-78xAlSN_.mjs";
|
|
6
|
+
import { c as registryPath, i as atomicWrite, n as invocation, o as claudeDirectory, r as version, s as configurationDirectory, t as claudeUsesPowerShell } from "./command-line-ByzwzoIt.mjs";
|
|
7
7
|
import { createHash } from "node:crypto";
|
|
8
8
|
import { i as isRecord } from "./permission-rule-DXm-Jvfg.mjs";
|
|
9
|
-
import { t as checkRegistry } from "./check-
|
|
9
|
+
import { t as checkRegistry } from "./check-DiQUS1CB.mjs";
|
|
10
10
|
import { execFile, spawn } from "node:child_process";
|
|
11
11
|
import { createInterface } from "node:readline";
|
|
12
12
|
import { homedir, tmpdir } from "node:os";
|
|
@@ -471,17 +471,17 @@ function nativeHookFiles(env) {
|
|
|
471
471
|
codex: join(codexDirectory(env), "hooks.json")
|
|
472
472
|
};
|
|
473
473
|
}
|
|
474
|
-
const claudeList = array(
|
|
475
|
-
|
|
474
|
+
const claudeList = array(looseObject({ id: string() }));
|
|
475
|
+
const claudeEntry = object({
|
|
476
476
|
version: string(),
|
|
477
477
|
installPath: string(),
|
|
478
478
|
enabled: boolean()
|
|
479
|
-
})
|
|
480
|
-
const codexList = object({ installed: array(
|
|
481
|
-
|
|
479
|
+
});
|
|
480
|
+
const codexList = object({ installed: array(looseObject({ pluginId: string() })) });
|
|
481
|
+
const codexEntry = object({
|
|
482
482
|
version: string(),
|
|
483
483
|
enabled: boolean()
|
|
484
|
-
})
|
|
484
|
+
});
|
|
485
485
|
const INSTALL = {
|
|
486
486
|
claude: (source) => [[
|
|
487
487
|
"plugin",
|
|
@@ -509,6 +509,24 @@ function installCommands(harness, source) {
|
|
|
509
509
|
return INSTALL[harness](source);
|
|
510
510
|
}
|
|
511
511
|
/**
|
|
512
|
+
* The enabled hookloom plugin in a harness's `plugin list --json` output, or `undefined` when it has none.
|
|
513
|
+
* @throws when the listing, or the plugin's own entry, cannot be read.
|
|
514
|
+
*/
|
|
515
|
+
function listedPlugin(harness, listing, env) {
|
|
516
|
+
if (harness === "claude") {
|
|
517
|
+
const entry = claudeList.parse(listing).filter(({ id }) => id === PLUGIN_ID).map((found) => claudeEntry.parse(found)).find(({ enabled }) => enabled);
|
|
518
|
+
return entry === void 0 ? void 0 : {
|
|
519
|
+
version: entry.version,
|
|
520
|
+
directory: entry.installPath
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
const entry = codexList.parse(listing).installed.filter(({ pluginId }) => pluginId === PLUGIN_ID).map((found) => codexEntry.parse(found)).find(({ enabled }) => enabled);
|
|
524
|
+
return entry === void 0 ? void 0 : {
|
|
525
|
+
version: entry.version,
|
|
526
|
+
directory: join(codexDirectory(env), "plugins", "cache", "hookloom", "hookloom", entry.version)
|
|
527
|
+
};
|
|
528
|
+
}
|
|
529
|
+
/**
|
|
512
530
|
* The enabled hookloom plugin of a harness, or `undefined` when it has none.
|
|
513
531
|
* @throws when the harness is not on the PATH or cannot list its plugins.
|
|
514
532
|
*/
|
|
@@ -521,19 +539,7 @@ async function installedPlugin(harness, env) {
|
|
|
521
539
|
"--json"
|
|
522
540
|
], env);
|
|
523
541
|
if (listed.code !== 0) throw new Error(`${harness} could not list its plugins: ${listed.stderr.trim()}`);
|
|
524
|
-
|
|
525
|
-
if (harness === "claude") {
|
|
526
|
-
const entry = claudeList.parse(document).find((plugin) => plugin.id === "hookloom@hookloom" && plugin.enabled);
|
|
527
|
-
return entry === void 0 ? void 0 : {
|
|
528
|
-
version: entry.version,
|
|
529
|
-
directory: entry.installPath
|
|
530
|
-
};
|
|
531
|
-
}
|
|
532
|
-
const entry = codexList.parse(document).installed.find((plugin) => plugin.pluginId === "hookloom@hookloom" && plugin.enabled);
|
|
533
|
-
return entry === void 0 ? void 0 : {
|
|
534
|
-
version: entry.version,
|
|
535
|
-
directory: join(codexDirectory(env), "plugins", "cache", "hookloom", "hookloom", entry.version)
|
|
536
|
-
};
|
|
542
|
+
return listedPlugin(harness, JSON.parse(listed.stdout), env);
|
|
537
543
|
}
|
|
538
544
|
// src/cli/in-order.ts
|
|
539
545
|
/** Applies an asynchronous step to each item in turn, each starting after the one before has finished, and resolves with their results. */
|
package/dist/dispatcher.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { text } from "node:stream/consumers";
|
|
2
|
-
import {
|
|
2
|
+
import { h as harnesses, m as eventContract, t as handlersOf } from "./schema-78xAlSN_.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 cacheDirectory, c as registryPath, i as atomicWrite, n as invocation, o as claudeDirectory, r as version } from "./command-line-
|
|
6
|
+
import { a as cacheDirectory, c as registryPath, i as atomicWrite, n as invocation, o as claudeDirectory, r as version } from "./command-line-ByzwzoIt.mjs";
|
|
7
7
|
import { createHash } from "node:crypto";
|
|
8
8
|
import { a as namedField, c as toolInput, i as isRecord, n as permissionRuleMatches, o as parsePayload, s as stringField, t as parsePermissionRule } from "./permission-rule-DXm-Jvfg.mjs";
|
|
9
9
|
import { spawn } from "node:child_process";
|
|
@@ -14,7 +14,7 @@ import { spawn } from "node:child_process";
|
|
|
14
14
|
const MEMO_PREFIX = "registry-";
|
|
15
15
|
var RegistryError = class extends Error {};
|
|
16
16
|
async function validate(text, path) {
|
|
17
|
-
const [{ parseRegistry }, { checkRegistry }] = await Promise.all([import("./schema-
|
|
17
|
+
const [{ parseRegistry }, { checkRegistry }] = await Promise.all([import("./schema-DR7G3z1u.mjs"), import("./check-C4-tOQXQ.mjs")]);
|
|
18
18
|
const registry = parseRegistry(JSON.parse(text));
|
|
19
19
|
const problems = checkRegistry(registry);
|
|
20
20
|
if (problems.length > 0) throw new RegistryError(`${path} cannot run:\n${problems.map((problem) => `${problem.harness} ${problem.event}: ${problem.message}`).join("\n")}`);
|
|
@@ -5420,6 +5420,14 @@ function strictObject(shape, params) {
|
|
|
5420
5420
|
...normalizeParams(params)
|
|
5421
5421
|
});
|
|
5422
5422
|
}
|
|
5423
|
+
function looseObject(shape, params) {
|
|
5424
|
+
return new ZodObject({
|
|
5425
|
+
type: "object",
|
|
5426
|
+
shape,
|
|
5427
|
+
catchall: unknown(),
|
|
5428
|
+
...normalizeParams(params)
|
|
5429
|
+
});
|
|
5430
|
+
}
|
|
5423
5431
|
const ZodUnion = /*@__PURE__*/ $constructor("ZodUnion", (inst, def) => {
|
|
5424
5432
|
$ZodUnion.init(inst, def);
|
|
5425
5433
|
ZodType.init(inst, def);
|
|
@@ -5805,4 +5813,4 @@ function handlersOf(entry) {
|
|
|
5805
5813
|
...entry.timeout === void 0 ? {} : { timeout: entry.timeout }
|
|
5806
5814
|
}];
|
|
5807
5815
|
}
|
|
5808
|
-
export { array as a,
|
|
5816
|
+
export { array as a, number as c, strictObject as d, string as f, harnesses as h, _enum as i, object as l, eventContract as m, parseRegistry as n, boolean as o, unknown as p, registryDocument as r, looseObject as s, handlersOf as t, record as u };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as handlersOf, n as parseRegistry, r as registryDocument } from "./schema-
|
|
1
|
+
export { t as handlersOf, n as parseRegistry, r as registryDocument } from "./schema-78xAlSN_.mjs";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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.0.
|
|
4
|
+
"version": "1.0.1",
|
|
5
5
|
"author": "Joseph Mearman <joseph@mearman.co.uk>",
|
|
6
6
|
"bin": {
|
|
7
7
|
"hookloom": "./dist/cli.mjs"
|
package/dist/check-nhb0tW8i.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { t as checkRegistry } from "./check-D6B_qnUy.mjs";
|