keri-ts 2.0.1 → 2.2.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 (450) hide show
  1. package/README.md +30 -2
  2. package/esm/keri/npm/src/acdc/authoring.js +195 -0
  3. package/esm/keri/npm/src/acdc/chaining.js +223 -89
  4. package/esm/keri/npm/src/acdc/custody.js +164 -0
  5. package/esm/keri/npm/src/acdc/dhking.js +244 -32
  6. package/esm/keri/npm/src/acdc/observing.js +2 -2
  7. package/esm/keri/npm/src/acdc/regbasing.js +30 -29
  8. package/esm/keri/npm/src/acdc/regengine.js +4 -6
  9. package/esm/keri/npm/src/acdc/registering.js +13 -10
  10. package/esm/keri/npm/src/acdc/registraring.js +4 -9
  11. package/esm/keri/npm/src/acdc/salting.js +143 -26
  12. package/esm/keri/npm/src/acdc/scheming.js +93 -54
  13. package/esm/keri/npm/src/acdc/unblinding.js +120 -99
  14. package/esm/keri/npm/src/app/bootstrap/authenticating.js +4 -6
  15. package/esm/keri/npm/src/app/bootstrap/oobi-resolving.js +41 -0
  16. package/esm/keri/npm/src/app/bootstrap/oobiery.js +5 -7
  17. package/esm/keri/npm/src/app/credentials/credential-revoking.js +1 -0
  18. package/esm/keri/npm/src/app/credentials/credential-workflows.js +2 -0
  19. package/esm/keri/npm/src/app/credentials/registry-settling.js +44 -0
  20. package/esm/keri/npm/src/app/credentials/root-replicating.js +131 -0
  21. package/esm/keri/npm/src/app/credentials/root-replicator.js +198 -0
  22. package/esm/keri/npm/src/app/credentials/tel-completion.js +36 -0
  23. package/esm/keri/npm/src/app/credentials/verifying.js +12 -3
  24. package/esm/keri/npm/src/app/delivery/forwarding.js +64 -9
  25. package/esm/keri/npm/src/app/exchanges/exchanging.js +24 -15
  26. package/esm/keri/npm/src/app/identity/challenging.js +50 -0
  27. package/esm/keri/npm/src/app/identity/configing.js +17 -43
  28. package/esm/keri/npm/src/app/identity/delegating.js +77 -77
  29. package/esm/keri/npm/src/app/identity/delegation-approval.js +333 -0
  30. package/esm/keri/npm/src/app/identity/event-completion.js +154 -0
  31. package/esm/keri/npm/src/app/identity/habbing.js +183 -41
  32. package/esm/keri/npm/src/app/identity/keeping.js +78 -5
  33. package/esm/keri/npm/src/app/identity/lmdb-habery.js +12 -0
  34. package/esm/keri/npm/src/app/ipex/group-ipex.js +327 -0
  35. package/esm/keri/npm/src/app/ipex/group-issuance.js +902 -0
  36. package/esm/keri/npm/src/app/ipex/ipex-admitting.js +120 -0
  37. package/esm/keri/npm/src/app/ipex/ipex-conversation.js +197 -0
  38. package/esm/keri/npm/src/app/ipex/ipex-discloser.js +591 -0
  39. package/esm/keri/npm/src/app/ipex/ipex-granting.js +93 -0
  40. package/esm/keri/npm/src/app/ipex/ipex-graph.js +7 -70
  41. package/esm/keri/npm/src/app/ipex/ipex-grouping.js +42 -16
  42. package/esm/keri/npm/src/app/ipex/ipex-v2.js +21 -5
  43. package/esm/keri/npm/src/app/ipex/ipexing.js +1 -1
  44. package/esm/keri/npm/src/app/ipex/issuance.js +888 -0
  45. package/esm/keri/npm/src/app/ipex/pending-presentations.js +46 -0
  46. package/esm/keri/npm/src/app/ipex/presentation-files.js +200 -0
  47. package/esm/keri/npm/src/app/ipex/presenting.js +401 -0
  48. package/esm/keri/npm/src/app/ipex/receive-issuance.js +86 -0
  49. package/esm/keri/npm/src/app/ipex/unblinding-workflow.js +660 -0
  50. package/esm/keri/npm/src/app/mailbox/ipex-arrival.js +103 -0
  51. package/esm/keri/npm/src/app/mailbox/kel-publisher.js +322 -0
  52. package/esm/keri/npm/src/app/mailbox/kel-publishing.js +65 -0
  53. package/esm/keri/npm/src/app/mailbox/kel-submission.js +24 -0
  54. package/esm/keri/npm/src/app/mailbox/mailbox-admin.js +208 -0
  55. package/esm/keri/npm/src/app/mailbox/mailbox-poller.js +212 -47
  56. package/esm/keri/npm/src/app/mailbox/mailboxing.js +15 -14
  57. package/esm/keri/npm/src/app/multisig/counseling.js +482 -0
  58. package/esm/keri/npm/src/app/multisig/group-members.js +32 -0
  59. package/esm/keri/npm/src/app/multisig/grouping.js +4 -3
  60. package/esm/keri/npm/src/app/multisig/multisig-workflows.js +101 -141
  61. package/esm/keri/npm/src/app/multisig/proposals.js +281 -0
  62. package/esm/keri/npm/src/app/multisig/proposing.js +122 -0
  63. package/esm/keri/npm/src/app/notifications/notifying.js +5 -9
  64. package/esm/keri/npm/src/app/notifications/signaling.js +5 -5
  65. package/esm/keri/npm/src/app/protocol/parsering.js +26 -1
  66. package/esm/keri/npm/src/app/protocol/protocol-processing.js +44 -6
  67. package/esm/keri/npm/src/app/queries/query-workflows.js +98 -0
  68. package/esm/keri/npm/src/app/queries/witness-inquisitor.js +2 -2
  69. package/esm/keri/npm/src/app/runtime/agent-runtime.js +113 -65
  70. package/esm/keri/npm/src/app/runtime/cue-runtime.js +3 -6
  71. package/esm/keri/npm/src/app/runtime/delivery-outbox.js +87 -0
  72. package/esm/keri/npm/src/app/runtime/doing.js +17 -0
  73. package/esm/keri/npm/src/app/runtime/ipex-auxiliaries.js +207 -0
  74. package/esm/keri/npm/src/app/runtime/operation-owners.js +151 -0
  75. package/esm/keri/npm/src/app/runtime/retry-backoff.js +93 -0
  76. package/esm/keri/npm/src/app/runtime/workflow-contract.js +80 -0
  77. package/esm/keri/npm/src/app/transport/byte-source.js +6 -42
  78. package/esm/keri/npm/src/app/transport/cesr-egress.js +77 -13
  79. package/esm/keri/npm/src/app/transport/file-bytes.js +41 -0
  80. package/esm/keri/npm/src/app/transport/http-client.js +25 -6
  81. package/esm/keri/npm/src/app/transport/http-messenger.js +14 -9
  82. package/esm/keri/npm/src/app/transport/message-source.js +1 -1
  83. package/esm/keri/npm/src/app/transport/messengering.js +3 -4
  84. package/esm/keri/npm/src/app/transport/node-http-client.js +21 -0
  85. package/esm/keri/npm/src/app/transport/tcp-dialer.js +14 -0
  86. package/esm/keri/npm/src/app/witness/http-endpoints.js +4 -4
  87. package/esm/keri/npm/src/app/witness/receipt-client.js +2 -2
  88. package/esm/keri/npm/src/cli/common/context.js +2 -2
  89. package/esm/keri/npm/src/cli/common/event-completion.js +49 -0
  90. package/esm/keri/npm/src/cli/common/existing.js +3 -5
  91. package/esm/keri/npm/src/cli/common/runtime-workers.js +23 -0
  92. package/esm/keri/npm/src/cli/credentials/ipex.js +159 -191
  93. package/esm/keri/npm/src/cli/credentials/vc.js +53 -72
  94. package/esm/keri/npm/src/cli/endpoints/did.js +12 -3
  95. package/esm/keri/npm/src/cli/endpoints/oobi-clean.js +4 -3
  96. package/esm/keri/npm/src/cli/endpoints/oobi.js +12 -15
  97. package/esm/keri/npm/src/cli/identity/challenge.js +9 -35
  98. package/esm/keri/npm/src/cli/identity/delegate.js +81 -258
  99. package/esm/keri/npm/src/cli/identity/incept.js +17 -34
  100. package/esm/keri/npm/src/cli/identity/init.js +4 -3
  101. package/esm/keri/npm/src/cli/identity/interact.js +7 -19
  102. package/esm/keri/npm/src/cli/identity/rotate.js +10 -38
  103. package/esm/keri/npm/src/cli/index.js +3 -1
  104. package/esm/keri/npm/src/cli/messaging/exchange.js +2 -2
  105. package/esm/keri/npm/src/cli/messaging/group-join.js +79 -0
  106. package/esm/keri/npm/src/cli/messaging/group-wait.js +88 -0
  107. package/esm/keri/npm/src/cli/messaging/multisig.js +187 -250
  108. package/esm/keri/npm/src/cli/messaging/root-copy-lines.js +31 -0
  109. package/esm/keri/npm/src/cli/tools/annotate.js +2 -1
  110. package/esm/keri/npm/src/cli/tools/benchmark.js +2 -1
  111. package/esm/keri/npm/src/cli/tools/db-dump.js +1 -4
  112. package/esm/keri/npm/src/core/bytes.js +9 -0
  113. package/esm/keri/npm/src/core/kel/delegation-ancestry.js +92 -0
  114. package/esm/keri/npm/src/core/kel/eventing.js +67 -12
  115. package/esm/keri/npm/src/core/kel/kever.js +11 -9
  116. package/esm/keri/npm/src/core/mailbox/kram-policy.js +41 -9
  117. package/esm/keri/npm/src/core/mailbox/kram-pruning.js +15 -22
  118. package/esm/keri/npm/src/core/mailbox/kram-staging.js +2 -2
  119. package/esm/keri/npm/src/core/mailbox/kraming.js +2 -0
  120. package/esm/keri/npm/src/core/records.js +23 -0
  121. package/esm/keri/npm/src/core/routing.js +15 -2
  122. package/esm/keri/npm/src/db/basing.js +183 -205
  123. package/esm/keri/npm/src/db/core/dber.js +1062 -0
  124. package/esm/keri/npm/src/db/core/index.js +4 -2
  125. package/esm/keri/npm/src/db/core/indexeddb-persistence.js +221 -0
  126. package/esm/keri/npm/src/db/core/lmdb-opener.js +30 -0
  127. package/esm/keri/npm/src/db/core/lmdber.js +199 -1067
  128. package/esm/keri/npm/src/db/core/memstore.js +532 -0
  129. package/esm/keri/npm/src/db/core/path-manager.js +109 -223
  130. package/esm/keri/npm/src/db/core/store-owner.js +104 -0
  131. package/esm/keri/npm/src/db/core/webdber.js +252 -0
  132. package/esm/keri/npm/src/db/escrowing.js +2 -2
  133. package/esm/keri/npm/src/db/exchange/exchange-nests.js +3 -2
  134. package/esm/keri/npm/src/db/indexeddb.js +98 -0
  135. package/esm/keri/npm/src/db/keeping.js +38 -123
  136. package/esm/keri/npm/src/db/koming.js +1 -1
  137. package/esm/keri/npm/src/db/lmdb-stores.js +68 -0
  138. package/esm/keri/npm/src/db/lmdb.js +6 -0
  139. package/esm/keri/npm/src/db/mailbox/mailboxing.js +12 -65
  140. package/esm/keri/npm/src/db/noting.js +11 -55
  141. package/esm/keri/npm/src/db/reger.js +43 -105
  142. package/esm/keri/npm/src/db/replay/witness-replay.js +2 -20
  143. package/esm/keri/npm/src/db/store-lock.js +150 -0
  144. package/esm/keri/npm/src/db/subing.js +1 -1
  145. package/esm/keri/npm/src/npm/db-indexeddb.browser.js +2 -0
  146. package/esm/keri/npm/src/npm/db-indexeddb.js +3 -0
  147. package/esm/keri/npm/src/npm/db-lmdb.js +3 -0
  148. package/esm/keri/npm/src/npm/db.browser.js +2 -0
  149. package/esm/keri/npm/src/npm/index.browser.js +9 -0
  150. package/esm/keri/npm/src/npm/runtime-node.js +3 -0
  151. package/esm/keri/npm/src/npm/runtime-web.browser.js +2 -0
  152. package/esm/keri/npm/src/npm/runtime-web.js +3 -0
  153. package/esm/keri/npm/src/npm/runtime.browser.js +2 -0
  154. package/esm/keri/npm/src/runtime/index.js +58 -12
  155. package/esm/keri/npm/src/runtime/node.js +14 -0
  156. package/esm/keri/npm/src/runtime/web/output-barrier.js +47 -0
  157. package/esm/keri/npm/src/runtime/web/persistent-storage.js +37 -0
  158. package/esm/keri/npm/src/runtime/web.js +10 -0
  159. package/esm/keri/npm/src/vdr/eventing.js +1 -1
  160. package/esm/keri/npm/src/vdr/tel-publication.js +19 -3
  161. package/esm/keri/npm/src/version.js +2 -2
  162. package/package.json +24 -4
  163. package/types/acdc/authoring.d.ts +54 -0
  164. package/types/acdc/authoring.d.ts.map +1 -0
  165. package/types/acdc/chaining.d.ts +56 -6
  166. package/types/acdc/chaining.d.ts.map +1 -1
  167. package/types/acdc/custody.d.ts +77 -0
  168. package/types/acdc/custody.d.ts.map +1 -0
  169. package/types/acdc/dhking.d.ts +94 -3
  170. package/types/acdc/dhking.d.ts.map +1 -1
  171. package/types/acdc/regbasing.d.ts +11 -6
  172. package/types/acdc/regbasing.d.ts.map +1 -1
  173. package/types/acdc/regengine.d.ts.map +1 -1
  174. package/types/acdc/registering.d.ts +8 -4
  175. package/types/acdc/registering.d.ts.map +1 -1
  176. package/types/acdc/registraring.d.ts.map +1 -1
  177. package/types/acdc/salting.d.ts +59 -7
  178. package/types/acdc/salting.d.ts.map +1 -1
  179. package/types/acdc/scheming.d.ts +2 -0
  180. package/types/acdc/scheming.d.ts.map +1 -1
  181. package/types/acdc/unblinding.d.ts +58 -19
  182. package/types/acdc/unblinding.d.ts.map +1 -1
  183. package/types/app/bootstrap/authenticating.d.ts +3 -1
  184. package/types/app/bootstrap/authenticating.d.ts.map +1 -1
  185. package/types/app/bootstrap/oobi-resolving.d.ts +92 -0
  186. package/types/app/bootstrap/oobi-resolving.d.ts.map +1 -0
  187. package/types/app/bootstrap/oobiery.d.ts +3 -1
  188. package/types/app/bootstrap/oobiery.d.ts.map +1 -1
  189. package/types/app/credentials/credential-revoking.d.ts +3 -0
  190. package/types/app/credentials/credential-revoking.d.ts.map +1 -1
  191. package/types/app/credentials/credential-workflows.d.ts +5 -0
  192. package/types/app/credentials/credential-workflows.d.ts.map +1 -1
  193. package/types/app/credentials/registry-settling.d.ts +85 -0
  194. package/types/app/credentials/registry-settling.d.ts.map +1 -0
  195. package/types/app/credentials/root-replicating.d.ts +97 -0
  196. package/types/app/credentials/root-replicating.d.ts.map +1 -0
  197. package/types/app/credentials/root-replicator.d.ts +105 -0
  198. package/types/app/credentials/root-replicator.d.ts.map +1 -0
  199. package/types/app/credentials/tel-completion.d.ts +55 -0
  200. package/types/app/credentials/tel-completion.d.ts.map +1 -0
  201. package/types/app/credentials/verifying.d.ts +2 -1
  202. package/types/app/credentials/verifying.d.ts.map +1 -1
  203. package/types/app/delivery/forwarding.d.ts +16 -0
  204. package/types/app/delivery/forwarding.d.ts.map +1 -1
  205. package/types/app/exchanges/exchanging.d.ts +2 -0
  206. package/types/app/exchanges/exchanging.d.ts.map +1 -1
  207. package/types/app/identity/challenging.d.ts +54 -0
  208. package/types/app/identity/challenging.d.ts.map +1 -1
  209. package/types/app/identity/configing.d.ts +7 -5
  210. package/types/app/identity/configing.d.ts.map +1 -1
  211. package/types/app/identity/delegating.d.ts +21 -4
  212. package/types/app/identity/delegating.d.ts.map +1 -1
  213. package/types/app/identity/delegation-approval.d.ts +228 -0
  214. package/types/app/identity/delegation-approval.d.ts.map +1 -0
  215. package/types/app/identity/event-completion.d.ts +151 -0
  216. package/types/app/identity/event-completion.d.ts.map +1 -0
  217. package/types/app/identity/habbing.d.ts +90 -7
  218. package/types/app/identity/habbing.d.ts.map +1 -1
  219. package/types/app/identity/keeping.d.ts +50 -4
  220. package/types/app/identity/keeping.d.ts.map +1 -1
  221. package/types/app/identity/lmdb-habery.d.ts +6 -0
  222. package/types/app/identity/lmdb-habery.d.ts.map +1 -0
  223. package/types/app/ipex/group-ipex.d.ts +247 -0
  224. package/types/app/ipex/group-ipex.d.ts.map +1 -0
  225. package/types/app/ipex/group-issuance.d.ts +281 -0
  226. package/types/app/ipex/group-issuance.d.ts.map +1 -0
  227. package/types/app/ipex/ipex-admitting.d.ts +47 -0
  228. package/types/app/ipex/ipex-admitting.d.ts.map +1 -0
  229. package/types/app/ipex/ipex-conversation.d.ts +195 -0
  230. package/types/app/ipex/ipex-conversation.d.ts.map +1 -0
  231. package/types/app/ipex/ipex-discloser.d.ts +156 -0
  232. package/types/app/ipex/ipex-discloser.d.ts.map +1 -0
  233. package/types/app/ipex/ipex-granting.d.ts +145 -0
  234. package/types/app/ipex/ipex-granting.d.ts.map +1 -0
  235. package/types/app/ipex/ipex-graph.d.ts +4 -4
  236. package/types/app/ipex/ipex-graph.d.ts.map +1 -1
  237. package/types/app/ipex/ipex-grouping.d.ts +18 -0
  238. package/types/app/ipex/ipex-grouping.d.ts.map +1 -1
  239. package/types/app/ipex/ipex-v2.d.ts +11 -2
  240. package/types/app/ipex/ipex-v2.d.ts.map +1 -1
  241. package/types/app/ipex/ipexing.d.ts +3 -0
  242. package/types/app/ipex/ipexing.d.ts.map +1 -1
  243. package/types/app/ipex/issuance.d.ts +443 -0
  244. package/types/app/ipex/issuance.d.ts.map +1 -0
  245. package/types/app/ipex/pending-presentations.d.ts +25 -0
  246. package/types/app/ipex/pending-presentations.d.ts.map +1 -0
  247. package/types/app/ipex/presentation-files.d.ts +47 -0
  248. package/types/app/ipex/presentation-files.d.ts.map +1 -0
  249. package/types/app/ipex/presenting.d.ts +298 -0
  250. package/types/app/ipex/presenting.d.ts.map +1 -0
  251. package/types/app/ipex/receive-issuance.d.ts +99 -0
  252. package/types/app/ipex/receive-issuance.d.ts.map +1 -0
  253. package/types/app/ipex/unblinding-workflow.d.ts +255 -0
  254. package/types/app/ipex/unblinding-workflow.d.ts.map +1 -0
  255. package/types/app/mailbox/ipex-arrival.d.ts +104 -0
  256. package/types/app/mailbox/ipex-arrival.d.ts.map +1 -0
  257. package/types/app/mailbox/kel-publisher.d.ts +141 -0
  258. package/types/app/mailbox/kel-publisher.d.ts.map +1 -0
  259. package/types/app/mailbox/kel-publishing.d.ts +70 -0
  260. package/types/app/mailbox/kel-publishing.d.ts.map +1 -0
  261. package/types/app/mailbox/kel-submission.d.ts +18 -0
  262. package/types/app/mailbox/kel-submission.d.ts.map +1 -0
  263. package/types/app/mailbox/mailbox-admin.d.ts +113 -0
  264. package/types/app/mailbox/mailbox-admin.d.ts.map +1 -0
  265. package/types/app/mailbox/mailbox-poller.d.ts +92 -3
  266. package/types/app/mailbox/mailbox-poller.d.ts.map +1 -1
  267. package/types/app/mailbox/mailboxing.d.ts +4 -1
  268. package/types/app/mailbox/mailboxing.d.ts.map +1 -1
  269. package/types/app/multisig/counseling.d.ts +196 -0
  270. package/types/app/multisig/counseling.d.ts.map +1 -0
  271. package/types/app/multisig/group-members.d.ts +20 -0
  272. package/types/app/multisig/group-members.d.ts.map +1 -1
  273. package/types/app/multisig/grouping.d.ts +39 -20
  274. package/types/app/multisig/grouping.d.ts.map +1 -1
  275. package/types/app/multisig/multisig-workflows.d.ts +93 -23
  276. package/types/app/multisig/multisig-workflows.d.ts.map +1 -1
  277. package/types/app/multisig/proposals.d.ts +129 -0
  278. package/types/app/multisig/proposals.d.ts.map +1 -0
  279. package/types/app/multisig/proposing.d.ts +125 -0
  280. package/types/app/multisig/proposing.d.ts.map +1 -0
  281. package/types/app/notifications/notifying.d.ts +1 -1
  282. package/types/app/notifications/notifying.d.ts.map +1 -1
  283. package/types/app/notifications/signaling.d.ts +3 -1
  284. package/types/app/notifications/signaling.d.ts.map +1 -1
  285. package/types/app/protocol/parsering.d.ts +16 -1
  286. package/types/app/protocol/parsering.d.ts.map +1 -1
  287. package/types/app/protocol/protocol-processing.d.ts +9 -1
  288. package/types/app/protocol/protocol-processing.d.ts.map +1 -1
  289. package/types/app/queries/query-workflows.d.ts +98 -0
  290. package/types/app/queries/query-workflows.d.ts.map +1 -0
  291. package/types/app/runtime/agent-runtime.d.ts +79 -25
  292. package/types/app/runtime/agent-runtime.d.ts.map +1 -1
  293. package/types/app/runtime/cue-runtime.d.ts +2 -1
  294. package/types/app/runtime/cue-runtime.d.ts.map +1 -1
  295. package/types/app/runtime/delivery-outbox.d.ts +68 -0
  296. package/types/app/runtime/delivery-outbox.d.ts.map +1 -0
  297. package/types/app/runtime/doing.d.ts +27 -0
  298. package/types/app/runtime/doing.d.ts.map +1 -0
  299. package/types/app/runtime/ipex-auxiliaries.d.ts +74 -0
  300. package/types/app/runtime/ipex-auxiliaries.d.ts.map +1 -0
  301. package/types/app/runtime/operation-owners.d.ts +137 -0
  302. package/types/app/runtime/operation-owners.d.ts.map +1 -0
  303. package/types/app/runtime/retry-backoff.d.ts +49 -0
  304. package/types/app/runtime/retry-backoff.d.ts.map +1 -0
  305. package/types/app/runtime/workflow-contract.d.ts +79 -0
  306. package/types/app/runtime/workflow-contract.d.ts.map +1 -0
  307. package/types/app/transport/byte-source.d.ts +13 -10
  308. package/types/app/transport/byte-source.d.ts.map +1 -1
  309. package/types/app/transport/cesr-egress.d.ts +21 -7
  310. package/types/app/transport/cesr-egress.d.ts.map +1 -1
  311. package/types/app/transport/file-bytes.d.ts +11 -0
  312. package/types/app/transport/file-bytes.d.ts.map +1 -0
  313. package/types/app/transport/http-client.d.ts +3 -0
  314. package/types/app/transport/http-client.d.ts.map +1 -1
  315. package/types/app/transport/http-messenger.d.ts +15 -10
  316. package/types/app/transport/http-messenger.d.ts.map +1 -1
  317. package/types/app/transport/message-source.d.ts +1 -1
  318. package/types/app/transport/messengering.d.ts +2 -2
  319. package/types/app/transport/messengering.d.ts.map +1 -1
  320. package/types/app/transport/node-http-client.d.ts +10 -0
  321. package/types/app/transport/node-http-client.d.ts.map +1 -0
  322. package/types/app/transport/tcp-dialer.d.ts +21 -0
  323. package/types/app/transport/tcp-dialer.d.ts.map +1 -0
  324. package/types/cli/common/event-completion.d.ts +26 -0
  325. package/types/cli/common/event-completion.d.ts.map +1 -0
  326. package/types/cli/common/existing.d.ts.map +1 -1
  327. package/types/cli/common/runtime-workers.d.ts +23 -0
  328. package/types/cli/common/runtime-workers.d.ts.map +1 -0
  329. package/types/cli/credentials/ipex.d.ts.map +1 -1
  330. package/types/cli/credentials/vc.d.ts +1 -1
  331. package/types/cli/credentials/vc.d.ts.map +1 -1
  332. package/types/cli/endpoints/did.d.ts.map +1 -1
  333. package/types/cli/endpoints/oobi-clean.d.ts.map +1 -1
  334. package/types/cli/endpoints/oobi.d.ts +3 -1
  335. package/types/cli/endpoints/oobi.d.ts.map +1 -1
  336. package/types/cli/identity/challenge.d.ts +1 -1
  337. package/types/cli/identity/challenge.d.ts.map +1 -1
  338. package/types/cli/identity/delegate.d.ts +14 -1
  339. package/types/cli/identity/delegate.d.ts.map +1 -1
  340. package/types/cli/identity/incept.d.ts.map +1 -1
  341. package/types/cli/identity/init.d.ts.map +1 -1
  342. package/types/cli/identity/interact.d.ts.map +1 -1
  343. package/types/cli/identity/rotate.d.ts.map +1 -1
  344. package/types/cli/index.d.ts +4 -2
  345. package/types/cli/index.d.ts.map +1 -1
  346. package/types/cli/messaging/group-join.d.ts +53 -0
  347. package/types/cli/messaging/group-join.d.ts.map +1 -0
  348. package/types/cli/messaging/group-wait.d.ts +34 -0
  349. package/types/cli/messaging/group-wait.d.ts.map +1 -0
  350. package/types/cli/messaging/multisig.d.ts +36 -4
  351. package/types/cli/messaging/multisig.d.ts.map +1 -1
  352. package/types/cli/messaging/root-copy-lines.d.ts +39 -0
  353. package/types/cli/messaging/root-copy-lines.d.ts.map +1 -0
  354. package/types/cli/tools/annotate.d.ts.map +1 -1
  355. package/types/cli/tools/benchmark.d.ts.map +1 -1
  356. package/types/cli/tools/db-dump.d.ts.map +1 -1
  357. package/types/core/bytes.d.ts +2 -0
  358. package/types/core/bytes.d.ts.map +1 -1
  359. package/types/core/cues.d.ts +11 -0
  360. package/types/core/cues.d.ts.map +1 -1
  361. package/types/core/kel/delegation-ancestry.d.ts +41 -0
  362. package/types/core/kel/delegation-ancestry.d.ts.map +1 -0
  363. package/types/core/kel/eventing.d.ts.map +1 -1
  364. package/types/core/kel/kever.d.ts +5 -4
  365. package/types/core/kel/kever.d.ts.map +1 -1
  366. package/types/core/mailbox/kram-policy.d.ts +14 -0
  367. package/types/core/mailbox/kram-policy.d.ts.map +1 -1
  368. package/types/core/mailbox/kram-pruning.d.ts +1 -3
  369. package/types/core/mailbox/kram-pruning.d.ts.map +1 -1
  370. package/types/core/mailbox/kraming.d.ts +1 -1
  371. package/types/core/mailbox/kraming.d.ts.map +1 -1
  372. package/types/core/records.d.ts +61 -0
  373. package/types/core/records.d.ts.map +1 -1
  374. package/types/core/routing.d.ts +6 -0
  375. package/types/core/routing.d.ts.map +1 -1
  376. package/types/db/basing.d.ts +22 -25
  377. package/types/db/basing.d.ts.map +1 -1
  378. package/types/db/core/dber.d.ts +505 -0
  379. package/types/db/core/dber.d.ts.map +1 -0
  380. package/types/db/core/index.d.ts +4 -2
  381. package/types/db/core/index.d.ts.map +1 -1
  382. package/types/db/core/indexeddb-persistence.d.ts +59 -0
  383. package/types/db/core/indexeddb-persistence.d.ts.map +1 -0
  384. package/types/db/core/lmdb-opener.d.ts +17 -0
  385. package/types/db/core/lmdb-opener.d.ts.map +1 -0
  386. package/types/db/core/lmdber.d.ts +60 -383
  387. package/types/db/core/lmdber.d.ts.map +1 -1
  388. package/types/db/core/memstore.d.ts +129 -0
  389. package/types/db/core/memstore.d.ts.map +1 -0
  390. package/types/db/core/path-manager.d.ts +22 -45
  391. package/types/db/core/path-manager.d.ts.map +1 -1
  392. package/types/db/core/store-owner.d.ts +59 -0
  393. package/types/db/core/store-owner.d.ts.map +1 -0
  394. package/types/db/core/webdber.d.ts +127 -0
  395. package/types/db/core/webdber.d.ts.map +1 -0
  396. package/types/db/escrowing.d.ts +3 -3
  397. package/types/db/escrowing.d.ts.map +1 -1
  398. package/types/db/exchange/exchange-nests.d.ts.map +1 -1
  399. package/types/db/indexeddb.d.ts +37 -0
  400. package/types/db/indexeddb.d.ts.map +1 -0
  401. package/types/db/keeping.d.ts +14 -25
  402. package/types/db/keeping.d.ts.map +1 -1
  403. package/types/db/koming.d.ts +7 -8
  404. package/types/db/koming.d.ts.map +1 -1
  405. package/types/db/lmdb-stores.d.ts +45 -0
  406. package/types/db/lmdb-stores.d.ts.map +1 -0
  407. package/types/db/lmdb.d.ts +7 -0
  408. package/types/db/lmdb.d.ts.map +1 -0
  409. package/types/db/mailbox/mailboxing.d.ts +7 -21
  410. package/types/db/mailbox/mailboxing.d.ts.map +1 -1
  411. package/types/db/noting.d.ts +7 -12
  412. package/types/db/noting.d.ts.map +1 -1
  413. package/types/db/reger.d.ts +7 -11
  414. package/types/db/reger.d.ts.map +1 -1
  415. package/types/db/replay/witness-replay.d.ts +0 -2
  416. package/types/db/replay/witness-replay.d.ts.map +1 -1
  417. package/types/db/store-lock.d.ts +72 -0
  418. package/types/db/store-lock.d.ts.map +1 -0
  419. package/types/db/subing.d.ts +24 -25
  420. package/types/db/subing.d.ts.map +1 -1
  421. package/types/npm/db-indexeddb.d.ts +4 -0
  422. package/types/npm/db-indexeddb.d.ts.map +1 -0
  423. package/types/npm/db-lmdb.d.ts +4 -0
  424. package/types/npm/db-lmdb.d.ts.map +1 -0
  425. package/types/npm/runtime-node.d.ts +4 -0
  426. package/types/npm/runtime-node.d.ts.map +1 -0
  427. package/types/npm/runtime-web.d.ts +4 -0
  428. package/types/npm/runtime-web.d.ts.map +1 -0
  429. package/types/runtime/index.d.ts +48 -14
  430. package/types/runtime/index.d.ts.map +1 -1
  431. package/types/runtime/node.d.ts +15 -0
  432. package/types/runtime/node.d.ts.map +1 -0
  433. package/types/runtime/web/output-barrier.d.ts +30 -0
  434. package/types/runtime/web/output-barrier.d.ts.map +1 -0
  435. package/types/runtime/web/persistent-storage.d.ts +36 -0
  436. package/types/runtime/web/persistent-storage.d.ts.map +1 -0
  437. package/types/runtime/web.d.ts +11 -0
  438. package/types/runtime/web.d.ts.map +1 -0
  439. package/types/vdr/tel-publication.d.ts +6 -0
  440. package/types/vdr/tel-publication.d.ts.map +1 -1
  441. package/types/version.d.ts +2 -2
  442. package/esm/keri/npm/src/acdc/relating.js +0 -59
  443. package/esm/keri/npm/src/cli/common/tel-completion.js +0 -24
  444. package/esm/keri/npm/src/db/baser-defaults.js +0 -11
  445. package/types/acdc/relating.d.ts +0 -21
  446. package/types/acdc/relating.d.ts.map +0 -1
  447. package/types/cli/common/tel-completion.d.ts +0 -8
  448. package/types/cli/common/tel-completion.d.ts.map +0 -1
  449. package/types/db/baser-defaults.d.ts +0 -5
  450. package/types/db/baser-defaults.d.ts.map +0 -1
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Output barrier for browser compositions (ADR-0015 durability rule 6).
3
+ *
4
+ * A browser store acknowledges a commit before it is durable, so a response,
5
+ * receipt or query that depends on that commit must not leave the page until
6
+ * the composition's persistence queue has flushed. Otherwise a crash or tab
7
+ * close could leave a peer holding evidence of state this wallet then forgot.
8
+ */
9
+ import { call } from "effection";
10
+ import { AppError } from "../../core/errors.js";
11
+ /** The persistence queue failed, so the request was not sent. The queue's failure is the cause. */
12
+ export class OutputBarrierError extends AppError {
13
+ }
14
+ /**
15
+ * Wrap `inner` so no request, finite or streaming, reaches it before `flushed` resolves.
16
+ *
17
+ * `flushed` is evaluated per request, so each request waits for everything
18
+ * committed before it was made. Pass `() => opener.queue.flushed()` from the
19
+ * composition's `WebStoreOpener`: the queue is shared by every store family, so
20
+ * it covers all commits, which one store's `flushed()` would not.
21
+ *
22
+ * A rejected flush fails the call with `OutputBarrierError` and sends nothing.
23
+ * Cancelling the caller cancels only the wait.
24
+ *
25
+ * The wrapper has no `tcp` dialer: a dialer would be a network path around the
26
+ * barrier, and browsers have none.
27
+ */
28
+ export function barrierHttpClient(inner, flushed) {
29
+ function* barrier() {
30
+ try {
31
+ yield* call(() => flushed());
32
+ }
33
+ catch (error) {
34
+ throw new OutputBarrierError("Persistence did not flush; the request was not sent", { cause: error });
35
+ }
36
+ }
37
+ return {
38
+ *request(url, init) {
39
+ yield* barrier();
40
+ return yield* inner.request(url, init);
41
+ },
42
+ *open(url, init) {
43
+ yield* barrier();
44
+ return yield* inner.open(url, init);
45
+ },
46
+ };
47
+ }
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Persistent-storage request for browser wallets.
3
+ *
4
+ * Keys live only in IndexedDB, and Safari may evict script-writable storage
5
+ * that was not granted persistence, so a wallet should ask and surface a refusal.
6
+ */
7
+ /**
8
+ * Ask the engine to make this origin's storage persistent, then report the outcome.
9
+ * Never throws: an absent API reports `supported: false`, and a failing or
10
+ * refusing one reports `persisted: false`. Call it from a user gesture where the
11
+ * engine requires one.
12
+ *
13
+ * @param storage Defaults to `navigator.storage`.
14
+ */
15
+ export async function requestPersistentStorage(storage = globalThis.navigator?.storage) {
16
+ if (typeof storage?.persist !== "function")
17
+ return { persisted: false, supported: false };
18
+ let persisted = await attempt(() => storage.persisted?.(), false);
19
+ if (!persisted)
20
+ persisted = await attempt(() => storage.persist(), false);
21
+ const estimate = await attempt(() => storage.estimate?.(), undefined);
22
+ return {
23
+ persisted,
24
+ supported: true,
25
+ ...(typeof estimate?.quota === "number" ? { quota: estimate.quota } : {}),
26
+ ...(typeof estimate?.usage === "number" ? { usage: estimate.usage } : {}),
27
+ };
28
+ }
29
+ /** Run one engine call, treating a throw or an absent method as the fallback. */
30
+ async function attempt(fn, fallback) {
31
+ try {
32
+ return (await fn()) ?? fallback;
33
+ }
34
+ catch {
35
+ return fallback;
36
+ }
37
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Browser host surface: the output barrier, single-writer store lock and
3
+ * persistence request that any browser composition needs.
4
+ *
5
+ * Mirrors `keri-ts/runtime/node` for the browser. Nothing here may reach
6
+ * `node:` modules, sockets or the `Deno` global.
7
+ */
8
+ export { acquireStoreLock, StoreLockHeldError, storeLockKey, StoreLockUnsupportedError, } from "../db/store-lock.js";
9
+ export { barrierHttpClient, OutputBarrierError } from "./web/output-barrier.js";
10
+ export { requestPersistentStorage, } from "./web/persistent-storage.js";
@@ -783,7 +783,7 @@ export class Tevery {
783
783
  let publicationFailure;
784
784
  let decision;
785
785
  try {
786
- decision = this.reger.env.transactionSync(() => {
786
+ decision = this.reger.transaction(() => {
787
787
  const serder = args.serder;
788
788
  const ilk = telIlk(serder);
789
789
  const pre = okPre(serder);
@@ -60,7 +60,7 @@ export class TelPublication {
60
60
  }
61
61
  /** Move accepted anchors forward; empty witness/publication cohorts need no I/O. */
62
62
  advance() {
63
- this.reger.env.transactionSync(() => {
63
+ this.reger.transaction(() => {
64
64
  for (const [keys, seal] of [...this.reger.tmse.getTopItemIter()]) {
65
65
  const target = this.target(keys, seal);
66
66
  if (!target || target.said !== keys[2])
@@ -90,7 +90,7 @@ export class TelPublication {
90
90
  if (!this.allReceipts(target))
91
91
  throw new ValidationError("TEL anchor is missing required witness receipts.");
92
92
  const seal = this.seal(target);
93
- this.reger.env.transactionSync(() => {
93
+ this.reger.transaction(() => {
94
94
  this.reger.tede.add(this.keys(target), [seal[0], seal[1], new Saider({ qb64: target.anchorSaid })]);
95
95
  this.reger.tpwe.rem(this.keys(target), seal);
96
96
  });
@@ -108,7 +108,7 @@ export class TelPublication {
108
108
  throw new ValidationError("TEL publication dependencies changed before completion.");
109
109
  }
110
110
  const seal = this.seal(target);
111
- this.reger.env.transactionSync(() => {
111
+ this.reger.transaction(() => {
112
112
  this.reger.ctel.pin(this.keys(target), new Saider({ qb64: target.anchorSaid }));
113
113
  this.reger.tede.rem(this.keys(target), [seal[0], seal[1], new Saider({ qb64: target.anchorSaid })]);
114
114
  });
@@ -117,6 +117,22 @@ export class TelPublication {
117
117
  complete(pre, sn = 0) {
118
118
  return this.reger.ctel.get([pre, ordinal(sn).qb64]) !== null;
119
119
  }
120
+ /**
121
+ * Durable progress of one TEL event, read without side effects: waiting for the
122
+ * issuer's accepted anchor (`tmse.`), for the anchoring event's witness receipts
123
+ * (`tpwe.`), for local publication (`tede.`), complete (`ctel.`), or untracked.
124
+ */
125
+ progress(pre, sn = 0) {
126
+ if (this.complete(pre, sn))
127
+ return "complete";
128
+ const coordinates = [pre, ordinal(sn).qb64];
129
+ if (this.reger.tede.get(coordinates).length > 0)
130
+ return "awaitingPublication";
131
+ if (this.reger.tpwe.get(coordinates).length > 0)
132
+ return "awaitingReceipts";
133
+ const waiting = [...this.reger.tmse.getTopItemIter()].some(([keys]) => keys[0] === pre && keys[1] === coordinates[1]);
134
+ return waiting ? "awaitingAnchor" : null;
135
+ }
120
136
  /** Reverify by unique roster index; multiple signatures from one witness never fill another's slot. */
121
137
  allReceipts(target) {
122
138
  const current = this.target(this.keys(target), this.seal(target));
@@ -6,9 +6,9 @@
6
6
  * `src/version.ts` files by hand; edit this template instead.
7
7
  */
8
8
  /** Package semantic version copied from the owning package manifest. */
9
- export const PACKAGE_VERSION = "2.0.1";
9
+ export const PACKAGE_VERSION = "2.2.0";
10
10
  /** Optional build metadata stamp injected by release/CI workflows. */
11
- export const BUILD_METADATA = "build.28.a12ad3cd8a7ed98328dc17124bfc8146c4a97b7e";
11
+ export const BUILD_METADATA = "build.30.f1b0e618d5d1dd02f57fc0b4b3447acfe0535799";
12
12
  /** User-facing version string with build metadata appended when present. */
13
13
  export const DISPLAY_VERSION = BUILD_METADATA
14
14
  ? `${PACKAGE_VERSION}+${BUILD_METADATA}`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keri-ts",
3
- "version": "2.0.1",
3
+ "version": "2.2.0",
4
4
  "description": "KERI TypeScript protocol and runtime library",
5
5
  "homepage": "https://github.com/kentbull/keri-ts",
6
6
  "repository": {
@@ -17,6 +17,7 @@
17
17
  "types": "./types/npm/index.d.ts",
18
18
  "exports": {
19
19
  ".": {
20
+ "browser": "./esm/keri/npm/src/npm/index.browser.js",
20
21
  "import": "./esm/keri/npm/src/npm/index.js",
21
22
  "types": "./types/npm/index.d.ts"
22
23
  },
@@ -25,12 +26,32 @@
25
26
  "types": "./types/npm/cli.d.ts"
26
27
  },
27
28
  "./runtime": {
29
+ "browser": "./esm/keri/npm/src/npm/runtime.browser.js",
28
30
  "import": "./esm/keri/npm/src/npm/runtime.js",
29
31
  "types": "./types/npm/runtime.d.ts"
30
32
  },
33
+ "./runtime/node": {
34
+ "import": "./esm/keri/npm/src/npm/runtime-node.js",
35
+ "types": "./types/npm/runtime-node.d.ts"
36
+ },
37
+ "./runtime/web": {
38
+ "browser": "./esm/keri/npm/src/npm/runtime-web.browser.js",
39
+ "import": "./esm/keri/npm/src/npm/runtime-web.js",
40
+ "types": "./types/npm/runtime-web.d.ts"
41
+ },
31
42
  "./db": {
43
+ "browser": "./esm/keri/npm/src/npm/db.browser.js",
32
44
  "import": "./esm/keri/npm/src/npm/db.js",
33
45
  "types": "./types/npm/db.d.ts"
46
+ },
47
+ "./db/lmdb": {
48
+ "import": "./esm/keri/npm/src/npm/db-lmdb.js",
49
+ "types": "./types/npm/db-lmdb.d.ts"
50
+ },
51
+ "./db/indexeddb": {
52
+ "browser": "./esm/keri/npm/src/npm/db-indexeddb.browser.js",
53
+ "import": "./esm/keri/npm/src/npm/db-indexeddb.js",
54
+ "types": "./types/npm/db-indexeddb.d.ts"
34
55
  }
35
56
  },
36
57
  "scripts": {
@@ -55,12 +76,11 @@
55
76
  "@inquirer/password": "3.0.1",
56
77
  "@noble/hashes": "1.8.0",
57
78
  "ajv": "8.18.0",
58
- "cesr-ts": ">=2.0.0 <2.1.0",
79
+ "cesr-ts": ">=2.2.0 <2.3.0",
59
80
  "effection": "^3.6.0",
60
81
  "lmdb": "3.5.3",
61
82
  "@msgpack/msgpack": "3.1.3",
62
- "cbor-x": "1.6.0",
63
- "libsodium-wrappers-sumo": "0.8.4"
83
+ "cbor-x": "1.6.0"
64
84
  },
65
85
  "_generatedBy": "dnt@dev"
66
86
  }
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Finite ACDC v2 registry authoring: stage, anchor and update protocol cores.
3
+ *
4
+ * Existing engines own acceptance and receipt authentication; this class only
5
+ * sequences them for one local individual issuer. It reads and writes no
6
+ * credential inventory: embedders that keep issued or held records wrap it
7
+ * (the wallet's `WalletAuthor` adds `issue` and `revoke`). Private derivation
8
+ * requires a `RegistryCustody`, whose coordinate store the embedder supplies.
9
+ */
10
+ import { type SerderACDC } from "cesr-ts";
11
+ import type { Operation } from "effection";
12
+ import type { Receiptor, WitnessAuthMap } from "../app/witness/receipting.js";
13
+ import type { RegistryCustody } from "./custody.js";
14
+ import { type AcdcMapOptions } from "./messaging.js";
15
+ import { type RegistryDisclosure } from "./regeventing.js";
16
+ import type { Regery, Registry } from "./registraring.js";
17
+ /** Public means deliberate opening publication; private derivation requires supplied custody. */
18
+ export interface AcdcV2UpdateOptions {
19
+ public?: boolean;
20
+ stamp?: string;
21
+ boundEvent?: string;
22
+ /** Transient witness codes for this operation; never retained with registry evidence. */
23
+ auths?: WitnessAuthMap;
24
+ }
25
+ /** Borrow the actual registry environment and receipt collector; acquire no handles or workers. */
26
+ export declare class RegistryAuthor {
27
+ readonly rgy: Regery;
28
+ readonly receiptor: Receiptor;
29
+ readonly custody?: RegistryCustody | undefined;
30
+ constructor(rgy: Regery, receiptor: Receiptor, custody?: RegistryCustody | undefined);
31
+ /** Resolve the actual local registry; staging supports groups while signing methods enforce their owner. */
32
+ registry(name: string, controller: string): Registry;
33
+ /** Signing belongs either to this individual owner or to explicit group approval, never a staging flag. */
34
+ protected individual(reg: Registry): void;
35
+ /** Idempotently stage an alias, then return only its exact accepted inception. */
36
+ incept(name: string, controller: string, auths?: WitnessAuthMap): Operation<SerderACDC>;
37
+ /** Construct the issuer's credential using the existing ACDC v2 finite builder. */
38
+ create(reg: Registry, options: Omit<AcdcMapOptions, "regid">): SerderACDC;
39
+ /** Stage one BUP state advance, preserving an exact pending retry and its opening. Never author historical upd. */
40
+ stage(reg: Registry, acdc: SerderACDC, state: string, options?: AcdcV2UpdateOptions): {
41
+ event: SerderACDC;
42
+ opening: RegistryDisclosure;
43
+ };
44
+ /** Share validation and exact pending-next reuse; only the concrete revocation ensure operation can reuse an accepted head. */
45
+ protected stageState(reg: Registry, acdc: SerderACDC, state: string, options: AcdcV2UpdateOptions, ensureRevoked?: boolean): {
46
+ event: SerderACDC;
47
+ opening: RegistryDisclosure;
48
+ };
49
+ /** Advance one explicit state through real anchoring; staging is never reported as accepted. */
50
+ update(reg: Registry, acdc: SerderACDC, state: string, options?: AcdcV2UpdateOptions): Operation<SerderACDC>;
51
+ /** Reuse the current branch's already signed seal even before receipts; no extra anchor merely to poll. */
52
+ anchor(reg: Registry, event: SerderACDC, auths?: WitnessAuthMap): Operation<void>;
53
+ }
54
+ //# sourceMappingURL=authoring.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authoring.d.ts","sourceRoot":"","sources":["../../src/acdc/authoring.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAA8B,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AACtE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAW,KAAK,cAAc,EAAY,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAuB,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAG1D,iGAAiG;AACjG,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yFAAyF;IACzF,KAAK,CAAC,EAAE,cAAc,CAAC;CACxB;AAED,mGAAmG;AACnG,qBAAa,cAAc;IAEvB,QAAQ,CAAC,GAAG,EAAE,MAAM;IACpB,QAAQ,CAAC,SAAS,EAAE,SAAS;IAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,eAAe;gBAFzB,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,SAAS,EACpB,OAAO,CAAC,EAAE,eAAe,YAAA;IAUpC,4GAA4G;IAC5G,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,QAAQ;IAQpD,2GAA2G;IAC3G,SAAS,CAAC,UAAU,CAAC,GAAG,EAAE,QAAQ,GAAG,IAAI;IAMzC,kFAAkF;IACjF,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC,UAAU,CAAC;IAYxF,mFAAmF;IACnF,MAAM,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,GAAG,UAAU;IAKzE,mHAAmH;IACnH,KAAK,CACH,GAAG,EAAE,QAAQ,EACb,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,mBAAwB,GAChC;QAAE,KAAK,EAAE,UAAU,CAAC;QAAC,OAAO,EAAE,kBAAkB,CAAA;KAAE;IAIrD,+HAA+H;IAC/H,SAAS,CAAC,UAAU,CAClB,GAAG,EAAE,QAAQ,EACb,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,mBAAmB,EAC5B,aAAa,UAAQ,GACpB;QAAE,KAAK,EAAE,UAAU,CAAC;QAAC,OAAO,EAAE,kBAAkB,CAAA;KAAE;IA2ErD,gGAAgG;IAC/F,MAAM,CACL,GAAG,EAAE,QAAQ,EACb,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,mBAAwB,GAChC,SAAS,CAAC,UAAU,CAAC;IAOxB,2GAA2G;IAC1G,MAAM,CAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC,IAAI,CAAC;CA4BnF"}
@@ -1,14 +1,34 @@
1
- /** Read-only ACDC chaining over caller-owned node verdicts; authentication and application state policy stay separate. */
1
+ /**
2
+ * Read-only ACDC chaining over caller-owned node verdicts; authentication and application state policy stay separate.
3
+ *
4
+ * KERIpy correspondence: the graph walk and Edge evaluation of upstream PR 1757's
5
+ * `acdc.evaluating.EdgeEvaluator`. keri-ts keeps a functional seam: protocols
6
+ * (IPEX) own node authentication and frame admission, then call `walkAcdcGraph`
7
+ * and `evaluateChain` without this module knowing any disclosure protocol.
8
+ */
2
9
  import { type SerderACDC } from "cesr-ts";
3
10
  import type { Baser } from "../db/basing.js";
4
- /** Borrow a complete reachable DAG of verified credential views, with its origin first, without projecting frames. */
11
+ /**
12
+ * How a walk treats an expanded Edge leaf whose far node is not disclosed.
13
+ *
14
+ * `closed` refuses the whole graph. `open` skips the leaf in the walk, and
15
+ * `evaluateChain` then reads it as a non-retryable unknown: disclosed nodes are
16
+ * fixed bytes, so nothing can supply the far node later. An OR group with a
17
+ * valid sibling still holds; an AND group or a sole Edge refuses without escrow.
18
+ */
19
+ export type AcdcWalkPolicy = "open" | "closed";
20
+ /** Every Grant-side caller defaults to `open`, matching KERIpy's Grant walk default. */
21
+ export declare const DEFAULT_GRANT_WALK: AcdcWalkPolicy;
22
+ /** Borrow a reachable DAG of verified credential views, with its origin first, without projecting frames. */
5
23
  export interface AcdcGraph {
6
24
  nodes: ReadonlyMap<string, {
7
25
  readonly body: SerderACDC;
8
26
  }>;
9
27
  order: readonly string[];
28
+ /** The policy the walk enforced; evaluation of undisclosed far nodes follows it. */
29
+ walk: AcdcWalkPolicy;
10
30
  }
11
- /** Reserved section/group labels include a pin at every level. */
31
+ /** Reserved Edge-group labels include a pin at every level. The top-level Edge Section additionally forbids `w`. */
12
32
  export declare const acdcGroupLabels: ReadonlySet<string>;
13
33
  /** A truth verdict cannot absorb malformed input; callers represent that separately as null. */
14
34
  export type ChainVerdict = {
@@ -21,15 +41,45 @@ export type ChainVerdict = {
21
41
  reason: string;
22
42
  schemas: readonly string[];
23
43
  };
24
- /** Empty section containers carry no disclosed edge semantics; malformed nonempty values refuse. */
25
- export declare function acdcEdgeBlocks(value: unknown): Record<string, unknown>[] | null;
44
+ /** One node's Edge Section: absent or empty, an opaque compact commitment, or one expanded top-level Edge-group. */
45
+ export type AcdcEdgeSection = {
46
+ kind: "none";
47
+ } | {
48
+ kind: "compact";
49
+ said: string;
50
+ } | {
51
+ kind: "expanded";
52
+ section: Record<string, unknown>;
53
+ };
54
+ /**
55
+ * Classify a node's `e` field; null is malformed.
56
+ * Lists, falsy non-map values, non-SAID strings and a top-level `n` or `w` are
57
+ * malformed. A compact SAID is a valid opaque terminal that names no far nodes.
58
+ */
59
+ export declare function acdcEdgeSection(sad: Readonly<Record<string, unknown>>): AcdcEdgeSection | null;
26
60
  /** Compact Edge strings name blocks, never far ACDCs. Expanded leaves have exact labels. */
27
61
  export declare function acdcEdgeTarget(value: unknown): string | null | false;
62
+ /**
63
+ * Walk a disclosed graph of credential views from `origin` in BFS order.
64
+ *
65
+ * Every view must verify (including its carried section SAIDs) under its own
66
+ * SAID key, every Edge Section must be well shaped, every disclosed node must be
67
+ * reachable and the reachable graph must be acyclic. Closed walks also require
68
+ * every expanded leaf target to be disclosed; open walks skip undisclosed ones
69
+ * (see `AcdcWalkPolicy`).
70
+ * Compact Edge Sections and compact Edge members are opaque terminals.
71
+ * Protocol frame admission (ilks, nests, duplicates) belongs to the caller.
72
+ */
73
+ export declare function walkAcdcGraph(origin: string, nodes: ReadonlyMap<string, {
74
+ readonly body: SerderACDC;
75
+ }>, walk: AcdcWalkPolicy): string[] | null;
28
76
  /**
29
77
  * Validate every own schema, then conjoin each caller verdict with its complete edge expression.
30
78
  * Every branch is inspected for malformed shape, even when its truth value is unused.
79
+ * Under an open walk an undisclosed far node is a non-retryable unknown for its leaf.
31
80
  * Protocol callers supply issuer authentication; applications supply their state policy.
32
- * This helper reads schemas but writes no records and publishes no cues.
81
+ * The graph must come from `walkAcdcGraph` (directly or through a protocol walk).
82
+ * This helper reads schemas and KEL state but writes no records and publishes no cues.
33
83
  */
34
84
  export declare function evaluateChain(graph: AcdcGraph, verdicts: ReadonlyMap<string, ChainVerdict>, db: Baser): ChainVerdict | null;
35
85
  //# sourceMappingURL=chaining.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chaining.d.ts","sourceRoot":"","sources":["../../src/acdc/chaining.ts"],"names":[],"mappings":"AAAA,0HAA0H;AAC1H,OAAO,EAAuB,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAG/D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAI7C,sHAAsH;AACtH,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;KAAE,CAAC,CAAC;IAC1D,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1B;AAED,kEAAkE;AAClE,eAAO,MAAM,eAAe,EAAE,WAAW,CAAC,MAAM,CAAsC,CAAC;AAKvF,gGAAgG;AAChG,MAAM,MAAM,YAAY,GACpB;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GACjB;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GACnB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,SAAS,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC;AAMxF,oGAAoG;AACpG,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,IAAI,CAI/E;AAUD,4FAA4F;AAC5F,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,GAAG,KAAK,CAGpE;AAoBD;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC,EAC3C,EAAE,EAAE,KAAK,GACR,YAAY,GAAG,IAAI,CA6HrB"}
1
+ {"version":3,"file":"chaining.d.ts","sourceRoot":"","sources":["../../src/acdc/chaining.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAuB,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAI/D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAG7C;;;;;;;GAOG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,QAAQ,CAAC;AAC/C,wFAAwF;AACxF,eAAO,MAAM,kBAAkB,EAAE,cAAuB,CAAC;AAEzD,6GAA6G;AAC7G,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;KAAE,CAAC,CAAC;IAC1D,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,oFAAoF;IACpF,IAAI,EAAE,cAAc,CAAC;CACtB;AAED,oHAAoH;AACpH,eAAO,MAAM,eAAe,EAAE,WAAW,CAAC,MAAM,CAAsC,CAAC;AASvF,gGAAgG;AAChG,MAAM,MAAM,YAAY,GACpB;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GACjB;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GACnB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,SAAS,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC;AAgBxF,oHAAoH;AACpH,MAAM,MAAM,eAAe,GACvB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,CAAC;AAE3D;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,eAAe,GAAG,IAAI,CAU9F;AACD,4FAA4F;AAC5F,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,GAAG,KAAK,CAGpE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC,EACzD,IAAI,EAAE,cAAc,GACnB,MAAM,EAAE,GAAG,IAAI,CAwDjB;AAiED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC,EAC3C,EAAE,EAAE,KAAK,GACR,YAAY,GAAG,IAAI,CA4GrB"}
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Registry blind derivation over the Keeper's registry root.
3
+ *
4
+ * Issuing a blinded (BUP) registry update needs a deterministic opening. The
5
+ * root salt stays in the Keeper; this core derives openings from it and keeps
6
+ * only the public, event-specific coordinates in a `DerivedUpdateStore`. A
7
+ * runtime defaults to {@link BaserDerivedUpdateStore}; a wallet backs the port
8
+ * with its own table. The core opens no database of its own.
9
+ */
10
+ import { type SerderACDC } from "cesr-ts";
11
+ import type { Hab, Habery } from "../app/identity/habbing.js";
12
+ import type { RegBaser } from "./regbasing.js";
13
+ import { type RegistryDisclosure } from "./regeventing.js";
14
+ import type { RegistryStore } from "./registering.js";
15
+ /** Public event-specific inputs; neither a salt nor a derived opening is retained here. */
16
+ export interface DerivedUpdate {
17
+ credential: string;
18
+ state: string;
19
+ bound: {
20
+ bn: string;
21
+ bd: string;
22
+ } | null;
23
+ }
24
+ /** Durable, non-secret derivation coordinates keyed by BUP SAID; `pin` overwrites. */
25
+ export interface DerivedUpdateStore {
26
+ get(event: string): DerivedUpdate | null;
27
+ pin(event: string, value: DerivedUpdate): void;
28
+ }
29
+ /** Process-local store for a CLI or tests; a wallet backs the port with its own durable table. */
30
+ export declare class MemoryDerivedUpdateStore implements DerivedUpdateStore {
31
+ private readonly rows;
32
+ get(event: string): DerivedUpdate | null;
33
+ pin(event: string, value: DerivedUpdate): void;
34
+ }
35
+ /**
36
+ * Derivation coordinates kept in a registry environment's own database (`RegBaser.dvus`). The default of a
37
+ * runtime that supplies no store, so a server agent keeps them durably beside the registry events they
38
+ * describe. A wallet with its own table still passes that instead.
39
+ */
40
+ export declare class BaserDerivedUpdateStore implements DerivedUpdateStore {
41
+ private readonly baser;
42
+ constructor(baser: RegBaser);
43
+ get(event: string): DerivedUpdate | null;
44
+ pin(event: string, value: DerivedUpdate): void;
45
+ }
46
+ /** Owners a custody borrows; construction opens nothing. */
47
+ export interface RegistryCustodyOptions {
48
+ hby: Habery;
49
+ hab: Hab;
50
+ registry: RegistryStore;
51
+ store: DerivedUpdateStore;
52
+ }
53
+ /** Explicit capability over a local habitat's Keeper root and accepted public registry evidence. */
54
+ export declare class RegistryCustody {
55
+ readonly options: RegistryCustodyOptions;
56
+ /** Borrow owners only; construction loads no encrypted row. */
57
+ constructor(options: RegistryCustodyOptions);
58
+ /** Bind the actual local habitat and its key owners, never an AID label alone. */
59
+ private owner;
60
+ /** Load only this habitat's Keeper root; possession confers no protocol authority. */
61
+ private load;
62
+ /** Provision an issuer-selected root once, refusing replacement behind opaque accepted history. */
63
+ createCustody(registry: string): {
64
+ registry: string;
65
+ };
66
+ /** Derive a candidate only; consumers still authenticate its exact accepted event and bound KEL reference. */
67
+ derive(registry: string, ordinal: number | bigint, credential: string, state: string, options?: {
68
+ bound?: boolean;
69
+ bsn?: number | bigint;
70
+ bd?: string;
71
+ }): RegistryDisclosure;
72
+ /** Persist exact nonsecret coordinates before processing/anchoring a newly derived BUP. */
73
+ retainDerivedUpdate(event: SerderACDC, opening: RegistryDisclosure): DerivedUpdate;
74
+ /** Reproduce only the exact accepted event, never today's head or a later credential's coordinates. */
75
+ derivedOpening(event: SerderACDC): RegistryDisclosure;
76
+ }
77
+ //# sourceMappingURL=custody.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custody.d.ts","sourceRoot":"","sources":["../../src/acdc/custody.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAA8D,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AACtG,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAG9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,KAAK,kBAAkB,EAAY,MAAM,kBAAkB,CAAC;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,2FAA2F;AAC3F,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CAC1C;AAED,sFAAsF;AACtF,MAAM,WAAW,kBAAkB;IACjC,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAAC;IACzC,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,GAAG,IAAI,CAAC;CAChD;AAED,kGAAkG;AAClG,qBAAa,wBAAyB,YAAW,kBAAkB;IACjE,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAoC;IACzD,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI;IAGxC,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,GAAG,IAAI;CAG/C;AAED;;;;GAIG;AACH,qBAAa,uBAAwB,YAAW,kBAAkB;IACpD,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAC5C,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI;IAIxC,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,GAAG,IAAI;CAG/C;AAED,4DAA4D;AAC5D,MAAM,WAAW,sBAAsB;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,GAAG,CAAC;IACT,QAAQ,EAAE,aAAa,CAAC;IACxB,KAAK,EAAE,kBAAkB,CAAC;CAC3B;AAED,oGAAoG;AACpG,qBAAa,eAAe;IAEd,QAAQ,CAAC,OAAO,EAAE,sBAAsB;IADpD,+DAA+D;gBAC1C,OAAO,EAAE,sBAAsB;IAIpD,kFAAkF;IAClF,OAAO,CAAC,KAAK;IAOb,sFAAsF;IACtF,OAAO,CAAC,IAAI;IAOZ,mGAAmG;IACnG,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE;IAiCrD,8GAA8G;IAC9G,MAAM,CACJ,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,GAAG,MAAM,EACxB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EACb,OAAO,GAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAA;KAAO,GACpE,kBAAkB;IAarB,2FAA2F;IAC3F,mBAAmB,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,kBAAkB,GAAG,aAAa;IAiBlF,uGAAuG;IACvG,cAAc,CAAC,KAAK,EAAE,UAAU,GAAG,kBAAkB;CAwBtD"}
@@ -5,13 +5,14 @@
5
5
  */
6
6
  import { type Cigar, type Diger, Salter, type SerderKERI } from "cesr-ts";
7
7
  import type { Operation } from "effection";
8
- import type { ExchangeDecision, Exchanger } from "../app/exchanges/exchanging.js";
8
+ import type { ExchangeDecision, ExchangeInput, Exchanger } from "../app/exchanges/exchanging.js";
9
9
  import { Hab } from "../app/identity/habbing.js";
10
10
  import { type GroupCoordinator } from "../app/multisig/group-members.js";
11
11
  import { type AuxiliaryQueryProcessor, type MessageDropDecision } from "../app/protocol/parsering.js";
12
12
  import { Deck } from "../core/deck.js";
13
13
  import type { KeriDispatchEnvelope, TransIdxSigGroup } from "../core/dispatch.js";
14
14
  import { type ReplyProcessDecision, type Revery } from "../core/routing.js";
15
+ import type { Baser } from "../db/basing.js";
15
16
  import { type RegistryStore } from "./registering.js";
16
17
  /** Exact context bound by the Python HKDF profile. XID can differ from Grant SAID. */
17
18
  export interface DhkeContext {
@@ -33,6 +34,40 @@ export declare function generateKeyPair(): {
33
34
  };
34
35
  /** Derive one Salt128; malformed context, wrong local keys and low-order peers refuse. */
35
36
  export declare function deriveRoot(privateKey: Uint8Array, context: DhkeContext): Salter;
37
+ /** The Grant `hab` takes part in, with its parties, transaction and registry scope. */
38
+ interface GrantScope {
39
+ input: ExchangeInput;
40
+ issuer: string;
41
+ issuee: string;
42
+ xid: string;
43
+ registries: readonly string[];
44
+ }
45
+ /**
46
+ * The DH transaction id of a Grant: its own SAID when it opens the exchange (`xip`), and otherwise the exchange it
47
+ * continues (`x`). The one definition, so the owner and any workflow that names the transaction agree.
48
+ */
49
+ export declare function grantTransactionId(grant: SerderKERI): string;
50
+ /**
51
+ * The scope of a completed exchange that can finish without new key exchange: the Grant is still pending
52
+ * inside its original deadline and `hab` holds a root for the registries it discloses. The scope is those
53
+ * registries; a registry that is still fresh must hold one. No fresh registry is required, because the
54
+ * issuer's update may already be accepted: {@link Dhke.finish} proves the held root against that update, so
55
+ * a root from any other exchange is rejected there. Pure read of stores. Null when nothing can resume.
56
+ */
57
+ export declare function resumableExchange({ hab, exc }: {
58
+ hab: Hab;
59
+ exc: Exchanger;
60
+ }, grant: string): GrantScope | null;
61
+ /**
62
+ * Whether `registry` has no committed state: its head is still the inception and no update is escrowed.
63
+ * A staged update waits in the missing-anchor or out-of-order escrow under its registry until the issuer's
64
+ * anchor is accepted, and an accepted one moves the head, so two keyed reads bounded by this registry
65
+ * decide it. Only then can a retained root be unused, because every derivation from a root, and every copy
66
+ * of it to another member (which `RegistryRoot` authorizes only for an accepted, issuer-anchored update),
67
+ * starts from a staged or accepted update. A remote update escrowed for this registry also counts, which
68
+ * is the conservative side.
69
+ */
70
+ export declare function registryUncommitted(registryStore: RegistryStore, registry: string): boolean;
36
71
  /** Group consent names its own accepted coordinator and elected member; individuals omit both. */
37
72
  export interface DhkeApproval {
38
73
  coordinator?: GroupCoordinator;
@@ -44,6 +79,16 @@ export interface DhkeOutgoing {
44
79
  dest: string;
45
80
  msg: Uint8Array;
46
81
  }
82
+ /**
83
+ * The group custodian just retained these registries' roots for `gid`; every other
84
+ * current member should receive a sealed copy (KERIpy's `replicate` cue). It carries
85
+ * coordinates only, never a root. It is a separate deck from `outgoing` because it is
86
+ * not wire: a drainer that sends every `outgoing` item would send it.
87
+ */
88
+ export interface DhkeReplicate {
89
+ gid: string;
90
+ registries: string[];
91
+ }
47
92
  /**
48
93
  * Issuer/issuee DH for an explicitly approved pending Grant. Wire
49
94
  * intake cannot approve work. Inject as ProtocolProcessor.qvy and register on
@@ -56,6 +101,8 @@ export declare class Dhke implements AuxiliaryQueryProcessor {
56
101
  static readonly Route = "/ipex/dhke";
57
102
  readonly resource = "/ipex/dhke";
58
103
  readonly outgoing: Deck<DhkeOutgoing>;
104
+ /** Completion cues for roots just retained by this group's custodian; feed `RootReplicator.replicate`. */
105
+ readonly replicated: Deck<DhkeReplicate>;
59
106
  private readonly pendingQueries;
60
107
  private readonly now;
61
108
  private readonly operations;
@@ -64,16 +111,46 @@ export declare class Dhke implements AuxiliaryQueryProcessor {
64
111
  readonly rvy: Revery;
65
112
  readonly registryStore: RegistryStore;
66
113
  readonly group: boolean;
114
+ private readonly kram;
67
115
  /** Bind concrete local owners; construction grants no consent and writes nothing. */
68
- constructor({ hab, exc, registryStore, rvy, now }: {
116
+ constructor({ hab, exc, registryStore, rvy, now, kram }: {
69
117
  hab: Hab;
70
118
  exc: Exchanger;
71
119
  registryStore: RegistryStore;
72
120
  rvy?: Revery;
73
121
  now?: () => number;
122
+ /** False when the runtime has KRAM off: its `tmsc`/`msgc` rows never exist, so `approve` refuses. */
123
+ kram?: boolean;
74
124
  });
75
- /** Select one live fresh issuance and freeze its exact bodies, parties and registry order. */
125
+ /**
126
+ * Select one live fresh issuance and freeze its exact bodies, parties and registry order.
127
+ *
128
+ * A registry that already holds a root refuses (`Registry root conflicts with this live DH operation`)
129
+ * unless it has no committed state ({@link registryUncommitted}): then the held root was never used and
130
+ * this exchange, whose Grant is from the registry's issuer, overwrites it when it retains its own root,
131
+ * never at approval, so an interruption before retention leaves the old root. Once any update is staged
132
+ * or accepted the refusal is unchanged. A KERIpy peer keeps the old rule and refuses such a second
133
+ * exchange: with a KERIpy holder the issuer needs a fresh registry. One process also refuses a second
134
+ * live operation on a registry, so two pending Grants cannot clobber each other's root.
135
+ */
76
136
  approve(grant: string, { coordinator, custodian }?: DhkeApproval): string;
137
+ /**
138
+ * Resume a completed exchange after a process restart, without new key exchange: rebuild the operation as
139
+ * completed from the roots held for the Grant's registries ({@link resumableExchange}). It holds no
140
+ * ephemeral key, so it cannot start, answer or renew a query; it can only {@link complete} and
141
+ * {@link finish}, which signs nothing and verifies the issuer's update against the held root. Needs an
142
+ * unlocked Keeper; wire intake never calls it. Repeating it returns the same transaction.
143
+ *
144
+ * @throws ValidationError unless the Grant is pending and holds a root for each registry in its scope.
145
+ */
146
+ resume(grant: string, { coordinator, custodian }?: DhkeApproval): string;
147
+ /** Freeze the exact pending Grant, parties and registry order into an operation; registers nothing. */
148
+ private frozen;
149
+ /**
150
+ * Whether this owner already holds a live operation for `grant`. Two operation tables over one runtime
151
+ * (the host's and a command's own) use it so only the first to reach a Grant drives it.
152
+ */
153
+ holds(grant: string): boolean;
77
154
  /** Return the stable issuer proposal until own threshold intake supplies the complete query. */
78
155
  start(grant: string): Uint8Array;
79
156
  /**
@@ -109,6 +186,16 @@ export declare class Dhke implements AuxiliaryQueryProcessor {
109
186
  finish(xid: string): Operation<ExchangeDecision>;
110
187
  /** Drop local ephemeral key references and permanently refuse this operation. */
111
188
  abandon(xid: string): void;
189
+ /**
190
+ * Whether this local habitat is the party of DH transaction `xid` with `sender`.
191
+ *
192
+ * Messages carry no recipient, so a per-identifier registry selects the owner by transaction:
193
+ * an approved operation here, a stored Grant from `sender` addressed to this habitat, or, for a
194
+ * group, its own members' contributions, which KRAM must pool before this owner consents.
195
+ */
196
+ inTransaction(sender: string, xid: string): boolean;
197
+ /** Recipients of the pending Grants `sender` opened in DH transaction `xid`, from KRAM-accepted store rows. */
198
+ static recipients(db: Baser, sender: string, xid: string): string[];
112
199
  /** Release all process-local approvals and retry bytes; zero owned ephemeral scalar arrays. */
113
200
  close(): void;
114
201
  /** Retain public query evidence against one exact pending Grant, without creating keys or consent. */
@@ -117,6 +204,9 @@ export declare class Dhke implements AuxiliaryQueryProcessor {
117
204
  private pruneQueries;
118
205
  /** Consume the first authenticated request only after explicit approval; never renew either clock. */
119
206
  private replayQuery;
207
+ /** The persisted query for `xid` after a restart, with its lifetime recomputed from KRAM's durable records. */
208
+ private loadHeld;
209
+ private dropHeld;
120
210
  /** Bound process-local public evidence by the original query and accepted Grant lifetimes. */
121
211
  private retainUntil;
122
212
  private operation;
@@ -133,4 +223,5 @@ export declare class Dhke implements AuxiliaryQueryProcessor {
133
223
  /** Recheck exact frozen election evidence and current membership without choosing a replacement. */
134
224
  private custody;
135
225
  }
226
+ export {};
136
227
  //# sourceMappingURL=dhking.d.ts.map