vibeusage 0.2.8 → 0.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibeusage",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "description": "Codex CLI token usage tracker (macOS-first, notify-driven).",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -42,12 +42,12 @@ const {
42
42
  const { renderLocalReport, renderAuthTransition, renderSuccessBox } = require('../lib/init-flow');
43
43
 
44
44
  const ASCII_LOGO = [
45
- '██╗ ██╗██╗██████╗ ███████╗███████╗ ██████╗ ██████╗ ██████╗ ███████╗',
46
- '██║ ██║██║██╔══██╗██╔════╝██╔════╝██╔════╝ ██╔═══██╗██╔══██╗██╔════╝',
47
- '██║ ██║██║██████╔╝█████╗ ███████╗██║ ██║ ██║██████╔╝█████╗',
48
- '╚██╗ ██╔╝██║██╔══██╗██╔══╝ ╚════██║██║ ██║ ██║██╔══██╗██╔══╝',
49
- ' ╚████╔╝ ██║██████╔╝███████╗███████║╚██████╗ ╚██████╔╝██║ ██║███████╗',
50
- ' ╚═══╝ ╚═╝╚═════╝ ╚══════╝╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝'
45
+ '██╗ ██╗██╗██████╗ ███████╗██╗ ██╗███████╗ █████╗ ██████╗ ███████╗',
46
+ '██║ ██║██║██╔══██╗██╔════╝██║ ██║██╔════╝██╔══██╗██╔════╝ ██╔════╝',
47
+ '██║ ██║██║██████╔╝█████╗ ██║ ██║███████╗███████║██║ ███╗█████╗',
48
+ '╚██╗ ██╔╝██║██╔══██╗██╔══╝ ██║ ██║╚════██║██╔══██║██║ ██║██╔══╝',
49
+ ' ╚████╔╝ ██║██████╔╝███████╗╚██████╔╝███████║██║ ██║╚██████╔╝███████╗',
50
+ ' ╚═══╝ ╚═╝╚═════╝ ╚══════╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝'
51
51
  ].join('\n');
52
52
 
53
53
  const DIVIDER = '----------------------------------------------';
@@ -6,7 +6,7 @@ const { ensureDir } = require('./fs');
6
6
 
7
7
  const DEFAULT_PLUGIN_NAME = 'vibeusage-tracker.js';
8
8
  const PLUGIN_MARKER = 'VIBEUSAGE_TRACKER_PLUGIN';
9
- const DEFAULT_EVENT = 'session.idle';
9
+ const DEFAULT_EVENT = 'session.updated';
10
10
 
11
11
  function resolveOpencodeConfigDir({ home = os.homedir(), env = process.env } = {}) {
12
12
  const explicit = typeof env.OPENCODE_CONFIG_DIR === 'string' ? env.OPENCODE_CONFIG_DIR.trim() : '';
@@ -88,7 +88,9 @@ function hasPluginMarker(text) {
88
88
  }
89
89
 
90
90
  module.exports = {
91
+ DEFAULT_EVENT,
91
92
  DEFAULT_PLUGIN_NAME,
93
+ PLUGIN_MARKER,
92
94
  resolveOpencodeConfigDir,
93
95
  resolveOpencodePluginDir,
94
96
  buildOpencodePlugin,
@@ -574,7 +574,7 @@ async function parseOpencodeMessageFile({ filePath, lastTotals, hourlyState, tou
574
574
  const bucketStart = toUtcHalfHourStart(tsIso);
575
575
  if (!bucketStart) return { lastTotals, eventsAggregated: 0 };
576
576
 
577
- const model = normalizeModelInput(msg?.modelID) || DEFAULT_MODEL;
577
+ const model = normalizeModelInput(msg?.modelID || msg?.model || msg?.modelId) || DEFAULT_MODEL;
578
578
  const bucket = getHourlyBucket(hourlyState, source, model, bucketStart);
579
579
  addTotals(bucket.totals, delta);
580
580
  touchedBuckets.add(bucketKey(source, model, bucketStart));