keri-ts 0.11.0 → 2.0.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.
- package/README.md +32 -2
- package/esm/keri/npm/src/_dnt.polyfills.js +36 -0
- package/esm/keri/npm/src/acdc/chaining.js +213 -0
- package/esm/keri/npm/src/acdc/dhking.js +716 -0
- package/esm/keri/npm/src/acdc/messaging.js +2 -0
- package/esm/keri/npm/src/acdc/observing.js +47 -40
- package/esm/keri/npm/src/acdc/regbasing.js +22 -22
- package/esm/keri/npm/src/acdc/regengine.js +88 -119
- package/esm/keri/npm/src/acdc/regeventing.js +163 -44
- package/esm/keri/npm/src/acdc/registering.js +99 -23
- package/esm/keri/npm/src/acdc/registraring.js +82 -46
- package/esm/keri/npm/src/acdc/relating.js +59 -0
- package/esm/keri/npm/src/acdc/salting.js +720 -0
- package/esm/keri/npm/src/acdc/scheming.js +103 -105
- package/esm/keri/npm/src/acdc/unblinding.js +1042 -0
- package/esm/keri/npm/src/app/{authenticating.js → bootstrap/authenticating.js} +40 -39
- package/esm/keri/npm/src/app/bootstrap/bootstrapping.js +109 -0
- package/esm/keri/npm/src/app/bootstrap/oobi-replies.js +113 -0
- package/esm/keri/npm/src/app/{oobiery.js → bootstrap/oobiery.js} +211 -267
- package/esm/keri/npm/src/app/credentials/credential-importing.js +201 -0
- package/esm/keri/npm/src/app/credentials/credential-proposals.js +120 -0
- package/esm/keri/npm/src/app/credentials/credential-revoking.js +165 -0
- package/esm/keri/npm/src/app/credentials/credential-workflows.js +365 -0
- package/esm/keri/npm/src/app/credentials/tel-publishing.js +27 -0
- package/esm/keri/npm/src/app/{verifying.js → credentials/verifying.js} +50 -45
- package/esm/keri/npm/src/app/delivery/forwarding.js +600 -0
- package/esm/keri/npm/src/app/delivery/introducing.js +68 -0
- package/esm/keri/npm/src/app/delivery/reply-streams.js +230 -0
- package/esm/keri/npm/src/app/delivery/respondant.js +159 -0
- package/esm/keri/npm/src/app/delivery/stored-replies.js +53 -0
- package/esm/keri/npm/src/app/exchanges/essr.js +111 -0
- package/esm/keri/npm/src/app/exchanges/exchange-messaging.js +66 -0
- package/esm/keri/npm/src/app/exchanges/exchanging.js +1354 -0
- package/esm/keri/npm/src/app/{challenging.js → identity/challenging.js} +13 -8
- package/esm/keri/npm/src/app/{configing.js → identity/configing.js} +4 -4
- package/esm/keri/npm/src/app/{delegating.js → identity/delegating.js} +118 -40
- package/esm/keri/npm/src/app/{endpoint-roleing.js → identity/endpoint-roleing.js} +43 -39
- package/esm/keri/npm/src/app/{habbing.js → identity/habbing.js} +258 -226
- package/esm/keri/npm/src/app/{keeping.js → identity/keeping.js} +60 -56
- package/esm/keri/npm/src/app/{organizing.js → identity/organizing.js} +47 -21
- package/esm/keri/npm/src/app/{ipex-building.js → ipex/ipex-building.js} +53 -55
- package/esm/keri/npm/src/app/ipex/ipex-credentialing.js +359 -0
- package/esm/keri/npm/src/app/{ipex-graph.js → ipex/ipex-graph.js} +70 -124
- package/esm/keri/npm/src/app/ipex/ipex-grouping.js +664 -0
- package/esm/keri/npm/src/app/ipex/ipex-node-authentication.js +185 -0
- package/esm/keri/npm/src/app/ipex/ipex-v2.js +692 -0
- package/esm/keri/npm/src/app/{ipexing.js → ipex/ipexing.js} +59 -10
- package/esm/keri/npm/src/app/mailbox/forward-handler.js +228 -0
- package/esm/keri/npm/src/app/{mailbox-director.js → mailbox/mailbox-director.js} +146 -139
- package/esm/keri/npm/src/app/mailbox/mailbox-poller.js +305 -0
- package/esm/keri/npm/src/app/mailbox/mailbox-sse.js +254 -0
- package/esm/keri/npm/src/app/{mailboxing.js → mailbox/mailboxing.js} +117 -70
- package/esm/keri/npm/src/app/mailbox/topic-routing.js +54 -0
- package/esm/keri/npm/src/app/multisig/group-members.js +173 -0
- package/esm/keri/npm/src/app/multisig/grouping.js +932 -0
- package/esm/keri/npm/src/app/multisig/multisig-messaging.js +164 -0
- package/esm/keri/npm/src/app/multisig/multisig-workflows.js +821 -0
- package/esm/keri/npm/src/app/{notifying.js → notifications/notifying.js} +23 -50
- package/esm/keri/npm/src/app/notifications/signaling.js +177 -0
- package/esm/keri/npm/src/app/{parsering.js → protocol/parsering.js} +123 -53
- package/esm/keri/npm/src/app/protocol/protocol-processing.js +245 -0
- package/esm/keri/npm/src/app/protocol/reactor.js +55 -0
- package/esm/keri/npm/src/app/queries/query-replies.js +151 -0
- package/esm/keri/npm/src/app/queries/querying.js +306 -0
- package/esm/keri/npm/src/app/queries/witness-inquisitor.js +415 -0
- package/esm/keri/npm/src/app/runtime/abortable.js +103 -0
- package/esm/keri/npm/src/app/runtime/agent-runtime.js +633 -0
- package/esm/keri/npm/src/app/runtime/cue-runtime.js +61 -0
- package/esm/keri/npm/src/app/runtime/runtime-clock.js +6 -0
- package/esm/keri/npm/src/app/{byte-source.js → transport/byte-source.js} +43 -21
- package/esm/keri/npm/src/app/transport/cesr-egress.js +317 -0
- package/esm/keri/npm/src/app/{cesr-http.js → transport/cesr-http.js} +28 -78
- package/esm/keri/npm/src/app/transport/http-client.js +172 -0
- package/esm/keri/npm/src/app/transport/http-messenger.js +52 -0
- package/esm/keri/npm/src/app/transport/http-stream-messenger.js +60 -0
- package/esm/keri/npm/src/app/transport/httping.js +57 -0
- package/esm/keri/npm/src/app/transport/message-source.js +77 -0
- package/esm/keri/npm/src/app/transport/messengering.js +68 -0
- package/esm/keri/npm/src/app/{socket-source.js → transport/socket-source.js} +41 -5
- package/esm/keri/npm/src/app/transport/tcp-egress.js +377 -0
- package/esm/keri/npm/src/app/transport/tcp-messenger.js +162 -0
- package/esm/keri/npm/src/app/transport/tcp-stream-messenger.js +40 -0
- package/esm/keri/npm/src/app/transport/transport-error.js +14 -0
- package/esm/keri/npm/src/app/witness/http-endpoints.js +185 -0
- package/esm/keri/npm/src/app/witness/ingress.js +148 -0
- package/esm/keri/npm/src/app/witness/receipt-client.js +248 -0
- package/esm/keri/npm/src/app/witness/receipt-messages.js +29 -0
- package/esm/keri/npm/src/app/witness/receipting.js +323 -0
- package/esm/keri/npm/src/app/witness/registration.js +50 -0
- package/esm/keri/npm/src/cli/common/bootstrap.js +12 -0
- package/esm/keri/npm/src/{app/cli → cli}/common/context.js +47 -9
- package/esm/keri/npm/src/{app/cli → cli}/common/existing.js +9 -29
- package/esm/keri/npm/src/cli/common/parsing.js +279 -0
- package/esm/keri/npm/src/cli/common/passcode.js +66 -0
- package/esm/keri/npm/src/cli/common/tel-completion.js +24 -0
- package/esm/keri/npm/src/{app/cli → cli}/common/witness-auth.js +2 -2
- package/esm/keri/npm/src/cli/credentials/ipex.js +702 -0
- package/esm/keri/npm/src/cli/credentials/vc.js +399 -0
- package/esm/keri/npm/src/{app/cli → cli/endpoints}/did.js +71 -53
- package/esm/keri/npm/src/{app/cli → cli/endpoints}/ends.js +34 -31
- package/esm/keri/npm/src/{app/cli → cli/endpoints}/loc.js +22 -20
- package/esm/keri/npm/src/cli/endpoints/oobi-clean.js +134 -0
- package/esm/keri/npm/src/{app/cli → cli/endpoints}/oobi.js +37 -36
- package/esm/keri/npm/src/{app/cli → cli/identity}/aid.js +8 -7
- package/esm/keri/npm/src/cli/identity/challenge.js +181 -0
- package/esm/keri/npm/src/{app/cli → cli/identity}/delegate.js +88 -73
- package/esm/keri/npm/src/{app/cli → cli/identity}/export.js +9 -8
- package/esm/keri/npm/src/cli/identity/incept.js +181 -0
- package/esm/keri/npm/src/cli/identity/init.js +153 -0
- package/esm/keri/npm/src/cli/identity/interact.js +84 -0
- package/esm/keri/npm/src/{app/cli → cli/identity}/list.js +7 -6
- package/esm/keri/npm/src/cli/identity/rotate.js +172 -0
- package/esm/keri/npm/src/cli/index.js +38 -0
- package/esm/keri/npm/src/{app/cli → cli/messaging}/exchange.js +24 -24
- package/esm/keri/npm/src/cli/messaging/multisig.js +569 -0
- package/esm/keri/npm/src/{app/cli → cli/messaging}/notifications.js +26 -22
- package/esm/keri/npm/src/{app/cli → cli}/output.js +1 -1
- package/esm/keri/npm/src/cli/tools/annotate.js +25 -0
- package/esm/keri/npm/src/{app/cli → cli/tools}/benchmark.js +18 -9
- package/esm/keri/npm/src/{app/cli → cli/tools}/db-dump.js +14 -27
- package/esm/keri/npm/src/{app/cli → cli/tools}/saidify.js +3 -2
- package/esm/keri/npm/src/{app/cli → cli/tools}/sign.js +16 -10
- package/esm/keri/npm/src/{app/cli → cli/tools}/verify.js +10 -10
- package/esm/keri/npm/src/core/attachment-countering.js +31 -1
- package/esm/keri/npm/src/core/deck.js +5 -44
- package/esm/keri/npm/src/core/dispatch.js +10 -2
- package/esm/keri/npm/src/core/errors.js +5 -10
- package/esm/keri/npm/src/core/{exchange-proofing.js → exchange/exchange-proofing.js} +32 -2
- package/esm/keri/npm/src/core/{protocol-exchanging.js → exchange/protocol-exchanging.js} +47 -4
- package/esm/keri/npm/src/core/genus-framing.js +44 -0
- package/esm/keri/npm/src/core/{eventing.js → kel/eventing.js} +209 -390
- package/esm/keri/npm/src/core/kel/kever-decisions.js +70 -0
- package/esm/keri/npm/src/core/{kever.js → kel/kever.js} +84 -167
- package/esm/keri/npm/src/core/logger.js +3 -3
- package/esm/keri/npm/src/core/{kram-policy.js → mailbox/kram-policy.js} +14 -4
- package/esm/keri/npm/src/core/{kram-pruning.js → mailbox/kram-pruning.js} +5 -15
- package/esm/keri/npm/src/core/{kram-signatures.js → mailbox/kram-signatures.js} +1 -1
- package/esm/keri/npm/src/core/mailbox/kram-staging.js +149 -0
- package/esm/keri/npm/src/core/{kram-time.js → mailbox/kram-time.js} +9 -15
- package/esm/keri/npm/src/core/mailbox/kraming.js +78 -0
- package/esm/keri/npm/src/core/protocol-eventing.js +6 -1
- package/esm/keri/npm/src/core/protocol-serialization.js +9 -34
- package/esm/keri/npm/src/core/protocol-vdr-eventing.js +10 -11
- package/esm/keri/npm/src/core/records.js +0 -19
- package/esm/keri/npm/src/core/routing.js +187 -199
- package/esm/keri/npm/src/db/baser-defaults.js +11 -0
- package/esm/keri/npm/src/db/basing.js +224 -401
- package/esm/keri/npm/src/db/core/keys.js +2 -2
- package/esm/keri/npm/src/db/core/lmdber.js +123 -149
- package/esm/keri/npm/src/db/core/path-manager.js +2 -4
- package/esm/keri/npm/src/db/escrowing.js +82 -200
- package/esm/keri/npm/src/db/exchange/exchange-nests.js +54 -0
- package/esm/keri/npm/src/db/exchange/exchange-records.js +7 -0
- package/esm/keri/npm/src/db/index.js +5 -6
- package/esm/keri/npm/src/db/keeping.js +123 -6
- package/esm/keri/npm/src/db/{kram-factors.js → mailbox/kram-factors.js} +17 -50
- package/esm/keri/npm/src/db/{mailboxing.js → mailbox/mailboxing.js} +5 -8
- package/esm/keri/npm/src/db/reger.js +48 -69
- package/esm/keri/npm/src/db/{kel-replay.js → replay/kel-replay.js} +12 -24
- package/esm/keri/npm/src/db/{tel-replay.js → replay/tel-replay.js} +38 -36
- package/esm/keri/npm/src/db/{witness-replay.js → replay/witness-replay.js} +8 -14
- package/esm/keri/npm/src/db/subing.js +2 -11
- package/esm/keri/npm/src/did/keri/resolving.js +4 -18
- package/esm/keri/npm/src/did/webs/artifacts.js +21 -24
- package/esm/keri/npm/src/did/webs/designated-aliases.js +18 -48
- package/esm/keri/npm/src/did/webs/documenting.js +8 -8
- package/esm/keri/npm/src/did/webs/resolving.js +73 -74
- package/esm/keri/npm/src/library/index.js +1 -1
- package/esm/keri/npm/src/npm/cli.js +1 -1
- package/esm/keri/npm/src/npm/index.js +1 -1
- package/esm/keri/npm/src/runtime/index.js +105 -74
- package/esm/keri/npm/src/vdr/backer-state.js +55 -0
- package/esm/keri/npm/src/vdr/credential-tsn-record.js +59 -0
- package/esm/keri/npm/src/vdr/credentialing.js +84 -109
- package/esm/keri/npm/src/vdr/eventing.js +633 -251
- package/esm/keri/npm/src/vdr/registry-tsn-record.js +55 -0
- package/esm/keri/npm/src/vdr/revoking.js +90 -0
- package/esm/keri/npm/src/vdr/tel-anchor.js +29 -0
- package/esm/keri/npm/src/vdr/tel-publication.js +178 -0
- package/esm/keri/npm/src/vdr/tsn-query.js +15 -10
- package/esm/keri/npm/src/{app/version.js → version.js} +2 -2
- package/package.json +7 -21
- package/types/_dnt.polyfills.d.ts +55 -0
- package/types/_dnt.polyfills.d.ts.map +1 -1
- package/types/acdc/chaining.d.ts +35 -0
- package/types/acdc/chaining.d.ts.map +1 -0
- package/types/acdc/dhking.d.ts +136 -0
- package/types/acdc/dhking.d.ts.map +1 -0
- package/types/acdc/messaging.d.ts.map +1 -1
- package/types/acdc/observing.d.ts +19 -15
- package/types/acdc/observing.d.ts.map +1 -1
- package/types/acdc/regbasing.d.ts +8 -9
- package/types/acdc/regbasing.d.ts.map +1 -1
- package/types/acdc/regengine.d.ts +14 -28
- package/types/acdc/regengine.d.ts.map +1 -1
- package/types/acdc/regeventing.d.ts +24 -7
- package/types/acdc/regeventing.d.ts.map +1 -1
- package/types/acdc/registering.d.ts +27 -11
- package/types/acdc/registering.d.ts.map +1 -1
- package/types/acdc/registraring.d.ts +22 -22
- package/types/acdc/registraring.d.ts.map +1 -1
- package/types/acdc/relating.d.ts +21 -0
- package/types/acdc/relating.d.ts.map +1 -0
- package/types/acdc/salting.d.ts +241 -0
- package/types/acdc/salting.d.ts.map +1 -0
- package/types/acdc/scheming.d.ts +3 -2
- package/types/acdc/scheming.d.ts.map +1 -1
- package/types/acdc/unblinding.d.ts +150 -0
- package/types/acdc/unblinding.d.ts.map +1 -0
- package/types/app/bootstrap/authenticating.d.ts +54 -0
- package/types/app/bootstrap/authenticating.d.ts.map +1 -0
- package/types/app/bootstrap/bootstrapping.d.ts +45 -0
- package/types/app/bootstrap/bootstrapping.d.ts.map +1 -0
- package/types/app/bootstrap/oobi-replies.d.ts +8 -0
- package/types/app/bootstrap/oobi-replies.d.ts.map +1 -0
- package/types/app/{oobiery.d.ts → bootstrap/oobiery.d.ts} +98 -27
- package/types/app/bootstrap/oobiery.d.ts.map +1 -0
- package/types/app/credentials/credential-importing.d.ts +29 -0
- package/types/app/credentials/credential-importing.d.ts.map +1 -0
- package/types/app/credentials/credential-proposals.d.ts +27 -0
- package/types/app/credentials/credential-proposals.d.ts.map +1 -0
- package/types/app/credentials/credential-revoking.d.ts +44 -0
- package/types/app/credentials/credential-revoking.d.ts.map +1 -0
- package/types/app/credentials/credential-workflows.d.ts +149 -0
- package/types/app/credentials/credential-workflows.d.ts.map +1 -0
- package/types/app/{schema-resolving.d.ts → credentials/schema-resolving.d.ts} +2 -2
- package/types/app/credentials/schema-resolving.d.ts.map +1 -0
- package/types/app/credentials/tel-publishing.d.ts +16 -0
- package/types/app/credentials/tel-publishing.d.ts.map +1 -0
- package/types/app/{verifying.d.ts → credentials/verifying.d.ts} +20 -9
- package/types/app/credentials/verifying.d.ts.map +1 -0
- package/types/app/delivery/forwarding.d.ts +227 -0
- package/types/app/delivery/forwarding.d.ts.map +1 -0
- package/types/app/delivery/introducing.d.ts +21 -0
- package/types/app/delivery/introducing.d.ts.map +1 -0
- package/types/app/delivery/reply-streams.d.ts +49 -0
- package/types/app/delivery/reply-streams.d.ts.map +1 -0
- package/types/app/delivery/respondant.d.ts +52 -0
- package/types/app/delivery/respondant.d.ts.map +1 -0
- package/types/app/delivery/stored-replies.d.ts +11 -0
- package/types/app/delivery/stored-replies.d.ts.map +1 -0
- package/types/app/exchanges/essr.d.ts +53 -0
- package/types/app/exchanges/essr.d.ts.map +1 -0
- package/types/app/exchanges/exchange-messaging.d.ts +73 -0
- package/types/app/exchanges/exchange-messaging.d.ts.map +1 -0
- package/types/app/exchanges/exchanging.d.ts +379 -0
- package/types/app/exchanges/exchanging.d.ts.map +1 -0
- package/types/app/{challenging.d.ts → identity/challenging.d.ts} +9 -3
- package/types/app/identity/challenging.d.ts.map +1 -0
- package/types/app/{configing.d.ts → identity/configing.d.ts} +1 -1
- package/types/app/identity/configing.d.ts.map +1 -0
- package/types/app/{delegating.d.ts → identity/delegating.d.ts} +59 -17
- package/types/app/identity/delegating.d.ts.map +1 -0
- package/types/app/identity/endpoint-roleing.d.ts +54 -0
- package/types/app/identity/endpoint-roleing.d.ts.map +1 -0
- package/types/app/{habbing.d.ts → identity/habbing.d.ts} +86 -54
- package/types/app/identity/habbing.d.ts.map +1 -0
- package/types/app/{keeping.d.ts → identity/keeping.d.ts} +19 -5
- package/types/app/identity/keeping.d.ts.map +1 -0
- package/types/app/{organizing.d.ts → identity/organizing.d.ts} +19 -4
- package/types/app/identity/organizing.d.ts.map +1 -0
- package/types/app/{ipex-building.d.ts → ipex/ipex-building.d.ts} +5 -5
- package/types/app/ipex/ipex-building.d.ts.map +1 -0
- package/types/app/{ipex-credentialing.d.ts → ipex/ipex-credentialing.d.ts} +42 -10
- package/types/app/ipex/ipex-credentialing.d.ts.map +1 -0
- package/types/app/ipex/ipex-graph.d.ts +28 -0
- package/types/app/ipex/ipex-graph.d.ts.map +1 -0
- package/types/app/ipex/ipex-grouping.d.ts +112 -0
- package/types/app/ipex/ipex-grouping.d.ts.map +1 -0
- package/types/app/ipex/ipex-node-authentication.d.ts +32 -0
- package/types/app/ipex/ipex-node-authentication.d.ts.map +1 -0
- package/types/app/ipex/ipex-v2.d.ts +71 -0
- package/types/app/ipex/ipex-v2.d.ts.map +1 -0
- package/types/app/{ipexing.d.ts → ipex/ipexing.d.ts} +21 -8
- package/types/app/ipex/ipexing.d.ts.map +1 -0
- package/types/app/mailbox/forward-handler.d.ts +68 -0
- package/types/app/mailbox/forward-handler.d.ts.map +1 -0
- package/types/app/mailbox/mailbox-director.d.ts +252 -0
- package/types/app/mailbox/mailbox-director.d.ts.map +1 -0
- package/types/app/mailbox/mailbox-poller.d.ts +149 -0
- package/types/app/mailbox/mailbox-poller.d.ts.map +1 -0
- package/types/app/mailbox/mailbox-sse.d.ts +63 -0
- package/types/app/mailbox/mailbox-sse.d.ts.map +1 -0
- package/types/app/{mailboxing.d.ts → mailbox/mailboxing.d.ts} +92 -43
- package/types/app/mailbox/mailboxing.d.ts.map +1 -0
- package/types/app/mailbox/topic-routing.d.ts +18 -0
- package/types/app/mailbox/topic-routing.d.ts.map +1 -0
- package/types/app/multisig/group-members.d.ts +60 -0
- package/types/app/multisig/group-members.d.ts.map +1 -0
- package/types/app/multisig/grouping.d.ts +317 -0
- package/types/app/multisig/grouping.d.ts.map +1 -0
- package/types/app/multisig/multisig-messaging.d.ts +97 -0
- package/types/app/multisig/multisig-messaging.d.ts.map +1 -0
- package/types/app/multisig/multisig-workflows.d.ts +85 -0
- package/types/app/multisig/multisig-workflows.d.ts.map +1 -0
- package/types/app/{notifying.d.ts → notifications/notifying.d.ts} +5 -6
- package/types/app/notifications/notifying.d.ts.map +1 -0
- package/types/app/notifications/signaling.d.ts +68 -0
- package/types/app/notifications/signaling.d.ts.map +1 -0
- package/types/app/protocol/parsering.d.ts +128 -0
- package/types/app/protocol/parsering.d.ts.map +1 -0
- package/types/app/{protocol-host-policy.d.ts → protocol/protocol-host-policy.d.ts} +1 -10
- package/types/app/protocol/protocol-host-policy.d.ts.map +1 -0
- package/types/app/protocol/protocol-processing.d.ts +140 -0
- package/types/app/protocol/protocol-processing.d.ts.map +1 -0
- package/types/app/protocol/reactor.d.ts +43 -0
- package/types/app/protocol/reactor.d.ts.map +1 -0
- package/types/app/queries/query-replies.d.ts +78 -0
- package/types/app/queries/query-replies.d.ts.map +1 -0
- package/types/app/queries/querying.d.ts +155 -0
- package/types/app/queries/querying.d.ts.map +1 -0
- package/types/app/queries/witness-inquisitor.d.ts +150 -0
- package/types/app/queries/witness-inquisitor.d.ts.map +1 -0
- package/types/app/runtime/abortable.d.ts +39 -0
- package/types/app/runtime/abortable.d.ts.map +1 -0
- package/types/app/runtime/agent-runtime.d.ts +348 -0
- package/types/app/runtime/agent-runtime.d.ts.map +1 -0
- package/types/app/runtime/cue-runtime.d.ts +33 -0
- package/types/app/runtime/cue-runtime.d.ts.map +1 -0
- package/types/app/runtime/runtime-clock.d.ts +28 -0
- package/types/app/runtime/runtime-clock.d.ts.map +1 -0
- package/types/app/runtime/runtime-turn.d.ts.map +1 -0
- package/types/app/transport/byte-source.d.ts +41 -0
- package/types/app/transport/byte-source.d.ts.map +1 -0
- package/types/app/transport/cesr-egress.d.ts +117 -0
- package/types/app/transport/cesr-egress.d.ts.map +1 -0
- package/types/app/{cesr-http.d.ts → transport/cesr-http.d.ts} +9 -33
- package/types/app/transport/cesr-http.d.ts.map +1 -0
- package/types/app/transport/http-client.d.ts +99 -0
- package/types/app/transport/http-client.d.ts.map +1 -0
- package/types/app/transport/http-messenger.d.ts +37 -0
- package/types/app/transport/http-messenger.d.ts.map +1 -0
- package/types/app/transport/http-stream-messenger.d.ts +30 -0
- package/types/app/transport/http-stream-messenger.d.ts.map +1 -0
- package/types/app/transport/httping.d.ts +19 -0
- package/types/app/transport/httping.d.ts.map +1 -0
- package/types/app/transport/message-source.d.ts +22 -0
- package/types/app/transport/message-source.d.ts.map +1 -0
- package/types/app/transport/messengering.d.ts +41 -0
- package/types/app/transport/messengering.d.ts.map +1 -0
- package/types/app/{socket-source.d.ts → transport/socket-source.d.ts} +10 -3
- package/types/app/transport/socket-source.d.ts.map +1 -0
- package/types/app/transport/tcp-egress.d.ts +118 -0
- package/types/app/transport/tcp-egress.d.ts.map +1 -0
- package/types/app/transport/tcp-messenger.d.ts +69 -0
- package/types/app/transport/tcp-messenger.d.ts.map +1 -0
- package/types/app/transport/tcp-stream-messenger.d.ts +25 -0
- package/types/app/transport/tcp-stream-messenger.d.ts.map +1 -0
- package/types/app/transport/transport-error.d.ts +12 -0
- package/types/app/transport/transport-error.d.ts.map +1 -0
- package/types/app/witness/http-endpoints.d.ts +77 -0
- package/types/app/witness/http-endpoints.d.ts.map +1 -0
- package/types/app/witness/ingress.d.ts +65 -0
- package/types/app/witness/ingress.d.ts.map +1 -0
- package/types/app/witness/receipt-client.d.ts +82 -0
- package/types/app/witness/receipt-client.d.ts.map +1 -0
- package/types/app/witness/receipt-messages.d.ts +21 -0
- package/types/app/witness/receipt-messages.d.ts.map +1 -0
- package/types/app/witness/receipting.d.ts +117 -0
- package/types/app/witness/receipting.d.ts.map +1 -0
- package/types/app/witness/registration.d.ts +27 -0
- package/types/app/witness/registration.d.ts.map +1 -0
- package/types/cli/common/bootstrap.d.ts +5 -0
- package/types/cli/common/bootstrap.d.ts.map +1 -0
- package/types/{app/cli → cli}/common/context.d.ts +10 -9
- package/types/cli/common/context.d.ts.map +1 -0
- package/types/{app/cli → cli}/common/existing.d.ts +2 -8
- package/types/cli/common/existing.d.ts.map +1 -0
- package/types/{app/cli → cli}/common/parsing.d.ts +26 -15
- package/types/cli/common/parsing.d.ts.map +1 -0
- package/types/cli/common/passcode.d.ts +9 -0
- package/types/cli/common/passcode.d.ts.map +1 -0
- package/types/cli/common/rendering.d.ts.map +1 -0
- package/types/cli/common/tel-completion.d.ts +8 -0
- package/types/cli/common/tel-completion.d.ts.map +1 -0
- package/types/{app/cli → cli}/common/witness-auth.d.ts +1 -1
- package/types/cli/common/witness-auth.d.ts.map +1 -0
- package/types/cli/credentials/ipex.d.ts +110 -0
- package/types/cli/credentials/ipex.d.ts.map +1 -0
- package/types/cli/credentials/vc.d.ts +42 -0
- package/types/cli/credentials/vc.d.ts.map +1 -0
- package/types/{app/cli → cli/endpoints}/did.d.ts +5 -1
- package/types/cli/endpoints/did.d.ts.map +1 -0
- package/types/{app/cli → cli/endpoints}/ends.d.ts +9 -1
- package/types/cli/endpoints/ends.d.ts.map +1 -0
- package/types/cli/endpoints/loc.d.ts.map +1 -0
- package/types/cli/endpoints/oobi-clean.d.ts +8 -0
- package/types/cli/endpoints/oobi-clean.d.ts.map +1 -0
- package/types/{app/cli → cli/endpoints}/oobi.d.ts +3 -1
- package/types/cli/endpoints/oobi.d.ts.map +1 -0
- package/types/cli/identity/aid.d.ts.map +1 -0
- package/types/{app/cli → cli/identity}/challenge.d.ts +5 -1
- package/types/cli/identity/challenge.d.ts.map +1 -0
- package/types/cli/identity/delegate.d.ts +4 -0
- package/types/cli/identity/delegate.d.ts.map +1 -0
- package/types/cli/identity/export.d.ts.map +1 -0
- package/types/{app/cli → cli/identity}/incept.d.ts +2 -0
- package/types/cli/identity/incept.d.ts.map +1 -0
- package/types/{app/cli → cli/identity}/init.d.ts +2 -0
- package/types/cli/identity/init.d.ts.map +1 -0
- package/types/{app/cli → cli/identity}/interact.d.ts +2 -0
- package/types/cli/identity/interact.d.ts.map +1 -0
- package/types/cli/identity/list.d.ts.map +1 -0
- package/types/{app/cli → cli/identity}/rotate.d.ts +9 -2
- package/types/cli/identity/rotate.d.ts.map +1 -0
- package/types/cli/index.d.ts +39 -0
- package/types/cli/index.d.ts.map +1 -0
- package/types/{app/cli → cli/messaging}/exchange.d.ts +3 -1
- package/types/cli/messaging/exchange.d.ts.map +1 -0
- package/types/cli/messaging/multisig.d.ts +29 -0
- package/types/cli/messaging/multisig.d.ts.map +1 -0
- package/types/cli/messaging/notifications.d.ts.map +1 -0
- package/types/cli/output.d.ts.map +1 -0
- package/types/cli/tools/annotate-color.d.ts.map +1 -0
- package/types/cli/tools/annotate.d.ts.map +1 -0
- package/types/cli/tools/benchmark.d.ts.map +1 -0
- package/types/{app/cli → cli/tools}/db-dump.d.ts +0 -2
- package/types/cli/tools/db-dump.d.ts.map +1 -0
- package/types/cli/tools/saidify.d.ts.map +1 -0
- package/types/{app/cli → cli/tools}/sign.d.ts +2 -0
- package/types/cli/tools/sign.d.ts.map +1 -0
- package/types/cli/tools/verify.d.ts.map +1 -0
- package/types/core/attachment-countering.d.ts +10 -1
- package/types/core/attachment-countering.d.ts.map +1 -1
- package/types/core/cues.d.ts +146 -57
- package/types/core/cues.d.ts.map +1 -1
- package/types/core/deck.d.ts +2 -12
- package/types/core/deck.d.ts.map +1 -1
- package/types/core/dispatch.d.ts +7 -3
- package/types/core/dispatch.d.ts.map +1 -1
- package/types/core/errors.d.ts +4 -4
- package/types/core/errors.d.ts.map +1 -1
- package/types/core/{exchange-proofing.d.ts → exchange/exchange-proofing.d.ts} +9 -2
- package/types/core/exchange/exchange-proofing.d.ts.map +1 -0
- package/types/core/{protocol-exchanging.d.ts → exchange/protocol-exchanging.d.ts} +18 -2
- package/types/core/exchange/protocol-exchanging.d.ts.map +1 -0
- package/types/core/genus-framing.d.ts +12 -0
- package/types/core/genus-framing.d.ts.map +1 -0
- package/types/core/{eventing.d.ts → kel/eventing.d.ts} +37 -48
- package/types/core/kel/eventing.d.ts.map +1 -0
- package/types/core/{kever-decisions.d.ts → kel/kever-decisions.d.ts} +36 -22
- package/types/core/kel/kever-decisions.d.ts.map +1 -0
- package/types/core/{kever.d.ts → kel/kever.d.ts} +13 -47
- package/types/core/kel/kever.d.ts.map +1 -0
- package/types/core/kel/witnesses.d.ts.map +1 -0
- package/types/core/logger.d.ts +1 -1
- package/types/core/logger.d.ts.map +1 -1
- package/types/core/{kram-auth.d.ts → mailbox/kram-auth.d.ts} +2 -2
- package/types/core/mailbox/kram-auth.d.ts.map +1 -0
- package/types/core/{kram-policy.d.ts → mailbox/kram-policy.d.ts} +2 -2
- package/types/core/mailbox/kram-policy.d.ts.map +1 -0
- package/types/core/{kram-pruning.d.ts → mailbox/kram-pruning.d.ts} +3 -3
- package/types/core/{kram-pruning.d.ts.map → mailbox/kram-pruning.d.ts.map} +1 -1
- package/types/core/{kram-signatures.d.ts → mailbox/kram-signatures.d.ts} +3 -3
- package/types/core/mailbox/kram-signatures.d.ts.map +1 -0
- package/types/core/mailbox/kram-staging.d.ts +30 -0
- package/types/core/mailbox/kram-staging.d.ts.map +1 -0
- package/types/core/{kram-time.d.ts → mailbox/kram-time.d.ts} +5 -11
- package/types/core/mailbox/kram-time.d.ts.map +1 -0
- package/types/core/mailbox/kraming.d.ts +42 -0
- package/types/core/mailbox/kraming.d.ts.map +1 -0
- package/types/core/mailbox/mailbox-topics.d.ts.map +1 -0
- package/types/core/protocol-eventing.d.ts +5 -0
- package/types/core/protocol-eventing.d.ts.map +1 -1
- package/types/core/protocol-serialization.d.ts +1 -1
- package/types/core/protocol-serialization.d.ts.map +1 -1
- package/types/core/protocol-vdr-eventing.d.ts +7 -5
- package/types/core/protocol-vdr-eventing.d.ts.map +1 -1
- package/types/core/records.d.ts +15 -50
- package/types/core/records.d.ts.map +1 -1
- package/types/core/routing.d.ts +76 -46
- package/types/core/routing.d.ts.map +1 -1
- package/types/db/baser-defaults.d.ts +5 -0
- package/types/db/baser-defaults.d.ts.map +1 -0
- package/types/db/basing.d.ts +70 -75
- package/types/db/basing.d.ts.map +1 -1
- package/types/db/core/keys.d.ts.map +1 -1
- package/types/db/core/lmdber.d.ts +21 -23
- package/types/db/core/lmdber.d.ts.map +1 -1
- package/types/db/core/path-manager.d.ts.map +1 -1
- package/types/db/escrowing.d.ts +12 -49
- package/types/db/escrowing.d.ts.map +1 -1
- package/types/db/exchange/exchange-nests.d.ts +12 -0
- package/types/db/exchange/exchange-nests.d.ts.map +1 -0
- package/types/db/exchange/exchange-records.d.ts +38 -0
- package/types/db/exchange/exchange-records.d.ts.map +1 -0
- package/types/db/index.d.ts +5 -6
- package/types/db/index.d.ts.map +1 -1
- package/types/db/keeping.d.ts +19 -1
- package/types/db/keeping.d.ts.map +1 -1
- package/types/db/koming.d.ts +1 -1
- package/types/db/koming.d.ts.map +1 -1
- package/types/db/{kram-factors.d.ts → mailbox/kram-factors.d.ts} +3 -5
- package/types/db/mailbox/kram-factors.d.ts.map +1 -0
- package/types/db/{mailboxing.d.ts → mailbox/mailboxing.d.ts} +3 -4
- package/types/db/mailbox/mailboxing.d.ts.map +1 -0
- package/types/db/reger.d.ts +10 -12
- package/types/db/reger.d.ts.map +1 -1
- package/types/db/{kel-replay.d.ts → replay/kel-replay.d.ts} +2 -6
- package/types/db/replay/kel-replay.d.ts.map +1 -0
- package/types/db/{tel-replay.d.ts → replay/tel-replay.d.ts} +13 -8
- package/types/db/replay/tel-replay.d.ts.map +1 -0
- package/types/db/{witness-replay.d.ts → replay/witness-replay.d.ts} +2 -3
- package/types/db/replay/witness-replay.d.ts.map +1 -0
- package/types/db/subing.d.ts +1 -5
- package/types/db/subing.d.ts.map +1 -1
- package/types/did/keri/resolving.d.ts +5 -10
- package/types/did/keri/resolving.d.ts.map +1 -1
- package/types/did/webs/artifacts.d.ts +5 -5
- package/types/did/webs/artifacts.d.ts.map +1 -1
- package/types/did/webs/designated-aliases.d.ts +6 -5
- package/types/did/webs/designated-aliases.d.ts.map +1 -1
- package/types/did/webs/documenting.d.ts +6 -5
- package/types/did/webs/documenting.d.ts.map +1 -1
- package/types/did/webs/resolving.d.ts +13 -3
- package/types/did/webs/resolving.d.ts.map +1 -1
- package/types/library/index.d.ts +1 -1
- package/types/library/index.d.ts.map +1 -1
- package/types/npm/cli.d.ts +1 -1
- package/types/npm/cli.d.ts.map +1 -1
- package/types/npm/index.d.ts +1 -1
- package/types/npm/index.d.ts.map +1 -1
- package/types/runtime/index.d.ts +109 -76
- package/types/runtime/index.d.ts.map +1 -1
- package/types/vdr/backer-state.d.ts +22 -0
- package/types/vdr/backer-state.d.ts.map +1 -0
- package/types/vdr/credential-tsn-record.d.ts +13 -0
- package/types/vdr/credential-tsn-record.d.ts.map +1 -0
- package/types/vdr/credentialing.d.ts +16 -27
- package/types/vdr/credentialing.d.ts.map +1 -1
- package/types/vdr/eventing.d.ts +66 -23
- package/types/vdr/eventing.d.ts.map +1 -1
- package/types/vdr/registry-tsn-record.d.ts +6 -0
- package/types/vdr/registry-tsn-record.d.ts.map +1 -0
- package/types/vdr/revoking.d.ts +18 -0
- package/types/vdr/revoking.d.ts.map +1 -0
- package/types/vdr/tel-anchor.d.ts +10 -0
- package/types/vdr/tel-anchor.d.ts.map +1 -0
- package/types/vdr/tel-publication.d.ts +49 -0
- package/types/vdr/tel-publication.d.ts.map +1 -0
- package/types/vdr/tsn-query.d.ts +9 -4
- package/types/vdr/tsn-query.d.ts.map +1 -1
- package/types/{app/version.d.ts → version.d.ts} +2 -2
- package/types/version.d.ts.map +1 -0
- package/esm/keri/npm/src/app/abortable.js +0 -27
- package/esm/keri/npm/src/app/agent-runtime.js +0 -638
- package/esm/keri/npm/src/app/cesr-egress.js +0 -308
- package/esm/keri/npm/src/app/cesr-output.js +0 -12
- package/esm/keri/npm/src/app/cli/annotate.js +0 -24
- package/esm/keri/npm/src/app/cli/challenge.js +0 -168
- package/esm/keri/npm/src/app/cli/common/displaying.js +0 -43
- package/esm/keri/npm/src/app/cli/common/parsing.js +0 -215
- package/esm/keri/npm/src/app/cli/incept.js +0 -187
- package/esm/keri/npm/src/app/cli/index.js +0 -36
- package/esm/keri/npm/src/app/cli/init.js +0 -155
- package/esm/keri/npm/src/app/cli/interact.js +0 -72
- package/esm/keri/npm/src/app/cli/ipex.js +0 -453
- package/esm/keri/npm/src/app/cli/multisig.js +0 -474
- package/esm/keri/npm/src/app/cli/query.js +0 -143
- package/esm/keri/npm/src/app/cli/rotate.js +0 -171
- package/esm/keri/npm/src/app/cli/vc.js +0 -284
- package/esm/keri/npm/src/app/cli/verifier.js +0 -96
- package/esm/keri/npm/src/app/credential-workflows.js +0 -431
- package/esm/keri/npm/src/app/cue-delivery.js +0 -171
- package/esm/keri/npm/src/app/cue-preparation.js +0 -124
- package/esm/keri/npm/src/app/cue-route.js +0 -64
- package/esm/keri/npm/src/app/cue-runtime.js +0 -104
- package/esm/keri/npm/src/app/direct-reply-delivery.js +0 -282
- package/esm/keri/npm/src/app/essr.js +0 -235
- package/esm/keri/npm/src/app/exchanging.js +0 -1219
- package/esm/keri/npm/src/app/forwarding.js +0 -1346
- package/esm/keri/npm/src/app/group-members.js +0 -37
- package/esm/keri/npm/src/app/grouping.js +0 -534
- package/esm/keri/npm/src/app/httping.js +0 -130
- package/esm/keri/npm/src/app/ipex-credentialing.js +0 -245
- package/esm/keri/npm/src/app/ipex-grouping.js +0 -317
- package/esm/keri/npm/src/app/ipex-v2.js +0 -542
- package/esm/keri/npm/src/app/mailbox-sse.js +0 -257
- package/esm/keri/npm/src/app/multisig-workflows.js +0 -537
- package/esm/keri/npm/src/app/oobi-replies.js +0 -194
- package/esm/keri/npm/src/app/query-replies.js +0 -181
- package/esm/keri/npm/src/app/querying.js +0 -1040
- package/esm/keri/npm/src/app/reactor.js +0 -517
- package/esm/keri/npm/src/app/reply-streams.js +0 -304
- package/esm/keri/npm/src/app/respondant.js +0 -173
- package/esm/keri/npm/src/app/runtime-deliveries.js +0 -510
- package/esm/keri/npm/src/app/runtime-services.js +0 -25
- package/esm/keri/npm/src/app/signaling.js +0 -388
- package/esm/keri/npm/src/app/stored-replies.js +0 -85
- package/esm/keri/npm/src/app/tcp-egress.js +0 -334
- package/esm/keri/npm/src/app/verifier-agent.js +0 -461
- package/esm/keri/npm/src/app/witnessing.js +0 -956
- package/esm/keri/npm/src/core/cue-admission.js +0 -419
- package/esm/keri/npm/src/core/index.js +0 -23
- package/esm/keri/npm/src/core/kever-decisions.js +0 -63
- package/esm/keri/npm/src/core/kram-handoff.js +0 -148
- package/esm/keri/npm/src/core/kram-staging.js +0 -211
- package/esm/keri/npm/src/core/kraming.js +0 -99
- package/esm/keri/npm/src/db/exchange-nests.js +0 -175
- package/esm/keri/npm/src/db/exchange-records.js +0 -7
- package/esm/keri/npm/src/db/kram-snapshots.js +0 -216
- package/esm/keri/npm/src/db/mailbox-inbox.js +0 -206
- package/esm/keri/npm/src/db/outboxing.js +0 -371
- package/esm/keri/npm/src/db/payload-archive.js +0 -402
- package/esm/keri/npm/src/db/payload-store.js +0 -416
- package/esm/keri/npm/src/db/payload-view.js +0 -23
- package/esm/keri/npm/src/db/verifier-cueing.js +0 -132
- package/esm/keri/npm/src/vdr/credential-tsn.js +0 -218
- package/esm/keri/npm/src/vdr/registry-tsn.js +0 -218
- package/types/app/abortable.d.ts +0 -11
- package/types/app/abortable.d.ts.map +0 -1
- package/types/app/agent-runtime.d.ts +0 -284
- package/types/app/agent-runtime.d.ts.map +0 -1
- package/types/app/authenticating.d.ts +0 -36
- package/types/app/authenticating.d.ts.map +0 -1
- package/types/app/byte-source.d.ts +0 -16
- package/types/app/byte-source.d.ts.map +0 -1
- package/types/app/cesr-egress.d.ts +0 -48
- package/types/app/cesr-egress.d.ts.map +0 -1
- package/types/app/cesr-http.d.ts.map +0 -1
- package/types/app/cesr-output.d.ts +0 -5
- package/types/app/cesr-output.d.ts.map +0 -1
- package/types/app/challenging.d.ts.map +0 -1
- package/types/app/cli/aid.d.ts.map +0 -1
- package/types/app/cli/annotate-color.d.ts.map +0 -1
- package/types/app/cli/annotate.d.ts.map +0 -1
- package/types/app/cli/benchmark.d.ts.map +0 -1
- package/types/app/cli/challenge.d.ts.map +0 -1
- package/types/app/cli/common/context.d.ts.map +0 -1
- package/types/app/cli/common/displaying.d.ts +0 -12
- package/types/app/cli/common/displaying.d.ts.map +0 -1
- package/types/app/cli/common/existing.d.ts.map +0 -1
- package/types/app/cli/common/parsing.d.ts.map +0 -1
- package/types/app/cli/common/rendering.d.ts.map +0 -1
- package/types/app/cli/common/witness-auth.d.ts.map +0 -1
- package/types/app/cli/db-dump.d.ts.map +0 -1
- package/types/app/cli/delegate.d.ts +0 -26
- package/types/app/cli/delegate.d.ts.map +0 -1
- package/types/app/cli/did.d.ts.map +0 -1
- package/types/app/cli/ends.d.ts.map +0 -1
- package/types/app/cli/exchange.d.ts.map +0 -1
- package/types/app/cli/export.d.ts.map +0 -1
- package/types/app/cli/incept.d.ts.map +0 -1
- package/types/app/cli/index.d.ts +0 -37
- package/types/app/cli/index.d.ts.map +0 -1
- package/types/app/cli/init.d.ts.map +0 -1
- package/types/app/cli/interact.d.ts.map +0 -1
- package/types/app/cli/ipex.d.ts +0 -20
- package/types/app/cli/ipex.d.ts.map +0 -1
- package/types/app/cli/list.d.ts.map +0 -1
- package/types/app/cli/loc.d.ts.map +0 -1
- package/types/app/cli/multisig.d.ts +0 -12
- package/types/app/cli/multisig.d.ts.map +0 -1
- package/types/app/cli/notifications.d.ts.map +0 -1
- package/types/app/cli/oobi.d.ts.map +0 -1
- package/types/app/cli/output.d.ts.map +0 -1
- package/types/app/cli/query.d.ts +0 -12
- package/types/app/cli/query.d.ts.map +0 -1
- package/types/app/cli/rotate.d.ts.map +0 -1
- package/types/app/cli/saidify.d.ts.map +0 -1
- package/types/app/cli/sign.d.ts.map +0 -1
- package/types/app/cli/vc.d.ts +0 -20
- package/types/app/cli/vc.d.ts.map +0 -1
- package/types/app/cli/verifier.d.ts +0 -3
- package/types/app/cli/verifier.d.ts.map +0 -1
- package/types/app/cli/verify.d.ts.map +0 -1
- package/types/app/configing.d.ts.map +0 -1
- package/types/app/credential-workflows.d.ts +0 -118
- package/types/app/credential-workflows.d.ts.map +0 -1
- package/types/app/cue-delivery.d.ts +0 -30
- package/types/app/cue-delivery.d.ts.map +0 -1
- package/types/app/cue-preparation.d.ts +0 -25
- package/types/app/cue-preparation.d.ts.map +0 -1
- package/types/app/cue-route.d.ts +0 -19
- package/types/app/cue-route.d.ts.map +0 -1
- package/types/app/cue-runtime.d.ts +0 -46
- package/types/app/cue-runtime.d.ts.map +0 -1
- package/types/app/delegating.d.ts.map +0 -1
- package/types/app/direct-reply-delivery.d.ts +0 -38
- package/types/app/direct-reply-delivery.d.ts.map +0 -1
- package/types/app/endpoint-roleing.d.ts +0 -41
- package/types/app/endpoint-roleing.d.ts.map +0 -1
- package/types/app/essr.d.ts +0 -72
- package/types/app/essr.d.ts.map +0 -1
- package/types/app/exchanging.d.ts +0 -245
- package/types/app/exchanging.d.ts.map +0 -1
- package/types/app/forwarding.d.ts +0 -411
- package/types/app/forwarding.d.ts.map +0 -1
- package/types/app/group-members.d.ts +0 -12
- package/types/app/group-members.d.ts.map +0 -1
- package/types/app/grouping.d.ts +0 -150
- package/types/app/grouping.d.ts.map +0 -1
- package/types/app/habbing.d.ts.map +0 -1
- package/types/app/httping.d.ts +0 -42
- package/types/app/httping.d.ts.map +0 -1
- package/types/app/ipex-building.d.ts.map +0 -1
- package/types/app/ipex-credentialing.d.ts.map +0 -1
- package/types/app/ipex-graph.d.ts +0 -30
- package/types/app/ipex-graph.d.ts.map +0 -1
- package/types/app/ipex-grouping.d.ts +0 -51
- package/types/app/ipex-grouping.d.ts.map +0 -1
- package/types/app/ipex-v2.d.ts +0 -51
- package/types/app/ipex-v2.d.ts.map +0 -1
- package/types/app/ipexing.d.ts.map +0 -1
- package/types/app/keeping.d.ts.map +0 -1
- package/types/app/mailbox-director.d.ts +0 -159
- package/types/app/mailbox-director.d.ts.map +0 -1
- package/types/app/mailbox-sse.d.ts +0 -38
- package/types/app/mailbox-sse.d.ts.map +0 -1
- package/types/app/mailboxing.d.ts.map +0 -1
- package/types/app/multisig-workflows.d.ts +0 -59
- package/types/app/multisig-workflows.d.ts.map +0 -1
- package/types/app/notifying.d.ts.map +0 -1
- package/types/app/oobi-replies.d.ts +0 -18
- package/types/app/oobi-replies.d.ts.map +0 -1
- package/types/app/oobiery.d.ts.map +0 -1
- package/types/app/organizing.d.ts.map +0 -1
- package/types/app/parsering.d.ts +0 -106
- package/types/app/parsering.d.ts.map +0 -1
- package/types/app/protocol-host-policy.d.ts.map +0 -1
- package/types/app/query-replies.d.ts +0 -45
- package/types/app/query-replies.d.ts.map +0 -1
- package/types/app/querying.d.ts +0 -294
- package/types/app/querying.d.ts.map +0 -1
- package/types/app/reactor.d.ts +0 -171
- package/types/app/reactor.d.ts.map +0 -1
- package/types/app/reply-streams.d.ts +0 -51
- package/types/app/reply-streams.d.ts.map +0 -1
- package/types/app/respondant.d.ts +0 -48
- package/types/app/respondant.d.ts.map +0 -1
- package/types/app/runtime-deliveries.d.ts +0 -67
- package/types/app/runtime-deliveries.d.ts.map +0 -1
- package/types/app/runtime-services.d.ts +0 -29
- package/types/app/runtime-services.d.ts.map +0 -1
- package/types/app/runtime-turn.d.ts.map +0 -1
- package/types/app/schema-resolving.d.ts.map +0 -1
- package/types/app/signaling.d.ts +0 -96
- package/types/app/signaling.d.ts.map +0 -1
- package/types/app/socket-source.d.ts.map +0 -1
- package/types/app/stored-replies.d.ts +0 -18
- package/types/app/stored-replies.d.ts.map +0 -1
- package/types/app/tcp-egress.d.ts +0 -87
- package/types/app/tcp-egress.d.ts.map +0 -1
- package/types/app/verifier-agent.d.ts +0 -91
- package/types/app/verifier-agent.d.ts.map +0 -1
- package/types/app/verifying.d.ts.map +0 -1
- package/types/app/version.d.ts.map +0 -1
- package/types/app/witnessing.d.ts +0 -227
- package/types/app/witnessing.d.ts.map +0 -1
- package/types/core/cue-admission.d.ts +0 -74
- package/types/core/cue-admission.d.ts.map +0 -1
- package/types/core/eventing.d.ts.map +0 -1
- package/types/core/exchange-proofing.d.ts.map +0 -1
- package/types/core/index.d.ts +0 -24
- package/types/core/index.d.ts.map +0 -1
- package/types/core/kever-decisions.d.ts.map +0 -1
- package/types/core/kever.d.ts.map +0 -1
- package/types/core/kram-auth.d.ts.map +0 -1
- package/types/core/kram-handoff.d.ts +0 -45
- package/types/core/kram-handoff.d.ts.map +0 -1
- package/types/core/kram-policy.d.ts.map +0 -1
- package/types/core/kram-signatures.d.ts.map +0 -1
- package/types/core/kram-staging.d.ts +0 -36
- package/types/core/kram-staging.d.ts.map +0 -1
- package/types/core/kram-time.d.ts.map +0 -1
- package/types/core/kraming.d.ts +0 -46
- package/types/core/kraming.d.ts.map +0 -1
- package/types/core/mailbox-topics.d.ts.map +0 -1
- package/types/core/protocol-exchanging.d.ts.map +0 -1
- package/types/core/witnesses.d.ts.map +0 -1
- package/types/db/exchange-nests.d.ts +0 -39
- package/types/db/exchange-nests.d.ts.map +0 -1
- package/types/db/exchange-records.d.ts +0 -35
- package/types/db/exchange-records.d.ts.map +0 -1
- package/types/db/kel-replay.d.ts.map +0 -1
- package/types/db/kram-factors.d.ts.map +0 -1
- package/types/db/kram-snapshots.d.ts +0 -23
- package/types/db/kram-snapshots.d.ts.map +0 -1
- package/types/db/mailbox-inbox.d.ts +0 -72
- package/types/db/mailbox-inbox.d.ts.map +0 -1
- package/types/db/mailboxing.d.ts.map +0 -1
- package/types/db/outboxing.d.ts +0 -182
- package/types/db/outboxing.d.ts.map +0 -1
- package/types/db/payload-archive.d.ts +0 -70
- package/types/db/payload-archive.d.ts.map +0 -1
- package/types/db/payload-store.d.ts +0 -40
- package/types/db/payload-store.d.ts.map +0 -1
- package/types/db/payload-view.d.ts +0 -4
- package/types/db/payload-view.d.ts.map +0 -1
- package/types/db/tel-replay.d.ts.map +0 -1
- package/types/db/verifier-cueing.d.ts +0 -46
- package/types/db/verifier-cueing.d.ts.map +0 -1
- package/types/db/witness-replay.d.ts.map +0 -1
- package/types/vdr/credential-tsn.d.ts +0 -18
- package/types/vdr/credential-tsn.d.ts.map +0 -1
- package/types/vdr/registry-tsn.d.ts +0 -23
- package/types/vdr/registry-tsn.d.ts.map +0 -1
- /package/esm/keri/npm/src/app/{schema-resolving.js → credentials/schema-resolving.js} +0 -0
- /package/esm/keri/npm/src/app/{protocol-host-policy.js → protocol/protocol-host-policy.js} +0 -0
- /package/esm/keri/npm/src/app/{runtime-turn.js → runtime/runtime-turn.js} +0 -0
- /package/esm/keri/npm/src/{app/cli → cli}/common/rendering.js +0 -0
- /package/esm/keri/npm/src/{app/cli → cli/tools}/annotate-color.js +0 -0
- /package/esm/keri/npm/src/core/{witnesses.js → kel/witnesses.js} +0 -0
- /package/esm/keri/npm/src/core/{kram-auth.js → mailbox/kram-auth.js} +0 -0
- /package/esm/keri/npm/src/core/{mailbox-topics.js → mailbox/mailbox-topics.js} +0 -0
- /package/types/app/{runtime-turn.d.ts → runtime/runtime-turn.d.ts} +0 -0
- /package/types/{app/cli → cli}/common/rendering.d.ts +0 -0
- /package/types/{app/cli → cli/endpoints}/loc.d.ts +0 -0
- /package/types/{app/cli → cli/identity}/aid.d.ts +0 -0
- /package/types/{app/cli → cli/identity}/export.d.ts +0 -0
- /package/types/{app/cli → cli/identity}/list.d.ts +0 -0
- /package/types/{app/cli → cli/messaging}/notifications.d.ts +0 -0
- /package/types/{app/cli → cli}/output.d.ts +0 -0
- /package/types/{app/cli → cli/tools}/annotate-color.d.ts +0 -0
- /package/types/{app/cli → cli/tools}/annotate.d.ts +0 -0
- /package/types/{app/cli → cli/tools}/benchmark.d.ts +0 -0
- /package/types/{app/cli → cli/tools}/saidify.d.ts +0 -0
- /package/types/{app/cli → cli/tools}/verify.d.ts +0 -0
- /package/types/core/{witnesses.d.ts → kel/witnesses.d.ts} +0 -0
- /package/types/core/{mailbox-topics.d.ts → mailbox/mailbox-topics.d.ts} +0 -0
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
/** KERI event-log databaser built on `LMDBer` composition. */
|
|
2
|
-
import { b, Cigar, Dater, Diger,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { Kever } from "../core/kever.js";
|
|
2
|
+
import { b, Cigar, Dater, Diger, Ilks, Labeler, Noncer, NumberPrimitive, NumDex, Prefixer, Saider, SealEvent, SerderKERI, Siger, t, Texter, Verfer, Verser, Vrsn_1_0, } from "cesr-ts";
|
|
3
|
+
import { action } from "effection";
|
|
4
|
+
import { attachmentCounterPayloadQb64b, attachmentCounterQb64b, attachmentOrdinal, resolveAttachmentGvrsn, } from "../core/attachment-countering.js";
|
|
5
|
+
import { DatabaseNotOpenError, DatabaseOperationError, ValidationError } from "../core/errors.js";
|
|
6
|
+
import { Kever } from "../core/kel/kever.js";
|
|
8
7
|
import { consoleLogger } from "../core/logger.js";
|
|
9
8
|
import { CacheTypeRecord, EndpointRecord, EventSourceRecord, HabitatRecord, KeyStateRecord, LocationRecord, MsgCacheRecord, ObservedRecord, OobiRecord, TopicsRecord, TxnMsgCacheRecord, WellKnownAuthN, } from "../core/records.js";
|
|
10
|
-
import {
|
|
9
|
+
import { encodeDateTimeToDater, makeNowIso8601 } from "../time/mod.js";
|
|
10
|
+
import { baserDefaults } from "./baser-defaults.js";
|
|
11
|
+
import { dgKey, splitOnKey } from "./core/keys.js";
|
|
11
12
|
import { LMDBer } from "./core/lmdber.js";
|
|
12
|
-
import { ExchangeRecord,
|
|
13
|
-
import { CapturedKelReplay } from "./kel-replay.js";
|
|
13
|
+
import { ExchangeRecord, ExchangeRegistryStateRecord } from "./exchange/exchange-records.js";
|
|
14
14
|
import { IoSetKomer, Komer } from "./koming.js";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { B64OnIoDupSuber, BytesIoSetSuber, BytesSuber, CatCesrIoSetSuber, CatCesrSuber, CesrIoSetSuber, CesrOnSuber, CesrSuber, IoSetSuber, OnIoDupSuber, OnSuber, SchemerSuber, SerderSuber, Suber, } from "./subing.js";
|
|
19
|
-
import { CapturedWitnessReplay } from "./witness-replay.js";
|
|
15
|
+
import { CapturedKelReplay } from "./replay/kel-replay.js";
|
|
16
|
+
import { CapturedWitnessReplay } from "./replay/witness-replay.js";
|
|
17
|
+
import { B64OnIoDupSuber, BytesIoSetSuber, CatCesrIoSetSuber, CatCesrSuber, CesrIoSetSuber, CesrOnSuber, CesrSuber, IoSetSuber, OnIoDupSuber, OnSuber, SchemerSuber, SerderSuber, Suber, } from "./subing.js";
|
|
20
18
|
function isMissingReloadEventError(error) {
|
|
21
19
|
return error instanceof Error
|
|
22
20
|
&& error.message.startsWith("Missing accepted event for reloaded Kever state ");
|
|
@@ -55,6 +53,10 @@ function eventSealsEqual(left, right) {
|
|
|
55
53
|
function encodeHugeOrdinal(num) {
|
|
56
54
|
return new NumberPrimitive({ code: NumDex.Huge, raw: hugeOrdinalRaw(num) });
|
|
57
55
|
}
|
|
56
|
+
/** Preserve qualified numeric source ordinals; normalize legacy Seqner input to the stored number family. */
|
|
57
|
+
function eventSourceOrdinal(ordinal) {
|
|
58
|
+
return ordinal instanceof NumberPrimitive ? ordinal : encodeHugeOrdinal(ordinal.sn);
|
|
59
|
+
}
|
|
58
60
|
function hugeOrdinalRaw(num) {
|
|
59
61
|
const raw = new Uint8Array(16);
|
|
60
62
|
let value = BigInt(num);
|
|
@@ -64,9 +66,6 @@ function hugeOrdinalRaw(num) {
|
|
|
64
66
|
}
|
|
65
67
|
return raw;
|
|
66
68
|
}
|
|
67
|
-
function seqnerFromNumber(number) {
|
|
68
|
-
return new Seqner({ code: NumDex.Huge, raw: hugeOrdinalRaw(number.num) });
|
|
69
|
-
}
|
|
70
69
|
/**
|
|
71
70
|
* High-level event-log databaser for KERI application state.
|
|
72
71
|
*
|
|
@@ -89,195 +88,21 @@ function seqnerFromNumber(number) {
|
|
|
89
88
|
* subset is actively driven by `Habery`/CLI in this arc
|
|
90
89
|
*/
|
|
91
90
|
export class Baser {
|
|
92
|
-
/**
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
signal?.throwIfAborted();
|
|
102
|
-
if (!this.opened || !this.path)
|
|
103
|
-
return Promise.reject(new Error("Payload database is closed"));
|
|
104
|
-
if (this.archive)
|
|
105
|
-
return this.archive;
|
|
106
|
-
const opening = this.recoverPayloads(signal);
|
|
107
|
-
this.archive = opening;
|
|
108
|
-
// Failed or cancelled recovery owns its cleanup and permits a later fresh admission.
|
|
109
|
-
void opening.catch(() => {
|
|
110
|
-
if (this.archive === opening)
|
|
111
|
-
this.archive = undefined;
|
|
112
|
-
});
|
|
113
|
-
return opening;
|
|
114
|
-
}
|
|
115
|
-
/** Remove interrupted wire rows while the archive still excludes all payload admissions. */
|
|
116
|
-
async recoverPayloads(signal) {
|
|
117
|
-
const archive = await PayloadArchive.open(this.lmdber, join(this.path, "payloads"), signal);
|
|
118
|
-
try {
|
|
119
|
-
let previous;
|
|
120
|
-
let owned = false;
|
|
121
|
-
// Exclusive startup proves all private staging rows belong to interrupted admissions.
|
|
122
|
-
let removed = this.enstStaging.trim();
|
|
123
|
-
// Scan physical keys only: a crashed write can leave arbitrarily many Texter rows.
|
|
124
|
-
for (const table of [this.essrs, this.enst]) {
|
|
125
|
-
previous = undefined;
|
|
126
|
-
for (const key of table.sdb.getKeys()) {
|
|
127
|
-
signal?.throwIfAborted();
|
|
128
|
-
const [saidKey] = unsuffix(key);
|
|
129
|
-
const said = t(saidKey);
|
|
130
|
-
if (said !== previous) {
|
|
131
|
-
previous = said;
|
|
132
|
-
// Preserve KERIpy-origin wire evidence without requiring our private metadata.
|
|
133
|
-
owned = this.exns.sdb.doesExist(saidKey) || this.epse.sdb.doesExist(saidKey) || this.hasSchemaEscrow(said);
|
|
134
|
-
}
|
|
135
|
-
if (!owned)
|
|
136
|
-
removed = table.sdb.removeSync(key) || removed;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
if (removed)
|
|
140
|
-
await this.lmdber.env.flushed;
|
|
141
|
-
signal?.throwIfAborted();
|
|
142
|
-
return archive;
|
|
143
|
-
}
|
|
144
|
-
catch (error) {
|
|
145
|
-
await archive.close();
|
|
146
|
-
throw error;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
/** Reopen private wire or borrow bounded KERIpy rows when no private metadata exists. */
|
|
150
|
-
async getEssr(said, signal, { maxEssrBytes = 8 * 1024 ** 2, maxEssrItems = 16384 } = {}) {
|
|
151
|
-
signal?.throwIfAborted();
|
|
152
|
-
for (const limit of [maxEssrBytes, maxEssrItems]) {
|
|
153
|
-
if (!Number.isSafeInteger(limit) || limit < 0)
|
|
154
|
-
throw new RangeError("Invalid stored ESSR limit");
|
|
155
|
-
}
|
|
156
|
-
if (!Number.isSafeInteger(4 * Math.ceil(maxEssrBytes / 3) + 12 * maxEssrItems)) {
|
|
157
|
-
throw new RangeError("Stored ESSR wire limit exceeds safe integer range");
|
|
158
|
-
}
|
|
159
|
-
const metadata = this.exchangeMeta.get([said])?.essr;
|
|
160
|
-
if (!metadata)
|
|
161
|
-
return this.borrowEssr(said, maxEssrBytes, maxEssrItems, signal);
|
|
162
|
-
if (metadata.count > maxEssrItems || metadata.size > maxEssrBytes) {
|
|
163
|
-
throw new ResourceLimitError("Stored ESSR exceeds admission limits");
|
|
164
|
-
}
|
|
165
|
-
const wire = await (await this.openPayloads(signal)).get(`essr/${said}`, signal);
|
|
166
|
-
if (!wire)
|
|
167
|
-
throw new Error("Exchange ESSR reference is missing");
|
|
168
|
-
return essrPayload({
|
|
169
|
-
size: wire.size,
|
|
170
|
-
/** Reopen the archive's immutable wire object for each decoded read. */
|
|
171
|
-
open: (signal) => wire.open(signal),
|
|
172
|
-
/** The archive retains ownership when a consumer releases this view. */
|
|
173
|
-
discard: async () => { },
|
|
174
|
-
}, metadata.count, metadata.size, metadata.gvrsn);
|
|
175
|
-
}
|
|
176
|
-
/** Preserve the insertion order and deduplication already represented by KERIpy rows. */
|
|
177
|
-
borrowEssr(said, maxBytes, maxItems, signal) {
|
|
91
|
+
/**
|
|
92
|
+
* Read pinned-main ESSR evidence only while an accepted or pending EXN owns it.
|
|
93
|
+
* Return hydrated Texters in first-insertion order, or null for absent/unowned
|
|
94
|
+
* evidence. These are set members, not the original fragment sequence: equal
|
|
95
|
+
* qualified values deduplicate and alternate fragmentations may add members.
|
|
96
|
+
* Callers needing authenticated payload bytes must verify the signed digest
|
|
97
|
+
* against this reconstruction; reading rows does not establish acceptance.
|
|
98
|
+
*/
|
|
99
|
+
getEssrs(said) {
|
|
178
100
|
if (!this.exns.get([said]) && !this.epse.get([said]) && !this.hasSchemaEscrow(said))
|
|
179
101
|
return null;
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
let wireSize = 0;
|
|
183
|
-
for (const texter of this.essrRows(said, maxBytes, maxItems, signal)) {
|
|
184
|
-
count++;
|
|
185
|
-
size += texter.raw.length;
|
|
186
|
-
wireSize += texter.qb64.length;
|
|
187
|
-
}
|
|
188
|
-
if (!count)
|
|
189
|
-
return null;
|
|
190
|
-
/** Revisit current rows without retaining tokens or an item-size manifest. */
|
|
191
|
-
const rows = (signal) => this.essrRows(said, maxBytes, maxItems, signal);
|
|
192
|
-
return essrPayload({
|
|
193
|
-
size: wireSize,
|
|
194
|
-
/** Copy bounded chunks so a stored large token never supplies an oversized backing buffer. */
|
|
195
|
-
async *open(signal) {
|
|
196
|
-
for (const texter of rows(signal)) {
|
|
197
|
-
const wire = texter.qb64b;
|
|
198
|
-
for (let offset = 0; offset < wire.length; offset += 65536) {
|
|
199
|
-
signal?.throwIfAborted();
|
|
200
|
-
yield wire.slice(offset, offset + 65536);
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
},
|
|
204
|
-
/** Releasing a borrowed view never deletes protocol evidence. */
|
|
205
|
-
async discard() { },
|
|
206
|
-
}, count, size, Vrsn_1_0); // The wire table records no original frame genus.
|
|
207
|
-
}
|
|
208
|
-
/** Admit stored token size/count before hydration; never assemble a complete ESSR message. */
|
|
209
|
-
*essrRows(said, maxBytes, maxItems, signal) {
|
|
210
|
-
let count = 0;
|
|
211
|
-
let size = 0;
|
|
212
|
-
signal?.throwIfAborted();
|
|
213
|
-
// Scan keys first so neither an over-count row nor an adjacent owner reads a value.
|
|
214
|
-
for (const key of this.essrs.sdb.getKeys({ start: suffix(b(said), 0) })) {
|
|
215
|
-
signal?.throwIfAborted();
|
|
216
|
-
if (t(unsuffix(key)[0]) !== said)
|
|
217
|
-
break;
|
|
218
|
-
if (++count > maxItems)
|
|
219
|
-
throw new ResourceLimitError("Stored ESSR exceeds admission limits");
|
|
220
|
-
const wire = this.essrs.sdb.get(key);
|
|
221
|
-
if (!wire)
|
|
222
|
-
throw new Error("Stored ESSR row disappeared during traversal");
|
|
223
|
-
if (wire.length > 4 * Math.ceil((maxBytes - size) / 3) + 12) {
|
|
224
|
-
throw new ResourceLimitError("Stored ESSR exceeds admission limits");
|
|
225
|
-
}
|
|
226
|
-
const texter = new Texter({ qb64b: wire });
|
|
227
|
-
size += texter.raw.length;
|
|
228
|
-
if (size > maxBytes)
|
|
229
|
-
throw new ResourceLimitError("Stored ESSR exceeds admission limits");
|
|
230
|
-
if (texter.qb64.length !== wire.length)
|
|
231
|
-
throw new Error("Stored ESSR row has trailing bytes");
|
|
232
|
-
yield texter;
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
/** Persist caller-authenticated recipient output after its signed exchange is accepted. */
|
|
236
|
-
async savePlaintext(said, plaintext, offset, signal) {
|
|
237
|
-
signal?.throwIfAborted();
|
|
238
|
-
if (!this.exns.get([said]))
|
|
239
|
-
throw new Error("Cannot store plaintext for an unaccepted exchange");
|
|
240
|
-
payloadRange(plaintext, offset);
|
|
241
|
-
const metadata = this.plaintextMetadata ??= new Komer(this.lmdber, {
|
|
242
|
-
subkey: "plaintext.meta.",
|
|
243
|
-
recordClass: PlaintextRecord,
|
|
244
|
-
});
|
|
245
|
-
const previous = metadata.get([said]);
|
|
246
|
-
if (previous && previous.offset !== offset) {
|
|
247
|
-
throw new Error("Plaintext header offset conflicts with its stored value");
|
|
248
|
-
}
|
|
249
|
-
const stored = await (await this.openPayloads(signal)).publish(`plain/${said}`, plaintext, () => {
|
|
250
|
-
metadata.pin([said], { offset });
|
|
251
|
-
}, signal);
|
|
252
|
-
return { plaintext: stored, body: payloadRange(stored, offset) };
|
|
253
|
-
}
|
|
254
|
-
/** Reopen the authenticated inner CESR source independently of ciphertext evidence. */
|
|
255
|
-
async getPlaintext(said, signal) {
|
|
256
|
-
signal?.throwIfAborted();
|
|
257
|
-
const metadata = this.plaintextMetadata ??= new Komer(this.lmdber, {
|
|
258
|
-
subkey: "plaintext.meta.",
|
|
259
|
-
recordClass: PlaintextRecord,
|
|
260
|
-
});
|
|
261
|
-
const record = metadata.get([said]);
|
|
262
|
-
if (!record)
|
|
263
|
-
return null;
|
|
264
|
-
const plaintext = await (await this.openPayloads(signal)).get(`plain/${said}`, signal);
|
|
265
|
-
if (!plaintext)
|
|
266
|
-
throw new Error("Plaintext reference is missing");
|
|
267
|
-
return { plaintext, body: payloadRange(plaintext, record.offset) };
|
|
268
|
-
}
|
|
269
|
-
/** Open opt-in consumer storage lazily so legacy/read-only opens require no new subdatabase. */
|
|
270
|
-
get mailboxInbox() {
|
|
271
|
-
return this.inbox ??= new MailboxInbox(this.lmdber, this.tops);
|
|
102
|
+
const fragments = this.essrs.get([said]);
|
|
103
|
+
return fragments.length ? fragments : null;
|
|
272
104
|
}
|
|
273
105
|
constructor(options = {}) {
|
|
274
|
-
/** Survives runtime shutdown because runtimes borrow this database. */
|
|
275
|
-
Object.defineProperty(this, "resources", {
|
|
276
|
-
enumerable: true,
|
|
277
|
-
configurable: true,
|
|
278
|
-
writable: true,
|
|
279
|
-
value: void 0
|
|
280
|
-
});
|
|
281
106
|
Object.defineProperty(this, "lmdber", {
|
|
282
107
|
enumerable: true,
|
|
283
108
|
configurable: true,
|
|
@@ -308,6 +133,7 @@ export class Baser {
|
|
|
308
133
|
writable: true,
|
|
309
134
|
value: new Set()
|
|
310
135
|
});
|
|
136
|
+
/** Locally prepared/membered group identities; membership does not itself prove KEL acceptance. */
|
|
311
137
|
Object.defineProperty(this, "groups", {
|
|
312
138
|
enumerable: true,
|
|
313
139
|
configurable: true,
|
|
@@ -554,28 +380,15 @@ export class Baser {
|
|
|
554
380
|
writable: true,
|
|
555
381
|
value: void 0
|
|
556
382
|
}); // Observed identifier records keyed by controller, watcher, and observed ID.
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
configurable: true,
|
|
560
|
-
writable: true,
|
|
561
|
-
value: void 0
|
|
562
|
-
});
|
|
563
|
-
/** One lazily opened file owner, shared by parser staging and runtime storage. */
|
|
564
|
-
Object.defineProperty(this, "archive", {
|
|
383
|
+
/** Receiver receipt, mailbox provenance and attachment genus; no payload ownership. */
|
|
384
|
+
Object.defineProperty(this, "exchangeMeta", {
|
|
565
385
|
enumerable: true,
|
|
566
386
|
configurable: true,
|
|
567
387
|
writable: true,
|
|
568
388
|
value: void 0
|
|
569
389
|
});
|
|
570
|
-
/**
|
|
571
|
-
Object.defineProperty(this, "
|
|
572
|
-
enumerable: true,
|
|
573
|
-
configurable: true,
|
|
574
|
-
writable: true,
|
|
575
|
-
value: void 0
|
|
576
|
-
});
|
|
577
|
-
/** Authenticated plaintext offsets used to reconstruct inner-stream views. */
|
|
578
|
-
Object.defineProperty(this, "plaintextMetadata", {
|
|
390
|
+
/** Registry observations from successful Grant verification, keyed by (Grant, node). */
|
|
391
|
+
Object.defineProperty(this, "exrs", {
|
|
579
392
|
enumerable: true,
|
|
580
393
|
configurable: true,
|
|
581
394
|
writable: true,
|
|
@@ -622,7 +435,7 @@ export class Baser {
|
|
|
622
435
|
configurable: true,
|
|
623
436
|
writable: true,
|
|
624
437
|
value: void 0
|
|
625
|
-
}); //
|
|
438
|
+
}); // Absolute partial-signature deadlines; v2 Grant originals survive body removal.
|
|
626
439
|
/** Optional on readonly legacy stores; schema dependencies share one absolute deadline. */
|
|
627
440
|
Object.defineProperty(this, "emse", {
|
|
628
441
|
enumerable: true,
|
|
@@ -679,25 +492,30 @@ export class Baser {
|
|
|
679
492
|
writable: true,
|
|
680
493
|
value: void 0
|
|
681
494
|
});
|
|
682
|
-
|
|
683
|
-
Object.defineProperty(this, "enstStaging", {
|
|
495
|
+
Object.defineProperty(this, "epath", {
|
|
684
496
|
enumerable: true,
|
|
685
497
|
configurable: true,
|
|
686
498
|
writable: true,
|
|
687
499
|
value: void 0
|
|
688
|
-
});
|
|
689
|
-
|
|
500
|
+
}); // Exchange-message pathed attachments.
|
|
501
|
+
/**
|
|
502
|
+
* Pinned KERIpy main's `essrs.` table: EXN SAID keys, qualified Texter values,
|
|
503
|
+
* native insertion-ordered set semantics. Duplicate add=false is normal, not
|
|
504
|
+
* a write failure. This binding does not claim legacy `.essrs` interchange.
|
|
505
|
+
*/
|
|
506
|
+
Object.defineProperty(this, "essrs", {
|
|
690
507
|
enumerable: true,
|
|
691
508
|
configurable: true,
|
|
692
509
|
writable: true,
|
|
693
510
|
value: void 0
|
|
694
|
-
});
|
|
695
|
-
|
|
511
|
+
});
|
|
512
|
+
/** KERIpy `rrpe.`: `/registry/root` copies in `exns`/`essrs` awaiting automatic retention; SAID -> time it entered escrow; no timeout. */
|
|
513
|
+
Object.defineProperty(this, "rrpe", {
|
|
696
514
|
enumerable: true,
|
|
697
515
|
configurable: true,
|
|
698
516
|
writable: true,
|
|
699
517
|
value: void 0
|
|
700
|
-
});
|
|
518
|
+
});
|
|
701
519
|
Object.defineProperty(this, "chas", {
|
|
702
520
|
enumerable: true,
|
|
703
521
|
configurable: true,
|
|
@@ -908,18 +726,6 @@ export class Baser {
|
|
|
908
726
|
writable: true,
|
|
909
727
|
value: void 0
|
|
910
728
|
}); // KRAM transactioned message-cache records.
|
|
911
|
-
Object.defineProperty(this, "kready", {
|
|
912
|
-
enumerable: true,
|
|
913
|
-
configurable: true,
|
|
914
|
-
writable: true,
|
|
915
|
-
value: void 0
|
|
916
|
-
}); // Private first ready receiver timestamp; consumed only after joined handoff.
|
|
917
|
-
Object.defineProperty(this, "kpnd", {
|
|
918
|
-
enumerable: true,
|
|
919
|
-
configurable: true,
|
|
920
|
-
writable: true,
|
|
921
|
-
value: void 0
|
|
922
|
-
}); // Private KRAM parent snapshots, never accepted wire publication.
|
|
923
729
|
Object.defineProperty(this, "ulgs", {
|
|
924
730
|
enumerable: true,
|
|
925
731
|
configurable: true,
|
|
@@ -1010,17 +816,8 @@ export class Baser {
|
|
|
1010
816
|
writable: true,
|
|
1011
817
|
value: void 0
|
|
1012
818
|
}); // Type-media quadruples.
|
|
1013
|
-
this.resources = options.resources ?? new ResourcePolicy();
|
|
1014
819
|
this.logger = options.logger ?? consoleLogger;
|
|
1015
|
-
|
|
1016
|
-
this.lmdber = new LMDBer(options, {
|
|
1017
|
-
tailDirPath: Baser.TailDirPath,
|
|
1018
|
-
cleanTailDirPath: "keri/clean/db",
|
|
1019
|
-
altTailDirPath: compat ? Baser.CompatAltTailDirPath : Baser.AltTailDirPath,
|
|
1020
|
-
altCleanTailDirPath: compat ? ".keri/clean/db" : ".tufa/clean/db",
|
|
1021
|
-
tempPrefix: Baser.TempPrefix,
|
|
1022
|
-
maxNamedDBs: Baser.MaxNamedDBs,
|
|
1023
|
-
});
|
|
820
|
+
this.lmdber = new LMDBer(options, baserDefaults(options.compat));
|
|
1024
821
|
}
|
|
1025
822
|
/** Expose the resolved logical database name delegated from the root LMDBer. */
|
|
1026
823
|
get name() {
|
|
@@ -1054,9 +851,13 @@ export class Baser {
|
|
|
1054
851
|
get env() {
|
|
1055
852
|
return this.lmdber.env;
|
|
1056
853
|
}
|
|
1057
|
-
/**
|
|
1058
|
-
|
|
1059
|
-
return this.lmdber.
|
|
854
|
+
/** Report an active caller writer without exposing native transaction internals. */
|
|
855
|
+
get inWriteTransaction() {
|
|
856
|
+
return this.lmdber.inWriteTransaction;
|
|
857
|
+
}
|
|
858
|
+
/** Read an owned binary row through the backing database's normal copy path. */
|
|
859
|
+
getVal(table, key) {
|
|
860
|
+
return this.lmdber.getVal(table, key);
|
|
1060
861
|
}
|
|
1061
862
|
/**
|
|
1062
863
|
* Reopen the root LMDB environment and bind the KERIpy-style named subdbs.
|
|
@@ -1067,17 +868,6 @@ export class Baser {
|
|
|
1067
868
|
* than hand-rolled raw LMDB handles.
|
|
1068
869
|
*/
|
|
1069
870
|
*reopen(options = {}) {
|
|
1070
|
-
if (options.resources && options.resources !== this.resources) {
|
|
1071
|
-
throw new RangeError("Baser reopen requires its original resource policy");
|
|
1072
|
-
}
|
|
1073
|
-
if (this.archive) {
|
|
1074
|
-
yield* call(async () => {
|
|
1075
|
-
await (await this.archive.catch(() => null))?.close();
|
|
1076
|
-
});
|
|
1077
|
-
}
|
|
1078
|
-
this.archive = undefined;
|
|
1079
|
-
this.exchangeMetadata = undefined;
|
|
1080
|
-
this.plaintextMetadata = undefined;
|
|
1081
871
|
const opened = yield* this.lmdber.reopen(options);
|
|
1082
872
|
if (!opened) {
|
|
1083
873
|
return false;
|
|
@@ -1261,7 +1051,6 @@ export class Baser {
|
|
|
1261
1051
|
subkey: "witm.",
|
|
1262
1052
|
recordClass: TopicsRecord,
|
|
1263
1053
|
});
|
|
1264
|
-
this.inbox = undefined;
|
|
1265
1054
|
// Group partial signature escrow entries.
|
|
1266
1055
|
this.gpse = new CatCesrIoSetSuber(this.lmdber, {
|
|
1267
1056
|
subkey: "gpse.",
|
|
@@ -1297,6 +1086,9 @@ export class Baser {
|
|
|
1297
1086
|
: null;
|
|
1298
1087
|
// Exchange messages keyed by digest.
|
|
1299
1088
|
this.exns = new SerderSuber(this.lmdber, { subkey: "exns." });
|
|
1089
|
+
// Bind metadata during store opening, never lazily inside an admission that may abort.
|
|
1090
|
+
this.exchangeMeta = new Komer(this.lmdber, { subkey: "exchange.meta.", recordClass: ExchangeRecord });
|
|
1091
|
+
this.exrs = new Komer(this.lmdber, { subkey: "exrs.", recordClass: ExchangeRegistryStateRecord });
|
|
1300
1092
|
// Forward pointers to provided reply messages.
|
|
1301
1093
|
this.erpy = new CesrSuber(this.lmdber, {
|
|
1302
1094
|
subkey: "erpy.",
|
|
@@ -1321,12 +1113,13 @@ export class Baser {
|
|
|
1321
1113
|
// Exchange-message pathed attachments.
|
|
1322
1114
|
this.epath = new IoSetSuber(this.lmdber, { subkey: ".epath" });
|
|
1323
1115
|
this.enst = new IoSetSuber(this.lmdber, { subkey: "enst." });
|
|
1324
|
-
this.enstStaging = new IoSetSuber(this.lmdber, { subkey: "enst.stage." });
|
|
1325
1116
|
// Encrypt-Sender-Sign-Receiver payloads keyed by exchange digest.
|
|
1326
1117
|
this.essrs = new CesrIoSetSuber(this.lmdber, {
|
|
1327
|
-
subkey: ".
|
|
1118
|
+
subkey: "essrs.",
|
|
1328
1119
|
ctor: Texter,
|
|
1329
1120
|
});
|
|
1121
|
+
// Registry root copies awaiting automatic retention, keyed by exchange SAID.
|
|
1122
|
+
this.rrpe = new CesrSuber(this.lmdber, { subkey: "rrpe.", ctor: Dater });
|
|
1330
1123
|
// Accepted signed challenge-response exchange-message SAIDs keyed by the
|
|
1331
1124
|
// signer prefix.
|
|
1332
1125
|
this.chas = new CesrIoSetSuber(this.lmdber, {
|
|
@@ -1491,8 +1284,6 @@ export class Baser {
|
|
|
1491
1284
|
subkey: "tmsc.",
|
|
1492
1285
|
recordClass: TxnMsgCacheRecord,
|
|
1493
1286
|
});
|
|
1494
|
-
this.kpnd = new BytesSuber(this.lmdber, { subkey: "kpnd." });
|
|
1495
|
-
this.kready = new Suber(this.lmdber, { subkey: "kready." });
|
|
1496
1287
|
this.ulgs = new CesrIoSetSuber(this.lmdber, { subkey: "ulgs.", ctor: Prefixer });
|
|
1497
1288
|
this.cigs = new CatCesrIoSetSuber(this.lmdber, { subkey: "cigs.", ctor: [Verfer, Cigar] });
|
|
1498
1289
|
// KRAM partially signed multi-key messages keyed by `(AID, MID)`.
|
|
@@ -1560,19 +1351,11 @@ export class Baser {
|
|
|
1560
1351
|
}
|
|
1561
1352
|
catch (error) {
|
|
1562
1353
|
this.logger.error(`Failed to open Baser sub-databases: ${error}`);
|
|
1563
|
-
throw new DatabaseOperationError("Failed to open Baser sub-databases", { cause: error
|
|
1354
|
+
throw new DatabaseOperationError("Failed to open Baser sub-databases", { cause: error });
|
|
1564
1355
|
}
|
|
1565
1356
|
}
|
|
1566
1357
|
/** Close the underlying LMDB resources. */
|
|
1567
1358
|
*close(clear = false) {
|
|
1568
|
-
if (this.archive) {
|
|
1569
|
-
yield* call(async () => {
|
|
1570
|
-
await (await this.archive.catch(() => null))?.close();
|
|
1571
|
-
});
|
|
1572
|
-
}
|
|
1573
|
-
this.archive = undefined;
|
|
1574
|
-
this.exchangeMetadata = undefined;
|
|
1575
|
-
this.plaintextMetadata = undefined;
|
|
1576
1359
|
this.kevers.clear();
|
|
1577
1360
|
this.prefixes.clear();
|
|
1578
1361
|
this.groups.clear();
|
|
@@ -1646,23 +1429,49 @@ export class Baser {
|
|
|
1646
1429
|
}
|
|
1647
1430
|
}
|
|
1648
1431
|
}
|
|
1432
|
+
/** Resolve the stored establishment governing an accepted event's witnesses. */
|
|
1433
|
+
acceptedEventEstablishment(serder) {
|
|
1434
|
+
const pre = serder.pre;
|
|
1435
|
+
const sn = serder.sn;
|
|
1436
|
+
const said = serder.said;
|
|
1437
|
+
if (!pre || !said || sn === null || !this.kels.getOn(pre, sn).includes(said))
|
|
1438
|
+
return null;
|
|
1439
|
+
let event = this.getEvtSerder(pre, said);
|
|
1440
|
+
while (event && !event.estive) {
|
|
1441
|
+
event = event.prior ? this.getEvtSerder(pre, event.prior) : null;
|
|
1442
|
+
}
|
|
1443
|
+
return event;
|
|
1444
|
+
}
|
|
1649
1445
|
/**
|
|
1650
|
-
*
|
|
1651
|
-
*
|
|
1652
|
-
*
|
|
1653
|
-
*
|
|
1446
|
+
* Resolve an accepted event's receipt witnesses from its latest establishment.
|
|
1447
|
+
* Like KERIpy Kevery.fetchWitnessState, interactions inherit an establishment's
|
|
1448
|
+
* stored cohort, including an empty cohort. Follow this event's prior digests
|
|
1449
|
+
* so a recovery at the same ordinal cannot replace its historical cohort.
|
|
1450
|
+
* Partial-witness escrows derive their cohort separately before acceptance.
|
|
1451
|
+
*/
|
|
1452
|
+
acceptedEventWitnesses(serder) {
|
|
1453
|
+
const event = this.acceptedEventEstablishment(serder);
|
|
1454
|
+
return event ? this.wits.get(dgKey(event.pre, event.said)).map((wit) => wit.qb64) : null;
|
|
1455
|
+
}
|
|
1456
|
+
/**
|
|
1457
|
+
* Return whether an accepted event has its governing establishment's receipts.
|
|
1458
|
+
* Later rotations cannot raise or lower this historical event's required
|
|
1459
|
+
* witness threshold.
|
|
1460
|
+
* Reverify retained signatures against that event and count distinct witnesses;
|
|
1461
|
+
* early event escrows may have stored attachments before witness verification.
|
|
1654
1462
|
*/
|
|
1655
1463
|
fullyWitnessed(serder) {
|
|
1656
|
-
const
|
|
1657
|
-
|
|
1658
|
-
if (!pre || !said) {
|
|
1464
|
+
const establishment = this.acceptedEventEstablishment(serder);
|
|
1465
|
+
if (!establishment)
|
|
1659
1466
|
return false;
|
|
1660
|
-
|
|
1661
|
-
const
|
|
1662
|
-
if (
|
|
1467
|
+
const witnesses = this.wits.get(dgKey(establishment.pre, establishment.said));
|
|
1468
|
+
const threshold = establishment.bner.num;
|
|
1469
|
+
if (threshold === 0n)
|
|
1470
|
+
return witnesses.length === 0;
|
|
1471
|
+
if (threshold < 1n || threshold > BigInt(witnesses.length))
|
|
1663
1472
|
return false;
|
|
1664
|
-
}
|
|
1665
|
-
return BigInt(
|
|
1473
|
+
const verified = Kever.verifyIndexedSignatures(serder.raw, this.wigs.get(dgKey(serder.pre, serder.said)), witnesses.map((witness) => new Verfer({ qb64: witness.qb64 })));
|
|
1474
|
+
return BigInt(verified.indices.length) >= threshold;
|
|
1666
1475
|
}
|
|
1667
1476
|
/**
|
|
1668
1477
|
* Find the first fully witnessed event in `pre`'s KEL that carries `seal`.
|
|
@@ -1730,6 +1539,63 @@ export class Baser {
|
|
|
1730
1539
|
}
|
|
1731
1540
|
return next;
|
|
1732
1541
|
}
|
|
1542
|
+
/** Fix prospective FEL metadata before the processing owner admits follow-up work or writes. */
|
|
1543
|
+
prepareKelEventLog(args) {
|
|
1544
|
+
const pre = args.serder.pre;
|
|
1545
|
+
if (!pre || !args.serder.said || args.serder.sn === null) {
|
|
1546
|
+
throw new ValidationError("logEvent requires pre, said, and sn.");
|
|
1547
|
+
}
|
|
1548
|
+
return {
|
|
1549
|
+
fn: args.first ? this.nextFelOrdinal(pre) : null,
|
|
1550
|
+
dater: args.frc?.dt ?? new Dater({ qb64: encodeDateTimeToDater(makeNowIso8601()) }),
|
|
1551
|
+
};
|
|
1552
|
+
}
|
|
1553
|
+
/**
|
|
1554
|
+
* Persist verified accepted/duplicate event material under the caller's synchronous writer.
|
|
1555
|
+
* The processing owner supplies the validated delegated fact, admits follow-up
|
|
1556
|
+
* work before this call, and publishes live state/cues after native commit.
|
|
1557
|
+
* This owns row layout and first-seen checks, not decisions, queues or transport.
|
|
1558
|
+
*/
|
|
1559
|
+
writeKelEventLog(args, prepared, delegated) {
|
|
1560
|
+
const local = args.local ?? false;
|
|
1561
|
+
const pre = args.serder.pre, said = args.serder.said, sn = args.serder.sn;
|
|
1562
|
+
if (!pre || !said || sn === null) {
|
|
1563
|
+
throw new ValidationError("logEvent requires pre, said, and sn.");
|
|
1564
|
+
}
|
|
1565
|
+
const first = args.first ?? false;
|
|
1566
|
+
const { fn, dater } = prepared;
|
|
1567
|
+
if (fn !== (first ? this.nextFelOrdinal(pre) : null)) {
|
|
1568
|
+
throw new Error("Prepared first-seen ordinal changed before logging");
|
|
1569
|
+
}
|
|
1570
|
+
const dgkey = dgKey(pre, said);
|
|
1571
|
+
this.dtss.put(dgkey, dater);
|
|
1572
|
+
if (args.sigers?.length)
|
|
1573
|
+
this.sigs.put(dgkey, [...args.sigers]);
|
|
1574
|
+
if (args.wigers?.length)
|
|
1575
|
+
this.wigs.put(dgkey, [...args.wigers]);
|
|
1576
|
+
if (args.wits?.length)
|
|
1577
|
+
this.wits.put(dgkey, args.wits.map((wit) => new Prefixer({ qb64: wit })));
|
|
1578
|
+
this.evts.put(dgkey, args.serder);
|
|
1579
|
+
if (args.sourceSeal && delegated && args.serder.ilk !== Ilks.ixn) {
|
|
1580
|
+
this.aess.pin(dgkey, [eventSourceOrdinal(args.sourceSeal.s), args.sourceSeal.d]);
|
|
1581
|
+
}
|
|
1582
|
+
const existing = this.esrs.get(dgkey);
|
|
1583
|
+
if (existing) {
|
|
1584
|
+
if (local && !existing.local) {
|
|
1585
|
+
existing.local = true;
|
|
1586
|
+
this.esrs.pin(dgkey, existing);
|
|
1587
|
+
}
|
|
1588
|
+
}
|
|
1589
|
+
else
|
|
1590
|
+
this.esrs.put(dgkey, { local });
|
|
1591
|
+
if (first) {
|
|
1592
|
+
if (this.appendFel(pre, said) !== fn)
|
|
1593
|
+
throw new Error("First-seen append disagrees with preparation");
|
|
1594
|
+
this.dtss.pin(dgkey, dater);
|
|
1595
|
+
this.fons.pin(dgkey, encodeHugeOrdinal(fn));
|
|
1596
|
+
}
|
|
1597
|
+
this.kels.add(pre, sn, said);
|
|
1598
|
+
}
|
|
1733
1599
|
/** Read one first-seen digest by `(pre, fn)` from `fels.`. */
|
|
1734
1600
|
getFel(pre, fn) {
|
|
1735
1601
|
return this.fels.getOn(pre, fn);
|
|
@@ -1793,6 +1659,9 @@ export class Baser {
|
|
|
1793
1659
|
const removes = [];
|
|
1794
1660
|
for (const [pre, habord] of this.getHabItemIter()) {
|
|
1795
1661
|
const hid = habord.hid || pre;
|
|
1662
|
+
// Prepared membership survives reopen independently of accepted key state.
|
|
1663
|
+
if (habord.mid)
|
|
1664
|
+
this.groups.add(hid);
|
|
1796
1665
|
const state = this.getState(hid);
|
|
1797
1666
|
if (!state) {
|
|
1798
1667
|
if (!habord.mid) {
|
|
@@ -1804,9 +1673,6 @@ export class Baser {
|
|
|
1804
1673
|
const kever = Kever.fromState({ state, db: this });
|
|
1805
1674
|
this.kevers.set(kever.pre, kever);
|
|
1806
1675
|
this.prefixes.add(kever.pre);
|
|
1807
|
-
if (habord.mid) {
|
|
1808
|
-
this.groups.add(hid);
|
|
1809
|
-
}
|
|
1810
1676
|
}
|
|
1811
1677
|
catch (error) {
|
|
1812
1678
|
if (!habord.mid && isMissingReloadEventError(error)) {
|
|
@@ -1863,62 +1729,40 @@ export class Baser {
|
|
|
1863
1729
|
* This is the durable export/replay seam for locally stored events. The
|
|
1864
1730
|
* event body comes from `evts.`, while the attached foot is reconstructed
|
|
1865
1731
|
* from the companion stores that hold controller signatures, witness
|
|
1866
|
-
* signatures, source seals, receipts, and first-seen replay metadata.
|
|
1867
|
-
* byte budget preflights the body row before owned materialization and admits
|
|
1868
|
-
* each evidence item before retaining the full message. Unlimited legacy calls
|
|
1869
|
-
* keep their ordinary read path; fixed native scratch is separate overhead.
|
|
1732
|
+
* signatures, source seals, receipts, and first-seen replay metadata.
|
|
1870
1733
|
*/
|
|
1871
|
-
cloneEvtMsg(pre, fn, said,
|
|
1872
|
-
if (maxBytes !== Infinity && (!Number.isSafeInteger(maxBytes) || maxBytes < 1)) {
|
|
1873
|
-
throw new RangeError("Replay byte limit must be a positive safe integer");
|
|
1874
|
-
}
|
|
1734
|
+
cloneEvtMsg(pre, fn, said, requestedGenus = Vrsn_1_0) {
|
|
1875
1735
|
const dgkey = dgKey(pre, said);
|
|
1876
|
-
|
|
1877
|
-
const stored = maxBytes === Infinity
|
|
1878
|
-
? this.getEvt(dgkey)
|
|
1879
|
-
: this.getValBounded(this.evtsRaw, dgkey, maxBytes);
|
|
1736
|
+
const stored = this.getEvt(dgkey);
|
|
1880
1737
|
if (stored === null)
|
|
1881
1738
|
throw new DatabaseOperationError(`Missing event body for ${pre}:${said}`);
|
|
1882
|
-
return this.cloneStoredEvtMsg(pre, fn, said, stored,
|
|
1739
|
+
return this.cloneStoredEvtMsg(pre, fn, said, stored, requestedGenus);
|
|
1883
1740
|
}
|
|
1884
|
-
/** Reconstruct
|
|
1885
|
-
cloneStoredEvtMsg(pre, fn, said, stored,
|
|
1741
|
+
/** Reconstruct stored body bytes without reopening their native row. */
|
|
1742
|
+
cloneStoredEvtMsg(pre, fn, said, stored, requestedGenus = Vrsn_1_0) {
|
|
1886
1743
|
const dgkey = dgKey(pre, said);
|
|
1887
|
-
if (stored.length > maxBytes)
|
|
1888
|
-
throw new ResourceLimitError("Replay message exceeds byte limit");
|
|
1889
1744
|
// Preserve SerderSuber's validation so corrupt records retain clonePreIter's skip behavior.
|
|
1890
1745
|
// SerderKERI recognizes both native CESR and version-string bodies.
|
|
1891
1746
|
const serder = new SerderKERI({ raw: stored });
|
|
1892
1747
|
const raw = serder.raw;
|
|
1893
1748
|
// Preserve body bytes; its declared protocol/genus sets the minimum lawful attachment genus.
|
|
1894
|
-
const gvrsn = resolveAttachmentGvrsn(serder);
|
|
1895
|
-
let size = 0;
|
|
1896
|
-
/** Admit each qualified fragment before retaining it or allocating the complete replay. */
|
|
1897
|
-
const retain = (part) => {
|
|
1898
|
-
if (part.length > maxBytes - size)
|
|
1899
|
-
throw new ResourceLimitError("Replay message exceeds byte limit");
|
|
1900
|
-
size += part.length;
|
|
1901
|
-
return part;
|
|
1902
|
-
};
|
|
1903
|
-
retain(raw);
|
|
1749
|
+
const gvrsn = resolveAttachmentGvrsn(serder, requestedGenus);
|
|
1904
1750
|
const attachments = [];
|
|
1905
|
-
/** Prefix
|
|
1751
|
+
/** Prefix payload pieces without a large argument spread or another copy. */
|
|
1906
1752
|
const group = (name, count, payload) => {
|
|
1907
|
-
attachments.push(
|
|
1753
|
+
attachments.push(attachmentCounterPayloadQb64b(name, count, payload, gvrsn));
|
|
1908
1754
|
for (const part of payload)
|
|
1909
1755
|
attachments.push(part);
|
|
1910
1756
|
};
|
|
1911
|
-
/**
|
|
1757
|
+
/** Read controller and witness signature fragments in stored order. */
|
|
1912
1758
|
const signatures = (entries) => {
|
|
1913
1759
|
const parts = [];
|
|
1914
1760
|
for (const siger of entries)
|
|
1915
|
-
parts.push(
|
|
1761
|
+
parts.push(siger.qb64b);
|
|
1916
1762
|
return parts;
|
|
1917
1763
|
};
|
|
1918
|
-
/**
|
|
1919
|
-
const ordinal = (value) => gvrsn.
|
|
1920
|
-
? seqnerFromNumber(value).qb64b
|
|
1921
|
-
: value.qb64b;
|
|
1764
|
+
/** V1 seals require the fixed Seqner; v2 writes the compact Number whatever width was stored. */
|
|
1765
|
+
const ordinal = (value) => attachmentOrdinal(value, gvrsn).qb64b;
|
|
1922
1766
|
const sigers = signatures(this.sigs.getIter(dgkey));
|
|
1923
1767
|
if (sigers.length === 0)
|
|
1924
1768
|
throw new DatabaseOperationError(`Missing indexed signatures for ${pre}:${said}`);
|
|
@@ -1929,7 +1773,7 @@ export class Baser {
|
|
|
1929
1773
|
const seal = this.aess.get(dgkey);
|
|
1930
1774
|
if (seal !== null) {
|
|
1931
1775
|
const [number, diger] = seal;
|
|
1932
|
-
group("SealSourceCouples", 1, [
|
|
1776
|
+
group("SealSourceCouples", 1, [ordinal(number), diger.qb64b]);
|
|
1933
1777
|
}
|
|
1934
1778
|
// Receipt storage remains per signature; canonical groups share one establishment seal.
|
|
1935
1779
|
const groups = new Map();
|
|
@@ -1938,19 +1782,19 @@ export class Baser {
|
|
|
1938
1782
|
let receipt = groups.get(key);
|
|
1939
1783
|
if (!receipt) {
|
|
1940
1784
|
receipt = {
|
|
1941
|
-
seal: [
|
|
1785
|
+
seal: [prefixer.qb64b, ordinal(snu), diger.qb64b],
|
|
1942
1786
|
signatures: [],
|
|
1943
1787
|
};
|
|
1944
1788
|
groups.set(key, receipt);
|
|
1945
1789
|
}
|
|
1946
|
-
receipt.signatures.push(
|
|
1790
|
+
receipt.signatures.push(siger.qb64b);
|
|
1947
1791
|
}
|
|
1948
1792
|
if (groups.size) {
|
|
1949
1793
|
const payload = [];
|
|
1950
1794
|
for (const receipt of groups.values()) {
|
|
1951
1795
|
for (const part of receipt.seal)
|
|
1952
1796
|
payload.push(part);
|
|
1953
|
-
payload.push(
|
|
1797
|
+
payload.push(attachmentCounterPayloadQb64b("ControllerIdxSigs", receipt.signatures.length, receipt.signatures, gvrsn));
|
|
1954
1798
|
for (const part of receipt.signatures)
|
|
1955
1799
|
payload.push(part);
|
|
1956
1800
|
}
|
|
@@ -1959,7 +1803,7 @@ export class Baser {
|
|
|
1959
1803
|
const receipts = [];
|
|
1960
1804
|
let count = 0;
|
|
1961
1805
|
for (const [prefixer, cigar] of this.rcts.getIter(dgkey)) {
|
|
1962
|
-
receipts.push(
|
|
1806
|
+
receipts.push(prefixer.qb64b, cigar.qb64b);
|
|
1963
1807
|
count++;
|
|
1964
1808
|
}
|
|
1965
1809
|
if (count)
|
|
@@ -1967,15 +1811,16 @@ export class Baser {
|
|
|
1967
1811
|
const dater = this.dtss.get(dgkey);
|
|
1968
1812
|
if (dater === null)
|
|
1969
1813
|
throw new DatabaseOperationError(`Missing datetime stamp for ${pre}:${said}`);
|
|
1970
|
-
//
|
|
1971
|
-
|
|
1972
|
-
|
|
1814
|
+
// KERIpy: v1 attachments carry a Seqner; v2 carries the smallest automatic Number code.
|
|
1815
|
+
const firstSeen = gvrsn.major === 1 ? encodeHugeOrdinal(fn) : NumberPrimitive.fromNum(BigInt(fn));
|
|
1816
|
+
group("FirstSeenReplayCouples", 1, [firstSeen.qb64b, dater.qb64b]);
|
|
1817
|
+
const attachmentSize = attachments.reduce((size, part) => size + part.length, 0);
|
|
1973
1818
|
if (attachmentSize % 4 !== 0) {
|
|
1974
1819
|
throw new DatabaseOperationError(`Invalid attachment quadlet size for ${pre}:${said}`);
|
|
1975
1820
|
}
|
|
1976
|
-
const header =
|
|
1977
|
-
//
|
|
1978
|
-
const message = new Uint8Array(
|
|
1821
|
+
const header = attachmentCounterQb64b("AttachmentGroup", attachmentSize / 4, gvrsn);
|
|
1822
|
+
// Allocate the actual wire extent once, after framing lengths are known.
|
|
1823
|
+
const message = new Uint8Array(raw.length + header.length + attachmentSize);
|
|
1979
1824
|
message.set(raw);
|
|
1980
1825
|
message.set(header, raw.length);
|
|
1981
1826
|
let offset = raw.length + header.length;
|
|
@@ -1994,10 +1839,10 @@ export class Baser {
|
|
|
1994
1839
|
* Errors rebuilding individual events are skipped so export/replay callers
|
|
1995
1840
|
* can continue streaming later entries, matching KERIpy's clone behavior.
|
|
1996
1841
|
*/
|
|
1997
|
-
*clonePreIter(pre, fn = 0) {
|
|
1842
|
+
*clonePreIter(pre, fn = 0, requestedGenus = Vrsn_1_0) {
|
|
1998
1843
|
for (const [, currentFn, said] of this.fels.getAllItemIter(pre, fn)) {
|
|
1999
1844
|
try {
|
|
2000
|
-
yield this.cloneEvtMsg(pre, currentFn, said);
|
|
1845
|
+
yield this.cloneEvtMsg(pre, currentFn, said, requestedGenus);
|
|
2001
1846
|
}
|
|
2002
1847
|
catch {
|
|
2003
1848
|
continue;
|
|
@@ -2010,7 +1855,7 @@ export class Baser {
|
|
|
2010
1855
|
* KERIpy correspondence:
|
|
2011
1856
|
* - mirrors `Baser.cloneDelegation(...)`
|
|
2012
1857
|
*/
|
|
2013
|
-
*cloneDelegation(kever) {
|
|
1858
|
+
*cloneDelegation(kever, requestedGenus = Vrsn_1_0) {
|
|
2014
1859
|
if (!kever.delegated || !kever.delpre) {
|
|
2015
1860
|
return;
|
|
2016
1861
|
}
|
|
@@ -2018,22 +1863,17 @@ export class Baser {
|
|
|
2018
1863
|
if (!delegator) {
|
|
2019
1864
|
return;
|
|
2020
1865
|
}
|
|
2021
|
-
yield* this.cloneDelegation(delegator);
|
|
2022
|
-
yield* this.clonePreIter(kever.delpre, 0);
|
|
1866
|
+
yield* this.cloneDelegation(delegator, requestedGenus);
|
|
1867
|
+
yield* this.clonePreIter(kever.delpre, 0, requestedGenus);
|
|
2023
1868
|
}
|
|
2024
1869
|
/**
|
|
2025
1870
|
* Capture a reopenable replay extent without retaining its event bytes or an LMDB cursor.
|
|
2026
1871
|
* The queried log precedes root-to-parent delegator logs, matching cloneDelegation order.
|
|
2027
1872
|
* Event identities stop at the captured first-seen tails; proofs are read at consumption time.
|
|
2028
1873
|
*/
|
|
2029
|
-
replay(pre, fn = 0
|
|
1874
|
+
replay(pre, fn = 0) {
|
|
2030
1875
|
if (!Number.isSafeInteger(fn) || fn < 0)
|
|
2031
1876
|
throw new RangeError("Replay ordinal must be a non-negative safe integer");
|
|
2032
|
-
for (const limit of [maxDepth, maxMessageBytes]) {
|
|
2033
|
-
if (!Number.isSafeInteger(limit) || limit < 1) {
|
|
2034
|
-
throw new RangeError("Replay limits must be positive safe integers");
|
|
2035
|
-
}
|
|
2036
|
-
}
|
|
2037
1877
|
// Each range is a small immutable identity/ordinal tuple; no event body is read during capture.
|
|
2038
1878
|
const ranges = [];
|
|
2039
1879
|
const ancestors = [];
|
|
@@ -2042,8 +1882,6 @@ export class Baser {
|
|
|
2042
1882
|
while (parent) {
|
|
2043
1883
|
if (visited.has(parent))
|
|
2044
1884
|
throw new DatabaseOperationError("Cyclic replay delegation chain");
|
|
2045
|
-
if (ancestors.length >= maxDepth)
|
|
2046
|
-
throw new ResourceLimitError("Replay delegation depth exceeds limit");
|
|
2047
1885
|
visited.add(parent);
|
|
2048
1886
|
const kever = this.getKever(parent);
|
|
2049
1887
|
if (!kever)
|
|
@@ -2060,12 +1898,12 @@ export class Baser {
|
|
|
2060
1898
|
}
|
|
2061
1899
|
if (ranges.length === 0)
|
|
2062
1900
|
return null;
|
|
2063
|
-
return new CapturedKelReplay(this, ranges
|
|
1901
|
+
return new CapturedKelReplay(this, ranges);
|
|
2064
1902
|
}
|
|
2065
1903
|
/** Capture target-only witness GET replay; explicit sequence queries retain KEL duplicate ordering. */
|
|
2066
|
-
witnessReplay(pre, sn
|
|
2067
|
-
if (typeof pre !== "string" || !pre
|
|
2068
|
-
throw new RangeError("Invalid witness replay prefix
|
|
1904
|
+
witnessReplay(pre, sn) {
|
|
1905
|
+
if (typeof pre !== "string" || !pre) {
|
|
1906
|
+
throw new RangeError("Invalid witness replay prefix");
|
|
2069
1907
|
}
|
|
2070
1908
|
if (sn !== null && (!Number.isSafeInteger(sn) || sn < 0))
|
|
2071
1909
|
throw new RangeError("Invalid witness replay sequence");
|
|
@@ -2075,9 +1913,9 @@ export class Baser {
|
|
|
2075
1913
|
if (!Number.isFinite(felEnd) || felEnd < 0)
|
|
2076
1914
|
throw new DatabaseOperationError("Corrupt witness FEL horizon");
|
|
2077
1915
|
if (!Number.isSafeInteger(felEnd))
|
|
2078
|
-
throw new
|
|
1916
|
+
throw new RangeError("Unsupported witness replay horizon");
|
|
2079
1917
|
if (sn === null)
|
|
2080
|
-
return new CapturedKelReplay(this, [[pre, 0, felEnd]]
|
|
1918
|
+
return new CapturedKelReplay(this, [[pre, 0, felEnd]]);
|
|
2081
1919
|
const start = b(`${pre}.${"f".repeat(32)}`);
|
|
2082
1920
|
for (const entry of this.kels.sdb.getRange({ start, reverse: true, limit: 1 })) {
|
|
2083
1921
|
const [prefix, end] = splitOnKey(entry.key);
|
|
@@ -2086,18 +1924,18 @@ export class Baser {
|
|
|
2086
1924
|
if (!Number.isFinite(end) || end < 0)
|
|
2087
1925
|
throw new DatabaseOperationError("Corrupt witness KEL horizon");
|
|
2088
1926
|
if (!Number.isSafeInteger(end))
|
|
2089
|
-
throw new
|
|
1927
|
+
throw new RangeError("Unsupported witness KEL horizon");
|
|
2090
1928
|
if (end < sn)
|
|
2091
1929
|
return null;
|
|
2092
|
-
return new CapturedWitnessReplay(this, pre, sn, end, felEnd
|
|
1930
|
+
return new CapturedWitnessReplay(this, pre, sn, end, felEnd);
|
|
2093
1931
|
}
|
|
2094
1932
|
return null;
|
|
2095
1933
|
}
|
|
2096
1934
|
/** Read one captured range, retaining only a current event and releasing its cursor before each yield. */
|
|
2097
|
-
*replayRange([current, from, end]
|
|
1935
|
+
*replayRange([current, from, end]) {
|
|
2098
1936
|
if (typeof current !== "string" || !current || !Number.isSafeInteger(from) || from < 0
|
|
2099
|
-
|| !Number.isSafeInteger(end) || end < from
|
|
2100
|
-
throw new RangeError("Invalid captured KEL replay range
|
|
1937
|
+
|| !Number.isSafeInteger(end) || end < from)
|
|
1938
|
+
throw new RangeError("Invalid captured KEL replay range");
|
|
2101
1939
|
let next = from;
|
|
2102
1940
|
while (next <= end) {
|
|
2103
1941
|
const rows = this.fels.getAllItemIter(current, next);
|
|
@@ -2113,18 +1951,15 @@ export class Baser {
|
|
|
2113
1951
|
break;
|
|
2114
1952
|
const [, ordinal, said] = row;
|
|
2115
1953
|
next = ordinal + 1;
|
|
2116
|
-
//
|
|
2117
|
-
const stored = this.
|
|
1954
|
+
// Storage I/O failures are outside the corrupt-record reconstruction skip boundary.
|
|
1955
|
+
const stored = this.getEvt(dgKey(current, said));
|
|
2118
1956
|
if (!stored)
|
|
2119
1957
|
continue;
|
|
2120
1958
|
let message;
|
|
2121
1959
|
try {
|
|
2122
|
-
message = this.cloneStoredEvtMsg(current, ordinal, said, stored
|
|
1960
|
+
message = this.cloneStoredEvtMsg(current, ordinal, said, stored);
|
|
2123
1961
|
}
|
|
2124
|
-
catch
|
|
2125
|
-
// Resource policy is terminal; only corrupt/incomplete replay records are skipped.
|
|
2126
|
-
if (error instanceof ResourceLimitError)
|
|
2127
|
-
throw error;
|
|
1962
|
+
catch {
|
|
2128
1963
|
// KERIpy clonePreIter skips individual corrupt/incomplete replay records.
|
|
2129
1964
|
continue;
|
|
2130
1965
|
}
|
|
@@ -2198,36 +2033,6 @@ export class Baser {
|
|
|
2198
2033
|
return this.hbys.get(name);
|
|
2199
2034
|
}
|
|
2200
2035
|
}
|
|
2201
|
-
Object.defineProperty(Baser, "TailDirPath", {
|
|
2202
|
-
enumerable: true,
|
|
2203
|
-
configurable: true,
|
|
2204
|
-
writable: true,
|
|
2205
|
-
value: "keri/db"
|
|
2206
|
-
});
|
|
2207
|
-
Object.defineProperty(Baser, "AltTailDirPath", {
|
|
2208
|
-
enumerable: true,
|
|
2209
|
-
configurable: true,
|
|
2210
|
-
writable: true,
|
|
2211
|
-
value: ".tufa/db"
|
|
2212
|
-
});
|
|
2213
|
-
Object.defineProperty(Baser, "CompatAltTailDirPath", {
|
|
2214
|
-
enumerable: true,
|
|
2215
|
-
configurable: true,
|
|
2216
|
-
writable: true,
|
|
2217
|
-
value: ".keri/db"
|
|
2218
|
-
});
|
|
2219
|
-
Object.defineProperty(Baser, "TempPrefix", {
|
|
2220
|
-
enumerable: true,
|
|
2221
|
-
configurable: true,
|
|
2222
|
-
writable: true,
|
|
2223
|
-
value: "keri_db_"
|
|
2224
|
-
});
|
|
2225
|
-
Object.defineProperty(Baser, "MaxNamedDBs", {
|
|
2226
|
-
enumerable: true,
|
|
2227
|
-
configurable: true,
|
|
2228
|
-
writable: true,
|
|
2229
|
-
value: 128
|
|
2230
|
-
});
|
|
2231
2036
|
/**
|
|
2232
2037
|
* Thin Effection-native lifecycle host for one `Baser`.
|
|
2233
2038
|
*
|
|
@@ -2283,6 +2088,7 @@ export class BaserDoer {
|
|
|
2283
2088
|
export function* createBaser(options = {}) {
|
|
2284
2089
|
const baser = new Baser(options);
|
|
2285
2090
|
let delivered = false;
|
|
2091
|
+
let failure;
|
|
2286
2092
|
try {
|
|
2287
2093
|
const opened = yield* baser.reopen(options);
|
|
2288
2094
|
if (!opened) {
|
|
@@ -2291,8 +2097,25 @@ export function* createBaser(options = {}) {
|
|
|
2291
2097
|
delivered = true;
|
|
2292
2098
|
return baser;
|
|
2293
2099
|
}
|
|
2100
|
+
catch (error) {
|
|
2101
|
+
failure = { error };
|
|
2102
|
+
throw error;
|
|
2103
|
+
}
|
|
2294
2104
|
finally {
|
|
2295
|
-
if (!delivered)
|
|
2296
|
-
|
|
2105
|
+
if (!delivered) {
|
|
2106
|
+
try {
|
|
2107
|
+
yield* baser.close();
|
|
2108
|
+
}
|
|
2109
|
+
catch (error) {
|
|
2110
|
+
if (failure) {
|
|
2111
|
+
// deno-lint-ignore no-unsafe-finally -- Preserve the operation failure alongside shutdown failure.
|
|
2112
|
+
throw new AggregateError([failure.error, error], "Database acquisition and close failed", {
|
|
2113
|
+
cause: failure.error,
|
|
2114
|
+
});
|
|
2115
|
+
}
|
|
2116
|
+
// deno-lint-ignore no-unsafe-finally -- A shutdown failure must propagate.
|
|
2117
|
+
throw error;
|
|
2118
|
+
}
|
|
2119
|
+
}
|
|
2297
2120
|
}
|
|
2298
2121
|
}
|