@copilotkit/pathfinder 1.5.0 → 1.6.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/CHANGELOG.md +23 -0
- package/LICENSE +111 -21
- package/LICENSING.md +19 -0
- package/README.md +7 -1
- package/dist/cli.js +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +8 -2
- package/dist/config.js.map +1 -1
- package/dist/db/queries.d.ts +5 -0
- package/dist/db/queries.d.ts.map +1 -1
- package/dist/db/queries.js +9 -0
- package/dist/db/queries.js.map +1 -1
- package/dist/indexing/chunking/index.js +1 -0
- package/dist/indexing/chunking/index.js.map +1 -1
- package/dist/indexing/orchestrator.d.ts.map +1 -1
- package/dist/indexing/orchestrator.js +2 -1
- package/dist/indexing/orchestrator.js.map +1 -1
- package/dist/indexing/providers/index.js +2 -0
- package/dist/indexing/providers/index.js.map +1 -1
- package/dist/indexing/providers/notion-api.d.ts +101 -0
- package/dist/indexing/providers/notion-api.d.ts.map +1 -0
- package/dist/indexing/providers/notion-api.js +419 -0
- package/dist/indexing/providers/notion-api.js.map +1 -0
- package/dist/indexing/providers/notion.d.ts +29 -0
- package/dist/indexing/providers/notion.d.ts.map +1 -0
- package/dist/indexing/providers/notion.js +236 -0
- package/dist/indexing/providers/notion.js.map +1 -0
- package/dist/indexing/providers/types.d.ts +1 -0
- package/dist/indexing/providers/types.d.ts.map +1 -1
- package/dist/types.d.ts +228 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +12 -0
- package/dist/types.js.map +1 -1
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +6 -1
- package/dist/validate.js.map +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
// NotionDataProvider — Notion page acquisition via API client.
|
|
2
|
+
// Implements DataProvider: discovers pages from root_pages, databases, or workspace search,
|
|
3
|
+
// fetches markdown content, and detects deletions during incremental acquire.
|
|
4
|
+
import { NotionApiClient } from './notion-api.js';
|
|
5
|
+
import { getIndexedItemIds } from '../../db/queries.js';
|
|
6
|
+
export class NotionDataProvider {
|
|
7
|
+
config;
|
|
8
|
+
apiClient;
|
|
9
|
+
logPrefix;
|
|
10
|
+
constructor(config, options) {
|
|
11
|
+
if (config.type !== 'notion') {
|
|
12
|
+
throw new Error('NotionDataProvider requires a notion source config');
|
|
13
|
+
}
|
|
14
|
+
this.config = config;
|
|
15
|
+
const token = options.notionToken;
|
|
16
|
+
if (!token) {
|
|
17
|
+
throw new Error('NotionDataProvider requires a notionToken in provider options');
|
|
18
|
+
}
|
|
19
|
+
this.apiClient = new NotionApiClient(token, {
|
|
20
|
+
maxDepth: this.config.max_depth,
|
|
21
|
+
});
|
|
22
|
+
this.logPrefix = `[notion-provider:${config.name}]`;
|
|
23
|
+
}
|
|
24
|
+
async fullAcquire() {
|
|
25
|
+
console.log(`${this.logPrefix} Starting full acquire`);
|
|
26
|
+
const pages = await this.discoverAllPages();
|
|
27
|
+
console.log(`${this.logPrefix} Discovered ${pages.size} page(s)`);
|
|
28
|
+
const { items, maxTime, failedCount } = await this.acquireContent(pages);
|
|
29
|
+
if (failedCount === pages.size && pages.size > 0) {
|
|
30
|
+
throw new Error(`All ${failedCount} page(s) failed during acquire`);
|
|
31
|
+
}
|
|
32
|
+
console.log(`${this.logPrefix} Full acquire complete: ${items.length} item(s)`);
|
|
33
|
+
return {
|
|
34
|
+
items,
|
|
35
|
+
removedIds: [],
|
|
36
|
+
stateToken: maxTime || new Date().toISOString(),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
async incrementalAcquire(lastStateToken) {
|
|
40
|
+
console.log(`${this.logPrefix} Starting incremental acquire since ${lastStateToken}`);
|
|
41
|
+
// Discover full page set for deletion detection
|
|
42
|
+
const allPages = await this.discoverAllPages();
|
|
43
|
+
const allPageIds = new Set(allPages.keys());
|
|
44
|
+
// Discover recently edited pages
|
|
45
|
+
const editedPages = await this.discoverEditedPages(lastStateToken);
|
|
46
|
+
// Detect deletions
|
|
47
|
+
const indexedIds = await getIndexedItemIds(this.config.name);
|
|
48
|
+
const removedIds = [];
|
|
49
|
+
for (const id of indexedIds) {
|
|
50
|
+
if (!allPageIds.has(id)) {
|
|
51
|
+
removedIds.push(id);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
// Early return if no changes
|
|
55
|
+
if (editedPages.size === 0 && removedIds.length === 0) {
|
|
56
|
+
console.log(`${this.logPrefix} No changes detected`);
|
|
57
|
+
return { items: [], removedIds: [], stateToken: lastStateToken };
|
|
58
|
+
}
|
|
59
|
+
// Acquire content only for edited pages
|
|
60
|
+
const { items, maxTime, failedCount } = await this.acquireContent(editedPages);
|
|
61
|
+
if (failedCount === editedPages.size && editedPages.size > 0) {
|
|
62
|
+
throw new Error(`All ${failedCount} page(s) failed during acquire`);
|
|
63
|
+
}
|
|
64
|
+
console.log(`${this.logPrefix} Incremental acquire complete: ${items.length} item(s), ${removedIds.length} removal(s)`);
|
|
65
|
+
return {
|
|
66
|
+
items,
|
|
67
|
+
removedIds,
|
|
68
|
+
stateToken: maxTime || lastStateToken,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
async getCurrentStateToken() {
|
|
72
|
+
const pages = await this.apiClient.searchPages();
|
|
73
|
+
if (pages.length === 0)
|
|
74
|
+
return null;
|
|
75
|
+
let maxTime = '';
|
|
76
|
+
for (const page of pages) {
|
|
77
|
+
if (page.lastEditedTime > maxTime) {
|
|
78
|
+
maxTime = page.lastEditedTime;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return maxTime || null;
|
|
82
|
+
}
|
|
83
|
+
// -----------------------------------------------------------------------
|
|
84
|
+
// Private: discovery
|
|
85
|
+
// -----------------------------------------------------------------------
|
|
86
|
+
/**
|
|
87
|
+
* Discover all pages — full page set for indexing or deletion detection.
|
|
88
|
+
*/
|
|
89
|
+
async discoverAllPages() {
|
|
90
|
+
const pages = new Map();
|
|
91
|
+
const hasRootPages = this.config.root_pages.length > 0;
|
|
92
|
+
const hasDatabases = this.config.databases.length > 0;
|
|
93
|
+
if (!hasRootPages && !hasDatabases) {
|
|
94
|
+
// Search-all mode
|
|
95
|
+
const results = await this.apiClient.searchPages();
|
|
96
|
+
for (const page of results) {
|
|
97
|
+
pages.set(page.id, page);
|
|
98
|
+
}
|
|
99
|
+
return pages;
|
|
100
|
+
}
|
|
101
|
+
// Fetch root pages
|
|
102
|
+
for (const pageId of this.config.root_pages) {
|
|
103
|
+
try {
|
|
104
|
+
const page = await this.apiClient.getPageMeta(pageId);
|
|
105
|
+
pages.set(page.id, page);
|
|
106
|
+
}
|
|
107
|
+
catch (err) {
|
|
108
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
109
|
+
console.warn(`${this.logPrefix} Failed to fetch root page ${pageId}: ${msg}`);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
// Query databases
|
|
113
|
+
for (const dbId of this.config.databases) {
|
|
114
|
+
try {
|
|
115
|
+
const entries = await this.apiClient.queryDatabase(dbId);
|
|
116
|
+
for (const entry of entries) {
|
|
117
|
+
pages.set(entry.id, entry);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
catch (err) {
|
|
121
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
122
|
+
console.warn(`${this.logPrefix} Failed to query database ${dbId}: ${msg}`);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return pages;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Discover recently edited pages — only pages edited after the given timestamp.
|
|
129
|
+
*/
|
|
130
|
+
async discoverEditedPages(editedAfter) {
|
|
131
|
+
const pages = new Map();
|
|
132
|
+
const hasRootPages = this.config.root_pages.length > 0;
|
|
133
|
+
const hasDatabases = this.config.databases.length > 0;
|
|
134
|
+
if (!hasRootPages && !hasDatabases) {
|
|
135
|
+
const results = await this.apiClient.searchPages(editedAfter);
|
|
136
|
+
for (const page of results) {
|
|
137
|
+
pages.set(page.id, page);
|
|
138
|
+
}
|
|
139
|
+
return pages;
|
|
140
|
+
}
|
|
141
|
+
// Fetch root pages and filter by time
|
|
142
|
+
const cutoff = new Date(editedAfter).getTime();
|
|
143
|
+
for (const pageId of this.config.root_pages) {
|
|
144
|
+
try {
|
|
145
|
+
const page = await this.apiClient.getPageMeta(pageId);
|
|
146
|
+
if (new Date(page.lastEditedTime).getTime() > cutoff) {
|
|
147
|
+
pages.set(page.id, page);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
catch (err) {
|
|
151
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
152
|
+
console.warn(`${this.logPrefix} Failed to fetch root page ${pageId}: ${msg}`);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
// Query databases with time filter
|
|
156
|
+
for (const dbId of this.config.databases) {
|
|
157
|
+
try {
|
|
158
|
+
const entries = await this.apiClient.queryDatabase(dbId, editedAfter);
|
|
159
|
+
for (const entry of entries) {
|
|
160
|
+
pages.set(entry.id, entry);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
catch (err) {
|
|
164
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
165
|
+
console.warn(`${this.logPrefix} Failed to query database ${dbId}: ${msg}`);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return pages;
|
|
169
|
+
}
|
|
170
|
+
// -----------------------------------------------------------------------
|
|
171
|
+
// Private: content acquisition
|
|
172
|
+
// -----------------------------------------------------------------------
|
|
173
|
+
/**
|
|
174
|
+
* Acquire content for a set of pages. Returns items, max edit time, and failure count.
|
|
175
|
+
*/
|
|
176
|
+
async acquireContent(pages) {
|
|
177
|
+
const items = [];
|
|
178
|
+
let maxTime = '';
|
|
179
|
+
let failedCount = 0;
|
|
180
|
+
for (const [id, page] of pages) {
|
|
181
|
+
try {
|
|
182
|
+
let content = await this.apiClient.getPageContent(id);
|
|
183
|
+
// Prepend YAML frontmatter if page has properties and include_properties is enabled
|
|
184
|
+
if (page.properties && this.config.include_properties) {
|
|
185
|
+
const frontmatter = this.buildFrontmatter(page.properties);
|
|
186
|
+
if (frontmatter) {
|
|
187
|
+
content = `${frontmatter}\n\n${content}`;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
// Empty pages get title-only content
|
|
191
|
+
if (!content.trim()) {
|
|
192
|
+
content = `# ${page.title}`;
|
|
193
|
+
}
|
|
194
|
+
items.push({
|
|
195
|
+
id: page.id,
|
|
196
|
+
content,
|
|
197
|
+
title: page.title,
|
|
198
|
+
sourceUrl: page.url,
|
|
199
|
+
metadata: {
|
|
200
|
+
parentType: page.parentType,
|
|
201
|
+
parentId: page.parentId,
|
|
202
|
+
},
|
|
203
|
+
});
|
|
204
|
+
if (page.lastEditedTime > maxTime) {
|
|
205
|
+
maxTime = page.lastEditedTime;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
catch (err) {
|
|
209
|
+
failedCount++;
|
|
210
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
211
|
+
console.warn(`${this.logPrefix} Failed to acquire content for page ${id}: ${msg}`);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
return { items, maxTime, failedCount };
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Build YAML frontmatter from page properties.
|
|
218
|
+
* Skips the "title" key (redundant with page title) and null/empty values.
|
|
219
|
+
*/
|
|
220
|
+
buildFrontmatter(properties) {
|
|
221
|
+
const lines = [];
|
|
222
|
+
for (const [key, value] of Object.entries(properties)) {
|
|
223
|
+
// Skip title property — it's already the page title
|
|
224
|
+
if (key.toLowerCase() === 'title')
|
|
225
|
+
continue;
|
|
226
|
+
// Skip null/empty values
|
|
227
|
+
if (!value)
|
|
228
|
+
continue;
|
|
229
|
+
lines.push(`${key}: ${value}`);
|
|
230
|
+
}
|
|
231
|
+
if (lines.length === 0)
|
|
232
|
+
return null;
|
|
233
|
+
return `---\n${lines.join('\n')}\n---`;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
//# sourceMappingURL=notion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notion.js","sourceRoot":"","sources":["../../../src/indexing/providers/notion.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,4FAA4F;AAC5F,8EAA8E;AAE9E,OAAO,EAAE,eAAe,EAAuB,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAIxD,MAAM,OAAO,kBAAkB;IACnB,MAAM,CAAqB;IAC3B,SAAS,CAAkB;IAC3B,SAAS,CAAS;IAE1B,YAAY,MAAoB,EAAE,OAAwB;QACtD,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;QAC1E,CAAC;QACD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,MAAM,KAAK,GAAG,OAAO,CAAC,WAAW,CAAC;QAClC,IAAI,CAAC,KAAK,EAAE,CAAC;YACT,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAC;QACrF,CAAC;QACD,IAAI,CAAC,SAAS,GAAG,IAAI,eAAe,CAAC,KAAK,EAAE;YACxC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,SAAS;SAClC,CAAC,CAAC;QACH,IAAI,CAAC,SAAS,GAAG,oBAAoB,MAAM,CAAC,IAAI,GAAG,CAAC;IACxD,CAAC;IAED,KAAK,CAAC,WAAW;QACb,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,SAAS,wBAAwB,CAAC,CAAC;QAEvD,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAC5C,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,SAAS,eAAe,KAAK,CAAC,IAAI,UAAU,CAAC,CAAC;QAElE,MAAM,EAAE,KAAK,EAAE,OAAO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AAC;YACL,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACX,WAAW,EAAE,CAAC;gBACd,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;gBAC7D,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,SAAS,uCAAuC,EAAE,KAAK,GAAG,EAAE,CAAC,CAAC;YACvF,CAAC;QACL,CAAC;QAED,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;IAC3C,CAAC;IAED;;;OAGG;IACK,gBAAgB,CAAC,UAAkC;QACvD,MAAM,KAAK,GAAa,EAAE,CAAC;QAE3B,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;YACpD,oDAAoD;YACpD,IAAI,GAAG,CAAC,WAAW,EAAE,KAAK,OAAO;gBAAE,SAAS;YAC5C,yBAAyB;YACzB,IAAI,CAAC,KAAK;gBAAE,SAAS;YACrB,KAAK,CAAC,IAAI,CAAC,GAAG,GAAG,KAAK,KAAK,EAAE,CAAC,CAAC;QACnC,CAAC;QAED,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QACpC,OAAO,QAAQ,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;IAC3C,CAAC;CACJ"}
|
|
@@ -50,6 +50,7 @@ export interface ProviderOptions {
|
|
|
50
50
|
githubToken?: string;
|
|
51
51
|
slackBotToken?: string;
|
|
52
52
|
discordBotToken?: string;
|
|
53
|
+
notionToken?: string;
|
|
53
54
|
}
|
|
54
55
|
/** Factory function that creates a DataProvider for a given source config. */
|
|
55
56
|
export type DataProviderFactory = (config: SourceConfig, options: ProviderOptions) => DataProvider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/indexing/providers/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,2CAA2C;AAC3C,MAAM,WAAW,WAAW;IACxB,gFAAgF;IAChF,EAAE,EAAE,MAAM,CAAC;IACX,gCAAgC;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,+DAA+D;IAC/D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAED,wCAAwC;AACxC,MAAM,WAAW,iBAAiB;IAC9B,iFAAiF;IACjF,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB;;;;;;OAMG;IACH,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,wEAAwE;IACxE,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,mDAAmD;AACnD,MAAM,WAAW,YAAY;IACzB;;;OAGG;IACH,WAAW,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAE1C;;OAEG;IACH,kBAAkB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAEvE;;;OAGG;IACH,oBAAoB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CAClD;AAED,4CAA4C;AAC5C,MAAM,WAAW,eAAe;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/indexing/providers/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,2CAA2C;AAC3C,MAAM,WAAW,WAAW;IACxB,gFAAgF;IAChF,EAAE,EAAE,MAAM,CAAC;IACX,gCAAgC;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,+DAA+D;IAC/D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAED,wCAAwC;AACxC,MAAM,WAAW,iBAAiB;IAC9B,iFAAiF;IACjF,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB;;;;;;OAMG;IACH,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,wEAAwE;IACxE,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,mDAAmD;AACnD,MAAM,WAAW,YAAY;IACzB;;;OAGG;IACH,WAAW,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAE1C;;OAEG;IACH,kBAAkB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAEvE;;;OAGG;IACH,oBAAoB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CAClD;AAED,4CAA4C;AAC5C,MAAM,WAAW,eAAe;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,8EAA8E;AAC9E,MAAM,MAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,eAAe,KAAK,YAAY,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -270,6 +270,62 @@ export declare const DiscordSourceConfigSchema: z.ZodObject<{
|
|
|
270
270
|
min_thread_replies?: number | undefined;
|
|
271
271
|
distiller_model?: string | undefined;
|
|
272
272
|
}>;
|
|
273
|
+
export declare const NotionSourceConfigSchema: z.ZodObject<{
|
|
274
|
+
type: z.ZodLiteral<"notion">;
|
|
275
|
+
root_pages: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
276
|
+
databases: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
277
|
+
max_depth: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
278
|
+
include_properties: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
279
|
+
name: z.ZodString;
|
|
280
|
+
chunk: z.ZodObject<{
|
|
281
|
+
target_tokens: z.ZodOptional<z.ZodNumber>;
|
|
282
|
+
overlap_tokens: z.ZodOptional<z.ZodNumber>;
|
|
283
|
+
target_lines: z.ZodOptional<z.ZodNumber>;
|
|
284
|
+
overlap_lines: z.ZodOptional<z.ZodNumber>;
|
|
285
|
+
}, "strip", z.ZodTypeAny, {
|
|
286
|
+
target_tokens?: number | undefined;
|
|
287
|
+
overlap_tokens?: number | undefined;
|
|
288
|
+
target_lines?: number | undefined;
|
|
289
|
+
overlap_lines?: number | undefined;
|
|
290
|
+
}, {
|
|
291
|
+
target_tokens?: number | undefined;
|
|
292
|
+
overlap_tokens?: number | undefined;
|
|
293
|
+
target_lines?: number | undefined;
|
|
294
|
+
overlap_lines?: number | undefined;
|
|
295
|
+
}>;
|
|
296
|
+
version: z.ZodOptional<z.ZodString>;
|
|
297
|
+
category: z.ZodOptional<z.ZodEnum<["faq"]>>;
|
|
298
|
+
}, "strip", z.ZodTypeAny, {
|
|
299
|
+
type: "notion";
|
|
300
|
+
name: string;
|
|
301
|
+
chunk: {
|
|
302
|
+
target_tokens?: number | undefined;
|
|
303
|
+
overlap_tokens?: number | undefined;
|
|
304
|
+
target_lines?: number | undefined;
|
|
305
|
+
overlap_lines?: number | undefined;
|
|
306
|
+
};
|
|
307
|
+
root_pages: string[];
|
|
308
|
+
databases: string[];
|
|
309
|
+
max_depth: number;
|
|
310
|
+
include_properties: boolean;
|
|
311
|
+
version?: string | undefined;
|
|
312
|
+
category?: "faq" | undefined;
|
|
313
|
+
}, {
|
|
314
|
+
type: "notion";
|
|
315
|
+
name: string;
|
|
316
|
+
chunk: {
|
|
317
|
+
target_tokens?: number | undefined;
|
|
318
|
+
overlap_tokens?: number | undefined;
|
|
319
|
+
target_lines?: number | undefined;
|
|
320
|
+
overlap_lines?: number | undefined;
|
|
321
|
+
};
|
|
322
|
+
version?: string | undefined;
|
|
323
|
+
category?: "faq" | undefined;
|
|
324
|
+
root_pages?: string[] | undefined;
|
|
325
|
+
databases?: string[] | undefined;
|
|
326
|
+
max_depth?: number | undefined;
|
|
327
|
+
include_properties?: boolean | undefined;
|
|
328
|
+
}>;
|
|
273
329
|
export declare const SourceConfigSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
274
330
|
type: z.ZodEnum<["markdown", "code", "raw-text", "html"]>;
|
|
275
331
|
repo: z.ZodOptional<z.ZodString>;
|
|
@@ -496,6 +552,61 @@ export declare const SourceConfigSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
496
552
|
confidence_threshold?: number | undefined;
|
|
497
553
|
min_thread_replies?: number | undefined;
|
|
498
554
|
distiller_model?: string | undefined;
|
|
555
|
+
}>, z.ZodObject<{
|
|
556
|
+
type: z.ZodLiteral<"notion">;
|
|
557
|
+
root_pages: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
558
|
+
databases: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
559
|
+
max_depth: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
560
|
+
include_properties: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
561
|
+
name: z.ZodString;
|
|
562
|
+
chunk: z.ZodObject<{
|
|
563
|
+
target_tokens: z.ZodOptional<z.ZodNumber>;
|
|
564
|
+
overlap_tokens: z.ZodOptional<z.ZodNumber>;
|
|
565
|
+
target_lines: z.ZodOptional<z.ZodNumber>;
|
|
566
|
+
overlap_lines: z.ZodOptional<z.ZodNumber>;
|
|
567
|
+
}, "strip", z.ZodTypeAny, {
|
|
568
|
+
target_tokens?: number | undefined;
|
|
569
|
+
overlap_tokens?: number | undefined;
|
|
570
|
+
target_lines?: number | undefined;
|
|
571
|
+
overlap_lines?: number | undefined;
|
|
572
|
+
}, {
|
|
573
|
+
target_tokens?: number | undefined;
|
|
574
|
+
overlap_tokens?: number | undefined;
|
|
575
|
+
target_lines?: number | undefined;
|
|
576
|
+
overlap_lines?: number | undefined;
|
|
577
|
+
}>;
|
|
578
|
+
version: z.ZodOptional<z.ZodString>;
|
|
579
|
+
category: z.ZodOptional<z.ZodEnum<["faq"]>>;
|
|
580
|
+
}, "strip", z.ZodTypeAny, {
|
|
581
|
+
type: "notion";
|
|
582
|
+
name: string;
|
|
583
|
+
chunk: {
|
|
584
|
+
target_tokens?: number | undefined;
|
|
585
|
+
overlap_tokens?: number | undefined;
|
|
586
|
+
target_lines?: number | undefined;
|
|
587
|
+
overlap_lines?: number | undefined;
|
|
588
|
+
};
|
|
589
|
+
root_pages: string[];
|
|
590
|
+
databases: string[];
|
|
591
|
+
max_depth: number;
|
|
592
|
+
include_properties: boolean;
|
|
593
|
+
version?: string | undefined;
|
|
594
|
+
category?: "faq" | undefined;
|
|
595
|
+
}, {
|
|
596
|
+
type: "notion";
|
|
597
|
+
name: string;
|
|
598
|
+
chunk: {
|
|
599
|
+
target_tokens?: number | undefined;
|
|
600
|
+
overlap_tokens?: number | undefined;
|
|
601
|
+
target_lines?: number | undefined;
|
|
602
|
+
overlap_lines?: number | undefined;
|
|
603
|
+
};
|
|
604
|
+
version?: string | undefined;
|
|
605
|
+
category?: "faq" | undefined;
|
|
606
|
+
root_pages?: string[] | undefined;
|
|
607
|
+
databases?: string[] | undefined;
|
|
608
|
+
max_depth?: number | undefined;
|
|
609
|
+
include_properties?: boolean | undefined;
|
|
499
610
|
}>]>;
|
|
500
611
|
export declare const SearchToolConfigSchema: z.ZodObject<{
|
|
501
612
|
name: z.ZodString;
|
|
@@ -1224,6 +1335,61 @@ export declare const ServerConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1224
1335
|
confidence_threshold?: number | undefined;
|
|
1225
1336
|
min_thread_replies?: number | undefined;
|
|
1226
1337
|
distiller_model?: string | undefined;
|
|
1338
|
+
}>, z.ZodObject<{
|
|
1339
|
+
type: z.ZodLiteral<"notion">;
|
|
1340
|
+
root_pages: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
1341
|
+
databases: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
1342
|
+
max_depth: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
1343
|
+
include_properties: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
1344
|
+
name: z.ZodString;
|
|
1345
|
+
chunk: z.ZodObject<{
|
|
1346
|
+
target_tokens: z.ZodOptional<z.ZodNumber>;
|
|
1347
|
+
overlap_tokens: z.ZodOptional<z.ZodNumber>;
|
|
1348
|
+
target_lines: z.ZodOptional<z.ZodNumber>;
|
|
1349
|
+
overlap_lines: z.ZodOptional<z.ZodNumber>;
|
|
1350
|
+
}, "strip", z.ZodTypeAny, {
|
|
1351
|
+
target_tokens?: number | undefined;
|
|
1352
|
+
overlap_tokens?: number | undefined;
|
|
1353
|
+
target_lines?: number | undefined;
|
|
1354
|
+
overlap_lines?: number | undefined;
|
|
1355
|
+
}, {
|
|
1356
|
+
target_tokens?: number | undefined;
|
|
1357
|
+
overlap_tokens?: number | undefined;
|
|
1358
|
+
target_lines?: number | undefined;
|
|
1359
|
+
overlap_lines?: number | undefined;
|
|
1360
|
+
}>;
|
|
1361
|
+
version: z.ZodOptional<z.ZodString>;
|
|
1362
|
+
category: z.ZodOptional<z.ZodEnum<["faq"]>>;
|
|
1363
|
+
}, "strip", z.ZodTypeAny, {
|
|
1364
|
+
type: "notion";
|
|
1365
|
+
name: string;
|
|
1366
|
+
chunk: {
|
|
1367
|
+
target_tokens?: number | undefined;
|
|
1368
|
+
overlap_tokens?: number | undefined;
|
|
1369
|
+
target_lines?: number | undefined;
|
|
1370
|
+
overlap_lines?: number | undefined;
|
|
1371
|
+
};
|
|
1372
|
+
root_pages: string[];
|
|
1373
|
+
databases: string[];
|
|
1374
|
+
max_depth: number;
|
|
1375
|
+
include_properties: boolean;
|
|
1376
|
+
version?: string | undefined;
|
|
1377
|
+
category?: "faq" | undefined;
|
|
1378
|
+
}, {
|
|
1379
|
+
type: "notion";
|
|
1380
|
+
name: string;
|
|
1381
|
+
chunk: {
|
|
1382
|
+
target_tokens?: number | undefined;
|
|
1383
|
+
overlap_tokens?: number | undefined;
|
|
1384
|
+
target_lines?: number | undefined;
|
|
1385
|
+
overlap_lines?: number | undefined;
|
|
1386
|
+
};
|
|
1387
|
+
version?: string | undefined;
|
|
1388
|
+
category?: "faq" | undefined;
|
|
1389
|
+
root_pages?: string[] | undefined;
|
|
1390
|
+
databases?: string[] | undefined;
|
|
1391
|
+
max_depth?: number | undefined;
|
|
1392
|
+
include_properties?: boolean | undefined;
|
|
1227
1393
|
}>]>, "many">;
|
|
1228
1394
|
tools: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
1229
1395
|
name: z.ZodString;
|
|
@@ -1521,6 +1687,21 @@ export declare const ServerConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1521
1687
|
guild_id: string;
|
|
1522
1688
|
version?: string | undefined;
|
|
1523
1689
|
distiller_model?: string | undefined;
|
|
1690
|
+
} | {
|
|
1691
|
+
type: "notion";
|
|
1692
|
+
name: string;
|
|
1693
|
+
chunk: {
|
|
1694
|
+
target_tokens?: number | undefined;
|
|
1695
|
+
overlap_tokens?: number | undefined;
|
|
1696
|
+
target_lines?: number | undefined;
|
|
1697
|
+
overlap_lines?: number | undefined;
|
|
1698
|
+
};
|
|
1699
|
+
root_pages: string[];
|
|
1700
|
+
databases: string[];
|
|
1701
|
+
max_depth: number;
|
|
1702
|
+
include_properties: boolean;
|
|
1703
|
+
version?: string | undefined;
|
|
1704
|
+
category?: "faq" | undefined;
|
|
1524
1705
|
})[];
|
|
1525
1706
|
server: {
|
|
1526
1707
|
name: string;
|
|
@@ -1648,6 +1829,21 @@ export declare const ServerConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1648
1829
|
confidence_threshold?: number | undefined;
|
|
1649
1830
|
min_thread_replies?: number | undefined;
|
|
1650
1831
|
distiller_model?: string | undefined;
|
|
1832
|
+
} | {
|
|
1833
|
+
type: "notion";
|
|
1834
|
+
name: string;
|
|
1835
|
+
chunk: {
|
|
1836
|
+
target_tokens?: number | undefined;
|
|
1837
|
+
overlap_tokens?: number | undefined;
|
|
1838
|
+
target_lines?: number | undefined;
|
|
1839
|
+
overlap_lines?: number | undefined;
|
|
1840
|
+
};
|
|
1841
|
+
version?: string | undefined;
|
|
1842
|
+
category?: "faq" | undefined;
|
|
1843
|
+
root_pages?: string[] | undefined;
|
|
1844
|
+
databases?: string[] | undefined;
|
|
1845
|
+
max_depth?: number | undefined;
|
|
1846
|
+
include_properties?: boolean | undefined;
|
|
1651
1847
|
})[];
|
|
1652
1848
|
server: {
|
|
1653
1849
|
name: string;
|
|
@@ -1775,6 +1971,21 @@ export declare const ServerConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1775
1971
|
guild_id: string;
|
|
1776
1972
|
version?: string | undefined;
|
|
1777
1973
|
distiller_model?: string | undefined;
|
|
1974
|
+
} | {
|
|
1975
|
+
type: "notion";
|
|
1976
|
+
name: string;
|
|
1977
|
+
chunk: {
|
|
1978
|
+
target_tokens?: number | undefined;
|
|
1979
|
+
overlap_tokens?: number | undefined;
|
|
1980
|
+
target_lines?: number | undefined;
|
|
1981
|
+
overlap_lines?: number | undefined;
|
|
1982
|
+
};
|
|
1983
|
+
root_pages: string[];
|
|
1984
|
+
databases: string[];
|
|
1985
|
+
max_depth: number;
|
|
1986
|
+
include_properties: boolean;
|
|
1987
|
+
version?: string | undefined;
|
|
1988
|
+
category?: "faq" | undefined;
|
|
1778
1989
|
})[];
|
|
1779
1990
|
server: {
|
|
1780
1991
|
name: string;
|
|
@@ -1902,6 +2113,21 @@ export declare const ServerConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1902
2113
|
confidence_threshold?: number | undefined;
|
|
1903
2114
|
min_thread_replies?: number | undefined;
|
|
1904
2115
|
distiller_model?: string | undefined;
|
|
2116
|
+
} | {
|
|
2117
|
+
type: "notion";
|
|
2118
|
+
name: string;
|
|
2119
|
+
chunk: {
|
|
2120
|
+
target_tokens?: number | undefined;
|
|
2121
|
+
overlap_tokens?: number | undefined;
|
|
2122
|
+
target_lines?: number | undefined;
|
|
2123
|
+
overlap_lines?: number | undefined;
|
|
2124
|
+
};
|
|
2125
|
+
version?: string | undefined;
|
|
2126
|
+
category?: "faq" | undefined;
|
|
2127
|
+
root_pages?: string[] | undefined;
|
|
2128
|
+
databases?: string[] | undefined;
|
|
2129
|
+
max_depth?: number | undefined;
|
|
2130
|
+
include_properties?: boolean | undefined;
|
|
1905
2131
|
})[];
|
|
1906
2132
|
server: {
|
|
1907
2133
|
name: string;
|
|
@@ -1976,6 +2202,7 @@ export type FileSourceConfig = z.infer<typeof FileSourceConfigSchema>;
|
|
|
1976
2202
|
export type SlackSourceConfig = z.infer<typeof SlackSourceConfigSchema>;
|
|
1977
2203
|
export type DiscordChannelConfig = z.infer<typeof DiscordChannelConfigSchema>;
|
|
1978
2204
|
export type DiscordSourceConfig = z.infer<typeof DiscordSourceConfigSchema>;
|
|
2205
|
+
export type NotionSourceConfig = z.infer<typeof NotionSourceConfigSchema>;
|
|
1979
2206
|
export type SearchToolConfig = z.infer<typeof SearchToolConfigSchema>;
|
|
1980
2207
|
export type BashToolConfig = z.infer<typeof BashToolConfigSchema>;
|
|
1981
2208
|
export type CollectToolConfig = z.infer<typeof CollectToolConfigSchema>;
|
|
@@ -1989,6 +2216,7 @@ export type BashOptions = z.infer<typeof BashOptionsSchema>;
|
|
|
1989
2216
|
export declare function isFileSourceConfig(config: SourceConfig): config is FileSourceConfig;
|
|
1990
2217
|
export declare function isSlackSourceConfig(config: SourceConfig): config is SlackSourceConfig;
|
|
1991
2218
|
export declare function isDiscordSourceConfig(config: SourceConfig): config is DiscordSourceConfig;
|
|
2219
|
+
export declare function isNotionSourceConfig(config: SourceConfig): config is NotionSourceConfig;
|
|
1992
2220
|
export interface Chunk {
|
|
1993
2221
|
source_name: string;
|
|
1994
2222
|
source_url?: string | null;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;EAKpC,CAAC;AAKH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;EAK5B,CAAC;AAWH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYjC,CAAC;AAGH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASlC,CAAC;AAGH,eAAO,MAAM,0BAA0B;;;;;;;;;EAGrC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASpC,CAAC;AAGH,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE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MAAM,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,cAAe,SAAQ,WAAW;IAC/C,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,UAAU,EAAE,MAAM,CAAC;CACtB;AAGD,MAAM,WAAW,WAAW;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACtB;AAID,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC;AAExD,MAAM,WAAW,UAAU;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,eAAe,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAC9B,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC"}
|
package/dist/types.js
CHANGED
|
@@ -64,11 +64,20 @@ export const DiscordSourceConfigSchema = z.object({
|
|
|
64
64
|
min_thread_replies: z.number().int().positive().default(2),
|
|
65
65
|
distiller_model: z.string().optional(),
|
|
66
66
|
});
|
|
67
|
+
export const NotionSourceConfigSchema = z.object({
|
|
68
|
+
...BaseSourceFields,
|
|
69
|
+
type: z.literal('notion'),
|
|
70
|
+
root_pages: z.array(z.string().min(1)).optional().default([]),
|
|
71
|
+
databases: z.array(z.string().min(1)).optional().default([]),
|
|
72
|
+
max_depth: z.number().int().min(1).max(20).optional().default(5),
|
|
73
|
+
include_properties: z.boolean().optional().default(true),
|
|
74
|
+
});
|
|
67
75
|
// Union: TypeScript infers the right shape based on `type`
|
|
68
76
|
export const SourceConfigSchema = z.discriminatedUnion('type', [
|
|
69
77
|
FileSourceConfigSchema,
|
|
70
78
|
SlackSourceConfigSchema,
|
|
71
79
|
DiscordSourceConfigSchema,
|
|
80
|
+
NotionSourceConfigSchema,
|
|
72
81
|
]);
|
|
73
82
|
// ── Tool configuration schemas ────────────────────────────────────────────────
|
|
74
83
|
const SearchToolConfigObjectSchema = z.object({
|
|
@@ -242,4 +251,7 @@ export function isSlackSourceConfig(config) {
|
|
|
242
251
|
export function isDiscordSourceConfig(config) {
|
|
243
252
|
return config.type === 'discord';
|
|
244
253
|
}
|
|
254
|
+
export function isNotionSourceConfig(config) {
|
|
255
|
+
return config.type === 'notion';
|
|
256
|
+
}
|
|
245
257
|
//# sourceMappingURL=types.js.map
|