@yhong91/vibetime 0.1.13 → 0.1.14
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 +47 -4
- package/package.json +1 -1
package/bin/vibetime.mjs
CHANGED
|
@@ -1195,7 +1195,7 @@ function countTextLines(text) {
|
|
|
1195
1195
|
}
|
|
1196
1196
|
|
|
1197
1197
|
// src/lib/constants.ts
|
|
1198
|
-
var PACKAGE_VERSION = true ? "0.1.
|
|
1198
|
+
var PACKAGE_VERSION = true ? "0.1.14" : "0.1.1";
|
|
1199
1199
|
var DEFAULT_API_URL = "http://121.196.224.82:3001";
|
|
1200
1200
|
var DEFAULT_BACKFILL_BATCH_SIZE = 50;
|
|
1201
1201
|
var DEFAULT_BACKFILL_BATCH_BYTES = 800 * 1024;
|
|
@@ -3770,6 +3770,7 @@ async function parseCodexSessionFile(filePath, options) {
|
|
|
3770
3770
|
let model;
|
|
3771
3771
|
let sessionStartEmitted = false;
|
|
3772
3772
|
let serviceTier;
|
|
3773
|
+
let reasoningEffort;
|
|
3773
3774
|
let currentTurnId;
|
|
3774
3775
|
let lastTurnIdForComplete;
|
|
3775
3776
|
let turnIdAtLastUserMessage;
|
|
@@ -3816,6 +3817,10 @@ async function parseCodexSessionFile(filePath, options) {
|
|
|
3816
3817
|
cwd = stringField(payload, "cwd") || cwd;
|
|
3817
3818
|
project = cwd ? path9.basename(cwd) : project;
|
|
3818
3819
|
model = stringField(payload, "model") || model;
|
|
3820
|
+
const effort = stringField(payload, "effort") || stringField(objectField(objectField(payload, "collaboration_mode"), "settings"), "reasoning_effort");
|
|
3821
|
+
if (effort) {
|
|
3822
|
+
reasoningEffort = effort;
|
|
3823
|
+
}
|
|
3819
3824
|
const tier = stringField(payload, "service_tier");
|
|
3820
3825
|
if (tier) {
|
|
3821
3826
|
serviceTier = tier.toLowerCase();
|
|
@@ -3916,6 +3921,7 @@ async function parseCodexSessionFile(filePath, options) {
|
|
|
3916
3921
|
}
|
|
3917
3922
|
const usage = tokenUsageFromPayload(payload);
|
|
3918
3923
|
if (usage) {
|
|
3924
|
+
const metrics = { ...usage, reasoningEffort };
|
|
3919
3925
|
const usageKey = [
|
|
3920
3926
|
usage.tokensInput,
|
|
3921
3927
|
usage.tokensCachedInput,
|
|
@@ -3939,7 +3945,7 @@ async function parseCodexSessionFile(filePath, options) {
|
|
|
3939
3945
|
// model was the user on") don't show tier-specific names.
|
|
3940
3946
|
model: rewriteCodexModelForTier(model, serviceTier),
|
|
3941
3947
|
confidence: "partial",
|
|
3942
|
-
metrics
|
|
3948
|
+
metrics
|
|
3943
3949
|
}), { filePath, sourcePathHash, lineNumber, topType, payloadType, options }));
|
|
3944
3950
|
}
|
|
3945
3951
|
break;
|
|
@@ -4333,6 +4339,7 @@ async function parseCopilotSessionFile(filePath, options) {
|
|
|
4333
4339
|
let model;
|
|
4334
4340
|
let currentTurnId;
|
|
4335
4341
|
let sessionStartedAt;
|
|
4342
|
+
let reasoningEffort;
|
|
4336
4343
|
const pendingTools = /* @__PURE__ */ new Map();
|
|
4337
4344
|
const turnTokenAccum = /* @__PURE__ */ new Map();
|
|
4338
4345
|
for (const [index, line] of lines.entries()) {
|
|
@@ -4351,6 +4358,10 @@ async function parseCopilotSessionFile(filePath, options) {
|
|
|
4351
4358
|
case "session.start": {
|
|
4352
4359
|
sessionId = stringField(data, "sessionId") || sessionId;
|
|
4353
4360
|
model = stringField(data, "selectedModel") || model;
|
|
4361
|
+
const effort = stringField(data, "reasoningEffort");
|
|
4362
|
+
if (effort) {
|
|
4363
|
+
reasoningEffort = effort;
|
|
4364
|
+
}
|
|
4354
4365
|
const context = objectField(data, "context");
|
|
4355
4366
|
cwd = stringField(context, "cwd") || stringField(context, "gitRoot") || cwd;
|
|
4356
4367
|
project = stringField(context, "repository") || (cwd ? path10.basename(cwd) : void 0);
|
|
@@ -4494,6 +4505,7 @@ async function parseCopilotSessionFile(filePath, options) {
|
|
|
4494
4505
|
const turnId = endTurnId !== void 0 ? `turn_${createStableHash([sessionId, endTurnId]).slice(0, 24)}` : currentTurnId;
|
|
4495
4506
|
const accum = turnId ? turnTokenAccum.get(turnId) : void 0;
|
|
4496
4507
|
if (accum && accum.tokensOutput && accum.tokensOutput > 0) {
|
|
4508
|
+
accum.reasoningEffort = reasoningEffort;
|
|
4497
4509
|
events.push(baseCopilotEvent({
|
|
4498
4510
|
ts,
|
|
4499
4511
|
type: "model.usage",
|
|
@@ -4553,6 +4565,7 @@ async function parseCopilotSessionFile(filePath, options) {
|
|
|
4553
4565
|
tokensCacheReadInput: cacheReadTokens || void 0,
|
|
4554
4566
|
tokensCacheCreationInput: cacheWriteTokens || void 0,
|
|
4555
4567
|
tokensReasoningOutput: reasoningTokens || void 0,
|
|
4568
|
+
reasoningEffort,
|
|
4556
4569
|
tokensTotal: total,
|
|
4557
4570
|
modelCalls: requestCount || void 0
|
|
4558
4571
|
}
|
|
@@ -4700,6 +4713,20 @@ async function parseOpenCodeSessionFile(dbPath, options) {
|
|
|
4700
4713
|
let currentTurnId;
|
|
4701
4714
|
let currentProvider;
|
|
4702
4715
|
let turnTs;
|
|
4716
|
+
let reasoningEffort;
|
|
4717
|
+
const modelSwitchedEvents = db.prepare(
|
|
4718
|
+
"SELECT data FROM event WHERE aggregate_id = ? AND type = 'session.next.model.switched.1' ORDER BY seq"
|
|
4719
|
+
).all(sessionId);
|
|
4720
|
+
for (const evt of modelSwitchedEvents) {
|
|
4721
|
+
try {
|
|
4722
|
+
const evtData = JSON.parse(evt.data);
|
|
4723
|
+
const variant = isPlainObject(evtData) ? stringField(evtData.model || evtData, "variant") : void 0;
|
|
4724
|
+
if (variant && variant !== "default") {
|
|
4725
|
+
reasoningEffort = variant;
|
|
4726
|
+
}
|
|
4727
|
+
} catch {
|
|
4728
|
+
}
|
|
4729
|
+
}
|
|
4703
4730
|
for (const msg of messages) {
|
|
4704
4731
|
let info;
|
|
4705
4732
|
try {
|
|
@@ -4791,7 +4818,8 @@ async function parseOpenCodeSessionFile(dbPath, options) {
|
|
|
4791
4818
|
tokensCachedInput: tokens.tokensCachedInput,
|
|
4792
4819
|
tokensCacheReadInput: tokens.tokensCacheReadInput,
|
|
4793
4820
|
tokensCacheCreationInput: tokens.tokensCacheCreationInput,
|
|
4794
|
-
tokensTotal: tokens.tokensTotal
|
|
4821
|
+
tokensTotal: tokens.tokensTotal,
|
|
4822
|
+
reasoningEffort
|
|
4795
4823
|
};
|
|
4796
4824
|
if (cost !== void 0) {
|
|
4797
4825
|
metrics.costUsd = cost;
|
|
@@ -4916,7 +4944,8 @@ async function parseOpenCodeSessionFile(dbPath, options) {
|
|
|
4916
4944
|
tokensCachedInput: stepTokens.tokensCachedInput,
|
|
4917
4945
|
tokensCacheReadInput: stepTokens.tokensCacheReadInput,
|
|
4918
4946
|
tokensCacheCreationInput: stepTokens.tokensCacheCreationInput,
|
|
4919
|
-
tokensTotal: stepTokens.tokensTotal
|
|
4947
|
+
tokensTotal: stepTokens.tokensTotal,
|
|
4948
|
+
reasoningEffort
|
|
4920
4949
|
};
|
|
4921
4950
|
if (stepCost !== void 0) {
|
|
4922
4951
|
stepMetrics.costUsd = stepCost;
|
|
@@ -5149,6 +5178,7 @@ async function parsePiSessionFile(filePath, options) {
|
|
|
5149
5178
|
let model;
|
|
5150
5179
|
let provider;
|
|
5151
5180
|
let turnStartedAt;
|
|
5181
|
+
let reasoningEffort;
|
|
5152
5182
|
const pendingToolCalls = /* @__PURE__ */ new Map();
|
|
5153
5183
|
const state = new SessionParserState(filePath, options, (event) => basePiEvent({ ...event, cwd, project, model }));
|
|
5154
5184
|
const push = (event, ln) => {
|
|
@@ -5179,6 +5209,13 @@ async function parsePiSessionFile(filePath, options) {
|
|
|
5179
5209
|
provider = stringField(raw, "provider") || provider;
|
|
5180
5210
|
continue;
|
|
5181
5211
|
}
|
|
5212
|
+
if (entryType === "thinking_level_change") {
|
|
5213
|
+
const level = stringField(raw, "thinkingLevel");
|
|
5214
|
+
if (level) {
|
|
5215
|
+
reasoningEffort = level;
|
|
5216
|
+
}
|
|
5217
|
+
continue;
|
|
5218
|
+
}
|
|
5182
5219
|
if (entryType !== "message") {
|
|
5183
5220
|
continue;
|
|
5184
5221
|
}
|
|
@@ -5228,6 +5265,7 @@ async function parsePiSessionFile(filePath, options) {
|
|
|
5228
5265
|
provider = stringField(message, "provider") || provider;
|
|
5229
5266
|
const usage = piUsageFromMessage(message);
|
|
5230
5267
|
if (usage) {
|
|
5268
|
+
usage.reasoningEffort = reasoningEffort;
|
|
5231
5269
|
push(basePiEvent({
|
|
5232
5270
|
ts,
|
|
5233
5271
|
type: "model.usage",
|
|
@@ -7948,6 +7986,7 @@ function buildSessionRollup(rollupKey, events) {
|
|
|
7948
7986
|
let cacheReadInputTokens = 0;
|
|
7949
7987
|
let outputTokens = 0;
|
|
7950
7988
|
let reasoningOutputTokens = 0;
|
|
7989
|
+
let reasoningEffort;
|
|
7951
7990
|
let totalTokens = 0;
|
|
7952
7991
|
let linesAdded = 0;
|
|
7953
7992
|
let linesRemoved = 0;
|
|
@@ -8042,6 +8081,9 @@ function buildSessionRollup(rollupKey, events) {
|
|
|
8042
8081
|
cacheReadInputTokens += eventCacheReadInputTokens;
|
|
8043
8082
|
outputTokens += eventOutputTokens;
|
|
8044
8083
|
reasoningOutputTokens += eventReasoningOutputTokens;
|
|
8084
|
+
if (event.metrics?.reasoningEffort) {
|
|
8085
|
+
reasoningEffort = event.metrics.reasoningEffort;
|
|
8086
|
+
}
|
|
8045
8087
|
totalTokens += eventTotalTokens;
|
|
8046
8088
|
linesAdded += lineStats.linesAdded;
|
|
8047
8089
|
linesRemoved += lineStats.linesRemoved;
|
|
@@ -8173,6 +8215,7 @@ function buildSessionRollup(rollupKey, events) {
|
|
|
8173
8215
|
cacheReadInputTokens,
|
|
8174
8216
|
outputTokens,
|
|
8175
8217
|
reasoningOutputTokens,
|
|
8218
|
+
reasoningEffort,
|
|
8176
8219
|
totalTokens,
|
|
8177
8220
|
linesAdded,
|
|
8178
8221
|
linesRemoved,
|
package/package.json
CHANGED