@exulu/backend 1.25.5 → 1.27.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/index.d.ts CHANGED
@@ -27,7 +27,7 @@ declare const STATISTICS_TYPE_ENUM: {
27
27
  AGENT_RUN: string;
28
28
  };
29
29
 
30
- type ExuluFieldTypes = "text" | "longText" | "shortText" | "number" | "boolean" | "code" | "json" | "enum" | "markdown";
30
+ type ExuluFieldTypes = "text" | "longText" | "shortText" | "number" | "boolean" | "code" | "json" | "enum" | "markdown" | "file" | "date" | "uuid";
31
31
 
32
32
  interface Item {
33
33
  id?: string;
@@ -80,6 +80,7 @@ type ExuluConfig = {
80
80
  s3secret: string;
81
81
  s3Bucket: string;
82
82
  s3endpoint?: string;
83
+ s3prefix?: string;
83
84
  };
84
85
  };
85
86
  declare class ExuluApp {
@@ -144,6 +145,7 @@ type User = {
144
145
  id: string;
145
146
  name: string;
146
147
  agents: "read" | "write";
148
+ evals: "read" | "write";
147
149
  workflows: "read" | "write";
148
150
  variables: "read" | "write";
149
151
  users: "read" | "write";
@@ -179,13 +181,11 @@ type ExuluAgentConfig = {
179
181
  };
180
182
  };
181
183
  };
182
- type ExuluAgentEval = {
183
- runner: ExuluEvalRunnerInstance;
184
- };
185
184
  type imageTypes = '.png' | '.jpg' | '.jpeg' | '.gif' | '.webp';
186
185
  type fileTypes = '.pdf' | '.docx' | '.xlsx' | '.xls' | '.csv' | '.pptx' | '.ppt' | '.txt' | '.md' | '.json';
187
186
  type audioTypes = '.mp3' | '.wav' | '.m4a' | '.mp4' | '.mpeg';
188
187
  type videoTypes = '.mp4' | '.m4a' | '.mp3' | '.mpeg' | '.wav';
188
+ type allFileTypes = imageTypes | fileTypes | audioTypes | videoTypes;
189
189
  interface ExuluAgentParams {
190
190
  id: string;
191
191
  name: string;
@@ -193,6 +193,7 @@ interface ExuluAgentParams {
193
193
  description: string;
194
194
  config?: ExuluAgentConfig | undefined;
195
195
  maxContextLength?: number;
196
+ provider: string;
196
197
  capabilities?: {
197
198
  text: boolean;
198
199
  images: imageTypes[];
@@ -200,9 +201,9 @@ interface ExuluAgentParams {
200
201
  audio: audioTypes[];
201
202
  video: videoTypes[];
202
203
  };
203
- evals?: ExuluAgentEval[];
204
204
  outputSchema?: z.ZodType;
205
205
  rateLimit?: RateLimiterRule;
206
+ evals?: ExuluEval[];
206
207
  }
207
208
  interface ExuluAgentToolConfig {
208
209
  id: string;
@@ -213,9 +214,54 @@ interface ExuluAgentToolConfig {
213
214
  value?: any;
214
215
  }[];
215
216
  }
217
+ type ExuluQueueConfig = {
218
+ queue: Queue;
219
+ ratelimit: number;
220
+ concurrency: number;
221
+ };
222
+ type ExuluEvalTokenMetadata = {
223
+ totalTokens?: number;
224
+ reasoningTokens?: number;
225
+ inputTokens?: number;
226
+ outputTokens?: number;
227
+ cachedInputTokens?: number;
228
+ };
229
+ type ExuluEvalMetadata = {
230
+ tokens?: ExuluEvalTokenMetadata;
231
+ duration?: number;
232
+ };
233
+ interface ExuluEvalParams {
234
+ id: string;
235
+ name: string;
236
+ description: string;
237
+ execute: (params: {
238
+ messages: UIMessage[];
239
+ metadata: ExuluEvalMetadata;
240
+ config?: Record<string, any>;
241
+ }) => Promise<number>;
242
+ config?: {
243
+ name: string;
244
+ description: string;
245
+ }[];
246
+ queue: ExuluQueueConfig;
247
+ }
248
+ declare class ExuluEval {
249
+ id: string;
250
+ name: string;
251
+ description: string;
252
+ private execute;
253
+ config?: {
254
+ name: string;
255
+ description: string;
256
+ }[];
257
+ queue: ExuluQueueConfig;
258
+ constructor({ id, name, description, execute, config, queue }: ExuluEvalParams);
259
+ run(messages: UIMessage[], metadata: ExuluEvalMetadata, config?: Record<string, any>): Promise<number>;
260
+ }
216
261
  declare class ExuluAgent {
217
262
  id: string;
218
263
  name: string;
264
+ provider: string;
219
265
  description: string;
220
266
  slug: string;
221
267
  type: "agent";
@@ -223,7 +269,7 @@ declare class ExuluAgent {
223
269
  maxContextLength?: number;
224
270
  rateLimit?: RateLimiterRule;
225
271
  config?: ExuluAgentConfig | undefined;
226
- evals?: ExuluAgentEval[];
272
+ evals?: ExuluEval[];
227
273
  model?: {
228
274
  create: ({ apiKey }: {
229
275
  apiKey: string;
@@ -236,11 +282,11 @@ declare class ExuluAgent {
236
282
  audio: string[];
237
283
  video: string[];
238
284
  };
239
- constructor({ id, name, description, config, rateLimit, capabilities, type, evals, maxContextLength }: ExuluAgentParams);
285
+ constructor({ id, name, description, config, rateLimit, capabilities, type, maxContextLength, evals, provider }: ExuluAgentParams);
240
286
  get providerName(): string;
241
287
  get modelName(): string;
242
288
  tool: (instance: string, agents: ExuluAgent[]) => Promise<ExuluTool | null>;
243
- generateSync: ({ prompt, user, session, message, currentTools, allExuluTools, statistics, toolConfigs, providerapikey, contexts, exuluConfig, filesContext, outputSchema, instructions }: {
289
+ generateSync: ({ prompt, user, session, message, currentTools, allExuluTools, statistics, toolConfigs, providerapikey, contexts, exuluConfig, outputSchema, instructions }: {
244
290
  prompt?: string;
245
291
  user?: User;
246
292
  session?: string;
@@ -252,11 +298,10 @@ declare class ExuluAgent {
252
298
  providerapikey: string;
253
299
  contexts?: ExuluContext[] | undefined;
254
300
  exuluConfig?: ExuluConfig;
255
- filesContext?: ExuluContext;
256
301
  instructions?: string;
257
302
  outputSchema?: z.ZodType;
258
303
  }) => Promise<string | any>;
259
- generateStream: ({ express, user, session, message, currentTools, allExuluTools, statistics, toolConfigs, providerapikey, contexts, exuluConfig, filesContext, instructions, }: {
304
+ generateStream: ({ express, user, session, message, currentTools, allExuluTools, statistics, toolConfigs, providerapikey, contexts, exuluConfig, instructions, }: {
260
305
  express: {
261
306
  res: Response;
262
307
  req: Request;
@@ -271,7 +316,6 @@ declare class ExuluAgent {
271
316
  providerapikey: string;
272
317
  contexts?: ExuluContext[] | undefined;
273
318
  exuluConfig?: ExuluConfig;
274
- filesContext?: ExuluContext;
275
319
  instructions?: string;
276
320
  }) => Promise<void>;
277
321
  }
@@ -283,7 +327,9 @@ type VectorOperationResponse = Promise<{
283
327
  type VectorGenerateOperation = (inputs: ChunkerResponse) => VectorGenerationResponse;
284
328
  type ChunkerOperation = (item: Item & {
285
329
  id: string;
286
- }, maxChunkSize: number) => Promise<ChunkerResponse>;
330
+ }, maxChunkSize: number, utils: {
331
+ storage: ExuluStorage;
332
+ }) => Promise<ChunkerResponse>;
287
333
  type ChunkerResponse = {
288
334
  item: Item & {
289
335
  id: string;
@@ -305,106 +351,27 @@ declare class ExuluEmbedder {
305
351
  id: string;
306
352
  name: string;
307
353
  slug: string;
308
- queue?: Queue;
354
+ queue?: Promise<ExuluQueueConfig>;
309
355
  private generateEmbeddings;
356
+ description: string;
310
357
  vectorDimensions: number;
311
358
  maxChunkSize: number;
312
- chunker: ChunkerOperation;
359
+ _chunker: ChunkerOperation;
313
360
  constructor({ id, name, description, generateEmbeddings, queue, vectorDimensions, maxChunkSize, chunker }: {
314
361
  id: string;
315
362
  name: string;
316
363
  description: string;
317
364
  generateEmbeddings: VectorGenerateOperation;
318
365
  chunker: ChunkerOperation;
319
- queue?: Queue;
366
+ queue?: Promise<ExuluQueueConfig>;
320
367
  vectorDimensions: number;
321
368
  maxChunkSize: number;
322
369
  });
323
- generateFromQuery(query: string, statistics?: ExuluStatisticParams, user?: number, role?: string): VectorGenerationResponse;
324
- generateFromDocument(input: Item, statistics?: ExuluStatisticParams, user?: number, role?: string): VectorGenerationResponse;
325
- }
326
- interface WorkflowVariable {
327
- name: string;
328
- description?: string;
329
- type: 'string';
330
- required: boolean;
331
- defaultValue?: string;
332
- }
333
- interface WorkflowStep {
334
- id: string;
335
- type: 'user' | 'assistant' | 'tool';
336
- content?: string;
337
- contentExample?: string;
338
- toolName?: string;
339
- variablesUsed?: string[];
340
- }
341
- interface ExuluWorkflow {
342
- id: string;
343
- name: string;
344
- description?: string;
345
- rights_mode?: ExuluRightsMode;
346
- RBAC?: ExuluRBAC;
347
- variables?: WorkflowVariable[];
348
- steps_json?: WorkflowStep[];
349
- }
350
- interface ExuluRBAC {
351
- users?: Array<{
370
+ chunker: (item: Item & {
352
371
  id: string;
353
- rights: 'read' | 'write';
354
- }>;
355
- roles?: Array<{
356
- id: string;
357
- rights: 'read' | 'write';
358
- }>;
359
- }
360
- type ExuluEvalRunnerInstance = {
361
- name: string;
362
- description: string;
363
- testcases: ExuluEvalInput[];
364
- run: ExuluEvalRunner;
365
- };
366
- type ExuluEvalRunner = ({ data, runner }: {
367
- data: ExuluEvalInput;
368
- runner: {
369
- agent?: ExuluAgent & {
370
- providerapikey: string;
371
- };
372
- workflow?: ExuluWorkflow;
373
- };
374
- }) => Promise<{
375
- score: number;
376
- comment: string;
377
- }>;
378
- type ExuluEvalInput = {
379
- prompt?: string;
380
- inputs?: any;
381
- result?: string;
382
- category?: string;
383
- metadata?: Record<string, any>;
384
- duration?: number;
385
- reference?: string;
386
- };
387
- declare class ExuluEval {
388
- name: string;
389
- description: string;
390
- constructor({ name, description }: {
391
- name: string;
392
- description: string;
393
- });
394
- create: {
395
- LlmAsAJudge: {
396
- niah: ({ label, model, needles, testDocument, contextlengths }: {
397
- label: string;
398
- model: LanguageModel;
399
- needles: {
400
- question: string;
401
- answer: string;
402
- }[];
403
- testDocument: string;
404
- contextlengths: (5000 | 30000 | 50000 | 128000)[];
405
- }) => ExuluEvalRunnerInstance;
406
- };
407
- };
372
+ }, maxChunkSize: number, config: ExuluConfig) => Promise<ChunkerResponse>;
373
+ generateFromQuery(query: string, statistics?: ExuluStatisticParams, user?: number, role?: string): VectorGenerationResponse;
374
+ generateFromDocument(input: Item, config: ExuluConfig, statistics?: ExuluStatisticParams, user?: number, role?: string): VectorGenerationResponse;
408
375
  }
409
376
  declare class ExuluTool {
410
377
  id: string;
@@ -438,12 +405,50 @@ declare class ExuluTool {
438
405
  }>;
439
406
  });
440
407
  }
408
+ type ExuluContextFieldProcessor = {
409
+ description: string;
410
+ execute: ({ item, user, role, utils, config }: {
411
+ item: Item & {
412
+ field: string;
413
+ };
414
+ user: number;
415
+ role: string;
416
+ utils: {
417
+ storage: ExuluStorage;
418
+ items: {
419
+ update: ExuluContext['updateItem'];
420
+ create: ExuluContext['createItem'];
421
+ delete: ExuluContext['deleteItem'];
422
+ };
423
+ };
424
+ config: ExuluConfig;
425
+ }) => Promise<string>;
426
+ config?: {
427
+ queue?: Promise<ExuluQueueConfig>;
428
+ trigger: "manual" | "onUpdate" | "onCreate" | "always";
429
+ };
430
+ };
441
431
  type ExuluContextFieldDefinition = {
442
432
  name: string;
443
433
  type: ExuluFieldTypes;
444
434
  unique?: boolean;
435
+ required?: boolean;
436
+ default?: any;
437
+ calculated?: boolean;
438
+ index?: boolean;
439
+ enumValues?: string[];
440
+ allowedFileTypes?: allFileTypes[];
441
+ processor?: ExuluContextFieldProcessor;
445
442
  };
446
443
  type ExuluRightsMode = "private" | "users" | "roles" | "public" | "projects";
444
+ declare class ExuluStorage {
445
+ private config;
446
+ constructor({ config }: {
447
+ config: ExuluConfig;
448
+ });
449
+ getPresignedUrl: (key: string) => Promise<string>;
450
+ uploadFile: (user: number, file: Buffer | Uint8Array, key: string, type: string, metadata?: Record<string, string>) => Promise<string>;
451
+ }
447
452
  declare class ExuluContext {
448
453
  id: string;
449
454
  name: string;
@@ -475,39 +480,37 @@ declare class ExuluContext {
475
480
  language?: "german" | "english";
476
481
  };
477
482
  });
483
+ process: (trigger: STATISTICS_LABELS, user: number, role: string, item: Item & {
484
+ field: string;
485
+ }, config: ExuluConfig) => Promise<{
486
+ result: string;
487
+ job?: string;
488
+ }>;
478
489
  deleteAll: () => Promise<VectorOperationResponse>;
479
490
  tableExists: () => Promise<boolean>;
480
491
  chunksTableExists: () => Promise<boolean>;
481
- createAndUpsertEmbeddings: (item: Item, user?: number, statistics?: ExuluStatisticParams, role?: string, job?: string) => Promise<{
492
+ createAndUpsertEmbeddings: (item: Item, config: ExuluConfig, user?: number, statistics?: ExuluStatisticParams, role?: string, job?: string) => Promise<{
482
493
  id: string;
483
494
  chunks?: number;
484
495
  job?: string;
485
496
  }>;
486
- createItem: (item: Item, user?: number, role?: string, upsert?: boolean) => Promise<{
487
- item: Item;
488
- job?: string;
489
- }>;
490
- updateItem: (item: Item, user?: number, role?: string) => Promise<{
491
- item: Item;
492
- job?: string;
493
- }>;
494
- deleteItem: (item: Item, user?: number, role?: string) => Promise<{
495
- id: string;
496
- job?: string;
497
- }>;
497
+ private createItem;
498
+ private updateItem;
499
+ private deleteItem;
498
500
  embeddings: {
499
501
  generate: {
500
- one: ({ item, user, role, trigger }: {
502
+ one: ({ item, user, role, trigger, config }: {
501
503
  item: Item;
502
504
  user?: number;
503
505
  role?: string;
504
506
  trigger: STATISTICS_LABELS;
507
+ config: ExuluConfig;
505
508
  }) => Promise<{
506
509
  id: string;
507
510
  job?: string;
508
511
  chunks?: number;
509
512
  }>;
510
- all: (userId?: number, roleId?: string) => Promise<{
513
+ all: (config: ExuluConfig, userId?: number, roleId?: string) => Promise<{
511
514
  jobs: string[];
512
515
  items: number;
513
516
  }>;
@@ -540,10 +543,18 @@ declare const authentication: ({ apikey, authtoken, internalkey, db, }: {
540
543
  }>;
541
544
 
542
545
  declare class ExuluQueues {
543
- queues: Queue[];
546
+ queues: {
547
+ queue: Queue;
548
+ ratelimit: number;
549
+ concurrency: number;
550
+ }[];
544
551
  constructor();
545
- queue(name: string): Queue | undefined;
546
- use(name: string): Queue;
552
+ queue(name: string): {
553
+ queue: Queue;
554
+ ratelimit: number;
555
+ concurrency: number;
556
+ } | undefined;
557
+ use: (name: string, concurrency?: number, ratelimit?: number) => Promise<ExuluQueueConfig>;
547
558
  }
548
559
  declare const queues: ExuluQueues;
549
560
 
@@ -1420,7 +1431,6 @@ declare const ExuluJobs: {
1420
1431
  };
1421
1432
  };
1422
1433
  declare const ExuluDefaultContexts: {
1423
- files: ExuluContext;
1424
1434
  codeStandards: ExuluContext;
1425
1435
  outputs: ExuluContext;
1426
1436
  };
@@ -1428,10 +1438,18 @@ declare const ExuluDefaultAgents: {
1428
1438
  anthropic: {
1429
1439
  opus4: ExuluAgent;
1430
1440
  sonnet4: ExuluAgent;
1441
+ sonnet45: ExuluAgent;
1431
1442
  };
1432
1443
  openai: {
1433
1444
  gpt5Mini: ExuluAgent;
1434
1445
  gpt5: ExuluAgent;
1446
+ gpt5pro: ExuluAgent;
1447
+ gpt5Codex: ExuluAgent;
1448
+ gpt5Nano: ExuluAgent;
1449
+ gpt41: ExuluAgent;
1450
+ gpt41Mini: ExuluAgent;
1451
+ gpt4o: ExuluAgent;
1452
+ gpt4oMini: ExuluAgent;
1435
1453
  };
1436
1454
  };
1437
1455
  declare const ExuluVariables: {
@@ -1482,4 +1500,4 @@ declare const ExuluChunkers: {
1482
1500
  };
1483
1501
  };
1484
1502
 
1485
- export { type JOB_STATUS as EXULU_JOB_STATUS, JOB_STATUS_ENUM as EXULU_JOB_STATUS_ENUM, type STATISTICS_TYPE as EXULU_STATISTICS_TYPE, STATISTICS_TYPE_ENUM as EXULU_STATISTICS_TYPE_ENUM, ExuluAgent, ExuluApp, authentication as ExuluAuthentication, ExuluChunkers, ExuluContext, ExuluDefaultAgents, ExuluDefaultContexts, ExuluEmbedder, ExuluEval, ExuluJobs, ExuluOtel, queues as ExuluQueues, ExuluTool, ExuluUtils, ExuluVariables, db };
1503
+ export { type JOB_STATUS as EXULU_JOB_STATUS, JOB_STATUS_ENUM as EXULU_JOB_STATUS_ENUM, type STATISTICS_TYPE as EXULU_STATISTICS_TYPE, STATISTICS_TYPE_ENUM as EXULU_STATISTICS_TYPE_ENUM, ExuluAgent, ExuluApp, authentication as ExuluAuthentication, ExuluChunkers, ExuluContext, ExuluDefaultAgents, ExuluDefaultContexts, ExuluEmbedder, ExuluEval, type ExuluEvalMetadata, type ExuluEvalTokenMetadata, ExuluJobs, ExuluOtel, type ExuluQueueConfig, queues as ExuluQueues, ExuluTool, ExuluUtils, ExuluVariables, db };