@yhong91/vibetime 0.1.9 → 0.1.11
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 +19 -1
- 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.11" : "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;
|
|
@@ -1701,6 +1701,20 @@ function usageMetadataFromGenerator(item) {
|
|
|
1701
1701
|
occurredAt: Number.isFinite(occurredAt) ? occurredAt : null
|
|
1702
1702
|
};
|
|
1703
1703
|
}
|
|
1704
|
+
async function readAgyModelSetting(filePath) {
|
|
1705
|
+
const settingsPath = path4.resolve(path4.dirname(filePath), "../../../..", "settings.json");
|
|
1706
|
+
try {
|
|
1707
|
+
const [text, info] = await Promise.all([
|
|
1708
|
+
readFile2(settingsPath, "utf8"),
|
|
1709
|
+
stat2(settingsPath)
|
|
1710
|
+
]);
|
|
1711
|
+
const configured = JSON.parse(text)?.model;
|
|
1712
|
+
const model = typeof configured === "string" ? resolveModelName(configured) : null;
|
|
1713
|
+
return model ? { model, changedAt: info.mtimeMs } : null;
|
|
1714
|
+
} catch {
|
|
1715
|
+
return null;
|
|
1716
|
+
}
|
|
1717
|
+
}
|
|
1704
1718
|
function extractProjectContext(rawLines) {
|
|
1705
1719
|
let cwd;
|
|
1706
1720
|
let project;
|
|
@@ -1775,6 +1789,7 @@ async function parseAgySessionFile(filePath, options) {
|
|
|
1775
1789
|
}
|
|
1776
1790
|
const { cwd: detectedCwd, project: detectedProject } = extractProjectContext(rawEvents);
|
|
1777
1791
|
const sessionId = getSessionId(filePath);
|
|
1792
|
+
const modelSetting = await readAgyModelSetting(filePath);
|
|
1778
1793
|
let generatorMetadata = options?.mockTrajectoryMetadata || await getTrajectoryGeneratorMetadata(sessionId).catch(() => null);
|
|
1779
1794
|
const cacheDir = path4.join(path4.dirname(path4.dirname(filePath)), "cache");
|
|
1780
1795
|
const cacheFile = path4.join(cacheDir, "trajectory_metadata.json");
|
|
@@ -1865,6 +1880,9 @@ async function parseAgySessionFile(filePath, options) {
|
|
|
1865
1880
|
if (!ts) {
|
|
1866
1881
|
continue;
|
|
1867
1882
|
}
|
|
1883
|
+
if (modelSetting && Date.parse(ts) >= modelSetting.changedAt) {
|
|
1884
|
+
model = modelSetting.model;
|
|
1885
|
+
}
|
|
1868
1886
|
state.ensureSessionStarted(ts, lineNumber, raw.type);
|
|
1869
1887
|
if (raw.type === "USER_INPUT") {
|
|
1870
1888
|
const content = stringField(raw, "content") || "";
|
package/package.json
CHANGED