@glyphteck/veyl 0.2.0 → 0.3.1
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 +65 -100
- package/dist/cli.js +1072 -951
- package/dist/index.js +957 -591
- package/docs/agents.md +235 -0
- package/docs/api.md +647 -0
- package/docs/cli.md +169 -0
- package/docs/mcp.md +54 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -1,148 +1,113 @@
|
|
|
1
1
|
# Veyl Headless
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`@glyphteck/veyl` is the Bun client for using Veyl from a terminal, script, automation, bot, agent, or MCP client.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Headless is a normal Veyl client, not a privileged backend. Account keys, vault secrets, wallet entropy, chat seeds, Spark wallet boot, message encryption, and payment signing run locally. The backend only creates public account records, verifies machine-key login challenges, issues Firebase custom tokens, and stores encrypted vault data it cannot decrypt.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Machine-created accounts are marked as `bot` on their public profile. Passkey-created CLI accounts are real human accounts and are not marked as bots.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
## Install
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
12
|
bunx @glyphteck/veyl help
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
For scripts:
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
```bash
|
|
18
|
+
bun add @glyphteck/veyl
|
|
19
|
+
```
|
|
18
20
|
|
|
19
|
-
|
|
20
|
-
- `src/cli.js`: terminal command wrapper.
|
|
21
|
-
- `src/mcp.js`: MCP wrapper.
|
|
22
|
-
- `src/passkey.js`: browser-assisted passkey bridge for terminal flows.
|
|
21
|
+
## Quick Start
|
|
23
22
|
|
|
24
|
-
|
|
23
|
+
```bash
|
|
24
|
+
veyl create @runner
|
|
25
|
+
veyl vault create
|
|
26
|
+
veyl balance
|
|
27
|
+
veyl listen --agent
|
|
28
|
+
```
|
|
25
29
|
|
|
26
|
-
|
|
30
|
+
Passkey account from the terminal:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
veyl create --passkey @runner
|
|
34
|
+
veyl vault create
|
|
35
|
+
veyl listen --agent
|
|
36
|
+
```
|
|
27
37
|
|
|
28
|
-
|
|
38
|
+
## JavaScript
|
|
29
39
|
|
|
30
40
|
```js
|
|
31
41
|
import { open } from '@glyphteck/veyl';
|
|
32
42
|
|
|
33
|
-
const veyl = await open();
|
|
43
|
+
const veyl = await open({ profile: 'runner', network: 'REGTEST' });
|
|
34
44
|
|
|
35
|
-
|
|
36
|
-
const vault = await veyl.vault.create();
|
|
45
|
+
await veyl.account.login();
|
|
37
46
|
await veyl.vault.unlock();
|
|
38
47
|
await veyl.chat.send('@alice', 'hello');
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
48
|
+
await veyl.money.request('@alice', 1000);
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Agent Loop
|
|
52
|
+
|
|
53
|
+
```js
|
|
54
|
+
import { open } from '@glyphteck/veyl';
|
|
55
|
+
|
|
56
|
+
const veyl = await open({ profile: 'runner', network: 'REGTEST' });
|
|
57
|
+
|
|
58
|
+
await veyl.account.login();
|
|
59
|
+
await veyl.vault.unlock();
|
|
44
60
|
|
|
45
61
|
await veyl.listen({
|
|
46
|
-
|
|
47
|
-
incomingOnly: true,
|
|
62
|
+
agent: true,
|
|
48
63
|
onEvent: async (event) => {
|
|
49
|
-
if (event.type !== 'message') return;
|
|
50
|
-
await veyl.chat.
|
|
51
|
-
await veyl.chat.reply(event, 'thanks');
|
|
64
|
+
if (event.type !== 'message' || event.message.type !== 'txt') return;
|
|
65
|
+
await veyl.chat.reply(event, `received: ${event.message.text}`);
|
|
52
66
|
},
|
|
53
67
|
});
|
|
54
|
-
|
|
55
|
-
const receive = await veyl.money.receive();
|
|
56
|
-
const invoice = await veyl.money.invoice(1000, { memo: 'coffee' });
|
|
57
|
-
await veyl.money.send('@alice', 1000);
|
|
58
|
-
await veyl.money.request('@alice', 1000);
|
|
59
|
-
const transactions = await veyl.money.transactions();
|
|
60
|
-
|
|
61
|
-
console.log(account.uid, vault.vaultSecret, receive.address, invoice.encodedInvoice, messages, transactions);
|
|
62
68
|
```
|
|
63
69
|
|
|
64
|
-
|
|
70
|
+
## Common CLI Commands
|
|
65
71
|
|
|
66
72
|
```bash
|
|
73
|
+
veyl create @runner
|
|
67
74
|
veyl create --passkey @runner
|
|
68
|
-
veyl
|
|
69
|
-
veyl
|
|
75
|
+
veyl login [@runner]
|
|
76
|
+
veyl vault create
|
|
77
|
+
veyl vault unlock
|
|
78
|
+
veyl balance
|
|
70
79
|
veyl receive
|
|
71
80
|
veyl claim
|
|
72
|
-
veyl invoice 100 "coffee"
|
|
73
|
-
veyl pay-invoice <invoice>
|
|
74
|
-
veyl withdraw <address> 1000
|
|
75
|
-
veyl balance
|
|
76
|
-
veyl read @alice
|
|
77
81
|
veyl say @alice "hello"
|
|
78
82
|
veyl reply @alice <message-id> "got it"
|
|
79
83
|
veyl react @alice <message-id> +1
|
|
80
|
-
veyl
|
|
81
|
-
veyl
|
|
82
|
-
veyl
|
|
83
|
-
|
|
84
|
-
veyl account create @runner
|
|
85
|
-
veyl account create --passkey @runner
|
|
86
|
-
veyl account login @runner
|
|
87
|
-
veyl account login --passkey @runner
|
|
88
|
-
veyl vault create
|
|
89
|
-
veyl vault unlock
|
|
90
|
-
veyl vault lock
|
|
91
|
-
veyl chat read @alice
|
|
92
|
-
veyl chat send @alice "hello"
|
|
93
|
-
veyl chat reply @alice <message-id> "got it"
|
|
94
|
-
veyl chat react @alice <message-id> +1
|
|
95
|
-
veyl chat react-to @alice <message-id> +1
|
|
96
|
-
veyl chat unreact @alice <message-id>
|
|
97
|
-
veyl chat save @alice <message-id>
|
|
98
|
-
veyl chat unsave @alice <message-id>
|
|
99
|
-
veyl chat delete @alice <message-id>
|
|
100
|
-
veyl chat delete-chat @alice
|
|
101
|
-
veyl chat retention @alice seen
|
|
102
|
-
veyl money receive
|
|
103
|
-
veyl money balance
|
|
104
|
-
veyl money claim
|
|
105
|
-
veyl money invoice 100 "coffee"
|
|
106
|
-
veyl money pay-invoice <invoice>
|
|
107
|
-
veyl money send @alice 1000
|
|
108
|
-
veyl money request @alice 1000
|
|
109
|
-
veyl money withdraw-quote <address> 1000
|
|
110
|
-
veyl money withdraw <address> 1000
|
|
84
|
+
veyl send @alice 1000
|
|
85
|
+
veyl request @alice 1000
|
|
86
|
+
veyl pay <request-id>
|
|
111
87
|
veyl transactions
|
|
88
|
+
veyl listen --agent
|
|
112
89
|
veyl mcp serve
|
|
113
90
|
```
|
|
114
91
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
`veyl listen` keeps one auth and vault session alive in the current process, then emits newline-delimited JSON events for new messages and wallet transfers. It is the terminal event-stream path for agents that do not want to speak MCP. Use `veyl listen --agent` for compact peer-authored message events with `replyTo` and `reactTo` handles shaped as `{ peer, messageId }`.
|
|
118
|
-
|
|
119
|
-
Passkey browser auth defaults to `https://veyl.glyphteck.com`. Use `--web-url` or `VEYL_WEB_URL` to point the CLI at another allowed passkey origin, such as a local dev host or a future dedicated auth host.
|
|
92
|
+
## Docs
|
|
120
93
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
```
|
|
94
|
+
- Agent quick reference: [docs/agents.md](docs/agents.md)
|
|
95
|
+
- JavaScript API: [docs/api.md](docs/api.md)
|
|
96
|
+
- CLI: [docs/cli.md](docs/cli.md)
|
|
97
|
+
- MCP: [docs/mcp.md](docs/mcp.md)
|
|
126
98
|
|
|
127
99
|
## Local Secrets
|
|
128
100
|
|
|
129
|
-
|
|
101
|
+
Profiles live under `~/.veyl` by default, or `VEYL_HOME` if set. Use `--no-save-secret`, `--no-save-credential`, `saveSecret: false`, or `saveCredential: false` if you want to store vault or machine credentials yourself.
|
|
130
102
|
|
|
131
|
-
|
|
103
|
+
## Environment
|
|
132
104
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
- `POST /headless/account/login/finish`
|
|
141
|
-
- `POST /headless/account/credential/add/start`
|
|
142
|
-
- `POST /headless/account/credential/add/finish`
|
|
143
|
-
|
|
144
|
-
Machine-created accounts are marked as bots on their public profile so app users can tell that the account is bot-operated. Passkey-created CLI accounts are not marked as bots.
|
|
145
|
-
|
|
146
|
-
Vault secrets, wallet entropy, chat seeds, Spark wallet boot, and message/payment signing all run locally in this package through shared Veyl primitives.
|
|
105
|
+
```bash
|
|
106
|
+
VEYL_HOME=/secure/veyl-home
|
|
107
|
+
VEYL_PROFILE=runner
|
|
108
|
+
VEYL_NETWORK=REGTEST
|
|
109
|
+
VEYL_VAULT_SECRET=...
|
|
110
|
+
VEYL_WEB_URL=https://veyl.glyphteck.com
|
|
111
|
+
```
|
|
147
112
|
|
|
148
|
-
|
|
113
|
+
`VEYL_WEB_URL` is used for passkey flows and must be `https://...` or `localhost`.
|