@resolveio/server-lib 22.2.13 → 22.2.14

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.
@@ -1603,7 +1603,7 @@ function executeAiFormPatch(payload, context) {
1603
1603
  }
1604
1604
  function executeAiAssistantCodexRun(payload, context) {
1605
1605
  return __awaiter(this, void 0, void 0, function () {
1606
- var input, message, aiWorkerDebug, requestId, codexModel, codexFallbackModels, user, isSuperAdmin, guardrailsEnabled, guardrail, conversation_3, now_3, userMsg, assistantMsg, canViewDebug, hasInvoiceAccess, customerId, conversation, now, attachments, navigationFastPath, userMsg, assistantMsg, assistantInsert, assistantMessageId_1, changeHistoryFastPath, changeHistoryFastPathBypassedReason, userMsg, assistantMsg, assistantInsert, assistantMessageId_2, attachmentData, historyLines, recentToolError, userDoc, initialProgress, assistantDoc, insertResult, assistantMessageId;
1606
+ var input, message, aiWorkerDebug, requestId, codexModel, codexFallbackModels, user, isSuperAdmin, guardrail, conversation_3, now_3, userMsg, assistantMsg, canViewDebug, hasInvoiceAccess, customerId, conversation, now, attachments, navigationFastPath, userMsg, assistantMsg, assistantInsert, assistantMessageId_1, changeHistoryFastPath, changeHistoryFastPathBypassedReason, userMsg, assistantMsg, assistantInsert, assistantMessageId_2, attachmentData, historyLines, recentToolError, userDoc, initialProgress, assistantDoc, insertResult, assistantMessageId;
1607
1607
  var _this = this;
1608
1608
  var _a, _b, _c;
1609
1609
  return __generator(this, function (_d) {
@@ -1628,8 +1628,6 @@ function executeAiAssistantCodexRun(payload, context) {
1628
1628
  throw new Error('Unauthorized.');
1629
1629
  }
1630
1630
  isSuperAdmin = !!((_a = user === null || user === void 0 ? void 0 : user.roles) === null || _a === void 0 ? void 0 : _a.super_admin);
1631
- guardrailsEnabled = resolveAssistantGuardrailsEnabled(input, isSuperAdmin);
1632
- if (!guardrailsEnabled) return [3 /*break*/, 6];
1633
1631
  guardrail = evaluateAssistantGuardrails(message);
1634
1632
  if (!(guardrail === null || guardrail === void 0 ? void 0 : guardrail.blocked)) return [3 /*break*/, 6];
1635
1633
  return [4 /*yield*/, ensureConversation(input, 'codex', context === null || context === void 0 ? void 0 : context.id_user)];
@@ -17021,22 +17019,6 @@ function resolveAssistantSystemPrompt(config) {
17021
17019
  var override = normalizeOptionalString((config === null || config === void 0 ? void 0 : config.system_prompt) || (config === null || config === void 0 ? void 0 : config.systemPrompt));
17022
17020
  return override || AI_ASSISTANT_SYSTEM_PROMPT;
17023
17021
  }
17024
- function resolveAssistantGuardrailsEnabled(input, isSuperAdmin) {
17025
- var _a;
17026
- if (isSuperAdmin === void 0) { isSuperAdmin = false; }
17027
- if (isSuperAdmin) {
17028
- return false;
17029
- }
17030
- var topLevel = input === null || input === void 0 ? void 0 : input.guardrails;
17031
- if (topLevel === false) {
17032
- return false;
17033
- }
17034
- var configGuardrails = normalizeOptionalBoolean((_a = input === null || input === void 0 ? void 0 : input.config) === null || _a === void 0 ? void 0 : _a.guardrails);
17035
- if (configGuardrails === false) {
17036
- return false;
17037
- }
17038
- return true;
17039
- }
17040
17022
  function normalizeAssistantRuntimeControl(value) {
17041
17023
  if (!value || typeof value !== 'object') {
17042
17024
  return null;