librechat-data-provider 0.8.503 → 0.8.505
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-CG5e1FOi.js +8593 -0
- package/dist/data-service-CG5e1FOi.js.map +1 -0
- package/dist/data-service-CwM4Cew0.mjs +6582 -0
- package/dist/data-service-CwM4Cew0.mjs.map +1 -0
- package/dist/index.js +6601 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6167 -0
- package/dist/index.mjs.map +1 -0
- package/dist/react-query/index.js +365 -0
- package/dist/react-query/index.js.map +1 -0
- package/dist/react-query/index.mjs +330 -0
- package/dist/react-query/index.mjs.map +1 -0
- package/dist/types/accessPermissions.d.ts +13 -10
- package/dist/types/actions.d.ts +2 -2
- package/dist/types/api-endpoints.d.ts +18 -9
- package/dist/types/bedrock.d.ts +252 -212
- package/dist/types/config.d.ts +4732 -2632
- package/dist/types/data-service.d.ts +24 -6
- package/dist/types/file-config.d.ts +12 -12
- package/dist/types/generate.d.ts +64 -53
- package/dist/types/keys.d.ts +8 -0
- package/dist/types/limits.d.ts +2 -0
- package/dist/types/mcp.d.ts +489 -210
- package/dist/types/models.d.ts +335 -206
- package/dist/types/parsers.d.ts +8 -8
- package/dist/types/permissions.d.ts +65 -9
- package/dist/types/react-query/react-query-service.d.ts +3 -33
- package/dist/types/request.d.ts +1 -1
- package/dist/types/roles.d.ts +52 -0
- package/dist/types/schemas.d.ts +400 -161
- package/dist/types/types/agents.d.ts +20 -1
- package/dist/types/types/files.d.ts +1 -1
- package/dist/types/types/queries.d.ts +16 -3
- package/dist/types/types/runs.d.ts +81 -0
- package/dist/types/types/skills.d.ts +72 -9
- package/dist/types/types.d.ts +50 -3
- package/package.json +11 -13
- package/dist/index.es.js +0 -2
- package/dist/index.es.js.map +0 -1
- package/dist/react-query/index.es.js +0 -2
- package/dist/react-query/index.es.js.map +0 -1
- package/dist/types/balance.spec.d.ts +0 -1
- package/dist/types/cloudfront-config.spec.d.ts +0 -1
- package/dist/types/codeEnvRef.spec.d.ts +0 -1
- package/dist/types/config.spec.d.ts +0 -1
- package/dist/types/file-config.spec.d.ts +0 -1
- package/dist/types/parameterSettings.spec.d.ts +0 -1
- package/dist/types/roles.spec.d.ts +0 -1
- package/dist/types/schemas.spec.d.ts +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { StepTypes, ContentTypes, ToolCallTypes } from './runs';
|
|
2
1
|
import type { FunctionToolCall, SummaryContentPart } from './assistants';
|
|
2
|
+
import type { TTokenUsageEvent, TContextUsageEvent } from './runs';
|
|
3
3
|
import type { TAttachment, TPlugin } from 'src/schemas';
|
|
4
|
+
import { StepTypes, ContentTypes, ToolCallTypes } from './runs';
|
|
4
5
|
export declare namespace Agents {
|
|
5
6
|
type MessageType = 'human' | 'ai' | 'generic' | 'system' | 'function' | 'tool' | 'remove';
|
|
6
7
|
type ImageDetail = 'auto' | 'low' | 'high';
|
|
@@ -188,6 +189,24 @@ export declare namespace Agents {
|
|
|
188
189
|
responseMessageId?: string;
|
|
189
190
|
conversationId?: string;
|
|
190
191
|
sender?: string;
|
|
192
|
+
iconURL?: string;
|
|
193
|
+
model?: string;
|
|
194
|
+
titleEvent?: {
|
|
195
|
+
event: 'title';
|
|
196
|
+
data?: {
|
|
197
|
+
conversationId?: string;
|
|
198
|
+
title?: string;
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
replayEvents?: Array<{
|
|
202
|
+
event: string;
|
|
203
|
+
data?: unknown;
|
|
204
|
+
[key: string]: unknown;
|
|
205
|
+
}>;
|
|
206
|
+
/** Cumulative provider-reported usage for the run; backfills usage totals on resume */
|
|
207
|
+
collectedUsage?: TTokenUsageEvent[];
|
|
208
|
+
/** Latest context window snapshot; restores the usage gauge on resume */
|
|
209
|
+
contextUsage?: TContextUsageEvent;
|
|
191
210
|
}
|
|
192
211
|
/**
|
|
193
212
|
* Represents a run step delta i.e. any changed fields on a run step during
|
|
@@ -16,7 +16,7 @@ export declare enum FileSources {
|
|
|
16
16
|
text = "text",
|
|
17
17
|
document_parser = "document_parser"
|
|
18
18
|
}
|
|
19
|
-
export declare const checkOpenAIStorage: (source: string) =>
|
|
19
|
+
export declare const checkOpenAIStorage: (source: string) => source is FileSources.azure | FileSources.openai;
|
|
20
20
|
export declare enum FileContext {
|
|
21
21
|
avatar = "avatar",
|
|
22
22
|
unknown = "unknown",
|
|
@@ -17,14 +17,27 @@ export type ConversationListParams = {
|
|
|
17
17
|
sortDirection?: 'asc' | 'desc';
|
|
18
18
|
tags?: string[];
|
|
19
19
|
search?: string;
|
|
20
|
+
projectId?: string;
|
|
20
21
|
};
|
|
21
|
-
export type MinimalConversation = Pick<s.TConversation, 'conversationId' | 'endpoint' | 'title' | 'createdAt' | 'updatedAt' | 'user'>;
|
|
22
|
+
export type MinimalConversation = Pick<s.TConversation, 'conversationId' | 'endpoint' | 'title' | 'createdAt' | 'updatedAt' | 'user' | 'chatProjectId'>;
|
|
22
23
|
export type ConversationListResponse = {
|
|
23
24
|
conversations: MinimalConversation[];
|
|
24
25
|
nextCursor: string | null;
|
|
25
26
|
};
|
|
26
27
|
export type ConversationData = InfiniteData<ConversationListResponse>;
|
|
27
28
|
export type ConversationUpdater = (data: ConversationData, conversation: s.TConversation) => ConversationData;
|
|
29
|
+
export type ProjectListParams = {
|
|
30
|
+
cursor?: string;
|
|
31
|
+
limit?: number;
|
|
32
|
+
sortBy?: 'name' | 'createdAt' | 'lastConversationAt';
|
|
33
|
+
sortDirection?: 'asc' | 'desc';
|
|
34
|
+
search?: string;
|
|
35
|
+
};
|
|
36
|
+
export type ProjectListResponse = {
|
|
37
|
+
projects: t.TChatProject[];
|
|
38
|
+
nextCursor: string | null;
|
|
39
|
+
};
|
|
40
|
+
export type ProjectData = InfiniteData<ProjectListResponse>;
|
|
28
41
|
export type MessagesListParams = {
|
|
29
42
|
cursor?: string | null;
|
|
30
43
|
sortBy?: 'endpoint' | 'createdAt' | 'updatedAt';
|
|
@@ -43,7 +56,6 @@ export type SharedMessagesResponse = Omit<s.TSharedLink, 'messages'> & {
|
|
|
43
56
|
};
|
|
44
57
|
export interface SharedLinksListParams {
|
|
45
58
|
pageSize: number;
|
|
46
|
-
isPublic: boolean;
|
|
47
59
|
sortBy: 'title' | 'createdAt';
|
|
48
60
|
sortDirection: 'asc' | 'desc';
|
|
49
61
|
search?: string;
|
|
@@ -52,7 +64,6 @@ export interface SharedLinksListParams {
|
|
|
52
64
|
export type SharedLinkItem = {
|
|
53
65
|
shareId: string;
|
|
54
66
|
title: string;
|
|
55
|
-
isPublic: boolean;
|
|
56
67
|
createdAt: Date;
|
|
57
68
|
conversationId: string;
|
|
58
69
|
};
|
|
@@ -156,6 +167,8 @@ export interface MCPServerStatus {
|
|
|
156
167
|
export interface MCPConnectionStatusResponse {
|
|
157
168
|
success: boolean;
|
|
158
169
|
connectionStatus: Record<string, MCPServerStatus>;
|
|
170
|
+
/** Server-configured OAuth completion window in ms (`MCP_OAUTH_HANDLING_TIMEOUT`) */
|
|
171
|
+
oauthTimeout?: number;
|
|
159
172
|
}
|
|
160
173
|
export interface MCPServerConnectionStatusResponse {
|
|
161
174
|
success: boolean;
|
|
@@ -35,6 +35,87 @@ export declare enum StepEvents {
|
|
|
35
35
|
ON_SUMMARIZE_COMPLETE = "on_summarize_complete",
|
|
36
36
|
ON_SUBAGENT_UPDATE = "on_subagent_update"
|
|
37
37
|
}
|
|
38
|
+
/** Token-tracking event names streamed to the client (separate from StepEvents dispatch). */
|
|
39
|
+
export declare enum UsageEvents {
|
|
40
|
+
ON_CONTEXT_USAGE = "on_context_usage",
|
|
41
|
+
ON_TOKEN_USAGE = "on_token_usage"
|
|
42
|
+
}
|
|
43
|
+
/** Mirrors TokenBudgetBreakdown from @librechat/agents (data-provider cannot import it). */
|
|
44
|
+
export type TTokenBudgetBreakdown = {
|
|
45
|
+
maxContextTokens: number;
|
|
46
|
+
instructionTokens: number;
|
|
47
|
+
systemMessageTokens: number;
|
|
48
|
+
dynamicInstructionTokens: number;
|
|
49
|
+
toolSchemaTokens: number;
|
|
50
|
+
summaryTokens: number;
|
|
51
|
+
toolCount: number;
|
|
52
|
+
messageCount: number;
|
|
53
|
+
messageTokens: number;
|
|
54
|
+
availableForMessages: number;
|
|
55
|
+
/** Per-tool schema token counts (post-multiplier), keyed by tool name */
|
|
56
|
+
toolTokenCounts?: Record<string, number>;
|
|
57
|
+
/** Names of counted tools that are deferred (`defer_loading`) and discovered */
|
|
58
|
+
deferredToolNames?: string[];
|
|
59
|
+
};
|
|
60
|
+
/** Per-model-call context snapshot, dispatched after pruning and before the LLM call. */
|
|
61
|
+
export type TContextUsageEvent = {
|
|
62
|
+
runId?: string;
|
|
63
|
+
agentId?: string;
|
|
64
|
+
breakdown: TTokenBudgetBreakdown;
|
|
65
|
+
/** Usable budget this call: maxContextTokens minus output reserve */
|
|
66
|
+
contextBudget?: number;
|
|
67
|
+
/** Calibrated instruction overhead actually applied this call */
|
|
68
|
+
effectiveInstructionTokens?: number;
|
|
69
|
+
/** Calibrated message tokens before pruning (excluding instructions) */
|
|
70
|
+
prePruneContextTokens?: number;
|
|
71
|
+
/** Tokens still free after instructions + pruned messages */
|
|
72
|
+
remainingContextTokens?: number;
|
|
73
|
+
calibrationRatio?: number;
|
|
74
|
+
/** Output tokens of the response's final model call (the call this pre-invoke
|
|
75
|
+
* snapshot precedes). Populated only on the persisted `metadata.contextUsage`
|
|
76
|
+
* blob so a reloaded multi-call turn adds the same post-snapshot delta the
|
|
77
|
+
* live finalizer did — not the full response `tokenCount`, which the snapshot
|
|
78
|
+
* already includes for earlier steps. */
|
|
79
|
+
completedOutputTokens?: number;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Per-response usage rollup persisted on `responseMessage.metadata.usage`, in
|
|
83
|
+
* display units (input excludes cache; output includes repaired completion).
|
|
84
|
+
* Normalized per-event on the backend before summing so a reloaded conversation
|
|
85
|
+
* reproduces the live branch/total usage exactly, even for mixed-provider turns
|
|
86
|
+
* (summarization/subagent calls on a different provider than the primary).
|
|
87
|
+
*/
|
|
88
|
+
export type TResponseUsage = {
|
|
89
|
+
input: number;
|
|
90
|
+
output: number;
|
|
91
|
+
cacheWrite: number;
|
|
92
|
+
cacheRead: number;
|
|
93
|
+
/** Authoritative USD cost; present only when `interface.contextCost` was on at save */
|
|
94
|
+
cost?: number;
|
|
95
|
+
};
|
|
96
|
+
/** Provider-reported usage for a single completed model call. */
|
|
97
|
+
export type TTokenUsageEvent = {
|
|
98
|
+
input_tokens?: number;
|
|
99
|
+
output_tokens?: number;
|
|
100
|
+
total_tokens?: number;
|
|
101
|
+
input_token_details?: {
|
|
102
|
+
cache_creation?: number;
|
|
103
|
+
cache_read?: number;
|
|
104
|
+
};
|
|
105
|
+
model?: string;
|
|
106
|
+
provider?: string;
|
|
107
|
+
/** Non-primary buckets fold into session cost/totals but not the live
|
|
108
|
+
* context gauge: hidden sequential-agent calls (`sequential`), summary
|
|
109
|
+
* passes (`summarization`), and isolated subagent runs (`subagent`) */
|
|
110
|
+
usage_type?: 'summarization' | 'subagent' | 'sequential';
|
|
111
|
+
runId?: string;
|
|
112
|
+
/** Per-run emission sequence; keeps identical payloads from distinct model calls unique */
|
|
113
|
+
seq?: number;
|
|
114
|
+
/** Authoritative USD cost of this call from the backend (premium tiers, cache
|
|
115
|
+
* rates); present only when `interface.contextCost` is enabled. Clients sum
|
|
116
|
+
* this rather than re-deriving cost from base rates. */
|
|
117
|
+
cost?: number;
|
|
118
|
+
};
|
|
38
119
|
/** Lifecycle phase carried on subagent-progress envelopes (mirrors SDK SubagentUpdatePhase). */
|
|
39
120
|
export type SubagentUpdatePhase = 'start' | 'run_step' | 'run_step_delta' | 'run_step_completed' | 'message_delta' | 'reasoning_delta' | 'stop' | 'error';
|
|
40
121
|
/** Single streamed subagent update forwarded by the SDK's SubagentExecutor. */
|
|
@@ -22,9 +22,11 @@ export declare const SKILL_NAME_PATTERN: RegExp;
|
|
|
22
22
|
/**
|
|
23
23
|
* Source of a skill — where its canonical definition came from.
|
|
24
24
|
* `inline` means the skill was authored directly in LibreChat.
|
|
25
|
-
* `
|
|
25
|
+
* `deployment` means the skill was loaded from the server's configured
|
|
26
|
+
* deployment skill directory and is not persisted as a Skill document.
|
|
27
|
+
* `github` is populated by admin-configured GitHub skill sync; `notion` is reserved.
|
|
26
28
|
*/
|
|
27
|
-
export type SkillSource = 'inline' | 'github' | 'notion';
|
|
29
|
+
export type SkillSource = 'inline' | 'deployment' | 'github' | 'notion';
|
|
28
30
|
/**
|
|
29
31
|
* Category inferred from a skill file's top-level directory prefix.
|
|
30
32
|
* `script` for `scripts/...`, `reference` for `references/...`, `asset` for `assets/...`,
|
|
@@ -51,11 +53,23 @@ export type SkillFrontmatter = {
|
|
|
51
53
|
* Provenance metadata for skills that originated from an external source
|
|
52
54
|
* (e.g. a GitHub commit SHA or a Notion page id).
|
|
53
55
|
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
* without a schema migration.
|
|
56
|
+
* Populated by external sync workers with upstream identifiers such as source
|
|
57
|
+
* ids, paths, and commit/blob SHAs.
|
|
57
58
|
*/
|
|
58
|
-
export type SkillSourceMetadata = Record<string, string | number | boolean
|
|
59
|
+
export type SkillSourceMetadata = Record<string, string | number | boolean> | {
|
|
60
|
+
provider: 'github';
|
|
61
|
+
sourceId: string;
|
|
62
|
+
upstreamId: string;
|
|
63
|
+
owner: string;
|
|
64
|
+
repo: string;
|
|
65
|
+
ref: string;
|
|
66
|
+
skillPath: string;
|
|
67
|
+
commitSha?: string;
|
|
68
|
+
skillBlobSha?: string;
|
|
69
|
+
syncedAt?: string;
|
|
70
|
+
syncStatus?: 'synced' | 'failed';
|
|
71
|
+
error?: string;
|
|
72
|
+
};
|
|
59
73
|
/**
|
|
60
74
|
* A non-blocking coaching hint surfaced alongside a successful create/update
|
|
61
75
|
* response. Unlike validation errors (which return 400 and block the write),
|
|
@@ -83,8 +97,8 @@ export type TSkillWarning = {
|
|
|
83
97
|
* - `frontmatter` is the structured YAML bag minus `name`/`description`
|
|
84
98
|
* (those live as top-level columns). Validated strictly against a known
|
|
85
99
|
* key set server-side.
|
|
86
|
-
* - `source`/`sourceMetadata`
|
|
87
|
-
*
|
|
100
|
+
* - `source`/`sourceMetadata` identify whether the row is user-authored,
|
|
101
|
+
* deployment-provided, or mirrored from an external source such as GitHub.
|
|
88
102
|
*/
|
|
89
103
|
export type TSkill = {
|
|
90
104
|
_id: string;
|
|
@@ -170,6 +184,7 @@ export type TSkillFile = {
|
|
|
170
184
|
isExecutable: boolean;
|
|
171
185
|
author: string;
|
|
172
186
|
tenantId?: string;
|
|
187
|
+
sourceMetadata?: Record<string, string | number | boolean>;
|
|
173
188
|
/** Lazily cached text content (≤ 512 KB). Excluded from list responses. */
|
|
174
189
|
content?: string;
|
|
175
190
|
/** Set on first read. `true` prevents repeated storage reads for non-text files. */
|
|
@@ -177,6 +192,54 @@ export type TSkillFile = {
|
|
|
177
192
|
createdAt: string;
|
|
178
193
|
updatedAt: string;
|
|
179
194
|
};
|
|
195
|
+
export type TGitHubSkillSyncCredentialSummary = {
|
|
196
|
+
provider: 'github';
|
|
197
|
+
credentialKey: string;
|
|
198
|
+
credentialPresent: boolean;
|
|
199
|
+
tokenFingerprint?: string;
|
|
200
|
+
updatedAt?: string;
|
|
201
|
+
createdAt?: string;
|
|
202
|
+
};
|
|
203
|
+
export type TGitHubSkillSyncSourceStatus = {
|
|
204
|
+
provider: 'github';
|
|
205
|
+
sourceId: string;
|
|
206
|
+
tenantId?: string;
|
|
207
|
+
status: 'idle' | 'running' | 'succeeded' | 'failed' | 'skipped';
|
|
208
|
+
credentialKey?: string;
|
|
209
|
+
credentialPresent: boolean;
|
|
210
|
+
owner?: string;
|
|
211
|
+
repo?: string;
|
|
212
|
+
ref?: string;
|
|
213
|
+
paths?: string[];
|
|
214
|
+
startedAt?: string;
|
|
215
|
+
finishedAt?: string;
|
|
216
|
+
lastSuccessAt?: string;
|
|
217
|
+
lastFailureAt?: string;
|
|
218
|
+
errorCode?: string;
|
|
219
|
+
errorMessage?: string;
|
|
220
|
+
syncedSkillCount: number;
|
|
221
|
+
syncedFileCount: number;
|
|
222
|
+
deletedSkillCount: number;
|
|
223
|
+
deletedFileCount: number;
|
|
224
|
+
updatedAt?: string;
|
|
225
|
+
createdAt?: string;
|
|
226
|
+
};
|
|
227
|
+
export type TGitHubSkillSyncStatusResponse = {
|
|
228
|
+
enabled: boolean;
|
|
229
|
+
intervalMinutes: number;
|
|
230
|
+
runOnStartup: boolean;
|
|
231
|
+
sources: TGitHubSkillSyncSourceStatus[];
|
|
232
|
+
credentials: TGitHubSkillSyncCredentialSummary[];
|
|
233
|
+
fineGrainedTokenRecommendation: string;
|
|
234
|
+
};
|
|
235
|
+
export type TGitHubSkillSyncCredentialUpdateRequest = {
|
|
236
|
+
token: string;
|
|
237
|
+
};
|
|
238
|
+
export type TGitHubSkillSyncManualRunResponse = {
|
|
239
|
+
status: 'started' | 'skipped' | 'completed' | 'failed';
|
|
240
|
+
message?: string;
|
|
241
|
+
sources?: TGitHubSkillSyncSourceStatus[];
|
|
242
|
+
};
|
|
180
243
|
/** Request body for POST `/api/skills`. */
|
|
181
244
|
export type TCreateSkill = {
|
|
182
245
|
name: string;
|
|
@@ -185,7 +248,7 @@ export type TCreateSkill = {
|
|
|
185
248
|
body: string;
|
|
186
249
|
frontmatter?: Partial<SkillFrontmatter>;
|
|
187
250
|
category?: string;
|
|
188
|
-
/** When `true`, the skill auto-primes into every turn (mirrors
|
|
251
|
+
/** When `true`, the skill auto-primes into every turn (mirrors always-apply frontmatter). */
|
|
189
252
|
alwaysApply?: boolean;
|
|
190
253
|
};
|
|
191
254
|
/** Partial payload for PATCH `/api/skills/:id` — all fields optional. */
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { InfiniteData } from '@tanstack/react-query';
|
|
2
|
-
import type { TConversationTag, EModelEndpoint, TConversation, TSharedLink, TAttachment, TMessage, TBanner } from './schemas';
|
|
2
|
+
import type { TConversationTag, EModelEndpoint, TConversation, TSharedLink, TAttachment, TMessage, TBanner, ReasoningResponseKey, ReasoningParameterFormat } from './schemas';
|
|
3
3
|
import type { RefillIntervalUnit } from './balance';
|
|
4
4
|
import type { SettingDefinition } from './generate';
|
|
5
5
|
import type { TMinimalFeedback } from './feedback';
|
|
@@ -7,7 +7,7 @@ import type { ContentTypes } from './types/runs';
|
|
|
7
7
|
import type { Agent } from './types/assistants';
|
|
8
8
|
export * from './schemas';
|
|
9
9
|
export type TMessages = TMessage[];
|
|
10
|
-
export type TEndpointOption = Pick<TConversation, 'endpoint' | 'endpointType' | 'model' | 'modelLabel' | 'chatGptLabel' | 'promptPrefix' | 'temperature' | 'topP' | 'topK' | 'top_p' | 'frequency_penalty' | 'presence_penalty' | 'maxOutputTokens' | 'maxContextTokens' | 'max_tokens' | 'maxTokens' | 'resendFiles' | 'imageDetail' | 'reasoning_effort' | 'verbosity' | 'instructions' | 'additional_instructions' | 'append_current_datetime' | 'tools' | 'stop' | 'region' | 'additionalModelRequestFields' | 'promptCache' | 'thinking' | 'thinkingBudget' | 'thinkingLevel' | 'effort' | 'thinkingDisplay' | 'assistant_id' | 'agent_id' | 'iconURL' | 'greeting' | 'spec' | 'artifacts' | 'file_ids' | 'system' | 'examples' | 'context'> & {
|
|
10
|
+
export type TEndpointOption = Pick<TConversation, 'endpoint' | 'endpointType' | 'model' | 'modelLabel' | 'chatGptLabel' | 'promptPrefix' | 'temperature' | 'topP' | 'topK' | 'top_p' | 'frequency_penalty' | 'presence_penalty' | 'maxOutputTokens' | 'maxContextTokens' | 'max_tokens' | 'maxTokens' | 'resendFiles' | 'imageDetail' | 'reasoning_effort' | 'verbosity' | 'instructions' | 'additional_instructions' | 'append_current_datetime' | 'tools' | 'stop' | 'region' | 'additionalModelRequestFields' | 'promptCache' | 'thinking' | 'thinkingBudget' | 'thinkingLevel' | 'effort' | 'thinkingDisplay' | 'assistant_id' | 'agent_id' | 'iconURL' | 'greeting' | 'spec' | 'artifacts' | 'file_ids' | 'system' | 'chatProjectId' | 'examples' | 'context'> & {
|
|
11
11
|
modelDisplayLabel?: string;
|
|
12
12
|
key?: string | null;
|
|
13
13
|
/** @deprecated Assistants API */
|
|
@@ -63,6 +63,8 @@ export type TSubmission = {
|
|
|
63
63
|
isContinued?: boolean;
|
|
64
64
|
isTemporary: boolean;
|
|
65
65
|
messages: TMessage[];
|
|
66
|
+
/** Client-only full message context used to restore branch siblings after scoped regenerate. */
|
|
67
|
+
regenerateMessages?: TMessage[];
|
|
66
68
|
isRegenerate?: boolean;
|
|
67
69
|
initialResponse?: TMessage;
|
|
68
70
|
conversation: Partial<TConversation>;
|
|
@@ -185,6 +187,37 @@ export type TUpdateConversationRequest = {
|
|
|
185
187
|
title: string;
|
|
186
188
|
};
|
|
187
189
|
export type TUpdateConversationResponse = TConversation;
|
|
190
|
+
export type TChatProject = {
|
|
191
|
+
_id: string;
|
|
192
|
+
name: string;
|
|
193
|
+
description?: string;
|
|
194
|
+
user?: string;
|
|
195
|
+
conversationCount: number;
|
|
196
|
+
lastConversationAt?: string | null;
|
|
197
|
+
lastConversationId?: string | null;
|
|
198
|
+
createdAt: string;
|
|
199
|
+
updatedAt: string;
|
|
200
|
+
};
|
|
201
|
+
export type TCreateChatProjectRequest = {
|
|
202
|
+
name: string;
|
|
203
|
+
description?: string;
|
|
204
|
+
};
|
|
205
|
+
export type TUpdateChatProjectRequest = Partial<TCreateChatProjectRequest> & {
|
|
206
|
+
projectId: string;
|
|
207
|
+
};
|
|
208
|
+
export type TDeleteChatProjectResponse = {
|
|
209
|
+
deletedCount: number;
|
|
210
|
+
modifiedCount: number;
|
|
211
|
+
};
|
|
212
|
+
export type TAssignConversationToProjectRequest = {
|
|
213
|
+
conversationId: string;
|
|
214
|
+
projectId: string | null;
|
|
215
|
+
};
|
|
216
|
+
export type TAssignConversationToProjectResponse = {
|
|
217
|
+
conversation: TConversation;
|
|
218
|
+
previousProjectId: string | null;
|
|
219
|
+
projectId: string | null;
|
|
220
|
+
};
|
|
188
221
|
export type TDeleteConversationRequest = {
|
|
189
222
|
conversationId?: string;
|
|
190
223
|
thread_id?: string;
|
|
@@ -209,7 +242,9 @@ export type TSharedMessagesResponse = Omit<TSharedLink, 'messages'> & {
|
|
|
209
242
|
};
|
|
210
243
|
export type TCreateShareLinkRequest = Pick<TConversation, 'conversationId'>;
|
|
211
244
|
export type TUpdateShareLinkRequest = Pick<TSharedLink, 'shareId' | 'targetMessageId'>;
|
|
212
|
-
export type TSharedLinkResponse = Pick<TSharedLink, 'shareId'> & Pick<TSharedLink, 'targetMessageId'> & Pick<TConversation, 'conversationId'
|
|
245
|
+
export type TSharedLinkResponse = Pick<TSharedLink, 'shareId'> & Pick<TSharedLink, 'targetMessageId'> & Pick<TConversation, 'conversationId'> & {
|
|
246
|
+
_id?: string;
|
|
247
|
+
};
|
|
213
248
|
export type TSharedLinkGetResponse = Omit<TSharedLinkResponse, 'shareId'> & {
|
|
214
249
|
shareId: string | null;
|
|
215
250
|
success: boolean;
|
|
@@ -274,11 +309,23 @@ export type TConfig = {
|
|
|
274
309
|
capabilities?: string[];
|
|
275
310
|
customParams?: {
|
|
276
311
|
defaultParamsEndpoint?: string;
|
|
312
|
+
reasoningFormat?: ReasoningParameterFormat;
|
|
313
|
+
reasoningKey?: ReasoningResponseKey;
|
|
277
314
|
paramDefinitions?: Partial<SettingDefinition>[];
|
|
278
315
|
};
|
|
279
316
|
};
|
|
280
317
|
export type TEndpointsConfig = Record<EModelEndpoint | string, TConfig | null | undefined> | undefined;
|
|
281
318
|
export type TModelsConfig = Record<string, string[]>;
|
|
319
|
+
/** Server-resolved context window and pricing for one model. Rates are USD per 1M tokens. */
|
|
320
|
+
export type TModelTokenomics = {
|
|
321
|
+
context?: number;
|
|
322
|
+
prompt?: number;
|
|
323
|
+
completion?: number;
|
|
324
|
+
cacheWrite?: number;
|
|
325
|
+
cacheRead?: number;
|
|
326
|
+
};
|
|
327
|
+
/** endpoint → model → resolved tokenomics, from GET /api/endpoints/token-config */
|
|
328
|
+
export type TTokenConfigMap = Record<string, Record<string, TModelTokenomics>>;
|
|
282
329
|
export type TUpdateTokenCountResponse = {
|
|
283
330
|
count: number;
|
|
284
331
|
};
|
package/package.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "librechat-data-provider",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.505",
|
|
4
4
|
"description": "data services for librechat apps",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
|
-
"module": "dist/index.
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
7
|
"types": "./dist/types/index.d.ts",
|
|
8
8
|
"sideEffects": false,
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
|
-
"import": "./dist/index.
|
|
11
|
+
"import": "./dist/index.mjs",
|
|
12
12
|
"require": "./dist/index.js",
|
|
13
13
|
"types": "./dist/types/index.d.ts"
|
|
14
14
|
},
|
|
15
15
|
"./react-query": {
|
|
16
|
-
"import": "./dist/react-query/index.
|
|
16
|
+
"import": "./dist/react-query/index.mjs",
|
|
17
17
|
"require": "./dist/react-query/index.js",
|
|
18
18
|
"types": "./dist/types/react-query/index.d.ts"
|
|
19
19
|
}
|
|
@@ -23,14 +23,14 @@
|
|
|
23
23
|
],
|
|
24
24
|
"scripts": {
|
|
25
25
|
"clean": "rimraf dist",
|
|
26
|
-
"build": "npm run clean &&
|
|
27
|
-
"build:watch": "
|
|
26
|
+
"build": "npm run clean && tsdown && tsc -p tsconfig.build.json",
|
|
27
|
+
"build:watch": "tsdown --watch",
|
|
28
28
|
"rollup:api": "npx rollup -c server-rollup.config.js --bundleConfigAsCjs",
|
|
29
29
|
"test": "jest --coverage --watch",
|
|
30
30
|
"test:ci": "jest --coverage --ci --logHeapUsage",
|
|
31
31
|
"verify": "npm run test:ci",
|
|
32
32
|
"b:clean": "bun run rimraf dist",
|
|
33
|
-
"b:build": "bun run b:clean && bun run
|
|
33
|
+
"b:build": "bun run b:clean && bun run tsdown && bun run tsc -p tsconfig.build.json"
|
|
34
34
|
},
|
|
35
35
|
"repository": {
|
|
36
36
|
"type": "git",
|
|
@@ -57,20 +57,18 @@
|
|
|
57
57
|
"@rollup/plugin-json": "^6.1.0",
|
|
58
58
|
"@rollup/plugin-node-resolve": "^15.1.0",
|
|
59
59
|
"@rollup/plugin-replace": "^5.0.5",
|
|
60
|
-
"@rollup/plugin-terser": "^1.0.0",
|
|
61
60
|
"@types/jest": "^29.5.2",
|
|
62
61
|
"@types/js-yaml": "^4.0.9",
|
|
63
|
-
"@types/node": "^
|
|
62
|
+
"@types/node": "^24.12.4",
|
|
64
63
|
"@types/react": "^18.2.18",
|
|
65
64
|
"@types/winston": "^2.4.4",
|
|
66
65
|
"jest": "^30.2.0",
|
|
67
|
-
"jest-junit": "^
|
|
66
|
+
"jest-junit": "^17.0.0",
|
|
68
67
|
"openapi-types": "^12.1.3",
|
|
69
68
|
"rimraf": "^6.1.3",
|
|
70
69
|
"rollup": "^4.34.9",
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"typescript": "^5.0.4"
|
|
70
|
+
"tsdown": "^0.22.2",
|
|
71
|
+
"typescript": "^5.9.3"
|
|
74
72
|
},
|
|
75
73
|
"peerDependencies": {
|
|
76
74
|
"@tanstack/react-query": "^4.28.0"
|