@sentropic/cluster-mesh 0.24.0 → 0.26.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 (610) hide show
  1. package/README.md +5 -0
  2. package/dist/comments/storage-schema.d.ts +1 -1
  3. package/dist/comments/transport-contracts.d.ts +1 -1
  4. package/dist/compile/contract/diagnostics.d.ts +9 -0
  5. package/dist/compile/contract/diagnostics.d.ts.map +1 -0
  6. package/dist/compile/contract/diagnostics.js +82 -0
  7. package/dist/compile/contract/diagnostics.js.map +1 -0
  8. package/dist/compile/contract/encoding.d.ts +12 -0
  9. package/dist/compile/contract/encoding.d.ts.map +1 -0
  10. package/dist/compile/contract/encoding.js +95 -0
  11. package/dist/compile/contract/encoding.js.map +1 -0
  12. package/dist/compile/contract/index.d.ts +9 -0
  13. package/dist/compile/contract/index.d.ts.map +1 -0
  14. package/dist/compile/contract/index.js +9 -0
  15. package/dist/compile/contract/index.js.map +1 -0
  16. package/dist/compile/contract/json.d.ts +3 -0
  17. package/dist/compile/contract/json.d.ts.map +1 -0
  18. package/dist/compile/contract/json.js +75 -0
  19. package/dist/compile/contract/json.js.map +1 -0
  20. package/dist/compile/contract/output.d.ts +5 -0
  21. package/dist/compile/contract/output.d.ts.map +1 -0
  22. package/dist/compile/contract/output.js +57 -0
  23. package/dist/compile/contract/output.js.map +1 -0
  24. package/dist/compile/contract/recipe.d.ts +5 -0
  25. package/dist/compile/contract/recipe.d.ts.map +1 -0
  26. package/dist/compile/contract/recipe.js +86 -0
  27. package/dist/compile/contract/recipe.js.map +1 -0
  28. package/dist/compile/contract/schema.d.ts +26 -0
  29. package/dist/compile/contract/schema.d.ts.map +1 -0
  30. package/dist/compile/contract/schema.js +92 -0
  31. package/dist/compile/contract/schema.js.map +1 -0
  32. package/dist/compile/contract/types.d.ts +166 -0
  33. package/dist/compile/contract/types.d.ts.map +1 -0
  34. package/dist/compile/contract/types.js +21 -0
  35. package/dist/compile/contract/types.js.map +1 -0
  36. package/dist/compile/contract/vectors.d.ts +38 -0
  37. package/dist/compile/contract/vectors.d.ts.map +1 -0
  38. package/dist/compile/contract/vectors.js +29 -0
  39. package/dist/compile/contract/vectors.js.map +1 -0
  40. package/dist/engram-memory/wire-adaptation.d.ts +1 -1
  41. package/dist/engram-memory/wire-adaptation.d.ts.map +1 -1
  42. package/dist/engram-memory/wire-adaptation.js +24 -8
  43. package/dist/engram-memory/wire-adaptation.js.map +1 -1
  44. package/dist/forge/contracts.d.ts +60 -0
  45. package/dist/forge/contracts.d.ts.map +1 -0
  46. package/dist/forge/contracts.js +19 -0
  47. package/dist/forge/contracts.js.map +1 -0
  48. package/dist/forge/custody.d.ts +7 -0
  49. package/dist/forge/custody.d.ts.map +1 -0
  50. package/dist/forge/custody.js +76 -0
  51. package/dist/forge/custody.js.map +1 -0
  52. package/dist/forge/enrollment.d.ts +151 -0
  53. package/dist/forge/enrollment.d.ts.map +1 -0
  54. package/dist/forge/enrollment.js +98 -0
  55. package/dist/forge/enrollment.js.map +1 -0
  56. package/dist/forge/github-api.d.ts +6 -0
  57. package/dist/forge/github-api.d.ts.map +1 -0
  58. package/dist/forge/github-api.js +131 -0
  59. package/dist/forge/github-api.js.map +1 -0
  60. package/dist/forge/hono.d.ts +14 -0
  61. package/dist/forge/hono.d.ts.map +1 -0
  62. package/dist/forge/hono.js +141 -0
  63. package/dist/forge/hono.js.map +1 -0
  64. package/dist/forge/lifecycle.d.ts +108 -0
  65. package/dist/forge/lifecycle.d.ts.map +1 -0
  66. package/dist/forge/lifecycle.js +160 -0
  67. package/dist/forge/lifecycle.js.map +1 -0
  68. package/dist/forge/records.d.ts +70 -0
  69. package/dist/forge/records.d.ts.map +1 -0
  70. package/dist/forge/records.js +2 -0
  71. package/dist/forge/records.js.map +1 -0
  72. package/dist/forge/rotation.d.ts +46 -0
  73. package/dist/forge/rotation.d.ts.map +1 -0
  74. package/dist/forge/rotation.js +62 -0
  75. package/dist/forge/rotation.js.map +1 -0
  76. package/dist/identity/auth-abort.d.ts +9 -0
  77. package/dist/identity/auth-abort.d.ts.map +1 -0
  78. package/dist/identity/auth-abort.js +59 -0
  79. package/dist/identity/auth-abort.js.map +1 -0
  80. package/dist/identity/auth-binding.d.ts +3 -0
  81. package/dist/identity/auth-binding.d.ts.map +1 -0
  82. package/dist/identity/auth-binding.js +87 -0
  83. package/dist/identity/auth-binding.js.map +1 -0
  84. package/dist/identity/auth-boundary.d.ts +11 -0
  85. package/dist/identity/auth-boundary.d.ts.map +1 -0
  86. package/dist/identity/auth-boundary.js +73 -0
  87. package/dist/identity/auth-boundary.js.map +1 -0
  88. package/dist/identity/auth-completion.d.ts +9 -0
  89. package/dist/identity/auth-completion.d.ts.map +1 -0
  90. package/dist/identity/auth-completion.js +24 -0
  91. package/dist/identity/auth-completion.js.map +1 -0
  92. package/dist/identity/auth-credentials.d.ts +5 -0
  93. package/dist/identity/auth-credentials.d.ts.map +1 -0
  94. package/dist/identity/auth-credentials.js +82 -0
  95. package/dist/identity/auth-credentials.js.map +1 -0
  96. package/dist/identity/auth-email.d.ts +8 -0
  97. package/dist/identity/auth-email.d.ts.map +1 -0
  98. package/dist/identity/auth-email.js +104 -0
  99. package/dist/identity/auth-email.js.map +1 -0
  100. package/dist/identity/auth-hono.d.ts +5 -0
  101. package/dist/identity/auth-hono.d.ts.map +1 -0
  102. package/dist/identity/auth-hono.js +10 -0
  103. package/dist/identity/auth-hono.js.map +1 -0
  104. package/dist/identity/auth-proofs.d.ts +11 -0
  105. package/dist/identity/auth-proofs.d.ts.map +1 -0
  106. package/dist/identity/auth-proofs.js +107 -0
  107. package/dist/identity/auth-proofs.js.map +1 -0
  108. package/dist/identity/auth-service-tenant.d.ts +4 -0
  109. package/dist/identity/auth-service-tenant.d.ts.map +1 -0
  110. package/dist/identity/auth-service-tenant.js +54 -0
  111. package/dist/identity/auth-service-tenant.js.map +1 -0
  112. package/dist/identity/auth-sessions.d.ts +8 -0
  113. package/dist/identity/auth-sessions.d.ts.map +1 -0
  114. package/dist/identity/auth-sessions.js +141 -0
  115. package/dist/identity/auth-sessions.js.map +1 -0
  116. package/dist/identity/auth-social.d.ts +4 -0
  117. package/dist/identity/auth-social.d.ts.map +1 -0
  118. package/dist/identity/auth-social.js +82 -0
  119. package/dist/identity/auth-social.js.map +1 -0
  120. package/dist/identity/auth-users.d.ts +9 -0
  121. package/dist/identity/auth-users.d.ts.map +1 -0
  122. package/dist/identity/auth-users.js +116 -0
  123. package/dist/identity/auth-users.js.map +1 -0
  124. package/dist/identity/auth-webauthn.d.ts +22 -0
  125. package/dist/identity/auth-webauthn.d.ts.map +1 -0
  126. package/dist/identity/auth-webauthn.js +108 -0
  127. package/dist/identity/auth-webauthn.js.map +1 -0
  128. package/dist/identity/cascade.d.ts +12 -0
  129. package/dist/identity/cascade.d.ts.map +1 -0
  130. package/dist/identity/cascade.js +19 -0
  131. package/dist/identity/cascade.js.map +1 -0
  132. package/dist/identity/connector-custody.d.ts +85 -0
  133. package/dist/identity/connector-custody.d.ts.map +1 -0
  134. package/dist/identity/connector-custody.js +288 -0
  135. package/dist/identity/connector-custody.js.map +1 -0
  136. package/dist/identity/conversation.d.ts +50 -0
  137. package/dist/identity/conversation.d.ts.map +1 -0
  138. package/dist/identity/conversation.js +102 -0
  139. package/dist/identity/conversation.js.map +1 -0
  140. package/dist/identity/custody-crypto.d.ts +37 -0
  141. package/dist/identity/custody-crypto.d.ts.map +1 -0
  142. package/dist/identity/custody-crypto.js +173 -0
  143. package/dist/identity/custody-crypto.js.map +1 -0
  144. package/dist/identity/decision.d.ts +28 -0
  145. package/dist/identity/decision.d.ts.map +1 -0
  146. package/dist/identity/decision.js +97 -0
  147. package/dist/identity/decision.js.map +1 -0
  148. package/dist/identity/index.d.ts +9 -0
  149. package/dist/identity/index.d.ts.map +1 -0
  150. package/dist/identity/index.js +13 -0
  151. package/dist/identity/index.js.map +1 -0
  152. package/dist/identity/ledger.d.ts +120 -0
  153. package/dist/identity/ledger.d.ts.map +1 -0
  154. package/dist/identity/ledger.js +226 -0
  155. package/dist/identity/ledger.js.map +1 -0
  156. package/dist/identity/postgres.d.ts +13 -0
  157. package/dist/identity/postgres.d.ts.map +1 -0
  158. package/dist/identity/postgres.js +207 -0
  159. package/dist/identity/postgres.js.map +1 -0
  160. package/dist/identity/sqlite.d.ts +14 -0
  161. package/dist/identity/sqlite.d.ts.map +1 -0
  162. package/dist/identity/sqlite.js +193 -0
  163. package/dist/identity/sqlite.js.map +1 -0
  164. package/dist/identity-contracts/access.d.ts +54 -0
  165. package/dist/identity-contracts/access.d.ts.map +1 -0
  166. package/dist/identity-contracts/access.js +168 -0
  167. package/dist/identity-contracts/access.js.map +1 -0
  168. package/dist/identity-contracts/accounts.d.ts +44 -0
  169. package/dist/identity-contracts/accounts.d.ts.map +1 -0
  170. package/dist/identity-contracts/accounts.js +150 -0
  171. package/dist/identity-contracts/accounts.js.map +1 -0
  172. package/dist/identity-contracts/boundary-resolution.d.ts +31 -0
  173. package/dist/identity-contracts/boundary-resolution.d.ts.map +1 -0
  174. package/dist/identity-contracts/boundary-resolution.js +56 -0
  175. package/dist/identity-contracts/boundary-resolution.js.map +1 -0
  176. package/dist/identity-contracts/composition-descriptors.d.ts +17 -0
  177. package/dist/identity-contracts/composition-descriptors.d.ts.map +1 -0
  178. package/dist/identity-contracts/composition-descriptors.js +77 -0
  179. package/dist/identity-contracts/composition-descriptors.js.map +1 -0
  180. package/dist/identity-contracts/custody-auth.d.ts +122 -0
  181. package/dist/identity-contracts/custody-auth.d.ts.map +1 -0
  182. package/dist/identity-contracts/custody-auth.js +2 -0
  183. package/dist/identity-contracts/custody-auth.js.map +1 -0
  184. package/dist/identity-contracts/custody-descriptors.d.ts +18 -0
  185. package/dist/identity-contracts/custody-descriptors.d.ts.map +1 -0
  186. package/dist/identity-contracts/custody-descriptors.js +83 -0
  187. package/dist/identity-contracts/custody-descriptors.js.map +1 -0
  188. package/dist/identity-contracts/custody-errors.d.ts +21 -0
  189. package/dist/identity-contracts/custody-errors.d.ts.map +1 -0
  190. package/dist/identity-contracts/custody-errors.js +80 -0
  191. package/dist/identity-contracts/custody-errors.js.map +1 -0
  192. package/dist/identity-contracts/custody-operations.d.ts +79 -0
  193. package/dist/identity-contracts/custody-operations.d.ts.map +1 -0
  194. package/dist/identity-contracts/custody-operations.js +2 -0
  195. package/dist/identity-contracts/custody-operations.js.map +1 -0
  196. package/dist/identity-contracts/custody.d.ts +587 -0
  197. package/dist/identity-contracts/custody.d.ts.map +1 -0
  198. package/dist/identity-contracts/custody.js +7 -0
  199. package/dist/identity-contracts/custody.js.map +1 -0
  200. package/dist/identity-contracts/descriptors.d.ts +12 -0
  201. package/dist/identity-contracts/descriptors.d.ts.map +1 -0
  202. package/dist/identity-contracts/descriptors.js +57 -0
  203. package/dist/identity-contracts/descriptors.js.map +1 -0
  204. package/dist/identity-contracts/doubles.d.ts +124 -0
  205. package/dist/identity-contracts/doubles.d.ts.map +1 -0
  206. package/dist/identity-contracts/doubles.js +360 -0
  207. package/dist/identity-contracts/doubles.js.map +1 -0
  208. package/dist/identity-contracts/enforcement.d.ts +27 -0
  209. package/dist/identity-contracts/enforcement.d.ts.map +1 -0
  210. package/dist/identity-contracts/enforcement.js +155 -0
  211. package/dist/identity-contracts/enforcement.js.map +1 -0
  212. package/dist/identity-contracts/errors.d.ts +71 -0
  213. package/dist/identity-contracts/errors.d.ts.map +1 -0
  214. package/dist/identity-contracts/errors.js +129 -0
  215. package/dist/identity-contracts/errors.js.map +1 -0
  216. package/dist/identity-contracts/index.d.ts +22 -0
  217. package/dist/identity-contracts/index.d.ts.map +1 -0
  218. package/dist/identity-contracts/index.js +23 -0
  219. package/dist/identity-contracts/index.js.map +1 -0
  220. package/dist/identity-contracts/oauth-reads.d.ts +42 -0
  221. package/dist/identity-contracts/oauth-reads.d.ts.map +1 -0
  222. package/dist/identity-contracts/oauth-reads.js +38 -0
  223. package/dist/identity-contracts/oauth-reads.js.map +1 -0
  224. package/dist/identity-contracts/ports.d.ts +116 -0
  225. package/dist/identity-contracts/ports.d.ts.map +1 -0
  226. package/dist/identity-contracts/ports.js +7 -0
  227. package/dist/identity-contracts/ports.js.map +1 -0
  228. package/dist/identity-contracts/replica-sync.d.ts +89 -0
  229. package/dist/identity-contracts/replica-sync.d.ts.map +1 -0
  230. package/dist/identity-contracts/replica-sync.js +7 -0
  231. package/dist/identity-contracts/replica-sync.js.map +1 -0
  232. package/dist/identity-contracts/resolution.d.ts +56 -0
  233. package/dist/identity-contracts/resolution.d.ts.map +1 -0
  234. package/dist/identity-contracts/resolution.js +87 -0
  235. package/dist/identity-contracts/resolution.js.map +1 -0
  236. package/dist/identity-contracts/service-tenancy.d.ts +43 -0
  237. package/dist/identity-contracts/service-tenancy.d.ts.map +1 -0
  238. package/dist/identity-contracts/service-tenancy.js +75 -0
  239. package/dist/identity-contracts/service-tenancy.js.map +1 -0
  240. package/dist/identity-contracts/tenancy.d.ts +52 -0
  241. package/dist/identity-contracts/tenancy.d.ts.map +1 -0
  242. package/dist/identity-contracts/tenancy.js +171 -0
  243. package/dist/identity-contracts/tenancy.js.map +1 -0
  244. package/dist/identity-contracts/types.d.ts +253 -0
  245. package/dist/identity-contracts/types.d.ts.map +1 -0
  246. package/dist/identity-contracts/types.js +7 -0
  247. package/dist/identity-contracts/types.js.map +1 -0
  248. package/dist/identity-contracts/workspace-deletion.d.ts +56 -0
  249. package/dist/identity-contracts/workspace-deletion.d.ts.map +1 -0
  250. package/dist/identity-contracts/workspace-deletion.js +7 -0
  251. package/dist/identity-contracts/workspace-deletion.js.map +1 -0
  252. package/dist/identity-contracts/workspaces.d.ts +37 -0
  253. package/dist/identity-contracts/workspaces.d.ts.map +1 -0
  254. package/dist/identity-contracts/workspaces.js +118 -0
  255. package/dist/identity-contracts/workspaces.js.map +1 -0
  256. package/dist/identity-stores/index.d.ts +4 -0
  257. package/dist/identity-stores/index.d.ts.map +1 -0
  258. package/dist/identity-stores/index.js +7 -0
  259. package/dist/identity-stores/index.js.map +1 -0
  260. package/dist/identity-stores/tenancy-postgres.d.ts +23 -0
  261. package/dist/identity-stores/tenancy-postgres.d.ts.map +1 -0
  262. package/dist/identity-stores/tenancy-postgres.js +294 -0
  263. package/dist/identity-stores/tenancy-postgres.js.map +1 -0
  264. package/dist/identity-stores/tenancy-schema.d.ts +11 -0
  265. package/dist/identity-stores/tenancy-schema.d.ts.map +1 -0
  266. package/dist/identity-stores/tenancy-schema.js +74 -0
  267. package/dist/identity-stores/tenancy-schema.js.map +1 -0
  268. package/dist/identity-stores/tenancy-sqlite.d.ts +24 -0
  269. package/dist/identity-stores/tenancy-sqlite.d.ts.map +1 -0
  270. package/dist/identity-stores/tenancy-sqlite.js +288 -0
  271. package/dist/identity-stores/tenancy-sqlite.js.map +1 -0
  272. package/dist/index.d.ts +15 -0
  273. package/dist/index.d.ts.map +1 -1
  274. package/dist/index.js +14 -0
  275. package/dist/index.js.map +1 -1
  276. package/dist/integrations/mcp/memory-compose.d.ts +11 -0
  277. package/dist/integrations/mcp/memory-compose.d.ts.map +1 -0
  278. package/dist/integrations/mcp/memory-compose.js +79 -0
  279. package/dist/integrations/mcp/memory-compose.js.map +1 -0
  280. package/dist/integrations/mcp/memory-definition.d.ts +28 -0
  281. package/dist/integrations/mcp/memory-definition.d.ts.map +1 -0
  282. package/dist/integrations/mcp/memory-definition.js +2 -0
  283. package/dist/integrations/mcp/memory-definition.js.map +1 -0
  284. package/dist/integrations/mcp/memory-manifest.d.ts +4 -0
  285. package/dist/integrations/mcp/memory-manifest.d.ts.map +1 -0
  286. package/dist/integrations/mcp/memory-manifest.js +9 -0
  287. package/dist/integrations/mcp/memory-manifest.js.map +1 -0
  288. package/dist/integrations/mcp/memory-transport.d.ts +21 -0
  289. package/dist/integrations/mcp/memory-transport.d.ts.map +1 -0
  290. package/dist/integrations/mcp/memory-transport.js +47 -0
  291. package/dist/integrations/mcp/memory-transport.js.map +1 -0
  292. package/dist/integrations/mcp/memory.d.ts +19 -0
  293. package/dist/integrations/mcp/memory.d.ts.map +1 -0
  294. package/dist/integrations/mcp/memory.js +40 -0
  295. package/dist/integrations/mcp/memory.js.map +1 -0
  296. package/dist/loaders/mcp/index.d.ts +1 -0
  297. package/dist/loaders/mcp/index.d.ts.map +1 -1
  298. package/dist/loaders/mcp/index.js +1 -0
  299. package/dist/loaders/mcp/index.js.map +1 -1
  300. package/dist/loaders/mcp/memory.d.ts +6 -0
  301. package/dist/loaders/mcp/memory.d.ts.map +1 -0
  302. package/dist/loaders/mcp/memory.js +9 -0
  303. package/dist/loaders/mcp/memory.js.map +1 -0
  304. package/dist/loaders/notifications/index.d.ts +5 -0
  305. package/dist/loaders/notifications/index.d.ts.map +1 -0
  306. package/dist/loaders/notifications/index.js +6 -0
  307. package/dist/loaders/notifications/index.js.map +1 -0
  308. package/dist/mcp/stateful-preflight.d.ts +1 -1
  309. package/dist/messaging/email-port.d.ts +49 -0
  310. package/dist/messaging/email-port.d.ts.map +1 -0
  311. package/dist/messaging/email-port.js +92 -0
  312. package/dist/messaging/email-port.js.map +1 -0
  313. package/dist/messaging/index.d.ts +1 -0
  314. package/dist/messaging/index.d.ts.map +1 -1
  315. package/dist/messaging/index.js +1 -0
  316. package/dist/messaging/index.js.map +1 -1
  317. package/dist/modules/catalog.d.ts +7 -4
  318. package/dist/modules/catalog.d.ts.map +1 -1
  319. package/dist/modules/catalog.js +24 -5
  320. package/dist/modules/catalog.js.map +1 -1
  321. package/dist/modules/contracts.d.ts +1 -1
  322. package/dist/modules/contracts.d.ts.map +1 -1
  323. package/dist/modules/contracts.js +3 -0
  324. package/dist/modules/contracts.js.map +1 -1
  325. package/dist/notifications/incident-policy.d.ts +6 -0
  326. package/dist/notifications/incident-policy.d.ts.map +1 -0
  327. package/dist/notifications/incident-policy.js +119 -0
  328. package/dist/notifications/incident-policy.js.map +1 -0
  329. package/dist/notifications/incident-schedule.d.ts +14 -0
  330. package/dist/notifications/incident-schedule.d.ts.map +1 -0
  331. package/dist/notifications/incident-schedule.js +36 -0
  332. package/dist/notifications/incident-schedule.js.map +1 -0
  333. package/dist/notifications/incident-state.d.ts +72 -0
  334. package/dist/notifications/incident-state.d.ts.map +1 -0
  335. package/dist/notifications/incident-state.js +72 -0
  336. package/dist/notifications/incident-state.js.map +1 -0
  337. package/dist/notifications/index.d.ts +9 -0
  338. package/dist/notifications/index.d.ts.map +1 -0
  339. package/dist/notifications/index.js +9 -0
  340. package/dist/notifications/index.js.map +1 -0
  341. package/dist/notifications/ops-job-failure-contract.d.ts +19 -0
  342. package/dist/notifications/ops-job-failure-contract.d.ts.map +1 -0
  343. package/dist/notifications/ops-job-failure-contract.js +183 -0
  344. package/dist/notifications/ops-job-failure-contract.js.map +1 -0
  345. package/dist/notifications/ops-job-failure-types.d.ts +81 -0
  346. package/dist/notifications/ops-job-failure-types.d.ts.map +1 -0
  347. package/dist/notifications/ops-job-failure-types.js +73 -0
  348. package/dist/notifications/ops-job-failure-types.js.map +1 -0
  349. package/dist/notifications/recipients-http.d.ts +66 -0
  350. package/dist/notifications/recipients-http.d.ts.map +1 -0
  351. package/dist/notifications/recipients-http.js +148 -0
  352. package/dist/notifications/recipients-http.js.map +1 -0
  353. package/dist/notifications/recipients.d.ts +50 -0
  354. package/dist/notifications/recipients.d.ts.map +1 -0
  355. package/dist/notifications/recipients.js +59 -0
  356. package/dist/notifications/recipients.js.map +1 -0
  357. package/dist/prompts/registry.d.ts +55 -0
  358. package/dist/prompts/registry.d.ts.map +1 -0
  359. package/dist/prompts/registry.js +76 -0
  360. package/dist/prompts/registry.js.map +1 -0
  361. package/dist/runtime/heavy-phase-queue.d.ts +101 -0
  362. package/dist/runtime/heavy-phase-queue.d.ts.map +1 -0
  363. package/dist/runtime/heavy-phase-queue.js +129 -0
  364. package/dist/runtime/heavy-phase-queue.js.map +1 -0
  365. package/dist/sessions/content-policy.d.ts +55 -0
  366. package/dist/sessions/content-policy.d.ts.map +1 -0
  367. package/dist/sessions/content-policy.js +133 -0
  368. package/dist/sessions/content-policy.js.map +1 -0
  369. package/dist/sessions/registry-admin.d.ts +19 -0
  370. package/dist/sessions/registry-admin.d.ts.map +1 -0
  371. package/dist/sessions/registry-admin.js +42 -0
  372. package/dist/sessions/registry-admin.js.map +1 -0
  373. package/dist/sessions/registry-freshness.d.ts +8 -0
  374. package/dist/sessions/registry-freshness.d.ts.map +1 -0
  375. package/dist/sessions/registry-freshness.js +108 -0
  376. package/dist/sessions/registry-freshness.js.map +1 -0
  377. package/dist/sessions/registry-ingest.d.ts +5 -0
  378. package/dist/sessions/registry-ingest.d.ts.map +1 -0
  379. package/dist/sessions/registry-ingest.js +113 -0
  380. package/dist/sessions/registry-ingest.js.map +1 -0
  381. package/dist/sessions/registry-publish.d.ts +18 -0
  382. package/dist/sessions/registry-publish.d.ts.map +1 -0
  383. package/dist/sessions/registry-publish.js +134 -0
  384. package/dist/sessions/registry-publish.js.map +1 -0
  385. package/dist/sessions/registry-store.d.ts +51 -0
  386. package/dist/sessions/registry-store.d.ts.map +1 -0
  387. package/dist/sessions/registry-store.js +134 -0
  388. package/dist/sessions/registry-store.js.map +1 -0
  389. package/dist/sessions/registry-types.d.ts +180 -0
  390. package/dist/sessions/registry-types.d.ts.map +1 -0
  391. package/dist/sessions/registry-types.js +32 -0
  392. package/dist/sessions/registry-types.js.map +1 -0
  393. package/dist/sessions/registry.d.ts +45 -0
  394. package/dist/sessions/registry.d.ts.map +1 -0
  395. package/dist/sessions/registry.js +74 -0
  396. package/dist/sessions/registry.js.map +1 -0
  397. package/dist/sessions/relay-bind.d.ts +38 -0
  398. package/dist/sessions/relay-bind.d.ts.map +1 -0
  399. package/dist/sessions/relay-bind.js +74 -0
  400. package/dist/sessions/relay-bind.js.map +1 -0
  401. package/dist/sessions/relay-brand.d.ts +2 -0
  402. package/dist/sessions/relay-brand.d.ts.map +1 -0
  403. package/dist/sessions/relay-brand.js +7 -0
  404. package/dist/sessions/relay-brand.js.map +1 -0
  405. package/dist/sessions/relay-capsule.d.ts +50 -0
  406. package/dist/sessions/relay-capsule.d.ts.map +1 -0
  407. package/dist/sessions/relay-capsule.js +72 -0
  408. package/dist/sessions/relay-capsule.js.map +1 -0
  409. package/dist/sessions/relay-chain-failure.d.ts +25 -0
  410. package/dist/sessions/relay-chain-failure.d.ts.map +1 -0
  411. package/dist/sessions/relay-chain-failure.js +23 -0
  412. package/dist/sessions/relay-chain-failure.js.map +1 -0
  413. package/dist/sessions/relay-chain.d.ts +74 -0
  414. package/dist/sessions/relay-chain.d.ts.map +1 -0
  415. package/dist/sessions/relay-chain.js +71 -0
  416. package/dist/sessions/relay-chain.js.map +1 -0
  417. package/dist/sessions/relay-composition.d.ts +8 -0
  418. package/dist/sessions/relay-composition.d.ts.map +1 -0
  419. package/dist/sessions/relay-composition.js +65 -0
  420. package/dist/sessions/relay-composition.js.map +1 -0
  421. package/dist/sessions/relay-credit.d.ts +40 -0
  422. package/dist/sessions/relay-credit.d.ts.map +1 -0
  423. package/dist/sessions/relay-credit.js +68 -0
  424. package/dist/sessions/relay-credit.js.map +1 -0
  425. package/dist/sessions/relay-engine.d.ts +19 -0
  426. package/dist/sessions/relay-engine.d.ts.map +1 -0
  427. package/dist/sessions/relay-engine.js +34 -0
  428. package/dist/sessions/relay-engine.js.map +1 -0
  429. package/dist/sessions/relay-frames.d.ts +28 -0
  430. package/dist/sessions/relay-frames.d.ts.map +1 -0
  431. package/dist/sessions/relay-frames.js +72 -0
  432. package/dist/sessions/relay-frames.js.map +1 -0
  433. package/dist/sessions/relay-lane-client.d.ts +7 -0
  434. package/dist/sessions/relay-lane-client.d.ts.map +1 -0
  435. package/dist/sessions/relay-lane-client.js +137 -0
  436. package/dist/sessions/relay-lane-client.js.map +1 -0
  437. package/dist/sessions/relay-lane-lease.d.ts +20 -0
  438. package/dist/sessions/relay-lane-lease.d.ts.map +1 -0
  439. package/dist/sessions/relay-lane-lease.js +74 -0
  440. package/dist/sessions/relay-lane-lease.js.map +1 -0
  441. package/dist/sessions/relay-lane-record.d.ts +28 -0
  442. package/dist/sessions/relay-lane-record.d.ts.map +1 -0
  443. package/dist/sessions/relay-lane-record.js +28 -0
  444. package/dist/sessions/relay-lane-record.js.map +1 -0
  445. package/dist/sessions/relay-lane-stream.d.ts +13 -0
  446. package/dist/sessions/relay-lane-stream.d.ts.map +1 -0
  447. package/dist/sessions/relay-lane-stream.js +148 -0
  448. package/dist/sessions/relay-lane-stream.js.map +1 -0
  449. package/dist/sessions/relay-routes.d.ts +368 -0
  450. package/dist/sessions/relay-routes.d.ts.map +1 -0
  451. package/dist/sessions/relay-routes.js +46 -0
  452. package/dist/sessions/relay-routes.js.map +1 -0
  453. package/dist/sessions/relay-skeleton.d.ts +4 -0
  454. package/dist/sessions/relay-skeleton.d.ts.map +1 -0
  455. package/dist/sessions/relay-skeleton.js +85 -0
  456. package/dist/sessions/relay-skeleton.js.map +1 -0
  457. package/dist/sessions/relay-types.d.ts +107 -0
  458. package/dist/sessions/relay-types.d.ts.map +1 -0
  459. package/dist/sessions/relay-types.js +2 -0
  460. package/dist/sessions/relay-types.js.map +1 -0
  461. package/dist/sessions/relay-validate.d.ts +8 -0
  462. package/dist/sessions/relay-validate.d.ts.map +1 -0
  463. package/dist/sessions/relay-validate.js +169 -0
  464. package/dist/sessions/relay-validate.js.map +1 -0
  465. package/dist/sessions/relay-wire.d.ts +8 -0
  466. package/dist/sessions/relay-wire.d.ts.map +1 -0
  467. package/dist/sessions/relay-wire.js +37 -0
  468. package/dist/sessions/relay-wire.js.map +1 -0
  469. package/dist/sessions/relay-wiring.d.ts +26 -0
  470. package/dist/sessions/relay-wiring.d.ts.map +1 -0
  471. package/dist/sessions/relay-wiring.js +13 -0
  472. package/dist/sessions/relay-wiring.js.map +1 -0
  473. package/dist/sessions/relay.d.ts +11 -0
  474. package/dist/sessions/relay.d.ts.map +1 -0
  475. package/dist/sessions/relay.js +71 -0
  476. package/dist/sessions/relay.js.map +1 -0
  477. package/dist/storage/descriptor.d.ts +1 -1
  478. package/dist/storage/errors.d.ts +1 -1
  479. package/dist/storage/identity/atomic-deletion.d.ts +4 -0
  480. package/dist/storage/identity/atomic-deletion.d.ts.map +1 -0
  481. package/dist/storage/identity/atomic-deletion.js +235 -0
  482. package/dist/storage/identity/atomic-deletion.js.map +1 -0
  483. package/dist/storage/identity/custody-composition.d.ts +9 -0
  484. package/dist/storage/identity/custody-composition.d.ts.map +1 -0
  485. package/dist/storage/identity/custody-composition.js +31 -0
  486. package/dist/storage/identity/custody-composition.js.map +1 -0
  487. package/dist/storage/identity/custody-delivery-record.d.ts +4 -0
  488. package/dist/storage/identity/custody-delivery-record.d.ts.map +1 -0
  489. package/dist/storage/identity/custody-delivery-record.js +11 -0
  490. package/dist/storage/identity/custody-delivery-record.js.map +1 -0
  491. package/dist/storage/identity/custody-host.d.ts +16 -0
  492. package/dist/storage/identity/custody-host.d.ts.map +1 -0
  493. package/dist/storage/identity/custody-host.js +5 -0
  494. package/dist/storage/identity/custody-host.js.map +1 -0
  495. package/dist/storage/identity/custody-import-deliveries.d.ts +6 -0
  496. package/dist/storage/identity/custody-import-deliveries.d.ts.map +1 -0
  497. package/dist/storage/identity/custody-import-deliveries.js +46 -0
  498. package/dist/storage/identity/custody-import-deliveries.js.map +1 -0
  499. package/dist/storage/identity/custody-import.d.ts +4 -0
  500. package/dist/storage/identity/custody-import.d.ts.map +1 -0
  501. package/dist/storage/identity/custody-import.js +364 -0
  502. package/dist/storage/identity/custody-import.js.map +1 -0
  503. package/dist/storage/identity/custody-journal-postgres.d.ts +125 -0
  504. package/dist/storage/identity/custody-journal-postgres.d.ts.map +1 -0
  505. package/dist/storage/identity/custody-journal-postgres.js +428 -0
  506. package/dist/storage/identity/custody-journal-postgres.js.map +1 -0
  507. package/dist/storage/identity/custody-journal-sqlite.d.ts +121 -0
  508. package/dist/storage/identity/custody-journal-sqlite.d.ts.map +1 -0
  509. package/dist/storage/identity/custody-journal-sqlite.js +345 -0
  510. package/dist/storage/identity/custody-journal-sqlite.js.map +1 -0
  511. package/dist/storage/identity/custody-lifecycle.d.ts +4 -0
  512. package/dist/storage/identity/custody-lifecycle.d.ts.map +1 -0
  513. package/dist/storage/identity/custody-lifecycle.js +42 -0
  514. package/dist/storage/identity/custody-lifecycle.js.map +1 -0
  515. package/dist/storage/identity/custody-postgres.d.ts +96 -0
  516. package/dist/storage/identity/custody-postgres.d.ts.map +1 -0
  517. package/dist/storage/identity/custody-postgres.js +726 -0
  518. package/dist/storage/identity/custody-postgres.js.map +1 -0
  519. package/dist/storage/identity/custody-records.d.ts +17 -0
  520. package/dist/storage/identity/custody-records.d.ts.map +1 -0
  521. package/dist/storage/identity/custody-records.js +260 -0
  522. package/dist/storage/identity/custody-records.js.map +1 -0
  523. package/dist/storage/identity/custody-shared.d.ts +28 -0
  524. package/dist/storage/identity/custody-shared.d.ts.map +1 -0
  525. package/dist/storage/identity/custody-shared.js +24 -0
  526. package/dist/storage/identity/custody-shared.js.map +1 -0
  527. package/dist/storage/identity/custody-sqlite.d.ts +93 -0
  528. package/dist/storage/identity/custody-sqlite.d.ts.map +1 -0
  529. package/dist/storage/identity/custody-sqlite.js +568 -0
  530. package/dist/storage/identity/custody-sqlite.js.map +1 -0
  531. package/dist/storage/identity/custody-tombstone-record.d.ts +3 -0
  532. package/dist/storage/identity/custody-tombstone-record.d.ts.map +1 -0
  533. package/dist/storage/identity/custody-tombstone-record.js +8 -0
  534. package/dist/storage/identity/custody-tombstone-record.js.map +1 -0
  535. package/dist/storage/identity/custody-transaction-guards.d.ts +16 -0
  536. package/dist/storage/identity/custody-transaction-guards.d.ts.map +1 -0
  537. package/dist/storage/identity/custody-transaction-guards.js +64 -0
  538. package/dist/storage/identity/custody-transaction-guards.js.map +1 -0
  539. package/dist/storage/identity/custody-transaction-ports.d.ts +9 -0
  540. package/dist/storage/identity/custody-transaction-ports.d.ts.map +1 -0
  541. package/dist/storage/identity/custody-transaction-ports.js +106 -0
  542. package/dist/storage/identity/custody-transaction-ports.js.map +1 -0
  543. package/dist/storage/identity/deletion-planes.d.ts +10 -0
  544. package/dist/storage/identity/deletion-planes.d.ts.map +1 -0
  545. package/dist/storage/identity/deletion-planes.js +54 -0
  546. package/dist/storage/identity/deletion-planes.js.map +1 -0
  547. package/dist/storage/identity/index.d.ts +18 -0
  548. package/dist/storage/identity/index.d.ts.map +1 -0
  549. package/dist/storage/identity/index.js +22 -0
  550. package/dist/storage/identity/index.js.map +1 -0
  551. package/dist/storage/identity/postgres.d.ts +16 -0
  552. package/dist/storage/identity/postgres.d.ts.map +1 -0
  553. package/dist/storage/identity/postgres.js +345 -0
  554. package/dist/storage/identity/postgres.js.map +1 -0
  555. package/dist/storage/identity/records.d.ts +12 -0
  556. package/dist/storage/identity/records.d.ts.map +1 -0
  557. package/dist/storage/identity/records.js +84 -0
  558. package/dist/storage/identity/records.js.map +1 -0
  559. package/dist/storage/identity/replica-sync.d.ts +4 -0
  560. package/dist/storage/identity/replica-sync.d.ts.map +1 -0
  561. package/dist/storage/identity/replica-sync.js +402 -0
  562. package/dist/storage/identity/replica-sync.js.map +1 -0
  563. package/dist/storage/identity/schema.d.ts +13 -0
  564. package/dist/storage/identity/schema.d.ts.map +1 -0
  565. package/dist/storage/identity/schema.js +418 -0
  566. package/dist/storage/identity/schema.js.map +1 -0
  567. package/dist/storage/identity/sqlite-schema.d.ts +4 -0
  568. package/dist/storage/identity/sqlite-schema.d.ts.map +1 -0
  569. package/dist/storage/identity/sqlite-schema.js +17 -0
  570. package/dist/storage/identity/sqlite-schema.js.map +1 -0
  571. package/dist/storage/identity/sqlite.d.ts +25 -0
  572. package/dist/storage/identity/sqlite.d.ts.map +1 -0
  573. package/dist/storage/identity/sqlite.js +233 -0
  574. package/dist/storage/identity/sqlite.js.map +1 -0
  575. package/dist/storage/identity/stores.d.ts +10 -0
  576. package/dist/storage/identity/stores.d.ts.map +1 -0
  577. package/dist/storage/identity/stores.js +5 -0
  578. package/dist/storage/identity/stores.js.map +1 -0
  579. package/dist/storage/identity/wiring.d.ts +20 -0
  580. package/dist/storage/identity/wiring.d.ts.map +1 -0
  581. package/dist/storage/identity/wiring.js +26 -0
  582. package/dist/storage/identity/wiring.js.map +1 -0
  583. package/dist/storage/identity/workspace-deletion.d.ts +3 -0
  584. package/dist/storage/identity/workspace-deletion.d.ts.map +1 -0
  585. package/dist/storage/identity/workspace-deletion.js +100 -0
  586. package/dist/storage/identity/workspace-deletion.js.map +1 -0
  587. package/dist/storage/postgres/journal.d.ts +1 -1
  588. package/dist/storage/postgres/profiles.d.ts +2 -2
  589. package/dist/storage/postgres/scope.d.ts +1 -1
  590. package/dist/storage/root-facade.d.ts +1 -1
  591. package/dist/storage/root-journal.d.ts +1 -1
  592. package/dist/storage/root-profiles.d.ts +1 -1
  593. package/docs/memory-mcp-candidate.md +46 -0
  594. package/docs/memory-mcp.md +98 -0
  595. package/examples/memory-mcp-stdio.mjs +42 -0
  596. package/package.json +66 -5
  597. package/ui/AdminUsersScreen.svelte +197 -0
  598. package/ui/AdminUsersScreen.svelte.d.ts +4 -0
  599. package/ui/LoginScreen.svelte +15 -0
  600. package/ui/LoginScreen.svelte.d.ts +4 -0
  601. package/ui/MembershipDecisionsScreen.svelte +76 -0
  602. package/ui/MembershipDecisionsScreen.svelte.d.ts +4 -0
  603. package/ui/RegistrationScreen.svelte +15 -0
  604. package/ui/RegistrationScreen.svelte.d.ts +4 -0
  605. package/ui/WorkspaceMembersScreen.svelte +86 -0
  606. package/ui/WorkspaceMembersScreen.svelte.d.ts +4 -0
  607. package/ui/auth-flow.ts +44 -0
  608. package/ui/management-ports.ts +36 -0
  609. package/ui/management-transport.ts +29 -0
  610. package/contracts/engram-memory-neutral-contract-v1.d.ts +0 -367
@@ -0,0 +1,79 @@
1
+ import type { IdentityAccountProfileV1, IdentityDeletionAttemptV2, IdentityDeletionOperationV2, IdentityExternalRevocationV1, IdentityRevocationClaimV1, IdentityTransactionV1, BusinessDeletionPlanV1, PersonDeletionCommandV2, PersonDeletionReceiptV2 } from './custody.js';
2
+ import type { RevocationStepKind, UserAccount } from './types.js';
3
+ export interface IdentitySubjectLifecyclePortV1 {
4
+ register(account: UserAccount, profile: IdentityAccountProfileV1): Promise<void>;
5
+ updateEmail(userId: string, email: string, at: string): Promise<UserAccount>;
6
+ }
7
+ export interface IdentityCleanupReceiptV1 {
8
+ readonly deletedByTable: Readonly<Record<string, number>>;
9
+ readonly detachedByTable: Readonly<Record<string, number>>;
10
+ readonly remainingLiveReferences: number;
11
+ }
12
+ export interface PersonOrphanCleanupPortV1 {
13
+ deleteSubjectReferences(input: {
14
+ readonly userId: string;
15
+ readonly accountEmail: string | null;
16
+ readonly workspaceIdsToDelete: readonly string[];
17
+ readonly at: string;
18
+ }): Promise<IdentityCleanupReceiptV1>;
19
+ assertNoLiveReferences(input: {
20
+ readonly userId: string;
21
+ readonly accountEmail: string | null;
22
+ readonly deletedWorkspaceIds: readonly string[];
23
+ }): Promise<void>;
24
+ }
25
+ export interface IdentityDeletionJournalPortV2 {
26
+ reserve(record: IdentityDeletionOperationV2): Promise<IdentityDeletionOperationV2>;
27
+ find(operationId: string): Promise<IdentityDeletionOperationV2 | null>;
28
+ lock(operationId: string): Promise<IdentityDeletionOperationV2 | null>;
29
+ markCommitted(operationId: string, receipt: PersonDeletionReceiptV2): Promise<void>;
30
+ appendRolledBack(attemptId: string, receipt: PersonDeletionReceiptV2): Promise<void>;
31
+ listAttempts(operationId: string): Promise<readonly IdentityDeletionAttemptV2[]>;
32
+ }
33
+ export type IdentityRevocationTargetKindV1 = 'login_session' | 'subject' | 'connector_grant' | 'plane_resource';
34
+ export interface IdentityExternalRevocationDraftV1 {
35
+ readonly step: RevocationStepKind;
36
+ readonly subjectId: string;
37
+ readonly targetKind: IdentityRevocationTargetKindV1;
38
+ readonly targetRef: string;
39
+ readonly custodyRef: string | null;
40
+ }
41
+ export interface IdentityRevocationOutboxPortV1 {
42
+ enqueue(record: IdentityExternalRevocationV1): Promise<void>;
43
+ find(deliveryId: string): Promise<IdentityExternalRevocationV1 | null>;
44
+ listPending(operationId: string): Promise<readonly IdentityExternalRevocationV1[]>;
45
+ claimPending(input: {
46
+ readonly workerId: string;
47
+ readonly now: string;
48
+ readonly leaseUntil: string;
49
+ readonly limit: number;
50
+ }): Promise<readonly IdentityRevocationClaimV1[]>;
51
+ acknowledge(input: {
52
+ readonly deliveryId: string;
53
+ readonly workerId: string;
54
+ readonly claimVersion: number;
55
+ readonly at: string;
56
+ }): Promise<void>;
57
+ release(input: {
58
+ readonly deliveryId: string;
59
+ readonly workerId: string;
60
+ readonly claimVersion: number;
61
+ readonly at: string;
62
+ readonly nextAttemptAt: string;
63
+ }): Promise<void>;
64
+ }
65
+ export interface IdentityRevocationDeliveryPortV1 {
66
+ deliver(record: IdentityExternalRevocationV1): Promise<void>;
67
+ }
68
+ export interface PersonDeletionAuthorizationPortV1<H> {
69
+ assertAllowed(command: PersonDeletionCommandV2, tx: IdentityTransactionV1<H>): Promise<void>;
70
+ }
71
+ export interface PersonDeletionPlanePortV2<H> {
72
+ readonly step: Exclude<RevocationStepKind, 'login_sessions' | 'tenant_memberships' | 'account'>;
73
+ readonly placement: 'present' | 'absent';
74
+ apply(command: PersonDeletionCommandV2, plan: BusinessDeletionPlanV1, tx: IdentityTransactionV1<H>): Promise<readonly IdentityExternalRevocationDraftV1[]>;
75
+ assertDeliveryInScope(command: PersonDeletionCommandV2, plan: BusinessDeletionPlanV1, draft: IdentityExternalRevocationDraftV1, tx: IdentityTransactionV1<H>): Promise<void>;
76
+ assertAbsent(command: PersonDeletionCommandV2, plan: BusinessDeletionPlanV1, tx: IdentityTransactionV1<H>): Promise<void>;
77
+ }
78
+ export type AtomicRevocationDetailV2 = 'local_effects_committed' | 'external_delivery_pending' | 'external_delivery_complete' | 'required_local_step_failed' | 'transaction_rolled_back' | 'not_attempted_after_failure' | 'plane_absent';
79
+ //# sourceMappingURL=custody-operations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custody-operations.d.ts","sourceRoot":"","sources":["../../src/identity-contracts/custody-operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EAAE,yBAAyB,EAAE,2BAA2B,EAChF,4BAA4B,EAAE,yBAAyB,EAAE,qBAAqB,EAC9E,sBAAsB,EAAE,uBAAuB,EAAE,uBAAuB,EACzE,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAElE,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjF,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;CAC9E;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC1D,QAAQ,CAAC,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC3D,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;CAC1C;AAED,MAAM,WAAW,yBAAyB;IACxC,uBAAuB,CAAC,KAAK,EAAE;QAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;QAC9D,QAAQ,CAAC,oBAAoB,EAAE,SAAS,MAAM,EAAE,CAAC;QAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;KACvE,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;IACtC,sBAAsB,CAAC,KAAK,EAAE;QAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,QAAQ,CAAC,mBAAmB,EAAE,SAAS,MAAM,EAAE,CAAC;KAChH,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACnB;AAED,MAAM,WAAW,6BAA6B;IAC5C,OAAO,CAAC,MAAM,EAAE,2BAA2B,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;IACnF,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,2BAA2B,GAAG,IAAI,CAAC,CAAC;IACvE,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,2BAA2B,GAAG,IAAI,CAAC,CAAC;IACvE,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpF,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrF,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,yBAAyB,EAAE,CAAC,CAAC;CAClF;AAED,MAAM,MAAM,8BAA8B,GAAG,eAAe,GAAG,SAAS,GAAG,iBAAiB,GAAG,gBAAgB,CAAC;AAChH,MAAM,WAAW,iCAAiC;IAChD,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,8BAA8B,CAAC;IACpD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC;AAED,MAAM,WAAW,8BAA8B;IAC7C,OAAO,CAAC,MAAM,EAAE,4BAA4B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7D,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,4BAA4B,GAAG,IAAI,CAAC,CAAC;IACvE,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,4BAA4B,EAAE,CAAC,CAAC;IACnF,YAAY,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,SAAS,yBAAyB,EAAE,CAAC,CAAC;IAC7K,WAAW,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClJ,OAAO,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/K;AAED,MAAM,WAAW,gCAAgC;IAC/C,OAAO,CAAC,MAAM,EAAE,4BAA4B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9D;AAED,MAAM,WAAW,iCAAiC,CAAC,CAAC;IAClD,aAAa,CAAC,OAAO,EAAE,uBAAuB,EAAE,EAAE,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9F;AAED,MAAM,WAAW,yBAAyB,CAAC,CAAC;IAC1C,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,kBAAkB,EAAE,gBAAgB,GAAG,oBAAoB,GAAG,SAAS,CAAC,CAAC;IAChG,QAAQ,CAAC,SAAS,EAAE,SAAS,GAAG,QAAQ,CAAC;IACzC,KAAK,CAAC,OAAO,EAAE,uBAAuB,EAAE,IAAI,EAAE,sBAAsB,EAAE,EAAE,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,SAAS,iCAAiC,EAAE,CAAC,CAAC;IAC3J,qBAAqB,CAAC,OAAO,EAAE,uBAAuB,EAAE,IAAI,EAAE,sBAAsB,EAAE,KAAK,EAAE,iCAAiC,EAAE,EAAE,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7K,YAAY,CAAC,OAAO,EAAE,uBAAuB,EAAE,IAAI,EAAE,sBAAsB,EAAE,EAAE,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3H;AAED,MAAM,MAAM,wBAAwB,GAAG,yBAAyB,GAAG,2BAA2B,GAAG,4BAA4B,GACzH,4BAA4B,GAAG,yBAAyB,GAAG,6BAA6B,GAAG,cAAc,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=custody-operations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custody-operations.js","sourceRoot":"","sources":["../../src/identity-contracts/custody-operations.ts"],"names":[],"mappings":""}
@@ -0,0 +1,587 @@
1
+ import type { IdentityStores } from './ports.js';
2
+ import type { ConversationAuthorityStore } from '../identity/conversation.js';
3
+ import type { IdentityLedgerStore } from '../identity/ledger.js';
4
+ import type { IdentitySubjectLifecyclePortV1, PersonOrphanCleanupPortV1, IdentityDeletionJournalPortV2, IdentityRevocationOutboxPortV1, IdentityExternalRevocationDraftV1, IdentityCleanupReceiptV1, AtomicRevocationDetailV2, PersonDeletionAuthorizationPortV1, PersonDeletionPlanePortV2 } from './custody-operations.js';
5
+ export type IdentityIsoTimeV1 = string;
6
+ export type IdentitySha256HexV1 = string;
7
+ export type IdentityBase64UrlV1 = string;
8
+ export type IdentityRevisionV1 = number;
9
+ export type IdentityStorageProfileV1 = 'postgres' | 'sqlite';
10
+ export type IdentityDigestV1 = {
11
+ readonly algorithm: 'sha256';
12
+ readonly value: IdentitySha256HexV1;
13
+ } | {
14
+ readonly algorithm: 'hmac-sha256';
15
+ readonly value: IdentitySha256HexV1;
16
+ readonly keyRef: string;
17
+ };
18
+ /** Canonical binding key: exactly ECMAScript `email.trim().toLowerCase()`. */
19
+ export declare const canonicalBindingEmailV1: (email: string) => string;
20
+ export interface IdentityAccountProfileV1 {
21
+ readonly userId: string;
22
+ readonly emailVerified: boolean;
23
+ readonly displayName: string | null;
24
+ readonly approvalDueAt: IdentityIsoTimeV1 | null;
25
+ readonly approvedAt: IdentityIsoTimeV1 | null;
26
+ readonly approvedByUserId: string | null;
27
+ readonly disabledAt: IdentityIsoTimeV1 | null;
28
+ readonly disabledReason: string | null;
29
+ readonly legacyAccountStatus: string | null;
30
+ }
31
+ export interface WebAuthnCredentialV1 {
32
+ readonly proofId: string;
33
+ readonly userId: string;
34
+ readonly credentialId: IdentityBase64UrlV1;
35
+ readonly publicKeyCose: IdentityBase64UrlV1;
36
+ readonly counter: number;
37
+ readonly revision: IdentityRevisionV1;
38
+ readonly rpId: string;
39
+ readonly deviceName: string | null;
40
+ readonly transports: readonly string[] | null;
41
+ readonly uv: boolean;
42
+ readonly deviceType: string | null;
43
+ readonly backedUp: boolean | null;
44
+ readonly createdAt: IdentityIsoTimeV1;
45
+ readonly lastUsedAt: IdentityIsoTimeV1 | null;
46
+ readonly revokedAt: IdentityIsoTimeV1 | null;
47
+ }
48
+ export type SingleUseProofKindV1 = 'webauthn_challenge' | 'email_code' | 'magic_link';
49
+ export interface SingleUseProofKeyV1 {
50
+ readonly kind: SingleUseProofKindV1;
51
+ readonly proofId: string;
52
+ }
53
+ export interface SingleUseProofBaseV1 {
54
+ readonly proofId: string;
55
+ readonly userId: string | null;
56
+ readonly state: 'pending' | 'consumed' | 'revoked';
57
+ readonly revision: IdentityRevisionV1;
58
+ readonly createdAt: IdentityIsoTimeV1;
59
+ readonly expiresAt: IdentityIsoTimeV1;
60
+ readonly consumedAt: IdentityIsoTimeV1 | null;
61
+ readonly revokedAt: IdentityIsoTimeV1 | null;
62
+ }
63
+ export interface WebAuthnChallengeV1 extends SingleUseProofBaseV1 {
64
+ readonly kind: 'webauthn_challenge';
65
+ readonly challenge: IdentityBase64UrlV1;
66
+ readonly purpose: 'registration' | 'authentication';
67
+ readonly rpId: string;
68
+ readonly allowedOrigins: readonly string[];
69
+ readonly userVerification: 'required' | 'preferred' | 'discouraged';
70
+ }
71
+ export interface EmailCodeProofV1 extends SingleUseProofBaseV1 {
72
+ readonly kind: 'email_code';
73
+ readonly email: string;
74
+ readonly codeDigest: IdentityDigestV1;
75
+ }
76
+ export interface MagicLinkProofV1 extends SingleUseProofBaseV1 {
77
+ readonly kind: 'magic_link';
78
+ readonly email: string;
79
+ readonly tokenHash: IdentitySha256HexV1;
80
+ }
81
+ export type SingleUseProofV1 = WebAuthnChallengeV1 | EmailCodeProofV1 | MagicLinkProofV1;
82
+ export interface EmailRegistrationTicketV1 {
83
+ readonly codeProofId: string;
84
+ readonly email: string;
85
+ readonly tokenHash: IdentitySha256HexV1;
86
+ readonly userId: string | null;
87
+ readonly state: 'pending' | 'consumed' | 'revoked';
88
+ readonly revision: IdentityRevisionV1;
89
+ readonly createdAt: IdentityIsoTimeV1;
90
+ readonly expiresAt: IdentityIsoTimeV1;
91
+ readonly consumedAt: IdentityIsoTimeV1 | null;
92
+ readonly revokedAt: IdentityIsoTimeV1 | null;
93
+ }
94
+ export interface DigestInvitationV1 {
95
+ readonly invitationId: string;
96
+ readonly email: string;
97
+ readonly tenantId: string | null;
98
+ readonly workspaceId: string | null;
99
+ readonly clientId: string | null;
100
+ readonly tokenHash: IdentitySha256HexV1;
101
+ readonly status: 'pending' | 'consumed' | 'revoked';
102
+ readonly expiresAt: IdentityIsoTimeV1;
103
+ readonly createdAt: IdentityIsoTimeV1 | null;
104
+ readonly consumedAt: IdentityIsoTimeV1 | null;
105
+ readonly consumedByUserId: string | null;
106
+ readonly revision: IdentityRevisionV1;
107
+ }
108
+ export interface IssuedDigestInvitationV1 {
109
+ readonly invitation: DigestInvitationV1;
110
+ readonly token: string;
111
+ }
112
+ export interface SignedLoginBindingV1 {
113
+ readonly mfaVerified: boolean;
114
+ readonly authTime: number;
115
+ readonly sessionVersion: number;
116
+ }
117
+ export interface BoundLoginSessionV1 {
118
+ readonly sessionId: string;
119
+ readonly userId: string;
120
+ readonly sessionTokenHash: IdentitySha256HexV1;
121
+ readonly refreshTokenHash: IdentitySha256HexV1 | null;
122
+ readonly login: SignedLoginBindingV1;
123
+ readonly rotationVersion: IdentityRevisionV1;
124
+ readonly createdAt: IdentityIsoTimeV1;
125
+ readonly expiresAt: IdentityIsoTimeV1;
126
+ readonly revokedAt: IdentityIsoTimeV1 | null;
127
+ readonly deviceName: string | null;
128
+ readonly ipAddress: string | null;
129
+ readonly userAgent: string | null;
130
+ readonly lastActivityAt: IdentityIsoTimeV1 | null;
131
+ }
132
+ export interface SocialIdentityV1 {
133
+ readonly proofId: string;
134
+ readonly userId: string;
135
+ readonly provider: string;
136
+ readonly providerSubject: string;
137
+ readonly providerTenant: string | null;
138
+ readonly emailAtLink: string | null;
139
+ readonly emailVerifiedByProvider: boolean;
140
+ readonly linkedAt: IdentityIsoTimeV1;
141
+ readonly lastLoginAt: IdentityIsoTimeV1 | null;
142
+ readonly revokedAt: IdentityIsoTimeV1 | null;
143
+ readonly revision: IdentityRevisionV1;
144
+ }
145
+ export interface IdentityAccountProfileStoreV1 {
146
+ find(userId: string): Promise<IdentityAccountProfileV1 | null>;
147
+ put(record: IdentityAccountProfileV1): Promise<void>;
148
+ }
149
+ export interface WebAuthnCredentialStoreV1 {
150
+ insert(record: WebAuthnCredentialV1): Promise<void>;
151
+ findById(proofId: string): Promise<WebAuthnCredentialV1 | null>;
152
+ findByCredentialId(credentialId: string): Promise<WebAuthnCredentialV1 | null>;
153
+ listForUser(userId: string): Promise<readonly WebAuthnCredentialV1[]>;
154
+ compareAndSwapCounter(input: {
155
+ readonly proofId: string;
156
+ readonly userId: string;
157
+ readonly expectedCounter: number;
158
+ readonly expectedRevision: number;
159
+ readonly newCounter: number;
160
+ readonly at: string;
161
+ }): Promise<WebAuthnCredentialV1>;
162
+ rename(proofId: string, userId: string, deviceName: string): Promise<void>;
163
+ revoke(proofId: string, userId: string, at: string): Promise<void>;
164
+ }
165
+ export type SingleUseProofMatchV1 = {
166
+ readonly kind: 'webauthn_challenge';
167
+ readonly challenge: string;
168
+ readonly purpose: 'registration' | 'authentication';
169
+ readonly rpId: string;
170
+ } | {
171
+ readonly kind: 'email_code';
172
+ readonly email: string;
173
+ readonly digest: IdentityDigestV1;
174
+ } | {
175
+ readonly kind: 'magic_link';
176
+ readonly email: string;
177
+ readonly tokenHash: string;
178
+ };
179
+ export interface SingleUseProofStoreV1 {
180
+ insert(record: SingleUseProofV1): Promise<void>;
181
+ find(key: SingleUseProofKeyV1): Promise<SingleUseProofV1 | null>;
182
+ findChallenge(challenge: string, purpose: WebAuthnChallengeV1['purpose']): Promise<WebAuthnChallengeV1 | null>;
183
+ findLatestEmailCode(email: string, candidates: readonly IdentityDigestV1[], now: string): Promise<EmailCodeProofV1 | null>;
184
+ findMagicLink(tokenHash: string): Promise<MagicLinkProofV1 | null>;
185
+ countEmailCodes(email: string, since: string): Promise<number>;
186
+ consume(input: {
187
+ readonly key: SingleUseProofKeyV1;
188
+ readonly expectedRevision: number;
189
+ readonly expectedUserId: string | null;
190
+ readonly match: SingleUseProofMatchV1;
191
+ readonly bindUserId: string | null;
192
+ readonly at: string;
193
+ }): Promise<SingleUseProofV1>;
194
+ revoke(key: SingleUseProofKeyV1, expectedRevision: number, at: string): Promise<void>;
195
+ purgeExpired(now: string): Promise<number>;
196
+ }
197
+ export interface EmailRegistrationTicketStoreV1 {
198
+ findByTokenHash(tokenHash: string): Promise<EmailRegistrationTicketV1 | null>;
199
+ /** Create-only privileged import of a ticket row; no code consumption. */
200
+ importTicket(record: EmailRegistrationTicketV1): Promise<void>;
201
+ exchangeCode(input: {
202
+ readonly codeProofId: string;
203
+ readonly expectedRevision: number;
204
+ readonly email: string;
205
+ readonly digest: IdentityDigestV1;
206
+ readonly ticket: EmailRegistrationTicketV1;
207
+ readonly at: string;
208
+ }): Promise<EmailRegistrationTicketV1>;
209
+ consume(input: {
210
+ readonly tokenHash: string;
211
+ readonly email: string;
212
+ readonly expectedRevision: number;
213
+ readonly bindUserId: string;
214
+ readonly at: string;
215
+ }): Promise<EmailRegistrationTicketV1>;
216
+ revoke(codeProofId: string, expectedRevision: number, at: string): Promise<void>;
217
+ }
218
+ export interface DigestInvitationStoreV1 {
219
+ insert(record: DigestInvitationV1): Promise<void>;
220
+ findById(invitationId: string): Promise<DigestInvitationV1 | null>;
221
+ findByDigest(tokenHash: string): Promise<DigestInvitationV1 | null>;
222
+ consumeByDigest(input: {
223
+ readonly tokenHash: string;
224
+ readonly email: string;
225
+ readonly clientId: string | null;
226
+ readonly userId: string;
227
+ readonly expectedRevision: number;
228
+ readonly at: string;
229
+ }): Promise<DigestInvitationV1>;
230
+ revoke(invitationId: string, expectedRevision: number, at: string): Promise<void>;
231
+ }
232
+ export interface BoundLoginSessionStoreV1 {
233
+ insert(record: BoundLoginSessionV1): Promise<void>;
234
+ findById(sessionId: string): Promise<BoundLoginSessionV1 | null>;
235
+ findBySessionTokenHash(hash: string): Promise<BoundLoginSessionV1 | null>;
236
+ findByRefreshTokenHash(hash: string): Promise<BoundLoginSessionV1 | null>;
237
+ rotate(input: {
238
+ readonly sessionId: string;
239
+ readonly userId: string;
240
+ readonly expectedRefreshTokenHash: string;
241
+ readonly expectedRotationVersion: number;
242
+ readonly verifiedLogin: SignedLoginBindingV1;
243
+ readonly nextSessionTokenHash: string;
244
+ readonly nextRefreshTokenHash: string;
245
+ readonly nextExpiresAt: string;
246
+ readonly at: string;
247
+ }): Promise<BoundLoginSessionV1>;
248
+ touchActivity(sessionId: string, at: string): Promise<void>;
249
+ revoke(sessionId: string, at: string): Promise<void>;
250
+ revokeAllForUser(userId: string, at: string): Promise<number>;
251
+ listForUser(userId: string): Promise<readonly BoundLoginSessionV1[]>;
252
+ }
253
+ export interface SocialIdentityStoreV1 {
254
+ insert(record: SocialIdentityV1): Promise<void>;
255
+ findById(proofId: string): Promise<SocialIdentityV1 | null>;
256
+ findBySubject(provider: string, providerSubject: string): Promise<SocialIdentityV1 | null>;
257
+ listForUser(userId: string): Promise<readonly SocialIdentityV1[]>;
258
+ touchLogin(proofId: string, expectedRevision: number, at: string): Promise<void>;
259
+ unlink(proofId: string, userId: string, expectedRevision: number, at: string): Promise<void>;
260
+ }
261
+ export interface IdentityCustodyStoresV1 {
262
+ readonly subjects: IdentitySubjectLifecyclePortV1;
263
+ readonly profiles: IdentityAccountProfileStoreV1;
264
+ readonly credentials: WebAuthnCredentialStoreV1;
265
+ readonly singleUseProofs: SingleUseProofStoreV1;
266
+ readonly emailTickets: EmailRegistrationTicketStoreV1;
267
+ readonly invitations: DigestInvitationStoreV1;
268
+ readonly sessions: BoundLoginSessionStoreV1;
269
+ readonly social: SocialIdentityStoreV1;
270
+ }
271
+ export interface IdentityDigestPortV1 {
272
+ sha256(value: Uint8Array): Promise<IdentitySha256HexV1>;
273
+ hmacSha256(keyRef: string, value: Uint8Array): Promise<IdentitySha256HexV1>;
274
+ equal(left: Uint8Array, right: Uint8Array): boolean;
275
+ }
276
+ export interface IdentityEmailCodeKeyRingV1 {
277
+ readonly issuance: 'hmac-sha256' | 'sha256';
278
+ readonly activeKeyRef: string | null;
279
+ readonly previousKeyRefs: readonly string[];
280
+ }
281
+ export interface IdentityEmailCodeKeyRingPortV1 {
282
+ snapshot(): Promise<IdentityEmailCodeKeyRingV1>;
283
+ }
284
+ export interface IdentityEmailTicketClaimsV1 {
285
+ readonly codeProofId: string;
286
+ readonly email: string;
287
+ readonly issuedAt: string;
288
+ readonly expiresAt: string;
289
+ }
290
+ export interface IdentityEmailTicketTokenPortV1 {
291
+ sign(claims: IdentityEmailTicketClaimsV1): Promise<string>;
292
+ verify(token: Uint8Array, now: string): Promise<IdentityEmailTicketClaimsV1>;
293
+ verifyForImport(token: Uint8Array): Promise<IdentityEmailTicketClaimsV1>;
294
+ }
295
+ export type VerifiedLoginClaimsV1 = {
296
+ readonly userId: string;
297
+ readonly sessionId: string;
298
+ readonly expiresAt: string;
299
+ } & ({
300
+ readonly tokenUse: 'session';
301
+ readonly login: SignedLoginBindingV1 | null;
302
+ } | {
303
+ readonly tokenUse: 'refresh';
304
+ readonly login: SignedLoginBindingV1;
305
+ });
306
+ export interface IdentityLoginVerifierPortV1 {
307
+ verify(token: Uint8Array, expectedUse: 'session' | 'refresh', now: string): Promise<VerifiedLoginClaimsV1>;
308
+ }
309
+ export interface IdentityLoginTokenPortV1 extends IdentityLoginVerifierPortV1 {
310
+ sign(input: {
311
+ readonly userId: string;
312
+ readonly sessionId: string;
313
+ readonly tokenUse: 'session' | 'refresh';
314
+ readonly role: import('./types.js').GlobalRole;
315
+ readonly login: SignedLoginBindingV1;
316
+ readonly expiresAt: string;
317
+ }): Promise<string>;
318
+ }
319
+ export interface IdentityHostRunOptionsV1 {
320
+ readonly readOnly: boolean;
321
+ readonly deadlineMs: number;
322
+ }
323
+ export interface IdentityRunOptionsV1 {
324
+ readonly mode: 'read' | 'write';
325
+ readonly purpose: 'request' | 'import' | 'delete' | 'delivery';
326
+ readonly deadlineMs: number;
327
+ readonly maxAttempts: 1 | 2 | 3;
328
+ }
329
+ export interface IdentityTransactionV1<H> {
330
+ readonly profile: IdentityStorageProfileV1;
331
+ readonly transactionId: string;
332
+ readonly mode: 'read' | 'write';
333
+ readonly hostTransaction: H;
334
+ readonly stores: IdentityStores;
335
+ readonly custody: IdentityCustodyStoresV1;
336
+ readonly conversations: ConversationAuthorityStore;
337
+ readonly ledger: IdentityLedgerStore;
338
+ readonly cleanup: PersonOrphanCleanupPortV1;
339
+ readonly deletionJournal: IdentityDeletionJournalPortV2;
340
+ readonly revocationOutbox: IdentityRevocationOutboxPortV1;
341
+ lockSubject(userId: string): Promise<void>;
342
+ lockWorkspace(workspaceId: string): Promise<void>;
343
+ lockEmail(email: string): Promise<void>;
344
+ advanceSubjectRevision(userId: string, at: string, retire: boolean): Promise<void>;
345
+ }
346
+ export interface IdentityUnitOfWorkV1<H> {
347
+ readonly profile: IdentityStorageProfileV1;
348
+ run<T>(options: IdentityRunOptionsV1, operation: (tx: IdentityTransactionV1<H>) => Promise<T>): Promise<T>;
349
+ }
350
+ export type IdentityImportRowV1 = {
351
+ readonly entity: 'service_client';
352
+ readonly record: import('./types.js').ServiceClientBinding;
353
+ } | {
354
+ readonly entity: 'account';
355
+ readonly record: import('./types.js').UserAccount;
356
+ readonly profile: IdentityAccountProfileV1;
357
+ } | {
358
+ readonly entity: 'oauth_consent';
359
+ readonly record: import('./types.js').OAuthConsentRecord;
360
+ } | {
361
+ readonly entity: 'credential';
362
+ readonly record: WebAuthnCredentialV1;
363
+ } | {
364
+ readonly entity: 'single_use_proof';
365
+ readonly record: SingleUseProofV1;
366
+ } | {
367
+ readonly entity: 'email_ticket';
368
+ readonly record: EmailRegistrationTicketV1;
369
+ } | {
370
+ readonly entity: 'invitation';
371
+ readonly record: DigestInvitationV1;
372
+ } | {
373
+ readonly entity: 'login_session';
374
+ readonly record: BoundLoginSessionV1;
375
+ } | {
376
+ readonly entity: 'social_link';
377
+ readonly record: SocialIdentityV1;
378
+ } | {
379
+ readonly entity: 'tenant';
380
+ readonly record: import('./types.js').TenantRecord;
381
+ } | {
382
+ readonly entity: 'tenant_membership';
383
+ readonly record: import('./types.js').TenantMembershipRecord;
384
+ } | {
385
+ readonly entity: 'workspace';
386
+ readonly record: import('./types.js').WorkspaceRecord;
387
+ } | {
388
+ readonly entity: 'workspace_membership';
389
+ readonly record: import('./types.js').WorkspaceMembershipRecord;
390
+ } | {
391
+ readonly entity: 'revocation_delivery';
392
+ readonly record: IdentityExternalRevocationV1;
393
+ } | {
394
+ readonly entity: 'legacy_connector_tombstone';
395
+ readonly record: IdentityLegacyConnectorTombstoneV1;
396
+ };
397
+ export interface IdentityImportBatchV1 {
398
+ readonly legacyConnectorSourceEventIds: readonly string[];
399
+ readonly contractVersion: '1.1.0';
400
+ readonly migrationId: string;
401
+ readonly sourceSnapshotRef: string;
402
+ readonly sourceSnapshotDigest: string;
403
+ readonly manifestDigest: string;
404
+ readonly importedAt: string;
405
+ readonly rows: readonly IdentityImportRowV1[];
406
+ }
407
+ export interface IdentityImportIssueReferenceV1 {
408
+ readonly rowIndex: number;
409
+ readonly safeIdentity?: readonly string[];
410
+ }
411
+ export interface IdentityImportValidationV1 {
412
+ readonly valid: boolean;
413
+ readonly issues: readonly {
414
+ readonly entity: IdentityImportRowV1['entity'];
415
+ readonly code: 'identity_import_conflict' | 'identity_import_invalid';
416
+ readonly count: number;
417
+ readonly references: readonly IdentityImportIssueReferenceV1[];
418
+ }[];
419
+ }
420
+ export interface IdentityImportReceiptV1 {
421
+ readonly contractVersion: '1.1.0';
422
+ readonly migrationId: string;
423
+ readonly sourceSnapshotRef: string;
424
+ readonly sourceSnapshotDigest: string;
425
+ readonly manifestDigest: string;
426
+ readonly importedAt: string;
427
+ readonly counts: Readonly<Record<IdentityImportRowV1['entity'], number>>;
428
+ readonly legacyConnectorTombstones: {
429
+ readonly queued: number;
430
+ readonly unresolved: number;
431
+ readonly acknowledged: number;
432
+ };
433
+ readonly identitiesPreserved: true;
434
+ readonly verificationMaterialPreserved: true;
435
+ readonly lifecyclePreserved: true;
436
+ }
437
+ export interface IdentityImportFencePortV1 {
438
+ assertExclusiveWriter(sourceSnapshotRef: string): Promise<void>;
439
+ }
440
+ export interface IdentityCustodyImportPortV1<H> {
441
+ validate(batch: IdentityImportBatchV1): Promise<IdentityImportValidationV1>;
442
+ importBatch(batch: IdentityImportBatchV1): Promise<IdentityImportReceiptV1>;
443
+ importBatchInTransaction(batch: IdentityImportBatchV1, tx: IdentityTransactionV1<H>): Promise<IdentityImportReceiptV1>;
444
+ }
445
+ export interface IdentityCustodyImporterInput<H> {
446
+ readonly connectorCustody: ConnectorRevocationCustodyPortV1<H> | null;
447
+ readonly unitOfWork: IdentityUnitOfWorkV1<H>;
448
+ readonly fence: IdentityImportFencePortV1;
449
+ readonly importOptions: IdentityRunOptionsV1;
450
+ readonly validationOptions: IdentityRunOptionsV1;
451
+ }
452
+ export type BusinessDeletionHandlerIdV1 = 'self_account' | 'admin_account';
453
+ export interface BusinessDeletionPlanV1 {
454
+ readonly userId: string;
455
+ readonly workspaceIdsToDelete: readonly string[];
456
+ readonly retainedWorkspaceIds: readonly string[];
457
+ }
458
+ export interface BusinessDeletionReceiptV1 {
459
+ readonly handlerId: BusinessDeletionHandlerIdV1;
460
+ readonly deletedRows: Readonly<Record<string, number>>;
461
+ }
462
+ /** Business participant bound to the exact active host transaction. */
463
+ export interface BusinessDeletionPortV1<H> {
464
+ readonly handlerId: BusinessDeletionHandlerIdV1;
465
+ prepare(command: PersonDeletionCommandV2, tx: IdentityTransactionV1<H>): Promise<BusinessDeletionPlanV1>;
466
+ deleteRows(plan: BusinessDeletionPlanV1, tx: IdentityTransactionV1<H>): Promise<BusinessDeletionReceiptV1>;
467
+ assertNoOrphans(plan: BusinessDeletionPlanV1, tx: IdentityTransactionV1<H>): Promise<void>;
468
+ }
469
+ export type AtomicRevocationStepOutcomeV2 = 'applied' | 'rolled_back' | 'queued' | 'not_applicable';
470
+ export interface AtomicRevocationStepReceiptV2 {
471
+ readonly step: import('./types.js').RevocationStepKind;
472
+ readonly outcome: AtomicRevocationStepOutcomeV2;
473
+ readonly detailCode: AtomicRevocationDetailV2;
474
+ }
475
+ export interface PersonDeletionCommandV2 {
476
+ readonly userId: string;
477
+ readonly actorId: string;
478
+ readonly handlerId: BusinessDeletionHandlerIdV1;
479
+ readonly operationId: string;
480
+ }
481
+ export interface PersonDeletionReceiptV2 {
482
+ readonly contractVersion: '2.0.0';
483
+ readonly operationId: string;
484
+ readonly deliveryIds: readonly string[];
485
+ readonly userId: string;
486
+ readonly mode: 'delete';
487
+ readonly transaction: 'committed' | 'rolled_back';
488
+ readonly resultCode: 'identity_deleted' | 'identity_cascade_rolled_back';
489
+ readonly complete: boolean;
490
+ readonly steps: readonly AtomicRevocationStepReceiptV2[];
491
+ readonly business: BusinessDeletionReceiptV1 | null;
492
+ readonly cleanup: IdentityCleanupReceiptV1 | null;
493
+ readonly at: string;
494
+ }
495
+ export interface IdentityDeletionOperationV2 {
496
+ readonly committedReceipt: PersonDeletionReceiptV2 | null;
497
+ readonly operationId: string;
498
+ readonly userId: string;
499
+ readonly actorId: string;
500
+ readonly handlerId: BusinessDeletionHandlerIdV1;
501
+ readonly requestDigest: string;
502
+ readonly state: 'queued' | 'committed';
503
+ readonly createdAt: string;
504
+ readonly committedAt: string | null;
505
+ }
506
+ export interface IdentityDeletionAttemptV2 {
507
+ readonly attemptId: string;
508
+ readonly operationId: string;
509
+ readonly at: string;
510
+ readonly receipt: PersonDeletionReceiptV2;
511
+ }
512
+ export interface AtomicPersonDeletionV2 {
513
+ deletePerson(command: PersonDeletionCommandV2): Promise<PersonDeletionReceiptV2>;
514
+ getOperation(operationId: string): Promise<IdentityDeletionOperationV2 | null>;
515
+ getReceipt(operationId: string): Promise<PersonDeletionReceiptV2 | null>;
516
+ }
517
+ export interface AtomicPersonDeletionInput<H> {
518
+ readonly unitOfWork: IdentityUnitOfWorkV1<H>;
519
+ readonly business: BusinessDeletionPortV1<H>;
520
+ readonly clock: import('./types.js').IdentityClock;
521
+ readonly authorization: PersonDeletionAuthorizationPortV1<H>;
522
+ readonly planes: readonly PersonDeletionPlanePortV2<H>[];
523
+ readonly transactionOptions: {
524
+ readonly reservation: IdentityRunOptionsV1;
525
+ readonly deletion: IdentityRunOptionsV1;
526
+ readonly diagnostic: IdentityRunOptionsV1;
527
+ readonly read: IdentityRunOptionsV1;
528
+ };
529
+ }
530
+ export interface IdentityExternalRevocationV1 extends IdentityExternalRevocationDraftV1 {
531
+ readonly deliveryId: string;
532
+ readonly operationId: string;
533
+ readonly state: 'pending' | 'delivered';
534
+ readonly createdAt: string;
535
+ readonly nextAttemptAt: string;
536
+ readonly deliveredAt: string | null;
537
+ readonly claimOwner: string | null;
538
+ readonly claimVersion: number;
539
+ readonly leaseUntil: string | null;
540
+ readonly attemptCount: number;
541
+ }
542
+ export interface IdentityRevocationClaimV1 {
543
+ readonly record: IdentityExternalRevocationV1;
544
+ readonly workerId: string;
545
+ readonly claimVersion: number;
546
+ }
547
+ export interface ConnectorRevocationCustodyReferenceV1 {
548
+ readonly custodyRef: string;
549
+ readonly deliveryId: string;
550
+ readonly connectorAccountId: string;
551
+ readonly provider: string;
552
+ readonly createdAt: string;
553
+ }
554
+ export type ConnectorRevocationCaptureV1 = {
555
+ readonly kind: 'no_capability';
556
+ } | {
557
+ readonly kind: 'captured';
558
+ readonly reference: ConnectorRevocationCustodyReferenceV1;
559
+ };
560
+ export interface ConnectorRevocationCustodyPortV1<H> {
561
+ capture(input: {
562
+ readonly deliveryId: string;
563
+ readonly connectorAccountId: string;
564
+ readonly subjectId: string;
565
+ readonly workspaceIdsToDelete: readonly string[];
566
+ readonly at: string;
567
+ }, tx: IdentityTransactionV1<H>): Promise<ConnectorRevocationCaptureV1>;
568
+ assertCaptured(record: IdentityExternalRevocationV1, tx: IdentityTransactionV1<H>): Promise<void>;
569
+ eraseAcknowledged(record: IdentityExternalRevocationV1, tx: IdentityTransactionV1<H>): Promise<void>;
570
+ }
571
+ export interface AcknowledgeRevocationInput<H> {
572
+ readonly tx: IdentityTransactionV1<H>;
573
+ readonly claim: IdentityRevocationClaimV1;
574
+ readonly at: string;
575
+ readonly connectorCustody: ConnectorRevocationCustodyPortV1<H> | null;
576
+ }
577
+ export interface IdentityLegacyConnectorTombstoneV1 {
578
+ readonly sourceEventId: string;
579
+ readonly connectorAccountId: string;
580
+ readonly provider: string;
581
+ readonly subjectId: string | null;
582
+ readonly disposition: 'queued' | 'unresolved' | 'acknowledged';
583
+ readonly deliveryId: string | null;
584
+ readonly evidenceRef: string | null;
585
+ readonly importedAt: string;
586
+ }
587
+ //# sourceMappingURL=custody.d.ts.map