@exulu/backend 1.57.0 → 1.58.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
@@ -10,6 +10,7 @@ import { z } from 'zod';
10
10
  import { Tiktoken } from 'tiktoken/lite';
11
11
  import models from 'tiktoken/model_to_encoding.json';
12
12
 
13
+ type ApiKeyScopeMode = "admin" | "agents";
13
14
  type User = {
14
15
  id: number;
15
16
  firstname?: string;
@@ -20,6 +21,8 @@ type User = {
20
21
  anthropic_token?: string;
21
22
  super_admin?: boolean;
22
23
  favourite_agents?: string[];
24
+ scope_mode?: ApiKeyScopeMode;
25
+ agent_ids?: string[];
23
26
  role: {
24
27
  id: string;
25
28
  name: string;
@@ -39,8 +42,12 @@ type ExuluProviderConfig = {
39
42
  name: string;
40
43
  instructions: string;
41
44
  model: {
42
- create: ({ apiKey }: {
45
+ create: ({ apiKey, user, role, project, agent }: {
43
46
  apiKey?: string | undefined;
47
+ user?: number;
48
+ role?: string;
49
+ project?: string;
50
+ agent?: string;
44
51
  }) => LanguageModel;
45
52
  };
46
53
  custom?: {
@@ -57,6 +64,15 @@ type ExuluProviderConfig = {
57
64
  };
58
65
  };
59
66
 
67
+ type AgentRateLimitBucket = {
68
+ limit: number;
69
+ window_seconds: number;
70
+ };
71
+ type AgentRateLimits = {
72
+ requests?: AgentRateLimitBucket;
73
+ input_tokens?: AgentRateLimitBucket;
74
+ output_tokens?: AgentRateLimitBucket;
75
+ };
60
76
  interface ExuluAgent {
61
77
  id: string;
62
78
  modelName?: string;
@@ -124,6 +140,7 @@ interface ExuluAgent {
124
140
  rights: 'read' | 'write';
125
141
  }>;
126
142
  };
143
+ rate_limits?: AgentRateLimits;
127
144
  createdAt?: string;
128
145
  updatedAt?: string;
129
146
  }
@@ -168,7 +185,7 @@ declare class ExuluTool {
168
185
  description: string;
169
186
  category: string;
170
187
  inputSchema?: z.ZodType;
171
- type: "context" | "function" | "agent" | "web_search";
188
+ type: "context" | "function" | "agent" | "web_search" | "skill";
172
189
  tool: Tool;
173
190
  needsApproval: boolean;
174
191
  config: {
@@ -183,7 +200,7 @@ declare class ExuluTool {
183
200
  description: string;
184
201
  category?: string;
185
202
  inputSchema?: z.ZodType;
186
- type: "context" | "function" | "agent" | "web_search";
203
+ type: "context" | "function" | "agent" | "web_search" | "skill";
187
204
  config: {
188
205
  name: string;
189
206
  description: string;
@@ -699,6 +716,17 @@ type ExuluAgentToolConfig = {
699
716
  }[];
700
717
  };
701
718
 
719
+ type ExuluSkill = {
720
+ id: string;
721
+ name: string;
722
+ description: string;
723
+ s3folder: string;
724
+ tags: string[];
725
+ usage_count: number;
726
+ favorite_count: number;
727
+ current_version: number;
728
+ };
729
+
702
730
  type ExuluProviderWorkflowConfig = {
703
731
  enabled: boolean;
704
732
  queue?: Promise<ExuluQueueConfig>;
@@ -739,8 +767,12 @@ declare class ExuluProvider {
739
767
  rateLimit?: RateLimiterRule;
740
768
  config?: ExuluProviderConfig | undefined;
741
769
  model?: {
742
- create: ({ apiKey }: {
770
+ create: ({ apiKey, user, role, project, agent }: {
743
771
  apiKey?: string | undefined;
772
+ user?: number;
773
+ role?: string;
774
+ project?: string;
775
+ agent?: string;
744
776
  }) => LanguageModel;
745
777
  };
746
778
  capabilities: {
@@ -754,7 +786,7 @@ declare class ExuluProvider {
754
786
  get providerName(): string;
755
787
  get modelName(): string;
756
788
  tool: (instance: string, providers: ExuluProvider[], contexts: ExuluContext[], rerankers: ExuluReranker[]) => Promise<ExuluTool | null>;
757
- generateSync: ({ prompt, req, user, session, inputMessages, approvedTools, currentTools, allExuluTools, statistics, toolConfigs, providerapikey, contexts, rerankers, exuluConfig, outputSchema, agent, instructions, maxStepCount, }: {
789
+ generateSync: ({ prompt, req, user, session, inputMessages, approvedTools, currentTools, currentSkills, allExuluTools, statistics, toolConfigs, providerapikey, contexts, rerankers, exuluConfig, outputSchema, agent, instructions, maxStepCount, onTokenUsage, }: {
758
790
  prompt?: string;
759
791
  user?: User;
760
792
  maxStepCount?: number;
@@ -764,6 +796,7 @@ declare class ExuluProvider {
764
796
  approvedTools?: string[];
765
797
  inputMessages?: UIMessage[];
766
798
  currentTools?: ExuluTool[];
799
+ currentSkills?: ExuluSkill[];
767
800
  allExuluTools?: ExuluTool[];
768
801
  statistics?: ExuluStatisticParams;
769
802
  toolConfigs?: ExuluAgentToolConfig[];
@@ -773,6 +806,10 @@ declare class ExuluProvider {
773
806
  exuluConfig?: ExuluConfig;
774
807
  instructions?: string;
775
808
  outputSchema?: z.ZodTypeAny;
809
+ onTokenUsage?: (usage: {
810
+ inputTokens: number;
811
+ outputTokens: number;
812
+ }) => Promise<void> | void;
776
813
  }) => Promise<any>;
777
814
  /**
778
815
  * Convert file parts in messages to OpenAI Responses API compatible format.
@@ -782,7 +819,7 @@ declare class ExuluProvider {
782
819
  * - Image files -> image parts (which ARE supported by Responses API)
783
820
  */
784
821
  private processFilePartsInMessages;
785
- generateStream: ({ user, session, agent, message, previousMessages, currentTools, approvedTools, allExuluTools, toolConfigs, providerapikey, contexts, rerankers, exuluConfig, instructions, req, maxStepCount }: {
822
+ generateStream: ({ user, session, agent, message, previousMessages, currentTools, currentSkills, approvedTools, allExuluTools, toolConfigs, providerapikey, contexts, rerankers, exuluConfig, instructions, req, maxStepCount }: {
786
823
  user?: User;
787
824
  session?: string;
788
825
  agent?: ExuluAgent;
@@ -790,6 +827,7 @@ declare class ExuluProvider {
790
827
  message?: UIMessage;
791
828
  previousMessages?: UIMessage[];
792
829
  currentTools?: ExuluTool[];
830
+ currentSkills?: ExuluSkill[];
793
831
  approvedTools?: string[];
794
832
  allExuluTools?: ExuluTool[];
795
833
  toolConfigs?: ExuluAgentToolConfig[];
@@ -886,6 +924,14 @@ type ExuluConfig = {
886
924
  privacy?: {
887
925
  systemPromptPersonalization?: boolean;
888
926
  };
927
+ /**
928
+ * When true, ExuluApp.create() throws if any required system binary
929
+ * (pandoc / soffice / pdftoppm — needed by built-in skills like docx) is
930
+ * missing. When false or unset, the missing deps are logged as a warning
931
+ * and the app continues to start; skills that need the binary will fail
932
+ * at use time instead. Recommended `true` in production deployments.
933
+ */
934
+ requireSystemDependencies?: boolean;
889
935
  };
890
936
  declare class ExuluApp {
891
937
  private _providers;
@@ -2093,6 +2139,7 @@ declare const ExuluDefaultProviders: {
2093
2139
  vertexGemini25Flash: ExuluProvider;
2094
2140
  vertexGemini25Pro: ExuluProvider;
2095
2141
  vertexGemini3Pro: ExuluProvider;
2142
+ vertexLlamaScout4: ExuluProvider;
2096
2143
  };
2097
2144
  openai: {
2098
2145
  gpt5Mini: ExuluProvider;
package/dist/index.d.ts CHANGED
@@ -10,6 +10,7 @@ import { z } from 'zod';
10
10
  import { Tiktoken } from 'tiktoken/lite';
11
11
  import models from 'tiktoken/model_to_encoding.json';
12
12
 
13
+ type ApiKeyScopeMode = "admin" | "agents";
13
14
  type User = {
14
15
  id: number;
15
16
  firstname?: string;
@@ -20,6 +21,8 @@ type User = {
20
21
  anthropic_token?: string;
21
22
  super_admin?: boolean;
22
23
  favourite_agents?: string[];
24
+ scope_mode?: ApiKeyScopeMode;
25
+ agent_ids?: string[];
23
26
  role: {
24
27
  id: string;
25
28
  name: string;
@@ -39,8 +42,12 @@ type ExuluProviderConfig = {
39
42
  name: string;
40
43
  instructions: string;
41
44
  model: {
42
- create: ({ apiKey }: {
45
+ create: ({ apiKey, user, role, project, agent }: {
43
46
  apiKey?: string | undefined;
47
+ user?: number;
48
+ role?: string;
49
+ project?: string;
50
+ agent?: string;
44
51
  }) => LanguageModel;
45
52
  };
46
53
  custom?: {
@@ -57,6 +64,15 @@ type ExuluProviderConfig = {
57
64
  };
58
65
  };
59
66
 
67
+ type AgentRateLimitBucket = {
68
+ limit: number;
69
+ window_seconds: number;
70
+ };
71
+ type AgentRateLimits = {
72
+ requests?: AgentRateLimitBucket;
73
+ input_tokens?: AgentRateLimitBucket;
74
+ output_tokens?: AgentRateLimitBucket;
75
+ };
60
76
  interface ExuluAgent {
61
77
  id: string;
62
78
  modelName?: string;
@@ -124,6 +140,7 @@ interface ExuluAgent {
124
140
  rights: 'read' | 'write';
125
141
  }>;
126
142
  };
143
+ rate_limits?: AgentRateLimits;
127
144
  createdAt?: string;
128
145
  updatedAt?: string;
129
146
  }
@@ -168,7 +185,7 @@ declare class ExuluTool {
168
185
  description: string;
169
186
  category: string;
170
187
  inputSchema?: z.ZodType;
171
- type: "context" | "function" | "agent" | "web_search";
188
+ type: "context" | "function" | "agent" | "web_search" | "skill";
172
189
  tool: Tool;
173
190
  needsApproval: boolean;
174
191
  config: {
@@ -183,7 +200,7 @@ declare class ExuluTool {
183
200
  description: string;
184
201
  category?: string;
185
202
  inputSchema?: z.ZodType;
186
- type: "context" | "function" | "agent" | "web_search";
203
+ type: "context" | "function" | "agent" | "web_search" | "skill";
187
204
  config: {
188
205
  name: string;
189
206
  description: string;
@@ -699,6 +716,17 @@ type ExuluAgentToolConfig = {
699
716
  }[];
700
717
  };
701
718
 
719
+ type ExuluSkill = {
720
+ id: string;
721
+ name: string;
722
+ description: string;
723
+ s3folder: string;
724
+ tags: string[];
725
+ usage_count: number;
726
+ favorite_count: number;
727
+ current_version: number;
728
+ };
729
+
702
730
  type ExuluProviderWorkflowConfig = {
703
731
  enabled: boolean;
704
732
  queue?: Promise<ExuluQueueConfig>;
@@ -739,8 +767,12 @@ declare class ExuluProvider {
739
767
  rateLimit?: RateLimiterRule;
740
768
  config?: ExuluProviderConfig | undefined;
741
769
  model?: {
742
- create: ({ apiKey }: {
770
+ create: ({ apiKey, user, role, project, agent }: {
743
771
  apiKey?: string | undefined;
772
+ user?: number;
773
+ role?: string;
774
+ project?: string;
775
+ agent?: string;
744
776
  }) => LanguageModel;
745
777
  };
746
778
  capabilities: {
@@ -754,7 +786,7 @@ declare class ExuluProvider {
754
786
  get providerName(): string;
755
787
  get modelName(): string;
756
788
  tool: (instance: string, providers: ExuluProvider[], contexts: ExuluContext[], rerankers: ExuluReranker[]) => Promise<ExuluTool | null>;
757
- generateSync: ({ prompt, req, user, session, inputMessages, approvedTools, currentTools, allExuluTools, statistics, toolConfigs, providerapikey, contexts, rerankers, exuluConfig, outputSchema, agent, instructions, maxStepCount, }: {
789
+ generateSync: ({ prompt, req, user, session, inputMessages, approvedTools, currentTools, currentSkills, allExuluTools, statistics, toolConfigs, providerapikey, contexts, rerankers, exuluConfig, outputSchema, agent, instructions, maxStepCount, onTokenUsage, }: {
758
790
  prompt?: string;
759
791
  user?: User;
760
792
  maxStepCount?: number;
@@ -764,6 +796,7 @@ declare class ExuluProvider {
764
796
  approvedTools?: string[];
765
797
  inputMessages?: UIMessage[];
766
798
  currentTools?: ExuluTool[];
799
+ currentSkills?: ExuluSkill[];
767
800
  allExuluTools?: ExuluTool[];
768
801
  statistics?: ExuluStatisticParams;
769
802
  toolConfigs?: ExuluAgentToolConfig[];
@@ -773,6 +806,10 @@ declare class ExuluProvider {
773
806
  exuluConfig?: ExuluConfig;
774
807
  instructions?: string;
775
808
  outputSchema?: z.ZodTypeAny;
809
+ onTokenUsage?: (usage: {
810
+ inputTokens: number;
811
+ outputTokens: number;
812
+ }) => Promise<void> | void;
776
813
  }) => Promise<any>;
777
814
  /**
778
815
  * Convert file parts in messages to OpenAI Responses API compatible format.
@@ -782,7 +819,7 @@ declare class ExuluProvider {
782
819
  * - Image files -> image parts (which ARE supported by Responses API)
783
820
  */
784
821
  private processFilePartsInMessages;
785
- generateStream: ({ user, session, agent, message, previousMessages, currentTools, approvedTools, allExuluTools, toolConfigs, providerapikey, contexts, rerankers, exuluConfig, instructions, req, maxStepCount }: {
822
+ generateStream: ({ user, session, agent, message, previousMessages, currentTools, currentSkills, approvedTools, allExuluTools, toolConfigs, providerapikey, contexts, rerankers, exuluConfig, instructions, req, maxStepCount }: {
786
823
  user?: User;
787
824
  session?: string;
788
825
  agent?: ExuluAgent;
@@ -790,6 +827,7 @@ declare class ExuluProvider {
790
827
  message?: UIMessage;
791
828
  previousMessages?: UIMessage[];
792
829
  currentTools?: ExuluTool[];
830
+ currentSkills?: ExuluSkill[];
793
831
  approvedTools?: string[];
794
832
  allExuluTools?: ExuluTool[];
795
833
  toolConfigs?: ExuluAgentToolConfig[];
@@ -886,6 +924,14 @@ type ExuluConfig = {
886
924
  privacy?: {
887
925
  systemPromptPersonalization?: boolean;
888
926
  };
927
+ /**
928
+ * When true, ExuluApp.create() throws if any required system binary
929
+ * (pandoc / soffice / pdftoppm — needed by built-in skills like docx) is
930
+ * missing. When false or unset, the missing deps are logged as a warning
931
+ * and the app continues to start; skills that need the binary will fail
932
+ * at use time instead. Recommended `true` in production deployments.
933
+ */
934
+ requireSystemDependencies?: boolean;
889
935
  };
890
936
  declare class ExuluApp {
891
937
  private _providers;
@@ -2093,6 +2139,7 @@ declare const ExuluDefaultProviders: {
2093
2139
  vertexGemini25Flash: ExuluProvider;
2094
2140
  vertexGemini25Pro: ExuluProvider;
2095
2141
  vertexGemini3Pro: ExuluProvider;
2142
+ vertexLlamaScout4: ExuluProvider;
2096
2143
  };
2097
2144
  openai: {
2098
2145
  gpt5Mini: ExuluProvider;