chat-logbook 0.7.0 → 0.7.1
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/api/dist/index.js +16 -21
- package/package.json +1 -1
package/api/dist/index.js
CHANGED
|
@@ -10795,7 +10795,7 @@ var ClaudeCodePlugin = class {
|
|
|
10795
10795
|
if (!file.isFile() || !file.name.endsWith(".jsonl")) continue;
|
|
10796
10796
|
const sourcePath = path3.join(projectPath, file.name);
|
|
10797
10797
|
const sessionId = file.name.replace(/\.jsonl$/, "");
|
|
10798
|
-
const cwd = readCwdFromJsonl(sourcePath);
|
|
10798
|
+
const cwd = await readCwdFromJsonl(sourcePath);
|
|
10799
10799
|
yield {
|
|
10800
10800
|
sessionId,
|
|
10801
10801
|
sourcePath,
|
|
@@ -10854,33 +10854,28 @@ var ClaudeCodePlugin = class {
|
|
|
10854
10854
|
return null;
|
|
10855
10855
|
}
|
|
10856
10856
|
};
|
|
10857
|
-
function readCwdFromJsonl(sourcePath) {
|
|
10858
|
-
let fd;
|
|
10857
|
+
async function readCwdFromJsonl(sourcePath) {
|
|
10859
10858
|
try {
|
|
10860
|
-
|
|
10861
|
-
const
|
|
10862
|
-
|
|
10863
|
-
|
|
10864
|
-
|
|
10865
|
-
|
|
10866
|
-
|
|
10867
|
-
|
|
10868
|
-
|
|
10869
|
-
|
|
10859
|
+
const stream = fs5.createReadStream(sourcePath, { encoding: "utf-8" });
|
|
10860
|
+
const rl = readline.createInterface({ input: stream, crlfDelay: Infinity });
|
|
10861
|
+
try {
|
|
10862
|
+
for await (const line of rl) {
|
|
10863
|
+
if (!line) continue;
|
|
10864
|
+
let obj;
|
|
10865
|
+
try {
|
|
10866
|
+
obj = JSON.parse(line);
|
|
10867
|
+
} catch {
|
|
10868
|
+
continue;
|
|
10869
|
+
}
|
|
10870
10870
|
if (typeof obj.cwd === "string" && obj.cwd.length > 0) {
|
|
10871
10871
|
return obj.cwd;
|
|
10872
10872
|
}
|
|
10873
|
-
} catch {
|
|
10874
10873
|
}
|
|
10874
|
+
} finally {
|
|
10875
|
+
rl.close();
|
|
10876
|
+
stream.destroy();
|
|
10875
10877
|
}
|
|
10876
10878
|
} catch {
|
|
10877
|
-
} finally {
|
|
10878
|
-
if (fd !== void 0) {
|
|
10879
|
-
try {
|
|
10880
|
-
fs5.closeSync(fd);
|
|
10881
|
-
} catch {
|
|
10882
|
-
}
|
|
10883
|
-
}
|
|
10884
10879
|
}
|
|
10885
10880
|
return void 0;
|
|
10886
10881
|
}
|