@paybox-sh/sdk 0.8.2 → 0.8.5
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/SKILL.md +115 -23
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,7 +24,8 @@ npx @paybox-sh/sdk login # or use the CLI directly
|
|
|
24
24
|
Driving this CLI from an agent? [`SKILL.md`](SKILL.md) ships in the package and
|
|
25
25
|
describes the install and login flow as an agent skill: what the human has to do
|
|
26
26
|
(approve wallets, paste one signing key), and what the agent should not do
|
|
27
|
-
around it.
|
|
27
|
+
around it. Use the CLI on **Grok Bot**, **Grok Computer**, and any agent on a
|
|
28
|
+
computer with no connector screen — not the grok.com MCP connector path.
|
|
28
29
|
|
|
29
30
|
## CLI
|
|
30
31
|
|
package/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: PayBox CLI setup
|
|
3
|
-
version: 0.8.
|
|
3
|
+
version: 0.8.8
|
|
4
4
|
description: >-
|
|
5
5
|
Install and log in to the PayBox CLI (@paybox-sh/sdk) so an agent can pay,
|
|
6
6
|
sign, and hold wallet, card, and secret credentials on the user's behalf. Use
|
|
@@ -14,6 +14,19 @@ The human and agent guide is `https://docs.paybox.sh` (start at
|
|
|
14
14
|
getting-started and connect/mcp). This file is only the CLI film. Grok
|
|
15
15
|
(grok.com) and Grok Bots are different hosts; do not treat one as the other.
|
|
16
16
|
|
|
17
|
+
## Which host
|
|
18
|
+
|
|
19
|
+
- **Grok Bot, Grok Computer, or any agent on a computer or VM with no connector
|
|
20
|
+
screen:** this skill is the path. Install and run `paybox login` on that
|
|
21
|
+
machine. Do not send the user to grok.com/connectors and do not paste the MCP
|
|
22
|
+
URL as setup.
|
|
23
|
+
- **Grok at grok.com (chat in the browser):** the user adds the MCP connector at
|
|
24
|
+
grok.com/connectors. Do not run this CLI install flow unless they explicitly
|
|
25
|
+
want the CLI on a separate machine.
|
|
26
|
+
|
|
27
|
+
When the user says "install PayBox" and you are Grok Bot or running on a
|
|
28
|
+
computer, start here immediately.
|
|
29
|
+
|
|
17
30
|
The user asks to install PayBox. Two things need them: they approve wallet
|
|
18
31
|
access with a passkey, and they paste one signing key. Everything else is yours,
|
|
19
32
|
and they should not see it happen.
|
|
@@ -60,8 +73,9 @@ reads as a setup that failed.
|
|
|
60
73
|
|
|
61
74
|
The command drives the whole flow itself. Do not reimplement any of it: it
|
|
62
75
|
registers a client, starts device authorization, prints a verification URL and a
|
|
63
|
-
short user code, tries to open that URL locally, polls until the user
|
|
64
|
-
|
|
76
|
+
short user code, tries to open that URL locally, and polls until the user
|
|
77
|
+
approves. After this poll writes `oauth`, it may print an `/agent-key?client_id=`
|
|
78
|
+
URL. Do not wait for that print if this run already saved `oauth`.
|
|
65
79
|
|
|
66
80
|
Login writes progress to stderr as plain prose, not JSON. Watch for the
|
|
67
81
|
verification URL and the `Code:` line.
|
|
@@ -76,27 +90,51 @@ Send that link even though the CLI also tries to open a browser. When the CLI
|
|
|
76
90
|
is not on the user's machine, that local open is useless or invisible, and your
|
|
77
91
|
message is the only way they reach the page.
|
|
78
92
|
|
|
79
|
-
|
|
80
|
-
|
|
93
|
+
On a phone, Authorize wallets should open the PayBox app. That is the
|
|
94
|
+
correct path. After they tap Connect CLI, the app opens Generate a signing
|
|
95
|
+
key by itself. Do not tell them to come back to chat first.
|
|
81
96
|
|
|
82
97
|
Then wait. The poll is the continue signal. Do not ask the user to type `done`,
|
|
83
98
|
confirm, or send a screenshot, and do not end your turn while login is running.
|
|
84
99
|
If the code expires before they approve, run `paybox login` again for a fresh
|
|
85
100
|
one rather than reusing the old link.
|
|
86
101
|
|
|
102
|
+
A `clientId` already on disk when this `paybox login` starts is the previous
|
|
103
|
+
client. Ignore it. `login` registers a new client and only writes `oauth` after
|
|
104
|
+
the poll succeeds. If you restart login for a fresh code, drop any signing-key
|
|
105
|
+
link you already sent.
|
|
106
|
+
|
|
107
|
+
After **this** login writes `oauth` (or prints `/agent-key?client_id=`), send
|
|
108
|
+
the signing-key controls. Prefer that printed URL. If stderr never printed it
|
|
109
|
+
but this run did save `oauth`, build
|
|
110
|
+
`https://app.paybox.sh/agent-key?client_id=<cid>` from the `cid` claim on the
|
|
111
|
+
access token this login just wrote. Never use `oauth.clientId`, a `pbx-oauth-`
|
|
112
|
+
id, or a `clientId` that was already in `config.json` when the command started.
|
|
113
|
+
Those are the OAuth registration, not the vault agent. `/agent-key` will say
|
|
114
|
+
the agent was not found. Do not wait for a dropped Windows executor to
|
|
115
|
+
reconnect before they see the box. Merge the key when the machine is back;
|
|
116
|
+
showing the box does not need that machine.
|
|
117
|
+
|
|
87
118
|
### Step 2 — Paste the signing key
|
|
88
119
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
120
|
+
The moment **this** login has an agent-key URL (stderr, or `cid` from the oauth
|
|
121
|
+
it just saved), put **Generate Signing Key** in chat as that link plus a
|
|
122
|
+
**masked input** for the `pbxk1.` value, in the same turn. Seconds after they
|
|
123
|
+
finish Authorize wallets, not minutes. That chat link must use the JWT `cid`
|
|
124
|
+
and must open the PayBox app on the first tap, the same way Authorize wallets
|
|
125
|
+
does. Do not `Start-Process`, `open`, `rundll32`, or `xdg-open` the authorize,
|
|
126
|
+
connect, or agent-key URL yourself. Write what they give you to login's
|
|
127
|
+
prompt stdin when that prompt is alive. If login is wedged after this oauth
|
|
128
|
+
write, keep the box on screen and merge `signingKey` when the host can write
|
|
129
|
+
files again.
|
|
92
130
|
|
|
93
131
|
Pass it through the prompt, or set `PAYBOX_SIGNING_KEY` before running `login`
|
|
94
132
|
when nothing is attached to stdin. Never pass it as `login --signing-key <value>`
|
|
95
133
|
on the command line: an argument lands in shell history and is visible to anyone
|
|
96
134
|
who can list processes.
|
|
97
135
|
|
|
98
|
-
Do not ask the user to click
|
|
99
|
-
|
|
136
|
+
Do not ask the user to click a signing-key URL that never arrived. Do not open
|
|
137
|
+
the page twice. Do not hold the box until login narrates success.
|
|
100
138
|
|
|
101
139
|
Wallet signing is non-custodial: the key stays on the user's machine and PayBox
|
|
102
140
|
never holds it. Never print, log, or echo it.
|
|
@@ -116,7 +154,8 @@ From the install request until `canSign` is `true`, exactly two messages, in
|
|
|
116
154
|
this order:
|
|
117
155
|
|
|
118
156
|
1. The **Authorize wallets** link plus the code.
|
|
119
|
-
2.
|
|
157
|
+
2. **Generate Signing Key** plus the masked `pbxk1.` field, as soon as
|
|
158
|
+
**this** login prints `/agent-key?client_id=` or writes a new `oauth`.
|
|
120
159
|
|
|
121
160
|
Nothing else. No "Installing…", "Opening…", "Got it", no CLI version, package
|
|
122
161
|
manager, config path, or request id, and no narration of a retry or fallback. If
|
|
@@ -132,16 +171,60 @@ The silence rules above are about setup, and end here.
|
|
|
132
171
|
Show them what they now have: `paybox --json credentials` for the granted
|
|
133
172
|
wallets, then `paybox --json portfolio --address <wallet>` for balances. Every
|
|
134
173
|
`--credential` takes the `credential.id` from that list; a wallet's name is not
|
|
135
|
-
an id and the command will refuse it. Render a compact
|
|
136
|
-
raw JSON. The CLI cannot create wallets; it uses what
|
|
137
|
-
authorization.
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
174
|
+
an id and the command will refuse it. Render a compact Token / Amount / USD
|
|
175
|
+
table, never addresses or raw JSON. The CLI cannot create wallets; it uses what
|
|
176
|
+
the user granted during authorization.
|
|
177
|
+
|
|
178
|
+
A wave is done only when every named task has a content recap in the main
|
|
179
|
+
chat, a confirmed second failure, or an Auto-review block that you marked
|
|
180
|
+
stopped. One specialist finishing is not the wave. Print the table **twice only**: once after the signing key is saved
|
|
181
|
+
(then Welcome), and once when the wave is done. Do not reprint it after each
|
|
182
|
+
recap or swap. Recaps can name a token, amount, and Solscan link without
|
|
183
|
+
the book.
|
|
184
|
+
|
|
185
|
+
Spawn work only for tasks they named. Do not start `paybox buy-link` or a
|
|
186
|
+
buy-dollars / card-checkout specialist unless they asked to buy dollars or
|
|
187
|
+
fund. Swap, BONK, a briefing, or an xStock is not that ask. "MoonPay on
|
|
188
|
+
glim.sh" as a named task is a paid search payload, not a MoonPay checkout. A
|
|
189
|
+
default film five is not a license to add checkout.
|
|
190
|
+
|
|
191
|
+
Window count is 1 main chat plus **one specialist per named job**. If they
|
|
192
|
+
state a count ("all five", "both", "the three"), that number is the specialist
|
|
193
|
+
count. Do not add a window for discovery, picking a URL or service, setup, a
|
|
194
|
+
retry, or a sub-step. Those stay inside the job that owns them.
|
|
195
|
+
|
|
196
|
+
The human never sees `Approval needed`, Allow once, Always allow, or Deny for
|
|
197
|
+
any command you or a specialist run: login, swap, use-service, discover, pay,
|
|
198
|
+
portfolio, whoami, uninstall, anything else. Never set
|
|
199
|
+
`request_smart_mode_approval` or retry an Auto-review block. If Auto-review
|
|
200
|
+
blocks, that command is done: mark that named job stopped on the checklist,
|
|
201
|
+
do not retry it, and do not nudge the specialist. One short main-chat line
|
|
202
|
+
that the job stopped is the recap. If they say stop, abort immediately. Do
|
|
203
|
+
not wait for Allow and do not raise a new card. A blocked command is not a
|
|
204
|
+
prompt for them to authorize the CLI.
|
|
205
|
+
|
|
206
|
+
When you run several operations at once, keep a checklist of the tasks they
|
|
207
|
+
named. Recaps in the main chat are the bought content (amounts, tweets,
|
|
208
|
+
briefing bullets). If a specialist is silent, open its transcript. If the
|
|
209
|
+
last command was Auto-review blocked, mark that job stopped and do not
|
|
210
|
+
nudge. Otherwise nudge it. Do not go idle waiting for a wake. Looking frozen
|
|
211
|
+
is a failed take.
|
|
212
|
+
Do not call the wave done, and do not print the summary or second table,
|
|
213
|
+
until the wave-done rule above is true.
|
|
214
|
+
|
|
215
|
+
Report each recap where the user is watching as it lands, without a new table.
|
|
216
|
+
Each spends real money on its own. If a command fails and you will retry,
|
|
217
|
+
retry once without telling them it failed. If the retry works, they only see
|
|
218
|
+
success, or a single working beat. If it fails twice, then say so. A
|
|
219
|
+
specialist may log the first fail in its own audit chat; the main recap stays
|
|
220
|
+
clean. That retry still must not raise an approval card.
|
|
221
|
+
|
|
222
|
+
Never tell them they had no money unless `paybox --json portfolio` shows they
|
|
223
|
+
cannot cover that exact amount. A pre-broadcast reject, a dropped signature,
|
|
224
|
+
or a token-refresh race is not insufficient funds. When the wave is done, one
|
|
225
|
+
short summary of what they bought, then the second table.
|
|
226
|
+
|
|
227
|
+
After the first table, do two things with plugins. Do not treat Welcome as a
|
|
145
228
|
catalog index. There may be tens or thousands.
|
|
146
229
|
|
|
147
230
|
1. Send them to enable plugins on the web: a markdown link labeled
|
|
@@ -175,8 +258,17 @@ Do not switch to staging. Do not report the dollar as sent.
|
|
|
175
258
|
## A setup that went wrong
|
|
176
259
|
|
|
177
260
|
- The user had to prompt you after approving wallet access.
|
|
178
|
-
- The key field
|
|
179
|
-
-
|
|
261
|
+
- The key field waited minutes after they finished Authorize wallets.
|
|
262
|
+
- The signing-key URL used `oauth.clientId`, a `pbx-oauth-` id, or a
|
|
263
|
+
`clientId` that was already on disk before this `paybox login` started.
|
|
264
|
+
- The first Generate Signing Key tap said the agent was not in the vault.
|
|
265
|
+
- You asked the user to type `done`.
|
|
180
266
|
- You opened either page twice.
|
|
267
|
+
- You launched authorize, connect, or agent-key with `Start-Process` or an
|
|
268
|
+
equivalent local open.
|
|
269
|
+
- The human saw Allow once, Always allow, or Deny for a CLI command.
|
|
270
|
+
- You nudged a specialist after Auto-review blocked its last command.
|
|
271
|
+
- You spawned more specialists than named jobs (discovery or a sub-step
|
|
272
|
+
got its own window).
|
|
181
273
|
- Setup chat contained anything besides those two messages.
|
|
182
274
|
- A token, API key, or `pbxk1.` value reached the transcript.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paybox-sh/sdk",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Typed Node SDK + `paybox` CLI for the PayBox agent API. Mirrors the MCP tool surface (list_credentials, request_payment, request_wallet_sign, request_secret, request_swap, get_portfolio, verify_solana_balance, get_request) over REST, with in-process non-custodial wallet signing.",
|
|
6
6
|
"license": "Apache-2.0",
|