@exulu/backend 1.62.1 → 1.63.1

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/index.cjs CHANGED
@@ -267,6 +267,12 @@ var init_auth = __esm({
267
267
  user.role = role;
268
268
  }
269
269
  }
270
+ if (user?.team) {
271
+ const team = await db2.from("teams").select("*").where("id", user?.team).first();
272
+ if (team) {
273
+ user.team = team;
274
+ }
275
+ }
270
276
  if (!user) {
271
277
  return {
272
278
  error: true,
@@ -637,6 +643,7 @@ var init_check_record_access = __esm({
637
643
  const isPublic = record.rights_mode === "public";
638
644
  const byUsers = record.rights_mode === "users";
639
645
  const byRoles = record.rights_mode === "roles";
646
+ const byTeams = record.rights_mode === "teams";
640
647
  const createdBy = typeof record.created_by === "string" ? record.created_by : record.created_by?.toString();
641
648
  const isCreator = user ? createdBy === user.id.toString() : false;
642
649
  const isAdmin = user ? user.super_admin : false;
@@ -682,6 +689,23 @@ var init_check_record_access = __esm({
682
689
  return true;
683
690
  }
684
691
  }
692
+ if (byTeams) {
693
+ if (!user) {
694
+ setRecordAccessCache(false);
695
+ return false;
696
+ }
697
+ hasAccess = record.RBAC?.teams?.find((x) => x.id === user.team?.id)?.rights || "none";
698
+ if (!hasAccess || hasAccess === "none" || hasAccess !== request2) {
699
+ console.error(
700
+ `[EXULU] Your current team ${user.team?.name} does not have access to this record, current access type is: ${hasAccess}.`
701
+ );
702
+ setRecordAccessCache(false);
703
+ return false;
704
+ } else {
705
+ setRecordAccessCache(true);
706
+ return true;
707
+ }
708
+ }
685
709
  setRecordAccessCache(false);
686
710
  return false;
687
711
  };
@@ -784,6 +808,12 @@ function buildTags(input) {
784
808
  if (input.agent_name) {
785
809
  candidates.push("agent_name_" + input.agent_name);
786
810
  }
811
+ if (input.team_id) {
812
+ candidates.push("team_id_" + input.team_id);
813
+ }
814
+ if (input.team_name) {
815
+ candidates.push("team_name_" + input.team_name);
816
+ }
787
817
  console.log("[EXULU] Candidates", candidates);
788
818
  const out = [];
789
819
  for (const candidate of candidates) {
@@ -881,10 +911,11 @@ async function resolveModel(input) {
881
911
  );
882
912
  }
883
913
  const litellm = getLiteLLMProvider({
884
- user: user?.id,
885
- role: user?.role?.id,
886
- project: project?.id,
887
- agent: agent?.id
914
+ user,
915
+ role: user?.role,
916
+ project,
917
+ agent,
918
+ team: user?.team
888
919
  });
889
920
  const languageModel2 = litellm(modelId);
890
921
  const syntheticModel = {
@@ -996,17 +1027,24 @@ var init_resolve_model = __esm({
996
1027
  user,
997
1028
  role,
998
1029
  project,
999
- agent
1030
+ agent,
1031
+ team
1000
1032
  }) => {
1001
1033
  if (_litellmProvider) return _litellmProvider;
1002
1034
  const host = process.env.LITELLM_HOST ?? "127.0.0.1";
1003
1035
  const port = process.env.LITELLM_PORT ?? "4000";
1004
1036
  const masterKey = process.env.LITELLM_MASTER_KEY;
1005
1037
  const tags = buildTags({
1006
- user,
1007
- role,
1008
- project,
1009
- agent
1038
+ user_id: user?.id,
1039
+ role_id: role?.id,
1040
+ project_id: project?.id,
1041
+ agent_id: agent?.id,
1042
+ user_name: !user ? void 0 : user.type === "api" ? user.firstname ?? user.email : user.email,
1043
+ role_name: role?.name,
1044
+ project_name: project?.name,
1045
+ agent_name: agent?.name,
1046
+ team_id: team?.id,
1047
+ team_name: team?.name
1010
1048
  });
1011
1049
  if (!masterKey) {
1012
1050
  throw new ResolveModelError(
@@ -3328,7 +3366,7 @@ var init_tool = __esm({
3328
3366
  modelId: agent.model,
3329
3367
  user,
3330
3368
  providers,
3331
- agent: { id: agent.id },
3369
+ agent,
3332
3370
  rbacBypass: true
3333
3371
  });
3334
3372
  providerapikey = resolved.apiKey;
@@ -3698,6 +3736,16 @@ var init_access_control = __esm({
3698
3736
  });
3699
3737
  });
3700
3738
  }
3739
+ if (user?.team) {
3740
+ const userTeamId = user.team.id;
3741
+ this.orWhere(function() {
3742
+ this.where(`${prefix}rights_mode`, "teams").whereExists(function() {
3743
+ this.select("*").from("rbac").whereRaw(
3744
+ "rbac.target_resource_id = " + (prefix ? prefix.slice(0, -1) : tableNamePlural) + ".id"
3745
+ ).where("rbac.entity", table.name.singular).where("rbac.access_type", "Team").where("rbac.team_id", userTeamId);
3746
+ });
3747
+ });
3748
+ }
3701
3749
  });
3702
3750
  } catch (error) {
3703
3751
  console.error("Access control error:", error);
@@ -3840,7 +3888,7 @@ var init_vector_methods = __esm({
3840
3888
  });
3841
3889
 
3842
3890
  // ee/schemas.ts
3843
- var feedbackSchema, rolesSchema, statisticsSchema, testCasesSchema, evalSetsSchema, jobResultsSchema, evalRunsSchema, rbacSchema, workflowTemplatesSchema;
3891
+ var feedbackSchema, rolesSchema, teamsSchema, statisticsSchema, testCasesSchema, evalSetsSchema, jobResultsSchema, evalRunsSchema, rbacSchema, workflowTemplatesSchema;
3844
3892
  var init_schemas = __esm({
3845
3893
  "ee/schemas.ts"() {
3846
3894
  "use strict";
@@ -3924,6 +3972,26 @@ var init_schemas = __esm({
3924
3972
  }
3925
3973
  ]
3926
3974
  };
3975
+ teamsSchema = {
3976
+ type: "teams",
3977
+ name: {
3978
+ plural: "teams",
3979
+ singular: "team"
3980
+ },
3981
+ fields: [
3982
+ {
3983
+ name: "name",
3984
+ type: "text",
3985
+ index: true,
3986
+ unique: true,
3987
+ required: true
3988
+ },
3989
+ {
3990
+ name: "description",
3991
+ type: "text"
3992
+ }
3993
+ ]
3994
+ };
3927
3995
  statisticsSchema = {
3928
3996
  type: "tracking",
3929
3997
  name: {
@@ -4144,6 +4212,10 @@ var init_schemas = __esm({
4144
4212
  name: "role_id",
4145
4213
  type: "uuid"
4146
4214
  },
4215
+ {
4216
+ name: "team_id",
4217
+ type: "uuid"
4218
+ },
4147
4219
  {
4148
4220
  name: "user_id",
4149
4221
  type: "number"
@@ -4611,6 +4683,10 @@ var init_core_schema = __esm({
4611
4683
  {
4612
4684
  name: "role",
4613
4685
  type: "uuid"
4686
+ },
4687
+ {
4688
+ name: "team",
4689
+ type: "uuid"
4614
4690
  }
4615
4691
  ]
4616
4692
  };
@@ -4889,6 +4965,7 @@ var init_core_schema = __esm({
4889
4965
  }
4890
4966
  if (license["rbac"]) {
4891
4967
  schemas.rolesSchema = () => addCoreFields(rolesSchema);
4968
+ schemas.teamsSchema = () => addCoreFields(teamsSchema);
4892
4969
  schemas.rbacSchema = () => addCoreFields(rbacSchema);
4893
4970
  }
4894
4971
  if (license["evals"]) {
@@ -7779,6 +7856,8 @@ var init_catalog = __esm({
7779
7856
  region: m.model_info?.region ?? null,
7780
7857
  max_tokens: m.model_info?.max_tokens ?? null,
7781
7858
  max_input_tokens: m.model_info?.max_input_tokens ?? null,
7859
+ input_cost_per_million_tokens: m.model_info?.input_cost_per_token * 1e6,
7860
+ output_cost_per_million_tokens: m.model_info?.output_cost_per_token * 1e6,
7782
7861
  active: m.model_info?.active ?? true,
7783
7862
  max_output_tokens: m.model_info?.max_output_tokens ?? null,
7784
7863
  supports_vision: !!m.model_info?.supports_vision,
@@ -7790,8 +7869,18 @@ var init_catalog = __esm({
7790
7869
  supports_edit: !!m.model_info?.supports_edit,
7791
7870
  max_n: typeof m.model_info?.max_n === "number" ? m.model_info.max_n : null
7792
7871
  }));
7793
- _cache = { expiresAt: Date.now() + CACHE_TTL_MS2, items };
7794
- return items.filter((m) => m.type !== "speech_to_text" && m.type !== "text_to_speech");
7872
+ const map = /* @__PURE__ */ new Map();
7873
+ for (const item of items) {
7874
+ const key2 = `${item.model_name}-${item.upstream_model}`;
7875
+ if (map.has(key2)) {
7876
+ map.get(key2).tags.push(...item.tags);
7877
+ } else {
7878
+ map.set(key2, item);
7879
+ }
7880
+ }
7881
+ const uniqueItems = Array.from(map.values());
7882
+ _cache = { expiresAt: Date.now() + CACHE_TTL_MS2, items: uniqueItems };
7883
+ return uniqueItems.filter((m) => m.type !== "speech_to_text" && m.type !== "text_to_speech");
7795
7884
  } catch (err) {
7796
7885
  console.error("[EXULU] litellmCatalog: failed to fetch /model/info:", err);
7797
7886
  return [];
@@ -8313,7 +8402,8 @@ var RBACResolver = async (db2, entityName, resourceId, rights_mode) => {
8313
8402
  return {
8314
8403
  type: "public",
8315
8404
  users: [],
8316
- roles: []
8405
+ roles: [],
8406
+ teams: []
8317
8407
  };
8318
8408
  }
8319
8409
  const rbacRecords = await db2.from("rbac").where({
@@ -8322,13 +8412,16 @@ var RBACResolver = async (db2, entityName, resourceId, rights_mode) => {
8322
8412
  }).select("*");
8323
8413
  const users = rbacRecords.filter((r) => r.access_type === "User")?.map((r) => ({ id: r.user_id, rights: r.rights }));
8324
8414
  const roles = rbacRecords.filter((r) => r.access_type === "Role")?.map((r) => ({ id: r.role_id, rights: r.rights }));
8415
+ const teams = rbacRecords.filter((r) => r.access_type === "Team")?.map((r) => ({ id: r.team_id, rights: r.rights }));
8325
8416
  let type = rights_mode || "private";
8326
8417
  if (type === "users" && users.length === 0) type = "private";
8327
8418
  if (type === "roles" && roles.length === 0) type = "private";
8419
+ if (type === "teams" && teams.length === 0) type = "private";
8328
8420
  return {
8329
8421
  type,
8330
8422
  users,
8331
- roles
8423
+ roles,
8424
+ teams
8332
8425
  };
8333
8426
  };
8334
8427
 
@@ -9085,7 +9178,8 @@ var handleRBACUpdate = async (db2, entityName, resourceId, rbacData, existingRba
9085
9178
  }
9086
9179
  const {
9087
9180
  users = [],
9088
- roles = []
9181
+ roles = [],
9182
+ teams = []
9089
9183
  /* projects = [] */
9090
9184
  } = rbacData;
9091
9185
  if (!existingRbacRecords) {
@@ -9096,20 +9190,28 @@ var handleRBACUpdate = async (db2, entityName, resourceId, rbacData, existingRba
9096
9190
  }
9097
9191
  const newUserRecords = new Set(users.map((u) => `${u.id}:${u.rights}`));
9098
9192
  const newRoleRecords = new Set(roles.map((r) => `${r.id}:${r.rights}`));
9193
+ const newTeamRecords = new Set(teams.map((t) => `${t.id}:${t.rights}`));
9099
9194
  const existingUserRecords = new Set(
9100
9195
  existingRbacRecords.filter((r) => r.access_type === "User").map((r) => `${r.user_id}:${r.rights}`)
9101
9196
  );
9102
9197
  const existingRoleRecords = new Set(
9103
9198
  existingRbacRecords.filter((r) => r.access_type === "Role").map((r) => `${r.role_id}:${r.rights}`)
9104
9199
  );
9200
+ const existingTeamRecords = new Set(
9201
+ existingRbacRecords.filter((r) => r.access_type === "Team").map((r) => `${r.team_id}:${r.rights}`)
9202
+ );
9105
9203
  const usersToCreate = users.filter((u) => !existingUserRecords.has(`${u.id}:${u.rights}`));
9106
9204
  const rolesToCreate = roles.filter((r) => !existingRoleRecords.has(`${r.id}:${r.rights}`));
9205
+ const teamsToCreate = teams.filter((t) => !existingTeamRecords.has(`${t.id}:${t.rights}`));
9107
9206
  const usersToRemove = existingRbacRecords.filter(
9108
9207
  (r) => r.access_type === "User" && !newUserRecords.has(`${r.user_id}:${r.rights}`)
9109
9208
  );
9110
9209
  const rolesToRemove = existingRbacRecords.filter(
9111
9210
  (r) => r.access_type === "Role" && !newRoleRecords.has(`${r.role_id}:${r.rights}`)
9112
9211
  );
9212
+ const teamsToRemove = existingRbacRecords.filter(
9213
+ (r) => r.access_type === "Team" && !newTeamRecords.has(`${r.team_id}:${r.rights}`)
9214
+ );
9113
9215
  if (usersToRemove.length > 0) {
9114
9216
  await db2.from("rbac").whereIn(
9115
9217
  "id",
@@ -9122,6 +9224,12 @@ var handleRBACUpdate = async (db2, entityName, resourceId, rbacData, existingRba
9122
9224
  rolesToRemove.map((r) => r.id)
9123
9225
  ).del();
9124
9226
  }
9227
+ if (teamsToRemove.length > 0) {
9228
+ await db2.from("rbac").whereIn(
9229
+ "id",
9230
+ teamsToRemove.map((r) => r.id)
9231
+ ).del();
9232
+ }
9125
9233
  const recordsToInsert = [];
9126
9234
  usersToCreate.forEach((user) => {
9127
9235
  recordsToInsert.push({
@@ -9145,6 +9253,17 @@ var handleRBACUpdate = async (db2, entityName, resourceId, rbacData, existingRba
9145
9253
  updatedAt: /* @__PURE__ */ new Date()
9146
9254
  });
9147
9255
  });
9256
+ teamsToCreate.forEach((team) => {
9257
+ recordsToInsert.push({
9258
+ entity: entityName,
9259
+ access_type: "Team",
9260
+ target_resource_id: resourceId,
9261
+ team_id: team.id,
9262
+ rights: team.rights,
9263
+ createdAt: /* @__PURE__ */ new Date(),
9264
+ updatedAt: /* @__PURE__ */ new Date()
9265
+ });
9266
+ });
9148
9267
  if (recordsToInsert.length > 0) {
9149
9268
  await db2.from("rbac").insert(recordsToInsert);
9150
9269
  }
@@ -9343,6 +9462,19 @@ function createMutations(table, providers, contexts, rerankers, tools, config) {
9343
9462
  }
9344
9463
  throw new Error("Insufficient role permissions to edit this record");
9345
9464
  }
9465
+ if (record.rights_mode === "teams" && user.team) {
9466
+ const rbacRecord = await db2.from("rbac").where({
9467
+ entity: table.name.singular,
9468
+ target_resource_id: id,
9469
+ access_type: "Team",
9470
+ team_id: user.team,
9471
+ rights: "write"
9472
+ }).first();
9473
+ if (rbacRecord) {
9474
+ return true;
9475
+ }
9476
+ throw new Error("Insufficient team permissions to edit this record");
9477
+ }
9346
9478
  throw new Error("Insufficient permissions to edit this record");
9347
9479
  } catch (error) {
9348
9480
  console.error("Write access validation error:", error);
@@ -11046,7 +11178,7 @@ var processUiMessagesFlow = async ({
11046
11178
  modelId: agent.model,
11047
11179
  user,
11048
11180
  providers,
11049
- agent: { id: agent.id }
11181
+ agent
11050
11182
  });
11051
11183
  const providerapikey = resolved.apiKey;
11052
11184
  const resolvedLanguageModel = resolved.languageModel;
@@ -12087,6 +12219,8 @@ type LiteLLMModel {
12087
12219
  supports_function_calling: Boolean
12088
12220
  supports_pdf_input: Boolean
12089
12221
  supports_audio_input: Boolean
12222
+ input_cost_per_million_tokens: Float
12223
+ output_cost_per_million_tokens: Float
12090
12224
  }
12091
12225
  `;
12092
12226
  resolvers.Query["agentRateLimitUsage"] = async (_, args, context) => {
@@ -13678,7 +13812,7 @@ var ExuluProvider = class {
13678
13812
  modelId: agent.model,
13679
13813
  user,
13680
13814
  providers,
13681
- agent: { id: agent.id }
13815
+ agent
13682
13816
  });
13683
13817
  const providerapikey = resolved.apiKey;
13684
13818
  console.log(
@@ -15386,7 +15520,7 @@ var registerOpenAIGatewayRoutes = async (app, providers, tools, contexts, config
15386
15520
  });
15387
15521
  return;
15388
15522
  }
15389
- let project = null;
15523
+ let project = void 0;
15390
15524
  if (projectName) {
15391
15525
  let projectQuery = db2("projects").select("*");
15392
15526
  projectQuery = applyAccessControl(projectsSchema4(), projectQuery, user);
@@ -15409,8 +15543,8 @@ var registerOpenAIGatewayRoutes = async (app, providers, tools, contexts, config
15409
15543
  modelId: agent.model,
15410
15544
  user,
15411
15545
  providers,
15412
- agent: { id: agent.id },
15413
- project: project ? { id: project.id } : void 0
15546
+ agent,
15547
+ project
15414
15548
  });
15415
15549
  } catch (err) {
15416
15550
  if (err instanceof ResolveModelError) {
@@ -15587,6 +15721,7 @@ var {
15587
15721
  rbacSchema: rbacSchema2,
15588
15722
  promptLibrarySchema: promptLibrarySchema2,
15589
15723
  contextPresetsSchema: contextPresetsSchema2,
15724
+ teamsSchema: teamsSchema2,
15590
15725
  embedderSettingsSchema: embedderSettingsSchema2,
15591
15726
  promptFavoritesSchema: promptFavoritesSchema2,
15592
15727
  statisticsSchema: statisticsSchema2,
@@ -15636,6 +15771,7 @@ var createExpressRoutes = async (app, providers, tools, contexts, config, evals,
15636
15771
  jobResultsSchema2(),
15637
15772
  promptLibrarySchema2(),
15638
15773
  contextPresetsSchema2(),
15774
+ teamsSchema2(),
15639
15775
  embedderSettingsSchema2(),
15640
15776
  promptFavoritesSchema2(),
15641
15777
  evalRunsSchema2(),
@@ -16022,7 +16158,7 @@ Mood: friendly and intelligent.
16022
16158
  modelId,
16023
16159
  user,
16024
16160
  providers,
16025
- agent: { id: agent.id }
16161
+ agent
16026
16162
  });
16027
16163
  } catch (err) {
16028
16164
  if (err instanceof ResolveModelError) {
@@ -16283,7 +16419,7 @@ ${customInstructions}` : agent.instructions;
16283
16419
  modelId: agent.model,
16284
16420
  user,
16285
16421
  providers,
16286
- agent: { id: agent.id }
16422
+ agent
16287
16423
  });
16288
16424
  } catch (err) {
16289
16425
  if (err instanceof ResolveModelError) {
@@ -17095,7 +17231,9 @@ ${style.markdown}` : params.prompt;
17095
17231
  project_id: project?.id,
17096
17232
  user_name: user.email,
17097
17233
  role_name: user.role?.name,
17098
- project_name: project?.name
17234
+ project_name: project?.name,
17235
+ team_id: user.team?.id,
17236
+ team_name: user.team?.name
17099
17237
  });
17100
17238
  if (tags?.length) {
17101
17239
  upstreamHeaders["x-litellm-tags"] = tags.join(",");
@@ -18140,7 +18278,7 @@ var ExuluMCP = class {
18140
18278
  modelId: agent.model,
18141
18279
  user,
18142
18280
  providers: allProviders,
18143
- agent: { id: agent.id }
18281
+ agent
18144
18282
  });
18145
18283
  const providerapikey = resolved.apiKey;
18146
18284
  if (!isLiteLLMEnabled()) {
@@ -19386,6 +19524,7 @@ var ExuluEval = class {
19386
19524
  init_resolve_model();
19387
19525
  init_singleton();
19388
19526
  var import_zod14 = require("zod");
19527
+ var import_ai14 = require("ai");
19389
19528
  var llmAsJudgeEval = () => {
19390
19529
  if (process.env.REDIS_HOST?.length && process.env.REDIS_PORT?.length) {
19391
19530
  return new ExuluEval({
@@ -19426,27 +19565,27 @@ var llmAsJudgeEval = () => {
19426
19565
  const resolved = await resolveModel({
19427
19566
  modelId: agent.model,
19428
19567
  providers: exuluApp.get().providers,
19429
- agent: { id: agent.id },
19568
+ agent,
19430
19569
  rbacBypass: true
19431
19570
  });
19432
- const providerapikey = resolved.apiKey;
19433
19571
  console.log("[EXULU] prompt", prompt);
19434
- const response = await provider.generateSync({
19435
- agent,
19436
- contexts: [],
19437
- rerankers: [],
19572
+ const { output } = await (0, import_ai14.generateText)({
19573
+ temperature: 0,
19574
+ model: resolved.languageModel,
19575
+ system: "",
19438
19576
  prompt,
19439
- outputSchema: import_zod14.z.object({
19440
- score: import_zod14.z.number().min(0).max(100).describe("The score between 0 and 100.")
19441
- }),
19442
- languageModel: resolved.languageModel,
19443
- providerapikey
19577
+ maxRetries: 2,
19578
+ output: import_ai14.Output.object({
19579
+ schema: import_zod14.z.object({
19580
+ score: import_zod14.z.number().min(0).max(100).describe("The score between 0 and 100.")
19581
+ })
19582
+ })
19444
19583
  });
19445
- console.log("[EXULU] response", response);
19446
- const score = parseFloat(response.score);
19584
+ console.log("[EXULU] output", output);
19585
+ const score = output.score;
19447
19586
  if (isNaN(score)) {
19448
19587
  throw new Error(
19449
- `Generated score from llm as a judge eval is not a number: ${response.score}`
19588
+ `Generated score from llm as a judge eval is not a number: ${output.score}`
19450
19589
  );
19451
19590
  }
19452
19591
  return score;
@@ -22853,6 +22992,7 @@ var {
22853
22992
  agentMessagesSchema: agentMessagesSchema3,
22854
22993
  modelsSchema: modelsSchema3,
22855
22994
  rolesSchema: rolesSchema3,
22995
+ teamsSchema: teamsSchema3,
22856
22996
  usersSchema: usersSchema3,
22857
22997
  skillsSchema: skillsSchema3,
22858
22998
  statisticsSchema: statisticsSchema3,
@@ -22895,6 +23035,7 @@ var up = async function(knex) {
22895
23035
  agentMessagesSchema3(),
22896
23036
  modelsSchema3(),
22897
23037
  rolesSchema3(),
23038
+ teamsSchema3(),
22898
23039
  testCasesSchema3(),
22899
23040
  evalSetsSchema3(),
22900
23041
  evalRunsSchema3(),
@@ -23329,9 +23470,20 @@ var initLiteLLMDatabase = async (packageRoot) => {
23329
23470
  }
23330
23471
  const venvBin = (0, import_node_path8.resolve)(packageRoot, "ee/python/.venv/bin");
23331
23472
  const prismaCli = (0, import_node_path8.resolve)(venvBin, "prisma");
23473
+ const venvLibDir = (0, import_node_path8.resolve)(packageRoot, "ee/python/.venv/lib");
23474
+ const pythonVersionDir = (0, import_node_fs7.existsSync)(venvLibDir) ? (0, import_node_fs7.readdirSync)(venvLibDir).find((entry) => /^python3\.\d+$/.test(entry)) : void 0;
23475
+ if (!pythonVersionDir) {
23476
+ warn([
23477
+ `Could not find a python3.* directory under ${venvLibDir}.`,
23478
+ `Run \`npm run python:setup\` to create the venv.`,
23479
+ `Skipping LiteLLM database setup.`
23480
+ ]);
23481
+ return;
23482
+ }
23332
23483
  const litellmProxyDir = (0, import_node_path8.resolve)(
23333
- packageRoot,
23334
- "ee/python/.venv/lib/python3.12/site-packages/litellm/proxy"
23484
+ venvLibDir,
23485
+ pythonVersionDir,
23486
+ "site-packages/litellm/proxy"
23335
23487
  );
23336
23488
  const schemaPath = (0, import_node_path8.resolve)(litellmProxyDir, "schema.prisma");
23337
23489
  if (!(0, import_node_fs7.existsSync)(prismaCli)) {
@@ -23922,7 +24074,7 @@ var MarkdownChunker = class {
23922
24074
  init_cjs_shims();
23923
24075
  var fs5 = __toESM(require("fs"), 1);
23924
24076
  var path2 = __toESM(require("path"), 1);
23925
- var import_ai14 = require("ai");
24077
+ var import_ai15 = require("ai");
23926
24078
  var import_zod22 = require("zod");
23927
24079
  var import_p_limit = __toESM(require("p-limit"), 1);
23928
24080
  var import_crypto = require("crypto");
@@ -24275,9 +24427,9 @@ If the page contains a flow-chart, schematic, technical drawing or control board
24275
24427
 
24276
24428
  ### 7. Only populate \`corrected_text\` when \`needs_correction\` is true. If the OCR output is accurate, return \`needs_correction: false\` and \`corrected_content: null\`.
24277
24429
  `;
24278
- const result = await (0, import_ai14.generateText)({
24430
+ const result = await (0, import_ai15.generateText)({
24279
24431
  model,
24280
- output: import_ai14.Output.object({
24432
+ output: import_ai15.Output.object({
24281
24433
  schema: import_zod22.z.object({
24282
24434
  needs_correction: import_zod22.z.boolean(),
24283
24435
  corrected_text: import_zod22.z.string().nullable(),
package/dist/index.d.cts CHANGED
@@ -24,15 +24,22 @@ type User = {
24
24
  favourite_agents?: string[];
25
25
  scope_mode?: ApiKeyScopeMode;
26
26
  agent_ids?: string[];
27
- role: {
28
- id: string;
29
- name: string;
30
- agents: "read" | "write";
31
- evals: "read" | "write";
32
- workflows: "read" | "write";
33
- variables: "read" | "write";
34
- users: "read" | "write";
35
- };
27
+ role: UserRole;
28
+ team?: ExuluTeam;
29
+ };
30
+ type UserRole = {
31
+ id: string;
32
+ name: string;
33
+ agents: "read" | "write";
34
+ evals: "read" | "write";
35
+ workflows: "read" | "write";
36
+ variables: "read" | "write";
37
+ users: "read" | "write";
38
+ };
39
+ type ExuluTeam = {
40
+ id: string;
41
+ name: string;
42
+ description?: string;
36
43
  };
37
44
 
38
45
  declare function redisClient(): Promise<{
@@ -789,7 +796,7 @@ declare class ExuluProvider {
789
796
  get providerName(): string;
790
797
  get modelName(): string;
791
798
  tool: (instance: string, providers: ExuluProvider[], contexts: ExuluContext[], rerankers: ExuluReranker[]) => Promise<ExuluTool | null>;
792
- generateSync: ({ prompt, req, user, session, inputMessages, approvedTools, currentTools, currentSkills, allExuluTools, statistics, toolConfigs, providerapikey, languageModel, contexts, rerankers, exuluConfig, agent, instructions, maxStepCount, onTokenUsage, }: {
799
+ generateSync: ({ prompt, req, user, session, inputMessages, approvedTools, currentTools, currentSkills, allExuluTools, statistics, toolConfigs, providerapikey, languageModel, contexts, rerankers, exuluConfig, agent, instructions, maxStepCount, onTokenUsage }: {
793
800
  prompt?: string;
794
801
  user?: User;
795
802
  maxStepCount?: number;
package/dist/index.d.ts CHANGED
@@ -24,15 +24,22 @@ type User = {
24
24
  favourite_agents?: string[];
25
25
  scope_mode?: ApiKeyScopeMode;
26
26
  agent_ids?: string[];
27
- role: {
28
- id: string;
29
- name: string;
30
- agents: "read" | "write";
31
- evals: "read" | "write";
32
- workflows: "read" | "write";
33
- variables: "read" | "write";
34
- users: "read" | "write";
35
- };
27
+ role: UserRole;
28
+ team?: ExuluTeam;
29
+ };
30
+ type UserRole = {
31
+ id: string;
32
+ name: string;
33
+ agents: "read" | "write";
34
+ evals: "read" | "write";
35
+ workflows: "read" | "write";
36
+ variables: "read" | "write";
37
+ users: "read" | "write";
38
+ };
39
+ type ExuluTeam = {
40
+ id: string;
41
+ name: string;
42
+ description?: string;
36
43
  };
37
44
 
38
45
  declare function redisClient(): Promise<{
@@ -789,7 +796,7 @@ declare class ExuluProvider {
789
796
  get providerName(): string;
790
797
  get modelName(): string;
791
798
  tool: (instance: string, providers: ExuluProvider[], contexts: ExuluContext[], rerankers: ExuluReranker[]) => Promise<ExuluTool | null>;
792
- generateSync: ({ prompt, req, user, session, inputMessages, approvedTools, currentTools, currentSkills, allExuluTools, statistics, toolConfigs, providerapikey, languageModel, contexts, rerankers, exuluConfig, agent, instructions, maxStepCount, onTokenUsage, }: {
799
+ generateSync: ({ prompt, req, user, session, inputMessages, approvedTools, currentTools, currentSkills, allExuluTools, statistics, toolConfigs, providerapikey, languageModel, contexts, rerankers, exuluConfig, agent, instructions, maxStepCount, onTokenUsage }: {
793
800
  prompt?: string;
794
801
  user?: User;
795
802
  maxStepCount?: number;