@glyphteck/veyl 0.56.0 → 0.58.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/dist/cli.js +137 -187
- package/dist/index.js +89 -122
- package/docs/agents.md +18 -16
- package/docs/api.md +21 -25
- package/docs/cli.md +13 -12
- package/docs/validation.md +1 -1
- package/examples/bot-fleet/readme.md +1 -1
- package/examples/bot-fleet/runtime.js +0 -1
- package/package.json +1 -1
- package/readme.md +13 -14
package/docs/api.md
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
```js
|
|
8
8
|
import {
|
|
9
9
|
API_VERSION,
|
|
10
|
-
TERMS_VERSION,
|
|
11
10
|
VERSION,
|
|
12
11
|
open,
|
|
13
12
|
} from '@glyphteck/veyl';
|
|
@@ -24,7 +23,7 @@ const veyl = await open({
|
|
|
24
23
|
|
|
25
24
|
The auth and account compositions consume explicit runtime ports and have no direct Node, Firebase-construction, Spark-construction, filesystem, machine-key, namespace-file, browser-process, or React dependency. The package's current high-level `open()` implementation comes from `src/runtime/node.js`, which supplies the Node ports. Web and iOS use `openAuth()` and `openAccount()` with their existing cloud, passkey-ceremony, vault crypto, Spark, cache, network, and diagnostics ports; React remains only a snapshot/lifecycle adapter.
|
|
26
25
|
|
|
27
|
-
Most product methods ensure login and vault unlock when
|
|
26
|
+
Most product methods ensure login and vault unlock when saved account and vault keys are available. Long-running callers should explicitly login/unlock once and call `close()` when finished.
|
|
28
27
|
|
|
29
28
|
## Graphical auth owner
|
|
30
29
|
|
|
@@ -48,7 +47,7 @@ const auth = openAuth({
|
|
|
48
47
|
},
|
|
49
48
|
});
|
|
50
49
|
|
|
51
|
-
await auth.register({ label
|
|
50
|
+
await auth.register({ label });
|
|
52
51
|
await auth.login({ uid });
|
|
53
52
|
const unsubscribeAuth = auth.subscribe((user) => console.log(user));
|
|
54
53
|
|
|
@@ -189,46 +188,46 @@ An unknown Spark send, payment-request payment, invoice payment, or withdrawal o
|
|
|
189
188
|
|
|
190
189
|
## Account
|
|
191
190
|
|
|
191
|
+
Creating an account accepts Veyl's [Terms](https://veyl.glyphteck.com/legal#terms) and [Community Rules](https://veyl.glyphteck.com/community-rules).
|
|
192
|
+
|
|
192
193
|
```js
|
|
193
|
-
await veyl.account.create({
|
|
194
|
+
const accountKey = await veyl.account.create({
|
|
194
195
|
username: 'runner',
|
|
195
196
|
network: 'REGTEST',
|
|
196
|
-
termsVersion: TERMS_VERSION,
|
|
197
|
-
saveCredential: true,
|
|
198
197
|
});
|
|
199
198
|
|
|
200
199
|
await veyl.account.login();
|
|
201
200
|
const local = await veyl.account.me();
|
|
202
201
|
const terms = await veyl.account.terms();
|
|
203
|
-
await veyl.account.acceptTerms(
|
|
202
|
+
await veyl.account.acceptTerms();
|
|
204
203
|
await veyl.account.logout();
|
|
205
204
|
await veyl.account.logoutAll();
|
|
206
205
|
await veyl.account.delete({ confirm: true });
|
|
207
206
|
```
|
|
208
207
|
|
|
209
|
-
- `create` makes an ordinary account authenticated by a local machine credential. Authentication does not assign a public bot label.
|
|
210
|
-
- `createPasskey({ username,
|
|
211
|
-
- `login({ username?,
|
|
208
|
+
- `create` makes an ordinary account authenticated by a local machine credential and returns its account key directly. Authentication does not assign a public bot label.
|
|
209
|
+
- `createPasskey({ username, webUrl, onUrl })` creates a normal passkey account through a browser-assisted WebAuthn flow, installs a local machine credential for future CLI sessions, and returns that account key directly.
|
|
210
|
+
- `login({ username?, key?, saveKey? })` authenticates with an account key. The key can instead come from `open({ accountKey })` or `VEYL_ACCOUNT_KEY`.
|
|
212
211
|
- `loginPasskey({ username?, webUrl?, onUrl? })` authenticates through the browser-assisted passkey flow.
|
|
213
212
|
- `me` returns the local account summary without forcing login.
|
|
214
|
-
- `terms` reports the
|
|
215
|
-
- `acceptTerms(
|
|
213
|
+
- `terms` reports the canonical Terms/Community Rules links, whether the account's acceptance is current, and when it last accepted an agreement.
|
|
214
|
+
- `acceptTerms()` records the current agreement through the shared user owner without forcing a vault unlock.
|
|
216
215
|
- `logout` signs out and tears down only this runtime.
|
|
217
216
|
- `logoutAll` revokes every product session generation, tears down this runtime locally, and stops a persistent CLI owner after its in-flight work drains.
|
|
218
217
|
- `delete({ confirm: true })` drains decryptable inbox state, marks all discoverable chats deleted, destroys the complete account/network encrypted cache scope, proves vault possession, deletes identifiable account data, removes the local profile, and stops a persistent CLI owner after its in-flight work drains.
|
|
219
218
|
|
|
220
|
-
Account summaries report identity, network, local credential/vault availability, public wallet/chat keys, auth kind, an explicit managed-bot marker when assigned by Glyphteck's owner namespace, and current signed-in/unlocked state.
|
|
219
|
+
Account summaries report identity, network, local credential/vault availability, public wallet/chat keys, auth kind, an explicit managed-bot marker when assigned by Glyphteck's owner namespace, and current signed-in/unlocked state. Account and vault keys are never included in summaries.
|
|
221
220
|
|
|
222
221
|
## Vault
|
|
223
222
|
|
|
224
223
|
```js
|
|
225
|
-
await veyl.vault.create({
|
|
226
|
-
await veyl.vault.unlock({
|
|
224
|
+
const vaultKey = await veyl.vault.create({ saveKey: false });
|
|
225
|
+
await veyl.vault.unlock({ key: vaultKey });
|
|
227
226
|
await veyl.vault.lock();
|
|
228
|
-
const { mnemonic } = await veyl.vault.export({
|
|
227
|
+
const { mnemonic } = await veyl.vault.export({ key: vaultKey });
|
|
229
228
|
```
|
|
230
229
|
|
|
231
|
-
Vault creation and unlock use the shared local encryption, seed derivation, Spark wallet, chat, cache, peer, and transfer owners. `export` returns the Spark mnemonic and must be treated as secret output.
|
|
230
|
+
Vault creation returns the vault key directly. That key unlocks the vault and every feature derived from it. Creation and unlock use the shared local encryption, seed derivation, Spark wallet, chat, cache, peer, and transfer owners. `export` returns the Spark mnemonic and must be treated as secret output.
|
|
232
231
|
|
|
233
232
|
## Profile, settings, and cache
|
|
234
233
|
|
|
@@ -395,7 +394,6 @@ These methods use the same account-scoped validation, encrypted-message lookup,
|
|
|
395
394
|
const controller = new AbortController();
|
|
396
395
|
|
|
397
396
|
await veyl.listen({
|
|
398
|
-
agent: true,
|
|
399
397
|
replay: false,
|
|
400
398
|
signal: controller.signal,
|
|
401
399
|
onEvent(event) {
|
|
@@ -406,18 +404,17 @@ await veyl.listen({
|
|
|
406
404
|
});
|
|
407
405
|
```
|
|
408
406
|
|
|
409
|
-
`listen` subscribes to the shared live chat-list and transfer-store owners. It emits `ready`, `message`, `message-delete`, `transaction`, and `error` events.
|
|
407
|
+
`listen` subscribes to the shared live chat-list and transfer-store owners. It emits `ready`, `message`, `message-delete`, `transaction`, and `error` events. Compact, incoming-only events and transient chat subscriptions are the defaults: a changed conversation is opened briefly, processed, and released instead of retaining one message listener per chat. This keeps an account with hundreds of peers from multiplying long-lived Firestore listeners. Set `compact: false`, `incomingOnly: false`, or `persistentChats: true` only when the caller needs those broader behaviors.
|
|
410
408
|
|
|
411
409
|
Use `listen` for account-wide agent wakeups. Use `chat.enter` when an agent is actively inside one conversation and needs that mounted transcript's exact lifecycle, history, retention, and read semantics.
|
|
412
410
|
|
|
413
411
|
## Local fleet owner
|
|
414
412
|
|
|
415
|
-
`openFleetOwner` is the canonical long-running host for one local agent managing many Veyl accounts. The host keeps one fleet root seed and derives a separate
|
|
413
|
+
`openFleetOwner` is the canonical long-running host for one local agent managing many Veyl accounts. The host keeps one fleet root seed and derives a separate account key, vault key, and Veyl master seed for every monotonically allocated account index.
|
|
416
414
|
|
|
417
415
|
```js
|
|
418
416
|
import {
|
|
419
417
|
FLEET_MANIFEST_VERSION,
|
|
420
|
-
TERMS_VERSION,
|
|
421
418
|
createFleetSeed,
|
|
422
419
|
openFleetOwner,
|
|
423
420
|
saveFleetManifest,
|
|
@@ -446,7 +443,6 @@ await fleet.provision({
|
|
|
446
443
|
username: 'worker-one',
|
|
447
444
|
roles: ['read'],
|
|
448
445
|
network: 'REGTEST',
|
|
449
|
-
termsVersion: TERMS_VERSION,
|
|
450
446
|
});
|
|
451
447
|
|
|
452
448
|
fleet.use(agentPolicy);
|
|
@@ -483,11 +479,11 @@ await fleet.stop();
|
|
|
483
479
|
}
|
|
484
480
|
```
|
|
485
481
|
|
|
486
|
-
The root format and derivation domains are versioned. `nextAccountIndex` only moves forward, so removing a profile never reuses its
|
|
482
|
+
The root format and derivation domains are versioned. `nextAccountIndex` only moves forward, so removing a profile never reuses its key slot. The manifest accepts only public ownership and routing data; account and vault keys are rejected. Derived keys exist in memory while an account is used, and local fleet profile files contain only public identifiers.
|
|
487
483
|
|
|
488
484
|
Losing the root loses every derived account. Back it up as carefully as a wallet seed.
|
|
489
485
|
|
|
490
|
-
An existing account cannot retroactively acquire a derived master seed. Adopting one requires a one-time authenticated handoff that installs its root-derived
|
|
486
|
+
An existing account cannot retroactively acquire a derived master seed. Adopting one requires a one-time authenticated handoff that installs its root-derived account key and encrypts the existing master seed under its root-derived vault key without changing wallet/chat material.
|
|
491
487
|
|
|
492
488
|
The Glyphteck namespace seed is separate from a fleet root. `veyl namespace init` creates that owner-only local key once. When its default file exists under the fleet `homeDir`, provisioning automatically signs a short-lived claim bound to the exact derived machine credential so a reserved canonical username can use the normal public account-creation transaction. The seed is never stored in the manifest or an account profile. Other fleet operators do not have this key and cannot claim the reserved namespace.
|
|
493
489
|
|
|
@@ -525,7 +521,7 @@ Completed results survive restarts. An interrupted replay-safe chat action may r
|
|
|
525
521
|
|
|
526
522
|
The default profile store is `~/.veyl`; override it with `homeDir` or `VEYL_HOME`. Profile directories use mode `0700`, and credential/secret/session files use mode `0600`.
|
|
527
523
|
|
|
528
|
-
Standalone profiles may include Firebase uid, username, network,
|
|
524
|
+
Standalone profiles may include Firebase uid, username, network, account authentication material, vault metadata, public wallet/chat keys, and optionally the vault key. Root-derived fleet profiles intentionally store no account or vault key. Use `saveKey: false` / `--no-save-key` when another secret owner supplies a key.
|
|
529
525
|
|
|
530
526
|
## Close
|
|
531
527
|
|
package/docs/cli.md
CHANGED
|
@@ -17,22 +17,22 @@ The namespace seed is not accepted through a command argument, environment varia
|
|
|
17
17
|
## Account and vault
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
veyl account create @name [--passkey] [--reserved]
|
|
20
|
+
veyl account create @name [--passkey] [--reserved]
|
|
21
21
|
veyl account login [@name] [--passkey]
|
|
22
22
|
veyl account show
|
|
23
23
|
veyl account terms
|
|
24
|
-
veyl account accept-terms
|
|
24
|
+
veyl account accept-terms
|
|
25
25
|
veyl account logout
|
|
26
26
|
veyl account logout-all
|
|
27
27
|
veyl account delete --confirm
|
|
28
28
|
|
|
29
|
-
veyl vault create [--
|
|
30
|
-
veyl vault unlock [--
|
|
29
|
+
veyl vault create [--key VALUE] [--no-save-key]
|
|
30
|
+
veyl vault unlock [--key VALUE] [--no-save-key]
|
|
31
31
|
veyl vault lock
|
|
32
|
-
veyl vault export [--
|
|
32
|
+
veyl vault export [--key VALUE]
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
Creating an account accepts Veyl's [Terms](https://veyl.glyphteck.com/legal#terms) and [Community Rules](https://veyl.glyphteck.com/community-rules). `account accept-terms` accepts their current revisions for an existing account. `account terms` reports the canonical links and whether the account's acceptance is current without unlocking the vault.
|
|
36
36
|
|
|
37
37
|
`vault export` returns the Spark mnemonic. Treat its JSON output as a secret.
|
|
38
38
|
|
|
@@ -172,7 +172,7 @@ veyl --profile runner --session default chat enter @alice
|
|
|
172
172
|
# another shell, when the conversation is actually finished
|
|
173
173
|
veyl --profile runner --session default chat leave @alice
|
|
174
174
|
veyl --profile runner --session default session status
|
|
175
|
-
veyl --profile runner --session default session events
|
|
175
|
+
veyl --profile runner --session default session events
|
|
176
176
|
veyl --profile runner --session default session stop
|
|
177
177
|
```
|
|
178
178
|
|
|
@@ -184,9 +184,8 @@ Event flags:
|
|
|
184
184
|
|
|
185
185
|
```text
|
|
186
186
|
--replay include current rows at startup
|
|
187
|
-
--
|
|
188
|
-
--
|
|
189
|
-
--agent shorthand for --incoming --compact
|
|
187
|
+
--all include self-authored messages; defaults to incoming only
|
|
188
|
+
--raw include complete event payloads
|
|
190
189
|
--no-chats omit message events
|
|
191
190
|
--no-transactions omit transaction events
|
|
192
191
|
```
|
|
@@ -202,7 +201,8 @@ Event flags:
|
|
|
202
201
|
--offset N
|
|
203
202
|
--raw
|
|
204
203
|
--web-url ORIGIN
|
|
205
|
-
--
|
|
204
|
+
--key VALUE
|
|
205
|
+
--no-save-key
|
|
206
206
|
--operation-id ID
|
|
207
207
|
--cid ID
|
|
208
208
|
```
|
|
@@ -213,6 +213,7 @@ Event flags:
|
|
|
213
213
|
VEYL_HOME local profile directory
|
|
214
214
|
VEYL_PROFILE default profile
|
|
215
215
|
VEYL_NETWORK REGTEST or MAINNET
|
|
216
|
-
|
|
216
|
+
VEYL_ACCOUNT_KEY account key used by login
|
|
217
|
+
VEYL_VAULT_KEY vault key used by create/unlock
|
|
217
218
|
VEYL_WEB_URL passkey browser origin
|
|
218
219
|
```
|
package/docs/validation.md
CHANGED
|
@@ -11,7 +11,7 @@ The Node SDK composes the same framework-free owners as web and iOS:
|
|
|
11
11
|
| Product area | Shared owner used by the SDK | Node adaptation |
|
|
12
12
|
| --- | --- | --- |
|
|
13
13
|
| Auth/session | `core/account/session.js`, `core/account/user.js` | local machine credential or browser-assisted passkey |
|
|
14
|
-
| Vault | `core/vault.js`, shared crypto/seed owners | local
|
|
14
|
+
| Vault | `core/vault.js`, shared crypto/seed owners | local vault key or caller secret manager |
|
|
15
15
|
| Peers/search/block | `core/peerlist.js`, `core/peers.js`, shared search sessions | JSON peer projections |
|
|
16
16
|
| Chat | `core/chat/session.js`, `core/chat/actions/*`, shared message batches/cache | strings, byte buffers, filesystem paths, JSON events |
|
|
17
17
|
| Wallet/transactions | `core/wallet/session.js`, `core/wallet/invoice.js`, transfer store, tx data | direct invoice/address strings, integer sats, and JSON results |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
This is a reference implementation of a long-lived multi-account agent fleet built entirely on `@glyphteck/veyl`. It uses no Firebase Admin connection, privileged chat path, server action queue, or cloud secret store. The Glyphteck-owned runtime under `bots` consumes this policy with its own local lineup and operator controls.
|
|
4
4
|
|
|
5
|
-
The secret-free version-2 manifest stores account indices, usernames, networks, roles, and enabled state. One owner-only root at `$VEYL_HOME/fleets/<name>.seed` derives isolated
|
|
5
|
+
The secret-free version-2 manifest stores account indices, usernames, networks, roles, and enabled state. One owner-only root at `$VEYL_HOME/fleets/<name>.seed` derives isolated account keys, vault keys, and Veyl master seeds for monotonic account indices. Per-account private material is never stored in the manifest.
|
|
6
6
|
|
|
7
7
|
## Roles
|
|
8
8
|
|
|
@@ -21,7 +21,6 @@ export async function createExampleBotFleetRuntime(options = {}) {
|
|
|
21
21
|
bootConcurrency: options.bootConcurrency ?? 2,
|
|
22
22
|
policies: [],
|
|
23
23
|
eventOptions: async (profile) => ({
|
|
24
|
-
agent: true,
|
|
25
24
|
replay: true,
|
|
26
25
|
chats: profile.roles.includes('read'),
|
|
27
26
|
persistentChats: true,
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -16,18 +16,22 @@ npm install @glyphteck/veyl
|
|
|
16
16
|
|
|
17
17
|
## JavaScript quick start
|
|
18
18
|
|
|
19
|
+
Creating an account accepts Veyl's [Terms](https://veyl.glyphteck.com/legal#terms) and [Community Rules](https://veyl.glyphteck.com/community-rules).
|
|
20
|
+
|
|
19
21
|
```js
|
|
20
|
-
import { open
|
|
22
|
+
import { open } from '@glyphteck/veyl';
|
|
21
23
|
|
|
22
|
-
const veyl = await open({
|
|
23
|
-
await veyl.account.create({ username: 'runner'
|
|
24
|
-
await veyl.vault.create();
|
|
24
|
+
const veyl = await open({ network: 'REGTEST' });
|
|
25
|
+
const accountKey = await veyl.account.create({ username: 'runner' });
|
|
26
|
+
const vaultKey = await veyl.vault.create();
|
|
25
27
|
await veyl.chat.send('@alice', 'hello');
|
|
26
28
|
console.log(await veyl.wallet.balance());
|
|
27
29
|
await veyl.close();
|
|
28
30
|
```
|
|
29
31
|
|
|
30
|
-
|
|
32
|
+
`account.create()` returns the account key used to authenticate the machine. `vault.create()` returns the vault key that unlocks every vaulted feature. Both keys are saved in the local profile by default and must never be logged or committed.
|
|
33
|
+
|
|
34
|
+
Machine credentials and passkeys describe authentication capability, not whether a person or agent operates the account. Third-party agents use ordinary public profiles; only namespace-authorized Glyphteck services carry the managed bot marker. Use `REGTEST` for disposable automation and `MAINNET` only for real funds.
|
|
31
35
|
|
|
32
36
|
## Optional CLI
|
|
33
37
|
|
|
@@ -40,12 +44,6 @@ npx veyl account show
|
|
|
40
44
|
npx veyl wallet address
|
|
41
45
|
```
|
|
42
46
|
|
|
43
|
-
Interactive account creation displays the public Terms and Community Rules URLs and asks for acceptance. Non-interactive callers must pass the exact current version:
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
npx veyl --network REGTEST account create @runner --accept-terms 2026-07-15
|
|
47
|
-
```
|
|
48
|
-
|
|
49
47
|
To create or log into a normal passkey account from a browser-capable terminal, add `--passkey` to `account create` or `account login`.
|
|
50
48
|
|
|
51
49
|
Glyphteck's owner-only reserved namespace uses one local key:
|
|
@@ -59,7 +57,7 @@ Initialization writes the private seed only to `~/.veyl/namespace.seed` with mod
|
|
|
59
57
|
|
|
60
58
|
Long-running agents should keep one unlocked client or foreground session alive. This reuses the same wallet, peer, chat, cache, and live-listener owners instead of paying cold login and wallet boot cost for every command.
|
|
61
59
|
|
|
62
|
-
Agents can also mount one conversation through `veyl.chat.enter('@alice')`, or run one local `openFleetOwner(...)` for many accounts. A versioned fleet root derives isolated
|
|
60
|
+
Agents can also mount one conversation through `veyl.chat.enter('@alice')`, or run one local `openFleetOwner(...)` for many accounts. A versioned fleet root derives isolated account keys, vault keys, and Veyl master seeds by monotonically allocated account index, so the operator backs up one root for an unbounded fleet. Fleet policies remain normal API consumers; they receive no Firebase Admin or wallet shortcuts.
|
|
63
61
|
|
|
64
62
|
The public SDK keeps ordinary errors simple. Only an ambiguous money mutation has a stable `operation_outcome_unknown` contract, including its caller correlation id and whether an identical retry is safe. This prevents an agent from self-correcting a network error into a duplicate spend without building a large error taxonomy.
|
|
65
63
|
|
|
@@ -70,7 +68,7 @@ veyl --profile runner session start
|
|
|
70
68
|
# another shell
|
|
71
69
|
veyl --profile runner --session default wallet balance
|
|
72
70
|
veyl --profile runner --session default chat enter @alice
|
|
73
|
-
veyl --profile runner --session default session events
|
|
71
|
+
veyl --profile runner --session default session events
|
|
74
72
|
veyl --profile runner --session default session stop
|
|
75
73
|
```
|
|
76
74
|
|
|
@@ -90,7 +88,8 @@ Profiles live under `~/.veyl` by default. The directory and sensitive files use
|
|
|
90
88
|
VEYL_HOME=/secure/veyl-home
|
|
91
89
|
VEYL_PROFILE=runner
|
|
92
90
|
VEYL_NETWORK=REGTEST
|
|
93
|
-
|
|
91
|
+
VEYL_ACCOUNT_KEY=...
|
|
92
|
+
VEYL_VAULT_KEY=...
|
|
94
93
|
VEYL_WEB_URL=https://veyl.glyphteck.com
|
|
95
94
|
```
|
|
96
95
|
|