@exulu/backend 2.3.0 → 3.1.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
@@ -233,7 +233,8 @@ interface Item {
233
233
  * declared in code (source them from env vars or however you like) — none of
234
234
  * them are exposed as admin-configurable tool config.
235
235
  */
236
- type ExuluOauthConfig = {
236
+ interface ExuluOauthConfig {
237
+ authType: "oauth";
237
238
  /**
238
239
  * Identifier for the OAuth provider (e.g., "google", "jira", "github").
239
240
  * Tools sharing the same provider share tokens under (provider, userId) —
@@ -241,7 +242,7 @@ type ExuluOauthConfig = {
241
242
  * omitted, defaults to the tool's `id`, preserving per-tool behavior for
242
243
  * tools that don't opt in.
243
244
  */
244
- provider?: string;
245
+ provider: string;
245
246
  /** The provider's authorization endpoint, e.g. https://app.hubspot.com/oauth/authorize */
246
247
  authorizationUrl: string;
247
248
  /** The provider's token endpoint, e.g. https://api.hubapi.com/oauth/v1/token */
@@ -250,7 +251,7 @@ type ExuluOauthConfig = {
250
251
  /** Never leaves the server: used only in the server-side token exchange. */
251
252
  clientSecret: string;
252
253
  /** Scopes to request; joined with spaces in the authorization URL. */
253
- scopes: string[];
254
+ scopes: readonly string[];
254
255
  /** PKCE (S256). Defaults to true; set false for providers that reject PKCE. */
255
256
  pkce?: boolean;
256
257
  /**
@@ -259,7 +260,26 @@ type ExuluOauthConfig = {
259
260
  * refresh token.
260
261
  */
261
262
  extraAuthParams?: Record<string, string>;
262
- };
263
+ }
264
+ interface CredentialField {
265
+ name: string;
266
+ label: string;
267
+ type: "text" | "password";
268
+ placeholder?: string;
269
+ help?: string;
270
+ }
271
+ interface ExuluUserCredentialsConfig {
272
+ authType: "user_credentials";
273
+ provider: string;
274
+ fields: CredentialField[];
275
+ validate?: (values: Record<string, string>) => Promise<void>;
276
+ }
277
+ type ExuluAuthConfig = ExuluOauthConfig | ExuluUserCredentialsConfig;
278
+ interface ExuluCredentialsToolContext {
279
+ userId: string;
280
+ provider: string;
281
+ credentials: Record<string, string>;
282
+ }
263
283
  /** The oauth context injected into an oauth-enabled tool's execute inputs. */
264
284
  type ExuluOauthToolContext = {
265
285
  accessToken: string;
@@ -281,14 +301,14 @@ declare class ExuluTool {
281
301
  type: ToolType;
282
302
  tool: Tool;
283
303
  needsApproval: boolean;
284
- oauth?: ExuluOauthConfig;
304
+ authentication?: ExuluAuthConfig;
285
305
  config: {
286
306
  name: string;
287
307
  description: string;
288
308
  type: "boolean" | "string" | "number" | "variable" | "json";
289
309
  default?: string | boolean | number | object;
290
310
  }[];
291
- constructor({ id, name, description, category, inputSchema, type, execute, config, needsApproval, oauth, }: {
311
+ constructor({ id, name, description, category, inputSchema, type, execute, config, needsApproval, authentication, }: {
292
312
  id: string;
293
313
  name: string;
294
314
  description: string;
@@ -302,7 +322,7 @@ declare class ExuluTool {
302
322
  default?: string | boolean | number | object;
303
323
  }[];
304
324
  needsApproval?: boolean;
305
- oauth?: ExuluOauthConfig;
325
+ authentication?: ExuluAuthConfig;
306
326
  execute: (inputs: any, options?: any) => Promise<{
307
327
  result?: string;
308
328
  job?: string;
@@ -658,6 +678,13 @@ type ExuluContextFieldDefinition = {
658
678
  index?: boolean;
659
679
  enumValues?: string[];
660
680
  allowedFileTypes?: allFileTypes[];
681
+ /**
682
+ * Write-only secret: excluded from the generated GraphQL object type, Filter
683
+ * type, SQL read selections, and all read payloads. Still accepted as
684
+ * mutation INPUT (the mutation layer hashes/stores it) unless additionally
685
+ * excluded by name in the input generator.
686
+ */
687
+ hidden?: boolean;
661
688
  };
662
689
  type ExuluContextSource = {
663
690
  id: string;
@@ -2518,7 +2545,7 @@ declare function createAgenticRetrievalTool(opts: {
2518
2545
  projectScope?: ProjectScope;
2519
2546
  }): ExuluTool | undefined;
2520
2547
 
2521
- type JOB_STATUS = "completed" | "failed" | "delayed" | "active" | "waiting" | "paused" | "stuck";
2548
+ type JOB_STATUS = "completed" | "failed" | "delayed" | "active" | "waiting" | "paused" | "stuck" | "waiting_approval" | "filtered" | "cancelled";
2522
2549
  declare const JOB_STATUS_ENUM: {
2523
2550
  completed: string;
2524
2551
  failed: string;
@@ -2527,8 +2554,17 @@ declare const JOB_STATUS_ENUM: {
2527
2554
  waiting: string;
2528
2555
  paused: string;
2529
2556
  stuck: string;
2557
+ waiting_approval: string;
2558
+ filtered: string;
2559
+ cancelled: string;
2530
2560
  };
2531
2561
 
2562
+ declare class CredentialInvalidError extends Error {
2563
+ readonly provider: string;
2564
+ readonly reason?: string;
2565
+ constructor(provider: string, reason?: string);
2566
+ }
2567
+
2532
2568
  declare const ExuluJobs: {
2533
2569
  redis: typeof redisClient;
2534
2570
  };
@@ -2632,4 +2668,4 @@ declare const ExuluPython: {
2632
2668
  instructions: typeof getPythonSetupInstructions;
2633
2669
  };
2634
2670
 
2635
- export { type ChunkerOperation, type ChunkerResponse, 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, type ExuluAgent, ExuluApp, ExuluAuthentication, ExuluChunkers, ExuluContext, type ExuluContextEmbedder, ExuluDatabase, ExuluDefaultProviders, ExuluDefaultTools, ExuluDocumentProcessor, ExuluEval, type Item as ExuluItem, ExuluJobs, type ExuluOauthConfig, type ExuluOauthToolContext, ExuluOtel, ExuluProvider, ExuluPython, queues as ExuluQueues, ExuluReadApi, ExuluReranker, ExuluTool, ExuluVariables, type VectorSearchChunkResult, defaultChunker, enableLiteLLMClientMode, postgresClient };
2671
+ export { type ChunkerOperation, type ChunkerResponse, type CredentialField, CredentialInvalidError, 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, type ExuluAgent, ExuluApp, type ExuluAuthConfig, ExuluAuthentication, ExuluChunkers, ExuluContext, type ExuluContextEmbedder, type ExuluCredentialsToolContext, ExuluDatabase, ExuluDefaultProviders, ExuluDefaultTools, ExuluDocumentProcessor, ExuluEval, type Item as ExuluItem, ExuluJobs, type ExuluOauthConfig, type ExuluOauthToolContext, ExuluOtel, ExuluProvider, ExuluPython, queues as ExuluQueues, ExuluReadApi, ExuluReranker, ExuluTool, type ExuluUserCredentialsConfig, ExuluVariables, type VectorSearchChunkResult, defaultChunker, enableLiteLLMClientMode, postgresClient };
package/dist/index.d.ts CHANGED
@@ -233,7 +233,8 @@ interface Item {
233
233
  * declared in code (source them from env vars or however you like) — none of
234
234
  * them are exposed as admin-configurable tool config.
235
235
  */
236
- type ExuluOauthConfig = {
236
+ interface ExuluOauthConfig {
237
+ authType: "oauth";
237
238
  /**
238
239
  * Identifier for the OAuth provider (e.g., "google", "jira", "github").
239
240
  * Tools sharing the same provider share tokens under (provider, userId) —
@@ -241,7 +242,7 @@ type ExuluOauthConfig = {
241
242
  * omitted, defaults to the tool's `id`, preserving per-tool behavior for
242
243
  * tools that don't opt in.
243
244
  */
244
- provider?: string;
245
+ provider: string;
245
246
  /** The provider's authorization endpoint, e.g. https://app.hubspot.com/oauth/authorize */
246
247
  authorizationUrl: string;
247
248
  /** The provider's token endpoint, e.g. https://api.hubapi.com/oauth/v1/token */
@@ -250,7 +251,7 @@ type ExuluOauthConfig = {
250
251
  /** Never leaves the server: used only in the server-side token exchange. */
251
252
  clientSecret: string;
252
253
  /** Scopes to request; joined with spaces in the authorization URL. */
253
- scopes: string[];
254
+ scopes: readonly string[];
254
255
  /** PKCE (S256). Defaults to true; set false for providers that reject PKCE. */
255
256
  pkce?: boolean;
256
257
  /**
@@ -259,7 +260,26 @@ type ExuluOauthConfig = {
259
260
  * refresh token.
260
261
  */
261
262
  extraAuthParams?: Record<string, string>;
262
- };
263
+ }
264
+ interface CredentialField {
265
+ name: string;
266
+ label: string;
267
+ type: "text" | "password";
268
+ placeholder?: string;
269
+ help?: string;
270
+ }
271
+ interface ExuluUserCredentialsConfig {
272
+ authType: "user_credentials";
273
+ provider: string;
274
+ fields: CredentialField[];
275
+ validate?: (values: Record<string, string>) => Promise<void>;
276
+ }
277
+ type ExuluAuthConfig = ExuluOauthConfig | ExuluUserCredentialsConfig;
278
+ interface ExuluCredentialsToolContext {
279
+ userId: string;
280
+ provider: string;
281
+ credentials: Record<string, string>;
282
+ }
263
283
  /** The oauth context injected into an oauth-enabled tool's execute inputs. */
264
284
  type ExuluOauthToolContext = {
265
285
  accessToken: string;
@@ -281,14 +301,14 @@ declare class ExuluTool {
281
301
  type: ToolType;
282
302
  tool: Tool;
283
303
  needsApproval: boolean;
284
- oauth?: ExuluOauthConfig;
304
+ authentication?: ExuluAuthConfig;
285
305
  config: {
286
306
  name: string;
287
307
  description: string;
288
308
  type: "boolean" | "string" | "number" | "variable" | "json";
289
309
  default?: string | boolean | number | object;
290
310
  }[];
291
- constructor({ id, name, description, category, inputSchema, type, execute, config, needsApproval, oauth, }: {
311
+ constructor({ id, name, description, category, inputSchema, type, execute, config, needsApproval, authentication, }: {
292
312
  id: string;
293
313
  name: string;
294
314
  description: string;
@@ -302,7 +322,7 @@ declare class ExuluTool {
302
322
  default?: string | boolean | number | object;
303
323
  }[];
304
324
  needsApproval?: boolean;
305
- oauth?: ExuluOauthConfig;
325
+ authentication?: ExuluAuthConfig;
306
326
  execute: (inputs: any, options?: any) => Promise<{
307
327
  result?: string;
308
328
  job?: string;
@@ -658,6 +678,13 @@ type ExuluContextFieldDefinition = {
658
678
  index?: boolean;
659
679
  enumValues?: string[];
660
680
  allowedFileTypes?: allFileTypes[];
681
+ /**
682
+ * Write-only secret: excluded from the generated GraphQL object type, Filter
683
+ * type, SQL read selections, and all read payloads. Still accepted as
684
+ * mutation INPUT (the mutation layer hashes/stores it) unless additionally
685
+ * excluded by name in the input generator.
686
+ */
687
+ hidden?: boolean;
661
688
  };
662
689
  type ExuluContextSource = {
663
690
  id: string;
@@ -2518,7 +2545,7 @@ declare function createAgenticRetrievalTool(opts: {
2518
2545
  projectScope?: ProjectScope;
2519
2546
  }): ExuluTool | undefined;
2520
2547
 
2521
- type JOB_STATUS = "completed" | "failed" | "delayed" | "active" | "waiting" | "paused" | "stuck";
2548
+ type JOB_STATUS = "completed" | "failed" | "delayed" | "active" | "waiting" | "paused" | "stuck" | "waiting_approval" | "filtered" | "cancelled";
2522
2549
  declare const JOB_STATUS_ENUM: {
2523
2550
  completed: string;
2524
2551
  failed: string;
@@ -2527,8 +2554,17 @@ declare const JOB_STATUS_ENUM: {
2527
2554
  waiting: string;
2528
2555
  paused: string;
2529
2556
  stuck: string;
2557
+ waiting_approval: string;
2558
+ filtered: string;
2559
+ cancelled: string;
2530
2560
  };
2531
2561
 
2562
+ declare class CredentialInvalidError extends Error {
2563
+ readonly provider: string;
2564
+ readonly reason?: string;
2565
+ constructor(provider: string, reason?: string);
2566
+ }
2567
+
2532
2568
  declare const ExuluJobs: {
2533
2569
  redis: typeof redisClient;
2534
2570
  };
@@ -2632,4 +2668,4 @@ declare const ExuluPython: {
2632
2668
  instructions: typeof getPythonSetupInstructions;
2633
2669
  };
2634
2670
 
2635
- export { type ChunkerOperation, type ChunkerResponse, 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, type ExuluAgent, ExuluApp, ExuluAuthentication, ExuluChunkers, ExuluContext, type ExuluContextEmbedder, ExuluDatabase, ExuluDefaultProviders, ExuluDefaultTools, ExuluDocumentProcessor, ExuluEval, type Item as ExuluItem, ExuluJobs, type ExuluOauthConfig, type ExuluOauthToolContext, ExuluOtel, ExuluProvider, ExuluPython, queues as ExuluQueues, ExuluReadApi, ExuluReranker, ExuluTool, ExuluVariables, type VectorSearchChunkResult, defaultChunker, enableLiteLLMClientMode, postgresClient };
2671
+ export { type ChunkerOperation, type ChunkerResponse, type CredentialField, CredentialInvalidError, 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, type ExuluAgent, ExuluApp, type ExuluAuthConfig, ExuluAuthentication, ExuluChunkers, ExuluContext, type ExuluContextEmbedder, type ExuluCredentialsToolContext, ExuluDatabase, ExuluDefaultProviders, ExuluDefaultTools, ExuluDocumentProcessor, ExuluEval, type Item as ExuluItem, ExuluJobs, type ExuluOauthConfig, type ExuluOauthToolContext, ExuluOtel, ExuluProvider, ExuluPython, queues as ExuluQueues, ExuluReadApi, ExuluReranker, ExuluTool, type ExuluUserCredentialsConfig, ExuluVariables, type VectorSearchChunkResult, defaultChunker, enableLiteLLMClientMode, postgresClient };