@yhong91/vibetime 0.1.35 → 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 +36 -32
- 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
|
}
|
|
@@ -4248,7 +4249,7 @@ async function parseCodebuddyTraceFile(filePath, options) {
|
|
|
4248
4249
|
confidence: "partial"
|
|
4249
4250
|
}), 0, "trace");
|
|
4250
4251
|
}
|
|
4251
|
-
if (
|
|
4252
|
+
if (traceStartedAt) {
|
|
4252
4253
|
const turnId = `turn_${createStableHash([sessionId, trace.traceId]).slice(0, 24)}`;
|
|
4253
4254
|
push(baseEvent({
|
|
4254
4255
|
ts: traceStartedAt,
|
|
@@ -4260,23 +4261,25 @@ async function parseCodebuddyTraceFile(filePath, options) {
|
|
|
4260
4261
|
model,
|
|
4261
4262
|
confidence: "partial"
|
|
4262
4263
|
}), 0, "trace");
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
|
|
4279
|
-
|
|
4264
|
+
if (trace.prompt) {
|
|
4265
|
+
push(baseEvent({
|
|
4266
|
+
ts: traceStartedAt,
|
|
4267
|
+
type: "prompt.submitted",
|
|
4268
|
+
sessionId,
|
|
4269
|
+
turnId,
|
|
4270
|
+
cwd,
|
|
4271
|
+
project,
|
|
4272
|
+
model,
|
|
4273
|
+
confidence: "partial",
|
|
4274
|
+
metrics: {
|
|
4275
|
+
prompts: 1,
|
|
4276
|
+
promptChars: trace.prompt.length
|
|
4277
|
+
},
|
|
4278
|
+
refs: stringRefs({
|
|
4279
|
+
promptHash: `sha256:${createStableHash(trace.prompt)}`
|
|
4280
|
+
})
|
|
4281
|
+
}), 0, "trace");
|
|
4282
|
+
}
|
|
4280
4283
|
if (traceEndedAt) {
|
|
4281
4284
|
push(baseEvent({
|
|
4282
4285
|
ts: traceEndedAt,
|
|
@@ -4625,20 +4628,21 @@ async function readCwdFromSession(sessionPath, matchSessionId) {
|
|
|
4625
4628
|
if (matchSessionId && session.sessionId !== matchSessionId) {
|
|
4626
4629
|
return void 0;
|
|
4627
4630
|
}
|
|
4628
|
-
|
|
4629
|
-
|
|
4630
|
-
|
|
4631
|
+
return {
|
|
4632
|
+
cwd: typeof session.cwd === "string" ? session.cwd : void 0,
|
|
4633
|
+
sessionId: typeof session.sessionId === "string" ? session.sessionId : void 0
|
|
4634
|
+
};
|
|
4631
4635
|
} catch {
|
|
4632
4636
|
}
|
|
4633
4637
|
return void 0;
|
|
4634
4638
|
}
|
|
4635
|
-
async function
|
|
4639
|
+
async function readCodebuddySessionMeta(pid, traceSessionId, options) {
|
|
4636
4640
|
const home = resolveHome(options);
|
|
4637
4641
|
const sessionsDir = path9.join(home, ".codebuddy", "sessions");
|
|
4638
4642
|
if (pid) {
|
|
4639
|
-
const
|
|
4640
|
-
if (
|
|
4641
|
-
return
|
|
4643
|
+
const meta = await readCwdFromSession(path9.join(sessionsDir, `${pid}.json`));
|
|
4644
|
+
if (meta) {
|
|
4645
|
+
return meta;
|
|
4642
4646
|
}
|
|
4643
4647
|
}
|
|
4644
4648
|
if (traceSessionId) {
|
|
@@ -4648,18 +4652,18 @@ async function cwdFromSessionFile(pid, traceSessionId, options) {
|
|
|
4648
4652
|
if (!f.endsWith(".json")) {
|
|
4649
4653
|
continue;
|
|
4650
4654
|
}
|
|
4651
|
-
const
|
|
4655
|
+
const meta = await readCwdFromSession(
|
|
4652
4656
|
path9.join(sessionsDir, f),
|
|
4653
4657
|
traceSessionId
|
|
4654
4658
|
);
|
|
4655
|
-
if (
|
|
4656
|
-
return
|
|
4659
|
+
if (meta) {
|
|
4660
|
+
return meta;
|
|
4657
4661
|
}
|
|
4658
4662
|
}
|
|
4659
4663
|
} catch {
|
|
4660
4664
|
}
|
|
4661
4665
|
}
|
|
4662
|
-
return
|
|
4666
|
+
return {};
|
|
4663
4667
|
}
|
|
4664
4668
|
async function cwdFromHistoryFile(traceStartedAt, options) {
|
|
4665
4669
|
const home = resolveHome(options);
|
package/package.json
CHANGED