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