apiblaze 0.18.6 → 0.18.7

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 (2) hide show
  1. package/dist/index.js +9 -2
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -703,7 +703,7 @@ var import_commander = require("commander");
703
703
  var import_chalk41 = __toESM(require("chalk"));
704
704
 
705
705
  // package.json
706
- var version = "0.18.6";
706
+ var version = "0.18.7";
707
707
 
708
708
  // src/index.ts
709
709
  init_types();
@@ -5613,6 +5613,7 @@ function renderToolEvents(events, dpKey) {
5613
5613
  }
5614
5614
  function billingLine(billing) {
5615
5615
  if (!billing || typeof billing.cents !== "number") return null;
5616
+ if (typeof billing.free_turns_remaining === "number") return null;
5616
5617
  const usd = (billing.cents / 100).toFixed(Math.abs(billing.cents - Math.round(billing.cents)) < 1e-9 ? 2 : 4);
5617
5618
  let line = import_chalk36.default.magenta(` \u{1F4B3} $${usd}`) + import_chalk36.default.dim(billing.model ? ` \xB7 ${billing.model}` : "");
5618
5619
  if (typeof billing.credits_remaining === "number") {
@@ -5621,7 +5622,13 @@ function billingLine(billing) {
5621
5622
  return line;
5622
5623
  }
5623
5624
  function freeBudgetWarning(billing, anon) {
5624
- if (!anon || !billing || typeof billing.free_remaining_cents !== "number") return null;
5625
+ if (!anon || !billing) return null;
5626
+ if (typeof billing.free_turns_remaining === "number") {
5627
+ const left2 = billing.free_turns_remaining;
5628
+ if (left2 <= 0) return import_chalk36.default.yellow(" Free chats used up \u2014 `npx apiblaze login` (free) to keep going.");
5629
+ return import_chalk36.default.dim(` ${left2} free chat${left2 === 1 ? "" : "s"} left`);
5630
+ }
5631
+ if (typeof billing.free_remaining_cents !== "number") return null;
5625
5632
  const perTurn = Math.max(billing.cents || 0, 0.02);
5626
5633
  const left = Math.floor(billing.free_remaining_cents / perTurn);
5627
5634
  if (left > 8) return null;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "apiblaze",
3
- "version": "0.18.6",
4
- "description": "APIblaze CLI Chat with your APIs, Manage your API keys, users and groups with the APIblaze serverless proxy",
3
+ "version": "0.18.7",
4
+ "description": "APIblaze CLI \u2014 Chat with your APIs, Manage your API keys, users and groups with the APIblaze serverless proxy",
5
5
  "keywords": [
6
6
  "apiblaze",
7
7
  "dev-tunnel",
@@ -90,4 +90,4 @@
90
90
  "optional": true
91
91
  }
92
92
  }
93
- }
93
+ }