@yhong91/vibetime 0.1.47 → 0.1.48

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/bin/vibetime.mjs +17 -3
  2. package/package.json +1 -1
package/bin/vibetime.mjs CHANGED
@@ -2047,7 +2047,7 @@ function claudeStyleFileMetrics(tool, input) {
2047
2047
  }
2048
2048
 
2049
2049
  // src/lib/constants.ts
2050
- var PACKAGE_VERSION = true ? "0.1.47" : "0.1.1";
2050
+ var PACKAGE_VERSION = true ? "0.1.48" : "0.1.1";
2051
2051
  var DEFAULT_API_URL = "http://121.196.224.82:3001";
2052
2052
  var DEFAULT_BACKFILL_BATCH_SIZE = 50;
2053
2053
  var DEFAULT_BACKFILL_BATCH_BYTES = 800 * 1024;
@@ -5157,7 +5157,7 @@ async function parseCodexSessionFile(filePath, options) {
5157
5157
  let sessionId = sessionIdFromFilePath(filePath, "codex");
5158
5158
  let cwd;
5159
5159
  let project;
5160
- let model;
5160
+ let model = firstTurnContextModel(lines);
5161
5161
  let sessionStartEmitted = false;
5162
5162
  let serviceTier;
5163
5163
  let reasoningEffort;
@@ -5191,7 +5191,6 @@ async function parseCodexSessionFile(filePath, options) {
5191
5191
  sessionId = stringField(payload, "id") || sessionId;
5192
5192
  cwd = inherited?.cwd || stringField(payload, "cwd") || cwd;
5193
5193
  project = inherited?.project || (cwd ? path11.basename(cwd) : project);
5194
- model = stringField(payload, "model_provider") || model;
5195
5194
  events.push(withBackfillRefs({
5196
5195
  schemaVersion: AGENT_TIME_SCHEMA_VERSION,
5197
5196
  ts,
@@ -5599,6 +5598,21 @@ async function parseCodexSessionFile(filePath, options) {
5599
5598
  }
5600
5599
  return events.filter((event) => validateCanonicalEvent(event).valid);
5601
5600
  }
5601
+ function firstTurnContextModel(lines) {
5602
+ for (const line of lines) {
5603
+ if (!line.includes("turn_context")) {
5604
+ continue;
5605
+ }
5606
+ const raw = parseJsonLine(line);
5607
+ if (raw && stringField(raw, "type") === "turn_context") {
5608
+ const model = stringField(objectField(raw, "payload"), "model");
5609
+ if (model) {
5610
+ return model;
5611
+ }
5612
+ }
5613
+ }
5614
+ return void 0;
5615
+ }
5602
5616
  function rewriteCodexModelForTier(model, serviceTier) {
5603
5617
  if (!model) {
5604
5618
  return model;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@yhong91/vibetime",
3
3
  "type": "module",
4
- "version": "0.1.47",
4
+ "version": "0.1.48",
5
5
  "description": "vibetime CLI — install AI-agent hooks (Claude Code, Codex, OpenCode, Pi) and report activity to vibetime.",
6
6
  "license": "MIT",
7
7
  "publishConfig": {