@aiusage/cli 1.7.7 → 1.7.9

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/cli.js CHANGED
@@ -1310,7 +1310,7 @@ var inflection = {
1310
1310
  };
1311
1311
 
1312
1312
  // ../shared/src/pricing/catalog.ts
1313
- var PRICING_VERSION = "2026-07-18-kimi-k3-v1", aliases = {
1313
+ var PRICING_VERSION = "2026-07-20-gpt-5.6-kimi-k3-v1", aliases = {
1314
1314
  "claude-opus-4-7-20260201": "claude-opus-4-7",
1315
1315
  "claude-sonnet-4-6-20250301": "claude-sonnet-4-6",
1316
1316
  "claude-opus-4-6-20250301": "claude-opus-4-6",
@@ -1976,7 +1976,11 @@ function extractSuccessEvent(line) {
1976
1976
  let parts = line.split("|").map((part) => part.trim());
1977
1977
  if (parts.length < 3 || parts[1] !== "success") return null;
1978
1978
  let requestId = parts[0].match(/ccreq:([^.|\s]+)/)?.[1] ?? `${timestamp.getTime()}`, model = normalizeModel(parts[2]);
1979
- return model ? { requestId, timestamp, model } : null;
1979
+ return !model || isBackgroundRequest(parts[4], model) ? null : { requestId, timestamp, model };
1980
+ }
1981
+ function isBackgroundRequest(rawScope, model) {
1982
+ let scope = rawScope?.replace(/^\[|\]$/g, "").trim().toLowerCase();
1983
+ return scope === "xtabprovider" || scope === "settingseditorsearchsuggestions" ? !0 : model.startsWith("copilot-suggestions-") || model.startsWith("copilot-nes-") || model.startsWith("dd_");
1980
1984
  }
1981
1985
  function normalizeModel(raw) {
1982
1986
  let parts = raw.split("->").map((part) => part.trim()).filter(Boolean);
@@ -5369,6 +5373,7 @@ async function requestJson(url, init) {
5369
5373
  }
5370
5374
 
5371
5375
  // src/schedule.ts
5376
+ import { realpathSync } from "node:fs";
5372
5377
  import { mkdir as mkdir2, readFile as readFile16, stat as stat4, unlink, writeFile as writeFile2 } from "node:fs/promises";
5373
5378
  import { execFile as execFile2 } from "node:child_process";
5374
5379
  import { promisify } from "node:util";
@@ -5409,7 +5414,9 @@ async function getScheduleStatus() {
5409
5414
  return platform() === "darwin" ? getLaunchdStatus() : getCronStatus();
5410
5415
  }
5411
5416
  function resolveCommandPaths() {
5412
- let scriptPath = resolve5(process.argv[1]);
5417
+ let entryPath = process.argv[1];
5418
+ if (!entryPath) throw new Error("\u65E0\u6CD5\u89E3\u6790\u5F53\u524D aiusage \u547D\u4EE4\u8DEF\u5F84");
5419
+ let scriptPath = realpathSync(resolve5(entryPath));
5413
5420
  if (scriptPath.includes("_npx") || scriptPath.includes("/npx-"))
5414
5421
  throw new Error(
5415
5422
  `\u68C0\u6D4B\u5230\u901A\u8FC7 npx \u8FD0\u884C\uFF0C\u5B9A\u65F6\u4EFB\u52A1\u9700\u8981\u5168\u5C40\u5B89\u88C5\u3002
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiusage/cli",
3
- "version": "1.7.7",
3
+ "version": "1.7.9",
4
4
  "description": "Track and sync AI tool token usage across devices.",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2026-07-18-kimi-k3-v1",
2
+ "version": "2026-07-20-gpt-5.6-kimi-k3-v1",
3
3
  "fx": {
4
4
  "CNY": 7.2
5
5
  },