@agent-watch-ai/edge 0.2.5 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (348) hide show
  1. package/CHANGELOG.md +558 -0
  2. package/README.md +222 -97
  3. package/SECURITY.md +72 -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 +52 -4
  9. package/dist/cli/constants/cli.constants.js +56 -5
  10. package/dist/cli/context.d.ts +33 -2
  11. package/dist/cli/context.js +84 -14
  12. package/dist/cli/doctor.js +321 -33
  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 +553 -103
  26. package/dist/cli/status.js +82 -13
  27. package/dist/cli/toggle.d.ts +9 -0
  28. package/dist/cli/toggle.js +117 -0
  29. package/dist/cli/types/cli.types.d.ts +43 -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 +110 -12
  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 +116 -6
  41. package/dist/config/constants/config.constants.js +131 -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 +831 -84
  51. package/dist/config/schemas/config.schema.js +398 -16
  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 +119 -0
  71. package/dist/credentials/constants/credentials.constants.js +120 -0
  72. package/dist/credentials/credential-status.d.ts +14 -0
  73. package/dist/credentials/credential-status.js +38 -0
  74. package/dist/credentials/credentials.d.ts +86 -0
  75. package/dist/credentials/credentials.js +278 -0
  76. package/dist/credentials/device-api.d.ts +73 -0
  77. package/dist/credentials/device-api.js +161 -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 +73 -0
  81. package/dist/credentials/identity.js +101 -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 +31 -0
  93. package/dist/credentials/sign-in.js +105 -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 +206 -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 +64 -17
  104. package/dist/enforcement/enforcement.d.ts +23 -2
  105. package/dist/enforcement/enforcement.js +107 -17
  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 +66 -2
  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 +10 -0
  160. package/dist/pipeline/constants/pipeline.constants.js +10 -0
  161. package/dist/pipeline/hook-pipeline.js +410 -33
  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 +75 -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 +36 -3
  197. package/dist/providers/codex/codex.otel.js +199 -32
  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 +10 -0
  202. package/dist/providers/codex/constants/codex.otel.constants.js +10 -0
  203. package/dist/providers/constants/provider.constants.d.ts +8 -3
  204. package/dist/providers/constants/provider.constants.js +8 -3
  205. package/dist/providers/cursor/constants/cursor.constants.d.ts +9 -0
  206. package/dist/providers/cursor/constants/cursor.constants.js +9 -0
  207. package/dist/providers/cursor/cursor.adapter.d.ts +33 -1
  208. package/dist/providers/cursor/cursor.adapter.js +129 -4
  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 +9 -1
  215. package/dist/providers/gemini/constants/gemini.otel.constants.js +9 -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 +30 -21
  221. package/dist/providers/gemini/gemini.otel.js +166 -22
  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/bearer-rewrite.d.ts +19 -0
  232. package/dist/providers/shared/bearer-rewrite.js +46 -0
  233. package/dist/providers/shared/constants/hook-refusal.constants.d.ts +7 -0
  234. package/dist/providers/shared/constants/hook-refusal.constants.js +7 -0
  235. package/dist/providers/shared/constants/shell-directories.constants.d.ts +30 -0
  236. package/dist/providers/shared/constants/shell-directories.constants.js +39 -0
  237. package/dist/providers/shared/constants/tooling.constants.d.ts +24 -2
  238. package/dist/providers/shared/constants/tooling.constants.js +25 -3
  239. package/dist/providers/shared/event-builder.d.ts +12 -14
  240. package/dist/providers/shared/event-builder.js +20 -14
  241. package/dist/providers/shared/exporter-allowlist.d.ts +20 -0
  242. package/dist/providers/shared/exporter-allowlist.js +49 -0
  243. package/dist/providers/shared/hook-config.d.ts +2 -21
  244. package/dist/providers/shared/hook-config.js +5 -4
  245. package/dist/providers/shared/hook-refusal.d.ts +12 -0
  246. package/dist/providers/shared/hook-refusal.js +17 -1
  247. package/dist/providers/shared/install-record.d.ts +12 -2
  248. package/dist/providers/shared/install-record.js +5 -2
  249. package/dist/providers/shared/shell-directories.d.ts +24 -0
  250. package/dist/providers/shared/shell-directories.js +90 -0
  251. package/dist/providers/shared/tooling.d.ts +40 -1
  252. package/dist/providers/shared/tooling.js +70 -1
  253. package/dist/providers/shared/types/adapter.types.d.ts +1 -2
  254. package/dist/providers/types/provider.types.d.ts +81 -1
  255. package/dist/snapshot/constants/snapshot.constants.d.ts +32 -0
  256. package/dist/snapshot/constants/snapshot.constants.js +33 -0
  257. package/dist/snapshot/snapshot-event.js +52 -11
  258. package/dist/snapshot/snapshot-pipeline.js +1 -1
  259. package/dist/snapshot/types/snapshot.types.d.ts +2 -0
  260. package/dist/storage/atomic-file.d.ts +21 -0
  261. package/dist/storage/atomic-file.js +20 -1
  262. package/dist/storage/constants/storage.constants.d.ts +19 -0
  263. package/dist/storage/constants/storage.constants.js +19 -0
  264. package/dist/storage/disabled.d.ts +13 -0
  265. package/dist/storage/disabled.js +24 -0
  266. package/dist/storage/index.d.ts +2 -0
  267. package/dist/storage/index.js +2 -0
  268. package/dist/storage/paths.js +3 -2
  269. package/dist/storage/schemas/storage.schema.d.ts +72 -0
  270. package/dist/storage/schemas/storage.schema.js +6 -0
  271. package/dist/storage/sweep-marker.d.ts +19 -0
  272. package/dist/storage/sweep-marker.js +55 -0
  273. package/dist/storage/types/storage.types.d.ts +2 -0
  274. package/dist/storage/uninstalled.d.ts +58 -0
  275. package/dist/storage/uninstalled.js +107 -0
  276. package/dist/transport/auth-block.d.ts +66 -0
  277. package/dist/transport/auth-block.js +129 -0
  278. package/dist/transport/constants/transport.constants.d.ts +82 -3
  279. package/dist/transport/constants/transport.constants.js +83 -4
  280. package/dist/transport/cooldown.js +8 -1
  281. package/dist/transport/delivery.d.ts +14 -6
  282. package/dist/transport/delivery.js +80 -55
  283. package/dist/transport/http-transport.d.ts +1 -0
  284. package/dist/transport/http-transport.js +52 -10
  285. package/dist/transport/index.d.ts +6 -3
  286. package/dist/transport/index.js +3 -0
  287. package/dist/transport/queue-partition.d.ts +91 -0
  288. package/dist/transport/queue-partition.js +143 -0
  289. package/dist/transport/queue.d.ts +99 -20
  290. package/dist/transport/queue.js +210 -69
  291. package/dist/transport/response-body.d.ts +25 -0
  292. package/dist/transport/response-body.js +64 -0
  293. package/dist/transport/send.d.ts +11 -0
  294. package/dist/transport/send.js +17 -0
  295. package/dist/transport/types/delivery-flow.types.d.ts +19 -0
  296. package/dist/transport/types/delivery-flow.types.js +1 -0
  297. package/dist/transport/types/transport.types.d.ts +45 -0
  298. package/dist/turns/claude-transcript.d.ts +19 -1
  299. package/dist/turns/claude-transcript.js +46 -1
  300. package/dist/turns/codex-originator.d.ts +11 -0
  301. package/dist/turns/codex-originator.js +31 -0
  302. package/dist/turns/codex-transcript.d.ts +30 -0
  303. package/dist/turns/codex-transcript.js +88 -0
  304. package/dist/turns/constants/turns.constants.d.ts +141 -5
  305. package/dist/turns/constants/turns.constants.js +155 -5
  306. package/dist/turns/file-identity.d.ts +27 -0
  307. package/dist/turns/file-identity.js +48 -0
  308. package/dist/turns/gemini-transcript.d.ts +30 -0
  309. package/dist/turns/gemini-transcript.js +96 -0
  310. package/dist/turns/index.d.ts +3 -3
  311. package/dist/turns/index.js +1 -1
  312. package/dist/turns/inherited-checkout.d.ts +54 -0
  313. package/dist/turns/inherited-checkout.js +155 -0
  314. package/dist/turns/native-session-titles.d.ts +26 -0
  315. package/dist/turns/native-session-titles.js +102 -0
  316. package/dist/turns/transcript.d.ts +3 -2
  317. package/dist/turns/transcript.js +5 -1
  318. package/dist/turns/turn-state.d.ts +224 -3
  319. package/dist/turns/turn-state.js +456 -21
  320. package/dist/turns/turn-summary.d.ts +1 -14
  321. package/dist/turns/turn-summary.js +87 -51
  322. package/dist/turns/turn-tracker.d.ts +21 -2
  323. package/dist/turns/turn-tracker.js +379 -56
  324. package/dist/turns/types/transcript.types.d.ts +5 -0
  325. package/dist/turns/types/turn-state.types.d.ts +116 -5
  326. package/dist/turns/types/turn-summary.types.d.ts +64 -14
  327. package/dist/turns/types/turn-tracker.types.d.ts +27 -1
  328. package/dist/turns/work-checkout.d.ts +67 -0
  329. package/dist/turns/work-checkout.js +700 -0
  330. package/dist/untraced/constants/untraced.constants.d.ts +31 -0
  331. package/dist/untraced/constants/untraced.constants.js +63 -0
  332. package/dist/untraced/untraced.d.ts +35 -0
  333. package/dist/untraced/untraced.js +105 -0
  334. package/dist/update/constants/update.constants.d.ts +18 -0
  335. package/dist/update/constants/update.constants.js +20 -0
  336. package/dist/update/update-check.d.ts +52 -0
  337. package/dist/update/update-check.js +113 -0
  338. package/docs/AUDIT_PROMPT.md +129 -0
  339. package/docs/DATA_HANDLING.md +655 -0
  340. package/docs/ENTERPRISE_DEPLOYMENT.md +194 -0
  341. package/docs/PERFORMANCE.md +81 -0
  342. package/package.json +14 -4
  343. package/dist/enrollment/enrollment-provider.d.ts +0 -5
  344. package/dist/enrollment/manual-enrollment.d.ts +0 -32
  345. package/dist/enrollment/manual-enrollment.js +0 -72
  346. package/example/README.md +0 -43
  347. package/example/server.mjs +0 -240
  348. /package/dist/{enrollment/enrollment-provider.js → config/types/destination.types.js} +0 -0
@@ -2,8 +2,21 @@
2
2
  export declare const GIT_TIMEOUT_MS = 1000;
3
3
  /** Cap on the changedFiles list; a huge dirty tree must not bloat an event. */
4
4
  export declare const MAX_CHANGED_FILES = 50;
5
+ /** Prepended to every git call: status and diff then never write `index.lock`. */
6
+ export declare const GIT_NO_OPTIONAL_LOCKS = "--no-optional-locks";
5
7
  /** stdout ceiling per git process. */
6
8
  export declare const GIT_MAX_BUFFER_BYTES: number;
9
+ /**
10
+ * Cap on the developer display name, matching the backend's `shortText`.
11
+ *
12
+ * The backend validates `developer_name` at 500 characters, and the field sits
13
+ * on the turn summary — so an over-long name fails the parse and drops the
14
+ * whole summary rather than just the name. The sanitizer's 8192 is no help
15
+ * here: it is far above the limit that actually decides. A cosmetic value must
16
+ * never be able to cost a turn, so it is truncated at the boundary that knows
17
+ * the limit instead of being sent and refused.
18
+ */
19
+ export declare const MAX_DEVELOPER_NAME_LENGTH = 500;
7
20
  /**
8
21
  * Argument vectors, named so a reader sees intent instead of flags.
9
22
  *
@@ -18,6 +31,7 @@ export declare const GIT_COMMIT_ARGS: readonly ["rev-parse", "HEAD"];
18
31
  export declare const GIT_REMOTE_ARGS: readonly ["config", "--get", "remote.origin.url"];
19
32
  export declare const GIT_STATUS_ARGS: readonly ["status", "--porcelain"];
20
33
  export declare const GIT_USER_EMAIL_ARGS: readonly ["config", "--get", "user.email"];
34
+ export declare const GIT_USER_NAME_ARGS: readonly ["config", "--get", "user.name"];
21
35
  /** Where `origin/HEAD` points: the remote's default branch, when it is known locally. */
22
36
  export declare const GIT_ORIGIN_HEAD_ARGS: readonly ["symbolic-ref", "--short", "-q", "refs/remotes/origin/HEAD"];
23
37
  /** Field separator inside one `for-each-ref` / `log` record. */
@@ -48,6 +62,30 @@ export declare function gitRecentBranchesArgs(count: number): readonly string[];
48
62
  * @returns The argument vector.
49
63
  */
50
64
  export declare function gitBranchDeltaArgs(defaultBranch: string, branch: string, count: number): readonly string[];
65
+ /** One name-status letter: added, copied, deleted, modified, renamed, type-changed, unmerged, unknown. */
66
+ export declare const RE_NAME_STATUS: RegExp;
67
+ /** The newline git puts between a commit's header and its first name-status entry. */
68
+ export declare const RE_LEADING_NEWLINE: RegExp;
69
+ /**
70
+ * The files each commit of a branch's delta changed, one process for the branch.
71
+ *
72
+ * The same range and count as {@link gitBranchDeltaArgs}, so the shas line up.
73
+ * `-z` so no path comes back quoted; `--no-renames` so every entry is one
74
+ * letter and one path (a rename reads as its delete and its add, both of which
75
+ * the work did); merge commits list nothing, as `log` never diffs them unasked.
76
+ *
77
+ * @param base - The trunk the delta was taken against.
78
+ * @param branch - The branch to describe.
79
+ * @param count - Ceiling on the commits, the same as the delta's.
80
+ * @returns The argument vector.
81
+ */
82
+ export declare function gitBranchFilesArgs(base: string, branch: string, count: number): readonly string[];
83
+ /**
84
+ * Names of files that hold credentials. Never hashed, and never named in a
85
+ * snapshot: the path of a key file says nothing about the work and something
86
+ * about where the keys are.
87
+ */
88
+ export declare const RE_SECRET_FILE: RegExp;
51
89
  /**
52
90
  * Whether a ref exists at all, for the local fallback when no `origin/HEAD` does.
53
91
  *
@@ -55,6 +93,19 @@ export declare function gitBranchDeltaArgs(defaultBranch: string, branch: string
55
93
  * @returns The argument vector, which exits non-zero when the ref is absent.
56
94
  */
57
95
  export declare function gitVerifyRefArgs(ref: string): readonly string[];
96
+ /**
97
+ * The remote-tracking branches whose tip is one commit, each as
98
+ * `name<separator>symref` with `refs/remotes/<remote>/` stripped.
99
+ *
100
+ * A `<remote>/HEAD` at that commit lists itself with its target as the symref:
101
+ * the remote's default branch, which is how the caller tells it apart. One
102
+ * process, and `--points-at` keeps the output to the few refs at that commit
103
+ * however many branches the remote has.
104
+ *
105
+ * @param oid - The checked-out commit.
106
+ * @returns The argument vector.
107
+ */
108
+ export declare function gitRemoteBranchesAtArgs(oid: string): readonly string[];
58
109
  /** What a repository's trunk is called when neither git nor the platform said. */
59
110
  export declare const ASSUMED_DEFAULT_BRANCHES: readonly ["main", "master"];
60
111
  /** Node's error code for a child process that overran maxBuffer on stdout. */
@@ -82,3 +133,112 @@ export declare const RE_SCP_REMOTE: RegExp;
82
133
  export declare const RE_LEADING_SLASHES: RegExp;
83
134
  export declare const RE_TRAILING_SLASHES: RegExp;
84
135
  export declare const RE_DOT_GIT_SUFFIX: RegExp;
136
+ /**
137
+ * What the gate reads out of a working copy, and how far it looks.
138
+ *
139
+ * The same ceiling the repository-config walk uses, for the same reason: a walk
140
+ * that never ends is a hook that never answers.
141
+ */
142
+ export declare const GATE_MAX_WALK_DEPTH = 32;
143
+ /** A linked worktree's `.git` file names its real git directory on one line. */
144
+ export declare const GATE_GITDIR_PREFIX = "gitdir:";
145
+ /** `HEAD` on a branch; anything else is a detached HEAD, which names none. */
146
+ export declare const GATE_BRANCH_REF_PREFIX = "ref: refs/heads/";
147
+ /**
148
+ * How long a remembered remote is trusted.
149
+ *
150
+ * A remote changes approximately never, which is the whole reason this is
151
+ * memoised — but `git remote set-url` does happen, and a memo with no expiry
152
+ * would pin a checkout to its old repository for good. An hour is one
153
+ * subprocess per checkout per working session, and at most an hour of a
154
+ * repository being reported under the name it had this morning.
155
+ */
156
+ export declare const GATE_REMOTE_MEMO_TTL_MS = 3600000;
157
+ /**
158
+ * And how long "this checkout has no usable remote" is remembered.
159
+ *
160
+ * Much shorter, because the answer cannot be trusted the way a remote can.
161
+ * `runGit` resolves undefined for a missing key *and* for a timeout, a git that
162
+ * is not on PATH, a spawn that failed — indistinguishable from here. Remembered
163
+ * for an hour, one overrun of the one-second budget on a cold checkout would
164
+ * silence every feature cap in that repository for the rest of the hour, with a
165
+ * debug line as the only trace. A minute bounds that, and a genuinely
166
+ * remoteless checkout pays one subprocess a minute rather than one per prompt.
167
+ */
168
+ export declare const GATE_REMOTE_ABSENT_TTL_MS = 60000;
169
+ /**
170
+ * The entry that marks a repository root. A *file* of that name counts too:
171
+ * that is what a linked worktree and a submodule check out as.
172
+ */
173
+ export declare const GIT_ENTRY_NAME = ".git";
174
+ /**
175
+ * The errors that mean "no `.git` here". Anything else — a permission or I/O
176
+ * error — means the answer is unknown, not no.
177
+ */
178
+ export declare const GIT_ENTRY_ABSENT_CODES: ReadonlySet<string>;
179
+ /**
180
+ * One fingerprint of a checkout: HEAD, branch and every dirty entry in one
181
+ * process. NUL-separated so a path is never quoted, split or trimmed; every
182
+ * untracked file listed on its own, since editing a file inside an untracked
183
+ * directory need not re-stamp the directory.
184
+ */
185
+ export declare const GIT_FINGERPRINT_ARGS: readonly ["status", "--porcelain=v2", "--branch", "-z", "--untracked-files=all"];
186
+ /** Header lines of porcelain v2 `--branch` output that the fingerprint keeps. */
187
+ export declare const PORCELAIN_V2_OID_HEADER = "# branch.oid ";
188
+ export declare const PORCELAIN_V2_HEAD_HEADER = "# branch.head ";
189
+ /** What porcelain v2 says in place of an oid or a branch when there is none. */
190
+ export declare const PORCELAIN_V2_NO_OID = "(initial)";
191
+ export declare const PORCELAIN_V2_DETACHED = "(detached)";
192
+ /**
193
+ * Space-separated fields before the path on each porcelain v2 entry kind:
194
+ * ordinary (`1`), rename or copy (`2`, followed by the original path as its own
195
+ * NUL record), unmerged (`u`), untracked (`?`).
196
+ */
197
+ export declare const PORCELAIN_V2_PATH_FIELD: Readonly<Record<string, number>>;
198
+ /** Porcelain v2 kinds whose entry is followed by one more NUL record, the original path. */
199
+ export declare const PORCELAIN_V2_RENAME_KIND = "2";
200
+ /** A full SHA-1 or SHA-256 object id. */
201
+ export declare const RE_OBJECT_ID: RegExp;
202
+ /** XY stand-in for an untracked entry, which porcelain v2 gives none. */
203
+ export declare const PORCELAIN_V2_UNTRACKED_XY = "??";
204
+ /** A linked worktree's git dir names the shared one in this file. */
205
+ export declare const GIT_COMMONDIR_FILE = "commondir";
206
+ /**
207
+ * Cap on the files a turn reports as changed in its work checkout, the
208
+ * gateway's own bound on the list: a longer one would refuse the summary whole.
209
+ */
210
+ export declare const MAX_WORK_CHANGED_FILES = 500;
211
+ /**
212
+ * The files of the commits in `from..to` that no remote-tracking ref reaches,
213
+ * NUL-separated so no path comes back quoted: the commits made here, not the
214
+ * ones a pull or a merge brought in. Merge commits list nothing.
215
+ *
216
+ * @param from - The oid the turn started on; undefined for the whole history up to `to` (an unborn start).
217
+ * @param to - The oid or ref it ended on.
218
+ * @returns The argument vector.
219
+ */
220
+ export declare function gitOwnCommitFilesArgs(from: string | undefined, to: string): readonly string[];
221
+ /**
222
+ * Prints `from` when it is not an ancestor of `to`, and nothing when it is.
223
+ *
224
+ * @param from - The oid the turn started on.
225
+ * @param to - The oid or ref it ended on.
226
+ * @returns The argument vector.
227
+ */
228
+ export declare function gitNotAncestorArgs(from: string, to: string): readonly string[];
229
+ /** Files whose content ids one turn reports; the gateway clips a longer list. */
230
+ export declare const MAX_CONTENT_HASHES = 20;
231
+ /**
232
+ * Largest file worth an id. Mirrors the code index's `MAX_JSON_BLOB_BYTES`
233
+ * (agent-watch-core, integrations-service `github-source-read.service.ts`):
234
+ * past it the index records no digests, so a hash could never match.
235
+ */
236
+ export declare const MAX_HASHED_FILE_BYTES = 1000000;
237
+ /**
238
+ * Time one Stop hook may spend hashing; the same cap the process walk has.
239
+ * Local disk hashes 20 files in ~5 ms, so SPEC §8's 60 ms p90 is untouched; a
240
+ * loaded machine can take tens of ms, and a tighter cap would drop ids there.
241
+ * Past it, on a slow or network mount, the remaining files are skipped and the
242
+ * ids already taken are sent.
243
+ */
244
+ export declare const HASH_BUDGET_MS = 100;
@@ -2,8 +2,21 @@
2
2
  export const GIT_TIMEOUT_MS = 1000;
3
3
  /** Cap on the changedFiles list; a huge dirty tree must not bloat an event. */
4
4
  export const MAX_CHANGED_FILES = 50;
5
+ /** Prepended to every git call: status and diff then never write `index.lock`. */
6
+ export const GIT_NO_OPTIONAL_LOCKS = '--no-optional-locks';
5
7
  /** stdout ceiling per git process. */
6
8
  export const GIT_MAX_BUFFER_BYTES = 1024 * 1024;
9
+ /**
10
+ * Cap on the developer display name, matching the backend's `shortText`.
11
+ *
12
+ * The backend validates `developer_name` at 500 characters, and the field sits
13
+ * on the turn summary — so an over-long name fails the parse and drops the
14
+ * whole summary rather than just the name. The sanitizer's 8192 is no help
15
+ * here: it is far above the limit that actually decides. A cosmetic value must
16
+ * never be able to cost a turn, so it is truncated at the boundary that knows
17
+ * the limit instead of being sent and refused.
18
+ */
19
+ export const MAX_DEVELOPER_NAME_LENGTH = 500;
7
20
  /**
8
21
  * Argument vectors, named so a reader sees intent instead of flags.
9
22
  *
@@ -18,6 +31,7 @@ export const GIT_COMMIT_ARGS = ['rev-parse', 'HEAD'];
18
31
  export const GIT_REMOTE_ARGS = ['config', '--get', 'remote.origin.url'];
19
32
  export const GIT_STATUS_ARGS = ['status', '--porcelain'];
20
33
  export const GIT_USER_EMAIL_ARGS = ['config', '--get', 'user.email'];
34
+ export const GIT_USER_NAME_ARGS = ['config', '--get', 'user.name'];
21
35
  /** Where `origin/HEAD` points: the remote's default branch, when it is known locally. */
22
36
  export const GIT_ORIGIN_HEAD_ARGS = ['symbolic-ref', '--short', '-q', 'refs/remotes/origin/HEAD'];
23
37
  /** Field separator inside one `for-each-ref` / `log` record. */
@@ -65,6 +79,45 @@ export function gitBranchDeltaArgs(defaultBranch, branch, count) {
65
79
  '--'
66
80
  ];
67
81
  }
82
+ /** One name-status letter: added, copied, deleted, modified, renamed, type-changed, unmerged, unknown. */
83
+ export const RE_NAME_STATUS = /^[ACDMRTUX]$/;
84
+ /** The newline git puts between a commit's header and its first name-status entry. */
85
+ export const RE_LEADING_NEWLINE = /^\n/;
86
+ /**
87
+ * The files each commit of a branch's delta changed, one process for the branch.
88
+ *
89
+ * The same range and count as {@link gitBranchDeltaArgs}, so the shas line up.
90
+ * `-z` so no path comes back quoted; `--no-renames` so every entry is one
91
+ * letter and one path (a rename reads as its delete and its add, both of which
92
+ * the work did); merge commits list nothing, as `log` never diffs them unasked.
93
+ *
94
+ * @param base - The trunk the delta was taken against.
95
+ * @param branch - The branch to describe.
96
+ * @param count - Ceiling on the commits, the same as the delta's.
97
+ * @returns The argument vector.
98
+ */
99
+ export function gitBranchFilesArgs(base, branch, count) {
100
+ return [
101
+ 'log',
102
+ '-n',
103
+ String(count),
104
+ '-z',
105
+ '--name-status',
106
+ '--no-renames',
107
+ '--no-ext-diff',
108
+ // Repository-relative whatever `diff.relative` says: the hook may run in a subfolder.
109
+ '--no-relative',
110
+ '--format=%H',
111
+ `${base}..${branch}`,
112
+ '--'
113
+ ];
114
+ }
115
+ /**
116
+ * Names of files that hold credentials. Never hashed, and never named in a
117
+ * snapshot: the path of a key file says nothing about the work and something
118
+ * about where the keys are.
119
+ */
120
+ export const RE_SECRET_FILE = /^(\.env(\..*)?|.*\.(pem|key|p12|pfx)|id_(rsa|ed25519|ecdsa)|credentials(\..*)?|\.npmrc|\.netrc)$/i;
68
121
  /**
69
122
  * Whether a ref exists at all, for the local fallback when no `origin/HEAD` does.
70
123
  *
@@ -74,6 +127,21 @@ export function gitBranchDeltaArgs(defaultBranch, branch, count) {
74
127
  export function gitVerifyRefArgs(ref) {
75
128
  return ['rev-parse', '--verify', '-q', `${ref}^{commit}`];
76
129
  }
130
+ /**
131
+ * The remote-tracking branches whose tip is one commit, each as
132
+ * `name<separator>symref` with `refs/remotes/<remote>/` stripped.
133
+ *
134
+ * A `<remote>/HEAD` at that commit lists itself with its target as the symref:
135
+ * the remote's default branch, which is how the caller tells it apart. One
136
+ * process, and `--points-at` keeps the output to the few refs at that commit
137
+ * however many branches the remote has.
138
+ *
139
+ * @param oid - The checked-out commit.
140
+ * @returns The argument vector.
141
+ */
142
+ export function gitRemoteBranchesAtArgs(oid) {
143
+ return ['for-each-ref', `--points-at=${oid}`, `--format=%(refname:lstrip=3)${GIT_FIELD_SEPARATOR}%(symref:lstrip=3)`, 'refs/remotes'];
144
+ }
77
145
  /** What a repository's trunk is called when neither git nor the platform said. */
78
146
  export const ASSUMED_DEFAULT_BRANCHES = ['main', 'master'];
79
147
  /** Node's error code for a child process that overran maxBuffer on stdout. */
@@ -111,3 +179,116 @@ export const RE_SCP_REMOTE = /^([\w.-]{2,}):([^\s]+)$/;
111
179
  export const RE_LEADING_SLASHES = /^\/+/;
112
180
  export const RE_TRAILING_SLASHES = /\/+$/;
113
181
  export const RE_DOT_GIT_SUFFIX = /\.git$/;
182
+ /**
183
+ * What the gate reads out of a working copy, and how far it looks.
184
+ *
185
+ * The same ceiling the repository-config walk uses, for the same reason: a walk
186
+ * that never ends is a hook that never answers.
187
+ */
188
+ export const GATE_MAX_WALK_DEPTH = 32;
189
+ /** A linked worktree's `.git` file names its real git directory on one line. */
190
+ export const GATE_GITDIR_PREFIX = 'gitdir:';
191
+ /** `HEAD` on a branch; anything else is a detached HEAD, which names none. */
192
+ export const GATE_BRANCH_REF_PREFIX = 'ref: refs/heads/';
193
+ /**
194
+ * How long a remembered remote is trusted.
195
+ *
196
+ * A remote changes approximately never, which is the whole reason this is
197
+ * memoised — but `git remote set-url` does happen, and a memo with no expiry
198
+ * would pin a checkout to its old repository for good. An hour is one
199
+ * subprocess per checkout per working session, and at most an hour of a
200
+ * repository being reported under the name it had this morning.
201
+ */
202
+ export const GATE_REMOTE_MEMO_TTL_MS = 3_600_000;
203
+ /**
204
+ * And how long "this checkout has no usable remote" is remembered.
205
+ *
206
+ * Much shorter, because the answer cannot be trusted the way a remote can.
207
+ * `runGit` resolves undefined for a missing key *and* for a timeout, a git that
208
+ * is not on PATH, a spawn that failed — indistinguishable from here. Remembered
209
+ * for an hour, one overrun of the one-second budget on a cold checkout would
210
+ * silence every feature cap in that repository for the rest of the hour, with a
211
+ * debug line as the only trace. A minute bounds that, and a genuinely
212
+ * remoteless checkout pays one subprocess a minute rather than one per prompt.
213
+ */
214
+ export const GATE_REMOTE_ABSENT_TTL_MS = 60_000;
215
+ /**
216
+ * The entry that marks a repository root. A *file* of that name counts too:
217
+ * that is what a linked worktree and a submodule check out as.
218
+ */
219
+ export const GIT_ENTRY_NAME = '.git';
220
+ /**
221
+ * The errors that mean "no `.git` here". Anything else — a permission or I/O
222
+ * error — means the answer is unknown, not no.
223
+ */
224
+ export const GIT_ENTRY_ABSENT_CODES = new Set(['ENOENT', 'ENOTDIR']);
225
+ /**
226
+ * One fingerprint of a checkout: HEAD, branch and every dirty entry in one
227
+ * process. NUL-separated so a path is never quoted, split or trimmed; every
228
+ * untracked file listed on its own, since editing a file inside an untracked
229
+ * directory need not re-stamp the directory.
230
+ */
231
+ export const GIT_FINGERPRINT_ARGS = ['status', '--porcelain=v2', '--branch', '-z', '--untracked-files=all'];
232
+ /** Header lines of porcelain v2 `--branch` output that the fingerprint keeps. */
233
+ export const PORCELAIN_V2_OID_HEADER = '# branch.oid ';
234
+ export const PORCELAIN_V2_HEAD_HEADER = '# branch.head ';
235
+ /** What porcelain v2 says in place of an oid or a branch when there is none. */
236
+ export const PORCELAIN_V2_NO_OID = '(initial)';
237
+ export const PORCELAIN_V2_DETACHED = '(detached)';
238
+ /**
239
+ * Space-separated fields before the path on each porcelain v2 entry kind:
240
+ * ordinary (`1`), rename or copy (`2`, followed by the original path as its own
241
+ * NUL record), unmerged (`u`), untracked (`?`).
242
+ */
243
+ export const PORCELAIN_V2_PATH_FIELD = { 1: 8, 2: 9, u: 10, '?': 1 };
244
+ /** Porcelain v2 kinds whose entry is followed by one more NUL record, the original path. */
245
+ export const PORCELAIN_V2_RENAME_KIND = '2';
246
+ /** A full SHA-1 or SHA-256 object id. */
247
+ export const RE_OBJECT_ID = /^[0-9a-f]{40}(?:[0-9a-f]{24})?$/;
248
+ /** XY stand-in for an untracked entry, which porcelain v2 gives none. */
249
+ export const PORCELAIN_V2_UNTRACKED_XY = '??';
250
+ /** A linked worktree's git dir names the shared one in this file. */
251
+ export const GIT_COMMONDIR_FILE = 'commondir';
252
+ /**
253
+ * Cap on the files a turn reports as changed in its work checkout, the
254
+ * gateway's own bound on the list: a longer one would refuse the summary whole.
255
+ */
256
+ export const MAX_WORK_CHANGED_FILES = 500;
257
+ /**
258
+ * The files of the commits in `from..to` that no remote-tracking ref reaches,
259
+ * NUL-separated so no path comes back quoted: the commits made here, not the
260
+ * ones a pull or a merge brought in. Merge commits list nothing.
261
+ *
262
+ * @param from - The oid the turn started on; undefined for the whole history up to `to` (an unborn start).
263
+ * @param to - The oid or ref it ended on.
264
+ * @returns The argument vector.
265
+ */
266
+ export function gitOwnCommitFilesArgs(from, to) {
267
+ return ['log', '--name-only', '-z', '--format=', from === undefined ? to : `${from}..${to}`, '--not', '--remotes', '--'];
268
+ }
269
+ /**
270
+ * Prints `from` when it is not an ancestor of `to`, and nothing when it is.
271
+ *
272
+ * @param from - The oid the turn started on.
273
+ * @param to - The oid or ref it ended on.
274
+ * @returns The argument vector.
275
+ */
276
+ export function gitNotAncestorArgs(from, to) {
277
+ return ['rev-list', '-n1', `${to}..${from}`, '--'];
278
+ }
279
+ /** Files whose content ids one turn reports; the gateway clips a longer list. */
280
+ export const MAX_CONTENT_HASHES = 20;
281
+ /**
282
+ * Largest file worth an id. Mirrors the code index's `MAX_JSON_BLOB_BYTES`
283
+ * (agent-watch-core, integrations-service `github-source-read.service.ts`):
284
+ * past it the index records no digests, so a hash could never match.
285
+ */
286
+ export const MAX_HASHED_FILE_BYTES = 1_000_000;
287
+ /**
288
+ * Time one Stop hook may spend hashing; the same cap the process walk has.
289
+ * Local disk hashes 20 files in ~5 ms, so SPEC §8's 60 ms p90 is untouched; a
290
+ * loaded machine can take tens of ms, and a tighter cap would drop ids there.
291
+ * Past it, on a slow or network mount, the remaining files are skipped and the
292
+ * ids already taken are sent.
293
+ */
294
+ export const HASH_BUDGET_MS = 100;
@@ -0,0 +1,74 @@
1
+ import type { Fingerprint, GitRunner } from './types/git.types.js';
2
+ export type { DirtyEntry, Fingerprint } from './types/git.types.js';
3
+ /**
4
+ * What a checkout looks like right now: HEAD, branch, and every dirty entry
5
+ * with its size and mtime.
6
+ *
7
+ * Two of these, one when a turn first names the checkout and one at its Stop,
8
+ * are how the edge tells which checkout a turn changed without watching any of
9
+ * them: a moved HEAD is a commit, a new or re-stamped dirty entry is an edit,
10
+ * whoever made it — a file tool or a shell command.
11
+ *
12
+ * One git process, taken without optional locks; the sizes are `lstat`s. Any
13
+ * failure is no fingerprint, which costs the checkout its evidence and nothing
14
+ * else.
15
+ *
16
+ * @param root - Checkout root.
17
+ * @param run - Git runner; injectable for tests.
18
+ * @param timeoutMs - Kill budget for the git process.
19
+ * @returns The fingerprint, or undefined when git could not give one.
20
+ */
21
+ export declare function fingerprint(root: string, run?: GitRunner, timeoutMs?: number): Promise<Fingerprint | undefined>;
22
+ /**
23
+ * `git status --porcelain=v2 --branch -z`, read.
24
+ *
25
+ * Renames carry their original path as the next NUL record, which is skipped:
26
+ * the new path is the one that changed. Ignored entries never appear without
27
+ * `--ignored`.
28
+ *
29
+ * @param output - Raw NUL-separated output.
30
+ * @returns HEAD (and whether it is unborn), branch and the dirty entries as `[path, xy]`, in git's order.
31
+ */
32
+ export declare function parsePorcelainV2(output: string): {
33
+ oid?: string;
34
+ unborn: boolean;
35
+ branch?: string;
36
+ entries: (readonly [string, string])[];
37
+ };
38
+ /**
39
+ * The paths a turn changed in a checkout's working tree: every dirty entry
40
+ * that is new, re-stamped or gone since the baseline.
41
+ *
42
+ * A file that was already dirty and stayed untouched is not this turn's work,
43
+ * which is the whole difference from reporting `git status`.
44
+ *
45
+ * @param baseline - The checkout when the turn first named it.
46
+ * @param closing - The checkout at the Stop.
47
+ * @returns Repository-relative paths, in the closing fingerprint's order.
48
+ */
49
+ export declare function dirtyDelta(baseline: Fingerprint, closing: Fingerprint): string[];
50
+ /**
51
+ * The files of the commits a turn made between two points of one branch.
52
+ *
53
+ * Only commits no remote-tracking ref reaches count, so a pull, a fast-forward
54
+ * or a merge of pushed work brings in none of its files. A `from` that is not an
55
+ * ancestor of `to` (a reset, a rebase) names no commits of the turn's own.
56
+ *
57
+ * @param cwd - Checkout root, or the common git dir of one that vanished.
58
+ * @param from - Where the turn started; undefined when the branch was unborn.
59
+ * @param to - Where it ended: an oid, or a branch ref.
60
+ * @param gitDir - Ask this git dir rather than the one `cwd` would find.
61
+ * @param run - Git runner; injectable for tests.
62
+ * @returns Repository-relative paths; empty when git could not say.
63
+ */
64
+ export declare function commitFiles(cwd: string, from: string | undefined, to: string, gitDir?: string, run?: GitRunner): Promise<string[]>;
65
+ /**
66
+ * A fingerprint out of turn state, type-checked field by field.
67
+ *
68
+ * Turn state is a file on disk between hooks; a value that is not the shape
69
+ * this code writes is no baseline, never a throw.
70
+ *
71
+ * @param value - Decoded record field.
72
+ * @returns The fingerprint, or undefined.
73
+ */
74
+ export declare function asFingerprint(value: unknown): Fingerprint | undefined;