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
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import type { SubagentIdentity, ContentTypes } from './runs';
|
|
2
|
+
import type { Agents } from './agents';
|
|
3
|
+
import type { TFile } from './files';
|
|
4
|
+
/**
|
|
5
|
+
* Details of the Code Interpreter tool call the run step was involved in.
|
|
6
|
+
* Includes the tool call ID, the code interpreter definition, and the type of tool call.
|
|
7
|
+
*/
|
|
8
|
+
export type CodeToolCall = {
|
|
9
|
+
id: string;
|
|
10
|
+
code_interpreter: {
|
|
11
|
+
input: string;
|
|
12
|
+
outputs: Array<Record<string, unknown>>;
|
|
13
|
+
};
|
|
14
|
+
type: 'code_interpreter';
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Details of a Function tool call the run step was involved in.
|
|
18
|
+
* Includes the tool call ID, the function definition, and the type of tool call.
|
|
19
|
+
*/
|
|
20
|
+
export type FunctionToolCall = {
|
|
21
|
+
id: string;
|
|
22
|
+
function: {
|
|
23
|
+
arguments: string;
|
|
24
|
+
name: string;
|
|
25
|
+
output: string | null;
|
|
26
|
+
};
|
|
27
|
+
type: 'function';
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Details of a Retrieval tool call the run step was involved in.
|
|
31
|
+
* Includes the tool call ID and the type of tool call.
|
|
32
|
+
*/
|
|
33
|
+
export type RetrievalToolCall = {
|
|
34
|
+
id: string;
|
|
35
|
+
retrieval: unknown;
|
|
36
|
+
type: 'retrieval';
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Details of a Retrieval tool call the run step was involved in.
|
|
40
|
+
* Includes the tool call ID and the type of tool call.
|
|
41
|
+
*/
|
|
42
|
+
export type FileSearchToolCall = {
|
|
43
|
+
id: string;
|
|
44
|
+
file_search: unknown;
|
|
45
|
+
type: 'file_search';
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Details of the tool calls involved in a run step.
|
|
49
|
+
* Can be associated with one of three types of tools: `code_interpreter`, `retrieval`, or `function`.
|
|
50
|
+
*/
|
|
51
|
+
export type ToolCallsStepDetails = {
|
|
52
|
+
tool_calls: Array<CodeToolCall | RetrievalToolCall | FileSearchToolCall | FunctionToolCall>;
|
|
53
|
+
type: 'tool_calls';
|
|
54
|
+
};
|
|
55
|
+
export type ImageFile = TFile & {
|
|
56
|
+
/**
|
|
57
|
+
* The [File](https://platform.openai.com/docs/api-reference/files) ID of the image
|
|
58
|
+
* in the message content.
|
|
59
|
+
*/
|
|
60
|
+
file_id: string;
|
|
61
|
+
filename: string;
|
|
62
|
+
filepath: string;
|
|
63
|
+
height: number;
|
|
64
|
+
width: number;
|
|
65
|
+
/**
|
|
66
|
+
* Prompt used to generate the image if applicable.
|
|
67
|
+
*/
|
|
68
|
+
prompt?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Additional metadata used to generate or about the image/tool_call.
|
|
71
|
+
*/
|
|
72
|
+
metadata?: Record<string, unknown>;
|
|
73
|
+
};
|
|
74
|
+
export type FileCitation = {
|
|
75
|
+
end_index: number;
|
|
76
|
+
file_citation: FileCitationDetails;
|
|
77
|
+
start_index: number;
|
|
78
|
+
text: string;
|
|
79
|
+
type: 'file_citation';
|
|
80
|
+
};
|
|
81
|
+
export type FileCitationDetails = {
|
|
82
|
+
file_id: string;
|
|
83
|
+
quote: string;
|
|
84
|
+
};
|
|
85
|
+
export type FilePath = {
|
|
86
|
+
end_index: number;
|
|
87
|
+
file_path: FilePathDetails;
|
|
88
|
+
start_index: number;
|
|
89
|
+
text: string;
|
|
90
|
+
type: 'file_path';
|
|
91
|
+
};
|
|
92
|
+
export type FilePathDetails = {
|
|
93
|
+
file_id: string;
|
|
94
|
+
};
|
|
95
|
+
export type Text = {
|
|
96
|
+
annotations?: Array<FileCitation | FilePath>;
|
|
97
|
+
value: string;
|
|
98
|
+
};
|
|
99
|
+
export declare enum AnnotationTypes {
|
|
100
|
+
FILE_CITATION = "file_citation",
|
|
101
|
+
FILE_PATH = "file_path"
|
|
102
|
+
}
|
|
103
|
+
export declare enum StepStatus {
|
|
104
|
+
IN_PROGRESS = "in_progress",
|
|
105
|
+
CANCELLED = "cancelled",
|
|
106
|
+
FAILED = "failed",
|
|
107
|
+
COMPLETED = "completed",
|
|
108
|
+
EXPIRED = "expired"
|
|
109
|
+
}
|
|
110
|
+
export declare enum MessageContentTypes {
|
|
111
|
+
TEXT = "text",
|
|
112
|
+
IMAGE_FILE = "image_file"
|
|
113
|
+
}
|
|
114
|
+
export type PartMetadata = {
|
|
115
|
+
/** Host-resolved execution identity for a saved subagent invocation. */
|
|
116
|
+
subagentIdentity?: SubagentIdentity;
|
|
117
|
+
progress?: number;
|
|
118
|
+
asset_pointer?: string;
|
|
119
|
+
status?: string;
|
|
120
|
+
action?: boolean;
|
|
121
|
+
auth?: string;
|
|
122
|
+
expires_at?: number;
|
|
123
|
+
/** Index indicating parallel sibling content (same stepIndex in multi-agent runs) */
|
|
124
|
+
siblingIndex?: number;
|
|
125
|
+
/** Agent ID for parallel agent rendering - identifies which agent produced this content */
|
|
126
|
+
agentId?: string;
|
|
127
|
+
/** Group ID for parallel content - parts with same groupId are displayed in columns */
|
|
128
|
+
groupId?: number;
|
|
129
|
+
/**
|
|
130
|
+
* Terminal lifecycle status of the run step that produced this part, from
|
|
131
|
+
* `on_run_step_closed`. Distinct from `status`, which is already claimed by
|
|
132
|
+
* activity-label and question-form parts. Absent on parts predating the
|
|
133
|
+
* event or from endpoints that do not emit it, in which case renderers fall
|
|
134
|
+
* back to inferring "stopped" from `progress` and `isSubmitting`.
|
|
135
|
+
*/
|
|
136
|
+
runStepStatus?: Agents.RunStepClosedStatus;
|
|
137
|
+
/**
|
|
138
|
+
* Wall-clock milliseconds the run step took, derived from the same
|
|
139
|
+
* `on_run_step_closed` event as {@link runStepStatus} via
|
|
140
|
+
* `getRunStepDurationMs`. Only written when the event carried both
|
|
141
|
+
* timestamps and they agree in order — so its absence means "not
|
|
142
|
+
* derivable", never "instant". The raw value is persisted unfiltered;
|
|
143
|
+
* whether it is worth showing (`isReportableRunStepDuration`) is decided
|
|
144
|
+
* at render time.
|
|
145
|
+
*/
|
|
146
|
+
runStepDurationMs?: number;
|
|
147
|
+
/**
|
|
148
|
+
* Stamped by the background harvester when a detached task's final output
|
|
149
|
+
* replaces the dispatch handle in `tool_call.output`. The handle JSON and
|
|
150
|
+
* the live status-marker attachment are both transient, so after the patch
|
|
151
|
+
* (or a reload) this is the only signal that the call ran in the
|
|
152
|
+
* background — renderers use it to keep treating {@link runStepDurationMs}
|
|
153
|
+
* as dispatch time rather than the task's runtime.
|
|
154
|
+
*/
|
|
155
|
+
backgrounded?: boolean;
|
|
156
|
+
/**
|
|
157
|
+
* Content index this part occupied while its run streamed. The aggregator
|
|
158
|
+
* writes parts at provider-source indexes, so the streamed array is sparse;
|
|
159
|
+
* persistence compacts it and every part after a hole shifts down. The
|
|
160
|
+
* client's final handler stamps the streamed position onto the compacted
|
|
161
|
+
* parts it adopts, so index-derived render identity survives the swap
|
|
162
|
+
* instead of remounting the settled message. Client-only and absent
|
|
163
|
+
* everywhere else — persisted content never carries it.
|
|
164
|
+
*/
|
|
165
|
+
streamedIndex?: number;
|
|
166
|
+
};
|
|
167
|
+
/** Metadata for parallel content rendering - subset of PartMetadata */
|
|
168
|
+
export type ContentMetadata = Pick<PartMetadata, 'agentId' | 'groupId' | 'streamedIndex'>;
|
|
169
|
+
export type ContentPart = (CodeToolCall | RetrievalToolCall | FileSearchToolCall | FunctionToolCall | Agents.AgentToolCall | ImageFile | Text) & PartMetadata;
|
|
170
|
+
export type TextData = (Text & PartMetadata) | undefined;
|
|
171
|
+
export type SummaryContentPart = {
|
|
172
|
+
type: ContentTypes.SUMMARY;
|
|
173
|
+
content?: Array<{
|
|
174
|
+
type: ContentTypes.TEXT;
|
|
175
|
+
text: string;
|
|
176
|
+
}>;
|
|
177
|
+
tokenCount?: number;
|
|
178
|
+
summarizing?: boolean;
|
|
179
|
+
/** A summarize round that ended in error. Partial deltas already streamed
|
|
180
|
+
* into this slot are kept, so the renderer needs this to avoid presenting
|
|
181
|
+
* truncated text under the "Conversation summarized" label. */
|
|
182
|
+
failed?: boolean;
|
|
183
|
+
/** Set when the user compacted the context manually rather than the
|
|
184
|
+
* automatic detour firing on context pressure. */
|
|
185
|
+
initiatedBy?: 'user';
|
|
186
|
+
summaryVersion?: number;
|
|
187
|
+
model?: string;
|
|
188
|
+
provider?: string;
|
|
189
|
+
createdAt?: string;
|
|
190
|
+
boundary?: {
|
|
191
|
+
messageId: string;
|
|
192
|
+
contentIndex: number;
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
/**
|
|
196
|
+
* A user steering message injected mid-run at a tool-batch boundary.
|
|
197
|
+
* Persisted inline in the response message's content array (keyed by the
|
|
198
|
+
* type name like `text`/`think` so token counting reads it for free);
|
|
199
|
+
* replayed as a user message on subsequent turns by `formatAgentMessages`.
|
|
200
|
+
*/
|
|
201
|
+
export type SteerContentPart = {
|
|
202
|
+
type: ContentTypes.STEER;
|
|
203
|
+
steer: string;
|
|
204
|
+
steerId?: string;
|
|
205
|
+
/** Stable optimistic-client id used to settle a POST whose response was lost. */
|
|
206
|
+
clientSteerId?: string;
|
|
207
|
+
createdAt?: number;
|
|
208
|
+
/** Attachments steered with the message; re-encoded per turn on replay
|
|
209
|
+
* like any other user-message media (refs only, never encoded data). */
|
|
210
|
+
files?: Partial<TFile>[];
|
|
211
|
+
/** Quoted excerpts steered with the message, persisted separately from the
|
|
212
|
+
* typed text (mirroring `TMessage.quotes`) so the UI renders them as
|
|
213
|
+
* reference blocks; merged into the model-bound user turn on every replay. */
|
|
214
|
+
quotes?: string[];
|
|
215
|
+
};
|
|
216
|
+
export type TMessageContentParts = ({
|
|
217
|
+
type: ContentTypes.ERROR;
|
|
218
|
+
text?: string | TextData;
|
|
219
|
+
error?: string;
|
|
220
|
+
/** Set when this failure is what a manual compaction produced instead of a
|
|
221
|
+
* summary. The turn has no other record of having been one, so the rerun
|
|
222
|
+
* controls read it the same way they read a summary's marker. */
|
|
223
|
+
initiatedBy?: 'user';
|
|
224
|
+
} & ContentMetadata) | ({
|
|
225
|
+
type: ContentTypes.THINK;
|
|
226
|
+
think?: string | TextData;
|
|
227
|
+
/** Generated orientation for this user-visible reasoning step. */
|
|
228
|
+
reasoning_label?: string;
|
|
229
|
+
/** Stable SDK run-step identity used to correlate live revisions. */
|
|
230
|
+
reasoning_label_step_id?: string;
|
|
231
|
+
/** Durable provider-call count used to enforce the per-run cost cap across resumes. */
|
|
232
|
+
reasoning_label_attempts?: number;
|
|
233
|
+
/** Visible reasoning length included in this step's latest provider call. */
|
|
234
|
+
reasoning_label_submitted_chars?: number;
|
|
235
|
+
/** Monotonic provider-call revision; gaps are allowed after unsuccessful attempts. */
|
|
236
|
+
reasoning_label_revision?: number;
|
|
237
|
+
/** Whether the reasoning step can still produce a newer label. */
|
|
238
|
+
reasoning_label_status?: 'streaming' | 'complete';
|
|
239
|
+
/** The reasoning happened but its text is not available to this view
|
|
240
|
+
* (e.g. detached subagent projections retain only a marker). */
|
|
241
|
+
reasoning_unavailable?: boolean;
|
|
242
|
+
} & ContentMetadata) | (SteerContentPart & ContentMetadata) | ({
|
|
243
|
+
type: ContentTypes.TEXT;
|
|
244
|
+
text?: string | TextData;
|
|
245
|
+
tool_call_ids?: string[];
|
|
246
|
+
/** Open Responses semantic channel for assistant text. */
|
|
247
|
+
phase?: 'commentary' | 'final_answer';
|
|
248
|
+
} & ContentMetadata) | ({
|
|
249
|
+
type: ContentTypes.TOOL_CALL;
|
|
250
|
+
tool_call: (CodeToolCall | RetrievalToolCall | FileSearchToolCall | FunctionToolCall | Agents.AgentToolCall) & PartMetadata;
|
|
251
|
+
} & ContentMetadata) | ({
|
|
252
|
+
type: ContentTypes.IMAGE_FILE;
|
|
253
|
+
image_file: ImageFile & PartMetadata;
|
|
254
|
+
} & ContentMetadata) | (SummaryContentPart & ContentMetadata) | ({
|
|
255
|
+
/** One-line LLM-generated note describing a completed tool batch. UI-only:
|
|
256
|
+
* never sent to the model (stripped before payload formatting). */
|
|
257
|
+
type: ContentTypes.ACTIVITY_LABEL;
|
|
258
|
+
activity_label?: string;
|
|
259
|
+
/** Missing means the legacy/per-batch activity label. */
|
|
260
|
+
activity_label_type?: 'phase';
|
|
261
|
+
tool_call_ids?: string[];
|
|
262
|
+
/** Parent phase bounds and telemetry. */
|
|
263
|
+
activity_start_index?: number;
|
|
264
|
+
/** Exclusive end of the grouped content; may precede the marker itself. */
|
|
265
|
+
activity_end_index?: number;
|
|
266
|
+
activity_count?: number;
|
|
267
|
+
agent_ids?: string[];
|
|
268
|
+
/** ok = all tools succeeded, failed = all failed, partial = mixed. */
|
|
269
|
+
status?: 'ok' | 'partial' | 'failed';
|
|
270
|
+
pending?: boolean;
|
|
271
|
+
} & ContentMetadata) | (Agents.AgentUpdate & ContentMetadata) | (Agents.MessageContentImageUrl & ContentMetadata) | (Agents.MessageContentVideoUrl & ContentMetadata) | (Agents.MessageContentInputAudio & ContentMetadata);
|
|
272
|
+
export type StreamContentData = TMessageContentParts & {
|
|
273
|
+
/** The index of the current content part */
|
|
274
|
+
index: number;
|
|
275
|
+
/** The current text content was already served but edited to replace elements therein */
|
|
276
|
+
edited?: boolean;
|
|
277
|
+
};
|
|
278
|
+
export type TContentData = StreamContentData & {
|
|
279
|
+
messageId: string;
|
|
280
|
+
conversationId: string;
|
|
281
|
+
userMessageId: string;
|
|
282
|
+
thread_id: string;
|
|
283
|
+
stream?: boolean;
|
|
284
|
+
};
|
|
285
|
+
export declare const hostImageIdSuffix = "_host_copy";
|
|
286
|
+
export declare const hostImageNamePrefix = "host_copy_";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TDefaultLLMDeliveryPathConfig } from '../file-config';
|
|
2
2
|
import type { CodeEnvRef, CodeEnvRefMap } from '../codeEnvRef';
|
|
3
|
-
import { EToolResources } from './
|
|
3
|
+
import { EToolResources } from './tools';
|
|
4
4
|
export declare enum FileSources {
|
|
5
5
|
local = "local",
|
|
6
6
|
firebase = "firebase",
|
|
@@ -48,12 +48,17 @@ export type EndpointFileConfig = {
|
|
|
48
48
|
supportedMimeTypes?: RegexLike[];
|
|
49
49
|
defaultLLMDeliveryPath?: TDefaultLLMDeliveryPathConfig;
|
|
50
50
|
legacyFileUploadUX?: boolean;
|
|
51
|
+
/** Delivers the text extracted at upload for a file routed to tools (`none`) on a turn that
|
|
52
|
+
* runs no tool able to read it. Off by default, which leaves such a file out of the prompt. */
|
|
53
|
+
textFallbackWithoutTools?: boolean;
|
|
51
54
|
};
|
|
52
55
|
export type FileConfig = {
|
|
53
56
|
endpoints: {
|
|
54
57
|
[key: string]: EndpointFileConfig;
|
|
55
58
|
};
|
|
56
59
|
skills?: {
|
|
60
|
+
/** Maximum concurrent blob deletions during failed archive import cleanup. */
|
|
61
|
+
importCleanupConcurrency?: number;
|
|
57
62
|
fileSizeLimit?: number;
|
|
58
63
|
};
|
|
59
64
|
fileTokenLimit?: number;
|
|
@@ -83,12 +88,17 @@ export type FileConfig = {
|
|
|
83
88
|
checkType?: (fileType: string, supportedTypes: RegexLike[]) => boolean;
|
|
84
89
|
defaultLLMDeliveryPath?: TDefaultLLMDeliveryPathConfig;
|
|
85
90
|
legacyFileUploadUX?: boolean;
|
|
91
|
+
/** Delivers the text extracted at upload for a file routed to tools (`none`) on a turn that
|
|
92
|
+
* runs no tool able to read it. Off by default, which leaves such a file out of the prompt. */
|
|
93
|
+
textFallbackWithoutTools?: boolean;
|
|
86
94
|
};
|
|
87
95
|
export type FileConfigInput = {
|
|
88
96
|
endpoints?: {
|
|
89
97
|
[key: string]: EndpointFileConfig;
|
|
90
98
|
};
|
|
91
99
|
skills?: {
|
|
100
|
+
/** Maximum concurrent blob deletions during failed archive import cleanup. */
|
|
101
|
+
importCleanupConcurrency?: number;
|
|
92
102
|
fileSizeLimit?: number;
|
|
93
103
|
};
|
|
94
104
|
serverFileSizeLimit?: number;
|
|
@@ -113,6 +123,9 @@ export type FileConfigInput = {
|
|
|
113
123
|
checkType?: (fileType: string, supportedTypes: RegexLike[]) => boolean;
|
|
114
124
|
defaultLLMDeliveryPath?: TDefaultLLMDeliveryPathConfig;
|
|
115
125
|
legacyFileUploadUX?: boolean;
|
|
126
|
+
/** Delivers the text extracted at upload for a file routed to tools (`none`) on a turn that
|
|
127
|
+
* runs no tool able to read it. Off by default, which leaves such a file out of the prompt. */
|
|
128
|
+
textFallbackWithoutTools?: boolean;
|
|
116
129
|
};
|
|
117
130
|
/** The immutable origin of a file explicitly published from an agent execution. */
|
|
118
131
|
export type RunFileProvenance = {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { InfiniteData, QueryKey } from '@tanstack/react-query';
|
|
2
2
|
import type { TSkill, TSkillFile, TCreateSkill, TUpdateSkillVariables, TUpdateSkillResponse, TDeleteSkillResponse, TUploadSkillFileVariables, TDeleteSkillFileVariables, TDeleteSkillFileResponse, TSkillListResponse } from './skills';
|
|
3
|
-
import {
|
|
4
|
-
import { Action, ActionMetadata } from './agents';
|
|
3
|
+
import { Assistant, AssistantCreateParams, AssistantUpdateParams, AssistantDocument } from './assistants';
|
|
4
|
+
import { Action, ActionMetadata, Agent, AgentCreateParams, AgentUpdateParams } from './agents';
|
|
5
|
+
import { Tools, FunctionTool } from './tools';
|
|
5
6
|
import * as p from '../permissions';
|
|
6
7
|
import * as types from '../types';
|
|
7
8
|
import * as r from '../roles';
|