@exulu/backend 2.0.1 → 2.2.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
@@ -150,6 +150,7 @@ interface ExuluAgent {
150
150
  feedback?: boolean;
151
151
  suggestions_enabled?: boolean;
152
152
  sandbox_enabled?: boolean;
153
+ max_tool_steps?: number | null;
153
154
  slug?: string;
154
155
  tools?: {
155
156
  id: string;
@@ -986,7 +987,7 @@ declare class ExuluProvider {
986
987
  get providerName(): string;
987
988
  get modelName(): string;
988
989
  tool: (instance: string, providers: ExuluProvider[], contexts: ExuluContext[]) => Promise<ExuluTool | null>;
989
- generateSync: ({ prompt, req, user, session, inputMessages, approvedTools, currentTools, currentSkills, allExuluTools, statistics, toolConfigs, providerapikey, languageModel, contexts, exuluConfig, agent, instructions, maxStepCount, onTokenUsage }: {
990
+ generateSync: ({ prompt, req, user, session, inputMessages, approvedTools, currentTools, currentSkills, allExuluTools, statistics, toolConfigs, providerapikey, languageModel, contexts, exuluConfig, agent, instructions, maxStepCount, onTokenUsage, contextWindow, disabledTools, }: {
990
991
  prompt?: string;
991
992
  user?: User;
992
993
  maxStepCount?: number;
@@ -1009,6 +1010,8 @@ declare class ExuluProvider {
1009
1010
  inputTokens: number;
1010
1011
  outputTokens: number;
1011
1012
  }) => Promise<void> | void;
1013
+ contextWindow?: number;
1014
+ disabledTools?: string[];
1012
1015
  }) => Promise<any>;
1013
1016
  /**
1014
1017
  * Convert file parts in messages to OpenAI Responses API compatible format.
@@ -1018,7 +1021,7 @@ declare class ExuluProvider {
1018
1021
  * - Image files -> image parts (which ARE supported by Responses API)
1019
1022
  */
1020
1023
  private processFilePartsInMessages;
1021
- generateStream: ({ user, session, agent, message, previousMessages, currentTools, currentSkills, approvedTools, allExuluTools, toolConfigs, providerapikey, languageModel, contexts, exuluConfig, instructions, req, maxStepCount }: {
1024
+ generateStream: ({ user, session, agent, message, previousMessages, currentTools, currentSkills, approvedTools, allExuluTools, toolConfigs, providerapikey, languageModel, contexts, exuluConfig, instructions, req, maxStepCount, contextWindow, disabledTools, }: {
1022
1025
  user?: User;
1023
1026
  session?: string;
1024
1027
  agent?: ExuluAgent;
@@ -1036,6 +1039,8 @@ declare class ExuluProvider {
1036
1039
  exuluConfig?: ExuluConfig;
1037
1040
  instructions?: string;
1038
1041
  req?: Request;
1042
+ contextWindow?: number;
1043
+ disabledTools?: string[];
1039
1044
  }) => Promise<{
1040
1045
  stream: ReturnType<typeof streamText>;
1041
1046
  originalMessages: UIMessage[];
@@ -2472,6 +2477,35 @@ declare function rerank<T extends RerankableChunk>(input: ExuluRerankInput<T>):
2472
2477
  rerank_score: number;
2473
2478
  })[]>;
2474
2479
 
2480
+ declare const kbProfileSchema: z.ZodObject<{
2481
+ enabled: z.ZodDefault<z.ZodBoolean>;
2482
+ kind: z.ZodDefault<z.ZodEnum<{
2483
+ documents: "documents";
2484
+ conversations: "conversations";
2485
+ records: "records";
2486
+ }>>;
2487
+ instructions: z.ZodDefault<z.ZodString>;
2488
+ overrides: z.ZodDefault<z.ZodObject<{
2489
+ limit: z.ZodOptional<z.ZodNumber>;
2490
+ expand: z.ZodOptional<z.ZodNumber>;
2491
+ multiQuery: z.ZodOptional<z.ZodBoolean>;
2492
+ hyde: z.ZodOptional<z.ZodBoolean>;
2493
+ }, z.core.$strip>>;
2494
+ }, z.core.$strip>;
2495
+ type KbProfile = z.infer<typeof kbProfileSchema>;
2496
+
2497
+ /** Identity + items of the project attached to the current chat session. */
2498
+ type ProjectScope = {
2499
+ id: string;
2500
+ name: string;
2501
+ description?: string;
2502
+ customInstructions?: string;
2503
+ /** Raw project_items gids: "<contextId>/<itemId>" or bare "<contextId>" (= whole context). */
2504
+ items: string[];
2505
+ /** Synthesized per-context profile defaults; a stored knowledge_bases profile always wins. */
2506
+ kbProfileDefaults?: Record<string, KbProfile>;
2507
+ };
2508
+
2475
2509
  declare function createAgenticRetrievalTool(opts: {
2476
2510
  contexts: ExuluContext[];
2477
2511
  memoryContext?: ExuluContext;
@@ -2481,6 +2515,7 @@ declare function createAgenticRetrievalTool(opts: {
2481
2515
  instructions?: string;
2482
2516
  preselected?: string[];
2483
2517
  memoryItems?: VectorSearchChunkResult[];
2518
+ projectScope?: ProjectScope;
2484
2519
  }): ExuluTool | undefined;
2485
2520
 
2486
2521
  type JOB_STATUS = "completed" | "failed" | "delayed" | "active" | "waiting" | "paused" | "stuck";
package/dist/index.d.ts CHANGED
@@ -150,6 +150,7 @@ interface ExuluAgent {
150
150
  feedback?: boolean;
151
151
  suggestions_enabled?: boolean;
152
152
  sandbox_enabled?: boolean;
153
+ max_tool_steps?: number | null;
153
154
  slug?: string;
154
155
  tools?: {
155
156
  id: string;
@@ -986,7 +987,7 @@ declare class ExuluProvider {
986
987
  get providerName(): string;
987
988
  get modelName(): string;
988
989
  tool: (instance: string, providers: ExuluProvider[], contexts: ExuluContext[]) => Promise<ExuluTool | null>;
989
- generateSync: ({ prompt, req, user, session, inputMessages, approvedTools, currentTools, currentSkills, allExuluTools, statistics, toolConfigs, providerapikey, languageModel, contexts, exuluConfig, agent, instructions, maxStepCount, onTokenUsage }: {
990
+ generateSync: ({ prompt, req, user, session, inputMessages, approvedTools, currentTools, currentSkills, allExuluTools, statistics, toolConfigs, providerapikey, languageModel, contexts, exuluConfig, agent, instructions, maxStepCount, onTokenUsage, contextWindow, disabledTools, }: {
990
991
  prompt?: string;
991
992
  user?: User;
992
993
  maxStepCount?: number;
@@ -1009,6 +1010,8 @@ declare class ExuluProvider {
1009
1010
  inputTokens: number;
1010
1011
  outputTokens: number;
1011
1012
  }) => Promise<void> | void;
1013
+ contextWindow?: number;
1014
+ disabledTools?: string[];
1012
1015
  }) => Promise<any>;
1013
1016
  /**
1014
1017
  * Convert file parts in messages to OpenAI Responses API compatible format.
@@ -1018,7 +1021,7 @@ declare class ExuluProvider {
1018
1021
  * - Image files -> image parts (which ARE supported by Responses API)
1019
1022
  */
1020
1023
  private processFilePartsInMessages;
1021
- generateStream: ({ user, session, agent, message, previousMessages, currentTools, currentSkills, approvedTools, allExuluTools, toolConfigs, providerapikey, languageModel, contexts, exuluConfig, instructions, req, maxStepCount }: {
1024
+ generateStream: ({ user, session, agent, message, previousMessages, currentTools, currentSkills, approvedTools, allExuluTools, toolConfigs, providerapikey, languageModel, contexts, exuluConfig, instructions, req, maxStepCount, contextWindow, disabledTools, }: {
1022
1025
  user?: User;
1023
1026
  session?: string;
1024
1027
  agent?: ExuluAgent;
@@ -1036,6 +1039,8 @@ declare class ExuluProvider {
1036
1039
  exuluConfig?: ExuluConfig;
1037
1040
  instructions?: string;
1038
1041
  req?: Request;
1042
+ contextWindow?: number;
1043
+ disabledTools?: string[];
1039
1044
  }) => Promise<{
1040
1045
  stream: ReturnType<typeof streamText>;
1041
1046
  originalMessages: UIMessage[];
@@ -2472,6 +2477,35 @@ declare function rerank<T extends RerankableChunk>(input: ExuluRerankInput<T>):
2472
2477
  rerank_score: number;
2473
2478
  })[]>;
2474
2479
 
2480
+ declare const kbProfileSchema: z.ZodObject<{
2481
+ enabled: z.ZodDefault<z.ZodBoolean>;
2482
+ kind: z.ZodDefault<z.ZodEnum<{
2483
+ documents: "documents";
2484
+ conversations: "conversations";
2485
+ records: "records";
2486
+ }>>;
2487
+ instructions: z.ZodDefault<z.ZodString>;
2488
+ overrides: z.ZodDefault<z.ZodObject<{
2489
+ limit: z.ZodOptional<z.ZodNumber>;
2490
+ expand: z.ZodOptional<z.ZodNumber>;
2491
+ multiQuery: z.ZodOptional<z.ZodBoolean>;
2492
+ hyde: z.ZodOptional<z.ZodBoolean>;
2493
+ }, z.core.$strip>>;
2494
+ }, z.core.$strip>;
2495
+ type KbProfile = z.infer<typeof kbProfileSchema>;
2496
+
2497
+ /** Identity + items of the project attached to the current chat session. */
2498
+ type ProjectScope = {
2499
+ id: string;
2500
+ name: string;
2501
+ description?: string;
2502
+ customInstructions?: string;
2503
+ /** Raw project_items gids: "<contextId>/<itemId>" or bare "<contextId>" (= whole context). */
2504
+ items: string[];
2505
+ /** Synthesized per-context profile defaults; a stored knowledge_bases profile always wins. */
2506
+ kbProfileDefaults?: Record<string, KbProfile>;
2507
+ };
2508
+
2475
2509
  declare function createAgenticRetrievalTool(opts: {
2476
2510
  contexts: ExuluContext[];
2477
2511
  memoryContext?: ExuluContext;
@@ -2481,6 +2515,7 @@ declare function createAgenticRetrievalTool(opts: {
2481
2515
  instructions?: string;
2482
2516
  preselected?: string[];
2483
2517
  memoryItems?: VectorSearchChunkResult[];
2518
+ projectScope?: ProjectScope;
2484
2519
  }): ExuluTool | undefined;
2485
2520
 
2486
2521
  type JOB_STATUS = "completed" | "failed" | "delayed" | "active" | "waiting" | "paused" | "stuck";