@minca/core 0.1.14 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/elements/auth-styles.d.ts +1 -1
- package/dist/elements/auth-styles.d.ts.map +1 -1
- package/dist/elements/auth-styles.js +21 -4
- package/dist/elements/auth-styles.js.map +1 -1
- package/dist/elements/minca-auth.d.ts.map +1 -1
- package/dist/elements/minca-auth.js +151 -57
- package/dist/elements/minca-auth.js.map +1 -1
- package/dist/files/space-files.d.ts +15 -3
- package/dist/files/space-files.d.ts.map +1 -1
- package/dist/files/space-files.js +225 -37
- package/dist/files/space-files.js.map +1 -1
- package/dist/identity/abilities.d.ts +2 -0
- package/dist/identity/abilities.d.ts.map +1 -1
- package/dist/identity/abilities.js +2 -0
- package/dist/identity/abilities.js.map +1 -1
- package/dist/identity/account-vault.d.ts +15 -71
- package/dist/identity/account-vault.d.ts.map +1 -1
- package/dist/identity/account-vault.js +45 -104
- package/dist/identity/account-vault.js.map +1 -1
- package/dist/identity/channel.d.ts +3 -9
- package/dist/identity/channel.d.ts.map +1 -1
- package/dist/identity/channel.js +42 -42
- package/dist/identity/channel.js.map +1 -1
- package/dist/identity/contact-key.d.ts +14 -29
- package/dist/identity/contact-key.d.ts.map +1 -1
- package/dist/identity/contact-key.js +31 -51
- package/dist/identity/contact-key.js.map +1 -1
- package/dist/identity/crypto-p256.d.ts.map +1 -1
- package/dist/identity/crypto-p256.js +39 -53
- package/dist/identity/crypto-p256.js.map +1 -1
- package/dist/identity/hpke.d.ts.map +1 -1
- package/dist/identity/hpke.js +19 -19
- package/dist/identity/hpke.js.map +1 -1
- package/dist/identity/identity-manager.d.ts.map +1 -1
- package/dist/identity/identity-manager.js +1 -2
- package/dist/identity/identity-manager.js.map +1 -1
- package/dist/identity/policy.d.ts.map +1 -1
- package/dist/identity/policy.js +35 -61
- package/dist/identity/policy.js.map +1 -1
- package/dist/identity/recovery-code.d.ts +2 -8
- package/dist/identity/recovery-code.d.ts.map +1 -1
- package/dist/identity/recovery-code.js +4 -11
- package/dist/identity/recovery-code.js.map +1 -1
- package/dist/identity/root-signer.d.ts +1 -6
- package/dist/identity/root-signer.d.ts.map +1 -1
- package/dist/identity/root-signer.js +12 -15
- package/dist/identity/root-signer.js.map +1 -1
- package/dist/identity/ucan.d.ts.map +1 -1
- package/dist/identity/ucan.js +48 -39
- package/dist/identity/ucan.js.map +1 -1
- package/dist/identity/webauthn.d.ts +6 -11
- package/dist/identity/webauthn.d.ts.map +1 -1
- package/dist/identity/webauthn.js +18 -30
- package/dist/identity/webauthn.js.map +1 -1
- package/dist/inbox/inbox.d.ts.map +1 -1
- package/dist/inbox/inbox.js +40 -30
- package/dist/inbox/inbox.js.map +1 -1
- package/dist/inbox/index.d.ts +2 -0
- package/dist/inbox/index.d.ts.map +1 -1
- package/dist/inbox/index.js +1 -0
- package/dist/inbox/index.js.map +1 -1
- package/dist/inbox/names.d.ts +54 -0
- package/dist/inbox/names.d.ts.map +1 -0
- package/dist/inbox/names.js +299 -0
- package/dist/inbox/names.js.map +1 -0
- package/dist/index.d.ts +3 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -12
- package/dist/index.js.map +1 -1
- package/dist/network/mesh.d.ts +7 -20
- package/dist/network/mesh.d.ts.map +1 -1
- package/dist/network/mesh.js +267 -245
- package/dist/network/mesh.js.map +1 -1
- package/dist/network/relay-link.d.ts +31 -0
- package/dist/network/relay-link.d.ts.map +1 -0
- package/dist/network/relay-link.js +62 -0
- package/dist/network/relay-link.js.map +1 -0
- package/dist/network/relay-minca.d.ts +12 -1
- package/dist/network/relay-minca.d.ts.map +1 -1
- package/dist/network/relay-minca.js +25 -55
- package/dist/network/relay-minca.js.map +1 -1
- package/dist/network/relay-nostr.d.ts +14 -3
- package/dist/network/relay-nostr.d.ts.map +1 -1
- package/dist/network/relay-nostr.js +34 -72
- package/dist/network/relay-nostr.js.map +1 -1
- package/dist/network/relay-socket.d.ts +1 -1
- package/dist/network/relay-socket.d.ts.map +1 -1
- package/dist/network/relay-socket.js +3 -1
- package/dist/network/relay-socket.js.map +1 -1
- package/dist/network/relays.d.ts +26 -17
- package/dist/network/relays.d.ts.map +1 -1
- package/dist/network/relays.js +21 -28
- package/dist/network/relays.js.map +1 -1
- package/dist/network/rendezvous.d.ts +1 -1
- package/dist/network/rendezvous.d.ts.map +1 -1
- package/dist/network/rendezvous.js +2 -2
- package/dist/network/rendezvous.js.map +1 -1
- package/dist/node/actions.d.ts.map +1 -1
- package/dist/node/actions.js +56 -39
- package/dist/node/actions.js.map +1 -1
- package/dist/node/api.d.ts +6 -0
- package/dist/node/api.d.ts.map +1 -1
- package/dist/node/api.js +6 -0
- package/dist/node/api.js.map +1 -1
- package/dist/node/carrier.d.ts +5 -0
- package/dist/node/carrier.d.ts.map +1 -1
- package/dist/node/carrier.js +94 -73
- package/dist/node/carrier.js.map +1 -1
- package/dist/node/copy.d.ts +8 -7
- package/dist/node/copy.d.ts.map +1 -1
- package/dist/node/copy.js +54 -56
- package/dist/node/copy.js.map +1 -1
- package/dist/node/host.d.ts +39 -65
- package/dist/node/host.d.ts.map +1 -1
- package/dist/node/host.js +362 -379
- package/dist/node/host.js.map +1 -1
- package/dist/node/index.d.ts +2 -2
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js +1 -1
- package/dist/node/index.js.map +1 -1
- package/dist/node/node-carriers.d.ts +35 -0
- package/dist/node/node-carriers.d.ts.map +1 -0
- package/dist/node/node-carriers.js +562 -0
- package/dist/node/node-carriers.js.map +1 -0
- package/dist/node/node-contacts.d.ts +11 -0
- package/dist/node/node-contacts.d.ts.map +1 -0
- package/dist/node/node-contacts.js +808 -0
- package/dist/node/node-contacts.js.map +1 -0
- package/dist/node/node-context.d.ts +76 -0
- package/dist/node/node-context.d.ts.map +1 -0
- package/dist/node/node-context.js +54 -0
- package/dist/node/node-context.js.map +1 -0
- package/dist/node/node-hosting.d.ts +20 -0
- package/dist/node/node-hosting.d.ts.map +1 -0
- package/dist/node/node-hosting.js +449 -0
- package/dist/node/node-hosting.js.map +1 -0
- package/dist/node/node-records.d.ts +18 -0
- package/dist/node/node-records.d.ts.map +1 -0
- package/dist/node/node-records.js +262 -0
- package/dist/node/node-records.js.map +1 -0
- package/dist/node/node.d.ts.map +1 -1
- package/dist/node/node.js +197 -1989
- package/dist/node/node.js.map +1 -1
- package/dist/node/remote.d.ts +5 -6
- package/dist/node/remote.d.ts.map +1 -1
- package/dist/node/remote.js +272 -260
- package/dist/node/remote.js.map +1 -1
- package/dist/node/space-catalog.d.ts +40 -0
- package/dist/node/space-catalog.d.ts.map +1 -0
- package/dist/node/space-catalog.js +158 -0
- package/dist/node/space-catalog.js.map +1 -0
- package/dist/node/space-checks.d.ts +25 -0
- package/dist/node/space-checks.d.ts.map +1 -0
- package/dist/node/space-checks.js +343 -0
- package/dist/node/space-checks.js.map +1 -0
- package/dist/node/space-history.d.ts +37 -0
- package/dist/node/space-history.d.ts.map +1 -0
- package/dist/node/space-history.js +350 -0
- package/dist/node/space-history.js.map +1 -0
- package/dist/node/space-holding.d.ts +49 -0
- package/dist/node/space-holding.d.ts.map +1 -0
- package/dist/node/space-holding.js +267 -0
- package/dist/node/space-holding.js.map +1 -0
- package/dist/node/space-index.d.ts +41 -0
- package/dist/node/space-index.d.ts.map +1 -0
- package/dist/node/space-index.js +217 -0
- package/dist/node/space-index.js.map +1 -0
- package/dist/node/space-keys.d.ts +34 -0
- package/dist/node/space-keys.d.ts.map +1 -0
- package/dist/node/space-keys.js +309 -0
- package/dist/node/space-keys.js.map +1 -0
- package/dist/node/space-lines.d.ts +33 -0
- package/dist/node/space-lines.d.ts.map +1 -0
- package/dist/node/space-lines.js +145 -0
- package/dist/node/space-lines.js.map +1 -0
- package/dist/node/space-membership.d.ts +69 -0
- package/dist/node/space-membership.d.ts.map +1 -0
- package/dist/node/space-membership.js +242 -0
- package/dist/node/space-membership.js.map +1 -0
- package/dist/node/space-mirrors.d.ts +43 -0
- package/dist/node/space-mirrors.d.ts.map +1 -0
- package/dist/node/space-mirrors.js +125 -0
- package/dist/node/space-mirrors.js.map +1 -0
- package/dist/node/space-peers.d.ts +104 -0
- package/dist/node/space-peers.d.ts.map +1 -0
- package/dist/node/space-peers.js +595 -0
- package/dist/node/space-peers.js.map +1 -0
- package/dist/node/space-profiles.d.ts +18 -0
- package/dist/node/space-profiles.d.ts.map +1 -0
- package/dist/node/space-profiles.js +105 -0
- package/dist/node/space-profiles.js.map +1 -0
- package/dist/node/space-rules.d.ts +29 -0
- package/dist/node/space-rules.d.ts.map +1 -0
- package/dist/node/space-rules.js +144 -0
- package/dist/node/space-rules.js.map +1 -0
- package/dist/node/space-runtime.d.ts +104 -143
- package/dist/node/space-runtime.d.ts.map +1 -1
- package/dist/node/space-runtime.js +293 -3954
- package/dist/node/space-runtime.js.map +1 -1
- package/dist/node/space-standing.d.ts +20 -0
- package/dist/node/space-standing.d.ts.map +1 -0
- package/dist/node/space-standing.js +317 -0
- package/dist/node/space-standing.js.map +1 -0
- package/dist/node/space-versions.d.ts +104 -0
- package/dist/node/space-versions.d.ts.map +1 -0
- package/dist/node/space-versions.js +153 -0
- package/dist/node/space-versions.js.map +1 -0
- package/dist/node/space-warrants.d.ts +25 -0
- package/dist/node/space-warrants.d.ts.map +1 -0
- package/dist/node/space-warrants.js +214 -0
- package/dist/node/space-warrants.js.map +1 -0
- package/dist/node/space-writing.d.ts +72 -0
- package/dist/node/space-writing.d.ts.map +1 -0
- package/dist/node/space-writing.js +440 -0
- package/dist/node/space-writing.js.map +1 -0
- package/dist/node/stores.d.ts +19 -50
- package/dist/node/stores.d.ts.map +1 -1
- package/dist/node/stores.js +14 -33
- package/dist/node/stores.js.map +1 -1
- package/dist/node/types.d.ts +225 -305
- package/dist/node/types.d.ts.map +1 -1
- package/dist/node/usage.d.ts +2 -24
- package/dist/node/usage.d.ts.map +1 -1
- package/dist/node/usage.js +118 -102
- package/dist/node/usage.js.map +1 -1
- package/dist/node/watch-notifications.d.ts.map +1 -1
- package/dist/node/watch-notifications.js +32 -29
- package/dist/node/watch-notifications.js.map +1 -1
- package/dist/node/worker.d.ts +5 -6
- package/dist/node/worker.d.ts.map +1 -1
- package/dist/node/worker.js +80 -72
- package/dist/node/worker.js.map +1 -1
- package/dist/node/writer-keys.d.ts +5 -6
- package/dist/node/writer-keys.d.ts.map +1 -1
- package/dist/node/writer-keys.js +66 -57
- package/dist/node/writer-keys.js.map +1 -1
- package/dist/node/writers.d.ts +12 -19
- package/dist/node/writers.d.ts.map +1 -1
- package/dist/node/writers.js +7 -15
- package/dist/node/writers.js.map +1 -1
- package/dist/privacy/direct.d.ts.map +1 -1
- package/dist/privacy/direct.js +31 -27
- package/dist/privacy/direct.js.map +1 -1
- package/dist/privacy/space-encryption.d.ts.map +1 -1
- package/dist/privacy/space-encryption.js +5 -9
- package/dist/privacy/space-encryption.js.map +1 -1
- package/dist/query/computed.d.ts.map +1 -1
- package/dist/query/computed.js +78 -77
- package/dist/query/computed.js.map +1 -1
- package/dist/query/engine.d.ts +3 -4
- package/dist/query/engine.d.ts.map +1 -1
- package/dist/query/engine.js +93 -86
- package/dist/query/engine.js.map +1 -1
- package/dist/query/filter.d.ts +8 -10
- package/dist/query/filter.d.ts.map +1 -1
- package/dist/query/filter.js +144 -161
- package/dist/query/filter.js.map +1 -1
- package/dist/records/cel-types.d.ts.map +1 -1
- package/dist/records/cel-types.js +13 -27
- package/dist/records/cel-types.js.map +1 -1
- package/dist/records/cel.d.ts.map +1 -1
- package/dist/records/cel.js +177 -242
- package/dist/records/cel.js.map +1 -1
- package/dist/records/rules.d.ts.map +1 -1
- package/dist/records/rules.js +46 -50
- package/dist/records/rules.js.map +1 -1
- package/dist/records/topics.d.ts.map +1 -1
- package/dist/records/topics.js +18 -22
- package/dist/records/topics.js.map +1 -1
- package/dist/schema/collection-def.d.ts.map +1 -1
- package/dist/schema/collection-def.js +16 -5
- package/dist/schema/collection-def.js.map +1 -1
- package/dist/schemas/automations.d.ts +16 -15
- package/dist/schemas/automations.d.ts.map +1 -1
- package/dist/schemas/automations.js +203 -165
- package/dist/schemas/automations.js.map +1 -1
- package/dist/schemas/blueprints.d.ts.map +1 -1
- package/dist/schemas/blueprints.js +14 -13
- package/dist/schemas/blueprints.js.map +1 -1
- package/dist/schemas/connectors.d.ts +12 -0
- package/dist/schemas/connectors.d.ts.map +1 -1
- package/dist/schemas/connectors.js +16 -11
- package/dist/schemas/connectors.js.map +1 -1
- package/dist/schemas/contacts.d.ts +57 -0
- package/dist/schemas/contacts.d.ts.map +1 -1
- package/dist/schemas/contacts.js +32 -0
- package/dist/schemas/contacts.js.map +1 -1
- package/dist/schemas/cron.d.ts.map +1 -1
- package/dist/schemas/cron.js +27 -28
- package/dist/schemas/cron.js.map +1 -1
- package/dist/schemas/defined.d.ts +6 -0
- package/dist/schemas/defined.d.ts.map +1 -0
- package/dist/schemas/defined.js +7 -0
- package/dist/schemas/defined.js.map +1 -0
- package/dist/schemas/fragments.d.ts +22 -2
- package/dist/schemas/fragments.d.ts.map +1 -1
- package/dist/schemas/fragments.js +20 -12
- package/dist/schemas/fragments.js.map +1 -1
- package/dist/schemas/guides.d.ts +3 -1
- package/dist/schemas/guides.d.ts.map +1 -1
- package/dist/schemas/guides.js +13 -12
- package/dist/schemas/guides.js.map +1 -1
- package/dist/schemas/index.d.ts +2 -2
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +18 -14
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/library/annotations.d.ts +30 -0
- package/dist/schemas/library/annotations.d.ts.map +1 -1
- package/dist/schemas/library/annotations.js +1 -0
- package/dist/schemas/library/annotations.js.map +1 -1
- package/dist/schemas/library/community.d.ts +28 -0
- package/dist/schemas/library/community.d.ts.map +1 -1
- package/dist/schemas/library/life.d.ts +62 -2
- package/dist/schemas/library/life.d.ts.map +1 -1
- package/dist/schemas/library/media.d.ts +36 -0
- package/dist/schemas/library/media.d.ts.map +1 -1
- package/dist/schemas/library/money.d.ts +74 -2
- package/dist/schemas/library/money.d.ts.map +1 -1
- package/dist/schemas/library/planning.d.ts +56 -0
- package/dist/schemas/library/planning.d.ts.map +1 -1
- package/dist/schemas/library/publishing.d.ts +80 -4
- package/dist/schemas/library/publishing.d.ts.map +1 -1
- package/dist/schemas/library/social.d.ts +44 -0
- package/dist/schemas/library/social.d.ts.map +1 -1
- package/dist/session/account-hint.d.ts.map +1 -1
- package/dist/session/account-hint.js +8 -5
- package/dist/session/account-hint.js.map +1 -1
- package/dist/session/auth.d.ts +36 -2
- package/dist/session/auth.d.ts.map +1 -1
- package/dist/session/auth.js +95 -2
- package/dist/session/auth.js.map +1 -1
- package/dist/session/connect.d.ts +1 -0
- package/dist/session/connect.d.ts.map +1 -1
- package/dist/session/connect.js +3 -1
- package/dist/session/connect.js.map +1 -1
- package/dist/session/credentials.d.ts +8 -26
- package/dist/session/credentials.d.ts.map +1 -1
- package/dist/session/credentials.js +14 -32
- package/dist/session/credentials.js.map +1 -1
- package/dist/session/index.d.ts +1 -0
- package/dist/session/index.d.ts.map +1 -1
- package/dist/session/index.js +1 -0
- package/dist/session/index.js.map +1 -1
- package/dist/session/pairing.d.ts.map +1 -1
- package/dist/session/pairing.js +92 -88
- package/dist/session/pairing.js.map +1 -1
- package/dist/session/password-strength.d.ts.map +1 -1
- package/dist/session/password-strength.js +37 -37
- package/dist/session/password-strength.js.map +1 -1
- package/dist/session/places.d.ts.map +1 -1
- package/dist/session/places.js +18 -13
- package/dist/session/places.js.map +1 -1
- package/dist/session/popup.d.ts +13 -0
- package/dist/session/popup.d.ts.map +1 -0
- package/dist/session/popup.js +23 -0
- package/dist/session/popup.js.map +1 -0
- package/dist/space/constitution.d.ts.map +1 -1
- package/dist/space/constitution.js +22 -29
- package/dist/space/constitution.js.map +1 -1
- package/dist/space/grants.d.ts.map +1 -1
- package/dist/space/grants.js +37 -39
- package/dist/space/grants.js.map +1 -1
- package/dist/space/invite-link.d.ts.map +1 -1
- package/dist/space/invite-link.js +33 -33
- package/dist/space/invite-link.js.map +1 -1
- package/dist/space/own-automations.d.ts +13 -24
- package/dist/space/own-automations.d.ts.map +1 -1
- package/dist/space/own-automations.js +47 -37
- package/dist/space/own-automations.js.map +1 -1
- package/dist/space/roles.d.ts +56 -80
- package/dist/space/roles.d.ts.map +1 -1
- package/dist/space/roles.js +448 -441
- package/dist/space/roles.js.map +1 -1
- package/dist/space/space-access.d.ts +3 -4
- package/dist/space/space-access.d.ts.map +1 -1
- package/dist/space/space-access.js +3 -8
- package/dist/space/space-access.js.map +1 -1
- package/dist/storage/blob/directory.d.ts.map +1 -1
- package/dist/storage/blob/directory.js +39 -32
- package/dist/storage/blob/directory.js.map +1 -1
- package/dist/storage/blob/s3.d.ts.map +1 -1
- package/dist/storage/blob/s3.js +21 -19
- package/dist/storage/blob/s3.js.map +1 -1
- package/dist/storage/blob-store.d.ts +0 -9
- package/dist/storage/blob-store.d.ts.map +1 -1
- package/dist/storage/directory-access.d.ts +8 -32
- package/dist/storage/directory-access.d.ts.map +1 -1
- package/dist/storage/directory-access.js +11 -36
- package/dist/storage/directory-access.js.map +1 -1
- package/dist/storage/encrypted-adapter.d.ts +12 -32
- package/dist/storage/encrypted-adapter.d.ts.map +1 -1
- package/dist/storage/encrypted-adapter.js +31 -54
- package/dist/storage/encrypted-adapter.js.map +1 -1
- package/dist/storage/folder-adapter.d.ts +12 -26
- package/dist/storage/folder-adapter.d.ts.map +1 -1
- package/dist/storage/folder-adapter.js +37 -54
- package/dist/storage/folder-adapter.js.map +1 -1
- package/dist/storage/folder-reconcile.d.ts +12 -26
- package/dist/storage/folder-reconcile.d.ts.map +1 -1
- package/dist/storage/folder-reconcile.js +39 -48
- package/dist/storage/folder-reconcile.js.map +1 -1
- package/dist/storage/indexeddb-adapter.d.ts +2 -6
- package/dist/storage/indexeddb-adapter.d.ts.map +1 -1
- package/dist/storage/indexeddb-adapter.js +60 -114
- package/dist/storage/indexeddb-adapter.js.map +1 -1
- package/dist/storage/mirror.d.ts +0 -29
- package/dist/storage/mirror.d.ts.map +1 -1
- package/dist/storage/mirror.js +153 -110
- package/dist/storage/mirror.js.map +1 -1
- package/dist/storage/segment.d.ts.map +1 -1
- package/dist/storage/segment.js +3 -7
- package/dist/storage/segment.js.map +1 -1
- package/dist/storage/storage-provider.d.ts +6 -11
- package/dist/storage/storage-provider.d.ts.map +1 -1
- package/dist/storage/storage-provider.js +112 -116
- package/dist/storage/storage-provider.js.map +1 -1
- package/dist/sync/sync-engine.d.ts +10 -44
- package/dist/sync/sync-engine.d.ts.map +1 -1
- package/dist/sync/sync-engine.js +245 -247
- package/dist/sync/sync-engine.js.map +1 -1
- package/dist/sync/sync-messages.d.ts +1 -1
- package/dist/sync/sync-messages.d.ts.map +1 -1
- package/dist/sync/sync-messages.js +1 -1
- package/dist/sync/sync-messages.js.map +1 -1
- package/dist/utils/guards.d.ts +1 -0
- package/dist/utils/guards.d.ts.map +1 -1
- package/dist/utils/guards.js +1 -0
- package/dist/utils/guards.js.map +1 -1
- package/dist/utils/hmac.d.ts +5 -0
- package/dist/utils/hmac.d.ts.map +1 -0
- package/dist/utils/hmac.js +20 -0
- package/dist/utils/hmac.js.map +1 -0
- package/dist/utils/map.d.ts +10 -0
- package/dist/utils/map.d.ts.map +1 -0
- package/dist/utils/map.js +30 -0
- package/dist/utils/map.js.map +1 -0
- package/dist/utils/serial.d.ts +2 -0
- package/dist/utils/serial.d.ts.map +1 -1
- package/dist/utils/serial.js +9 -0
- package/dist/utils/serial.js.map +1 -1
- package/dist/validation/capability-gate.d.ts +7 -15
- package/dist/validation/capability-gate.d.ts.map +1 -1
- package/dist/validation/capability-gate.js +32 -36
- package/dist/validation/capability-gate.js.map +1 -1
- package/dist/validation/crypto-gate.d.ts.map +1 -1
- package/dist/validation/crypto-gate.js +12 -21
- package/dist/validation/crypto-gate.js.map +1 -1
- package/docs/README.md +3 -2
- package/docs/actions.md +47 -20
- package/docs/automations.md +1 -1
- package/docs/blueprints-and-guides.md +57 -13
- package/docs/building-an-app.md +11 -8
- package/docs/collections.md +33 -5
- package/docs/contacts.md +34 -1
- package/docs/contracts.md +1 -1
- package/docs/direct-messages.md +1 -1
- package/docs/inbox.md +5 -11
- package/docs/node.md +36 -26
- package/docs/records-and-queries.md +1 -1
- package/docs/sign-in.md +54 -26
- package/docs/spaces.md +6 -6
- package/docs/standard-library.md +33 -31
- package/docs/storage.md +37 -15
- package/docs/usernames.md +161 -0
- package/docs/warrants.md +1 -1
- package/package.json +2 -21
- package/dist/calls/calls.d.ts +0 -140
- package/dist/calls/calls.d.ts.map +0 -1
- package/dist/calls/calls.js +0 -861
- package/dist/calls/calls.js.map +0 -1
- package/dist/calls/index.d.ts +0 -4
- package/dist/calls/index.d.ts.map +0 -1
- package/dist/calls/index.js +0 -3
- package/dist/calls/index.js.map +0 -1
- package/dist/react/context.d.ts +0 -81
- package/dist/react/context.d.ts.map +0 -1
- package/dist/react/context.js +0 -97
- package/dist/react/context.js.map +0 -1
- package/dist/react/follow.d.ts +0 -11
- package/dist/react/follow.d.ts.map +0 -1
- package/dist/react/follow.js +0 -7
- package/dist/react/follow.js.map +0 -1
- package/dist/react/index.d.ts +0 -44
- package/dist/react/index.d.ts.map +0 -1
- package/dist/react/index.js +0 -40
- package/dist/react/index.js.map +0 -1
- package/dist/react/minca-auth.d.ts +0 -19
- package/dist/react/minca-auth.d.ts.map +0 -1
- package/dist/react/minca-auth.js +0 -36
- package/dist/react/minca-auth.js.map +0 -1
- package/dist/react/use-calls.d.ts +0 -21
- package/dist/react/use-calls.d.ts.map +0 -1
- package/dist/react/use-calls.js +0 -39
- package/dist/react/use-calls.js.map +0 -1
- package/dist/react/use-invite-link.d.ts +0 -24
- package/dist/react/use-invite-link.d.ts.map +0 -1
- package/dist/react/use-invite-link.js +0 -62
- package/dist/react/use-invite-link.js.map +0 -1
- package/dist/react/use-live.d.ts +0 -16
- package/dist/react/use-live.d.ts.map +0 -1
- package/dist/react/use-live.js +0 -56
- package/dist/react/use-live.js.map +0 -1
- package/dist/react/use-my-name.d.ts +0 -12
- package/dist/react/use-my-name.d.ts.map +0 -1
- package/dist/react/use-my-name.js +0 -38
- package/dist/react/use-my-name.js.map +0 -1
- package/dist/react/use-names.d.ts +0 -7
- package/dist/react/use-names.d.ts.map +0 -1
- package/dist/react/use-names.js +0 -13
- package/dist/react/use-names.js.map +0 -1
- package/dist/react/use-network.d.ts +0 -9
- package/dist/react/use-network.d.ts.map +0 -1
- package/dist/react/use-network.js +0 -33
- package/dist/react/use-network.js.map +0 -1
- package/dist/react/use-query.d.ts +0 -14
- package/dist/react/use-query.d.ts.map +0 -1
- package/dist/react/use-query.js +0 -26
- package/dist/react/use-query.js.map +0 -1
- package/dist/react/use-space.d.ts +0 -29
- package/dist/react/use-space.d.ts.map +0 -1
- package/dist/react/use-space.js +0 -57
- package/dist/react/use-space.js.map +0 -1
- package/dist/react/use-spaces.d.ts +0 -29
- package/dist/react/use-spaces.d.ts.map +0 -1
- package/dist/react/use-spaces.js +0 -78
- package/dist/react/use-spaces.js.map +0 -1
- package/docs/calls.md +0 -189
package/docs/storage.md
CHANGED
|
@@ -38,7 +38,7 @@ records changed once per message taken in, not once per version.
|
|
|
38
38
|
|
|
39
39
|
_Source: `packages/core/src/sync/sync-engine.ts` (`MAX_WANTS_IN_FLIGHT`,
|
|
40
40
|
`MAX_ROUNDS`, `STALE_MS`, `MAX_WAITING`, `MAX_REFUSED`, `want`, `pump`,
|
|
41
|
-
`sweep`), `packages/core/src/node/space-
|
|
41
|
+
`sweep`), `packages/core/src/node/space-peers.ts` (heartbeat,
|
|
42
42
|
`announceSoon`). Tests: `packages/core/tests/reconcile.test.ts` ("a want whose
|
|
43
43
|
answer is lost is given up, and the peer is synced again"),
|
|
44
44
|
`packages/core/tests/sync.test.ts`._
|
|
@@ -172,8 +172,12 @@ change and on close.
|
|
|
172
172
|
directory store (`localPath` in `packages/cli/src/home.ts`). A command and
|
|
173
173
|
the daemon share it, and the daemon finds the command's writes as it finds
|
|
174
174
|
any directory store's (`reconcileFolder`). Writer keys are beside it in
|
|
175
|
-
`
|
|
176
|
-
|
|
175
|
+
`writer-keys/`; a slot left in the home from before is not read, nor
|
|
176
|
+
`writers/`, where a minca from before the numbered lock keeps its keys, so
|
|
177
|
+
the two never sign with one key. `minca agent`
|
|
178
|
+
and `minca mcp` keep each session's key and stores together in a slot of
|
|
179
|
+
`<home>/agent`, beside the data folder the sessions share
|
|
180
|
+
([actions](actions.md#the-agent-on-a-computer)).
|
|
177
181
|
- **Elsewhere** it must be given: `folderStores` refuses to start without
|
|
178
182
|
one, since a lasting key's places kept in memory would be handed out again
|
|
179
183
|
after a restart.
|
|
@@ -209,8 +213,7 @@ _Source: `packages/core/src/node/stores.ts` (`folderStores`),
|
|
|
209
213
|
`packages/core/src/storage/blob/directory.ts`,
|
|
210
214
|
`packages/core/src/storage/directory-access.ts`,
|
|
211
215
|
`packages/cli/src/fs-directory.ts`, `packages/cli/src/home.ts` (`unlock`),
|
|
212
|
-
`packages/core/src/node/space-
|
|
213
|
-
process"). Tests: `packages/core/tests/folder-adapter.test.ts`,
|
|
216
|
+
`packages/core/src/node/space-mirrors.ts` (`openMirrors`, `watch`). Tests: `packages/core/tests/folder-adapter.test.ts`,
|
|
214
217
|
`packages/cli/tests/path-safety.test.ts`._
|
|
215
218
|
|
|
216
219
|
## Blob stores
|
|
@@ -275,7 +278,7 @@ and twice as many as its last compaction left, it compacts them, keeping
|
|
|
275
278
|
only what its store holds.
|
|
276
279
|
|
|
277
280
|
_Source: `packages/core/src/storage/mirror.ts`,
|
|
278
|
-
`packages/core/src/node/space-
|
|
281
|
+
`packages/core/src/node/space-mirrors.ts` (`openMirrors`),
|
|
279
282
|
`packages/core/src/node/host.ts`. Tests: `packages/core/tests/mirror.test.ts`._
|
|
280
283
|
|
|
281
284
|
### Planned: mirrors in your own storage
|
|
@@ -326,16 +329,35 @@ How this library does the rest:
|
|
|
326
329
|
(`fileRefsIn`, at most 16), so the envelope and the body always agree.
|
|
327
330
|
- **Reading.** `records.readFile(space, ref)` gives the bytes: held here, or
|
|
328
331
|
fetched from connected peers, one after another, then from mirrors,
|
|
329
|
-
checking every chunk.
|
|
330
|
-
|
|
331
|
-
|
|
332
|
+
checking every chunk. When none has them it waits, asking everyone again
|
|
333
|
+
whenever records change or a peer connects, and every 15 s, and resolves
|
|
334
|
+
once one does. It rejects for a file no version this node keeps whole
|
|
335
|
+
names, one whose id is here whole yet won't open as named, and when the
|
|
336
|
+
space closes. For a picture, `URL.createObjectURL(new Blob([bytes], {
|
|
337
|
+
type: ref.mime }))` shows it.
|
|
332
338
|
- **Where chunks live.** Entries in the space's own store: `f/<id>/list`,
|
|
333
|
-
`f/<id>/<n>`,
|
|
334
|
-
|
|
339
|
+
`f/<id>/<n>`, `f/<id>/own` with the time a file was added here (0 once a
|
|
340
|
+
version names it), and `f/<id>/used` with when it was last fetched or
|
|
341
|
+
read. A data folder keeps these in this device's own stores, not the
|
|
335
342
|
folder.
|
|
336
|
-
- **What a node fetches.** A node
|
|
337
|
-
|
|
338
|
-
|
|
343
|
+
- **What a node fetches.** Files follow records. A node fetches every file
|
|
344
|
+
named by a version it keeps whole about 2 s after its records change,
|
|
345
|
+
while the writer is likely still connected. A file this sweep found
|
|
346
|
+
nobody had is not asked of everyone again for 10 minutes, but is asked at
|
|
347
|
+
once of each peer that connects meanwhile.
|
|
348
|
+
- **A device's limits.** A node limits the files it did not add, in every
|
|
349
|
+
space: it fetches unread only files of up to 5 MiB, so photos and
|
|
350
|
+
documents come ahead and video when played. Past 256 MiB of them in a
|
|
351
|
+
space, counting each at the size its list proves, or every chunk held of
|
|
352
|
+
one never whole, it drops those fetched or opened longest ago, down to
|
|
353
|
+
90%, at the start of each pass and as it fetches. One never whole goes
|
|
354
|
+
first. A file added here is never dropped, nor one being fetched or read;
|
|
355
|
+
one larger than the limit is dropped on the pass after it is read, and
|
|
356
|
+
fetched again at the next read. A dropped file that was whole keeps its
|
|
357
|
+
`used` entry, so it is not fetched unread again while a version names it;
|
|
358
|
+
reading it fetches it. The limit is per space, so a device in many spaces
|
|
359
|
+
holds more. A node with `fetchFiles: 'all'`, a carrier or host, fetches
|
|
360
|
+
and keeps every file.
|
|
339
361
|
- **Serving.** A `want-file` is answered with at most 4 chunks; the asker
|
|
340
362
|
asks again for the rest, so a large file never floods a connection.
|
|
341
363
|
- **Keeping.** About 2 s after records change, files no version kept whole
|
|
@@ -346,7 +368,7 @@ ref.mime }))` shows it.
|
|
|
346
368
|
writer's copies of files no longer named.
|
|
347
369
|
|
|
348
370
|
_Source: `packages/core/src/files/space-files.ts`, `packages/core/src/files/file-id.ts`,
|
|
349
|
-
`packages/core/src/files/seal.ts`, `packages/core/src/node/space-runtime.ts` (
|
|
371
|
+
`packages/core/src/files/seal.ts`, `packages/core/src/node/space-runtime.ts` (`filesChanged`).
|
|
350
372
|
Tests: `packages/core/tests/files.test.ts`._
|
|
351
373
|
|
|
352
374
|
### Planned: video and pictures
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# Usernames
|
|
2
|
+
|
|
3
|
+
A username, `leif@minca.social`, is a name at a domain that leads to an
|
|
4
|
+
inbox code, so someone can find you by a name they can say aloud. What a
|
|
5
|
+
username is, how it is looked up and what a reader checks are protocol
|
|
6
|
+
([spec 07 §9](https://github.com/leifriksheim/minca/blob/main/spec/07-inbox.md)):
|
|
7
|
+
every reader must agree on them.
|
|
8
|
+
|
|
9
|
+
How a name is claimed at a domain is not. A domain can answer from a file it
|
|
10
|
+
edits by hand, or from anything else. This page describes the **Minca name
|
|
11
|
+
service** (`packages/names`), which minca.social runs and anyone can run for a
|
|
12
|
+
domain of their own, and how the library claims a name on one.
|
|
13
|
+
|
|
14
|
+
## Looking a name up
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import { resolveUsername } from '@minca/core/inbox';
|
|
18
|
+
|
|
19
|
+
const { code, inbox } = await resolveUsername('leif@minca.social', provider);
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
It asks `https://minca.social/.well-known/minca.json?name=leif`, refuses a
|
|
23
|
+
redirect, and checks the code it gets as any other. The code then works
|
|
24
|
+
wherever one does: knock on it.
|
|
25
|
+
|
|
26
|
+
## On the node
|
|
27
|
+
|
|
28
|
+
`node.inbox.claim('leif@minca.social')` does all of the below for the
|
|
29
|
+
account's inbox, and keeps the name in `std.inbox` so every device knows it:
|
|
30
|
+
replacing the inbox, or changing its name or mailboxes, points the name at
|
|
31
|
+
the new code, and reading knocks renews it a month before its year is up.
|
|
32
|
+
`node.inbox.release()` gives it up. `node.inbox.knock('anna@minca.social')`
|
|
33
|
+
knocks by username, and the contact it becomes keeps the username
|
|
34
|
+
(`ContactView.username`). See [node.md](node.md#the-inbox).
|
|
35
|
+
|
|
36
|
+
**At sign-up.** `createMincaAuth({ usernames: 'minca.social' })` makes the
|
|
37
|
+
create screen of `<minca-auth>` one field: the username, with a tick once the
|
|
38
|
+
service says it is free and a cross once it is taken. A bare name is at that
|
|
39
|
+
domain, and is how it is shown and handed out (`leif`); a whole username,
|
|
40
|
+
`leif@example.org`, is checked and claimed at its own domain, and one that
|
|
41
|
+
gives out no Minca usernames says so, with a link to running a service. The account's name
|
|
42
|
+
starts as the username's (`nameFromUsername`: `leif.r` is Leif R) and is
|
|
43
|
+
changed on the account page. "Continue without a username" makes the account with none, so nobody
|
|
44
|
+
finds it by one, and a made-up name to show until it is given one
|
|
45
|
+
(`adHocName`: Swift Otter). `createAccount(name,
|
|
46
|
+
{ username })` claims it in the background while the recovery code and
|
|
47
|
+
password screens are up, and those screens say how it went: `state.username`
|
|
48
|
+
is `claiming`, `claimed`, or `failed` with an `error`, when it was taken
|
|
49
|
+
meanwhile or the service was down. The account is made either way.
|
|
50
|
+
|
|
51
|
+
The claim is made on the home's node, which may be the only one holding the
|
|
52
|
+
inbox: a connect page that closes once it answers keeps the window open
|
|
53
|
+
until the app's node holds the contacts space too (`spaces.reached`, keyed
|
|
54
|
+
by the app's key from its request), or else the app would read no knocks
|
|
55
|
+
until the two next met. The account home waits for what setup began in
|
|
56
|
+
the background (`auth.settled()`: the claim, and the host's handover) to
|
|
57
|
+
finish, however long, so neither is cut off halfway; then up to 30 s for the app,
|
|
58
|
+
and only for an account that claimed a name there. If the claim failed, the
|
|
59
|
+
app's contacts screen asks for a name again.
|
|
60
|
+
|
|
61
|
+
_Source: `packages/core/src/session/auth.ts` (`createAccount`, `claimInBackground`), `packages/core/src/elements/minca-auth.ts` (`#create`), `packages/core/src/inbox/names.ts` (`adHocName`, `nameFromUsername`, `usernameFree`), `apps/home/src/components/ConnectPage.tsx` (`handOver`). Tests: `packages/core/tests/usernames.test.ts` ("a username at sign-up")._
|
|
62
|
+
|
|
63
|
+
Renewing claims the code of the inbox this device knows. A device that
|
|
64
|
+
hasn't yet synced a replacement made on another one points the name back at
|
|
65
|
+
the old inbox until the inbox next changes; renewal starts only within a
|
|
66
|
+
month of the name lapsing, so this is rare.
|
|
67
|
+
|
|
68
|
+
## Claiming a name
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
import { claimUsername } from '@minca/core/inbox';
|
|
72
|
+
|
|
73
|
+
const until = await claimUsername('leif@minca.social', contactKey, inboxCode);
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
`claimUsername` looks the name up first. A Minca name service says, in every
|
|
77
|
+
answer, where claims go and how much work one needs:
|
|
78
|
+
|
|
79
|
+
```json
|
|
80
|
+
{ "names": {}, "claim": "https://usernames.minca.social/.well-known/minca.json", "work": 20 }
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Then it posts the claim there:
|
|
84
|
+
|
|
85
|
+
```json
|
|
86
|
+
{
|
|
87
|
+
"name": "leif",
|
|
88
|
+
"key": "<name key public half>",
|
|
89
|
+
"at": 1790000000000,
|
|
90
|
+
"work": 731042,
|
|
91
|
+
"code": "<inbox code>",
|
|
92
|
+
"bind": "<base64url>",
|
|
93
|
+
"sig": "<base64url>"
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
| Field | |
|
|
98
|
+
| ------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
99
|
+
| `key` | The **name key**'s public half, compressed P-256, base64url |
|
|
100
|
+
| `at` | When the claim was made, ms. It must be within 10 minutes of the service's clock, and later than the claim it follows |
|
|
101
|
+
| `work` | A counter: SHA-256 of `minca/name-work/v1\|<name>@<domain>\|<key>\|<at>\|<work>` starts with `work` zero bits |
|
|
102
|
+
| `code` | The inbox code, at most 4,096 characters. None gives the name up |
|
|
103
|
+
| `bind` | With a code: the inbox signing key's signature over `minca/name-bind/v1\|<name>@<domain>`, so a name leads only to an inbox whose owner chose it |
|
|
104
|
+
| `sig` | The name key's ECDSA P-256 signature over `minca/name-claim/v1\|<name>@<domain>\|<at>\|<code, or empty>` |
|
|
105
|
+
|
|
106
|
+
The answer is `{ "until": <ms> }`, when the name lapses, or
|
|
107
|
+
`{ "error": "…" }` with a 4xx status.
|
|
108
|
+
|
|
109
|
+
**The name key** is derived from the contact key, one per username:
|
|
110
|
+
`HKDF-SHA-256(contact key, info = "minca/p256-name-key/v1|" + name@domain)`,
|
|
111
|
+
with the username as `formatUsername` writes it, so every spelling a reader takes gives one key. `claimUsername` derives it itself. Every device that holds the contact key
|
|
112
|
+
derives the same one; it is not an inbox key, so replacing the inbox keeps
|
|
113
|
+
the name, and nothing ties it to the account. Only the key that holds a name
|
|
114
|
+
can point it elsewhere, renew it or give it up.
|
|
115
|
+
|
|
116
|
+
**Who may.** A name leads to the account's inbox, so only what may run the
|
|
117
|
+
inbox may claim one: a node whose note grants `/account/write` for the whole
|
|
118
|
+
account, holding the contact key. An app given the contact key could claim
|
|
119
|
+
the account's names too, and its hold outlasts revoking it, since a name key
|
|
120
|
+
has no generation to move on to
|
|
121
|
+
([#313](https://github.com/leifriksheim/minca/issues/313)).
|
|
122
|
+
|
|
123
|
+
## What the service keeps to
|
|
124
|
+
|
|
125
|
+
| Rule | On minca.social |
|
|
126
|
+
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
127
|
+
| How long a claim holds | A year. Claiming again, with the same code or a new one, renews it |
|
|
128
|
+
| New names from one address | 3 a day (an IPv4 address, or an IPv6 /48). Changing or renewing a name is free |
|
|
129
|
+
| Work | 18 bits: a fraction of a second on a laptop, about a second on a phone |
|
|
130
|
+
| Names held | 50,000: each is a file of up to 8 KB, so a 1 GB volume holds them, inodes included |
|
|
131
|
+
| Reserved | `admin`, `support`, `security`, `minca` and a few more that pass for the service. A lookup of one answers `"reserved": true`, so `usernameFree` says it isn't |
|
|
132
|
+
| Given up | Free again after 10 minutes, so no earlier claim can be replayed to take it back |
|
|
133
|
+
|
|
134
|
+
The work is a speed bump for bots, not a gate: a server does it ten times
|
|
135
|
+
faster than a phone. The address budget and the year are what keep squatting
|
|
136
|
+
in check; a name nobody renews comes back. The budget is kept in memory, so a
|
|
137
|
+
restart forgets it; nothing a client sends can make the service stop, since
|
|
138
|
+
whatever goes wrong with one request answers that request.
|
|
139
|
+
|
|
140
|
+
Each name is a file of its own on the service's disk, so nothing grows in
|
|
141
|
+
memory and no large file is rewritten. Lookups are open to any page
|
|
142
|
+
(`Access-Control-Allow-Origin: *`).
|
|
143
|
+
|
|
144
|
+
## Running one for your domain
|
|
145
|
+
|
|
146
|
+
The service is `packages/names/server.mjs`, with no dependencies:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
NAMES_DOMAIN=example.org \
|
|
150
|
+
NAMES_CLAIM_URL=https://names.example.org/.well-known/minca.json \
|
|
151
|
+
NAMES_DIR=/data/names \
|
|
152
|
+
node packages/names/server.mjs 8080
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Then answer `https://example.org/.well-known/minca.json` from it, by serving
|
|
156
|
+
the domain from it or proxying that one path (minca.social's site does this,
|
|
157
|
+
in `apps/site/public/_redirects`). Claims go to `NAMES_CLAIM_URL` directly, so
|
|
158
|
+
the service sees each client's address. `packages/names/fly.toml` deploys it
|
|
159
|
+
on Fly.
|
|
160
|
+
|
|
161
|
+
_Source: `packages/core/src/inbox/names.ts` (`claimUsername`, `claimMessage`), `packages/core/src/identity/contact-key.ts` (`deriveNameKeyBytes`), `packages/names/names.mjs` (`createNames`, `NAMES_LIMITS`), `packages/names/server.mjs`, `apps/site/public/_redirects`. Tests: `packages/names/tests/names.test.ts`._
|
package/docs/warrants.md
CHANGED
|
@@ -76,4 +76,4 @@ Like any record, a warrant is withdrawn when its writer is removed by a
|
|
|
76
76
|
change whose cutoff doesn't cover it, or revokes the key that signed it ([#166](https://github.com/leifriksheim/minca/issues/166)). More kinds are planned after v1, in
|
|
77
77
|
[#148](https://github.com/leifriksheim/minca/issues/148).
|
|
78
78
|
|
|
79
|
-
_Source: `packages/core/src/records/warrant.ts` (`readWarrant`, `knownKind`), `packages/core/src/node/space-
|
|
79
|
+
_Source: `packages/core/src/records/warrant.ts` (`readWarrant`, `knownKind`), `packages/core/src/node/space-history.ts` (`ownView`), `packages/core/src/node/space-warrants.ts` (`warrantShape`, `warrantVerdict`, `evidenceHolds`, `violationIn`, `warrantIfDue`, `flagged`), `packages/core/src/space/space-access.ts` (`WARRANT_COLLECTION`). Tests: `packages/core/tests/warrants.test.ts`._
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@minca/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.16",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Self-sovereign P2P protocol for the browser — identity, schemas, storage, networking, and gossip sync",
|
|
6
6
|
"repository": {
|
|
@@ -51,16 +51,6 @@
|
|
|
51
51
|
"types": "./dist/elements/index.d.ts",
|
|
52
52
|
"import": "./dist/elements/index.js"
|
|
53
53
|
},
|
|
54
|
-
"./react": {
|
|
55
|
-
"@minca/source": "./src/react/index.ts",
|
|
56
|
-
"types": "./dist/react/index.d.ts",
|
|
57
|
-
"import": "./dist/react/index.js"
|
|
58
|
-
},
|
|
59
|
-
"./calls": {
|
|
60
|
-
"@minca/source": "./src/calls/index.ts",
|
|
61
|
-
"types": "./dist/calls/index.d.ts",
|
|
62
|
-
"import": "./dist/calls/index.js"
|
|
63
|
-
},
|
|
64
54
|
"./inbox": {
|
|
65
55
|
"@minca/source": "./src/inbox/index.ts",
|
|
66
56
|
"types": "./dist/inbox/index.d.ts",
|
|
@@ -70,13 +60,12 @@
|
|
|
70
60
|
"scripts": {
|
|
71
61
|
"build": "rm -rf dist && tsc",
|
|
72
62
|
"typecheck": "tsc --noEmit && tsc -p tests",
|
|
73
|
-
"test": "node --experimental-vm-modules --import tsx --test --test-concurrency=
|
|
63
|
+
"test": "node --experimental-vm-modules --import tsx --test --test-concurrency=8 --test-timeout=60000 --test-force-exit tests/*.test.ts",
|
|
74
64
|
"prepack": "node ../../scripts/npm-readme.mjs",
|
|
75
65
|
"postpack": "rm -f README.md",
|
|
76
66
|
"prepublishOnly": "npm run build"
|
|
77
67
|
},
|
|
78
68
|
"devDependencies": {
|
|
79
|
-
"@types/react": "^19.3.0",
|
|
80
69
|
"@types/ws": "^8.18.2",
|
|
81
70
|
"esbuild": "^0.28.2",
|
|
82
71
|
"tsx": "^4.19.0",
|
|
@@ -95,14 +84,6 @@
|
|
|
95
84
|
"@scure/base": "^2.4.0",
|
|
96
85
|
"aws4fetch": "^1.0.20"
|
|
97
86
|
},
|
|
98
|
-
"peerDependencies": {
|
|
99
|
-
"react": "^19.3.1"
|
|
100
|
-
},
|
|
101
|
-
"peerDependenciesMeta": {
|
|
102
|
-
"react": {
|
|
103
|
-
"optional": true
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
87
|
"publishConfig": {
|
|
107
88
|
"access": "public"
|
|
108
89
|
}
|
package/dist/calls/calls.d.ts
DELETED
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Voice and video calls between the people in a space.
|
|
3
|
-
*
|
|
4
|
-
* Nothing here is new to the protocol. A call is live messages
|
|
5
|
-
* (`node.spaces.send`) in the space it belongs to, and a WebRTC connection of
|
|
6
|
-
* its own between each pair of people in it — the shape Matrix gives group
|
|
7
|
-
* calls (MSC3401, Element Call's full mesh):
|
|
8
|
-
*
|
|
9
|
-
* ```
|
|
10
|
-
* call.here { call, since, camera, muted } to the space, every few seconds while in it
|
|
11
|
-
* call.ring { call } to one account: ring its devices
|
|
12
|
-
* call.answered { call } / call.declined to the caller, and to your own other devices
|
|
13
|
-
* call.cancel { call } the caller gave up ringing
|
|
14
|
-
* call.signal { call, description | candidate } to one device: setting up the connection
|
|
15
|
-
* call.leave { call } to the space: gone now, not in 15 seconds
|
|
16
|
-
* ```
|
|
17
|
-
*
|
|
18
|
-
* The setup travels over the space's own peer connection, whose handshake
|
|
19
|
-
* proved who is at the other end — so the offer, and the fingerprint of the
|
|
20
|
-
* key the browser will insist on, really come from that person. A relay only
|
|
21
|
-
* ever introduced the two devices; it never sees a call.
|
|
22
|
-
*
|
|
23
|
-
* Only members of the space (anyone holding a role) are rung by, heard in or
|
|
24
|
-
* connected to a call; a view-only reader of a public space is not.
|
|
25
|
-
*
|
|
26
|
-
* A call belongs to the space, not to a screen: it keeps the space open
|
|
27
|
-
* (`spaces.hold`) for as long as it runs, so moving between spaces
|
|
28
|
-
* never interrupts it. One call at a time.
|
|
29
|
-
*
|
|
30
|
-
* Each connection is made with an audio and a video transceiver from the
|
|
31
|
-
* start. Turning the camera on or off, or sharing the screen, swaps the track
|
|
32
|
-
* a sender carries and never renegotiates — so neither side can offer at the
|
|
33
|
-
* same moment as the other, and the side with the lower session DID always
|
|
34
|
-
* makes the offer.
|
|
35
|
-
*/
|
|
36
|
-
import type { P2PNode } from '../node/types.js';
|
|
37
|
-
export interface CallsOptions {
|
|
38
|
-
/** How a WebRTC connection is made. `new RTCPeerConnection` by default. */
|
|
39
|
-
readonly createConnection?: (config: RTCConfiguration) => RTCPeerConnection;
|
|
40
|
-
/** Camera and microphone. `navigator.mediaDevices.getUserMedia` by default. */
|
|
41
|
-
readonly getUserMedia?: (constraints: MediaStreamConstraints) => Promise<MediaStream>;
|
|
42
|
-
/** The screen, for sharing it. `navigator.mediaDevices.getDisplayMedia` by default. */
|
|
43
|
-
readonly getDisplayMedia?: (constraints: DisplayMediaStreamOptions) => Promise<MediaStream>;
|
|
44
|
-
/** How a set of tracks becomes something a `<video>` can show. `new MediaStream` by default. */
|
|
45
|
-
readonly createStream?: (tracks: ReadonlyArray<MediaStreamTrack>) => MediaStream | null;
|
|
46
|
-
/** Where the call you're in is remembered, to offer rejoining after a reload. `sessionStorage` by default; null for nowhere. */
|
|
47
|
-
readonly storage?: Pick<Storage, 'getItem' | 'setItem' | 'removeItem'> | null;
|
|
48
|
-
/** How often you say you're in a call. Default 5 s. */
|
|
49
|
-
readonly heartbeatMs?: number;
|
|
50
|
-
/** How long without hearing that someone is gone. Default 15 s. */
|
|
51
|
-
readonly goneMs?: number;
|
|
52
|
-
/** How long a ring rings before it's a missed call. Default 45 s. */
|
|
53
|
-
readonly ringMs?: number;
|
|
54
|
-
}
|
|
55
|
-
/** Someone else in the call you're in: one device of theirs */
|
|
56
|
-
export interface CallPeer {
|
|
57
|
-
/** Their device's session DID */
|
|
58
|
-
readonly peer: string;
|
|
59
|
-
/** Their account */
|
|
60
|
-
readonly account: string;
|
|
61
|
-
/** What they send: sound, and video when their camera is on. Null until it arrives. */
|
|
62
|
-
readonly stream: MediaStream | null;
|
|
63
|
-
readonly muted: boolean;
|
|
64
|
-
readonly camera: boolean;
|
|
65
|
-
readonly connection: 'connecting' | 'connected' | 'failed';
|
|
66
|
-
}
|
|
67
|
-
/** The call you're in */
|
|
68
|
-
export interface CurrentCall {
|
|
69
|
-
readonly id: string;
|
|
70
|
-
readonly space: string;
|
|
71
|
-
/** When you joined it, ms */
|
|
72
|
-
readonly joinedAt: number;
|
|
73
|
-
/** Your own camera and microphone, for showing yourself */
|
|
74
|
-
readonly local: MediaStream | null;
|
|
75
|
-
readonly muted: boolean;
|
|
76
|
-
readonly camera: boolean;
|
|
77
|
-
readonly sharing: boolean;
|
|
78
|
-
readonly people: ReadonlyArray<CallPeer>;
|
|
79
|
-
/** Who you're ringing, while it rings — and what came of it, for a moment after */
|
|
80
|
-
readonly outgoing: {
|
|
81
|
-
readonly to: string;
|
|
82
|
-
readonly since: number;
|
|
83
|
-
readonly state: 'ringing' | 'declined' | 'missed';
|
|
84
|
-
} | null;
|
|
85
|
-
/** Something went wrong that you should hear about: no microphone, say */
|
|
86
|
-
readonly problem: string | null;
|
|
87
|
-
}
|
|
88
|
-
/** Someone ringing you */
|
|
89
|
-
export interface IncomingCall {
|
|
90
|
-
readonly id: string;
|
|
91
|
-
readonly space: string;
|
|
92
|
-
/** The caller's account */
|
|
93
|
-
readonly from: string;
|
|
94
|
-
readonly since: number;
|
|
95
|
-
}
|
|
96
|
-
/** A call going on in a space you have open, that you're not in */
|
|
97
|
-
export interface CallAround {
|
|
98
|
-
readonly id: string;
|
|
99
|
-
readonly space: string;
|
|
100
|
-
/** Accounts in it, each once */
|
|
101
|
-
readonly people: ReadonlyArray<string>;
|
|
102
|
-
/** When the first of them joined, ms */
|
|
103
|
-
readonly since: number;
|
|
104
|
-
}
|
|
105
|
-
export interface CallsState {
|
|
106
|
-
readonly current: CurrentCall | null;
|
|
107
|
-
readonly ringing: ReadonlyArray<IncomingCall>;
|
|
108
|
-
readonly around: ReadonlyArray<CallAround>;
|
|
109
|
-
/** The call you were in before this page loaded, while it's still going on */
|
|
110
|
-
readonly rejoin: CallAround | null;
|
|
111
|
-
}
|
|
112
|
-
export interface CallOptions {
|
|
113
|
-
/** Start with the camera on. Default false: sound only. */
|
|
114
|
-
readonly video?: boolean;
|
|
115
|
-
}
|
|
116
|
-
export interface Calls {
|
|
117
|
-
/** What's going on now. The same object until something changes. */
|
|
118
|
-
getState(): CallsState;
|
|
119
|
-
subscribe(listener: () => void): () => void;
|
|
120
|
-
/** Joins the call going on in a space, or starts one. Leaves any other call first. */
|
|
121
|
-
start(space: string, options?: CallOptions & {
|
|
122
|
-
readonly call?: string;
|
|
123
|
-
}): Promise<void>;
|
|
124
|
-
/** Starts a call in a space, and rings one person there — all their devices, until one answers */
|
|
125
|
-
ring(space: string, account: string, options?: CallOptions): Promise<void>;
|
|
126
|
-
answer(id: string, options?: CallOptions): Promise<void>;
|
|
127
|
-
decline(id: string): Promise<void>;
|
|
128
|
-
leave(): Promise<void>;
|
|
129
|
-
setMuted(muted: boolean): void;
|
|
130
|
-
setCamera(on: boolean): Promise<void>;
|
|
131
|
-
/** Shows your screen in place of your camera, until you stop it (or the browser does) */
|
|
132
|
-
shareScreen(): Promise<void>;
|
|
133
|
-
stopSharing(): Promise<void>;
|
|
134
|
-
/** Stops offering `rejoin` */
|
|
135
|
-
forgetRejoin(): void;
|
|
136
|
-
/** Leaves any call and stops listening */
|
|
137
|
-
close(): Promise<void>;
|
|
138
|
-
}
|
|
139
|
-
export declare function createCalls(node: P2PNode, options?: CallsOptions): Calls;
|
|
140
|
-
//# sourceMappingURL=calls.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"calls.d.ts","sourceRoot":"","sources":["../../src/calls/calls.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,KAAK,EAAE,OAAO,EAAa,MAAM,kBAAkB,CAAC;AAK3D,MAAM,WAAW,YAAY;IAC3B,2EAA2E;IAC3E,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,iBAAiB,CAAC;IAC5E,+EAA+E;IAC/E,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,WAAW,EAAE,sBAAsB,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;IACtF,uFAAuF;IACvF,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,WAAW,EAAE,yBAAyB,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;IAC5F,gGAAgG;IAChG,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,MAAM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