librechat-data-provider 0.8.521 → 0.8.522
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-pwrlWjJs.mjs → data-service-CaB7saTP.mjs} +1145 -37
- package/dist/data-service-CaB7saTP.mjs.map +1 -0
- package/dist/{data-service-DOIF4BkW.js → data-service-D5kHzBt-.js} +1588 -36
- package/dist/data-service-D5kHzBt-.js.map +1 -0
- package/dist/index.js +947 -36
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +825 -37
- package/dist/index.mjs.map +1 -1
- package/dist/react-query/index.js +2 -1
- package/dist/react-query/index.js.map +1 -1
- package/dist/react-query/index.mjs +2 -1
- package/dist/react-query/index.mjs.map +1 -1
- package/dist/types/accessPermissions.d.ts +4 -0
- package/dist/types/actions.d.ts +2 -2
- package/dist/types/agentToolOptions.d.ts +11 -0
- package/dist/types/api-endpoints.d.ts +18 -0
- package/dist/types/bedrock.d.ts +168 -0
- package/dist/types/cadence.d.ts +33 -0
- package/dist/types/codeEnvRef.d.ts +21 -0
- package/dist/types/config.d.ts +9060 -1135
- package/dist/types/data-service.d.ts +40 -2
- package/dist/types/file-config.d.ts +1 -0
- package/dist/types/filters.d.ts +1422 -0
- package/dist/types/generate.d.ts +79 -1
- package/dist/types/index.d.ts +10 -0
- package/dist/types/keys.d.ts +23 -2
- package/dist/types/langchain.d.ts +4 -0
- package/dist/types/limits.d.ts +13 -0
- package/dist/types/mcp.d.ts +299 -210
- package/dist/types/messages.d.ts +5 -0
- package/dist/types/models.d.ts +732 -68
- package/dist/types/parameterSettings.d.ts +5 -1
- package/dist/types/parsers.d.ts +10 -0
- package/dist/types/permissions.d.ts +42 -1
- package/dist/types/providers.d.ts +36 -0
- package/dist/types/request.d.ts +2 -2
- package/dist/types/roles.d.ts +34 -0
- package/dist/types/runSteps.d.ts +59 -0
- package/dist/types/schemas.d.ts +1191 -26
- package/dist/types/stateful-code.d.ts +7 -0
- package/dist/types/types/agents.d.ts +92 -7
- package/dist/types/types/assistants.d.ts +96 -5
- package/dist/types/types/files.d.ts +12 -2
- package/dist/types/types/index.d.ts +2 -0
- package/dist/types/types/insights.d.ts +62 -0
- package/dist/types/types/mutations.d.ts +1 -0
- package/dist/types/types/queries.d.ts +30 -2
- package/dist/types/types/queuedTurns.d.ts +870 -0
- package/dist/types/types/runs.d.ts +95 -4
- package/dist/types/types/schedules.d.ts +306 -0
- package/dist/types/types/skills.d.ts +9 -0
- package/dist/types/types/subagents.d.ts +159 -0
- package/dist/types/types/web.d.ts +12 -2
- package/dist/types/types.d.ts +61 -1
- package/package.json +4 -2
- package/dist/data-service-DOIF4BkW.js.map +0 -1
- package/dist/data-service-pwrlWjJs.mjs.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-
|
|
2
|
+
const require_data_service = require("./data-service-D5kHzBt-.js");
|
|
3
3
|
let zod = require("zod");
|
|
4
4
|
let dayjs = require("dayjs");
|
|
5
5
|
dayjs = require_data_service.__toESM(dayjs);
|
|
@@ -7,6 +7,7 @@ let dayjs_plugin_utc_js = require("dayjs/plugin/utc.js");
|
|
|
7
7
|
dayjs_plugin_utc_js = require_data_service.__toESM(dayjs_plugin_utc_js);
|
|
8
8
|
let dayjs_plugin_timezone_js = require("dayjs/plugin/timezone.js");
|
|
9
9
|
dayjs_plugin_timezone_js = require_data_service.__toESM(dayjs_plugin_timezone_js);
|
|
10
|
+
let croner = require("croner");
|
|
10
11
|
let axios = require("axios");
|
|
11
12
|
axios = require_data_service.__toESM(axios);
|
|
12
13
|
let url = require("url");
|
|
@@ -190,6 +191,17 @@ function supportsContext1m(model) {
|
|
|
190
191
|
return false;
|
|
191
192
|
}
|
|
192
193
|
/**
|
|
194
|
+
* Checks whether a native Anthropic Claude model supports prompt caching.
|
|
195
|
+
*
|
|
196
|
+
* This uses the configured model ID directly. Resolving it through a token
|
|
197
|
+
* map first can collapse a newly released Claude model to the generic
|
|
198
|
+
* `claude-` fallback and incorrectly disable cache control.
|
|
199
|
+
*/
|
|
200
|
+
function supportsPromptCache(model) {
|
|
201
|
+
if (model.includes("claude-3-5-sonnet-latest") || model.includes("claude-3.5-sonnet-latest")) return false;
|
|
202
|
+
return /claude-3[-.]7/.test(model) || /claude-3[-.]5-(?:sonnet|haiku)/.test(model) || /claude-3-(?:sonnet|haiku|opus)?/.test(model) || /claude-(?:sonnet|opus|haiku)[-.]?(?:[4-9]|\d{2,})/.test(model) || /claude-(?:[4-9]|\d{2,})(?:[-.](?:sonnet|opus|haiku))?/.test(model) || require_data_service.isMythosClassModel(model);
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
193
205
|
* A Bedrock Claude model ID may be prefixed (`anthropic.claude-*`,
|
|
194
206
|
* `us.anthropic.claude-*`, `global.anthropic.claude-*`) or bare (`claude-*`,
|
|
195
207
|
* used when the LibreChat model ID maps to an application inference profile).
|
|
@@ -644,11 +656,14 @@ let StepEvents = /* @__PURE__ */ function(StepEvents) {
|
|
|
644
656
|
StepEvents["ON_REASONING_DELTA"] = "on_reasoning_delta";
|
|
645
657
|
StepEvents["ON_RUN_STEP_DELTA"] = "on_run_step_delta";
|
|
646
658
|
StepEvents["ON_RUN_STEP_COMPLETED"] = "on_run_step_completed";
|
|
659
|
+
/** Terminal signal for a run step: closed with a status and timestamps. */
|
|
660
|
+
StepEvents["ON_RUN_STEP_CLOSED"] = "on_run_step_closed";
|
|
647
661
|
StepEvents["ON_SUMMARIZE_START"] = "on_summarize_start";
|
|
648
662
|
StepEvents["ON_SUMMARIZE_DELTA"] = "on_summarize_delta";
|
|
649
663
|
StepEvents["ON_SUMMARIZE_COMPLETE"] = "on_summarize_complete";
|
|
650
664
|
StepEvents["ON_SUBAGENT_UPDATE"] = "on_subagent_update";
|
|
651
665
|
StepEvents["ON_SANDBOX_STARTING"] = "on_sandbox_starting";
|
|
666
|
+
StepEvents["ON_PTC_TOOL_CALL"] = "on_ptc_tool_call";
|
|
652
667
|
return StepEvents;
|
|
653
668
|
}({});
|
|
654
669
|
/** Token-tracking event names streamed to the client (separate from StepEvents dispatch). */
|
|
@@ -689,6 +704,13 @@ let ActivityLabelEvents = /* @__PURE__ */ function(ActivityLabelEvents) {
|
|
|
689
704
|
ActivityLabelEvents["ON_ACTIVITY_LABEL"] = "on_activity_label";
|
|
690
705
|
return ActivityLabelEvents;
|
|
691
706
|
}({});
|
|
707
|
+
/** Live title updates for an existing reasoning content part. */
|
|
708
|
+
let ReasoningLabelEvents = /* @__PURE__ */ function(ReasoningLabelEvents) {
|
|
709
|
+
ReasoningLabelEvents["ON_REASONING_LABEL"] = "on_reasoning_label";
|
|
710
|
+
/** Internal durable budget reservation; clients intentionally do not render it. */
|
|
711
|
+
ReasoningLabelEvents["ON_REASONING_LABEL_ATTEMPT"] = "on_reasoning_label_attempt";
|
|
712
|
+
return ReasoningLabelEvents;
|
|
713
|
+
}({});
|
|
692
714
|
/**
|
|
693
715
|
* Full prompt token count for one completed model call — the EXACT context the
|
|
694
716
|
* model saw, provider-aware: additive providers (Bedrock) report `input_tokens`
|
|
@@ -964,6 +986,14 @@ function replaceSpecialVars({ text, user, now: inputNow, timezone }) {
|
|
|
964
986
|
return result;
|
|
965
987
|
}
|
|
966
988
|
/**
|
|
989
|
+
* Resolves the display label ("sender") for an ephemeral agent:
|
|
990
|
+
* `modelLabel` (user/preset) → model spec's `label` → endpoint config's
|
|
991
|
+
* `modelDisplayLabel` → `''` (lets consumers fall back to the model name).
|
|
992
|
+
*/
|
|
993
|
+
function getEphemeralSender({ modelLabel, specLabel, modelDisplayLabel }) {
|
|
994
|
+
return modelLabel ?? specLabel ?? modelDisplayLabel ?? "";
|
|
995
|
+
}
|
|
996
|
+
/**
|
|
967
997
|
* Encodes an ephemeral agent ID from endpoint, model, optional sender, and optional index.
|
|
968
998
|
* Uses __ to replace : (reserved in graph node names) and ___ to separate sender.
|
|
969
999
|
*
|
|
@@ -1255,7 +1285,106 @@ function mapGroupToAzureConfig({ groupName, groupMap }) {
|
|
|
1255
1285
|
return result;
|
|
1256
1286
|
}
|
|
1257
1287
|
//#endregion
|
|
1288
|
+
//#region src/langchain.ts
|
|
1289
|
+
/**
|
|
1290
|
+
* LangChain classifies a provider failure by mutating the error: it stamps `lc_error_code` and
|
|
1291
|
+
* appends `\n\nTroubleshooting URL: <docs url>\n` to the message. Both halves are handled here
|
|
1292
|
+
* because the server strips the URL before persisting the message, while the client still reads the
|
|
1293
|
+
* code back out of messages persisted before it did.
|
|
1294
|
+
*/
|
|
1295
|
+
const LANGCHAIN = "langchain";
|
|
1296
|
+
const ERROR_PATH = "/errors/";
|
|
1297
|
+
const TROUBLESHOOTING_LABEL = "Troubleshooting URL:";
|
|
1298
|
+
const WHITESPACE = /\s/;
|
|
1299
|
+
/** Provider errors cross untyped boundaries, so a `message` is not guaranteed to be a string. */
|
|
1300
|
+
function toMessageText(message) {
|
|
1301
|
+
if (typeof message === "string") return message;
|
|
1302
|
+
return message == null ? "" : String(message);
|
|
1303
|
+
}
|
|
1304
|
+
function isErrorCodeCharacter(character) {
|
|
1305
|
+
const code = character.charCodeAt(0);
|
|
1306
|
+
return character === "_" || code >= 65 && code <= 90 || code >= 97 && code <= 122;
|
|
1307
|
+
}
|
|
1308
|
+
function findTokenEnd(text, start, limit = text.length) {
|
|
1309
|
+
let end = start;
|
|
1310
|
+
while (end < limit && !WHITESPACE.test(text[end])) end += 1;
|
|
1311
|
+
return end;
|
|
1312
|
+
}
|
|
1313
|
+
function findErrorCode(text, searchableText, start, end) {
|
|
1314
|
+
const langChainIndex = searchableText.indexOf(LANGCHAIN, start);
|
|
1315
|
+
if (langChainIndex < 0 || langChainIndex >= end) return;
|
|
1316
|
+
let errorCode;
|
|
1317
|
+
let pathIndex = searchableText.indexOf(ERROR_PATH, langChainIndex + 9);
|
|
1318
|
+
while (pathIndex >= 0 && pathIndex < end) {
|
|
1319
|
+
const codeStart = pathIndex + 8;
|
|
1320
|
+
let codeEnd = codeStart;
|
|
1321
|
+
while (codeEnd < end && isErrorCodeCharacter(text[codeEnd])) codeEnd += 1;
|
|
1322
|
+
if (codeEnd > codeStart) errorCode = {
|
|
1323
|
+
start: codeStart,
|
|
1324
|
+
end: codeEnd
|
|
1325
|
+
};
|
|
1326
|
+
pathIndex = searchableText.indexOf(ERROR_PATH, Math.max(codeStart, codeEnd));
|
|
1327
|
+
}
|
|
1328
|
+
return errorCode;
|
|
1329
|
+
}
|
|
1330
|
+
/** Removes LangChain's appended docs URL so provider text carries no third-party attribution. */
|
|
1331
|
+
function stripLangChainTroubleshootingUrl(message) {
|
|
1332
|
+
const text = toMessageText(message);
|
|
1333
|
+
const parts = [];
|
|
1334
|
+
let copiedUntil = 0;
|
|
1335
|
+
let searchFrom = 0;
|
|
1336
|
+
while (searchFrom < text.length) {
|
|
1337
|
+
const labelStart = text.indexOf(TROUBLESHOOTING_LABEL, searchFrom);
|
|
1338
|
+
if (labelStart < 0) break;
|
|
1339
|
+
let matchStart = labelStart;
|
|
1340
|
+
while (matchStart > copiedUntil && WHITESPACE.test(text[matchStart - 1])) matchStart -= 1;
|
|
1341
|
+
let urlStart = labelStart + 20;
|
|
1342
|
+
while (urlStart < text.length && WHITESPACE.test(text[urlStart])) urlStart += 1;
|
|
1343
|
+
if (!text.startsWith("https://", urlStart) && !text.startsWith("http://", urlStart)) {
|
|
1344
|
+
searchFrom = urlStart;
|
|
1345
|
+
continue;
|
|
1346
|
+
}
|
|
1347
|
+
const urlEnd = findTokenEnd(text, urlStart);
|
|
1348
|
+
const errorCode = findErrorCode(text, text, urlStart, urlEnd);
|
|
1349
|
+
if (errorCode == null) {
|
|
1350
|
+
searchFrom = urlEnd;
|
|
1351
|
+
continue;
|
|
1352
|
+
}
|
|
1353
|
+
let matchEnd = errorCode.end;
|
|
1354
|
+
if (text[matchEnd] === "/") matchEnd += 1;
|
|
1355
|
+
while (matchEnd < text.length && WHITESPACE.test(text[matchEnd])) matchEnd += 1;
|
|
1356
|
+
parts.push(text.slice(copiedUntil, matchStart), " ");
|
|
1357
|
+
copiedUntil = matchEnd;
|
|
1358
|
+
searchFrom = matchEnd;
|
|
1359
|
+
}
|
|
1360
|
+
parts.push(text.slice(copiedUntil));
|
|
1361
|
+
return parts.join("").trim();
|
|
1362
|
+
}
|
|
1363
|
+
/** The classification LangChain encoded in the docs URL it appended, when the text carries one. */
|
|
1364
|
+
function parseLangChainErrorCode(message) {
|
|
1365
|
+
const text = toMessageText(message);
|
|
1366
|
+
const searchableText = text.toLowerCase();
|
|
1367
|
+
let searchFrom = 0;
|
|
1368
|
+
while (searchFrom < text.length) {
|
|
1369
|
+
const langChainIndex = searchableText.indexOf(LANGCHAIN, searchFrom);
|
|
1370
|
+
if (langChainIndex < 0) return;
|
|
1371
|
+
const tokenEnd = findTokenEnd(text, langChainIndex);
|
|
1372
|
+
const errorCode = findErrorCode(text, searchableText, langChainIndex, tokenEnd);
|
|
1373
|
+
if (errorCode != null) return text.slice(errorCode.start, errorCode.end).toUpperCase();
|
|
1374
|
+
searchFrom = tokenEnd + 1;
|
|
1375
|
+
}
|
|
1376
|
+
}
|
|
1377
|
+
//#endregion
|
|
1258
1378
|
//#region src/messages.ts
|
|
1379
|
+
/** A generated reasoning title describes the text as it existed at generation time.
|
|
1380
|
+
* Any manual edit or merge into a different reasoning step invalidates the entire
|
|
1381
|
+
* title revision domain while preserving unrelated content metadata. */
|
|
1382
|
+
function stripReasoningLabelMetadata(part) {
|
|
1383
|
+
if (part.type !== "think") return part;
|
|
1384
|
+
const { reasoning_label: _label, reasoning_label_step_id: _stepId, reasoning_label_attempts: _attempts, reasoning_label_submitted_chars: _submittedChars, reasoning_label_revision: _revision, reasoning_label_status: _status, ...unlabeledPart } = part;
|
|
1385
|
+
return unlabeledPart;
|
|
1386
|
+
}
|
|
1387
|
+
const treeCache = /* @__PURE__ */ new WeakMap();
|
|
1259
1388
|
/**
|
|
1260
1389
|
* Builds the render tree from the flat messages array. Order-robust: live
|
|
1261
1390
|
* stream/steer/preempt cache writes can momentarily place a child before its
|
|
@@ -1266,6 +1395,11 @@ function mapGroupToAzureConfig({ groupName, groupMap }) {
|
|
|
1266
1395
|
*/
|
|
1267
1396
|
function buildTree({ messages, fileMap }) {
|
|
1268
1397
|
if (messages === null) return null;
|
|
1398
|
+
const cached = treeCache.get(messages);
|
|
1399
|
+
if (cached) {
|
|
1400
|
+
if (fileMap == null && cached.bare) return cached.bare;
|
|
1401
|
+
if (fileMap != null && cached.fileMap === fileMap && cached.hydrated) return cached.hydrated;
|
|
1402
|
+
}
|
|
1269
1403
|
const messageMap = {};
|
|
1270
1404
|
const orderedMessages = [];
|
|
1271
1405
|
const rootMessages = [];
|
|
@@ -1319,7 +1453,69 @@ function buildTree({ messages, fileMap }) {
|
|
|
1319
1453
|
rootMessages.push(extendedMessage);
|
|
1320
1454
|
assignDepths(extendedMessage);
|
|
1321
1455
|
}
|
|
1322
|
-
|
|
1456
|
+
const tree = rootMessages;
|
|
1457
|
+
const entry = cached ?? {};
|
|
1458
|
+
if (fileMap == null) entry.bare = tree;
|
|
1459
|
+
else {
|
|
1460
|
+
entry.fileMap = fileMap;
|
|
1461
|
+
entry.hydrated = tree;
|
|
1462
|
+
}
|
|
1463
|
+
if (!cached) treeCache.set(messages, entry);
|
|
1464
|
+
return tree;
|
|
1465
|
+
}
|
|
1466
|
+
//#endregion
|
|
1467
|
+
//#region src/runSteps.ts
|
|
1468
|
+
/**
|
|
1469
|
+
* Below this, a duration is noise rather than information: sub-second tool
|
|
1470
|
+
* calls are the common case, and labelling every one of them `· 0.3s` adds a
|
|
1471
|
+
* moving number to the end of most cards without telling the reader anything
|
|
1472
|
+
* they could act on. Callers use {@link isReportableRunStepDuration} rather
|
|
1473
|
+
* than comparing against this directly.
|
|
1474
|
+
*/
|
|
1475
|
+
const MIN_REPORTABLE_RUN_STEP_DURATION_MS = 1e3;
|
|
1476
|
+
/**
|
|
1477
|
+
* Wall-clock duration of a run step, derived from the terminal
|
|
1478
|
+
* `on_run_step_closed` event.
|
|
1479
|
+
*
|
|
1480
|
+
* Returns `undefined` rather than a fallback whenever the value would be a
|
|
1481
|
+
* guess, because a wrong duration is worse than an absent one — an absent one
|
|
1482
|
+
* renders nothing, a wrong one is indistinguishable from a real measurement:
|
|
1483
|
+
*
|
|
1484
|
+
* - `created_at` is optional on the event; emitters that do not know when the
|
|
1485
|
+
* step opened cannot have their duration inferred from anything else.
|
|
1486
|
+
* - A negative result means the two timestamps came from clocks that disagree.
|
|
1487
|
+
* That is not hypothetical: since `@librechat/agents` v3.6.0 a step can be
|
|
1488
|
+
* opened in one process and closed in another after a checkpoint resume, so
|
|
1489
|
+
* the two stamps can legitimately originate on different machines.
|
|
1490
|
+
* - Non-finite input is treated as absent instead of propagating `NaN` into
|
|
1491
|
+
* rendering.
|
|
1492
|
+
*
|
|
1493
|
+
* Known limits, accepted rather than guessed at: only the negative direction
|
|
1494
|
+
* of clock skew is detectable from a single stamp pair — positive skew
|
|
1495
|
+
* inflates the result and cannot be distinguished from a genuinely long
|
|
1496
|
+
* step. And the value is wall-clock elapsed between open and close, so a
|
|
1497
|
+
* step held open across a suspension (a checkpoint resume, a HITL approval
|
|
1498
|
+
* wait) includes that held-open time. Both are properties of the only data
|
|
1499
|
+
* available, not derivation bugs.
|
|
1500
|
+
*/
|
|
1501
|
+
function getRunStepDurationMs(closed) {
|
|
1502
|
+
const { created_at: createdAt, closed_at: closedAt } = closed;
|
|
1503
|
+
if (typeof createdAt !== "number" || typeof closedAt !== "number") return;
|
|
1504
|
+
if (!Number.isFinite(createdAt) || !Number.isFinite(closedAt)) return;
|
|
1505
|
+
const durationMs = closedAt - createdAt;
|
|
1506
|
+
return durationMs >= 0 ? durationMs : void 0;
|
|
1507
|
+
}
|
|
1508
|
+
/**
|
|
1509
|
+
* Whether a derived duration is worth showing to the reader.
|
|
1510
|
+
*
|
|
1511
|
+
* This is a presentation judgment, so it belongs at render time only. The
|
|
1512
|
+
* stamp sites persist the raw {@link getRunStepDurationMs} value instead of
|
|
1513
|
+
* pre-filtering through this — thresholding at write time would bake a
|
|
1514
|
+
* display rule into stored data, making "fast" indistinguishable from "not
|
|
1515
|
+
* derivable" and unrecoverable if the rule ever changes.
|
|
1516
|
+
*/
|
|
1517
|
+
function isReportableRunStepDuration(durationMs) {
|
|
1518
|
+
return typeof durationMs === "number" && durationMs >= 1e3;
|
|
1323
1519
|
}
|
|
1324
1520
|
//#endregion
|
|
1325
1521
|
//#region src/artifacts.ts
|
|
@@ -4492,6 +4688,10 @@ let PermissionTypes = /* @__PURE__ */ function(PermissionTypes) {
|
|
|
4492
4688
|
* Type for Shared Link Permissions
|
|
4493
4689
|
*/
|
|
4494
4690
|
PermissionTypes["SHARED_LINKS"] = "SHARED_LINKS";
|
|
4691
|
+
/**
|
|
4692
|
+
* Type for Scheduled Chats Permissions
|
|
4693
|
+
*/
|
|
4694
|
+
PermissionTypes["SCHEDULES"] = "SCHEDULES";
|
|
4495
4695
|
return PermissionTypes;
|
|
4496
4696
|
}({});
|
|
4497
4697
|
/**
|
|
@@ -4515,11 +4715,20 @@ const PERMISSION_TYPE_INTERFACE_FIELDS = {
|
|
|
4515
4715
|
["MCP_SERVERS"]: "mcpServers",
|
|
4516
4716
|
["REMOTE_AGENTS"]: "remoteAgents",
|
|
4517
4717
|
["SKILLS"]: "skills",
|
|
4518
|
-
["SHARED_LINKS"]: "sharedLinks"
|
|
4718
|
+
["SHARED_LINKS"]: "sharedLinks",
|
|
4719
|
+
["SCHEDULES"]: "schedules"
|
|
4519
4720
|
};
|
|
4520
4721
|
/** Set of interface config field names that correspond to role permissions. */
|
|
4521
4722
|
const INTERFACE_PERMISSION_FIELDS = new Set(Object.values(PERMISSION_TYPE_INTERFACE_FIELDS));
|
|
4522
4723
|
/**
|
|
4724
|
+
* Interface fields that seed a permission (use/create) BUT also carry runtime
|
|
4725
|
+
* config that must survive DB/tenant/user overrides. For these, override
|
|
4726
|
+
* sanitizers strip only the permission sub-keys (use/create) from the object
|
|
4727
|
+
* form and PRESERVE the boolean form — for `schedules`, `interface.schedules: false`
|
|
4728
|
+
* is the runtime feature disable that `getLimits` reads, not a permission toggle.
|
|
4729
|
+
*/
|
|
4730
|
+
const RUNTIME_CONFIG_INTERFACE_FIELDS = new Set(["schedules"]);
|
|
4731
|
+
/**
|
|
4523
4732
|
* YAML sub-keys within composite interface permission fields that map to permission bits.
|
|
4524
4733
|
* When an interface permission field is an object, only these sub-keys are stripped from
|
|
4525
4734
|
* DB overrides — other sub-keys (like `placeholder`, `trustCheckbox`) are UI-only and pass through.
|
|
@@ -4620,6 +4829,10 @@ const skillPermissionsSchema = zod.z.object({
|
|
|
4620
4829
|
["SHARE"]: zod.z.boolean().default(false),
|
|
4621
4830
|
["SHARE_PUBLIC"]: zod.z.boolean().default(false)
|
|
4622
4831
|
});
|
|
4832
|
+
const schedulesPermissionsSchema = zod.z.object({
|
|
4833
|
+
["USE"]: zod.z.boolean().default(true),
|
|
4834
|
+
["CREATE"]: zod.z.boolean().default(true)
|
|
4835
|
+
});
|
|
4623
4836
|
const sharedLinksPermissionsSchema = zod.z.object({
|
|
4624
4837
|
["CREATE"]: zod.z.boolean().default(true),
|
|
4625
4838
|
["SHARE"]: zod.z.boolean().default(true),
|
|
@@ -4641,7 +4854,8 @@ const permissionsSchema = zod.z.object({
|
|
|
4641
4854
|
["MCP_SERVERS"]: mcpServersPermissionsSchema,
|
|
4642
4855
|
["REMOTE_AGENTS"]: remoteAgentsPermissionsSchema,
|
|
4643
4856
|
["SKILLS"]: skillPermissionsSchema,
|
|
4644
|
-
["SHARED_LINKS"]: sharedLinksPermissionsSchema
|
|
4857
|
+
["SHARED_LINKS"]: sharedLinksPermissionsSchema,
|
|
4858
|
+
["SCHEDULES"]: schedulesPermissionsSchema
|
|
4645
4859
|
});
|
|
4646
4860
|
//#endregion
|
|
4647
4861
|
//#region src/roles.ts
|
|
@@ -4722,6 +4936,10 @@ const defaultRolesSchema = zod.z.object({
|
|
|
4722
4936
|
["CREATE"]: zod.z.boolean().default(true),
|
|
4723
4937
|
["SHARE"]: zod.z.boolean().default(true),
|
|
4724
4938
|
["SHARE_PUBLIC"]: zod.z.boolean().default(true)
|
|
4939
|
+
}),
|
|
4940
|
+
["SCHEDULES"]: schedulesPermissionsSchema.extend({
|
|
4941
|
+
["USE"]: zod.z.boolean().default(true),
|
|
4942
|
+
["CREATE"]: zod.z.boolean().default(true)
|
|
4725
4943
|
})
|
|
4726
4944
|
})
|
|
4727
4945
|
}),
|
|
@@ -4795,6 +5013,10 @@ const roleDefaults = defaultRolesSchema.parse({
|
|
|
4795
5013
|
["CREATE"]: true,
|
|
4796
5014
|
["SHARE"]: true,
|
|
4797
5015
|
["SHARE_PUBLIC"]: true
|
|
5016
|
+
},
|
|
5017
|
+
["SCHEDULES"]: {
|
|
5018
|
+
["USE"]: true,
|
|
5019
|
+
["CREATE"]: true
|
|
4798
5020
|
}
|
|
4799
5021
|
}
|
|
4800
5022
|
},
|
|
@@ -4850,6 +5072,10 @@ const roleDefaults = defaultRolesSchema.parse({
|
|
|
4850
5072
|
["CREATE"]: true,
|
|
4851
5073
|
["SHARE"]: true,
|
|
4852
5074
|
["SHARE_PUBLIC"]: true
|
|
5075
|
+
},
|
|
5076
|
+
["SCHEDULES"]: {
|
|
5077
|
+
["USE"]: true,
|
|
5078
|
+
["CREATE"]: true
|
|
4853
5079
|
}
|
|
4854
5080
|
}
|
|
4855
5081
|
}
|
|
@@ -4869,6 +5095,308 @@ let InvocationMode = /* @__PURE__ */ function(InvocationMode) {
|
|
|
4869
5095
|
return InvocationMode;
|
|
4870
5096
|
}({});
|
|
4871
5097
|
//#endregion
|
|
5098
|
+
//#region src/types/schedules.ts
|
|
5099
|
+
/** Cadences the dialog builds from structured pickers (hour, minute, weekday). */
|
|
5100
|
+
const scheduleStructuredFrequencies = [
|
|
5101
|
+
"hourly",
|
|
5102
|
+
"daily",
|
|
5103
|
+
"weekdays",
|
|
5104
|
+
"weekly"
|
|
5105
|
+
];
|
|
5106
|
+
const scheduleFrequencies = [...scheduleStructuredFrequencies, "cron"];
|
|
5107
|
+
/** Bounds a stored expression. Generous for five fields, because each one can hold a
|
|
5108
|
+
* list: an every-minute-of-the-hour cadence spelled out runs past two hundred chars. */
|
|
5109
|
+
const SCHEDULE_CRON_MAX_LENGTH = 256;
|
|
5110
|
+
const scheduleTargets = ["new"];
|
|
5111
|
+
const structuredCadenceSchema = zod.z.object({
|
|
5112
|
+
frequency: zod.z.enum(scheduleStructuredFrequencies),
|
|
5113
|
+
hour: zod.z.number().int().min(0).max(23),
|
|
5114
|
+
minute: zod.z.number().int().min(0).max(59),
|
|
5115
|
+
daysOfWeek: zod.z.array(zod.z.number().int().min(0).max(6)).min(1).max(7).transform((days) => Array.from(new Set(days))).optional()
|
|
5116
|
+
});
|
|
5117
|
+
/**
|
|
5118
|
+
* A raw cron expression carries its own hour and minute, so it cannot share the
|
|
5119
|
+
* structured shape: there is no single `hour` for `0 9,17 * * 1-5`. Syntax is
|
|
5120
|
+
* validated server-side by croner, the same parser the engine fires from, rather
|
|
5121
|
+
* than by a regex that would accept patterns croner then rejects at fire time.
|
|
5122
|
+
*/
|
|
5123
|
+
const cronCadenceSchema = zod.z.object({
|
|
5124
|
+
frequency: zod.z.literal("cron"),
|
|
5125
|
+
expression: zod.z.string().trim().min(1).max(256)
|
|
5126
|
+
});
|
|
5127
|
+
const scheduleCadenceSchema = zod.z.discriminatedUnion("frequency", [structuredCadenceSchema, cronCadenceSchema]);
|
|
5128
|
+
const isCronCadence = (cadence) => cadence.frequency === "cron";
|
|
5129
|
+
const createSchedulePayloadSchema = zod.z.object({
|
|
5130
|
+
name: zod.z.string().trim().min(1).max(256),
|
|
5131
|
+
prompt: zod.z.string().trim().min(1).max(32e3),
|
|
5132
|
+
agent_id: zod.z.string().trim().min(1),
|
|
5133
|
+
cadence: scheduleCadenceSchema,
|
|
5134
|
+
timezone: zod.z.string().min(1),
|
|
5135
|
+
target: zod.z.enum(scheduleTargets).default("new"),
|
|
5136
|
+
file_ids: zod.z.array(zod.z.string()).max(10).transform((ids) => Array.from(new Set(ids))).optional(),
|
|
5137
|
+
/**
|
|
5138
|
+
* Chat project each run's conversation is filed under. `null` clears the scope.
|
|
5139
|
+
* Ownership is checked server-side at write time and again at every fire, so a
|
|
5140
|
+
* deleted project disables the schedule instead of silently filing runs loose.
|
|
5141
|
+
*/
|
|
5142
|
+
chatProjectId: zod.z.string().trim().min(1).nullable().optional(),
|
|
5143
|
+
enabled: zod.z.boolean().default(true),
|
|
5144
|
+
/**
|
|
5145
|
+
* Client-generated key making creation idempotent across retries. Creation commits
|
|
5146
|
+
* the row and arms it in two writes, so a failure between them leaves the client
|
|
5147
|
+
* unable to tell whether anything persisted; retrying blind can produce two recurring
|
|
5148
|
+
* schedules. A retry carrying the same key resolves to the original row instead.
|
|
5149
|
+
* REQUIRED: an optional key preserves the keyless duplicate path for any client
|
|
5150
|
+
* that omits it, which is exactly the failure the key exists to close.
|
|
5151
|
+
*/
|
|
5152
|
+
clientRequestId: zod.z.string().trim().min(1).max(128)
|
|
5153
|
+
});
|
|
5154
|
+
/** Idempotency is a property of the CREATE attempt, not of the schedule's config. */
|
|
5155
|
+
const updateSchedulePayloadSchema = createSchedulePayloadSchema.omit({ clientRequestId: true }).partial().extend({
|
|
5156
|
+
/**
|
|
5157
|
+
* The configRevision the client's edit was computed from (captured when the
|
|
5158
|
+
* dialog opened). The server fences the update on it, so a concurrent edit
|
|
5159
|
+
* from another tab answers 409 instead of being silently overwritten by a
|
|
5160
|
+
* payload rebuilt from a stale snapshot (cadence is sent whole, so the
|
|
5161
|
+
* server-side fresh-read fence alone cannot detect this).
|
|
5162
|
+
*/
|
|
5163
|
+
expectedConfigRevision: zod.z.number().int().min(0).optional() });
|
|
5164
|
+
//#endregion
|
|
5165
|
+
//#region src/cadence.ts
|
|
5166
|
+
/** Mirrors the server default when a weekly cadence omits `daysOfWeek`. */
|
|
5167
|
+
const WEEKLY_DEFAULT_DAY = 1;
|
|
5168
|
+
/**
|
|
5169
|
+
* Minute, hour, day of month, month, day of week. croner also reads a six-field form
|
|
5170
|
+
* carrying seconds and a seven-field form that pins a year, and both are refused.
|
|
5171
|
+
* Seconds would promise a precision the runtime does not keep: the engine polls on a
|
|
5172
|
+
* thirty-second tick and offsets each schedule by up to two minutes of jitter. A pinned
|
|
5173
|
+
* year makes a cadence that runs out, and every caller here treats "no next occurrence"
|
|
5174
|
+
* as a cadence it cannot read.
|
|
5175
|
+
*/
|
|
5176
|
+
const CRON_FIELD_COUNT = 5;
|
|
5177
|
+
/**
|
|
5178
|
+
* Spring-forward compresses consecutive wall-clock occurrences, so the ENFORCEABLE
|
|
5179
|
+
* minimum for day-and-longer gaps is the nominal gap minus the largest real-world
|
|
5180
|
+
* transition: two hours (Antarctica/Troll; every other zone shifts at most one).
|
|
5181
|
+
* A floor set exactly at the nominal value would otherwise admit a schedule that
|
|
5182
|
+
* genuinely violates it once a year. Hourly gaps are unaffected (the skipped hours
|
|
5183
|
+
* lengthen, never shorten, the gap between occurrences).
|
|
5184
|
+
*/
|
|
5185
|
+
const DST_COMPRESSION_MINUTES = 120;
|
|
5186
|
+
/**
|
|
5187
|
+
* Occurrences sampled when measuring a cron expression's tightest gap. The floor
|
|
5188
|
+
* exists to reject expressions that fire too OFTEN, and a dense pattern reveals
|
|
5189
|
+
* its short gap within the first few occurrences, so a small window answers the
|
|
5190
|
+
* question this guards. Known limit: this is a bounded probe, not the exhaustive
|
|
5191
|
+
* proof the structured formulas give. An expression that is sparse for the next
|
|
5192
|
+
* `CRON_PROBE_OCCURRENCES` runs and dense later would pass here and be caught by
|
|
5193
|
+
* the fire-time recheck instead.
|
|
5194
|
+
*/
|
|
5195
|
+
const CRON_PROBE_OCCURRENCES = 32;
|
|
5196
|
+
/** Enough to span four nominal gaps from an anchor two gaps before a transition,
|
|
5197
|
+
* which is what guarantees the straddling pair falls inside the window. */
|
|
5198
|
+
const TRANSITION_PROBE_OCCURRENCES = 5;
|
|
5199
|
+
/**
|
|
5200
|
+
* Compiles a cadence to the cron expression the engine fires from. Shared rather
|
|
5201
|
+
* than server-owned because the dialog previews the next runs, validates the
|
|
5202
|
+
* interval floor, and disables its own submit from these same functions: a second
|
|
5203
|
+
* client-side implementation would drift and either show run times the schedule
|
|
5204
|
+
* does not keep or accept a cadence the server then rejects.
|
|
5205
|
+
*/
|
|
5206
|
+
function cadenceToCron(cadence) {
|
|
5207
|
+
if (cadence.frequency === "cron") return cadence.expression;
|
|
5208
|
+
const { frequency, hour, minute } = cadence;
|
|
5209
|
+
if (frequency === "hourly") return `${minute} * * * *`;
|
|
5210
|
+
if (frequency === "daily") return `${minute} ${hour} * * *`;
|
|
5211
|
+
if (frequency === "weekdays") return `${minute} ${hour} * * 1-5`;
|
|
5212
|
+
return `${minute} ${hour} * * ${[...cadence.daysOfWeek?.length ? cadence.daysOfWeek : [WEEKLY_DEFAULT_DAY]].sort((a, b) => a - b).join(",")}`;
|
|
5213
|
+
}
|
|
5214
|
+
/**
|
|
5215
|
+
* Everything `cronCadenceSchema` will accept: exactly five fields, within the length
|
|
5216
|
+
* the schema stores, and actually matching at some point. croner accepts syntactically
|
|
5217
|
+
* valid patterns that can never match (`0 0 30 2 *`), and those would arm a schedule
|
|
5218
|
+
* that never fires. Validated with croner rather than a regex, because a regex would
|
|
5219
|
+
* accept patterns croner then rejects at fire time.
|
|
5220
|
+
*
|
|
5221
|
+
* A five-field expression that matches at all matches forever, which is what lets every
|
|
5222
|
+
* caller keep reading "no next occurrence" as "this cadence is unreadable".
|
|
5223
|
+
*/
|
|
5224
|
+
function isValidCronExpression(expression, timezone) {
|
|
5225
|
+
const trimmed = expression.trim();
|
|
5226
|
+
if (trimmed.length > 256) return false;
|
|
5227
|
+
if (trimmed.split(/\s+/).length !== CRON_FIELD_COUNT) return false;
|
|
5228
|
+
try {
|
|
5229
|
+
return new croner.Cron(trimmed, {
|
|
5230
|
+
timezone,
|
|
5231
|
+
paused: true
|
|
5232
|
+
}).nextRun() != null;
|
|
5233
|
+
} catch {
|
|
5234
|
+
return false;
|
|
5235
|
+
}
|
|
5236
|
+
}
|
|
5237
|
+
/**
|
|
5238
|
+
* The next occurrences the engine would fire. Server-side jitter (up to two
|
|
5239
|
+
* minutes) is deliberately not modelled: it is keyed off a schedule id that does
|
|
5240
|
+
* not exist yet at create time, and showing 9:01 for a 9:00 schedule reads as a bug.
|
|
5241
|
+
*/
|
|
5242
|
+
function nextRunInstants(cadence, timezone, count) {
|
|
5243
|
+
try {
|
|
5244
|
+
const runs = new croner.Cron(cadenceToCron(cadence), {
|
|
5245
|
+
timezone,
|
|
5246
|
+
paused: true
|
|
5247
|
+
}).nextRuns(count);
|
|
5248
|
+
return runs.filter((run, index) => index === 0 || run.getTime() !== runs[index - 1].getTime());
|
|
5249
|
+
} catch {
|
|
5250
|
+
return [];
|
|
5251
|
+
}
|
|
5252
|
+
}
|
|
5253
|
+
const MINUTE_MS = 6e4;
|
|
5254
|
+
const DAY_MS = 1440 * MINUTE_MS;
|
|
5255
|
+
/** A year and a bit, so a zone with a single yearly transition always shows one. */
|
|
5256
|
+
const TRANSITION_SEARCH_DAYS = 400;
|
|
5257
|
+
const offsetFormatters = /* @__PURE__ */ new Map();
|
|
5258
|
+
/** Minutes east of UTC in `zone` at `instant`, read back from the wall clock the
|
|
5259
|
+
* zone renders. The only way to observe a zone's offset without a tz database. */
|
|
5260
|
+
function zoneOffsetMinutes(zone, instant) {
|
|
5261
|
+
let formatter = offsetFormatters.get(zone);
|
|
5262
|
+
if (formatter == null) {
|
|
5263
|
+
formatter = new Intl.DateTimeFormat("en-US", {
|
|
5264
|
+
timeZone: zone,
|
|
5265
|
+
hourCycle: "h23",
|
|
5266
|
+
year: "numeric",
|
|
5267
|
+
month: "2-digit",
|
|
5268
|
+
day: "2-digit",
|
|
5269
|
+
hour: "2-digit",
|
|
5270
|
+
minute: "2-digit",
|
|
5271
|
+
second: "2-digit"
|
|
5272
|
+
});
|
|
5273
|
+
offsetFormatters.set(zone, formatter);
|
|
5274
|
+
}
|
|
5275
|
+
const parts = {};
|
|
5276
|
+
for (const part of formatter.formatToParts(instant)) parts[part.type] = part.value;
|
|
5277
|
+
const wallClock = Date.UTC(Number(parts.year), Number(parts.month) - 1, Number(parts.day), Number(parts.hour), Number(parts.minute), Number(parts.second));
|
|
5278
|
+
return Math.round((wallClock - instant.getTime()) / MINUTE_MS);
|
|
5279
|
+
}
|
|
5280
|
+
/** Zone transitions are asked for once per fire, and the scan below costs ~10ms.
|
|
5281
|
+
* Keyed by day because that is how far the answer stays put as the window slides,
|
|
5282
|
+
* and cleared wholesale at the cap so a long-lived worker cannot accumulate an
|
|
5283
|
+
* entry per zone per day forever. */
|
|
5284
|
+
const transitionCache = /* @__PURE__ */ new Map();
|
|
5285
|
+
const TRANSITION_CACHE_MAX = 512;
|
|
5286
|
+
/**
|
|
5287
|
+
* Every instant `zone` changes its UTC offset within the search window; empty for a
|
|
5288
|
+
* fixed-offset zone. Both directions matter and only one of them shortens anything,
|
|
5289
|
+
* so taking just the next one would usually find the harmless fall-back and miss the
|
|
5290
|
+
* spring-forward six months behind it. Bracketed a day at a time, bisected to the
|
|
5291
|
+
* minute.
|
|
5292
|
+
*/
|
|
5293
|
+
function offsetChanges(zone, from) {
|
|
5294
|
+
const day = Math.floor(from.getTime() / DAY_MS);
|
|
5295
|
+
const cacheKey = `${zone}:${day}`;
|
|
5296
|
+
const cached = transitionCache.get(cacheKey);
|
|
5297
|
+
if (cached != null) return cached;
|
|
5298
|
+
const changes = [];
|
|
5299
|
+
const start = /* @__PURE__ */ new Date((day - 1) * DAY_MS);
|
|
5300
|
+
let low = start.getTime();
|
|
5301
|
+
let baseOffset = zoneOffsetMinutes(zone, start);
|
|
5302
|
+
const end = low + TRANSITION_SEARCH_DAYS * DAY_MS;
|
|
5303
|
+
for (let probe = low + DAY_MS; probe <= end; probe += DAY_MS) {
|
|
5304
|
+
const offset = zoneOffsetMinutes(zone, new Date(probe));
|
|
5305
|
+
if (offset !== baseOffset) {
|
|
5306
|
+
let high = probe;
|
|
5307
|
+
let bracket = low;
|
|
5308
|
+
while (high - bracket > MINUTE_MS) {
|
|
5309
|
+
const mid = bracket + Math.floor((high - bracket) / 2);
|
|
5310
|
+
if (zoneOffsetMinutes(zone, new Date(mid)) === baseOffset) bracket = mid;
|
|
5311
|
+
else high = mid;
|
|
5312
|
+
}
|
|
5313
|
+
changes.push(new Date(high));
|
|
5314
|
+
baseOffset = offset;
|
|
5315
|
+
}
|
|
5316
|
+
low = probe;
|
|
5317
|
+
}
|
|
5318
|
+
if (transitionCache.size >= TRANSITION_CACHE_MAX) transitionCache.clear();
|
|
5319
|
+
transitionCache.set(cacheKey, changes);
|
|
5320
|
+
return changes;
|
|
5321
|
+
}
|
|
5322
|
+
function runsAfter(expression, from, zone, occurrences = CRON_PROBE_OCCURRENCES) {
|
|
5323
|
+
return new croner.Cron(expression, {
|
|
5324
|
+
timezone: zone,
|
|
5325
|
+
paused: true
|
|
5326
|
+
}).nextRuns(occurrences, from);
|
|
5327
|
+
}
|
|
5328
|
+
/** Tightest gap, in minutes, across `runs`; null when there is no pair to measure. */
|
|
5329
|
+
function minGapMinutes(runs) {
|
|
5330
|
+
if (runs.length < 2) return null;
|
|
5331
|
+
let minGapMs = Number.MAX_SAFE_INTEGER;
|
|
5332
|
+
for (let i = 1; i < runs.length; i++) {
|
|
5333
|
+
const gapMs = runs[i].getTime() - runs[i - 1].getTime();
|
|
5334
|
+
if (gapMs <= 0) continue;
|
|
5335
|
+
minGapMs = Math.min(minGapMs, gapMs);
|
|
5336
|
+
}
|
|
5337
|
+
if (minGapMs === Number.MAX_SAFE_INTEGER) return null;
|
|
5338
|
+
return Math.floor(minGapMs / MINUTE_MS);
|
|
5339
|
+
}
|
|
5340
|
+
function probeMinGapMinutes(expression, zone, from, occurrences = CRON_PROBE_OCCURRENCES) {
|
|
5341
|
+
return minGapMinutes(runsAfter(expression, from, zone, occurrences));
|
|
5342
|
+
}
|
|
5343
|
+
/**
|
|
5344
|
+
* Smallest gap in minutes between occurrences. Returns 0 for an unparseable or
|
|
5345
|
+
* never-matching expression so every floor rejects it, failing closed rather than
|
|
5346
|
+
* admitting an expression the engine cannot fire.
|
|
5347
|
+
*
|
|
5348
|
+
* Measured twice, and the smaller wins:
|
|
5349
|
+
*
|
|
5350
|
+
* 1. Nominal, probed in UTC, then discounted by the same worst-case DST allowance
|
|
5351
|
+
* the structured branches assume. This keeps `0 9 * * *` reporting exactly what
|
|
5352
|
+
* the Daily preset reports, so the same schedule cannot be admitted in one form
|
|
5353
|
+
* and rejected in the other.
|
|
5354
|
+
* 2. Real elapsed time in the schedule's own zone, across each of that zone's
|
|
5355
|
+
* transitions. Spring-forward compresses a gap that straddles one
|
|
5356
|
+
* (`0 0,12 * * *` in America/New_York is 11 hours that day, not 12), and step 1
|
|
5357
|
+
* only discounts gaps of a day or more, so a subdaily gap needs measuring rather
|
|
5358
|
+
* than estimating. Anchoring at the transition is what makes a bounded probe see
|
|
5359
|
+
* it at all: from today it is usually months outside any reasonable window.
|
|
5360
|
+
*/
|
|
5361
|
+
function cronIntervalMinutes(expression, timezone) {
|
|
5362
|
+
try {
|
|
5363
|
+
const now = /* @__PURE__ */ new Date();
|
|
5364
|
+
const nominal = probeMinGapMinutes(expression, "UTC", now);
|
|
5365
|
+
if (nominal == null) return 0;
|
|
5366
|
+
const estimate = nominal < 1440 ? nominal : Math.max(0, nominal - DST_COMPRESSION_MINUTES);
|
|
5367
|
+
if (timezone == null || estimate === 0) return estimate;
|
|
5368
|
+
const anchorBackMs = 2 * Math.max(nominal, 1) * MINUTE_MS;
|
|
5369
|
+
let smallest = estimate;
|
|
5370
|
+
for (const transition of offsetChanges(timezone, now)) {
|
|
5371
|
+
const measured = probeMinGapMinutes(expression, timezone, new Date(Math.max(now.getTime(), transition.getTime() - anchorBackMs)), TRANSITION_PROBE_OCCURRENCES);
|
|
5372
|
+
if (measured != null) smallest = Math.min(smallest, measured);
|
|
5373
|
+
}
|
|
5374
|
+
return smallest;
|
|
5375
|
+
} catch {
|
|
5376
|
+
return 0;
|
|
5377
|
+
}
|
|
5378
|
+
}
|
|
5379
|
+
/**
|
|
5380
|
+
* Minimum minutes between occurrences, for the admin interval floor. `timezone` is
|
|
5381
|
+
* the schedule's own; passing it lets the cron branch measure a DST-compressed gap
|
|
5382
|
+
* instead of estimating one. The structured branches are zone-independent: their
|
|
5383
|
+
* formulas already carry the worst-case allowance.
|
|
5384
|
+
*/
|
|
5385
|
+
function cadenceIntervalMinutes(cadence, timezone) {
|
|
5386
|
+
if (isCronCadence(cadence)) return cronIntervalMinutes(cadence.expression, timezone);
|
|
5387
|
+
if (cadence.frequency === "hourly") return 60;
|
|
5388
|
+
if (cadence.frequency === "daily" || cadence.frequency === "weekdays") return 1440 - DST_COMPRESSION_MINUTES;
|
|
5389
|
+
const days = cadence.daysOfWeek?.length ? Array.from(new Set(cadence.daysOfWeek)) : [WEEKLY_DEFAULT_DAY];
|
|
5390
|
+
if (days.length <= 1) return 10080 - DST_COMPRESSION_MINUTES;
|
|
5391
|
+
const sorted = [...days].sort((a, b) => a - b);
|
|
5392
|
+
let minGapDays = 7;
|
|
5393
|
+
for (let i = 0; i < sorted.length; i++) {
|
|
5394
|
+
const gap = i + 1 < sorted.length ? sorted[i + 1] - sorted[i] : 7 - sorted[i] + sorted[0];
|
|
5395
|
+
minGapDays = Math.min(minGapDays, gap);
|
|
5396
|
+
}
|
|
5397
|
+
return minGapDays * 24 * 60 - DST_COMPRESSION_MINUTES;
|
|
5398
|
+
}
|
|
5399
|
+
//#endregion
|
|
4872
5400
|
//#region src/types/skills.ts
|
|
4873
5401
|
/**
|
|
4874
5402
|
* Shared skill validation constants — the single source of truth for name,
|
|
@@ -4901,6 +5429,171 @@ let DATE_RANGE = /* @__PURE__ */ function(DATE_RANGE) {
|
|
|
4901
5429
|
return DATE_RANGE;
|
|
4902
5430
|
}({});
|
|
4903
5431
|
//#endregion
|
|
5432
|
+
//#region src/types/insights.ts
|
|
5433
|
+
const INSIGHTS_MAX_RANGE_DAYS = 30;
|
|
5434
|
+
const INSIGHTS_SEARCH_MIN_LENGTH = 3;
|
|
5435
|
+
const INSIGHTS_SEARCH_MAX_LENGTH = 200;
|
|
5436
|
+
//#endregion
|
|
5437
|
+
//#region src/types/queuedTurns.ts
|
|
5438
|
+
const agentQueuedTurnStatuses = [
|
|
5439
|
+
"queued",
|
|
5440
|
+
"claimed",
|
|
5441
|
+
"admitted",
|
|
5442
|
+
"cancelled",
|
|
5443
|
+
"dead"
|
|
5444
|
+
];
|
|
5445
|
+
const agentQueuedTurnDurability = ["process_local", "durable"];
|
|
5446
|
+
const agentQueuedTurnFileRefSchema = zod.z.object({
|
|
5447
|
+
file_id: zod.z.string().trim().min(1),
|
|
5448
|
+
type: zod.z.string().optional(),
|
|
5449
|
+
filepath: zod.z.string().optional(),
|
|
5450
|
+
filename: zod.z.string().optional(),
|
|
5451
|
+
height: zod.z.number().optional(),
|
|
5452
|
+
width: zod.z.number().optional(),
|
|
5453
|
+
bytes: zod.z.number().nonnegative().optional()
|
|
5454
|
+
});
|
|
5455
|
+
const enqueueAgentQueuedTurnSchema = zod.z.object({
|
|
5456
|
+
conversationId: zod.z.string().trim().min(1),
|
|
5457
|
+
parentMessageId: zod.z.string().trim().min(1),
|
|
5458
|
+
clientRequestId: zod.z.string().trim().min(1).max(128),
|
|
5459
|
+
text: zod.z.string(),
|
|
5460
|
+
files: zod.z.array(agentQueuedTurnFileRefSchema).optional(),
|
|
5461
|
+
quotes: zod.z.array(zod.z.string()).optional(),
|
|
5462
|
+
manualSkills: zod.z.array(zod.z.string().trim().min(1)).optional(),
|
|
5463
|
+
priority: zod.z.boolean().optional(),
|
|
5464
|
+
expectedPredecessorCreatedAt: zod.z.number().int().nonnegative().optional()
|
|
5465
|
+
});
|
|
5466
|
+
const listAgentQueuedTurnsSchema = zod.z.object({
|
|
5467
|
+
conversationId: zod.z.string().trim().min(1),
|
|
5468
|
+
clientRequestIds: zod.z.array(zod.z.string().trim().min(1).max(128)).max(100).transform((ids) => Array.from(new Set(ids))).optional()
|
|
5469
|
+
});
|
|
5470
|
+
const cancelAgentQueuedTurnSchema = zod.z.object({ queuedTurnId: zod.z.string().trim().min(1) });
|
|
5471
|
+
const agentQueuedTurnReceiptSchema = enqueueAgentQueuedTurnSchema.extend({
|
|
5472
|
+
queuedTurnId: zod.z.string().trim().min(1),
|
|
5473
|
+
status: zod.z.enum(agentQueuedTurnStatuses),
|
|
5474
|
+
/** Effective generation boundary consumed by an admitted turn. This can
|
|
5475
|
+
* advance beyond the originally captured root as queued turns chain. */
|
|
5476
|
+
effectivePredecessorCreatedAt: zod.z.number().int().nonnegative().optional(),
|
|
5477
|
+
/** Explicitly proves that this admission consumed no predecessor boundary. */
|
|
5478
|
+
rootPredecessor: zod.z.literal(true).optional(),
|
|
5479
|
+
position: zod.z.number().int().nonnegative().optional(),
|
|
5480
|
+
/** Immutable queue sequence retained as `revision` for wire compatibility. */
|
|
5481
|
+
revision: zod.z.number().int().nonnegative(),
|
|
5482
|
+
failure: zod.z.object({
|
|
5483
|
+
code: zod.z.string().trim().min(1).max(128),
|
|
5484
|
+
message: zod.z.string().max(2048).optional()
|
|
5485
|
+
}).optional(),
|
|
5486
|
+
createdAt: zod.z.string(),
|
|
5487
|
+
updatedAt: zod.z.string()
|
|
5488
|
+
});
|
|
5489
|
+
const agentQueuedTurnCapabilitySchema = zod.z.discriminatedUnion("supported", [zod.z.object({ supported: zod.z.literal(false) }), zod.z.object({
|
|
5490
|
+
supported: zod.z.literal(true),
|
|
5491
|
+
durability: zod.z.enum(agentQueuedTurnDurability)
|
|
5492
|
+
})]);
|
|
5493
|
+
const enqueueAgentQueuedTurnResponseSchema = zod.z.object({
|
|
5494
|
+
receipt: agentQueuedTurnReceiptSchema,
|
|
5495
|
+
capability: agentQueuedTurnCapabilitySchema
|
|
5496
|
+
});
|
|
5497
|
+
const listAgentQueuedTurnsResponseSchema = zod.z.object({
|
|
5498
|
+
queuedTurns: zod.z.array(agentQueuedTurnReceiptSchema),
|
|
5499
|
+
capability: agentQueuedTurnCapabilitySchema,
|
|
5500
|
+
revision: zod.z.number().int().nonnegative()
|
|
5501
|
+
});
|
|
5502
|
+
const cancelAgentQueuedTurnResponseSchema = zod.z.object({ receipt: agentQueuedTurnReceiptSchema });
|
|
5503
|
+
//#endregion
|
|
5504
|
+
//#region src/providers.ts
|
|
5505
|
+
/** Canonical provider identity used for branding across client and server. */
|
|
5506
|
+
let ProviderId = /* @__PURE__ */ function(ProviderId) {
|
|
5507
|
+
ProviderId["openai"] = "openai";
|
|
5508
|
+
ProviderId["anthropic"] = "anthropic";
|
|
5509
|
+
ProviderId["google"] = "google";
|
|
5510
|
+
ProviderId["azure"] = "azure";
|
|
5511
|
+
ProviderId["bedrock"] = "bedrock";
|
|
5512
|
+
ProviderId["xai"] = "xai";
|
|
5513
|
+
ProviderId["moonshot"] = "moonshot";
|
|
5514
|
+
ProviderId["anyscale"] = "anyscale";
|
|
5515
|
+
ProviderId["apipie"] = "apipie";
|
|
5516
|
+
ProviderId["cohere"] = "cohere";
|
|
5517
|
+
ProviderId["deepseek"] = "deepseek";
|
|
5518
|
+
ProviderId["fireworks"] = "fireworks";
|
|
5519
|
+
ProviderId["groq"] = "groq";
|
|
5520
|
+
ProviderId["helicone"] = "helicone";
|
|
5521
|
+
ProviderId["huggingface"] = "huggingface";
|
|
5522
|
+
ProviderId["mistral"] = "mistral";
|
|
5523
|
+
ProviderId["mlx"] = "mlx";
|
|
5524
|
+
ProviderId["ollama"] = "ollama";
|
|
5525
|
+
ProviderId["openrouter"] = "openrouter";
|
|
5526
|
+
ProviderId["perplexity"] = "perplexity";
|
|
5527
|
+
ProviderId["qwen"] = "qwen";
|
|
5528
|
+
ProviderId["shuttleai"] = "shuttleai";
|
|
5529
|
+
ProviderId["together"] = "together";
|
|
5530
|
+
ProviderId["unify"] = "unify";
|
|
5531
|
+
ProviderId["vercel"] = "vercel";
|
|
5532
|
+
return ProviderId;
|
|
5533
|
+
}({});
|
|
5534
|
+
const endpointToProvider = {
|
|
5535
|
+
["openAI"]: "openai",
|
|
5536
|
+
["azureOpenAI"]: "azure",
|
|
5537
|
+
["anthropic"]: "anthropic",
|
|
5538
|
+
["google"]: "google",
|
|
5539
|
+
["bedrock"]: "bedrock"
|
|
5540
|
+
};
|
|
5541
|
+
const knownEndpointToProvider = {
|
|
5542
|
+
["anyscale"]: "anyscale",
|
|
5543
|
+
["apipie"]: "apipie",
|
|
5544
|
+
["cohere"]: "cohere",
|
|
5545
|
+
["fireworks"]: "fireworks",
|
|
5546
|
+
["deepseek"]: "deepseek",
|
|
5547
|
+
["moonshot"]: "moonshot",
|
|
5548
|
+
["groq"]: "groq",
|
|
5549
|
+
["helicone"]: "helicone",
|
|
5550
|
+
["huggingface"]: "huggingface",
|
|
5551
|
+
["mistral"]: "mistral",
|
|
5552
|
+
["mlx"]: "mlx",
|
|
5553
|
+
["ollama"]: "ollama",
|
|
5554
|
+
["openrouter"]: "openrouter",
|
|
5555
|
+
["perplexity"]: "perplexity",
|
|
5556
|
+
["shuttleai"]: "shuttleai",
|
|
5557
|
+
["together.ai"]: "together",
|
|
5558
|
+
["unify"]: "unify",
|
|
5559
|
+
["vercel"]: "vercel",
|
|
5560
|
+
["xai"]: "xai"
|
|
5561
|
+
};
|
|
5562
|
+
const providerAliases = {
|
|
5563
|
+
chatgpt: "openai",
|
|
5564
|
+
gpt: "openai",
|
|
5565
|
+
azureopenai: "azure",
|
|
5566
|
+
claude: "anthropic",
|
|
5567
|
+
gemini: "google",
|
|
5568
|
+
gemma: "google",
|
|
5569
|
+
vertex: "google",
|
|
5570
|
+
vertexai: "google",
|
|
5571
|
+
palm: "google",
|
|
5572
|
+
awsbedrock: "bedrock",
|
|
5573
|
+
grok: "xai",
|
|
5574
|
+
kimi: "moonshot",
|
|
5575
|
+
moonshotai: "moonshot",
|
|
5576
|
+
mistralai: "mistral",
|
|
5577
|
+
togetherai: "together"
|
|
5578
|
+
};
|
|
5579
|
+
const modelCatalogAliases = { ["vertexai"]: "google" };
|
|
5580
|
+
const normalize = (input) => input.toLowerCase().replace(/[\s._-]/g, "");
|
|
5581
|
+
const providerByNormalizedId = Object.values(ProviderId).reduce((acc, id) => {
|
|
5582
|
+
acc[normalize(id)] = id;
|
|
5583
|
+
return acc;
|
|
5584
|
+
}, {});
|
|
5585
|
+
/** Resolves free-form provider text to a canonical id, ignoring case and separators. */
|
|
5586
|
+
function resolveProviderId(input) {
|
|
5587
|
+
if (!input) return null;
|
|
5588
|
+
const key = normalize(input);
|
|
5589
|
+
return providerByNormalizedId[key] ?? providerAliases[key] ?? null;
|
|
5590
|
+
}
|
|
5591
|
+
/** Resolves a runtime provider to its model catalog, using a native alias only when needed. */
|
|
5592
|
+
function resolveModelCatalogKey(provider, catalogs) {
|
|
5593
|
+
const key = provider ?? "";
|
|
5594
|
+
return catalogs?.[key] != null ? key : modelCatalogAliases[key] ?? key;
|
|
5595
|
+
}
|
|
5596
|
+
//#endregion
|
|
4904
5597
|
//#region src/actions.ts
|
|
4905
5598
|
function sha1(input) {
|
|
4906
5599
|
return crypto.default.createHash("sha1").update(input).digest("hex");
|
|
@@ -5388,7 +6081,9 @@ function createPayload(submission) {
|
|
|
5388
6081
|
const { conversationId } = require_data_service.tConvoUpdateSchema.parse(conversation);
|
|
5389
6082
|
const { endpoint: _e, endpointType } = endpointOption;
|
|
5390
6083
|
const endpoint = _e;
|
|
5391
|
-
|
|
6084
|
+
/** Custom endpoint names are user-defined and may contain `/`, which would
|
|
6085
|
+
* otherwise split into extra path segments and miss the `/:endpoint` route. */
|
|
6086
|
+
let server = `${require_data_service.EndpointURLs["agents"]}/${encodeURIComponent(endpoint)}`;
|
|
5392
6087
|
if (require_data_service.isAssistantsEndpoint(endpoint)) server = require_data_service.EndpointURLs[endpointType ?? endpoint] + (isEdited ? "/modify" : "");
|
|
5393
6088
|
const payload = {
|
|
5394
6089
|
...userMessage,
|
|
@@ -5464,28 +6159,6 @@ const baseDefinitions = {
|
|
|
5464
6159
|
optionType: "conversation",
|
|
5465
6160
|
minTags: 0,
|
|
5466
6161
|
maxTags: 4
|
|
5467
|
-
},
|
|
5468
|
-
imageDetail: {
|
|
5469
|
-
key: "imageDetail",
|
|
5470
|
-
label: "com_endpoint_plug_image_detail",
|
|
5471
|
-
labelCode: true,
|
|
5472
|
-
description: "com_endpoint_openai_detail",
|
|
5473
|
-
descriptionCode: true,
|
|
5474
|
-
type: "enum",
|
|
5475
|
-
default: "auto",
|
|
5476
|
-
component: "slider",
|
|
5477
|
-
options: [
|
|
5478
|
-
"low",
|
|
5479
|
-
"auto",
|
|
5480
|
-
"high"
|
|
5481
|
-
],
|
|
5482
|
-
enumMappings: {
|
|
5483
|
-
["low"]: "com_ui_low",
|
|
5484
|
-
["auto"]: "com_ui_auto",
|
|
5485
|
-
["high"]: "com_ui_high"
|
|
5486
|
-
},
|
|
5487
|
-
optionType: "conversation",
|
|
5488
|
-
columnSpan: 2
|
|
5489
6162
|
}
|
|
5490
6163
|
};
|
|
5491
6164
|
const createDefinition = (base, overrides) => {
|
|
@@ -5543,6 +6216,30 @@ const librechat = {
|
|
|
5543
6216
|
placeholderCode: true,
|
|
5544
6217
|
optionType: "model"
|
|
5545
6218
|
},
|
|
6219
|
+
/** Controls how LibreChat encodes image content blocks, not a provider request
|
|
6220
|
+
* parameter — so it belongs to this group and is stripped from model options. */
|
|
6221
|
+
imageDetail: {
|
|
6222
|
+
key: "imageDetail",
|
|
6223
|
+
label: "com_endpoint_plug_image_detail",
|
|
6224
|
+
labelCode: true,
|
|
6225
|
+
description: "com_endpoint_openai_detail",
|
|
6226
|
+
descriptionCode: true,
|
|
6227
|
+
type: "enum",
|
|
6228
|
+
default: "auto",
|
|
6229
|
+
component: "slider",
|
|
6230
|
+
options: [
|
|
6231
|
+
"low",
|
|
6232
|
+
"auto",
|
|
6233
|
+
"high"
|
|
6234
|
+
],
|
|
6235
|
+
enumMappings: {
|
|
6236
|
+
["low"]: "com_ui_low",
|
|
6237
|
+
["auto"]: "com_ui_auto",
|
|
6238
|
+
["high"]: "com_ui_high"
|
|
6239
|
+
},
|
|
6240
|
+
optionType: "conversation",
|
|
6241
|
+
columnSpan: 2
|
|
6242
|
+
},
|
|
5546
6243
|
fileTokenLimit: {
|
|
5547
6244
|
key: "fileTokenLimit",
|
|
5548
6245
|
label: "com_ui_file_token_limit",
|
|
@@ -6121,6 +6818,14 @@ const meta = {
|
|
|
6121
6818
|
})
|
|
6122
6819
|
};
|
|
6123
6820
|
const google = {
|
|
6821
|
+
/** Bounds the hand-rolled editor enforced through InputNumber, and they stay
|
|
6822
|
+
* scoped to this endpoint: the shared definition is rendered by every other
|
|
6823
|
+
* endpoint, whose own context windows may fall outside them. */
|
|
6824
|
+
maxContextTokens: createDefinition(librechat.maxContextTokens, { range: {
|
|
6825
|
+
min: require_data_service.googleSettings.maxContextTokens.min,
|
|
6826
|
+
max: require_data_service.googleSettings.maxContextTokens.max,
|
|
6827
|
+
step: require_data_service.googleSettings.maxContextTokens.step
|
|
6828
|
+
} }),
|
|
6124
6829
|
temperature: createDefinition(baseDefinitions.temperature, {
|
|
6125
6830
|
default: require_data_service.googleSettings.temperature.default,
|
|
6126
6831
|
range: {
|
|
@@ -6260,7 +6965,7 @@ const google = {
|
|
|
6260
6965
|
const googleConfig = [
|
|
6261
6966
|
librechat.modelLabel,
|
|
6262
6967
|
librechat.promptPrefix,
|
|
6263
|
-
|
|
6968
|
+
google.maxContextTokens,
|
|
6264
6969
|
google.maxOutputTokens,
|
|
6265
6970
|
google.temperature,
|
|
6266
6971
|
google.topP,
|
|
@@ -6279,7 +6984,7 @@ const googleCol1 = [
|
|
|
6279
6984
|
librechat.promptPrefix
|
|
6280
6985
|
];
|
|
6281
6986
|
const googleCol2 = [
|
|
6282
|
-
|
|
6987
|
+
google.maxContextTokens,
|
|
6283
6988
|
google.maxOutputTokens,
|
|
6284
6989
|
google.temperature,
|
|
6285
6990
|
google.topP,
|
|
@@ -6303,7 +7008,7 @@ const openAI = [
|
|
|
6303
7008
|
openAIParams.presence_penalty,
|
|
6304
7009
|
baseDefinitions.stop,
|
|
6305
7010
|
librechat.resendFiles,
|
|
6306
|
-
|
|
7011
|
+
librechat.imageDetail,
|
|
6307
7012
|
openAIParams.web_search,
|
|
6308
7013
|
openAIParams.reasoning_effort,
|
|
6309
7014
|
openAIParams.useResponsesApi,
|
|
@@ -6333,7 +7038,7 @@ const openAICol2 = [
|
|
|
6333
7038
|
openAIParams.presence_penalty,
|
|
6334
7039
|
baseDefinitions.stop,
|
|
6335
7040
|
librechat.resendFiles,
|
|
6336
|
-
|
|
7041
|
+
librechat.imageDetail,
|
|
6337
7042
|
openAIParams.reasoning_effort,
|
|
6338
7043
|
openAIParams.reasoning_summary,
|
|
6339
7044
|
openAIParams.reasoning_mode,
|
|
@@ -6640,13 +7345,71 @@ const agentParamSettings = Object.entries(presetSettings).reduce((acc, [key, val
|
|
|
6640
7345
|
* Resolves model-aware defaults for a settings configuration before rendering.
|
|
6641
7346
|
* Google's `maxOutputTokens` default depends on the selected Gemini model so that
|
|
6642
7347
|
* current models (2.5 and 3+) surface their 64K output limit instead of the legacy 8K value.
|
|
7348
|
+
* Anthropic prompt-cache controls are only surfaced for models that support them.
|
|
6643
7349
|
*/
|
|
6644
7350
|
function applyModelAwareDefaults(settings, endpoint, model) {
|
|
6645
|
-
if (
|
|
6646
|
-
|
|
6647
|
-
|
|
6648
|
-
|
|
6649
|
-
|
|
7351
|
+
if (!model) return settings;
|
|
7352
|
+
const modelAwareSettings = endpoint === "google" ? settings.map((setting) => {
|
|
7353
|
+
if (setting.key === "maxOutputTokens") return {
|
|
7354
|
+
...setting,
|
|
7355
|
+
default: require_data_service.googleSettings.maxOutputTokens.reset(model)
|
|
7356
|
+
};
|
|
7357
|
+
/** The shared thinking budget range is model-agnostic, so it caps Pro below
|
|
7358
|
+
* its real ceiling and accepts Flash values the provider rejects. The
|
|
7359
|
+
* maximum and the positive floor move together. `range.min` stays -1 so
|
|
7360
|
+
* the "decide automatically" sentinel remains typeable. */
|
|
7361
|
+
if (setting.key === "thinkingBudget" && setting.range != null) {
|
|
7362
|
+
const bounds = require_data_service.getGoogleThinkingBudgetBounds(model);
|
|
7363
|
+
if (bounds != null) return {
|
|
7364
|
+
...setting,
|
|
7365
|
+
range: {
|
|
7366
|
+
...setting.range,
|
|
7367
|
+
max: bounds.max,
|
|
7368
|
+
positiveMin: bounds.min,
|
|
7369
|
+
modelSpecific: true
|
|
7370
|
+
}
|
|
7371
|
+
};
|
|
7372
|
+
}
|
|
7373
|
+
return setting;
|
|
7374
|
+
}) : settings;
|
|
7375
|
+
if (endpoint !== "anthropic" || supportsPromptCache(model)) return modelAwareSettings;
|
|
7376
|
+
return modelAwareSettings.filter((setting) => setting.key !== "promptCache" && setting.key !== "promptCacheTtl");
|
|
7377
|
+
}
|
|
7378
|
+
//#endregion
|
|
7379
|
+
//#region src/agentToolOptions.ts
|
|
7380
|
+
const actionDomainSeparatorRegex = /* @__PURE__ */ new RegExp("---", "g");
|
|
7381
|
+
/**
|
|
7382
|
+
* Collapses the encoded-domain suffix of an action tool name to the shape used
|
|
7383
|
+
* by runtime tool definitions. The operation id is deliberately preserved.
|
|
7384
|
+
*/
|
|
7385
|
+
function normalizeActionToolName(toolName) {
|
|
7386
|
+
if (!require_data_service.isActionTool(toolName)) return toolName;
|
|
7387
|
+
const prefixEnd = toolName.lastIndexOf(require_data_service.actionDelimiter) + require_data_service.actionDelimiter.length;
|
|
7388
|
+
const encodedDomain = toolName.slice(prefixEnd);
|
|
7389
|
+
return toolName.slice(0, prefixEnd) + encodedDomain.replace(actionDomainSeparatorRegex, "_");
|
|
7390
|
+
}
|
|
7391
|
+
/**
|
|
7392
|
+
* Removes Code Interpreter as an allowed caller without mutating the input.
|
|
7393
|
+
* Tool entries and unrelated options are preserved; an empty entry is removed.
|
|
7394
|
+
*/
|
|
7395
|
+
function removeCodeExecutionCaller(toolOptions) {
|
|
7396
|
+
if (toolOptions == null) return toolOptions;
|
|
7397
|
+
const normalized = {};
|
|
7398
|
+
for (const [toolName, options] of Object.entries(toolOptions)) {
|
|
7399
|
+
const callers = options.allowed_callers;
|
|
7400
|
+
if (callers?.includes("code_execution") !== true) {
|
|
7401
|
+
normalized[toolName] = options;
|
|
7402
|
+
continue;
|
|
7403
|
+
}
|
|
7404
|
+
const allowedCallers = callers.filter((caller) => caller !== "code_execution");
|
|
7405
|
+
const { allowed_callers: _removed, ...remainingOptions } = options;
|
|
7406
|
+
const nextOptions = allowedCallers.length > 0 ? {
|
|
7407
|
+
...remainingOptions,
|
|
7408
|
+
allowed_callers: allowedCallers
|
|
7409
|
+
} : remainingOptions;
|
|
7410
|
+
if (Object.keys(nextOptions).length > 0) normalized[toolName] = nextOptions;
|
|
7411
|
+
}
|
|
7412
|
+
return normalized;
|
|
6650
7413
|
}
|
|
6651
7414
|
//#endregion
|
|
6652
7415
|
//#region src/codeEnvRef.ts
|
|
@@ -6673,7 +7436,34 @@ const CODE_ENV_KINDS = [
|
|
|
6673
7436
|
"agent",
|
|
6674
7437
|
"user"
|
|
6675
7438
|
];
|
|
7439
|
+
function getCodeEnvRefForProfile(refs, routeKey) {
|
|
7440
|
+
const profileRef = refs?.codeEnvRefs?.[routeKey];
|
|
7441
|
+
if (profileRef) return profileRef;
|
|
7442
|
+
const legacyRef = refs?.codeEnvRef;
|
|
7443
|
+
if (legacyRef && (legacyRef.executionRouteKey ?? legacyRef.executionProfile ?? "default") === routeKey) return legacyRef;
|
|
7444
|
+
}
|
|
7445
|
+
/** Adds one profile pointer without discarding the other profile's storage object. */
|
|
7446
|
+
function mergeCodeEnvRef(refs, ref) {
|
|
7447
|
+
const codeEnvRefs = { ...refs?.codeEnvRefs };
|
|
7448
|
+
const legacyRef = refs?.codeEnvRef;
|
|
7449
|
+
if (legacyRef) codeEnvRefs[legacyRef.executionRouteKey ?? legacyRef.executionProfile ?? "default"] ??= legacyRef;
|
|
7450
|
+
const routeKey = ref.executionRouteKey ?? ref.executionProfile ?? "default";
|
|
7451
|
+
codeEnvRefs[routeKey] = ref;
|
|
7452
|
+
return {
|
|
7453
|
+
codeEnvRef: codeEnvRefs.default ?? codeEnvRefs.stateful ?? ref,
|
|
7454
|
+
codeEnvRefs
|
|
7455
|
+
};
|
|
7456
|
+
}
|
|
7457
|
+
/** Enumerates every deployment-local pointer, including legacy single-pointer records. */
|
|
7458
|
+
function getCodeEnvRefs(refs) {
|
|
7459
|
+
const merged = { ...refs?.codeEnvRefs };
|
|
7460
|
+
const legacyRef = refs?.codeEnvRef;
|
|
7461
|
+
if (legacyRef) merged[legacyRef.executionRouteKey ?? legacyRef.executionProfile ?? "default"] ??= legacyRef;
|
|
7462
|
+
return Object.entries(merged).flatMap(([routeKey, ref]) => ref ? [[routeKey, ref]] : []);
|
|
7463
|
+
}
|
|
6676
7464
|
//#endregion
|
|
7465
|
+
exports.ACTION_METADATA_FILTER_FIELDS = require_data_service.ACTION_METADATA_FILTER_FIELDS;
|
|
7466
|
+
exports.AGENT_INSTRUCTION_FILTER_FIELDS = require_data_service.AGENT_INSTRUCTION_FILTER_FIELDS;
|
|
6677
7467
|
exports.AUTH_USER_DOC_BY_ID_PREFIX = require_data_service.AUTH_USER_DOC_BY_ID_PREFIX;
|
|
6678
7468
|
exports.AccessRoleIds = require_data_service.AccessRoleIds;
|
|
6679
7469
|
exports.ActionRequest = ActionRequest;
|
|
@@ -6695,6 +7485,8 @@ exports.BEDROCK_OUTPUT_128K_BETA = BEDROCK_OUTPUT_128K_BETA;
|
|
|
6695
7485
|
exports.BedrockProviders = require_data_service.BedrockProviders;
|
|
6696
7486
|
exports.BedrockReasoningConfig = require_data_service.BedrockReasoningConfig;
|
|
6697
7487
|
exports.CODE_ENV_KINDS = CODE_ENV_KINDS;
|
|
7488
|
+
exports.CONVERSATION_STARTER_FILTER_FIELDS = require_data_service.CONVERSATION_STARTER_FILTER_FIELDS;
|
|
7489
|
+
exports.CONVERSATION_TITLE_FILTER_FIELDS = require_data_service.CONVERSATION_TITLE_FILTER_FIELDS;
|
|
6698
7490
|
exports.CacheKeys = require_data_service.CacheKeys;
|
|
6699
7491
|
exports.Capabilities = require_data_service.Capabilities;
|
|
6700
7492
|
exports.CohereConstants = require_data_service.CohereConstants;
|
|
@@ -6709,15 +7501,22 @@ exports.EModelEndpoint = require_data_service.EModelEndpoint;
|
|
|
6709
7501
|
exports.EToolResources = require_data_service.EToolResources;
|
|
6710
7502
|
exports.EndpointURLs = require_data_service.EndpointURLs;
|
|
6711
7503
|
exports.ErrorTypes = require_data_service.ErrorTypes;
|
|
7504
|
+
exports.FEEDBACK_FILTER_FIELDS = require_data_service.FEEDBACK_FILTER_FIELDS;
|
|
6712
7505
|
exports.FEEDBACK_RATINGS = require_data_service.FEEDBACK_RATINGS;
|
|
6713
7506
|
exports.FEEDBACK_REASON_KEYS = require_data_service.FEEDBACK_REASON_KEYS;
|
|
6714
7507
|
exports.FEEDBACK_TAGS = require_data_service.FEEDBACK_TAGS;
|
|
7508
|
+
exports.FILE_FILTER_FIELDS = require_data_service.FILE_FILTER_FIELDS;
|
|
7509
|
+
exports.FILTER_PII_STARTER_PATTERNS = require_data_service.FILTER_PII_STARTER_PATTERNS;
|
|
6715
7510
|
exports.FetchTokenConfig = require_data_service.FetchTokenConfig;
|
|
6716
7511
|
exports.FileContext = require_data_service.FileContext;
|
|
6717
7512
|
exports.FilePurpose = require_data_service.FilePurpose;
|
|
6718
7513
|
exports.FileSources = require_data_service.FileSources;
|
|
6719
7514
|
exports.ForkOptions = require_data_service.ForkOptions;
|
|
6720
7515
|
exports.FunctionSignature = FunctionSignature;
|
|
7516
|
+
exports.HITL_MESSAGE_FILTER_FIELDS = require_data_service.HITL_MESSAGE_FILTER_FIELDS;
|
|
7517
|
+
exports.INSIGHTS_MAX_RANGE_DAYS = INSIGHTS_MAX_RANGE_DAYS;
|
|
7518
|
+
exports.INSIGHTS_SEARCH_MAX_LENGTH = INSIGHTS_SEARCH_MAX_LENGTH;
|
|
7519
|
+
exports.INSIGHTS_SEARCH_MIN_LENGTH = INSIGHTS_SEARCH_MIN_LENGTH;
|
|
6721
7520
|
exports.INTERFACE_PERMISSION_FIELDS = INTERFACE_PERMISSION_FIELDS;
|
|
6722
7521
|
exports.ImageDetail = require_data_service.ImageDetail;
|
|
6723
7522
|
exports.ImageDetailCost = require_data_service.ImageDetailCost;
|
|
@@ -6726,14 +7525,31 @@ exports.InfiniteCollections = require_data_service.InfiniteCollections;
|
|
|
6726
7525
|
exports.InvocationMode = InvocationMode;
|
|
6727
7526
|
exports.KnownEndpoints = require_data_service.KnownEndpoints;
|
|
6728
7527
|
exports.LocalStorageKeys = require_data_service.LocalStorageKeys;
|
|
7528
|
+
exports.MAX_CHAT_PROJECT_DESCRIPTION_LENGTH = require_data_service.MAX_CHAT_PROJECT_DESCRIPTION_LENGTH;
|
|
7529
|
+
exports.MAX_CHAT_PROJECT_NAME_LENGTH = require_data_service.MAX_CHAT_PROJECT_NAME_LENGTH;
|
|
7530
|
+
exports.MAX_GRAPH_SUBAGENT_MEMBERS = require_data_service.MAX_GRAPH_SUBAGENT_MEMBERS;
|
|
7531
|
+
exports.MAX_PII_CUSTOM_PATTERNS_TOTAL = require_data_service.MAX_PII_CUSTOM_PATTERNS_TOTAL;
|
|
7532
|
+
exports.MAX_PII_CUSTOM_REGEX_CHARACTERS = require_data_service.MAX_PII_CUSTOM_REGEX_CHARACTERS;
|
|
7533
|
+
exports.MAX_PII_CUSTOM_REGEX_INSTRUCTIONS = require_data_service.MAX_PII_CUSTOM_REGEX_INSTRUCTIONS;
|
|
7534
|
+
exports.MAX_PII_PATTERNS_PER_SOURCE = require_data_service.MAX_PII_PATTERNS_PER_SOURCE;
|
|
7535
|
+
exports.MAX_PII_PATTERN_ID_LENGTH = require_data_service.MAX_PII_PATTERN_ID_LENGTH;
|
|
7536
|
+
exports.MAX_PII_PATTERN_LABEL_LENGTH = require_data_service.MAX_PII_PATTERN_LABEL_LENGTH;
|
|
7537
|
+
exports.MAX_PII_PATTERN_LENGTH = require_data_service.MAX_PII_PATTERN_LENGTH;
|
|
6729
7538
|
exports.MAX_SUBAGENTS = require_data_service.MAX_SUBAGENTS;
|
|
7539
|
+
exports.MAX_SUBAGENTS_CEILING = require_data_service.MAX_SUBAGENTS_CEILING;
|
|
6730
7540
|
exports.MAX_SUBAGENT_DEPTH = require_data_service.MAX_SUBAGENT_DEPTH;
|
|
6731
7541
|
exports.MAX_SUBAGENT_GRAPH_NODES = require_data_service.MAX_SUBAGENT_GRAPH_NODES;
|
|
6732
7542
|
exports.MAX_SUBAGENT_RUN_CONFIGS = require_data_service.MAX_SUBAGENT_RUN_CONFIGS;
|
|
6733
7543
|
exports.MCPOptionsSchema = require_data_service.MCPOptionsSchema;
|
|
6734
7544
|
exports.MCPServerUserInputSchema = require_data_service.MCPServerUserInputSchema;
|
|
6735
7545
|
exports.MCPServersSchema = require_data_service.MCPServersSchema;
|
|
7546
|
+
exports.MCP_SERVER_TITLE_ERROR = require_data_service.MCP_SERVER_TITLE_ERROR;
|
|
7547
|
+
exports.MCP_SERVER_TITLE_PATTERN = require_data_service.MCP_SERVER_TITLE_PATTERN;
|
|
6736
7548
|
exports.MCP_USER_INPUT_FIELDS = require_data_service.MCP_USER_INPUT_FIELDS;
|
|
7549
|
+
exports.MEMORY_FILTER_FIELDS = require_data_service.MEMORY_FILTER_FIELDS;
|
|
7550
|
+
exports.MESSAGE_FILTER_FIELDS = require_data_service.MESSAGE_FILTER_FIELDS;
|
|
7551
|
+
exports.MIN_REPORTABLE_RUN_STEP_DURATION_MS = MIN_REPORTABLE_RUN_STEP_DURATION_MS;
|
|
7552
|
+
exports.MODEL_PARAMETER_FILTER_FIELDS = require_data_service.MODEL_PARAMETER_FILTER_FIELDS;
|
|
6737
7553
|
exports.MYTHOS_CLASS_FAMILIES = require_data_service.MYTHOS_CLASS_FAMILIES;
|
|
6738
7554
|
exports.MemoryScope = require_data_service.MemoryScope;
|
|
6739
7555
|
exports.MessageContentTypes = require_data_service.MessageContentTypes;
|
|
@@ -6742,17 +7558,21 @@ exports.OCRStrategy = require_data_service.OCRStrategy;
|
|
|
6742
7558
|
exports.OptionTypes = require_data_service.OptionTypes;
|
|
6743
7559
|
exports.PERMISSION_SUB_KEYS = PERMISSION_SUB_KEYS;
|
|
6744
7560
|
exports.PERMISSION_TYPE_INTERFACE_FIELDS = PERMISSION_TYPE_INTERFACE_FIELDS;
|
|
7561
|
+
exports.PROMPT_FILTER_FIELDS = require_data_service.PROMPT_FILTER_FIELDS;
|
|
6745
7562
|
exports.PermissionBits = require_data_service.PermissionBits;
|
|
6746
7563
|
exports.PermissionTypes = PermissionTypes;
|
|
6747
7564
|
exports.Permissions = Permissions;
|
|
6748
7565
|
exports.PrincipalModel = require_data_service.PrincipalModel;
|
|
6749
7566
|
exports.PrincipalType = require_data_service.PrincipalType;
|
|
7567
|
+
exports.ProviderId = ProviderId;
|
|
6750
7568
|
exports.Providers = require_data_service.Providers;
|
|
6751
7569
|
exports.QueryKeys = require_data_service.QueryKeys;
|
|
6752
7570
|
exports.REFILL_INTERVAL_UNITS = require_data_service.REFILL_INTERVAL_UNITS;
|
|
7571
|
+
exports.RUNTIME_CONFIG_INTERFACE_FIELDS = RUNTIME_CONFIG_INTERFACE_FIELDS;
|
|
6753
7572
|
exports.RateLimitPrefix = require_data_service.RateLimitPrefix;
|
|
6754
7573
|
exports.ReasoningContext = require_data_service.ReasoningContext;
|
|
6755
7574
|
exports.ReasoningEffort = require_data_service.ReasoningEffort;
|
|
7575
|
+
exports.ReasoningLabelEvents = ReasoningLabelEvents;
|
|
6756
7576
|
exports.ReasoningMode = require_data_service.ReasoningMode;
|
|
6757
7577
|
exports.ReasoningParameterFormat = require_data_service.ReasoningParameterFormat;
|
|
6758
7578
|
exports.ReasoningResponseKey = require_data_service.ReasoningResponseKey;
|
|
@@ -6761,11 +7581,13 @@ exports.RerankerTypes = require_data_service.RerankerTypes;
|
|
|
6761
7581
|
exports.ResourceType = require_data_service.ResourceType;
|
|
6762
7582
|
exports.RetentionMode = require_data_service.RetentionMode;
|
|
6763
7583
|
exports.RunStatus = require_data_service.RunStatus;
|
|
7584
|
+
exports.SCHEDULE_CRON_MAX_LENGTH = SCHEDULE_CRON_MAX_LENGTH;
|
|
6764
7585
|
exports.SEPARATORS = SEPARATORS;
|
|
6765
7586
|
exports.SKILL_BODY_MAX_LENGTH = SKILL_BODY_MAX_LENGTH;
|
|
6766
7587
|
exports.SKILL_DESCRIPTION_MAX_LENGTH = SKILL_DESCRIPTION_MAX_LENGTH;
|
|
6767
7588
|
exports.SKILL_DESCRIPTION_SHORT_THRESHOLD = SKILL_DESCRIPTION_SHORT_THRESHOLD;
|
|
6768
7589
|
exports.SKILL_DISPLAY_TITLE_MAX_LENGTH = SKILL_DISPLAY_TITLE_MAX_LENGTH;
|
|
7590
|
+
exports.SKILL_FILTER_FIELDS = require_data_service.SKILL_FILTER_FIELDS;
|
|
6769
7591
|
exports.SKILL_NAME_MAX_LENGTH = SKILL_NAME_MAX_LENGTH;
|
|
6770
7592
|
exports.SKILL_NAME_PATTERN = SKILL_NAME_PATTERN;
|
|
6771
7593
|
exports.SKILL_SYNC_DEFAULT_DISCOVERY_DEPTH = require_data_service.SKILL_SYNC_DEFAULT_DISCOVERY_DEPTH;
|
|
@@ -6773,6 +7595,8 @@ exports.SKILL_SYNC_MAX_DISCOVERY_DEPTH = require_data_service.SKILL_SYNC_MAX_DIS
|
|
|
6773
7595
|
exports.SKILL_SYNC_MAX_INTERVAL_MINUTES = require_data_service.SKILL_SYNC_MAX_INTERVAL_MINUTES;
|
|
6774
7596
|
exports.SKILL_SYNC_MIN_INTERVAL_MINUTES = require_data_service.SKILL_SYNC_MIN_INTERVAL_MINUTES;
|
|
6775
7597
|
exports.SSEOptionsSchema = require_data_service.SSEOptionsSchema;
|
|
7598
|
+
exports.STATEFUL_CODE_ENVIRONMENTS = require_data_service.STATEFUL_CODE_ENVIRONMENTS;
|
|
7599
|
+
exports.STORED_MESSAGE_FILTER_FIELDS = require_data_service.STORED_MESSAGE_FILTER_FIELDS;
|
|
6776
7600
|
exports.STTProviders = require_data_service.STTProviders;
|
|
6777
7601
|
exports.SafeSearchTypes = require_data_service.SafeSearchTypes;
|
|
6778
7602
|
exports.ScraperProviders = require_data_service.ScraperProviders;
|
|
@@ -6781,6 +7605,7 @@ exports.SearchProviders = require_data_service.SearchProviders;
|
|
|
6781
7605
|
exports.SettingTypes = require_data_service.SettingTypes;
|
|
6782
7606
|
exports.SettingsTabValues = require_data_service.SettingsTabValues;
|
|
6783
7607
|
exports.SettingsViews = require_data_service.SettingsViews;
|
|
7608
|
+
exports.SkillsScope = require_data_service.SkillsScope;
|
|
6784
7609
|
exports.StdioOptionsSchema = require_data_service.StdioOptionsSchema;
|
|
6785
7610
|
exports.SteerEvents = SteerEvents;
|
|
6786
7611
|
exports.StepEvents = StepEvents;
|
|
@@ -6789,6 +7614,7 @@ exports.StepTypes = StepTypes;
|
|
|
6789
7614
|
exports.StreamableHTTPOptionsSchema = require_data_service.StreamableHTTPOptionsSchema;
|
|
6790
7615
|
exports.SystemCategories = require_data_service.SystemCategories;
|
|
6791
7616
|
exports.SystemRoles = SystemRoles;
|
|
7617
|
+
exports.TOOL_ARGUMENT_FILTER_FIELDS = require_data_service.TOOL_ARGUMENT_FILTER_FIELDS;
|
|
6792
7618
|
exports.TTSProviders = require_data_service.TTSProviders;
|
|
6793
7619
|
exports.ThinkingDisplay = require_data_service.ThinkingDisplay;
|
|
6794
7620
|
exports.ThinkingLevel = require_data_service.ThinkingLevel;
|
|
@@ -6806,8 +7632,15 @@ exports.accessRoleToPermBits = require_data_service.accessRoleToPermBits;
|
|
|
6806
7632
|
exports.accordian = accordian;
|
|
6807
7633
|
exports.actionDelimiter = require_data_service.actionDelimiter;
|
|
6808
7634
|
exports.actionDomainSeparator = require_data_service.actionDomainSeparator;
|
|
7635
|
+
exports.actionMetadataFilterFieldSchema = require_data_service.actionMetadataFilterFieldSchema;
|
|
7636
|
+
exports.agentInstructionFilterFieldSchema = require_data_service.agentInstructionFilterFieldSchema;
|
|
6809
7637
|
exports.agentParamSettings = agentParamSettings;
|
|
6810
7638
|
exports.agentPermissionsSchema = agentPermissionsSchema;
|
|
7639
|
+
exports.agentQueuedTurnCapabilitySchema = agentQueuedTurnCapabilitySchema;
|
|
7640
|
+
exports.agentQueuedTurnDurability = agentQueuedTurnDurability;
|
|
7641
|
+
exports.agentQueuedTurnFileRefSchema = agentQueuedTurnFileRefSchema;
|
|
7642
|
+
exports.agentQueuedTurnReceiptSchema = agentQueuedTurnReceiptSchema;
|
|
7643
|
+
exports.agentQueuedTurnStatuses = agentQueuedTurnStatuses;
|
|
6811
7644
|
exports.agentsBaseSchema = require_data_service.agentsBaseSchema;
|
|
6812
7645
|
exports.agentsEndpointSchema = require_data_service.agentsEndpointSchema;
|
|
6813
7646
|
exports.agentsSchema = require_data_service.agentsSchema;
|
|
@@ -6852,7 +7685,11 @@ exports.buildServerNameAliases = require_data_service.buildServerNameAliases;
|
|
|
6852
7685
|
exports.buildTree = buildTree;
|
|
6853
7686
|
exports.button = button;
|
|
6854
7687
|
exports.cacheSubsetProviders = require_data_service.cacheSubsetProviders;
|
|
7688
|
+
exports.cadenceIntervalMinutes = cadenceIntervalMinutes;
|
|
7689
|
+
exports.cadenceToCron = cadenceToCron;
|
|
6855
7690
|
exports.calendar = calendar;
|
|
7691
|
+
exports.cancelAgentQueuedTurnResponseSchema = cancelAgentQueuedTurnResponseSchema;
|
|
7692
|
+
exports.cancelAgentQueuedTurnSchema = cancelAgentQueuedTurnSchema;
|
|
6856
7693
|
exports.capsEffortWhenThinkingDisabled = capsEffortWhenThinkingDisabled;
|
|
6857
7694
|
exports.card = card;
|
|
6858
7695
|
exports.carousel = carousel;
|
|
@@ -6862,7 +7699,11 @@ exports.checkpointerSchema = require_data_service.checkpointerSchema;
|
|
|
6862
7699
|
exports.checkpointerTypeSchema = require_data_service.checkpointerTypeSchema;
|
|
6863
7700
|
exports.clampEffortForDisabledThinking = clampEffortForDisabledThinking;
|
|
6864
7701
|
exports.clampOutputConfigEffort = clampOutputConfigEffort;
|
|
7702
|
+
exports.clampSettingRange = require_data_service.clampSettingRange;
|
|
6865
7703
|
exports.cloudfrontConfigSchema = require_data_service.cloudfrontConfigSchema;
|
|
7704
|
+
exports.codeEnvironmentPermissionDecisionSchema = require_data_service.codeEnvironmentPermissionDecisionSchema;
|
|
7705
|
+
exports.codeEnvironmentUserConfigSchema = require_data_service.codeEnvironmentUserConfigSchema;
|
|
7706
|
+
exports.codeEnvironmentUserSettingsSchema = require_data_service.codeEnvironmentUserSettingsSchema;
|
|
6866
7707
|
exports.codeInterpreterMimeTypes = require_data_service.codeInterpreterMimeTypes;
|
|
6867
7708
|
exports.codeInterpreterMimeTypesList = require_data_service.codeInterpreterMimeTypesList;
|
|
6868
7709
|
exports.codeTypeMapping = require_data_service.codeTypeMapping;
|
|
@@ -6874,9 +7715,13 @@ exports.compactAssistantSchema = require_data_service.compactAssistantSchema;
|
|
|
6874
7715
|
exports.compactGoogleSchema = require_data_service.compactGoogleSchema;
|
|
6875
7716
|
exports.configSchema = require_data_service.configSchema;
|
|
6876
7717
|
exports.contextPruningSchema = require_data_service.contextPruningSchema;
|
|
7718
|
+
exports.conversationStarterFilterFieldSchema = require_data_service.conversationStarterFilterFieldSchema;
|
|
7719
|
+
exports.conversationTitleFilterFieldSchema = require_data_service.conversationTitleFilterFieldSchema;
|
|
6877
7720
|
exports.convertStringsToRegex = require_data_service.convertStringsToRegex;
|
|
6878
7721
|
exports.createPayload = createPayload;
|
|
7722
|
+
exports.createSchedulePayloadSchema = createSchedulePayloadSchema;
|
|
6879
7723
|
exports.createURL = createURL;
|
|
7724
|
+
exports.cronCadenceSchema = cronCadenceSchema;
|
|
6880
7725
|
Object.defineProperty(exports, "dataService", {
|
|
6881
7726
|
enumerable: true,
|
|
6882
7727
|
get: function() {
|
|
@@ -6917,6 +7762,9 @@ exports.encodeEphemeralAgentId = encodeEphemeralAgentId;
|
|
|
6917
7762
|
exports.endpointFileConfigSchema = require_data_service.endpointFileConfigSchema;
|
|
6918
7763
|
exports.endpointSchema = require_data_service.endpointSchema;
|
|
6919
7764
|
exports.endpointSettings = require_data_service.endpointSettings;
|
|
7765
|
+
exports.endpointToProvider = endpointToProvider;
|
|
7766
|
+
exports.enqueueAgentQueuedTurnResponseSchema = enqueueAgentQueuedTurnResponseSchema;
|
|
7767
|
+
exports.enqueueAgentQueuedTurnSchema = enqueueAgentQueuedTurnSchema;
|
|
6920
7768
|
exports.envVarRegex = require_data_service.envVarRegex;
|
|
6921
7769
|
exports.errorsToString = errorsToString;
|
|
6922
7770
|
exports.essentialShadcnComponents = essentialShadcnComponents;
|
|
@@ -6927,33 +7775,48 @@ exports.extendedModelEndpointSchema = require_data_service.extendedModelEndpoint
|
|
|
6927
7775
|
exports.extractDomainFromUrl = extractDomainFromUrl;
|
|
6928
7776
|
exports.extractEnvVariable = require_data_service.extractEnvVariable;
|
|
6929
7777
|
exports.extractVariableName = require_data_service.extractVariableName;
|
|
7778
|
+
exports.feedbackFilterFieldSchema = require_data_service.feedbackFilterFieldSchema;
|
|
6930
7779
|
exports.feedbackRatingSchema = require_data_service.feedbackRatingSchema;
|
|
6931
7780
|
exports.feedbackSchema = require_data_service.feedbackSchema;
|
|
6932
7781
|
exports.feedbackTagKeySchema = require_data_service.feedbackTagKeySchema;
|
|
6933
7782
|
exports.fileCitationsPermissionsSchema = fileCitationsPermissionsSchema;
|
|
6934
7783
|
exports.fileConfig = require_data_service.fileConfig;
|
|
6935
7784
|
exports.fileConfigSchema = require_data_service.fileConfigSchema;
|
|
7785
|
+
exports.fileFilterFieldSchema = require_data_service.fileFilterFieldSchema;
|
|
6936
7786
|
exports.fileSearchPermissionsSchema = fileSearchPermissionsSchema;
|
|
6937
7787
|
exports.fileSourceSchema = require_data_service.fileSourceSchema;
|
|
6938
7788
|
exports.fileStorageSchema = require_data_service.fileStorageSchema;
|
|
6939
7789
|
exports.fileStrategiesSchema = require_data_service.fileStrategiesSchema;
|
|
7790
|
+
exports.filterPiiActionSchema = require_data_service.filterPiiActionSchema;
|
|
7791
|
+
exports.filterPiiCustomPatternSchema = require_data_service.filterPiiCustomPatternSchema;
|
|
7792
|
+
exports.filterPiiRegexSchema = require_data_service.filterPiiRegexSchema;
|
|
7793
|
+
exports.filterPiiStarterPatternSchema = require_data_service.filterPiiStarterPatternSchema;
|
|
7794
|
+
exports.filtersConfigSchema = require_data_service.filtersConfigSchema;
|
|
6940
7795
|
exports.findLastSeparatorIndex = findLastSeparatorIndex;
|
|
6941
7796
|
exports.fullMimeTypesList = require_data_service.fullMimeTypesList;
|
|
6942
7797
|
exports.generateDynamicSchema = require_data_service.generateDynamicSchema;
|
|
6943
7798
|
exports.generateGoogleSchema = require_data_service.generateGoogleSchema;
|
|
6944
7799
|
exports.generateOpenAISchema = require_data_service.generateOpenAISchema;
|
|
7800
|
+
exports.getCodeEnvRefForProfile = getCodeEnvRefForProfile;
|
|
7801
|
+
exports.getCodeEnvRefs = getCodeEnvRefs;
|
|
6945
7802
|
exports.getConfigDefaults = require_data_service.getConfigDefaults;
|
|
6946
7803
|
exports.getConfiguredMimeAccept = require_data_service.getConfiguredMimeAccept;
|
|
6947
7804
|
exports.getDefaultParamsEndpoint = require_data_service.getDefaultParamsEndpoint;
|
|
6948
7805
|
exports.getEnabledEndpoints = getEnabledEndpoints;
|
|
6949
7806
|
exports.getEndpointField = require_data_service.getEndpointField;
|
|
6950
7807
|
exports.getEndpointFileConfig = require_data_service.getEndpointFileConfig;
|
|
7808
|
+
exports.getEphemeralSender = getEphemeralSender;
|
|
6951
7809
|
exports.getFirstDefinedValue = getFirstDefinedValue;
|
|
7810
|
+
exports.getGoogleThinkingBudgetBounds = require_data_service.getGoogleThinkingBudgetBounds;
|
|
7811
|
+
exports.getGoogleThinkingBudgetMax = require_data_service.getGoogleThinkingBudgetMax;
|
|
7812
|
+
exports.getMaxSubagents = require_data_service.getMaxSubagents;
|
|
6952
7813
|
exports.getModelKey = require_data_service.getModelKey;
|
|
6953
7814
|
exports.getNonEmptyValue = getNonEmptyValue;
|
|
7815
|
+
exports.getPiiRegexProgramSize = require_data_service.getPiiRegexProgramSize;
|
|
6954
7816
|
exports.getRefillEligibilityDate = require_data_service.getRefillEligibilityDate;
|
|
6955
7817
|
exports.getResourcePermissionsResponseSchema = require_data_service.getResourcePermissionsResponseSchema;
|
|
6956
7818
|
exports.getResponseSender = getResponseSender;
|
|
7819
|
+
exports.getRunStepDurationMs = getRunStepDurationMs;
|
|
6957
7820
|
exports.getSchemaDefaults = require_data_service.getSchemaDefaults;
|
|
6958
7821
|
exports.getSettingsKeys = require_data_service.getSettingsKeys;
|
|
6959
7822
|
exports.getTagByKey = require_data_service.getTagByKey;
|
|
@@ -6963,7 +7826,11 @@ exports.googleBaseSchema = require_data_service.googleBaseSchema;
|
|
|
6963
7826
|
exports.googleGenConfigSchema = require_data_service.googleGenConfigSchema;
|
|
6964
7827
|
exports.googleSchema = require_data_service.googleSchema;
|
|
6965
7828
|
exports.googleSettings = require_data_service.googleSettings;
|
|
7829
|
+
exports.hasActiveFiltersConfig = require_data_service.hasActiveFiltersConfig;
|
|
7830
|
+
exports.hasActivePiiFields = require_data_service.hasActivePiiFields;
|
|
7831
|
+
exports.hasActivePiiPatterns = require_data_service.hasActivePiiPatterns;
|
|
6966
7832
|
exports.hasPermissions = require_data_service.hasPermissions;
|
|
7833
|
+
exports.hasProcessMCPServerConfig = require_data_service.hasProcessMCPServerConfig;
|
|
6967
7834
|
exports.hostImageIdSuffix = require_data_service.hostImageIdSuffix;
|
|
6968
7835
|
exports.hostImageNamePrefix = require_data_service.hostImageNamePrefix;
|
|
6969
7836
|
exports.hoverCard = hoverCard;
|
|
@@ -6984,6 +7851,7 @@ exports.isAnthropicDocumentType = require_data_service.isAnthropicDocumentType;
|
|
|
6984
7851
|
exports.isAnthropicTextDocumentType = require_data_service.isAnthropicTextDocumentType;
|
|
6985
7852
|
exports.isAssistantsEndpoint = require_data_service.isAssistantsEndpoint;
|
|
6986
7853
|
exports.isBedrockDocumentType = require_data_service.isBedrockDocumentType;
|
|
7854
|
+
exports.isCronCadence = isCronCadence;
|
|
6987
7855
|
exports.isDocumentSupportedProvider = require_data_service.isDocumentSupportedProvider;
|
|
6988
7856
|
exports.isEphemeralAgentId = isEphemeralAgentId;
|
|
6989
7857
|
exports.isImageVisionTool = require_data_service.isImageVisionTool;
|
|
@@ -6991,35 +7859,51 @@ exports.isMythosClassModel = require_data_service.isMythosClassModel;
|
|
|
6991
7859
|
exports.isOpenAILikeProvider = require_data_service.isOpenAILikeProvider;
|
|
6992
7860
|
exports.isParamEndpoint = require_data_service.isParamEndpoint;
|
|
6993
7861
|
exports.isPermissiveMimeConfig = require_data_service.isPermissiveMimeConfig;
|
|
7862
|
+
exports.isProcessMCPServerConfig = require_data_service.isProcessMCPServerConfig;
|
|
7863
|
+
exports.isProcessMCPServerField = require_data_service.isProcessMCPServerField;
|
|
6994
7864
|
exports.isRemoteOidcUrlAllowed = require_data_service.isRemoteOidcUrlAllowed;
|
|
7865
|
+
exports.isReportableRunStepDuration = isReportableRunStepDuration;
|
|
7866
|
+
exports.isSecureCodeEnvironmentControlURL = require_data_service.isSecureCodeEnvironmentControlURL;
|
|
6995
7867
|
exports.isSensitiveEnvVar = require_data_service.isSensitiveEnvVar;
|
|
6996
7868
|
exports.isSystemRoleName = isSystemRoleName;
|
|
6997
7869
|
exports.isThinkingDisabled = isThinkingDisabled;
|
|
6998
7870
|
exports.isUUID = require_data_service.isUUID;
|
|
7871
|
+
exports.isValidCronExpression = isValidCronExpression;
|
|
7872
|
+
exports.knownEndpointToProvider = knownEndpointToProvider;
|
|
6999
7873
|
exports.label = label;
|
|
7000
7874
|
exports.langfuseConfigSchema = require_data_service.langfuseConfigSchema;
|
|
7001
7875
|
exports.librechat = librechat;
|
|
7876
|
+
exports.listAgentQueuedTurnsResponseSchema = listAgentQueuedTurnsResponseSchema;
|
|
7877
|
+
exports.listAgentQueuedTurnsSchema = listAgentQueuedTurnsSchema;
|
|
7002
7878
|
exports.loginPage = require_data_service.loginPage;
|
|
7003
7879
|
exports.mapGroupToAzureConfig = mapGroupToAzureConfig;
|
|
7004
7880
|
exports.mapModelToAzureConfig = mapModelToAzureConfig;
|
|
7005
7881
|
exports.marketplacePermissionsSchema = marketplacePermissionsSchema;
|
|
7882
|
+
exports.materializeModelSpecEndpoints = require_data_service.materializeModelSpecEndpoints;
|
|
7006
7883
|
exports.mbToBytes = require_data_service.mbToBytes;
|
|
7007
7884
|
exports.mcpServersPermissionsSchema = mcpServersPermissionsSchema;
|
|
7008
7885
|
exports.megabyte = require_data_service.megabyte;
|
|
7886
|
+
exports.memoryFilterFieldSchema = require_data_service.memoryFilterFieldSchema;
|
|
7009
7887
|
exports.memoryPermissionsSchema = memoryPermissionsSchema;
|
|
7010
7888
|
exports.memorySchema = require_data_service.memorySchema;
|
|
7011
7889
|
exports.menuBar = menuBar;
|
|
7890
|
+
exports.mergeCodeEnvRef = mergeCodeEnvRef;
|
|
7012
7891
|
exports.mergeFileConfig = require_data_service.mergeFileConfig;
|
|
7892
|
+
exports.messageFilterFieldSchema = require_data_service.messageFilterFieldSchema;
|
|
7013
7893
|
exports.messageFilterPiiSchema = require_data_service.messageFilterPiiSchema;
|
|
7014
7894
|
exports.messageFilterSchema = require_data_service.messageFilterSchema;
|
|
7015
7895
|
exports.mimeTypeAliases = require_data_service.mimeTypeAliases;
|
|
7016
7896
|
exports.modelConfigSchema = require_data_service.modelConfigSchema;
|
|
7897
|
+
exports.modelParameterFilterFieldSchema = require_data_service.modelParameterFilterFieldSchema;
|
|
7017
7898
|
exports.modelSpecSubagentsSchema = require_data_service.modelSpecSubagentsSchema;
|
|
7018
7899
|
exports.modularEndpoints = require_data_service.modularEndpoints;
|
|
7019
7900
|
exports.multiConvoPermissionsSchema = multiConvoPermissionsSchema;
|
|
7020
7901
|
exports.navigationMenu = navigationMenu;
|
|
7902
|
+
exports.nextRunInstants = nextRunInstants;
|
|
7903
|
+
exports.normalizeActionToolName = normalizeActionToolName;
|
|
7021
7904
|
exports.normalizeEndpointName = require_data_service.normalizeEndpointName;
|
|
7022
7905
|
exports.normalizeMCPToolKey = require_data_service.normalizeMCPToolKey;
|
|
7906
|
+
exports.normalizeSearxngEngines = require_data_service.normalizeSearxngEngines;
|
|
7023
7907
|
exports.normalizeServerName = require_data_service.normalizeServerName;
|
|
7024
7908
|
exports.ocrSchema = require_data_service.ocrSchema;
|
|
7025
7909
|
exports.omitsSamplingParameters = omitsSamplingParameters;
|
|
@@ -7037,6 +7921,7 @@ exports.paramSettings = paramSettings;
|
|
|
7037
7921
|
exports.parseCompactConvo = parseCompactConvo;
|
|
7038
7922
|
exports.parseConvo = parseConvo;
|
|
7039
7923
|
exports.parseEphemeralAgentId = parseEphemeralAgentId;
|
|
7924
|
+
exports.parseLangChainErrorCode = parseLangChainErrorCode;
|
|
7040
7925
|
exports.parseTextParts = parseTextParts;
|
|
7041
7926
|
exports.peoplePickerPermissionsSchema = peoplePickerPermissionsSchema;
|
|
7042
7927
|
exports.permBitsToAccessLevel = require_data_service.permBitsToAccessLevel;
|
|
@@ -7046,6 +7931,7 @@ exports.popover = popover;
|
|
|
7046
7931
|
exports.presetSettings = presetSettings;
|
|
7047
7932
|
exports.principalSchema = require_data_service.principalSchema;
|
|
7048
7933
|
exports.progress = progress;
|
|
7934
|
+
exports.promptFilterFieldSchema = require_data_service.promptFilterFieldSchema;
|
|
7049
7935
|
exports.promptPermissionsSchema = promptPermissionsSchema;
|
|
7050
7936
|
exports.promptTokensFromUsage = promptTokensFromUsage;
|
|
7051
7937
|
exports.providerEndpointMap = require_data_service.providerEndpointMap;
|
|
@@ -7054,12 +7940,19 @@ exports.rateLimitSchema = require_data_service.rateLimitSchema;
|
|
|
7054
7940
|
exports.reconcileContextUsage = reconcileContextUsage;
|
|
7055
7941
|
exports.registerPage = require_data_service.registerPage;
|
|
7056
7942
|
exports.remoteAgentsPermissionsSchema = remoteAgentsPermissionsSchema;
|
|
7943
|
+
exports.removeCodeExecutionCaller = removeCodeExecutionCaller;
|
|
7057
7944
|
exports.removeNullishValues = require_data_service.removeNullishValues;
|
|
7058
7945
|
exports.replaceSpecialVars = replaceSpecialVars;
|
|
7059
7946
|
exports.request = require_data_service.request_default;
|
|
7060
7947
|
exports.requiresExplicitThinkingDisabled = requiresExplicitThinkingDisabled;
|
|
7948
|
+
exports.resolveAgentSkillsScope = require_data_service.resolveAgentSkillsScope;
|
|
7949
|
+
exports.resolveAllowedStatefulCodeEnvironments = require_data_service.resolveAllowedStatefulCodeEnvironments;
|
|
7061
7950
|
exports.resolveEndpointType = require_data_service.resolveEndpointType;
|
|
7951
|
+
exports.resolveModelCatalogKey = resolveModelCatalogKey;
|
|
7952
|
+
exports.resolveModelSpecEndpoint = require_data_service.resolveModelSpecEndpoint;
|
|
7953
|
+
exports.resolveProviderId = resolveProviderId;
|
|
7062
7954
|
exports.resolveRef = resolveRef;
|
|
7955
|
+
exports.resolveStatefulCodeEnvironment = require_data_service.resolveStatefulCodeEnvironment;
|
|
7063
7956
|
exports.resolveThinkingDisplay = resolveThinkingDisplay;
|
|
7064
7957
|
exports.resourcePermissionsResponseSchema = require_data_service.resourcePermissionsResponseSchema;
|
|
7065
7958
|
exports.retainRecentConfigSchema = require_data_service.retainRecentConfigSchema;
|
|
@@ -7068,10 +7961,16 @@ exports.retrievalMimeTypesList = require_data_service.retrievalMimeTypesList;
|
|
|
7068
7961
|
exports.roleDefaults = roleDefaults;
|
|
7069
7962
|
exports.roleSchema = roleSchema;
|
|
7070
7963
|
exports.runCodePermissionsSchema = runCodePermissionsSchema;
|
|
7964
|
+
exports.scheduleCadenceSchema = scheduleCadenceSchema;
|
|
7965
|
+
exports.scheduleFrequencies = scheduleFrequencies;
|
|
7966
|
+
exports.scheduleStructuredFrequencies = scheduleStructuredFrequencies;
|
|
7967
|
+
exports.scheduleTargets = scheduleTargets;
|
|
7968
|
+
exports.schedulesPermissionsSchema = schedulesPermissionsSchema;
|
|
7071
7969
|
exports.select = select;
|
|
7072
7970
|
exports.separator = separator;
|
|
7073
7971
|
exports.setAcceptLanguageHeader = require_data_service.setAcceptLanguageHeader;
|
|
7074
7972
|
exports.setFileConfigRegexCompiler = require_data_service.setFileConfigRegexCompiler;
|
|
7973
|
+
exports.setMaxSubagents = require_data_service.setMaxSubagents;
|
|
7075
7974
|
exports.setMessageFilterRegexValidator = require_data_service.setMessageFilterRegexValidator;
|
|
7076
7975
|
exports.setTokenHeader = require_data_service.setTokenHeader;
|
|
7077
7976
|
exports.sha1 = sha1;
|
|
@@ -7079,6 +7978,7 @@ exports.shadcnComponents = shadcnComponents;
|
|
|
7079
7978
|
exports.sharedFileDownload = require_data_service.sharedFileDownload;
|
|
7080
7979
|
exports.sharedLinksPermissionsSchema = sharedLinksPermissionsSchema;
|
|
7081
7980
|
exports.skeleton = skeleton;
|
|
7981
|
+
exports.skillFilterFieldSchema = require_data_service.skillFilterFieldSchema;
|
|
7082
7982
|
exports.skillPermissionsSchema = skillPermissionsSchema;
|
|
7083
7983
|
exports.skillSyncConfigSchema = require_data_service.skillSyncConfigSchema;
|
|
7084
7984
|
exports.skillSyncGitHubSourceSchema = require_data_service.skillSyncGitHubSourceSchema;
|
|
@@ -7088,6 +7988,12 @@ exports.specsConfigSchema = require_data_service.specsConfigSchema;
|
|
|
7088
7988
|
exports.splitMCPToolKey = require_data_service.splitMCPToolKey;
|
|
7089
7989
|
exports.splitToolCallName = require_data_service.splitToolCallName;
|
|
7090
7990
|
exports.stripAgentIdSuffix = stripAgentIdSuffix;
|
|
7991
|
+
exports.stripLangChainTroubleshootingUrl = stripLangChainTroubleshootingUrl;
|
|
7992
|
+
exports.stripReasoningLabelMetadata = stripReasoningLabelMetadata;
|
|
7993
|
+
exports.stripServerNamePrefix = require_data_service.stripServerNamePrefix;
|
|
7994
|
+
exports.stripServerNamePrefixes = require_data_service.stripServerNamePrefixes;
|
|
7995
|
+
exports.structuredCadenceSchema = structuredCadenceSchema;
|
|
7996
|
+
exports.subagentThreadLineageSchema = require_data_service.subagentThreadLineageSchema;
|
|
7091
7997
|
exports.summarizationConfigSchema = require_data_service.summarizationConfigSchema;
|
|
7092
7998
|
exports.summarizationTriggerSchema = require_data_service.summarizationTriggerSchema;
|
|
7093
7999
|
exports.supportedMimeTypes = require_data_service.supportedMimeTypes;
|
|
@@ -7095,6 +8001,7 @@ exports.supportsAdaptiveThinking = supportsAdaptiveThinking;
|
|
|
7095
8001
|
exports.supportsBalanceCheck = require_data_service.supportsBalanceCheck;
|
|
7096
8002
|
exports.supportsContext1m = supportsContext1m;
|
|
7097
8003
|
exports.supportsFiles = require_data_service.supportsFiles;
|
|
8004
|
+
exports.supportsPromptCache = supportsPromptCache;
|
|
7098
8005
|
exports.switchComponent = switchComponent;
|
|
7099
8006
|
exports.tBannerSchema = require_data_service.tBannerSchema;
|
|
7100
8007
|
exports.tConversationSchema = require_data_service.tConversationSchema;
|
|
@@ -7122,13 +8029,17 @@ exports.toggleGroup = toggleGroup;
|
|
|
7122
8029
|
exports.toolApprovalHookConfigSchema = require_data_service.toolApprovalHookConfigSchema;
|
|
7123
8030
|
exports.toolApprovalModeSchema = require_data_service.toolApprovalModeSchema;
|
|
7124
8031
|
exports.toolApprovalPolicySchema = require_data_service.toolApprovalPolicySchema;
|
|
8032
|
+
exports.toolArgumentFilterFieldSchema = require_data_service.toolArgumentFilterFieldSchema;
|
|
7125
8033
|
exports.tooltip = tooltip;
|
|
7126
8034
|
exports.transactionsSchema = require_data_service.transactionsSchema;
|
|
7127
8035
|
exports.turnstileOptionsSchema = require_data_service.turnstileOptionsSchema;
|
|
7128
8036
|
exports.turnstileSchema = require_data_service.turnstileSchema;
|
|
8037
|
+
exports.unattributedAssistantContentSchema = require_data_service.unattributedAssistantContentSchema;
|
|
7129
8038
|
exports.updateResourcePermissionsRequestSchema = require_data_service.updateResourcePermissionsRequestSchema;
|
|
7130
8039
|
exports.updateResourcePermissionsResponseSchema = require_data_service.updateResourcePermissionsResponseSchema;
|
|
8040
|
+
exports.updateSchedulePayloadSchema = updateSchedulePayloadSchema;
|
|
7131
8041
|
exports.useToast = useToast;
|
|
8042
|
+
exports.userSubmittedMessageFieldPathSchema = require_data_service.userSubmittedMessageFieldPathSchema;
|
|
7132
8043
|
exports.utils = utils;
|
|
7133
8044
|
exports.validateActionDomain = validateActionDomain;
|
|
7134
8045
|
exports.validateAndParseOpenAPISpec = validateAndParseOpenAPISpec;
|