@agent-watch-ai/edge 0.2.5 → 0.3.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 (346) hide show
  1. package/CHANGELOG.md +512 -0
  2. package/README.md +217 -96
  3. package/SECURITY.md +69 -0
  4. package/dist/billing/session-billing.d.ts +19 -0
  5. package/dist/billing/session-billing.js +52 -0
  6. package/dist/cli/args.d.ts +10 -0
  7. package/dist/cli/args.js +20 -0
  8. package/dist/cli/constants/cli.constants.d.ts +50 -4
  9. package/dist/cli/constants/cli.constants.js +54 -5
  10. package/dist/cli/context.d.ts +33 -2
  11. package/dist/cli/context.js +84 -14
  12. package/dist/cli/doctor.js +309 -32
  13. package/dist/cli/hook-check.d.ts +23 -0
  14. package/dist/cli/hook-check.js +114 -0
  15. package/dist/cli/hook.js +118 -7
  16. package/dist/cli/index.d.ts +3 -1
  17. package/dist/cli/index.js +3 -1
  18. package/dist/cli/misc.d.ts +11 -0
  19. package/dist/cli/misc.js +80 -4
  20. package/dist/cli/npx-install.d.ts +37 -0
  21. package/dist/cli/npx-install.js +79 -0
  22. package/dist/cli/open-browser.d.ts +39 -0
  23. package/dist/cli/open-browser.js +62 -0
  24. package/dist/cli/setup.d.ts +17 -8
  25. package/dist/cli/setup.js +439 -98
  26. package/dist/cli/status.js +82 -13
  27. package/dist/cli/toggle.d.ts +9 -0
  28. package/dist/cli/toggle.js +113 -0
  29. package/dist/cli/types/cli.types.d.ts +37 -3
  30. package/dist/cli/ui.d.ts +7 -0
  31. package/dist/cli/ui.js +10 -1
  32. package/dist/cli/uninstall.js +39 -2
  33. package/dist/cli/update.d.ts +17 -0
  34. package/dist/cli/update.js +76 -0
  35. package/dist/cli.js +100 -13
  36. package/dist/config/config-store.d.ts +57 -0
  37. package/dist/config/config-store.js +250 -12
  38. package/dist/config/config.d.ts +53 -6
  39. package/dist/config/config.js +66 -6
  40. package/dist/config/constants/config.constants.d.ts +113 -6
  41. package/dist/config/constants/config.constants.js +126 -8
  42. package/dist/config/destination.d.ts +24 -0
  43. package/dist/config/destination.js +33 -0
  44. package/dist/config/index.d.ts +7 -4
  45. package/dist/config/index.js +5 -3
  46. package/dist/config/repo-config.d.ts +11 -7
  47. package/dist/config/repo-config.js +64 -15
  48. package/dist/config/root-config.d.ts +72 -0
  49. package/dist/config/root-config.js +170 -0
  50. package/dist/config/schemas/config.schema.d.ts +721 -84
  51. package/dist/config/schemas/config.schema.js +388 -15
  52. package/dist/config/types/config.types.d.ts +15 -1
  53. package/dist/config/types/destination.types.d.ts +8 -0
  54. package/dist/core/async.d.ts +36 -0
  55. package/dist/core/async.js +68 -0
  56. package/dist/core/index.d.ts +1 -1
  57. package/dist/core/index.js +1 -1
  58. package/dist/core/object.d.ts +5 -0
  59. package/dist/core/object.js +9 -4
  60. package/dist/core/pipe.d.ts +0 -13
  61. package/dist/core/pipe.js +1 -9
  62. package/dist/core/types/core.types.d.ts +9 -0
  63. package/dist/core/types/core.types.js +0 -3
  64. package/dist/core/which.d.ts +14 -0
  65. package/dist/core/which.js +43 -3
  66. package/dist/credentials/budget.d.ts +9 -0
  67. package/dist/credentials/budget.js +16 -0
  68. package/dist/credentials/command-runner.d.ts +16 -0
  69. package/dist/credentials/command-runner.js +37 -0
  70. package/dist/credentials/constants/credentials.constants.d.ts +111 -0
  71. package/dist/credentials/constants/credentials.constants.js +112 -0
  72. package/dist/credentials/credential-status.d.ts +14 -0
  73. package/dist/credentials/credential-status.js +34 -0
  74. package/dist/credentials/credentials.d.ts +72 -0
  75. package/dist/credentials/credentials.js +253 -0
  76. package/dist/credentials/device-api.d.ts +64 -0
  77. package/dist/credentials/device-api.js +150 -0
  78. package/dist/credentials/device-state.d.ts +31 -0
  79. package/dist/credentials/device-state.js +51 -0
  80. package/dist/credentials/identity.d.ts +62 -0
  81. package/dist/credentials/identity.js +90 -0
  82. package/dist/credentials/index.d.ts +7 -0
  83. package/dist/credentials/index.js +5 -0
  84. package/dist/credentials/migration.d.ts +46 -0
  85. package/dist/credentials/migration.js +164 -0
  86. package/dist/credentials/schemas/device-api.schema.d.ts +77 -0
  87. package/dist/credentials/schemas/device-api.schema.js +33 -0
  88. package/dist/credentials/schemas/device-state.schema.d.ts +51 -0
  89. package/dist/credentials/schemas/device-state.schema.js +20 -0
  90. package/dist/credentials/secret-store.d.ts +54 -0
  91. package/dist/credentials/secret-store.js +217 -0
  92. package/dist/credentials/sign-in.d.ts +18 -0
  93. package/dist/credentials/sign-in.js +86 -0
  94. package/dist/credentials/token-refresher.d.ts +39 -0
  95. package/dist/credentials/token-refresher.js +185 -0
  96. package/dist/credentials/types/credentials.types.d.ts +195 -0
  97. package/dist/credentials/types/credentials.types.js +1 -0
  98. package/dist/enforcement/constants/enforcement.constants.d.ts +47 -1
  99. package/dist/enforcement/constants/enforcement.constants.js +56 -0
  100. package/dist/enforcement/decision-cache.d.ts +20 -1
  101. package/dist/enforcement/decision-cache.js +65 -2
  102. package/dist/enforcement/decision-client.d.ts +9 -8
  103. package/dist/enforcement/decision-client.js +62 -16
  104. package/dist/enforcement/enforcement.d.ts +23 -2
  105. package/dist/enforcement/enforcement.js +103 -15
  106. package/dist/enforcement/index.d.ts +4 -3
  107. package/dist/enforcement/index.js +3 -2
  108. package/dist/enforcement/types/enforcement.types.d.ts +64 -0
  109. package/dist/enrollment/constants/enrollment.constants.d.ts +2 -6
  110. package/dist/enrollment/constants/enrollment.constants.js +2 -6
  111. package/dist/enrollment/enrollment.d.ts +16 -0
  112. package/dist/enrollment/enrollment.js +54 -0
  113. package/dist/enrollment/index.d.ts +3 -7
  114. package/dist/enrollment/index.js +1 -1
  115. package/dist/enrollment/types/enrollment.types.d.ts +9 -13
  116. package/dist/events/constants/enrich.constants.d.ts +15 -0
  117. package/dist/events/constants/enrich.constants.js +15 -0
  118. package/dist/events/constants/events.constants.d.ts +6 -2
  119. package/dist/events/constants/events.constants.js +5 -1
  120. package/dist/events/enrich.js +92 -10
  121. package/dist/events/event-id.d.ts +0 -8
  122. package/dist/events/event-id.js +0 -10
  123. package/dist/events/index.d.ts +2 -2
  124. package/dist/events/index.js +1 -1
  125. package/dist/events/product-event.d.ts +9 -6
  126. package/dist/events/types/repo-snapshot.types.d.ts +7 -0
  127. package/dist/events/types/session-billing.types.d.ts +16 -0
  128. package/dist/events/types/session-billing.types.js +1 -0
  129. package/dist/feature/constants/feature.constants.d.ts +7 -0
  130. package/dist/feature/constants/feature.constants.js +7 -0
  131. package/dist/feature/index.d.ts +1 -1
  132. package/dist/feature/index.js +1 -1
  133. package/dist/feature/ticket-candidates.d.ts +14 -0
  134. package/dist/feature/ticket-candidates.js +26 -8
  135. package/dist/git/blob-hash.d.ts +21 -0
  136. package/dist/git/blob-hash.js +69 -0
  137. package/dist/git/checkout-root.d.ts +27 -0
  138. package/dist/git/checkout-root.js +75 -0
  139. package/dist/git/constants/git.constants.d.ts +160 -0
  140. package/dist/git/constants/git.constants.js +181 -0
  141. package/dist/git/fingerprint.d.ts +74 -0
  142. package/dist/git/fingerprint.js +219 -0
  143. package/dist/git/gate-checkout.d.ts +44 -0
  144. package/dist/git/gate-checkout.js +201 -0
  145. package/dist/git/git-context.d.ts +45 -0
  146. package/dist/git/git-context.js +61 -3
  147. package/dist/git/index.d.ts +4 -2
  148. package/dist/git/index.js +2 -1
  149. package/dist/git/manifest-repository.d.ts +13 -0
  150. package/dist/git/manifest-repository.js +92 -0
  151. package/dist/git/repo-snapshot.d.ts +29 -3
  152. package/dist/git/repo-snapshot.js +110 -7
  153. package/dist/git/repository-root.d.ts +39 -0
  154. package/dist/git/repository-root.js +131 -0
  155. package/dist/git/types/git.types.d.ts +55 -0
  156. package/dist/git/types/repository-root.types.d.ts +11 -0
  157. package/dist/git/types/repository-root.types.js +1 -0
  158. package/dist/git/types/snapshot.types.d.ts +9 -0
  159. package/dist/pipeline/constants/pipeline.constants.d.ts +7 -0
  160. package/dist/pipeline/constants/pipeline.constants.js +7 -0
  161. package/dist/pipeline/hook-pipeline.js +360 -32
  162. package/dist/pipeline/types/pipeline.types.d.ts +39 -4
  163. package/dist/privacy/constants/privacy.constants.js +15 -1
  164. package/dist/privacy/index.d.ts +1 -0
  165. package/dist/privacy/index.js +1 -0
  166. package/dist/privacy/product-capture.d.ts +12 -0
  167. package/dist/privacy/product-capture.js +73 -0
  168. package/dist/privacy/sanitizer.d.ts +21 -3
  169. package/dist/privacy/sanitizer.js +52 -8
  170. package/dist/process/ancestors.d.ts +39 -0
  171. package/dist/process/ancestors.js +121 -0
  172. package/dist/process/constants/process.constants.d.ts +34 -0
  173. package/dist/process/constants/process.constants.js +34 -0
  174. package/dist/process/index.d.ts +7 -0
  175. package/dist/process/index.js +2 -0
  176. package/dist/process/types/process.types.d.ts +23 -0
  177. package/dist/process/types/process.types.js +1 -0
  178. package/dist/providers/antigravity/antigravity.adapter.d.ts +12 -1
  179. package/dist/providers/antigravity/antigravity.adapter.js +21 -3
  180. package/dist/providers/antigravity/antigravity.detect.d.ts +0 -9
  181. package/dist/providers/antigravity/antigravity.detect.js +1 -1
  182. package/dist/providers/antigravity/antigravity.provider.js +3 -2
  183. package/dist/providers/antigravity/constants/antigravity.constants.d.ts +2 -0
  184. package/dist/providers/antigravity/constants/antigravity.constants.js +2 -0
  185. package/dist/providers/claude/claude.adapter.d.ts +11 -1
  186. package/dist/providers/claude/claude.adapter.js +26 -5
  187. package/dist/providers/claude/claude.otel.d.ts +32 -18
  188. package/dist/providers/claude/claude.otel.js +81 -6
  189. package/dist/providers/claude/claude.provider.js +5 -2
  190. package/dist/providers/claude/constants/claude.constants.d.ts +2 -0
  191. package/dist/providers/claude/constants/claude.constants.js +2 -0
  192. package/dist/providers/claude/constants/claude.otel.constants.d.ts +4 -0
  193. package/dist/providers/claude/constants/claude.otel.constants.js +8 -0
  194. package/dist/providers/codex/codex.adapter.d.ts +15 -1
  195. package/dist/providers/codex/codex.adapter.js +29 -5
  196. package/dist/providers/codex/codex.otel.d.ts +24 -2
  197. package/dist/providers/codex/codex.otel.js +147 -30
  198. package/dist/providers/codex/codex.provider.js +5 -2
  199. package/dist/providers/codex/constants/codex.constants.d.ts +2 -0
  200. package/dist/providers/codex/constants/codex.constants.js +16 -0
  201. package/dist/providers/codex/constants/codex.otel.constants.d.ts +5 -0
  202. package/dist/providers/codex/constants/codex.otel.constants.js +5 -0
  203. package/dist/providers/constants/provider.constants.d.ts +0 -3
  204. package/dist/providers/constants/provider.constants.js +0 -3
  205. package/dist/providers/cursor/constants/cursor.constants.d.ts +7 -0
  206. package/dist/providers/cursor/constants/cursor.constants.js +7 -0
  207. package/dist/providers/cursor/cursor.adapter.d.ts +33 -1
  208. package/dist/providers/cursor/cursor.adapter.js +52 -3
  209. package/dist/providers/cursor/cursor.detect.d.ts +0 -7
  210. package/dist/providers/cursor/cursor.detect.js +1 -1
  211. package/dist/providers/cursor/cursor.provider.js +5 -2
  212. package/dist/providers/gemini/constants/gemini.constants.d.ts +9 -0
  213. package/dist/providers/gemini/constants/gemini.constants.js +9 -0
  214. package/dist/providers/gemini/constants/gemini.otel.constants.d.ts +3 -1
  215. package/dist/providers/gemini/constants/gemini.otel.constants.js +3 -0
  216. package/dist/providers/gemini/gemini.adapter.d.ts +14 -1
  217. package/dist/providers/gemini/gemini.adapter.js +25 -5
  218. package/dist/providers/gemini/gemini.detect.d.ts +0 -7
  219. package/dist/providers/gemini/gemini.detect.js +1 -1
  220. package/dist/providers/gemini/gemini.otel.d.ts +19 -20
  221. package/dist/providers/gemini/gemini.otel.js +121 -17
  222. package/dist/providers/gemini/gemini.provider.js +2 -1
  223. package/dist/providers/index.d.ts +1 -1
  224. package/dist/providers/index.js +1 -1
  225. package/dist/providers/loaders.d.ts +10 -0
  226. package/dist/providers/loaders.js +40 -0
  227. package/dist/providers/provider.d.ts +11 -0
  228. package/dist/providers/provider.js +1 -1
  229. package/dist/providers/registry.d.ts +11 -8
  230. package/dist/providers/registry.js +11 -15
  231. package/dist/providers/shared/constants/hook-refusal.constants.d.ts +7 -0
  232. package/dist/providers/shared/constants/hook-refusal.constants.js +7 -0
  233. package/dist/providers/shared/constants/shell-directories.constants.d.ts +30 -0
  234. package/dist/providers/shared/constants/shell-directories.constants.js +39 -0
  235. package/dist/providers/shared/constants/tooling.constants.d.ts +18 -2
  236. package/dist/providers/shared/constants/tooling.constants.js +19 -3
  237. package/dist/providers/shared/event-builder.d.ts +12 -14
  238. package/dist/providers/shared/event-builder.js +20 -14
  239. package/dist/providers/shared/exporter-allowlist.d.ts +20 -0
  240. package/dist/providers/shared/exporter-allowlist.js +49 -0
  241. package/dist/providers/shared/hook-config.d.ts +2 -21
  242. package/dist/providers/shared/hook-config.js +5 -4
  243. package/dist/providers/shared/hook-refusal.d.ts +12 -0
  244. package/dist/providers/shared/hook-refusal.js +17 -1
  245. package/dist/providers/shared/install-record.d.ts +12 -2
  246. package/dist/providers/shared/install-record.js +5 -2
  247. package/dist/providers/shared/shell-directories.d.ts +24 -0
  248. package/dist/providers/shared/shell-directories.js +90 -0
  249. package/dist/providers/shared/tooling.d.ts +12 -1
  250. package/dist/providers/shared/tooling.js +18 -0
  251. package/dist/providers/shared/types/adapter.types.d.ts +1 -2
  252. package/dist/providers/types/provider.types.d.ts +57 -1
  253. package/dist/snapshot/constants/snapshot.constants.d.ts +32 -0
  254. package/dist/snapshot/constants/snapshot.constants.js +33 -0
  255. package/dist/snapshot/snapshot-event.js +52 -11
  256. package/dist/snapshot/snapshot-pipeline.js +1 -1
  257. package/dist/snapshot/types/snapshot.types.d.ts +2 -0
  258. package/dist/storage/atomic-file.d.ts +7 -0
  259. package/dist/storage/atomic-file.js +1 -1
  260. package/dist/storage/constants/storage.constants.d.ts +17 -0
  261. package/dist/storage/constants/storage.constants.js +17 -0
  262. package/dist/storage/disabled.d.ts +13 -0
  263. package/dist/storage/disabled.js +24 -0
  264. package/dist/storage/index.d.ts +2 -0
  265. package/dist/storage/index.js +2 -0
  266. package/dist/storage/paths.js +3 -2
  267. package/dist/storage/schemas/storage.schema.d.ts +72 -0
  268. package/dist/storage/schemas/storage.schema.js +6 -0
  269. package/dist/storage/sweep-marker.d.ts +19 -0
  270. package/dist/storage/sweep-marker.js +55 -0
  271. package/dist/storage/types/storage.types.d.ts +2 -0
  272. package/dist/storage/uninstalled.d.ts +58 -0
  273. package/dist/storage/uninstalled.js +107 -0
  274. package/dist/transport/auth-block.d.ts +66 -0
  275. package/dist/transport/auth-block.js +129 -0
  276. package/dist/transport/constants/transport.constants.d.ts +82 -3
  277. package/dist/transport/constants/transport.constants.js +83 -4
  278. package/dist/transport/cooldown.js +8 -1
  279. package/dist/transport/delivery.d.ts +14 -6
  280. package/dist/transport/delivery.js +80 -55
  281. package/dist/transport/http-transport.d.ts +1 -0
  282. package/dist/transport/http-transport.js +52 -10
  283. package/dist/transport/index.d.ts +6 -3
  284. package/dist/transport/index.js +3 -0
  285. package/dist/transport/queue-partition.d.ts +91 -0
  286. package/dist/transport/queue-partition.js +143 -0
  287. package/dist/transport/queue.d.ts +99 -20
  288. package/dist/transport/queue.js +210 -69
  289. package/dist/transport/response-body.d.ts +25 -0
  290. package/dist/transport/response-body.js +64 -0
  291. package/dist/transport/send.d.ts +11 -0
  292. package/dist/transport/send.js +17 -0
  293. package/dist/transport/types/delivery-flow.types.d.ts +19 -0
  294. package/dist/transport/types/delivery-flow.types.js +1 -0
  295. package/dist/transport/types/transport.types.d.ts +45 -0
  296. package/dist/turns/claude-transcript.d.ts +19 -1
  297. package/dist/turns/claude-transcript.js +46 -1
  298. package/dist/turns/codex-originator.d.ts +11 -0
  299. package/dist/turns/codex-originator.js +31 -0
  300. package/dist/turns/codex-transcript.d.ts +30 -0
  301. package/dist/turns/codex-transcript.js +88 -0
  302. package/dist/turns/constants/turns.constants.d.ts +141 -5
  303. package/dist/turns/constants/turns.constants.js +155 -5
  304. package/dist/turns/file-identity.d.ts +27 -0
  305. package/dist/turns/file-identity.js +48 -0
  306. package/dist/turns/gemini-transcript.d.ts +30 -0
  307. package/dist/turns/gemini-transcript.js +96 -0
  308. package/dist/turns/index.d.ts +3 -3
  309. package/dist/turns/index.js +1 -1
  310. package/dist/turns/inherited-checkout.d.ts +54 -0
  311. package/dist/turns/inherited-checkout.js +155 -0
  312. package/dist/turns/native-session-titles.d.ts +26 -0
  313. package/dist/turns/native-session-titles.js +102 -0
  314. package/dist/turns/transcript.d.ts +3 -2
  315. package/dist/turns/transcript.js +5 -1
  316. package/dist/turns/turn-state.d.ts +224 -3
  317. package/dist/turns/turn-state.js +456 -21
  318. package/dist/turns/turn-summary.d.ts +1 -14
  319. package/dist/turns/turn-summary.js +87 -51
  320. package/dist/turns/turn-tracker.d.ts +21 -2
  321. package/dist/turns/turn-tracker.js +379 -56
  322. package/dist/turns/types/transcript.types.d.ts +5 -0
  323. package/dist/turns/types/turn-state.types.d.ts +116 -5
  324. package/dist/turns/types/turn-summary.types.d.ts +64 -14
  325. package/dist/turns/types/turn-tracker.types.d.ts +27 -1
  326. package/dist/turns/work-checkout.d.ts +65 -0
  327. package/dist/turns/work-checkout.js +666 -0
  328. package/dist/untraced/constants/untraced.constants.d.ts +31 -0
  329. package/dist/untraced/constants/untraced.constants.js +63 -0
  330. package/dist/untraced/untraced.d.ts +35 -0
  331. package/dist/untraced/untraced.js +105 -0
  332. package/dist/update/constants/update.constants.d.ts +18 -0
  333. package/dist/update/constants/update.constants.js +20 -0
  334. package/dist/update/update-check.d.ts +52 -0
  335. package/dist/update/update-check.js +113 -0
  336. package/docs/AUDIT_PROMPT.md +129 -0
  337. package/docs/DATA_HANDLING.md +648 -0
  338. package/docs/ENTERPRISE_DEPLOYMENT.md +179 -0
  339. package/docs/PERFORMANCE.md +81 -0
  340. package/package.json +14 -4
  341. package/dist/enrollment/enrollment-provider.d.ts +0 -5
  342. package/dist/enrollment/manual-enrollment.d.ts +0 -32
  343. package/dist/enrollment/manual-enrollment.js +0 -72
  344. package/example/README.md +0 -43
  345. package/example/server.mjs +0 -240
  346. /package/dist/{enrollment/enrollment-provider.js → config/types/destination.types.js} +0 -0
@@ -1,3 +1,4 @@
1
+ import path from 'node:path';
1
2
  import { asRecord, firstString } from '../../core/object.js';
2
3
  import { sha256Hex } from '../../events/event-id.js';
3
4
  import { COMMAND_KEYS, FILE_EDIT_TOOLS, FILE_PATH_KEYS, FILE_READ_TOOLS, MCP_TOOL_PREFIX, MCP_TOOL_SEPARATOR, SHELL_TOOLS } from './constants/tooling.constants.js';
@@ -101,3 +102,20 @@ export function extractCommand(toolInput) {
101
102
  return undefined;
102
103
  return firstString(record, COMMAND_KEYS);
103
104
  }
105
+ /**
106
+ * A shell call out of untrusted payload fields, type-checked.
107
+ *
108
+ * A working directory counts only when it is an absolute path: a relative one
109
+ * would have to be resolved against a guess.
110
+ *
111
+ * @param command - The command field as the payload carries it.
112
+ * @param workdir - The working-directory field as the payload carries it.
113
+ * @returns The call, or undefined when neither field is usable.
114
+ */
115
+ export function shellCallOf(command, workdir) {
116
+ const call = {
117
+ command: typeof command === 'string' && command.length > 0 ? command : undefined,
118
+ workdir: typeof workdir === 'string' && path.isAbsolute(workdir) ? workdir : undefined
119
+ };
120
+ return call.command || call.workdir ? call : undefined;
121
+ }
@@ -44,8 +44,7 @@ export interface ToolCallInput {
44
44
  }
45
45
  /** What the effective config allows to be captured. */
46
46
  export interface CapturePolicy {
47
- readonly prompts: boolean;
48
- readonly responses: boolean;
47
+ readonly promptText: boolean;
49
48
  readonly toolInput: boolean;
50
49
  readonly toolOutput: boolean;
51
50
  readonly files: boolean;
@@ -1,4 +1,4 @@
1
- import type { AgentWatchConfig } from '../../config/types/config.types.js';
1
+ import type { AgentWatchConfig, OtelSignalName } from '../../config/types/config.types.js';
2
2
  import type { Env } from '../../core/types/core.types.js';
3
3
  import type { AgentWatchEvent } from '../../events/types/events.types.js';
4
4
  import type { AgentWatchPaths, InstallState } from '../../storage/types/storage.types.js';
@@ -57,6 +57,23 @@ export interface NativeTelemetryConfigurator {
57
57
  inspect(context: SetupContext): Promise<NativeTelemetryStatus>;
58
58
  configure(context: SetupContext): Promise<SetupOutcome>;
59
59
  uninstall(context: SetupContext): Promise<SetupOutcome>;
60
+ /**
61
+ * Where the AgentWatch-owned exporter config sends, as the agent's file says
62
+ * now: exactly the entries `uninstall` would remove, so a refused host is only
63
+ * ever cleared from what AgentWatch can show it wrote. Empty when there is none.
64
+ */
65
+ exporterEndpoints(context: SetupContext): Promise<readonly string[]>;
66
+ /**
67
+ * Signals this machine asked for that the agent will not be given, because
68
+ * the content its logs carry has no consent.
69
+ *
70
+ * Doctor reports the gate, and the only truthful answer is the configurator's
71
+ * own rule: Codex takes logs and traces all-or-nothing on the two tool flags,
72
+ * Gemini never gets traces, which carry prompts past the edge's scrubber. An
73
+ * agent with no content gate — Claude, which has per-field switches — omits
74
+ * this and is never reported as held back.
75
+ */
76
+ withheldSignals?(config: AgentWatchConfig): readonly OtelSignalName[];
60
77
  }
61
78
  export interface AgentProvider {
62
79
  readonly id: string;
@@ -78,6 +95,12 @@ export interface AgentProvider {
78
95
  * how to say it.
79
96
  */
80
97
  getBlockResponse?(payload: unknown, message: string): ProviderHookResponse | undefined;
98
+ /**
99
+ * How to show the developer one line after a tool ran, without blocking or
100
+ * informing the model. Undefined means this hook (or this agent) has no such
101
+ * channel, and the line is not shown.
102
+ */
103
+ getNoticeResponse?(payload: unknown, message: string): ProviderHookResponse | undefined;
81
104
  /**
82
105
  * Working directory this payload was produced in, when the provider does not
83
106
  * report it as a top-level `cwd`. Git context, repository config and ticket
@@ -85,8 +108,28 @@ export interface AgentProvider {
85
108
  * reports `common.workspacePaths`) has to say where it is.
86
109
  */
87
110
  resolveCwd?(payload: unknown): string | undefined;
111
+ /**
112
+ * The shell command a tool-start payload is about to run, and the directory
113
+ * it runs in when the agent reports one apart from `cwd`.
114
+ *
115
+ * Read by one pipeline stage only, in memory, for the directory names in it;
116
+ * the text is dropped there and never reaches an event, a record or a log.
117
+ * Undefined for any payload that is not a shell call.
118
+ */
119
+ shellCall?(payload: unknown): ShellCall | undefined;
120
+ /**
121
+ * The folders the agent has open, when it reports them apart from `cwd`
122
+ * (Cursor's `workspace_roots`). Candidates for the checkout a turn worked in,
123
+ * as weak as the cwd: git decides whether the turn changed one.
124
+ */
125
+ workspaceRoots?(payload: unknown): readonly string[] | undefined;
88
126
  readonly nativeTelemetry?: NativeTelemetryConfigurator;
89
127
  }
128
+ /** A shell call as the agent is about to run it. Memory only; see `AgentProvider.shellCall`. */
129
+ export interface ShellCall {
130
+ readonly command?: string;
131
+ readonly workdir?: string;
132
+ }
90
133
  /** How a tool call is classified for canonical event mapping. */
91
134
  export type ToolKind = 'shell' | 'mcp' | 'file-read' | 'file-edit' | 'other';
92
135
  /** Lifecycle position of a tool event. */
@@ -96,3 +139,16 @@ export interface McpToolName {
96
139
  readonly server?: string;
97
140
  readonly tool?: string;
98
141
  }
142
+ /** One agent whose AgentWatch-owned exporter sent somewhere the edge would not. */
143
+ export interface RefusedExporter {
144
+ readonly agent: string;
145
+ /** Whether its owned entries are gone; false when the agent's file could not be changed. */
146
+ readonly removed: boolean;
147
+ /** One line naming the agent, the refused origin and the outcome. */
148
+ readonly message: string;
149
+ }
150
+ /** What a pass over the agents' exporters did, and the install state after it. */
151
+ export interface ExporterSweep {
152
+ readonly installState: InstallState;
153
+ readonly refused: readonly RefusedExporter[];
154
+ }
@@ -52,5 +52,37 @@ export declare const SNAPSHOT_MAX_SUBJECT_LENGTH = 200;
52
52
  * would report work under a name that does not exist.
53
53
  */
54
54
  export declare const SNAPSHOT_MAX_BRANCH_NAME_LENGTH = 255;
55
+ /**
56
+ * How many changed files one branch may name across its commits (AWT-323).
57
+ *
58
+ * Newest commit first, so the work being done now is what survives the cap; a
59
+ * single commit may use all of it, which is also the backend's per-commit cap.
60
+ * The files are what lets grouping compare branches by content rather than by
61
+ * title, and a few hundred is plenty; past it is a vendored tree, a mass rename
62
+ * or generated churn. The rest are dropped, in git's (alphabetical) order
63
+ * within a commit, and nothing marks that they were.
64
+ *
65
+ * Per branch rather than only per commit because the queue drains by count, not
66
+ * bytes: ten branches of twenty two-hundred-file commits would be ~3 MB per
67
+ * snapshot, and twenty-five of those in one drain pass is a 413, which loses
68
+ * the batch. With {@link SNAPSHOT_MAX_FILE_BYTES_PER_BRANCH} beside it, a
69
+ * snapshot's files stay under ~210 KB however long the paths are.
70
+ */
71
+ export declare const SNAPSHOT_MAX_FILES_PER_BRANCH = 200;
72
+ /**
73
+ * And how many bytes of path one branch may spend, for the same reason: two
74
+ * hundred paths of a thousand characters would be ten times the size the count
75
+ * alone suggests. 16 KiB is two hundred paths of ~80 bytes, past every branch
76
+ * measured (docs/PERFORMANCE.md).
77
+ */
78
+ export declare const SNAPSHOT_MAX_FILE_BYTES_PER_BRANCH: number;
79
+ /** The longest path the backend stores; a longer one is dropped, as it would be there. */
80
+ export declare const SNAPSHOT_MAX_PATH_LENGTH = 1024;
81
+ /**
82
+ * A path holding one of these is not sent: git `-z` prints it raw, and a newline
83
+ * or the listing's own record separator inside it is what a truncated or
84
+ * mis-split listing is made of.
85
+ */
86
+ export declare const SNAPSHOT_RE_CONTROL_CHARACTER: RegExp;
55
87
  /** Hex characters kept from the repository digest that names a state file. */
56
88
  export declare const SNAPSHOT_STATE_HASH_LENGTH = 32;
@@ -52,5 +52,38 @@ export const SNAPSHOT_MAX_SUBJECT_LENGTH = 200;
52
52
  * would report work under a name that does not exist.
53
53
  */
54
54
  export const SNAPSHOT_MAX_BRANCH_NAME_LENGTH = 255;
55
+ /**
56
+ * How many changed files one branch may name across its commits (AWT-323).
57
+ *
58
+ * Newest commit first, so the work being done now is what survives the cap; a
59
+ * single commit may use all of it, which is also the backend's per-commit cap.
60
+ * The files are what lets grouping compare branches by content rather than by
61
+ * title, and a few hundred is plenty; past it is a vendored tree, a mass rename
62
+ * or generated churn. The rest are dropped, in git's (alphabetical) order
63
+ * within a commit, and nothing marks that they were.
64
+ *
65
+ * Per branch rather than only per commit because the queue drains by count, not
66
+ * bytes: ten branches of twenty two-hundred-file commits would be ~3 MB per
67
+ * snapshot, and twenty-five of those in one drain pass is a 413, which loses
68
+ * the batch. With {@link SNAPSHOT_MAX_FILE_BYTES_PER_BRANCH} beside it, a
69
+ * snapshot's files stay under ~210 KB however long the paths are.
70
+ */
71
+ export const SNAPSHOT_MAX_FILES_PER_BRANCH = 200;
72
+ /**
73
+ * And how many bytes of path one branch may spend, for the same reason: two
74
+ * hundred paths of a thousand characters would be ten times the size the count
75
+ * alone suggests. 16 KiB is two hundred paths of ~80 bytes, past every branch
76
+ * measured (docs/PERFORMANCE.md).
77
+ */
78
+ export const SNAPSHOT_MAX_FILE_BYTES_PER_BRANCH = 16 * 1024;
79
+ /** The longest path the backend stores; a longer one is dropped, as it would be there. */
80
+ export const SNAPSHOT_MAX_PATH_LENGTH = 1024;
81
+ /**
82
+ * A path holding one of these is not sent: git `-z` prints it raw, and a newline
83
+ * or the listing's own record separator inside it is what a truncated or
84
+ * mis-split listing is made of.
85
+ */
86
+ // eslint-disable-next-line no-control-regex -- matching control characters is the point
87
+ export const SNAPSHOT_RE_CONTROL_CHARACTER = /[\x00-\x1f\x7f]/;
55
88
  /** Hex characters kept from the repository digest that names a state file. */
56
89
  export const SNAPSHOT_STATE_HASH_LENGTH = 32;
@@ -1,7 +1,9 @@
1
+ import path from 'node:path';
1
2
  import { compact } from '../core/object.js';
2
3
  import { deriveEventId, sha256Hex } from '../events/event-id.js';
3
4
  import { EVENT_SCHEMA_VERSION } from '../events/constants/events.constants.js';
4
- import { SNAPSHOT_MAX_BRANCH_NAME_LENGTH, SNAPSHOT_MAX_SUBJECT_LENGTH } from './constants/snapshot.constants.js';
5
+ import { RE_SECRET_FILE } from '../git/constants/git.constants.js';
6
+ import { SNAPSHOT_MAX_BRANCH_NAME_LENGTH, SNAPSHOT_MAX_FILE_BYTES_PER_BRANCH, SNAPSHOT_MAX_FILES_PER_BRANCH, SNAPSHOT_MAX_PATH_LENGTH, SNAPSHOT_MAX_SUBJECT_LENGTH, SNAPSHOT_RE_CONTROL_CHARACTER } from './constants/snapshot.constants.js';
5
7
  /**
6
8
  * Build the record one repository's changed branches become.
7
9
  *
@@ -42,18 +44,57 @@ export function buildRepoSnapshot(input) {
42
44
  // A name the backend cannot store costs that branch its row, and a
43
45
  // branch name that long is not a name anyone typed.
44
46
  .filter((branch) => branch.name.length <= SNAPSHOT_MAX_BRANCH_NAME_LENGTH)
45
- .map((branch) => compact({
46
- name: branch.name,
47
- head_sha: branch.headSha,
48
- last_commit_at: branch.lastCommitAt,
49
- commits: branch.commits.map((commit) => compact({
50
- sha: commit.sha,
51
- subject: commit.subject.slice(0, SNAPSHOT_MAX_SUBJECT_LENGTH),
52
- authored_at: commit.authoredAt
53
- }))
54
- }))
47
+ .map((branch) => {
48
+ const files = branchFiles(branch.commits);
49
+ return compact({
50
+ name: branch.name,
51
+ head_sha: branch.headSha,
52
+ last_commit_at: branch.lastCommitAt,
53
+ commits: branch.commits.map((commit, index) => compact({
54
+ sha: commit.sha,
55
+ subject: commit.subject.slice(0, SNAPSHOT_MAX_SUBJECT_LENGTH),
56
+ authored_at: commit.authoredAt,
57
+ files: files[index]
58
+ }))
59
+ });
60
+ })
55
61
  });
56
62
  }
63
+ /**
64
+ * The files each commit of one branch sends: names only, within the branch's
65
+ * cap, newest commit first so the cap keeps the current work.
66
+ *
67
+ * A withheld name is dropped before the cap is counted, so it can never cost a
68
+ * real path its place, and a path too long for what is left is skipped while a
69
+ * shorter one after it may still fit.
70
+ *
71
+ * @param commits - The branch's commits, newest first, as git listed them.
72
+ * @returns Per commit, the files to send, or undefined for none known.
73
+ */
74
+ function branchFiles(commits) {
75
+ let files = SNAPSHOT_MAX_FILES_PER_BRANCH;
76
+ let bytes = SNAPSHOT_MAX_FILE_BYTES_PER_BRANCH;
77
+ return commits.map((commit) => {
78
+ const kept = [];
79
+ for (const file of (commit.files ?? []).filter((entry) => sendable(entry.path))) {
80
+ const size = Buffer.byteLength(file.path);
81
+ if (files === 0)
82
+ break;
83
+ if (size > bytes)
84
+ continue;
85
+ files -= 1;
86
+ bytes -= size;
87
+ kept.push(file);
88
+ }
89
+ // Empty only when git listed nothing: a commit whose every file was withheld
90
+ // or capped did change something, and an empty list would say it had not.
91
+ return kept.length > 0 || commit.files?.length === 0 ? kept : undefined;
92
+ });
93
+ }
94
+ /** Whether a path may be named at all: not over-long, no control characters, not a credential file. */
95
+ function sendable(filePath) {
96
+ return filePath.length <= SNAPSHOT_MAX_PATH_LENGTH && !SNAPSHOT_RE_CONTROL_CHARACTER.test(filePath) && !RE_SECRET_FILE.test(path.posix.basename(filePath));
97
+ }
57
98
  /**
58
99
  * What makes this send different from the one before it.
59
100
  *
@@ -96,7 +96,7 @@ async function collectCommits(state) {
96
96
  for (const ref of state.selected) {
97
97
  if (remainingMs(deadline) === 0)
98
98
  break;
99
- const commits = await collectBranchCommits(ref.name, { cwd, defaultBranch: state.defaultBranch, commitCount: SNAPSHOT_COMMITS_PER_BRANCH }, state.run);
99
+ const commits = await collectBranchCommits(ref.name, { cwd, defaultBranch: state.defaultBranch, commitCount: SNAPSHOT_COMMITS_PER_BRANCH, withFiles: state.input.files }, state.run);
100
100
  branches.push({ ...ref, commits });
101
101
  }
102
102
  if (branches.length === 0)
@@ -39,6 +39,8 @@ export interface SnapshotIdentity {
39
39
  /** Everything the snapshot flow needs to decide and build one event. */
40
40
  export interface SnapshotFlowInput extends SnapshotIdentity {
41
41
  readonly cwd: string;
42
+ /** Whether the effective capture policy allows file names; when not, no files listing runs. */
43
+ readonly files: boolean;
42
44
  readonly deadline: number;
43
45
  readonly run: GitRunner;
44
46
  }
@@ -23,3 +23,10 @@ export declare function writeFileAtomic(filePath: string, contents: string, mode
23
23
  * @returns The backup path, or undefined when there was nothing to copy.
24
24
  */
25
25
  export declare function backupFile(filePath: string, backupsDir: string, now: Date): Promise<string | undefined>;
26
+ /**
27
+ * Permission bits of an existing file.
28
+ *
29
+ * @param filePath - File to inspect.
30
+ * @returns Its mode, or undefined when the file does not exist.
31
+ */
32
+ export declare function currentMode(filePath: string): Promise<number | undefined>;
@@ -65,7 +65,7 @@ export async function backupFile(filePath, backupsDir, now) {
65
65
  * @param filePath - File to inspect.
66
66
  * @returns Its mode, or undefined when the file does not exist.
67
67
  */
68
- async function currentMode(filePath) {
68
+ export async function currentMode(filePath) {
69
69
  try {
70
70
  return (await fs.stat(filePath)).mode & PERMISSION_MASK;
71
71
  }
@@ -4,6 +4,15 @@ export declare const AGENTWATCH_HOME_DIR_NAME = ".agentwatch";
4
4
  /** Environment overrides for the two roots, used by the test suite. */
5
5
  export declare const CONFIG_DIR_VAR = "AGENTWATCH_CONFIG_DIR";
6
6
  export declare const DATA_DIR_VAR = "AGENTWATCH_DATA_DIR";
7
+ /**
8
+ * Enrollment token, for a setup nobody is watching.
9
+ *
10
+ * An MDM policy runs as root with no terminal and has to get the token in
11
+ * somehow; `--token` puts it on a command line, where `ps` and shell history
12
+ * can see it. This is the private channel for that one case — the flag still
13
+ * wins, so an interactive run is unaffected.
14
+ */
15
+ export declare const TOKEN_VAR = "AGENTWATCH_TOKEN";
7
16
  export declare const CONFIG_FILE_NAME = "config.json";
8
17
  export declare const INSTALL_STATE_FILE_NAME = "install-state.json";
9
18
  /** Sub-directories of the data root. */
@@ -13,6 +22,8 @@ export declare const BACKUPS_DIR_NAME = "backups";
13
22
  export declare const TURNS_DIR_NAME = "turns";
14
23
  /** What the last repository snapshot reported, so the next one can send only changes. */
15
24
  export declare const SNAPSHOTS_DIR_NAME = "snapshots";
25
+ /** One remembered remote per checkout, so the gate spawns git once and not per prompt. */
26
+ export declare const CHECKOUTS_DIR_NAME = "checkouts";
16
27
  /** XDG / Windows locations consulted for the data root, in order. */
17
28
  export declare const LOCAL_APP_DATA_VAR = "LOCALAPPDATA";
18
29
  export declare const XDG_DATA_HOME_VAR = "XDG_DATA_HOME";
@@ -32,3 +43,9 @@ export declare const STALE_LOCK_MS = 30000;
32
43
  export declare const LOCK_ACQUIRE_ATTEMPTS = 2;
33
44
  /** Characters that are unsafe in a timestamped backup filename. */
34
45
  export declare const RE_UNSAFE_STAMP_CHARS: RegExp;
46
+ /** Marker whose mtime records the last sweep, written inside the swept directory. */
47
+ export declare const SWEEP_MARKER_FILE = ".sweep";
48
+ /** The marker `uninstall` leaves beside config.json (AWT-275). */
49
+ export declare const UNINSTALLED_FILE_NAME = "uninstalled.json";
50
+ /** The uninstall marker's name for the machine entry; a root is named by its resolved path. */
51
+ export declare const MACHINE_SCOPE = "machine";
@@ -5,6 +5,15 @@ export const AGENTWATCH_HOME_DIR_NAME = '.agentwatch';
5
5
  /** Environment overrides for the two roots, used by the test suite. */
6
6
  export const CONFIG_DIR_VAR = 'AGENTWATCH_CONFIG_DIR';
7
7
  export const DATA_DIR_VAR = 'AGENTWATCH_DATA_DIR';
8
+ /**
9
+ * Enrollment token, for a setup nobody is watching.
10
+ *
11
+ * An MDM policy runs as root with no terminal and has to get the token in
12
+ * somehow; `--token` puts it on a command line, where `ps` and shell history
13
+ * can see it. This is the private channel for that one case — the flag still
14
+ * wins, so an interactive run is unaffected.
15
+ */
16
+ export const TOKEN_VAR = 'AGENTWATCH_TOKEN';
8
17
  export const CONFIG_FILE_NAME = 'config.json';
9
18
  export const INSTALL_STATE_FILE_NAME = 'install-state.json';
10
19
  /** Sub-directories of the data root. */
@@ -14,6 +23,8 @@ export const BACKUPS_DIR_NAME = 'backups';
14
23
  export const TURNS_DIR_NAME = 'turns';
15
24
  /** What the last repository snapshot reported, so the next one can send only changes. */
16
25
  export const SNAPSHOTS_DIR_NAME = 'snapshots';
26
+ /** One remembered remote per checkout, so the gate spawns git once and not per prompt. */
27
+ export const CHECKOUTS_DIR_NAME = 'checkouts';
17
28
  /** XDG / Windows locations consulted for the data root, in order. */
18
29
  export const LOCAL_APP_DATA_VAR = 'LOCALAPPDATA';
19
30
  export const XDG_DATA_HOME_VAR = 'XDG_DATA_HOME';
@@ -33,3 +44,9 @@ export const STALE_LOCK_MS = 30_000;
33
44
  export const LOCK_ACQUIRE_ATTEMPTS = 2;
34
45
  /** Characters that are unsafe in a timestamped backup filename. */
35
46
  export const RE_UNSAFE_STAMP_CHARS = /[:.]/g;
47
+ /** Marker whose mtime records the last sweep, written inside the swept directory. */
48
+ export const SWEEP_MARKER_FILE = '.sweep';
49
+ /** The marker `uninstall` leaves beside config.json (AWT-275). */
50
+ export const UNINSTALLED_FILE_NAME = 'uninstalled.json';
51
+ /** The uninstall marker's name for the machine entry; a root is named by its resolved path. */
52
+ export const MACHINE_SCOPE = 'machine';
@@ -0,0 +1,13 @@
1
+ import type { AgentWatchPaths } from './types/storage.types.js';
2
+ /**
3
+ * Resolve the local stop marker independently of configuration validity.
4
+ * @param paths - User data paths.
5
+ * @returns The marker path.
6
+ */
7
+ export declare function disabledFile(paths: AgentWatchPaths): string;
8
+ /**
9
+ * An unreadable marker must not accidentally resume collection.
10
+ * @param paths - User data paths.
11
+ * @returns Whether collection must remain stopped.
12
+ */
13
+ export declare function isDisabled(paths: AgentWatchPaths): Promise<boolean>;
@@ -0,0 +1,24 @@
1
+ import fs from 'node:fs/promises';
2
+ import path from 'node:path';
3
+ /**
4
+ * Resolve the local stop marker independently of configuration validity.
5
+ * @param paths - User data paths.
6
+ * @returns The marker path.
7
+ */
8
+ export function disabledFile(paths) {
9
+ return path.join(paths.dataDir, 'disabled.json');
10
+ }
11
+ /**
12
+ * An unreadable marker must not accidentally resume collection.
13
+ * @param paths - User data paths.
14
+ * @returns Whether collection must remain stopped.
15
+ */
16
+ export async function isDisabled(paths) {
17
+ try {
18
+ await fs.lstat(disabledFile(paths));
19
+ return true;
20
+ }
21
+ catch (error) {
22
+ return error.code !== 'ENOENT';
23
+ }
24
+ }
@@ -4,6 +4,8 @@
4
4
  */
5
5
  export type { AgentInstallState, AgentWatchPaths, InstallState, JsonReadResult, ReleaseLock } from './types/storage.types.js';
6
6
  export { resolvePaths } from './paths.js';
7
+ export { disabledFile, isDisabled } from './disabled.js';
8
+ export { isUninstalled, uninstalledFile } from './uninstalled.js';
7
9
  export { readJsonFile } from './json-file.js';
8
10
  export { backupFile, writeFileAtomic } from './atomic-file.js';
9
11
  export { acquireLock } from './lock.js';
@@ -1,4 +1,6 @@
1
1
  export { resolvePaths } from './paths.js';
2
+ export { disabledFile, isDisabled } from './disabled.js';
3
+ export { isUninstalled, uninstalledFile } from './uninstalled.js';
2
4
  export { readJsonFile } from './json-file.js';
3
5
  export { backupFile, writeFileAtomic } from './atomic-file.js';
4
6
  export { acquireLock } from './lock.js';
@@ -1,5 +1,5 @@
1
1
  import path from 'node:path';
2
- import { AGENTWATCH_DIR_NAME, AGENTWATCH_HOME_DIR_NAME, BACKUPS_DIR_NAME, CONFIG_DIR_VAR, CONFIG_FILE_NAME, DATA_DIR_VAR, INSTALL_STATE_FILE_NAME, LOCAL_APP_DATA_VAR, LOCKS_DIR_NAME, POSIX_DATA_FALLBACK, QUEUE_DIR_NAME, SNAPSHOTS_DIR_NAME, TURNS_DIR_NAME, XDG_DATA_HOME_VAR } from './constants/storage.constants.js';
2
+ import { AGENTWATCH_DIR_NAME, AGENTWATCH_HOME_DIR_NAME, BACKUPS_DIR_NAME, CHECKOUTS_DIR_NAME, CONFIG_DIR_VAR, CONFIG_FILE_NAME, DATA_DIR_VAR, INSTALL_STATE_FILE_NAME, LOCAL_APP_DATA_VAR, LOCKS_DIR_NAME, POSIX_DATA_FALLBACK, QUEUE_DIR_NAME, SNAPSHOTS_DIR_NAME, TURNS_DIR_NAME, XDG_DATA_HOME_VAR } from './constants/storage.constants.js';
3
3
  /**
4
4
  * Every path AgentWatch reads or writes, derived from the environment alone.
5
5
  *
@@ -22,7 +22,8 @@ export function resolvePaths(env) {
22
22
  locksDir: path.join(dataDir, LOCKS_DIR_NAME),
23
23
  backupsDir: path.join(dataDir, BACKUPS_DIR_NAME),
24
24
  turnsDir: path.join(dataDir, TURNS_DIR_NAME),
25
- snapshotsDir: path.join(dataDir, SNAPSHOTS_DIR_NAME)
25
+ snapshotsDir: path.join(dataDir, SNAPSHOTS_DIR_NAME),
26
+ checkoutsDir: path.join(dataDir, CHECKOUTS_DIR_NAME)
26
27
  };
27
28
  }
28
29
  /**
@@ -14,6 +14,12 @@ export declare const agentInstallSchema: z.ZodObject<{
14
14
  otelConfiguredAt: z.ZodOptional<z.ZodString>;
15
15
  otelConfigPath: z.ZodOptional<z.ZodString>;
16
16
  otelOwnedKeys: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
17
+ /**
18
+ * Permission bits the agent's own config file carried before AgentWatch
19
+ * tightened it, so uninstall can put them back. Absent when the file was
20
+ * never tightened, or when AgentWatch created it.
21
+ */
22
+ otelPriorMode: z.ZodOptional<z.ZodNumber>;
17
23
  notes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
18
24
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
19
25
  hooksInstalledAt: z.ZodOptional<z.ZodString>;
@@ -23,6 +29,12 @@ export declare const agentInstallSchema: z.ZodObject<{
23
29
  otelConfiguredAt: z.ZodOptional<z.ZodString>;
24
30
  otelConfigPath: z.ZodOptional<z.ZodString>;
25
31
  otelOwnedKeys: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
32
+ /**
33
+ * Permission bits the agent's own config file carried before AgentWatch
34
+ * tightened it, so uninstall can put them back. Absent when the file was
35
+ * never tightened, or when AgentWatch created it.
36
+ */
37
+ otelPriorMode: z.ZodOptional<z.ZodNumber>;
26
38
  notes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
27
39
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
28
40
  hooksInstalledAt: z.ZodOptional<z.ZodString>;
@@ -32,6 +44,12 @@ export declare const agentInstallSchema: z.ZodObject<{
32
44
  otelConfiguredAt: z.ZodOptional<z.ZodString>;
33
45
  otelConfigPath: z.ZodOptional<z.ZodString>;
34
46
  otelOwnedKeys: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
47
+ /**
48
+ * Permission bits the agent's own config file carried before AgentWatch
49
+ * tightened it, so uninstall can put them back. Absent when the file was
50
+ * never tightened, or when AgentWatch created it.
51
+ */
52
+ otelPriorMode: z.ZodOptional<z.ZodNumber>;
35
53
  notes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
36
54
  }, z.ZodTypeAny, "passthrough">>;
37
55
  /** The whole install-state file: one entry per agent. */
@@ -45,6 +63,12 @@ export declare const installStateSchema: z.ZodObject<{
45
63
  otelConfiguredAt: z.ZodOptional<z.ZodString>;
46
64
  otelConfigPath: z.ZodOptional<z.ZodString>;
47
65
  otelOwnedKeys: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
66
+ /**
67
+ * Permission bits the agent's own config file carried before AgentWatch
68
+ * tightened it, so uninstall can put them back. Absent when the file was
69
+ * never tightened, or when AgentWatch created it.
70
+ */
71
+ otelPriorMode: z.ZodOptional<z.ZodNumber>;
48
72
  notes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
49
73
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
50
74
  hooksInstalledAt: z.ZodOptional<z.ZodString>;
@@ -54,6 +78,12 @@ export declare const installStateSchema: z.ZodObject<{
54
78
  otelConfiguredAt: z.ZodOptional<z.ZodString>;
55
79
  otelConfigPath: z.ZodOptional<z.ZodString>;
56
80
  otelOwnedKeys: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
81
+ /**
82
+ * Permission bits the agent's own config file carried before AgentWatch
83
+ * tightened it, so uninstall can put them back. Absent when the file was
84
+ * never tightened, or when AgentWatch created it.
85
+ */
86
+ otelPriorMode: z.ZodOptional<z.ZodNumber>;
57
87
  notes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
58
88
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
59
89
  hooksInstalledAt: z.ZodOptional<z.ZodString>;
@@ -63,6 +93,12 @@ export declare const installStateSchema: z.ZodObject<{
63
93
  otelConfiguredAt: z.ZodOptional<z.ZodString>;
64
94
  otelConfigPath: z.ZodOptional<z.ZodString>;
65
95
  otelOwnedKeys: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
96
+ /**
97
+ * Permission bits the agent's own config file carried before AgentWatch
98
+ * tightened it, so uninstall can put them back. Absent when the file was
99
+ * never tightened, or when AgentWatch created it.
100
+ */
101
+ otelPriorMode: z.ZodOptional<z.ZodNumber>;
66
102
  notes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
67
103
  }, z.ZodTypeAny, "passthrough">>>>;
68
104
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
@@ -75,6 +111,12 @@ export declare const installStateSchema: z.ZodObject<{
75
111
  otelConfiguredAt: z.ZodOptional<z.ZodString>;
76
112
  otelConfigPath: z.ZodOptional<z.ZodString>;
77
113
  otelOwnedKeys: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
114
+ /**
115
+ * Permission bits the agent's own config file carried before AgentWatch
116
+ * tightened it, so uninstall can put them back. Absent when the file was
117
+ * never tightened, or when AgentWatch created it.
118
+ */
119
+ otelPriorMode: z.ZodOptional<z.ZodNumber>;
78
120
  notes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
79
121
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
80
122
  hooksInstalledAt: z.ZodOptional<z.ZodString>;
@@ -84,6 +126,12 @@ export declare const installStateSchema: z.ZodObject<{
84
126
  otelConfiguredAt: z.ZodOptional<z.ZodString>;
85
127
  otelConfigPath: z.ZodOptional<z.ZodString>;
86
128
  otelOwnedKeys: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
129
+ /**
130
+ * Permission bits the agent's own config file carried before AgentWatch
131
+ * tightened it, so uninstall can put them back. Absent when the file was
132
+ * never tightened, or when AgentWatch created it.
133
+ */
134
+ otelPriorMode: z.ZodOptional<z.ZodNumber>;
87
135
  notes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
88
136
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
89
137
  hooksInstalledAt: z.ZodOptional<z.ZodString>;
@@ -93,6 +141,12 @@ export declare const installStateSchema: z.ZodObject<{
93
141
  otelConfiguredAt: z.ZodOptional<z.ZodString>;
94
142
  otelConfigPath: z.ZodOptional<z.ZodString>;
95
143
  otelOwnedKeys: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
144
+ /**
145
+ * Permission bits the agent's own config file carried before AgentWatch
146
+ * tightened it, so uninstall can put them back. Absent when the file was
147
+ * never tightened, or when AgentWatch created it.
148
+ */
149
+ otelPriorMode: z.ZodOptional<z.ZodNumber>;
96
150
  notes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
97
151
  }, z.ZodTypeAny, "passthrough">>>>;
98
152
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
@@ -105,6 +159,12 @@ export declare const installStateSchema: z.ZodObject<{
105
159
  otelConfiguredAt: z.ZodOptional<z.ZodString>;
106
160
  otelConfigPath: z.ZodOptional<z.ZodString>;
107
161
  otelOwnedKeys: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
162
+ /**
163
+ * Permission bits the agent's own config file carried before AgentWatch
164
+ * tightened it, so uninstall can put them back. Absent when the file was
165
+ * never tightened, or when AgentWatch created it.
166
+ */
167
+ otelPriorMode: z.ZodOptional<z.ZodNumber>;
108
168
  notes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
109
169
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
110
170
  hooksInstalledAt: z.ZodOptional<z.ZodString>;
@@ -114,6 +174,12 @@ export declare const installStateSchema: z.ZodObject<{
114
174
  otelConfiguredAt: z.ZodOptional<z.ZodString>;
115
175
  otelConfigPath: z.ZodOptional<z.ZodString>;
116
176
  otelOwnedKeys: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
177
+ /**
178
+ * Permission bits the agent's own config file carried before AgentWatch
179
+ * tightened it, so uninstall can put them back. Absent when the file was
180
+ * never tightened, or when AgentWatch created it.
181
+ */
182
+ otelPriorMode: z.ZodOptional<z.ZodNumber>;
117
183
  notes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
118
184
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
119
185
  hooksInstalledAt: z.ZodOptional<z.ZodString>;
@@ -123,6 +189,12 @@ export declare const installStateSchema: z.ZodObject<{
123
189
  otelConfiguredAt: z.ZodOptional<z.ZodString>;
124
190
  otelConfigPath: z.ZodOptional<z.ZodString>;
125
191
  otelOwnedKeys: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
192
+ /**
193
+ * Permission bits the agent's own config file carried before AgentWatch
194
+ * tightened it, so uninstall can put them back. Absent when the file was
195
+ * never tightened, or when AgentWatch created it.
196
+ */
197
+ otelPriorMode: z.ZodOptional<z.ZodNumber>;
126
198
  notes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
127
199
  }, z.ZodTypeAny, "passthrough">>>>;
128
200
  }, z.ZodTypeAny, "passthrough">>;
@@ -15,6 +15,12 @@ export const agentInstallSchema = z
15
15
  otelConfiguredAt: z.string().optional(),
16
16
  otelConfigPath: z.string().optional(),
17
17
  otelOwnedKeys: z.array(z.string()).default([]),
18
+ /**
19
+ * Permission bits the agent's own config file carried before AgentWatch
20
+ * tightened it, so uninstall can put them back. Absent when the file was
21
+ * never tightened, or when AgentWatch created it.
22
+ */
23
+ otelPriorMode: z.number().int().optional(),
18
24
  notes: z.array(z.string()).default([])
19
25
  })
20
26
  .passthrough();