@threadbase-sh/scanner 0.14.6 → 0.14.7

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/index.js CHANGED
@@ -3456,7 +3456,8 @@ var ConversationScanner = class {
3456
3456
  // feeds the conversation's account field; "default" is the single-profile
3457
3457
  // fallback, matching refreshFile.
3458
3458
  async parseSingleFilePage(filePath, account, options) {
3459
- const conversation = await parseConversation(filePath, account ?? "default");
3459
+ const provider = await this.resolveProviderForFile(filePath, null);
3460
+ const conversation = provider?.name === CODEX_CLI_PROVIDER ? await parseCodexConversation(filePath, account ?? "default") : await parseConversation(filePath, account ?? "default");
3460
3461
  if (!conversation) return null;
3461
3462
  const { messages } = conversation;
3462
3463
  const total = messages.length;
@@ -3500,7 +3501,7 @@ var ConversationScanner = class {
3500
3501
  const engine = this.engine();
3501
3502
  const previous2 = engine.getByIdOrSession(filePath);
3502
3503
  const resolvedAccount2 = account ?? previous2?.account ?? "default";
3503
- const provider = await this.resolveProviderForFile(filePath, previous2);
3504
+ const provider2 = await this.resolveProviderForFile(filePath, previous2);
3504
3505
  const { meta: meta2, change } = await engine.indexFile(
3505
3506
  filePath,
3506
3507
  resolvedAccount2,
@@ -3508,7 +3509,7 @@ var ConversationScanner = class {
3508
3509
  void 0,
3509
3510
  readGitBranch,
3510
3511
  false,
3511
- provider
3512
+ provider2
3512
3513
  );
3513
3514
  const cacheKeys = /* @__PURE__ */ new Set();
3514
3515
  for (const m of [previous2, meta2]) {
@@ -3529,10 +3530,12 @@ var ConversationScanner = class {
3529
3530
  const resolvedAccount = account ?? previous?.account ?? "default";
3530
3531
  let meta = null;
3531
3532
  let searchDoc = emptySearchDocument();
3533
+ const onEntry = (entry) => {
3534
+ searchDoc = appendSearchDelta(searchDoc, extractSearchDelta(entry));
3535
+ };
3536
+ const provider = await this.resolveProviderForFile(filePath, previous ?? null);
3532
3537
  try {
3533
- meta = await parseMeta(filePath, resolvedAccount, this.lastTier, (entry) => {
3534
- searchDoc = appendSearchDelta(searchDoc, extractSearchDelta(entry));
3535
- });
3538
+ meta = provider ? await parseMetaWithProvider(provider, filePath, resolvedAccount, this.lastTier, onEntry) : await parseMeta(filePath, resolvedAccount, this.lastTier, onEntry);
3536
3539
  } catch (err) {
3537
3540
  log.warn({ filePath, err }, "refreshFile: parseMeta threw");
3538
3541
  meta = null;