librechat-data-provider 0.8.523 → 0.8.524
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/{data-service-Bx6IFaSa.mjs → data-service-B-WUVvTH.mjs} +434 -174
- package/dist/data-service-B-WUVvTH.mjs.map +1 -0
- package/dist/{data-service-CTX0tVO5.js → data-service-CUG1qdeC.js} +577 -203
- package/dist/data-service-CUG1qdeC.js.map +1 -0
- package/dist/index.js +346 -72
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +307 -68
- package/dist/index.mjs.map +1 -1
- package/dist/react-query/index.js +1 -1
- package/dist/react-query/index.mjs +1 -1
- package/dist/types/actions.d.ts +1 -1
- package/dist/types/agentToolOptions.d.ts +1 -1
- package/dist/types/api-endpoints.d.ts +1 -0
- package/dist/types/backgroundResults.d.ts +13 -0
- package/dist/types/balance.d.ts +4 -0
- package/dist/types/bedrock.d.ts +77 -70
- package/dist/types/code/workspace.d.ts +22 -0
- package/dist/types/config.d.ts +5362 -4206
- package/dist/types/data-service.d.ts +14 -12
- package/dist/types/file-config.d.ts +81 -42
- package/dist/types/filters.d.ts +205 -205
- package/dist/types/footer.d.ts +20 -0
- package/dist/types/generate.d.ts +28 -28
- package/dist/types/index.d.ts +4 -0
- package/dist/types/keys.d.ts +2 -1
- package/dist/types/limits.d.ts +8 -0
- package/dist/types/mcp.d.ts +999 -352
- package/dist/types/messages.d.ts +12 -7
- package/dist/types/models.d.ts +429 -429
- package/dist/types/parameterSettings.d.ts +2 -1
- package/dist/types/parsers.d.ts +25 -1
- package/dist/types/resolve-llm-delivery-path.d.ts +97 -4
- package/dist/types/schemas.d.ts +646 -643
- package/dist/types/types/agents.d.ts +233 -2
- package/dist/types/types/assistants.d.ts +2 -641
- package/dist/types/types/content.d.ts +286 -0
- package/dist/types/types/files.d.ts +14 -1
- package/dist/types/types/mutations.d.ts +3 -2
- package/dist/types/types/queuedTurns.d.ts +124 -90
- package/dist/types/types/runs.d.ts +9 -0
- package/dist/types/types/schedules.d.ts +10 -10
- package/dist/types/types/skills.d.ts +43 -0
- package/dist/types/types/tools.d.ts +132 -0
- package/dist/types/types/traces.d.ts +49 -0
- package/dist/types/types.d.ts +31 -1
- package/package.json +1 -1
- package/dist/data-service-Bx6IFaSa.mjs.map +0 -1
- package/dist/data-service-CTX0tVO5.js.map +0 -1
|
@@ -1,7 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { TAttachment, TPlugin, AgentProvider, MemoryScope, SkillsScope } from 'src/schemas';
|
|
1
3
|
import type { TTokenUsageEvent, TContextUsageEvent, TPendingSteer } from './runs';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
+
import type { FunctionTool, ToolResources, AgentToolOptions } from './tools';
|
|
5
|
+
import type { StatefulCodeEnvironment } from '../stateful-code';
|
|
6
|
+
import type { SummaryContentPart } from './content';
|
|
7
|
+
import type { TFile } from './files';
|
|
4
8
|
import { StepTypes, ContentTypes, ToolCallTypes } from './runs';
|
|
9
|
+
import { ArtifactModes } from 'src/artifacts';
|
|
10
|
+
import { EToolResources } from './tools';
|
|
11
|
+
export { STATEFUL_CODE_ENVIRONMENTS, resolveStatefulCodeEnvironment, resolveAllowedStatefulCodeEnvironments, } from '../stateful-code';
|
|
12
|
+
export type { StatefulCodeEnvironment } from '../stateful-code';
|
|
5
13
|
export declare namespace Agents {
|
|
6
14
|
type MessageType = 'human' | 'ai' | 'generic' | 'system' | 'function' | 'tool' | 'remove';
|
|
7
15
|
type ImageDetail = 'auto' | 'low' | 'high';
|
|
@@ -769,3 +777,226 @@ export type GraphEdge = {
|
|
|
769
777
|
*/
|
|
770
778
|
promptKey?: string;
|
|
771
779
|
};
|
|
780
|
+
export type AgentAvatar = {
|
|
781
|
+
filepath: string;
|
|
782
|
+
source: string;
|
|
783
|
+
};
|
|
784
|
+
export type AgentParameterValue = number | string | null;
|
|
785
|
+
export type AgentModelParameters = {
|
|
786
|
+
model?: string;
|
|
787
|
+
temperature: AgentParameterValue;
|
|
788
|
+
maxContextTokens: AgentParameterValue;
|
|
789
|
+
max_context_tokens: AgentParameterValue;
|
|
790
|
+
max_output_tokens: AgentParameterValue;
|
|
791
|
+
top_p: AgentParameterValue;
|
|
792
|
+
frequency_penalty: AgentParameterValue;
|
|
793
|
+
presence_penalty: AgentParameterValue;
|
|
794
|
+
useResponsesApi?: boolean;
|
|
795
|
+
web_search?: boolean;
|
|
796
|
+
};
|
|
797
|
+
export interface AgentBaseResource {
|
|
798
|
+
/**
|
|
799
|
+
* A list of file IDs made available to the tool.
|
|
800
|
+
*/
|
|
801
|
+
file_ids?: Array<string>;
|
|
802
|
+
/**
|
|
803
|
+
* A list of files already fetched.
|
|
804
|
+
*/
|
|
805
|
+
files?: Array<TFile>;
|
|
806
|
+
}
|
|
807
|
+
export interface AgentToolResources {
|
|
808
|
+
[EToolResources.image_edit]?: AgentBaseResource;
|
|
809
|
+
[EToolResources.execute_code]?: ExecuteCodeResource;
|
|
810
|
+
[EToolResources.file_search]?: AgentFileResource;
|
|
811
|
+
[EToolResources.context]?: AgentBaseResource;
|
|
812
|
+
/** @deprecated Use context instead */
|
|
813
|
+
[EToolResources.ocr]?: AgentBaseResource;
|
|
814
|
+
}
|
|
815
|
+
/**
|
|
816
|
+
* A resource for the execute_code tool.
|
|
817
|
+
* Contains file IDs made available to the tool (max 20 files) and already fetched files.
|
|
818
|
+
*/
|
|
819
|
+
export type ExecuteCodeResource = AgentBaseResource;
|
|
820
|
+
export interface AgentFileResource extends AgentBaseResource {
|
|
821
|
+
/**
|
|
822
|
+
* The ID of the vector store attached to this agent. There
|
|
823
|
+
* can be a maximum of 1 vector store attached to the agent.
|
|
824
|
+
*/
|
|
825
|
+
vector_store_ids?: Array<string>;
|
|
826
|
+
}
|
|
827
|
+
export type SupportContact = {
|
|
828
|
+
name?: string;
|
|
829
|
+
email?: string;
|
|
830
|
+
};
|
|
831
|
+
export type AgentOwnerContact = {
|
|
832
|
+
name?: string;
|
|
833
|
+
};
|
|
834
|
+
/**
|
|
835
|
+
* Configuration for spawning subagents (isolated-context child agents) from an agent.
|
|
836
|
+
* When `enabled` is true, the agent gets a subagent-spawn tool that can delegate work
|
|
837
|
+
* to itself, listed single-agent targets, and/or explicit saved-agent teams.
|
|
838
|
+
*/
|
|
839
|
+
export type AgentSubagentGraphEdge = Omit<GraphEdge, 'edgeType' | 'condition' | 'prompt' | 'promptKey'> & {
|
|
840
|
+
edgeType: 'direct';
|
|
841
|
+
condition?: never;
|
|
842
|
+
prompt?: string;
|
|
843
|
+
promptKey?: never;
|
|
844
|
+
};
|
|
845
|
+
/** A bounded saved-agent team that can be spawned as one isolated child graph. */
|
|
846
|
+
export type AgentSubagentGraph = {
|
|
847
|
+
/** Stable spawn-tool enum value for the team. */
|
|
848
|
+
type: string;
|
|
849
|
+
name: string;
|
|
850
|
+
description: string;
|
|
851
|
+
/** Member IDs. In create/update payloads, an empty ID refers to the current agent. */
|
|
852
|
+
agent_ids: string[];
|
|
853
|
+
edges: AgentSubagentGraphEdge[];
|
|
854
|
+
/** Entry member ID. In create/update payloads, an empty ID refers to the current agent. */
|
|
855
|
+
entry_agent_id: string;
|
|
856
|
+
/** Result member ID. In create/update payloads, an empty ID refers to the current agent. */
|
|
857
|
+
result_agent_id: string;
|
|
858
|
+
};
|
|
859
|
+
export type AgentSubagentsConfig = {
|
|
860
|
+
enabled?: boolean;
|
|
861
|
+
/** When true (default), the agent may spawn itself in an isolated context. */
|
|
862
|
+
allowSelf?: boolean;
|
|
863
|
+
/** Share current-turn files with authorized descendants. Off unless explicitly enabled. */
|
|
864
|
+
shareFiles?: boolean;
|
|
865
|
+
/** Specific agents that may be spawned as subagents. */
|
|
866
|
+
agent_ids?: string[];
|
|
867
|
+
/** Explicit saved-agent teams that may be spawned as bounded child graphs. */
|
|
868
|
+
graphs?: AgentSubagentGraph[];
|
|
869
|
+
};
|
|
870
|
+
export type AgentGitIdentity = {
|
|
871
|
+
/** Commit author and committer display name. */
|
|
872
|
+
name: string;
|
|
873
|
+
/** Commit author and committer email address. */
|
|
874
|
+
email: string;
|
|
875
|
+
};
|
|
876
|
+
export declare const agentGitIdentitySchema: z.ZodType<AgentGitIdentity | undefined>;
|
|
877
|
+
export type Agent = {
|
|
878
|
+
_id?: string;
|
|
879
|
+
id: string;
|
|
880
|
+
name: string | null;
|
|
881
|
+
author?: string | null;
|
|
882
|
+
/** The original custom endpoint name, lowercased */
|
|
883
|
+
endpoint?: string | null;
|
|
884
|
+
authorName?: string | null;
|
|
885
|
+
description: string | null;
|
|
886
|
+
created_at: number;
|
|
887
|
+
avatar: AgentAvatar | null;
|
|
888
|
+
instructions?: string | null;
|
|
889
|
+
additional_instructions?: string | null;
|
|
890
|
+
tools?: string[];
|
|
891
|
+
tool_kwargs?: Record<string, unknown>;
|
|
892
|
+
metadata?: Record<string, unknown>;
|
|
893
|
+
provider: AgentProvider;
|
|
894
|
+
model: string | null;
|
|
895
|
+
model_parameters: AgentModelParameters;
|
|
896
|
+
conversation_starters?: string[];
|
|
897
|
+
tool_resources?: AgentToolResources;
|
|
898
|
+
/** @deprecated Use edges instead */
|
|
899
|
+
agent_ids?: string[];
|
|
900
|
+
edges?: GraphEdge[];
|
|
901
|
+
end_after_tools?: boolean;
|
|
902
|
+
hide_sequential_outputs?: boolean;
|
|
903
|
+
/** Per-agent opt-in for stateful code sessions (requires the app-level capability). */
|
|
904
|
+
stateful_code_sessions?: boolean;
|
|
905
|
+
/** Stateful workspace sharing scope. Defaults to one workspace per user. */
|
|
906
|
+
stateful_code_environment?: StatefulCodeEnvironment;
|
|
907
|
+
/** Operator-configured managed or attached stateful execution environment. */
|
|
908
|
+
code_environment_id?: string | null;
|
|
909
|
+
/** Default attached workspace for new chats; empty means no agent default. */
|
|
910
|
+
code_workspace_id?: string;
|
|
911
|
+
repositoryInstructions?: 'prefer' | 'defer' | 'off';
|
|
912
|
+
/** Non-secret Git authorship injected into this agent's sandboxed commands. */
|
|
913
|
+
git_identity?: AgentGitIdentity | null;
|
|
914
|
+
artifacts?: ArtifactModes;
|
|
915
|
+
recursion_limit?: number;
|
|
916
|
+
isPublic?: boolean;
|
|
917
|
+
/**
|
|
918
|
+
* Whether the requesting user holds EDIT on this agent, so a single VIEW-scoped fetch can
|
|
919
|
+
* serve consumers that only need the editable subset instead of issuing a second full
|
|
920
|
+
* paginated walk under an EDIT-scoped cache key.
|
|
921
|
+
*
|
|
922
|
+
* Set by the list endpoint only; single-agent responses omit it. Treat absence as unknown
|
|
923
|
+
* and fail open (`isEditable !== false`), never as `false`, since a client on an older
|
|
924
|
+
* server would otherwise see an empty list rather than too many rows.
|
|
925
|
+
*
|
|
926
|
+
* Reflects the caller's ACL grant. The `MANAGE_AGENTS` capability bypasses ACL on write,
|
|
927
|
+
* so a capability holder can edit agents this flag reports as not editable.
|
|
928
|
+
*/
|
|
929
|
+
isEditable?: boolean;
|
|
930
|
+
version?: number;
|
|
931
|
+
category?: string;
|
|
932
|
+
support_contact?: SupportContact;
|
|
933
|
+
owner_contact?: AgentOwnerContact;
|
|
934
|
+
/** Per-tool configuration options (deferred loading, allowed callers, etc.) */
|
|
935
|
+
tool_options?: AgentToolOptions;
|
|
936
|
+
/** Attached action registrations, each `${encodedDomain}${actionDelimiter}${action_id}` */
|
|
937
|
+
actions?: string[];
|
|
938
|
+
/** Optional allowlist of skill ObjectIds. Only applies when `skills_enabled`. */
|
|
939
|
+
skills?: string[];
|
|
940
|
+
/** Master toggle for skill use on this agent. `true` = active (full catalog unless
|
|
941
|
+
* `skills` narrows it). `false`/undefined = inactive (no skills available). */
|
|
942
|
+
skills_enabled?: boolean;
|
|
943
|
+
/** Enables runtime skill creation without exposing an existing skill catalog. */
|
|
944
|
+
skill_authoring_enabled?: boolean;
|
|
945
|
+
/** Explicit catalog exposure while skills are enabled. Missing preserves legacy semantics. */
|
|
946
|
+
skills_scope?: SkillsScope;
|
|
947
|
+
/** Subagent spawning configuration — isolated-context child agents. */
|
|
948
|
+
subagents?: AgentSubagentsConfig;
|
|
949
|
+
/** Memory partition: `agent` isolates memories per (user, agent); default shared pool */
|
|
950
|
+
memory_scope?: MemoryScope;
|
|
951
|
+
};
|
|
952
|
+
export type TAgentsMap = Record<string, Agent | undefined>;
|
|
953
|
+
export type AgentCreateParams = {
|
|
954
|
+
git_identity?: AgentGitIdentity;
|
|
955
|
+
name?: string | null;
|
|
956
|
+
description?: string | null;
|
|
957
|
+
avatar?: AgentAvatar | null;
|
|
958
|
+
file_ids?: string[];
|
|
959
|
+
instructions?: string | null;
|
|
960
|
+
tools?: Array<FunctionTool | string>;
|
|
961
|
+
provider: AgentProvider;
|
|
962
|
+
model: string | null;
|
|
963
|
+
model_parameters: AgentModelParameters;
|
|
964
|
+
} & Pick<Agent, 'agent_ids' | 'edges' | 'end_after_tools' | 'hide_sequential_outputs' | 'stateful_code_sessions' | 'stateful_code_environment' | 'code_environment_id' | 'code_workspace_id' | 'repositoryInstructions' | 'artifacts' | 'recursion_limit' | 'category' | 'support_contact' | 'tool_options' | 'skills' | 'skills_enabled' | 'skill_authoring_enabled' | 'skills_scope' | 'subagents' | 'memory_scope'>;
|
|
965
|
+
export type AgentUpdateParams = {
|
|
966
|
+
name?: string | null;
|
|
967
|
+
description?: string | null;
|
|
968
|
+
avatar?: AgentAvatar | null;
|
|
969
|
+
file_ids?: string[];
|
|
970
|
+
instructions?: string | null;
|
|
971
|
+
tools?: Array<FunctionTool | string>;
|
|
972
|
+
tool_resources?: ToolResources;
|
|
973
|
+
provider?: AgentProvider;
|
|
974
|
+
model?: string | null;
|
|
975
|
+
model_parameters?: AgentModelParameters;
|
|
976
|
+
} & Pick<Agent, 'agent_ids' | 'edges' | 'end_after_tools' | 'hide_sequential_outputs' | 'stateful_code_sessions' | 'stateful_code_environment' | 'code_environment_id' | 'git_identity' | 'code_workspace_id' | 'repositoryInstructions' | 'artifacts' | 'recursion_limit' | 'category' | 'support_contact' | 'tool_options' | 'skills' | 'skills_enabled' | 'skill_authoring_enabled' | 'skills_scope' | 'subagents' | 'memory_scope'>;
|
|
977
|
+
export type AgentListParams = {
|
|
978
|
+
limit?: number;
|
|
979
|
+
requiredPermission: number;
|
|
980
|
+
category?: string;
|
|
981
|
+
search?: string;
|
|
982
|
+
cursor?: string;
|
|
983
|
+
promoted?: 0 | 1;
|
|
984
|
+
};
|
|
985
|
+
export type AgentListResponse = {
|
|
986
|
+
object: string;
|
|
987
|
+
data: Agent[];
|
|
988
|
+
first_id: string;
|
|
989
|
+
last_id: string;
|
|
990
|
+
has_more: boolean;
|
|
991
|
+
after?: string;
|
|
992
|
+
};
|
|
993
|
+
export type AgentFile = {
|
|
994
|
+
file_id: string;
|
|
995
|
+
id?: string;
|
|
996
|
+
temp_file_id?: string;
|
|
997
|
+
bytes: number;
|
|
998
|
+
created_at: number;
|
|
999
|
+
filename: string;
|
|
1000
|
+
object: string;
|
|
1001
|
+
purpose: 'fine-tune' | 'fine-tune-results' | 'agents' | 'agents_output';
|
|
1002
|
+
};
|