keri-ts 2.0.1 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -2
- package/esm/keri/npm/src/acdc/authoring.js +195 -0
- package/esm/keri/npm/src/acdc/chaining.js +223 -89
- package/esm/keri/npm/src/acdc/custody.js +164 -0
- package/esm/keri/npm/src/acdc/dhking.js +244 -32
- package/esm/keri/npm/src/acdc/observing.js +2 -2
- package/esm/keri/npm/src/acdc/regbasing.js +30 -29
- package/esm/keri/npm/src/acdc/regengine.js +4 -6
- package/esm/keri/npm/src/acdc/registering.js +13 -10
- package/esm/keri/npm/src/acdc/registraring.js +4 -9
- package/esm/keri/npm/src/acdc/salting.js +143 -26
- package/esm/keri/npm/src/acdc/scheming.js +93 -54
- package/esm/keri/npm/src/acdc/unblinding.js +120 -99
- package/esm/keri/npm/src/app/bootstrap/authenticating.js +4 -6
- package/esm/keri/npm/src/app/bootstrap/oobi-resolving.js +41 -0
- package/esm/keri/npm/src/app/bootstrap/oobiery.js +5 -7
- package/esm/keri/npm/src/app/credentials/credential-revoking.js +1 -0
- package/esm/keri/npm/src/app/credentials/credential-workflows.js +2 -0
- package/esm/keri/npm/src/app/credentials/registry-settling.js +44 -0
- package/esm/keri/npm/src/app/credentials/root-replicating.js +131 -0
- package/esm/keri/npm/src/app/credentials/root-replicator.js +198 -0
- package/esm/keri/npm/src/app/credentials/tel-completion.js +36 -0
- package/esm/keri/npm/src/app/credentials/verifying.js +12 -3
- package/esm/keri/npm/src/app/delivery/forwarding.js +64 -9
- package/esm/keri/npm/src/app/exchanges/exchanging.js +24 -15
- package/esm/keri/npm/src/app/identity/challenging.js +50 -0
- package/esm/keri/npm/src/app/identity/configing.js +17 -43
- package/esm/keri/npm/src/app/identity/delegating.js +77 -77
- package/esm/keri/npm/src/app/identity/delegation-approval.js +333 -0
- package/esm/keri/npm/src/app/identity/event-completion.js +154 -0
- package/esm/keri/npm/src/app/identity/habbing.js +183 -41
- package/esm/keri/npm/src/app/identity/keeping.js +78 -5
- package/esm/keri/npm/src/app/identity/lmdb-habery.js +12 -0
- package/esm/keri/npm/src/app/ipex/group-ipex.js +327 -0
- package/esm/keri/npm/src/app/ipex/group-issuance.js +902 -0
- package/esm/keri/npm/src/app/ipex/ipex-admitting.js +120 -0
- package/esm/keri/npm/src/app/ipex/ipex-conversation.js +197 -0
- package/esm/keri/npm/src/app/ipex/ipex-discloser.js +591 -0
- package/esm/keri/npm/src/app/ipex/ipex-granting.js +93 -0
- package/esm/keri/npm/src/app/ipex/ipex-graph.js +7 -70
- package/esm/keri/npm/src/app/ipex/ipex-grouping.js +42 -16
- package/esm/keri/npm/src/app/ipex/ipex-v2.js +21 -5
- package/esm/keri/npm/src/app/ipex/ipexing.js +1 -1
- package/esm/keri/npm/src/app/ipex/issuance.js +888 -0
- package/esm/keri/npm/src/app/ipex/pending-presentations.js +46 -0
- package/esm/keri/npm/src/app/ipex/presentation-files.js +200 -0
- package/esm/keri/npm/src/app/ipex/presenting.js +401 -0
- package/esm/keri/npm/src/app/ipex/receive-issuance.js +86 -0
- package/esm/keri/npm/src/app/ipex/unblinding-workflow.js +660 -0
- package/esm/keri/npm/src/app/mailbox/ipex-arrival.js +103 -0
- package/esm/keri/npm/src/app/mailbox/kel-publisher.js +322 -0
- package/esm/keri/npm/src/app/mailbox/kel-publishing.js +65 -0
- package/esm/keri/npm/src/app/mailbox/kel-submission.js +24 -0
- package/esm/keri/npm/src/app/mailbox/mailbox-admin.js +208 -0
- package/esm/keri/npm/src/app/mailbox/mailbox-poller.js +212 -47
- package/esm/keri/npm/src/app/mailbox/mailboxing.js +15 -14
- package/esm/keri/npm/src/app/multisig/counseling.js +482 -0
- package/esm/keri/npm/src/app/multisig/group-members.js +32 -0
- package/esm/keri/npm/src/app/multisig/grouping.js +4 -3
- package/esm/keri/npm/src/app/multisig/multisig-workflows.js +101 -141
- package/esm/keri/npm/src/app/multisig/proposals.js +281 -0
- package/esm/keri/npm/src/app/multisig/proposing.js +122 -0
- package/esm/keri/npm/src/app/notifications/notifying.js +5 -9
- package/esm/keri/npm/src/app/notifications/signaling.js +5 -5
- package/esm/keri/npm/src/app/protocol/parsering.js +26 -1
- package/esm/keri/npm/src/app/protocol/protocol-processing.js +44 -6
- package/esm/keri/npm/src/app/queries/query-workflows.js +98 -0
- package/esm/keri/npm/src/app/queries/witness-inquisitor.js +2 -2
- package/esm/keri/npm/src/app/runtime/agent-runtime.js +113 -65
- package/esm/keri/npm/src/app/runtime/cue-runtime.js +3 -6
- package/esm/keri/npm/src/app/runtime/delivery-outbox.js +87 -0
- package/esm/keri/npm/src/app/runtime/doing.js +17 -0
- package/esm/keri/npm/src/app/runtime/ipex-auxiliaries.js +207 -0
- package/esm/keri/npm/src/app/runtime/operation-owners.js +151 -0
- package/esm/keri/npm/src/app/runtime/retry-backoff.js +93 -0
- package/esm/keri/npm/src/app/runtime/workflow-contract.js +80 -0
- package/esm/keri/npm/src/app/transport/byte-source.js +6 -42
- package/esm/keri/npm/src/app/transport/cesr-egress.js +77 -13
- package/esm/keri/npm/src/app/transport/file-bytes.js +41 -0
- package/esm/keri/npm/src/app/transport/http-client.js +25 -6
- package/esm/keri/npm/src/app/transport/http-messenger.js +14 -9
- package/esm/keri/npm/src/app/transport/message-source.js +1 -1
- package/esm/keri/npm/src/app/transport/messengering.js +3 -4
- package/esm/keri/npm/src/app/transport/node-http-client.js +21 -0
- package/esm/keri/npm/src/app/transport/tcp-dialer.js +14 -0
- package/esm/keri/npm/src/app/witness/http-endpoints.js +4 -4
- package/esm/keri/npm/src/app/witness/receipt-client.js +2 -2
- package/esm/keri/npm/src/cli/common/context.js +2 -2
- package/esm/keri/npm/src/cli/common/event-completion.js +49 -0
- package/esm/keri/npm/src/cli/common/existing.js +3 -5
- package/esm/keri/npm/src/cli/common/runtime-workers.js +23 -0
- package/esm/keri/npm/src/cli/credentials/ipex.js +159 -191
- package/esm/keri/npm/src/cli/credentials/vc.js +53 -72
- package/esm/keri/npm/src/cli/endpoints/did.js +12 -3
- package/esm/keri/npm/src/cli/endpoints/oobi-clean.js +4 -3
- package/esm/keri/npm/src/cli/endpoints/oobi.js +12 -15
- package/esm/keri/npm/src/cli/identity/challenge.js +9 -35
- package/esm/keri/npm/src/cli/identity/delegate.js +81 -258
- package/esm/keri/npm/src/cli/identity/incept.js +17 -34
- package/esm/keri/npm/src/cli/identity/init.js +4 -3
- package/esm/keri/npm/src/cli/identity/interact.js +7 -19
- package/esm/keri/npm/src/cli/identity/rotate.js +10 -38
- package/esm/keri/npm/src/cli/index.js +3 -1
- package/esm/keri/npm/src/cli/messaging/exchange.js +2 -2
- package/esm/keri/npm/src/cli/messaging/group-join.js +79 -0
- package/esm/keri/npm/src/cli/messaging/group-wait.js +88 -0
- package/esm/keri/npm/src/cli/messaging/multisig.js +187 -250
- package/esm/keri/npm/src/cli/messaging/root-copy-lines.js +31 -0
- package/esm/keri/npm/src/cli/tools/annotate.js +2 -1
- package/esm/keri/npm/src/cli/tools/benchmark.js +2 -1
- package/esm/keri/npm/src/cli/tools/db-dump.js +1 -4
- package/esm/keri/npm/src/core/bytes.js +9 -0
- package/esm/keri/npm/src/core/kel/delegation-ancestry.js +92 -0
- package/esm/keri/npm/src/core/kel/eventing.js +67 -12
- package/esm/keri/npm/src/core/kel/kever.js +11 -9
- package/esm/keri/npm/src/core/mailbox/kram-policy.js +41 -9
- package/esm/keri/npm/src/core/mailbox/kram-pruning.js +15 -22
- package/esm/keri/npm/src/core/mailbox/kram-staging.js +2 -2
- package/esm/keri/npm/src/core/mailbox/kraming.js +2 -0
- package/esm/keri/npm/src/core/records.js +23 -0
- package/esm/keri/npm/src/core/routing.js +15 -2
- package/esm/keri/npm/src/db/basing.js +183 -205
- package/esm/keri/npm/src/db/core/dber.js +1062 -0
- package/esm/keri/npm/src/db/core/index.js +4 -2
- package/esm/keri/npm/src/db/core/indexeddb-persistence.js +221 -0
- package/esm/keri/npm/src/db/core/lmdb-opener.js +30 -0
- package/esm/keri/npm/src/db/core/lmdber.js +199 -1067
- package/esm/keri/npm/src/db/core/memstore.js +532 -0
- package/esm/keri/npm/src/db/core/path-manager.js +109 -223
- package/esm/keri/npm/src/db/core/store-owner.js +104 -0
- package/esm/keri/npm/src/db/core/webdber.js +252 -0
- package/esm/keri/npm/src/db/escrowing.js +2 -2
- package/esm/keri/npm/src/db/exchange/exchange-nests.js +3 -2
- package/esm/keri/npm/src/db/indexeddb.js +98 -0
- package/esm/keri/npm/src/db/keeping.js +38 -123
- package/esm/keri/npm/src/db/koming.js +1 -1
- package/esm/keri/npm/src/db/lmdb-stores.js +68 -0
- package/esm/keri/npm/src/db/lmdb.js +6 -0
- package/esm/keri/npm/src/db/mailbox/mailboxing.js +12 -65
- package/esm/keri/npm/src/db/noting.js +11 -55
- package/esm/keri/npm/src/db/reger.js +43 -105
- package/esm/keri/npm/src/db/replay/witness-replay.js +2 -20
- package/esm/keri/npm/src/db/store-lock.js +150 -0
- package/esm/keri/npm/src/db/subing.js +1 -1
- package/esm/keri/npm/src/npm/db-indexeddb.browser.js +2 -0
- package/esm/keri/npm/src/npm/db-indexeddb.js +3 -0
- package/esm/keri/npm/src/npm/db-lmdb.js +3 -0
- package/esm/keri/npm/src/npm/db.browser.js +2 -0
- package/esm/keri/npm/src/npm/index.browser.js +9 -0
- package/esm/keri/npm/src/npm/runtime-node.js +3 -0
- package/esm/keri/npm/src/npm/runtime-web.browser.js +2 -0
- package/esm/keri/npm/src/npm/runtime-web.js +3 -0
- package/esm/keri/npm/src/npm/runtime.browser.js +2 -0
- package/esm/keri/npm/src/runtime/index.js +58 -12
- package/esm/keri/npm/src/runtime/node.js +14 -0
- package/esm/keri/npm/src/runtime/web/output-barrier.js +47 -0
- package/esm/keri/npm/src/runtime/web/persistent-storage.js +37 -0
- package/esm/keri/npm/src/runtime/web.js +10 -0
- package/esm/keri/npm/src/vdr/eventing.js +1 -1
- package/esm/keri/npm/src/vdr/tel-publication.js +19 -3
- package/esm/keri/npm/src/version.js +2 -2
- package/package.json +24 -4
- package/types/acdc/authoring.d.ts +54 -0
- package/types/acdc/authoring.d.ts.map +1 -0
- package/types/acdc/chaining.d.ts +56 -6
- package/types/acdc/chaining.d.ts.map +1 -1
- package/types/acdc/custody.d.ts +77 -0
- package/types/acdc/custody.d.ts.map +1 -0
- package/types/acdc/dhking.d.ts +94 -3
- package/types/acdc/dhking.d.ts.map +1 -1
- package/types/acdc/regbasing.d.ts +11 -6
- package/types/acdc/regbasing.d.ts.map +1 -1
- package/types/acdc/regengine.d.ts.map +1 -1
- package/types/acdc/registering.d.ts +8 -4
- package/types/acdc/registering.d.ts.map +1 -1
- package/types/acdc/registraring.d.ts.map +1 -1
- package/types/acdc/salting.d.ts +59 -7
- package/types/acdc/salting.d.ts.map +1 -1
- package/types/acdc/scheming.d.ts +2 -0
- package/types/acdc/scheming.d.ts.map +1 -1
- package/types/acdc/unblinding.d.ts +58 -19
- package/types/acdc/unblinding.d.ts.map +1 -1
- package/types/app/bootstrap/authenticating.d.ts +3 -1
- package/types/app/bootstrap/authenticating.d.ts.map +1 -1
- package/types/app/bootstrap/oobi-resolving.d.ts +92 -0
- package/types/app/bootstrap/oobi-resolving.d.ts.map +1 -0
- package/types/app/bootstrap/oobiery.d.ts +3 -1
- package/types/app/bootstrap/oobiery.d.ts.map +1 -1
- package/types/app/credentials/credential-revoking.d.ts +3 -0
- package/types/app/credentials/credential-revoking.d.ts.map +1 -1
- package/types/app/credentials/credential-workflows.d.ts +5 -0
- package/types/app/credentials/credential-workflows.d.ts.map +1 -1
- package/types/app/credentials/registry-settling.d.ts +85 -0
- package/types/app/credentials/registry-settling.d.ts.map +1 -0
- package/types/app/credentials/root-replicating.d.ts +97 -0
- package/types/app/credentials/root-replicating.d.ts.map +1 -0
- package/types/app/credentials/root-replicator.d.ts +105 -0
- package/types/app/credentials/root-replicator.d.ts.map +1 -0
- package/types/app/credentials/tel-completion.d.ts +55 -0
- package/types/app/credentials/tel-completion.d.ts.map +1 -0
- package/types/app/credentials/verifying.d.ts +2 -1
- package/types/app/credentials/verifying.d.ts.map +1 -1
- package/types/app/delivery/forwarding.d.ts +16 -0
- package/types/app/delivery/forwarding.d.ts.map +1 -1
- package/types/app/exchanges/exchanging.d.ts +2 -0
- package/types/app/exchanges/exchanging.d.ts.map +1 -1
- package/types/app/identity/challenging.d.ts +54 -0
- package/types/app/identity/challenging.d.ts.map +1 -1
- package/types/app/identity/configing.d.ts +7 -5
- package/types/app/identity/configing.d.ts.map +1 -1
- package/types/app/identity/delegating.d.ts +21 -4
- package/types/app/identity/delegating.d.ts.map +1 -1
- package/types/app/identity/delegation-approval.d.ts +228 -0
- package/types/app/identity/delegation-approval.d.ts.map +1 -0
- package/types/app/identity/event-completion.d.ts +151 -0
- package/types/app/identity/event-completion.d.ts.map +1 -0
- package/types/app/identity/habbing.d.ts +90 -7
- package/types/app/identity/habbing.d.ts.map +1 -1
- package/types/app/identity/keeping.d.ts +50 -4
- package/types/app/identity/keeping.d.ts.map +1 -1
- package/types/app/identity/lmdb-habery.d.ts +6 -0
- package/types/app/identity/lmdb-habery.d.ts.map +1 -0
- package/types/app/ipex/group-ipex.d.ts +247 -0
- package/types/app/ipex/group-ipex.d.ts.map +1 -0
- package/types/app/ipex/group-issuance.d.ts +281 -0
- package/types/app/ipex/group-issuance.d.ts.map +1 -0
- package/types/app/ipex/ipex-admitting.d.ts +47 -0
- package/types/app/ipex/ipex-admitting.d.ts.map +1 -0
- package/types/app/ipex/ipex-conversation.d.ts +195 -0
- package/types/app/ipex/ipex-conversation.d.ts.map +1 -0
- package/types/app/ipex/ipex-discloser.d.ts +156 -0
- package/types/app/ipex/ipex-discloser.d.ts.map +1 -0
- package/types/app/ipex/ipex-granting.d.ts +145 -0
- package/types/app/ipex/ipex-granting.d.ts.map +1 -0
- package/types/app/ipex/ipex-graph.d.ts +4 -4
- package/types/app/ipex/ipex-graph.d.ts.map +1 -1
- package/types/app/ipex/ipex-grouping.d.ts +18 -0
- package/types/app/ipex/ipex-grouping.d.ts.map +1 -1
- package/types/app/ipex/ipex-v2.d.ts +11 -2
- package/types/app/ipex/ipex-v2.d.ts.map +1 -1
- package/types/app/ipex/ipexing.d.ts +3 -0
- package/types/app/ipex/ipexing.d.ts.map +1 -1
- package/types/app/ipex/issuance.d.ts +443 -0
- package/types/app/ipex/issuance.d.ts.map +1 -0
- package/types/app/ipex/pending-presentations.d.ts +25 -0
- package/types/app/ipex/pending-presentations.d.ts.map +1 -0
- package/types/app/ipex/presentation-files.d.ts +47 -0
- package/types/app/ipex/presentation-files.d.ts.map +1 -0
- package/types/app/ipex/presenting.d.ts +298 -0
- package/types/app/ipex/presenting.d.ts.map +1 -0
- package/types/app/ipex/receive-issuance.d.ts +99 -0
- package/types/app/ipex/receive-issuance.d.ts.map +1 -0
- package/types/app/ipex/unblinding-workflow.d.ts +255 -0
- package/types/app/ipex/unblinding-workflow.d.ts.map +1 -0
- package/types/app/mailbox/ipex-arrival.d.ts +104 -0
- package/types/app/mailbox/ipex-arrival.d.ts.map +1 -0
- package/types/app/mailbox/kel-publisher.d.ts +141 -0
- package/types/app/mailbox/kel-publisher.d.ts.map +1 -0
- package/types/app/mailbox/kel-publishing.d.ts +70 -0
- package/types/app/mailbox/kel-publishing.d.ts.map +1 -0
- package/types/app/mailbox/kel-submission.d.ts +18 -0
- package/types/app/mailbox/kel-submission.d.ts.map +1 -0
- package/types/app/mailbox/mailbox-admin.d.ts +113 -0
- package/types/app/mailbox/mailbox-admin.d.ts.map +1 -0
- package/types/app/mailbox/mailbox-poller.d.ts +92 -3
- package/types/app/mailbox/mailbox-poller.d.ts.map +1 -1
- package/types/app/mailbox/mailboxing.d.ts +4 -1
- package/types/app/mailbox/mailboxing.d.ts.map +1 -1
- package/types/app/multisig/counseling.d.ts +196 -0
- package/types/app/multisig/counseling.d.ts.map +1 -0
- package/types/app/multisig/group-members.d.ts +20 -0
- package/types/app/multisig/group-members.d.ts.map +1 -1
- package/types/app/multisig/grouping.d.ts +39 -20
- package/types/app/multisig/grouping.d.ts.map +1 -1
- package/types/app/multisig/multisig-workflows.d.ts +93 -23
- package/types/app/multisig/multisig-workflows.d.ts.map +1 -1
- package/types/app/multisig/proposals.d.ts +129 -0
- package/types/app/multisig/proposals.d.ts.map +1 -0
- package/types/app/multisig/proposing.d.ts +125 -0
- package/types/app/multisig/proposing.d.ts.map +1 -0
- package/types/app/notifications/notifying.d.ts +1 -1
- package/types/app/notifications/notifying.d.ts.map +1 -1
- package/types/app/notifications/signaling.d.ts +3 -1
- package/types/app/notifications/signaling.d.ts.map +1 -1
- package/types/app/protocol/parsering.d.ts +16 -1
- package/types/app/protocol/parsering.d.ts.map +1 -1
- package/types/app/protocol/protocol-processing.d.ts +9 -1
- package/types/app/protocol/protocol-processing.d.ts.map +1 -1
- package/types/app/queries/query-workflows.d.ts +98 -0
- package/types/app/queries/query-workflows.d.ts.map +1 -0
- package/types/app/runtime/agent-runtime.d.ts +79 -25
- package/types/app/runtime/agent-runtime.d.ts.map +1 -1
- package/types/app/runtime/cue-runtime.d.ts +2 -1
- package/types/app/runtime/cue-runtime.d.ts.map +1 -1
- package/types/app/runtime/delivery-outbox.d.ts +68 -0
- package/types/app/runtime/delivery-outbox.d.ts.map +1 -0
- package/types/app/runtime/doing.d.ts +27 -0
- package/types/app/runtime/doing.d.ts.map +1 -0
- package/types/app/runtime/ipex-auxiliaries.d.ts +74 -0
- package/types/app/runtime/ipex-auxiliaries.d.ts.map +1 -0
- package/types/app/runtime/operation-owners.d.ts +137 -0
- package/types/app/runtime/operation-owners.d.ts.map +1 -0
- package/types/app/runtime/retry-backoff.d.ts +49 -0
- package/types/app/runtime/retry-backoff.d.ts.map +1 -0
- package/types/app/runtime/workflow-contract.d.ts +79 -0
- package/types/app/runtime/workflow-contract.d.ts.map +1 -0
- package/types/app/transport/byte-source.d.ts +13 -10
- package/types/app/transport/byte-source.d.ts.map +1 -1
- package/types/app/transport/cesr-egress.d.ts +21 -7
- package/types/app/transport/cesr-egress.d.ts.map +1 -1
- package/types/app/transport/file-bytes.d.ts +11 -0
- package/types/app/transport/file-bytes.d.ts.map +1 -0
- package/types/app/transport/http-client.d.ts +3 -0
- package/types/app/transport/http-client.d.ts.map +1 -1
- package/types/app/transport/http-messenger.d.ts +15 -10
- package/types/app/transport/http-messenger.d.ts.map +1 -1
- package/types/app/transport/message-source.d.ts +1 -1
- package/types/app/transport/messengering.d.ts +2 -2
- package/types/app/transport/messengering.d.ts.map +1 -1
- package/types/app/transport/node-http-client.d.ts +10 -0
- package/types/app/transport/node-http-client.d.ts.map +1 -0
- package/types/app/transport/tcp-dialer.d.ts +21 -0
- package/types/app/transport/tcp-dialer.d.ts.map +1 -0
- package/types/cli/common/event-completion.d.ts +26 -0
- package/types/cli/common/event-completion.d.ts.map +1 -0
- package/types/cli/common/existing.d.ts.map +1 -1
- package/types/cli/common/runtime-workers.d.ts +23 -0
- package/types/cli/common/runtime-workers.d.ts.map +1 -0
- package/types/cli/credentials/ipex.d.ts.map +1 -1
- package/types/cli/credentials/vc.d.ts +1 -1
- package/types/cli/credentials/vc.d.ts.map +1 -1
- package/types/cli/endpoints/did.d.ts.map +1 -1
- package/types/cli/endpoints/oobi-clean.d.ts.map +1 -1
- package/types/cli/endpoints/oobi.d.ts +3 -1
- package/types/cli/endpoints/oobi.d.ts.map +1 -1
- package/types/cli/identity/challenge.d.ts +1 -1
- package/types/cli/identity/challenge.d.ts.map +1 -1
- package/types/cli/identity/delegate.d.ts +14 -1
- package/types/cli/identity/delegate.d.ts.map +1 -1
- package/types/cli/identity/incept.d.ts.map +1 -1
- package/types/cli/identity/init.d.ts.map +1 -1
- package/types/cli/identity/interact.d.ts.map +1 -1
- package/types/cli/identity/rotate.d.ts.map +1 -1
- package/types/cli/index.d.ts +4 -2
- package/types/cli/index.d.ts.map +1 -1
- package/types/cli/messaging/group-join.d.ts +53 -0
- package/types/cli/messaging/group-join.d.ts.map +1 -0
- package/types/cli/messaging/group-wait.d.ts +34 -0
- package/types/cli/messaging/group-wait.d.ts.map +1 -0
- package/types/cli/messaging/multisig.d.ts +36 -4
- package/types/cli/messaging/multisig.d.ts.map +1 -1
- package/types/cli/messaging/root-copy-lines.d.ts +39 -0
- package/types/cli/messaging/root-copy-lines.d.ts.map +1 -0
- package/types/cli/tools/annotate.d.ts.map +1 -1
- package/types/cli/tools/benchmark.d.ts.map +1 -1
- package/types/cli/tools/db-dump.d.ts.map +1 -1
- package/types/core/bytes.d.ts +2 -0
- package/types/core/bytes.d.ts.map +1 -1
- package/types/core/cues.d.ts +11 -0
- package/types/core/cues.d.ts.map +1 -1
- package/types/core/kel/delegation-ancestry.d.ts +41 -0
- package/types/core/kel/delegation-ancestry.d.ts.map +1 -0
- package/types/core/kel/eventing.d.ts.map +1 -1
- package/types/core/kel/kever.d.ts +5 -4
- package/types/core/kel/kever.d.ts.map +1 -1
- package/types/core/mailbox/kram-policy.d.ts +14 -0
- package/types/core/mailbox/kram-policy.d.ts.map +1 -1
- package/types/core/mailbox/kram-pruning.d.ts +1 -3
- package/types/core/mailbox/kram-pruning.d.ts.map +1 -1
- package/types/core/mailbox/kraming.d.ts +1 -1
- package/types/core/mailbox/kraming.d.ts.map +1 -1
- package/types/core/records.d.ts +61 -0
- package/types/core/records.d.ts.map +1 -1
- package/types/core/routing.d.ts +6 -0
- package/types/core/routing.d.ts.map +1 -1
- package/types/db/basing.d.ts +22 -25
- package/types/db/basing.d.ts.map +1 -1
- package/types/db/core/dber.d.ts +505 -0
- package/types/db/core/dber.d.ts.map +1 -0
- package/types/db/core/index.d.ts +4 -2
- package/types/db/core/index.d.ts.map +1 -1
- package/types/db/core/indexeddb-persistence.d.ts +59 -0
- package/types/db/core/indexeddb-persistence.d.ts.map +1 -0
- package/types/db/core/lmdb-opener.d.ts +17 -0
- package/types/db/core/lmdb-opener.d.ts.map +1 -0
- package/types/db/core/lmdber.d.ts +60 -383
- package/types/db/core/lmdber.d.ts.map +1 -1
- package/types/db/core/memstore.d.ts +129 -0
- package/types/db/core/memstore.d.ts.map +1 -0
- package/types/db/core/path-manager.d.ts +22 -45
- package/types/db/core/path-manager.d.ts.map +1 -1
- package/types/db/core/store-owner.d.ts +59 -0
- package/types/db/core/store-owner.d.ts.map +1 -0
- package/types/db/core/webdber.d.ts +127 -0
- package/types/db/core/webdber.d.ts.map +1 -0
- package/types/db/escrowing.d.ts +3 -3
- package/types/db/escrowing.d.ts.map +1 -1
- package/types/db/exchange/exchange-nests.d.ts.map +1 -1
- package/types/db/indexeddb.d.ts +37 -0
- package/types/db/indexeddb.d.ts.map +1 -0
- package/types/db/keeping.d.ts +14 -25
- package/types/db/keeping.d.ts.map +1 -1
- package/types/db/koming.d.ts +7 -8
- package/types/db/koming.d.ts.map +1 -1
- package/types/db/lmdb-stores.d.ts +45 -0
- package/types/db/lmdb-stores.d.ts.map +1 -0
- package/types/db/lmdb.d.ts +7 -0
- package/types/db/lmdb.d.ts.map +1 -0
- package/types/db/mailbox/mailboxing.d.ts +7 -21
- package/types/db/mailbox/mailboxing.d.ts.map +1 -1
- package/types/db/noting.d.ts +7 -12
- package/types/db/noting.d.ts.map +1 -1
- package/types/db/reger.d.ts +7 -11
- package/types/db/reger.d.ts.map +1 -1
- package/types/db/replay/witness-replay.d.ts +0 -2
- package/types/db/replay/witness-replay.d.ts.map +1 -1
- package/types/db/store-lock.d.ts +72 -0
- package/types/db/store-lock.d.ts.map +1 -0
- package/types/db/subing.d.ts +24 -25
- package/types/db/subing.d.ts.map +1 -1
- package/types/npm/db-indexeddb.d.ts +4 -0
- package/types/npm/db-indexeddb.d.ts.map +1 -0
- package/types/npm/db-lmdb.d.ts +4 -0
- package/types/npm/db-lmdb.d.ts.map +1 -0
- package/types/npm/runtime-node.d.ts +4 -0
- package/types/npm/runtime-node.d.ts.map +1 -0
- package/types/npm/runtime-web.d.ts +4 -0
- package/types/npm/runtime-web.d.ts.map +1 -0
- package/types/runtime/index.d.ts +48 -14
- package/types/runtime/index.d.ts.map +1 -1
- package/types/runtime/node.d.ts +15 -0
- package/types/runtime/node.d.ts.map +1 -0
- package/types/runtime/web/output-barrier.d.ts +30 -0
- package/types/runtime/web/output-barrier.d.ts.map +1 -0
- package/types/runtime/web/persistent-storage.d.ts +36 -0
- package/types/runtime/web/persistent-storage.d.ts.map +1 -0
- package/types/runtime/web.d.ts +11 -0
- package/types/runtime/web.d.ts.map +1 -0
- package/types/vdr/tel-publication.d.ts +6 -0
- package/types/vdr/tel-publication.d.ts.map +1 -1
- package/types/version.d.ts +2 -2
- package/esm/keri/npm/src/acdc/relating.js +0 -59
- package/esm/keri/npm/src/cli/common/tel-completion.js +0 -24
- package/esm/keri/npm/src/db/baser-defaults.js +0 -11
- package/types/acdc/relating.d.ts +0 -21
- package/types/acdc/relating.d.ts.map +0 -1
- package/types/cli/common/tel-completion.d.ts +0 -8
- package/types/cli/common/tel-completion.d.ts.map +0 -1
- package/types/db/baser-defaults.d.ts +0 -5
- package/types/db/baser-defaults.d.ts.map +0 -1
|
@@ -5,15 +5,19 @@
|
|
|
5
5
|
* caller consumes that body before leaving the enclosing scope. Neither path
|
|
6
6
|
* implicitly feeds successful response bytes into protocol processing.
|
|
7
7
|
*
|
|
8
|
-
* Match KERIpy's
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* Match KERIpy HTTPMessenger's two wire shapes. A JSON/CBOR/MGPK frame is one
|
|
9
|
+
* detached-attachment POST retaining the exact signed body; only the known
|
|
10
|
+
* pre-intake Falcon media refusal permits a second request, and
|
|
11
|
+
* authentication/application failures and network errors are not retries.
|
|
12
|
+
* A native CESR frame (counter-prefixed body, text or binary domain) is one
|
|
13
|
+
* whole opaque PUT of the serialized frame, as KERIpy sends since PR 1751,
|
|
14
|
+
* because a native body is not JSON and cannot travel in the detached form.
|
|
11
15
|
*/
|
|
12
|
-
import { attachmentPayload, byteString, collectPayload, parse, } from "cesr-ts";
|
|
16
|
+
import { attachmentPayload, byteString, collectPayload, framePayload, Kinds, parse, sniff, } from "cesr-ts";
|
|
13
17
|
import { call, ensure, race, resource, scoped } from "effection";
|
|
14
18
|
import { ValidationError } from "../../core/errors.js";
|
|
15
19
|
import { abortable, cleanupFailures, throwOnAbort } from "../runtime/abortable.js";
|
|
16
|
-
import { CESR_ATTACHMENT_HEADER, CESR_CONTENT_TYPE, CESR_DESTINATION_HEADER, KERIPY_CESR_JSON_CONTENT_TYPE, } from "./cesr-http.js";
|
|
20
|
+
import { buildCesrStreamRequest, CESR_ATTACHMENT_HEADER, CESR_CONTENT_TYPE, CESR_DESTINATION_HEADER, KERIPY_CESR_JSON_CONTENT_TYPE, } from "./cesr-http.js";
|
|
17
21
|
/** Positive remote HTTP refusal, distinct from source, transport, storage and cleanup failure. */
|
|
18
22
|
export class CesrHttpRefusal extends ValidationError {
|
|
19
23
|
/**
|
|
@@ -108,19 +112,79 @@ function openFrameResponse(url, frame, http, options) {
|
|
|
108
112
|
}
|
|
109
113
|
});
|
|
110
114
|
}
|
|
115
|
+
/**
|
|
116
|
+
* Recognize a frame whose body is native CESR rather than a JSON/CBOR/MGPK message.
|
|
117
|
+
* KERIpy HTTPMessenger decides by sniffing the message cold start for a counter in
|
|
118
|
+
* either domain; a hydrated native body carries kind CESR and its raw bytes begin
|
|
119
|
+
* with that fixed-field counter. Opaque fallback bodies without a counter stay ordinary.
|
|
120
|
+
*
|
|
121
|
+
* @param frame Parsed frame whose body kind and raw bytes decide the wire shape.
|
|
122
|
+
* @returns True when the frame must travel as one whole PUT instead of a detached POST.
|
|
123
|
+
*/
|
|
124
|
+
export function isNativeCesrFrame(frame) {
|
|
125
|
+
if (frame.body.kind !== Kinds.cesr)
|
|
126
|
+
return false;
|
|
127
|
+
const cold = sniff(frame.body.raw);
|
|
128
|
+
return cold === "txt" || cold === "bny";
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Select the qualification domain for one native frame's PUT body.
|
|
132
|
+
* The parser hydrates native bodies as qualified text, so the admitted attachment
|
|
133
|
+
* wire is the remaining evidence of a binary source; a bare body stays text.
|
|
134
|
+
*
|
|
135
|
+
* @param frame Native frame whose attachments retain their admitted domain.
|
|
136
|
+
* @returns The source domain KERIpy would have forwarded unchanged.
|
|
137
|
+
*/
|
|
138
|
+
function nativeFrameDomain(frame) {
|
|
139
|
+
const evidence = frame.attachments[0]?.raw;
|
|
140
|
+
return evidence && sniff(evidence) === "bny" ? "bny" : "txt";
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Prepare KERIpy HTTPMessenger's native-stream PUT for one frame.
|
|
144
|
+
* The shared serializer emits the frame's root genus selector, body and one
|
|
145
|
+
* attachment enclosure in the source domain, and that whole payload is the body
|
|
146
|
+
* with an explicit length, exactly as HTTPStreamMessenger sends a prepared stream.
|
|
147
|
+
* Detached CESR-ATTACHMENT/CESR-Genus headers do not apply and no legacy media
|
|
148
|
+
* fallback exists; caller authentication headers are retained.
|
|
149
|
+
*
|
|
150
|
+
* @param frame Native frame; its serialized bytes are the complete request body.
|
|
151
|
+
* @param options Destination, extra headers and optional cancellation.
|
|
152
|
+
* @returns One PUT request whose body is the serialized frame.
|
|
153
|
+
*/
|
|
154
|
+
function* nativeFrameRequest(frame, options) {
|
|
155
|
+
const domain = nativeFrameDomain(frame);
|
|
156
|
+
const bytes = yield* abortable((signal) => collectPayload(framePayload(frame, { domain }), signal), options.signal);
|
|
157
|
+
const prepared = buildCesrStreamRequest(bytes, { destination: options.destination });
|
|
158
|
+
const headers = new Headers(options.headers);
|
|
159
|
+
headers.delete(CESR_DESTINATION_HEADER);
|
|
160
|
+
headers.delete(CESR_ATTACHMENT_HEADER);
|
|
161
|
+
headers.delete("CESR-Genus");
|
|
162
|
+
for (const [key, value] of Object.entries(prepared.headers))
|
|
163
|
+
headers.set(key, value);
|
|
164
|
+
headers.set("Content-Length", String(bytes.byteLength));
|
|
165
|
+
return {
|
|
166
|
+
method: "PUT",
|
|
167
|
+
redirect: "manual",
|
|
168
|
+
headers,
|
|
169
|
+
signal: options.signal,
|
|
170
|
+
body: prepared.body,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
111
173
|
/**
|
|
112
174
|
* Prepare finite request bytes before opening any network attempt.
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
* Requests retain
|
|
175
|
+
* A native frame yields exactly one whole PUT. Ordinary POSTs put normalized text
|
|
176
|
+
* attachments in CESR-ATTACHMENT and send the original body. CESR-Genus retains
|
|
177
|
+
* the observed counter context when stream framing is removed. Requests retain
|
|
116
178
|
* caller authentication headers; sender-owned framing/destination headers replace
|
|
117
179
|
* conflicting caller values. The fallback shares the prepared bytes.
|
|
118
180
|
*
|
|
119
181
|
* @param frame Parsed signed body and attachments; framing preserves the signed body bytes.
|
|
120
182
|
* @param options Destination, extra headers and optional cancellation for ordinary signed-message POSTs.
|
|
121
|
-
* @returns
|
|
183
|
+
* @returns One native PUT, or the current and legacy media choices sharing the same signed body.
|
|
122
184
|
*/
|
|
123
185
|
function* frameRequests(frame, options) {
|
|
186
|
+
if (isNativeCesrFrame(frame))
|
|
187
|
+
return [yield* nativeFrameRequest(frame, options)];
|
|
124
188
|
const header = byteString(yield* abortable((signal) => collectPayload(attachmentPayload(frame, { domain: "txt" }), signal), options.signal));
|
|
125
189
|
const body = frame.body.raw;
|
|
126
190
|
const types = [CESR_CONTENT_TYPE, KERIPY_CESR_JSON_CONTENT_TYPE];
|
|
@@ -202,8 +266,8 @@ function* sendFrame(url, frame, http, options) {
|
|
|
202
266
|
}
|
|
203
267
|
/**
|
|
204
268
|
* Send a CESR source and throw on a completed peer refusal.
|
|
205
|
-
* One parsed frame becomes one POST,
|
|
206
|
-
* source pull. A refusal stops the sequence; prior frames may already be delivered.
|
|
269
|
+
* One parsed frame becomes one request (a detached POST, or one whole PUT for a
|
|
270
|
+
* native frame), and its request scope closes before the next source pull. A refusal stops the sequence; prior frames may already be delivered.
|
|
207
271
|
* Cancellation aborts active work, joins any pending source pull and returns the
|
|
208
272
|
* parser iterator before leaving. There is no automatic retry beyond media fallback.
|
|
209
273
|
* A pending asynchronous source pull can finish after cancellation is requested;
|
|
@@ -224,8 +288,8 @@ export function* postCesr(url, source, http, options = {}) {
|
|
|
224
288
|
}
|
|
225
289
|
/**
|
|
226
290
|
* Send frames sequentially and return a completed peer refusal as data.
|
|
227
|
-
* One parsed frame becomes one POST,
|
|
228
|
-
* source pull. A refusal stops the sequence; prior frames may already be delivered.
|
|
291
|
+
* One parsed frame becomes one request (a detached POST, or one whole PUT for a
|
|
292
|
+
* native frame), and its request scope closes before the next source pull. A refusal stops the sequence; prior frames may already be delivered.
|
|
229
293
|
* Cancellation aborts active work, joins any pending source pull and returns the
|
|
230
294
|
* parser iterator before leaving. There is no automatic retry beyond media fallback.
|
|
231
295
|
*
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/** Local-file byte source. Host-only: it opens files through `Deno`. */
|
|
2
|
+
import * as dntShim from "../../_dnt.shims.js";
|
|
3
|
+
import { checkLimit } from "./byte-source.js";
|
|
4
|
+
/**
|
|
5
|
+
* Stream a local file with fixed-size owned buffers and close it on break or abort.
|
|
6
|
+
*
|
|
7
|
+
* @param path Local filesystem path opened read-only for this iteration.
|
|
8
|
+
* @param options Optional cancellation and positive read buffer size in bytes; defaults to 65536.
|
|
9
|
+
* @yields Owned buffers up to the selected chunk size until file EOF.
|
|
10
|
+
* @throws Open/read failures or cancellation; the file closes on EOF, break or failure.
|
|
11
|
+
*/
|
|
12
|
+
export async function* fileBytes(path, { signal, maxChunkBytes = 64 * 1024 } = {}) {
|
|
13
|
+
checkLimit(maxChunkBytes);
|
|
14
|
+
signal?.throwIfAborted();
|
|
15
|
+
const file = await dntShim.Deno.open(path, { read: true });
|
|
16
|
+
let closed = false;
|
|
17
|
+
/** Interrupt a pending read and release the file exactly once. */
|
|
18
|
+
const close = () => {
|
|
19
|
+
if (!closed) {
|
|
20
|
+
closed = true;
|
|
21
|
+
file.close();
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
signal?.addEventListener("abort", close, { once: true });
|
|
25
|
+
try {
|
|
26
|
+
while (true) {
|
|
27
|
+
signal?.throwIfAborted();
|
|
28
|
+
const chunk = new Uint8Array(maxChunkBytes);
|
|
29
|
+
const size = await file.read(chunk);
|
|
30
|
+
signal?.throwIfAborted();
|
|
31
|
+
if (size === null)
|
|
32
|
+
return;
|
|
33
|
+
if (size > 0)
|
|
34
|
+
yield chunk.subarray(0, size);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
finally {
|
|
38
|
+
signal?.removeEventListener("abort", close);
|
|
39
|
+
close();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -4,6 +4,21 @@ import { ValidationError } from "../../core/errors.js";
|
|
|
4
4
|
import { abortable } from "../runtime/abortable.js";
|
|
5
5
|
import { collectBytes } from "./byte-source.js";
|
|
6
6
|
import { TransportError } from "./transport-error.js";
|
|
7
|
+
/**
|
|
8
|
+
* Native requests and signals that a pending `fetch` still needs. WebKit links an in-flight fetch to
|
|
9
|
+
* its abort signal only weakly: once the `Request`, or an `AbortSignal.any` composite, is garbage
|
|
10
|
+
* collected, `abort()` neither rejects the fetch nor closes the connection, so a halted caller waits
|
|
11
|
+
* forever on a request that WebKit will never settle. A strong reference until the request scope
|
|
12
|
+
* ends keeps the link alive; engines that hold it themselves are unaffected.
|
|
13
|
+
*/
|
|
14
|
+
const inFlight = new Set();
|
|
15
|
+
/**
|
|
16
|
+
* Whether `cause` is the rejection an abort of `signal` produces. Chromium rejects with `signal.reason`;
|
|
17
|
+
* Node 20 and WebKit reject with a fresh native `AbortError`, which is the same cancellation.
|
|
18
|
+
*/
|
|
19
|
+
function isAbort(cause, signal) {
|
|
20
|
+
return cause === signal.reason || (cause instanceof DOMException && cause.name === "AbortError");
|
|
21
|
+
}
|
|
7
22
|
/**
|
|
8
23
|
* Own the native Request, fetch and response reader for one attempt.
|
|
9
24
|
* Construction errors remain outside network classification. Native fetch/read
|
|
@@ -44,6 +59,7 @@ export class FetchHttpClient {
|
|
|
44
59
|
const controller = new AbortController();
|
|
45
60
|
const signal = init.signal ? AbortSignal.any([controller.signal, init.signal]) : controller.signal;
|
|
46
61
|
// These handles let scope teardown join native work before releasing the reader.
|
|
62
|
+
let request;
|
|
47
63
|
let fetching;
|
|
48
64
|
let reader;
|
|
49
65
|
let reading;
|
|
@@ -57,7 +73,9 @@ export class FetchHttpClient {
|
|
|
57
73
|
* @param message Operation detail to combine with the endpoint URL.
|
|
58
74
|
* @returns Original cancellation reason or a TransportError retaining cause.
|
|
59
75
|
*/
|
|
60
|
-
const transportFailure = (cause, message) => signal.aborted && cause
|
|
76
|
+
const transportFailure = (cause, message) => signal.aborted && isAbort(cause, signal)
|
|
77
|
+
? signal.reason
|
|
78
|
+
: new TransportError(`${message} for ${url}`, { cause });
|
|
61
79
|
try {
|
|
62
80
|
signal.throwIfAborted();
|
|
63
81
|
const endpoint = new URL(url);
|
|
@@ -65,7 +83,8 @@ export class FetchHttpClient {
|
|
|
65
83
|
throw new ValidationError("HTTP output requires an HTTP(S) URL without credentials");
|
|
66
84
|
}
|
|
67
85
|
// Construction errors are caller errors, before native network classification.
|
|
68
|
-
|
|
86
|
+
request = new Request(url, { ...init, signal, body: init.body });
|
|
87
|
+
inFlight.add(request).add(signal);
|
|
69
88
|
fetching = fetch(request).catch((cause) => {
|
|
70
89
|
throw transportFailure(cause, "HTTP request failed");
|
|
71
90
|
});
|
|
@@ -99,9 +118,6 @@ export class FetchHttpClient {
|
|
|
99
118
|
signal.throwIfAborted();
|
|
100
119
|
reading = reader.read().catch((cause) => {
|
|
101
120
|
// Node 20 Fetch replaces the supplied reason with a native AbortError during body reads.
|
|
102
|
-
if (signal.aborted && cause instanceof DOMException && cause.name === "AbortError") {
|
|
103
|
-
throw signal.reason;
|
|
104
|
-
}
|
|
105
121
|
throw transportFailure(cause, "HTTP response body failed");
|
|
106
122
|
});
|
|
107
123
|
let result;
|
|
@@ -144,7 +160,7 @@ export class FetchHttpClient {
|
|
|
144
160
|
await pending;
|
|
145
161
|
}
|
|
146
162
|
catch (error) {
|
|
147
|
-
if (error
|
|
163
|
+
if (!isAbort(error, signal) && error !== failure?.error)
|
|
148
164
|
cleanup.push(error);
|
|
149
165
|
}
|
|
150
166
|
}
|
|
@@ -156,6 +172,9 @@ export class FetchHttpClient {
|
|
|
156
172
|
}
|
|
157
173
|
bodySignal?.removeEventListener("abort", abortBody);
|
|
158
174
|
});
|
|
175
|
+
if (request)
|
|
176
|
+
inFlight.delete(request);
|
|
177
|
+
inFlight.delete(signal);
|
|
159
178
|
// Throw outside the Promise leaf so Effection teardown preserves genuine cleanup failures.
|
|
160
179
|
if (cleanup.length) {
|
|
161
180
|
if (failure && failure.error !== signal.reason)
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { chunkBytes } from "./byte-source.js";
|
|
2
2
|
import { attemptPostCesr } from "./cesr-egress.js";
|
|
3
3
|
/**
|
|
4
|
-
* Send ordinary signed messages as ordered HTTP
|
|
4
|
+
* Send ordinary signed messages as ordered HTTP requests and finish response cleanup.
|
|
5
5
|
* Producers own preparation and Poster owns queued work. This component needs no
|
|
6
6
|
* Habery, protocol processor, parser state, timer or response history.
|
|
7
7
|
*
|
|
8
|
-
* Corresponds to
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* permits a second attempt with legacy
|
|
12
|
-
*
|
|
8
|
+
* Corresponds to KERIpy HTTPMessenger. Each complete CESR frame is one request,
|
|
9
|
+
* shaped by its body: a JSON/CBOR/MGPK frame is a POST with the original signed
|
|
10
|
+
* body in the request body and text attachments in CESR-ATTACHMENT, where only
|
|
11
|
+
* the recognized pre-intake media refusal permits a second attempt with legacy
|
|
12
|
+
* media metadata; a native CESR frame (counter-prefixed body) is one whole PUT of
|
|
13
|
+
* the serialized frame with Content-Length and CESR-DESTINATION, matching KERIpy
|
|
14
|
+
* since PR 1751 and without detached headers or media fallback. Successful response
|
|
15
|
+
* bytes are drained and discarded; protocol receiving belongs to independent intake.
|
|
13
16
|
*/
|
|
14
17
|
export class HTTPMessenger {
|
|
15
18
|
/** Bind one endpoint and request metadata; construction performs no I/O. */
|
|
@@ -42,9 +45,11 @@ export class HTTPMessenger {
|
|
|
42
45
|
return this.sendSource((signal) => chunkBytes(msg, { signal }), options);
|
|
43
46
|
}
|
|
44
47
|
/**
|
|
45
|
-
* Iterate
|
|
46
|
-
* A
|
|
47
|
-
*
|
|
48
|
+
* Iterate messages into one request each; this is not whole-stream PUT delivery.
|
|
49
|
+
* A multi-message native stream becomes successive per-frame PUTs, not KERIpy's
|
|
50
|
+
* single bulk PUT. A later malformed message cannot prevent an earlier valid
|
|
51
|
+
* request. Parser, transport, source and cleanup failures propagate; HTTP
|
|
52
|
+
* refusal is typed data.
|
|
48
53
|
*/
|
|
49
54
|
sendSource(source, options = {}) {
|
|
50
55
|
return attemptPostCesr(this.url, source, this.http, { ...this.options, ...options });
|
|
@@ -12,7 +12,7 @@ import { rethrowCleanupFailure } from "../runtime/abortable.js";
|
|
|
12
12
|
* @param protocol Borrowed dispatcher over synchronous domain commits and correlated cue publication.
|
|
13
13
|
* @param kvy Input-owned KEL processor bound to the same store, reply verifier and cue flow.
|
|
14
14
|
* @param options Dispatch policy and optional upstream cancellation; defaults follow the shared processor.
|
|
15
|
-
* @throws Parsing, dispatch and cleanup failures propagate after the pending pull and iterator cleanup join.
|
|
15
|
+
* @throws Parsing, infrastructure dispatch and cleanup failures propagate after the pending pull and iterator cleanup join; one invalid message does not.
|
|
16
16
|
*/
|
|
17
17
|
export function* processMessages(source, protocol, kvy, options = {}) {
|
|
18
18
|
const input = call(function* () {
|
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
import { ValidationError } from "../../core/errors.js";
|
|
10
10
|
import { HTTPMessenger } from "./http-messenger.js";
|
|
11
11
|
import { HTTPStreamMessenger } from "./http-stream-messenger.js";
|
|
12
|
-
import {
|
|
13
|
-
import { TCPStreamMessenger } from "./tcp-stream-messenger.js";
|
|
12
|
+
import { requireTcpDialer } from "./tcp-dialer.js";
|
|
14
13
|
/** Choose HTTPS, HTTP, then TCP and reject a mismatched advertised scheme before I/O. */
|
|
15
14
|
function endpointFrom(urls) {
|
|
16
15
|
for (const scheme of ["https", "http", "tcp"]) {
|
|
@@ -43,7 +42,7 @@ function endpointFrom(urls) {
|
|
|
43
42
|
export function messengerFrom(destination, urls, http, clock, headers) {
|
|
44
43
|
const endpoint = endpointFrom(urls);
|
|
45
44
|
if (endpoint.protocol === "tcp:")
|
|
46
|
-
return
|
|
45
|
+
return requireTcpDialer(http).messenger(endpoint.href, clock);
|
|
47
46
|
return new HTTPMessenger(endpoint.href, http, { destination, headers });
|
|
48
47
|
}
|
|
49
48
|
/**
|
|
@@ -63,6 +62,6 @@ export function messengerFrom(destination, urls, http, clock, headers) {
|
|
|
63
62
|
export function streamMessengerFrom(destination, urls, payload, http, clock, headers) {
|
|
64
63
|
const endpoint = endpointFrom(urls);
|
|
65
64
|
if (endpoint.protocol === "tcp:")
|
|
66
|
-
return
|
|
65
|
+
return requireTcpDialer(http).streamMessenger(endpoint.href, clock, payload);
|
|
67
66
|
return new HTTPStreamMessenger(endpoint.href, http, payload, { destination, headers });
|
|
68
67
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** HTTP client plus TCP egress, for hosts with sockets. */
|
|
2
|
+
import { FetchHttpClient } from "./http-client.js";
|
|
3
|
+
import { TCPMessenger } from "./tcp-messenger.js";
|
|
4
|
+
import { TCPStreamMessenger } from "./tcp-stream-messenger.js";
|
|
5
|
+
/** Dials TCP endpoints through `node:net`. */
|
|
6
|
+
export const nodeTcpDialer = {
|
|
7
|
+
messenger: (url, clock, protocol = null) => new TCPMessenger(url, clock, protocol),
|
|
8
|
+
streamMessenger: (url, clock, payload) => new TCPStreamMessenger(url, clock, payload),
|
|
9
|
+
};
|
|
10
|
+
/** A `FetchHttpClient` that can also reach `tcp:` endpoints. */
|
|
11
|
+
export class NodeHttpClient extends FetchHttpClient {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
Object.defineProperty(this, "tcp", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
configurable: true,
|
|
17
|
+
writable: true,
|
|
18
|
+
value: nodeTcpDialer
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Host seam for TCP egress.
|
|
3
|
+
*
|
|
4
|
+
* Browsers have no TCP, so `HttpClient` carries an optional dialer supplied by
|
|
5
|
+
* hosts that do. Code that reaches a `tcp:` endpoint asks for it here and fails
|
|
6
|
+
* clearly when this host cannot dial.
|
|
7
|
+
*/
|
|
8
|
+
import { ValidationError } from "../../core/errors.js";
|
|
9
|
+
/** Return the host's dialer, or fail for a `tcp:` endpoint this host cannot reach. */
|
|
10
|
+
export function requireTcpDialer(http) {
|
|
11
|
+
if (!http.tcp)
|
|
12
|
+
throw new ValidationError("TCP endpoints are unavailable on this host.");
|
|
13
|
+
return http.tcp;
|
|
14
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Witness HTTP semantic policies for receipts, log queries and endorsed key state; adapters format decisions. */
|
|
2
|
-
import { Ilks
|
|
2
|
+
import { Ilks } from "cesr-ts";
|
|
3
3
|
import { receipt as receiptEvent, reply as replyEvent } from "../../core/protocol-eventing.js";
|
|
4
4
|
import { dgKey } from "../../db/core/keys.js";
|
|
5
5
|
import { inspectCesrRequest } from "../transport/cesr-http.js";
|
|
@@ -178,8 +178,8 @@ export function witnessKeyStateGet(serviceHab, query) {
|
|
|
178
178
|
status: 200,
|
|
179
179
|
body: serviceHab.endorse(replyEvent(`/ksn/${serviceHab.pre}`, kever.state().asDict(), {
|
|
180
180
|
pre: serviceHab.pre,
|
|
181
|
-
pvrsn:
|
|
182
|
-
gvrsn:
|
|
183
|
-
}), { gvrsn:
|
|
181
|
+
pvrsn: serviceHab.kelVersion,
|
|
182
|
+
gvrsn: serviceHab.kelVersion,
|
|
183
|
+
}), { gvrsn: serviceHab.kelVersion }),
|
|
184
184
|
};
|
|
185
185
|
}
|
|
@@ -7,7 +7,7 @@ import { abortable } from "../runtime/abortable.js";
|
|
|
7
7
|
import { collectBytes } from "../transport/byte-source.js";
|
|
8
8
|
import { buildCesrRequest, CESR_CONTENT_TYPE, KERIPY_CESR_JSON_CONTENT_TYPE } from "../transport/cesr-http.js";
|
|
9
9
|
import { HTTPMessenger } from "../transport/http-messenger.js";
|
|
10
|
-
import {
|
|
10
|
+
import { requireTcpDialer } from "../transport/tcp-dialer.js";
|
|
11
11
|
import { inspectReceiptMessage } from "./receipt-messages.js";
|
|
12
12
|
const WitnessReceiptPollAttempts = 20;
|
|
13
13
|
const WitnessReceiptPollDelayMs = 100;
|
|
@@ -71,7 +71,7 @@ export function* sendWitnessMessage(hab, witness, bytes, http, clock, protocol,
|
|
|
71
71
|
}
|
|
72
72
|
const parsed = new URL(url);
|
|
73
73
|
if (parsed.protocol === "tcp:") {
|
|
74
|
-
yield*
|
|
74
|
+
yield* requireTcpDialer(http).messenger(url, clock, protocol).send(bytes, {
|
|
75
75
|
replies: Boolean(protocol),
|
|
76
76
|
local: true,
|
|
77
77
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createAgentRuntime } from "../../app/runtime/agent-runtime.js";
|
|
2
2
|
import { systemClock } from "../../app/runtime/runtime-clock.js";
|
|
3
|
-
import {
|
|
3
|
+
import { NodeHttpClient } from "../../app/transport/node-http-client.js";
|
|
4
4
|
import { ValidationError } from "../../core/errors.js";
|
|
5
5
|
import { setupHby } from "./existing.js";
|
|
6
6
|
/** Open an existing Habery for one CLI command and close it after the callback. */
|
|
@@ -54,7 +54,7 @@ export function* withExistingHab(args, alias, options, use) {
|
|
|
54
54
|
*/
|
|
55
55
|
export function* withAgentRuntime(args, options, use) {
|
|
56
56
|
return yield* withExistingHabery(args, options, function* ({ hby }) {
|
|
57
|
-
const runtime = yield* (options.dependencies?.createAgentRuntime ?? createAgentRuntime)(hby, new
|
|
57
|
+
const runtime = yield* (options.dependencies?.createAgentRuntime ?? createAgentRuntime)(hby, new NodeHttpClient(), systemClock, { kram: hby.cf?.get().kram });
|
|
58
58
|
let failure;
|
|
59
59
|
try {
|
|
60
60
|
return yield* use({ hby, runtime });
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { completeEvent } from "../../app/identity/event-completion.js";
|
|
2
|
+
import { KelPublisher } from "../../app/mailbox/kel-publisher.js";
|
|
3
|
+
import { createProtocolProcessor } from "../../app/protocol/protocol-processing.js";
|
|
4
|
+
import { createAgentRuntime } from "../../app/runtime/agent-runtime.js";
|
|
5
|
+
import { systemClock } from "../../app/runtime/runtime-clock.js";
|
|
6
|
+
import { withRuntimeWorkers } from "./runtime-workers.js";
|
|
7
|
+
/**
|
|
8
|
+
* Compose event-completion dependencies for one CLI command.
|
|
9
|
+
*
|
|
10
|
+
* A short-lived runtime is created only when a delegated event needs workers.
|
|
11
|
+
* It is lent to the library for that one scope with its workers running around
|
|
12
|
+
* the library's observe-only wait, and closed on every exit path.
|
|
13
|
+
*/
|
|
14
|
+
export function cliEventCompletionDeps(hby, http) {
|
|
15
|
+
// A command has no running runtime, so it carries the publisher whose pass `completeEventOrThrow` runs.
|
|
16
|
+
const publisher = new KelPublisher({ hby, http, clock: systemClock });
|
|
17
|
+
return {
|
|
18
|
+
hby,
|
|
19
|
+
publisher,
|
|
20
|
+
rotated: publisher.rotated,
|
|
21
|
+
protocol: createProtocolProcessor(hby),
|
|
22
|
+
http,
|
|
23
|
+
clock: systemClock,
|
|
24
|
+
*withDelegation(hab, use) {
|
|
25
|
+
const runtime = yield* createAgentRuntime(hby, http, systemClock);
|
|
26
|
+
try {
|
|
27
|
+
return yield* withRuntimeWorkers(runtime, { hab, pollMailbox: true }, () => use({ anchorer: runtime.delegating }));
|
|
28
|
+
}
|
|
29
|
+
finally {
|
|
30
|
+
yield* runtime.close();
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* `completeEvent` for commands: an expired delegation wait fails the command with
|
|
37
|
+
* the text the CLI has always printed, then the caller sees the usual result.
|
|
38
|
+
*/
|
|
39
|
+
export function* completeEventOrThrow(deps, ...args) {
|
|
40
|
+
const completion = yield* completeEvent(deps, ...args);
|
|
41
|
+
if (completion.outcome === "timed-out") {
|
|
42
|
+
throw new Error(`Runtime did not converge within ${completion.timeoutMs}ms.`);
|
|
43
|
+
}
|
|
44
|
+
// No fiber runs the publisher in a one-shot command: tell the mailboxes of a completed rotation now. A
|
|
45
|
+
// mailbox that cannot be reached stays owed in the marker and the poller repairs it.
|
|
46
|
+
if (!deps.publisher.rotated.empty)
|
|
47
|
+
yield* deps.publisher.processOnce();
|
|
48
|
+
return completion;
|
|
49
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as dntShim from "../../_dnt.shims.js";
|
|
2
|
-
import { createHabery } from "../../app/identity/
|
|
3
|
-
import { createKeeper,
|
|
2
|
+
import { createHabery } from "../../app/identity/lmdb-habery.js";
|
|
3
|
+
import { createKeeper, lmdbKeeper } from "../../db/lmdb-stores.js";
|
|
4
4
|
import { readPasscode } from "./passcode.js";
|
|
5
5
|
/**
|
|
6
6
|
* Return true when the named keeper already exists and contains keeper globals.
|
|
@@ -10,7 +10,7 @@ import { readPasscode } from "./passcode.js";
|
|
|
10
10
|
* keystore" without mutating on-disk state during the probe.
|
|
11
11
|
*/
|
|
12
12
|
function* keeperExists(name, base = "", temp = false, headDirPath, compat = false) {
|
|
13
|
-
const keeper =
|
|
13
|
+
const keeper = lmdbKeeper({
|
|
14
14
|
name,
|
|
15
15
|
base,
|
|
16
16
|
temp,
|
|
@@ -22,8 +22,6 @@ function* keeperExists(name, base = "", temp = false, headDirPath, compat = fals
|
|
|
22
22
|
name,
|
|
23
23
|
base,
|
|
24
24
|
temp,
|
|
25
|
-
headDirPath,
|
|
26
|
-
compat,
|
|
27
25
|
reopen: true,
|
|
28
26
|
readonly: true,
|
|
29
27
|
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { spawn } from "effection";
|
|
2
|
+
import { runAgentRuntime } from "../../app/runtime/agent-runtime.js";
|
|
3
|
+
/**
|
|
4
|
+
* Run the runtime workers around one observe-only library call.
|
|
5
|
+
*
|
|
6
|
+
* Library workflows only observe (see `app/runtime/workflow-contract.ts`); a
|
|
7
|
+
* one-shot CLI command has no running runtime, so it supplies the workers here.
|
|
8
|
+
* The worker is halted and joined on success, failure and cancellation before
|
|
9
|
+
* the caller can release stores.
|
|
10
|
+
*
|
|
11
|
+
* @param runtime Borrowed composed runtime; the command owns its lifetime.
|
|
12
|
+
* @param options Signer, mailbox polling and command-owned query cue Deck.
|
|
13
|
+
* @param use Observe-only operation that depends on the workers' progress.
|
|
14
|
+
*/
|
|
15
|
+
export function* withRuntimeWorkers(runtime, options, use) {
|
|
16
|
+
const worker = yield* spawn(() => runAgentRuntime(runtime, options));
|
|
17
|
+
try {
|
|
18
|
+
return yield* use();
|
|
19
|
+
}
|
|
20
|
+
finally {
|
|
21
|
+
yield* worker.halt();
|
|
22
|
+
}
|
|
23
|
+
}
|