@yhong91/vibetime 0.1.21 → 0.1.24
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 +27 -7
- package/package.json +1 -1
package/bin/vibetime.mjs
CHANGED
|
@@ -159,8 +159,7 @@ var init_fs = __esm({
|
|
|
159
159
|
|
|
160
160
|
// src/cli.ts
|
|
161
161
|
import { spawn as spawn2, spawnSync } from "node:child_process";
|
|
162
|
-
import {
|
|
163
|
-
import { mkdir as mkdir5, open, rename as rename2, rm, stat as stat12, writeFile as writeFile4 } from "node:fs/promises";
|
|
162
|
+
import { mkdir as mkdir5, open, rm, stat as stat12, writeFile as writeFile4 } from "node:fs/promises";
|
|
164
163
|
import os9 from "node:os";
|
|
165
164
|
import path21 from "node:path";
|
|
166
165
|
import { fileURLToPath } from "node:url";
|
|
@@ -1202,7 +1201,7 @@ function countTextLines(text) {
|
|
|
1202
1201
|
}
|
|
1203
1202
|
|
|
1204
1203
|
// src/lib/constants.ts
|
|
1205
|
-
var PACKAGE_VERSION = true ? "0.1.
|
|
1204
|
+
var PACKAGE_VERSION = true ? "0.1.24" : "0.1.1";
|
|
1206
1205
|
var DEFAULT_API_URL = "http://121.196.224.82:3001";
|
|
1207
1206
|
var DEFAULT_BACKFILL_BATCH_SIZE = 50;
|
|
1208
1207
|
var DEFAULT_BACKFILL_BATCH_BYTES = 800 * 1024;
|
|
@@ -2695,6 +2694,9 @@ async function parseClaudeCodeSessionFile(filePath, options) {
|
|
|
2695
2694
|
continue;
|
|
2696
2695
|
}
|
|
2697
2696
|
if (topType === "user") {
|
|
2697
|
+
if (isClaudeNoiseUserEntry(raw, message)) {
|
|
2698
|
+
continue;
|
|
2699
|
+
}
|
|
2698
2700
|
const prompt = claudeTextStats(message.content);
|
|
2699
2701
|
state.closeTurn(ts, lineNumber, topType);
|
|
2700
2702
|
state.currentTurnId = stringField(raw, "uuid") || stringField(raw, "promptId") || `turn_${createStableHash([sessionId, lineNumber]).slice(0, 24)}`;
|
|
@@ -2978,6 +2980,23 @@ function claudeTextStats(value) {
|
|
|
2978
2980
|
hash: textItems.length > 0 ? `sha256:${createStableHash(textItems)}` : void 0
|
|
2979
2981
|
};
|
|
2980
2982
|
}
|
|
2983
|
+
function isClaudeNoiseUserEntry(raw, message) {
|
|
2984
|
+
if (raw.isMeta === true) {
|
|
2985
|
+
return true;
|
|
2986
|
+
}
|
|
2987
|
+
const content = message.content;
|
|
2988
|
+
let text = "";
|
|
2989
|
+
if (typeof content === "string") {
|
|
2990
|
+
text = content;
|
|
2991
|
+
} else if (Array.isArray(content)) {
|
|
2992
|
+
text = content.filter((item) => isPlainObject(item) && item.type === "text").map((item) => stringField(item, "text") || "").join("");
|
|
2993
|
+
}
|
|
2994
|
+
text = text.trim();
|
|
2995
|
+
if (!text) {
|
|
2996
|
+
return false;
|
|
2997
|
+
}
|
|
2998
|
+
return /^<(?:command-name|command-message|command-args|local-command-stdout|local-command-stderr|local-command-caveat)>/.test(text) || text === "[Request interrupted by user]";
|
|
2999
|
+
}
|
|
2981
3000
|
async function claudeProjectContextFromLines(filePath, lines, options) {
|
|
2982
3001
|
const projectDir = path7.basename(path7.dirname(filePath));
|
|
2983
3002
|
const cwds = [];
|
|
@@ -8357,7 +8376,10 @@ function buildSessionRollups(events) {
|
|
|
8357
8376
|
grouped.set(key, [event]);
|
|
8358
8377
|
}
|
|
8359
8378
|
}
|
|
8360
|
-
return [...grouped.entries()].map(([rollupKey, sessionEvents]) => buildSessionRollup(rollupKey, sessionEvents)).sort((a, b) => a.startedAt.localeCompare(b.startedAt));
|
|
8379
|
+
return [...grouped.entries()].map(([rollupKey, sessionEvents]) => buildSessionRollup(rollupKey, sessionEvents)).filter((rollup) => !isPhantomRollup(rollup)).sort((a, b) => a.startedAt.localeCompare(b.startedAt));
|
|
8380
|
+
}
|
|
8381
|
+
function isPhantomRollup(rollup) {
|
|
8382
|
+
return rollup.totalTokens === 0 && rollup.toolCallCount === 0 && rollup.commandCallCount === 0 && rollup.linesAdded === 0 && rollup.linesRemoved === 0;
|
|
8361
8383
|
}
|
|
8362
8384
|
function buildSessionRollup(rollupKey, events) {
|
|
8363
8385
|
const ordered = [...events].sort((a, b) => a.ts.localeCompare(b.ts));
|
|
@@ -10042,10 +10064,8 @@ async function readSyncLocalTriggerState(statePath) {
|
|
|
10042
10064
|
}
|
|
10043
10065
|
async function writeSyncLocalTriggerState(statePath, state) {
|
|
10044
10066
|
await mkdir5(path21.dirname(statePath), { recursive: true });
|
|
10045
|
-
|
|
10046
|
-
await writeFile4(tmpPath, `${JSON.stringify(state, null, 2)}
|
|
10067
|
+
await writeFile4(statePath, `${JSON.stringify(state, null, 2)}
|
|
10047
10068
|
`, "utf8");
|
|
10048
|
-
await rename2(tmpPath, statePath);
|
|
10049
10069
|
}
|
|
10050
10070
|
async function readSyncLocalLock(lockPath) {
|
|
10051
10071
|
const lock = await readJsonIfExists(lockPath);
|
package/package.json
CHANGED