@brainervirus/workit-codex 8.33.0 → 8.34.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.
|
@@ -15,6 +15,9 @@ import {
|
|
|
15
15
|
checkCommand,
|
|
16
16
|
maybeHeavy2
|
|
17
17
|
} from "./workit-hook-eaahdgen.js";
|
|
18
|
+
import {
|
|
19
|
+
recordHookRun2
|
|
20
|
+
} from "./workit-hook-w6s3hcyz.js";
|
|
18
21
|
// packages/workit-core/src/hooks/descriptor.ts
|
|
19
22
|
var support = (descriptor, axis) => {
|
|
20
23
|
if (axis.startsWith("event:"))
|
|
@@ -23730,6 +23733,8 @@ async function runHookProcess(host, stdin, stdout, stderr = process.stderr, env
|
|
|
23730
23733
|
} catch {
|
|
23731
23734
|
raw = undefined;
|
|
23732
23735
|
}
|
|
23736
|
+
const native = raw?.hook_event_name;
|
|
23737
|
+
recordHookRun2(typeof host === "string" ? host : adapter.descriptor.host, typeof native === "string" ? native : null, env);
|
|
23733
23738
|
const result = text === null ? skippedHook(adapter, undefined, env, budget, "input") : await dispatchWithin(adapter, raw, env, budget, deadline.dispatch);
|
|
23734
23739
|
if (result.skipped)
|
|
23735
23740
|
stderr.write(`[workit] ${result.error}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
stateDir2
|
|
4
|
+
} from "./workit-hook-eaahdgen.js";
|
|
5
|
+
|
|
6
|
+
// packages/workit-core/src/hooks/hook-runs.ts
|
|
7
|
+
import { mkdirSync, readdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
8
|
+
import path from "node:path";
|
|
9
|
+
var HOOK_RUNS_DIR = "hook-runs";
|
|
10
|
+
var safe = (part) => part.replace(/[^A-Za-z0-9_.-]/g, "-").slice(0, 64);
|
|
11
|
+
var runFile = (dir, host, event) => path.join(dir, HOOK_RUNS_DIR, `${safe(host)}__${safe(event)}.json`);
|
|
12
|
+
var recordHookRun2 = (host, event, env = process.env, now = Date.now) => {
|
|
13
|
+
if (!event)
|
|
14
|
+
return;
|
|
15
|
+
try {
|
|
16
|
+
const dir = stateDir2(env);
|
|
17
|
+
const file = runFile(dir, host, event);
|
|
18
|
+
let count = 0;
|
|
19
|
+
try {
|
|
20
|
+
const previous = JSON.parse(readFileSync(file, "utf8"));
|
|
21
|
+
if (typeof previous.count === "number" && Number.isFinite(previous.count))
|
|
22
|
+
count = previous.count;
|
|
23
|
+
} catch {}
|
|
24
|
+
const row = {
|
|
25
|
+
host,
|
|
26
|
+
event,
|
|
27
|
+
at: new Date(now()).toISOString(),
|
|
28
|
+
count: count + 1
|
|
29
|
+
};
|
|
30
|
+
try {
|
|
31
|
+
writeFileSync(file, JSON.stringify(row));
|
|
32
|
+
} catch {
|
|
33
|
+
mkdirSync(path.dirname(file), { recursive: true });
|
|
34
|
+
writeFileSync(file, JSON.stringify(row));
|
|
35
|
+
}
|
|
36
|
+
} catch {}
|
|
37
|
+
};
|
|
38
|
+
export { recordHookRun2 };
|
package/dist/workit-hook.js
CHANGED
|
@@ -36,6 +36,7 @@ if (tooOld) {
|
|
|
36
36
|
}
|
|
37
37
|
var { maybeHeavy, stateDir } = await import("./workit-hook-9pq84bdw.js");
|
|
38
38
|
var { standingPending } = await import("./workit-hook-mk64s4fk.js");
|
|
39
|
+
var { recordHookRun } = await import("./workit-hook-b9ansxvm.js");
|
|
39
40
|
var payload = "";
|
|
40
41
|
for await (const chunk of process.stdin)
|
|
41
42
|
payload += String(chunk);
|
|
@@ -75,10 +76,12 @@ var quietEvent = () => {
|
|
|
75
76
|
}
|
|
76
77
|
};
|
|
77
78
|
var quiet = quietEvent();
|
|
78
|
-
if (quiet)
|
|
79
|
+
if (quiet) {
|
|
80
|
+
if (quiet === "PreToolUse")
|
|
81
|
+
recordHookRun(process.env.CODEX_INTERNAL_ORIGINATOR_OVERRIDE === "Codex Desktop" || process.env.CODEX_ELECTRON_RESOURCES_PATH ? "codex_desktop" : "codex_cli", quiet);
|
|
79
82
|
process.stdout.write(`${JSON.stringify({ hookSpecificOutput: { hookEventName: quiet } })}
|
|
80
83
|
`);
|
|
81
|
-
else {
|
|
82
|
-
const { runCodexHook } = await import("./workit-hook-
|
|
84
|
+
} else {
|
|
85
|
+
const { runCodexHook } = await import("./workit-hook-h4ryf1zq.js");
|
|
83
86
|
await runCodexHook([payload]);
|
|
84
87
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brainervirus/workit-codex",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.34.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Workit Codex CLI/desktop plugin — shared MCP transport, hooks, method skills, and verifier/reviewer/implementer agents",
|
|
6
6
|
"keywords": [
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"build": "bun scripts/build.ts"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@brainervirus/workit-core": "^8.
|
|
43
|
-
"@brainervirus/workit-mcp": "^8.
|
|
42
|
+
"@brainervirus/workit-core": "^8.34.0",
|
|
43
|
+
"@brainervirus/workit-mcp": "^8.34.0"
|
|
44
44
|
},
|
|
45
45
|
"engines": {
|
|
46
46
|
"node": ">=24"
|