@agentgates/cli 0.11.3 → 0.13.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/dist/cli.mjs +536 -269
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -3118,7 +3118,7 @@ var require_package = __commonJS({
|
|
|
3118
3118
|
"package.json"(exports, module) {
|
|
3119
3119
|
module.exports = {
|
|
3120
3120
|
name: "@agentgates/cli",
|
|
3121
|
-
version: "0.
|
|
3121
|
+
version: "0.13.0",
|
|
3122
3122
|
description: "Wallet operations for AI agents and humans",
|
|
3123
3123
|
keywords: [
|
|
3124
3124
|
"crypto",
|
|
@@ -34373,7 +34373,7 @@ var {
|
|
|
34373
34373
|
} = import_index.default;
|
|
34374
34374
|
|
|
34375
34375
|
// src/main.ts
|
|
34376
|
-
var
|
|
34376
|
+
var import_picocolors27 = __toESM(require_picocolors(), 1);
|
|
34377
34377
|
|
|
34378
34378
|
// src/commands/login.ts
|
|
34379
34379
|
var import_picocolors2 = __toESM(require_picocolors(), 1);
|
|
@@ -35346,7 +35346,7 @@ function shortAddress(addr) {
|
|
|
35346
35346
|
}
|
|
35347
35347
|
|
|
35348
35348
|
// src/commands/onboard.ts
|
|
35349
|
-
var
|
|
35349
|
+
var import_picocolors7 = __toESM(require_picocolors(), 1);
|
|
35350
35350
|
import { createInterface } from "node:readline/promises";
|
|
35351
35351
|
|
|
35352
35352
|
// src/lib/water.ts
|
|
@@ -35608,6 +35608,217 @@ async function inferenceAsk() {
|
|
|
35608
35608
|
);
|
|
35609
35609
|
}
|
|
35610
35610
|
|
|
35611
|
+
// src/commands/phone.ts
|
|
35612
|
+
var import_picocolors5 = __toESM(require_picocolors(), 1);
|
|
35613
|
+
var SITE3 = (process.env.AGENTGATES_ORIGIN || "https://agentgates.ai").replace(/\/$/, "");
|
|
35614
|
+
var usd2 = (v) => {
|
|
35615
|
+
const n = Number(v);
|
|
35616
|
+
if (Number.isInteger(n)) return `$${n}`;
|
|
35617
|
+
const [whole, frac = ""] = n.toFixed(6).replace(/0+$/, "").split(".");
|
|
35618
|
+
return `$${whole}.${frac.padEnd(2, "0")}`;
|
|
35619
|
+
};
|
|
35620
|
+
function phoneSlice(body) {
|
|
35621
|
+
const { booth, ...rest } = body;
|
|
35622
|
+
const out = {
|
|
35623
|
+
...rest,
|
|
35624
|
+
products: (body.products ?? []).filter((p) => p.id === "phone"),
|
|
35625
|
+
rungs: (body.rungs ?? []).filter((r) => r.product === "phone"),
|
|
35626
|
+
prices: (body.prices ?? []).filter((p) => p.product === "phone")
|
|
35627
|
+
};
|
|
35628
|
+
if (booth?.call) out.booth = { brief: booth.brief, call: booth.call };
|
|
35629
|
+
delete out.payg;
|
|
35630
|
+
delete out.sendOverflow;
|
|
35631
|
+
return out;
|
|
35632
|
+
}
|
|
35633
|
+
async function phonePricing(opts) {
|
|
35634
|
+
const res = await fetch(`${SITE3}/api/identity/catalog`, { headers: { accept: "application/json" } });
|
|
35635
|
+
if (!res.ok) throw new Error(`phone catalog: HTTP ${res.status}`);
|
|
35636
|
+
const body = await res.json();
|
|
35637
|
+
const slice = phoneSlice(body);
|
|
35638
|
+
if (opts.json) {
|
|
35639
|
+
process.stdout.write(JSON.stringify(slice, null, 2) + "\n");
|
|
35640
|
+
return;
|
|
35641
|
+
}
|
|
35642
|
+
const product = slice.products?.[0];
|
|
35643
|
+
if (!product || product.available === false) {
|
|
35644
|
+
process.stdout.write(` ${import_picocolors5.default.dim(product?.brief || "Phone numbers are not on sale right now.")}
|
|
35645
|
+
`);
|
|
35646
|
+
return;
|
|
35647
|
+
}
|
|
35648
|
+
const plans = slice.prices ?? [];
|
|
35649
|
+
process.stdout.write(`
|
|
35650
|
+
${import_picocolors5.default.bold("PHONE NUMBERS")} ${import_picocolors5.default.dim("texts and calls, on a wallet plan")}
|
|
35651
|
+
|
|
35652
|
+
`);
|
|
35653
|
+
for (const p of plans) {
|
|
35654
|
+
const count = p.phones ?? 1;
|
|
35655
|
+
const price = usd2(p.priceUsd).padStart(4);
|
|
35656
|
+
const term = `/${p.units} days`.padEnd(9);
|
|
35657
|
+
process.stdout.write(` ${import_picocolors5.default.bold(p.rung.padEnd(11))} ${import_picocolors5.default.cyan(price)}${import_picocolors5.default.dim(term)} ${import_picocolors5.default.dim(`${count} number${count === 1 ? "" : "s"}`)}
|
|
35658
|
+
`);
|
|
35659
|
+
}
|
|
35660
|
+
if (plans.length === 0) process.stdout.write(` ${import_picocolors5.default.dim("no plan rungs are priced right now")}
|
|
35661
|
+
`);
|
|
35662
|
+
const u = slice.phoneUsage;
|
|
35663
|
+
if (u) {
|
|
35664
|
+
const meter = [
|
|
35665
|
+
u.textUsd ? `text ${usd2(u.textUsd)}` : "",
|
|
35666
|
+
u.minuteUsd ? `call minute ${usd2(u.minuteUsd)}` : "",
|
|
35667
|
+
u.waitCodeUsd !== void 0 ? `wait-code ${Number(u.waitCodeUsd) === 0 ? "free" : usd2(u.waitCodeUsd)}` : ""
|
|
35668
|
+
].filter(Boolean).join(" \xB7 ");
|
|
35669
|
+
process.stdout.write(`
|
|
35670
|
+
${import_picocolors5.default.dim(`usage, from the prepaid balance: ${meter}`)}
|
|
35671
|
+
`);
|
|
35672
|
+
if (u.sendingNote) process.stdout.write(` ${import_picocolors5.default.dim(u.sendingNote)}
|
|
35673
|
+
`);
|
|
35674
|
+
}
|
|
35675
|
+
const call = slice.booth?.call;
|
|
35676
|
+
const windows = call?.windows ?? [];
|
|
35677
|
+
if (call?.available && windows.length) {
|
|
35678
|
+
process.stdout.write(`
|
|
35679
|
+
${import_picocolors5.default.bold("PAYPHONE")} ${import_picocolors5.default.dim("no plan, no number: one payment, one call")}
|
|
35680
|
+
|
|
35681
|
+
`);
|
|
35682
|
+
const ladder = windows.map((w) => `${w.minutes} min ${usd2(w.priceUsd)}`).join(" ");
|
|
35683
|
+
process.stdout.write(` ${import_picocolors5.default.dim(ladder)}
|
|
35684
|
+
`);
|
|
35685
|
+
}
|
|
35686
|
+
const nets = [...new Set((plans[0]?.byNetwork ?? []).map((n) => n.network))];
|
|
35687
|
+
if (nets.length) process.stdout.write(`
|
|
35688
|
+
${import_picocolors5.default.dim(`USDC on ${nets.join(", ")}`)}
|
|
35689
|
+
|
|
35690
|
+
`);
|
|
35691
|
+
else process.stdout.write("\n");
|
|
35692
|
+
}
|
|
35693
|
+
async function phoneCall() {
|
|
35694
|
+
process.stdout.write(
|
|
35695
|
+
`
|
|
35696
|
+
A call signs an x402 payment, and this CLI has no signer yet.
|
|
35697
|
+
Call from the wallet, one biometric: ${import_picocolors5.default.cyan(`${SITE3}/phone`)}
|
|
35698
|
+
Prices from here: ${import_picocolors5.default.dim("agentgates phone pricing")}
|
|
35699
|
+
|
|
35700
|
+
`
|
|
35701
|
+
);
|
|
35702
|
+
}
|
|
35703
|
+
|
|
35704
|
+
// src/commands/email.ts
|
|
35705
|
+
var import_picocolors6 = __toESM(require_picocolors(), 1);
|
|
35706
|
+
var SITE4 = (process.env.AGENTGATES_ORIGIN || "https://agentgates.ai").replace(/\/$/, "");
|
|
35707
|
+
var usd3 = (v) => {
|
|
35708
|
+
const n = Number(v);
|
|
35709
|
+
if (Number.isInteger(n)) return `$${n}`;
|
|
35710
|
+
const [whole, frac = ""] = n.toFixed(6).replace(/0+$/, "").split(".");
|
|
35711
|
+
return `$${whole}.${frac.padEnd(2, "0")}`;
|
|
35712
|
+
};
|
|
35713
|
+
var family = (rung) => {
|
|
35714
|
+
const base = rung.replace(/-?(month|year)$/, "");
|
|
35715
|
+
return base === "" ? "Starter" : base.charAt(0).toUpperCase() + base.slice(1);
|
|
35716
|
+
};
|
|
35717
|
+
function emailSlice(body) {
|
|
35718
|
+
const out = {
|
|
35719
|
+
...body,
|
|
35720
|
+
products: (body.products ?? []).filter((p) => p.id === "inbox"),
|
|
35721
|
+
rungs: (body.rungs ?? []).filter((r) => r.product === "inbox"),
|
|
35722
|
+
prices: (body.prices ?? []).filter((p) => p.product === "inbox")
|
|
35723
|
+
};
|
|
35724
|
+
for (const k of ["booth", "phoneUsage", "voices", "operator", "countries"]) {
|
|
35725
|
+
delete out[k];
|
|
35726
|
+
}
|
|
35727
|
+
return out;
|
|
35728
|
+
}
|
|
35729
|
+
async function emailPricing(opts) {
|
|
35730
|
+
const res = await fetch(`${SITE4}/api/identity/catalog`, { headers: { accept: "application/json" } });
|
|
35731
|
+
if (!res.ok) throw new Error(`email catalog: HTTP ${res.status}`);
|
|
35732
|
+
const body = await res.json();
|
|
35733
|
+
const slice = emailSlice(body);
|
|
35734
|
+
const product = slice.products?.[0];
|
|
35735
|
+
if (opts.json) {
|
|
35736
|
+
process.stdout.write(JSON.stringify(slice, null, 2) + "\n");
|
|
35737
|
+
if (!product || product.available === false) process.exitCode = 1;
|
|
35738
|
+
return;
|
|
35739
|
+
}
|
|
35740
|
+
if (!product || product.available === false) {
|
|
35741
|
+
process.stdout.write(` ${import_picocolors6.default.dim(product?.note || product?.brief || "Inboxes are not on sale right now.")}
|
|
35742
|
+
`);
|
|
35743
|
+
process.exitCode = 1;
|
|
35744
|
+
return;
|
|
35745
|
+
}
|
|
35746
|
+
process.stdout.write(`
|
|
35747
|
+
${import_picocolors6.default.bold("EMAIL")} ${import_picocolors6.default.dim(product.brief || "an inbox on your wallet")}
|
|
35748
|
+
|
|
35749
|
+
`);
|
|
35750
|
+
const freeInboxes = slice.payg?.inboxes;
|
|
35751
|
+
if (freeInboxes) {
|
|
35752
|
+
const at = product.domain ? ` @ ${product.domain}` : "";
|
|
35753
|
+
process.stdout.write(
|
|
35754
|
+
` ${import_picocolors6.default.bold("free".padEnd(11))} ${import_picocolors6.default.cyan("$0".padStart(4))}${"".padEnd(11)} ${import_picocolors6.default.dim(`${freeInboxes} inbox${freeInboxes === 1 ? "" : "es"}${at}, behind a funded balance`)}
|
|
35755
|
+
`
|
|
35756
|
+
);
|
|
35757
|
+
}
|
|
35758
|
+
const plans = slice.prices ?? [];
|
|
35759
|
+
const families = [];
|
|
35760
|
+
const byFamily = /* @__PURE__ */ new Map();
|
|
35761
|
+
for (const p of plans) {
|
|
35762
|
+
const f = family(p.rung);
|
|
35763
|
+
if (!byFamily.has(f)) {
|
|
35764
|
+
byFamily.set(f, []);
|
|
35765
|
+
families.push(f);
|
|
35766
|
+
}
|
|
35767
|
+
byFamily.get(f).push(p);
|
|
35768
|
+
}
|
|
35769
|
+
for (const f of families) {
|
|
35770
|
+
const rows = byFamily.get(f).sort((a, b) => a.units - b.units);
|
|
35771
|
+
const cells = rows.map((p) => `${import_picocolors6.default.cyan(usd3(p.priceUsd).padStart(4))}${import_picocolors6.default.dim(`/${p.units} days`.padEnd(10))}`).join(" ");
|
|
35772
|
+
const lead = rows[0];
|
|
35773
|
+
const cap = [
|
|
35774
|
+
lead.inboxes ? `${lead.inboxes} inbox${lead.inboxes === 1 ? "" : "es"}` : "",
|
|
35775
|
+
lead.sendsPerDay ? `${lead.sendsPerDay} sends/day` : ""
|
|
35776
|
+
].filter(Boolean).join(" \xB7 ");
|
|
35777
|
+
process.stdout.write(` ${import_picocolors6.default.bold(f.padEnd(11))} ${cells} ${import_picocolors6.default.dim(cap)}
|
|
35778
|
+
`);
|
|
35779
|
+
}
|
|
35780
|
+
if (plans.length === 0) process.stdout.write(` ${import_picocolors6.default.dim("no plan rungs are priced right now")}
|
|
35781
|
+
`);
|
|
35782
|
+
const send2 = slice.sendOverflow?.priceUsd;
|
|
35783
|
+
const wait = body.phoneUsage?.waitCodeUsd;
|
|
35784
|
+
const meter = [
|
|
35785
|
+
send2 ? `send ${usd3(send2)}` : "",
|
|
35786
|
+
wait !== void 0 ? `wait-code ${Number(wait) === 0 ? "free" : usd3(wait)}` : ""
|
|
35787
|
+
].filter(Boolean).join(" \xB7 ");
|
|
35788
|
+
if (meter) process.stdout.write(`
|
|
35789
|
+
${import_picocolors6.default.dim(`usage, from the prepaid balance: ${meter}`)}
|
|
35790
|
+
`);
|
|
35791
|
+
process.stdout.write(` ${import_picocolors6.default.dim("receiving costs nothing; the plan sells inboxes and sends per day")}
|
|
35792
|
+
`);
|
|
35793
|
+
const bal = slice.balance;
|
|
35794
|
+
if (bal?.note) process.stdout.write(` ${import_picocolors6.default.dim(bal.note)}
|
|
35795
|
+
`);
|
|
35796
|
+
else if (bal?.minTopUpUsd) process.stdout.write(` ${import_picocolors6.default.dim(`top up any amount from ${usd3(bal.minTopUpUsd)}`)}
|
|
35797
|
+
`);
|
|
35798
|
+
const nets = [...new Set((plans[0]?.byNetwork ?? []).map((n) => n.network))];
|
|
35799
|
+
if (nets.length) process.stdout.write(`
|
|
35800
|
+
${import_picocolors6.default.dim(`USDC on ${nets.join(", ")}`)}
|
|
35801
|
+
|
|
35802
|
+
`);
|
|
35803
|
+
else process.stdout.write("\n");
|
|
35804
|
+
}
|
|
35805
|
+
function emailDoor(first) {
|
|
35806
|
+
process.stdout.write(
|
|
35807
|
+
`
|
|
35808
|
+
${first}, and this CLI has no signer yet.
|
|
35809
|
+
Do it from the wallet, one biometric: ${import_picocolors6.default.cyan(`${SITE4}/email`)}
|
|
35810
|
+
Prices from here: ${import_picocolors6.default.dim("agentgates email pricing")}
|
|
35811
|
+
|
|
35812
|
+
`
|
|
35813
|
+
);
|
|
35814
|
+
}
|
|
35815
|
+
async function emailCreate() {
|
|
35816
|
+
emailDoor("An inbox is created under your wallet's own signature");
|
|
35817
|
+
}
|
|
35818
|
+
async function emailSend() {
|
|
35819
|
+
emailDoor("A send signs with your wallet and draws from its balance");
|
|
35820
|
+
}
|
|
35821
|
+
|
|
35611
35822
|
// src/commands/onboard.ts
|
|
35612
35823
|
var WORDMARK = [
|
|
35613
35824
|
" _ _",
|
|
@@ -35616,7 +35827,7 @@ var WORDMARK = [
|
|
|
35616
35827
|
" \\__,_\\__, \\___|_||_\\__\\__, \\__,_|\\__\\___/__/",
|
|
35617
35828
|
" |___/ |___/"
|
|
35618
35829
|
].join("\n");
|
|
35619
|
-
var TAGLINE = "Confidential virtual machines and
|
|
35830
|
+
var TAGLINE = "Confidential virtual machines, inference, phone numbers and email, paid per use in USDC.";
|
|
35620
35831
|
var { version: LOCAL_VERSION } = require_package();
|
|
35621
35832
|
function olderThan(a, b) {
|
|
35622
35833
|
const pa = a.split(".").map(Number);
|
|
@@ -35638,7 +35849,7 @@ async function staleLine() {
|
|
|
35638
35849
|
if (!res.ok) return null;
|
|
35639
35850
|
const { version: latest } = await res.json();
|
|
35640
35851
|
if (!latest || !olderThan(LOCAL_VERSION, latest)) return null;
|
|
35641
|
-
return ` ${
|
|
35852
|
+
return ` ${import_picocolors7.default.yellow("\u2191")} ${latest} is out, this copy is ${LOCAL_VERSION} \xB7 curl -fsSL ${CREATORS_ORIGIN}/api/cli/install | sh
|
|
35642
35853
|
|
|
35643
35854
|
`;
|
|
35644
35855
|
} catch {
|
|
@@ -35653,9 +35864,9 @@ function makePut(w) {
|
|
|
35653
35864
|
}
|
|
35654
35865
|
function banner() {
|
|
35655
35866
|
const w = water();
|
|
35656
|
-
if (!w) process.stdout.write("\n" +
|
|
35867
|
+
if (!w) process.stdout.write("\n" + import_picocolors7.default.cyan(WORDMARK) + "\n\n");
|
|
35657
35868
|
const put = makePut(w);
|
|
35658
|
-
put(` ${
|
|
35869
|
+
put(` ${import_picocolors7.default.dim(TAGLINE)}
|
|
35659
35870
|
|
|
35660
35871
|
`);
|
|
35661
35872
|
return { w, put };
|
|
@@ -35663,49 +35874,60 @@ function banner() {
|
|
|
35663
35874
|
var MENU = {
|
|
35664
35875
|
compute: { label: "see virtual machine pricing" },
|
|
35665
35876
|
models: { label: "see inference pricing" },
|
|
35877
|
+
phone: { label: "see phone pricing" },
|
|
35878
|
+
email: { label: "see email pricing" },
|
|
35666
35879
|
docs: { label: "read the docs" },
|
|
35667
35880
|
poke: { label: "nothing, I'll poke around" },
|
|
35668
35881
|
wallet: { label: "pair my wallet", hint: "(members only)" }
|
|
35669
35882
|
};
|
|
35883
|
+
var LANES = {
|
|
35884
|
+
compute: { key: "compute", name: "virtual machines", docs: "/api/compute/docs" },
|
|
35885
|
+
inference: { key: "models", name: "inference", docs: "/api/inference/docs" },
|
|
35886
|
+
phone: { key: "phone", name: "phone", docs: "/api/identity/docs" },
|
|
35887
|
+
email: { key: "email", name: "email", docs: "/api/identity/docs" }
|
|
35888
|
+
};
|
|
35889
|
+
var LANE_ORDER = ["compute", "inference", "phone", "email"];
|
|
35890
|
+
function leadLane(lane) {
|
|
35891
|
+
return lane === "inference" || lane === "phone" || lane === "email" ? lane : "compute";
|
|
35892
|
+
}
|
|
35893
|
+
function lanesLedBy(lane) {
|
|
35894
|
+
const lead = leadLane(lane);
|
|
35895
|
+
return [lead, ...LANE_ORDER.filter((l) => l !== lead)];
|
|
35896
|
+
}
|
|
35670
35897
|
function menuOrder(lane) {
|
|
35671
|
-
const browse = lane
|
|
35898
|
+
const browse = lanesLedBy(lane).map((l) => LANES[l].key);
|
|
35672
35899
|
return [...browse, "docs", "poke", "wallet"];
|
|
35673
35900
|
}
|
|
35674
35901
|
function printMenu(put, order, first) {
|
|
35675
|
-
put(` ${
|
|
35902
|
+
put(` ${import_picocolors7.default.bold(first ? "choose how to start:" : "what next:")}
|
|
35676
35903
|
`);
|
|
35677
35904
|
order.forEach((k, i) => {
|
|
35678
35905
|
const item = MENU[k];
|
|
35679
|
-
put(` ${
|
|
35906
|
+
put(` ${import_picocolors7.default.cyan(`${i + 1}.`)} ${item.label}${item.hint ? ` ${import_picocolors7.default.dim(item.hint)}` : ""}
|
|
35680
35907
|
`);
|
|
35681
35908
|
});
|
|
35682
35909
|
}
|
|
35683
35910
|
async function printDocs(put, lane) {
|
|
35684
|
-
const lead = lane
|
|
35685
|
-
const
|
|
35686
|
-
const name = (l) => l === "compute" ? "virtual machines" : "inference";
|
|
35911
|
+
const [lead, ...others] = lanesLedBy(lane);
|
|
35912
|
+
const url = (l) => `${CREATORS_ORIGIN}${LANES[l].docs}`;
|
|
35687
35913
|
try {
|
|
35688
|
-
const res = await fetch(
|
|
35689
|
-
headers: { accept: "text/markdown, text/plain" }
|
|
35690
|
-
});
|
|
35914
|
+
const res = await fetch(url(lead), { headers: { accept: "text/markdown, text/plain" } });
|
|
35691
35915
|
if (!res.ok) throw new Error(String(res.status));
|
|
35692
35916
|
const md = (await res.text()).replace(/\s+$/, "");
|
|
35693
35917
|
put(`
|
|
35694
|
-
${
|
|
35918
|
+
${import_picocolors7.default.bold(`THE ${LANES[lead].name.toUpperCase()} CONTRACT`)} ${import_picocolors7.default.dim(url(lead))}
|
|
35695
35919
|
|
|
35696
35920
|
`);
|
|
35697
35921
|
put(md + "\n\n");
|
|
35698
|
-
put(` ${
|
|
35699
|
-
|
|
35922
|
+
for (const other of others) put(` ${import_picocolors7.default.dim(`the ${LANES[other].name} contract:`)} ${url(other)}
|
|
35700
35923
|
`);
|
|
35924
|
+
put("\n");
|
|
35701
35925
|
} catch {
|
|
35702
|
-
put(` ${
|
|
35703
|
-
`);
|
|
35704
|
-
put(` ${import_picocolors5.default.cyan("virtual machines")} ${CREATORS_ORIGIN}/api/compute/docs
|
|
35926
|
+
put(` ${import_picocolors7.default.red("\u2715")} could not fetch the contract; the URLs:
|
|
35705
35927
|
`);
|
|
35706
|
-
put(` ${
|
|
35707
|
-
|
|
35928
|
+
for (const l of LANE_ORDER) put(` ${import_picocolors7.default.cyan(LANES[l].name.padEnd(16))} ${url(l)}
|
|
35708
35929
|
`);
|
|
35930
|
+
put("\n");
|
|
35709
35931
|
}
|
|
35710
35932
|
}
|
|
35711
35933
|
async function onboard(opts = {}) {
|
|
@@ -35713,7 +35935,7 @@ async function onboard(opts = {}) {
|
|
|
35713
35935
|
const { w, put } = banner();
|
|
35714
35936
|
const existing = await loadProfile(profileName).catch(() => null);
|
|
35715
35937
|
if (existing) {
|
|
35716
|
-
put(` ${
|
|
35938
|
+
put(` ${import_picocolors7.default.green("\u2713")} already paired as ${import_picocolors7.default.bold(existing.walletAddress ?? existing.userId)}
|
|
35717
35939
|
|
|
35718
35940
|
`);
|
|
35719
35941
|
}
|
|
@@ -35721,19 +35943,25 @@ async function onboard(opts = {}) {
|
|
|
35721
35943
|
put(` No terminal attached, so no menu. The machine door:
|
|
35722
35944
|
|
|
35723
35945
|
`);
|
|
35724
|
-
put(` agentgates compute plans --json ${
|
|
35946
|
+
put(` agentgates compute plans --json ${import_picocolors7.default.dim("\xB7 virtual machine pricing, JSON")}
|
|
35725
35947
|
`);
|
|
35726
|
-
put(` agentgates inference models --json ${
|
|
35948
|
+
put(` agentgates inference models --json ${import_picocolors7.default.dim("\xB7 model pricing, JSON; --tier --tag --org --search filter it")}
|
|
35727
35949
|
`);
|
|
35728
|
-
put(`
|
|
35950
|
+
put(` agentgates phone pricing --json ${import_picocolors7.default.dim("\xB7 number plans, usage and payphone windows, JSON")}
|
|
35729
35951
|
`);
|
|
35730
|
-
put(` ${
|
|
35952
|
+
put(` agentgates email pricing --json ${import_picocolors7.default.dim("\xB7 the free inbox, plans and per-send price, JSON")}
|
|
35731
35953
|
`);
|
|
35732
|
-
put(` ${CREATORS_ORIGIN}/
|
|
35954
|
+
put(` ${CREATORS_ORIGIN}/api/compute/docs ${import_picocolors7.default.dim("\xB7 the buy/read/renew/destroy contract")}
|
|
35955
|
+
`);
|
|
35956
|
+
put(` ${CREATORS_ORIGIN}/api/inference/docs ${import_picocolors7.default.dim("\xB7 the chat contract, x402 or Bearer")}
|
|
35957
|
+
`);
|
|
35958
|
+
put(` ${CREATORS_ORIGIN}/api/identity/docs ${import_picocolors7.default.dim("\xB7 the phone and email contract: plans, inboxes, the booth")}
|
|
35959
|
+
`);
|
|
35960
|
+
put(` ${CREATORS_ORIGIN}/llms.txt ${import_picocolors7.default.dim("\xB7 the whole surface")}
|
|
35733
35961
|
|
|
35734
35962
|
`);
|
|
35735
35963
|
if (!existing) {
|
|
35736
|
-
put(` Pairing a wallet needs a human at a browser: ${
|
|
35964
|
+
put(` Pairing a wallet needs a human at a browser: ${import_picocolors7.default.bold("agentgates onboard")} in a real terminal.
|
|
35737
35965
|
|
|
35738
35966
|
`);
|
|
35739
35967
|
}
|
|
@@ -35754,7 +35982,7 @@ async function onboard(opts = {}) {
|
|
|
35754
35982
|
const fallback = first ? "1" : exitDefault;
|
|
35755
35983
|
let choice;
|
|
35756
35984
|
try {
|
|
35757
|
-
choice = (await rl.question(` ${
|
|
35985
|
+
choice = (await rl.question(` ${import_picocolors7.default.dim(`choice [${fallback}]:`)} `)).trim() || fallback;
|
|
35758
35986
|
} catch {
|
|
35759
35987
|
if (first) w?.stop();
|
|
35760
35988
|
process.stdout.write("\n");
|
|
@@ -35778,7 +36006,7 @@ async function onboard(opts = {}) {
|
|
|
35778
36006
|
await runLoginFlow({ profile: profileName, jsonMode: false, ttyHeader: "Pairing this terminal with your wallet\u2026" });
|
|
35779
36007
|
process.stdout.write("\n");
|
|
35780
36008
|
} catch {
|
|
35781
|
-
plain(` ${
|
|
36009
|
+
plain(` ${import_picocolors7.default.red("\u2715")} pairing didn't complete
|
|
35782
36010
|
|
|
35783
36011
|
`);
|
|
35784
36012
|
}
|
|
@@ -35787,7 +36015,7 @@ async function onboard(opts = {}) {
|
|
|
35787
36015
|
try {
|
|
35788
36016
|
await computePlans({});
|
|
35789
36017
|
} catch {
|
|
35790
|
-
plain(` ${
|
|
36018
|
+
plain(` ${import_picocolors7.default.red("\u2715")} could not read the compute catalog
|
|
35791
36019
|
|
|
35792
36020
|
`);
|
|
35793
36021
|
}
|
|
@@ -35796,7 +36024,25 @@ async function onboard(opts = {}) {
|
|
|
35796
36024
|
try {
|
|
35797
36025
|
await inferenceModels({});
|
|
35798
36026
|
} catch {
|
|
35799
|
-
plain(` ${
|
|
36027
|
+
plain(` ${import_picocolors7.default.red("\u2715")} could not read the model catalog
|
|
36028
|
+
|
|
36029
|
+
`);
|
|
36030
|
+
}
|
|
36031
|
+
break;
|
|
36032
|
+
case "phone":
|
|
36033
|
+
try {
|
|
36034
|
+
await phonePricing({});
|
|
36035
|
+
} catch {
|
|
36036
|
+
plain(` ${import_picocolors7.default.red("\u2715")} could not read the phone catalog
|
|
36037
|
+
|
|
36038
|
+
`);
|
|
36039
|
+
}
|
|
36040
|
+
break;
|
|
36041
|
+
case "email":
|
|
36042
|
+
try {
|
|
36043
|
+
await emailPricing({});
|
|
36044
|
+
} catch {
|
|
36045
|
+
plain(` ${import_picocolors7.default.red("\u2715")} could not read the email catalog
|
|
35800
36046
|
|
|
35801
36047
|
`);
|
|
35802
36048
|
}
|
|
@@ -35812,26 +36058,30 @@ async function onboard(opts = {}) {
|
|
|
35812
36058
|
}
|
|
35813
36059
|
}
|
|
35814
36060
|
function printNext(put) {
|
|
35815
|
-
put(` ${
|
|
36061
|
+
put(` ${import_picocolors7.default.dim("agentgates compute plans")} ${import_picocolors7.default.dim("\xB7 virtual machines by the hour")}
|
|
36062
|
+
`);
|
|
36063
|
+
put(` ${import_picocolors7.default.dim("agentgates inference models")} ${import_picocolors7.default.dim("\xB7 models by the token")}
|
|
36064
|
+
`);
|
|
36065
|
+
put(` ${import_picocolors7.default.dim("agentgates phone pricing")} ${import_picocolors7.default.dim("\xB7 numbers by the month, calls by the minute")}
|
|
35816
36066
|
`);
|
|
35817
|
-
put(` ${
|
|
36067
|
+
put(` ${import_picocolors7.default.dim("agentgates email pricing")} ${import_picocolors7.default.dim("\xB7 inboxes free on a balance, sends per message")}
|
|
35818
36068
|
`);
|
|
35819
|
-
put(` ${
|
|
36069
|
+
put(` ${import_picocolors7.default.dim("agentgates --help")} ${import_picocolors7.default.dim("\xB7 everything else")}
|
|
35820
36070
|
|
|
35821
36071
|
`);
|
|
35822
36072
|
}
|
|
35823
36073
|
|
|
35824
36074
|
// src/commands/logout.ts
|
|
35825
|
-
var
|
|
36075
|
+
var import_picocolors8 = __toESM(require_picocolors(), 1);
|
|
35826
36076
|
async function logout(opts) {
|
|
35827
36077
|
const requested = opts.profile ?? DEFAULT_PROFILE;
|
|
35828
36078
|
const resolved = await resolveProfile(requested);
|
|
35829
36079
|
if (!resolved) {
|
|
35830
|
-
process.stdout.write(
|
|
36080
|
+
process.stdout.write(import_picocolors8.default.dim("Not logged in \u2014 nothing to log out.\n"));
|
|
35831
36081
|
return;
|
|
35832
36082
|
}
|
|
35833
36083
|
if (resolved.autoSelected) {
|
|
35834
|
-
process.stderr.write(
|
|
36084
|
+
process.stderr.write(import_picocolors8.default.dim(`Using profile "${resolved.name}" (pass --profile to choose)
|
|
35835
36085
|
`));
|
|
35836
36086
|
}
|
|
35837
36087
|
const { profile, name: profileName } = resolved;
|
|
@@ -35856,15 +36106,15 @@ async function logout(opts) {
|
|
|
35856
36106
|
const removed = await deleteProfile(profileName);
|
|
35857
36107
|
if (removed) {
|
|
35858
36108
|
process.stdout.write(
|
|
35859
|
-
|
|
36109
|
+
import_picocolors8.default.green(`\u2713 Logged out of profile ${import_picocolors8.default.bold(profileName)}.
|
|
35860
36110
|
`)
|
|
35861
36111
|
);
|
|
35862
36112
|
}
|
|
35863
36113
|
if (serverError) {
|
|
35864
36114
|
process.stderr.write(
|
|
35865
|
-
|
|
36115
|
+
import_picocolors8.default.yellow(
|
|
35866
36116
|
`\u26A0 Couldn't revoke server-side: ${serverError}
|
|
35867
|
-
The local bearer is wiped. If the server still has it, revoke from ${
|
|
36117
|
+
The local bearer is wiped. If the server still has it, revoke from ${import_picocolors8.default.bold("agentgates.ai/settings/pairings")}.
|
|
35868
36118
|
`
|
|
35869
36119
|
)
|
|
35870
36120
|
);
|
|
@@ -35872,16 +36122,16 @@ async function logout(opts) {
|
|
|
35872
36122
|
}
|
|
35873
36123
|
|
|
35874
36124
|
// src/commands/whoami.ts
|
|
35875
|
-
var
|
|
36125
|
+
var import_picocolors9 = __toESM(require_picocolors(), 1);
|
|
35876
36126
|
async function whoami(opts) {
|
|
35877
36127
|
const requested = opts.profile ?? DEFAULT_PROFILE;
|
|
35878
36128
|
const resolved = await resolveProfile(requested);
|
|
35879
36129
|
if (!resolved) {
|
|
35880
|
-
process.stderr.write(
|
|
36130
|
+
process.stderr.write(import_picocolors9.default.red("Not logged in. Run agentgates login first.\n"));
|
|
35881
36131
|
process.exit(2);
|
|
35882
36132
|
}
|
|
35883
36133
|
if (resolved.autoSelected) {
|
|
35884
|
-
process.stderr.write(
|
|
36134
|
+
process.stderr.write(import_picocolors9.default.dim(`Using profile "${resolved.name}" (pass --profile to choose)
|
|
35885
36135
|
`));
|
|
35886
36136
|
}
|
|
35887
36137
|
const { profile, name: profileName } = resolved;
|
|
@@ -35890,7 +36140,7 @@ async function whoami(opts) {
|
|
|
35890
36140
|
profile,
|
|
35891
36141
|
profileName,
|
|
35892
36142
|
jsonMode,
|
|
35893
|
-
ttyHeader:
|
|
36143
|
+
ttyHeader: import_picocolors9.default.dim("Bearer expired \u2014 re-pairing this terminal\u2026"),
|
|
35894
36144
|
fn: (bearer, origin) => apiFetch("/api/whoami", { bearer, origin })
|
|
35895
36145
|
});
|
|
35896
36146
|
if (outcome.kind === "auth_failed") {
|
|
@@ -35900,14 +36150,14 @@ async function whoami(opts) {
|
|
|
35900
36150
|
);
|
|
35901
36151
|
process.exit(1);
|
|
35902
36152
|
}
|
|
35903
|
-
process.stderr.write(
|
|
36153
|
+
process.stderr.write(import_picocolors9.default.red(`\u2715 ${outcome.reason}.
|
|
35904
36154
|
`));
|
|
35905
36155
|
process.exit(1);
|
|
35906
36156
|
}
|
|
35907
36157
|
if (outcome.kind === "error") {
|
|
35908
36158
|
const err = outcome.error;
|
|
35909
36159
|
if (err instanceof ApiError) {
|
|
35910
|
-
process.stderr.write(
|
|
36160
|
+
process.stderr.write(import_picocolors9.default.red(`\u2715 ${err.message} (HTTP ${err.status})
|
|
35911
36161
|
`));
|
|
35912
36162
|
process.exit(1);
|
|
35913
36163
|
}
|
|
@@ -35928,7 +36178,7 @@ async function whoami(opts) {
|
|
|
35928
36178
|
process.stdout.write(`Solana ${me.solanaAddress}
|
|
35929
36179
|
`);
|
|
35930
36180
|
}
|
|
35931
|
-
process.stdout.write(`Scopes ${me.scopes.join(", ") ||
|
|
36181
|
+
process.stdout.write(`Scopes ${me.scopes.join(", ") || import_picocolors9.default.dim("(none)")}
|
|
35932
36182
|
`);
|
|
35933
36183
|
const txCap = me.perTxUSD == null ? "No limit/tx" : `$${me.perTxUSD}/tx`;
|
|
35934
36184
|
const dayCap = me.perDayUSD == null ? "No limit/day" : `$${me.perDayUSD}/day`;
|
|
@@ -35945,7 +36195,7 @@ async function whoami(opts) {
|
|
|
35945
36195
|
`
|
|
35946
36196
|
);
|
|
35947
36197
|
process.stdout.write(
|
|
35948
|
-
`Profile ${profileName === DEFAULT_PROFILE ?
|
|
36198
|
+
`Profile ${profileName === DEFAULT_PROFILE ? import_picocolors9.default.dim("(default)") : profileName}
|
|
35949
36199
|
`
|
|
35950
36200
|
);
|
|
35951
36201
|
process.stdout.write(AI_DIRECTIVE + "\n");
|
|
@@ -35959,7 +36209,7 @@ function formatDate(iso) {
|
|
|
35959
36209
|
}
|
|
35960
36210
|
|
|
35961
36211
|
// src/commands/send.ts
|
|
35962
|
-
var
|
|
36212
|
+
var import_picocolors10 = __toESM(require_picocolors(), 1);
|
|
35963
36213
|
|
|
35964
36214
|
// src/lib/status.ts
|
|
35965
36215
|
var TERMINAL_STATUSES = /* @__PURE__ */ new Set([
|
|
@@ -36109,11 +36359,11 @@ async function send(amount, asset, opts) {
|
|
|
36109
36359
|
const requested = opts.profile ?? DEFAULT_PROFILE;
|
|
36110
36360
|
const resolved = await resolveProfile(requested);
|
|
36111
36361
|
if (!resolved) {
|
|
36112
|
-
process.stderr.write(
|
|
36362
|
+
process.stderr.write(import_picocolors10.default.red("Not logged in. Run agentgates login first.\n"));
|
|
36113
36363
|
process.exit(2);
|
|
36114
36364
|
}
|
|
36115
36365
|
if (resolved.autoSelected) {
|
|
36116
|
-
process.stderr.write(
|
|
36366
|
+
process.stderr.write(import_picocolors10.default.dim(`Using profile "${resolved.name}" (pass --profile to choose)
|
|
36117
36367
|
`));
|
|
36118
36368
|
}
|
|
36119
36369
|
const { profile, name: profileName } = resolved;
|
|
@@ -36122,7 +36372,7 @@ async function send(amount, asset, opts) {
|
|
|
36122
36372
|
const amountNumber = Number(amount);
|
|
36123
36373
|
if (!Number.isFinite(amountNumber) || amountNumber <= 0) {
|
|
36124
36374
|
process.stderr.write(
|
|
36125
|
-
|
|
36375
|
+
import_picocolors10.default.red(`\u2715 amount must be a positive number (got ${import_picocolors10.default.bold(amount)}).
|
|
36126
36376
|
`)
|
|
36127
36377
|
);
|
|
36128
36378
|
process.exit(2);
|
|
@@ -36130,23 +36380,23 @@ async function send(amount, asset, opts) {
|
|
|
36130
36380
|
const assetNormalized = asset.toLowerCase();
|
|
36131
36381
|
if (assetNormalized !== "native" && assetNormalized !== "usdc") {
|
|
36132
36382
|
process.stderr.write(
|
|
36133
|
-
|
|
36134
|
-
`\u2715 asset must be ${
|
|
36383
|
+
import_picocolors10.default.red(
|
|
36384
|
+
`\u2715 asset must be ${import_picocolors10.default.bold("native")} or ${import_picocolors10.default.bold("usdc")} (got ${import_picocolors10.default.bold(asset)}).
|
|
36135
36385
|
`
|
|
36136
36386
|
)
|
|
36137
36387
|
);
|
|
36138
36388
|
process.exit(2);
|
|
36139
36389
|
}
|
|
36140
36390
|
if (!opts.to || opts.to.trim() === "") {
|
|
36141
|
-
process.stderr.write(
|
|
36391
|
+
process.stderr.write(import_picocolors10.default.red(`\u2715 --to <address> is required.
|
|
36142
36392
|
`));
|
|
36143
36393
|
process.exit(2);
|
|
36144
36394
|
}
|
|
36145
36395
|
if (isSolanaChainAlias(opts.chain)) {
|
|
36146
36396
|
if (EVM_ADDRESS_RE.test(opts.to)) {
|
|
36147
36397
|
process.stderr.write(
|
|
36148
|
-
|
|
36149
|
-
`\u2715 --to looks like an EVM address (0x-hex), but --chain is ${
|
|
36398
|
+
import_picocolors10.default.red(
|
|
36399
|
+
`\u2715 --to looks like an EVM address (0x-hex), but --chain is ${import_picocolors10.default.bold("solana")}. Pass a base58 Solana pubkey, or pick an EVM chain.
|
|
36150
36400
|
`
|
|
36151
36401
|
)
|
|
36152
36402
|
);
|
|
@@ -36154,10 +36404,10 @@ async function send(amount, asset, opts) {
|
|
|
36154
36404
|
}
|
|
36155
36405
|
if (!SOLANA_ADDRESS_RE.test(opts.to)) {
|
|
36156
36406
|
process.stderr.write(
|
|
36157
|
-
|
|
36158
|
-
`\u2715 --to must be a base58 Solana pubkey (32\u201344 chars, base58 alphabet) for --chain solana (got ${
|
|
36407
|
+
import_picocolors10.default.red(
|
|
36408
|
+
`\u2715 --to must be a base58 Solana pubkey (32\u201344 chars, base58 alphabet) for --chain solana (got ${import_picocolors10.default.bold(opts.to)}).
|
|
36159
36409
|
`
|
|
36160
|
-
) +
|
|
36410
|
+
) + import_picocolors10.default.dim(
|
|
36161
36411
|
` SNS resolution is deferred to a future server-side change;
|
|
36162
36412
|
for now Solana sends require the literal pubkey.
|
|
36163
36413
|
`
|
|
@@ -36168,8 +36418,8 @@ async function send(amount, asset, opts) {
|
|
|
36168
36418
|
}
|
|
36169
36419
|
if (!opts.userStated || opts.userStated.trim() === "") {
|
|
36170
36420
|
process.stderr.write(
|
|
36171
|
-
|
|
36172
|
-
`) +
|
|
36421
|
+
import_picocolors10.default.red(`\u2715 --user-stated <text> is required.
|
|
36422
|
+
`) + import_picocolors10.default.dim(
|
|
36173
36423
|
` This is the trust-gap defense: pass the verbatim user request so
|
|
36174
36424
|
the approval modal can cross-check what the agent thinks the user
|
|
36175
36425
|
asked for vs. the actual decoded transaction.
|
|
@@ -36187,7 +36437,7 @@ async function send(amount, asset, opts) {
|
|
|
36187
36437
|
const n = Number(opts.maxUsd);
|
|
36188
36438
|
if (!Number.isFinite(n) || n <= 0) {
|
|
36189
36439
|
process.stderr.write(
|
|
36190
|
-
|
|
36440
|
+
import_picocolors10.default.red(`\u2715 --max-usd must be a positive number (got ${opts.maxUsd}).
|
|
36191
36441
|
`)
|
|
36192
36442
|
);
|
|
36193
36443
|
process.exit(2);
|
|
@@ -36229,7 +36479,7 @@ async function send(amount, asset, opts) {
|
|
|
36229
36479
|
profile: profileName,
|
|
36230
36480
|
jsonMode,
|
|
36231
36481
|
origin: activeProfile.mcpOrigin,
|
|
36232
|
-
ttyHeader:
|
|
36482
|
+
ttyHeader: import_picocolors10.default.dim("Bearer expired \u2014 re-pairing this terminal\u2026")
|
|
36233
36483
|
});
|
|
36234
36484
|
} catch (reloginErr) {
|
|
36235
36485
|
if (jsonMode) {
|
|
@@ -36241,7 +36491,7 @@ async function send(amount, asset, opts) {
|
|
|
36241
36491
|
process.exit(1);
|
|
36242
36492
|
}
|
|
36243
36493
|
process.stderr.write(
|
|
36244
|
-
|
|
36494
|
+
import_picocolors10.default.red(`\u2715 Auto-relogin failed: ${reloginErr.message}
|
|
36245
36495
|
`)
|
|
36246
36496
|
);
|
|
36247
36497
|
process.exit(1);
|
|
@@ -36265,7 +36515,7 @@ async function send(amount, asset, opts) {
|
|
|
36265
36515
|
process.exit(1);
|
|
36266
36516
|
}
|
|
36267
36517
|
process.stderr.write(
|
|
36268
|
-
|
|
36518
|
+
import_picocolors10.default.red(`\u2715 ${retryErr.message} (HTTP ${retryErr.status})
|
|
36269
36519
|
`)
|
|
36270
36520
|
);
|
|
36271
36521
|
process.exit(1);
|
|
@@ -36282,7 +36532,7 @@ async function send(amount, asset, opts) {
|
|
|
36282
36532
|
});
|
|
36283
36533
|
process.exit(1);
|
|
36284
36534
|
}
|
|
36285
|
-
process.stderr.write(
|
|
36535
|
+
process.stderr.write(import_picocolors10.default.red(`\u2715 ${err.message} (HTTP ${err.status})
|
|
36286
36536
|
`));
|
|
36287
36537
|
process.exit(1);
|
|
36288
36538
|
} else {
|
|
@@ -36308,17 +36558,17 @@ async function send(amount, asset, opts) {
|
|
|
36308
36558
|
if (proposed.detail) {
|
|
36309
36559
|
const d = proposed.detail;
|
|
36310
36560
|
process.stderr.write(
|
|
36311
|
-
|
|
36561
|
+
import_picocolors10.default.red(`\u2715 ${d.asset_symbol ?? "Asset"} on ${d.chain_name ?? "chain"}: `) + `have ${d.balance}, need ${d.required} (short ${d.deficit})
|
|
36312
36562
|
`
|
|
36313
36563
|
);
|
|
36314
36564
|
} else {
|
|
36315
|
-
process.stderr.write(
|
|
36565
|
+
process.stderr.write(import_picocolors10.default.red(`\u2715 ${proposed.reason}
|
|
36316
36566
|
`));
|
|
36317
36567
|
}
|
|
36318
36568
|
if (proposed.upgrade_url) {
|
|
36319
36569
|
process.stderr.write(
|
|
36320
36570
|
` Open this to grant access, then re-run the command:
|
|
36321
|
-
${
|
|
36571
|
+
${import_picocolors10.default.cyan(proposed.upgrade_url)}
|
|
36322
36572
|
`
|
|
36323
36573
|
);
|
|
36324
36574
|
}
|
|
@@ -36328,21 +36578,21 @@ async function send(amount, asset, opts) {
|
|
|
36328
36578
|
const a = proposed.recommended_actions[i];
|
|
36329
36579
|
process.stderr.write(` ${i + 1}. ${a.label}
|
|
36330
36580
|
`);
|
|
36331
|
-
if (a.reasoning) process.stderr.write(
|
|
36581
|
+
if (a.reasoning) process.stderr.write(import_picocolors10.default.dim(` ${a.reasoning}
|
|
36332
36582
|
`));
|
|
36333
36583
|
if (a.action_intent && a.action_intent.external_url) {
|
|
36334
36584
|
process.stderr.write(
|
|
36335
|
-
` ${
|
|
36585
|
+
` ${import_picocolors10.default.cyan(a.action_intent.external_url)}
|
|
36336
36586
|
`
|
|
36337
36587
|
);
|
|
36338
36588
|
}
|
|
36339
36589
|
}
|
|
36340
36590
|
}
|
|
36341
36591
|
if (proposed.suggestions && proposed.suggestions.length > 0) {
|
|
36342
|
-
process.stderr.write(
|
|
36592
|
+
process.stderr.write(import_picocolors10.default.dim("\n Other ways to fund:\n"));
|
|
36343
36593
|
for (const s of proposed.suggestions) {
|
|
36344
36594
|
if (s.kind === "ask_user") continue;
|
|
36345
|
-
process.stderr.write(
|
|
36595
|
+
process.stderr.write(import_picocolors10.default.dim(` \u2022 ${s.label}
|
|
36346
36596
|
`));
|
|
36347
36597
|
}
|
|
36348
36598
|
}
|
|
@@ -36369,8 +36619,8 @@ async function send(amount, asset, opts) {
|
|
|
36369
36619
|
} else {
|
|
36370
36620
|
process.stdout.write(
|
|
36371
36621
|
`
|
|
36372
|
-
${
|
|
36373
|
-
${
|
|
36622
|
+
${import_picocolors10.default.bold("Proposed.")} Open this URL to approve with biometric:
|
|
36623
|
+
${import_picocolors10.default.cyan(proposed.approval_url)}
|
|
36374
36624
|
|
|
36375
36625
|
`
|
|
36376
36626
|
);
|
|
@@ -36389,7 +36639,7 @@ ${import_picocolors8.default.bold("Proposed.")} Open this URL to approve with bi
|
|
|
36389
36639
|
if (jsonMode) {
|
|
36390
36640
|
emitNdjson({ status: s.status, intent_id: s.approval_id });
|
|
36391
36641
|
} else {
|
|
36392
|
-
process.stdout.write(` ${describeStatus(s.status)}${
|
|
36642
|
+
process.stdout.write(` ${describeStatus(s.status)}${import_picocolors10.default.dim("\u2026")}\r`);
|
|
36393
36643
|
}
|
|
36394
36644
|
}
|
|
36395
36645
|
});
|
|
@@ -36403,7 +36653,7 @@ ${import_picocolors8.default.bold("Proposed.")} Open this URL to approve with bi
|
|
|
36403
36653
|
profile: profileName,
|
|
36404
36654
|
jsonMode,
|
|
36405
36655
|
origin: activeProfile.mcpOrigin,
|
|
36406
|
-
ttyHeader:
|
|
36656
|
+
ttyHeader: import_picocolors10.default.dim("Bearer expired mid-poll \u2014 re-pairing this terminal\u2026")
|
|
36407
36657
|
});
|
|
36408
36658
|
} catch (reloginErr) {
|
|
36409
36659
|
if (jsonMode) {
|
|
@@ -36416,7 +36666,7 @@ ${import_picocolors8.default.bold("Proposed.")} Open this URL to approve with bi
|
|
|
36416
36666
|
process.exit(1);
|
|
36417
36667
|
}
|
|
36418
36668
|
process.stderr.write(
|
|
36419
|
-
"\n" +
|
|
36669
|
+
"\n" + import_picocolors10.default.red(`\u2715 Auto-relogin failed: ${reloginErr.message}
|
|
36420
36670
|
`)
|
|
36421
36671
|
);
|
|
36422
36672
|
process.exit(1);
|
|
@@ -36434,7 +36684,7 @@ ${import_picocolors8.default.bold("Proposed.")} Open this URL to approve with bi
|
|
|
36434
36684
|
process.exit(1);
|
|
36435
36685
|
}
|
|
36436
36686
|
process.stderr.write(
|
|
36437
|
-
"\n" +
|
|
36687
|
+
"\n" + import_picocolors10.default.red(`\u2715 Status poll failed: ${retryErr.message}
|
|
36438
36688
|
`)
|
|
36439
36689
|
);
|
|
36440
36690
|
process.exit(1);
|
|
@@ -36450,7 +36700,7 @@ ${import_picocolors8.default.bold("Proposed.")} Open this URL to approve with bi
|
|
|
36450
36700
|
process.exit(1);
|
|
36451
36701
|
}
|
|
36452
36702
|
process.stderr.write(
|
|
36453
|
-
"\n" +
|
|
36703
|
+
"\n" + import_picocolors10.default.red(`\u2715 Status poll failed: ${err.message}
|
|
36454
36704
|
`)
|
|
36455
36705
|
);
|
|
36456
36706
|
process.exit(1);
|
|
@@ -36470,19 +36720,19 @@ ${import_picocolors8.default.bold("Proposed.")} Open this URL to approve with bi
|
|
|
36470
36720
|
}
|
|
36471
36721
|
process.stdout.write("\n");
|
|
36472
36722
|
if (final.status === "mined") {
|
|
36473
|
-
process.stdout.write(
|
|
36723
|
+
process.stdout.write(import_picocolors10.default.green("\u2713 Mined.") + "\n");
|
|
36474
36724
|
if (final.tx_hash) {
|
|
36475
36725
|
process.stdout.write(` Tx ${final.tx_hash}
|
|
36476
36726
|
`);
|
|
36477
36727
|
}
|
|
36478
36728
|
if (explorer) {
|
|
36479
|
-
process.stdout.write(` Explorer ${
|
|
36729
|
+
process.stdout.write(` Explorer ${import_picocolors10.default.cyan(explorer)}
|
|
36480
36730
|
`);
|
|
36481
36731
|
}
|
|
36482
36732
|
process.exit(0);
|
|
36483
36733
|
}
|
|
36484
36734
|
const label = final.status === "rejected" ? "Rejected by user" : final.status === "expired" ? "Expired (TTL elapsed before approval)" : final.status === "failed" ? "Broadcast failed" : `Ended in unexpected status: ${final.status}`;
|
|
36485
|
-
process.stderr.write(
|
|
36735
|
+
process.stderr.write(import_picocolors10.default.red(`\u2715 ${label}.
|
|
36486
36736
|
`));
|
|
36487
36737
|
process.exit(1);
|
|
36488
36738
|
}
|
|
@@ -36510,7 +36760,7 @@ function describeStatus(s) {
|
|
|
36510
36760
|
}
|
|
36511
36761
|
|
|
36512
36762
|
// src/commands/status.ts
|
|
36513
|
-
var
|
|
36763
|
+
var import_picocolors11 = __toESM(require_picocolors(), 1);
|
|
36514
36764
|
var WATCH_GIVEUP_MS = 10 * 6e4;
|
|
36515
36765
|
function explorerUrl2(chainId, hash) {
|
|
36516
36766
|
switch (chainId) {
|
|
@@ -36528,17 +36778,17 @@ function explorerUrl2(chainId, hash) {
|
|
|
36528
36778
|
}
|
|
36529
36779
|
async function status(intentId, opts) {
|
|
36530
36780
|
if (!intentId || intentId.trim() === "") {
|
|
36531
|
-
process.stderr.write(
|
|
36781
|
+
process.stderr.write(import_picocolors11.default.red("\u2715 Missing intent id.\n"));
|
|
36532
36782
|
process.exit(2);
|
|
36533
36783
|
}
|
|
36534
36784
|
const requested = opts.profile ?? DEFAULT_PROFILE;
|
|
36535
36785
|
const resolved = await resolveProfile(requested);
|
|
36536
36786
|
if (!resolved) {
|
|
36537
|
-
process.stderr.write(
|
|
36787
|
+
process.stderr.write(import_picocolors11.default.red("Not logged in. Run agentgates login first.\n"));
|
|
36538
36788
|
process.exit(2);
|
|
36539
36789
|
}
|
|
36540
36790
|
if (resolved.autoSelected) {
|
|
36541
|
-
process.stderr.write(
|
|
36791
|
+
process.stderr.write(import_picocolors11.default.dim(`Using profile "${resolved.name}" (pass --profile to choose)
|
|
36542
36792
|
`));
|
|
36543
36793
|
}
|
|
36544
36794
|
const { profile, name: profileName } = resolved;
|
|
@@ -36547,7 +36797,7 @@ async function status(intentId, opts) {
|
|
|
36547
36797
|
profile,
|
|
36548
36798
|
profileName,
|
|
36549
36799
|
jsonMode,
|
|
36550
|
-
ttyHeader:
|
|
36800
|
+
ttyHeader: import_picocolors11.default.dim("Bearer expired \u2014 re-pairing this terminal\u2026"),
|
|
36551
36801
|
fn: (bearer, origin) => fetchStatus({ intentId, bearer, origin })
|
|
36552
36802
|
});
|
|
36553
36803
|
if (outcome.kind === "auth_failed") {
|
|
@@ -36557,7 +36807,7 @@ async function status(intentId, opts) {
|
|
|
36557
36807
|
);
|
|
36558
36808
|
process.exit(1);
|
|
36559
36809
|
}
|
|
36560
|
-
process.stderr.write(
|
|
36810
|
+
process.stderr.write(import_picocolors11.default.red(`\u2715 ${outcome.reason}.
|
|
36561
36811
|
`));
|
|
36562
36812
|
process.exit(1);
|
|
36563
36813
|
}
|
|
@@ -36565,11 +36815,11 @@ async function status(intentId, opts) {
|
|
|
36565
36815
|
const err = outcome.error;
|
|
36566
36816
|
if (err instanceof ApiError) {
|
|
36567
36817
|
if (err.status === 404) {
|
|
36568
|
-
process.stderr.write(
|
|
36818
|
+
process.stderr.write(import_picocolors11.default.red(`\u2715 No intent with id ${intentId}.
|
|
36569
36819
|
`));
|
|
36570
36820
|
process.exit(1);
|
|
36571
36821
|
}
|
|
36572
|
-
process.stderr.write(
|
|
36822
|
+
process.stderr.write(import_picocolors11.default.red(`\u2715 ${err.message} (HTTP ${err.status})
|
|
36573
36823
|
`));
|
|
36574
36824
|
process.exit(1);
|
|
36575
36825
|
}
|
|
@@ -36580,7 +36830,7 @@ async function status(intentId, opts) {
|
|
|
36580
36830
|
if (opts.watch && !isTerminalStatus(snap.status)) {
|
|
36581
36831
|
if (!jsonMode) {
|
|
36582
36832
|
printSnap(snap);
|
|
36583
|
-
process.stdout.write(
|
|
36833
|
+
process.stdout.write(import_picocolors11.default.dim("Watching\u2026\n"));
|
|
36584
36834
|
}
|
|
36585
36835
|
const runWatchPoll = (p) => streamStatusUntilTerminal({
|
|
36586
36836
|
intentId,
|
|
@@ -36591,7 +36841,7 @@ async function status(intentId, opts) {
|
|
|
36591
36841
|
giveUpMs: WATCH_GIVEUP_MS,
|
|
36592
36842
|
onTick: (s) => {
|
|
36593
36843
|
if (!jsonMode) {
|
|
36594
|
-
process.stdout.write(` ${
|
|
36844
|
+
process.stdout.write(` ${import_picocolors11.default.dim("\u2192")} ${s.status}
|
|
36595
36845
|
`);
|
|
36596
36846
|
}
|
|
36597
36847
|
}
|
|
@@ -36606,7 +36856,7 @@ async function status(intentId, opts) {
|
|
|
36606
36856
|
profile: profileName,
|
|
36607
36857
|
jsonMode,
|
|
36608
36858
|
origin: activeProfile.mcpOrigin,
|
|
36609
|
-
ttyHeader:
|
|
36859
|
+
ttyHeader: import_picocolors11.default.dim("Bearer expired mid-watch \u2014 re-pairing\u2026")
|
|
36610
36860
|
});
|
|
36611
36861
|
} catch (reloginErr) {
|
|
36612
36862
|
if (jsonMode) {
|
|
@@ -36620,7 +36870,7 @@ async function status(intentId, opts) {
|
|
|
36620
36870
|
process.exit(1);
|
|
36621
36871
|
}
|
|
36622
36872
|
process.stderr.write(
|
|
36623
|
-
|
|
36873
|
+
import_picocolors11.default.red(`\u2715 Auto-relogin failed: ${reloginErr.message}
|
|
36624
36874
|
`)
|
|
36625
36875
|
);
|
|
36626
36876
|
process.exit(1);
|
|
@@ -36628,12 +36878,12 @@ async function status(intentId, opts) {
|
|
|
36628
36878
|
try {
|
|
36629
36879
|
final = await runWatchPoll(activeProfile);
|
|
36630
36880
|
} catch (retryErr) {
|
|
36631
|
-
process.stderr.write(
|
|
36881
|
+
process.stderr.write(import_picocolors11.default.red(`\u2715 ${retryErr.message}
|
|
36632
36882
|
`));
|
|
36633
36883
|
process.exit(1);
|
|
36634
36884
|
}
|
|
36635
36885
|
} else {
|
|
36636
|
-
process.stderr.write(
|
|
36886
|
+
process.stderr.write(import_picocolors11.default.red(`\u2715 ${err.message}
|
|
36637
36887
|
`));
|
|
36638
36888
|
process.exit(1);
|
|
36639
36889
|
}
|
|
@@ -36654,7 +36904,7 @@ async function status(intentId, opts) {
|
|
|
36654
36904
|
}
|
|
36655
36905
|
function printSnap(s) {
|
|
36656
36906
|
const explorer = s.tx_hash ? explorerUrl2(s.chain_id, s.tx_hash) : null;
|
|
36657
|
-
const colorFn = s.status === "mined" ?
|
|
36907
|
+
const colorFn = s.status === "mined" ? import_picocolors11.default.green : s.status === "rejected" || s.status === "expired" || s.status === "failed" ? import_picocolors11.default.red : import_picocolors11.default.cyan;
|
|
36658
36908
|
process.stdout.write(`Intent ${s.approval_id}
|
|
36659
36909
|
`);
|
|
36660
36910
|
process.stdout.write(`Status ${colorFn(s.status)}
|
|
@@ -36669,12 +36919,12 @@ function printSnap(s) {
|
|
|
36669
36919
|
process.stdout.write(`Tx ${s.tx_hash}
|
|
36670
36920
|
`);
|
|
36671
36921
|
if (explorer) {
|
|
36672
|
-
process.stdout.write(`Explorer ${
|
|
36922
|
+
process.stdout.write(`Explorer ${import_picocolors11.default.cyan(explorer)}
|
|
36673
36923
|
`);
|
|
36674
36924
|
}
|
|
36675
36925
|
}
|
|
36676
36926
|
if (!isTerminalStatus(s.status)) {
|
|
36677
|
-
process.stdout.write(`Approve ${
|
|
36927
|
+
process.stdout.write(`Approve ${import_picocolors11.default.cyan(s.approval_url)}
|
|
36678
36928
|
`);
|
|
36679
36929
|
}
|
|
36680
36930
|
process.stdout.write(`Created ${formatDate2(s.created_at)}
|
|
@@ -36691,7 +36941,7 @@ function formatDate2(iso) {
|
|
|
36691
36941
|
}
|
|
36692
36942
|
|
|
36693
36943
|
// src/commands/balance.ts
|
|
36694
|
-
var
|
|
36944
|
+
var import_picocolors12 = __toESM(require_picocolors(), 1);
|
|
36695
36945
|
var CHAIN_ALIASES = {
|
|
36696
36946
|
"1": 1,
|
|
36697
36947
|
ethereum: 1,
|
|
@@ -36714,11 +36964,11 @@ async function balance(opts) {
|
|
|
36714
36964
|
const requested = opts.profile ?? DEFAULT_PROFILE;
|
|
36715
36965
|
const resolved = await resolveProfile(requested);
|
|
36716
36966
|
if (!resolved) {
|
|
36717
|
-
process.stderr.write(
|
|
36967
|
+
process.stderr.write(import_picocolors12.default.red("Not logged in. Run agentgates login first.\n"));
|
|
36718
36968
|
process.exit(2);
|
|
36719
36969
|
}
|
|
36720
36970
|
if (resolved.autoSelected) {
|
|
36721
|
-
process.stderr.write(
|
|
36971
|
+
process.stderr.write(import_picocolors12.default.dim(`Using profile "${resolved.name}" (pass --profile to choose)
|
|
36722
36972
|
`));
|
|
36723
36973
|
}
|
|
36724
36974
|
const { profile, name: profileName } = resolved;
|
|
@@ -36728,8 +36978,8 @@ async function balance(opts) {
|
|
|
36728
36978
|
const id = CHAIN_ALIASES[key];
|
|
36729
36979
|
if (id === void 0) {
|
|
36730
36980
|
process.stderr.write(
|
|
36731
|
-
|
|
36732
|
-
`\u2715 Unknown chain ${
|
|
36981
|
+
import_picocolors12.default.red(
|
|
36982
|
+
`\u2715 Unknown chain ${import_picocolors12.default.bold(opts.chain)}. Supported: ${import_picocolors12.default.bold("1/ethereum")}, ${import_picocolors12.default.bold("137/polygon")}, ${import_picocolors12.default.bold("8453/base")}, ${import_picocolors12.default.bold("42161/arbitrum")}, ${import_picocolors12.default.bold("900/solana")}.
|
|
36733
36983
|
`
|
|
36734
36984
|
)
|
|
36735
36985
|
);
|
|
@@ -36742,7 +36992,7 @@ async function balance(opts) {
|
|
|
36742
36992
|
profile,
|
|
36743
36993
|
profileName,
|
|
36744
36994
|
jsonMode,
|
|
36745
|
-
ttyHeader:
|
|
36995
|
+
ttyHeader: import_picocolors12.default.dim("Bearer expired \u2014 re-pairing this terminal\u2026"),
|
|
36746
36996
|
fn: (bearer, origin) => apiFetch("/api/balances", { bearer, origin })
|
|
36747
36997
|
});
|
|
36748
36998
|
if (outcome.kind === "auth_failed") {
|
|
@@ -36752,14 +37002,14 @@ async function balance(opts) {
|
|
|
36752
37002
|
);
|
|
36753
37003
|
process.exit(1);
|
|
36754
37004
|
}
|
|
36755
|
-
process.stderr.write(
|
|
37005
|
+
process.stderr.write(import_picocolors12.default.red(`\u2715 ${outcome.reason}.
|
|
36756
37006
|
`));
|
|
36757
37007
|
process.exit(1);
|
|
36758
37008
|
}
|
|
36759
37009
|
if (outcome.kind === "error") {
|
|
36760
37010
|
const err = outcome.error;
|
|
36761
37011
|
if (err instanceof ApiError) {
|
|
36762
|
-
process.stderr.write(
|
|
37012
|
+
process.stderr.write(import_picocolors12.default.red(`\u2715 ${err.message} (HTTP ${err.status})
|
|
36763
37013
|
`));
|
|
36764
37014
|
process.exit(1);
|
|
36765
37015
|
}
|
|
@@ -36789,7 +37039,7 @@ async function balance(opts) {
|
|
|
36789
37039
|
}
|
|
36790
37040
|
if (filtered.length === 0) {
|
|
36791
37041
|
process.stdout.write(
|
|
36792
|
-
|
|
37042
|
+
import_picocolors12.default.dim(
|
|
36793
37043
|
chainFilter !== null ? `No balances on chain ${chainFilter}.
|
|
36794
37044
|
` : `No chain balances returned.
|
|
36795
37045
|
`
|
|
@@ -36801,7 +37051,7 @@ async function balance(opts) {
|
|
|
36801
37051
|
const errorLines = [];
|
|
36802
37052
|
for (const c of filtered) {
|
|
36803
37053
|
if (c.error) {
|
|
36804
|
-
errorLines.push(`${c.chainName} ${
|
|
37054
|
+
errorLines.push(`${c.chainName} ${import_picocolors12.default.red(`(read failed: ${c.error})`)}`);
|
|
36805
37055
|
continue;
|
|
36806
37056
|
}
|
|
36807
37057
|
if (c.native.balance > 0) {
|
|
@@ -36822,7 +37072,7 @@ async function balance(opts) {
|
|
|
36822
37072
|
}
|
|
36823
37073
|
}
|
|
36824
37074
|
if (rows.length === 0 && errorLines.length === 0) {
|
|
36825
|
-
process.stdout.write(
|
|
37075
|
+
process.stdout.write(import_picocolors12.default.dim(`All balances are zero.
|
|
36826
37076
|
`));
|
|
36827
37077
|
process.stdout.write(AI_DIRECTIVE + "\n");
|
|
36828
37078
|
return;
|
|
@@ -36832,7 +37082,7 @@ async function balance(opts) {
|
|
|
36832
37082
|
const colAsset = Math.max(5, ...rows.map((r) => r.asset.length));
|
|
36833
37083
|
const colBalance = Math.max(7, ...rows.map((r) => r.balance.length));
|
|
36834
37084
|
const header = "Chain".padEnd(colChain) + " " + "Asset".padEnd(colAsset) + " " + "Balance".padStart(colBalance);
|
|
36835
|
-
process.stdout.write(
|
|
37085
|
+
process.stdout.write(import_picocolors12.default.dim(header) + "\n");
|
|
36836
37086
|
for (const r of rows) {
|
|
36837
37087
|
process.stdout.write(
|
|
36838
37088
|
r.chain.padEnd(colChain) + " " + r.asset.padEnd(colAsset) + " " + r.balance.padStart(colBalance) + "\n"
|
|
@@ -36845,7 +37095,7 @@ async function balance(opts) {
|
|
|
36845
37095
|
`);
|
|
36846
37096
|
}
|
|
36847
37097
|
if (res.fetched_at) {
|
|
36848
|
-
process.stdout.write("\n" +
|
|
37098
|
+
process.stdout.write("\n" + import_picocolors12.default.dim(`Fetched ${res.fetched_at}
|
|
36849
37099
|
`));
|
|
36850
37100
|
}
|
|
36851
37101
|
process.stdout.write(AI_DIRECTIVE + "\n");
|
|
@@ -36858,18 +37108,18 @@ function formatBalance(value, decimals) {
|
|
|
36858
37108
|
}
|
|
36859
37109
|
|
|
36860
37110
|
// src/commands/history.ts
|
|
36861
|
-
var
|
|
37111
|
+
var import_picocolors13 = __toESM(require_picocolors(), 1);
|
|
36862
37112
|
var DEFAULT_LIMIT = 20;
|
|
36863
37113
|
var SERVER_MAX_LIMIT = 100;
|
|
36864
37114
|
async function history(opts) {
|
|
36865
37115
|
const requested = opts.profile ?? DEFAULT_PROFILE;
|
|
36866
37116
|
const resolved = await resolveProfile(requested);
|
|
36867
37117
|
if (!resolved) {
|
|
36868
|
-
process.stderr.write(
|
|
37118
|
+
process.stderr.write(import_picocolors13.default.red("Not logged in. Run agentgates login first.\n"));
|
|
36869
37119
|
process.exit(2);
|
|
36870
37120
|
}
|
|
36871
37121
|
if (resolved.autoSelected) {
|
|
36872
|
-
process.stderr.write(
|
|
37122
|
+
process.stderr.write(import_picocolors13.default.dim(`Using profile "${resolved.name}" (pass --profile to choose)
|
|
36873
37123
|
`));
|
|
36874
37124
|
}
|
|
36875
37125
|
const { profile, name: profileName } = resolved;
|
|
@@ -36878,14 +37128,14 @@ async function history(opts) {
|
|
|
36878
37128
|
const n = Number(opts.limit);
|
|
36879
37129
|
if (!Number.isFinite(n) || n <= 0 || !Number.isInteger(n)) {
|
|
36880
37130
|
process.stderr.write(
|
|
36881
|
-
|
|
37131
|
+
import_picocolors13.default.red(`\u2715 --limit must be a positive integer (got ${import_picocolors13.default.bold(opts.limit)}).
|
|
36882
37132
|
`)
|
|
36883
37133
|
);
|
|
36884
37134
|
process.exit(2);
|
|
36885
37135
|
}
|
|
36886
37136
|
if (n > SERVER_MAX_LIMIT) {
|
|
36887
37137
|
process.stderr.write(
|
|
36888
|
-
|
|
37138
|
+
import_picocolors13.default.red(
|
|
36889
37139
|
`\u2715 --limit max is ${SERVER_MAX_LIMIT} (the server's wallet://history hard cap). Got ${n}.
|
|
36890
37140
|
`
|
|
36891
37141
|
)
|
|
@@ -36899,7 +37149,7 @@ async function history(opts) {
|
|
|
36899
37149
|
profile,
|
|
36900
37150
|
profileName,
|
|
36901
37151
|
jsonMode,
|
|
36902
|
-
ttyHeader:
|
|
37152
|
+
ttyHeader: import_picocolors13.default.dim("Bearer expired \u2014 re-pairing this terminal\u2026"),
|
|
36903
37153
|
fn: (bearer, origin) => apiFetch(
|
|
36904
37154
|
`/api/history?limit=${encodeURIComponent(String(limit))}`,
|
|
36905
37155
|
{ bearer, origin }
|
|
@@ -36912,14 +37162,14 @@ async function history(opts) {
|
|
|
36912
37162
|
);
|
|
36913
37163
|
process.exit(1);
|
|
36914
37164
|
}
|
|
36915
|
-
process.stderr.write(
|
|
37165
|
+
process.stderr.write(import_picocolors13.default.red(`\u2715 ${outcome.reason}.
|
|
36916
37166
|
`));
|
|
36917
37167
|
process.exit(1);
|
|
36918
37168
|
}
|
|
36919
37169
|
if (outcome.kind === "error") {
|
|
36920
37170
|
const err = outcome.error;
|
|
36921
37171
|
if (err instanceof ApiError) {
|
|
36922
|
-
process.stderr.write(
|
|
37172
|
+
process.stderr.write(import_picocolors13.default.red(`\u2715 ${err.message} (HTTP ${err.status})
|
|
36923
37173
|
`));
|
|
36924
37174
|
process.exit(1);
|
|
36925
37175
|
}
|
|
@@ -36936,7 +37186,7 @@ async function history(opts) {
|
|
|
36936
37186
|
return;
|
|
36937
37187
|
}
|
|
36938
37188
|
if (res.txs.length === 0) {
|
|
36939
|
-
process.stdout.write(
|
|
37189
|
+
process.stdout.write(import_picocolors13.default.dim(`No activity yet.
|
|
36940
37190
|
`));
|
|
36941
37191
|
return;
|
|
36942
37192
|
}
|
|
@@ -36956,7 +37206,7 @@ async function history(opts) {
|
|
|
36956
37206
|
const colAsset = Math.max(5, ...rows.map((r) => r.asset.length));
|
|
36957
37207
|
const colTo = Math.max(2, ...rows.map((r) => r.to.length));
|
|
36958
37208
|
const header = "When".padEnd(colWhen) + " " + "Chain".padEnd(colChain) + " " + "Type".padEnd(colType) + " " + "Amount".padStart(colAmount) + " " + "Asset".padEnd(colAsset) + " " + "To".padEnd(colTo) + " Hash";
|
|
36959
|
-
process.stdout.write(
|
|
37209
|
+
process.stdout.write(import_picocolors13.default.dim(header) + "\n");
|
|
36960
37210
|
for (const r of rows) {
|
|
36961
37211
|
process.stdout.write(
|
|
36962
37212
|
r.when.padEnd(colWhen) + " " + r.chain.padEnd(colChain) + " " + r.type.padEnd(colType) + " " + r.amount.padStart(colAmount) + " " + r.asset.padEnd(colAsset) + " " + r.to.padEnd(colTo) + " " + r.hash + "\n"
|
|
@@ -36964,7 +37214,7 @@ async function history(opts) {
|
|
|
36964
37214
|
}
|
|
36965
37215
|
if (res.fetched_at) {
|
|
36966
37216
|
process.stdout.write(
|
|
36967
|
-
"\n" +
|
|
37217
|
+
"\n" + import_picocolors13.default.dim(
|
|
36968
37218
|
`Showing ${rows.length} of limit ${res.limit ?? limit} \xB7 fetched ${res.fetched_at}
|
|
36969
37219
|
`
|
|
36970
37220
|
)
|
|
@@ -37051,10 +37301,10 @@ function prettyType(activityType, status2) {
|
|
|
37051
37301
|
}
|
|
37052
37302
|
|
|
37053
37303
|
// src/commands/swap.ts
|
|
37054
|
-
var
|
|
37304
|
+
var import_picocolors15 = __toESM(require_picocolors(), 1);
|
|
37055
37305
|
|
|
37056
37306
|
// src/lib/intent-flow.ts
|
|
37057
|
-
var
|
|
37307
|
+
var import_picocolors14 = __toESM(require_picocolors(), 1);
|
|
37058
37308
|
var STREAM_GIVEUP_MS = 10 * 6e4;
|
|
37059
37309
|
var SOLANA_CHAIN_ID2 = 900;
|
|
37060
37310
|
function isBlocked2(r) {
|
|
@@ -37129,7 +37379,7 @@ async function runIntentFlow(opts) {
|
|
|
37129
37379
|
profile: opts.profileName,
|
|
37130
37380
|
jsonMode: opts.jsonMode,
|
|
37131
37381
|
origin: activeProfile.mcpOrigin,
|
|
37132
|
-
ttyHeader:
|
|
37382
|
+
ttyHeader: import_picocolors14.default.dim("Bearer expired \u2014 re-pairing this terminal\u2026")
|
|
37133
37383
|
});
|
|
37134
37384
|
} catch (reloginErr) {
|
|
37135
37385
|
if (opts.jsonMode) {
|
|
@@ -37141,7 +37391,7 @@ async function runIntentFlow(opts) {
|
|
|
37141
37391
|
process.exit(1);
|
|
37142
37392
|
}
|
|
37143
37393
|
process.stderr.write(
|
|
37144
|
-
|
|
37394
|
+
import_picocolors14.default.red(`\u2715 Auto-relogin failed: ${reloginErr.message}
|
|
37145
37395
|
`)
|
|
37146
37396
|
);
|
|
37147
37397
|
process.exit(1);
|
|
@@ -37165,7 +37415,7 @@ async function runIntentFlow(opts) {
|
|
|
37165
37415
|
process.exit(1);
|
|
37166
37416
|
}
|
|
37167
37417
|
process.stderr.write(
|
|
37168
|
-
|
|
37418
|
+
import_picocolors14.default.red(`\u2715 ${retryErr.message} (HTTP ${retryErr.status})
|
|
37169
37419
|
`)
|
|
37170
37420
|
);
|
|
37171
37421
|
process.exit(1);
|
|
@@ -37182,7 +37432,7 @@ async function runIntentFlow(opts) {
|
|
|
37182
37432
|
});
|
|
37183
37433
|
process.exit(1);
|
|
37184
37434
|
}
|
|
37185
|
-
process.stderr.write(
|
|
37435
|
+
process.stderr.write(import_picocolors14.default.red(`\u2715 ${err.message} (HTTP ${err.status})
|
|
37186
37436
|
`));
|
|
37187
37437
|
process.exit(1);
|
|
37188
37438
|
} else {
|
|
@@ -37204,18 +37454,18 @@ async function runIntentFlow(opts) {
|
|
|
37204
37454
|
});
|
|
37205
37455
|
process.exit(1);
|
|
37206
37456
|
}
|
|
37207
|
-
process.stderr.write(
|
|
37457
|
+
process.stderr.write(import_picocolors14.default.red(`\u2715 Blocked (${proposed.code}): ${proposed.reason}
|
|
37208
37458
|
`));
|
|
37209
37459
|
if (proposed.upgrade_url) {
|
|
37210
37460
|
process.stderr.write(
|
|
37211
37461
|
` Open this to grant access, then re-run the command:
|
|
37212
|
-
${
|
|
37462
|
+
${import_picocolors14.default.cyan(proposed.upgrade_url)}
|
|
37213
37463
|
`
|
|
37214
37464
|
);
|
|
37215
37465
|
}
|
|
37216
37466
|
if (proposed.recommended_actions && proposed.recommended_actions.length > 0) {
|
|
37217
37467
|
process.stderr.write(
|
|
37218
|
-
|
|
37468
|
+
import_picocolors14.default.dim(
|
|
37219
37469
|
` Suggested actions:
|
|
37220
37470
|
` + proposed.recommended_actions.map((a) => ` \u2022 ${JSON.stringify(a)}`).join("\n") + "\n"
|
|
37221
37471
|
)
|
|
@@ -37238,8 +37488,8 @@ async function runIntentFlow(opts) {
|
|
|
37238
37488
|
} else {
|
|
37239
37489
|
process.stdout.write(
|
|
37240
37490
|
`
|
|
37241
|
-
${
|
|
37242
|
-
${
|
|
37491
|
+
${import_picocolors14.default.bold("Proposed.")} Open this URL to approve with biometric:
|
|
37492
|
+
${import_picocolors14.default.cyan(proposed.approval_url)}
|
|
37243
37493
|
|
|
37244
37494
|
`
|
|
37245
37495
|
);
|
|
@@ -37261,7 +37511,7 @@ ${import_picocolors12.default.bold("Proposed.")} Open this URL to approve with b
|
|
|
37261
37511
|
if (opts.jsonMode) {
|
|
37262
37512
|
emitNdjson2({ status: s.status, intent_id: s.approval_id });
|
|
37263
37513
|
} else {
|
|
37264
|
-
process.stdout.write(` ${describeStatus2(s.status)}${
|
|
37514
|
+
process.stdout.write(` ${describeStatus2(s.status)}${import_picocolors14.default.dim("\u2026")}\r`);
|
|
37265
37515
|
}
|
|
37266
37516
|
}
|
|
37267
37517
|
});
|
|
@@ -37275,7 +37525,7 @@ ${import_picocolors12.default.bold("Proposed.")} Open this URL to approve with b
|
|
|
37275
37525
|
profile: opts.profileName,
|
|
37276
37526
|
jsonMode: opts.jsonMode,
|
|
37277
37527
|
origin: activeProfile.mcpOrigin,
|
|
37278
|
-
ttyHeader:
|
|
37528
|
+
ttyHeader: import_picocolors14.default.dim(
|
|
37279
37529
|
"Bearer expired mid-poll \u2014 re-pairing this terminal\u2026"
|
|
37280
37530
|
)
|
|
37281
37531
|
});
|
|
@@ -37290,7 +37540,7 @@ ${import_picocolors12.default.bold("Proposed.")} Open this URL to approve with b
|
|
|
37290
37540
|
process.exit(1);
|
|
37291
37541
|
}
|
|
37292
37542
|
process.stderr.write(
|
|
37293
|
-
"\n" +
|
|
37543
|
+
"\n" + import_picocolors14.default.red(`\u2715 Auto-relogin failed: ${reloginErr.message}
|
|
37294
37544
|
`)
|
|
37295
37545
|
);
|
|
37296
37546
|
process.exit(1);
|
|
@@ -37308,7 +37558,7 @@ ${import_picocolors12.default.bold("Proposed.")} Open this URL to approve with b
|
|
|
37308
37558
|
process.exit(1);
|
|
37309
37559
|
}
|
|
37310
37560
|
process.stderr.write(
|
|
37311
|
-
"\n" +
|
|
37561
|
+
"\n" + import_picocolors14.default.red(`\u2715 Status poll failed: ${retryErr.message}
|
|
37312
37562
|
`)
|
|
37313
37563
|
);
|
|
37314
37564
|
process.exit(1);
|
|
@@ -37324,7 +37574,7 @@ ${import_picocolors12.default.bold("Proposed.")} Open this URL to approve with b
|
|
|
37324
37574
|
process.exit(1);
|
|
37325
37575
|
}
|
|
37326
37576
|
process.stderr.write(
|
|
37327
|
-
"\n" +
|
|
37577
|
+
"\n" + import_picocolors14.default.red(`\u2715 Status poll failed: ${err.message}
|
|
37328
37578
|
`)
|
|
37329
37579
|
);
|
|
37330
37580
|
process.exit(1);
|
|
@@ -37365,39 +37615,39 @@ ${import_picocolors12.default.bold("Proposed.")} Open this URL to approve with b
|
|
|
37365
37615
|
process.stdout.write("\n");
|
|
37366
37616
|
const printLegJournal = () => {
|
|
37367
37617
|
if (legs.length === 0) return;
|
|
37368
|
-
process.stdout.write(
|
|
37618
|
+
process.stdout.write(import_picocolors14.default.bold(" Legs:\n"));
|
|
37369
37619
|
for (const l of legs) {
|
|
37370
|
-
const line = l.status === "mined" ?
|
|
37620
|
+
const line = l.status === "mined" ? import_picocolors14.default.green(`\u2713 leg ${l.index + 1} mined`) + (l.tx_hash ? import_picocolors14.default.dim(` ${l.tx_hash}`) : "") : l.status === "failed" ? import_picocolors14.default.red(`\u2715 leg ${l.index + 1} failed`) + (l.failure?.message ? ` \u2014 ${l.failure.message}` : "") : l.status === "pending" || l.status === "rendered" ? import_picocolors14.default.dim(`\u2013 leg ${l.index + 1} not run`) : import_picocolors14.default.dim(`\u2026 leg ${l.index + 1} ${l.status}`);
|
|
37371
37621
|
process.stdout.write(` ${line}
|
|
37372
37622
|
`);
|
|
37373
37623
|
}
|
|
37374
37624
|
};
|
|
37375
37625
|
if (final.status === "mined") {
|
|
37376
|
-
process.stdout.write(
|
|
37626
|
+
process.stdout.write(import_picocolors14.default.green("\u2713 Mined.") + "\n");
|
|
37377
37627
|
if (final.tx_hash) {
|
|
37378
37628
|
process.stdout.write(` Tx ${final.tx_hash}
|
|
37379
37629
|
`);
|
|
37380
37630
|
}
|
|
37381
37631
|
if (explorer) {
|
|
37382
|
-
process.stdout.write(` Explorer ${
|
|
37632
|
+
process.stdout.write(` Explorer ${import_picocolors14.default.cyan(explorer)}
|
|
37383
37633
|
`);
|
|
37384
37634
|
}
|
|
37385
37635
|
printLegJournal();
|
|
37386
37636
|
process.exit(0);
|
|
37387
37637
|
}
|
|
37388
37638
|
if (final.status === "failed" && failure?.message) {
|
|
37389
|
-
process.stderr.write(
|
|
37639
|
+
process.stderr.write(import_picocolors14.default.red(`\u2715 ${failure.message}
|
|
37390
37640
|
`));
|
|
37391
37641
|
if (retryCommand) {
|
|
37392
37642
|
process.stderr.write(` Retry:
|
|
37393
|
-
${
|
|
37643
|
+
${import_picocolors14.default.cyan(retryCommand)}
|
|
37394
37644
|
`);
|
|
37395
37645
|
}
|
|
37396
37646
|
printLegJournal();
|
|
37397
37647
|
process.exit(1);
|
|
37398
37648
|
}
|
|
37399
37649
|
const label = final.status === "rejected" ? "Rejected by user" : final.status === "expired" ? "Expired (TTL elapsed before approval)" : final.status === "failed" ? "The transaction did not land; nothing moved. Re-run the command to retry with fresh parameters" : `Ended in unexpected status: ${final.status}`;
|
|
37400
|
-
process.stderr.write(
|
|
37650
|
+
process.stderr.write(import_picocolors14.default.red(`\u2715 ${label}.
|
|
37401
37651
|
`));
|
|
37402
37652
|
printLegJournal();
|
|
37403
37653
|
process.exit(1);
|
|
@@ -37417,7 +37667,7 @@ function isAsset(v) {
|
|
|
37417
37667
|
return ASSET_VALUES.has(v.toLowerCase());
|
|
37418
37668
|
}
|
|
37419
37669
|
function failArg(msg) {
|
|
37420
|
-
process.stderr.write(
|
|
37670
|
+
process.stderr.write(import_picocolors15.default.red(`\u2715 ${msg}
|
|
37421
37671
|
`));
|
|
37422
37672
|
process.exit(2);
|
|
37423
37673
|
}
|
|
@@ -37425,11 +37675,11 @@ async function swap(amount, fromAsset, opts) {
|
|
|
37425
37675
|
const requested = opts.profile ?? DEFAULT_PROFILE;
|
|
37426
37676
|
const resolved = await resolveProfile(requested);
|
|
37427
37677
|
if (!resolved) {
|
|
37428
|
-
process.stderr.write(
|
|
37678
|
+
process.stderr.write(import_picocolors15.default.red("Not logged in. Run agentgates login first.\n"));
|
|
37429
37679
|
process.exit(2);
|
|
37430
37680
|
}
|
|
37431
37681
|
if (resolved.autoSelected) {
|
|
37432
|
-
process.stderr.write(
|
|
37682
|
+
process.stderr.write(import_picocolors15.default.dim(`Using profile "${resolved.name}" (pass --profile to choose)
|
|
37433
37683
|
`));
|
|
37434
37684
|
}
|
|
37435
37685
|
const { profile, name: profileName } = resolved;
|
|
@@ -37437,12 +37687,12 @@ async function swap(amount, fromAsset, opts) {
|
|
|
37437
37687
|
const jsonMode = opts.json === true || !stdoutIsTty;
|
|
37438
37688
|
const amountNumber = Number(amount);
|
|
37439
37689
|
if (!Number.isFinite(amountNumber) || amountNumber <= 0) {
|
|
37440
|
-
failArg(`amount must be a positive number (got ${
|
|
37690
|
+
failArg(`amount must be a positive number (got ${import_picocolors15.default.bold(amount)}).`);
|
|
37441
37691
|
}
|
|
37442
37692
|
const fromAssetNorm = fromAsset.toLowerCase();
|
|
37443
37693
|
if (!isAsset(fromAssetNorm)) {
|
|
37444
37694
|
failArg(
|
|
37445
|
-
`from-asset must be ${
|
|
37695
|
+
`from-asset must be ${import_picocolors15.default.bold("native")} or ${import_picocolors15.default.bold("usdc")} (got ${import_picocolors15.default.bold(fromAsset)}).`
|
|
37446
37696
|
);
|
|
37447
37697
|
}
|
|
37448
37698
|
if (!opts.toAsset) {
|
|
@@ -37451,7 +37701,7 @@ async function swap(amount, fromAsset, opts) {
|
|
|
37451
37701
|
const toAssetNorm = opts.toAsset.toLowerCase();
|
|
37452
37702
|
if (!isAsset(toAssetNorm)) {
|
|
37453
37703
|
failArg(
|
|
37454
|
-
`--to-asset must be ${
|
|
37704
|
+
`--to-asset must be ${import_picocolors15.default.bold("native")} or ${import_picocolors15.default.bold("usdc")} (got ${import_picocolors15.default.bold(opts.toAsset)}).`
|
|
37455
37705
|
);
|
|
37456
37706
|
}
|
|
37457
37707
|
if (!opts.userStated || opts.userStated.trim() === "") {
|
|
@@ -37580,9 +37830,9 @@ async function swap(amount, fromAsset, opts) {
|
|
|
37580
37830
|
}
|
|
37581
37831
|
|
|
37582
37832
|
// src/commands/batch.ts
|
|
37583
|
-
var
|
|
37833
|
+
var import_picocolors16 = __toESM(require_picocolors(), 1);
|
|
37584
37834
|
function failArg2(msg) {
|
|
37585
|
-
process.stderr.write(
|
|
37835
|
+
process.stderr.write(import_picocolors16.default.red(`\u2715 ${msg}
|
|
37586
37836
|
`));
|
|
37587
37837
|
process.exit(2);
|
|
37588
37838
|
}
|
|
@@ -37590,7 +37840,7 @@ async function batch(opts) {
|
|
|
37590
37840
|
const requested = opts.profile ?? DEFAULT_PROFILE;
|
|
37591
37841
|
const resolved = await resolveProfile(requested);
|
|
37592
37842
|
if (!resolved) {
|
|
37593
|
-
process.stderr.write(
|
|
37843
|
+
process.stderr.write(import_picocolors16.default.red("Not logged in. Run agentgates login first.\n"));
|
|
37594
37844
|
process.exit(2);
|
|
37595
37845
|
}
|
|
37596
37846
|
const { name: profileName, profile } = resolved;
|
|
@@ -37644,14 +37894,14 @@ async function batch(opts) {
|
|
|
37644
37894
|
}
|
|
37645
37895
|
|
|
37646
37896
|
// src/commands/fund-wallet.ts
|
|
37647
|
-
var
|
|
37897
|
+
var import_picocolors17 = __toESM(require_picocolors(), 1);
|
|
37648
37898
|
var EVM_ADDRESS_RE2 = /^0x[0-9a-fA-F]{40}$/;
|
|
37649
37899
|
var SOLANA_ADDRESS_RE2 = /^[1-9A-HJ-NP-Za-km-z]{32,44}$/;
|
|
37650
37900
|
function isAddressTarget(target) {
|
|
37651
37901
|
return EVM_ADDRESS_RE2.test(target) || SOLANA_ADDRESS_RE2.test(target);
|
|
37652
37902
|
}
|
|
37653
37903
|
function failArg3(msg) {
|
|
37654
|
-
process.stderr.write(
|
|
37904
|
+
process.stderr.write(import_picocolors17.default.red(`\u2715 ${msg}
|
|
37655
37905
|
`));
|
|
37656
37906
|
process.exit(2);
|
|
37657
37907
|
}
|
|
@@ -37659,7 +37909,7 @@ async function fundWallet(address, opts) {
|
|
|
37659
37909
|
const requested = opts.profile ?? DEFAULT_PROFILE;
|
|
37660
37910
|
const resolved = await resolveProfile(requested);
|
|
37661
37911
|
if (!resolved) {
|
|
37662
|
-
process.stderr.write(
|
|
37912
|
+
process.stderr.write(import_picocolors17.default.red("Not logged in. Run agentgates login first.\n"));
|
|
37663
37913
|
process.exit(2);
|
|
37664
37914
|
}
|
|
37665
37915
|
const { name: profileName, profile } = resolved;
|
|
@@ -37736,11 +37986,11 @@ async function fundWallet(address, opts) {
|
|
|
37736
37986
|
}
|
|
37737
37987
|
|
|
37738
37988
|
// src/commands/earn-supply.ts
|
|
37739
|
-
var
|
|
37989
|
+
var import_picocolors18 = __toESM(require_picocolors(), 1);
|
|
37740
37990
|
var ASSET_VALUES2 = /* @__PURE__ */ new Set(["native", "usdc"]);
|
|
37741
37991
|
var PROTOCOLS = /* @__PURE__ */ new Set(["aave_v3", "kamino_lend"]);
|
|
37742
37992
|
function failArg4(msg) {
|
|
37743
|
-
process.stderr.write(
|
|
37993
|
+
process.stderr.write(import_picocolors18.default.red(`\u2715 ${msg}
|
|
37744
37994
|
`));
|
|
37745
37995
|
process.exit(2);
|
|
37746
37996
|
}
|
|
@@ -37748,11 +37998,11 @@ async function earnSupply(amount, asset, opts) {
|
|
|
37748
37998
|
const requested = opts.profile ?? DEFAULT_PROFILE;
|
|
37749
37999
|
const resolved = await resolveProfile(requested);
|
|
37750
38000
|
if (!resolved) {
|
|
37751
|
-
process.stderr.write(
|
|
38001
|
+
process.stderr.write(import_picocolors18.default.red("Not logged in. Run agentgates login first.\n"));
|
|
37752
38002
|
process.exit(2);
|
|
37753
38003
|
}
|
|
37754
38004
|
if (resolved.autoSelected) {
|
|
37755
|
-
process.stderr.write(
|
|
38005
|
+
process.stderr.write(import_picocolors18.default.dim(`Using profile "${resolved.name}" (pass --profile to choose)
|
|
37756
38006
|
`));
|
|
37757
38007
|
}
|
|
37758
38008
|
const { profile, name: profileName } = resolved;
|
|
@@ -37760,12 +38010,12 @@ async function earnSupply(amount, asset, opts) {
|
|
|
37760
38010
|
const jsonMode = opts.json === true || !stdoutIsTty;
|
|
37761
38011
|
const amountNumber = Number(amount);
|
|
37762
38012
|
if (!Number.isFinite(amountNumber) || amountNumber <= 0) {
|
|
37763
|
-
failArg4(`amount must be a positive number (got ${
|
|
38013
|
+
failArg4(`amount must be a positive number (got ${import_picocolors18.default.bold(amount)}).`);
|
|
37764
38014
|
}
|
|
37765
38015
|
const assetNorm = asset.toLowerCase();
|
|
37766
38016
|
if (!ASSET_VALUES2.has(assetNorm)) {
|
|
37767
38017
|
failArg4(
|
|
37768
|
-
`asset must be ${
|
|
38018
|
+
`asset must be ${import_picocolors18.default.bold("native")} or ${import_picocolors18.default.bold("usdc")} (got ${import_picocolors18.default.bold(asset)}).`
|
|
37769
38019
|
);
|
|
37770
38020
|
}
|
|
37771
38021
|
if (!opts.chain) {
|
|
@@ -37777,7 +38027,7 @@ async function earnSupply(amount, asset, opts) {
|
|
|
37777
38027
|
const protocolNorm = opts.protocol.toLowerCase();
|
|
37778
38028
|
if (!PROTOCOLS.has(protocolNorm)) {
|
|
37779
38029
|
failArg4(
|
|
37780
|
-
`--protocol must be ${
|
|
38030
|
+
`--protocol must be ${import_picocolors18.default.bold("aave_v3")} or ${import_picocolors18.default.bold("kamino_lend")} (got ${import_picocolors18.default.bold(opts.protocol)}).`
|
|
37781
38031
|
);
|
|
37782
38032
|
}
|
|
37783
38033
|
if (!opts.userStated || opts.userStated.trim() === "") {
|
|
@@ -37829,11 +38079,11 @@ async function earnSupply(amount, asset, opts) {
|
|
|
37829
38079
|
}
|
|
37830
38080
|
|
|
37831
38081
|
// src/commands/earn-withdraw.ts
|
|
37832
|
-
var
|
|
38082
|
+
var import_picocolors19 = __toESM(require_picocolors(), 1);
|
|
37833
38083
|
var ASSET_VALUES3 = /* @__PURE__ */ new Set(["native", "usdc"]);
|
|
37834
38084
|
var PROTOCOLS2 = /* @__PURE__ */ new Set(["aave_v3", "kamino_lend"]);
|
|
37835
38085
|
function failArg5(msg) {
|
|
37836
|
-
process.stderr.write(
|
|
38086
|
+
process.stderr.write(import_picocolors19.default.red(`\u2715 ${msg}
|
|
37837
38087
|
`));
|
|
37838
38088
|
process.exit(2);
|
|
37839
38089
|
}
|
|
@@ -37841,11 +38091,11 @@ async function earnWithdraw(amountOrMax, asset, opts) {
|
|
|
37841
38091
|
const requested = opts.profile ?? DEFAULT_PROFILE;
|
|
37842
38092
|
const resolved = await resolveProfile(requested);
|
|
37843
38093
|
if (!resolved) {
|
|
37844
|
-
process.stderr.write(
|
|
38094
|
+
process.stderr.write(import_picocolors19.default.red("Not logged in. Run agentgates login first.\n"));
|
|
37845
38095
|
process.exit(2);
|
|
37846
38096
|
}
|
|
37847
38097
|
if (resolved.autoSelected) {
|
|
37848
|
-
process.stderr.write(
|
|
38098
|
+
process.stderr.write(import_picocolors19.default.dim(`Using profile "${resolved.name}" (pass --profile to choose)
|
|
37849
38099
|
`));
|
|
37850
38100
|
}
|
|
37851
38101
|
const { profile, name: profileName } = resolved;
|
|
@@ -37856,14 +38106,14 @@ async function earnWithdraw(amountOrMax, asset, opts) {
|
|
|
37856
38106
|
const amountNumber = Number(amountOrMax);
|
|
37857
38107
|
if (!Number.isFinite(amountNumber) || amountNumber <= 0) {
|
|
37858
38108
|
failArg5(
|
|
37859
|
-
`<amount-or-max> must be a positive number or the literal string "max" (got ${
|
|
38109
|
+
`<amount-or-max> must be a positive number or the literal string "max" (got ${import_picocolors19.default.bold(amountOrMax)}).`
|
|
37860
38110
|
);
|
|
37861
38111
|
}
|
|
37862
38112
|
}
|
|
37863
38113
|
const assetNorm = asset.toLowerCase();
|
|
37864
38114
|
if (!ASSET_VALUES3.has(assetNorm)) {
|
|
37865
38115
|
failArg5(
|
|
37866
|
-
`asset must be ${
|
|
38116
|
+
`asset must be ${import_picocolors19.default.bold("native")} or ${import_picocolors19.default.bold("usdc")} (got ${import_picocolors19.default.bold(asset)}).`
|
|
37867
38117
|
);
|
|
37868
38118
|
}
|
|
37869
38119
|
if (!opts.chain) {
|
|
@@ -37875,7 +38125,7 @@ async function earnWithdraw(amountOrMax, asset, opts) {
|
|
|
37875
38125
|
const protocolNorm = opts.protocol.toLowerCase();
|
|
37876
38126
|
if (!PROTOCOLS2.has(protocolNorm)) {
|
|
37877
38127
|
failArg5(
|
|
37878
|
-
`--protocol must be ${
|
|
38128
|
+
`--protocol must be ${import_picocolors19.default.bold("aave_v3")} or ${import_picocolors19.default.bold("kamino_lend")} (got ${import_picocolors19.default.bold(opts.protocol)}).`
|
|
37879
38129
|
);
|
|
37880
38130
|
}
|
|
37881
38131
|
if (!opts.userStated || opts.userStated.trim() === "") {
|
|
@@ -37927,7 +38177,7 @@ async function earnWithdraw(amountOrMax, asset, opts) {
|
|
|
37927
38177
|
}
|
|
37928
38178
|
|
|
37929
38179
|
// src/commands/eat.ts
|
|
37930
|
-
var
|
|
38180
|
+
var import_picocolors20 = __toESM(require_picocolors(), 1);
|
|
37931
38181
|
function parseLineJson(values) {
|
|
37932
38182
|
const lines = [];
|
|
37933
38183
|
for (const value of values) {
|
|
@@ -37954,11 +38204,11 @@ function parseLineJson(values) {
|
|
|
37954
38204
|
async function loadResolvedProfile(requested) {
|
|
37955
38205
|
const resolved = await resolveProfile(requested);
|
|
37956
38206
|
if (!resolved) {
|
|
37957
|
-
process.stderr.write(
|
|
38207
|
+
process.stderr.write(import_picocolors20.default.red("Not logged in. Run agentgates login first.\n"));
|
|
37958
38208
|
process.exit(2);
|
|
37959
38209
|
}
|
|
37960
38210
|
if (resolved.autoSelected) {
|
|
37961
|
-
process.stderr.write(
|
|
38211
|
+
process.stderr.write(import_picocolors20.default.dim(`Using profile "${resolved.name}" (pass --profile to choose)
|
|
37962
38212
|
`));
|
|
37963
38213
|
}
|
|
37964
38214
|
return resolved;
|
|
@@ -37969,12 +38219,12 @@ function printResult(res, jsonMode) {
|
|
|
37969
38219
|
return;
|
|
37970
38220
|
}
|
|
37971
38221
|
if (res.blocked) {
|
|
37972
|
-
process.stderr.write(
|
|
38222
|
+
process.stderr.write(import_picocolors20.default.red(`\u2715 ${res.reason ?? res.code ?? "Blocked"}
|
|
37973
38223
|
`));
|
|
37974
38224
|
if (res.upgrade_url) {
|
|
37975
38225
|
process.stderr.write(
|
|
37976
38226
|
` Open this to grant access, then re-run the command:
|
|
37977
|
-
${
|
|
38227
|
+
${import_picocolors20.default.cyan(res.upgrade_url)}
|
|
37978
38228
|
`
|
|
37979
38229
|
);
|
|
37980
38230
|
}
|
|
@@ -38005,7 +38255,7 @@ async function postRestaurant(path5, body, resolved, jsonMode) {
|
|
|
38005
38255
|
profile: resolved.profile,
|
|
38006
38256
|
profileName: resolved.name,
|
|
38007
38257
|
jsonMode,
|
|
38008
|
-
ttyHeader:
|
|
38258
|
+
ttyHeader: import_picocolors20.default.dim("Bearer expired \u2014 re-pairing this terminal\u2026"),
|
|
38009
38259
|
fn: (bearer, origin) => apiFetch(path5, { method: "POST", bearer, origin, body })
|
|
38010
38260
|
});
|
|
38011
38261
|
if (outcome.kind === "auth_failed") {
|
|
@@ -38015,7 +38265,7 @@ async function postRestaurant(path5, body, resolved, jsonMode) {
|
|
|
38015
38265
|
);
|
|
38016
38266
|
process.exit(1);
|
|
38017
38267
|
}
|
|
38018
|
-
process.stderr.write(
|
|
38268
|
+
process.stderr.write(import_picocolors20.default.red(`\u2715 ${outcome.reason}.
|
|
38019
38269
|
`));
|
|
38020
38270
|
process.exit(1);
|
|
38021
38271
|
}
|
|
@@ -38028,7 +38278,7 @@ async function postRestaurant(path5, body, resolved, jsonMode) {
|
|
|
38028
38278
|
);
|
|
38029
38279
|
process.exit(1);
|
|
38030
38280
|
}
|
|
38031
|
-
process.stderr.write(
|
|
38281
|
+
process.stderr.write(import_picocolors20.default.red(`\u2715 ${err.message} (HTTP ${err.status})
|
|
38032
38282
|
`));
|
|
38033
38283
|
process.exit(1);
|
|
38034
38284
|
}
|
|
@@ -38041,7 +38291,7 @@ async function searchFood(opts) {
|
|
|
38041
38291
|
const jsonMode = opts.json === true || process.stdout.isTTY !== true;
|
|
38042
38292
|
if (!opts.location && !opts.name) {
|
|
38043
38293
|
process.stderr.write(
|
|
38044
|
-
|
|
38294
|
+
import_picocolors20.default.red("\u2715 Pass --location (search near a place) or --name (look one store up).\n")
|
|
38045
38295
|
);
|
|
38046
38296
|
process.exit(2);
|
|
38047
38297
|
}
|
|
@@ -38062,7 +38312,7 @@ async function menuFood(items, opts) {
|
|
|
38062
38312
|
const jsonMode = opts.json === true || process.stdout.isTTY !== true;
|
|
38063
38313
|
if (!opts.brand || !opts.address) {
|
|
38064
38314
|
process.stderr.write(
|
|
38065
|
-
|
|
38315
|
+
import_picocolors20.default.red(
|
|
38066
38316
|
"\u2715 --brand and --address are required \u2014 use the pair a `agentgates eat search` result gave you, verbatim.\n"
|
|
38067
38317
|
)
|
|
38068
38318
|
);
|
|
@@ -38082,7 +38332,7 @@ async function orderFood(items, opts) {
|
|
|
38082
38332
|
const jsonMode = opts.json === true || process.stdout.isTTY !== true;
|
|
38083
38333
|
if (!opts.brand || !opts.address) {
|
|
38084
38334
|
process.stderr.write(
|
|
38085
|
-
|
|
38335
|
+
import_picocolors20.default.red(
|
|
38086
38336
|
"\u2715 --brand and --address are required \u2014 use the pair a `agentgates eat search` result gave you, verbatim.\n"
|
|
38087
38337
|
)
|
|
38088
38338
|
);
|
|
@@ -38092,14 +38342,14 @@ async function orderFood(items, opts) {
|
|
|
38092
38342
|
try {
|
|
38093
38343
|
structuredLines = parseLineJson(opts.lineJson ?? []);
|
|
38094
38344
|
} catch (e) {
|
|
38095
|
-
process.stderr.write(
|
|
38345
|
+
process.stderr.write(import_picocolors20.default.red(`\u2715 ${e instanceof Error ? e.message : String(e)}
|
|
38096
38346
|
`));
|
|
38097
38347
|
process.exit(2);
|
|
38098
38348
|
}
|
|
38099
38349
|
const lines = [...items ?? [], ...structuredLines];
|
|
38100
38350
|
if (lines.length === 0) {
|
|
38101
38351
|
process.stderr.write(
|
|
38102
|
-
|
|
38352
|
+
import_picocolors20.default.red("\u2715 Pass at least one dish \u2014 plain words as arguments, or --line-json for a line with a size/option/note.\n")
|
|
38103
38353
|
);
|
|
38104
38354
|
process.exit(2);
|
|
38105
38355
|
}
|
|
@@ -38133,7 +38383,7 @@ async function orderFood(items, opts) {
|
|
|
38133
38383
|
if (!agentCard.will_attempt) {
|
|
38134
38384
|
if (!jsonMode) {
|
|
38135
38385
|
process.stderr.write(
|
|
38136
|
-
|
|
38386
|
+
import_picocolors20.default.yellow(
|
|
38137
38387
|
`This order is over your saved card's per-order cap (${fmtCents(agentCard.max_per_order_cents)}), so it needs you.
|
|
38138
38388
|
`
|
|
38139
38389
|
)
|
|
@@ -38150,7 +38400,7 @@ async function orderFood(items, opts) {
|
|
|
38150
38400
|
}
|
|
38151
38401
|
if (verdict.status === "paid") {
|
|
38152
38402
|
process.stdout.write(
|
|
38153
|
-
|
|
38403
|
+
import_picocolors20.default.green(
|
|
38154
38404
|
`Paid with your saved card ending ${agentCard.last4}.` + (verdict.failure_detail ? ` ${verdict.failure_detail}` : "") + " Nothing to do.\n"
|
|
38155
38405
|
)
|
|
38156
38406
|
);
|
|
@@ -38158,7 +38408,7 @@ async function orderFood(items, opts) {
|
|
|
38158
38408
|
}
|
|
38159
38409
|
if (verdict.status === "failed") {
|
|
38160
38410
|
process.stderr.write(
|
|
38161
|
-
|
|
38411
|
+
import_picocolors20.default.yellow(
|
|
38162
38412
|
`Your saved card did not pay this (${verdict.failure_reason ?? "refused"}${verdict.failure_detail ? `: ${verdict.failure_detail}` : ""}). Nothing was charged. The link still works for you to pay yourself.
|
|
38163
38413
|
`
|
|
38164
38414
|
)
|
|
@@ -38168,7 +38418,7 @@ async function orderFood(items, opts) {
|
|
|
38168
38418
|
}
|
|
38169
38419
|
if (verdict.status === "unconfirmed") {
|
|
38170
38420
|
process.stderr.write(
|
|
38171
|
-
|
|
38421
|
+
import_picocolors20.default.red(
|
|
38172
38422
|
"A payment attempt happened and its outcome is UNKNOWN \u2014 nothing will retry it. Open the order and check before paying anything:\n" + (approvalUrl ? ` ${approvalUrl}
|
|
38173
38423
|
` : "")
|
|
38174
38424
|
)
|
|
@@ -38177,7 +38427,7 @@ async function orderFood(items, opts) {
|
|
|
38177
38427
|
return;
|
|
38178
38428
|
}
|
|
38179
38429
|
process.stderr.write(
|
|
38180
|
-
|
|
38430
|
+
import_picocolors20.default.dim(
|
|
38181
38431
|
`Still being attempted. Check with: agentgates eat status ${orderId}` + (approvalUrl ? ` \u2014 or pay yourself: ${approvalUrl}` : "") + "\n"
|
|
38182
38432
|
)
|
|
38183
38433
|
);
|
|
@@ -38202,7 +38452,7 @@ var POLL_BUDGET_MS = 1e5;
|
|
|
38202
38452
|
var POLL_INTERVAL_MS2 = 3500;
|
|
38203
38453
|
async function pollOrderVerdict(orderId, resolved, jsonMode) {
|
|
38204
38454
|
if (!jsonMode) {
|
|
38205
|
-
process.stderr.write(
|
|
38455
|
+
process.stderr.write(import_picocolors20.default.dim("Your saved card is paying this \u2014 watching for the result\u2026\n"));
|
|
38206
38456
|
}
|
|
38207
38457
|
const deadline = Date.now() + POLL_BUDGET_MS;
|
|
38208
38458
|
let last = {
|
|
@@ -38272,16 +38522,16 @@ async function statusFood(orderId, opts) {
|
|
|
38272
38522
|
}
|
|
38273
38523
|
|
|
38274
38524
|
// src/commands/bounties.ts
|
|
38275
|
-
var
|
|
38525
|
+
var import_picocolors21 = __toESM(require_picocolors(), 1);
|
|
38276
38526
|
async function withProfile(opts, path5, init) {
|
|
38277
38527
|
const requested = opts.profile ?? DEFAULT_PROFILE;
|
|
38278
38528
|
const resolved = await resolveProfile(requested);
|
|
38279
38529
|
if (!resolved) {
|
|
38280
|
-
process.stderr.write(
|
|
38530
|
+
process.stderr.write(import_picocolors21.default.red("Not logged in. Run agentgates login first.\n"));
|
|
38281
38531
|
process.exit(2);
|
|
38282
38532
|
}
|
|
38283
38533
|
if (resolved.autoSelected) {
|
|
38284
|
-
process.stderr.write(
|
|
38534
|
+
process.stderr.write(import_picocolors21.default.dim(`Using profile "${resolved.name}" (pass --profile to choose)
|
|
38285
38535
|
`));
|
|
38286
38536
|
}
|
|
38287
38537
|
const { profile, name: profileName } = resolved;
|
|
@@ -38290,7 +38540,7 @@ async function withProfile(opts, path5, init) {
|
|
|
38290
38540
|
profile,
|
|
38291
38541
|
profileName,
|
|
38292
38542
|
jsonMode,
|
|
38293
|
-
ttyHeader:
|
|
38543
|
+
ttyHeader: import_picocolors21.default.dim("Bearer expired \u2014 re-pairing this terminal\u2026"),
|
|
38294
38544
|
fn: (bearer, origin) => apiFetch(path5, init ? { bearer, origin, method: init.method, body: init.body } : { bearer, origin })
|
|
38295
38545
|
});
|
|
38296
38546
|
if (outcome.kind === "auth_failed") {
|
|
@@ -38298,14 +38548,14 @@ async function withProfile(opts, path5, init) {
|
|
|
38298
38548
|
process.stdout.write(JSON.stringify({ ok: false, status: "auth_failed", error: outcome.reason }) + "\n");
|
|
38299
38549
|
process.exit(1);
|
|
38300
38550
|
}
|
|
38301
|
-
process.stderr.write(
|
|
38551
|
+
process.stderr.write(import_picocolors21.default.red(`\u2715 ${outcome.reason}.
|
|
38302
38552
|
`));
|
|
38303
38553
|
process.exit(1);
|
|
38304
38554
|
}
|
|
38305
38555
|
if (outcome.kind === "error") {
|
|
38306
38556
|
const err = outcome.error;
|
|
38307
38557
|
if (err instanceof ApiError) {
|
|
38308
|
-
process.stderr.write(
|
|
38558
|
+
process.stderr.write(import_picocolors21.default.red(`\u2715 ${err.message} (HTTP ${err.status})
|
|
38309
38559
|
`));
|
|
38310
38560
|
process.exit(1);
|
|
38311
38561
|
}
|
|
@@ -38319,12 +38569,12 @@ function handleBlocked(res, jsonMode) {
|
|
|
38319
38569
|
process.stdout.write(JSON.stringify(res, null, 2) + "\n");
|
|
38320
38570
|
process.exit(1);
|
|
38321
38571
|
}
|
|
38322
|
-
process.stderr.write(
|
|
38572
|
+
process.stderr.write(import_picocolors21.default.yellow(`
|
|
38323
38573
|
${res.reason ?? "Blocked."}
|
|
38324
38574
|
`));
|
|
38325
38575
|
if (res.upgrade_url) {
|
|
38326
38576
|
process.stderr.write(`
|
|
38327
|
-
${
|
|
38577
|
+
${import_picocolors21.default.bold(res.upgrade_url)}
|
|
38328
38578
|
|
|
38329
38579
|
`);
|
|
38330
38580
|
}
|
|
@@ -38367,14 +38617,14 @@ function printTable(rows) {
|
|
|
38367
38617
|
const cLeft = w("left", 4);
|
|
38368
38618
|
const cSubs = w("subs", 4);
|
|
38369
38619
|
process.stdout.write(
|
|
38370
|
-
|
|
38620
|
+
import_picocolors21.default.dim(
|
|
38371
38621
|
"Amount".padStart(cAmount) + " " + "Title".padEnd(cTitle) + " " + "Chain".padEnd(cChain) + " " + "Evidence".padEnd(cEv) + " " + "Left".padStart(cLeft) + " " + "Subs".padStart(cSubs) + " ID"
|
|
38372
38622
|
) + "\n"
|
|
38373
38623
|
);
|
|
38374
38624
|
for (const c of cells) {
|
|
38375
|
-
const title = c.live ?
|
|
38625
|
+
const title = c.live ? import_picocolors21.default.green(c.title.padEnd(cTitle)) : c.title.padEnd(cTitle);
|
|
38376
38626
|
process.stdout.write(
|
|
38377
|
-
|
|
38627
|
+
import_picocolors21.default.bold(c.amount.padStart(cAmount)) + " " + title + " " + c.chain.padEnd(cChain) + " " + c.ev.padEnd(cEv) + " " + c.left.padStart(cLeft) + " " + c.subs.padStart(cSubs) + " " + import_picocolors21.default.dim(c.id) + "\n"
|
|
38378
38628
|
);
|
|
38379
38629
|
}
|
|
38380
38630
|
}
|
|
@@ -38386,11 +38636,11 @@ async function listBounties(opts) {
|
|
|
38386
38636
|
const min = opts.min !== void 0 ? Number(opts.min) : void 0;
|
|
38387
38637
|
const max = opts.max !== void 0 ? Number(opts.max) : void 0;
|
|
38388
38638
|
if (min !== void 0 && !Number.isFinite(min)) {
|
|
38389
|
-
process.stderr.write(
|
|
38639
|
+
process.stderr.write(import_picocolors21.default.red("\u2715 --min must be a number.\n"));
|
|
38390
38640
|
process.exit(2);
|
|
38391
38641
|
}
|
|
38392
38642
|
if (max !== void 0 && !Number.isFinite(max)) {
|
|
38393
|
-
process.stderr.write(
|
|
38643
|
+
process.stderr.write(import_picocolors21.default.red("\u2715 --max must be a number.\n"));
|
|
38394
38644
|
process.exit(2);
|
|
38395
38645
|
}
|
|
38396
38646
|
rows = rows.filter((r) => {
|
|
@@ -38415,7 +38665,7 @@ async function listBounties(opts) {
|
|
|
38415
38665
|
});
|
|
38416
38666
|
const limit = opts.limit !== void 0 ? Number(opts.limit) : 20;
|
|
38417
38667
|
if (!Number.isFinite(limit) || limit <= 0) {
|
|
38418
|
-
process.stderr.write(
|
|
38668
|
+
process.stderr.write(import_picocolors21.default.red("\u2715 --limit must be a positive number.\n"));
|
|
38419
38669
|
process.exit(2);
|
|
38420
38670
|
}
|
|
38421
38671
|
const shown = rows.slice(0, limit);
|
|
@@ -38424,13 +38674,13 @@ async function listBounties(opts) {
|
|
|
38424
38674
|
return;
|
|
38425
38675
|
}
|
|
38426
38676
|
if (shown.length === 0) {
|
|
38427
|
-
process.stdout.write(
|
|
38677
|
+
process.stdout.write(import_picocolors21.default.dim("No active bounties match.\n"));
|
|
38428
38678
|
return;
|
|
38429
38679
|
}
|
|
38430
38680
|
printTable(shown);
|
|
38431
38681
|
const clipped = rows.length - shown.length;
|
|
38432
38682
|
process.stdout.write(
|
|
38433
|
-
"\n" +
|
|
38683
|
+
"\n" + import_picocolors21.default.dim(
|
|
38434
38684
|
`${shown.length} of ${rows.length} matching${clipped > 0 ? ` (${clipped} more \u2014 raise --limit)` : ""}. agentgates show <id> for detail.
|
|
38435
38685
|
`
|
|
38436
38686
|
)
|
|
@@ -38441,7 +38691,7 @@ async function showBounty(id, opts) {
|
|
|
38441
38691
|
const jsonMode = opts.json === true;
|
|
38442
38692
|
const clean = id.trim().replace(/^.*\/bounty\//, "").replace(/[?#].*$/, "").trim();
|
|
38443
38693
|
if (!clean) {
|
|
38444
|
-
process.stderr.write(
|
|
38694
|
+
process.stderr.write(import_picocolors21.default.red("\u2715 Give a bounty id, or a agentgates.ai/bounty/<id> link.\n"));
|
|
38445
38695
|
process.exit(2);
|
|
38446
38696
|
}
|
|
38447
38697
|
const res = await withProfile(opts, `/api/bounties/${encodeURIComponent(clean)}`);
|
|
@@ -38452,26 +38702,26 @@ async function showBounty(id, opts) {
|
|
|
38452
38702
|
}
|
|
38453
38703
|
const b = res.bounty;
|
|
38454
38704
|
if (!b) {
|
|
38455
|
-
process.stdout.write(
|
|
38705
|
+
process.stdout.write(import_picocolors21.default.dim("Not found.\n"));
|
|
38456
38706
|
return;
|
|
38457
38707
|
}
|
|
38458
|
-
process.stdout.write("\n" +
|
|
38708
|
+
process.stdout.write("\n" + import_picocolors21.default.bold(b.title) + "\n\n");
|
|
38459
38709
|
process.stdout.write(b.description + "\n\n");
|
|
38460
38710
|
process.stdout.write(
|
|
38461
|
-
|
|
38711
|
+
import_picocolors21.default.bold(fmtAmount(b.amount)) + import_picocolors21.default.dim(" USDC") + import_picocolors21.default.dim(` \xB7 ${chainOf2(b)} \xB7 ${b.status.toLowerCase()}`) + (b.liveNow ? import_picocolors21.default.green(" \xB7 LIVE now") : "") + "\n"
|
|
38462
38712
|
);
|
|
38463
38713
|
if (b.claimsAllowed && b.claimsAllowed > 1) {
|
|
38464
38714
|
const left = Math.max(0, b.claimsAllowed - (b.claimsPaid ?? 0));
|
|
38465
38715
|
process.stdout.write(
|
|
38466
|
-
|
|
38716
|
+
import_picocolors21.default.dim(
|
|
38467
38717
|
`${left} of ${b.claimsAllowed} claims left` + (b.perClaimAmount != null ? `, ${fmtAmount(b.perClaimAmount)} each` : "")
|
|
38468
38718
|
) + "\n"
|
|
38469
38719
|
);
|
|
38470
38720
|
}
|
|
38471
|
-
if (b.evidenceType) process.stdout.write(
|
|
38472
|
-
if (b.expiresAt) process.stdout.write(
|
|
38721
|
+
if (b.evidenceType) process.stdout.write(import_picocolors21.default.dim(`Evidence required: ${b.evidenceType}`) + "\n");
|
|
38722
|
+
if (b.expiresAt) process.stdout.write(import_picocolors21.default.dim(`Expires in ${fmtExpiry(b.expiresAt)}`) + "\n");
|
|
38473
38723
|
if (b.geoLabel && b.geoScope !== "global") {
|
|
38474
|
-
process.stdout.write(
|
|
38724
|
+
process.stdout.write(import_picocolors21.default.dim(`Creator says: ${b.geoLabel}`) + "\n");
|
|
38475
38725
|
}
|
|
38476
38726
|
if (res.url) process.stdout.write("\n" + res.url + "\n");
|
|
38477
38727
|
process.stdout.write(AI_DIRECTIVE + "\n");
|
|
@@ -38489,7 +38739,7 @@ async function myBounties(opts) {
|
|
|
38489
38739
|
}
|
|
38490
38740
|
if (rows.length === 0) {
|
|
38491
38741
|
process.stdout.write(
|
|
38492
|
-
|
|
38742
|
+
import_picocolors21.default.dim(
|
|
38493
38743
|
status2 ? `No bounties of yours are ${status2}.
|
|
38494
38744
|
` : "You have not created any bounties yet. `agentgates draft` starts one.\n"
|
|
38495
38745
|
)
|
|
@@ -38499,7 +38749,7 @@ async function myBounties(opts) {
|
|
|
38499
38749
|
printTable(rows);
|
|
38500
38750
|
const subs = res.submissions ?? [];
|
|
38501
38751
|
if (subs.length > 0) {
|
|
38502
|
-
process.stdout.write("\n" +
|
|
38752
|
+
process.stdout.write("\n" + import_picocolors21.default.dim(`Plus ${subs.length} submission(s) on other people's bounties.
|
|
38503
38753
|
`));
|
|
38504
38754
|
}
|
|
38505
38755
|
process.stdout.write(AI_DIRECTIVE + "\n");
|
|
@@ -38518,19 +38768,19 @@ async function bountyFeed(opts) {
|
|
|
38518
38768
|
}
|
|
38519
38769
|
const subs = res.submissions ?? [];
|
|
38520
38770
|
if (subs.length === 0) {
|
|
38521
|
-
process.stdout.write(
|
|
38771
|
+
process.stdout.write(import_picocolors21.default.dim("Nothing in the feed for that filter.\n"));
|
|
38522
38772
|
return;
|
|
38523
38773
|
}
|
|
38524
38774
|
process.stdout.write(
|
|
38525
|
-
`${subs.length} submission(s) shown of ${res.total ?? subs.length} total.` + (res.hasMore ?
|
|
38775
|
+
`${subs.length} submission(s) shown of ${res.total ?? subs.length} total.` + (res.hasMore ? import_picocolors21.default.dim(" More available.") : "") + "\n"
|
|
38526
38776
|
);
|
|
38527
|
-
process.stdout.write(
|
|
38777
|
+
process.stdout.write(import_picocolors21.default.dim("Use --json for the full rows.\n"));
|
|
38528
38778
|
}
|
|
38529
38779
|
async function draftBounty(opts) {
|
|
38530
38780
|
const jsonMode = opts.json === true;
|
|
38531
38781
|
const amountNum = Number(opts.amount);
|
|
38532
38782
|
if (!Number.isFinite(amountNum) || amountNum <= 0) {
|
|
38533
|
-
process.stderr.write(
|
|
38783
|
+
process.stderr.write(import_picocolors21.default.red("\u2715 --amount must be a positive number of USDC.\n"));
|
|
38534
38784
|
process.exit(2);
|
|
38535
38785
|
}
|
|
38536
38786
|
const res = await withProfile(opts, "/api/bounties", {
|
|
@@ -38548,20 +38798,20 @@ async function draftBounty(opts) {
|
|
|
38548
38798
|
process.stdout.write(JSON.stringify(res, null, 2) + "\n");
|
|
38549
38799
|
return;
|
|
38550
38800
|
}
|
|
38551
|
-
process.stdout.write("\n" +
|
|
38801
|
+
process.stdout.write("\n" + import_picocolors21.default.green("\u2713") + ` Drafted "${opts.title}" for $${opts.amount} USDC.
|
|
38552
38802
|
|
|
38553
38803
|
`);
|
|
38554
|
-
process.stdout.write(
|
|
38804
|
+
process.stdout.write(import_picocolors21.default.dim("It is a draft. Nobody can see or claim it until you fund the escrow.\n"));
|
|
38555
38805
|
if (res.fund_url) {
|
|
38556
|
-
process.stdout.write("\nFund it here:\n" +
|
|
38557
|
-
process.stdout.write(
|
|
38806
|
+
process.stdout.write("\nFund it here:\n" + import_picocolors21.default.bold(res.fund_url) + "\n\n");
|
|
38807
|
+
process.stdout.write(import_picocolors21.default.dim("Funding happens in your browser with your own wallet.\n"));
|
|
38558
38808
|
}
|
|
38559
38809
|
}
|
|
38560
38810
|
|
|
38561
38811
|
// src/commands/bounty-money.ts
|
|
38562
|
-
var
|
|
38812
|
+
var import_picocolors22 = __toESM(require_picocolors(), 1);
|
|
38563
38813
|
function failArg6(message) {
|
|
38564
|
-
process.stderr.write(
|
|
38814
|
+
process.stderr.write(import_picocolors22.default.red(`${message}
|
|
38565
38815
|
`));
|
|
38566
38816
|
process.exit(2);
|
|
38567
38817
|
}
|
|
@@ -38573,12 +38823,12 @@ async function loadProfileOrExit(requested, jsonMode) {
|
|
|
38573
38823
|
JSON.stringify({ ok: false, status: "auth_failed", error: "Not logged in. Run agentgates login first." }) + "\n"
|
|
38574
38824
|
);
|
|
38575
38825
|
} else {
|
|
38576
|
-
process.stderr.write(
|
|
38826
|
+
process.stderr.write(import_picocolors22.default.red("Not logged in. Run agentgates login first.\n"));
|
|
38577
38827
|
}
|
|
38578
38828
|
process.exit(2);
|
|
38579
38829
|
}
|
|
38580
38830
|
if (resolved.autoSelected && !jsonMode) {
|
|
38581
|
-
process.stderr.write(
|
|
38831
|
+
process.stderr.write(import_picocolors22.default.dim(`Using profile "${resolved.name}" (pass --profile to choose)
|
|
38582
38832
|
`));
|
|
38583
38833
|
}
|
|
38584
38834
|
return { profile: resolved.profile, profileName: resolved.name };
|
|
@@ -38683,16 +38933,16 @@ async function subscribeCreator(creatorUserId, opts) {
|
|
|
38683
38933
|
}
|
|
38684
38934
|
|
|
38685
38935
|
// src/commands/bounty-work.ts
|
|
38686
|
-
var
|
|
38936
|
+
var import_picocolors23 = __toESM(require_picocolors(), 1);
|
|
38687
38937
|
async function runWork(path5, body, opts) {
|
|
38688
38938
|
const requested = opts.profile ?? DEFAULT_PROFILE;
|
|
38689
38939
|
const resolved = await resolveProfile(requested);
|
|
38690
38940
|
if (!resolved) {
|
|
38691
|
-
process.stderr.write(
|
|
38941
|
+
process.stderr.write(import_picocolors23.default.red("Not logged in. Run agentgates login first.\n"));
|
|
38692
38942
|
process.exit(2);
|
|
38693
38943
|
}
|
|
38694
38944
|
if (resolved.autoSelected) {
|
|
38695
|
-
process.stderr.write(
|
|
38945
|
+
process.stderr.write(import_picocolors23.default.dim(`Using profile "${resolved.name}" (pass --profile to choose)
|
|
38696
38946
|
`));
|
|
38697
38947
|
}
|
|
38698
38948
|
const jsonMode = opts.json === true;
|
|
@@ -38700,7 +38950,7 @@ async function runWork(path5, body, opts) {
|
|
|
38700
38950
|
profile: resolved.profile,
|
|
38701
38951
|
profileName: resolved.name,
|
|
38702
38952
|
jsonMode,
|
|
38703
|
-
ttyHeader:
|
|
38953
|
+
ttyHeader: import_picocolors23.default.dim("Bearer expired \u2014 re-pairing this terminal\u2026"),
|
|
38704
38954
|
fn: (bearer, origin) => apiFetch(path5, { bearer, origin, method: "POST", body })
|
|
38705
38955
|
});
|
|
38706
38956
|
if (outcome.kind === "auth_failed") {
|
|
@@ -38708,7 +38958,7 @@ async function runWork(path5, body, opts) {
|
|
|
38708
38958
|
process.stdout.write(JSON.stringify({ ok: false, status: "auth_failed", error: outcome.reason }) + "\n");
|
|
38709
38959
|
process.exit(1);
|
|
38710
38960
|
}
|
|
38711
|
-
process.stderr.write(
|
|
38961
|
+
process.stderr.write(import_picocolors23.default.red(`\u2715 ${outcome.reason}.
|
|
38712
38962
|
`));
|
|
38713
38963
|
process.exit(1);
|
|
38714
38964
|
}
|
|
@@ -38718,7 +38968,7 @@ async function runWork(path5, body, opts) {
|
|
|
38718
38968
|
if (jsonMode) {
|
|
38719
38969
|
process.stdout.write(JSON.stringify({ ok: false, error: err.message, http_status: err.status }) + "\n");
|
|
38720
38970
|
} else {
|
|
38721
|
-
process.stderr.write(
|
|
38971
|
+
process.stderr.write(import_picocolors23.default.red(`\u2715 ${err.message} (HTTP ${err.status})
|
|
38722
38972
|
`));
|
|
38723
38973
|
}
|
|
38724
38974
|
process.exit(1);
|
|
@@ -38731,11 +38981,11 @@ async function runWork(path5, body, opts) {
|
|
|
38731
38981
|
process.stdout.write(JSON.stringify({ ok: false, ...data }) + "\n");
|
|
38732
38982
|
process.exit(1);
|
|
38733
38983
|
}
|
|
38734
|
-
process.stderr.write(
|
|
38984
|
+
process.stderr.write(import_picocolors23.default.yellow(`
|
|
38735
38985
|
${data.reason ?? "Blocked."}
|
|
38736
38986
|
`));
|
|
38737
38987
|
if (data.upgrade_url) process.stderr.write(`
|
|
38738
|
-
${
|
|
38988
|
+
${import_picocolors23.default.bold(data.upgrade_url)}
|
|
38739
38989
|
|
|
38740
38990
|
`);
|
|
38741
38991
|
process.exit(1);
|
|
@@ -38744,7 +38994,7 @@ ${import_picocolors21.default.bold(data.upgrade_url)}
|
|
|
38744
38994
|
if (jsonMode) {
|
|
38745
38995
|
process.stdout.write(JSON.stringify({ ok: false, error: data.error }) + "\n");
|
|
38746
38996
|
} else {
|
|
38747
|
-
process.stderr.write(
|
|
38997
|
+
process.stderr.write(import_picocolors23.default.red(`\u2715 ${data.error}
|
|
38748
38998
|
`));
|
|
38749
38999
|
}
|
|
38750
39000
|
process.exit(1);
|
|
@@ -38787,7 +39037,7 @@ async function bountyRetention(bountyId, opts) {
|
|
|
38787
39037
|
}
|
|
38788
39038
|
|
|
38789
39039
|
// src/commands/bounty-deliver.ts
|
|
38790
|
-
var
|
|
39040
|
+
var import_picocolors24 = __toESM(require_picocolors(), 1);
|
|
38791
39041
|
import { spawn } from "node:child_process";
|
|
38792
39042
|
var FLUSH_MS = 400;
|
|
38793
39043
|
var FLUSH_BYTES = 2048;
|
|
@@ -38796,11 +39046,11 @@ async function deliver(bountyId, command, opts) {
|
|
|
38796
39046
|
const requested = opts.profile ?? DEFAULT_PROFILE;
|
|
38797
39047
|
const resolved = await resolveProfile(requested);
|
|
38798
39048
|
if (!resolved) {
|
|
38799
|
-
process.stderr.write(
|
|
39049
|
+
process.stderr.write(import_picocolors24.default.red("Not logged in. Run agentgates login first.\n"));
|
|
38800
39050
|
process.exit(2);
|
|
38801
39051
|
}
|
|
38802
39052
|
if (resolved.autoSelected && !jsonMode) {
|
|
38803
|
-
process.stderr.write(
|
|
39053
|
+
process.stderr.write(import_picocolors24.default.dim(`Using profile "${resolved.name}" (pass --profile to choose)
|
|
38804
39054
|
`));
|
|
38805
39055
|
}
|
|
38806
39056
|
const post = async (path5, body) => {
|
|
@@ -38808,7 +39058,7 @@ async function deliver(bountyId, command, opts) {
|
|
|
38808
39058
|
profile: resolved.profile,
|
|
38809
39059
|
profileName: resolved.name,
|
|
38810
39060
|
jsonMode,
|
|
38811
|
-
ttyHeader:
|
|
39061
|
+
ttyHeader: import_picocolors24.default.dim("Bearer expired \u2014 re-pairing this terminal\u2026"),
|
|
38812
39062
|
fn: (bearer, origin) => apiFetch(path5, { bearer, origin, method: "POST", body })
|
|
38813
39063
|
});
|
|
38814
39064
|
if (outcome.kind === "auth_failed") throw new Error(outcome.reason);
|
|
@@ -38819,11 +39069,11 @@ async function deliver(bountyId, command, opts) {
|
|
|
38819
39069
|
if (jsonMode) {
|
|
38820
39070
|
process.stdout.write(JSON.stringify({ ok: false, error: msg, ...data ?? {} }) + "\n");
|
|
38821
39071
|
} else {
|
|
38822
|
-
process.stderr.write(
|
|
39072
|
+
process.stderr.write(import_picocolors24.default.red(`
|
|
38823
39073
|
\u2715 ${msg}
|
|
38824
39074
|
`));
|
|
38825
39075
|
if (data?.upgrade_url) process.stderr.write(`
|
|
38826
|
-
${
|
|
39076
|
+
${import_picocolors24.default.bold(data.upgrade_url)}
|
|
38827
39077
|
|
|
38828
39078
|
`);
|
|
38829
39079
|
}
|
|
@@ -38848,7 +39098,7 @@ ${import_picocolors22.default.bold(data.upgrade_url)}
|
|
|
38848
39098
|
if (!runId) return void die("The service opened a run but did not name it.");
|
|
38849
39099
|
if (!jsonMode) {
|
|
38850
39100
|
process.stderr.write(
|
|
38851
|
-
|
|
39101
|
+
import_picocolors24.default.bold("\n\u25CF LIVE ") + import_picocolors24.default.dim("everything below is going onto the bounty page as it happens\n") + import_picocolors24.default.dim(` ${started.url ?? ""}
|
|
38852
39102
|
|
|
38853
39103
|
`)
|
|
38854
39104
|
);
|
|
@@ -38900,10 +39150,10 @@ ${import_picocolors22.default.bold(data.upgrade_url)}
|
|
|
38900
39150
|
child.stdout.on("data", (d) => consume(d));
|
|
38901
39151
|
child.stderr.setEncoding("utf8");
|
|
38902
39152
|
child.stderr.on("data", (d) => {
|
|
38903
|
-
if (!jsonMode) process.stderr.write(
|
|
39153
|
+
if (!jsonMode) process.stderr.write(import_picocolors24.default.dim(d));
|
|
38904
39154
|
});
|
|
38905
39155
|
child.on("error", (err) => {
|
|
38906
|
-
process.stderr.write(
|
|
39156
|
+
process.stderr.write(import_picocolors24.default.red(`
|
|
38907
39157
|
\u2715 Could not run ${command[0]}: ${err.message}
|
|
38908
39158
|
`));
|
|
38909
39159
|
resolve(127);
|
|
@@ -38940,14 +39190,14 @@ ${import_picocolors22.default.bold(data.upgrade_url)}
|
|
|
38940
39190
|
}
|
|
38941
39191
|
if (appendFailure) {
|
|
38942
39192
|
process.stderr.write(
|
|
38943
|
-
|
|
39193
|
+
import_picocolors24.default.yellow(`
|
|
38944
39194
|
! Some output did not reach the page: ${appendFailure}
|
|
38945
|
-
`) +
|
|
39195
|
+
`) + import_picocolors24.default.yellow(" What did arrive is sealed below. Check it before you submit.\n")
|
|
38946
39196
|
);
|
|
38947
39197
|
}
|
|
38948
39198
|
if (exitCode) {
|
|
38949
39199
|
process.stderr.write(
|
|
38950
|
-
|
|
39200
|
+
import_picocolors24.default.yellow(`
|
|
38951
39201
|
! ${command[0]} exited ${exitCode}. The run was sealed with what it produced.
|
|
38952
39202
|
`)
|
|
38953
39203
|
);
|
|
@@ -38957,7 +39207,7 @@ ${import_picocolors22.default.bold(data.upgrade_url)}
|
|
|
38957
39207
|
}
|
|
38958
39208
|
|
|
38959
39209
|
// src/commands/trade.ts
|
|
38960
|
-
var
|
|
39210
|
+
var import_picocolors25 = __toESM(require_picocolors(), 1);
|
|
38961
39211
|
|
|
38962
39212
|
// src/lib/trade-sol.ts
|
|
38963
39213
|
var import_web3 = __toESM(require_index_cjs(), 1);
|
|
@@ -39323,7 +39573,7 @@ function fail(message, json) {
|
|
|
39323
39573
|
if (json) {
|
|
39324
39574
|
process.stdout.write(JSON.stringify({ ok: false, error: message }) + "\n");
|
|
39325
39575
|
} else {
|
|
39326
|
-
process.stderr.write(
|
|
39576
|
+
process.stderr.write(import_picocolors25.default.red(`\u2715 ${message}
|
|
39327
39577
|
`));
|
|
39328
39578
|
}
|
|
39329
39579
|
process.exit(1);
|
|
@@ -39514,7 +39764,7 @@ async function tradeBuy(coinArg, amount, opts) {
|
|
|
39514
39764
|
}
|
|
39515
39765
|
const { keypair, state, created } = await loadOrCreateTradeKey();
|
|
39516
39766
|
if (created && !opts.json) {
|
|
39517
|
-
process.stderr.write(
|
|
39767
|
+
process.stderr.write(import_picocolors25.default.dim(`Generated the agent trading key ${state.address} (${tradeKeyPath()}).
|
|
39518
39768
|
`));
|
|
39519
39769
|
}
|
|
39520
39770
|
const result = await runTrade({ ctx: ctx2, keypair, token: coin.mint, side: "buy", amount, minOut: opts.minOut });
|
|
@@ -39568,7 +39818,7 @@ async function tradeOrderPlace(coinArg, opts) {
|
|
|
39568
39818
|
if (opts.mcap && !opts.at) fail("--mcap qualifies --at.", opts.json);
|
|
39569
39819
|
const { keypair, state, created } = await loadOrCreateTradeKey();
|
|
39570
39820
|
if (created && !opts.json) {
|
|
39571
|
-
process.stderr.write(
|
|
39821
|
+
process.stderr.write(import_picocolors25.default.dim(`Generated the agent trading key ${state.address} (${tradeKeyPath()}).
|
|
39572
39822
|
`));
|
|
39573
39823
|
}
|
|
39574
39824
|
let amount;
|
|
@@ -39733,7 +39983,7 @@ async function tradePositions(opts) {
|
|
|
39733
39983
|
}
|
|
39734
39984
|
|
|
39735
39985
|
// src/commands/desk.ts
|
|
39736
|
-
var
|
|
39986
|
+
var import_picocolors26 = __toESM(require_picocolors(), 1);
|
|
39737
39987
|
|
|
39738
39988
|
// src/lib/desk-sol.ts
|
|
39739
39989
|
var import_web32 = __toESM(require_index_cjs(), 1);
|
|
@@ -39907,7 +40157,7 @@ function fail2(message, json) {
|
|
|
39907
40157
|
if (json) {
|
|
39908
40158
|
process.stdout.write(JSON.stringify({ ok: false, error: message }) + "\n");
|
|
39909
40159
|
} else {
|
|
39910
|
-
process.stderr.write(
|
|
40160
|
+
process.stderr.write(import_picocolors26.default.red(`\u2715 ${message}
|
|
39911
40161
|
`));
|
|
39912
40162
|
}
|
|
39913
40163
|
process.exit(1);
|
|
@@ -40050,7 +40300,7 @@ async function deskDeposit(amount, opts) {
|
|
|
40050
40300
|
if (units <= 0n) fail2("Deposit amount must be above zero.", opts.json);
|
|
40051
40301
|
const { keypair, state, created } = await loadOrCreateTradeKey();
|
|
40052
40302
|
if (created && !opts.json) {
|
|
40053
|
-
process.stderr.write(
|
|
40303
|
+
process.stderr.write(import_picocolors26.default.dim(`Generated the agent trading key ${state.address} (${tradeKeyPath()}).
|
|
40054
40304
|
`));
|
|
40055
40305
|
}
|
|
40056
40306
|
const result = await runDeskCeremony({
|
|
@@ -40145,13 +40395,13 @@ async function deskSessionRegister(opts) {
|
|
|
40145
40395
|
}
|
|
40146
40396
|
const owner = await loadOrCreateTradeKey();
|
|
40147
40397
|
if (owner.created && !opts.json) {
|
|
40148
|
-
process.stderr.write(
|
|
40398
|
+
process.stderr.write(import_picocolors26.default.dim(`Generated the agent trading key ${owner.state.address} (${tradeKeyPath()}).
|
|
40149
40399
|
`));
|
|
40150
40400
|
}
|
|
40151
40401
|
const session = await loadOrCreateDeskSessionKey();
|
|
40152
40402
|
if (session.created && !opts.json) {
|
|
40153
40403
|
process.stderr.write(
|
|
40154
|
-
|
|
40404
|
+
import_picocolors26.default.dim(`Generated the desk session key ${session.state.address} (${deskSessionKeyPath()}).
|
|
40155
40405
|
`)
|
|
40156
40406
|
);
|
|
40157
40407
|
}
|
|
@@ -40693,7 +40943,7 @@ program2.command("fund").description(
|
|
|
40693
40943
|
}
|
|
40694
40944
|
if (opts.usdc || opts.gas || opts.chain) {
|
|
40695
40945
|
process.stderr.write(
|
|
40696
|
-
|
|
40946
|
+
import_picocolors27.default.red(
|
|
40697
40947
|
`\u2715 --usdc/--gas/--chain go with an ADDRESS target (0x\u2026 or Solana base58); "${target}" reads as a bounty id.
|
|
40698
40948
|
`
|
|
40699
40949
|
)
|
|
@@ -40812,7 +41062,7 @@ desk.command("buy").description("Buy a launch coin with desk USDC credit (sessio
|
|
|
40812
41062
|
desk.command("sell").description("Sell desk coin credit back to the curve (session signs; sells uncapped by design \u2014 proceeds only ever land in the owner's vault)").argument("<coin>", "coin ticker or base58 mint address").argument("<amount>", 'coin amount, a percentage like "50%" (resolved from the state read), or "all"').option("--min-out <usdc>", "explicit min-out in USDC (overrides the server-owned guard)").option("--json", "machine-readable output").action(async (coin, amount, opts) => {
|
|
40813
41063
|
await deskSell(coin, amount, opts);
|
|
40814
41064
|
});
|
|
40815
|
-
program2.command("onboard").description("Welcome screen: look at what is for sale, or pair your wallet. Run by the installer.").option("--profile <name>", "named profile (default: 'default')").option("--lane <lane>", "which lane leads the menu: compute | inference").action(async (opts) => {
|
|
41065
|
+
program2.command("onboard").description("Welcome screen: look at what is for sale, or pair your wallet. Run by the installer.").option("--profile <name>", "named profile (default: 'default')").option("--lane <lane>", "which lane leads the menu: compute | inference | phone | email").action(async (opts) => {
|
|
40816
41066
|
await onboard(opts);
|
|
40817
41067
|
});
|
|
40818
41068
|
var compute = program2.command("compute").description("Confidential virtual machines by the hour, USDC per payment");
|
|
@@ -40829,11 +41079,28 @@ inference.command("models").description("Live models and per-token prices. Publi
|
|
|
40829
41079
|
inference.command("ask").description("One paid ask (needs an x402 signature this CLI does not have yet)").action(async () => {
|
|
40830
41080
|
await inferenceAsk();
|
|
40831
41081
|
});
|
|
41082
|
+
var phone = program2.command("phone").description("Phone numbers on a plan, texts and calls metered, and a walk-up payphone, USDC over x402");
|
|
41083
|
+
phone.command("pricing").description("Number plans, per-unit usage and the payphone windows. Public read: no key, no account, no payment.").option("--json", "machine-readable output (the phone slice of the identity catalog)").action(async (opts) => {
|
|
41084
|
+
await phonePricing(opts);
|
|
41085
|
+
});
|
|
41086
|
+
phone.command("call").description("Place a payphone call (needs an x402 signature this CLI does not have yet)").action(async () => {
|
|
41087
|
+
await phoneCall();
|
|
41088
|
+
});
|
|
41089
|
+
var email = program2.command("email").description("Inboxes on your wallet: free to hold on a funded balance, receiving free, sends per message, USDC over x402");
|
|
41090
|
+
email.command("pricing").description("The free inbox, the plans, the per-send price and the top-up floor. Public read: no key, no account, no payment.").option("--json", "machine-readable output (the email slice of the identity catalog)").action(async (opts) => {
|
|
41091
|
+
await emailPricing(opts);
|
|
41092
|
+
});
|
|
41093
|
+
email.command("create").description("Create an inbox (needs the wallet's signature this CLI does not have yet)").action(async () => {
|
|
41094
|
+
await emailCreate();
|
|
41095
|
+
});
|
|
41096
|
+
email.command("send").description("Send from an inbox (needs the wallet's signature this CLI does not have yet)").action(async () => {
|
|
41097
|
+
await emailSend();
|
|
41098
|
+
});
|
|
40832
41099
|
program2.parseAsync(process.argv).catch((err) => {
|
|
40833
|
-
process.stderr.write(
|
|
41100
|
+
process.stderr.write(import_picocolors27.default.red(`\u2715 ${err.message}
|
|
40834
41101
|
`));
|
|
40835
41102
|
if (process.env.BOUNTY_DEBUG) {
|
|
40836
|
-
process.stderr.write(
|
|
41103
|
+
process.stderr.write(import_picocolors27.default.dim((err.stack ?? "") + "\n"));
|
|
40837
41104
|
}
|
|
40838
41105
|
process.exit(1);
|
|
40839
41106
|
});
|