chorus-cli 0.5.0 → 0.5.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.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/index.js +20 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -72,7 +72,7 @@ chorus run 4464 --super --qa 'John Doe'
72
72
 
73
73
  ## Docs
74
74
 
75
- Full documentation at [getchorusai.com/docs](https://getchorusai.com/docs)
75
+ Full documentation at [choruscli.com/docs](https://choruscli.com/docs)
76
76
 
77
77
  ## License
78
78
 
package/index.js CHANGED
@@ -545,12 +545,31 @@ async function fetchAccountEmail() {
545
545
  return null;
546
546
  }
547
547
 
548
+ async function fetchCreditBalance(email) {
549
+ if (!email || !CONFIG.ai.chorusApiKey) return null;
550
+ try {
551
+ const baseUrl = CONFIG.ai.chorusApiUrl.replace(/\/v1\/?$/, '');
552
+ const res = await fetch(`${baseUrl}/tokens/balance?email=${encodeURIComponent(email)}&client=true`);
553
+ if (!res.ok) return null;
554
+ const data = await res.json();
555
+ return data.tokenBalance ?? null;
556
+ } catch {
557
+ return null;
558
+ }
559
+ }
560
+
548
561
  async function printTokenLimitMessage() {
549
562
  const email = await fetchAccountEmail();
550
- const base = 'https://getchorusai.com/pricing';
563
+ const base = 'https://choruscli.com/pricing';
551
564
  const url = email ? `${base}?email=${encodeURIComponent(email)}` : base;
552
565
 
553
566
  console.error('\n⚠️ You\'ve run out of Chorus tokens for this month.\n');
567
+
568
+ const balance = await fetchCreditBalance(email);
569
+ if (balance !== null) {
570
+ console.error(` Remaining credit balance: ${balance}\n`);
571
+ }
572
+
554
573
  console.error(' To keep going, purchase more tokens at:');
555
574
  console.error(` ${url}\n`);
556
575
  console.error(' Or wait for your monthly allowance to reset.\n');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chorus-cli",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "Automated ticket resolution with AI, Teams, and Slack integration",
5
5
  "main": "index.js",
6
6
  "bin": {