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
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_data_service = require("./data-service-D5kHzBt-.js");
2
+ const require_data_service = require("./data-service-CTX0tVO5.js");
3
3
  let zod = require("zod");
4
4
  let dayjs = require("dayjs");
5
5
  dayjs = require_data_service.__toESM(dayjs);
@@ -711,6 +711,10 @@ let ReasoningLabelEvents = /* @__PURE__ */ function(ReasoningLabelEvents) {
711
711
  ReasoningLabelEvents["ON_REASONING_LABEL_ATTEMPT"] = "on_reasoning_label_attempt";
712
712
  return ReasoningLabelEvents;
713
713
  }({});
714
+ const finiteNonNegativeInteger = (value) => {
715
+ if (typeof value !== "number" || !Number.isFinite(value)) return;
716
+ return Math.min(Number.MAX_SAFE_INTEGER, Math.max(0, Math.floor(value)));
717
+ };
714
718
  /**
715
719
  * Full prompt token count for one completed model call — the EXACT context the
716
720
  * model saw, provider-aware: additive providers (Bedrock) report `input_tokens`
@@ -722,37 +726,114 @@ let ReasoningLabelEvents = /* @__PURE__ */ function(ReasoningLabelEvents) {
722
726
  * gauge reconciles its calibrated estimate to.
723
727
  */
724
728
  const promptTokensFromUsage = (event) => {
725
- const input = event.input_tokens ?? 0;
729
+ const input = finiteNonNegativeInteger(event.input_tokens) ?? 0;
726
730
  const details = event.input_token_details ?? {};
727
- const cacheRead = details.cache_read ?? 0;
728
- const cacheCreation = details.cache_creation ?? 0;
729
- return (event.provider != null ? require_data_service.inputTokensIncludesCache(event.provider) : cacheRead + cacheCreation <= input) ? input : input + cacheRead + cacheCreation;
731
+ const cacheRead = finiteNonNegativeInteger(details.cache_read) ?? 0;
732
+ const cacheCreation = finiteNonNegativeInteger(details.cache_creation) ?? 0;
733
+ return (event.provider != null ? require_data_service.inputTokensIncludesCache(event.provider) : cacheRead + cacheCreation <= input) ? input : Math.min(Number.MAX_SAFE_INTEGER, input + cacheRead + cacheCreation);
734
+ };
735
+ /**
736
+ * Scales per-tool result-message counts while bounding both malformed input and
737
+ * rounding error. Null-prototype records keep tool names as ordinary data keys;
738
+ * cumulative apportionment preserves the scaled sum in one linear pass.
739
+ */
740
+ const scaleToolMessageTokenCounts = (value, oldTotal, newTotal) => {
741
+ if (value == null || typeof value !== "object" || Array.isArray(value)) return;
742
+ const scaled = Object.create(null);
743
+ let remaining = oldTotal;
744
+ let cumulative = 0;
745
+ let allocated = 0;
746
+ let found = false;
747
+ for (const [name, rawCount] of Object.entries(value)) {
748
+ const count = finiteNonNegativeInteger(rawCount);
749
+ if (count == null || count === 0) continue;
750
+ const bounded = Math.min(count, remaining);
751
+ remaining -= bounded;
752
+ cumulative += bounded;
753
+ const target = oldTotal > 0 ? Math.round(cumulative / oldTotal * newTotal) : 0;
754
+ const apportioned = target - allocated;
755
+ allocated = target;
756
+ if (apportioned > 0) {
757
+ scaled[name] = apportioned;
758
+ found = true;
759
+ }
760
+ }
761
+ return found ? scaled : void 0;
730
762
  };
731
763
  /**
732
764
  * Reconciles a pre-invoke context snapshot's CALIBRATED estimate to a call's
733
765
  * ACTUAL prompt tokens. The SDK's calibration multiplier scales only
734
- * `messageTokens` (instructions/summary are raw tiktoken counts), and it can
766
+ * `messageTokens` (instructions/summary are raw tiktoken counts) and can
735
767
  * over-shoot badly when a provider injects server-side content the SDK never
736
768
  * counted (e.g. Anthropic web search) — pinning the gauge several× too high and
737
769
  * persisting it. Trust the provider's own prompt count: keep the raw
738
- * instruction/summary rows, set `messageTokens` to the remainder, and recompute
739
- * the free space. No-op when `promptTokens` is unusable.
770
+ * instruction/summary rows, set `messageTokens` to the remainder, recompute the
771
+ * free space, and rescale the `toolMessageTokens` share to the new message
772
+ * total. No-op when `promptTokens` is unusable.
740
773
  */
741
774
  const reconcileContextUsage = (snapshot, promptTokens) => {
742
775
  if (!Number.isFinite(promptTokens) || promptTokens <= 0) return snapshot;
776
+ const normalizedPromptTokens = Math.min(Number.MAX_SAFE_INTEGER, Math.floor(promptTokens));
777
+ if (normalizedPromptTokens <= 0) return snapshot;
743
778
  const { breakdown } = snapshot;
744
- const budget = snapshot.contextBudget ?? breakdown.maxContextTokens;
745
- const nonMessageTokens = (breakdown.instructionTokens ?? 0) + (breakdown.summaryTokens ?? 0);
746
- const messageTokens = Math.max(0, promptTokens - nonMessageTokens);
747
- return {
779
+ const instructionTokens = finiteNonNegativeInteger(breakdown.instructionTokens) ?? 0;
780
+ const summaryTokens = finiteNonNegativeInteger(breakdown.summaryTokens) ?? 0;
781
+ const budget = finiteNonNegativeInteger(snapshot.contextBudget) ?? finiteNonNegativeInteger(breakdown.maxContextTokens);
782
+ const nonMessageTokens = instructionTokens + summaryTokens;
783
+ const messageTokens = Math.max(0, normalizedPromptTokens - nonMessageTokens);
784
+ /** `toolMessageTokens` is a subset of the OLD (calibrated) `messageTokens`;
785
+ * rescale it by the same proportion so the split tracks the provider's real
786
+ * total. A supplied zero remains a known-zero split; absent fields stay absent
787
+ * for older snapshots. */
788
+ const priorMessageTokens = finiteNonNegativeInteger(breakdown.messageTokens) ?? 0;
789
+ const priorToolMessageTokens = finiteNonNegativeInteger(breakdown.toolMessageTokens);
790
+ let toolMessageTokens;
791
+ if (priorToolMessageTokens != null) {
792
+ toolMessageTokens = 0;
793
+ if (priorMessageTokens > 0 && priorToolMessageTokens > 0) toolMessageTokens = Math.min(messageTokens, Math.round(Math.min(priorToolMessageTokens, priorMessageTokens) / priorMessageTokens * messageTokens));
794
+ }
795
+ const toolMessageTokenCounts = toolMessageTokens != null ? scaleToolMessageTokenCounts(breakdown.toolMessageTokenCounts, Math.min(priorToolMessageTokens ?? 0, priorMessageTokens), toolMessageTokens) : void 0;
796
+ const nextBreakdown = {
797
+ ...breakdown,
798
+ instructionTokens,
799
+ summaryTokens,
800
+ messageTokens
801
+ };
802
+ if (toolMessageTokens == null) {
803
+ delete nextBreakdown.toolMessageTokens;
804
+ delete nextBreakdown.toolMessageTokenCounts;
805
+ } else {
806
+ nextBreakdown.toolMessageTokens = toolMessageTokens;
807
+ if (toolMessageTokenCounts == null) delete nextBreakdown.toolMessageTokenCounts;
808
+ else nextBreakdown.toolMessageTokenCounts = toolMessageTokenCounts;
809
+ }
810
+ const result = {
748
811
  ...snapshot,
749
- breakdown: {
750
- ...breakdown,
751
- messageTokens
752
- },
753
- remainingContextTokens: budget != null ? Math.max(0, budget - promptTokens) : snapshot.remainingContextTokens
812
+ breakdown: nextBreakdown
754
813
  };
814
+ if (budget != null) result.remainingContextTokens = Math.max(0, budget - normalizedPromptTokens);
815
+ else {
816
+ const remaining = finiteNonNegativeInteger(snapshot.remainingContextTokens);
817
+ if (remaining == null) delete result.remainingContextTokens;
818
+ else result.remainingContextTokens = remaining;
819
+ }
820
+ return result;
821
+ };
822
+ /** Provider output, including reasoning omitted from an under-reported output count. */
823
+ const outputTokensFromUsage = (event) => {
824
+ const output = finiteNonNegativeInteger(event.output_tokens) ?? 0;
825
+ const total = finiteNonNegativeInteger(event.total_tokens) ?? 0;
826
+ return Math.max(output, total - promptTokensFromUsage(event));
755
827
  };
828
+ /** Reconcile and retain the primary call details on live, saved, and resumable snapshots. */
829
+ const reconcileContextUsageFromEvent = (snapshot, event) => ({
830
+ ...reconcileContextUsage(snapshot, promptTokensFromUsage(event)),
831
+ model: event.model,
832
+ provider: event.provider,
833
+ completedOutputTokens: outputTokensFromUsage(event),
834
+ cacheRead: finiteNonNegativeInteger(event.input_token_details?.cache_read) ?? 0,
835
+ cacheWrite: finiteNonNegativeInteger(event.input_token_details?.cache_creation) ?? 0
836
+ });
756
837
  //#endregion
757
838
  //#region src/parsers.ts
758
839
  dayjs.default.extend(dayjs_plugin_utc_js.default);
@@ -1375,6 +1456,166 @@ function parseLangChainErrorCode(message) {
1375
1456
  }
1376
1457
  }
1377
1458
  //#endregion
1459
+ //#region src/resolve-llm-delivery-path.ts
1460
+ /** Audio and video reach the model only through the media encoders, which support a
1461
+ * narrower provider set than documents. Images use the broadly supported vision
1462
+ * path and are never gated here. */
1463
+ const isProviderCapable = (mimeType, endpoint, useResponsesApi) => {
1464
+ if (mimeType.startsWith("audio/") || mimeType.startsWith("video/")) return require_data_service.isMediaSupportedProvider(endpoint);
1465
+ if (mimeType === "application/pdf") return useResponsesApi === true || require_data_service.isDocumentSupportedProvider(endpoint);
1466
+ return true;
1467
+ };
1468
+ const SYSTEM_LLM_DELIVERY_DEFAULTS = {
1469
+ fallback: "text",
1470
+ overrides: {
1471
+ "image/*": "provider",
1472
+ "video/*": "provider",
1473
+ "audio/*": "provider",
1474
+ "application/pdf": "provider"
1475
+ }
1476
+ };
1477
+ /**
1478
+ * Types some step in the upload pipeline can turn into text: natively readable text,
1479
+ * documents a parser or OCR handles, images through OCR, and audio through transcription.
1480
+ *
1481
+ * Everything absent from this list, notably archives, tarballs, columnar data files and
1482
+ * video, has no such step, and the default text matcher accepts any well-formed type, so
1483
+ * routing them to text ends in their bytes being decoded as UTF-8.
1484
+ */
1485
+ const TEXT_RECOVERABLE_MIME_TYPES = [
1486
+ /^text\//,
1487
+ /^image\//,
1488
+ /^audio\//,
1489
+ /^application\/(json|javascript|xml|sql|yaml|x-yaml|csv|typescript|x-sh|vnd\.coffeescript)$/,
1490
+ /^application\/pdf$/,
1491
+ /^application\/vnd\.openxmlformats-officedocument\.(wordprocessingml\.document|spreadsheetml\.sheet)$/,
1492
+ /^application\/vnd\.oasis\.opendocument\.(text|spreadsheet)$/,
1493
+ /^application\/(vnd\.ms-excel|x-msexcel|msexcel|x-ms-excel|x-excel|x-dos_ms_excel|xls|x-xls)$/,
1494
+ /^message\/rfc822$/
1495
+ ];
1496
+ /**
1497
+ * Types whose bytes are text already, so reading them directly is meaningful. Everything
1498
+ * else needs a real extractor: decoding it as UTF-8 produces mojibake rather than content.
1499
+ */
1500
+ /** Application types whose payload is text. Mirrors the set the content-protection code
1501
+ * treats as textual, plus the source and data formats this pipeline also accepts. */
1502
+ const TEXTUAL_APPLICATION_MIME_TYPES = new Set([
1503
+ "application/json",
1504
+ "application/javascript",
1505
+ "application/sql",
1506
+ "application/xml",
1507
+ "application/x-yaml",
1508
+ "application/yaml",
1509
+ "application/csv",
1510
+ "application/typescript",
1511
+ "application/x-sh",
1512
+ "application/vnd.coffeescript"
1513
+ ]);
1514
+ function isNativelyReadableText(mimeType) {
1515
+ const normalized = mimeType.split(";", 1)[0].trim().toLowerCase();
1516
+ return normalized.startsWith("text/") || TEXTUAL_APPLICATION_MIME_TYPES.has(normalized) || normalized === "message/rfc822";
1517
+ }
1518
+ function hasTextExtractionPath(mimeType) {
1519
+ return TEXT_RECOVERABLE_MIME_TYPES.some((pattern) => pattern.test(mimeType));
1520
+ }
1521
+ /**
1522
+ * Resolves the default file path destination for a given mime type.
1523
+ * Resolution chain: endpoint overrides -> endpoint fallback -> global overrides -> global fallback -> system defaults.
1524
+ */
1525
+ function resolveDefaultLLMDeliveryPath(mimeType, endpointConfig, globalConfig, endpoint, useResponsesApi, sttConfigured) {
1526
+ const wildcard = mimeType.split("/")[0] + "/*";
1527
+ if (endpointConfig?.overrides) {
1528
+ if (endpointConfig.overrides[mimeType]) return endpointConfig.overrides[mimeType];
1529
+ if (endpointConfig.overrides[wildcard]) return endpointConfig.overrides[wildcard];
1530
+ }
1531
+ if (endpointConfig?.fallback) return endpointConfig.fallback;
1532
+ if (globalConfig?.overrides) {
1533
+ if (globalConfig.overrides[mimeType]) return globalConfig.overrides[mimeType];
1534
+ if (globalConfig.overrides[wildcard]) return globalConfig.overrides[wildcard];
1535
+ }
1536
+ if (globalConfig?.fallback) return globalConfig.fallback;
1537
+ const systemDefault = SYSTEM_LLM_DELIVERY_DEFAULTS.overrides[mimeType] ?? SYSTEM_LLM_DELIVERY_DEFAULTS.overrides[wildcard] ?? SYSTEM_LLM_DELIVERY_DEFAULTS.fallback;
1538
+ /** Only the system default is capability-gated: an explicit config above is the
1539
+ * admin's decision. A known endpoint that cannot encode documents or media would
1540
+ * otherwise accept the upload and hand the model nothing at all. */
1541
+ /** `agents` is a container, not a provider: it is what an upload reports when the
1542
+ * agent's real provider could not be resolved, as for ephemeral agents. A custom
1543
+ * endpoint name is likewise unresolvable here, since its real provider is chosen
1544
+ * at request time and is usually OpenAI- or Anthropic-compatible. Judging
1545
+ * capability from either would downgrade media the actual provider can deliver,
1546
+ * so an unresolved provider keeps the system default. */
1547
+ const namedEndpoint = endpoint != null && endpoint !== "agents";
1548
+ const providerKnown = namedEndpoint && require_data_service.isKnownProviderIdentifier(endpoint);
1549
+ const isMedia = mimeType.startsWith("audio/") || mimeType.startsWith("video/");
1550
+ const canRecoverText = (type) => type.startsWith("audio/") && sttConfigured === false ? false : hasTextExtractionPath(type);
1551
+ if (systemDefault === "provider" && (isMedia ? namedEndpoint : providerKnown) && !isProviderCapable(mimeType, endpoint, useResponsesApi)) return canRecoverText(mimeType) ? "text" : "none";
1552
+ /** Bedrock's Converse document path natively accepts more than PDF, so on that
1553
+ * endpoint its document types belong on the provider path rather than being
1554
+ * extracted, which would drop non-text content and layout. */
1555
+ if (systemDefault !== "provider" && endpoint === "bedrock" && require_data_service.isBedrockDocumentType(mimeType)) return "provider";
1556
+ if (systemDefault === "text" && !canRecoverText(mimeType)) return "none";
1557
+ return systemDefault;
1558
+ }
1559
+ /**
1560
+ * Delivery path for an upload that named no tool resource. The legacy chooser makes the
1561
+ * destination explicit, so nothing is inferred there.
1562
+ */
1563
+ function resolveDefaultUploadLLMDeliveryPath({ mimeType, endpointConfig, fileConfig, endpoint, useResponsesApi, sttConfigured }) {
1564
+ if (endpointConfig?.legacyFileUploadUX === true) return "provider";
1565
+ return resolveDefaultLLMDeliveryPath(mimeType, endpointConfig?.defaultLLMDeliveryPath, fileConfig?.defaultLLMDeliveryPath, endpoint, useResponsesApi, sttConfigured);
1566
+ }
1567
+ /** Delivery path for an upload, honoring an explicitly chosen tool resource. */
1568
+ function resolveUploadLLMDeliveryPath({ toolResource, mimeType, endpointConfig, fileConfig, endpoint, useResponsesApi, sttConfigured }) {
1569
+ if (toolResource === "context" || toolResource === "ocr") return "text";
1570
+ if (toolResource === "file_search" || toolResource === "execute_code") return "none";
1571
+ return resolveDefaultUploadLLMDeliveryPath({
1572
+ mimeType,
1573
+ endpointConfig,
1574
+ fileConfig,
1575
+ endpoint,
1576
+ useResponsesApi,
1577
+ sttConfigured
1578
+ });
1579
+ }
1580
+ /**
1581
+ * Whether a file tool can do anything with this type. `file_search` indexes extracted
1582
+ * text, so it needs a type some step can turn into text and cannot use media, whose
1583
+ * extraction paths are OCR and speech rather than the vector store. Code execution is
1584
+ * judged by the list the client offers it from. Shared by upload-time selection and
1585
+ * deferred provisioning so the two cannot queue a file the other would refuse.
1586
+ */
1587
+ function canToolResourceConsume(toolResource, mimeType) {
1588
+ if (toolResource === "file_search") return !mimeType.startsWith("image") && !mimeType.startsWith("audio") && !mimeType.startsWith("video") && (hasTextExtractionPath(mimeType) || matchesMimeList(mimeType, require_data_service.retrievalMimeTypes));
1589
+ if (toolResource === "execute_code") return matchesMimeList(mimeType, require_data_service.codeInterpreterMimeTypes);
1590
+ return true;
1591
+ }
1592
+ const matchesMimeList = (mimeType, patterns) => patterns.some((pattern) => pattern.test(mimeType));
1593
+ /**
1594
+ * Where a unified upload will end up, and whether it can be accepted at all.
1595
+ *
1596
+ * An upload has to be readable by something: the model, an extraction step, or a file
1597
+ * tool. A permanent one has to land on an agent resource too, or storing it succeeds
1598
+ * while leaving the agent no reference to it. Both outcomes are decided here rather than
1599
+ * discovered later, so a request that would change nothing is refused with a reason.
1600
+ *
1601
+ * `agentTools` is undefined when no agent record backs the upload, as for an ephemeral
1602
+ * agent that exists only for the request. An unknown tool set is not judged.
1603
+ */
1604
+ function resolveUploadDestination(params) {
1605
+ const { toolResource, deliveryPath, mimeType, agentTools, hasAgent, isMessageAttachment, allowUnknownMessageConsumer = false, contextEnabled } = params;
1606
+ const refusesContext = (resource) => resource === "context" && hasAgent && !isMessageAttachment && contextEnabled === false;
1607
+ if (toolResource) {
1608
+ const resolved = toolResource === "ocr" ? "context" : toolResource;
1609
+ return refusesContext(resolved) ? { rejection: "context-disabled" } : { toolResource: resolved };
1610
+ }
1611
+ if (deliveryPath === "text") return refusesContext("context") ? { rejection: "context-disabled" } : { toolResource: "context" };
1612
+ const consumingTool = agentTools?.find((tool) => (tool === "execute_code" || tool === "file_search") && canToolResourceConsume(tool, mimeType));
1613
+ if (deliveryPath === "none" && consumingTool) return { toolResource: consumingTool };
1614
+ if (hasAgent && !isMessageAttachment) return { rejection: "no-agent-resource" };
1615
+ if (deliveryPath === "none" && (!isMessageAttachment || !allowUnknownMessageConsumer)) return { rejection: "no-consumer" };
1616
+ return {};
1617
+ }
1618
+ //#endregion
1378
1619
  //#region src/messages.ts
1379
1620
  /** A generated reasoning title describes the text as it existed at generation time.
1380
1621
  * Any manual edit or merge into a different reasoning step invalidates the entire
@@ -1463,6 +1704,66 @@ function buildTree({ messages, fileMap }) {
1463
1704
  if (!cached) treeCache.set(messages, entry);
1464
1705
  return tree;
1465
1706
  }
1707
+ /**
1708
+ * Memoizes a messages array's id index. Every row that needs to look another
1709
+ * message up (the hover controls resolving the turn a rerun would replay) would
1710
+ * otherwise scan the whole array, which is quadratic in the conversation. A
1711
+ * cache write replaces the array, so the index dies with the array it indexes
1712
+ * and can never answer from stale rows.
1713
+ */
1714
+ const indexCache = /* @__PURE__ */ new WeakMap();
1715
+ /** The message with this id, resolved through the array's memoized index. */
1716
+ function findMessageById(messages, messageId) {
1717
+ if (messages == null || messageId == null) return;
1718
+ let index = indexCache.get(messages);
1719
+ if (index == null) {
1720
+ index = /* @__PURE__ */ new Map();
1721
+ for (const message of messages) if (message?.messageId != null && !index.has(message.messageId)) index.set(message.messageId, message);
1722
+ indexCache.set(messages, index);
1723
+ }
1724
+ return index.get(messageId);
1725
+ }
1726
+ /**
1727
+ * True when a turn carries the marker the server stamps on a manual compaction:
1728
+ * `markCompactionSummary` sets `initiatedBy: 'user'` on the summary a Compact
1729
+ * action produced, and nothing else writes it, so an automatic summary detour is
1730
+ * not one. This is the compaction's own identity, independent of where it hangs:
1731
+ * Compact runs on whatever leaf the branch ends with, so its response can parent
1732
+ * onto a user message as easily as onto the answer it summarized. Redoing one is
1733
+ * the context indicator's Compact action, never a rerun of the turn behind it.
1734
+ */
1735
+ function isUserInitiatedCompaction(message) {
1736
+ const content = message?.content;
1737
+ if (!Array.isArray(content)) return false;
1738
+ return content.some((part) => part?.type === "summary" && part.initiatedBy === "user");
1739
+ }
1740
+ /**
1741
+ * True when a message is a finished manual compaction: every content part is a
1742
+ * summary and at least one of them carries text. A part that is still streaming
1743
+ * or that failed contributes no text of its own, so an interrupted compaction
1744
+ * can be retried.
1745
+ */
1746
+ function isCompactedLeaf(message) {
1747
+ const content = message?.content;
1748
+ if (!Array.isArray(content) || content.length === 0) return false;
1749
+ let usable = false;
1750
+ for (const part of content) {
1751
+ if (part?.type !== "summary") return false;
1752
+ if (part.summarizing === true || part.failed === true) continue;
1753
+ const hasText = (part.content ?? []).some((block) => typeof block?.text === "string" && block.text.trim().length > 0);
1754
+ usable = usable || hasText;
1755
+ }
1756
+ return usable;
1757
+ }
1758
+ //#endregion
1759
+ //#region src/errors.ts
1760
+ const TOOL_CALL_ERROR_PREFIX = /^Error:\s*(?:\[[^\]]*\]\s*)*tool call failed:\s*/i;
1761
+ function hasToolCallErrorPrefix(text) {
1762
+ return TOOL_CALL_ERROR_PREFIX.test(text);
1763
+ }
1764
+ function stripToolCallErrorPrefix(text) {
1765
+ return text.replace(TOOL_CALL_ERROR_PREFIX, "");
1766
+ }
1466
1767
  //#endregion
1467
1768
  //#region src/runSteps.ts
1468
1769
  /**
@@ -5161,6 +5462,35 @@ const updateSchedulePayloadSchema = createSchedulePayloadSchema.omit({ clientReq
5161
5462
  * server-side fresh-read fence alone cannot detect this).
5162
5463
  */
5163
5464
  expectedConfigRevision: zod.z.number().int().min(0).optional() });
5465
+ /** Only structured schedule preflight failures may request immediate suspension. */
5466
+ function getScheduleMCPDisabledReason(outcomes) {
5467
+ const statuses = new Set(outcomes?.map((outcome) => outcome.status));
5468
+ if (statuses.has("mcp_permission_denied")) return "mcp_permission_denied";
5469
+ if (statuses.has("mcp_configuration_missing")) return "mcp_configuration_missing";
5470
+ if (statuses.has("mcp_reauth_required")) return "mcp_reauth_required";
5471
+ }
5472
+ const scheduleMCPOutcomeSchema = zod.z.object({
5473
+ server: zod.z.string(),
5474
+ /** Agent whose selected tool requires this server. Used to open the correct
5475
+ * recovery chat when the requirement belongs to a handoff or subagent. */
5476
+ agentId: zod.z.string().optional(),
5477
+ status: zod.z.enum([
5478
+ "ready",
5479
+ "mcp_reauth_required",
5480
+ "mcp_configuration_missing",
5481
+ "mcp_permission_denied",
5482
+ "mcp_unavailable"
5483
+ ])
5484
+ });
5485
+ function readScheduleMCPOutcomes(error) {
5486
+ if (!error || !/^mcp_(reauth_required|configuration_missing|permission_denied|unavailable): \[/.test(error)) return [];
5487
+ try {
5488
+ const result = scheduleMCPOutcomeSchema.array().safeParse(JSON.parse(error.slice(error.indexOf(": ") + 2)));
5489
+ return result.success ? result.data : [];
5490
+ } catch {
5491
+ return [];
5492
+ }
5493
+ }
5164
5494
  //#endregion
5165
5495
  //#region src/cadence.ts
5166
5496
  /** Mirrors the server default when a weekly cadence omits `daysOfWeek`. */
@@ -5433,6 +5763,12 @@ let DATE_RANGE = /* @__PURE__ */ function(DATE_RANGE) {
5433
5763
  const INSIGHTS_MAX_RANGE_DAYS = 30;
5434
5764
  const INSIGHTS_SEARCH_MIN_LENGTH = 3;
5435
5765
  const INSIGHTS_SEARCH_MAX_LENGTH = 200;
5766
+ const INSIGHTS_AGENT_ID_MAX_LENGTH = 256;
5767
+ //#endregion
5768
+ //#region src/types/traces.ts
5769
+ const TRACE_CURSOR_MAX_LENGTH = 4096;
5770
+ const TRACE_SOURCE_ID_MAX_LENGTH = 128;
5771
+ const TRACE_RECORD_ID_MAX_LENGTH = 256;
5436
5772
  //#endregion
5437
5773
  //#region src/types/queuedTurns.ts
5438
5774
  const agentQueuedTurnStatuses = [
@@ -5519,6 +5855,7 @@ let ProviderId = /* @__PURE__ */ function(ProviderId) {
5519
5855
  ProviderId["groq"] = "groq";
5520
5856
  ProviderId["helicone"] = "helicone";
5521
5857
  ProviderId["huggingface"] = "huggingface";
5858
+ ProviderId["lemonade"] = "lemonade";
5522
5859
  ProviderId["mistral"] = "mistral";
5523
5860
  ProviderId["mlx"] = "mlx";
5524
5861
  ProviderId["ollama"] = "ollama";
@@ -5548,6 +5885,7 @@ const knownEndpointToProvider = {
5548
5885
  ["groq"]: "groq",
5549
5886
  ["helicone"]: "helicone",
5550
5887
  ["huggingface"]: "huggingface",
5888
+ ["lemonade"]: "lemonade",
5551
5889
  ["mistral"]: "mistral",
5552
5890
  ["mlx"]: "mlx",
5553
5891
  ["ollama"]: "ollama",
@@ -5573,6 +5911,8 @@ const providerAliases = {
5573
5911
  grok: "xai",
5574
5912
  kimi: "moonshot",
5575
5913
  moonshotai: "moonshot",
5914
+ amdlemonade: "lemonade",
5915
+ lemonadeserver: "lemonade",
5576
5916
  mistralai: "mistral",
5577
5917
  togetherai: "together"
5578
5918
  };
@@ -5594,6 +5934,77 @@ function resolveModelCatalogKey(provider, catalogs) {
5594
5934
  return catalogs?.[key] != null ? key : modelCatalogAliases[key] ?? key;
5595
5935
  }
5596
5936
  //#endregion
5937
+ //#region src/svg.ts
5938
+ /**
5939
+ * DOMPurify policy for user-provided SVG icons, shared by the browser uploader and
5940
+ * the server trust boundary so a preview and the persisted icon cannot disagree.
5941
+ * `use` is re-added for self-contained `<defs>` references (targets restricted by
5942
+ * `restrictSvgReferences`); every SMIL element is forbidden so a stored icon
5943
+ * cannot animate forever wherever it renders.
5944
+ */
5945
+ const SVG_SANITIZE_CONFIG = {
5946
+ USE_PROFILES: {
5947
+ svg: true,
5948
+ svgFilters: true
5949
+ },
5950
+ ADD_TAGS: ["use"],
5951
+ ADD_ATTR: ["fr"],
5952
+ FORBID_TAGS: [
5953
+ "script",
5954
+ "foreignObject",
5955
+ "style",
5956
+ "a",
5957
+ "image",
5958
+ "animate",
5959
+ "animateColor",
5960
+ "animateMotion",
5961
+ "animateTransform",
5962
+ "mpath",
5963
+ "set"
5964
+ ],
5965
+ FORBID_ATTR: ["style"]
5966
+ };
5967
+ const URL_TOKEN_PREFIX = /url\(\s*['"]?\s*/gi;
5968
+ /**
5969
+ * True when every `url()` token targets a fragment. Backslashes reject the value
5970
+ * outright: CSS unescapes idents before tokenizing, so `u\72l(...)` is a `url()`.
5971
+ */
5972
+ function referencesOnlyFragments(value) {
5973
+ if (value.includes("\\")) return false;
5974
+ if (!value.toLowerCase().includes("url(")) return true;
5975
+ URL_TOKEN_PREFIX.lastIndex = 0;
5976
+ while (URL_TOKEN_PREFIX.exec(value) !== null) if (value[URL_TOKEN_PREFIX.lastIndex] !== "#") return false;
5977
+ return true;
5978
+ }
5979
+ /** DOMPurify hook that drops every attribute referencing outside the document. */
5980
+ function restrictSvgReferences(node) {
5981
+ const names = [];
5982
+ for (let i = 0; i < node.attributes.length; i += 1) names.push(node.attributes[i].name);
5983
+ for (const name of names) {
5984
+ const value = node.getAttribute(name)?.trim();
5985
+ if (value == null) continue;
5986
+ if (name === "href" || name === "xlink:href") {
5987
+ if (!value.startsWith("#")) node.removeAttribute(name);
5988
+ continue;
5989
+ }
5990
+ if (!referencesOnlyFragments(value)) node.removeAttribute(name);
5991
+ }
5992
+ }
5993
+ /** SVG names the HTML parser lowercases and its adjustment table does not restore. */
5994
+ const UNADJUSTED_SVG_TAGS = [[/(<\/?)fedropshadow\b/gi, "$1feDropShadow"]];
5995
+ const SVG_ROOT_TAG = /<svg(\s[^>]*)?>/i;
5996
+ /**
5997
+ * Makes HTML-mode sanitizer output valid as a standalone `image/svg+xml`
5998
+ * document: restores camelCase element names the HTML parser lowercased and
5999
+ * declares the SVG namespace on the root, without which an XML parser puts the
6000
+ * root in no namespace and the icon renders blank.
6001
+ */
6002
+ function finalizeSvgMarkup(markup) {
6003
+ let restored = markup;
6004
+ for (const [pattern, canonical] of UNADJUSTED_SVG_TAGS) restored = restored.replace(pattern, canonical);
6005
+ return restored.replace(SVG_ROOT_TAG, (tag, attributes) => attributes != null && /\sxmlns\s*=/i.test(attributes) ? tag : `<svg xmlns="http://www.w3.org/2000/svg"${attributes ?? ""}>`);
6006
+ }
6007
+ //#endregion
5597
6008
  //#region src/actions.ts
5598
6009
  function sha1(input) {
5599
6010
  return crypto.default.createHash("sha1").update(input).digest("hex");
@@ -6077,7 +6488,7 @@ function getUserTimezone() {
6077
6488
  }
6078
6489
  }
6079
6490
  function createPayload(submission) {
6080
- const { isEdited, addedConvo, userMessage, isContinued, isTemporary, isRegenerate, conversation, editedContent, ephemeralAgent, endpointOption, manualSkills, clientRequestId, recoverySteerId, expectedPredecessorCreatedAt } = submission;
6491
+ const { isEdited, addedConvo, userMessage, isContinued, isTemporary, isRegenerate, compact, conversation, editedContent, ephemeralAgent, endpointOption, manualSkills, codeApprovalMode, codeEnvironmentMode, codeWorkspaces, clientRequestId, recoverySteerId, expectedPredecessorCreatedAt } = submission;
6081
6492
  const { conversationId } = require_data_service.tConvoUpdateSchema.parse(conversation);
6082
6493
  const { endpoint: _e, endpointType } = endpointOption;
6083
6494
  const endpoint = _e;
@@ -6091,12 +6502,18 @@ function createPayload(submission) {
6091
6502
  endpoint,
6092
6503
  addedConvo,
6093
6504
  isTemporary,
6094
- isRegenerate,
6505
+ /** A compaction borrows the regenerate shape client-side only: the server
6506
+ * must see it as a compaction, never as a regenerated user turn. */
6507
+ isRegenerate: compact === true ? void 0 : isRegenerate,
6508
+ ...compact === true && { compact: true },
6095
6509
  editedContent,
6096
6510
  conversationId,
6097
6511
  isContinued: !!(isEdited && isContinued),
6098
6512
  ephemeralAgent: require_data_service.isAssistantsEndpoint(endpoint) ? void 0 : ephemeralAgent,
6099
6513
  manualSkills: require_data_service.isAssistantsEndpoint(endpoint) ? void 0 : manualSkills,
6514
+ codeApprovalMode: require_data_service.isAssistantsEndpoint(endpoint) ? void 0 : codeApprovalMode,
6515
+ codeEnvironmentMode: require_data_service.isAssistantsEndpoint(endpoint) ? void 0 : codeEnvironmentMode,
6516
+ codeWorkspaces: require_data_service.isAssistantsEndpoint(endpoint) ? void 0 : codeWorkspaces,
6100
6517
  timezone: getUserTimezone(),
6101
6518
  clientRequestId,
6102
6519
  recoverySteerId,
@@ -7279,6 +7696,38 @@ const paramSettings = {
7279
7696
  [`bedrock-zai`]: bedrockZAI,
7280
7697
  ["google"]: googleConfig
7281
7698
  };
7699
+ /**
7700
+ * Maps effective backend param names for OpenAI-compatible/Azure endpoints (as deleted from
7701
+ * `llmConfig` via `dropParams`, e.g. `maxTokens`) to their corresponding UI/conversation keys
7702
+ * (e.g. `max_tokens`). Native providers (anthropic, google, bedrock, ...) already render these
7703
+ * same camelCase names as their UI key (e.g. `topP`), so this alias must only be applied to
7704
+ * OpenAI-compatible parameter sets — see `resolveDropParamsUIKeys`.
7705
+ */
7706
+ const dropParamsBackendToUIKey = {
7707
+ maxTokens: "max_tokens",
7708
+ topP: "top_p",
7709
+ frequencyPenalty: "frequency_penalty",
7710
+ presencePenalty: "presence_penalty"
7711
+ };
7712
+ /** Endpoint keys whose parameter settings render the OpenAI-compatible (snake_case) UI keys. */
7713
+ const openAILikeParamEndpointKeys = new Set([
7714
+ "openAI",
7715
+ "azureOpenAI",
7716
+ "custom",
7717
+ "openrouter"
7718
+ ]);
7719
+ /**
7720
+ * Normalizes an admin-configured `dropParams` list into the UI/conversation keys used to hide
7721
+ * the matching controls in the settings panels. `endpointKey` should be the same key used to
7722
+ * resolve the panel's parameter settings (e.g. `overriddenEndpointKey`); the backend-name alias
7723
+ * is only applied for OpenAI-compatible endpoints, since native providers (anthropic, google,
7724
+ * bedrock, ...) already use these backend names as their UI key.
7725
+ */
7726
+ function resolveDropParamsUIKeys(dropParams, endpointKey) {
7727
+ if (!dropParams || dropParams.length === 0) return /* @__PURE__ */ new Set();
7728
+ if (!openAILikeParamEndpointKeys.has(endpointKey)) return new Set(dropParams);
7729
+ return new Set(dropParams.map((param) => dropParamsBackendToUIKey[param] ?? param));
7730
+ }
7282
7731
  const openAIColumns = {
7283
7732
  col1: openAICol1,
7284
7733
  col2: openAICol2
@@ -7462,6 +7911,28 @@ function getCodeEnvRefs(refs) {
7462
7911
  return Object.entries(merged).flatMap(([routeKey, ref]) => ref ? [[routeKey, ref]] : []);
7463
7912
  }
7464
7913
  //#endregion
7914
+ //#region src/code/worker.ts
7915
+ function isCodeWorkerShell(value) {
7916
+ return value === "posix" || value === "powershell";
7917
+ }
7918
+ function quotePosix(value) {
7919
+ return `'${value.replace(/'/g, `'\\''`)}'`;
7920
+ }
7921
+ function quotePowerShell(value) {
7922
+ return `'${value.replace(/'/g, "''")}'`;
7923
+ }
7924
+ function createCodeWorkerSetupCommand(pairing, shell, options = {}) {
7925
+ const quote = shell === "powershell" ? quotePowerShell : quotePosix;
7926
+ const pair = `librechat-code pair ${quote(pairing.endpoint)} ${quote(pairing.code)} --worker-id ${quote(pairing.workerId)}`;
7927
+ const run = ["librechat-code run", ...[
7928
+ options.defaultWorkspace === false ? null : "--default-workspace",
7929
+ options.allowWorkspaceWrites === true ? "--allow-workspace-writes" : null,
7930
+ options.allowWorkspaceCommands === true ? "--allow-workspace-commands" : null
7931
+ ].filter((value) => value != null)].join(" ");
7932
+ if (shell === "powershell") return `${pair}\n$env:LIBRECHAT_CODE_WORKER_ID = ${quote(pairing.workerId)}\n${run}`;
7933
+ return `${pair}\nLIBRECHAT_CODE_WORKER_ID=${quote(pairing.workerId)} ${run}`;
7934
+ }
7935
+ //#endregion
7465
7936
  exports.ACTION_METADATA_FILTER_FIELDS = require_data_service.ACTION_METADATA_FILTER_FIELDS;
7466
7937
  exports.AGENT_INSTRUCTION_FILTER_FIELDS = require_data_service.AGENT_INSTRUCTION_FILTER_FIELDS;
7467
7938
  exports.AUTH_USER_DOC_BY_ID_PREFIX = require_data_service.AUTH_USER_DOC_BY_ID_PREFIX;
@@ -7484,17 +7955,28 @@ exports.BEDROCK_FINE_GRAINED_TOOL_STREAMING_BETA = BEDROCK_FINE_GRAINED_TOOL_STR
7484
7955
  exports.BEDROCK_OUTPUT_128K_BETA = BEDROCK_OUTPUT_128K_BETA;
7485
7956
  exports.BedrockProviders = require_data_service.BedrockProviders;
7486
7957
  exports.BedrockReasoningConfig = require_data_service.BedrockReasoningConfig;
7958
+ exports.CODE_APPROVAL_MODES = require_data_service.CODE_APPROVAL_MODES;
7959
+ exports.CODE_ENVIRONMENT_COMMAND_TIMEOUT_DEFAULT_MS = require_data_service.CODE_ENVIRONMENT_COMMAND_TIMEOUT_DEFAULT_MS;
7960
+ exports.CODE_ENVIRONMENT_COMMAND_TIMEOUT_HARD_MAX_MS = require_data_service.CODE_ENVIRONMENT_COMMAND_TIMEOUT_HARD_MAX_MS;
7961
+ exports.CODE_ENVIRONMENT_DECISION_VERSION = require_data_service.CODE_ENVIRONMENT_DECISION_VERSION;
7962
+ exports.CODE_ENVIRONMENT_MODES = require_data_service.CODE_ENVIRONMENT_MODES;
7487
7963
  exports.CODE_ENV_KINDS = CODE_ENV_KINDS;
7964
+ exports.CODE_WORKSPACE_ID_PATTERN = require_data_service.CODE_WORKSPACE_ID_PATTERN;
7965
+ exports.CODE_WORKSPACE_MAX_COUNT = require_data_service.CODE_WORKSPACE_MAX_COUNT;
7966
+ exports.CODE_WORKSPACE_OPERATIONS = require_data_service.CODE_WORKSPACE_OPERATIONS;
7967
+ exports.CODE_WORKSPACE_SELECTION_ERROR_REASONS = require_data_service.CODE_WORKSPACE_SELECTION_ERROR_REASONS;
7488
7968
  exports.CONVERSATION_STARTER_FILTER_FIELDS = require_data_service.CONVERSATION_STARTER_FILTER_FIELDS;
7489
7969
  exports.CONVERSATION_TITLE_FILTER_FIELDS = require_data_service.CONVERSATION_TITLE_FILTER_FIELDS;
7490
7970
  exports.CacheKeys = require_data_service.CacheKeys;
7491
7971
  exports.Capabilities = require_data_service.Capabilities;
7972
+ exports.CodeApprovalModeError = require_data_service.CodeApprovalModeError;
7492
7973
  exports.CohereConstants = require_data_service.CohereConstants;
7493
7974
  exports.ComponentTypes = require_data_service.ComponentTypes;
7494
7975
  exports.Constants = require_data_service.Constants;
7495
7976
  exports.ContentTypes = ContentTypes;
7496
7977
  exports.DATE_RANGE = DATE_RANGE;
7497
7978
  exports.DEFAULT_MEMORY_MAX_INPUT_TOKENS = require_data_service.DEFAULT_MEMORY_MAX_INPUT_TOKENS;
7979
+ exports.DefaultLLMDeliveryPath = require_data_service.DefaultLLMDeliveryPath;
7498
7980
  exports.DynamicQueryKeys = require_data_service.DynamicQueryKeys;
7499
7981
  exports.EImageOutputType = require_data_service.EImageOutputType;
7500
7982
  exports.EModelEndpoint = require_data_service.EModelEndpoint;
@@ -7514,6 +7996,7 @@ exports.FileSources = require_data_service.FileSources;
7514
7996
  exports.ForkOptions = require_data_service.ForkOptions;
7515
7997
  exports.FunctionSignature = FunctionSignature;
7516
7998
  exports.HITL_MESSAGE_FILTER_FIELDS = require_data_service.HITL_MESSAGE_FILTER_FIELDS;
7999
+ exports.INSIGHTS_AGENT_ID_MAX_LENGTH = INSIGHTS_AGENT_ID_MAX_LENGTH;
7517
8000
  exports.INSIGHTS_MAX_RANGE_DAYS = INSIGHTS_MAX_RANGE_DAYS;
7518
8001
  exports.INSIGHTS_SEARCH_MAX_LENGTH = INSIGHTS_SEARCH_MAX_LENGTH;
7519
8002
  exports.INSIGHTS_SEARCH_MIN_LENGTH = INSIGHTS_SEARCH_MIN_LENGTH;
@@ -7524,10 +8007,14 @@ exports.ImageVisionTool = require_data_service.ImageVisionTool;
7524
8007
  exports.InfiniteCollections = require_data_service.InfiniteCollections;
7525
8008
  exports.InvocationMode = InvocationMode;
7526
8009
  exports.KnownEndpoints = require_data_service.KnownEndpoints;
8010
+ exports.LANGFUSE_TRACE_CONVERSATION_METADATA_FIELDS = require_data_service.LANGFUSE_TRACE_CONVERSATION_METADATA_FIELDS;
8011
+ exports.LANGFUSE_TRACE_USER_ID_FIELDS = require_data_service.LANGFUSE_TRACE_USER_ID_FIELDS;
8012
+ exports.LANGFUSE_TRACE_USER_METADATA_FIELDS = require_data_service.LANGFUSE_TRACE_USER_METADATA_FIELDS;
7527
8013
  exports.LocalStorageKeys = require_data_service.LocalStorageKeys;
7528
8014
  exports.MAX_CHAT_PROJECT_DESCRIPTION_LENGTH = require_data_service.MAX_CHAT_PROJECT_DESCRIPTION_LENGTH;
7529
8015
  exports.MAX_CHAT_PROJECT_NAME_LENGTH = require_data_service.MAX_CHAT_PROJECT_NAME_LENGTH;
7530
8016
  exports.MAX_GRAPH_SUBAGENT_MEMBERS = require_data_service.MAX_GRAPH_SUBAGENT_MEMBERS;
8017
+ exports.MAX_MCP_ICON_PATH_LENGTH = require_data_service.MAX_MCP_ICON_PATH_LENGTH;
7531
8018
  exports.MAX_PII_CUSTOM_PATTERNS_TOTAL = require_data_service.MAX_PII_CUSTOM_PATTERNS_TOTAL;
7532
8019
  exports.MAX_PII_CUSTOM_REGEX_CHARACTERS = require_data_service.MAX_PII_CUSTOM_REGEX_CHARACTERS;
7533
8020
  exports.MAX_PII_CUSTOM_REGEX_INSTRUCTIONS = require_data_service.MAX_PII_CUSTOM_REGEX_INSTRUCTIONS;
@@ -7598,6 +8085,8 @@ exports.SSEOptionsSchema = require_data_service.SSEOptionsSchema;
7598
8085
  exports.STATEFUL_CODE_ENVIRONMENTS = require_data_service.STATEFUL_CODE_ENVIRONMENTS;
7599
8086
  exports.STORED_MESSAGE_FILTER_FIELDS = require_data_service.STORED_MESSAGE_FILTER_FIELDS;
7600
8087
  exports.STTProviders = require_data_service.STTProviders;
8088
+ exports.SVG_SANITIZE_CONFIG = SVG_SANITIZE_CONFIG;
8089
+ exports.SYSTEM_LLM_DELIVERY_DEFAULTS = SYSTEM_LLM_DELIVERY_DEFAULTS;
7601
8090
  exports.SafeSearchTypes = require_data_service.SafeSearchTypes;
7602
8091
  exports.ScraperProviders = require_data_service.ScraperProviders;
7603
8092
  exports.SearchCategories = require_data_service.SearchCategories;
@@ -7615,6 +8104,9 @@ exports.StreamableHTTPOptionsSchema = require_data_service.StreamableHTTPOptions
7615
8104
  exports.SystemCategories = require_data_service.SystemCategories;
7616
8105
  exports.SystemRoles = SystemRoles;
7617
8106
  exports.TOOL_ARGUMENT_FILTER_FIELDS = require_data_service.TOOL_ARGUMENT_FILTER_FIELDS;
8107
+ exports.TRACE_CURSOR_MAX_LENGTH = TRACE_CURSOR_MAX_LENGTH;
8108
+ exports.TRACE_RECORD_ID_MAX_LENGTH = TRACE_RECORD_ID_MAX_LENGTH;
8109
+ exports.TRACE_SOURCE_ID_MAX_LENGTH = TRACE_SOURCE_ID_MAX_LENGTH;
7618
8110
  exports.TTSProviders = require_data_service.TTSProviders;
7619
8111
  exports.ThinkingDisplay = require_data_service.ThinkingDisplay;
7620
8112
  exports.ThinkingLevel = require_data_service.ThinkingLevel;
@@ -7633,6 +8125,7 @@ exports.accordian = accordian;
7633
8125
  exports.actionDelimiter = require_data_service.actionDelimiter;
7634
8126
  exports.actionDomainSeparator = require_data_service.actionDomainSeparator;
7635
8127
  exports.actionMetadataFilterFieldSchema = require_data_service.actionMetadataFilterFieldSchema;
8128
+ exports.agentGitIdentitySchema = require_data_service.agentGitIdentitySchema;
7636
8129
  exports.agentInstructionFilterFieldSchema = require_data_service.agentInstructionFilterFieldSchema;
7637
8130
  exports.agentParamSettings = agentParamSettings;
7638
8131
  exports.agentPermissionsSchema = agentPermissionsSchema;
@@ -7688,6 +8181,7 @@ exports.cacheSubsetProviders = require_data_service.cacheSubsetProviders;
7688
8181
  exports.cadenceIntervalMinutes = cadenceIntervalMinutes;
7689
8182
  exports.cadenceToCron = cadenceToCron;
7690
8183
  exports.calendar = calendar;
8184
+ exports.canToolResourceConsume = canToolResourceConsume;
7691
8185
  exports.cancelAgentQueuedTurnResponseSchema = cancelAgentQueuedTurnResponseSchema;
7692
8186
  exports.cancelAgentQueuedTurnSchema = cancelAgentQueuedTurnSchema;
7693
8187
  exports.capsEffortWhenThinkingDisabled = capsEffortWhenThinkingDisabled;
@@ -7718,6 +8212,7 @@ exports.contextPruningSchema = require_data_service.contextPruningSchema;
7718
8212
  exports.conversationStarterFilterFieldSchema = require_data_service.conversationStarterFilterFieldSchema;
7719
8213
  exports.conversationTitleFilterFieldSchema = require_data_service.conversationTitleFilterFieldSchema;
7720
8214
  exports.convertStringsToRegex = require_data_service.convertStringsToRegex;
8215
+ exports.createCodeWorkerSetupCommand = createCodeWorkerSetupCommand;
7721
8216
  exports.createPayload = createPayload;
7722
8217
  exports.createSchedulePayloadSchema = createSchedulePayloadSchema;
7723
8218
  exports.createURL = createURL;
@@ -7733,6 +8228,7 @@ exports.defaultAgentFormValues = require_data_service.defaultAgentFormValues;
7733
8228
  exports.defaultAssistantFormValues = require_data_service.defaultAssistantFormValues;
7734
8229
  exports.defaultAssistantsVersion = require_data_service.defaultAssistantsVersion;
7735
8230
  exports.defaultEndpoints = require_data_service.defaultEndpoints;
8231
+ exports.defaultLLMDeliveryPathSchema = require_data_service.defaultLLMDeliveryPathSchema;
7736
8232
  exports.defaultModels = require_data_service.defaultModels;
7737
8233
  exports.defaultOCRMimeTypes = require_data_service.defaultOCRMimeTypes;
7738
8234
  exports.defaultOrderQuery = require_data_service.defaultOrderQuery;
@@ -7792,16 +8288,20 @@ exports.filterPiiCustomPatternSchema = require_data_service.filterPiiCustomPatte
7792
8288
  exports.filterPiiRegexSchema = require_data_service.filterPiiRegexSchema;
7793
8289
  exports.filterPiiStarterPatternSchema = require_data_service.filterPiiStarterPatternSchema;
7794
8290
  exports.filtersConfigSchema = require_data_service.filtersConfigSchema;
8291
+ exports.finalizeSvgMarkup = finalizeSvgMarkup;
7795
8292
  exports.findLastSeparatorIndex = findLastSeparatorIndex;
8293
+ exports.findMessageById = findMessageById;
7796
8294
  exports.fullMimeTypesList = require_data_service.fullMimeTypesList;
7797
8295
  exports.generateDynamicSchema = require_data_service.generateDynamicSchema;
7798
8296
  exports.generateGoogleSchema = require_data_service.generateGoogleSchema;
7799
8297
  exports.generateOpenAISchema = require_data_service.generateOpenAISchema;
8298
+ exports.getAllowedCodeApprovalModes = require_data_service.getAllowedCodeApprovalModes;
7800
8299
  exports.getCodeEnvRefForProfile = getCodeEnvRefForProfile;
7801
8300
  exports.getCodeEnvRefs = getCodeEnvRefs;
7802
8301
  exports.getConfigDefaults = require_data_service.getConfigDefaults;
7803
8302
  exports.getConfiguredMimeAccept = require_data_service.getConfiguredMimeAccept;
7804
8303
  exports.getDefaultParamsEndpoint = require_data_service.getDefaultParamsEndpoint;
8304
+ exports.getDocumentFileExtension = require_data_service.getDocumentFileExtension;
7805
8305
  exports.getEnabledEndpoints = getEnabledEndpoints;
7806
8306
  exports.getEndpointField = require_data_service.getEndpointField;
7807
8307
  exports.getEndpointFileConfig = require_data_service.getEndpointFileConfig;
@@ -7817,6 +8317,7 @@ exports.getRefillEligibilityDate = require_data_service.getRefillEligibilityDate
7817
8317
  exports.getResourcePermissionsResponseSchema = require_data_service.getResourcePermissionsResponseSchema;
7818
8318
  exports.getResponseSender = getResponseSender;
7819
8319
  exports.getRunStepDurationMs = getRunStepDurationMs;
8320
+ exports.getScheduleMCPDisabledReason = getScheduleMCPDisabledReason;
7820
8321
  exports.getSchemaDefaults = require_data_service.getSchemaDefaults;
7821
8322
  exports.getSettingsKeys = require_data_service.getSettingsKeys;
7822
8323
  exports.getTagByKey = require_data_service.getTagByKey;
@@ -7831,6 +8332,8 @@ exports.hasActivePiiFields = require_data_service.hasActivePiiFields;
7831
8332
  exports.hasActivePiiPatterns = require_data_service.hasActivePiiPatterns;
7832
8333
  exports.hasPermissions = require_data_service.hasPermissions;
7833
8334
  exports.hasProcessMCPServerConfig = require_data_service.hasProcessMCPServerConfig;
8335
+ exports.hasTextExtractionPath = hasTextExtractionPath;
8336
+ exports.hasToolCallErrorPrefix = hasToolCallErrorPrefix;
7834
8337
  exports.hostImageIdSuffix = require_data_service.hostImageIdSuffix;
7835
8338
  exports.hostImageNamePrefix = require_data_service.hostImageNamePrefix;
7836
8339
  exports.hoverCard = hoverCard;
@@ -7851,11 +8354,21 @@ exports.isAnthropicDocumentType = require_data_service.isAnthropicDocumentType;
7851
8354
  exports.isAnthropicTextDocumentType = require_data_service.isAnthropicTextDocumentType;
7852
8355
  exports.isAssistantsEndpoint = require_data_service.isAssistantsEndpoint;
7853
8356
  exports.isBedrockDocumentType = require_data_service.isBedrockDocumentType;
8357
+ exports.isCodeEnvironmentMode = require_data_service.isCodeEnvironmentMode;
8358
+ exports.isCodeWorkerShell = isCodeWorkerShell;
8359
+ exports.isCodeWorkspaceSelection = require_data_service.isCodeWorkspaceSelection;
8360
+ exports.isCodeWorkspaceSelectionErrorReason = require_data_service.isCodeWorkspaceSelectionErrorReason;
8361
+ exports.isCodeWorkspaceSelections = require_data_service.isCodeWorkspaceSelections;
8362
+ exports.isCompactedLeaf = isCompactedLeaf;
7854
8363
  exports.isCronCadence = isCronCadence;
7855
8364
  exports.isDocumentSupportedProvider = require_data_service.isDocumentSupportedProvider;
7856
8365
  exports.isEphemeralAgentId = isEphemeralAgentId;
7857
8366
  exports.isImageVisionTool = require_data_service.isImageVisionTool;
8367
+ exports.isKnownProviderIdentifier = require_data_service.isKnownProviderIdentifier;
8368
+ exports.isMediaSupportedProvider = require_data_service.isMediaSupportedProvider;
8369
+ exports.isMessageFileUpload = require_data_service.isMessageFileUpload;
7858
8370
  exports.isMythosClassModel = require_data_service.isMythosClassModel;
8371
+ exports.isNativelyReadableText = isNativelyReadableText;
7859
8372
  exports.isOpenAILikeProvider = require_data_service.isOpenAILikeProvider;
7860
8373
  exports.isParamEndpoint = require_data_service.isParamEndpoint;
7861
8374
  exports.isPermissiveMimeConfig = require_data_service.isPermissiveMimeConfig;
@@ -7863,25 +8376,32 @@ exports.isProcessMCPServerConfig = require_data_service.isProcessMCPServerConfig
7863
8376
  exports.isProcessMCPServerField = require_data_service.isProcessMCPServerField;
7864
8377
  exports.isRemoteOidcUrlAllowed = require_data_service.isRemoteOidcUrlAllowed;
7865
8378
  exports.isReportableRunStepDuration = isReportableRunStepDuration;
8379
+ exports.isResponsesApiUpload = require_data_service.isResponsesApiUpload;
7866
8380
  exports.isSecureCodeEnvironmentControlURL = require_data_service.isSecureCodeEnvironmentControlURL;
7867
8381
  exports.isSensitiveEnvVar = require_data_service.isSensitiveEnvVar;
8382
+ exports.isSpeechProviderConfigured = require_data_service.isSpeechProviderConfigured;
7868
8383
  exports.isSystemRoleName = isSystemRoleName;
7869
8384
  exports.isThinkingDisabled = isThinkingDisabled;
7870
8385
  exports.isUUID = require_data_service.isUUID;
8386
+ exports.isUserInitiatedCompaction = isUserInitiatedCompaction;
7871
8387
  exports.isValidCronExpression = isValidCronExpression;
7872
8388
  exports.knownEndpointToProvider = knownEndpointToProvider;
7873
8389
  exports.label = label;
7874
8390
  exports.langfuseConfigSchema = require_data_service.langfuseConfigSchema;
8391
+ exports.langfuseTraceConfigSchema = require_data_service.langfuseTraceConfigSchema;
7875
8392
  exports.librechat = librechat;
7876
8393
  exports.listAgentQueuedTurnsResponseSchema = listAgentQueuedTurnsResponseSchema;
7877
8394
  exports.listAgentQueuedTurnsSchema = listAgentQueuedTurnsSchema;
8395
+ exports.listConfiguredSpeechProviders = require_data_service.listConfiguredSpeechProviders;
7878
8396
  exports.loginPage = require_data_service.loginPage;
7879
8397
  exports.mapGroupToAzureConfig = mapGroupToAzureConfig;
7880
8398
  exports.mapModelToAzureConfig = mapModelToAzureConfig;
7881
8399
  exports.marketplacePermissionsSchema = marketplacePermissionsSchema;
7882
8400
  exports.materializeModelSpecEndpoints = require_data_service.materializeModelSpecEndpoints;
7883
8401
  exports.mbToBytes = require_data_service.mbToBytes;
8402
+ exports.mcpRefreshDefaults = require_data_service.mcpRefreshDefaults;
7884
8403
  exports.mcpServersPermissionsSchema = mcpServersPermissionsSchema;
8404
+ exports.mediaSupportedProviders = require_data_service.mediaSupportedProviders;
7885
8405
  exports.megabyte = require_data_service.megabyte;
7886
8406
  exports.memoryFilterFieldSchema = require_data_service.memoryFilterFieldSchema;
7887
8407
  exports.memoryPermissionsSchema = memoryPermissionsSchema;
@@ -7914,6 +8434,7 @@ exports.openAISettings = require_data_service.openAISettings;
7914
8434
  exports.openRouterSchema = require_data_service.openRouterSchema;
7915
8435
  exports.openapiToFunction = openapiToFunction;
7916
8436
  exports.orderEndpointsConfig = orderEndpointsConfig;
8437
+ exports.outputTokensFromUsage = outputTokensFromUsage;
7917
8438
  exports.pagination = pagination;
7918
8439
  exports.paramDefinitionSchema = require_data_service.paramDefinitionSchema;
7919
8440
  exports.paramEndpoints = require_data_service.paramEndpoints;
@@ -7937,7 +8458,9 @@ exports.promptTokensFromUsage = promptTokensFromUsage;
7937
8458
  exports.providerEndpointMap = require_data_service.providerEndpointMap;
7938
8459
  exports.radioGroup = radioGroup;
7939
8460
  exports.rateLimitSchema = require_data_service.rateLimitSchema;
8461
+ exports.readScheduleMCPOutcomes = readScheduleMCPOutcomes;
7940
8462
  exports.reconcileContextUsage = reconcileContextUsage;
8463
+ exports.reconcileContextUsageFromEvent = reconcileContextUsageFromEvent;
7941
8464
  exports.registerPage = require_data_service.registerPage;
7942
8465
  exports.remoteAgentsPermissionsSchema = remoteAgentsPermissionsSchema;
7943
8466
  exports.removeCodeExecutionCaller = removeCodeExecutionCaller;
@@ -7947,14 +8470,25 @@ exports.request = require_data_service.request_default;
7947
8470
  exports.requiresExplicitThinkingDisabled = requiresExplicitThinkingDisabled;
7948
8471
  exports.resolveAgentSkillsScope = require_data_service.resolveAgentSkillsScope;
7949
8472
  exports.resolveAllowedStatefulCodeEnvironments = require_data_service.resolveAllowedStatefulCodeEnvironments;
8473
+ exports.resolveCodeApprovalMode = require_data_service.resolveCodeApprovalMode;
8474
+ exports.resolveCodePermissionDecision = require_data_service.resolveCodePermissionDecision;
8475
+ exports.resolveDefaultLLMDeliveryPath = resolveDefaultLLMDeliveryPath;
8476
+ exports.resolveDefaultUploadLLMDeliveryPath = resolveDefaultUploadLLMDeliveryPath;
8477
+ exports.resolveDropParamsUIKeys = resolveDropParamsUIKeys;
7950
8478
  exports.resolveEndpointType = require_data_service.resolveEndpointType;
7951
8479
  exports.resolveModelCatalogKey = resolveModelCatalogKey;
7952
8480
  exports.resolveModelSpecEndpoint = require_data_service.resolveModelSpecEndpoint;
7953
8481
  exports.resolveProviderId = resolveProviderId;
7954
8482
  exports.resolveRef = resolveRef;
8483
+ exports.resolveSandboxFilename = require_data_service.resolveSandboxFilename;
7955
8484
  exports.resolveStatefulCodeEnvironment = require_data_service.resolveStatefulCodeEnvironment;
7956
8485
  exports.resolveThinkingDisplay = resolveThinkingDisplay;
8486
+ exports.resolveTraceViewerConfig = require_data_service.resolveTraceViewerConfig;
8487
+ exports.resolveUploadDestination = resolveUploadDestination;
8488
+ exports.resolveUploadLLMDeliveryPath = resolveUploadLLMDeliveryPath;
8489
+ exports.resolveUseResponsesApi = require_data_service.resolveUseResponsesApi;
7957
8490
  exports.resourcePermissionsResponseSchema = require_data_service.resourcePermissionsResponseSchema;
8491
+ exports.restrictSvgReferences = restrictSvgReferences;
7958
8492
  exports.retainRecentConfigSchema = require_data_service.retainRecentConfigSchema;
7959
8493
  exports.retrievalMimeTypes = require_data_service.retrievalMimeTypes;
7960
8494
  exports.retrievalMimeTypesList = require_data_service.retrievalMimeTypesList;
@@ -7963,6 +8497,7 @@ exports.roleSchema = roleSchema;
7963
8497
  exports.runCodePermissionsSchema = runCodePermissionsSchema;
7964
8498
  exports.scheduleCadenceSchema = scheduleCadenceSchema;
7965
8499
  exports.scheduleFrequencies = scheduleFrequencies;
8500
+ exports.scheduleMCPOutcomeSchema = scheduleMCPOutcomeSchema;
7966
8501
  exports.scheduleStructuredFrequencies = scheduleStructuredFrequencies;
7967
8502
  exports.scheduleTargets = scheduleTargets;
7968
8503
  exports.schedulesPermissionsSchema = schedulesPermissionsSchema;
@@ -7992,6 +8527,7 @@ exports.stripLangChainTroubleshootingUrl = stripLangChainTroubleshootingUrl;
7992
8527
  exports.stripReasoningLabelMetadata = stripReasoningLabelMetadata;
7993
8528
  exports.stripServerNamePrefix = require_data_service.stripServerNamePrefix;
7994
8529
  exports.stripServerNamePrefixes = require_data_service.stripServerNamePrefixes;
8530
+ exports.stripToolCallErrorPrefix = stripToolCallErrorPrefix;
7995
8531
  exports.structuredCadenceSchema = structuredCadenceSchema;
7996
8532
  exports.subagentThreadLineageSchema = require_data_service.subagentThreadLineageSchema;
7997
8533
  exports.summarizationConfigSchema = require_data_service.summarizationConfigSchema;
@@ -8031,6 +8567,8 @@ exports.toolApprovalModeSchema = require_data_service.toolApprovalModeSchema;
8031
8567
  exports.toolApprovalPolicySchema = require_data_service.toolApprovalPolicySchema;
8032
8568
  exports.toolArgumentFilterFieldSchema = require_data_service.toolArgumentFilterFieldSchema;
8033
8569
  exports.tooltip = tooltip;
8570
+ exports.traceViewerDefaults = require_data_service.traceViewerDefaults;
8571
+ exports.traceViewerLimits = require_data_service.traceViewerLimits;
8034
8572
  exports.transactionsSchema = require_data_service.transactionsSchema;
8035
8573
  exports.turnstileOptionsSchema = require_data_service.turnstileOptionsSchema;
8036
8574
  exports.turnstileSchema = require_data_service.turnstileSchema;