@threadbase-sh/scanner 0.12.4 → 0.14.0

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.d.cts CHANGED
@@ -98,9 +98,14 @@ interface SearchOptions extends ScanOptions {
98
98
  fields?: string[];
99
99
  provider?: ProviderName;
100
100
  }
101
+ interface SearchHighlight {
102
+ start: number;
103
+ end: number;
104
+ }
101
105
  interface SearchMatch {
102
106
  field: string;
103
107
  snippet: string;
108
+ highlights?: SearchHighlight[];
104
109
  }
105
110
  interface SearchResult {
106
111
  meta: ConversationMeta;
@@ -217,17 +222,19 @@ declare function readGitBranch(projectPath: string): string | null;
217
222
  declare class SearchIndexer {
218
223
  private index;
219
224
  private documents;
225
+ private searchContents;
220
226
  constructor();
221
227
  private createIndex;
222
- addDocument(meta: ConversationMeta): void;
223
- buildIndex(metas: ConversationMeta[]): void;
228
+ addDocument(meta: ConversationMeta, searchContent?: string): void;
229
+ buildIndex(metas: ConversationMeta[], searchContents?: Map<string, string>): void;
224
230
  search(query: string, options?: {
225
231
  fields?: string[];
226
232
  limit?: number;
227
233
  }): SearchResult[];
234
+ private matchesFor;
228
235
  private getRecent;
229
236
  getDocumentCount(): number;
230
- updateDocument(meta: ConversationMeta): void;
237
+ updateDocument(meta: ConversationMeta, searchContent?: string): void;
231
238
  removeDocument(id: string): void;
232
239
  clear(): void;
233
240
  }
@@ -379,6 +386,7 @@ declare class ConversationScanner {
379
386
  private sessionIdIndex;
380
387
  private projects;
381
388
  private indexer;
389
+ private searchContents;
382
390
  private lastTier;
383
391
  private readonly dbPath;
384
392
  private readonly sidecarEnabled;
@@ -437,4 +445,4 @@ declare function scan(options?: ScanOptions, scanner?: ConversationScanner): Pro
437
445
  declare function search(query: string, options?: SearchOptions, scanner?: ConversationScanner): Promise<SearchResult[]>;
438
446
  declare function getConversation(id: string, options?: GetConversationOptions, scanner?: ConversationScanner): Promise<Conversation | null>;
439
447
 
440
- export { type AttachmentSidecar, CodexCliProvider, type ContentTier, type Conversation, type ConversationMessage, type ConversationMeta, type ConversationPage, ConversationScanner, type ConversationScannerOptions, DEFAULT_TIERS, type DeferredToolsDeltaAttachment, type DiscoveredConversationFile, type FileStatEntry, type GetConversationOptions, type GetConversationPageOptions, type GroupedConversations, type Include, type ConvReducerState as JsonlParseState, type MessageMetadata, type MessageSender, type MessageSnapshot, type PersistentConfig, type Profile, type ProviderName, type ScanOptions, type ScanResult, type ScannerChangeEvent, type ScannerProvider, type ScannerProviderName, SearchIndexer, type SearchMatch, type SearchOptions, type SearchResult, type Sidecar, type SingleFilePage, type SortOrder, type TeamInfo, ThreadbaseProvider, type ToolResultBlock, type ToolUseBlock, type TreeConversation, type TurnDuration, VALID_SORT_ORDERS, type View, type WatchOptions, applyAccountFilter, applyIncludeFilter, applyPagination, applyProjectFilter, applySinceFilter, applySort, cleanSystemTags, initialConvState as createJsonlParseState, createLogger, detectDefaultProfile, getConversation, getLogger, getProjectsDir, loadProfiles, parseJsonlLine, readGitBranch, readSidecar, resetDefaultScanner, resolveConfigDir, resolveTier, saveProfiles, scan, search, setLogger, sidecarPath };
448
+ export { type AttachmentSidecar, CodexCliProvider, type ContentTier, type Conversation, type ConversationMessage, type ConversationMeta, type ConversationPage, ConversationScanner, type ConversationScannerOptions, DEFAULT_TIERS, type DeferredToolsDeltaAttachment, type DiscoveredConversationFile, type FileStatEntry, type GetConversationOptions, type GetConversationPageOptions, type GroupedConversations, type Include, type ConvReducerState as JsonlParseState, type MessageMetadata, type MessageSender, type MessageSnapshot, type PersistentConfig, type Profile, type ProviderName, type ScanOptions, type ScanResult, type ScannerChangeEvent, type ScannerProvider, type ScannerProviderName, type SearchHighlight, SearchIndexer, type SearchMatch, type SearchOptions, type SearchResult, type Sidecar, type SingleFilePage, type SortOrder, type TeamInfo, ThreadbaseProvider, type ToolResultBlock, type ToolUseBlock, type TreeConversation, type TurnDuration, VALID_SORT_ORDERS, type View, type WatchOptions, applyAccountFilter, applyIncludeFilter, applyPagination, applyProjectFilter, applySinceFilter, applySort, cleanSystemTags, initialConvState as createJsonlParseState, createLogger, detectDefaultProfile, getConversation, getLogger, getProjectsDir, loadProfiles, parseJsonlLine, readGitBranch, readSidecar, resetDefaultScanner, resolveConfigDir, resolveTier, saveProfiles, scan, search, setLogger, sidecarPath };
package/dist/index.d.ts CHANGED
@@ -98,9 +98,14 @@ interface SearchOptions extends ScanOptions {
98
98
  fields?: string[];
99
99
  provider?: ProviderName;
100
100
  }
101
+ interface SearchHighlight {
102
+ start: number;
103
+ end: number;
104
+ }
101
105
  interface SearchMatch {
102
106
  field: string;
103
107
  snippet: string;
108
+ highlights?: SearchHighlight[];
104
109
  }
105
110
  interface SearchResult {
106
111
  meta: ConversationMeta;
@@ -217,17 +222,19 @@ declare function readGitBranch(projectPath: string): string | null;
217
222
  declare class SearchIndexer {
218
223
  private index;
219
224
  private documents;
225
+ private searchContents;
220
226
  constructor();
221
227
  private createIndex;
222
- addDocument(meta: ConversationMeta): void;
223
- buildIndex(metas: ConversationMeta[]): void;
228
+ addDocument(meta: ConversationMeta, searchContent?: string): void;
229
+ buildIndex(metas: ConversationMeta[], searchContents?: Map<string, string>): void;
224
230
  search(query: string, options?: {
225
231
  fields?: string[];
226
232
  limit?: number;
227
233
  }): SearchResult[];
234
+ private matchesFor;
228
235
  private getRecent;
229
236
  getDocumentCount(): number;
230
- updateDocument(meta: ConversationMeta): void;
237
+ updateDocument(meta: ConversationMeta, searchContent?: string): void;
231
238
  removeDocument(id: string): void;
232
239
  clear(): void;
233
240
  }
@@ -379,6 +386,7 @@ declare class ConversationScanner {
379
386
  private sessionIdIndex;
380
387
  private projects;
381
388
  private indexer;
389
+ private searchContents;
382
390
  private lastTier;
383
391
  private readonly dbPath;
384
392
  private readonly sidecarEnabled;
@@ -437,4 +445,4 @@ declare function scan(options?: ScanOptions, scanner?: ConversationScanner): Pro
437
445
  declare function search(query: string, options?: SearchOptions, scanner?: ConversationScanner): Promise<SearchResult[]>;
438
446
  declare function getConversation(id: string, options?: GetConversationOptions, scanner?: ConversationScanner): Promise<Conversation | null>;
439
447
 
440
- export { type AttachmentSidecar, CodexCliProvider, type ContentTier, type Conversation, type ConversationMessage, type ConversationMeta, type ConversationPage, ConversationScanner, type ConversationScannerOptions, DEFAULT_TIERS, type DeferredToolsDeltaAttachment, type DiscoveredConversationFile, type FileStatEntry, type GetConversationOptions, type GetConversationPageOptions, type GroupedConversations, type Include, type ConvReducerState as JsonlParseState, type MessageMetadata, type MessageSender, type MessageSnapshot, type PersistentConfig, type Profile, type ProviderName, type ScanOptions, type ScanResult, type ScannerChangeEvent, type ScannerProvider, type ScannerProviderName, SearchIndexer, type SearchMatch, type SearchOptions, type SearchResult, type Sidecar, type SingleFilePage, type SortOrder, type TeamInfo, ThreadbaseProvider, type ToolResultBlock, type ToolUseBlock, type TreeConversation, type TurnDuration, VALID_SORT_ORDERS, type View, type WatchOptions, applyAccountFilter, applyIncludeFilter, applyPagination, applyProjectFilter, applySinceFilter, applySort, cleanSystemTags, initialConvState as createJsonlParseState, createLogger, detectDefaultProfile, getConversation, getLogger, getProjectsDir, loadProfiles, parseJsonlLine, readGitBranch, readSidecar, resetDefaultScanner, resolveConfigDir, resolveTier, saveProfiles, scan, search, setLogger, sidecarPath };
448
+ export { type AttachmentSidecar, CodexCliProvider, type ContentTier, type Conversation, type ConversationMessage, type ConversationMeta, type ConversationPage, ConversationScanner, type ConversationScannerOptions, DEFAULT_TIERS, type DeferredToolsDeltaAttachment, type DiscoveredConversationFile, type FileStatEntry, type GetConversationOptions, type GetConversationPageOptions, type GroupedConversations, type Include, type ConvReducerState as JsonlParseState, type MessageMetadata, type MessageSender, type MessageSnapshot, type PersistentConfig, type Profile, type ProviderName, type ScanOptions, type ScanResult, type ScannerChangeEvent, type ScannerProvider, type ScannerProviderName, type SearchHighlight, SearchIndexer, type SearchMatch, type SearchOptions, type SearchResult, type Sidecar, type SingleFilePage, type SortOrder, type TeamInfo, ThreadbaseProvider, type ToolResultBlock, type ToolUseBlock, type TreeConversation, type TurnDuration, VALID_SORT_ORDERS, type View, type WatchOptions, applyAccountFilter, applyIncludeFilter, applyPagination, applyProjectFilter, applySinceFilter, applySort, cleanSystemTags, initialConvState as createJsonlParseState, createLogger, detectDefaultProfile, getConversation, getLogger, getProjectsDir, loadProfiles, parseJsonlLine, readGitBranch, readSidecar, resetDefaultScanner, resolveConfigDir, resolveTier, saveProfiles, scan, search, setLogger, sidecarPath };