@flanksource/clicky-ui 0.3.24 → 0.3.26
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/NOTICE.md +1 -0
- package/dist/ai.cjs +4 -0
- package/dist/ai.cjs.map +1 -1
- package/dist/ai.js +6 -2
- package/dist/ai.js.map +1 -1
- package/dist/chat.cjs +8 -0
- package/dist/chat.cjs.map +1 -1
- package/dist/chat.js +9 -1
- package/dist/chat.js.map +1 -1
- package/dist/comments/CommentCard.cjs +89 -14
- package/dist/comments/CommentCard.cjs.map +1 -1
- package/dist/comments/CommentCard.d.ts.map +1 -1
- package/dist/comments/CommentCard.js +90 -15
- package/dist/comments/CommentCard.js.map +1 -1
- package/dist/comments/CommentComposer.cjs +25 -2
- package/dist/comments/CommentComposer.cjs.map +1 -1
- package/dist/comments/CommentComposer.d.ts.map +1 -1
- package/dist/comments/CommentComposer.js +25 -2
- package/dist/comments/CommentComposer.js.map +1 -1
- package/dist/comments/CommentProvider.cjs +21 -14
- package/dist/comments/CommentProvider.cjs.map +1 -1
- package/dist/comments/CommentProvider.d.ts +1 -1
- package/dist/comments/CommentProvider.d.ts.map +1 -1
- package/dist/comments/CommentProvider.js +21 -14
- package/dist/comments/CommentProvider.js.map +1 -1
- package/dist/comments/CommentSidePanel.cjs +1 -1
- package/dist/comments/CommentSidePanel.cjs.map +1 -1
- package/dist/comments/CommentSidePanel.js +1 -1
- package/dist/comments/CommentSidePanel.js.map +1 -1
- package/dist/comments/comment-types.cjs.map +1 -1
- package/dist/comments/comment-types.d.ts +6 -0
- package/dist/comments/comment-types.d.ts.map +1 -1
- package/dist/comments/comment-types.js.map +1 -1
- package/dist/components/DimensionField.cjs +56 -0
- package/dist/components/DimensionField.cjs.map +1 -0
- package/dist/components/DimensionField.d.ts +17 -0
- package/dist/components/DimensionField.d.ts.map +1 -0
- package/dist/components/DimensionField.js +56 -0
- package/dist/components/DimensionField.js.map +1 -0
- package/dist/components.cjs +4 -0
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.ts +2 -0
- package/dist/components.d.ts.map +1 -1
- package/dist/components.js +4 -0
- package/dist/components.js.map +1 -1
- package/dist/data/Clicky.cjs +4 -5
- package/dist/data/Clicky.cjs.map +1 -1
- package/dist/data/Clicky.d.ts.map +1 -1
- package/dist/data/Clicky.js +4 -5
- package/dist/data/Clicky.js.map +1 -1
- package/dist/data/TaskExecDetails.cjs +8 -3
- package/dist/data/TaskExecDetails.cjs.map +1 -1
- package/dist/data/TaskExecDetails.d.ts +4 -0
- package/dist/data/TaskExecDetails.d.ts.map +1 -1
- package/dist/data/TaskExecDetails.js +9 -4
- package/dist/data/TaskExecDetails.js.map +1 -1
- package/dist/data/TaskManagerButton.cjs +101 -7
- package/dist/data/TaskManagerButton.cjs.map +1 -1
- package/dist/data/TaskManagerButton.d.ts +6 -1
- package/dist/data/TaskManagerButton.d.ts.map +1 -1
- package/dist/data/TaskManagerButton.js +103 -9
- package/dist/data/TaskManagerButton.js.map +1 -1
- package/dist/data/TaskProcessDetails.cjs +2 -0
- package/dist/data/TaskProcessDetails.cjs.map +1 -1
- package/dist/data/TaskProcessDetails.d.ts.map +1 -1
- package/dist/data/TaskProcessDetails.js +2 -0
- package/dist/data/TaskProcessDetails.js.map +1 -1
- package/dist/data/TaskProgress.cjs +14 -4
- package/dist/data/TaskProgress.cjs.map +1 -1
- package/dist/data/TaskProgress.js +14 -4
- package/dist/data/TaskProgress.js.map +1 -1
- package/dist/data/TaskSnapshot.cjs.map +1 -1
- package/dist/data/TaskSnapshot.d.ts +1 -0
- package/dist/data/TaskSnapshot.d.ts.map +1 -1
- package/dist/data/TaskSnapshot.js.map +1 -1
- package/dist/data/ai/ChatWindow.cjs +18 -23
- package/dist/data/ai/ChatWindow.cjs.map +1 -1
- package/dist/data/ai/ChatWindow.d.ts +1 -1
- package/dist/data/ai/ChatWindow.d.ts.map +1 -1
- package/dist/data/ai/ChatWindow.js +19 -24
- package/dist/data/ai/ChatWindow.js.map +1 -1
- package/dist/data/ai/ChatWindow.preferences.cjs +12 -21
- package/dist/data/ai/ChatWindow.preferences.cjs.map +1 -1
- package/dist/data/ai/ChatWindow.preferences.d.ts +3 -2
- package/dist/data/ai/ChatWindow.preferences.d.ts.map +1 -1
- package/dist/data/ai/ChatWindow.preferences.js +12 -21
- package/dist/data/ai/ChatWindow.preferences.js.map +1 -1
- package/dist/data/ai/ChatWindow.tool-catalog.cjs +21 -38
- package/dist/data/ai/ChatWindow.tool-catalog.cjs.map +1 -1
- package/dist/data/ai/ChatWindow.tool-catalog.d.ts +5 -5
- package/dist/data/ai/ChatWindow.tool-catalog.d.ts.map +1 -1
- package/dist/data/ai/ChatWindow.tool-catalog.js +21 -38
- package/dist/data/ai/ChatWindow.tool-catalog.js.map +1 -1
- package/dist/data/ai/ChatWindow.types.d.ts +2 -2
- package/dist/data/ai/ChatWindow.types.d.ts.map +1 -1
- package/dist/data/ai/ChatWindowManager.cjs +2 -2
- package/dist/data/ai/ChatWindowManager.cjs.map +1 -1
- package/dist/data/ai/ChatWindowManager.js +2 -2
- package/dist/data/ai/ChatWindowManager.js.map +1 -1
- package/dist/data/ai/ChatWindowRequestBody.cjs +4 -2
- package/dist/data/ai/ChatWindowRequestBody.cjs.map +1 -1
- package/dist/data/ai/ChatWindowRequestBody.d.ts +15 -3
- package/dist/data/ai/ChatWindowRequestBody.d.ts.map +1 -1
- package/dist/data/ai/ChatWindowRequestBody.js +4 -2
- package/dist/data/ai/ChatWindowRequestBody.js.map +1 -1
- package/dist/data/ai/ToolPreferences.cjs +5 -5
- package/dist/data/ai/ToolPreferences.cjs.map +1 -1
- package/dist/data/ai/ToolPreferences.d.ts +6 -5
- package/dist/data/ai/ToolPreferences.d.ts.map +1 -1
- package/dist/data/ai/ToolPreferences.js +5 -5
- package/dist/data/ai/ToolPreferences.js.map +1 -1
- package/dist/data/ai/ToolPreferences.model.cjs +61 -37
- package/dist/data/ai/ToolPreferences.model.cjs.map +1 -1
- package/dist/data/ai/ToolPreferences.model.d.ts +32 -13
- package/dist/data/ai/ToolPreferences.model.d.ts.map +1 -1
- package/dist/data/ai/ToolPreferences.model.js +62 -38
- package/dist/data/ai/ToolPreferences.model.js.map +1 -1
- package/dist/data/ai/ToolPreferencesList.cjs +17 -20
- package/dist/data/ai/ToolPreferencesList.cjs.map +1 -1
- package/dist/data/ai/ToolPreferencesList.d.ts +16 -7
- package/dist/data/ai/ToolPreferencesList.d.ts.map +1 -1
- package/dist/data/ai/ToolPreferencesList.js +18 -21
- package/dist/data/ai/ToolPreferencesList.js.map +1 -1
- package/dist/data/ai/chat-window-context.cjs +1 -1
- package/dist/data/ai/chat-window-context.cjs.map +1 -1
- package/dist/data/ai/chat-window-context.d.ts +7 -7
- package/dist/data/ai/chat-window-context.d.ts.map +1 -1
- package/dist/data/ai/chat-window-context.js +1 -1
- package/dist/data/ai/chat-window-context.js.map +1 -1
- package/dist/data/ai/index.d.ts +3 -1
- package/dist/data/ai/index.d.ts.map +1 -1
- package/dist/data/chat/Chat.cjs +8 -4
- package/dist/data/chat/Chat.cjs.map +1 -1
- package/dist/data/chat/Chat.d.ts.map +1 -1
- package/dist/data/chat/Chat.js +8 -4
- package/dist/data/chat/Chat.js.map +1 -1
- package/dist/data/chat/ChatRuntimeToolbar.cjs +11 -7
- package/dist/data/chat/ChatRuntimeToolbar.cjs.map +1 -1
- package/dist/data/chat/ChatRuntimeToolbar.d.ts.map +1 -1
- package/dist/data/chat/ChatRuntimeToolbar.js +11 -7
- package/dist/data/chat/ChatRuntimeToolbar.js.map +1 -1
- package/dist/data/chat/ContextMeter.cjs +64 -27
- package/dist/data/chat/ContextMeter.cjs.map +1 -1
- package/dist/data/chat/ContextMeter.d.ts +11 -4
- package/dist/data/chat/ContextMeter.d.ts.map +1 -1
- package/dist/data/chat/ContextMeter.js +64 -27
- package/dist/data/chat/ContextMeter.js.map +1 -1
- package/dist/data/chat/clickyOperationsToTools.cjs +2 -1
- package/dist/data/chat/clickyOperationsToTools.cjs.map +1 -1
- package/dist/data/chat/clickyOperationsToTools.d.ts.map +1 -1
- package/dist/data/chat/clickyOperationsToTools.js +2 -1
- package/dist/data/chat/clickyOperationsToTools.js.map +1 -1
- package/dist/data/chat/index.d.ts +2 -1
- package/dist/data/chat/index.d.ts.map +1 -1
- package/dist/data/chat/tool-policy.cjs +132 -0
- package/dist/data/chat/tool-policy.cjs.map +1 -0
- package/dist/data/chat/tool-policy.d.ts +81 -0
- package/dist/data/chat/tool-policy.d.ts.map +1 -0
- package/dist/data/chat/tool-policy.js +132 -0
- package/dist/data/chat/tool-policy.js.map +1 -0
- package/dist/data/chat/types.cjs +20 -0
- package/dist/data/chat/types.cjs.map +1 -1
- package/dist/data/chat/types.d.ts +41 -2
- package/dist/data/chat/types.d.ts.map +1 -1
- package/dist/data/chat/types.js +20 -0
- package/dist/data/chat/types.js.map +1 -1
- package/dist/data/chat/usage-snapshot.cjs +10 -1
- package/dist/data/chat/usage-snapshot.cjs.map +1 -1
- package/dist/data/chat/usage-snapshot.d.ts.map +1 -1
- package/dist/data/chat/usage-snapshot.js +10 -1
- package/dist/data/chat/usage-snapshot.js.map +1 -1
- package/dist/data/debugConsoleSignal.cjs +64 -0
- package/dist/data/debugConsoleSignal.cjs.map +1 -0
- package/dist/data/debugConsoleSignal.d.ts +83 -0
- package/dist/data/debugConsoleSignal.d.ts.map +1 -0
- package/dist/data/debugConsoleSignal.js +64 -0
- package/dist/data/debugConsoleSignal.js.map +1 -0
- package/dist/data/har/HarPanel.cjs +20 -14
- package/dist/data/har/HarPanel.cjs.map +1 -1
- package/dist/data/har/HarPanel.d.ts.map +1 -1
- package/dist/data/har/HarPanel.js +20 -14
- package/dist/data/har/HarPanel.js.map +1 -1
- package/dist/data/har/types.d.ts +18 -0
- package/dist/data/har/types.d.ts.map +1 -1
- package/dist/data/query-browser/QueryBrowser.cjs +4 -42
- package/dist/data/query-browser/QueryBrowser.cjs.map +1 -1
- package/dist/data/query-browser/QueryBrowser.d.ts.map +1 -1
- package/dist/data/query-browser/QueryBrowser.js +5 -43
- package/dist/data/query-browser/QueryBrowser.js.map +1 -1
- package/dist/data/query-browser/QueryBrowser.types.cjs.map +1 -1
- package/dist/data/query-browser/QueryBrowser.types.d.ts +0 -1
- package/dist/data/query-browser/QueryBrowser.types.d.ts.map +1 -1
- package/dist/data/query-browser/QueryBrowser.types.js.map +1 -1
- package/dist/data/useDebugAction.cjs +29 -0
- package/dist/data/useDebugAction.cjs.map +1 -0
- package/dist/data/useDebugAction.d.ts +16 -0
- package/dist/data/useDebugAction.d.ts.map +1 -0
- package/dist/data/useDebugAction.js +29 -0
- package/dist/data/useDebugAction.js.map +1 -0
- package/dist/data/version-info.cjs +3 -3
- package/dist/data/version-info.js +3 -3
- package/dist/data.cjs +16 -8
- package/dist/data.cjs.map +1 -1
- package/dist/data.d.ts +3 -2
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +16 -8
- package/dist/devtools/DebugConsole.cjs +138 -0
- package/dist/devtools/DebugConsole.cjs.map +1 -0
- package/dist/devtools/DebugConsole.d.ts +23 -0
- package/dist/devtools/DebugConsole.d.ts.map +1 -0
- package/dist/devtools/DebugConsole.js +138 -0
- package/dist/devtools/DebugConsole.js.map +1 -0
- package/dist/devtools/DebugConsoleButton.cjs +59 -0
- package/dist/devtools/DebugConsoleButton.cjs.map +1 -0
- package/dist/devtools/DebugConsoleButton.d.ts +20 -0
- package/dist/devtools/DebugConsoleButton.d.ts.map +1 -0
- package/dist/devtools/DebugConsoleButton.js +59 -0
- package/dist/devtools/DebugConsoleButton.js.map +1 -0
- package/dist/devtools/DebugConsoleDock.cjs +112 -0
- package/dist/devtools/DebugConsoleDock.cjs.map +1 -0
- package/dist/devtools/DebugConsoleDock.d.ts +26 -0
- package/dist/devtools/DebugConsoleDock.d.ts.map +1 -0
- package/dist/devtools/DebugConsoleDock.js +112 -0
- package/dist/devtools/DebugConsoleDock.js.map +1 -0
- package/dist/devtools/ExecutionDetail.cjs +135 -0
- package/dist/devtools/ExecutionDetail.cjs.map +1 -0
- package/dist/devtools/ExecutionDetail.d.ts +19 -0
- package/dist/devtools/ExecutionDetail.d.ts.map +1 -0
- package/dist/devtools/ExecutionDetail.js +135 -0
- package/dist/devtools/ExecutionDetail.js.map +1 -0
- package/dist/devtools/debugClient.cjs +172 -0
- package/dist/devtools/debugClient.cjs.map +1 -0
- package/dist/devtools/debugClient.d.ts +98 -0
- package/dist/devtools/debugClient.d.ts.map +1 -0
- package/dist/devtools/debugClient.js +172 -0
- package/dist/devtools/debugClient.js.map +1 -0
- package/dist/devtools/debugStore.cjs +115 -0
- package/dist/devtools/debugStore.cjs.map +1 -0
- package/dist/devtools/debugStore.d.ts +83 -0
- package/dist/devtools/debugStore.d.ts.map +1 -0
- package/dist/devtools/debugStore.js +115 -0
- package/dist/devtools/debugStore.js.map +1 -0
- package/dist/devtools/dockState.cjs +51 -0
- package/dist/devtools/dockState.cjs.map +1 -0
- package/dist/devtools/dockState.d.ts +31 -0
- package/dist/devtools/dockState.d.ts.map +1 -0
- package/dist/devtools/dockState.js +51 -0
- package/dist/devtools/dockState.js.map +1 -0
- package/dist/devtools/tabs/ConsoleTab.cjs +36 -0
- package/dist/devtools/tabs/ConsoleTab.cjs.map +1 -0
- package/dist/devtools/tabs/ConsoleTab.d.ts +19 -0
- package/dist/devtools/tabs/ConsoleTab.d.ts.map +1 -0
- package/dist/devtools/tabs/ConsoleTab.js +36 -0
- package/dist/devtools/tabs/ConsoleTab.js.map +1 -0
- package/dist/devtools/tabs/InspectionCaches.cjs +150 -0
- package/dist/devtools/tabs/InspectionCaches.cjs.map +1 -0
- package/dist/devtools/tabs/InspectionCaches.d.ts +23 -0
- package/dist/devtools/tabs/InspectionCaches.d.ts.map +1 -0
- package/dist/devtools/tabs/InspectionCaches.js +150 -0
- package/dist/devtools/tabs/InspectionCaches.js.map +1 -0
- package/dist/devtools/tabs/InspectionTab.cjs +316 -0
- package/dist/devtools/tabs/InspectionTab.cjs.map +1 -0
- package/dist/devtools/tabs/InspectionTab.d.ts +27 -0
- package/dist/devtools/tabs/InspectionTab.d.ts.map +1 -0
- package/dist/devtools/tabs/InspectionTab.js +316 -0
- package/dist/devtools/tabs/InspectionTab.js.map +1 -0
- package/dist/devtools/tabs/NetworkTab.cjs +91 -0
- package/dist/devtools/tabs/NetworkTab.cjs.map +1 -0
- package/dist/devtools/tabs/NetworkTab.d.ts +20 -0
- package/dist/devtools/tabs/NetworkTab.d.ts.map +1 -0
- package/dist/devtools/tabs/NetworkTab.js +91 -0
- package/dist/devtools/tabs/NetworkTab.js.map +1 -0
- package/dist/devtools/tabs/QueriesTab.cjs +85 -0
- package/dist/devtools/tabs/QueriesTab.cjs.map +1 -0
- package/dist/devtools/tabs/QueriesTab.d.ts +24 -0
- package/dist/devtools/tabs/QueriesTab.d.ts.map +1 -0
- package/dist/devtools/tabs/QueriesTab.js +85 -0
- package/dist/devtools/tabs/QueriesTab.js.map +1 -0
- package/dist/devtools/types.cjs +26 -0
- package/dist/devtools/types.cjs.map +1 -0
- package/dist/devtools/types.d.ts +235 -0
- package/dist/devtools/types.d.ts.map +1 -0
- package/dist/devtools/types.js +26 -0
- package/dist/devtools/types.js.map +1 -0
- package/dist/devtools/useDebugStream.cjs +46 -0
- package/dist/devtools/useDebugStream.cjs.map +1 -0
- package/dist/devtools/useDebugStream.d.ts +23 -0
- package/dist/devtools/useDebugStream.d.ts.map +1 -0
- package/dist/devtools/useDebugStream.js +46 -0
- package/dist/devtools/useDebugStream.js.map +1 -0
- package/dist/devtools.cjs +51 -0
- package/dist/devtools.cjs.map +1 -0
- package/dist/devtools.d.ts +37 -0
- package/dist/devtools.d.ts.map +1 -0
- package/dist/devtools.js +51 -0
- package/dist/devtools.js.map +1 -0
- package/dist/icons/components/UiOpenScad.cjs +10 -0
- package/dist/icons/components/UiOpenScad.cjs.map +1 -0
- package/dist/icons/components/UiOpenScad.d.ts +9 -0
- package/dist/icons/components/UiOpenScad.d.ts.map +1 -0
- package/dist/icons/components/UiOpenScad.js +10 -0
- package/dist/icons/components/UiOpenScad.js.map +1 -0
- package/dist/icons/index.d.ts +1 -0
- package/dist/icons/index.d.ts.map +1 -1
- package/dist/icons/registry.cjs +2 -0
- package/dist/icons/registry.cjs.map +1 -1
- package/dist/icons/registry.d.ts.map +1 -1
- package/dist/icons/registry.js +2 -0
- package/dist/icons/registry.js.map +1 -1
- package/dist/icons.cjs +2 -0
- package/dist/icons.cjs.map +1 -1
- package/dist/icons.js +2 -0
- package/dist/icons.js.map +1 -1
- package/dist/index.cjs +20 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +20 -8
- package/dist/index.js.map +1 -1
- package/dist/layout/AppShell.cjs +15 -10
- package/dist/layout/AppShell.cjs.map +1 -1
- package/dist/layout/AppShell.d.ts +11 -0
- package/dist/layout/AppShell.d.ts.map +1 -1
- package/dist/layout/AppShell.js +15 -10
- package/dist/layout/AppShell.js.map +1 -1
- package/dist/layout/AppShell.nav.cjs +170 -49
- package/dist/layout/AppShell.nav.cjs.map +1 -1
- package/dist/layout/AppShell.nav.d.ts.map +1 -1
- package/dist/layout/AppShell.nav.js +170 -49
- package/dist/layout/AppShell.nav.js.map +1 -1
- package/dist/overlay/CellActions.cjs +18 -124
- package/dist/overlay/CellActions.cjs.map +1 -1
- package/dist/overlay/CellActions.d.ts +1 -1
- package/dist/overlay/CellActions.d.ts.map +1 -1
- package/dist/overlay/CellActions.js +18 -124
- package/dist/overlay/CellActions.js.map +1 -1
- package/dist/overlay/ContextMenu.cjs +144 -0
- package/dist/overlay/ContextMenu.cjs.map +1 -0
- package/dist/overlay/ContextMenu.d.ts +8 -0
- package/dist/overlay/ContextMenu.d.ts.map +1 -0
- package/dist/overlay/ContextMenu.js +144 -0
- package/dist/overlay/ContextMenu.js.map +1 -0
- package/dist/profiles/connections/connectionBrowserModel.cjs +14 -65
- package/dist/profiles/connections/connectionBrowserModel.cjs.map +1 -1
- package/dist/profiles/connections/connectionBrowserModel.d.ts +35 -35
- package/dist/profiles/connections/connectionBrowserModel.d.ts.map +1 -1
- package/dist/profiles/connections/connectionBrowserModel.js +14 -65
- package/dist/profiles/connections/connectionBrowserModel.js.map +1 -1
- package/dist/profiles/connections/connectionQueryWorkspace.cjs +29 -9
- package/dist/profiles/connections/connectionQueryWorkspace.cjs.map +1 -1
- package/dist/profiles/connections/connectionQueryWorkspace.d.ts +3 -2
- package/dist/profiles/connections/connectionQueryWorkspace.d.ts.map +1 -1
- package/dist/profiles/connections/connectionQueryWorkspace.js +30 -10
- package/dist/profiles/connections/connectionQueryWorkspace.js.map +1 -1
- package/dist/profiles/connections/connectionQueryWorkspaceModel.cjs +15 -0
- package/dist/profiles/connections/connectionQueryWorkspaceModel.cjs.map +1 -1
- package/dist/profiles/connections/connectionQueryWorkspaceModel.d.ts +22 -1
- package/dist/profiles/connections/connectionQueryWorkspaceModel.d.ts.map +1 -1
- package/dist/profiles/connections/connectionQueryWorkspaceModel.js +15 -0
- package/dist/profiles/connections/connectionQueryWorkspaceModel.js.map +1 -1
- package/dist/profiles/connections/index.d.ts +1 -0
- package/dist/profiles/connections/index.d.ts.map +1 -1
- package/dist/profiles/connections/inspectionStatus.cjs +44 -0
- package/dist/profiles/connections/inspectionStatus.cjs.map +1 -0
- package/dist/profiles/connections/inspectionStatus.d.ts +5 -0
- package/dist/profiles/connections/inspectionStatus.d.ts.map +1 -0
- package/dist/profiles/connections/inspectionStatus.js +44 -0
- package/dist/profiles/connections/inspectionStatus.js.map +1 -0
- package/dist/profiles/connections/useInspection.cjs +123 -0
- package/dist/profiles/connections/useInspection.cjs.map +1 -0
- package/dist/profiles/connections/useInspection.d.ts +35 -0
- package/dist/profiles/connections/useInspection.d.ts.map +1 -0
- package/dist/profiles/connections/useInspection.js +123 -0
- package/dist/profiles/connections/useInspection.js.map +1 -0
- package/dist/profiles/editor/profileBuilderWorkspace.cjs +55 -23
- package/dist/profiles/editor/profileBuilderWorkspace.cjs.map +1 -1
- package/dist/profiles/editor/profileBuilderWorkspace.d.ts.map +1 -1
- package/dist/profiles/editor/profileBuilderWorkspace.js +56 -24
- package/dist/profiles/editor/profileBuilderWorkspace.js.map +1 -1
- package/dist/profiles/elasticsearch/esQueryBuilder.cjs +12 -3
- package/dist/profiles/elasticsearch/esQueryBuilder.cjs.map +1 -1
- package/dist/profiles/elasticsearch/esQueryBuilder.d.ts +2 -2
- package/dist/profiles/elasticsearch/esQueryBuilder.d.ts.map +1 -1
- package/dist/profiles/elasticsearch/esQueryBuilder.js +12 -3
- package/dist/profiles/elasticsearch/esQueryBuilder.js.map +1 -1
- package/dist/profiles/fields/profileFieldEditor.cjs +137 -22
- package/dist/profiles/fields/profileFieldEditor.cjs.map +1 -1
- package/dist/profiles/fields/profileFieldEditor.d.ts.map +1 -1
- package/dist/profiles/fields/profileFieldEditor.js +137 -22
- package/dist/profiles/fields/profileFieldEditor.js.map +1 -1
- package/dist/profiles/fields/profileFieldFilterEditor.cjs +171 -82
- package/dist/profiles/fields/profileFieldFilterEditor.cjs.map +1 -1
- package/dist/profiles/fields/profileFieldFilterEditor.d.ts +0 -9
- package/dist/profiles/fields/profileFieldFilterEditor.d.ts.map +1 -1
- package/dist/profiles/fields/profileFieldFilterEditor.js +174 -85
- package/dist/profiles/fields/profileFieldFilterEditor.js.map +1 -1
- package/dist/profiles/fields/profileFieldIcons.cjs +6 -3
- package/dist/profiles/fields/profileFieldIcons.cjs.map +1 -1
- package/dist/profiles/fields/profileFieldIcons.js +6 -3
- package/dist/profiles/fields/profileFieldIcons.js.map +1 -1
- package/dist/profiles/query/profileSampleFilterLookup.cjs +34 -0
- package/dist/profiles/query/profileSampleFilterLookup.cjs.map +1 -0
- package/dist/profiles/query/profileSampleFilterLookup.d.ts +12 -0
- package/dist/profiles/query/profileSampleFilterLookup.d.ts.map +1 -0
- package/dist/profiles/query/profileSampleFilterLookup.js +34 -0
- package/dist/profiles/query/profileSampleFilterLookup.js.map +1 -0
- package/dist/profiles/query/profileSamplePayload.cjs +6 -4
- package/dist/profiles/query/profileSamplePayload.cjs.map +1 -1
- package/dist/profiles/query/profileSamplePayload.d.ts +11 -4
- package/dist/profiles/query/profileSamplePayload.d.ts.map +1 -1
- package/dist/profiles/query/profileSamplePayload.js +6 -4
- package/dist/profiles/query/profileSamplePayload.js.map +1 -1
- package/dist/profiles/query/profileSampleResult.cjs +26 -0
- package/dist/profiles/query/profileSampleResult.cjs.map +1 -0
- package/dist/profiles/query/profileSampleResult.d.ts +11 -0
- package/dist/profiles/query/profileSampleResult.d.ts.map +1 -0
- package/dist/profiles/query/profileSampleResult.js +26 -0
- package/dist/profiles/query/profileSampleResult.js.map +1 -0
- package/dist/profiles/query/queryTargetPicker.cjs +5 -3
- package/dist/profiles/query/queryTargetPicker.cjs.map +1 -1
- package/dist/profiles/query/queryTargetPicker.d.ts +3 -2
- package/dist/profiles/query/queryTargetPicker.d.ts.map +1 -1
- package/dist/profiles/query/queryTargetPicker.js +5 -3
- package/dist/profiles/query/queryTargetPicker.js.map +1 -1
- package/dist/profiles/wizard/profileWizard.cjs +14 -5
- package/dist/profiles/wizard/profileWizard.cjs.map +1 -1
- package/dist/profiles/wizard/profileWizard.d.ts.map +1 -1
- package/dist/profiles/wizard/profileWizard.js +15 -6
- package/dist/profiles/wizard/profileWizard.js.map +1 -1
- package/dist/profiles/wizard/profileWizardModel.cjs +35 -6
- package/dist/profiles/wizard/profileWizardModel.cjs.map +1 -1
- package/dist/profiles/wizard/profileWizardModel.d.ts +29 -4
- package/dist/profiles/wizard/profileWizardModel.d.ts.map +1 -1
- package/dist/profiles/wizard/profileWizardModel.js +35 -6
- package/dist/profiles/wizard/profileWizardModel.js.map +1 -1
- package/dist/profiles/wizard/profileWizardQueryStep.cjs +44 -11
- package/dist/profiles/wizard/profileWizardQueryStep.cjs.map +1 -1
- package/dist/profiles/wizard/profileWizardQueryStep.d.ts.map +1 -1
- package/dist/profiles/wizard/profileWizardQueryStep.js +46 -13
- package/dist/profiles/wizard/profileWizardQueryStep.js.map +1 -1
- package/dist/profiles/wizard/profileWizardSteps.cjs +33 -2
- package/dist/profiles/wizard/profileWizardSteps.cjs.map +1 -1
- package/dist/profiles/wizard/profileWizardSteps.d.ts +11 -2
- package/dist/profiles/wizard/profileWizardSteps.d.ts.map +1 -1
- package/dist/profiles/wizard/profileWizardSteps.js +33 -2
- package/dist/profiles/wizard/profileWizardSteps.js.map +1 -1
- package/dist/profiles.cjs +8 -2
- package/dist/profiles.cjs.map +1 -1
- package/dist/profiles.js +10 -4
- package/dist/profiles.js.map +1 -1
- package/dist/rpc/FilterForm.cjs +21 -237
- package/dist/rpc/FilterForm.cjs.map +1 -1
- package/dist/rpc/FilterForm.d.ts +3 -1
- package/dist/rpc/FilterForm.d.ts.map +1 -1
- package/dist/rpc/FilterForm.js +21 -237
- package/dist/rpc/FilterForm.js.map +1 -1
- package/dist/rpc/FilterFormFields.cjs +240 -0
- package/dist/rpc/FilterFormFields.cjs.map +1 -0
- package/dist/rpc/FilterFormFields.d.ts +12 -0
- package/dist/rpc/FilterFormFields.d.ts.map +1 -0
- package/dist/rpc/FilterFormFields.js +240 -0
- package/dist/rpc/FilterFormFields.js.map +1 -0
- package/dist/rpc/router.cjs +3 -2
- package/dist/rpc/router.cjs.map +1 -1
- package/dist/rpc/router.d.ts.map +1 -1
- package/dist/rpc/router.js +3 -2
- package/dist/rpc/router.js.map +1 -1
- package/dist/rpc/types.cjs.map +1 -1
- package/dist/rpc/types.d.ts +3 -1
- package/dist/rpc/types.d.ts.map +1 -1
- package/dist/rpc/types.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +6 -1
- package/dist/data/query-info/QueryInfoDialog.cjs +0 -106
- package/dist/data/query-info/QueryInfoDialog.cjs.map +0 -1
- package/dist/data/query-info/QueryInfoDialog.d.ts +0 -16
- package/dist/data/query-info/QueryInfoDialog.d.ts.map +0 -1
- package/dist/data/query-info/QueryInfoDialog.js +0 -106
- package/dist/data/query-info/QueryInfoDialog.js.map +0 -1
- package/dist/data/query-info/index.d.ts +0 -4
- package/dist/data/query-info/index.d.ts.map +0 -1
- package/dist/data/query-info/queryInfo.cjs +0 -42
- package/dist/data/query-info/queryInfo.cjs.map +0 -1
- package/dist/data/query-info/queryInfo.d.ts +0 -45
- package/dist/data/query-info/queryInfo.d.ts.map +0 -1
- package/dist/data/query-info/queryInfo.js +0 -42
- package/dist/data/query-info/queryInfo.js.map +0 -1
- package/dist/data/query-info/useQueryInfo.cjs +0 -48
- package/dist/data/query-info/useQueryInfo.cjs.map +0 -1
- package/dist/data/query-info/useQueryInfo.d.ts +0 -26
- package/dist/data/query-info/useQueryInfo.d.ts.map +0 -1
- package/dist/data/query-info/useQueryInfo.js +0 -48
- package/dist/data/query-info/useQueryInfo.js.map +0 -1
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const react = require("react");
|
|
5
|
+
const DataTable = require("../../data/DataTable.cjs");
|
|
6
|
+
const ExecutionDetail = require("../ExecutionDetail.cjs");
|
|
7
|
+
const COLUMNS = [
|
|
8
|
+
{ key: "time", label: "Time", kind: "timestamp", shrink: true, minWidth: 120 },
|
|
9
|
+
{ key: "surface", label: "Surface", shrink: true, minWidth: 100, filterable: true },
|
|
10
|
+
{ key: "provider", label: "Provider", shrink: true, minWidth: 110, filterable: true },
|
|
11
|
+
{
|
|
12
|
+
key: "query",
|
|
13
|
+
label: "Query",
|
|
14
|
+
grow: true,
|
|
15
|
+
minWidth: 280,
|
|
16
|
+
cellClassName: "font-mono text-xs",
|
|
17
|
+
render: (value) => /* @__PURE__ */ jsxRuntime.jsx("span", { title: String(value ?? ""), children: String(value ?? "") })
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
key: "operations",
|
|
21
|
+
label: "Ops",
|
|
22
|
+
align: "right",
|
|
23
|
+
shrink: true,
|
|
24
|
+
// A request that ran one operation is the ordinary case; showing "1" on
|
|
25
|
+
// every row would bury the four-operation request that is worth noticing.
|
|
26
|
+
render: (value) => Number(value ?? 0) > 1 ? String(value) : ""
|
|
27
|
+
},
|
|
28
|
+
{ key: "rows", label: "Rows", align: "right", shrink: true },
|
|
29
|
+
{
|
|
30
|
+
key: "durationMs",
|
|
31
|
+
label: "Duration",
|
|
32
|
+
align: "right",
|
|
33
|
+
shrink: true,
|
|
34
|
+
render: (value) => `${Number(value ?? 0).toFixed(1)}ms`,
|
|
35
|
+
sortValue: (value) => Number(value ?? 0)
|
|
36
|
+
},
|
|
37
|
+
{ key: "status", label: "Status", kind: "status", shrink: true, minWidth: 90 }
|
|
38
|
+
];
|
|
39
|
+
function QueriesTab({ records, client, search, onSelect }) {
|
|
40
|
+
const rows = react.useMemo(() => records.map(toRow), [records]);
|
|
41
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
42
|
+
DataTable.DataTable,
|
|
43
|
+
{
|
|
44
|
+
data: rows,
|
|
45
|
+
columns: COLUMNS,
|
|
46
|
+
...search === void 0 ? { showGlobalFilter: true } : { globalFilter: search },
|
|
47
|
+
emptyMessage: "No captures yet — run a query with the console open.",
|
|
48
|
+
defaultSort: { key: "time", dir: "desc" },
|
|
49
|
+
onRowClick: (row) => {
|
|
50
|
+
onSelect == null ? void 0 : onSelect(row.record);
|
|
51
|
+
},
|
|
52
|
+
renderExpandedRow: (row) => /* @__PURE__ */ jsxRuntime.jsx(ExecutionDetail.ExecutionDetail, { record: row.record, ...client ? { client } : {} })
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
function toRow(record) {
|
|
57
|
+
const operations = record.operations ?? [];
|
|
58
|
+
const first = operations[0];
|
|
59
|
+
return {
|
|
60
|
+
id: record.id,
|
|
61
|
+
time: record.startedAt,
|
|
62
|
+
surface: record.source.profile ? `${record.source.surface}: ${record.source.profile}` : record.source.surface,
|
|
63
|
+
provider: providerLabel(operations.map((operation) => operation.provider)),
|
|
64
|
+
query: (first == null ? void 0 : first.query) ?? (first == null ? void 0 : first.url) ?? "",
|
|
65
|
+
rows: record.rows,
|
|
66
|
+
durationMs: record.durationMs,
|
|
67
|
+
status: statusLabel(record),
|
|
68
|
+
operations: record.counts.operations,
|
|
69
|
+
record
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
function providerLabel(providers) {
|
|
73
|
+
const distinct = Array.from(new Set(providers.filter(Boolean)));
|
|
74
|
+
if (distinct.length === 0) return "";
|
|
75
|
+
if (distinct.length === 1) return distinct[0];
|
|
76
|
+
return `${distinct[0]} +${distinct.length - 1}`;
|
|
77
|
+
}
|
|
78
|
+
function statusLabel(record) {
|
|
79
|
+
if (record.error) return "error";
|
|
80
|
+
if (typeof record.status === "number" && record.status >= 400) return `error ${record.status}`;
|
|
81
|
+
if (typeof record.status === "number") return String(record.status);
|
|
82
|
+
return "ok";
|
|
83
|
+
}
|
|
84
|
+
exports.QueriesTab = QueriesTab;
|
|
85
|
+
//# sourceMappingURL=QueriesTab.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QueriesTab.cjs","sources":["../../../src/devtools/tabs/QueriesTab.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport { DataTable, type DataTableColumn } from \"../../data/DataTable\";\nimport type { DebugClient } from \"../debugClient\";\nimport { ExecutionDetail } from \"../ExecutionDetail\";\nimport type { ExecutionSummary } from \"../types\";\n\n/**\n * What ran, in the order it ran.\n *\n * One row per request rather than per provider operation: a profile with\n * context sub-queries is one thing the user asked for, and its operations are\n * listed in the detail pane where their relationship is visible. The counts\n * column says how many there were, so a request that quietly ran four queries\n * cannot look like one.\n */\n\nexport type QueriesTabProps = {\n records: ExecutionSummary[];\n client?: DebugClient | undefined;\n /** Search term owned by the console header, shared across tabs. */\n search?: string | undefined;\n /**\n * Called when a row is opened. The Network and Inspection tabs are scoped to\n * one capture, and this is how they learn which.\n */\n onSelect?: ((record: ExecutionSummary) => void) | undefined;\n};\n\ntype QueryRow = Record<string, unknown> & {\n id: string;\n time: string;\n surface: string;\n provider: string;\n query: string;\n rows: number;\n durationMs: number;\n status: string;\n operations: number;\n record: ExecutionSummary;\n};\n\nconst COLUMNS: DataTableColumn<QueryRow>[] = [\n { key: \"time\", label: \"Time\", kind: \"timestamp\", shrink: true, minWidth: 120 },\n { key: \"surface\", label: \"Surface\", shrink: true, minWidth: 100, filterable: true },\n { key: \"provider\", label: \"Provider\", shrink: true, minWidth: 110, filterable: true },\n {\n key: \"query\",\n label: \"Query\",\n grow: true,\n minWidth: 280,\n cellClassName: \"font-mono text-xs\",\n render: (value) => <span title={String(value ?? \"\")}>{String(value ?? \"\")}</span>,\n },\n {\n key: \"operations\",\n label: \"Ops\",\n align: \"right\",\n shrink: true,\n // A request that ran one operation is the ordinary case; showing \"1\" on\n // every row would bury the four-operation request that is worth noticing.\n render: (value) => (Number(value ?? 0) > 1 ? String(value) : \"\"),\n },\n { key: \"rows\", label: \"Rows\", align: \"right\", shrink: true },\n {\n key: \"durationMs\",\n label: \"Duration\",\n align: \"right\",\n shrink: true,\n render: (value) => `${Number(value ?? 0).toFixed(1)}ms`,\n sortValue: (value) => Number(value ?? 0),\n },\n { key: \"status\", label: \"Status\", kind: \"status\", shrink: true, minWidth: 90 },\n];\n\nexport function QueriesTab({ records, client, search, onSelect }: QueriesTabProps) {\n const rows = useMemo(() => records.map(toRow), [records]);\n\n return (\n <DataTable<QueryRow>\n data={rows}\n columns={COLUMNS}\n {...(search === undefined ? { showGlobalFilter: true } : { globalFilter: search })}\n emptyMessage=\"No captures yet — run a query with the console open.\"\n defaultSort={{ key: \"time\", dir: \"desc\" }}\n onRowClick={(row) => {\n onSelect?.(row.record);\n }}\n renderExpandedRow={(row) => <ExecutionDetail record={row.record} {...(client ? { client } : {})} />}\n />\n );\n}\n\nfunction toRow(record: ExecutionSummary): QueryRow {\n const operations = record.operations ?? [];\n const first = operations[0];\n return {\n id: record.id,\n time: record.startedAt,\n surface: record.source.profile\n ? `${record.source.surface}: ${record.source.profile}`\n : record.source.surface,\n provider: providerLabel(operations.map((operation) => operation.provider)),\n query: first?.query ?? first?.url ?? \"\",\n rows: record.rows,\n durationMs: record.durationMs,\n status: statusLabel(record),\n operations: record.counts.operations,\n record,\n };\n}\n\n/** Several providers in one request is a fact about it, not a cell to truncate. */\nfunction providerLabel(providers: string[]): string {\n const distinct = Array.from(new Set(providers.filter(Boolean)));\n if (distinct.length === 0) return \"\";\n if (distinct.length === 1) return distinct[0] as string;\n return `${distinct[0]} +${distinct.length - 1}`;\n}\n\nfunction statusLabel(record: ExecutionSummary): string {\n if (record.error) return \"error\";\n if (typeof record.status === \"number\" && record.status >= 400) return `error ${record.status}`;\n if (typeof record.status === \"number\") return String(record.status);\n return \"ok\";\n}\n"],"names":["jsx","useMemo","DataTable","ExecutionDetail"],"mappings":";;;;;;AAyCA,MAAM,UAAuC;AAAA,EAC3C,EAAE,KAAK,QAAQ,OAAO,QAAQ,MAAM,aAAa,QAAQ,MAAM,UAAU,IAAA;AAAA,EACzE,EAAE,KAAK,WAAW,OAAO,WAAW,QAAQ,MAAM,UAAU,KAAK,YAAY,KAAA;AAAA,EAC7E,EAAE,KAAK,YAAY,OAAO,YAAY,QAAQ,MAAM,UAAU,KAAK,YAAY,KAAA;AAAA,EAC/E;AAAA,IACE,KAAK;AAAA,IACL,OAAO;AAAA,IACP,MAAM;AAAA,IACN,UAAU;AAAA,IACV,eAAe;AAAA,IACf,QAAQ,CAAC,UAAUA,2BAAAA,IAAC,QAAA,EAAK,OAAO,OAAO,SAAS,EAAE,GAAI,UAAA,OAAO,SAAS,EAAE,EAAA,CAAE;AAAA,EAAA;AAAA,EAE5E;AAAA,IACE,KAAK;AAAA,IACL,OAAO;AAAA,IACP,OAAO;AAAA,IACP,QAAQ;AAAA;AAAA;AAAA,IAGR,QAAQ,CAAC,UAAW,OAAO,SAAS,CAAC,IAAI,IAAI,OAAO,KAAK,IAAI;AAAA,EAAA;AAAA,EAE/D,EAAE,KAAK,QAAQ,OAAO,QA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AAA,IACzE,QAAO,+BAAO,WAAS,+BAAO,QAAO;AAAA,IACrC,MAAM,OAAO;AAAA,IACb,YAAY,OAAO;AAAA,IACnB,QAAQ,YAAY,MAAM;AAAA,IAC1B,YAAY,OAAO,OAAO;AAAA,IAC1B;AAAA,EAAA;AAEJ;AAGA,SAAS,cAAc,WAA6B;AAClD,QAAM,WAAW,MAAM,KAAK,IAAI,IAAI,UAAU,OAAO,OAAO,CAAC,CAAC;AAC9D,MAAI,SAAS,WAAW,EAAG,QAAO;AAClC,MAAI,SAAS,WAAW,EAAG,QAAO,SAAS,CAAC;AAC5C,SAAO,GAAG,SAAS,CAAC,CAAC,KAAK,SAAS,SAAS,CAAC;AAC/C;AAEA,SAAS,YAAY,QAAkC;AACrD,MAAI,OAAO,MAAO,QAAO;AACzB,MAAI,OAAO,OAAO,WAAW,YAAY,OAAO,UAAU,IAAK,QAAO,SAAS,OAAO,MAAM;AAC5F,MAAI,OAAO,OAAO,WAAW,SAAU,QAAO,OAAO,OAAO,MAAM;AAClE,SAAO;AACT;;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { DebugClient } from '../debugClient';
|
|
2
|
+
import { ExecutionSummary } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* What ran, in the order it ran.
|
|
5
|
+
*
|
|
6
|
+
* One row per request rather than per provider operation: a profile with
|
|
7
|
+
* context sub-queries is one thing the user asked for, and its operations are
|
|
8
|
+
* listed in the detail pane where their relationship is visible. The counts
|
|
9
|
+
* column says how many there were, so a request that quietly ran four queries
|
|
10
|
+
* cannot look like one.
|
|
11
|
+
*/
|
|
12
|
+
export type QueriesTabProps = {
|
|
13
|
+
records: ExecutionSummary[];
|
|
14
|
+
client?: DebugClient | undefined;
|
|
15
|
+
/** Search term owned by the console header, shared across tabs. */
|
|
16
|
+
search?: string | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Called when a row is opened. The Network and Inspection tabs are scoped to
|
|
19
|
+
* one capture, and this is how they learn which.
|
|
20
|
+
*/
|
|
21
|
+
onSelect?: ((record: ExecutionSummary) => void) | undefined;
|
|
22
|
+
};
|
|
23
|
+
export declare function QueriesTab({ records, client, search, onSelect }: QueriesTabProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
//# sourceMappingURL=QueriesTab.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QueriesTab.d.ts","sourceRoot":"","sources":["../../../src/devtools/tabs/QueriesTab.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD;;;;;;;;GAQG;AAEH,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IACjC,mEAAmE;IACnE,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;CAC7D,CAAC;AAgDF,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,eAAe,2CAgBhF"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { DataTable } from "../../data/DataTable.js";
|
|
4
|
+
import { ExecutionDetail } from "../ExecutionDetail.js";
|
|
5
|
+
const COLUMNS = [
|
|
6
|
+
{ key: "time", label: "Time", kind: "timestamp", shrink: true, minWidth: 120 },
|
|
7
|
+
{ key: "surface", label: "Surface", shrink: true, minWidth: 100, filterable: true },
|
|
8
|
+
{ key: "provider", label: "Provider", shrink: true, minWidth: 110, filterable: true },
|
|
9
|
+
{
|
|
10
|
+
key: "query",
|
|
11
|
+
label: "Query",
|
|
12
|
+
grow: true,
|
|
13
|
+
minWidth: 280,
|
|
14
|
+
cellClassName: "font-mono text-xs",
|
|
15
|
+
render: (value) => /* @__PURE__ */ jsx("span", { title: String(value ?? ""), children: String(value ?? "") })
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
key: "operations",
|
|
19
|
+
label: "Ops",
|
|
20
|
+
align: "right",
|
|
21
|
+
shrink: true,
|
|
22
|
+
// A request that ran one operation is the ordinary case; showing "1" on
|
|
23
|
+
// every row would bury the four-operation request that is worth noticing.
|
|
24
|
+
render: (value) => Number(value ?? 0) > 1 ? String(value) : ""
|
|
25
|
+
},
|
|
26
|
+
{ key: "rows", label: "Rows", align: "right", shrink: true },
|
|
27
|
+
{
|
|
28
|
+
key: "durationMs",
|
|
29
|
+
label: "Duration",
|
|
30
|
+
align: "right",
|
|
31
|
+
shrink: true,
|
|
32
|
+
render: (value) => `${Number(value ?? 0).toFixed(1)}ms`,
|
|
33
|
+
sortValue: (value) => Number(value ?? 0)
|
|
34
|
+
},
|
|
35
|
+
{ key: "status", label: "Status", kind: "status", shrink: true, minWidth: 90 }
|
|
36
|
+
];
|
|
37
|
+
function QueriesTab({ records, client, search, onSelect }) {
|
|
38
|
+
const rows = useMemo(() => records.map(toRow), [records]);
|
|
39
|
+
return /* @__PURE__ */ jsx(
|
|
40
|
+
DataTable,
|
|
41
|
+
{
|
|
42
|
+
data: rows,
|
|
43
|
+
columns: COLUMNS,
|
|
44
|
+
...search === void 0 ? { showGlobalFilter: true } : { globalFilter: search },
|
|
45
|
+
emptyMessage: "No captures yet — run a query with the console open.",
|
|
46
|
+
defaultSort: { key: "time", dir: "desc" },
|
|
47
|
+
onRowClick: (row) => {
|
|
48
|
+
onSelect == null ? void 0 : onSelect(row.record);
|
|
49
|
+
},
|
|
50
|
+
renderExpandedRow: (row) => /* @__PURE__ */ jsx(ExecutionDetail, { record: row.record, ...client ? { client } : {} })
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
function toRow(record) {
|
|
55
|
+
const operations = record.operations ?? [];
|
|
56
|
+
const first = operations[0];
|
|
57
|
+
return {
|
|
58
|
+
id: record.id,
|
|
59
|
+
time: record.startedAt,
|
|
60
|
+
surface: record.source.profile ? `${record.source.surface}: ${record.source.profile}` : record.source.surface,
|
|
61
|
+
provider: providerLabel(operations.map((operation) => operation.provider)),
|
|
62
|
+
query: (first == null ? void 0 : first.query) ?? (first == null ? void 0 : first.url) ?? "",
|
|
63
|
+
rows: record.rows,
|
|
64
|
+
durationMs: record.durationMs,
|
|
65
|
+
status: statusLabel(record),
|
|
66
|
+
operations: record.counts.operations,
|
|
67
|
+
record
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function providerLabel(providers) {
|
|
71
|
+
const distinct = Array.from(new Set(providers.filter(Boolean)));
|
|
72
|
+
if (distinct.length === 0) return "";
|
|
73
|
+
if (distinct.length === 1) return distinct[0];
|
|
74
|
+
return `${distinct[0]} +${distinct.length - 1}`;
|
|
75
|
+
}
|
|
76
|
+
function statusLabel(record) {
|
|
77
|
+
if (record.error) return "error";
|
|
78
|
+
if (typeof record.status === "number" && record.status >= 400) return `error ${record.status}`;
|
|
79
|
+
if (typeof record.status === "number") return String(record.status);
|
|
80
|
+
return "ok";
|
|
81
|
+
}
|
|
82
|
+
export {
|
|
83
|
+
QueriesTab
|
|
84
|
+
};
|
|
85
|
+
//# sourceMappingURL=QueriesTab.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QueriesTab.js","sources":["../../../src/devtools/tabs/QueriesTab.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport { DataTable, type DataTableColumn } from \"../../data/DataTable\";\nimport type { DebugClient } from \"../debugClient\";\nimport { ExecutionDetail } from \"../ExecutionDetail\";\nimport type { ExecutionSummary } from \"../types\";\n\n/**\n * What ran, in the order it ran.\n *\n * One row per request rather than per provider operation: a profile with\n * context sub-queries is one thing the user asked for, and its operations are\n * listed in the detail pane where their relationship is visible. The counts\n * column says how many there were, so a request that quietly ran four queries\n * cannot look like one.\n */\n\nexport type QueriesTabProps = {\n records: ExecutionSummary[];\n client?: DebugClient | undefined;\n /** Search term owned by the console header, shared across tabs. */\n search?: string | undefined;\n /**\n * Called when a row is opened. The Network and Inspection tabs are scoped to\n * one capture, and this is how they learn which.\n */\n onSelect?: ((record: ExecutionSummary) => void) | undefined;\n};\n\ntype QueryRow = Record<string, unknown> & {\n id: string;\n time: string;\n surface: string;\n provider: string;\n query: string;\n rows: number;\n durationMs: number;\n status: string;\n operations: number;\n record: ExecutionSummary;\n};\n\nconst COLUMNS: DataTableColumn<QueryRow>[] = [\n { key: \"time\", label: \"Time\", kind: \"timestamp\", shrink: true, minWidth: 120 },\n { key: \"surface\", label: \"Surface\", shrink: true, minWidth: 100, filterable: true },\n { key: \"provider\", label: \"Provider\", shrink: true, minWidth: 110, filterable: true },\n {\n key: \"query\",\n label: \"Query\",\n grow: true,\n minWidth: 280,\n cellClassName: \"font-mono text-xs\",\n render: (value) => <span title={String(value ?? \"\")}>{String(value ?? \"\")}</span>,\n },\n {\n key: \"operations\",\n label: \"Ops\",\n align: \"right\",\n shrink: true,\n // A request that ran one operation is the ordinary case; showing \"1\" on\n // every row would bury the four-operation request that is worth noticing.\n render: (value) => (Number(value ?? 0) > 1 ? String(value) : \"\"),\n },\n { key: \"rows\", label: \"Rows\", align: \"right\", shrink: true },\n {\n key: \"durationMs\",\n label: \"Duration\",\n align: \"right\",\n shrink: true,\n render: (value) => `${Number(value ?? 0).toFixed(1)}ms`,\n sortValue: (value) => Number(value ?? 0),\n },\n { key: \"status\", label: \"Status\", kind: \"status\", shrink: true, minWidth: 90 },\n];\n\nexport function QueriesTab({ records, client, search, onSelect }: QueriesTabProps) {\n const rows = useMemo(() => records.map(toRow), [records]);\n\n return (\n <DataTable<QueryRow>\n data={rows}\n columns={COLUMNS}\n {...(search === undefined ? { showGlobalFilter: true } : { globalFilter: search })}\n emptyMessage=\"No captures yet — run a query with the console open.\"\n defaultSort={{ key: \"time\", dir: \"desc\" }}\n onRowClick={(row) => {\n onSelect?.(row.record);\n }}\n renderExpandedRow={(row) => <ExecutionDetail record={row.record} {...(client ? { client } : {})} />}\n />\n );\n}\n\nfunction toRow(record: ExecutionSummary): QueryRow {\n const operations = record.operations ?? [];\n const first = operations[0];\n return {\n id: record.id,\n time: record.startedAt,\n surface: record.source.profile\n ? `${record.source.surface}: ${record.source.profile}`\n : record.source.surface,\n provider: providerLabel(operations.map((operation) => operation.provider)),\n query: first?.query ?? first?.url ?? \"\",\n rows: record.rows,\n durationMs: record.durationMs,\n status: statusLabel(record),\n operations: record.counts.operations,\n record,\n };\n}\n\n/** Several providers in one request is a fact about it, not a cell to truncate. */\nfunction providerLabel(providers: string[]): string {\n const distinct = Array.from(new Set(providers.filter(Boolean)));\n if (distinct.length === 0) return \"\";\n if (distinct.length === 1) return distinct[0] as string;\n return `${distinct[0]} +${distinct.length - 1}`;\n}\n\nfunction statusLabel(record: ExecutionSummary): string {\n if (record.error) return \"error\";\n if (typeof record.status === \"number\" && record.status >= 400) return `error ${record.status}`;\n if (typeof record.status === \"number\") return String(record.status);\n return \"ok\";\n}\n"],"names":[],"mappings":";;;;AAyCA,MAAM,UAAuC;AAAA,EAC3C,EAAE,KAAK,QAAQ,OAAO,QAAQ,MAAM,aAAa,QAAQ,MAAM,UAAU,IAAA;AAAA,EACzE,EAAE,KAAK,WAAW,OAAO,WAAW,QAAQ,MAAM,UAAU,KAAK,YAAY,KAAA;AAAA,EAC7E,EAAE,KAAK,YAAY,OAAO,YAAY,QAAQ,MAAM,UAAU,KAAK,YAAY,KAAA;AAAA,EAC/E;AAAA,IACE,KAAK;AAAA,IACL,OAAO;AAAA,IACP,MAAM;AAAA,IACN,UAAU;AAAA,IACV,eAAe;AAAA,IACf,QAAQ,CAAC,UAAU,oBAAC,QAAA,EAAK,OAAO,OAAO,SAAS,EAAE,GA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,WAAW,CAAC;AAC1B,SAAO;AAAA,IACL,IAAI,OAAO;AAAA,IACX,MAAM,OAAO;AAAA,IACb,SAAS,OAAO,OAAO,UACnB,GAAG,OAAO,OAAO,OAAO,KAAK,OAAO,OAAO,OAAO,KAClD,OAAO,OAAO;AAAA,IAClB,UAAU,cAAc,WAAW,IAAI,CAAC,cAAc,UAAU,QAAQ,CAAC;AAAA,IACzE,QAAO,+BAAO,WAAS,+BAAO,QAAO;AAAA,IACrC,MAAM,OAAO;AAAA,IACb,YAAY,OAAO;AAAA,IACnB,QAAQ,YAAY,MAAM;AAAA,IAC1B,YAAY,OAAO,OAAO;AAAA,IAC1B;AAAA,EAAA;AAEJ;AAGA,SAAS,cAAc,WAA6B;AAClD,QAAM,WAAW,MAAM,KAAK,IAAI,IAAI,UAAU,OAAO,OAAO,CAAC,CAAC;AAC9D,MAAI,SAAS,WAAW,EAAG,QAAO;AAClC,MAAI,SAAS,WAAW,EAAG,QAAO,SAAS,CAAC;AAC5C,SAAO,GAAG,SAAS,CAAC,CAAC,KAAK,SAAS,SAAS,CAAC;AAC/C;AAEA,SAAS,YAAY,QAAkC;AACrD,MAAI,OAAO,MAAO,QAAO;AACzB,MAAI,OAAO,OAAO,WAAW,YAAY,OAAO,UAAU,IAAK,QAAO,SAAS,OAAO,MAAM;AAC5F,MAAI,OAAO,OAAO,WAAW,SAAU,QAAO,OAAO,OAAO,MAAM;AAClE,SAAO;AACT;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const DEBUG_TABS = ["queries", "network", "console", "inspection"];
|
|
4
|
+
const SELECTABLE_LEVELS = ["off", "info", "debug", "trace", "trace1", "trace2"];
|
|
5
|
+
const LEVEL_HELP = {
|
|
6
|
+
off: "Nothing is captured and an ordinary run pays nothing",
|
|
7
|
+
info: "Query text, connection, filters, rows, duration and errors",
|
|
8
|
+
debug: "Adds HAR entries and response previews — no bodies are buffered",
|
|
9
|
+
trace: "Adds request headers and the SQL statement itself",
|
|
10
|
+
trace1: "Adds request bodies and bound SQL arguments",
|
|
11
|
+
trace2: "Adds response bodies, with truncation reported"
|
|
12
|
+
};
|
|
13
|
+
const DEFAULT_DEBUG_LEVEL = "debug";
|
|
14
|
+
const DEBUG_LEVEL_HEADER = "X-Debug-Level";
|
|
15
|
+
const DEBUG_ID_HEADER = "X-Debug-Id";
|
|
16
|
+
const DEBUG_REFRESH_HEADER = "X-Debug-Refresh-Inspection";
|
|
17
|
+
const DEBUG_LEVEL_PARAM = "__debug";
|
|
18
|
+
exports.DEBUG_ID_HEADER = DEBUG_ID_HEADER;
|
|
19
|
+
exports.DEBUG_LEVEL_HEADER = DEBUG_LEVEL_HEADER;
|
|
20
|
+
exports.DEBUG_LEVEL_PARAM = DEBUG_LEVEL_PARAM;
|
|
21
|
+
exports.DEBUG_REFRESH_HEADER = DEBUG_REFRESH_HEADER;
|
|
22
|
+
exports.DEBUG_TABS = DEBUG_TABS;
|
|
23
|
+
exports.DEFAULT_DEBUG_LEVEL = DEFAULT_DEBUG_LEVEL;
|
|
24
|
+
exports.LEVEL_HELP = LEVEL_HELP;
|
|
25
|
+
exports.SELECTABLE_LEVELS = SELECTABLE_LEVELS;
|
|
26
|
+
//# sourceMappingURL=types.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.cjs","sources":["../../src/devtools/types.ts"],"sourcesContent":["import type { HARFile, HAREntry } from \"../data/har/types\";\nimport type { QueryBrowserDiagnostics } from \"../data/query-browser/QueryBrowser.types\";\n\n/**\n * The devtools wire types, mirroring the server's `query` package field for\n * field.\n *\n * They are split in two the same way the server splits them. A summary is what\n * every armed request produces and what the stream pushes; a detail carries the\n * bodies, previews and correlated logs and is fetched for one record when\n * someone opens it. A console watching a busy server would otherwise be handed\n * megabytes of response bodies for queries nobody looked at.\n */\n\n/** Capture levels, in the order the server accepts them. */\nexport type DebugLevel =\n | \"off\"\n | \"error\"\n | \"warn\"\n | \"info\"\n | \"debug\"\n | \"trace\"\n | \"trace1\"\n | \"trace2\"\n | \"trace3\"\n | \"trace4\";\n\n/** The seam a recorded request came in on. */\nexport type ExecutionSource = {\n surface: string;\n profile?: string | undefined;\n method?: string | undefined;\n path?: string | undefined;\n /** The client's query string, credential-shaped values blanked. */\n query?: string | undefined;\n};\n\n/**\n * What detail exists to fetch, so a badge can be rendered without paying for\n * the payload behind it.\n */\nexport type RecordCounts = {\n operations: number;\n harEntries: number;\n harDropped: number;\n logLines: number;\n logDropped: number;\n probes: number;\n inspections: number;\n};\n\n/**\n * One provider operation inside a request.\n *\n * A request is routinely more than one — a profile with context sub-queries\n * runs several — and reporting them as a single row is what makes \"which of\n * these three was slow\" unanswerable.\n */\nexport type OperationSummary = {\n /** 1-based, in the order the operations started. */\n index: number;\n provider: string;\n connection?: string | undefined;\n query?: string | undefined;\n method?: string | undefined;\n url?: string | undefined;\n status?: number | undefined;\n durationMs: number;\n rows: number;\n pages?: number | undefined;\n error?: string | undefined;\n};\n\n/** The cheap half: what ran, against what, how long, and how much came back. */\nexport type ExecutionSummary = {\n id: string;\n /** Assigned by the server's store; also the stream's event id. */\n sequence: number;\n source: ExecutionSource;\n startedAt: string;\n durationMs: number;\n rows: number;\n status?: number | undefined;\n error?: string | undefined;\n /**\n * The level this run was armed at. A console showing a record it did not arm\n * needs it to explain why the bodies are missing, rather than implying the\n * request made none.\n */\n level: string;\n operations?: OperationSummary[] | undefined;\n counts: RecordCounts;\n};\n\n/** One line a request logged, or one the process logged while no request owned it. */\nexport type DebugLogLine = {\n sequence: number;\n time: string;\n level: string;\n /** `request` lines are captured structurally; `process` lines are scraped text. */\n source: \"request\" | \"process\" | string;\n logger?: string | undefined;\n event?: string | undefined;\n message: string;\n values?: Record<string, unknown> | undefined;\n recordId?: string | undefined;\n /** Which operation within the request wrote it; 0 when not attributable. */\n operation?: number | undefined;\n};\n\n/** A column-cardinality question and the filter kind its answer chose. */\nexport type CardinalityProbe = {\n provider: string;\n connection?: string | undefined;\n column: string;\n field?: string | undefined;\n distinct: number;\n limit: number;\n kind: string;\n cached: boolean;\n};\n\n/** One inspection-cache lookup a request made. */\nexport type InspectionRecord = {\n policy: string;\n key: string;\n /** ~0 for a hit, the whole fill for a miss. That difference is the point. */\n elapsedMs: number;\n cached: boolean;\n state?: string | undefined;\n refreshing?: boolean | undefined;\n ageMs: number;\n /** A failed refresh behind a value that was still served. */\n refreshError?: string | undefined;\n /** A failure the caller actually got. */\n error?: string | undefined;\n};\n\n/** The expensive half, served for one record on demand. */\nexport type ExecutionDetail = {\n summary: ExecutionSummary;\n operations?: QueryBrowserDiagnostics[] | undefined;\n har?: HARFile | undefined;\n logs?: DebugLogLine[] | undefined;\n probes?: CardinalityProbe[] | undefined;\n inspections?: InspectionRecord[] | undefined;\n /**\n * Credential capture was on, so the HAR entries hold live secrets. Stated\n * rather than refused: a console that hands the file to a colleague has to\n * know which kind of file it is.\n */\n harSensitive?: boolean | undefined;\n};\n\n/**\n * One metadata cache as the server holds it — the other half of the Inspection\n * tab. A record says what one request looked up; this says what is being kept\n * on everyone's behalf, which is the thing a flush throws away.\n */\nexport type InspectionCacheStats = {\n policy: string;\n entries: number;\n maxEntries: number;\n weight: number;\n maxWeight: number;\n /** Loads in flight. Always-filling means the freshness window is too short. */\n filling: number;\n oldest?: string | undefined;\n freshForSeconds: number;\n maxFreshForSeconds: number;\n};\n\nexport type InspectionCaches = {\n caches: InspectionCacheStats[];\n};\n\n/** What a flush actually dropped, per cache. */\nexport type FlushResult = {\n caches: { policy: string; entries: number }[];\n entries: number;\n};\n\n/** What the server's record store currently holds and what it has let go. */\nexport type DebugStats = {\n records: number;\n recordsDropped: number;\n oldestSequence: number;\n logLines: number;\n logsDropped: number;\n logsOldestSequence: number;\n detailsHeld: number;\n detailBytes: number;\n detailsEvicted: number;\n maxDetailBytes: number;\n detailTtlSeconds: number;\n};\n\n/**\n * What this server will do, asked before anything is asked of it — so the UI is\n * not built around constants duplicated on the other side of the wire.\n */\nexport type DebugCapabilities = {\n enabled: boolean;\n levels: string[];\n header: string;\n param: string;\n idHeader: string;\n stats: DebugStats;\n};\n\nexport type DebugRecordsPage = {\n records: ExecutionSummary[];\n stats: DebugStats;\n};\n\n/** The server's answer when a record exists but its detail has aged out. */\nexport type DetailEvicted = {\n code: \"detail_evicted\";\n id: string;\n reason: string;\n};\n\nexport type { HARFile, HAREntry };\n\n/** The console's tabs, in the order they appear. */\nexport const DEBUG_TABS = [\"queries\", \"network\", \"console\", \"inspection\"] as const;\nexport type DebugTab = (typeof DEBUG_TABS)[number];\n\n/**\n * Offered in the level picker, in the order they cost more.\n *\n * A subset of DebugLevel: `error`/`warn` capture less than the summary every\n * run already produces, and trace3/trace4 add nothing this console renders — a\n * picker offering ten options where six differ is a picker nobody reads.\n */\nexport const SELECTABLE_LEVELS: DebugLevel[] = [\"off\", \"info\", \"debug\", \"trace\", \"trace1\", \"trace2\"];\n\n/**\n * What each level buys, stated as the extra capture rather than as a number.\n *\n * These are the *existing* per-event defaults in the server's observability\n * policy, not a scale this console invented — which is why the wording names\n * concrete artifacts (HAR entries, the SQL statement, response bodies).\n */\nexport const LEVEL_HELP: Record<string, string> = {\n off: \"Nothing is captured and an ordinary run pays nothing\",\n info: \"Query text, connection, filters, rows, duration and errors\",\n debug: \"Adds HAR entries and response previews — no bodies are buffered\",\n trace: \"Adds request headers and the SQL statement itself\",\n trace1: \"Adds request bodies and bound SQL arguments\",\n trace2: \"Adds response bodies, with truncation reported\",\n};\n\n/** Default arming level. `debug` buys HAR entries without buffering bodies. */\nexport const DEFAULT_DEBUG_LEVEL: DebugLevel = \"debug\";\n\n/** The header a request arms itself with, and the one the response answers by. */\nexport const DEBUG_LEVEL_HEADER = \"X-Debug-Level\";\nexport const DEBUG_ID_HEADER = \"X-Debug-Id\";\n/**\n * Asks a request to rebuild every metadata lookup it makes rather than read\n * what is cached.\n *\n * It rides per-request so the cost lands on the caller who asked and on nobody\n * else — unlike flushing, which drops the entry for everyone. The console keeps\n * it on until it is switched off, and drops it when the console closes, exactly\n * as it does the capture level.\n */\nexport const DEBUG_REFRESH_HEADER = \"X-Debug-Refresh-Inspection\";\n/** Says the same thing as the header for a caller that cannot set one. */\nexport const DEBUG_LEVEL_PARAM = \"__debug\";\n"],"names":[],"mappings":";;AAiOO,MAAM,aAAa,CAAC,WAAW,WAAW,WAAW,YAAY;AAUjE,MAAM,oBAAkC,CAAC,OAAO,QAAQ,SAAS,SAAS,UAAU,QAAQ;AAS5F,MAAM,aAAqC;AAAA,EAChD,KAAK;AAAA,EACL,MAAM;AAAA,EACN,OAAO;AAAA,EACP,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AACV;AAGO,MAAM,sBAAkC;AAGxC,MAAM,qBAAqB;AAC3B,MAAM,kBAAkB;AAUxB,MAAM,uBAAuB;AAE7B,MAAM,oBAAoB;;;;;;;;;"}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { HARFile, HAREntry } from '../data/har/types';
|
|
2
|
+
import { QueryBrowserDiagnostics } from '../data/query-browser/QueryBrowser.types';
|
|
3
|
+
/**
|
|
4
|
+
* The devtools wire types, mirroring the server's `query` package field for
|
|
5
|
+
* field.
|
|
6
|
+
*
|
|
7
|
+
* They are split in two the same way the server splits them. A summary is what
|
|
8
|
+
* every armed request produces and what the stream pushes; a detail carries the
|
|
9
|
+
* bodies, previews and correlated logs and is fetched for one record when
|
|
10
|
+
* someone opens it. A console watching a busy server would otherwise be handed
|
|
11
|
+
* megabytes of response bodies for queries nobody looked at.
|
|
12
|
+
*/
|
|
13
|
+
/** Capture levels, in the order the server accepts them. */
|
|
14
|
+
export type DebugLevel = "off" | "error" | "warn" | "info" | "debug" | "trace" | "trace1" | "trace2" | "trace3" | "trace4";
|
|
15
|
+
/** The seam a recorded request came in on. */
|
|
16
|
+
export type ExecutionSource = {
|
|
17
|
+
surface: string;
|
|
18
|
+
profile?: string | undefined;
|
|
19
|
+
method?: string | undefined;
|
|
20
|
+
path?: string | undefined;
|
|
21
|
+
/** The client's query string, credential-shaped values blanked. */
|
|
22
|
+
query?: string | undefined;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* What detail exists to fetch, so a badge can be rendered without paying for
|
|
26
|
+
* the payload behind it.
|
|
27
|
+
*/
|
|
28
|
+
export type RecordCounts = {
|
|
29
|
+
operations: number;
|
|
30
|
+
harEntries: number;
|
|
31
|
+
harDropped: number;
|
|
32
|
+
logLines: number;
|
|
33
|
+
logDropped: number;
|
|
34
|
+
probes: number;
|
|
35
|
+
inspections: number;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* One provider operation inside a request.
|
|
39
|
+
*
|
|
40
|
+
* A request is routinely more than one — a profile with context sub-queries
|
|
41
|
+
* runs several — and reporting them as a single row is what makes "which of
|
|
42
|
+
* these three was slow" unanswerable.
|
|
43
|
+
*/
|
|
44
|
+
export type OperationSummary = {
|
|
45
|
+
/** 1-based, in the order the operations started. */
|
|
46
|
+
index: number;
|
|
47
|
+
provider: string;
|
|
48
|
+
connection?: string | undefined;
|
|
49
|
+
query?: string | undefined;
|
|
50
|
+
method?: string | undefined;
|
|
51
|
+
url?: string | undefined;
|
|
52
|
+
status?: number | undefined;
|
|
53
|
+
durationMs: number;
|
|
54
|
+
rows: number;
|
|
55
|
+
pages?: number | undefined;
|
|
56
|
+
error?: string | undefined;
|
|
57
|
+
};
|
|
58
|
+
/** The cheap half: what ran, against what, how long, and how much came back. */
|
|
59
|
+
export type ExecutionSummary = {
|
|
60
|
+
id: string;
|
|
61
|
+
/** Assigned by the server's store; also the stream's event id. */
|
|
62
|
+
sequence: number;
|
|
63
|
+
source: ExecutionSource;
|
|
64
|
+
startedAt: string;
|
|
65
|
+
durationMs: number;
|
|
66
|
+
rows: number;
|
|
67
|
+
status?: number | undefined;
|
|
68
|
+
error?: string | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* The level this run was armed at. A console showing a record it did not arm
|
|
71
|
+
* needs it to explain why the bodies are missing, rather than implying the
|
|
72
|
+
* request made none.
|
|
73
|
+
*/
|
|
74
|
+
level: string;
|
|
75
|
+
operations?: OperationSummary[] | undefined;
|
|
76
|
+
counts: RecordCounts;
|
|
77
|
+
};
|
|
78
|
+
/** One line a request logged, or one the process logged while no request owned it. */
|
|
79
|
+
export type DebugLogLine = {
|
|
80
|
+
sequence: number;
|
|
81
|
+
time: string;
|
|
82
|
+
level: string;
|
|
83
|
+
/** `request` lines are captured structurally; `process` lines are scraped text. */
|
|
84
|
+
source: "request" | "process" | string;
|
|
85
|
+
logger?: string | undefined;
|
|
86
|
+
event?: string | undefined;
|
|
87
|
+
message: string;
|
|
88
|
+
values?: Record<string, unknown> | undefined;
|
|
89
|
+
recordId?: string | undefined;
|
|
90
|
+
/** Which operation within the request wrote it; 0 when not attributable. */
|
|
91
|
+
operation?: number | undefined;
|
|
92
|
+
};
|
|
93
|
+
/** A column-cardinality question and the filter kind its answer chose. */
|
|
94
|
+
export type CardinalityProbe = {
|
|
95
|
+
provider: string;
|
|
96
|
+
connection?: string | undefined;
|
|
97
|
+
column: string;
|
|
98
|
+
field?: string | undefined;
|
|
99
|
+
distinct: number;
|
|
100
|
+
limit: number;
|
|
101
|
+
kind: string;
|
|
102
|
+
cached: boolean;
|
|
103
|
+
};
|
|
104
|
+
/** One inspection-cache lookup a request made. */
|
|
105
|
+
export type InspectionRecord = {
|
|
106
|
+
policy: string;
|
|
107
|
+
key: string;
|
|
108
|
+
/** ~0 for a hit, the whole fill for a miss. That difference is the point. */
|
|
109
|
+
elapsedMs: number;
|
|
110
|
+
cached: boolean;
|
|
111
|
+
state?: string | undefined;
|
|
112
|
+
refreshing?: boolean | undefined;
|
|
113
|
+
ageMs: number;
|
|
114
|
+
/** A failed refresh behind a value that was still served. */
|
|
115
|
+
refreshError?: string | undefined;
|
|
116
|
+
/** A failure the caller actually got. */
|
|
117
|
+
error?: string | undefined;
|
|
118
|
+
};
|
|
119
|
+
/** The expensive half, served for one record on demand. */
|
|
120
|
+
export type ExecutionDetail = {
|
|
121
|
+
summary: ExecutionSummary;
|
|
122
|
+
operations?: QueryBrowserDiagnostics[] | undefined;
|
|
123
|
+
har?: HARFile | undefined;
|
|
124
|
+
logs?: DebugLogLine[] | undefined;
|
|
125
|
+
probes?: CardinalityProbe[] | undefined;
|
|
126
|
+
inspections?: InspectionRecord[] | undefined;
|
|
127
|
+
/**
|
|
128
|
+
* Credential capture was on, so the HAR entries hold live secrets. Stated
|
|
129
|
+
* rather than refused: a console that hands the file to a colleague has to
|
|
130
|
+
* know which kind of file it is.
|
|
131
|
+
*/
|
|
132
|
+
harSensitive?: boolean | undefined;
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* One metadata cache as the server holds it — the other half of the Inspection
|
|
136
|
+
* tab. A record says what one request looked up; this says what is being kept
|
|
137
|
+
* on everyone's behalf, which is the thing a flush throws away.
|
|
138
|
+
*/
|
|
139
|
+
export type InspectionCacheStats = {
|
|
140
|
+
policy: string;
|
|
141
|
+
entries: number;
|
|
142
|
+
maxEntries: number;
|
|
143
|
+
weight: number;
|
|
144
|
+
maxWeight: number;
|
|
145
|
+
/** Loads in flight. Always-filling means the freshness window is too short. */
|
|
146
|
+
filling: number;
|
|
147
|
+
oldest?: string | undefined;
|
|
148
|
+
freshForSeconds: number;
|
|
149
|
+
maxFreshForSeconds: number;
|
|
150
|
+
};
|
|
151
|
+
export type InspectionCaches = {
|
|
152
|
+
caches: InspectionCacheStats[];
|
|
153
|
+
};
|
|
154
|
+
/** What a flush actually dropped, per cache. */
|
|
155
|
+
export type FlushResult = {
|
|
156
|
+
caches: {
|
|
157
|
+
policy: string;
|
|
158
|
+
entries: number;
|
|
159
|
+
}[];
|
|
160
|
+
entries: number;
|
|
161
|
+
};
|
|
162
|
+
/** What the server's record store currently holds and what it has let go. */
|
|
163
|
+
export type DebugStats = {
|
|
164
|
+
records: number;
|
|
165
|
+
recordsDropped: number;
|
|
166
|
+
oldestSequence: number;
|
|
167
|
+
logLines: number;
|
|
168
|
+
logsDropped: number;
|
|
169
|
+
logsOldestSequence: number;
|
|
170
|
+
detailsHeld: number;
|
|
171
|
+
detailBytes: number;
|
|
172
|
+
detailsEvicted: number;
|
|
173
|
+
maxDetailBytes: number;
|
|
174
|
+
detailTtlSeconds: number;
|
|
175
|
+
};
|
|
176
|
+
/**
|
|
177
|
+
* What this server will do, asked before anything is asked of it — so the UI is
|
|
178
|
+
* not built around constants duplicated on the other side of the wire.
|
|
179
|
+
*/
|
|
180
|
+
export type DebugCapabilities = {
|
|
181
|
+
enabled: boolean;
|
|
182
|
+
levels: string[];
|
|
183
|
+
header: string;
|
|
184
|
+
param: string;
|
|
185
|
+
idHeader: string;
|
|
186
|
+
stats: DebugStats;
|
|
187
|
+
};
|
|
188
|
+
export type DebugRecordsPage = {
|
|
189
|
+
records: ExecutionSummary[];
|
|
190
|
+
stats: DebugStats;
|
|
191
|
+
};
|
|
192
|
+
/** The server's answer when a record exists but its detail has aged out. */
|
|
193
|
+
export type DetailEvicted = {
|
|
194
|
+
code: "detail_evicted";
|
|
195
|
+
id: string;
|
|
196
|
+
reason: string;
|
|
197
|
+
};
|
|
198
|
+
export type { HARFile, HAREntry };
|
|
199
|
+
/** The console's tabs, in the order they appear. */
|
|
200
|
+
export declare const DEBUG_TABS: readonly ["queries", "network", "console", "inspection"];
|
|
201
|
+
export type DebugTab = (typeof DEBUG_TABS)[number];
|
|
202
|
+
/**
|
|
203
|
+
* Offered in the level picker, in the order they cost more.
|
|
204
|
+
*
|
|
205
|
+
* A subset of DebugLevel: `error`/`warn` capture less than the summary every
|
|
206
|
+
* run already produces, and trace3/trace4 add nothing this console renders — a
|
|
207
|
+
* picker offering ten options where six differ is a picker nobody reads.
|
|
208
|
+
*/
|
|
209
|
+
export declare const SELECTABLE_LEVELS: DebugLevel[];
|
|
210
|
+
/**
|
|
211
|
+
* What each level buys, stated as the extra capture rather than as a number.
|
|
212
|
+
*
|
|
213
|
+
* These are the *existing* per-event defaults in the server's observability
|
|
214
|
+
* policy, not a scale this console invented — which is why the wording names
|
|
215
|
+
* concrete artifacts (HAR entries, the SQL statement, response bodies).
|
|
216
|
+
*/
|
|
217
|
+
export declare const LEVEL_HELP: Record<string, string>;
|
|
218
|
+
/** Default arming level. `debug` buys HAR entries without buffering bodies. */
|
|
219
|
+
export declare const DEFAULT_DEBUG_LEVEL: DebugLevel;
|
|
220
|
+
/** The header a request arms itself with, and the one the response answers by. */
|
|
221
|
+
export declare const DEBUG_LEVEL_HEADER = "X-Debug-Level";
|
|
222
|
+
export declare const DEBUG_ID_HEADER = "X-Debug-Id";
|
|
223
|
+
/**
|
|
224
|
+
* Asks a request to rebuild every metadata lookup it makes rather than read
|
|
225
|
+
* what is cached.
|
|
226
|
+
*
|
|
227
|
+
* It rides per-request so the cost lands on the caller who asked and on nobody
|
|
228
|
+
* else — unlike flushing, which drops the entry for everyone. The console keeps
|
|
229
|
+
* it on until it is switched off, and drops it when the console closes, exactly
|
|
230
|
+
* as it does the capture level.
|
|
231
|
+
*/
|
|
232
|
+
export declare const DEBUG_REFRESH_HEADER = "X-Debug-Refresh-Inspection";
|
|
233
|
+
/** Says the same thing as the header for a caller that cannot set one. */
|
|
234
|
+
export declare const DEBUG_LEVEL_PARAM = "__debug";
|
|
235
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/devtools/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AAExF;;;;;;;;;GASG;AAEH,4DAA4D;AAC5D,MAAM,MAAM,UAAU,GAClB,KAAK,GACL,OAAO,GACP,MAAM,GACN,MAAM,GACN,OAAO,GACP,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,QAAQ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EAAE,QAAQ,EAAE,CAAC;AAElC,oDAAoD;AACpD,eAAO,MAAM,UAAU,0DAA2D,CAAC;AACnF,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnD;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,EAAE,UAAU,EAA0D,CAAC;AAErG;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAO7C,CAAC;AAEF,+EAA+E;AAC/E,eAAO,MAAM,mBAAmB,EAAE,UAAoB,CAAC;AAEvD,kFAAkF;AAClF,eAAO,MAAM,kBAAkB,kBAAkB,CAAC;AAClD,eAAO,MAAM,eAAe,eAAe,CAAC;AAC5C;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,+BAA+B,CAAC;AACjE,0EAA0E;AAC1E,eAAO,MAAM,iBAAiB,YAAY,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const DEBUG_TABS = ["queries", "network", "console", "inspection"];
|
|
2
|
+
const SELECTABLE_LEVELS = ["off", "info", "debug", "trace", "trace1", "trace2"];
|
|
3
|
+
const LEVEL_HELP = {
|
|
4
|
+
off: "Nothing is captured and an ordinary run pays nothing",
|
|
5
|
+
info: "Query text, connection, filters, rows, duration and errors",
|
|
6
|
+
debug: "Adds HAR entries and response previews — no bodies are buffered",
|
|
7
|
+
trace: "Adds request headers and the SQL statement itself",
|
|
8
|
+
trace1: "Adds request bodies and bound SQL arguments",
|
|
9
|
+
trace2: "Adds response bodies, with truncation reported"
|
|
10
|
+
};
|
|
11
|
+
const DEFAULT_DEBUG_LEVEL = "debug";
|
|
12
|
+
const DEBUG_LEVEL_HEADER = "X-Debug-Level";
|
|
13
|
+
const DEBUG_ID_HEADER = "X-Debug-Id";
|
|
14
|
+
const DEBUG_REFRESH_HEADER = "X-Debug-Refresh-Inspection";
|
|
15
|
+
const DEBUG_LEVEL_PARAM = "__debug";
|
|
16
|
+
export {
|
|
17
|
+
DEBUG_ID_HEADER,
|
|
18
|
+
DEBUG_LEVEL_HEADER,
|
|
19
|
+
DEBUG_LEVEL_PARAM,
|
|
20
|
+
DEBUG_REFRESH_HEADER,
|
|
21
|
+
DEBUG_TABS,
|
|
22
|
+
DEFAULT_DEBUG_LEVEL,
|
|
23
|
+
LEVEL_HELP,
|
|
24
|
+
SELECTABLE_LEVELS
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../src/devtools/types.ts"],"sourcesContent":["import type { HARFile, HAREntry } from \"../data/har/types\";\nimport type { QueryBrowserDiagnostics } from \"../data/query-browser/QueryBrowser.types\";\n\n/**\n * The devtools wire types, mirroring the server's `query` package field for\n * field.\n *\n * They are split in two the same way the server splits them. A summary is what\n * every armed request produces and what the stream pushes; a detail carries the\n * bodies, previews and correlated logs and is fetched for one record when\n * someone opens it. A console watching a busy server would otherwise be handed\n * megabytes of response bodies for queries nobody looked at.\n */\n\n/** Capture levels, in the order the server accepts them. */\nexport type DebugLevel =\n | \"off\"\n | \"error\"\n | \"warn\"\n | \"info\"\n | \"debug\"\n | \"trace\"\n | \"trace1\"\n | \"trace2\"\n | \"trace3\"\n | \"trace4\";\n\n/** The seam a recorded request came in on. */\nexport type ExecutionSource = {\n surface: string;\n profile?: string | undefined;\n method?: string | undefined;\n path?: string | undefined;\n /** The client's query string, credential-shaped values blanked. */\n query?: string | undefined;\n};\n\n/**\n * What detail exists to fetch, so a badge can be rendered without paying for\n * the payload behind it.\n */\nexport type RecordCounts = {\n operations: number;\n harEntries: number;\n harDropped: number;\n logLines: number;\n logDropped: number;\n probes: number;\n inspections: number;\n};\n\n/**\n * One provider operation inside a request.\n *\n * A request is routinely more than one — a profile with context sub-queries\n * runs several — and reporting them as a single row is what makes \"which of\n * these three was slow\" unanswerable.\n */\nexport type OperationSummary = {\n /** 1-based, in the order the operations started. */\n index: number;\n provider: string;\n connection?: string | undefined;\n query?: string | undefined;\n method?: string | undefined;\n url?: string | undefined;\n status?: number | undefined;\n durationMs: number;\n rows: number;\n pages?: number | undefined;\n error?: string | undefined;\n};\n\n/** The cheap half: what ran, against what, how long, and how much came back. */\nexport type ExecutionSummary = {\n id: string;\n /** Assigned by the server's store; also the stream's event id. */\n sequence: number;\n source: ExecutionSource;\n startedAt: string;\n durationMs: number;\n rows: number;\n status?: number | undefined;\n error?: string | undefined;\n /**\n * The level this run was armed at. A console showing a record it did not arm\n * needs it to explain why the bodies are missing, rather than implying the\n * request made none.\n */\n level: string;\n operations?: OperationSummary[] | undefined;\n counts: RecordCounts;\n};\n\n/** One line a request logged, or one the process logged while no request owned it. */\nexport type DebugLogLine = {\n sequence: number;\n time: string;\n level: string;\n /** `request` lines are captured structurally; `process` lines are scraped text. */\n source: \"request\" | \"process\" | string;\n logger?: string | undefined;\n event?: string | undefined;\n message: string;\n values?: Record<string, unknown> | undefined;\n recordId?: string | undefined;\n /** Which operation within the request wrote it; 0 when not attributable. */\n operation?: number | undefined;\n};\n\n/** A column-cardinality question and the filter kind its answer chose. */\nexport type CardinalityProbe = {\n provider: string;\n connection?: string | undefined;\n column: string;\n field?: string | undefined;\n distinct: number;\n limit: number;\n kind: string;\n cached: boolean;\n};\n\n/** One inspection-cache lookup a request made. */\nexport type InspectionRecord = {\n policy: string;\n key: string;\n /** ~0 for a hit, the whole fill for a miss. That difference is the point. */\n elapsedMs: number;\n cached: boolean;\n state?: string | undefined;\n refreshing?: boolean | undefined;\n ageMs: number;\n /** A failed refresh behind a value that was still served. */\n refreshError?: string | undefined;\n /** A failure the caller actually got. */\n error?: string | undefined;\n};\n\n/** The expensive half, served for one record on demand. */\nexport type ExecutionDetail = {\n summary: ExecutionSummary;\n operations?: QueryBrowserDiagnostics[] | undefined;\n har?: HARFile | undefined;\n logs?: DebugLogLine[] | undefined;\n probes?: CardinalityProbe[] | undefined;\n inspections?: InspectionRecord[] | undefined;\n /**\n * Credential capture was on, so the HAR entries hold live secrets. Stated\n * rather than refused: a console that hands the file to a colleague has to\n * know which kind of file it is.\n */\n harSensitive?: boolean | undefined;\n};\n\n/**\n * One metadata cache as the server holds it — the other half of the Inspection\n * tab. A record says what one request looked up; this says what is being kept\n * on everyone's behalf, which is the thing a flush throws away.\n */\nexport type InspectionCacheStats = {\n policy: string;\n entries: number;\n maxEntries: number;\n weight: number;\n maxWeight: number;\n /** Loads in flight. Always-filling means the freshness window is too short. */\n filling: number;\n oldest?: string | undefined;\n freshForSeconds: number;\n maxFreshForSeconds: number;\n};\n\nexport type InspectionCaches = {\n caches: InspectionCacheStats[];\n};\n\n/** What a flush actually dropped, per cache. */\nexport type FlushResult = {\n caches: { policy: string; entries: number }[];\n entries: number;\n};\n\n/** What the server's record store currently holds and what it has let go. */\nexport type DebugStats = {\n records: number;\n recordsDropped: number;\n oldestSequence: number;\n logLines: number;\n logsDropped: number;\n logsOldestSequence: number;\n detailsHeld: number;\n detailBytes: number;\n detailsEvicted: number;\n maxDetailBytes: number;\n detailTtlSeconds: number;\n};\n\n/**\n * What this server will do, asked before anything is asked of it — so the UI is\n * not built around constants duplicated on the other side of the wire.\n */\nexport type DebugCapabilities = {\n enabled: boolean;\n levels: string[];\n header: string;\n param: string;\n idHeader: string;\n stats: DebugStats;\n};\n\nexport type DebugRecordsPage = {\n records: ExecutionSummary[];\n stats: DebugStats;\n};\n\n/** The server's answer when a record exists but its detail has aged out. */\nexport type DetailEvicted = {\n code: \"detail_evicted\";\n id: string;\n reason: string;\n};\n\nexport type { HARFile, HAREntry };\n\n/** The console's tabs, in the order they appear. */\nexport const DEBUG_TABS = [\"queries\", \"network\", \"console\", \"inspection\"] as const;\nexport type DebugTab = (typeof DEBUG_TABS)[number];\n\n/**\n * Offered in the level picker, in the order they cost more.\n *\n * A subset of DebugLevel: `error`/`warn` capture less than the summary every\n * run already produces, and trace3/trace4 add nothing this console renders — a\n * picker offering ten options where six differ is a picker nobody reads.\n */\nexport const SELECTABLE_LEVELS: DebugLevel[] = [\"off\", \"info\", \"debug\", \"trace\", \"trace1\", \"trace2\"];\n\n/**\n * What each level buys, stated as the extra capture rather than as a number.\n *\n * These are the *existing* per-event defaults in the server's observability\n * policy, not a scale this console invented — which is why the wording names\n * concrete artifacts (HAR entries, the SQL statement, response bodies).\n */\nexport const LEVEL_HELP: Record<string, string> = {\n off: \"Nothing is captured and an ordinary run pays nothing\",\n info: \"Query text, connection, filters, rows, duration and errors\",\n debug: \"Adds HAR entries and response previews — no bodies are buffered\",\n trace: \"Adds request headers and the SQL statement itself\",\n trace1: \"Adds request bodies and bound SQL arguments\",\n trace2: \"Adds response bodies, with truncation reported\",\n};\n\n/** Default arming level. `debug` buys HAR entries without buffering bodies. */\nexport const DEFAULT_DEBUG_LEVEL: DebugLevel = \"debug\";\n\n/** The header a request arms itself with, and the one the response answers by. */\nexport const DEBUG_LEVEL_HEADER = \"X-Debug-Level\";\nexport const DEBUG_ID_HEADER = \"X-Debug-Id\";\n/**\n * Asks a request to rebuild every metadata lookup it makes rather than read\n * what is cached.\n *\n * It rides per-request so the cost lands on the caller who asked and on nobody\n * else — unlike flushing, which drops the entry for everyone. The console keeps\n * it on until it is switched off, and drops it when the console closes, exactly\n * as it does the capture level.\n */\nexport const DEBUG_REFRESH_HEADER = \"X-Debug-Refresh-Inspection\";\n/** Says the same thing as the header for a caller that cannot set one. */\nexport const DEBUG_LEVEL_PARAM = \"__debug\";\n"],"names":[],"mappings":"AAiOO,MAAM,aAAa,CAAC,WAAW,WAAW,WAAW,YAAY;AAUjE,MAAM,oBAAkC,CAAC,OAAO,QAAQ,SAAS,SAAS,UAAU,QAAQ;AAS5F,MAAM,aAAqC;AAAA,EAChD,KAAK;AAAA,EACL,MAAM;AAAA,EACN,OAAO;AAAA,EACP,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AACV;AAGO,MAAM,sBAAkC;AAGxC,MAAM,qBAAqB;AAC3B,MAAM,kBAAkB;AAUxB,MAAM,uBAAuB;AAE7B,MAAM,oBAAoB;"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const react = require("react");
|
|
4
|
+
const debugClient = require("./debugClient.cjs");
|
|
5
|
+
const debugStore = require("./debugStore.cjs");
|
|
6
|
+
function useDebugStream(options) {
|
|
7
|
+
const store = options.store ?? debugStore.debugStore;
|
|
8
|
+
const state = react.useSyncExternalStore(store.subscribe, store.getSnapshot, store.getSnapshot);
|
|
9
|
+
react.useEffect(() => {
|
|
10
|
+
if (!options.enabled) {
|
|
11
|
+
store.setConnected(false);
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
const client = options.client ?? new debugClient.DebugClient();
|
|
15
|
+
const create = options.createEventSource ?? ((url) => new EventSource(url));
|
|
16
|
+
const source = create(client.streamUrl(store.lastSequence()));
|
|
17
|
+
const onRecord = (event) => {
|
|
18
|
+
const record = parse(event.data);
|
|
19
|
+
if (record) store.addRecord(record);
|
|
20
|
+
};
|
|
21
|
+
const onLog = (event) => {
|
|
22
|
+
const line = parse(event.data);
|
|
23
|
+
if (line) store.addLog(line);
|
|
24
|
+
};
|
|
25
|
+
source.addEventListener("record", onRecord);
|
|
26
|
+
source.addEventListener("log", onLog);
|
|
27
|
+
source.onopen = () => store.setConnected(true);
|
|
28
|
+
source.onerror = () => store.setConnected(false, "reconnecting to the devtools stream");
|
|
29
|
+
return () => {
|
|
30
|
+
source.removeEventListener("record", onRecord);
|
|
31
|
+
source.removeEventListener("log", onLog);
|
|
32
|
+
source.close();
|
|
33
|
+
store.setConnected(false);
|
|
34
|
+
};
|
|
35
|
+
}, [options.enabled, options.client, options.createEventSource, store]);
|
|
36
|
+
return state;
|
|
37
|
+
}
|
|
38
|
+
function parse(data) {
|
|
39
|
+
try {
|
|
40
|
+
return JSON.parse(data);
|
|
41
|
+
} catch {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.useDebugStream = useDebugStream;
|
|
46
|
+
//# sourceMappingURL=useDebugStream.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDebugStream.cjs","sources":["../../src/devtools/useDebugStream.ts"],"sourcesContent":["import { useEffect, useSyncExternalStore } from \"react\";\nimport { DebugClient } from \"./debugClient\";\nimport { debugStore, type DebugStore, type DebugStoreState } from \"./debugStore\";\nimport type { DebugLogLine, ExecutionSummary } from \"./types\";\n\n/**\n * The console's live connection: one SSE stream carrying both records and log\n * lines.\n *\n * One stream, not two, because an HTTP/1.1 origin gets six connections and this\n * server already holds session streams on the same one. The frames are tagged,\n * so the split happens here rather than on the wire.\n */\n\nexport type UseDebugStreamOptions = {\n /** Off by default — a closed console must not hold a connection open. */\n enabled: boolean;\n client?: DebugClient | undefined;\n store?: DebugStore | undefined;\n /**\n * Builds the EventSource. Injected so a test can drive frames without a\n * server, and so a host with its own auth wrapper can supply one.\n */\n createEventSource?: ((url: string) => EventSource) | undefined;\n};\n\nexport function useDebugStream(options: UseDebugStreamOptions): DebugStoreState {\n const store = options.store ?? debugStore;\n const state = useSyncExternalStore(store.subscribe, store.getSnapshot, store.getSnapshot);\n\n useEffect(() => {\n if (!options.enabled) {\n store.setConnected(false);\n return;\n }\n const client = options.client ?? new DebugClient();\n const create = options.createEventSource ?? ((url: string) => new EventSource(url));\n const source = create(client.streamUrl(store.lastSequence()));\n\n const onRecord = (event: MessageEvent) => {\n const record = parse<ExecutionSummary>(event.data);\n if (record) store.addRecord(record);\n };\n const onLog = (event: MessageEvent) => {\n const line = parse<DebugLogLine>(event.data);\n if (line) store.addLog(line);\n };\n\n source.addEventListener(\"record\", onRecord as EventListener);\n source.addEventListener(\"log\", onLog as EventListener);\n source.onopen = () => store.setConnected(true);\n // EventSource reconnects on its own and resumes from Last-Event-ID, so this\n // reports the gap rather than tearing the stream down and rebuilding it.\n source.onerror = () => store.setConnected(false, \"reconnecting to the devtools stream\");\n\n return () => {\n source.removeEventListener(\"record\", onRecord as EventListener);\n source.removeEventListener(\"log\", onLog as EventListener);\n source.close();\n store.setConnected(false);\n };\n }, [options.enabled, options.client, options.createEventSource, store]);\n\n return state;\n}\n\nfunction parse<T>(data: string): T | null {\n try {\n return JSON.parse(data) as T;\n } catch {\n // A malformed frame is the server's bug, not a reason to drop the stream:\n // the next frame is very likely fine, and a console that went blank here\n // would hide every record that follows.\n return null;\n }\n}\n"],"names":["debugStore","useSyncExternalStore","useEffect","DebugClient"],"mappings":";;;;;AA0BO,SAAS,eAAe,SAAiD;AAC9E,QAAM,QAAQ,QAAQ,SAASA,WAAAA;AAC/B,QAAM,QAAQC,MAAAA,qBAAqB,MAAM,WAAW,MAAM,aAAa,MAAM,WAAW;AAExFC,QAAAA,UAAU,MAAM;AACd,QAAI,CAAC,QAAQ,SAAS;AACpB,YAAM,aAAa,KAAK;AACxB;AAAA,IACF;AACA,UAAM,SAAS,QAAQ,UAAU,IAAIC,YAAAA,YAAA;AACrC,UAAM,SAAS,QAAQ,sBAAsB,CAAC,QAAgB,IAAI,YAAY,GAAG;AACjF,UAAM,SAAS,OAAO,OAAO,UAAU,MAAM,aAAA,CAAc,CAAC;AAE5D,UAAM,WAAW,CAAC,UAAwB;AACxC,YAAM,SAAS,MAAwB,MAAM,IAAI;AACjD,UAAI,OAAQ,OAAM,UAAU,MAAM;AAAA,IACpC;AACA,UAAM,QAAQ,CAAC,UAAwB;AACrC,YAAM,OAAO,MAAoB,MAAM,IAAI;AAC3C,UAAI,KAAM,OAAM,OAAO,IAAI;AAAA,IAC7B;AAEA,WAAO,iBAAiB,UAAU,QAAyB;AAC3D,WAAO,iBAAiB,OAAO,KAAsB;AACrD,WAAO,SAAS,MAAM,MAAM,aAAa,IAAI;AAG7C,WAAO,UAAU,MAAM,MAAM,aAAa,OAAO,qCAAqC;AAEtF,WAAO,MAAM;AACX,aAAO,oBAAoB,UAAU,QAAyB;AAC9D,aAAO,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