@minca/core 0.1.17 โ 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/files/space-files.d.ts +2 -2
- package/dist/files/space-files.d.ts.map +1 -1
- package/dist/files/space-files.js +7 -5
- package/dist/files/space-files.js.map +1 -1
- package/dist/inbox/names.d.ts +1 -1
- package/dist/inbox/names.js +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/node/actions.d.ts +3 -0
- package/dist/node/actions.d.ts.map +1 -1
- package/dist/node/actions.js.map +1 -1
- package/dist/node/api.d.ts +1 -0
- package/dist/node/api.d.ts.map +1 -1
- package/dist/node/api.js +1 -0
- package/dist/node/api.js.map +1 -1
- package/dist/node/carrier.js +1 -1
- package/dist/node/carrier.js.map +1 -1
- package/dist/node/index.d.ts +1 -1
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/node-contacts.d.ts.map +1 -1
- package/dist/node/node-contacts.js +1 -0
- package/dist/node/node-contacts.js.map +1 -1
- package/dist/node/node-records.d.ts.map +1 -1
- package/dist/node/node-records.js +6 -1
- package/dist/node/node-records.js.map +1 -1
- package/dist/node/node.d.ts.map +1 -1
- package/dist/node/node.js +13 -1
- package/dist/node/node.js.map +1 -1
- package/dist/node/remote.d.ts.map +1 -1
- package/dist/node/remote.js +7 -1
- package/dist/node/remote.js.map +1 -1
- package/dist/node/space-runtime.d.ts +5 -3
- package/dist/node/space-runtime.d.ts.map +1 -1
- package/dist/node/space-runtime.js +3 -1
- package/dist/node/space-runtime.js.map +1 -1
- package/dist/node/types.d.ts +112 -36
- package/dist/node/types.d.ts.map +1 -1
- package/dist/node/watch-notifications.d.ts +6 -0
- package/dist/node/watch-notifications.d.ts.map +1 -1
- package/dist/node/watch-notifications.js +47 -9
- package/dist/node/watch-notifications.js.map +1 -1
- package/dist/query/types.d.ts +1 -0
- package/dist/query/types.d.ts.map +1 -1
- package/dist/query/types.js.map +1 -1
- package/dist/records/contract-builder.d.ts +22 -6
- package/dist/records/contract-builder.d.ts.map +1 -1
- package/dist/records/contract-builder.js.map +1 -1
- package/dist/schemas/automations.d.ts +6 -2
- package/dist/schemas/automations.d.ts.map +1 -1
- package/dist/schemas/automations.js.map +1 -1
- package/dist/schemas/connectors.d.ts +4 -3
- package/dist/schemas/connectors.d.ts.map +1 -1
- package/dist/schemas/connectors.js +4 -3
- package/dist/schemas/connectors.js.map +1 -1
- package/dist/schemas/library/media.js +1 -1
- package/dist/schemas/library/media.js.map +1 -1
- package/dist/session/account-hint.d.ts +2 -2
- package/dist/session/account-hint.d.ts.map +1 -1
- package/dist/session/account-hint.js +3 -3
- package/dist/session/account-hint.js.map +1 -1
- package/dist/session/auth.d.ts +7 -3
- package/dist/session/auth.d.ts.map +1 -1
- package/dist/session/auth.js.map +1 -1
- package/dist/session/connection.d.ts +18 -0
- package/dist/session/connection.d.ts.map +1 -1
- package/dist/session/connection.js +11 -0
- package/dist/session/connection.js.map +1 -1
- package/dist/session/index.d.ts +2 -2
- package/dist/session/index.d.ts.map +1 -1
- package/dist/session/index.js +2 -2
- package/dist/session/index.js.map +1 -1
- package/dist/storage/blob-store.d.ts +3 -0
- package/dist/storage/blob-store.d.ts.map +1 -1
- package/dist/types.d.ts +11 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/docs/README.md +86 -93
- package/docs/actions.md +213 -152
- package/docs/agents.md +198 -167
- package/docs/automations.md +296 -204
- package/docs/blueprints-and-guides.md +405 -311
- package/docs/bots.md +208 -134
- package/docs/building-an-app.md +86 -159
- package/docs/collections.md +248 -328
- package/docs/computed.md +112 -89
- package/docs/contacts.md +151 -112
- package/docs/contracts.md +299 -120
- package/docs/direct-messages.md +80 -65
- package/docs/inbox.md +138 -93
- package/docs/node.md +1081 -996
- package/docs/permissions.md +142 -0
- package/docs/proposing-collections.md +74 -55
- package/docs/query-format.md +150 -126
- package/docs/records-and-queries.md +205 -126
- package/docs/sign-in.md +487 -416
- package/docs/spaces.md +261 -246
- package/docs/standard-library.md +487 -526
- package/docs/storage.md +325 -348
- package/docs/usernames.md +164 -97
- package/docs/warrants.md +100 -67
- package/package.json +1 -6
- package/dist/elements/auth-styles.d.ts +0 -18
- package/dist/elements/auth-styles.d.ts.map +0 -1
- package/dist/elements/auth-styles.js +0 -206
- package/dist/elements/auth-styles.js.map +0 -1
- package/dist/elements/dom.d.ts +0 -29
- package/dist/elements/dom.d.ts.map +0 -1
- package/dist/elements/dom.js +0 -91
- package/dist/elements/dom.js.map +0 -1
- package/dist/elements/index.d.ts +0 -13
- package/dist/elements/index.d.ts.map +0 -1
- package/dist/elements/index.js +0 -11
- package/dist/elements/index.js.map +0 -1
- package/dist/elements/minca-auth.d.ts +0 -55
- package/dist/elements/minca-auth.d.ts.map +0 -1
- package/dist/elements/minca-auth.js +0 -768
- package/dist/elements/minca-auth.js.map +0 -1
package/docs/README.md
CHANGED
|
@@ -1,114 +1,107 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Understanding Minca
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
Minca apps keep their data in spaces that people own, not on a server you
|
|
4
|
+
run. This page explains the few ideas everything else builds on. Read it
|
|
5
|
+
first, then [build a small app](building-an-app.md).
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
specified in `spec/` in the repository: https://github.com/leifriksheim/minca/tree/main/spec
|
|
7
|
+
These docs ship inside `@minca/core`, so they always match the version you
|
|
8
|
+
have installed. An agent working in your app's repository finds them at
|
|
9
|
+
`node_modules/@minca/core/docs/`.
|
|
11
10
|
|
|
12
11
|
## The model in ten lines
|
|
13
12
|
|
|
14
|
-
- An **account** is a
|
|
15
|
-
- A **
|
|
16
|
-
|
|
17
|
-
- A **
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
- **
|
|
32
|
-
|
|
33
|
-
device works them out from what it holds: a view, where a contract is a
|
|
34
|
-
verdict.
|
|
35
|
-
- **Queries** are plain JSON: Mongo-style filters, sorting, paging, and
|
|
36
|
-
`include` to follow links. Name the collection by its definition and
|
|
37
|
-
`where` and `sort` are typed: a misspelled field is a compile error.
|
|
13
|
+
- An **account** is a person. Its keys stay with them, and your app never sees them.
|
|
14
|
+
- A **space** is a shared place: who is in it, what each of them may do, and
|
|
15
|
+
the data. Private spaces are encrypted end to end.
|
|
16
|
+
- A **collection** is a kind of record in a space, like `app.todo.item`.
|
|
17
|
+
- A **record** is a signed piece of JSON. Editing it makes a new version.
|
|
18
|
+
- A **role** says what its members may write. Every device checks every
|
|
19
|
+
record it receives, so there is no server to trust.
|
|
20
|
+
- A **node** (`createNode`) does all of this for you: it signs, stores, checks and syncs.
|
|
21
|
+
|
|
22
|
+
That's the whole model. A few more ideas build on it, and each has its own
|
|
23
|
+
page when you need it:
|
|
24
|
+
|
|
25
|
+
- **Rules** and **contracts** say what a collection's records must keep to,
|
|
26
|
+
like whose turn it is. See [Collections](collections.md) and
|
|
27
|
+
[Contracts](contracts.md).
|
|
28
|
+
- **Computed fields** are values worked out from what links to a record,
|
|
29
|
+
like "done once two people react ๐". See [Computed fields](computed.md).
|
|
30
|
+
- **Queries** are plain JSON, and typed when you pass a collection. See
|
|
31
|
+
[Records and queries](records-and-queries.md).
|
|
38
32
|
|
|
39
33
|
## Guides
|
|
40
34
|
|
|
41
|
-
| Guide | Read it to
|
|
42
|
-
| ---------------------------------------------------- |
|
|
43
|
-
| [building-an-app.md](building-an-app.md) |
|
|
44
|
-
| [collections.md](collections.md) | Say what your data is and who may
|
|
45
|
-
| [records-and-queries.md](records-and-queries.md) | Write, edit, delete, query and watch records
|
|
46
|
-
| [proposing-collections.md](proposing-collections.md) |
|
|
47
|
-
| [agents.md](agents.md) | Let an agent read and write as the person
|
|
35
|
+
| Guide | Read it to |
|
|
36
|
+
| ---------------------------------------------------- | -------------------------------------------- |
|
|
37
|
+
| [building-an-app.md](building-an-app.md) | Build a small to-do app |
|
|
38
|
+
| [collections.md](collections.md) | Say what your data is, and who may change it |
|
|
39
|
+
| [records-and-queries.md](records-and-queries.md) | Write, edit, delete, query and watch records |
|
|
40
|
+
| [proposing-collections.md](proposing-collections.md) | Add collections to a space with no deploy |
|
|
41
|
+
| [agents.md](agents.md) | Let an agent read and write as the person |
|
|
48
42
|
|
|
49
43
|
## Reference
|
|
50
44
|
|
|
51
|
-
What the library does, in full. None of it is protocol
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
|
58
|
-
|
|
|
59
|
-
| [
|
|
60
|
-
| [
|
|
61
|
-
| [
|
|
62
|
-
| [
|
|
63
|
-
| [
|
|
64
|
-
| [
|
|
65
|
-
| [
|
|
66
|
-
| [
|
|
67
|
-
| [
|
|
68
|
-
| [
|
|
69
|
-
| [
|
|
70
|
-
| [
|
|
71
|
-
| [
|
|
72
|
-
| [
|
|
73
|
-
| [
|
|
74
|
-
| [
|
|
75
|
-
| [warrants.md](warrants.md) | `std.warrant`: proof that an account broke the protocol's rules
|
|
76
|
-
| [storage.md](storage.md) |
|
|
45
|
+
What the library does, in full. None of it is protocol, so another
|
|
46
|
+
implementation may do it differently and still sync. Some of it, like the
|
|
47
|
+
`std.*` collections, is a convention apps share: an app that ignores it still
|
|
48
|
+
syncs, but can't read what the others wrote.
|
|
49
|
+
|
|
50
|
+
| Page | Covers |
|
|
51
|
+
| ---------------------------------------------------- | ------------------------------------------------------------------------ |
|
|
52
|
+
| [node.md](node.md) | `createNode`: configuration, stores, events, the network, hosting, React |
|
|
53
|
+
| [sign-in.md](sign-in.md) | `createMincaAuth`: accounts, passkeys, staying signed in, pairing |
|
|
54
|
+
| [actions.md](actions.md) | The node's actions, and the CLI, MCP and WebMCP tools made from them |
|
|
55
|
+
| [query-format.md](query-format.md) | The JSON query format: filters, sort, paging, `include` |
|
|
56
|
+
| [standard-library.md](standard-library.md) | Every `std.*` collection |
|
|
57
|
+
| [direct-messages.md](direct-messages.md) | `std.direct`: text sealed for some members of a space |
|
|
58
|
+
| [blueprints-and-guides.md](blueprints-and-guides.md) | `std.blueprint` and `std.guide`: proposing, reviewing, updating |
|
|
59
|
+
| [computed.md](computed.md) | Values every app works out the same way from what links to a record |
|
|
60
|
+
| [contracts.md](contracts.md) | What a record must be to count, checked by every reader |
|
|
61
|
+
| [automations.md](automations.md) | `std.automation`: do something when records change, or at set times |
|
|
62
|
+
| [bots.md](bots.md) | Bots: who configures them, their instructions, connectors, GitHub |
|
|
63
|
+
| [calls](../../calls/README.md) | Voice and video calls in a space |
|
|
64
|
+
| [contacts.md](contacts.md) | `std.contact` and `node.contacts` |
|
|
65
|
+
| [inbox.md](inbox.md) | The inbox, and how a knock becomes a contact |
|
|
66
|
+
| [usernames.md](usernames.md) | `leif@minca.social`: looking up and claiming usernames |
|
|
67
|
+
| [spaces.md](spaces.md) | Making spaces, invites, profiles, the space manager |
|
|
68
|
+
| [permissions.md](permissions.md) | Roles, grants, presets, and who sits at the top |
|
|
69
|
+
| [warrants.md](warrants.md) | `std.warrant`: proof that an account broke the protocol's rules |
|
|
70
|
+
| [storage.md](storage.md) | Sync pacing, storage adapters, IndexedDB, data folders, blob stores |
|
|
71
|
+
|
|
72
|
+
The protocol itself, what goes over the wire and what every peer checks, is
|
|
73
|
+
in the [spec](https://github.com/leifriksheim/minca/tree/main/spec).
|
|
77
74
|
|
|
78
75
|
## Rules of thumb
|
|
79
76
|
|
|
80
|
-
- Import only from the package's entry points: `@minca/core
|
|
81
|
-
`/
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
77
|
+
- Import only from the package's entry points: `@minca/core` and its
|
|
78
|
+
`/session`, `/schemas`, `/elements`, `/storage` and `/inbox`, and
|
|
79
|
+
`@minca/react` for React.
|
|
80
|
+
- Name your collections `app.<yours>.<thing>`. `sys.*` belongs to the
|
|
81
|
+
protocol and `std.*` to the standard library.
|
|
82
|
+
- Before you define a reaction, comment, tag, message, task or poll, look in
|
|
83
|
+
the standard library (`@minca/core/schemas`). Using the same one is how two
|
|
84
|
+
apps see each other's data.
|
|
85
|
+
- Keep anything other people should see in records. Records are what syncs.
|
|
89
86
|
- A refused write throws with the reason in plain words. Show it, or check
|
|
90
87
|
first with `node.records.can` and hide the button.
|
|
91
88
|
|
|
92
89
|
## Planned in the library
|
|
93
90
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
- **
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
- **
|
|
102
|
-
|
|
103
|
-
- **Typed handles.**
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
- **
|
|
107
|
-
|
|
108
|
-
replaced by the planned `compare` ([02](https://github.com/leifriksheim/minca/blob/main/spec/02-records.md),
|
|
109
|
-
compatible definitions).
|
|
110
|
-
- **Asking for what a version cites.** A version pending on a cited version
|
|
111
|
-
from a collection this node doesn't hold, asking for it
|
|
91
|
+
The protocol's own plans are in [the spec](https://github.com/leifriksheim/minca/blob/main/spec/README.md).
|
|
92
|
+
In the library:
|
|
93
|
+
|
|
94
|
+
- **More typed queries.** Typed `where` inside an `include`, a misspelled
|
|
95
|
+
collection name as a compile error, types generated from a space's stored
|
|
96
|
+
definitions, and a warning in development when your schemas differ from
|
|
97
|
+
the space's.
|
|
98
|
+
- **More computed fields.** On `records.get` and `records.list`, and a
|
|
99
|
+
`linked()` that follows a record's own links.
|
|
100
|
+
- **Typed handles.** A collection bound to a space: `node.use(space, Poll)`.
|
|
101
|
+
- **Definitions that update themselves.** `useSchemas` and `applyBlueprint`
|
|
102
|
+
applying harmless changes on their own.
|
|
103
|
+
- **Asking for what a version cites**, when it comes from a collection this
|
|
104
|
+
node doesn't hold
|
|
112
105
|
([spec 09 ยง9](../../../spec/09-contracts.md#9-planned-asking-for-what-a-version-cites),
|
|
113
106
|
[#138](https://github.com/leifriksheim/minca/issues/138)).
|
|
114
|
-
- **Web components** for the standard
|
|
107
|
+
- **Web components** for the standard collections.
|