librechat-data-provider 0.8.522 → 0.8.523

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 (46) hide show
  1. package/dist/{data-service-CaB7saTP.mjs → data-service-Bx6IFaSa.mjs} +638 -27
  2. package/dist/data-service-Bx6IFaSa.mjs.map +1 -0
  3. package/dist/{data-service-D5kHzBt-.js → data-service-CTX0tVO5.js} +871 -26
  4. package/dist/data-service-CTX0tVO5.js.map +1 -0
  5. package/dist/index.js +557 -19
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.mjs +491 -20
  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/accessPermissions.d.ts +54 -1
  12. package/dist/types/api-endpoints.d.ts +6 -0
  13. package/dist/types/bedrock.d.ts +80 -20
  14. package/dist/types/code/approval.d.ts +26 -0
  15. package/dist/types/code/worker.d.ts +10 -0
  16. package/dist/types/code/workspace.d.ts +28 -0
  17. package/dist/types/codeEnvRef.d.ts +5 -0
  18. package/dist/types/config.d.ts +6062 -3828
  19. package/dist/types/data-service.d.ts +8 -0
  20. package/dist/types/errors.d.ts +2 -0
  21. package/dist/types/file-config.d.ts +137 -9
  22. package/dist/types/filters.d.ts +176 -176
  23. package/dist/types/generate.d.ts +28 -4
  24. package/dist/types/index.d.ts +7 -0
  25. package/dist/types/keys.d.ts +11 -1
  26. package/dist/types/mcp.d.ts +336 -330
  27. package/dist/types/messages.d.ts +19 -0
  28. package/dist/types/models.d.ts +367 -238
  29. package/dist/types/parameterSettings.d.ts +8 -0
  30. package/dist/types/providers.d.ts +1 -0
  31. package/dist/types/resolve-llm-delivery-path.d.ts +68 -0
  32. package/dist/types/schemas.d.ts +628 -317
  33. package/dist/types/svg.d.ts +34 -0
  34. package/dist/types/types/agents.d.ts +24 -0
  35. package/dist/types/types/assistants.d.ts +27 -3
  36. package/dist/types/types/files.d.ts +34 -0
  37. package/dist/types/types/insights.d.ts +9 -0
  38. package/dist/types/types/queries.d.ts +8 -1
  39. package/dist/types/types/queuedTurns.d.ts +16 -16
  40. package/dist/types/types/runs.d.ts +24 -5
  41. package/dist/types/types/schedules.d.ts +44 -11
  42. package/dist/types/types/traces.d.ts +85 -0
  43. package/dist/types/types.d.ts +41 -1
  44. package/package.json +2 -2
  45. package/dist/data-service-CaB7saTP.mjs.map +0 -1
  46. package/dist/data-service-D5kHzBt-.js.map +0 -1
@@ -9,7 +9,7 @@ export type ScheduleFrequency = (typeof scheduleFrequencies)[number];
9
9
  export declare const SCHEDULE_CRON_MAX_LENGTH = 256;
10
10
  export declare const scheduleTargets: readonly ["new"];
11
11
  export type ScheduleTarget = (typeof scheduleTargets)[number];
12
- export type ScheduleDisabledReason = 'too_many_failures' | 'agent_deleted' | 'invalid_schedule' | 'permission_revoked' | 'insufficient_balance' | 'project_deleted' | 'project_required';
12
+ export type ScheduleDisabledReason = 'mcp_reauth_required' | 'mcp_configuration_missing' | 'mcp_permission_denied' | 'too_many_failures' | 'agent_deleted' | 'invalid_schedule' | 'permission_revoked' | 'insufficient_balance' | 'project_deleted' | 'project_required';
13
13
  export type ScheduleRunStatus = 'started' | 'requires_action' | 'success' | 'error' | 'interrupted' | 'skipped_overlap' | 'skipped_balance';
14
14
  export declare const structuredCadenceSchema: z.ZodObject<{
15
15
  frequency: z.ZodEnum<["hourly", "daily", "weekdays", "weekly"]>;
@@ -122,10 +122,10 @@ export declare const createSchedulePayloadSchema: z.ZodObject<{
122
122
  clientRequestId: z.ZodString;
123
123
  }, "strip", z.ZodTypeAny, {
124
124
  name: string;
125
- agent_id: string;
126
- clientRequestId: string;
127
125
  prompt: string;
128
126
  enabled: boolean;
127
+ agent_id: string;
128
+ clientRequestId: string;
129
129
  timezone: string;
130
130
  cadence: {
131
131
  frequency: "hourly" | "daily" | "weekdays" | "weekly";
@@ -141,9 +141,9 @@ export declare const createSchedulePayloadSchema: z.ZodObject<{
141
141
  file_ids?: string[] | undefined;
142
142
  }, {
143
143
  name: string;
144
+ prompt: string;
144
145
  agent_id: string;
145
146
  clientRequestId: string;
146
- prompt: string;
147
147
  timezone: string;
148
148
  cadence: {
149
149
  frequency: "hourly" | "daily" | "weekdays" | "weekly";
@@ -154,20 +154,20 @@ export declare const createSchedulePayloadSchema: z.ZodObject<{
154
154
  frequency: "cron";
155
155
  expression: string;
156
156
  };
157
+ enabled?: boolean | undefined;
157
158
  chatProjectId?: string | null | undefined;
158
159
  file_ids?: string[] | undefined;
159
- enabled?: boolean | undefined;
160
160
  target?: "new" | undefined;
161
161
  }>;
162
162
  export type TCreateSchedule = z.infer<typeof createSchedulePayloadSchema>;
163
163
  /** Idempotency is a property of the CREATE attempt, not of the schedule's config. */
164
164
  export declare const updateSchedulePayloadSchema: z.ZodObject<{
165
165
  name: z.ZodOptional<z.ZodString>;
166
+ prompt: z.ZodOptional<z.ZodString>;
167
+ enabled: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
166
168
  chatProjectId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
167
169
  file_ids: z.ZodOptional<z.ZodOptional<z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>>>;
168
170
  agent_id: z.ZodOptional<z.ZodString>;
169
- prompt: z.ZodOptional<z.ZodString>;
170
- enabled: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
171
171
  timezone: z.ZodOptional<z.ZodString>;
172
172
  cadence: z.ZodOptional<z.ZodDiscriminatedUnion<"frequency", [z.ZodObject<{
173
173
  frequency: z.ZodEnum<["hourly", "daily", "weekdays", "weekly"]>;
@@ -206,11 +206,11 @@ export declare const updateSchedulePayloadSchema: z.ZodObject<{
206
206
  expectedConfigRevision: z.ZodOptional<z.ZodNumber>;
207
207
  }, "strip", z.ZodTypeAny, {
208
208
  name?: string | undefined;
209
+ prompt?: string | undefined;
210
+ enabled?: boolean | undefined;
209
211
  chatProjectId?: string | null | undefined;
210
212
  file_ids?: string[] | undefined;
211
213
  agent_id?: string | undefined;
212
- prompt?: string | undefined;
213
- enabled?: boolean | undefined;
214
214
  timezone?: string | undefined;
215
215
  cadence?: {
216
216
  frequency: "hourly" | "daily" | "weekdays" | "weekly";
@@ -225,11 +225,11 @@ export declare const updateSchedulePayloadSchema: z.ZodObject<{
225
225
  expectedConfigRevision?: number | undefined;
226
226
  }, {
227
227
  name?: string | undefined;
228
+ prompt?: string | undefined;
229
+ enabled?: boolean | undefined;
228
230
  chatProjectId?: string | null | undefined;
229
231
  file_ids?: string[] | undefined;
230
232
  agent_id?: string | undefined;
231
- prompt?: string | undefined;
232
- enabled?: boolean | undefined;
233
233
  timezone?: string | undefined;
234
234
  cadence?: {
235
235
  frequency: "hourly" | "daily" | "weekdays" | "weekly";
@@ -248,6 +248,7 @@ export type TScheduleLastRun = {
248
248
  conversationId?: string;
249
249
  status: ScheduleRunStatus;
250
250
  error?: string;
251
+ mcp?: ScheduleMCPOutcome[];
251
252
  firedAt: string;
252
253
  };
253
254
  export type TSchedule = {
@@ -265,6 +266,17 @@ export type TSchedule = {
265
266
  disabledReason?: ScheduleDisabledReason;
266
267
  nextRunAt?: string;
267
268
  lastRun?: TScheduleLastRun;
269
+ /**
270
+ * The occurrences generating right now. Read from their own run rows, not from
271
+ * `lastRun`, which is projected only when a run settles, pauses or skips and is
272
+ * deliberately withheld from a run whose schedule was edited mid-flight. This is
273
+ * the signal a client has that a chat is on its way, and the id to fetch it by.
274
+ * A run parked on an approval is not here: its chat was listed long ago, and the
275
+ * rows can accumulate for as long as approvals wait.
276
+ */
277
+ inFlight?: Array<{
278
+ conversationId: string;
279
+ }>;
268
280
  runCount: number;
269
281
  failureCount: number;
270
282
  configRevision?: number;
@@ -272,6 +284,7 @@ export type TSchedule = {
272
284
  updatedAt: string;
273
285
  };
274
286
  export type TScheduleRun = {
287
+ mcp?: ScheduleMCPOutcome[];
275
288
  scheduleId: string;
276
289
  scheduledFor: string;
277
290
  firedAt?: string;
@@ -304,3 +317,23 @@ export type TScheduleRunNowResponse = {
304
317
  conversationId: string;
305
318
  status: 'started';
306
319
  };
320
+ /** Only structured schedule preflight failures may request immediate suspension. */
321
+ export declare function getScheduleMCPDisabledReason(outcomes?: ScheduleMCPOutcome[]): 'mcp_reauth_required' | 'mcp_configuration_missing' | 'mcp_permission_denied' | undefined;
322
+ export declare const scheduleMCPOutcomeSchema: z.ZodObject<{
323
+ server: z.ZodString;
324
+ /** Agent whose selected tool requires this server. Used to open the correct
325
+ * recovery chat when the requirement belongs to a handoff or subagent. */
326
+ agentId: z.ZodOptional<z.ZodString>;
327
+ status: z.ZodEnum<["ready", "mcp_reauth_required", "mcp_configuration_missing", "mcp_permission_denied", "mcp_unavailable"]>;
328
+ }, "strip", z.ZodTypeAny, {
329
+ status: "ready" | "mcp_reauth_required" | "mcp_configuration_missing" | "mcp_permission_denied" | "mcp_unavailable";
330
+ server: string;
331
+ agentId?: string | undefined;
332
+ }, {
333
+ status: "ready" | "mcp_reauth_required" | "mcp_configuration_missing" | "mcp_permission_denied" | "mcp_unavailable";
334
+ server: string;
335
+ agentId?: string | undefined;
336
+ }>;
337
+ export type ScheduleMCPOutcome = z.infer<typeof scheduleMCPOutcomeSchema>;
338
+ export type ScheduleMCPStatus = ScheduleMCPOutcome['status'];
339
+ export declare function readScheduleMCPOutcomes(error?: string): ScheduleMCPOutcome[];
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Provider-neutral conversation trace contract. The server maps whatever its
3
+ * tracing backend stores into these shapes, so the client never sees a
4
+ * backend's field names, credentials, URL structure or API version.
5
+ */
6
+ export type TTraceRecordKind = 'agent' | 'generation' | 'tool' | 'span' | 'event';
7
+ /** `running` marks a record with no end time yet; it has a start but no duration. */
8
+ export type TTraceStatus = 'ok' | 'warning' | 'error' | 'running';
9
+ export type TTraceUsage = {
10
+ input?: number;
11
+ output?: number;
12
+ total?: number;
13
+ reasoning?: number;
14
+ cacheRead?: number;
15
+ cacheWrite?: number;
16
+ };
17
+ export type TTraceRecord = {
18
+ id: string;
19
+ traceId: string;
20
+ /** The response message whose turn produced this record; groups records into turns. */
21
+ messageId: string;
22
+ /** `null` for a root; may name a record that is not loaded (or does not exist). */
23
+ parentId: string | null;
24
+ kind: TTraceRecordKind;
25
+ name: string;
26
+ model?: string;
27
+ /** ISO-8601 timestamps. */
28
+ startTime: string;
29
+ endTime?: string;
30
+ /** First streamed token of a generation; splits its span into TTFT and decoding. */
31
+ completionStartTime?: string;
32
+ status: TTraceStatus;
33
+ statusMessage?: string;
34
+ usage?: TTraceUsage;
35
+ /** Total cost in USD, when the backend priced the record. */
36
+ cost?: number;
37
+ };
38
+ export type TTraceErrorCode = 'disabled' | 'not_found' | 'invalid_request' | 'rate_limited' | 'timeout' | 'unauthorized' | 'unsupported' | 'upstream_error';
39
+ export type TTraceErrorResponse = {
40
+ error: string;
41
+ errorCode: TTraceErrorCode;
42
+ };
43
+ export type TTraceAvailability = {
44
+ available: boolean;
45
+ /** Set when the backend cannot decide yet; ask again after this many milliseconds. */
46
+ retryAfterMs?: number;
47
+ };
48
+ export type TTracePageParams = {
49
+ conversationId: string;
50
+ cursor?: string;
51
+ };
52
+ export type TTraceRecordParams = {
53
+ conversationId: string;
54
+ recordId: string;
55
+ /** The turn the list attributed the record to; its traces are what authorize the read. */
56
+ messageId: string;
57
+ /** The `sourceId` of the page that listed the record, so its detail reads the same project. */
58
+ sourceId?: string;
59
+ };
60
+ /**
61
+ * Newest turns first; `nextCursor` loads the next older page. A turn's records
62
+ * may continue on the following page, and their order within a turn is not
63
+ * defined, so a client groups records by turn and orders them by time.
64
+ */
65
+ export type TTracePage = {
66
+ records: TTraceRecord[];
67
+ nextCursor?: string;
68
+ /** Opaque identity of the backend project that served the page. */
69
+ sourceId?: string;
70
+ };
71
+ export type TTraceContent = {
72
+ value: string;
73
+ truncated: boolean;
74
+ };
75
+ export type TTraceRecordDetail = {
76
+ record: TTraceRecord;
77
+ /** False when the deployment withholds input, output and metadata. */
78
+ contentAvailable: boolean;
79
+ input?: TTraceContent;
80
+ output?: TTraceContent;
81
+ metadata?: TTraceContent;
82
+ };
83
+ export declare const TRACE_CURSOR_MAX_LENGTH = 4096;
84
+ export declare const TRACE_SOURCE_ID_MAX_LENGTH = 128;
85
+ export declare const TRACE_RECORD_ID_MAX_LENGTH = 256;
@@ -1,7 +1,9 @@
1
1
  import type { InfiniteData } from '@tanstack/react-query';
2
2
  import type { TConversationTag, EModelEndpoint, TConversation, TSharedLink, TAttachment, TMessage, TBanner, ReasoningResponseKey, ReasoningParameterFormat } from './schemas';
3
- import type { CodeEnvironmentUserConfigSchema, CodeEnvironmentUserSettings } from './config';
3
+ import type { CodeWorkspaceDescriptor, CodeEnvironmentMode, CodeWorkspaceOperation, CodeWorkspaceSelection } from './code/workspace';
4
+ import type { CodeEnvironmentUserConfigSchema, CodeEnvironmentUserSettings, TAgentsEndpoint } from './config';
4
5
  import type { Agent, EToolResources, StatefulCodeEnvironment } from './types/assistants';
6
+ import type { CodeApprovalMode } from './code/approval';
5
7
  import type { RefillIntervalUnit } from './balance';
6
8
  import type { SettingDefinition } from './generate';
7
9
  import type { TMinimalFeedback } from './feedback';
@@ -51,6 +53,9 @@ export type TEphemeralAgent = {
51
53
  export type TPayload = Partial<TMessage> & Partial<TEndpointOption> & {
52
54
  isContinued: boolean;
53
55
  isRegenerate?: boolean;
56
+ /** Manual context compaction: summarize the branch up to `parentMessageId`
57
+ * and end without a reply. No user message is created. */
58
+ compact?: boolean;
54
59
  conversationId: string | null;
55
60
  messages?: TMessages;
56
61
  isTemporary: boolean;
@@ -65,6 +70,12 @@ export type TPayload = Partial<TMessage> & Partial<TEndpointOption> & {
65
70
  * before the LLM turn runs.
66
71
  */
67
72
  manualSkills?: string[];
73
+ /** Conversation-scoped preference for code tool approval behavior. */
74
+ codeApprovalMode?: CodeApprovalMode;
75
+ /** Immutable conversation choice for attached code execution. */
76
+ codeEnvironmentMode?: CodeEnvironmentMode;
77
+ /** Conversation-selected workspaces, with at most one binding per environment. */
78
+ codeWorkspaces?: CodeWorkspaceSelection[];
68
79
  /** Browser IANA timezone (e.g. `America/New_York`) used to resolve local-time prompt variables server-side. */
69
80
  timezone?: string;
70
81
  /**
@@ -101,6 +112,9 @@ export type TSubmission = {
101
112
  /** Client-only full message context used to restore branch siblings after scoped regenerate. */
102
113
  regenerateMessages?: TMessage[];
103
114
  isRegenerate?: boolean;
115
+ /** Manual context compaction; shaped like a regenerate on the client (no new
116
+ * user bubble) and sent to the server as a summarize-only turn. */
117
+ compact?: boolean;
104
118
  initialResponse?: TMessage;
105
119
  conversation: Partial<TConversation>;
106
120
  endpointOption: TEndpointOption;
@@ -137,6 +151,12 @@ export type TSubmission = {
137
151
  addedConvo?: TConversation;
138
152
  /** Skills the user invoked via the `$` popover for this submission. */
139
153
  manualSkills?: string[];
154
+ /** Conversation-scoped preference for code tool approval behavior. */
155
+ codeApprovalMode?: CodeApprovalMode;
156
+ /** Immutable conversation choice for attached code execution. */
157
+ codeEnvironmentMode?: CodeEnvironmentMode;
158
+ /** Conversation-selected workspaces, with at most one binding per environment. */
159
+ codeWorkspaces?: CodeWorkspaceSelection[];
140
160
  /** Stable per-submission idempotency key (uuid) forwarded to the server to dedup retried start-generation requests. */
141
161
  clientRequestId?: string;
142
162
  /** Client-only carry-through for a receipt-bound queued recovery. */
@@ -424,6 +444,16 @@ export type TCodeEnvironmentPairingResponse = {
424
444
  endpoint: string;
425
445
  };
426
446
  };
447
+ export type TCodeEnvironmentStatusResponse = {
448
+ environmentId: string;
449
+ status: 'offline' | 'starting' | 'ready';
450
+ statefulWorkspace?: boolean;
451
+ leaseExpiresInMs?: number;
452
+ sandboxProfile?: string;
453
+ runtimes?: string[];
454
+ operations?: CodeWorkspaceOperation[];
455
+ workspaces?: CodeWorkspaceDescriptor[];
456
+ };
427
457
  export type TConfig = {
428
458
  order: number;
429
459
  type?: EModelEndpoint;
@@ -450,9 +480,17 @@ export type TConfig = {
450
480
  statefulCodeSessions?: {
451
481
  allowedEnvironments: StatefulCodeEnvironment[];
452
482
  environments?: TPublicCodeEnvironment[];
483
+ approvalsEnabled?: boolean;
484
+ /** Approval modes the endpoint policy permits the client to offer. */
485
+ approvalModes?: CodeApprovalMode[];
453
486
  };
454
487
  /** Effective subagents-per-agent cap served from `endpoints.agents.maxSubagents`. */
455
488
  maxSubagents?: number;
489
+ fileSharing?: TAgentsEndpoint['fileSharing'];
490
+ /** Concurrent Code API uploads allowed per route and authenticated principal. */
491
+ codeApiUploadConcurrency?: number;
492
+ /** Milliseconds one operation may spend waiting on Code API rate limits. */
493
+ codeApiMaxRetryWaitMs?: number;
456
494
  customParams?: {
457
495
  defaultParamsEndpoint?: string;
458
496
  reasoningFormat?: ReasoningParameterFormat;
@@ -793,4 +831,6 @@ export type TLangfuseConnectionTestResponse = {
793
831
  };
794
832
  export type TLangfuseSessionLinkResponse = {
795
833
  url: string | null;
834
+ /** Opaque identity of the project `url` opens, so a caller can tell whether it holds what it showed. */
835
+ destinationId?: string;
796
836
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "librechat-data-provider",
3
- "version": "0.8.522",
3
+ "version": "0.8.523",
4
4
  "description": "data services for librechat apps",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -46,7 +46,7 @@
46
46
  "axios": "^1.20.0",
47
47
  "croner": "^10.0.1",
48
48
  "dayjs": "^1.11.13",
49
- "js-yaml": "^4.3.1",
49
+ "js-yaml": "^4.3.2",
50
50
  "re2js": "^2.8.6",
51
51
  "zod": "^3.22.4"
52
52
  },