@capxul/cli 4.20.0-beta.29 → 4.20.0-beta.30
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 +56 -73
- package/dist/browser/signer.js +10 -4
- package/dist/browser/signer.js.map +1 -1
- package/dist/{entry-kvdchEO1.mjs → entry-Cp3LiVYn.mjs} +2134 -2318
- package/dist/entry-Cp3LiVYn.mjs.map +1 -0
- package/dist/main.mjs +1 -1
- package/dist/{organizations-BAIv8qyL.mjs → organizations-Dkb73lVO.mjs} +33 -20
- package/dist/organizations-Dkb73lVO.mjs.map +1 -0
- package/dist/{permission-approvals-DzfNZsW0.mjs → permission-approvals-C3cUSQeT.mjs} +2 -2
- package/dist/{permission-approvals-DzfNZsW0.mjs.map → permission-approvals-C3cUSQeT.mjs.map} +1 -1
- package/package.json +4 -4
- package/dist/entry-kvdchEO1.mjs.map +0 -1
- package/dist/organizations-BAIv8qyL.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# Capxul CLI
|
|
2
2
|
|
|
3
|
-
The CLI provides email OTP login, persistent first-party sessions,
|
|
4
|
-
|
|
3
|
+
The CLI provides email OTP login, persistent first-party sessions, a handover to
|
|
4
|
+
the web app for Account setup, personal and Organization contacts, a bundled
|
|
5
|
+
Openfort wallet page for Organization setup,
|
|
5
6
|
backend profile and account reads, diagnostics, and one global collection
|
|
6
7
|
preference. It requires Node 24 or later on macOS or Linux.
|
|
7
8
|
|
|
@@ -228,7 +229,11 @@ payment to whoever funded it; `redirect` sends it to someone else. For an
|
|
|
228
229
|
Organization's held payment only an Owner may cancel or redirect it; anyone else,
|
|
229
230
|
a Budget member included, is refused before anything is prepared. Both hand over
|
|
230
231
|
to the approval page as `send` does, then read the Payment until the chain shows
|
|
231
|
-
the step (`payment wait <approval id>` reports them once sent).
|
|
232
|
+
the step (`payment wait <approval id>` reports them once sent). A cancelled
|
|
233
|
+
payment keeps the amount it was for. A cancel or redirect of a payment that is
|
|
234
|
+
no longer held is refused (`WRONG_STATE`, exit 2) with `Payment <id> is already
|
|
235
|
+
cancelled.` or the state it is in. A held payment that was never signed reads
|
|
236
|
+
`failed`, not `scheduled`.
|
|
232
237
|
|
|
233
238
|
Retry prepares the retry of the exact Payment and hands over to the approval
|
|
234
239
|
page, exactly as `payment send` does: the page is the one and only
|
|
@@ -481,10 +486,10 @@ Organization's treasury with `--org`. Balance shows exact asset quantities and
|
|
|
481
486
|
available fiat valuations. An unavailable valuation or failed read is not zero.
|
|
482
487
|
`address` uses the SDK's address and network.
|
|
483
488
|
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
489
|
+
Account setup finishes in the Capxul web app, not in the CLI: it creates your
|
|
490
|
+
wallet, which needs you in a browser, and the CLI never opens one. `account retry`
|
|
491
|
+
reads your Account; when it is not ready, it prints the web app link. Run it again
|
|
492
|
+
to check: it returns the same handover until the Account is ready.
|
|
488
493
|
|
|
489
494
|
## Organization commands
|
|
490
495
|
|
|
@@ -626,7 +631,10 @@ read `status`. `--json --wait` writes the approval link to stderr as one
|
|
|
626
631
|
`approval.awaiting` event and returns once it is followed through.
|
|
627
632
|
`--timeout-seconds` bounds how long the CLI follows it (default: until the
|
|
628
633
|
approval lapses). A follow that runs out of time fails with exit 5 and names the
|
|
629
|
-
wait command.
|
|
634
|
+
wait command. The same write run again with a request key whose command was
|
|
635
|
+
already sent opens no approval and shows no link: it reads the command and
|
|
636
|
+
prints `Already applied: …` (or where it stands), with the command's view in
|
|
637
|
+
`command`. After an interruption or uncertain result, retain the original
|
|
630
638
|
input, Organization ID, key, command ID, and execution ID. The key alone cannot
|
|
631
639
|
restore wizard/stdin input.
|
|
632
640
|
|
|
@@ -853,7 +861,9 @@ known, the command lists your Organizations instead of guessing one.
|
|
|
853
861
|
`--json` writes one version 1 envelope to stdout. Success contains `data`: the
|
|
854
862
|
SDK's own value for the command, with no CLI wrapper. A list is the SDK page,
|
|
855
863
|
`{ items, nextCursor }`; pass `nextCursor` back as `--after` where the command
|
|
856
|
-
takes one.
|
|
864
|
+
takes one. A list whose next cursor would show the same page again fails with
|
|
865
|
+
exit 1 and `The list did not advance past the cursor <cursor>`, so a paging loop
|
|
866
|
+
ends. `--fields a,b` keeps only those fields of `data` (`amount.value`
|
|
857
867
|
reaches inside an object; a list keeps `nextCursor` and picks from each item).
|
|
858
868
|
`--fields` without `--json` refuses, and so does a typo: a name the result lacks that is a
|
|
859
869
|
letter or two off a name it has (exit 2, `field: "fields"`); the message names it, the
|
|
@@ -1010,17 +1020,26 @@ This CLI establishes a first-party BetterAuth session. An older native
|
|
|
1010
1020
|
Logout clears the selected email's session and attempts to revoke any native
|
|
1011
1021
|
grant that was stored before the first-party flow replaced it.
|
|
1012
1022
|
|
|
1013
|
-
`
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
times for one request. After sign-in, an incomplete account gets one offer to
|
|
1017
|
-
continue setup in the same command. `account retry` authenticates first, then asks
|
|
1018
|
-
for the Profile fields: display name, two-letter country code, and handle. A
|
|
1019
|
-
known value is the prompt default, so Enter keeps it.
|
|
1023
|
+
On a terminal, `auth login` is a wizard. It asks for the email and a masked OTP.
|
|
1024
|
+
It accepts the code as a paste. It retries an invalid code at most three times
|
|
1025
|
+
for one request.
|
|
1020
1026
|
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1027
|
+
`auth login` and `account retry` never open a browser, in any output mode. When
|
|
1028
|
+
your Account is not set up, they print where to finish it:
|
|
1029
|
+
|
|
1030
|
+
```text
|
|
1031
|
+
Signed in as person@example.com.
|
|
1032
|
+
Account setup required.
|
|
1033
|
+
Finish setting up your Account in your browser, signed in as person@example.com:
|
|
1034
|
+
https://app.staging.capxul.com/
|
|
1035
|
+
Then check it with: capxul account retry --email 'person@example.com'
|
|
1036
|
+
```
|
|
1037
|
+
|
|
1038
|
+
With `--json`, `data` carries the same handover:
|
|
1039
|
+
`setupState: "setup-required"`, `status: "awaiting_setup"`, `setupUrl` and
|
|
1040
|
+
`next.argv` (`["capxul", "account", "retry", "--email", EMAIL, "--json"]`, with the
|
|
1041
|
+
`--org` and `--env` you typed). That read exits 0 and returns the handover again,
|
|
1042
|
+
or the ready report. `capxul schema auth login` declares the shape.
|
|
1024
1043
|
|
|
1025
1044
|
Ctrl+C or Ctrl+D at a wizard prompt cancels the command. The command prints no
|
|
1026
1045
|
success result and exits 130. A step that already finished keeps its result: a
|
|
@@ -1041,67 +1060,33 @@ After sending a code, the output names `capxul auth verify <code>`. If
|
|
|
1041
1060
|
verification has no waiting sign-in, the error names `capxul auth login`.
|
|
1042
1061
|
Neither command prints the code itself.
|
|
1043
1062
|
|
|
1044
|
-
If account setup or its final read fails recoverably, the CLI prints an exact
|
|
1045
|
-
`account retry` continuation with your email and Profile fields. Run it with the
|
|
1046
|
-
same protected CLI home to resume the saved session. Explicit access/input
|
|
1047
|
-
refusals and non-retryable failures require their stated correction first.
|
|
1048
|
-
|
|
1049
1063
|
Human profile/status output labels your Profile fields and available Account,
|
|
1050
1064
|
wallet and Smart Account identifiers. Failed setup includes its stage and error
|
|
1051
1065
|
code. These reads do not open the wallet browser. `--json` retains the structured
|
|
1052
1066
|
result, including the same Profile and lifecycle values.
|
|
1053
1067
|
|
|
1054
1068
|
A machine run never prompts. `auth login` with `--otp-stdin` sends the OTP and
|
|
1055
|
-
verifies one code from stdin. It returns the
|
|
1056
|
-
|
|
1057
|
-
setup work, so sign-in never becomes signup.
|
|
1058
|
-
|
|
1059
|
-
A fresh machine signup does verification and setup in one command. State every
|
|
1060
|
-
Profile field; a missing field refuses with exit 2:
|
|
1061
|
-
|
|
1062
|
-
```sh
|
|
1063
|
-
# Supply only the delivered OTP through stdin.
|
|
1064
|
-
capxul account retry --email "$TEST_EMAIL" --otp-stdin \
|
|
1065
|
-
--display-name "Test Person" --country GH --handle test_person --json
|
|
1066
|
-
```
|
|
1069
|
+
verifies one code from stdin. It returns the profile report, with the setup
|
|
1070
|
+
handover when the Account is not ready. It starts no setup work.
|
|
1067
1071
|
|
|
1068
1072
|
`--otp-stdin` reads up to 64 bytes, ending at EOF. Pipe from a secret provider or
|
|
1069
1073
|
use input redirection from a protected file. An invalid value refuses with exit 2.
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
remains valid.
|
|
1081
|
-
|
|
1082
|
-
`account retry` returns only two readiness results. `setupState: "ready"` is a
|
|
1083
|
-
personal Account that the Account readiness owner reads as ready and deployed,
|
|
1084
|
-
and its data carries the public identifiers: the Profile, the public wallet
|
|
1085
|
-
address (`smartAccount.signerAddress`), the personal Smart Account address
|
|
1086
|
-
(`smartAccount.smartAccountAddress`), the Account ID
|
|
1087
|
-
(`lifecycle.accountId`), and the ready status. Any other state returns the typed
|
|
1088
|
-
recoverable result `setupState: "setup-required"`, with the lifecycle, its
|
|
1089
|
-
failure code, and the command that resumes the journey. A ready Account starts
|
|
1090
|
-
no wallet work, so a retry keeps the one Profile, wallet, Smart Account, and
|
|
1091
|
-
Account. An interruption keeps the stored session and stores no code, so the
|
|
1092
|
-
next command resumes the same setup.
|
|
1074
|
+
Only `auth verify <code>` accepts a code as an argument: the code is single-use
|
|
1075
|
+
and expires in minutes. Codes are never persisted or included in output.
|
|
1076
|
+
|
|
1077
|
+
`setupState: "ready"` is a personal Account that the Account readiness owner
|
|
1078
|
+
reads as ready and deployed. Its data carries the public identifiers: the
|
|
1079
|
+
Profile, the public wallet address (`smartAccount.signerAddress`), the personal
|
|
1080
|
+
Smart Account address (`smartAccount.smartAccountAddress`), the Account ID
|
|
1081
|
+
(`lifecycle.accountId`), and the ready status. Any other state is
|
|
1082
|
+
`setupState: "setup-required"` with the lifecycle, its failure code, and the
|
|
1083
|
+
handover above.
|
|
1093
1084
|
|
|
1094
1085
|
A ready personal Account continues the same journey into Organization creation
|
|
1095
1086
|
with `capxul org create --name NAME --handle HANDLE --country CC`. The create
|
|
1096
1087
|
command records the safe recovery handle for that Organization, so an
|
|
1097
1088
|
interruption or a restart resumes the exact same Organization.
|
|
1098
1089
|
|
|
1099
|
-
The CLI checks `--display-name`, `--country`, and `--handle` before it opens a
|
|
1100
|
-
client, so a malformed value refuses with exit 2 and no code is sent. The handle
|
|
1101
|
-
check covers the grammar only: a handle that another person holds, and a reserved
|
|
1102
|
-
handle, refuse through the identity owner after sign-in. Both refusals name the
|
|
1103
|
-
handle, and neither offers verification-code recovery for a Profile problem.
|
|
1104
|
-
|
|
1105
1090
|
The version 2 `first-party-session` record stores the opaque provider credential
|
|
1106
1091
|
in the existing protected plaintext store. Its scope includes the application
|
|
1107
1092
|
key, issuer, environment, and email. Each process validates restoration with the
|
|
@@ -1112,21 +1097,19 @@ local sign-out remains in effect.
|
|
|
1112
1097
|
|
|
1113
1098
|
`account show` returns a backend-read Profile and account lifecycle without opening
|
|
1114
1099
|
the browser. Successful email authentication can return `setupState: "setup-required"`.
|
|
1115
|
-
`account retry` returns `setupState: "ready"` only after Core reads a ready Account
|
|
1100
|
+
`account retry` returns `setupState: "ready"` only after Core reads a ready Account;
|
|
1101
|
+
otherwise it returns the web app handover.
|
|
1116
1102
|
After logout, profile reads refuse with `NOT_AUTHENTICATED` and exit 3. An invalid
|
|
1117
1103
|
or expired OTP refuses with exit 2.
|
|
1118
1104
|
|
|
1119
|
-
|
|
1105
|
+
Find where to finish an incomplete personal Account:
|
|
1120
1106
|
|
|
1121
1107
|
```sh
|
|
1122
|
-
capxul account retry --email you@example.com
|
|
1123
|
-
capxul account retry --email you@example.com --wizard
|
|
1108
|
+
capxul account retry --email you@example.com
|
|
1124
1109
|
```
|
|
1125
1110
|
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
state directs to `account retry`. A deadline stops waiting; check `account show`
|
|
1129
|
-
for the same session before retrying.
|
|
1111
|
+
It writes nothing and opens no browser. Missing Account or Profile state in other
|
|
1112
|
+
commands directs to `account retry`.
|
|
1130
1113
|
|
|
1131
1114
|
Read an Organization treasury or deposit target:
|
|
1132
1115
|
|
package/dist/browser/signer.js
CHANGED
|
@@ -15200,7 +15200,9 @@ faucetMint: Operation.action("accounts.grants.faucetMint", {
|
|
|
15200
15200
|
needsYou: NullOr(Struct({
|
|
15201
15201
|
requestsToPay: ArraySchema(String$1),
|
|
15202
15202
|
payrollToApprove: ArraySchema(String$1),
|
|
15203
|
-
paymentsToRetry: ArraySchema(String$1)
|
|
15203
|
+
paymentsToRetry: ArraySchema(String$1),
|
|
15204
|
+
/** The caller's capped Budgets in the Organization with nothing left this period. */
|
|
15205
|
+
budgetsUsedUp: ArraySchema(String$1)
|
|
15204
15206
|
})),
|
|
15205
15207
|
/** The newest rows of the actor's activity. */
|
|
15206
15208
|
recentActivity: NullOr(ArraySchema(ActivityItemSchema))
|
|
@@ -15857,7 +15859,8 @@ ensure: Operation.action("documents.memos.ensure", {
|
|
|
15857
15859
|
"verified",
|
|
15858
15860
|
"mismatch",
|
|
15859
15861
|
"provider_failure",
|
|
15860
|
-
"applied"
|
|
15862
|
+
"applied",
|
|
15863
|
+
"abandoned"
|
|
15861
15864
|
]),
|
|
15862
15865
|
executionState: Literals([
|
|
15863
15866
|
"unprepared",
|
|
@@ -18044,7 +18047,8 @@ list: Operation.query("payroll.terms.list", {
|
|
|
18044
18047
|
"verified",
|
|
18045
18048
|
"mismatch",
|
|
18046
18049
|
"provider_failure",
|
|
18047
|
-
"applied"
|
|
18050
|
+
"applied",
|
|
18051
|
+
"abandoned"
|
|
18048
18052
|
]),
|
|
18049
18053
|
status: Literals([
|
|
18050
18054
|
"pending",
|
|
@@ -19543,7 +19547,9 @@ loadBudgetLeft: "permissions.authorities.loadBudgetLeft" },
|
|
|
19543
19547
|
/** The prepare action's transaction: authorize, plan and save the command. */
|
|
19544
19548
|
prepareIntent: "permissions.commands.prepareIntent",
|
|
19545
19549
|
/** The submit action's transaction: record the accepted UserOperation. */
|
|
19546
|
-
completeExecution: "permissions.commands.completeExecution"
|
|
19550
|
+
completeExecution: "permissions.commands.completeExecution",
|
|
19551
|
+
/** The prepare's cleanup: a saved command whose UserOperation could not be built ends. */
|
|
19552
|
+
abandonUnbuilt: "permissions.commands.abandonUnbuilt"
|
|
19547
19553
|
},
|
|
19548
19554
|
configurations: {
|
|
19549
19555
|
prepareIntent: "permissions.configurations.prepareIntent",
|