@daf-sdk/runtime 1.0.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/dist/chunk-4H6PEYL7.mjs +1221 -0
- package/dist/chunk-HGSJ2UZZ.mjs +625 -0
- package/dist/chunk-HT5X5ZSB.mjs +7231 -0
- package/dist/encryption-5J2VZDSY.mjs +11 -0
- package/dist/index.d.mts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +9336 -0
- package/dist/index.mjs +318 -0
- package/dist/mongodbService-PJCZZWQ3.mjs +23 -0
- package/dist/notion-3VBQFXSQ.mjs +52 -0
- package/dist/protocol/index.d.mts +589 -0
- package/dist/protocol/index.d.ts +589 -0
- package/dist/protocol/index.js +735 -0
- package/dist/protocol/index.mjs +174 -0
- package/dist/runtime/index.d.mts +957 -0
- package/dist/runtime/index.d.ts +957 -0
- package/dist/runtime/index.js +8628 -0
- package/dist/runtime/index.mjs +146 -0
- package/package.json +64 -0
|
@@ -0,0 +1,957 @@
|
|
|
1
|
+
import * as _ai_sdk_provider from '@ai-sdk/provider';
|
|
2
|
+
import * as google_auth_library from 'google-auth-library';
|
|
3
|
+
|
|
4
|
+
interface UserProviderSettings {
|
|
5
|
+
openaiApiKey?: string | null;
|
|
6
|
+
anthropicApiKey?: string | null;
|
|
7
|
+
mistralApiKey?: string | null;
|
|
8
|
+
googleApiKey?: string | null;
|
|
9
|
+
xaiApiKey?: string | null;
|
|
10
|
+
deepseekApiKey?: string | null;
|
|
11
|
+
useOpenaiKey: boolean;
|
|
12
|
+
useAnthropicKey: boolean;
|
|
13
|
+
useMistralKey: boolean;
|
|
14
|
+
useGoogleKey: boolean;
|
|
15
|
+
useXaiKey: boolean;
|
|
16
|
+
useDeepseekKey: boolean;
|
|
17
|
+
tier: string;
|
|
18
|
+
tokensUsedThisMonth: number;
|
|
19
|
+
walletBalance: number;
|
|
20
|
+
}
|
|
21
|
+
interface TokenUsage {
|
|
22
|
+
inputTokens: number;
|
|
23
|
+
outputTokens: number;
|
|
24
|
+
cachedTokens: number;
|
|
25
|
+
reasoningTokens: number;
|
|
26
|
+
totalTokens: number;
|
|
27
|
+
costUsd: number;
|
|
28
|
+
model: string;
|
|
29
|
+
}
|
|
30
|
+
interface DAFRunRecord {
|
|
31
|
+
id: string;
|
|
32
|
+
status: string;
|
|
33
|
+
messages: any[];
|
|
34
|
+
metadata: any;
|
|
35
|
+
model: string;
|
|
36
|
+
userId: string;
|
|
37
|
+
processId: string;
|
|
38
|
+
}
|
|
39
|
+
interface DAFProcessRecord {
|
|
40
|
+
id: string;
|
|
41
|
+
name: string;
|
|
42
|
+
steps: any[];
|
|
43
|
+
userId: string;
|
|
44
|
+
description?: string | null;
|
|
45
|
+
resourceIds?: string[];
|
|
46
|
+
resources?: any[];
|
|
47
|
+
}
|
|
48
|
+
interface DAFUserRecord {
|
|
49
|
+
id: string;
|
|
50
|
+
email: string;
|
|
51
|
+
name?: string | null;
|
|
52
|
+
tier: string;
|
|
53
|
+
tokensUsedThisMonth: number;
|
|
54
|
+
walletBalance: number;
|
|
55
|
+
lastMonthlyReset: Date;
|
|
56
|
+
openaiApiKey?: string | null;
|
|
57
|
+
anthropicApiKey?: string | null;
|
|
58
|
+
mistralApiKey?: string | null;
|
|
59
|
+
googleApiKey?: string | null;
|
|
60
|
+
xaiApiKey?: string | null;
|
|
61
|
+
deepseekApiKey?: string | null;
|
|
62
|
+
useOpenaiKey: boolean;
|
|
63
|
+
useAnthropicKey: boolean;
|
|
64
|
+
useMistralKey: boolean;
|
|
65
|
+
useGoogleKey: boolean;
|
|
66
|
+
useXaiKey: boolean;
|
|
67
|
+
useDeepseekKey: boolean;
|
|
68
|
+
variables?: Record<string, string>;
|
|
69
|
+
}
|
|
70
|
+
interface DAFResourceRecord {
|
|
71
|
+
id?: string;
|
|
72
|
+
name: string;
|
|
73
|
+
type: string;
|
|
74
|
+
provider: string;
|
|
75
|
+
url: string;
|
|
76
|
+
}
|
|
77
|
+
interface DAFGoogleIntegration {
|
|
78
|
+
id: string;
|
|
79
|
+
accessToken: string;
|
|
80
|
+
refreshToken?: string | null;
|
|
81
|
+
expiresAt?: Date | null;
|
|
82
|
+
}
|
|
83
|
+
interface DAFNotionIntegration {
|
|
84
|
+
id: string;
|
|
85
|
+
accessToken: string;
|
|
86
|
+
}
|
|
87
|
+
interface DAFEmailIntegration {
|
|
88
|
+
host: string;
|
|
89
|
+
port: number;
|
|
90
|
+
user: string;
|
|
91
|
+
pass: string;
|
|
92
|
+
from?: string;
|
|
93
|
+
}
|
|
94
|
+
interface DAFStorageAdapter {
|
|
95
|
+
getRun(runId: string): Promise<DAFRunRecord | null>;
|
|
96
|
+
createRun(data: Omit<DAFRunRecord, 'id'>): Promise<DAFRunRecord>;
|
|
97
|
+
updateRun(runId: string, data: Partial<Omit<DAFRunRecord, 'id'>>): Promise<void>;
|
|
98
|
+
countRunningRuns(userId: string): Promise<number>;
|
|
99
|
+
getRunningRuns(processId: string): Promise<DAFRunRecord[]>;
|
|
100
|
+
getProcess(processId: string, userId: string): Promise<DAFProcessRecord | null>;
|
|
101
|
+
getProcesses(processIds: string[], userId: string): Promise<DAFProcessRecord[]>;
|
|
102
|
+
updateProcess(processId: string, data: Partial<DAFProcessRecord>): Promise<void>;
|
|
103
|
+
getUser(userId: string): Promise<DAFUserRecord | null>;
|
|
104
|
+
updateUserUsage(userId: string, usage: TokenUsage): Promise<{
|
|
105
|
+
newBalance: number;
|
|
106
|
+
newTokenCount: number;
|
|
107
|
+
}>;
|
|
108
|
+
getResourcesForProcess(processId: string, userId: string, parentProcessIds?: string[]): Promise<DAFResourceRecord[]>;
|
|
109
|
+
getResourcesByIds(resourceIds: string[], userId: string): Promise<DAFResourceRecord[]>;
|
|
110
|
+
getUserVariables(userId: string): Promise<Record<string, string>>;
|
|
111
|
+
getGoogleIntegration(userId: string): Promise<DAFGoogleIntegration | null>;
|
|
112
|
+
updateGoogleIntegration(integrationId: string, data: {
|
|
113
|
+
accessToken: string;
|
|
114
|
+
expiresAt: Date;
|
|
115
|
+
}): Promise<void>;
|
|
116
|
+
getNotionIntegration(userId: string): Promise<DAFNotionIntegration | null>;
|
|
117
|
+
getEmailIntegration(userId: string): Promise<DAFEmailIntegration | null>;
|
|
118
|
+
pauseUserSchedules?(userId: string): Promise<void>;
|
|
119
|
+
getScheduleForProcess?(processId: string): Promise<{
|
|
120
|
+
id: string;
|
|
121
|
+
} | null>;
|
|
122
|
+
onMonthlyLimitReached?(userId: string, user: any): Promise<void>;
|
|
123
|
+
onWalletDepleted?(userId: string, user: any): Promise<void>;
|
|
124
|
+
db: {
|
|
125
|
+
user: {
|
|
126
|
+
findUnique(args: {
|
|
127
|
+
where: Record<string, any>;
|
|
128
|
+
select?: Record<string, any>;
|
|
129
|
+
}): Promise<any | null>;
|
|
130
|
+
update(args: {
|
|
131
|
+
where: Record<string, any>;
|
|
132
|
+
data: Record<string, any>;
|
|
133
|
+
}): Promise<any>;
|
|
134
|
+
};
|
|
135
|
+
run: {
|
|
136
|
+
create(args: {
|
|
137
|
+
data: Record<string, any>;
|
|
138
|
+
}): Promise<any>;
|
|
139
|
+
update(args: {
|
|
140
|
+
where: Record<string, any>;
|
|
141
|
+
data: Record<string, any>;
|
|
142
|
+
select?: Record<string, any>;
|
|
143
|
+
}): Promise<any>;
|
|
144
|
+
findUnique(args: {
|
|
145
|
+
where: Record<string, any>;
|
|
146
|
+
select?: Record<string, any>;
|
|
147
|
+
}): Promise<any | null>;
|
|
148
|
+
findFirst(args: {
|
|
149
|
+
where: Record<string, any>;
|
|
150
|
+
select?: Record<string, any>;
|
|
151
|
+
}): Promise<any | null>;
|
|
152
|
+
findMany(args: {
|
|
153
|
+
where: Record<string, any>;
|
|
154
|
+
select?: Record<string, any>;
|
|
155
|
+
orderBy?: Record<string, any>;
|
|
156
|
+
}): Promise<any[]>;
|
|
157
|
+
count(args: {
|
|
158
|
+
where: Record<string, any>;
|
|
159
|
+
}): Promise<number>;
|
|
160
|
+
};
|
|
161
|
+
resource: {
|
|
162
|
+
create(args: {
|
|
163
|
+
data: Record<string, any>;
|
|
164
|
+
}): Promise<any>;
|
|
165
|
+
update(args: {
|
|
166
|
+
where: Record<string, any>;
|
|
167
|
+
data: Record<string, any>;
|
|
168
|
+
}): Promise<void>;
|
|
169
|
+
delete(args: {
|
|
170
|
+
where: Record<string, any>;
|
|
171
|
+
}): Promise<void>;
|
|
172
|
+
findFirst(args: {
|
|
173
|
+
where: Record<string, any>;
|
|
174
|
+
select?: Record<string, any>;
|
|
175
|
+
}): Promise<any | null>;
|
|
176
|
+
findMany(args: {
|
|
177
|
+
where: Record<string, any>;
|
|
178
|
+
select?: Record<string, any>;
|
|
179
|
+
}): Promise<any[]>;
|
|
180
|
+
};
|
|
181
|
+
process: {
|
|
182
|
+
findUnique(args: {
|
|
183
|
+
where: Record<string, any>;
|
|
184
|
+
select?: Record<string, any>;
|
|
185
|
+
}): Promise<any | null>;
|
|
186
|
+
findFirst(args: {
|
|
187
|
+
where: Record<string, any>;
|
|
188
|
+
select?: Record<string, any>;
|
|
189
|
+
}): Promise<any | null>;
|
|
190
|
+
findMany(args: {
|
|
191
|
+
where: Record<string, any>;
|
|
192
|
+
select?: Record<string, any>;
|
|
193
|
+
}): Promise<any[]>;
|
|
194
|
+
update(args: {
|
|
195
|
+
where: Record<string, any>;
|
|
196
|
+
data: Record<string, any>;
|
|
197
|
+
}): Promise<void>;
|
|
198
|
+
};
|
|
199
|
+
integration: {
|
|
200
|
+
findUnique(args: {
|
|
201
|
+
where: Record<string, any>;
|
|
202
|
+
select?: Record<string, any>;
|
|
203
|
+
}): Promise<any | null>;
|
|
204
|
+
};
|
|
205
|
+
schedule: {
|
|
206
|
+
findFirst(args: {
|
|
207
|
+
where: Record<string, any>;
|
|
208
|
+
select?: Record<string, any>;
|
|
209
|
+
}): Promise<any | null>;
|
|
210
|
+
updateMany(args: {
|
|
211
|
+
where: Record<string, any>;
|
|
212
|
+
data: Record<string, any>;
|
|
213
|
+
}): Promise<void>;
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
emitRunUpdate(runId: string, event: any): void;
|
|
217
|
+
emitRunListUpdate(userId: string, event: any): void;
|
|
218
|
+
emitRunningCountUpdate(userId: string, count: number): void;
|
|
219
|
+
log: {
|
|
220
|
+
info(msg: string, ...args: any[]): void;
|
|
221
|
+
warn(msg: string, ...args: any[]): void;
|
|
222
|
+
error(msg: string, ...args: any[]): void;
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
interface ActionConfig {
|
|
226
|
+
firecrawlApiKey?: string;
|
|
227
|
+
serpApiKey?: string;
|
|
228
|
+
tavilyApiKey?: string;
|
|
229
|
+
}
|
|
230
|
+
interface ExecutionContext {
|
|
231
|
+
model: string;
|
|
232
|
+
modelProvider: any;
|
|
233
|
+
onTokenUsage?: (input: number, output: number, total: number, cached: number, reasoning: number) => Promise<void>;
|
|
234
|
+
isChatContext?: boolean;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
declare const TIER_TOKEN_LIMITS: Record<string, number>;
|
|
238
|
+
declare const MODEL_PRICING: Record<string, {
|
|
239
|
+
input: number;
|
|
240
|
+
output: number;
|
|
241
|
+
cachedInput?: number;
|
|
242
|
+
}>;
|
|
243
|
+
declare function calculateTokenCost(model: string | undefined, inputTokens: number, outputTokens: number, cachedInputTokens?: number, reasoningTokens?: number): number;
|
|
244
|
+
declare function buildTokenUsage(model: string, inputTokens: number, outputTokens: number, cachedTokens?: number, reasoningTokens?: number): TokenUsage;
|
|
245
|
+
|
|
246
|
+
declare function getProviderFromModel(modelName: string): string;
|
|
247
|
+
declare function getModelProvider(modelName: string, userSettings?: UserProviderSettings | null): _ai_sdk_provider.LanguageModelV3;
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Generic Variables - System-defined variables that help users reference actions
|
|
251
|
+
* These are read-only and available to all users
|
|
252
|
+
*/
|
|
253
|
+
interface GenericVariable {
|
|
254
|
+
name: string;
|
|
255
|
+
value: string;
|
|
256
|
+
description: string;
|
|
257
|
+
}
|
|
258
|
+
declare const GENERIC_VARIABLES: Record<string, string>;
|
|
259
|
+
declare function getDescEditorActions(): string;
|
|
260
|
+
declare function getDescAllActions(): string;
|
|
261
|
+
declare function getDescChatActions(): string;
|
|
262
|
+
/**
|
|
263
|
+
* Get all generic variables as a record
|
|
264
|
+
*/
|
|
265
|
+
declare function getGenericVariables(): Record<string, string>;
|
|
266
|
+
/**
|
|
267
|
+
* Get a specific generic variable by name
|
|
268
|
+
*/
|
|
269
|
+
declare function getGenericVariable(name: string): string | undefined;
|
|
270
|
+
/**
|
|
271
|
+
* Check if a variable name is a generic variable
|
|
272
|
+
*/
|
|
273
|
+
declare function isGenericVariable(name: string): boolean;
|
|
274
|
+
/**
|
|
275
|
+
* Get variable names (for autocomplete/picker)
|
|
276
|
+
*/
|
|
277
|
+
declare function getGenericVariableNames(): string[];
|
|
278
|
+
/**
|
|
279
|
+
* Merge generic variables with user variables
|
|
280
|
+
* User variables take precedence over generic variables
|
|
281
|
+
*/
|
|
282
|
+
declare function mergeVariables(userVariables: Record<string, string>): Record<string, string>;
|
|
283
|
+
|
|
284
|
+
interface SendEmailAction {
|
|
285
|
+
type: 'action';
|
|
286
|
+
variant: 'sendEmail';
|
|
287
|
+
parameters: {
|
|
288
|
+
to: string;
|
|
289
|
+
subject: string;
|
|
290
|
+
content: string;
|
|
291
|
+
from_name?: string;
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
interface ReadDocumentAction {
|
|
295
|
+
type: 'action';
|
|
296
|
+
variant: 'readDocument';
|
|
297
|
+
parameters: {
|
|
298
|
+
resourceUrl: string;
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
interface WriteDocumentAction {
|
|
302
|
+
type: 'action';
|
|
303
|
+
variant: 'writeDocument';
|
|
304
|
+
parameters: {
|
|
305
|
+
resourceUrl: string;
|
|
306
|
+
content: string;
|
|
307
|
+
mode?: 'replace' | 'append' | 'selective';
|
|
308
|
+
range?: {
|
|
309
|
+
startIndex: number;
|
|
310
|
+
endIndex: number;
|
|
311
|
+
};
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
interface FormatDocumentAction {
|
|
315
|
+
type: 'action';
|
|
316
|
+
variant: 'formatDocument';
|
|
317
|
+
parameters: {
|
|
318
|
+
resourceUrl: string;
|
|
319
|
+
range?: {
|
|
320
|
+
startIndex: number;
|
|
321
|
+
endIndex: number;
|
|
322
|
+
};
|
|
323
|
+
formatting: {
|
|
324
|
+
bold?: boolean;
|
|
325
|
+
italic?: boolean;
|
|
326
|
+
fontSize?: number;
|
|
327
|
+
};
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
interface RemoveDocumentAction {
|
|
331
|
+
type: 'action';
|
|
332
|
+
variant: 'removeDocument';
|
|
333
|
+
parameters: {
|
|
334
|
+
resourceUrl: string;
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
interface RenameDocumentAction {
|
|
338
|
+
type: 'action';
|
|
339
|
+
variant: 'renameDocument';
|
|
340
|
+
parameters: {
|
|
341
|
+
resourceUrl: string;
|
|
342
|
+
newName: string;
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
interface DuplicateDocumentAction {
|
|
346
|
+
type: 'action';
|
|
347
|
+
variant: 'duplicateDocument';
|
|
348
|
+
parameters: {
|
|
349
|
+
resourceUrl: string;
|
|
350
|
+
newName: string;
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
interface AddFolderAction {
|
|
354
|
+
type: 'action';
|
|
355
|
+
variant: 'addFolder';
|
|
356
|
+
parameters: {
|
|
357
|
+
folderName: string;
|
|
358
|
+
parentUrl?: string;
|
|
359
|
+
provider: 'google' | 'notion';
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
interface RemoveFolderAction {
|
|
363
|
+
type: 'action';
|
|
364
|
+
variant: 'removeFolder';
|
|
365
|
+
parameters: {
|
|
366
|
+
folderUrl: string;
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
interface ReadFolderAction {
|
|
370
|
+
type: 'action';
|
|
371
|
+
variant: 'readFolder';
|
|
372
|
+
parameters: {
|
|
373
|
+
folderUrl: string;
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
interface RenameFolderAction {
|
|
377
|
+
type: 'action';
|
|
378
|
+
variant: 'renameFolder';
|
|
379
|
+
parameters: {
|
|
380
|
+
folderUrl: string;
|
|
381
|
+
newName: string;
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
interface AddDocumentAction {
|
|
385
|
+
type: 'action';
|
|
386
|
+
variant: 'addDocument';
|
|
387
|
+
parameters: {
|
|
388
|
+
locationUrl?: string;
|
|
389
|
+
documentName: string;
|
|
390
|
+
content?: string;
|
|
391
|
+
provider: 'google' | 'notion';
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
interface CreateDatabaseAction {
|
|
395
|
+
type: 'action';
|
|
396
|
+
variant: 'createDatabase';
|
|
397
|
+
parameters: {
|
|
398
|
+
parentPageUrl?: string;
|
|
399
|
+
databaseName: string;
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
interface ReadDatabaseAction {
|
|
403
|
+
type: 'action';
|
|
404
|
+
variant: 'readDatabase';
|
|
405
|
+
parameters: {
|
|
406
|
+
databaseUrl: string;
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
interface UpdateDatabaseAction {
|
|
410
|
+
type: 'action';
|
|
411
|
+
variant: 'updateDatabase';
|
|
412
|
+
parameters: {
|
|
413
|
+
databaseUrl: string;
|
|
414
|
+
databaseName?: string;
|
|
415
|
+
properties?: Record<string, any>;
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
interface DeleteDatabaseAction {
|
|
419
|
+
type: 'action';
|
|
420
|
+
variant: 'deleteDatabase';
|
|
421
|
+
parameters: {
|
|
422
|
+
databaseUrl: string;
|
|
423
|
+
};
|
|
424
|
+
}
|
|
425
|
+
interface WriteDatabaseAction {
|
|
426
|
+
type: 'action';
|
|
427
|
+
variant: 'writeDatabase';
|
|
428
|
+
parameters: {
|
|
429
|
+
databaseUrl: string;
|
|
430
|
+
properties: Record<string, any>;
|
|
431
|
+
content?: string;
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
interface DuplicateDatabaseAction {
|
|
435
|
+
type: 'action';
|
|
436
|
+
variant: 'duplicateDatabase';
|
|
437
|
+
parameters: {
|
|
438
|
+
databaseUrl: string;
|
|
439
|
+
newDatabaseName?: string;
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
type FirecrawlActionType = {
|
|
443
|
+
type: 'wait';
|
|
444
|
+
milliseconds?: number;
|
|
445
|
+
selector?: string;
|
|
446
|
+
} | {
|
|
447
|
+
type: 'click';
|
|
448
|
+
selector: string;
|
|
449
|
+
} | {
|
|
450
|
+
type: 'write';
|
|
451
|
+
text: string;
|
|
452
|
+
selector?: string;
|
|
453
|
+
} | {
|
|
454
|
+
type: 'press';
|
|
455
|
+
key: string;
|
|
456
|
+
} | {
|
|
457
|
+
type: 'scroll';
|
|
458
|
+
direction?: 'up' | 'down';
|
|
459
|
+
selector?: string;
|
|
460
|
+
amount?: number;
|
|
461
|
+
} | {
|
|
462
|
+
type: 'screenshot';
|
|
463
|
+
fullPage?: boolean;
|
|
464
|
+
} | {
|
|
465
|
+
type: 'scrape';
|
|
466
|
+
};
|
|
467
|
+
interface LocationSettings {
|
|
468
|
+
country?: string;
|
|
469
|
+
languages?: string[];
|
|
470
|
+
}
|
|
471
|
+
interface JsonFormatOptions {
|
|
472
|
+
type: 'json';
|
|
473
|
+
schema?: any;
|
|
474
|
+
prompt?: string;
|
|
475
|
+
}
|
|
476
|
+
interface ScreenshotFormatOptions {
|
|
477
|
+
type: 'screenshot';
|
|
478
|
+
fullPage?: boolean;
|
|
479
|
+
quality?: number;
|
|
480
|
+
viewport?: {
|
|
481
|
+
width: number;
|
|
482
|
+
height: number;
|
|
483
|
+
};
|
|
484
|
+
}
|
|
485
|
+
type ScrapeFormat = 'markdown' | 'html' | 'rawHtml' | 'links' | 'screenshot' | 'summary' | JsonFormatOptions | ScreenshotFormatOptions;
|
|
486
|
+
interface ScrapeAction {
|
|
487
|
+
type: 'action';
|
|
488
|
+
variant: 'scrape';
|
|
489
|
+
parameters: {
|
|
490
|
+
url: string;
|
|
491
|
+
timeout?: number;
|
|
492
|
+
};
|
|
493
|
+
}
|
|
494
|
+
interface SearchAction {
|
|
495
|
+
type: 'action';
|
|
496
|
+
variant: 'search';
|
|
497
|
+
parameters: {
|
|
498
|
+
query: string;
|
|
499
|
+
limit?: number;
|
|
500
|
+
ignoreInvalidURLs?: boolean;
|
|
501
|
+
sources?: Array<'web' | 'news' | 'images'>;
|
|
502
|
+
categories?: Array<'github' | 'research' | 'pdf'>;
|
|
503
|
+
tbs?: string;
|
|
504
|
+
location?: string;
|
|
505
|
+
scrapeOptions?: {
|
|
506
|
+
formats?: string[];
|
|
507
|
+
onlyMainContent?: boolean;
|
|
508
|
+
timeout?: number;
|
|
509
|
+
maxAge?: number;
|
|
510
|
+
parsers?: Array<{
|
|
511
|
+
type: string;
|
|
512
|
+
maxPages?: number;
|
|
513
|
+
}>;
|
|
514
|
+
proxy?: 'basic' | 'enhanced' | 'auto';
|
|
515
|
+
};
|
|
516
|
+
};
|
|
517
|
+
}
|
|
518
|
+
interface NewsSearchAction {
|
|
519
|
+
type: 'action';
|
|
520
|
+
variant: 'newsSearch';
|
|
521
|
+
parameters: {
|
|
522
|
+
query: string;
|
|
523
|
+
limit?: number;
|
|
524
|
+
ignoreInvalidURLs?: boolean;
|
|
525
|
+
tbs?: string;
|
|
526
|
+
location?: string;
|
|
527
|
+
scrapeOptions?: {
|
|
528
|
+
formats?: string[];
|
|
529
|
+
onlyMainContent?: boolean;
|
|
530
|
+
timeout?: number;
|
|
531
|
+
maxAge?: number;
|
|
532
|
+
parsers?: Array<{
|
|
533
|
+
type: string;
|
|
534
|
+
maxPages?: number;
|
|
535
|
+
}>;
|
|
536
|
+
proxy?: 'basic' | 'enhanced' | 'auto';
|
|
537
|
+
};
|
|
538
|
+
};
|
|
539
|
+
}
|
|
540
|
+
interface QuickSearchAction {
|
|
541
|
+
type: 'action';
|
|
542
|
+
variant: 'previewSearch';
|
|
543
|
+
parameters: {
|
|
544
|
+
query: string;
|
|
545
|
+
limit?: number;
|
|
546
|
+
sources?: Array<'web' | 'news'>;
|
|
547
|
+
};
|
|
548
|
+
}
|
|
549
|
+
interface TavilySearchAction {
|
|
550
|
+
type: 'action';
|
|
551
|
+
variant: 'tavilySearch';
|
|
552
|
+
parameters: {
|
|
553
|
+
query: string;
|
|
554
|
+
maxResults?: number;
|
|
555
|
+
searchDepth?: 'basic' | 'advanced';
|
|
556
|
+
includeAnswer?: boolean;
|
|
557
|
+
};
|
|
558
|
+
}
|
|
559
|
+
interface WebhookConfig {
|
|
560
|
+
url: string;
|
|
561
|
+
metadata?: Record<string, any>;
|
|
562
|
+
events?: ('started' | 'page' | 'completed' | 'failed')[];
|
|
563
|
+
}
|
|
564
|
+
interface CrawlAction {
|
|
565
|
+
type: 'action';
|
|
566
|
+
variant: 'crawl';
|
|
567
|
+
parameters: {
|
|
568
|
+
url: string;
|
|
569
|
+
limit?: number;
|
|
570
|
+
maxDepth?: number;
|
|
571
|
+
allowBackwardLinks?: boolean;
|
|
572
|
+
allowExternalLinks?: boolean;
|
|
573
|
+
allowSubdomains?: boolean;
|
|
574
|
+
crawlEntireDomain?: boolean;
|
|
575
|
+
ignoreSitemap?: boolean;
|
|
576
|
+
includePaths?: string[];
|
|
577
|
+
excludePaths?: string[];
|
|
578
|
+
maxFileSize?: number;
|
|
579
|
+
webhook?: WebhookConfig;
|
|
580
|
+
scrapeOptions?: {
|
|
581
|
+
formats?: ScrapeFormat[];
|
|
582
|
+
onlyMainContent?: boolean;
|
|
583
|
+
includeTags?: string[];
|
|
584
|
+
excludeTags?: string[];
|
|
585
|
+
headers?: Record<string, string>;
|
|
586
|
+
waitFor?: number;
|
|
587
|
+
maxAge?: number;
|
|
588
|
+
storeInCache?: boolean;
|
|
589
|
+
actions?: FirecrawlActionType[];
|
|
590
|
+
location?: LocationSettings;
|
|
591
|
+
mobile?: boolean;
|
|
592
|
+
skipTlsVerification?: boolean;
|
|
593
|
+
removeBase64Images?: boolean;
|
|
594
|
+
};
|
|
595
|
+
};
|
|
596
|
+
}
|
|
597
|
+
interface EditorTransformAction {
|
|
598
|
+
type: 'editorAction';
|
|
599
|
+
variant: 'fixSpellingGrammar' | 'rewrite' | 'extendText' | 'addText' | 'reduceText' | 'removeText' | 'simplify' | 'completeSentence' | 'translate' | 'formatText' | 'directive';
|
|
600
|
+
parameters: {
|
|
601
|
+
selectedText: string;
|
|
602
|
+
language?: string;
|
|
603
|
+
directive?: string;
|
|
604
|
+
from?: number;
|
|
605
|
+
to?: number;
|
|
606
|
+
};
|
|
607
|
+
}
|
|
608
|
+
interface DbFindAction {
|
|
609
|
+
type: 'action';
|
|
610
|
+
variant: 'dbFind';
|
|
611
|
+
parameters: {
|
|
612
|
+
resourceUrl: string;
|
|
613
|
+
filter?: Record<string, unknown>;
|
|
614
|
+
sort?: Record<string, 1 | -1>;
|
|
615
|
+
limit?: number;
|
|
616
|
+
projection?: Record<string, 0 | 1>;
|
|
617
|
+
};
|
|
618
|
+
}
|
|
619
|
+
interface DbInsertAction {
|
|
620
|
+
type: 'action';
|
|
621
|
+
variant: 'dbInsert';
|
|
622
|
+
parameters: {
|
|
623
|
+
resourceUrl: string;
|
|
624
|
+
document: Record<string, unknown>;
|
|
625
|
+
};
|
|
626
|
+
}
|
|
627
|
+
interface DbUpdateAction {
|
|
628
|
+
type: 'action';
|
|
629
|
+
variant: 'dbUpdate';
|
|
630
|
+
parameters: {
|
|
631
|
+
resourceUrl: string;
|
|
632
|
+
filter: Record<string, unknown>;
|
|
633
|
+
update: Record<string, unknown>;
|
|
634
|
+
multi?: boolean;
|
|
635
|
+
upsert?: boolean;
|
|
636
|
+
};
|
|
637
|
+
}
|
|
638
|
+
interface DbDeleteAction {
|
|
639
|
+
type: 'action';
|
|
640
|
+
variant: 'dbDelete';
|
|
641
|
+
parameters: {
|
|
642
|
+
resourceUrl: string;
|
|
643
|
+
filter: Record<string, unknown>;
|
|
644
|
+
multi?: boolean;
|
|
645
|
+
confirm: true;
|
|
646
|
+
};
|
|
647
|
+
}
|
|
648
|
+
interface AskUserInputAction {
|
|
649
|
+
type: 'action';
|
|
650
|
+
variant: 'askUserInput';
|
|
651
|
+
parameters: {
|
|
652
|
+
message?: string;
|
|
653
|
+
};
|
|
654
|
+
}
|
|
655
|
+
type Action = SendEmailAction | ScrapeAction | SearchAction | NewsSearchAction | QuickSearchAction | TavilySearchAction | CrawlAction | ReadDocumentAction | WriteDocumentAction | FormatDocumentAction | RemoveDocumentAction | RenameDocumentAction | DuplicateDocumentAction | AddFolderAction | RemoveFolderAction | ReadFolderAction | RenameFolderAction | AddDocumentAction | CreateDatabaseAction | ReadDatabaseAction | UpdateDatabaseAction | DeleteDatabaseAction | WriteDatabaseAction | DuplicateDatabaseAction | DbFindAction | DbInsertAction | DbUpdateAction | DbDeleteAction | EditorTransformAction | AskUserInputAction;
|
|
656
|
+
interface ActionResult {
|
|
657
|
+
success: boolean;
|
|
658
|
+
error?: string;
|
|
659
|
+
message?: string;
|
|
660
|
+
data?: any;
|
|
661
|
+
pauseForInput?: boolean;
|
|
662
|
+
}
|
|
663
|
+
declare function extractActionsFromMessage(message: string): Action[];
|
|
664
|
+
declare function executeAction(action: Action, userId?: string, adapter?: DAFStorageAdapter, processId?: string, parentProcessIds?: string[], context?: ExecutionContext): Promise<ActionResult>;
|
|
665
|
+
declare function processMessageActions(message: string, userId?: string, adapter?: DAFStorageAdapter, processId?: string, parentProcessIds?: string[], context?: ExecutionContext): Promise<{
|
|
666
|
+
originalMessage: string;
|
|
667
|
+
processedMessage: string;
|
|
668
|
+
actionResults: ActionResult[];
|
|
669
|
+
hasActions: boolean;
|
|
670
|
+
}>;
|
|
671
|
+
|
|
672
|
+
/**
|
|
673
|
+
* Pre-check if user has any available credits BEFORE making API call
|
|
674
|
+
* This prevents consuming tokens when user is already out of credits
|
|
675
|
+
*/
|
|
676
|
+
declare function canUserAffordApiCall(userId: string, adapter: DAFStorageAdapter): Promise<{
|
|
677
|
+
allowed: boolean;
|
|
678
|
+
user: any;
|
|
679
|
+
message?: string;
|
|
680
|
+
failureReason?: 'WALLET_DEPLETED' | 'MONTHLY_LIMIT_REACHED';
|
|
681
|
+
}>;
|
|
682
|
+
declare function checkAndUpdateCostLimit(userId: string, costUsed: number, tokensUsed: number, adapter: DAFStorageAdapter, authType?: string): Promise<{
|
|
683
|
+
allowed: boolean;
|
|
684
|
+
user: any;
|
|
685
|
+
message?: string;
|
|
686
|
+
failureReason?: 'WALLET_DEPLETED' | 'MONTHLY_LIMIT_REACHED';
|
|
687
|
+
}>;
|
|
688
|
+
declare function substituteVariables(text: string, userId: string, adapter: DAFStorageAdapter, processId?: string, parentProcessIds?: string[]): Promise<string>;
|
|
689
|
+
declare function formatActionResult(actionResult: ActionResult): string;
|
|
690
|
+
declare function executeProcess(processId: string, userId: string, adapter: DAFStorageAdapter, modelOverride?: string, scheduleId?: string, authType?: string, editorContext?: boolean): Promise<{
|
|
691
|
+
success: boolean;
|
|
692
|
+
runId: any;
|
|
693
|
+
processId: string;
|
|
694
|
+
}>;
|
|
695
|
+
declare function executeProcessInRun(processId: string, runId: string, userId: string, adapter: DAFStorageAdapter, model?: string, chatResourceIds?: string[]): Promise<void>;
|
|
696
|
+
declare function resumeProcessExecution(runId: string, userId: string, userMessage: string, model: string, adapter: DAFStorageAdapter): Promise<void>;
|
|
697
|
+
|
|
698
|
+
declare function executeChatTurn(runId: string, userId: string, adapter: DAFStorageAdapter, message: string, model: string, resourceIds: string[], editorContext?: boolean): Promise<void>;
|
|
699
|
+
|
|
700
|
+
/**
|
|
701
|
+
* Get OAuth2 client for Google
|
|
702
|
+
*/
|
|
703
|
+
declare function getGoogleOAuth2Client(): google_auth_library.OAuth2Client;
|
|
704
|
+
/**
|
|
705
|
+
* Generate Google OAuth authorization URL
|
|
706
|
+
*/
|
|
707
|
+
declare function getGoogleAuthUrl(userId: string): string;
|
|
708
|
+
/**
|
|
709
|
+
* Exchange authorization code for tokens
|
|
710
|
+
*/
|
|
711
|
+
declare function exchangeGoogleCode(code: string): Promise<{
|
|
712
|
+
accessToken: string;
|
|
713
|
+
refreshToken: string | null;
|
|
714
|
+
expiresAt: Date;
|
|
715
|
+
}>;
|
|
716
|
+
/**
|
|
717
|
+
* Refresh Google access token using refresh token
|
|
718
|
+
*/
|
|
719
|
+
declare function refreshGoogleToken(refreshToken: string): Promise<{
|
|
720
|
+
accessToken: string;
|
|
721
|
+
expiresAt: Date;
|
|
722
|
+
}>;
|
|
723
|
+
/**
|
|
724
|
+
* Get or refresh Google access token for a user
|
|
725
|
+
*/
|
|
726
|
+
declare function getGoogleAccessToken(userId: string, adapter: DAFStorageAdapter): Promise<string>;
|
|
727
|
+
/**
|
|
728
|
+
* Extract document ID from Google Docs URL
|
|
729
|
+
*/
|
|
730
|
+
declare function extractDocIdFromUrl(url: string): string | null;
|
|
731
|
+
/**
|
|
732
|
+
* Read content from a Google Doc using Drive API
|
|
733
|
+
*/
|
|
734
|
+
declare function readGoogleDoc(documentId: string, accessToken: string): Promise<{
|
|
735
|
+
title: string;
|
|
736
|
+
content: string;
|
|
737
|
+
}>;
|
|
738
|
+
/**
|
|
739
|
+
* Replace entire content of a Google Doc
|
|
740
|
+
* Uses Drive API to verify access before writing
|
|
741
|
+
*/
|
|
742
|
+
declare function writeGoogleDoc(documentId: string, content: string, accessToken: string): Promise<void>;
|
|
743
|
+
/**
|
|
744
|
+
* Selectively replace content in a Google Doc at a specific range
|
|
745
|
+
*/
|
|
746
|
+
declare function selectiveUpdateGoogleDoc(documentId: string, content: string, startIndex: number, endIndex: number, accessToken: string): Promise<void>;
|
|
747
|
+
/**
|
|
748
|
+
* Append content to a Google Doc
|
|
749
|
+
*/
|
|
750
|
+
declare function appendGoogleDoc(documentId: string, content: string, accessToken: string): Promise<void>;
|
|
751
|
+
/**
|
|
752
|
+
* Format text in a Google Doc (apply bold, italic, etc.)
|
|
753
|
+
*/
|
|
754
|
+
declare function formatGoogleDoc(documentId: string, startIndex: number, endIndex: number, formatting: {
|
|
755
|
+
bold?: boolean;
|
|
756
|
+
italic?: boolean;
|
|
757
|
+
fontSize?: number;
|
|
758
|
+
}, accessToken: string): Promise<void>;
|
|
759
|
+
/**
|
|
760
|
+
* Delete a Google Doc (move to trash)
|
|
761
|
+
*/
|
|
762
|
+
declare function deleteGoogleDoc(documentId: string, accessToken: string): Promise<void>;
|
|
763
|
+
/**
|
|
764
|
+
* Rename a Google Doc
|
|
765
|
+
*/
|
|
766
|
+
declare function renameGoogleDoc(documentId: string, newName: string, accessToken: string): Promise<void>;
|
|
767
|
+
/**
|
|
768
|
+
* Duplicate a Google Doc
|
|
769
|
+
*/
|
|
770
|
+
declare function duplicateGoogleDoc(documentId: string, newName: string, accessToken: string): Promise<{
|
|
771
|
+
documentId: string;
|
|
772
|
+
url: string;
|
|
773
|
+
}>;
|
|
774
|
+
/**
|
|
775
|
+
* Create a Google Drive folder
|
|
776
|
+
*/
|
|
777
|
+
declare function createGoogleDriveFolder(folderName: string, accessToken: string, parentFolderId?: string): Promise<{
|
|
778
|
+
folderId: string;
|
|
779
|
+
url: string;
|
|
780
|
+
}>;
|
|
781
|
+
/**
|
|
782
|
+
* Extract folder ID from Google Drive folder URL
|
|
783
|
+
*/
|
|
784
|
+
declare function extractFolderIdFromUrl(url: string): string | null;
|
|
785
|
+
/**
|
|
786
|
+
* Delete a Google Drive folder (move to trash)
|
|
787
|
+
*/
|
|
788
|
+
declare function deleteGoogleDriveFolder(folderId: string, accessToken: string): Promise<void>;
|
|
789
|
+
/**
|
|
790
|
+
* Rename a Google Drive folder
|
|
791
|
+
*/
|
|
792
|
+
declare function renameGoogleDriveFolder(folderId: string, newName: string, accessToken: string): Promise<void>;
|
|
793
|
+
/**
|
|
794
|
+
* Create a new Google Doc in a specific folder or root
|
|
795
|
+
*/
|
|
796
|
+
declare function createGoogleDocInFolder(documentName: string, accessToken: string, parentFolderId?: string, initialContent?: string): Promise<{
|
|
797
|
+
documentId: string;
|
|
798
|
+
url: string;
|
|
799
|
+
}>;
|
|
800
|
+
/**
|
|
801
|
+
* List files and folders in a Google Drive folder
|
|
802
|
+
*/
|
|
803
|
+
declare function listGoogleDriveFolderContents(folderId: string, accessToken: string): Promise<Array<{
|
|
804
|
+
id: string;
|
|
805
|
+
name: string;
|
|
806
|
+
type: 'file' | 'folder';
|
|
807
|
+
mimeType: string;
|
|
808
|
+
url: string;
|
|
809
|
+
}>>;
|
|
810
|
+
|
|
811
|
+
/**
|
|
812
|
+
* Generate Notion OAuth authorization URL
|
|
813
|
+
* Notion OAuth supports page-level permissions through the authorization flow
|
|
814
|
+
*/
|
|
815
|
+
declare function getNotionAuthUrl(userId: string): string;
|
|
816
|
+
/**
|
|
817
|
+
* Exchange authorization code for tokens
|
|
818
|
+
*/
|
|
819
|
+
declare function exchangeNotionCode(code: string): Promise<{
|
|
820
|
+
accessToken: string;
|
|
821
|
+
workspaceId: string;
|
|
822
|
+
workspaceName: string;
|
|
823
|
+
botId: string;
|
|
824
|
+
}>;
|
|
825
|
+
/**
|
|
826
|
+
* Get Notion access token for a user
|
|
827
|
+
* Note: Notion tokens don't expire, so no refresh needed
|
|
828
|
+
*/
|
|
829
|
+
declare function getNotionAccessToken(userId: string, adapter: DAFStorageAdapter): Promise<string>;
|
|
830
|
+
/**
|
|
831
|
+
* Extract page ID from Notion URL
|
|
832
|
+
*/
|
|
833
|
+
declare function extractPageIdFromUrl(url: string): string | null;
|
|
834
|
+
/**
|
|
835
|
+
* Extract database ID from Notion URL
|
|
836
|
+
* Database URLs are similar to page URLs but may include view parameter
|
|
837
|
+
*/
|
|
838
|
+
declare function extractDatabaseIdFromUrl(url: string): string | null;
|
|
839
|
+
/**
|
|
840
|
+
* Get page title from Notion page
|
|
841
|
+
*/
|
|
842
|
+
declare function getNotionPageTitle(pageId: string, accessToken: string): Promise<string | null>;
|
|
843
|
+
/**
|
|
844
|
+
* Read content from a Notion page
|
|
845
|
+
*/
|
|
846
|
+
declare function readNotionPage(pageId: string, accessToken: string): Promise<string>;
|
|
847
|
+
/**
|
|
848
|
+
* Replace entire content of a Notion page
|
|
849
|
+
*/
|
|
850
|
+
declare function writeNotionPage(pageId: string, content: string, accessToken: string): Promise<void>;
|
|
851
|
+
/**
|
|
852
|
+
* Selectively replace blocks in a Notion page by block range
|
|
853
|
+
* Note: Notion doesn't support character-level indices, so we work with block indices
|
|
854
|
+
*/
|
|
855
|
+
declare function selectiveUpdateNotionPage(pageId: string, content: string, startBlockIndex: number, endBlockIndex: number, accessToken: string): Promise<void>;
|
|
856
|
+
/**
|
|
857
|
+
* Append content to a Notion page
|
|
858
|
+
*/
|
|
859
|
+
declare function appendNotionPage(pageId: string, content: string, accessToken: string): Promise<void>;
|
|
860
|
+
/**
|
|
861
|
+
* Delete a Notion page (archive it)
|
|
862
|
+
*/
|
|
863
|
+
declare function deleteNotionPage(pageId: string, accessToken: string): Promise<void>;
|
|
864
|
+
/**
|
|
865
|
+
* Rename a Notion page by updating its title property
|
|
866
|
+
*/
|
|
867
|
+
declare function renameNotionPage(pageId: string, newTitle: string, accessToken: string): Promise<void>;
|
|
868
|
+
/**
|
|
869
|
+
* Duplicate a Notion page (creates a new page with the same content)
|
|
870
|
+
*/
|
|
871
|
+
declare function duplicateNotionPage(pageId: string, newTitle: string, accessToken: string): Promise<{
|
|
872
|
+
pageId: string;
|
|
873
|
+
url: string;
|
|
874
|
+
}>;
|
|
875
|
+
/**
|
|
876
|
+
* Create a new Notion page as a subpage of another page or at workspace root
|
|
877
|
+
*/
|
|
878
|
+
declare function createNotionSubpage(parentPageId: string | undefined, pageTitle: string, accessToken: string, initialContent?: string): Promise<{
|
|
879
|
+
pageId: string;
|
|
880
|
+
url: string;
|
|
881
|
+
}>;
|
|
882
|
+
/**
|
|
883
|
+
* List child pages of a Notion page
|
|
884
|
+
*/
|
|
885
|
+
declare function listNotionPageChildren(pageId: string, accessToken: string): Promise<Array<{
|
|
886
|
+
id: string;
|
|
887
|
+
title: string;
|
|
888
|
+
type: 'page' | 'database';
|
|
889
|
+
url: string;
|
|
890
|
+
}>>;
|
|
891
|
+
/**
|
|
892
|
+
* Get database title/name and schema
|
|
893
|
+
*/
|
|
894
|
+
declare function getNotionDatabase(databaseId: string, accessToken: string): Promise<{
|
|
895
|
+
title: string;
|
|
896
|
+
properties: any;
|
|
897
|
+
}>;
|
|
898
|
+
/**
|
|
899
|
+
* Create a new page in a Notion database
|
|
900
|
+
* @param databaseId - The ID of the database to add the page to
|
|
901
|
+
* @param properties - Object containing property values (e.g., { "Name": "My Page", "Status": "In Progress" })
|
|
902
|
+
* @param content - Optional markdown content to add to the page body
|
|
903
|
+
* @param accessToken - Notion access token
|
|
904
|
+
*/
|
|
905
|
+
declare function createNotionDatabasePage(databaseId: string, properties: Record<string, any>, accessToken: string, content?: string): Promise<{
|
|
906
|
+
pageId: string;
|
|
907
|
+
url: string;
|
|
908
|
+
}>;
|
|
909
|
+
/**
|
|
910
|
+
* Query database pages (with optional filters)
|
|
911
|
+
*/
|
|
912
|
+
declare function queryNotionDatabase(databaseId: string, accessToken: string, filter?: any, sorts?: any[]): Promise<any[]>;
|
|
913
|
+
/**
|
|
914
|
+
* Create a new Notion database
|
|
915
|
+
* @param parentPageId - The ID of the parent page to create the database in
|
|
916
|
+
* @param title - The title of the database
|
|
917
|
+
* @param properties - Database property schema (e.g., { "Name": { title: {} }, "Status": { select: { options: [...] } } })
|
|
918
|
+
* @param accessToken - Notion access token
|
|
919
|
+
*/
|
|
920
|
+
declare function createNotionDatabase(parentPageId: string | undefined, title: string, properties: Record<string, any>, accessToken: string): Promise<{
|
|
921
|
+
databaseId: string;
|
|
922
|
+
url: string;
|
|
923
|
+
}>;
|
|
924
|
+
/**
|
|
925
|
+
* Read database schema and properties
|
|
926
|
+
*/
|
|
927
|
+
declare function readNotionDatabase(databaseId: string, accessToken: string): Promise<{
|
|
928
|
+
title: string;
|
|
929
|
+
properties: Record<string, any>;
|
|
930
|
+
url: string;
|
|
931
|
+
}>;
|
|
932
|
+
/**
|
|
933
|
+
* Update database title and/or properties
|
|
934
|
+
*/
|
|
935
|
+
declare function updateNotionDatabase(databaseId: string, accessToken: string, title?: string, properties?: Record<string, any>): Promise<void>;
|
|
936
|
+
/**
|
|
937
|
+
* Archive/delete a Notion database
|
|
938
|
+
*/
|
|
939
|
+
declare function deleteNotionDatabase(databaseId: string, accessToken: string): Promise<void>;
|
|
940
|
+
/**
|
|
941
|
+
* Duplicate a Notion database (copies schema but not data/rows)
|
|
942
|
+
*/
|
|
943
|
+
declare function duplicateNotionDatabase(databaseId: string, accessToken: string, newDatabaseName?: string): Promise<{
|
|
944
|
+
databaseId: string;
|
|
945
|
+
title: string;
|
|
946
|
+
url: string;
|
|
947
|
+
}>;
|
|
948
|
+
/**
|
|
949
|
+
* Update properties and/or content of a database page
|
|
950
|
+
* @param pageId - The ID of the page to update
|
|
951
|
+
* @param properties - Optional object containing property values to update
|
|
952
|
+
* @param content - Optional markdown content to replace the page body
|
|
953
|
+
* @param accessToken - Notion access token
|
|
954
|
+
*/
|
|
955
|
+
declare function updateNotionDatabasePage(pageId: string, accessToken: string, properties?: Record<string, any>, content?: string): Promise<void>;
|
|
956
|
+
|
|
957
|
+
export { type Action, type ActionConfig, type ActionResult, type AddDocumentAction, type AddFolderAction, type AskUserInputAction, type CrawlAction, type CreateDatabaseAction, type DAFEmailIntegration, type DAFGoogleIntegration, type DAFNotionIntegration, type DAFProcessRecord, type DAFResourceRecord, type DAFRunRecord, type DAFStorageAdapter, type DAFUserRecord, type DbDeleteAction, type DbFindAction, type DbInsertAction, type DbUpdateAction, type DeleteDatabaseAction, type DuplicateDatabaseAction, type DuplicateDocumentAction, type EditorTransformAction, type ExecutionContext, type FirecrawlActionType, type FormatDocumentAction, GENERIC_VARIABLES, type GenericVariable, type JsonFormatOptions, type LocationSettings, MODEL_PRICING, type NewsSearchAction, type QuickSearchAction, type ReadDatabaseAction, type ReadDocumentAction, type ReadFolderAction, type RemoveDocumentAction, type RemoveFolderAction, type RenameDocumentAction, type RenameFolderAction, type ScrapeAction, type ScrapeFormat, type ScreenshotFormatOptions, type SearchAction, type SendEmailAction, TIER_TOKEN_LIMITS, type TavilySearchAction, type TokenUsage, type UpdateDatabaseAction, type UserProviderSettings, type WebhookConfig, type WriteDatabaseAction, type WriteDocumentAction, appendGoogleDoc, appendNotionPage, buildTokenUsage, calculateTokenCost, canUserAffordApiCall, checkAndUpdateCostLimit, createGoogleDocInFolder, createGoogleDriveFolder, createNotionDatabase, createNotionDatabasePage, createNotionSubpage, deleteGoogleDoc, deleteGoogleDriveFolder, deleteNotionDatabase, deleteNotionPage, duplicateGoogleDoc, duplicateNotionDatabase, duplicateNotionPage, exchangeGoogleCode, exchangeNotionCode, executeAction, executeChatTurn, executeProcess, executeProcessInRun, extractActionsFromMessage, extractDatabaseIdFromUrl, extractDocIdFromUrl, extractFolderIdFromUrl, extractPageIdFromUrl, formatActionResult, formatGoogleDoc, getDescAllActions, getDescChatActions, getDescEditorActions, getGenericVariable, getGenericVariableNames, getGenericVariables, getGoogleAccessToken, getGoogleAuthUrl, getGoogleOAuth2Client, getModelProvider, getNotionAccessToken, getNotionAuthUrl, getNotionDatabase, getNotionPageTitle, getProviderFromModel, isGenericVariable, listGoogleDriveFolderContents, listNotionPageChildren, mergeVariables, processMessageActions, queryNotionDatabase, readGoogleDoc, readNotionDatabase, readNotionPage, refreshGoogleToken, renameGoogleDoc, renameGoogleDriveFolder, renameNotionPage, resumeProcessExecution, selectiveUpdateGoogleDoc, selectiveUpdateNotionPage, substituteVariables, updateNotionDatabase, updateNotionDatabasePage, writeGoogleDoc, writeNotionPage };
|