@librechat/data-schemas 0.0.35 → 0.0.36

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.
@@ -0,0 +1,39 @@
1
+ /// <reference types="mongoose/types/aggregate" />
2
+ /// <reference types="mongoose/types/callback" />
3
+ /// <reference types="mongoose/types/collection" />
4
+ /// <reference types="mongoose/types/connection" />
5
+ /// <reference types="mongoose/types/cursor" />
6
+ /// <reference types="mongoose/types/document" />
7
+ /// <reference types="mongoose/types/error" />
8
+ /// <reference types="mongoose/types/expressions" />
9
+ /// <reference types="mongoose/types/helpers" />
10
+ /// <reference types="mongoose/types/middlewares" />
11
+ /// <reference types="mongoose/types/indexes" />
12
+ /// <reference types="mongoose/types/models" />
13
+ /// <reference types="mongoose/types/mongooseoptions" />
14
+ /// <reference types="mongoose/types/pipelinestage" />
15
+ /// <reference types="mongoose/types/populate" />
16
+ /// <reference types="mongoose/types/query" />
17
+ /// <reference types="mongoose/types/schemaoptions" />
18
+ /// <reference types="mongoose/types/schematypes" />
19
+ /// <reference types="mongoose/types/session" />
20
+ /// <reference types="mongoose/types/types" />
21
+ /// <reference types="mongoose/types/utility" />
22
+ /// <reference types="mongoose/types/validation" />
23
+ /// <reference types="mongoose/types/virtuals" />
24
+ /// <reference types="mongoose/types/inferschematype" />
25
+ /// <reference types="mongoose/types/inferrawdoctype" />
26
+ import type { Types } from 'mongoose';
27
+ import type { AgentApiKeyCreateResult, AgentApiKeyCreateData, AgentApiKeyListItem } from '~/types';
28
+ export declare function createAgentApiKeyMethods(mongoose: typeof import('mongoose')): {
29
+ createAgentApiKey: (data: AgentApiKeyCreateData) => Promise<AgentApiKeyCreateResult>;
30
+ validateAgentApiKey: (apiKey: string) => Promise<{
31
+ userId: Types.ObjectId;
32
+ keyId: Types.ObjectId;
33
+ } | null>;
34
+ listAgentApiKeys: (userId: string | Types.ObjectId) => Promise<AgentApiKeyListItem[]>;
35
+ deleteAgentApiKey: (keyId: string | Types.ObjectId, userId: string | Types.ObjectId) => Promise<boolean>;
36
+ deleteAllAgentApiKeys: (userId: string | Types.ObjectId) => Promise<number>;
37
+ getAgentApiKeyById: (keyId: string | Types.ObjectId, userId: string | Types.ObjectId) => Promise<AgentApiKeyListItem | null>;
38
+ };
39
+ export type AgentApiKeyMethods = ReturnType<typeof createAgentApiKeyMethods>;
@@ -31,6 +31,14 @@ export declare function createFileMethods(mongoose: typeof import('mongoose')):
31
31
  findFileById: (file_id: string, options?: Record<string, unknown>) => Promise<IMongoFile | null>;
32
32
  getFiles: (filter: FilterQuery<IMongoFile>, _sortOptions?: Record<string, SortOrder> | null, selectFields?: string | Record<string, 0 | 1> | null | undefined) => Promise<IMongoFile[] | null>;
33
33
  getToolFilesByIds: (fileIds: string[], toolResourceSet?: Set<EToolResources>) => Promise<IMongoFile[]>;
34
+ getCodeGeneratedFiles: (conversationId: string, messageIds?: string[]) => Promise<IMongoFile[]>;
35
+ getUserCodeFiles: (fileIds?: string[]) => Promise<IMongoFile[]>;
36
+ claimCodeFile: (data: {
37
+ filename: string;
38
+ conversationId: string;
39
+ file_id: string;
40
+ user: string;
41
+ }) => Promise<IMongoFile>;
34
42
  createFile: (data: Partial<IMongoFile>, disableTTL?: boolean) => Promise<IMongoFile | null>;
35
43
  updateFile: (data: Partial<IMongoFile> & {
36
44
  file_id: string;
@@ -33,16 +33,17 @@ import { type KeyMethods } from './key';
33
33
  import { type FileMethods } from './file';
34
34
  import { type MemoryMethods } from './memory';
35
35
  import { type AgentCategoryMethods } from './agentCategory';
36
+ import { type AgentApiKeyMethods } from './agentApiKey';
36
37
  import { type MCPServerMethods } from './mcpServer';
37
38
  import { type PluginAuthMethods } from './pluginAuth';
38
39
  import { type AccessRoleMethods } from './accessRole';
39
40
  import { type UserGroupMethods } from './userGroup';
40
41
  import { type AclEntryMethods } from './aclEntry';
41
42
  import { type ShareMethods } from './share';
42
- export type AllMethods = UserMethods & SessionMethods & TokenMethods & RoleMethods & KeyMethods & FileMethods & MemoryMethods & AgentCategoryMethods & MCPServerMethods & UserGroupMethods & AclEntryMethods & ShareMethods & AccessRoleMethods & PluginAuthMethods;
43
+ export type AllMethods = UserMethods & SessionMethods & TokenMethods & RoleMethods & KeyMethods & FileMethods & MemoryMethods & AgentCategoryMethods & AgentApiKeyMethods & MCPServerMethods & UserGroupMethods & AclEntryMethods & ShareMethods & AccessRoleMethods & PluginAuthMethods;
43
44
  /**
44
45
  * Creates all database methods for all collections
45
46
  * @param mongoose - Mongoose instance
46
47
  */
47
48
  export declare function createMethods(mongoose: typeof import('mongoose')): AllMethods;
48
- export type { UserMethods, SessionMethods, TokenMethods, RoleMethods, KeyMethods, FileMethods, MemoryMethods, AgentCategoryMethods, MCPServerMethods, UserGroupMethods, AclEntryMethods, ShareMethods, AccessRoleMethods, PluginAuthMethods, };
49
+ export type { UserMethods, SessionMethods, TokenMethods, RoleMethods, KeyMethods, FileMethods, MemoryMethods, AgentCategoryMethods, AgentApiKeyMethods, MCPServerMethods, UserGroupMethods, AclEntryMethods, ShareMethods, AccessRoleMethods, PluginAuthMethods, };
@@ -0,0 +1,27 @@
1
+ /// <reference types="mongoose/types/aggregate" />
2
+ /// <reference types="mongoose/types/callback" />
3
+ /// <reference types="mongoose/types/collection" />
4
+ /// <reference types="mongoose/types/connection" />
5
+ /// <reference types="mongoose/types/cursor" />
6
+ /// <reference types="mongoose/types/document" />
7
+ /// <reference types="mongoose/types/error" />
8
+ /// <reference types="mongoose/types/expressions" />
9
+ /// <reference types="mongoose/types/helpers" />
10
+ /// <reference types="mongoose/types/middlewares" />
11
+ /// <reference types="mongoose/types/indexes" />
12
+ /// <reference types="mongoose/types/models" />
13
+ /// <reference types="mongoose/types/mongooseoptions" />
14
+ /// <reference types="mongoose/types/pipelinestage" />
15
+ /// <reference types="mongoose/types/populate" />
16
+ /// <reference types="mongoose/types/query" />
17
+ /// <reference types="mongoose/types/schemaoptions" />
18
+ /// <reference types="mongoose/types/schematypes" />
19
+ /// <reference types="mongoose/types/session" />
20
+ /// <reference types="mongoose/types/types" />
21
+ /// <reference types="mongoose/types/utility" />
22
+ /// <reference types="mongoose/types/validation" />
23
+ /// <reference types="mongoose/types/virtuals" />
24
+ /// <reference types="mongoose" />
25
+ /// <reference types="mongoose/types/inferschematype" />
26
+ /// <reference types="mongoose/types/inferrawdoctype" />
27
+ export declare function createAgentApiKeyModel(mongoose: typeof import('mongoose')): import("mongoose").Model<any, {}, {}, {}, any, any>;
@@ -35,6 +35,7 @@ export declare function createModels(mongoose: typeof import('mongoose')): {
35
35
  Conversation: import("mongoose").Model<any, {}, {}, {}, any, any>;
36
36
  Message: import("mongoose").Model<any, {}, {}, {}, any, any>;
37
37
  Agent: import("mongoose").Model<any, {}, {}, {}, any, any>;
38
+ AgentApiKey: import("mongoose").Model<any, {}, {}, {}, any, any>;
38
39
  AgentCategory: import("mongoose").Model<any, {}, {}, {}, any, any>;
39
40
  MCPServer: import("mongoose").Model<any, {}, {}, {}, any, any>;
40
41
  Role: import("mongoose").Model<any, {}, {}, {}, any, any>;
@@ -0,0 +1,38 @@
1
+ /// <reference types="mongoose/types/aggregate" />
2
+ /// <reference types="mongoose/types/callback" />
3
+ /// <reference types="mongoose/types/collection" />
4
+ /// <reference types="mongoose/types/connection" />
5
+ /// <reference types="mongoose/types/cursor" />
6
+ /// <reference types="mongoose/types/document" />
7
+ /// <reference types="mongoose/types/error" />
8
+ /// <reference types="mongoose/types/expressions" />
9
+ /// <reference types="mongoose/types/helpers" />
10
+ /// <reference types="mongoose/types/middlewares" />
11
+ /// <reference types="mongoose/types/indexes" />
12
+ /// <reference types="mongoose/types/models" />
13
+ /// <reference types="mongoose/types/mongooseoptions" />
14
+ /// <reference types="mongoose/types/pipelinestage" />
15
+ /// <reference types="mongoose/types/populate" />
16
+ /// <reference types="mongoose/types/query" />
17
+ /// <reference types="mongoose/types/schemaoptions" />
18
+ /// <reference types="mongoose/types/schematypes" />
19
+ /// <reference types="mongoose/types/session" />
20
+ /// <reference types="mongoose/types/types" />
21
+ /// <reference types="mongoose/types/utility" />
22
+ /// <reference types="mongoose/types/validation" />
23
+ /// <reference types="mongoose/types/virtuals" />
24
+ /// <reference types="mongoose/types/inferschematype" />
25
+ /// <reference types="mongoose/types/inferrawdoctype" />
26
+ import { Schema, Document, Types } from 'mongoose';
27
+ export interface IAgentApiKey extends Document {
28
+ userId: Types.ObjectId;
29
+ name: string;
30
+ keyHash: string;
31
+ keyPrefix: string;
32
+ lastUsedAt?: Date;
33
+ expiresAt?: Date;
34
+ createdAt: Date;
35
+ updatedAt: Date;
36
+ }
37
+ declare const agentApiKeySchema: Schema<IAgentApiKey>;
38
+ export default agentApiKeySchema;
@@ -109,6 +109,9 @@ export declare const conversationPreset: {
109
109
  thinkingBudget: {
110
110
  type: NumberConstructor;
111
111
  };
112
+ effort: {
113
+ type: StringConstructor;
114
+ };
112
115
  system: {
113
116
  type: StringConstructor;
114
117
  };
@@ -1,5 +1,6 @@
1
1
  export { default as actionSchema } from './action';
2
2
  export { default as agentSchema } from './agent';
3
+ export { default as agentApiKeySchema } from './agentApiKey';
3
4
  export { default as agentCategorySchema } from './agentCategory';
4
5
  export { default as assistantSchema } from './assistant';
5
6
  export { default as balanceSchema } from './balance';
@@ -51,6 +51,7 @@ export interface IPreset extends Document {
51
51
  promptCache?: boolean;
52
52
  thinking?: boolean;
53
53
  thinkingBudget?: number;
54
+ effort?: string;
54
55
  system?: string;
55
56
  resendFiles?: boolean;
56
57
  imageDetail?: string;
@@ -24,7 +24,7 @@
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
25
  /// <reference types="mongoose/types/inferrawdoctype" />
26
26
  import { Document, Types } from 'mongoose';
27
- import type { GraphEdge } from 'librechat-data-provider';
27
+ import type { GraphEdge, AgentToolOptions } from 'librechat-data-provider';
28
28
  export interface ISupportContact {
29
29
  name?: string;
30
30
  email?: string;
@@ -65,4 +65,6 @@ export interface IAgent extends Omit<Document, 'model'> {
65
65
  is_promoted?: boolean;
66
66
  /** MCP server names extracted from tools for efficient querying */
67
67
  mcpServerNames?: string[];
68
+ /** Per-tool configuration (defer_loading, allowed_callers) */
69
+ tool_options?: AgentToolOptions;
68
70
  }
@@ -0,0 +1,65 @@
1
+ /// <reference types="mongoose/types/aggregate" />
2
+ /// <reference types="mongoose/types/callback" />
3
+ /// <reference types="mongoose/types/collection" />
4
+ /// <reference types="mongoose/types/connection" />
5
+ /// <reference types="mongoose/types/cursor" />
6
+ /// <reference types="mongoose/types/document" />
7
+ /// <reference types="mongoose/types/error" />
8
+ /// <reference types="mongoose/types/expressions" />
9
+ /// <reference types="mongoose/types/helpers" />
10
+ /// <reference types="mongoose/types/middlewares" />
11
+ /// <reference types="mongoose/types/indexes" />
12
+ /// <reference types="mongoose/types/models" />
13
+ /// <reference types="mongoose/types/mongooseoptions" />
14
+ /// <reference types="mongoose/types/pipelinestage" />
15
+ /// <reference types="mongoose/types/populate" />
16
+ /// <reference types="mongoose/types/query" />
17
+ /// <reference types="mongoose/types/schemaoptions" />
18
+ /// <reference types="mongoose/types/schematypes" />
19
+ /// <reference types="mongoose/types/session" />
20
+ /// <reference types="mongoose/types/types" />
21
+ /// <reference types="mongoose/types/utility" />
22
+ /// <reference types="mongoose/types/validation" />
23
+ /// <reference types="mongoose/types/virtuals" />
24
+ /// <reference types="mongoose/types/inferschematype" />
25
+ /// <reference types="mongoose/types/inferrawdoctype" />
26
+ import { Document, Types } from 'mongoose';
27
+ export interface IAgentApiKey extends Document {
28
+ userId: Types.ObjectId;
29
+ name: string;
30
+ keyHash: string;
31
+ keyPrefix: string;
32
+ lastUsedAt?: Date;
33
+ expiresAt?: Date;
34
+ createdAt: Date;
35
+ updatedAt: Date;
36
+ }
37
+ export interface AgentApiKeyCreateData {
38
+ userId: Types.ObjectId | string;
39
+ name: string;
40
+ expiresAt?: Date | null;
41
+ }
42
+ export interface AgentApiKeyCreateResult {
43
+ id: string;
44
+ name: string;
45
+ keyPrefix: string;
46
+ key: string;
47
+ createdAt: Date;
48
+ expiresAt?: Date;
49
+ }
50
+ export interface AgentApiKeyListItem {
51
+ id: string;
52
+ name: string;
53
+ keyPrefix: string;
54
+ lastUsedAt?: Date;
55
+ expiresAt?: Date;
56
+ createdAt: Date;
57
+ }
58
+ export interface AgentApiKeyQuery {
59
+ userId?: Types.ObjectId | string;
60
+ keyPrefix?: string;
61
+ id?: string;
62
+ }
63
+ export interface AgentApiKeyDeleteResult {
64
+ deletedCount?: number;
65
+ }
@@ -50,6 +50,7 @@ export interface IConversation extends Document {
50
50
  promptCache?: boolean;
51
51
  thinking?: boolean;
52
52
  thinkingBudget?: number;
53
+ effort?: string;
53
54
  system?: string;
54
55
  resendFiles?: boolean;
55
56
  imageDetail?: string;
@@ -27,6 +27,7 @@ import { Document, Types } from 'mongoose';
27
27
  export interface IMongoFile extends Omit<Document, 'model'> {
28
28
  user: Types.ObjectId;
29
29
  conversationId?: string;
30
+ messageId?: string;
30
31
  file_id: string;
31
32
  temp_file_id?: string;
32
33
  bytes: number;
@@ -34,6 +34,7 @@ export * from './balance';
34
34
  export * from './banner';
35
35
  export * from './message';
36
36
  export * from './agent';
37
+ export * from './agentApiKey';
37
38
  export * from './agentCategory';
38
39
  export * from './role';
39
40
  export * from './action';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@librechat/data-schemas",
3
- "version": "0.0.35",
3
+ "version": "0.0.36",
4
4
  "description": "Mongoose schemas and models for LibreChat",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",