@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/actions.md
CHANGED
|
@@ -103,26 +103,53 @@ _Source: `packages/core/src/node/actions.ts` (`callAction`, `offeredActions`), `
|
|
|
103
103
|
|
|
104
104
|
## The agent on a computer
|
|
105
105
|
|
|
106
|
-
_Implementation detail of the CLI._
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
106
|
+
_Implementation detail of the CLI._ A key signs in one process at a time,
|
|
107
|
+
or its log forks (spec 02 §4.10). So each session running the agent at once,
|
|
108
|
+
a `minca mcp` per Claude window or a `minca agent`, has a key of its own, in a
|
|
109
|
+
numbered slot: `<home>/agent/<n>/` (1 to 16) holds `key.json`, the P-256 key
|
|
110
|
+
as JWK (mode 0600), the grant made out to it in `grant.json`, each written
|
|
111
|
+
whole, its lock, and `stores/`, what only that session keeps (its key's
|
|
112
|
+
places in its logs among them). The spaces are in one folder,
|
|
113
|
+
`<home>/agent/spaces/`, under a path per account, that every session reads
|
|
114
|
+
and writes at once the way clients share a data folder (spec 05 §14.5,
|
|
115
|
+
`folderStores`): what one session synced, the next starts from. It is a cache
|
|
116
|
+
of this CLI's, not a data folder another program opens.
|
|
117
|
+
|
|
118
|
+
Each session is a connection of its own at the account home, named "Agent on
|
|
119
|
+
<host>, session <n>", and is disconnected there on its own. A session whose
|
|
120
|
+
key is revoked forgets its slot's grant, so the next session there asks to be
|
|
121
|
+
allowed again, with a new key.
|
|
122
|
+
|
|
123
|
+
A session claims the first connected slot no other process holds, else the
|
|
124
|
+
first not connected yet. In that one, `minca mcp` offers only `agent_connect`:
|
|
125
|
+
the person allows this session at their account home and gives the model the
|
|
126
|
+
code it shows, once; the slot keeps its key and grant for later sessions.
|
|
127
|
+
`minca connect` at a terminal connects slot 1 and forgets the other slots'
|
|
128
|
+
grants, so each session after asks for its own again rather than run on a
|
|
129
|
+
note the person may have revoked; a session connected to another account
|
|
130
|
+
has every slot connected to the first forget its grant, so no later session
|
|
131
|
+
is handed one and writes as that account. Each connection is named for its
|
|
132
|
+
slot: "Agent on <host>", then ", session <n>" from slot 2. A slot's lock is
|
|
133
|
+
numbered files, `lock.<n>`, each linked into place whole: the highest is the
|
|
134
|
+
lock, taken over once its process is gone by linking the next number, and
|
|
135
|
+
let go of by writing `released` into it, so no number is used twice. Only one
|
|
136
|
+
session of an account runs its automations, under
|
|
137
|
+
`<home>/agent/automations-<account key>.lock`. A new key each time, since a key the
|
|
138
|
+
account home revoked stays revoked in every space, so a new note made out to
|
|
139
|
+
it would write nothing.
|
|
140
|
+
|
|
141
|
+
A session's node: signer `grantSigner(grant)`, session key = the slot's key,
|
|
142
|
+
the grant's keys when present and relays = the grant's ∪ `$MINCA_RELAYS`
|
|
143
|
+
(default `wss://relay.minca.social`) (`nodeOptionsFromGrant`), WebRTC via
|
|
144
|
+
`node-datachannel`; it joins any granted spaces it lacks (`joinGranted`);
|
|
145
|
+
wraps the node with `asAgent`; holds every space; and serves MCP over stdio:
|
|
146
|
+
`offeredActions({ agent: true })`, without the `PERSON_ONLY` actions or
|
|
147
|
+
direct messages ([actions](#actions)).
|
|
148
|
+
|
|
149
|
+
A running session watches its slot's `grant.json`, and looks every 30 s as
|
|
150
|
+
well. When `minca connect` writes a new key and grant there that check out, it
|
|
151
|
+
closes its node and starts one under them, keeping the slot, so the session
|
|
125
152
|
needs no restart. When the node hears that its key was revoked in a space, a
|
|
126
153
|
tool that fails says so, and that connecting again fixes it.
|
|
127
154
|
|
|
128
|
-
_Source: `packages/cli/src/agent.ts` (`connectAgent`, `startAgentNode`, `reloadOnConnect`), `packages/cli/src/writer-keys.ts` (`holdLock`), `packages/cli/src/mcp.ts`, `packages/cli/src/main.ts` (`minca mcp`). Tests: `packages/core/tests/records-only.test.ts` ("an agent running a node of its own"), `packages/cli/tests/cli.test.ts` ("MCP"), `packages/cli/tests/agent-reconnect.test.ts` (all)._
|
|
155
|
+
_Source: `packages/cli/src/agent.ts` (`claimSlot`, `connectAgent`, `reconnectAgent`, `startAgentNode`, `reloadOnConnect`), `packages/cli/src/writer-keys.ts` (`holdLock`), `packages/cli/src/mcp.ts`, `packages/cli/src/main.ts` (`minca mcp`). Tests: `packages/core/tests/records-only.test.ts` ("an agent running a node of its own"), `packages/cli/tests/cli.test.ts` ("MCP"), `packages/cli/tests/agent-reconnect.test.ts` (all), `packages/cli/tests/agent-slot-lock.test.ts` (all), `packages/cli/tests/writer-keys.test.ts` ("a lock number is never used twice, so one taker that stalled can’t hold it beside another")._
|
package/docs/automations.md
CHANGED
|
@@ -280,4 +280,4 @@ exception: `$contains` on a text field matches part of it, and a tag only a
|
|
|
280
280
|
whole value. Mark as topics only fields that hold whole values: people,
|
|
281
281
|
links, cells.
|
|
282
282
|
|
|
283
|
-
_Source: `packages/core/src/space/own-automations.ts` (`checkOwnAutomation`, `notifyOn`, `checkProposal`, `fromProposal`, `wakeFor`, `linkedWakes`, `holdsFor`, `setsOff`), `packages/core/src/query/computed.ts` (`linkedReads`, `lastRead`), `packages/core/src/node/node.ts` (`automations`, `syncPasses`), `packages/core/src/node/watch-notifications.ts`, `packages/core/src/schemas/automations.ts` (`matching`). Tests: `packages/core/tests/topics.test.ts` ("an automation of the account’s own: its where"), `packages/core/tests/carrier.test.ts` ("notifications through a carrier"), `packages/core/tests/connect.test.ts` ("an app proposing automations", "an app showing its own notifications"), `packages/core/tests/watch-notifications.test.ts`, `packages/core/tests/computed.test.ts` ("computed: what watches a filter on them"), `packages/core/tests/geo.test.ts`._
|
|
283
|
+
_Source: `packages/core/src/space/own-automations.ts` (`checkOwnAutomation`, `notifyOn`, `checkProposal`, `fromProposal`, `wakeFor`, `linkedWakes`, `holdsFor`, `setsOff`), `packages/core/src/query/computed.ts` (`linkedReads`, `lastRead`), `packages/core/src/node/node-carriers.ts` (`automations`, `syncPasses`), `packages/core/src/node/watch-notifications.ts`, `packages/core/src/schemas/automations.ts` (`matching`). Tests: `packages/core/tests/topics.test.ts` ("an automation of the account’s own: its where"), `packages/core/tests/carrier.test.ts` ("notifications through a carrier"), `packages/core/tests/connect.test.ts` ("an app proposing automations", "an app showing its own notifications"), `packages/core/tests/watch-notifications.test.ts`, `packages/core/tests/computed.test.ts` ("computed: what watches a filter on them"), `packages/core/tests/geo.test.ts`._
|
|
@@ -163,12 +163,18 @@ define collections wrote it under a note that isn't records-only
|
|
|
163
163
|
(`NodeRecord.recordsOnly`). It writes a guide on `launcher.app` saying how to
|
|
164
164
|
propose one.
|
|
165
165
|
|
|
166
|
+
**Where a space opens.** The launcher is in one order for everyone in the
|
|
167
|
+
space (each record's `position`). The example app opens a space into the
|
|
168
|
+
first app on it, so a group chooses where it opens by moving an app to the
|
|
169
|
+
top. A new group starts with Chat, and so does a new space for two, which
|
|
170
|
+
the one asking makes, so both people open it into a conversation.
|
|
171
|
+
|
|
166
172
|
A screen reaches the page around it only through `window.minca`, and only for
|
|
167
173
|
its app's collections and the people in its space: it lists and writes
|
|
168
174
|
records as the person looking, asks what they may do (`can`), gets someone's
|
|
169
175
|
picture (`picture`), and asks the page to show a record or a person
|
|
170
176
|
(`open`), or the record one of its own links to (`open` with `link`: the
|
|
171
|
-
message a file was shared on)
|
|
177
|
+
message a file was shared on), which shows it to the person and tells the screen nothing. The bridge never follows one to the space's own records (`sys.*`, `launcher.app`), and opening one answers the same whether or not the record is there; but the page visibly opens a record that is there, for the person, who can see it anyway. What a sealed frame can't do, the page does for it when it asks,
|
|
172
178
|
after checking the request: it searches for places and asks where the person
|
|
173
179
|
is (`places`), opens http and https pages (`link`), saves text files
|
|
174
180
|
(`save`), keeps a few kilobytes per app on the device (`remember`, `recall`),
|
|
@@ -176,22 +182,60 @@ and reads a picture that one of the app's own records refers to (`file`),
|
|
|
176
182
|
or the whole file (`blob`), taking its type from the record rather than from
|
|
177
183
|
the screen.
|
|
178
184
|
|
|
185
|
+
**Settings and the network.** An app may ask for `settings`, like an API
|
|
186
|
+
key. Someone who may add apps fills them in once, from the open app, for
|
|
187
|
+
everyone in the space, and its screen reads them as `minca.settings`; nobody
|
|
188
|
+
else is asked. They live on the app's own record, so they stand only as it
|
|
189
|
+
does: a new version proposed without values keeps the ones the app has, and a
|
|
190
|
+
copy to another space carries none. The origins an app names in `network` are
|
|
191
|
+
allowed for everyone once it is added, as a workspace's admin adds an
|
|
192
|
+
integration: adding it is the consent. The ready-made Chat asks for a GIPHY
|
|
193
|
+
key, and shows its GIF button only once it has one.
|
|
194
|
+
|
|
179
195
|
**Opening a record where it belongs.** A `launcher.app` may name, among its
|
|
180
196
|
`collections`, the ones it `shows`: the ones whose records it is the place
|
|
181
197
|
to open (`shows: ["std.message"]` for a chat). Whatever asks the example app
|
|
182
198
|
to open a record, a screen's `open` or a link beside a record, goes to the
|
|
183
|
-
app that shows that record's collection
|
|
199
|
+
app that shows that record's collection: the one open, if it does, else the
|
|
200
|
+
only one, else the one the person picks when asked, and that app's
|
|
184
201
|
screen is handed the record's key (`minca.shown`, `minca.onShow`, the kit's
|
|
185
202
|
`useShown`) to scroll to or open, but only of a collection it shows, which
|
|
186
203
|
it could list anyway. That app does learn which of those records the person
|
|
187
204
|
opens from elsewhere, which is why only someone who may define collections
|
|
188
|
-
adds an app. With no app that shows it,
|
|
189
|
-
|
|
205
|
+
adds an app. With no app that shows it, or when that app opens one of its
|
|
206
|
+
own (a poll's title in Polls, for its comments), the record opens beside
|
|
207
|
+
whatever is open. So the Files app opens a file's message in
|
|
190
208
|
the chat, and a chat's file in Files, without either knowing the other. An
|
|
191
209
|
app that names a collection in `shows` must do something with what it is
|
|
192
210
|
handed. The kit's `<Record>` draws any standard record as one line the same
|
|
193
211
|
way in every app, and opens it this way when clicked.
|
|
194
212
|
|
|
213
|
+
**Sharing a record into an app.** A screen can't list or read what its app
|
|
214
|
+
doesn't name, but a person can hand it one record, as a page gets only the
|
|
215
|
+
file a person picks for it. `minca.pick` asks the page to show a finder over
|
|
216
|
+
the whole space, and gives the screen the record the person chooses, or
|
|
217
|
+
null. The screen may then link one of its records to it with `shares`, like
|
|
218
|
+
a message, and anyone's screen reads it back through that link
|
|
219
|
+
(`minca.get(key, { link: 'shares' })`), read only. `shares` is the only role
|
|
220
|
+
a screen reads through: a file about a diary entry, or a reaction to it,
|
|
221
|
+
shares nothing, so a screen reads beyond its collections only records the
|
|
222
|
+
person picked, or that someone writing its collections shares (a member, an
|
|
223
|
+
agent, another app). That binds the screen, not its author: a member who
|
|
224
|
+
wrote a screen can share any record into its collections from their own
|
|
225
|
+
node, and the screen reads it. A shared record comes with its files' keys,
|
|
226
|
+
though not their bytes. A screen writes
|
|
227
|
+
a link only to a record of its own collections, one the person picked for
|
|
228
|
+
it, or one the record already has, refused alike whether or not the target
|
|
229
|
+
is here (so a link to a record that hasn't arrived yet waits until it has):
|
|
230
|
+
a screen never links out on its own, though like anything it reads, it can
|
|
231
|
+
copy what was shared into its own records. A screen may ask to pick as often
|
|
232
|
+
as it likes, and start the search from its own text; what it gets is still
|
|
233
|
+
only what the person chooses, in a space they can read anyway: Enter takes
|
|
234
|
+
the top match only once the person has typed. A chat
|
|
235
|
+
shares a poll without being able to read polls; `/` typed into an empty
|
|
236
|
+
message, or its `/` button, picks one; so does a comment box (the kit's
|
|
237
|
+
`useShare`).
|
|
238
|
+
|
|
195
239
|
A screen also sends live messages, kept nowhere, to the other devices that
|
|
196
240
|
have the same app open in the space (`live.send`, `live.on`): for cursors,
|
|
197
241
|
typing, who is here, or a game. Each goes as a live message of the space
|
|
@@ -223,7 +267,7 @@ defines its collections and writes a copy of it, naming where it came from
|
|
|
223
267
|
(`template: "kanban"`), and from then on the space changes its copy like any
|
|
224
268
|
other app.
|
|
225
269
|
|
|
226
|
-
_Source: `apps/example/src/components/apps/launcher.ts` (`addTemplate`), `apps/example/src/components/apps/screens.ts`, `apps/example/src/components/apps/ScreenFrame.tsx`, `apps/example/src/components/apps/templates/`, `apps/example/public/screen.html`, `packages/ui/src/frame/`, `packages/ui/src/guide.ts`. Tests: `apps/example/tests/launcher.test.ts` ("adding a ready-made app copies it into the space once, with its collections and first records"), `apps/example/tests/screens.test.ts` ("a screen checks, shows faces and opens things only within its app and its space", "what the page does for a screen, it does only as asked properly", "a screen hears the same app's screens on other devices, as who sent it, and no other app's")._
|
|
270
|
+
_Source: `apps/example/src/components/apps/launcher.ts` (`addTemplate`, `firstApp`, `saveSettings`, `settingsOf`), `apps/example/src/components/apps/entries.ts` (`landingApp`, `addChat`), `apps/example/src/contacts.ts` (`withChat`), `apps/example/src/components/apps/screens.ts`, `apps/example/src/components/apps/ScreenFrame.tsx`, `apps/example/src/components/apps/AppSettings.tsx`, `apps/example/src/components/apps/templates/`, `apps/example/public/screen.html`, `packages/ui/src/frame/`, `packages/ui/src/guide.ts`. Tests: `apps/example/tests/launcher.test.ts` ("a space opens with the first app on its launcher, the same for everyone in it, and moving one changes it", "adding a ready-made app copies it into the space once, with its collections and first records", "settings filled in once stand for everyone, survive a new version of the app, and stay in their space"), `apps/example/tests/screens.test.ts` ("an app's settings come with the screen, and the screen can't change them", "a screen checks, shows faces and opens things only within its app and its space", "what the page does for a screen, it does only as asked properly", "a screen can’t point a link out of its app, so it can’t probe for keys or reach what no one shared", "a record someone shared is read through the link to it, and only through that", "a screen links out only to what the person picked for it, and is handed what they picked", "the space’s own records are never picked for a screen", "a screen hears the same app's screens on other devices, as who sent it, and no other app's")._
|
|
227
271
|
|
|
228
272
|
## Describing a collection
|
|
229
273
|
|
|
@@ -260,7 +304,7 @@ _Source: `packages/core/src/records/describe.ts`. Tests: `packages/core/tests/re
|
|
|
260
304
|
|
|
261
305
|
An app decides it can open a space by finding a collection with the right
|
|
262
306
|
**name**. Chat opens any `std.message`, whatever its fields and rules. And a space whose definition is a little older than the
|
|
263
|
-
app's (a `std.message` without the `shares` link) stays that way, because the
|
|
307
|
+
app's (a `std.message` or `std.comment` without the `shares` link) stays that way, because the
|
|
264
308
|
library skips a collection the space already has. Whether an app can use a
|
|
265
309
|
definition it did not write is a question for the app, not for peers: a peer
|
|
266
310
|
stores and judges every record the same way whatever the answer.
|
|
@@ -296,8 +340,8 @@ Anything the checker cannot decide is a break.
|
|
|
296
340
|
this is a walk of both schemas: `type` sets contained (`integer` inside
|
|
297
341
|
`number`); a field one side relies on is `required` on the other; numeric
|
|
298
342
|
and length ranges contained; `enum`, `const` and `oneOf` value sets
|
|
299
|
-
contained; recurse into `properties` and `items`. `title`, `description
|
|
300
|
-
|
|
343
|
+
contained; recurse into `properties` and `items`. `title`, `description`,
|
|
344
|
+
`x-choicesFrom` and every other `x-*` annotation are ignored. A field only one side mentions is ignored,
|
|
301
345
|
unless that side requires it or closes the schema
|
|
302
346
|
(`additionalProperties: false`).
|
|
303
347
|
- **Links.** A link role the app uses is declared in the space; where it may
|
|
@@ -385,15 +429,15 @@ which field is the title or that votes are shown as counts. The plan adds
|
|
|
385
429
|
optional hints to a definition:
|
|
386
430
|
|
|
387
431
|
- which field is the record's **title**;
|
|
388
|
-
- a field's **role** (a date, a person, an amount);
|
|
389
432
|
- **tallies**: "show as a count" of records linking here, the way
|
|
390
433
|
`x-choicesFrom` already makes vote-style counts possible;
|
|
391
434
|
- values **worked out on read**: "voting closes Friday", "who hasn't
|
|
392
435
|
answered". Each reader computes them from the records and its own clock, so
|
|
393
436
|
nothing has to run anywhere.
|
|
394
437
|
|
|
438
|
+
A field's kind (a person) is already its `x-kind` ([collections](collections.md#schemas)).
|
|
395
439
|
Like `x-choicesFrom`, hints are display only and never checked when
|
|
396
|
-
validating, and [`compare`](#compatible-definitions) ignores them.
|
|
397
|
-
|
|
398
|
-
top-level
|
|
399
|
-
|
|
440
|
+
validating, and [`compare`](#compatible-definitions) ignores them. A hint
|
|
441
|
+
about one field is an `x-*` keyword on it; one about the whole record goes
|
|
442
|
+
in a top-level definition member, which today's peers ignore when they
|
|
443
|
+
don't know it ([spec 02 §6.2](https://github.com/leifriksheim/minca/blob/main/spec/02-records.md)). Added when a derived view falls short. _Open:_ the format.
|
package/docs/building-an-app.md
CHANGED
|
@@ -12,7 +12,7 @@ the app cannot write anywhere it was not given.
|
|
|
12
12
|
|
|
13
13
|
```tsx
|
|
14
14
|
import { createMincaConnection } from '@minca/core/session';
|
|
15
|
-
import { MincaProvider, useConnection } from '@minca/
|
|
15
|
+
import { MincaProvider, useConnection } from '@minca/react';
|
|
16
16
|
|
|
17
17
|
const connection = createMincaConnection({
|
|
18
18
|
home: 'https://home.minca.social/connect', // a suggestion: the person may use their own
|
|
@@ -22,7 +22,7 @@ const connection = createMincaConnection({
|
|
|
22
22
|
scope: 'spaces', // or 'account', for every space
|
|
23
23
|
create: [{ name: 'Todos', visibility: 'private' }],
|
|
24
24
|
},
|
|
25
|
-
network: { relays: ['wss://minca.
|
|
25
|
+
network: { relays: ['wss://relay.minca.social'] },
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
createRoot(root).render(
|
|
@@ -55,7 +55,7 @@ account, password or passkey, creating one, pairing a phone) ships as an
|
|
|
55
55
|
element and as a React component.
|
|
56
56
|
|
|
57
57
|
```html
|
|
58
|
-
<minca-auth app-name="Todo" relays="wss://minca.
|
|
58
|
+
<minca-auth app-name="Todo" relays="wss://relay.minca.social"></minca-auth>
|
|
59
59
|
<script type="module">
|
|
60
60
|
import '@minca/core/elements';
|
|
61
61
|
document.querySelector('minca-auth').addEventListener('minca-session', (event) => {
|
|
@@ -67,9 +67,9 @@ element and as a React component.
|
|
|
67
67
|
|
|
68
68
|
```tsx
|
|
69
69
|
import { createMincaAuth } from '@minca/core/session';
|
|
70
|
-
import { MincaProvider, MincaAuth, useMinca } from '@minca/
|
|
70
|
+
import { MincaProvider, MincaAuth, useMinca } from '@minca/react';
|
|
71
71
|
|
|
72
|
-
const auth = createMincaAuth({ appName: 'Todo', network: { relays: ['wss://minca.
|
|
72
|
+
const auth = createMincaAuth({ appName: 'Todo', network: { relays: ['wss://relay.minca.social'] } });
|
|
73
73
|
|
|
74
74
|
function App() {
|
|
75
75
|
const { state } = useMinca();
|
|
@@ -103,7 +103,7 @@ const me = await manager.fromRecoveryCode(code);
|
|
|
103
103
|
const node = await createNode({
|
|
104
104
|
signer: createLocalRootSigner(me, manager.getProvider()),
|
|
105
105
|
stores: indexedDBStores('my-app'),
|
|
106
|
-
network: { relays: ['wss://minca.
|
|
106
|
+
network: { relays: ['wss://relay.minca.social'] },
|
|
107
107
|
});
|
|
108
108
|
```
|
|
109
109
|
|
|
@@ -135,7 +135,7 @@ await node.spaces.closeInvite(space.id, invite); // nobody else joins with it
|
|
|
135
135
|
|
|
136
136
|
## React hooks
|
|
137
137
|
|
|
138
|
-
All from `@minca/
|
|
138
|
+
All from `@minca/react`, below a `MincaProvider`:
|
|
139
139
|
|
|
140
140
|
| Hook | Gives |
|
|
141
141
|
| ------------------------------------------------------------------- | ----------------------------------------------------------------------- |
|
|
@@ -148,6 +148,9 @@ All from `@minca/core/react`, below a `MincaProvider`:
|
|
|
148
148
|
| `useCan(space, action, target)` | Whether to show an edit or delete button |
|
|
149
149
|
| `useHoldSpace(space)` | Keeps a space syncing while the view is on screen |
|
|
150
150
|
| `useLive(space, load, deps)` | Anything else, reloaded as the space changes |
|
|
151
|
+
| `useWatched(load, deps, { when, settle, every })` | Anything else, reloaded after the node events you pick |
|
|
152
|
+
| `useAsync(load, deps)` | One answer: `loading`, `done` with its value, or `failed` |
|
|
153
|
+
| `useAccountPicture()` | The account's picture as a URL, or null |
|
|
151
154
|
| `useNames(space)` | `name(did)`: what someone is called there, never passing for another |
|
|
152
155
|
| `useMyName()` | The account's name, to ask for when making or joining a space |
|
|
153
156
|
| `useInviteLink()` | The invite this page was opened with, what it is for, and `dismiss` |
|
|
@@ -177,7 +180,7 @@ takes the invite out of a pasted link, and `useInviteLink()` reads the one the
|
|
|
177
180
|
page was opened with:
|
|
178
181
|
|
|
179
182
|
```tsx
|
|
180
|
-
import { inviteLink, useInviteLink, useMyName, useNode } from '@minca/
|
|
183
|
+
import { inviteLink, useInviteLink, useMyName, useNode } from '@minca/react';
|
|
181
184
|
|
|
182
185
|
const link = inviteLink(await node.spaces.invite(space.id, { short: true })); // https://app.example/#invite=…
|
|
183
186
|
|
package/docs/collections.md
CHANGED
|
@@ -45,13 +45,39 @@ What gets stored is JSON Schema, in a small subset every app agrees on:
|
|
|
45
45
|
`maximum`, `minLength`, `maxLength`, `minItems`, `maxItems`,
|
|
46
46
|
`additionalProperties` (true or false), `title`, `description`
|
|
47
47
|
|
|
48
|
-
and
|
|
48
|
+
and three that say what a value means, so any app can show it well:
|
|
49
49
|
|
|
50
50
|
- `oneOf: [{ const, title }]`: fixed choices with labels.
|
|
51
51
|
- `x-choicesFrom: { rel, field }`: the value picks from a list in the record
|
|
52
52
|
this one links to as `rel`, in its field `field`. A number is a position in
|
|
53
53
|
that list; anything else is the option itself. A vote's `choice` picks from
|
|
54
54
|
its poll's `options`. It is a display hint, never checked when validating.
|
|
55
|
+
- `x-kind: "<name>"`: what kind of value a field holds. The names apps read:
|
|
56
|
+
|
|
57
|
+
| `x-kind` | The value | An app shows |
|
|
58
|
+
| ---------- | ------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------- |
|
|
59
|
+
| `did` | an account's DID, `did:key:z…` ([spec 01 §4](https://github.com/leifriksheim/minca/blob/main/spec/01-identity.md)) | who it is, and a list of people to pick from |
|
|
60
|
+
| `when` | a moment, RFC 3339, or a whole day, `YYYY-MM-DD` | the time in the reader's words, a date and time picker with "all day" |
|
|
61
|
+
| `day` | a day, `YYYY-MM-DD` | the day in the reader's words, a date picker |
|
|
62
|
+
| `url` | a web address | a link, opened only when it is `http` or `https` |
|
|
63
|
+
| `money` | `{ amount, currency }`, `amount` a decimal string | `€12.50` in the reader's format; an amount and a currency |
|
|
64
|
+
| `file` | a file, as `records.addFile` gives it | its name and size, a picture when it is one; a file picker |
|
|
65
|
+
| `image` | `{ blob, alt }`: a picture and what it shows | the picture; a picker and its description |
|
|
66
|
+
| `position` | a sort key (`positionBetween`) | nothing: it orders records, nobody reads it |
|
|
67
|
+
|
|
68
|
+
Each is what the fragment of the same name writes (`person` writes `did`,
|
|
69
|
+
`blob` writes `file`). An app shows a kind it doesn't know as the plain
|
|
70
|
+
value. A definition
|
|
71
|
+
already in a space keeps the labels it was written with: a space defined
|
|
72
|
+
before these labels shows those fields plainly until the collection is
|
|
73
|
+
redefined.
|
|
74
|
+
|
|
75
|
+
Any keyword starting `x-` is an annotation like these: any JSON, and it says
|
|
76
|
+
nothing about whether a body fits. A new one, or a new `x-kind`, is a row
|
|
77
|
+
here, never a change to the protocol. With Zod, add one with
|
|
78
|
+
`.meta({ 'x-kind': 'did' })`. Keep annotations to plain values: a validator
|
|
79
|
+
that can't build from a schema (an `$id` inside one is enough) checks
|
|
80
|
+
nothing against it, so the collection's shape goes unchecked.
|
|
55
81
|
|
|
56
82
|
Anything else, like `pattern` or `format`, is refused when you define the
|
|
57
83
|
collection, with the reason. A Zod `.regex()` or `.email()` fails for that
|
|
@@ -69,7 +95,9 @@ unknown keywords ignored, so a space written by a newer app that allows more
|
|
|
69
95
|
stays readable by an older one. Every failing leaf is reported, not only the
|
|
70
96
|
first, with a JSON Pointer to the value. The validator is
|
|
71
97
|
`@cfworker/json-schema`, which interprets rather than compiles, so it runs
|
|
72
|
-
under a strict CSP.
|
|
98
|
+
under a strict CSP. A schema it can't build a validator from (it follows
|
|
99
|
+
`$id`s into any key it doesn't know, so a bad one in an annotation is enough)
|
|
100
|
+
checks nothing, like an invalid definition; reading never fails on it.
|
|
73
101
|
|
|
74
102
|
A record that doesn't fit the schema is still kept and synced, and comes back
|
|
75
103
|
with `conforms: false` and the issues. Shape is checked when you write, not
|
|
@@ -77,7 +105,7 @@ enforced on arrival, because two peers may have seen different versions of a
|
|
|
77
105
|
definition ([spec 02 §9.6](https://github.com/leifriksheim/minca/blob/main/spec/02-records.md)).
|
|
78
106
|
Rules, below, are enforced everywhere.
|
|
79
107
|
|
|
80
|
-
_Source: `packages/core/src/schema/collection-def.ts` (`validateJsonSchema`, `toJsonSchema`, `asStandardSchema`), `packages/core/src/node/space-
|
|
108
|
+
_Source: `packages/core/src/schema/collection-def.ts` (`validateJsonSchema`, `toJsonSchema`, `asStandardSchema`), `packages/core/src/node/space-catalog.ts` (`contentIssues`). Tests: `packages/core/tests/space-catalog.test.ts` ("validate and reject within the supported subset", "an unknown keyword is ignored when validating, so newer spaces stay readable", "choices can carry labels, or come from a linked record", "an x-\* keyword is an annotation: any one publishes, and no value is checked against it", "a record that does not fit is kept and flagged when it arrives, never rejected"), `packages/core/tests/attacks.test.ts` ("a definition the validator can't use can't break reading the collection, or the space"), `packages/core/tests/schemas.test.ts` ("schemas from a validator you already use")._
|
|
81
109
|
|
|
82
110
|
## Links
|
|
83
111
|
|
|
@@ -107,7 +135,7 @@ Like a schema, link declarations are checked when you write: the node refuses
|
|
|
107
135
|
to sign links that don't conform. A record that arrives with links that
|
|
108
136
|
don't conform is kept and comes back with `conforms: false`.
|
|
109
137
|
|
|
110
|
-
_Source: `packages/core/src/records/links.ts` (`checkLinks`), `packages/core/src/node/space-
|
|
138
|
+
_Source: `packages/core/src/records/links.ts` (`checkLinks`), `packages/core/src/node/space-catalog.ts` (`linkIssues`), `packages/core/src/node/space-writing.ts` (`write`). Tests: `packages/core/tests/links.test.ts` ("refused on write when they break the declaration; flagged, never rejected, when they arrive")._
|
|
111
139
|
|
|
112
140
|
## Rules
|
|
113
141
|
|
|
@@ -371,7 +399,7 @@ differ, `collections.list` leaves it out and its records are judged by no
|
|
|
371
399
|
rules
|
|
372
400
|
([spec 02 §6.3](https://github.com/leifriksheim/minca/blob/main/spec/02-records.md)).
|
|
373
401
|
|
|
374
|
-
_Source: `packages/core/src/node/space-runtime.ts` (`define`, `undefine
|
|
402
|
+
_Source: `packages/core/src/node/space-runtime.ts` (`define`, `undefine`), `packages/core/src/node/space-writing.ts` (`write`), `packages/core/src/node/types.ts` (`NodeCollections`). Tests: `packages/core/tests/space-catalog.test.ts`, `packages/core/tests/rules.test.ts` ("grants: changing them")._
|
|
375
403
|
|
|
376
404
|
## The standard library
|
|
377
405
|
|
package/docs/contacts.md
CHANGED
|
@@ -88,13 +88,46 @@ theirs to leave, and opens as nothing.
|
|
|
88
88
|
`blocked: true`.
|
|
89
89
|
- `others(did)` lists accounts other than the two seen in the space for two
|
|
90
90
|
(members, profiles, connected peers).
|
|
91
|
+
- `invite(did, spaceId, { role? })` invites a contact into a space you hold:
|
|
92
|
+
it makes an invite for `role` and leaves it as a `std.space-invite` in your
|
|
93
|
+
space for two with them. The contact must have joined the space for two: a
|
|
94
|
+
knock nobody answered yet is refused, so a space is never opened to whoever
|
|
95
|
+
a username happens to lead to before you have seen who they are. A blocked
|
|
96
|
+
contact is refused.
|
|
97
|
+
- `invites()` lists the invites a contact left for you in your space for two
|
|
98
|
+
with them, to spaces you don't hold yet, newest first:
|
|
99
|
+
`{ from, space, name, invite, pairSpace, key, createdAt }`. Only the
|
|
100
|
+
contact's own records count, and each invite is checked as joining checks
|
|
101
|
+
it: signed by the contact, for the space whose constitution it carries,
|
|
102
|
+
which is where `space` and `name` come from. Invites from someone blocked are
|
|
103
|
+
not shown. It also closes, and deletes, invites of yours the contact has
|
|
104
|
+
joined with.
|
|
105
|
+
- `join(pairSpace, key)` joins the space an invite from that contact is for.
|
|
106
|
+
|
|
107
|
+
## `std.space-invite`
|
|
108
|
+
|
|
109
|
+
An invite to a space, left in a space for two: `{ space, invite }`,
|
|
110
|
+
`onePer: ['space']`, so inviting again to the same space replaces it.
|
|
111
|
+
|
|
112
|
+
It is open until its maker's node sees the contact in the space and closes
|
|
113
|
+
it, the next time it reads `invites()`. A contact removed before then can
|
|
114
|
+
rejoin with it, as with any open role invite
|
|
115
|
+
([#170](https://github.com/leifriksheim/minca/issues/170)), and whoever else
|
|
116
|
+
holds a place in the space for two reads it
|
|
117
|
+
([#313](https://github.com/leifriksheim/minca/issues/313)). An invite with no
|
|
118
|
+
role, to view, carries the space key and can't be closed
|
|
119
|
+
([#172](https://github.com/leifriksheim/minca/issues/172)).
|
|
120
|
+
|
|
121
|
+
A contact's `username` is what their domain answered when you found them by
|
|
122
|
+
it. Nothing checks it again: once a name lapses and someone else claims it, a
|
|
123
|
+
lookup leads to them, and the contact keeps the old one.
|
|
91
124
|
|
|
92
125
|
`ask` and `accept` need a session note that grants `/account/write` for the
|
|
93
126
|
whole account, as a knock does. An app granted `contacts` sees the list and
|
|
94
127
|
requests, but may not ask or accept
|
|
95
128
|
([spec 06 §2.5](https://github.com/leifriksheim/minca/blob/main/spec/06-nodes-and-sessions.md)).
|
|
96
129
|
|
|
97
|
-
_Source: `packages/core/src/schemas/contacts.ts` (`contact`), `packages/core/src/identity/contact-key.ts` (`deriveContactKeyBytes`), `packages/core/src/inbox/inbox.ts` (`sealKnock`, `openKnock`), `packages/core/src/node/node.ts` (
|
|
130
|
+
_Source: `packages/core/src/schemas/contacts.ts` (`contact`), `packages/core/src/identity/contact-key.ts` (`deriveContactKeyBytes`), `packages/core/src/inbox/inbox.ts` (`sealKnock`, `openKnock`), `packages/core/src/node/node-contacts.ts` (`openMail`, `makePair`, `contacts`), `packages/core/src/schemas/contacts.ts` (`contactRequest`), `packages/core/src/node/types.ts` (`NodeContacts`), `packages/core/src/space/account-registry.ts` (`deriveContactsSpace`). Tests: `packages/core/tests/contacts.test.ts`, `packages/core/tests/attacks.test.ts` ("a knock re-posted by someone else…"), `packages/core/tests/usernames.test.ts` ("node.contacts.invite")._
|
|
98
131
|
|
|
99
132
|
## Planned: requests that can be taken back
|
|
100
133
|
|
package/docs/contracts.md
CHANGED
|
@@ -196,4 +196,4 @@ A line is checked by walking its counted chain for each version judged, so a
|
|
|
196
196
|
very long line costs time in proportion to its length squared, once; the
|
|
197
197
|
verdicts are cached.
|
|
198
198
|
|
|
199
|
-
_Source: `packages/core/src/records/contract-builder.ts` (`contract`, `buildChecks`, `storedContract`), `packages/core/src/records/cel-types.ts` (`typeCheckCel`, `typeOfSchema`), `packages/core/src/records/contracts.ts` (`checkContracts`, `checkContractShape`, `checkContractTypes`, `runContracts`, `contractCostHints`, `checkLine`), `packages/core/src/node/space-
|
|
199
|
+
_Source: `packages/core/src/records/contract-builder.ts` (`contract`, `buildChecks`, `storedContract`), `packages/core/src/records/cel-types.ts` (`typeCheckCel`, `typeOfSchema`), `packages/core/src/records/contracts.ts` (`checkContracts`, `checkContractShape`, `checkContractTypes`, `runContracts`, `contractCostHints`, `checkLine`), `packages/core/src/node/space-checks.ts` (`checksOf`, `lineBreak`, `counts`), `packages/core/src/node/space-writing.ts` (`contractsFor`, `after`, `write`), `packages/core/src/node/space-runtime.ts` (`recordsChanged`, `define`), `packages/core/src/node/node-records.ts` (`contracts`). Tests: `packages/core/tests/contract-builder.test.ts`, `packages/core/tests/contracts.test.ts`, `packages/core/tests/contracts-shape.test.ts`, `packages/core/tests/contracts-line.test.ts`, `packages/core/tests/contracts-pending.test.ts`, `packages/core/tests/contracts-reads.test.ts`, `scenarios/tests/fame.test.ts` and `scenarios/tests/credit.test.ts` (each case with the built contract and the hand-written one)._
|
package/docs/direct-messages.md
CHANGED
|
@@ -107,7 +107,7 @@ _Source:_ `packages/core/src/node/actions.ts` (`direct_list`, `direct_send`),
|
|
|
107
107
|
(`openTrigger`, `ruleContext`). Tests: `packages/core/tests/direct.test.ts`
|
|
108
108
|
("the direct message actions"), `packages/cli/tests/agent-automations.test.ts`.
|
|
109
109
|
|
|
110
|
-
_Source: `packages/core/src/privacy/direct.ts` (`sealDirect`, `openDirect`, `directBound`), `packages/core/src/schemas/library/publishing.ts` (`direct`), `packages/core/src/node/node.ts` (`
|
|
110
|
+
_Source: `packages/core/src/privacy/direct.ts` (`sealDirect`, `openDirect`, `directBound`), `packages/core/src/schemas/library/publishing.ts` (`direct`), `packages/core/src/node/node-records.ts` (`createNodeDirect`, `directView`), `packages/core/src/node/space-profiles.ts` (`memberKeys`), `packages/core/src/node/space-runtime.ts` (`ownMemberKey`), `apps/example/src/components/apps/Chat.tsx`. Tests: `packages/core/tests/direct.test.ts`, `packages/core/tests/records-only.test.ts` ("neither sends nor reads direct messages")._
|
|
111
111
|
|
|
112
112
|
## Planned: direct messages in public spaces
|
|
113
113
|
|
package/docs/inbox.md
CHANGED
|
@@ -32,7 +32,7 @@ keys stay, so a code already handed out keeps working once it is read again.
|
|
|
32
32
|
`gen + 1`: the old code leads to a topic nobody reads, and nothing ties the
|
|
33
33
|
new keys to the old.
|
|
34
34
|
|
|
35
|
-
_Source: `packages/core/src/schemas/contacts.ts` (`inbox`), `packages/core/src/node/node.ts` (
|
|
35
|
+
_Source: `packages/core/src/schemas/contacts.ts` (`inbox`), `packages/core/src/node/node-contacts.ts` (`inboxRecord`, `writeInbox`, `inbox.rotate`). Tests: `packages/core/tests/inbox.test.ts` ("node.inbox")._
|
|
36
36
|
|
|
37
37
|
## The exchange
|
|
38
38
|
|
|
@@ -113,7 +113,7 @@ and the contact key. The inbox is the person's: a node whose note lacks
|
|
|
113
113
|
knock, accept or dismiss. A home never gives an agent the contact key in the
|
|
114
114
|
first place ([spec 06 §2.8](https://github.com/leifriksheim/minca/blob/main/spec/06-nodes-and-sessions.md)).
|
|
115
115
|
|
|
116
|
-
_Source: `packages/core/src/node/node.ts` (
|
|
116
|
+
_Source: `packages/core/src/node/node-contacts.ts` (`makePair`, `settleSent`, `readKnocks`, `inbox`), `packages/core/src/node/types.ts` (`NodeInbox`), `packages/core/src/schemas/contacts.ts` (`inbox`, `knock`), `packages/core/src/inbox/inbox.ts`, `packages/core/src/session/auth.ts` (`grant`). Tests: `packages/core/tests/inbox.test.ts` ("node.inbox"), `packages/core/tests/carrier.test.ts` ("a space made just now, carried before its invite goes out…"), `packages/core/tests/records-only.test.ts`._
|
|
117
117
|
|
|
118
118
|
## `node.inbox`
|
|
119
119
|
|
|
@@ -133,13 +133,7 @@ _Source: `packages/core/src/network/relays.ts` (`createMailboxClient`)._
|
|
|
133
133
|
- **Mailboxes that last.** A host that keeps its accounts' inbox topics
|
|
134
134
|
across restarts, as it keeps short links.
|
|
135
135
|
|
|
136
|
-
##
|
|
136
|
+
## Usernames
|
|
137
137
|
|
|
138
|
-
|
|
139
|
-
[
|
|
140
|
-
On this side:
|
|
141
|
-
|
|
142
|
-
- `node.inbox.knock` accepts a handle wherever it takes a code.
|
|
143
|
-
- **Who may knock.** The inbox gains a policy in its `std.inbox` record (never
|
|
144
|
-
published): `anyone` (default), `follows` or `mutuals` on the handle's
|
|
145
|
-
network. Knocks that don't match are kept but shown apart.
|
|
138
|
+
A username (`leif@minca.social`) leads to an inbox code: see
|
|
139
|
+
[usernames.md](usernames.md).
|