@waniwani/sdk 0.10.2 → 0.10.3-beta.1
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/chat/next-js/index.d.ts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/mcp/index.d.ts +76 -4
- package/dist/mcp/index.js +5 -5
- package/dist/mcp/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/kb/index.d.ts +0 -84
package/package.json
CHANGED
package/dist/kb/index.d.ts
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
interface SearchResult {
|
|
2
|
-
source: string;
|
|
3
|
-
heading: string;
|
|
4
|
-
content: string;
|
|
5
|
-
score: number;
|
|
6
|
-
metadata?: Record<string, string>;
|
|
7
|
-
}
|
|
8
|
-
/** A file to ingest into the knowledge base */
|
|
9
|
-
interface KbIngestFile {
|
|
10
|
-
/** Filename (used as chunk source identifier) */
|
|
11
|
-
filename: string;
|
|
12
|
-
/** Markdown content of the file */
|
|
13
|
-
content: string;
|
|
14
|
-
/** Arbitrary key-value metadata attached to all chunks from this file */
|
|
15
|
-
metadata?: Record<string, string>;
|
|
16
|
-
}
|
|
17
|
-
/** Response from the ingest endpoint */
|
|
18
|
-
interface KbIngestResult {
|
|
19
|
-
/** Number of chunks created from the ingested files */
|
|
20
|
-
chunksIngested: number;
|
|
21
|
-
/** Number of files successfully processed */
|
|
22
|
-
filesProcessed: number;
|
|
23
|
-
}
|
|
24
|
-
/** Options for the search method */
|
|
25
|
-
interface KbSearchOptions {
|
|
26
|
-
/** Number of results to return (1-20, default 5) */
|
|
27
|
-
topK?: number;
|
|
28
|
-
/** Minimum similarity score threshold (0-1, default 0.3) */
|
|
29
|
-
minScore?: number;
|
|
30
|
-
/** Filter results to chunks whose metadata contains all these key-value pairs (exact match) */
|
|
31
|
-
metadata?: Record<string, string>;
|
|
32
|
-
}
|
|
33
|
-
/** A source entry in the knowledge base */
|
|
34
|
-
interface KbSource {
|
|
35
|
-
/** Source filename */
|
|
36
|
-
source: string;
|
|
37
|
-
/** Number of chunks from this source */
|
|
38
|
-
chunkCount: number;
|
|
39
|
-
/** ISO timestamp of when the source was first ingested */
|
|
40
|
-
createdAt: string;
|
|
41
|
-
}
|
|
42
|
-
/** KB client for server-side knowledge base operations */
|
|
43
|
-
interface KbClient {
|
|
44
|
-
/**
|
|
45
|
-
* Ingest files into the knowledge base.
|
|
46
|
-
*
|
|
47
|
-
* **Warning**: This is destructive — it deletes ALL existing chunks
|
|
48
|
-
* for the environment before ingesting the new files.
|
|
49
|
-
*/
|
|
50
|
-
ingest(files: KbIngestFile[]): Promise<KbIngestResult>;
|
|
51
|
-
/** Search the knowledge base for relevant chunks */
|
|
52
|
-
search(query: string, options?: KbSearchOptions): Promise<SearchResult[]>;
|
|
53
|
-
/** List all sources in the knowledge base */
|
|
54
|
-
sources(): Promise<KbSource[]>;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
interface TrackingConfig {
|
|
58
|
-
/** Events API V2 endpoint path. */
|
|
59
|
-
endpointPath?: string;
|
|
60
|
-
/** Periodic flush interval for buffered events. */
|
|
61
|
-
flushIntervalMs?: number;
|
|
62
|
-
/** Max events per HTTP batch send. */
|
|
63
|
-
maxBatchSize?: number;
|
|
64
|
-
/** Max in-memory buffer size before oldest items are dropped. */
|
|
65
|
-
maxBufferSize?: number;
|
|
66
|
-
/** Number of retries for retryable failures. */
|
|
67
|
-
maxRetries?: number;
|
|
68
|
-
/** Retry backoff base delay. */
|
|
69
|
-
retryBaseDelayMs?: number;
|
|
70
|
-
/** Retry backoff max delay. */
|
|
71
|
-
retryMaxDelayMs?: number;
|
|
72
|
-
/** Default shutdown timeout when none is provided. */
|
|
73
|
-
shutdownTimeoutMs?: number;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
interface InternalConfig {
|
|
77
|
-
apiUrl: string;
|
|
78
|
-
apiKey: string | undefined;
|
|
79
|
-
tracking: Required<TrackingConfig>;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
declare function createKbClient(config: InternalConfig): KbClient;
|
|
83
|
-
|
|
84
|
-
export { type KbClient, type KbIngestFile, type KbIngestResult, type KbSearchOptions, type KbSource, type SearchResult, createKbClient };
|