@minca/core 0.1.17 → 0.1.18
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 +2 -0
- 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/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/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/auth.d.ts +7 -3
- package/dist/session/auth.d.ts.map +1 -1
- package/dist/session/auth.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 +74 -163
- 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 +1072 -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 +496 -418
- package/docs/spaces.md +261 -246
- package/docs/standard-library.md +473 -526
- package/docs/storage.md +325 -348
- package/docs/usernames.md +164 -97
- package/docs/warrants.md +100 -67
- package/package.json +1 -1
package/docs/agents.md
CHANGED
|
@@ -1,198 +1,229 @@
|
|
|
1
1
|
# Agents
|
|
2
2
|
|
|
3
|
-
An agent
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
(`/record`), so every peer refuses it defining collections, changing who
|
|
7
|
-
may do what, or writing for the account ([spec 01 §8](https://github.com/leifriksheim/minca/blob/main/spec/01-identity.md)).
|
|
8
|
-
What it writes counts as the person's, and carries `recordsOnly: true`
|
|
9
|
-
everywhere, which apps may show (the example app says "via agent"). It never
|
|
10
|
-
gets the seed.
|
|
11
|
-
|
|
12
|
-
An agent that is its own user, such as a community's bot, is an account of
|
|
13
|
-
its own instead (see Bots, below).
|
|
3
|
+
An agent can read and write in a person's spaces as them. It might be Claude
|
|
4
|
+
in a chat app, a coding agent in your terminal, or a program you write. This
|
|
5
|
+
page shows how to connect one, and what it may do once it is in.
|
|
14
6
|
|
|
15
|
-
##
|
|
16
|
-
|
|
17
|
-
Every node operation is in `NODE_ACTIONS`: a name, a sentence and a JSON
|
|
18
|
-
Schema for its input. The CLI, the MCP server and the browser's WebMCP tools
|
|
19
|
-
are all generated from it.
|
|
7
|
+
## From a chat app
|
|
20
8
|
|
|
21
|
-
|
|
22
|
-
|
|
9
|
+
The simplest way is Minca's MCP service. Add it to your chat app by its
|
|
10
|
+
address:
|
|
23
11
|
|
|
24
|
-
|
|
12
|
+
```bash
|
|
13
|
+
claude mcp add --transport http minca https://mcp.minca.social/mcp
|
|
25
14
|
```
|
|
26
15
|
|
|
27
|
-
|
|
28
|
-
|
|
16
|
+
[minca.social/mcp](https://minca.social/mcp) has one-click links for Claude
|
|
17
|
+
and Cursor. The app opens a page where you sign in at your account home and
|
|
18
|
+
pick the spaces it may use, up to 8. The access lasts 30 days. Then its
|
|
19
|
+
tools arrive, and the chat app's own
|
|
20
|
+
model does the thinking.
|
|
29
21
|
|
|
30
|
-
|
|
22
|
+
How the service works, and how to run your own, is under
|
|
23
|
+
[The MCP service](#the-mcp-service) below.
|
|
31
24
|
|
|
32
|
-
From
|
|
25
|
+
## From a terminal
|
|
26
|
+
|
|
27
|
+
An agent with a shell, like Claude Code, Codex or Cursor's agent, uses
|
|
28
|
+
Minca through the `minca` command. Connect it once:
|
|
33
29
|
|
|
34
30
|
```bash
|
|
35
31
|
npx @minca/cli connect
|
|
36
32
|
```
|
|
37
33
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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).
|
|
50
|
-
|
|
51
|
-
`minca agent` runs the same agent without a chat client: it chats in the
|
|
52
|
-
terminal and thinks with the person's own Anthropic API key, offering the model
|
|
53
|
-
the same tools. See `packages/cli/README.md`.
|
|
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.
|
|
34
|
+
Your browser opens your account home. Sign in, or make an account, and allow
|
|
35
|
+
it. The home shows six digits to type into the terminal, and the agent keeps
|
|
36
|
+
its access only once they match.
|
|
70
37
|
|
|
71
|
-
|
|
38
|
+
From then on, every `minca spaces …` and `minca records …` command on this
|
|
39
|
+
computer runs as the agent, unless `--account` names an account. Tell your
|
|
40
|
+
agent to start with `minca help`. Each command catches up with the space's
|
|
41
|
+
always-on nodes before it acts, and refuses when it can't.
|
|
72
42
|
|
|
73
|
-
The
|
|
74
|
-
protocol, and know nothing of agents
|
|
75
|
-
([spec 06 §3](https://github.com/leifriksheim/minca/blob/main/spec/06-nodes-and-sessions.md)).
|
|
76
|
-
The library's two sides are `connectWithCode` (the program) and
|
|
77
|
-
`receiveConnectCode` (the account home).
|
|
43
|
+
The details are in [the CLI's README](https://github.com/leifriksheim/minca/blob/main/packages/cli/README.md#agents).
|
|
78
44
|
|
|
79
|
-
|
|
80
|
-
to open: `https://home.minca.social/connect#mc_…`.
|
|
81
|
-
- `connectWithCode({ home, code, key, name, network, check, onWaiting? })`
|
|
82
|
-
waits in the code's room, signs the proof once it learns the home's origin
|
|
83
|
-
(`keyProof(key, { via: 'code', recordsOnly: true, origin })`), tells
|
|
84
|
-
`onWaiting({ origin })` when the home has heard, and keeps only a
|
|
85
|
-
records-only note made out to its key, once `check(matches)` has had the
|
|
86
|
-
person give the six digits the home showed.
|
|
87
|
-
- `receiveConnectCode({ code, relays, onAnswered? })`, on the home's connect
|
|
88
|
-
page, answers the program and gives back the same `IncomingRequest` an
|
|
89
|
-
app's popup does: records only, in the whole account, for 30 days, with
|
|
90
|
-
`check`, the six digits to show.
|
|
91
|
-
`connectCodeIn(location.hash)` finds the code. `answerConnectCode` is the
|
|
92
|
-
same exchange without the request around it.
|
|
93
|
-
|
|
94
|
-
What the reference sides add:
|
|
45
|
+
## Helping you build an app
|
|
95
46
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
`
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
`
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
An agent that runs by itself (`minca agent`) also runs the person's
|
|
148
|
-
automations ([automations.md](automations.md)), and does what those that ask
|
|
149
|
-
it say: when some records come to be a certain way, or at set times. An agent
|
|
47
|
+
These docs ship inside `@minca/core`, matched to the installed version. A
|
|
48
|
+
coding agent in your repository finds them at
|
|
49
|
+
`node_modules/@minca/core/docs/`. One line pointing there in your
|
|
50
|
+
project's `AGENTS.md` or `CLAUDE.md` is enough.
|
|
51
|
+
|
|
52
|
+
## What an agent may do
|
|
53
|
+
|
|
54
|
+
An agent gets a note from the person's account that lets it write records
|
|
55
|
+
and nothing more. It never gets the account's keys. Every peer refuses an
|
|
56
|
+
agent that tries to define collections, change who may do what, or write for
|
|
57
|
+
the account.
|
|
58
|
+
|
|
59
|
+
What it writes counts as the person's. Each record carries
|
|
60
|
+
`recordsOnly: true`, which apps may show. The example app says "via agent".
|
|
61
|
+
|
|
62
|
+
The note's format is in [spec 01 §8](https://github.com/leifriksheim/minca/blob/main/spec/01-identity.md).
|
|
63
|
+
|
|
64
|
+
## The tools
|
|
65
|
+
|
|
66
|
+
An agent gets the same tools from the CLI, the MCP service and WebMCP: the
|
|
67
|
+
node's actions that read spaces and records, write records, say what it is
|
|
68
|
+
doing, and propose collections. Each one, with what it takes, is in
|
|
69
|
+
[the list of actions](https://minca.dev/automations/actions/#the-list).
|
|
70
|
+
|
|
71
|
+
The MCP service leaves out `spaces_preview_invite`, which would have it dial
|
|
72
|
+
addresses a caller chose. `records_query` takes the same JSON query as `node.records.query`
|
|
73
|
+
([Records and queries](records-and-queries.md)).
|
|
74
|
+
|
|
75
|
+
A bot also gets `direct_list` and `direct_send`. It holds its own member key,
|
|
76
|
+
and an agent isn't given the person's ([Direct messages](direct-messages.md)).
|
|
77
|
+
|
|
78
|
+
## Making something new
|
|
79
|
+
|
|
80
|
+
An agent can't define collections, so it proposes the ones it needs with
|
|
81
|
+
`collections_propose`. Someone who may define collections reads what the
|
|
82
|
+
proposal would do, and applies it. A person whose role can't define
|
|
83
|
+
collections works the same way.
|
|
84
|
+
|
|
85
|
+
`collections_list` points at the guides a space's apps wrote (`std.guide`),
|
|
86
|
+
which say how they want new things proposed there. See
|
|
87
|
+
[Proposing collections](proposing-collections.md).
|
|
88
|
+
|
|
89
|
+
## An agent in the terminal: `minca agent`
|
|
90
|
+
|
|
91
|
+
`minca agent` runs the same agent without a chat app. It chats in the
|
|
92
|
+
terminal and thinks with your own Anthropic API key. With
|
|
93
|
+
`--provider openai` it uses any server that speaks OpenAI's Chat Completions,
|
|
94
|
+
including a model on your own machine.
|
|
95
|
+
|
|
96
|
+
It also runs the person's [automations](automations.md): when some records
|
|
97
|
+
come to be a certain way, or at set times, it does what they say. An agent
|
|
150
98
|
may write an automation when asked, but it runs only once the person has
|
|
151
99
|
saved it themselves.
|
|
152
100
|
|
|
153
|
-
|
|
154
|
-
speaks OpenAI's Chat Completions, including a model on your own machine
|
|
155
|
-
(`--provider openai`; see `packages/cli/README.md`).
|
|
101
|
+
See the [CLI's README](https://github.com/leifriksheim/minca/blob/main/packages/cli/README.md).
|
|
156
102
|
|
|
157
103
|
## Bots
|
|
158
104
|
|
|
159
|
-
A bot is
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
105
|
+
A bot is an agent that is its own account. People invite it to their spaces
|
|
106
|
+
as a member. It writes as itself, is checked against its role like any
|
|
107
|
+
member, and is mentioned by its account's name.
|
|
108
|
+
|
|
109
|
+
The usual way to have one is to let the community's host run it
|
|
110
|
+
(`node.hosting.startBot`). An admin picks its name and role in the app, and
|
|
111
|
+
the host makes its account and joins. The community pays for it as it pays
|
|
112
|
+
for hosting. The host thinks with its own model key, within a daily cap per
|
|
113
|
+
bot. It holds the bot's keys, so it can read what the bot can read.
|
|
114
|
+
|
|
115
|
+
`minca agent --bot` runs the same bot yourself, with your own model key.
|
|
116
|
+
|
|
117
|
+
A bot runs the automations that name it in `by`, written by members granted
|
|
118
|
+
`/std.automation/instruct`. Where a space keeps `std.profile`, the bot marks
|
|
119
|
+
itself `bot: true` there as soon as the definition arrives, and adds
|
|
120
|
+
`std.profile` itself where its role may add collections. Apps list bots from
|
|
121
|
+
that, so a space without `std.profile` shows none.
|
|
122
|
+
|
|
123
|
+
See [Bots](bots.md), [who runs an automation](automations.md#who-runs-an-automation)
|
|
124
|
+
and the [standard library](standard-library.md). Hosted bots are in
|
|
125
|
+
[spec 08 §3](https://github.com/leifriksheim/minca/blob/main/spec/08-hosting.md).
|
|
126
|
+
|
|
127
|
+
## Every operation, described once
|
|
128
|
+
|
|
129
|
+
Every node operation is in `NODE_ACTIONS`, with a name, a sentence and a JSON
|
|
130
|
+
Schema for its input. The CLI, the MCP service and WebMCP tools are all made
|
|
131
|
+
from it. You can run one by name:
|
|
132
|
+
|
|
133
|
+
```typescript
|
|
134
|
+
import { runAction } from '@minca/core';
|
|
135
|
+
|
|
136
|
+
await runAction(node, 'records_put', {
|
|
137
|
+
space: space.id,
|
|
138
|
+
collection: 'app.todo.item',
|
|
139
|
+
body: { text: 'milk' },
|
|
140
|
+
});
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
See [Actions](actions.md).
|
|
178
144
|
|
|
179
145
|
## In your own code
|
|
180
146
|
|
|
181
|
-
`node.asAgent({ keys, note })` gives the same node acting as an agent, from
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
holds, as code, should trust only records without it.
|
|
147
|
+
`node.asAgent({ keys, note })` gives the same node acting as an agent, from
|
|
148
|
+
a records-only note the account home issued. Everything it writes is signed
|
|
149
|
+
under that note, and carries `recordsOnly: true`. An app that runs what a
|
|
150
|
+
record holds as code should trust only records without it.
|
|
186
151
|
|
|
187
152
|
Records don't say which program wrote them, only that its note grants
|
|
188
|
-
records only.
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
153
|
+
records only. A name would be the program's own word, not proof. An app that
|
|
154
|
+
wants to show one can keep its own list of connected programs by key, as the
|
|
155
|
+
account home does.
|
|
156
|
+
|
|
157
|
+
## The MCP service
|
|
158
|
+
|
|
159
|
+
`minca mcp-server` is the service chat apps connect to. It has an MCP
|
|
160
|
+
endpoint at `/mcp`, and apps sign in with OAuth.
|
|
161
|
+
|
|
162
|
+
The consent page the app opens is an app like any other to the account home.
|
|
163
|
+
It makes a key in the browser and asks for a records-only note in the spaces
|
|
164
|
+
the person picks, with `connectToHome`. It hands the key and note to the
|
|
165
|
+
service. The service checks them with
|
|
166
|
+
`checkGrant(grant, did, { recordsOnly: true })`, and keeps them sealed under
|
|
167
|
+
a key only the app's access token carries.
|
|
192
168
|
|
|
193
|
-
|
|
169
|
+
Each call starts a node in memory from what the token opens
|
|
170
|
+
(`startGrantedAgent`). It reaches only the always-on nodes and relays the
|
|
171
|
+
person's invites and spaces name at public addresses, and the service's own
|
|
172
|
+
(`network.reach`, see [The node](node.md)). A write is done once the space's
|
|
173
|
+
keepers have it (`spaces.kept`). The one thing kept between calls is where
|
|
174
|
+
the key has signed, so the next node doesn't sign at a place it used.
|
|
194
175
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
176
|
+
Nothing new goes over the wire between the home and the page. See
|
|
177
|
+
[the CLI's README](https://github.com/leifriksheim/minca/blob/main/packages/cli/README.md#agents).
|
|
178
|
+
|
|
179
|
+
## Connecting at your account home
|
|
180
|
+
|
|
181
|
+
`minca connect` uses a one-time code to reach the account home. The code,
|
|
182
|
+
the channel it opens and the messages sent over it are protocol, and know
|
|
183
|
+
nothing of agents ([spec 06 §3](https://github.com/leifriksheim/minca/blob/main/spec/06-nodes-and-sessions.md)).
|
|
184
|
+
|
|
185
|
+
The program's side is `connectWithCode`, and the account home's is
|
|
186
|
+
`receiveConnectCode`:
|
|
187
|
+
|
|
188
|
+
- `newConnectCode()` makes a code, and `connectCodeUrl(home, code)` the link
|
|
189
|
+
to open: `https://home.minca.social/connect#mc_…`.
|
|
190
|
+
- [`connectWithCode`](https://minca.dev/api/session/functions/connectWithCode/)
|
|
191
|
+
waits in the code's room. Once it learns the home's origin, it signs the
|
|
192
|
+
proof (`keyProof(key, { via: 'code', recordsOnly: true, origin })`) and
|
|
193
|
+
calls `onWaiting({ origin })`. It keeps a records-only note made out to its
|
|
194
|
+
key only after `check(matches)` has had the person enter the six digits.
|
|
195
|
+
- [`receiveConnectCode`](https://minca.dev/api/session/functions/receiveConnectCode/) runs on the home's
|
|
196
|
+
connect page. It answers the program and returns the same
|
|
197
|
+
`IncomingRequest` an app's popup does: records only, in the whole account,
|
|
198
|
+
for 30 days, with `check`, the six digits to show.
|
|
199
|
+
- `connectCodeIn(location.hash)` finds the code in the address.
|
|
200
|
+
`answerConnectCode` is the same exchange without the request around it.
|
|
201
|
+
|
|
202
|
+
### What the CLI and the account home add
|
|
203
|
+
|
|
204
|
+
- The terminal asks which account home to open, with home.minca.social, or
|
|
205
|
+
the one used last, filled in. `--account-home` or `MINCA_ACCOUNT_HOME`
|
|
206
|
+
answers ahead. Where nothing can be asked, it uses the usual one. The MCP
|
|
207
|
+
server's connect tool takes no home, so the model never chooses where the
|
|
208
|
+
person signs in.
|
|
209
|
+
- It opens the link in the browser, and shows it only when no browser opens,
|
|
210
|
+
like on a server or over SSH. Whoever else holds the link could answer as
|
|
211
|
+
the home. The link works from any device.
|
|
212
|
+
- `connectWithCode` asks only the home it opened, and keeps that home in the
|
|
213
|
+
grant, whatever the answer names. It prints the account's DID beside its
|
|
214
|
+
name.
|
|
215
|
+
- The home takes the code out of the address bar and shows the program's name. It says to allow it only if
|
|
216
|
+
the person started it just now. Once answered, it says so and the tab can
|
|
217
|
+
be closed. If no program asks within a minute, it says the link was used
|
|
218
|
+
or has run out.
|
|
219
|
+
- The terminal waits 10 minutes for the home to open, since the person may
|
|
220
|
+
make an account first, then 30 minutes for the answer. It checks the grant
|
|
221
|
+
with `checkGrant(grant, did, { recordsOnly: true })` before keeping it and
|
|
222
|
+
each time it starts, and says whose account it joined.
|
|
223
|
+
- Each connect makes a new key. Connecting again, to renew or after a
|
|
224
|
+
disconnect, gives a new key and note, and a running `minca agent` picks
|
|
225
|
+
them up without a restart. The earlier connection stays in the account
|
|
226
|
+
home until it is disconnected there, but nothing can use it: its key is
|
|
227
|
+
gone from the computer.
|
|
228
|
+
- An app only says how. "Connect an agent" in the example app shows the
|
|
229
|
+
command.
|