@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.
- package/bin/vibetime.mjs +16 -14
- 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.
|
|
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
|
|
4212
|
-
|
|
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
|
-
|
|
4631
|
-
|
|
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
|
|
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
|
|
4642
|
-
if (
|
|
4643
|
-
return
|
|
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
|
|
4655
|
+
const meta = await readCwdFromSession(
|
|
4654
4656
|
path9.join(sessionsDir, f),
|
|
4655
4657
|
traceSessionId
|
|
4656
4658
|
);
|
|
4657
|
-
if (
|
|
4658
|
-
return
|
|
4659
|
+
if (meta) {
|
|
4660
|
+
return meta;
|
|
4659
4661
|
}
|
|
4660
4662
|
}
|
|
4661
4663
|
} catch {
|
|
4662
4664
|
}
|
|
4663
4665
|
}
|
|
4664
|
-
return
|
|
4666
|
+
return {};
|
|
4665
4667
|
}
|
|
4666
4668
|
async function cwdFromHistoryFile(traceStartedAt, options) {
|
|
4667
4669
|
const home = resolveHome(options);
|
package/package.json
CHANGED