@flamingo-stack/openframe-frontend-core 0.0.532 → 0.0.533

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/confirm-tool.d.ts +50 -0
  2. package/dist/chat-protocol/confirm-tool.d.ts.map +1 -0
  3. package/dist/chat-protocol/decode.d.ts +1 -9
  4. package/dist/chat-protocol/decode.d.ts.map +1 -1
  5. package/dist/chat-protocol/events.d.ts +35 -0
  6. package/dist/chat-protocol/events.d.ts.map +1 -1
  7. package/dist/chat-protocol/index.cjs +72 -3
  8. package/dist/chat-protocol/index.cjs.map +1 -1
  9. package/dist/chat-protocol/index.d.ts +1 -0
  10. package/dist/chat-protocol/index.d.ts.map +1 -1
  11. package/dist/chat-protocol/index.js +67 -4
  12. package/dist/chat-protocol/index.js.map +1 -1
  13. package/dist/chat-protocol/leading-frames.d.ts +38 -0
  14. package/dist/chat-protocol/leading-frames.d.ts.map +1 -0
  15. package/dist/chat-protocol/nats-decoder.d.ts +41 -0
  16. package/dist/chat-protocol/nats-decoder.d.ts.map +1 -1
  17. package/dist/{chunk-QEMI34VA.cjs → chunk-2MYDGLJS.cjs} +87 -87
  18. package/dist/{chunk-QEMI34VA.cjs.map → chunk-2MYDGLJS.cjs.map} +1 -1
  19. package/dist/{chunk-TQ7EPKKO.js → chunk-2TUOBFPK.js} +2 -2
  20. package/dist/{chunk-XBYEPSNZ.js → chunk-2XGHEJZK.js} +4 -4
  21. package/dist/{chunk-OAEJWP7H.js → chunk-46FKXLNE.js} +2 -2
  22. package/dist/{chunk-ECR37JHH.js → chunk-4QKXNWH5.js} +2 -2
  23. package/dist/{chunk-GWFC3NE5.cjs → chunk-4ZRHVOEB.cjs} +31 -31
  24. package/dist/{chunk-GWFC3NE5.cjs.map → chunk-4ZRHVOEB.cjs.map} +1 -1
  25. package/dist/{chunk-AZBS4PZG.js → chunk-5U67WTAS.js} +2 -2
  26. package/dist/{chunk-3G7FDE5E.js → chunk-6SMLYZLH.js} +4 -4
  27. package/dist/{chunk-7SGBF2I2.js → chunk-6W3ULZ4X.js} +6 -6
  28. package/dist/{chunk-ALXLWF75.js → chunk-6YXN5RHW.js} +2 -2
  29. package/dist/{chunk-2QP67D2L.cjs → chunk-DFQLUK75.cjs} +3 -3
  30. package/dist/{chunk-2QP67D2L.cjs.map → chunk-DFQLUK75.cjs.map} +1 -1
  31. package/dist/{chunk-ETF2QXXU.cjs → chunk-ENPGPZIB.cjs} +61 -61
  32. package/dist/{chunk-ETF2QXXU.cjs.map → chunk-ENPGPZIB.cjs.map} +1 -1
  33. package/dist/{chunk-HJDCDOJM.cjs → chunk-GNOK5J34.cjs} +37 -37
  34. package/dist/{chunk-HJDCDOJM.cjs.map → chunk-GNOK5J34.cjs.map} +1 -1
  35. package/dist/{chunk-4GL2XJ5C.cjs → chunk-J4BE4FIR.cjs} +4 -4
  36. package/dist/{chunk-4GL2XJ5C.cjs.map → chunk-J4BE4FIR.cjs.map} +1 -1
  37. package/dist/{chunk-HXHA3DCI.cjs → chunk-JDW2IL7A.cjs} +11 -11
  38. package/dist/{chunk-HXHA3DCI.cjs.map → chunk-JDW2IL7A.cjs.map} +1 -1
  39. package/dist/{chunk-TMZS63G2.cjs → chunk-KMB66NYX.cjs} +7 -7
  40. package/dist/{chunk-TMZS63G2.cjs.map → chunk-KMB66NYX.cjs.map} +1 -1
  41. package/dist/{chunk-5W3RCZIK.js → chunk-LE3BJ5H2.js} +2 -2
  42. package/dist/{chunk-WINT757E.js → chunk-LIUARTOZ.js} +206 -64
  43. package/dist/chunk-LIUARTOZ.js.map +1 -0
  44. package/dist/{chunk-65NR333L.js → chunk-MVGL5NNJ.js} +2 -2
  45. package/dist/{chunk-LYWSHNK4.cjs → chunk-NAV4FRNL.cjs} +26 -26
  46. package/dist/{chunk-LYWSHNK4.cjs.map → chunk-NAV4FRNL.cjs.map} +1 -1
  47. package/dist/{chunk-2MBS3YEY.cjs → chunk-OLOKQQAP.cjs} +5 -5
  48. package/dist/{chunk-2MBS3YEY.cjs.map → chunk-OLOKQQAP.cjs.map} +1 -1
  49. package/dist/{chunk-QYNLVIGQ.cjs → chunk-QZ2NAPLF.cjs} +9 -9
  50. package/dist/{chunk-QYNLVIGQ.cjs.map → chunk-QZ2NAPLF.cjs.map} +1 -1
  51. package/dist/{chunk-L6EKEYF7.cjs → chunk-RKITTO5V.cjs} +14 -14
  52. package/dist/{chunk-L6EKEYF7.cjs.map → chunk-RKITTO5V.cjs.map} +1 -1
  53. package/dist/{chunk-UP4RA54U.js → chunk-U555TMPC.js} +5 -5
  54. package/dist/{chunk-GVLA2BPW.cjs → chunk-UPHN2VRZ.cjs} +259 -117
  55. package/dist/chunk-UPHN2VRZ.cjs.map +1 -0
  56. package/dist/{chunk-IZOGFZ7N.js → chunk-XN4JKIJY.js} +2 -2
  57. package/dist/{chunk-KYQZBQYV.js → chunk-YLB6XXO6.js} +2 -2
  58. package/dist/{chunk-JZ5XDZYD.cjs → chunk-Z3NOI7X7.cjs} +26 -26
  59. package/dist/{chunk-JZ5XDZYD.cjs.map → chunk-Z3NOI7X7.cjs.map} +1 -1
  60. package/dist/components/case-studies/index.cjs +8 -8
  61. package/dist/components/case-studies/index.js +2 -2
  62. package/dist/components/chat/embeddable-chat.d.ts +13 -0
  63. package/dist/components/chat/embeddable-chat.d.ts.map +1 -1
  64. package/dist/components/chat/hooks/use-sse-chat-adapter.d.ts.map +1 -1
  65. package/dist/components/chat/index.cjs +10 -2
  66. package/dist/components/chat/index.cjs.map +1 -1
  67. package/dist/components/chat/index.js +9 -1
  68. package/dist/components/chat/stream/chat-stream-reducer.d.ts +9 -0
  69. package/dist/components/chat/stream/chat-stream-reducer.d.ts.map +1 -1
  70. package/dist/components/chat/types/message.types.d.ts +15 -0
  71. package/dist/components/chat/types/message.types.d.ts.map +1 -1
  72. package/dist/components/chat/types/network.types.d.ts +4 -0
  73. package/dist/components/chat/types/network.types.d.ts.map +1 -1
  74. package/dist/components/chat/types/processing.types.d.ts +7 -1
  75. package/dist/components/chat/types/processing.types.d.ts.map +1 -1
  76. package/dist/components/chat/utils/approval-display.d.ts +49 -0
  77. package/dist/components/chat/utils/approval-display.d.ts.map +1 -0
  78. package/dist/components/chat/utils/index.d.ts +1 -0
  79. package/dist/components/chat/utils/index.d.ts.map +1 -1
  80. package/dist/components/chat/utils/message-segment-accumulator.d.ts +25 -3
  81. package/dist/components/chat/utils/message-segment-accumulator.d.ts.map +1 -1
  82. package/dist/components/chat/utils/process-historical-messages.d.ts.map +1 -1
  83. package/dist/components/contact/index.cjs +3 -3
  84. package/dist/components/contact/index.js +2 -2
  85. package/dist/components/docs/index.cjs +5 -5
  86. package/dist/components/docs/index.js +4 -4
  87. package/dist/components/embeds/index.cjs +3 -3
  88. package/dist/components/embeds/index.js +2 -2
  89. package/dist/components/faq/index.cjs +3 -3
  90. package/dist/components/faq/index.js +2 -2
  91. package/dist/components/features/index.cjs +2 -2
  92. package/dist/components/features/index.js +1 -1
  93. package/dist/components/help-center-pages/index.cjs +22 -22
  94. package/dist/components/help-center-pages/index.js +13 -13
  95. package/dist/components/index.cjs +140 -132
  96. package/dist/components/index.cjs.map +1 -1
  97. package/dist/components/index.js +19 -11
  98. package/dist/components/index.js.map +1 -1
  99. package/dist/components/meeting-scheduler/index.cjs +34 -34
  100. package/dist/components/meeting-scheduler/index.js +3 -3
  101. package/dist/components/navigation/index.cjs +2 -2
  102. package/dist/components/navigation/index.js +1 -1
  103. package/dist/components/onboarding-guides/index.cjs +5 -5
  104. package/dist/components/onboarding-guides/index.js +4 -4
  105. package/dist/components/related-content/index.cjs +3 -3
  106. package/dist/components/related-content/index.js +2 -2
  107. package/dist/components/tickets/index.cjs +6 -6
  108. package/dist/components/tickets/index.js +5 -5
  109. package/dist/components/ui/index.cjs +10 -2
  110. package/dist/components/ui/index.cjs.map +1 -1
  111. package/dist/components/ui/index.js +9 -1
  112. package/dist/index.cjs +10 -2
  113. package/dist/index.cjs.map +1 -1
  114. package/dist/index.js +9 -1
  115. package/dist/utils/index.cjs.map +1 -1
  116. package/dist/utils/index.js.map +1 -1
  117. package/package.json +1 -1
  118. package/src/chat-protocol/__tests__/__snapshots__/nats-decoder-golden.test.ts.snap +70 -0
  119. package/src/chat-protocol/__tests__/nats-decoder-golden.test.ts +108 -1
  120. package/src/chat-protocol/confirm-tool.ts +67 -0
  121. package/src/chat-protocol/decode.ts +7 -153
  122. package/src/chat-protocol/events.ts +40 -0
  123. package/src/chat-protocol/index.ts +3 -0
  124. package/src/chat-protocol/leading-frames.ts +175 -0
  125. package/src/chat-protocol/nats-decoder.ts +111 -3
  126. package/src/components/chat/embeddable-chat.tsx +18 -0
  127. package/src/components/chat/hooks/use-sse-chat-adapter.ts +7 -16
  128. package/src/components/chat/stream/chat-stream-reducer.ts +49 -3
  129. package/src/components/chat/types/message.types.ts +15 -0
  130. package/src/components/chat/types/network.types.ts +4 -0
  131. package/src/components/chat/types/processing.types.ts +12 -1
  132. package/src/components/chat/utils/__tests__/process-historical-messages-approvals.test.ts +92 -0
  133. package/src/components/chat/utils/approval-display.ts +70 -0
  134. package/src/components/chat/utils/index.ts +9 -0
  135. package/src/components/chat/utils/message-segment-accumulator.ts +62 -32
  136. package/src/components/chat/utils/process-historical-messages.ts +40 -6
  137. package/dist/chunk-GVLA2BPW.cjs.map +0 -1
  138. package/dist/chunk-WINT757E.js.map +0 -1
  139. /package/dist/{chunk-TQ7EPKKO.js.map → chunk-2TUOBFPK.js.map} +0 -0
  140. /package/dist/{chunk-XBYEPSNZ.js.map → chunk-2XGHEJZK.js.map} +0 -0
  141. /package/dist/{chunk-OAEJWP7H.js.map → chunk-46FKXLNE.js.map} +0 -0
  142. /package/dist/{chunk-ECR37JHH.js.map → chunk-4QKXNWH5.js.map} +0 -0
  143. /package/dist/{chunk-AZBS4PZG.js.map → chunk-5U67WTAS.js.map} +0 -0
  144. /package/dist/{chunk-3G7FDE5E.js.map → chunk-6SMLYZLH.js.map} +0 -0
  145. /package/dist/{chunk-7SGBF2I2.js.map → chunk-6W3ULZ4X.js.map} +0 -0
  146. /package/dist/{chunk-ALXLWF75.js.map → chunk-6YXN5RHW.js.map} +0 -0
  147. /package/dist/{chunk-5W3RCZIK.js.map → chunk-LE3BJ5H2.js.map} +0 -0
  148. /package/dist/{chunk-65NR333L.js.map → chunk-MVGL5NNJ.js.map} +0 -0
  149. /package/dist/{chunk-UP4RA54U.js.map → chunk-U555TMPC.js.map} +0 -0
  150. /package/dist/{chunk-IZOGFZ7N.js.map → chunk-XN4JKIJY.js.map} +0 -0
  151. /package/dist/{chunk-KYQZBQYV.js.map → chunk-YLB6XXO6.js.map} +0 -0
@@ -17,10 +17,51 @@
17
17
  */
18
18
  import type { AskOptionData } from '../components/chat/types/message.types';
19
19
  import type { ChatStreamEvent } from './events';
20
+ export { GUIDE_ORIGIN } from './events';
20
21
  /** Coerce the wire's ask `options[]` into the card's row shape. Rows without a
21
22
  * usable `label` are dropped: the label is what gets SENT when the row is
22
23
  * picked, so a blank one would post an empty reply. */
23
24
  export declare function normalizeAskOptions(raw: unknown): AskOptionData[];
25
+ /**
26
+ * Adapt ONE Product Guide event to the NATS kernel.
27
+ *
28
+ * The guide half of a Mingo dialog is the hub's own stream, so it is decoded by
29
+ * the shared table in `./leading-frames` and then passed through here — the ONE
30
+ * place that reconciles the two kernels. Both entry points use it: frames
31
+ * re-streamed by the agent inside `GUIDE` chunks, and the SSE response of the
32
+ * hub's confirm-tool route, which a host replays into the same dialog.
33
+ *
34
+ * Pass-through is the DEFAULT; only these rules alter an event, and each exists
35
+ * because the two kernels genuinely disagree:
36
+ *
37
+ * - `text-delta` becomes `guide-delta`: the body of a guide turn belongs
38
+ * inside the "OpenFrame Guide" card, and a `text` segment would strand part
39
+ * of the same answer outside it.
40
+ * - thinking is escaped HERE. The SSE kernel escapes `<` on the way in, the
41
+ * NATS kernel does not, and the guide's thinking is full of XML-ish tokens
42
+ * that would otherwise render as markup.
43
+ * - `metadata` survives ONLY to carry `conversationId`, which the hub mints
44
+ * and every confirm-tool call must quote back. Everything else on that
45
+ * frame (the hub's model, routing) is dropped: `applyNats` rebuilds the
46
+ * dialog's live model from a metadata event, so letting it through would
47
+ * relabel a Mingo turn with the hub's model, and a routing frame — which
48
+ * carries no model at all — would blank the badge mid-answer.
49
+ * - dialog-level events stop here (`AGENT_OWNED_EVENTS`).
50
+ *
51
+ * Everything else crosses over as the hub typed it, gaining only `origin`.
52
+ * `approvalType` in particular stays the TOOL NAME, exactly as in the hub's own
53
+ * chat: the NATS kernel gates approvals on approval TIER and escalates the rest,
54
+ * which is an agent-side concept a hub proposal has no tier for. Rewriting the
55
+ * tool name into a fake tier to slip past that gate would make the guide half of
56
+ * the stream diverge from the guide chat itself.
57
+ */
58
+ export declare function guideEventForNats(event: ChatStreamEvent): ChatStreamEvent | null;
59
+ /**
60
+ * Decode one re-streamed Product Guide frame (a `GUIDE` chunk's `payload`) into
61
+ * a NATS event. The frame grammar is decoded by the shared table, never by a
62
+ * second copy here; the kernel reconciliation is `guideEventForNats`.
63
+ */
64
+ export declare function guideFrameEvent(frame: Record<string, unknown>): ChatStreamEvent | null;
24
65
  /**
25
66
  * Parse one raw NATS chunk into a normalized event. Returns `null` for
26
67
  * unknown/malformed chunks — an unrecognized `type`, a missing required
@@ -1 +1 @@
1
- {"version":3,"file":"nats-decoder.d.ts","sourceRoot":"","sources":["../../src/chat-protocol/nats-decoder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAA;AAE3E,OAAO,KAAK,EAAoB,eAAe,EAAE,MAAM,UAAU,CAAA;AA4BjE;;wDAEwD;AACxD,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,aAAa,EAAE,CASjE;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,GAAG,IAAI,CAiRtE"}
1
+ {"version":3,"file":"nats-decoder.d.ts","sourceRoot":"","sources":["../../src/chat-protocol/nats-decoder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAA;AAE3E,OAAO,KAAK,EAAoB,eAAe,EAAE,MAAM,UAAU,CAAA;AAUjE,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAwBvC;;wDAEwD;AACxD,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,aAAa,EAAE,CASjE;AA+BD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,eAAe,GAAG,eAAe,GAAG,IAAI,CAgBhF;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,eAAe,GAAG,IAAI,CAMtF;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,GAAG,IAAI,CA0RtE"}