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.
- package/README.md +8 -8
- package/dist/cli.js +456 -187
- package/dist/client.cjs +121 -0
- package/dist/client.d.cts +17 -2
- package/dist/client.d.ts +17 -2
- package/dist/client.js +121 -1
- package/dist/index.cjs +590 -169
- package/dist/index.d.cts +6 -4
- package/dist/index.d.ts +6 -4
- package/dist/index.js +590 -170
- package/dist/sveltekit.cjs +380 -82
- package/dist/sveltekit.d.cts +1 -1
- package/dist/sveltekit.d.ts +1 -1
- package/dist/sveltekit.js +380 -82
- package/dist/{types-BrG6XTUU.d.cts → types-z2dw3H6E.d.cts} +37 -1
- package/dist/{types-BrG6XTUU.d.ts → types-z2dw3H6E.d.ts} +37 -1
- package/package.json +1 -1
|
@@ -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,
|
|
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,
|
|
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 };
|