@agent-watch-ai/edge 0.4.0 → 0.5.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.
Files changed (74) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +3 -3
  3. package/SECURITY.md +1 -1
  4. package/dist/config/config-store.js +1 -1
  5. package/dist/config/repo-config.js +1 -1
  6. package/dist/config/schemas/config.schema.d.ts +93 -857
  7. package/dist/config/schemas/config.schema.js +5 -5
  8. package/dist/credentials/credentials.js +2 -2
  9. package/dist/credentials/schemas/device-api.schema.d.ts +4 -51
  10. package/dist/credentials/schemas/device-state.schema.d.ts +3 -38
  11. package/dist/git/code-state.d.ts +33 -0
  12. package/dist/git/code-state.js +44 -0
  13. package/dist/git/constants/git.constants.d.ts +6 -0
  14. package/dist/git/constants/git.constants.js +6 -0
  15. package/dist/git/index.d.ts +2 -1
  16. package/dist/git/index.js +1 -0
  17. package/dist/git/types/git.types.d.ts +6 -0
  18. package/dist/privacy/command-fingerprint.d.ts +42 -0
  19. package/dist/privacy/command-fingerprint.js +249 -0
  20. package/dist/privacy/constants/command-fingerprint.constants.d.ts +34 -0
  21. package/dist/privacy/constants/command-fingerprint.constants.js +38 -0
  22. package/dist/privacy/index.d.ts +3 -1
  23. package/dist/privacy/index.js +2 -0
  24. package/dist/privacy/product-capture.js +19 -1
  25. package/dist/privacy/types/privacy.types.d.ts +7 -0
  26. package/dist/providers/antigravity/antigravity.adapter.js +3 -0
  27. package/dist/providers/antigravity/schemas/antigravity.schema.d.ts +18 -492
  28. package/dist/providers/claude/claude.adapter.js +12 -1
  29. package/dist/providers/claude/constants/claude.constants.d.ts +6 -0
  30. package/dist/providers/claude/constants/claude.constants.js +6 -0
  31. package/dist/providers/claude/schemas/claude.schema.d.ts +1 -43
  32. package/dist/providers/codex/codex.adapter.js +14 -0
  33. package/dist/providers/codex/schemas/codex.schema.d.ts +1 -41
  34. package/dist/providers/cursor/cursor.adapter.js +5 -2
  35. package/dist/providers/cursor/schemas/cursor.schema.d.ts +5 -85
  36. package/dist/providers/gemini/constants/gemini.constants.d.ts +2 -0
  37. package/dist/providers/gemini/constants/gemini.constants.js +2 -0
  38. package/dist/providers/gemini/constants/gemini.otel.constants.d.ts +10 -1
  39. package/dist/providers/gemini/constants/gemini.otel.constants.js +11 -2
  40. package/dist/providers/gemini/gemini.detect.d.ts +11 -0
  41. package/dist/providers/gemini/gemini.detect.js +14 -1
  42. package/dist/providers/gemini/gemini.hooks.d.ts +3 -3
  43. package/dist/providers/gemini/gemini.hooks.js +5 -5
  44. package/dist/providers/gemini/gemini.otel.d.ts +6 -6
  45. package/dist/providers/gemini/gemini.otel.js +392 -121
  46. package/dist/providers/gemini/schemas/gemini.schema.d.ts +1 -49
  47. package/dist/providers/shared/event-builder.d.ts +17 -2
  48. package/dist/providers/shared/event-builder.js +43 -3
  49. package/dist/providers/shared/install-record.d.ts +2 -0
  50. package/dist/providers/shared/install-record.js +3 -2
  51. package/dist/providers/shared/tooling.d.ts +7 -0
  52. package/dist/providers/shared/tooling.js +10 -1
  53. package/dist/providers/shared/types/adapter.types.d.ts +18 -0
  54. package/dist/storage/schemas/storage.schema.d.ts +11 -175
  55. package/dist/storage/schemas/storage.schema.js +7 -1
  56. package/dist/transport/schemas/queue.schema.d.ts +1 -16
  57. package/dist/transport/schemas/queue.schema.js +1 -1
  58. package/dist/turns/constants/turns.constants.d.ts +17 -0
  59. package/dist/turns/constants/turns.constants.js +17 -0
  60. package/dist/turns/index.d.ts +3 -2
  61. package/dist/turns/index.js +1 -0
  62. package/dist/turns/tool-events.d.ts +15 -0
  63. package/dist/turns/tool-events.js +59 -0
  64. package/dist/turns/turn-state.js +2 -2
  65. package/dist/turns/turn-summary.d.ts +1 -1
  66. package/dist/turns/turn-summary.js +1 -0
  67. package/dist/turns/turn-tracker.js +138 -7
  68. package/dist/turns/types/turn-state.types.d.ts +28 -1
  69. package/dist/turns/types/turn-summary.types.d.ts +30 -0
  70. package/dist/turns/types/turn-tracker.types.d.ts +10 -0
  71. package/docs/AUDIT_PROMPT.md +11 -0
  72. package/docs/DATA_HANDLING.md +58 -10
  73. package/docs/ENTERPRISE_DEPLOYMENT.md +2 -1
  74. package/package.json +9 -8
package/CHANGELOG.md CHANGED
@@ -6,6 +6,35 @@
6
6
  together from one `otel-vX.Y.Z` tag by `otel-release.yml`, at one version and
7
7
  only when both suites pass. `python-release.yml` no longer publishes alone.
8
8
 
9
+ ## 0.5.0
10
+
11
+ ### Behaviour change: turn summaries carry per-tool-call records
12
+
13
+ `turn.summary` gains `tool_events`: one content-free record per tool call, in
14
+ call order and capped at 200, from Claude Code, Codex, Cursor, Gemini CLI and
15
+ Antigravity. Each record has the tool, call id, status, exit code, start and
16
+ end times, and a fingerprint of the command or connector arguments, hashed in
17
+ memory. An allowlisted check that ran also carries HEAD and a digest of the
18
+ working tree. Nothing is sent with `capture.git` off. `docs/DATA_HANDLING.md`
19
+ lists every field. Needs a platform that accepts `tool_events` (AWT-674).
20
+
21
+ ### Behaviour change: Gemini CLI telemetry moves to `~/.gemini/.env`
22
+
23
+ Gemini CLI 0.63 and later ignore the `env` block in `settings.json`, so native
24
+ telemetry sent nothing. Setup, the hook bearer rewrite, `inspect`, the exporter
25
+ sweep and uninstall now use `~/.gemini/.env`, and remove a block an older
26
+ version left in `settings.json`. Re-run setup on machines with Gemini CLI.
27
+
28
+ ### Security: dependency updates
29
+
30
+ - `smol-toml`, the TOML parser the edge reads agent config files
31
+ with, is now `^1.9.1`, which clears GHSA-r4xh-jqrq-34v2 (quadratic-time
32
+ `parse()` on `<= 1.8.0`). No behaviour change.
33
+ - `zod` is now `^4.6.7` (from 3.x), which clears GHSA-mrhx-c7xc-m3w5
34
+ (memory exhaustion validating oversized constrained collections). It parses
35
+ the config, the delivery queue and every hook payload. No behaviour change:
36
+ nested config defaults still fill in from an empty section.
37
+
9
38
  ## 0.4.0
10
39
 
11
40
  - A Cursor MCP call keeps its server name: the before-hook carries it to the
package/README.md CHANGED
@@ -46,7 +46,7 @@ tracer_provider.add_span_processor(AgentWatchSpanProcessor(token="..."))
46
46
  |---|---|---|---|
47
47
  | **Claude Code** | `~/.claude/settings.json` | Logs, Traces, Metrics | Yes |
48
48
  | **OpenAI Codex** | `~/.codex/hooks.json` | Logs, Traces (`~/.codex/config.toml`) | Yes |
49
- | **Gemini CLI** | `~/.gemini/settings.json` | Logs, Traces, Metrics | Yes |
49
+ | **Gemini CLI** | `~/.gemini/settings.json` | Logs, Traces, Metrics (`~/.gemini/.env`) | Yes |
50
50
  | **Cursor** | `~/.cursor/hooks.json` | None | **No** |
51
51
  | **Google Antigravity** | `~/.gemini/config/hooks.json` | None | **No** |
52
52
 
@@ -57,7 +57,7 @@ branches, ticket keys — is reported for all five.
57
57
  Per-agent notes:
58
58
 
59
59
  * **OpenAI Codex** — new hooks must be trusted once: launch `codex`, type `/hooks`, approve the AgentWatch entries.
60
- * **Gemini CLI** — telemetry runs through `GEMINI_TELEMETRY_ENABLED` with `GEMINI_TELEMETRY_TARGET=local`, and the ingest token travels in `OTEL_EXPORTER_OTLP_HEADERS`; Gemini has no `otelHeadersHelper`.
60
+ * **Gemini CLI** — telemetry is written to `~/.gemini/.env` (Gemini 0.63+ does not apply the `settings.json` `env` block): `GEMINI_TELEMETRY_ENABLED` with `GEMINI_TELEMETRY_TARGET=local`, and the access token in `OTEL_EXPORTER_OTLP_HEADERS`; Gemini has no `otelHeadersHelper`. Gemini loads that file only in a trusted folder, and a project `.env` or `.gemini/.env` found first replaces it. The switch, target and endpoint are also set in the `settings.json` `telemetry` block, and `agentwatch status` warns when a project `.env` hides the token.
61
61
  * **Google Antigravity** — a turn is one *execution*: `PreInvocation`/`PostInvocation` bracket the model calls inside it and only `Stop` closes it. The prompt comes from `common.lastUserInput`; there is no user-prompt hook.
62
62
  * **Cursor** — the CLI emits shell hooks only; the full lifecycle exists in IDE sessions. Cloud agents need a committed `.cursor/hooks.json` and the package installed in the cloud environment. Accepted tab edits (`afterTabFileEdit`) are monitored; high-frequency `beforeTabFileRead` is ignored.
63
63
 
@@ -267,7 +267,7 @@ To try it locally: `BLOCK=1 npm run example` refuses every check.
267
267
 
268
268
  | Record | How | Contents |
269
269
  |---|---|---|
270
- | `turn.summary` | Edge hooks → `POST <backend>/v1/events` | One completed turn: prompt/response length and hash, tool counts, file paths (repo-relative, and home-relative outside a checkout), Git branch, ticket keys from the branch name and the opening prompt. Prompt text and shell/connector inputs only when opted in. Never response text. |
270
+ | `turn.summary` | Edge hooks → `POST <backend>/v1/events` | One completed turn: prompt/response length and hash, tool counts, file paths (repo-relative, and home-relative outside a checkout), Git branch, ticket keys from the branch name and the opening prompt. With Git capture on, `tool_events`: per tool call its order, status, exit code, times, a sha256 fingerprint of the normalized command or connector arguments (never the text), and for a test/lint/build check over 60 s the commit and a working-tree digest. Prompt text and shell/connector inputs only when opted in. Never response text. |
271
271
  | `llm.call` | The agent's own OTLP → `POST <backend>/v1/otlp/v1/logs` | Token usage, cost and latency per model request. The edge does not proxy this. |
272
272
  | `repo.snapshot` | Edge hooks, after a closed turn | Changed branch/commit metadata, including commit subjects, when Git capture is on. |
273
273
 
package/SECURITY.md CHANGED
@@ -23,7 +23,7 @@ bugs of the highest priority:
23
23
  Codex has no headers-helper mechanism, so its OTel exporter carries the device's one-hour
24
24
  access token inside `~/.codex/config.toml` — which setup therefore keeps at mode 0600, and
25
25
  every hook rewrites as the token rotates. Gemini stores the same access token in
26
- `~/.gemini/settings.json` (0600); it has no headers helper. The device secret is never written
26
+ `~/.gemini/.env` (0600); it has no headers helper. The device secret is never written
27
27
  to either file, and the install key only while the machine has no device yet: the
28
28
  first hook with a device token replaces it, and on Windows the next successful setup does (docs/NATIVE_OTLP_TOKENS.md).
29
29
  - a long-lived credential on disk in plaintext where an OS keychain exists. The edge exchanges
@@ -309,5 +309,5 @@ function fallbackConfig() {
309
309
  * @returns The joined description.
310
310
  */
311
311
  function describeIssues(issues) {
312
- return issues.map((issue) => `${issue.path.join('.')}: ${issue.message}`).join('; ');
312
+ return issues.map((issue) => `${issue.path.map(String).join('.')}: ${issue.message}`).join('; ');
313
313
  }
@@ -51,7 +51,7 @@ export function mergeRepoConfig(global, repoValue) {
51
51
  const merged = overlay(global, narrowed.value);
52
52
  const parsed = configSchema.safeParse(merged);
53
53
  if (!parsed.success) {
54
- const detail = parsed.error.issues.map((issue) => `${issue.path.join('.')}: ${issue.message}`).join('; ');
54
+ const detail = parsed.error.issues.map((issue) => `${issue.path.map(String).join('.')}: ${issue.message}`).join('; ');
55
55
  return { config: global, warnings: [...warnings, `${REPO_CONFIG_NAME}: invalid overrides ignored (${detail})`] };
56
56
  }
57
57
  return { config: parsed.data, warnings };