@codemem/core 0.49.1 → 0.50.0-beta.2

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 (391) hide show
  1. package/dist/api-types.d.ts +7 -0
  2. package/dist/api-types.d.ts.map +1 -1
  3. package/dist/better-sqlite-coordinator-runtime.d.ts.map +1 -1
  4. package/dist/better-sqlite-coordinator-store.d.ts +56 -3
  5. package/dist/better-sqlite-coordinator-store.d.ts.map +1 -1
  6. package/dist/boundary-readiness-inventory.d.ts +27 -0
  7. package/dist/boundary-readiness-inventory.d.ts.map +1 -0
  8. package/dist/coordinator-account-link-receiver.d.ts +15 -0
  9. package/dist/coordinator-account-link-receiver.d.ts.map +1 -1
  10. package/dist/coordinator-account-link-status-client.d.ts +1 -1
  11. package/dist/coordinator-account-link-status-client.d.ts.map +1 -1
  12. package/dist/coordinator-actions.d.ts +14 -0
  13. package/dist/coordinator-actions.d.ts.map +1 -1
  14. package/dist/coordinator-api.d.ts +7 -0
  15. package/dist/coordinator-api.d.ts.map +1 -1
  16. package/dist/coordinator-auth-historical-store-test-fixture.d.ts.map +1 -1
  17. package/dist/coordinator-auth-link-revocation-test-harness.d.ts.map +1 -1
  18. package/dist/coordinator-auth-schema-stage.d.ts +14 -2
  19. package/dist/coordinator-auth-schema-stage.d.ts.map +1 -1
  20. package/dist/coordinator-block-tombstone-test-harness.d.ts +3 -0
  21. package/dist/coordinator-block-tombstone-test-harness.d.ts.map +1 -0
  22. package/dist/coordinator-bootstrap-authorization-api-test-harness.d.ts.map +1 -1
  23. package/dist/coordinator-bootstrap-authorization-test-harness.d.ts.map +1 -1
  24. package/dist/coordinator-bootstrap-revocation-test-harness.d.ts.map +1 -1
  25. package/dist/coordinator-boundary-readiness-client.d.ts +35 -0
  26. package/dist/coordinator-boundary-readiness-client.d.ts.map +1 -0
  27. package/dist/coordinator-boundary-readiness-route.d.ts +52 -0
  28. package/dist/coordinator-boundary-readiness-route.d.ts.map +1 -0
  29. package/dist/coordinator-boundary-readiness-test-harness.d.ts +15 -0
  30. package/dist/coordinator-boundary-readiness-test-harness.d.ts.map +1 -0
  31. package/dist/coordinator-boundary-readiness.d.ts +161 -0
  32. package/dist/coordinator-boundary-readiness.d.ts.map +1 -0
  33. package/dist/coordinator-browser-auth-app.d.ts +1 -1
  34. package/dist/coordinator-browser-auth-app.d.ts.map +1 -1
  35. package/dist/coordinator-browser-auth-callback.d.ts +2 -1
  36. package/dist/coordinator-browser-auth-callback.d.ts.map +1 -1
  37. package/dist/coordinator-controller-revocation-test-harness.d.ts.map +1 -1
  38. package/dist/coordinator-d1-schema-inventory.d.ts +2 -0
  39. package/dist/coordinator-d1-schema-inventory.d.ts.map +1 -1
  40. package/dist/coordinator-d1-scope-authorization-test-harness.d.ts.map +1 -1
  41. package/dist/coordinator-device-auth-link.d.ts +1 -0
  42. package/dist/coordinator-device-auth-link.d.ts.map +1 -1
  43. package/dist/coordinator-device-rejoin-browser-evidence.d.ts +28 -0
  44. package/dist/coordinator-device-rejoin-browser-evidence.d.ts.map +1 -0
  45. package/dist/coordinator-device-rejoin-browser-transaction-test-harness.d.ts +8 -0
  46. package/dist/coordinator-device-rejoin-browser-transaction-test-harness.d.ts.map +1 -0
  47. package/dist/coordinator-device-rejoin-browser-transaction.d.ts +43 -0
  48. package/dist/coordinator-device-rejoin-browser-transaction.d.ts.map +1 -0
  49. package/dist/coordinator-device-rejoin-browser-view.d.ts +30 -0
  50. package/dist/coordinator-device-rejoin-browser-view.d.ts.map +1 -0
  51. package/dist/coordinator-device-rejoin-browser.d.ts +26 -0
  52. package/dist/coordinator-device-rejoin-browser.d.ts.map +1 -0
  53. package/dist/coordinator-device-rejoin-client-requests.d.ts +70 -0
  54. package/dist/coordinator-device-rejoin-client-requests.d.ts.map +1 -0
  55. package/dist/coordinator-device-rejoin-client.d.ts +15 -0
  56. package/dist/coordinator-device-rejoin-client.d.ts.map +1 -0
  57. package/dist/coordinator-device-rejoin-confirmation-test-harness.d.ts +22 -0
  58. package/dist/coordinator-device-rejoin-confirmation-test-harness.d.ts.map +1 -0
  59. package/dist/coordinator-device-rejoin-confirmation.d.ts +18 -0
  60. package/dist/coordinator-device-rejoin-confirmation.d.ts.map +1 -0
  61. package/dist/coordinator-device-rejoin-destinations-test-harness.d.ts +7 -0
  62. package/dist/coordinator-device-rejoin-destinations-test-harness.d.ts.map +1 -0
  63. package/dist/coordinator-device-rejoin-destinations.d.ts +25 -0
  64. package/dist/coordinator-device-rejoin-destinations.d.ts.map +1 -0
  65. package/dist/coordinator-device-rejoin-display.d.ts +14 -0
  66. package/dist/coordinator-device-rejoin-display.d.ts.map +1 -0
  67. package/dist/coordinator-device-rejoin-event-client.d.ts +30 -0
  68. package/dist/coordinator-device-rejoin-event-client.d.ts.map +1 -0
  69. package/dist/coordinator-device-rejoin-events.d.ts +7 -0
  70. package/dist/coordinator-device-rejoin-events.d.ts.map +1 -0
  71. package/dist/coordinator-device-rejoin-finalize-test-harness.d.ts +14 -0
  72. package/dist/coordinator-device-rejoin-finalize-test-harness.d.ts.map +1 -0
  73. package/dist/coordinator-device-rejoin-finalize.d.ts +36 -0
  74. package/dist/coordinator-device-rejoin-finalize.d.ts.map +1 -0
  75. package/dist/coordinator-device-rejoin-http.d.ts +11 -0
  76. package/dist/coordinator-device-rejoin-http.d.ts.map +1 -0
  77. package/dist/coordinator-device-rejoin-link-evidence-test-harness.d.ts +17 -0
  78. package/dist/coordinator-device-rejoin-link-evidence-test-harness.d.ts.map +1 -0
  79. package/dist/coordinator-device-rejoin-link-evidence.d.ts +29 -0
  80. package/dist/coordinator-device-rejoin-link-evidence.d.ts.map +1 -0
  81. package/dist/coordinator-device-rejoin-link-lineage.d.ts +7 -0
  82. package/dist/coordinator-device-rejoin-link-lineage.d.ts.map +1 -0
  83. package/dist/coordinator-device-rejoin-oidc-pins.d.ts +14 -0
  84. package/dist/coordinator-device-rejoin-oidc-pins.d.ts.map +1 -0
  85. package/dist/coordinator-device-rejoin-proof.d.ts +41 -0
  86. package/dist/coordinator-device-rejoin-proof.d.ts.map +1 -0
  87. package/dist/coordinator-device-rejoin-schema-test-harness.d.ts +8 -0
  88. package/dist/coordinator-device-rejoin-schema-test-harness.d.ts.map +1 -0
  89. package/dist/coordinator-device-rejoin-schema.d.ts +9 -0
  90. package/dist/coordinator-device-rejoin-schema.d.ts.map +1 -0
  91. package/dist/coordinator-device-rejoin-start-evidence-test-harness.d.ts +40 -0
  92. package/dist/coordinator-device-rejoin-start-evidence-test-harness.d.ts.map +1 -0
  93. package/dist/coordinator-device-rejoin-start-evidence.d.ts +25 -0
  94. package/dist/coordinator-device-rejoin-start-evidence.d.ts.map +1 -0
  95. package/dist/coordinator-device-rejoin-start-http.d.ts +12 -0
  96. package/dist/coordinator-device-rejoin-start-http.d.ts.map +1 -0
  97. package/dist/coordinator-device-rejoin-start-input.d.ts +23 -0
  98. package/dist/coordinator-device-rejoin-start-input.d.ts.map +1 -0
  99. package/dist/coordinator-device-rejoin-start-write.d.ts +38 -0
  100. package/dist/coordinator-device-rejoin-start-write.d.ts.map +1 -0
  101. package/dist/coordinator-device-rejoin-status-http.d.ts +10 -0
  102. package/dist/coordinator-device-rejoin-status-http.d.ts.map +1 -0
  103. package/dist/coordinator-device-rejoin-status-live-test-harness.d.ts +33 -0
  104. package/dist/coordinator-device-rejoin-status-live-test-harness.d.ts.map +1 -0
  105. package/dist/coordinator-device-rejoin-status-projection.d.ts +28 -0
  106. package/dist/coordinator-device-rejoin-status-projection.d.ts.map +1 -0
  107. package/dist/coordinator-device-rejoin-status-test-harness.d.ts +8 -0
  108. package/dist/coordinator-device-rejoin-status-test-harness.d.ts.map +1 -0
  109. package/dist/coordinator-device-rejoin-status.d.ts +39 -0
  110. package/dist/coordinator-device-rejoin-status.d.ts.map +1 -0
  111. package/dist/coordinator-device-removal-commands.d.ts +13 -0
  112. package/dist/coordinator-device-removal-commands.d.ts.map +1 -0
  113. package/dist/coordinator-device-removal-commit-test-harness.d.ts +3 -0
  114. package/dist/coordinator-device-removal-commit-test-harness.d.ts.map +1 -0
  115. package/dist/coordinator-device-removal-commit.d.ts +44 -0
  116. package/dist/coordinator-device-removal-commit.d.ts.map +1 -0
  117. package/dist/coordinator-device-removal-dependents-test-harness.d.ts +9 -0
  118. package/dist/coordinator-device-removal-dependents-test-harness.d.ts.map +1 -0
  119. package/dist/coordinator-device-removal-dependents.d.ts +34 -0
  120. package/dist/coordinator-device-removal-dependents.d.ts.map +1 -0
  121. package/dist/coordinator-device-removal-list-test-harness.d.ts +4 -0
  122. package/dist/coordinator-device-removal-list-test-harness.d.ts.map +1 -0
  123. package/dist/coordinator-device-removal-list.d.ts +42 -0
  124. package/dist/coordinator-device-removal-list.d.ts.map +1 -0
  125. package/dist/coordinator-device-removal-preview-test-harness.d.ts +9 -0
  126. package/dist/coordinator-device-removal-preview-test-harness.d.ts.map +1 -0
  127. package/dist/coordinator-device-removal-routes.d.ts +13 -0
  128. package/dist/coordinator-device-removal-routes.d.ts.map +1 -0
  129. package/dist/coordinator-device-removal-target.d.ts +98 -0
  130. package/dist/coordinator-device-removal-target.d.ts.map +1 -0
  131. package/dist/coordinator-device-removal-test-harness.d.ts +70 -0
  132. package/dist/coordinator-device-removal-test-harness.d.ts.map +1 -0
  133. package/dist/coordinator-device-removal-writer-test-harness.d.ts +8 -0
  134. package/dist/coordinator-device-removal-writer-test-harness.d.ts.map +1 -0
  135. package/dist/coordinator-device-removal.d.ts +233 -0
  136. package/dist/coordinator-device-removal.d.ts.map +1 -0
  137. package/dist/coordinator-device-revocation-client.d.ts +2 -0
  138. package/dist/coordinator-device-revocation-client.d.ts.map +1 -1
  139. package/dist/coordinator-device-revocation-handler-test-harness.d.ts.map +1 -1
  140. package/dist/coordinator-device-revocation-handler.d.ts +1 -1
  141. package/dist/coordinator-device-revocation-handler.d.ts.map +1 -1
  142. package/dist/coordinator-device-revocation-route.d.ts.map +1 -1
  143. package/dist/coordinator-device-revocation-test-harness.d.ts.map +1 -1
  144. package/dist/coordinator-device-revocation.d.ts +20 -2
  145. package/dist/coordinator-device-revocation.d.ts.map +1 -1
  146. package/dist/coordinator-enrollment-reconciler.d.ts.map +1 -1
  147. package/dist/coordinator-enrollment-test-fixtures.d.ts +126 -0
  148. package/dist/coordinator-enrollment-test-fixtures.d.ts.map +1 -0
  149. package/dist/coordinator-history-sql-equivalence-test-fixtures.d.ts +1 -1
  150. package/dist/coordinator-history-sql-equivalence-test-fixtures.d.ts.map +1 -1
  151. package/dist/coordinator-identity-grant-revocation-test-harness.d.ts.map +1 -1
  152. package/dist/coordinator-identity-group-grant-test-harness.d.ts.map +1 -1
  153. package/dist/coordinator-invitation-lift-test-harness.d.ts +6 -0
  154. package/dist/coordinator-invitation-lift-test-harness.d.ts.map +1 -0
  155. package/dist/coordinator-invitation-removal.d.ts +71 -0
  156. package/dist/coordinator-invitation-removal.d.ts.map +1 -0
  157. package/dist/coordinator-join-review-guards.d.ts +2 -0
  158. package/dist/coordinator-join-review-guards.d.ts.map +1 -1
  159. package/dist/coordinator-join-revocation-test-harness.d.ts.map +1 -1
  160. package/dist/coordinator-key-id-fill-api-test-harness.d.ts +12 -0
  161. package/dist/coordinator-key-id-fill-api-test-harness.d.ts.map +1 -0
  162. package/dist/coordinator-key-id-fill-api.d.ts +19 -0
  163. package/dist/coordinator-key-id-fill-api.d.ts.map +1 -0
  164. package/dist/coordinator-legacy-device-ownership.d.ts +66 -5
  165. package/dist/coordinator-legacy-device-ownership.d.ts.map +1 -1
  166. package/dist/coordinator-legacy-owner-compatibility.d.ts +3 -0
  167. package/dist/coordinator-legacy-owner-compatibility.d.ts.map +1 -1
  168. package/dist/coordinator-membership-enrollment-test-harness.d.ts +4 -0
  169. package/dist/coordinator-membership-enrollment-test-harness.d.ts.map +1 -0
  170. package/dist/coordinator-membership-enrollment.d.ts +15 -0
  171. package/dist/coordinator-membership-enrollment.d.ts.map +1 -0
  172. package/dist/coordinator-owner-enrollment-commit.d.ts +1 -1
  173. package/dist/coordinator-owner-enrollment-commit.d.ts.map +1 -1
  174. package/dist/coordinator-owner-enrollment-qualification-test-harness.d.ts.map +1 -1
  175. package/dist/coordinator-owner-enrollment-qualification.d.ts +1 -0
  176. package/dist/coordinator-owner-enrollment-qualification.d.ts.map +1 -1
  177. package/dist/coordinator-owner-resolution-review-test-fixtures.d.ts.map +1 -1
  178. package/dist/coordinator-peer-discovery-revocation-test-harness.d.ts.map +1 -1
  179. package/dist/coordinator-peer-removal-api-test-harness.d.ts +29 -0
  180. package/dist/coordinator-peer-removal-api-test-harness.d.ts.map +1 -0
  181. package/dist/coordinator-peer-removal-query-test-harness.d.ts +4 -0
  182. package/dist/coordinator-peer-removal-query-test-harness.d.ts.map +1 -0
  183. package/dist/coordinator-peer-removal-query.d.ts +32 -0
  184. package/dist/coordinator-peer-removal-query.d.ts.map +1 -0
  185. package/dist/coordinator-peer-revocation-route.d.ts +45 -0
  186. package/dist/coordinator-peer-revocation-route.d.ts.map +1 -0
  187. package/dist/coordinator-peer-revocation.d.ts +61 -0
  188. package/dist/coordinator-peer-revocation.d.ts.map +1 -0
  189. package/dist/coordinator-presence-capabilities.d.ts +10 -0
  190. package/dist/coordinator-presence-capabilities.d.ts.map +1 -0
  191. package/dist/coordinator-project-revocation-test-harness.d.ts +1 -1
  192. package/dist/coordinator-project-revocation-test-harness.d.ts.map +1 -1
  193. package/dist/coordinator-recipient-revocation-test-harness.d.ts.map +1 -1
  194. package/dist/coordinator-refresh-lifecycle.d.ts +11 -0
  195. package/dist/coordinator-refresh-lifecycle.d.ts.map +1 -0
  196. package/dist/coordinator-rejoin-discovery.d.ts +16 -0
  197. package/dist/coordinator-rejoin-discovery.d.ts.map +1 -0
  198. package/dist/coordinator-rejoin-timestamp.d.ts +3 -0
  199. package/dist/coordinator-rejoin-timestamp.d.ts.map +1 -0
  200. package/dist/coordinator-removal-notice.d.ts +21 -0
  201. package/dist/coordinator-removal-notice.d.ts.map +1 -0
  202. package/dist/coordinator-removal-progress-listing-test-harness.d.ts +3 -0
  203. package/dist/coordinator-removal-progress-listing-test-harness.d.ts.map +1 -0
  204. package/dist/coordinator-runtime-ChgCIqfx.js +1716 -0
  205. package/dist/coordinator-runtime-ChgCIqfx.js.map +1 -0
  206. package/dist/coordinator-runtime.d.ts +20 -1
  207. package/dist/coordinator-runtime.d.ts.map +1 -1
  208. package/dist/coordinator-scope-authorization-api-test-harness.d.ts.map +1 -1
  209. package/dist/coordinator-store-contract.d.ts +21 -3
  210. package/dist/coordinator-store-contract.d.ts.map +1 -1
  211. package/dist/coordinator-store-test-harness.d.ts.map +1 -1
  212. package/dist/coordinator-sync-config.d.ts +14 -0
  213. package/dist/coordinator-sync-config.d.ts.map +1 -1
  214. package/dist/d1-coordinator-runtime.d.ts +3 -1
  215. package/dist/d1-coordinator-runtime.d.ts.map +1 -1
  216. package/dist/d1-coordinator-store.d.ts +63 -3
  217. package/dist/d1-coordinator-store.d.ts.map +1 -1
  218. package/dist/database-runtime-primitives.d.ts +1 -1
  219. package/dist/db.d.ts.map +1 -1
  220. package/dist/device-identity-binding.d.ts +24 -0
  221. package/dist/device-identity-binding.d.ts.map +1 -1
  222. package/dist/device-identity-inventory.d.ts +19 -1
  223. package/dist/device-identity-inventory.d.ts.map +1 -1
  224. package/dist/device-retirement.d.ts +43 -0
  225. package/dist/device-retirement.d.ts.map +1 -0
  226. package/dist/identity-device-assignment.d.ts +8 -0
  227. package/dist/identity-device-assignment.d.ts.map +1 -1
  228. package/dist/index.d.ts +34 -8
  229. package/dist/index.d.ts.map +1 -1
  230. package/dist/index.js +11908 -10664
  231. package/dist/index.js.map +1 -1
  232. package/dist/ingest-events.d.ts.map +1 -1
  233. package/dist/internal/cloudflare-coordinator.js +2317 -1542
  234. package/dist/internal/cloudflare-coordinator.js.map +1 -1
  235. package/dist/internal/relay-runtime.js +32 -32
  236. package/dist/legacy-pairing-assignment-conversion.d.ts +46 -0
  237. package/dist/legacy-pairing-assignment-conversion.d.ts.map +1 -0
  238. package/dist/legacy-pairing-assignment-state.d.ts +11 -0
  239. package/dist/legacy-pairing-assignment-state.d.ts.map +1 -0
  240. package/dist/legacy-team-setup-completion-manifest.d.ts +41 -0
  241. package/dist/legacy-team-setup-completion-manifest.d.ts.map +1 -1
  242. package/dist/legacy-team-setup-errors.d.ts +3 -2
  243. package/dist/legacy-team-setup-errors.d.ts.map +1 -1
  244. package/dist/local-origin-claim.d.ts +48 -0
  245. package/dist/local-origin-claim.d.ts.map +1 -0
  246. package/dist/maintenance/ai-structured.d.ts +2 -0
  247. package/dist/maintenance/ai-structured.d.ts.map +1 -1
  248. package/dist/observer-config.d.ts.map +1 -1
  249. package/dist/owned-recipient-d1-test-harness.d.ts.map +1 -1
  250. package/dist/owner-enrollment-link-authority.d.ts +1 -0
  251. package/dist/owner-enrollment-link-authority.d.ts.map +1 -1
  252. package/dist/{owner-enrollment-start-BsDwgxAh.js → owner-enrollment-start-CD7R8wy3.js} +5548 -3637
  253. package/dist/owner-enrollment-start-CD7R8wy3.js.map +1 -0
  254. package/dist/pairing-removal.d.ts +58 -0
  255. package/dist/pairing-removal.d.ts.map +1 -0
  256. package/dist/peer-project-filter-change.d.ts +33 -0
  257. package/dist/peer-project-filter-change.d.ts.map +1 -0
  258. package/dist/peer-project-filter-management.d.ts +7 -0
  259. package/dist/peer-project-filter-management.d.ts.map +1 -0
  260. package/dist/peer-project-filter-retention.d.ts +17 -0
  261. package/dist/peer-project-filter-retention.d.ts.map +1 -0
  262. package/dist/peer-removal-check-state.d.ts +24 -0
  263. package/dist/peer-removal-check-state.d.ts.map +1 -0
  264. package/dist/peer-removal.d.ts +34 -0
  265. package/dist/peer-removal.d.ts.map +1 -0
  266. package/dist/peer-traversal-coordinator-attempt-write-test-fixtures.d.ts.map +1 -1
  267. package/dist/peer-traversal-coordinator-decision-test-fixtures.d.ts.map +1 -1
  268. package/dist/pi-hooks.d.ts +1 -5
  269. package/dist/pi-hooks.d.ts.map +1 -1
  270. package/dist/policy-team-device-eligibility.d.ts +10 -0
  271. package/dist/policy-team-device-eligibility.d.ts.map +1 -1
  272. package/dist/project-boundary-migration-hold.d.ts +50 -0
  273. package/dist/project-boundary-migration-hold.d.ts.map +1 -0
  274. package/dist/project-boundary-migration-records.d.ts +46 -0
  275. package/dist/project-boundary-migration-records.d.ts.map +1 -0
  276. package/dist/project-filters-narrowing.d.ts +11 -0
  277. package/dist/project-filters-narrowing.d.ts.map +1 -0
  278. package/dist/project-scope-resume.d.ts +26 -0
  279. package/dist/project-scope-resume.d.ts.map +1 -0
  280. package/dist/project-scope-settings.d.ts +21 -1
  281. package/dist/project-scope-settings.d.ts.map +1 -1
  282. package/dist/project-scope-withdrawal.d.ts +48 -0
  283. package/dist/project-scope-withdrawal.d.ts.map +1 -0
  284. package/dist/project-withdrawal-state.d.ts +36 -0
  285. package/dist/project-withdrawal-state.d.ts.map +1 -0
  286. package/dist/raw-event-flush.d.ts.map +1 -1
  287. package/dist/{recipient-policy-contract-Ca40IBUh.js → recipient-policy-contract-BHxfaQZ2.js} +12 -5
  288. package/dist/recipient-policy-contract-BHxfaQZ2.js.map +1 -0
  289. package/dist/recipient-policy-contract.d.ts +7 -0
  290. package/dist/recipient-policy-contract.d.ts.map +1 -1
  291. package/dist/recipient-policy-contract.js +2 -2
  292. package/dist/recipient-policy-edges.d.ts.map +1 -1
  293. package/dist/recipient-policy-intent.d.ts +1 -0
  294. package/dist/recipient-policy-intent.d.ts.map +1 -1
  295. package/dist/recipient-policy-onboarding.d.ts.map +1 -1
  296. package/dist/recipient-policy-reconciler.d.ts.map +1 -1
  297. package/dist/recipient-policy-reconciliation.d.ts.map +1 -1
  298. package/dist/recipient-policy-team-create.d.ts +22 -0
  299. package/dist/recipient-policy-team-create.d.ts.map +1 -0
  300. package/dist/{relay-health-CeyhVeuq.js → relay-health-B8BpHFaE.js} +14 -14
  301. package/dist/{relay-health-CeyhVeuq.js.map → relay-health-B8BpHFaE.js.map} +1 -1
  302. package/dist/{relay-peer-client-DmZfZebO.js → relay-peer-client-CrFrhN_q.js} +3140 -2687
  303. package/dist/relay-peer-client-CrFrhN_q.js.map +1 -0
  304. package/dist/relay-server-test-fixtures.d.ts.map +1 -1
  305. package/dist/removed-device-local-ids.d.ts +16 -0
  306. package/dist/removed-device-local-ids.d.ts.map +1 -0
  307. package/dist/replication-cursor-orphan-cleanup.d.ts +14 -0
  308. package/dist/replication-cursor-orphan-cleanup.d.ts.map +1 -0
  309. package/dist/retired-device-aliases.d.ts +28 -0
  310. package/dist/retired-device-aliases.d.ts.map +1 -0
  311. package/dist/same-actor-peers.d.ts +5 -1
  312. package/dist/same-actor-peers.d.ts.map +1 -1
  313. package/dist/schema-bootstrap.d.ts +1 -0
  314. package/dist/schema-bootstrap.d.ts.map +1 -1
  315. package/dist/schema.d.ts +4456 -3623
  316. package/dist/schema.d.ts.map +1 -1
  317. package/dist/scope-membership-cache-read.d.ts +28 -1
  318. package/dist/scope-membership-cache-read.d.ts.map +1 -1
  319. package/dist/scope-membership-cache-test-fixtures.d.ts +1 -0
  320. package/dist/scope-membership-cache-test-fixtures.d.ts.map +1 -1
  321. package/dist/scope-membership-cache.d.ts +1 -1
  322. package/dist/scope-membership-cache.d.ts.map +1 -1
  323. package/dist/scope-membership-evidence.d.ts +17 -1
  324. package/dist/scope-membership-evidence.d.ts.map +1 -1
  325. package/dist/{scope-membership-cache-read-B6z47l2W.js → scope-resolution-DXzf4k16.js} +2287 -1613
  326. package/dist/scope-resolution-DXzf4k16.js.map +1 -0
  327. package/dist/semantic-worker-entry.js +1 -1
  328. package/dist/{semantic-worker-job-BLaC4xRY.js → semantic-worker-job-DjfAtX64.js} +3 -3
  329. package/dist/{semantic-worker-job-BLaC4xRY.js.map → semantic-worker-job-DjfAtX64.js.map} +1 -1
  330. package/dist/{semantic-worker-ranking-5-VSzEmx.js → semantic-worker-ranking-CZCemeb4.js} +59 -53
  331. package/dist/semantic-worker-ranking-CZCemeb4.js.map +1 -0
  332. package/dist/share-provisioning.d.ts +4 -0
  333. package/dist/share-provisioning.d.ts.map +1 -1
  334. package/dist/shared-owned-device-enrollment-test-harness.d.ts.map +1 -1
  335. package/dist/shared-owned-project-invites-test-harness.d.ts.map +1 -1
  336. package/dist/shared-owned-recipient-invites-test-harness.d.ts.map +1 -1
  337. package/dist/shared-ownership-writer-lifecycle-test-harness.d.ts.map +1 -1
  338. package/dist/snapshot-cross-scope-reconcile.d.ts +25 -0
  339. package/dist/snapshot-cross-scope-reconcile.d.ts.map +1 -0
  340. package/dist/{sync-auth-constants-BVzVfSmn.js → sync-auth-constants-CifCg69d.js} +4484 -2842
  341. package/dist/sync-auth-constants-CifCg69d.js.map +1 -0
  342. package/dist/sync-bootstrap.d.ts +2 -0
  343. package/dist/sync-bootstrap.d.ts.map +1 -1
  344. package/dist/sync-capability.d.ts +1 -1
  345. package/dist/sync-capability.d.ts.map +1 -1
  346. package/dist/sync-channel-pass.d.ts.map +1 -1
  347. package/dist/sync-channel-progress.d.ts +7 -0
  348. package/dist/sync-channel-progress.d.ts.map +1 -1
  349. package/dist/sync-daemon.d.ts +4 -1
  350. package/dist/sync-daemon.d.ts.map +1 -1
  351. package/dist/sync-pass.d.ts +2 -0
  352. package/dist/sync-pass.d.ts.map +1 -1
  353. package/dist/sync-peer-addresses.d.ts +4 -2
  354. package/dist/sync-peer-addresses.d.ts.map +1 -1
  355. package/dist/sync-reachability-pass-BFTEIkZH.js +2 -0
  356. package/dist/{sync-reachability-pass-Dhn4N2hr.js → sync-reachability-pass-vOvswNNG.js} +3219 -3025
  357. package/dist/sync-reachability-pass-vOvswNNG.js.map +1 -0
  358. package/dist/sync-replication.d.ts +26 -3
  359. package/dist/sync-replication.d.ts.map +1 -1
  360. package/dist/sync-scope-protocol.d.ts.map +1 -1
  361. package/dist/sync-status-test-fixtures.d.ts +1 -1
  362. package/dist/sync-status-test-fixtures.d.ts.map +1 -1
  363. package/dist/test-environment-isolation.d.ts +2 -0
  364. package/dist/test-environment-isolation.d.ts.map +1 -0
  365. package/dist/test-schema.generated.d.ts +1 -1
  366. package/dist/test-schema.generated.d.ts.map +1 -1
  367. package/dist/test-utils.d.ts +7 -0
  368. package/dist/test-utils.d.ts.map +1 -1
  369. package/dist/{validated-vector-index-audit-B64yhEBF.js → validated-vector-index-audit-CFSIbYIn.js} +255 -623
  370. package/dist/validated-vector-index-audit-CFSIbYIn.js.map +1 -0
  371. package/dist/viewer-device-removal-commit.d.ts +56 -0
  372. package/dist/viewer-device-removal-commit.d.ts.map +1 -0
  373. package/dist/viewer-device-removal-evidence.d.ts +17 -0
  374. package/dist/viewer-device-removal-evidence.d.ts.map +1 -0
  375. package/dist/{scope-membership-semantics-B8qXaMqx.js → workspace-identity-C7EPmSZe.js} +121 -49
  376. package/dist/workspace-identity-C7EPmSZe.js.map +1 -0
  377. package/package.json +3 -3
  378. package/dist/coordinator-runtime-CEc6KhBE.js +0 -594
  379. package/dist/coordinator-runtime-CEc6KhBE.js.map +0 -1
  380. package/dist/owner-enrollment-start-BsDwgxAh.js.map +0 -1
  381. package/dist/recipient-policy-contract-Ca40IBUh.js.map +0 -1
  382. package/dist/relay-peer-client-DmZfZebO.js.map +0 -1
  383. package/dist/scope-membership-cache-read-B6z47l2W.js.map +0 -1
  384. package/dist/scope-membership-semantics-B8qXaMqx.js.map +0 -1
  385. package/dist/semantic-worker-ranking-5-VSzEmx.js.map +0 -1
  386. package/dist/sync-auth-constants-BVzVfSmn.js.map +0 -1
  387. package/dist/sync-reachability-pass-C_-w0t6b.js +0 -2
  388. package/dist/sync-reachability-pass-Dhn4N2hr.js.map +0 -1
  389. package/dist/validated-vector-index-audit-B64yhEBF.js.map +0 -1
  390. package/dist/workspace-identity-DI8bBR0Y.js +0 -76
  391. package/dist/workspace-identity-DI8bBR0Y.js.map +0 -1
@@ -0,0 +1,58 @@
1
+ import type { Database } from "./db.js";
2
+ import { recordRetiredDeviceAliases } from "./retired-device-aliases.js";
3
+ export type RetiredDeviceAliasRecord = Parameters<typeof recordRetiredDeviceAliases>[1][number];
4
+ /** A coordinator-policy pairing, named by the discovery fields its cleanup requires. */
5
+ export interface PolicyPairing {
6
+ deviceId: string;
7
+ coordinatorId: string;
8
+ groupId: string;
9
+ }
10
+ export type PairingRemoval =
11
+ /** The coordinator removed the device, or this device removed it locally. It may pair again. */
12
+ {
13
+ reason: "removed" | "local";
14
+ deviceIds: string[];
15
+ }
16
+ /**
17
+ * This device withdrew its own connection to the device. The binding stays active,
18
+ * because this device may not change the other device's access.
19
+ */
20
+ | {
21
+ reason: "disconnect";
22
+ deviceIds: string[];
23
+ }
24
+ /**
25
+ * The coordinator blocked the device. Without `retiredAliases`, each validated
26
+ * pinned key is recorded as a key-only alias.
27
+ */
28
+ | {
29
+ reason: "revoked";
30
+ deviceIds: string[];
31
+ retiredAliases?: RetiredDeviceAliasRecord[];
32
+ }
33
+ /** A coordinator-policy pairing lost its last shared Project. Its binding stays active. */
34
+ | {
35
+ reason: "policy";
36
+ pairings: PolicyPairing[];
37
+ };
38
+ /** Rows changed in each table. */
39
+ export interface PairingRemovalCounts {
40
+ syncPeers: number;
41
+ replicationCursors: number;
42
+ replicationCursorsV2: number;
43
+ syncChannelProgress: number;
44
+ /** Bindings whose status changed from `active` to `removed`. */
45
+ identityDevices: number;
46
+ }
47
+ export type PairingRemovalInput = PairingRemoval & {
48
+ localDeviceId: string;
49
+ };
50
+ /**
51
+ * Removes each device's pairing and sync progress, and ends its Identity binding
52
+ * and cached scope authorization unless the reason is `disconnect` or `policy`.
53
+ * Memory retirement trust is retained first, and
54
+ * `sync_attempts` and `sync_scope_rejections` stay as diagnostic history. One
55
+ * immediate transaction: any failure leaves every table unchanged.
56
+ */
57
+ export declare function removePairingState(db: Database, input: PairingRemovalInput): PairingRemovalCounts;
58
+ //# sourceMappingURL=pairing-removal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pairing-removal.d.ts","sourceRoot":"","sources":["../src/pairing-removal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGxC,OAAO,EAAkB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2
+ import type { Database } from "./db.js";
3
+ export { type PeerProjectFilters, peerProjectFiltersOnlyNarrow, } from "./project-filters-narrowing.js";
4
+ export declare function readPeerProjectFilterAuthority(db: Database): boolean;
5
+ /**
6
+ * Whether replacement lists would exceed a removed pairing's retained filters,
7
+ * or the shared defaults when none were retained. NULL lists restore retained
8
+ * restrictions through the insert trigger, or inherit the shared defaults.
9
+ */
10
+ export declare function newPairingFiltersNeedAdmin(db: Database, own: {
11
+ peerDeviceId: string;
12
+ include: string[] | null;
13
+ exclude: string[] | null;
14
+ }): boolean;
15
+ /** Null for both lists removes the pairing's own filters, so it inherits the shared ones. */
16
+ export interface PeerProjectFilterLists {
17
+ include: string[] | null;
18
+ exclude: string[] | null;
19
+ }
20
+ export interface SetPeerProjectFilterCheckedOptions extends PeerProjectFilterLists {
21
+ readConfig?: typeof readCoordinatorSyncConfig;
22
+ }
23
+ export type SetPeerProjectFilterResult = "saved" | "needs_admin_device";
24
+ /** Whether storing `lists` for a pairing sends it nothing that its filters in effect hold back. */
25
+ export declare function peerProjectFilterChangeOnlyNarrows(db: Database, peerDeviceId: string, lists: PeerProjectFilterLists): boolean;
26
+ /**
27
+ * Replaces a pairing's Project filters. A device that may not widen is refused
28
+ * when the new filters would send anything the filters in effect hold back.
29
+ * The comparison and the write share one write transaction, so another save
30
+ * cannot land between them.
31
+ */
32
+ export declare function setPeerProjectFilterChecked(db: Database, peerDeviceId: string, options: SetPeerProjectFilterCheckedOptions): SetPeerProjectFilterResult;
33
+ //# sourceMappingURL=peer-project-filter-change.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"peer-project-filter-change.d.ts","sourceRoot":"","sources":["../src/peer-project-filter-change.ts"],"names":[],"mappings":"AACA,OAAO,EAA4B,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AACnG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAUxC,OAAO,EACN,KAAK,kBAAkB,EACvB,4BAA4B,GAC5B,MAAM,gCAAgC,CAAC;AA0CxC,wBAAgB,8BAA8B,CAAC,EAAE,EAAE,QAAQ,GAAG,OAAO,CAGpE;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CACzC,EAAE,EAAE,QAAQ,EACZ,GAAG,EAAE;IACJ,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;CACzB,GACC,OAAO,CAST;AAED,6FAA6F;AAC7F,MAAM,WAAW,sBAAsB;IACtC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,kCAAmC,SAAQ,sBAAsB;IACjF,UAAU,CAAC,EAAE,OAAO,yBAAyB,CAAC;CAC9C;AAED,MAAM,MAAM,0BAA0B,GAAG,OAAO,GAAG,oBAAoB,CAAC;AA0BxE,mGAAmG;AACnG,wBAAgB,kCAAkC,CACjD,EAAE,EAAE,QAAQ,EACZ,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,sBAAsB,GAC3B,OAAO,CAGT;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAC1C,EAAE,EAAE,QAAQ,EACZ,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,kCAAkC,GACzC,0BAA0B,CAgB5B"}
@@ -0,0 +1,7 @@
1
+ import type { Database } from "better-sqlite3";
2
+ export declare function ensurePeerProjectFilterManagementSchema(db: Database): void;
3
+ /** Preserve this store's filter policy before its configured coordinator URL is cleared. */
4
+ export declare function rememberPeerProjectFilterManagement(db: Database): void;
5
+ /** A store that disconnected before the marker existed may still have coordinator history. */
6
+ export declare function hasPeerProjectFilterManagement(db: Database): boolean;
7
+ //# sourceMappingURL=peer-project-filter-management.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"peer-project-filter-management.d.ts","sourceRoot":"","sources":["../src/peer-project-filter-management.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,wBAAgB,uCAAuC,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI,CAa1E;AAED,4FAA4F;AAC5F,wBAAgB,mCAAmC,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI,CAItE;AAED,8FAA8F;AAC9F,wBAAgB,8BAA8B,CAAC,EAAE,EAAE,QAAQ,GAAG,OAAO,CAWpE"}
@@ -0,0 +1,17 @@
1
+ import type { Database } from "better-sqlite3";
2
+ /**
3
+ * Independent of pairing and Identity lifetime. Removing a connection must not
4
+ * turn its Project restrictions into unrestricted inheritance on recreation.
5
+ * Explicit replacement lists still require the normal filter authorization.
6
+ */
7
+ export declare const PEER_PROJECT_FILTER_RETENTION_SCHEMA_SQL = "\nCREATE TABLE IF NOT EXISTS peer_project_filter_retention (\n\tpeer_device_id TEXT PRIMARY KEY NOT NULL,\n\tprojects_include_json TEXT,\n\tprojects_exclude_json TEXT\n);\n\nCREATE TRIGGER IF NOT EXISTS peer_project_filters_retain_before_delete\nBEFORE DELETE ON sync_peers\nBEGIN\n\tINSERT INTO peer_project_filter_retention (\n\t\tpeer_device_id, projects_include_json, projects_exclude_json\n\t) VALUES (OLD.peer_device_id, OLD.projects_include_json, OLD.projects_exclude_json)\n\tON CONFLICT(peer_device_id) DO UPDATE SET\n\t\tprojects_include_json = excluded.projects_include_json,\n\t\tprojects_exclude_json = excluded.projects_exclude_json;\nEND;\n\nCREATE TRIGGER IF NOT EXISTS peer_project_filters_restore_after_insert\nAFTER INSERT ON sync_peers\nWHEN NEW.projects_include_json IS NULL AND NEW.projects_exclude_json IS NULL\nBEGIN\n\tUPDATE sync_peers SET\n\t\tprojects_include_json = (\n\t\t\tSELECT projects_include_json FROM peer_project_filter_retention\n\t\t\tWHERE peer_device_id = NEW.peer_device_id\n\t\t),\n\t\tprojects_exclude_json = (\n\t\t\tSELECT projects_exclude_json FROM peer_project_filter_retention\n\t\t\tWHERE peer_device_id = NEW.peer_device_id\n\t\t)\n\tWHERE peer_device_id = NEW.peer_device_id\n\t\tAND EXISTS (\n\t\t\tSELECT 1 FROM peer_project_filter_retention WHERE peer_device_id = NEW.peer_device_id\n\t\t);\nEND;\n";
8
+ export declare const PEER_PROJECT_FILTER_RETENTION_TRIGGER_NAMES: readonly ["peer_project_filters_retain_before_delete", "peer_project_filters_restore_after_insert"];
9
+ /** Normal additive initialization only. Readers and pairing writers never create storage. */
10
+ export declare function ensurePeerProjectFilterRetentionSchema(db: Database): void;
11
+ export interface RetainedPeerProjectFilters {
12
+ projects_include_json: string | null;
13
+ projects_exclude_json: string | null;
14
+ }
15
+ /** A removed pairing's last lists, or null when none were retained on this store. */
16
+ export declare function readRetainedPeerProjectFilters(db: Database, peerDeviceId: string): RetainedPeerProjectFilters | null;
17
+ //# sourceMappingURL=peer-project-filter-retention.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"peer-project-filter-retention.d.ts","sourceRoot":"","sources":["../src/peer-project-filter-retention.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C;;;;GAIG;AACH,eAAO,MAAM,wCAAwC,+0CAoCpD,CAAC;AAEF,eAAO,MAAM,2CAA2C,YACvD,2CAA2C,EAC3C,2CAA2C,CAClC,CAAC;AAEX,6FAA6F;AAC7F,wBAAgB,sCAAsC,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI,CAkBzE;AAED,MAAM,WAAW,0BAA0B;IAC1C,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;AAED,qFAAqF;AACrF,wBAAgB,8BAA8B,CAC7C,EAAE,EAAE,QAAQ,EACZ,YAAY,EAAE,MAAM,GAClB,0BAA0B,GAAG,IAAI,CAenC"}
@@ -0,0 +1,24 @@
1
+ import type { Database } from "./db.js";
2
+ export interface PeerRemovalCheckState {
3
+ generation: number;
4
+ appliedRemovalSeq: number;
5
+ }
6
+ /**
7
+ * The stored state, or null when the table, its row, or any trigger is missing.
8
+ * Without every trigger the counter cannot vouch for the stored number.
9
+ */
10
+ export declare function readPeerRemovalCheckState(db: Database): PeerRemovalCheckState | null;
11
+ /** Installs the state row and the triggers. Later opens only read `sqlite_schema`. */
12
+ export declare function ensurePeerRemovalCheckState(db: Database): void;
13
+ /** The number to advertise in presence. 0 until a complete lookup has covered every current entry. */
14
+ export declare function readAppliedRemovalSeq(db: Database): number;
15
+ /**
16
+ * Stores a complete lookup's number, only while the counter still has the value
17
+ * the lookup read with its entries. One statement, so no write can slip between
18
+ * the comparison and the store. Returns whether it stored.
19
+ */
20
+ export declare function storeAppliedRemovalSeq(db: Database, lookup: {
21
+ generation: number;
22
+ removalSeq: number;
23
+ }): boolean;
24
+ //# sourceMappingURL=peer-removal-check-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"peer-removal-check-state.d.ts","sourceRoot":"","sources":["../src/peer-removal-check-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AA0CxC,MAAM,WAAW,qBAAqB;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;CAC1B;AAgBD;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,EAAE,EAAE,QAAQ,GAAG,qBAAqB,GAAG,IAAI,CASpF;AAED,sFAAsF;AACtF,wBAAgB,2BAA2B,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI,CAiB9D;AAED,sGAAsG;AACtG,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,QAAQ,GAAG,MAAM,CAE1D;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACrC,EAAE,EAAE,QAAQ,EACZ,MAAM,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAChD,OAAO,CAOT"}
@@ -0,0 +1,34 @@
1
+ import { type CoordinatorSyncConfig } from "./coordinator-sync-config.js";
2
+ import type { Database } from "./db.js";
3
+ import { type PairingRemovalCounts } from "./pairing-removal.js";
4
+ /** What the coordinator says about a device. `unknown` covers every case without an answer. */
5
+ export type CoordinatorDeviceAnswer = "removed" | "revoked" | "not_enrolled" | "enrolled" | "unknown";
6
+ export type CoordinatorDeviceAnswerLookup = (deviceId: string) => Promise<CoordinatorDeviceAnswer>;
7
+ /** Nothing asks the coordinator about a single device yet, so there is no answer. */
8
+ export declare const noCoordinatorDeviceAnswer: CoordinatorDeviceAnswerLookup;
9
+ export type PeerBindingOutcome = "ended" | "kept";
10
+ export interface PeerBindingDecisionInput {
11
+ /** This device is ready and holds the coordinator admin secret. */
12
+ isAdminDevice: boolean;
13
+ coordinatorConfigured: boolean;
14
+ coordinatorAnswer: CoordinatorDeviceAnswer;
15
+ }
16
+ /** Whether disconnecting also ends the other device's binding under ADR 0007 Decision 4. */
17
+ export declare function decidePeerBinding(input: PeerBindingDecisionInput): PeerBindingOutcome;
18
+ export interface PeerRemovalOptions {
19
+ localDeviceId: string;
20
+ peerDeviceId: string;
21
+ readConfig?: () => CoordinatorSyncConfig;
22
+ lookupCoordinatorAnswer?: CoordinatorDeviceAnswerLookup;
23
+ }
24
+ export interface PeerRemovalResult {
25
+ binding: PeerBindingOutcome;
26
+ removed: PairingRemovalCounts;
27
+ }
28
+ /**
29
+ * Deletes this device's pairing with the peer and its sync progress, and ends the
30
+ * peer's Identity binding only when `decidePeerBinding` allows it. One transaction:
31
+ * a failure leaves every table unchanged.
32
+ */
33
+ export declare function removePeerFromThisDevice(db: Database, options: PeerRemovalOptions): Promise<PeerRemovalResult>;
34
+ //# sourceMappingURL=peer-removal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"peer-removal.d.ts","sourceRoot":"","sources":["../src/peer-removal.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,qBAAqB,EAI1B,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,OAAO,EAAE,KAAK,oBAAoB,EAAsB,MAAM,sBAAsB,CAAC;AAErF,+FAA+F;AAC/F,MAAM,MAAM,uBAAuB,GAChC,SAAS,GACT,SAAS,GACT,cAAc,GACd,UAAU,GACV,SAAS,CAAC;AAEb,MAAM,MAAM,6BAA6B,GAAG,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,uBAAuB,CAAC,CAAC;AAEnG,qFAAqF;AACrF,eAAO,MAAM,yBAAyB,EAAE,6BAAqD,CAAC;AAE9F,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,MAAM,CAAC;AAElD,MAAM,WAAW,wBAAwB;IACxC,mEAAmE;IACnE,aAAa,EAAE,OAAO,CAAC;IACvB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,iBAAiB,EAAE,uBAAuB,CAAC;CAC3C;AASD,4FAA4F;AAC5F,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,wBAAwB,GAAG,kBAAkB,CAKrF;AAED,MAAM,WAAW,kBAAkB;IAClC,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,qBAAqB,CAAC;IACzC,uBAAuB,CAAC,EAAE,6BAA6B,CAAC;CACxD;AAED,MAAM,WAAW,iBAAiB;IACjC,OAAO,EAAE,kBAAkB,CAAC;IAC5B,OAAO,EAAE,oBAAoB,CAAC;CAC9B;AAqCD;;;;GAIG;AACH,wBAAsB,wBAAwB,CAC7C,EAAE,EAAE,QAAQ,EACZ,OAAO,EAAE,kBAAkB,GACzB,OAAO,CAAC,iBAAiB,CAAC,CAkB5B"}
@@ -1 +1 @@
1
- {"version":3,"file":"peer-traversal-coordinator-attempt-write-test-fixtures.d.ts","sourceRoot":"","sources":["../src/peer-traversal-coordinator-attempt-write-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EAAE,MAAM,QAcpD"}
1
+ {"version":3,"file":"peer-traversal-coordinator-attempt-write-test-fixtures.d.ts","sourceRoot":"","sources":["../src/peer-traversal-coordinator-attempt-write-test-fixtures.ts"],"names":[],"mappings":"AAKA,OAAO,EACN,4BAA4B,EAC5B,4BAA4B,EAE5B,KAAK,2BAA2B,EAChC,KAAK,6BAA6B,EAClC,MAAM,+CAA+C,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6DAA6D,CAAC;AAElG,OAAO,EAEN,KAAK,mBAAmB,EACxB,MAAM,kCAAkC,CAAC;AAY1C,MAAM,WAAW,aAAc,SAAQ,cAAc;IACpD,SAAS,CAAC,SAAS,EAAE,6BAA6B,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACtE;AACD,MAAM,WAAW,gBAAgB;IAChC,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,iBAAiB,GAAG,aAAa,CAAC;IAC9D,SAAS,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;IACnC,UAAU,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;IACpC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;CACvB;AAyDD,gGAAgG;AAChG,wBAAsB,YAAY,CACjC,EAAE,EAAE,aAAa,EACjB,GAAG,EAAE,MAAM,EACX,EAAE,EAAE,MAAM,EACV,IAAI,GAAE,gBAAqB;;;;;;;;;;;;;kBA2CN,mBAAmB,UAAU,MAAM;sBArC/B,MAAM;;;;;;;;;;;;;GAkD/B;AACD,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC;AACpE,KAAK,MAAM,GAAG,CAAC,OAAO,CAAC,EAAE,gBAAgB,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;AA6BpE,eAAO,MAAM,QAAQ,sBACnB,OAAO,kDACP,OAAO,uCACC,CAAC;AACX,wBAAsB,aAAa,CAAC,CAAC,EAAE,YAAY;;;GAKlD;AAyBD,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,QAcpD"}
@@ -1 +1 @@
1
- {"version":3,"file":"peer-traversal-coordinator-decision-test-fixtures.d.ts","sourceRoot":"","sources":["../src/peer-traversal-coordinator-decision-test-fixtures.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,YAAY,EACZ,gBAAgB,EAChB,MAAM,6DAA6D,CAAC;AACrE,OAAO,EAGN,KAAK,8BAA8B,EACnC,KAAK,gCAAgC,EACrC,KAAK,iCAAiC,EACtC,MAAM,0CAA0C,CAAC;AAIlD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAIhF,MAAM,MAAM,QAAQ,GAAG,SAAS,CAAC,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;AAC3D,KAAK,MAAM,GAAG,CAAC,OAAO,CAAC,EAAE,gBAAgB,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;AACpE,wBAAgB,eAAe,CAC9B,CAAC,EAAE,YAAY,EACf,KAAK,0EAAkB,GACrB,8BAA8B,CAShC;AACD,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAI9D;AACD,eAAO,MAAM,UAAU,QAAS,MAAM,YAAsD,CAAC;AAC7F,wBAAgB,eAAe,CAAC,CAAC,EAAE,YAAY;;;+CAGd,MAAM,YAAY,QAAQ,KAAG,OAAO,CAAC,OAAO,CAAC;wDAIpC,MAAM,YAAY,QAAQ,KAAG,OAAO,CAAC,OAAO,CAAC;;;iEAUtE,iCAAiC,KAC7C,OAAO,CAAC,0BAA0B,CAAC;wEAMjB,gCAAgC,KAAG,OAAO,CAAC,0BAA0B,CAAC;;;;;cAtBtE,MAAM;aAAO,OAAO;;EAgC1C;AACD,eAAO,MAAM,SAAS,MAAO,YAAY,2GACyC,CAAC;AACnF,eAAO,MAAM,SAAS,MAAO,YAAY,2GAItC,CAAC;AAEJ,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,QAcvD"}
1
+ {"version":3,"file":"peer-traversal-coordinator-decision-test-fixtures.d.ts","sourceRoot":"","sources":["../src/peer-traversal-coordinator-decision-test-fixtures.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACX,YAAY,EACZ,gBAAgB,EAChB,MAAM,6DAA6D,CAAC;AACrE,OAAO,EAGN,KAAK,8BAA8B,EACnC,KAAK,gCAAgC,EACrC,KAAK,iCAAiC,EACtC,MAAM,0CAA0C,CAAC;AAIlD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAIhF,MAAM,MAAM,QAAQ,GAAG,SAAS,CAAC,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;AAC3D,KAAK,MAAM,GAAG,CAAC,OAAO,CAAC,EAAE,gBAAgB,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;AACpE,wBAAgB,eAAe,CAC9B,CAAC,EAAE,YAAY,EACf,KAAK,0EAAkB,GACrB,8BAA8B,CAShC;AACD,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAI9D;AACD,eAAO,MAAM,UAAU,QAAS,MAAM,YAAsD,CAAC;AAC7F,wBAAgB,eAAe,CAAC,CAAC,EAAE,YAAY;;;+CAGd,MAAM,YAAY,QAAQ,KAAG,OAAO,CAAC,OAAO,CAAC;wDAIpC,MAAM,YAAY,QAAQ,KAAG,OAAO,CAAC,OAAO,CAAC;;;iEAUtE,iCAAiC,KAC7C,OAAO,CAAC,0BAA0B,CAAC;wEAMjB,gCAAgC,KAAG,OAAO,CAAC,0BAA0B,CAAC;;;;;cAtBtE,MAAM;aAAO,OAAO;;EAgC1C;AACD,eAAO,MAAM,SAAS,MAAO,YAAY,2GACyC,CAAC;AACnF,eAAO,MAAM,SAAS,MAAO,YAAY,2GAItC,CAAC;AAEJ,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,QAcvD"}
@@ -32,11 +32,7 @@ export interface PiHookAdapterEvent {
32
32
  payload: Record<string, unknown>;
33
33
  meta: Record<string, unknown>;
34
34
  }
35
- /**
36
- * Map a pi extension event payload to a normalized AdapterEvent v1.
37
- * Returns null if the event type is unsupported, flush-only, or required
38
- * fields are missing.
39
- */
35
+ /** Map supported Pi events with the required fields to AdapterEvent v1. */
40
36
  export declare function mapPiEventPayload(payload: Record<string, unknown>): PiHookAdapterEvent | null;
41
37
  export interface PiFlushSignal {
42
38
  kind: "flush";
@@ -1 +1 @@
1
- {"version":3,"file":"pi-hooks.d.ts","sourceRoot":"","sources":["../src/pi-hooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAUH,wEAAwE;AACxE,eAAO,MAAM,kBAAkB,aAO7B,CAAC;AAEH,6EAA6E;AAC7E,eAAO,MAAM,oBAAoB,aAAsC,CAAC;AAExE,qEAAqE;AACrE,eAAO,MAAM,gBAAgB,SAAS,CAAC;AAiFvC,MAAM,WAAW,kBAAkB;IAClC,cAAc,EAAE,KAAK,CAAC;IACtB,MAAM,EAAE,IAAI,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,mBAAmB,EAAE,KAAK,CAAC;IAC3B,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC9B;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,kBAA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MAAM,EAAE,IAAI,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,SAAS,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED;;;;GAIG;AACH,wBAAgB,gCAAgC,CAC/C,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,sBAAsB,GAAG,IAAI,CAiC/B;AAMD;;;;GAIG;AACH,wBAAgB,6BAA6B,CAC5C,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAsBhC"}
@@ -46,6 +46,16 @@ export interface BlockedPolicyTeamDeviceEligibilityResult {
46
46
  blocked: [PolicyTeamDeviceEligibilityBlock, ...PolicyTeamDeviceEligibilityBlock[]];
47
47
  }
48
48
  export type PolicyTeamDeviceEligibilityResult = EligiblePolicyTeamDeviceEligibilityResult | BlockedPolicyTeamDeviceEligibilityResult;
49
+ /**
50
+ * A deactivated or merged Identity has withdrawn from sharing. It contributes no
51
+ * devices to any Team or Project, so its devices lose access instead of the whole
52
+ * policy stalling. A merged Identity's access never passes to the survivor through
53
+ * a leftover edge or membership; the merge itself moves those to the survivor.
54
+ */
55
+ export declare function isWithdrawnPolicyIdentity(identity: {
56
+ status: string;
57
+ mergedIntoIdentityId?: string | null;
58
+ } | undefined): boolean;
49
59
  export declare function isPolicyTeamMembershipActiveForMode(mode: string, status: string): boolean;
50
60
  export declare function derivePolicyTeamDeviceEligibility(input: DerivePolicyTeamDeviceEligibilityInput): PolicyTeamDeviceEligibilityResult;
51
61
  //# sourceMappingURL=policy-team-device-eligibility.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"policy-team-device-eligibility.d.ts","sourceRoot":"","sources":["../src/policy-team-device-eligibility.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oCAAoC,YAChD,oBAAoB,EACpB,oBAAoB,CACX,CAAC;AAEX,MAAM,MAAM,+BAA+B,GAAG,CAAC,OAAO,oCAAoC,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpG,eAAO,MAAM,4BAA4B,YAAI,UAAU,EAAE,UAAU,EAAE,YAAY,CAAU,CAAC;AAE5F,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,4BAA4B,CAAC,CAAC,MAAM,CAAC,CAAC;AAErF,MAAM,MAAM,oCAAoC,GAC7C,sCAAsC,GACtC,8BAA8B,GAC9B,yBAAyB,GACzB,8BAA8B,GAC9B,8BAA8B,GAC9B,iCAAiC,GACjC,6BAA6B,GAC7B,yBAAyB,CAAC;AAE7B,MAAM,WAAW,mCAAmC;IACnD,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC;AAED,MAAM,WAAW,qCAAqC;IACrD,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,iCAAiC;IACjD,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,mCAAmC;IACnD,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,iBAAiB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,sCAAsC;IACtD,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,qCAAqC,EAAE,CAAC;IACrD,UAAU,EAAE,mCAAmC,EAAE,CAAC;IAClD,OAAO,EAAE,iCAAiC,EAAE,CAAC;IAC7C,SAAS,EAAE,mCAAmC,EAAE,CAAC;CACjD;AAED,MAAM,WAAW,gCAAgC;IAChD,IAAI,EAAE,oCAAoC,CAAC;IAC3C,WAAW,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,yCAAyC;IACzD,MAAM,EAAE,UAAU,CAAC;IACnB,uBAAuB,EAAE,MAAM,EAAE,CAAC;IAClC,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,OAAO,EAAE,EAAE,CAAC;CACZ;AAED,MAAM,WAAW,wCAAwC;IACxD,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,EAAE,CAAC,gCAAgC,EAAE,GAAG,gCAAgC,EAAE,CAAC,CAAC;CACnF;AAED,MAAM,MAAM,iCAAiC,GAC1C,yCAAyC,GACzC,wCAAwC,CAAC;AAuB5C,wBAAgB,mCAAmC,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAKzF;AA0CD,wBAAgB,iCAAiC,CAChD,KAAK,EAAE,sCAAsC,GAC3C,iCAAiC,CA2EnC"}
1
+ {"version":3,"file":"policy-team-device-eligibility.d.ts","sourceRoot":"","sources":["../src/policy-team-device-eligibility.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oCAAoC,YAChD,oBAAoB,EACpB,oBAAoB,CACX,CAAC;AAEX,MAAM,MAAM,+BAA+B,GAAG,CAAC,OAAO,oCAAoC,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpG,eAAO,MAAM,4BAA4B,YAAI,UAAU,EAAE,UAAU,EAAE,YAAY,CAAU,CAAC;AAE5F,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,4BAA4B,CAAC,CAAC,MAAM,CAAC,CAAC;AAErF,MAAM,MAAM,oCAAoC,GAC7C,sCAAsC,GACtC,8BAA8B,GAC9B,yBAAyB,GACzB,8BAA8B,GAC9B,8BAA8B,GAC9B,iCAA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GACzC,wCAAwC,CAAC;AAwB5C;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACxC,QAAQ,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAAG,SAAS,GAC5E,OAAO,CAOT;AAED,wBAAgB,mCAAmC,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAKzF;AA0CD,wBAAgB,iCAAiC,CAChD,KAAK,EAAE,sCAAsC,GAC3C,iCAAiC,CA6EnC"}
@@ -0,0 +1,50 @@
1
+ import { type Database } from "./db.js";
2
+ /** Why a hold was cleared: nothing to change, the admin's answer, or a recipient change in Projects. */
3
+ export type MigrationHoldClearReason = "empty_plan" | "summary_confirmed" | "recipients_changed";
4
+ export interface ProjectBoundaryMigrationHold {
5
+ boundaryScopeId: string;
6
+ /** The record's generation. Null when the stored row is not a valid record, which nothing can clear. */
7
+ generation: number | null;
8
+ held: boolean;
9
+ clearedReason: MigrationHoldClearReason | null;
10
+ clearedAt: string | null;
11
+ /**
12
+ * Devices that belonged to a deactivated or merged person when this hold was
13
+ * first seen at the current generation. Null until a pass has stored them.
14
+ */
15
+ withdrawnAtFirstPassDeviceIds: string[] | null;
16
+ }
17
+ export interface ClearProjectBoundaryMigrationHoldInput {
18
+ boundaryScopeId: string;
19
+ /** The generation the caller read. A hold on any other generation stays set. */
20
+ generation: number;
21
+ reason: MigrationHoldClearReason;
22
+ now?: string;
23
+ }
24
+ export interface RecordHoldWithdrawnDevicesInput {
25
+ boundaryScopeId: string;
26
+ generation: number;
27
+ deviceIds: readonly string[];
28
+ }
29
+ /**
30
+ * The hold for one boundary. Null means the Project has no migration record on
31
+ * this device, so the reconciler treats it as it always has.
32
+ */
33
+ export declare function getProjectBoundaryMigrationHold(db: Database, boundaryScopeId: string): ProjectBoundaryMigrationHold | null;
34
+ /**
35
+ * Clears the hold for the generation the caller read. Returns whether the hold
36
+ * is clear at that generation afterwards. A newer record, an unreadable row, or
37
+ * a database without the hold columns leaves the Project held. The first reason
38
+ * a hold was cleared for is kept. The read and the write share one write
39
+ * transaction, so a newer record cannot arrive between them.
40
+ */
41
+ export declare function clearProjectBoundaryMigrationHold(db: Database, input: ClearProjectBoundaryMigrationHoldInput): boolean;
42
+ /**
43
+ * Stores the devices that already belonged to a deactivated or merged person
44
+ * when the hold is first seen at this generation, and returns the stored list.
45
+ * The first pass wins: a later call returns what the first stored, so a person
46
+ * withdrawn afterwards is never added. Returns null when the record is at
47
+ * another generation or cannot be read.
48
+ */
49
+ export declare function recordHoldWithdrawnDevices(db: Database, input: RecordHoldWithdrawnDevicesInput): string[] | null;
50
+ //# sourceMappingURL=project-boundary-migration-hold.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-boundary-migration-hold.d.ts","sourceRoot":"","sources":["../src/project-boundary-migration-hold.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAe,MAAM,SAAS,CAAC;AAkCrD,wGAAwG;AACxG,MAAM,MAAM,wBAAwB,GAAG,YAAY,GAAG,mBAAmB,GAAG,oBAAoB,CAAC;AAQjG,MAAM,WAAW,4BAA4B;IAC5C,eAAe,EAAE,MAAM,CAAC;IACxB,wGAAwG;IACxG,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,IAAI,EAAE,OAAO,CAAC;IACd,aAAa,EAAE,wBAAwB,GAAG,IAAI,CAAC;IAC/C,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB;;;OAGG;IACH,6BAA6B,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;CAC/C;AAED,MAAM,WAAW,sCAAsC;IACtD,eAAe,EAAE,MAAM,CAAC;IACxB,gFAAgF;IAChF,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,wBAAwB,CAAC;IACjC,GAAG,CAAC,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,+BAA+B;IAC/C,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;CAC7B;AAiFD;;;GAGG;AACH,wBAAgB,+BAA+B,CAC9C,EAAE,EAAE,QAAQ,EACZ,eAAe,EAAE,MAAM,GACrB,4BAA4B,GAAG,IAAI,CAGrC;AAED;;;;;;GAMG;AACH,wBAAgB,iCAAiC,CAChD,EAAE,EAAE,QAAQ,EACZ,KAAK,EAAE,sCAAsC,GAC3C,OAAO,CAwBT;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACzC,EAAE,EAAE,QAAQ,EACZ,KAAK,EAAE,+BAA+B,GACpC,MAAM,EAAE,GAAG,IAAI,CAoBjB"}
@@ -0,0 +1,46 @@
1
+ import { type Database } from "./db.js";
2
+ export type ProjectBoundaryMigrationState = "committed" | "rolled_back" | "detached";
3
+ export interface ProjectBoundaryMigrationRecord {
4
+ boundaryScopeId: string;
5
+ sourceScopeId: string;
6
+ /** A second older setup whose memories move too, named after the admin's answer. */
7
+ additionalSourceScopeIds: string[];
8
+ state: ProjectBoundaryMigrationState;
9
+ generation: number;
10
+ }
11
+ export interface RecordProjectBoundaryMigrationInput {
12
+ boundaryScopeId: string;
13
+ sourceScopeId: string;
14
+ additionalSourceScopeIds?: string[];
15
+ state: ProjectBoundaryMigrationState;
16
+ generation: number;
17
+ now?: string;
18
+ }
19
+ /** The record columns of a stored row, as SQLite returns them. */
20
+ export interface ProjectBoundaryMigrationRecordRow {
21
+ boundary_scope_id: string;
22
+ source_scope_id: string;
23
+ additional_source_scope_ids_json: string;
24
+ state: string;
25
+ generation: number;
26
+ }
27
+ /** Reads a stored row as a record, or null when the writer would not have accepted it. */
28
+ export declare function projectBoundaryMigrationRecordFromRow(row: ProjectBoundaryMigrationRecordRow): ProjectBoundaryMigrationRecord | null;
29
+ /**
30
+ * Every record this device holds. The additive schema step is fail-open, so a
31
+ * database it could not upgrade has no table, and that reads as no records.
32
+ */
33
+ export declare function listProjectBoundaryMigrationRecords(db: Database): ProjectBoundaryMigrationRecord[];
34
+ /**
35
+ * Stores the coordinator's record for one boundary. A record with an older
36
+ * generation than the stored one is ignored, so a late read cannot bring a
37
+ * rolled-back migration back. Returns whether the stored record changed.
38
+ */
39
+ export declare function recordProjectBoundaryMigration(db: Database, input: RecordProjectBoundaryMigrationInput): boolean;
40
+ export interface ScopeMove {
41
+ fromScopeId: string;
42
+ toScopeId: string;
43
+ }
44
+ /** Whether a record says a memory may move from one scope to the other in this direction. */
45
+ export declare function migrationRecordCoversMove(records: readonly ProjectBoundaryMigrationRecord[], move: ScopeMove): boolean;
46
+ //# sourceMappingURL=project-boundary-migration-records.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-boundary-migration-records.d.ts","sourceRoot":"","sources":["../src/project-boundary-migration-records.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAe,MAAM,SAAS,CAAC;AAUrD,MAAM,MAAM,6BAA6B,GAAG,WAAW,GAAG,aAAa,GAAG,UAAU,CAAC;AAIrF,MAAM,WAAW,8BAA8B;IAC9C,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,oFAAoF;IACpF,wBAAwB,EAAE,MAAM,EAAE,CAAC;IACnC,KAAK,EAAE,6BAA6B,CAAC;IACrC,UAAU,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mCAAmC;IACnD,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAC;IACpC,KAAK,EAAE,6BAA6B,CAAC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;CACb;AAED,kEAAkE;AAClE,MAAM,WAAW,iCAAiC;IACjD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,eAAe,EAAE,MAAM,CAAC;IACxB,gCAAgC,EAAE,MAAM,CAAC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACnB;AAgBD,0FAA0F;AAC1F,wBAAgB,qCAAqC,CACpD,GAAG,EAAE,iCAAiC,GACpC,8BAA8B,GAAG,IAAI,CAuBvC;AAED;;;GAGG;AACH,wBAAgB,mCAAmC,CAClD,EAAE,EAAE,QAAQ,GACV,8BAA8B,EAAE,CASlC;AAwBD;;;;GAIG;AACH,wBAAgB,8BAA8B,CAC7C,EAAE,EAAE,QAAQ,EACZ,KAAK,EAAE,mCAAmC,GACxC,OAAO,CA2BT;AAMD,MAAM,WAAW,SAAS;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CAClB;AAmBD,6FAA6F;AAC7F,wBAAgB,yBAAyB,CACxC,OAAO,EAAE,SAAS,8BAA8B,EAAE,EAClD,IAAI,EAAE,SAAS,GACb,OAAO,CAET"}
@@ -0,0 +1,11 @@
1
+ export interface PeerProjectFilters {
2
+ include: string[];
3
+ exclude: string[];
4
+ }
5
+ /**
6
+ * Checks every class the filter predicate distinguishes: each literal value,
7
+ * unnamed paths with each named basename, and values matching neither list.
8
+ * Outside the literal values, only the basename can affect the decision.
9
+ */
10
+ export declare function peerProjectFiltersOnlyNarrow(currentFilters: PeerProjectFilters, nextFilters: PeerProjectFilters): boolean;
11
+ //# sourceMappingURL=project-filters-narrowing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-filters-narrowing.d.ts","sourceRoot":"","sources":["../src/project-filters-narrowing.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,kBAAkB;IAClC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CAClB;AAiBD;;;;GAIG;AACH,wBAAgB,4BAA4B,CAC3C,cAAc,EAAE,kBAAkB,EAClC,WAAW,EAAE,kBAAkB,GAC7B,OAAO,CAkBT"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Undoing a local withdrawal from a Project. While withdrawn, this device skipped
3
+ * the Project's ops in both directions without recording them, so peers' ops it
4
+ * skipped and its own ops it held back both have to flow again:
5
+ *
6
+ * - Its pull cursor for the boundary is reset with every peer, so the next pass
7
+ * catches up through the normal membership checks. That is what keeps an undo
8
+ * from delivering anything this device is no longer entitled to.
9
+ * - Every memory in the boundary whose stored revision this device wrote gets a
10
+ * fresh op, whoever created the memory. A push while withdrawn moved the
11
+ * default outbound position past held-back ops, including ones recorded just
12
+ * before the withdrawal that no peer had received yet. A memory last changed
13
+ * by another device is left alone, so no remote change is replayed. The fresh
14
+ * op carries the memory's current clock, so peers apply it idempotently.
15
+ */
16
+ import type { Database } from "./db.js";
17
+ export interface ResumeProjectScopeSyncResult {
18
+ resumed: boolean;
19
+ resentMemoryCount: number;
20
+ }
21
+ export declare function resumeProjectScopeSync(db: Database, input: {
22
+ scopeId: string;
23
+ deviceId: string;
24
+ now: string;
25
+ }): ResumeProjectScopeSyncResult;
26
+ //# sourceMappingURL=project-scope-resume.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-scope-resume.d.ts","sourceRoot":"","sources":["../src/project-scope-resume.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAQxC,MAAM,WAAW,4BAA4B;IAC5C,OAAO,EAAE,OAAO,CAAC;IACjB,iBAAiB,EAAE,MAAM,CAAC;CAC1B;AAiCD,wBAAgB,sBAAsB,CACrC,EAAE,EAAE,QAAQ,EACZ,KAAK,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GACvD,4BAA4B,CAsB9B"}
@@ -64,7 +64,7 @@ export interface ProjectScopeCandidate {
64
64
  device_id: string;
65
65
  }>;
66
66
  }
67
- export type ProjectScopeInventoryStatus = "explicitly_mapped" | "legacy_review" | "local_only" | "needs_attention" | "received" | "suggested" | "unmapped";
67
+ export type ProjectScopeInventoryStatus = "empty" | "explicitly_mapped" | "legacy_review" | "local_only" | "needs_attention" | "received" | "suggested" | "unmapped";
68
68
  export interface ProjectScopeInventoryProject extends ProjectScopeCandidate {
69
69
  memory_count: number | null;
70
70
  origin_devices: Array<{
@@ -83,6 +83,11 @@ export interface ProjectScopeInventoryWorktree {
83
83
  export interface ProjectScopeInventoryOptions {
84
84
  repositoryIdentitySnapshot?: RepositoryIdentitySnapshot;
85
85
  identitySource?: string | null;
86
+ /**
87
+ * When false, leaves out Projects with no memories that `pruneEmptyProjects` can hide.
88
+ * Defaults to true so lookups by identity still see every Project.
89
+ */
90
+ includeEmpty?: boolean;
86
91
  limit?: number;
87
92
  offset?: number;
88
93
  query?: string | null;
@@ -95,6 +100,8 @@ export interface ProjectScopeInventoryResult {
95
100
  limit: number;
96
101
  offset: number;
97
102
  has_more: boolean;
103
+ /** Empty Projects that matched the other filters but were left out by `includeEmpty: false`. */
104
+ hidden_empty_count: number;
98
105
  }
99
106
  export interface UpsertProjectScopeMappingInput {
100
107
  canWriteScope?: (scopeId: string | null) => boolean;
@@ -122,6 +129,13 @@ export interface ReassignProjectScopeInventoryProjectResult {
122
129
  }
123
130
  export declare function listSharingDomainSettingsScopes(db: Database): SharingDomainSettingsScope[];
124
131
  export declare function listProjectScopeSettingsMappings(db: Database): ProjectScopeSettingsMapping[];
132
+ /**
133
+ * Whether saving these mappings can only narrow who receives Projects: every
134
+ * target is local-only, and no existing mapping changes what it matches or its
135
+ * precedence, because that could let the Projects it covered fall through to a
136
+ * broader shared mapping. Input the route would reject passes through unchanged.
137
+ */
138
+ export declare function projectScopeMappingSavesOnlyNarrow(db: Database, inputs: UpsertProjectScopeMappingInput[]): boolean;
125
139
  export declare function analyzeProjectScopeMappingDeletionGuardrails(db: Database, id: number, deviceId: string | null): ProjectScopeGuardrailWarning[];
126
140
  export declare function analyzeProjectScopeMappingChangesGuardrails(db: Database, inputs: UpsertProjectScopeMappingInput[]): ProjectScopeMappingChangeGuardrailAnalysis[];
127
141
  export declare function analyzeProjectScopeMappingChangeGuardrails(db: Database, input: UpsertProjectScopeMappingInput, options?: {
@@ -134,6 +148,12 @@ export declare function listProjectScopeCandidates(db: Database, options?: {
134
148
  excludePeerReceived?: boolean;
135
149
  }): ProjectScopeCandidate[];
136
150
  export declare function listProjectScopeInventory(db: Database, options?: ProjectScopeInventoryOptions): ProjectScopeInventoryResult;
151
+ /**
152
+ * The group a Project's row belongs to in the Projects table. Keep this rule identical to
153
+ * projectClusterKey in packages/ui/src/tabs/projects/project-view.ts; both have tests
154
+ * pinned to the same three cases.
155
+ */
156
+ export declare function projectInventoryGroupKey(project: Pick<ProjectScopeInventoryProject, "git_remote" | "project" | "workspace_identity">): string;
137
157
  export declare function reassignProjectScopeInventoryProject(db: Database, input: {
138
158
  deviceId: string;
139
159
  workspaceIdentity: string;
@@ -1 +1 @@
1
- {"version":3,"file":"project-scope-settings.d.ts","sourceRoot":"","sources":["../src/project-scope-settings.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,QAAQ,EAAoB,MAAM,SAAS,CAAC;AAI1D,OAAO,EAIN,KAAK,0BAA0B,EAM/B,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAIN,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAE1B,KAAK,uBAAuB,EAC5B,MAAM,uBAAuB,CAAC;AAK/B,MAAM,WAAW,0BAA0B;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACnB;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C,CAChD,EAAE,EAAE,QAAQ,EACZ,EAAE,EAAE,MAAM,EACV,OAAO,GAAE;IACR,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAC;IACpC,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,OAAO,CAAC;CAC/C,GACJ,OAAO,CA6BT"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Local self-withdrawal from a Project (ADR 0007 Decision 4). This device stops
3
+ * syncing one Project's boundary in both directions and records that it did. It
4
+ * stays a member of the boundary at the coordinator until the signed withdrawal
5
+ * route exists, and keeps every copy it already holds.
6
+ *
7
+ * A withdrawal is keyed by the Project's boundary scope ID, which stays the same
8
+ * across a migration's commit, rollback, and a second commit, so it applies again
9
+ * whenever the Project is on its boundary. It never touches migration records,
10
+ * presence, or the local restamp of this device's own memories.
11
+ */
12
+ import type { Database } from "./db.js";
13
+ export interface ProjectScopeWithdrawal {
14
+ scopeId: string;
15
+ canonicalProjectIdentity: string;
16
+ groupId: string;
17
+ withdrawnAt: string;
18
+ }
19
+ /** Records that this device stopped receiving the Project. Repeating it changes nothing. */
20
+ export declare function withdrawProjectScope(db: Database, input: {
21
+ canonicalProjectIdentity: string;
22
+ groupId: string;
23
+ now: string;
24
+ }): ProjectScopeWithdrawal;
25
+ /**
26
+ * Records a withdrawal for a boundary this device already knows by scope ID, as a
27
+ * receiving device does. Repeating it changes nothing.
28
+ */
29
+ export declare function recordProjectScopeWithdrawal(db: Database, input: {
30
+ scopeId: string;
31
+ canonicalProjectIdentity: string;
32
+ groupId: string;
33
+ now: string;
34
+ }): ProjectScopeWithdrawal;
35
+ /**
36
+ * Ends a withdrawal. Returns whether one existed. Callers then reset this device's
37
+ * sync position for the boundary so it catches up through the normal membership
38
+ * checks, which is what keeps an undo from delivering anything this device is no
39
+ * longer entitled to.
40
+ */
41
+ export declare function resumeProjectScope(db: Database, input: {
42
+ scopeId: string;
43
+ now: string;
44
+ }): boolean;
45
+ /** A missing table means nothing is withdrawn, so older databases keep syncing as before. */
46
+ export declare function isProjectScopeWithdrawn(db: Database, scopeId: string): boolean;
47
+ export declare function listProjectScopeWithdrawals(db: Database): ProjectScopeWithdrawal[];
48
+ //# sourceMappingURL=project-scope-withdrawal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-scope-withdrawal.d.ts","sourceRoot":"","sources":["../src/project-scope-withdrawal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAMxC,MAAM,WAAW,sBAAsB;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,wBAAwB,EAAE,MAAM,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACpB;AAkBD,4FAA4F;AAC5F,wBAAgB,oBAAoB,CACnC,EAAE,EAAE,QAAQ,EACZ,KAAK,EAAE;IAAE,wBAAwB,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GACvE,sBAAsB,CAKxB;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAC3C,EAAE,EAAE,QAAQ,EACZ,KAAK,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,wBAAwB,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GACxF,sBAAsB,CASxB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAGjG;AAED,6FAA6F;AAC7F,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAG9E;AAED,wBAAgB,2BAA2B,CAAC,EAAE,EAAE,QAAQ,GAAG,sBAAsB,EAAE,CAKlF"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * What the Viewer needs to let this device stop and resume a Project on its own
3
+ * boundary (ADR 0007 Decision 4). The Viewer names Projects by their inventory
4
+ * workspace identity:
5
+ *
6
+ * - A Project received from other devices on its own boundary is
7
+ * `peer-received:scope:<boundary scope ID>`.
8
+ * - A Project of this device's own is its canonical identity, and its boundary
9
+ * scope ID is a hash of the coordinator group and that identity.
10
+ */
11
+ import type { Database } from "./db.js";
12
+ export interface ProjectWithdrawalState {
13
+ scopeId: string;
14
+ groupId: string;
15
+ /** When this device stopped the Project, or null while it still syncs it. */
16
+ withdrawnAt: string | null;
17
+ }
18
+ /**
19
+ * Where this device stands on each named Project that it syncs on the Project's
20
+ * own boundary. A stopped Project stays listed after its boundary is gone, so the
21
+ * device can still resume it.
22
+ */
23
+ export declare function projectWithdrawalStates(db: Database, deviceId: string, workspaceIdentities: string[]): Map<string, ProjectWithdrawalState>;
24
+ /** Stops the Project on this device. Returns null when it isn't on its own boundary here. */
25
+ export declare function stopProjectOnThisDevice(db: Database, input: {
26
+ deviceId: string;
27
+ workspaceIdentity: string;
28
+ now: string;
29
+ }): ProjectWithdrawalState | null;
30
+ /** Resumes a Project this device stopped. Returns false when it wasn't stopped. */
31
+ export declare function resumeProjectOnThisDevice(db: Database, input: {
32
+ deviceId: string;
33
+ workspaceIdentity: string;
34
+ now: string;
35
+ }): boolean;
36
+ //# sourceMappingURL=project-withdrawal-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-withdrawal-state.d.ts","sourceRoot":"","sources":["../src/project-withdrawal-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAYxC,MAAM,WAAW,sBAAsB;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,6EAA6E;IAC7E,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAiCD;;;;GAIG;AACH,wBAAgB,uBAAuB,CACtC,EAAE,EAAE,QAAQ,EACZ,QAAQ,EAAE,MAAM,EAChB,mBAAmB,EAAE,MAAM,EAAE,GAC3B,GAAG,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAmBrC;AA4BD,6FAA6F;AAC7F,wBAAgB,uBAAuB,CACtC,EAAE,EAAE,QAAQ,EACZ,KAAK,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GACjE,sBAAsB,GAAG,IAAI,CAc/B;AAED,mFAAmF;AACnF,wBAAgB,yBAAyB,CACxC,EAAE,EAAE,QAAQ,EACZ,KAAK,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GACjE,OAAO,CAUT"}