@exulu/backend 1.16.0 → 1.17.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,5 +1,6 @@
1
+ import * as _opentelemetry_sdk_node from '@opentelemetry/sdk-node';
1
2
  import * as bullmq from 'bullmq';
2
- import { Queue } from 'bullmq';
3
+ import { Queue, Job } from 'bullmq';
3
4
  import { RedisClientType } from 'redis';
4
5
  import { ZodSchema, z } from 'zod';
5
6
  import { Tool, LanguageModel, UIMessage } from 'ai';
@@ -12,15 +13,6 @@ declare function redisClient(): Promise<{
12
13
  client: RedisClientType | null;
13
14
  }>;
14
15
 
15
- type Job = {
16
- id: string;
17
- name: string;
18
- status: string;
19
- result?: string;
20
- date_done?: Date;
21
- date_started?: Date;
22
- };
23
-
24
16
  type STATISTICS_TYPE = "CONTEXT_RETRIEVE" | "SOURCE_UPDATE" | "EMBEDDER_UPSERT" | "EMBEDDER_GENERATE" | "EMBEDDER_DELETE" | "WORKFLOW_RUN" | "CONTEXT_UPSERT" | "TOOL_CALL" | "AGENT_RUN";
25
17
  declare const STATISTICS_TYPE_ENUM: {
26
18
  CONTEXT_RETRIEVE: string;
@@ -173,7 +165,7 @@ declare class ExuluAgent {
173
165
  statistics?: ExuluStatisticParams;
174
166
  toolConfigs?: ExuluAgentToolConfig[];
175
167
  providerApiKey: string;
176
- }) => Promise<string>;
168
+ }) => Promise<string | undefined>;
177
169
  generateStream: ({ express, user, role, session, message, tools, statistics, toolConfigs, providerApiKey }: {
178
170
  express: {
179
171
  res: Response;
@@ -388,11 +380,15 @@ declare class ExuluContext {
388
380
  getTableName: () => string;
389
381
  getChunksTableName: () => string;
390
382
  tableExists: () => Promise<boolean>;
391
- updateItem(user: string, id: string, item: Item, role?: string): Promise<{
383
+ createAndUpsertEmbeddings: (item: Item, user: string, statistics: ExuluStatisticParams, role?: string) => Promise<{
384
+ id: string | undefined;
385
+ chunks: number;
386
+ }>;
387
+ updateItem(user: string, item: Item, role?: string, trigger?: STATISTICS_LABELS): Promise<{
392
388
  id: string;
393
389
  job?: string;
394
390
  }>;
395
- insertItem(user: string, item: Item, upsert?: boolean, role?: string): Promise<{
391
+ insertItem(user: string, item: Item, upsert?: boolean, role?: string, trigger?: STATISTICS_LABELS): Promise<{
396
392
  id: string;
397
393
  job?: string;
398
394
  }>;
@@ -485,7 +481,7 @@ type ExuluSourceUpdaterArgs = {
485
481
  example: string;
486
482
  }>;
487
483
  };
488
- type STATISTICS_LABELS = "tool" | "agent" | "flow" | "api" | "claude-code";
484
+ type STATISTICS_LABELS = "tool" | "agent" | "flow" | "api" | "claude-code" | "user";
489
485
  type ExuluStatistic = {
490
486
  name: string;
491
487
  label: string;
@@ -507,9 +503,15 @@ declare class ExuluSource {
507
503
  }
508
504
 
509
505
  type ExuluConfig = {
506
+ telemetry?: {
507
+ enabled: boolean;
508
+ };
510
509
  workers: {
511
510
  enabled: boolean;
512
511
  logsDir?: string;
512
+ telemetry?: {
513
+ enabled: boolean;
514
+ };
513
515
  };
514
516
  MCP: {
515
517
  enabled: boolean;
@@ -1454,6 +1456,13 @@ declare const ExuluJobs: {
1454
1456
  validate: (job: bullmq.Job) => bullmq.Job<any, any, string>;
1455
1457
  };
1456
1458
  };
1459
+ declare const ExuluOtel: {
1460
+ create: ({ SIGNOZ_ACCESS_TOKEN, SIGNOZ_TRACES_URL, SIGNOZ_LOGS_URL }: {
1461
+ SIGNOZ_ACCESS_TOKEN: string;
1462
+ SIGNOZ_TRACES_URL: string;
1463
+ SIGNOZ_LOGS_URL: string;
1464
+ }) => _opentelemetry_sdk_node.NodeSDK;
1465
+ };
1457
1466
 
1458
1467
  declare const db: {
1459
1468
  init: () => Promise<void>;
@@ -1473,4 +1482,4 @@ declare const ExuluChunkers: {
1473
1482
  };
1474
1483
  };
1475
1484
 
1476
- 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, type Job as ExuluJob, ExuluJobs, ExuluLogger, queues as ExuluQueues, ExuluSource, ExuluTool, ExuluZodFileType, db };
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 };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
+ import * as _opentelemetry_sdk_node from '@opentelemetry/sdk-node';
1
2
  import * as bullmq from 'bullmq';
2
- import { Queue } from 'bullmq';
3
+ import { Queue, Job } from 'bullmq';
3
4
  import { RedisClientType } from 'redis';
4
5
  import { ZodSchema, z } from 'zod';
5
6
  import { Tool, LanguageModel, UIMessage } from 'ai';
@@ -12,15 +13,6 @@ declare function redisClient(): Promise<{
12
13
  client: RedisClientType | null;
13
14
  }>;
14
15
 
15
- type Job = {
16
- id: string;
17
- name: string;
18
- status: string;
19
- result?: string;
20
- date_done?: Date;
21
- date_started?: Date;
22
- };
23
-
24
16
  type STATISTICS_TYPE = "CONTEXT_RETRIEVE" | "SOURCE_UPDATE" | "EMBEDDER_UPSERT" | "EMBEDDER_GENERATE" | "EMBEDDER_DELETE" | "WORKFLOW_RUN" | "CONTEXT_UPSERT" | "TOOL_CALL" | "AGENT_RUN";
25
17
  declare const STATISTICS_TYPE_ENUM: {
26
18
  CONTEXT_RETRIEVE: string;
@@ -173,7 +165,7 @@ declare class ExuluAgent {
173
165
  statistics?: ExuluStatisticParams;
174
166
  toolConfigs?: ExuluAgentToolConfig[];
175
167
  providerApiKey: string;
176
- }) => Promise<string>;
168
+ }) => Promise<string | undefined>;
177
169
  generateStream: ({ express, user, role, session, message, tools, statistics, toolConfigs, providerApiKey }: {
178
170
  express: {
179
171
  res: Response;
@@ -388,11 +380,15 @@ declare class ExuluContext {
388
380
  getTableName: () => string;
389
381
  getChunksTableName: () => string;
390
382
  tableExists: () => Promise<boolean>;
391
- updateItem(user: string, id: string, item: Item, role?: string): Promise<{
383
+ createAndUpsertEmbeddings: (item: Item, user: string, statistics: ExuluStatisticParams, role?: string) => Promise<{
384
+ id: string | undefined;
385
+ chunks: number;
386
+ }>;
387
+ updateItem(user: string, item: Item, role?: string, trigger?: STATISTICS_LABELS): Promise<{
392
388
  id: string;
393
389
  job?: string;
394
390
  }>;
395
- insertItem(user: string, item: Item, upsert?: boolean, role?: string): Promise<{
391
+ insertItem(user: string, item: Item, upsert?: boolean, role?: string, trigger?: STATISTICS_LABELS): Promise<{
396
392
  id: string;
397
393
  job?: string;
398
394
  }>;
@@ -485,7 +481,7 @@ type ExuluSourceUpdaterArgs = {
485
481
  example: string;
486
482
  }>;
487
483
  };
488
- type STATISTICS_LABELS = "tool" | "agent" | "flow" | "api" | "claude-code";
484
+ type STATISTICS_LABELS = "tool" | "agent" | "flow" | "api" | "claude-code" | "user";
489
485
  type ExuluStatistic = {
490
486
  name: string;
491
487
  label: string;
@@ -507,9 +503,15 @@ declare class ExuluSource {
507
503
  }
508
504
 
509
505
  type ExuluConfig = {
506
+ telemetry?: {
507
+ enabled: boolean;
508
+ };
510
509
  workers: {
511
510
  enabled: boolean;
512
511
  logsDir?: string;
512
+ telemetry?: {
513
+ enabled: boolean;
514
+ };
513
515
  };
514
516
  MCP: {
515
517
  enabled: boolean;
@@ -1454,6 +1456,13 @@ declare const ExuluJobs: {
1454
1456
  validate: (job: bullmq.Job) => bullmq.Job<any, any, string>;
1455
1457
  };
1456
1458
  };
1459
+ declare const ExuluOtel: {
1460
+ create: ({ SIGNOZ_ACCESS_TOKEN, SIGNOZ_TRACES_URL, SIGNOZ_LOGS_URL }: {
1461
+ SIGNOZ_ACCESS_TOKEN: string;
1462
+ SIGNOZ_TRACES_URL: string;
1463
+ SIGNOZ_LOGS_URL: string;
1464
+ }) => _opentelemetry_sdk_node.NodeSDK;
1465
+ };
1457
1466
 
1458
1467
  declare const db: {
1459
1468
  init: () => Promise<void>;
@@ -1473,4 +1482,4 @@ declare const ExuluChunkers: {
1473
1482
  };
1474
1483
  };
1475
1484
 
1476
- 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, type Job as ExuluJob, ExuluJobs, ExuluLogger, queues as ExuluQueues, ExuluSource, ExuluTool, ExuluZodFileType, db };
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 };