Skip to main content

seyk_core/
lib.rs

1//! Search, caching and verified evidence, independent of any concrete embedding backend.
2//!
3//! With `pdf`, applications installing a `log` logger MUST filter `pdf_extract`
4//! to Off. With `pdf-render`, also filter `hayro_interpret`, `hayro_syntax` and
5//! `hayro_font` to Off: upstream diagnostics can contain document bytes. This crate installs
6//! no logger. PDF panics become errors via catch_unwind. A permanent dispatcher is
7//! installed lazily once; RAII guards suppress and record parser panics only on
8//! the parsing thread, delegating other threads to the captured previous hook.
9//! Later external hooks replace it and may print; Seyk never removes or overwrites them.
10//! First installation is deferred during unwinding, so that parse may also print.
11//! With `audio`, Symphonia probe, construction, packet reads and decode panics
12//! likewise become payload-free `UnsupportedAudio` errors; applications must use
13//! a payload-free panic hook for audio. ALAC frame allocations are checked before construction.
14//! Unwinding does not contain aborts, OOM, hangs or excessive parser allocations.
15
16pub mod cache;
17pub mod discovery;
18pub mod embedder {
19    pub use seyk_embed::*;
20}
21mod embedding;
22mod engine;
23mod error;
24pub mod extractor;
25mod lexical_engine;
26#[cfg(feature = "pdf")]
27pub mod pdf;
28#[cfg(feature = "pdf")]
29pub use pdf::PdfTextExtractor;
30pub mod index;
31pub mod lexical;
32#[cfg(unix)]
33pub mod local_content;
34#[cfg(unix)]
35mod pinned_dir;
36mod progress;
37pub mod provider;
38mod resource;
39pub use progress::{IndexProgress, KindProgress};
40pub mod segment;
41#[cfg(feature = "watch")]
42pub mod watch;
43
44pub use cache::{
45    CacheImportMapping, CacheImportReport, CacheStats, EmbeddingCache, MemoryCache, ResourceWrite,
46    SegmentWrite, SqliteCache,
47};
48pub use discovery::DiscoveryOptions;
49pub use embedder::{Embedder, ModelIdentity, ResourceInput};
50pub use embedding::{Dimension, Embedding};
51pub use engine::{
52    DegradedMode, DegradedReason, ImageScan, IndexReport, IndexRequest, MatchReason, MatchSignals,
53    PageDiagnostic, ProgressEvent, ProgressFn, SearchDegradation, SearchEngine,
54    SearchEngineBuilder, SearchHit, SearchMode, SearchRequest, SearchResults, SearchStats,
55    SkipCode, SkippedCount, SkippedResource, SyncStats, expand_tilde, make_preview,
56};
57pub use error::{Error, Result};
58pub use resource::{PDF_TEXT_VERSION, ResourceId, ResourceLocator, ResourceMetadata};
59pub use seyk_embed::{EmbeddingRequest, EmbeddingTask, Modality};
60
61pub use provider::{
62    FsProvider, ProvidedResource, ResourceListing, ResourceProvider, ResourceScope, ResourceVersion,
63};
64
65pub use extractor::{ExtractedContent, Extractor, TextExtractor, extract_resource};
66
67#[cfg(feature = "audio")]
68pub mod audio;
69
70mod cache_guards;
71
72#[cfg(all(feature = "test-support", debug_assertions))]
73pub use engine::LeaseEvent;