searchsocket 0.4.0 → 0.5.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 +49 -31
- package/dist/cli.js +634 -1326
- package/dist/client.cjs +41 -117
- package/dist/client.d.cts +3 -17
- package/dist/client.d.ts +3 -17
- package/dist/client.js +41 -117
- package/dist/index.cjs +608 -1398
- package/dist/index.d.cts +73 -35
- package/dist/index.d.ts +73 -35
- package/dist/index.js +605 -1392
- package/dist/plugin-B_npJSux.d.cts +36 -0
- package/dist/plugin-M-aW0ev6.d.ts +36 -0
- package/dist/scroll.cjs +185 -0
- package/dist/scroll.d.cts +42 -0
- package/dist/scroll.d.ts +42 -0
- package/dist/scroll.js +183 -0
- package/dist/sveltekit.cjs +781 -1278
- package/dist/sveltekit.d.cts +3 -43
- package/dist/sveltekit.d.ts +3 -43
- package/dist/sveltekit.js +779 -1276
- package/dist/{types-z2dw3H6E.d.cts → types-Dk43uz25.d.cts} +46 -141
- package/dist/{types-z2dw3H6E.d.ts → types-Dk43uz25.d.ts} +46 -141
- package/package.json +10 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { R as ResolvedSearchSocketConfig,
|
|
2
|
-
export { C as Chunk
|
|
3
|
-
|
|
4
|
-
export {
|
|
1
|
+
import { R as ResolvedSearchSocketConfig, c as SearchSocketConfig, d as Scope, V as VectorHit, P as PageHit, e as ScopeInfo, f as PageRecord, I as IndexOptions, g as IndexStats, S as SearchRequest, a as SearchResponse } from './types-Dk43uz25.cjs';
|
|
2
|
+
export { C as Chunk } from './types-Dk43uz25.cjs';
|
|
3
|
+
import { Search } from '@upstash/search';
|
|
4
|
+
export { s as searchsocketHandle, b as searchsocketVitePlugin } from './plugin-B_npJSux.cjs';
|
|
5
|
+
export { createSearchClient } from './client.cjs';
|
|
5
6
|
|
|
6
7
|
interface LoadConfigOptions {
|
|
7
8
|
cwd?: string;
|
|
@@ -28,26 +29,71 @@ declare function isServerless(): boolean;
|
|
|
28
29
|
|
|
29
30
|
declare function resolveScope(config: ResolvedSearchSocketConfig, override?: string): Scope;
|
|
30
31
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
/** Content fields stored in Upstash Search (indexed and searchable) */
|
|
33
|
+
interface ChunkContent {
|
|
34
|
+
title: string;
|
|
35
|
+
sectionTitle: string;
|
|
36
|
+
text: string;
|
|
37
|
+
url: string;
|
|
38
|
+
tags: string;
|
|
39
|
+
headingPath: string;
|
|
40
|
+
[key: string]: unknown;
|
|
41
|
+
}
|
|
42
|
+
/** Metadata fields stored in Upstash Search (returned but not searchable) */
|
|
43
|
+
interface ChunkMetadata {
|
|
44
|
+
projectId: string;
|
|
45
|
+
scopeName: string;
|
|
46
|
+
path: string;
|
|
47
|
+
snippet: string;
|
|
48
|
+
ordinal: number;
|
|
49
|
+
contentHash: string;
|
|
50
|
+
depth: number;
|
|
51
|
+
incomingLinks: number;
|
|
52
|
+
routeFile: string;
|
|
53
|
+
description: string;
|
|
54
|
+
keywords: string;
|
|
55
|
+
[key: string]: unknown;
|
|
37
56
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
57
|
+
interface UpstashSearchStoreOptions {
|
|
58
|
+
client: Search;
|
|
59
|
+
}
|
|
60
|
+
declare class UpstashSearchStore {
|
|
61
|
+
private readonly client;
|
|
62
|
+
constructor(opts: UpstashSearchStoreOptions);
|
|
63
|
+
private chunkIndex;
|
|
64
|
+
private pageIndex;
|
|
65
|
+
upsertChunks(chunks: Array<{
|
|
44
66
|
id: string;
|
|
45
|
-
|
|
46
|
-
|
|
67
|
+
content: ChunkContent;
|
|
68
|
+
metadata: ChunkMetadata;
|
|
69
|
+
}>, scope: Scope): Promise<void>;
|
|
70
|
+
search(query: string, opts: {
|
|
71
|
+
limit: number;
|
|
72
|
+
semanticWeight?: number;
|
|
73
|
+
inputEnrichment?: boolean;
|
|
74
|
+
reranking?: boolean;
|
|
75
|
+
filter?: string;
|
|
76
|
+
}, scope: Scope): Promise<VectorHit[]>;
|
|
77
|
+
searchPages(query: string, opts: {
|
|
78
|
+
limit: number;
|
|
79
|
+
semanticWeight?: number;
|
|
80
|
+
inputEnrichment?: boolean;
|
|
81
|
+
filter?: string;
|
|
82
|
+
}, scope: Scope): Promise<PageHit[]>;
|
|
83
|
+
deleteByIds(ids: string[], scope: Scope): Promise<void>;
|
|
84
|
+
deleteScope(scope: Scope): Promise<void>;
|
|
85
|
+
listScopes(projectId: string): Promise<ScopeInfo[]>;
|
|
86
|
+
getContentHashes(scope: Scope): Promise<Map<string, string>>;
|
|
87
|
+
upsertPages(pages: PageRecord[], scope: Scope): Promise<void>;
|
|
88
|
+
getPage(url: string, scope: Scope): Promise<PageRecord | null>;
|
|
89
|
+
deletePages(scope: Scope): Promise<void>;
|
|
90
|
+
health(): Promise<{
|
|
91
|
+
ok: boolean;
|
|
92
|
+
details?: string;
|
|
93
|
+
}>;
|
|
94
|
+
dropAllIndexes(projectId: string): Promise<void>;
|
|
47
95
|
}
|
|
48
96
|
|
|
49
|
-
declare function createReranker(config: ResolvedSearchSocketConfig): Reranker | null;
|
|
50
|
-
|
|
51
97
|
interface LoggerOptions {
|
|
52
98
|
json?: boolean;
|
|
53
99
|
verbose?: boolean;
|
|
@@ -74,15 +120,13 @@ interface IndexPipelineOptions {
|
|
|
74
120
|
cwd?: string;
|
|
75
121
|
configPath?: string;
|
|
76
122
|
config?: ResolvedSearchSocketConfig;
|
|
77
|
-
|
|
78
|
-
vectorStore?: VectorStore;
|
|
123
|
+
store?: UpstashSearchStore;
|
|
79
124
|
logger?: Logger;
|
|
80
125
|
}
|
|
81
126
|
declare class IndexPipeline {
|
|
82
127
|
private readonly cwd;
|
|
83
128
|
private readonly config;
|
|
84
|
-
private readonly
|
|
85
|
-
private readonly vectorStore;
|
|
129
|
+
private readonly store;
|
|
86
130
|
private readonly logger;
|
|
87
131
|
private constructor();
|
|
88
132
|
static create(options?: IndexPipelineOptions): Promise<IndexPipeline>;
|
|
@@ -94,21 +138,17 @@ interface SearchEngineOptions {
|
|
|
94
138
|
cwd?: string;
|
|
95
139
|
configPath?: string;
|
|
96
140
|
config?: ResolvedSearchSocketConfig;
|
|
97
|
-
|
|
98
|
-
vectorStore?: VectorStore;
|
|
99
|
-
reranker?: Reranker | null;
|
|
141
|
+
store?: UpstashSearchStore;
|
|
100
142
|
}
|
|
101
143
|
declare class SearchEngine {
|
|
102
144
|
private readonly cwd;
|
|
103
145
|
private readonly config;
|
|
104
|
-
private readonly
|
|
105
|
-
private readonly vectorStore;
|
|
106
|
-
private readonly reranker;
|
|
146
|
+
private readonly store;
|
|
107
147
|
private constructor();
|
|
108
148
|
static create(options?: SearchEngineOptions): Promise<SearchEngine>;
|
|
109
149
|
getConfig(): ResolvedSearchSocketConfig;
|
|
110
150
|
search(request: SearchRequest): Promise<SearchResponse>;
|
|
111
|
-
|
|
151
|
+
private ensureSnippet;
|
|
112
152
|
private buildResults;
|
|
113
153
|
getPage(pathOrUrl: string, scope?: string): Promise<{
|
|
114
154
|
url: string;
|
|
@@ -120,11 +160,9 @@ declare class SearchEngine {
|
|
|
120
160
|
details?: string;
|
|
121
161
|
}>;
|
|
122
162
|
private resolveInputPath;
|
|
123
|
-
private assertModelCompatibility;
|
|
124
|
-
private rerankHits;
|
|
125
163
|
}
|
|
126
164
|
|
|
127
|
-
declare function
|
|
165
|
+
declare function createUpstashStore(config: ResolvedSearchSocketConfig): Promise<UpstashSearchStore>;
|
|
128
166
|
|
|
129
167
|
interface McpServerOptions {
|
|
130
168
|
cwd?: string;
|
|
@@ -135,4 +173,4 @@ interface McpServerOptions {
|
|
|
135
173
|
}
|
|
136
174
|
declare function runMcpServer(options?: McpServerOptions): Promise<void>;
|
|
137
175
|
|
|
138
|
-
export {
|
|
176
|
+
export { IndexOptions, IndexPipeline, IndexStats, ResolvedSearchSocketConfig, Scope, SearchEngine, SearchRequest, SearchResponse, SearchSocketConfig, UpstashSearchStore, VectorHit, createUpstashStore, isServerless, loadConfig, mergeConfig, mergeConfigServerless, resolveScope, runMcpServer };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { R as ResolvedSearchSocketConfig,
|
|
2
|
-
export { C as Chunk
|
|
3
|
-
|
|
4
|
-
export {
|
|
1
|
+
import { R as ResolvedSearchSocketConfig, c as SearchSocketConfig, d as Scope, V as VectorHit, P as PageHit, e as ScopeInfo, f as PageRecord, I as IndexOptions, g as IndexStats, S as SearchRequest, a as SearchResponse } from './types-Dk43uz25.js';
|
|
2
|
+
export { C as Chunk } from './types-Dk43uz25.js';
|
|
3
|
+
import { Search } from '@upstash/search';
|
|
4
|
+
export { s as searchsocketHandle, b as searchsocketVitePlugin } from './plugin-M-aW0ev6.js';
|
|
5
|
+
export { createSearchClient } from './client.js';
|
|
5
6
|
|
|
6
7
|
interface LoadConfigOptions {
|
|
7
8
|
cwd?: string;
|
|
@@ -28,26 +29,71 @@ declare function isServerless(): boolean;
|
|
|
28
29
|
|
|
29
30
|
declare function resolveScope(config: ResolvedSearchSocketConfig, override?: string): Scope;
|
|
30
31
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
/** Content fields stored in Upstash Search (indexed and searchable) */
|
|
33
|
+
interface ChunkContent {
|
|
34
|
+
title: string;
|
|
35
|
+
sectionTitle: string;
|
|
36
|
+
text: string;
|
|
37
|
+
url: string;
|
|
38
|
+
tags: string;
|
|
39
|
+
headingPath: string;
|
|
40
|
+
[key: string]: unknown;
|
|
41
|
+
}
|
|
42
|
+
/** Metadata fields stored in Upstash Search (returned but not searchable) */
|
|
43
|
+
interface ChunkMetadata {
|
|
44
|
+
projectId: string;
|
|
45
|
+
scopeName: string;
|
|
46
|
+
path: string;
|
|
47
|
+
snippet: string;
|
|
48
|
+
ordinal: number;
|
|
49
|
+
contentHash: string;
|
|
50
|
+
depth: number;
|
|
51
|
+
incomingLinks: number;
|
|
52
|
+
routeFile: string;
|
|
53
|
+
description: string;
|
|
54
|
+
keywords: string;
|
|
55
|
+
[key: string]: unknown;
|
|
37
56
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
57
|
+
interface UpstashSearchStoreOptions {
|
|
58
|
+
client: Search;
|
|
59
|
+
}
|
|
60
|
+
declare class UpstashSearchStore {
|
|
61
|
+
private readonly client;
|
|
62
|
+
constructor(opts: UpstashSearchStoreOptions);
|
|
63
|
+
private chunkIndex;
|
|
64
|
+
private pageIndex;
|
|
65
|
+
upsertChunks(chunks: Array<{
|
|
44
66
|
id: string;
|
|
45
|
-
|
|
46
|
-
|
|
67
|
+
content: ChunkContent;
|
|
68
|
+
metadata: ChunkMetadata;
|
|
69
|
+
}>, scope: Scope): Promise<void>;
|
|
70
|
+
search(query: string, opts: {
|
|
71
|
+
limit: number;
|
|
72
|
+
semanticWeight?: number;
|
|
73
|
+
inputEnrichment?: boolean;
|
|
74
|
+
reranking?: boolean;
|
|
75
|
+
filter?: string;
|
|
76
|
+
}, scope: Scope): Promise<VectorHit[]>;
|
|
77
|
+
searchPages(query: string, opts: {
|
|
78
|
+
limit: number;
|
|
79
|
+
semanticWeight?: number;
|
|
80
|
+
inputEnrichment?: boolean;
|
|
81
|
+
filter?: string;
|
|
82
|
+
}, scope: Scope): Promise<PageHit[]>;
|
|
83
|
+
deleteByIds(ids: string[], scope: Scope): Promise<void>;
|
|
84
|
+
deleteScope(scope: Scope): Promise<void>;
|
|
85
|
+
listScopes(projectId: string): Promise<ScopeInfo[]>;
|
|
86
|
+
getContentHashes(scope: Scope): Promise<Map<string, string>>;
|
|
87
|
+
upsertPages(pages: PageRecord[], scope: Scope): Promise<void>;
|
|
88
|
+
getPage(url: string, scope: Scope): Promise<PageRecord | null>;
|
|
89
|
+
deletePages(scope: Scope): Promise<void>;
|
|
90
|
+
health(): Promise<{
|
|
91
|
+
ok: boolean;
|
|
92
|
+
details?: string;
|
|
93
|
+
}>;
|
|
94
|
+
dropAllIndexes(projectId: string): Promise<void>;
|
|
47
95
|
}
|
|
48
96
|
|
|
49
|
-
declare function createReranker(config: ResolvedSearchSocketConfig): Reranker | null;
|
|
50
|
-
|
|
51
97
|
interface LoggerOptions {
|
|
52
98
|
json?: boolean;
|
|
53
99
|
verbose?: boolean;
|
|
@@ -74,15 +120,13 @@ interface IndexPipelineOptions {
|
|
|
74
120
|
cwd?: string;
|
|
75
121
|
configPath?: string;
|
|
76
122
|
config?: ResolvedSearchSocketConfig;
|
|
77
|
-
|
|
78
|
-
vectorStore?: VectorStore;
|
|
123
|
+
store?: UpstashSearchStore;
|
|
79
124
|
logger?: Logger;
|
|
80
125
|
}
|
|
81
126
|
declare class IndexPipeline {
|
|
82
127
|
private readonly cwd;
|
|
83
128
|
private readonly config;
|
|
84
|
-
private readonly
|
|
85
|
-
private readonly vectorStore;
|
|
129
|
+
private readonly store;
|
|
86
130
|
private readonly logger;
|
|
87
131
|
private constructor();
|
|
88
132
|
static create(options?: IndexPipelineOptions): Promise<IndexPipeline>;
|
|
@@ -94,21 +138,17 @@ interface SearchEngineOptions {
|
|
|
94
138
|
cwd?: string;
|
|
95
139
|
configPath?: string;
|
|
96
140
|
config?: ResolvedSearchSocketConfig;
|
|
97
|
-
|
|
98
|
-
vectorStore?: VectorStore;
|
|
99
|
-
reranker?: Reranker | null;
|
|
141
|
+
store?: UpstashSearchStore;
|
|
100
142
|
}
|
|
101
143
|
declare class SearchEngine {
|
|
102
144
|
private readonly cwd;
|
|
103
145
|
private readonly config;
|
|
104
|
-
private readonly
|
|
105
|
-
private readonly vectorStore;
|
|
106
|
-
private readonly reranker;
|
|
146
|
+
private readonly store;
|
|
107
147
|
private constructor();
|
|
108
148
|
static create(options?: SearchEngineOptions): Promise<SearchEngine>;
|
|
109
149
|
getConfig(): ResolvedSearchSocketConfig;
|
|
110
150
|
search(request: SearchRequest): Promise<SearchResponse>;
|
|
111
|
-
|
|
151
|
+
private ensureSnippet;
|
|
112
152
|
private buildResults;
|
|
113
153
|
getPage(pathOrUrl: string, scope?: string): Promise<{
|
|
114
154
|
url: string;
|
|
@@ -120,11 +160,9 @@ declare class SearchEngine {
|
|
|
120
160
|
details?: string;
|
|
121
161
|
}>;
|
|
122
162
|
private resolveInputPath;
|
|
123
|
-
private assertModelCompatibility;
|
|
124
|
-
private rerankHits;
|
|
125
163
|
}
|
|
126
164
|
|
|
127
|
-
declare function
|
|
165
|
+
declare function createUpstashStore(config: ResolvedSearchSocketConfig): Promise<UpstashSearchStore>;
|
|
128
166
|
|
|
129
167
|
interface McpServerOptions {
|
|
130
168
|
cwd?: string;
|
|
@@ -135,4 +173,4 @@ interface McpServerOptions {
|
|
|
135
173
|
}
|
|
136
174
|
declare function runMcpServer(options?: McpServerOptions): Promise<void>;
|
|
137
175
|
|
|
138
|
-
export {
|
|
176
|
+
export { IndexOptions, IndexPipeline, IndexStats, ResolvedSearchSocketConfig, Scope, SearchEngine, SearchRequest, SearchResponse, SearchSocketConfig, UpstashSearchStore, VectorHit, createUpstashStore, isServerless, loadConfig, mergeConfig, mergeConfigServerless, resolveScope, runMcpServer };
|