@flamingo-stack/openframe-frontend-core 0.0.532-snapshot.20260811155109 → 0.0.532

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 (151) hide show
  1. package/dist/chat-protocol/decode.d.ts +9 -1
  2. package/dist/chat-protocol/decode.d.ts.map +1 -1
  3. package/dist/chat-protocol/events.d.ts +0 -35
  4. package/dist/chat-protocol/events.d.ts.map +1 -1
  5. package/dist/chat-protocol/index.cjs +3 -72
  6. package/dist/chat-protocol/index.cjs.map +1 -1
  7. package/dist/chat-protocol/index.d.ts +0 -1
  8. package/dist/chat-protocol/index.d.ts.map +1 -1
  9. package/dist/chat-protocol/index.js +4 -67
  10. package/dist/chat-protocol/index.js.map +1 -1
  11. package/dist/chat-protocol/nats-decoder.d.ts +0 -41
  12. package/dist/chat-protocol/nats-decoder.d.ts.map +1 -1
  13. package/dist/{chunk-OLOKQQAP.cjs → chunk-2MBS3YEY.cjs} +5 -5
  14. package/dist/{chunk-OLOKQQAP.cjs.map → chunk-2MBS3YEY.cjs.map} +1 -1
  15. package/dist/{chunk-DFQLUK75.cjs → chunk-2QP67D2L.cjs} +3 -3
  16. package/dist/{chunk-DFQLUK75.cjs.map → chunk-2QP67D2L.cjs.map} +1 -1
  17. package/dist/{chunk-6SMLYZLH.js → chunk-3G7FDE5E.js} +4 -4
  18. package/dist/{chunk-J4BE4FIR.cjs → chunk-4GL2XJ5C.cjs} +4 -4
  19. package/dist/{chunk-J4BE4FIR.cjs.map → chunk-4GL2XJ5C.cjs.map} +1 -1
  20. package/dist/{chunk-LE3BJ5H2.js → chunk-5W3RCZIK.js} +2 -2
  21. package/dist/{chunk-MVGL5NNJ.js → chunk-65NR333L.js} +2 -2
  22. package/dist/{chunk-6W3ULZ4X.js → chunk-7SGBF2I2.js} +6 -6
  23. package/dist/{chunk-6YXN5RHW.js → chunk-ALXLWF75.js} +2 -2
  24. package/dist/{chunk-5U67WTAS.js → chunk-AZBS4PZG.js} +2 -2
  25. package/dist/{chunk-4QKXNWH5.js → chunk-ECR37JHH.js} +2 -2
  26. package/dist/{chunk-ENPGPZIB.cjs → chunk-ETF2QXXU.cjs} +61 -61
  27. package/dist/{chunk-ENPGPZIB.cjs.map → chunk-ETF2QXXU.cjs.map} +1 -1
  28. package/dist/{chunk-UPHN2VRZ.cjs → chunk-GVLA2BPW.cjs} +117 -259
  29. package/dist/chunk-GVLA2BPW.cjs.map +1 -0
  30. package/dist/{chunk-4ZRHVOEB.cjs → chunk-GWFC3NE5.cjs} +31 -31
  31. package/dist/{chunk-4ZRHVOEB.cjs.map → chunk-GWFC3NE5.cjs.map} +1 -1
  32. package/dist/{chunk-GNOK5J34.cjs → chunk-HJDCDOJM.cjs} +37 -37
  33. package/dist/{chunk-GNOK5J34.cjs.map → chunk-HJDCDOJM.cjs.map} +1 -1
  34. package/dist/{chunk-JDW2IL7A.cjs → chunk-HXHA3DCI.cjs} +11 -11
  35. package/dist/{chunk-JDW2IL7A.cjs.map → chunk-HXHA3DCI.cjs.map} +1 -1
  36. package/dist/{chunk-XN4JKIJY.js → chunk-IZOGFZ7N.js} +2 -2
  37. package/dist/{chunk-Z3NOI7X7.cjs → chunk-JZ5XDZYD.cjs} +26 -26
  38. package/dist/{chunk-Z3NOI7X7.cjs.map → chunk-JZ5XDZYD.cjs.map} +1 -1
  39. package/dist/{chunk-YLB6XXO6.js → chunk-KYQZBQYV.js} +2 -2
  40. package/dist/{chunk-RKITTO5V.cjs → chunk-L6EKEYF7.cjs} +14 -14
  41. package/dist/{chunk-RKITTO5V.cjs.map → chunk-L6EKEYF7.cjs.map} +1 -1
  42. package/dist/{chunk-NAV4FRNL.cjs → chunk-LYWSHNK4.cjs} +26 -26
  43. package/dist/{chunk-NAV4FRNL.cjs.map → chunk-LYWSHNK4.cjs.map} +1 -1
  44. package/dist/{chunk-46FKXLNE.js → chunk-OAEJWP7H.js} +2 -2
  45. package/dist/{chunk-2MYDGLJS.cjs → chunk-QEMI34VA.cjs} +87 -87
  46. package/dist/{chunk-2MYDGLJS.cjs.map → chunk-QEMI34VA.cjs.map} +1 -1
  47. package/dist/{chunk-QZ2NAPLF.cjs → chunk-QYNLVIGQ.cjs} +9 -9
  48. package/dist/{chunk-QZ2NAPLF.cjs.map → chunk-QYNLVIGQ.cjs.map} +1 -1
  49. package/dist/{chunk-KMB66NYX.cjs → chunk-TMZS63G2.cjs} +7 -7
  50. package/dist/{chunk-KMB66NYX.cjs.map → chunk-TMZS63G2.cjs.map} +1 -1
  51. package/dist/{chunk-2TUOBFPK.js → chunk-TQ7EPKKO.js} +2 -2
  52. package/dist/{chunk-U555TMPC.js → chunk-UP4RA54U.js} +5 -5
  53. package/dist/{chunk-LIUARTOZ.js → chunk-WINT757E.js} +64 -206
  54. package/dist/chunk-WINT757E.js.map +1 -0
  55. package/dist/{chunk-2XGHEJZK.js → chunk-XBYEPSNZ.js} +4 -4
  56. package/dist/components/case-studies/index.cjs +8 -8
  57. package/dist/components/case-studies/index.js +2 -2
  58. package/dist/components/chat/embeddable-chat.d.ts +0 -13
  59. package/dist/components/chat/embeddable-chat.d.ts.map +1 -1
  60. package/dist/components/chat/hooks/use-sse-chat-adapter.d.ts.map +1 -1
  61. package/dist/components/chat/index.cjs +2 -10
  62. package/dist/components/chat/index.cjs.map +1 -1
  63. package/dist/components/chat/index.js +1 -9
  64. package/dist/components/chat/stream/chat-stream-reducer.d.ts +0 -9
  65. package/dist/components/chat/stream/chat-stream-reducer.d.ts.map +1 -1
  66. package/dist/components/chat/types/message.types.d.ts +0 -15
  67. package/dist/components/chat/types/message.types.d.ts.map +1 -1
  68. package/dist/components/chat/types/network.types.d.ts +0 -4
  69. package/dist/components/chat/types/network.types.d.ts.map +1 -1
  70. package/dist/components/chat/types/processing.types.d.ts +1 -7
  71. package/dist/components/chat/types/processing.types.d.ts.map +1 -1
  72. package/dist/components/chat/utils/index.d.ts +0 -1
  73. package/dist/components/chat/utils/index.d.ts.map +1 -1
  74. package/dist/components/chat/utils/message-segment-accumulator.d.ts +3 -25
  75. package/dist/components/chat/utils/message-segment-accumulator.d.ts.map +1 -1
  76. package/dist/components/chat/utils/process-historical-messages.d.ts.map +1 -1
  77. package/dist/components/contact/index.cjs +3 -3
  78. package/dist/components/contact/index.js +2 -2
  79. package/dist/components/docs/index.cjs +5 -5
  80. package/dist/components/docs/index.js +4 -4
  81. package/dist/components/embeds/index.cjs +3 -3
  82. package/dist/components/embeds/index.js +2 -2
  83. package/dist/components/faq/index.cjs +3 -3
  84. package/dist/components/faq/index.js +2 -2
  85. package/dist/components/features/index.cjs +2 -2
  86. package/dist/components/features/index.js +1 -1
  87. package/dist/components/help-center-pages/index.cjs +22 -22
  88. package/dist/components/help-center-pages/index.js +13 -13
  89. package/dist/components/index.cjs +132 -140
  90. package/dist/components/index.cjs.map +1 -1
  91. package/dist/components/index.js +11 -19
  92. package/dist/components/index.js.map +1 -1
  93. package/dist/components/meeting-scheduler/index.cjs +34 -34
  94. package/dist/components/meeting-scheduler/index.js +3 -3
  95. package/dist/components/navigation/index.cjs +2 -2
  96. package/dist/components/navigation/index.js +1 -1
  97. package/dist/components/onboarding-guides/index.cjs +5 -5
  98. package/dist/components/onboarding-guides/index.js +4 -4
  99. package/dist/components/related-content/index.cjs +3 -3
  100. package/dist/components/related-content/index.js +2 -2
  101. package/dist/components/tickets/index.cjs +6 -6
  102. package/dist/components/tickets/index.js +5 -5
  103. package/dist/components/ui/index.cjs +2 -10
  104. package/dist/components/ui/index.cjs.map +1 -1
  105. package/dist/components/ui/index.js +1 -9
  106. package/dist/index.cjs +2 -10
  107. package/dist/index.cjs.map +1 -1
  108. package/dist/index.js +1 -9
  109. package/dist/utils/index.cjs.map +1 -1
  110. package/dist/utils/index.js.map +1 -1
  111. package/package.json +1 -1
  112. package/src/chat-protocol/__tests__/__snapshots__/nats-decoder-golden.test.ts.snap +0 -70
  113. package/src/chat-protocol/__tests__/nats-decoder-golden.test.ts +1 -108
  114. package/src/chat-protocol/decode.ts +153 -7
  115. package/src/chat-protocol/events.ts +0 -40
  116. package/src/chat-protocol/index.ts +0 -3
  117. package/src/chat-protocol/nats-decoder.ts +3 -111
  118. package/src/components/chat/embeddable-chat.tsx +0 -18
  119. package/src/components/chat/hooks/use-sse-chat-adapter.ts +16 -7
  120. package/src/components/chat/stream/chat-stream-reducer.ts +3 -49
  121. package/src/components/chat/types/message.types.ts +0 -15
  122. package/src/components/chat/types/network.types.ts +0 -4
  123. package/src/components/chat/types/processing.types.ts +1 -12
  124. package/src/components/chat/utils/__tests__/process-historical-messages-approvals.test.ts +0 -92
  125. package/src/components/chat/utils/index.ts +0 -9
  126. package/src/components/chat/utils/message-segment-accumulator.ts +32 -62
  127. package/src/components/chat/utils/process-historical-messages.ts +6 -40
  128. package/dist/chat-protocol/confirm-tool.d.ts +0 -50
  129. package/dist/chat-protocol/confirm-tool.d.ts.map +0 -1
  130. package/dist/chat-protocol/leading-frames.d.ts +0 -38
  131. package/dist/chat-protocol/leading-frames.d.ts.map +0 -1
  132. package/dist/chunk-LIUARTOZ.js.map +0 -1
  133. package/dist/chunk-UPHN2VRZ.cjs.map +0 -1
  134. package/dist/components/chat/utils/approval-display.d.ts +0 -49
  135. package/dist/components/chat/utils/approval-display.d.ts.map +0 -1
  136. package/src/chat-protocol/confirm-tool.ts +0 -67
  137. package/src/chat-protocol/leading-frames.ts +0 -175
  138. package/src/components/chat/utils/approval-display.ts +0 -70
  139. /package/dist/{chunk-6SMLYZLH.js.map → chunk-3G7FDE5E.js.map} +0 -0
  140. /package/dist/{chunk-LE3BJ5H2.js.map → chunk-5W3RCZIK.js.map} +0 -0
  141. /package/dist/{chunk-MVGL5NNJ.js.map → chunk-65NR333L.js.map} +0 -0
  142. /package/dist/{chunk-6W3ULZ4X.js.map → chunk-7SGBF2I2.js.map} +0 -0
  143. /package/dist/{chunk-6YXN5RHW.js.map → chunk-ALXLWF75.js.map} +0 -0
  144. /package/dist/{chunk-5U67WTAS.js.map → chunk-AZBS4PZG.js.map} +0 -0
  145. /package/dist/{chunk-4QKXNWH5.js.map → chunk-ECR37JHH.js.map} +0 -0
  146. /package/dist/{chunk-XN4JKIJY.js.map → chunk-IZOGFZ7N.js.map} +0 -0
  147. /package/dist/{chunk-YLB6XXO6.js.map → chunk-KYQZBQYV.js.map} +0 -0
  148. /package/dist/{chunk-46FKXLNE.js.map → chunk-OAEJWP7H.js.map} +0 -0
  149. /package/dist/{chunk-2TUOBFPK.js.map → chunk-TQ7EPKKO.js.map} +0 -0
  150. /package/dist/{chunk-U555TMPC.js.map → chunk-UP4RA54U.js.map} +0 -0
  151. /package/dist/{chunk-2XGHEJZK.js.map → chunk-XBYEPSNZ.js.map} +0 -0
@@ -4,10 +4,6 @@ var END_OF_LEADING = "";
4
4
  var TRAILER_SENTINEL = "";
5
5
 
6
6
  // src/chat-protocol/events.ts
7
- var GUIDE_ORIGIN = "guide";
8
- function isGuideOrigin(source) {
9
- return source?.origin === GUIDE_ORIGIN;
10
- }
11
7
  var ESCALATION_STATE = {
12
8
  PENDING: "PENDING",
13
9
  APPROVED: "APPROVED",
@@ -47,7 +43,7 @@ function encodeTrailingUsageFrame(frame) {
47
43
  return encoder.encode(TRAILER_SENTINEL + JSON.stringify(frame));
48
44
  }
49
45
 
50
- // src/chat-protocol/leading-frames.ts
46
+ // src/chat-protocol/decode.ts
51
47
  function escapeThinkingTags(text) {
52
48
  return text.replace(/</g, "&lt;");
53
49
  }
@@ -154,8 +150,6 @@ function mapLeadingFrame(meta, out) {
154
150
  });
155
151
  }
156
152
  }
157
-
158
- // src/chat-protocol/decode.ts
159
153
  function createSseFrameDecoder() {
160
154
  const textDecoder = new TextDecoder();
161
155
  let buffer = "";
@@ -303,37 +297,6 @@ function normalizeAskOptions(raw) {
303
297
  description: typeof item.description === "string" ? item.description : void 0
304
298
  })).filter((option) => option.label.length > 0);
305
299
  }
306
- var AGENT_OWNED_EVENTS = /* @__PURE__ */ new Set([
307
- "usage",
308
- "token-usage",
309
- "status",
310
- "compaction",
311
- "participant",
312
- "dialog-closed"
313
- ]);
314
- var ORIGIN_BEARING_EVENTS = /* @__PURE__ */ new Set([
315
- "approval-request",
316
- "approval-resolved"
317
- ]);
318
- function guideEventForNats(event) {
319
- switch (event.type) {
320
- case "text-delta":
321
- return { type: "guide-delta", text: event.text };
322
- case "thinking-delta":
323
- return { type: "thinking-delta", text: escapeThinkingTags(event.text) };
324
- case "metadata":
325
- return typeof event.conversationId === "string" && event.conversationId ? { type: "metadata", conversationId: event.conversationId, origin: GUIDE_ORIGIN } : null;
326
- default:
327
- if (AGENT_OWNED_EVENTS.has(event.type)) return null;
328
- return ORIGIN_BEARING_EVENTS.has(event.type) ? { ...event, origin: GUIDE_ORIGIN } : event;
329
- }
330
- }
331
- function guideFrameEvent(frame) {
332
- const events = [];
333
- mapLeadingFrame(frame, events);
334
- const event = events[0];
335
- return event ? guideEventForNats(event) : null;
336
- }
337
300
  function decodeNatsChunk(chunk) {
338
301
  if (!chunk || typeof chunk !== "object") return null;
339
302
  const data = chunk;
@@ -368,20 +331,11 @@ function decodeNatsChunk(chunk) {
368
331
  return { type: "thinking-delta", text: data.text, ...seq };
369
332
  }
370
333
  return null;
371
- // Two shapes share this chunk type. `text` is the answer body the agent
372
- // streams (and persists). `payload` is a Product Guide frame re-streamed
373
- // verbatim from the hub — decoded through the shared frame table, with the
374
- // narrowing `guideFrameEvent` documents.
375
- case MESSAGE_TYPE.GUIDE: {
334
+ case MESSAGE_TYPE.GUIDE:
376
335
  if (typeof data.text === "string") {
377
336
  return { type: "guide-delta", text: data.text, ...seq };
378
337
  }
379
- const frame = data.payload;
380
- if (!frame || typeof frame !== "object" || Array.isArray(frame)) return null;
381
- const event = guideFrameEvent(frame);
382
- if (!event) return null;
383
- return { ...event, ...seq };
384
- }
338
+ return null;
385
339
  // An ask card is only an ask card with something to pick: a question and at
386
340
  // least one option. Anything less is dropped rather than rendered as an
387
341
  // empty card the user can't answer — the backend already falls back to a
@@ -561,23 +515,6 @@ function decodeNatsChunk(chunk) {
561
515
  }
562
516
  }
563
517
 
564
- // src/chat-protocol/confirm-tool.ts
565
- function buildConfirmToolBody(request) {
566
- return {
567
- proposal_id: request.proposalId,
568
- action: request.action,
569
- conversationId: request.conversationId
570
- };
571
- }
572
- async function readServerErrorMessage(response) {
573
- try {
574
- const body = await response.json();
575
- if (typeof body?.error === "string" && body.error.length > 0) return body.error;
576
- } catch {
577
- }
578
- return null;
579
- }
580
-
581
518
  // src/chat-protocol/ip-normalize.ts
582
519
  var IP_BUCKET_KEY_MAX_LENGTH = 64;
583
520
  function isIpv4(value) {
@@ -651,6 +588,6 @@ function envFlagEnabled(name) {
651
588
  return v !== "" && v !== "0" && v !== "false" && v !== "off";
652
589
  }
653
590
 
654
- export { CHAT_OWNER_ADMIN, END_OF_LEADING, ESCALATION_STATE, FRAME_TERMINATOR, GUIDE_ORIGIN, IP_BUCKET_KEY_MAX_LENGTH, TRAILER_SENTINEL, buildConfirmToolBody, createSseFrameDecoder, decodeNatsChunk, encodeEndOfLeading, encodeLeadingFrame, encodeTextDelta, encodeTrailingUsageFrame, envFlagEnabled, escalationResolvedStatus, escapeThinkingTags, guideEventForNats, guideFrameEvent, isGuideOrigin, normalizeAskOptions, normalizeIpForBucketKey, readServerErrorMessage, stripSentinelBytes };
591
+ export { CHAT_OWNER_ADMIN, END_OF_LEADING, ESCALATION_STATE, FRAME_TERMINATOR, IP_BUCKET_KEY_MAX_LENGTH, TRAILER_SENTINEL, createSseFrameDecoder, decodeNatsChunk, encodeEndOfLeading, encodeLeadingFrame, encodeTextDelta, encodeTrailingUsageFrame, envFlagEnabled, escalationResolvedStatus, escapeThinkingTags, normalizeAskOptions, normalizeIpForBucketKey, stripSentinelBytes };
655
592
  //# sourceMappingURL=index.js.map
656
593
  //# sourceMappingURL=index.js.map