@flamingo-stack/openframe-frontend-core 0.0.824 → 0.0.826
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/build/export-map.json +1 -1
- package/dist/{case-study-card-IZBMHA6R.cjs → case-study-card-O4IQCJAX.cjs} +5 -5
- package/dist/chat-protocol/events.d.ts +0 -3
- package/dist/chat-protocol/events.d.ts.map +1 -1
- package/dist/chat-protocol/frames.d.ts +10 -7
- package/dist/chat-protocol/frames.d.ts.map +1 -1
- package/dist/chat-protocol/index.cjs +238 -234
- package/dist/chat-protocol/leading-frames.d.ts.map +1 -1
- package/dist/chat-protocol/leading-frames.js +6 -3
- package/dist/chat-protocol/progress.d.ts +13 -20
- package/dist/chat-protocol/progress.d.ts.map +1 -1
- package/dist/chat-protocol/progress.js +13 -11
- package/dist/{chunk-QOAA7ZHB.cjs → chunk-2HQNXX2K.cjs} +2 -2
- package/dist/{chunk-TQ7TUEK2.cjs → chunk-2TQJSB62.cjs} +4879 -3563
- package/dist/{chunk-NONMZ5WJ.cjs → chunk-2VLPXUQK.cjs} +14 -83
- package/dist/{chunk-HDOU3AXV.cjs → chunk-37OYBX7W.cjs} +36 -36
- package/dist/{chunk-OBQ5WUNG.cjs → chunk-3B6ZE4EZ.cjs} +29 -29
- package/dist/{chunk-C3RAE7RO.cjs → chunk-5AQKXEMI.cjs} +979 -1357
- package/dist/{chunk-25HBH4J6.cjs → chunk-5BM7X4GA.cjs} +2 -2
- package/dist/{chunk-A3SR6HHX.cjs → chunk-63T2KKDZ.cjs} +86 -86
- package/dist/{chunk-MROW2JWE.cjs → chunk-6G4WRMEM.cjs} +3 -3
- package/dist/{chunk-WMTV6M5B.cjs → chunk-74GWFGH2.cjs} +28 -28
- package/dist/{chunk-467T3LCG.cjs → chunk-7PZQ7SHB.cjs} +49 -32
- package/dist/{chunk-SOSVC6HB.cjs → chunk-AJM4YZTW.cjs} +8 -8
- package/dist/{chunk-2XLPRW7V.cjs → chunk-BIG3O33P.cjs} +6 -2
- package/dist/chunk-BMQLM2NU.cjs +40 -0
- package/dist/{chunk-DVHSYPDB.cjs → chunk-DAKGX2WF.cjs} +2 -2
- package/dist/{chunk-2IWAHBCC.cjs → chunk-DRSFR5AC.cjs} +159 -159
- package/dist/{chunk-IJCSQFLD.cjs → chunk-DU6AF77X.cjs} +83 -121
- package/dist/{chunk-B2VRNRTY.cjs → chunk-EJNDTSKY.cjs} +91 -91
- package/dist/{chunk-SBFBNOKU.cjs → chunk-ENMPSEEQ.cjs} +4 -4
- package/dist/{chunk-ZECG6GU5.cjs → chunk-F2J5WN6U.cjs} +2 -2
- package/dist/{chunk-BOS7OIC4.cjs → chunk-GRHF5SWL.cjs} +5 -2
- package/dist/{chunk-Z7BLMJEI.cjs → chunk-GZAPOCKS.cjs} +54 -54
- package/dist/{chunk-M7EBCYKN.cjs → chunk-HJAPXKWK.cjs} +17 -17
- package/dist/{chunk-XUMZMIHR.cjs → chunk-HQ4FKHOO.cjs} +249 -108
- package/dist/{chunk-ZRDVFADQ.cjs → chunk-IBD2FPSX.cjs} +75 -9
- package/dist/{chunk-T266OITJ.cjs → chunk-IKWQW3YJ.cjs} +45 -45
- package/dist/{chunk-B7NSH7IK.cjs → chunk-IWQ2LJGW.cjs} +5 -5
- package/dist/{chunk-2IHGR57J.cjs → chunk-JDR72QFU.cjs} +12 -14
- package/dist/{chunk-EHANO6UE.cjs → chunk-K34TTZAE.cjs} +9 -129
- package/dist/{chunk-QDDBOCG3.cjs → chunk-KPGKTEEB.cjs} +2 -2
- package/dist/{chunk-WSBAIZXL.cjs → chunk-MDEOCOIE.cjs} +23 -23
- package/dist/chunk-OEP5KAT6.cjs +56 -0
- package/dist/chunk-OT6P57ZS.cjs +94 -0
- package/dist/{chunk-QQT23JJ7.cjs → chunk-PBHP3FHO.cjs} +4 -4
- package/dist/{chunk-J5U3XHFJ.cjs → chunk-PJY3SYCS.cjs} +29 -27
- package/dist/{chunk-5N26M6CK.cjs → chunk-PWAKRRRO.cjs} +1283 -268
- package/dist/{chunk-UEULXVW2.cjs → chunk-QS6AKUUL.cjs} +22 -22
- package/dist/{chunk-GXBIYPDM.cjs → chunk-QYJZDEG7.cjs} +6 -6
- package/dist/{chunk-NPNZAAOB.cjs → chunk-S6UJEW4G.cjs} +2 -2
- package/dist/{chunk-TTMTNG3U.cjs → chunk-TJG2BJ5J.cjs} +4 -4
- package/dist/{chunk-QOOMUGF2.cjs → chunk-TYJ73DHW.cjs} +15 -15
- package/dist/{chunk-A34UNP5V.cjs → chunk-W4VEDSAX.cjs} +80 -11
- package/dist/{chunk-2M4E2V25.cjs → chunk-WGMU45NV.cjs} +20 -20
- package/dist/{chunk-EZTCN43H.cjs → chunk-XDHQC4XH.cjs} +46 -46
- package/dist/{cloud-tenants-VYXMNISG.cjs → cloud-tenants-F67KQ5GC.cjs} +108 -106
- package/dist/components/case-studies/index.cjs +124 -122
- package/dist/components/chat/approval-batch-message.d.ts.map +1 -1
- package/dist/components/chat/approval-batch-message.js +2 -2
- package/dist/components/chat/chat-archive-page.d.ts +7 -0
- package/dist/components/chat/chat-archive-page.d.ts.map +1 -1
- package/dist/components/chat/chat-archive-page.js +9 -0
- package/dist/components/chat/chat-composer.d.ts +24 -4
- package/dist/components/chat/chat-composer.d.ts.map +1 -1
- package/dist/components/chat/chat-composer.js +90 -48
- package/dist/components/chat/chat-context-memory-bar.d.ts +4 -1
- package/dist/components/chat/chat-context-memory-bar.d.ts.map +1 -1
- package/dist/components/chat/chat-context-memory-bar.js +8 -5
- package/dist/components/chat/chat-context-picker.d.ts +8 -1
- package/dist/components/chat/chat-context-picker.d.ts.map +1 -1
- package/dist/components/chat/chat-context-picker.js +32 -9
- package/dist/components/chat/chat-header-rename-field.d.ts +18 -0
- package/dist/components/chat/chat-header-rename-field.d.ts.map +1 -0
- package/dist/components/chat/chat-header-rename-field.js +49 -0
- package/dist/components/chat/chat-input.d.ts.map +1 -1
- package/dist/components/chat/chat-input.js +5 -0
- package/dist/components/chat/composer-sheet.d.ts +44 -0
- package/dist/components/chat/composer-sheet.d.ts.map +1 -0
- package/dist/components/chat/composer-sheet.js +140 -0
- package/dist/components/chat/embeddable-chat.d.ts +114 -1
- package/dist/components/chat/embeddable-chat.d.ts.map +1 -1
- package/dist/components/chat/embeddable-chat.js +328 -218
- package/dist/components/chat/hooks/use-sse-chat-adapter.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-sse-chat-adapter.js +0 -2
- package/dist/components/chat/hooks/use-unified-chat.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-unified-chat.js +0 -1
- package/dist/components/chat/index.cjs +118 -103
- package/dist/components/chat/index.d.ts +6 -0
- package/dist/components/chat/index.d.ts.map +1 -1
- package/dist/components/chat/index.js +9 -0
- package/dist/components/chat/mingo-chat-day-groups.d.ts +18 -0
- package/dist/components/chat/mingo-chat-day-groups.d.ts.map +1 -0
- package/dist/components/chat/mingo-chat-day-groups.js +45 -0
- package/dist/components/chat/mingo-chat-header.d.ts +34 -6
- package/dist/components/chat/mingo-chat-header.d.ts.map +1 -1
- package/dist/components/chat/mingo-chat-header.js +44 -7
- package/dist/components/chat/mingo-chat-history-section.d.ts +30 -0
- package/dist/components/chat/mingo-chat-history-section.d.ts.map +1 -0
- package/dist/components/chat/mingo-chat-history-section.js +500 -0
- package/dist/components/chat/mingo-chat-history.d.ts +5 -2
- package/dist/components/chat/mingo-chat-history.d.ts.map +1 -1
- package/dist/components/chat/mingo-chat-history.js +26 -30
- package/dist/components/chat/mingo-chat-list-shared.d.ts +136 -0
- package/dist/components/chat/mingo-chat-list-shared.d.ts.map +1 -0
- package/dist/components/chat/mingo-chat-list-shared.js +76 -0
- package/dist/components/chat/mingo-chat-rail.d.ts +19 -51
- package/dist/components/chat/mingo-chat-rail.d.ts.map +1 -1
- package/dist/components/chat/mingo-chat-rail.js +23 -45
- package/dist/components/chat/mingo-edge-light.d.ts +13 -0
- package/dist/components/chat/mingo-edge-light.d.ts.map +1 -0
- package/dist/components/chat/mingo-edge-light.js +17 -0
- package/dist/components/chat/mingo-history-rail.d.ts +5 -4
- package/dist/components/chat/mingo-history-rail.d.ts.map +1 -1
- package/dist/components/chat/mingo-history-rail.js +5 -10
- package/dist/components/chat/mingo-quick-action-wall.d.ts +27 -0
- package/dist/components/chat/mingo-quick-action-wall.d.ts.map +1 -0
- package/dist/components/chat/mingo-quick-action-wall.js +41 -0
- package/dist/components/chat/mingo-welcome.d.ts.map +1 -1
- package/dist/components/chat/mingo-welcome.js +6 -20
- package/dist/components/chat/model-display.d.ts.map +1 -1
- package/dist/components/chat/model-display.js +38 -9
- package/dist/components/chat/stream/chat-dialog-store.d.ts.map +1 -1
- package/dist/components/chat/stream/chat-dialog-store.js +0 -1
- package/dist/components/chat/stream/chat-stream-reducer.d.ts +0 -4
- package/dist/components/chat/stream/chat-stream-reducer.d.ts.map +1 -1
- package/dist/components/chat/stream/chat-stream-reducer.js +6 -13
- package/dist/components/chat/tool-execution-display.d.ts.map +1 -1
- package/dist/components/chat/tool-execution-display.js +15 -1
- package/dist/components/chat/types/component.types.d.ts +13 -1
- package/dist/components/chat/types/component.types.d.ts.map +1 -1
- package/dist/components/chat/types/unified-chat-state.types.d.ts +0 -5
- package/dist/components/chat/types/unified-chat-state.types.d.ts.map +1 -1
- package/dist/components/chat/utils/chat-day-label.d.ts +8 -0
- package/dist/components/chat/utils/chat-day-label.d.ts.map +1 -0
- package/dist/components/chat/utils/chat-day-label.js +21 -0
- package/dist/components/contact/index.cjs +109 -107
- package/dist/components/docs/index.cjs +112 -110
- package/dist/components/embeds/index.cjs +109 -107
- package/dist/components/faq/index.cjs +110 -108
- package/dist/components/features/board/board-column.d.ts +3 -1
- package/dist/components/features/board/board-column.d.ts.map +1 -1
- package/dist/components/features/board/board-column.js +6 -2
- package/dist/components/features/board/board.d.ts +6 -0
- package/dist/components/features/board/board.d.ts.map +1 -1
- package/dist/components/features/board/board.js +14 -3
- package/dist/components/features/board/touch-board.d.ts +1 -1
- package/dist/components/features/board/touch-board.d.ts.map +1 -1
- package/dist/components/features/board/touch-board.js +3 -1
- package/dist/components/features/index.cjs +108 -106
- package/dist/components/features/notifications/approval-request-notification-tile.d.ts +7 -1
- package/dist/components/features/notifications/approval-request-notification-tile.d.ts.map +1 -1
- package/dist/components/features/notifications/approval-request-notification-tile.js +1 -1
- package/dist/components/features/notifications/notification-drawer.d.ts +6 -1
- package/dist/components/features/notifications/notification-drawer.d.ts.map +1 -1
- package/dist/components/features/notifications/notification-drawer.js +3 -2
- package/dist/components/features/notifications/notification-tile.d.ts +4 -1
- package/dist/components/features/notifications/notification-tile.d.ts.map +1 -1
- package/dist/components/features/notifications/notification-tile.js +9 -7
- package/dist/components/features/time-tracker/time-tracker-header-button.d.ts +18 -1
- package/dist/components/features/time-tracker/time-tracker-header-button.d.ts.map +1 -1
- package/dist/components/features/time-tracker/time-tracker-header-button.js +31 -7
- package/dist/components/help-center-pages/index.cjs +217 -215
- package/dist/components/icons-v2-generated/icon-loaders.d.ts.map +1 -1
- package/dist/components/icons-v2-generated/icon-loaders.js +1 -0
- package/dist/components/icons-v2-generated/icon-names.js +1 -1
- package/dist/components/icons-v2-generated/index.cjs +90 -86
- package/dist/components/icons-v2-generated/loaders/dots-loader-icon.d.ts.map +1 -1
- package/dist/components/icons-v2-generated/loaders/dots-loader-icon.js +21 -24
- package/dist/components/icons-v2-generated/logos/index.d.ts +1 -0
- package/dist/components/icons-v2-generated/logos/index.d.ts.map +1 -1
- package/dist/components/icons-v2-generated/logos/index.js +2 -0
- package/dist/components/icons-v2-generated/logos/mingo-logo-icon.d.ts +9 -0
- package/dist/components/icons-v2-generated/logos/mingo-logo-icon.d.ts.map +1 -0
- package/dist/components/icons-v2-generated/logos/mingo-logo-icon.js +36 -0
- package/dist/components/index.cjs +215 -182
- package/dist/components/meeting-scheduler/index.cjs +182 -180
- package/dist/components/navigation/account-popover.d.ts +62 -0
- package/dist/components/navigation/account-popover.d.ts.map +1 -0
- package/dist/components/navigation/account-popover.js +138 -0
- package/dist/components/navigation/app-header.d.ts +36 -2
- package/dist/components/navigation/app-header.d.ts.map +1 -1
- package/dist/components/navigation/app-header.js +28 -24
- package/dist/components/navigation/app-layout-context.d.ts +17 -0
- package/dist/components/navigation/app-layout-context.d.ts.map +1 -1
- package/dist/components/navigation/app-layout-context.js +9 -1
- package/dist/components/navigation/app-layout.d.ts +93 -1
- package/dist/components/navigation/app-layout.d.ts.map +1 -1
- package/dist/components/navigation/app-layout.js +149 -30
- package/dist/components/navigation/header-button.d.ts +11 -1
- package/dist/components/navigation/header-button.d.ts.map +1 -1
- package/dist/components/navigation/header-button.js +16 -5
- package/dist/components/navigation/header-mingo-button.d.ts.map +1 -1
- package/dist/components/navigation/header-mingo-button.js +6 -5
- package/dist/components/navigation/index.cjs +120 -109
- package/dist/components/navigation/index.d.ts +10 -1
- package/dist/components/navigation/index.d.ts.map +1 -1
- package/dist/components/navigation/index.js +8 -0
- package/dist/components/navigation/mingo-ai-button.d.ts.map +1 -1
- package/dist/components/navigation/mingo-ai-button.js +2 -1
- package/dist/components/navigation/mobile-burger-menu.d.ts.map +1 -1
- package/dist/components/navigation/mobile-burger-menu.js +155 -39
- package/dist/components/navigation/navigation-sidebar-grouped.d.ts +57 -0
- package/dist/components/navigation/navigation-sidebar-grouped.d.ts.map +1 -0
- package/dist/components/navigation/navigation-sidebar-grouped.js +365 -0
- package/dist/components/navigation/navigation-sidebar-match.d.ts +37 -0
- package/dist/components/navigation/navigation-sidebar-match.d.ts.map +1 -0
- package/dist/components/navigation/navigation-sidebar-match.js +85 -0
- package/dist/components/navigation/navigation-sidebar-slot.d.ts +7 -0
- package/dist/components/navigation/navigation-sidebar-slot.d.ts.map +1 -0
- package/dist/components/navigation/navigation-sidebar-slot.js +11 -0
- package/dist/components/navigation/navigation-sidebar-toggle.d.ts +7 -1
- package/dist/components/navigation/navigation-sidebar-toggle.d.ts.map +1 -1
- package/dist/components/navigation/navigation-sidebar-toggle.js +52 -23
- package/dist/components/navigation/navigation-sidebar.d.ts +13 -1
- package/dist/components/navigation/navigation-sidebar.d.ts.map +1 -1
- package/dist/components/navigation/navigation-sidebar.js +188 -52
- package/dist/components/navigation/notifications-bell-button.d.ts +28 -0
- package/dist/components/navigation/notifications-bell-button.d.ts.map +1 -0
- package/dist/components/navigation/notifications-bell-button.js +44 -0
- package/dist/components/navigation/ticket-alerts-button.d.ts +7 -1
- package/dist/components/navigation/ticket-alerts-button.d.ts.map +1 -1
- package/dist/components/navigation/ticket-alerts-button.js +3 -2
- package/dist/components/onboarding-guides/index.cjs +111 -109
- package/dist/components/product-demo/index.cjs +119 -117
- package/dist/components/related-content/index.cjs +13 -13
- package/dist/components/tickets/index.cjs +115 -113
- package/dist/components/ui/actions-menu.d.ts +6 -1
- package/dist/components/ui/actions-menu.d.ts.map +1 -1
- package/dist/components/ui/actions-menu.js +6 -2
- package/dist/components/ui/fade-preview.d.ts +8 -0
- package/dist/components/ui/fade-preview.d.ts.map +1 -1
- package/dist/components/ui/fade-preview.js +7 -5
- package/dist/components/ui/index.cjs +136 -111
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +1 -0
- package/dist/components/ui/mobile-action-bar.d.ts +14 -0
- package/dist/components/ui/mobile-action-bar.d.ts.map +1 -0
- package/dist/components/ui/mobile-action-bar.js +68 -0
- package/dist/components/ui/no-data/no-data-styles.d.ts +1 -1
- package/dist/components/ui/no-data/no-data-styles.d.ts.map +1 -1
- package/dist/components/ui/no-data/no-data-styles.js +1 -1
- package/dist/components/ui/page-actions.d.ts.map +1 -1
- package/dist/components/ui/page-actions.js +24 -8
- package/dist/components/ui/panel-resize-handle.d.ts +6 -2
- package/dist/components/ui/panel-resize-handle.d.ts.map +1 -1
- package/dist/components/ui/panel-resize-handle.js +6 -3
- package/dist/components/ui/square-avatar.d.ts.map +1 -1
- package/dist/components/ui/square-avatar.js +5 -2
- package/dist/{devices-NTYNZEGJ.cjs → devices-SJORCARH.cjs} +109 -107
- package/dist/dots-loader-icon-5JXWD6FB.cjs +7 -0
- package/dist/{embeddable-chat-JAUO4O2T.cjs → embeddable-chat-7Z4CEZJL.cjs} +512 -400
- package/dist/hooks/index.cjs +15 -16
- package/dist/hooks/ui/use-content-breakpoint.d.ts +4 -2
- package/dist/hooks/ui/use-content-breakpoint.d.ts.map +1 -1
- package/dist/{icon-loaders-OLGJZGRP.cjs → icon-loaders-SUPEKMBJ.cjs} +2 -1
- package/dist/index.cjs +154 -121
- package/dist/{knowledge-I2LW27EP.cjs → knowledge-QXILUVEM.cjs} +109 -107
- package/dist/{logs-KLZHXSOU.cjs → logs-E3KQQQD6.cjs} +118 -115
- package/dist/mingo-logo-icon-WGPBSDTF.cjs +7 -0
- package/dist/{policies-SMDAHDKL.cjs → policies-IOYQY6TF.cjs} +112 -110
- package/dist/{remote-session-BQMTIQTU.cjs → remote-session-QGFG5WAL.cjs} +99 -97
- package/dist/{scripts-OMBBPNTU.cjs → scripts-E5TWWUNP.cjs} +115 -113
- package/dist/{software-update-ZIJYNJIC.cjs → software-update-QZGYG4TD.cjs} +112 -110
- package/dist/{tickets-board-TRXOX77R.cjs → tickets-board-KCH6ITUV.cjs} +95 -94
- package/dist/types/navigation.d.ts +131 -0
- package/dist/types/navigation.d.ts.map +1 -1
- package/dist/utils/index.cjs +65 -25
- package/package.json +1 -1
- package/src/chat-protocol/events.ts +0 -3
- package/src/chat-protocol/frames.ts +12 -8
- package/src/chat-protocol/leading-frames.ts +7 -4
- package/src/chat-protocol/progress.ts +31 -28
- package/src/components/chat/approval-batch-message.tsx +3 -2
- package/src/components/chat/chat-archive-page.tsx +16 -0
- package/src/components/chat/chat-composer.tsx +131 -61
- package/src/components/chat/chat-context-memory-bar.tsx +27 -17
- package/src/components/chat/chat-context-picker.tsx +45 -11
- package/src/components/chat/chat-header-rename-field.tsx +68 -0
- package/src/components/chat/chat-input.tsx +9 -1
- package/src/components/chat/composer-sheet.tsx +196 -0
- package/src/components/chat/embeddable-chat.tsx +636 -324
- package/src/components/chat/hooks/use-sse-chat-adapter.ts +0 -2
- package/src/components/chat/hooks/use-unified-chat.ts +0 -1
- package/src/components/chat/index.ts +6 -0
- package/src/components/chat/mingo-chat-day-groups.ts +62 -0
- package/src/components/chat/mingo-chat-header.tsx +99 -23
- package/src/components/chat/mingo-chat-history-section.tsx +670 -0
- package/src/components/chat/mingo-chat-history.tsx +31 -45
- package/src/components/chat/mingo-chat-list-shared.tsx +244 -0
- package/src/components/chat/mingo-chat-rail.tsx +45 -97
- package/src/components/chat/mingo-edge-light.tsx +25 -0
- package/src/components/chat/mingo-history-rail.tsx +7 -17
- package/src/components/chat/mingo-quick-action-wall.tsx +64 -0
- package/src/components/chat/mingo-welcome.tsx +5 -19
- package/src/components/chat/model-display.tsx +66 -14
- package/src/components/chat/stream/chat-dialog-store.ts +0 -1
- package/src/components/chat/stream/chat-stream-reducer.ts +6 -17
- package/src/components/chat/tool-execution-display.tsx +9 -1
- package/src/components/chat/types/component.types.ts +13 -1
- package/src/components/chat/types/unified-chat-state.types.ts +0 -6
- package/src/components/chat/utils/chat-day-label.ts +24 -0
- package/src/components/features/board/board-column.tsx +8 -0
- package/src/components/features/board/board.tsx +16 -2
- package/src/components/features/board/touch-board.tsx +2 -0
- package/src/components/features/notifications/approval-request-notification-tile.tsx +8 -2
- package/src/components/features/notifications/notification-drawer.tsx +7 -1
- package/src/components/features/notifications/notification-tile.tsx +17 -9
- package/src/components/features/time-tracker/time-tracker-header-button.tsx +53 -6
- package/src/components/icons-v2/icon-colors.json +4 -0
- package/src/components/icons-v2-generated/icon-loaders.ts +1 -0
- package/src/components/icons-v2-generated/icon-names.ts +1 -1
- package/src/components/icons-v2-generated/loaders/dots-loader-icon.tsx +18 -27
- package/src/components/icons-v2-generated/logos/index.ts +1 -0
- package/src/components/icons-v2-generated/logos/mingo-logo-icon.tsx +35 -0
- package/src/components/navigation/account-popover.tsx +198 -0
- package/src/components/navigation/app-header.tsx +74 -33
- package/src/components/navigation/app-layout-context.ts +22 -0
- package/src/components/navigation/app-layout.tsx +290 -24
- package/src/components/navigation/header-button.tsx +27 -5
- package/src/components/navigation/header-mingo-button.tsx +6 -5
- package/src/components/navigation/index.ts +19 -0
- package/src/components/navigation/mingo-ai-button.tsx +2 -3
- package/src/components/navigation/mobile-burger-menu.tsx +219 -53
- package/src/components/navigation/navigation-sidebar-grouped.tsx +554 -0
- package/src/components/navigation/navigation-sidebar-match.ts +152 -0
- package/src/components/navigation/navigation-sidebar-slot.ts +12 -0
- package/src/components/navigation/navigation-sidebar-toggle.tsx +39 -6
- package/src/components/navigation/navigation-sidebar.tsx +278 -61
- package/src/components/navigation/notifications-bell-button.tsx +70 -0
- package/src/components/navigation/ticket-alerts-button.tsx +9 -2
- package/src/components/ui/actions-menu.tsx +19 -3
- package/src/components/ui/fade-preview.tsx +13 -6
- package/src/components/ui/index.ts +1 -0
- package/src/components/ui/mobile-action-bar.ts +87 -0
- package/src/components/ui/no-data/no-data-styles.ts +5 -2
- package/src/components/ui/page-actions.tsx +38 -11
- package/src/components/ui/panel-resize-handle.tsx +14 -5
- package/src/components/ui/square-avatar.tsx +5 -2
- package/src/hooks/ui/use-content-breakpoint.ts +4 -2
- package/src/styles/ods-interaction-states.css +68 -0
- package/src/types/navigation.ts +140 -0
- package/dist/chunk-C7GIHB3V.cjs +0 -59
- package/dist/dots-loader-icon-RBLX46X7.cjs +0 -7
- package/dist/{chunk-ZOZR3QI2.cjs → chunk-46547WQW.cjs} +0 -0
- package/dist/{video-file-player-IAMWBKEQ.cjs → video-file-player-IHO66P2Q.cjs} +1 -1
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
require('./chunk-
|
|
5
|
+
var _chunkQS6AKUULcjs = require('./chunk-QS6AKUUL.cjs');
|
|
6
|
+
require('./chunk-PBHP3FHO.cjs');
|
|
7
7
|
require('./chunk-USUVHAQ7.cjs');
|
|
8
8
|
require('./chunk-S5C3OZCO.cjs');
|
|
9
9
|
require('./chunk-4IYNDV3G.cjs');
|
|
10
|
-
require('./chunk-
|
|
10
|
+
require('./chunk-DAKGX2WF.cjs');
|
|
11
11
|
require('./chunk-FX35L4Y6.cjs');
|
|
12
|
+
require('./chunk-2HQNXX2K.cjs');
|
|
12
13
|
require('./chunk-NTPX5GXI.cjs');
|
|
13
|
-
require('./chunk-QOAA7ZHB.cjs');
|
|
14
14
|
require('./chunk-GI3MMBP3.cjs');
|
|
15
15
|
require('./chunk-3V5JWG27.cjs');
|
|
16
16
|
require('./chunk-UJ7AXHRZ.cjs');
|
|
@@ -20,4 +20,4 @@ require('./chunk-63A4GZMB.cjs');
|
|
|
20
20
|
require('./chunk-V45KLJQP.cjs');
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
exports.CaseStudyCard =
|
|
23
|
+
exports.CaseStudyCard = _chunkQS6AKUULcjs.CaseStudyCard;
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
import type { ChatRef } from '../components/chat/chat-ref.types';
|
|
11
11
|
import type { AskOptionData, ChatSource } from '../components/chat/types/message.types';
|
|
12
12
|
import type { ApprovalRequestField, DecisionResolvedFrame, UsageTelemetry } from './frames';
|
|
13
|
-
import type { ChatProgress } from './progress';
|
|
14
13
|
/** Optional envelope on every event. `seq` carries the transport's
|
|
15
14
|
* stream sequence (JetStream `streamSeq` on NATS; unused on SSE). */
|
|
16
15
|
interface ChatStreamEventBase {
|
|
@@ -59,8 +58,6 @@ export interface AskEvent extends ChatStreamEventBase {
|
|
|
59
58
|
export interface StatusEvent extends ChatStreamEventBase {
|
|
60
59
|
type: 'status';
|
|
61
60
|
phase: 'thinking';
|
|
62
|
-
/** What the turn is doing right now, when the server says (`./progress`). */
|
|
63
|
-
progress?: ChatProgress;
|
|
64
61
|
}
|
|
65
62
|
/** NATS tool execution progress (EXECUTING_TOOL / EXECUTED_TOOL). */
|
|
66
63
|
export interface ToolExecutionEvent extends ChatStreamEventBase {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/chat-protocol/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAGxF,OAAO,KAAK,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/chat-protocol/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAGxF,OAAO,KAAK,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE5F;sEACsE;AACtE,UAAU,mBAAmB;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;;;;iDAMiD;AACjD,MAAM,WAAW,cAAe,SAAQ,mBAAmB;IACzD,IAAI,EAAE,YAAY,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,YAAa,SAAQ,mBAAmB;IACvD,IAAI,EAAE,UAAU,CAAC;CAClB;AAED;oEACoE;AACpE,MAAM,WAAW,cAAe,SAAQ,mBAAmB;IACzD,IAAI,EAAE,YAAY,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;iEACiE;AACjE,MAAM,WAAW,kBAAmB,SAAQ,mBAAmB;IAC7D,IAAI,EAAE,gBAAgB,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;0BAM0B;AAC1B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AqBG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAanF;AAED;;YAEY;AACZ;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,QAAQ,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAE/D,8DAA8D;AAC9D,eAAO,MAAM,gBAAgB,UAAU,CAAC;AAExC,MAAM,WAAW,gBAAiB,SAAQ,mBAAmB;IAC3D,IAAI,EAAE,aAAa,CAAC;IACpB,IAAI,EAAE,iBAAiB,GAAG,gBAAgB,GAAG,QAAQ,CAAC;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACnE;AAED,MAAM,WAAW,iBAAkB,SAAQ,mBAAmB;IAC5D,IAAI,EAAE,eAAe,CAAC;CACvB;AAED,MAAM,MAAM,eAAe,GACvB,cAAc,GACd,YAAY,GACZ,cAAc,GACd,kBAAkB,GAClB,QAAQ,GACR,WAAW,GACX,kBAAkB,GAClB,oBAAoB,GACpB,qBAAqB,GACrB,oBAAoB,GACpB,4BAA4B,GAC5B,oBAAoB,GACpB,gBAAgB,GAChB,iBAAiB,GACjB,YAAY,GACZ,UAAU,GACV,eAAe,GACf,eAAe,GACf,UAAU,GACV,gBAAgB,GAChB,iBAAiB,CAAC"}
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
*
|
|
18
18
|
* Server-safe: no React, no browser APIs beyond TextEncoder/TextDecoder.
|
|
19
19
|
*/
|
|
20
|
-
import type { ChatProgressStage } from './progress';
|
|
21
20
|
/** Terminates every leading JSON frame. */
|
|
22
21
|
export declare const FRAME_TERMINATOR = "\0";
|
|
23
22
|
/** Record Separator — end of leading frames, start of raw answer text. */
|
|
@@ -65,11 +64,15 @@ export interface RoutedAnswerBreakdown {
|
|
|
65
64
|
* within ~200ms, before any upstream byte arrives. */
|
|
66
65
|
export interface StatusThinkingFrame {
|
|
67
66
|
status: 'thinking';
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
67
|
+
}
|
|
68
|
+
/** A step of the turn (`./progress`), in the chunk shape a NATS tool run has: the decoder reads it with
|
|
69
|
+
* `decodeNatsChunk` and the chat draws it as that run's row. */
|
|
70
|
+
export interface ToolExecutionFrame {
|
|
71
|
+
type: 'EXECUTING_TOOL' | 'EXECUTED_TOOL';
|
|
72
|
+
toolFunction: string;
|
|
73
|
+
title: string;
|
|
74
|
+
toolExecutionRequestId: string;
|
|
75
|
+
success?: boolean;
|
|
73
76
|
}
|
|
74
77
|
/** Per-turn metadata frame. The emitter sends `options.metadata`
|
|
75
78
|
* verbatim. All fields optional — the decoder's catch-all treats ANY
|
|
@@ -192,7 +195,7 @@ export interface DecisionResolvedFrame {
|
|
|
192
195
|
receiptText?: string;
|
|
193
196
|
}
|
|
194
197
|
/** Every leading frame the emitter can produce. */
|
|
195
|
-
export type SseLeadingFrame = StatusThinkingFrame | ChatMetadataFrame | RoutingFrame | ThinkingDeltaFrame | UsageStartFrame | TextLeadingFrame | ToolErrorFrame | ApprovalRequestFrame | ApprovalBatchFrame | DecisionResolvedFrame;
|
|
198
|
+
export type SseLeadingFrame = StatusThinkingFrame | ChatMetadataFrame | RoutingFrame | ThinkingDeltaFrame | UsageStartFrame | TextLeadingFrame | ToolErrorFrame | ApprovalRequestFrame | ApprovalBatchFrame | DecisionResolvedFrame | ToolExecutionFrame;
|
|
196
199
|
/** Card/chip emission counts for admin adoption tooling. */
|
|
197
200
|
export interface UsageTelemetry {
|
|
198
201
|
cards: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frames.d.ts","sourceRoot":"","sources":["../../src/chat-protocol/frames.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;
|
|
1
|
+
{"version":3,"file":"frames.d.ts","sourceRoot":"","sources":["../../src/chat-protocol/frames.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAMH,2CAA2C;AAC3C,eAAO,MAAM,gBAAgB,OAAO,CAAC;AACrC,0EAA0E;AAC1E,eAAO,MAAM,cAAc,WAAS,CAAC;AACrC,+DAA+D;AAC/D,eAAO,MAAM,gBAAgB,WAAS,CAAC;AAOvC;;;gEAGgE;AAChE,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;AAEzE;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,SAAS,CAAC;IAChB,gBAAgB,EAAE,eAAe,CAAC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAED;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,eAAe,CAAC;IAC5B,cAAc,EAAE,MAAM,CAAC;CACxB;AAMD;uDACuD;AACvD,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,UAAU,CAAC;CACpB;AAED;iEACiE;AACjE,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,gBAAgB,GAAG,eAAe,CAAC;IACzC,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,sBAAsB,EAAE,MAAM,CAAC;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;qEAEqE;AACrE,MAAM,WAAW,iBAAiB;IAChC;2EACuE;IACvE,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;IACpB;+DAC2D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AW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;8BAE8B;AAC9B,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B;mDAC+C;IAC/C,SAAS,CAAC,EAAE;QACV,aAAa,CAAC,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC;QAClD,eAAe,CAAC,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC;QACpD,eAAe,CAAC,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC;QACpD,YAAY,CAAC,EAAE,qBAAqB,CAAC;KACtC,CAAC;IACF;wCACoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC"}
|
|
@@ -42,14 +42,6 @@ var CHAT_OWNER_ADMIN = "ADMIN";
|
|
|
42
42
|
|
|
43
43
|
// src/chat-protocol/progress.ts
|
|
44
44
|
var CHAT_PROGRESS_STAGES = ["understanding", "searching", "searching_again", "reading"];
|
|
45
|
-
function isChatProgressStage(value) {
|
|
46
|
-
return typeof value === "string" && CHAT_PROGRESS_STAGES.includes(value);
|
|
47
|
-
}
|
|
48
|
-
function chatProgressOf(frame) {
|
|
49
|
-
if (!isChatProgressStage(frame.stage)) return null;
|
|
50
|
-
const count = typeof frame.count === "number" && Number.isFinite(frame.count) && frame.count > 0 ? Math.floor(frame.count) : void 0;
|
|
51
|
-
return count === void 0 ? { stage: frame.stage } : { stage: frame.stage, count };
|
|
52
|
-
}
|
|
53
45
|
var PROGRESS_LABEL = {
|
|
54
46
|
understanding: () => "Understanding your question",
|
|
55
47
|
searching: (count) => count ? `Searching ${count} ${count === 1 ? "source" : "sources"}` : "Searching",
|
|
@@ -59,6 +51,17 @@ var PROGRESS_LABEL = {
|
|
|
59
51
|
function chatProgressLabel(progress) {
|
|
60
52
|
return PROGRESS_LABEL[progress.stage](progress.count);
|
|
61
53
|
}
|
|
54
|
+
function chatProgressFrame(progress, state, turnId) {
|
|
55
|
+
const id = `${turnId}:${progress.stage}`;
|
|
56
|
+
const title = chatProgressLabel(progress);
|
|
57
|
+
return state === "running" ? { type: "EXECUTING_TOOL", toolFunction: progress.stage, title, toolExecutionRequestId: id } : {
|
|
58
|
+
type: "EXECUTED_TOOL",
|
|
59
|
+
toolFunction: progress.stage,
|
|
60
|
+
title,
|
|
61
|
+
toolExecutionRequestId: id,
|
|
62
|
+
success: state === "done"
|
|
63
|
+
};
|
|
64
|
+
}
|
|
62
65
|
|
|
63
66
|
// src/chat-protocol/encode.ts
|
|
64
67
|
var encoder = new TextEncoder();
|
|
@@ -79,230 +82,6 @@ function encodeTrailingUsageFrame(frame) {
|
|
|
79
82
|
return encoder.encode(TRAILER_SENTINEL + JSON.stringify(frame));
|
|
80
83
|
}
|
|
81
84
|
|
|
82
|
-
// src/chat-protocol/leading-frames.ts
|
|
83
|
-
function escapeThinkingTags(text2) {
|
|
84
|
-
return text2.replace(/</g, "<");
|
|
85
|
-
}
|
|
86
|
-
function frameStr(value) {
|
|
87
|
-
return typeof value === "string" ? value : void 0;
|
|
88
|
-
}
|
|
89
|
-
function frameNum(value) {
|
|
90
|
-
return typeof value === "number" ? value : void 0;
|
|
91
|
-
}
|
|
92
|
-
function mapLeadingFrame(meta, out) {
|
|
93
|
-
if (meta.status === "thinking") {
|
|
94
|
-
const progress = chatProgressOf(meta);
|
|
95
|
-
out.push(progress ? { type: "status", phase: "thinking", progress } : { type: "status", phase: "thinking" });
|
|
96
|
-
} else if (meta.kind === "thinking-delta" && typeof meta.text === "string") {
|
|
97
|
-
out.push({ type: "thinking-delta", text: meta.text });
|
|
98
|
-
} else if (meta.kind === "usage" && meta.stage === "start") {
|
|
99
|
-
out.push({
|
|
100
|
-
type: "usage",
|
|
101
|
-
stage: "start",
|
|
102
|
-
input_tokens: frameNum(meta.input_tokens),
|
|
103
|
-
cache_read_input_tokens: frameNum(meta.cache_read_input_tokens),
|
|
104
|
-
cache_creation_input_tokens: frameNum(meta.cache_creation_input_tokens)
|
|
105
|
-
});
|
|
106
|
-
} else if (meta.kind === "decision_resolved" && typeof meta.action === "string") {
|
|
107
|
-
const status = meta.action === "rejected" ? "rejected" : "approved";
|
|
108
|
-
const toolName = typeof meta.tool_name === "string" ? meta.tool_name : void 0;
|
|
109
|
-
const result = meta.result ?? null;
|
|
110
|
-
out.push({
|
|
111
|
-
type: "approval-resolved",
|
|
112
|
-
status,
|
|
113
|
-
ok: meta.ok === true,
|
|
114
|
-
willAutoContinue: meta.willAutoContinue === true,
|
|
115
|
-
...toolName ? { toolName } : {},
|
|
116
|
-
...result ? { result } : {},
|
|
117
|
-
...typeof meta.receiptText === "string" ? { receiptText: meta.receiptText } : {},
|
|
118
|
-
requestId: typeof meta.proposalId === "string" ? meta.proposalId : void 0
|
|
119
|
-
});
|
|
120
|
-
} else if (meta.kind === "approval_batch" && meta.batchId && Array.isArray(meta.proposals)) {
|
|
121
|
-
const toolCalls = meta.proposals.filter((p) => typeof p === "object" && p !== null).filter((p) => typeof p.proposalId === "string").map((p) => {
|
|
122
|
-
const rawFields = Array.isArray(p.fields) ? p.fields.filter((f) => f && f.label && f.value) : [];
|
|
123
|
-
const detail = rawFields.find((f) => /^(title|subject|name)$/i.test(String(f.label))) ?? rawFields[0];
|
|
124
|
-
const base = typeof p.title === "string" && p.title.length > 0 ? p.title : String(p.toolName ?? "Tool call");
|
|
125
|
-
return {
|
|
126
|
-
toolExecutionRequestId: String(p.proposalId),
|
|
127
|
-
toolName: String(p.toolName ?? "tool"),
|
|
128
|
-
toolTitle: detail ? `${base} \u2014 ${detail.value}` : base,
|
|
129
|
-
requiresApproval: true,
|
|
130
|
-
toolCallArguments: rawFields.length > 0 ? Object.fromEntries(rawFields.map((f) => [String(f.label), String(f.value)])) : null
|
|
131
|
-
};
|
|
132
|
-
});
|
|
133
|
-
if (toolCalls.length > 0) {
|
|
134
|
-
out.push({
|
|
135
|
-
type: "approval-request",
|
|
136
|
-
requestId: String(meta.batchId),
|
|
137
|
-
approvalType: "chat",
|
|
138
|
-
toolCalls,
|
|
139
|
-
status: "pending"
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
} else if (meta.kind === "approval_request" && meta.proposalId) {
|
|
143
|
-
const proposalId = String(meta.proposalId);
|
|
144
|
-
const toolName = String(meta.toolName ?? "tool");
|
|
145
|
-
const headline = typeof meta.title === "string" && meta.title.length > 0 ? meta.title : toolName;
|
|
146
|
-
const rawFields = Array.isArray(meta.fields) ? meta.fields : [];
|
|
147
|
-
const fields = [];
|
|
148
|
-
for (const f of rawFields) {
|
|
149
|
-
if (!f || !f.label || !f.value) continue;
|
|
150
|
-
fields.push({ label: f.label, value: f.value });
|
|
151
|
-
}
|
|
152
|
-
out.push({
|
|
153
|
-
type: "approval-request",
|
|
154
|
-
requestId: proposalId,
|
|
155
|
-
approvalType: toolName,
|
|
156
|
-
command: headline,
|
|
157
|
-
fields,
|
|
158
|
-
status: "pending"
|
|
159
|
-
});
|
|
160
|
-
} else if (meta.kind === "text-leading" && typeof meta.text === "string") {
|
|
161
|
-
out.push({ type: "text-delta", text: meta.text, leading: true });
|
|
162
|
-
} else if (meta.kind === "tool_error") {
|
|
163
|
-
const msg = typeof meta.message === "string" && meta.message.length > 0 ? meta.message : "Could not complete the requested action right now.";
|
|
164
|
-
out.push({ type: "error", title: msg });
|
|
165
|
-
} else if (meta.kind === "routing") {
|
|
166
|
-
if (typeof meta.routedComplexity === "string") {
|
|
167
|
-
out.push({
|
|
168
|
-
type: "metadata",
|
|
169
|
-
routing: {
|
|
170
|
-
routedComplexity: meta.routedComplexity,
|
|
171
|
-
...typeof meta.routedModel === "string" ? { routedModel: meta.routedModel } : {},
|
|
172
|
-
routedThinkingBudget: typeof meta.routedThinkingBudget === "number" ? meta.routedThinkingBudget : null
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
} else {
|
|
177
|
-
out.push({
|
|
178
|
-
type: "metadata",
|
|
179
|
-
sources: meta.sources,
|
|
180
|
-
provider: frameStr(meta.provider),
|
|
181
|
-
modelLabel: frameStr(meta.modelLabel),
|
|
182
|
-
modelName: frameStr(meta.model),
|
|
183
|
-
contextWindowMaxTokens: frameNum(meta.contextWindowMaxTokens),
|
|
184
|
-
scrollAnchor: meta.scrollAnchor,
|
|
185
|
-
conversationId: frameStr(meta.conversationId)
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
// src/chat-protocol/decode.ts
|
|
191
|
-
function isFrameObject(value) {
|
|
192
|
-
return typeof value === "object" && value !== null;
|
|
193
|
-
}
|
|
194
|
-
function frameTelemetry(value) {
|
|
195
|
-
if (!isFrameObject(value)) return void 0;
|
|
196
|
-
const { cards: cards2, chips, sentences, answerLen } = value;
|
|
197
|
-
if (typeof cards2 !== "number" || typeof chips !== "number" || typeof sentences !== "number" || typeof answerLen !== "number") {
|
|
198
|
-
return void 0;
|
|
199
|
-
}
|
|
200
|
-
return { cards: cards2, chips, sentences, answerLen };
|
|
201
|
-
}
|
|
202
|
-
function createSseFrameDecoder() {
|
|
203
|
-
const textDecoder = new TextDecoder();
|
|
204
|
-
let buffer = "";
|
|
205
|
-
let inText = false;
|
|
206
|
-
let inTrailer = false;
|
|
207
|
-
let trailerBuffer = "";
|
|
208
|
-
let ended = false;
|
|
209
|
-
function push(bytes) {
|
|
210
|
-
const out = [];
|
|
211
|
-
const chunk = textDecoder.decode(bytes, { stream: true });
|
|
212
|
-
if (!inText) {
|
|
213
|
-
buffer += chunk;
|
|
214
|
-
while (!inText) {
|
|
215
|
-
const recIdx = buffer.indexOf(END_OF_LEADING);
|
|
216
|
-
const nullIdx = buffer.indexOf(FRAME_TERMINATOR);
|
|
217
|
-
if (recIdx !== -1 && (nullIdx === -1 || recIdx < nullIdx)) {
|
|
218
|
-
inText = true;
|
|
219
|
-
out.push({ type: "turn-start" });
|
|
220
|
-
const after = buffer.slice(recIdx + 1);
|
|
221
|
-
buffer = "";
|
|
222
|
-
if (after) {
|
|
223
|
-
const unitIdx = after.indexOf(TRAILER_SENTINEL);
|
|
224
|
-
if (unitIdx === -1) {
|
|
225
|
-
out.push({ type: "text-delta", text: after });
|
|
226
|
-
} else {
|
|
227
|
-
const textBefore = after.slice(0, unitIdx);
|
|
228
|
-
const trailerAfter = after.slice(unitIdx + 1);
|
|
229
|
-
if (textBefore) {
|
|
230
|
-
out.push({ type: "text-delta", text: textBefore });
|
|
231
|
-
}
|
|
232
|
-
inTrailer = true;
|
|
233
|
-
trailerBuffer = trailerAfter;
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
break;
|
|
237
|
-
}
|
|
238
|
-
if (nullIdx === -1) break;
|
|
239
|
-
const metaStr = buffer.slice(0, nullIdx);
|
|
240
|
-
const remaining = buffer.slice(nullIdx + 1);
|
|
241
|
-
let meta;
|
|
242
|
-
try {
|
|
243
|
-
meta = JSON.parse(metaStr);
|
|
244
|
-
} catch {
|
|
245
|
-
inText = true;
|
|
246
|
-
out.push({ type: "turn-start", implicit: true });
|
|
247
|
-
if (buffer.length > 0) {
|
|
248
|
-
out.push({ type: "text-delta", text: buffer });
|
|
249
|
-
buffer = "";
|
|
250
|
-
}
|
|
251
|
-
break;
|
|
252
|
-
}
|
|
253
|
-
mapLeadingFrame(isFrameObject(meta) ? meta : {}, out);
|
|
254
|
-
buffer = remaining;
|
|
255
|
-
}
|
|
256
|
-
} else if (inTrailer) {
|
|
257
|
-
trailerBuffer += chunk;
|
|
258
|
-
} else {
|
|
259
|
-
const sepIdx = chunk.indexOf(TRAILER_SENTINEL);
|
|
260
|
-
if (sepIdx === -1) {
|
|
261
|
-
out.push({ type: "text-delta", text: chunk });
|
|
262
|
-
} else {
|
|
263
|
-
const before = chunk.slice(0, sepIdx);
|
|
264
|
-
const after = chunk.slice(sepIdx + 1);
|
|
265
|
-
if (before) out.push({ type: "text-delta", text: before });
|
|
266
|
-
inTrailer = true;
|
|
267
|
-
trailerBuffer = after;
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
return out;
|
|
271
|
-
}
|
|
272
|
-
function end() {
|
|
273
|
-
if (ended) return [];
|
|
274
|
-
ended = true;
|
|
275
|
-
const out = [];
|
|
276
|
-
if (trailerBuffer.length > 0) {
|
|
277
|
-
const raw = trailerBuffer;
|
|
278
|
-
trailerBuffer = "";
|
|
279
|
-
try {
|
|
280
|
-
const meta = JSON.parse(raw);
|
|
281
|
-
if (isFrameObject(meta) && meta.kind === "usage" && (meta.stage === "end" || meta.stage === "display")) {
|
|
282
|
-
out.push({
|
|
283
|
-
type: "usage",
|
|
284
|
-
stage: "end",
|
|
285
|
-
input_tokens: frameNum(meta.input_tokens),
|
|
286
|
-
output_tokens: frameNum(meta.output_tokens),
|
|
287
|
-
cache_read_input_tokens: frameNum(meta.cache_read_input_tokens),
|
|
288
|
-
cache_creation_input_tokens: frameNum(meta.cache_creation_input_tokens),
|
|
289
|
-
hit_rate_pct: frameNum(meta.hit_rate_pct),
|
|
290
|
-
telemetry: frameTelemetry(meta.telemetry),
|
|
291
|
-
// `breakdown` and `debug` are declared `unknown` on UsageEvent on
|
|
292
|
-
// purpose — `applySseUsage` re-validates every nested field — so
|
|
293
|
-
// they pass through raw, exactly as before.
|
|
294
|
-
breakdown: meta.breakdown,
|
|
295
|
-
debug: meta.debug
|
|
296
|
-
});
|
|
297
|
-
}
|
|
298
|
-
} catch {
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
return out;
|
|
302
|
-
}
|
|
303
|
-
return { push, end };
|
|
304
|
-
}
|
|
305
|
-
|
|
306
85
|
// src/components/chat/types/message.types.ts
|
|
307
86
|
var MESSAGE_TYPE = {
|
|
308
87
|
TEXT: "TEXT",
|
|
@@ -823,6 +602,232 @@ function decodeNatsChunk(chunk) {
|
|
|
823
602
|
}
|
|
824
603
|
}
|
|
825
604
|
|
|
605
|
+
// src/chat-protocol/leading-frames.ts
|
|
606
|
+
function escapeThinkingTags(text2) {
|
|
607
|
+
return text2.replace(/</g, "<");
|
|
608
|
+
}
|
|
609
|
+
function frameStr(value) {
|
|
610
|
+
return typeof value === "string" ? value : void 0;
|
|
611
|
+
}
|
|
612
|
+
function frameNum(value) {
|
|
613
|
+
return typeof value === "number" ? value : void 0;
|
|
614
|
+
}
|
|
615
|
+
function mapLeadingFrame(meta, out) {
|
|
616
|
+
if (meta.status === "thinking") {
|
|
617
|
+
out.push({ type: "status", phase: "thinking" });
|
|
618
|
+
} else if (meta.type === MESSAGE_TYPE.EXECUTING_TOOL || meta.type === MESSAGE_TYPE.EXECUTED_TOOL) {
|
|
619
|
+
const event = decodeNatsChunk(meta);
|
|
620
|
+
if (event) out.push(event);
|
|
621
|
+
} else if (meta.kind === "thinking-delta" && typeof meta.text === "string") {
|
|
622
|
+
out.push({ type: "thinking-delta", text: meta.text });
|
|
623
|
+
} else if (meta.kind === "usage" && meta.stage === "start") {
|
|
624
|
+
out.push({
|
|
625
|
+
type: "usage",
|
|
626
|
+
stage: "start",
|
|
627
|
+
input_tokens: frameNum(meta.input_tokens),
|
|
628
|
+
cache_read_input_tokens: frameNum(meta.cache_read_input_tokens),
|
|
629
|
+
cache_creation_input_tokens: frameNum(meta.cache_creation_input_tokens)
|
|
630
|
+
});
|
|
631
|
+
} else if (meta.kind === "decision_resolved" && typeof meta.action === "string") {
|
|
632
|
+
const status = meta.action === "rejected" ? "rejected" : "approved";
|
|
633
|
+
const toolName = typeof meta.tool_name === "string" ? meta.tool_name : void 0;
|
|
634
|
+
const result = meta.result ?? null;
|
|
635
|
+
out.push({
|
|
636
|
+
type: "approval-resolved",
|
|
637
|
+
status,
|
|
638
|
+
ok: meta.ok === true,
|
|
639
|
+
willAutoContinue: meta.willAutoContinue === true,
|
|
640
|
+
...toolName ? { toolName } : {},
|
|
641
|
+
...result ? { result } : {},
|
|
642
|
+
...typeof meta.receiptText === "string" ? { receiptText: meta.receiptText } : {},
|
|
643
|
+
requestId: typeof meta.proposalId === "string" ? meta.proposalId : void 0
|
|
644
|
+
});
|
|
645
|
+
} else if (meta.kind === "approval_batch" && meta.batchId && Array.isArray(meta.proposals)) {
|
|
646
|
+
const toolCalls = meta.proposals.filter((p) => typeof p === "object" && p !== null).filter((p) => typeof p.proposalId === "string").map((p) => {
|
|
647
|
+
const rawFields = Array.isArray(p.fields) ? p.fields.filter((f) => f && f.label && f.value) : [];
|
|
648
|
+
const detail = rawFields.find((f) => /^(title|subject|name)$/i.test(String(f.label))) ?? rawFields[0];
|
|
649
|
+
const base = typeof p.title === "string" && p.title.length > 0 ? p.title : String(p.toolName ?? "Tool call");
|
|
650
|
+
return {
|
|
651
|
+
toolExecutionRequestId: String(p.proposalId),
|
|
652
|
+
toolName: String(p.toolName ?? "tool"),
|
|
653
|
+
toolTitle: detail ? `${base} \u2014 ${detail.value}` : base,
|
|
654
|
+
requiresApproval: true,
|
|
655
|
+
toolCallArguments: rawFields.length > 0 ? Object.fromEntries(rawFields.map((f) => [String(f.label), String(f.value)])) : null
|
|
656
|
+
};
|
|
657
|
+
});
|
|
658
|
+
if (toolCalls.length > 0) {
|
|
659
|
+
out.push({
|
|
660
|
+
type: "approval-request",
|
|
661
|
+
requestId: String(meta.batchId),
|
|
662
|
+
approvalType: "chat",
|
|
663
|
+
toolCalls,
|
|
664
|
+
status: "pending"
|
|
665
|
+
});
|
|
666
|
+
}
|
|
667
|
+
} else if (meta.kind === "approval_request" && meta.proposalId) {
|
|
668
|
+
const proposalId = String(meta.proposalId);
|
|
669
|
+
const toolName = String(meta.toolName ?? "tool");
|
|
670
|
+
const headline = typeof meta.title === "string" && meta.title.length > 0 ? meta.title : toolName;
|
|
671
|
+
const rawFields = Array.isArray(meta.fields) ? meta.fields : [];
|
|
672
|
+
const fields = [];
|
|
673
|
+
for (const f of rawFields) {
|
|
674
|
+
if (!f || !f.label || !f.value) continue;
|
|
675
|
+
fields.push({ label: f.label, value: f.value });
|
|
676
|
+
}
|
|
677
|
+
out.push({
|
|
678
|
+
type: "approval-request",
|
|
679
|
+
requestId: proposalId,
|
|
680
|
+
approvalType: toolName,
|
|
681
|
+
command: headline,
|
|
682
|
+
fields,
|
|
683
|
+
status: "pending"
|
|
684
|
+
});
|
|
685
|
+
} else if (meta.kind === "text-leading" && typeof meta.text === "string") {
|
|
686
|
+
out.push({ type: "text-delta", text: meta.text, leading: true });
|
|
687
|
+
} else if (meta.kind === "tool_error") {
|
|
688
|
+
const msg = typeof meta.message === "string" && meta.message.length > 0 ? meta.message : "Could not complete the requested action right now.";
|
|
689
|
+
out.push({ type: "error", title: msg });
|
|
690
|
+
} else if (meta.kind === "routing") {
|
|
691
|
+
if (typeof meta.routedComplexity === "string") {
|
|
692
|
+
out.push({
|
|
693
|
+
type: "metadata",
|
|
694
|
+
routing: {
|
|
695
|
+
routedComplexity: meta.routedComplexity,
|
|
696
|
+
...typeof meta.routedModel === "string" ? { routedModel: meta.routedModel } : {},
|
|
697
|
+
routedThinkingBudget: typeof meta.routedThinkingBudget === "number" ? meta.routedThinkingBudget : null
|
|
698
|
+
}
|
|
699
|
+
});
|
|
700
|
+
}
|
|
701
|
+
} else {
|
|
702
|
+
out.push({
|
|
703
|
+
type: "metadata",
|
|
704
|
+
sources: meta.sources,
|
|
705
|
+
provider: frameStr(meta.provider),
|
|
706
|
+
modelLabel: frameStr(meta.modelLabel),
|
|
707
|
+
modelName: frameStr(meta.model),
|
|
708
|
+
contextWindowMaxTokens: frameNum(meta.contextWindowMaxTokens),
|
|
709
|
+
scrollAnchor: meta.scrollAnchor,
|
|
710
|
+
conversationId: frameStr(meta.conversationId)
|
|
711
|
+
});
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
// src/chat-protocol/decode.ts
|
|
716
|
+
function isFrameObject(value) {
|
|
717
|
+
return typeof value === "object" && value !== null;
|
|
718
|
+
}
|
|
719
|
+
function frameTelemetry(value) {
|
|
720
|
+
if (!isFrameObject(value)) return void 0;
|
|
721
|
+
const { cards: cards2, chips, sentences, answerLen } = value;
|
|
722
|
+
if (typeof cards2 !== "number" || typeof chips !== "number" || typeof sentences !== "number" || typeof answerLen !== "number") {
|
|
723
|
+
return void 0;
|
|
724
|
+
}
|
|
725
|
+
return { cards: cards2, chips, sentences, answerLen };
|
|
726
|
+
}
|
|
727
|
+
function createSseFrameDecoder() {
|
|
728
|
+
const textDecoder = new TextDecoder();
|
|
729
|
+
let buffer = "";
|
|
730
|
+
let inText = false;
|
|
731
|
+
let inTrailer = false;
|
|
732
|
+
let trailerBuffer = "";
|
|
733
|
+
let ended = false;
|
|
734
|
+
function push(bytes) {
|
|
735
|
+
const out = [];
|
|
736
|
+
const chunk = textDecoder.decode(bytes, { stream: true });
|
|
737
|
+
if (!inText) {
|
|
738
|
+
buffer += chunk;
|
|
739
|
+
while (!inText) {
|
|
740
|
+
const recIdx = buffer.indexOf(END_OF_LEADING);
|
|
741
|
+
const nullIdx = buffer.indexOf(FRAME_TERMINATOR);
|
|
742
|
+
if (recIdx !== -1 && (nullIdx === -1 || recIdx < nullIdx)) {
|
|
743
|
+
inText = true;
|
|
744
|
+
out.push({ type: "turn-start" });
|
|
745
|
+
const after = buffer.slice(recIdx + 1);
|
|
746
|
+
buffer = "";
|
|
747
|
+
if (after) {
|
|
748
|
+
const unitIdx = after.indexOf(TRAILER_SENTINEL);
|
|
749
|
+
if (unitIdx === -1) {
|
|
750
|
+
out.push({ type: "text-delta", text: after });
|
|
751
|
+
} else {
|
|
752
|
+
const textBefore = after.slice(0, unitIdx);
|
|
753
|
+
const trailerAfter = after.slice(unitIdx + 1);
|
|
754
|
+
if (textBefore) {
|
|
755
|
+
out.push({ type: "text-delta", text: textBefore });
|
|
756
|
+
}
|
|
757
|
+
inTrailer = true;
|
|
758
|
+
trailerBuffer = trailerAfter;
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
break;
|
|
762
|
+
}
|
|
763
|
+
if (nullIdx === -1) break;
|
|
764
|
+
const metaStr = buffer.slice(0, nullIdx);
|
|
765
|
+
const remaining = buffer.slice(nullIdx + 1);
|
|
766
|
+
let meta;
|
|
767
|
+
try {
|
|
768
|
+
meta = JSON.parse(metaStr);
|
|
769
|
+
} catch {
|
|
770
|
+
inText = true;
|
|
771
|
+
out.push({ type: "turn-start", implicit: true });
|
|
772
|
+
if (buffer.length > 0) {
|
|
773
|
+
out.push({ type: "text-delta", text: buffer });
|
|
774
|
+
buffer = "";
|
|
775
|
+
}
|
|
776
|
+
break;
|
|
777
|
+
}
|
|
778
|
+
mapLeadingFrame(isFrameObject(meta) ? meta : {}, out);
|
|
779
|
+
buffer = remaining;
|
|
780
|
+
}
|
|
781
|
+
} else if (inTrailer) {
|
|
782
|
+
trailerBuffer += chunk;
|
|
783
|
+
} else {
|
|
784
|
+
const sepIdx = chunk.indexOf(TRAILER_SENTINEL);
|
|
785
|
+
if (sepIdx === -1) {
|
|
786
|
+
out.push({ type: "text-delta", text: chunk });
|
|
787
|
+
} else {
|
|
788
|
+
const before = chunk.slice(0, sepIdx);
|
|
789
|
+
const after = chunk.slice(sepIdx + 1);
|
|
790
|
+
if (before) out.push({ type: "text-delta", text: before });
|
|
791
|
+
inTrailer = true;
|
|
792
|
+
trailerBuffer = after;
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
return out;
|
|
796
|
+
}
|
|
797
|
+
function end() {
|
|
798
|
+
if (ended) return [];
|
|
799
|
+
ended = true;
|
|
800
|
+
const out = [];
|
|
801
|
+
if (trailerBuffer.length > 0) {
|
|
802
|
+
const raw = trailerBuffer;
|
|
803
|
+
trailerBuffer = "";
|
|
804
|
+
try {
|
|
805
|
+
const meta = JSON.parse(raw);
|
|
806
|
+
if (isFrameObject(meta) && meta.kind === "usage" && (meta.stage === "end" || meta.stage === "display")) {
|
|
807
|
+
out.push({
|
|
808
|
+
type: "usage",
|
|
809
|
+
stage: "end",
|
|
810
|
+
input_tokens: frameNum(meta.input_tokens),
|
|
811
|
+
output_tokens: frameNum(meta.output_tokens),
|
|
812
|
+
cache_read_input_tokens: frameNum(meta.cache_read_input_tokens),
|
|
813
|
+
cache_creation_input_tokens: frameNum(meta.cache_creation_input_tokens),
|
|
814
|
+
hit_rate_pct: frameNum(meta.hit_rate_pct),
|
|
815
|
+
telemetry: frameTelemetry(meta.telemetry),
|
|
816
|
+
// `breakdown` and `debug` are declared `unknown` on UsageEvent on
|
|
817
|
+
// purpose — `applySseUsage` re-validates every nested field — so
|
|
818
|
+
// they pass through raw, exactly as before.
|
|
819
|
+
breakdown: meta.breakdown,
|
|
820
|
+
debug: meta.debug
|
|
821
|
+
});
|
|
822
|
+
}
|
|
823
|
+
} catch {
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
return out;
|
|
827
|
+
}
|
|
828
|
+
return { push, end };
|
|
829
|
+
}
|
|
830
|
+
|
|
826
831
|
// src/chat-protocol/confirm-tool.ts
|
|
827
832
|
function buildConfirmToolBody(request) {
|
|
828
833
|
return {
|
|
@@ -944,8 +949,8 @@ exports.FRAME_TERMINATOR = FRAME_TERMINATOR;
|
|
|
944
949
|
exports.IP_BUCKET_KEY_MAX_LENGTH = IP_BUCKET_KEY_MAX_LENGTH;
|
|
945
950
|
exports.TRAILER_SENTINEL = TRAILER_SENTINEL;
|
|
946
951
|
exports.buildConfirmToolBody = buildConfirmToolBody;
|
|
952
|
+
exports.chatProgressFrame = chatProgressFrame;
|
|
947
953
|
exports.chatProgressLabel = chatProgressLabel;
|
|
948
|
-
exports.chatProgressOf = chatProgressOf;
|
|
949
954
|
exports.citedSourceNumbers = citedSourceNumbers;
|
|
950
955
|
exports.createCardMarkerScanner = createCardMarkerScanner;
|
|
951
956
|
exports.createSseFrameDecoder = createSseFrameDecoder;
|
|
@@ -960,7 +965,6 @@ exports.escalationResolvedStatus = escalationResolvedStatus;
|
|
|
960
965
|
exports.escapeThinkingTags = escapeThinkingTags;
|
|
961
966
|
exports.extractCardReferences = extractCardReferences;
|
|
962
967
|
exports.formatCitationChips = formatCitationChips;
|
|
963
|
-
exports.isChatProgressStage = isChatProgressStage;
|
|
964
968
|
exports.isRecord = isRecord;
|
|
965
969
|
exports.normalizeAskOptions = normalizeAskOptions;
|
|
966
970
|
exports.normalizeIpForBucketKey = normalizeIpForBucketKey;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leading-frames.d.ts","sourceRoot":"","sources":["../../src/chat-protocol/leading-frames.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"leading-frames.d.ts","sourceRoot":"","sources":["../../src/chat-protocol/leading-frames.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAGhD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEvD;AASD;;;2DAG2D;AAC3D,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAE3D;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,eAAe,EAAE,GAAG,IAAI,CA0H3F"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MESSAGE_TYPE } from "../components/chat/types/message.types.js";
|
|
2
|
+
import { decodeNatsChunk } from "./nats-decoder.js";
|
|
2
3
|
function escapeThinkingTags(text) {
|
|
3
4
|
return text.replace(/</g, "<");
|
|
4
5
|
}
|
|
@@ -10,8 +11,10 @@ function frameNum(value) {
|
|
|
10
11
|
}
|
|
11
12
|
function mapLeadingFrame(meta, out) {
|
|
12
13
|
if (meta.status === "thinking") {
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
out.push({ type: "status", phase: "thinking" });
|
|
15
|
+
} else if (meta.type === MESSAGE_TYPE.EXECUTING_TOOL || meta.type === MESSAGE_TYPE.EXECUTED_TOOL) {
|
|
16
|
+
const event = decodeNatsChunk(meta);
|
|
17
|
+
if (event) out.push(event);
|
|
15
18
|
} else if (meta.kind === "thinking-delta" && typeof meta.text === "string") {
|
|
16
19
|
out.push({ type: "thinking-delta", text: meta.text });
|
|
17
20
|
} else if (meta.kind === "usage" && meta.stage === "start") {
|