@keyban/cli 0.2.1 → 0.2.3

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 CHANGED
@@ -11,7 +11,7 @@ humans.
11
11
  Registry name: `io.keyban.mcp/agent-wallet`.
12
12
 
13
13
  `keyban mcp` runs locally over stdio, next to your MCP client. It holds one share
14
- of a FROST threshold key in your OS keyring; Keyban holds the other. No single
14
+ of a FROST threshold key in its wallet file; Keyban holds the other. No single
15
15
  side can move funds alone, and the model never sees either share or your API
16
16
  key.
17
17
 
@@ -71,8 +71,8 @@ claude mcp add agent-wallet \
71
71
  -- npx -y @keyban/cli@latest mcp
72
72
  ```
73
73
 
74
- On first boot the server runs a key generation, keeps its share in your OS
75
- keyring, and registers itself on chain as a signer of that wallet using the
74
+ On first boot the server runs a key generation, keeps its share in the wallet
75
+ file (`KEYBAN_WALLET_PATH`, else `$XDG_CONFIG_HOME/keyban/wallet.json`), and registers itself on chain as a signer of that wallet using the
76
76
  invite key. That happens once per machine; the invite key is spent by it.
77
77
 
78
78
  ## Configuration
@@ -88,7 +88,9 @@ can pick yourself.
88
88
  | `KEYBAN_WALLET_ADDRESS` | yes | Address of the account this server drives. |
89
89
  | `KEYBAN_NETWORK` | yes | Network the wallet operates on: `BaseMainnet`, `BaseSepolia`, `XdcMainnet` or `XdcApothem`. |
90
90
  | `KEYBAN_BASE_URL` | no | Backend base URL, or one of `dev`, `testing`, `staging`, `prod`, `sandbox`. Defaults to `https://api.prod.keyban.io`. |
91
- | `KEYBAN_DKG_BLOB` | no | Pre-generated signer share, base64 JSON. For runtimes with no OS keyring; it does not replace the invite key. |
91
+ | `KEYBAN_DKG_BLOB` | no | Pre-generated signer share, base64 JSON. For runtimes whose disk does not last; it does not replace the invite key. |
92
+ | `KEYBAN_WALLET_PATH` | no | The wallet file, holding these variables and the share. Defaults to `$XDG_CONFIG_HOME/keyban/wallet.json`. |
93
+ | `KEYBAN_CONFIG` | no | All the variables above as one base64 JSON object, for runtimes like AgentCore where each variable is a chore to add. A variable set on its own wins. |
92
94
  | `MCP_LOG_FILE` | no | Path the server writes its log to. |
93
95
  | `MCP_LOG_LEVEL` | no | `debug`, `info`, `warn` or `error`. Defaults to `info` for `keyban mcp`, `warn` for `keyban wallet`. |
94
96
 
@@ -117,6 +119,8 @@ Read-only:
117
119
  | `discover_x402_services` | Search the x402 service directory |
118
120
  | `list_missions`, `get_mission` | Read the missions and their statistics |
119
121
  | `list_mission_runs`, `get_mission_run` | Read this wallet's mission runs |
122
+ | `list_runs_of_mission` | List this wallet's runs of one mission, paginated, filterable by status |
123
+ | `list_mission_run_payments` | List every payment of a run, paginated (`get_mission_run` only carries the 50 most recent) |
120
124
  | `publish_mission` | Check a draft can be published and show the page to publish it |
121
125
 
122
126
  Writing:
@@ -170,10 +174,9 @@ the link and the steps in the answer.
170
174
 
171
175
  ## Trust boundary
172
176
 
173
- The share and the API key are protected by your user account, nothing finer.
174
- On Linux (Secret Service) and Windows (Credential Manager) the OS keyring
175
- grants no per-program access: any program running as you can read them, and
176
- can run `keyban` too. What bounds such a program is the same thing that bounds
177
+ The share and the API key are protected by your user account, nothing finer:
178
+ the wallet file is readable by you alone (mode 600), so any program running as
179
+ you can read them, and can run `keyban` too. What bounds such a program is the same thing that bounds
177
180
  the agent: Keyban co-signs every signature and applies the wallet's policy
178
181
  first. Treat the machine account that holds the share like one that holds an
179
182
  SSH key.
package/SKILL.md CHANGED
@@ -191,7 +191,8 @@ short name; `key` is the stable kebab-case identifier (`lead-enrichment`).
191
191
  5. On a task with units, `unitCount` is an estimate used for the envelope, not
192
192
  a limit: a run may handle more or fewer units. A trial plays a small sample
193
193
  of units, not a whole run: when you ask it, pass `unitCount`, the sample, a
194
- few units; you may propose its size to the user.
194
+ few units, never more than the `unitCount` of the draft; you may propose its
195
+ size to the user.
195
196
 
196
197
  Amounts are integer strings in cents of the organization's currency, never
197
198
  decimals: 0.05 EUR is `"5"`, 30.00 EUR is `"3000"`. A decimal is refused with a
@@ -226,7 +227,8 @@ to action and ends the message. In French, say « essai », never « trial ».
226
227
  2. `agent-wallet:request_mission_trial`, right after the draft call, without
227
228
  asking the user in the chat first: the only approval is the user's
228
229
  « Validate in Keyban ». It asks a trial of the draft on this wallet; on a
229
- task with units, pass `unitCount`, the sample (a few units). It returns at
230
+ task with units, pass `unitCount`, the sample (a few units, never more than
231
+ the draft `unitCount`). It returns at
230
232
  once with a card, which the user validates in the Inbox of the dashboard
231
233
  (an operator of the wallet; the organization's finance owner too when the
232
234
  draft loosens application or organization rules). Then call
@@ -304,7 +306,8 @@ and its results are elsewhere). Start your own run and leave the others alone.
304
306
  under the wallet policy alone, unless the policy requires a mission
305
307
  (`policy/mission-required`).
306
308
  3. Record progress with `agent-wallet:log_mission_progress` (`unitsDone`,
307
- idempotent, or `unitsDoneCount`, and a `note`). `agent-wallet:get_mission_run`
309
+ idempotent, or `unitsDoneCount`, and a `note`); on a mission without unit,
310
+ log a `note` only, as a done count is refused. `agent-wallet:get_mission_run`
308
311
  returns what is spent and left and the units remaining: after an
309
312
  interruption, read it and continue from the remaining units.
310
313
  4. When done, deliver the work result first, then call
@@ -320,6 +323,12 @@ Refusals of `agent-wallet:start_mission_run`:
320
323
  - `MISSION_RUN_LIMIT_REACHED` (409): the mission limits the simultaneous runs
321
324
  per wallet and this wallet reached it. Finish one of your own runs first; if
322
325
  the others are not yours, tell the user and stop.
326
+ - `MISSION_RUN_PENDING` (409): `on_demand` mode, a run of this mission on this
327
+ wallet already waits for approval; one request waits at a time. If you
328
+ started it, keep calling `agent-wallet:wait_for_mission_run` on it, or
329
+ withdraw it with `agent-wallet:abandon_mission_run` if you no longer need it;
330
+ otherwise tell the user a request already waits and start again once it is
331
+ approved, declined or expired. Do not retry in a loop.
323
332
  - `MISSION_NOT_PUBLISHED` (409): nothing is published yet (ask a trial) or the
324
333
  mission is archived.
325
334
  - `MISSION_RUN_WALLET_OUT_OF_SCOPE` (403): this wallet is outside the mission's
@@ -338,6 +347,9 @@ statistics (runs by status, total spent,
338
347
  observed price per unit next to the target) and the limits currently blocking a
339
348
  start, with their `retryAt`. `agent-wallet:list_mission_runs` and
340
349
  `agent-wallet:get_mission_run` read the runs of this wallet.
350
+ `agent-wallet:list_runs_of_mission` lists this wallet's runs of one mission.
351
+ `agent-wallet:list_mission_run_payments` pages every payment of a run beyond the
352
+ 50 most recent ones that `get_mission_run` carries.
341
353
 
342
354
  ## When the policy refuses
343
355
 
@@ -348,6 +360,7 @@ that payment.
348
360
  |---|---|---|
349
361
  | `policy/amount-exceeded` | above the per-payment cap | raise the cap on the wallet page |
350
362
  | `policy/budget-day-exceeded`, `-week-`, `-month-` | the period's budget is used | wait, or raise the budget on the wallet page |
363
+ | `policy/budget-application-…-exceeded`, `policy/budget-organization-…-exceeded` | the budget shared by every wallet of the application (or of the whole organization) is used for the period, not this wallet's own | wait for the next period, or ask an owner or admin to raise it in Settings → Policies of the application or organization; never split the payment |
351
364
  | `policy/recipient-…`, `policy/domain-…` | destination not allowed at some scope | change a destination rule, through the admin MCP only if the user asks |
352
365
  | `policy/mission-required` | this wallet only pays inside a mission run, and the payment named none | pay inside a run of the mission this task belongs to: start one with `agent-wallet:start_mission_run` if none is active, or ask the user which mission it is; never start a run of an unrelated mission to get the payment through; do not retry without a run |
353
366
  | `policy/mission-run-not-found` | the run id is unknown, belongs to another wallet, or missions are not available | check the id with `agent-wallet:list_mission_runs`; do not guess another |
@@ -362,7 +375,7 @@ that payment.
362
375
  | `policy/missing` | the wallet has no policy (403 at signing) | ask the user to open the wallet page; do not retry |
363
376
  | `policy/x402-no-exact-accept` | the seller only offers an x402 payment scheme the wallet cannot settle yet (e.g. `upto`) — a current limit of the wallet, not a budget problem | do not retry; pick another provider and tell the user |
364
377
  | `policy/x402-…` | the seller's x402 offer cannot be paid (unreachable, malformed, invalid recipient, wrong asset or chain, above `maxAmount`) | pick another provider |
365
- | `policy/prepaid-balance-insufficient` | the prepaid credit of the organization does not cover the payment | tell the user an admin must buy a pack in Billing → Prepaid credit; never retry or split the payment |
378
+ | `policy/prepaid-balance-insufficient` | the prepaid credit of the organization does not cover the payment; even a fraction of a cent short refuses | tell the user an admin must buy a pack in Billing → Prepaid credit; never retry or split the payment |
366
379
  | `policy/prepaid-payer-unavailable`, `policy/prepaid-suspended` | Keyban cannot pay prepaid payments for now | report it; do not retry |
367
380
 
368
381
  A destination refused with `mission` as scope is the mission's list; with