@mooring-live/cli 0.0.0-stage → 0.2.0
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 +27 -2
- package/dist/index.d.ts +13 -0
- package/dist/index.js +164 -0
- package/dist/index.js.map +1 -0
- package/package.json +52 -4
package/README.md
CHANGED
|
@@ -1,3 +1,28 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @mooring-live/cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@mooring-live/cli)
|
|
4
|
+
|
|
5
|
+
Command-line companion to [`@mooring-live/x402-client`](https://www.npmjs.com/package/@mooring-live/x402-client):
|
|
6
|
+
generate an agent key, inspect a Mooring spending card, and pay an [x402](https://x402.org)-protected
|
|
7
|
+
API from it. A card is a Soroban custom account on Stellar that holds USDC and enforces a periodic
|
|
8
|
+
budget, a per-payment cap, a merchant allowlist and an expiry inside its authorization path.
|
|
9
|
+
|
|
10
|
+
Apache-2.0. **Stellar testnet only** — not audited, not on mainnet.
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
npm i -g @mooring-live/cli
|
|
14
|
+
|
|
15
|
+
mooring keygen --hex # a new agent keypair (--hex prints the signer bytes)
|
|
16
|
+
mooring status --card C… --json # label, policy, period, remaining budget, allowlist
|
|
17
|
+
AGENT_SECRET=S… mooring pay https://api.example.com/weather --card C…
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
`mooring pay` prints the HTTP status, the settlement transaction hash and the response body.
|
|
21
|
+
A refusal by the card's policy prints `Denied (<reason>) at <stage>` and exits with code **2**,
|
|
22
|
+
so a script can tell a refused payment from a broken one. `--no-precheck` skips the local policy
|
|
23
|
+
mirror (the card still enforces on-chain); `--agent-secret-env <NAME>` reads the secret from a
|
|
24
|
+
different variable; `--network` and `--rpc` select the network.
|
|
25
|
+
|
|
26
|
+
Cards are created and managed by their owner in the web app at https://app.mooring.live.
|
|
27
|
+
Integration guide, error semantics and facilitator constraints:
|
|
28
|
+
[`docs/x402-integration.md`](https://github.com/berkay1532/mooring/blob/main/docs/x402-integration.md).
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from "commander";
|
|
3
|
+
import { createMooringFetch, getSettlement, readCardInfo, readMerchants, type CardInfo } from "@mooring-live/x402-client";
|
|
4
|
+
/** Everything `buildProgram` needs from the outside world; tests inject fakes. */
|
|
5
|
+
export interface CliDeps {
|
|
6
|
+
readCardInfo: typeof readCardInfo;
|
|
7
|
+
readMerchants: typeof readMerchants;
|
|
8
|
+
createMooringFetch: typeof createMooringFetch;
|
|
9
|
+
getSettlement: typeof getSettlement;
|
|
10
|
+
stdout: (line: string) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function buildProgram(deps?: CliDeps): Command;
|
|
13
|
+
export type { CardInfo };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
import { realpathSync } from "node:fs";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { Keypair } from "@stellar/stellar-sdk";
|
|
6
|
+
import { getNetworkPassphrase, getRpcUrl } from "@x402/stellar";
|
|
7
|
+
import { Command, Option } from "commander";
|
|
8
|
+
import { CardPolicyDenied, DEFAULT_APP_URL, allowMerchantUrl, createMooringFetch, getSettlement, readCardInfo, readMerchants, } from "@mooring-live/x402-client";
|
|
9
|
+
const realDeps = {
|
|
10
|
+
readCardInfo,
|
|
11
|
+
readMerchants,
|
|
12
|
+
createMooringFetch,
|
|
13
|
+
getSettlement,
|
|
14
|
+
stdout: (line) => process.stdout.write(`${line}\n`),
|
|
15
|
+
};
|
|
16
|
+
/** JSON.stringify that renders bigints as strings and byte arrays as hex, instead of throwing or dumping index-keyed objects. */
|
|
17
|
+
function toJson(value) {
|
|
18
|
+
return JSON.stringify(value, (_key, v) => (typeof v === "bigint" ? v.toString() : v instanceof Uint8Array ? Buffer.from(v).toString("hex") : v), 2);
|
|
19
|
+
}
|
|
20
|
+
/** Deep-converts every bigint to a string and every byte array to hex, for table/plain printing. */
|
|
21
|
+
function stringifyBigints(value) {
|
|
22
|
+
if (typeof value === "bigint")
|
|
23
|
+
return value.toString();
|
|
24
|
+
if (value instanceof Uint8Array)
|
|
25
|
+
return Buffer.from(value).toString("hex");
|
|
26
|
+
if (Array.isArray(value))
|
|
27
|
+
return value.map(stringifyBigints);
|
|
28
|
+
if (value && typeof value === "object") {
|
|
29
|
+
return Object.fromEntries(Object.entries(value).map(([k, v]) => [k, stringifyBigints(v)]));
|
|
30
|
+
}
|
|
31
|
+
return value;
|
|
32
|
+
}
|
|
33
|
+
export function buildProgram(deps = realDeps) {
|
|
34
|
+
const program = new Command();
|
|
35
|
+
program
|
|
36
|
+
.name("mooring")
|
|
37
|
+
.description("CLI for Mooring spending cards (Soroban custom accounts on Stellar)")
|
|
38
|
+
.version("0.2.0");
|
|
39
|
+
program
|
|
40
|
+
.command("keygen")
|
|
41
|
+
.description("Generate a new agent keypair for a Mooring card signer")
|
|
42
|
+
.option("--hex", "also print the 32-byte public key as hex, for `create_card --signer`")
|
|
43
|
+
.action((opts) => {
|
|
44
|
+
const kp = Keypair.random();
|
|
45
|
+
deps.stdout(`Public key: ${kp.publicKey()}`);
|
|
46
|
+
deps.stdout(`Secret key: ${kp.secret()}`);
|
|
47
|
+
deps.stdout("WARNING: the secret key is shown once and never stored. Save it now (e.g. as AGENT_SECRET) — Mooring does not keep a copy.");
|
|
48
|
+
if (opts.hex) {
|
|
49
|
+
const hex = Buffer.from(kp.rawPublicKey()).toString("hex");
|
|
50
|
+
deps.stdout(`Signer hex: ${hex}`);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
program
|
|
54
|
+
.command("status")
|
|
55
|
+
.description("Print a card's on-chain info and merchant allowlist")
|
|
56
|
+
.requiredOption("--card <address>", "card contract address (C...)")
|
|
57
|
+
.addOption(new Option("--network <network>", "stellar network").choices(["stellar:testnet", "stellar:pubnet"]).default("stellar:testnet"))
|
|
58
|
+
.option("--rpc <url>", "override the default RPC URL for the network")
|
|
59
|
+
.option("--json", "print machine-readable JSON instead of a table")
|
|
60
|
+
.action(async (opts) => {
|
|
61
|
+
const rpcUrl = getRpcUrl(opts.network, opts.rpc ? { url: opts.rpc } : undefined);
|
|
62
|
+
const passphrase = getNetworkPassphrase(opts.network);
|
|
63
|
+
const [info, merchants] = await Promise.all([
|
|
64
|
+
deps.readCardInfo(rpcUrl, passphrase, opts.card),
|
|
65
|
+
deps.readMerchants(rpcUrl, passphrase, opts.card),
|
|
66
|
+
]);
|
|
67
|
+
if (opts.json) {
|
|
68
|
+
deps.stdout(toJson({ info, merchants }));
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
deps.stdout(`Label: ${info.label}`);
|
|
72
|
+
deps.stdout(`Card: ${opts.card}`);
|
|
73
|
+
deps.stdout(`Network: ${opts.network}`);
|
|
74
|
+
deps.stdout("Info:");
|
|
75
|
+
deps.stdout(toJson(stringifyBigints(info)));
|
|
76
|
+
deps.stdout("Merchants:");
|
|
77
|
+
deps.stdout(merchants.length ? merchants.map((m) => ` ${m}`).join("\n") : " (none)");
|
|
78
|
+
});
|
|
79
|
+
program
|
|
80
|
+
.command("pay")
|
|
81
|
+
.description("Pay an x402-protected URL from a Mooring card")
|
|
82
|
+
.argument("<url>", "the x402-protected URL to request")
|
|
83
|
+
.requiredOption("--card <address>", "card contract address (C...)")
|
|
84
|
+
.option("--agent-secret-env <name>", "env var holding the agent's Stellar secret key", "AGENT_SECRET")
|
|
85
|
+
.addOption(new Option("--network <network>", "stellar network").choices(["stellar:testnet", "stellar:pubnet"]).default("stellar:testnet"))
|
|
86
|
+
.option("--rpc <url>", "override the default RPC URL for the network")
|
|
87
|
+
.option("--no-precheck", "skip the local policy pre-check before signing")
|
|
88
|
+
.action(async (url, opts) => {
|
|
89
|
+
const secretEnvName = opts.agentSecretEnv ?? "AGENT_SECRET";
|
|
90
|
+
const secret = process.env[secretEnvName];
|
|
91
|
+
if (!secret) {
|
|
92
|
+
deps.stdout(`Missing agent secret: set ${secretEnvName} to the agent's Stellar secret key (S...).`);
|
|
93
|
+
process.exitCode = 2;
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
let agent;
|
|
97
|
+
try {
|
|
98
|
+
agent = Keypair.fromSecret(secret);
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
deps.stdout(`Invalid agent secret in $${secretEnvName}`);
|
|
102
|
+
process.exitCode = 1;
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
const fetchWithPayment = deps.createMooringFetch({
|
|
106
|
+
card: opts.card,
|
|
107
|
+
agent,
|
|
108
|
+
network: opts.network,
|
|
109
|
+
rpcUrl: opts.rpc,
|
|
110
|
+
precheck: opts.precheck,
|
|
111
|
+
});
|
|
112
|
+
try {
|
|
113
|
+
const res = await fetchWithPayment(url);
|
|
114
|
+
deps.stdout(`HTTP ${res.status}`);
|
|
115
|
+
const settlement = deps.getSettlement(res);
|
|
116
|
+
if (settlement) {
|
|
117
|
+
deps.stdout(`Settlement: ${settlement.transaction} (${settlement.network})`);
|
|
118
|
+
}
|
|
119
|
+
const body = await res.text();
|
|
120
|
+
deps.stdout(body);
|
|
121
|
+
}
|
|
122
|
+
catch (err) {
|
|
123
|
+
if (err instanceof CardPolicyDenied) {
|
|
124
|
+
deps.stdout(`Denied (${err.reason}) at ${err.stage}`);
|
|
125
|
+
if (err.merchant?.url) {
|
|
126
|
+
deps.stdout(`Allow it: ${allowMerchantUrl(DEFAULT_APP_URL, opts.card, err.merchant.url)}`);
|
|
127
|
+
}
|
|
128
|
+
process.exitCode = 2;
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
throw err;
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
return program;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Resolves a path through symlinks, falling back to a plain `path.resolve`
|
|
138
|
+
* when the path does not exist (e.g. under test) or cannot be read.
|
|
139
|
+
*/
|
|
140
|
+
function realOrResolved(p) {
|
|
141
|
+
try {
|
|
142
|
+
return realpathSync(p);
|
|
143
|
+
}
|
|
144
|
+
catch {
|
|
145
|
+
return path.resolve(p);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
// Robust equivalent of `import.meta.url === \`file://${process.argv[1]}\``:
|
|
149
|
+
// resolves both sides through symlinks before comparing, so it works when the
|
|
150
|
+
// CLI is invoked through its installed bin symlink (npm links `mooring` into
|
|
151
|
+
// `node_modules/.bin`, which points at the package under `node_modules/@mooring-live/cli`,
|
|
152
|
+
// itself a workspace symlink — `fileURLToPath(import.meta.url)` follows all of
|
|
153
|
+
// that back to the real `dist/index.js`, but `process.argv[1]` does not unless
|
|
154
|
+
// resolved the same way). Never runs `parseAsync` when the module is only imported.
|
|
155
|
+
const isMainModule = process.argv[1] !== undefined && fileURLToPath(import.meta.url) === realOrResolved(process.argv[1]);
|
|
156
|
+
if (isMainModule) {
|
|
157
|
+
void buildProgram()
|
|
158
|
+
.parseAsync(process.argv)
|
|
159
|
+
.catch((err) => {
|
|
160
|
+
process.stderr.write(`${err instanceof Error ? err.message : String(err)}\n`);
|
|
161
|
+
process.exitCode = 1;
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,eAAe,C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
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "CLI for Mooring spending cards on Stellar: generate an agent key, inspect a card, pay an x402 API from it.",
|
|
5
|
+
"private": false,
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/berkay1532/mooring.git",
|
|
10
|
+
"directory": "packages/cli"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://mooring.live",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/berkay1532/mooring/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"stellar",
|
|
18
|
+
"soroban",
|
|
19
|
+
"x402",
|
|
20
|
+
"usdc",
|
|
21
|
+
"ai-agents",
|
|
22
|
+
"cli"
|
|
23
|
+
],
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": ">=20"
|
|
26
|
+
},
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public"
|
|
29
|
+
},
|
|
30
|
+
"type": "module",
|
|
31
|
+
"bin": {
|
|
32
|
+
"mooring": "./dist/index.js"
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"dist",
|
|
36
|
+
"README.md"
|
|
37
|
+
],
|
|
38
|
+
"scripts": {
|
|
39
|
+
"prepublishOnly": "npm run build",
|
|
40
|
+
"build": "tsc -p tsconfig.json",
|
|
41
|
+
"typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.test.json --noEmit",
|
|
42
|
+
"test": "vitest run"
|
|
43
|
+
},
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"@mooring-live/x402-client": "0.2.0",
|
|
46
|
+
"@stellar/stellar-sdk": "17.0.1",
|
|
47
|
+
"commander": "^12.1.0"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@types/node": "^22.0.0",
|
|
51
|
+
"typescript": "^5.6.0",
|
|
52
|
+
"vitest": "^3.0.0"
|
|
53
|
+
}
|
|
54
|
+
}
|