free-pi-cli 0.2.12 → 0.2.13

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 CHANGED
@@ -30,4 +30,4 @@ if (err) {
30
30
  console.error(err);
31
31
  process.exit(1);
32
32
  }
33
- await import("./main-mh0wmxjc.js");
33
+ await import("./main-e58f4t8x.js");
@@ -48,7 +48,7 @@ function openBrowser(url, platform = process.platform, spawnImpl = spawn) {
48
48
  // package.json
49
49
  var package_default = {
50
50
  name: "free-pi-cli",
51
- version: "0.2.12",
51
+ version: "0.2.13",
52
52
  description: "Free, ad-supported distribution of the pi coding agent. Inference paid for by ads.",
53
53
  license: "MIT",
54
54
  type: "module",
@@ -14525,6 +14525,7 @@ var MeStatsResponseSchema = exports_external.object({
14525
14525
  spent_usd_today: exports_external.number(),
14526
14526
  remaining_usd_today: exports_external.number(),
14527
14527
  credit_usd: exports_external.number(),
14528
+ credit_credits: exports_external.number(),
14528
14529
  request_count_today: exports_external.number(),
14529
14530
  prompt_tokens_today: exports_external.number(),
14530
14531
  completion_tokens_today: exports_external.number(),
@@ -14591,7 +14592,7 @@ function assertExhaustiveErrorCode(code) {
14591
14592
  }
14592
14593
  // ../shared/src/config.ts
14593
14594
  var ConfigSchema = exports_external.object({
14594
- perUserDailyCapUsd: exports_external.number().default(5),
14595
+ perUserDailyCapUsd: exports_external.number().default(2.5),
14595
14596
  perUserRollingCapUsd: exports_external.number().default(0),
14596
14597
  rollingCapWindowHours: exports_external.number().int().default(5),
14597
14598
  globalDailyCapUsd: exports_external.number().default(50),
@@ -14719,6 +14720,11 @@ function compareVersions(a, b) {
14719
14720
  }
14720
14721
  return 0;
14721
14722
  }
14723
+ // ../shared/src/credits.ts
14724
+ var CREDITS_PER_USD = 40000 / 3;
14725
+ function usdToCredits(usd) {
14726
+ return Math.round(Number(usd) * CREDITS_PER_USD);
14727
+ }
14722
14728
  // ../pi-ads/src/api.ts
14723
14729
  var REQUEST_TIMEOUT_MS = 3000;
14724
14730
  async function authedFetch(deps, path, init) {
@@ -14923,7 +14929,7 @@ var CONFIRM_TURNS = 3;
14923
14929
  var lastCreditUsd;
14924
14930
  var confirm;
14925
14931
  function creditAddedMessage(addedUsd) {
14926
- return `Payment received — $${addedUsd.toFixed(2)} of usage added to your balance.`;
14932
+ return `Payment received — ${usdToCredits(addedUsd).toLocaleString("en-US")} credits added to your balance.`;
14927
14933
  }
14928
14934
  async function renderMeter(deps, ctx) {
14929
14935
  const me = await fetchMe(deps);
@@ -19293,13 +19299,13 @@ function percentUsed(spentUsd, capUsd) {
19293
19299
  return Math.min(100, Math.max(0, Math.round(spentUsd / capUsd * 100)));
19294
19300
  }
19295
19301
  function formatStats(stats) {
19296
- const credit = stats.credit_usd;
19302
+ const credits2 = stats.credit_credits;
19297
19303
  return [
19298
19304
  `tier: ${stats.tier}`,
19299
- `today: ${percentUsed(stats.spent_usd_today, stats.cap_usd_today)}% of your free daily allowance used, ${stats.request_count_today} request(s)`,
19300
- ...typeof credit === "number" ? [`credit: $${credit.toFixed(2)} purchased usage remaining`] : [],
19305
+ `today: ${percentUsed(stats.spent_usd_today, stats.cap_usd_today)}% of your free daily allowance used`,
19306
+ ...typeof credits2 === "number" ? [`credit: ${credits2.toLocaleString("en-US")} credits remaining`] : [],
19301
19307
  `today tokens: ${stats.prompt_tokens_today} prompt / ${stats.completion_tokens_today} completion`,
19302
- `lifetime: ${stats.lifetime.request_count} request(s), ${stats.lifetime.prompt_tokens} prompt / ${stats.lifetime.completion_tokens} completion tokens`
19308
+ `lifetime: ${stats.lifetime.prompt_tokens} prompt / ${stats.lifetime.completion_tokens} completion tokens`
19303
19309
  ].join(`
19304
19310
  `);
19305
19311
  }
@@ -19363,7 +19369,7 @@ function buyPageText(url2) {
19363
19369
  return `Opening the buy page in your browser. If it did not open (for example over SSH), visit:
19364
19370
  ${url2}
19365
19371
 
19366
- Packs: $5 → $4.00 of usage, $10 → $8.00. Card or USDC.`;
19372
+ Packs: $5 → 50,000 credits, $10 → 100,000 credits. Card or USDC.`;
19367
19373
  }
19368
19374
  var BUY_TOOL_NAME = "free_pi_buy_credits";
19369
19375
  var PARAMS2 = exports_typebox.Object({});
@@ -19470,6 +19476,13 @@ function createToolGuardExtension(opts) {
19470
19476
 
19471
19477
  // src/changelog.ts
19472
19478
  var CHANGELOG_HIGHLIGHTS = [
19479
+ {
19480
+ version: "0.2.13",
19481
+ highlights: [
19482
+ "Purchased balance is now shown as credits — $5 buys 50,000 credits, $10 buys 100,000.",
19483
+ "The usage summary is cleaner: your free allowance still shows as a percentage, with token counts, and no request tally."
19484
+ ]
19485
+ },
19473
19486
  {
19474
19487
  version: "0.2.12",
19475
19488
  highlights: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "free-pi-cli",
3
- "version": "0.2.12",
3
+ "version": "0.2.13",
4
4
  "description": "Free, ad-supported distribution of the pi coding agent. Inference paid for by ads.",
5
5
  "license": "MIT",
6
6
  "type": "module",