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.
Files changed (48) hide show
  1. package/dist/{data-service-Bx6IFaSa.mjs → data-service-B-WUVvTH.mjs} +434 -174
  2. package/dist/data-service-B-WUVvTH.mjs.map +1 -0
  3. package/dist/{data-service-CTX0tVO5.js → data-service-CUG1qdeC.js} +577 -203
  4. package/dist/data-service-CUG1qdeC.js.map +1 -0
  5. package/dist/index.js +346 -72
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.mjs +307 -68
  8. package/dist/index.mjs.map +1 -1
  9. package/dist/react-query/index.js +1 -1
  10. package/dist/react-query/index.mjs +1 -1
  11. package/dist/types/actions.d.ts +1 -1
  12. package/dist/types/agentToolOptions.d.ts +1 -1
  13. package/dist/types/api-endpoints.d.ts +1 -0
  14. package/dist/types/backgroundResults.d.ts +13 -0
  15. package/dist/types/balance.d.ts +4 -0
  16. package/dist/types/bedrock.d.ts +77 -70
  17. package/dist/types/code/workspace.d.ts +22 -0
  18. package/dist/types/config.d.ts +5362 -4206
  19. package/dist/types/data-service.d.ts +14 -12
  20. package/dist/types/file-config.d.ts +81 -42
  21. package/dist/types/filters.d.ts +205 -205
  22. package/dist/types/footer.d.ts +20 -0
  23. package/dist/types/generate.d.ts +28 -28
  24. package/dist/types/index.d.ts +4 -0
  25. package/dist/types/keys.d.ts +2 -1
  26. package/dist/types/limits.d.ts +8 -0
  27. package/dist/types/mcp.d.ts +999 -352
  28. package/dist/types/messages.d.ts +12 -7
  29. package/dist/types/models.d.ts +429 -429
  30. package/dist/types/parameterSettings.d.ts +2 -1
  31. package/dist/types/parsers.d.ts +25 -1
  32. package/dist/types/resolve-llm-delivery-path.d.ts +97 -4
  33. package/dist/types/schemas.d.ts +646 -643
  34. package/dist/types/types/agents.d.ts +233 -2
  35. package/dist/types/types/assistants.d.ts +2 -641
  36. package/dist/types/types/content.d.ts +286 -0
  37. package/dist/types/types/files.d.ts +14 -1
  38. package/dist/types/types/mutations.d.ts +3 -2
  39. package/dist/types/types/queuedTurns.d.ts +124 -90
  40. package/dist/types/types/runs.d.ts +9 -0
  41. package/dist/types/types/schedules.d.ts +10 -10
  42. package/dist/types/types/skills.d.ts +43 -0
  43. package/dist/types/types/tools.d.ts +132 -0
  44. package/dist/types/types/traces.d.ts +49 -0
  45. package/dist/types/types.d.ts +31 -1
  46. package/package.json +1 -1
  47. package/dist/data-service-Bx6IFaSa.mjs.map +0 -1
  48. package/dist/data-service-CTX0tVO5.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: {
@@ -84,4 +85,4 @@ export declare const agentParamSettings: Record<string, SettingsConfiguration |
84
85
  * current models (2.5 and 3+) surface their 64K output limit instead of the legacy 8K value.
85
86
  * Anthropic prompt-cache controls are only surfaced for models that support them.
86
87
  */
87
- 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;
@@ -1,5 +1,5 @@
1
1
  import type { ZodIssue } from 'zod';
2
- import type * as a from './types/assistants';
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.
@@ -1,5 +1,14 @@
1
1
  import type { TDefaultLLMDeliveryPath, TDefaultLLMDeliveryPathConfig } from './file-config';
2
- import type { EndpointFileConfig, FileConfig } from './types/files';
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;
3
12
  export declare const SYSTEM_LLM_DELIVERY_DEFAULTS: Required<TDefaultLLMDeliveryPathConfig>;
4
13
  export declare function isNativelyReadableText(mimeType: string): boolean;
5
14
  export declare function hasTextExtractionPath(mimeType: string): boolean;
@@ -7,26 +16,30 @@ export declare function hasTextExtractionPath(mimeType: string): boolean;
7
16
  * Resolves the default file path destination for a given mime type.
8
17
  * Resolution chain: endpoint overrides -> endpoint fallback -> global overrides -> global fallback -> system defaults.
9
18
  */
10
- export declare function resolveDefaultLLMDeliveryPath(mimeType: string, endpointConfig?: TDefaultLLMDeliveryPathConfig, globalConfig?: TDefaultLLMDeliveryPathConfig, endpoint?: string, useResponsesApi?: boolean, sttConfigured?: boolean): TDefaultLLMDeliveryPath;
19
+ export declare function resolveDefaultLLMDeliveryPath(mimeType: string, endpointConfig?: TDefaultLLMDeliveryPathConfig, globalConfig?: TDefaultLLMDeliveryPathConfig, endpoint?: string, useResponsesApi?: boolean, sttConfigured?: boolean, supportedMimeTypes?: RegexLike[]): TDefaultLLMDeliveryPath;
11
20
  /**
12
21
  * Delivery path for an upload that named no tool resource. The legacy chooser makes the
13
22
  * destination explicit, so nothing is inferred there.
14
23
  */
15
- export declare function resolveDefaultUploadLLMDeliveryPath({ mimeType, endpointConfig, fileConfig, endpoint, useResponsesApi, sttConfigured, }: {
24
+ export declare function resolveDefaultUploadLLMDeliveryPath({ mimeType, endpointConfig, fileConfig, endpoint, endpointProvider, useResponsesApi, sttConfigured, }: {
16
25
  mimeType: string;
17
26
  endpointConfig?: EndpointFileConfig;
18
27
  fileConfig?: FileConfig;
19
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;
20
32
  useResponsesApi?: boolean;
21
33
  sttConfigured?: boolean;
22
34
  }): TDefaultLLMDeliveryPath;
23
35
  /** Delivery path for an upload, honoring an explicitly chosen tool resource. */
24
- export declare function resolveUploadLLMDeliveryPath({ toolResource, mimeType, endpointConfig, fileConfig, endpoint, useResponsesApi, sttConfigured, }: {
36
+ export declare function resolveUploadLLMDeliveryPath({ toolResource, mimeType, endpointConfig, fileConfig, endpoint, useResponsesApi, endpointProvider, sttConfigured, }: {
25
37
  toolResource?: string | null;
26
38
  mimeType: string;
27
39
  endpointConfig?: EndpointFileConfig;
28
40
  fileConfig?: FileConfig;
29
41
  endpoint?: string;
42
+ endpointProvider?: string | null;
30
43
  useResponsesApi?: boolean;
31
44
  sttConfigured?: boolean;
32
45
  }): TDefaultLLMDeliveryPath;
@@ -38,6 +51,86 @@ export declare function resolveUploadLLMDeliveryPath({ toolResource, mimeType, e
38
51
  * deferred provisioning so the two cannot queue a file the other would refuse.
39
52
  */
40
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;
41
134
  /** Why an upload cannot be accepted, when nothing would be able to read it. */
42
135
  export type UploadRejection = 'no-agent-resource' | 'context-disabled' | 'no-consumer';
43
136
  /**