panopticon-cli 0.6.3 → 0.6.5

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.
@@ -18,7 +18,7 @@
18
18
  }
19
19
  })();
20
20
  </script>
21
- <script type="module" crossorigin src="/assets/index-DuamiNtC.js"></script>
21
+ <script type="module" crossorigin src="/assets/index-yarWhi0M.js"></script>
22
22
  <link rel="modulepreload" crossorigin href="/assets/chunk-BEqpzyXh.js">
23
23
  <link rel="stylesheet" crossorigin href="/assets/index-CpSmB2ts.css">
24
24
  </head>
@@ -6751,6 +6751,13 @@ function canReplaceTitle(conv) {
6751
6751
  * All file I/O uses fs/promises (no sync calls).
6752
6752
  */
6753
6753
  init_cost();
6754
+ /** Detect AI provider from model name */
6755
+ function providerFromModel(model) {
6756
+ if (model.includes("gpt")) return "openai";
6757
+ if (model.includes("gemini")) return "google";
6758
+ if (model.includes("kimi") || model.toLowerCase().startsWith("minimax")) return "custom";
6759
+ return "anthropic";
6760
+ }
6754
6761
  /**
6755
6762
  * Parse JSONL session file from a byte offset.
6756
6763
  *
@@ -6822,7 +6829,7 @@ async function parseConversationMessages(sessionFile, fromByteOffset = 0) {
6822
6829
  const msg = entry.message;
6823
6830
  const content = Array.isArray(msg.content) ? msg.content : [];
6824
6831
  if (msg.usage && msg.model) {
6825
- const pricing = getPricing("anthropic", msg.model);
6832
+ const pricing = getPricing(providerFromModel(msg.model), msg.model);
6826
6833
  if (pricing) totalCost += calculateCost({
6827
6834
  inputTokens: msg.usage.input_tokens ?? 0,
6828
6835
  outputTokens: msg.usage.output_tokens ?? 0,
@@ -22161,21 +22168,15 @@ init_config_yaml();
22161
22168
  init_config();
22162
22169
  const execAsync$2 = promisify(exec);
22163
22170
  function readPackageVersion() {
22164
- const base = dirname$1(fileURLToPath(import.meta.url));
22165
- for (const levels of [[
22166
- "..",
22167
- "..",
22168
- ".."
22169
- ], [
22170
- "..",
22171
- "..",
22172
- "..",
22173
- ".."
22174
- ]]) {
22175
- const candidate = join$1(base, ...levels, "package.json");
22171
+ let dir = dirname$1(fileURLToPath(import.meta.url));
22172
+ for (let i = 0; i < 8; i++) {
22173
+ const candidate = join$1(dir, "package.json");
22176
22174
  try {
22177
22175
  return JSON.parse(readFileSync$1(candidate, "utf-8")).version;
22178
22176
  } catch {}
22177
+ const parent = dirname$1(dir);
22178
+ if (parent === dir) break;
22179
+ dir = parent;
22179
22180
  }
22180
22181
  return "0.0.0";
22181
22182
  }