@exulu/backend 5.10.1 → 5.11.0

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.d.cts CHANGED
@@ -861,11 +861,13 @@ declare class ExuluContext {
861
861
  getItem: ({ item }: {
862
862
  item: Item;
863
863
  }) => Promise<Item>;
864
- getItems: ({ filters, fields, user, role, }: {
864
+ getItems: ({ filters, fields, user, role, limit, }: {
865
865
  filters?: any[];
866
866
  fields?: string[];
867
867
  user?: User;
868
868
  role?: string;
869
+ /** Caps the number of rows returned. Omitted or <= 0 → no cap (unchanged). */
870
+ limit?: number;
869
871
  }) => Promise<Item[]>;
870
872
  embeddings: {
871
873
  generate: {
package/dist/index.d.ts CHANGED
@@ -861,11 +861,13 @@ declare class ExuluContext {
861
861
  getItem: ({ item }: {
862
862
  item: Item;
863
863
  }) => Promise<Item>;
864
- getItems: ({ filters, fields, user, role, }: {
864
+ getItems: ({ filters, fields, user, role, limit, }: {
865
865
  filters?: any[];
866
866
  fields?: string[];
867
867
  user?: User;
868
868
  role?: string;
869
+ /** Caps the number of rows returned. Omitted or <= 0 → no cap (unchanged). */
870
+ limit?: number;
869
871
  }) => Promise<Item[]>;
870
872
  embeddings: {
871
873
  generate: {
package/dist/index.js CHANGED
@@ -63,6 +63,7 @@ import {
63
63
  VIEW_DOCUMENT_PAGE_TOOL_NAME,
64
64
  applyAccessControl,
65
65
  applyFilters,
66
+ applyFiltersGrouped,
66
67
  applyMap,
67
68
  applySorting,
68
69
  assertAllowedField,
@@ -136,6 +137,7 @@ import {
136
137
  initAudit,
137
138
  isExternalOrAnonymousUser,
138
139
  isIgnoredArtifactPath,
140
+ isPublicSurface,
139
141
  l2normalize,
140
142
  listS3ObjectsByPrefix,
141
143
  mapStreamErrorMessage,
@@ -181,6 +183,7 @@ import {
181
183
  setEntityModelSetting,
182
184
  shouldShowSourcesToUser,
183
185
  sliceHistoryAtCheckpoint,
186
+ treatAsGuest,
184
187
  truncateToolOutput,
185
188
  updateStatistic,
186
189
  uploadFile,
@@ -190,7 +193,7 @@ import {
190
193
  verifyCredentialNonce,
191
194
  willEmbedOnQueue,
192
195
  workflowTemplatesSchema
193
- } from "./chunk-TFWF6WKM.js";
196
+ } from "./chunk-3AEINUGF.js";
194
197
  import {
195
198
  LITELLM_UI_PATH,
196
199
  ResolveModelError,
@@ -1162,7 +1165,7 @@ var itemsPaginationRequest = async ({
1162
1165
  }
1163
1166
  const tableName = table.name.plural.toLowerCase();
1164
1167
  let countQuery = db(tableName);
1165
- countQuery = applyFilters(countQuery, filters, table);
1168
+ countQuery = applyFiltersGrouped(countQuery, filters, table);
1166
1169
  countQuery = applyAccessControl(table, countQuery, user);
1167
1170
  const countResult = await countQuery.count("* as count");
1168
1171
  const itemCount = Number(countResult[0]?.count || 0);
@@ -1171,7 +1174,7 @@ var itemsPaginationRequest = async ({
1171
1174
  const hasPreviousPage = currentPage > 1;
1172
1175
  const hasNextPage = currentPage <= pageCount - 1;
1173
1176
  let dataQuery = db(tableName);
1174
- dataQuery = applyFilters(dataQuery, filters, table);
1177
+ dataQuery = applyFiltersGrouped(dataQuery, filters, table);
1175
1178
  dataQuery = applyAccessControl(table, dataQuery, user);
1176
1179
  dataQuery = applySorting(dataQuery, sort, void 0, table);
1177
1180
  if (page > 1) {
@@ -1312,7 +1315,7 @@ function createQueries(table, tools, contexts) {
1312
1315
  const requestedFields = getRequestedFields(info);
1313
1316
  const sanitizedFields = sanitizeRequestedFields(table, requestedFields);
1314
1317
  let query = db.from(tableNamePlural).select(sanitizedFields);
1315
- query = applyFilters(query, filters, table);
1318
+ query = applyFiltersGrouped(query, filters, table);
1316
1319
  query = applyAccessControl(table, query, context.user);
1317
1320
  query = applySorting(query, sort, void 0, table);
1318
1321
  let result = await query.first();
@@ -1359,7 +1362,7 @@ function createQueries(table, tools, contexts) {
1359
1362
  const { filters = [], groupBy, limit = 10 } = args;
1360
1363
  const { db } = context;
1361
1364
  let query = db(tableNamePlural);
1362
- query = applyFilters(query, filters, table);
1365
+ query = applyFiltersGrouped(query, filters, table);
1363
1366
  query = applyAccessControl(table, query, context.user);
1364
1367
  query = query.limit(limit);
1365
1368
  if (groupBy) {
@@ -4554,17 +4557,6 @@ async function recallMemories({ agent, contexts, query, user, db, previousUserTu
4554
4557
  return { collector, memoryItems: chunks, promptBlock: buildMemoryPromptBlock(collector.list()) };
4555
4558
  }
4556
4559
 
4557
- // src/exulu/public-surface.ts
4558
- var PUBLIC_SURFACE_HEADER = "x-public-surface";
4559
- function isPublicSurface(req) {
4560
- const raw = req?.headers?.[PUBLIC_SURFACE_HEADER];
4561
- const value = Array.isArray(raw) ? raw[0] : raw;
4562
- return value === "1" || value === "true";
4563
- }
4564
- function treatAsGuest(req, user) {
4565
- return isPublicSurface(req) || !user?.id;
4566
- }
4567
-
4568
4560
  // src/exulu/skills/decisions.ts
4569
4561
  var SKILL_TOOL_IDS = ["skill_create", "skill_update"];
4570
4562
  var isSkillToolId = (id) => SKILL_TOOL_IDS.includes(id);
@@ -203,6 +203,15 @@ export async function runRoutingPhase(opts: {
203
203
  }),
204
204
  });
205
205
  } catch (err) {
206
+ // The step text tells the user the hints are gone; only the log can
207
+ // tell anyone WHY (a cooled-down deployment, a tag refusal, empty
208
+ // output from thinking starvation). Without it the degradation is
209
+ // permanent and undiagnosable from the outside — M&V saw this line on
210
+ // every question with nothing to go on.
211
+ console.warn(
212
+ "[EXULU pipeline] doc/page detection failed — skipping filename and page hints.",
213
+ err,
214
+ );
206
215
  steps.push({ text: "Doc/page detection failed — skipping filename and page hints." });
207
216
  return {
208
217
  output: {
@@ -227,6 +236,14 @@ export async function runRoutingPhase(opts: {
227
236
  messages: [{ role: "user", content: question }],
228
237
  });
229
238
  } catch (err) {
239
+ // Silent in the chat on purpose (an empty list is the normal answer
240
+ // for most questions, so a degradation step here would be noise), and
241
+ // therefore the log is the ONLY trace: a failure makes every "search
242
+ // in the tickets" look like it never named a knowledge base.
243
+ console.warn(
244
+ "[EXULU pipeline] explicit knowledge base detection failed — treating the question as naming none.",
245
+ err,
246
+ );
230
247
  return { output: { explicitlyRequestedKnowledgeBases: [] as string[] } };
231
248
  }
232
249
  })(),
@@ -374,7 +391,13 @@ export async function runRoutingPhase(opts: {
374
391
  });
375
392
  }
376
393
  } catch (err) {
377
- // Classification failed → implicit all-main (degraded)
394
+ // Classification failed → implicit all-main (degraded). Same reason as
395
+ // the two detection catches above: the step says the routing degraded,
396
+ // the log is the only place that can say why.
397
+ console.warn(
398
+ "[EXULU pipeline] classification failed — using the implicit all-main rule.",
399
+ err,
400
+ );
378
401
  mainContexts = enabledContexts.map((c) => c.id);
379
402
  fallbackContexts = [];
380
403
  steps.push({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@exulu/backend",
3
3
  "author": "Qventu B.V.",
4
- "version": "5.10.1",
4
+ "version": "5.11.0",
5
5
  "main": "./dist/index.js",
6
6
  "private": false,
7
7
  "publishConfig": {
@@ -120,13 +120,13 @@
120
120
  "@opentelemetry/semantic-conventions": "^1.36.0",
121
121
  "@opentelemetry/winston-transport": "^0.14.1",
122
122
  "@perplexity-ai/perplexity_ai": "^0.25.0",
123
- "ai": "^6.0.49",
123
+ "ai": "6.0.330",
124
124
  "bash-tool": "^1.3.16",
125
125
  "bcryptjs": "^3.0.2",
126
126
  "body-parser": "^2.2.0",
127
- "busboy": "^1.6.0",
128
127
  "bullmq": "^5.48.1",
129
128
  "bullmq-otel": "^1.0.1",
129
+ "busboy": "^1.6.0",
130
130
  "class-validator": "^0.14.2",
131
131
  "cookie-parser": "^1.4.7",
132
132
  "cors": "^2.8.5",