@agentis-hq/cli 0.1.7 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +47 -15
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -489,6 +489,13 @@ Sent!`);
|
|
|
489
489
|
}
|
|
490
490
|
|
|
491
491
|
// src/lib/format-agent.ts
|
|
492
|
+
var blue = "\x1B[38;5;117m";
|
|
493
|
+
var purple = "\x1B[38;5;141m";
|
|
494
|
+
var green = "\x1B[38;5;114m";
|
|
495
|
+
var amber = "\x1B[38;5;179m";
|
|
496
|
+
var red = "\x1B[38;5;203m";
|
|
497
|
+
var muted = "\x1B[38;5;244m";
|
|
498
|
+
var reset = "\x1B[0m";
|
|
492
499
|
function formatPolicy(agent) {
|
|
493
500
|
const mode = agent.policyMode ?? "backend";
|
|
494
501
|
if (mode !== "onchain") return "policy=backend";
|
|
@@ -501,16 +508,41 @@ function formatPrivacy(agent) {
|
|
|
501
508
|
function formatLocalPolicy(wallet) {
|
|
502
509
|
return wallet.policy.killSwitch ? "policy=local:killed" : "policy=local";
|
|
503
510
|
}
|
|
511
|
+
function shorten(value, prefix = 6, suffix = 5) {
|
|
512
|
+
if (value.length <= prefix + suffix + 3) return value;
|
|
513
|
+
return `${value.slice(0, prefix)}...${value.slice(-suffix)}`;
|
|
514
|
+
}
|
|
515
|
+
function color(value, ansi) {
|
|
516
|
+
return `${ansi}${value}${reset}`;
|
|
517
|
+
}
|
|
518
|
+
function colorPolicy(policy) {
|
|
519
|
+
if (policy === "policy=onchain:ready") return color(policy, purple);
|
|
520
|
+
if (policy === "policy=onchain:pending") return color(policy, amber);
|
|
521
|
+
if (policy === "policy=local:killed") return color(policy, red);
|
|
522
|
+
return color(policy, muted);
|
|
523
|
+
}
|
|
524
|
+
function colorPrivacy(privacy) {
|
|
525
|
+
if (!privacy) return null;
|
|
526
|
+
if (privacy === "privacy=registered") return color(privacy, green);
|
|
527
|
+
if (privacy === "privacy=pending") return color(privacy, amber);
|
|
528
|
+
if (privacy === "privacy=failed") return color(privacy, red);
|
|
529
|
+
return color(privacy, muted);
|
|
530
|
+
}
|
|
504
531
|
function formatBadges(parts) {
|
|
505
|
-
return parts.filter(Boolean).join("
|
|
532
|
+
return parts.filter(Boolean).join(" ");
|
|
533
|
+
}
|
|
534
|
+
function formatName(name) {
|
|
535
|
+
return color(shorten(name, 17, 4).padEnd(24), blue);
|
|
506
536
|
}
|
|
507
537
|
function formatHostedAgentLine(agent) {
|
|
508
|
-
const badges = formatBadges([
|
|
509
|
-
|
|
538
|
+
const badges = formatBadges([
|
|
539
|
+
colorPolicy(formatPolicy(agent)),
|
|
540
|
+
colorPrivacy(formatPrivacy(agent))
|
|
541
|
+
]);
|
|
542
|
+
return ` ${formatName(agent.name)} ${shorten(agent.walletAddress)} ${badges}`;
|
|
510
543
|
}
|
|
511
544
|
function formatLocalWalletLine(wallet) {
|
|
512
|
-
|
|
513
|
-
return ` ${wallet.name.padEnd(20)} ${wallet.solanaAddress} [${wallet.id}] ${badges}`;
|
|
545
|
+
return ` ${formatName(wallet.name)} ${shorten(wallet.solanaAddress)} ${colorPolicy(formatLocalPolicy(wallet))}`;
|
|
514
546
|
}
|
|
515
547
|
|
|
516
548
|
// src/commands/wallet.ts
|
|
@@ -1395,11 +1427,11 @@ async function earnSweep(args2) {
|
|
|
1395
1427
|
var args = process.argv.slice(2);
|
|
1396
1428
|
var cmd = args[0];
|
|
1397
1429
|
var sub = args[1];
|
|
1398
|
-
var
|
|
1399
|
-
var
|
|
1400
|
-
var
|
|
1430
|
+
var blue2 = "\x1B[38;5;117m";
|
|
1431
|
+
var green2 = "\x1B[38;5;114m";
|
|
1432
|
+
var muted2 = "\x1B[38;5;244m";
|
|
1401
1433
|
var bold = "\x1B[1m";
|
|
1402
|
-
var
|
|
1434
|
+
var reset2 = "\x1B[0m";
|
|
1403
1435
|
function readCliVersion() {
|
|
1404
1436
|
try {
|
|
1405
1437
|
const packageJsonPath = join3(dirname2(fileURLToPath(import.meta.url)), "..", "package.json");
|
|
@@ -1671,18 +1703,18 @@ var helpSpecs = {
|
|
|
1671
1703
|
}
|
|
1672
1704
|
};
|
|
1673
1705
|
function showHelp() {
|
|
1674
|
-
console.log(`${
|
|
1706
|
+
console.log(`${blue2}${bold}
|
|
1675
1707
|
\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557
|
|
1676
1708
|
\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D
|
|
1677
1709
|
\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2554\u2588\u2588\u2557 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557
|
|
1678
1710
|
\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u255D \u2588\u2588\u2551\u255A\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2551
|
|
1679
1711
|
\u2588\u2588\u2551 \u2588\u2588\u2551\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551
|
|
1680
1712
|
\u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D
|
|
1681
|
-
${
|
|
1713
|
+
${reset2}${muted2}v${version}${reset2}
|
|
1682
1714
|
|
|
1683
|
-
${bold}Agentis${
|
|
1715
|
+
${bold}Agentis${reset2} \u2014 financial infrastructure for AI agents
|
|
1684
1716
|
|
|
1685
|
-
${
|
|
1717
|
+
${green2}${bold}Commands:${reset2}
|
|
1686
1718
|
login authenticate with your Agentis account
|
|
1687
1719
|
logout remove stored credentials
|
|
1688
1720
|
whoami show current account
|
|
@@ -1751,7 +1783,7 @@ function helpPath(values) {
|
|
|
1751
1783
|
}
|
|
1752
1784
|
function printRows(title, rows) {
|
|
1753
1785
|
console.log(`
|
|
1754
|
-
${
|
|
1786
|
+
${green2}${bold}${title}:${reset2}`);
|
|
1755
1787
|
for (const [left, right] of rows) {
|
|
1756
1788
|
console.log(` ${left.padEnd(38)} ${right}`);
|
|
1757
1789
|
}
|
|
@@ -1766,7 +1798,7 @@ function showCommandHelp(path) {
|
|
|
1766
1798
|
showHelp();
|
|
1767
1799
|
return;
|
|
1768
1800
|
}
|
|
1769
|
-
console.log(`${bold}Usage:${
|
|
1801
|
+
console.log(`${bold}Usage:${reset2} ${spec.usage}
|
|
1770
1802
|
`);
|
|
1771
1803
|
console.log(spec.description);
|
|
1772
1804
|
if (spec.commands) printRows("Commands", spec.commands);
|