@ev-ai/agent-hook 1.3.11 → 1.4.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.
- package/COLLECTED-DATA.md +1 -1
- package/dist/cli.mjs +42 -42
- package/dist/hook.mjs +38 -38
- package/dist/launcher-update.mjs +1 -1
- package/dist/launcher.mjs +1 -1
- package/dist/managed-hooks-snippet.cjs +116 -5
- package/dist/managed-hooks-snippet.d.ts +13 -2
- package/dist/managed-hooks-snippet.mjs +114 -5
- package/dist/plugin-hooks.mjs +52 -6
- package/package.json +1 -1
package/COLLECTED-DATA.md
CHANGED
|
@@ -10,7 +10,7 @@ What `@ev-ai/agent-hook` POSTs to the ev-ai collector (`POST /{orgToken}/hook`,
|
|
|
10
10
|
| `session_end` | Session stops |
|
|
11
11
|
| `tool_invoked` | Tool, skill, MCP, shell, or file-edit hook fires |
|
|
12
12
|
|
|
13
|
-
Every event also carries: UTC timestamp, `installation_id` (per-machine under `~/.ev-ai/agent-hook/installation.json`; on ephemeral CI/cloud homes derived from platform seeds such as `GITHUB_REPOSITORY_ID`+`GITHUB_ACTOR` / `CODESPACE_NAME` / Cursor Cloud `CURSOR_PROJECT_DIR`+`CURSOR_USER_EMAIL` / Claude Code remote logged-in Claude account (`~/.claude.json` `oauthAccount.emailAddress`, lowercased and hashed; without a Claude login, origin remote + git author email), or pinned via `EV_AI_HOOK_INSTALLATION_ID`), runner `platform` (`claude` / `cursor` / `codex`), `platform_agent_id` (Layer-1 inventory join key: `{owner}/{repo}:{scopePath/}{markerDir}`, e.g. `acme/my-app:.claude` or `acme/my-app:apps/web/.cursor`), `session_id`, `turn_id`, raw `runner_event` name, `agent_hook_version`, `hook_delivery` (`plugin` when a runner plugin started the hook, `npx` when an npx hook command did, otherwise `null`), `host_arch`, `node_version`, `build_ms` (wall-clock milliseconds to assemble the envelope before the collector POST; not tool/session duration), and `self_config.operator` (human identity — see Operator identity below; skipped when `EV_AI_HOOK_USER_SPEC=off`). When the process was started by the npx launcher (`dist/launcher.mjs`), the envelope also includes `launcher_version`, `hook_source` (`bundled` / `cached` / `bootstrap`), `hook_fallback_reason` (string or `null`), and `launcher_scope_match` (whether the hook's POST URL hashes to the same collector scope the launcher resolved). Direct `node dist/hook.mjs`, the compiled binary, and the marketplace plugin launcher omit those four fields. On `session_start` only, a launcher-started hook also adds `launcher_scope` (the opaque collector-scope hash from `EV_AI_LAUNCHER_SCOPE`, never a token) and `launcher_attempt` (`n`, `latest_claim`, `outcome`, `finished_at`, `selection_version`, and when the `.done` recorded them `started_at`, `check_ms`, `download_ms`, `install_ms`, `total_ms`). `outcome` is a `.done` result (`updated`, `current`, `repaired`, `bundled`, `skipped:below_floor`, `skipped:quarantined`, `failed:*`, …) or `incomplete` when the latest claim has no `.done` past its owner budget. `started_at` is an ISO timestamp; the four `*_ms` fields are whole milliseconds for that update attempt: `check_ms` is the `/version` fetch, `download_ms` the hook artifact GET (absent when an installed or packaged copy was used), `install_ms` the local lookup, verify and install work, and `total_ms` the time from the attempt's claim (`started_at`) to its `.done`; a phase that did not run is omitted, and all five are absent for `incomplete` and for `.done` files written by older launchers. They are recorded even when `EV_AI_HOOK_PERF=0`. A log read error omits `launcher_attempt` and never delays the runner ack. Other events carry only the four launcher fields above.
|
|
13
|
+
Every event also carries: UTC timestamp, `installation_id` (per-machine under `~/.ev-ai/agent-hook/installation.json`; on ephemeral CI/cloud homes derived from platform seeds such as `GITHUB_REPOSITORY_ID`+`GITHUB_ACTOR` / `CODESPACE_NAME` / Cursor Cloud `CURSOR_PROJECT_DIR`+`CURSOR_USER_EMAIL` / Claude Code remote logged-in Claude account (`~/.claude.json` `oauthAccount.emailAddress`, lowercased and hashed; without a Claude login, origin remote + git author email), or pinned via `EV_AI_HOOK_INSTALLATION_ID`), runner `platform` (`claude` / `cursor` / `codex`), `platform_agent_id` (Layer-1 inventory join key: `{owner}/{repo}:{scopePath/}{markerDir}`, e.g. `acme/my-app:.claude` or `acme/my-app:apps/web/.cursor`), `session_id`, `turn_id`, raw `runner_event` name, `agent_hook_version`, `hook_delivery` (`plugin` when a runner plugin started the hook, `npx` when an npx hook command did, otherwise `null`), `host_arch`, `host_os` (`process.platform`: `darwin` / `linux` / `win32`), `node_version`, `build_ms` (wall-clock milliseconds to assemble the envelope before the collector POST; not tool/session duration), and `self_config.operator` (human identity — see Operator identity below; skipped when `EV_AI_HOOK_USER_SPEC=off`). When the process was started by the npx launcher (`dist/launcher.mjs`), the envelope also includes `launcher_version`, `hook_source` (`bundled` / `cached` / `bootstrap`), `hook_fallback_reason` (string or `null`), and `launcher_scope_match` (whether the hook's POST URL hashes to the same collector scope the launcher resolved). Direct `node dist/hook.mjs`, the compiled binary, and the marketplace plugin launcher omit those four fields. On `session_start` only, a launcher-started hook also adds `launcher_scope` (the opaque collector-scope hash from `EV_AI_LAUNCHER_SCOPE`, never a token) and `launcher_attempt` (`n`, `latest_claim`, `outcome`, `finished_at`, `selection_version`, and when the `.done` recorded them `started_at`, `check_ms`, `download_ms`, `install_ms`, `total_ms`). `outcome` is a `.done` result (`updated`, `current`, `repaired`, `bundled`, `skipped:below_floor`, `skipped:quarantined`, `failed:*`, …) or `incomplete` when the latest claim has no `.done` past its owner budget. `started_at` is an ISO timestamp; the four `*_ms` fields are whole milliseconds for that update attempt: `check_ms` is the `/version` fetch, `download_ms` the hook artifact GET (absent when an installed or packaged copy was used), `install_ms` the local lookup, verify and install work, and `total_ms` the time from the attempt's claim (`started_at`) to its `.done`; a phase that did not run is omitted, and all five are absent for `incomplete` and for `.done` files written by older launchers. They are recorded even when `EV_AI_HOOK_PERF=0`. A log read error omits `launcher_attempt` and never delays the runner ack. Other events carry only the four launcher fields above.
|
|
14
14
|
|
|
15
15
|
Every event also carries `perf`, timings of the hook's own run (no event content): `base` (`l` launcher, `h` hook process or `w` worker: whose start is time 0), `t` (one timeline in milliseconds since `base`: the start of each process, `l` / `h` / `w`, plus its marks `l0`–`l6`, `l6r` (replay spawn), `h0`–`h3`, `w0`–`w5` and `w4e` (operator identity done); see `docs/hooks/time-measure.md` in the source repo), `ack_ms` (a lower bound of how long the runner waited for the ack: until the hook process handed off to its background worker; absent for in-process events), `bootstrap` (true when the launcher blocked on a first-run update), `spans` (per-collector milliseconds, only on the `session_start` that ran the collectors: `git`, `operator`, `mcp_declared`, `self_config`, `virt`, `cloud`, `host_env`), and `prev` (the previous POST from this machine: `at` epoch ms when it finished, `post_ms` its duration). The previous POST's duration is kept in `~/.ev-ai/agent-hook/perf-prev.json`; reading it does not delete it, each POST overwrites it, and a record older than 24 hours is ignored. Set `EV_AI_HOOK_PERF=0` to omit those timings and stop writing that file.
|
|
16
16
|
|