@pollinations/cli 0.1.55 → 0.1.56

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
@@ -14,7 +14,7 @@ var init_package = __esm({
14
14
  "package.json"() {
15
15
  package_default = {
16
16
  name: "@pollinations/cli",
17
- version: "0.1.55",
17
+ version: "0.1.56",
18
18
  description: "The Pollinations CLI \u2014 for humans, AI agents, and everything in between",
19
19
  type: "module",
20
20
  bin: {
@@ -88,7 +88,7 @@ var init_package = __esm({
88
88
  "@types/update-notifier": "^6.0.8",
89
89
  tsup: "^8.4.0",
90
90
  typescript: "^5.7.0",
91
- vitest: "^3.0.0"
91
+ vitest: "^4.1.12"
92
92
  }
93
93
  };
94
94
  }
@@ -2390,49 +2390,6 @@ var fetchHarnessModels = async (selectedModel) => {
2390
2390
  return models2;
2391
2391
  };
2392
2392
 
2393
- // src/harnesses/usage-proof.ts
2394
- init_api();
2395
- init_config();
2396
- var keyUsageCount = async (apiKey) => {
2397
- const result9 = await gen(
2398
- "/account/key/usage?limit=1",
2399
- { apiKey }
2400
- );
2401
- return Number(result9.count ?? result9.usage?.length ?? 0);
2402
- };
2403
- var accountLastRequest = async (apiKey) => {
2404
- const accountKey = resolveApiKey();
2405
- if (!accountKey || accountKey === apiKey) return null;
2406
- try {
2407
- const result9 = await gen("/account/keys", { apiKey: accountKey });
2408
- const row = result9.data?.find(
2409
- (item) => item.enabled !== false && Boolean(item.start) && apiKey.startsWith(item.start)
2410
- );
2411
- return row?.lastRequest ? Date.parse(row.lastRequest) : null;
2412
- } catch {
2413
- return null;
2414
- }
2415
- };
2416
- var waitForKeyUsageIncrease = async (apiKey, before, options = {}) => {
2417
- const attempts = options.attempts ?? 30;
2418
- const delayMs = options.delayMs ?? 1e3;
2419
- const afterMs = options.afterMs ?? Date.now();
2420
- for (let attempt = 0; attempt < attempts; attempt += 1) {
2421
- const count = await keyUsageCount(apiKey);
2422
- if (count > before) return count;
2423
- const lastRequest = await accountLastRequest(apiKey);
2424
- if (lastRequest !== null && Number.isFinite(lastRequest) && lastRequest >= afterMs - 5e3) {
2425
- return before + 1;
2426
- }
2427
- if (attempt + 1 < attempts) {
2428
- await new Promise((resolve4) => setTimeout(resolve4, delayMs));
2429
- }
2430
- }
2431
- throw new Error(
2432
- "The smoke test returned, but no request appeared for the dedicated Pollinations key."
2433
- );
2434
- };
2435
-
2436
2393
  // src/harnesses/claude-code.ts
2437
2394
  var ID2 = "claude-code";
2438
2395
  var LABEL2 = "Claude Code";
@@ -2504,10 +2461,7 @@ var configure = async (ctx, apiKey, model) => {
2504
2461
  writeTextAtomic(path, `${JSON.stringify({ env }, null, 2)}
2505
2462
  `, 384);
2506
2463
  try {
2507
- const before = await keyUsageCount(apiKey);
2508
- const startedAt = Date.now();
2509
2464
  smokeTest(ctx);
2510
- await waitForKeyUsageIncrease(apiKey, before, { afterMs: startedAt });
2511
2465
  } catch (error) {
2512
2466
  if (previous === null) removeIfExists(path);
2513
2467
  else writeTextAtomic(path, previous, 384);
@@ -2788,8 +2742,6 @@ var configureCodex = async (ctx, model, options = {}) => {
2788
2742
  throw failRun(curated, "Codex Router model curation");
2789
2743
  }
2790
2744
  }
2791
- const before = await keyUsageCount(key);
2792
- const startedAt = Date.now();
2793
2745
  const check = smoke(ctx, model);
2794
2746
  if (!check.ok) {
2795
2747
  throw failRun(check, "Codex Router smoke test");
@@ -2802,9 +2754,6 @@ var configureCodex = async (ctx, model, options = {}) => {
2802
2754
  "Codex Router smoke test did not confirm a basic routed response."
2803
2755
  );
2804
2756
  }
2805
- await waitForKeyUsageIncrease(key, before, {
2806
- afterMs: startedAt
2807
- });
2808
2757
  return {
2809
2758
  ...status3(ctx),
2810
2759
  model: `${PROVIDER}/${model}`,