@ev-ai/agent-hook 1.3.7 → 1.3.8
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/COLLECTED-DATA.md +5 -1
- package/README.md +1 -1
- package/dist/cli.mjs +39 -39
- package/dist/hook.mjs +36 -36
- package/dist/launcher-update.mjs +4 -4
- package/dist/launcher.mjs +6 -5
- package/dist/managed-hooks-snippet.cjs +6 -2
- package/dist/managed-hooks-snippet.mjs +6 -2
- package/dist/plugin-hooks.mjs +21 -15
- package/package.json +2 -2
package/dist/plugin-hooks.mjs
CHANGED
|
@@ -3,7 +3,14 @@ const require = __createRequire(import.meta.url);
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
// src/install/plugin-hooks.ts
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
chmodSync,
|
|
8
|
+
copyFileSync,
|
|
9
|
+
existsSync,
|
|
10
|
+
mkdirSync,
|
|
11
|
+
readFileSync,
|
|
12
|
+
writeFileSync
|
|
13
|
+
} from "node:fs";
|
|
7
14
|
import { dirname, join } from "node:path";
|
|
8
15
|
|
|
9
16
|
// src/launcher/constants.ts
|
|
@@ -26,7 +33,7 @@ var HOOK_INPUT_ALLOWLIST_MAX_BYTES = 4 * 1024;
|
|
|
26
33
|
var HOOK_INPUT_FULL_MAX_BYTES = 256 * 1024;
|
|
27
34
|
var HOOK_INPUT_MCP_MAX_BYTES = 4 * 1024;
|
|
28
35
|
var GZIP_MIN_BYTES = 32 * 1024;
|
|
29
|
-
var PACKAGE_VERSION = "1.3.
|
|
36
|
+
var PACKAGE_VERSION = "1.3.8";
|
|
30
37
|
var NPX_PACKAGE_SPEC = `@ev-ai/agent-hook@${PACKAGE_VERSION}`;
|
|
31
38
|
var HOOK_STATUS_MESSAGE = "ev-ai runtime report";
|
|
32
39
|
var PLUGIN_ROOT_VARIABLE = {
|
|
@@ -35,8 +42,10 @@ var PLUGIN_ROOT_VARIABLE = {
|
|
|
35
42
|
codex: "PLUGIN_ROOT"
|
|
36
43
|
};
|
|
37
44
|
|
|
45
|
+
// src/collectors/sys.ts
|
|
46
|
+
var BYTES_PER_MB = 1024 * 1024;
|
|
47
|
+
|
|
38
48
|
// src/config/hook-config.ts
|
|
39
|
-
var HOOK_CONFIG_MAX_AGE_MS = 7 * 24 * 60 * 60 * 1e3;
|
|
40
49
|
var HOOK_CONFIG_FETCHED_AT_BUMP_MS = 24 * 60 * 60 * 1e3;
|
|
41
50
|
var HOOK_CONFIG_FILE_MAX_BYTES = 1024 * 1024;
|
|
42
51
|
|
|
@@ -123,16 +132,12 @@ var PLUGIN_PACKAGE_FILE = "package.json";
|
|
|
123
132
|
function pluginLauncherPosixCommand(runner) {
|
|
124
133
|
return `node "\${${PLUGIN_ROOT_VARIABLE[runner]}}/${PLUGIN_HOOK_ENTRY}" --runner ${runner} ; exit 0`;
|
|
125
134
|
}
|
|
126
|
-
function pluginLauncherPowerShellCommand(runner) {
|
|
127
|
-
const variable = PLUGIN_ROOT_VARIABLE[runner];
|
|
128
|
-
return `powershell -NoProfile -NonInteractive -Command "node (Join-Path (Get-Item Env:${variable}).Value '${PLUGIN_HOOK_ENTRY}') --runner ${runner}" ; exit 0`;
|
|
129
|
-
}
|
|
130
|
-
function pluginLauncherCommands(runner) {
|
|
131
|
-
return [pluginLauncherPosixCommand(runner), pluginLauncherPowerShellCommand(runner)];
|
|
132
|
-
}
|
|
133
135
|
function claudePluginCommand() {
|
|
134
136
|
return pluginLauncherPosixCommand("claude");
|
|
135
137
|
}
|
|
138
|
+
function cursorPluginCommand() {
|
|
139
|
+
return pluginLauncherPosixCommand("cursor");
|
|
140
|
+
}
|
|
136
141
|
function pluginLauncherCodexWindowsCommand() {
|
|
137
142
|
const variable = PLUGIN_ROOT_VARIABLE.codex;
|
|
138
143
|
return `node (Join-Path (Get-Item Env:${variable}).Value '${PLUGIN_HOOK_ENTRY}') --runner codex; exit 0`;
|
|
@@ -150,7 +155,9 @@ function buildClaudePluginHooks(command) {
|
|
|
150
155
|
}
|
|
151
156
|
function buildClaudeMarketplacePluginHooks() {
|
|
152
157
|
const hooks = {};
|
|
153
|
-
for (const [eventName, groups] of Object.entries(
|
|
158
|
+
for (const [eventName, groups] of Object.entries(
|
|
159
|
+
desiredClaudeHookGroups(claudePluginCommand())
|
|
160
|
+
)) {
|
|
154
161
|
const timeout = isSessionStartEvent(eventName) ? CLAUDE_SESSION_START_TIMEOUT_SECONDS : CLAUDE_HOOK_TIMEOUT_SECONDS;
|
|
155
162
|
hooks[eventName] = groups.map((group) => ({
|
|
156
163
|
...group,
|
|
@@ -204,7 +211,7 @@ function writeJson(path, value) {
|
|
|
204
211
|
function writeMarketplacePluginHooks(marketplaceRoot) {
|
|
205
212
|
const paths = marketplacePluginHookPaths(marketplaceRoot);
|
|
206
213
|
writeJson(paths.claude, buildClaudeMarketplacePluginHooks());
|
|
207
|
-
writeJson(paths.cursor, buildCursorPluginHooks(
|
|
214
|
+
writeJson(paths.cursor, buildCursorPluginHooks(cursorPluginCommand()));
|
|
208
215
|
writeJson(paths.codex, buildCodexPluginHooks(pluginLauncherCodexCommand()));
|
|
209
216
|
return paths;
|
|
210
217
|
}
|
|
@@ -240,7 +247,7 @@ function copyMarketplacePluginPayload(marketplaceRoot, packageRoot) {
|
|
|
240
247
|
function expectedMarketplacePluginHooks() {
|
|
241
248
|
return {
|
|
242
249
|
claude: buildClaudeMarketplacePluginHooks(),
|
|
243
|
-
cursor: buildCursorPluginHooks(
|
|
250
|
+
cursor: buildCursorPluginHooks(cursorPluginCommand()),
|
|
244
251
|
codex: buildCodexPluginHooks(pluginLauncherCodexCommand())
|
|
245
252
|
};
|
|
246
253
|
}
|
|
@@ -259,13 +266,12 @@ export {
|
|
|
259
266
|
buildCursorPluginHooks,
|
|
260
267
|
claudePluginCommand,
|
|
261
268
|
copyMarketplacePluginPayload,
|
|
269
|
+
cursorPluginCommand,
|
|
262
270
|
expectedMarketplacePluginHooks,
|
|
263
271
|
marketplacePluginHookPaths,
|
|
264
272
|
pluginLauncherCodexCommand,
|
|
265
273
|
pluginLauncherCodexWindowsCommand,
|
|
266
|
-
pluginLauncherCommands,
|
|
267
274
|
pluginLauncherPosixCommand,
|
|
268
|
-
pluginLauncherPowerShellCommand,
|
|
269
275
|
pluginPackageManifest,
|
|
270
276
|
writeMarketplacePluginHooks
|
|
271
277
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ev-ai/agent-hook",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.8",
|
|
4
4
|
"description": "Cross-runner runtime telemetry hook for Claude Code, Cursor, and Codex",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"evAi": {
|
|
27
27
|
"launcherProtocol": 1,
|
|
28
28
|
"minLauncherProtocol": 1,
|
|
29
|
-
"launcherRevision":
|
|
29
|
+
"launcherRevision": 7
|
|
30
30
|
},
|
|
31
31
|
"engines": {
|
|
32
32
|
"node": ">=18"
|