@iota-uz/sdk 0.20.0 → 0.22.0
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-ui/PHOSPHOR-LICENSE +21 -0
- package/dist/chat-ui/animations/index.d.ts +4 -0
- package/dist/chat-ui/animations/variants.d.ts +322 -0
- package/dist/chat-ui/api/csrf.d.ts +20 -0
- package/dist/chat-ui/components/ActivityTrace.d.ts +12 -0
- package/dist/chat-ui/components/Alert.d.ts +13 -0
- package/dist/chat-ui/components/AllChatsList.d.ts +9 -0
- package/dist/chat-ui/components/ArchiveBanner.d.ts +9 -0
- package/dist/chat-ui/components/ArchivedChatList.d.ts +12 -0
- package/dist/chat-ui/components/AssistantMessage.d.ts +149 -0
- package/dist/chat-ui/components/AssistantTurnView.d.ts +25 -0
- package/dist/chat-ui/components/AttachmentGrid.d.ts +19 -0
- package/dist/chat-ui/components/AttachmentPreview.d.ts +14 -0
- package/dist/chat-ui/components/AttachmentUpload.d.ts +14 -0
- package/dist/chat-ui/components/AvatarStack.d.ts +21 -0
- package/dist/chat-ui/components/BiChatLayout.d.ts +19 -0
- package/dist/chat-ui/components/ChartCard.d.ts +17 -0
- package/dist/chat-ui/components/ChatHeader.d.ts +31 -0
- package/dist/chat-ui/components/ChatSession.d.ts +51 -0
- package/dist/chat-ui/components/CodeBlock.d.ts +26 -0
- package/dist/chat-ui/components/CodeOutputsPanel.d.ts +8 -0
- package/dist/chat-ui/components/CompactionDoodle.d.ts +7 -0
- package/dist/chat-ui/components/ConfirmModal.d.ts +23 -0
- package/dist/chat-ui/components/ConfirmationStep.d.ts +13 -0
- package/dist/chat-ui/components/DataTableCell.d.ts +11 -0
- package/dist/chat-ui/components/DataTableFooter.d.ts +9 -0
- package/dist/chat-ui/components/DataTableHeader.d.ts +15 -0
- package/dist/chat-ui/components/DataTableToolbar.d.ts +17 -0
- package/dist/chat-ui/components/DateGroupHeader.d.ts +11 -0
- package/dist/chat-ui/components/DateSeparator.d.ts +6 -0
- package/dist/chat-ui/components/DebugPanel.d.ts +7 -0
- package/dist/chat-ui/components/DownloadCard.d.ts +7 -0
- package/dist/chat-ui/components/EditableText.d.ts +30 -0
- package/dist/chat-ui/components/EmptyState.d.ts +19 -0
- package/dist/chat-ui/components/ErrorBoundary.d.ts +23 -0
- package/dist/chat-ui/components/FullscreenOverlay.d.ts +9 -0
- package/dist/chat-ui/components/ImageModal.d.ts +13 -0
- package/dist/chat-ui/components/InlineDialog.d.ts +16 -0
- package/dist/chat-ui/components/InlineQuestionForm.d.ts +7 -0
- package/dist/chat-ui/components/InteractiveTableCard.d.ts +18 -0
- package/dist/chat-ui/components/LoadingSpinner.d.ts +11 -0
- package/dist/chat-ui/components/MarkdownRenderer.d.ts +13 -0
- package/dist/chat-ui/components/Menu.d.ts +29 -0
- package/dist/chat-ui/components/MessageActions.d.ts +17 -0
- package/dist/chat-ui/components/MessageInput.d.ts +39 -0
- package/dist/chat-ui/components/MessageList.d.ts +12 -0
- package/dist/chat-ui/components/MessageQueueList.d.ts +9 -0
- package/dist/chat-ui/components/ModelSelector.d.ts +2 -0
- package/dist/chat-ui/components/PermissionGuard.d.ts +47 -0
- package/dist/chat-ui/components/QuestionForm.d.ts +10 -0
- package/dist/chat-ui/components/QuestionStep.d.ts +15 -0
- package/dist/chat-ui/components/RetryActionArea.d.ts +7 -0
- package/dist/chat-ui/components/ScreenReaderAnnouncer.d.ts +22 -0
- package/dist/chat-ui/components/ScrollToBottomButton.d.ts +12 -0
- package/dist/chat-ui/components/SearchInput.d.ts +27 -0
- package/dist/chat-ui/components/SessionArtifactList.d.ts +9 -0
- package/dist/chat-ui/components/SessionArtifactPreview.d.ts +7 -0
- package/dist/chat-ui/components/SessionArtifactPreviewModal.d.ts +13 -0
- package/dist/chat-ui/components/SessionArtifactsPanel.d.ts +13 -0
- package/dist/chat-ui/components/SessionItem.d.ts +18 -0
- package/dist/chat-ui/components/SessionMembersModal.d.ts +10 -0
- package/dist/chat-ui/components/SessionSkeleton.d.ts +6 -0
- package/dist/chat-ui/components/Sidebar.d.ts +22 -0
- package/dist/chat-ui/components/Skeleton.d.ts +63 -0
- package/dist/chat-ui/components/SkipLink.d.ts +2 -0
- package/dist/chat-ui/components/SourcesPanel.d.ts +7 -0
- package/dist/chat-ui/components/StreamError.d.ts +15 -0
- package/dist/chat-ui/components/StreamingCursor.d.ts +4 -0
- package/dist/chat-ui/components/SystemMessage.d.ts +10 -0
- package/dist/chat-ui/components/TabBar.d.ts +15 -0
- package/dist/chat-ui/components/TabbedChartGroup.d.ts +6 -0
- package/dist/chat-ui/components/TabbedTableGroup.d.ts +8 -0
- package/dist/chat-ui/components/TableExportButton.d.ts +13 -0
- package/dist/chat-ui/components/TableWithExport.d.ts +15 -0
- package/dist/chat-ui/components/Toast.d.ts +15 -0
- package/dist/chat-ui/components/ToastContainer.d.ts +10 -0
- package/dist/chat-ui/components/TouchContextMenu.d.ts +18 -0
- package/dist/chat-ui/components/Transition.d.ts +11 -0
- package/dist/chat-ui/components/TurnBubble.d.ts +51 -0
- package/dist/chat-ui/components/TypingIndicator.d.ts +13 -0
- package/dist/chat-ui/components/UserAvatar.d.ts +21 -0
- package/dist/chat-ui/components/UserFilter.d.ts +12 -0
- package/dist/chat-ui/components/UserMessage.d.ts +86 -0
- package/dist/chat-ui/components/UserTurnView.d.ts +25 -0
- package/dist/chat-ui/components/WelcomeContent.d.ts +17 -0
- package/dist/chat-ui/config/ConfigContext.d.ts +61 -0
- package/dist/chat-ui/context/ChatContext.d.ts +42 -0
- package/dist/chat-ui/context/IotaContext.d.ts +21 -0
- package/dist/chat-ui/context/chatHelpers.d.ts +18 -0
- package/dist/chat-ui/context/externalSnapshot.d.ts +4 -0
- package/dist/chat-ui/data/ArtifactManager.d.ts +23 -0
- package/dist/chat-ui/data/AttachmentUploader.d.ts +25 -0
- package/dist/chat-ui/data/HttpDataSource.d.ts +109 -0
- package/dist/chat-ui/data/ManagedHttpDataSource.d.ts +26 -0
- package/dist/chat-ui/data/MessageTransport.d.ts +88 -0
- package/dist/chat-ui/data/SessionManager.d.ts +52 -0
- package/dist/chat-ui/data/applet-rpc.d.ts +29 -0
- package/dist/chat-ui/data/mappers.d.ts +33 -0
- package/dist/chat-ui/data/openManagedEventSource.d.ts +54 -0
- package/dist/chat-ui/data/rpc.generated.d.ts +421 -0
- package/dist/chat-ui/hooks/createHorizontalSwipe.d.ts +27 -0
- package/dist/chat-ui/hooks/createReducedMotion.d.ts +1 -0
- package/dist/chat-ui/hooks/useActiveRuns.d.ts +47 -0
- package/dist/chat-ui/hooks/useAttachments.d.ts +80 -0
- package/dist/chat-ui/hooks/useAutoScroll.d.ts +51 -0
- package/dist/chat-ui/hooks/useBichatRouter.d.ts +40 -0
- package/dist/chat-ui/hooks/useBranding.d.ts +16 -0
- package/dist/chat-ui/hooks/useDataTable.d.ts +54 -0
- package/dist/chat-ui/hooks/useFocusTrap.d.ts +17 -0
- package/dist/chat-ui/hooks/useHttpDataSourceConfigFromApplet.d.ts +19 -0
- package/dist/chat-ui/hooks/useImageGallery.d.ts +67 -0
- package/dist/chat-ui/hooks/useKeyboardShortcuts.d.ts +23 -0
- package/dist/chat-ui/hooks/useLongPress.d.ts +22 -0
- package/dist/chat-ui/hooks/useMarkdownCopy.d.ts +46 -0
- package/dist/chat-ui/hooks/useMessageActions.d.ts +53 -0
- package/dist/chat-ui/hooks/useMessageListScroll.d.ts +22 -0
- package/dist/chat-ui/hooks/useModalLock.d.ts +1 -0
- package/dist/chat-ui/hooks/useScrollToBottom.d.ts +22 -0
- package/dist/chat-ui/hooks/useSidebarState.d.ts +8 -0
- package/dist/chat-ui/hooks/useToast.d.ts +43 -0
- package/dist/chat-ui/hooks/useTranslation.d.ts +4 -0
- package/dist/chat-ui/icons/index.d.ts +93 -0
- package/dist/chat-ui/icons.js +975 -0
- package/dist/chat-ui/index.d.ts +122 -0
- package/dist/chat-ui/index.js +51821 -0
- package/dist/chat-ui/machine/ChatMachine.d.ts +191 -0
- package/dist/chat-ui/machine/hitlLifecycle.d.ts +7 -0
- package/dist/chat-ui/machine/index.d.ts +2 -0
- package/dist/chat-ui/machine/selectors.d.ts +5 -0
- package/dist/chat-ui/machine/types.d.ts +127 -0
- package/dist/chat-ui/styles.css +1 -0
- package/dist/chat-ui/theme/themes.d.ts +6 -0
- package/dist/chat-ui/theme/types.d.ts +38 -0
- package/dist/chat-ui/types/applet/index.d.ts +82 -0
- package/dist/chat-ui/types/data-source.d.ts +81 -0
- package/dist/chat-ui/types/index.d.ts +719 -0
- package/dist/chat-ui/types/iota.d.ts +76 -0
- package/dist/chat-ui/utils/RateLimiter.d.ts +28 -0
- package/dist/chat-ui/utils/activitySteps.d.ts +15 -0
- package/dist/chat-ui/utils/artifactHelpers.d.ts +7 -0
- package/dist/chat-ui/utils/assistantTurnState.d.ts +4 -0
- package/dist/chat-ui/utils/chartSpec.d.ts +15 -0
- package/dist/chat-ui/utils/citationProcessor.d.ts +38 -0
- package/dist/chat-ui/utils/columnTypes.d.ts +9 -0
- package/dist/chat-ui/utils/cssLength.d.ts +1 -0
- package/dist/chat-ui/utils/dateFormatting.d.ts +13 -0
- package/dist/chat-ui/utils/debugMetrics.d.ts +5 -0
- package/dist/chat-ui/utils/debugModeStorage.d.ts +2 -0
- package/dist/chat-ui/utils/debugTrace.d.ts +4 -0
- package/dist/chat-ui/utils/errorDisplay.d.ts +23 -0
- package/dist/chat-ui/utils/eventNames.d.ts +27 -0
- package/dist/chat-ui/utils/fileUtils.d.ts +48 -0
- package/dist/chat-ui/utils/markdownMath.d.ts +9 -0
- package/dist/chat-ui/utils/markdownStream.d.ts +8 -0
- package/dist/chat-ui/utils/questionFormUtils.d.ts +18 -0
- package/dist/chat-ui/utils/queueStorage.d.ts +4 -0
- package/dist/chat-ui/utils/reasoningEffortStorage.d.ts +3 -0
- package/dist/chat-ui/utils/sessionGrouping.d.ts +7 -0
- package/dist/chat-ui/utils/sseParser.d.ts +34 -0
- package/dist/chat-ui/utils/tableSpec.d.ts +6 -0
- package/dist/chat-ui/utils/textBlocks.d.ts +43 -0
- package/dist/chat-ui/utils/toolLabels.d.ts +17 -0
- package/dist/client-host/{applet.d.ts → bichat-config.d.ts} +2 -16
- package/dist/client-host/bichat-config.d.ts.map +1 -0
- package/dist/client-host/{applet.js → bichat-config.js} +0 -8
- package/dist/client-host/identity.d.ts +4 -4
- package/dist/client-host/identity.js +2 -2
- package/dist/client-host/index.d.ts +7 -4
- package/dist/client-host/index.d.ts.map +1 -1
- package/dist/client-host/index.js +7 -4
- package/dist/client-host/solid-index.d.ts +1 -0
- package/dist/client-host/solid-index.d.ts.map +1 -1
- package/dist/client-host/solid-index.js +1 -0
- package/dist/client-host/solid-streaming.d.ts.map +1 -1
- package/dist/lens/CascadePanel-BXaSLD9I.js +700 -0
- package/dist/lens/ChartDataEquivalent-Uo4RCCqz.js +92 -0
- package/dist/lens/ChartPanel-BYIblvtO.js +981 -0
- package/dist/lens/CoveragePanel-CBxW7l_N.js +195 -0
- package/dist/lens/DashboardPanels.d.ts +4 -1
- package/dist/lens/DashboardPanels.d.ts.map +1 -1
- package/dist/lens/GaugePanel-Gm3y4QBi.js +39 -0
- package/dist/lens/LensDashboard.d.ts +7 -2
- package/dist/lens/LensDashboard.d.ts.map +1 -1
- package/dist/lens/MapPanel-Fr67rBRo.js +256 -0
- package/dist/lens/MetricFlowPanel-DFGBh3hI.js +135 -0
- package/dist/lens/MetricHierarchyPanel-DKiQ8e3m.js +121 -0
- package/dist/lens/MetricRelationshipPanel-YC3Cg9Id.js +120 -0
- package/dist/lens/PrintReport-BPI_jNyw.js +1876 -0
- package/dist/lens/TablePanel-Bh8dWK4d.js +946 -0
- package/dist/lens/{adapter-BwEwcw2W.js → adapter-DIzUDxuh.js} +384 -384
- package/dist/lens/contract/schemas.d.ts.map +1 -1
- package/dist/lens/contract/types.d.ts +1 -1
- package/dist/lens/contract/types.d.ts.map +1 -1
- package/dist/lens/controls/Calendar.d.ts +1 -1
- package/dist/lens/controls/Calendar.d.ts.map +1 -1
- package/dist/lens/controls/CompareFilterControl.d.ts +2 -2
- package/dist/lens/controls/CompareFilterControl.d.ts.map +1 -1
- package/dist/lens/controls/FacetFilterMenu.d.ts +2 -2
- package/dist/lens/controls/FacetFilterMenu.d.ts.map +1 -1
- package/dist/lens/controls/FilterBar.d.ts +3 -3
- package/dist/lens/controls/FilterBar.d.ts.map +1 -1
- package/dist/lens/controls/PeriodFilterControl.d.ts +2 -1
- package/dist/lens/controls/PeriodFilterControl.d.ts.map +1 -1
- package/dist/lens/controls/SegmentedFilterControl.d.ts +2 -2
- package/dist/lens/controls/SegmentedFilterControl.d.ts.map +1 -1
- package/dist/lens/controls/facetOptions.d.ts +5 -5
- package/dist/lens/controls/facetOptions.d.ts.map +1 -1
- package/dist/lens/element.d.ts +1 -1
- package/dist/lens/element.d.ts.map +1 -1
- package/dist/lens/explore/ContextMiniChart.d.ts +2 -1
- package/dist/lens/explore/ContextMiniChart.d.ts.map +1 -1
- package/dist/lens/explore/DrillOverlay.d.ts +2 -1
- package/dist/lens/explore/DrillOverlay.d.ts.map +1 -1
- package/dist/lens/explore/ExplorePanel.d.ts +2 -1
- package/dist/lens/explore/ExplorePanel.d.ts.map +1 -1
- package/dist/lens/explore/FocusContextHeader.d.ts +2 -1
- package/dist/lens/explore/FocusContextHeader.d.ts.map +1 -1
- package/dist/lens/explore/LensSelector.d.ts +2 -1
- package/dist/lens/explore/LensSelector.d.ts.map +1 -1
- package/dist/lens/explore/SourceDataDisclosure.d.ts +3 -3
- package/dist/lens/explore/SourceDataDisclosure.d.ts.map +1 -1
- package/dist/lens/icons.d.ts +36 -35
- package/dist/lens/icons.d.ts.map +1 -1
- package/dist/lens/{index-B6anZ5Pr.js → index-2qUA4koZ.js} +1 -1
- package/dist/lens/index-DW4iQi93.js +13171 -0
- package/dist/lens/index.d.ts +3 -1
- package/dist/lens/index.d.ts.map +1 -1
- package/dist/lens/index.js +14 -9
- package/dist/lens/{install-D5OiGDnd.js → install-C-b2Bm4Y.js} +1 -1
- package/dist/lens/{install-CsNOaFxV.js → install-C7rGzRvO.js} +1 -1
- package/dist/lens/{install-CumkiUJn.js → install-Ce8R_Bl2.js} +1 -1
- package/dist/lens/{install-VEXJv-Wi.js → install-Czhlaw4u.js} +1 -1
- package/dist/lens/keys-BC7G1vyT.js +91 -0
- package/dist/lens/metricViews-DSoDe0GU.js +210 -0
- package/dist/lens/panels/CascadePanel.d.ts +1 -1
- package/dist/lens/panels/CascadePanel.d.ts.map +1 -1
- package/dist/lens/panels/ChartDataEquivalent.d.ts +1 -1
- package/dist/lens/panels/ChartDataEquivalent.d.ts.map +1 -1
- package/dist/lens/panels/ChartHost.d.ts +1 -1
- package/dist/lens/panels/ChartHost.d.ts.map +1 -1
- package/dist/lens/panels/ChartPanel.d.ts +2 -1
- package/dist/lens/panels/ChartPanel.d.ts.map +1 -1
- package/dist/lens/panels/CopyValueButton.d.ts +1 -1
- package/dist/lens/panels/CopyValueButton.d.ts.map +1 -1
- package/dist/lens/panels/CoveragePanel.d.ts +1 -1
- package/dist/lens/panels/CoveragePanel.d.ts.map +1 -1
- package/dist/lens/panels/ExportMenu.d.ts +1 -1
- package/dist/lens/panels/ExportMenu.d.ts.map +1 -1
- package/dist/lens/panels/GaugePanel.d.ts +1 -1
- package/dist/lens/panels/GaugePanel.d.ts.map +1 -1
- package/dist/lens/panels/InfoTip.d.ts +2 -1
- package/dist/lens/panels/InfoTip.d.ts.map +1 -1
- package/dist/lens/panels/MapPanel.d.ts +1 -1
- package/dist/lens/panels/MapPanel.d.ts.map +1 -1
- package/dist/lens/panels/MetricFlowPanel.d.ts +1 -1
- package/dist/lens/panels/MetricFlowPanel.d.ts.map +1 -1
- package/dist/lens/panels/MetricHierarchyPanel.d.ts +2 -1
- package/dist/lens/panels/MetricHierarchyPanel.d.ts.map +1 -1
- package/dist/lens/panels/MetricRelationshipPanel.d.ts +1 -1
- package/dist/lens/panels/MetricRelationshipPanel.d.ts.map +1 -1
- package/dist/lens/panels/PanelExportMenu.d.ts +2 -2
- package/dist/lens/panels/PanelExportMenu.d.ts.map +1 -1
- package/dist/lens/panels/PanelFrame.d.ts +6 -6
- package/dist/lens/panels/PanelFrame.d.ts.map +1 -1
- package/dist/lens/panels/PanelOverlay.d.ts +4 -4
- package/dist/lens/panels/PanelOverlay.d.ts.map +1 -1
- package/dist/lens/panels/QualityChip.d.ts +8 -4
- package/dist/lens/panels/QualityChip.d.ts.map +1 -1
- package/dist/lens/panels/ShareSliceButton.d.ts +1 -1
- package/dist/lens/panels/ShareSliceButton.d.ts.map +1 -1
- package/dist/lens/panels/Skeleton.d.ts +13 -13
- package/dist/lens/panels/Skeleton.d.ts.map +1 -1
- package/dist/lens/panels/StatPanel.d.ts +11 -11
- package/dist/lens/panels/StatPanel.d.ts.map +1 -1
- package/dist/lens/panels/StatValueTicker.d.ts +2 -2
- package/dist/lens/panels/StatValueTicker.d.ts.map +1 -1
- package/dist/lens/panels/TablePanel.d.ts +2 -1
- package/dist/lens/panels/TablePanel.d.ts.map +1 -1
- package/dist/lens/panels/WaterfallPlot.d.ts +3 -3
- package/dist/lens/panels/WaterfallPlot.d.ts.map +1 -1
- package/dist/lens/panels/actions.d.ts +16 -13
- package/dist/lens/panels/actions.d.ts.map +1 -1
- package/dist/lens/panels/context.d.ts +5 -5
- package/dist/lens/panels/context.d.ts.map +1 -1
- package/dist/lens/panels/focusTrap.d.ts +4 -0
- package/dist/lens/panels/focusTrap.d.ts.map +1 -0
- package/dist/lens/panels/overlayContainer.d.ts +18 -0
- package/dist/lens/panels/overlayContainer.d.ts.map +1 -0
- package/dist/lens/panels/registry.d.ts +23 -23
- package/dist/lens/panels/registry.d.ts.map +1 -1
- package/dist/lens/panels/useIsClamped.d.ts +2 -2
- package/dist/lens/panels/useIsClamped.d.ts.map +1 -1
- package/dist/lens/panels/useMenuButton.d.ts +21 -14
- package/dist/lens/panels/useMenuButton.d.ts.map +1 -1
- package/dist/lens/{prefetch-C_qYKOTU.js → prefetch-Caqfl7sC.js} +2 -2
- package/dist/lens/{prefetchPanels-CD4C-A5q.js → prefetchPanels-B-09akeK.js} +1 -1
- package/dist/lens/print/PrintReport.d.ts +4 -3
- package/dist/lens/print/PrintReport.d.ts.map +1 -1
- package/dist/lens/print/formula.d.ts +3 -2
- package/dist/lens/print/formula.d.ts.map +1 -1
- package/dist/lens/print/quality.d.ts +3 -2
- package/dist/lens/print/quality.d.ts.map +1 -1
- package/dist/lens/{print-Iu804kRb.js → print-CcDZyjFC.js} +1 -1
- package/dist/lens/reports/contract/schemas.d.ts +17 -0
- package/dist/lens/reports/contract/schemas.d.ts.map +1 -0
- package/dist/lens/reports/contract/types.d.ts +42 -0
- package/dist/lens/reports/contract/types.d.ts.map +1 -0
- package/dist/lens/reports/draft.d.ts +28 -0
- package/dist/lens/reports/draft.d.ts.map +1 -0
- package/dist/lens/runtime/drawer.d.ts +3 -3
- package/dist/lens/runtime/drawer.d.ts.map +1 -1
- package/dist/lens/runtime/overlayContainer.d.ts +2 -2
- package/dist/lens/runtime/overlayContainer.d.ts.map +1 -1
- package/dist/lens/runtime/provider.d.ts +23 -23
- package/dist/lens/runtime/provider.d.ts.map +1 -1
- package/dist/lens/{scales-CWTA0tSQ.js → scales-DOCY7Afr.js} +1 -1
- package/dist/lens/style.css +1 -1
- package/dist/sdk-identity.cjs +3 -3
- package/dist/sdk-identity.js +3 -3
- package/dist/sdk-identity.json +2 -2
- package/package.json +11 -10
- package/dist/client-host/applet.d.ts.map +0 -1
- package/dist/client-host/portals.d.ts +0 -30
- package/dist/client-host/portals.d.ts.map +0 -1
- package/dist/client-host/portals.js +0 -84
- package/dist/client-host/route.d.ts +0 -17
- package/dist/client-host/route.d.ts.map +0 -1
- package/dist/client-host/route.js +0 -19
- package/dist/client-host/rpc.d.ts +0 -15
- package/dist/client-host/rpc.d.ts.map +0 -1
- package/dist/client-host/rpc.js +0 -28
- package/dist/lens/CascadePanel-Sd2OKQx-.js +0 -574
- package/dist/lens/ChartDataEquivalent-DgCAb4Ov.js +0 -53
- package/dist/lens/ChartPanel-CiAahY9O.js +0 -709
- package/dist/lens/CoveragePanel-DeeKg8gF.js +0 -131
- package/dist/lens/GaugePanel-8rsf_XHS.js +0 -43
- package/dist/lens/MapPanel-Bq0mfVCB.js +0 -179
- package/dist/lens/MetricFlowPanel-ZBJqPFpc.js +0 -70
- package/dist/lens/MetricHierarchyPanel-DStGwvVU.js +0 -72
- package/dist/lens/MetricRelationshipPanel-D6ItmGCS.js +0 -54
- package/dist/lens/PrintReport-Dr-6xXVr.js +0 -1367
- package/dist/lens/TablePanel-CzLP8gG0.js +0 -619
- package/dist/lens/index-R9mnOHaj.js +0 -11000
- package/dist/lens/keys-6_gqLhcv.js +0 -78
- package/dist/lens/metricViews-De-9pff-.js +0 -170
- package/dist/lens/runtime/focusTrap.d.ts +0 -4
- package/dist/lens/runtime/focusTrap.d.ts.map +0 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
import { type IconComponent } from '../icons';
|
|
3
|
+
interface WelcomeContentProps {
|
|
4
|
+
onPromptSelect?: (prompt: string) => void;
|
|
5
|
+
title?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
/** Custom prompts to replace the default i18n prompts. Icons cycle from defaults if not provided. */
|
|
9
|
+
prompts?: Array<{
|
|
10
|
+
category: string;
|
|
11
|
+
text: string;
|
|
12
|
+
icon?: IconComponent;
|
|
13
|
+
}>;
|
|
14
|
+
}
|
|
15
|
+
declare function WelcomeContent(solidProps1Input: WelcomeContentProps): JSX.Element;
|
|
16
|
+
export { WelcomeContent };
|
|
17
|
+
export default WelcomeContent;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
/**
|
|
3
|
+
* Configuration context provider for BiChat.
|
|
4
|
+
*
|
|
5
|
+
* @deprecated Use `IotaContextProvider` with its new optional `context` prop
|
|
6
|
+
* instead. `ConfigProvider` and `BiChatConfig` are kept for backwards
|
|
7
|
+
* compatibility but will be removed in a future major version.
|
|
8
|
+
*/
|
|
9
|
+
/** @deprecated Use `IotaContextProvider` with its `context` prop instead. */
|
|
10
|
+
export interface BiChatConfig {
|
|
11
|
+
user: {
|
|
12
|
+
id: string;
|
|
13
|
+
email: string;
|
|
14
|
+
firstName: string;
|
|
15
|
+
lastName: string;
|
|
16
|
+
permissions: string[];
|
|
17
|
+
};
|
|
18
|
+
tenant: {
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
};
|
|
22
|
+
locale: {
|
|
23
|
+
language: string;
|
|
24
|
+
translations: Record<string, string>;
|
|
25
|
+
};
|
|
26
|
+
endpoints: {
|
|
27
|
+
rpc: string;
|
|
28
|
+
stream: string;
|
|
29
|
+
};
|
|
30
|
+
csrfToken?: string;
|
|
31
|
+
}
|
|
32
|
+
interface ConfigProviderProps {
|
|
33
|
+
config?: BiChatConfig;
|
|
34
|
+
useGlobalConfig?: boolean;
|
|
35
|
+
children: JSX.Element;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* @deprecated Use `IotaContextProvider` with its `context` prop instead.
|
|
39
|
+
*
|
|
40
|
+
* ConfigProvider component — provides configuration to the BiChat library.
|
|
41
|
+
*
|
|
42
|
+
* @param config - Configuration object (preferred method)
|
|
43
|
+
* @param useGlobalConfig - If true, falls back to window.__APPLET_CONTEXT__ when config is not provided
|
|
44
|
+
* @param children - React children
|
|
45
|
+
*/
|
|
46
|
+
export declare function ConfigProvider(solidProps1Input: ConfigProviderProps): JSX.Element;
|
|
47
|
+
/**
|
|
48
|
+
* Hook to access BiChat configuration
|
|
49
|
+
* Returns null if no configuration is available
|
|
50
|
+
*/
|
|
51
|
+
export declare function useConfig(): BiChatConfig | null;
|
|
52
|
+
/**
|
|
53
|
+
* Hook to access BiChat configuration (required)
|
|
54
|
+
* Throws an error if configuration is not available
|
|
55
|
+
*/
|
|
56
|
+
export declare function useRequiredConfig(): BiChatConfig;
|
|
57
|
+
/**
|
|
58
|
+
* Check if user has a specific permission
|
|
59
|
+
*/
|
|
60
|
+
export declare function hasPermission(config: BiChatConfig | null, permission: string): boolean;
|
|
61
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
/**
|
|
3
|
+
* Chat session context provider and hooks.
|
|
4
|
+
*
|
|
5
|
+
* Thin React wrapper around ChatMachine. All async logic (session fetch,
|
|
6
|
+
* streaming, HITL, slash commands, queue, rate limiting) lives in the
|
|
7
|
+
* framework-agnostic ChatMachine class.
|
|
8
|
+
*
|
|
9
|
+
* Split into 3 focused contexts to minimize re-renders:
|
|
10
|
+
* - ChatSessionContext: session lifecycle (session, fetching, error, debug)
|
|
11
|
+
* - ChatMessagingContext: turns + streaming + tool interactions
|
|
12
|
+
* - ChatInputContext: input form state (message, inputError, queue)
|
|
13
|
+
*/
|
|
14
|
+
import type { ChatDataSource, ChatSessionStateValue, ChatMessagingStateValue, ChatInputStateValue } from '../types';
|
|
15
|
+
import { RateLimiter, type RateLimiterConfig } from '../utils/RateLimiter';
|
|
16
|
+
export interface ChatSessionProviderProps {
|
|
17
|
+
dataSource: ChatDataSource;
|
|
18
|
+
sessionId?: string;
|
|
19
|
+
/**
|
|
20
|
+
* External rate limiter instance. Captured once at mount — changing this prop
|
|
21
|
+
* after initial render has no effect. For most cases, use `rateLimitConfig`
|
|
22
|
+
* instead and let the provider create the limiter internally.
|
|
23
|
+
*/
|
|
24
|
+
rateLimiter?: RateLimiter;
|
|
25
|
+
/**
|
|
26
|
+
* Configuration for the built-in rate limiter (ignored when `rateLimiter` is
|
|
27
|
+
* provided). Captured once at mount — changing after initial render has no effect.
|
|
28
|
+
*/
|
|
29
|
+
rateLimitConfig?: RateLimiterConfig;
|
|
30
|
+
/**
|
|
31
|
+
* Called when the machine creates a new session (e.g. on first message in a
|
|
32
|
+
* "new chat"). Use this to navigate your SPA router to the new session URL.
|
|
33
|
+
*/
|
|
34
|
+
onSessionCreated?: (sessionId: string) => void;
|
|
35
|
+
children: JSX.Element;
|
|
36
|
+
}
|
|
37
|
+
export declare function ChatSessionProvider(solidProps1: ChatSessionProviderProps): JSX.Element;
|
|
38
|
+
export declare function useChatSession(): ChatSessionStateValue;
|
|
39
|
+
export declare function useChatMessaging(): ChatMessagingStateValue;
|
|
40
|
+
/** Returns messaging context or null when outside ChatSessionProvider. */
|
|
41
|
+
export declare function useOptionalChatMessaging(): ChatMessagingStateValue | null;
|
|
42
|
+
export declare function useChatInput(): ChatInputStateValue;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
/**
|
|
3
|
+
* IOTA SDK integration context provider
|
|
4
|
+
* Consumes server-side context from window.__APPLET_CONTEXT__ or accepts it as a prop.
|
|
5
|
+
*/
|
|
6
|
+
import type { IotaContext as IotaContextType } from '../types/iota';
|
|
7
|
+
interface IotaContextProviderProps {
|
|
8
|
+
/**
|
|
9
|
+
* Explicit context object. When provided, the window global is not read.
|
|
10
|
+
* Useful for tests, Storybook, or apps that manage their own context.
|
|
11
|
+
*/
|
|
12
|
+
context?: IotaContextType;
|
|
13
|
+
children: JSX.Element;
|
|
14
|
+
}
|
|
15
|
+
export declare function IotaContextProvider(solidProps1: IotaContextProviderProps): JSX.Element;
|
|
16
|
+
export declare function useIotaContext(): IotaContextType;
|
|
17
|
+
/**
|
|
18
|
+
* Check if user has a specific permission
|
|
19
|
+
*/
|
|
20
|
+
export declare function hasPermission(permission: string): boolean;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure helper functions for the ChatContext provider.
|
|
3
|
+
* Extracted to keep the main provider file focused on state and handlers.
|
|
4
|
+
*/
|
|
5
|
+
import { type ConversationTurn, type Attachment, type DebugLimits } from '../types';
|
|
6
|
+
/** Tool names that produce persisted artifacts; must match server ArtifactHandler. */
|
|
7
|
+
export declare const ARTIFACT_TOOL_NAMES: Set<string>;
|
|
8
|
+
export declare function generateTempId(prefix: string): string;
|
|
9
|
+
export declare function createPendingTurn(sessionId: string, content: string, attachments?: Attachment[]): ConversationTurn;
|
|
10
|
+
export declare function createCompactedSystemTurn(sessionId: string, summary: string): ConversationTurn;
|
|
11
|
+
export type SlashCommandName = '/clear' | '/debug' | '/compact';
|
|
12
|
+
export interface ParsedSlashCommand {
|
|
13
|
+
name: SlashCommandName;
|
|
14
|
+
hasArgs: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare function parseSlashCommand(input: string): ParsedSlashCommand | null;
|
|
17
|
+
export declare function readDebugLimitsFromGlobalContext(): DebugLimits | null;
|
|
18
|
+
export declare function readReasoningEffortOptionsFromGlobalContext(): string[] | undefined;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type Accessor } from 'solid-js';
|
|
2
|
+
export declare function createExternalSnapshot<T>(subscribe: (listener: () => void) => () => void, snapshot: () => T): Accessor<T>;
|
|
3
|
+
export declare function createReactiveSnapshot<T extends object>(subscribe: (listener: () => void) => () => void, snapshot: () => T): T;
|
|
4
|
+
export declare function createReactiveValue<T extends object>(value: Accessor<T>): T;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session artifact CRUD: fetch, upload, rename, delete artifacts.
|
|
3
|
+
*
|
|
4
|
+
* @internal — Not part of the public API. Consumed by HttpDataSource.
|
|
5
|
+
*/
|
|
6
|
+
import type { BichatRPC } from './rpc.generated';
|
|
7
|
+
import type { SessionArtifact } from '../types';
|
|
8
|
+
import type { CoreUploadResponse } from './AttachmentUploader';
|
|
9
|
+
type RPCCaller = <TMethod extends keyof BichatRPC & string>(method: TMethod, params: BichatRPC[TMethod]['params']) => Promise<BichatRPC[TMethod]['result']>;
|
|
10
|
+
export declare function fetchSessionArtifacts(callRPC: RPCCaller, sessionId: string, options?: {
|
|
11
|
+
limit?: number;
|
|
12
|
+
offset?: number;
|
|
13
|
+
}): Promise<{
|
|
14
|
+
artifacts: SessionArtifact[];
|
|
15
|
+
hasMore?: boolean;
|
|
16
|
+
nextOffset?: number;
|
|
17
|
+
}>;
|
|
18
|
+
export declare function uploadSessionArtifacts(callRPC: RPCCaller, sessionId: string, files: File[], uploadFileFn: (file: File) => Promise<CoreUploadResponse>): Promise<{
|
|
19
|
+
artifacts: SessionArtifact[];
|
|
20
|
+
}>;
|
|
21
|
+
export declare function renameSessionArtifact(callRPC: RPCCaller, artifactId: string, name: string, description?: string): Promise<SessionArtifact>;
|
|
22
|
+
export declare function deleteSessionArtifact(callRPC: RPCCaller, artifactId: string): Promise<void>;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Attachment file processing and upload logic.
|
|
3
|
+
*
|
|
4
|
+
* Handles MIME detection from file signatures, filename normalization,
|
|
5
|
+
* base64/URL decoding, and upload to the core upload endpoint.
|
|
6
|
+
*
|
|
7
|
+
* @internal — Not part of the public API. Consumed by HttpDataSource.
|
|
8
|
+
*/
|
|
9
|
+
import type { Attachment } from '../types';
|
|
10
|
+
export interface CoreUploadResponse {
|
|
11
|
+
id: number;
|
|
12
|
+
url: string;
|
|
13
|
+
path: string;
|
|
14
|
+
name: string;
|
|
15
|
+
mimetype: string;
|
|
16
|
+
size: number;
|
|
17
|
+
}
|
|
18
|
+
export declare function uploadFile(file: File, baseUrl: string, uploadEndpoint: string, createUploadHeaders: () => Headers, fetcher?: typeof fetch): Promise<CoreUploadResponse>;
|
|
19
|
+
export declare function assertUploadReferences(uploads: CoreUploadResponse[]): Array<{
|
|
20
|
+
uploadId: number;
|
|
21
|
+
}>;
|
|
22
|
+
export declare function ensureAttachmentUpload(attachment: Attachment, context: {
|
|
23
|
+
sessionId: string;
|
|
24
|
+
attachmentIndex: number;
|
|
25
|
+
}, uploadFileFn: (file: File) => Promise<CoreUploadResponse>): Promise<CoreUploadResponse>;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import type { ChatDataSource, Session, SessionMember, SessionListResult, SessionUser, SessionArtifact, Attachment, StreamChunk, StreamStatus, QuestionAnswers, SendMessageOptions, AsyncRunAccepted } from '../types';
|
|
2
|
+
import type { SessionState } from './SessionManager';
|
|
3
|
+
import * as Messages from './MessageTransport';
|
|
4
|
+
export interface HttpDataSourceConfig {
|
|
5
|
+
baseUrl: string;
|
|
6
|
+
rpcEndpoint: string;
|
|
7
|
+
streamEndpoint?: string;
|
|
8
|
+
uploadEndpoint?: string;
|
|
9
|
+
csrfToken?: string | (() => string);
|
|
10
|
+
headers?: Record<string, string>;
|
|
11
|
+
rpcTimeoutMs?: number;
|
|
12
|
+
/** Optional transport owned by the mounted host. */
|
|
13
|
+
fetcher?: typeof fetch;
|
|
14
|
+
streamConnectTimeoutMs?: number;
|
|
15
|
+
}
|
|
16
|
+
export declare class HttpDataSource implements ChatDataSource {
|
|
17
|
+
private config;
|
|
18
|
+
private abortController;
|
|
19
|
+
private rpc;
|
|
20
|
+
constructor(config: HttpDataSourceConfig);
|
|
21
|
+
private getCSRFToken;
|
|
22
|
+
private createHeaders;
|
|
23
|
+
private createUploadHeaders;
|
|
24
|
+
private callRPC;
|
|
25
|
+
private boundCallRPC;
|
|
26
|
+
private boundUploadFile;
|
|
27
|
+
createSession(): Promise<Session>;
|
|
28
|
+
fetchSession(id: string): Promise<SessionState | null>;
|
|
29
|
+
listSessions(options?: {
|
|
30
|
+
limit?: number;
|
|
31
|
+
offset?: number;
|
|
32
|
+
includeArchived?: boolean;
|
|
33
|
+
}): Promise<SessionListResult>;
|
|
34
|
+
archiveSession(sessionId: string): Promise<Session>;
|
|
35
|
+
unarchiveSession(sessionId: string): Promise<Session>;
|
|
36
|
+
pinSession(sessionId: string): Promise<Session>;
|
|
37
|
+
unpinSession(sessionId: string): Promise<Session>;
|
|
38
|
+
deleteSession(sessionId: string): Promise<void>;
|
|
39
|
+
renameSession(sessionId: string, title: string): Promise<Session>;
|
|
40
|
+
regenerateSessionTitle(sessionId: string): Promise<Session>;
|
|
41
|
+
clearSessionHistory(sessionId: string): Promise<{
|
|
42
|
+
success: boolean;
|
|
43
|
+
deletedMessages: number;
|
|
44
|
+
deletedArtifacts: number;
|
|
45
|
+
}>;
|
|
46
|
+
compactSessionHistory(sessionId: string): Promise<AsyncRunAccepted>;
|
|
47
|
+
listUsers(): Promise<SessionUser[]>;
|
|
48
|
+
listAllSessions(options?: {
|
|
49
|
+
limit?: number;
|
|
50
|
+
offset?: number;
|
|
51
|
+
includeArchived?: boolean;
|
|
52
|
+
userId?: string | null;
|
|
53
|
+
}): Promise<{
|
|
54
|
+
sessions: Session[];
|
|
55
|
+
total: number;
|
|
56
|
+
hasMore: boolean;
|
|
57
|
+
}>;
|
|
58
|
+
listSessionMembers(sessionId: string): Promise<SessionMember[]>;
|
|
59
|
+
addSessionMember(sessionId: string, userId: string, role: 'editor' | 'viewer'): Promise<void>;
|
|
60
|
+
updateSessionMemberRole(sessionId: string, userId: string, role: 'editor' | 'viewer'): Promise<void>;
|
|
61
|
+
removeSessionMember(sessionId: string, userId: string): Promise<void>;
|
|
62
|
+
stopGeneration(sessionId: string): Promise<void>;
|
|
63
|
+
getStreamStatus(sessionId: string): Promise<StreamStatus | null>;
|
|
64
|
+
resumeStream(sessionId: string, runId: string, onChunk: (chunk: StreamChunk) => void, signal?: AbortSignal): Promise<void>;
|
|
65
|
+
/**
|
|
66
|
+
* Open a native EventSource against GET /stream/events for the given
|
|
67
|
+
* run. Used by components that want browser-native auto-reconnect
|
|
68
|
+
* with Last-Event-ID (tab close, wifi drop, device switch). Prefer
|
|
69
|
+
* over resumeStream when tailing an already-running generation that
|
|
70
|
+
* another tab started.
|
|
71
|
+
*/
|
|
72
|
+
subscribeRunEvents(sessionId: string, runId: string, options: Messages.SubscribeRunEventsOptions): Promise<void>;
|
|
73
|
+
/**
|
|
74
|
+
* Subscribe to the per-tenant active-run fan-out
|
|
75
|
+
* (GET /stream/active-runs). Never resolves until the caller aborts
|
|
76
|
+
* via the signal; use from a top-level component (sidebar container)
|
|
77
|
+
* that mounts for the lifetime of the chat app.
|
|
78
|
+
*/
|
|
79
|
+
subscribeActiveRuns(options: Messages.SubscribeActiveRunsOptions): Promise<void>;
|
|
80
|
+
sendMessage(sessionId: string, content: string, attachments?: Attachment[], signal?: AbortSignal, options?: SendMessageOptions): AsyncGenerator<StreamChunk>;
|
|
81
|
+
cancelStream(): void;
|
|
82
|
+
submitQuestionAnswers(sessionId: string, questionId: string, answers: QuestionAnswers): Promise<{
|
|
83
|
+
success: boolean;
|
|
84
|
+
data?: AsyncRunAccepted;
|
|
85
|
+
error?: string;
|
|
86
|
+
}>;
|
|
87
|
+
rejectPendingQuestion(sessionId: string): Promise<{
|
|
88
|
+
success: boolean;
|
|
89
|
+
data?: AsyncRunAccepted;
|
|
90
|
+
error?: string;
|
|
91
|
+
}>;
|
|
92
|
+
fetchSessionArtifacts(sessionId: string, options?: {
|
|
93
|
+
limit?: number;
|
|
94
|
+
offset?: number;
|
|
95
|
+
}): Promise<{
|
|
96
|
+
artifacts: SessionArtifact[];
|
|
97
|
+
hasMore?: boolean;
|
|
98
|
+
nextOffset?: number;
|
|
99
|
+
}>;
|
|
100
|
+
uploadSessionArtifacts(sessionId: string, files: File[]): Promise<{
|
|
101
|
+
artifacts: SessionArtifact[];
|
|
102
|
+
}>;
|
|
103
|
+
renameSessionArtifact(artifactId: string, name: string, description?: string): Promise<SessionArtifact>;
|
|
104
|
+
deleteSessionArtifact(artifactId: string): Promise<void>;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Factory function to create HttpDataSource
|
|
108
|
+
*/
|
|
109
|
+
export declare function createHttpDataSource(config: HttpDataSourceConfig): ChatDataSource;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { HttpDataSource, type HttpDataSourceConfig } from './HttpDataSource';
|
|
2
|
+
import type { Attachment, StreamChunk } from '../types';
|
|
3
|
+
import { type SessionService } from '@iota-uz/sdk/client-host';
|
|
4
|
+
interface SendMessageOptions {
|
|
5
|
+
requestId?: string;
|
|
6
|
+
debugMode?: boolean;
|
|
7
|
+
replaceFromMessageID?: string;
|
|
8
|
+
reasoningEffort?: string;
|
|
9
|
+
model?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare class ManagedHttpDataSource extends HttpDataSource {
|
|
12
|
+
private readonly managedConfig;
|
|
13
|
+
private readonly session;
|
|
14
|
+
private readonly owner;
|
|
15
|
+
private readonly subscriptions;
|
|
16
|
+
constructor(managedConfig: HttpDataSourceConfig, session: SessionService);
|
|
17
|
+
sendMessage(sessionId: string, content: string, attachments?: Attachment[], signal?: AbortSignal, options?: SendMessageOptions): AsyncGenerator<StreamChunk>;
|
|
18
|
+
resumeStream(sessionId: string, runId: string, onChunk: (chunk: StreamChunk) => void, signal?: AbortSignal): Promise<void>;
|
|
19
|
+
dispose(): void;
|
|
20
|
+
cancelStream(): void;
|
|
21
|
+
private openPOSTStream;
|
|
22
|
+
private openEventStream;
|
|
23
|
+
private openManagedStream;
|
|
24
|
+
private uploadReference;
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Message sending, SSE streaming, and HITL question handling.
|
|
3
|
+
*
|
|
4
|
+
* @internal — Not part of the public API. Consumed by HttpDataSource.
|
|
5
|
+
*/
|
|
6
|
+
import type { BichatRPC } from './rpc.generated';
|
|
7
|
+
import type { ActiveRunDelivery, Attachment, StreamChunk, StreamStatus, QuestionAnswers, SendMessageOptions, AsyncRunAccepted } from '../types';
|
|
8
|
+
import { type CoreUploadResponse } from './AttachmentUploader';
|
|
9
|
+
/**
|
|
10
|
+
* Thrown by {@link subscribeRunEvents} when the underlying EventSource
|
|
11
|
+
* emits `onerror` before the first event arrives within the
|
|
12
|
+
* initial-connect grace window. Distinguishes boundary failures
|
|
13
|
+
* (401 / 404 / 503) from transient mid-run flaps, which the browser's
|
|
14
|
+
* native auto-reconnect continues to handle silently.
|
|
15
|
+
*/
|
|
16
|
+
export declare class RunEventsConnectError extends Error {
|
|
17
|
+
readonly cause?: Event;
|
|
18
|
+
constructor(message: string, cause?: Event);
|
|
19
|
+
}
|
|
20
|
+
interface Result<T> {
|
|
21
|
+
success: boolean;
|
|
22
|
+
data?: T;
|
|
23
|
+
error?: string;
|
|
24
|
+
}
|
|
25
|
+
type RPCCaller = <TMethod extends keyof BichatRPC & string>(method: TMethod, params: BichatRPC[TMethod]['params']) => Promise<BichatRPC[TMethod]['result']>;
|
|
26
|
+
type AttachmentLifecycleLogger = (event: 'stream_send_with_upload_ids', details: Record<string, unknown>) => void;
|
|
27
|
+
export interface MessageTransportDeps {
|
|
28
|
+
callRPC: RPCCaller;
|
|
29
|
+
baseUrl: string;
|
|
30
|
+
streamEndpoint: string;
|
|
31
|
+
rpcTimeoutMs: number;
|
|
32
|
+
streamConnectTimeoutMs?: number;
|
|
33
|
+
createHeaders: (additionalHeaders?: Record<string, string>) => Headers;
|
|
34
|
+
uploadFileFn: (file: File) => Promise<CoreUploadResponse>;
|
|
35
|
+
logAttachmentLifecycle: AttachmentLifecycleLogger;
|
|
36
|
+
}
|
|
37
|
+
export declare function sendMessage(deps: MessageTransportDeps, sessionId: string, content: string, attachments?: Attachment[], signal?: AbortSignal, options?: SendMessageOptions): AsyncGenerator<StreamChunk>;
|
|
38
|
+
export declare function stopStream(deps: Pick<MessageTransportDeps, 'baseUrl' | 'streamEndpoint' | 'createHeaders'> & {
|
|
39
|
+
timeoutMs?: number;
|
|
40
|
+
}, sessionId: string): Promise<void>;
|
|
41
|
+
type StreamStatusResumeDeps = Pick<MessageTransportDeps, 'baseUrl' | 'streamEndpoint' | 'createHeaders'> & {
|
|
42
|
+
timeoutMs?: number;
|
|
43
|
+
connectTimeoutMs?: number;
|
|
44
|
+
};
|
|
45
|
+
export declare function getStreamStatus(deps: StreamStatusResumeDeps, sessionId: string): Promise<StreamStatus | null>;
|
|
46
|
+
export declare function resumeStream(deps: StreamStatusResumeDeps, sessionId: string, runId: string, onChunk: (chunk: StreamChunk) => void, signal?: AbortSignal): Promise<void>;
|
|
47
|
+
type StreamEventsDeps = Pick<MessageTransportDeps, 'baseUrl' | 'streamEndpoint'>;
|
|
48
|
+
export interface SubscribeRunEventsOptions {
|
|
49
|
+
/** When set, start from the last seen event id instead of a full replay. */
|
|
50
|
+
lastEventId?: string;
|
|
51
|
+
/** Fires for every chunk (content / tool / snapshot / done / error / …). */
|
|
52
|
+
onChunk: (chunk: StreamChunk) => void;
|
|
53
|
+
/** Optional hook for raw SSE errors (connection blips, parse failures). */
|
|
54
|
+
onError?: (event: Event) => void;
|
|
55
|
+
/** AbortSignal closes the underlying EventSource. */
|
|
56
|
+
signal?: AbortSignal;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Open a native EventSource against GET /stream/events for a run. The
|
|
60
|
+
* browser handles reconnect + Last-Event-ID automatically on transient
|
|
61
|
+
* network drops; we forward each SSE event onto onChunk and resolve the
|
|
62
|
+
* returned promise when a terminal event (done / error) arrives or the
|
|
63
|
+
* caller aborts.
|
|
64
|
+
*
|
|
65
|
+
* Kept separate from sendMessage so the applet can connect to a run
|
|
66
|
+
* that was started by another tab (shared request_id) or that the
|
|
67
|
+
* current session already had in flight (tab reopen, device switch).
|
|
68
|
+
*/
|
|
69
|
+
export declare function subscribeRunEvents(deps: StreamEventsDeps, sessionId: string, runId: string, options: SubscribeRunEventsOptions): Promise<void>;
|
|
70
|
+
export interface SubscribeActiveRunsOptions {
|
|
71
|
+
onEvent: (event: ActiveRunDelivery) => void;
|
|
72
|
+
onError?: (event: Event) => void;
|
|
73
|
+
signal?: AbortSignal;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Open an EventSource to the per-tenant active-run feed. Emits one
|
|
77
|
+
* "snapshot" row per currently-running session on connect then live
|
|
78
|
+
* "update" deltas as runs transition. Used by the chat list to render
|
|
79
|
+
* a status dot without polling each session.
|
|
80
|
+
*
|
|
81
|
+
* Never resolves on its own — the caller should abort via the signal
|
|
82
|
+
* when the component unmounts; the returned promise only settles on
|
|
83
|
+
* signal abort or initial-connect failure.
|
|
84
|
+
*/
|
|
85
|
+
export declare function subscribeActiveRuns(deps: StreamEventsDeps, options: SubscribeActiveRunsOptions): Promise<void>;
|
|
86
|
+
export declare function submitQuestionAnswers(callRPC: RPCCaller, sessionId: string, questionId: string, answers: QuestionAnswers): Promise<Result<AsyncRunAccepted>>;
|
|
87
|
+
export declare function rejectPendingQuestion(callRPC: RPCCaller, sessionId: string): Promise<Result<AsyncRunAccepted>>;
|
|
88
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { BichatRPC } from './rpc.generated';
|
|
2
|
+
import type { Session, SessionMember, SessionUser, SessionListResult, SessionArtifact, ConversationTurn, PendingQuestion, AsyncRunAccepted } from '../types';
|
|
3
|
+
export interface SessionState {
|
|
4
|
+
session: Session;
|
|
5
|
+
turns: ConversationTurn[];
|
|
6
|
+
pendingQuestion?: PendingQuestion | null;
|
|
7
|
+
}
|
|
8
|
+
type RPCCaller = <TMethod extends keyof BichatRPC & string>(method: TMethod, params: BichatRPC[TMethod]['params']) => Promise<BichatRPC[TMethod]['result']>;
|
|
9
|
+
type FetchSessionArtifactsFn = (sessionId: string, options?: {
|
|
10
|
+
limit?: number;
|
|
11
|
+
offset?: number;
|
|
12
|
+
}) => Promise<{
|
|
13
|
+
artifacts: SessionArtifact[];
|
|
14
|
+
hasMore?: boolean;
|
|
15
|
+
nextOffset?: number;
|
|
16
|
+
}>;
|
|
17
|
+
export declare function createSession(callRPC: RPCCaller): Promise<Session>;
|
|
18
|
+
export declare function fetchSession(id: string, callRPC: RPCCaller, fetchArtifacts: FetchSessionArtifactsFn): Promise<SessionState | null>;
|
|
19
|
+
export declare function listSessions(callRPC: RPCCaller, options?: {
|
|
20
|
+
limit?: number;
|
|
21
|
+
offset?: number;
|
|
22
|
+
includeArchived?: boolean;
|
|
23
|
+
}): Promise<SessionListResult>;
|
|
24
|
+
export declare function archiveSession(callRPC: RPCCaller, sessionId: string): Promise<Session>;
|
|
25
|
+
export declare function unarchiveSession(callRPC: RPCCaller, sessionId: string): Promise<Session>;
|
|
26
|
+
export declare function pinSession(callRPC: RPCCaller, sessionId: string): Promise<Session>;
|
|
27
|
+
export declare function unpinSession(callRPC: RPCCaller, sessionId: string): Promise<Session>;
|
|
28
|
+
export declare function deleteSession(callRPC: RPCCaller, sessionId: string): Promise<void>;
|
|
29
|
+
export declare function renameSession(callRPC: RPCCaller, sessionId: string, title: string): Promise<Session>;
|
|
30
|
+
export declare function regenerateSessionTitle(callRPC: RPCCaller, sessionId: string): Promise<Session>;
|
|
31
|
+
export declare function clearSessionHistory(callRPC: RPCCaller, sessionId: string): Promise<{
|
|
32
|
+
success: boolean;
|
|
33
|
+
deletedMessages: number;
|
|
34
|
+
deletedArtifacts: number;
|
|
35
|
+
}>;
|
|
36
|
+
export declare function compactSessionHistory(callRPC: RPCCaller, sessionId: string): Promise<AsyncRunAccepted>;
|
|
37
|
+
export declare function listUsers(callRPC: RPCCaller): Promise<SessionUser[]>;
|
|
38
|
+
export declare function listAllSessions(callRPC: RPCCaller, options?: {
|
|
39
|
+
limit?: number;
|
|
40
|
+
offset?: number;
|
|
41
|
+
includeArchived?: boolean;
|
|
42
|
+
userId?: string | null;
|
|
43
|
+
}): Promise<{
|
|
44
|
+
sessions: Session[];
|
|
45
|
+
total: number;
|
|
46
|
+
hasMore: boolean;
|
|
47
|
+
}>;
|
|
48
|
+
export declare function listSessionMembers(callRPC: RPCCaller, sessionId: string): Promise<SessionMember[]>;
|
|
49
|
+
export declare function addSessionMember(callRPC: RPCCaller, sessionId: string, userId: string, role: 'editor' | 'viewer'): Promise<void>;
|
|
50
|
+
export declare function updateSessionMemberRole(callRPC: RPCCaller, sessionId: string, userId: string, role: 'editor' | 'viewer'): Promise<void>;
|
|
51
|
+
export declare function removeSessionMember(callRPC: RPCCaller, sessionId: string, userId: string): Promise<void>;
|
|
52
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface AppletRPCError {
|
|
2
|
+
code: string;
|
|
3
|
+
message: string;
|
|
4
|
+
details?: unknown;
|
|
5
|
+
}
|
|
6
|
+
export declare class AppletRPCException extends Error {
|
|
7
|
+
code: string;
|
|
8
|
+
details?: unknown;
|
|
9
|
+
cause?: unknown;
|
|
10
|
+
constructor(args: {
|
|
11
|
+
code: string;
|
|
12
|
+
message: string;
|
|
13
|
+
details?: unknown;
|
|
14
|
+
cause?: unknown;
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
export type AppletRPCSchema = Record<string, {
|
|
18
|
+
params: unknown;
|
|
19
|
+
result: unknown;
|
|
20
|
+
}>;
|
|
21
|
+
export interface CreateAppletRPCClientOptions {
|
|
22
|
+
endpoint: string;
|
|
23
|
+
fetcher?: typeof fetch;
|
|
24
|
+
timeoutMs?: number;
|
|
25
|
+
}
|
|
26
|
+
export declare function createAppletRPCClient(options: CreateAppletRPCClientOptions): {
|
|
27
|
+
call: <TParams, TResult>(method: string, params: TParams) => Promise<TResult>;
|
|
28
|
+
callTyped: <TRouter extends AppletRPCSchema, TMethod extends keyof TRouter & string>(method: TMethod, params: TRouter[TMethod]["params"]) => Promise<TRouter[TMethod]["result"]>;
|
|
29
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type mapping and sanitization functions for converting RPC payloads
|
|
3
|
+
* to domain types used by the BiChat UI.
|
|
4
|
+
*
|
|
5
|
+
* All functions are pure and side-effect-free (except console.warn for
|
|
6
|
+
* malformed payloads).
|
|
7
|
+
*
|
|
8
|
+
* @internal — Not part of the public API. Consumed by HttpDataSource modules.
|
|
9
|
+
*/
|
|
10
|
+
import type { Session as RPCSession } from "./rpc.generated";
|
|
11
|
+
import type { PendingQuestion as RPCPendingQuestion } from "./rpc.generated";
|
|
12
|
+
import type { Session, ConversationTurn, SessionArtifact, PendingQuestion } from "../types";
|
|
13
|
+
export interface RPCArtifact {
|
|
14
|
+
id: string;
|
|
15
|
+
sessionId: string;
|
|
16
|
+
messageId?: string;
|
|
17
|
+
uploadId?: number | null;
|
|
18
|
+
type: string;
|
|
19
|
+
name: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
mimeType?: string;
|
|
22
|
+
url?: string;
|
|
23
|
+
sizeBytes: number;
|
|
24
|
+
metadata?: Record<string, unknown>;
|
|
25
|
+
createdAt: string;
|
|
26
|
+
}
|
|
27
|
+
export declare function warnMalformedSessionPayload(message: string, details?: Record<string, unknown>): void;
|
|
28
|
+
export declare function toSession(session: RPCSession): Session;
|
|
29
|
+
export declare function toSessionArtifact(artifact: RPCArtifact): SessionArtifact;
|
|
30
|
+
export declare function sanitizeConversationTurns(rawTurns: unknown, sessionID: string): ConversationTurn[];
|
|
31
|
+
export declare function sanitizePendingQuestion(rawPendingQuestion: RPCPendingQuestion | null | undefined, sessionID: string): PendingQuestion | null;
|
|
32
|
+
export declare function normalizeTurns(raw: ConversationTurn[]): ConversationTurn[];
|
|
33
|
+
export declare function attachArtifactsToTurns(turns: ConversationTurn[], artifacts: SessionArtifact[]): ConversationTurn[];
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* openManagedEventSource — shared EventSource primitive.
|
|
3
|
+
*
|
|
4
|
+
* Centralises the listener wiring, AbortSignal handling, and the
|
|
5
|
+
* 500ms initial-connect grace used by subscribeRunEvents and
|
|
6
|
+
* subscribeActiveRuns. Future fan-out helpers can adopt this instead
|
|
7
|
+
* of duplicating the EventSource boilerplate.
|
|
8
|
+
*
|
|
9
|
+
* Behaviour:
|
|
10
|
+
* - Registers an addEventListener for every name in `events`. The
|
|
11
|
+
* callback receives the event name and the JSON-parsed payload.
|
|
12
|
+
* - On JSON parse failure, the callback is invoked with
|
|
13
|
+
* `{ __unparseable: true, raw: <string> }` so the caller can log or
|
|
14
|
+
* surface a synthetic error. The subscription stays open; native
|
|
15
|
+
* EventSource reconnect handles transient flaps.
|
|
16
|
+
* - Initial-connect grace: when `onerror` fires before any event is
|
|
17
|
+
* received AND within `connectGraceMs` of construction, the
|
|
18
|
+
* returned promise rejects with either the caller-provided error
|
|
19
|
+
* (via `onConnectError`) or a generic Error. After the grace
|
|
20
|
+
* window expires, `onerror` is non-fatal — the browser reconnects
|
|
21
|
+
* silently.
|
|
22
|
+
* - AbortSignal close: closing the source resolves the promise.
|
|
23
|
+
* Already-aborted signals short-circuit before construction.
|
|
24
|
+
*/
|
|
25
|
+
export interface UnparseableEventPayload {
|
|
26
|
+
__unparseable: true;
|
|
27
|
+
raw: string;
|
|
28
|
+
}
|
|
29
|
+
export interface OpenManagedEventSourceOptions {
|
|
30
|
+
url: string;
|
|
31
|
+
/** Every named event to subscribe to via addEventListener. */
|
|
32
|
+
events: readonly string[];
|
|
33
|
+
/**
|
|
34
|
+
* Called for each event received. `data` is either the JSON-parsed
|
|
35
|
+
* payload or a sentinel `{ __unparseable: true, raw }` when the
|
|
36
|
+
* payload could not be parsed.
|
|
37
|
+
*/
|
|
38
|
+
onMessage: (name: string, data: unknown) => void;
|
|
39
|
+
/** Optional hook for raw EventSource errors (all flaps, not just initial). */
|
|
40
|
+
onError?: (e: Event) => void;
|
|
41
|
+
/** Close the source and resolve the promise when the signal aborts. */
|
|
42
|
+
signal?: AbortSignal;
|
|
43
|
+
/** Forwarded to the EventSource constructor. Defaults to true. */
|
|
44
|
+
withCredentials?: boolean;
|
|
45
|
+
/** Initial-connect grace window in ms. Default 500. Set 0 to disable the probe. */
|
|
46
|
+
connectGraceMs?: number;
|
|
47
|
+
/**
|
|
48
|
+
* Maps the raw onerror Event into a rejection Error. Called only
|
|
49
|
+
* when the error fires within the grace window and before any event
|
|
50
|
+
* has been received. Defaults to a plain Error.
|
|
51
|
+
*/
|
|
52
|
+
onConnectError?: (e: Event) => Error;
|
|
53
|
+
}
|
|
54
|
+
export declare function openManagedEventSource(opts: OpenManagedEventSourceOptions): Promise<void>;
|