@agentgates/cli 0.10.0 → 0.10.1
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 +37 -37
- package/dist/cli.mjs +46 -46
- package/package.json +1 -1
- package/scripts/postinstall.mjs +18 -15
package/README.md
CHANGED
|
@@ -6,31 +6,31 @@ Wallet operations for AI agents and humans.
|
|
|
6
6
|
|
|
7
7
|
```sh
|
|
8
8
|
npm install -g git+https://github.com/Carlos-Sotop/agentgates-ai-cli.git
|
|
9
|
-
|
|
9
|
+
agentgates --help
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
## Usage
|
|
13
13
|
|
|
14
14
|
```sh
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
agentgates login # pair with your wallet
|
|
16
|
+
agentgates balance # balances across all chains
|
|
17
|
+
agentgates send <amt> <asset> [--to <addr>] [--chain <chain>]
|
|
18
|
+
agentgates swap <amt> <from> [--to <asset>] [--chain <chain>]
|
|
19
|
+
agentgates earn supply|withdraw <amt> <asset> [--chain <chain>]
|
|
20
|
+
agentgates history # recent activity
|
|
21
|
+
agentgates list # the open bounty board (also: show, mine, feed, draft)
|
|
22
22
|
bounty submission <id> # your submission's verification state (also: context, room, live, pot, who, retention)
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
agentgates fund <id> # fund YOUR OWN bounty's escrow so it goes live
|
|
24
|
+
agentgates tip <id> <amt> # add USDC to a live bounty's prize pot
|
|
25
|
+
agentgates subscribe <creator-user-id> [--months 1|3|12] # prepaid, at the creator's stored price
|
|
26
|
+
agentgates trade status|key|quote|buy|sell|positions # launch-coin trading on Solana devnet, see below
|
|
27
|
+
agentgates desk status|deposit|withdraw|session|buy|sell # the trading desk: bounds on chain, see below
|
|
28
|
+
agentgates --help # full command list
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
## Launch trading (Solana devnet)
|
|
32
32
|
|
|
33
|
-
`
|
|
33
|
+
`agentgates trade` trades launch coins on the Solana bonding curve, devnet only
|
|
34
34
|
(chain 901; the mainnet id is refused in code until the launch mainnet
|
|
35
35
|
ceremony). Trades sign with an agent-held ed25519 key generated locally at
|
|
36
36
|
first use (`~/.agentgates/trade-sol.json`, self-custodial, never your product
|
|
@@ -41,23 +41,23 @@ and the slippage guard are read from the deployed launch-config.
|
|
|
41
41
|
|
|
42
42
|
```sh
|
|
43
43
|
export BOUNTY_LAUNCH_ADMIN_KEY=… # operator bearer for the relay wire (prepare/submit, positions)
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
agentgates trade key # create/show the agent trading key (fund it with devnet USDC)
|
|
45
|
+
agentgates trade quote SLFYB 2 # live curve quote (public read, no key needed)
|
|
46
|
+
agentgates trade buy SLFYB 2 # ticker or base58 mint; buys below the served floor refuse
|
|
47
|
+
agentgates trade sell SLFYB 50% # 50% of the position (also: an amount, or "all"); no sell floor
|
|
48
|
+
agentgates trade positions # balance, value, entry, signed result per coin
|
|
49
|
+
agentgates trade status [--coin SLFYB] [--json]
|
|
50
50
|
|
|
51
51
|
# Standing orders on durable nonces: the key pre-signs the exact trade, the
|
|
52
52
|
# deployed engine fires it when the trigger crosses. Cancel withdraws the
|
|
53
53
|
# nonce on chain, so the signed bytes can never land after it.
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
54
|
+
agentgates trade order place SLFYB --buy 2 --at 0.000003 # buy when price drops to-or-below
|
|
55
|
+
agentgates trade order place SLFYB --buy 2 --at 8000 --mcap # trigger on market cap instead
|
|
56
|
+
agentgates trade order place SLFYB --sell 50% --at 0.00001 # take-profit at-or-above
|
|
57
|
+
agentgates trade order place SLFYB --sell all --at 0.000002 --stop # stop at-or-below
|
|
58
|
+
agentgates trade order place SLFYB --sell all --on-graduation # fire near the curve's close
|
|
59
|
+
agentgates trade orders [--coin SLFYB] # open, filled (with fire tx), missed, expired
|
|
60
|
+
agentgates trade order cancel <id>
|
|
61
61
|
```
|
|
62
62
|
|
|
63
63
|
Optional env: `BOUNTY_LAUNCH_RELAY_ORIGIN` (relay base, host-only or
|
|
@@ -71,7 +71,7 @@ revocable without touching anything else.
|
|
|
71
71
|
|
|
72
72
|
## Launch trading desk (Solana devnet)
|
|
73
73
|
|
|
74
|
-
`
|
|
74
|
+
`agentgates desk` is the same lane through the on-chain desk program
|
|
75
75
|
(`launch_desk_sol`): credits live in per-owner vaults on chain, and trading
|
|
76
76
|
authority is a SESSION key whose bounds the program itself enforces — a
|
|
77
77
|
per-trade cap on buys, an expiry, owner-only exit, instant revoke. Two local
|
|
@@ -84,14 +84,14 @@ surfaces the program's own refusal. Neither key ever needs SOL; withdrawals
|
|
|
84
84
|
pay only the owner's own token accounts.
|
|
85
85
|
|
|
86
86
|
```sh
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
87
|
+
agentgates desk deposit 5 # owner's USDC → its desk vault (confirmed on chain)
|
|
88
|
+
agentgates desk session register --cap 2 --minutes 30 # YOUR bounds, required — the chain enforces them
|
|
89
|
+
agentgates desk buy SLFYB 1.5 # session signs; over-cap refuses on chain
|
|
90
|
+
agentgates desk sell SLFYB 50% # % resolves from the live state read; also amount / "all"
|
|
91
|
+
agentgates desk status [--coin SLFYB] [--json] # live credits + the session's key, cap, expiry + recent fills
|
|
92
|
+
agentgates desk status --coin SLFYB --fills 100 # --coin filters the fills; --fills sets the count served
|
|
93
|
+
agentgates desk session revoke # closes the session on chain — pre-signed trades die too
|
|
94
|
+
agentgates desk withdraw all [--coin SLFYB] # exit to the owner's own token account
|
|
95
95
|
```
|
|
96
96
|
|
|
97
97
|
`status` also prints the desk's recent FILLS — the settled buys and sells the
|
package/dist/cli.mjs
CHANGED
|
@@ -34297,7 +34297,7 @@ var require_package = __commonJS({
|
|
|
34297
34297
|
"package.json"(exports, module) {
|
|
34298
34298
|
module.exports = {
|
|
34299
34299
|
name: "@agentgates/cli",
|
|
34300
|
-
version: "0.10.
|
|
34300
|
+
version: "0.10.1",
|
|
34301
34301
|
description: "Wallet operations for AI agents and humans",
|
|
34302
34302
|
keywords: [
|
|
34303
34303
|
"crypto",
|
|
@@ -35283,7 +35283,7 @@ async function login(opts) {
|
|
|
35283
35283
|
process.stdout.write(
|
|
35284
35284
|
import_picocolors2.default.yellow(
|
|
35285
35285
|
`Profile ${import_picocolors2.default.bold(profileName)} is already paired (wallet ${shortAddress(existing.walletAddress)}).
|
|
35286
|
-
Run ${import_picocolors2.default.bold(`
|
|
35286
|
+
Run ${import_picocolors2.default.bold(`agentgates logout --profile ${profileName}`)} first to re-pair, or pass ${import_picocolors2.default.bold("--profile <name>")} to add another.
|
|
35287
35287
|
`
|
|
35288
35288
|
)
|
|
35289
35289
|
);
|
|
@@ -35306,7 +35306,7 @@ Run ${import_picocolors2.default.bold(`bounty logout --profile ${profileName}`)}
|
|
|
35306
35306
|
process.exit(1);
|
|
35307
35307
|
}
|
|
35308
35308
|
process.stderr.write(
|
|
35309
|
-
import_picocolors2.default.red(`\u2715 ${err.message}. Run ${import_picocolors2.default.bold("
|
|
35309
|
+
import_picocolors2.default.red(`\u2715 ${err.message}. Run ${import_picocolors2.default.bold("agentgates login")} again to retry.
|
|
35310
35310
|
`)
|
|
35311
35311
|
);
|
|
35312
35312
|
process.exit(1);
|
|
@@ -35334,7 +35334,7 @@ Run ${import_picocolors2.default.bold(`bounty logout --profile ${profileName}`)}
|
|
|
35334
35334
|
);
|
|
35335
35335
|
process.stdout.write(
|
|
35336
35336
|
import_picocolors2.default.dim(
|
|
35337
|
-
`Try ${import_picocolors2.default.bold("
|
|
35337
|
+
`Try ${import_picocolors2.default.bold("agentgates whoami")} to confirm, or visit ${CREATORS_ORIGIN}/settings/pairings to revoke.
|
|
35338
35338
|
`
|
|
35339
35339
|
)
|
|
35340
35340
|
);
|
|
@@ -35401,7 +35401,7 @@ async function whoami(opts) {
|
|
|
35401
35401
|
const requested = opts.profile ?? DEFAULT_PROFILE;
|
|
35402
35402
|
const resolved = await resolveProfile(requested);
|
|
35403
35403
|
if (!resolved) {
|
|
35404
|
-
process.stderr.write(import_picocolors4.default.red("Not logged in. Run
|
|
35404
|
+
process.stderr.write(import_picocolors4.default.red("Not logged in. Run agentgates login first.\n"));
|
|
35405
35405
|
process.exit(2);
|
|
35406
35406
|
}
|
|
35407
35407
|
if (resolved.autoSelected) {
|
|
@@ -35633,7 +35633,7 @@ async function send(amount, asset, opts) {
|
|
|
35633
35633
|
const requested = opts.profile ?? DEFAULT_PROFILE;
|
|
35634
35634
|
const resolved = await resolveProfile(requested);
|
|
35635
35635
|
if (!resolved) {
|
|
35636
|
-
process.stderr.write(import_picocolors5.default.red("Not logged in. Run
|
|
35636
|
+
process.stderr.write(import_picocolors5.default.red("Not logged in. Run agentgates login first.\n"));
|
|
35637
35637
|
process.exit(2);
|
|
35638
35638
|
}
|
|
35639
35639
|
if (resolved.autoSelected) {
|
|
@@ -36058,7 +36058,7 @@ async function status(intentId, opts) {
|
|
|
36058
36058
|
const requested = opts.profile ?? DEFAULT_PROFILE;
|
|
36059
36059
|
const resolved = await resolveProfile(requested);
|
|
36060
36060
|
if (!resolved) {
|
|
36061
|
-
process.stderr.write(import_picocolors6.default.red("Not logged in. Run
|
|
36061
|
+
process.stderr.write(import_picocolors6.default.red("Not logged in. Run agentgates login first.\n"));
|
|
36062
36062
|
process.exit(2);
|
|
36063
36063
|
}
|
|
36064
36064
|
if (resolved.autoSelected) {
|
|
@@ -36238,7 +36238,7 @@ async function balance(opts) {
|
|
|
36238
36238
|
const requested = opts.profile ?? DEFAULT_PROFILE;
|
|
36239
36239
|
const resolved = await resolveProfile(requested);
|
|
36240
36240
|
if (!resolved) {
|
|
36241
|
-
process.stderr.write(import_picocolors7.default.red("Not logged in. Run
|
|
36241
|
+
process.stderr.write(import_picocolors7.default.red("Not logged in. Run agentgates login first.\n"));
|
|
36242
36242
|
process.exit(2);
|
|
36243
36243
|
}
|
|
36244
36244
|
if (resolved.autoSelected) {
|
|
@@ -36389,7 +36389,7 @@ async function history(opts) {
|
|
|
36389
36389
|
const requested = opts.profile ?? DEFAULT_PROFILE;
|
|
36390
36390
|
const resolved = await resolveProfile(requested);
|
|
36391
36391
|
if (!resolved) {
|
|
36392
|
-
process.stderr.write(import_picocolors8.default.red("Not logged in. Run
|
|
36392
|
+
process.stderr.write(import_picocolors8.default.red("Not logged in. Run agentgates login first.\n"));
|
|
36393
36393
|
process.exit(2);
|
|
36394
36394
|
}
|
|
36395
36395
|
if (resolved.autoSelected) {
|
|
@@ -36949,7 +36949,7 @@ async function swap(amount, fromAsset, opts) {
|
|
|
36949
36949
|
const requested = opts.profile ?? DEFAULT_PROFILE;
|
|
36950
36950
|
const resolved = await resolveProfile(requested);
|
|
36951
36951
|
if (!resolved) {
|
|
36952
|
-
process.stderr.write(import_picocolors10.default.red("Not logged in. Run
|
|
36952
|
+
process.stderr.write(import_picocolors10.default.red("Not logged in. Run agentgates login first.\n"));
|
|
36953
36953
|
process.exit(2);
|
|
36954
36954
|
}
|
|
36955
36955
|
if (resolved.autoSelected) {
|
|
@@ -37272,7 +37272,7 @@ async function earnSupply(amount, asset, opts) {
|
|
|
37272
37272
|
const requested = opts.profile ?? DEFAULT_PROFILE;
|
|
37273
37273
|
const resolved = await resolveProfile(requested);
|
|
37274
37274
|
if (!resolved) {
|
|
37275
|
-
process.stderr.write(import_picocolors13.default.red("Not logged in. Run
|
|
37275
|
+
process.stderr.write(import_picocolors13.default.red("Not logged in. Run agentgates login first.\n"));
|
|
37276
37276
|
process.exit(2);
|
|
37277
37277
|
}
|
|
37278
37278
|
if (resolved.autoSelected) {
|
|
@@ -37365,7 +37365,7 @@ async function earnWithdraw(amountOrMax, asset, opts) {
|
|
|
37365
37365
|
const requested = opts.profile ?? DEFAULT_PROFILE;
|
|
37366
37366
|
const resolved = await resolveProfile(requested);
|
|
37367
37367
|
if (!resolved) {
|
|
37368
|
-
process.stderr.write(import_picocolors14.default.red("Not logged in. Run
|
|
37368
|
+
process.stderr.write(import_picocolors14.default.red("Not logged in. Run agentgates login first.\n"));
|
|
37369
37369
|
process.exit(2);
|
|
37370
37370
|
}
|
|
37371
37371
|
if (resolved.autoSelected) {
|
|
@@ -37478,7 +37478,7 @@ function parseLineJson(values) {
|
|
|
37478
37478
|
async function loadResolvedProfile(requested) {
|
|
37479
37479
|
const resolved = await resolveProfile(requested);
|
|
37480
37480
|
if (!resolved) {
|
|
37481
|
-
process.stderr.write(import_picocolors15.default.red("Not logged in. Run
|
|
37481
|
+
process.stderr.write(import_picocolors15.default.red("Not logged in. Run agentgates login first.\n"));
|
|
37482
37482
|
process.exit(2);
|
|
37483
37483
|
}
|
|
37484
37484
|
if (resolved.autoSelected) {
|
|
@@ -37587,7 +37587,7 @@ async function menuFood(items, opts) {
|
|
|
37587
37587
|
if (!opts.brand || !opts.address) {
|
|
37588
37588
|
process.stderr.write(
|
|
37589
37589
|
import_picocolors15.default.red(
|
|
37590
|
-
"\u2715 --brand and --address are required \u2014 use the pair a `
|
|
37590
|
+
"\u2715 --brand and --address are required \u2014 use the pair a `agentgates eat search` result gave you, verbatim.\n"
|
|
37591
37591
|
)
|
|
37592
37592
|
);
|
|
37593
37593
|
process.exit(2);
|
|
@@ -37607,7 +37607,7 @@ async function orderFood(items, opts) {
|
|
|
37607
37607
|
if (!opts.brand || !opts.address) {
|
|
37608
37608
|
process.stderr.write(
|
|
37609
37609
|
import_picocolors15.default.red(
|
|
37610
|
-
"\u2715 --brand and --address are required \u2014 use the pair a `
|
|
37610
|
+
"\u2715 --brand and --address are required \u2014 use the pair a `agentgates eat search` result gave you, verbatim.\n"
|
|
37611
37611
|
)
|
|
37612
37612
|
);
|
|
37613
37613
|
process.exit(2);
|
|
@@ -37702,7 +37702,7 @@ async function orderFood(items, opts) {
|
|
|
37702
37702
|
}
|
|
37703
37703
|
process.stderr.write(
|
|
37704
37704
|
import_picocolors15.default.dim(
|
|
37705
|
-
`Still being attempted. Check with:
|
|
37705
|
+
`Still being attempted. Check with: agentgates eat status ${orderId}` + (approvalUrl ? ` \u2014 or pay yourself: ${approvalUrl}` : "") + "\n"
|
|
37706
37706
|
)
|
|
37707
37707
|
);
|
|
37708
37708
|
}
|
|
@@ -37801,7 +37801,7 @@ async function withProfile(opts, path5, init) {
|
|
|
37801
37801
|
const requested = opts.profile ?? DEFAULT_PROFILE;
|
|
37802
37802
|
const resolved = await resolveProfile(requested);
|
|
37803
37803
|
if (!resolved) {
|
|
37804
|
-
process.stderr.write(import_picocolors16.default.red("Not logged in. Run
|
|
37804
|
+
process.stderr.write(import_picocolors16.default.red("Not logged in. Run agentgates login first.\n"));
|
|
37805
37805
|
process.exit(2);
|
|
37806
37806
|
}
|
|
37807
37807
|
if (resolved.autoSelected) {
|
|
@@ -37955,7 +37955,7 @@ async function listBounties(opts) {
|
|
|
37955
37955
|
const clipped = rows.length - shown.length;
|
|
37956
37956
|
process.stdout.write(
|
|
37957
37957
|
"\n" + import_picocolors16.default.dim(
|
|
37958
|
-
`${shown.length} of ${rows.length} matching${clipped > 0 ? ` (${clipped} more \u2014 raise --limit)` : ""}.
|
|
37958
|
+
`${shown.length} of ${rows.length} matching${clipped > 0 ? ` (${clipped} more \u2014 raise --limit)` : ""}. agentgates show <id> for detail.
|
|
37959
37959
|
`
|
|
37960
37960
|
)
|
|
37961
37961
|
);
|
|
@@ -38015,7 +38015,7 @@ async function myBounties(opts) {
|
|
|
38015
38015
|
process.stdout.write(
|
|
38016
38016
|
import_picocolors16.default.dim(
|
|
38017
38017
|
status2 ? `No bounties of yours are ${status2}.
|
|
38018
|
-
` : "You have not created any bounties yet. `
|
|
38018
|
+
` : "You have not created any bounties yet. `agentgates draft` starts one.\n"
|
|
38019
38019
|
)
|
|
38020
38020
|
);
|
|
38021
38021
|
return;
|
|
@@ -38094,10 +38094,10 @@ async function loadProfileOrExit(requested, jsonMode) {
|
|
|
38094
38094
|
if (!resolved) {
|
|
38095
38095
|
if (jsonMode) {
|
|
38096
38096
|
process.stdout.write(
|
|
38097
|
-
JSON.stringify({ ok: false, status: "auth_failed", error: "Not logged in. Run
|
|
38097
|
+
JSON.stringify({ ok: false, status: "auth_failed", error: "Not logged in. Run agentgates login first." }) + "\n"
|
|
38098
38098
|
);
|
|
38099
38099
|
} else {
|
|
38100
|
-
process.stderr.write(import_picocolors17.default.red("Not logged in. Run
|
|
38100
|
+
process.stderr.write(import_picocolors17.default.red("Not logged in. Run agentgates login first.\n"));
|
|
38101
38101
|
}
|
|
38102
38102
|
process.exit(2);
|
|
38103
38103
|
}
|
|
@@ -38123,7 +38123,7 @@ function resolveMaxUsd(opts, profile, fallbackHint) {
|
|
|
38123
38123
|
async function fundBounty(bountyId, opts) {
|
|
38124
38124
|
const jsonMode = Boolean(opts.json) || !process.stdout.isTTY;
|
|
38125
38125
|
const { profile, profileName } = await loadProfileOrExit(opts.profile ?? DEFAULT_PROFILE, jsonMode);
|
|
38126
|
-
const maxUsd = resolveMaxUsd(opts, profile, "
|
|
38126
|
+
const maxUsd = resolveMaxUsd(opts, profile, "agentgates fund");
|
|
38127
38127
|
return runIntentFlow({
|
|
38128
38128
|
endpoint: "/api/intents/propose-fund-bounty",
|
|
38129
38129
|
body: {
|
|
@@ -38152,7 +38152,7 @@ async function tipBounty(bountyId, amount, opts) {
|
|
|
38152
38152
|
failArg6(`amount must be a positive USDC number (got ${amount}).`);
|
|
38153
38153
|
}
|
|
38154
38154
|
const { profile, profileName } = await loadProfileOrExit(opts.profile ?? DEFAULT_PROFILE, jsonMode);
|
|
38155
|
-
const maxUsd = opts.maxUsd !== void 0 ? resolveMaxUsd(opts, profile, "
|
|
38155
|
+
const maxUsd = opts.maxUsd !== void 0 ? resolveMaxUsd(opts, profile, "agentgates tip") : Math.ceil(amt * 1.01 * 100) / 100;
|
|
38156
38156
|
return runIntentFlow({
|
|
38157
38157
|
endpoint: "/api/intents/propose-tip",
|
|
38158
38158
|
body: {
|
|
@@ -38182,7 +38182,7 @@ async function subscribeCreator(creatorUserId, opts) {
|
|
|
38182
38182
|
failArg6(`--months must be 1, 3 or 12 (got ${opts.months}). Prepaid periods only \u2014 no auto-renew exists.`);
|
|
38183
38183
|
}
|
|
38184
38184
|
const { profile, profileName } = await loadProfileOrExit(opts.profile ?? DEFAULT_PROFILE, jsonMode);
|
|
38185
|
-
const maxUsd = resolveMaxUsd(opts, profile, "
|
|
38185
|
+
const maxUsd = resolveMaxUsd(opts, profile, "agentgates subscribe");
|
|
38186
38186
|
return runIntentFlow({
|
|
38187
38187
|
endpoint: "/api/intents/propose-subscribe",
|
|
38188
38188
|
body: {
|
|
@@ -38212,7 +38212,7 @@ async function runWork(path5, body, opts) {
|
|
|
38212
38212
|
const requested = opts.profile ?? DEFAULT_PROFILE;
|
|
38213
38213
|
const resolved = await resolveProfile(requested);
|
|
38214
38214
|
if (!resolved) {
|
|
38215
|
-
process.stderr.write(import_picocolors18.default.red("Not logged in. Run
|
|
38215
|
+
process.stderr.write(import_picocolors18.default.red("Not logged in. Run agentgates login first.\n"));
|
|
38216
38216
|
process.exit(2);
|
|
38217
38217
|
}
|
|
38218
38218
|
if (resolved.autoSelected) {
|
|
@@ -38925,7 +38925,7 @@ async function tradeStatus(opts) {
|
|
|
38925
38925
|
if (floor) lines.push(`Buy floor: $${floor.usdc} (served by launch-config)`);
|
|
38926
38926
|
if (!key) {
|
|
38927
38927
|
lines.push("No agent trading key yet. Create one:");
|
|
38928
|
-
lines.push("
|
|
38928
|
+
lines.push(" agentgates trade key");
|
|
38929
38929
|
} else {
|
|
38930
38930
|
lines.push(`Trade key: ${key.state.address}`);
|
|
38931
38931
|
lines.push(`USDC: ${usdc ? formatUnits(usdc.units, usdc.decimals) : "(unreadable right now \u2014 RPC did not answer; not zero)"}`);
|
|
@@ -39049,7 +39049,7 @@ async function tradeSell(coinArg, amount, opts) {
|
|
|
39049
39049
|
await withContext(opts, async (ctx) => {
|
|
39050
39050
|
const coin = await resolveCoin(coinArg);
|
|
39051
39051
|
const key = await loadTradeKey();
|
|
39052
|
-
if (!key) fail("No agent trading key yet (nothing to sell with). Run:
|
|
39052
|
+
if (!key) fail("No agent trading key yet (nothing to sell with). Run: agentgates trade key", opts.json);
|
|
39053
39053
|
let sellAmount = amount.trim();
|
|
39054
39054
|
const pct = sellAmount.match(/^(\d+)%$/);
|
|
39055
39055
|
if (sellAmount === "all" || pct) {
|
|
@@ -39166,7 +39166,7 @@ async function tradeOrderPlace(coinArg, opts) {
|
|
|
39166
39166
|
async function tradeOrdersList(opts) {
|
|
39167
39167
|
await withContext(opts, async (ctx) => {
|
|
39168
39168
|
const key = await loadTradeKey();
|
|
39169
|
-
if (!key) fail("No agent trading key yet. Run:
|
|
39169
|
+
if (!key) fail("No agent trading key yet. Run: agentgates trade key", opts.json);
|
|
39170
39170
|
const token = opts.coin ? (await resolveCoin(opts.coin)).mint : void 0;
|
|
39171
39171
|
const res = await listOrders(key.state.address, token);
|
|
39172
39172
|
if (opts.json) {
|
|
@@ -39186,7 +39186,7 @@ async function tradeOrdersList(opts) {
|
|
|
39186
39186
|
async function tradeOrderCancel(id, opts) {
|
|
39187
39187
|
await withContext(opts, async (_ctx) => {
|
|
39188
39188
|
const key = await loadTradeKey();
|
|
39189
|
-
if (!key) fail("No agent trading key yet. Run:
|
|
39189
|
+
if (!key) fail("No agent trading key yet. Run: agentgates trade key", opts.json);
|
|
39190
39190
|
try {
|
|
39191
39191
|
await cancelOrder(id, key.state.address);
|
|
39192
39192
|
} catch (err) {
|
|
@@ -39209,7 +39209,7 @@ async function tradeOrderCancel(id, opts) {
|
|
|
39209
39209
|
async function tradePositions(opts) {
|
|
39210
39210
|
await withContext(opts, async (ctx) => {
|
|
39211
39211
|
const key = await loadTradeKey();
|
|
39212
|
-
if (!key) fail("No agent trading key yet. Run:
|
|
39212
|
+
if (!key) fail("No agent trading key yet. Run: agentgates trade key", opts.json);
|
|
39213
39213
|
let body;
|
|
39214
39214
|
try {
|
|
39215
39215
|
body = await relayGet(`/launch-portfolio?address=${encodeURIComponent(key.state.address)}`);
|
|
@@ -39336,7 +39336,7 @@ async function prepareDeskOp(body) {
|
|
|
39336
39336
|
function signDeskTemplate(prepared, keypair, chain, role) {
|
|
39337
39337
|
if (prepared.signWith !== keypair.publicKey.toBase58()) {
|
|
39338
39338
|
throw new Error(
|
|
39339
|
-
role === "session" ? `The desk's registered session key is ${prepared.signWith}; this terminal holds ${keypair.publicKey.toBase58()}. Re-register:
|
|
39339
|
+
role === "session" ? `The desk's registered session key is ${prepared.signWith}; this terminal holds ${keypair.publicKey.toBase58()}. Re-register: agentgates desk session register --cap <usdc> --minutes <n>` : `The prepared template names signer ${prepared.signWith}, not this terminal's ${role} key.`
|
|
39340
39340
|
);
|
|
39341
39341
|
}
|
|
39342
39342
|
if (chain.feePayer && prepared.feePayer !== chain.feePayer) {
|
|
@@ -39452,7 +39452,7 @@ function servedFloorUnits2(ctx) {
|
|
|
39452
39452
|
async function requireOwner(opts) {
|
|
39453
39453
|
const key = await loadTradeKey();
|
|
39454
39454
|
if (!key) {
|
|
39455
|
-
fail2("No agent trading key yet (the desk's owner). Run:
|
|
39455
|
+
fail2("No agent trading key yet (the desk's owner). Run: agentgates trade key", opts.json);
|
|
39456
39456
|
}
|
|
39457
39457
|
return key;
|
|
39458
39458
|
}
|
|
@@ -39468,7 +39468,7 @@ function stateJson(state) {
|
|
|
39468
39468
|
function describeSession(state, localSessionAddress) {
|
|
39469
39469
|
if (!state.session) {
|
|
39470
39470
|
return [
|
|
39471
|
-
"Session: none (register one:
|
|
39471
|
+
"Session: none (register one: agentgates desk session register --cap <usdc> --minutes <n>)"
|
|
39472
39472
|
];
|
|
39473
39473
|
}
|
|
39474
39474
|
const s = state.session;
|
|
@@ -39750,7 +39750,7 @@ async function requireSessionKeypair(opts) {
|
|
|
39750
39750
|
const session = await loadDeskSessionKey();
|
|
39751
39751
|
if (!session) {
|
|
39752
39752
|
fail2(
|
|
39753
|
-
"No desk session key on this terminal. Register one:
|
|
39753
|
+
"No desk session key on this terminal. Register one: agentgates desk session register --cap <usdc> --minutes <n>",
|
|
39754
39754
|
opts.json
|
|
39755
39755
|
);
|
|
39756
39756
|
}
|
|
@@ -39850,7 +39850,7 @@ async function deskSell(coinArg, amount, opts) {
|
|
|
39850
39850
|
// src/main.ts
|
|
39851
39851
|
var { version: VERSION } = require_package();
|
|
39852
39852
|
var program2 = new Command();
|
|
39853
|
-
program2.name("
|
|
39853
|
+
program2.name("agentgates").description(
|
|
39854
39854
|
"Drive your non-custodial Agentgates wallet from the terminal.\nPair once with biometric; every send still requires biometric in your browser."
|
|
39855
39855
|
).version(VERSION);
|
|
39856
39856
|
program2.command("login").description("Pair this terminal with your Agentgates wallet (one-time)").option("--profile <name>", "named profile (default: 'default')").option("--no-browser", "don't auto-open the approval URL \u2014 print it only").action(async (opts) => {
|
|
@@ -39891,7 +39891,7 @@ program2.command("send").description(
|
|
|
39891
39891
|
});
|
|
39892
39892
|
}
|
|
39893
39893
|
);
|
|
39894
|
-
program2.command("status").description("Read the status of a previously-proposed intent").argument("<intent-id>", "the approval_id returned by `
|
|
39894
|
+
program2.command("status").description("Read the status of a previously-proposed intent").argument("<intent-id>", "the approval_id returned by `agentgates send`").option("--profile <name>", "named profile (default: 'default')").option("--watch", "tail until terminal (mined / rejected / expired / failed)").option("--json", "machine-readable output").action(
|
|
39895
39895
|
async (intentId, opts) => {
|
|
39896
39896
|
await status(intentId, opts);
|
|
39897
39897
|
}
|
|
@@ -40094,8 +40094,8 @@ eat.command("search").description(
|
|
|
40094
40094
|
});
|
|
40095
40095
|
});
|
|
40096
40096
|
eat.command("menu").description(
|
|
40097
|
-
"Read what one store has \u2014 items, sizes, prices, option sets. A relevance SAMPLE, never the full catalogue; for actually ordering, skip straight to `
|
|
40098
|
-
).argument("[items...]", "dishes to check for, in the person's own words \u2014 this is the lever over what comes back").requiredOption("--brand <name>", "the store, from a `
|
|
40097
|
+
"Read what one store has \u2014 items, sizes, prices, option sets. A relevance SAMPLE, never the full catalogue; for actually ordering, skip straight to `agentgates eat order`."
|
|
40098
|
+
).argument("[items...]", "dishes to check for, in the person's own words \u2014 this is the lever over what comes back").requiredOption("--brand <name>", "the store, from a `agentgates eat search` result").requiredOption(
|
|
40099
40099
|
"--address <address>",
|
|
40100
40100
|
"that location's address, from the same result \u2014 use the row's lookupAddress when it has one (street + area resolves; the bare street alone can answer 404)"
|
|
40101
40101
|
).option("--intent <text>", 'a theme, biases the sample \u2014 "lunch", "something vegan"').option("--profile <name>", "named profile (default: 'default')").option("--json", "machine-readable output (default when stdout is not a TTY)").action(async (items, opts) => {
|
|
@@ -40108,8 +40108,8 @@ eat.command("menu").description(
|
|
|
40108
40108
|
});
|
|
40109
40109
|
});
|
|
40110
40110
|
eat.command("order").description(
|
|
40111
|
-
"Build a priced, itemised order at one store and get back a link only the person can pay. Never charges anything \u2014 find the store with `
|
|
40112
|
-
).argument("[items...]", `one dish per argument, in the person's own words \u2014 e.g. "al pastor taco" "horchata"`).requiredOption("--brand <name>", "the store, from a `
|
|
40111
|
+
"Build a priced, itemised order at one store and get back a link only the person can pay. Never charges anything \u2014 find the store with `agentgates eat search` first and pass its brand + address through verbatim."
|
|
40112
|
+
).argument("[items...]", `one dish per argument, in the person's own words \u2014 e.g. "al pastor taco" "horchata"`).requiredOption("--brand <name>", "the store, from a `agentgates eat search` result").requiredOption(
|
|
40113
40113
|
"--address <address>",
|
|
40114
40114
|
"that location's address, from the same result \u2014 use the row's lookupAddress when it has one (street + area resolves; the bare street alone can answer 404)"
|
|
40115
40115
|
).option(
|
|
@@ -40136,7 +40136,7 @@ eat.command("order").description(
|
|
|
40136
40136
|
});
|
|
40137
40137
|
eat.command("status").description(
|
|
40138
40138
|
"One order's current state \u2014 pending, paid (your saved card covered it), failed (provably not charged), or unconfirmed (a human must look before anything retries)."
|
|
40139
|
-
).argument("<orderId>", "the order_id a `
|
|
40139
|
+
).argument("<orderId>", "the order_id a `agentgates eat order` response carried").option("--profile <name>", "named profile (default: 'default')").option("--json", "machine-readable output (default when stdout is not a TTY)").action(async (orderId, opts) => {
|
|
40140
40140
|
await statusFood(orderId, { profile: opts.profile, json: opts.json });
|
|
40141
40141
|
});
|
|
40142
40142
|
program2.command("list").description(
|
|
@@ -40177,7 +40177,7 @@ program2.command("live").description("Who is streaming on bounties right now \u2
|
|
|
40177
40177
|
program2.command("pot").description("A bounty's REAL current pot, read from its escrow contract: base pool, sweetener, funded state, claims left. Stream tips (the streamer's, never the pot) ride along when live.").argument("<id>", "the bounty id").option("--profile <name>", "named profile (default: 'default')").option("--json", "machine-readable output").action(async (id, opts) => {
|
|
40178
40178
|
await bountyPot(id, opts);
|
|
40179
40179
|
});
|
|
40180
|
-
program2.command("who").description("A creator's public track record: shipped bounties, library, subscription price, and whether you hold access.").argument("<creator-user-id>", "the creator's user id (a bounty's userId from
|
|
40180
|
+
program2.command("who").description("A creator's public track record: shipped bounties, library, subscription price, and whether you hold access.").argument("<creator-user-id>", "the creator's user id (a bounty's userId from agentgates show --json)").option("--profile <name>", "named profile (default: 'default')").option("--json", "machine-readable output").action(async (creatorUserId, opts) => {
|
|
40181
40181
|
await creatorWho(creatorUserId, opts);
|
|
40182
40182
|
});
|
|
40183
40183
|
program2.command("retention").description("Your OWN bounty's retention readout: what is kept, under what policy, what keeping it costs. Creator-only; read-only.").argument("<id>", "your bounty id").option("--profile <name>", "named profile (default: 'default')").option("--json", "machine-readable output").action(async (id, opts) => {
|
|
@@ -40190,7 +40190,7 @@ program2.command("deliver").description(
|
|
|
40190
40190
|
});
|
|
40191
40191
|
program2.command("fund").description(
|
|
40192
40192
|
"Two shapes, picked by the target. `fund <bounty-id>`: fund YOUR OWN bounty's escrow so it goes live (amount/chain/escrow read from the bounty). `fund <address> --usdc N --gas M --chain C`: top up a payer wallet in ONE approval ceremony \u2014 the server plans the legs (a shortfall swap sized with headroom when your USDC can't cover) and the ceremony shows the whole plan."
|
|
40193
|
-
).argument("<target>", "a bounty id (see
|
|
40193
|
+
).argument("<target>", "a bounty id (see agentgates mine) OR a payer address (0x\u2026 / Solana base58)").requiredOption(
|
|
40194
40194
|
"--user-stated <text>",
|
|
40195
40195
|
"the verbatim user request that triggered this funding (trust-gap defense)"
|
|
40196
40196
|
).option("--usdc <n>", "address targets only: USDC the payer should receive, display units").option("--gas <n>", "address targets only: native gas the payer should receive, display units").option("--chain <chain>", "address targets only: chain id (1/137/8453/42161/900) or shortName").option("--profile <name>", "named profile (default: 'default')").option("--browser", "force open the approval URL (default unless --no-browser or CI=1)").option("--no-browser", "skip opening the approval URL").option(
|
|
@@ -40234,7 +40234,7 @@ program2.command("fund").description(
|
|
|
40234
40234
|
});
|
|
40235
40235
|
program2.command("tip").description(
|
|
40236
40236
|
"Add your own USDC to a live bounty's prize pot (sweeten). The pot pays out with the bounty. Opens your browser for biometric approval, then polls until mined."
|
|
40237
|
-
).argument("<id>", "the bounty id (see
|
|
40237
|
+
).argument("<id>", "the bounty id (see agentgates list)").argument("<amount>", 'contribution in USDC display units (e.g. "5")').requiredOption(
|
|
40238
40238
|
"--user-stated <text>",
|
|
40239
40239
|
"the verbatim user request that triggered this tip (trust-gap defense)"
|
|
40240
40240
|
).option("--profile <name>", "named profile (default: 'default')").option("--browser", "force open the approval URL (default unless --no-browser or CI=1)").option("--no-browser", "skip opening the approval URL").option("--max-usd <n>", "per-intent USD ceiling (default: amount + 1% price wobble)").option("--json", "NDJSON output (one object per status flip + final terminal object)").action(async (id, amount, opts, command) => {
|
|
@@ -40253,7 +40253,7 @@ program2.command("tip").description(
|
|
|
40253
40253
|
});
|
|
40254
40254
|
program2.command("subscribe").description(
|
|
40255
40255
|
"Buy prepaid months of a creator's subscription at THEIR stored price (read server-side, never guessed). Prepaid only \u2014 no auto-renew exists. Opens your browser for biometric approval."
|
|
40256
|
-
).argument("<creator-user-id>", "the creator's user id (a bounty's userId from
|
|
40256
|
+
).argument("<creator-user-id>", "the creator's user id (a bounty's userId from agentgates show --json)").requiredOption(
|
|
40257
40257
|
"--user-stated <text>",
|
|
40258
40258
|
"the verbatim user request that triggered this purchase (trust-gap defense)"
|
|
40259
40259
|
).option("--months <n>", "prepaid months: 1, 3 or 12 (default 1)").option("--profile <name>", "named profile (default: 'default')").option("--browser", "force open the approval URL (default unless --no-browser or CI=1)").option("--no-browser", "skip opening the approval URL").option(
|
|
@@ -40301,7 +40301,7 @@ var tradeOrder = trade.command("order").description(
|
|
|
40301
40301
|
tradeOrder.command("place").description("Place a standing order (buy_at / sell_at / buy_on_graduation / sell_on_graduation)").argument("<coin>", "coin ticker or base58 mint address").option("--buy <usdc>", "buy this much USDC when the trigger crosses (floor served by launch-config)").option("--sell <amount>", 'sell this amount, a percentage like "50%", or "all" (resolved at placement)').option("--at <value>", "trigger value in USDC: price per coin, or market cap with --mcap").option("--mcap", "the --at value is a market cap, not a price").option("--stop", "sell when the value drops TO OR BELOW --at (default: take-profit at-or-above)").option("--on-graduation", "fire near graduation instead of a price/mcap trigger").option("--expires-days <n>", "order lifetime in days (default: the served orders config)").option("--json", "machine-readable output").action(async (coin, opts) => {
|
|
40302
40302
|
await tradeOrderPlace(coin, opts);
|
|
40303
40303
|
});
|
|
40304
|
-
tradeOrder.command("cancel").description("Cancel a standing order: withdraws its nonce on chain, the signed bytes can never land").argument("<id>", "the order id (see:
|
|
40304
|
+
tradeOrder.command("cancel").description("Cancel a standing order: withdraws its nonce on chain, the signed bytes can never land").argument("<id>", "the order id (see: agentgates trade orders)").option("--json", "machine-readable output").action(async (id, opts) => {
|
|
40305
40305
|
await tradeOrderCancel(id, opts);
|
|
40306
40306
|
});
|
|
40307
40307
|
trade.command("orders").description("List the agent key's standing orders (open, fired, missed, expired, canceled)").option("--coin <ticker-or-mint>", "only this coin's orders").option("--json", "machine-readable output").action(async (opts) => {
|
package/package.json
CHANGED
package/scripts/postinstall.mjs
CHANGED
|
@@ -7,24 +7,27 @@ const MARKER_START = "<!-- agentgates-cli:start -->";
|
|
|
7
7
|
const MARKER_END = "<!-- agentgates-cli:end -->";
|
|
8
8
|
|
|
9
9
|
const CONTEXT_BLOCK = `
|
|
10
|
-
## Agentgates CLI (\`
|
|
10
|
+
## Agentgates CLI (\`agentgates\`)
|
|
11
11
|
|
|
12
12
|
When the user asks to check balance, send, swap, earn, or do anything with
|
|
13
|
-
their Agentgates wallet — use the \`
|
|
13
|
+
their Agentgates wallet — use the \`agentgates\` CLI command, not MCP tools.
|
|
14
14
|
|
|
15
15
|
\`\`\`
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
agentgates balance # wallet balances across all chains
|
|
17
|
+
agentgates send <amt> <asset> [--to <addr>] [--chain <chain>]
|
|
18
|
+
agentgates swap <amt> <from> [--to <asset>] [--chain <chain>] [--slippage-bps <n>]
|
|
19
|
+
agentgates fund <address> [--usdc <n>] [--gas <n>] --chain <chain> # payer top-up, one approval
|
|
20
|
+
agentgates batch --legs-json <json> # several money moves, one approval
|
|
21
|
+
agentgates earn supply|withdraw <amt> <asset> [--chain <chain>]
|
|
22
|
+
agentgates history # recent activity
|
|
23
|
+
agentgates whoami # pairing info
|
|
24
|
+
agentgates login # one-time pairing
|
|
23
25
|
\`\`\`
|
|
24
26
|
|
|
25
|
-
The \`
|
|
26
|
-
\`propose_send\`, etc.) are the programmatic layer underneath —
|
|
27
|
-
for user-facing operations.
|
|
27
|
+
The \`agentgates\` command is the primary interface. MCP tools (\`wallet://\`
|
|
28
|
+
resources, \`propose_send\`, etc.) are the programmatic layer underneath —
|
|
29
|
+
prefer \`agentgates\` for user-facing operations. Swap slippage walls at
|
|
30
|
+
100 bps (1%); \`--max-loss-bps\` (101-1000) is the loud per-swap override.
|
|
28
31
|
`.trim();
|
|
29
32
|
|
|
30
33
|
function injectBlock(filePath, block) {
|
|
@@ -101,10 +104,10 @@ console.log(`
|
|
|
101
104
|
╔══════════════════════════════════════════════════════╗
|
|
102
105
|
║ agentgates-cli installed ║
|
|
103
106
|
║ ║
|
|
104
|
-
║ Use \`
|
|
105
|
-
║ Run \`
|
|
107
|
+
║ Use \`agentgates <command>\` for all wallet operations. ║
|
|
108
|
+
║ Run \`agentgates --help\` for the full command list. ║
|
|
106
109
|
║ ║
|
|
107
|
-
║ AI agents: prefer \`
|
|
110
|
+
║ AI agents: prefer \`agentgates balance\` over MCP ║
|
|
108
111
|
║ wallet://balances. The CLI is the user-facing ║
|
|
109
112
|
║ interface; MCP is the programmatic layer beneath. ║
|
|
110
113
|
╚══════════════════════════════════════════════════════╝
|