@dxos/credentials 0.6.14-main.2b6a0f3 → 0.6.14-main.f49f251

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.
@@ -1,12 +1,5 @@
1
1
  import "@dxos/node-std/globals";
2
2
 
3
- // inject-globals:@inject-globals
4
- import {
5
- global,
6
- Buffer,
7
- process
8
- } from "@dxos/node-std/inject-globals";
9
-
10
3
  // packages/core/halo/credentials/src/invitations.ts
11
4
  var defaultSecretProvider = async () => Buffer.from("0000");
12
5
  var defaultSecretValidator = async (invitation, secret) => true;
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/invitations.ts", "../../../src/seedphrase.ts", "../../../src/passcode.ts", "../../../src/credentials/signing.ts", "../../../src/presentations/signing.ts", "../../../src/credentials/assertions.ts", "../../../src/credentials/credential-factory.ts", "../../../src/credentials/verifier.ts", "../../../src/credentials/credential-generator.ts", "../../../src/presentations/presentation.ts", "../../../src/presentations/verifier.ts", "../../../src/state-machine/space-state-machine.ts", "../../../src/state-machine/feed-state-machine.ts", "../../../src/state-machine/invitation-state-machine.ts", "../../../src/state-machine/member-state-machine.ts", "../../../src/graph/credential-graph.ts", "../../../src/processor/device-state-machine.ts", "../../../src/processor/profile-state-machine.ts"],
4
4
  "sourcesContent": ["//\n// Copyright 2019 DXOS.org\n//\n\n/**\n * Info required for offline invitations.\n */\n// TODO(burdon): Define types.\nexport interface SecretInfo {\n id: any;\n authNonce: any;\n}\n\n/**\n * Provides a shared secret during an invitation process.\n */\nexport type SecretProvider = (info?: SecretInfo) => Promise<Buffer>;\n\n/**\n * Validates the shared secret during an invitation process.\n */\nexport type SecretValidator = (invitation: never, secret: Buffer) => Promise<boolean>;\n\nexport const defaultSecretProvider: SecretProvider = async () => Buffer.from('0000');\n\nexport const defaultSecretValidator: SecretValidator = async (invitation, secret) => true;\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { generateMnemonic, mnemonicToSeedSync } from 'bip39';\n\nimport { createKeyPair } from '@dxos/crypto';\nimport { invariant } from '@dxos/invariant';\nimport { type KeyPair } from '@dxos/keys';\n\n/**\n * Generate bip39 seed phrase (aka mnemonic).\n */\nexport const generateSeedPhrase = (): string => generateMnemonic();\n\n/**\n * Generate key pair from seed phrase.\n */\nexport const keyPairFromSeedPhrase = (seedPhrase: string): KeyPair => {\n invariant(seedPhrase);\n const seed = mnemonicToSeedSync(seedPhrase);\n return createKeyPair(seed);\n};\n", "//\n// Copyright 2019 DXOS.org\n//\n\n/**\n * Generates a numeric passcode.\n * @param {number} length\n * @returns {string}\n */\nexport const generatePasscode = (length = 4) => {\n let passcode = '';\n for (let i = 0; i < length; i++) {\n passcode += `${Math.floor(Math.random() * 10)}`;\n }\n\n return passcode;\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport stableStringify from 'json-stable-stringify';\n\nimport { PublicKey } from '@dxos/keys';\nimport { type Credential } from '@dxos/protocols/proto/dxos/halo/credentials';\nimport { Timeframe } from '@dxos/timeframe';\nimport { arrayToBuffer } from '@dxos/util';\n\n/**\n * @returns The input message to be signed for a given credential.\n */\n// TODO(nf): rename, this returns not the proof itself, but the payload for verifying against the proof.\nexport const getCredentialProofPayload = (credential: Credential): Uint8Array => {\n const copy = {\n ...credential,\n proof: {\n ...credential.proof,\n value: new Uint8Array(),\n chain: undefined,\n },\n };\n if (copy.parentCredentialIds?.length === 0) {\n delete copy.parentCredentialIds;\n }\n delete copy.id; // ID is not part of the signature payload.\n\n return Buffer.from(canonicalStringify(copy));\n};\n\n/**\n * Utility method to produce stable output for signing/verifying.\n */\nexport const canonicalStringify = (obj: any) =>\n stableStringify(obj, {\n /* The point of signing and verifying is not that the internal, private state of the objects be\n * identical, but that the public contents can be verified not to have been altered. For that reason,\n * really private fields (indicated by '__') are not included in the signature.\n * This gives a mechanism for attaching other attributes to an object without breaking the signature.\n * We also skip @type.\n */\n // TODO(dmaretskyi): Should we actually skip the @type field?\n replacer: function (this: any, key: any, value: any) {\n if (key.toString().startsWith('__') || key.toString() === '@type') {\n return undefined;\n }\n\n if (value === null) {\n return undefined;\n }\n\n // Value before .toJSON() is called.\n const original = this[key];\n\n if (value) {\n if (PublicKey.isPublicKey(value)) {\n return value.toHex();\n }\n if (Buffer.isBuffer(value)) {\n return value.toString('hex');\n }\n\n if (value instanceof Uint8Array) {\n return arrayToBuffer(value).toString('hex');\n }\n if (value.data && value.type === 'Buffer') {\n return Buffer.from(value).toString('hex');\n }\n if (original instanceof Timeframe) {\n // Uses old key truncation method (339d...9d66) to keep backwards compatibility.\n return original.frames().reduce((frames: Record<string, number>, [key, seq]) => {\n frames[truncateKey(key)] = seq;\n return frames;\n }, {});\n }\n }\n\n return value;\n },\n });\n\n/**\n * Old key truncation method (339d...9d66) to keep backwards compatibility with credentials signed with old method\n */\nconst truncateKey = (key: PublicKey) => {\n const str = key.toHex();\n return `${str.substring(0, 4)}...${str.substring(str.length - 4)}`;\n};\n\n/**\n * export const truncateKey = (key: any, { length = 8, start }: TruncateKeyOptions = {}) => {\nconst str = String(key);\nif (str.length <= length) {\n return str;\n}\n\nreturn start\n ? `${str.slice(0, length)}...`\n : `${str.substring(0, length / 2)}...${str.substring(str.length - length / 2)}`;\n};\n\n{\n\"04009285\": 20,\n\"0415004f\": 0,\n\"0415e6d7\": 9964,\n\"042a4fa9\": 8,\n\"0448e62f\": 3,\n\"04775053\": 257,\n\"04a6b603\": 97,\n\"04bc5c9d\": 198,\n\"04da9930\": 59,\n\"04df0449\": 676,\n\"04e122ae\": 5435,\n\"04ee588b\": 1703\n}\n\n */\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Credential, type Proof } from '@dxos/protocols/proto/dxos/halo/credentials';\n\nimport { canonicalStringify } from '../credentials/signing';\n\nexport const getPresentationProofPayload = (credentials: Credential[], proof: Proof): Uint8Array => {\n const copy = {\n credentials: credentials.map((credential) => removeEmptyParentCredentialIds(credential)),\n proof: {\n ...proof,\n value: new Uint8Array(),\n chain: undefined,\n },\n };\n\n return Buffer.from(canonicalStringify(copy));\n};\n\nconst removeEmptyParentCredentialIds = (credential: Credential): Credential => {\n const copy = {\n ...credential,\n proof: credential.proof\n ? {\n ...credential.proof,\n chain: credential.proof.chain\n ? { credential: removeEmptyParentCredentialIds(credential.proof.chain.credential) }\n : undefined,\n }\n : undefined,\n };\n if (copy.parentCredentialIds?.length === 0) {\n delete copy.parentCredentialIds;\n }\n return copy;\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { type PublicKey } from '@dxos/keys';\nimport { type TypedMessage, type TYPES } from '@dxos/protocols/proto';\nimport { type Credential } from '@dxos/protocols/proto/dxos/halo/credentials';\n\nexport const getCredentialAssertion = (credential: Credential): TypedMessage => credential.subject.assertion;\n\nexport const isValidAuthorizedDeviceCredential = (\n credential: Credential,\n identityKey: PublicKey,\n deviceKey: PublicKey,\n): boolean => {\n const assertion = getCredentialAssertion(credential);\n return (\n credential.subject.id.equals(deviceKey) &&\n credential.issuer.equals(identityKey) &&\n assertion['@type'] === 'dxos.halo.credentials.AuthorizedDevice' &&\n assertion.identityKey.equals(identityKey) &&\n assertion.deviceKey.equals(deviceKey)\n );\n};\n\nexport type SpecificCredential<T> = Omit<Credential, 'subject'> & {\n subject: Omit<Credential['subject'], 'assertion'> & { assertion: T };\n};\n\nexport const checkCredentialType = <K extends keyof TYPES>(\n credential: Credential,\n type: K,\n): credential is SpecificCredential<TYPES[K]> => credential.subject.assertion['@type'] === type;\n\nexport const credentialTypeFilter =\n <K extends keyof TYPES>(type: K) =>\n (credential: Credential): credential is SpecificCredential<TYPES[K]> =>\n checkCredentialType(credential, type);\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { type Signer, subtleCrypto } from '@dxos/crypto';\nimport { invariant } from '@dxos/invariant';\nimport { PublicKey } from '@dxos/keys';\nimport { type TypedMessage } from '@dxos/protocols/proto';\nimport { type Chain, type Credential } from '@dxos/protocols/proto/dxos/halo/credentials';\n\nimport { getCredentialProofPayload } from './signing';\nimport { SIGNATURE_TYPE_ED25519, verifyChain } from './verifier';\n\nexport type CreateCredentialSignerParams = {\n subject: PublicKey;\n assertion: TypedMessage;\n nonce?: Uint8Array;\n parentCredentialIds?: PublicKey[];\n};\n\nexport type CreateCredentialParams = {\n signer: Signer;\n issuer: PublicKey;\n signingKey?: PublicKey;\n\n // Provided only if signer is different from issuer.\n chain?: Chain;\n\n subject: PublicKey;\n assertion: TypedMessage;\n nonce?: Uint8Array;\n parentCredentialIds?: PublicKey[];\n};\n\n/**\n * Construct a signed credential message.\n */\nexport const createCredential = async ({\n signer,\n issuer,\n subject,\n assertion,\n signingKey,\n chain,\n nonce,\n parentCredentialIds,\n}: CreateCredentialParams): Promise<Credential> => {\n invariant(assertion['@type'], 'Invalid assertion.');\n invariant(!!signingKey === !!chain, 'Chain must be provided if and only if the signing key differs from the issuer.');\n if (chain) {\n const result = await verifyChain(chain, issuer, signingKey!);\n invariant(result.kind === 'pass', 'Invalid chain.');\n }\n\n // Create the credential with proof value and chain fields missing (for signature payload).\n const credential: Credential = {\n issuer,\n issuanceDate: new Date(),\n subject: {\n id: subject,\n assertion,\n },\n parentCredentialIds,\n proof: {\n type: SIGNATURE_TYPE_ED25519,\n creationDate: new Date(),\n signer: signingKey ?? issuer,\n value: new Uint8Array(),\n nonce,\n },\n };\n\n // Set proof after creating signature.\n const signedPayload = getCredentialProofPayload(credential);\n credential.proof!.value = await signer.sign(signingKey ?? issuer, signedPayload);\n if (chain) {\n credential.proof!.chain = chain;\n }\n\n credential.id = PublicKey.from(await subtleCrypto.digest('SHA-256', signedPayload));\n\n return credential;\n};\n\n// TODO(burdon): Use consistently (merge halo/echo protocol packages).\nexport const createCredentialMessage = (credential: Credential) => {\n return {\n '@type': 'dxos.echo.feed.CredentialsMessage',\n credential,\n };\n};\n\n// TODO(burdon): Vs. Signer.\nexport interface CredentialSigner {\n getIssuer(): PublicKey;\n createCredential: (params: CreateCredentialSignerParams) => Promise<Credential>;\n}\n\n/**\n * Issue credentials directly signed by the issuer.\n */\nexport const createCredentialSignerWithKey = (signer: Signer, issuer: PublicKey): CredentialSigner => ({\n getIssuer: () => issuer,\n createCredential: ({ subject, assertion, nonce, parentCredentialIds }) =>\n createCredential({\n signer,\n issuer,\n subject,\n assertion,\n nonce,\n parentCredentialIds,\n }),\n});\n\n/**\n * Issue credentials with transitive proof via a chain.\n */\nexport const createCredentialSignerWithChain = (\n signer: Signer,\n chain: Chain,\n signingKey: PublicKey,\n): CredentialSigner => ({\n getIssuer: () => chain.credential.issuer,\n createCredential: ({ subject, assertion, nonce, parentCredentialIds }) =>\n createCredential({\n signer,\n issuer: chain.credential.issuer,\n signingKey,\n chain,\n subject,\n assertion,\n nonce,\n parentCredentialIds,\n }),\n});\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { verifySignature } from '@dxos/crypto';\nimport { type PublicKey } from '@dxos/keys';\nimport { type Chain, type Credential } from '@dxos/protocols/proto/dxos/halo/credentials';\n\nimport { isValidAuthorizedDeviceCredential } from './assertions';\nimport { getCredentialProofPayload } from './signing';\n\nexport const SIGNATURE_TYPE_ED25519 = 'ED25519Signature';\n\nexport type VerificationResult = { kind: 'pass' } | { kind: 'fail'; errors: string[] };\n\nexport const verifyCredential = async (credential: Credential): Promise<VerificationResult> => {\n if (credential.parentCredentialIds?.length === 0) {\n delete credential.parentCredentialIds;\n }\n\n if (!credential.issuer.equals(credential.proof!.signer)) {\n if (!credential.proof!.chain) {\n return {\n kind: 'fail',\n errors: ['Delegated credential is missing credential chain.'],\n };\n }\n\n const result = await verifyChain(credential.proof!.chain, credential.issuer, credential.proof!.signer);\n if (result.kind === 'fail') {\n return result;\n }\n }\n\n const result = await verifyCredentialSignature(credential);\n if (result.kind === 'fail') {\n return result;\n }\n\n return { kind: 'pass' };\n};\n\n/**\n * Verifies that the signature is valid and was made by the signer.\n * Does not validate other semantics (e.g. chains).\n */\nexport const verifyCredentialSignature = async (credential: Credential): Promise<VerificationResult> => {\n if (credential.proof!.type !== SIGNATURE_TYPE_ED25519) {\n return {\n kind: 'fail',\n errors: [`Invalid signature type: ${credential.proof!.type}`],\n };\n }\n\n const signData = getCredentialProofPayload(credential);\n if (!(await verifySignature(credential.proof!.signer, signData, credential.proof!.value))) {\n return { kind: 'fail', errors: ['Invalid signature'] };\n }\n\n return { kind: 'pass' };\n};\n\n/**\n * Verifies that the signer has the delegated authority to create credentials on behalf of the issuer.\n */\nexport const verifyChain = async (\n chain: Chain,\n authority: PublicKey,\n subject: PublicKey,\n): Promise<VerificationResult> => {\n const result = await verifyCredential(chain.credential);\n if (result.kind === 'fail') {\n return result;\n }\n\n if (!isValidAuthorizedDeviceCredential(chain.credential, authority, subject)) {\n return {\n kind: 'fail',\n errors: [`Invalid credential chain: invalid assertion for key: ${subject}`],\n };\n }\n\n return { kind: 'pass' };\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { type Signer } from '@dxos/crypto';\nimport { type PublicKey } from '@dxos/keys';\nimport { type TypedMessage } from '@dxos/protocols/proto';\nimport { type FeedMessage } from '@dxos/protocols/proto/dxos/echo/feed';\nimport {\n AdmittedFeed,\n type Credential,\n type DeviceProfileDocument,\n type ProfileDocument,\n SpaceMember,\n} from '@dxos/protocols/proto/dxos/halo/credentials';\nimport { type DelegateSpaceInvitation } from '@dxos/protocols/proto/dxos/halo/invitations';\nimport { Timeframe } from '@dxos/timeframe';\n\nimport { createCredential, type CredentialSigner } from './credential-factory';\n\n// TODO(burdon): Normalize generate and functions below.\n// Use throughout stack and in tests.\n\n/**\n * Utility class for generating credential messages, where the issuer is the current identity or device.\n */\nexport class CredentialGenerator {\n constructor(\n private readonly _signer: Signer,\n private readonly _identityKey: PublicKey,\n private readonly _deviceKey: PublicKey,\n ) {}\n\n /**\n * Create genesis messages for new Space.\n */\n async createSpaceGenesis(\n spaceKey: PublicKey,\n controlKey: PublicKey,\n creatorProfile?: ProfileDocument,\n ): Promise<Credential[]> {\n return [\n await createCredential({\n signer: this._signer,\n issuer: spaceKey,\n subject: spaceKey,\n assertion: {\n '@type': 'dxos.halo.credentials.SpaceGenesis',\n spaceKey,\n },\n }),\n\n await createCredential({\n signer: this._signer,\n issuer: spaceKey,\n subject: this._identityKey,\n assertion: {\n '@type': 'dxos.halo.credentials.SpaceMember',\n spaceKey,\n role: SpaceMember.Role.ADMIN,\n profile: creatorProfile,\n genesisFeedKey: controlKey,\n },\n }),\n\n await this.createFeedAdmission(spaceKey, controlKey, AdmittedFeed.Designation.CONTROL),\n ];\n }\n\n /**\n * Create invitation.\n * Admit identity and control and data feeds.\n */\n // TODO(burdon): Reconcile with above (esp. Signer).\n async createMemberInvitation(\n spaceKey: PublicKey,\n identityKey: PublicKey,\n deviceKey: PublicKey,\n controlKey: PublicKey,\n dataKey: PublicKey,\n genesisFeedKey: PublicKey,\n ): Promise<Credential[]> {\n return [\n await createCredential({\n signer: this._signer,\n issuer: this._identityKey,\n subject: identityKey,\n assertion: {\n '@type': 'dxos.halo.credentials.SpaceMember',\n spaceKey,\n role: SpaceMember.Role.EDITOR,\n genesisFeedKey,\n },\n }),\n\n await this.createFeedAdmission(spaceKey, controlKey, AdmittedFeed.Designation.CONTROL),\n await this.createFeedAdmission(spaceKey, dataKey, AdmittedFeed.Designation.DATA),\n ];\n }\n\n /**\n * Add device to space.\n */\n // TODO(burdon): Reconcile with below.\n async createDeviceAuthorization(deviceKey: PublicKey): Promise<Credential> {\n return createCredential({\n signer: this._signer,\n issuer: this._identityKey,\n subject: deviceKey,\n assertion: {\n '@type': 'dxos.halo.credentials.AuthorizedDevice',\n identityKey: this._identityKey,\n deviceKey,\n },\n });\n }\n\n /**\n * Add device metadata.\n */\n async createDeviceProfile(profile: DeviceProfileDocument): Promise<Credential> {\n return createCredential({\n signer: this._signer,\n issuer: this._identityKey,\n subject: this._deviceKey,\n assertion: {\n '@type': 'dxos.halo.credentials.DeviceProfile',\n profile,\n },\n });\n }\n\n /**\n * Add feed to space.\n */\n async createFeedAdmission(\n spaceKey: PublicKey,\n feedKey: PublicKey,\n designation: AdmittedFeed.Designation,\n ): Promise<Credential> {\n return createCredential({\n signer: this._signer,\n issuer: this._identityKey,\n subject: feedKey,\n assertion: {\n '@type': 'dxos.halo.credentials.AdmittedFeed',\n spaceKey,\n identityKey: this._identityKey,\n deviceKey: this._deviceKey,\n designation,\n },\n });\n }\n\n async createProfileCredential(profile: ProfileDocument): Promise<Credential> {\n return createCredential({\n signer: this._signer,\n issuer: this._identityKey,\n subject: this._identityKey,\n assertion: {\n '@type': 'dxos.halo.credentials.IdentityProfile',\n profile,\n },\n });\n }\n\n async createEpochCredential(spaceKey: PublicKey): Promise<Credential> {\n return createCredential({\n signer: this._signer,\n issuer: this._identityKey,\n subject: spaceKey,\n assertion: {\n '@type': 'dxos.halo.credentials.Epoch',\n number: 0,\n timeframe: new Timeframe(),\n },\n });\n }\n}\n\n// TODO(burdon): Reconcile with above (esp. Signer).\nexport const createDeviceAuthorization = async (\n signer: CredentialSigner,\n identityKey: PublicKey,\n deviceKey: PublicKey,\n): Promise<TypedMessage[]> => {\n const credentials = await Promise.all([\n await signer.createCredential({\n subject: deviceKey,\n assertion: {\n '@type': 'dxos.halo.credentials.AuthorizedDevice',\n identityKey,\n deviceKey,\n },\n }),\n ]);\n\n return credentials.map((credential) => ({\n '@type': 'dxos.echo.feed.CredentialsMessage',\n credential,\n }));\n};\n\n// TODO(burdon): Reconcile with above (esp. Signer).\n/**\n * @param signer - invitation signer.\n * @param identityKey - identity key of the admitted member.\n * @param spaceKey - subject space key.\n * @param genesisFeedKey - genesis feed key of the space.\n * @param role - role of the newly added member.\n * @param membershipChainHeads - ids of the last known SpaceMember credentials (branching possible).\n * @param profile - profile of the newly added member.\n * @param invitationCredentialId - id of the delegated invitation credential in case one was used to add the member.\n */\nexport const createAdmissionCredentials = async (\n signer: CredentialSigner,\n identityKey: PublicKey,\n spaceKey: PublicKey,\n genesisFeedKey: PublicKey,\n role: SpaceMember.Role = SpaceMember.Role.ADMIN,\n membershipChainHeads: PublicKey[] = [],\n profile?: ProfileDocument,\n invitationCredentialId?: PublicKey,\n): Promise<FeedMessage.Payload[]> => {\n const credentials = await Promise.all([\n await signer.createCredential({\n subject: identityKey,\n parentCredentialIds: membershipChainHeads,\n assertion: {\n '@type': 'dxos.halo.credentials.SpaceMember',\n spaceKey,\n role,\n profile,\n genesisFeedKey,\n invitationCredentialId,\n },\n }),\n ]);\n\n return credentials.map((credential) => ({\n credential: { credential },\n }));\n};\n\nexport const createDelegatedSpaceInvitationCredential = async (\n signer: CredentialSigner,\n subject: PublicKey,\n invitation: DelegateSpaceInvitation,\n): Promise<FeedMessage.Payload> => {\n const credential = await signer.createCredential({\n subject,\n assertion: {\n '@type': 'dxos.halo.invitations.DelegateSpaceInvitation',\n invitationId: invitation.invitationId,\n authMethod: invitation.authMethod,\n swarmKey: invitation.swarmKey,\n role: invitation.role,\n guestKey: invitation.guestKey,\n expiresOn: invitation.expiresOn,\n multiUse: invitation.multiUse,\n },\n });\n return { credential: { credential } };\n};\n\n/**\n * @param signer - credential issuer.\n * @param subject - key of the space the invitation was for.\n * @param invitationCredentialId id of a dxos.halo.invitations.DelegateSpaceInvitation credential.\n */\nexport const createCancelDelegatedSpaceInvitationCredential = async (\n signer: CredentialSigner,\n subject: PublicKey,\n invitationCredentialId: PublicKey,\n): Promise<FeedMessage.Payload> => {\n const credential = await signer.createCredential({\n subject,\n assertion: {\n '@type': 'dxos.halo.invitations.CancelDelegatedInvitation',\n credentialId: invitationCredentialId,\n },\n });\n return { credential: { credential } };\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Signer } from '@dxos/crypto';\nimport { type PublicKey } from '@dxos/keys';\nimport { type Chain, type Presentation, type Proof } from '@dxos/protocols/proto/dxos/halo/credentials';\n\nimport { getPresentationProofPayload } from './signing';\nimport { SIGNATURE_TYPE_ED25519 } from '../credentials';\n\n// TODO(burdon): Rename createPresentation?\nexport const signPresentation = async ({\n presentation,\n signer,\n signerKey,\n chain,\n nonce,\n}: {\n presentation: Presentation;\n signer: Signer;\n signerKey: PublicKey;\n chain?: Chain;\n nonce?: Uint8Array;\n}): Promise<Presentation> => {\n const proof: Proof = {\n type: SIGNATURE_TYPE_ED25519,\n value: new Uint8Array(),\n creationDate: new Date(),\n signer: signerKey,\n nonce,\n };\n\n const signedPayload = getPresentationProofPayload(presentation.credentials ?? [], proof);\n proof.value = await signer.sign(signerKey, signedPayload);\n if (chain) {\n proof.chain = chain;\n }\n\n return {\n credentials: presentation.credentials,\n proofs: [...(presentation.proofs ?? []), proof],\n };\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { verifySignature } from '@dxos/crypto';\nimport { type Presentation, type Proof } from '@dxos/protocols/proto/dxos/halo/credentials';\n\nimport { getPresentationProofPayload } from './signing';\nimport { SIGNATURE_TYPE_ED25519, type VerificationResult, verifyChain, verifyCredential } from '../credentials';\n\nexport const verifyPresentation = async (presentation: Presentation): Promise<VerificationResult> => {\n const errors: string[] = [];\n\n // Verify all credentials.\n const credentialsVerifications = await Promise.all(\n presentation.credentials?.map((credential) => verifyCredential(credential)) ?? [],\n );\n for (const verification of credentialsVerifications) {\n if (verification.kind === 'fail') {\n errors.push(...verification.errors);\n }\n }\n\n // Verify all proofs.\n const proofVerification = await Promise.all(\n presentation.proofs?.map(async (proof) => {\n const chainVerification = await verifyPresentationChain(presentation, proof);\n if (chainVerification.kind === 'fail') {\n return chainVerification;\n }\n const signatureVerification = await verifyPresentationSignature(presentation, proof);\n if (signatureVerification.kind === 'fail') {\n return signatureVerification;\n }\n return { kind: 'pass' } as VerificationResult;\n }) ?? [],\n );\n for (const verification of proofVerification) {\n if (verification.kind === 'fail') {\n errors.push(...verification.errors);\n }\n }\n\n if (errors.length === 0) {\n return { kind: 'pass' };\n }\n {\n return {\n kind: 'fail',\n errors,\n };\n }\n};\n\nexport const verifyPresentationChain = async (\n presentation: Presentation,\n proof: Proof,\n): Promise<VerificationResult> => {\n for (const credential of presentation.credentials ?? []) {\n if (!credential.issuer.equals(proof.signer)) {\n if (!proof.chain) {\n return {\n kind: 'fail',\n errors: ['Delegated credential is missing credential chain.'],\n };\n }\n\n const chainVerification = await verifyChain(proof.chain, credential.subject.id, proof.signer);\n if (chainVerification.kind === 'fail') {\n return chainVerification;\n }\n }\n }\n\n return { kind: 'pass' };\n};\n\n/**\n * Verifies that the signature is valid and was made by the signer.\n * Does not validate other semantics (e.g. chains).\n */\nexport const verifyPresentationSignature = async (\n presentation: Presentation,\n proof: Proof,\n): Promise<VerificationResult> => {\n if (proof.type !== SIGNATURE_TYPE_ED25519) {\n return {\n kind: 'fail',\n errors: [`Invalid signature type: ${proof.type}`],\n };\n }\n\n const signData = getPresentationProofPayload(presentation.credentials ?? [], proof);\n if (!(await verifySignature(proof.signer, signData, proof.value))) {\n return { kind: 'fail', errors: ['Invalid signature'] };\n }\n\n return { kind: 'pass' };\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { runInContextAsync } from '@dxos/async';\nimport { Context } from '@dxos/context';\nimport { PublicKey } from '@dxos/keys';\nimport { log } from '@dxos/log';\nimport { type TypedMessage } from '@dxos/protocols/proto';\nimport { type Credential, SpaceMember } from '@dxos/protocols/proto/dxos/halo/credentials';\nimport { type DelegateSpaceInvitation } from '@dxos/protocols/proto/dxos/halo/invitations';\nimport { type AsyncCallback, Callback, ComplexMap, ComplexSet } from '@dxos/util';\n\nimport { type FeedInfo, FeedStateMachine } from './feed-state-machine';\nimport { InvitationStateMachine } from './invitation-state-machine';\nimport { MemberStateMachine, type MemberInfo } from './member-state-machine';\nimport { getCredentialAssertion, verifyCredential } from '../credentials';\nimport { type CredentialProcessor } from '../processor/credential-processor';\n\nexport interface SpaceState {\n readonly members: ReadonlyMap<PublicKey, MemberInfo>;\n readonly membershipChainHeads: PublicKey[];\n readonly feeds: ReadonlyMap<PublicKey, FeedInfo>;\n readonly credentials: Credential[];\n readonly genesisCredential: Credential | undefined;\n readonly creator: MemberInfo | undefined;\n readonly invitations: ReadonlyMap<PublicKey, DelegateSpaceInvitation>;\n\n addCredentialProcessor(processor: CredentialProcessor): Promise<void>;\n removeCredentialProcessor(processor: CredentialProcessor): Promise<void>;\n\n getCredentialsOfType(type: TypedMessage['@type']): Credential[];\n\n getMemberRole(memberKey: PublicKey): SpaceMember.Role;\n hasMembershipManagementPermission(memberKey: PublicKey): boolean;\n}\n\nexport type ProcessOptions = {\n sourceFeed: PublicKey;\n skipVerification?: boolean;\n};\n\nexport type CredentialEntry = {\n credential: Credential;\n sourceFeed: PublicKey;\n revoked: boolean;\n};\n\n/**\n * Validates and processes credentials for a single space.\n * Keeps a list of members and feeds.\n * Keeps and in-memory index of credentials and allows to query them.\n */\nexport class SpaceStateMachine implements SpaceState {\n private readonly _members = new MemberStateMachine(this._spaceKey);\n private readonly _feeds = new FeedStateMachine(this._spaceKey);\n private readonly _invitations = new InvitationStateMachine();\n private readonly _credentials: CredentialEntry[] = [];\n private readonly _credentialsById = new ComplexMap<PublicKey, CredentialEntry>(PublicKey.hash);\n private readonly _processedCredentials = new ComplexSet<PublicKey>(PublicKey.hash);\n\n private _genesisCredential: Credential | undefined;\n private _credentialProcessors: CredentialConsumer<any>[] = [];\n\n readonly onCredentialProcessed = new Callback<AsyncCallback<Credential>>();\n readonly onMemberRoleChanged = this._members.onMemberRoleChanged;\n readonly onFeedAdmitted = this._feeds.onFeedAdmitted;\n readonly onDelegatedInvitation = this._invitations.onDelegatedInvitation;\n readonly onDelegatedInvitationRemoved = this._invitations.onDelegatedInvitationRemoved;\n\n constructor(private readonly _spaceKey: PublicKey) {}\n\n get creator(): MemberInfo | undefined {\n return this._members.creator;\n }\n\n get members(): ReadonlyMap<PublicKey, MemberInfo> {\n return this._members.members;\n }\n\n get membershipChainHeads(): PublicKey[] {\n return this._members.membershipChainHeads;\n }\n\n get feeds(): ReadonlyMap<PublicKey, FeedInfo> {\n return this._feeds.feeds;\n }\n\n get credentials(): Credential[] {\n return this._credentials.map((entry) => entry.credential);\n }\n\n get credentialEntries(): CredentialEntry[] {\n return this._credentials;\n }\n\n get genesisCredential(): Credential | undefined {\n return this._genesisCredential;\n }\n\n get invitations(): ReadonlyMap<PublicKey, DelegateSpaceInvitation> {\n return this._invitations.invitations;\n }\n\n async addCredentialProcessor(processor: CredentialProcessor) {\n if (this._credentialProcessors.find((p) => p.processor === processor)) {\n throw new Error('Credential processor already added.');\n }\n\n const consumer = new CredentialConsumer(\n processor,\n async () => {\n for (const credential of this.credentials) {\n await consumer._process(credential);\n }\n\n // NOTE: It is important to set this flag after immediately after processing existing credentials.\n // Otherwise, we might miss some credentials.\n // Having an `await` statement between the end of the loop and setting the flag would cause a race condition.\n consumer._isReadyForLiveCredentials = true;\n },\n async () => {\n this._credentialProcessors = this._credentialProcessors.filter((p) => p !== consumer);\n },\n );\n this._credentialProcessors.push(consumer);\n\n await consumer.open();\n }\n\n async removeCredentialProcessor(processor: CredentialProcessor) {\n const consumer = this._credentialProcessors.find((p) => p.processor === processor);\n await consumer?.close();\n }\n\n getCredentialsOfType(type: TypedMessage['@type']): Credential[] {\n return this.credentials.filter((credential) => getCredentialAssertion(credential)['@type'] === type);\n }\n\n /**\n * @param credential Message to process.\n * @param fromFeed Key of the feed where this credential is recorded.\n */\n async process(credential: Credential, { sourceFeed, skipVerification }: ProcessOptions): Promise<boolean> {\n if (credential.id) {\n if (this._processedCredentials.has(credential.id)) {\n return true;\n }\n this._processedCredentials.add(credential.id);\n }\n\n if (!skipVerification) {\n const result = await verifyCredential(credential);\n if (result.kind !== 'pass') {\n log.warn(`Invalid credential: ${result.errors.join(', ')}`);\n return false;\n }\n }\n\n const assertion = getCredentialAssertion(credential);\n switch (assertion['@type']) {\n case 'dxos.halo.credentials.SpaceGenesis': {\n if (this._genesisCredential) {\n log.warn('Space already has a genesis credential.');\n return false;\n }\n if (!credential.issuer.equals(this._spaceKey)) {\n log.warn('Space genesis credential must be issued by space.');\n return false;\n }\n if (!credential.subject.id.equals(this._spaceKey)) {\n log.warn('Space genesis credential must be issued to space.');\n return false;\n }\n this._genesisCredential = credential;\n break;\n }\n\n case 'dxos.halo.credentials.SpaceMember': {\n if (!assertion.spaceKey.equals(this._spaceKey)) {\n break; // Ignore credentials for other spaces.\n }\n\n if (!this._genesisCredential) {\n log.warn('Space must have a genesis credential before adding members.');\n return false;\n }\n if (!this._canInviteNewMembers(credential.issuer)) {\n log.warn(`Space member is not authorized to invite new members: ${credential.issuer}`);\n return false;\n }\n\n await this._members.process(credential);\n await this._invitations.process(credential);\n break;\n }\n\n case 'dxos.halo.credentials.MemberProfile': {\n if (!this._genesisCredential) {\n log.warn('Space must have a genesis credential before adding members.');\n return false;\n }\n\n await this._members.process(credential);\n break;\n }\n\n case 'dxos.halo.credentials.AdmittedFeed': {\n if (!this._genesisCredential) {\n log.warn('Space must have a genesis credential before admitting feeds.');\n return false;\n }\n if (!this._canAdmitFeeds(credential.issuer)) {\n log.warn(`Space member is not authorized to admit feeds: ${credential.issuer}`);\n return false;\n }\n\n // TODO(dmaretskyi): Check that the feed owner is a member of the space.\n await this._feeds.process(credential, sourceFeed);\n break;\n }\n case 'dxos.halo.invitations.CancelDelegatedInvitation':\n case 'dxos.halo.invitations.DelegateSpaceInvitation': {\n if (!this._canInviteNewMembers(credential.issuer)) {\n log.warn(`Invalid invitation, space member is not authorized to invite new members: ${credential.issuer}`);\n return false;\n }\n await this._invitations.process(credential);\n break;\n }\n }\n\n const newEntry: CredentialEntry = { credential, sourceFeed, revoked: false };\n this._credentials.push(newEntry);\n\n // TODO(dmaretskyi): Invariant on every credential having an id?\n if (credential.id) {\n this._credentialsById.set(credential.id, newEntry);\n }\n\n for (const processor of this._credentialProcessors) {\n if (processor._isReadyForLiveCredentials) {\n await processor._process(credential);\n }\n }\n\n await this.onCredentialProcessed.callIfSet(credential);\n return true;\n }\n\n public getMemberRole(memberKey: PublicKey): SpaceMember.Role {\n return this._members.getRole(memberKey);\n }\n\n public hasMembershipManagementPermission(memberKey: PublicKey): boolean {\n return this._canInviteNewMembers(memberKey);\n }\n\n private _canInviteNewMembers(key: PublicKey): boolean {\n return (\n key.equals(this._spaceKey) ||\n this._members.getRole(key) === SpaceMember.Role.ADMIN ||\n this._members.getRole(key) === SpaceMember.Role.OWNER\n );\n }\n\n private _canAdmitFeeds(key: PublicKey): boolean {\n const role = this._members.getRole(key);\n return role === SpaceMember.Role.EDITOR || role === SpaceMember.Role.ADMIN || role === SpaceMember.Role.OWNER;\n }\n}\n\n// TODO(dmaretskyi): Simplify.\nclass CredentialConsumer<T extends CredentialProcessor> {\n private _ctx = new Context();\n\n /**\n * @internal\n * Processor is ready to process live credentials.\n * NOTE: Setting this flag before all existing credentials are processed will cause them to be processed out of order.\n * Set externally.\n */\n _isReadyForLiveCredentials = false;\n\n constructor(\n public readonly processor: T,\n private readonly _onOpen: () => Promise<void>,\n private readonly _onClose: () => Promise<void>,\n ) {}\n\n /**\n * @internal\n */\n async _process(credential: Credential) {\n await runInContextAsync(this._ctx, async () => {\n await this.processor.processCredential(credential);\n });\n }\n\n async open() {\n if (this._ctx.disposed) {\n throw new Error('CredentialProcessor is disposed');\n }\n\n await this._onOpen();\n }\n\n async close() {\n await this._ctx.dispose();\n\n await this._onClose();\n }\n}\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { invariant } from '@dxos/invariant';\nimport { PublicKey } from '@dxos/keys';\nimport { type AdmittedFeed, type Credential } from '@dxos/protocols/proto/dxos/halo/credentials';\nimport { type AsyncCallback, Callback, ComplexMap } from '@dxos/util';\n\nimport { getCredentialAssertion } from '../credentials';\n\nexport interface FeedInfo {\n key: PublicKey;\n /**\n * Parent feed from the feed tree.\n * This is the feed where the AdmittedFeed assertion is written.\n * The genesis feed will have itself as a parent.\n */\n parent: PublicKey;\n credential: Credential;\n assertion: AdmittedFeed;\n}\n\n/**\n * Tracks the feed tree for a space.\n * Provides a list of admitted feeds.\n */\nexport class FeedStateMachine {\n private _feeds = new ComplexMap<PublicKey, FeedInfo>(PublicKey.hash);\n\n readonly onFeedAdmitted = new Callback<AsyncCallback<FeedInfo>>();\n\n constructor(private readonly _spaceKey: PublicKey) {}\n\n get feeds(): ReadonlyMap<PublicKey, FeedInfo> {\n return this._feeds;\n }\n\n /**\n * Processes the AdmittedFeed credential.\n * Assumes the credential is already pre-verified\n * and the issuer has been authorized to issue credentials of this type.\n * @param fromFeed Key of the feed where this credential is recorded.\n */\n async process(credential: Credential, fromFeed: PublicKey) {\n const assertion = getCredentialAssertion(credential);\n invariant(assertion['@type'] === 'dxos.halo.credentials.AdmittedFeed');\n invariant(assertion.spaceKey.equals(this._spaceKey));\n\n const info: FeedInfo = {\n key: credential.subject.id,\n credential,\n assertion,\n parent: fromFeed,\n };\n\n this._feeds.set(credential.subject.id, info);\n await this.onFeedAdmitted.callIfSet(info);\n }\n}\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { PublicKey } from '@dxos/keys';\nimport { type Credential } from '@dxos/protocols/proto/dxos/halo/credentials';\nimport { type DelegateSpaceInvitation } from '@dxos/protocols/proto/dxos/halo/invitations';\nimport { type AsyncCallback, Callback, ComplexMap, ComplexSet } from '@dxos/util';\n\nimport { getCredentialAssertion } from '../credentials';\n\nexport interface DelegateInvitationCredential {\n credentialId: PublicKey;\n invitation: DelegateSpaceInvitation;\n}\n\n/**\n * Tracks the feed tree for a space.\n * Provides a list of admitted feeds.\n */\nexport class InvitationStateMachine {\n private readonly _invitations = new ComplexMap<PublicKey, DelegateSpaceInvitation>(PublicKey.hash);\n private readonly _redeemedInvitationCredentialIds = new ComplexSet(PublicKey.hash);\n private readonly _cancelledInvitationCredentialIds = new ComplexSet(PublicKey.hash);\n\n readonly onDelegatedInvitation = new Callback<AsyncCallback<DelegateInvitationCredential>>();\n readonly onDelegatedInvitationRemoved = new Callback<AsyncCallback<DelegateInvitationCredential>>();\n\n get invitations(): ReadonlyMap<PublicKey, DelegateSpaceInvitation> {\n return this._invitations;\n }\n\n async process(credential: Credential): Promise<void> {\n const credentialId = credential.id;\n if (credentialId == null) {\n return;\n }\n const assertion = getCredentialAssertion(credential);\n switch (assertion['@type']) {\n case 'dxos.halo.invitations.CancelDelegatedInvitation': {\n this._cancelledInvitationCredentialIds.add(assertion.credentialId);\n const existingInvitation = this._invitations.get(assertion.credentialId);\n if (existingInvitation != null) {\n this._invitations.delete(assertion.credentialId);\n await this.onDelegatedInvitationRemoved.callIfSet({\n credentialId: assertion.credentialId,\n invitation: existingInvitation,\n });\n }\n break;\n }\n case 'dxos.halo.invitations.DelegateSpaceInvitation': {\n if (credential.id) {\n const isExpired = assertion.expiresOn && assertion.expiresOn.getTime() < Date.now();\n const wasUsed = this._redeemedInvitationCredentialIds.has(credential.id) && !assertion.multiUse;\n const wasCancelled = this._cancelledInvitationCredentialIds.has(credential.id);\n if (isExpired || wasCancelled || wasUsed) {\n return;\n }\n const invitation: DelegateSpaceInvitation = { ...assertion };\n this._invitations.set(credential.id, invitation);\n await this.onDelegatedInvitation.callIfSet({\n credentialId: credential.id,\n invitation,\n });\n }\n break;\n }\n case 'dxos.halo.credentials.SpaceMember': {\n if (assertion.invitationCredentialId != null) {\n this._redeemedInvitationCredentialIds.add(assertion.invitationCredentialId);\n const existingInvitation = this._invitations.get(assertion.invitationCredentialId);\n if (existingInvitation != null && !existingInvitation.multiUse) {\n this._invitations.delete(assertion.invitationCredentialId);\n await this.onDelegatedInvitationRemoved.callIfSet({\n credentialId: assertion.invitationCredentialId,\n invitation: existingInvitation,\n });\n }\n }\n break;\n }\n }\n }\n}\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { invariant } from '@dxos/invariant';\nimport { PublicKey } from '@dxos/keys';\nimport { log } from '@dxos/log';\nimport { type Credential, SpaceMember, type ProfileDocument } from '@dxos/protocols/proto/dxos/halo/credentials';\nimport { ComplexMap } from '@dxos/util';\n\nimport { getCredentialAssertion } from '../credentials';\nimport {\n type ChainVertex,\n CredentialGraph,\n type CredentialGraphStateHandler,\n type PathState,\n type StateScope,\n} from '../graph/credential-graph';\n\nexport interface MemberInfo {\n key: PublicKey;\n role: SpaceMember.Role;\n credential: Credential;\n assertion: SpaceMember;\n profile?: ProfileDocument;\n}\n\n/**\n * Tracks the list of members (with roles) for the space.\n * Provides a list of admitted feeds.\n */\nexport class MemberStateMachine implements CredentialGraphStateHandler<SpaceMember, MemberInfo> {\n private _ownerKey: PublicKey | undefined;\n private _memberProfiles = new ComplexMap<PublicKey, ProfileDocument | undefined>(PublicKey.hash);\n private _hashgraph = new CredentialGraph<SpaceMember, MemberInfo>(this);\n\n readonly onMemberRoleChanged = this._hashgraph.onSubjectStateChanged;\n\n constructor(private readonly _spaceKey: PublicKey) {}\n\n get creator(): MemberInfo | undefined {\n return this._ownerKey && this._hashgraph.getSubjectState(this._ownerKey);\n }\n\n get members(): ReadonlyMap<PublicKey, MemberInfo> {\n return this._hashgraph.getState();\n }\n\n get membershipChainHeads(): PublicKey[] {\n return this._hashgraph.getLeafIds();\n }\n\n getRole(member: PublicKey): SpaceMember.Role {\n return this._getRole(this._hashgraph.getGlobalStateScope(), member);\n }\n\n /**\n * Processes the SpaceMember credential.\n * Assumes the credential is already pre-verified and the issuer has been authorized to issue credentials of this type.\n */\n async process(credential: Credential) {\n const assertion = getCredentialAssertion(credential);\n\n switch (assertion['@type']) {\n case 'dxos.halo.credentials.SpaceMember': {\n invariant(assertion.spaceKey.equals(this._spaceKey));\n if (this._ownerKey == null && credential.issuer === this._spaceKey) {\n this._ownerKey = credential.subject.id;\n }\n if (assertion.profile != null) {\n this._memberProfiles.set(credential.subject.id, assertion.profile);\n }\n await this._hashgraph.addVertex(credential, assertion);\n break;\n }\n case 'dxos.halo.credentials.MemberProfile': {\n const member = this._hashgraph.getSubjectState(credential.subject.id);\n if (member) {\n member.profile = assertion.profile;\n } else {\n log.warn('Member not found', { id: credential.subject.id });\n }\n this._memberProfiles.set(credential.subject.id, assertion.profile);\n break;\n }\n default:\n throw new Error('Invalid assertion type');\n }\n }\n\n public createState(credential: Credential, assertion: SpaceMember): MemberInfo {\n const memberKey = credential.subject.id;\n return {\n key: memberKey,\n role: assertion.role,\n credential,\n assertion,\n profile: this._memberProfiles.get(memberKey),\n };\n }\n\n public isUpdateAllowed(scope: StateScope<SpaceMember>, credential: Credential, assertion: SpaceMember) {\n if (assertion.role === SpaceMember.Role.OWNER) {\n return credential!.issuer.equals(this._spaceKey);\n }\n const issuer = credential.issuer;\n const isChangingOwnRole = issuer.equals(credential.subject.id);\n if (isChangingOwnRole) {\n return false;\n }\n if (issuer.equals(assertion.spaceKey)) {\n return true;\n }\n const issuerRole = this._getRole(scope, issuer);\n return issuerRole === SpaceMember.Role.ADMIN || issuerRole === SpaceMember.Role.OWNER;\n }\n\n public getConflictingPaths(\n paths: PathState<SpaceMember>[],\n update: ChainVertex<SpaceMember>,\n ): PathState<SpaceMember>[] {\n // a member can't be an issuer in a concurrent branch if we decided to remove or revoke admin permissions during merge\n if (update.assertion.role !== SpaceMember.Role.REMOVED && update.assertion.role !== SpaceMember.Role.EDITOR) {\n return [];\n }\n const memberId = update.credential!.subject.id!;\n return paths.filter((p) => p.forkIssuers.has(memberId));\n }\n\n public tryPickWinningUpdate(\n scope1: StateScope<SpaceMember>,\n update1: Credential,\n scope2: StateScope<SpaceMember>,\n update2: Credential,\n ): Credential | null {\n const path1IssuerRole = this._getRole(scope1, update1.issuer);\n const path2IssuerRole = this._getRole(scope2, update2.issuer);\n if ((path2IssuerRole === SpaceMember.Role.OWNER) !== (path1IssuerRole === SpaceMember.Role.OWNER)) {\n log('owner decision used to break the tie');\n return path1IssuerRole === SpaceMember.Role.OWNER ? update1 : update2;\n }\n return null;\n }\n\n public toLogString(assertion: SpaceMember | undefined): string {\n const role = assertion?.role ?? SpaceMember.Role.REMOVED;\n return Object.entries(SpaceMember.Role).find(([_, value]) => value === role)![0];\n }\n\n public hasStateChanged(s1?: MemberInfo, s2?: MemberInfo): boolean {\n return s1?.role !== s2?.role;\n }\n\n private _getRole(scope: StateScope<SpaceMember>, memberId: PublicKey): SpaceMember.Role {\n if (this._ownerKey?.equals(memberId)) {\n return SpaceMember.Role.OWNER;\n }\n const realRole = scope.state.get(memberId)?.assertion?.role ?? SpaceMember.Role.REMOVED;\n if (scope.stateOverrides != null) {\n const override = scope.stateOverrides.get(memberId);\n if (override != null) {\n log('member role overridden in path', () => ({\n headId: scope.head?.id,\n roleOverride: this.toLogString(override.assertion),\n realRole: this.toLogString(scope.state.get(memberId)?.assertion),\n }));\n return override.assertion.role;\n }\n }\n return realRole;\n }\n}\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { invariant } from '@dxos/invariant';\nimport { PublicKey } from '@dxos/keys';\nimport { log } from '@dxos/log';\nimport { type Credential } from '@dxos/protocols/proto/dxos/halo/credentials';\nimport { type AsyncCallback, Callback, ComplexMap, ComplexSet } from '@dxos/util';\n\nexport class CredentialGraph<A, State> {\n /**\n * Local ids are used during traversals.\n */\n private _vertexIdGenerator = 1;\n /**\n * All credentials without parent references are connected to the root.\n */\n private _root = { id: -1, parents: [], children: [] } as any as ChainVertex<A>;\n /**\n * A credential which is not a parent of any other credential has the sentinel as a child.\n * Sentinel is a virtual merge-point of all credentials.\n */\n private _sentinel = { id: -2, parents: [], children: [] } as any as ChainVertex<A>;\n /**\n * Vertex references are used for fast credential inserts into the graph.\n */\n private _vertexByCredentialId = new ComplexMap<PublicKey, ChainVertex<A>>(PublicKey.hash);\n /**\n * The current state of the graph.\n */\n private _subjectToVertex = new ComplexMap<PublicKey, ChainVertex<A>>(PublicKey.hash);\n private _subjectToState = new ComplexMap<PublicKey, State>(PublicKey.hash);\n\n public onSubjectStateChanged = new Callback<AsyncCallback<State[]>>();\n\n constructor(private readonly _stateHandler: CredentialGraphStateHandler<A, State>) {}\n\n public getSubjectState(subjectId: PublicKey): State | undefined {\n return this._subjectToState.get(subjectId);\n }\n\n public getState(): ReadonlyMap<PublicKey, State> {\n return this._subjectToState;\n }\n\n public getLeafIds(): PublicKey[] {\n return this._sentinel.parents.map((v) => v.credential!.id!);\n }\n\n public getGlobalStateScope(): StateScope<A> {\n return { state: this._subjectToVertex };\n }\n\n public addVertex(credential: Credential, assertion: A): Promise<void> {\n const newVertex: ChainVertex<A> = {\n id: this._vertexIdGenerator++,\n credential,\n assertion,\n parents: [],\n children: [],\n };\n this._vertexByCredentialId.set(credential.id!, newVertex);\n const parentIds = credential.parentCredentialIds ?? [];\n if (parentIds.length === 0) {\n this._root.children.push(newVertex);\n newVertex.parents.push(this._root);\n } else {\n for (const parentId of parentIds) {\n const parentVertex = this._vertexByCredentialId.get(parentId);\n if (parentVertex == null) {\n log.error('credential skipped because of the unknown parent', { credential, parentId });\n continue;\n }\n parentVertex.children.push(newVertex);\n newVertex.parents.push(parentVertex);\n this._removeSentinelConnection(parentVertex);\n }\n }\n newVertex.children.push(this._sentinel);\n this._sentinel.parents.push(newVertex);\n return this._onVertexInserted(newVertex);\n }\n\n private _removeSentinelConnection(vertex: ChainVertex<A>) {\n const sentinelIdx = vertex.children.indexOf(this._sentinel);\n if (sentinelIdx >= 0) {\n vertex.children.splice(sentinelIdx, 1);\n const vertexInSentinelIdx = this._sentinel.parents.indexOf(vertex);\n invariant(vertexInSentinelIdx >= 0);\n this._sentinel.parents.splice(vertexInSentinelIdx, 1);\n }\n }\n\n private async _onVertexInserted(newVertex: ChainVertex<A>) {\n const { credential, assertion } = newVertex;\n invariant(credential);\n let changedSubjects: State[] = [];\n const isUpdateAppliedOnTopOfThePreviousState = this._sentinel.parents.length === 1;\n if (isUpdateAppliedOnTopOfThePreviousState) {\n const subjectId = credential.subject.id;\n if (this._stateHandler.isUpdateAllowed(this.getGlobalStateScope(), credential, assertion)) {\n const newSubjectState = this._stateHandler.createState(credential, newVertex.assertion);\n const prevSubjectState = this._subjectToState.get(subjectId);\n this._subjectToState.set(subjectId, newSubjectState);\n this._subjectToVertex.set(subjectId, newVertex);\n if (this._stateHandler.hasStateChanged(newSubjectState, prevSubjectState)) {\n changedSubjects.push(newSubjectState);\n }\n }\n } else {\n changedSubjects = this._recomputeState();\n }\n if (changedSubjects.length > 0) {\n await this.onSubjectStateChanged.callIfSet(changedSubjects);\n }\n }\n\n /**\n * DFS the graph from root to sentinel pausing on merge points (nodes with multiple parents).\n * Continue after all paths leading to a merge point converge by merging their states.\n * In case of a concurrent update paths are replayed taking into account the state set\n * by the winning branch.\n */\n private _recomputeState(): State[] {\n // ID of a merge point to the list of paths that reached the point.\n const pendingPaths = new Map<number, PathState<A>[]>();\n const paths: PathState<A>[] = [this._createRootPath()];\n let lastPath: PathState<A> | null = null;\n while (lastPath == null) {\n const path = paths.pop()!;\n log('visit vertex', { id: path.head.id });\n this._updatePathState(path);\n const convergedPaths = this._handleMergePoint(paths, pendingPaths, path);\n if (convergedPaths == null) {\n log('waiting for other paths');\n continue;\n }\n const mergeResult = this._mergePaths(convergedPaths);\n if (mergeResult.type === 'replay_required') {\n this._replayFailedPaths(paths, pendingPaths, mergeResult, convergedPaths);\n continue;\n }\n const merged = mergeResult.path;\n if (merged.head.children.length === 0) {\n lastPath = merged;\n } else if (merged.head.children.length === 1) {\n merged.head = merged.head.children[0];\n paths.push(merged);\n } else {\n this._forkTraversal(paths, merged);\n }\n }\n if (paths.length > 0) {\n log.error('traversal finished while there were active paths', {\n paths: paths.map((p) => ({ path: toChosenPath(p), head: p.head.id })),\n });\n }\n return this._setCurrentState(lastPath);\n }\n\n private _replayFailedPaths(\n paths: PathState<A>[],\n pendingPaths: Map<number, PathState<A>[]>,\n mergeResult: ReplayRequiredMergeResult<A>,\n convergedPaths: PathState<A>[],\n ) {\n paths.push(\n ...mergeResult.replay.map((path) => {\n const stateOverrides = path.stateOverrides ?? new ComplexMap<PublicKey, ChainVertex<A>>(PublicKey.hash);\n mergeResult.stateOverrides.forEach((value, key) => stateOverrides.set(key, value));\n return { ...mergeResult.from, chosenPath: path.chosenPath, stateOverrides };\n }),\n );\n log('replay paths', () => ({\n count: paths.length,\n paths: paths.map((path) => ({\n from: mergeResult.from.head.id,\n path: toChosenPath(path),\n overrides: path?.stateOverrides?.mapValues((v) => this._stateHandler.toLogString(v.assertion)),\n })),\n }));\n const clearedPending = convergedPaths.filter((l) => !mergeResult.replay.includes(l));\n pendingPaths.set(convergedPaths[0].head.id, clearedPending);\n }\n\n private _handleMergePoint(\n paths: PathState<A>[],\n pendingPaths: Map<number, PathState<A>[]>,\n path: PathState<A>,\n ): PathState<A>[] | null {\n const pendingList = pendingPaths.get(path.head.id) ?? [];\n pendingPaths.set(path.head.id, pendingList);\n pendingList.push(path);\n if (pendingList.length < path.head.parents.length) {\n return null;\n }\n if (path.head.id === this._sentinel.id && paths.length > 0) {\n log('waiting for all the active paths to converge on the sentinel');\n return null;\n }\n pendingPaths.delete(path.head.id);\n return pendingList;\n }\n\n private _updatePathState(path: PathState<A>) {\n const headCredential = path.head.credential;\n if (headCredential == null) {\n return;\n }\n const updatedSubject = headCredential.subject.id;\n path.credentials.add(headCredential.id!);\n let isUpdateAllowed = this._stateHandler.isUpdateAllowed(path, headCredential, path.head.assertion);\n // Compatibility with old credentials where parent references were not specified.\n if (!isUpdateAllowed && path.head.parents[0]?.id === this._root.id) {\n const globalState = this.getGlobalStateScope();\n isUpdateAllowed = this._stateHandler.isUpdateAllowed(globalState, headCredential, path.head.assertion);\n }\n if (isUpdateAllowed) {\n path.forkChangedSubjects.add(updatedSubject);\n path.forkIssuers.add(headCredential.issuer);\n path.state.set(updatedSubject, path.head);\n log('path state updated', () => ({\n subject: updatedSubject,\n newState: this._stateHandler.toLogString(path.head.assertion),\n }));\n }\n }\n\n private _forkTraversal(paths: PathState<A>[], path: PathState<A>) {\n const replayChoice = path.chosenPath?.[path.head.id];\n const choices = replayChoice ?? path.head.children;\n for (const choice of choices) {\n log('edge traversal', { from: path.head.id, to: choice.id });\n const fork: PathState<A> = {\n forkPoint: path,\n chosenPath: { ...path.chosenPath, [path.head.id]: [choice] },\n head: choice,\n credentials: new ComplexSet(PublicKey.hash, path.credentials),\n state: new ComplexMap(PublicKey.hash, [...path.state.entries()]),\n forkIssuers: new ComplexSet(PublicKey.hash),\n forkChangedSubjects: new ComplexSet(PublicKey.hash),\n stateOverrides: path.stateOverrides,\n };\n paths.push(fork);\n }\n }\n\n /**\n * Updates the current graph state.\n * @returns changed states.\n */\n private _setCurrentState(path: PathState<A>): State[] {\n const changedSubjects: State[] = [];\n const newStateMap = new ComplexMap<PublicKey, State>(PublicKey.hash);\n const newVertexMap = new ComplexMap<PublicKey, ChainVertex<A>>(PublicKey.hash);\n for (const [subjectKey, subjectVertex] of path.state.entries()) {\n const newState = this._stateHandler.createState(subjectVertex.credential!, subjectVertex.assertion);\n const prevState = this._subjectToState.get(subjectKey);\n newStateMap.set(subjectKey, newState);\n newVertexMap.set(subjectKey, subjectVertex);\n if (this._stateHandler.hasStateChanged(newState, prevState)) {\n changedSubjects.push(newState);\n }\n }\n this._subjectToState = newStateMap;\n this._subjectToVertex = newVertexMap;\n return changedSubjects;\n }\n\n /*\n * Walk up all the fork points and return the first one present in all the paths.\n * We use local id to determine vertex position in the graph, because nodes can't\n * be inserted in the middle (between a parent and a child) and ids are monotonically increasing.\n */\n private _leastCommonAncestor(paths: PathState<A>[]): PathState<A> {\n const uniqueForkPoints = paths.reduce((acc, path) => {\n let it = path.forkPoint;\n while (it) {\n acc.set(it.head.id, it);\n it = it.forkPoint;\n }\n return acc;\n }, new Map<number, PathState<A>>());\n let maxId = this._root.id;\n let maxState: PathState<A> | null = null;\n for (const [id, state] of uniqueForkPoints.entries()) {\n const headCredential = state.head.credential;\n if (headCredential != null) {\n const isPointInEveryPath = paths.every((p) => p.credentials.has(headCredential.id!));\n if (isPointInEveryPath && id > maxId) {\n maxId = id;\n maxState = state;\n }\n }\n }\n return maxState ?? this._createRootPath();\n }\n\n /**\n * We might be merging paths where some of them had fork points after the initial forking.\n * We need all the paths to point to the least common fork point and contain all the changes\n * that happened after it.\n */\n private _moveUpToForkPoint(forkPoint: PathState<A>, path: PathState<A>): PathState<A> {\n const isForkPointInPath = path.chosenPath[forkPoint.head.id] == null || path.forkPoint == null;\n if (isForkPointInPath) {\n return path;\n }\n if (forkPoint.head.id === path.forkPoint?.head.id) {\n return path;\n }\n let it = path.forkPoint!;\n while (it.head.id !== forkPoint.head.id) {\n it.forkIssuers.forEach((iss) => path.forkIssuers.add(iss));\n it.forkChangedSubjects.forEach((m) => path.forkChangedSubjects.add(m));\n it = it!.forkPoint!;\n path.forkPoint = it;\n }\n return path;\n }\n\n private _mergePaths(convergedPaths: PathState<A>[]): PathMergeResult<A> {\n invariant(convergedPaths.length >= 1);\n if (convergedPaths.length === 1) {\n return { type: 'merged', path: convergedPaths[0] };\n }\n const forkPoint = this._leastCommonAncestor(convergedPaths);\n log('merging paths', () => ({\n forkPointId: forkPoint.head.id,\n pathCount: convergedPaths.length,\n forkPoints: convergedPaths.map((fp) => fp.forkPoint?.head.id),\n }));\n const paths = convergedPaths.map((p) => this._moveUpToForkPoint(forkPoint, p));\n invariant(forkPoint);\n const result: PathState<A> = {\n forkPoint: forkPoint.forkPoint,\n chosenPath: { ...forkPoint.chosenPath, [forkPoint.head.id]: [] },\n stateOverrides: forkPoint.stateOverrides,\n credentials: new ComplexSet(PublicKey.hash, forkPoint.credentials),\n forkIssuers: new ComplexSet(PublicKey.hash, forkPoint.forkIssuers),\n forkChangedSubjects: new ComplexSet(PublicKey.hash, forkPoint.forkChangedSubjects),\n state: forkPoint.state.mapValues((v) => v),\n head: paths[0].head,\n };\n const subjectToBranch = new ComplexMap<PublicKey, PathState<A>>(PublicKey.hash);\n for (const path of paths) {\n log('processing a path', () => ({\n choices: toChosenPath(path),\n modified: path.forkChangedSubjects,\n forkIssuers: path.forkIssuers,\n state: path.state.mapValues((v) => this._stateHandler.toLogString(v.assertion)),\n }));\n path.forkIssuers.forEach((iss) => result.forkIssuers.add(iss));\n path.credentials.forEach((cred) => result.credentials.add(cred));\n result.chosenPath![forkPoint.head.id].push(...(path.chosenPath![forkPoint.head.id] ?? []));\n for (const modifiedSubject of path.forkChangedSubjects) {\n const existingBranch = subjectToBranch.get(modifiedSubject);\n if (existingBranch == null || this._shouldOverrideCredential(existingBranch, path, modifiedSubject)) {\n subjectToBranch.set(modifiedSubject, path);\n }\n }\n }\n const replayPaths = new Set<PathState<A>>();\n const addReplayPath = replayPaths.add.bind(replayPaths);\n for (const [subject, branch] of subjectToBranch.entries()) {\n result.forkChangedSubjects.add(subject);\n const vertex = branch.state.get(subject)!;\n result.state.set(subject, vertex);\n log('set subject state', () => ({ subject, state: this._stateHandler.toLogString(vertex.assertion) }));\n const otherPaths = paths.filter((p) => p !== branch);\n this._stateHandler.getConflictingPaths(otherPaths, vertex).forEach(addReplayPath);\n }\n if (replayPaths.size > 0) {\n return {\n type: 'replay_required',\n replay: [...replayPaths.values()],\n from: forkPoint,\n stateOverrides: subjectToBranch.mapValues((v, key) => v.state.get(key)!),\n };\n }\n return { type: 'merged', path: result };\n }\n\n /**\n * A candidate credential is preferred over the existing credential if:\n * 1. It is the merge-point, because it's the last credential that was issued in awareness of all\n * the previously existing ones.\n * 2. A path where candidate was set contains existing credential in it, which means that the candidate\n * was issued after the existing credential by a legitimate issuer.\n * 3. A state-specific logic (_stateHandler) is able to justify using the candidate credential.\n * 4. The path where candidate was set has more issuers than the existing path (longer branch).\n * 5. The issuance time of the candidate is after the issuance time of the existing credential (LWW).\n */\n private _shouldOverrideCredential(\n existing: PathState<A>,\n candidate: PathState<A>,\n modifiedSubject: PublicKey,\n ): boolean {\n const candidateVertex = candidate.state.get(modifiedSubject)!;\n const currentVertex = existing.state.get(modifiedSubject)!;\n if (candidateVertex.id === currentVertex.id) {\n return false;\n }\n // During merge all paths are pointing to the same head, which is the merge point.\n const mergePointId = existing.head.id;\n if (candidateVertex.id === mergePointId || currentVertex.id === mergePointId) {\n log('merge point chosen to break the tie', { mergePointId: existing.head.id });\n return mergePointId === candidateVertex.id;\n }\n const candidateCredential = candidateVertex.credential!;\n const currentCredential = currentVertex.credential!;\n // A credential is contained in a branch where another credential for this subject was issued.\n if (existing.credentials.has(candidateCredential.id!) !== candidate.credentials.has(currentCredential.id!)) {\n log('one of the credentials was overridden in another branch', {\n current: currentVertex.id,\n candidate: candidateVertex.id,\n });\n return candidate.credentials.has(currentCredential.id!);\n }\n // Give a chance to state-specific conflict resolution logic.\n const winningCredential = this._stateHandler.tryPickWinningUpdate(\n existing,\n currentCredential,\n candidate,\n candidateCredential,\n );\n if (winningCredential != null) {\n return winningCredential === candidateCredential;\n }\n if (candidate.forkIssuers.size !== existing.forkIssuers.size) {\n log('longer issuers branch used to break the tie', {\n issuerCount: [existing.forkIssuers.size, candidate.forkIssuers.size],\n });\n return candidate.forkIssuers.size > existing.forkIssuers.size;\n }\n log('issuance date used to break the tie');\n return candidateCredential.issuanceDate.getTime() > currentCredential.issuanceDate.getTime();\n }\n\n private _createRootPath(): PathState<A> {\n return {\n head: this._root,\n chosenPath: {},\n forkIssuers: new ComplexSet(PublicKey.hash),\n forkChangedSubjects: new ComplexSet(PublicKey.hash),\n state: new ComplexMap<PublicKey, ChainVertex<A>>(PublicKey.hash),\n credentials: new ComplexSet(PublicKey.hash),\n };\n }\n}\n\nexport interface StateScope<A> {\n head?: { id: number };\n state: ReadonlyMap<PublicKey, ChainVertex<A>>;\n stateOverrides?: ReadonlyMap<PublicKey, ChainVertex<A>>;\n}\n\nexport interface CredentialGraphStateHandler<Assertion, State> {\n hasStateChanged(s1?: State, s2?: State): boolean;\n\n createState(credential: Credential, assertion: Assertion): State;\n\n isUpdateAllowed: (scope: StateScope<Assertion>, update: Credential, assertion: Assertion) => boolean;\n\n getConflictingPaths(paths: PathState<Assertion>[], update: ChainVertex<Assertion>): PathState<Assertion>[];\n\n tryPickWinningUpdate(\n scope1: StateScope<Assertion>,\n update1: Credential,\n scope2: StateScope<Assertion>,\n update2: Credential,\n ): Credential | null;\n\n toLogString(assertion: Assertion): string;\n}\n\nexport interface PathState<A> {\n /**\n * The current vertex position in path, always advances.\n */\n head: ChainVertex<A>;\n /**\n * Subject info local to the current path.\n */\n state: ComplexMap<PublicKey, ChainVertex<A>>;\n /**\n * Used during path replay to throw away cascading concurrent modifications.\n * Overrides pathState.\n */\n stateOverrides?: ComplexMap<PublicKey, ChainVertex<A>>;\n /**\n * Used to faster search of conflicting branches. Is different from pathState.keys()\n * because pathState is not reset on forks.\n */\n forkChangedSubjects: ComplexSet<PublicKey>;\n /**\n * Used to find winning branches. A branch wins if it had more participants.\n * Ties are broken using credential issuance date.\n */\n forkIssuers: ComplexSet<PublicKey>;\n /**\n * All the credentials processed during this path traversal.\n */\n credentials: ComplexSet<PublicKey>;\n /**\n * PathState where we had multiple children in the current vertex.\n * Will be merged with child branches when they converge.\n */\n forkPoint?: PathState<A>;\n /**\n * Used for a particular path replay with stateOverrides for conflict resolution\n * forkVertexId is mapped to child vertex selection.\n * Contains choices that lead to the current state. Value is an array when\n * some branches converged before converging with the remaining branches.\n */\n chosenPath: { [forkVertexId: number]: ChainVertex<A>[] };\n}\n\nexport interface ChainVertex<Assertion> {\n /**\n * The field is missing on root and sentinel vertices. Assertion is not undefined to avoid\n * always asserting two fields.\n */\n credential?: Credential;\n assertion: Assertion;\n /**\n * Local incrementing counter used to form paths. Is used only for causality resolution.\n */\n id: number;\n /**\n * Parents references are used to handle divergent branch merge-points.\n */\n parents: ChainVertex<Assertion>[];\n /**\n * Child references are traversed when computing the current state.\n */\n children: ChainVertex<Assertion>[];\n}\n\ntype PathMergeResult<A> = SuccessfulMergeResult<A> | ReplayRequiredMergeResult<A>;\n\ninterface SuccessfulMergeResult<A> {\n type: 'merged';\n path: PathState<A>;\n}\n\ninterface ReplayRequiredMergeResult<A> {\n type: 'replay_required';\n from: PathState<A>;\n replay: PathState<A>[];\n stateOverrides: ComplexMap<PublicKey, ChainVertex<A>>;\n}\n\nconst toChosenPath = <A>(path: PathState<A>) => {\n return Object.fromEntries(Object.entries(path.chosenPath!).map(([k, vs]) => [k, vs.map((v) => v.id)]));\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { Trigger } from '@dxos/async';\nimport { invariant } from '@dxos/invariant';\nimport { PublicKey } from '@dxos/keys';\nimport { log } from '@dxos/log';\nimport { type Chain, type Credential, type DeviceProfileDocument } from '@dxos/protocols/proto/dxos/halo/credentials';\nimport { ComplexMap } from '@dxos/util';\n\nimport { type CredentialProcessor } from './credential-processor';\nimport { getCredentialAssertion, isValidAuthorizedDeviceCredential } from '../credentials';\n\nexport type DeviceStateMachineParams = {\n identityKey: PublicKey;\n deviceKey: PublicKey;\n onUpdate?: () => void;\n};\n\n/**\n * Processes device invitation credentials.\n */\nexport class DeviceStateMachine implements CredentialProcessor {\n // TODO(burdon): Return values via getter.\n public readonly authorizedDeviceKeys = new ComplexMap<PublicKey, DeviceProfileDocument>(PublicKey.hash);\n\n public readonly deviceChainReady = new Trigger();\n\n public deviceCredentialChain?: Chain;\n\n constructor(private readonly _params: DeviceStateMachineParams) {}\n\n async processCredential(credential: Credential) {\n log('processing credential...', {\n identityKey: this._params.identityKey,\n deviceKey: this._params.deviceKey,\n credential,\n });\n\n // Save device keychain credential when processed by the space state machine.\n if (isValidAuthorizedDeviceCredential(credential, this._params.identityKey, this._params.deviceKey)) {\n this.deviceCredentialChain = { credential };\n this.deviceChainReady.wake();\n }\n\n const assertion = getCredentialAssertion(credential);\n\n switch (assertion['@type']) {\n case 'dxos.halo.credentials.AuthorizedDevice': {\n invariant(!this.authorizedDeviceKeys.has(assertion.deviceKey), 'Device already added.');\n // TODO(dmaretskyi): Extra validation for the credential?\n this.authorizedDeviceKeys.set(assertion.deviceKey, {});\n log('added device', {\n localDeviceKey: this._params.deviceKey,\n deviceKey: assertion.deviceKey,\n size: this.authorizedDeviceKeys.size,\n });\n this._params.onUpdate?.();\n break;\n }\n\n case 'dxos.halo.credentials.DeviceProfile': {\n invariant(this.authorizedDeviceKeys.has(credential.subject.id), 'Device not found.');\n\n if (assertion && credential.subject.id.equals(this._params.deviceKey)) {\n log.trace('dxos.halo.device', {\n deviceKey: credential.subject.id,\n profile: assertion.profile,\n });\n }\n\n this.authorizedDeviceKeys.set(credential.subject.id, assertion.profile);\n this._params.onUpdate?.();\n break;\n }\n }\n }\n}\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { type PublicKey } from '@dxos/keys';\nimport { log } from '@dxos/log';\nimport { type Credential, type ProfileDocument } from '@dxos/protocols/proto/dxos/halo/credentials';\n\nimport { type CredentialProcessor } from './credential-processor';\nimport { getCredentialAssertion } from '../credentials';\n\nexport type ProfileStateMachineParams = {\n identityKey: PublicKey;\n onUpdate?: () => void;\n};\n\n/**\n * Processes device invitation credentials.\n */\nexport class ProfileStateMachine implements CredentialProcessor {\n // TODO(burdon): Return values via getter.\n public profile?: ProfileDocument;\n\n constructor(private readonly _params: ProfileStateMachineParams) {}\n\n async processCredential(credential: Credential) {\n const assertion = getCredentialAssertion(credential);\n switch (assertion['@type']) {\n case 'dxos.halo.credentials.IdentityProfile': {\n if (\n !credential.issuer.equals(this._params.identityKey) ||\n !credential.subject.id.equals(this._params.identityKey)\n ) {\n log.warn('Invalid profile credential', { expectedIdentity: this._params.identityKey, credential });\n return;\n }\n\n // TODO(dmaretskyi): Extra validation for the credential?\n this.profile = assertion.profile;\n log('updated profile', {\n identityKey: this._params.identityKey,\n profile: this.profile,\n });\n this._params.onUpdate?.();\n break;\n }\n }\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;AAuBO,IAAMA,wBAAwC,YAAYC,OAAOC,KAAK,MAAA;AAEtE,IAAMC,yBAA0C,OAAOC,YAAYC,WAAW;;;ACrBrF,SAASC,kBAAkBC,0BAA0B;AAErD,SAASC,qBAAqB;AAC9B,SAASC,iBAAiB;;AAMnB,IAAMC,qBAAqB,MAAcJ,iBAAAA;AAKzC,IAAMK,wBAAwB,CAACC,eAAAA;AACpCH,YAAUG,YAAAA,QAAAA;;;;;;;;;AACV,QAAMC,OAAON,mBAAmBK,UAAAA;AAChC,SAAOJ,cAAcK,IAAAA;AACvB;;;ACbO,IAAMC,mBAAmB,CAACC,SAAS,MAAC;AACzC,MAAIC,WAAW;AACf,WAASC,IAAI,GAAGA,IAAIF,QAAQE,KAAK;AAC/BD,gBAAY,GAAGE,KAA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AAWH,WAAWe,QAAQC;YAC9BG,SAASZ,UAAUY;UACrB,GAAA;;;;;;QACF;AAEA,aAAK1B,qBAAqBkB,IAAIX,WAAWe,QAAQC,IAAIT,UAAUY,OAAO;AACtE,aAAK3B,QAAQsB,WAAQ;AACrB;MACF;IACF;EACF;AACF;;;ACzEA,SAASM,OAAAA,YAAW;;AAcb,IAAMC,sBAAN,MAAMA;EAIXC,YAA6BC,SAAoC;SAApCA,UAAAA;EAAqC;EAElE,MAAMC,kBAAkBC,YAAwB;AAC9C,UAAMC,YAAYC,uBAAuBF,UAAAA;AACzC,YAAQC,UAAU,OAAA,GAAQ;MACxB,KAAK,yCAAyC;AAC5C,YACE,CAACD,WAAWG,OAAOC,OAAO,KAAKN,QAAQO,WAAW,KAClD,CAACL,WAAWM,QAAQC,GAAGH,OAAO,KAAKN,QAAQO,WAAW,GACtD;AACAG,UAAAA,KAAIC,KAAK,8BAA8B;YAAEC,kBAAkB,KAAKZ,QAAQO;YAAaL;UAAW,GAAA;;;;;;AAChG;QACF;AAGA,aAAKW,UAAUV,UAAUU;AACzBH,QAAAA,KAAI,mBAAmB;UACrBH,aAAa,KAAKP,QAAQO;UAC1BM,SAAS,KAAKA;QAChB,GAAA;;;;;;AACA,aAAKb,QAAQc,WAAQ;AACrB;MACF;IACF;EACF;AACF;",
6
6
  "names": ["defaultSecretProvider", "Buffer", "from", "defaultSecretValidator", "invitation", "secret", "generateMnemonic", "mnemonicToSeedSync", "createKeyPair", "invariant", "generateSeedPhrase", "keyPairFromSeedPhrase", "seedPhrase", "seed", "generatePasscode", "length", "passcode", "i", "Math", "floor", "random", "stableStringify", "PublicKey", "Timeframe", "arrayToBuffer", "getCredentialProofPayload", "credential", "copy", "proof", "value", "Uint8Array", "chain", "undefined", "parentCredentialIds", "length", "id", "Buffer", "from", "canonicalStringify", "obj", "stableStringify", "replacer", "key", "toString", "startsWith", "original", "PublicKey", "isPublicKey", "toHex", "isBuffer", "arrayToBuffer", "data", "type", "Timeframe", "frames", "reduce", "seq", "truncateKey", "str", "substring", "getPresentationProofPayload", "credentials", "proof", "copy", "map", "credential", "removeEmptyParentCredentialIds", "value", "Uint8Array", "chain", "undefined", "Buffer", "from", "canonicalStringify", "parentCredentialIds", "length", "getCredentialAssertion", "credential", "subject", "assertion", "isValidAuthorizedDeviceCredential", "identityKey", "deviceKey", "id", "equals", "issuer", "checkCredentialType", "type", "credentialTypeFilter", "subtleCrypto", "invariant", "PublicKey", "verifySignature", "SIGNATURE_TYPE_ED25519", "verifyCredential", "credential", "parentCredentialIds", "length", "issuer", "equals", "proof", "signer", "chain", "kind", "errors", "result", "verifyChain", "verifyCredentialSignature", "type", "signData", "getCredentialProofPayload", "verifySignature", "value", "authority", "subject", "isValidAuthorizedDeviceCredential", "createCredential", "signer", "issuer", "subject", "assertion", "signingKey", "chain", "nonce", "parentCredentialIds", "invariant", "result", "verifyChain", "kind", "credential", "issuanceDate", "Date", "id", "proof", "type", "SIGNATURE_TYPE_ED25519", "creationDate", "value", "Uint8Array", "signedPayload", "getCredentialProofPayload", "sign", "PublicKey", "from", "subtleCrypto", "digest", "createCredentialMessage", "createCredentialSignerWithKey", "getIssuer", "createCredentialSignerWithChain", "AdmittedFeed", "SpaceMember", "Timeframe", "CredentialGenerator", "constructor", "_signer", "_identityKey", "_deviceKey", "createSpaceGenesis", "spaceKey", "controlKey", "creatorProfile", "createCredential", "signer", "issuer", "subject", "assertion", "role", "SpaceMember", "Role", "ADMIN", "profile", "genesisFeedKey", "createFeedAdmission", "AdmittedFeed", "Designation", "CONTROL", "createMemberInvitation", "identityKey", "deviceKey", "dataKey", "EDITOR", "DATA", "createDeviceAuthorization", "createDeviceProfile", "feedKey", "designation", "createProfileCredential", "createEpochCredential", "number", "timeframe", "Timeframe", "credentials", "Promise", "all", "map", "credential", "createAdmissionCredentials", "membershipChainHeads", "invitationCredentialId", "parentCredentialIds", "createDelegatedSpaceInvitationCredential", "invitation", "invitationId", "authMethod", "swarmKey", "guestKey", "expiresOn", "multiUse", "createCancelDelegatedSpaceInvitationCredential", "credentialId", "signPresentation", "presentation", "signer", "signerKey", "chain", "nonce", "proof", "type", "SIGNATURE_TYPE_ED25519", "value", "Uint8Array", "creationDate", "Date", "signedPayload", "getPresentationProofPayload", "credentials", "sign", "proofs", "verifySignature", "verifyPresentation", "presentation", "errors", "credentialsVerifications", "Promise", "all", "credentials", "map", "credential", "verifyCredential", "verification", "kind", "push", "proofVerification", "proofs", "proof", "chainVerification", "verifyPresentationChain", "signatureVerification", "verifyPresentationSignature", "length", "issuer", "equals", "signer", "chain", "verifyChain", "subject", "id", "type", "SIGNATURE_TYPE_ED25519", "signData", "getPresentationProofPayload", "verifySignature", "value", "runInContextAsync", "Context", "PublicKey", "log", "SpaceMember", "Callback", "ComplexMap", "ComplexSet", "invariant", "PublicKey", "Callback", "ComplexMap", "FeedStateMachine", "constructor", "_spaceKey", "_feeds", "ComplexMap", "PublicKey", "hash", "onFeedAdmitted", "Callback", "feeds", "process", "credential", "fromFeed", "assertion", "getCredentialAssertion", "invariant", "spaceKey", "equals", "info", "key", "subject", "id", "parent", "set", "callIfSet", "PublicKey", "Callback", "ComplexMap", "ComplexSet", "InvitationStateMachine", "_invitations", "ComplexMap", "PublicKey", "hash", "_redeemedInvitationCredentialIds", "ComplexSet", "_cancelledInvitationCredentialIds", "onDelegatedInvitation", "Callback", "onDelegatedInvitationRemoved", "invitations", "process", "credential", "credentialId", "id", "assertion", "getCredentialAssertion", "add", "existingInvitation", "get", "delete", "callIfSet", "invitation", "isExpired", "expiresOn", "getTime", "Date", "now", "wasUsed", "has", "multiUse", "wasCancelled", "set", "invitationCredentialId", "invariant", "PublicKey", "log", "SpaceMember", "ComplexMap", "invariant", "PublicKey", "log", "Callback", "ComplexMap", "ComplexSet", "CredentialGraph", "constructor", "_stateHandler", "_vertexIdGenerator", "_root", "id", "parents", "children", "_sentinel", "_vertexByCredentialId", "hash", "_subjectToVertex", "_subjectToState", "onSubjectStateChanged", "getSubjectState", "subjectId", "get", "getState", "getLeafIds", "map", "v", "credential", "getGlobalStateScope", "state", "addVertex", "assertion", "newVertex", "set", "parentIds", "parentCredentialIds", "length", "push", "parentId", "parentVertex", "error", "_removeSentinelConnection", "_onVertexInserted", "vertex", "sentinelIdx", "indexOf", "splice", "vertexInSentinelIdx", "changedSubjects", "isUpdateAppliedOnTopOfThePreviousState", "subject", "isUpdateAllowed", "newSubjectState", "createState", "prevSubjectState", "hasStateChanged", "_recomputeState", "callIfSet", "pendingPaths", "Map", "paths", "_createRootPath", "lastPath", "path", "pop", "head", "_updatePathState", "convergedPaths", "_handleMergePoint", "mergeResult", "_mergePaths", "type", "_replayFailedPaths", "merged", "_forkTraversal", "p", "toChosenPath", "_setCurrentState", "replay", "stateOverrides", "forEach", "value", "key", "from", "chosenPath", "count", "overrides", "mapValues", "toLogString", "clearedPending", "filter", "l", "includes", "pendingList", "delete", "headCredential", "updatedSubject", "credentials", "add", "globalState", "forkChangedSubjects", "forkIssuers", "issuer", "newState", "replayChoice", "choices", "choice", "to", "fork", "forkPoint", "entries", "newStateMap", "newVertexMap", "subjectKey", "subjectVertex", "prevState", "_leastCommonAncestor", "uniqueForkPoints", "reduce", "acc", "it", "maxId", "maxState", "isPointInEveryPath", "every", "has", "_moveUpToForkPoint", "isForkPointInPath", "iss", "m", "forkPointId", "pathCount", "forkPoints", "fp", "result", "subjectToBranch", "modified", "cred", "modifiedSubject", "existingBranch", "_shouldOverrideCredential", "replayPaths", "Set", "addReplayPath", "bind", "branch", "otherPaths", "getConflictingPaths", "size", "values", "existing", "candidate", "candidateVertex", "currentVertex", "mergePointId", "candidateCredential", "currentCredential", "current", "winningCredential", "tryPickWinningUpdate", "issuerCount", "issuanceDate", "getTime", "Object", "fromEntries", "k", "vs", "MemberStateMachine", "constructor", "_spaceKey", "_memberProfiles", "ComplexMap", "PublicKey", "hash", "_hashgraph", "CredentialGraph", "onMemberRoleChanged", "onSubjectStateChanged", "creator", "_ownerKey", "getSubjectState", "members", "getState", "membershipChainHeads", "getLeafIds", "getRole", "member", "_getRole", "getGlobalStateScope", "process", "credential", "assertion", "getCredentialAssertion", "invariant", "spaceKey", "equals", "issuer", "subject", "id", "profile", "set", "addVertex", "log", "warn", "Error", "createState", "memberKey", "key", "role", "get", "isUpdateAllowed", "scope", "SpaceMember", "Role", "OWNER", "isChangingOwnRole", "issuerRole", "ADMIN", "getConflictingPaths", "paths", "update", "REMOVED", "EDITOR", "memberId", "filter", "p", "forkIssuers", "has", "tryPickWinningUpdate", "scope1", "update1", "scope2", "update2", "path1IssuerRole", "path2IssuerRole", "toLogString", "Object", "entries", "find", "_", "value", "hasStateChanged", "s1", "s2", "realRole", "state", "stateOverrides", "override", "headId", "head", "roleOverride", "SpaceStateMachine", "constructor", "_spaceKey", "_members", "MemberStateMachine", "_feeds", "FeedStateMachine", "_invitations", "InvitationStateMachine", "_credentials", "_credentialsById", "ComplexMap", "PublicKey", "hash", "_processedCredentials", "ComplexSet", "_credentialProcessors", "onCredentialProcessed", "Callback", "onMemberRoleChanged", "onFeedAdmitted", "onDelegatedInvitation", "onDelegatedInvitationRemoved", "creator", "members", "membershipChainHeads", "feeds", "credentials", "map", "entry", "credential", "credentialEntries", "genesisCredential", "_genesisCredential", "invitations", "addCredentialProcessor", "processor", "find", "p", "Error", "consumer", "CredentialConsumer", "_process", "_isReadyForLiveCredentials", "filter", "push", "open", "removeCredentialProcessor", "close", "getCredentialsOfType", "type", "getCredentialAssertion", "process", "sourceFeed", "skipVerification", "id", "has", "add", "result", "verifyCredential", "kind", "log", "warn", "errors", "join", "assertion", "issuer", "equals", "subject", "spaceKey", "_canInviteNewMembers", "_canAdmitFeeds", "newEntry", "revoked", "set", "callIfSet", "getMemberRole", "memberKey", "getRole", "hasMembershipManagementPermission", "key", "SpaceMember", "Role", "ADMIN", "OWNER", "role", "EDITOR", "_onOpen", "_onClose", "_ctx", "Context", "runInContextAsync", "processCredential", "disposed", "dispose", "Trigger", "invariant", "PublicKey", "log", "ComplexMap", "DeviceStateMachine", "constructor", "_params", "authorizedDeviceKeys", "ComplexMap", "PublicKey", "hash", "deviceChainReady", "Trigger", "processCredential", "credential", "log", "identityKey", "deviceKey", "isValidAuthorizedDeviceCredential", "deviceCredentialChain", "wake", "assertion", "getCredentialAssertion", "invariant", "has", "set", "localDeviceKey", "size", "onUpdate", "subject", "id", "equals", "trace", "profile", "log", "ProfileStateMachine", "constructor", "_params", "processCredential", "credential", "assertion", "getCredentialAssertion", "issuer", "equals", "identityKey", "subject", "id", "log", "warn", "expectedIdentity", "profile", "onUpdate"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"inject-globals:@inject-globals":{"bytes":324,"imports":[{"path":"@dxos/node-std/inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/invitations.ts":{"bytes":1781,"imports":[{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/seedphrase.ts":{"bytes":2345,"imports":[{"path":"bip39","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/passcode.ts":{"bytes":1464,"imports":[{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/credentials/signing.ts":{"bytes":11236,"imports":[{"path":"json-stable-stringify","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/timeframe","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/presentations/signing.ts":{"bytes":3794,"imports":[{"path":"packages/core/halo/credentials/src/credentials/signing.ts","kind":"import-statement","original":"../credentials/signing"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/credentials/assertions.ts":{"bytes":3821,"imports":[{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/credentials/verifier.ts":{"bytes":8574,"imports":[{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/assertions.ts","kind":"import-statement","original":"./assertions"},{"path":"packages/core/halo/credentials/src/credentials/signing.ts","kind":"import-statement","original":"./signing"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/credentials/credential-factory.ts":{"bytes":11553,"imports":[{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/signing.ts","kind":"import-statement","original":"./signing"},{"path":"packages/core/halo/credentials/src/credentials/verifier.ts","kind":"import-statement","original":"./verifier"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/credentials/credential-generator.ts":{"bytes":25434,"imports":[{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/timeframe","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/credential-factory.ts","kind":"import-statement","original":"./credential-factory"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/credentials/index.ts":{"bytes":929,"imports":[{"path":"packages/core/halo/credentials/src/credentials/assertions.ts","kind":"import-statement","original":"./assertions"},{"path":"packages/core/halo/credentials/src/credentials/credential-factory.ts","kind":"import-statement","original":"./credential-factory"},{"path":"packages/core/halo/credentials/src/credentials/credential-generator.ts","kind":"import-statement","original":"./credential-generator"},{"path":"packages/core/halo/credentials/src/credentials/signing.ts","kind":"import-statement","original":"./signing"},{"path":"packages/core/halo/credentials/src/credentials/verifier.ts","kind":"import-statement","original":"./verifier"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/presentations/presentation.ts":{"bytes":3718,"imports":[{"path":"packages/core/halo/credentials/src/presentations/signing.ts","kind":"import-statement","original":"./signing"},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/presentations/verifier.ts":{"bytes":10470,"imports":[{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/presentations/signing.ts","kind":"import-statement","original":"./signing"},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/presentations/index.ts":{"bytes":703,"imports":[{"path":"packages/core/halo/credentials/src/presentations/signing.ts","kind":"import-statement","original":"./signing"},{"path":"packages/core/halo/credentials/src/presentations/presentation.ts","kind":"import-statement","original":"./presentation"},{"path":"packages/core/halo/credentials/src/presentations/verifier.ts","kind":"import-statement","original":"./verifier"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/state-machine/feed-state-machine.ts":{"bytes":6028,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/state-machine/invitation-state-machine.ts":{"bytes":11718,"imports":[{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/graph/credential-graph.ts":{"bytes":73642,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/state-machine/member-state-machine.ts":{"bytes":21767,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"},{"path":"packages/core/halo/credentials/src/graph/credential-graph.ts","kind":"import-statement","original":"../graph/credential-graph"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/state-machine/space-state-machine.ts":{"bytes":37002,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/state-machine/feed-state-machine.ts","kind":"import-statement","original":"./feed-state-machine"},{"path":"packages/core/halo/credentials/src/state-machine/invitation-state-machine.ts","kind":"import-statement","original":"./invitation-state-machine"},{"path":"packages/core/halo/credentials/src/state-machine/member-state-machine.ts","kind":"import-statement","original":"./member-state-machine"},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/state-machine/index.ts":{"bytes":909,"imports":[{"path":"packages/core/halo/credentials/src/state-machine/space-state-machine.ts","kind":"import-statement","original":"./space-state-machine"},{"path":"packages/core/halo/credentials/src/state-machine/feed-state-machine.ts","kind":"import-statement","original":"./feed-state-machine"},{"path":"packages/core/halo/credentials/src/state-machine/member-state-machine.ts","kind":"import-statement","original":"./member-state-machine"},{"path":"packages/core/halo/credentials/src/state-machine/invitation-state-machine.ts","kind":"import-statement","original":"./invitation-state-machine"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/processor/credential-processor.ts":{"bytes":735,"imports":[{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/processor/device-state-machine.ts":{"bytes":10680,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/processor/profile-state-machine.ts":{"bytes":5520,"imports":[{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/processor/index.ts":{"bytes":785,"imports":[{"path":"packages/core/halo/credentials/src/processor/credential-processor.ts","kind":"import-statement","original":"./credential-processor"},{"path":"packages/core/halo/credentials/src/processor/device-state-machine.ts","kind":"import-statement","original":"./device-state-machine"},{"path":"packages/core/halo/credentials/src/processor/profile-state-machine.ts","kind":"import-statement","original":"./profile-state-machine"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/index.ts":{"bytes":1093,"imports":[{"path":"packages/core/halo/credentials/src/invitations.ts","kind":"import-statement","original":"./invitations"},{"path":"packages/core/halo/credentials/src/seedphrase.ts","kind":"import-statement","original":"./seedphrase"},{"path":"packages/core/halo/credentials/src/passcode.ts","kind":"import-statement","original":"./passcode"},{"path":"packages/core/halo/credentials/src/presentations/index.ts","kind":"import-statement","original":"./presentations"},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"./credentials"},{"path":"packages/core/halo/credentials/src/state-machine/index.ts","kind":"import-statement","original":"./state-machine"},{"path":"packages/core/halo/credentials/src/processor/index.ts","kind":"import-statement","original":"./processor"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"packages/core/halo/credentials/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":119090},"packages/core/halo/credentials/dist/lib/browser/index.mjs":{"imports":[{"path":"@dxos/node-std/inject-globals","kind":"import-statement","external":true},{"path":"bip39","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"json-stable-stringify","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/timeframe","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/timeframe","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["CredentialGenerator","DeviceStateMachine","FeedStateMachine","InvitationStateMachine","MemberStateMachine","ProfileStateMachine","SIGNATURE_TYPE_ED25519","SpaceStateMachine","canonicalStringify","checkCredentialType","createAdmissionCredentials","createCancelDelegatedSpaceInvitationCredential","createCredential","createCredentialMessage","createCredentialSignerWithChain","createCredentialSignerWithKey","createDelegatedSpaceInvitationCredential","createDeviceAuthorization","credentialTypeFilter","defaultSecretProvider","defaultSecretValidator","generatePasscode","generateSeedPhrase","getCredentialAssertion","getCredentialProofPayload","getPresentationProofPayload","isValidAuthorizedDeviceCredential","keyPairFromSeedPhrase","signPresentation","verifyChain","verifyCredential","verifyCredentialSignature","verifyPresentation","verifyPresentationChain","verifyPresentationSignature"],"entryPoint":"packages/core/halo/credentials/src/index.ts","inputs":{"inject-globals:@inject-globals":{"bytesInOutput":79},"packages/core/halo/credentials/src/invitations.ts":{"bytesInOutput":126},"packages/core/halo/credentials/src/index.ts":{"bytesInOutput":0},"packages/core/halo/credentials/src/seedphrase.ts":{"bytesInOutput":560},"packages/core/halo/credentials/src/passcode.ts":{"bytesInOutput":178},"packages/core/halo/credentials/src/credentials/signing.ts":{"bytesInOutput":2037},"packages/core/halo/credentials/src/presentations/signing.ts":{"bytesInOutput":733},"packages/core/halo/credentials/src/credentials/assertions.ts":{"bytesInOutput":648},"packages/core/halo/credentials/src/credentials/credential-factory.ts":{"bytesInOutput":2614},"packages/core/halo/credentials/src/credentials/verifier.ts":{"bytesInOutput":1762},"packages/core/halo/credentials/src/credentials/credential-generator.ts":{"bytesInOutput":5630},"packages/core/halo/credentials/src/presentations/presentation.ts":{"bytesInOutput":578},"packages/core/halo/credentials/src/presentations/verifier.ts":{"bytesInOutput":2306},"packages/core/halo/credentials/src/state-machine/space-state-machine.ts":{"bytesInOutput":8796},"packages/core/halo/credentials/src/state-machine/feed-state-machine.ts":{"bytesInOutput":1545},"packages/core/halo/credentials/src/state-machine/invitation-state-machine.ts":{"bytesInOutput":2764},"packages/core/halo/credentials/src/state-machine/member-state-machine.ts":{"bytesInOutput":5260},"packages/core/halo/credentials/src/graph/credential-graph.ts":{"bytesInOutput":18877},"packages/core/halo/credentials/src/processor/device-state-machine.ts":{"bytesInOutput":2782},"packages/core/halo/credentials/src/processor/profile-state-machine.ts":{"bytesInOutput":1204}},"bytes":60959}}}
1
+ {"inputs":{"packages/core/halo/credentials/src/invitations.ts":{"bytes":1781,"imports":[],"format":"esm"},"packages/core/halo/credentials/src/seedphrase.ts":{"bytes":2345,"imports":[{"path":"bip39","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/passcode.ts":{"bytes":1464,"imports":[],"format":"esm"},"packages/core/halo/credentials/src/credentials/signing.ts":{"bytes":11236,"imports":[{"path":"json-stable-stringify","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/timeframe","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/presentations/signing.ts":{"bytes":3794,"imports":[{"path":"packages/core/halo/credentials/src/credentials/signing.ts","kind":"import-statement","original":"../credentials/signing"}],"format":"esm"},"packages/core/halo/credentials/src/credentials/assertions.ts":{"bytes":3821,"imports":[],"format":"esm"},"packages/core/halo/credentials/src/credentials/verifier.ts":{"bytes":8574,"imports":[{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/assertions.ts","kind":"import-statement","original":"./assertions"},{"path":"packages/core/halo/credentials/src/credentials/signing.ts","kind":"import-statement","original":"./signing"}],"format":"esm"},"packages/core/halo/credentials/src/credentials/credential-factory.ts":{"bytes":11553,"imports":[{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/signing.ts","kind":"import-statement","original":"./signing"},{"path":"packages/core/halo/credentials/src/credentials/verifier.ts","kind":"import-statement","original":"./verifier"}],"format":"esm"},"packages/core/halo/credentials/src/credentials/credential-generator.ts":{"bytes":25434,"imports":[{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/timeframe","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/credential-factory.ts","kind":"import-statement","original":"./credential-factory"}],"format":"esm"},"packages/core/halo/credentials/src/credentials/index.ts":{"bytes":929,"imports":[{"path":"packages/core/halo/credentials/src/credentials/assertions.ts","kind":"import-statement","original":"./assertions"},{"path":"packages/core/halo/credentials/src/credentials/credential-factory.ts","kind":"import-statement","original":"./credential-factory"},{"path":"packages/core/halo/credentials/src/credentials/credential-generator.ts","kind":"import-statement","original":"./credential-generator"},{"path":"packages/core/halo/credentials/src/credentials/signing.ts","kind":"import-statement","original":"./signing"},{"path":"packages/core/halo/credentials/src/credentials/verifier.ts","kind":"import-statement","original":"./verifier"}],"format":"esm"},"packages/core/halo/credentials/src/presentations/presentation.ts":{"bytes":3718,"imports":[{"path":"packages/core/halo/credentials/src/presentations/signing.ts","kind":"import-statement","original":"./signing"},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/presentations/verifier.ts":{"bytes":10470,"imports":[{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/presentations/signing.ts","kind":"import-statement","original":"./signing"},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/presentations/index.ts":{"bytes":703,"imports":[{"path":"packages/core/halo/credentials/src/presentations/signing.ts","kind":"import-statement","original":"./signing"},{"path":"packages/core/halo/credentials/src/presentations/presentation.ts","kind":"import-statement","original":"./presentation"},{"path":"packages/core/halo/credentials/src/presentations/verifier.ts","kind":"import-statement","original":"./verifier"}],"format":"esm"},"packages/core/halo/credentials/src/state-machine/feed-state-machine.ts":{"bytes":6028,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/state-machine/invitation-state-machine.ts":{"bytes":11718,"imports":[{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/graph/credential-graph.ts":{"bytes":73642,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/state-machine/member-state-machine.ts":{"bytes":21767,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"},{"path":"packages/core/halo/credentials/src/graph/credential-graph.ts","kind":"import-statement","original":"../graph/credential-graph"}],"format":"esm"},"packages/core/halo/credentials/src/state-machine/space-state-machine.ts":{"bytes":37002,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/state-machine/feed-state-machine.ts","kind":"import-statement","original":"./feed-state-machine"},{"path":"packages/core/halo/credentials/src/state-machine/invitation-state-machine.ts","kind":"import-statement","original":"./invitation-state-machine"},{"path":"packages/core/halo/credentials/src/state-machine/member-state-machine.ts","kind":"import-statement","original":"./member-state-machine"},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/state-machine/index.ts":{"bytes":909,"imports":[{"path":"packages/core/halo/credentials/src/state-machine/space-state-machine.ts","kind":"import-statement","original":"./space-state-machine"},{"path":"packages/core/halo/credentials/src/state-machine/feed-state-machine.ts","kind":"import-statement","original":"./feed-state-machine"},{"path":"packages/core/halo/credentials/src/state-machine/member-state-machine.ts","kind":"import-statement","original":"./member-state-machine"},{"path":"packages/core/halo/credentials/src/state-machine/invitation-state-machine.ts","kind":"import-statement","original":"./invitation-state-machine"}],"format":"esm"},"packages/core/halo/credentials/src/processor/credential-processor.ts":{"bytes":735,"imports":[],"format":"esm"},"packages/core/halo/credentials/src/processor/device-state-machine.ts":{"bytes":10680,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/processor/profile-state-machine.ts":{"bytes":5520,"imports":[{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/processor/index.ts":{"bytes":785,"imports":[{"path":"packages/core/halo/credentials/src/processor/credential-processor.ts","kind":"import-statement","original":"./credential-processor"},{"path":"packages/core/halo/credentials/src/processor/device-state-machine.ts","kind":"import-statement","original":"./device-state-machine"},{"path":"packages/core/halo/credentials/src/processor/profile-state-machine.ts","kind":"import-statement","original":"./profile-state-machine"}],"format":"esm"},"packages/core/halo/credentials/src/index.ts":{"bytes":1093,"imports":[{"path":"packages/core/halo/credentials/src/invitations.ts","kind":"import-statement","original":"./invitations"},{"path":"packages/core/halo/credentials/src/seedphrase.ts","kind":"import-statement","original":"./seedphrase"},{"path":"packages/core/halo/credentials/src/passcode.ts","kind":"import-statement","original":"./passcode"},{"path":"packages/core/halo/credentials/src/presentations/index.ts","kind":"import-statement","original":"./presentations"},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"./credentials"},{"path":"packages/core/halo/credentials/src/state-machine/index.ts","kind":"import-statement","original":"./state-machine"},{"path":"packages/core/halo/credentials/src/processor/index.ts","kind":"import-statement","original":"./processor"}],"format":"esm"}},"outputs":{"packages/core/halo/credentials/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":119083},"packages/core/halo/credentials/dist/lib/browser/index.mjs":{"imports":[{"path":"bip39","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"json-stable-stringify","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/timeframe","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/timeframe","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["CredentialGenerator","DeviceStateMachine","FeedStateMachine","InvitationStateMachine","MemberStateMachine","ProfileStateMachine","SIGNATURE_TYPE_ED25519","SpaceStateMachine","canonicalStringify","checkCredentialType","createAdmissionCredentials","createCancelDelegatedSpaceInvitationCredential","createCredential","createCredentialMessage","createCredentialSignerWithChain","createCredentialSignerWithKey","createDelegatedSpaceInvitationCredential","createDeviceAuthorization","credentialTypeFilter","defaultSecretProvider","defaultSecretValidator","generatePasscode","generateSeedPhrase","getCredentialAssertion","getCredentialProofPayload","getPresentationProofPayload","isValidAuthorizedDeviceCredential","keyPairFromSeedPhrase","signPresentation","verifyChain","verifyCredential","verifyCredentialSignature","verifyPresentation","verifyPresentationChain","verifyPresentationSignature"],"entryPoint":"packages/core/halo/credentials/src/index.ts","inputs":{"packages/core/halo/credentials/src/invitations.ts":{"bytesInOutput":126},"packages/core/halo/credentials/src/index.ts":{"bytesInOutput":0},"packages/core/halo/credentials/src/seedphrase.ts":{"bytesInOutput":560},"packages/core/halo/credentials/src/passcode.ts":{"bytesInOutput":178},"packages/core/halo/credentials/src/credentials/signing.ts":{"bytesInOutput":2037},"packages/core/halo/credentials/src/presentations/signing.ts":{"bytesInOutput":733},"packages/core/halo/credentials/src/presentations/index.ts":{"bytesInOutput":0},"packages/core/halo/credentials/src/credentials/assertions.ts":{"bytesInOutput":648},"packages/core/halo/credentials/src/credentials/index.ts":{"bytesInOutput":0},"packages/core/halo/credentials/src/credentials/credential-factory.ts":{"bytesInOutput":2614},"packages/core/halo/credentials/src/credentials/verifier.ts":{"bytesInOutput":1762},"packages/core/halo/credentials/src/credentials/credential-generator.ts":{"bytesInOutput":5630},"packages/core/halo/credentials/src/presentations/presentation.ts":{"bytesInOutput":578},"packages/core/halo/credentials/src/presentations/verifier.ts":{"bytesInOutput":2306},"packages/core/halo/credentials/src/state-machine/space-state-machine.ts":{"bytesInOutput":8796},"packages/core/halo/credentials/src/state-machine/feed-state-machine.ts":{"bytesInOutput":1545},"packages/core/halo/credentials/src/state-machine/invitation-state-machine.ts":{"bytesInOutput":2764},"packages/core/halo/credentials/src/state-machine/member-state-machine.ts":{"bytesInOutput":5260},"packages/core/halo/credentials/src/graph/credential-graph.ts":{"bytesInOutput":18877},"packages/core/halo/credentials/src/state-machine/index.ts":{"bytesInOutput":0},"packages/core/halo/credentials/src/processor/index.ts":{"bytesInOutput":0},"packages/core/halo/credentials/src/processor/device-state-machine.ts":{"bytesInOutput":2782},"packages/core/halo/credentials/src/processor/profile-state-machine.ts":{"bytesInOutput":1204}},"bytes":60845}}}
@@ -1 +1 @@
1
- {"inputs":{"packages/core/halo/credentials/src/invitations.ts":{"bytes":1781,"imports":[],"format":"esm"},"packages/core/halo/credentials/src/seedphrase.ts":{"bytes":2345,"imports":[{"path":"bip39","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/passcode.ts":{"bytes":1464,"imports":[],"format":"esm"},"packages/core/halo/credentials/src/credentials/signing.ts":{"bytes":11236,"imports":[{"path":"json-stable-stringify","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/timeframe","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/presentations/signing.ts":{"bytes":3794,"imports":[{"path":"packages/core/halo/credentials/src/credentials/signing.ts","kind":"import-statement","original":"../credentials/signing"}],"format":"esm"},"packages/core/halo/credentials/src/credentials/assertions.ts":{"bytes":3821,"imports":[],"format":"esm"},"packages/core/halo/credentials/src/credentials/verifier.ts":{"bytes":8574,"imports":[{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/assertions.ts","kind":"import-statement","original":"./assertions"},{"path":"packages/core/halo/credentials/src/credentials/signing.ts","kind":"import-statement","original":"./signing"}],"format":"esm"},"packages/core/halo/credentials/src/credentials/credential-factory.ts":{"bytes":11553,"imports":[{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/signing.ts","kind":"import-statement","original":"./signing"},{"path":"packages/core/halo/credentials/src/credentials/verifier.ts","kind":"import-statement","original":"./verifier"}],"format":"esm"},"packages/core/halo/credentials/src/credentials/credential-generator.ts":{"bytes":25434,"imports":[{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/timeframe","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/credential-factory.ts","kind":"import-statement","original":"./credential-factory"}],"format":"esm"},"packages/core/halo/credentials/src/credentials/index.ts":{"bytes":929,"imports":[{"path":"packages/core/halo/credentials/src/credentials/assertions.ts","kind":"import-statement","original":"./assertions"},{"path":"packages/core/halo/credentials/src/credentials/credential-factory.ts","kind":"import-statement","original":"./credential-factory"},{"path":"packages/core/halo/credentials/src/credentials/credential-generator.ts","kind":"import-statement","original":"./credential-generator"},{"path":"packages/core/halo/credentials/src/credentials/signing.ts","kind":"import-statement","original":"./signing"},{"path":"packages/core/halo/credentials/src/credentials/verifier.ts","kind":"import-statement","original":"./verifier"}],"format":"esm"},"packages/core/halo/credentials/src/presentations/presentation.ts":{"bytes":3718,"imports":[{"path":"packages/core/halo/credentials/src/presentations/signing.ts","kind":"import-statement","original":"./signing"},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/presentations/verifier.ts":{"bytes":10470,"imports":[{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/presentations/signing.ts","kind":"import-statement","original":"./signing"},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/presentations/index.ts":{"bytes":703,"imports":[{"path":"packages/core/halo/credentials/src/presentations/signing.ts","kind":"import-statement","original":"./signing"},{"path":"packages/core/halo/credentials/src/presentations/presentation.ts","kind":"import-statement","original":"./presentation"},{"path":"packages/core/halo/credentials/src/presentations/verifier.ts","kind":"import-statement","original":"./verifier"}],"format":"esm"},"packages/core/halo/credentials/src/state-machine/feed-state-machine.ts":{"bytes":6028,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/state-machine/invitation-state-machine.ts":{"bytes":11718,"imports":[{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/graph/credential-graph.ts":{"bytes":73642,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/state-machine/member-state-machine.ts":{"bytes":21767,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"},{"path":"packages/core/halo/credentials/src/graph/credential-graph.ts","kind":"import-statement","original":"../graph/credential-graph"}],"format":"esm"},"packages/core/halo/credentials/src/state-machine/space-state-machine.ts":{"bytes":37002,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/state-machine/feed-state-machine.ts","kind":"import-statement","original":"./feed-state-machine"},{"path":"packages/core/halo/credentials/src/state-machine/invitation-state-machine.ts","kind":"import-statement","original":"./invitation-state-machine"},{"path":"packages/core/halo/credentials/src/state-machine/member-state-machine.ts","kind":"import-statement","original":"./member-state-machine"},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/state-machine/index.ts":{"bytes":909,"imports":[{"path":"packages/core/halo/credentials/src/state-machine/space-state-machine.ts","kind":"import-statement","original":"./space-state-machine"},{"path":"packages/core/halo/credentials/src/state-machine/feed-state-machine.ts","kind":"import-statement","original":"./feed-state-machine"},{"path":"packages/core/halo/credentials/src/state-machine/member-state-machine.ts","kind":"import-statement","original":"./member-state-machine"},{"path":"packages/core/halo/credentials/src/state-machine/invitation-state-machine.ts","kind":"import-statement","original":"./invitation-state-machine"}],"format":"esm"},"packages/core/halo/credentials/src/processor/credential-processor.ts":{"bytes":735,"imports":[],"format":"esm"},"packages/core/halo/credentials/src/processor/device-state-machine.ts":{"bytes":10680,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/processor/profile-state-machine.ts":{"bytes":5520,"imports":[{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/processor/index.ts":{"bytes":785,"imports":[{"path":"packages/core/halo/credentials/src/processor/credential-processor.ts","kind":"import-statement","original":"./credential-processor"},{"path":"packages/core/halo/credentials/src/processor/device-state-machine.ts","kind":"import-statement","original":"./device-state-machine"},{"path":"packages/core/halo/credentials/src/processor/profile-state-machine.ts","kind":"import-statement","original":"./profile-state-machine"}],"format":"esm"},"packages/core/halo/credentials/src/index.ts":{"bytes":1093,"imports":[{"path":"packages/core/halo/credentials/src/invitations.ts","kind":"import-statement","original":"./invitations"},{"path":"packages/core/halo/credentials/src/seedphrase.ts","kind":"import-statement","original":"./seedphrase"},{"path":"packages/core/halo/credentials/src/passcode.ts","kind":"import-statement","original":"./passcode"},{"path":"packages/core/halo/credentials/src/presentations/index.ts","kind":"import-statement","original":"./presentations"},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"./credentials"},{"path":"packages/core/halo/credentials/src/state-machine/index.ts","kind":"import-statement","original":"./state-machine"},{"path":"packages/core/halo/credentials/src/processor/index.ts","kind":"import-statement","original":"./processor"}],"format":"esm"}},"outputs":{"packages/core/halo/credentials/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":119081},"packages/core/halo/credentials/dist/lib/node/index.cjs":{"imports":[{"path":"bip39","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"json-stable-stringify","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/timeframe","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/timeframe","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["CredentialGenerator","DeviceStateMachine","FeedStateMachine","InvitationStateMachine","MemberStateMachine","ProfileStateMachine","SIGNATURE_TYPE_ED25519","SpaceStateMachine","canonicalStringify","checkCredentialType","createAdmissionCredentials","createCancelDelegatedSpaceInvitationCredential","createCredential","createCredentialMessage","createCredentialSignerWithChain","createCredentialSignerWithKey","createDelegatedSpaceInvitationCredential","createDeviceAuthorization","credentialTypeFilter","defaultSecretProvider","defaultSecretValidator","generatePasscode","generateSeedPhrase","getCredentialAssertion","getCredentialProofPayload","getPresentationProofPayload","isValidAuthorizedDeviceCredential","keyPairFromSeedPhrase","signPresentation","verifyChain","verifyCredential","verifyCredentialSignature","verifyPresentation","verifyPresentationChain","verifyPresentationSignature"],"entryPoint":"packages/core/halo/credentials/src/index.ts","inputs":{"packages/core/halo/credentials/src/invitations.ts":{"bytesInOutput":126},"packages/core/halo/credentials/src/index.ts":{"bytesInOutput":0},"packages/core/halo/credentials/src/seedphrase.ts":{"bytesInOutput":560},"packages/core/halo/credentials/src/passcode.ts":{"bytesInOutput":178},"packages/core/halo/credentials/src/credentials/signing.ts":{"bytesInOutput":2037},"packages/core/halo/credentials/src/presentations/signing.ts":{"bytesInOutput":733},"packages/core/halo/credentials/src/credentials/assertions.ts":{"bytesInOutput":648},"packages/core/halo/credentials/src/credentials/credential-factory.ts":{"bytesInOutput":2614},"packages/core/halo/credentials/src/credentials/verifier.ts":{"bytesInOutput":1762},"packages/core/halo/credentials/src/credentials/credential-generator.ts":{"bytesInOutput":5630},"packages/core/halo/credentials/src/presentations/presentation.ts":{"bytesInOutput":578},"packages/core/halo/credentials/src/presentations/verifier.ts":{"bytesInOutput":2306},"packages/core/halo/credentials/src/state-machine/space-state-machine.ts":{"bytesInOutput":8796},"packages/core/halo/credentials/src/state-machine/feed-state-machine.ts":{"bytesInOutput":1545},"packages/core/halo/credentials/src/state-machine/invitation-state-machine.ts":{"bytesInOutput":2764},"packages/core/halo/credentials/src/state-machine/member-state-machine.ts":{"bytesInOutput":5260},"packages/core/halo/credentials/src/graph/credential-graph.ts":{"bytesInOutput":18877},"packages/core/halo/credentials/src/processor/device-state-machine.ts":{"bytesInOutput":2782},"packages/core/halo/credentials/src/processor/profile-state-machine.ts":{"bytesInOutput":1204}},"bytes":60811}}}
1
+ {"inputs":{"packages/core/halo/credentials/src/invitations.ts":{"bytes":1781,"imports":[],"format":"esm"},"packages/core/halo/credentials/src/seedphrase.ts":{"bytes":2345,"imports":[{"path":"bip39","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/passcode.ts":{"bytes":1464,"imports":[],"format":"esm"},"packages/core/halo/credentials/src/credentials/signing.ts":{"bytes":11236,"imports":[{"path":"json-stable-stringify","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/timeframe","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/presentations/signing.ts":{"bytes":3794,"imports":[{"path":"packages/core/halo/credentials/src/credentials/signing.ts","kind":"import-statement","original":"../credentials/signing"}],"format":"esm"},"packages/core/halo/credentials/src/credentials/assertions.ts":{"bytes":3821,"imports":[],"format":"esm"},"packages/core/halo/credentials/src/credentials/verifier.ts":{"bytes":8574,"imports":[{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/assertions.ts","kind":"import-statement","original":"./assertions"},{"path":"packages/core/halo/credentials/src/credentials/signing.ts","kind":"import-statement","original":"./signing"}],"format":"esm"},"packages/core/halo/credentials/src/credentials/credential-factory.ts":{"bytes":11553,"imports":[{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/signing.ts","kind":"import-statement","original":"./signing"},{"path":"packages/core/halo/credentials/src/credentials/verifier.ts","kind":"import-statement","original":"./verifier"}],"format":"esm"},"packages/core/halo/credentials/src/credentials/credential-generator.ts":{"bytes":25434,"imports":[{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/timeframe","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/credential-factory.ts","kind":"import-statement","original":"./credential-factory"}],"format":"esm"},"packages/core/halo/credentials/src/credentials/index.ts":{"bytes":929,"imports":[{"path":"packages/core/halo/credentials/src/credentials/assertions.ts","kind":"import-statement","original":"./assertions"},{"path":"packages/core/halo/credentials/src/credentials/credential-factory.ts","kind":"import-statement","original":"./credential-factory"},{"path":"packages/core/halo/credentials/src/credentials/credential-generator.ts","kind":"import-statement","original":"./credential-generator"},{"path":"packages/core/halo/credentials/src/credentials/signing.ts","kind":"import-statement","original":"./signing"},{"path":"packages/core/halo/credentials/src/credentials/verifier.ts","kind":"import-statement","original":"./verifier"}],"format":"esm"},"packages/core/halo/credentials/src/presentations/presentation.ts":{"bytes":3718,"imports":[{"path":"packages/core/halo/credentials/src/presentations/signing.ts","kind":"import-statement","original":"./signing"},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/presentations/verifier.ts":{"bytes":10470,"imports":[{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/presentations/signing.ts","kind":"import-statement","original":"./signing"},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/presentations/index.ts":{"bytes":703,"imports":[{"path":"packages/core/halo/credentials/src/presentations/signing.ts","kind":"import-statement","original":"./signing"},{"path":"packages/core/halo/credentials/src/presentations/presentation.ts","kind":"import-statement","original":"./presentation"},{"path":"packages/core/halo/credentials/src/presentations/verifier.ts","kind":"import-statement","original":"./verifier"}],"format":"esm"},"packages/core/halo/credentials/src/state-machine/feed-state-machine.ts":{"bytes":6028,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/state-machine/invitation-state-machine.ts":{"bytes":11718,"imports":[{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/graph/credential-graph.ts":{"bytes":73642,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/state-machine/member-state-machine.ts":{"bytes":21767,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"},{"path":"packages/core/halo/credentials/src/graph/credential-graph.ts","kind":"import-statement","original":"../graph/credential-graph"}],"format":"esm"},"packages/core/halo/credentials/src/state-machine/space-state-machine.ts":{"bytes":37002,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/state-machine/feed-state-machine.ts","kind":"import-statement","original":"./feed-state-machine"},{"path":"packages/core/halo/credentials/src/state-machine/invitation-state-machine.ts","kind":"import-statement","original":"./invitation-state-machine"},{"path":"packages/core/halo/credentials/src/state-machine/member-state-machine.ts","kind":"import-statement","original":"./member-state-machine"},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/state-machine/index.ts":{"bytes":909,"imports":[{"path":"packages/core/halo/credentials/src/state-machine/space-state-machine.ts","kind":"import-statement","original":"./space-state-machine"},{"path":"packages/core/halo/credentials/src/state-machine/feed-state-machine.ts","kind":"import-statement","original":"./feed-state-machine"},{"path":"packages/core/halo/credentials/src/state-machine/member-state-machine.ts","kind":"import-statement","original":"./member-state-machine"},{"path":"packages/core/halo/credentials/src/state-machine/invitation-state-machine.ts","kind":"import-statement","original":"./invitation-state-machine"}],"format":"esm"},"packages/core/halo/credentials/src/processor/credential-processor.ts":{"bytes":735,"imports":[],"format":"esm"},"packages/core/halo/credentials/src/processor/device-state-machine.ts":{"bytes":10680,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/processor/profile-state-machine.ts":{"bytes":5520,"imports":[{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/processor/index.ts":{"bytes":785,"imports":[{"path":"packages/core/halo/credentials/src/processor/credential-processor.ts","kind":"import-statement","original":"./credential-processor"},{"path":"packages/core/halo/credentials/src/processor/device-state-machine.ts","kind":"import-statement","original":"./device-state-machine"},{"path":"packages/core/halo/credentials/src/processor/profile-state-machine.ts","kind":"import-statement","original":"./profile-state-machine"}],"format":"esm"},"packages/core/halo/credentials/src/index.ts":{"bytes":1093,"imports":[{"path":"packages/core/halo/credentials/src/invitations.ts","kind":"import-statement","original":"./invitations"},{"path":"packages/core/halo/credentials/src/seedphrase.ts","kind":"import-statement","original":"./seedphrase"},{"path":"packages/core/halo/credentials/src/passcode.ts","kind":"import-statement","original":"./passcode"},{"path":"packages/core/halo/credentials/src/presentations/index.ts","kind":"import-statement","original":"./presentations"},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"./credentials"},{"path":"packages/core/halo/credentials/src/state-machine/index.ts","kind":"import-statement","original":"./state-machine"},{"path":"packages/core/halo/credentials/src/processor/index.ts","kind":"import-statement","original":"./processor"}],"format":"esm"}},"outputs":{"packages/core/halo/credentials/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":119081},"packages/core/halo/credentials/dist/lib/node/index.cjs":{"imports":[{"path":"bip39","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"json-stable-stringify","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/timeframe","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/timeframe","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["CredentialGenerator","DeviceStateMachine","FeedStateMachine","InvitationStateMachine","MemberStateMachine","ProfileStateMachine","SIGNATURE_TYPE_ED25519","SpaceStateMachine","canonicalStringify","checkCredentialType","createAdmissionCredentials","createCancelDelegatedSpaceInvitationCredential","createCredential","createCredentialMessage","createCredentialSignerWithChain","createCredentialSignerWithKey","createDelegatedSpaceInvitationCredential","createDeviceAuthorization","credentialTypeFilter","defaultSecretProvider","defaultSecretValidator","generatePasscode","generateSeedPhrase","getCredentialAssertion","getCredentialProofPayload","getPresentationProofPayload","isValidAuthorizedDeviceCredential","keyPairFromSeedPhrase","signPresentation","verifyChain","verifyCredential","verifyCredentialSignature","verifyPresentation","verifyPresentationChain","verifyPresentationSignature"],"entryPoint":"packages/core/halo/credentials/src/index.ts","inputs":{"packages/core/halo/credentials/src/invitations.ts":{"bytesInOutput":126},"packages/core/halo/credentials/src/index.ts":{"bytesInOutput":0},"packages/core/halo/credentials/src/seedphrase.ts":{"bytesInOutput":560},"packages/core/halo/credentials/src/passcode.ts":{"bytesInOutput":178},"packages/core/halo/credentials/src/credentials/signing.ts":{"bytesInOutput":2037},"packages/core/halo/credentials/src/presentations/signing.ts":{"bytesInOutput":733},"packages/core/halo/credentials/src/presentations/index.ts":{"bytesInOutput":0},"packages/core/halo/credentials/src/credentials/assertions.ts":{"bytesInOutput":648},"packages/core/halo/credentials/src/credentials/index.ts":{"bytesInOutput":0},"packages/core/halo/credentials/src/credentials/credential-factory.ts":{"bytesInOutput":2614},"packages/core/halo/credentials/src/credentials/verifier.ts":{"bytesInOutput":1762},"packages/core/halo/credentials/src/credentials/credential-generator.ts":{"bytesInOutput":5630},"packages/core/halo/credentials/src/presentations/presentation.ts":{"bytesInOutput":578},"packages/core/halo/credentials/src/presentations/verifier.ts":{"bytesInOutput":2306},"packages/core/halo/credentials/src/state-machine/space-state-machine.ts":{"bytesInOutput":8796},"packages/core/halo/credentials/src/state-machine/feed-state-machine.ts":{"bytesInOutput":1545},"packages/core/halo/credentials/src/state-machine/invitation-state-machine.ts":{"bytesInOutput":2764},"packages/core/halo/credentials/src/state-machine/member-state-machine.ts":{"bytesInOutput":5260},"packages/core/halo/credentials/src/graph/credential-graph.ts":{"bytesInOutput":18877},"packages/core/halo/credentials/src/state-machine/index.ts":{"bytesInOutput":0},"packages/core/halo/credentials/src/processor/index.ts":{"bytesInOutput":0},"packages/core/halo/credentials/src/processor/device-state-machine.ts":{"bytesInOutput":2782},"packages/core/halo/credentials/src/processor/profile-state-machine.ts":{"bytesInOutput":1204}},"bytes":60811}}}
@@ -1 +1 @@
1
- {"inputs":{"packages/core/halo/credentials/src/invitations.ts":{"bytes":1781,"imports":[],"format":"esm"},"packages/core/halo/credentials/src/seedphrase.ts":{"bytes":2345,"imports":[{"path":"bip39","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/passcode.ts":{"bytes":1464,"imports":[],"format":"esm"},"packages/core/halo/credentials/src/credentials/signing.ts":{"bytes":11236,"imports":[{"path":"json-stable-stringify","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/timeframe","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/presentations/signing.ts":{"bytes":3794,"imports":[{"path":"packages/core/halo/credentials/src/credentials/signing.ts","kind":"import-statement","original":"../credentials/signing"}],"format":"esm"},"packages/core/halo/credentials/src/credentials/assertions.ts":{"bytes":3821,"imports":[],"format":"esm"},"packages/core/halo/credentials/src/credentials/verifier.ts":{"bytes":8574,"imports":[{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/assertions.ts","kind":"import-statement","original":"./assertions"},{"path":"packages/core/halo/credentials/src/credentials/signing.ts","kind":"import-statement","original":"./signing"}],"format":"esm"},"packages/core/halo/credentials/src/credentials/credential-factory.ts":{"bytes":11553,"imports":[{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/signing.ts","kind":"import-statement","original":"./signing"},{"path":"packages/core/halo/credentials/src/credentials/verifier.ts","kind":"import-statement","original":"./verifier"}],"format":"esm"},"packages/core/halo/credentials/src/credentials/credential-generator.ts":{"bytes":25434,"imports":[{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/timeframe","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/credential-factory.ts","kind":"import-statement","original":"./credential-factory"}],"format":"esm"},"packages/core/halo/credentials/src/credentials/index.ts":{"bytes":929,"imports":[{"path":"packages/core/halo/credentials/src/credentials/assertions.ts","kind":"import-statement","original":"./assertions"},{"path":"packages/core/halo/credentials/src/credentials/credential-factory.ts","kind":"import-statement","original":"./credential-factory"},{"path":"packages/core/halo/credentials/src/credentials/credential-generator.ts","kind":"import-statement","original":"./credential-generator"},{"path":"packages/core/halo/credentials/src/credentials/signing.ts","kind":"import-statement","original":"./signing"},{"path":"packages/core/halo/credentials/src/credentials/verifier.ts","kind":"import-statement","original":"./verifier"}],"format":"esm"},"packages/core/halo/credentials/src/presentations/presentation.ts":{"bytes":3718,"imports":[{"path":"packages/core/halo/credentials/src/presentations/signing.ts","kind":"import-statement","original":"./signing"},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/presentations/verifier.ts":{"bytes":10470,"imports":[{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/presentations/signing.ts","kind":"import-statement","original":"./signing"},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/presentations/index.ts":{"bytes":703,"imports":[{"path":"packages/core/halo/credentials/src/presentations/signing.ts","kind":"import-statement","original":"./signing"},{"path":"packages/core/halo/credentials/src/presentations/presentation.ts","kind":"import-statement","original":"./presentation"},{"path":"packages/core/halo/credentials/src/presentations/verifier.ts","kind":"import-statement","original":"./verifier"}],"format":"esm"},"packages/core/halo/credentials/src/state-machine/feed-state-machine.ts":{"bytes":6028,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/state-machine/invitation-state-machine.ts":{"bytes":11718,"imports":[{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/graph/credential-graph.ts":{"bytes":73642,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/state-machine/member-state-machine.ts":{"bytes":21767,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"},{"path":"packages/core/halo/credentials/src/graph/credential-graph.ts","kind":"import-statement","original":"../graph/credential-graph"}],"format":"esm"},"packages/core/halo/credentials/src/state-machine/space-state-machine.ts":{"bytes":37002,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/state-machine/feed-state-machine.ts","kind":"import-statement","original":"./feed-state-machine"},{"path":"packages/core/halo/credentials/src/state-machine/invitation-state-machine.ts","kind":"import-statement","original":"./invitation-state-machine"},{"path":"packages/core/halo/credentials/src/state-machine/member-state-machine.ts","kind":"import-statement","original":"./member-state-machine"},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/state-machine/index.ts":{"bytes":909,"imports":[{"path":"packages/core/halo/credentials/src/state-machine/space-state-machine.ts","kind":"import-statement","original":"./space-state-machine"},{"path":"packages/core/halo/credentials/src/state-machine/feed-state-machine.ts","kind":"import-statement","original":"./feed-state-machine"},{"path":"packages/core/halo/credentials/src/state-machine/member-state-machine.ts","kind":"import-statement","original":"./member-state-machine"},{"path":"packages/core/halo/credentials/src/state-machine/invitation-state-machine.ts","kind":"import-statement","original":"./invitation-state-machine"}],"format":"esm"},"packages/core/halo/credentials/src/processor/credential-processor.ts":{"bytes":735,"imports":[],"format":"esm"},"packages/core/halo/credentials/src/processor/device-state-machine.ts":{"bytes":10680,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/processor/profile-state-machine.ts":{"bytes":5520,"imports":[{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/processor/index.ts":{"bytes":785,"imports":[{"path":"packages/core/halo/credentials/src/processor/credential-processor.ts","kind":"import-statement","original":"./credential-processor"},{"path":"packages/core/halo/credentials/src/processor/device-state-machine.ts","kind":"import-statement","original":"./device-state-machine"},{"path":"packages/core/halo/credentials/src/processor/profile-state-machine.ts","kind":"import-statement","original":"./profile-state-machine"}],"format":"esm"},"packages/core/halo/credentials/src/index.ts":{"bytes":1093,"imports":[{"path":"packages/core/halo/credentials/src/invitations.ts","kind":"import-statement","original":"./invitations"},{"path":"packages/core/halo/credentials/src/seedphrase.ts","kind":"import-statement","original":"./seedphrase"},{"path":"packages/core/halo/credentials/src/passcode.ts","kind":"import-statement","original":"./passcode"},{"path":"packages/core/halo/credentials/src/presentations/index.ts","kind":"import-statement","original":"./presentations"},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"./credentials"},{"path":"packages/core/halo/credentials/src/state-machine/index.ts","kind":"import-statement","original":"./state-machine"},{"path":"packages/core/halo/credentials/src/processor/index.ts","kind":"import-statement","original":"./processor"}],"format":"esm"}},"outputs":{"packages/core/halo/credentials/dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":119083},"packages/core/halo/credentials/dist/lib/node-esm/index.mjs":{"imports":[{"path":"bip39","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"json-stable-stringify","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/timeframe","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/timeframe","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["CredentialGenerator","DeviceStateMachine","FeedStateMachine","InvitationStateMachine","MemberStateMachine","ProfileStateMachine","SIGNATURE_TYPE_ED25519","SpaceStateMachine","canonicalStringify","checkCredentialType","createAdmissionCredentials","createCancelDelegatedSpaceInvitationCredential","createCredential","createCredentialMessage","createCredentialSignerWithChain","createCredentialSignerWithKey","createDelegatedSpaceInvitationCredential","createDeviceAuthorization","credentialTypeFilter","defaultSecretProvider","defaultSecretValidator","generatePasscode","generateSeedPhrase","getCredentialAssertion","getCredentialProofPayload","getPresentationProofPayload","isValidAuthorizedDeviceCredential","keyPairFromSeedPhrase","signPresentation","verifyChain","verifyCredential","verifyCredentialSignature","verifyPresentation","verifyPresentationChain","verifyPresentationSignature"],"entryPoint":"packages/core/halo/credentials/src/index.ts","inputs":{"packages/core/halo/credentials/src/invitations.ts":{"bytesInOutput":126},"packages/core/halo/credentials/src/index.ts":{"bytesInOutput":0},"packages/core/halo/credentials/src/seedphrase.ts":{"bytesInOutput":560},"packages/core/halo/credentials/src/passcode.ts":{"bytesInOutput":178},"packages/core/halo/credentials/src/credentials/signing.ts":{"bytesInOutput":2037},"packages/core/halo/credentials/src/presentations/signing.ts":{"bytesInOutput":733},"packages/core/halo/credentials/src/credentials/assertions.ts":{"bytesInOutput":648},"packages/core/halo/credentials/src/credentials/credential-factory.ts":{"bytesInOutput":2614},"packages/core/halo/credentials/src/credentials/verifier.ts":{"bytesInOutput":1762},"packages/core/halo/credentials/src/credentials/credential-generator.ts":{"bytesInOutput":5630},"packages/core/halo/credentials/src/presentations/presentation.ts":{"bytesInOutput":578},"packages/core/halo/credentials/src/presentations/verifier.ts":{"bytesInOutput":2306},"packages/core/halo/credentials/src/state-machine/space-state-machine.ts":{"bytesInOutput":8796},"packages/core/halo/credentials/src/state-machine/feed-state-machine.ts":{"bytesInOutput":1545},"packages/core/halo/credentials/src/state-machine/invitation-state-machine.ts":{"bytesInOutput":2764},"packages/core/halo/credentials/src/state-machine/member-state-machine.ts":{"bytesInOutput":5260},"packages/core/halo/credentials/src/graph/credential-graph.ts":{"bytesInOutput":18877},"packages/core/halo/credentials/src/processor/device-state-machine.ts":{"bytesInOutput":2782},"packages/core/halo/credentials/src/processor/profile-state-machine.ts":{"bytesInOutput":1204}},"bytes":60904}}}
1
+ {"inputs":{"packages/core/halo/credentials/src/invitations.ts":{"bytes":1781,"imports":[],"format":"esm"},"packages/core/halo/credentials/src/seedphrase.ts":{"bytes":2345,"imports":[{"path":"bip39","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/passcode.ts":{"bytes":1464,"imports":[],"format":"esm"},"packages/core/halo/credentials/src/credentials/signing.ts":{"bytes":11236,"imports":[{"path":"json-stable-stringify","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/timeframe","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/presentations/signing.ts":{"bytes":3794,"imports":[{"path":"packages/core/halo/credentials/src/credentials/signing.ts","kind":"import-statement","original":"../credentials/signing"}],"format":"esm"},"packages/core/halo/credentials/src/credentials/assertions.ts":{"bytes":3821,"imports":[],"format":"esm"},"packages/core/halo/credentials/src/credentials/verifier.ts":{"bytes":8574,"imports":[{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/assertions.ts","kind":"import-statement","original":"./assertions"},{"path":"packages/core/halo/credentials/src/credentials/signing.ts","kind":"import-statement","original":"./signing"}],"format":"esm"},"packages/core/halo/credentials/src/credentials/credential-factory.ts":{"bytes":11553,"imports":[{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/signing.ts","kind":"import-statement","original":"./signing"},{"path":"packages/core/halo/credentials/src/credentials/verifier.ts","kind":"import-statement","original":"./verifier"}],"format":"esm"},"packages/core/halo/credentials/src/credentials/credential-generator.ts":{"bytes":25434,"imports":[{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/timeframe","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/credential-factory.ts","kind":"import-statement","original":"./credential-factory"}],"format":"esm"},"packages/core/halo/credentials/src/credentials/index.ts":{"bytes":929,"imports":[{"path":"packages/core/halo/credentials/src/credentials/assertions.ts","kind":"import-statement","original":"./assertions"},{"path":"packages/core/halo/credentials/src/credentials/credential-factory.ts","kind":"import-statement","original":"./credential-factory"},{"path":"packages/core/halo/credentials/src/credentials/credential-generator.ts","kind":"import-statement","original":"./credential-generator"},{"path":"packages/core/halo/credentials/src/credentials/signing.ts","kind":"import-statement","original":"./signing"},{"path":"packages/core/halo/credentials/src/credentials/verifier.ts","kind":"import-statement","original":"./verifier"}],"format":"esm"},"packages/core/halo/credentials/src/presentations/presentation.ts":{"bytes":3718,"imports":[{"path":"packages/core/halo/credentials/src/presentations/signing.ts","kind":"import-statement","original":"./signing"},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/presentations/verifier.ts":{"bytes":10470,"imports":[{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/presentations/signing.ts","kind":"import-statement","original":"./signing"},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/presentations/index.ts":{"bytes":703,"imports":[{"path":"packages/core/halo/credentials/src/presentations/signing.ts","kind":"import-statement","original":"./signing"},{"path":"packages/core/halo/credentials/src/presentations/presentation.ts","kind":"import-statement","original":"./presentation"},{"path":"packages/core/halo/credentials/src/presentations/verifier.ts","kind":"import-statement","original":"./verifier"}],"format":"esm"},"packages/core/halo/credentials/src/state-machine/feed-state-machine.ts":{"bytes":6028,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/state-machine/invitation-state-machine.ts":{"bytes":11718,"imports":[{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/graph/credential-graph.ts":{"bytes":73642,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/core/halo/credentials/src/state-machine/member-state-machine.ts":{"bytes":21767,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"},{"path":"packages/core/halo/credentials/src/graph/credential-graph.ts","kind":"import-statement","original":"../graph/credential-graph"}],"format":"esm"},"packages/core/halo/credentials/src/state-machine/space-state-machine.ts":{"bytes":37002,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/state-machine/feed-state-machine.ts","kind":"import-statement","original":"./feed-state-machine"},{"path":"packages/core/halo/credentials/src/state-machine/invitation-state-machine.ts","kind":"import-statement","original":"./invitation-state-machine"},{"path":"packages/core/halo/credentials/src/state-machine/member-state-machine.ts","kind":"import-statement","original":"./member-state-machine"},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/state-machine/index.ts":{"bytes":909,"imports":[{"path":"packages/core/halo/credentials/src/state-machine/space-state-machine.ts","kind":"import-statement","original":"./space-state-machine"},{"path":"packages/core/halo/credentials/src/state-machine/feed-state-machine.ts","kind":"import-statement","original":"./feed-state-machine"},{"path":"packages/core/halo/credentials/src/state-machine/member-state-machine.ts","kind":"import-statement","original":"./member-state-machine"},{"path":"packages/core/halo/credentials/src/state-machine/invitation-state-machine.ts","kind":"import-statement","original":"./invitation-state-machine"}],"format":"esm"},"packages/core/halo/credentials/src/processor/credential-processor.ts":{"bytes":735,"imports":[],"format":"esm"},"packages/core/halo/credentials/src/processor/device-state-machine.ts":{"bytes":10680,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/processor/profile-state-machine.ts":{"bytes":5520,"imports":[{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"../credentials"}],"format":"esm"},"packages/core/halo/credentials/src/processor/index.ts":{"bytes":785,"imports":[{"path":"packages/core/halo/credentials/src/processor/credential-processor.ts","kind":"import-statement","original":"./credential-processor"},{"path":"packages/core/halo/credentials/src/processor/device-state-machine.ts","kind":"import-statement","original":"./device-state-machine"},{"path":"packages/core/halo/credentials/src/processor/profile-state-machine.ts","kind":"import-statement","original":"./profile-state-machine"}],"format":"esm"},"packages/core/halo/credentials/src/index.ts":{"bytes":1093,"imports":[{"path":"packages/core/halo/credentials/src/invitations.ts","kind":"import-statement","original":"./invitations"},{"path":"packages/core/halo/credentials/src/seedphrase.ts","kind":"import-statement","original":"./seedphrase"},{"path":"packages/core/halo/credentials/src/passcode.ts","kind":"import-statement","original":"./passcode"},{"path":"packages/core/halo/credentials/src/presentations/index.ts","kind":"import-statement","original":"./presentations"},{"path":"packages/core/halo/credentials/src/credentials/index.ts","kind":"import-statement","original":"./credentials"},{"path":"packages/core/halo/credentials/src/state-machine/index.ts","kind":"import-statement","original":"./state-machine"},{"path":"packages/core/halo/credentials/src/processor/index.ts","kind":"import-statement","original":"./processor"}],"format":"esm"}},"outputs":{"packages/core/halo/credentials/dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":119083},"packages/core/halo/credentials/dist/lib/node-esm/index.mjs":{"imports":[{"path":"bip39","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"json-stable-stringify","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/timeframe","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/timeframe","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/halo/credentials","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["CredentialGenerator","DeviceStateMachine","FeedStateMachine","InvitationStateMachine","MemberStateMachine","ProfileStateMachine","SIGNATURE_TYPE_ED25519","SpaceStateMachine","canonicalStringify","checkCredentialType","createAdmissionCredentials","createCancelDelegatedSpaceInvitationCredential","createCredential","createCredentialMessage","createCredentialSignerWithChain","createCredentialSignerWithKey","createDelegatedSpaceInvitationCredential","createDeviceAuthorization","credentialTypeFilter","defaultSecretProvider","defaultSecretValidator","generatePasscode","generateSeedPhrase","getCredentialAssertion","getCredentialProofPayload","getPresentationProofPayload","isValidAuthorizedDeviceCredential","keyPairFromSeedPhrase","signPresentation","verifyChain","verifyCredential","verifyCredentialSignature","verifyPresentation","verifyPresentationChain","verifyPresentationSignature"],"entryPoint":"packages/core/halo/credentials/src/index.ts","inputs":{"packages/core/halo/credentials/src/invitations.ts":{"bytesInOutput":126},"packages/core/halo/credentials/src/index.ts":{"bytesInOutput":0},"packages/core/halo/credentials/src/seedphrase.ts":{"bytesInOutput":560},"packages/core/halo/credentials/src/passcode.ts":{"bytesInOutput":178},"packages/core/halo/credentials/src/credentials/signing.ts":{"bytesInOutput":2037},"packages/core/halo/credentials/src/presentations/signing.ts":{"bytesInOutput":733},"packages/core/halo/credentials/src/presentations/index.ts":{"bytesInOutput":0},"packages/core/halo/credentials/src/credentials/assertions.ts":{"bytesInOutput":648},"packages/core/halo/credentials/src/credentials/index.ts":{"bytesInOutput":0},"packages/core/halo/credentials/src/credentials/credential-factory.ts":{"bytesInOutput":2614},"packages/core/halo/credentials/src/credentials/verifier.ts":{"bytesInOutput":1762},"packages/core/halo/credentials/src/credentials/credential-generator.ts":{"bytesInOutput":5630},"packages/core/halo/credentials/src/presentations/presentation.ts":{"bytesInOutput":578},"packages/core/halo/credentials/src/presentations/verifier.ts":{"bytesInOutput":2306},"packages/core/halo/credentials/src/state-machine/space-state-machine.ts":{"bytesInOutput":8796},"packages/core/halo/credentials/src/state-machine/feed-state-machine.ts":{"bytesInOutput":1545},"packages/core/halo/credentials/src/state-machine/invitation-state-machine.ts":{"bytesInOutput":2764},"packages/core/halo/credentials/src/state-machine/member-state-machine.ts":{"bytesInOutput":5260},"packages/core/halo/credentials/src/graph/credential-graph.ts":{"bytesInOutput":18877},"packages/core/halo/credentials/src/state-machine/index.ts":{"bytesInOutput":0},"packages/core/halo/credentials/src/processor/index.ts":{"bytesInOutput":0},"packages/core/halo/credentials/src/processor/device-state-machine.ts":{"bytesInOutput":2782},"packages/core/halo/credentials/src/processor/profile-state-machine.ts":{"bytesInOutput":1204}},"bytes":60904}}}
package/package.json CHANGED
@@ -1,21 +1,18 @@
1
1
  {
2
2
  "name": "@dxos/credentials",
3
- "version": "0.6.14-main.2b6a0f3",
3
+ "version": "0.6.14-main.f49f251",
4
4
  "description": "DXOS Credentials",
5
5
  "homepage": "https://github.com/dxos/dxos/tree/main/packages/core/halo/credentials#readme",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
7
7
  "repository": "github:dxos/dxos",
8
8
  "license": "MIT",
9
9
  "author": "info@dxos.org",
10
- "sideEffects": false,
10
+ "sideEffects": true,
11
11
  "exports": {
12
12
  ".": {
13
+ "types": "./dist/types/src/index.d.ts",
13
14
  "browser": "./dist/lib/browser/index.mjs",
14
- "node": {
15
- "require": "./dist/lib/node/index.cjs",
16
- "default": "./dist/lib/node-esm/index.mjs"
17
- },
18
- "types": "./dist/types/src/index.d.ts"
15
+ "node": "./dist/lib/node-esm/index.mjs"
19
16
  }
20
17
  },
21
18
  "types": "dist/types/src/index.d.ts",
@@ -25,17 +22,17 @@
25
22
  "dependencies": {
26
23
  "bip39": "^3.1.0",
27
24
  "json-stable-stringify": "^1.0.1",
28
- "@dxos/async": "0.6.14-main.2b6a0f3",
29
- "@dxos/crypto": "0.6.14-main.2b6a0f3",
30
- "@dxos/context": "0.6.14-main.2b6a0f3",
31
- "@dxos/keyring": "0.6.14-main.2b6a0f3",
32
- "@dxos/invariant": "0.6.14-main.2b6a0f3",
33
- "@dxos/log": "0.6.14-main.2b6a0f3",
34
- "@dxos/keys": "0.6.14-main.2b6a0f3",
35
- "@dxos/node-std": "0.6.14-main.2b6a0f3",
36
- "@dxos/timeframe": "0.6.14-main.2b6a0f3",
37
- "@dxos/protocols": "0.6.14-main.2b6a0f3",
38
- "@dxos/util": "0.6.14-main.2b6a0f3"
25
+ "@dxos/async": "0.6.14-main.f49f251",
26
+ "@dxos/crypto": "0.6.14-main.f49f251",
27
+ "@dxos/context": "0.6.14-main.f49f251",
28
+ "@dxos/invariant": "0.6.14-main.f49f251",
29
+ "@dxos/keys": "0.6.14-main.f49f251",
30
+ "@dxos/keyring": "0.6.14-main.f49f251",
31
+ "@dxos/node-std": "0.6.14-main.f49f251",
32
+ "@dxos/log": "0.6.14-main.f49f251",
33
+ "@dxos/timeframe": "0.6.14-main.f49f251",
34
+ "@dxos/protocols": "0.6.14-main.f49f251",
35
+ "@dxos/util": "0.6.14-main.f49f251"
39
36
  },
40
37
  "devDependencies": {
41
38
  "@types/json-stable-stringify": "^1.0.32"