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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ResponsesApiRouting } from './types';
|
|
1
2
|
import { SettingDefinition, SettingsConfiguration } from './generate';
|
|
2
3
|
export declare const librechat: {
|
|
3
4
|
modelLabel: {
|
|
@@ -65,6 +66,14 @@ export declare const librechat: {
|
|
|
65
66
|
};
|
|
66
67
|
};
|
|
67
68
|
export declare const paramSettings: Record<string, SettingsConfiguration | undefined>;
|
|
69
|
+
/**
|
|
70
|
+
* Normalizes an admin-configured `dropParams` list into the UI/conversation keys used to hide
|
|
71
|
+
* the matching controls in the settings panels. `endpointKey` should be the same key used to
|
|
72
|
+
* resolve the panel's parameter settings (e.g. `overriddenEndpointKey`); the backend-name alias
|
|
73
|
+
* is only applied for OpenAI-compatible endpoints, since native providers (anthropic, google,
|
|
74
|
+
* bedrock, ...) already use these backend names as their UI key.
|
|
75
|
+
*/
|
|
76
|
+
export declare function resolveDropParamsUIKeys(dropParams: string[] | undefined, endpointKey: string): Set<string>;
|
|
68
77
|
export declare const presetSettings: Record<string, {
|
|
69
78
|
col1: SettingsConfiguration;
|
|
70
79
|
col2: SettingsConfiguration;
|
|
@@ -76,4 +85,4 @@ export declare const agentParamSettings: Record<string, SettingsConfiguration |
|
|
|
76
85
|
* current models (2.5 and 3+) surface their 64K output limit instead of the legacy 8K value.
|
|
77
86
|
* Anthropic prompt-cache controls are only surfaced for models that support them.
|
|
78
87
|
*/
|
|
79
|
-
export declare function applyModelAwareDefaults(settings: SettingsConfiguration, endpoint: string, model?: string): SettingsConfiguration;
|
|
88
|
+
export declare function applyModelAwareDefaults(settings: SettingsConfiguration, endpoint: string, model?: string, responsesApiRouting?: ResponsesApiRouting): SettingsConfiguration;
|
package/dist/types/parsers.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ZodIssue } from 'zod';
|
|
2
|
-
import type * as a from './types/
|
|
2
|
+
import type * as a from './types/content';
|
|
3
3
|
import type * as s from './schemas';
|
|
4
4
|
import type * as t from './types';
|
|
5
5
|
import { EModelEndpoint } from './schemas';
|
|
@@ -60,6 +60,30 @@ export declare function getEphemeralSender({ modelLabel, specLabel, modelDisplay
|
|
|
60
60
|
specLabel?: string | null;
|
|
61
61
|
modelDisplayLabel?: string | null;
|
|
62
62
|
}): string;
|
|
63
|
+
/**
|
|
64
|
+
* Whether a persisted `sender` is a label someone configured rather than the
|
|
65
|
+
* model-derived name `getResponseSender` produces.
|
|
66
|
+
*
|
|
67
|
+
* The sender is the one thing that records which it was: `resolveSender` writes an
|
|
68
|
+
* agent's name, then the `getEphemeralSender` chain (`modelLabel` → a model spec's
|
|
69
|
+
* `label` → an endpoint's `modelDisplayLabel`), and falls back to `getResponseSender`
|
|
70
|
+
* only when none of those is set. Asking the message rather than the conversation
|
|
71
|
+
* settles three things a settings lookup cannot: labels that live in config a caller
|
|
72
|
+
* may not hold, labels an endpoint ignores (Anthropic keeps reading `Claude` whatever
|
|
73
|
+
* `chatGptLabel` says, and matches here), and labels changed since the message was
|
|
74
|
+
* written — its header still shows the sender it was written under.
|
|
75
|
+
*
|
|
76
|
+
* Equality is the test, so the only way to be wrong is a stored name that no longer
|
|
77
|
+
* matches what the current heuristics produce, which withholds a model rather than
|
|
78
|
+
* revealing one.
|
|
79
|
+
*/
|
|
80
|
+
export declare const isConfiguredSender: ({ sender, endpoint, endpointType, model, isCreatedByUser, }: {
|
|
81
|
+
sender?: string | null;
|
|
82
|
+
endpoint?: EModelEndpoint | string | null;
|
|
83
|
+
endpointType?: EModelEndpoint | string | null;
|
|
84
|
+
model?: string | null;
|
|
85
|
+
isCreatedByUser?: boolean | null;
|
|
86
|
+
}) => boolean;
|
|
63
87
|
/**
|
|
64
88
|
* Encodes an ephemeral agent ID from endpoint, model, optional sender, and optional index.
|
|
65
89
|
* Uses __ to replace : (reserved in graph node names) and ___ to separate sender.
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import type { TDefaultLLMDeliveryPath, TDefaultLLMDeliveryPathConfig } from './file-config';
|
|
2
|
+
import type { EndpointFileConfig, FileConfig, RegexLike } from './types/files';
|
|
3
|
+
import type { CodeEnvReferenceSet } from './codeEnvRef';
|
|
4
|
+
import type { TEndpoint } from './config';
|
|
5
|
+
/**
|
|
6
|
+
* The native provider a custom endpoint declares, when it declares one. A custom endpoint
|
|
7
|
+
* speaks OpenAI's API unless its config names another dialect, and the upload route needs
|
|
8
|
+
* that answer for the same reason request initialization does: the media encoders emit
|
|
9
|
+
* OpenAI-format parts, so a custom endpoint running as Anthropic receives none.
|
|
10
|
+
*/
|
|
11
|
+
export declare function getCustomEndpointProvider(customEndpoints: Array<Partial<Pick<TEndpoint, 'name' | 'provider'>>> | undefined, endpoint?: string | null): string | undefined;
|
|
12
|
+
export declare const SYSTEM_LLM_DELIVERY_DEFAULTS: Required<TDefaultLLMDeliveryPathConfig>;
|
|
13
|
+
export declare function isNativelyReadableText(mimeType: string): boolean;
|
|
14
|
+
export declare function hasTextExtractionPath(mimeType: string): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Resolves the default file path destination for a given mime type.
|
|
17
|
+
* Resolution chain: endpoint overrides -> endpoint fallback -> global overrides -> global fallback -> system defaults.
|
|
18
|
+
*/
|
|
19
|
+
export declare function resolveDefaultLLMDeliveryPath(mimeType: string, endpointConfig?: TDefaultLLMDeliveryPathConfig, globalConfig?: TDefaultLLMDeliveryPathConfig, endpoint?: string, useResponsesApi?: boolean, sttConfigured?: boolean, supportedMimeTypes?: RegexLike[]): TDefaultLLMDeliveryPath;
|
|
20
|
+
/**
|
|
21
|
+
* Delivery path for an upload that named no tool resource. The legacy chooser makes the
|
|
22
|
+
* destination explicit, so nothing is inferred there.
|
|
23
|
+
*/
|
|
24
|
+
export declare function resolveDefaultUploadLLMDeliveryPath({ mimeType, endpointConfig, fileConfig, endpoint, endpointProvider, useResponsesApi, sttConfigured, }: {
|
|
25
|
+
mimeType: string;
|
|
26
|
+
endpointConfig?: EndpointFileConfig;
|
|
27
|
+
fileConfig?: FileConfig;
|
|
28
|
+
endpoint?: string;
|
|
29
|
+
/** The provider the endpoint runs as, when the caller knows it: a custom endpoint's
|
|
30
|
+
* declared dialect at upload time, the agent's resolved provider at turn time. */
|
|
31
|
+
endpointProvider?: string | null;
|
|
32
|
+
useResponsesApi?: boolean;
|
|
33
|
+
sttConfigured?: boolean;
|
|
34
|
+
}): TDefaultLLMDeliveryPath;
|
|
35
|
+
/** Delivery path for an upload, honoring an explicitly chosen tool resource. */
|
|
36
|
+
export declare function resolveUploadLLMDeliveryPath({ toolResource, mimeType, endpointConfig, fileConfig, endpoint, useResponsesApi, endpointProvider, sttConfigured, }: {
|
|
37
|
+
toolResource?: string | null;
|
|
38
|
+
mimeType: string;
|
|
39
|
+
endpointConfig?: EndpointFileConfig;
|
|
40
|
+
fileConfig?: FileConfig;
|
|
41
|
+
endpoint?: string;
|
|
42
|
+
endpointProvider?: string | null;
|
|
43
|
+
useResponsesApi?: boolean;
|
|
44
|
+
sttConfigured?: boolean;
|
|
45
|
+
}): TDefaultLLMDeliveryPath;
|
|
46
|
+
/**
|
|
47
|
+
* Whether a file tool can do anything with this type. `file_search` indexes extracted
|
|
48
|
+
* text, so it needs a type some step can turn into text and cannot use media, whose
|
|
49
|
+
* extraction paths are OCR and speech rather than the vector store. Code execution is
|
|
50
|
+
* judged by the list the client offers it from. Shared by upload-time selection and
|
|
51
|
+
* deferred provisioning so the two cannot queue a file the other would refuse.
|
|
52
|
+
*/
|
|
53
|
+
export declare function canToolResourceConsume(toolResource: string, mimeType: string): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* The file-reading tools one agent's turn runs. Each flag requires deployment capability,
|
|
56
|
+
* the caller's role grant, and a reader in the final loaded tool set.
|
|
57
|
+
*/
|
|
58
|
+
export interface TurnFileConsumers {
|
|
59
|
+
executeCode: boolean;
|
|
60
|
+
fileSearch: boolean;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Whether the record shows this file reached a tool's own store: vectors for file search, a
|
|
64
|
+
* sandbox pointer for code execution. Nothing else writes either, so their presence is proof
|
|
65
|
+
* the file was provisioned and their absence proof it was not. The same evidence deferred
|
|
66
|
+
* provisioning reads before queueing a file, so a turn cannot withhold content for a tool that
|
|
67
|
+
* provisioning has yet to serve.
|
|
68
|
+
*/
|
|
69
|
+
export declare function hasToolResourceProvisioning(file: TurnDeliveryFile, toolResource: string): boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Whether a tool this turn runs can read a file of this type.
|
|
72
|
+
*
|
|
73
|
+
* Passing the record asks the stricter question a delivery decision needs where a tool serves
|
|
74
|
+
* only what it already holds. File search reads the vector store, and an upload that named no
|
|
75
|
+
* destination is filed under no tool at all, so an enabled search tool is a reader only once
|
|
76
|
+
* the record shows the store holds the file. Run Code needs no copy in advance: its first call
|
|
77
|
+
* uploads every attachment it can read to the sandbox, so enabling it is enough. Requiring a
|
|
78
|
+
* copy there would hand the file's text to the prompt on every turn before the first code run,
|
|
79
|
+
* and a turn that refuses that text never runs code, so the file would never become held.
|
|
80
|
+
*/
|
|
81
|
+
export declare function hasTurnFileConsumer(mimeType: string, consumers: TurnFileConsumers, file?: TurnDeliveryFile): boolean;
|
|
82
|
+
/**
|
|
83
|
+
* The inputs that route every attachment for the agent running a turn. Initialization
|
|
84
|
+
* settles them once, after the provider swap and the Responses API decision, and every
|
|
85
|
+
* reader of a turn route consumes this value rather than deriving one from the agent.
|
|
86
|
+
*/
|
|
87
|
+
export interface TurnDeliveryRouting {
|
|
88
|
+
fileConfig: FileConfig;
|
|
89
|
+
endpointConfig: EndpointFileConfig;
|
|
90
|
+
/** The endpoint the file policy is configured under: a custom endpoint's own name, not
|
|
91
|
+
* the client family initialization runs it as. */
|
|
92
|
+
endpoint: string;
|
|
93
|
+
/** The dialect a custom endpoint declares, which decides whether it receives OpenAI-format
|
|
94
|
+
* media; undefined for a built-in or OpenAI-compatible endpoint. */
|
|
95
|
+
endpointProvider?: string;
|
|
96
|
+
useResponsesApi?: boolean;
|
|
97
|
+
sttConfigured: boolean;
|
|
98
|
+
}
|
|
99
|
+
/** The fields of an attachment record that decide its delivery on a turn. */
|
|
100
|
+
export interface TurnDeliveryFile {
|
|
101
|
+
type?: string;
|
|
102
|
+
text?: string | null;
|
|
103
|
+
/** Stored as an upload-time inference, so any string may be read back. */
|
|
104
|
+
llmDeliveryPath?: string | null;
|
|
105
|
+
/** Whether a vector store holds this file, which is what lets file search serve it.
|
|
106
|
+
* Records predating namespace tracking carry only this flag. */
|
|
107
|
+
embedded?: boolean | null;
|
|
108
|
+
metadata?: ({
|
|
109
|
+
routingMimeType?: string;
|
|
110
|
+
destinationChosen?: boolean;
|
|
111
|
+
/** Vector namespaces holding this file, written as each embedding succeeds. */
|
|
112
|
+
embeddedEntities?: string[];
|
|
113
|
+
} & CodeEnvReferenceSet) | null;
|
|
114
|
+
}
|
|
115
|
+
/** Whether a record's stored route was inferred at upload, so each turn resolves it again. */
|
|
116
|
+
export declare function hasInferredLLMDeliveryPath(file: TurnDeliveryFile): boolean;
|
|
117
|
+
/**
|
|
118
|
+
* Delivery path for one attachment on one agent's turn.
|
|
119
|
+
*
|
|
120
|
+
* A record predating routing and a destination the user chose keep what they stored. An
|
|
121
|
+
* inferred route re-resolves against the endpoint handling the turn. A `none` route leaves
|
|
122
|
+
* the file for a tool; where the endpoint enables `textFallbackWithoutTools` and no tool this
|
|
123
|
+
* turn runs can read the file, the text extracted at upload is delivered rather than the file
|
|
124
|
+
* reaching nothing. Consumers left undefined are unknown and not judged, as in
|
|
125
|
+
* {@link resolveUploadDestination}.
|
|
126
|
+
*
|
|
127
|
+
* For file search, reading is asked of the record rather than of the tool set, because the two
|
|
128
|
+
* disagree for the upload that needs the fallback most: one that named no destination is filed
|
|
129
|
+
* under no tool, so enabling file search would otherwise withhold the text for a vector store
|
|
130
|
+
* that never received the file. Run Code is judged by the tool set: see
|
|
131
|
+
* {@link hasTurnFileConsumer}.
|
|
132
|
+
*/
|
|
133
|
+
export declare function resolveTurnLLMDeliveryPath(routing: Partial<TurnDeliveryRouting> | undefined, file: TurnDeliveryFile, consumers?: TurnFileConsumers): TDefaultLLMDeliveryPath | undefined;
|
|
134
|
+
/** Why an upload cannot be accepted, when nothing would be able to read it. */
|
|
135
|
+
export type UploadRejection = 'no-agent-resource' | 'context-disabled' | 'no-consumer';
|
|
136
|
+
/**
|
|
137
|
+
* Where a unified upload will end up, and whether it can be accepted at all.
|
|
138
|
+
*
|
|
139
|
+
* An upload has to be readable by something: the model, an extraction step, or a file
|
|
140
|
+
* tool. A permanent one has to land on an agent resource too, or storing it succeeds
|
|
141
|
+
* while leaving the agent no reference to it. Both outcomes are decided here rather than
|
|
142
|
+
* discovered later, so a request that would change nothing is refused with a reason.
|
|
143
|
+
*
|
|
144
|
+
* `agentTools` is undefined when no agent record backs the upload, as for an ephemeral
|
|
145
|
+
* agent that exists only for the request. An unknown tool set is not judged.
|
|
146
|
+
*/
|
|
147
|
+
export declare function resolveUploadDestination(params: {
|
|
148
|
+
toolResource?: string | null;
|
|
149
|
+
deliveryPath: TDefaultLLMDeliveryPath;
|
|
150
|
+
mimeType: string;
|
|
151
|
+
agentTools?: string[];
|
|
152
|
+
hasAgent: boolean;
|
|
153
|
+
isMessageAttachment: boolean;
|
|
154
|
+
/** True when a message attachment may acquire a compatible tool on a later turn. */
|
|
155
|
+
allowUnknownMessageConsumer?: boolean;
|
|
156
|
+
/** Undefined when not looked up, as for an upload that cannot land on context. */
|
|
157
|
+
contextEnabled?: boolean;
|
|
158
|
+
}): {
|
|
159
|
+
toolResource?: string;
|
|
160
|
+
rejection?: UploadRejection;
|
|
161
|
+
};
|