@ev-ai/agent-hook 1.3.7 → 1.3.9

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.
@@ -3,7 +3,14 @@ const require = __createRequire(import.meta.url);
3
3
 
4
4
 
5
5
  // src/install/plugin-hooks.ts
6
- import { chmodSync, copyFileSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
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.7";
36
+ var PACKAGE_VERSION = "1.3.9";
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,13 @@ 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
+ const root = `\${${PLUGIN_ROOT_VARIABLE.cursor}}`;
140
+ return `"${root}/scripts/run-node.cmd" "${root}/${PLUGIN_HOOK_ENTRY}" --runner cursor ; exit 0`;
141
+ }
136
142
  function pluginLauncherCodexWindowsCommand() {
137
143
  const variable = PLUGIN_ROOT_VARIABLE.codex;
138
144
  return `node (Join-Path (Get-Item Env:${variable}).Value '${PLUGIN_HOOK_ENTRY}') --runner codex; exit 0`;
@@ -150,7 +156,9 @@ function buildClaudePluginHooks(command) {
150
156
  }
151
157
  function buildClaudeMarketplacePluginHooks() {
152
158
  const hooks = {};
153
- for (const [eventName, groups] of Object.entries(desiredClaudeHookGroups(claudePluginCommand()))) {
159
+ for (const [eventName, groups] of Object.entries(
160
+ desiredClaudeHookGroups(claudePluginCommand())
161
+ )) {
154
162
  const timeout = isSessionStartEvent(eventName) ? CLAUDE_SESSION_START_TIMEOUT_SECONDS : CLAUDE_HOOK_TIMEOUT_SECONDS;
155
163
  hooks[eventName] = groups.map((group) => ({
156
164
  ...group,
@@ -204,7 +212,7 @@ function writeJson(path, value) {
204
212
  function writeMarketplacePluginHooks(marketplaceRoot) {
205
213
  const paths = marketplacePluginHookPaths(marketplaceRoot);
206
214
  writeJson(paths.claude, buildClaudeMarketplacePluginHooks());
207
- writeJson(paths.cursor, buildCursorPluginHooks(pluginLauncherCommands("cursor")));
215
+ writeJson(paths.cursor, buildCursorPluginHooks(cursorPluginCommand()));
208
216
  writeJson(paths.codex, buildCodexPluginHooks(pluginLauncherCodexCommand()));
209
217
  return paths;
210
218
  }
@@ -240,7 +248,7 @@ function copyMarketplacePluginPayload(marketplaceRoot, packageRoot) {
240
248
  function expectedMarketplacePluginHooks() {
241
249
  return {
242
250
  claude: buildClaudeMarketplacePluginHooks(),
243
- cursor: buildCursorPluginHooks(pluginLauncherCommands("cursor")),
251
+ cursor: buildCursorPluginHooks(cursorPluginCommand()),
244
252
  codex: buildCodexPluginHooks(pluginLauncherCodexCommand())
245
253
  };
246
254
  }
@@ -259,13 +267,12 @@ export {
259
267
  buildCursorPluginHooks,
260
268
  claudePluginCommand,
261
269
  copyMarketplacePluginPayload,
270
+ cursorPluginCommand,
262
271
  expectedMarketplacePluginHooks,
263
272
  marketplacePluginHookPaths,
264
273
  pluginLauncherCodexCommand,
265
274
  pluginLauncherCodexWindowsCommand,
266
- pluginLauncherCommands,
267
275
  pluginLauncherPosixCommand,
268
- pluginLauncherPowerShellCommand,
269
276
  pluginPackageManifest,
270
277
  writeMarketplacePluginHooks
271
278
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ev-ai/agent-hook",
3
- "version": "1.3.7",
3
+ "version": "1.3.9",
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": 6
29
+ "launcherRevision": 7
30
30
  },
31
31
  "engines": {
32
32
  "node": ">=18"