qodewk 0.9.0 → 0.9.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 (2) hide show
  1. package/dist/index.cjs +51 -23
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -13842,6 +13842,9 @@ var MODEL_ALIASES = {
13842
13842
  "gemini-3": "gemini-3-8-flash",
13843
13843
  "gemini-flash": "gemini-3-8-flash",
13844
13844
  "gemini-pro": "gemini-2-5-pro",
13845
+ "gemini-3-1-pro": "gemini-2-5-pro",
13846
+ "gemini-3-pro": "gemini-2-5-pro",
13847
+ "gemini-3-1-flash": "gemini-3-8-flash",
13845
13848
  "gemini-2.0-flash": "gemini-2-0-flash",
13846
13849
  "gemini-1.5-pro": "gemini-1-5-pro",
13847
13850
  "gemini-1.5-flash": "gemini-2-0-flash",
@@ -13854,10 +13857,47 @@ var MODEL_ALIASES = {
13854
13857
  };
13855
13858
  var DYNAMIC_RATE_CARDS = {};
13856
13859
  var DYNAMIC_ALIASES = {};
13860
+ var PROVIDERS = /* @__PURE__ */ new Set(["anthropic", "openai", "google", "deepseek", "generic"]);
13861
+ function isPrice(v) {
13862
+ return typeof v === "number" && Number.isFinite(v) && v >= 0 && v <= 1e3;
13863
+ }
13864
+ function sanitizeRateCards(raw) {
13865
+ const out = {};
13866
+ if (!raw || typeof raw !== "object")
13867
+ return out;
13868
+ for (const [key, value] of Object.entries(raw)) {
13869
+ const c3 = value;
13870
+ if (!c3 || typeof c3 !== "object")
13871
+ continue;
13872
+ if (isPrice(c3.inputPerMTok) && isPrice(c3.outputPerMTok) && isPrice(c3.cacheReadPerMTok) && isPrice(c3.cacheWritePerMTok)) {
13873
+ out[key] = {
13874
+ id: typeof c3.id === "string" ? c3.id : key,
13875
+ provider: PROVIDERS.has(c3.provider) ? c3.provider : "generic",
13876
+ name: typeof c3.name === "string" ? c3.name : key,
13877
+ inputPerMTok: c3.inputPerMTok,
13878
+ outputPerMTok: c3.outputPerMTok,
13879
+ cacheReadPerMTok: c3.cacheReadPerMTok,
13880
+ cacheWritePerMTok: c3.cacheWritePerMTok,
13881
+ contextWindow: typeof c3.contextWindow === "number" && c3.contextWindow > 0 ? c3.contextWindow : 128e3
13882
+ };
13883
+ }
13884
+ }
13885
+ return out;
13886
+ }
13887
+ function sanitizeAliases(raw) {
13888
+ const out = {};
13889
+ if (!raw || typeof raw !== "object")
13890
+ return out;
13891
+ for (const [k2, v] of Object.entries(raw)) {
13892
+ if (typeof v === "string" && v.length > 0)
13893
+ out[k2.toLowerCase()] = v;
13894
+ }
13895
+ return out;
13896
+ }
13857
13897
  function updatePricingRegistry(newCards, newAliases) {
13858
- DYNAMIC_RATE_CARDS = { ...DYNAMIC_RATE_CARDS, ...newCards };
13898
+ DYNAMIC_RATE_CARDS = { ...DYNAMIC_RATE_CARDS, ...sanitizeRateCards(newCards) };
13859
13899
  if (newAliases) {
13860
- DYNAMIC_ALIASES = { ...DYNAMIC_ALIASES, ...newAliases };
13900
+ DYNAMIC_ALIASES = { ...DYNAMIC_ALIASES, ...sanitizeAliases(newAliases) };
13861
13901
  }
13862
13902
  }
13863
13903
  function getRateCard(modelId) {
@@ -13881,18 +13921,16 @@ function getRateCard(modelId) {
13881
13921
  return RATE_CARDS["claude-opus-4-6-thinking"] ?? RATE_CARDS["claude-opus-4"];
13882
13922
  }
13883
13923
  if (key.includes("sonnet")) {
13884
- if (key.includes("4-6") || key.includes("thinking")) {
13885
- return RATE_CARDS["claude-sonnet-4-6-thinking"];
13886
- }
13887
13924
  if (key.includes("3-7") || key.includes("sonnet-3-7")) {
13888
13925
  return RATE_CARDS["claude-3-7-sonnet"];
13889
13926
  }
13890
13927
  if (key.includes("3-5") || key.includes("sonnet-3-5")) {
13891
13928
  return RATE_CARDS["claude-3-5-sonnet"];
13892
13929
  }
13893
- if (key.includes("sonnet-4") || key.includes("claude-4") || key.includes("sonnet-v4")) {
13894
- return RATE_CARDS["claude-sonnet-4"] ?? RATE_CARDS["claude-sonnet-4-6-thinking"];
13895
- }
13930
+ return RATE_CARDS["claude-sonnet-4-6-thinking"];
13931
+ }
13932
+ if (key.includes("haiku")) {
13933
+ return RATE_CARDS["claude-3-5-haiku"];
13896
13934
  }
13897
13935
  if (key.includes("o1-mini") || key.includes("o3-mini")) {
13898
13936
  return RATE_CARDS["o3-mini"];
@@ -14248,17 +14286,7 @@ function harvestAntigravityFootprints(repoPath, sinceDate) {
14248
14286
  if (line.includes("Model Selection")) {
14249
14287
  const match = line.match(/Model Selection` from .*?to ([^\.\(\n\r]+)/);
14250
14288
  if (match && match[1] && match[1].length < 30) {
14251
- const rawModel = match[1].trim();
14252
- if (rawModel.toLowerCase().includes("opus"))
14253
- detectedModel = "claude-opus-4-6-thinking";
14254
- else if (rawModel.toLowerCase().includes("sonnet"))
14255
- detectedModel = "claude-sonnet-4-6-thinking";
14256
- else if (rawModel.toLowerCase().includes("flash"))
14257
- detectedModel = "gemini-3-8-flash";
14258
- else if (rawModel.toLowerCase().includes("pro"))
14259
- detectedModel = "gemini-2-5-pro";
14260
- else
14261
- detectedModel = rawModel.toLowerCase().replace(/\s+/g, "-");
14289
+ detectedModel = match[1].toLowerCase().replace(/\(.*?\)/g, "").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
14262
14290
  }
14263
14291
  }
14264
14292
  if (line.includes('"replace_file_content"') || line.includes('"write_to_file"')) {
@@ -14589,8 +14617,8 @@ function harvestCursorFootprints(repoPath, sinceDate) {
14589
14617
  cached: estCached
14590
14618
  },
14591
14619
  cost,
14592
- mode: "verified",
14593
- confidence: 0.95,
14620
+ mode: "estimated",
14621
+ confidence: 0.55,
14594
14622
  rawTranscriptPath: dbFile
14595
14623
  });
14596
14624
  }
@@ -16079,7 +16107,7 @@ function buildMenuFrame(selectedIndex, items = MENU_ITEMS, title = "Telemetry Co
16079
16107
  }
16080
16108
  push("");
16081
16109
  const badge = bg.teal(import_picocolors2.default.bold(colors.ink(" qodewk ")));
16082
- push(` ${colors.mutedSoft("\u250C")} ${badge} ${import_picocolors2.default.dim("v0.9.0")}`);
16110
+ push(` ${colors.mutedSoft("\u250C")} ${badge} ${import_picocolors2.default.dim("v0.9.1")}`);
16083
16111
  push(` ${colors.mutedSoft("\u2502")}`);
16084
16112
  if (options.actionContext) {
16085
16113
  push(` ${colors.teal("\u25C7")} ${import_picocolors2.default.dim("Action:")} ${import_picocolors2.default.white(options.actionContext)}`);
@@ -16618,7 +16646,7 @@ function resolveCliVersion() {
16618
16646
  }
16619
16647
  } catch {
16620
16648
  }
16621
- return "0.9.0";
16649
+ return "0.9.1";
16622
16650
  }
16623
16651
  function resolveSince(options) {
16624
16652
  return options.today ? "today" : options.since;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qodewk",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "Universal telemetry and digital receipt generator for the AI coding agent era",
5
5
  "type": "module",
6
6
  "bin": {