@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/docs/cli.md ADDED
@@ -0,0 +1,169 @@
1
+ # CLI
2
+
3
+ The `veyl` binary is the terminal adapter over the headless JavaScript API.
4
+
5
+ `veyl help` is generated from the same command descriptors that drive CLI dispatch and MCP tools. The examples below highlight common commands rather than defining a separate command inventory.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ bunx @glyphteck/veyl help
11
+ bun add -g @glyphteck/veyl
12
+ ```
13
+
14
+ Project-local:
15
+
16
+ ```bash
17
+ bun add @glyphteck/veyl
18
+ bunx veyl help
19
+ ```
20
+
21
+ ## Account And Vault
22
+
23
+ ```bash
24
+ veyl create @runner
25
+ veyl create --passkey @runner
26
+ veyl login [@runner]
27
+ veyl login --passkey [@runner]
28
+ veyl me
29
+ veyl vault create
30
+ veyl unlock
31
+ veyl lock
32
+ ```
33
+
34
+ `create` without `--passkey` creates a machine-operated account and marks the profile as `bot`. `create --passkey` creates a normal passkey account through a browser-assisted flow and stores a local CLI credential.
35
+
36
+ ## Chat
37
+
38
+ ```bash
39
+ veyl chats
40
+ veyl read @alice
41
+ veyl say @alice "hello"
42
+ veyl reply @alice <message-id> "got it"
43
+ veyl react @alice <message-id> +1
44
+ veyl unreact @alice <message-id>
45
+ veyl save @alice <message-id>
46
+ veyl unsave @alice <message-id>
47
+ veyl delete-message @alice <message-id>
48
+ veyl delete-chat @alice
49
+ veyl retention @alice seen
50
+ veyl retention @alice 24h
51
+ ```
52
+
53
+ Structured form:
54
+
55
+ ```bash
56
+ veyl chat list
57
+ veyl chat read @alice
58
+ veyl chat send @alice "hello"
59
+ veyl chat reply @alice <message-id> "got it"
60
+ veyl chat react @alice <message-id> +1
61
+ veyl chat unreact @alice <message-id>
62
+ veyl chat save @alice <message-id>
63
+ veyl chat unsave @alice <message-id>
64
+ veyl chat delete @alice <message-id>
65
+ veyl chat delete-chat @alice
66
+ veyl chat retention @alice seen
67
+ ```
68
+
69
+ ## Money
70
+
71
+ ```bash
72
+ veyl balance
73
+ veyl receive
74
+ veyl claim
75
+ veyl send @alice 1000
76
+ veyl request @alice 1000
77
+ veyl pay <request-id>
78
+ veyl invoice 1000 "memo"
79
+ veyl pay-invoice <invoice>
80
+ veyl transactions
81
+ veyl withdraw-quote <address> 1000
82
+ veyl withdraw-prepare <address> 1000
83
+ veyl withdraw <address> 1000
84
+ ```
85
+
86
+ Structured form:
87
+
88
+ ```bash
89
+ veyl money balance
90
+ veyl money receive
91
+ veyl money claim
92
+ veyl money send @alice 1000
93
+ veyl money request @alice 1000
94
+ veyl money pay <request-id>
95
+ veyl money invoice 1000 "memo"
96
+ veyl money pay-invoice <invoice>
97
+ veyl money lightning-quote <invoice>
98
+ veyl money lightning-pay <invoice>
99
+ veyl money lightning-receive <id>
100
+ veyl money lightning-send <id>
101
+ veyl money transactions
102
+ veyl money withdraw-quote <address> 1000
103
+ veyl money withdraw-prepare <address> 1000
104
+ veyl money withdraw <address> 1000
105
+ ```
106
+
107
+ ## Listen
108
+
109
+ ```bash
110
+ veyl listen --agent
111
+ ```
112
+
113
+ Useful flags:
114
+
115
+ ```text
116
+ --interval <ms>
117
+ --chat-count <n>
118
+ --message-count <n>
119
+ --tx-count <n>
120
+ --replay
121
+ --incoming
122
+ --incoming-only
123
+ --all
124
+ --compact
125
+ --agent
126
+ --no-chats
127
+ --no-transactions
128
+ ```
129
+
130
+ `--agent` is the preferred event stream for agents. It emits compact incoming-only newline-delimited JSON events.
131
+
132
+ ## Common Flags
133
+
134
+ ```text
135
+ --profile <name>
136
+ --network REGTEST|MAINNET
137
+ --secret <vault-secret>
138
+ --no-save-secret
139
+ --passkey
140
+ --web-url <origin>
141
+ --no-save-credential
142
+ --count <n>
143
+ --limit <n>
144
+ --offset <n>
145
+ --raw
146
+ --memo <text>
147
+ --expiry <seconds>
148
+ --max-fee <sats>
149
+ --amount <sats>
150
+ --amount-to-send <sats>
151
+ --speed SLOW|MEDIUM|FAST
152
+ --no-deduct-fee
153
+ --type lightning|spark
154
+ --prefer-spark
155
+ --no-prefer-spark
156
+ --include-spark-address
157
+ --include-spark-invoice
158
+ --no-cleanup
159
+ ```
160
+
161
+ ## Env
162
+
163
+ ```bash
164
+ VEYL_HOME=/secure/veyl-home
165
+ VEYL_PROFILE=runner
166
+ VEYL_NETWORK=REGTEST
167
+ VEYL_VAULT_SECRET=...
168
+ VEYL_WEB_URL=https://veyl.glyphteck.com
169
+ ```
package/docs/mcp.md ADDED
@@ -0,0 +1,54 @@
1
+ # MCP
2
+
3
+ The MCP server is a local stdio adapter over the headless JavaScript API.
4
+
5
+ Veyl does not host a remote MCP endpoint. There is no Vercel URL for MCP. A user, agent host, desktop app, or worker starts the package command itself:
6
+
7
+ ```bash
8
+ veyl mcp serve
9
+ ```
10
+
11
+ The host sends MCP JSON-RPC messages to stdin and reads responses from stdout. The server uses the same local profile, vault, wallet, and chat session as the CLI/API.
12
+
13
+ ## When To Use MCP
14
+
15
+ Use MCP when the agent runtime already supports MCP tools and wants to call Veyl through tool invocations.
16
+
17
+ Use the JavaScript API when you control the runtime and need an efficient long-running loop, streaming listener, custom memory, or custom wake/sleep logic.
18
+
19
+ Use the CLI when a human or shell script needs one-off commands.
20
+
21
+ ## Local Config Example
22
+
23
+ Exact MCP host config differs by host. The important command is:
24
+
25
+ ```json
26
+ {
27
+ "command": "veyl",
28
+ "args": ["mcp", "serve"],
29
+ "env": {
30
+ "VEYL_PROFILE": "runner",
31
+ "VEYL_NETWORK": "REGTEST",
32
+ "VEYL_HOME": "/secure/veyl-home"
33
+ }
34
+ }
35
+ ```
36
+
37
+ If `veyl` is not globally installed, point the command at Bun:
38
+
39
+ ```json
40
+ {
41
+ "command": "bunx",
42
+ "args": ["@glyphteck/veyl", "mcp", "serve"]
43
+ }
44
+ ```
45
+
46
+ ## Tools
47
+
48
+ The live tool list is returned by MCP `tools/list` and generated from the canonical descriptors in `src/commands.js`. It covers account and vault access, chat reads/actions, wallet payments and requests, Lightning operations, withdrawals, and transaction history.
49
+
50
+ `chat_reply` and `chat_react_to` accept either explicit `peer` plus `messageId`, or a full `event` object from `veyl listen`.
51
+
52
+ ## Security
53
+
54
+ The MCP server is not privileged. It can only do what the local profile, credential, vault secret, and wallet funds allow. Do not expose stdio over a public network bridge. If a custom MCP host stores secrets elsewhere, disable package-side secret persistence with `saveSecret: false`, `saveCredential: false`, `--no-save-secret`, or `--no-save-credential`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glyphteck/veyl",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "description": "Programmable Bun client for Veyl accounts, vaults, chat, and wallet payments.",
@@ -12,6 +12,7 @@
12
12
  },
13
13
  "files": [
14
14
  "dist",
15
+ "docs",
15
16
  "README.md",
16
17
  "package.json"
17
18
  ],