@boole-digital/cli 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +30 -19
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -403,14 +403,14 @@ function orient() {
|
|
|
403
403
|
}
|
|
404
404
|
function operatingBrief() {
|
|
405
405
|
log("");
|
|
406
|
-
log(c.bold("
|
|
407
|
-
log(`
|
|
408
|
-
log(` (run ${c.cyan("boole init")} here first), then just say what you want \u2014 e.g. ${c.dim('"buy $100 of BTC"')}.`);
|
|
409
|
-
log("");
|
|
410
|
-
log(` The authoritative operating guide lives on the box:`);
|
|
406
|
+
log(c.bold("You're connected. Just tell your agent what you want \u2014 in plain English."));
|
|
407
|
+
log(` It drives the box's harness (tracked on your dashboard). Guide on the box:`);
|
|
411
408
|
log(` ${c.cyan('boole ssh "cat /srv/cust/OPERATOR.md"')}`);
|
|
412
|
-
log(
|
|
413
|
-
log(
|
|
409
|
+
log("");
|
|
410
|
+
log(c.bold("Try asking:"));
|
|
411
|
+
log(` \xB7 ${c.dim('"buy $100 of BTC"')} \xB7 ${c.dim('"short $50 of ETH"')}`);
|
|
412
|
+
log(` \xB7 ${c.dim('"run a grid on SOL"')} \xB7 ${c.dim('"watch the BTC price every 10s"')}`);
|
|
413
|
+
log(` \xB7 ${c.dim('"what are my balances?"')} \xB7 ${c.dim('"show my running strategies"')}`);
|
|
414
414
|
log("");
|
|
415
415
|
}
|
|
416
416
|
function printAgents(droplets) {
|
|
@@ -489,24 +489,35 @@ async function summary() {
|
|
|
489
489
|
try {
|
|
490
490
|
const health = await api.getHealth(pick.id);
|
|
491
491
|
ok(`online${health.defaultModel ? c.dim(` \xB7 model ${health.defaultModel}`) : ""}`);
|
|
492
|
-
await printBalances(api, pick.id
|
|
492
|
+
await printBalances(api, pick.id);
|
|
493
493
|
} catch {
|
|
494
494
|
warn("trading computer unreachable (tunnel may be waking up \u2014 retry in a moment)");
|
|
495
495
|
}
|
|
496
496
|
}
|
|
497
497
|
operatingBrief();
|
|
498
498
|
}
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
499
|
+
var BALANCE_VENUES = ["hyperliquid", "portara-testnet", "rise", "polymarket"];
|
|
500
|
+
async function printBalances(api, id, venue) {
|
|
501
|
+
const venues = venue ? [venue] : BALANCE_VENUES;
|
|
502
|
+
const results = await Promise.all(venues.map(async (v) => {
|
|
503
|
+
try {
|
|
504
|
+
return { v, acct: await api.getAccount(id, v), err: "" };
|
|
505
|
+
} catch (e) {
|
|
506
|
+
return { v, acct: null, err: e?.message || String(e) };
|
|
506
507
|
}
|
|
507
|
-
}
|
|
508
|
-
|
|
508
|
+
}));
|
|
509
|
+
let shown = 0;
|
|
510
|
+
for (const { v, acct, err: err2 } of results) {
|
|
511
|
+
if (!acct) {
|
|
512
|
+
if (venue) warn(`${v} balances unavailable: ${err2}`);
|
|
513
|
+
continue;
|
|
514
|
+
}
|
|
515
|
+
const positions = Array.isArray(acct.positions) ? acct.positions : [];
|
|
516
|
+
info(`${v}: equity ${c.bold(fmtUsd(acct.equity))} \xB7 available ${fmtUsd(acct.available)} \xB7 ${positions.length} open position(s)`);
|
|
517
|
+
for (const p of positions.slice(0, 12)) log(` ${c.bold(String(p.market ?? "?"))} ${p.size ?? ""}`);
|
|
518
|
+
shown++;
|
|
509
519
|
}
|
|
520
|
+
if (!shown && !venue) warn("No connected venue returned a balance. Deposit funds, or confirm the box is connected.");
|
|
510
521
|
}
|
|
511
522
|
async function status() {
|
|
512
523
|
await summary();
|
|
@@ -517,7 +528,7 @@ async function balances(opts = {}) {
|
|
|
517
528
|
const pick = pickAgentId(droplets);
|
|
518
529
|
if (!pick) die("No trading computer connected. Run `boole connect` first.");
|
|
519
530
|
log(c.bold(`${pick.name}`));
|
|
520
|
-
await printBalances(api, pick.id, opts.venue
|
|
531
|
+
await printBalances(api, pick.id, opts.venue);
|
|
521
532
|
}
|
|
522
533
|
async function logout() {
|
|
523
534
|
clearCredentials();
|
|
@@ -700,7 +711,7 @@ function init(opts = {}) {
|
|
|
700
711
|
}
|
|
701
712
|
|
|
702
713
|
// src/index.ts
|
|
703
|
-
var VERSION = "0.2.
|
|
714
|
+
var VERSION = "0.2.1";
|
|
704
715
|
function parse(argv) {
|
|
705
716
|
const _ = [];
|
|
706
717
|
const flags = {};
|
package/package.json
CHANGED