@exulu/backend 1.17.0 → 1.18.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.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as _opentelemetry_sdk_node from '@opentelemetry/sdk-node';
2
2
  import * as bullmq from 'bullmq';
3
- import { Queue, Job } from 'bullmq';
3
+ import { Queue } from 'bullmq';
4
4
  import { RedisClientType } from 'redis';
5
5
  import { ZodSchema, z } from 'zod';
6
6
  import { Tool, LanguageModel, UIMessage } from 'ai';
@@ -37,7 +37,7 @@ interface Item {
37
37
  external_id?: string;
38
38
  source?: string;
39
39
  tags?: string[];
40
- textLength?: number;
40
+ textlength?: number;
41
41
  chunks?: {
42
42
  id: string;
43
43
  index: number;
@@ -229,13 +229,6 @@ declare class ExuluEmbedder {
229
229
  generateFromQuery(query: string, statistics?: ExuluStatisticParams, user?: string, role?: string): VectorGenerationResponse;
230
230
  generateFromDocument(input: Item, statistics?: ExuluStatisticParams, user?: string, role?: string): VectorGenerationResponse;
231
231
  }
232
- declare class ExuluLogger {
233
- private readonly logPath?;
234
- private readonly job?;
235
- constructor(job?: Job, logsDir?: string);
236
- write(message: string, level: "INFO" | "ERROR" | "WARNING"): Promise<void>;
237
- }
238
- type AddSourceArgs = Omit<ExuluSourceConstructorArgs, "context">;
239
232
  interface WorkflowVariable {
240
233
  name: string;
241
234
  description?: string;
@@ -347,6 +340,7 @@ type ExuluContextFieldDefinition = {
347
340
  type: ExuluFieldTypes;
348
341
  unique?: boolean;
349
342
  };
343
+ type ExuluRightsMode = "private" | "users" | "roles" | "public" | "projects";
350
344
  declare class ExuluContext {
351
345
  id: string;
352
346
  name: string;
@@ -354,31 +348,29 @@ declare class ExuluContext {
354
348
  fields: ExuluContextFieldDefinition[];
355
349
  rateLimit?: RateLimiterRule;
356
350
  description: string;
357
- embedder: ExuluEmbedder;
351
+ embedder?: ExuluEmbedder;
358
352
  queryRewriter?: (query: string) => Promise<string>;
359
353
  resultReranker?: (results: any[]) => Promise<any[]>;
360
- private _sources;
361
354
  configuration: {
362
- calculateVectors: "manual" | "onUpdate" | "onInsert" | "always";
355
+ calculateVectors?: "manual" | "onUpdate" | "onInsert" | "always";
356
+ defaultRightsMode?: ExuluRightsMode;
363
357
  };
364
358
  constructor({ id, name, description, embedder, active, rateLimit, fields, queryRewriter, resultReranker, configuration }: {
365
359
  id: string;
366
360
  name: string;
367
361
  fields: ExuluContextFieldDefinition[];
368
362
  description: string;
369
- embedder: ExuluEmbedder;
363
+ embedder?: ExuluEmbedder;
370
364
  active: boolean;
371
365
  rateLimit?: RateLimiterRule;
372
366
  queryRewriter?: (query: string) => Promise<string>;
373
367
  resultReranker?: (results: any[]) => Promise<any[]>;
374
368
  configuration?: {
375
- calculateVectors: "manual" | "onUpdate" | "onInsert" | "always";
369
+ calculateVectors?: "manual" | "onUpdate" | "onInsert" | "always";
370
+ defaultRightsMode?: ExuluRightsMode;
376
371
  };
377
372
  });
378
- deleteOne: (id: string) => VectorOperationResponse;
379
- deleteAll: () => VectorOperationResponse;
380
- getTableName: () => string;
381
- getChunksTableName: () => string;
373
+ deleteAll: () => Promise<VectorOperationResponse>;
382
374
  tableExists: () => Promise<boolean>;
383
375
  createAndUpsertEmbeddings: (item: Item, user: string, statistics: ExuluStatisticParams, role?: string) => Promise<{
384
376
  id: string | undefined;
@@ -424,7 +416,7 @@ declare class ExuluContext {
424
416
  context: {
425
417
  name: string;
426
418
  id: string;
427
- embedder: string;
419
+ embedder: string | undefined;
428
420
  };
429
421
  items: any[];
430
422
  } | {
@@ -444,43 +436,7 @@ declare class ExuluContext {
444
436
  createItemsTable: () => Promise<void>;
445
437
  createChunksTable: () => Promise<void>;
446
438
  tool: () => ExuluTool;
447
- sources: {
448
- add: (inputs: AddSourceArgs) => ExuluSource;
449
- get: (id?: string) => ExuluSource[] | (ExuluSource | undefined);
450
- };
451
439
  }
452
- /**
453
- * @param updaters - Defines how this source decides when and which data to send to the embedder for updating vectors
454
- * @param updaters.type - The type of update mechanism:
455
- * - "manual": Will be shown in the Exulu frontend UI via a Button for manual triggering
456
- * - "cron": Will automatically update on a schedule
457
- * - "webhook": Will update when triggered by an external webhook
458
- * @param updaters.fn - The function that handles the update logic
459
- * @param configuration - Defines fields shown in the UI that admins can set for each instance of the Source
460
- * This allows reusing logic while exposing configurable variables (e.g. a "query" field)
461
- * that admins can set differently for different instances in the UI
462
- */
463
- type ExuluSourceConstructorArgs = {
464
- id: string;
465
- name: string;
466
- description: string;
467
- updaters: ExuluSourceUpdaterArgs[];
468
- context: string;
469
- };
470
- type SourceDocument = {
471
- id: string;
472
- content: string;
473
- metadata?: Record<string, any>;
474
- };
475
- type ExuluSourceUpdaterArgs = {
476
- id: string;
477
- type: "manual" | "cron" | "webhook";
478
- fn: (configuration: Record<string, any>) => Promise<SourceDocument[]>;
479
- configuration: Record<string, {
480
- type: "string" | "number" | "query";
481
- example: string;
482
- }>;
483
- };
484
440
  type STATISTICS_LABELS = "tool" | "agent" | "flow" | "api" | "claude-code" | "user";
485
441
  type ExuluStatistic = {
486
442
  name: string;
@@ -490,17 +446,6 @@ type ExuluStatistic = {
490
446
  total: number;
491
447
  };
492
448
  type ExuluStatisticParams = Omit<ExuluStatistic, "total" | "name" | "type">;
493
- type ExuluSourceUpdater = ExuluSourceUpdaterArgs & {
494
- slug?: string;
495
- };
496
- declare class ExuluSource {
497
- id: string;
498
- name: string;
499
- description: string;
500
- updaters: ExuluSourceUpdater[];
501
- context: string;
502
- constructor({ id, name, description, updaters, context }: ExuluSourceConstructorArgs);
503
- }
504
449
 
505
450
  type ExuluConfig = {
506
451
  telemetry?: {
@@ -1482,4 +1427,4 @@ declare const ExuluChunkers: {
1482
1427
  };
1483
1428
  };
1484
1429
 
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, ExuluEmbedder, ExuluEval, ExuluJobs, ExuluLogger, ExuluOtel, queues as ExuluQueues, ExuluSource, ExuluTool, ExuluZodFileType, db };
1430
+ 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, ExuluEmbedder, ExuluEval, ExuluJobs, ExuluOtel, queues as ExuluQueues, ExuluTool, ExuluZodFileType, db };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as _opentelemetry_sdk_node from '@opentelemetry/sdk-node';
2
2
  import * as bullmq from 'bullmq';
3
- import { Queue, Job } from 'bullmq';
3
+ import { Queue } from 'bullmq';
4
4
  import { RedisClientType } from 'redis';
5
5
  import { ZodSchema, z } from 'zod';
6
6
  import { Tool, LanguageModel, UIMessage } from 'ai';
@@ -37,7 +37,7 @@ interface Item {
37
37
  external_id?: string;
38
38
  source?: string;
39
39
  tags?: string[];
40
- textLength?: number;
40
+ textlength?: number;
41
41
  chunks?: {
42
42
  id: string;
43
43
  index: number;
@@ -229,13 +229,6 @@ declare class ExuluEmbedder {
229
229
  generateFromQuery(query: string, statistics?: ExuluStatisticParams, user?: string, role?: string): VectorGenerationResponse;
230
230
  generateFromDocument(input: Item, statistics?: ExuluStatisticParams, user?: string, role?: string): VectorGenerationResponse;
231
231
  }
232
- declare class ExuluLogger {
233
- private readonly logPath?;
234
- private readonly job?;
235
- constructor(job?: Job, logsDir?: string);
236
- write(message: string, level: "INFO" | "ERROR" | "WARNING"): Promise<void>;
237
- }
238
- type AddSourceArgs = Omit<ExuluSourceConstructorArgs, "context">;
239
232
  interface WorkflowVariable {
240
233
  name: string;
241
234
  description?: string;
@@ -347,6 +340,7 @@ type ExuluContextFieldDefinition = {
347
340
  type: ExuluFieldTypes;
348
341
  unique?: boolean;
349
342
  };
343
+ type ExuluRightsMode = "private" | "users" | "roles" | "public" | "projects";
350
344
  declare class ExuluContext {
351
345
  id: string;
352
346
  name: string;
@@ -354,31 +348,29 @@ declare class ExuluContext {
354
348
  fields: ExuluContextFieldDefinition[];
355
349
  rateLimit?: RateLimiterRule;
356
350
  description: string;
357
- embedder: ExuluEmbedder;
351
+ embedder?: ExuluEmbedder;
358
352
  queryRewriter?: (query: string) => Promise<string>;
359
353
  resultReranker?: (results: any[]) => Promise<any[]>;
360
- private _sources;
361
354
  configuration: {
362
- calculateVectors: "manual" | "onUpdate" | "onInsert" | "always";
355
+ calculateVectors?: "manual" | "onUpdate" | "onInsert" | "always";
356
+ defaultRightsMode?: ExuluRightsMode;
363
357
  };
364
358
  constructor({ id, name, description, embedder, active, rateLimit, fields, queryRewriter, resultReranker, configuration }: {
365
359
  id: string;
366
360
  name: string;
367
361
  fields: ExuluContextFieldDefinition[];
368
362
  description: string;
369
- embedder: ExuluEmbedder;
363
+ embedder?: ExuluEmbedder;
370
364
  active: boolean;
371
365
  rateLimit?: RateLimiterRule;
372
366
  queryRewriter?: (query: string) => Promise<string>;
373
367
  resultReranker?: (results: any[]) => Promise<any[]>;
374
368
  configuration?: {
375
- calculateVectors: "manual" | "onUpdate" | "onInsert" | "always";
369
+ calculateVectors?: "manual" | "onUpdate" | "onInsert" | "always";
370
+ defaultRightsMode?: ExuluRightsMode;
376
371
  };
377
372
  });
378
- deleteOne: (id: string) => VectorOperationResponse;
379
- deleteAll: () => VectorOperationResponse;
380
- getTableName: () => string;
381
- getChunksTableName: () => string;
373
+ deleteAll: () => Promise<VectorOperationResponse>;
382
374
  tableExists: () => Promise<boolean>;
383
375
  createAndUpsertEmbeddings: (item: Item, user: string, statistics: ExuluStatisticParams, role?: string) => Promise<{
384
376
  id: string | undefined;
@@ -424,7 +416,7 @@ declare class ExuluContext {
424
416
  context: {
425
417
  name: string;
426
418
  id: string;
427
- embedder: string;
419
+ embedder: string | undefined;
428
420
  };
429
421
  items: any[];
430
422
  } | {
@@ -444,43 +436,7 @@ declare class ExuluContext {
444
436
  createItemsTable: () => Promise<void>;
445
437
  createChunksTable: () => Promise<void>;
446
438
  tool: () => ExuluTool;
447
- sources: {
448
- add: (inputs: AddSourceArgs) => ExuluSource;
449
- get: (id?: string) => ExuluSource[] | (ExuluSource | undefined);
450
- };
451
439
  }
452
- /**
453
- * @param updaters - Defines how this source decides when and which data to send to the embedder for updating vectors
454
- * @param updaters.type - The type of update mechanism:
455
- * - "manual": Will be shown in the Exulu frontend UI via a Button for manual triggering
456
- * - "cron": Will automatically update on a schedule
457
- * - "webhook": Will update when triggered by an external webhook
458
- * @param updaters.fn - The function that handles the update logic
459
- * @param configuration - Defines fields shown in the UI that admins can set for each instance of the Source
460
- * This allows reusing logic while exposing configurable variables (e.g. a "query" field)
461
- * that admins can set differently for different instances in the UI
462
- */
463
- type ExuluSourceConstructorArgs = {
464
- id: string;
465
- name: string;
466
- description: string;
467
- updaters: ExuluSourceUpdaterArgs[];
468
- context: string;
469
- };
470
- type SourceDocument = {
471
- id: string;
472
- content: string;
473
- metadata?: Record<string, any>;
474
- };
475
- type ExuluSourceUpdaterArgs = {
476
- id: string;
477
- type: "manual" | "cron" | "webhook";
478
- fn: (configuration: Record<string, any>) => Promise<SourceDocument[]>;
479
- configuration: Record<string, {
480
- type: "string" | "number" | "query";
481
- example: string;
482
- }>;
483
- };
484
440
  type STATISTICS_LABELS = "tool" | "agent" | "flow" | "api" | "claude-code" | "user";
485
441
  type ExuluStatistic = {
486
442
  name: string;
@@ -490,17 +446,6 @@ type ExuluStatistic = {
490
446
  total: number;
491
447
  };
492
448
  type ExuluStatisticParams = Omit<ExuluStatistic, "total" | "name" | "type">;
493
- type ExuluSourceUpdater = ExuluSourceUpdaterArgs & {
494
- slug?: string;
495
- };
496
- declare class ExuluSource {
497
- id: string;
498
- name: string;
499
- description: string;
500
- updaters: ExuluSourceUpdater[];
501
- context: string;
502
- constructor({ id, name, description, updaters, context }: ExuluSourceConstructorArgs);
503
- }
504
449
 
505
450
  type ExuluConfig = {
506
451
  telemetry?: {
@@ -1482,4 +1427,4 @@ declare const ExuluChunkers: {
1482
1427
  };
1483
1428
  };
1484
1429
 
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, ExuluEmbedder, ExuluEval, ExuluJobs, ExuluLogger, ExuluOtel, queues as ExuluQueues, ExuluSource, ExuluTool, ExuluZodFileType, db };
1430
+ 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, ExuluEmbedder, ExuluEval, ExuluJobs, ExuluOtel, queues as ExuluQueues, ExuluTool, ExuluZodFileType, db };