@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.cjs CHANGED
@@ -3522,7 +3522,8 @@ var ConversationScanner = class {
3522
3522
  // feeds the conversation's account field; "default" is the single-profile
3523
3523
  // fallback, matching refreshFile.
3524
3524
  async parseSingleFilePage(filePath, account, options) {
3525
- const conversation = await parseConversation(filePath, account ?? "default");
3525
+ const provider = await this.resolveProviderForFile(filePath, null);
3526
+ const conversation = provider?.name === CODEX_CLI_PROVIDER ? await parseCodexConversation(filePath, account ?? "default") : await parseConversation(filePath, account ?? "default");
3526
3527
  if (!conversation) return null;
3527
3528
  const { messages } = conversation;
3528
3529
  const total = messages.length;
@@ -3566,7 +3567,7 @@ var ConversationScanner = class {
3566
3567
  const engine = this.engine();
3567
3568
  const previous2 = engine.getByIdOrSession(filePath);
3568
3569
  const resolvedAccount2 = account ?? previous2?.account ?? "default";
3569
- const provider = await this.resolveProviderForFile(filePath, previous2);
3570
+ const provider2 = await this.resolveProviderForFile(filePath, previous2);
3570
3571
  const { meta: meta2, change } = await engine.indexFile(
3571
3572
  filePath,
3572
3573
  resolvedAccount2,
@@ -3574,7 +3575,7 @@ var ConversationScanner = class {
3574
3575
  void 0,
3575
3576
  readGitBranch,
3576
3577
  false,
3577
- provider
3578
+ provider2
3578
3579
  );
3579
3580
  const cacheKeys = /* @__PURE__ */ new Set();
3580
3581
  for (const m of [previous2, meta2]) {
@@ -3595,10 +3596,12 @@ var ConversationScanner = class {
3595
3596
  const resolvedAccount = account ?? previous?.account ?? "default";
3596
3597
  let meta = null;
3597
3598
  let searchDoc = emptySearchDocument();
3599
+ const onEntry = (entry) => {
3600
+ searchDoc = appendSearchDelta(searchDoc, extractSearchDelta(entry));
3601
+ };
3602
+ const provider = await this.resolveProviderForFile(filePath, previous ?? null);
3598
3603
  try {
3599
- meta = await parseMeta(filePath, resolvedAccount, this.lastTier, (entry) => {
3600
- searchDoc = appendSearchDelta(searchDoc, extractSearchDelta(entry));
3601
- });
3604
+ meta = provider ? await parseMetaWithProvider(provider, filePath, resolvedAccount, this.lastTier, onEntry) : await parseMeta(filePath, resolvedAccount, this.lastTier, onEntry);
3602
3605
  } catch (err) {
3603
3606
  log.warn({ filePath, err }, "refreshFile: parseMeta threw");
3604
3607
  meta = null;