@yhong91/vibetime 0.1.36 → 0.1.37

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 +16 -14
  2. package/package.json +1 -1
package/bin/vibetime.mjs CHANGED
@@ -1928,7 +1928,7 @@ function countTextLines(text) {
1928
1928
  }
1929
1929
 
1930
1930
  // src/lib/constants.ts
1931
- var PACKAGE_VERSION = true ? "0.1.36" : "0.1.1";
1931
+ var PACKAGE_VERSION = true ? "0.1.37" : "0.1.1";
1932
1932
  var DEFAULT_API_URL = "http://121.196.224.82:3001";
1933
1933
  var DEFAULT_BACKFILL_BATCH_SIZE = 50;
1934
1934
  var DEFAULT_BACKFILL_BATCH_BYTES = 800 * 1024;
@@ -4208,8 +4208,9 @@ async function parseCodebuddyTraceFile(filePath, options) {
4208
4208
  if (isTrivial) {
4209
4209
  return [];
4210
4210
  }
4211
- const sessionId = trace.sessionId || sessionIdFromTracePath(filePath);
4212
- let cwd = await cwdFromSessionFile(trace.workerPid, trace.sessionId, options);
4211
+ const sessionMeta = await readCodebuddySessionMeta(trace.workerPid, trace.sessionId, options);
4212
+ const sessionId = trace.sessionId || sessionMeta.sessionId || sessionIdFromTracePath(filePath);
4213
+ let cwd = sessionMeta.cwd;
4213
4214
  if (!cwd && trace.startedAt) {
4214
4215
  cwd = await cwdFromHistoryFile(trace.startedAt, options);
4215
4216
  }
@@ -4627,20 +4628,21 @@ async function readCwdFromSession(sessionPath, matchSessionId) {
4627
4628
  if (matchSessionId && session.sessionId !== matchSessionId) {
4628
4629
  return void 0;
4629
4630
  }
4630
- if (typeof session.cwd === "string") {
4631
- return session.cwd;
4632
- }
4631
+ return {
4632
+ cwd: typeof session.cwd === "string" ? session.cwd : void 0,
4633
+ sessionId: typeof session.sessionId === "string" ? session.sessionId : void 0
4634
+ };
4633
4635
  } catch {
4634
4636
  }
4635
4637
  return void 0;
4636
4638
  }
4637
- async function cwdFromSessionFile(pid, traceSessionId, options) {
4639
+ async function readCodebuddySessionMeta(pid, traceSessionId, options) {
4638
4640
  const home = resolveHome(options);
4639
4641
  const sessionsDir = path9.join(home, ".codebuddy", "sessions");
4640
4642
  if (pid) {
4641
- const cwd = await readCwdFromSession(path9.join(sessionsDir, `${pid}.json`));
4642
- if (cwd) {
4643
- return cwd;
4643
+ const meta = await readCwdFromSession(path9.join(sessionsDir, `${pid}.json`));
4644
+ if (meta) {
4645
+ return meta;
4644
4646
  }
4645
4647
  }
4646
4648
  if (traceSessionId) {
@@ -4650,18 +4652,18 @@ async function cwdFromSessionFile(pid, traceSessionId, options) {
4650
4652
  if (!f.endsWith(".json")) {
4651
4653
  continue;
4652
4654
  }
4653
- const cwd = await readCwdFromSession(
4655
+ const meta = await readCwdFromSession(
4654
4656
  path9.join(sessionsDir, f),
4655
4657
  traceSessionId
4656
4658
  );
4657
- if (cwd) {
4658
- return cwd;
4659
+ if (meta) {
4660
+ return meta;
4659
4661
  }
4660
4662
  }
4661
4663
  } catch {
4662
4664
  }
4663
4665
  }
4664
- return void 0;
4666
+ return {};
4665
4667
  }
4666
4668
  async function cwdFromHistoryFile(traceStartedAt, options) {
4667
4669
  const home = resolveHome(options);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@yhong91/vibetime",
3
3
  "type": "module",
4
- "version": "0.1.36",
4
+ "version": "0.1.37",
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": {