@ev-ai/agent-hook 1.3.3 → 1.3.5
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 +3 -3
- package/README.md +6 -6
- package/dist/cli.mjs +38 -38
- package/dist/hook.mjs +32 -32
- package/dist/launcher-update.mjs +4 -4
- package/dist/launcher.mjs +4 -3
- package/dist/managed-hooks-snippet.cjs +7 -17
- package/dist/managed-hooks-snippet.d.ts +6 -1
- package/dist/managed-hooks-snippet.mjs +6 -17
- package/dist/plugin-hooks.mjs +30 -41
- package/package.json +2 -2
package/dist/plugin-hooks.mjs
CHANGED
|
@@ -3,7 +3,7 @@ const require = __createRequire(import.meta.url);
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
// src/install/plugin-hooks.ts
|
|
6
|
-
import { chmodSync, copyFileSync, existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
6
|
+
import { chmodSync, copyFileSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
7
7
|
import { dirname, join } from "node:path";
|
|
8
8
|
|
|
9
9
|
// src/launcher/constants.ts
|
|
@@ -20,14 +20,13 @@ var MAX_JSON_FILE_BYTES = 1024 * 1024;
|
|
|
20
20
|
|
|
21
21
|
// src/shared/constants.ts
|
|
22
22
|
var HOOK_BINARY_NAME = "ev-ai-agent-hook";
|
|
23
|
-
var HOOK_CHECKSUMS_FILE = "SHA256SUMS";
|
|
24
23
|
var GLOBAL_HOOK_BINARY_RELATIVE = `current/${HOOK_BINARY_NAME}`;
|
|
25
24
|
var PROJECT_HOOK_BINARY_RELATIVE = `.ev-ai/agent-hook/${HOOK_BINARY_NAME}`;
|
|
26
25
|
var HOOK_INPUT_ALLOWLIST_MAX_BYTES = 4 * 1024;
|
|
27
26
|
var HOOK_INPUT_FULL_MAX_BYTES = 256 * 1024;
|
|
28
27
|
var HOOK_INPUT_MCP_MAX_BYTES = 4 * 1024;
|
|
29
28
|
var GZIP_MIN_BYTES = 32 * 1024;
|
|
30
|
-
var PACKAGE_VERSION = "1.3.
|
|
29
|
+
var PACKAGE_VERSION = "1.3.5";
|
|
31
30
|
var NPX_PACKAGE_SPEC = `@ev-ai/agent-hook@${PACKAGE_VERSION}`;
|
|
32
31
|
var HOOK_STATUS_MESSAGE = "ev-ai runtime report";
|
|
33
32
|
|
|
@@ -114,20 +113,19 @@ var CURSOR_WIRED_HOOK_EVENTS = [
|
|
|
114
113
|
];
|
|
115
114
|
|
|
116
115
|
// src/install/plugin-hooks.ts
|
|
117
|
-
var
|
|
118
|
-
var
|
|
119
|
-
var PLUGIN_CHECKSUMS_FILE = HOOK_CHECKSUMS_FILE;
|
|
116
|
+
var PLUGIN_HOOK_ENTRY = "dist/launcher.mjs";
|
|
117
|
+
var PLUGIN_PACKAGE_FILE = "package.json";
|
|
120
118
|
var PLUGIN_ROOT_VARIABLE = {
|
|
121
119
|
claude: "CLAUDE_PLUGIN_ROOT",
|
|
122
120
|
cursor: "CURSOR_PLUGIN_ROOT",
|
|
123
121
|
codex: "PLUGIN_ROOT"
|
|
124
122
|
};
|
|
125
123
|
function pluginLauncherPosixCommand(runner) {
|
|
126
|
-
return `node "\${${PLUGIN_ROOT_VARIABLE[runner]}}/${
|
|
124
|
+
return `node "\${${PLUGIN_ROOT_VARIABLE[runner]}}/${PLUGIN_HOOK_ENTRY}" --runner ${runner} ; exit 0`;
|
|
127
125
|
}
|
|
128
126
|
function pluginLauncherPowerShellCommand(runner) {
|
|
129
127
|
const variable = PLUGIN_ROOT_VARIABLE[runner];
|
|
130
|
-
return `powershell -NoProfile -NonInteractive -Command "node (Join-Path (Get-Item Env:${variable}).Value '${
|
|
128
|
+
return `powershell -NoProfile -NonInteractive -Command "node (Join-Path (Get-Item Env:${variable}).Value '${PLUGIN_HOOK_ENTRY}') --runner ${runner}" ; exit 0`;
|
|
131
129
|
}
|
|
132
130
|
function pluginLauncherCommands(runner) {
|
|
133
131
|
return [pluginLauncherPosixCommand(runner), pluginLauncherPowerShellCommand(runner)];
|
|
@@ -137,11 +135,11 @@ function claudePluginCommand() {
|
|
|
137
135
|
}
|
|
138
136
|
function pluginLauncherCodexWindowsCommand() {
|
|
139
137
|
const variable = PLUGIN_ROOT_VARIABLE.codex;
|
|
140
|
-
return `node (Join-Path (Get-Item Env:${variable}).Value '${
|
|
138
|
+
return `node (Join-Path (Get-Item Env:${variable}).Value '${PLUGIN_HOOK_ENTRY}') --runner codex; exit 0`;
|
|
141
139
|
}
|
|
142
140
|
function pluginLauncherCodexCommand() {
|
|
143
141
|
return {
|
|
144
|
-
command: `sh -c 'node "\${PLUGIN_ROOT}/${
|
|
142
|
+
command: `sh -c 'node "\${PLUGIN_ROOT}/${PLUGIN_HOOK_ENTRY}" --runner codex; exit 0'`,
|
|
145
143
|
commandWindows: pluginLauncherCodexWindowsCommand()
|
|
146
144
|
};
|
|
147
145
|
}
|
|
@@ -155,7 +153,7 @@ function buildCursorPluginHooks(command) {
|
|
|
155
153
|
command: commandForEvent(eventName, entry)
|
|
156
154
|
}));
|
|
157
155
|
}
|
|
158
|
-
return { hooks };
|
|
156
|
+
return { version: 1, hooks };
|
|
159
157
|
}
|
|
160
158
|
function buildCodexPluginHooks(command) {
|
|
161
159
|
return { hooks: desiredCodexHookGroups(command) };
|
|
@@ -175,17 +173,9 @@ function marketplacePluginHookPaths(marketplaceRoot) {
|
|
|
175
173
|
};
|
|
176
174
|
}
|
|
177
175
|
var PLUGIN_PAYLOAD_FILES = [
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
target: PLUGIN_CHECKSUMS_FILE,
|
|
182
|
-
executable: false,
|
|
183
|
-
optional: true
|
|
184
|
-
}
|
|
185
|
-
];
|
|
186
|
-
var PLUGIN_REQUIRED_PAYLOAD_TARGETS = [
|
|
187
|
-
PLUGIN_HOOK_PAYLOAD,
|
|
188
|
-
PLUGIN_VERSION_FILE
|
|
176
|
+
PLUGIN_HOOK_ENTRY,
|
|
177
|
+
"dist/launcher-update.mjs",
|
|
178
|
+
"dist/hook.mjs"
|
|
189
179
|
];
|
|
190
180
|
function writeJson(path, value) {
|
|
191
181
|
mkdirSync(dirname(path), { recursive: true });
|
|
@@ -199,32 +189,32 @@ function writeMarketplacePluginHooks(marketplaceRoot) {
|
|
|
199
189
|
writeJson(paths.codex, buildCodexPluginHooks(pluginLauncherCodexCommand()));
|
|
200
190
|
return paths;
|
|
201
191
|
}
|
|
192
|
+
function pluginPackageManifest(packageRoot) {
|
|
193
|
+
const pkg = JSON.parse(readFileSync(join(packageRoot, "package.json"), "utf8"));
|
|
194
|
+
return { name: pkg.name, version: pkg.version, private: true, evAi: pkg.evAi };
|
|
195
|
+
}
|
|
202
196
|
function copyMarketplacePluginPayload(marketplaceRoot, packageRoot) {
|
|
203
197
|
for (const file of PLUGIN_PAYLOAD_FILES) {
|
|
204
|
-
const source = join(packageRoot, file
|
|
205
|
-
if (!
|
|
198
|
+
const source = join(packageRoot, file);
|
|
199
|
+
if (!existsSync(source)) {
|
|
206
200
|
throw new Error(`Missing plugin payload source: ${source} (run \`yarn build\` first)`);
|
|
207
201
|
}
|
|
208
202
|
}
|
|
203
|
+
const manifest = pluginPackageManifest(packageRoot);
|
|
209
204
|
const written = [];
|
|
210
205
|
for (const pluginDir of Object.values(MARKETPLACE_PLUGIN_DIRS)) {
|
|
211
206
|
const pluginRoot = join(marketplaceRoot, pluginDir);
|
|
212
|
-
mkdirSync(pluginRoot, { recursive: true });
|
|
213
207
|
for (const file of PLUGIN_PAYLOAD_FILES) {
|
|
214
|
-
const
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
const target = join(pluginRoot, file.target);
|
|
219
|
-
copyFileSync(source, target);
|
|
220
|
-
chmodSync(target, file.executable ? 493 : 420);
|
|
208
|
+
const target = join(pluginRoot, file);
|
|
209
|
+
mkdirSync(dirname(target), { recursive: true });
|
|
210
|
+
copyFileSync(join(packageRoot, file), target);
|
|
211
|
+
chmodSync(target, 420);
|
|
221
212
|
written.push(target);
|
|
222
213
|
}
|
|
223
|
-
const
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
written.push(versionTarget);
|
|
214
|
+
const manifestTarget = join(pluginRoot, PLUGIN_PACKAGE_FILE);
|
|
215
|
+
writeJson(manifestTarget, manifest);
|
|
216
|
+
chmodSync(manifestTarget, 420);
|
|
217
|
+
written.push(manifestTarget);
|
|
228
218
|
}
|
|
229
219
|
return written;
|
|
230
220
|
}
|
|
@@ -239,12 +229,10 @@ export {
|
|
|
239
229
|
MARKETPLACE_NAME,
|
|
240
230
|
MARKETPLACE_PLUGIN_DIRS,
|
|
241
231
|
MARKETPLACE_PLUGIN_NAME,
|
|
242
|
-
|
|
243
|
-
|
|
232
|
+
PLUGIN_HOOK_ENTRY,
|
|
233
|
+
PLUGIN_PACKAGE_FILE,
|
|
244
234
|
PLUGIN_PAYLOAD_FILES,
|
|
245
|
-
PLUGIN_REQUIRED_PAYLOAD_TARGETS,
|
|
246
235
|
PLUGIN_ROOT_VARIABLE,
|
|
247
|
-
PLUGIN_VERSION_FILE,
|
|
248
236
|
buildClaudePluginHooks,
|
|
249
237
|
buildCodexPluginHooks,
|
|
250
238
|
buildCursorPluginHooks,
|
|
@@ -257,5 +245,6 @@ export {
|
|
|
257
245
|
pluginLauncherCommands,
|
|
258
246
|
pluginLauncherPosixCommand,
|
|
259
247
|
pluginLauncherPowerShellCommand,
|
|
248
|
+
pluginPackageManifest,
|
|
260
249
|
writeMarketplacePluginHooks
|
|
261
250
|
};
|
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.5",
|
|
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": 5
|
|
30
30
|
},
|
|
31
31
|
"engines": {
|
|
32
32
|
"node": ">=18"
|