acuvo-code 0.3.1 → 0.3.2
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/bin/acuvo.mjs +53 -1
- package/package.json +1 -1
package/bin/acuvo.mjs
CHANGED
|
@@ -1440,7 +1440,59 @@ ${formatBoard(listed)}
|
|
|
1440
1440
|
* exactly the fact a banner exists to state, so it stays, shortened and with
|
|
1441
1441
|
* any elision marked. See `shortenRoot`.
|
|
1442
1442
|
*/
|
|
1443
|
-
|
|
1443
|
+
/**
|
|
1444
|
+
* ── ⭐⭐⭐ WHO IS PAYING FOR THIS, ON THE LINE ABOVE THE FIRST SPEND ────────
|
|
1445
|
+
*
|
|
1446
|
+
* Roman opened a terminal, typed `acuvo`, and got a working prompt without
|
|
1447
|
+
* ever logging in — because a stray `OPENROUTER_API_KEY` in the project's
|
|
1448
|
+
* `.env.local` was picked up automatically. `resolveCredential` has the right
|
|
1449
|
+
* PRECEDENCE (an Acuvo account beats BYOK), but nothing on screen said which
|
|
1450
|
+
* one had won.
|
|
1451
|
+
*
|
|
1452
|
+
* ⚠️ THAT IS A BILLING FAILURE, NOT A COSMETIC ONE. A paying customer with a
|
|
1453
|
+
* leftover provider key in a project directory burns THEIR OWN credits while
|
|
1454
|
+
* believing their plan covers it, and the first evidence is somebody else's
|
|
1455
|
+
* invoice. The banner already states what the tool may RUN before it runs it;
|
|
1456
|
+
* stating what it will CHARGE before it charges is the same obligation.
|
|
1457
|
+
*/
|
|
1458
|
+
let billing = 'no key — run `acuvo --login`';
|
|
1459
|
+
try {
|
|
1460
|
+
const { resolveCredential } = await import('../lib/account.mjs');
|
|
1461
|
+
const cred = resolveCredential();
|
|
1462
|
+
billing =
|
|
1463
|
+
cred.mode === 'account' ? 'your Acuvo plan'
|
|
1464
|
+
: cred.mode === 'byok' ? 'YOUR OWN OpenRouter key (not your Acuvo plan)'
|
|
1465
|
+
: billing;
|
|
1466
|
+
} catch {
|
|
1467
|
+
// Never let a banner stop a run.
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1470
|
+
/**
|
|
1471
|
+
* ⚠️ THE SAFETY LINE SURVIVED THE REDESIGN, DELIBERATELY. Roman read
|
|
1472
|
+
* "may run: node, npm test, …" as the product describing itself and disliked
|
|
1473
|
+
* it — but a tool that can execute programs on your machine has to say so
|
|
1474
|
+
* above the first one it runs, and moving that into a README is how it stops
|
|
1475
|
+
* being read. It is relabelled `can run`, not removed.
|
|
1476
|
+
*/
|
|
1477
|
+
const pkgVersion = (() => {
|
|
1478
|
+
try {
|
|
1479
|
+
return JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')).version;
|
|
1480
|
+
} catch {
|
|
1481
|
+
return '';
|
|
1482
|
+
}
|
|
1483
|
+
})();
|
|
1484
|
+
|
|
1485
|
+
const row = (k, v) => ` ${k.padEnd(11)}${v}`;
|
|
1486
|
+
const banner = [
|
|
1487
|
+
'',
|
|
1488
|
+
` ▌ACUVO CODE${pkgVersion ? ` ${pkgVersion}` : ''}`,
|
|
1489
|
+
'',
|
|
1490
|
+
row('workspace', shortenRoot(executor.root)),
|
|
1491
|
+
row('model', config.model),
|
|
1492
|
+
row('billing', billing),
|
|
1493
|
+
row('can run', mode),
|
|
1494
|
+
'',
|
|
1495
|
+
].join('\n');
|
|
1444
1496
|
if (opts.json) process.stderr.write(banner);
|
|
1445
1497
|
else process.stdout.write(banner);
|
|
1446
1498
|
|