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,443 @@
1
+ /**
2
+ * Runtime-owned operations for single-signature v2 DH issuance.
3
+ *
4
+ * One `IssuanceOperations` owner holds an in-memory table of live operations. The user begins an
5
+ * operation with `beginIssuance`, which signs the Grant, approves the DH exchange, starts the query
6
+ * and records that authorisation in memory. The host's runtime loop (or, in a one-shot CLI, a driver
7
+ * under `withRuntimeWorkers`) then calls `processOnce`, which performs exactly the steps
8
+ * `tufa ipex --issue` performed itself: send the proof support and Grant, deliver DH traffic, resend
9
+ * a freshly dated query each second until DH completes, and once DH completes stage and anchor the registry update (BUP),
10
+ * `finish` the Grant and send the final proof support. Nothing starts an operation or signs except
11
+ * inside an operation the user began while its in-memory authorisation lives.
12
+ *
13
+ * Workflow-contract shape (`app/runtime/workflow-contract.ts`): `beginIssuance` returns after local
14
+ * commit and never waits for the peer; `issuanceStatus` is a pure read; `waitForIssuance` only
15
+ * observes and returns a `WaitResult`; `abandonIssuance` is local.
16
+ *
17
+ * There is no operation store. Status is derived from the protocol stores plus the live table, so a
18
+ * reopened store reads what the stores prove, whatever the process was doing:
19
+ *
20
+ * | stores prove | status |
21
+ * | ------------------------------------------------------------------------- | ---------------------------------------- |
22
+ * | holder: pending Grant, no root held | `awaitingExchangeConsent` |
23
+ * | pending Grant past its deadline | `expired` |
24
+ * | holder: root held, not committed otherwise; issuer: update accepted | `active`, `rootRetained` (adopted) |
25
+ * | issuer: pending Grant, update not accepted | `interrupted` |
26
+ * | root held and the registry committed to another exchange | `interrupted` |
27
+ * | holder: Grant accepted, no accepted Admit | `active`, `awaitingAdmitConsent` |
28
+ * | holder: accepted Admit | `done`, `admitted` |
29
+ * | issuer: Grant accepted | `done`, `issued` |
30
+ *
31
+ * Lost on reload, by design: the phases that live only in memory (`exchangingKeys`, `awaitingAnchor`,
32
+ * `proving` read `rootRetained` or `interrupted` afterwards), the `abandoned` and `failed` end states
33
+ * with their reasons (an abandoned holder reads `awaitingExchangeConsent` again, an abandoned issuer
34
+ * `interrupted`, and an abandoned operation whose root and accepted update remain is adopted and
35
+ * completed on the next start; it signs nothing and Admit stays a separate consent), the consent
36
+ * timestamps, and whether the issuer's final proof support was delivered (an issuer whose Grant is
37
+ * accepted reads `done` even if the process ended before that message went out). A Grant the issuer
38
+ * prepared but never began reads `interrupted`, the same as one whose process ended; so does an issuer
39
+ * that ended between staging its registry update and anchoring it (an explicit recovery action for that
40
+ * case is a planned follow-up; until then it needs a new Grant, and a held root nothing committed to is
41
+ * replaced). A wallet that wants any of these keeps them itself from the `ChangeSink`.
42
+ *
43
+ * After a restart the first `processOnce` finds the pending Grants this runtime's identifiers are party
44
+ * to that hold a root and can finish without new key exchange ({@link resumableExchange}) and adopts
45
+ * them: the holder waits for or verifies the issuer's update, an issuer whose update is already
46
+ * accepted finishes. Neither signs: the issuer's update was anchored before the restart, and
47
+ * `Dhke.finish` only proves the held root against the accepted update before the Grant is accepted. A
48
+ * new Grant on a registry that holds an unused root (no update staged or accepted) replaces that root
49
+ * when its exchange retains its own; otherwise the refusal stands. A KERIpy peer keeps the old rule and
50
+ * refuses a second exchange on a registry it holds a root for. The Grant's exchange deadline bounds
51
+ * everything, even a late completion; passing it reads `expired`.
52
+ *
53
+ * The runtime never writes wallet inventory. Completion is pushed to the `ChangeSink` as
54
+ * `{kind: "issuance", id: <grant>}` and the embedder records it.
55
+ *
56
+ * A local group issues and receives through the same table, status and wait: its consent calls and per-operation
57
+ * steps are in `group-issuance.ts` and run inside the same `processOnce`. A group exchange is not resumed after a
58
+ * restart (its frozen coordinator and custodian are not stored): a group pending Grant with no root reads
59
+ * `awaitingExchangeConsent`, and a member consents again with the same call.
60
+ *
61
+ * Collaborators are narrow concrete owners (ADR-0013); no `AgentRuntime`.
62
+ */
63
+ import { SerderACDC, type SerderKERI, type Versionage } from "cesr-ts";
64
+ import { type Operation } from "effection";
65
+ import { type DerivedUpdateStore } from "../../acdc/custody.js";
66
+ import { Dhke } from "../../acdc/dhking.js";
67
+ import type { Regery } from "../../acdc/registraring.js";
68
+ import type { Poster } from "../delivery/forwarding.js";
69
+ import type { Exchanger } from "../exchanges/exchanging.js";
70
+ import type { Hab, Habery } from "../identity/habbing.js";
71
+ import type { ProtocolProcessor } from "../protocol/protocol-processing.js";
72
+ import type { Reactor } from "../protocol/reactor.js";
73
+ import { type DeliveryFailure, type DeliveryMessage, DeliveryOutbox, type Outbound } from "../runtime/delivery-outbox.js";
74
+ import type { RetryPolicy } from "../runtime/retry-backoff.js";
75
+ import type { RuntimeClock } from "../runtime/runtime-clock.js";
76
+ import { type ChangeSink, type WaitResult } from "../runtime/workflow-contract.js";
77
+ import type { Receiptor, WitnessAuthMap } from "../witness/receipting.js";
78
+ import { GroupIssuance, type GroupIssuanceDeps, type GroupRouteBinding } from "./group-issuance.js";
79
+ import { IpexDiscloser, type IssuanceGrantOptions } from "./ipex-discloser.js";
80
+ /**
81
+ * Milliseconds between resends of the issuer query. Each resend is a new query (new date, SAID and signatures):
82
+ * the peer's KRAM caches every query it accepts, so an identical resend is a replay it drops, which would
83
+ * strand a peer that took the first query and then lost it before consenting (a process that ended, or a
84
+ * retained query that outlived its window).
85
+ */
86
+ export declare const ISSUANCE_QUERY_RESEND_MS = 1000;
87
+ /**
88
+ * Milliseconds between scans of the pending exchange escrow for Grants a restarted process can finish. The scan
89
+ * repeats because what makes a Grant resumable can arrive after the restart (an issuer's update accepted once the
90
+ * other members approve it).
91
+ */
92
+ export declare const ISSUANCE_SWEEP_MS = 5000;
93
+ /** Which side of the exchange the local identifier is. */
94
+ export type IssuanceRole = "issuer" | "holder";
95
+ /** Terminal states that are not completion; each carries a reason. */
96
+ export type IssuanceEndState = "abandoned" | "interrupted" | "expired" | "failed";
97
+ /** Where an active issuance is. Group and holder phases extend this union. */
98
+ export type IssuancePhase = "awaitingExchangeConsent" | "exchangingKeys" | "rootRetained"
99
+ /** Group issuer: the Grant lacks member contributions; the group threshold has not authenticated it. */
100
+ | "awaitingGrantSignatures" | "awaitingAnchor" | "proving" | "awaitingAdmitConsent";
101
+ /** A user step an active issuance waits for. Single-signature issuers never wait: `beginIssuance` authorises the anchor. */
102
+ export type IssuanceNeed = "exchange" | "admit";
103
+ /** Status of one issuance, discriminated on `state`. A pure read. */
104
+ export type IssuanceStatus = {
105
+ state: "active";
106
+ role: IssuanceRole;
107
+ phase: IssuancePhase;
108
+ needs?: IssuanceNeed;
109
+ /** The Grant's exchange deadline (ISO 8601), while the exchange is still open. */
110
+ deadline?: string;
111
+ /** Present while a delivery is failing and being retried with a doubling delay. */
112
+ failure?: DeliveryFailure;
113
+ } | {
114
+ state: "done";
115
+ role: IssuanceRole;
116
+ phase: "issued" | "admitted";
117
+ } | {
118
+ state: IssuanceEndState;
119
+ role: IssuanceRole;
120
+ reason: string;
121
+ };
122
+ /** Delivery of signed bytes; resolves once the transport reports an outcome and throws when it failed. */
123
+ export interface IssuanceDelivery {
124
+ /** `topic` defaults to the credential mailbox topic; group members coordinate on `multisig`. */
125
+ deliver(message: DeliveryMessage): Operation<string[]>;
126
+ }
127
+ /**
128
+ * Adapt a `Poster`; its delivery worker must be running (a one-shot CLI runs it under `withRuntimeWorkers`).
129
+ * A wire of several complete messages (proof support plus Grant) goes as one ordered stream, which mailbox
130
+ * forwarding needs; a single message goes as an ordinary send, which is what a direct peer's query route expects.
131
+ */
132
+ export declare function posterDelivery(postman: Pick<Poster, "send" | "sendStream" | "wait">): IssuanceDelivery;
133
+ /** Collaborators of an Admit: everything that needs no DH owner, so a host without per-identifier owners can admit. */
134
+ export interface AdmitDeps {
135
+ readonly hby: Habery;
136
+ /** Registry environment; only its public `store` is read here. */
137
+ readonly rgy: Pick<Regery, "store">;
138
+ readonly exc: Exchanger;
139
+ /** Receipt collector for an anchored Admit; its genus selects the witness protocol version. */
140
+ readonly receiptor: Receiptor;
141
+ /** Local intake of what this identifier signs. */
142
+ readonly reactor: Pick<Reactor, "processBytes">;
143
+ readonly protocol: Pick<ProtocolProcessor, "processEscrowsOnce" | "dispatch">;
144
+ readonly delivery: IssuanceDelivery;
145
+ /** Same clock the exchanger and DH owners were composed with. */
146
+ readonly clock: RuntimeClock;
147
+ readonly changes?: ChangeSink;
148
+ }
149
+ /** Narrow collaborators of the issuance owner. Hosts adapt their runtime to this once. */
150
+ export interface IssuanceDeps extends AdmitDeps {
151
+ /** Registry environment; `rgy.store` is the public registry store. */
152
+ readonly rgy: Regery;
153
+ /** Per-identifier DH owners (`runtime.ipex`), so several identifiers can issue on one runtime. */
154
+ readonly dhkes: {
155
+ dhke(hab: Hab): Dhke;
156
+ };
157
+ /** Non-secret derivation coordinates of blinded registry updates. */
158
+ readonly derived: DerivedUpdateStore;
159
+ /** Delivery retry delays; {@link DEFAULT_RETRY_POLICY} when absent. */
160
+ readonly retry?: Readonly<RetryPolicy>;
161
+ /** Milliseconds between issuer query resends; {@link ISSUANCE_QUERY_RESEND_MS} when absent. */
162
+ readonly queryResendMs?: number;
163
+ /** Collaborators of group issuance; absent, this owner issues and holds as an individual only. */
164
+ readonly group?: GroupIssuanceDeps;
165
+ }
166
+ /** One operation the user began or adopted; exists only while it is live in this process. */
167
+ export interface LiveIssuance {
168
+ /** SAID of the Grant exchange. */
169
+ readonly grant: string;
170
+ /** DH transaction id; differs from the Grant SAID for a Grant that continues an earlier exchange. */
171
+ readonly xid: string;
172
+ readonly role: IssuanceRole;
173
+ /** The Grant's original exchange deadline (ISO 8601). */
174
+ deadline: string | null;
175
+ readonly hab: Hab;
176
+ readonly dh: Dhke;
177
+ readonly peer: string;
178
+ readonly registry: string;
179
+ /** Null while a group issuer's Grant lacks member contributions: KRAM fixes the lifetime once the group authenticates it. */
180
+ expires: bigint | null;
181
+ /** Issuer only: what the loop sends and anchors. Absent for a holder. */
182
+ readonly issuer?: {
183
+ readonly credential: SerderACDC;
184
+ /** Grant body and nested disclosure, the input of proof support. */
185
+ readonly raw: Uint8Array;
186
+ readonly grantWire: Uint8Array;
187
+ /** The latest signed DH query; null once DH is complete (a completed issuer after a restart). */
188
+ query: Uint8Array | null;
189
+ /** Transient witness codes for the anchor. */
190
+ readonly auths?: WitnessAuthMap;
191
+ sent: boolean;
192
+ nextQuery: number;
193
+ };
194
+ /** Group party state, for an operation of a local group; such an operation has no {@link issuer} part. */
195
+ readonly group?: GroupIssuance;
196
+ phase: IssuancePhase;
197
+ /** Signed bytes the steps decided to send and delivery has not yet taken; a member briefly offline is retried. */
198
+ readonly outbox: DeliveryOutbox;
199
+ /** The steps are done; the operation ends once the outbox is empty. */
200
+ finished: boolean;
201
+ /** A step is running; overlapping `processOnce` calls skip it. */
202
+ busy: boolean;
203
+ }
204
+ /** How long delivery failures may last on an operation that has no Grant deadline yet before it ends `failed`. */
205
+ export declare const ISSUANCE_RETRY_BOUND_MS = 600000;
206
+ /** What `beginIssuance` selected. */
207
+ export interface IssuanceBegun {
208
+ grant: string;
209
+ xid: string;
210
+ }
211
+ /** A fresh credential and how its Grant is addressed; the issuer is its registry's identifier. */
212
+ export interface GrantDraft {
213
+ credential: SerderACDC;
214
+ options: IssuanceGrantOptions;
215
+ }
216
+ /** A Grant taken into local pending issuance and the wire a host may deliver or file itself. */
217
+ export interface PreparedGrant {
218
+ grant: string;
219
+ wire: Uint8Array;
220
+ }
221
+ /** What an operation that ended in this process reports until the process ends. */
222
+ interface EndedIssuance {
223
+ role: IssuanceRole;
224
+ state: IssuanceEndState;
225
+ reason: string;
226
+ }
227
+ /**
228
+ * The live operations table and its driver. One per host runtime; every identifier of that runtime may
229
+ * issue through it. Only `processOnce` performs work, and only for operations in
230
+ * {@link IssuanceOperations.live}.
231
+ */
232
+ export declare class IssuanceOperations {
233
+ readonly deps: IssuanceDeps;
234
+ /** Operations live in this process. Internal to this module's functions. */
235
+ readonly live: Map<string, LiveIssuance>;
236
+ /** Operations that ended in this process with their reasons; not durable, see the module doc. */
237
+ readonly ended: Map<string, EndedIssuance>;
238
+ readonly discloser: IpexDiscloser;
239
+ /** The DH child handlers this owner registered on the multiplexor, once a group operation began. */
240
+ groupRoutes: GroupRouteBinding[] | null;
241
+ /** When the next scan for resumable Grants is due (host clock, ms); 0 until the first pass. */
242
+ private nextSweep;
243
+ /** Grants a scan found resumable and adoption refused; they are not tried again in this process. */
244
+ private readonly refused;
245
+ /** Grants an earlier process left resumable: each is adopted once, or dropped. */
246
+ private stale;
247
+ constructor(deps: IssuanceDeps);
248
+ /** Whether a pass has work: a live operation, or the one-time scan for resumable Grants has not run. */
249
+ active(): boolean;
250
+ /**
251
+ * Advance every live operation by one pass. Each pass is bounded by the operation's Grant deadline.
252
+ * The first pass also adopts the pending Grants the stores prove resumable ({@link resumableGrants});
253
+ * that signs and sends nothing.
254
+ */
255
+ processOnce(): Operation<void>;
256
+ /** End a live operation: release its DH approval, remember why until the process ends, tell the sink. */
257
+ end(op: LiveIssuance, state: IssuanceEndState, reason: string): void;
258
+ /** Drop the live entry and the DH approval; a missing approval means the owner already closed. */
259
+ private release;
260
+ /**
261
+ * Adopt one Grant an earlier process left resumable, without signing: the holder waits for or verifies the
262
+ * update, an issuer whose update is already accepted finishes. A Grant the exchange can no longer resume is
263
+ * dropped and reads from the stores. False means the Keeper is locked and the Grant is retried.
264
+ */
265
+ private settle;
266
+ /** Rebuild the live entry of a resumable Grant from the stored Grant and the held roots. */
267
+ private adopt;
268
+ /**
269
+ * Adopt a group custodian's completed exchange after a restart, signing nothing: the coordinator and custodian
270
+ * the exchange was frozen with are derived from the stores ({@link deriveGroupCustody}), the holder's root is
271
+ * already held, and the group steps finish the Grant against the accepted update. The only signature is the
272
+ * endorsement of the public proof wrapper the original consent already covers.
273
+ */
274
+ private adoptGroup;
275
+ /** The live entry of a group operation; its lifetime is the Grant's once KRAM has accepted it, else unknown. */
276
+ private liveGroup;
277
+ private timer;
278
+ /**
279
+ * Queue signed bytes for delivery from the identifier that signed them. Steps decide what to send; {@link drain}
280
+ * sends it, so a member that is briefly offline delays the operation instead of ending it.
281
+ */
282
+ enqueue(op: LiveIssuance, message: Outbound): void;
283
+ /**
284
+ * Deliver the queued messages in order. A failure keeps the message and schedules a retry with a doubling delay;
285
+ * it ends the operation only where nothing else bounds it: the Grant deadline ends one that has it, and failures
286
+ * lasting {@link ISSUANCE_RETRY_BOUND_MS} end one that has none yet. True when the outbox is empty.
287
+ */
288
+ private drain;
289
+ /** One pass: send what is queued, step only once the queue is empty, send what the step queued. */
290
+ private advance;
291
+ /** Record a phase change of a live operation and tell the sink; the group steps call it too. */
292
+ setPhase(op: LiveIssuance, phase: IssuancePhase): void;
293
+ /**
294
+ * Record one group operation the user consented to ({@link approveGroupIssuance},
295
+ * {@link approveGroupIssuanceExchange}, {@link followGroupIssuanceProof}). A holder approves DH here, with its
296
+ * consent; an issuer approves once the group has authenticated the Grant.
297
+ */
298
+ beginGroup(group: GroupIssuance): IssuanceBegun;
299
+ /** One pass of the issuer loop, in the order of the CLI loop it replaces. */
300
+ private step;
301
+ /**
302
+ * The query to resend now, signed afresh (`Dhke.requery`: same keys and scope, new `dt`, SAID and signatures).
303
+ * An unchanged resend is a KRAM replay once the peer has accepted the original, so it can never reach a peer
304
+ * that lost it; a new query is timely whatever window the peer runs. Re-signing happens only here, inside the
305
+ * live authorisation that began the operation; with the Keeper locked the last query goes again unchanged. A
306
+ * group threshold query cannot be re-dated by one member; group issuance is not run here.
307
+ */
308
+ private renewed;
309
+ /**
310
+ * Holder, DH complete: wait for the issuer's registry update, then verify it and finish the Grant. The
311
+ * issuance is then complete but for the holder's separate Admit consent.
312
+ */
313
+ private receive;
314
+ /** DH is complete: stage and anchor the BUP under the live authorisation, finish the Grant, send proof support. */
315
+ private finish;
316
+ }
317
+ /**
318
+ * Sign a fresh Grant for `credential` and take it into local pending issuance
319
+ * without approving DH or generating a root. A host may deliver or file the
320
+ * returned wire itself and begin later with the Grant SAID.
321
+ */
322
+ export declare function prepareIssuanceGrant(ops: IssuanceOperations, draft: GrantDraft): Operation<PreparedGrant>;
323
+ /**
324
+ * The issuer's one "issue this credential" consent for a prepared Grant ({@link prepareIssuanceGrant}); the
325
+ * issuer is the Grant's sender. Approves the DH exchange, signs the query and records the
326
+ * authorisation, including the later KEL signature that anchors the registry
327
+ * update, in memory. Returns after local commit; `processOnce` does the rest.
328
+ *
329
+ * @throws ValidationError for a Grant that is not this identifier's exact
330
+ * unanchored pending issuance, an unmanaged registry, a group identifier, or
331
+ * an issuance already begun or completed.
332
+ */
333
+ export declare function beginIssuance(ops: IssuanceOperations, grant: string, auths?: WitnessAuthMap): Operation<IssuanceBegun>;
334
+ /**
335
+ * The issuer's one consent to issue a fresh credential: signs the Grant ({@link prepareIssuanceGrant}) and begins
336
+ * the issuance ({@link beginIssuance}) in one step.
337
+ */
338
+ export declare function proposeIssuance(ops: IssuanceOperations, draft: GrantDraft, auths?: WitnessAuthMap): Operation<IssuanceBegun>;
339
+ /**
340
+ * Pure read of one issuance: what ended in this process, the live table, and otherwise what the protocol
341
+ * stores prove (see the module doc for the table and what a reload loses). A pending Grant no live
342
+ * operation holds reads `interrupted` (or `expired` once the Grant deadline has passed); that is a
343
+ * statement, not a write.
344
+ *
345
+ * @throws ValidationError when `grant` is not a v2 Grant this runtime's identifiers are party to.
346
+ */
347
+ export declare function issuanceStatus(ops: IssuanceOperations, grant: string): IssuanceStatus;
348
+ /** A pending Grant addressed to a local identifier that no one has consented to yet. */
349
+ export interface PendingGrant {
350
+ /** SAID of the Grant exchange. */
351
+ grant: string;
352
+ /** The local identifier the Grant is addressed to. */
353
+ holder: string;
354
+ /** The AID that sent the Grant. */
355
+ issuer: string;
356
+ /** SAID of the disclosed credential. */
357
+ credential: string;
358
+ /** The credential's registry. */
359
+ registry: string;
360
+ /** The Grant's exchange deadline (ISO 8601). */
361
+ deadline: string;
362
+ }
363
+ /**
364
+ * Pure read of the Grants waiting for the holder's exchange consent: authenticated pending v2 Grants addressed
365
+ * to a local identifier (to `hab` when given) for which {@link approveIssuanceExchange} would be accepted.
366
+ * `issuanceStatus` throws for a Grant until it is stored; this lists the stored ones, so an embedder needs no poll.
367
+ */
368
+ export declare function pendingIssuanceGrants(ops: IssuanceOperations, { hab }?: {
369
+ hab?: Hab;
370
+ }): PendingGrant[];
371
+ /**
372
+ * Pure read of the pending Grants addressed to a local group (to `group` when given) that its members have not
373
+ * consented to: authenticated pending v2 Grants whose issuance status reads `awaitingExchangeConsent`.
374
+ * {@link pendingIssuanceGrants} lists the individual identifiers' Grants and skips groups; this is its group form.
375
+ */
376
+ export declare function pendingGroupGrants(ops: IssuanceOperations, { group }?: {
377
+ group?: Hab;
378
+ }): PendingGrant[];
379
+ /** Options for {@link waitForIssuance}. */
380
+ export interface IssuanceWaitOptions {
381
+ /** Wall-clock budget. */
382
+ timeoutMs: number;
383
+ clock?: RuntimeClock;
384
+ /** Settle on this instead of any non-active state, e.g. a holder stopping where it needs the Admit consent. */
385
+ until?: (status: IssuanceStatus) => boolean;
386
+ }
387
+ /**
388
+ * Observe until the issuance is done or ended, or the budget expires. Starts no
389
+ * worker and drives nothing: someone else must call `processOnce`.
390
+ */
391
+ export declare function waitForIssuance(ops: IssuanceOperations, grant: string, { timeoutMs, clock, until }: IssuanceWaitOptions): Operation<WaitResult<IssuanceStatus>>;
392
+ /**
393
+ * The holder's consent to the DH exchange for one pending Grant addressed to a local identifier. Approves DH and records the
394
+ * consent; `processOnce` then answers the issuer's query, waits for its registry update and finishes the Grant.
395
+ * Admitting the credential is a separate consent ({@link admitIssuance}).
396
+ */
397
+ export declare function approveIssuanceExchange(ops: IssuanceOperations, grant: string): IssuanceBegun;
398
+ /** A signed Admit already accepted locally; delivery is the next, separate step. */
399
+ export interface IssuanceAdmit {
400
+ admit: SerderKERI;
401
+ /** The holder that signed it, the sender of the delivery. */
402
+ src: string;
403
+ /** Support and Admit bytes, in delivery order. */
404
+ wire: Uint8Array;
405
+ /** The issuer the Admit answers. */
406
+ dest: string;
407
+ }
408
+ /** Choices of an Admit. */
409
+ export interface AdmitOptions {
410
+ message?: string;
411
+ gvrsn?: Versionage;
412
+ auths?: WitnessAuthMap;
413
+ }
414
+ /**
415
+ * The holder's consent to admit one accepted Grant: signs the Admit, accepts it locally and records it. Works for
416
+ * a Grant finished by this module and for any other accepted v2 Grant. Returns
417
+ * before delivery so an embedder can record its own inventory first; see {@link deliverIssuanceAdmit}.
418
+ *
419
+ * @throws ValidationError for a Grant that is not accepted and addressed to a local identifier, an admitted Grant, or a group identifier.
420
+ */
421
+ export declare function admitIssuance(deps: AdmitDeps, grant: string, options?: AdmitOptions): Operation<IssuanceAdmit>;
422
+ /** Deliver an accepted Admit; needs the host's delivery worker. Returns the destinations reached. */
423
+ export declare function deliverIssuanceAdmit(delivery: IssuanceDelivery, admitted: IssuanceAdmit): Operation<string[]>;
424
+ /**
425
+ * Rebuild an Admit this process signed earlier so it can be delivered again, after a failed delivery or a
426
+ * restart. The wire is rebuilt from the stored signatures or source seal, so it is the bytes first made and
427
+ * nothing is signed. Delivery stays with {@link deliverIssuanceAdmit}. A peer that already took the Admit
428
+ * may drop the repeat as a replay.
429
+ *
430
+ * @throws ValidationError for an Admit no local identifier signed or whose retained factors no longer authenticate.
431
+ */
432
+ export declare function rebuildIssuanceAdmit(deps: AdmitDeps, admit: string): Operation<IssuanceAdmit>;
433
+ /**
434
+ * Local abandon: release the DH approval (ephemeral keys, permanent refusal of
435
+ * this operation) and read `abandoned` until the process ends. Does not message the peer and does
436
+ * not undo a retained root or a registry update that was already anchored.
437
+ * Does nothing to an issuance that is already done or ended.
438
+ *
439
+ * @throws ValidationError when no issuance was begun for `grant`.
440
+ */
441
+ export declare function abandonIssuance(ops: IssuanceOperations, grant: string, reason?: string): void;
442
+ export {};
443
+ //# sourceMappingURL=issuance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"issuance.d.ts","sourceRoot":"","sources":["../../../src/app/ipex/issuance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AACH,OAAO,EAML,UAAU,EACV,KAAK,UAAU,EACf,KAAK,UAAU,EAEhB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAQ,KAAK,SAAS,EAAQ,MAAM,WAAW,CAAC;AAEvD,OAAO,EAAE,KAAK,kBAAkB,EAAmB,MAAM,uBAAuB,CAAC;AACjF,OAAO,EAAE,IAAI,EAA8D,MAAM,sBAAsB,CAAC;AACxG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAIzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,cAAc,EACd,KAAK,QAAQ,EACd,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,KAAK,UAAU,EAA6B,KAAK,UAAU,EAAE,MAAM,iCAA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MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,UAAU,CAAC;IAClB,6DAA6D;IAC7D,GAAG,EAAE,MAAM,CAAC;IACZ,kDAAkD;IAClD,IAAI,EAAE,UAAU,CAAC;IACjB,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,2BAA2B;AAC3B,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,KAAK,CAAC,EAAE,cAAc,CAAC;CACxB;AAED;;;;;;GAMG;AACH,wBAAiB,aAAa,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB,GAAG,SAAS,CAAC,aAAa,CAAC,CAiBnH;AAED,qGAAqG;AACrG,wBAAiB,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,QAAQ,EAAE,aAAa,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,CAE9G;AAED;;;;;;;GAOG;AACH,wBAAiB,oBAAoB,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC,aAAa,CAAC,CAe9F;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,SAA0B,GAAG,IAAI,CAS9G"}
@@ -0,0 +1,25 @@
1
+ import type { Hab } from "../identity/habbing.js";
2
+ import { type UnblindingOperations, type UnblindingStatus } from "./unblinding-workflow.js";
3
+ /** A pending Grant addressed to a local identifier. */
4
+ export interface PendingPresentation {
5
+ /** SAID of the Grant exchange. */
6
+ grant: string;
7
+ /** The local identifier it is addressed to. */
8
+ disclosee: string;
9
+ /** The AID that sent it. */
10
+ presenter: string;
11
+ /** SAID of the credential the Grant discloses, when its first node is one. */
12
+ credential?: string;
13
+ /** The Grant's exchange deadline (ISO 8601). */
14
+ deadline: string;
15
+ /** `active`: an Unblind is running for it; `interrupted`: none is, so consent is needed. */
16
+ status: UnblindingStatus;
17
+ }
18
+ /**
19
+ * The pending v2 Grants addressed to a local identifier (to `hab` when given) that are inside their deadline.
20
+ * Mutates nothing.
21
+ */
22
+ export declare function pendingPresentations(ops: UnblindingOperations, { hab }?: {
23
+ hab?: Hab;
24
+ }): PendingPresentation[];
25
+ //# sourceMappingURL=pending-presentations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pending-presentations.d.ts","sourceRoot":"","sources":["../../../src/app/ipex/pending-presentations.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,KAAK,oBAAoB,EAAE,KAAK,gBAAgB,EAAoB,MAAM,0BAA0B,CAAC;AAE9G,uDAAuD;AACvD,MAAM,WAAW,mBAAmB;IAClC,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,SAAS,EAAE,MAAM,CAAC;IAClB,4BAA4B;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,8EAA8E;IAC9E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gDAAgD;IAChD,QAAQ,EAAE,MAAM,CAAC;IACjB,4FAA4F;IAC5F,MAAM,EAAE,gBAAgB,CAAC;CAC1B;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,oBAAoB,EAAE,EAAE,GAAG,EAAE,GAAE;IAAE,GAAG,CAAC,EAAE,GAAG,CAAA;CAAO,GAAG,mBAAmB,EAAE,CAwBlH"}
@@ -0,0 +1,47 @@
1
+ import { type Operation } from "effection";
2
+ import type { Regery } from "../../acdc/registraring.js";
3
+ import type { Exchanger } from "../exchanges/exchanging.js";
4
+ import type { Hab, Habery } from "../identity/habbing.js";
5
+ import type { ProtocolProcessor } from "../protocol/protocol-processing.js";
6
+ import type { Reactor } from "../protocol/reactor.js";
7
+ import type { RuntimeClock } from "../runtime/runtime-clock.js";
8
+ import type { Receiptor } from "../witness/receipting.js";
9
+ import type { IpexV2BodyOptions } from "./ipex-building.js";
10
+ import { type CredentialViews, type DisclosureSelection } from "./ipex-discloser.js";
11
+ /** A partial group file is explicit; prepared means the sender threshold, not issuer consent, is complete. */
12
+ export interface PreparedPresentationFile {
13
+ grant: string;
14
+ wire: Uint8Array;
15
+ prepared: boolean;
16
+ deadline: string | null;
17
+ }
18
+ /** Grant body options of a prepared file. */
19
+ export interface PresentationFileOptions extends IpexV2BodyOptions {
20
+ priorSaid?: string;
21
+ }
22
+ /** A completed prepared Grant imported from its file. */
23
+ export interface ResumedPresentationFile {
24
+ grant: string;
25
+ wire: Uint8Array;
26
+ deadline: string;
27
+ /** Proof support and the completed Grant, in delivery order. */
28
+ delivery: Uint8Array;
29
+ }
30
+ /** Collaborators of the exact-file group presentation; no runtime bundle. */
31
+ export interface PresentationFileDeps {
32
+ readonly hby: Habery;
33
+ readonly rgy: Pick<Regery, "store">;
34
+ readonly exc: Exchanger;
35
+ readonly receiptor: Receiptor;
36
+ readonly reactor: Pick<Reactor, "processBytes">;
37
+ /** Only the sender-threshold KRAM owner is read, to refuse preparation when KRAM is off. */
38
+ readonly protocol: Pick<ProtocolProcessor, "kvy">;
39
+ readonly clock: RuntimeClock;
40
+ /** Embedder inventory the selection reads. */
41
+ readonly views: CredentialViews;
42
+ }
43
+ /** Freeze one selected public view; a group member may append its signature to the same exact proposal file. */
44
+ export declare function preparePresentationFile(deps: PresentationFileDeps, hab: Hab, selection: DisclosureSelection, options: PresentationFileOptions, proposal?: Uint8Array): Operation<PreparedPresentationFile>;
45
+ /** Import only additions to an existing sender-authenticated preparation; missing issuer consent cannot be recreated. */
46
+ export declare function resumePresentationFile(deps: PresentationFileDeps, hab: Hab, said: string, raw: Uint8Array): Operation<ResumedPresentationFile>;
47
+ //# sourceMappingURL=presentation-files.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presentation-files.d.ts","sourceRoot":"","s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