keri-ts 2.1.0 → 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/custody.js +164 -0
- package/esm/keri/npm/src/acdc/dhking.js +244 -32
- package/esm/keri/npm/src/acdc/regbasing.js +10 -0
- package/esm/keri/npm/src/acdc/salting.js +16 -1
- package/esm/keri/npm/src/acdc/scheming.js +93 -54
- package/esm/keri/npm/src/acdc/unblinding.js +118 -95
- 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 +4 -6
- 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 +68 -60
- 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/delivery/forwarding.js +16 -3
- package/esm/keri/npm/src/app/exchanges/exchanging.js +14 -4
- package/esm/keri/npm/src/app/identity/challenging.js +50 -0
- 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 +129 -6
- package/esm/keri/npm/src/app/identity/keeping.js +77 -4
- 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-grouping.js +34 -11
- 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 +10 -5
- package/esm/keri/npm/src/app/multisig/counseling.js +482 -0
- package/esm/keri/npm/src/app/multisig/group-members.js +18 -0
- package/esm/keri/npm/src/app/multisig/multisig-workflows.js +94 -139
- 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/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 +9 -3
- package/esm/keri/npm/src/app/queries/query-workflows.js +98 -0
- package/esm/keri/npm/src/app/runtime/agent-runtime.js +106 -55
- 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/http-client.js +25 -6
- package/esm/keri/npm/src/app/witness/http-endpoints.js +4 -4
- package/esm/keri/npm/src/cli/common/event-completion.js +49 -0
- package/esm/keri/npm/src/cli/common/runtime-workers.js +23 -0
- package/esm/keri/npm/src/cli/credentials/ipex.js +157 -190
- 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.js +10 -13
- package/esm/keri/npm/src/cli/identity/challenge.js +8 -34
- package/esm/keri/npm/src/cli/identity/delegate.js +81 -258
- package/esm/keri/npm/src/cli/identity/incept.js +15 -32
- package/esm/keri/npm/src/cli/identity/interact.js +5 -17
- package/esm/keri/npm/src/cli/identity/rotate.js +8 -36
- package/esm/keri/npm/src/cli/index.js +3 -1
- 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 +163 -284
- package/esm/keri/npm/src/cli/messaging/root-copy-lines.js +31 -0
- package/esm/keri/npm/src/core/kel/eventing.js +66 -10
- package/esm/keri/npm/src/core/mailbox/kram-policy.js +39 -6
- 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 +13 -0
- package/esm/keri/npm/src/db/basing.js +34 -2
- package/esm/keri/npm/src/db/core/indexeddb-persistence.js +221 -0
- package/esm/keri/npm/src/db/indexeddb.js +98 -0
- package/esm/keri/npm/src/db/keeping.js +11 -2
- package/esm/keri/npm/src/db/store-lock.js +150 -0
- 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.browser.js +2 -0
- package/esm/keri/npm/src/npm/index.browser.js +9 -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 +51 -4
- 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/tel-publication.js +16 -0
- package/esm/keri/npm/src/version.js +2 -2
- package/package.json +15 -2
- package/types/acdc/authoring.d.ts +54 -0
- package/types/acdc/authoring.d.ts.map +1 -0
- 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 +4 -0
- package/types/acdc/regbasing.d.ts.map +1 -1
- package/types/acdc/salting.d.ts +6 -1
- 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 +56 -44
- package/types/app/credentials/root-replicating.d.ts.map +1 -1
- 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/delivery/forwarding.d.ts +6 -0
- package/types/app/delivery/forwarding.d.ts.map +1 -1
- 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/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 +67 -2
- package/types/app/identity/habbing.d.ts.map +1 -1
- package/types/app/identity/keeping.d.ts +49 -3
- package/types/app/identity/keeping.d.ts.map +1 -1
- 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-grouping.d.ts +18 -0
- package/types/app/ipex/ipex-grouping.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 +3 -0
- 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 +11 -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 +91 -22
- 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/signaling.d.ts +3 -1
- package/types/app/notifications/signaling.d.ts.map +1 -1
- package/types/app/protocol/parsering.d.ts +13 -0
- package/types/app/protocol/parsering.d.ts.map +1 -1
- package/types/app/protocol/protocol-processing.d.ts +7 -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 +72 -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/http-client.d.ts.map +1 -1
- 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/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.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/interact.d.ts.map +1 -1
- package/types/cli/identity/rotate.d.ts.map +1 -1
- package/types/cli/index.d.ts +3 -1
- 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 +28 -5
- 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/core/cues.d.ts +11 -0
- package/types/core/cues.d.ts.map +1 -1
- package/types/core/kel/eventing.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/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 +8 -2
- package/types/db/basing.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/indexeddb.d.ts +37 -0
- package/types/db/indexeddb.d.ts.map +1 -0
- package/types/db/keeping.d.ts +5 -2
- package/types/db/keeping.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/npm/db-indexeddb.d.ts +4 -0
- package/types/npm/db-indexeddb.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 +41 -6
- package/types/runtime/index.d.ts.map +1 -1
- 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/cli/common/tel-completion.js +0 -24
- package/types/cli/common/tel-completion.d.ts +0 -8
- package/types/cli/common/tel-completion.d.ts.map +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import * as dntShim from "../../_dnt.shims.js";
|
|
2
2
|
import { concatBytes } from "cesr-ts";
|
|
3
|
-
import { call, spawn } from "effection";
|
|
4
3
|
import { importCredentialStream } from "../../app/credentials/credential-importing.js";
|
|
5
4
|
import { deliverCredentialRevocation, revocationRecipients, revokeCredential, } from "../../app/credentials/credential-revoking.js";
|
|
6
5
|
import { createCredential, credentialRegistryRecords, credentialRegistryStatus, credentialStreamBytes, exportCredentialStream, inceptCredentialRegistry, listCredentials, pinSchemaBytes, } from "../../app/credentials/credential-workflows.js";
|
|
6
|
+
import { waitForIssuedCredential, waitForTelEvent } from "../../app/credentials/tel-completion.js";
|
|
7
7
|
import { isLocalGroupHab, localGroupMember } from "../../app/multisig/group-members.js";
|
|
8
|
-
import {
|
|
8
|
+
import { proposeCredentialIssue, proposeCredentialRegistry, proposeCredentialRevocation, } from "../../app/multisig/proposing.js";
|
|
9
9
|
import { ValidationError } from "../../core/errors.js";
|
|
10
10
|
import { withAgentRuntime, withExistingHabery } from "../common/context.js";
|
|
11
11
|
import { parseBooleanOption, parseNumberOption, parseStringListOption, parseStringOption } from "../common/parsing.js";
|
|
12
|
-
import {
|
|
12
|
+
import { withRuntimeWorkers } from "../common/runtime-workers.js";
|
|
13
13
|
/** Implement `tufa vc schema import` by pinning JSON schemas into `schema.`. */
|
|
14
14
|
export function* vcSchemaImportCommand(args) {
|
|
15
15
|
const vcArgs = {
|
|
@@ -35,29 +35,22 @@ export function* vcRegistryInceptCommand(args) {
|
|
|
35
35
|
const hab = requireHab(hby, vcArgs.alias);
|
|
36
36
|
const group = isLocalGroupHab(hby, hab);
|
|
37
37
|
const signer = group ? localGroupMember(hby, hab.pre) : hab;
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
created.
|
|
49
|
-
if (created.group)
|
|
50
|
-
created.group.
|
|
51
|
-
if (created.group.accepted)
|
|
52
|
-
created.group.status = "accept";
|
|
53
|
-
}
|
|
54
|
-
return created;
|
|
55
|
-
}
|
|
56
|
-
finally {
|
|
57
|
-
yield* worker.halt();
|
|
38
|
+
return yield* withRuntimeWorkers(runtime, { hab: signer, pollMailbox: group }, function* () {
|
|
39
|
+
const deadline = Date.now() + timeout * 1000;
|
|
40
|
+
const options = { registryName: vcArgs.registryName, estOnly: vcArgs.estOnly, usage: vcArgs.usage };
|
|
41
|
+
const created = group
|
|
42
|
+
? yield* proposeCredentialRegistry(proposeDeps(rgy, runtime), hab, options, GROUP_INPUTS)
|
|
43
|
+
: yield* inceptCredentialRegistry(rgy, runtime.reactor, runtime.postman, hab, options);
|
|
44
|
+
const waited = yield* waitForTelEvent(rgy, created.registry, 0, { deadline });
|
|
45
|
+
created.publicationComplete = waited.outcome === "settled";
|
|
46
|
+
// Report the accepted state the wait ended with; sending the proposal is not acceptance.
|
|
47
|
+
if (created.group) {
|
|
48
|
+
created.group.accepted = rgy.reger.tels.getOn(created.registry, 0)?.qb64 === created.registry;
|
|
49
|
+
if (created.group.accepted)
|
|
50
|
+
created.group.status = "accept";
|
|
58
51
|
}
|
|
52
|
+
return created;
|
|
59
53
|
});
|
|
60
|
-
return result;
|
|
61
54
|
});
|
|
62
55
|
}
|
|
63
56
|
/** Implement `tufa vc registry list` from local `Reger.regs` state. */
|
|
@@ -112,34 +105,23 @@ export function* vcCreateCommand(args) {
|
|
|
112
105
|
throw new ValidationError("Selected alias does not control this registry.");
|
|
113
106
|
const group = isLocalGroupHab(hby, issuer);
|
|
114
107
|
const signer = group ? localGroupMember(hby, issuer.pre) : issuer;
|
|
115
|
-
const result = yield*
|
|
116
|
-
const
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
created.publicationComplete = rgy.publication.complete(created.creder.said);
|
|
131
|
-
if (saved)
|
|
132
|
-
created.status = "accept";
|
|
133
|
-
if (created.group) {
|
|
134
|
-
created.group.saved = saved;
|
|
135
|
-
if (rgy.reger.tels.getOn(created.creder.said, 0)?.qb64 === created.tel)
|
|
136
|
-
created.group.telStatus = "accept";
|
|
137
|
-
}
|
|
138
|
-
return created;
|
|
139
|
-
}
|
|
140
|
-
finally {
|
|
141
|
-
yield* worker.halt();
|
|
108
|
+
const result = yield* withRuntimeWorkers(runtime, { hab: signer, pollMailbox: group }, function* () {
|
|
109
|
+
const deadline = Date.now() + timeout * 1000;
|
|
110
|
+
const options = { registryName: vcArgs.registryName, schema: schema, recipient, data, edges, rules };
|
|
111
|
+
const created = group
|
|
112
|
+
? yield* proposeCredentialIssue(proposeDeps(rgy, runtime), options, GROUP_INPUTS)
|
|
113
|
+
: yield* createCredential(rgy, runtime.reactor, runtime.postman, options);
|
|
114
|
+
yield* waitForIssuedCredential(rgy, created.creder.said, { deadline });
|
|
115
|
+
const saved = rgy.reger.saved.get(created.creder.said) !== null;
|
|
116
|
+
created.publicationComplete = rgy.publication.complete(created.creder.said);
|
|
117
|
+
if (saved)
|
|
118
|
+
created.status = "accept";
|
|
119
|
+
if (created.group) {
|
|
120
|
+
created.group.saved = saved;
|
|
121
|
+
if (rgy.reger.tels.getOn(created.creder.said, 0)?.qb64 === created.tel)
|
|
122
|
+
created.group.telStatus = "accept";
|
|
142
123
|
}
|
|
124
|
+
return created;
|
|
143
125
|
});
|
|
144
126
|
if (vcArgs.out) {
|
|
145
127
|
writeBytes(credentialStreamBytes(hby, reger, result.creder, result.recipient), vcArgs.out);
|
|
@@ -235,28 +217,22 @@ export function* vcRevokeCommand(args) {
|
|
|
235
217
|
}
|
|
236
218
|
const group = isLocalGroupHab(hby, registry.hab);
|
|
237
219
|
const signer = group ? localGroupMember(hby, registry.hab.pre) : registry.hab;
|
|
238
|
-
const result = yield*
|
|
239
|
-
const
|
|
240
|
-
const
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
revoked.
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
if (recipients.length > 0) {
|
|
253
|
-
revoked.deliveries = yield* deliverCredentialRevocation(rgy, postman, revoked.said, recipients);
|
|
254
|
-
}
|
|
255
|
-
return revoked;
|
|
256
|
-
}
|
|
257
|
-
finally {
|
|
258
|
-
yield* worker.halt();
|
|
220
|
+
const result = yield* withRuntimeWorkers(runtime, { hab: signer, pollMailbox: group }, function* () {
|
|
221
|
+
const deadline = Date.now() + timeout * 1000;
|
|
222
|
+
const options = { registryName: vcArgs.registryName, credentialSaid: vcArgs.said };
|
|
223
|
+
const revoked = group
|
|
224
|
+
? yield* proposeCredentialRevocation(proposeDeps(rgy, runtime), options, GROUP_INPUTS)
|
|
225
|
+
: yield* revokeCredential(rgy, runtime.reactor, runtime.postman, options);
|
|
226
|
+
const waited = yield* waitForTelEvent(rgy, revoked.said, 1, { deadline });
|
|
227
|
+
revoked.publicationComplete = waited.outcome === "settled";
|
|
228
|
+
revoked.accepted = reger.tels.getOn(revoked.said, 1)?.qb64 === revoked.tel;
|
|
229
|
+
if (revoked.accepted)
|
|
230
|
+
revoked.status = "accept";
|
|
231
|
+
const recipients = revocationRecipients(revoked.creder, vcArgs.send ?? [], !!vcArgs.alias);
|
|
232
|
+
if (recipients.length > 0) {
|
|
233
|
+
revoked.deliveries = yield* deliverCredentialRevocation(rgy, runtime.postman, revoked.said, recipients);
|
|
259
234
|
}
|
|
235
|
+
return revoked;
|
|
260
236
|
});
|
|
261
237
|
if (vcArgs.out && result.accepted && result.publicationComplete) {
|
|
262
238
|
const recipient = vcArgs.recipient ? resolveAid(hby, vcArgs.recipient) : result.creder.issuee ?? "";
|
|
@@ -265,6 +241,11 @@ export function* vcRevokeCommand(args) {
|
|
|
265
241
|
return result;
|
|
266
242
|
});
|
|
267
243
|
}
|
|
244
|
+
/** Every group member submits receipts for the anchors it proposes, as this command always has. */
|
|
245
|
+
const GROUP_INPUTS = { fallbackAfterMs: 0 };
|
|
246
|
+
function proposeDeps(rgy, runtime) {
|
|
247
|
+
return { rgy, input: runtime.reactor, postman: runtime.postman, counselor: runtime.counselor };
|
|
248
|
+
}
|
|
268
249
|
function baseArgs(args) {
|
|
269
250
|
return {
|
|
270
251
|
name: parseStringOption(args.name, "name"),
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
* DID-related CLI operations shared by the Tufa command dispatcher.
|
|
3
3
|
*/
|
|
4
4
|
import * as dntShim from "../../_dnt.shims.js";
|
|
5
|
+
import { beginOobi, waitForOobi } from "../../app/bootstrap/oobi-resolving.js";
|
|
5
6
|
import { isLocalGroupHab } from "../../app/multisig/group-members.js";
|
|
6
|
-
import { runAgentRuntimeUntil, runtimeOobiConverged } from "../../app/runtime/agent-runtime.js";
|
|
7
7
|
import { WitnessReceiptor } from "../../app/witness/receipting.js";
|
|
8
8
|
import { ValidationError } from "../../core/errors.js";
|
|
9
9
|
import { bindDesignatedAliases, DEFAULT_DESIGNATED_ALIASES_REGISTRY_NAME, generateDidWebsArtifacts, parseDidKeriIdentifier, parseDidWebs, resolveDidKeri, resolveDidWebs, } from "../../did/index.js";
|
|
10
10
|
import { withAgentRuntime } from "../common/context.js";
|
|
11
11
|
import { parseBooleanOption, parseStringListOption, parseStringOption, requireNonEmpty } from "../common/parsing.js";
|
|
12
|
+
import { withRuntimeWorkers } from "../common/runtime-workers.js";
|
|
12
13
|
/** Implement `tufa dws bind`. */
|
|
13
14
|
export function* dwsBindCommand(args) {
|
|
14
15
|
const commandArgs = {
|
|
@@ -125,9 +126,17 @@ export function* dkrResolveCommand(args) {
|
|
|
125
126
|
if (!rgy)
|
|
126
127
|
throw new ValidationError("Legacy credential registry is unavailable in this runtime.");
|
|
127
128
|
for (const oobi of commandArgs.oobis)
|
|
128
|
-
runtime.oobiery
|
|
129
|
+
beginOobi({ oobiery: runtime.oobiery }, oobi);
|
|
129
130
|
if (commandArgs.oobis.length > 0) {
|
|
130
|
-
|
|
131
|
+
// Each wait observes its own URL's record; the jobs progress together under one set of workers.
|
|
132
|
+
yield* withRuntimeWorkers(runtime, { pollMailbox: false }, function* () {
|
|
133
|
+
for (const url of commandArgs.oobis) {
|
|
134
|
+
const result = yield* waitForOobi({ db: hby.db }, url, { timeoutMs: 30_000 });
|
|
135
|
+
if (result.outcome === "timed-out") {
|
|
136
|
+
throw new Error(`OOBI ${url} did not resolve within ${result.timeoutMs}ms.`);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
});
|
|
131
140
|
}
|
|
132
141
|
const result = resolveDidKeri(hby, rgy, did);
|
|
133
142
|
console.log(JSON.stringify(commandArgs.meta ? result.resolution : result.document, null, 2));
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { resolveOobi } from "../../app/bootstrap/oobi-resolving.js";
|
|
2
2
|
import { OOBI_MAILBOX_TOPIC, OOBI_REQUEST_ROUTE, oobiRequestExn } from "../../app/bootstrap/oobiery.js";
|
|
3
3
|
import { sendExchangeMessage } from "../../app/exchanges/exchange-messaging.js";
|
|
4
|
-
import { enqueueOobi, runAgentRuntimeUntil, runtimeOobiConverged } from "../../app/runtime/agent-runtime.js";
|
|
5
4
|
import { systemClock } from "../../app/runtime/runtime-clock.js";
|
|
6
5
|
import { NodeHttpClient } from "../../app/transport/node-http-client.js";
|
|
7
6
|
import { ValidationError } from "../../core/errors.js";
|
|
8
7
|
import { EndpointRoles, isEndpointRole } from "../../core/roles.js";
|
|
9
8
|
import { parseBooleanOption, parseStringOption } from "../common/parsing.js";
|
|
10
9
|
import { withAgentRuntime, withExistingHab } from "../common/context.js";
|
|
10
|
+
import { withRuntimeWorkers } from "../common/runtime-workers.js";
|
|
11
11
|
/**
|
|
12
12
|
* Choose one preferred URL from a scheme-keyed location map.
|
|
13
13
|
*
|
|
@@ -107,7 +107,9 @@ export function* oobiGenerateCommand(args) {
|
|
|
107
107
|
*
|
|
108
108
|
* The command queues one OOBI job, runs the shared workers, and succeeds only if
|
|
109
109
|
* the URL lands in `roobi.`. Any reply/event material fetched from the OOBI is
|
|
110
|
-
* forced through the same parser/routing path used by the long-lived host.
|
|
110
|
+
* forced through the same parser/routing path used by the long-lived host. It
|
|
111
|
+
* waits on that URL's own record, never on unrelated pending runtime work such
|
|
112
|
+
* as group proposals or delegation escrows.
|
|
111
113
|
*/
|
|
112
114
|
export function* oobiResolveCommand(args) {
|
|
113
115
|
const commandArgs = {
|
|
@@ -132,17 +134,12 @@ export function* oobiResolveCommand(args) {
|
|
|
132
134
|
skipConfig: false,
|
|
133
135
|
skipSignator: false,
|
|
134
136
|
}, function* ({ runtime }) {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
});
|
|
139
|
-
yield* runAgentRuntimeUntil(runtime, () => runtimeOobiConverged(runtime, url), { timeoutMs: 30_000, pollMailbox: false });
|
|
140
|
-
const terminal = oobiTerminalState(runtime.hby.db, url);
|
|
141
|
-
if (terminal.status === "failed") {
|
|
142
|
-
throw new ValidationError(`OOBI ${url} failed: ${terminal.record?.state ?? "failed"}`);
|
|
137
|
+
const result = yield* withRuntimeWorkers(runtime, { pollMailbox: false }, () => resolveOobi({ oobiery: runtime.oobiery, db: runtime.hby.db }, url, { alias: commandArgs.oobiAlias, timeoutMs: 30_000 }));
|
|
138
|
+
if (result.outcome === "timed-out") {
|
|
139
|
+
throw new Error(`OOBI ${url} did not resolve within ${result.timeoutMs}ms.`);
|
|
143
140
|
}
|
|
144
|
-
if (
|
|
145
|
-
throw new ValidationError(`OOBI ${url}
|
|
141
|
+
if (result.status.state === "failed") {
|
|
142
|
+
throw new ValidationError(`OOBI ${url} failed: ${result.status.reason}`);
|
|
146
143
|
}
|
|
147
144
|
console.log(url);
|
|
148
145
|
});
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { sendExchangeMessage } from "../../app/exchanges/exchange-messaging.js";
|
|
3
|
-
import { CHALLENGE_RESPONSE_ROUTE, findVerifiedChallengeResponse, formatChallengeWords, generateChallengeWords, markChallengeVerified, parseChallengeWords, } from "../../app/identity/challenging.js";
|
|
1
|
+
import { challengeStatus, formatChallengeWords, generateChallengeWords, markChallengeVerified, parseChallengeWords, respondToChallenge, waitForChallengeResponse, } from "../../app/identity/challenging.js";
|
|
4
2
|
import { Organizer } from "../../app/identity/organizing.js";
|
|
5
|
-
import { isLocalGroupHab } from "../../app/multisig/group-members.js";
|
|
6
|
-
import { runAgentRuntime } from "../../app/runtime/agent-runtime.js";
|
|
7
3
|
import { systemClock } from "../../app/runtime/runtime-clock.js";
|
|
8
4
|
import { NodeHttpClient } from "../../app/transport/node-http-client.js";
|
|
9
5
|
import { ValidationError } from "../../core/errors.js";
|
|
10
6
|
import { parseBooleanOption, parseIntegerOption, parseNumberOption, parseStringOption } from "../common/parsing.js";
|
|
11
7
|
import { withAgentRuntime, withExistingHab } from "../common/context.js";
|
|
8
|
+
import { withRuntimeWorkers } from "../common/runtime-workers.js";
|
|
12
9
|
/** Implement `tufa challenge generate`. */
|
|
13
10
|
export function* challengeGenerateCommand(args) {
|
|
14
11
|
const commandArgs = {
|
|
@@ -58,16 +55,7 @@ export function* challengeRespondCommand(args) {
|
|
|
58
55
|
skipConfig: false,
|
|
59
56
|
skipSignator: false,
|
|
60
57
|
}, function* ({ hby, hab }) {
|
|
61
|
-
|
|
62
|
-
throw new ValidationError("Challenge respond does not coordinate group approval. Select the responding member alias.");
|
|
63
|
-
}
|
|
64
|
-
const payload = { words };
|
|
65
|
-
const { serder } = yield* sendExchangeMessage(hby, hab, new NodeHttpClient(), systemClock, {
|
|
66
|
-
dest: recipient,
|
|
67
|
-
route: CHALLENGE_RESPONSE_ROUTE,
|
|
68
|
-
topic: "challenge",
|
|
69
|
-
payload: { i: hab.pre, ...payload },
|
|
70
|
-
});
|
|
58
|
+
const serder = yield* respondToChallenge({ hby, http: new NodeHttpClient(), clock: systemClock }, hab, recipient, words);
|
|
71
59
|
console.log("Sent EXN message");
|
|
72
60
|
console.log(serder.pretty());
|
|
73
61
|
});
|
|
@@ -125,20 +113,12 @@ export function* challengeVerifyCommand(args) {
|
|
|
125
113
|
runtime.mailboxDirector.registerTopic("/challenge");
|
|
126
114
|
const timeoutMs = commandArgs.timeout * 1000;
|
|
127
115
|
const pollDelayMs = commandArgs.pollDelayMs;
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
try {
|
|
133
|
-
while (!match && Date.now() < deadline) {
|
|
134
|
-
yield* sleep(Math.min(pollDelayMs, Math.max(0, deadline - Date.now())));
|
|
135
|
-
match = findVerifiedChallengeResponse(hby.db, signer, words);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
finally {
|
|
139
|
-
yield* worker.halt();
|
|
140
|
-
}
|
|
116
|
+
let status = challengeStatus(hby, signer, words);
|
|
117
|
+
if (status.state === "waiting" && timeoutMs > 0) {
|
|
118
|
+
const waited = yield* withRuntimeWorkers(runtime, {}, () => waitForChallengeResponse(hby, signer, words, { timeoutMs, pollMs: pollDelayMs }));
|
|
119
|
+
status = waited.status;
|
|
141
120
|
}
|
|
121
|
+
const match = status.state === "waiting" ? null : status.response;
|
|
142
122
|
if (!match) {
|
|
143
123
|
throw new ValidationError(`No challenge response from ${signerInput} matched the provided words.`);
|
|
144
124
|
}
|
|
@@ -166,12 +146,6 @@ function normalizeOutput(input) {
|
|
|
166
146
|
}
|
|
167
147
|
throw new ValidationError(`Unsupported challenge output ${String(input)}.`);
|
|
168
148
|
}
|
|
169
|
-
function* sleep(ms) {
|
|
170
|
-
yield* action((resolve) => {
|
|
171
|
-
const timeoutId = setTimeout(() => resolve(undefined), ms);
|
|
172
|
-
return () => clearTimeout(timeoutId);
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
149
|
/** Challenge entropy is a positive whole bit count; omission selects the command default. */
|
|
176
150
|
function parseStrength(value) {
|
|
177
151
|
const strength = parseIntegerOption(value, "strength") ?? 128;
|