@flamingo-stack/openframe-frontend-core 0.0.508 → 0.0.509
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/chat-protocol/decode.d.ts +58 -0
- package/dist/chat-protocol/decode.d.ts.map +1 -0
- package/dist/chat-protocol/encode.d.ts +44 -0
- package/dist/chat-protocol/encode.d.ts.map +1 -0
- package/dist/chat-protocol/env-flag.d.ts +35 -0
- package/dist/chat-protocol/env-flag.d.ts.map +1 -0
- package/dist/chat-protocol/events.d.ts +216 -0
- package/dist/chat-protocol/events.d.ts.map +1 -0
- package/dist/chat-protocol/frames.d.ts +213 -0
- package/dist/chat-protocol/frames.d.ts.map +1 -0
- package/dist/chat-protocol/index.cjs +506 -0
- package/dist/chat-protocol/index.cjs.map +1 -0
- package/dist/chat-protocol/index.d.ts +18 -0
- package/dist/chat-protocol/index.d.ts.map +1 -0
- package/dist/chat-protocol/index.js +490 -0
- package/dist/chat-protocol/index.js.map +1 -0
- package/dist/chat-protocol/ip-normalize.d.ts +44 -0
- package/dist/chat-protocol/ip-normalize.d.ts.map +1 -0
- package/dist/chat-protocol/nats-decoder.d.ts +26 -0
- package/dist/chat-protocol/nats-decoder.d.ts.map +1 -0
- package/dist/{chunk-3SQ5KXHQ.cjs → chunk-2T4GTV25.cjs} +9 -9
- package/dist/{chunk-3SQ5KXHQ.cjs.map → chunk-2T4GTV25.cjs.map} +1 -1
- package/dist/{chunk-CWAOV2FK.cjs → chunk-3CGZPAGR.cjs} +3 -3
- package/dist/{chunk-CWAOV2FK.cjs.map → chunk-3CGZPAGR.cjs.map} +1 -1
- package/dist/{chunk-TLMJHMXJ.js → chunk-3QSR22IC.js} +12 -12
- package/dist/chunk-3QSR22IC.js.map +1 -0
- package/dist/{chunk-TWYNR4TZ.cjs → chunk-4G5TLHJD.cjs} +7141 -4799
- package/dist/chunk-4G5TLHJD.cjs.map +1 -0
- package/dist/{chunk-ADPMHWOE.js → chunk-72XAID7Y.js} +4 -4
- package/dist/{chunk-PAGKRNWK.js → chunk-7WZHBQ4J.js} +2 -2
- package/dist/{chunk-OCEKO5CW.js → chunk-AEELJC4N.js} +12106 -9764
- package/dist/chunk-AEELJC4N.js.map +1 -0
- package/dist/{chunk-Z42BGM6Q.cjs → chunk-BT2WWDFP.cjs} +5 -5
- package/dist/{chunk-Z42BGM6Q.cjs.map → chunk-BT2WWDFP.cjs.map} +1 -1
- package/dist/{chunk-7LEL3RIX.cjs → chunk-C7OY3PQP.cjs} +11 -11
- package/dist/{chunk-7LEL3RIX.cjs.map → chunk-C7OY3PQP.cjs.map} +1 -1
- package/dist/{chunk-RHGGEKPQ.cjs → chunk-CIOLOQKQ.cjs} +4 -4
- package/dist/{chunk-RHGGEKPQ.cjs.map → chunk-CIOLOQKQ.cjs.map} +1 -1
- package/dist/{chunk-TSZHM74B.js → chunk-DC2TKS7C.js} +2 -2
- package/dist/{chunk-M2GOR3XQ.cjs → chunk-DYPYR7FR.cjs} +87 -87
- package/dist/{chunk-M2GOR3XQ.cjs.map → chunk-DYPYR7FR.cjs.map} +1 -1
- package/dist/{chunk-I64ABCDX.js → chunk-I2B6X77L.js} +2 -2
- package/dist/{chunk-NIZDKTGL.cjs → chunk-K5MSCMDK.cjs} +37 -37
- package/dist/{chunk-NIZDKTGL.cjs.map → chunk-K5MSCMDK.cjs.map} +1 -1
- package/dist/{chunk-DTYRYB2N.js → chunk-K6QTZ7CZ.js} +2 -2
- package/dist/{chunk-4LTMXDUS.js → chunk-KBN7PMFT.js} +2 -2
- package/dist/{chunk-TBMV7I5N.js → chunk-KXZO2WZX.js} +2 -2
- package/dist/{chunk-QTYZMP6D.cjs → chunk-LBAKLT6T.cjs} +62 -62
- package/dist/chunk-LBAKLT6T.cjs.map +1 -0
- package/dist/{chunk-KEBYLU3U.js → chunk-LFUPI7VX.js} +2 -2
- package/dist/{chunk-LDTR4IVZ.cjs → chunk-M37PBG4N.cjs} +31 -31
- package/dist/{chunk-LDTR4IVZ.cjs.map → chunk-M37PBG4N.cjs.map} +1 -1
- package/dist/{chunk-WA7RR64F.js → chunk-PO5O654H.js} +6 -5
- package/dist/chunk-PO5O654H.js.map +1 -0
- package/dist/{chunk-WK4N5VBX.cjs → chunk-QJJISLPA.cjs} +28 -27
- package/dist/chunk-QJJISLPA.cjs.map +1 -0
- package/dist/{chunk-2F44PLTV.cjs → chunk-T7MCSA55.cjs} +26 -26
- package/dist/{chunk-2F44PLTV.cjs.map → chunk-T7MCSA55.cjs.map} +1 -1
- package/dist/{chunk-WJQHJD7J.js → chunk-TWSKTJHW.js} +2 -2
- package/dist/{chunk-ZSQHZYCO.cjs → chunk-UQDMJ6DH.cjs} +13 -13
- package/dist/{chunk-ZSQHZYCO.cjs.map → chunk-UQDMJ6DH.cjs.map} +1 -1
- package/dist/{chunk-TZRUCD56.js → chunk-V3ZAAFE3.js} +5 -5
- package/dist/{chunk-LRGHJPET.js → chunk-XGIFOHKE.js} +2 -2
- package/dist/{chunk-POOMO3PA.cjs → chunk-YQEPRYT5.cjs} +7 -7
- package/dist/{chunk-POOMO3PA.cjs.map → chunk-YQEPRYT5.cjs.map} +1 -1
- package/dist/components/case-studies/index.cjs +8 -8
- package/dist/components/case-studies/index.js +2 -2
- package/dist/components/chat/chat-message-enhanced.d.ts.map +1 -1
- package/dist/components/chat/chat-message-list.d.ts.map +1 -1
- package/dist/components/chat/hooks/index.d.ts +0 -1
- package/dist/components/chat/hooks/index.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-chat.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-chunk-catchup.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-nats-chat-adapter.d.ts +15 -48
- package/dist/components/chat/hooks/use-nats-chat-adapter.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-sse-chat-adapter.d.ts +10 -57
- package/dist/components/chat/hooks/use-sse-chat-adapter.d.ts.map +1 -1
- package/dist/components/chat/index.cjs +10 -2
- package/dist/components/chat/index.cjs.map +1 -1
- package/dist/components/chat/index.d.ts +1 -0
- package/dist/components/chat/index.d.ts.map +1 -1
- package/dist/components/chat/index.js +21 -13
- package/dist/components/chat/stream/chat-dialog-store.d.ts +184 -0
- package/dist/components/chat/stream/chat-dialog-store.d.ts.map +1 -0
- package/dist/components/chat/stream/chat-stream-reducer.d.ts +380 -0
- package/dist/components/chat/stream/chat-stream-reducer.d.ts.map +1 -0
- package/dist/components/chat/stream/delta-batcher.d.ts +51 -0
- package/dist/components/chat/stream/delta-batcher.d.ts.map +1 -0
- package/dist/components/chat/stream/index.d.ts +17 -0
- package/dist/components/chat/stream/index.d.ts.map +1 -0
- package/dist/components/chat/stream/message-mutations.d.ts +77 -0
- package/dist/components/chat/stream/message-mutations.d.ts.map +1 -0
- package/dist/components/chat/stream/use-chat-stream-reducer.d.ts +22 -0
- package/dist/components/chat/stream/use-chat-stream-reducer.d.ts.map +1 -0
- package/dist/components/chat/types/api.types.d.ts +1 -81
- package/dist/components/chat/types/api.types.d.ts.map +1 -1
- package/dist/components/chat/types/processing.types.d.ts +2 -93
- package/dist/components/chat/types/processing.types.d.ts.map +1 -1
- package/dist/components/chat/types/unified-chat-state.types.d.ts +15 -0
- package/dist/components/chat/types/unified-chat-state.types.d.ts.map +1 -1
- package/dist/components/chat/utils/extract-incomplete-message-state.d.ts +34 -6
- package/dist/components/chat/utils/extract-incomplete-message-state.d.ts.map +1 -1
- package/dist/components/chat/utils/history-merge.d.ts.map +1 -1
- package/dist/components/chat/utils/index.d.ts +2 -3
- package/dist/components/chat/utils/index.d.ts.map +1 -1
- package/dist/components/chat/utils/process-historical-messages.d.ts +59 -11
- package/dist/components/chat/utils/process-historical-messages.d.ts.map +1 -1
- package/dist/components/contact/index.cjs +3 -3
- package/dist/components/contact/index.js +2 -2
- package/dist/components/docs/index.cjs +5 -5
- package/dist/components/docs/index.js +4 -4
- package/dist/components/embeds/index.cjs +3 -3
- package/dist/components/embeds/index.js +2 -2
- package/dist/components/faq/index.cjs +3 -3
- package/dist/components/faq/index.js +2 -2
- package/dist/components/features/index.cjs +2 -2
- package/dist/components/features/index.js +1 -1
- package/dist/components/help-center-pages/index.cjs +22 -22
- package/dist/components/help-center-pages/index.js +13 -13
- package/dist/components/index.cjs +174 -132
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +65 -23
- package/dist/components/index.js.map +1 -1
- package/dist/components/meeting-scheduler/index.cjs +34 -34
- package/dist/components/meeting-scheduler/index.js +3 -3
- package/dist/components/navigation/index.cjs +2 -2
- package/dist/components/navigation/index.js +1 -1
- package/dist/components/onboarding-guides/index.cjs +5 -5
- package/dist/components/onboarding-guides/index.js +4 -4
- package/dist/components/onboarding-guides/onboarding-guide-detail-view.d.ts.map +1 -1
- package/dist/components/related-content/index.cjs +3 -3
- package/dist/components/related-content/index.js +2 -2
- package/dist/components/shared/product-release/release-detail-page.d.ts.map +1 -1
- package/dist/components/tickets/index.cjs +6 -6
- package/dist/components/tickets/index.js +5 -5
- package/dist/components/ui/index.cjs +44 -2
- package/dist/components/ui/index.cjs.map +1 -1
- package/dist/components/ui/index.d.ts +1 -2
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +55 -13
- package/dist/components/ui/markdown/base-components.d.ts +51 -0
- package/dist/components/ui/markdown/base-components.d.ts.map +1 -0
- package/dist/components/ui/markdown/engine.d.ts +99 -0
- package/dist/components/ui/markdown/engine.d.ts.map +1 -0
- package/dist/components/ui/markdown/heading-ids.d.ts +65 -0
- package/dist/components/ui/markdown/heading-ids.d.ts.map +1 -0
- package/dist/components/ui/markdown/index.d.ts +18 -0
- package/dist/components/ui/markdown/index.d.ts.map +1 -0
- package/dist/components/ui/markdown/mermaid-diagram.d.ts +79 -0
- package/dist/components/ui/markdown/mermaid-diagram.d.ts.map +1 -0
- package/dist/components/ui/markdown/rich/embed-overrides.d.ts +14 -0
- package/dist/components/ui/markdown/rich/embed-overrides.d.ts.map +1 -0
- package/dist/components/ui/markdown/rich/rich-markdown-renderer.d.ts +40 -0
- package/dist/components/ui/markdown/rich/rich-markdown-renderer.d.ts.map +1 -0
- package/dist/components/ui/markdown/rich/shortcodes.d.ts +8 -0
- package/dist/components/ui/markdown/rich/shortcodes.d.ts.map +1 -0
- package/dist/components/ui/markdown/sanitize.d.ts +153 -0
- package/dist/components/ui/markdown/sanitize.d.ts.map +1 -0
- package/dist/components/ui/markdown/simple-markdown-renderer.d.ts +23 -0
- package/dist/components/ui/markdown/simple-markdown-renderer.d.ts.map +1 -0
- package/dist/components/ui/markdown/streaming.d.ts +78 -0
- package/dist/components/ui/markdown/streaming.d.ts.map +1 -0
- package/dist/components/ui/markdown/text-size.d.ts +34 -0
- package/dist/components/ui/markdown/text-size.d.ts.map +1 -0
- package/dist/index.cjs +60 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +71 -13
- package/dist/utils/index.cjs +169 -40
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +162 -41
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/markdown-fences.d.ts +42 -0
- package/dist/utils/markdown-fences.d.ts.map +1 -0
- package/dist/utils/markdown-heading-id.d.ts +85 -0
- package/dist/utils/markdown-heading-id.d.ts.map +1 -0
- package/dist/utils/markdown-section-extractor.d.ts.map +1 -1
- package/package.json +7 -1
- package/src/chat-protocol/__tests__/__snapshots__/nats-decoder-golden.test.ts.snap +319 -0
- package/src/chat-protocol/__tests__/chat-protocol.test.ts +516 -0
- package/src/chat-protocol/__tests__/env-flag.test.ts +52 -0
- package/src/chat-protocol/__tests__/ip-normalize.test.ts +136 -0
- package/src/chat-protocol/__tests__/nats-decoder-golden.test.ts +237 -0
- package/src/chat-protocol/decode.ts +278 -0
- package/src/chat-protocol/encode.ts +71 -0
- package/src/chat-protocol/env-flag.ts +39 -0
- package/src/chat-protocol/events.ts +254 -0
- package/src/chat-protocol/frames.ts +245 -0
- package/src/chat-protocol/index.ts +21 -0
- package/src/chat-protocol/ip-normalize.ts +146 -0
- package/src/chat-protocol/nats-decoder.ts +264 -0
- package/src/components/chat/.chat-message-list.md +10 -6
- package/src/components/chat/__tests__/chat-message-list.test.tsx +450 -9
- package/src/components/chat/__tests__/chat-message-streaming-memo.test.tsx +207 -0
- package/src/components/chat/__tests__/chat-pending-turn.test.tsx +250 -0
- package/src/components/chat/chat-message-enhanced.tsx +122 -20
- package/src/components/chat/chat-message-list.tsx +515 -133
- package/src/components/chat/embeddable-chat.tsx +6 -0
- package/src/components/chat/hooks/.index.md +30 -33
- package/src/components/chat/hooks/.use-nats-chat-adapter.md +36 -55
- package/src/components/chat/hooks/__tests__/__snapshots__/conversation-id-persistence-golden.test.ts.snap +37 -0
- package/src/components/chat/hooks/__tests__/__snapshots__/sse-stream-golden.test.ts.snap +0 -0
- package/src/components/chat/hooks/__tests__/chunk-catchup-dialog-staleness.test.ts +92 -0
- package/src/components/chat/hooks/__tests__/conversation-id-persistence-golden.test.ts +438 -0
- package/src/components/chat/hooks/__tests__/sse-stream-golden.test.ts +318 -0
- package/src/components/chat/hooks/index.ts +0 -1
- package/src/components/chat/hooks/use-chat.ts +8 -0
- package/src/components/chat/hooks/use-chunk-catchup.ts +26 -1
- package/src/components/chat/hooks/use-nats-chat-adapter.ts +254 -825
- package/src/components/chat/hooks/use-sse-chat-adapter.ts +380 -684
- package/src/components/chat/index.ts +5 -0
- package/src/components/chat/stream/__tests__/__snapshots__/chat-stream-reducer-golden.test.ts.snap +944 -0
- package/src/components/chat/stream/__tests__/chat-dialog-store.test.ts +806 -0
- package/src/components/chat/stream/__tests__/chat-stream-reducer-golden.test.ts +467 -0
- package/src/components/chat/stream/__tests__/chat-stream-reducer.test.ts +1330 -0
- package/src/components/chat/stream/__tests__/delta-batcher.test.ts +255 -0
- package/src/components/chat/stream/__tests__/use-chat-stream-reducer.test.ts +105 -0
- package/src/components/chat/stream/chat-dialog-store.ts +536 -0
- package/src/components/chat/stream/chat-stream-reducer.ts +1928 -0
- package/src/components/chat/stream/delta-batcher.ts +168 -0
- package/src/components/chat/stream/index.ts +55 -0
- package/src/components/chat/stream/message-mutations.ts +340 -0
- package/src/components/chat/stream/use-chat-stream-reducer.ts +126 -0
- package/src/components/chat/thinking-display.tsx +1 -1
- package/src/components/chat/types/.api.types.md +39 -49
- package/src/components/chat/types/.processing.types.md +29 -58
- package/src/components/chat/types/.unified-chat-state.types.md +2 -2
- package/src/components/chat/types/api.types.ts +6 -73
- package/src/components/chat/types/processing.types.ts +11 -53
- package/src/components/chat/types/unified-chat-state.types.ts +16 -0
- package/src/components/chat/utils/.extract-incomplete-message-state.md +21 -3
- package/src/components/chat/utils/.history-merge.md +44 -3
- package/src/components/chat/utils/.index.md +31 -40
- package/src/components/chat/utils/__tests__/__snapshots__/process-historical-messages-golden.test.ts.snap +420 -0
- package/src/components/chat/utils/__tests__/__snapshots__/segment-accumulator-golden.test.ts.snap +605 -0
- package/src/components/chat/utils/__tests__/extract-incomplete-message-state.test.ts +106 -0
- package/src/components/chat/utils/__tests__/history-merge.test.ts +160 -0
- package/src/components/chat/utils/__tests__/process-historical-messages-approvals.test.ts +61 -0
- package/src/components/chat/utils/__tests__/process-historical-messages-golden.test.ts +394 -0
- package/src/components/chat/utils/__tests__/segment-accumulator-golden.test.ts +270 -0
- package/src/components/chat/utils/extract-incomplete-message-state.ts +93 -6
- package/src/components/chat/utils/history-merge.ts +85 -5
- package/src/components/chat/utils/index.ts +5 -8
- package/src/components/chat/utils/process-historical-messages.ts +361 -385
- package/src/components/onboarding-guides/onboarding-guide-detail-view.tsx +22 -4
- package/src/components/shared/legal-document/legal-document-page.tsx +1 -1
- package/src/components/shared/product-release/release-detail-page.tsx +19 -4
- package/src/components/ui/__tests__/__snapshots__/markdown-parity.test.tsx.snap +2420 -0
- package/src/components/ui/__tests__/markdown-parity.test.tsx +2540 -0
- package/src/components/ui/index.ts +1 -2
- package/src/components/ui/markdown/__tests__/mermaid-security.test.ts +176 -0
- package/src/components/ui/markdown/__tests__/mermaid-stale-render.test.tsx +151 -0
- package/src/components/ui/markdown/__tests__/sanitize-invariant.test.ts +354 -0
- package/src/components/ui/markdown/__tests__/sanitize-render.test.tsx +118 -0
- package/src/components/ui/markdown/__tests__/streaming.test.tsx +436 -0
- package/src/components/ui/markdown/base-components.tsx +360 -0
- package/src/components/ui/markdown/engine.tsx +315 -0
- package/src/components/ui/markdown/heading-ids.ts +239 -0
- package/src/components/ui/markdown/index.ts +49 -0
- package/src/components/ui/markdown/mermaid-diagram.tsx +323 -0
- package/src/components/ui/markdown/rich/embed-overrides.tsx +199 -0
- package/src/components/ui/markdown/rich/rich-markdown-renderer.tsx +184 -0
- package/src/components/ui/markdown/rich/shortcodes.ts +170 -0
- package/src/components/ui/markdown/sanitize.ts +3584 -0
- package/src/components/ui/markdown/simple-markdown-renderer.tsx +28 -0
- package/src/components/ui/markdown/streaming.ts +390 -0
- package/src/components/ui/markdown/text-size.ts +106 -0
- package/src/components/ui/release-changelog-section.tsx +1 -1
- package/src/components/ui/ticket-info-section.tsx +1 -1
- package/src/utils/index.ts +1 -0
- package/src/utils/markdown-fences.ts +127 -0
- package/src/utils/markdown-heading-id.ts +348 -0
- package/src/utils/markdown-section-extractor.ts +41 -56
- package/dist/chunk-OCEKO5CW.js.map +0 -1
- package/dist/chunk-QTYZMP6D.cjs.map +0 -1
- package/dist/chunk-TLMJHMXJ.js.map +0 -1
- package/dist/chunk-TWYNR4TZ.cjs.map +0 -1
- package/dist/chunk-WA7RR64F.js.map +0 -1
- package/dist/chunk-WK4N5VBX.cjs.map +0 -1
- package/dist/components/chat/hooks/use-realtime-chunk-processor.d.ts +0 -6
- package/dist/components/chat/hooks/use-realtime-chunk-processor.d.ts.map +0 -1
- package/dist/components/chat/utils/chunk-parser.d.ts +0 -25
- package/dist/components/chat/utils/chunk-parser.d.ts.map +0 -1
- package/dist/components/ui/rich-markdown-renderer.d.ts +0 -34
- package/dist/components/ui/rich-markdown-renderer.d.ts.map +0 -1
- package/dist/components/ui/simple-markdown-renderer.d.ts +0 -73
- package/dist/components/ui/simple-markdown-renderer.d.ts.map +0 -1
- package/src/components/chat/hooks/.use-realtime-chunk-processor.md +0 -77
- package/src/components/chat/hooks/use-realtime-chunk-processor.ts +0 -489
- package/src/components/chat/utils/.chunk-parser.md +0 -62
- package/src/components/chat/utils/chunk-parser.ts +0 -262
- package/src/components/ui/.simple-markdown-renderer.md +0 -52
- package/src/components/ui/rich-markdown-renderer.tsx +0 -1223
- package/src/components/ui/simple-markdown-renderer.tsx +0 -964
- /package/dist/{chunk-ADPMHWOE.js.map → chunk-72XAID7Y.js.map} +0 -0
- /package/dist/{chunk-PAGKRNWK.js.map → chunk-7WZHBQ4J.js.map} +0 -0
- /package/dist/{chunk-TSZHM74B.js.map → chunk-DC2TKS7C.js.map} +0 -0
- /package/dist/{chunk-I64ABCDX.js.map → chunk-I2B6X77L.js.map} +0 -0
- /package/dist/{chunk-DTYRYB2N.js.map → chunk-K6QTZ7CZ.js.map} +0 -0
- /package/dist/{chunk-4LTMXDUS.js.map → chunk-KBN7PMFT.js.map} +0 -0
- /package/dist/{chunk-TBMV7I5N.js.map → chunk-KXZO2WZX.js.map} +0 -0
- /package/dist/{chunk-KEBYLU3U.js.map → chunk-LFUPI7VX.js.map} +0 -0
- /package/dist/{chunk-WJQHJD7J.js.map → chunk-TWSKTJHW.js.map} +0 -0
- /package/dist/{chunk-TZRUCD56.js.map → chunk-V3ZAAFE3.js.map} +0 -0
- /package/dist/{chunk-LRGHJPET.js.map → chunk-XGIFOHKE.js.map} +0 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fenced-code tracker — THE definition of "am I inside a code fence".
|
|
3
|
+
* Server-safe: no React, no DOM.
|
|
4
|
+
*
|
|
5
|
+
* Lives in its own module because it is a GENERAL CommonMark fence machine
|
|
6
|
+
* with two unrelated consumers: the heading scanner
|
|
7
|
+
* (`utils/markdown-heading-id`) and the streaming block splitter
|
|
8
|
+
* (`components/ui/markdown/streaming`). It used to live inside
|
|
9
|
+
* `markdown-heading-id`, which meant a streaming renderer imported its fence
|
|
10
|
+
* state machine from a module named after heading slugs. `markdown-heading-id`
|
|
11
|
+
* re-exports these names so the public `utils` surface is unchanged.
|
|
12
|
+
*/
|
|
13
|
+
/** True when `line` is a CommonMark blank line (spaces/tabs only, `\r`-tolerant). */
|
|
14
|
+
export declare function isBlankLine(line: string): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* What one source line is, relative to fenced code:
|
|
17
|
+
* - `open` — this line opened a fence
|
|
18
|
+
* - `close` — this line closed the open fence
|
|
19
|
+
* - `inside`— this line is fence content (including a would-be delimiter that
|
|
20
|
+
* does NOT close the open fence: wrong marker char, too short, or
|
|
21
|
+
* carrying an info string)
|
|
22
|
+
* - `text` — this line is ordinary markdown outside any fence
|
|
23
|
+
*
|
|
24
|
+
* NOTE: no consumer discriminates the three non-`text` roles today — both the
|
|
25
|
+
* heading scanner and the streaming splitter only test `!== 'text'`, and the
|
|
26
|
+
* closer-haystack mask below only tests `=== 'open'` / `=== 'close'`. The
|
|
27
|
+
* four-value union is kept because the state machine already computes the
|
|
28
|
+
* distinction for free and a future consumer (e.g. fence-aware syntax
|
|
29
|
+
* post-processing) would otherwise have to re-derive it.
|
|
30
|
+
*/
|
|
31
|
+
export type FenceLineRole = 'open' | 'close' | 'inside' | 'text';
|
|
32
|
+
export interface FenceTracker {
|
|
33
|
+
/** Advance across one raw source line (mutates) and classify it. */
|
|
34
|
+
push(line: string): FenceLineRole;
|
|
35
|
+
/** Marker CHARACTER of the currently open fence (`` ` `` / `~`), or null. */
|
|
36
|
+
openChar(): string | null;
|
|
37
|
+
/** Run length of the currently open fence (a closer must be ≥ this). */
|
|
38
|
+
openLength(): number;
|
|
39
|
+
}
|
|
40
|
+
/** A fresh fenced-code state machine. Server-safe: no React, no DOM. */
|
|
41
|
+
export declare function createFenceTracker(): FenceTracker;
|
|
42
|
+
//# sourceMappingURL=markdown-fences.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown-fences.d.ts","sourceRoot":"","sources":["../../src/utils/markdown-fences.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAoDH,qFAAqF;AACrF,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEjD;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAA;AAEhE,MAAM,WAAW,YAAY;IAC3B,oEAAoE;IACpE,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CAAA;IACjC,6EAA6E;IAC7E,QAAQ,IAAI,MAAM,GAAG,IAAI,CAAA;IACzB,wEAAwE;IACxE,UAAU,IAAI,MAAM,CAAA;CACrB;AAED,wEAAwE;AACxE,wBAAgB,kBAAkB,IAAI,YAAY,CA8BjD"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Markdown heading-id slug SSOT (server-safe: no React, no DOM).
|
|
3
|
+
*
|
|
4
|
+
* This algorithm previously existed in THREE byte-identical copies:
|
|
5
|
+
* - `components/ui/simple-markdown-renderer.tsx` (generateHeadingId)
|
|
6
|
+
* - `components/ui/rich-markdown-renderer.tsx` (generateHeadingId)
|
|
7
|
+
* - `utils/markdown-section-extractor.ts` (extractSections)
|
|
8
|
+
*
|
|
9
|
+
* The extractor is the PRODUCER of `sectionIds` and the renderers are the
|
|
10
|
+
* CONSUMERS — if the two ever drift, deep-link anchors and scroll-spy
|
|
11
|
+
* targets silently diverge. All three now call these helpers; the parity
|
|
12
|
+
* test `components/ui/__tests__/markdown-parity.test.tsx` asserts
|
|
13
|
+
* extractor-vs-renderer ID agreement over the fixture corpus.
|
|
14
|
+
*/
|
|
15
|
+
/** Emoji ranges stripped from heading text before slugification. */
|
|
16
|
+
export declare const HEADING_EMOJI_RE: RegExp;
|
|
17
|
+
/** Remove emoji characters and trim. */
|
|
18
|
+
export declare function stripHeadingEmojis(text: string): string;
|
|
19
|
+
/**
|
|
20
|
+
* Core slug chain WITHOUT the emoji strip (the extractor exposes emoji
|
|
21
|
+
* stripping as an option, so the two steps are kept separable):
|
|
22
|
+
* lowercase → drop non-word/space/hyphen chars → spaces to hyphens →
|
|
23
|
+
* trim leading/trailing hyphens. May return `''` for symbol-only input —
|
|
24
|
+
* callers apply their own fallback (`section-N`).
|
|
25
|
+
*/
|
|
26
|
+
export declare function slugifyHeadingBase(text: string): string;
|
|
27
|
+
/** The full default chain used by the renderers: emoji strip + slugify. */
|
|
28
|
+
export declare function slugifyHeadingText(text: string): string;
|
|
29
|
+
/**
|
|
30
|
+
* Sharing the slug chain alone was not enough. The PRODUCER
|
|
31
|
+
* (`utils/markdown-section-extractor`) and the CONSUMER
|
|
32
|
+
* (`components/ui/markdown/heading-ids`) each carried their own copy of
|
|
33
|
+
* "which lines are headings" and "how do duplicates get suffixed", and the
|
|
34
|
+
* copies drifted:
|
|
35
|
+
* - the extractor toggled its code-block state on a bare
|
|
36
|
+
* `line.startsWith('```')`, so a `~~~`-fenced (or wider-backtick, or
|
|
37
|
+
* indented) block containing `## Setup` produced a SECTION from the
|
|
38
|
+
* extractor and NO id from the renderer — `sectionIdMap` then missed
|
|
39
|
+
* silently and the deep-link anchor pointed nowhere;
|
|
40
|
+
* - the extractor anchored ATX at column 0 while the renderer allowed the
|
|
41
|
+
* CommonMark 0..3-space indent;
|
|
42
|
+
* - the dedupe counter was hand-copied in both files, each with a comment
|
|
43
|
+
* saying "the two must agree".
|
|
44
|
+
* Both now call `scanHeadings` + `createHeadingIdDeduper`. Server-safe: no
|
|
45
|
+
* React, no DOM.
|
|
46
|
+
*/
|
|
47
|
+
export { createFenceTracker, isBlankLine, type FenceTracker, type FenceLineRole, } from './markdown-fences';
|
|
48
|
+
/** A heading the renderer will emit, located in the source. */
|
|
49
|
+
export interface ScannedHeading {
|
|
50
|
+
/** 1-based line of the heading's FIRST line (setext: the title line). */
|
|
51
|
+
line: number;
|
|
52
|
+
level: number;
|
|
53
|
+
/** Raw title text, before `stripInlineMarkdown` / slugification. */
|
|
54
|
+
text: string;
|
|
55
|
+
}
|
|
56
|
+
export interface ScanHeadingsOptions {
|
|
57
|
+
/**
|
|
58
|
+
* Skip a leading YAML frontmatter block (`---` on line 1 through the next
|
|
59
|
+
* `---`). Only a DOCUMENT-LEADING block counts: a bare `---` mid-document
|
|
60
|
+
* is a thematic break or a setext underline, and treating it as a
|
|
61
|
+
* frontmatter toggle (what the extractor used to do) silently swallowed
|
|
62
|
+
* every heading until the next one.
|
|
63
|
+
*/
|
|
64
|
+
skipFrontmatter?: boolean;
|
|
65
|
+
/** Include raw-HTML headings (`<h2>Title</h2>`). Default true. */
|
|
66
|
+
includeRawHtml?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Skip fenced-code blocks. Default true — a `##` inside a code fence is
|
|
69
|
+
* code, not a heading, and the renderer emits no id for it.
|
|
70
|
+
*/
|
|
71
|
+
skipFences?: boolean;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Collect every heading the markdown renderer will emit, in document order.
|
|
75
|
+
* THE single definition of "which lines are headings" for both the extractor
|
|
76
|
+
* and the renderer's id map.
|
|
77
|
+
*/
|
|
78
|
+
export declare function scanHeadings(content: string, options?: ScanHeadingsOptions): ScannedHeading[];
|
|
79
|
+
/**
|
|
80
|
+
* The duplicate-id suffix counter, as ONE closure both sides instantiate.
|
|
81
|
+
* First occurrence keeps the bare slug; the Nth gets `-N`. Extractor and
|
|
82
|
+
* renderer MUST use the same counter or `#anchor` deep links diverge.
|
|
83
|
+
*/
|
|
84
|
+
export declare function createHeadingIdDeduper(): (cleanId: string) => string;
|
|
85
|
+
//# sourceMappingURL=markdown-heading-id.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown-heading-id.d.ts","sourceRoot":"","sources":["../../src/utils/markdown-heading-id.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,oEAAoE;AACpE,eAAO,MAAM,gBAAgB,QACsC,CAAA;AAEnE,wCAAwC;AACxC,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOvD;AAED,2EAA2E;AAC3E,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEvD;AAKD;;;;;;;;;;;;;;;;;GAiBG;AAMH,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,KAAK,YAAY,EACjB,KAAK,aAAa,GACnB,MAAM,mBAAmB,CAAA;AAG1B,+DAA+D;AAC/D,MAAM,WAAW,cAAc;IAC7B,yEAAyE;IACzE,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,mBAAmB;IAClC;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,kEAAkE;IAClE,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAkHD;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,mBAAwB,GAChC,cAAc,EAAE,CAwGlB;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,IAAI,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAUpE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown-section-extractor.d.ts","sourceRoot":"","sources":["../../src/utils/markdown-section-extractor.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"markdown-section-extractor.d.ts","sourceRoot":"","sources":["../../src/utils/markdown-section-extractor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,sBAAsB;IACrC,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,uDAAuD;IACvD,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,yEAAyE;IACzE,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,8EAA8E;IAC9E,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAChC,4DAA4D;IAC5D,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAChC;AAUD,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,sBAA2B,GACnC,eAAe,EAAE,CA+CnB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flamingo-stack/openframe-frontend-core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.509",
|
|
4
4
|
"description": "Shared design system and components for all Flamingo platforms",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -120,6 +120,12 @@
|
|
|
120
120
|
"require": "./dist/platform-domains.cjs",
|
|
121
121
|
"default": "./dist/platform-domains.js"
|
|
122
122
|
},
|
|
123
|
+
"./chat-protocol": {
|
|
124
|
+
"types": "./dist/chat-protocol/index.d.ts",
|
|
125
|
+
"import": "./dist/chat-protocol/index.js",
|
|
126
|
+
"require": "./dist/chat-protocol/index.cjs",
|
|
127
|
+
"default": "./dist/chat-protocol/index.js"
|
|
128
|
+
},
|
|
123
129
|
"./components/ui/file-manager": {
|
|
124
130
|
"types": "./dist/components/ui/file-manager/index.d.ts",
|
|
125
131
|
"import": "./dist/components/ui/file-manager/index.js",
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`decodeNatsChunk — golden corpus > maps the full recorded corpus to normalized events (snapshot) 1`] = `
|
|
4
|
+
{
|
|
5
|
+
"ai_metadata_full": {
|
|
6
|
+
"contextWindowMaxTokens": 200000,
|
|
7
|
+
"modelLabel": "Claude Sonnet",
|
|
8
|
+
"modelName": "claude-sonnet-x",
|
|
9
|
+
"provider": "anthropic",
|
|
10
|
+
"type": "metadata",
|
|
11
|
+
},
|
|
12
|
+
"ai_metadata_legacy_provider_field": {
|
|
13
|
+
"contextWindowMaxTokens": 0,
|
|
14
|
+
"modelLabel": undefined,
|
|
15
|
+
"modelName": "gpt-x",
|
|
16
|
+
"provider": "openai",
|
|
17
|
+
"type": "metadata",
|
|
18
|
+
},
|
|
19
|
+
"ai_metadata_missing_model": null,
|
|
20
|
+
"ai_metadata_non_numeric_context_window": {
|
|
21
|
+
"contextWindowMaxTokens": 0,
|
|
22
|
+
"modelLabel": undefined,
|
|
23
|
+
"modelName": "claude-sonnet-x",
|
|
24
|
+
"provider": "anthropic",
|
|
25
|
+
"type": "metadata",
|
|
26
|
+
},
|
|
27
|
+
"approval_request_batch": {
|
|
28
|
+
"approvalType": "ADMIN",
|
|
29
|
+
"requestId": "batch-1",
|
|
30
|
+
"toolCalls": [
|
|
31
|
+
{
|
|
32
|
+
"approvalType": "ADMIN",
|
|
33
|
+
"requiresApproval": true,
|
|
34
|
+
"toolCallArguments": {
|
|
35
|
+
"subject": "Printer down",
|
|
36
|
+
},
|
|
37
|
+
"toolExecutionRequestId": "exec-a",
|
|
38
|
+
"toolExplanation": "Opens a new support ticket",
|
|
39
|
+
"toolName": "create_ticket",
|
|
40
|
+
"toolTitle": "Create ticket",
|
|
41
|
+
"toolType": "WRITE",
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"approvalType": null,
|
|
45
|
+
"requiresApproval": false,
|
|
46
|
+
"toolCallArguments": null,
|
|
47
|
+
"toolExecutionRequestId": "exec-b",
|
|
48
|
+
"toolExplanation": undefined,
|
|
49
|
+
"toolName": "read_kb",
|
|
50
|
+
"toolTitle": undefined,
|
|
51
|
+
"toolType": undefined,
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
"type": "approval-request",
|
|
55
|
+
},
|
|
56
|
+
"approval_request_batch_malformed_entries": {
|
|
57
|
+
"approvalType": "USER",
|
|
58
|
+
"requestId": "batch-2",
|
|
59
|
+
"toolCalls": [
|
|
60
|
+
{
|
|
61
|
+
"approvalType": null,
|
|
62
|
+
"requiresApproval": false,
|
|
63
|
+
"toolCallArguments": null,
|
|
64
|
+
"toolExecutionRequestId": "",
|
|
65
|
+
"toolExplanation": undefined,
|
|
66
|
+
"toolName": "42",
|
|
67
|
+
"toolTitle": undefined,
|
|
68
|
+
"toolType": undefined,
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
"type": "approval-request",
|
|
72
|
+
},
|
|
73
|
+
"approval_request_empty_tool_calls": {
|
|
74
|
+
"approvalType": "USER",
|
|
75
|
+
"command": "echo hi",
|
|
76
|
+
"explanation": undefined,
|
|
77
|
+
"requestId": "req-3",
|
|
78
|
+
"type": "approval-request",
|
|
79
|
+
},
|
|
80
|
+
"approval_request_single": {
|
|
81
|
+
"approvalType": "CLIENT",
|
|
82
|
+
"command": "systemctl restart nats",
|
|
83
|
+
"explanation": "Restart the message broker",
|
|
84
|
+
"requestId": "req-1",
|
|
85
|
+
"type": "approval-request",
|
|
86
|
+
},
|
|
87
|
+
"approval_request_snake_case_id": {
|
|
88
|
+
"approvalType": "USER",
|
|
89
|
+
"command": "rm -rf /tmp/cache",
|
|
90
|
+
"explanation": undefined,
|
|
91
|
+
"requestId": "req-2",
|
|
92
|
+
"type": "approval-request",
|
|
93
|
+
},
|
|
94
|
+
"approval_result_approved": {
|
|
95
|
+
"approvalType": "CLIENT",
|
|
96
|
+
"requestId": "req-1",
|
|
97
|
+
"resolvedByName": "Jane Admin",
|
|
98
|
+
"status": "approved",
|
|
99
|
+
"type": "approval-resolved",
|
|
100
|
+
},
|
|
101
|
+
"approval_result_rejected_resolved_by_name": {
|
|
102
|
+
"approvalType": "CLIENT",
|
|
103
|
+
"requestId": "req-1",
|
|
104
|
+
"resolvedByName": "Bob Tech",
|
|
105
|
+
"status": "rejected",
|
|
106
|
+
"type": "approval-resolved",
|
|
107
|
+
},
|
|
108
|
+
"approval_result_truthy_string_approved": {
|
|
109
|
+
"approvalType": "CLIENT",
|
|
110
|
+
"requestId": "req-9",
|
|
111
|
+
"resolvedByName": undefined,
|
|
112
|
+
"status": "rejected",
|
|
113
|
+
"type": "approval-resolved",
|
|
114
|
+
},
|
|
115
|
+
"context_compaction_end": {
|
|
116
|
+
"phase": "end",
|
|
117
|
+
"summary": "Compacted 34 messages",
|
|
118
|
+
"type": "compaction",
|
|
119
|
+
},
|
|
120
|
+
"context_compaction_end_no_summary": {
|
|
121
|
+
"phase": "end",
|
|
122
|
+
"summary": undefined,
|
|
123
|
+
"type": "compaction",
|
|
124
|
+
},
|
|
125
|
+
"context_compaction_start": {
|
|
126
|
+
"phase": "start",
|
|
127
|
+
"type": "compaction",
|
|
128
|
+
},
|
|
129
|
+
"dialog_closed": {
|
|
130
|
+
"type": "dialog-closed",
|
|
131
|
+
},
|
|
132
|
+
"direct_message": {
|
|
133
|
+
"displayName": "Jane Admin",
|
|
134
|
+
"kind": "direct-message",
|
|
135
|
+
"ownerType": "ADMIN",
|
|
136
|
+
"text": "Hi, human here taking over",
|
|
137
|
+
"type": "participant",
|
|
138
|
+
"userId": "admin-7",
|
|
139
|
+
},
|
|
140
|
+
"direct_message_no_text": null,
|
|
141
|
+
"empty_object": null,
|
|
142
|
+
"error_bare": {
|
|
143
|
+
"details": undefined,
|
|
144
|
+
"title": "An error occurred",
|
|
145
|
+
"type": "error",
|
|
146
|
+
},
|
|
147
|
+
"error_full": {
|
|
148
|
+
"details": "{"error":{"message":"boom"}}",
|
|
149
|
+
"title": "Agent crashed",
|
|
150
|
+
"type": "error",
|
|
151
|
+
},
|
|
152
|
+
"executed_tool": {
|
|
153
|
+
"data": {
|
|
154
|
+
"integratedToolType": "TACTICAL_RMM",
|
|
155
|
+
"parameters": {
|
|
156
|
+
"script": "cleanup.sh",
|
|
157
|
+
},
|
|
158
|
+
"result": "Freed 2.3 GB",
|
|
159
|
+
"success": true,
|
|
160
|
+
"toolExecutionRequestId": "exec-1",
|
|
161
|
+
"toolFunction": "run_script",
|
|
162
|
+
"toolTitle": undefined,
|
|
163
|
+
"type": "EXECUTED_TOOL",
|
|
164
|
+
},
|
|
165
|
+
"type": "tool-execution",
|
|
166
|
+
},
|
|
167
|
+
"executed_tool_failure_no_exec_id": {
|
|
168
|
+
"data": {
|
|
169
|
+
"integratedToolType": "FLEET_MDM",
|
|
170
|
+
"parameters": undefined,
|
|
171
|
+
"result": "Device unreachable",
|
|
172
|
+
"success": false,
|
|
173
|
+
"toolExecutionRequestId": undefined,
|
|
174
|
+
"toolFunction": "lock_device",
|
|
175
|
+
"toolTitle": undefined,
|
|
176
|
+
"type": "EXECUTED_TOOL",
|
|
177
|
+
},
|
|
178
|
+
"type": "tool-execution",
|
|
179
|
+
},
|
|
180
|
+
"executing_tool": {
|
|
181
|
+
"data": {
|
|
182
|
+
"integratedToolType": "TACTICAL_RMM",
|
|
183
|
+
"parameters": {
|
|
184
|
+
"script": "cleanup.sh",
|
|
185
|
+
"timeout": 30,
|
|
186
|
+
},
|
|
187
|
+
"toolExecutionRequestId": "exec-1",
|
|
188
|
+
"toolExplanation": "Discovering columns available in the system_info table for accurate querying.",
|
|
189
|
+
"toolFunction": "run_script",
|
|
190
|
+
"toolTitle": "Run cleanup script",
|
|
191
|
+
"type": "EXECUTING_TOOL",
|
|
192
|
+
},
|
|
193
|
+
"type": "tool-execution",
|
|
194
|
+
},
|
|
195
|
+
"executing_tool_minimal": {
|
|
196
|
+
"data": {
|
|
197
|
+
"integratedToolType": "",
|
|
198
|
+
"parameters": undefined,
|
|
199
|
+
"toolExecutionRequestId": undefined,
|
|
200
|
+
"toolExplanation": undefined,
|
|
201
|
+
"toolFunction": "",
|
|
202
|
+
"toolTitle": undefined,
|
|
203
|
+
"type": "EXECUTING_TOOL",
|
|
204
|
+
},
|
|
205
|
+
"type": "tool-execution",
|
|
206
|
+
},
|
|
207
|
+
"guide": {
|
|
208
|
+
"text": "## Enroll a device
|
|
209
|
+
1. Open Settings",
|
|
210
|
+
"type": "guide-delta",
|
|
211
|
+
},
|
|
212
|
+
"guide_empty_string": {
|
|
213
|
+
"text": "",
|
|
214
|
+
"type": "guide-delta",
|
|
215
|
+
},
|
|
216
|
+
"guide_missing_text": null,
|
|
217
|
+
"message_end": {
|
|
218
|
+
"type": "turn-end",
|
|
219
|
+
},
|
|
220
|
+
"message_request": {
|
|
221
|
+
"contextItems": undefined,
|
|
222
|
+
"displayName": "Alice",
|
|
223
|
+
"kind": "message-request",
|
|
224
|
+
"ownerType": "CLIENT",
|
|
225
|
+
"text": "open a ticket",
|
|
226
|
+
"type": "participant",
|
|
227
|
+
"userId": "user-42",
|
|
228
|
+
},
|
|
229
|
+
"message_request_no_text": {
|
|
230
|
+
"contextItems": undefined,
|
|
231
|
+
"displayName": undefined,
|
|
232
|
+
"kind": "message-request",
|
|
233
|
+
"ownerType": undefined,
|
|
234
|
+
"text": "",
|
|
235
|
+
"type": "participant",
|
|
236
|
+
"userId": undefined,
|
|
237
|
+
},
|
|
238
|
+
"message_request_with_context_items": {
|
|
239
|
+
"contextItems": [
|
|
240
|
+
{
|
|
241
|
+
"id": "dev-1",
|
|
242
|
+
"label": "dev-1",
|
|
243
|
+
"type": "device",
|
|
244
|
+
},
|
|
245
|
+
],
|
|
246
|
+
"displayName": undefined,
|
|
247
|
+
"kind": "message-request",
|
|
248
|
+
"ownerType": undefined,
|
|
249
|
+
"text": "diagnose this device",
|
|
250
|
+
"type": "participant",
|
|
251
|
+
"userId": undefined,
|
|
252
|
+
},
|
|
253
|
+
"message_start": {
|
|
254
|
+
"type": "turn-start",
|
|
255
|
+
},
|
|
256
|
+
"missing_type": null,
|
|
257
|
+
"null_chunk": null,
|
|
258
|
+
"number_chunk": null,
|
|
259
|
+
"string_chunk": null,
|
|
260
|
+
"system": {
|
|
261
|
+
"kind": "system",
|
|
262
|
+
"text": "Technician joined the chat",
|
|
263
|
+
"type": "participant",
|
|
264
|
+
},
|
|
265
|
+
"system_no_text": null,
|
|
266
|
+
"text": {
|
|
267
|
+
"text": "Hello, ",
|
|
268
|
+
"type": "text-delta",
|
|
269
|
+
},
|
|
270
|
+
"text_empty_string": {
|
|
271
|
+
"text": "",
|
|
272
|
+
"type": "text-delta",
|
|
273
|
+
},
|
|
274
|
+
"text_missing_text_field": null,
|
|
275
|
+
"thinking": {
|
|
276
|
+
"text": "Considering options…",
|
|
277
|
+
"type": "thinking-delta",
|
|
278
|
+
},
|
|
279
|
+
"thinking_missing_text": null,
|
|
280
|
+
"token_usage": {
|
|
281
|
+
"contextSize": 180000,
|
|
282
|
+
"inputTokensSize": 1200,
|
|
283
|
+
"outputTokensSize": 340,
|
|
284
|
+
"totalTokensSize": 1540,
|
|
285
|
+
"type": "token-usage",
|
|
286
|
+
},
|
|
287
|
+
"token_usage_empty_defaults": {
|
|
288
|
+
"contextSize": 0,
|
|
289
|
+
"inputTokensSize": 0,
|
|
290
|
+
"outputTokensSize": 0,
|
|
291
|
+
"totalTokensSize": 0,
|
|
292
|
+
"type": "token-usage",
|
|
293
|
+
},
|
|
294
|
+
"undefined_chunk": null,
|
|
295
|
+
"unknown_type": null,
|
|
296
|
+
}
|
|
297
|
+
`;
|
|
298
|
+
|
|
299
|
+
exports[`decodeNatsChunk — seq envelope > lifts a numeric JetStream \`streamSeq\` into \`seq\`, and omits it otherwise (snapshot) 1`] = `
|
|
300
|
+
{
|
|
301
|
+
"absent": {
|
|
302
|
+
"text": "hi",
|
|
303
|
+
"type": "text-delta",
|
|
304
|
+
},
|
|
305
|
+
"non_numeric": {
|
|
306
|
+
"text": "hi",
|
|
307
|
+
"type": "text-delta",
|
|
308
|
+
},
|
|
309
|
+
"numeric": {
|
|
310
|
+
"seq": 42,
|
|
311
|
+
"text": "hi",
|
|
312
|
+
"type": "text-delta",
|
|
313
|
+
},
|
|
314
|
+
"zero": {
|
|
315
|
+
"seq": 0,
|
|
316
|
+
"type": "turn-start",
|
|
317
|
+
},
|
|
318
|
+
}
|
|
319
|
+
`;
|