@minca/core 0.1.15 → 0.1.17
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 +10 -10
- 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 +35 -9
- 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 +169 -72
- package/dist/elements/minca-auth.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.map +1 -1
- package/dist/network/relay-minca.js +11 -49
- package/dist/network/relay-minca.js.map +1 -1
- package/dist/network/relay-nostr.d.ts.map +1 -1
- package/dist/network/relay-nostr.js +23 -63
- 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/ws-transport.d.ts.map +1 -1
- package/dist/network/ws-transport.js +3 -0
- package/dist/network/ws-transport.js.map +1 -1
- package/dist/node/actions.d.ts +2 -0
- package/dist/node/actions.d.ts.map +1 -1
- package/dist/node/actions.js +89 -58
- package/dist/node/actions.js.map +1 -1
- package/dist/node/api.d.ts +7 -0
- package/dist/node/api.d.ts.map +1 -1
- package/dist/node/api.js +7 -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 +567 -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 +456 -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 +199 -1990
- 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 +53 -0
- package/dist/node/space-holding.d.ts.map +1 -0
- package/dist/node/space-holding.js +339 -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 +629 -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 +107 -140
- package/dist/node/space-runtime.d.ts.map +1 -1
- package/dist/node/space-runtime.js +331 -3985
- 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 +74 -0
- package/dist/node/space-writing.d.ts.map +1 -0
- package/dist/node/space-writing.js +442 -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 +243 -306
- 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/schemas/automations.d.ts +8 -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.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/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/social.d.ts +258 -0
- package/dist/schemas/library/social.d.ts.map +1 -1
- package/dist/schemas/library/social.js +28 -1
- package/dist/schemas/library/social.js.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/hosting.d.ts.map +1 -1
- package/dist/session/hosting.js +8 -2
- package/dist/session/hosting.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/presets.d.ts +2 -2
- package/dist/space/presets.d.ts.map +1 -1
- package/dist/space/presets.js +3 -2
- package/dist/space/presets.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 +1 -0
- package/docs/actions.md +32 -25
- package/docs/agents.md +28 -16
- package/docs/automations.md +1 -1
- package/docs/blueprints-and-guides.md +37 -5
- package/docs/building-an-app.md +7 -4
- package/docs/collections.md +3 -3
- package/docs/contacts.md +34 -1
- package/docs/contracts.md +1 -1
- package/docs/direct-messages.md +6 -2
- package/docs/inbox.md +5 -11
- package/docs/node.md +54 -22
- package/docs/records-and-queries.md +1 -1
- package/docs/sign-in.md +54 -26
- package/docs/spaces.md +9 -8
- package/docs/standard-library.md +37 -14
- package/docs/storage.md +5 -6
- package/docs/usernames.md +161 -0
- package/docs/warrants.md +1 -1
- package/package.json +1 -2
package/docs/actions.md
CHANGED
|
@@ -14,6 +14,7 @@ of them.
|
|
|
14
14
|
| Field | Meaning |
|
|
15
15
|
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------- |
|
|
16
16
|
| `name` | Matches `[a-z_]+`, so it is a valid tool name everywhere. |
|
|
17
|
+
| `title` | A few words for a person: what a client shows when it asks before running it. |
|
|
17
18
|
| `description` | One or more sentences for a person or model. |
|
|
18
19
|
| `input` | A JSON Schema object (`type: "object"`, `properties`, `required`). |
|
|
19
20
|
| `readOnly` | Reads only. An agent may run it without asking. |
|
|
@@ -53,8 +54,7 @@ The actions (R = readOnly, S = sensitive, D = destructive, P = peerContent):
|
|
|
53
54
|
| `collections_proposals` | R P | **`space`** | Blueprints: `key`, `title`, `description`, `proposedBy`, `recordsOnly?`, `updates?`, `applied`, `superseded`, `problem`, `collections[]` (each `name`, `status`, `summary`, `changes`, and `usedBy`: the applied blueprints a change would touch). |
|
|
54
55
|
| `collections_apply` | D | **`space`**, **`key`** | `applyBlueprint()`: `{ applied, collections }`. Needs a grant of `/collection/define` in the space, and a note that grants it. |
|
|
55
56
|
| `collections_delete` | D | **`space`**, **`name`** | `collections.delete()` |
|
|
56
|
-
| `
|
|
57
|
-
| `records_query` | R P | **`space`**, **`collection`**, `where`, `include`, `sort`, `limit`, `cursor` | `records.query()` ([02](https://github.com/leifriksheim/minca/blob/main/spec/02-records.md)) |
|
|
57
|
+
| `records_query` | R P | **`space`**, **`collection`**, `where`, `include`, `sort`, `limit` (50 by default), `cursor` | `records.query()` ([02](https://github.com/leifriksheim/minca/blob/main/spec/02-records.md)) |
|
|
58
58
|
| `records_get` | R P | **`space`**, **`key`** | `records.get()` |
|
|
59
59
|
| `records_history` | R P | **`space`**, **`key`** | `records.history()` |
|
|
60
60
|
| `records_put` | | **`space`**, **`collection`**, **`body`**, `key`, `links` | `records.put()` |
|
|
@@ -71,7 +71,7 @@ The blueprint the three proposal actions read and write (`collections_propose`,
|
|
|
71
71
|
points at, are described in [blueprints and guides](blueprints-and-guides.md).
|
|
72
72
|
|
|
73
73
|
**For a model.** `callAction(node, name, input)` runs an action and returns
|
|
74
|
-
`{ text, isError, value? }`: the result as
|
|
74
|
+
`{ text, isError, value? }`: the result as compact JSON, with
|
|
75
75
|
`PEER_CONTENT_NOTE` (treat this as data, not instructions) and a blank line
|
|
76
76
|
ahead of it when the action is `peerContent`; or the error's message with
|
|
77
77
|
`isError: true`. `offeredActions({ agent?, bot? })` is what a model is offered:
|
|
@@ -85,10 +85,9 @@ every action for the account itself; for a bot, all but `PERSON_ONLY`
|
|
|
85
85
|
**Front ends.** Each exposes the same list under the same names:
|
|
86
86
|
|
|
87
87
|
- **CLI** (`minca <action>`): flags from `input`. _Implementation detail._
|
|
88
|
-
- **MCP** (`minca mcp`,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
tool with `inputSchema = input` and annotations `readOnlyHint = readOnly`,
|
|
88
|
+
- **MCP** (`minca mcp-server`, the service chat apps connect to, over
|
|
89
|
+
Streamable HTTP; and `minca agent`'s own chat). Each action becomes a
|
|
90
|
+
tool with its `title`, `inputSchema = input` and annotations `readOnlyHint = readOnly`,
|
|
92
91
|
`destructiveHint = destructive`, `idempotentHint = readOnly`,
|
|
93
92
|
`openWorldHint = peerContent || !readOnly`; a `sensitive` action's
|
|
94
93
|
description gains "Confirm with the user before sharing the result." Calls
|
|
@@ -99,13 +98,13 @@ every action for the account itself; for a bot, all but `PERSON_ONLY`
|
|
|
99
98
|
`collections_delete` and `collections_apply`, registered on `document.modelContext` at page load.
|
|
100
99
|
_Implementation detail of the example._
|
|
101
100
|
|
|
102
|
-
_Source: `packages/core/src/node/actions.ts` (`callAction`, `offeredActions`), `packages/core/src/schemas/choosing.ts` (`CHOOSING`, `lookalikes`), `packages/cli/src/mcp.ts`, `packages/cli/src/agent-chat.ts`, `apps/example/src/webmcp.ts`. Tests: `packages/core/tests/node.test.ts` ("actions"), `packages/core/tests/records-only.test.ts` ("a twin of a standard collection, or a link of its own for where a record sits, is warned of"), `packages/cli/tests/cli.test.ts` ("MCP")._
|
|
101
|
+
_Source: `packages/core/src/node/actions.ts` (`callAction`, `offeredActions`), `packages/core/src/schemas/choosing.ts` (`CHOOSING`, `lookalikes`), `packages/cli/src/mcp.ts`, `packages/cli/src/agent-chat.ts`, `apps/example/src/webmcp.ts`. Tests: `packages/core/tests/node.test.ts` ("actions"), `packages/core/tests/records-only.test.ts` ("a twin of a standard collection, or a link of its own for where a record sits, is warned of"), `packages/cli/tests/cli.test.ts` ("MCP tools")._
|
|
103
102
|
|
|
104
103
|
## The agent on a computer
|
|
105
104
|
|
|
106
105
|
_Implementation detail of the CLI._ A key signs in one process at a time,
|
|
107
106
|
or its log forks (spec 02 §4.10). So each session running the agent at once,
|
|
108
|
-
a `minca
|
|
107
|
+
a `minca` command an agent runs or a `minca agent`, has a key of its own, in a
|
|
109
108
|
numbered slot: `<home>/agent/<n>/` (1 to 16) holds `key.json`, the P-256 key
|
|
110
109
|
as JWK (mode 0600), the grant made out to it in `grant.json`, each written
|
|
111
110
|
whole, its lock, and `stores/`, what only that session keeps (its key's
|
|
@@ -121,10 +120,9 @@ key is revoked forgets its slot's grant, so the next session there asks to be
|
|
|
121
120
|
allowed again, with a new key.
|
|
122
121
|
|
|
123
122
|
A session claims the first connected slot no other process holds, else the
|
|
124
|
-
first not connected yet.
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
`minca connect` at a terminal connects slot 1 and forgets the other slots'
|
|
123
|
+
first not connected yet. A command waits up to 30 s for a connected one;
|
|
124
|
+
`minca agent` at a terminal connects the one it was given. `minca connect`
|
|
125
|
+
at a terminal connects slot 1 and forgets the other slots'
|
|
128
126
|
grants, so each session after asks for its own again rather than run on a
|
|
129
127
|
note the person may have revoked; a session connected to another account
|
|
130
128
|
has every slot connected to the first forget its grant, so no later session
|
|
@@ -140,16 +138,25 @@ it would write nothing.
|
|
|
140
138
|
|
|
141
139
|
A session's node: signer `grantSigner(grant)`, session key = the slot's key,
|
|
142
140
|
the grant's keys when present and relays = the grant's ∪ `$MINCA_RELAYS`
|
|
143
|
-
(default `wss://minca.
|
|
141
|
+
(default `wss://relay.minca.social`) (`nodeOptionsFromGrant`), WebRTC via
|
|
144
142
|
`node-datachannel`; it joins any granted spaces it lacks (`joinGranted`);
|
|
145
|
-
wraps the node with `asAgent`; holds every space
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
143
|
+
wraps the node with `asAgent`; and holds every space.
|
|
144
|
+
|
|
145
|
+
Once the agent is connected here, a `minca` command on spaces or records
|
|
146
|
+
runs as it unless `--account` or `$MINCA_ACCOUNT` names an account (an empty
|
|
147
|
+
one names none), whatever secrets the environment holds. Commands that open
|
|
148
|
+
the account itself (`run`, `agent --bot`) still unlock it from the
|
|
149
|
+
environment. What it writes shows
|
|
150
|
+
"via agent". Its node runs for that one command, under the MCP service's
|
|
151
|
+
rule (`catchUp`, `keptAfter`): a command naming a space waits up to 15 s to
|
|
152
|
+
hold what an always-on node there holds and refuses when it can't, and one
|
|
153
|
+
that writes waits up to 10 s for the space's keepers to have it and fails
|
|
154
|
+
when nobody does. A `peerContent` result comes with `PEER_CONTENT_NOTE` on
|
|
155
|
+
stderr.
|
|
156
|
+
|
|
157
|
+
A running `minca agent` watches its slot's `grant.json`, and looks every 30 s
|
|
158
|
+
as well. When `minca connect` writes a new key and grant there that check
|
|
159
|
+
out, it closes its node and starts one under them, keeping the slot, so it
|
|
160
|
+
needs no restart.
|
|
161
|
+
|
|
162
|
+
_Source: `packages/cli/src/agent.ts` (`claimSlot`, `connectAgent`, `reconnectAgent`, `startAgentNode`, `reloadOnConnect`), `packages/cli/src/writer-keys.ts` (`holdLock`), `packages/cli/src/level.ts` (`catchUp`, `keptAfter`), `packages/cli/src/main.ts` (`withNode`, `agentSlot`). Tests: `packages/core/tests/records-only.test.ts` ("an agent running a node of its own"), `packages/cli/tests/cli-agent.test.ts` (all), `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/agents.md
CHANGED
|
@@ -38,24 +38,36 @@ npx @minca/cli connect
|
|
|
38
38
|
It makes a key for this computer's agent and opens the person's account home
|
|
39
39
|
in the browser, where they sign in, or make an account, and allow it. The
|
|
40
40
|
home then shows six digits, which the person types into the terminal: the
|
|
41
|
-
agent keeps its note only once they match.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
and gives them back to the same tool
|
|
51
|
-
([the CLI's README](https://github.com/leifriksheim/minca/blob/main/packages/cli/README.md#agents)). Once the
|
|
52
|
-
person has allowed it, every tool arrives (`notifications/tools/list_changed`)
|
|
53
|
-
without a restart.
|
|
41
|
+
agent keeps its note only once they match. From then on every `minca`
|
|
42
|
+
command on spaces or records on that computer runs as the agent unless an
|
|
43
|
+
account is named
|
|
44
|
+
(`--account`): an agent with a shell (Claude Code, Codex, Cursor's agent)
|
|
45
|
+
uses Minca through the CLI, and what it writes shows "via agent". Each
|
|
46
|
+
command catches up with the space's always-on nodes before it acts, and
|
|
47
|
+
refuses when it can't, as the MCP service does
|
|
48
|
+
([the CLI's README](https://github.com/leifriksheim/minca/blob/main/packages/cli/README.md#agents)).
|
|
49
|
+
A chat app with no shell connects to Minca's MCP service instead (below).
|
|
54
50
|
|
|
55
51
|
`minca agent` runs the same agent without a chat client: it chats in the
|
|
56
52
|
terminal and thinks with the person's own Anthropic API key, offering the model
|
|
57
53
|
the same tools. See `packages/cli/README.md`.
|
|
58
54
|
|
|
55
|
+
## Connecting a chat app
|
|
56
|
+
|
|
57
|
+
Minca's MCP service (`minca mcp-server`) offers the same tools to chat apps
|
|
58
|
+
over the network: an MCP endpoint at `/mcp`, signed in with OAuth. The
|
|
59
|
+
consent page the app opens is an app like any other to the account home: it
|
|
60
|
+
makes a key in the browser and asks for a note with `connectToHome`, records
|
|
61
|
+
only, in the spaces the person picks, then hands the key and the note to the
|
|
62
|
+
service, which checks them (`checkGrant(grant, did, { recordsOnly: true })`,
|
|
63
|
+
and that the key's halves belong together) and keeps them sealed under a key
|
|
64
|
+
only the app's access token carries. Each call starts a node from what the token opens
|
|
65
|
+
(`startGrantedAgent`), in memory, reaching the always-on nodes and relays its
|
|
66
|
+
invites and spaces name at public addresses only, and the service's own
|
|
67
|
+
(`network.reach`, [node.md](node.md)). A write is done once the space's keepers have it
|
|
68
|
+
(`spaces.kept`), and the key's places, the one thing kept, outlast the node. Nothing new goes over the wire between the home and the
|
|
69
|
+
page. See `packages/cli/README.md`, Agents.
|
|
70
|
+
|
|
59
71
|
## Connecting at your account home
|
|
60
72
|
|
|
61
73
|
The code, the channel it opens and the messages the two sides trade are
|
|
@@ -102,19 +114,19 @@ What the reference sides add:
|
|
|
102
114
|
with `checkGrant(grant, did, { recordsOnly: true })` before keeping it, and
|
|
103
115
|
again each time it starts, and says whose account it joined.
|
|
104
116
|
- The terminal makes a new key for each connect. Connecting again, after a
|
|
105
|
-
disconnect or to renew, gives a new key and note; a running `minca
|
|
117
|
+
disconnect or to renew, gives a new key and note; a running `minca agent`
|
|
106
118
|
takes them up without a restart. The earlier connection stays in the
|
|
107
119
|
account home until it is disconnected there, and nothing can use it: its
|
|
108
120
|
key is gone from the computer.
|
|
109
121
|
- An app only says how: "Connect an agent" in the example app shows the
|
|
110
122
|
command (`apps/example/src/components/ConnectAgent.tsx`).
|
|
111
123
|
|
|
112
|
-
_Source: `packages/core/src/session/connect-code.ts`, `packages/cli/src/agent.ts` (`connectAgent`, `openInBrowser`, `startAgentNode`, `reloadOnConnect`), `packages/cli/src/main.ts` (`chooseAccountHome`), `
|
|
124
|
+
_Source: `packages/core/src/session/connect-code.ts`, `packages/cli/src/agent.ts` (`connectAgent`, `openInBrowser`, `startAgentNode`, `reloadOnConnect`), `packages/cli/src/main.ts` (`chooseAccountHome`), `apps/home/src/components/ConnectPage.tsx`. Tests: `packages/core/tests/connect-code.test.ts`, `packages/core/tests/records-only.test.ts` ("a program connected by code, through the account home"), `packages/cli/tests/agent-reconnect.test.ts`, `packages/cli/tests/cli-agent.test.ts`._
|
|
113
125
|
|
|
114
126
|
## Tools an agent gets
|
|
115
127
|
|
|
116
128
|
`node_info`, `spaces_list`, `spaces_status`, `spaces_preview_invite`, `spaces_access`, `spaces_profiles`,
|
|
117
|
-
`collections_list`, `records_query`, `
|
|
129
|
+
`collections_list`, `records_query`, `records_get`,
|
|
118
130
|
`records_linked`, `records_history`, `records_can`, `records_put`,
|
|
119
131
|
`records_update`, `records_delete`, `activity_set` (what it is doing, for
|
|
120
132
|
people to see), and for new collections: `collections_standard`,
|
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,6 +163,11 @@ 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
|
+
**The launcher's order.** The launcher is in one order for everyone in the
|
|
167
|
+
space (each record's `position`). The example app opens a space on its
|
|
168
|
+
Overview, which lists the apps in that order. A new group starts with Chat,
|
|
169
|
+
and so does a new space for two, which the one asking makes.
|
|
170
|
+
|
|
166
171
|
A screen reaches the page around it only through `window.minca`, and only for
|
|
167
172
|
its app's collections and the people in its space: it lists and writes
|
|
168
173
|
records as the person looking, asks what they may do (`can`), gets someone's
|
|
@@ -176,12 +181,39 @@ and reads a picture that one of the app's own records refers to (`file`),
|
|
|
176
181
|
or the whole file (`blob`), taking its type from the record rather than from
|
|
177
182
|
the screen.
|
|
178
183
|
|
|
184
|
+
**Settings and the network.** An app may ask for `settings`, like an API
|
|
185
|
+
key. Someone who may add apps fills them in once, from the open app, for
|
|
186
|
+
everyone in the space, and its screen reads them as `minca.settings`; nobody
|
|
187
|
+
else is asked. They live on the app's own record, so they stand only as it
|
|
188
|
+
does: a new version proposed without values keeps the ones the app has, and a
|
|
189
|
+
copy to another space carries none. The origins an app names in `network` are
|
|
190
|
+
allowed for everyone once it is added, as a workspace's admin adds an
|
|
191
|
+
integration: adding it is the consent. The ready-made Chat asks for a GIPHY
|
|
192
|
+
key, and shows its GIF button only once it has one.
|
|
193
|
+
|
|
194
|
+
**An app's icon.** A `launcher.app` may carry an `icon`: `{ "path": "M10 10…Z",
|
|
195
|
+
"colour": "coral" }`, the data of one SVG path on a 100 × 100 grid and one
|
|
196
|
+
of the shapes' colours (cobalt, coral, peach, sage, lilac, ink). The example
|
|
197
|
+
app draws it filled, in place of the shape the app would have otherwise, and
|
|
198
|
+
only when the path is path data and nothing else (commands, numbers and
|
|
199
|
+
separators, at most 4,000 characters), since it comes from other people; the
|
|
200
|
+
stored schema can't hold that rule, so the check is where it is drawn. The
|
|
201
|
+
guide asks an agent for one when it makes an app. Changing an icon is changing
|
|
202
|
+
the app, as any other field is; updating a ready-made app keeps the icon the
|
|
203
|
+
space gave it.
|
|
204
|
+
|
|
179
205
|
**Opening a record where it belongs.** A `launcher.app` may name, among its
|
|
180
206
|
`collections`, the ones it `shows`: the ones whose records it is the place
|
|
181
|
-
to open (`shows: ["std.message"]` for a chat).
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
207
|
+
to open (`shows: ["std.message"]` for a chat). An entry may name a kind of
|
|
208
|
+
one too, `collection:kind`, for the records of that collection whose `kind`
|
|
209
|
+
field holds it: `std.list:tab` for Bills' tabs, `std.work:book` for a
|
|
210
|
+
reading app, or a `kind` in an app's own collection. Lists are folders,
|
|
211
|
+
albums and tabs as well as checklists, and each belongs in a different app. Whatever asks the example app to open a record, a screen's
|
|
212
|
+
`open` or a link beside a record, goes to the app that shows it, those
|
|
213
|
+
naming its kind before those naming only its collection: the one open, if
|
|
214
|
+
it does, else the only one, else the one the person picks when asked. So
|
|
215
|
+
a Bills tab shared in a chat opens in Bills, a Files category in Files, and
|
|
216
|
+
any other list in Lists. That app's
|
|
185
217
|
screen is handed the record's key (`minca.shown`, `minca.onShow`, the kit's
|
|
186
218
|
`useShown`) to scroll to or open, but only of a collection it shows, which
|
|
187
219
|
it could list anyway. That app does learn which of those records the person
|
|
@@ -251,7 +283,7 @@ defines its collections and writes a copy of it, naming where it came from
|
|
|
251
283
|
(`template: "kanban"`), and from then on the space changes its copy like any
|
|
252
284
|
other app.
|
|
253
285
|
|
|
254
|
-
_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 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")._
|
|
286
|
+
_Source: `apps/example/src/components/apps/launcher.ts` (`addTemplate`, `iconOf`, `showsRecord`, `saveSettings`, `settingsOf`), `apps/example/src/components/apps/entries.ts` (`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` ("an app's own icon is drawn only as path data in a shape colour, and outlives an update of its ready-made app", "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 record opens in the apps that name it most closely: its kind, then its collection", "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")._
|
|
255
287
|
|
|
256
288
|
## Describing a collection
|
|
257
289
|
|
package/docs/building-an-app.md
CHANGED
|
@@ -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) => {
|
|
@@ -69,7 +69,7 @@ element and as a React component.
|
|
|
69
69
|
import { createMincaAuth } from '@minca/core/session';
|
|
70
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
|
|
|
@@ -148,6 +148,9 @@ All from `@minca/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` |
|
package/docs/collections.md
CHANGED
|
@@ -105,7 +105,7 @@ enforced on arrival, because two peers may have seen different versions of a
|
|
|
105
105
|
definition ([spec 02 §9.6](https://github.com/leifriksheim/minca/blob/main/spec/02-records.md)).
|
|
106
106
|
Rules, below, are enforced everywhere.
|
|
107
107
|
|
|
108
|
-
_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")._
|
|
109
109
|
|
|
110
110
|
## Links
|
|
111
111
|
|
|
@@ -135,7 +135,7 @@ Like a schema, link declarations are checked when you write: the node refuses
|
|
|
135
135
|
to sign links that don't conform. A record that arrives with links that
|
|
136
136
|
don't conform is kept and comes back with `conforms: false`.
|
|
137
137
|
|
|
138
|
-
_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")._
|
|
139
139
|
|
|
140
140
|
## Rules
|
|
141
141
|
|
|
@@ -399,7 +399,7 @@ differ, `collections.list` leaves it out and its records are judged by no
|
|
|
399
399
|
rules
|
|
400
400
|
([spec 02 §6.3](https://github.com/leifriksheim/minca/blob/main/spec/02-records.md)).
|
|
401
401
|
|
|
402
|
-
_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")._
|
|
403
403
|
|
|
404
404
|
## The standard library
|
|
405
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
|
@@ -97,7 +97,11 @@ moved to another reader's slot.
|
|
|
97
97
|
with `text: null` for one this node can't open.
|
|
98
98
|
|
|
99
99
|
They need the account's member key for the space. An agent isn't given it, so
|
|
100
|
-
an agent may only ask `reachable`.
|
|
100
|
+
an agent may only ask `reachable` through `node.direct`. That is the library's
|
|
101
|
+
refusal, not sealing: an app or program granted the whole account holds the
|
|
102
|
+
account key every member key derives from, and one granted a private space
|
|
103
|
+
holds its member key, so either can open the account's direct messages there
|
|
104
|
+
with code of its own ([threat model §3.6](../../../spec/threat-model.md)). A bot is an account of its own and holds
|
|
101
105
|
one, so it reads and sends them like anyone: the actions `direct_list` and
|
|
102
106
|
`direct_send` ([actions](actions.md)) are offered to bots, not to agents,
|
|
103
107
|
and an automation set off by a direct message hands the bot the message opened.
|
|
@@ -107,7 +111,7 @@ _Source:_ `packages/core/src/node/actions.ts` (`direct_list`, `direct_send`),
|
|
|
107
111
|
(`openTrigger`, `ruleContext`). Tests: `packages/core/tests/direct.test.ts`
|
|
108
112
|
("the direct message actions"), `packages/cli/tests/agent-automations.test.ts`.
|
|
109
113
|
|
|
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` (`
|
|
114
|
+
_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/DirectMessages.tsx`. Tests: `packages/core/tests/direct.test.ts`, `packages/core/tests/records-only.test.ts` ("neither sends nor reads direct messages")._
|
|
111
115
|
|
|
112
116
|
## Planned: direct messages in public spaces
|
|
113
117
|
|
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).
|