@codemem/core 0.47.0-beta.3 → 0.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (232) hide show
  1. package/dist/account-owner-association-directory.d.ts +6 -0
  2. package/dist/account-owner-association-directory.d.ts.map +1 -0
  3. package/dist/account-owner-association.d.ts +50 -0
  4. package/dist/account-owner-association.d.ts.map +1 -0
  5. package/dist/better-sqlite-coordinator-store.d.ts +27 -1
  6. package/dist/better-sqlite-coordinator-store.d.ts.map +1 -1
  7. package/dist/coordinator-account-change.d.ts +0 -5
  8. package/dist/coordinator-account-change.d.ts.map +1 -1
  9. package/dist/coordinator-account-connection-link.d.ts +7 -1
  10. package/dist/coordinator-account-connection-link.d.ts.map +1 -1
  11. package/dist/coordinator-account-connection-schema.d.ts +3 -0
  12. package/dist/coordinator-account-connection-schema.d.ts.map +1 -1
  13. package/dist/coordinator-account-link-receiver.d.ts +19 -0
  14. package/dist/coordinator-account-link-receiver.d.ts.map +1 -1
  15. package/dist/coordinator-account-link-status.d.ts.map +1 -1
  16. package/dist/coordinator-account-owner-target.d.ts +40 -0
  17. package/dist/coordinator-account-owner-target.d.ts.map +1 -0
  18. package/dist/coordinator-actions.d.ts +5 -0
  19. package/dist/coordinator-actions.d.ts.map +1 -1
  20. package/dist/coordinator-api.d.ts +2 -0
  21. package/dist/coordinator-api.d.ts.map +1 -1
  22. package/dist/coordinator-auth-browser-view.d.ts +6 -0
  23. package/dist/coordinator-auth-browser-view.d.ts.map +1 -1
  24. package/dist/coordinator-auth-controller-consistency-test-fixtures.d.ts +51 -0
  25. package/dist/coordinator-auth-controller-consistency-test-fixtures.d.ts.map +1 -0
  26. package/dist/coordinator-auth-controller-history.d.ts +71 -0
  27. package/dist/coordinator-auth-controller-history.d.ts.map +1 -0
  28. package/dist/coordinator-auth-controller-owner-review.d.ts +35 -0
  29. package/dist/coordinator-auth-controller-owner-review.d.ts.map +1 -0
  30. package/dist/coordinator-auth-controller-owner.d.ts +20 -0
  31. package/dist/coordinator-auth-controller-owner.d.ts.map +1 -0
  32. package/dist/coordinator-auth-controller-review-route.d.ts +16 -2
  33. package/dist/coordinator-auth-controller-review-route.d.ts.map +1 -1
  34. package/dist/coordinator-auth-controller.d.ts +30 -3
  35. package/dist/coordinator-auth-controller.d.ts.map +1 -1
  36. package/dist/coordinator-auth-device-claim-eligibility.d.ts +8 -3
  37. package/dist/coordinator-auth-device-claim-eligibility.d.ts.map +1 -1
  38. package/dist/coordinator-auth-historical-store-test-fixture.d.ts.map +1 -1
  39. package/dist/coordinator-auth-legacy-assignment.d.ts +1 -1
  40. package/dist/coordinator-auth-legacy-assignment.d.ts.map +1 -1
  41. package/dist/coordinator-auth-link-authority.d.ts +2 -1
  42. package/dist/coordinator-auth-link-authority.d.ts.map +1 -1
  43. package/dist/coordinator-auth-link.d.ts +1 -0
  44. package/dist/coordinator-auth-link.d.ts.map +1 -1
  45. package/dist/coordinator-auth-schema.d.ts.map +1 -1
  46. package/dist/coordinator-auth-store-test-fixtures.d.ts.map +1 -1
  47. package/dist/coordinator-browser-auth-app.d.ts.map +1 -1
  48. package/dist/coordinator-browser-auth-callback.d.ts +7 -1
  49. package/dist/coordinator-browser-auth-callback.d.ts.map +1 -1
  50. package/dist/coordinator-device-auth-link.d.ts +6 -1
  51. package/dist/coordinator-device-auth-link.d.ts.map +1 -1
  52. package/dist/coordinator-device-ownership-evidence-classify.d.ts +22 -0
  53. package/dist/coordinator-device-ownership-evidence-classify.d.ts.map +1 -0
  54. package/dist/coordinator-device-ownership-evidence-digest.d.ts +8 -0
  55. package/dist/coordinator-device-ownership-evidence-digest.d.ts.map +1 -0
  56. package/dist/coordinator-device-ownership-evidence-queries.d.ts +13 -0
  57. package/dist/coordinator-device-ownership-evidence-queries.d.ts.map +1 -0
  58. package/dist/coordinator-device-ownership-evidence-test-fixtures.d.ts +80 -0
  59. package/dist/coordinator-device-ownership-evidence-test-fixtures.d.ts.map +1 -0
  60. package/dist/coordinator-device-ownership-evidence.d.ts +60 -0
  61. package/dist/coordinator-device-ownership-evidence.d.ts.map +1 -0
  62. package/dist/coordinator-device-ownership-schema.d.ts +7 -1
  63. package/dist/coordinator-device-ownership-schema.d.ts.map +1 -1
  64. package/dist/coordinator-device-rebind-browser.d.ts +26 -0
  65. package/dist/coordinator-device-rebind-browser.d.ts.map +1 -0
  66. package/dist/coordinator-device-rebind-ceremony.d.ts +126 -0
  67. package/dist/coordinator-device-rebind-ceremony.d.ts.map +1 -0
  68. package/dist/coordinator-device-rebind-client.d.ts +82 -0
  69. package/dist/coordinator-device-rebind-client.d.ts.map +1 -0
  70. package/dist/coordinator-device-rebind-commit.d.ts +58 -0
  71. package/dist/coordinator-device-rebind-commit.d.ts.map +1 -0
  72. package/dist/coordinator-device-rebind-http.d.ts +11 -0
  73. package/dist/coordinator-device-rebind-http.d.ts.map +1 -0
  74. package/dist/coordinator-device-rebind-proof.d.ts +55 -0
  75. package/dist/coordinator-device-rebind-proof.d.ts.map +1 -0
  76. package/dist/coordinator-device-rebind-schema.d.ts +38 -0
  77. package/dist/coordinator-device-rebind-schema.d.ts.map +1 -0
  78. package/dist/coordinator-device-rebind-test-fixtures.d.ts +47 -0
  79. package/dist/coordinator-device-rebind-test-fixtures.d.ts.map +1 -0
  80. package/dist/coordinator-device-rebind-view.d.ts +37 -0
  81. package/dist/coordinator-device-rebind-view.d.ts.map +1 -0
  82. package/dist/coordinator-enrollment-ownership.d.ts +14 -0
  83. package/dist/coordinator-enrollment-ownership.d.ts.map +1 -0
  84. package/dist/coordinator-enrollment-reconciler.d.ts.map +1 -1
  85. package/dist/coordinator-history-sql-equivalence-test-fixtures.d.ts +35 -0
  86. package/dist/coordinator-history-sql-equivalence-test-fixtures.d.ts.map +1 -0
  87. package/dist/coordinator-legacy-completion-owner-proof.d.ts +47 -0
  88. package/dist/coordinator-legacy-completion-owner-proof.d.ts.map +1 -0
  89. package/dist/coordinator-legacy-owner-compatibility.d.ts +33 -0
  90. package/dist/coordinator-legacy-owner-compatibility.d.ts.map +1 -0
  91. package/dist/coordinator-legacy-owner-resolution-birth-test-fixtures.d.ts +3 -0
  92. package/dist/coordinator-legacy-owner-resolution-birth-test-fixtures.d.ts.map +1 -0
  93. package/dist/coordinator-legacy-owner-resolution-commit-test-fixtures.d.ts +54 -0
  94. package/dist/coordinator-legacy-owner-resolution-commit-test-fixtures.d.ts.map +1 -0
  95. package/dist/coordinator-legacy-owner-resolution-commit.d.ts +34 -0
  96. package/dist/coordinator-legacy-owner-resolution-commit.d.ts.map +1 -0
  97. package/dist/coordinator-legacy-owner-resolution-metadata.d.ts +40 -0
  98. package/dist/coordinator-legacy-owner-resolution-metadata.d.ts.map +1 -0
  99. package/dist/coordinator-legacy-owner-resolution-schema.d.ts +70 -0
  100. package/dist/coordinator-legacy-owner-resolution-schema.d.ts.map +1 -0
  101. package/dist/coordinator-legacy-owner-resolution-upgrade.d.ts +4 -0
  102. package/dist/coordinator-legacy-owner-resolution-upgrade.d.ts.map +1 -0
  103. package/dist/coordinator-legacy-team-completion.d.ts +17 -0
  104. package/dist/coordinator-legacy-team-completion.d.ts.map +1 -1
  105. package/dist/coordinator-owner-enrollment-commit.d.ts +7 -6
  106. package/dist/coordinator-owner-enrollment-commit.d.ts.map +1 -1
  107. package/dist/coordinator-owner-negative-consistency.d.ts +38 -0
  108. package/dist/coordinator-owner-negative-consistency.d.ts.map +1 -0
  109. package/dist/coordinator-owner-resolution-review-client.d.ts +17 -0
  110. package/dist/coordinator-owner-resolution-review-client.d.ts.map +1 -0
  111. package/dist/coordinator-owner-resolution-review-read.d.ts +48 -0
  112. package/dist/coordinator-owner-resolution-review-read.d.ts.map +1 -0
  113. package/dist/coordinator-owner-resolution-review-test-fixtures.d.ts +60 -0
  114. package/dist/coordinator-owner-resolution-review-test-fixtures.d.ts.map +1 -0
  115. package/dist/coordinator-owner-resolution-review.d.ts +73 -0
  116. package/dist/coordinator-owner-resolution-review.d.ts.map +1 -0
  117. package/dist/coordinator-producer-negative-owner-test-fixtures.d.ts +26 -0
  118. package/dist/coordinator-producer-negative-owner-test-fixtures.d.ts.map +1 -0
  119. package/dist/coordinator-recipient-owner-consistency.d.ts +8 -0
  120. package/dist/coordinator-recipient-owner-consistency.d.ts.map +1 -0
  121. package/dist/coordinator-resolved-account-owner-status-client.d.ts +27 -0
  122. package/dist/coordinator-resolved-account-owner-status-client.d.ts.map +1 -0
  123. package/dist/coordinator-resolved-account-owner-status-query.d.ts +21 -0
  124. package/dist/coordinator-resolved-account-owner-status-query.d.ts.map +1 -0
  125. package/dist/coordinator-resolved-account-owner-status-test-fixtures.d.ts +84 -0
  126. package/dist/coordinator-resolved-account-owner-status-test-fixtures.d.ts.map +1 -0
  127. package/dist/coordinator-resolved-account-owner-status.d.ts +57 -0
  128. package/dist/coordinator-resolved-account-owner-status.d.ts.map +1 -0
  129. package/dist/coordinator-store-contract.d.ts +4 -0
  130. package/dist/coordinator-store-contract.d.ts.map +1 -1
  131. package/dist/coordinator-store-test-harness.d.ts.map +1 -1
  132. package/dist/d1-coordinator-runtime.d.ts +1 -0
  133. package/dist/d1-coordinator-runtime.d.ts.map +1 -1
  134. package/dist/d1-coordinator-store.d.ts +23 -1
  135. package/dist/d1-coordinator-store.d.ts.map +1 -1
  136. package/dist/db.d.ts.map +1 -1
  137. package/dist/index.d.ts +20 -5
  138. package/dist/index.d.ts.map +1 -1
  139. package/dist/index.js +13953 -18682
  140. package/dist/index.js.map +1 -1
  141. package/dist/internal/cloudflare-coordinator.js +1806 -1329
  142. package/dist/internal/cloudflare-coordinator.js.map +1 -1
  143. package/dist/legacy-team-setup-completion-manifest.d.ts.map +1 -1
  144. package/dist/legacy-team-setup-draft.d.ts +7 -0
  145. package/dist/legacy-team-setup-draft.d.ts.map +1 -1
  146. package/dist/local-identity-generation.d.ts +14 -0
  147. package/dist/local-identity-generation.d.ts.map +1 -0
  148. package/dist/local-identity-switch.d.ts +82 -0
  149. package/dist/local-identity-switch.d.ts.map +1 -0
  150. package/dist/memory-retirement-delivery.d.ts.map +1 -1
  151. package/dist/operational-status.d.ts.map +1 -1
  152. package/dist/owner-enrollment-start-XwN1p7du.js +8395 -0
  153. package/dist/owner-enrollment-start-XwN1p7du.js.map +1 -0
  154. package/dist/pack.d.ts +4 -4
  155. package/dist/pack.d.ts.map +1 -1
  156. package/dist/recipient-policy-contract-Ca40IBUh.js +24 -0
  157. package/dist/recipient-policy-contract-Ca40IBUh.js.map +1 -0
  158. package/dist/recipient-policy-contract.js +2 -24
  159. package/dist/same-actor-peers.d.ts +4 -0
  160. package/dist/same-actor-peers.d.ts.map +1 -0
  161. package/dist/schema-bootstrap.d.ts.map +1 -1
  162. package/dist/schema.d.ts +38 -0
  163. package/dist/schema.d.ts.map +1 -1
  164. package/dist/search.d.ts +2 -0
  165. package/dist/search.d.ts.map +1 -1
  166. package/dist/semantic/semantic-executor-seam.d.ts +30 -0
  167. package/dist/semantic/semantic-executor-seam.d.ts.map +1 -0
  168. package/dist/semantic/semantic-ranking-reference.test-helper.d.ts +34 -0
  169. package/dist/semantic/semantic-ranking-reference.test-helper.d.ts.map +1 -0
  170. package/dist/semantic/semantic-ranking.d.ts +50 -0
  171. package/dist/semantic/semantic-ranking.d.ts.map +1 -0
  172. package/dist/semantic/semantic-ranking.test-helper.d.ts +17 -0
  173. package/dist/semantic/semantic-ranking.test-helper.d.ts.map +1 -0
  174. package/dist/semantic/semantic-worker-entry.d.ts +2 -0
  175. package/dist/semantic/semantic-worker-entry.d.ts.map +1 -0
  176. package/dist/semantic/semantic-worker-executor.d.ts +20 -0
  177. package/dist/semantic/semantic-worker-executor.d.ts.map +1 -0
  178. package/dist/semantic/semantic-worker-job.d.ts +2 -0
  179. package/dist/semantic/semantic-worker-job.d.ts.map +1 -0
  180. package/dist/semantic/semantic-worker-protocol.d.ts +48 -0
  181. package/dist/semantic/semantic-worker-protocol.d.ts.map +1 -0
  182. package/dist/semantic/semantic-worker-queue.d.ts +32 -0
  183. package/dist/semantic/semantic-worker-queue.d.ts.map +1 -0
  184. package/dist/semantic/semantic-worker-ranking.d.ts +8 -0
  185. package/dist/semantic/semantic-worker-ranking.d.ts.map +1 -0
  186. package/dist/semantic/semantic-worker-test-fixtures.d.ts +55 -0
  187. package/dist/semantic/semantic-worker-test-fixtures.d.ts.map +1 -0
  188. package/dist/semantic/validated-vector-index-audit.d.ts +10 -0
  189. package/dist/semantic/validated-vector-index-audit.d.ts.map +1 -0
  190. package/dist/semantic/validated-vector-index-mutations.d.ts +23 -0
  191. package/dist/semantic/validated-vector-index-mutations.d.ts.map +1 -0
  192. package/dist/semantic/validated-vector-index-state.d.ts +77 -0
  193. package/dist/semantic/validated-vector-index-state.d.ts.map +1 -0
  194. package/dist/semantic/validated-vector-index-statements.d.ts +30 -0
  195. package/dist/semantic/validated-vector-index-statements.d.ts.map +1 -0
  196. package/dist/semantic/validated-vector-index.d.ts +16 -0
  197. package/dist/semantic/validated-vector-index.d.ts.map +1 -0
  198. package/dist/semantic/validated-vector-index.test-helper.d.ts +9 -0
  199. package/dist/semantic/validated-vector-index.test-helper.d.ts.map +1 -0
  200. package/dist/semantic-query.d.ts +10 -0
  201. package/dist/semantic-query.d.ts.map +1 -0
  202. package/dist/semantic-worker-entry.js +14 -0
  203. package/dist/semantic-worker-entry.js.map +1 -0
  204. package/dist/semantic-worker-job-a7S-qbRH.js +49 -0
  205. package/dist/semantic-worker-job-a7S-qbRH.js.map +1 -0
  206. package/dist/semantic-worker-ranking-hRyoWJtp.js +7680 -0
  207. package/dist/semantic-worker-ranking-hRyoWJtp.js.map +1 -0
  208. package/dist/store.d.ts +25 -12
  209. package/dist/store.d.ts.map +1 -1
  210. package/dist/test-schema.generated.d.ts +1 -1
  211. package/dist/test-schema.generated.d.ts.map +1 -1
  212. package/dist/types.d.ts +4 -0
  213. package/dist/types.d.ts.map +1 -1
  214. package/dist/usage-aggregate-index.d.ts +4 -0
  215. package/dist/usage-aggregate-index.d.ts.map +1 -0
  216. package/dist/vector-index-maintenance.d.ts +28 -0
  217. package/dist/vector-index-maintenance.d.ts.map +1 -0
  218. package/dist/vector-index-upgrade.d.ts +21 -0
  219. package/dist/vector-index-upgrade.d.ts.map +1 -0
  220. package/dist/vector-layout.d.ts +21 -0
  221. package/dist/vector-layout.d.ts.map +1 -0
  222. package/dist/vector-migration.d.ts.map +1 -1
  223. package/dist/vector-writes.d.ts +26 -0
  224. package/dist/vector-writes.d.ts.map +1 -0
  225. package/dist/vectors.d.ts +8 -3
  226. package/dist/vectors.d.ts.map +1 -1
  227. package/dist/workspace-identity-C2g2-ZRR.js +10038 -0
  228. package/dist/workspace-identity-C2g2-ZRR.js.map +1 -0
  229. package/package.json +5 -5
  230. package/dist/owner-enrollment-start-xsoRbhG2.js +0 -14318
  231. package/dist/owner-enrollment-start-xsoRbhG2.js.map +0 -1
  232. package/dist/recipient-policy-contract.js.map +0 -1
@@ -0,0 +1,55 @@
1
+ /** One stored rebinding attempt. Private ceremony state, never current authority. */
2
+ export interface DeviceRebindAttempt {
3
+ coordinator_id: string;
4
+ attempt_id: string;
5
+ origin: string;
6
+ device_id: string;
7
+ public_key: string;
8
+ key_id: string;
9
+ fingerprint: string;
10
+ current_identity_id: string;
11
+ issuer: string;
12
+ auth_config_revision: string;
13
+ loopback_redirect: string | null;
14
+ browser_start_hash: string;
15
+ browser_transaction_hash: string | null;
16
+ browser_binder_hash: string | null;
17
+ account_subject: string | null;
18
+ target_identity_id: string | null;
19
+ link_id: string | null;
20
+ link_authority_kind: "controller_attestation" | "device_claim" | null;
21
+ review_digest: string | null;
22
+ team_effects_json: string | null;
23
+ enrollment_count: number | null;
24
+ confirmation_hash: string | null;
25
+ completion_secret_hash: string | null;
26
+ final_key_proof_hash: string | null;
27
+ state: string;
28
+ created_at_ms: number;
29
+ expires_at_ms: number;
30
+ finalized_at_ms: number | null;
31
+ binding_id: string | null;
32
+ audit_event_id: string | null;
33
+ final_outcome_json: string | null;
34
+ }
35
+ /**
36
+ * What the browser confirms: the Google account, both Identities, the device,
37
+ * the local review digest, and the Team effects shown to the person.
38
+ */
39
+ export declare function deviceRebindConfirmationHash(a: DeviceRebindAttempt): Promise<string>;
40
+ /** What the device key signs after the loopback delivers the completion secret. */
41
+ export declare function deviceRebindFinalMessage(a: DeviceRebindAttempt, completionSecret: string): string;
42
+ /**
43
+ * Checks the three proofs this attempt binds: the confirmed browser commitment,
44
+ * the completion secret delivered to this device, and its enrolled key's
45
+ * signature. It does not check current authority; the commit SQL does that.
46
+ */
47
+ export declare function verifyDeviceRebindCompletion(a: DeviceRebindAttempt, input: {
48
+ revision: string;
49
+ now: number;
50
+ completionSecret: string;
51
+ signature: string;
52
+ }): Promise<{
53
+ keyProofHash: string;
54
+ } | null>;
55
+ //# sourceMappingURL=coordinator-device-rebind-proof.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinator-device-rebind-proof.d.ts","sourceRoot":"","sources":["../src/coordinator-device-rebind-proof.ts"],"names":[],"mappings":"AAOA,qFAAqF;AACrF,MAAM,WAAW,mBAAmB;IACnC,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,oBAAoB,EAAE,MAAM,CAAC;IAC7B,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,wBAAwB,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,mBAAmB,EAAE,wBAAwB,GAAG,cAAc,GAAG,IAAI,CAAC;IACtE,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAoCD;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC,CAEpF;AAED,mFAAmF;AACnF,wBAAgB,wBAAwB,CAAC,CAAC,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAkBjG;AAmBD;;;;GAIG;AACH,wBAAsB,4BAA4B,CACjD,CAAC,EAAE,mBAAmB,EACtB,KAAK,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GACnF,OAAO,CAAC;IAAE,YAAY,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,CAW1C"}
@@ -0,0 +1,38 @@
1
+ import type { AuthLinkBackend } from "./coordinator-auth-link.js";
2
+ /**
3
+ * Storage for ADR 0005 Section 8 rebinding: an enrolled device whose current
4
+ * Identity has no account link of its own moves to the Identity linked to the
5
+ * Google account it signs in with. A self-bind keeps the device's Identity
6
+ * (target = current) and gives a device without its own proof a binding. Both tables are additive. They never change
7
+ * the owner-enrollment tables, whose schema readiness checks compare exact DDL.
8
+ *
9
+ * Mirror: packages/cloudflare-coordinator-worker/migrations/0038_add_device_rebind.sql
10
+ */
11
+ export declare const COORDINATOR_DEVICE_REBIND_SCHEMA_SQL = "\nCREATE TABLE IF NOT EXISTS coordinator_device_rebind_attempts (\n coordinator_id TEXT NOT NULL,\n attempt_id TEXT NOT NULL,\n origin TEXT NOT NULL,\n device_id TEXT NOT NULL,\n public_key TEXT NOT NULL,\n key_id TEXT NOT NULL CHECK (length(key_id) = 64 AND key_id NOT GLOB '*[^0-9a-f]*'),\n fingerprint TEXT NOT NULL,\n current_identity_id TEXT NOT NULL CHECK (length(current_identity_id) BETWEEN 1 AND 256),\n issuer TEXT NOT NULL,\n auth_config_revision TEXT NOT NULL,\n loopback_redirect TEXT,\n browser_start_hash TEXT NOT NULL UNIQUE,\n browser_transaction_hash TEXT UNIQUE,\n browser_binder_hash TEXT,\n account_subject TEXT,\n target_identity_id TEXT,\n link_id TEXT,\n link_authority_kind TEXT CHECK (link_authority_kind IS NULL\n OR link_authority_kind IN ('controller_attestation', 'device_claim')),\n review_digest TEXT CHECK (review_digest IS NULL\n OR (length(review_digest) = 64 AND review_digest NOT GLOB '*[^0-9a-f]*')),\n team_effects_json TEXT CHECK (team_effects_json IS NULL OR json_valid(team_effects_json)),\n enrollment_count INTEGER CHECK (enrollment_count IS NULL OR enrollment_count BETWEEN 1 AND 50),\n confirmation_hash TEXT,\n completion_secret_hash TEXT UNIQUE,\n final_key_proof_hash TEXT,\n state TEXT NOT NULL CHECK (state IN\n ('pending', 'browser_claimed', 'oidc_verified', 'confirmed', 'finalized', 'expired', 'failed')),\n created_at_ms INTEGER NOT NULL,\n expires_at_ms INTEGER NOT NULL CHECK (expires_at_ms = created_at_ms + 600000),\n finalized_at_ms INTEGER,\n binding_id TEXT UNIQUE,\n audit_event_id TEXT UNIQUE,\n final_outcome_json TEXT CHECK (final_outcome_json IS NULL OR json_valid(final_outcome_json)),\n PRIMARY KEY (coordinator_id, attempt_id),\n CHECK (state NOT IN ('confirmed', 'finalized') OR (account_subject IS NOT NULL\n AND target_identity_id IS NOT NULL AND link_id IS NOT NULL AND link_authority_kind IS NOT NULL\n AND review_digest IS NOT NULL AND team_effects_json IS NOT NULL AND enrollment_count IS NOT NULL\n AND confirmation_hash IS NOT NULL AND completion_secret_hash IS NOT NULL)),\n CHECK (state <> 'finalized' OR (finalized_at_ms IS NOT NULL AND binding_id IS NOT NULL\n AND audit_event_id IS NOT NULL AND final_key_proof_hash IS NOT NULL\n AND final_outcome_json IS NOT NULL AND loopback_redirect IS NULL)),\n CHECK (state = 'finalized' OR (finalized_at_ms IS NULL AND binding_id IS NULL\n AND audit_event_id IS NULL AND final_key_proof_hash IS NULL AND final_outcome_json IS NULL)),\n CHECK (state NOT IN ('pending', 'browser_claimed', 'oidc_verified')\n OR (confirmation_hash IS NULL AND completion_secret_hash IS NULL)),\n CHECK (state NOT IN ('pending', 'browser_claimed') OR (account_subject IS NULL\n AND target_identity_id IS NULL AND link_id IS NULL AND link_authority_kind IS NULL\n AND team_effects_json IS NULL AND enrollment_count IS NULL)),\n CHECK (review_digest IS NOT NULL),\n CHECK (state <> 'pending' OR (browser_transaction_hash IS NULL AND browser_binder_hash IS NULL))\n);\n\nCREATE INDEX IF NOT EXISTS idx_coordinator_device_rebind_attempts_device\n ON coordinator_device_rebind_attempts (coordinator_id, device_id, state);\n\n-- Birth facts never change; proofs are set once; only forward transitions are allowed.\n-- The EXISTS clause stops UPDATE OR REPLACE from deleting another row through a unique key.\nCREATE TRIGGER IF NOT EXISTS coordinator_device_rebind_attempt_pins\nBEFORE UPDATE ON coordinator_device_rebind_attempts\nWHEN OLD.state IN ('finalized', 'expired', 'failed') OR NEW.rowid IS NOT OLD.rowid\n OR EXISTS (SELECT 1 FROM coordinator_device_rebind_attempts o\n WHERE NOT (o.coordinator_id = OLD.coordinator_id AND o.attempt_id = OLD.attempt_id)\n AND (o.browser_transaction_hash = NEW.browser_transaction_hash\n OR o.completion_secret_hash = NEW.completion_secret_hash\n OR o.binding_id = NEW.binding_id OR o.audit_event_id = NEW.audit_event_id))\n OR NEW.coordinator_id IS NOT OLD.coordinator_id OR NEW.attempt_id IS NOT OLD.attempt_id\n OR NEW.origin IS NOT OLD.origin OR NEW.device_id IS NOT OLD.device_id\n OR NEW.public_key IS NOT OLD.public_key OR NEW.key_id IS NOT OLD.key_id\n OR NEW.fingerprint IS NOT OLD.fingerprint OR NEW.current_identity_id IS NOT OLD.current_identity_id\n OR NEW.issuer IS NOT OLD.issuer OR NEW.auth_config_revision IS NOT OLD.auth_config_revision\n OR NEW.browser_start_hash IS NOT OLD.browser_start_hash\n OR NEW.created_at_ms IS NOT OLD.created_at_ms OR NEW.expires_at_ms IS NOT OLD.expires_at_ms\n OR (OLD.browser_transaction_hash IS NOT NULL AND NEW.browser_transaction_hash IS NOT OLD.browser_transaction_hash)\n OR (OLD.browser_binder_hash IS NOT NULL AND NEW.browser_binder_hash IS NOT OLD.browser_binder_hash)\n OR (OLD.account_subject IS NOT NULL AND NEW.account_subject IS NOT OLD.account_subject)\n OR (OLD.target_identity_id IS NOT NULL AND NEW.target_identity_id IS NOT OLD.target_identity_id)\n OR (OLD.link_id IS NOT NULL AND NEW.link_id IS NOT OLD.link_id)\n OR (OLD.review_digest IS NOT NULL AND NEW.review_digest IS NOT OLD.review_digest)\n OR (OLD.team_effects_json IS NOT NULL AND NEW.team_effects_json IS NOT OLD.team_effects_json)\n OR (OLD.enrollment_count IS NOT NULL AND NEW.enrollment_count IS NOT OLD.enrollment_count)\n OR (OLD.confirmation_hash IS NOT NULL AND NEW.confirmation_hash IS NOT OLD.confirmation_hash)\n OR (OLD.completion_secret_hash IS NOT NULL AND NEW.completion_secret_hash IS NOT OLD.completion_secret_hash)\n OR (NEW.loopback_redirect IS NOT OLD.loopback_redirect\n AND NOT (NEW.loopback_redirect IS NULL AND NEW.state IN ('finalized', 'expired', 'failed')))\n OR NOT ((OLD.state = NEW.state)\n OR (OLD.state = 'pending' AND NEW.state IN ('browser_claimed', 'expired', 'failed'))\n OR (OLD.state = 'browser_claimed' AND NEW.state IN ('oidc_verified', 'expired', 'failed'))\n OR (OLD.state = 'oidc_verified' AND NEW.state IN ('confirmed', 'expired', 'failed'))\n OR (OLD.state = 'confirmed' AND NEW.state IN ('finalized', 'expired', 'failed')))\nBEGIN\n SELECT RAISE(ABORT, 'device_rebind_attempt_immutable');\nEND;\n\n-- REPLACE's implicit deletes may skip DELETE triggers when recursive triggers are off.\nCREATE TRIGGER IF NOT EXISTS coordinator_device_rebind_attempt_insert_collision\nBEFORE INSERT ON coordinator_device_rebind_attempts\nWHEN EXISTS (SELECT 1 FROM coordinator_device_rebind_attempts\n WHERE rowid = NEW.rowid OR (coordinator_id = NEW.coordinator_id AND attempt_id = NEW.attempt_id)\n OR browser_start_hash = NEW.browser_start_hash\n OR browser_transaction_hash = NEW.browser_transaction_hash\n OR completion_secret_hash = NEW.completion_secret_hash\n OR binding_id = NEW.binding_id OR audit_event_id = NEW.audit_event_id)\nBEGIN\n SELECT RAISE(ABORT, 'device_rebind_attempt_collision');\nEND;\n\n-- An automatic rowid reads as -1 before insert; positive rowids keep that from matching a row.\nCREATE TRIGGER IF NOT EXISTS coordinator_device_rebind_attempt_rowid\nAFTER INSERT ON coordinator_device_rebind_attempts\nWHEN NEW.rowid < 1\nBEGIN\n SELECT RAISE(ABORT, 'device_rebind_attempt_rowid');\nEND;\n\nCREATE TRIGGER IF NOT EXISTS coordinator_device_rebind_attempt_retained\nBEFORE DELETE ON coordinator_device_rebind_attempts\nWHEN OLD.state = 'finalized'\nBEGIN\n SELECT RAISE(ABORT, 'device_rebind_attempt_immutable');\nEND;\n\nCREATE TABLE IF NOT EXISTS coordinator_device_rebind_audit_log (\n coordinator_id TEXT NOT NULL,\n event_id TEXT NOT NULL,\n attempt_id TEXT NOT NULL,\n action TEXT NOT NULL CHECK (action = 'owner_device_rebound'),\n binding_id TEXT NOT NULL,\n device_id TEXT NOT NULL,\n previous_identity_id TEXT NOT NULL,\n target_identity_id TEXT NOT NULL,\n enrollment_count INTEGER NOT NULL CHECK (enrollment_count BETWEEN 1 AND 50),\n created_at_ms INTEGER NOT NULL,\n PRIMARY KEY (coordinator_id, event_id),\n UNIQUE (coordinator_id, attempt_id)\n);\n\nCREATE INDEX IF NOT EXISTS idx_coordinator_device_rebind_audit_target\n ON coordinator_device_rebind_audit_log (coordinator_id, target_identity_id, created_at_ms);\n\nCREATE TRIGGER IF NOT EXISTS coordinator_device_rebind_audit_insert_collision\nBEFORE INSERT ON coordinator_device_rebind_audit_log\nWHEN EXISTS (SELECT 1 FROM coordinator_device_rebind_audit_log\n WHERE rowid = NEW.rowid\n OR (coordinator_id = NEW.coordinator_id AND (event_id = NEW.event_id OR attempt_id = NEW.attempt_id)))\nBEGIN\n SELECT RAISE(ABORT, 'device_rebind_audit_collision');\nEND;\n\nCREATE TRIGGER IF NOT EXISTS coordinator_device_rebind_audit_rowid\nAFTER INSERT ON coordinator_device_rebind_audit_log\nWHEN NEW.rowid < 1\nBEGIN\n SELECT RAISE(ABORT, 'device_rebind_audit_rowid');\nEND;\n\nCREATE TRIGGER IF NOT EXISTS coordinator_device_rebind_audit_immutable_update\nBEFORE UPDATE ON coordinator_device_rebind_audit_log\nBEGIN\n SELECT RAISE(ABORT, 'device_rebind_audit_immutable');\nEND;\n\nCREATE TRIGGER IF NOT EXISTS coordinator_device_rebind_audit_immutable_delete\nBEFORE DELETE ON coordinator_device_rebind_audit_log\nBEGIN\n SELECT RAISE(ABORT, 'device_rebind_audit_immutable');\nEND;\n";
12
+ /**
13
+ * The first pre-release attempts table forbade a review digest before OIDC,
14
+ * but the ceremony pins it at start. A coordinator that opened that build has
15
+ * the old table; recreate it while it is still empty (nothing wrote attempts
16
+ * before the routes shipped). With rows present it is left as is and starts
17
+ * fail closed.
18
+ */
19
+ export declare function upgradePreReleaseRebindAttemptsSql(existingTableSql: string | null, rows: number): string | null;
20
+ /**
21
+ * The backend, only when this database has the current rebind tables. Without
22
+ * them (a D1 database before migration 0038) rebind routes report not found
23
+ * and the shared OIDC callback skips the rebind hook.
24
+ */
25
+ export declare function readDeviceRebindBackend(backend: AuthLinkBackend): Promise<AuthLinkBackend | null>;
26
+ /**
27
+ * Rebuilds the attempts table without the first release's "target differs
28
+ * from current" CHECK, which self-binds need. Rows, the index and every
29
+ * trigger are kept. Mirror: migrations/0040_allow_device_self_bind.sql.
30
+ */
31
+ export declare function rebuildRebindAttemptsForSelfBindSql(): string;
32
+ /**
33
+ * True when an existing attempts table still forbids a self-bind. A
34
+ * pre-release table that kept rows (no review-digest CHECK) is left alone: its
35
+ * rows can't satisfy the current table, and it already fails closed.
36
+ */
37
+ export declare function rebindAttemptsNeedSelfBindRebuild(existingTableSql: string | null): boolean;
38
+ //# sourceMappingURL=coordinator-device-rebind-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinator-device-rebind-schema.d.ts","sourceRoot":"","sources":["../src/coordinator-device-rebind-schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE;;;;;;;;GAQG;AACH,eAAO,MAAM,oCAAoC,qyRAyKhD,CAAC;AAWF;;;;;;GAMG;AACH,wBAAgB,kCAAkC,CACjD,gBAAgB,EAAE,MAAM,GAAG,IAAI,EAC/B,IAAI,EAAE,MAAM,GACV,MAAM,GAAG,IAAI,CAUf;AAQD;;;;GAIG;AACH,wBAAsB,uBAAuB,CAC5C,OAAO,EAAE,eAAe,GACtB,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAMjC;AAoBD;;;;GAIG;AACH,wBAAgB,mCAAmC,IAAI,MAAM,CAa5D;AAED;;;;GAIG;AACH,wBAAgB,iCAAiC,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAM1F"}
@@ -0,0 +1,47 @@
1
+ import type Database from "better-sqlite3";
2
+ import type { AuthLinkBackend } from "./coordinator-auth-link.js";
3
+ import { type Backend } from "./coordinator-auth-store-test-fixtures.js";
4
+ import { type DeviceRebindAttempt } from "./coordinator-device-rebind-proof.js";
5
+ import type { CoordinatorStore } from "./coordinator-store-contract.js";
6
+ export declare const NOW = 1791028800000;
7
+ export declare const COORDINATOR = "coordinator-a";
8
+ export declare const CURRENT = "local:device-work";
9
+ export declare const TARGET = "identity-target";
10
+ export declare const REVISION: string;
11
+ export declare const GROUPS: readonly ["group-a", "group-b"];
12
+ /** Every table a rebind may touch, for all-or-nothing assertions. */
13
+ export declare const EFFECT_TABLES: readonly ["coordinator_device_rebind_attempts", "coordinator_device_ownership_bindings", "enrolled_devices", "coordinator_device_rebind_audit_log", "coordinator_identity_group_grants", "coordinator_auth_account_links"];
14
+ export interface RebindFixture {
15
+ db: Database.Database;
16
+ store: CoordinatorStore;
17
+ backend: AuthLinkBackend;
18
+ attempt: DeviceRebindAttempt;
19
+ secret: string;
20
+ sign(message: string): string;
21
+ input(patch?: {
22
+ now?: number;
23
+ completionSecret?: string;
24
+ signature?: string;
25
+ }): {
26
+ backend: AuthLinkBackend;
27
+ coordinatorId: string;
28
+ attemptId: string;
29
+ revision: string;
30
+ now: number;
31
+ completionSecret: string;
32
+ signature: string;
33
+ };
34
+ effects(): unknown[][];
35
+ close(): Promise<void>;
36
+ }
37
+ /** A migrated device enrolled in two groups, confirmed to rebind to TARGET. */
38
+ export declare function rebindFixture(kind: Backend): Promise<RebindFixture>;
39
+ /** Gives the enrolled device its own claim for `identityId`, so it has proof and can't self-bind. */
40
+ export declare function insertOwnDeviceClaim(db: Database.Database, input: {
41
+ coordinatorId: string;
42
+ issuer: string;
43
+ revision: string;
44
+ identityId: string;
45
+ deviceId: string;
46
+ }): Promise<void>;
47
+ //# sourceMappingURL=coordinator-device-rebind-test-fixtures.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinator-device-rebind-test-fixtures.d.ts","sourceRoot":"","sources":["../src/coordinator-device-rebind-test-fixtures.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,EAAE,KAAK,OAAO,EAAwB,MAAM,2CAA2C,CAAC;AAC/F,OAAO,EACN,KAAK,mBAAmB,EAGxB,MAAM,sCAAsC,CAAC;AAI9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAGxE,eAAO,MAAM,GAAG,gBAAoB,CAAC;AACrC,eAAO,MAAM,WAAW,kBAAkB,CAAC;AAC3C,eAAO,MAAM,OAAO,sBAAsB,CAAC;AAC3C,eAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,eAAO,MAAM,QAAQ,QAAiB,CAAC;AACvC,eAAO,MAAM,MAAM,YAAI,SAAS,EAAE,SAAS,CAAU,CAAC;AAEtD,qEAAqE;AACrE,eAAO,MAAM,aAAa,YACzB,oCAAoC,EACpC,uCAAuC,EACvC,kBAAkB,EAClB,qCAAqC,EACrC,mCAAmC,EACnC,gCAAgC,CACvB,CAAC;AAEX,MAAM,WAAW,aAAa;IAC7B,EAAE,EAAE,QAAQ,CAAC,QAAQ,CAAC;IACtB,KAAK,EAAE,gBAAgB,CAAC;IACxB,OAAO,EAAE,eAAe,CAAC;IACzB,OAAO,EAAE,mBAAmB,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,KAAK,CAAC,KAAK,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG;QAC/E,OAAO,EAAE,eAAe,CAAC;QACzB,aAAa,EAAE,MAAM,CAAC;QACtB,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,GAAG,EAAE,MAAM,CAAC;QACZ,gBAAgB,EAAE,MAAM,CAAC;QACzB,SAAS,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,OAAO,IAAI,OAAO,EAAE,EAAE,CAAC;IACvB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB;AAuFD,+EAA+E;AAC/E,wBAAsB,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,CAmCzE;AAED,qGAAqG;AACrG,wBAAsB,oBAAoB,CACzC,EAAE,EAAE,QAAQ,CAAC,QAAQ,EACrB,KAAK,EAAE;IACN,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CACjB,GACC,OAAO,CAAC,IAAI,CAAC,CAkBf"}
@@ -0,0 +1,37 @@
1
+ /** Browser pages for ADR 0005 Section 8 rebinding. Presentation only; the ceremony decides. */
2
+ import { type CoordinatorAuthBrowserPage } from "./coordinator-auth-browser-view.js";
3
+ import type { DeviceRebindConfirmation, DeviceRebindRefusal } from "./coordinator-device-rebind-ceremony.js";
4
+ export declare const DEVICE_REBIND_BROWSER_PATHS: Readonly<{
5
+ start: "/auth/rebind/start";
6
+ confirm: "/auth/rebind/confirm";
7
+ }>;
8
+ /** Private start code stays in hidden form data; the page submits itself. */
9
+ export declare function renderDeviceRebindStartPage(input: {
10
+ attemptId: string;
11
+ startCode: string;
12
+ csrf: string;
13
+ }): Promise<CoordinatorAuthBrowserPage>;
14
+ export declare function renderDeviceRebindConfirmPage(input: {
15
+ confirmation: DeviceRebindConfirmation;
16
+ csrf: string;
17
+ }): Promise<CoordinatorAuthBrowserPage>;
18
+ /** Caller releases this secret-bearing page only after confirmation commits. */
19
+ export declare function renderDeviceRebindHopPage(input: {
20
+ loopbackRedirect: string;
21
+ attemptId: string;
22
+ completionSecret: string;
23
+ confirmationHash: string;
24
+ }): Promise<CoordinatorAuthBrowserPage>;
25
+ /** Browser-only states on top of the ceremony's refusals. */
26
+ export type DeviceRebindNotice = DeviceRebindRefusal | "unknown" | "rate_limited" | "busy";
27
+ /**
28
+ * A refusal at the Google callback: explain it here and send the browser back
29
+ * to the device, which stops waiting and shows the next step.
30
+ */
31
+ export declare function renderDeviceRebindReturnPage(input: {
32
+ reason: DeviceRebindRefusal;
33
+ loopbackRedirect: string;
34
+ attemptId: string;
35
+ }): Promise<CoordinatorAuthBrowserPage>;
36
+ export declare function renderDeviceRebindNotice(reason: DeviceRebindNotice): Promise<CoordinatorAuthBrowserPage>;
37
+ //# sourceMappingURL=coordinator-device-rebind-view.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinator-device-rebind-view.d.ts","sourceRoot":"","sources":["../src/coordinator-device-rebind-view.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,OAAO,EAEN,KAAK,0BAA0B,EAE/B,MAAM,oCAAoC,CAAC;AAE5C,OAAO,KAAK,EACX,wBAAwB,EACxB,mBAAmB,EACnB,MAAM,yCAAyC,CAAC;AAEjD,eAAO,MAAM,2BAA2B;;;EAGtC,CAAC;AAeH,6EAA6E;AAC7E,wBAAgB,2BAA2B,CAAC,KAAK,EAAE;IAClD,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACb,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAQtC;AA6BD,wBAAgB,6BAA6B,CAAC,KAAK,EAAE;IACpD,YAAY,EAAE,wBAAwB,CAAC;IACvC,IAAI,EAAE,MAAM,CAAC;CACb,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAqBtC;AAED,gFAAgF;AAChF,wBAAgB,yBAAyB,CAAC,KAAK,EAAE;IAChD,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;CACzB,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAgBtC;AAED,6DAA6D;AAC7D,MAAM,MAAM,kBAAkB,GAAG,mBAAmB,GAAG,SAAS,GAAG,cAAc,GAAG,MAAM,CAAC;AAiC3F;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE;IACnD,MAAM,EAAE,mBAAmB,CAAC;IAC5B,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;CAClB,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAWtC;AAED,wBAAgB,wBAAwB,CACvC,MAAM,EAAE,kBAAkB,GACxB,OAAO,CAAC,0BAA0B,CAAC,CAGrC"}
@@ -0,0 +1,14 @@
1
+ import type { CoordinatorEnrollment } from "./coordinator-store-contract.js";
2
+ /**
3
+ * The device's ownership binding, if it has exactly one. A rebind (ADR 0005
4
+ * Section 8) writes one, so admins can tell a rebound device from a conflict.
5
+ */
6
+ export declare const ENROLLMENT_OWNERSHIP_COLUMNS = "(SELECT CASE WHEN count(*) = 1 THEN max(b.identity_id) END\n\t FROM coordinator_device_ownership_bindings b\n\t WHERE b.device_id = enrolled_devices.device_id) AS ownership_identity_id,\n\t(SELECT CASE WHEN count(*) = 1 THEN max(b.key_id) END\n\t FROM coordinator_device_ownership_bindings b\n\t WHERE b.device_id = enrolled_devices.device_id) AS ownership_key_id";
7
+ /**
8
+ * Keeps `ownership_identity_id` only when the binding names this enrollment's
9
+ * exact key; a binding for another key says nothing about this enrollment.
10
+ */
11
+ export declare function withEnrollmentOwnership(rows: ReadonlyArray<CoordinatorEnrollment & {
12
+ ownership_key_id?: unknown;
13
+ }>): Promise<CoordinatorEnrollment[]>;
14
+ //# sourceMappingURL=coordinator-enrollment-ownership.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinator-enrollment-ownership.d.ts","sourceRoot":"","sources":["../src/coordinator-enrollment-ownership.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAE7E;;;GAGG;AACH,eAAO,MAAM,4BAA4B,gXAK6B,CAAC;AAEvE;;;GAGG;AACH,wBAAsB,uBAAuB,CAC5C,IAAI,EAAE,aAAa,CAAC,qBAAqB,GAAG;IAAE,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,GACzE,OAAO,CAAC,qBAAqB,EAAE,CAAC,CASlC"}
@@ -1 +1 @@
1
- {"version":3,"file":"coordinator-enrollment-reconciler.d.ts","sourceRoot":"","sources":["../src/coordinator-enrollment-reconciler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AAE9E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAexC,MAAM,WAAW,mCAAmC;IACnD,IAAI,EAAE,QAAQ,GAAG,iBAAiB,CAAC;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,oCAAoC;IACpD,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,mCAAmC,EAAE,CAAC;CAC9C;AAED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,CAShF;AA6ED,wBAAsB,sCAAsC,CAC3D,EAAE,EAAE,QAAQ,EACZ,KAAK,EAAE;IACN,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,qBAAqB,EAAE,CAAC;IACrC,mBAAmB,EAAE,6BAA6B,EAAE,CAAC;IACrD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,GAAG,CAAC,EAAE,MAAM,CAAC;CACb,GACC,OAAO,CAAC,oCAAoC,CAAC,CA0b/C"}
1
+ {"version":3,"file":"coordinator-enrollment-reconciler.d.ts","sourceRoot":"","sources":["../src/coordinator-enrollment-reconciler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AAE9E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAexC,MAAM,WAAW,mCAAmC;IACnD,IAAI,EAAE,QAAQ,GAAG,iBAAiB,CAAC;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,oCAAoC;IACpD,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,mCAAmC,EAAE,CAAC;CAC9C;AAED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,CAShF;AAwLD,wBAAsB,sCAAsC,CAC3D,EAAE,EAAE,QAAQ,EACZ,KAAK,EAAE;IACN,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,qBAAqB,EAAE,CAAC;IACrC,mBAAmB,EAAE,6BAA6B,EAAE,CAAC;IACrD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,GAAG,CAAC,EAAE,MAAM,CAAC;CACb,GACC,OAAO,CAAC,oCAAoC,CAAC,CAia/C"}
@@ -0,0 +1,35 @@
1
+ import type { AuthLinkStatement } from "./coordinator-auth-link.js";
2
+ type Backend = {
3
+ all<T>(statement: AuthLinkStatement): Promise<T[]>;
4
+ first<T>(statement: AuthLinkStatement): Promise<T | null>;
5
+ };
6
+ export declare function referenceHistorySql(sql: string): string;
7
+ export declare function captureHistorySql(backend: Backend, input: {
8
+ groupId: string;
9
+ manifestJson: string;
10
+ keyMetadata: string;
11
+ }): Promise<{
12
+ statement: AuthLinkStatement;
13
+ observedRows: unknown[];
14
+ current(options?: {
15
+ reference?: boolean;
16
+ }): Promise<{
17
+ current: number;
18
+ } | null>;
19
+ }>;
20
+ export declare function historyCases(statement: AuthLinkStatement): {
21
+ name: string;
22
+ raw: string;
23
+ selected: boolean;
24
+ }[];
25
+ export declare function compareHistorySql(backend: Backend, statement: AuthLinkStatement): Promise<{
26
+ error?: undefined;
27
+ rows: {
28
+ row: string;
29
+ }[];
30
+ } | {
31
+ rows?: undefined;
32
+ error: string;
33
+ }>;
34
+ export {};
35
+ //# sourceMappingURL=coordinator-history-sql-equivalence-test-fixtures.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinator-history-sql-equivalence-test-fixtures.d.ts","sourceRoot":"","sources":["../src/coordinator-history-sql-equivalence-test-fixtures.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAOpE,KAAK,OAAO,GAAG;IACd,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,iBAAiB,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;IACnD,KAAK,CAAC,CAAC,EAAE,SAAS,EAAE,iBAAiB,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;CAC1D,CAAC;AAoBF,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAsBvD;AAED,wBAAsB,iBAAiB,CACtC,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE;;;sBAyB7C;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE;iBAGb,MAAM;;GAMxC;AAED,wBAAgB,YAAY,CAAC,SAAS,EAAE,iBAAiB;UAYpC,MAAM;SAAO,MAAM;cAAY,OAAO;IA0B1D;AAuDD,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,iBAAiB;;;aAG3C,MAAM;;;;;GAShD"}
@@ -0,0 +1,47 @@
1
+ import { type ControllerHistoryRecord, type ControllerHistorySnapshot } from "./coordinator-auth-controller-history.js";
2
+ import type { AuthLinkStatement } from "./coordinator-auth-link.js";
3
+ import { type EvidenceRow, type EvidenceRows, type EvidenceSubject } from "./coordinator-device-ownership-evidence-classify.js";
4
+ interface Backend {
5
+ first<T>(statement: AuthLinkStatement): Promise<T | null>;
6
+ all<T>(statement: AuthLinkStatement): Promise<T[]>;
7
+ }
8
+ /** Internal capability, meaningful only to this module's WeakMap. */
9
+ export interface LegacyCompletionOwnerProof {
10
+ readonly version: 1;
11
+ }
12
+ interface Subject extends EvidenceSubject {
13
+ owner: string;
14
+ fragments: string[];
15
+ fingerprints: string[];
16
+ }
17
+ interface ProofSql {
18
+ /** Append after LEGACY_OWNER_INPUT_SQL, which already starts WITH. */
19
+ readonly ctes: string;
20
+ readonly currentSql: string;
21
+ readonly compatibleSql: string;
22
+ /** Bind after the three LEGACY_OWNER_INPUT_SQL values. */
23
+ readonly values: readonly string[];
24
+ }
25
+ /** Internal capture preparation; not exported from the package entrypoint. */
26
+ export declare function prepareCompletionHistory(rows: EvidenceRow[], decode?: (text: string) => unknown): {
27
+ row: EvidenceRow;
28
+ record: ControllerHistoryRecord;
29
+ decode: () => unknown;
30
+ }[];
31
+ /** Internal subject view; canonical validation remains subject-specific. */
32
+ export declare function subjectHistory(rows: EvidenceRows, subject: Subject, keys: Map<string, string>, prepared: ReturnType<typeof prepareCompletionHistory>): ControllerHistorySnapshot;
33
+ /** Read-only capture. No submitted approved-subject list or source reference is accepted.
34
+ * Call only after the stores validate the canonical manifest and its source binding.
35
+ */
36
+ export declare function captureLegacyCompletionOwnerProof(input: {
37
+ backend: Backend;
38
+ groupId: string;
39
+ manifestJson: string;
40
+ keyMetadata: string;
41
+ }): Promise<LegacyCompletionOwnerProof>;
42
+ /** The winning INSERT must use both predicates. A token by itself grants nothing.
43
+ * Keep LEGACY_OWNER_SOURCE_CURRENT_SQL and all ordinary completion checks as well.
44
+ */
45
+ export declare function legacyCompletionOwnerProofSql(proof: LegacyCompletionOwnerProof): ProofSql;
46
+ export {};
47
+ //# sourceMappingURL=coordinator-legacy-completion-owner-proof.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinator-legacy-completion-owner-proof.d.ts","sourceRoot":"","sources":["../src/coordinator-legacy-completion-owner-proof.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAG9B,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAEN,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,eAAe,EAGpB,MAAM,qDAAqD,CAAC;AAoB7D,UAAU,OAAO;IAChB,KAAK,CAAC,CAAC,EAAE,SAAS,EAAE,iBAAiB,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAC1D,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,iBAAiB,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;CACnD;AAED,qEAAqE;AACrE,MAAM,WAAW,0BAA0B;IAC1C,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;CACpB;AAED,UAAU,OAAQ,SAAQ,eAAe;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,YAAY,EAAE,MAAM,EAAE,CAAC;CACvB;AAcD,UAAU,QAAQ;IACjB,sEAAsE;IACtE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,0DAA0D;IAC1D,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAoVD,8EAA8E;AAC9E,wBAAgB,wBAAwB,CACvC,IAAI,EAAE,WAAW,EAAE,EACnB,MAAM,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAoB;;;;IAsB9C;AAED,4EAA4E;AAC5E,wBAAgB,cAAc,CAC7B,IAAI,EAAE,YAAY,EAClB,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EACzB,QAAQ,EAAE,UAAU,CAAC,OAAO,wBAAwB,CAAC,GACnD,yBAAyB,CA8C3B;AAwPD;;GAEG;AACH,wBAAsB,iCAAiC,CAAC,KAAK,EAAE;IAC9D,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAyBtC;AAED;;GAEG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,0BAA0B,GAAG,QAAQ,CAEzF"}
@@ -0,0 +1,33 @@
1
+ import { type CoordinatorLegacyTeamCompletionWriteResult } from "./coordinator-legacy-team-completion.js";
2
+ /** Both the early replay and the post-INSERT winner retain the canonical row. */
3
+ export declare function legacyCompletionWriteResult(storedJson: string, requestedJson: string, status: CoordinatorLegacyTeamCompletionWriteResult["status"]): CoordinatorLegacyTeamCompletionWriteResult;
4
+ /** Bind canonical manifest JSON, then target group. */
5
+ export declare const LEGACY_OWNER_KEYS_SQL: string;
6
+ /** Classify server-held text aliases, never a fingerprint supplied as ownership proof.
7
+ * Invalid unrelated keys supply no key inference; included requesters must have a
8
+ * verified current key in the winning statement. No database I/O occurs here.
9
+ */
10
+ export declare function legacyOwnerKeyMetadata(rows: readonly {
11
+ public_key: string;
12
+ }[]): Promise<string>;
13
+ /** Bind canonical manifest JSON, target group, then server-derived key metadata.
14
+ * Ownership-bearing enrollments are re-read at INSERT time. Reject newly relevant
15
+ * text keys rather than letting an unclassified alias evade a canonical-key comparison.
16
+ * Materialize the size-limited key metadata and requested rows so correlated
17
+ * owner checks reuse them instead of repeatedly expanding their JSON inputs.
18
+ * Join requested enrollments directly by group/device; a left-joined enrollment
19
+ * CTE can materialize all groups sharing a key even with NOT MATERIALIZED.
20
+ */
21
+ export declare const LEGACY_OWNER_INPUT_SQL: string;
22
+ export declare const LEGACY_OWNER_SOURCE_CURRENT_SQL = "(NOT EXISTS (SELECT 1 FROM legacy_owner_requested)\n OR (NOT EXISTS (\n SELECT public_key FROM legacy_owner_source_keys EXCEPT SELECT public_key FROM legacy_owner_keys\n) AND NOT EXISTS (SELECT 1 FROM legacy_owner_requested WHERE key_id IS NULL)))";
23
+ /** Only included owner assignments compete. Labels, exclusions, and other people
24
+ * never supply ownership. A stored label (another device's guess) never blocks a
25
+ * later upload. Requested rows are all checked, labels included, so a new guess
26
+ * still cannot contradict recorded ownership. Old fingerprints need a verified current enrollment
27
+ * for the historical group/device; the exact device ID needs no key inference.
28
+ * This predicate belongs in the winning INSERT, not just a preview/read check.
29
+ */
30
+ export declare const LEGACY_OWNER_COMPATIBLE_SQL: string;
31
+ /** Used only to explain a refused INSERT; this cannot authorize a write. */
32
+ export declare const LEGACY_OWNER_DENIAL_SQL: string;
33
+ //# sourceMappingURL=coordinator-legacy-owner-compatibility.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinator-legacy-owner-compatibility.d.ts","sourceRoot":"","sources":["../src/coordinator-legacy-owner-compatibility.ts"],"names":[],"mappings":"AACA,OAAO,EAIN,KAAK,0CAA0C,EAG/C,MAAM,yCAAyC,CAAC;AAKjD,iFAAiF;AACjF,wBAAgB,2BAA2B,CAC1C,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,0CAA0C,CAAC,QAAQ,CAAC,GAC1D,0CAA0C,CAM5C;AA4BD,uDAAuD;AACvD,eAAO,MAAM,qBAAqB,QAMS,CAAC;AAE5C;;;GAGG;AACH,wBAAsB,sBAAsB,CAC3C,IAAI,EAAE,SAAS;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,EAAE,GACrC,OAAO,CAAC,MAAM,CAAC,CAuBjB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,QAqBjC,CAAC;AAGH,eAAO,MAAM,+BAA+B,4PAGmC,CAAC;AAEhF;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,QAqBtC,CAAC;AAEH,4EAA4E;AAC5E,eAAO,MAAM,uBAAuB,QAGkB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { type LinkFixture } from "./coordinator-auth-link-test-fixtures.js";
2
+ export declare function seedLinkedOwnerBirth(f: LinkFixture): Promise<void>;
3
+ //# sourceMappingURL=coordinator-legacy-owner-resolution-birth-test-fixtures.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinator-legacy-owner-resolution-birth-test-fixtures.d.ts","sourceRoot":"","sources":["../src/coordinator-legacy-owner-resolution-birth-test-fixtures.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,WAAW,EAAO,MAAM,0CAA0C,CAAC;AAyBjF,wBAAsB,oBAAoB,CAAC,CAAC,EAAE,WAAW,iBA0CxD"}
@@ -0,0 +1,54 @@
1
+ import type { CoordinatorAuthControllerAttestation, CoordinatorAuthControllerReviewInput } from "./coordinator-auth-controller.js";
2
+ import type { AuthLinkBackend, AuthLinkStatement } from "./coordinator-auth-link.js";
3
+ import { type LinkFixture } from "./coordinator-auth-link-test-fixtures.js";
4
+ import { type Backend } from "./coordinator-auth-store-test-fixtures.js";
5
+ import { CoordinatorDeviceOwnershipEvidence } from "./coordinator-device-ownership-evidence.js";
6
+ import type { LegacyOwnerResolutionRecord } from "./coordinator-legacy-owner-resolution-metadata.js";
7
+ export declare const now: string;
8
+ export declare const signer: {
9
+ groupId: string;
10
+ deviceId: string;
11
+ publicKey: string;
12
+ fingerprint: string;
13
+ };
14
+ export declare const controllerTable = "coordinator_auth_controller_attestations";
15
+ export declare const resolutionTable = "coordinator_legacy_owner_resolutions";
16
+ export interface InternalReviewFixture {
17
+ controllerReview: CoordinatorAuthControllerReviewInput;
18
+ ownershipEvidenceDigest: string;
19
+ existingController: CoordinatorAuthControllerAttestation | null;
20
+ existingResolution: LegacyOwnerResolutionRecord | null;
21
+ resolutionId: string;
22
+ consent: {
23
+ purpose: "existing_account_owner";
24
+ scope: "historical_included_owner_labels_only";
25
+ evidenceDigest: string;
26
+ confirmedDigest: string;
27
+ };
28
+ }
29
+ export declare function snapshot(f: LinkFixture, except?: string[]): (string | unknown[])[][];
30
+ export declare function backendFor(f: LinkFixture, kind: Backend): {
31
+ backend: AuthLinkBackend;
32
+ hooks: {
33
+ beforeBatch?: () => void;
34
+ mapStatement?: (statement: AuthLinkStatement) => AuthLinkStatement;
35
+ afterBatch?: () => void;
36
+ beforeFirst?: (statement: AuthLinkStatement) => void;
37
+ };
38
+ batchCount: () => number;
39
+ resetBatchCount: () => void;
40
+ evidence: CoordinatorDeviceOwnershipEvidence;
41
+ };
42
+ export type Harness = ReturnType<typeof backendFor>;
43
+ export declare function history(f: LinkFixture, groupId?: string, identityId?: string): void;
44
+ export declare function seed(f: LinkFixture, h: Harness, options?: {
45
+ weakCurrent?: boolean;
46
+ }): Promise<void>;
47
+ export declare function buildReview(f: LinkFixture, options?: {
48
+ existingController?: CoordinatorAuthControllerAttestation | null;
49
+ existingResolution?: LegacyOwnerResolutionRecord | null;
50
+ resolutionId?: string;
51
+ }): Promise<InternalReviewFixture>;
52
+ export declare function originalController(f: LinkFixture, groupId?: string, publicKey?: string): Promise<CoordinatorAuthControllerAttestation>;
53
+ export declare function revoke(f: LinkFixture, subject: "device_id" | "ed25519_key", origin?: boolean): Promise<void>;
54
+ //# sourceMappingURL=coordinator-legacy-owner-resolution-commit-test-fixtures.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinator-legacy-owner-resolution-commit-test-fixtures.d.ts","sourceRoot":"","sources":["../src/coordinator-legacy-owner-resolution-commit-test-fixtures.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACX,oCAAoC,EACpC,oCAAoC,EACpC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACrF,OAAO,EAAE,KAAK,WAAW,EAAO,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,KAAK,OAAO,EAAoB,MAAM,2CAA2C,CAAC;AAC3F,OAAO,EAAE,kCAAkC,EAAE,MAAM,4CAA4C,CAAC;AAGhG,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,mDAAmD,CAAC;AAQrG,eAAO,MAAM,GAAG,QAA8B,CAAC;AAC/C,eAAO,MAAM,MAAM;IAClB,OAAO;IACP,QAAQ;IACR,SAAS;IACT,WAAW;CACX,CAAC;AACF,eAAO,MAAM,eAAe,6CAA6C,CAAC;AAC1E,eAAO,MAAM,eAAe,yCAAyC,CAAC;AAEtE,MAAM,WAAW,qBAAqB;IACrC,gBAAgB,EAAE,oCAAoC,CAAC;IACvD,uBAAuB,EAAE,MAAM,CAAC;IAChC,kBAAkB,EAAE,oCAAoC,GAAG,IAAI,CAAC;IAChE,kBAAkB,EAAE,2BAA2B,GAAG,IAAI,CAAC;IACvD,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE;QACR,OAAO,EAAE,wBAAwB,CAAC;QAClC,KAAK,EAAE,uCAAuC,CAAC;QAC/C,cAAc,EAAE,MAAM,CAAC;QACvB,eAAe,EAAE,MAAM,CAAC;KACxB,CAAC;CACF;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,GAAE,MAAM,EAAO,4BAO7D;AAoBD,wBAAgB,UAAU,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO;;;sBAExC,MAAM,IAAI;uBACT,CAAC,SAAS,EAAE,iBAAiB,KAAK,iBAAiB;qBACrD,MAAM,IAAI;sBACT,CAAC,SAAS,EAAE,iBAAiB,KAAK,IAAI;;;;;EAuDrD;AACD,MAAM,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAEpD,wBAAgB,OAAO,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,SAAc,EAAE,UAAU,SAAe,QAmCvF;AAED,wBAAsB,IAAI,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,GAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAO,iBA0B7F;AAyDD,wBAAsB,WAAW,CAChC,CAAC,EAAE,WAAW,EACd,OAAO,GAAE;IACR,kBAAkB,CAAC,EAAE,oCAAoC,GAAG,IAAI,CAAC;IACjE,kBAAkB,CAAC,EAAE,2BAA2B,GAAG,IAAI,CAAC;IACxD,YAAY,CAAC,EAAE,MAAM,CAAC;CACjB,GACJ,OAAO,CAAC,qBAAqB,CAAC,CAsDhC;AAED,wBAAsB,kBAAkB,CACvC,CAAC,EAAE,WAAW,EACd,OAAO,SAAiB,EACxB,SAAS,SAAmB,iDAkB5B;AAED,wBAAsB,MAAM,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,GAAG,aAAa,EAAE,MAAM,UAAQ,iBAsBhG"}
@@ -0,0 +1,34 @@
1
+ import { type CoordinatorAuthControllerAttestation, type CoordinatorAuthControllerReviewInput } from "./coordinator-auth-controller.js";
2
+ import type { AuthLinkBackend } from "./coordinator-auth-link.js";
3
+ import type { CoordinatorDeviceOwnershipEvidence } from "./coordinator-device-ownership-evidence.js";
4
+ import { type LegacyOwnerResolutionRecord } from "./coordinator-legacy-owner-resolution-metadata.js";
5
+ export interface InternalOwnerResolutionReview {
6
+ controllerReview: CoordinatorAuthControllerReviewInput;
7
+ existingController: CoordinatorAuthControllerAttestation | null;
8
+ existingResolution: LegacyOwnerResolutionRecord | null;
9
+ resolutionId: string;
10
+ ownershipEvidenceDigest: string;
11
+ consent: {
12
+ purpose: "existing_account_owner";
13
+ scope: "historical_included_owner_labels_only";
14
+ evidenceDigest: string;
15
+ confirmedDigest: string;
16
+ };
17
+ }
18
+ /** Trusted operator-builder input only; this is not a public proof protocol. */
19
+ export declare function captureInternalOwnerResolutionReview(value: unknown): InternalOwnerResolutionReview | null;
20
+ /** Exactly one checked backend batch. A postcommit read failure is a persistence
21
+ * error, never a claim that the successful transaction changed nothing.
22
+ */
23
+ export declare function commitReviewedOwnerResolution(options: {
24
+ backend: AuthLinkBackend;
25
+ evidence: CoordinatorDeviceOwnershipEvidence;
26
+ review: unknown;
27
+ now: string;
28
+ }): Promise<{
29
+ controller: CoordinatorAuthControllerAttestation;
30
+ controllerDisposition: "created" | "reused";
31
+ resolution: LegacyOwnerResolutionRecord;
32
+ resolutionDisposition: "created" | "reused";
33
+ }>;
34
+ //# sourceMappingURL=coordinator-legacy-owner-resolution-commit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinator-legacy-owner-resolution-commit.d.ts","sourceRoot":"","sources":["../src/coordinator-legacy-owner-resolution-commit.ts"],"names":[],"mappings":"AAAA,OAAO,EAMN,KAAK,oCAAoC,EACzC,KAAK,oCAAoC,EAGzC,MAAM,kCAAkC,CAAC;AAK1C,OAAO,KAAK,EAAE,eAAe,EAAqB,MAAM,4BAA4B,CAAC;AACrF,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,4CAA4C,CAAC;AAErG,OAAO,EAGN,KAAK,2BAA2B,EAChC,MAAM,mDAAmD,CAAC;AAE3D,MAAM,WAAW,6BAA6B;IAC7C,gBAAgB,EAAE,oCAAoC,CAAC;IACvD,kBAAkB,EAAE,oCAAoC,GAAG,IAAI,CAAC;IAChE,kBAAkB,EAAE,2BAA2B,GAAG,IAAI,CAAC;IACvD,YAAY,EAAE,MAAM,CAAC;IACrB,uBAAuB,EAAE,MAAM,CAAC;IAChC,OAAO,EAAE;QACR,OAAO,EAAE,wBAAwB,CAAC;QAClC,KAAK,EAAE,uCAAuC,CAAC;QAC/C,cAAc,EAAE,MAAM,CAAC;QACvB,eAAe,EAAE,MAAM,CAAC;KACxB,CAAC;CACF;AA0MD,gFAAgF;AAChF,wBAAgB,oCAAoC,CACnD,KAAK,EAAE,OAAO,GACZ,6BAA6B,GAAG,IAAI,CA+CtC;AA8QD;;GAEG;AACH,wBAAsB,6BAA6B,CAAC,OAAO,EAAE;IAC5D,OAAO,EAAE,eAAe,CAAC;IACzB,QAAQ,EAAE,kCAAkC,CAAC;IAC7C,MAAM,EAAE,OAAO,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;CACZ;;;;;GA8BA"}
@@ -0,0 +1,40 @@
1
+ import type { AuthLinkBackend } from "./coordinator-auth-link.js";
2
+ /** Shape and key consistency only: never an ownership or provenance proof. */
3
+ export interface LegacyOwnerResolutionRecord {
4
+ coordinator_id: string;
5
+ resolution_id: string;
6
+ resolution_version: 1;
7
+ device_id: string;
8
+ key_id: string;
9
+ owner_identity_id: string;
10
+ purpose: "existing_account_owner";
11
+ scope: "historical_included_owner_labels_only";
12
+ source_attestation_id: string;
13
+ source_group_id: string;
14
+ source_controller_revision: 1;
15
+ source_public_key: string;
16
+ source_fingerprint: string;
17
+ source_enrollment_identity_id: string | null;
18
+ source_created_at: string;
19
+ source_review_receipt_id: string;
20
+ source_evidence_digest: string;
21
+ resolution_evidence_digest: string;
22
+ reviewed_weak_labels_json: string;
23
+ created_at: string;
24
+ }
25
+ export interface ReviewedWeakLabel {
26
+ label: string;
27
+ kind: "legacy_included_owner_label" | "consumed_project_actor_label";
28
+ group_id: string;
29
+ device_id: string;
30
+ evidence_ref: string;
31
+ effect: "account_owner_display_only";
32
+ }
33
+ export type LegacyOwnerResolutionSchemaState = "ready" | "missing" | "unsupported";
34
+ /** Categories describe reviewed display metadata, not verified server provenance. */
35
+ export declare function canonicalReviewedWeakLabels(value: unknown): string | null;
36
+ export declare function captureLegacyOwnerResolutionRecord(value: unknown): Promise<LegacyOwnerResolutionRecord | null>;
37
+ /** Classify one captured catalog, using the same DDL rules as the live reader. */
38
+ export declare function classifyLegacyOwnerResolutionSchemaCatalog(value: unknown): LegacyOwnerResolutionSchemaState;
39
+ export declare function readLegacyOwnerResolutionSchemaState(backend: Pick<AuthLinkBackend, "first">): Promise<LegacyOwnerResolutionSchemaState>;
40
+ //# sourceMappingURL=coordinator-legacy-owner-resolution-metadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinator-legacy-owner-resolution-metadata.d.ts","sourceRoot":"","sources":["../src/coordinator-legacy-owner-resolution-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAIlE,8EAA8E;AAC9E,MAAM,WAAW,2BAA2B;IAC3C,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,CAAC,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE,wBAAwB,CAAC;IAClC,KAAK,EAAE,uCAAuC,CAAC;IAC/C,qBAAqB,EAAE,MAAM,CAAC;IAC9B,eAAe,EAAE,MAAM,CAAC;IACxB,0BAA0B,EAAE,CAAC,CAAC;IAC9B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,6BAA6B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7C,iBAAiB,EAAE,MAAM,CAAC;IAC1B,wBAAwB,EAAE,MAAM,CAAC;IACjC,sBAAsB,EAAE,MAAM,CAAC;IAC/B,0BAA0B,EAAE,MAAM,CAAC;IACnC,yBAAyB,EAAE,MAAM,CAAC;IAClC,UAAU,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,6BAA6B,GAAG,8BAA8B,CAAC;IACrE,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,4BAA4B,CAAC;CACrC;AAED,MAAM,MAAM,gCAAgC,GAAG,OAAO,GAAG,SAAS,GAAG,aAAa,CAAC;AA+EnF,qFAAqF;AACrF,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CA2BzE;AAcD,wBAAsB,kCAAkC,CACvD,KAAK,EAAE,OAAO,GACZ,OAAO,CAAC,2BAA2B,GAAG,IAAI,CAAC,CAe7C;AAkBD,kFAAkF;AAClF,wBAAgB,0CAA0C,CACzD,KAAK,EAAE,OAAO,GACZ,gCAAgC,CAalC;AAED,wBAAsB,oCAAoC,CACzD,OAAO,EAAE,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,GACrC,OAAO,CAAC,gCAAgC,CAAC,CAa3C"}
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Inert historical-label receipts, never credentials or proof of authority.
3
+ * Future readers must validate the original source and current proof using the
4
+ * exact device AND canonical key. No store-open hook installs this schema.
5
+ * No foreign keys: deleting source state must not erase collision history.
6
+ * Canonical IDs use the full ECMAScript String.trim character set, including BOM.
7
+ */
8
+ export declare const LEGACY_OWNER_RESOLUTION_SCHEMA_STATEMENTS: readonly [`
9
+ CREATE TABLE IF NOT EXISTS coordinator_legacy_owner_resolutions (
10
+ coordinator_id TEXT NOT NULL CHECK (typeof(coordinator_id) = 'text' AND length(coordinator_id) BETWEEN 1 AND 256 AND length(trim(coordinator_id, char(9)||char(10)||char(13)||' ')) > 0 AND instr(coordinator_id, char(0)) = 0),
11
+ resolution_id TEXT NOT NULL CHECK (typeof(resolution_id) = 'text' AND length(resolution_id) BETWEEN 1 AND 256 AND length(trim(resolution_id, char(9)||char(10)||char(13)||' ')) > 0 AND instr(resolution_id, char(0)) = 0),
12
+ resolution_version INTEGER NOT NULL CHECK (typeof(resolution_version) = 'integer' AND resolution_version = 1),
13
+ device_id TEXT NOT NULL CHECK (typeof(device_id) = 'text' AND length(device_id) BETWEEN 1 AND 256 AND length(trim(device_id, char(9)||char(10)||char(13)||' ')) > 0 AND instr(device_id, char(0)) = 0),
14
+ key_id TEXT NOT NULL CHECK (typeof(key_id) = 'text' AND length(key_id) = 64 AND key_id NOT GLOB '*[^0-9a-f]*' AND instr(key_id, char(0)) = 0),
15
+ owner_identity_id TEXT NOT NULL CHECK (typeof(owner_identity_id) = 'text' AND length(owner_identity_id) BETWEEN 1 AND 256 AND length(trim(owner_identity_id, char(9)||char(10)||char(13)||' ')) > 0 AND instr(owner_identity_id, char(0)) = 0),
16
+ purpose TEXT NOT NULL CHECK (purpose = 'existing_account_owner'),
17
+ scope TEXT NOT NULL CHECK (scope = 'historical_included_owner_labels_only'),
18
+ source_attestation_id TEXT NOT NULL CHECK (typeof(source_attestation_id) = 'text' AND length(source_attestation_id) BETWEEN 1 AND 256 AND length(trim(source_attestation_id, char(9)||char(10)||char(13)||' ')) > 0 AND instr(source_attestation_id, char(0)) = 0),
19
+ source_group_id TEXT NOT NULL CHECK (typeof(source_group_id) = 'text' AND length(source_group_id) BETWEEN 1 AND 256 AND length(trim(source_group_id, char(9)||char(10)||char(13)||' ')) > 0 AND instr(source_group_id, char(0)) = 0),
20
+ source_controller_revision INTEGER NOT NULL CHECK (typeof(source_controller_revision) = 'integer' AND source_controller_revision = 1),
21
+ source_public_key TEXT NOT NULL CHECK (typeof(source_public_key) = 'text' AND length(source_public_key) BETWEEN 1 AND 4096 AND length(trim(source_public_key, char(9)||char(10)||char(13)||' ')) > 0 AND instr(source_public_key, char(0)) = 0),
22
+ source_fingerprint TEXT NOT NULL CHECK (typeof(source_fingerprint) = 'text' AND length(source_fingerprint) = 64 AND source_fingerprint NOT GLOB '*[^0-9a-f]*' AND instr(source_fingerprint, char(0)) = 0),
23
+ source_enrollment_identity_id TEXT CHECK (source_enrollment_identity_id IS NULL OR (typeof(source_enrollment_identity_id) = 'text' AND length(source_enrollment_identity_id) BETWEEN 1 AND 256 AND length(trim(source_enrollment_identity_id, char(9)||char(10)||char(13)||' ')) > 0 AND instr(source_enrollment_identity_id, char(0)) = 0)),
24
+ source_created_at TEXT NOT NULL CHECK (typeof(source_created_at) = 'text' AND length(source_created_at) BETWEEN 1 AND 256 AND length(trim(source_created_at, char(9)||char(10)||char(13)||' ')) > 0 AND instr(source_created_at, char(0)) = 0),
25
+ source_review_receipt_id TEXT NOT NULL CHECK (typeof(source_review_receipt_id) = 'text' AND length(source_review_receipt_id) BETWEEN 1 AND 256 AND length(trim(source_review_receipt_id, char(9)||char(10)||char(13)||' ')) > 0 AND instr(source_review_receipt_id, char(0)) = 0),
26
+ source_evidence_digest TEXT NOT NULL CHECK (typeof(source_evidence_digest) = 'text' AND length(source_evidence_digest) = 64 AND source_evidence_digest NOT GLOB '*[^0-9a-f]*' AND instr(source_evidence_digest, char(0)) = 0),
27
+ resolution_evidence_digest TEXT NOT NULL CHECK (typeof(resolution_evidence_digest) = 'text' AND length(resolution_evidence_digest) = 64 AND resolution_evidence_digest NOT GLOB '*[^0-9a-f]*' AND instr(resolution_evidence_digest, char(0)) = 0),
28
+ reviewed_weak_labels_json TEXT NOT NULL CHECK (typeof(reviewed_weak_labels_json) = 'text' AND length(CAST(reviewed_weak_labels_json AS BLOB)) <= 131072 AND CASE WHEN json_valid(reviewed_weak_labels_json) THEN json_type(reviewed_weak_labels_json) = 'array' ELSE 0 END),
29
+ created_at TEXT NOT NULL CHECK (typeof(created_at) = 'text' AND length(created_at) BETWEEN 1 AND 256 AND length(trim(created_at, char(9)||char(10)||char(13)||' ')) > 0 AND instr(created_at, char(0)) = 0),
30
+ CHECK (
31
+ coordinator_id = trim(coordinator_id, char(9,10,11,12,13,32,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288,65279))
32
+ AND resolution_id = trim(resolution_id, char(9,10,11,12,13,32,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288,65279))
33
+ AND device_id = trim(device_id, char(9,10,11,12,13,32,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288,65279))
34
+ AND owner_identity_id = trim(owner_identity_id, char(9,10,11,12,13,32,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288,65279))
35
+ AND source_attestation_id = trim(source_attestation_id, char(9,10,11,12,13,32,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288,65279))
36
+ AND source_group_id = trim(source_group_id, char(9,10,11,12,13,32,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288,65279))
37
+ AND source_review_receipt_id = trim(source_review_receipt_id, char(9,10,11,12,13,32,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288,65279))
38
+ AND (source_enrollment_identity_id IS NULL OR source_enrollment_identity_id = trim(source_enrollment_identity_id, char(9,10,11,12,13,32,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288,65279)))
39
+ ),
40
+ PRIMARY KEY (coordinator_id, resolution_id)
41
+ ) WITHOUT ROWID;
42
+ `, `
43
+ CREATE INDEX IF NOT EXISTS idx_legacy_owner_resolutions_device
44
+ ON coordinator_legacy_owner_resolutions (coordinator_id, device_id);
45
+ `, `
46
+ CREATE INDEX IF NOT EXISTS idx_legacy_owner_resolutions_key
47
+ ON coordinator_legacy_owner_resolutions (coordinator_id, key_id);
48
+ `, `
49
+ -- Reject before REPLACE can erase a receipt, even with recursive triggers off.
50
+ -- Separate indexed probes keep device-OR-key conflicts coordinator-scoped.
51
+ CREATE TRIGGER IF NOT EXISTS legacy_owner_resolution_insert_collision
52
+ BEFORE INSERT ON coordinator_legacy_owner_resolutions
53
+ WHEN EXISTS (SELECT 1 FROM coordinator_legacy_owner_resolutions
54
+ WHERE coordinator_id = NEW.coordinator_id AND resolution_id = NEW.resolution_id)
55
+ OR EXISTS (SELECT 1 FROM coordinator_legacy_owner_resolutions
56
+ WHERE coordinator_id = NEW.coordinator_id AND device_id = NEW.device_id AND owner_identity_id <> NEW.owner_identity_id)
57
+ OR EXISTS (SELECT 1 FROM coordinator_legacy_owner_resolutions
58
+ WHERE coordinator_id = NEW.coordinator_id AND key_id = NEW.key_id AND owner_identity_id <> NEW.owner_identity_id)
59
+ BEGIN SELECT RAISE(ABORT, 'legacy_owner_resolution_collision'); END;
60
+ `, `
61
+ CREATE TRIGGER IF NOT EXISTS legacy_owner_resolution_immutable_update
62
+ BEFORE UPDATE ON coordinator_legacy_owner_resolutions
63
+ BEGIN SELECT RAISE(ABORT, 'legacy_owner_resolution_immutable'); END;
64
+ `, `
65
+ CREATE TRIGGER IF NOT EXISTS legacy_owner_resolution_immutable_delete
66
+ BEFORE DELETE ON coordinator_legacy_owner_resolutions
67
+ BEGIN SELECT RAISE(ABORT, 'legacy_owner_resolution_immutable'); END;
68
+ `];
69
+ export declare const LEGACY_OWNER_RESOLUTION_SCHEMA_SQL: string;
70
+ //# sourceMappingURL=coordinator-legacy-owner-resolution-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinator-legacy-owner-resolution-schema.d.ts","sourceRoot":"","sources":["../src/coordinator-legacy-owner-resolution-schema.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,yCAAyC,YACrD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCA,EACA;;;CAGA,EACA;;;CAGA,EACA;;;;;;;;;;;;CAYA,EACA;;;;CAIA,EACA;;;;CAIA,CACS,CAAC;AAEX,eAAO,MAAM,kCAAkC,QACM,CAAC"}