@agent-watch-ai/edge 0.6.0 → 0.7.1

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 (309) hide show
  1. package/CHANGELOG.md +288 -9
  2. package/README.md +307 -5
  3. package/dist/billing/billing-mode.d.ts +37 -5
  4. package/dist/billing/billing-mode.js +28 -19
  5. package/dist/billing/constants/billing.constants.d.ts +0 -2
  6. package/dist/billing/constants/billing.constants.js +0 -2
  7. package/dist/billing/index.d.ts +2 -1
  8. package/dist/billing/index.js +1 -1
  9. package/dist/billing/session-billing.d.ts +7 -3
  10. package/dist/billing/session-billing.js +34 -13
  11. package/dist/billing/types/billing.types.d.ts +7 -0
  12. package/dist/capture/capture-env.d.ts +147 -0
  13. package/dist/capture/capture-env.js +301 -0
  14. package/dist/capture/captured-step.d.ts +88 -0
  15. package/dist/capture/captured-step.js +503 -0
  16. package/dist/capture/constants/capture.constants.d.ts +85 -0
  17. package/dist/capture/constants/capture.constants.js +87 -0
  18. package/dist/capture/launched-runs.d.ts +43 -0
  19. package/dist/capture/launched-runs.js +157 -0
  20. package/dist/capture/node.cjs +697 -0
  21. package/dist/capture/node.d.cts +32 -0
  22. package/dist/capture/python/sitecustomize.py +832 -0
  23. package/dist/capture/schemas/capture.schema.d.ts +35 -0
  24. package/dist/capture/schemas/capture.schema.js +31 -0
  25. package/dist/capture/types/capture.types.d.ts +20 -0
  26. package/dist/capture/venv-loader.d.ts +68 -0
  27. package/dist/capture/venv-loader.js +189 -0
  28. package/dist/cli/constants/cli.constants.d.ts +23 -6
  29. package/dist/cli/constants/cli.constants.js +24 -7
  30. package/dist/cli/context.d.ts +19 -22
  31. package/dist/cli/context.js +23 -54
  32. package/dist/cli/doctor-run-capture.d.ts +21 -0
  33. package/dist/cli/doctor-run-capture.js +33 -0
  34. package/dist/cli/doctor.js +21 -68
  35. package/dist/cli/hook-check.d.ts +7 -2
  36. package/dist/cli/hook-check.js +30 -15
  37. package/dist/cli/hook.d.ts +14 -0
  38. package/dist/cli/hook.js +82 -1
  39. package/dist/cli/index.d.ts +1 -1
  40. package/dist/cli/index.js +1 -1
  41. package/dist/cli/misc.js +10 -2
  42. package/dist/cli/npm-global.d.ts +24 -0
  43. package/dist/cli/npm-global.js +77 -0
  44. package/dist/cli/npx-install.js +22 -6
  45. package/dist/cli/replay.d.ts +33 -0
  46. package/dist/cli/replay.js +228 -0
  47. package/dist/cli/setup.d.ts +10 -2
  48. package/dist/cli/setup.js +200 -31
  49. package/dist/cli/status.js +45 -5
  50. package/dist/cli/toggle.js +10 -0
  51. package/dist/cli/types/cli.types.d.ts +15 -1
  52. package/dist/cli/uninstall.js +42 -23
  53. package/dist/cli/update.js +3 -2
  54. package/dist/cli.js +104 -17
  55. package/dist/config/config-store.d.ts +15 -4
  56. package/dist/config/config-store.js +31 -7
  57. package/dist/config/config.d.ts +0 -2
  58. package/dist/config/config.js +0 -1
  59. package/dist/config/constants/config.constants.d.ts +8 -1
  60. package/dist/config/constants/config.constants.js +10 -1
  61. package/dist/config/events-transport.d.ts +15 -0
  62. package/dist/config/events-transport.js +29 -0
  63. package/dist/config/index.d.ts +2 -1
  64. package/dist/config/index.js +1 -0
  65. package/dist/config/root-config.d.ts +12 -0
  66. package/dist/config/root-config.js +24 -0
  67. package/dist/config/schemas/config.schema.d.ts +15 -2
  68. package/dist/config/schemas/config.schema.js +52 -8
  69. package/dist/config/types/config.types.d.ts +7 -0
  70. package/dist/core/index.d.ts +1 -1
  71. package/dist/core/index.js +1 -1
  72. package/dist/core/version.d.ts +9 -0
  73. package/dist/core/version.js +14 -0
  74. package/dist/core/which.d.ts +11 -0
  75. package/dist/core/which.js +18 -0
  76. package/dist/credentials/cloud-claim.d.ts +34 -0
  77. package/dist/credentials/cloud-claim.js +61 -0
  78. package/dist/credentials/constants/credentials.constants.d.ts +16 -1
  79. package/dist/credentials/constants/credentials.constants.js +17 -2
  80. package/dist/credentials/credential-status.js +1 -1
  81. package/dist/credentials/credentials.d.ts +3 -3
  82. package/dist/credentials/credentials.js +26 -12
  83. package/dist/credentials/device-api.d.ts +15 -1
  84. package/dist/credentials/device-api.js +12 -1
  85. package/dist/credentials/identity.d.ts +2 -2
  86. package/dist/credentials/identity.js +2 -2
  87. package/dist/credentials/install-key.d.ts +31 -0
  88. package/dist/credentials/install-key.js +58 -0
  89. package/dist/credentials/migration.d.ts +9 -7
  90. package/dist/credentials/migration.js +58 -18
  91. package/dist/credentials/secret-store.d.ts +12 -0
  92. package/dist/credentials/secret-store.js +18 -1
  93. package/dist/credentials/sign-in.d.ts +27 -0
  94. package/dist/credentials/sign-in.js +31 -1
  95. package/dist/credentials/token-refresher.d.ts +5 -1
  96. package/dist/credentials/token-refresher.js +10 -2
  97. package/dist/enforcement/enforcement.js +1 -1
  98. package/dist/events/constants/events.constants.d.ts +5 -2
  99. package/dist/events/constants/events.constants.js +4 -1
  100. package/dist/events/enrich.d.ts +14 -0
  101. package/dist/events/enrich.js +1 -1
  102. package/dist/events/index.d.ts +1 -0
  103. package/dist/events/product-event.d.ts +6 -3
  104. package/dist/events/types/events.types.d.ts +6 -0
  105. package/dist/events/types/replay-progress.types.d.ts +26 -0
  106. package/dist/events/types/replay-progress.types.js +1 -0
  107. package/dist/events/types/repo-tree.types.d.ts +2 -1
  108. package/dist/feature/ticket-candidates.d.ts +1 -1
  109. package/dist/git/checkout-root.d.ts +15 -0
  110. package/dist/git/checkout-root.js +18 -0
  111. package/dist/git/code-state.d.ts +2 -16
  112. package/dist/git/code-state.js +11 -12
  113. package/dist/git/constants/git.constants.d.ts +33 -11
  114. package/dist/git/constants/git.constants.js +45 -12
  115. package/dist/git/fingerprint.d.ts +3 -6
  116. package/dist/git/fingerprint.js +5 -8
  117. package/dist/git/git-context.js +5 -1
  118. package/dist/git/index.d.ts +1 -2
  119. package/dist/git/index.js +1 -1
  120. package/dist/git/repo-snapshot.d.ts +13 -4
  121. package/dist/git/repo-snapshot.js +53 -9
  122. package/dist/git/types/snapshot.types.d.ts +6 -0
  123. package/dist/pipeline/constants/pipeline.constants.d.ts +3 -0
  124. package/dist/pipeline/constants/pipeline.constants.js +3 -0
  125. package/dist/pipeline/hook-pipeline.js +82 -57
  126. package/dist/privacy/product-capture.js +2 -0
  127. package/dist/providers/antigravity/antigravity.capture.d.ts +2 -0
  128. package/dist/providers/antigravity/antigravity.capture.js +5 -0
  129. package/dist/providers/antigravity/antigravity.detect.js +8 -22
  130. package/dist/providers/antigravity/antigravity.provider.js +10 -3
  131. package/dist/providers/antigravity/constants/antigravity.constants.d.ts +1 -0
  132. package/dist/providers/antigravity/constants/antigravity.constants.js +1 -0
  133. package/dist/providers/claude/claude.adapter.js +9 -6
  134. package/dist/providers/claude/claude.detect.js +2 -17
  135. package/dist/providers/claude/claude.otel.d.ts +21 -3
  136. package/dist/providers/claude/claude.otel.js +216 -61
  137. package/dist/providers/claude/claude.provider.js +21 -1
  138. package/dist/providers/claude/claude.version.d.ts +9 -0
  139. package/dist/providers/claude/claude.version.js +28 -0
  140. package/dist/providers/claude/constants/claude.constants.d.ts +27 -0
  141. package/dist/providers/claude/constants/claude.constants.js +27 -0
  142. package/dist/providers/claude/constants/claude.otel.constants.d.ts +27 -0
  143. package/dist/providers/claude/constants/claude.otel.constants.js +45 -5
  144. package/dist/providers/claude/types/claude.types.d.ts +13 -0
  145. package/dist/providers/codex/codex.capture.d.ts +76 -0
  146. package/dist/providers/codex/codex.capture.js +454 -0
  147. package/dist/providers/codex/codex.detect.js +2 -4
  148. package/dist/providers/codex/codex.otel.d.ts +38 -2
  149. package/dist/providers/codex/codex.otel.js +50 -6
  150. package/dist/providers/codex/codex.provider.js +8 -0
  151. package/dist/providers/codex/codex.surface.d.ts +9 -0
  152. package/dist/{turns/codex-originator.js → providers/codex/codex.surface.js} +17 -3
  153. package/dist/providers/codex/codex.titles.d.ts +14 -0
  154. package/dist/providers/codex/codex.titles.js +35 -0
  155. package/dist/providers/codex/constants/codex.constants.d.ts +4 -0
  156. package/dist/providers/codex/constants/codex.constants.js +4 -0
  157. package/dist/providers/cursor/constants/cursor.constants.d.ts +17 -4
  158. package/dist/providers/cursor/constants/cursor.constants.js +25 -5
  159. package/dist/providers/cursor/cursor-mcp-memo.d.ts +34 -0
  160. package/dist/providers/cursor/cursor-mcp-memo.js +94 -0
  161. package/dist/providers/cursor/cursor.adapter.js +20 -82
  162. package/dist/providers/cursor/cursor.capture.d.ts +1 -0
  163. package/dist/providers/cursor/cursor.capture.js +4 -0
  164. package/dist/providers/cursor/cursor.detect.d.ts +5 -1
  165. package/dist/providers/cursor/cursor.detect.js +11 -26
  166. package/dist/providers/cursor/cursor.hooks.js +2 -2
  167. package/dist/providers/cursor/cursor.provider.js +16 -7
  168. package/dist/providers/cursor/cursor.titles.d.ts +14 -0
  169. package/dist/providers/cursor/cursor.titles.js +20 -0
  170. package/dist/providers/cursor/schemas/cursor.schema.d.ts +3 -3
  171. package/dist/providers/cursor/schemas/cursor.schema.js +5 -3
  172. package/dist/providers/gemini/constants/gemini.constants.d.ts +16 -0
  173. package/dist/providers/gemini/constants/gemini.constants.js +17 -0
  174. package/dist/providers/gemini/gemini.capture.d.ts +81 -0
  175. package/dist/providers/gemini/gemini.capture.js +210 -0
  176. package/dist/providers/gemini/gemini.detect.js +57 -24
  177. package/dist/providers/gemini/gemini.otel.d.ts +38 -2
  178. package/dist/providers/gemini/gemini.otel.js +56 -125
  179. package/dist/providers/gemini/gemini.provider.js +5 -0
  180. package/dist/providers/index.d.ts +1 -0
  181. package/dist/providers/index.js +1 -0
  182. package/dist/providers/provider.d.ts +8 -0
  183. package/dist/providers/provider.js +9 -0
  184. package/dist/providers/registry.d.ts +14 -0
  185. package/dist/providers/registry.js +14 -0
  186. package/dist/providers/shared/constants/hook-config.constants.d.ts +2 -0
  187. package/dist/providers/shared/constants/hook-config.constants.js +2 -0
  188. package/dist/providers/shared/constants/terminal-capture.constants.d.ts +6 -0
  189. package/dist/providers/shared/constants/terminal-capture.constants.js +6 -0
  190. package/dist/providers/shared/editor-paths.d.ts +8 -0
  191. package/dist/providers/shared/editor-paths.js +18 -0
  192. package/dist/providers/shared/hook-config.d.ts +5 -0
  193. package/dist/providers/shared/hook-config.js +39 -1
  194. package/dist/providers/shared/hooks-marker.d.ts +14 -0
  195. package/dist/providers/shared/hooks-marker.js +23 -0
  196. package/dist/providers/shared/install-record.d.ts +29 -0
  197. package/dist/providers/shared/install-record.js +52 -0
  198. package/dist/providers/shared/session-title-store.d.ts +23 -0
  199. package/dist/providers/shared/session-title-store.js +50 -0
  200. package/dist/providers/shared/terminal-capture.d.ts +41 -0
  201. package/dist/providers/shared/terminal-capture.js +109 -0
  202. package/dist/providers/shared/tooling.d.ts +21 -0
  203. package/dist/providers/shared/tooling.js +36 -1
  204. package/dist/providers/types/provider.types.d.ts +57 -4
  205. package/dist/replay/checkout-resolver.d.ts +56 -0
  206. package/dist/replay/checkout-resolver.js +173 -0
  207. package/dist/replay/codex-turns.d.ts +24 -0
  208. package/dist/replay/codex-turns.js +221 -0
  209. package/dist/replay/constants/replay.constants.d.ts +99 -0
  210. package/dist/replay/constants/replay.constants.js +102 -0
  211. package/dist/replay/describe.d.ts +10 -0
  212. package/dist/replay/describe.js +31 -0
  213. package/dist/replay/gemini-turns.d.ts +36 -0
  214. package/dist/replay/gemini-turns.js +192 -0
  215. package/dist/replay/machine.d.ts +34 -0
  216. package/dist/replay/machine.js +68 -0
  217. package/dist/replay/progress-event.d.ts +21 -0
  218. package/dist/replay/progress-event.js +45 -0
  219. package/dist/replay/replay-runner.d.ts +60 -0
  220. package/dist/replay/replay-runner.js +581 -0
  221. package/dist/replay/replay-scan.d.ts +84 -0
  222. package/dist/replay/replay-scan.js +182 -0
  223. package/dist/replay/replay-state.d.ts +108 -0
  224. package/dist/replay/replay-state.js +199 -0
  225. package/dist/replay/resume.d.ts +18 -0
  226. package/dist/replay/resume.js +34 -0
  227. package/dist/replay/start.d.ts +23 -0
  228. package/dist/replay/start.js +39 -0
  229. package/dist/replay/throttle.d.ts +36 -0
  230. package/dist/replay/throttle.js +44 -0
  231. package/dist/replay/transcript-turns.d.ts +35 -0
  232. package/dist/replay/transcript-turns.js +241 -0
  233. package/dist/replay/turn-event.d.ts +40 -0
  234. package/dist/replay/turn-event.js +127 -0
  235. package/dist/replay/types/replay.types.d.ts +198 -0
  236. package/dist/replay/types/replay.types.js +1 -0
  237. package/dist/replay/window.d.ts +28 -0
  238. package/dist/replay/window.js +41 -0
  239. package/dist/replay/worktree-map.d.ts +42 -0
  240. package/dist/replay/worktree-map.js +134 -0
  241. package/dist/snapshot/branch-selection.d.ts +40 -23
  242. package/dist/snapshot/branch-selection.js +71 -41
  243. package/dist/snapshot/constants/snapshot-stages.constants.d.ts +3 -1
  244. package/dist/snapshot/constants/snapshot-stages.constants.js +3 -1
  245. package/dist/snapshot/constants/snapshot.constants.d.ts +34 -7
  246. package/dist/snapshot/constants/snapshot.constants.js +34 -7
  247. package/dist/snapshot/index.d.ts +2 -2
  248. package/dist/snapshot/index.js +1 -1
  249. package/dist/snapshot/snapshot-pipeline.js +100 -26
  250. package/dist/snapshot/snapshot-state.js +6 -2
  251. package/dist/snapshot/tree-pipeline.d.ts +1 -1
  252. package/dist/snapshot/tree-pipeline.js +34 -15
  253. package/dist/snapshot/types/snapshot.types.d.ts +22 -3
  254. package/dist/storage/schemas/storage.schema.d.ts +2 -0
  255. package/dist/storage/schemas/storage.schema.js +6 -0
  256. package/dist/transport/delivery-stats.d.ts +13 -1
  257. package/dist/transport/delivery-stats.js +18 -2
  258. package/dist/transport/delivery.d.ts +4 -3
  259. package/dist/transport/delivery.js +21 -7
  260. package/dist/transport/identity-delivery.d.ts +20 -0
  261. package/dist/transport/identity-delivery.js +41 -0
  262. package/dist/transport/index.d.ts +2 -0
  263. package/dist/transport/index.js +1 -0
  264. package/dist/transport/types/delivery-flow.types.d.ts +7 -0
  265. package/dist/turns/claude-transcript.js +4 -12
  266. package/dist/turns/codex-transcript.d.ts +9 -0
  267. package/dist/turns/codex-transcript.js +27 -19
  268. package/dist/turns/constants/turns.constants.d.ts +29 -12
  269. package/dist/turns/constants/turns.constants.js +31 -19
  270. package/dist/turns/gemini-transcript.d.ts +19 -1
  271. package/dist/turns/gemini-transcript.js +29 -18
  272. package/dist/turns/index.d.ts +3 -4
  273. package/dist/turns/index.js +2 -3
  274. package/dist/turns/run-state.d.ts +71 -0
  275. package/dist/turns/run-state.js +114 -0
  276. package/dist/turns/tool-events.d.ts +11 -1
  277. package/dist/turns/tool-events.js +32 -9
  278. package/dist/turns/transcript.d.ts +15 -14
  279. package/dist/turns/transcript.js +23 -4
  280. package/dist/turns/turn-state.d.ts +82 -7
  281. package/dist/turns/turn-state.js +157 -10
  282. package/dist/turns/turn-summary.js +7 -2
  283. package/dist/turns/turn-tracker.d.ts +9 -16
  284. package/dist/turns/turn-tracker.js +163 -87
  285. package/dist/turns/types/transcript.types.d.ts +11 -1
  286. package/dist/turns/types/turn-provider.types.d.ts +33 -0
  287. package/dist/turns/types/turn-provider.types.js +1 -0
  288. package/dist/turns/types/turn-state.types.d.ts +9 -0
  289. package/dist/turns/types/turn-summary.types.d.ts +17 -1
  290. package/dist/turns/types/turn-tracker.types.d.ts +3 -1
  291. package/dist/turns/work-checkout.js +1 -2
  292. package/docs/AUDIT_PROMPT.md +10 -0
  293. package/docs/DATA_HANDLING.md +201 -13
  294. package/docs/ENTERPRISE_DEPLOYMENT.md +3 -3
  295. package/docs/PERFORMANCE.md +10 -0
  296. package/package.json +3 -2
  297. package/dist/events/canonical-event.d.ts +0 -10
  298. package/dist/events/canonical-event.js +0 -9
  299. package/dist/git/repository-root.d.ts +0 -39
  300. package/dist/git/repository-root.js +0 -131
  301. package/dist/git/types/repository-root.types.d.ts +0 -11
  302. package/dist/transport/transport.d.ts +0 -6
  303. package/dist/turns/codex-originator.d.ts +0 -11
  304. package/dist/turns/cursor-transcript.d.ts +0 -21
  305. package/dist/turns/cursor-transcript.js +0 -66
  306. package/dist/turns/native-session-titles.d.ts +0 -26
  307. package/dist/turns/native-session-titles.js +0 -102
  308. /package/dist/{git/types/repository-root.types.js → billing/types/billing.types.js} +0 -0
  309. /package/dist/{transport/transport.js → capture/types/capture.types.js} +0 -0
package/CHANGELOG.md CHANGED
@@ -2,10 +2,289 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.7.1
6
+
7
+ - The budget check before each turn now waits up to 500 ms for the platform's answer, up
8
+ from 300 ms. From outside the US the round trip alone took about 300 ms, so about half
9
+ the checks gave up and let the turn run unchecked. A config that still holds 300 (the
10
+ old default, which setup wrote into every config) is read as 500. Any other value you
11
+ set is kept.
12
+ - `setup --token` no longer leaves the organization install key in plain text in
13
+ `~/.agentwatch/config.json`. Once the key is exchanged for a device credential it
14
+ is kept in the same store as the device secret (keychain, DPAPI or the 0600
15
+ `credentials/` file), only to enroll again when the secret expires, and uninstall
16
+ removes it. A config written by an earlier version loses the key the next time
17
+ `agentwatch setup` runs for that machine entry or root. After uninstall, a reinstall needs the key again
18
+ (`--token` or `$AGENTWATCH_TOKEN`).
19
+ - A session's billing mode (subscription or API) is now sent for sessions started
20
+ outside a repository. When Edge looked at the processes that started the agent and
21
+ that look ran out of time or found nothing, the mode was never sent, so the calls
22
+ could show as pay per use. On a machine without project roots it is now always sent;
23
+ with roots it waits only while the look is still to be retried.
24
+ - `agentwatch setup --cloud` claims the device at the backend the managed settings block
25
+ sends usage to. Without `--endpoint` it went to `https://api.agent-watch.ai` even when
26
+ the block's `OTEL_EXPORTER_OTLP_ENDPOINT` named another gateway (a self-hosted or test
27
+ backend). It takes that gateway when the endpoint is `<gateway>/v1/otlp`, as Settings
28
+ renders it, and logs the backend before it sends the claim. The endpoint allowlist
29
+ still applies: a gateway that is not an Agent Watch host or loopback is refused, and
30
+ nothing is sent.
31
+ - `agentwatch doctor` no longer fails a healthy install on a busy machine. The check that
32
+ runs the installed hook command with `--version` now waits up to 10 s instead of 1.5 s;
33
+ under load Node alone can take about a second to start.
34
+ - `npx -y @agent-watch-ai/edge setup` and `agentwatch update` work when npm's global
35
+ folder has a UUID in its path. npm 11 prints such a segment as `***`; setup crashed
36
+ with `MODULE_NOT_FOUND` and update said Edge was not installed with `npm install -g`.
37
+ The masked segment is now found again on disk.
38
+ - A Claude Code turn ended with `/exit` or `/clear` right after its answer is no longer
39
+ lost. The background process that sends a terminal session's turn could find the
40
+ turn already deleted by the session's end; now the session end leaves its cleanup to
41
+ that process while it is still running.
42
+ - Run capture now counts a `python -I` (or `-E`) run inside a virtual environment.
43
+ Those flags make Python ignore `PYTHONPATH`, so the capture shim never loaded and
44
+ the run's spend was lost. When a coding agent runs a venv's interpreter by path
45
+ (`venv/bin/python -I run.py`), Edge leaves a one-line `agentwatch-capture.pth` in
46
+ that venv's `site-packages`. It loads the shim only when the process holds the
47
+ agent's capture `PYTHONPATH`, so the same venv run from your own terminal is
48
+ untouched. `agentwatch doctor` lists those venvs and `agentwatch uninstall`
49
+ removes the files; one it cannot remove is named, and `--purge` then keeps only
50
+ its record so a re-run can still find it. A `python -S` run, and a bare `python` resolved from an
51
+ activated venv, are still not captured.
52
+ - Replay follow-ups. A failed or denied edit no longer decides which checkout a
53
+ turn belongs to. A turn carried from an earlier edit in the same folder takes the
54
+ transcript's branch. A resumed replay still snapshots the branches an earlier leg
55
+ saw, and each group of forced branches gets its own time budget. `agentwatch replay
56
+ --stop` is heard while the worktree scan runs. With `capture.git` off, a rooted
57
+ replay runs no git over child checkouts. Setup's automatic replay ignores the
58
+ operator window variables, and an operator run names its window when it starts.
59
+ - Replay sends the checkout evidence the live hook sends. A turn's repository and
60
+ branch now come from the checkout holding most of its edits, then the session's
61
+ last changed checkout, then its folder. A deleted worktree resolves through the
62
+ `git worktree add` commands in your Claude Code transcripts. A file outside any
63
+ checkout is sent as live sends it: basename in the file lists, home-relative path
64
+ in the external lists.
65
+
66
+ - `agentwatch replay` accepts an explicit historical window through
67
+ `AGENTWATCH_OPERATOR_REPLAY_FROM` and `AGENTWATCH_OPERATOR_REPLAY_UNTIL`, for an
68
+ operator replaying a chosen period into a fresh isolated tenant. Both bounds are
69
+ required and an invalid window is refused. Such a run skips the local machine
70
+ gates and still honours backend health, refusals and rate limits. Replayed
71
+ branches are forced into repository snapshots and stay eligible after a squash
72
+ merge, and a rooted replay now indexes its direct child checkouts.
73
+
74
+ ## 0.7.0
75
+
76
+ - `agentwatch setup --agent <id>` now installs hooks into that one agent only. Before, the
77
+ flag was ignored and setup wrote hooks and native telemetry into every detected
78
+ agent. The native exporter settings (signals, endpoint, identity) are machine-wide,
79
+ so setup still rewrites the exporter of every agent installed before, not only the
80
+ one named. An unknown id, or an agent that is not detected, is refused before anything
81
+ is written. Setup with `--agent` starts no background replay, since a replay reads
82
+ every agent's sessions; `agentwatch replay` still does that by hand.
83
+ `uninstall --agent <id> --purge` is refused instead of skipping the purge without a
84
+ word. `--agent` is taken by setup, uninstall and hook; `off`, `on`, `doctor` and
85
+ `replay` now refuse it and exit 1 instead of acting on every agent, and
86
+ `uninstall --agent` with no value is refused instead of removing every agent and
87
+ revoking the device. `status` names a flag it does not take and still exits 0. The
88
+ help lists all five ids: claude, codex, cursor, gemini, antigravity.
89
+ - Cursor: setup no longer hooks `afterTabFileEdit` (a hook process on every Tab
90
+ accept that no turn could use) and takes an older registration off; run
91
+ `agentwatch setup` again to remove it from an existing install. Background
92
+ agent turns report surface `cloud`. A project `.cursor` folder counts as Cursor
93
+ installed only when it holds `hooks.json`. MCP server memos idle for 7 days are
94
+ deleted, checked at most once a day. Run
95
+ capture reads the editor settings under `%APPDATA%` on Windows.
96
+ - `agentwatch status` now shows what an agent cannot report, as doctor already did
97
+ for Cursor, while its hooks are installed and Agent Watch is on: no token usage in
98
+ its hooks or transcripts, and only shell hooks from `cursor-agent`. Setup prints
99
+ both notes for Cursor now, not only the first. A Cursor Stop no longer reads the
100
+ transcript tail for usage it never holds.
101
+ - The end of a Claude Code turn no longer waits for Edge to send it. In a terminal
102
+ session the Stop and SubagentStop hooks hand their work to a background process and
103
+ return in about 0.1 s; before, the developer waited for the send, about 1 s typically
104
+ and up to 6 s. Headless runs (`claude -p`, the Agent SDK, the GitHub Action) still process their Stop
105
+ before returning, because the session ends right after it. Nothing changes in
106
+ `~/.claude/settings.json`, so there is no need to run `agentwatch setup` again.
107
+ - A folder in `ignoredRoots` now also stops Claude Code's own telemetry: `agentwatch
108
+ otel-headers` prints no credential there, so the LLM calls Claude Code exports
109
+ from that folder are refused and nothing from it is counted. Claude Code asks for
110
+ headers about every 29 minutes, so a call exported with a header it already held
111
+ can still arrive. Codex and Gemini CLI keep a fixed credential in their own config
112
+ file and still export from an ignored folder.
113
+ - Run capture now reaches Codex and Gemini CLI as well. Setup adds the capture copy
114
+ to `NODE_OPTIONS` and `PYTHONPATH` in `[shell_environment_policy.set]` of Codex's
115
+ `config.toml` and in `~/.gemini/.env`, keeping any value you have there, and
116
+ uninstall takes out only those parts. It does not depend on those agents' native
117
+ export: usage only, so a developer's own telemetry config or withheld content
118
+ consent does not stop it. `agentwatch status` and `agentwatch doctor` say per agent
119
+ when it is off and why, including a Codex include filter that strips the keys, and
120
+ a project `.env` or a shell value that hides Gemini's. Cursor and Antigravity report
121
+ "no environment route" and nothing is written for them until the route is verified
122
+ on the app. The capture copy stays until the last agent's hooks are gone.
123
+ Setup also adds `<data dir>/captured`, and only that folder, to
124
+ `[sandbox_workspace_write] writable_roots` in Codex's `config.toml`; your entries
125
+ stay, credentials and the rest of the data dir stay outside it, and uninstall takes
126
+ out only our entry. Under Codex's default workspace-write sandbox on macOS, a
127
+ script's call is captured only if the script can reach the network and the record
128
+ can be attributed. Today the sandbox denies `ps`, so such records are dropped; the
129
+ spool root is in place for when that is fixed. Status says so, and names what works
130
+ today: `sandbox_mode = "danger-full-access"` or an escalated command. It says off,
131
+ and to run `agentwatch setup`, when the entry is missing, and warns under
132
+ `sandbox_mode = "read-only"` or a `default_permissions` profile, which Edge does not
133
+ edit.
134
+ - Edge counts the LLM calls of code Claude Code runs. A script Claude Code starts
135
+ through its shell tool, in the foreground or the background, has each Anthropic,
136
+ OpenAI, Google (Gemini, Vertex AI) and Bedrock call recorded, through an SDK or
137
+ raw HTTP, and delivered as a call of the session and turn that ran it, labelled
138
+ with the entry file. Usage only: no prompt, response or key is read or kept. Setup
139
+ copies the capture shims to `<data dir>/capture/` and adds that copy to
140
+ `NODE_OPTIONS` (`--require`) and `PYTHONPATH` in Claude Code's settings, keeping
141
+ the value you have. Uninstall takes out the copy and only those parts; restart
142
+ running Claude Code sessions after it, because Node refuses to start when a
143
+ `--require` target is missing. After updating Edge, run `agentwatch setup` to
144
+ refresh the copy; `agentwatch status` warns when it is out of date, and shows run
145
+ capture per agent and why when it is off. The untraced-runs notice is no longer
146
+ shown for a run whose calls were captured. Run `agentwatch setup` again and restart
147
+ Claude Code to turn it on.
148
+ - Each Claude Code cloud session claims a device of its own.
149
+ `agentwatch setup --cloud` runs from the organization's managed SessionStart
150
+ hook. In a Claude Code cloud session with no credential, it signs a claim with
151
+ the organization's cloud session key from the managed settings
152
+ (`AGENTWATCH_CLOUD_ORGANIZATION`, `AGENTWATCH_CLOUD_KEY`), trades it for a
153
+ device for the developer's Claude account email, and installs as setup does.
154
+ Every cloud VM is its own device, so two sessions no longer share one
155
+ credential. It never uses the VM's git email, installs nothing when no account
156
+ email is found, returns at once on resume, does nothing outside a cloud
157
+ session, and always exits 0. The README's managed settings block changes to
158
+ the one Settings shows; the setup-script path with an install key is unchanged.
159
+ - Edge refreshes its device token once when the gateway answers a plain 401.
160
+ When a second holder of the same device credential refreshed it, the first
161
+ holder's access token was dropped, the gateway answered a bare 401, and Edge
162
+ stopped sending and queued until the cached token aged out. Edge now refreshes
163
+ once, resends the batch once, and only then stops sending. Answers that name a
164
+ reason (revoked, unknown, expired secret, installation mismatch) behave as
165
+ before.
166
+ - Edge resends the repository's file listing (`repo.tree`, used when there is
167
+ no GitHub App) when the default branch's tree changes. It was sent once and
168
+ never refreshed, so files added later stayed unknown and tool use on them
169
+ could not be attributed. Edge compares the tree with the one it sent at most
170
+ once an hour per repository (one git lookup) and resends on a difference.
171
+ - Cursor turn summaries carry the Cursor account email (`account_email`, from
172
+ the hook's `user_email`) beside `developer_id`, except on a machine that
173
+ serves two tenants, and the session's mode from its sessionStart
174
+ (`session_mode` from `composer_mode`, `is_cloud_agent` from
175
+ `is_background_agent`). Needs the core contract that declares these fields;
176
+ an older core drops them.
177
+ - `agentwatch on` no longer stays disabled when an agent has its own telemetry
178
+ config that AgentWatch refuses to overwrite (Claude Code OTLP keys or its own
179
+ `otelHeadersHelper`, a Codex `[otel]` section, Gemini telemetry keys). That agent is skipped, as setup
180
+ skips it, and the off switch is cleared; before, `on` and `setup` refused
181
+ until `disabled.json` was deleted by hand.
182
+ - `agentwatch off` and `uninstall` no longer remove Claude Code telemetry
183
+ settings the developer had before AgentWatch: setup records what each key
184
+ held before it was set and uninstall puts it back, value and type alike.
185
+ With no record, env keys are removed only while the base OTLP endpoint is an
186
+ Agent Watch one, a signal sent to the developer's own per-signal endpoint
187
+ keeps what it needs, and every key left in place is named. Setups recorded by
188
+ earlier versions have no prior values, so their keys are still only removed.
189
+ - Setup, `off`, `on` and uninstall keep a symlinked agent JSON config
190
+ (`~/.claude/settings.json`, `~/.gemini/settings.json`, the Codex, Cursor and
191
+ Antigravity `hooks.json`, for example linked into a dotfiles repository by
192
+ stow or chezmoi): it is written at the link's target instead of the link
193
+ being replaced by a regular file. Codex `config.toml` and Gemini `.env` still
194
+ replace a link, because they hold the bearer token and it must not land in a
195
+ dotfiles repository.
196
+ - `agentwatch replay` (and setup's background replay) now replays Codex and
197
+ Gemini CLI sessions too, from `~/.codex/sessions` and `~/.gemini/tmp`, under
198
+ the same rules as Claude Code: metadata only, the 30-day window clamped to
199
+ the open charge period, the same throttle, `ignoredRoots` and per-folder
200
+ `.agentwatch.json`, and `replay.progress` counting every agent together.
201
+ Codex turns carry the live hook's `turn_id`, the repository of their folder
202
+ and no branch. Gemini chat files do not record the live hook's id, so only
203
+ Gemini turns that began before AgentWatch first installed Gemini hooks on the
204
+ machine are replayed (install state now records `hooksFirstInstalledAt`); a
205
+ machine whose Gemini hooks predate this version replays none. Gemini sessions
206
+ written before gemini-cli 0.46 record no token counts and are skipped, not
207
+ sent as `pending` turns. Setup reports any existing replay state for the
208
+ current identity and writes one machine-wide attempt marker, so a later setup
209
+ never starts a second automatic replay even after the credential changes. An
210
+ explicit `agentwatch replay --machine` or `--root <path>` still starts fresh.
211
+ - Checks run by background subagents, and checks past the 200-call cap, are
212
+ now sent. A tool record that completes after its turn closed rides the next
213
+ Stop's `tool_events` instead of waiting for the 24 h sweep, and the cap keeps
214
+ checks ahead of other calls.
215
+ - Claude Code turns carry names only: `tool_events[].skill` for a Skill call and
216
+ the turn summary's `command` for the slash command a first prompt opens with.
217
+ Both are withheld when `capture.git` is off and are listed in
218
+ `docs/DATA_HANDLING.md`. Older platforms ignore them.
219
+ - `ignoredRoots` in the machine config (global only): a plain entry ignores that
220
+ directory, `<dir>/**` its subtree. A hook in an ignored directory parses,
221
+ enforces, sends and queues nothing, and replay skips it. A malformed list is
222
+ refused, not read as empty.
223
+ - `repo.snapshot` leaves out branches whose work is already on the default
224
+ branch: no commits of their own (fully merged, or never committed on), a
225
+ squash or rebase merge `git merge-tree` shows changes nothing (git >= 2.38),
226
+ or an upstream that is `[gone]` on first sight (a branch already recorded
227
+ always gets a real check, so commits after the merge are sent). The ten-branch
228
+ window fills from the next-newest live branches: up to 100 are listed and at
229
+ most 20 checked per snapshot, inside the one-second budget. Unknown stays
230
+ sent: no trunk, an old git, a timeout or a merge that conflicts keep the
231
+ branch. Merged verdicts are cached by head and base, so they are not checked
232
+ again and new commits send the branch again. Every edge git call now runs
233
+ with `GIT_NO_LAZY_FETCH=1`, so a partial clone never fetches inside a hook.
234
+ - Gemini CLI is no longer reported as detected on a machine that only has
235
+ Antigravity. Antigravity also lives in `~/.gemini`, so the directory alone no
236
+ longer counts, nor do the Google sign-in files the two share: detection needs
237
+ a file only Gemini CLI writes (`tmp/`, `installation_id`, or a
238
+ `settings.json` holding more than what AgentWatch setup wrote), and a
239
+ `.gemini` in the working tree counts only when it is not the Gemini home or
240
+ `~/.gemini`.
5
241
  - `@agent-watch-ai/otel` (npm) and `agent-watch-otel` (PyPI) are released
6
242
  together from one `otel-vX.Y.Z` tag by `otel-release.yml`, at one version and
7
243
  only when both suites pass. `python-release.yml` no longer publishes alone.
8
244
 
245
+ ### Setup replays the developer's earlier Claude Code sessions
246
+
247
+ `agentwatch setup` now starts, in the background, a replay of the Claude Code
248
+ sessions already on the machine (`~/.claude/projects`), so a newly installed
249
+ developer appears with recent history instead of after their next session. It
250
+ sends the same metadata the hooks send for a turn (never prompt text unless
251
+ prompt capture is already on, never a commit), only for the last 30 days
252
+ (`--replay-days N`) and never from before the open charge period, one turn id
253
+ per prompt so it can never double-count a live turn or a second replay.
254
+ `--no-replay` skips it; `agentwatch replay --stop`, `--resume` and `--dry-run`
255
+ control it; `agentwatch status` shows its progress. It runs at the lowest
256
+ priority, 20 turns every 5 seconds, and waits while the machine is busy, on
257
+ battery or an agent is working. New record `replay.progress` (counts and the
258
+ window only). Needs a platform that accepts `replay.progress` and a replayed
259
+ `pending` turn status.
260
+
261
+ ### `@agent-watch-ai/otel` and `agent-watch-otel` 0.2.1
262
+
263
+ - Fixed (Node): an application whose OpenTelemetry resource still had a promised
264
+ attribute, such as the `host.id` of NodeSDK's default host detector, logged
265
+ "Accessing resource attributes before async attributes settled" for each LLM
266
+ span. The processor now reads the attributes that are already known
267
+ (`service.name`, `service.version`) and leaves the pending ones out, without
268
+ waiting. No span or call is dropped. The Python package changes only its version.
269
+
270
+ ### `@agent-watch-ai/otel` and `agent-watch-otel` 0.2.0
271
+
272
+ - **Changed: which agent a call is charged to.** An LLM span's agent is now the
273
+ first of the span attributes `agent.name`, `gen_ai.agent.name` and `llm.task`
274
+ that is set and not blank, and the span name only when none is. Before, it
275
+ was always the span name. An application that declares an agent name now
276
+ reports that name, in the stored call and in the pre-call budget check alike,
277
+ where 0.1.0 reported the span name. It is the rule Agent Watch already uses
278
+ when it reads the same spans from Phoenix or Langfuse, so both now name one
279
+ agent with one cap. Such an application's agents appear under their new
280
+ names from the upgrade on; history recorded under the span name stays where
281
+ it is. `guard(agentName)` with an explicit name is unchanged.
282
+ - A model call that reached the provider and failed (a 5xx, or a timeout or
283
+ reset after the request was sent) is reported as `errored`, with its input
284
+ estimated from the request body's size when the provider gave no count. A
285
+ 4xx, 429 included, is reported errored with no estimate; a call that never
286
+ connected carries neither.
287
+
9
288
  ## 0.6.0
10
289
 
11
290
  ### New record: `repo.tree`
@@ -16,7 +295,7 @@ declaration and route names, read from git's object store: never file contents,
16
295
  never the working copy, no blob or tree ids. It is what a tenant with no GitHub
17
296
  App gets its feature catalog named from. Needs `capture.git` and
18
297
  `capture.files`; `docs/DATA_HANDLING.md` lists every field. Needs a platform
19
- that accepts `repo.tree` (AWT-680).
298
+ that accepts `repo.tree`.
20
299
 
21
300
  ### Fields nothing reads are no longer sent
22
301
 
@@ -25,7 +304,7 @@ response's length and SHA-256), sends at most one `prompt_jira_ids` key (the
25
304
  platform reads only the first), and sends `content_hashes` as blob ids without
26
305
  paths. `repo.snapshot` drops branch `last_commit_at`, commit `authored_at` and
27
306
  each file's `status` letter. Records queued by an older release lose the same
28
- fields at delivery. Needs a platform that accepts their absence (AWT-682).
307
+ fields at delivery. Needs a platform that accepts their absence.
29
308
 
30
309
  ## 0.5.0
31
310
 
@@ -37,7 +316,7 @@ Antigravity. Each record has the tool, call id, status, exit code, start and
37
316
  end times, and a fingerprint of the command or connector arguments, hashed in
38
317
  memory. An allowlisted check that ran also carries HEAD and a digest of the
39
318
  working tree. Nothing is sent with `capture.git` off. `docs/DATA_HANDLING.md`
40
- lists every field. Needs a platform that accepts `tool_events` (AWT-674).
319
+ lists every field. Needs a platform that accepts `tool_events`.
41
320
 
42
321
  ### Behaviour change: Gemini CLI telemetry moves to `~/.gemini/.env`
43
322
 
@@ -114,7 +393,7 @@ version left in `settings.json`. Re-run setup on machines with Gemini CLI.
114
393
  - After a browser sign-in, setup names the account that approved it as the
115
394
  developer (`developer: you@company.com (signed in)`) and stores that email,
116
395
  instead of this checkout's git email. A gateway that does not yet send the
117
- approver (before AWT-555) gets the email stored on this machine with a note that the
396
+ approver gets the email stored on this machine with a note that the
118
397
  platform credits the approver; an approver that is not a plain email is
119
398
  ignored. The approver also replaces an explicit `--developer-email` for that
120
399
  scope, and it is the email hooks send with each turn and match per-developer
@@ -144,7 +423,7 @@ On its first run that reaches the backend, the edge trades the install key in
144
423
  `~/.agentwatch/config.json` for a per-device credential (`POST /v1/devices/enroll`),
145
424
  keeps the device secret in the macOS Keychain, libsecret or Windows DPAPI, and
146
425
  records the device beside the key in the config (the key stays until Codex and
147
- Gemini move to short-lived tokens, AWT-357). Hooks, `status`, `doctor` and the Claude Code
426
+ Gemini move to short-lived tokens). Hooks, `status`, `doctor` and the Claude Code
148
427
  header helper send a one-hour access token, refreshed by one process per machine.
149
428
  Without a keychain the secret is a 0600 file and `status`/`doctor` say so. A
150
429
  revoked device queues events and is reported once. `uninstall` removes the secret.
@@ -163,7 +442,7 @@ repo `.agentwatch.json` cannot set `device`. See `SECURITY.md` and `docs/DATA_HA
163
442
  A turn in a checkout with no branch checked out (an automated reviewer's
164
443
  worktree, or `git checkout <sha>`) now reports, as its branch, the one
165
444
  remote-tracking branch whose tip is the checked-out commit, without its remote's
166
- prefix, and that branch's ticket keys (AWT-439). When no branch or several point
445
+ prefix, and that branch's ticket keys. When no branch or several point
167
446
  there, or one of them is the repository's default branch (`<remote>/HEAD` names
168
447
  it, else `main` or `master`), the turn reports no branch, as before. A branch another
169
448
  active session changed is still withheld.
@@ -175,7 +454,7 @@ is sent beyond the branch name a checked-out branch would have sent.
175
454
  ### Behaviour change: sessions sharing a checkout are judged by their own work
176
455
 
177
456
  When several agent sessions work in one checkout, a turn no longer takes another
178
- session's work as its own (AWT-438):
457
+ session's work as its own:
179
458
 
180
459
  - A branch switch, pull or reset with no commit of the turn's own is no change.
181
460
  Before, it counted as a lesser change. An empty commit of the turn's own still
@@ -219,7 +498,7 @@ The edge now extracts ticket keys (same syntax as branch keys) from a session's
219
498
  opening prompt, on the machine, and sends them as `prompt_jira_ids` on every turn
220
499
  summary, at every tier, with no consent step. Every candidate key is sent, with no
221
500
  prefix filter, and the platform keeps only keys it knows; the edge no longer
222
- calls `GET /v1/ticket-prefixes` (AWT-326). The prompt text still leaves
501
+ calls `GET /v1/ticket-prefixes`. The prompt text still leaves
223
502
  only with `capture.promptText`. The keys are kept in a local memo,
224
503
  `prompt-tickets.json`, whose 24-hour expiry counts from SessionEnd.
225
504
  `capture.git: false` withholds `prompt_jira_ids`. See `docs/DATA_HANDLING.md`.
@@ -308,7 +587,7 @@ latency without introducing competing timeout controls. CLI/status transports
308
587
  remain reusable with a fresh timeout per request (3 seconds in status), including
309
588
  bounded isolation probes. Local budget deferrals do not spend retry attempts.
310
589
 
311
- ### New: browser sign-in enrollment (AWT-538)
590
+ ### New: browser sign-in enrollment
312
591
 
313
592
  `agentwatch setup "https://<backend>?organization=<organization id>"` starts a
314
593
  device-code session, prints the verification link and code, and polls until the