librechat-data-provider 0.8.522 → 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-CaB7saTP.mjs → data-service-B-WUVvTH.mjs} +1044 -173
- package/dist/data-service-B-WUVvTH.mjs.map +1 -0
- package/dist/{data-service-D5kHzBt-.js → data-service-CUG1qdeC.js} +1426 -207
- package/dist/data-service-CUG1qdeC.js.map +1 -0
- package/dist/index.js +886 -74
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +780 -70
- 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/accessPermissions.d.ts +54 -1
- package/dist/types/actions.d.ts +1 -1
- package/dist/types/agentToolOptions.d.ts +1 -1
- package/dist/types/api-endpoints.d.ts +7 -0
- package/dist/types/backgroundResults.d.ts +13 -0
- package/dist/types/balance.d.ts +4 -0
- package/dist/types/bedrock.d.ts +132 -65
- package/dist/types/code/approval.d.ts +26 -0
- package/dist/types/code/worker.d.ts +10 -0
- package/dist/types/code/workspace.d.ts +50 -0
- package/dist/types/codeEnvRef.d.ts +5 -0
- package/dist/types/config.d.ts +5859 -2469
- package/dist/types/data-service.d.ts +22 -12
- package/dist/types/errors.d.ts +2 -0
- package/dist/types/file-config.d.ts +179 -12
- package/dist/types/filters.d.ts +97 -97
- package/dist/types/footer.d.ts +20 -0
- package/dist/types/generate.d.ts +48 -24
- package/dist/types/index.d.ts +11 -0
- package/dist/types/keys.d.ts +13 -2
- package/dist/types/limits.d.ts +8 -0
- package/dist/types/mcp.d.ts +683 -30
- package/dist/types/messages.d.ts +25 -1
- package/dist/types/models.d.ts +312 -183
- package/dist/types/parameterSettings.d.ts +10 -1
- package/dist/types/parsers.d.ts +25 -1
- package/dist/types/providers.d.ts +1 -0
- package/dist/types/resolve-llm-delivery-path.d.ts +161 -0
- package/dist/types/schemas.d.ts +771 -457
- package/dist/types/svg.d.ts +34 -0
- package/dist/types/types/agents.d.ts +257 -2
- package/dist/types/types/assistants.d.ts +2 -617
- package/dist/types/types/content.d.ts +286 -0
- package/dist/types/types/files.d.ts +48 -1
- package/dist/types/types/insights.d.ts +9 -0
- package/dist/types/types/mutations.d.ts +3 -2
- package/dist/types/types/queries.d.ts +8 -1
- package/dist/types/types/queuedTurns.d.ts +140 -106
- package/dist/types/types/runs.d.ts +33 -5
- package/dist/types/types/schedules.d.ts +40 -7
- 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 +134 -0
- package/dist/types/types.d.ts +72 -2
- package/package.json +2 -2
- package/dist/data-service-CaB7saTP.mjs.map +0 -1
- package/dist/data-service-D5kHzBt-.js.map +0 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOMPurify policy for user-provided SVG icons, shared by the browser uploader and
|
|
3
|
+
* the server trust boundary so a preview and the persisted icon cannot disagree.
|
|
4
|
+
* `use` is re-added for self-contained `<defs>` references (targets restricted by
|
|
5
|
+
* `restrictSvgReferences`); every SMIL element is forbidden so a stored icon
|
|
6
|
+
* cannot animate forever wherever it renders.
|
|
7
|
+
*/
|
|
8
|
+
export declare const SVG_SANITIZE_CONFIG: {
|
|
9
|
+
USE_PROFILES: {
|
|
10
|
+
svg: boolean;
|
|
11
|
+
svgFilters: boolean;
|
|
12
|
+
};
|
|
13
|
+
ADD_TAGS: string[];
|
|
14
|
+
ADD_ATTR: string[];
|
|
15
|
+
FORBID_TAGS: string[];
|
|
16
|
+
FORBID_ATTR: string[];
|
|
17
|
+
};
|
|
18
|
+
/** Element surface shared by the browser DOM and the server's jsdom. */
|
|
19
|
+
export interface SvgAttributeHost {
|
|
20
|
+
attributes: ArrayLike<{
|
|
21
|
+
name: string;
|
|
22
|
+
}>;
|
|
23
|
+
getAttribute(name: string): string | null;
|
|
24
|
+
removeAttribute(name: string): void;
|
|
25
|
+
}
|
|
26
|
+
/** DOMPurify hook that drops every attribute referencing outside the document. */
|
|
27
|
+
export declare function restrictSvgReferences(node: SvgAttributeHost): void;
|
|
28
|
+
/**
|
|
29
|
+
* Makes HTML-mode sanitizer output valid as a standalone `image/svg+xml`
|
|
30
|
+
* document: restores camelCase element names the HTML parser lowercased and
|
|
31
|
+
* declares the SVG namespace on the root, without which an XML parser puts the
|
|
32
|
+
* root in no namespace and the icon renders blank.
|
|
33
|
+
*/
|
|
34
|
+
export declare function finalizeSvgMarkup(markup: string): string;
|
|
@@ -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';
|
|
@@ -75,11 +83,15 @@ export declare namespace Agents {
|
|
|
75
83
|
taskId: string;
|
|
76
84
|
toolName: string;
|
|
77
85
|
status: 'completed' | 'error';
|
|
86
|
+
/** Additive rolling-deploy-compatible cancellation discriminator. */
|
|
87
|
+
cancelled?: true;
|
|
78
88
|
settledAt: Date;
|
|
79
89
|
resultClaim?: {
|
|
80
90
|
kind: 'manual' | 'wakeup';
|
|
81
91
|
claimId: string;
|
|
82
92
|
claimedAt: Date;
|
|
93
|
+
/** Response generation that owns a manual delivery claim. */
|
|
94
|
+
generationId?: string;
|
|
83
95
|
};
|
|
84
96
|
};
|
|
85
97
|
/** The tool call was rejected before execution because its input failed schema validation. */
|
|
@@ -383,6 +395,8 @@ export declare namespace Agents {
|
|
|
383
395
|
tool_call_id: string;
|
|
384
396
|
/** Optional human-readable description shown alongside the prompt */
|
|
385
397
|
description?: string;
|
|
398
|
+
/** Server-authored provenance. Absent for user, MCP, action, and older tool calls. */
|
|
399
|
+
source?: 'librechat_code';
|
|
386
400
|
}
|
|
387
401
|
/**
|
|
388
402
|
* Per-call review configuration: which decisions the user is allowed to make.
|
|
@@ -485,6 +499,8 @@ export declare namespace Agents {
|
|
|
485
499
|
* so the id check can't.
|
|
486
500
|
*/
|
|
487
501
|
requestFingerprint?: string;
|
|
502
|
+
/** Current-version fingerprint; server-only and omitted from client projections. */
|
|
503
|
+
requestFingerprintV2?: string;
|
|
488
504
|
/**
|
|
489
505
|
* Graph-determining request fields (endpoint, agent_id, model, spec, promptPrefix,
|
|
490
506
|
* ephemeralAgent) captured at pause. The resume route REPLAYS these onto the request
|
|
@@ -492,6 +508,22 @@ export declare namespace Agents {
|
|
|
492
508
|
* no longer reconstruct the ephemeral config — still rebuilds the same agent/graph.
|
|
493
509
|
*/
|
|
494
510
|
resumeContext?: Record<string, unknown>;
|
|
511
|
+
/**
|
|
512
|
+
* Opaque, server-only identity of the stateful code targets selected when a
|
|
513
|
+
* tool approval paused. Resume rejects a changed target before provider or
|
|
514
|
+
* tool execution so an approval cannot migrate to another VM or workspace.
|
|
515
|
+
*/
|
|
516
|
+
codeExecutionBinding?: CodeExecutionApprovalBinding;
|
|
517
|
+
}
|
|
518
|
+
interface CodeExecutionApprovalTargetBinding {
|
|
519
|
+
/** Agent identity when available; anonymous ephemeral agents use null. */
|
|
520
|
+
agentId: string | null;
|
|
521
|
+
/** SHA-256 of the resolved route, worker and runtime-session identity. */
|
|
522
|
+
targetHash: string;
|
|
523
|
+
}
|
|
524
|
+
interface CodeExecutionApprovalBinding {
|
|
525
|
+
version: 1;
|
|
526
|
+
targets: CodeExecutionApprovalTargetBinding[];
|
|
495
527
|
}
|
|
496
528
|
/**
|
|
497
529
|
* Scope of a tool-approval decision — drives the "remember this" persistence
|
|
@@ -745,3 +777,226 @@ export type GraphEdge = {
|
|
|
745
777
|
*/
|
|
746
778
|
promptKey?: string;
|
|
747
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
|
+
};
|