@indigoai-us/hq-cloud 6.18.44-alpha.9 → 6.18.44

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 (1068) hide show
  1. package/dist/bin/sync-runner-planning.d.ts +12 -0
  2. package/dist/bin/sync-runner-planning.d.ts.map +1 -1
  3. package/dist/bin/sync-runner-planning.js +18 -0
  4. package/dist/bin/sync-runner-planning.js.map +1 -1
  5. package/dist/bin/sync-runner-watch-loop.d.ts +18 -0
  6. package/dist/bin/sync-runner-watch-loop.d.ts.map +1 -1
  7. package/dist/bin/sync-runner-watch-loop.js +75 -6
  8. package/dist/bin/sync-runner-watch-loop.js.map +1 -1
  9. package/dist/bin/sync-runner.d.ts +22 -1
  10. package/dist/bin/sync-runner.d.ts.map +1 -1
  11. package/dist/bin/sync-runner.js +33 -4
  12. package/dist/bin/sync-runner.js.map +1 -1
  13. package/dist/cli/conflict.d.ts.map +1 -1
  14. package/dist/cli/conflict.js +2 -1
  15. package/dist/cli/conflict.js.map +1 -1
  16. package/dist/cli/rescue-core.d.ts +6 -0
  17. package/dist/cli/rescue-core.d.ts.map +1 -1
  18. package/dist/cli/rescue-core.js +10 -1
  19. package/dist/cli/rescue-core.js.map +1 -1
  20. package/dist/cli/rescue-windows-test-harness.d.ts +19 -0
  21. package/dist/cli/rescue-windows-test-harness.d.ts.map +1 -0
  22. package/dist/cli/rescue-windows-test-harness.js +443 -0
  23. package/dist/cli/rescue-windows-test-harness.js.map +1 -0
  24. package/dist/company-resolver.d.ts +22 -0
  25. package/dist/company-resolver.d.ts.map +1 -1
  26. package/dist/company-resolver.js +1 -1
  27. package/dist/company-resolver.js.map +1 -1
  28. package/dist/ignore.d.ts +4 -1
  29. package/dist/ignore.d.ts.map +1 -1
  30. package/dist/ignore.js +10 -12
  31. package/dist/ignore.js.map +1 -1
  32. package/dist/journal-snapshot-decoder.js +15 -2
  33. package/dist/journal-snapshot-decoder.js.map +1 -1
  34. package/dist/sync/durable-apply.d.ts +2 -0
  35. package/dist/sync/durable-apply.d.ts.map +1 -1
  36. package/dist/sync/durable-apply.js +9 -12
  37. package/dist/sync/durable-apply.js.map +1 -1
  38. package/dist/sync/fsync-compat.d.ts +13 -0
  39. package/dist/sync/fsync-compat.d.ts.map +1 -0
  40. package/dist/sync/fsync-compat.js +33 -0
  41. package/dist/sync/fsync-compat.js.map +1 -0
  42. package/dist/sync/multipart-uploader.d.ts.map +1 -1
  43. package/dist/sync/multipart-uploader.js +2 -1
  44. package/dist/sync/multipart-uploader.js.map +1 -1
  45. package/dist/sync/scope-inventory-client.d.ts.map +1 -1
  46. package/dist/sync/scope-inventory-client.js +7 -2
  47. package/dist/sync/scope-inventory-client.js.map +1 -1
  48. package/dist/telemetry.d.ts +31 -0
  49. package/dist/telemetry.d.ts.map +1 -1
  50. package/dist/telemetry.js +177 -17
  51. package/dist/telemetry.js.map +1 -1
  52. package/dist/usage-company-fallback.d.ts +104 -0
  53. package/dist/usage-company-fallback.d.ts.map +1 -0
  54. package/dist/usage-company-fallback.js +599 -0
  55. package/dist/usage-company-fallback.js.map +1 -0
  56. package/dist/watch-owner-lease.d.ts +3 -0
  57. package/dist/watch-owner-lease.d.ts.map +1 -1
  58. package/dist/watch-owner-lease.js +14 -3
  59. package/dist/watch-owner-lease.js.map +1 -1
  60. package/package.json +2 -2
  61. package/dist/active-company.test.d.ts +0 -2
  62. package/dist/active-company.test.d.ts.map +0 -1
  63. package/dist/active-company.test.js +0 -149
  64. package/dist/active-company.test.js.map +0 -1
  65. package/dist/agent-codex-instructions.test.d.ts +0 -2
  66. package/dist/agent-codex-instructions.test.d.ts.map +0 -1
  67. package/dist/agent-codex-instructions.test.js +0 -271
  68. package/dist/agent-codex-instructions.test.js.map +0 -1
  69. package/dist/backup-prune.test.d.ts +0 -2
  70. package/dist/backup-prune.test.d.ts.map +0 -1
  71. package/dist/backup-prune.test.js +0 -154
  72. package/dist/backup-prune.test.js.map +0 -1
  73. package/dist/bandwidth.test.d.ts +0 -2
  74. package/dist/bandwidth.test.d.ts.map +0 -1
  75. package/dist/bandwidth.test.js +0 -342
  76. package/dist/bandwidth.test.js.map +0 -1
  77. package/dist/best-effort-error.test.d.ts +0 -2
  78. package/dist/best-effort-error.test.d.ts.map +0 -1
  79. package/dist/best-effort-error.test.js +0 -54
  80. package/dist/best-effort-error.test.js.map +0 -1
  81. package/dist/bin/area-ledger-migration.test.d.ts +0 -2
  82. package/dist/bin/area-ledger-migration.test.d.ts.map +0 -1
  83. package/dist/bin/area-ledger-migration.test.js +0 -410
  84. package/dist/bin/area-ledger-migration.test.js.map +0 -1
  85. package/dist/bin/backup-prune-runner.test.d.ts +0 -2
  86. package/dist/bin/backup-prune-runner.test.d.ts.map +0 -1
  87. package/dist/bin/backup-prune-runner.test.js +0 -22
  88. package/dist/bin/backup-prune-runner.test.js.map +0 -1
  89. package/dist/bin/journal-repair.test.d.ts +0 -2
  90. package/dist/bin/journal-repair.test.d.ts.map +0 -1
  91. package/dist/bin/journal-repair.test.js +0 -53
  92. package/dist/bin/journal-repair.test.js.map +0 -1
  93. package/dist/bin/layout-compatibility.test.d.ts +0 -2
  94. package/dist/bin/layout-compatibility.test.d.ts.map +0 -1
  95. package/dist/bin/layout-compatibility.test.js +0 -87
  96. package/dist/bin/layout-compatibility.test.js.map +0 -1
  97. package/dist/bin/outpost-heartbeat.test.d.ts +0 -7
  98. package/dist/bin/outpost-heartbeat.test.d.ts.map +0 -1
  99. package/dist/bin/outpost-heartbeat.test.js +0 -84
  100. package/dist/bin/outpost-heartbeat.test.js.map +0 -1
  101. package/dist/bin/outpost-session-host.test.d.ts +0 -7
  102. package/dist/bin/outpost-session-host.test.d.ts.map +0 -1
  103. package/dist/bin/outpost-session-host.test.js +0 -52
  104. package/dist/bin/outpost-session-host.test.js.map +0 -1
  105. package/dist/bin/sync-mutation.test.d.ts +0 -2
  106. package/dist/bin/sync-mutation.test.d.ts.map +0 -1
  107. package/dist/bin/sync-mutation.test.js +0 -64
  108. package/dist/bin/sync-mutation.test.js.map +0 -1
  109. package/dist/bin/sync-runner-args.test.d.ts +0 -2
  110. package/dist/bin/sync-runner-args.test.d.ts.map +0 -1
  111. package/dist/bin/sync-runner-args.test.js +0 -82
  112. package/dist/bin/sync-runner-args.test.js.map +0 -1
  113. package/dist/bin/sync-runner-auth-wait.test.d.ts +0 -2
  114. package/dist/bin/sync-runner-auth-wait.test.d.ts.map +0 -1
  115. package/dist/bin/sync-runner-auth-wait.test.js +0 -406
  116. package/dist/bin/sync-runner-auth-wait.test.js.map +0 -1
  117. package/dist/bin/sync-runner-backoff.regression.test.d.ts +0 -29
  118. package/dist/bin/sync-runner-backoff.regression.test.d.ts.map +0 -1
  119. package/dist/bin/sync-runner-backoff.regression.test.js +0 -224
  120. package/dist/bin/sync-runner-backoff.regression.test.js.map +0 -1
  121. package/dist/bin/sync-runner-company.test.d.ts +0 -2
  122. package/dist/bin/sync-runner-company.test.d.ts.map +0 -1
  123. package/dist/bin/sync-runner-company.test.js +0 -2439
  124. package/dist/bin/sync-runner-company.test.js.map +0 -1
  125. package/dist/bin/sync-runner-delete-snapshot-mixed.bench.test.d.ts +0 -2
  126. package/dist/bin/sync-runner-delete-snapshot-mixed.bench.test.d.ts.map +0 -1
  127. package/dist/bin/sync-runner-delete-snapshot-mixed.bench.test.js +0 -648
  128. package/dist/bin/sync-runner-delete-snapshot-mixed.bench.test.js.map +0 -1
  129. package/dist/bin/sync-runner-delete-snapshot.bench.test.d.ts +0 -2
  130. package/dist/bin/sync-runner-delete-snapshot.bench.test.d.ts.map +0 -1
  131. package/dist/bin/sync-runner-delete-snapshot.bench.test.js +0 -329
  132. package/dist/bin/sync-runner-delete-snapshot.bench.test.js.map +0 -1
  133. package/dist/bin/sync-runner-events.test.d.ts +0 -2
  134. package/dist/bin/sync-runner-events.test.d.ts.map +0 -1
  135. package/dist/bin/sync-runner-events.test.js +0 -364
  136. package/dist/bin/sync-runner-events.test.js.map +0 -1
  137. package/dist/bin/sync-runner-heap-telemetry.test.d.ts +0 -2
  138. package/dist/bin/sync-runner-heap-telemetry.test.d.ts.map +0 -1
  139. package/dist/bin/sync-runner-heap-telemetry.test.js +0 -1966
  140. package/dist/bin/sync-runner-heap-telemetry.test.js.map +0 -1
  141. package/dist/bin/sync-runner-manifest.test.d.ts +0 -12
  142. package/dist/bin/sync-runner-manifest.test.d.ts.map +0 -1
  143. package/dist/bin/sync-runner-manifest.test.js +0 -921
  144. package/dist/bin/sync-runner-manifest.test.js.map +0 -1
  145. package/dist/bin/sync-runner-planning.test.d.ts +0 -2
  146. package/dist/bin/sync-runner-planning.test.d.ts.map +0 -1
  147. package/dist/bin/sync-runner-planning.test.js +0 -448
  148. package/dist/bin/sync-runner-planning.test.js.map +0 -1
  149. package/dist/bin/sync-runner-post-sync-flags.test.d.ts +0 -2
  150. package/dist/bin/sync-runner-post-sync-flags.test.d.ts.map +0 -1
  151. package/dist/bin/sync-runner-post-sync-flags.test.js +0 -64
  152. package/dist/bin/sync-runner-post-sync-flags.test.js.map +0 -1
  153. package/dist/bin/sync-runner-publish-expansion.test.d.ts +0 -2
  154. package/dist/bin/sync-runner-publish-expansion.test.d.ts.map +0 -1
  155. package/dist/bin/sync-runner-publish-expansion.test.js +0 -54
  156. package/dist/bin/sync-runner-publish-expansion.test.js.map +0 -1
  157. package/dist/bin/sync-runner-receiver-unresolved-company.test.d.ts +0 -2
  158. package/dist/bin/sync-runner-receiver-unresolved-company.test.d.ts.map +0 -1
  159. package/dist/bin/sync-runner-receiver-unresolved-company.test.js +0 -379
  160. package/dist/bin/sync-runner-receiver-unresolved-company.test.js.map +0 -1
  161. package/dist/bin/sync-runner-rollup.test.d.ts +0 -2
  162. package/dist/bin/sync-runner-rollup.test.d.ts.map +0 -1
  163. package/dist/bin/sync-runner-rollup.test.js +0 -24
  164. package/dist/bin/sync-runner-rollup.test.js.map +0 -1
  165. package/dist/bin/sync-runner-watch-loop.test.d.ts +0 -2
  166. package/dist/bin/sync-runner-watch-loop.test.d.ts.map +0 -1
  167. package/dist/bin/sync-runner-watch-loop.test.js +0 -734
  168. package/dist/bin/sync-runner-watch-loop.test.js.map +0 -1
  169. package/dist/bin/sync-runner-watch-routes.test.d.ts +0 -2
  170. package/dist/bin/sync-runner-watch-routes.test.d.ts.map +0 -1
  171. package/dist/bin/sync-runner-watch-routes.test.js +0 -181
  172. package/dist/bin/sync-runner-watch-routes.test.js.map +0 -1
  173. package/dist/bin/sync-runner.test.d.ts +0 -10
  174. package/dist/bin/sync-runner.test.d.ts.map +0 -1
  175. package/dist/bin/sync-runner.test.js +0 -18984
  176. package/dist/bin/sync-runner.test.js.map +0 -1
  177. package/dist/cli/case-alias.test.d.ts +0 -2
  178. package/dist/cli/case-alias.test.d.ts.map +0 -1
  179. package/dist/cli/case-alias.test.js +0 -96
  180. package/dist/cli/case-alias.test.js.map +0 -1
  181. package/dist/cli/conflict-recovery.test.d.ts +0 -2
  182. package/dist/cli/conflict-recovery.test.d.ts.map +0 -1
  183. package/dist/cli/conflict-recovery.test.js +0 -201
  184. package/dist/cli/conflict-recovery.test.js.map +0 -1
  185. package/dist/cli/conflict-winner.test.d.ts +0 -7
  186. package/dist/cli/conflict-winner.test.d.ts.map +0 -1
  187. package/dist/cli/conflict-winner.test.js +0 -98
  188. package/dist/cli/conflict-winner.test.js.map +0 -1
  189. package/dist/cli/doctor.test.d.ts +0 -13
  190. package/dist/cli/doctor.test.d.ts.map +0 -1
  191. package/dist/cli/doctor.test.js +0 -607
  192. package/dist/cli/doctor.test.js.map +0 -1
  193. package/dist/cli/invite.test.d.ts +0 -5
  194. package/dist/cli/invite.test.d.ts.map +0 -1
  195. package/dist/cli/invite.test.js +0 -178
  196. package/dist/cli/invite.test.js.map +0 -1
  197. package/dist/cli/onepass-pull-planner-regressions.test.d.ts +0 -2
  198. package/dist/cli/onepass-pull-planner-regressions.test.d.ts.map +0 -1
  199. package/dist/cli/onepass-pull-planner-regressions.test.js +0 -300
  200. package/dist/cli/onepass-pull-planner-regressions.test.js.map +0 -1
  201. package/dist/cli/onepass-pull-planner.test.d.ts +0 -2
  202. package/dist/cli/onepass-pull-planner.test.d.ts.map +0 -1
  203. package/dist/cli/onepass-pull-planner.test.js +0 -266
  204. package/dist/cli/onepass-pull-planner.test.js.map +0 -1
  205. package/dist/cli/push-scan-exclusions.test.d.ts +0 -2
  206. package/dist/cli/push-scan-exclusions.test.d.ts.map +0 -1
  207. package/dist/cli/push-scan-exclusions.test.js +0 -99
  208. package/dist/cli/push-scan-exclusions.test.js.map +0 -1
  209. package/dist/cli/reindex-knowledge.test.d.ts +0 -12
  210. package/dist/cli/reindex-knowledge.test.d.ts.map +0 -1
  211. package/dist/cli/reindex-knowledge.test.js +0 -260
  212. package/dist/cli/reindex-knowledge.test.js.map +0 -1
  213. package/dist/cli/reindex.test.d.ts +0 -11
  214. package/dist/cli/reindex.test.d.ts.map +0 -1
  215. package/dist/cli/reindex.test.js +0 -811
  216. package/dist/cli/reindex.test.js.map +0 -1
  217. package/dist/cli/rescue-breaker.test.d.ts +0 -2
  218. package/dist/cli/rescue-breaker.test.d.ts.map +0 -1
  219. package/dist/cli/rescue-breaker.test.js +0 -812
  220. package/dist/cli/rescue-breaker.test.js.map +0 -1
  221. package/dist/cli/rescue-classify-ordering.test.d.ts +0 -2
  222. package/dist/cli/rescue-classify-ordering.test.d.ts.map +0 -1
  223. package/dist/cli/rescue-classify-ordering.test.js +0 -500
  224. package/dist/cli/rescue-classify-ordering.test.js.map +0 -1
  225. package/dist/cli/rescue-clone-diagnostics.test.d.ts +0 -2
  226. package/dist/cli/rescue-clone-diagnostics.test.d.ts.map +0 -1
  227. package/dist/cli/rescue-clone-diagnostics.test.js +0 -101
  228. package/dist/cli/rescue-clone-diagnostics.test.js.map +0 -1
  229. package/dist/cli/rescue-clone-network-retry.test.d.ts +0 -2
  230. package/dist/cli/rescue-clone-network-retry.test.d.ts.map +0 -1
  231. package/dist/cli/rescue-clone-network-retry.test.js +0 -415
  232. package/dist/cli/rescue-clone-network-retry.test.js.map +0 -1
  233. package/dist/cli/rescue-core-stamp.test.d.ts +0 -2
  234. package/dist/cli/rescue-core-stamp.test.d.ts.map +0 -1
  235. package/dist/cli/rescue-core-stamp.test.js +0 -364
  236. package/dist/cli/rescue-core-stamp.test.js.map +0 -1
  237. package/dist/cli/rescue-drift-reconcile.test.d.ts +0 -2
  238. package/dist/cli/rescue-drift-reconcile.test.d.ts.map +0 -1
  239. package/dist/cli/rescue-drift-reconcile.test.js +0 -162
  240. package/dist/cli/rescue-drift-reconcile.test.js.map +0 -1
  241. package/dist/cli/rescue-drop-dir-symlink.test.d.ts +0 -2
  242. package/dist/cli/rescue-drop-dir-symlink.test.d.ts.map +0 -1
  243. package/dist/cli/rescue-drop-dir-symlink.test.js +0 -255
  244. package/dist/cli/rescue-drop-dir-symlink.test.js.map +0 -1
  245. package/dist/cli/rescue-exec-bit-preserve.test.d.ts +0 -2
  246. package/dist/cli/rescue-exec-bit-preserve.test.d.ts.map +0 -1
  247. package/dist/cli/rescue-exec-bit-preserve.test.js +0 -177
  248. package/dist/cli/rescue-exec-bit-preserve.test.js.map +0 -1
  249. package/dist/cli/rescue-hq-root-guard.test.d.ts +0 -2
  250. package/dist/cli/rescue-hq-root-guard.test.d.ts.map +0 -1
  251. package/dist/cli/rescue-hq-root-guard.test.js +0 -210
  252. package/dist/cli/rescue-hq-root-guard.test.js.map +0 -1
  253. package/dist/cli/rescue-journal-reconcile.test.d.ts +0 -2
  254. package/dist/cli/rescue-journal-reconcile.test.d.ts.map +0 -1
  255. package/dist/cli/rescue-journal-reconcile.test.js +0 -186
  256. package/dist/cli/rescue-journal-reconcile.test.js.map +0 -1
  257. package/dist/cli/rescue-keep-local-ignore.test.d.ts +0 -2
  258. package/dist/cli/rescue-keep-local-ignore.test.d.ts.map +0 -1
  259. package/dist/cli/rescue-keep-local-ignore.test.js +0 -315
  260. package/dist/cli/rescue-keep-local-ignore.test.js.map +0 -1
  261. package/dist/cli/rescue-move.test.d.ts +0 -2
  262. package/dist/cli/rescue-move.test.d.ts.map +0 -1
  263. package/dist/cli/rescue-move.test.js +0 -166
  264. package/dist/cli/rescue-move.test.js.map +0 -1
  265. package/dist/cli/rescue-mtime-preserve.test.d.ts +0 -2
  266. package/dist/cli/rescue-mtime-preserve.test.d.ts.map +0 -1
  267. package/dist/cli/rescue-mtime-preserve.test.js +0 -186
  268. package/dist/cli/rescue-mtime-preserve.test.js.map +0 -1
  269. package/dist/cli/rescue-preserve-copy-symlink.test.d.ts +0 -2
  270. package/dist/cli/rescue-preserve-copy-symlink.test.d.ts.map +0 -1
  271. package/dist/cli/rescue-preserve-copy-symlink.test.js +0 -483
  272. package/dist/cli/rescue-preserve-copy-symlink.test.js.map +0 -1
  273. package/dist/cli/rescue-realpath.test.d.ts +0 -2
  274. package/dist/cli/rescue-realpath.test.d.ts.map +0 -1
  275. package/dist/cli/rescue-realpath.test.js +0 -109
  276. package/dist/cli/rescue-realpath.test.js.map +0 -1
  277. package/dist/cli/rescue-restore-flag.test.d.ts +0 -2
  278. package/dist/cli/rescue-restore-flag.test.d.ts.map +0 -1
  279. package/dist/cli/rescue-restore-flag.test.js +0 -82
  280. package/dist/cli/rescue-restore-flag.test.js.map +0 -1
  281. package/dist/cli/rescue-rsync-preflight.test.d.ts +0 -2
  282. package/dist/cli/rescue-rsync-preflight.test.d.ts.map +0 -1
  283. package/dist/cli/rescue-rsync-preflight.test.js +0 -579
  284. package/dist/cli/rescue-rsync-preflight.test.js.map +0 -1
  285. package/dist/cli/rescue-rsync-status.test.d.ts +0 -2
  286. package/dist/cli/rescue-rsync-status.test.d.ts.map +0 -1
  287. package/dist/cli/rescue-rsync-status.test.js +0 -406
  288. package/dist/cli/rescue-rsync-status.test.js.map +0 -1
  289. package/dist/cli/rescue-settings-reconcile.test.d.ts +0 -2
  290. package/dist/cli/rescue-settings-reconcile.test.d.ts.map +0 -1
  291. package/dist/cli/rescue-settings-reconcile.test.js +0 -610
  292. package/dist/cli/rescue-settings-reconcile.test.js.map +0 -1
  293. package/dist/cli/rescue-snapshot-copy.test.d.ts +0 -2
  294. package/dist/cli/rescue-snapshot-copy.test.d.ts.map +0 -1
  295. package/dist/cli/rescue-snapshot-copy.test.js +0 -790
  296. package/dist/cli/rescue-snapshot-copy.test.js.map +0 -1
  297. package/dist/cli/rescue-snapshot-recovery.test.d.ts +0 -2
  298. package/dist/cli/rescue-snapshot-recovery.test.d.ts.map +0 -1
  299. package/dist/cli/rescue-snapshot-recovery.test.js +0 -265
  300. package/dist/cli/rescue-snapshot-recovery.test.js.map +0 -1
  301. package/dist/cli/rescue-snapshot.test.d.ts +0 -2
  302. package/dist/cli/rescue-snapshot.test.d.ts.map +0 -1
  303. package/dist/cli/rescue-snapshot.test.js +0 -46
  304. package/dist/cli/rescue-snapshot.test.js.map +0 -1
  305. package/dist/cli/rescue-source-switch-floor.test.d.ts +0 -2
  306. package/dist/cli/rescue-source-switch-floor.test.d.ts.map +0 -1
  307. package/dist/cli/rescue-source-switch-floor.test.js +0 -247
  308. package/dist/cli/rescue-source-switch-floor.test.js.map +0 -1
  309. package/dist/cli/rescue-unchanged-delete.test.d.ts +0 -2
  310. package/dist/cli/rescue-unchanged-delete.test.d.ts.map +0 -1
  311. package/dist/cli/rescue-unchanged-delete.test.js +0 -305
  312. package/dist/cli/rescue-unchanged-delete.test.js.map +0 -1
  313. package/dist/cli/rescue.reindex.test.d.ts +0 -2
  314. package/dist/cli/rescue.reindex.test.d.ts.map +0 -1
  315. package/dist/cli/rescue.reindex.test.js +0 -72
  316. package/dist/cli/rescue.reindex.test.js.map +0 -1
  317. package/dist/cli/rescue.test.d.ts +0 -2
  318. package/dist/cli/rescue.test.d.ts.map +0 -1
  319. package/dist/cli/rescue.test.js +0 -127
  320. package/dist/cli/rescue.test.js.map +0 -1
  321. package/dist/cli/share-plan-limit-presign.test.d.ts +0 -2
  322. package/dist/cli/share-plan-limit-presign.test.d.ts.map +0 -1
  323. package/dist/cli/share-plan-limit-presign.test.js +0 -271
  324. package/dist/cli/share-plan-limit-presign.test.js.map +0 -1
  325. package/dist/cli/share-presign-transport.test.d.ts +0 -22
  326. package/dist/cli/share-presign-transport.test.d.ts.map +0 -1
  327. package/dist/cli/share-presign-transport.test.js +0 -388
  328. package/dist/cli/share-presign-transport.test.js.map +0 -1
  329. package/dist/cli/share.test.d.ts +0 -5
  330. package/dist/cli/share.test.d.ts.map +0 -1
  331. package/dist/cli/share.test.js +0 -12335
  332. package/dist/cli/share.test.js.map +0 -1
  333. package/dist/cli/streaming-pull-planner.bench.test.d.ts +0 -15
  334. package/dist/cli/streaming-pull-planner.bench.test.d.ts.map +0 -1
  335. package/dist/cli/streaming-pull-planner.bench.test.js +0 -273
  336. package/dist/cli/streaming-pull-planner.bench.test.js.map +0 -1
  337. package/dist/cli/sync-scope.test.d.ts +0 -22
  338. package/dist/cli/sync-scope.test.d.ts.map +0 -1
  339. package/dist/cli/sync-scope.test.js +0 -903
  340. package/dist/cli/sync-scope.test.js.map +0 -1
  341. package/dist/cli/sync.test.d.ts +0 -5
  342. package/dist/cli/sync.test.d.ts.map +0 -1
  343. package/dist/cli/sync.test.js +0 -9028
  344. package/dist/cli/sync.test.js.map +0 -1
  345. package/dist/cli/tombstones.test.d.ts +0 -2
  346. package/dist/cli/tombstones.test.d.ts.map +0 -1
  347. package/dist/cli/tombstones.test.js +0 -120
  348. package/dist/cli/tombstones.test.js.map +0 -1
  349. package/dist/cli/watch-event-push-conflict.test.d.ts +0 -25
  350. package/dist/cli/watch-event-push-conflict.test.d.ts.map +0 -1
  351. package/dist/cli/watch-event-push-conflict.test.js +0 -230
  352. package/dist/cli/watch-event-push-conflict.test.js.map +0 -1
  353. package/dist/client-info.test.d.ts +0 -11
  354. package/dist/client-info.test.d.ts.map +0 -1
  355. package/dist/client-info.test.js +0 -168
  356. package/dist/client-info.test.js.map +0 -1
  357. package/dist/cognito-auth-lock-no-hard-links.test.d.ts +0 -11
  358. package/dist/cognito-auth-lock-no-hard-links.test.d.ts.map +0 -1
  359. package/dist/cognito-auth-lock-no-hard-links.test.js +0 -76
  360. package/dist/cognito-auth-lock-no-hard-links.test.js.map +0 -1
  361. package/dist/cognito-auth.test.d.ts +0 -9
  362. package/dist/cognito-auth.test.d.ts.map +0 -1
  363. package/dist/cognito-auth.test.js +0 -745
  364. package/dist/cognito-auth.test.js.map +0 -1
  365. package/dist/company-resolver.test.d.ts +0 -7
  366. package/dist/company-resolver.test.d.ts.map +0 -1
  367. package/dist/company-resolver.test.js +0 -533
  368. package/dist/company-resolver.test.js.map +0 -1
  369. package/dist/company-slug.test.d.ts +0 -7
  370. package/dist/company-slug.test.d.ts.map +0 -1
  371. package/dist/company-slug.test.js +0 -43
  372. package/dist/company-slug.test.js.map +0 -1
  373. package/dist/company-vault-transport.test.d.ts +0 -12
  374. package/dist/company-vault-transport.test.d.ts.map +0 -1
  375. package/dist/company-vault-transport.test.js +0 -97
  376. package/dist/company-vault-transport.test.js.map +0 -1
  377. package/dist/context.test.d.ts +0 -7
  378. package/dist/context.test.d.ts.map +0 -1
  379. package/dist/context.test.js +0 -646
  380. package/dist/context.test.js.map +0 -1
  381. package/dist/entity-resolver.test.d.ts +0 -10
  382. package/dist/entity-resolver.test.d.ts.map +0 -1
  383. package/dist/entity-resolver.test.js +0 -244
  384. package/dist/entity-resolver.test.js.map +0 -1
  385. package/dist/getindigo-dead-refs-contract.test.d.ts +0 -2
  386. package/dist/getindigo-dead-refs-contract.test.d.ts.map +0 -1
  387. package/dist/getindigo-dead-refs-contract.test.js +0 -58
  388. package/dist/getindigo-dead-refs-contract.test.js.map +0 -1
  389. package/dist/hermetic-test-env.test.d.ts +0 -2
  390. package/dist/hermetic-test-env.test.d.ts.map +0 -1
  391. package/dist/hermetic-test-env.test.js +0 -61
  392. package/dist/hermetic-test-env.test.js.map +0 -1
  393. package/dist/hq-root-recovery.test.d.ts +0 -2
  394. package/dist/hq-root-recovery.test.d.ts.map +0 -1
  395. package/dist/hq-root-recovery.test.js +0 -65
  396. package/dist/hq-root-recovery.test.js.map +0 -1
  397. package/dist/ignore.test.d.ts +0 -10
  398. package/dist/ignore.test.d.ts.map +0 -1
  399. package/dist/ignore.test.js +0 -926
  400. package/dist/ignore.test.js.map +0 -1
  401. package/dist/index.test.d.ts +0 -2
  402. package/dist/index.test.d.ts.map +0 -1
  403. package/dist/index.test.js +0 -26
  404. package/dist/index.test.js.map +0 -1
  405. package/dist/journal-area-ledger-read-boundary.test.d.ts +0 -2
  406. package/dist/journal-area-ledger-read-boundary.test.d.ts.map +0 -1
  407. package/dist/journal-area-ledger-read-boundary.test.js +0 -420
  408. package/dist/journal-area-ledger-read-boundary.test.js.map +0 -1
  409. package/dist/journal-baseline.test.d.ts +0 -2
  410. package/dist/journal-baseline.test.d.ts.map +0 -1
  411. package/dist/journal-baseline.test.js +0 -218
  412. package/dist/journal-baseline.test.js.map +0 -1
  413. package/dist/journal-decode-window.test.d.ts +0 -2
  414. package/dist/journal-decode-window.test.d.ts.map +0 -1
  415. package/dist/journal-decode-window.test.js +0 -99
  416. package/dist/journal-decode-window.test.js.map +0 -1
  417. package/dist/journal-delta-writes.test.d.ts +0 -2
  418. package/dist/journal-delta-writes.test.d.ts.map +0 -1
  419. package/dist/journal-delta-writes.test.js +0 -159
  420. package/dist/journal-delta-writes.test.js.map +0 -1
  421. package/dist/journal-ledger-index.test.d.ts +0 -15
  422. package/dist/journal-ledger-index.test.d.ts.map +0 -1
  423. package/dist/journal-ledger-index.test.js +0 -269
  424. package/dist/journal-ledger-index.test.js.map +0 -1
  425. package/dist/journal-public-boundary.test.d.ts +0 -2
  426. package/dist/journal-public-boundary.test.d.ts.map +0 -1
  427. package/dist/journal-public-boundary.test.js +0 -216
  428. package/dist/journal-public-boundary.test.js.map +0 -1
  429. package/dist/journal-row-store.test.d.ts +0 -2
  430. package/dist/journal-row-store.test.d.ts.map +0 -1
  431. package/dist/journal-row-store.test.js +0 -729
  432. package/dist/journal-row-store.test.js.map +0 -1
  433. package/dist/journal-snapshot-memory-helpers.d.ts +0 -33
  434. package/dist/journal-snapshot-memory-helpers.d.ts.map +0 -1
  435. package/dist/journal-snapshot-memory-helpers.js +0 -212
  436. package/dist/journal-snapshot-memory-helpers.js.map +0 -1
  437. package/dist/journal-snapshot-memory.test.d.ts +0 -2
  438. package/dist/journal-snapshot-memory.test.d.ts.map +0 -1
  439. package/dist/journal-snapshot-memory.test.js +0 -47
  440. package/dist/journal-snapshot-memory.test.js.map +0 -1
  441. package/dist/journal-snapshot-v4-memory.test.d.ts +0 -2
  442. package/dist/journal-snapshot-v4-memory.test.d.ts.map +0 -1
  443. package/dist/journal-snapshot-v4-memory.test.js +0 -24
  444. package/dist/journal-snapshot-v4-memory.test.js.map +0 -1
  445. package/dist/journal-snapshot-v4-writer-memory.test.d.ts +0 -2
  446. package/dist/journal-snapshot-v4-writer-memory.test.d.ts.map +0 -1
  447. package/dist/journal-snapshot-v4-writer-memory.test.js +0 -76
  448. package/dist/journal-snapshot-v4-writer-memory.test.js.map +0 -1
  449. package/dist/journal-snapshot-v4-writer.test.d.ts +0 -2
  450. package/dist/journal-snapshot-v4-writer.test.d.ts.map +0 -1
  451. package/dist/journal-snapshot-v4-writer.test.js +0 -282
  452. package/dist/journal-snapshot-v4-writer.test.js.map +0 -1
  453. package/dist/journal-snapshot-v4.test.d.ts +0 -2
  454. package/dist/journal-snapshot-v4.test.d.ts.map +0 -1
  455. package/dist/journal-snapshot-v4.test.js +0 -281
  456. package/dist/journal-snapshot-v4.test.js.map +0 -1
  457. package/dist/journal-store.test.d.ts +0 -2
  458. package/dist/journal-store.test.d.ts.map +0 -1
  459. package/dist/journal-store.test.js +0 -1227
  460. package/dist/journal-store.test.js.map +0 -1
  461. package/dist/journal-streaming.heap.test.d.ts +0 -2
  462. package/dist/journal-streaming.heap.test.d.ts.map +0 -1
  463. package/dist/journal-streaming.heap.test.js +0 -190
  464. package/dist/journal-streaming.heap.test.js.map +0 -1
  465. package/dist/journal.test.d.ts +0 -9
  466. package/dist/journal.test.d.ts.map +0 -1
  467. package/dist/journal.test.js +0 -1074
  468. package/dist/journal.test.js.map +0 -1
  469. package/dist/kms10-etag-safe-pull.test.d.ts +0 -2
  470. package/dist/kms10-etag-safe-pull.test.d.ts.map +0 -1
  471. package/dist/kms10-etag-safe-pull.test.js +0 -53
  472. package/dist/kms10-etag-safe-pull.test.js.map +0 -1
  473. package/dist/lib/cloud-authoritative.test.d.ts +0 -2
  474. package/dist/lib/cloud-authoritative.test.d.ts.map +0 -1
  475. package/dist/lib/cloud-authoritative.test.js +0 -42
  476. package/dist/lib/cloud-authoritative.test.js.map +0 -1
  477. package/dist/lib/conflict-reconcile.test.d.ts +0 -7
  478. package/dist/lib/conflict-reconcile.test.d.ts.map +0 -1
  479. package/dist/lib/conflict-reconcile.test.js +0 -246
  480. package/dist/lib/conflict-reconcile.test.js.map +0 -1
  481. package/dist/lib/conflict.test.d.ts +0 -9
  482. package/dist/lib/conflict.test.d.ts.map +0 -1
  483. package/dist/lib/conflict.test.js +0 -340
  484. package/dist/lib/conflict.test.js.map +0 -1
  485. package/dist/lib/describe-error.test.d.ts +0 -2
  486. package/dist/lib/describe-error.test.d.ts.map +0 -1
  487. package/dist/lib/describe-error.test.js +0 -148
  488. package/dist/lib/describe-error.test.js.map +0 -1
  489. package/dist/lib/machine-id.test.d.ts +0 -8
  490. package/dist/lib/machine-id.test.d.ts.map +0 -1
  491. package/dist/lib/machine-id.test.js +0 -228
  492. package/dist/lib/machine-id.test.js.map +0 -1
  493. package/dist/lib/net-errors.test.d.ts +0 -2
  494. package/dist/lib/net-errors.test.d.ts.map +0 -1
  495. package/dist/lib/net-errors.test.js +0 -111
  496. package/dist/lib/net-errors.test.js.map +0 -1
  497. package/dist/lib/ontology-entity-meta.test.d.ts +0 -2
  498. package/dist/lib/ontology-entity-meta.test.d.ts.map +0 -1
  499. package/dist/lib/ontology-entity-meta.test.js +0 -79
  500. package/dist/lib/ontology-entity-meta.test.js.map +0 -1
  501. package/dist/lib/ontology-entity-push.test.d.ts +0 -2
  502. package/dist/lib/ontology-entity-push.test.d.ts.map +0 -1
  503. package/dist/lib/ontology-entity-push.test.js +0 -156
  504. package/dist/lib/ontology-entity-push.test.js.map +0 -1
  505. package/dist/lib/personal-connector-settings-sync.test.d.ts +0 -2
  506. package/dist/lib/personal-connector-settings-sync.test.d.ts.map +0 -1
  507. package/dist/lib/personal-connector-settings-sync.test.js +0 -34
  508. package/dist/lib/personal-connector-settings-sync.test.js.map +0 -1
  509. package/dist/lib/readlink-safe.test.d.ts +0 -2
  510. package/dist/lib/readlink-safe.test.d.ts.map +0 -1
  511. package/dist/lib/readlink-safe.test.js +0 -34
  512. package/dist/lib/readlink-safe.test.js.map +0 -1
  513. package/dist/lib/s3-content-checksum.test.d.ts +0 -2
  514. package/dist/lib/s3-content-checksum.test.d.ts.map +0 -1
  515. package/dist/lib/s3-content-checksum.test.js +0 -26
  516. package/dist/lib/s3-content-checksum.test.js.map +0 -1
  517. package/dist/lib/skill-register-landed-bytes.test.d.ts +0 -2
  518. package/dist/lib/skill-register-landed-bytes.test.d.ts.map +0 -1
  519. package/dist/lib/skill-register-landed-bytes.test.js +0 -83
  520. package/dist/lib/skill-register-landed-bytes.test.js.map +0 -1
  521. package/dist/local-path-codec.test.d.ts +0 -14
  522. package/dist/local-path-codec.test.d.ts.map +0 -1
  523. package/dist/local-path-codec.test.js +0 -122
  524. package/dist/local-path-codec.test.js.map +0 -1
  525. package/dist/machine-auth.test.d.ts +0 -14
  526. package/dist/machine-auth.test.d.ts.map +0 -1
  527. package/dist/machine-auth.test.js +0 -1492
  528. package/dist/machine-auth.test.js.map +0 -1
  529. package/dist/machine-token-cache-isolation.test.d.ts +0 -24
  530. package/dist/machine-token-cache-isolation.test.d.ts.map +0 -1
  531. package/dist/machine-token-cache-isolation.test.js +0 -284
  532. package/dist/machine-token-cache-isolation.test.js.map +0 -1
  533. package/dist/manifest/US-002.acceptance.test.d.ts +0 -11
  534. package/dist/manifest/US-002.acceptance.test.d.ts.map +0 -1
  535. package/dist/manifest/US-002.acceptance.test.js +0 -160
  536. package/dist/manifest/US-002.acceptance.test.js.map +0 -1
  537. package/dist/manifest/US-004.acceptance.test.d.ts +0 -12
  538. package/dist/manifest/US-004.acceptance.test.d.ts.map +0 -1
  539. package/dist/manifest/US-004.acceptance.test.js +0 -173
  540. package/dist/manifest/US-004.acceptance.test.js.map +0 -1
  541. package/dist/manifest/build-manifest-resident-parity.test.d.ts +0 -2
  542. package/dist/manifest/build-manifest-resident-parity.test.d.ts.map +0 -1
  543. package/dist/manifest/build-manifest-resident-parity.test.js +0 -69
  544. package/dist/manifest/build-manifest-resident-parity.test.js.map +0 -1
  545. package/dist/manifest/build-manifest.bench.test.d.ts +0 -22
  546. package/dist/manifest/build-manifest.bench.test.d.ts.map +0 -1
  547. package/dist/manifest/build-manifest.bench.test.js +0 -930
  548. package/dist/manifest/build-manifest.bench.test.js.map +0 -1
  549. package/dist/manifest/build-manifest.test.d.ts +0 -10
  550. package/dist/manifest/build-manifest.test.d.ts.map +0 -1
  551. package/dist/manifest/build-manifest.test.js +0 -1217
  552. package/dist/manifest/build-manifest.test.js.map +0 -1
  553. package/dist/manifest/contract.test.d.ts +0 -17
  554. package/dist/manifest/contract.test.d.ts.map +0 -1
  555. package/dist/manifest/contract.test.js +0 -346
  556. package/dist/manifest/contract.test.js.map +0 -1
  557. package/dist/manifest/import-graph.test.d.ts +0 -25
  558. package/dist/manifest/import-graph.test.d.ts.map +0 -1
  559. package/dist/manifest/import-graph.test.js +0 -120
  560. package/dist/manifest/import-graph.test.js.map +0 -1
  561. package/dist/manifest/ledger-shard-isolation.test.d.ts +0 -18
  562. package/dist/manifest/ledger-shard-isolation.test.d.ts.map +0 -1
  563. package/dist/manifest/ledger-shard-isolation.test.js +0 -153
  564. package/dist/manifest/ledger-shard-isolation.test.js.map +0 -1
  565. package/dist/manifest/snapshot-store.test.d.ts +0 -11
  566. package/dist/manifest/snapshot-store.test.d.ts.map +0 -1
  567. package/dist/manifest/snapshot-store.test.js +0 -206
  568. package/dist/manifest/snapshot-store.test.js.map +0 -1
  569. package/dist/manifest/upload-manifest.test.d.ts +0 -10
  570. package/dist/manifest/upload-manifest.test.d.ts.map +0 -1
  571. package/dist/manifest/upload-manifest.test.js +0 -1335
  572. package/dist/manifest/upload-manifest.test.js.map +0 -1
  573. package/dist/manifest-reconcile.test.d.ts +0 -2
  574. package/dist/manifest-reconcile.test.d.ts.map +0 -1
  575. package/dist/manifest-reconcile.test.js +0 -1029
  576. package/dist/manifest-reconcile.test.js.map +0 -1
  577. package/dist/object-io.test.d.ts +0 -11
  578. package/dist/object-io.test.d.ts.map +0 -1
  579. package/dist/object-io.test.js +0 -2376
  580. package/dist/object-io.test.js.map +0 -1
  581. package/dist/operation-lock.test.d.ts +0 -5
  582. package/dist/operation-lock.test.d.ts.map +0 -1
  583. package/dist/operation-lock.test.js +0 -796
  584. package/dist/operation-lock.test.js.map +0 -1
  585. package/dist/outcome-telemetry.test.d.ts +0 -9
  586. package/dist/outcome-telemetry.test.d.ts.map +0 -1
  587. package/dist/outcome-telemetry.test.js +0 -663
  588. package/dist/outcome-telemetry.test.js.map +0 -1
  589. package/dist/outposts/client.test.d.ts +0 -9
  590. package/dist/outposts/client.test.d.ts.map +0 -1
  591. package/dist/outposts/client.test.js +0 -415
  592. package/dist/outposts/client.test.js.map +0 -1
  593. package/dist/outposts/command.test.d.ts +0 -18
  594. package/dist/outposts/command.test.d.ts.map +0 -1
  595. package/dist/outposts/command.test.js +0 -1230
  596. package/dist/outposts/command.test.js.map +0 -1
  597. package/dist/outposts/replica-sync.test.d.ts +0 -2
  598. package/dist/outposts/replica-sync.test.d.ts.map +0 -1
  599. package/dist/outposts/replica-sync.test.js +0 -224
  600. package/dist/outposts/replica-sync.test.js.map +0 -1
  601. package/dist/outposts/self-deploy.test.d.ts +0 -2
  602. package/dist/outposts/self-deploy.test.d.ts.map +0 -1
  603. package/dist/outposts/self-deploy.test.js +0 -218
  604. package/dist/outposts/self-deploy.test.js.map +0 -1
  605. package/dist/outposts/session-heartbeat-bounds.test.d.ts +0 -25
  606. package/dist/outposts/session-heartbeat-bounds.test.d.ts.map +0 -1
  607. package/dist/outposts/session-heartbeat-bounds.test.js +0 -156
  608. package/dist/outposts/session-heartbeat-bounds.test.js.map +0 -1
  609. package/dist/outposts/session-heartbeat-guard.test.d.ts +0 -16
  610. package/dist/outposts/session-heartbeat-guard.test.d.ts.map +0 -1
  611. package/dist/outposts/session-heartbeat-guard.test.js +0 -88
  612. package/dist/outposts/session-heartbeat-guard.test.js.map +0 -1
  613. package/dist/outposts/session-heartbeat-publisher.test.d.ts +0 -10
  614. package/dist/outposts/session-heartbeat-publisher.test.d.ts.map +0 -1
  615. package/dist/outposts/session-heartbeat-publisher.test.js +0 -153
  616. package/dist/outposts/session-heartbeat-publisher.test.js.map +0 -1
  617. package/dist/outposts/session-heartbeat-retain-guard.test.d.ts +0 -18
  618. package/dist/outposts/session-heartbeat-retain-guard.test.d.ts.map +0 -1
  619. package/dist/outposts/session-heartbeat-retain-guard.test.js +0 -106
  620. package/dist/outposts/session-heartbeat-retain-guard.test.js.map +0 -1
  621. package/dist/outposts/session-heartbeat-scan.test.d.ts +0 -20
  622. package/dist/outposts/session-heartbeat-scan.test.d.ts.map +0 -1
  623. package/dist/outposts/session-heartbeat-scan.test.js +0 -241
  624. package/dist/outposts/session-heartbeat-scan.test.js.map +0 -1
  625. package/dist/outposts/session-heartbeat.test.d.ts +0 -11
  626. package/dist/outposts/session-heartbeat.test.d.ts.map +0 -1
  627. package/dist/outposts/session-heartbeat.test.js +0 -370
  628. package/dist/outposts/session-heartbeat.test.js.map +0 -1
  629. package/dist/outposts/session-host-auth.test.d.ts +0 -16
  630. package/dist/outposts/session-host-auth.test.d.ts.map +0 -1
  631. package/dist/outposts/session-host-auth.test.js +0 -284
  632. package/dist/outposts/session-host-auth.test.js.map +0 -1
  633. package/dist/outposts/session-host-command.test.d.ts +0 -10
  634. package/dist/outposts/session-host-command.test.d.ts.map +0 -1
  635. package/dist/outposts/session-host-command.test.js +0 -180
  636. package/dist/outposts/session-host-command.test.js.map +0 -1
  637. package/dist/outposts/session-host-connection.test.d.ts +0 -18
  638. package/dist/outposts/session-host-connection.test.d.ts.map +0 -1
  639. package/dist/outposts/session-host-connection.test.js +0 -392
  640. package/dist/outposts/session-host-connection.test.js.map +0 -1
  641. package/dist/outposts/session-host-fakes.d.ts +0 -61
  642. package/dist/outposts/session-host-fakes.d.ts.map +0 -1
  643. package/dist/outposts/session-host-fakes.js +0 -115
  644. package/dist/outposts/session-host-fakes.js.map +0 -1
  645. package/dist/outposts/session-host-ndjson.test.d.ts +0 -11
  646. package/dist/outposts/session-host-ndjson.test.d.ts.map +0 -1
  647. package/dist/outposts/session-host-ndjson.test.js +0 -73
  648. package/dist/outposts/session-host-ndjson.test.js.map +0 -1
  649. package/dist/outposts/session-host-protocol.test.d.ts +0 -15
  650. package/dist/outposts/session-host-protocol.test.d.ts.map +0 -1
  651. package/dist/outposts/session-host-protocol.test.js +0 -0
  652. package/dist/outposts/session-host-protocol.test.js.map +0 -1
  653. package/dist/outposts/session-host-server.test.d.ts +0 -10
  654. package/dist/outposts/session-host-server.test.d.ts.map +0 -1
  655. package/dist/outposts/session-host-server.test.js +0 -118
  656. package/dist/outposts/session-host-server.test.js.map +0 -1
  657. package/dist/outposts/session-host-sessions.test.d.ts +0 -18
  658. package/dist/outposts/session-host-sessions.test.d.ts.map +0 -1
  659. package/dist/outposts/session-host-sessions.test.js +0 -439
  660. package/dist/outposts/session-host-sessions.test.js.map +0 -1
  661. package/dist/outposts/terminal.test.d.ts +0 -2
  662. package/dist/outposts/terminal.test.d.ts.map +0 -1
  663. package/dist/outposts/terminal.test.js +0 -146
  664. package/dist/outposts/terminal.test.js.map +0 -1
  665. package/dist/outposts/transport.test.d.ts +0 -10
  666. package/dist/outposts/transport.test.d.ts.map +0 -1
  667. package/dist/outposts/transport.test.js +0 -205
  668. package/dist/outposts/transport.test.js.map +0 -1
  669. package/dist/packed-journal-phase2.test.d.ts +0 -2
  670. package/dist/packed-journal-phase2.test.d.ts.map +0 -1
  671. package/dist/packed-journal-phase2.test.js +0 -273
  672. package/dist/packed-journal-phase2.test.js.map +0 -1
  673. package/dist/path-ancestors.test.d.ts +0 -2
  674. package/dist/path-ancestors.test.d.ts.map +0 -1
  675. package/dist/path-ancestors.test.js +0 -21
  676. package/dist/path-ancestors.test.js.map +0 -1
  677. package/dist/personal-vault-exclusions.test.d.ts +0 -22
  678. package/dist/personal-vault-exclusions.test.d.ts.map +0 -1
  679. package/dist/personal-vault-exclusions.test.js +0 -294
  680. package/dist/personal-vault-exclusions.test.js.map +0 -1
  681. package/dist/personal-vault.test.d.ts +0 -18
  682. package/dist/personal-vault.test.d.ts.map +0 -1
  683. package/dist/personal-vault.test.js +0 -1099
  684. package/dist/personal-vault.test.js.map +0 -1
  685. package/dist/plan-limit-pause.test.d.ts +0 -2
  686. package/dist/plan-limit-pause.test.d.ts.map +0 -1
  687. package/dist/plan-limit-pause.test.js +0 -150
  688. package/dist/plan-limit-pause.test.js.map +0 -1
  689. package/dist/plan-limit.fixtures.d.ts +0 -34
  690. package/dist/plan-limit.fixtures.d.ts.map +0 -1
  691. package/dist/plan-limit.fixtures.js +0 -96
  692. package/dist/plan-limit.fixtures.js.map +0 -1
  693. package/dist/plan-limit.test.d.ts +0 -2
  694. package/dist/plan-limit.test.d.ts.map +0 -1
  695. package/dist/plan-limit.test.js +0 -132
  696. package/dist/plan-limit.test.js.map +0 -1
  697. package/dist/prefix-coalesce.test.d.ts +0 -2
  698. package/dist/prefix-coalesce.test.d.ts.map +0 -1
  699. package/dist/prefix-coalesce.test.js +0 -260
  700. package/dist/prefix-coalesce.test.js.map +0 -1
  701. package/dist/private-folder-transport.test.d.ts +0 -2
  702. package/dist/private-folder-transport.test.d.ts.map +0 -1
  703. package/dist/private-folder-transport.test.js +0 -33
  704. package/dist/private-folder-transport.test.js.map +0 -1
  705. package/dist/public-surface.test.d.ts +0 -15
  706. package/dist/public-surface.test.d.ts.map +0 -1
  707. package/dist/public-surface.test.js +0 -110
  708. package/dist/public-surface.test.js.map +0 -1
  709. package/dist/qmd-reindex.test.d.ts +0 -14
  710. package/dist/qmd-reindex.test.d.ts.map +0 -1
  711. package/dist/qmd-reindex.test.js +0 -899
  712. package/dist/qmd-reindex.test.js.map +0 -1
  713. package/dist/read-only-state-dir.test.d.ts +0 -27
  714. package/dist/read-only-state-dir.test.d.ts.map +0 -1
  715. package/dist/read-only-state-dir.test.js +0 -167
  716. package/dist/read-only-state-dir.test.js.map +0 -1
  717. package/dist/remote-pull.test.d.ts +0 -2
  718. package/dist/remote-pull.test.d.ts.map +0 -1
  719. package/dist/remote-pull.test.js +0 -1147
  720. package/dist/remote-pull.test.js.map +0 -1
  721. package/dist/s3-download-stream-hash.test.d.ts +0 -2
  722. package/dist/s3-download-stream-hash.test.d.ts.map +0 -1
  723. package/dist/s3-download-stream-hash.test.js +0 -70
  724. package/dist/s3-download-stream-hash.test.js.map +0 -1
  725. package/dist/s3.list-cost.test.d.ts +0 -2
  726. package/dist/s3.list-cost.test.d.ts.map +0 -1
  727. package/dist/s3.list-cost.test.js +0 -51
  728. package/dist/s3.list-cost.test.js.map +0 -1
  729. package/dist/s3.rename-retry.test.d.ts +0 -2
  730. package/dist/s3.rename-retry.test.d.ts.map +0 -1
  731. package/dist/s3.rename-retry.test.js +0 -217
  732. package/dist/s3.rename-retry.test.js.map +0 -1
  733. package/dist/s3.symlink-materialize.test.d.ts +0 -18
  734. package/dist/s3.symlink-materialize.test.d.ts.map +0 -1
  735. package/dist/s3.symlink-materialize.test.js +0 -579
  736. package/dist/s3.symlink-materialize.test.js.map +0 -1
  737. package/dist/s3.test.d.ts +0 -9
  738. package/dist/s3.test.d.ts.map +0 -1
  739. package/dist/s3.test.js +0 -2047
  740. package/dist/s3.test.js.map +0 -1
  741. package/dist/s3.windows-portability.test.d.ts +0 -12
  742. package/dist/s3.windows-portability.test.d.ts.map +0 -1
  743. package/dist/s3.windows-portability.test.js +0 -223
  744. package/dist/s3.windows-portability.test.js.map +0 -1
  745. package/dist/schemas/signal-types.test.d.ts +0 -2
  746. package/dist/schemas/signal-types.test.d.ts.map +0 -1
  747. package/dist/schemas/signal-types.test.js +0 -65
  748. package/dist/schemas/signal-types.test.js.map +0 -1
  749. package/dist/schemas/source-channels.test.d.ts +0 -2
  750. package/dist/schemas/source-channels.test.d.ts.map +0 -1
  751. package/dist/schemas/source-channels.test.js +0 -65
  752. package/dist/schemas/source-channels.test.js.map +0 -1
  753. package/dist/scope-shrink.test.d.ts +0 -13
  754. package/dist/scope-shrink.test.d.ts.map +0 -1
  755. package/dist/scope-shrink.test.js +0 -558
  756. package/dist/scope-shrink.test.js.map +0 -1
  757. package/dist/session-log-capture.test.d.ts +0 -2
  758. package/dist/session-log-capture.test.d.ts.map +0 -1
  759. package/dist/session-log-capture.test.js +0 -533
  760. package/dist/session-log-capture.test.js.map +0 -1
  761. package/dist/session-log-retention.test.d.ts +0 -2
  762. package/dist/session-log-retention.test.d.ts.map +0 -1
  763. package/dist/session-log-retention.test.js +0 -383
  764. package/dist/session-log-retention.test.js.map +0 -1
  765. package/dist/signals/get.test.d.ts +0 -5
  766. package/dist/signals/get.test.d.ts.map +0 -1
  767. package/dist/signals/get.test.js +0 -254
  768. package/dist/signals/get.test.js.map +0 -1
  769. package/dist/signals/list.test.d.ts +0 -9
  770. package/dist/signals/list.test.d.ts.map +0 -1
  771. package/dist/signals/list.test.js +0 -330
  772. package/dist/signals/list.test.js.map +0 -1
  773. package/dist/skill-telemetry.test.d.ts +0 -2
  774. package/dist/skill-telemetry.test.d.ts.map +0 -1
  775. package/dist/skill-telemetry.test.js +0 -1484
  776. package/dist/skill-telemetry.test.js.map +0 -1
  777. package/dist/sources/get.test.d.ts +0 -5
  778. package/dist/sources/get.test.d.ts.map +0 -1
  779. package/dist/sources/get.test.js +0 -236
  780. package/dist/sources/get.test.js.map +0 -1
  781. package/dist/sources/list.test.d.ts +0 -8
  782. package/dist/sources/list.test.d.ts.map +0 -1
  783. package/dist/sources/list.test.js +0 -318
  784. package/dist/sources/list.test.js.map +0 -1
  785. package/dist/sts-credential-refresh.test.d.ts +0 -2
  786. package/dist/sts-credential-refresh.test.d.ts.map +0 -1
  787. package/dist/sts-credential-refresh.test.js +0 -181
  788. package/dist/sts-credential-refresh.test.js.map +0 -1
  789. package/dist/swallowed-error-sites.test.d.ts +0 -2
  790. package/dist/swallowed-error-sites.test.d.ts.map +0 -1
  791. package/dist/swallowed-error-sites.test.js +0 -199
  792. package/dist/swallowed-error-sites.test.js.map +0 -1
  793. package/dist/swallowed-error-w32.test.d.ts +0 -2
  794. package/dist/swallowed-error-w32.test.d.ts.map +0 -1
  795. package/dist/swallowed-error-w32.test.js +0 -171
  796. package/dist/swallowed-error-w32.test.js.map +0 -1
  797. package/dist/swallowed-error-w33.test.d.ts +0 -2
  798. package/dist/swallowed-error-w33.test.d.ts.map +0 -1
  799. package/dist/swallowed-error-w33.test.js +0 -125
  800. package/dist/swallowed-error-w33.test.js.map +0 -1
  801. package/dist/swallowed-error-w34.test.d.ts +0 -2
  802. package/dist/swallowed-error-w34.test.d.ts.map +0 -1
  803. package/dist/swallowed-error-w34.test.js +0 -110
  804. package/dist/swallowed-error-w34.test.js.map +0 -1
  805. package/dist/swallowed-error-w35.test.d.ts +0 -2
  806. package/dist/swallowed-error-w35.test.d.ts.map +0 -1
  807. package/dist/swallowed-error-w35.test.js +0 -223
  808. package/dist/swallowed-error-w35.test.js.map +0 -1
  809. package/dist/sync/area-ledger-auto-migration.test.d.ts +0 -2
  810. package/dist/sync/area-ledger-auto-migration.test.d.ts.map +0 -1
  811. package/dist/sync/area-ledger-auto-migration.test.js +0 -291
  812. package/dist/sync/area-ledger-auto-migration.test.js.map +0 -1
  813. package/dist/sync/area-ledger-migration.test.d.ts +0 -2
  814. package/dist/sync/area-ledger-migration.test.d.ts.map +0 -1
  815. package/dist/sync/area-ledger-migration.test.js +0 -554
  816. package/dist/sync/area-ledger-migration.test.js.map +0 -1
  817. package/dist/sync/area-ledger-recovery.bench.test.d.ts +0 -2
  818. package/dist/sync/area-ledger-recovery.bench.test.d.ts.map +0 -1
  819. package/dist/sync/area-ledger-recovery.bench.test.js +0 -60
  820. package/dist/sync/area-ledger-recovery.bench.test.js.map +0 -1
  821. package/dist/sync/area-ledger-writer-lock.bench.test.d.ts +0 -2
  822. package/dist/sync/area-ledger-writer-lock.bench.test.d.ts.map +0 -1
  823. package/dist/sync/area-ledger-writer-lock.bench.test.js +0 -57
  824. package/dist/sync/area-ledger-writer-lock.bench.test.js.map +0 -1
  825. package/dist/sync/area-ledger.test.d.ts +0 -2
  826. package/dist/sync/area-ledger.test.d.ts.map +0 -1
  827. package/dist/sync/area-ledger.test.js +0 -1401
  828. package/dist/sync/area-ledger.test.js.map +0 -1
  829. package/dist/sync/area-resolver.test.d.ts +0 -2
  830. package/dist/sync/area-resolver.test.d.ts.map +0 -1
  831. package/dist/sync/area-resolver.test.js +0 -234
  832. package/dist/sync/area-resolver.test.js.map +0 -1
  833. package/dist/sync/base-version-resolver.test.d.ts +0 -2
  834. package/dist/sync/base-version-resolver.test.d.ts.map +0 -1
  835. package/dist/sync/base-version-resolver.test.js +0 -24
  836. package/dist/sync/base-version-resolver.test.js.map +0 -1
  837. package/dist/sync/candidate-uploader.test.d.ts +0 -2
  838. package/dist/sync/candidate-uploader.test.d.ts.map +0 -1
  839. package/dist/sync/candidate-uploader.test.js +0 -132
  840. package/dist/sync/candidate-uploader.test.js.map +0 -1
  841. package/dist/sync/child-process-sync-worker-env.test.d.ts +0 -2
  842. package/dist/sync/child-process-sync-worker-env.test.d.ts.map +0 -1
  843. package/dist/sync/child-process-sync-worker-env.test.js +0 -38
  844. package/dist/sync/child-process-sync-worker-env.test.js.map +0 -1
  845. package/dist/sync/child-process-sync-worker-errors.test.d.ts +0 -2
  846. package/dist/sync/child-process-sync-worker-errors.test.d.ts.map +0 -1
  847. package/dist/sync/child-process-sync-worker-errors.test.js +0 -121
  848. package/dist/sync/child-process-sync-worker-errors.test.js.map +0 -1
  849. package/dist/sync/child-process-sync-worker.test.d.ts +0 -2
  850. package/dist/sync/child-process-sync-worker.test.d.ts.map +0 -1
  851. package/dist/sync/child-process-sync-worker.test.js +0 -262
  852. package/dist/sync/child-process-sync-worker.test.js.map +0 -1
  853. package/dist/sync/content-hash.test.d.ts +0 -2
  854. package/dist/sync/content-hash.test.d.ts.map +0 -1
  855. package/dist/sync/content-hash.test.js +0 -16
  856. package/dist/sync/content-hash.test.js.map +0 -1
  857. package/dist/sync/delta-client.test.d.ts +0 -2
  858. package/dist/sync/delta-client.test.d.ts.map +0 -1
  859. package/dist/sync/delta-client.test.js +0 -97
  860. package/dist/sync/delta-client.test.js.map +0 -1
  861. package/dist/sync/durable-apply.test.d.ts +0 -2
  862. package/dist/sync/durable-apply.test.d.ts.map +0 -1
  863. package/dist/sync/durable-apply.test.js +0 -180
  864. package/dist/sync/durable-apply.test.js.map +0 -1
  865. package/dist/sync/event-sync.test.d.ts +0 -14
  866. package/dist/sync/event-sync.test.d.ts.map +0 -1
  867. package/dist/sync/event-sync.test.js +0 -1714
  868. package/dist/sync/event-sync.test.js.map +0 -1
  869. package/dist/sync/feature-flags.test.d.ts +0 -24
  870. package/dist/sync/feature-flags.test.d.ts.map +0 -1
  871. package/dist/sync/feature-flags.test.js +0 -594
  872. package/dist/sync/feature-flags.test.js.map +0 -1
  873. package/dist/sync/full-pass-cap-governor.bench.test.d.ts +0 -2
  874. package/dist/sync/full-pass-cap-governor.bench.test.d.ts.map +0 -1
  875. package/dist/sync/full-pass-cap-governor.bench.test.js +0 -179
  876. package/dist/sync/full-pass-cap-governor.bench.test.js.map +0 -1
  877. package/dist/sync/full-pass-caps.test.d.ts +0 -2
  878. package/dist/sync/full-pass-caps.test.d.ts.map +0 -1
  879. package/dist/sync/full-pass-caps.test.js +0 -550
  880. package/dist/sync/full-pass-caps.test.js.map +0 -1
  881. package/dist/sync/idle-full-reconcile.test.d.ts +0 -2
  882. package/dist/sync/idle-full-reconcile.test.d.ts.map +0 -1
  883. package/dist/sync/idle-full-reconcile.test.js +0 -62
  884. package/dist/sync/idle-full-reconcile.test.js.map +0 -1
  885. package/dist/sync/inbound-event-admission.test.d.ts +0 -2
  886. package/dist/sync/inbound-event-admission.test.d.ts.map +0 -1
  887. package/dist/sync/inbound-event-admission.test.js +0 -125
  888. package/dist/sync/inbound-event-admission.test.js.map +0 -1
  889. package/dist/sync/journal-ledger-stream.test.d.ts +0 -12
  890. package/dist/sync/journal-ledger-stream.test.d.ts.map +0 -1
  891. package/dist/sync/journal-ledger-stream.test.js +0 -134
  892. package/dist/sync/journal-ledger-stream.test.js.map +0 -1
  893. package/dist/sync/lease-client.test.d.ts +0 -2
  894. package/dist/sync/lease-client.test.d.ts.map +0 -1
  895. package/dist/sync/lease-client.test.js +0 -119
  896. package/dist/sync/lease-client.test.js.map +0 -1
  897. package/dist/sync/logger.test.d.ts +0 -19
  898. package/dist/sync/logger.test.d.ts.map +0 -1
  899. package/dist/sync/logger.test.js +0 -204
  900. package/dist/sync/logger.test.js.map +0 -1
  901. package/dist/sync/metrics.test.d.ts +0 -19
  902. package/dist/sync/metrics.test.d.ts.map +0 -1
  903. package/dist/sync/metrics.test.js +0 -357
  904. package/dist/sync/metrics.test.js.map +0 -1
  905. package/dist/sync/multipart-uploader.test.d.ts +0 -2
  906. package/dist/sync/multipart-uploader.test.d.ts.map +0 -1
  907. package/dist/sync/multipart-uploader.test.js +0 -135
  908. package/dist/sync/multipart-uploader.test.js.map +0 -1
  909. package/dist/sync/mutation-client.test.d.ts +0 -2
  910. package/dist/sync/mutation-client.test.d.ts.map +0 -1
  911. package/dist/sync/mutation-client.test.js +0 -100
  912. package/dist/sync/mutation-client.test.js.map +0 -1
  913. package/dist/sync/mutation-session.test.d.ts +0 -2
  914. package/dist/sync/mutation-session.test.d.ts.map +0 -1
  915. package/dist/sync/mutation-session.test.js +0 -190
  916. package/dist/sync/mutation-session.test.js.map +0 -1
  917. package/dist/sync/parallel-sync-coordinator.test.d.ts +0 -2
  918. package/dist/sync/parallel-sync-coordinator.test.d.ts.map +0 -1
  919. package/dist/sync/parallel-sync-coordinator.test.js +0 -564
  920. package/dist/sync/parallel-sync-coordinator.test.js.map +0 -1
  921. package/dist/sync/path-leases.test.d.ts +0 -2
  922. package/dist/sync/path-leases.test.d.ts.map +0 -1
  923. package/dist/sync/path-leases.test.js +0 -51
  924. package/dist/sync/path-leases.test.js.map +0 -1
  925. package/dist/sync/per-area-maintenance.test.d.ts +0 -2
  926. package/dist/sync/per-area-maintenance.test.d.ts.map +0 -1
  927. package/dist/sync/per-area-maintenance.test.js +0 -100
  928. package/dist/sync/per-area-maintenance.test.js.map +0 -1
  929. package/dist/sync/push-event.test.d.ts +0 -15
  930. package/dist/sync/push-event.test.d.ts.map +0 -1
  931. package/dist/sync/push-event.test.js +0 -282
  932. package/dist/sync/push-event.test.js.map +0 -1
  933. package/dist/sync/push-receiver.test.d.ts +0 -25
  934. package/dist/sync/push-receiver.test.d.ts.map +0 -1
  935. package/dist/sync/push-receiver.test.js +0 -2851
  936. package/dist/sync/push-receiver.test.js.map +0 -1
  937. package/dist/sync/push-transport.test.d.ts +0 -2
  938. package/dist/sync/push-transport.test.d.ts.map +0 -1
  939. package/dist/sync/push-transport.test.js +0 -70
  940. package/dist/sync/push-transport.test.js.map +0 -1
  941. package/dist/sync/push-walk-matchers.bench.test.d.ts +0 -2
  942. package/dist/sync/push-walk-matchers.bench.test.d.ts.map +0 -1
  943. package/dist/sync/push-walk-matchers.bench.test.js +0 -230
  944. package/dist/sync/push-walk-matchers.bench.test.js.map +0 -1
  945. package/dist/sync/realtime-network-integration.test.d.ts +0 -2
  946. package/dist/sync/realtime-network-integration.test.d.ts.map +0 -1
  947. package/dist/sync/realtime-network-integration.test.js +0 -83
  948. package/dist/sync/realtime-network-integration.test.js.map +0 -1
  949. package/dist/sync/realtime-rollout.test.d.ts +0 -2
  950. package/dist/sync/realtime-rollout.test.d.ts.map +0 -1
  951. package/dist/sync/realtime-rollout.test.js +0 -94
  952. package/dist/sync/realtime-rollout.test.js.map +0 -1
  953. package/dist/sync/realtime-telemetry.test.d.ts +0 -2
  954. package/dist/sync/realtime-telemetry.test.d.ts.map +0 -1
  955. package/dist/sync/realtime-telemetry.test.js +0 -300
  956. package/dist/sync/realtime-telemetry.test.js.map +0 -1
  957. package/dist/sync/receiver-origin-config.test.d.ts +0 -2
  958. package/dist/sync/receiver-origin-config.test.d.ts.map +0 -1
  959. package/dist/sync/receiver-origin-config.test.js +0 -39
  960. package/dist/sync/receiver-origin-config.test.js.map +0 -1
  961. package/dist/sync/reconcile-cursor.test.d.ts +0 -2
  962. package/dist/sync/reconcile-cursor.test.d.ts.map +0 -1
  963. package/dist/sync/reconcile-cursor.test.js +0 -139
  964. package/dist/sync/reconcile-cursor.test.js.map +0 -1
  965. package/dist/sync/remote-file-spool.test.d.ts +0 -2
  966. package/dist/sync/remote-file-spool.test.d.ts.map +0 -1
  967. package/dist/sync/remote-file-spool.test.js +0 -77
  968. package/dist/sync/remote-file-spool.test.js.map +0 -1
  969. package/dist/sync/scope-inventory-client.test.d.ts +0 -2
  970. package/dist/sync/scope-inventory-client.test.d.ts.map +0 -1
  971. package/dist/sync/scope-inventory-client.test.js +0 -103
  972. package/dist/sync/scope-inventory-client.test.js.map +0 -1
  973. package/dist/sync/secret-path-policy.test.d.ts +0 -2
  974. package/dist/sync/secret-path-policy.test.d.ts.map +0 -1
  975. package/dist/sync/secret-path-policy.test.js +0 -183
  976. package/dist/sync/secret-path-policy.test.js.map +0 -1
  977. package/dist/sync/snapshot-client.test.d.ts +0 -2
  978. package/dist/sync/snapshot-client.test.d.ts.map +0 -1
  979. package/dist/sync/snapshot-client.test.js +0 -169
  980. package/dist/sync/snapshot-client.test.js.map +0 -1
  981. package/dist/sync/state-store.test.d.ts +0 -2
  982. package/dist/sync/state-store.test.d.ts.map +0 -1
  983. package/dist/sync/state-store.test.js +0 -1556
  984. package/dist/sync/state-store.test.js.map +0 -1
  985. package/dist/sync/sync-contract.test.d.ts +0 -2
  986. package/dist/sync/sync-contract.test.d.ts.map +0 -1
  987. package/dist/sync/sync-contract.test.js +0 -141
  988. package/dist/sync/sync-contract.test.js.map +0 -1
  989. package/dist/sync/targeted-pull-prefixes.test.d.ts +0 -2
  990. package/dist/sync/targeted-pull-prefixes.test.d.ts.map +0 -1
  991. package/dist/sync/targeted-pull-prefixes.test.js +0 -33
  992. package/dist/sync/targeted-pull-prefixes.test.js.map +0 -1
  993. package/dist/sync/targeted-upsert-exact-list.test.d.ts +0 -2
  994. package/dist/sync/targeted-upsert-exact-list.test.d.ts.map +0 -1
  995. package/dist/sync/targeted-upsert-exact-list.test.js +0 -247
  996. package/dist/sync/targeted-upsert-exact-list.test.js.map +0 -1
  997. package/dist/sync/unchanged-push-events.test.d.ts +0 -2
  998. package/dist/sync/unchanged-push-events.test.d.ts.map +0 -1
  999. package/dist/sync/unchanged-push-events.test.js +0 -76
  1000. package/dist/sync/unchanged-push-events.test.js.map +0 -1
  1001. package/dist/sync/uploader-finalization.test.d.ts +0 -2
  1002. package/dist/sync/uploader-finalization.test.d.ts.map +0 -1
  1003. package/dist/sync/uploader-finalization.test.js +0 -107
  1004. package/dist/sync/uploader-finalization.test.js.map +0 -1
  1005. package/dist/sync-core.test.d.ts +0 -2
  1006. package/dist/sync-core.test.d.ts.map +0 -1
  1007. package/dist/sync-core.test.js +0 -189
  1008. package/dist/sync-core.test.js.map +0 -1
  1009. package/dist/sync-progress.test.d.ts +0 -2
  1010. package/dist/sync-progress.test.d.ts.map +0 -1
  1011. package/dist/sync-progress.test.js +0 -277
  1012. package/dist/sync-progress.test.js.map +0 -1
  1013. package/dist/telemetry-events.test.d.ts +0 -2
  1014. package/dist/telemetry-events.test.d.ts.map +0 -1
  1015. package/dist/telemetry-events.test.js +0 -113
  1016. package/dist/telemetry-events.test.js.map +0 -1
  1017. package/dist/telemetry.test.d.ts +0 -11
  1018. package/dist/telemetry.test.d.ts.map +0 -1
  1019. package/dist/telemetry.test.js +0 -1603
  1020. package/dist/telemetry.test.js.map +0 -1
  1021. package/dist/vault-client.test.d.ts +0 -7
  1022. package/dist/vault-client.test.d.ts.map +0 -1
  1023. package/dist/vault-client.test.js +0 -1334
  1024. package/dist/vault-client.test.js.map +0 -1
  1025. package/dist/watch-coverage.test.d.ts +0 -2
  1026. package/dist/watch-coverage.test.d.ts.map +0 -1
  1027. package/dist/watch-coverage.test.js +0 -56
  1028. package/dist/watch-coverage.test.js.map +0 -1
  1029. package/dist/watch-owner-lease.test.d.ts +0 -2
  1030. package/dist/watch-owner-lease.test.d.ts.map +0 -1
  1031. package/dist/watch-owner-lease.test.js +0 -353
  1032. package/dist/watch-owner-lease.test.js.map +0 -1
  1033. package/dist/watch-parent.test.d.ts +0 -2
  1034. package/dist/watch-parent.test.d.ts.map +0 -1
  1035. package/dist/watch-parent.test.js +0 -131
  1036. package/dist/watch-parent.test.js.map +0 -1
  1037. package/dist/watch-roots.test.d.ts +0 -18
  1038. package/dist/watch-roots.test.d.ts.map +0 -1
  1039. package/dist/watch-roots.test.js +0 -395
  1040. package/dist/watch-roots.test.js.map +0 -1
  1041. package/dist/watcher-continuity-hot-path.test.d.ts +0 -2
  1042. package/dist/watcher-continuity-hot-path.test.d.ts.map +0 -1
  1043. package/dist/watcher-continuity-hot-path.test.js +0 -40
  1044. package/dist/watcher-continuity-hot-path.test.js.map +0 -1
  1045. package/dist/watcher-event-gate.test.d.ts +0 -16
  1046. package/dist/watcher-event-gate.test.d.ts.map +0 -1
  1047. package/dist/watcher-event-gate.test.js +0 -191
  1048. package/dist/watcher-event-gate.test.js.map +0 -1
  1049. package/dist/watcher-replan-sweep.test.d.ts +0 -2
  1050. package/dist/watcher-replan-sweep.test.d.ts.map +0 -1
  1051. package/dist/watcher-replan-sweep.test.js +0 -245
  1052. package/dist/watcher-replan-sweep.test.js.map +0 -1
  1053. package/dist/watcher-stdout.test.d.ts +0 -2
  1054. package/dist/watcher-stdout.test.d.ts.map +0 -1
  1055. package/dist/watcher-stdout.test.js +0 -86
  1056. package/dist/watcher-stdout.test.js.map +0 -1
  1057. package/dist/watcher.test.d.ts +0 -2
  1058. package/dist/watcher.test.d.ts.map +0 -1
  1059. package/dist/watcher.test.js +0 -4301
  1060. package/dist/watcher.test.js.map +0 -1
  1061. package/dist/watcher.warmup-cancel.test.d.ts +0 -2
  1062. package/dist/watcher.warmup-cancel.test.d.ts.map +0 -1
  1063. package/dist/watcher.warmup-cancel.test.js +0 -59
  1064. package/dist/watcher.warmup-cancel.test.js.map +0 -1
  1065. package/dist/watcher.warmup-responsive.test.d.ts +0 -2
  1066. package/dist/watcher.warmup-responsive.test.d.ts.map +0 -1
  1067. package/dist/watcher.warmup-responsive.test.js +0 -62
  1068. package/dist/watcher.warmup-responsive.test.js.map +0 -1
@@ -1,1492 +0,0 @@
1
- /**
2
- * Unit tests for the machine-identity auth mode in cognito-auth.ts.
3
- *
4
- * Machine identities (company agents) carry long-lived Cognito creds at
5
- * ~/.hq-agent/machine-creds.json (HQ_MACHINE_CREDS_FILE override) and mint
6
- * sessions via USER_PASSWORD_AUTH on demand — no browser, no refresh token.
7
- * The contract under test:
8
- * - detection: creds file present + well-formed → machine mode
9
- * - minting: BOTH tokens cached with correct field semantics
10
- * - re-mint on expiry; cache hit when valid
11
- * - getValidAccessToken short-circuits into machine mode (never browser)
12
- */
13
- import * as fs from "fs";
14
- import * as os from "os";
15
- import * as path from "path";
16
- import { spawn } from "child_process";
17
- import { pathToFileURL } from "url";
18
- import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
19
- let originalHome;
20
- let originalUserProfile;
21
- let originalCredsEnv;
22
- let tmpHome;
23
- beforeEach(() => {
24
- originalHome = process.env.HOME;
25
- originalUserProfile = process.env.USERPROFILE;
26
- originalCredsEnv = process.env.HQ_MACHINE_CREDS_FILE;
27
- tmpHome = fs.mkdtempSync(path.join(os.tmpdir(), "hq-machine-auth-test-"));
28
- process.env.HOME = tmpHome;
29
- process.env.USERPROFILE = tmpHome;
30
- // Keep this suite's token-cache fixture coupled to its sandboxed HOME
31
- // instead of inheriting Vitest's suite-wide hermetic state directory.
32
- process.env.HQ_STATE_DIR = path.join(tmpHome, ".hq");
33
- delete process.env.HQ_MACHINE_CREDS_FILE;
34
- vi.resetModules();
35
- });
36
- afterEach(() => {
37
- vi.useRealTimers();
38
- if (originalHome === undefined)
39
- delete process.env.HOME;
40
- else
41
- process.env.HOME = originalHome;
42
- if (originalUserProfile === undefined)
43
- delete process.env.USERPROFILE;
44
- else
45
- process.env.USERPROFILE = originalUserProfile;
46
- if (originalCredsEnv === undefined)
47
- delete process.env.HQ_MACHINE_CREDS_FILE;
48
- else
49
- process.env.HQ_MACHINE_CREDS_FILE = originalCredsEnv;
50
- fs.rmSync(tmpHome, { recursive: true, force: true });
51
- vi.unstubAllGlobals();
52
- vi.restoreAllMocks();
53
- });
54
- async function importModule() {
55
- return await import("./cognito-auth.js");
56
- }
57
- const CONFIG = {
58
- region: "us-east-1",
59
- userPoolDomain: "vault-indigo-hq-prod",
60
- clientId: "test-client-id",
61
- };
62
- function writeCreds(creds = { username: "machine-agt_01TEST", secret: "s3cret" }) {
63
- const dir = path.join(tmpHome, ".hq-agent");
64
- fs.mkdirSync(dir, { recursive: true });
65
- const file = path.join(dir, "machine-creds.json");
66
- fs.writeFileSync(file, JSON.stringify(creds));
67
- return file;
68
- }
69
- /** Build a fake JWT whose payload decodes to the given claims. */
70
- function fakeJwt(claims) {
71
- const enc = (o) => Buffer.from(JSON.stringify(o)).toString("base64url");
72
- return `${enc({ alg: "RS256", kid: "k" })}.${enc(claims)}.sig`;
73
- }
74
- function stubMintFetch(overrides = {}) {
75
- const calls = [];
76
- const fetchMock = vi.fn(async (url, init) => {
77
- calls.push({ url: String(url), init: init ?? {} });
78
- const body = JSON.parse(String(init?.body));
79
- const credsFile = process.env.HQ_MACHINE_CREDS_FILE ??
80
- path.join(tmpHome, ".hq-agent", "machine-creds.json");
81
- const creds = JSON.parse(fs.readFileSync(credsFile, "utf-8"));
82
- const username = body.AuthParameters.USERNAME;
83
- const subject = `sub:${username}`;
84
- const entityType = creds.entityType ?? "agent";
85
- const entityUid = creds.entityUid ?? "agt_01TEST";
86
- return new Response(JSON.stringify({
87
- AuthenticationResult: {
88
- AccessToken: overrides.AccessToken ??
89
- fakeJwt({
90
- token_use: "access",
91
- client_id: body.ClientId,
92
- username,
93
- sub: subject,
94
- }),
95
- IdToken: overrides.IdToken ??
96
- fakeJwt({
97
- token_use: "id",
98
- aud: body.ClientId,
99
- "custom:entityType": entityType,
100
- "custom:entityUid": entityUid,
101
- ...(entityType === "outpost"
102
- ? {
103
- "custom:delegatedSub": "human-sub",
104
- "custom:delegatedEmail": "owner@example.com",
105
- }
106
- : {}),
107
- "cognito:username": username,
108
- sub: subject,
109
- }),
110
- RefreshToken: overrides.RefreshToken,
111
- ExpiresIn: overrides.ExpiresIn ?? 3600,
112
- },
113
- }), { status: 200 });
114
- });
115
- vi.stubGlobal("fetch", fetchMock);
116
- return { fetchMock, calls };
117
- }
118
- // ---------------------------------------------------------------------------
119
- // Detection
120
- // ---------------------------------------------------------------------------
121
- describe("machine identity detection", () => {
122
- it("is off when no creds file exists", async () => {
123
- const { isMachineIdentity, loadMachineCreds } = await importModule();
124
- expect(loadMachineCreds()).toBeNull();
125
- expect(isMachineIdentity()).toBe(false);
126
- });
127
- it("detects creds at the default ~/.hq-agent path", async () => {
128
- writeCreds();
129
- const { isMachineIdentity, loadMachineCreds } = await importModule();
130
- expect(loadMachineCreds()).toEqual({
131
- username: "machine-agt_01TEST",
132
- secret: "s3cret",
133
- clientId: undefined,
134
- region: undefined,
135
- });
136
- expect(isMachineIdentity()).toBe(true);
137
- });
138
- it("detects provisioned-shape creds (agt-<ulid>@agents domain + clientId/region)", async () => {
139
- writeCreds({
140
- username: "agt-01ktt1rjj6kqrhnhhst0k4vrgt@agents.getindigo.ai",
141
- secret: "s3cret",
142
- clientId: "agent-client-1",
143
- region: "us-east-1",
144
- userPoolId: "us-east-1_pool",
145
- });
146
- const { isMachineIdentity, loadMachineCreds } = await importModule();
147
- expect(loadMachineCreds()).toEqual({
148
- username: "agt-01ktt1rjj6kqrhnhhst0k4vrgt@agents.getindigo.ai",
149
- secret: "s3cret",
150
- clientId: "agent-client-1",
151
- region: "us-east-1",
152
- });
153
- expect(isMachineIdentity()).toBe(true);
154
- });
155
- it("parses the expected machine entity type and uid from provisioned creds", async () => {
156
- writeCreds({
157
- username: "out-01test@outposts.getindigo.ai",
158
- secret: "s3cret",
159
- clientId: "outpost-client-1",
160
- region: "us-east-1",
161
- entityType: "outpost",
162
- entityUid: "out_01TEST",
163
- });
164
- const { loadMachineCreds } = await importModule();
165
- expect(loadMachineCreds()).toEqual({
166
- username: "out-01test@outposts.getindigo.ai",
167
- secret: "s3cret",
168
- clientId: "outpost-client-1",
169
- region: "us-east-1",
170
- entityType: "outpost",
171
- entityUid: "out_01TEST",
172
- });
173
- });
174
- it("honors HQ_MACHINE_CREDS_FILE override", async () => {
175
- const custom = path.join(tmpHome, "elsewhere.json");
176
- fs.writeFileSync(custom, JSON.stringify({ username: "machine-agt_X", secret: "y" }));
177
- process.env.HQ_MACHINE_CREDS_FILE = custom;
178
- const { loadMachineCreds, machineCredsFilePath } = await importModule();
179
- expect(machineCredsFilePath()).toBe(custom);
180
- expect(loadMachineCreds()?.username).toBe("machine-agt_X");
181
- });
182
- it("rejects malformed creds (missing secret, empty username, bad JSON)", async () => {
183
- const { loadMachineCreds } = await importModule();
184
- writeCreds({ username: "", secret: "x" });
185
- expect(loadMachineCreds()).toBeNull();
186
- writeCreds({ username: "machine-agt_01TEST" });
187
- expect(loadMachineCreds()).toBeNull();
188
- fs.writeFileSync(path.join(tmpHome, ".hq-agent", "machine-creds.json"), "{nope");
189
- expect(loadMachineCreds()).toBeNull();
190
- });
191
- it.each([
192
- { entityType: "agent", entityUid: "out_WRONG" },
193
- { entityType: "outpost", entityUid: "agt_WRONG" },
194
- { entityType: "agent", entityUid: "garbage" },
195
- { entityType: "agent" },
196
- { entityType: "outpost" },
197
- { entityUid: "out_NO_TYPE" },
198
- { entityUid: "garbage" },
199
- { entityType: "agent", entityUid: "agt_" },
200
- { entityType: "outpost", entityUid: "out_" },
201
- ])("rejects malformed or cross-prefix entity metadata: %j", async (identity) => {
202
- writeCreds({ username: "machine", secret: "secret", ...identity });
203
- const { loadMachineCreds } = await importModule();
204
- expect(loadMachineCreds()).toBeNull();
205
- });
206
- it("accepts an agt_* uid without a type as the legacy agent inference", async () => {
207
- writeCreds({
208
- username: "machine-agt_01TEST",
209
- secret: "secret",
210
- entityUid: "agt_01TEST",
211
- });
212
- const { loadMachineCreds } = await importModule();
213
- expect(loadMachineCreds()).toMatchObject({ entityUid: "agt_01TEST" });
214
- expect(loadMachineCreds()?.entityType).toBeUndefined();
215
- });
216
- });
217
- // ---------------------------------------------------------------------------
218
- // Minting
219
- // ---------------------------------------------------------------------------
220
- describe("mintMachineTokens", () => {
221
- it("prefers the creds file's clientId/region over config (agent app client has USER_PASSWORD_AUTH)", async () => {
222
- writeCreds({
223
- username: "agt-01ktt1rjj6kqrhnhhst0k4vrgt@agents.getindigo.ai",
224
- secret: "s3cret",
225
- clientId: "agent-client-1",
226
- region: "eu-west-1",
227
- });
228
- const { calls } = stubMintFetch();
229
- const { mintMachineTokens } = await importModule();
230
- await mintMachineTokens(CONFIG);
231
- expect(calls[0].url).toBe("https://cognito-idp.eu-west-1.amazonaws.com/");
232
- const body = JSON.parse(String(calls[0].init.body));
233
- expect(body.ClientId).toBe("agent-client-1");
234
- });
235
- it("mints via USER_PASSWORD_AUTH and caches both tokens with correct fields", async () => {
236
- writeCreds();
237
- const { calls } = stubMintFetch({ RefreshToken: "rt" });
238
- const { mintMachineTokens, loadCachedMachineTokens } = await importModule();
239
- const tokens = await mintMachineTokens(CONFIG);
240
- // Request shape: Cognito IDP InitiateAuth with the machine creds.
241
- expect(calls).toHaveLength(1);
242
- expect(calls[0].url).toBe("https://cognito-idp.us-east-1.amazonaws.com/");
243
- const body = JSON.parse(String(calls[0].init.body));
244
- expect(body).toMatchObject({
245
- AuthFlow: "USER_PASSWORD_AUTH",
246
- ClientId: CONFIG.clientId,
247
- AuthParameters: { USERNAME: "machine-agt_01TEST", PASSWORD: "s3cret" },
248
- });
249
- // Field semantics: access token in accessToken, id token in idToken.
250
- const accessClaims = JSON.parse(Buffer.from(tokens.accessToken.split(".")[1], "base64url").toString());
251
- const idClaims = JSON.parse(Buffer.from(tokens.idToken.split(".")[1], "base64url").toString());
252
- expect(accessClaims.token_use).toBe("access");
253
- expect(idClaims.token_use).toBe("id");
254
- expect(tokens.refreshToken).toBe("");
255
- expect(typeof tokens.expiresAt).toBe("number");
256
- // Persisted to the shared cache file.
257
- expect(loadCachedMachineTokens()).toEqual(tokens);
258
- });
259
- it("throws CognitoAuthError on auth failure", async () => {
260
- writeCreds();
261
- vi.stubGlobal("fetch", vi.fn(async () => new Response(JSON.stringify({ __type: "NotAuthorizedException", message: "nope" }), { status: 400 })));
262
- const { mintMachineTokens, CognitoAuthError } = await importModule();
263
- await expect(mintMachineTokens(CONFIG)).rejects.toBeInstanceOf(CognitoAuthError);
264
- expect(fs.existsSync(path.join(tmpHome, ".hq", "cognito-tokens.json.lock"))).toBe(false);
265
- stubMintFetch();
266
- await expect(mintMachineTokens(CONFIG)).resolves.toBeDefined();
267
- });
268
- it("throws when no creds are present", async () => {
269
- const { mintMachineTokens, CognitoAuthError } = await importModule();
270
- await expect(mintMachineTokens(CONFIG)).rejects.toBeInstanceOf(CognitoAuthError);
271
- });
272
- it.each([
273
- ["wrong entity type", { "custom:entityType": "agent", "custom:entityUid": "agt_OTHER" }],
274
- ["wrong entity uid", { "custom:entityUid": "out_OTHER" }],
275
- ["absent delegatedSub", { "custom:delegatedSub": undefined }],
276
- ["empty delegatedSub", { "custom:delegatedSub": "" }],
277
- ["non-string delegatedSub", { "custom:delegatedSub": 42 }],
278
- ["absent delegatedEmail", { "custom:delegatedEmail": undefined }],
279
- ["empty delegatedEmail", { "custom:delegatedEmail": "" }],
280
- ["non-string delegatedEmail", { "custom:delegatedEmail": 42 }],
281
- ])("rejects and does not cache a first mint with %s", async (_label, claimOverride) => {
282
- const username = "out-01test@outposts.getindigo.ai";
283
- writeCreds({
284
- username,
285
- secret: "outpost-secret",
286
- entityType: "outpost",
287
- entityUid: "out_01TEST",
288
- });
289
- const claims = {
290
- token_use: "id",
291
- aud: CONFIG.clientId,
292
- "custom:entityType": "outpost",
293
- "custom:entityUid": "out_01TEST",
294
- "custom:delegatedSub": "human-sub",
295
- "custom:delegatedEmail": "owner@example.com",
296
- "cognito:username": username,
297
- sub: "machine-sub",
298
- ...claimOverride,
299
- };
300
- for (const [key, value] of Object.entries(claims)) {
301
- if (value === undefined)
302
- delete claims[key];
303
- }
304
- stubMintFetch({
305
- AccessToken: fakeJwt({
306
- token_use: "access",
307
- client_id: CONFIG.clientId,
308
- username,
309
- sub: "machine-sub",
310
- }),
311
- IdToken: fakeJwt(claims),
312
- });
313
- const { mintMachineTokens, loadCachedMachineTokens, CognitoAuthError } = await importModule();
314
- await expect(mintMachineTokens(CONFIG)).rejects.toBeInstanceOf(CognitoAuthError);
315
- expect(loadCachedMachineTokens()).toBeNull();
316
- });
317
- });
318
- // ---------------------------------------------------------------------------
319
- // getValidMachineTokens — cache vs re-mint
320
- // ---------------------------------------------------------------------------
321
- describe("getValidMachineTokens", () => {
322
- const cacheWithIdentity = (expiresAt) => ({
323
- accessToken: fakeJwt({
324
- token_use: "access",
325
- client_id: CONFIG.clientId,
326
- username: "machine-agt_01TEST",
327
- sub: "machine-sub",
328
- }),
329
- idToken: fakeJwt({
330
- token_use: "id",
331
- aud: CONFIG.clientId,
332
- "custom:entityType": "agent",
333
- "custom:entityUid": "agt_01TEST",
334
- "cognito:username": "machine-agt_01TEST",
335
- sub: "machine-sub",
336
- }),
337
- refreshToken: "",
338
- expiresAt,
339
- tokenType: "Bearer",
340
- });
341
- const getMachineTokensWithMinValidity = (get, minValiditySeconds) => get(CONFIG, { minValiditySeconds });
342
- it("re-mints a hot cached token with 200 seconds left when 360 are required", async () => {
343
- writeCreds();
344
- vi.useFakeTimers();
345
- vi.setSystemTime(new Date("2026-10-02T07:00:00.000Z"));
346
- const { fetchMock } = stubMintFetch();
347
- const { saveCachedTokens, getValidMachineTokens } = await importModule();
348
- saveCachedTokens(cacheWithIdentity(Date.now() + 400_000));
349
- await getMachineTokensWithMinValidity(getValidMachineTokens, 360);
350
- await vi.advanceTimersByTimeAsync(200_000);
351
- await getMachineTokensWithMinValidity(getValidMachineTokens, 360);
352
- expect(fetchMock).toHaveBeenCalledTimes(1);
353
- });
354
- it("re-mints a disk-cached token with 200 seconds left under the lock", async () => {
355
- writeCreds();
356
- vi.useFakeTimers();
357
- vi.setSystemTime(new Date("2026-10-02T07:00:00.000Z"));
358
- const { fetchMock } = stubMintFetch();
359
- const { saveCachedTokens, getValidMachineTokens } = await importModule();
360
- saveCachedTokens(cacheWithIdentity(Date.now() + 200_000));
361
- await getValidMachineTokens(CONFIG);
362
- expect(fetchMock).toHaveBeenCalledTimes(1);
363
- });
364
- it("does not reuse a 200-second cache after a machine lock timeout", async () => {
365
- writeCreds();
366
- vi.useFakeTimers();
367
- vi.setSystemTime(new Date("2026-10-02T07:00:00.000Z"));
368
- const { fetchMock } = stubMintFetch();
369
- const { saveCachedTokens, getValidMachineTokens, machineTokenCacheFile, CognitoRefreshError } = await importModule();
370
- saveCachedTokens(cacheWithIdentity(Date.now() + 200_000));
371
- fs.writeFileSync(`${machineTokenCacheFile()}.lock`, String(process.pid));
372
- const resolution = getMachineTokensWithMinValidity(getValidMachineTokens, 360);
373
- const rejected = resolution.then(() => false, (error) => error instanceof CognitoRefreshError);
374
- await vi.advanceTimersByTimeAsync(20_050);
375
- expect(await rejected).toBe(true);
376
- expect(fetchMock).not.toHaveBeenCalled();
377
- });
378
- it("reuses a machine token with 400 seconds left when 360 are required", async () => {
379
- writeCreds();
380
- vi.useFakeTimers();
381
- vi.setSystemTime(new Date("2026-10-02T07:00:00.000Z"));
382
- const { fetchMock } = stubMintFetch();
383
- const { saveCachedTokens, getValidMachineTokens } = await importModule();
384
- const cached = cacheWithIdentity(Date.now() + 400_000);
385
- saveCachedTokens(cached);
386
- const reused = await getValidMachineTokens(CONFIG);
387
- expect(reused.expiresAt).toBe(cached.expiresAt);
388
- expect(fetchMock).not.toHaveBeenCalled();
389
- });
390
- it("rejects a required validity above 1800 seconds before any network call", async () => {
391
- writeCreds();
392
- const { fetchMock } = stubMintFetch();
393
- const { getValidMachineTokens } = await importModule();
394
- await expect(getMachineTokensWithMinValidity(getValidMachineTokens, 1801)).rejects.toThrow(RangeError);
395
- expect(fetchMock).not.toHaveBeenCalled();
396
- });
397
- it("accepts a required validity of exactly 1800 seconds", async () => {
398
- writeCreds();
399
- vi.useFakeTimers();
400
- vi.setSystemTime(new Date("2026-10-02T07:00:00.000Z"));
401
- const { fetchMock } = stubMintFetch();
402
- const { saveCachedTokens, getValidMachineTokens } = await importModule();
403
- const cached = cacheWithIdentity(Date.now() + 1_900_000);
404
- saveCachedTokens(cached);
405
- const reused = await getMachineTokensWithMinValidity(getValidMachineTokens, 1800);
406
- expect(reused.expiresAt).toBe(cached.expiresAt);
407
- expect(fetchMock).not.toHaveBeenCalled();
408
- });
409
- it("returns the cache when valid without touching the network", async () => {
410
- writeCreds();
411
- const { fetchMock } = stubMintFetch();
412
- const { saveCachedTokens, getValidMachineTokens } = await importModule();
413
- // A valid machine cache must prove this exact agent identity (F06): the
414
- // cached tokens carry the agent claims that distinguish a machine token
415
- // from a same-client human token, so cache reuse is safe and skips the wire.
416
- const cached = {
417
- accessToken: fakeJwt({
418
- token_use: "access",
419
- client_id: CONFIG.clientId,
420
- username: "machine-agt_01TEST",
421
- }),
422
- idToken: fakeJwt({
423
- token_use: "id",
424
- aud: CONFIG.clientId,
425
- "custom:entityType": "agent",
426
- "custom:entityUid": "agt_01TEST",
427
- "cognito:username": "machine-agt_01TEST",
428
- }),
429
- refreshToken: "",
430
- expiresAt: Date.now() + 30 * 60 * 1000,
431
- tokenType: "Bearer",
432
- };
433
- saveCachedTokens(cached);
434
- const tokens = await getValidMachineTokens(CONFIG);
435
- expect(tokens).toEqual(cached);
436
- expect(fetchMock).not.toHaveBeenCalled();
437
- });
438
- it("strips and persists an empty refresh token when reusing a machine cache", async () => {
439
- writeCreds();
440
- const { fetchMock } = stubMintFetch();
441
- const { saveCachedTokens, loadCachedMachineTokens, getValidMachineTokens } = await importModule();
442
- saveCachedTokens({
443
- accessToken: fakeJwt({
444
- token_use: "access",
445
- client_id: CONFIG.clientId,
446
- username: "machine-agt_01TEST",
447
- sub: "machine-sub",
448
- }),
449
- idToken: fakeJwt({
450
- token_use: "id",
451
- aud: CONFIG.clientId,
452
- "custom:entityType": "agent",
453
- "custom:entityUid": "agt_01TEST",
454
- "cognito:username": "machine-agt_01TEST",
455
- sub: "machine-sub",
456
- }),
457
- refreshToken: "legacy-machine-refresh-token",
458
- expiresAt: Date.now() + 30 * 60 * 1000,
459
- tokenType: "Bearer",
460
- });
461
- const tokens = await getValidMachineTokens(CONFIG);
462
- expect(tokens.refreshToken).toBe("");
463
- expect(loadCachedMachineTokens()?.refreshToken).toBe("");
464
- expect(fetchMock).not.toHaveBeenCalled();
465
- });
466
- it("re-mints when the cache is expiring", async () => {
467
- writeCreds();
468
- const { fetchMock } = stubMintFetch();
469
- const { saveCachedTokens, getValidMachineTokens } = await importModule();
470
- saveCachedTokens({
471
- accessToken: fakeJwt({ token_use: "access", client_id: CONFIG.clientId }),
472
- idToken: fakeJwt({ token_use: "id" }),
473
- refreshToken: "",
474
- expiresAt: Date.now() + 10 * 1000,
475
- tokenType: "Bearer",
476
- });
477
- await getValidMachineTokens(CONFIG);
478
- expect(fetchMock).toHaveBeenCalledTimes(1);
479
- });
480
- it("re-mints when the cached token targets a different app client", async () => {
481
- writeCreds();
482
- const { fetchMock } = stubMintFetch();
483
- const { saveCachedTokens, getValidMachineTokens } = await importModule();
484
- saveCachedTokens({
485
- accessToken: fakeJwt({ token_use: "access", client_id: "other-client" }),
486
- idToken: fakeJwt({ token_use: "id" }),
487
- refreshToken: "",
488
- expiresAt: Date.now() + 30 * 60 * 1000,
489
- tokenType: "Bearer",
490
- });
491
- await getValidMachineTokens(CONFIG);
492
- expect(fetchMock).toHaveBeenCalledTimes(1);
493
- });
494
- it("R-F06: re-mints when cached access and ID tokens belong to different agents", async () => {
495
- writeCreds();
496
- const freshAccess = fakeJwt({
497
- token_use: "access",
498
- client_id: CONFIG.clientId,
499
- username: "machine-agt_01TEST",
500
- sub: "sub-agent-1",
501
- });
502
- const freshId = fakeJwt({
503
- token_use: "id",
504
- aud: CONFIG.clientId,
505
- "custom:entityType": "agent",
506
- "custom:entityUid": "agt_01TEST",
507
- "cognito:username": "machine-agt_01TEST",
508
- sub: "sub-agent-1",
509
- });
510
- const { fetchMock } = stubMintFetch({
511
- AccessToken: freshAccess,
512
- IdToken: freshId,
513
- });
514
- const { saveCachedTokens, getValidAccessToken, loadCachedMachineTokens } = await importModule();
515
- saveCachedTokens({
516
- accessToken: fakeJwt({
517
- token_use: "access",
518
- client_id: CONFIG.clientId,
519
- username: "machine-agt_01TEST",
520
- sub: "sub-agent-1",
521
- }),
522
- idToken: fakeJwt({
523
- token_use: "id",
524
- aud: CONFIG.clientId,
525
- "custom:entityType": "agent",
526
- "custom:entityUid": "agt_OTHER",
527
- "cognito:username": "machine-agt_OTHER",
528
- sub: "sub-agent-2",
529
- }),
530
- refreshToken: "",
531
- expiresAt: Date.now() + 30 * 60 * 1000,
532
- tokenType: "Bearer",
533
- });
534
- const token = await getValidAccessToken(CONFIG, { interactive: false });
535
- expect(fetchMock).toHaveBeenCalledTimes(1);
536
- expect(token).toBe(freshId);
537
- expect(loadCachedMachineTokens()?.idToken).toBe(freshId);
538
- });
539
- it("accepts an Outpost machine cache with delegated claims, then re-mints after expiry without OAuth refresh", async () => {
540
- const username = "out-01test@outposts.getindigo.ai";
541
- const entityUid = "out_01TEST";
542
- writeCreds({
543
- username,
544
- secret: "outpost-secret",
545
- clientId: CONFIG.clientId,
546
- region: CONFIG.region,
547
- entityType: "outpost",
548
- entityUid,
549
- });
550
- const accessToken = fakeJwt({
551
- token_use: "access",
552
- client_id: CONFIG.clientId,
553
- username,
554
- sub: "machine-sub",
555
- });
556
- const idToken = fakeJwt({
557
- token_use: "id",
558
- aud: CONFIG.clientId,
559
- "custom:entityType": "outpost",
560
- "custom:entityUid": entityUid,
561
- "custom:delegatedSub": "human-sub",
562
- "custom:delegatedEmail": "owner@example.com",
563
- "cognito:username": username,
564
- sub: "machine-sub",
565
- });
566
- const { fetchMock, calls } = stubMintFetch({
567
- AccessToken: accessToken,
568
- IdToken: idToken,
569
- RefreshToken: "must-not-be-stored",
570
- });
571
- const firstModule = await importModule();
572
- const first = await firstModule.getValidMachineTokens(CONFIG);
573
- expect(first.idToken).toBe(idToken);
574
- expect(firstModule.loadCachedMachineTokens()?.refreshToken).toBe("");
575
- // A new process accepts the shared Outpost cache without another mint.
576
- vi.resetModules();
577
- const cacheHitModule = await importModule();
578
- await expect(cacheHitModule.getValidMachineTokens(CONFIG)).resolves.toEqual(first);
579
- expect(fetchMock).toHaveBeenCalledTimes(1);
580
- // Once expired, a new process re-mints with the permanent secret. It never
581
- // attempts the browser client's /oauth2/token refresh-token flow.
582
- cacheHitModule.saveCachedTokens({
583
- ...first,
584
- expiresAt: Date.now() - 1,
585
- });
586
- vi.resetModules();
587
- const expiredModule = await importModule();
588
- await expiredModule.getValidMachineTokens(CONFIG);
589
- expect(fetchMock).toHaveBeenCalledTimes(2);
590
- expect(calls.every(({ url }) => !url.includes("/oauth2/token"))).toBe(true);
591
- for (const { init } of calls) {
592
- const body = JSON.parse(String(init.body));
593
- expect(body).toMatchObject({
594
- AuthFlow: "USER_PASSWORD_AUTH",
595
- ClientId: CONFIG.clientId,
596
- AuthParameters: { USERNAME: username, PASSWORD: "outpost-secret" },
597
- });
598
- }
599
- expect(expiredModule.loadCachedMachineTokens()?.refreshToken).toBe("");
600
- });
601
- it.each([
602
- [
603
- "entity type",
604
- { entityType: "outpost", entityUid: "out_01TEST" },
605
- "agent",
606
- "agt_01TEST",
607
- ],
608
- [
609
- "entity uid",
610
- { entityType: "outpost", entityUid: "out_01TEST" },
611
- "outpost",
612
- "out_OTHER",
613
- ],
614
- ])("re-mints when the cached machine %s does not match the creds", async (_label, expectedIdentity, cachedEntityType, cachedEntityUid) => {
615
- const username = "out-01test@outposts.getindigo.ai";
616
- writeCreds({
617
- username,
618
- secret: "outpost-secret",
619
- ...expectedIdentity,
620
- });
621
- const { fetchMock } = stubMintFetch();
622
- const { saveCachedTokens, getValidMachineTokens } = await importModule();
623
- saveCachedTokens({
624
- accessToken: fakeJwt({
625
- token_use: "access",
626
- client_id: CONFIG.clientId,
627
- username,
628
- sub: "machine-sub",
629
- }),
630
- idToken: fakeJwt({
631
- token_use: "id",
632
- aud: CONFIG.clientId,
633
- "custom:entityType": cachedEntityType,
634
- "custom:entityUid": cachedEntityUid,
635
- "custom:delegatedSub": "human-sub",
636
- "custom:delegatedEmail": "owner@example.com",
637
- "cognito:username": username,
638
- sub: "machine-sub",
639
- }),
640
- refreshToken: "",
641
- expiresAt: Date.now() + 30 * 60 * 1000,
642
- tokenType: "Bearer",
643
- });
644
- await getValidMachineTokens(CONFIG);
645
- expect(fetchMock).toHaveBeenCalledTimes(1);
646
- });
647
- it.each(["custom:delegatedSub", "custom:delegatedEmail"])("re-mints when an Outpost cache is missing %s", async (missingClaim) => {
648
- const username = "out-01test@outposts.getindigo.ai";
649
- const outpostClaims = {
650
- token_use: "id",
651
- aud: CONFIG.clientId,
652
- "custom:entityType": "outpost",
653
- "custom:entityUid": "out_01TEST",
654
- "custom:delegatedSub": "human-sub",
655
- "custom:delegatedEmail": "owner@example.com",
656
- "cognito:username": username,
657
- sub: "machine-sub",
658
- };
659
- delete outpostClaims[missingClaim];
660
- writeCreds({
661
- username,
662
- secret: "outpost-secret",
663
- entityType: "outpost",
664
- entityUid: "out_01TEST",
665
- });
666
- const { fetchMock } = stubMintFetch();
667
- const { saveCachedTokens, getValidMachineTokens } = await importModule();
668
- saveCachedTokens({
669
- accessToken: fakeJwt({
670
- token_use: "access",
671
- client_id: CONFIG.clientId,
672
- username,
673
- sub: "machine-sub",
674
- }),
675
- idToken: fakeJwt(outpostClaims),
676
- refreshToken: "",
677
- expiresAt: Date.now() + 30 * 60 * 1000,
678
- tokenType: "Bearer",
679
- });
680
- await getValidMachineTokens(CONFIG);
681
- expect(fetchMock).toHaveBeenCalledTimes(1);
682
- });
683
- it("keeps accepting legacy agent creds without entity fields", async () => {
684
- writeCreds({ username: "machine-agt_01TEST", secret: "s3cret" });
685
- const { fetchMock } = stubMintFetch();
686
- const { saveCachedTokens, getValidMachineTokens } = await importModule();
687
- const cached = {
688
- accessToken: fakeJwt({
689
- token_use: "access",
690
- client_id: CONFIG.clientId,
691
- username: "machine-agt_01TEST",
692
- sub: "machine-sub",
693
- }),
694
- idToken: fakeJwt({
695
- token_use: "id",
696
- aud: CONFIG.clientId,
697
- "custom:entityType": "agent",
698
- "custom:entityUid": "agt_01TEST",
699
- "cognito:username": "machine-agt_01TEST",
700
- sub: "machine-sub",
701
- }),
702
- refreshToken: "",
703
- expiresAt: Date.now() + 30 * 60 * 1000,
704
- tokenType: "Bearer",
705
- };
706
- saveCachedTokens(cached);
707
- await expect(getValidMachineTokens(CONFIG)).resolves.toEqual(cached);
708
- expect(fetchMock).not.toHaveBeenCalled();
709
- });
710
- it("invalidates the memo after the creds file is reprovisioned", async () => {
711
- writeCreds({
712
- username: "machine-a",
713
- secret: "secret-a",
714
- entityType: "agent",
715
- entityUid: "agt_A",
716
- });
717
- const { fetchMock } = stubMintFetch();
718
- const { getValidMachineTokens } = await importModule();
719
- const first = await getValidMachineTokens(CONFIG);
720
- writeCreds({
721
- username: "machine-b",
722
- secret: "secret-b",
723
- entityType: "outpost",
724
- entityUid: "out_B",
725
- });
726
- const second = await getValidMachineTokens(CONFIG);
727
- expect(fetchMock).toHaveBeenCalledTimes(2);
728
- expect(first.idToken).not.toBe(second.idToken);
729
- expect(JSON.parse(Buffer.from(second.idToken.split(".")[1], "base64url").toString())["custom:entityUid"]).toBe("out_B");
730
- });
731
- it("invalidates the memo when legacy creds use a different config client", async () => {
732
- writeCreds();
733
- const { fetchMock } = stubMintFetch();
734
- const { getValidMachineTokens } = await importModule();
735
- const otherConfig = { ...CONFIG, clientId: "other-client-id" };
736
- const first = await getValidMachineTokens(CONFIG);
737
- const second = await getValidMachineTokens(otherConfig);
738
- expect(fetchMock).toHaveBeenCalledTimes(2);
739
- expect(first.idToken).not.toBe(second.idToken);
740
- expect(JSON.parse(Buffer.from(second.idToken.split(".")[1], "base64url").toString()).aud).toBe(otherConfig.clientId);
741
- });
742
- it("does not attach a reprovisioned identity to the previous identity's in-flight mint", async () => {
743
- writeCreds({
744
- username: "machine-a",
745
- secret: "secret-a",
746
- entityType: "agent",
747
- entityUid: "agt_A",
748
- });
749
- let releaseFirstMint;
750
- const firstMintGate = new Promise((resolve) => {
751
- releaseFirstMint = resolve;
752
- });
753
- let signalFirstMint;
754
- const firstMintStarted = new Promise((resolve) => {
755
- signalFirstMint = resolve;
756
- });
757
- let callCount = 0;
758
- const fetchMock = vi.fn(async (_url, init) => {
759
- callCount += 1;
760
- const body = JSON.parse(String(init?.body));
761
- if (callCount === 1) {
762
- signalFirstMint?.();
763
- await firstMintGate;
764
- }
765
- const username = body.AuthParameters.USERNAME;
766
- const uid = username === "machine-a" ? "agt_A" : "agt_B";
767
- return new Response(JSON.stringify({
768
- AuthenticationResult: {
769
- AccessToken: fakeJwt({
770
- token_use: "access",
771
- client_id: body.ClientId,
772
- username,
773
- sub: `sub:${username}`,
774
- }),
775
- IdToken: fakeJwt({
776
- token_use: "id",
777
- aud: body.ClientId,
778
- "custom:entityType": "agent",
779
- "custom:entityUid": uid,
780
- "cognito:username": username,
781
- sub: `sub:${username}`,
782
- }),
783
- ExpiresIn: 3600,
784
- },
785
- }), { status: 200 });
786
- });
787
- vi.stubGlobal("fetch", fetchMock);
788
- const { getValidMachineTokens } = await importModule();
789
- const first = getValidMachineTokens(CONFIG);
790
- await firstMintStarted;
791
- writeCreds({
792
- username: "machine-b",
793
- secret: "secret-b",
794
- entityType: "agent",
795
- entityUid: "agt_B",
796
- });
797
- const second = getValidMachineTokens(CONFIG);
798
- releaseFirstMint?.();
799
- const [firstTokens, secondTokens] = await Promise.all([first, second]);
800
- expect(fetchMock).toHaveBeenCalledTimes(2);
801
- expect(firstTokens.idToken).not.toBe(secondTokens.idToken);
802
- expect(JSON.parse(Buffer.from(secondTokens.idToken.split(".")[1], "base64url").toString())["custom:entityUid"]).toBe("agt_B");
803
- });
804
- it("reuses only an empty-refresh matching cache after a lock timeout", async () => {
805
- writeCreds();
806
- const { fetchMock } = stubMintFetch();
807
- const { saveCachedTokens, getValidMachineTokens, machineTokenCacheFile } = await importModule();
808
- const cached = {
809
- accessToken: fakeJwt({
810
- token_use: "access",
811
- client_id: CONFIG.clientId,
812
- username: "machine-agt_01TEST",
813
- sub: "machine-sub",
814
- }),
815
- idToken: fakeJwt({
816
- token_use: "id",
817
- aud: CONFIG.clientId,
818
- "custom:entityType": "agent",
819
- "custom:entityUid": "agt_01TEST",
820
- "cognito:username": "machine-agt_01TEST",
821
- sub: "machine-sub",
822
- }),
823
- refreshToken: "",
824
- expiresAt: Date.now() + 30 * 60 * 1000,
825
- tokenType: "Bearer",
826
- };
827
- saveCachedTokens(cached);
828
- // The lock guards the MACHINE cache, which lives beside the creds file,
829
- // not in the person's ~/.hq (machine-token-cache-isolation.test.ts).
830
- fs.writeFileSync(`${machineTokenCacheFile()}.lock`, String(process.pid));
831
- vi.useFakeTimers();
832
- const resolution = getValidMachineTokens(CONFIG);
833
- await vi.advanceTimersByTimeAsync(20_050);
834
- await expect(resolution).resolves.toEqual(cached);
835
- expect(fetchMock).not.toHaveBeenCalled();
836
- });
837
- it("rejects a legacy non-empty-refresh cache after a lock timeout without minting unlocked", async () => {
838
- writeCreds();
839
- const { fetchMock } = stubMintFetch();
840
- const { saveCachedTokens, getValidMachineTokens, machineTokenCacheFile, CognitoAuthError, } = await importModule();
841
- saveCachedTokens({
842
- accessToken: fakeJwt({
843
- token_use: "access",
844
- client_id: CONFIG.clientId,
845
- username: "machine-agt_01TEST",
846
- sub: "machine-sub",
847
- }),
848
- idToken: fakeJwt({
849
- token_use: "id",
850
- aud: CONFIG.clientId,
851
- "custom:entityType": "agent",
852
- "custom:entityUid": "agt_01TEST",
853
- "cognito:username": "machine-agt_01TEST",
854
- sub: "machine-sub",
855
- }),
856
- refreshToken: "legacy-refresh",
857
- expiresAt: Date.now() + 30 * 60 * 1000,
858
- tokenType: "Bearer",
859
- });
860
- fs.writeFileSync(`${machineTokenCacheFile()}.lock`, String(process.pid));
861
- vi.useFakeTimers();
862
- const resolution = getValidMachineTokens(CONFIG);
863
- const rejection = expect(resolution).rejects.toBeInstanceOf(CognitoAuthError);
864
- await vi.advanceTimersByTimeAsync(20_050);
865
- await rejection;
866
- expect(fetchMock).not.toHaveBeenCalled();
867
- });
868
- });
869
- // ---------------------------------------------------------------------------
870
- // Regression: constant token mints over N files (sync-runner mint storm)
871
- // ---------------------------------------------------------------------------
872
- //
873
- // `getValidAccessToken` (→ getValidMachineTokens) is invoked on EVERY vault
874
- // request a sync makes, including the per-file tombstone HEAD verifies. The
875
- // 2026-06-26 prod incident was 56 throttled USER_PASSWORD_AUTH mints over 314
876
- // files on one box: with no in-process memo + single-flight, mints scaled with
877
- // request count and tripped Cognito's per-user limit. These lock the invariant
878
- // that mints are O(1) per process, independent of N.
879
- describe("regression: constant mints regardless of file count", () => {
880
- it.each([10, 300])("performs exactly ONE token mint across %i sequential file-verify requests", async (n) => {
881
- writeCreds();
882
- const { fetchMock } = stubMintFetch();
883
- const { getValidMachineTokens } = await importModule();
884
- for (let i = 0; i < n; i++) {
885
- await getValidMachineTokens(CONFIG);
886
- }
887
- // One mint for N requests — NOT proportional to N. The first call mints;
888
- // every later call is served by the in-process memo (no network).
889
- expect(fetchMock).toHaveBeenCalledTimes(1);
890
- });
891
- it.each([10, 300])("collapses a concurrent burst of %i requests onto a SINGLE mint (single-flight)", async (n) => {
892
- writeCreds();
893
- const { fetchMock } = stubMintFetch();
894
- const { getValidMachineTokens } = await importModule();
895
- // Fire all N at once, as the run-start fan-out does. Without single-flight
896
- // every concurrent miss would mint and burst the per-user limit.
897
- const results = await Promise.all(Array.from({ length: n }, () => getValidMachineTokens(CONFIG)));
898
- expect(fetchMock).toHaveBeenCalledTimes(1);
899
- // All callers observe the same token.
900
- for (const r of results)
901
- expect(r).toEqual(results[0]);
902
- // Follow-up sequential requests stay on the memo — still one mint total.
903
- await getValidMachineTokens(CONFIG);
904
- expect(fetchMock).toHaveBeenCalledTimes(1);
905
- });
906
- it("serializes independent module instances through the shared cache lock", async () => {
907
- const username = "machine-agt_01TEST";
908
- writeCreds({
909
- username,
910
- secret: "s3cret",
911
- entityType: "agent",
912
- entityUid: "agt_01TEST",
913
- });
914
- let releaseMint;
915
- const mintGate = new Promise((resolve) => {
916
- releaseMint = resolve;
917
- });
918
- let signalMintStarted;
919
- const mintStarted = new Promise((resolve) => {
920
- signalMintStarted = resolve;
921
- });
922
- const accessToken = fakeJwt({
923
- token_use: "access",
924
- client_id: CONFIG.clientId,
925
- username,
926
- sub: "machine-sub",
927
- });
928
- const idToken = fakeJwt({
929
- token_use: "id",
930
- aud: CONFIG.clientId,
931
- "custom:entityType": "agent",
932
- "custom:entityUid": "agt_01TEST",
933
- "cognito:username": username,
934
- sub: "machine-sub",
935
- });
936
- const fetchMock = vi.fn(async () => {
937
- signalMintStarted?.();
938
- await mintGate;
939
- return new Response(JSON.stringify({
940
- AuthenticationResult: {
941
- AccessToken: accessToken,
942
- IdToken: idToken,
943
- RefreshToken: "must-not-be-stored",
944
- ExpiresIn: 3600,
945
- },
946
- }), { status: 200 });
947
- });
948
- vi.stubGlobal("fetch", fetchMock);
949
- const firstProcessModule = await importModule();
950
- vi.resetModules();
951
- const secondProcessModule = await importModule();
952
- const first = firstProcessModule.getValidMachineTokens(CONFIG);
953
- await mintStarted;
954
- const second = secondProcessModule.getValidMachineTokens(CONFIG);
955
- releaseMint?.();
956
- const [firstTokens, secondTokens] = await Promise.all([first, second]);
957
- expect(fetchMock).toHaveBeenCalledTimes(1);
958
- expect(secondTokens).toEqual(firstTokens);
959
- expect(secondProcessModule.loadCachedMachineTokens()?.refreshToken).toBe("");
960
- });
961
- it("serializes the exported direct mint API", async () => {
962
- writeCreds();
963
- let releaseFirstMint;
964
- const firstMintGate = new Promise((resolve) => {
965
- releaseFirstMint = resolve;
966
- });
967
- let signalFirstMint;
968
- const firstMintStarted = new Promise((resolve) => {
969
- signalFirstMint = resolve;
970
- });
971
- let activeMints = 0;
972
- let maxActiveMints = 0;
973
- let callCount = 0;
974
- const accessToken = fakeJwt({
975
- token_use: "access",
976
- client_id: CONFIG.clientId,
977
- username: "machine-agt_01TEST",
978
- sub: "machine-sub",
979
- });
980
- const idToken = fakeJwt({
981
- token_use: "id",
982
- aud: CONFIG.clientId,
983
- "custom:entityType": "agent",
984
- "custom:entityUid": "agt_01TEST",
985
- "cognito:username": "machine-agt_01TEST",
986
- sub: "machine-sub",
987
- });
988
- const fetchMock = vi.fn(async () => {
989
- callCount += 1;
990
- activeMints += 1;
991
- maxActiveMints = Math.max(maxActiveMints, activeMints);
992
- if (callCount === 1) {
993
- signalFirstMint?.();
994
- await firstMintGate;
995
- }
996
- activeMints -= 1;
997
- return new Response(JSON.stringify({
998
- AuthenticationResult: {
999
- AccessToken: accessToken,
1000
- IdToken: idToken,
1001
- ExpiresIn: 3600,
1002
- },
1003
- }), { status: 200 });
1004
- });
1005
- vi.stubGlobal("fetch", fetchMock);
1006
- const firstModule = await importModule();
1007
- vi.resetModules();
1008
- const secondModule = await importModule();
1009
- const first = firstModule.mintMachineTokens(CONFIG);
1010
- await firstMintStarted;
1011
- const second = secondModule.mintMachineTokens(CONFIG);
1012
- releaseFirstMint?.();
1013
- await Promise.all([first, second]);
1014
- expect(fetchMock).toHaveBeenCalledTimes(2);
1015
- expect(maxActiveMints).toBe(1);
1016
- });
1017
- it("serializes direct mints in actual separate processes", async () => {
1018
- const moduleUrl = pathToFileURL(path.join(process.cwd(), "src", "cognito-auth.ts")).href;
1019
- const marker = path.join(tmpHome, "mint-active");
1020
- const overlap = path.join(tmpHome, "mint-overlap");
1021
- const start = path.join(tmpHome, "mint-start");
1022
- const childScript = String.raw `
1023
- import fs from "fs";
1024
- const pause = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
1025
- const fakeJwt = (claims) => {
1026
- const enc = (value) => Buffer.from(JSON.stringify(value)).toString("base64url");
1027
- return enc({ alg: "none" }) + "." + enc(claims) + ".sig";
1028
- };
1029
- const auth = await import(process.env.HQ_LOCK_TEST_MODULE_URL);
1030
- fs.writeFileSync(process.env.HQ_LOCK_TEST_READY, "ready");
1031
- while (!fs.existsSync(process.env.HQ_LOCK_TEST_START)) await pause(5);
1032
- globalThis.fetch = async () => {
1033
- let ownsMarker = false;
1034
- try {
1035
- const fd = fs.openSync(process.env.HQ_LOCK_TEST_MARKER, "wx");
1036
- fs.closeSync(fd);
1037
- ownsMarker = true;
1038
- } catch (error) {
1039
- if (error.code === "EEXIST") {
1040
- fs.writeFileSync(process.env.HQ_LOCK_TEST_OVERLAP, "overlap");
1041
- } else {
1042
- throw error;
1043
- }
1044
- }
1045
- await pause(125);
1046
- if (ownsMarker) fs.unlinkSync(process.env.HQ_LOCK_TEST_MARKER);
1047
- return new Response(JSON.stringify({ AuthenticationResult: {
1048
- AccessToken: fakeJwt({ token_use: "access", client_id: "test-client-id", username: "machine", sub: "sub" }),
1049
- IdToken: fakeJwt({ token_use: "id", aud: "test-client-id", "custom:entityType": "agent", "custom:entityUid": "agt_TEST", "cognito:username": "machine", sub: "sub" }),
1050
- ExpiresIn: 3600
1051
- }}), { status: 200 });
1052
- };
1053
- await auth.mintMachineTokens(
1054
- { region: "us-east-1", userPoolDomain: "unused", clientId: "test-client-id" },
1055
- { username: "machine", secret: "secret", entityType: "agent", entityUid: "agt_TEST" },
1056
- { baseDelayMs: 0 }
1057
- );
1058
- `;
1059
- const children = ["a", "b"].map((name) => {
1060
- // Drop FORCE_COLOR/NO_COLOR so child Node processes do not emit the
1061
- // "NO_COLOR is ignored due to FORCE_COLOR" warning on stderr — that
1062
- // warning is ambient harness noise and is not a mint failure signal.
1063
- const childEnv = { ...process.env };
1064
- delete childEnv.FORCE_COLOR;
1065
- delete childEnv.NO_COLOR;
1066
- // Node 22 before type stripping was unflagged (the HQ toolchain ships
1067
- // 22.17.0) prints an ExperimentalWarning for --experimental-strip-types
1068
- // on stderr. Silence only that warning class so the empty-stderr check
1069
- // below still catches every real failure.
1070
- const child = spawn(process.execPath, [
1071
- "--experimental-strip-types",
1072
- "--disable-warning=ExperimentalWarning",
1073
- "--input-type=module",
1074
- "-e",
1075
- childScript,
1076
- ], {
1077
- cwd: process.cwd(),
1078
- env: {
1079
- ...childEnv,
1080
- HOME: tmpHome,
1081
- HQ_LOCK_TEST_MODULE_URL: moduleUrl,
1082
- HQ_LOCK_TEST_READY: path.join(tmpHome, `ready-${name}`),
1083
- HQ_LOCK_TEST_START: start,
1084
- HQ_LOCK_TEST_MARKER: marker,
1085
- HQ_LOCK_TEST_OVERLAP: overlap,
1086
- },
1087
- });
1088
- let stderr = "";
1089
- child.stderr.on("data", (chunk) => {
1090
- stderr += String(chunk);
1091
- });
1092
- return { child, stderr: () => stderr };
1093
- });
1094
- const readyPaths = ["a", "b"].map((name) => path.join(tmpHome, `ready-${name}`));
1095
- const readyDeadline = Date.now() + 5_000;
1096
- while (!readyPaths.every((readyPath) => fs.existsSync(readyPath)) &&
1097
- Date.now() < readyDeadline) {
1098
- await new Promise((resolve) => setTimeout(resolve, 10));
1099
- }
1100
- expect(readyPaths.every((readyPath) => fs.existsSync(readyPath))).toBe(true);
1101
- fs.writeFileSync(start, "start");
1102
- const exits = await Promise.all(children.map(({ child, stderr }) => new Promise((resolve) => {
1103
- child.on("exit", (code) => resolve({ code, stderr: stderr() }));
1104
- })));
1105
- expect(exits).toEqual([
1106
- { code: 0, stderr: "" },
1107
- { code: 0, stderr: "" },
1108
- ]);
1109
- expect(fs.existsSync(overlap)).toBe(false);
1110
- }, 10_000);
1111
- });
1112
- // ---------------------------------------------------------------------------
1113
- // Throttle handling: retry TooManyRequestsException with backoff
1114
- // ---------------------------------------------------------------------------
1115
- describe("mintMachineTokens throttle retry", () => {
1116
- /** Fetch mock that throttles (HTTP 400 + TooManyRequestsException, the shape
1117
- * Cognito actually returns) for the first `throttleCount` calls, then 200s. */
1118
- function stubThrottleThenSuccess(throttleCount) {
1119
- let call = 0;
1120
- const fetchMock = vi.fn(async () => {
1121
- call++;
1122
- if (call <= throttleCount) {
1123
- return new Response(JSON.stringify({
1124
- __type: "TooManyRequestsException",
1125
- message: "Too many requests",
1126
- }), { status: 400 });
1127
- }
1128
- return new Response(JSON.stringify({
1129
- AuthenticationResult: {
1130
- AccessToken: fakeJwt({
1131
- token_use: "access",
1132
- client_id: CONFIG.clientId,
1133
- username: "machine-agt_01TEST",
1134
- sub: "machine-sub",
1135
- }),
1136
- IdToken: fakeJwt({
1137
- token_use: "id",
1138
- aud: CONFIG.clientId,
1139
- "custom:entityType": "agent",
1140
- "custom:entityUid": "agt_01TEST",
1141
- "cognito:username": "machine-agt_01TEST",
1142
- sub: "machine-sub",
1143
- }),
1144
- ExpiresIn: 3600,
1145
- },
1146
- }), { status: 200 });
1147
- });
1148
- vi.stubGlobal("fetch", fetchMock);
1149
- return fetchMock;
1150
- }
1151
- it("retries a throttled mint with backoff and eventually succeeds", async () => {
1152
- writeCreds();
1153
- const fetchMock = stubThrottleThenSuccess(2);
1154
- const { mintMachineTokens } = await importModule();
1155
- // baseDelayMs: 0 keeps the test instant — jitter * 0 == 0.
1156
- const tokens = await mintMachineTokens(CONFIG, undefined, {
1157
- baseDelayMs: 0,
1158
- maxRetries: 5,
1159
- });
1160
- expect(fetchMock).toHaveBeenCalledTimes(3); // 2 throttles + 1 success
1161
- const idClaims = JSON.parse(Buffer.from(tokens.idToken.split(".")[1], "base64url").toString());
1162
- expect(idClaims.token_use).toBe("id");
1163
- });
1164
- it("gives up after maxRetries and throws when throttling never clears", async () => {
1165
- writeCreds();
1166
- const fetchMock = stubThrottleThenSuccess(Number.POSITIVE_INFINITY);
1167
- const { mintMachineTokens, CognitoAuthError } = await importModule();
1168
- await expect(mintMachineTokens(CONFIG, undefined, { baseDelayMs: 0, maxRetries: 2 })).rejects.toBeInstanceOf(CognitoAuthError);
1169
- // maxRetries: 2 → 3 total attempts (initial + 2 retries).
1170
- expect(fetchMock).toHaveBeenCalledTimes(3);
1171
- });
1172
- it("does NOT retry a non-throttle auth failure (bad creds fail fast)", async () => {
1173
- writeCreds();
1174
- const fetchMock = vi.fn(async () => new Response(JSON.stringify({ __type: "NotAuthorizedException", message: "nope" }), { status: 400 }));
1175
- vi.stubGlobal("fetch", fetchMock);
1176
- const { mintMachineTokens, CognitoAuthError } = await importModule();
1177
- await expect(mintMachineTokens(CONFIG, undefined, { baseDelayMs: 0, maxRetries: 5 })).rejects.toBeInstanceOf(CognitoAuthError);
1178
- expect(fetchMock).toHaveBeenCalledTimes(1); // no retries
1179
- });
1180
- });
1181
- // ---------------------------------------------------------------------------
1182
- // getValidAccessToken — machine-mode short circuit
1183
- // ---------------------------------------------------------------------------
1184
- describe("getValidAccessToken in machine mode", () => {
1185
- it("mints via machine creds and returns the ID token (vault-API identity)", async () => {
1186
- writeCreds();
1187
- const { calls } = stubMintFetch();
1188
- const { getValidAccessToken } = await importModule();
1189
- const token = await getValidAccessToken(CONFIG, { interactive: false });
1190
- expect(calls).toHaveLength(1);
1191
- const claims = JSON.parse(Buffer.from(token.split(".")[1], "base64url").toString());
1192
- // ID, NOT access: agent identity rides the ID token; the access-token
1193
- // return lobotomized first-sync on the first post-cutover box.
1194
- expect(claims.token_use).toBe("id");
1195
- });
1196
- });
1197
- // ---------------------------------------------------------------------------
1198
- // External agents: host-key signed mint (api-contract v1)
1199
- // ---------------------------------------------------------------------------
1200
- import { generateKeyPairSync, createPublicKey, verify as cryptoVerify } from "crypto";
1201
- const EXTERNAL_UID = "agt_01EXTERNAL0000000000000000";
1202
- const EXTERNAL_API = "https://hqapi.example.test";
1203
- function writeHostKey() {
1204
- const dir = path.join(tmpHome, ".hq-agent");
1205
- fs.mkdirSync(dir, { recursive: true });
1206
- const { privateKey, publicKey } = generateKeyPairSync("ed25519");
1207
- const privatePath = path.join(dir, "host-key");
1208
- fs.writeFileSync(privatePath, privateKey.export({ type: "pkcs8", format: "pem" }), { mode: 0o600 });
1209
- return {
1210
- privatePath,
1211
- publicPem: publicKey.export({ type: "spki", format: "pem" }).toString(),
1212
- };
1213
- }
1214
- function writeExternalCreds(hostKeyPath, overrides = {}) {
1215
- return writeCreds({
1216
- username: "agt-01external@agents.getindigo.ai",
1217
- secret: "s3cret",
1218
- clientId: "agent-client",
1219
- region: "us-east-1",
1220
- entityType: "agent",
1221
- entityUid: EXTERNAL_UID,
1222
- runtime: "external",
1223
- hostKeyPath,
1224
- apiBaseUrl: EXTERNAL_API,
1225
- ...overrides,
1226
- });
1227
- }
1228
- /**
1229
- * Fake hq-pro: hands out a nonce, then verifies the Ed25519 signature over
1230
- * `${uid}.${nonce}` against the enrolled public key before minting.
1231
- */
1232
- function stubExternalMintFetch(opts) {
1233
- const calls = [];
1234
- const nonces = new Set();
1235
- let n = 0;
1236
- const challengeStatuses = [...(opts.challengeStatus ?? [])];
1237
- const mintStatuses = [...(opts.mintStatus ?? [])];
1238
- const fetchMock = vi.fn(async (url, init) => {
1239
- const u = String(url);
1240
- calls.push({ url: u, init: init ?? {} });
1241
- if (u.endsWith("/mint-challenge")) {
1242
- const forced = challengeStatuses.shift();
1243
- if (forced && forced !== 200) {
1244
- return new Response(JSON.stringify({ error: "throttled" }), { status: forced });
1245
- }
1246
- const nonce = `nonce-${++n}`;
1247
- nonces.add(nonce);
1248
- return new Response(JSON.stringify({ nonce, expiresAt: new Date(Date.now() + 60_000).toISOString() }), { status: 200 });
1249
- }
1250
- if (u.endsWith("/mint")) {
1251
- const forced = mintStatuses.shift();
1252
- if (forced && forced !== 200) {
1253
- return new Response(JSON.stringify({ error: "throttled" }), { status: forced });
1254
- }
1255
- const body = JSON.parse(String(init?.body));
1256
- if (opts.rejectCode) {
1257
- return new Response(JSON.stringify({ code: opts.rejectCode, error: "refused" }), { status: opts.rejectStatus ?? 401 });
1258
- }
1259
- if (body.secret !== "s3cret") {
1260
- return new Response(JSON.stringify({ code: "not_authorized", error: "wrong secret" }), { status: 401 });
1261
- }
1262
- if (!nonces.delete(body.nonce)) {
1263
- return new Response(JSON.stringify({ code: "bad_nonce", error: "unknown nonce" }), { status: 401 });
1264
- }
1265
- const ok = cryptoVerify(null, Buffer.from(`${EXTERNAL_UID}.${body.nonce}`), createPublicKey(opts.publicPem), Buffer.from(body.signature, "base64"));
1266
- if (!ok) {
1267
- return new Response(JSON.stringify({ code: "bad_signature", error: "signature mismatch" }), { status: 401 });
1268
- }
1269
- const clientId = opts.clientId ?? "agent-client";
1270
- return new Response(JSON.stringify(opts.mintBody ?? {
1271
- accessToken: fakeJwt({
1272
- token_use: "access",
1273
- client_id: clientId,
1274
- username: "uuid-external",
1275
- sub: "sub-external",
1276
- }),
1277
- idToken: fakeJwt({
1278
- token_use: "id",
1279
- aud: clientId,
1280
- "custom:entityType": "agent",
1281
- "custom:entityUid": EXTERNAL_UID,
1282
- "cognito:username": "uuid-external",
1283
- sub: "sub-external",
1284
- }),
1285
- refreshToken: "should-not-be-kept",
1286
- expiresIn: 3600,
1287
- }), { status: 200 });
1288
- }
1289
- throw new Error(`unexpected fetch ${u}`);
1290
- });
1291
- vi.stubGlobal("fetch", fetchMock);
1292
- return { fetchMock, calls };
1293
- }
1294
- describe("external machine creds parsing", () => {
1295
- it("parses runtime, hostKeyPath and apiBaseUrl", async () => {
1296
- const { privatePath } = writeHostKey();
1297
- writeExternalCreds(privatePath);
1298
- const { loadMachineCreds, isExternalMachineCreds } = await importModule();
1299
- const creds = loadMachineCreds();
1300
- expect(creds).toMatchObject({
1301
- runtime: "external",
1302
- hostKeyPath: privatePath,
1303
- apiBaseUrl: EXTERNAL_API,
1304
- entityType: "agent",
1305
- entityUid: EXTERNAL_UID,
1306
- });
1307
- expect(isExternalMachineCreds(creds)).toBe(true);
1308
- });
1309
- it("keeps hosted creds hosted (no runtime field → not external)", async () => {
1310
- writeCreds({ username: "machine-agt_01TEST", secret: "s3cret" });
1311
- const { loadMachineCreds, isExternalMachineCreds } = await importModule();
1312
- const creds = loadMachineCreds();
1313
- expect(creds?.runtime).toBeUndefined();
1314
- expect(isExternalMachineCreds(creds)).toBe(false);
1315
- });
1316
- it("rejects an external file without hostKeyPath (no silent hosted downgrade)", async () => {
1317
- writeCreds({
1318
- username: "u",
1319
- secret: "s",
1320
- entityType: "agent",
1321
- entityUid: EXTERNAL_UID,
1322
- runtime: "external",
1323
- });
1324
- const { loadMachineCreds } = await importModule();
1325
- expect(loadMachineCreds()).toBeNull();
1326
- });
1327
- it("rejects an unknown runtime value", async () => {
1328
- writeCreds({ username: "u", secret: "s", runtime: "cloud" });
1329
- const { loadMachineCreds } = await importModule();
1330
- expect(loadMachineCreds()).toBeNull();
1331
- });
1332
- it("honors HQ_MACHINE_CREDS_FILE for external creds too", async () => {
1333
- const { privatePath } = writeHostKey();
1334
- const alt = path.join(tmpHome, "elsewhere.json");
1335
- fs.writeFileSync(alt, JSON.stringify({
1336
- username: "u",
1337
- secret: "s",
1338
- entityType: "agent",
1339
- entityUid: EXTERNAL_UID,
1340
- runtime: "external",
1341
- hostKeyPath: privatePath,
1342
- }));
1343
- process.env.HQ_MACHINE_CREDS_FILE = alt;
1344
- const { loadMachineCreds, externalMintApiBaseUrl } = await importModule();
1345
- const creds = loadMachineCreds();
1346
- expect(creds?.runtime).toBe("external");
1347
- // No apiBaseUrl in the file → env → default, trailing slash trimmed.
1348
- process.env.HQ_VAULT_API_URL = "https://alt.example.test/";
1349
- expect(externalMintApiBaseUrl(creds)).toBe("https://alt.example.test");
1350
- delete process.env.HQ_VAULT_API_URL;
1351
- expect(externalMintApiBaseUrl(creds)).toBe("https://hqapi.hq.computer");
1352
- });
1353
- });
1354
- describe("signExternalMintChallenge", () => {
1355
- it("produces a base64 Ed25519 signature over `${uid}.${nonce}`", async () => {
1356
- const { privatePath, publicPem } = writeHostKey();
1357
- const { signExternalMintChallenge, externalMintChallengeMessage } = await importModule();
1358
- const sig = signExternalMintChallenge(fs.readFileSync(privatePath), EXTERNAL_UID, "abc");
1359
- expect(externalMintChallengeMessage(EXTERNAL_UID, "abc")).toBe(`${EXTERNAL_UID}.abc`);
1360
- expect(cryptoVerify(null, Buffer.from(`${EXTERNAL_UID}.abc`), createPublicKey(publicPem), Buffer.from(sig, "base64"))).toBe(true);
1361
- // A different nonce must not verify with the same signature.
1362
- expect(cryptoVerify(null, Buffer.from(`${EXTERNAL_UID}.abd`), createPublicKey(publicPem), Buffer.from(sig, "base64"))).toBe(false);
1363
- });
1364
- it("refuses a non-Ed25519 key", async () => {
1365
- const { signExternalMintChallenge, CognitoAuthError } = await importModule();
1366
- const { privateKey } = generateKeyPairSync("rsa", { modulusLength: 2048 });
1367
- expect(() => signExternalMintChallenge(privateKey.export({ type: "pkcs8", format: "pem" }), EXTERNAL_UID, "n")).toThrow(CognitoAuthError);
1368
- });
1369
- });
1370
- describe("mintMachineTokens for external agents", () => {
1371
- it("challenges, signs, mints through hq-pro and never calls Cognito", async () => {
1372
- const { privatePath, publicPem } = writeHostKey();
1373
- writeExternalCreds(privatePath);
1374
- const { calls } = stubExternalMintFetch({ publicPem });
1375
- const { mintMachineTokens, loadCachedMachineTokens } = await importModule();
1376
- const tokens = await mintMachineTokens(CONFIG, undefined, { baseDelayMs: 0 });
1377
- expect(calls.map((c) => c.url)).toEqual([
1378
- `${EXTERNAL_API}/v1/agents/${EXTERNAL_UID}/mint-challenge`,
1379
- `${EXTERNAL_API}/v1/agents/${EXTERNAL_UID}/mint`,
1380
- ]);
1381
- expect(calls.every((c) => !c.url.includes("cognito-idp"))).toBe(true);
1382
- // The challenge carries nothing; the mint carries nonce + signature +
1383
- // the machine secret (hq-pro runs USER_PASSWORD_AUTH with it).
1384
- expect(String(calls[0].init.body)).toBe("{}");
1385
- const mintBody = JSON.parse(String(calls[1].init.body));
1386
- expect(mintBody).toEqual({ nonce: "nonce-1", signature: expect.any(String), secret: "s3cret" });
1387
- expect(tokens.refreshToken).toBe("");
1388
- const claims = JSON.parse(Buffer.from(tokens.idToken.split(".")[1], "base64url").toString());
1389
- expect(claims["custom:entityUid"]).toBe(EXTERNAL_UID);
1390
- expect(loadCachedMachineTokens()?.idToken).toBe(tokens.idToken);
1391
- });
1392
- it("getValidMachineTokens routes external creds through the signed mint", async () => {
1393
- const { privatePath, publicPem } = writeHostKey();
1394
- writeExternalCreds(privatePath);
1395
- const { calls } = stubExternalMintFetch({ publicPem });
1396
- const { getValidMachineTokens } = await importModule();
1397
- await getValidMachineTokens(CONFIG);
1398
- await getValidMachineTokens(CONFIG);
1399
- // One challenge + one mint; the second call is served from the memo.
1400
- expect(calls).toHaveLength(2);
1401
- });
1402
- it("surfaces hq-pro's 401 code (bad_signature) as a hard CognitoAuthError", async () => {
1403
- const { privatePath } = writeHostKey();
1404
- const other = generateKeyPairSync("ed25519").publicKey
1405
- .export({ type: "spki", format: "pem" })
1406
- .toString();
1407
- writeExternalCreds(privatePath);
1408
- const { calls } = stubExternalMintFetch({ publicPem: other });
1409
- const { mintMachineTokens, CognitoAuthError } = await importModule();
1410
- await expect(mintMachineTokens(CONFIG, undefined, { baseDelayMs: 0 })).rejects.toThrow(/External machine token mint failed \(401\) bad_signature/);
1411
- await expect(mintMachineTokens(CONFIG, undefined, { baseDelayMs: 0 })).rejects.toBeInstanceOf(CognitoAuthError);
1412
- // No retry on a hard refusal: each attempt is exactly challenge + mint.
1413
- expect(calls.filter((c) => c.url.endsWith("/mint"))).toHaveLength(2);
1414
- });
1415
- it("surfaces revoked / not_authorized / agent_not_found without retrying", async () => {
1416
- const { privatePath, publicPem } = writeHostKey();
1417
- for (const [code, status] of [["revoked", 401], ["not_authorized", 401], ["agent_not_found", 404]]) {
1418
- writeExternalCreds(privatePath);
1419
- const { calls } = stubExternalMintFetch({ publicPem, rejectCode: code, rejectStatus: status });
1420
- const { mintMachineTokens } = await importModule();
1421
- await expect(mintMachineTokens(CONFIG, undefined, { baseDelayMs: 0 })).rejects.toThrow(new RegExp(`\\(${status}\\) ${code}`));
1422
- expect(calls).toHaveLength(2);
1423
- vi.resetModules();
1424
- }
1425
- });
1426
- it("a wrong machine secret is refused as not_authorized", async () => {
1427
- const { privatePath, publicPem } = writeHostKey();
1428
- writeExternalCreds(privatePath, { secret: "stale" });
1429
- stubExternalMintFetch({ publicPem });
1430
- const { mintMachineTokens } = await importModule();
1431
- await expect(mintMachineTokens(CONFIG)).rejects.toThrow(/\(401\) not_authorized/);
1432
- });
1433
- it("retries a throttled challenge and a throttled mint, then succeeds", async () => {
1434
- const { privatePath, publicPem } = writeHostKey();
1435
- writeExternalCreds(privatePath);
1436
- const { calls } = stubExternalMintFetch({
1437
- publicPem,
1438
- challengeStatus: [429, 200, 200],
1439
- mintStatus: [429, 200],
1440
- });
1441
- const { mintMachineTokens } = await importModule();
1442
- await mintMachineTokens(CONFIG, undefined, { baseDelayMs: 0, maxRetries: 3 });
1443
- expect(calls.filter((c) => c.url.endsWith("/mint-challenge"))).toHaveLength(3);
1444
- expect(calls.filter((c) => c.url.endsWith("/mint"))).toHaveLength(2);
1445
- });
1446
- it("fails with an actionable error when the host key is missing", async () => {
1447
- const missing = path.join(tmpHome, ".hq-agent", "host-key");
1448
- writeExternalCreds(missing);
1449
- const { fetchMock } = stubExternalMintFetch({ publicPem: "" });
1450
- const { mintMachineTokens } = await importModule();
1451
- await expect(mintMachineTokens(CONFIG)).rejects.toThrow(/Cannot read host key .*--replace/);
1452
- expect(fetchMock).not.toHaveBeenCalled();
1453
- });
1454
- it("rejects tokens that do not match the enrolled identity", async () => {
1455
- const { privatePath, publicPem } = writeHostKey();
1456
- writeExternalCreds(privatePath);
1457
- stubExternalMintFetch({
1458
- publicPem,
1459
- mintBody: {
1460
- accessToken: fakeJwt({ token_use: "access", client_id: "agent-client", username: "x", sub: "x" }),
1461
- idToken: fakeJwt({
1462
- token_use: "id",
1463
- aud: "agent-client",
1464
- "custom:entityType": "agent",
1465
- "custom:entityUid": "agt_01SOMEONEELSE000000000000",
1466
- "cognito:username": "x",
1467
- sub: "x",
1468
- }),
1469
- expiresIn: 3600,
1470
- },
1471
- });
1472
- const { mintMachineTokens } = await importModule();
1473
- await expect(mintMachineTokens(CONFIG)).rejects.toThrow(/do not match the requested machine identity/);
1474
- });
1475
- it("hosted creds still mint straight against Cognito (path untouched)", async () => {
1476
- writeCreds({
1477
- username: "agt-01hosted@agents.getindigo.ai",
1478
- secret: "s3cret",
1479
- clientId: "agent-client",
1480
- region: "us-east-1",
1481
- entityType: "agent",
1482
- entityUid: "agt_01TEST",
1483
- runtime: "hosted",
1484
- });
1485
- const { calls } = stubMintFetch();
1486
- const { mintMachineTokens } = await importModule();
1487
- await mintMachineTokens(CONFIG);
1488
- expect(calls).toHaveLength(1);
1489
- expect(calls[0].url).toBe("https://cognito-idp.us-east-1.amazonaws.com/");
1490
- });
1491
- });
1492
- //# sourceMappingURL=machine-auth.test.js.map