@flanksource/clicky-ui 0.2.18 → 0.2.20
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/ai.cjs +26 -0
- package/dist/ai.cjs.map +1 -0
- package/dist/ai.d.ts +2 -0
- package/dist/ai.d.ts.map +1 -0
- package/dist/ai.js +26 -0
- package/dist/ai.js.map +1 -0
- package/dist/chat.cjs +7 -0
- package/dist/chat.cjs.map +1 -1
- package/dist/chat.js +7 -0
- package/dist/chat.js.map +1 -1
- package/dist/components/FilterBar.cjs +49 -18
- package/dist/components/FilterBar.cjs.map +1 -1
- package/dist/components/FilterBar.d.ts +0 -2
- package/dist/components/FilterBar.d.ts.map +1 -1
- package/dist/components/FilterBar.js +50 -19
- package/dist/components/FilterBar.js.map +1 -1
- package/dist/components/SearchInput.cjs +63 -0
- package/dist/components/SearchInput.cjs.map +1 -0
- package/dist/components/SearchInput.d.ts +31 -0
- package/dist/components/SearchInput.d.ts.map +1 -0
- package/dist/components/SearchInput.js +63 -0
- package/dist/components/SearchInput.js.map +1 -0
- package/dist/components/SegmentedControl.cjs +88 -0
- package/dist/components/SegmentedControl.cjs.map +1 -0
- package/dist/components/SegmentedControl.d.ts +38 -0
- package/dist/components/SegmentedControl.d.ts.map +1 -0
- package/dist/components/SegmentedControl.js +88 -0
- package/dist/components/SegmentedControl.js.map +1 -0
- package/dist/components/Switch.cjs +51 -0
- package/dist/components/Switch.cjs.map +1 -0
- package/dist/components/Switch.d.ts +23 -0
- package/dist/components/Switch.d.ts.map +1 -0
- package/dist/components/Switch.js +51 -0
- package/dist/components/Switch.js.map +1 -0
- package/dist/components/TimeRange.cjs +53 -45
- package/dist/components/TimeRange.cjs.map +1 -1
- package/dist/components/TimeRange.d.ts.map +1 -1
- package/dist/components/TimeRange.js +53 -45
- package/dist/components/TimeRange.js.map +1 -1
- package/dist/components/TreePickerField.cjs +5 -1
- package/dist/components/TreePickerField.cjs.map +1 -1
- package/dist/components/TreePickerField.d.ts.map +1 -1
- package/dist/components/TreePickerField.js +5 -1
- package/dist/components/TreePickerField.js.map +1 -1
- package/dist/components/filter-bar-utils.cjs +5 -0
- package/dist/components/filter-bar-utils.cjs.map +1 -1
- package/dist/components/filter-bar-utils.d.ts +2 -0
- package/dist/components/filter-bar-utils.d.ts.map +1 -1
- package/dist/components/filter-bar-utils.js +5 -0
- package/dist/components/filter-bar-utils.js.map +1 -1
- package/dist/components/json-schema-form-fields.cjs +8 -2
- package/dist/components/json-schema-form-fields.cjs.map +1 -1
- package/dist/components/json-schema-form-fields.d.ts.map +1 -1
- package/dist/components/json-schema-form-fields.js +8 -2
- package/dist/components/json-schema-form-fields.js.map +1 -1
- package/dist/components/json-schema-form-resolve.cjs +1 -1
- package/dist/components/json-schema-form-resolve.cjs.map +1 -1
- package/dist/components/json-schema-form-resolve.js +1 -1
- package/dist/components/json-schema-form-resolve.js.map +1 -1
- package/dist/components.cjs +21 -1
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.ts +11 -1
- package/dist/components.d.ts.map +1 -1
- package/dist/components.js +21 -1
- package/dist/components.js.map +1 -1
- package/dist/data/Clicky.cjs +33 -44
- package/dist/data/Clicky.cjs.map +1 -1
- package/dist/data/Clicky.d.ts +0 -9
- package/dist/data/Clicky.d.ts.map +1 -1
- package/dist/data/Clicky.js +31 -42
- package/dist/data/Clicky.js.map +1 -1
- package/dist/data/DataTable.cjs +73 -50
- package/dist/data/DataTable.cjs.map +1 -1
- package/dist/data/DataTable.d.ts +4 -0
- package/dist/data/DataTable.d.ts.map +1 -1
- package/dist/data/DataTable.js +73 -50
- package/dist/data/DataTable.js.map +1 -1
- package/dist/data/Icon.cjs +2 -5
- package/dist/data/Icon.cjs.map +1 -1
- package/dist/data/Icon.d.ts +1 -21
- package/dist/data/Icon.d.ts.map +1 -1
- package/dist/data/Icon.js +3 -6
- package/dist/data/Icon.js.map +1 -1
- package/dist/data/MatrixTable.cjs +4 -4
- package/dist/data/MatrixTable.cjs.map +1 -1
- package/dist/data/MatrixTable.js +4 -4
- package/dist/data/MatrixTable.js.map +1 -1
- package/dist/data/RadialGauge.cjs +76 -0
- package/dist/data/RadialGauge.cjs.map +1 -0
- package/dist/data/RadialGauge.d.ts +24 -0
- package/dist/data/RadialGauge.d.ts.map +1 -0
- package/dist/data/RadialGauge.js +76 -0
- package/dist/data/RadialGauge.js.map +1 -0
- package/dist/data/StatusBreakdown.cjs +0 -4
- package/dist/data/StatusBreakdown.cjs.map +1 -1
- package/dist/data/StatusBreakdown.d.ts +0 -2
- package/dist/data/StatusBreakdown.d.ts.map +1 -1
- package/dist/data/StatusBreakdown.js +1 -5
- package/dist/data/StatusBreakdown.js.map +1 -1
- package/dist/data/TabButton.cjs +17 -2
- package/dist/data/TabButton.cjs.map +1 -1
- package/dist/data/TabButton.d.ts +5 -1
- package/dist/data/TabButton.d.ts.map +1 -1
- package/dist/data/TabButton.js +17 -2
- package/dist/data/TabButton.js.map +1 -1
- package/dist/data/Timeline.cjs +61 -0
- package/dist/data/Timeline.cjs.map +1 -0
- package/dist/data/Timeline.d.ts +36 -0
- package/dist/data/Timeline.d.ts.map +1 -0
- package/dist/data/Timeline.js +61 -0
- package/dist/data/Timeline.js.map +1 -0
- package/dist/data/TimeseriesCoreBars.cjs +2 -25
- package/dist/data/TimeseriesCoreBars.cjs.map +1 -1
- package/dist/data/TimeseriesCoreBars.d.ts +0 -19
- package/dist/data/TimeseriesCoreBars.d.ts.map +1 -1
- package/dist/data/TimeseriesCoreBars.js +2 -25
- package/dist/data/TimeseriesCoreBars.js.map +1 -1
- package/dist/data/TimeseriesCoreBars.model.cjs +27 -0
- package/dist/data/TimeseriesCoreBars.model.cjs.map +1 -0
- package/dist/data/TimeseriesCoreBars.model.d.ts +20 -0
- package/dist/data/TimeseriesCoreBars.model.d.ts.map +1 -0
- package/dist/data/TimeseriesCoreBars.model.js +27 -0
- package/dist/data/TimeseriesCoreBars.model.js.map +1 -0
- package/dist/data/TimeseriesPanel.axes.cjs.map +1 -1
- package/dist/data/TimeseriesPanel.axes.d.ts +1 -1
- package/dist/data/TimeseriesPanel.axes.d.ts.map +1 -1
- package/dist/data/TimeseriesPanel.axes.js.map +1 -1
- package/dist/data/TimeseriesPanel.cjs +4 -54
- package/dist/data/TimeseriesPanel.cjs.map +1 -1
- package/dist/data/TimeseriesPanel.d.ts +2 -138
- package/dist/data/TimeseriesPanel.d.ts.map +1 -1
- package/dist/data/TimeseriesPanel.js +2 -52
- package/dist/data/TimeseriesPanel.js.map +1 -1
- package/dist/data/TimeseriesPanel.model.cjs +53 -0
- package/dist/data/TimeseriesPanel.model.cjs.map +1 -0
- package/dist/data/TimeseriesPanel.model.d.ts +88 -0
- package/dist/data/TimeseriesPanel.model.d.ts.map +1 -0
- package/dist/data/TimeseriesPanel.model.js +53 -0
- package/dist/data/TimeseriesPanel.model.js.map +1 -0
- package/dist/data/Tree.cjs +1 -1
- package/dist/data/Tree.cjs.map +1 -1
- package/dist/data/Tree.js +1 -1
- package/dist/data/Tree.js.map +1 -1
- package/dist/data/ai/ChatFab.cjs +29 -0
- package/dist/data/ai/ChatFab.cjs.map +1 -0
- package/dist/data/ai/ChatFab.d.ts +12 -0
- package/dist/data/ai/ChatFab.d.ts.map +1 -0
- package/dist/data/ai/ChatFab.js +29 -0
- package/dist/data/ai/ChatFab.js.map +1 -0
- package/dist/data/ai/ChatWindow.cjs +178 -0
- package/dist/data/ai/ChatWindow.cjs.map +1 -0
- package/dist/data/ai/ChatWindow.d.ts +38 -0
- package/dist/data/ai/ChatWindow.d.ts.map +1 -0
- package/dist/data/ai/ChatWindow.js +156 -0
- package/dist/data/ai/ChatWindow.js.map +1 -0
- package/dist/data/ai/ChatWindowManager.cjs +139 -0
- package/dist/data/ai/ChatWindowManager.cjs.map +1 -0
- package/dist/data/ai/ChatWindowManager.d.ts +12 -0
- package/dist/data/ai/ChatWindowManager.d.ts.map +1 -0
- package/dist/data/ai/ChatWindowManager.js +139 -0
- package/dist/data/ai/ChatWindowManager.js.map +1 -0
- package/dist/data/ai/ContextBadges.cjs +74 -0
- package/dist/data/ai/ContextBadges.cjs.map +1 -0
- package/dist/data/ai/ContextBadges.d.ts +16 -0
- package/dist/data/ai/ContextBadges.d.ts.map +1 -0
- package/dist/data/ai/ContextBadges.js +74 -0
- package/dist/data/ai/ContextBadges.js.map +1 -0
- package/dist/data/ai/ThreadPicker.cjs +148 -0
- package/dist/data/ai/ThreadPicker.cjs.map +1 -0
- package/dist/data/ai/ThreadPicker.d.ts +37 -0
- package/dist/data/ai/ThreadPicker.d.ts.map +1 -0
- package/dist/data/ai/ThreadPicker.js +148 -0
- package/dist/data/ai/ThreadPicker.js.map +1 -0
- package/dist/data/ai/ToolPreferences.cjs +80 -0
- package/dist/data/ai/ToolPreferences.cjs.map +1 -0
- package/dist/data/ai/ToolPreferences.d.ts +19 -0
- package/dist/data/ai/ToolPreferences.d.ts.map +1 -0
- package/dist/data/ai/ToolPreferences.js +80 -0
- package/dist/data/ai/ToolPreferences.js.map +1 -0
- package/dist/data/ai/chat-window-context.cjs +78 -0
- package/dist/data/ai/chat-window-context.cjs.map +1 -0
- package/dist/data/ai/chat-window-context.d.ts +57 -0
- package/dist/data/ai/chat-window-context.d.ts.map +1 -0
- package/dist/data/ai/chat-window-context.js +78 -0
- package/dist/data/ai/chat-window-context.js.map +1 -0
- package/dist/data/ai/context.cjs +43 -0
- package/dist/data/ai/context.cjs.map +1 -0
- package/dist/data/ai/context.d.ts +35 -0
- package/dist/data/ai/context.d.ts.map +1 -0
- package/dist/data/ai/context.js +43 -0
- package/dist/data/ai/context.js.map +1 -0
- package/dist/data/ai/index.d.ts +10 -0
- package/dist/data/ai/index.d.ts.map +1 -0
- package/dist/data/cache-browser/CacheDetailPanel.cjs +15 -0
- package/dist/data/cache-browser/CacheDetailPanel.cjs.map +1 -1
- package/dist/data/cache-browser/CacheDetailPanel.d.ts.map +1 -1
- package/dist/data/cache-browser/CacheDetailPanel.js +15 -0
- package/dist/data/cache-browser/CacheDetailPanel.js.map +1 -1
- package/dist/data/cache-browser/cache-browser.fixtures.d.ts +10 -0
- package/dist/data/cache-browser/cache-browser.fixtures.d.ts.map +1 -0
- package/dist/data/cache-browser/download.cjs +13 -0
- package/dist/data/cache-browser/download.cjs.map +1 -0
- package/dist/data/cache-browser/download.d.ts +3 -0
- package/dist/data/cache-browser/download.d.ts.map +1 -0
- package/dist/data/cache-browser/download.js +13 -0
- package/dist/data/cache-browser/download.js.map +1 -0
- package/dist/data/chat/Chat.cjs +40 -2
- package/dist/data/chat/Chat.cjs.map +1 -1
- package/dist/data/chat/Chat.d.ts +5 -2
- package/dist/data/chat/Chat.d.ts.map +1 -1
- package/dist/data/chat/Chat.fixtures.cjs +86 -0
- package/dist/data/chat/Chat.fixtures.cjs.map +1 -0
- package/dist/data/chat/Chat.fixtures.d.ts +4 -0
- package/dist/data/chat/Chat.fixtures.d.ts.map +1 -1
- package/dist/data/chat/Chat.fixtures.js +86 -0
- package/dist/data/chat/Chat.fixtures.js.map +1 -0
- package/dist/data/chat/Chat.js +41 -3
- package/dist/data/chat/Chat.js.map +1 -1
- package/dist/data/chat/ContextUsage.cjs +99 -0
- package/dist/data/chat/ContextUsage.cjs.map +1 -0
- package/dist/data/chat/ContextUsage.d.ts +19 -0
- package/dist/data/chat/ContextUsage.d.ts.map +1 -0
- package/dist/data/chat/ContextUsage.js +99 -0
- package/dist/data/chat/ContextUsage.js.map +1 -0
- package/dist/data/chat/ModelSelector.cjs +28 -14
- package/dist/data/chat/ModelSelector.cjs.map +1 -1
- package/dist/data/chat/ModelSelector.d.ts +5 -4
- package/dist/data/chat/ModelSelector.d.ts.map +1 -1
- package/dist/data/chat/ModelSelector.js +28 -14
- package/dist/data/chat/ModelSelector.js.map +1 -1
- package/dist/data/chat/clickyOperationsToTools.cjs +21 -1
- package/dist/data/chat/clickyOperationsToTools.cjs.map +1 -1
- package/dist/data/chat/clickyOperationsToTools.d.ts +5 -4
- package/dist/data/chat/clickyOperationsToTools.d.ts.map +1 -1
- package/dist/data/chat/clickyOperationsToTools.js +21 -1
- package/dist/data/chat/clickyOperationsToTools.js.map +1 -1
- package/dist/data/chat/index.d.ts +4 -1
- package/dist/data/chat/index.d.ts.map +1 -1
- package/dist/data/chat/provider-icons.cjs +15 -0
- package/dist/data/chat/provider-icons.cjs.map +1 -0
- package/dist/data/chat/provider-icons.d.ts +7 -0
- package/dist/data/chat/provider-icons.d.ts.map +1 -0
- package/dist/data/chat/provider-icons.js +15 -0
- package/dist/data/chat/provider-icons.js.map +1 -0
- package/dist/data/chat/types.cjs.map +1 -1
- package/dist/data/chat/types.d.ts +41 -9
- package/dist/data/chat/types.d.ts.map +1 -1
- package/dist/data/chat/types.js.map +1 -1
- package/dist/data/clicky-parse.cjs +42 -0
- package/dist/data/clicky-parse.cjs.map +1 -0
- package/dist/data/clicky-parse.d.ts +11 -0
- package/dist/data/clicky-parse.d.ts.map +1 -0
- package/dist/data/clicky-parse.js +42 -0
- package/dist/data/clicky-parse.js.map +1 -0
- package/dist/data/diagnostics/FrameSourceWindow.cjs +0 -4
- package/dist/data/diagnostics/FrameSourceWindow.cjs.map +1 -1
- package/dist/data/diagnostics/FrameSourceWindow.d.ts +1 -11
- package/dist/data/diagnostics/FrameSourceWindow.d.ts.map +1 -1
- package/dist/data/diagnostics/FrameSourceWindow.js +1 -5
- package/dist/data/diagnostics/FrameSourceWindow.js.map +1 -1
- package/dist/data/diagnostics/FrameSourceWindow.utils.cjs +7 -0
- package/dist/data/diagnostics/FrameSourceWindow.utils.cjs.map +1 -0
- package/dist/data/diagnostics/FrameSourceWindow.utils.d.ts +12 -0
- package/dist/data/diagnostics/FrameSourceWindow.utils.d.ts.map +1 -0
- package/dist/data/diagnostics/FrameSourceWindow.utils.js +7 -0
- package/dist/data/diagnostics/FrameSourceWindow.utils.js.map +1 -0
- package/dist/data/diagnostics/JvmStackTrace.cjs +2 -1
- package/dist/data/diagnostics/JvmStackTrace.cjs.map +1 -1
- package/dist/data/diagnostics/JvmStackTrace.d.ts.map +1 -1
- package/dist/data/diagnostics/JvmStackTrace.js +2 -1
- package/dist/data/diagnostics/JvmStackTrace.js.map +1 -1
- package/dist/data/icon-fallback.cjs +12 -0
- package/dist/data/icon-fallback.cjs.map +1 -0
- package/dist/data/icon-fallback.d.ts +19 -0
- package/dist/data/icon-fallback.d.ts.map +1 -0
- package/dist/data/icon-fallback.js +12 -0
- package/dist/data/icon-fallback.js.map +1 -0
- package/dist/data/status-breakdown-utils.cjs +7 -0
- package/dist/data/status-breakdown-utils.cjs.map +1 -0
- package/dist/data/status-breakdown-utils.d.ts +4 -0
- package/dist/data/status-breakdown-utils.d.ts.map +1 -0
- package/dist/data/status-breakdown-utils.js +7 -0
- package/dist/data/status-breakdown-utils.js.map +1 -0
- package/dist/data/test-runner/TestRunSummary.cjs +36 -0
- package/dist/data/test-runner/TestRunSummary.cjs.map +1 -1
- package/dist/data/test-runner/TestRunSummary.d.ts +7 -1
- package/dist/data/test-runner/TestRunSummary.d.ts.map +1 -1
- package/dist/data/test-runner/TestRunSummary.js +36 -0
- package/dist/data/test-runner/TestRunSummary.js.map +1 -1
- package/dist/data/test-runner/TestRunner.cjs +5 -3
- package/dist/data/test-runner/TestRunner.cjs.map +1 -1
- package/dist/data/test-runner/TestRunner.d.ts +13 -1
- package/dist/data/test-runner/TestRunner.d.ts.map +1 -1
- package/dist/data/test-runner/TestRunner.js +5 -3
- package/dist/data/test-runner/TestRunner.js.map +1 -1
- package/dist/data/version-info.cjs +3 -3
- package/dist/data/version-info.js +3 -3
- package/dist/data.cjs +19 -6
- package/dist/data.cjs.map +1 -1
- package/dist/data.d.ts +14 -6
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +18 -5
- package/dist/data.js.map +1 -1
- package/dist/index.cjs +57 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +56 -6
- package/dist/index.js.map +1 -1
- package/dist/layout/AppShell.cjs +332 -0
- package/dist/layout/AppShell.cjs.map +1 -0
- package/dist/layout/AppShell.d.ts +75 -0
- package/dist/layout/AppShell.d.ts.map +1 -0
- package/dist/layout/AppShell.js +332 -0
- package/dist/layout/AppShell.js.map +1 -0
- package/dist/layout/AppSidebar.cjs +239 -0
- package/dist/layout/AppSidebar.cjs.map +1 -0
- package/dist/layout/AppSidebar.d.ts +62 -0
- package/dist/layout/AppSidebar.d.ts.map +1 -0
- package/dist/layout/AppSidebar.js +239 -0
- package/dist/layout/AppSidebar.js.map +1 -0
- package/dist/layout/Panel.cjs +66 -0
- package/dist/layout/Panel.cjs.map +1 -0
- package/dist/layout/Panel.d.ts +34 -0
- package/dist/layout/Panel.d.ts.map +1 -0
- package/dist/layout/Panel.js +66 -0
- package/dist/layout/Panel.js.map +1 -0
- package/dist/layout/Tabs.cjs +36 -0
- package/dist/layout/Tabs.cjs.map +1 -0
- package/dist/layout/Tabs.d.ts +36 -0
- package/dist/layout/Tabs.d.ts.map +1 -0
- package/dist/layout/Tabs.js +36 -0
- package/dist/layout/Tabs.js.map +1 -0
- package/dist/overlay/DropdownMenu.cjs.map +1 -1
- package/dist/overlay/DropdownMenu.d.ts.map +1 -1
- package/dist/overlay/DropdownMenu.js.map +1 -1
- package/dist/overlay/Modal.cjs +4 -2
- package/dist/overlay/Modal.cjs.map +1 -1
- package/dist/overlay/Modal.d.ts +1 -1
- package/dist/overlay/Modal.d.ts.map +1 -1
- package/dist/overlay/Modal.js +4 -2
- package/dist/overlay/Modal.js.map +1 -1
- package/dist/overlay/Toast.cjs +89 -0
- package/dist/overlay/Toast.cjs.map +1 -0
- package/dist/overlay/Toast.d.ts +14 -0
- package/dist/overlay/Toast.d.ts.map +1 -0
- package/dist/overlay/Toast.js +89 -0
- package/dist/overlay/Toast.js.map +1 -0
- package/dist/overlay/toast-context.cjs +12 -0
- package/dist/overlay/toast-context.cjs.map +1 -0
- package/dist/overlay/toast-context.d.ts +24 -0
- package/dist/overlay/toast-context.d.ts.map +1 -0
- package/dist/overlay/toast-context.js +12 -0
- package/dist/overlay/toast-context.js.map +1 -0
- package/dist/rpc/AcceptPicker.cjs +81 -58
- package/dist/rpc/AcceptPicker.cjs.map +1 -1
- package/dist/rpc/AcceptPicker.d.ts.map +1 -1
- package/dist/rpc/AcceptPicker.js +81 -58
- package/dist/rpc/AcceptPicker.js.map +1 -1
- package/dist/rpc/CommandForm.cjs +5 -35
- package/dist/rpc/CommandForm.cjs.map +1 -1
- package/dist/rpc/CommandForm.d.ts +0 -3
- package/dist/rpc/CommandForm.d.ts.map +1 -1
- package/dist/rpc/CommandForm.js +2 -32
- package/dist/rpc/CommandForm.js.map +1 -1
- package/dist/rpc/CommandOutput.cjs +2 -1
- package/dist/rpc/CommandOutput.cjs.map +1 -1
- package/dist/rpc/CommandOutput.d.ts.map +1 -1
- package/dist/rpc/CommandOutput.js +2 -1
- package/dist/rpc/CommandOutput.js.map +1 -1
- package/dist/rpc/EntityExplorerApp.cjs +28 -83
- package/dist/rpc/EntityExplorerApp.cjs.map +1 -1
- package/dist/rpc/EntityExplorerApp.d.ts +1 -4
- package/dist/rpc/EntityExplorerApp.d.ts.map +1 -1
- package/dist/rpc/EntityExplorerApp.js +13 -68
- package/dist/rpc/EntityExplorerApp.js.map +1 -1
- package/dist/rpc/OperationCatalog.cjs +2 -2
- package/dist/rpc/OperationCatalog.cjs.map +1 -1
- package/dist/rpc/OperationCatalog.d.ts +1 -1
- package/dist/rpc/OperationCatalog.d.ts.map +1 -1
- package/dist/rpc/OperationCatalog.js +1 -1
- package/dist/rpc/OperationCatalog.js.map +1 -1
- package/dist/rpc/OperationCommandPage.cjs +6 -4
- package/dist/rpc/OperationCommandPage.cjs.map +1 -1
- package/dist/rpc/OperationCommandPage.d.ts.map +1 -1
- package/dist/rpc/OperationCommandPage.js +3 -1
- package/dist/rpc/OperationCommandPage.js.map +1 -1
- package/dist/rpc/RouterProvider.cjs +10 -0
- package/dist/rpc/RouterProvider.cjs.map +1 -0
- package/dist/rpc/RouterProvider.d.ts +10 -0
- package/dist/rpc/RouterProvider.d.ts.map +1 -0
- package/dist/rpc/RouterProvider.js +10 -0
- package/dist/rpc/RouterProvider.js.map +1 -0
- package/dist/rpc/apiClient.cjs +4 -4
- package/dist/rpc/apiClient.cjs.map +1 -1
- package/dist/rpc/apiClient.js +4 -4
- package/dist/rpc/apiClient.js.map +1 -1
- package/dist/rpc/command-form-utils.cjs +43 -0
- package/dist/rpc/command-form-utils.cjs.map +1 -0
- package/dist/rpc/command-form-utils.d.ts +5 -0
- package/dist/rpc/command-form-utils.d.ts.map +1 -0
- package/dist/rpc/command-form-utils.js +43 -0
- package/dist/rpc/command-form-utils.js.map +1 -0
- package/dist/rpc/commandHref.cjs +62 -0
- package/dist/rpc/commandHref.cjs.map +1 -0
- package/dist/rpc/commandHref.d.ts +7 -0
- package/dist/rpc/commandHref.d.ts.map +1 -0
- package/dist/rpc/commandHref.js +62 -0
- package/dist/rpc/commandHref.js.map +1 -0
- package/dist/rpc/formMetadata.cjs +1 -1
- package/dist/rpc/formMetadata.cjs.map +1 -1
- package/dist/rpc/formMetadata.js +1 -1
- package/dist/rpc/formMetadata.js.map +1 -1
- package/dist/rpc/router.cjs +83 -0
- package/dist/rpc/router.cjs.map +1 -0
- package/dist/rpc/router.d.ts +24 -0
- package/dist/rpc/router.d.ts.map +1 -0
- package/dist/rpc/router.js +83 -0
- package/dist/rpc/router.js.map +1 -0
- package/dist/rpc/rpc-story-fixtures/orders.fixture.d.ts +3 -0
- package/dist/rpc/rpc-story-fixtures/orders.fixture.d.ts.map +1 -0
- package/dist/rpc/rpc-story-fixtures/services.fixture.d.ts +3 -0
- package/dist/rpc/rpc-story-fixtures/services.fixture.d.ts.map +1 -0
- package/dist/rpc/rpc-story-fixtures/surface-fixture.d.ts +24 -0
- package/dist/rpc/rpc-story-fixtures/surface-fixture.d.ts.map +1 -0
- package/dist/rpc/rpc-story-fixtures/widgets.fixture.d.ts +3 -0
- package/dist/rpc/rpc-story-fixtures/widgets.fixture.d.ts.map +1 -0
- package/dist/rpc/rpc-story.fixtures.d.ts +16 -0
- package/dist/rpc/rpc-story.fixtures.d.ts.map +1 -0
- package/dist/rpc.cjs +17 -0
- package/dist/rpc.cjs.map +1 -1
- package/dist/rpc.d.ts +5 -0
- package/dist/rpc.d.ts.map +1 -1
- package/dist/rpc.js +18 -1
- package/dist/rpc.js.map +1 -1
- package/dist/styles.cjs +1 -0
- package/dist/styles.cjs.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.d.ts.map +1 -1
- package/dist/styles.js +1 -0
- package/dist/styles.js.map +1 -1
- package/dist/tailwind-preset.cjs +36 -19
- package/dist/tailwind-preset.cjs.map +1 -1
- package/dist/tailwind-preset.d.ts.map +1 -1
- package/dist/tailwind-preset.js +36 -19
- package/dist/tailwind-preset.js.map +1 -1
- package/package.json +11 -1
|
@@ -14,12 +14,32 @@ function operationToTool(operation) {
|
|
|
14
14
|
if (!operation.operationId) {
|
|
15
15
|
return null;
|
|
16
16
|
}
|
|
17
|
+
const meta = operation["x-clicky"];
|
|
18
|
+
const description = operation.description ?? operation.summary;
|
|
17
19
|
return {
|
|
18
20
|
name: operation.operationId,
|
|
19
|
-
|
|
21
|
+
label: toolLabel(operation),
|
|
22
|
+
...(meta == null ? void 0 : meta.surface) ? { group: meta.surface } : {},
|
|
23
|
+
...description ? { description } : {},
|
|
20
24
|
inputSchema: buildInputSchema(operation)
|
|
21
25
|
};
|
|
22
26
|
}
|
|
27
|
+
function toolLabel(operation) {
|
|
28
|
+
var _a, _b;
|
|
29
|
+
const meta = operation["x-clicky"];
|
|
30
|
+
const short = ((_a = meta == null ? void 0 : meta.actionName) == null ? void 0 : _a.trim()) || ((_b = meta == null ? void 0 : meta.verb) == null ? void 0 : _b.trim());
|
|
31
|
+
if (short && short !== "action") {
|
|
32
|
+
return short.charAt(0).toUpperCase() + short.slice(1);
|
|
33
|
+
}
|
|
34
|
+
if (operation.summary) {
|
|
35
|
+
return operation.summary;
|
|
36
|
+
}
|
|
37
|
+
return humanize(operation.operationId ?? "");
|
|
38
|
+
}
|
|
39
|
+
function humanize(operationId) {
|
|
40
|
+
const spaced = operationId.replace(/[_-]+/g, " ").replace(/([a-z\d])([A-Z])/g, "$1 $2");
|
|
41
|
+
return spaced.charAt(0).toUpperCase() + spaced.slice(1);
|
|
42
|
+
}
|
|
23
43
|
function buildInputSchema(operation) {
|
|
24
44
|
const properties = {};
|
|
25
45
|
const required = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clickyOperationsToTools.cjs","sources":["../../../src/data/chat/clickyOperationsToTools.ts"],"sourcesContent":["import type {\n OpenAPIOperation,\n OpenAPIParameter,\n OpenAPISchema,\n ResolvedOperation,\n} from \"../../rpc/types\";\nimport type { ChatToolInputSchema,
|
|
1
|
+
{"version":3,"file":"clickyOperationsToTools.cjs","sources":["../../../src/data/chat/clickyOperationsToTools.ts"],"sourcesContent":["import type {\n OpenAPIOperation,\n OpenAPIParameter,\n OpenAPISchema,\n ResolvedOperation,\n} from \"../../rpc/types\";\nimport type { ChatToolInputSchema, JSONSchemaProperty, ToolMeta } from \"./types\";\n\n/** Converts a clicky RPC operation catalog into AI-tool metadata for display\n * and request scoping. Execution stays in the Go backend; this maps an\n * operation's `operationId` → tool name, a short `x-clicky` verb/action →\n * label, the `x-clicky` surface → group, `summary`/`description` → description,\n * and `parameters` + `requestBody` → a JSON-Schema input. Operations without an\n * `operationId` are skipped (a tool needs a stable name). */\nexport function clickyOperationsToTools(operations: ResolvedOperation[]): ToolMeta[] {\n const tools: ToolMeta[] = [];\n for (const resolved of operations) {\n const tool = operationToTool(resolved.operation);\n if (tool) {\n tools.push(tool);\n }\n }\n return tools;\n}\n\nexport function operationToTool(operation: OpenAPIOperation): ToolMeta | null {\n if (!operation.operationId) {\n return null;\n }\n const meta = operation[\"x-clicky\"];\n const description = operation.description ?? operation.summary;\n return {\n name: operation.operationId,\n label: toolLabel(operation),\n ...(meta?.surface ? { group: meta.surface } : {}),\n ...(description ? { description } : {}),\n inputSchema: buildInputSchema(operation),\n };\n}\n\n/** A concise popover label: the clicky action/verb (capitalized) when present,\n * else the operation summary, else a humanized operationId. Mirrors the intent\n * of rpc/clickyMetadata.ts `surfaceActionLabel`. */\nfunction toolLabel(operation: OpenAPIOperation): string {\n const meta = operation[\"x-clicky\"];\n const short = meta?.actionName?.trim() || meta?.verb?.trim();\n if (short && short !== \"action\") {\n return short.charAt(0).toUpperCase() + short.slice(1);\n }\n if (operation.summary) {\n return operation.summary;\n }\n return humanize(operation.operationId ?? \"\");\n}\n\nfunction humanize(operationId: string): string {\n const spaced = operationId.replace(/[_-]+/g, \" \").replace(/([a-z\\d])([A-Z])/g, \"$1 $2\");\n return spaced.charAt(0).toUpperCase() + spaced.slice(1);\n}\n\nfunction buildInputSchema(operation: OpenAPIOperation): ChatToolInputSchema {\n const properties: Record<string, JSONSchemaProperty> = {};\n const required: string[] = [];\n\n for (const param of operation.parameters ?? []) {\n properties[param.name] = parameterToProperty(param);\n if (param.required) {\n required.push(param.name);\n }\n }\n\n const body = requestBodySchema(operation);\n if (body?.properties) {\n for (const [name, schema] of Object.entries(body.properties)) {\n properties[name] = schemaToProperty(schema);\n }\n }\n\n return { type: \"object\", properties, required };\n}\n\nfunction parameterToProperty(param: OpenAPIParameter): JSONSchemaProperty {\n const prop = schemaToProperty(param.schema);\n if (param.description && !prop.description) {\n prop.description = param.description;\n }\n return prop;\n}\n\nfunction schemaToProperty(schema: OpenAPISchema | undefined): JSONSchemaProperty {\n if (!schema) {\n return { type: \"string\" };\n }\n const prop: JSONSchemaProperty = { type: schema.type ?? \"string\" };\n if (schema.description !== undefined) {\n prop.description = schema.description;\n }\n if (schema.enum !== undefined) {\n prop.enum = schema.enum;\n }\n if (schema.default !== undefined) {\n prop.default = schema.default;\n }\n return prop;\n}\n\nfunction requestBodySchema(operation: OpenAPIOperation): OpenAPISchema | undefined {\n const content = operation.requestBody?.content;\n if (!content) {\n return undefined;\n }\n return content[\"application/json\"]?.schema ?? Object.values(content)[0]?.schema;\n}\n"],"names":[],"mappings":";;AAcO,SAAS,wBAAwB,YAA6C;AACnF,QAAM,QAAoB,CAAA;AAC1B,aAAW,YAAY,YAAY;AACjC,UAAM,OAAO,gBAAgB,SAAS,SAAS;AAC/C,QAAI,MAAM;AACR,YAAM,KAAK,IAAI;AAAA,IACjB;AAAA,EACF;AACA,SAAO;AACT;AAEO,SAAS,gBAAgB,WAA8C;AAC5E,MAAI,CAAC,UAAU,aAAa;AAC1B,WAAO;AAAA,EACT;AACA,QAAM,OAAO,UAAU,UAAU;AACjC,QAAM,cAAc,UAAU,eAAe,UAAU;AACvD,SAAO;AAAA,IACL,MAAM,UAAU;AAAA,IAChB,OAAO,UAAU,SAAS;AAAA,IAC1B,IAAI,6BAAM,WAAU,EAAE,OAAO,KAAK,QAAA,IAAY,CAAA;AAAA,IAC9C,GAAI,cAAc,EAAE,YAAA,IAAgB,CAAA;AAAA,IACpC,aAAa,iBAAiB,SAAS;AAAA,EAAA;AAE3C;AAKA,SAAS,UAAU,WAAqC;;AACtD,QAAM,OAAO,UAAU,UAAU;AACjC,QAAM,UAAQ,kCAAM,eAAN,mBAAkB,aAAU,kCAAM,SAAN,mBAAY;AACtD,MAAI,SAAS,UAAU,UAAU;AAC/B,WAAO,MAAM,OAAO,CAAC,EAAE,gBAAgB,MAAM,MAAM,CAAC;AAAA,EACtD;AACA,MAAI,UAAU,SAAS;AACrB,WAAO,UAAU;AAAA,EACnB;AACA,SAAO,SAAS,UAAU,eAAe,EAAE;AAC7C;AAEA,SAAS,SAAS,aAA6B;AAC7C,QAAM,SAAS,YAAY,QAAQ,UAAU,GAAG,EAAE,QAAQ,qBAAqB,OAAO;AACtF,SAAO,OAAO,OAAO,CAAC,EAAE,gBAAgB,OAAO,MAAM,CAAC;AACxD;AAEA,SAAS,iBAAiB,WAAkD;AAC1E,QAAM,aAAiD,CAAA;AACvD,QAAM,WAAqB,CAAA;AAE3B,aAAW,SAAS,UAAU,cAAc,CAAA,GAAI;AAC9C,eAAW,MAAM,IAAI,IAAI,oBAAoB,KAAK;AAClD,QAAI,MAAM,UAAU;AAClB,eAAS,KAAK,MAAM,IAAI;AAAA,IAC1B;AAAA,EACF;AAEA,QAAM,OAAO,kBAAkB,SAAS;AACxC,MAAI,6BAAM,YAAY;AACpB,eAAW,CAAC,MAAM,MAAM,KAAK,OAAO,QAAQ,KAAK,UAAU,GAAG;AAC5D,iBAAW,IAAI,IAAI,iBAAiB,MAAM;AAAA,IAC5C;AAAA,EACF;AAEA,SAAO,EAAE,MAAM,UAAU,YAAY,SAAA;AACvC;AAEA,SAAS,oBAAoB,OAA6C;AACxE,QAAM,OAAO,iBAAiB,MAAM,MAAM;AAC1C,MAAI,MAAM,eAAe,CAAC,KAAK,aAAa;AAC1C,SAAK,cAAc,MAAM;AAAA,EAC3B;AACA,SAAO;AACT;AAEA,SAAS,iBAAiB,QAAuD;AAC/E,MAAI,CAAC,QAAQ;AACX,WAAO,EAAE,MAAM,SAAA;AAAA,EACjB;AACA,QAAM,OAA2B,EAAE,MAAM,OAAO,QAAQ,SAAA;AACxD,MAAI,OAAO,gBAAgB,QAAW;AACpC,SAAK,cAAc,OAAO;AAAA,EAC5B;AACA,MAAI,OAAO,SAAS,QAAW;AAC7B,SAAK,OAAO,OAAO;AAAA,EACrB;AACA,MAAI,OAAO,YAAY,QAAW;AAChC,SAAK,UAAU,OAAO;AAAA,EACxB;AACA,SAAO;AACT;AAEA,SAAS,kBAAkB,WAAwD;;AACjF,QAAM,WAAU,eAAU,gBAAV,mBAAuB;AACvC,MAAI,CAAC,SAAS;AACZ,WAAO;AAAA,EACT;AACA,WAAO,aAAQ,kBAAkB,MAA1B,mBAA6B,aAAU,YAAO,OAAO,OAAO,EAAE,CAAC,MAAxB,mBAA2B;AAC3E;;;"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { OpenAPIOperation, ResolvedOperation } from '../../rpc/types';
|
|
2
|
-
import {
|
|
2
|
+
import { ToolMeta } from './types';
|
|
3
3
|
/** Converts a clicky RPC operation catalog into AI-tool metadata for display
|
|
4
4
|
* and request scoping. Execution stays in the Go backend; this maps an
|
|
5
|
-
* operation's `operationId` → tool name, `
|
|
5
|
+
* operation's `operationId` → tool name, a short `x-clicky` verb/action →
|
|
6
|
+
* label, the `x-clicky` surface → group, `summary`/`description` → description,
|
|
6
7
|
* and `parameters` + `requestBody` → a JSON-Schema input. Operations without an
|
|
7
8
|
* `operationId` are skipped (a tool needs a stable name). */
|
|
8
|
-
export declare function clickyOperationsToTools(operations: ResolvedOperation[]):
|
|
9
|
-
export declare function operationToTool(operation: OpenAPIOperation):
|
|
9
|
+
export declare function clickyOperationsToTools(operations: ResolvedOperation[]): ToolMeta[];
|
|
10
|
+
export declare function operationToTool(operation: OpenAPIOperation): ToolMeta | null;
|
|
10
11
|
//# sourceMappingURL=clickyOperationsToTools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clickyOperationsToTools.d.ts","sourceRoot":"","sources":["../../../src/data/chat/clickyOperationsToTools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAGhB,iBAAiB,EAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"clickyOperationsToTools.d.ts","sourceRoot":"","sources":["../../../src/data/chat/clickyOperationsToTools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAGhB,iBAAiB,EAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAA2C,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEjF;;;;;8DAK8D;AAC9D,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,iBAAiB,EAAE,GAAG,QAAQ,EAAE,CASnF;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,gBAAgB,GAAG,QAAQ,GAAG,IAAI,CAa5E"}
|
|
@@ -12,12 +12,32 @@ function operationToTool(operation) {
|
|
|
12
12
|
if (!operation.operationId) {
|
|
13
13
|
return null;
|
|
14
14
|
}
|
|
15
|
+
const meta = operation["x-clicky"];
|
|
16
|
+
const description = operation.description ?? operation.summary;
|
|
15
17
|
return {
|
|
16
18
|
name: operation.operationId,
|
|
17
|
-
|
|
19
|
+
label: toolLabel(operation),
|
|
20
|
+
...(meta == null ? void 0 : meta.surface) ? { group: meta.surface } : {},
|
|
21
|
+
...description ? { description } : {},
|
|
18
22
|
inputSchema: buildInputSchema(operation)
|
|
19
23
|
};
|
|
20
24
|
}
|
|
25
|
+
function toolLabel(operation) {
|
|
26
|
+
var _a, _b;
|
|
27
|
+
const meta = operation["x-clicky"];
|
|
28
|
+
const short = ((_a = meta == null ? void 0 : meta.actionName) == null ? void 0 : _a.trim()) || ((_b = meta == null ? void 0 : meta.verb) == null ? void 0 : _b.trim());
|
|
29
|
+
if (short && short !== "action") {
|
|
30
|
+
return short.charAt(0).toUpperCase() + short.slice(1);
|
|
31
|
+
}
|
|
32
|
+
if (operation.summary) {
|
|
33
|
+
return operation.summary;
|
|
34
|
+
}
|
|
35
|
+
return humanize(operation.operationId ?? "");
|
|
36
|
+
}
|
|
37
|
+
function humanize(operationId) {
|
|
38
|
+
const spaced = operationId.replace(/[_-]+/g, " ").replace(/([a-z\d])([A-Z])/g, "$1 $2");
|
|
39
|
+
return spaced.charAt(0).toUpperCase() + spaced.slice(1);
|
|
40
|
+
}
|
|
21
41
|
function buildInputSchema(operation) {
|
|
22
42
|
const properties = {};
|
|
23
43
|
const required = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clickyOperationsToTools.js","sources":["../../../src/data/chat/clickyOperationsToTools.ts"],"sourcesContent":["import type {\n OpenAPIOperation,\n OpenAPIParameter,\n OpenAPISchema,\n ResolvedOperation,\n} from \"../../rpc/types\";\nimport type { ChatToolInputSchema,
|
|
1
|
+
{"version":3,"file":"clickyOperationsToTools.js","sources":["../../../src/data/chat/clickyOperationsToTools.ts"],"sourcesContent":["import type {\n OpenAPIOperation,\n OpenAPIParameter,\n OpenAPISchema,\n ResolvedOperation,\n} from \"../../rpc/types\";\nimport type { ChatToolInputSchema, JSONSchemaProperty, ToolMeta } from \"./types\";\n\n/** Converts a clicky RPC operation catalog into AI-tool metadata for display\n * and request scoping. Execution stays in the Go backend; this maps an\n * operation's `operationId` → tool name, a short `x-clicky` verb/action →\n * label, the `x-clicky` surface → group, `summary`/`description` → description,\n * and `parameters` + `requestBody` → a JSON-Schema input. Operations without an\n * `operationId` are skipped (a tool needs a stable name). */\nexport function clickyOperationsToTools(operations: ResolvedOperation[]): ToolMeta[] {\n const tools: ToolMeta[] = [];\n for (const resolved of operations) {\n const tool = operationToTool(resolved.operation);\n if (tool) {\n tools.push(tool);\n }\n }\n return tools;\n}\n\nexport function operationToTool(operation: OpenAPIOperation): ToolMeta | null {\n if (!operation.operationId) {\n return null;\n }\n const meta = operation[\"x-clicky\"];\n const description = operation.description ?? operation.summary;\n return {\n name: operation.operationId,\n label: toolLabel(operation),\n ...(meta?.surface ? { group: meta.surface } : {}),\n ...(description ? { description } : {}),\n inputSchema: buildInputSchema(operation),\n };\n}\n\n/** A concise popover label: the clicky action/verb (capitalized) when present,\n * else the operation summary, else a humanized operationId. Mirrors the intent\n * of rpc/clickyMetadata.ts `surfaceActionLabel`. */\nfunction toolLabel(operation: OpenAPIOperation): string {\n const meta = operation[\"x-clicky\"];\n const short = meta?.actionName?.trim() || meta?.verb?.trim();\n if (short && short !== \"action\") {\n return short.charAt(0).toUpperCase() + short.slice(1);\n }\n if (operation.summary) {\n return operation.summary;\n }\n return humanize(operation.operationId ?? \"\");\n}\n\nfunction humanize(operationId: string): string {\n const spaced = operationId.replace(/[_-]+/g, \" \").replace(/([a-z\\d])([A-Z])/g, \"$1 $2\");\n return spaced.charAt(0).toUpperCase() + spaced.slice(1);\n}\n\nfunction buildInputSchema(operation: OpenAPIOperation): ChatToolInputSchema {\n const properties: Record<string, JSONSchemaProperty> = {};\n const required: string[] = [];\n\n for (const param of operation.parameters ?? []) {\n properties[param.name] = parameterToProperty(param);\n if (param.required) {\n required.push(param.name);\n }\n }\n\n const body = requestBodySchema(operation);\n if (body?.properties) {\n for (const [name, schema] of Object.entries(body.properties)) {\n properties[name] = schemaToProperty(schema);\n }\n }\n\n return { type: \"object\", properties, required };\n}\n\nfunction parameterToProperty(param: OpenAPIParameter): JSONSchemaProperty {\n const prop = schemaToProperty(param.schema);\n if (param.description && !prop.description) {\n prop.description = param.description;\n }\n return prop;\n}\n\nfunction schemaToProperty(schema: OpenAPISchema | undefined): JSONSchemaProperty {\n if (!schema) {\n return { type: \"string\" };\n }\n const prop: JSONSchemaProperty = { type: schema.type ?? \"string\" };\n if (schema.description !== undefined) {\n prop.description = schema.description;\n }\n if (schema.enum !== undefined) {\n prop.enum = schema.enum;\n }\n if (schema.default !== undefined) {\n prop.default = schema.default;\n }\n return prop;\n}\n\nfunction requestBodySchema(operation: OpenAPIOperation): OpenAPISchema | undefined {\n const content = operation.requestBody?.content;\n if (!content) {\n return undefined;\n }\n return content[\"application/json\"]?.schema ?? Object.values(content)[0]?.schema;\n}\n"],"names":[],"mappings":"AAcO,SAAS,wBAAwB,YAA6C;AACnF,QAAM,QAAoB,CAAA;AAC1B,aAAW,YAAY,YAAY;AACjC,UAAM,OAAO,gBAAgB,SAAS,SAAS;AAC/C,QAAI,MAAM;AACR,YAAM,KAAK,IAAI;AAAA,IACjB;AAAA,EACF;AACA,SAAO;AACT;AAEO,SAAS,gBAAgB,WAA8C;AAC5E,MAAI,CAAC,UAAU,aAAa;AAC1B,WAAO;AAAA,EACT;AACA,QAAM,OAAO,UAAU,UAAU;AACjC,QAAM,cAAc,UAAU,eAAe,UAAU;AACvD,SAAO;AAAA,IACL,MAAM,UAAU;AAAA,IAChB,OAAO,UAAU,SAAS;AAAA,IAC1B,IAAI,6BAAM,WAAU,EAAE,OAAO,KAAK,QAAA,IAAY,CAAA;AAAA,IAC9C,GAAI,cAAc,EAAE,YAAA,IAAgB,CAAA;AAAA,IACpC,aAAa,iBAAiB,SAAS;AAAA,EAAA;AAE3C;AAKA,SAAS,UAAU,WAAqC;AA7BjD;AA8BL,QAAM,OAAO,UAAU,UAAU;AACjC,QAAM,UAAQ,kCAAM,eAAN,mBAAkB,aAAU,kCAAM,SAAN,mBAAY;AACtD,MAAI,SAAS,UAAU,UAAU;AAC/B,WAAO,MAAM,OAAO,CAAC,EAAE,gBAAgB,MAAM,MAAM,CAAC;AAAA,EACtD;AACA,MAAI,UAAU,SAAS;AACrB,WAAO,UAAU;AAAA,EACnB;AACA,SAAO,SAAS,UAAU,eAAe,EAAE;AAC7C;AAEA,SAAS,SAAS,aAA6B;AAC7C,QAAM,SAAS,YAAY,QAAQ,UAAU,GAAG,EAAE,QAAQ,qBAAqB,OAAO;AACtF,SAAO,OAAO,OAAO,CAAC,EAAE,gBAAgB,OAAO,MAAM,CAAC;AACxD;AAEA,SAAS,iBAAiB,WAAkD;AAC1E,QAAM,aAAiD,CAAA;AACvD,QAAM,WAAqB,CAAA;AAE3B,aAAW,SAAS,UAAU,cAAc,CAAA,GAAI;AAC9C,eAAW,MAAM,IAAI,IAAI,oBAAoB,KAAK;AAClD,QAAI,MAAM,UAAU;AAClB,eAAS,KAAK,MAAM,IAAI;AAAA,IAC1B;AAAA,EACF;AAEA,QAAM,OAAO,kBAAkB,SAAS;AACxC,MAAI,6BAAM,YAAY;AACpB,eAAW,CAAC,MAAM,MAAM,KAAK,OAAO,QAAQ,KAAK,UAAU,GAAG;AAC5D,iBAAW,IAAI,IAAI,iBAAiB,MAAM;AAAA,IAC5C;AAAA,EACF;AAEA,SAAO,EAAE,MAAM,UAAU,YAAY,SAAA;AACvC;AAEA,SAAS,oBAAoB,OAA6C;AACxE,QAAM,OAAO,iBAAiB,MAAM,MAAM;AAC1C,MAAI,MAAM,eAAe,CAAC,KAAK,aAAa;AAC1C,SAAK,cAAc,MAAM;AAAA,EAC3B;AACA,SAAO;AACT;AAEA,SAAS,iBAAiB,QAAuD;AAC/E,MAAI,CAAC,QAAQ;AACX,WAAO,EAAE,MAAM,SAAA;AAAA,EACjB;AACA,QAAM,OAA2B,EAAE,MAAM,OAAO,QAAQ,SAAA;AACxD,MAAI,OAAO,gBAAgB,QAAW;AACpC,SAAK,cAAc,OAAO;AAAA,EAC5B;AACA,MAAI,OAAO,SAAS,QAAW;AAC7B,SAAK,OAAO,OAAO;AAAA,EACrB;AACA,MAAI,OAAO,YAAY,QAAW;AAChC,SAAK,UAAU,OAAO;AAAA,EACxB;AACA,SAAO;AACT;AAEA,SAAS,kBAAkB,WAAwD;AA5F5E;AA6FL,QAAM,WAAU,eAAU,gBAAV,mBAAuB;AACvC,MAAI,CAAC,SAAS;AACZ,WAAO;AAAA,EACT;AACA,WAAO,aAAQ,kBAAkB,MAA1B,mBAA6B,aAAU,YAAO,OAAO,OAAO,EAAE,CAAC,MAAxB,mBAA2B;AAC3E;"}
|
|
@@ -7,7 +7,10 @@ export { PromptInput, type PromptInputProps } from './PromptInput';
|
|
|
7
7
|
export { ToolCall, type ToolCallProps } from './ToolCall';
|
|
8
8
|
export { Suggestions, type SuggestionsProps } from './Suggestion';
|
|
9
9
|
export { ModelSelector, type ModelSelectorProps, EffortSelector, type EffortSelectorProps, } from './ModelSelector';
|
|
10
|
+
export { providerIcon, type ProviderGlyph } from './provider-icons';
|
|
11
|
+
export { ContextUsage, type ContextUsageProps } from './ContextUsage';
|
|
10
12
|
export { AttachmentButton, type AttachmentButtonProps, AttachmentList, type AttachmentListProps, } from './Attachment';
|
|
11
13
|
export { clickyOperationsToTools, operationToTool, } from './clickyOperationsToTools';
|
|
12
|
-
export {
|
|
14
|
+
export { mockChatTransport, MOCK_MODELS } from './Chat.fixtures';
|
|
15
|
+
export { isDynamicToolPart, isTypedToolPart, isReasoningPart, isFilePart, toolPartName, suggestionLabel, suggestionPrompt, type AnyToolPart, type ChatModel, type ChatMessageMetadata, type ChatUsageSummary, type ChatStatus, type ChatToolInputSchema, type ToolMeta, type DynamicToolUIPart, type FileUIPart, type JSONSchemaProperty, type ReasoningUIPart, type Suggestion, type ToolUIPart, type UIMessage, } from './types';
|
|
13
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data/chat/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,qBAAqB,EAAE,MAAM,WAAW,CAAC;AACnF,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EACL,aAAa,EACb,KAAK,kBAAkB,EACvB,cAAc,EACd,KAAK,mBAAmB,GACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,gBAAgB,EAChB,KAAK,qBAAqB,EAC1B,cAAc,EACd,KAAK,mBAAmB,GACzB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,uBAAuB,EACvB,eAAe,GAChB,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data/chat/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,qBAAqB,EAAE,MAAM,WAAW,CAAC;AACnF,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EACL,aAAa,EACb,KAAK,kBAAkB,EACvB,cAAc,EACd,KAAK,mBAAmB,GACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EACL,gBAAgB,EAChB,KAAK,qBAAqB,EAC1B,cAAc,EACd,KAAK,mBAAmB,GACzB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,uBAAuB,EACvB,eAAe,GAChB,MAAM,2BAA2B,CAAC;AAInC,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEjE,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,UAAU,EACV,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,mBAAmB,EACxB,KAAK,QAAQ,EACb,KAAK,iBAAiB,EACtB,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,SAAS,GACf,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const mi = require("@flanksource/icons/mi");
|
|
4
|
+
const PROVIDER_ICONS = {
|
|
5
|
+
anthropic: mi.Anthropic,
|
|
6
|
+
openai: mi.Openai,
|
|
7
|
+
google: mi.Google,
|
|
8
|
+
googleai: mi.Gemini,
|
|
9
|
+
gemini: mi.Gemini
|
|
10
|
+
};
|
|
11
|
+
function providerIcon(provider) {
|
|
12
|
+
return provider ? PROVIDER_ICONS[provider.toLowerCase()] : void 0;
|
|
13
|
+
}
|
|
14
|
+
exports.providerIcon = providerIcon;
|
|
15
|
+
//# sourceMappingURL=provider-icons.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider-icons.cjs","sources":["../../../src/data/chat/provider-icons.ts"],"sourcesContent":["import type { ComponentType } from \"react\";\nimport { Anthropic, Gemini, Google, Openai } from \"@flanksource/icons/mi\";\n\nexport type ProviderGlyph = ComponentType<{ className?: string }>;\n\n// Maps a backend provider id to its brand glyph. googleai surfaces as the Gemini\n// mark (the model family), plain google as the Google mark.\nconst PROVIDER_ICONS: Record<string, ProviderGlyph> = {\n anthropic: Anthropic,\n openai: Openai,\n google: Google,\n googleai: Gemini,\n gemini: Gemini,\n};\n\n/** The brand glyph for a chat model's provider, or undefined when unknown. */\nexport function providerIcon(provider?: string): ProviderGlyph | undefined {\n return provider ? PROVIDER_ICONS[provider.toLowerCase()] : undefined;\n}\n"],"names":["Anthropic","Openai","Google","Gemini"],"mappings":";;;AAOA,MAAM,iBAAgD;AAAA,EACpD,WAAWA,GAAAA;AAAAA,EACX,QAAQC,GAAAA;AAAAA,EACR,QAAQC,GAAAA;AAAAA,EACR,UAAUC,GAAAA;AAAAA,EACV,QAAQA,GAAAA;AACV;AAGO,SAAS,aAAa,UAA8C;AACzE,SAAO,WAAW,eAAe,SAAS,YAAA,CAAa,IAAI;AAC7D;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
export type ProviderGlyph = ComponentType<{
|
|
3
|
+
className?: string;
|
|
4
|
+
}>;
|
|
5
|
+
/** The brand glyph for a chat model's provider, or undefined when unknown. */
|
|
6
|
+
export declare function providerIcon(provider?: string): ProviderGlyph | undefined;
|
|
7
|
+
//# sourceMappingURL=provider-icons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider-icons.d.ts","sourceRoot":"","sources":["../../../src/data/chat/provider-icons.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAG3C,MAAM,MAAM,aAAa,GAAG,aAAa,CAAC;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAYlE,8EAA8E;AAC9E,wBAAgB,YAAY,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAEzE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Gemini, Google, Openai, Anthropic } from "@flanksource/icons/mi";
|
|
2
|
+
const PROVIDER_ICONS = {
|
|
3
|
+
anthropic: Anthropic,
|
|
4
|
+
openai: Openai,
|
|
5
|
+
google: Google,
|
|
6
|
+
googleai: Gemini,
|
|
7
|
+
gemini: Gemini
|
|
8
|
+
};
|
|
9
|
+
function providerIcon(provider) {
|
|
10
|
+
return provider ? PROVIDER_ICONS[provider.toLowerCase()] : void 0;
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
providerIcon
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=provider-icons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider-icons.js","sources":["../../../src/data/chat/provider-icons.ts"],"sourcesContent":["import type { ComponentType } from \"react\";\nimport { Anthropic, Gemini, Google, Openai } from \"@flanksource/icons/mi\";\n\nexport type ProviderGlyph = ComponentType<{ className?: string }>;\n\n// Maps a backend provider id to its brand glyph. googleai surfaces as the Gemini\n// mark (the model family), plain google as the Google mark.\nconst PROVIDER_ICONS: Record<string, ProviderGlyph> = {\n anthropic: Anthropic,\n openai: Openai,\n google: Google,\n googleai: Gemini,\n gemini: Gemini,\n};\n\n/** The brand glyph for a chat model's provider, or undefined when unknown. */\nexport function providerIcon(provider?: string): ProviderGlyph | undefined {\n return provider ? PROVIDER_ICONS[provider.toLowerCase()] : undefined;\n}\n"],"names":[],"mappings":";AAOA,MAAM,iBAAgD;AAAA,EACpD,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,QAAQ;AACV;AAGO,SAAS,aAAa,UAA8C;AACzE,SAAO,WAAW,eAAe,SAAS,YAAA,CAAa,IAAI;AAC7D;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.cjs","sources":["../../../src/data/chat/types.ts"],"sourcesContent":["import type {\n UIMessage,\n ToolUIPart,\n DynamicToolUIPart,\n ChatStatus,\n ReasoningUIPart,\n FileUIPart,\n} from \"ai\";\n\nexport type { UIMessage, ToolUIPart, DynamicToolUIPart, ChatStatus, ReasoningUIPart, FileUIPart };\n\n/** A selectable chat model, as served by the backend's GET /api/chat/models.\n * `configured` is false for catalogued models whose provider has no API key. */\nexport interface ChatModel {\n id: string;\n provider: string;\n label: string;\n reasoning: boolean;\n configured?: boolean;\n}\n\n/** A suggested prompt shown on the empty state. A bare string is both the label\n * and the submitted text; the object form separates them. */\nexport type Suggestion = string | { label: string; prompt: string };\n\n/** The label shown for a suggestion. */\nexport function suggestionLabel(s: Suggestion): string {\n return typeof s === \"string\" ? s : s.label;\n}\n\n/** The text submitted when a suggestion is clicked. */\nexport function suggestionPrompt(s: Suggestion): string {\n return typeof s === \"string\" ? s : s.prompt;\n}\n\n/** Returns true for an assistant reasoning (\"thinking\") part. */\nexport function isReasoningPart(part: { type: string }): part is ReasoningUIPart {\n return part.type === \"reasoning\";\n}\n\n/** Returns true for a file/attachment part. */\nexport function isFilePart(part: { type: string }): part is FileUIPart {\n return part.type === \"file\";\n}\n\n/** A tool part as it appears in an assistant UIMessage — either a typed\n * `tool-<name>` part or the generic `dynamic-tool` part. clicky operations\n * surface as dynamic tools, so the chat UI renders both shapes. */\nexport type AnyToolPart = ToolUIPart | DynamicToolUIPart;\n\n/**
|
|
1
|
+
{"version":3,"file":"types.cjs","sources":["../../../src/data/chat/types.ts"],"sourcesContent":["import type {\n UIMessage,\n ToolUIPart,\n DynamicToolUIPart,\n ChatStatus,\n ReasoningUIPart,\n FileUIPart,\n} from \"ai\";\n\nexport type { UIMessage, ToolUIPart, DynamicToolUIPart, ChatStatus, ReasoningUIPart, FileUIPart };\n\n/** A selectable chat model, as served by the backend's GET /api/chat/models.\n * `configured` is false for catalogued models whose provider has no API key. */\nexport interface ChatModel {\n id: string;\n provider: string;\n label: string;\n reasoning: boolean;\n configured?: boolean;\n /** Max context tokens — the denominator for a usage gauge. */\n contextWindow?: number;\n}\n\n/** Per-message metadata the backend rides on the SSE `finish` part\n * (`messageMetadata`), applied by the AI SDK to the assistant `UIMessage`. */\nexport interface ChatMessageMetadata {\n usage?: {\n inputTokens?: number;\n outputTokens?: number;\n totalTokens?: number;\n };\n /** This turn's cost in USD. */\n cost?: number;\n /** Cumulative thread cost in USD (when the turn is persisted to a thread). */\n threadCostUsd?: number;\n /** This turn's input-token count, ≈ current context-window occupancy. */\n contextTokens?: number;\n}\n\n/** A flattened usage snapshot a chat surfaces for a gauge: tokens used out of the\n * model's context window, plus cumulative cost. */\nexport interface ChatUsageSummary {\n usedTokens: number;\n maxTokens: number;\n cost?: number;\n messageCount: number;\n modelLabel?: string;\n}\n\n/** A suggested prompt shown on the empty state. A bare string is both the label\n * and the submitted text; the object form separates them. */\nexport type Suggestion = string | { label: string; prompt: string };\n\n/** The label shown for a suggestion. */\nexport function suggestionLabel(s: Suggestion): string {\n return typeof s === \"string\" ? s : s.label;\n}\n\n/** The text submitted when a suggestion is clicked. */\nexport function suggestionPrompt(s: Suggestion): string {\n return typeof s === \"string\" ? s : s.prompt;\n}\n\n/** Returns true for an assistant reasoning (\"thinking\") part. */\nexport function isReasoningPart(part: { type: string }): part is ReasoningUIPart {\n return part.type === \"reasoning\";\n}\n\n/** Returns true for a file/attachment part. */\nexport function isFilePart(part: { type: string }): part is FileUIPart {\n return part.type === \"file\";\n}\n\n/** A tool part as it appears in an assistant UIMessage — either a typed\n * `tool-<name>` part or the generic `dynamic-tool` part. clicky operations\n * surface as dynamic tools, so the chat UI renders both shapes. */\nexport type AnyToolPart = ToolUIPart | DynamicToolUIPart;\n\n/** Tool metadata shared by the chat shell. It both configures the\n * tool-preferences popover (`name`/`label`/`group`) and carries the schema\n * derived from a clicky RPC operation (`description`/`inputSchema`). The Go\n * backend owns execution; the client uses this only for display and to scope\n * which tools a request may call (passed in the transport `body`). */\nexport interface ToolMeta {\n /** Stable tool name sent to the model (the operation id). */\n name: string;\n /** Human-readable label shown in the tool-preferences popover. */\n label: string;\n /** Bucket heading in the popover — the clicky surface for RPC operations. */\n group?: string;\n /** Description shown in tool pickers / tool-call headers. */\n description?: string;\n /** JSON-Schema for the tool's input, assembled from an operation's\n * parameters + request body. Omitted for hand-authored tools. */\n inputSchema?: ChatToolInputSchema;\n}\n\nexport interface ChatToolInputSchema {\n type: \"object\";\n properties: Record<string, JSONSchemaProperty>;\n required: string[];\n}\n\nexport interface JSONSchemaProperty {\n type?: string;\n description?: string;\n enum?: unknown[];\n default?: unknown;\n}\n\n/** Returns true for a `dynamic-tool` part (clicky operations surface this way). */\nexport function isDynamicToolPart(part: { type: string }): part is DynamicToolUIPart {\n return part.type === \"dynamic-tool\";\n}\n\n/** Returns true for a typed `tool-<name>` part. */\nexport function isTypedToolPart(part: { type: string }): part is ToolUIPart {\n return part.type.startsWith(\"tool-\");\n}\n\n/** The display name of a tool part: the explicit `toolName` for dynamic tools,\n * otherwise the suffix after `tool-`. */\nexport function toolPartName(part: AnyToolPart): string {\n if (isDynamicToolPart(part)) {\n return part.toolName;\n }\n return part.type.slice(\"tool-\".length);\n}\n"],"names":[],"mappings":";;AAsDO,SAAS,gBAAgB,GAAuB;AACrD,SAAO,OAAO,MAAM,WAAW,IAAI,EAAE;AACvC;AAGO,SAAS,iBAAiB,GAAuB;AACtD,SAAO,OAAO,MAAM,WAAW,IAAI,EAAE;AACvC;AAGO,SAAS,gBAAgB,MAAiD;AAC/E,SAAO,KAAK,SAAS;AACvB;AAGO,SAAS,WAAW,MAA4C;AACrE,SAAO,KAAK,SAAS;AACvB;AAwCO,SAAS,kBAAkB,MAAmD;AACnF,SAAO,KAAK,SAAS;AACvB;AAGO,SAAS,gBAAgB,MAA4C;AAC1E,SAAO,KAAK,KAAK,WAAW,OAAO;AACrC;AAIO,SAAS,aAAa,MAA2B;AACtD,MAAI,kBAAkB,IAAI,GAAG;AAC3B,WAAO,KAAK;AAAA,EACd;AACA,SAAO,KAAK,KAAK,MAAM,QAAQ,MAAM;AACvC;;;;;;;;"}
|
|
@@ -8,6 +8,32 @@ export interface ChatModel {
|
|
|
8
8
|
label: string;
|
|
9
9
|
reasoning: boolean;
|
|
10
10
|
configured?: boolean;
|
|
11
|
+
/** Max context tokens — the denominator for a usage gauge. */
|
|
12
|
+
contextWindow?: number;
|
|
13
|
+
}
|
|
14
|
+
/** Per-message metadata the backend rides on the SSE `finish` part
|
|
15
|
+
* (`messageMetadata`), applied by the AI SDK to the assistant `UIMessage`. */
|
|
16
|
+
export interface ChatMessageMetadata {
|
|
17
|
+
usage?: {
|
|
18
|
+
inputTokens?: number;
|
|
19
|
+
outputTokens?: number;
|
|
20
|
+
totalTokens?: number;
|
|
21
|
+
};
|
|
22
|
+
/** This turn's cost in USD. */
|
|
23
|
+
cost?: number;
|
|
24
|
+
/** Cumulative thread cost in USD (when the turn is persisted to a thread). */
|
|
25
|
+
threadCostUsd?: number;
|
|
26
|
+
/** This turn's input-token count, ≈ current context-window occupancy. */
|
|
27
|
+
contextTokens?: number;
|
|
28
|
+
}
|
|
29
|
+
/** A flattened usage snapshot a chat surfaces for a gauge: tokens used out of the
|
|
30
|
+
* model's context window, plus cumulative cost. */
|
|
31
|
+
export interface ChatUsageSummary {
|
|
32
|
+
usedTokens: number;
|
|
33
|
+
maxTokens: number;
|
|
34
|
+
cost?: number;
|
|
35
|
+
messageCount: number;
|
|
36
|
+
modelLabel?: string;
|
|
11
37
|
}
|
|
12
38
|
/** A suggested prompt shown on the empty state. A bare string is both the label
|
|
13
39
|
* and the submitted text; the object form separates them. */
|
|
@@ -31,17 +57,23 @@ export declare function isFilePart(part: {
|
|
|
31
57
|
* `tool-<name>` part or the generic `dynamic-tool` part. clicky operations
|
|
32
58
|
* surface as dynamic tools, so the chat UI renders both shapes. */
|
|
33
59
|
export type AnyToolPart = ToolUIPart | DynamicToolUIPart;
|
|
34
|
-
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
|
|
60
|
+
/** Tool metadata shared by the chat shell. It both configures the
|
|
61
|
+
* tool-preferences popover (`name`/`label`/`group`) and carries the schema
|
|
62
|
+
* derived from a clicky RPC operation (`description`/`inputSchema`). The Go
|
|
63
|
+
* backend owns execution; the client uses this only for display and to scope
|
|
64
|
+
* which tools a request may call (passed in the transport `body`). */
|
|
65
|
+
export interface ToolMeta {
|
|
38
66
|
/** Stable tool name sent to the model (the operation id). */
|
|
39
67
|
name: string;
|
|
40
|
-
/** Human-readable
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
|
|
44
|
-
|
|
68
|
+
/** Human-readable label shown in the tool-preferences popover. */
|
|
69
|
+
label: string;
|
|
70
|
+
/** Bucket heading in the popover — the clicky surface for RPC operations. */
|
|
71
|
+
group?: string;
|
|
72
|
+
/** Description shown in tool pickers / tool-call headers. */
|
|
73
|
+
description?: string;
|
|
74
|
+
/** JSON-Schema for the tool's input, assembled from an operation's
|
|
75
|
+
* parameters + request body. Omitted for hand-authored tools. */
|
|
76
|
+
inputSchema?: ChatToolInputSchema;
|
|
45
77
|
}
|
|
46
78
|
export interface ChatToolInputSchema {
|
|
47
79
|
type: "object";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/data/chat/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,UAAU,EACV,eAAe,EACf,UAAU,EACX,MAAM,IAAI,CAAC;AAEZ,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,iBAAiB,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,CAAC;AAElG;iFACiF;AACjF,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/data/chat/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,UAAU,EACV,eAAe,EACf,UAAU,EACX,MAAM,IAAI,CAAC;AAEZ,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,iBAAiB,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,CAAC;AAElG;iFACiF;AACjF,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,8DAA8D;IAC9D,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;+EAC+E;AAC/E,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE;QACN,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,+BAA+B;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8EAA8E;IAC9E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,yEAAyE;IACzE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;oDACoD;AACpD,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;8DAC8D;AAC9D,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpE,wCAAwC;AACxC,wBAAgB,eAAe,CAAC,CAAC,EAAE,UAAU,GAAG,MAAM,CAErD;AAED,uDAAuD;AACvD,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,UAAU,GAAG,MAAM,CAEtD;AAED,iEAAiE;AACjE,wBAAgB,eAAe,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,IAAI,eAAe,CAE/E;AAED,+CAA+C;AAC/C,wBAAgB,UAAU,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,IAAI,UAAU,CAErE;AAED;;oEAEoE;AACpE,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,iBAAiB,CAAC;AAEzD;;;;uEAIuE;AACvE,MAAM,WAAW,QAAQ;IACvB,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,kEAAkE;IAClE,KAAK,EAAE,MAAM,CAAC;IACd,6EAA6E;IAC7E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6DAA6D;IAC7D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;sEACkE;IAClE,WAAW,CAAC,EAAE,mBAAmB,CAAC;CACnC;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,QAAQ,CAAC;IACf,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IAC/C,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,mFAAmF;AACnF,wBAAgB,iBAAiB,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,IAAI,iBAAiB,CAEnF;AAED,mDAAmD;AACnD,wBAAgB,eAAe,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,IAAI,UAAU,CAE1E;AAED;0CAC0C;AAC1C,wBAAgB,YAAY,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAKtD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../../../src/data/chat/types.ts"],"sourcesContent":["import type {\n UIMessage,\n ToolUIPart,\n DynamicToolUIPart,\n ChatStatus,\n ReasoningUIPart,\n FileUIPart,\n} from \"ai\";\n\nexport type { UIMessage, ToolUIPart, DynamicToolUIPart, ChatStatus, ReasoningUIPart, FileUIPart };\n\n/** A selectable chat model, as served by the backend's GET /api/chat/models.\n * `configured` is false for catalogued models whose provider has no API key. */\nexport interface ChatModel {\n id: string;\n provider: string;\n label: string;\n reasoning: boolean;\n configured?: boolean;\n}\n\n/** A suggested prompt shown on the empty state. A bare string is both the label\n * and the submitted text; the object form separates them. */\nexport type Suggestion = string | { label: string; prompt: string };\n\n/** The label shown for a suggestion. */\nexport function suggestionLabel(s: Suggestion): string {\n return typeof s === \"string\" ? s : s.label;\n}\n\n/** The text submitted when a suggestion is clicked. */\nexport function suggestionPrompt(s: Suggestion): string {\n return typeof s === \"string\" ? s : s.prompt;\n}\n\n/** Returns true for an assistant reasoning (\"thinking\") part. */\nexport function isReasoningPart(part: { type: string }): part is ReasoningUIPart {\n return part.type === \"reasoning\";\n}\n\n/** Returns true for a file/attachment part. */\nexport function isFilePart(part: { type: string }): part is FileUIPart {\n return part.type === \"file\";\n}\n\n/** A tool part as it appears in an assistant UIMessage — either a typed\n * `tool-<name>` part or the generic `dynamic-tool` part. clicky operations\n * surface as dynamic tools, so the chat UI renders both shapes. */\nexport type AnyToolPart = ToolUIPart | DynamicToolUIPart;\n\n/**
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../src/data/chat/types.ts"],"sourcesContent":["import type {\n UIMessage,\n ToolUIPart,\n DynamicToolUIPart,\n ChatStatus,\n ReasoningUIPart,\n FileUIPart,\n} from \"ai\";\n\nexport type { UIMessage, ToolUIPart, DynamicToolUIPart, ChatStatus, ReasoningUIPart, FileUIPart };\n\n/** A selectable chat model, as served by the backend's GET /api/chat/models.\n * `configured` is false for catalogued models whose provider has no API key. */\nexport interface ChatModel {\n id: string;\n provider: string;\n label: string;\n reasoning: boolean;\n configured?: boolean;\n /** Max context tokens — the denominator for a usage gauge. */\n contextWindow?: number;\n}\n\n/** Per-message metadata the backend rides on the SSE `finish` part\n * (`messageMetadata`), applied by the AI SDK to the assistant `UIMessage`. */\nexport interface ChatMessageMetadata {\n usage?: {\n inputTokens?: number;\n outputTokens?: number;\n totalTokens?: number;\n };\n /** This turn's cost in USD. */\n cost?: number;\n /** Cumulative thread cost in USD (when the turn is persisted to a thread). */\n threadCostUsd?: number;\n /** This turn's input-token count, ≈ current context-window occupancy. */\n contextTokens?: number;\n}\n\n/** A flattened usage snapshot a chat surfaces for a gauge: tokens used out of the\n * model's context window, plus cumulative cost. */\nexport interface ChatUsageSummary {\n usedTokens: number;\n maxTokens: number;\n cost?: number;\n messageCount: number;\n modelLabel?: string;\n}\n\n/** A suggested prompt shown on the empty state. A bare string is both the label\n * and the submitted text; the object form separates them. */\nexport type Suggestion = string | { label: string; prompt: string };\n\n/** The label shown for a suggestion. */\nexport function suggestionLabel(s: Suggestion): string {\n return typeof s === \"string\" ? s : s.label;\n}\n\n/** The text submitted when a suggestion is clicked. */\nexport function suggestionPrompt(s: Suggestion): string {\n return typeof s === \"string\" ? s : s.prompt;\n}\n\n/** Returns true for an assistant reasoning (\"thinking\") part. */\nexport function isReasoningPart(part: { type: string }): part is ReasoningUIPart {\n return part.type === \"reasoning\";\n}\n\n/** Returns true for a file/attachment part. */\nexport function isFilePart(part: { type: string }): part is FileUIPart {\n return part.type === \"file\";\n}\n\n/** A tool part as it appears in an assistant UIMessage — either a typed\n * `tool-<name>` part or the generic `dynamic-tool` part. clicky operations\n * surface as dynamic tools, so the chat UI renders both shapes. */\nexport type AnyToolPart = ToolUIPart | DynamicToolUIPart;\n\n/** Tool metadata shared by the chat shell. It both configures the\n * tool-preferences popover (`name`/`label`/`group`) and carries the schema\n * derived from a clicky RPC operation (`description`/`inputSchema`). The Go\n * backend owns execution; the client uses this only for display and to scope\n * which tools a request may call (passed in the transport `body`). */\nexport interface ToolMeta {\n /** Stable tool name sent to the model (the operation id). */\n name: string;\n /** Human-readable label shown in the tool-preferences popover. */\n label: string;\n /** Bucket heading in the popover — the clicky surface for RPC operations. */\n group?: string;\n /** Description shown in tool pickers / tool-call headers. */\n description?: string;\n /** JSON-Schema for the tool's input, assembled from an operation's\n * parameters + request body. Omitted for hand-authored tools. */\n inputSchema?: ChatToolInputSchema;\n}\n\nexport interface ChatToolInputSchema {\n type: \"object\";\n properties: Record<string, JSONSchemaProperty>;\n required: string[];\n}\n\nexport interface JSONSchemaProperty {\n type?: string;\n description?: string;\n enum?: unknown[];\n default?: unknown;\n}\n\n/** Returns true for a `dynamic-tool` part (clicky operations surface this way). */\nexport function isDynamicToolPart(part: { type: string }): part is DynamicToolUIPart {\n return part.type === \"dynamic-tool\";\n}\n\n/** Returns true for a typed `tool-<name>` part. */\nexport function isTypedToolPart(part: { type: string }): part is ToolUIPart {\n return part.type.startsWith(\"tool-\");\n}\n\n/** The display name of a tool part: the explicit `toolName` for dynamic tools,\n * otherwise the suffix after `tool-`. */\nexport function toolPartName(part: AnyToolPart): string {\n if (isDynamicToolPart(part)) {\n return part.toolName;\n }\n return part.type.slice(\"tool-\".length);\n}\n"],"names":[],"mappings":"AAsDO,SAAS,gBAAgB,GAAuB;AACrD,SAAO,OAAO,MAAM,WAAW,IAAI,EAAE;AACvC;AAGO,SAAS,iBAAiB,GAAuB;AACtD,SAAO,OAAO,MAAM,WAAW,IAAI,EAAE;AACvC;AAGO,SAAS,gBAAgB,MAAiD;AAC/E,SAAO,KAAK,SAAS;AACvB;AAGO,SAAS,WAAW,MAA4C;AACrE,SAAO,KAAK,SAAS;AACvB;AAwCO,SAAS,kBAAkB,MAAmD;AACnF,SAAO,KAAK,SAAS;AACvB;AAGO,SAAS,gBAAgB,MAA4C;AAC1E,SAAO,KAAK,KAAK,WAAW,OAAO;AACrC;AAIO,SAAS,aAAa,MAA2B;AACtD,MAAI,kBAAkB,IAAI,GAAG;AAC3B,WAAO,KAAK;AAAA,EACd;AACA,SAAO,KAAK,KAAK,MAAM,QAAQ,MAAM;AACvC;"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
function parseClickyData(data) {
|
|
4
|
+
if (typeof data === "string") {
|
|
5
|
+
try {
|
|
6
|
+
return normalizeClickyDocument(JSON.parse(data));
|
|
7
|
+
} catch (error) {
|
|
8
|
+
return {
|
|
9
|
+
ok: false,
|
|
10
|
+
message: error instanceof Error ? error.message : "Failed to parse JSON",
|
|
11
|
+
raw: data
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return normalizeClickyDocument(data);
|
|
16
|
+
}
|
|
17
|
+
function normalizeClickyDocument(data) {
|
|
18
|
+
if (!data || typeof data !== "object") {
|
|
19
|
+
return {
|
|
20
|
+
ok: false,
|
|
21
|
+
message: "Payload must be an object",
|
|
22
|
+
raw: String(data ?? "")
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
const candidate = data;
|
|
26
|
+
if ("version" in candidate && candidate.version === 1 && candidate.node && isClickyNode(candidate.node)) {
|
|
27
|
+
return { ok: true, document: candidate };
|
|
28
|
+
}
|
|
29
|
+
if (isClickyNode(candidate)) {
|
|
30
|
+
return { ok: true, document: { version: 1, node: candidate } };
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
ok: false,
|
|
34
|
+
message: "Payload is neither a Clicky document nor a Clicky node",
|
|
35
|
+
raw: JSON.stringify(data, null, 2)
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function isClickyNode(value) {
|
|
39
|
+
return !!value && typeof value === "object" && typeof value.kind === "string";
|
|
40
|
+
}
|
|
41
|
+
exports.parseClickyData = parseClickyData;
|
|
42
|
+
//# sourceMappingURL=clicky-parse.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clicky-parse.cjs","sources":["../../src/data/clicky-parse.ts"],"sourcesContent":["import type { ClickyDocument, ClickyNode, ClickyProps } from \"./Clicky\";\n\nexport type ParsedClicky =\n | { ok: true; document: ClickyDocument }\n | { ok: false; message: string; raw: string };\n\nexport function parseClickyData(data: ClickyProps[\"data\"]): ParsedClicky {\n if (typeof data === \"string\") {\n try {\n return normalizeClickyDocument(JSON.parse(data) as unknown);\n } catch (error) {\n return {\n ok: false,\n message:\n error instanceof Error ? error.message : \"Failed to parse JSON\",\n raw: data,\n };\n }\n }\n\n return normalizeClickyDocument(data);\n}\n\nfunction normalizeClickyDocument(data: unknown): ParsedClicky {\n if (!data || typeof data !== \"object\") {\n return {\n ok: false,\n message: \"Payload must be an object\",\n raw: String(data ?? \"\"),\n };\n }\n\n const candidate = data as Partial<ClickyDocument> & Partial<ClickyNode>;\n if (\n \"version\" in candidate &&\n candidate.version === 1 &&\n candidate.node &&\n isClickyNode(candidate.node)\n ) {\n return { ok: true, document: candidate as ClickyDocument };\n }\n\n if (isClickyNode(candidate)) {\n return { ok: true, document: { version: 1, node: candidate } };\n }\n\n return {\n ok: false,\n message: \"Payload is neither a Clicky document nor a Clicky node\",\n raw: JSON.stringify(data, null, 2),\n };\n}\n\nfunction isClickyNode(value: unknown): value is ClickyNode {\n return (\n !!value &&\n typeof value === \"object\" &&\n typeof (value as { kind?: unknown }).kind === \"string\"\n );\n}\n"],"names":[],"mappings":";;AAMO,SAAS,gBAAgB,MAAyC;AACvE,MAAI,OAAO,SAAS,UAAU;AAC5B,QAAI;AACF,aAAO,wBAAwB,KAAK,MAAM,IAAI,CAAY;AAAA,IAC5D,SAAS,OAAO;AACd,aAAO;AAAA,QACL,IAAI;AAAA,QACJ,SACE,iBAAiB,QAAQ,MAAM,UAAU;AAAA,QAC3C,KAAK;AAAA,MAAA;AAAA,IAET;AAAA,EACF;AAEA,SAAO,wBAAwB,IAAI;AACrC;AAEA,SAAS,wBAAwB,MAA6B;AAC5D,MAAI,CAAC,QAAQ,OAAO,SAAS,UAAU;AACrC,WAAO;AAAA,MACL,IAAI;AAAA,MACJ,SAAS;AAAA,MACT,KAAK,OAAO,QAAQ,EAAE;AAAA,IAAA;AAAA,EAE1B;AAEA,QAAM,YAAY;AAClB,MACE,aAAa,aACb,UAAU,YAAY,KACtB,UAAU,QACV,aAAa,UAAU,IAAI,GAC3B;AACA,WAAO,EAAE,IAAI,MAAM,UAAU,UAAA;AAAA,EAC/B;AAEA,MAAI,aAAa,SAAS,GAAG;AAC3B,WAAO,EAAE,IAAI,MAAM,UAAU,EAAE,SAAS,GAAG,MAAM,YAAU;AAAA,EAC7D;AAEA,SAAO;AAAA,IACL,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,KAAK,KAAK,UAAU,MAAM,MAAM,CAAC;AAAA,EAAA;AAErC;AAEA,SAAS,aAAa,OAAqC;AACzD,SACE,CAAC,CAAC,SACF,OAAO,UAAU,YACjB,OAAQ,MAA6B,SAAS;AAElD;;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ClickyDocument, ClickyProps } from './Clicky';
|
|
2
|
+
export type ParsedClicky = {
|
|
3
|
+
ok: true;
|
|
4
|
+
document: ClickyDocument;
|
|
5
|
+
} | {
|
|
6
|
+
ok: false;
|
|
7
|
+
message: string;
|
|
8
|
+
raw: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function parseClickyData(data: ClickyProps["data"]): ParsedClicky;
|
|
11
|
+
//# sourceMappingURL=clicky-parse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clicky-parse.d.ts","sourceRoot":"","sources":["../../src/data/clicky-parse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAc,WAAW,EAAE,MAAM,UAAU,CAAC;AAExE,MAAM,MAAM,YAAY,GACpB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,cAAc,CAAA;CAAE,GACtC;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhD,wBAAgB,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,YAAY,CAevE"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
function parseClickyData(data) {
|
|
2
|
+
if (typeof data === "string") {
|
|
3
|
+
try {
|
|
4
|
+
return normalizeClickyDocument(JSON.parse(data));
|
|
5
|
+
} catch (error) {
|
|
6
|
+
return {
|
|
7
|
+
ok: false,
|
|
8
|
+
message: error instanceof Error ? error.message : "Failed to parse JSON",
|
|
9
|
+
raw: data
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return normalizeClickyDocument(data);
|
|
14
|
+
}
|
|
15
|
+
function normalizeClickyDocument(data) {
|
|
16
|
+
if (!data || typeof data !== "object") {
|
|
17
|
+
return {
|
|
18
|
+
ok: false,
|
|
19
|
+
message: "Payload must be an object",
|
|
20
|
+
raw: String(data ?? "")
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
const candidate = data;
|
|
24
|
+
if ("version" in candidate && candidate.version === 1 && candidate.node && isClickyNode(candidate.node)) {
|
|
25
|
+
return { ok: true, document: candidate };
|
|
26
|
+
}
|
|
27
|
+
if (isClickyNode(candidate)) {
|
|
28
|
+
return { ok: true, document: { version: 1, node: candidate } };
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
ok: false,
|
|
32
|
+
message: "Payload is neither a Clicky document nor a Clicky node",
|
|
33
|
+
raw: JSON.stringify(data, null, 2)
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function isClickyNode(value) {
|
|
37
|
+
return !!value && typeof value === "object" && typeof value.kind === "string";
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
parseClickyData
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=clicky-parse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clicky-parse.js","sources":["../../src/data/clicky-parse.ts"],"sourcesContent":["import type { ClickyDocument, ClickyNode, ClickyProps } from \"./Clicky\";\n\nexport type ParsedClicky =\n | { ok: true; document: ClickyDocument }\n | { ok: false; message: string; raw: string };\n\nexport function parseClickyData(data: ClickyProps[\"data\"]): ParsedClicky {\n if (typeof data === \"string\") {\n try {\n return normalizeClickyDocument(JSON.parse(data) as unknown);\n } catch (error) {\n return {\n ok: false,\n message:\n error instanceof Error ? error.message : \"Failed to parse JSON\",\n raw: data,\n };\n }\n }\n\n return normalizeClickyDocument(data);\n}\n\nfunction normalizeClickyDocument(data: unknown): ParsedClicky {\n if (!data || typeof data !== \"object\") {\n return {\n ok: false,\n message: \"Payload must be an object\",\n raw: String(data ?? \"\"),\n };\n }\n\n const candidate = data as Partial<ClickyDocument> & Partial<ClickyNode>;\n if (\n \"version\" in candidate &&\n candidate.version === 1 &&\n candidate.node &&\n isClickyNode(candidate.node)\n ) {\n return { ok: true, document: candidate as ClickyDocument };\n }\n\n if (isClickyNode(candidate)) {\n return { ok: true, document: { version: 1, node: candidate } };\n }\n\n return {\n ok: false,\n message: \"Payload is neither a Clicky document nor a Clicky node\",\n raw: JSON.stringify(data, null, 2),\n };\n}\n\nfunction isClickyNode(value: unknown): value is ClickyNode {\n return (\n !!value &&\n typeof value === \"object\" &&\n typeof (value as { kind?: unknown }).kind === \"string\"\n );\n}\n"],"names":[],"mappings":"AAMO,SAAS,gBAAgB,MAAyC;AACvE,MAAI,OAAO,SAAS,UAAU;AAC5B,QAAI;AACF,aAAO,wBAAwB,KAAK,MAAM,IAAI,CAAY;AAAA,IAC5D,SAAS,OAAO;AACd,aAAO;AAAA,QACL,IAAI;AAAA,QACJ,SACE,iBAAiB,QAAQ,MAAM,UAAU;AAAA,QAC3C,KAAK;AAAA,MAAA;AAAA,IAET;AAAA,EACF;AAEA,SAAO,wBAAwB,IAAI;AACrC;AAEA,SAAS,wBAAwB,MAA6B;AAC5D,MAAI,CAAC,QAAQ,OAAO,SAAS,UAAU;AACrC,WAAO;AAAA,MACL,IAAI;AAAA,MACJ,SAAS;AAAA,MACT,KAAK,OAAO,QAAQ,EAAE;AAAA,IAAA;AAAA,EAE1B;AAEA,QAAM,YAAY;AAClB,MACE,aAAa,aACb,UAAU,YAAY,KACtB,UAAU,QACV,aAAa,UAAU,IAAI,GAC3B;AACA,WAAO,EAAE,IAAI,MAAM,UAAU,UAAA;AAAA,EAC/B;AAEA,MAAI,aAAa,SAAS,GAAG;AAC3B,WAAO,EAAE,IAAI,MAAM,UAAU,EAAE,SAAS,GAAG,MAAM,YAAU;AAAA,EAC7D;AAEA,SAAO;AAAA,IACL,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,KAAK,KAAK,UAAU,MAAM,MAAM,CAAC;AAAA,EAAA;AAErC;AAEA,SAAS,aAAa,OAAqC;AACzD,SACE,CAAC,CAAC,SACF,OAAO,UAAU,YACjB,OAAQ,MAA6B,SAAS;AAElD;"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
function frameHasSource(frame) {
|
|
5
|
-
return !!frame.sourceLines && frame.sourceLines.length > 0;
|
|
6
|
-
}
|
|
7
4
|
function FrameSourceWindow({ frame }) {
|
|
8
5
|
const lines = frame.sourceLines ?? [];
|
|
9
6
|
if (lines.length === 0) return null;
|
|
@@ -33,5 +30,4 @@ function FrameSourceWindow({ frame }) {
|
|
|
33
30
|
}) });
|
|
34
31
|
}
|
|
35
32
|
exports.FrameSourceWindow = FrameSourceWindow;
|
|
36
|
-
exports.frameHasSource = frameHasSource;
|
|
37
33
|
//# sourceMappingURL=FrameSourceWindow.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FrameSourceWindow.cjs","sources":["../../../src/data/diagnostics/FrameSourceWindow.tsx"],"sourcesContent":["// FrameSourceWindow renders a decompiled / resolved source window beneath a\n// stack frame: a gutter of absolute line numbers with the focal line (the one\n// the frame points at) highlighted. It is the plain (non-Shiki) renderer shared\n// by the JVM thread-dump frames and the exception stack-trace frames so both\n// surfaces show inline source the same way.\
|
|
1
|
+
{"version":3,"file":"FrameSourceWindow.cjs","sources":["../../../src/data/diagnostics/FrameSourceWindow.tsx"],"sourcesContent":["import type { FrameSource } from \"./FrameSourceWindow.utils\";\n\n// FrameSourceWindow renders a decompiled / resolved source window beneath a\n// stack frame: a gutter of absolute line numbers with the focal line (the one\n// the frame points at) highlighted. It is the plain (non-Shiki) renderer shared\n// by the JVM thread-dump frames and the exception stack-trace frames so both\n// surfaces show inline source the same way.\nexport function FrameSourceWindow({ frame }: { frame: FrameSource }) {\n const lines = frame.sourceLines ?? [];\n if (lines.length === 0) return null;\n const start = frame.sourceStartLine ?? 0;\n const numbers = frame.sourceLineNumbers;\n const focal = frame.line ?? -1;\n\n return (\n <div className=\"mx-3 mb-2 ml-12 overflow-x-auto rounded border border-border/60 bg-muted/30 py-1 font-mono text-[11px] leading-relaxed\">\n {lines.map((source, i) => {\n const lineNumber = numbers?.[i] ?? start + i;\n const isFocal = lineNumber === focal;\n return (\n <div\n key={`${lineNumber}-${i}`}\n className={[\n \"grid min-w-max grid-cols-[3.5rem_minmax(24rem,1fr)] gap-3 px-2\",\n isFocal\n ? \"bg-red-500/10 font-semibold text-red-800 dark:text-red-300\"\n : \"text-foreground\",\n ].join(\" \")}\n >\n <span className=\"select-none text-right text-muted-foreground\">\n {isFocal ? \">\" : \"\"}\n {lineNumber}\n </span>\n <code className=\"whitespace-pre\">{source || \" \"}</code>\n </div>\n );\n })}\n </div>\n );\n}\n"],"names":["jsx","jsxs"],"mappings":";;;AAOO,SAAS,kBAAkB,EAAE,SAAiC;AACnE,QAAM,QAAQ,MAAM,eAAe,CAAA;AACnC,MAAI,MAAM,WAAW,EAAG,QAAO;AAC/B,QAAM,QAAQ,MAAM,mBAAmB;AACvC,QAAM,UAAU,MAAM;AACtB,QAAM,QAAQ,MAAM,QAAQ;AAE5B,SACEA,+BAAC,SAAI,WAAU,0HACZ,gBAAM,IAAI,CAAC,QAAQ,MAAM;AACxB,UAAM,cAAa,mCAAU,OAAM,QAAQ;AAC3C,UAAM,UAAU,eAAe;AAC/B,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QAEC,WAAW;AAAA,UACT;AAAA,UACA,UACI,+DACA;AAAA,QAAA,EACJ,KAAK,GAAG;AAAA,QAEV,UAAA;AAAA,UAAAA,2BAAAA,KAAC,QAAA,EAAK,WAAU,gDACb,UAAA;AAAA,YAAA,UAAU,MAAM;AAAA,YAChB;AAAA,UAAA,GACH;AAAA,UACAD,2BAAAA,IAAC,QAAA,EAAK,WAAU,kBAAkB,oBAAU,IAAA,CAAI;AAAA,QAAA;AAAA,MAAA;AAAA,MAZ3C,GAAG,UAAU,IAAI,CAAC;AAAA,IAAA;AAAA,EAe7B,CAAC,EAAA,CACH;AAEJ;;"}
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
/** Source lines around the focal line. */
|
|
3
|
-
sourceLines?: string[];
|
|
4
|
-
/** Absolute line number for each entry in sourceLines (preferred gutter). */
|
|
5
|
-
sourceLineNumbers?: number[];
|
|
6
|
-
/** Line number of sourceLines[0] when sourceLineNumbers is absent. */
|
|
7
|
-
sourceStartLine?: number;
|
|
8
|
-
/** The frame's focal line, highlighted when it falls inside the window. */
|
|
9
|
-
line?: number;
|
|
10
|
-
}
|
|
11
|
-
export declare function frameHasSource(frame: FrameSource): boolean;
|
|
1
|
+
import { FrameSource } from './FrameSourceWindow.utils';
|
|
12
2
|
export declare function FrameSourceWindow({ frame }: {
|
|
13
3
|
frame: FrameSource;
|
|
14
4
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FrameSourceWindow.d.ts","sourceRoot":"","sources":["../../../src/data/diagnostics/FrameSourceWindow.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FrameSourceWindow.d.ts","sourceRoot":"","sources":["../../../src/data/diagnostics/FrameSourceWindow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAO7D,wBAAgB,iBAAiB,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,WAAW,CAAA;CAAE,kDAgClE"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
function frameHasSource(frame) {
|
|
3
|
-
return !!frame.sourceLines && frame.sourceLines.length > 0;
|
|
4
|
-
}
|
|
5
2
|
function FrameSourceWindow({ frame }) {
|
|
6
3
|
const lines = frame.sourceLines ?? [];
|
|
7
4
|
if (lines.length === 0) return null;
|
|
@@ -31,7 +28,6 @@ function FrameSourceWindow({ frame }) {
|
|
|
31
28
|
}) });
|
|
32
29
|
}
|
|
33
30
|
export {
|
|
34
|
-
FrameSourceWindow
|
|
35
|
-
frameHasSource
|
|
31
|
+
FrameSourceWindow
|
|
36
32
|
};
|
|
37
33
|
//# sourceMappingURL=FrameSourceWindow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FrameSourceWindow.js","sources":["../../../src/data/diagnostics/FrameSourceWindow.tsx"],"sourcesContent":["// FrameSourceWindow renders a decompiled / resolved source window beneath a\n// stack frame: a gutter of absolute line numbers with the focal line (the one\n// the frame points at) highlighted. It is the plain (non-Shiki) renderer shared\n// by the JVM thread-dump frames and the exception stack-trace frames so both\n// surfaces show inline source the same way.\
|
|
1
|
+
{"version":3,"file":"FrameSourceWindow.js","sources":["../../../src/data/diagnostics/FrameSourceWindow.tsx"],"sourcesContent":["import type { FrameSource } from \"./FrameSourceWindow.utils\";\n\n// FrameSourceWindow renders a decompiled / resolved source window beneath a\n// stack frame: a gutter of absolute line numbers with the focal line (the one\n// the frame points at) highlighted. It is the plain (non-Shiki) renderer shared\n// by the JVM thread-dump frames and the exception stack-trace frames so both\n// surfaces show inline source the same way.\nexport function FrameSourceWindow({ frame }: { frame: FrameSource }) {\n const lines = frame.sourceLines ?? [];\n if (lines.length === 0) return null;\n const start = frame.sourceStartLine ?? 0;\n const numbers = frame.sourceLineNumbers;\n const focal = frame.line ?? -1;\n\n return (\n <div className=\"mx-3 mb-2 ml-12 overflow-x-auto rounded border border-border/60 bg-muted/30 py-1 font-mono text-[11px] leading-relaxed\">\n {lines.map((source, i) => {\n const lineNumber = numbers?.[i] ?? start + i;\n const isFocal = lineNumber === focal;\n return (\n <div\n key={`${lineNumber}-${i}`}\n className={[\n \"grid min-w-max grid-cols-[3.5rem_minmax(24rem,1fr)] gap-3 px-2\",\n isFocal\n ? \"bg-red-500/10 font-semibold text-red-800 dark:text-red-300\"\n : \"text-foreground\",\n ].join(\" \")}\n >\n <span className=\"select-none text-right text-muted-foreground\">\n {isFocal ? \">\" : \"\"}\n {lineNumber}\n </span>\n <code className=\"whitespace-pre\">{source || \" \"}</code>\n </div>\n );\n })}\n </div>\n );\n}\n"],"names":[],"mappings":";AAOO,SAAS,kBAAkB,EAAE,SAAiC;AACnE,QAAM,QAAQ,MAAM,eAAe,CAAA;AACnC,MAAI,MAAM,WAAW,EAAG,QAAO;AAC/B,QAAM,QAAQ,MAAM,mBAAmB;AACvC,QAAM,UAAU,MAAM;AACtB,QAAM,QAAQ,MAAM,QAAQ;AAE5B,SACE,oBAAC,SAAI,WAAU,0HACZ,gBAAM,IAAI,CAAC,QAAQ,MAAM;AACxB,UAAM,cAAa,mCAAU,OAAM,QAAQ;AAC3C,UAAM,UAAU,eAAe;AAC/B,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QAEC,WAAW;AAAA,UACT;AAAA,UACA,UACI,+DACA;AAAA,QAAA,EACJ,KAAK,GAAG;AAAA,QAEV,UAAA;AAAA,UAAA,qBAAC,QAAA,EAAK,WAAU,gDACb,UAAA;AAAA,YAAA,UAAU,MAAM;AAAA,YAChB;AAAA,UAAA,GACH;AAAA,UACA,oBAAC,QAAA,EAAK,WAAU,kBAAkB,oBAAU,IAAA,CAAI;AAAA,QAAA;AAAA,MAAA;AAAA,MAZ3C,GAAG,UAAU,IAAI,CAAC;AAAA,IAAA;AAAA,EAe7B,CAAC,EAAA,CACH;AAEJ;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
function frameHasSource(frame) {
|
|
4
|
+
return !!frame.sourceLines && frame.sourceLines.length > 0;
|
|
5
|
+
}
|
|
6
|
+
exports.frameHasSource = frameHasSource;
|
|
7
|
+
//# sourceMappingURL=FrameSourceWindow.utils.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FrameSourceWindow.utils.cjs","sources":["../../../src/data/diagnostics/FrameSourceWindow.utils.ts"],"sourcesContent":["export interface FrameSource {\n /** Source lines around the focal line. */\n sourceLines?: string[];\n /** Absolute line number for each entry in sourceLines (preferred gutter). */\n sourceLineNumbers?: number[];\n /** Line number of sourceLines[0] when sourceLineNumbers is absent. */\n sourceStartLine?: number;\n /** The frame's focal line, highlighted when it falls inside the window. */\n line?: number;\n}\n\nexport function frameHasSource(frame: FrameSource): boolean {\n return !!frame.sourceLines && frame.sourceLines.length > 0;\n}\n"],"names":[],"mappings":";;AAWO,SAAS,eAAe,OAA6B;AAC1D,SAAO,CAAC,CAAC,MAAM,eAAe,MAAM,YAAY,SAAS;AAC3D;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface FrameSource {
|
|
2
|
+
/** Source lines around the focal line. */
|
|
3
|
+
sourceLines?: string[];
|
|
4
|
+
/** Absolute line number for each entry in sourceLines (preferred gutter). */
|
|
5
|
+
sourceLineNumbers?: number[];
|
|
6
|
+
/** Line number of sourceLines[0] when sourceLineNumbers is absent. */
|
|
7
|
+
sourceStartLine?: number;
|
|
8
|
+
/** The frame's focal line, highlighted when it falls inside the window. */
|
|
9
|
+
line?: number;
|
|
10
|
+
}
|
|
11
|
+
export declare function frameHasSource(frame: FrameSource): boolean;
|
|
12
|
+
//# sourceMappingURL=FrameSourceWindow.utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FrameSourceWindow.utils.d.ts","sourceRoot":"","sources":["../../../src/data/diagnostics/FrameSourceWindow.utils.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,0CAA0C;IAC1C,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,6EAA6E;IAC7E,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,sEAAsE;IACtE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,2EAA2E;IAC3E,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAE1D"}
|