@xona-labs/xpay 0.2.23 → 0.2.25
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/CHANGELOG.md +133 -76
- package/README.md +95 -71
- package/SKILL.md +29 -22
- package/dist/agenc/api.d.ts +8 -8
- package/dist/agenc/api.js +11 -11
- package/dist/agenc/hire.d.ts +4 -4
- package/dist/agenc/hire.js +17 -17
- package/dist/agenc/price.d.ts +1 -1
- package/dist/agenc/price.js +1 -1
- package/dist/biometric/index.d.ts +3 -3
- package/dist/biometric/index.js +6 -6
- package/dist/cli/accounts.d.ts +1 -1
- package/dist/cli/accounts.js +1 -1
- package/dist/cli/agenc.d.ts +2 -2
- package/dist/cli/agenc.js +4 -4
- package/dist/cli/balance.d.ts +1 -1
- package/dist/cli/balance.d.ts.map +1 -1
- package/dist/cli/balance.js +11 -10
- package/dist/cli/balance.js.map +1 -1
- package/dist/cli/bento.d.ts +3 -3
- package/dist/cli/bento.js +8 -8
- package/dist/cli/bento.js.map +1 -1
- package/dist/cli/biometric.d.ts +1 -1
- package/dist/cli/biometric.js +8 -8
- package/dist/cli/common.js +6 -6
- package/dist/cli/common.js.map +1 -1
- package/dist/cli/discover.d.ts +2 -2
- package/dist/cli/discover.js +10 -4
- package/dist/cli/discover.js.map +1 -1
- package/dist/cli/guardrail.d.ts +1 -1
- package/dist/cli/guardrail.js +3 -3
- package/dist/cli/index.d.ts +2 -2
- package/dist/cli/index.js +12 -12
- package/dist/cli/init.d.ts +1 -1
- package/dist/cli/init.js +2 -2
- package/dist/cli/magicblock.d.ts +1 -1
- package/dist/cli/magicblock.js +4 -4
- package/dist/cli/mcp-server.d.ts +2 -2
- package/dist/cli/mcp-server.js +21 -21
- package/dist/cli/pay.d.ts +1 -1
- package/dist/cli/pay.js +1 -1
- package/dist/cli/report.d.ts +2 -2
- package/dist/cli/report.js +4 -4
- package/dist/cli/report.js.map +1 -1
- package/dist/cli/sana.d.ts +1 -1
- package/dist/cli/sana.js +3 -3
- package/dist/cli/shop.d.ts +1 -1
- package/dist/cli/shop.js +1 -1
- package/dist/cli/swap.d.ts +1 -1
- package/dist/cli/swap.js +3 -3
- package/dist/cli/token.d.ts +2 -2
- package/dist/cli/token.js +2 -2
- package/dist/cli/trade.d.ts +2 -2
- package/dist/cli/trade.js +8 -8
- package/dist/cli/trade.js.map +1 -1
- package/dist/cli/transfer.d.ts +1 -1
- package/dist/cli/transfer.js +1 -1
- package/dist/cli/x.d.ts +1 -1
- package/dist/cli/x.js +1 -1
- package/dist/cli/zauth.d.ts +1 -1
- package/dist/cli/zauth.js +5 -5
- package/dist/discover/cache.js +1 -1
- package/dist/discover/index.d.ts +2 -2
- package/dist/discover/index.d.ts.map +1 -1
- package/dist/discover/index.js +21 -7
- package/dist/discover/index.js.map +1 -1
- package/dist/discover/orbitx402.d.ts +2 -2
- package/dist/discover/orbitx402.js +1 -1
- package/dist/discover/payai.js +1 -1
- package/dist/do/index.d.ts +2 -2
- package/dist/do/index.js +1 -1
- package/dist/guardrail/index.d.ts +4 -4
- package/dist/guardrail/index.js +14 -14
- package/dist/guardrail/index.js.map +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.js +2 -2
- package/dist/magicblock/client.d.ts +2 -2
- package/dist/magicblock/client.js +4 -4
- package/dist/profile/index.d.ts +3 -3
- package/dist/profile/index.d.ts.map +1 -1
- package/dist/profile/index.js +13 -4
- package/dist/profile/index.js.map +1 -1
- package/dist/profile/storage.d.ts +1 -1
- package/dist/profile/storage.js +4 -4
- package/dist/profile/types.d.ts +6 -6
- package/dist/profile/types.js +1 -1
- package/dist/report/index.d.ts +1 -1
- package/dist/report/index.js +2 -2
- package/dist/sana/tools.js +8 -8
- package/dist/signers/raw-evm.d.ts +1 -1
- package/dist/signers/raw-evm.d.ts.map +1 -1
- package/dist/signers/raw-evm.js +22 -7
- package/dist/signers/raw-evm.js.map +1 -1
- package/dist/signers/raw-solana.d.ts +1 -1
- package/dist/signers/raw-solana.js +4 -4
- package/dist/swap/index.d.ts +6 -6
- package/dist/swap/index.js +12 -12
- package/dist/token/index.d.ts +8 -8
- package/dist/token/index.js +14 -14
- package/dist/token/rwa.d.ts +3 -3
- package/dist/token/rwa.js +3 -3
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +46 -41
- package/dist/tools/index.js.map +1 -1
- package/dist/trading/discovery.d.ts +6 -6
- package/dist/trading/discovery.js +7 -7
- package/dist/trading/index.d.ts +6 -6
- package/dist/trading/index.js +13 -13
- package/dist/transfer/index.d.ts +6 -5
- package/dist/transfer/index.d.ts.map +1 -1
- package/dist/transfer/index.js +41 -21
- package/dist/transfer/index.js.map +1 -1
- package/dist/types.d.ts +10 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/use/index.d.ts +5 -5
- package/dist/use/index.js +24 -20
- package/dist/use/index.js.map +1 -1
- package/dist/wallet/index.d.ts +2 -2
- package/dist/wallet/index.d.ts.map +1 -1
- package/dist/wallet/index.js +5 -3
- package/dist/wallet/index.js.map +1 -1
- package/dist/x402/evm-payment.d.ts +4 -4
- package/dist/x402/evm-payment.d.ts.map +1 -1
- package/dist/x402/evm-payment.js +7 -6
- package/dist/x402/evm-payment.js.map +1 -1
- package/dist/x402/extract.d.ts +1 -1
- package/dist/x402/extract.js +1 -1
- package/dist/x402/svm-payment.d.ts +2 -2
- package/dist/x402/svm-payment.js +2 -2
- package/dist/zauth/index.d.ts +4 -4
- package/dist/zauth/index.js +5 -5
- package/package.json +6 -3
package/dist/cli/biometric.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `xpay biometric enable|disable|status`
|
|
2
|
+
* `xpay biometric enable|disable|status` - Touch ID unlock for a profile
|
|
3
3
|
* (macOS only). `enable` verifies the passphrase against the wallet, runs a
|
|
4
4
|
* Touch ID check, then stores the passphrase in the login keychain; from
|
|
5
5
|
* then on `unlockActive` offers Touch ID before falling back to typing.
|
package/dist/cli/biometric.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `xpay biometric enable|disable|status`
|
|
2
|
+
* `xpay biometric enable|disable|status` - Touch ID unlock for a profile
|
|
3
3
|
* (macOS only). `enable` verifies the passphrase against the wallet, runs a
|
|
4
4
|
* Touch ID check, then stores the passphrase in the login keychain; from
|
|
5
5
|
* then on `unlockActive` offers Touch ID before falling back to typing.
|
|
@@ -26,7 +26,7 @@ export async function runBiometricEnable(opts) {
|
|
|
26
26
|
}
|
|
27
27
|
const wallet = readWalletFile(profilePath(name));
|
|
28
28
|
if (!wallet.encrypted) {
|
|
29
|
-
console.error(chalk.red(`✗ Profile "${name}" is unencrypted (dev wallet)
|
|
29
|
+
console.error(chalk.red(`✗ Profile "${name}" is unencrypted (dev wallet) - there is no passphrase to protect.`));
|
|
30
30
|
process.exit(1);
|
|
31
31
|
}
|
|
32
32
|
let biometry;
|
|
@@ -38,7 +38,7 @@ export async function runBiometricEnable(opts) {
|
|
|
38
38
|
process.exit(1);
|
|
39
39
|
}
|
|
40
40
|
if (!biometry) {
|
|
41
|
-
console.error(chalk.red("✗ No usable biometry
|
|
41
|
+
console.error(chalk.red("✗ No usable biometry - enroll Touch ID in System Settings first."));
|
|
42
42
|
process.exit(1);
|
|
43
43
|
}
|
|
44
44
|
// Verify the passphrase actually unlocks this wallet before storing it.
|
|
@@ -59,14 +59,14 @@ export async function runBiometricEnable(opts) {
|
|
|
59
59
|
try {
|
|
60
60
|
const ok = await biometricPrompt(`enable Touch ID unlock for the xPay profile "${name}"`);
|
|
61
61
|
if (!ok) {
|
|
62
|
-
console.log(chalk.yellow("Cancelled
|
|
62
|
+
console.log(chalk.yellow("Cancelled - biometric unlock not enabled."));
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
65
65
|
await storeBiometricPassphrase(name, passphrase);
|
|
66
66
|
}
|
|
67
67
|
catch (err) {
|
|
68
68
|
const msg = err instanceof BiometricUnavailableError
|
|
69
|
-
? `${err.message}
|
|
69
|
+
? `${err.message} - biometric unlock not enabled.`
|
|
70
70
|
: err.message;
|
|
71
71
|
console.error(chalk.red(`✗ ${msg}`));
|
|
72
72
|
process.exit(1);
|
|
@@ -75,7 +75,7 @@ export async function runBiometricEnable(opts) {
|
|
|
75
75
|
console.log("");
|
|
76
76
|
console.log(chalk.green(`✔ Touch ID unlock enabled for "${name}".`));
|
|
77
77
|
console.log(chalk.dim(" The passphrase now lives in your login keychain, gated by Touch ID."));
|
|
78
|
-
console.log(chalk.dim(" macOS may ask once to allow keychain access
|
|
78
|
+
console.log(chalk.dim(" macOS may ask once to allow keychain access - choose \"Always Allow\"."));
|
|
79
79
|
console.log(chalk.dim(" Your passphrase still works everywhere and remains the recovery path."));
|
|
80
80
|
}
|
|
81
81
|
export async function runBiometricDisable(opts) {
|
|
@@ -88,10 +88,10 @@ export async function runBiometricDisable(opts) {
|
|
|
88
88
|
console.error(chalk.red(`✗ ${err.message}`));
|
|
89
89
|
process.exit(1);
|
|
90
90
|
}
|
|
91
|
-
// Helper unbuildable (e.g. CLT removed)
|
|
91
|
+
// Helper unbuildable (e.g. CLT removed) - still clear the config flag.
|
|
92
92
|
}
|
|
93
93
|
setProfileBiometric(name, false);
|
|
94
|
-
console.log(chalk.green(`✔ Touch ID unlock disabled for "${name}"
|
|
94
|
+
console.log(chalk.green(`✔ Touch ID unlock disabled for "${name}" - keychain entry removed.`));
|
|
95
95
|
}
|
|
96
96
|
export async function runBiometricStatus(profileName) {
|
|
97
97
|
const name = resolveProfileOrExit(profileName);
|
package/dist/cli/common.js
CHANGED
|
@@ -36,9 +36,9 @@ export async function unlockActive(opts = {}) {
|
|
|
36
36
|
}
|
|
37
37
|
catch (err) {
|
|
38
38
|
// The keychain copy can go stale if the wallet was re-encrypted with a
|
|
39
|
-
// new passphrase
|
|
39
|
+
// new passphrase - give the user one interactive retry instead of dying.
|
|
40
40
|
if (viaBiometric && process.stdin.isTTY) {
|
|
41
|
-
console.error(chalk.yellow(`⚠ The passphrase stored for Touch ID no longer unlocks "${name}"
|
|
41
|
+
console.error(chalk.yellow(`⚠ The passphrase stored for Touch ID no longer unlocks "${name}" - run \`xpay biometric enable\` to refresh it.`));
|
|
42
42
|
try {
|
|
43
43
|
return await loadProfile({ name, passphrase: await promptPassphrase(name) });
|
|
44
44
|
}
|
|
@@ -65,7 +65,7 @@ async function tryBiometricUnlock(name) {
|
|
|
65
65
|
try {
|
|
66
66
|
const passphrase = await readBiometricPassphrase(name, `unlock the xPay profile "${name}"`);
|
|
67
67
|
if (!passphrase && process.stdin.isTTY) {
|
|
68
|
-
console.log(chalk.dim(" (biometric unlock cancelled
|
|
68
|
+
console.log(chalk.dim(" (biometric unlock cancelled - enter the passphrase instead)"));
|
|
69
69
|
}
|
|
70
70
|
return passphrase ?? undefined;
|
|
71
71
|
}
|
|
@@ -93,7 +93,7 @@ export function guardrailWithApproval(profile, opts = {}) {
|
|
|
93
93
|
catch (err) {
|
|
94
94
|
if (!(err instanceof BiometricUnavailableError))
|
|
95
95
|
throw err;
|
|
96
|
-
// Biometry unavailable right now (e.g. lid closed)
|
|
96
|
+
// Biometry unavailable right now (e.g. lid closed) - fall through.
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
if (interactive && process.stdin.isTTY) {
|
|
@@ -107,7 +107,7 @@ export function guardrailWithApproval(profile, opts = {}) {
|
|
|
107
107
|
]);
|
|
108
108
|
return ok;
|
|
109
109
|
}
|
|
110
|
-
console.error(chalk.yellow(`⚠ $${usd.toFixed(2)} call needs approval but no biometric or interactive terminal is available
|
|
110
|
+
console.error(chalk.yellow(`⚠ $${usd.toFixed(2)} call needs approval but no biometric or interactive terminal is available - denying.`));
|
|
111
111
|
return false;
|
|
112
112
|
},
|
|
113
113
|
};
|
|
@@ -125,7 +125,7 @@ export function formatUsd(amount) {
|
|
|
125
125
|
/** "2m ago" / "3h ago" / "5d ago". */
|
|
126
126
|
export function timeAgo(ts) {
|
|
127
127
|
if (!ts)
|
|
128
|
-
return chalk.dim("
|
|
128
|
+
return chalk.dim(" - ");
|
|
129
129
|
const s = (Date.now() - ts) / 1000;
|
|
130
130
|
if (s < 60)
|
|
131
131
|
return `${Math.floor(s)}s ago`;
|
package/dist/cli/common.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/cli/common.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACnG,OAAO,EACL,yBAAyB,EACzB,eAAe,EACf,uBAAuB,GACxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AASjD;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,OAAsB,EAAE;IACzD,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,IAAI,gBAAgB,EAAE,CAAC;IAChD,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;QACzB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,cAAc,IAAI,uCAAuC,CAAC,CAAC,CAAC;QACpF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,MAAM,GAAG,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;IACjD,IAAI,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;IAChE,IAAI,YAAY,GAAG,KAAK,CAAC;IAEzB,IAAI,MAAM,CAAC,SAAS,IAAI,CAAC,UAAU,EAAE,CAAC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C,CAAC,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;AACvD,CAAC;AAED,wCAAwC;AACxC,MAAM,UAAU,SAAS,CAAC,MAAc;IACtC,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAC9C,CAAC;AAED,sCAAsC;AACtC,MAAM,UAAU,OAAO,CAAC,EAAiB;IACvC,IAAI,CAAC,EAAE;QAAE,OAAO,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACjC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC;IACnC,IAAI,CAAC,GAAG,EAAE;QAAE,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC;IAC3C,IAAI,CAAC,GAAG,IAAI;QAAE,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC;IAClD,IAAI,CAAC,GAAG,KAAK;QAAE,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC;IACrD,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC;AACzC,CAAC"}
|
package/dist/cli/discover.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `xpay discover <query>`
|
|
2
|
+
* `xpay discover <query>` - search the agentic-commerce catalog.
|
|
3
3
|
*
|
|
4
|
-
* Read-only
|
|
4
|
+
* Read-only - does not load a profile or touch keys.
|
|
5
5
|
*/
|
|
6
6
|
export interface DiscoverCmdOptions {
|
|
7
7
|
limit?: string;
|
package/dist/cli/discover.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `xpay discover <query>`
|
|
2
|
+
* `xpay discover <query>` - search the agentic-commerce catalog.
|
|
3
3
|
*
|
|
4
|
-
* Read-only
|
|
4
|
+
* Read-only - does not load a profile or touch keys.
|
|
5
5
|
*/
|
|
6
6
|
import chalk from "chalk";
|
|
7
7
|
import { discover, lastDiscoverWarnings } from "../discover/index.js";
|
|
@@ -40,14 +40,14 @@ export async function runDiscover(query, opts) {
|
|
|
40
40
|
function printResource(r, index) {
|
|
41
41
|
const opt = r.accepts[0];
|
|
42
42
|
if (opt?.scheme === AGENC_SCHEME) {
|
|
43
|
-
// AgenC listing
|
|
43
|
+
// AgenC listing - priced in native SOL (9 decimals), executed as an
|
|
44
44
|
// on-chain escrow hire rather than an HTTP call.
|
|
45
45
|
const sol = opt.amount ? `◎${(Number(opt.amount) / 1e9).toFixed(4)} SOL` : chalk.dim("?");
|
|
46
46
|
const name = typeof r.metadata?.name === "string" && r.metadata.name ? r.metadata.name : safeHost(r.resource);
|
|
47
47
|
const rep = r.metadata?.reputation;
|
|
48
48
|
console.log(` ${chalk.bold(String(index).padStart(2) + ".")} ${sol} ${chalk.cyan("solana".padEnd(9))} ${chalk.magenta("agenc escrow")} ${chalk.white(name)}`);
|
|
49
49
|
console.log(` ${chalk.dim(r.resource)}`);
|
|
50
|
-
console.log(` ${chalk.dim(`↳ hires ${rep?.totalHires ?? "0"}, ratings ${rep?.ratingCount ?? 0}
|
|
50
|
+
console.log(` ${chalk.dim(`↳ hires ${rep?.totalHires ?? "0"}, ratings ${rep?.ratingCount ?? 0} - xpay agenc hire ${r.metadata?.listingPda}`)}`);
|
|
51
51
|
console.log("");
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
@@ -79,6 +79,12 @@ function normalizeNetwork(raw) {
|
|
|
79
79
|
return "ethereum";
|
|
80
80
|
if (raw === "eip155:42161")
|
|
81
81
|
return "arbitrum";
|
|
82
|
+
if (raw === "eip155:10")
|
|
83
|
+
return "optimism";
|
|
84
|
+
if (raw === "eip155:4663")
|
|
85
|
+
return "robinhood";
|
|
86
|
+
if (raw === "eip155:988")
|
|
87
|
+
return "stable";
|
|
82
88
|
if (raw.startsWith("solana"))
|
|
83
89
|
return "solana";
|
|
84
90
|
return raw;
|
package/dist/cli/discover.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discover.js","sourceRoot":"","sources":["../../src/cli/discover.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAUtD,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,KAAyB,EAAE,IAAwB;IACnF,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC9E,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAChF,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAE3D,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACtB,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;IAC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B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,GAAG,CAAC;IACb,CAAC;AACH,CAAC;AAED,SAAS,gBAAgB,CAAC,GAAuB;IAC/C,IAAI,CAAC,GAAG;QAAE,OAAO,GAAG,CAAC;IACrB,IAAI,GAAG,KAAK,aAAa;QAAE,OAAO,MAAM,CAAC;IACzC,IAAI,GAAG,KAAK,UAAU;QAAE,OAAO,UAAU,CAAC;IAC1C,IAAI,GAAG,KAAK,cAAc;QAAE,OAAO,UAAU,CAAC;IAC9C,IAAI,GAAG,KAAK,WAAW;QAAE,OAAO,UAAU,CAAC;IAC3C,IAAI,GAAG,KAAK,aAAa;QAAE,OAAO,WAAW,CAAC;IAC9C,IAAI,GAAG,KAAK,YAAY;QAAE,OAAO,QAAQ,CAAC;IAC1C,IAAI,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,OAAO,QAAQ,CAAC;IAC9C,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/dist/cli/guardrail.d.ts
CHANGED
package/dist/cli/guardrail.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `xpay guardrail show|set|clear`
|
|
2
|
+
* `xpay guardrail show|set|clear` - view and edit the active profile's
|
|
3
3
|
* spending guardrail. Persisted to config.json; loaded by every command that
|
|
4
4
|
* builds a runtime client.
|
|
5
5
|
*/
|
|
@@ -13,7 +13,7 @@ export function runGuardrailShow(profileName) {
|
|
|
13
13
|
console.log("");
|
|
14
14
|
console.log(chalk.bold(`Guardrail for "${name}"`));
|
|
15
15
|
if (!g || Object.keys(g).length === 0) {
|
|
16
|
-
console.log(chalk.yellow(" (no guardrail configured
|
|
16
|
+
console.log(chalk.yellow(" (no guardrail configured - calls are uncapped)"));
|
|
17
17
|
console.log(chalk.dim(" Set one with: xpay guardrail set --max-per-tx 1 --max-per-day 10"));
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
@@ -58,7 +58,7 @@ export function runGuardrailSet(opts) {
|
|
|
58
58
|
export function runGuardrailClear(profileName) {
|
|
59
59
|
const name = profileName ?? getActiveProfile();
|
|
60
60
|
clearProfileGuardrail(name);
|
|
61
|
-
console.log(chalk.yellow(`⚠ Guardrail cleared for "${name}"
|
|
61
|
+
console.log(chalk.yellow(`⚠ Guardrail cleared for "${name}" - calls are now uncapped.`));
|
|
62
62
|
}
|
|
63
63
|
function parseDollarsOrExit(raw, flag) {
|
|
64
64
|
const n = Number(raw);
|
package/dist/cli/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* xpay CLI
|
|
3
|
+
* xpay CLI - agentic-commerce wallet.
|
|
4
4
|
*
|
|
5
5
|
* Top-level commands:
|
|
6
6
|
* xpay init [--import] [--no-encrypt] [--workspace]
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* More to come: discover, pay, transfer, history, bridge, guardrail, link.
|
|
12
12
|
*
|
|
13
13
|
* Designed to also run as the MCP server entry point (the `bin` field points
|
|
14
|
-
* here)
|
|
14
|
+
* here) - invoking `xpay-mcp` directly defaults to the `mcp` subcommand.
|
|
15
15
|
*/
|
|
16
16
|
import "dotenv/config";
|
|
17
17
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/cli/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* xpay CLI
|
|
3
|
+
* xpay CLI - agentic-commerce wallet.
|
|
4
4
|
*
|
|
5
5
|
* Top-level commands:
|
|
6
6
|
* xpay init [--import] [--no-encrypt] [--workspace]
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* More to come: discover, pay, transfer, history, bridge, guardrail, link.
|
|
12
12
|
*
|
|
13
13
|
* Designed to also run as the MCP server entry point (the `bin` field points
|
|
14
|
-
* here)
|
|
14
|
+
* here) - invoking `xpay-mcp` directly defaults to the `mcp` subcommand.
|
|
15
15
|
*/
|
|
16
16
|
import "dotenv/config";
|
|
17
17
|
import { basename } from "node:path";
|
|
@@ -43,7 +43,7 @@ import { startMcpServer } from "./mcp-server.js";
|
|
|
43
43
|
const program = new Command();
|
|
44
44
|
program
|
|
45
45
|
.name("xpay")
|
|
46
|
-
.description("xPay
|
|
46
|
+
.description("xPay - discovery, payments, and wallet for agentic commerce.")
|
|
47
47
|
.version(pkgVersion);
|
|
48
48
|
// ---------------------------------------------------------------- init
|
|
49
49
|
program
|
|
@@ -91,7 +91,7 @@ program
|
|
|
91
91
|
.description("Pay an x402 endpoint (catalog URL or any URL that returns 402).")
|
|
92
92
|
.option("--profile <name>", "Profile to pay from (defaults to active)")
|
|
93
93
|
.option("--passphrase <value>", "Non-interactive passphrase")
|
|
94
|
-
.option("--method <m>", "HTTP method (default GET
|
|
94
|
+
.option("--method <m>", "HTTP method (default GET - use POST for most x402 services)")
|
|
95
95
|
.option("--max-usd <n>", "Override per-tx guardrail cap for this call")
|
|
96
96
|
.option("--body <json>", "Request body for POST endpoints (JSON)")
|
|
97
97
|
.option("-y, --yes", "Skip the confirmation prompt")
|
|
@@ -135,7 +135,7 @@ token
|
|
|
135
135
|
// ---------------------------------------------------------------- x (Twitter)
|
|
136
136
|
const xcmd = program
|
|
137
137
|
.command("x")
|
|
138
|
-
.description("Realtime X (Twitter) account data
|
|
138
|
+
.description("Realtime X (Twitter) account data - paid via x402 at cost (no X account needed).");
|
|
139
139
|
xcmd
|
|
140
140
|
.command("user <handle>")
|
|
141
141
|
.description("Profile lookup: followers, bio, verification (~$0.01 USDC).")
|
|
@@ -160,7 +160,7 @@ xcmd
|
|
|
160
160
|
// ---------------------------------------------------------------- zauth
|
|
161
161
|
const zauth = program
|
|
162
162
|
.command("zauth")
|
|
163
|
-
.description("zauth partner
|
|
163
|
+
.description("zauth partner - repository security scans, paid via x402.");
|
|
164
164
|
zauth
|
|
165
165
|
.command("reposcan <repoUrl>")
|
|
166
166
|
.description("Scan a repository via zauth (~$0.05 USDC, paid via x402).")
|
|
@@ -306,7 +306,7 @@ const sana = program
|
|
|
306
306
|
.description("Manage the Sana agent wallet card integration (optional).");
|
|
307
307
|
sana
|
|
308
308
|
.command("link <apiKey>")
|
|
309
|
-
.description("Link a Sana API key
|
|
309
|
+
.description("Link a Sana API key - enables sana_* tools in the MCP server.")
|
|
310
310
|
.option("--profile <name>", "Profile to link to (defaults to active)")
|
|
311
311
|
.action((apiKey, opts) => runSanaLink(apiKey, opts));
|
|
312
312
|
sana
|
|
@@ -321,7 +321,7 @@ sana
|
|
|
321
321
|
.action((opts) => runSanaStatus(opts));
|
|
322
322
|
sana
|
|
323
323
|
.command("card")
|
|
324
|
-
.description("Card metadata
|
|
324
|
+
.description("Card metadata - status, type, last 4, expiry.")
|
|
325
325
|
.option("--profile <name>")
|
|
326
326
|
.action((opts) => runSanaCard(opts));
|
|
327
327
|
sana
|
|
@@ -363,7 +363,7 @@ sana
|
|
|
363
363
|
// ---------------------------------------------------------------- bento
|
|
364
364
|
const bento = program
|
|
365
365
|
.command("bento")
|
|
366
|
-
.description("Bento Guard intent firewall
|
|
366
|
+
.description("Bento Guard intent firewall - screen payments for malicious intent (optional).");
|
|
367
367
|
bento
|
|
368
368
|
.command("status", { isDefault: true })
|
|
369
369
|
.description("Show whether the Bento intent firewall is enabled.")
|
|
@@ -376,13 +376,13 @@ bento
|
|
|
376
376
|
.action((opts) => runBentoEnable(opts));
|
|
377
377
|
bento
|
|
378
378
|
.command("disable")
|
|
379
|
-
.description("Disable Bento intent screening
|
|
379
|
+
.description("Disable Bento intent screening - payments rely on local caps only.")
|
|
380
380
|
.option("--profile <name>", "Profile to disable (defaults to active)")
|
|
381
381
|
.action((opts) => runBentoDisable(opts));
|
|
382
382
|
// ---------------------------------------------------------------- magicblock
|
|
383
383
|
const magicblock = program
|
|
384
384
|
.command("magicblock")
|
|
385
|
-
.description("MagicBlock Private Ephemeral Rollup
|
|
385
|
+
.description("MagicBlock Private Ephemeral Rollup - platform-level privacy setup (operator commands).");
|
|
386
386
|
magicblock
|
|
387
387
|
.command("status", { isDefault: true })
|
|
388
388
|
.description("Show MagicBlock PER integration status and mint initialization state.")
|
|
@@ -407,7 +407,7 @@ magicblock
|
|
|
407
407
|
// ---------------------------------------------------------------- agenc
|
|
408
408
|
const agenc = program
|
|
409
409
|
.command("agenc")
|
|
410
|
-
.description("AgenC marketplace (agenc.ag)
|
|
410
|
+
.description("AgenC marketplace (agenc.ag) - hire on-chain agent services with SOL escrow.");
|
|
411
411
|
agenc
|
|
412
412
|
.command("hire <listingPda>")
|
|
413
413
|
.description("Hire a listing: escrow its SOL price on-chain; the provider works asynchronously.")
|
package/dist/cli/init.d.ts
CHANGED
package/dist/cli/init.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `xpay init`
|
|
2
|
+
* `xpay init` - create a new profile (or import one).
|
|
3
3
|
*
|
|
4
4
|
* Flow:
|
|
5
5
|
* 1. Confirm profile name (default: "default") + workspace flag.
|
|
@@ -77,7 +77,7 @@ export async function runInit(opts) {
|
|
|
77
77
|
console.log(` EVM ${chalk.cyan(result.addresses.evm)}`);
|
|
78
78
|
console.log("");
|
|
79
79
|
if (!opts.import) {
|
|
80
|
-
console.log(chalk.yellow.bold("⚠ RECOVERY PHRASE
|
|
80
|
+
console.log(chalk.yellow.bold("⚠ RECOVERY PHRASE - write this down NOW. We cannot recover it for you."));
|
|
81
81
|
console.log("");
|
|
82
82
|
printMnemonicGrid(result.mnemonic);
|
|
83
83
|
console.log("");
|
package/dist/cli/magicblock.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `xpay magicblock`
|
|
2
|
+
* `xpay magicblock` - platform-level MagicBlock PER integration commands.
|
|
3
3
|
*
|
|
4
4
|
* xpay acts as the privacy platform: end users never need a MagicBlock account.
|
|
5
5
|
* These commands are for the xpay operator (platform team) to run once.
|
package/dist/cli/magicblock.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `xpay magicblock`
|
|
2
|
+
* `xpay magicblock` - platform-level MagicBlock PER integration commands.
|
|
3
3
|
*
|
|
4
4
|
* xpay acts as the privacy platform: end users never need a MagicBlock account.
|
|
5
5
|
* These commands are for the xpay operator (platform team) to run once.
|
|
@@ -35,14 +35,14 @@ export async function runMagicBlockStatus(opts) {
|
|
|
35
35
|
const initialized = await magicBlockIsMintInitialized(USDC_SOLANA, mb).catch(() => false);
|
|
36
36
|
process.stdout.write("\r");
|
|
37
37
|
if (initialized) {
|
|
38
|
-
console.log(` ${chalk.green("●")} USDC mint is initialized
|
|
38
|
+
console.log(` ${chalk.green("●")} USDC mint is initialized - private transfers are ready.`);
|
|
39
39
|
}
|
|
40
40
|
else {
|
|
41
41
|
console.log(` ${chalk.yellow("●")} USDC mint is not yet initialized.`);
|
|
42
42
|
console.log(chalk.dim(" Run: xpay magicblock init-mint"));
|
|
43
43
|
}
|
|
44
44
|
console.log("");
|
|
45
|
-
console.log(chalk.dim(" End users pass private:true to xpay_transfer
|
|
45
|
+
console.log(chalk.dim(" End users pass private:true to xpay_transfer - no MagicBlock account needed."));
|
|
46
46
|
console.log("");
|
|
47
47
|
}
|
|
48
48
|
// ─── Init mint (one-time platform setup) ─────────────────────────────────────
|
|
@@ -90,7 +90,7 @@ export function runMagicBlockConfigure(opts) {
|
|
|
90
90
|
const name = opts.profile ?? getActiveProfile();
|
|
91
91
|
if (opts.clear) {
|
|
92
92
|
clearMagicBlockConfig(name);
|
|
93
|
-
console.log(chalk.yellow(`⚠ MagicBlock config cleared from profile "${name}"
|
|
93
|
+
console.log(chalk.yellow(`⚠ MagicBlock config cleared from profile "${name}" - using defaults.`));
|
|
94
94
|
return;
|
|
95
95
|
}
|
|
96
96
|
if (!opts.apiUrl && !opts.ephemeralRpc) {
|
package/dist/cli/mcp-server.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* xPay MCP server.
|
|
3
3
|
*
|
|
4
|
-
* Exposes every CLI capability as an MCP tool over stdio. Zero-config
|
|
4
|
+
* Exposes every CLI capability as an MCP tool over stdio. Zero-config - drop
|
|
5
5
|
* this into any Claude Desktop / Cursor / Codex / agent-framework config and
|
|
6
6
|
* on first boot the agent is given its own persistent wallet:
|
|
7
7
|
*
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* }
|
|
15
15
|
* }
|
|
16
16
|
*
|
|
17
|
-
* The generated wallet's address is printed to stderr on first run
|
|
17
|
+
* The generated wallet's address is printed to stderr on first run - fund the
|
|
18
18
|
* Solana address with USDC to let the agent pay. It persists under ~/.xpay and
|
|
19
19
|
* is reused on every later boot.
|
|
20
20
|
*
|
package/dist/cli/mcp-server.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* xPay MCP server.
|
|
3
3
|
*
|
|
4
|
-
* Exposes every CLI capability as an MCP tool over stdio. Zero-config
|
|
4
|
+
* Exposes every CLI capability as an MCP tool over stdio. Zero-config - drop
|
|
5
5
|
* this into any Claude Desktop / Cursor / Codex / agent-framework config and
|
|
6
6
|
* on first boot the agent is given its own persistent wallet:
|
|
7
7
|
*
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* }
|
|
15
15
|
* }
|
|
16
16
|
*
|
|
17
|
-
* The generated wallet's address is printed to stderr on first run
|
|
17
|
+
* The generated wallet's address is printed to stderr on first run - fund the
|
|
18
18
|
* Solana address with USDC to let the agent pay. It persists under ~/.xpay and
|
|
19
19
|
* is reused on every later boot.
|
|
20
20
|
*
|
|
@@ -42,7 +42,7 @@ export async function startMcpServer() {
|
|
|
42
42
|
// Boot must not throw: a crash here kills the stdio transport and the host
|
|
43
43
|
// only shows "Connection closed" with no way to recover. When the wallet
|
|
44
44
|
// can't be unlocked (encrypted profile, no/wrong passphrase) we start in a
|
|
45
|
-
// locked state instead
|
|
45
|
+
// locked state instead - tools are listed, and every call returns the
|
|
46
46
|
// unlock instructions for the agent to relay to the user.
|
|
47
47
|
let xpay;
|
|
48
48
|
let profileName = null;
|
|
@@ -52,7 +52,7 @@ export async function startMcpServer() {
|
|
|
52
52
|
}
|
|
53
53
|
catch (err) {
|
|
54
54
|
lockedReason = lockedBootMessage(err);
|
|
55
|
-
process.stderr.write(`[xpay-mcp] wallet locked
|
|
55
|
+
process.stderr.write(`[xpay-mcp] wallet locked - starting in locked mode.\n[xpay-mcp] ${lockedReason}\n`);
|
|
56
56
|
// Placeholder client: tool construction never touches it (all access is
|
|
57
57
|
// inside handler closures) and calls short-circuit on lockedReason below.
|
|
58
58
|
xpay = new Proxy({}, {
|
|
@@ -63,12 +63,12 @@ export async function startMcpServer() {
|
|
|
63
63
|
}
|
|
64
64
|
const sanaApiKey = await resolveSanaApiKey();
|
|
65
65
|
const { tools, handlers } = forClaude(xpay, { sanaApiKey });
|
|
66
|
-
// Note: xpay_transfer executes directly (via the forClaude handler)
|
|
66
|
+
// Note: xpay_transfer executes directly (via the forClaude handler) - the same
|
|
67
67
|
// path as the CLI. We deliberately do NOT stage transfers behind a second
|
|
68
68
|
// "confirm" tool call: that relied on the agent faithfully making a follow-up
|
|
69
69
|
// call, which weaker models skip while hallucinating a success + fake tx hash.
|
|
70
70
|
// The real spending gate is the guardrail (caps + requireApprovalAbove), which
|
|
71
|
-
// surfaces as a Touch ID prompt on MCP when biometric unlock is enabled
|
|
71
|
+
// surfaces as a Touch ID prompt on MCP when biometric unlock is enabled - a
|
|
72
72
|
// gate the model can't fake or skip.
|
|
73
73
|
const mcpTools = [
|
|
74
74
|
...tools,
|
|
@@ -82,7 +82,7 @@ export async function startMcpServer() {
|
|
|
82
82
|
name: "xpay_bento_enable",
|
|
83
83
|
description: "Turn ON the Bento intent firewall for this agent's wallet. Returns the agent wallet " +
|
|
84
84
|
"address, which must be registered once at app.bentoguard.xyz (logging in with the " +
|
|
85
|
-
"owner wallet) before protection takes effect
|
|
85
|
+
"owner wallet) before protection takes effect - until then payments are rejected.",
|
|
86
86
|
inputSchema: { type: "object", properties: {} },
|
|
87
87
|
},
|
|
88
88
|
{
|
|
@@ -130,7 +130,7 @@ export async function startMcpServer() {
|
|
|
130
130
|
enabled: true,
|
|
131
131
|
agentWallet: agentSolanaAddress(),
|
|
132
132
|
action_required: `Register this agent wallet at ${BENTO_DASHBOARD} (log in with your owner wallet). ` +
|
|
133
|
-
`Until it's registered, payments are rejected with "Agent not found"
|
|
133
|
+
`Until it's registered, payments are rejected with "Agent not found" - call ` +
|
|
134
134
|
`xpay_bento_disable to fall back to local caps if you don't want to register.`,
|
|
135
135
|
};
|
|
136
136
|
};
|
|
@@ -197,7 +197,7 @@ async function buildXPay() {
|
|
|
197
197
|
// Expose the agent's own key so a runtime `xpay_bento_enable` can activate
|
|
198
198
|
// protect() without a restart. In-process only; it's the wallet's own key.
|
|
199
199
|
process.env.AGENT_WALLET_PRIVATE_KEY ??= deriveKeysFromMnemonic(profile.mnemonic).solana.secretKeyBase58;
|
|
200
|
-
// No TTY here
|
|
200
|
+
// No TTY here - approvals above the guardrail threshold surface as a
|
|
201
201
|
// system Touch ID dialog when the profile has biometric unlock enabled.
|
|
202
202
|
const xpay = createXPay({ profile, guardrail: guardrailWithApproval(profile, { interactive: false }) });
|
|
203
203
|
return { xpay, profileName };
|
|
@@ -213,7 +213,7 @@ async function buildXPay() {
|
|
|
213
213
|
signers[evmNet] = rawEvmSigner({ privateKey: process.env.XPAY_EVM_KEY, network: evmNet });
|
|
214
214
|
}
|
|
215
215
|
if (Object.keys(signers).length === 0) {
|
|
216
|
-
// Nothing configured
|
|
216
|
+
// Nothing configured - give the agent its own wallet (zero-config
|
|
217
217
|
// onboarding). Opt out with XPAY_NO_AUTO_WALLET for the strict behaviour.
|
|
218
218
|
if (!process.env.XPAY_NO_AUTO_WALLET) {
|
|
219
219
|
return autoProvisionXPay(profileName);
|
|
@@ -223,7 +223,7 @@ async function buildXPay() {
|
|
|
223
223
|
`XPAY_NO_AUTO_WALLET to auto-generate a wallet.`);
|
|
224
224
|
}
|
|
225
225
|
// Raw-key mode: no profile on disk, so bento's profile-gated flag can't be
|
|
226
|
-
// toggled
|
|
226
|
+
// toggled - profileName is null and the bento tools report that.
|
|
227
227
|
const xpay = createXPay({
|
|
228
228
|
networks,
|
|
229
229
|
signers,
|
|
@@ -239,23 +239,23 @@ async function buildXPay() {
|
|
|
239
239
|
* Zero-config onboarding: no profile and no key configured, so generate a
|
|
240
240
|
* fresh wallet for the agent, persist it under ~/.xpay (or XPAY_HOME), and
|
|
241
241
|
* surface the address. Encrypted when XPAY_PASSPHRASE is set, otherwise
|
|
242
|
-
* plaintext (file-permission protected)
|
|
242
|
+
* plaintext (file-permission protected) - fine for a low-balance agent wallet.
|
|
243
243
|
*
|
|
244
244
|
* Runs once: the next boot finds the profile and loads it via the normal path,
|
|
245
245
|
* so the agent keeps the same address across restarts. All notices go to
|
|
246
|
-
* stderr
|
|
246
|
+
* stderr - stdout is the MCP JSON-RPC channel and must stay clean.
|
|
247
247
|
*/
|
|
248
248
|
async function autoProvisionXPay(profileName) {
|
|
249
249
|
const passphrase = process.env.XPAY_PASSPHRASE || undefined;
|
|
250
250
|
const created = await initProfile({ name: profileName, passphrase });
|
|
251
|
-
process.stderr.write(`\n[xpay-mcp] No wallet found
|
|
251
|
+
process.stderr.write(`\n[xpay-mcp] No wallet found - generated one for this agent.\n` +
|
|
252
252
|
`[xpay-mcp] profile: ${profileName}\n` +
|
|
253
253
|
`[xpay-mcp] Solana: ${created.addresses.solana}\n` +
|
|
254
254
|
`[xpay-mcp] Base/EVM: ${created.addresses.evm}\n` +
|
|
255
255
|
`[xpay-mcp] stored: ${created.path}` +
|
|
256
|
-
(passphrase ? " (encrypted)\n" : " (UNENCRYPTED
|
|
256
|
+
(passphrase ? " (encrypted)\n" : " (UNENCRYPTED - set XPAY_PASSPHRASE to encrypt at rest)\n") +
|
|
257
257
|
`[xpay-mcp] Fund the Solana address with USDC so the agent can pay.\n` +
|
|
258
|
-
`[xpay-mcp] The recovery phrase lives in ${created.path}
|
|
258
|
+
`[xpay-mcp] The recovery phrase lives in ${created.path} - back it up.\n\n`);
|
|
259
259
|
const profile = await loadProfile({ name: profileName, passphrase });
|
|
260
260
|
process.env.AGENT_WALLET_PRIVATE_KEY ??= deriveKeysFromMnemonic(profile.mnemonic).solana.secretKeyBase58;
|
|
261
261
|
const xpay = createXPay({ profile, guardrail: guardrailWithApproval(profile, { interactive: false }) });
|
|
@@ -269,20 +269,20 @@ async function autoProvisionXPay(profileName) {
|
|
|
269
269
|
async function resolveSanaApiKey() {
|
|
270
270
|
try {
|
|
271
271
|
const profileName = process.env.XPAY_PROFILE ?? getActiveProfile();
|
|
272
|
-
// config.json is plaintext
|
|
272
|
+
// config.json is plaintext - no need to unlock the wallet to read it.
|
|
273
273
|
const { readProfileConfig } = await import("../profile/index.js");
|
|
274
274
|
const key = readProfileConfig(profileName).sana?.apiKey;
|
|
275
275
|
if (key)
|
|
276
276
|
return key;
|
|
277
277
|
}
|
|
278
278
|
catch {
|
|
279
|
-
// profile not found
|
|
279
|
+
// profile not found - fall through to env
|
|
280
280
|
}
|
|
281
281
|
return process.env.SANABOT_API_KEY || undefined;
|
|
282
282
|
}
|
|
283
283
|
/**
|
|
284
284
|
* Turn a boot failure into the message locked-mode tools return. The agent
|
|
285
|
-
* relays this to the user, so it has to carry the full remediation
|
|
285
|
+
* relays this to the user, so it has to carry the full remediation - the
|
|
286
286
|
* user never sees stderr in an MCP host.
|
|
287
287
|
*/
|
|
288
288
|
function lockedBootMessage(err) {
|
|
@@ -296,7 +296,7 @@ function lockedBootMessage(err) {
|
|
|
296
296
|
if (err.message.includes("passphrase required")) {
|
|
297
297
|
return (`The xpay wallet profile "${profileName}" is encrypted and no passphrase was provided, ` +
|
|
298
298
|
`so wallet tools are locked. ${unlockHint}\n` +
|
|
299
|
-
`If the passphrase is lost, the wallet cannot be decrypted
|
|
299
|
+
`If the passphrase is lost, the wallet cannot be decrypted - restore from the recovery ` +
|
|
300
300
|
`phrase with \`npx @xona-labs/xpay init --overwrite\`, or delete the profile directory ` +
|
|
301
301
|
`to start fresh (funds at the old address are only recoverable with the phrase).`);
|
|
302
302
|
}
|
|
@@ -308,7 +308,7 @@ function lockedBootMessage(err) {
|
|
|
308
308
|
`${err.message}`);
|
|
309
309
|
}
|
|
310
310
|
/**
|
|
311
|
-
* Touch ID unlock at MCP startup
|
|
311
|
+
* Touch ID unlock at MCP startup - lets hosts omit XPAY_PASSPHRASE from
|
|
312
312
|
* their config when the profile has `xpay biometric enable` set. Shows one
|
|
313
313
|
* system dialog as the server boots; resolves undefined on any failure so
|
|
314
314
|
* loadProfile produces its normal "passphrase required" error.
|
package/dist/cli/pay.d.ts
CHANGED
package/dist/cli/pay.js
CHANGED