@threadbase-sh/scanner 0.8.1 → 0.8.3

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/dist/cli.js CHANGED
@@ -5,7 +5,7 @@ import { Command } from "commander";
5
5
  import pino2 from "pino";
6
6
 
7
7
  // package.json
8
- var version = "0.8.1";
8
+ var version = "0.8.3";
9
9
 
10
10
  // src/logger.ts
11
11
  import pino from "pino";
@@ -932,7 +932,10 @@ function classify(filePath, existing) {
932
932
  }
933
933
  return { change: "unchanged", stat: stat3 };
934
934
  }
935
- return { change: "appended", stat: stat3 };
935
+ if (existing.content_fingerprint && existing.size_bytes === existing.last_indexed_offset && fingerprint(filePath, existing.last_indexed_offset) === existing.content_fingerprint) {
936
+ return { change: "appended", stat: stat3 };
937
+ }
938
+ return { change: "reindex", stat: stat3 };
936
939
  }
937
940
 
938
941
  // src/providers/codex-cli.ts
@@ -2134,6 +2137,15 @@ var PersistentEngine = class {
2134
2137
  const meta = this.conversations.getByIdOrSession(id);
2135
2138
  if (!meta) return null;
2136
2139
  const filePath = meta.filePath;
2140
+ if (meta.provider === CODEX_CLI_PROVIDER) {
2141
+ const conversation = await parseCodexConversation(filePath, meta.account);
2142
+ if (!conversation) return null;
2143
+ const { messages } = conversation;
2144
+ const total2 = messages.length;
2145
+ const beforeIndex2 = options.beforeIndex ?? total2;
2146
+ const fromIndex2 = Math.max(0, beforeIndex2 - options.limit);
2147
+ return { messages: messages.slice(fromIndex2, beforeIndex2), total: total2, fromIndex: fromIndex2 };
2148
+ }
2137
2149
  const total = this.conversations.pageMessageCount(filePath);
2138
2150
  if (total > CHECKPOINT_INTERVAL && this.checkpoints.count(filePath) === 0) {
2139
2151
  const built = await buildCheckpoints(filePath);