searchsocket 0.3.2 → 0.4.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.
@@ -12,6 +12,8 @@ interface SearchSocketConfig {
12
12
  envVar?: string;
13
13
  sanitize?: boolean;
14
14
  };
15
+ exclude?: string[];
16
+ respectRobotsTxt?: boolean;
15
17
  source?: {
16
18
  mode?: SourceMode;
17
19
  staticOutputDir?: string;
@@ -132,6 +134,8 @@ interface ResolvedSearchSocketConfig {
132
134
  envVar: string;
133
135
  sanitize: boolean;
134
136
  };
137
+ exclude: string[];
138
+ respectRobotsTxt: boolean;
135
139
  source: {
136
140
  mode: SourceMode;
137
141
  staticOutputDir: string;
@@ -362,6 +366,7 @@ interface SearchRequest {
362
366
  tags?: string[];
363
367
  rerank?: boolean;
364
368
  groupBy?: "page" | "chunk";
369
+ stream?: boolean;
365
370
  }
366
371
  interface SearchResultChunk {
367
372
  sectionTitle?: string;
@@ -415,5 +420,36 @@ interface IndexOptions {
415
420
  maxChunks?: number;
416
421
  verbose?: boolean;
417
422
  }
423
+ interface StreamSearchEvent {
424
+ phase: "initial" | "reranked";
425
+ data: SearchResponse;
426
+ }
427
+ interface StreamSearchErrorEvent {
428
+ phase: "error";
429
+ data: {
430
+ error: {
431
+ code: string;
432
+ message: string;
433
+ };
434
+ };
435
+ }
436
+ type StreamEvent = StreamSearchEvent | StreamSearchErrorEvent;
437
+ interface MergeSearchOptions {
438
+ /**
439
+ * If any single result moved more than this many positions, adopt
440
+ * the reranked order. The reranker is semantic — if it strongly
441
+ * disagrees with vector similarity on even one result, trust it.
442
+ * @default 3
443
+ */
444
+ maxDisplacement?: number;
445
+ }
446
+ interface MergeSearchResult {
447
+ response: SearchResponse;
448
+ usedRerankedOrder: boolean;
449
+ displacements: Array<{
450
+ url: string;
451
+ displacement: number;
452
+ }>;
453
+ }
418
454
 
419
- export type { Chunk as C, EmbeddingsProvider as E, IndexOptions as I, QueryOpts as Q, ResolvedSearchSocketConfig as R, SearchRequest as S, VectorStore as V, SearchResponse as a, SearchSocketConfig as b, Scope as c, Reranker as d, RerankCandidate as e, IndexStats as f, VectorHit as g, VectorRecord as h };
455
+ export type { Chunk as C, EmbeddingsProvider as E, IndexOptions as I, MergeSearchOptions as M, QueryOpts as Q, ResolvedSearchSocketConfig as R, SearchResponse as S, VectorStore as V, MergeSearchResult as a, SearchRequest as b, StreamSearchEvent as c, SearchSocketConfig as d, Scope as e, Reranker as f, RerankCandidate as g, IndexStats as h, StreamEvent as i, StreamSearchErrorEvent as j, VectorHit as k, VectorRecord as l };
@@ -12,6 +12,8 @@ interface SearchSocketConfig {
12
12
  envVar?: string;
13
13
  sanitize?: boolean;
14
14
  };
15
+ exclude?: string[];
16
+ respectRobotsTxt?: boolean;
15
17
  source?: {
16
18
  mode?: SourceMode;
17
19
  staticOutputDir?: string;
@@ -132,6 +134,8 @@ interface ResolvedSearchSocketConfig {
132
134
  envVar: string;
133
135
  sanitize: boolean;
134
136
  };
137
+ exclude: string[];
138
+ respectRobotsTxt: boolean;
135
139
  source: {
136
140
  mode: SourceMode;
137
141
  staticOutputDir: string;
@@ -362,6 +366,7 @@ interface SearchRequest {
362
366
  tags?: string[];
363
367
  rerank?: boolean;
364
368
  groupBy?: "page" | "chunk";
369
+ stream?: boolean;
365
370
  }
366
371
  interface SearchResultChunk {
367
372
  sectionTitle?: string;
@@ -415,5 +420,36 @@ interface IndexOptions {
415
420
  maxChunks?: number;
416
421
  verbose?: boolean;
417
422
  }
423
+ interface StreamSearchEvent {
424
+ phase: "initial" | "reranked";
425
+ data: SearchResponse;
426
+ }
427
+ interface StreamSearchErrorEvent {
428
+ phase: "error";
429
+ data: {
430
+ error: {
431
+ code: string;
432
+ message: string;
433
+ };
434
+ };
435
+ }
436
+ type StreamEvent = StreamSearchEvent | StreamSearchErrorEvent;
437
+ interface MergeSearchOptions {
438
+ /**
439
+ * If any single result moved more than this many positions, adopt
440
+ * the reranked order. The reranker is semantic — if it strongly
441
+ * disagrees with vector similarity on even one result, trust it.
442
+ * @default 3
443
+ */
444
+ maxDisplacement?: number;
445
+ }
446
+ interface MergeSearchResult {
447
+ response: SearchResponse;
448
+ usedRerankedOrder: boolean;
449
+ displacements: Array<{
450
+ url: string;
451
+ displacement: number;
452
+ }>;
453
+ }
418
454
 
419
- export type { Chunk as C, EmbeddingsProvider as E, IndexOptions as I, QueryOpts as Q, ResolvedSearchSocketConfig as R, SearchRequest as S, VectorStore as V, SearchResponse as a, SearchSocketConfig as b, Scope as c, Reranker as d, RerankCandidate as e, IndexStats as f, VectorHit as g, VectorRecord as h };
455
+ export type { Chunk as C, EmbeddingsProvider as E, IndexOptions as I, MergeSearchOptions as M, QueryOpts as Q, ResolvedSearchSocketConfig as R, SearchResponse as S, VectorStore as V, MergeSearchResult as a, SearchRequest as b, StreamSearchEvent as c, SearchSocketConfig as d, Scope as e, Reranker as f, RerankCandidate as g, IndexStats as h, StreamEvent as i, StreamSearchErrorEvent as j, VectorHit as k, VectorRecord as l };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "searchsocket",
3
- "version": "0.3.2",
3
+ "version": "0.4.0",
4
4
  "description": "Semantic site search and MCP retrieval for SvelteKit static sites",
5
5
  "license": "MIT",
6
6
  "author": "Greg Priday <greg@siteorigin.com>",