@burtson-labs/bandit-engine 2.0.65 → 2.0.66

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/chat-IWRBVOVP.mjs +16 -0
  2. package/dist/chat-provider.js +4 -0
  3. package/dist/chat-provider.js.map +1 -1
  4. package/dist/chat-provider.mjs +5 -5
  5. package/dist/{chunk-EUBVBTB3.mjs → chunk-4D7245ZO.mjs} +55 -30
  6. package/dist/chunk-4D7245ZO.mjs.map +1 -0
  7. package/dist/{chunk-FXFTA5PZ.mjs → chunk-6DY7W4NK.mjs} +3 -3
  8. package/dist/{chunk-VTC6AIWY.mjs → chunk-6ITUH375.mjs} +3 -3
  9. package/dist/{chunk-O44AP4XI.mjs → chunk-EM2DB6NP.mjs} +53 -9
  10. package/dist/chunk-EM2DB6NP.mjs.map +1 -0
  11. package/dist/{chunk-D55E6ZDV.mjs → chunk-HHMGNCBS.mjs} +5 -5
  12. package/dist/{chunk-6QTTNYF2.mjs → chunk-IDZEEONG.mjs} +2 -2
  13. package/dist/{chunk-HKQSZALO.mjs → chunk-JURUEF52.mjs} +4 -4
  14. package/dist/{chunk-IPMTNREZ.mjs → chunk-LWHSOEPR.mjs} +6 -2
  15. package/dist/{chunk-IPMTNREZ.mjs.map → chunk-LWHSOEPR.mjs.map} +1 -1
  16. package/dist/{chunk-O7M4OPZU.mjs → chunk-U633CJBV.mjs} +2 -2
  17. package/dist/{chunk-7EPFQDJW.mjs → chunk-ZYQJVZK2.mjs} +18 -11
  18. package/dist/{chunk-7EPFQDJW.mjs.map → chunk-ZYQJVZK2.mjs.map} +1 -1
  19. package/dist/index.js +115 -35
  20. package/dist/index.js.map +1 -1
  21. package/dist/index.mjs +10 -10
  22. package/dist/management/management.js +114 -34
  23. package/dist/management/management.js.map +1 -1
  24. package/dist/management/management.mjs +8 -8
  25. package/dist/modals/chat-modal/chat-modal.js +4 -0
  26. package/dist/modals/chat-modal/chat-modal.js.map +1 -1
  27. package/dist/modals/chat-modal/chat-modal.mjs +4 -4
  28. package/dist/{modelStore-FBPBG7TI.mjs → modelStore-KCJPXFKO.mjs} +2 -2
  29. package/package.json +1 -1
  30. package/dist/chat-57M4OXFX.mjs +0 -16
  31. package/dist/chunk-EUBVBTB3.mjs.map +0 -1
  32. package/dist/chunk-O44AP4XI.mjs.map +0 -1
  33. /package/dist/{chat-57M4OXFX.mjs.map → chat-IWRBVOVP.mjs.map} +0 -0
  34. /package/dist/{chunk-FXFTA5PZ.mjs.map → chunk-6DY7W4NK.mjs.map} +0 -0
  35. /package/dist/{chunk-VTC6AIWY.mjs.map → chunk-6ITUH375.mjs.map} +0 -0
  36. /package/dist/{chunk-D55E6ZDV.mjs.map → chunk-HHMGNCBS.mjs.map} +0 -0
  37. /package/dist/{chunk-6QTTNYF2.mjs.map → chunk-IDZEEONG.mjs.map} +0 -0
  38. /package/dist/{chunk-HKQSZALO.mjs.map → chunk-JURUEF52.mjs.map} +0 -0
  39. /package/dist/{chunk-O7M4OPZU.mjs.map → chunk-U633CJBV.mjs.map} +0 -0
  40. /package/dist/{modelStore-FBPBG7TI.mjs.map → modelStore-KCJPXFKO.mjs.map} +0 -0
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  ChatProvider,
3
3
  chat_provider_default
4
- } from "./chunk-D55E6ZDV.mjs";
4
+ } from "./chunk-HHMGNCBS.mjs";
5
5
  import "./chunk-ONQMRE2G.mjs";
6
- import "./chunk-VTC6AIWY.mjs";
7
- import "./chunk-6QTTNYF2.mjs";
8
- import "./chunk-EUBVBTB3.mjs";
9
- import "./chunk-IPMTNREZ.mjs";
6
+ import "./chunk-6ITUH375.mjs";
7
+ import "./chunk-IDZEEONG.mjs";
8
+ import "./chunk-4D7245ZO.mjs";
9
+ import "./chunk-LWHSOEPR.mjs";
10
10
  import "./chunk-H3BYFEIE.mjs";
11
11
  import "./chunk-KCI46M23.mjs";
12
12
  import "./chunk-BJTO5JO5.mjs";
@@ -2,7 +2,7 @@ import {
2
2
  indexedDBService_default,
3
3
  useModelStore,
4
4
  usePackageSettingsStore
5
- } from "./chunk-IPMTNREZ.mjs";
5
+ } from "./chunk-LWHSOEPR.mjs";
6
6
  import {
7
7
  useAIProviderStore
8
8
  } from "./chunk-H3BYFEIE.mjs";
@@ -2361,42 +2361,65 @@ var getRandomTopicOfInterest = () => {
2361
2361
  const randomTopic = TOPICS[randomIndex];
2362
2362
  return randomTopic;
2363
2363
  };
2364
+ var pickDistinctRandomTopics = (count) => {
2365
+ const pool = [...TOPICS];
2366
+ const picked = [];
2367
+ const n = Math.min(Math.max(count, 0), pool.length);
2368
+ for (let i = 0; i < n; i++) {
2369
+ const idx = randomRange(0, pool.length - 1);
2370
+ picked.push(pool[idx]);
2371
+ pool.splice(idx, 1);
2372
+ }
2373
+ return picked;
2374
+ };
2364
2375
  var getStableQuestionPrompt = (args) => {
2365
- const { limit, topicOfInterest, modelSystemPrompt } = args;
2376
+ const { limit, topicOfInterest, modelSystemPrompt, interests, knowledgeTopics, webSearchAvailable } = args;
2366
2377
  if (limit < 1 || limit > 10) {
2367
2378
  throw new Error("Limit must be between 1 and 10");
2368
2379
  }
2369
2380
  const seed = generateSeed();
2370
- let prompt = `You are a helpful assistant.
2371
-
2372
- The following seed uniquely identifies the topic: "${seed}"`;
2381
+ const lines = [
2382
+ `You are crafting fresh, engaging conversation starters for a chat app's home screen.`,
2383
+ ``,
2384
+ `Variation seed (make this set different from any previous set): "${seed}"`
2385
+ ];
2373
2386
  if (modelSystemPrompt && modelSystemPrompt.trim()) {
2374
- prompt += `
2375
-
2376
- Based on this specialized assistant profile: "${modelSystemPrompt.trim()}"`;
2387
+ lines.push(``, `Tailor the questions to this assistant's role and expertise: "${modelSystemPrompt.trim()}"`);
2377
2388
  }
2378
- prompt += `
2379
-
2380
- Generate ${limit} concise (5\u201320 words, try to use this entire range), natural-sounding questions a user might ask${modelSystemPrompt ? " this specialized assistant" : " an AI assistant"}. These should be:
2381
-
2382
- - Relevant to ${topicOfInterest}`;
2383
- if (modelSystemPrompt && modelSystemPrompt.trim()) {
2384
- prompt += `
2385
- - Aligned with the assistant's specialized capabilities and knowledge area`;
2389
+ if (interests && interests.length) {
2390
+ lines.push(
2391
+ ``,
2392
+ `The user is especially interested in: ${interests.join(", ")}. Lean toward these, but do NOT make every question about the same one.`
2393
+ );
2386
2394
  }
2387
- prompt += `
2388
- - Specific enough to be practical
2389
- - Easy to understand and not abstract
2390
-
2391
- Do not:
2392
- - Refer to yourself or use phrases like "As an AI..."
2393
- - Include greetings, explanations, or personality
2394
- - Include jokes, fiction, or quotes
2395
- - Number, bullet, or otherwise prefix the questions with extra characters
2396
- - Repeat the same idea phrased differently \u2014 each question must explore a distinct angle or subtopic
2397
-
2398
- Output only ${limit} questions \u2014 one per line, with no leading numbers, bullets, or prefixes.`;
2399
- return prompt.trim();
2395
+ if (knowledgeTopics && knowledgeTopics.length) {
2396
+ lines.push(
2397
+ ``,
2398
+ `The user keeps these documents in their library: ${knowledgeTopics.join("; ")}. Include one or two questions that draw on this material.`
2399
+ );
2400
+ }
2401
+ lines.push(
2402
+ ``,
2403
+ `Spread the set across a VARIETY of these topics so it never feels repetitive (do not cluster on one): ${topicOfInterest}.`
2404
+ );
2405
+ if (webSearchAvailable) {
2406
+ lines.push(
2407
+ ``,
2408
+ `This assistant can search the web for live information. Include 2\u20133 questions that invite current, up-to-date answers (latest news, recent developments, "today" / "this week") so the user discovers that capability.`
2409
+ );
2410
+ }
2411
+ lines.push(
2412
+ ``,
2413
+ `Generate ${limit} concise (5\u201320 words), natural-sounding questions a user might ask${modelSystemPrompt ? " this specialized assistant" : " an AI assistant"}. Requirements:`,
2414
+ `- Each question must explore a DISTINCT topic or angle \u2014 no two may be similar or rephrasings of each other.`,
2415
+ `- Vary the type across the set: practical how-to, curious exploration, current/topical, creative, and learning.`,
2416
+ `- Specific and concrete, easy to understand, not abstract.`,
2417
+ ``,
2418
+ `Do not refer to yourself, say "As an AI", add greetings, explanations, jokes, fiction, quotes, or number/bullet the lines.`,
2419
+ ``,
2420
+ `Output only ${limit} questions \u2014 one per line, with no leading numbers, bullets, or prefixes.`
2421
+ );
2422
+ return lines.join("\n").trim();
2400
2423
  };
2401
2424
 
2402
2425
  // src/services/prompts/promptUtils.ts
@@ -5898,7 +5921,9 @@ export {
5898
5921
  fetchAndConvertToBase64,
5899
5922
  detectTransparency,
5900
5923
  resolveAvatar,
5924
+ TOPICS,
5901
5925
  getRandomTopicOfInterest,
5926
+ pickDistinctRandomTopics,
5902
5927
  NotificationService,
5903
5928
  notificationService,
5904
5929
  generateConversationStarters,
@@ -5924,4 +5949,4 @@ export {
5924
5949
  useNotification,
5925
5950
  NotificationProvider
5926
5951
  };
5927
- //# sourceMappingURL=chunk-EUBVBTB3.mjs.map
5952
+ //# sourceMappingURL=chunk-4D7245ZO.mjs.map