@burdenoff/website-sdk 2026.922.1 → 2026.922.3

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.
@@ -263,6 +263,18 @@ var EXPLORE_MESSAGE_FIELDS = (
263
263
  completedAt
264
264
  `
265
265
  );
266
+ var EXPLORE_OWN_MESSAGE_FIELDS = (
267
+ /* GraphQL */
268
+ `
269
+ ${EXPLORE_MESSAGE_FIELDS}
270
+ feedback {
271
+ rating
272
+ reason
273
+ comment
274
+ createdAt
275
+ }
276
+ `
277
+ );
266
278
  var EXPLORE_CATALOG_QUERY = (
267
279
  /* GraphQL */
268
280
  `
@@ -295,7 +307,7 @@ var EXPLORE_MESSAGE_QUERY = (
295
307
  `
296
308
  query ExploreMessage($conversationToken: String!, $id: ID!) {
297
309
  exploreMessage(conversationToken: $conversationToken, id: $id) {
298
- ${EXPLORE_MESSAGE_FIELDS}
310
+ ${EXPLORE_OWN_MESSAGE_FIELDS}
299
311
  }
300
312
  }
301
313
  `
@@ -313,10 +325,10 @@ var SEND_EXPLORE_MESSAGE_MUTATION = (
313
325
  createdAt
314
326
  }
315
327
  userMessage {
316
- ${EXPLORE_MESSAGE_FIELDS}
328
+ ${EXPLORE_OWN_MESSAGE_FIELDS}
317
329
  }
318
330
  assistantMessage {
319
- ${EXPLORE_MESSAGE_FIELDS}
331
+ ${EXPLORE_OWN_MESSAGE_FIELDS}
320
332
  }
321
333
  remainingToday
322
334
  }
@@ -333,6 +345,22 @@ var RECORD_EXPLORE_CLICK_MUTATION = (
333
345
  }
334
346
  `
335
347
  );
348
+ var SUBMIT_EXPLORE_FEEDBACK_MUTATION = (
349
+ /* GraphQL */
350
+ `
351
+ mutation SubmitExploreFeedback($input: SubmitExploreFeedbackInput!) {
352
+ submitExploreFeedback(input: $input) {
353
+ recorded
354
+ feedback {
355
+ rating
356
+ reason
357
+ comment
358
+ createdAt
359
+ }
360
+ }
361
+ }
362
+ `
363
+ );
336
364
  var CREATE_EXPLORE_SHARE_LINK_MUTATION = (
337
365
  /* GraphQL */
338
366
  `
@@ -616,13 +644,13 @@ var FALLBACK_EXPLORE_LIMITS = {
616
644
  historyTurns: 6
617
645
  };
618
646
  var DEFAULT_EXPLORE_EXAMPLE_PROMPTS = [
619
- "What does this product actually do?",
620
- "Which Burdenoff product fits my team?",
621
- "How do I get started, step by step?",
622
- "What does it integrate with?"
647
+ "Every course we run lives in a different spreadsheet.",
648
+ "We only hear a machine is down after the line has stopped.",
649
+ "Members quietly stop showing up and we never know why.",
650
+ "Which of your products fits a problem like mine?"
623
651
  ];
624
- var FALLBACK_WELCOME_TITLE = "Ask anything about our products";
625
- var FALLBACK_WELCOME_BODY = "Get straight answers drawn from our product documentation and public pages \u2014 with links back to the exact page each answer came from.";
652
+ var FALLBACK_WELCOME_TITLE = "What problem are you trying to solve?";
653
+ var FALLBACK_WELCOME_BODY = "Describe the problem you're facing, in your own words. You can also ask about a specific product or compare a few. Every answer comes straight from our documentation.";
626
654
  function buildFallbackCatalog(examplePrompts, welcome) {
627
655
  return {
628
656
  enabled: true,
@@ -1381,6 +1409,42 @@ function useExploreChat(options = {}) {
1381
1409
  },
1382
1410
  [client]
1383
1411
  );
1412
+ const submitFeedback = useCallback(
1413
+ async (messageId, rating, detail) => {
1414
+ const token = conversationTokenRef.current;
1415
+ if (!token) return false;
1416
+ const comment = detail?.comment?.trim();
1417
+ const input = {
1418
+ conversationToken: token,
1419
+ messageId,
1420
+ rating,
1421
+ // Only meaningful with NOT_HELPFUL. The server stores null for HELPFUL either
1422
+ // way; sending it would just be noise the backend has to defend against.
1423
+ reason: rating === "NOT_HELPFUL" ? detail?.reason ?? null : null,
1424
+ comment: comment ? comment : null
1425
+ };
1426
+ try {
1427
+ const res = await client.mutate(
1428
+ SUBMIT_EXPLORE_FEEDBACK_MUTATION,
1429
+ { input }
1430
+ );
1431
+ const result = res?.data?.submitExploreFeedback;
1432
+ if (!result?.recorded) return false;
1433
+ const recorded = result.feedback;
1434
+ if (recorded && mountedRef.current) {
1435
+ setMessages(
1436
+ (current) => current.map(
1437
+ (message) => message.id === messageId ? { ...message, feedback: recorded } : message
1438
+ )
1439
+ );
1440
+ }
1441
+ return true;
1442
+ } catch {
1443
+ return false;
1444
+ }
1445
+ },
1446
+ [client]
1447
+ );
1384
1448
  return {
1385
1449
  phase,
1386
1450
  catalog,
@@ -1400,6 +1464,7 @@ function useExploreChat(options = {}) {
1400
1464
  deleteConversation,
1401
1465
  clearHistory,
1402
1466
  recordClick,
1467
+ submitFeedback,
1403
1468
  createShareLink,
1404
1469
  isSharedView
1405
1470
  };