@codemem/core 0.46.3 → 0.47.0-beta.3

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 (481) hide show
  1. package/dist/address-utils.d.ts.map +1 -1
  2. package/dist/better-sqlite-coordinator-runtime.d.ts +2 -0
  3. package/dist/better-sqlite-coordinator-runtime.d.ts.map +1 -1
  4. package/dist/better-sqlite-coordinator-store.d.ts +109 -5
  5. package/dist/better-sqlite-coordinator-store.d.ts.map +1 -1
  6. package/dist/coordinator-account-change-browser.d.ts +39 -0
  7. package/dist/coordinator-account-change-browser.d.ts.map +1 -0
  8. package/dist/coordinator-account-change-contract.d.ts +4 -0
  9. package/dist/coordinator-account-change-contract.d.ts.map +1 -0
  10. package/dist/coordinator-account-change-http-test-fixtures.d.ts +101 -0
  11. package/dist/coordinator-account-change-http-test-fixtures.d.ts.map +1 -0
  12. package/dist/coordinator-account-change-schema.d.ts +5 -0
  13. package/dist/coordinator-account-change-schema.d.ts.map +1 -0
  14. package/dist/coordinator-account-change.d.ts +100 -0
  15. package/dist/coordinator-account-change.d.ts.map +1 -0
  16. package/dist/coordinator-account-connection-link.d.ts +25 -0
  17. package/dist/coordinator-account-connection-link.d.ts.map +1 -0
  18. package/dist/coordinator-account-connection-schema.d.ts +68 -0
  19. package/dist/coordinator-account-connection-schema.d.ts.map +1 -0
  20. package/dist/coordinator-account-connection-session.d.ts +15 -0
  21. package/dist/coordinator-account-connection-session.d.ts.map +1 -0
  22. package/dist/coordinator-account-connection-storage.d.ts +46 -0
  23. package/dist/coordinator-account-connection-storage.d.ts.map +1 -0
  24. package/dist/coordinator-account-historical-revoke.d.ts +7 -0
  25. package/dist/coordinator-account-historical-revoke.d.ts.map +1 -0
  26. package/dist/coordinator-account-link-receipt.d.ts +20 -0
  27. package/dist/coordinator-account-link-receipt.d.ts.map +1 -0
  28. package/dist/coordinator-account-link-receiver.d.ts +28 -0
  29. package/dist/coordinator-account-link-receiver.d.ts.map +1 -0
  30. package/dist/coordinator-account-link-runtime.d.ts +45 -0
  31. package/dist/coordinator-account-link-runtime.d.ts.map +1 -0
  32. package/dist/coordinator-account-link-signer.d.ts +15 -0
  33. package/dist/coordinator-account-link-signer.d.ts.map +1 -0
  34. package/dist/coordinator-account-link-status-client.d.ts +37 -0
  35. package/dist/coordinator-account-link-status-client.d.ts.map +1 -0
  36. package/dist/coordinator-account-link-status.d.ts +23 -0
  37. package/dist/coordinator-account-link-status.d.ts.map +1 -0
  38. package/dist/coordinator-account-unlink-schema.d.ts +7 -0
  39. package/dist/coordinator-account-unlink-schema.d.ts.map +1 -0
  40. package/dist/coordinator-actions.d.ts +29 -0
  41. package/dist/coordinator-actions.d.ts.map +1 -1
  42. package/dist/coordinator-api.d.ts +21 -1
  43. package/dist/coordinator-api.d.ts.map +1 -1
  44. package/dist/coordinator-auth-account-profile-contract.d.ts +41 -0
  45. package/dist/coordinator-auth-account-profile-contract.d.ts.map +1 -0
  46. package/dist/coordinator-auth-account-profile.d.ts +27 -0
  47. package/dist/coordinator-auth-account-profile.d.ts.map +1 -0
  48. package/dist/coordinator-auth-browser-migration-test-harness.d.ts +18 -0
  49. package/dist/coordinator-auth-browser-migration-test-harness.d.ts.map +1 -0
  50. package/dist/coordinator-auth-browser-owner-purpose-test-harness.d.ts +6 -0
  51. package/dist/coordinator-auth-browser-owner-purpose-test-harness.d.ts.map +1 -0
  52. package/dist/coordinator-auth-browser-proof-test-fixtures.d.ts +25 -0
  53. package/dist/coordinator-auth-browser-proof-test-fixtures.d.ts.map +1 -0
  54. package/dist/coordinator-auth-browser-schema-upgrade.d.ts +6 -0
  55. package/dist/coordinator-auth-browser-schema-upgrade.d.ts.map +1 -0
  56. package/dist/coordinator-auth-browser-style.d.ts +6 -0
  57. package/dist/coordinator-auth-browser-style.d.ts.map +1 -0
  58. package/dist/coordinator-auth-browser-transaction-contract.d.ts +130 -0
  59. package/dist/coordinator-auth-browser-transaction-contract.d.ts.map +1 -0
  60. package/dist/coordinator-auth-browser-transaction-test-fixtures.d.ts +14 -0
  61. package/dist/coordinator-auth-browser-transaction-test-fixtures.d.ts.map +1 -0
  62. package/dist/coordinator-auth-browser-transaction.d.ts +36 -0
  63. package/dist/coordinator-auth-browser-transaction.d.ts.map +1 -0
  64. package/dist/coordinator-auth-browser-view.d.ts +84 -0
  65. package/dist/coordinator-auth-browser-view.d.ts.map +1 -0
  66. package/dist/coordinator-auth-contract.d.ts +71 -0
  67. package/dist/coordinator-auth-contract.d.ts.map +1 -0
  68. package/dist/coordinator-auth-controller-review-route.d.ts +38 -0
  69. package/dist/coordinator-auth-controller-review-route.d.ts.map +1 -0
  70. package/dist/coordinator-auth-controller.d.ts +87 -0
  71. package/dist/coordinator-auth-controller.d.ts.map +1 -0
  72. package/dist/coordinator-auth-device-claim-eligibility.d.ts +43 -0
  73. package/dist/coordinator-auth-device-claim-eligibility.d.ts.map +1 -0
  74. package/dist/coordinator-auth-device-claim-schema.d.ts +116 -0
  75. package/dist/coordinator-auth-device-claim-schema.d.ts.map +1 -0
  76. package/dist/coordinator-auth-historical-migration-test-fixture.d.ts +2 -0
  77. package/dist/coordinator-auth-historical-migration-test-fixture.d.ts.map +1 -0
  78. package/dist/coordinator-auth-historical-store-test-fixture.d.ts +13 -0
  79. package/dist/coordinator-auth-historical-store-test-fixture.d.ts.map +1 -0
  80. package/dist/coordinator-auth-historical-test-fixture.d.ts +48 -0
  81. package/dist/coordinator-auth-historical-test-fixture.d.ts.map +1 -0
  82. package/dist/coordinator-auth-legacy-assignment.d.ts +12 -0
  83. package/dist/coordinator-auth-legacy-assignment.d.ts.map +1 -0
  84. package/dist/coordinator-auth-lifecycle-admission-schema.d.ts +28 -0
  85. package/dist/coordinator-auth-lifecycle-admission-schema.d.ts.map +1 -0
  86. package/dist/coordinator-auth-lifecycle-browser-schema.d.ts +15 -0
  87. package/dist/coordinator-auth-lifecycle-browser-schema.d.ts.map +1 -0
  88. package/dist/coordinator-auth-lifecycle-current-readiness.d.ts +7 -0
  89. package/dist/coordinator-auth-lifecycle-current-readiness.d.ts.map +1 -0
  90. package/dist/coordinator-auth-lifecycle-first-link.d.ts +17 -0
  91. package/dist/coordinator-auth-lifecycle-first-link.d.ts.map +1 -0
  92. package/dist/coordinator-auth-lifecycle-fresh-schema.d.ts +14 -0
  93. package/dist/coordinator-auth-lifecycle-fresh-schema.d.ts.map +1 -0
  94. package/dist/coordinator-auth-lifecycle-predecessor-shapes.d.ts +24 -0
  95. package/dist/coordinator-auth-lifecycle-predecessor-shapes.d.ts.map +1 -0
  96. package/dist/coordinator-auth-lifecycle-predecessor.d.ts +9 -0
  97. package/dist/coordinator-auth-lifecycle-predecessor.d.ts.map +1 -0
  98. package/dist/coordinator-auth-lifecycle-profile-schema.d.ts +13 -0
  99. package/dist/coordinator-auth-lifecycle-profile-schema.d.ts.map +1 -0
  100. package/dist/coordinator-auth-lifecycle-recognition.d.ts +22 -0
  101. package/dist/coordinator-auth-lifecycle-recognition.d.ts.map +1 -0
  102. package/dist/coordinator-auth-lifecycle-schema.d.ts +20 -0
  103. package/dist/coordinator-auth-lifecycle-schema.d.ts.map +1 -0
  104. package/dist/coordinator-auth-lifecycle-upgrade-copy.d.ts +36 -0
  105. package/dist/coordinator-auth-lifecycle-upgrade-copy.d.ts.map +1 -0
  106. package/dist/coordinator-auth-lifecycle-upgrade-sqlite.d.ts +11 -0
  107. package/dist/coordinator-auth-lifecycle-upgrade-sqlite.d.ts.map +1 -0
  108. package/dist/coordinator-auth-lifecycle-upgrade-test-fixture.d.ts +31 -0
  109. package/dist/coordinator-auth-lifecycle-upgrade-test-fixture.d.ts.map +1 -0
  110. package/dist/coordinator-auth-lifecycle-upgrade.d.ts +6 -0
  111. package/dist/coordinator-auth-lifecycle-upgrade.d.ts.map +1 -0
  112. package/dist/coordinator-auth-link-authority-upgrade.d.ts +17 -0
  113. package/dist/coordinator-auth-link-authority-upgrade.d.ts.map +1 -0
  114. package/dist/coordinator-auth-link-authority.d.ts +92 -0
  115. package/dist/coordinator-auth-link-authority.d.ts.map +1 -0
  116. package/dist/coordinator-auth-link-change-schema.d.ts +21 -0
  117. package/dist/coordinator-auth-link-change-schema.d.ts.map +1 -0
  118. package/dist/coordinator-auth-link-contract.d.ts +137 -0
  119. package/dist/coordinator-auth-link-contract.d.ts.map +1 -0
  120. package/dist/coordinator-auth-link-input.d.ts +7 -0
  121. package/dist/coordinator-auth-link-input.d.ts.map +1 -0
  122. package/dist/coordinator-auth-link-legacy-inline-test-fixture.d.ts +2 -0
  123. package/dist/coordinator-auth-link-legacy-inline-test-fixture.d.ts.map +1 -0
  124. package/dist/coordinator-auth-link-liveness.d.ts +8 -0
  125. package/dist/coordinator-auth-link-liveness.d.ts.map +1 -0
  126. package/dist/coordinator-auth-link-maintenance-fixtures.d.ts +14 -0
  127. package/dist/coordinator-auth-link-maintenance-fixtures.d.ts.map +1 -0
  128. package/dist/coordinator-auth-link-profile.d.ts +15 -0
  129. package/dist/coordinator-auth-link-profile.d.ts.map +1 -0
  130. package/dist/coordinator-auth-link-provenance.d.ts +17 -0
  131. package/dist/coordinator-auth-link-provenance.d.ts.map +1 -0
  132. package/dist/coordinator-auth-link-revocation-test-harness.d.ts +19 -0
  133. package/dist/coordinator-auth-link-revocation-test-harness.d.ts.map +1 -0
  134. package/dist/coordinator-auth-link-source.d.ts +15 -0
  135. package/dist/coordinator-auth-link-source.d.ts.map +1 -0
  136. package/dist/coordinator-auth-link-test-fixtures.d.ts +49 -0
  137. package/dist/coordinator-auth-link-test-fixtures.d.ts.map +1 -0
  138. package/dist/coordinator-auth-link.d.ts +91 -0
  139. package/dist/coordinator-auth-link.d.ts.map +1 -0
  140. package/dist/coordinator-auth-loopback.d.ts +11 -0
  141. package/dist/coordinator-auth-loopback.d.ts.map +1 -0
  142. package/dist/coordinator-auth-proof.d.ts +4 -0
  143. package/dist/coordinator-auth-proof.d.ts.map +1 -0
  144. package/dist/coordinator-auth-schema-operator.d.ts +6 -0
  145. package/dist/coordinator-auth-schema-operator.d.ts.map +1 -0
  146. package/dist/coordinator-auth-schema.d.ts +18 -0
  147. package/dist/coordinator-auth-schema.d.ts.map +1 -0
  148. package/dist/coordinator-auth-session-bound-test-fixtures.d.ts +7 -0
  149. package/dist/coordinator-auth-session-bound-test-fixtures.d.ts.map +1 -0
  150. package/dist/coordinator-auth-session-contract.d.ts +104 -0
  151. package/dist/coordinator-auth-session-contract.d.ts.map +1 -0
  152. package/dist/coordinator-auth-session-test-fixtures.d.ts +31 -0
  153. package/dist/coordinator-auth-session-test-fixtures.d.ts.map +1 -0
  154. package/dist/coordinator-auth-session.d.ts +44 -0
  155. package/dist/coordinator-auth-session.d.ts.map +1 -0
  156. package/dist/coordinator-auth-store-test-fixtures.d.ts +26 -0
  157. package/dist/coordinator-auth-store-test-fixtures.d.ts.map +1 -0
  158. package/dist/coordinator-bootstrap-authorization-api-test-harness.d.ts +5 -0
  159. package/dist/coordinator-bootstrap-authorization-api-test-harness.d.ts.map +1 -0
  160. package/dist/coordinator-bootstrap-authorization-test-harness.d.ts +11 -0
  161. package/dist/coordinator-bootstrap-authorization-test-harness.d.ts.map +1 -0
  162. package/dist/coordinator-bootstrap-grant-authorization.d.ts +28 -0
  163. package/dist/coordinator-bootstrap-grant-authorization.d.ts.map +1 -0
  164. package/dist/coordinator-bootstrap-grant-issuance.d.ts +22 -0
  165. package/dist/coordinator-bootstrap-grant-issuance.d.ts.map +1 -0
  166. package/dist/coordinator-bootstrap-revocation-test-harness.d.ts +11 -0
  167. package/dist/coordinator-bootstrap-revocation-test-harness.d.ts.map +1 -0
  168. package/dist/coordinator-browser-account.d.ts +36 -0
  169. package/dist/coordinator-browser-account.d.ts.map +1 -0
  170. package/dist/coordinator-browser-auth-app.d.ts +84 -0
  171. package/dist/coordinator-browser-auth-app.d.ts.map +1 -0
  172. package/dist/coordinator-browser-auth-callback.d.ts +47 -0
  173. package/dist/coordinator-browser-auth-callback.d.ts.map +1 -0
  174. package/dist/coordinator-browser-auth-config.d.ts +32 -0
  175. package/dist/coordinator-browser-auth-config.d.ts.map +1 -0
  176. package/dist/coordinator-browser-credential.d.ts +40 -0
  177. package/dist/coordinator-browser-credential.d.ts.map +1 -0
  178. package/dist/coordinator-browser-csrf.d.ts +19 -0
  179. package/dist/coordinator-browser-csrf.d.ts.map +1 -0
  180. package/dist/coordinator-browser-form-body.d.ts +42 -0
  181. package/dist/coordinator-browser-form-body.d.ts.map +1 -0
  182. package/dist/coordinator-browser-form-guard.d.ts +55 -0
  183. package/dist/coordinator-browser-form-guard.d.ts.map +1 -0
  184. package/dist/coordinator-browser-link-completion.d.ts +32 -0
  185. package/dist/coordinator-browser-link-completion.d.ts.map +1 -0
  186. package/dist/coordinator-browser-link-start.d.ts +39 -0
  187. package/dist/coordinator-browser-link-start.d.ts.map +1 -0
  188. package/dist/coordinator-browser-link.d.ts +36 -0
  189. package/dist/coordinator-browser-link.d.ts.map +1 -0
  190. package/dist/coordinator-browser-request.d.ts +10 -0
  191. package/dist/coordinator-browser-request.d.ts.map +1 -0
  192. package/dist/coordinator-browser-signin-start.d.ts +38 -0
  193. package/dist/coordinator-browser-signin-start.d.ts.map +1 -0
  194. package/dist/coordinator-browser-start-transaction.d.ts +6 -0
  195. package/dist/coordinator-browser-start-transaction.d.ts.map +1 -0
  196. package/dist/coordinator-controller-revocation-test-harness.d.ts +11 -0
  197. package/dist/coordinator-controller-revocation-test-harness.d.ts.map +1 -0
  198. package/dist/coordinator-d1-scope-authorization-test-harness.d.ts +14 -0
  199. package/dist/coordinator-d1-scope-authorization-test-harness.d.ts.map +1 -0
  200. package/dist/coordinator-device-account-change.d.ts +17 -0
  201. package/dist/coordinator-device-account-change.d.ts.map +1 -0
  202. package/dist/coordinator-device-auth-link.d.ts +43 -0
  203. package/dist/coordinator-device-auth-link.d.ts.map +1 -0
  204. package/dist/coordinator-device-local.d.ts +9 -0
  205. package/dist/coordinator-device-local.d.ts.map +1 -0
  206. package/dist/coordinator-device-ownership-schema.d.ts +3 -0
  207. package/dist/coordinator-device-ownership-schema.d.ts.map +1 -0
  208. package/dist/coordinator-device-ownership-test-harness.d.ts +17 -0
  209. package/dist/coordinator-device-ownership-test-harness.d.ts.map +1 -0
  210. package/dist/coordinator-device-revocation-client.d.ts +41 -0
  211. package/dist/coordinator-device-revocation-client.d.ts.map +1 -0
  212. package/dist/coordinator-device-revocation-handler-test-harness.d.ts +4 -0
  213. package/dist/coordinator-device-revocation-handler-test-harness.d.ts.map +1 -0
  214. package/dist/coordinator-device-revocation-handler.d.ts +17 -0
  215. package/dist/coordinator-device-revocation-handler.d.ts.map +1 -0
  216. package/dist/coordinator-device-revocation-route.d.ts +14 -0
  217. package/dist/coordinator-device-revocation-route.d.ts.map +1 -0
  218. package/dist/coordinator-device-revocation-test-harness.d.ts +34 -0
  219. package/dist/coordinator-device-revocation-test-harness.d.ts.map +1 -0
  220. package/dist/coordinator-device-revocation.d.ts +67 -0
  221. package/dist/coordinator-device-revocation.d.ts.map +1 -0
  222. package/dist/coordinator-ed25519-key-id-compat.d.ts +6 -0
  223. package/dist/coordinator-ed25519-key-id-compat.d.ts.map +1 -0
  224. package/dist/coordinator-ed25519-key-id-test-fixtures.d.ts +30 -0
  225. package/dist/coordinator-ed25519-key-id-test-fixtures.d.ts.map +1 -0
  226. package/dist/coordinator-ed25519-key-id.d.ts +21 -0
  227. package/dist/coordinator-ed25519-key-id.d.ts.map +1 -0
  228. package/dist/coordinator-enrollment-revocation-test-harness.d.ts +6 -0
  229. package/dist/coordinator-enrollment-revocation-test-harness.d.ts.map +1 -0
  230. package/dist/coordinator-hono-test-fixtures.d.ts +2 -0
  231. package/dist/coordinator-hono-test-fixtures.d.ts.map +1 -0
  232. package/dist/coordinator-identity-grant-revocation-test-harness.d.ts +11 -0
  233. package/dist/coordinator-identity-grant-revocation-test-harness.d.ts.map +1 -0
  234. package/dist/coordinator-identity-group-grant-client.d.ts +9 -0
  235. package/dist/coordinator-identity-group-grant-client.d.ts.map +1 -0
  236. package/dist/coordinator-identity-group-grant-input-test-harness.d.ts +3 -0
  237. package/dist/coordinator-identity-group-grant-input-test-harness.d.ts.map +1 -0
  238. package/dist/coordinator-identity-group-grant-test-harness.d.ts +17 -0
  239. package/dist/coordinator-identity-group-grant-test-harness.d.ts.map +1 -0
  240. package/dist/coordinator-identity-group-grant.d.ts +51 -0
  241. package/dist/coordinator-identity-group-grant.d.ts.map +1 -0
  242. package/dist/coordinator-invite-review.d.ts +64 -0
  243. package/dist/coordinator-invite-review.d.ts.map +1 -0
  244. package/dist/coordinator-join-review-guards.d.ts +22 -0
  245. package/dist/coordinator-join-review-guards.d.ts.map +1 -0
  246. package/dist/coordinator-join-revocation-test-harness.d.ts +23 -0
  247. package/dist/coordinator-join-revocation-test-harness.d.ts.map +1 -0
  248. package/dist/coordinator-legacy-device-ownership.d.ts +34 -0
  249. package/dist/coordinator-legacy-device-ownership.d.ts.map +1 -0
  250. package/dist/coordinator-oidc-test-fixtures.d.ts +50 -0
  251. package/dist/coordinator-oidc-test-fixtures.d.ts.map +1 -0
  252. package/dist/coordinator-oidc.d.ts +59 -0
  253. package/dist/coordinator-oidc.d.ts.map +1 -0
  254. package/dist/coordinator-owner-attempt-migration-test-harness.d.ts +16 -0
  255. package/dist/coordinator-owner-attempt-migration-test-harness.d.ts.map +1 -0
  256. package/dist/coordinator-owner-enrollment-client.d.ts +29 -0
  257. package/dist/coordinator-owner-enrollment-client.d.ts.map +1 -0
  258. package/dist/coordinator-owner-enrollment-commit-test-fixtures.d.ts +31 -0
  259. package/dist/coordinator-owner-enrollment-commit-test-fixtures.d.ts.map +1 -0
  260. package/dist/coordinator-owner-enrollment-commit.d.ts +23 -0
  261. package/dist/coordinator-owner-enrollment-commit.d.ts.map +1 -0
  262. package/dist/coordinator-owner-enrollment-historical-test-fixture.d.ts +11 -0
  263. package/dist/coordinator-owner-enrollment-historical-test-fixture.d.ts.map +1 -0
  264. package/dist/coordinator-owner-enrollment-http.d.ts +67 -0
  265. package/dist/coordinator-owner-enrollment-http.d.ts.map +1 -0
  266. package/dist/coordinator-owner-enrollment-proof.d.ts +67 -0
  267. package/dist/coordinator-owner-enrollment-proof.d.ts.map +1 -0
  268. package/dist/coordinator-owner-enrollment-qualification-schema.d.ts +107 -0
  269. package/dist/coordinator-owner-enrollment-qualification-schema.d.ts.map +1 -0
  270. package/dist/coordinator-owner-enrollment-qualification-test-harness.d.ts +39 -0
  271. package/dist/coordinator-owner-enrollment-qualification-test-harness.d.ts.map +1 -0
  272. package/dist/coordinator-owner-enrollment-qualification.d.ts +56 -0
  273. package/dist/coordinator-owner-enrollment-qualification.d.ts.map +1 -0
  274. package/dist/coordinator-owner-enrollment-schema.d.ts +7 -0
  275. package/dist/coordinator-owner-enrollment-schema.d.ts.map +1 -0
  276. package/dist/coordinator-owner-enrollment-start-test-fixtures.d.ts +54 -0
  277. package/dist/coordinator-owner-enrollment-start-test-fixtures.d.ts.map +1 -0
  278. package/dist/coordinator-owner-enrollment-test-harness.d.ts +72 -0
  279. package/dist/coordinator-owner-enrollment-test-harness.d.ts.map +1 -0
  280. package/dist/coordinator-owner-profile-adoption.d.ts +34 -0
  281. package/dist/coordinator-owner-profile-adoption.d.ts.map +1 -0
  282. package/dist/coordinator-owner-profile-client-test-harness.d.ts +57 -0
  283. package/dist/coordinator-owner-profile-client-test-harness.d.ts.map +1 -0
  284. package/dist/coordinator-owner-profile-client.d.ts +38 -0
  285. package/dist/coordinator-owner-profile-client.d.ts.map +1 -0
  286. package/dist/coordinator-owner-profile-files.d.ts +62 -0
  287. package/dist/coordinator-owner-profile-files.d.ts.map +1 -0
  288. package/dist/coordinator-owner-qualification-http.d.ts +14 -0
  289. package/dist/coordinator-owner-qualification-http.d.ts.map +1 -0
  290. package/dist/coordinator-owner-qualification-route.d.ts +16 -0
  291. package/dist/coordinator-owner-qualification-route.d.ts.map +1 -0
  292. package/dist/coordinator-owner-review-local.d.ts +35 -0
  293. package/dist/coordinator-owner-review-local.d.ts.map +1 -0
  294. package/dist/coordinator-peer-discovery-revocation-test-harness.d.ts +21 -0
  295. package/dist/coordinator-peer-discovery-revocation-test-harness.d.ts.map +1 -0
  296. package/dist/coordinator-peer-discovery.d.ts +15 -0
  297. package/dist/coordinator-peer-discovery.d.ts.map +1 -0
  298. package/dist/coordinator-project-invite-guards.d.ts +13 -0
  299. package/dist/coordinator-project-invite-guards.d.ts.map +1 -0
  300. package/dist/coordinator-project-revocation-test-harness.d.ts +25 -0
  301. package/dist/coordinator-project-revocation-test-harness.d.ts.map +1 -0
  302. package/dist/coordinator-recipient-revocation-test-harness.d.ts +30 -0
  303. package/dist/coordinator-recipient-revocation-test-harness.d.ts.map +1 -0
  304. package/dist/coordinator-runtime.d.ts +1 -0
  305. package/dist/coordinator-runtime.d.ts.map +1 -1
  306. package/dist/coordinator-scope-authorization-api-test-harness.d.ts +8 -0
  307. package/dist/coordinator-scope-authorization-api-test-harness.d.ts.map +1 -0
  308. package/dist/coordinator-scope-authorization-response.d.ts +10 -0
  309. package/dist/coordinator-scope-authorization-response.d.ts.map +1 -0
  310. package/dist/coordinator-scope-authorization.d.ts +25 -0
  311. package/dist/coordinator-scope-authorization.d.ts.map +1 -0
  312. package/dist/coordinator-store-contract.d.ts +48 -1
  313. package/dist/coordinator-store-contract.d.ts.map +1 -1
  314. package/dist/coordinator-store.d.ts +2 -1
  315. package/dist/coordinator-store.d.ts.map +1 -1
  316. package/dist/d1-coordinator-runtime.d.ts +9 -1
  317. package/dist/d1-coordinator-runtime.d.ts.map +1 -1
  318. package/dist/d1-coordinator-store.d.ts +108 -5
  319. package/dist/d1-coordinator-store.d.ts.map +1 -1
  320. package/dist/db.d.ts.map +1 -1
  321. package/dist/export-import.d.ts +2 -0
  322. package/dist/export-import.d.ts.map +1 -1
  323. package/dist/extraction-tier-routing.d.ts.map +1 -1
  324. package/dist/file-context-transport.d.ts +93 -0
  325. package/dist/file-context-transport.d.ts.map +1 -0
  326. package/dist/file-context.d.ts +58 -0
  327. package/dist/file-context.d.ts.map +1 -0
  328. package/dist/filters.d.ts +14 -3
  329. package/dist/filters.d.ts.map +1 -1
  330. package/dist/index.d.ts +43 -11
  331. package/dist/index.d.ts.map +1 -1
  332. package/dist/index.js +29731 -23760
  333. package/dist/index.js.map +1 -1
  334. package/dist/ingest-pipeline.d.ts +4 -0
  335. package/dist/ingest-pipeline.d.ts.map +1 -1
  336. package/dist/ingest-xml-parser.d.ts +2 -5
  337. package/dist/ingest-xml-parser.d.ts.map +1 -1
  338. package/dist/ingest-xml-scan.d.ts +30 -0
  339. package/dist/ingest-xml-scan.d.ts.map +1 -0
  340. package/dist/internal/cloudflare-coordinator.d.ts +23 -2
  341. package/dist/internal/cloudflare-coordinator.d.ts.map +1 -1
  342. package/dist/internal/cloudflare-coordinator.js +4109 -372
  343. package/dist/internal/cloudflare-coordinator.js.map +1 -1
  344. package/dist/legacy-recipient-policy-projection.d.ts.map +1 -1
  345. package/dist/maintenance/relink.d.ts.map +1 -1
  346. package/dist/managed-scope-test-fixtures.d.ts +25 -0
  347. package/dist/managed-scope-test-fixtures.d.ts.map +1 -0
  348. package/dist/memory-creation-provenance.d.ts +13 -0
  349. package/dist/memory-creation-provenance.d.ts.map +1 -0
  350. package/dist/memory-local-capture-test-fixtures.d.ts +39 -0
  351. package/dist/memory-local-capture-test-fixtures.d.ts.map +1 -0
  352. package/dist/memory-local-capture.d.ts +29 -0
  353. package/dist/memory-local-capture.d.ts.map +1 -0
  354. package/dist/memory-ownership-recovery.d.ts.map +1 -1
  355. package/dist/memory-retirement-delivery.d.ts.map +1 -1
  356. package/dist/memory-source-identity.d.ts +3 -0
  357. package/dist/memory-source-identity.d.ts.map +1 -1
  358. package/dist/observer-client.d.ts.map +1 -1
  359. package/dist/observer-output.d.ts.map +1 -1
  360. package/dist/opencode-v2-generation.d.ts.map +1 -1
  361. package/dist/owned-recipient-d1-test-harness.d.ts +7 -0
  362. package/dist/owned-recipient-d1-test-harness.d.ts.map +1 -0
  363. package/dist/owner-browser-admission-authority.d.ts +24 -0
  364. package/dist/owner-browser-admission-authority.d.ts.map +1 -0
  365. package/dist/owner-browser-admission-body.d.ts +8 -0
  366. package/dist/owner-browser-admission-body.d.ts.map +1 -0
  367. package/dist/owner-browser-admission.d.ts +30 -0
  368. package/dist/owner-browser-admission.d.ts.map +1 -0
  369. package/dist/owner-enrollment-admission.d.ts +58 -0
  370. package/dist/owner-enrollment-admission.d.ts.map +1 -0
  371. package/dist/owner-enrollment-link-authority.d.ts +26 -0
  372. package/dist/owner-enrollment-link-authority.d.ts.map +1 -0
  373. package/dist/owner-enrollment-owner-pin-test-harness.d.ts +21 -0
  374. package/dist/owner-enrollment-owner-pin-test-harness.d.ts.map +1 -0
  375. package/dist/owner-enrollment-owner-pin.d.ts +14 -0
  376. package/dist/owner-enrollment-owner-pin.d.ts.map +1 -0
  377. package/dist/owner-enrollment-start-xsoRbhG2.js +14318 -0
  378. package/dist/owner-enrollment-start-xsoRbhG2.js.map +1 -0
  379. package/dist/owner-enrollment-start.d.ts +109 -0
  380. package/dist/owner-enrollment-start.d.ts.map +1 -0
  381. package/dist/owner-qualified-consumer-access-test-harness.d.ts +3 -0
  382. package/dist/owner-qualified-consumer-access-test-harness.d.ts.map +1 -0
  383. package/dist/owner-qualified-consumer-adversarial-test-harness.d.ts +5 -0
  384. package/dist/owner-qualified-consumer-adversarial-test-harness.d.ts.map +1 -0
  385. package/dist/owner-qualified-consumer-test-fixture.d.ts +4 -0
  386. package/dist/owner-qualified-consumer-test-fixture.d.ts.map +1 -0
  387. package/dist/owner-qualified-consumer-test-harness.d.ts +69 -0
  388. package/dist/owner-qualified-consumer-test-harness.d.ts.map +1 -0
  389. package/dist/pack.d.ts.map +1 -1
  390. package/dist/pi-session-search.d.ts +73 -0
  391. package/dist/pi-session-search.d.ts.map +1 -0
  392. package/dist/pi-sessions-import.d.ts +72 -0
  393. package/dist/pi-sessions-import.d.ts.map +1 -0
  394. package/dist/policy-team-device-eligibility.d.ts.map +1 -1
  395. package/dist/project-scope-settings.d.ts +4 -0
  396. package/dist/project-scope-settings.d.ts.map +1 -1
  397. package/dist/{promise-B3UhYSzv.js → promise-BgC-VNzX.js} +436 -214
  398. package/dist/promise-BgC-VNzX.js.map +1 -0
  399. package/dist/{service-contender-9rqn6x4v-pocTjwT1.js → pty-handoff-9rqn6x4v-Dxw6kceQ.js} +2 -2
  400. package/dist/pty-handoff-9rqn6x4v-Dxw6kceQ.js.map +1 -0
  401. package/dist/raw-event-auth-recovery.d.ts +1 -1
  402. package/dist/raw-event-auth-recovery.d.ts.map +1 -1
  403. package/dist/raw-event-flush.d.ts.map +1 -1
  404. package/dist/recipient-policy-deny-overlay.d.ts +9 -0
  405. package/dist/recipient-policy-deny-overlay.d.ts.map +1 -0
  406. package/dist/recipient-policy-reconciliation.d.ts +1 -9
  407. package/dist/recipient-policy-reconciliation.d.ts.map +1 -1
  408. package/dist/ref-queries.d.ts +7 -2
  409. package/dist/ref-queries.d.ts.map +1 -1
  410. package/dist/schema-bootstrap.d.ts +2 -0
  411. package/dist/schema-bootstrap.d.ts.map +1 -1
  412. package/dist/schema.d.ts +160 -0
  413. package/dist/schema.d.ts.map +1 -1
  414. package/dist/scope-membership-cache-test-fixtures.d.ts +19 -0
  415. package/dist/scope-membership-cache-test-fixtures.d.ts.map +1 -0
  416. package/dist/scope-membership-cache.d.ts +15 -2
  417. package/dist/scope-membership-cache.d.ts.map +1 -1
  418. package/dist/scope-membership-evidence.d.ts +17 -0
  419. package/dist/scope-membership-evidence.d.ts.map +1 -0
  420. package/dist/scope-membership-snapshot.d.ts +22 -0
  421. package/dist/scope-membership-snapshot.d.ts.map +1 -0
  422. package/dist/scope-membership-wire.d.ts +4 -0
  423. package/dist/scope-membership-wire.d.ts.map +1 -0
  424. package/dist/scope-resolution.d.ts +15 -37
  425. package/dist/scope-resolution.d.ts.map +1 -1
  426. package/dist/scope-stamping.d.ts +7 -0
  427. package/dist/scope-stamping.d.ts.map +1 -1
  428. package/dist/scope-write-authority-error.d.ts +5 -0
  429. package/dist/scope-write-authority-error.d.ts.map +1 -0
  430. package/dist/search.d.ts +3 -1
  431. package/dist/search.d.ts.map +1 -1
  432. package/dist/session-export-identity-mutation.d.ts +4 -0
  433. package/dist/session-export-identity-mutation.d.ts.map +1 -0
  434. package/dist/session-export-identity.d.ts +7 -0
  435. package/dist/session-export-identity.d.ts.map +1 -0
  436. package/dist/shared-owned-device-enrollment-test-harness.d.ts +33 -0
  437. package/dist/shared-owned-device-enrollment-test-harness.d.ts.map +1 -0
  438. package/dist/shared-owned-join-approval-test-harness.d.ts +9 -0
  439. package/dist/shared-owned-join-approval-test-harness.d.ts.map +1 -0
  440. package/dist/shared-owned-project-invites-test-harness.d.ts +23 -0
  441. package/dist/shared-owned-project-invites-test-harness.d.ts.map +1 -0
  442. package/dist/shared-owned-recipient-invites-test-harness.d.ts +11 -0
  443. package/dist/shared-owned-recipient-invites-test-harness.d.ts.map +1 -0
  444. package/dist/shared-ownership-writer-lifecycle-test-harness.d.ts +19 -0
  445. package/dist/shared-ownership-writer-lifecycle-test-harness.d.ts.map +1 -0
  446. package/dist/store.d.ts +81 -13
  447. package/dist/store.d.ts.map +1 -1
  448. package/dist/summary-memory.d.ts +1 -1
  449. package/dist/summary-memory.d.ts.map +1 -1
  450. package/dist/sync-bootstrap.d.ts.map +1 -1
  451. package/dist/sync-http-client.d.ts +1 -0
  452. package/dist/sync-http-client.d.ts.map +1 -1
  453. package/dist/sync-identity.d.ts +6 -0
  454. package/dist/sync-identity.d.ts.map +1 -1
  455. package/dist/sync-pass.d.ts.map +1 -1
  456. package/dist/sync-replication.d.ts +6 -3
  457. package/dist/sync-replication.d.ts.map +1 -1
  458. package/dist/sync-scope-protocol.d.ts +6 -0
  459. package/dist/sync-scope-protocol.d.ts.map +1 -1
  460. package/dist/sync-status-test-fixtures.d.ts +21 -0
  461. package/dist/sync-status-test-fixtures.d.ts.map +1 -0
  462. package/dist/test-schema.generated.d.ts +1 -1
  463. package/dist/test-schema.generated.d.ts.map +1 -1
  464. package/dist/vector-corpus-epoch.d.ts +10 -0
  465. package/dist/vector-corpus-epoch.d.ts.map +1 -0
  466. package/dist/vector-cutover-validation.d.ts +19 -0
  467. package/dist/vector-cutover-validation.d.ts.map +1 -0
  468. package/dist/vector-metadata-snapshot.d.ts +21 -0
  469. package/dist/vector-metadata-snapshot.d.ts.map +1 -0
  470. package/dist/vector-migration.d.ts.map +1 -1
  471. package/dist/vectors.d.ts +8 -1
  472. package/dist/vectors.d.ts.map +1 -1
  473. package/dist/wildcard-match.d.ts +9 -0
  474. package/dist/wildcard-match.d.ts.map +1 -0
  475. package/dist/workspace-identity.d.ts +18 -0
  476. package/dist/workspace-identity.d.ts.map +1 -0
  477. package/package.json +5 -4
  478. package/dist/coordinator-api-CdUQtf5l.js +0 -3755
  479. package/dist/coordinator-api-CdUQtf5l.js.map +0 -1
  480. package/dist/promise-B3UhYSzv.js.map +0 -1
  481. package/dist/service-contender-9rqn6x4v-pocTjwT1.js.map +0 -1
@@ -0,0 +1,13 @@
1
+ /** Inert V3 display-only storage. Migration preserves every old column and raw
2
+ * payload, assigning legacy baselines without creating any profile rows.
3
+ * V3 writers must explicitly use browser_sequence + 1, compare source orders,
4
+ * and retain empty snapshots. Defaults exist only for the legacy baselines.
5
+ */
6
+ export declare const AUTH_LIFECYCLE_ACCOUNT_PROFILE_TABLE_SQL = "\nCREATE TABLE IF NOT EXISTS coordinator_auth_account_profiles (\n coordinator_id TEXT NOT NULL,\n link_id TEXT NOT NULL,\n display_name TEXT CHECK (display_name IS NULL OR (typeof(display_name) = 'text' AND length(display_name) BETWEEN 1 AND 256)),\n email TEXT CHECK (email IS NULL OR (typeof(email) = 'text' AND length(email) BETWEEN 1 AND 320)),\n email_verified INTEGER CHECK (email_verified IS NULL OR (typeof(email_verified) = 'integer' AND email_verified IN (0,1) AND email IS NOT NULL)),\n picture_url TEXT CHECK (picture_url IS NULL OR (typeof(picture_url) = 'text' AND length(picture_url) BETWEEN 1 AND 2048 AND substr(picture_url, 1, 8) = 'https://')),\n source_session_id TEXT NOT NULL,\n source_signed_in_at_ms INTEGER NOT NULL CHECK (typeof(source_signed_in_at_ms) = 'integer' AND source_signed_in_at_ms BETWEEN 0 AND 9007199225940991),\n source_order INTEGER NOT NULL DEFAULT 1 CHECK (typeof(source_order) = 'integer' AND source_order BETWEEN 1 AND 9007199254740991),\n PRIMARY KEY (coordinator_id, link_id)\n);";
7
+ export declare const AUTH_LIFECYCLE_LINK_PROFILE_TABLE_SQL = "\nCREATE TABLE IF NOT EXISTS coordinator_auth_link_profiles (\n coordinator_id TEXT NOT NULL,\n attempt_id TEXT NOT NULL,\n issuer TEXT NOT NULL,\n subject TEXT NOT NULL,\n auth_config_revision TEXT NOT NULL,\n browser_transaction_hash TEXT NOT NULL,\n link_id TEXT,\n display_name TEXT,\n email TEXT,\n email_verified INTEGER CHECK (email_verified IS NULL OR (email_verified IN (0,1) AND email IS NOT NULL)),\n picture_url TEXT,\n verified_at_ms INTEGER NOT NULL,\n source_order INTEGER NOT NULL DEFAULT 0 CHECK (typeof(source_order) = 'integer' AND (source_order = 0 OR source_order BETWEEN 2 AND 9007199254740991)),\n source_purpose TEXT NOT NULL DEFAULT 'link' CHECK (source_purpose IN ('link','link_change')),\n PRIMARY KEY (coordinator_id, attempt_id),\n UNIQUE (coordinator_id, link_id),\n CHECK (source_purpose = 'link' OR link_id IS NULL),\n CHECK (source_purpose = 'link' OR source_order >= 2)\n);";
8
+ /** No session provenance: a refresh is sourced from its own completed attempt.
9
+ * Receipt/proof validation and newer-order-only writes belong to finalization,
10
+ * not these shape constraints. No provider tokens or completion payload live here.
11
+ */
12
+ export declare const AUTH_LINK_PROFILE_REFRESH_TABLE_SQL = "\nCREATE TABLE IF NOT EXISTS coordinator_auth_link_profile_refreshes (\n coordinator_id TEXT NOT NULL,\n link_id TEXT NOT NULL,\n display_name TEXT CHECK (display_name IS NULL OR (typeof(display_name) = 'text' AND length(display_name) BETWEEN 1 AND 256)),\n email TEXT CHECK (email IS NULL OR (typeof(email) = 'text' AND length(email) BETWEEN 1 AND 320)),\n email_verified INTEGER CHECK (email_verified IS NULL OR (typeof(email_verified) = 'integer' AND email_verified IN (0,1) AND email IS NOT NULL)),\n picture_url TEXT CHECK (picture_url IS NULL OR (typeof(picture_url) = 'text' AND length(picture_url) BETWEEN 1 AND 2048 AND substr(picture_url, 1, 8) = 'https://')),\n source_attempt_id TEXT NOT NULL CHECK (typeof(source_attempt_id) = 'text' AND length(source_attempt_id) BETWEEN 1 AND 256 AND source_attempt_id = trim(source_attempt_id) AND instr(source_attempt_id, char(0)) = 0),\n verified_at_ms INTEGER NOT NULL CHECK (typeof(verified_at_ms) = 'integer' AND verified_at_ms BETWEEN 0 AND 9007199254740991),\n source_order INTEGER NOT NULL CHECK (typeof(source_order) = 'integer' AND source_order BETWEEN 2 AND 9007199254740991),\n PRIMARY KEY (coordinator_id, link_id)\n);";
13
+ //# sourceMappingURL=coordinator-auth-lifecycle-profile-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinator-auth-lifecycle-profile-schema.d.ts","sourceRoot":"","sources":["../src/coordinator-auth-lifecycle-profile-schema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,wCAAwC,wgCAYlD,CAAC;AAEJ,eAAO,MAAM,qCAAqC,g5BAoB/C,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,mCAAmC,iqCAY7C,CAAC"}
@@ -0,0 +1,22 @@
1
+ /** Pure SQL predicates for future transactional assertion statements. No I/O or
2
+ * migration execution. Missing tables may fail SQL preparation, which also
3
+ * rejects the predecessor; callers must never interpret lookup errors as ready.
4
+ * Copies must still compare all raw values and recheck target constraints.
5
+ */
6
+ export declare const AUTH_LIFECYCLE_PREDECESSOR_CHECKS: readonly Readonly<{
7
+ name: string;
8
+ matches: string;
9
+ }>[];
10
+ /** Portable main-schema checks for D1. SQLite callers must first apply the
11
+ * separate temporary-schema check, or use the SQLite recognition statement.
12
+ * Use individual checks to locate a failed pin without exposing account data.
13
+ */
14
+ export declare const AUTH_LIFECYCLE_PREDECESSOR_PREDICATE_SQL: string;
15
+ export declare const AUTH_LIFECYCLE_PREDECESSOR_RECOGNITION_SQL: string;
16
+ /** SQLite-only: any connection-local object can change unqualified resolution
17
+ * or trigger behavior. Reject it before a preserving upgrade; never clear it.
18
+ * sqlite_temp_master is unavailable on D1 and must not enter its SQL export.
19
+ */
20
+ export declare const AUTH_LIFECYCLE_SQLITE_TEMP_SCHEMA_CHECK_SQL = "NOT EXISTS (SELECT 1 FROM sqlite_temp_master)";
21
+ export declare const AUTH_LIFECYCLE_SQLITE_PREDECESSOR_RECOGNITION_SQL: string;
22
+ //# sourceMappingURL=coordinator-auth-lifecycle-recognition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinator-auth-lifecycle-recognition.d.ts","sourceRoot":"","sources":["../src/coordinator-auth-lifecycle-recognition.ts"],"names":[],"mappings":"AAqHA;;;;GAIG;AACH,eAAO,MAAM,iCAAiC;;;IAuC5C,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,wCAAwC,QAEpC,CAAC;AAElB,eAAO,MAAM,0CAA0C,QAAuE,CAAC;AAE/H;;;GAGG;AACH,eAAO,MAAM,2CAA2C,kDACR,CAAC;AAEjD,eAAO,MAAM,iDAAiD,QAEe,CAAC"}
@@ -0,0 +1,20 @@
1
+ /** Inert V3 definitions: no initializer, migration, or runtime imports this module.
2
+ * Historical copies and association backfill must precede guard installation.
3
+ * End-receipt matching belongs to the separate change-attempt schema; these
4
+ * definitions alone are not an activatable lifecycle schema.
5
+ */
6
+ export declare const AUTH_ACCOUNT_ASSOCIATION_TABLE_SQL = "\nCREATE TABLE IF NOT EXISTS coordinator_auth_account_associations (\n coordinator_id TEXT NOT NULL,\n issuer TEXT NOT NULL,\n subject TEXT NOT NULL CHECK (length(subject) BETWEEN 1 AND 255),\n identity_id TEXT NOT NULL,\n first_link_id TEXT NOT NULL,\n created_at_ms INTEGER NOT NULL,\n PRIMARY KEY (coordinator_id, issuer, subject)\n);";
7
+ /** Existing birth columns and authority checks retain their predecessor shape. */
8
+ export declare const AUTH_ACCOUNT_LINK_GENERATION_TABLE_SQL = "\nCREATE TABLE IF NOT EXISTS coordinator_auth_account_links (\n coordinator_id TEXT NOT NULL,\n link_id TEXT NOT NULL,\n issuer TEXT NOT NULL,\n subject TEXT NOT NULL CHECK (length(subject) BETWEEN 1 AND 255),\n identity_id TEXT NOT NULL,\n attempt_id TEXT NOT NULL,\n controller_attestation_id TEXT,\n auth_config_revision TEXT NOT NULL CHECK (length(auth_config_revision) = 64 AND auth_config_revision NOT GLOB '*[^0-9a-f]*'),\n created_at_ms INTEGER NOT NULL,\n revoked_at_ms INTEGER,\n authority_kind TEXT NOT NULL CHECK (authority_kind IN ('controller_attestation','device_claim')),\n device_claim_id TEXT,\n generation INTEGER NOT NULL CHECK (typeof(generation) = 'integer' AND generation BETWEEN 1 AND 9007199254740991),\n ended_at_ms INTEGER CHECK (ended_at_ms IS NULL OR (typeof(ended_at_ms) = 'integer' AND ended_at_ms BETWEEN 0 AND 9007199254740991 AND ended_at_ms >= created_at_ms)),\n end_reason TEXT CHECK (end_reason IS NULL OR end_reason = 'user_disconnected'),\n end_attempt_id TEXT CHECK (end_attempt_id IS NULL OR (typeof(end_attempt_id) = 'text' AND length(end_attempt_id) BETWEEN 1 AND 256 AND end_attempt_id = trim(end_attempt_id) AND instr(end_attempt_id, char(0)) = 0)),\n signin_sequence_floor INTEGER NOT NULL CHECK (typeof(signin_sequence_floor) = 'integer' AND signin_sequence_floor BETWEEN 0 AND 9007199254740990),\n PRIMARY KEY (coordinator_id, link_id),\n UNIQUE (coordinator_id, attempt_id),\n UNIQUE (coordinator_id, identity_id, generation),\n CHECK ((ended_at_ms IS NULL AND end_reason IS NULL AND end_attempt_id IS NULL)\n OR (ended_at_ms IS NOT NULL AND end_reason IS NOT NULL AND end_attempt_id IS NOT NULL)),\n CHECK ((authority_kind = 'controller_attestation'\n AND (controller_attestation_id IS NOT NULL AND typeof(controller_attestation_id) = 'text' AND length(controller_attestation_id) BETWEEN 1 AND 256 AND controller_attestation_id = trim(controller_attestation_id) AND instr(controller_attestation_id, char(0)) = 0) AND device_claim_id IS NULL)\n OR (authority_kind = 'device_claim' AND controller_attestation_id IS NULL\n AND (device_claim_id IS NOT NULL AND typeof(device_claim_id) = 'text' AND length(device_claim_id) BETWEEN 1 AND 256 AND device_claim_id = trim(device_claim_id) AND instr(device_claim_id, char(0)) = 0)))\n);";
9
+ export declare const AUTH_ACCOUNT_LINK_GENERATION_INDEX_STATEMENTS: readonly ["CREATE UNIQUE INDEX IF NOT EXISTS idx_auth_account_links_open_identity\n ON coordinator_auth_account_links(coordinator_id, identity_id)\n WHERE revoked_at_ms IS NULL AND ended_at_ms IS NULL;", "CREATE UNIQUE INDEX IF NOT EXISTS idx_auth_account_links_open_account\n ON coordinator_auth_account_links(coordinator_id, issuer, subject)\n WHERE revoked_at_ms IS NULL AND ended_at_ms IS NULL;"];
10
+ export declare const AUTH_ACCOUNT_ASSOCIATION_GUARD_STATEMENTS: readonly ["CREATE TRIGGER IF NOT EXISTS auth_account_associations_insert_collision\n BEFORE INSERT ON coordinator_auth_account_associations\n WHEN EXISTS (SELECT 1 FROM coordinator_auth_account_associations a\n WHERE a.rowid = NEW.rowid OR (a.coordinator_id = NEW.coordinator_id\n AND a.issuer = NEW.issuer AND a.subject = NEW.subject))\n BEGIN SELECT RAISE(ABORT, 'auth_account_association_collision'); END;", "CREATE TRIGGER IF NOT EXISTS auth_account_associations_immutable_update\n BEFORE UPDATE ON coordinator_auth_account_associations\n BEGIN SELECT RAISE(ABORT, 'auth_account_association_immutable'); END;", "CREATE TRIGGER IF NOT EXISTS auth_account_associations_immutable_delete\n BEFORE DELETE ON coordinator_auth_account_associations\n BEGIN SELECT RAISE(ABORT, 'auth_account_association_immutable'); END;"];
11
+ export declare const AUTH_ACCOUNT_LINK_GENERATION_GUARD_STATEMENTS: readonly ["CREATE TRIGGER IF NOT EXISTS auth_account_links_insert_collision\n BEFORE INSERT ON coordinator_auth_account_links\n WHEN EXISTS (SELECT 1 FROM coordinator_auth_account_links l\n WHERE l.rowid = NEW.rowid OR (l.coordinator_id = NEW.coordinator_id AND (\n l.link_id = NEW.link_id OR l.attempt_id = NEW.attempt_id\n OR (l.identity_id = NEW.identity_id AND l.generation = NEW.generation)\n OR (NEW.revoked_at_ms IS NULL AND NEW.ended_at_ms IS NULL\n AND l.revoked_at_ms IS NULL AND l.ended_at_ms IS NULL\n AND (l.identity_id = NEW.identity_id OR (l.issuer = NEW.issuer AND l.subject = NEW.subject))))))\n BEGIN SELECT RAISE(ABORT, 'auth_account_link_collision'); END;", "CREATE TRIGGER IF NOT EXISTS auth_account_links_insert_authority\n BEFORE INSERT ON coordinator_auth_account_links\n WHEN NOT EXISTS (SELECT 1 FROM coordinator_auth_account_associations a\n WHERE a.coordinator_id = NEW.coordinator_id AND a.issuer = NEW.issuer\n AND a.subject = NEW.subject AND a.identity_id = NEW.identity_id)\n OR EXISTS (SELECT 1 FROM coordinator_auth_account_links l\n WHERE l.coordinator_id = NEW.coordinator_id AND l.identity_id = NEW.identity_id\n AND l.revoked_at_ms IS NOT NULL)\n BEGIN SELECT RAISE(ABORT, 'auth_account_link_unavailable'); END;", "CREATE TRIGGER IF NOT EXISTS auth_account_links_immutable_update\n BEFORE UPDATE ON coordinator_auth_account_links\n WHEN OLD.rowid IS NOT NEW.rowid\n OR OLD.coordinator_id IS NOT NEW.coordinator_id OR OLD.link_id IS NOT NEW.link_id\n OR OLD.issuer IS NOT NEW.issuer OR OLD.subject IS NOT NEW.subject\n OR OLD.identity_id IS NOT NEW.identity_id OR OLD.attempt_id IS NOT NEW.attempt_id\n OR OLD.controller_attestation_id IS NOT NEW.controller_attestation_id\n OR OLD.auth_config_revision IS NOT NEW.auth_config_revision\n OR OLD.created_at_ms IS NOT NEW.created_at_ms OR OLD.authority_kind IS NOT NEW.authority_kind\n OR OLD.device_claim_id IS NOT NEW.device_claim_id OR OLD.generation IS NOT NEW.generation\n OR OLD.signin_sequence_floor IS NOT NEW.signin_sequence_floor\n OR (OLD.revoked_at_ms IS NOT NULL AND OLD.revoked_at_ms IS NOT NEW.revoked_at_ms)\n OR (OLD.revoked_at_ms IS NULL AND NEW.revoked_at_ms IS NOT NULL AND (\n typeof(NEW.revoked_at_ms) <> 'integer' OR NEW.revoked_at_ms < OLD.created_at_ms\n OR NEW.revoked_at_ms NOT BETWEEN 0 AND 9007199254740991))\n OR (OLD.ended_at_ms IS NOT NULL AND (OLD.ended_at_ms IS NOT NEW.ended_at_ms\n OR OLD.end_reason IS NOT NEW.end_reason OR OLD.end_attempt_id IS NOT NEW.end_attempt_id))\n OR (OLD.ended_at_ms IS NULL AND NEW.ended_at_ms IS NOT NULL AND (\n OLD.revoked_at_ms IS NOT NULL OR OLD.revoked_at_ms IS NOT NEW.revoked_at_ms))\n BEGIN SELECT RAISE(ABORT, 'auth_account_link_immutable'); END;", "CREATE TRIGGER IF NOT EXISTS auth_account_links_immutable_delete\n BEFORE DELETE ON coordinator_auth_account_links\n BEGIN SELECT RAISE(ABORT, 'auth_account_link_immutable'); END;"];
12
+ /** Fourth claim-table trigger: the frozen V2 exact-three check must reject it.
13
+ * Canonical key derivation remains the signed writer's job; SQLite compares the
14
+ * exact public-key and fingerprint pins, never substitutes a PEM hash for key_id.
15
+ * The attempt transitions first; claim, link and audit inserts follow atomically.
16
+ */
17
+ export declare const AUTH_DEVICE_CLAIM_FIRST_GENERATION_GUARD_SQL = "\nCREATE TRIGGER IF NOT EXISTS coordinator_auth_device_claims_first_generation\n BEFORE INSERT ON coordinator_auth_device_claims\n WHEN NOT EXISTS (SELECT 1 FROM coordinator_auth_link_attempts t\n WHERE t.coordinator_id = NEW.coordinator_id AND t.attempt_id = NEW.attempt_id\n AND t.link_id = NEW.claim_id AND t.prior_link_id IS NULL AND t.prior_generation IS NULL\n AND t.authority_kind = 'device_claim' AND t.state = 'finalized'\n AND t.controller_attestation_id IS NULL AND t.controller_review_receipt_id IS NULL\n AND t.controller_revision IS NULL AND t.identity_id = NEW.identity_id\n AND t.group_id = NEW.group_id AND t.device_id = NEW.device_id\n AND t.public_key = NEW.public_key AND t.fingerprint = NEW.fingerprint\n AND t.issuer = NEW.issuer AND t.auth_config_revision = NEW.auth_config_revision\n AND t.finalized_at_ms = NEW.created_at_ms AND t.account_subject IS NOT NULL\n AND t.runtime_verifier_hash IS NOT NULL AND t.browser_start_hash IS NOT NULL\n AND t.browser_transaction_hash IS NOT NULL AND t.completion_secret_hash IS NOT NULL\n AND t.created_at_ms <= t.claimed_at_ms AND t.claimed_at_ms <= t.oidc_verified_at_ms\n AND t.oidc_verified_at_ms <= t.confirmed_at_ms\n AND t.confirmed_at_ms <= t.finalized_at_ms AND t.finalized_at_ms < t.expires_at_ms)\n OR EXISTS (SELECT 1 FROM coordinator_auth_account_links l\n WHERE l.coordinator_id = NEW.coordinator_id AND l.identity_id = NEW.identity_id)\n BEGIN SELECT RAISE(ABORT, 'auth_device_claim_genesis_unavailable'); END;";
18
+ /** Keep the existing audit table, action checks and historical columns unchanged. */
19
+ export declare const AUTH_LINK_AUDIT_RECEIPT_GUARD_STATEMENTS: readonly ["CREATE TRIGGER IF NOT EXISTS auth_link_audit_insert_collision\n BEFORE INSERT ON coordinator_auth_link_audit_log\n WHEN EXISTS (SELECT 1 FROM coordinator_auth_link_audit_log a\n WHERE a.rowid = NEW.rowid OR (a.coordinator_id = NEW.coordinator_id\n AND a.link_id = NEW.link_id AND a.action = NEW.action))\n BEGIN SELECT RAISE(ABORT, 'auth_link_audit_collision'); END;", "CREATE TRIGGER IF NOT EXISTS auth_link_audit_immutable_update\n BEFORE UPDATE ON coordinator_auth_link_audit_log\n BEGIN SELECT RAISE(ABORT, 'auth_link_audit_immutable'); END;", "CREATE TRIGGER IF NOT EXISTS auth_link_audit_immutable_delete\n BEFORE DELETE ON coordinator_auth_link_audit_log\n BEGIN SELECT RAISE(ABORT, 'auth_link_audit_immutable'); END;"];
20
+ //# sourceMappingURL=coordinator-auth-lifecycle-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinator-auth-lifecycle-schema.d.ts","sourceRoot":"","sources":["../src/coordinator-auth-lifecycle-schema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,kCAAkC,sVAS5C,CAAC;AAEJ,kFAAkF;AAClF,eAAO,MAAM,sCAAsC,6uEA4BhD,CAAC;AAEJ,eAAO,MAAM,6CAA6C,kZAO/C,CAAC;AAEZ,eAAO,MAAM,yCAAyC,uzBAc3C,CAAC;AAEZ,eAAO,MAAM,6CAA6C,k2FA4C/C,CAAC;AAEZ;;;;GAIG;AACH,eAAO,MAAM,4CAA4C,m+CAoBiB,CAAC;AAE3E,qFAAqF;AACrF,eAAO,MAAM,wCAAwC,suBAa1C,CAAC"}
@@ -0,0 +1,36 @@
1
+ /** Inert SQL only. The operator transaction owns recognition, checks, swaps and
2
+ * scratch cleanup. Drop owned snapshots only after every preservation check.
3
+ * Never use these builders on a live store or before predecessor recognition.
4
+ */
5
+ export declare const AUTH_LIFECYCLE_COPY_TABLE_NAMES: readonly ["coordinator_auth_link_attempts", "coordinator_auth_account_links", "coordinator_auth_link_audit_log", "coordinator_auth_browser_transactions", "coordinator_auth_sessions", "coordinator_auth_session_receipts", "coordinator_auth_account_profiles", "coordinator_auth_link_profiles", "coordinator_auth_device_claims"];
6
+ export type AuthLifecycleCopyTable = (typeof AUTH_LIFECYCLE_COPY_TABLE_NAMES)[number];
7
+ export type AuthLifecycleCopyLocation = "original" | "upgrade" | "retained";
8
+ export interface AuthLifecycleSnapshotOptions {
9
+ table: AuthLifecycleCopyTable;
10
+ source?: "original" | "retained";
11
+ }
12
+ export interface AuthLifecycleCopyOptions extends AuthLifecycleSnapshotOptions {
13
+ destination?: "original" | "upgrade";
14
+ /** Browser sequence is an INTEGER PRIMARY KEY alias for the old rowid. */
15
+ targetRowId?: "rowid" | "browser_sequence";
16
+ /** New fields only; literals, never SQL expressions. Defaults belong to DDL. */
17
+ extraColumns?: Readonly<Record<string, string | number | null>>;
18
+ }
19
+ export interface AuthLifecyclePreservationOptions {
20
+ table: AuthLifecycleCopyTable;
21
+ destination?: AuthLifecycleCopyLocation;
22
+ targetRowId?: "rowid" | "browser_sequence";
23
+ }
24
+ /** No IF NOT EXISTS: stale or foreign scratch must fail, never be reused. */
25
+ export declare function authLifecycleSnapshotStatements(options: AuthLifecycleSnapshotOptions): readonly string[];
26
+ /** Copies originals directly, not their encoded snapshot. Appended fields are
27
+ * deliberately absent unless supplied as explicit new-column literals.
28
+ */
29
+ export declare function authLifecycleCopyStatement(options: AuthLifecycleCopyOptions): string;
30
+ /** Returns a scalar SQL predicate, not a SELECT statement or an assertion side
31
+ * effect. The assembler must make a false result abort its whole transaction.
32
+ * Counts plus both EXCEPT directions retain multiplicity and exact row identity.
33
+ * This checks old fields only; new lifecycle invariants need separate checks.
34
+ */
35
+ export declare function authLifecyclePreservationCheck(options: AuthLifecyclePreservationOptions): string;
36
+ //# sourceMappingURL=coordinator-auth-lifecycle-upgrade-copy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinator-auth-lifecycle-upgrade-copy.d.ts","sourceRoot":"","sources":["../src/coordinator-auth-lifecycle-upgrade-copy.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,+BAA+B,sUAUjC,CAAC;AAEZ,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,+BAA+B,CAAC,CAAC,MAAM,CAAC,CAAC;AACtF,MAAM,MAAM,yBAAyB,GAAG,UAAU,GAAG,SAAS,GAAG,UAAU,CAAC;AAC5E,MAAM,WAAW,4BAA4B;IAC5C,KAAK,EAAE,sBAAsB,CAAC;IAC9B,MAAM,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;CACjC;AACD,MAAM,WAAW,wBAAyB,SAAQ,4BAA4B;IAC7E,WAAW,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACrC,0EAA0E;IAC1E,WAAW,CAAC,EAAE,OAAO,GAAG,kBAAkB,CAAC;IAC3C,gFAAgF;IAChF,YAAY,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;CAChE;AACD,MAAM,WAAW,gCAAgC;IAChD,KAAK,EAAE,sBAAsB,CAAC;IAC9B,WAAW,CAAC,EAAE,yBAAyB,CAAC;IACxC,WAAW,CAAC,EAAE,OAAO,GAAG,kBAAkB,CAAC;CAC3C;AAoGD,6EAA6E;AAC7E,wBAAgB,+BAA+B,CAC9C,OAAO,EAAE,4BAA4B,GACnC,SAAS,MAAM,EAAE,CAKnB;AAcD;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,wBAAwB,GAAG,MAAM,CAyBpF;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,gCAAgC,GAAG,MAAM,CAMhG"}
@@ -0,0 +1,11 @@
1
+ import type { Database } from "better-sqlite3";
2
+ export declare class CoordinatorAuthLifecycleUpgradeRejectedError extends Error {
3
+ constructor();
4
+ }
5
+ /** Explicit invocation only. Never call from store open or normal auth requests.
6
+ * The dedicated connection must not already have a transaction open.
7
+ * SQLite-only connection checks run inside the same reserved write transaction,
8
+ * before preparing or executing any migration SQL that TEMP could shadow.
9
+ */
10
+ export declare function upgradeAuthLifecycleSchema(db: Database): void;
11
+ //# sourceMappingURL=coordinator-auth-lifecycle-upgrade-sqlite.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinator-auth-lifecycle-upgrade-sqlite.d.ts","sourceRoot":"","sources":["../src/coordinator-auth-lifecycle-upgrade-sqlite.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAI/C,qBAAa,4CAA6C,SAAQ,KAAK;IACtE,cAKC;CACD;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI,CAsB7D"}
@@ -0,0 +1,31 @@
1
+ import { type Database as SqliteDatabase } from "better-sqlite3";
2
+ export declare const LEGACY_AUTH_TABLES: readonly ["coordinator_auth_account_links", "coordinator_auth_link_attempts", "coordinator_auth_link_audit_log", "coordinator_auth_browser_transactions", "coordinator_auth_sessions", "coordinator_auth_session_receipts", "coordinator_auth_account_profiles", "coordinator_auth_link_profiles", "coordinator_auth_device_claims"];
3
+ export declare const hash: (index: number) => string;
4
+ export declare function insert(db: SqliteDatabase, table: string, row: Record<string, unknown>): void;
5
+ export declare function columns(db: SqliteDatabase, table: string): string[];
6
+ export declare function populatedPredecessor(source: "inline" | "migrations"): SqliteDatabase;
7
+ /** Independent oracle: read live predecessor columns, not the production copy inventory/builders. */
8
+ export declare function rawAuthSnapshot(db: SqliteDatabase, inventory?: readonly {
9
+ table: string;
10
+ columns: readonly string[];
11
+ rowid?: boolean;
12
+ }[]): {
13
+ table: string;
14
+ columns: readonly string[];
15
+ rows: unknown[];
16
+ }[];
17
+ /** Rollback preserves logical storage, not unspecified bytes in SQLite's free pages. */
18
+ export declare function databaseState(db: SqliteDatabase): {
19
+ schema: {
20
+ type: string;
21
+ name: string;
22
+ tbl_name: string;
23
+ sql: string | null;
24
+ }[];
25
+ data: {
26
+ table: string;
27
+ columns: readonly string[];
28
+ rows: unknown[];
29
+ }[];
30
+ };
31
+ //# sourceMappingURL=coordinator-auth-lifecycle-upgrade-test-fixture.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinator-auth-lifecycle-upgrade-test-fixture.d.ts","sourceRoot":"","sources":["../src/coordinator-auth-lifecycle-upgrade-test-fixture.ts"],"names":[],"mappings":"AACA,OAAiB,EAAE,KAAK,QAAQ,IAAI,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAI3E,eAAO,MAAM,kBAAkB,YAC9B,gCAAgC,EAChC,gCAAgC,EAChC,iCAAiC,EACjC,uCAAuC,EACvC,2BAA2B,EAC3B,mCAAmC,EACnC,mCAAmC,EACnC,gCAAgC,EAChC,gCAAgC,CACvB,CAAC;AACX,eAAO,MAAM,IAAI,UAAW,MAAM,WAAwC,CAAC;AAC3E,wBAAgB,MAAM,CAAC,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,QAKrF;AACD,wBAAgB,OAAO,CAAC,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,YAIxD;AAuHD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,QAAQ,GAAG,YAAY,GAAG,cAAc,CAoCpF;AAED,qGAAqG;AACrG,wBAAgB,eAAe,CAC9B,EAAE,EAAE,cAAc,EAClB,SAAS,GAAE,SAAS;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;CAChB,EAAgF;;;;IAoBjF;AAED,wFAAwF;AACxF,wBAAgB,aAAa,CAAC,EAAE,EAAE,cAAc;;cAG5B,MAAM;cAAQ,MAAM;kBAAY,MAAM;aAAO,MAAM,GAAG,IAAI;;;;;;;EAS7E"}
@@ -0,0 +1,6 @@
1
+ /** Each array entry is one D1 statement. Never split this SQL on semicolons:
2
+ * trigger bodies contain statement delimiters. No entry may exceed 100 KB.
3
+ */
4
+ export declare const AUTH_LIFECYCLE_UPGRADE_STATEMENTS: readonly string[];
5
+ export declare const AUTH_LIFECYCLE_UPGRADE_SQL: string;
6
+ //# sourceMappingURL=coordinator-auth-lifecycle-upgrade.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinator-auth-lifecycle-upgrade.d.ts","sourceRoot":"","sources":["../src/coordinator-auth-lifecycle-upgrade.ts"],"names":[],"mappings":"AA2MA;;GAEG;AACH,eAAO,MAAM,iCAAiC,mBA2E7C,CAAC;AAMF,eAAO,MAAM,0BAA0B,QAAwD,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { Database } from "better-sqlite3";
2
+ /**
3
+ * Exact D1 batch statements, deliberately outside the auto-discovered migration
4
+ * directory. No BEGIN/COMMIT or FK toggle. All assertions and comparisons precede
5
+ * every swap. An existing assertion/rebuild object aborts; it is never reused.
6
+ * Missing historical controllers/enrollments do not erase completed provenance.
7
+ * Unknown schema, custom indexes/triggers, or external DDL mentioning these
8
+ * tables requires review (including inbound FKs/views). D1 disallows the table-valued
9
+ * foreign-key PRAGMA, so this conservative text check can also reject benign DDL.
10
+ */
11
+ export declare const AUTH_LINK_AUTHORITY_UPGRADE_SQL: string;
12
+ /** Only the link-table source above has no triggers; each proof trigger stays one statement. */
13
+ export declare const AUTH_LINK_AUTHORITY_CUTOVER_STATEMENTS: readonly string[];
14
+ export declare const AUTH_LINK_AUTHORITY_CUTOVER_SQL: string;
15
+ /** Explicit invocation only; never call on open. Failure rolls back all DDL/data, including proofs. */
16
+ export declare function upgradeAuthLinkAuthoritySchema(db: Database): void;
17
+ //# sourceMappingURL=coordinator-auth-link-authority-upgrade.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinator-auth-link-authority-upgrade.d.ts","sourceRoot":"","sources":["../src/coordinator-auth-link-authority-upgrade.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AA2S/C;;;;;;;;GAQG;AACH,eAAO,MAAM,+BAA+B,QAY3C,CAAC;AAEF,gGAAgG;AAChG,eAAO,MAAM,sCAAsC,mBAMjD,CAAC;AAEH,eAAO,MAAM,+BAA+B,QAE1B,CAAC;AAEnB,uGAAuG;AACvG,wBAAgB,8BAA8B,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI,CAEjE"}
@@ -0,0 +1,92 @@
1
+ /**
2
+ * Authority contract for coordinator account links.
3
+ *
4
+ * Every link attempt, account link, and link audit row names its authority source:
5
+ * - `controller_attestation`: an admin-reviewed attestation for the exact enrolled key.
6
+ * - `device_claim`: an eligible enrolled-key claim while an attempt is pending.
7
+ * Link and audit rows reference proof committed after Google verification and
8
+ * device finalization. It is never an operator review.
9
+ *
10
+ * Rows store the kind explicitly and reference only the record that matches it.
11
+ * Readers must fail closed on any row whose references disagree with its kind.
12
+ */
13
+ export declare const AUTH_LINK_AUTHORITY_KINDS: readonly ["controller_attestation", "device_claim"];
14
+ export type CoordinatorAuthLinkAuthorityKind = (typeof AUTH_LINK_AUTHORITY_KINDS)[number];
15
+ export type CoordinatorAuthLinkAttemptAuthority = {
16
+ kind: "controller_attestation";
17
+ controllerAttestationId: string;
18
+ controllerReviewReceiptId: string;
19
+ } | {
20
+ kind: "device_claim";
21
+ };
22
+ export type CoordinatorAuthLinkRecordAuthority = {
23
+ kind: "controller_attestation";
24
+ controllerAttestationId: string;
25
+ } | {
26
+ kind: "device_claim";
27
+ deviceClaimId: string;
28
+ };
29
+ /** Link-attempt columns. A pending device claim has no committed claim record yet. */
30
+ export interface AuthLinkAttemptAuthorityRow {
31
+ authority_kind: unknown;
32
+ controller_attestation_id: unknown;
33
+ controller_review_receipt_id: unknown;
34
+ controller_revision: unknown;
35
+ }
36
+ /** Account-link and audit columns. */
37
+ export interface AuthLinkRecordAuthorityRow {
38
+ authority_kind: unknown;
39
+ controller_attestation_id: unknown;
40
+ device_claim_id: unknown;
41
+ }
42
+ /** Returns null for a corrupt row; callers must treat that as no authority. */
43
+ export declare function readAuthLinkAttemptAuthority(row: AuthLinkAttemptAuthorityRow): CoordinatorAuthLinkAttemptAuthority | null;
44
+ /** Returns null for a corrupt row; callers must treat that as no authority. */
45
+ export declare function readAuthLinkRecordAuthority(row: AuthLinkRecordAuthorityRow): CoordinatorAuthLinkRecordAuthority | null;
46
+ /**
47
+ * Operator-only consumers accept no other source kind. This classifies a stored
48
+ * reference, not caller permission. In-flight links revalidate their source;
49
+ * completed-link consumers apply historical-provenance and active-link checks.
50
+ */
51
+ export declare function isOperatorReviewedAuthority(authority: CoordinatorAuthLinkRecordAuthority | null): boolean;
52
+ interface AccountLinkStatusSubject {
53
+ version: 2;
54
+ coordinatorId: string;
55
+ groupId: string;
56
+ deviceId: string;
57
+ fingerprint: string;
58
+ }
59
+ type AccountMetadata = {
60
+ email?: string;
61
+ displayName?: string;
62
+ pictureUrl?: string;
63
+ };
64
+ /**
65
+ * Signed-device account-link status for the requested Identity.
66
+ * `unlinked` is eligibility only; for `device_claim` nothing is verified or
67
+ * reserved until the same operation's device finalization commits.
68
+ * `account` is null whenever the link Identity differs from the requested one.
69
+ */
70
+ export type CoordinatorAccountLinkStatusV2 = AccountLinkStatusSubject & ({
71
+ state: "review_required" | "conflict";
72
+ identityId: null;
73
+ authority: null;
74
+ account: null;
75
+ } | {
76
+ state: "unlinked";
77
+ identityId: string;
78
+ authority: CoordinatorAuthLinkAuthorityKind;
79
+ account: null;
80
+ } | {
81
+ state: "linked";
82
+ identityId: string;
83
+ authority: CoordinatorAuthLinkAuthorityKind;
84
+ account: AccountMetadata | null;
85
+ } | {
86
+ state: "revoked";
87
+ identityId: string;
88
+ authority: CoordinatorAuthLinkAuthorityKind;
89
+ account: null;
90
+ });
91
+ export {};
92
+ //# sourceMappingURL=coordinator-auth-link-authority.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinator-auth-link-authority.d.ts","sourceRoot":"","sources":["../src/coordinator-auth-link-authority.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,eAAO,MAAM,yBAAyB,YAAI,wBAAwB,EAAE,cAAc,CAAU,CAAC;AAC7F,MAAM,MAAM,gCAAgC,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1F,MAAM,MAAM,mCAAmC,GAC5C;IACA,IAAI,EAAE,wBAAwB,CAAC;IAC/B,uBAAuB,EAAE,MAAM,CAAC;IAChC,yBAAyB,EAAE,MAAM,CAAC;CACjC,GACD;IAAE,IAAI,EAAE,cAAc,CAAA;CAAE,CAAC;AAE5B,MAAM,MAAM,kCAAkC,GAC3C;IAAE,IAAI,EAAE,wBAAwB,CAAC;IAAC,uBAAuB,EAAE,MAAM,CAAA;CAAE,GACnE;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnD,sFAAsF;AACtF,MAAM,WAAW,2BAA2B;IAC3C,cAAc,EAAE,OAAO,CAAC;IACxB,yBAAyB,EAAE,OAAO,CAAC;IACnC,4BAA4B,EAAE,OAAO,CAAC;IACtC,mBAAmB,EAAE,OAAO,CAAC;CAC7B;AAED,sCAAsC;AACtC,MAAM,WAAW,0BAA0B;IAC1C,cAAc,EAAE,OAAO,CAAC;IACxB,yBAAyB,EAAE,OAAO,CAAC;IACnC,eAAe,EAAE,OAAO,CAAC;CACzB;AAED,+EAA+E;AAC/E,wBAAgB,4BAA4B,CAC3C,GAAG,EAAE,2BAA2B,GAC9B,mCAAmC,GAAG,IAAI,CAoB5C;AAED,+EAA+E;AAC/E,wBAAgB,2BAA2B,CAC1C,GAAG,EAAE,0BAA0B,GAC7B,kCAAkC,GAAG,IAAI,CAQ3C;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAC1C,SAAS,EAAE,kCAAkC,GAAG,IAAI,GAClD,OAAO,CAET;AAED,UAAU,wBAAwB;IACjC,OAAO,EAAE,CAAC,CAAC;IACX,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACpB;AACD,KAAK,eAAe,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAErF;;;;;GAKG;AACH,MAAM,MAAM,8BAA8B,GAAG,wBAAwB,GACpE,CACG;IACA,KAAK,EAAE,iBAAiB,GAAG,UAAU,CAAC;IACtC,UAAU,EAAE,IAAI,CAAC;IACjB,SAAS,EAAE,IAAI,CAAC;IAChB,OAAO,EAAE,IAAI,CAAC;CACb,GACD;IACA,KAAK,EAAE,UAAU,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,gCAAgC,CAAC;IAC5C,OAAO,EAAE,IAAI,CAAC;CACb,GACD;IACA,KAAK,EAAE,QAAQ,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,gCAAgC,CAAC;IAC5C,OAAO,EAAE,eAAe,GAAG,IAAI,CAAC;CAC/B,GACD;IACA,KAAK,EAAE,SAAS,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,gCAAgC,CAAC;IAC5C,OAAO,EAAE,IAAI,CAAC;CACb,CACH,CAAC"}
@@ -0,0 +1,21 @@
1
+ export declare const AUTH_LINK_CHANGE_ATTEMPT_TABLE_SQL: string;
2
+ export declare const AUTH_LINK_CHANGE_ATTEMPT_INDEX_STATEMENTS: readonly ["CREATE UNIQUE INDEX IF NOT EXISTS idx_auth_link_change_active_identity\n ON coordinator_auth_link_change_attempts(coordinator_id, identity_id) WHERE state IN ('pending','browser_claimed','oidc_verified','confirmed');", "CREATE INDEX IF NOT EXISTS idx_auth_link_change_device_created\n ON coordinator_auth_link_change_attempts(coordinator_id, group_id, device_id, created_at_ms);", "CREATE INDEX IF NOT EXISTS idx_auth_link_change_identity_expiry\n ON coordinator_auth_link_change_attempts(coordinator_id, identity_id, expires_at_ms);", "CREATE INDEX IF NOT EXISTS idx_auth_link_change_state_expiry\n ON coordinator_auth_link_change_attempts(coordinator_id, state, expires_at_ms);"];
3
+ export declare const AUTH_LINK_CHANGE_ATTEMPT_GUARD_STATEMENTS: readonly [`CREATE TRIGGER IF NOT EXISTS auth_link_change_insert_live_target
4
+ BEFORE INSERT ON coordinator_auth_link_change_attempts WHEN NOT ${string}
5
+ BEGIN SELECT RAISE(ABORT, 'auth_link_change_target_unavailable'); END;`, `CREATE TRIGGER IF NOT EXISTS auth_link_change_complete_live_target
6
+ BEFORE UPDATE ON coordinator_auth_link_change_attempts
7
+ WHEN NEW.state = 'completed' AND OLD.state <> NEW.state AND NOT ${string}
8
+ BEGIN SELECT RAISE(ABORT, 'auth_link_change_target_unavailable'); END;`, "CREATE TRIGGER IF NOT EXISTS auth_link_change_insert_collision\n BEFORE INSERT ON coordinator_auth_link_change_attempts\n WHEN EXISTS (SELECT 1 FROM coordinator_auth_link_change_attempts a WHERE a.rowid = NEW.rowid OR (a.coordinator_id = NEW.coordinator_id AND (\n a.attempt_id = NEW.attempt_id OR a.runtime_verifier_hash = NEW.runtime_verifier_hash\n OR a.browser_start_hash = NEW.browser_start_hash OR a.browser_transaction_hash = NEW.browser_transaction_hash\n OR a.completion_secret_hash = NEW.completion_secret_hash\n OR (a.identity_id = NEW.identity_id AND a.state IN ('pending','browser_claimed','oidc_verified','confirmed') AND NEW.state IN ('pending','browser_claimed','oidc_verified','confirmed')))))\n BEGIN SELECT RAISE(ABORT, 'auth_link_change_collision'); END;", "CREATE TRIGGER IF NOT EXISTS auth_link_change_insert_pending\n BEFORE INSERT ON coordinator_auth_link_change_attempts WHEN NEW.state <> 'pending'\n BEGIN SELECT RAISE(ABORT, 'auth_link_change_birth_invalid'); END;", "CREATE TRIGGER IF NOT EXISTS auth_link_change_update_collision\n BEFORE UPDATE ON coordinator_auth_link_change_attempts\n WHEN EXISTS (SELECT 1 FROM coordinator_auth_link_change_attempts a WHERE a.rowid <> OLD.rowid AND (a.rowid = NEW.rowid OR (a.coordinator_id = NEW.coordinator_id AND (\n a.attempt_id = NEW.attempt_id OR a.runtime_verifier_hash = NEW.runtime_verifier_hash\n OR a.browser_start_hash = NEW.browser_start_hash OR a.browser_transaction_hash = NEW.browser_transaction_hash\n OR a.completion_secret_hash = NEW.completion_secret_hash\n OR (a.identity_id = NEW.identity_id AND a.state IN ('pending','browser_claimed','oidc_verified','confirmed') AND NEW.state IN ('pending','browser_claimed','oidc_verified','confirmed'))))))\n BEGIN SELECT RAISE(ABORT, 'auth_link_change_collision'); END;", `CREATE TRIGGER IF NOT EXISTS auth_link_change_pins_update
9
+ BEFORE UPDATE ON coordinator_auth_link_change_attempts
10
+ WHEN OLD.rowid IS NOT NEW.rowid
11
+ OR ${string}
12
+ OR ${string}
13
+ OR (OLD.failure_reason IS NOT NEW.failure_reason AND NOT (OLD.state IN ('pending','browser_claimed','oidc_verified','confirmed') AND NEW.state = 'failed'))
14
+ OR (OLD.failed_at_ms IS NOT NEW.failed_at_ms AND NOT (OLD.state IN ('pending','browser_claimed','oidc_verified','confirmed') AND NEW.state = 'failed'))
15
+ BEGIN SELECT RAISE(ABORT, 'auth_link_change_pins_immutable'); END;`, "CREATE TRIGGER IF NOT EXISTS auth_link_change_state_update\n BEFORE UPDATE ON coordinator_auth_link_change_attempts WHEN OLD.state IS NOT NEW.state AND NOT (\n (OLD.state = 'pending' AND NEW.state = 'browser_claimed')\n OR (OLD.state = 'browser_claimed' AND NEW.state = 'oidc_verified')\n OR (OLD.state = 'oidc_verified' AND NEW.state = 'confirmed')\n OR (OLD.state = 'confirmed' AND NEW.state = 'completed')\n OR (OLD.state IN ('pending','browser_claimed','oidc_verified','confirmed') AND NEW.state IN ('failed','expired')))\n BEGIN SELECT RAISE(ABORT, 'auth_link_change_transition_invalid'); END;", "CREATE TRIGGER IF NOT EXISTS auth_link_change_completed_update\n BEFORE UPDATE ON coordinator_auth_link_change_attempts WHEN OLD.state = 'completed'\n BEGIN SELECT RAISE(ABORT, 'auth_link_change_receipt_immutable'); END;", "CREATE TRIGGER IF NOT EXISTS auth_link_change_completed_delete\n BEFORE DELETE ON coordinator_auth_link_change_attempts WHEN OLD.state = 'completed'\n BEGIN SELECT RAISE(ABORT, 'auth_link_change_receipt_immutable'); END;"];
16
+ /** The attempt completes first, then the target ends in the same future batch.
17
+ * This checks retained metadata, not current enrollment/attestation eligibility.
18
+ * Birth config need not equal the fresh attempt's same-issuer config revision.
19
+ */
20
+ export declare const AUTH_LINK_CHANGE_END_RECEIPT_GUARD_SQL: string;
21
+ //# sourceMappingURL=coordinator-auth-link-change-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinator-auth-link-change-schema.d.ts","sourceRoot":"","sources":["../src/coordinator-auth-link-change-schema.ts"],"names":[],"mappings":"AAuBA,eAAO,MAAM,kCAAkC,QAqE5C,CAAC;AAEJ,eAAO,MAAM,yCAAyC,srBAS3C,CAAC;AA6DZ,eAAO,MAAM,yCAAyC;;;;;;;;;;;;omCA4C3C,CAAC;AAEZ;;;GAGG;AACH,eAAO,MAAM,sCAAsC,QA0BsB,CAAC"}
@@ -0,0 +1,137 @@
1
+ export declare const AUTH_LINK_PURPOSE = "coordinator-account-link-v1";
2
+ export declare const AUTH_LINK_ATTEMPT_TTL_MS = 600000;
3
+ export declare const AUTH_LINK_MAX_ACTIVE_PER_DEVICE = 2;
4
+ export declare const AUTH_LINK_MAX_ACTIVE_PER_IDENTITY = 3;
5
+ export declare const AUTH_LINK_CREATE_WINDOW_MS = 3600000;
6
+ export declare const AUTH_LINK_MAX_CREATES_PER_DEVICE_WINDOW = 6;
7
+ export declare const AUTH_LINK_RETENTION_WINDOW_MS = 2592000000;
8
+ export declare const AUTH_LINK_MAX_CREATES_PER_DEVICE_RETENTION = 60;
9
+ export declare const AUTH_LINK_MAX_UNFINISHED_PER_COORDINATOR = 10000;
10
+ export declare const AUTH_LINK_EXPIRE_BATCH_MAX = 32;
11
+ /** Trusted server configuration, never request JSON. */
12
+ export interface CoordinatorAuthLinkConfig {
13
+ coordinatorId: string;
14
+ issuer: string;
15
+ revision: string;
16
+ enabled: boolean;
17
+ }
18
+ /** Already verified request key possession; SQL rechecks the selected authority source. */
19
+ export interface CoordinatorAuthLinkSigner {
20
+ groupId: string;
21
+ deviceId: string;
22
+ publicKey: string;
23
+ fingerprint: string;
24
+ }
25
+ export type CoordinatorAuthLinkRequester = {
26
+ kind: "device";
27
+ signer: CoordinatorAuthLinkSigner;
28
+ } | {
29
+ kind: "browser";
30
+ browserTransactionHash: string;
31
+ };
32
+ export type CoordinatorAuthLinkState = "pending" | "browser_claimed" | "oidc_verified" | "confirmed" | "finalized" | "session_redeemed" | "expired" | "failed";
33
+ export interface CoordinatorAuthLinkStatus {
34
+ attemptId: string;
35
+ state: CoordinatorAuthLinkState;
36
+ expiresAtMs: number;
37
+ }
38
+ export type CoordinatorAuthLinkError = "invalid_input" | "controller_not_active" | "attempt_conflict" | "attempt_limited" | "attempt_unavailable" | "attempt_expired" | "auth_config_changed" | "link_conflict";
39
+ export interface CoordinatorAuthLinkRejected {
40
+ kind: "rejected";
41
+ error: CoordinatorAuthLinkError;
42
+ }
43
+ export interface CoordinatorAuthLinkMaintenanceOptions {
44
+ limit?: number;
45
+ }
46
+ export type CoordinatorAuthLinkMaintenanceResult = {
47
+ kind: "maintained";
48
+ processedCount: number;
49
+ more: boolean;
50
+ } | CoordinatorAuthLinkRejected;
51
+ export type CoordinatorAuthLinkResult = {
52
+ kind: "applied" | "existing";
53
+ status: CoordinatorAuthLinkStatus;
54
+ } | CoordinatorAuthLinkRejected;
55
+ export type CoordinatorAuthLinkCreateResult = {
56
+ kind: "created" | "existing";
57
+ status: CoordinatorAuthLinkStatus;
58
+ identityId: string;
59
+ } | CoordinatorAuthLinkRejected;
60
+ export type CoordinatorAuthLinkOidcResult = {
61
+ kind: "applied";
62
+ status: CoordinatorAuthLinkStatus;
63
+ target: {
64
+ identityId: string;
65
+ groupId: string;
66
+ deviceId: string;
67
+ };
68
+ } | CoordinatorAuthLinkRejected;
69
+ export interface CoordinatorAuthLinkCreateInput {
70
+ /** Trusted server-selected source; device claims pin the current local Identity. */
71
+ authority: {
72
+ kind: "controller_attestation";
73
+ } | {
74
+ kind: "device_claim";
75
+ identityId: string;
76
+ };
77
+ /** Public HTTP callers pin their current Identity for either source kind. */
78
+ expectedIdentityId?: string;
79
+ attemptId: string;
80
+ signer: CoordinatorAuthLinkSigner;
81
+ runtimeVerifierHash: string;
82
+ loopbackRedirect: string;
83
+ /** Required for device claims; trusted attested callers may omit it. */
84
+ browserStartHash?: string;
85
+ }
86
+ export interface CoordinatorAuthLinkClaimInput {
87
+ attemptId: string;
88
+ browserTransactionHash: string;
89
+ }
90
+ export interface CoordinatorAuthLinkOidcInput extends CoordinatorAuthLinkClaimInput {
91
+ account: {
92
+ issuer: string;
93
+ subject: string;
94
+ };
95
+ /** Optional display claims from the same verified callback, never request JSON. */
96
+ profile?: unknown;
97
+ }
98
+ export interface CoordinatorAuthLinkConfirmInput extends CoordinatorAuthLinkClaimInput {
99
+ completionSecretHash: string;
100
+ }
101
+ export interface CoordinatorAuthLinkFinalizeInput {
102
+ purpose: typeof AUTH_LINK_PURPOSE;
103
+ coordinatorId: string;
104
+ attemptId: string;
105
+ groupId: string;
106
+ identityId: string;
107
+ deviceId: string;
108
+ fingerprint: string;
109
+ runtimeVerifierHash: string;
110
+ completionSecretHash: string;
111
+ signer: CoordinatorAuthLinkSigner;
112
+ }
113
+ export interface CoordinatorAuthLinkFailInput {
114
+ attemptId: string;
115
+ requester: CoordinatorAuthLinkRequester;
116
+ reason: "cancelled" | "provider_failure" | "config_failure";
117
+ }
118
+ export interface CoordinatorAuthLinkStore {
119
+ maintainAuthLinkAttempts(config: CoordinatorAuthLinkConfig, options?: CoordinatorAuthLinkMaintenanceOptions): Promise<CoordinatorAuthLinkMaintenanceResult>;
120
+ createAuthLinkAttempt(input: CoordinatorAuthLinkCreateInput, config: CoordinatorAuthLinkConfig): Promise<CoordinatorAuthLinkCreateResult>;
121
+ claimAuthLinkAttempt(input: CoordinatorAuthLinkClaimInput, config: CoordinatorAuthLinkConfig): Promise<CoordinatorAuthLinkResult>;
122
+ recordAuthLinkOidcVerified(input: CoordinatorAuthLinkOidcInput, config: CoordinatorAuthLinkConfig): Promise<CoordinatorAuthLinkOidcResult>;
123
+ confirmAuthLinkAttempt(input: CoordinatorAuthLinkConfirmInput, config: CoordinatorAuthLinkConfig): Promise<CoordinatorAuthLinkResult>;
124
+ readAuthLinkCompletionDestination(input: CoordinatorAuthLinkClaimInput, config: CoordinatorAuthLinkConfig): Promise<{
125
+ destination: string;
126
+ } | null>;
127
+ finalizeAuthLinkAttempt(input: CoordinatorAuthLinkFinalizeInput, config: CoordinatorAuthLinkConfig): Promise<CoordinatorAuthLinkResult>;
128
+ failAuthLinkAttempt(input: CoordinatorAuthLinkFailInput, config: CoordinatorAuthLinkConfig): Promise<CoordinatorAuthLinkResult>;
129
+ getAuthLinkAttemptStatus(attemptId: string, requester: CoordinatorAuthLinkRequester, config: CoordinatorAuthLinkConfig): Promise<CoordinatorAuthLinkStatus | null>;
130
+ }
131
+ export interface CoordinatorAuthLinkOptions {
132
+ authClock?: () => number;
133
+ }
134
+ export declare const AUTH_LINK_BROWSER_START_COLUMN_SQL = "browser_start_hash TEXT CHECK (browser_start_hash IS NULL OR (length(browser_start_hash) = 64 AND browser_start_hash NOT GLOB '*[^0-9a-f]*'))";
135
+ export declare const AUTH_LINK_BROWSER_START_INDEX_SQL = "CREATE UNIQUE INDEX IF NOT EXISTS idx_auth_link_attempts_browser_start\n ON coordinator_auth_link_attempts(coordinator_id, browser_start_hash);";
136
+ export declare const AUTH_LINK_SCHEMA_SQL = "\nCREATE TABLE IF NOT EXISTS coordinator_auth_link_attempts (\n coordinator_id TEXT NOT NULL,\n attempt_id TEXT NOT NULL,\n identity_id TEXT NOT NULL,\n group_id TEXT NOT NULL,\n device_id TEXT NOT NULL,\n public_key TEXT NOT NULL,\n fingerprint TEXT NOT NULL CHECK (length(fingerprint) = 64 AND fingerprint NOT GLOB '*[^0-9a-f]*'),\n controller_attestation_id TEXT,\n controller_review_receipt_id TEXT,\n controller_revision INTEGER,\n issuer TEXT NOT NULL,\n auth_config_revision TEXT NOT NULL CHECK (length(auth_config_revision) = 64 AND auth_config_revision NOT GLOB '*[^0-9a-f]*'),\n runtime_verifier_hash TEXT NOT NULL CHECK (length(runtime_verifier_hash) = 64 AND runtime_verifier_hash NOT GLOB '*[^0-9a-f]*'),\n loopback_redirect TEXT NOT NULL,\n state TEXT NOT NULL CHECK (state IN ('pending','browser_claimed','oidc_verified','confirmed','finalized','session_redeemed','expired','failed')),\n browser_transaction_hash TEXT CHECK (browser_transaction_hash IS NULL OR (length(browser_transaction_hash) = 64 AND browser_transaction_hash NOT GLOB '*[^0-9a-f]*')),\n account_subject TEXT CHECK (account_subject IS NULL OR length(account_subject) BETWEEN 1 AND 255),\n completion_secret_hash TEXT CHECK (completion_secret_hash IS NULL OR (length(completion_secret_hash) = 64 AND completion_secret_hash NOT GLOB '*[^0-9a-f]*')),\n link_id TEXT,\n failure_reason TEXT CHECK (failure_reason IS NULL OR failure_reason IN ('device_cancelled','browser_cancelled','provider_failure','config_failure')),\n created_at_ms INTEGER NOT NULL CHECK (typeof(created_at_ms) = 'integer' AND created_at_ms >= 0 AND created_at_ms <= 9007199254140991),\n expires_at_ms INTEGER NOT NULL CHECK (typeof(expires_at_ms) = 'integer' AND expires_at_ms = created_at_ms + 600000),\n claimed_at_ms INTEGER,\n oidc_verified_at_ms INTEGER,\n confirmed_at_ms INTEGER,\n finalized_at_ms INTEGER,\n failed_at_ms INTEGER,\n browser_start_hash TEXT CHECK (browser_start_hash IS NULL OR (length(browser_start_hash) = 64 AND browser_start_hash NOT GLOB '*[^0-9a-f]*')),\n authority_kind TEXT NOT NULL CHECK (authority_kind IN ('controller_attestation','device_claim')),\n PRIMARY KEY (coordinator_id, attempt_id),\n UNIQUE (coordinator_id, runtime_verifier_hash),\n UNIQUE (coordinator_id, browser_transaction_hash),\n UNIQUE (coordinator_id, completion_secret_hash),\n UNIQUE (coordinator_id, link_id),\n CHECK (state <> 'pending' OR (browser_transaction_hash IS NULL AND account_subject IS NULL AND completion_secret_hash IS NULL AND link_id IS NULL)),\n CHECK (state NOT IN ('browser_claimed','oidc_verified','confirmed','finalized','session_redeemed') OR browser_transaction_hash IS NOT NULL),\n CHECK (state NOT IN ('oidc_verified','confirmed','finalized','session_redeemed') OR account_subject IS NOT NULL),\n CHECK (state NOT IN ('confirmed','finalized','session_redeemed') OR completion_secret_hash IS NOT NULL),\n CHECK ((state IN ('finalized','session_redeemed') AND link_id IS NOT NULL AND finalized_at_ms IS NOT NULL) OR (state NOT IN ('finalized','session_redeemed') AND link_id IS NULL AND finalized_at_ms IS NULL)),\n CHECK ((state = 'failed' AND failure_reason IS NOT NULL AND failed_at_ms IS NOT NULL) OR (state <> 'failed' AND failure_reason IS NULL AND failed_at_ms IS NULL)),\n CHECK ((authority_kind = 'controller_attestation'\n AND (controller_attestation_id IS NOT NULL AND typeof(controller_attestation_id) = 'text' AND length(controller_attestation_id) BETWEEN 1 AND 256 AND controller_attestation_id = trim(controller_attestation_id) AND instr(controller_attestation_id, char(0)) = 0)\n AND (controller_review_receipt_id IS NOT NULL AND typeof(controller_review_receipt_id) = 'text' AND length(controller_review_receipt_id) BETWEEN 1 AND 256 AND controller_review_receipt_id = trim(controller_review_receipt_id) AND instr(controller_review_receipt_id, char(0)) = 0)\n AND controller_revision IS NOT NULL AND typeof(controller_revision) = 'integer' AND controller_revision = 1)\n OR (authority_kind = 'device_claim' AND controller_attestation_id IS NULL AND controller_review_receipt_id IS NULL AND controller_revision IS NULL))\n);\nCREATE TABLE IF NOT EXISTS coordinator_auth_account_links (\n coordinator_id TEXT NOT NULL,\n link_id TEXT NOT NULL,\n issuer TEXT NOT NULL,\n subject TEXT NOT NULL CHECK (length(subject) BETWEEN 1 AND 255),\n identity_id TEXT NOT NULL,\n attempt_id TEXT NOT NULL,\n controller_attestation_id TEXT,\n auth_config_revision TEXT NOT NULL CHECK (length(auth_config_revision) = 64 AND auth_config_revision NOT GLOB '*[^0-9a-f]*'),\n created_at_ms INTEGER NOT NULL,\n revoked_at_ms INTEGER,\n authority_kind TEXT NOT NULL CHECK (authority_kind IN ('controller_attestation','device_claim')),\n device_claim_id TEXT,\n PRIMARY KEY (coordinator_id, link_id),\n UNIQUE (coordinator_id, issuer, subject),\n UNIQUE (coordinator_id, identity_id),\n UNIQUE (coordinator_id, attempt_id),\n UNIQUE (device_claim_id),\n CHECK ((authority_kind = 'controller_attestation'\n AND (controller_attestation_id IS NOT NULL AND typeof(controller_attestation_id) = 'text' AND length(controller_attestation_id) BETWEEN 1 AND 256 AND controller_attestation_id = trim(controller_attestation_id) AND instr(controller_attestation_id, char(0)) = 0) AND device_claim_id IS NULL)\n OR (authority_kind = 'device_claim' AND controller_attestation_id IS NULL\n AND (device_claim_id IS NOT NULL AND typeof(device_claim_id) = 'text' AND length(device_claim_id) BETWEEN 1 AND 256 AND device_claim_id = trim(device_claim_id) AND instr(device_claim_id, char(0)) = 0)))\n);\nCREATE TABLE IF NOT EXISTS coordinator_auth_link_audit_log (\n coordinator_id TEXT NOT NULL,\n link_id TEXT NOT NULL,\n action TEXT NOT NULL CHECK (action IN ('link_created','link_revoked')),\n attempt_id TEXT NOT NULL,\n identity_id TEXT NOT NULL,\n group_id TEXT NOT NULL,\n device_id TEXT NOT NULL,\n fingerprint TEXT NOT NULL CHECK (length(fingerprint) = 64 AND fingerprint NOT GLOB '*[^0-9a-f]*'),\n controller_attestation_id TEXT,\n auth_config_revision TEXT NOT NULL CHECK (length(auth_config_revision) = 64 AND auth_config_revision NOT GLOB '*[^0-9a-f]*'),\n created_at_ms INTEGER NOT NULL,\n authority_kind TEXT NOT NULL CHECK (authority_kind IN ('controller_attestation','device_claim')),\n device_claim_id TEXT,\n PRIMARY KEY (coordinator_id, link_id, action),\n CHECK ((authority_kind = 'controller_attestation'\n AND (controller_attestation_id IS NOT NULL AND typeof(controller_attestation_id) = 'text' AND length(controller_attestation_id) BETWEEN 1 AND 256 AND controller_attestation_id = trim(controller_attestation_id) AND instr(controller_attestation_id, char(0)) = 0) AND device_claim_id IS NULL)\n OR (authority_kind = 'device_claim' AND controller_attestation_id IS NULL\n AND (device_claim_id IS NOT NULL AND typeof(device_claim_id) = 'text' AND length(device_claim_id) BETWEEN 1 AND 256 AND device_claim_id = trim(device_claim_id) AND instr(device_claim_id, char(0)) = 0)))\n);\nCREATE INDEX IF NOT EXISTS idx_auth_link_attempts_device_created\n ON coordinator_auth_link_attempts(coordinator_id, group_id, device_id, created_at_ms);\nCREATE INDEX IF NOT EXISTS idx_auth_link_attempts_identity_expiry\n ON coordinator_auth_link_attempts(coordinator_id, identity_id, expires_at_ms);\nCREATE INDEX IF NOT EXISTS idx_auth_link_attempts_state_expiry\n ON coordinator_auth_link_attempts(coordinator_id, state, expires_at_ms);\nCREATE UNIQUE INDEX IF NOT EXISTS idx_auth_link_attempts_browser_start\n ON coordinator_auth_link_attempts(coordinator_id, browser_start_hash);";
137
+ //# sourceMappingURL=coordinator-auth-link-contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinator-auth-link-contract.d.ts","sourceRoot":"","sources":["../src/coordinator-auth-link-contract.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,7 @@
1
+ import type { CoordinatorAuthLinkConfig, CoordinatorAuthLinkSigner } from "./coordinator-auth-link-contract.js";
2
+ export type Captured = Record<string, unknown>;
3
+ export declare function isHash(value: unknown): value is string;
4
+ export declare function capture(value: unknown, fields: readonly string[]): Captured | null;
5
+ export declare function captureAuthLinkConfig(value: unknown): CoordinatorAuthLinkConfig | null;
6
+ export declare function captureAuthLinkSigner(value: unknown): CoordinatorAuthLinkSigner | null;
7
+ //# sourceMappingURL=coordinator-auth-link-input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinator-auth-link-input.d.ts","sourceRoot":"","sources":["../src/coordinator-auth-link-input.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACX,yBAAyB,EACzB,yBAAyB,EACzB,MAAM,qCAAqC,CAAC;AAE7C,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAC/C,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAEtD;AACD,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,QAAQ,GAAG,IAAI,CAclF;AACD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,yBAAyB,GAAG,IAAI,CAWtF;AAMD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,yBAAyB,GAAG,IAAI,CAWtF"}
@@ -0,0 +1,2 @@
1
+ export declare const LEGACY_INLINE_AUTH_LINK_SCHEMA_SQL = "\nCREATE TABLE IF NOT EXISTS coordinator_auth_link_attempts (\n coordinator_id TEXT NOT NULL,\n attempt_id TEXT NOT NULL,\n identity_id TEXT NOT NULL,\n group_id TEXT NOT NULL,\n device_id TEXT NOT NULL,\n public_key TEXT NOT NULL,\n fingerprint TEXT NOT NULL CHECK (length(fingerprint) = 64 AND fingerprint NOT GLOB '*[^0-9a-f]*'),\n controller_attestation_id TEXT NOT NULL,\n controller_review_receipt_id TEXT NOT NULL,\n controller_revision INTEGER NOT NULL CHECK (controller_revision = 1),\n issuer TEXT NOT NULL,\n auth_config_revision TEXT NOT NULL CHECK (length(auth_config_revision) = 64 AND auth_config_revision NOT GLOB '*[^0-9a-f]*'),\n runtime_verifier_hash TEXT NOT NULL CHECK (length(runtime_verifier_hash) = 64 AND runtime_verifier_hash NOT GLOB '*[^0-9a-f]*'),\n loopback_redirect TEXT NOT NULL,\n state TEXT NOT NULL CHECK (state IN ('pending','browser_claimed','oidc_verified','confirmed','finalized','session_redeemed','expired','failed')),\n browser_transaction_hash TEXT CHECK (browser_transaction_hash IS NULL OR (length(browser_transaction_hash) = 64 AND browser_transaction_hash NOT GLOB '*[^0-9a-f]*')),\n account_subject TEXT CHECK (account_subject IS NULL OR length(account_subject) BETWEEN 1 AND 255),\n completion_secret_hash TEXT CHECK (completion_secret_hash IS NULL OR (length(completion_secret_hash) = 64 AND completion_secret_hash NOT GLOB '*[^0-9a-f]*')),\n link_id TEXT,\n failure_reason TEXT CHECK (failure_reason IS NULL OR failure_reason IN ('device_cancelled','browser_cancelled','provider_failure','config_failure')),\n created_at_ms INTEGER NOT NULL CHECK (typeof(created_at_ms) = 'integer' AND created_at_ms >= 0 AND created_at_ms <= 9007199254140991),\n expires_at_ms INTEGER NOT NULL CHECK (typeof(expires_at_ms) = 'integer' AND expires_at_ms = created_at_ms + 600000),\n claimed_at_ms INTEGER,\n oidc_verified_at_ms INTEGER,\n confirmed_at_ms INTEGER,\n finalized_at_ms INTEGER,\n failed_at_ms INTEGER,\n browser_start_hash TEXT CHECK (browser_start_hash IS NULL OR (length(browser_start_hash) = 64 AND browser_start_hash NOT GLOB '*[^0-9a-f]*')),\n PRIMARY KEY (coordinator_id, attempt_id),\n UNIQUE (coordinator_id, runtime_verifier_hash),\n UNIQUE (coordinator_id, browser_transaction_hash),\n UNIQUE (coordinator_id, completion_secret_hash),\n UNIQUE (coordinator_id, link_id),\n CHECK (state <> 'pending' OR (browser_transaction_hash IS NULL AND account_subject IS NULL AND completion_secret_hash IS NULL AND link_id IS NULL)),\n CHECK (state NOT IN ('browser_claimed','oidc_verified','confirmed','finalized','session_redeemed') OR browser_transaction_hash IS NOT NULL),\n CHECK (state NOT IN ('oidc_verified','confirmed','finalized','session_redeemed') OR account_subject IS NOT NULL),\n CHECK (state NOT IN ('confirmed','finalized','session_redeemed') OR completion_secret_hash IS NOT NULL),\n CHECK ((state IN ('finalized','session_redeemed') AND link_id IS NOT NULL AND finalized_at_ms IS NOT NULL) OR (state NOT IN ('finalized','session_redeemed') AND link_id IS NULL AND finalized_at_ms IS NULL)),\n CHECK ((state = 'failed' AND failure_reason IS NOT NULL AND failed_at_ms IS NOT NULL) OR (state <> 'failed' AND failure_reason IS NULL AND failed_at_ms IS NULL))\n);\nCREATE TABLE IF NOT EXISTS coordinator_auth_account_links (\n coordinator_id TEXT NOT NULL,\n link_id TEXT NOT NULL,\n issuer TEXT NOT NULL,\n subject TEXT NOT NULL CHECK (length(subject) BETWEEN 1 AND 255),\n identity_id TEXT NOT NULL,\n attempt_id TEXT NOT NULL,\n controller_attestation_id TEXT NOT NULL,\n auth_config_revision TEXT NOT NULL CHECK (length(auth_config_revision) = 64 AND auth_config_revision NOT GLOB '*[^0-9a-f]*'),\n created_at_ms INTEGER NOT NULL,\n revoked_at_ms INTEGER,\n PRIMARY KEY (coordinator_id, link_id),\n UNIQUE (coordinator_id, issuer, subject),\n UNIQUE (coordinator_id, identity_id),\n UNIQUE (coordinator_id, attempt_id)\n);\nCREATE TABLE IF NOT EXISTS coordinator_auth_link_audit_log (\n coordinator_id TEXT NOT NULL,\n link_id TEXT NOT NULL,\n action TEXT NOT NULL CHECK (action IN ('link_created','link_revoked')),\n attempt_id TEXT NOT NULL,\n identity_id TEXT NOT NULL,\n group_id TEXT NOT NULL,\n device_id TEXT NOT NULL,\n fingerprint TEXT NOT NULL CHECK (length(fingerprint) = 64 AND fingerprint NOT GLOB '*[^0-9a-f]*'),\n controller_attestation_id TEXT NOT NULL,\n auth_config_revision TEXT NOT NULL CHECK (length(auth_config_revision) = 64 AND auth_config_revision NOT GLOB '*[^0-9a-f]*'),\n created_at_ms INTEGER NOT NULL,\n PRIMARY KEY (coordinator_id, link_id, action)\n);\nCREATE INDEX IF NOT EXISTS idx_auth_link_attempts_device_created\n ON coordinator_auth_link_attempts(coordinator_id, group_id, device_id, created_at_ms);\nCREATE INDEX IF NOT EXISTS idx_auth_link_attempts_identity_expiry\n ON coordinator_auth_link_attempts(coordinator_id, identity_id, expires_at_ms);\nCREATE INDEX IF NOT EXISTS idx_auth_link_attempts_state_expiry\n ON coordinator_auth_link_attempts(coordinator_id, state, expires_at_ms);\nCREATE UNIQUE INDEX IF NOT EXISTS idx_auth_link_attempts_browser_start\n ON coordinator_auth_link_attempts(coordinator_id, browser_start_hash);";
2
+ //# sourceMappingURL=coordinator-auth-link-legacy-inline-test-fixture.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinator-auth-link-legacy-inline-test-fixture.d.ts","sourceRoot":"","sources":["../src/coordinator-auth-link-legacy-inline-test-fixture.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kCAAkC,khKA+EyB,CAAC"}
@@ -0,0 +1,8 @@
1
+ /** Lifecycle state only, not historical provenance or current device authority.
2
+ * Callers must also validate the link's full authority-specific proof.
3
+ */
4
+ export declare function authLinkLiveGenerationSql(options: {
5
+ link: "l" | "cl";
6
+ connections?: true;
7
+ }): string;
8
+ //# sourceMappingURL=coordinator-auth-link-liveness.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinator-auth-link-liveness.d.ts","sourceRoot":"","sources":["../src/coordinator-auth-link-liveness.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE;IAClD,IAAI,EAAE,GAAG,GAAG,IAAI,CAAC;IACjB,WAAW,CAAC,EAAE,IAAI,CAAC;CACnB,GAAG,MAAM,CAuBT"}
@@ -0,0 +1,14 @@
1
+ import type { CoordinatorAuthLinkSigner } from "./coordinator-auth-link-contract.js";
2
+ import { type LinkFixture } from "./coordinator-auth-link-test-fixtures.js";
3
+ export declare function numberedAttempt(n: number, actor?: {
4
+ groupId: string;
5
+ deviceId: string;
6
+ publicKey: string;
7
+ fingerprint: string;
8
+ }): import("./coordinator-auth-link-contract.js").CoordinatorAuthLinkCreateInput;
9
+ export declare function digest(n: number): string;
10
+ export declare function actor(f: LinkFixture, suffix: string, identityId?: string, coordinatorId?: string): Promise<CoordinatorAuthLinkSigner>;
11
+ export declare function seedCopies(f: LinkFixture, count: number, overrides?: Record<string, unknown>, offset?: number): void;
12
+ export declare function expireAt(f: LinkFixture, createdAt: number): void;
13
+ export declare function allData(f: LinkFixture): unknown[][];
14
+ //# sourceMappingURL=coordinator-auth-link-maintenance-fixtures.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinator-auth-link-maintenance-fixtures.d.ts","sourceRoot":"","sources":["../src/coordinator-auth-link-maintenance-fixtures.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AACrF,OAAO,EAEN,KAAK,WAAW,EAKhB,MAAM,0CAA0C,CAAC;AAGlD,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK;;;;;CAAS,gFAExD;AAED,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,UAE/B;AAED,wBAAsB,KAAK,CAC1B,CAAC,EAAE,WAAW,EACd,MAAM,EAAE,MAAM,EACd,UAAU,SAAe,EACzB,aAAa,SAAsB,GACjC,OAAO,CAAC,yBAAyB,CAAC,CAgBpC;AAID,wBAAgB,UAAU,CACzB,CAAC,EAAE,WAAW,EACd,KAAK,EAAE,MAAM,EACb,SAAS,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,EACvC,MAAM,SAAM,QAyBZ;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,QAIzD;AAED,wBAAgB,OAAO,CAAC,CAAC,EAAE,WAAW,eASrC"}
@@ -0,0 +1,15 @@
1
+ import type { AuthLinkStatement } from "./coordinator-auth-link.js";
2
+ import type { CoordinatorAuthLinkConfig, CoordinatorAuthLinkOidcInput } from "./coordinator-auth-link-contract.js";
3
+ /** Display metadata only. A nullable link_id separates staging from publication. */
4
+ export declare const AUTH_LINK_PROFILE_SCHEMA_SQL = "\nCREATE TABLE IF NOT EXISTS coordinator_auth_link_profiles (\n coordinator_id TEXT NOT NULL,\n attempt_id TEXT NOT NULL,\n issuer TEXT NOT NULL,\n subject TEXT NOT NULL,\n auth_config_revision TEXT NOT NULL,\n browser_transaction_hash TEXT NOT NULL,\n link_id TEXT,\n display_name TEXT,\n email TEXT,\n email_verified INTEGER CHECK (email_verified IS NULL OR (email_verified IN (0,1) AND email IS NOT NULL)),\n picture_url TEXT,\n verified_at_ms INTEGER NOT NULL,\n PRIMARY KEY (coordinator_id, attempt_id),\n UNIQUE (coordinator_id, link_id)\n);";
5
+ /** Must immediately follow the verified OIDC update in the same atomic batch.
6
+ * The native change count prevents same-timestamp replays from filling missing claims.
7
+ */
8
+ export declare function stageAuthLinkProfile(i: CoordinatorAuthLinkOidcInput, c: CoordinatorAuthLinkConfig, now: number): AuthLinkStatement | null;
9
+ /** Append to the finalization batch after the link/audit inserts; conflicts roll back all writes. */
10
+ export declare function promoteAuthLinkProfile(coordinatorId: string, attemptId: string, linkId: string): AuthLinkStatement;
11
+ /** Delete private staging promptly on failure/expiry/config change, and published rows on revocation.
12
+ * Publication never depends on cleanup having run. No authority records are modified.
13
+ */
14
+ export declare function cleanAuthLinkProfiles(c: CoordinatorAuthLinkConfig, now: number, limit: number): AuthLinkStatement;
15
+ //# sourceMappingURL=coordinator-auth-link-profile.d.ts.map