@capxul/cli 4.20.0-beta.26 → 4.20.0-beta.28
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 +90 -63
- package/dist/browser/signer.js +114 -88
- package/dist/browser/signer.js.map +1 -1
- package/dist/{entry-CXlsnqyc.mjs → entry-DXu0dr0S.mjs} +2794 -2434
- package/dist/entry-DXu0dr0S.mjs.map +1 -0
- package/dist/{fast-BYzVdpNs.mjs → fast-B1MSUn2P.mjs} +2 -2
- package/dist/{fast-BYzVdpNs.mjs.map → fast-B1MSUn2P.mjs.map} +1 -1
- package/dist/main.mjs +2 -2
- package/dist/{where-view-C0WT0ARR.mjs → where-view-BJmsAHQb.mjs} +11 -2
- package/dist/{where-view-C0WT0ARR.mjs.map → where-view-BJmsAHQb.mjs.map} +1 -1
- package/package.json +5 -5
- package/dist/entry-CXlsnqyc.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -184,19 +184,23 @@ An agent gives the person the link and runs `next.argv`. `payment wait
|
|
|
184
184
|
APPROVAL_ID` follows the approval: once it is approved it sends it (unless the
|
|
185
185
|
page already did; only one send can claim it) and waits for the payment to
|
|
186
186
|
settle. Its result is the SDK's `{ approval, payments }`. An Organization
|
|
187
|
-
payment's wait carries `--org`.
|
|
187
|
+
payment's wait carries `--org`. Without `--timeout-seconds`, `payment wait` follows
|
|
188
|
+
until the approval lapses and the payment settles, as `send` does; with it, the wait
|
|
189
|
+
stops after that many seconds (1 to 3600) with exit 5 and the same command to run again.
|
|
188
190
|
|
|
189
191
|
## Personal Payments
|
|
190
192
|
|
|
191
193
|
```sh
|
|
192
|
-
capxul payment retry PAYMENT_ID --
|
|
194
|
+
capxul payment retry PAYMENT_ID --json
|
|
193
195
|
capxul payment list --json
|
|
194
196
|
capxul payment get PAYMENT_ID --json
|
|
197
|
+
capxul payment wait PAYMENT_ID --json
|
|
195
198
|
capxul payment wait PAYMENT_ID --timeout-seconds 120 --json
|
|
196
199
|
```
|
|
197
200
|
|
|
198
201
|
These commands use the current authenticated session. Add `--email EMAIL` to
|
|
199
202
|
select a saved session. In a terminal, omit the required Payment ID to enter it.
|
|
203
|
+
`wait` follows a Payment until it ends unless `--timeout-seconds` bounds it.
|
|
200
204
|
`get` refuses when the Payment is absent or unavailable to the session. Human
|
|
201
205
|
output shows the full ID, status, amount, counterparty and available receipt.
|
|
202
206
|
|
|
@@ -205,9 +209,11 @@ action. A failed Payment can be a completed observation. The timeout accepts
|
|
|
205
209
|
1–3600 seconds and includes session restoration. A timeout or unavailable read
|
|
206
210
|
prints exact get/wait commands. Waiting never resubmits a Payment.
|
|
207
211
|
|
|
208
|
-
Retry
|
|
209
|
-
|
|
210
|
-
|
|
212
|
+
Retry prepares the retry of the exact Payment and hands over to the approval
|
|
213
|
+
page, exactly as `payment send` does: the page is the one and only
|
|
214
|
+
confirmation, and `--json` returns `awaiting_approval`, the link and
|
|
215
|
+
`next.argv` for `payment wait <approval id>`. It addresses the existing Payment
|
|
216
|
+
command and never creates a replacement send.
|
|
211
217
|
|
|
212
218
|
## Activity
|
|
213
219
|
|
|
@@ -240,7 +246,7 @@ capxul request get REQUEST_ID
|
|
|
240
246
|
capxul request cancel REQUEST_ID --confirm
|
|
241
247
|
capxul inbox list
|
|
242
248
|
capxul inbox get REQUEST_ID
|
|
243
|
-
capxul inbox pay REQUEST_ID
|
|
249
|
+
capxul inbox pay REQUEST_ID
|
|
244
250
|
capxul inbox decline REQUEST_ID --confirm
|
|
245
251
|
capxul request list --org ORGANIZATION_ID
|
|
246
252
|
capxul request issue --org ORGANIZATION_ID --input invoice.json --confirm
|
|
@@ -248,7 +254,7 @@ capxul request get --org ORGANIZATION_ID REQUEST_ID
|
|
|
248
254
|
capxul request cancel --org ORGANIZATION_ID REQUEST_ID --confirm
|
|
249
255
|
capxul inbox list --org ORGANIZATION_ID
|
|
250
256
|
capxul inbox get --org ORGANIZATION_ID REQUEST_ID
|
|
251
|
-
capxul inbox pay --org ORGANIZATION_ID REQUEST_ID --permission-id PERMISSION_ID
|
|
257
|
+
capxul inbox pay --org ORGANIZATION_ID REQUEST_ID --permission-id PERMISSION_ID
|
|
252
258
|
capxul inbox decline --org ORGANIZATION_ID REQUEST_ID --confirm
|
|
253
259
|
```
|
|
254
260
|
|
|
@@ -295,7 +301,9 @@ Issue accepts a basic payment request or an Invoice request JSON object from
|
|
|
295
301
|
`--input FILE` or `--input -`. Both require `payer` and an exact positive
|
|
296
302
|
`amount`. A basic request requires an explicit `reference` and accepts an
|
|
297
303
|
optional private `memo`. An Invoice request also supplies `invoice`.
|
|
298
|
-
Issue saves
|
|
304
|
+
Issue saves no file. Its human output names the `document render` command for
|
|
305
|
+
each document, and its JSON result is `{ scope, direction, item }`: the issued
|
|
306
|
+
request with its document references, with no document output.
|
|
299
307
|
Human and JSON output include `checkoutUrl` for an Invoice or Memo request
|
|
300
308
|
instruction with a link token. Invoice requests keep `/checkout/invoices/`.
|
|
301
309
|
Basic requests use `/checkout/requests/`. Movement documents do not create
|
|
@@ -305,9 +313,8 @@ For a custom deployment, set `CAPXUL_CHECKOUT_FRONTEND_ORIGIN` in both the CLI
|
|
|
305
313
|
and backend environments. Use the same frontend origin for both.
|
|
306
314
|
Offer create, get, list, revise, and deactivate output also include `checkoutUrl`.
|
|
307
315
|
The checkout page reads current terms and status when the link opens.
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
output; use the printed document render command.
|
|
316
|
+
Save a PDF with the printed `document render` command. Do not issue the request
|
|
317
|
+
again to get a PDF.
|
|
311
318
|
|
|
312
319
|
```json
|
|
313
320
|
{
|
|
@@ -359,7 +366,6 @@ CLI signer and the SDK fulfillment API. Organization payment requires the
|
|
|
359
366
|
selected Permission; the backend checks Budget and spending authority. The
|
|
360
367
|
command publishes prepared Payment IDs before signing. A submitted Payment
|
|
361
368
|
is not a settled Payment. Use the printed get/wait commands to inspect its state.
|
|
362
|
-
Returned documents use the same default PDF directory.
|
|
363
369
|
|
|
364
370
|
A lost reply or timeout gives exact readback in the same session and scope.
|
|
365
371
|
Pay refuses an already prepared Invoice unless you explicitly use `--resume`
|
|
@@ -391,12 +397,14 @@ file metadata. Each render uses a new private directory and preserves earlier
|
|
|
391
397
|
files. `export` writes the original bytes to a new file.
|
|
392
398
|
It refuses an existing output file.
|
|
393
399
|
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
+
Only `document render` and `document export` write files. Reads name each
|
|
401
|
+
document with the `document render` command that saves it: Payment `get`, `wait`
|
|
402
|
+
and `list`, Activity detail, Payroll `get` and `wait`. Writes save nothing either.
|
|
403
|
+
Payment `send` and `retry`, Payroll `run` and Inbox `pay` end with
|
|
404
|
+
`Save the receipt: capxul document render …` once the receipt exists, and
|
|
405
|
+
`request issue` prints that command for each document it issued. No write
|
|
406
|
+
result carries document output. A document that is still pending is named by
|
|
407
|
+
`payment get`.
|
|
400
408
|
|
|
401
409
|
## Contact commands
|
|
402
410
|
|
|
@@ -521,25 +529,14 @@ instructions with both Organization and Payment IDs.
|
|
|
521
529
|
## Organization Payment retry
|
|
522
530
|
|
|
523
531
|
```sh
|
|
524
|
-
capxul payment retry P --org O --
|
|
525
|
-
capxul payment retry
|
|
532
|
+
capxul payment retry P --org O --json
|
|
526
533
|
```
|
|
527
534
|
|
|
528
535
|
Retry addresses the original command and every Payment in that command. It
|
|
529
|
-
creates no replacement send or request key.
|
|
530
|
-
|
|
531
|
-
`--
|
|
532
|
-
|
|
533
|
-
Before signing, the preview shows every original Payment, recipient, exact
|
|
534
|
-
asset and quantity, timing, and state. It also shows the original command and
|
|
535
|
-
stored Budget. A human terminal asks one default-no question, including when
|
|
536
|
-
`--confirm` is supplied. The signer starts after this step. A changed prepared cohort
|
|
537
|
-
or actor refuses before signature.
|
|
538
|
-
|
|
539
|
-
The result is `{ payments }` in the SDK's original order. Submitted Payments
|
|
540
|
-
can still be pending. A failure, timeout, or interruption retains the selected
|
|
541
|
-
Organization, Payment, and verified sibling IDs with same-scope get/wait
|
|
542
|
-
commands. Retry does not claim settlement from a submission hash.
|
|
536
|
+
creates no replacement send or request key. The Organization's retry is
|
|
537
|
+
prepared for your own key and handed over to the approval page; the page
|
|
538
|
+
shows the whole cohort. `--json` returns the link and `next.argv` for
|
|
539
|
+
`payment wait <approval id> --org O`, which follows every Payment to its end.
|
|
543
540
|
|
|
544
541
|
## Permissions
|
|
545
542
|
|
|
@@ -569,11 +566,16 @@ Every Budget write supplies the complete policy:
|
|
|
569
566
|
"scope": {
|
|
570
567
|
"recipients": { "type": "allowlist", "accounts": ["account_alice"] },
|
|
571
568
|
"actions": ["pay"]
|
|
572
|
-
}
|
|
569
|
+
},
|
|
570
|
+
"refill": "monthly"
|
|
573
571
|
}
|
|
574
572
|
```
|
|
575
573
|
|
|
576
574
|
Use an exact admitted AssetId for `A`. The cap must be positive and finite.
|
|
575
|
+
`refill` is `monthly`, which refills the cap every 30 days (a fixed period from
|
|
576
|
+
the block that sets it, not a calendar month), or `none`. A create without
|
|
577
|
+
`refill` means `none`. A change without `refill` keeps the Budget's current
|
|
578
|
+
refill; write `"refill": "none"` to turn a refill off.
|
|
577
579
|
Recipients are `anyone` or 1 to 32 unique Account IDs. Actions are `pay`,
|
|
578
580
|
`commitments`, or both. `pay` covers single and batch Payments. Missing scope,
|
|
579
581
|
duplicate recipients/actions, unknown fields, and an asset mismatch refuse.
|
|
@@ -589,7 +591,14 @@ and printed before the first write. Scripted runs require `--request-key` and
|
|
|
589
591
|
`--confirm`.
|
|
590
592
|
|
|
591
593
|
Success means submitted and pending application. It does not prove active
|
|
592
|
-
rights.
|
|
594
|
+
rights. Add `--wait` to `create`, `change`, `assign`, `revoke` or `replace` to
|
|
595
|
+
follow the submitted command to its end, as `org permission command wait` does:
|
|
596
|
+
it stops when the command is applied, failed or needs action. The result then
|
|
597
|
+
also holds `command`, the command's view (`status` is `applied`, `failed` or
|
|
598
|
+
`actionable`), and exits 0 in each case, as `command wait` does; read `status`.
|
|
599
|
+
`--timeout-seconds` bounds the signing and, separately, the wait. A wait that
|
|
600
|
+
runs out of time fails with exit 5 and prints the exact `command get` and
|
|
601
|
+
`command wait` lines. After an interruption or uncertain result, retain the original input,
|
|
593
602
|
Organization ID, key, command ID, and execution ID. The key alone cannot restore
|
|
594
603
|
wizard/stdin input.
|
|
595
604
|
|
|
@@ -612,8 +621,8 @@ capxul org payroll groups save --org O --input group.json --confirm [--json]
|
|
|
612
621
|
capxul org payroll groups remove G --org O --confirm [--json]
|
|
613
622
|
capxul org payroll terms --org O [--json]
|
|
614
623
|
capxul org payroll list --org O [--json]
|
|
615
|
-
capxul org payroll run --org O --input run.json --request-key K
|
|
616
|
-
capxul org payroll run --org O --resume K
|
|
624
|
+
capxul org payroll run --org O --input run.json --request-key K [--json]
|
|
625
|
+
capxul org payroll run --org O --resume K [--json]
|
|
617
626
|
capxul org payroll get --org O R [--json]
|
|
618
627
|
capxul org payroll wait --org O R --timeout-seconds 120 [--json]
|
|
619
628
|
```
|
|
@@ -640,16 +649,18 @@ refuse before client work.
|
|
|
640
649
|
In a human terminal, `capxul org payroll run` guides the current Organization,
|
|
641
650
|
Budget, settlement asset, date, roster or known Parties, and actual payout
|
|
642
651
|
quantities. Roster amounts and terms are reference data. The complete preview
|
|
643
|
-
shows each recipient and Safe, quantity, raw units, and adjustment.
|
|
644
|
-
|
|
645
|
-
Machine runs require exact scope, input
|
|
652
|
+
shows each recipient and Safe, quantity, raw units, and adjustment. The run
|
|
653
|
+
is then prepared and handed over to the approval page, the one and only
|
|
654
|
+
confirmation. Machine runs require exact scope, input and key; `--json`
|
|
655
|
+
returns the approval link and `next.argv` for `payment wait <approval id> --org O`.
|
|
646
656
|
|
|
647
657
|
The command saves the exact input in protected storage under the verified actor,
|
|
648
658
|
Organization, and key before execution. `--resume K` restores that snapshot.
|
|
649
659
|
It requires the same explicit Organization and cannot combine fresh input or
|
|
650
660
|
another key. Payroll accepts email and Party references. Raw external addresses
|
|
651
661
|
are outside the current run contract.
|
|
652
|
-
|
|
662
|
+
`--resume K` prepares the same run again, so it reopens a pending approval
|
|
663
|
+
rather than paying twice.
|
|
653
664
|
|
|
654
665
|
Get returns the full authorized run detail, command, ordered items, and recorded
|
|
655
666
|
times. Wait observes the exact run without polling or submitting. It keeps
|
|
@@ -810,7 +821,14 @@ SDK's own value for the command, with no CLI wrapper. A list is the SDK page,
|
|
|
810
821
|
`{ items, nextCursor }`; pass `nextCursor` back as `--after` where the command
|
|
811
822
|
takes one. `--fields a,b` keeps only those fields of `data` (`amount.value`
|
|
812
823
|
reaches inside an object; a list keeps `nextCursor` and picks from each item).
|
|
813
|
-
`--fields` without `--json` refuses
|
|
824
|
+
`--fields` without `--json` refuses, and so does a typo: a name the result lacks that is a
|
|
825
|
+
letter or two off a name it has (exit 2, `field: "fields"`); the message names it, the
|
|
826
|
+
closest real field and the fields in this result. Any other name the result lacks, such as
|
|
827
|
+
an optional `execution` on a Payment that has none, is left out, as `jq` would.
|
|
828
|
+
The four commands that move money (`payment send`, `payment retry`, `inbox pay`,
|
|
829
|
+
`org payroll run`) check the names against the result they declare before they
|
|
830
|
+
run, so a typo never costs an approval: `status`, `approvalId`, `approvalUrl`,
|
|
831
|
+
`paymentIds`, `expiresAt` and `next`.
|
|
814
832
|
|
|
815
833
|
A failure contains `error`:
|
|
816
834
|
|
|
@@ -832,13 +850,21 @@ not grant authority or bypass current checks. `error.details.recovery` keeps
|
|
|
832
850
|
its `kind` (`read` or `retry`) next to the same `argv`.
|
|
833
851
|
|
|
834
852
|
A person sees one red line for what happened and one for what fixes it (on the
|
|
835
|
-
same line when both fit in 80 columns)
|
|
853
|
+
same line when both fit in 80 columns), then a dim last line, `ref <id>`, for
|
|
854
|
+
support:
|
|
836
855
|
|
|
837
856
|
```text
|
|
838
857
|
✗ Unknown command "paymnt". Did you mean: capxul payment list
|
|
839
858
|
✗ Not signed in. Try: capxul auth login
|
|
859
|
+
ref 6a0e10d1-06fb-4eed-9c2a-1f6f0c2b7d11
|
|
840
860
|
```
|
|
841
861
|
|
|
862
|
+
The `ref` is the backend's request ID when the error carries one, else its
|
|
863
|
+
correlation ID, else this run's `invocationId`. A mistyped command has none,
|
|
864
|
+
because no command started. An error that already quotes its request ID in its
|
|
865
|
+
sentence (a redacted backend error) has no `ref` line. JSON output has no `ref`
|
|
866
|
+
line and is unchanged: read `error.details.requestId` or `invocationId`.
|
|
867
|
+
|
|
842
868
|
A wallet failure
|
|
843
869
|
also includes its known `error.mode` and allowed `error.details`: wallet stage,
|
|
844
870
|
operation, provider, provider code, and HTTP status. An unknown browser failure
|
|
@@ -925,7 +951,7 @@ sign-in; it sets `NEXT_PUBLIC_CAPXUL_PUBLISHABLE_KEY` and `CAPXUL_SITE_URL` in
|
|
|
925
951
|
journeys with the built CLI against the local DevNet: sign in, `dev fund`, the home
|
|
926
952
|
screen, a payment (refused with its fix while the wallet setup is unfinished, as
|
|
927
953
|
it is on a DevNet with no wallet provider), requests, offers, Inbox, Organizations,
|
|
928
|
-
the account, `schema`, a typo's fix and `dev key`. The `
|
|
954
|
+
the account, `schema`, a typo's fix and `dev key`. The `cli-journeys` job in
|
|
929
955
|
`.github/workflows/devnet-integration.yml` starts the DevNet and runs it.
|
|
930
956
|
|
|
931
957
|
## Development commands
|
|
@@ -1049,7 +1075,7 @@ a concurrent logout from being undone by a delayed credential save. The backend
|
|
|
1049
1075
|
owns expiry and revocation. A failed remote logout is reported as `unconfirmed`;
|
|
1050
1076
|
local sign-out remains in effect.
|
|
1051
1077
|
|
|
1052
|
-
`
|
|
1078
|
+
`account show` returns a backend-read Profile and account lifecycle without opening
|
|
1053
1079
|
the browser. Successful email authentication can return `setupState: "setup-required"`.
|
|
1054
1080
|
`account retry` returns `setupState: "ready"` only after Core reads a ready Account.
|
|
1055
1081
|
After logout, profile reads refuse with `NOT_AUTHENTICATED` and exit 3. An invalid
|
|
@@ -1064,7 +1090,7 @@ capxul account retry --email you@example.com --wizard
|
|
|
1064
1090
|
|
|
1065
1091
|
The terminal shows the verified session, Account ID and current lifecycle before
|
|
1066
1092
|
confirmation. A ready Account starts no wallet work. Missing Account or Profile
|
|
1067
|
-
state directs to `account retry`. A deadline stops waiting; check `account
|
|
1093
|
+
state directs to `account retry`. A deadline stops waiting; check `account show`
|
|
1068
1094
|
for the same session before retrying.
|
|
1069
1095
|
|
|
1070
1096
|
Read an Organization treasury or deposit target:
|
|
@@ -1124,7 +1150,7 @@ capxul offer deactivate OFFER_ID --expected-revision 2 --confirm
|
|
|
1124
1150
|
capxul offer list --org ORG_ID
|
|
1125
1151
|
```
|
|
1126
1152
|
|
|
1127
|
-
|
|
1153
|
+
Add `--org ORG_ID` to run any of these as an Organization. Use `--email`
|
|
1128
1154
|
to select a saved session. Scripts must supply `--confirm` for each write.
|
|
1129
1155
|
A terminal shows the proposed change and asks for confirmation. Use `--json`
|
|
1130
1156
|
for structured output. Lists and reads create no PDF.
|
|
@@ -1160,16 +1186,16 @@ reference. Separate purchasers receive separate checkout and settlement IDs.
|
|
|
1160
1186
|
## Request and document flow
|
|
1161
1187
|
|
|
1162
1188
|
Alice issues a basic request or an Invoice to Bob with `request issue`. For an Organization issuer,
|
|
1163
|
-
Alice uses `
|
|
1164
|
-
|
|
1189
|
+
Alice uses `request issue --org ORGANIZATION_ID`. Issuance returns the request ID,
|
|
1190
|
+
document references, and checkout URL. Alice saves her PDF with the printed
|
|
1191
|
+
`document render` command.
|
|
1165
1192
|
Bob runs `inbox list`, then `inbox get REQUEST_ID`. An Organization
|
|
1166
|
-
payer uses the
|
|
1193
|
+
payer uses the same `inbox` commands with `--org`.
|
|
1167
1194
|
|
|
1168
|
-
Bob's Inbox contains the request and document references.
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
it does not download documents.
|
|
1195
|
+
Bob's Inbox contains the request and document references. Bob uses the printed
|
|
1196
|
+
`document render` command to save his copy. Both participants read the same verified document. Their files can
|
|
1197
|
+
have different local paths. The home screen (`capxul`) shows how many requests wait
|
|
1198
|
+
for you; it does not download documents.
|
|
1173
1199
|
|
|
1174
1200
|
A direct Payment uses the existing Payment and Activity commands. Alice inspects
|
|
1175
1201
|
her outgoing records. Bob inspects his incoming records after the backend observes
|
|
@@ -1183,10 +1209,10 @@ access remains available through the saved document and content hashes. Keep
|
|
|
1183
1209
|
those references when retaining a cancelled Invoice.
|
|
1184
1210
|
|
|
1185
1211
|
The shared document directory is `documents` next to the CLI settings directory.
|
|
1186
|
-
`CAPXUL_CLI_HOME` selects a separate CLI settings directory.
|
|
1187
|
-
the document output location
|
|
1188
|
-
|
|
1189
|
-
|
|
1212
|
+
`CAPXUL_CLI_HOME` selects a separate CLI settings directory. `document render
|
|
1213
|
+
--output-dir` changes the document output location. Each render preserves
|
|
1214
|
+
previous files. A failed PDF render does not repeat issuance or payment. Retry
|
|
1215
|
+
`document render` with the existing document references.
|
|
1190
1216
|
|
|
1191
1217
|
## Checkout links
|
|
1192
1218
|
|
|
@@ -1205,9 +1231,10 @@ External funding requires the correct network, balance, gas, and any exact token
|
|
|
1205
1231
|
approval. Payment goes through the Payments contract with the validated snapshot.
|
|
1206
1232
|
Inspect the resulting state and receipt before reporting payment complete.
|
|
1207
1233
|
|
|
1208
|
-
CLI `inbox pay`
|
|
1209
|
-
|
|
1210
|
-
|
|
1234
|
+
CLI `inbox pay` prepares the request's Payment and hands over to the approval
|
|
1235
|
+
page, as `payment send` does. It does not depend on the hosted checkout page.
|
|
1236
|
+
A rejection on the approval page is not permission to send another Payment.
|
|
1237
|
+
`--resume` reopens the approval of a request whose Payment is already prepared.
|
|
1211
1238
|
|
|
1212
1239
|
Checkout links do not create recurring billing, automatic debits, booking,
|
|
1213
1240
|
refunds, or QR codes.
|