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.
Files changed (2) hide show
  1. package/api/dist/index.js +16 -21
  2. 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
- fd = fs5.openSync(sourcePath, "r");
10861
- const buf = Buffer.alloc(64 * 1024);
10862
- const n = fs5.readSync(fd, buf, 0, buf.length, 0);
10863
- const head = buf.subarray(0, n).toString("utf-8");
10864
- const lines = head.split("\n");
10865
- if (n === buf.length) lines.pop();
10866
- for (const line of lines) {
10867
- if (!line) continue;
10868
- try {
10869
- const obj = JSON.parse(line);
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chat-logbook",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "A local-first conversation manager for Claude Code",
5
5
  "license": "AGPL-3.0-only",
6
6
  "type": "module",