@mks2508/mks-ui 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react-ui/blocks/Terminal/ResttyAdapter.d.ts +146 -0
- package/dist/react-ui/blocks/Terminal/ResttyAdapter.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/ResttyAdapter.js +213 -0
- package/dist/react-ui/blocks/Terminal/Terminal.adapter.d.ts +55 -0
- package/dist/react-ui/blocks/Terminal/Terminal.adapter.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/Terminal.adapter.js +68 -0
- package/dist/react-ui/blocks/Terminal/Terminal.theme.d.ts +43 -0
- package/dist/react-ui/blocks/Terminal/Terminal.theme.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/Terminal.theme.js +59 -0
- package/dist/react-ui/blocks/Terminal/Terminal.theme.restty.d.ts +63 -0
- package/dist/react-ui/blocks/Terminal/Terminal.theme.restty.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/Terminal.theme.restty.js +109 -0
- package/dist/react-ui/blocks/Terminal/Terminal.types.d.ts +351 -0
- package/dist/react-ui/blocks/Terminal/Terminal.types.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/TerminalPanel.d.ts +60 -0
- package/dist/react-ui/blocks/Terminal/TerminalPanel.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/TerminalPanel.js +183 -0
- package/dist/react-ui/blocks/Terminal/TerminalRestty.d.ts +111 -0
- package/dist/react-ui/blocks/Terminal/TerminalRestty.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/TerminalRestty.js +185 -0
- package/dist/react-ui/blocks/Terminal/TerminalXterm.d.ts +58 -0
- package/dist/react-ui/blocks/Terminal/TerminalXterm.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/TerminalXterm.js +143 -0
- package/dist/react-ui/blocks/Terminal/XTermAdapter.d.ts +87 -0
- package/dist/react-ui/blocks/Terminal/XTermAdapter.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/XTermAdapter.js +135 -0
- package/dist/react-ui/blocks/Terminal/components/LogLineBadges.d.ts +160 -0
- package/dist/react-ui/blocks/Terminal/components/LogLineBadges.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/components/LogLineBadges.js +185 -0
- package/dist/react-ui/blocks/Terminal/components/SpecializedSyntaxHighlighter.d.ts +48 -0
- package/dist/react-ui/blocks/Terminal/components/SpecializedSyntaxHighlighter.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/components/SpecializedSyntaxHighlighter.js +139 -0
- package/dist/react-ui/blocks/Terminal/components/SyntaxHighlight.d.ts +60 -0
- package/dist/react-ui/blocks/Terminal/components/SyntaxHighlight.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/components/SyntaxHighlight.js +352 -0
- package/dist/react-ui/blocks/Terminal/components/TerminalLogBadge.d.ts +36 -0
- package/dist/react-ui/blocks/Terminal/components/TerminalLogBadge.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/components/TerminalLogBadge.js +52 -0
- package/dist/react-ui/blocks/Terminal/components/index.d.ts +10 -0
- package/dist/react-ui/blocks/Terminal/components/index.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/components/index.js +4 -0
- package/dist/react-ui/blocks/Terminal/hooks/index.d.ts +11 -0
- package/dist/react-ui/blocks/Terminal/hooks/index.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/hooks/index.js +2 -0
- package/dist/react-ui/blocks/Terminal/hooks/useTerminalSettings.d.ts +69 -0
- package/dist/react-ui/blocks/Terminal/hooks/useTerminalSettings.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/hooks/useTerminalSettings.js +162 -0
- package/dist/react-ui/blocks/Terminal/hooks/useTerminalWebSocket.d.ts +104 -0
- package/dist/react-ui/blocks/Terminal/hooks/useTerminalWebSocket.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/hooks/useTerminalWebSocket.js +180 -0
- package/dist/react-ui/blocks/Terminal/index.d.ts +39 -0
- package/dist/react-ui/blocks/Terminal/index.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/index.js +38 -0
- package/dist/react-ui/blocks/Terminal/panel/LogLinesViewer.d.ts +58 -0
- package/dist/react-ui/blocks/Terminal/panel/LogLinesViewer.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/LogLinesViewer.js +222 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalDebugPanel.d.ts +74 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalDebugPanel.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalDebugPanel.js +168 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalFilterDropdown.d.ts +42 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalFilterDropdown.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalFilterDropdown.js +175 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalFilterTabs.d.ts +43 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalFilterTabs.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.d.ts +38 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.js +62 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.types.d.ts +67 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.types.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanelRestty.d.ts +32 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanelRestty.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanelRestty.js +326 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanelXterm.d.ts +36 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanelXterm.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanelXterm.js +371 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalLogsPanel.d.ts +67 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalLogsPanel.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalLogsPanel.js +417 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalLogsPanel.types.d.ts +197 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalLogsPanel.types.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelChrome.d.ts +54 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelChrome.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelChrome.js +193 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelChrome.types.d.ts +57 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelChrome.types.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelFooter.d.ts +30 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelFooter.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelFooter.js +126 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelHeader.d.ts +31 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelHeader.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelHeader.js +149 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelToolbar.d.ts +35 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelToolbar.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalSessionControl.d.ts +58 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalSessionControl.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalSessionTabs.d.ts +63 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalSessionTabs.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalSessionTabs.js +245 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalSettingsPopover.d.ts +24 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalSettingsPopover.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalSettingsPopover.js +225 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalThemeSelector.d.ts +35 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalThemeSelector.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalThemeSelector.js +187 -0
- package/dist/react-ui/blocks/Terminal/panel/index.d.ts +30 -0
- package/dist/react-ui/blocks/Terminal/panel/index.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/terminal-filter-dropdown.module-Bovc57nm.css +60 -0
- package/dist/react-ui/blocks/Terminal/panel/terminal-filter-dropdown.module.js +5 -0
- package/dist/react-ui/blocks/Terminal/panel/terminal-session-tabs.module-QyxHO7cN.css +60 -0
- package/dist/react-ui/blocks/Terminal/panel/terminal-session-tabs.module.js +5 -0
- package/dist/react-ui/blocks/Terminal/parsing/BadgeFormatter.d.ts +73 -0
- package/dist/react-ui/blocks/Terminal/parsing/BadgeFormatter.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/BadgeFormatter.js +136 -0
- package/dist/react-ui/blocks/Terminal/parsing/HttpLogParser.d.ts +117 -0
- package/dist/react-ui/blocks/Terminal/parsing/HttpLogParser.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/HttpLogParser.js +174 -0
- package/dist/react-ui/blocks/Terminal/parsing/LogParser.types.d.ts +221 -0
- package/dist/react-ui/blocks/Terminal/parsing/LogParser.types.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/LogParserService.d.ts +184 -0
- package/dist/react-ui/blocks/Terminal/parsing/LogParserService.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/LogParserService.js +478 -0
- package/dist/react-ui/blocks/Terminal/parsing/MultilineAggregator.d.ts +173 -0
- package/dist/react-ui/blocks/Terminal/parsing/MultilineAggregator.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/MultilineAggregator.js +313 -0
- package/dist/react-ui/blocks/Terminal/parsing/PersistentLogBuffer.d.ts +181 -0
- package/dist/react-ui/blocks/Terminal/parsing/PersistentLogBuffer.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/PersistentLogBuffer.js +221 -0
- package/dist/react-ui/blocks/Terminal/parsing/SyntaxHighlighter.d.ts +69 -0
- package/dist/react-ui/blocks/Terminal/parsing/SyntaxHighlighter.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/SyntaxHighlighter.js +142 -0
- package/dist/react-ui/blocks/Terminal/parsing/TableParser.d.ts +125 -0
- package/dist/react-ui/blocks/Terminal/parsing/TableParser.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/TableParser.js +245 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/AnsiColorMapper.d.ts +165 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/AnsiColorMapper.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/AnsiColorMapper.js +225 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/AnsiParser.d.ts +164 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/AnsiParser.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/AnsiParser.js +285 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/ansi.constants.d.ts +188 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/ansi.constants.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/ansi.constants.js +178 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/index.d.ts +12 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/index.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/index.d.ts +24 -0
- package/dist/react-ui/blocks/Terminal/parsing/index.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/levels/LogLevel.types.d.ts +56 -0
- package/dist/react-ui/blocks/Terminal/parsing/levels/LogLevel.types.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/levels/LogLevelDetector.d.ts +140 -0
- package/dist/react-ui/blocks/Terminal/parsing/levels/LogLevelDetector.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/levels/LogLevelDetector.js +325 -0
- package/dist/react-ui/blocks/Terminal/parsing/levels/index.d.ts +10 -0
- package/dist/react-ui/blocks/Terminal/parsing/levels/index.d.ts.map +1 -0
- package/dist/react-ui/blocks/index.d.ts +11 -0
- package/dist/react-ui/blocks/index.d.ts.map +1 -0
- package/dist/react-ui/icons/lucide-animated/activity.js +1 -1
- package/dist/react-ui/icons/lucide-animated/bell-electric.js +1 -1
- package/dist/react-ui/icons/lucide-animated/bell.js +1 -1
- package/dist/react-ui/icons/lucide-animated/bot.js +1 -1
- package/dist/react-ui/icons/lucide-animated/box.js +1 -1
- package/dist/react-ui/icons/lucide-animated/circle-check.js +1 -1
- package/dist/react-ui/icons/lucide-animated/delete.js +1 -1
- package/dist/react-ui/icons/lucide-animated/download.js +1 -1
- package/dist/react-ui/icons/lucide-animated/home.js +1 -1
- package/dist/react-ui/icons/lucide-animated/layout-panel-top.js +1 -1
- package/dist/react-ui/icons/lucide-animated/plus.js +1 -1
- package/dist/react-ui/icons/lucide-animated/search.js +1 -1
- package/dist/react-ui/icons/lucide-animated/settings.js +1 -1
- package/dist/react-ui/icons/lucide-animated/trending-down.js +1 -1
- package/dist/react-ui/icons/lucide-animated/trending-up.js +1 -1
- package/dist/react-ui/icons/lucide-animated/x.js +1 -1
- package/dist/react-ui/index.js +4 -1
- package/dist/react-ui/lib/icon-wrapper.d.ts +37 -0
- package/dist/react-ui/lib/icon-wrapper.d.ts.map +1 -0
- package/dist/react-ui/lib/icon-wrapper.js +55 -0
- package/dist/react-ui/lib/index.d.ts +1 -0
- package/dist/react-ui/lib/index.d.ts.map +1 -1
- package/dist/react-ui/lib/index.js +1 -0
- package/dist/react-ui/primitives/AutoHeight/index.d.ts +1 -1
- package/dist/react-ui/primitives/CountingNumber/index.d.ts +1 -1
- package/dist/react-ui/primitives/waapi/SlidingNumber/SlidingNumber.styles.d.ts +1 -1
- package/dist/react-ui/primitives/waapi/SlidingText/SlidingText.styles.d.ts +1 -1
- package/dist/react-ui/ui/Accordion/Accordion.styles.d.ts +1 -1
- package/dist/react-ui/ui/Accordion/Accordion.types.d.ts +1 -1
- package/dist/react-ui/ui/AlertDialog/AlertDialog.styles.d.ts +1 -1
- package/dist/react-ui/ui/AlertDialog/AlertDialog.types.d.ts +1 -1
- package/dist/react-ui/ui/Badge/Badge.styles.d.ts +1 -1
- package/dist/react-ui/ui/Badge/Badge.types.d.ts +1 -1
- package/dist/react-ui/ui/Button/Button.styles.d.ts +2 -2
- package/dist/react-ui/ui/Button/Button.types.d.ts +1 -1
- package/dist/react-ui/ui/Card/Card.styles.d.ts +1 -1
- package/dist/react-ui/ui/Card/Card.types.d.ts +1 -1
- package/dist/react-ui/ui/Checkbox/Checkbox.styles.d.ts +1 -1
- package/dist/react-ui/ui/Checkbox/Checkbox.types.d.ts +1 -1
- package/dist/react-ui/ui/Combobox/Combobox.styles.d.ts +1 -1
- package/dist/react-ui/ui/Combobox/Combobox.types.d.ts +1 -1
- package/dist/react-ui/ui/CornerBracket/CornerBracket.styles.d.ts +2 -2
- package/dist/react-ui/ui/CornerBracket/CornerBracket.styles.js +1 -1
- package/dist/react-ui/ui/CornerBracket/CornerBracket.types.d.ts +1 -1
- package/dist/react-ui/ui/DataCard/DataCard.styles.d.ts +1 -1
- package/dist/react-ui/ui/DataCard/DataCard.types.d.ts +1 -1
- package/dist/react-ui/ui/DataCard/index.d.ts +1 -1
- package/dist/react-ui/ui/Dialog/Dialog.styles.d.ts +1 -1
- package/dist/react-ui/ui/Dialog/Dialog.types.d.ts +1 -1
- package/dist/react-ui/ui/DropdownMenu/DropdownMenu.styles.d.ts +1 -1
- package/dist/react-ui/ui/DropdownMenu/DropdownMenu.types.d.ts +1 -1
- package/dist/react-ui/ui/Field/Field.styles.d.ts +1 -1
- package/dist/react-ui/ui/Field/Field.types.d.ts +1 -1
- package/dist/react-ui/ui/Input/Input.styles.d.ts +1 -1
- package/dist/react-ui/ui/Input/Input.types.d.ts +1 -1
- package/dist/react-ui/ui/InputGroup/InputGroup.styles.d.ts +1 -1
- package/dist/react-ui/ui/InputGroup/InputGroup.types.d.ts +1 -1
- package/dist/react-ui/ui/Label/Label.styles.d.ts +1 -1
- package/dist/react-ui/ui/Label/Label.types.d.ts +1 -1
- package/dist/react-ui/ui/Menu/Menu.styles.d.ts +1 -1
- package/dist/react-ui/ui/Menu/Menu.types.d.ts +2 -2
- package/dist/react-ui/ui/Popover/Popover.styles.d.ts +1 -1
- package/dist/react-ui/ui/Popover/Popover.types.d.ts +1 -1
- package/dist/react-ui/ui/Progress/Progress.styles.d.ts +1 -1
- package/dist/react-ui/ui/Progress/Progress.types.d.ts +2 -2
- package/dist/react-ui/ui/Select/Select.styles.d.ts +1 -1
- package/dist/react-ui/ui/Select/Select.types.d.ts +1 -1
- package/dist/react-ui/ui/Separator/Separator.styles.d.ts +1 -1
- package/dist/react-ui/ui/Separator/Separator.types.d.ts +1 -1
- package/dist/react-ui/ui/Switch/Switch.styles.d.ts +1 -1
- package/dist/react-ui/ui/Switch/Switch.types.d.ts +1 -1
- package/dist/react-ui/ui/Tabs/Tabs.styles.d.ts +43 -25
- package/dist/react-ui/ui/Tabs/Tabs.styles.d.ts.map +1 -1
- package/dist/react-ui/ui/Tabs/Tabs.styles.js +105 -13
- package/dist/react-ui/ui/Tabs/Tabs.types.d.ts +9 -6
- package/dist/react-ui/ui/Tabs/Tabs.types.d.ts.map +1 -1
- package/dist/react-ui/ui/Tabs/index.d.ts +18 -9
- package/dist/react-ui/ui/Tabs/index.d.ts.map +1 -1
- package/dist/react-ui/ui/Tabs/index.js +99 -27
- package/dist/react-ui/ui/TextFlow/TextFlow.styles.d.ts +1 -1
- package/dist/react-ui/ui/Textarea/Textarea.styles.d.ts +1 -1
- package/dist/react-ui/ui/Textarea/Textarea.types.d.ts +1 -1
- package/dist/react-ui/ui/Tooltip/Tooltip.styles.d.ts +1 -1
- package/dist/react-ui/ui/Tooltip/Tooltip.types.d.ts +1 -1
- package/dist/react-ui/ui/index.d.ts +1 -0
- package/dist/react-ui/ui/index.d.ts.map +1 -1
- package/dist/react-ui/ui/index.js +2 -0
- package/package.json +54 -6
- package/src/react-ui/blocks/Terminal/ResttyAdapter.ts +278 -0
- package/src/react-ui/blocks/Terminal/Terminal.adapter.ts +97 -0
- package/src/react-ui/blocks/Terminal/Terminal.theme.restty.ts +155 -0
- package/src/react-ui/blocks/Terminal/Terminal.theme.ts +80 -0
- package/src/react-ui/blocks/Terminal/Terminal.types.ts +438 -0
- package/src/react-ui/blocks/Terminal/TerminalPanel.tsx +269 -0
- package/src/react-ui/blocks/Terminal/TerminalRestty.tsx +326 -0
- package/src/react-ui/blocks/Terminal/TerminalXterm.tsx +230 -0
- package/src/react-ui/blocks/Terminal/XTermAdapter.ts +163 -0
- package/src/react-ui/blocks/Terminal/components/LogLineBadges.tsx +316 -0
- package/src/react-ui/blocks/Terminal/components/SpecializedSyntaxHighlighter.tsx +218 -0
- package/src/react-ui/blocks/Terminal/components/SyntaxHighlight.tsx +386 -0
- package/src/react-ui/blocks/Terminal/components/TerminalLogBadge.tsx +67 -0
- package/src/react-ui/blocks/Terminal/components/index.ts +10 -0
- package/src/react-ui/blocks/Terminal/hooks/index.ts +22 -0
- package/src/react-ui/blocks/Terminal/hooks/useTerminalSettings.ts +229 -0
- package/src/react-ui/blocks/Terminal/hooks/useTerminalWebSocket.ts +292 -0
- package/src/react-ui/blocks/Terminal/index.ts +103 -0
- package/src/react-ui/blocks/Terminal/panel/LogLinesViewer.tsx +330 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalDebugPanel.tsx +242 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalFilterDropdown.tsx +202 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalFilterTabs.tsx +140 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.tsx +68 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.types.ts +85 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanelRestty.tsx +383 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanelXterm.tsx +439 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalLogsPanel.tsx +550 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalLogsPanel.types.ts +259 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalPanelChrome.tsx +237 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalPanelChrome.types.ts +76 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalPanelFooter.tsx +112 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalPanelHeader.tsx +178 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalPanelToolbar.tsx +203 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalSessionControl.tsx +252 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalSessionTabs.tsx +334 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalSettingsPopover.tsx +261 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalThemeSelector.tsx +248 -0
- package/src/react-ui/blocks/Terminal/panel/index.ts +72 -0
- package/src/react-ui/blocks/Terminal/panel/terminal-filter-dropdown.module.css +59 -0
- package/src/react-ui/blocks/Terminal/panel/terminal-session-tabs.module.css +59 -0
- package/src/react-ui/blocks/Terminal/parsing/BadgeFormatter.ts +180 -0
- package/src/react-ui/blocks/Terminal/parsing/HttpLogParser.ts +248 -0
- package/src/react-ui/blocks/Terminal/parsing/LogParser.types.ts +283 -0
- package/src/react-ui/blocks/Terminal/parsing/LogParserService.ts +686 -0
- package/src/react-ui/blocks/Terminal/parsing/MultilineAggregator.ts +466 -0
- package/src/react-ui/blocks/Terminal/parsing/PersistentLogBuffer.ts +343 -0
- package/src/react-ui/blocks/Terminal/parsing/SyntaxHighlighter.ts +167 -0
- package/src/react-ui/blocks/Terminal/parsing/TableParser.ts +348 -0
- package/src/react-ui/blocks/Terminal/parsing/ansi/AnsiColorMapper.ts +251 -0
- package/src/react-ui/blocks/Terminal/parsing/ansi/AnsiParser.ts +390 -0
- package/src/react-ui/blocks/Terminal/parsing/ansi/ansi.constants.ts +320 -0
- package/src/react-ui/blocks/Terminal/parsing/ansi/index.ts +20 -0
- package/src/react-ui/blocks/Terminal/parsing/index.ts +69 -0
- package/src/react-ui/blocks/Terminal/parsing/levels/LogLevel.types.ts +68 -0
- package/src/react-ui/blocks/Terminal/parsing/levels/LogLevelDetector.ts +436 -0
- package/src/react-ui/blocks/Terminal/parsing/levels/index.ts +14 -0
- package/src/react-ui/blocks/index.ts +11 -0
- package/src/react-ui/icons/lucide-animated/activity.tsx +2 -2
- package/src/react-ui/icons/lucide-animated/bell-electric.tsx +1 -1
- package/src/react-ui/icons/lucide-animated/bell.tsx +2 -2
- package/src/react-ui/icons/lucide-animated/bot.tsx +1 -1
- package/src/react-ui/icons/lucide-animated/box.tsx +2 -2
- package/src/react-ui/icons/lucide-animated/circle-check.tsx +2 -2
- package/src/react-ui/icons/lucide-animated/delete.tsx +2 -2
- package/src/react-ui/icons/lucide-animated/download.tsx +2 -2
- package/src/react-ui/icons/lucide-animated/home.tsx +2 -2
- package/src/react-ui/icons/lucide-animated/layout-panel-top.tsx +1 -1
- package/src/react-ui/icons/lucide-animated/plus.tsx +1 -1
- package/src/react-ui/icons/lucide-animated/search.tsx +1 -1
- package/src/react-ui/icons/lucide-animated/settings.tsx +1 -1
- package/src/react-ui/icons/lucide-animated/trending-down.tsx +2 -2
- package/src/react-ui/icons/lucide-animated/trending-up.tsx +2 -2
- package/src/react-ui/icons/lucide-animated/x.tsx +2 -2
- package/src/react-ui/lib/icon-wrapper.tsx +70 -0
- package/src/react-ui/lib/index.ts +1 -0
- package/src/react-ui/ui/CornerBracket/CornerBracket.styles.ts +1 -1
- package/src/react-ui/ui/Tabs/Tabs.css +39 -0
- package/src/react-ui/ui/Tabs/Tabs.styles.ts +119 -31
- package/src/react-ui/ui/Tabs/Tabs.types.ts +8 -3
- package/src/react-ui/ui/Tabs/index.tsx +135 -27
- package/src/react-ui/ui/index.ts +1 -0
- package/dist/index.css +0 -129
|
@@ -0,0 +1,478 @@
|
|
|
1
|
+
import { AnsiParser } from "./ansi/AnsiParser.js";
|
|
2
|
+
import { LogLevelDetector } from "./levels/LogLevelDetector.js";
|
|
3
|
+
import { BadgeFormatter } from "./BadgeFormatter.js";
|
|
4
|
+
import { MultilineAggregator } from "./MultilineAggregator.js";
|
|
5
|
+
|
|
6
|
+
//#region src/react-ui/blocks/Terminal/parsing/LogParserService.ts
|
|
7
|
+
/**
|
|
8
|
+
* Log parser service for terminal log processing.
|
|
9
|
+
*
|
|
10
|
+
* Main service that combines ANSI parsing, log level detection,
|
|
11
|
+
* timestamp extraction, and structured log handling into a
|
|
12
|
+
* unified API for processing log streams.
|
|
13
|
+
*
|
|
14
|
+
* @module components/devenv/terminal/parsing/service
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Timestamp patterns for common log formats.
|
|
18
|
+
*
|
|
19
|
+
* IMPORTANT: Order matters! More specific patterns must come first.
|
|
20
|
+
* The double timestamp pattern MUST be before single timestamp patterns.
|
|
21
|
+
*/
|
|
22
|
+
const TIMESTAMP_PATTERNS = [
|
|
23
|
+
{
|
|
24
|
+
regex: /^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z?)\s+(\d{2}:\d{2}:\d{2}(?:\.\d+)?)\s+/,
|
|
25
|
+
format: "double",
|
|
26
|
+
extractIndex: 2
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
regex: /^(\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2}),(\d+)\s+/,
|
|
30
|
+
format: "supervisord"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
regex: /^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z?)\s/,
|
|
34
|
+
format: "iso"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
regex: /^(\d{2}:\d{2}:\d{2}(?:\.\d+)?)\s/,
|
|
38
|
+
format: "time"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
regex: /^\[(\d{13,})\]\s/,
|
|
42
|
+
format: "unix"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
regex: /^\[(\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2})\]\s/,
|
|
46
|
+
format: "datetime"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
regex: /^([A-Z][a-z]{2}\s+\d{1,2}\s+\d{2}:\d{2}:\d{2})\s/,
|
|
50
|
+
format: "syslog"
|
|
51
|
+
}
|
|
52
|
+
];
|
|
53
|
+
/**
|
|
54
|
+
* Tag extraction pattern.
|
|
55
|
+
* Matches: ⦗COMPONENT⦘ ⦗ROUTES⦘ etc.
|
|
56
|
+
*/
|
|
57
|
+
const TAG_PATTERN = /⦗([^⦘]+)⦘/g;
|
|
58
|
+
/**
|
|
59
|
+
* Log parser service class.
|
|
60
|
+
*
|
|
61
|
+
* Provides unified API for parsing log text with ANSI colorization,
|
|
62
|
+
* log level detection, timestamp extraction, and structured data handling.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```ts
|
|
66
|
+
* const parser = new LogParserService();
|
|
67
|
+
* const entry = parser.parseLine('2026-02-05T21:35:28.944Z INFO ⦗API⦘ Message');
|
|
68
|
+
* // entry.level = 'info'
|
|
69
|
+
* // entry.timestamp = '2026-02-05T21:35:28.944Z'
|
|
70
|
+
* // entry.tags = ['API']
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
var LogParserService = class {
|
|
74
|
+
/** ANSI parser instance */
|
|
75
|
+
ansiParser;
|
|
76
|
+
/** Log level detector instance */
|
|
77
|
+
levelDetector;
|
|
78
|
+
/** Badge formatter instance */
|
|
79
|
+
badgeFormatter;
|
|
80
|
+
/** Multiline aggregator instance */
|
|
81
|
+
multilineAggregator;
|
|
82
|
+
/** Parser options */
|
|
83
|
+
options;
|
|
84
|
+
/**
|
|
85
|
+
* Create a new log parser service.
|
|
86
|
+
*
|
|
87
|
+
* @param options - Parser configuration options
|
|
88
|
+
*/
|
|
89
|
+
constructor(options = {}) {
|
|
90
|
+
this.options = {
|
|
91
|
+
enable_ansi: true,
|
|
92
|
+
timestamp_format: "time",
|
|
93
|
+
enable_structured: true,
|
|
94
|
+
enable_tags: true,
|
|
95
|
+
max_line_length: 1e4,
|
|
96
|
+
level_patterns: {},
|
|
97
|
+
...options
|
|
98
|
+
};
|
|
99
|
+
this.ansiParser = new AnsiParser();
|
|
100
|
+
this.badgeFormatter = new BadgeFormatter();
|
|
101
|
+
this.multilineAggregator = new MultilineAggregator();
|
|
102
|
+
this.levelDetector = new LogLevelDetector({ custom_patterns: this.options.level_patterns ? Object.entries(this.options.level_patterns).map(([level, regex]) => ({
|
|
103
|
+
level,
|
|
104
|
+
regex,
|
|
105
|
+
confidence: .9
|
|
106
|
+
})) : void 0 });
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Parse a single log line into structured entry.
|
|
110
|
+
*
|
|
111
|
+
* @param line - Raw log line
|
|
112
|
+
* @param lineNumber - Line number in stream
|
|
113
|
+
* @param isStderr - Whether this is from stderr
|
|
114
|
+
* @returns Parsed log entry
|
|
115
|
+
*/
|
|
116
|
+
parseLine(line, lineNumber, isStderr = false) {
|
|
117
|
+
let raw = line;
|
|
118
|
+
let wasTruncated = false;
|
|
119
|
+
if (line.length > this.options.max_line_length) {
|
|
120
|
+
raw = line.slice(0, this.options.max_line_length) + "... (truncated)";
|
|
121
|
+
wasTruncated = true;
|
|
122
|
+
}
|
|
123
|
+
const levelDetection = this.levelDetector.detect(raw);
|
|
124
|
+
const level = levelDetection.confidence >= .5 ? levelDetection.level : this.levelDetector.detectOrDefault(raw);
|
|
125
|
+
const timestamp = this.extractTimestamp(raw);
|
|
126
|
+
const timestampDisplay = this.formatTimestamp(timestamp);
|
|
127
|
+
const tags = this.options.enable_tags ? this.extractTags(raw) : void 0;
|
|
128
|
+
const message = this.extractMessage(raw, timestamp, levelDetection.matched);
|
|
129
|
+
let formatted = raw;
|
|
130
|
+
if (this.options.enable_ansi) formatted = this.ansiParser.parse(raw).text;
|
|
131
|
+
else formatted = AnsiParser.stripAnsi(raw);
|
|
132
|
+
let structured;
|
|
133
|
+
if (this.options.enable_structured) structured = this.parseStructured(raw);
|
|
134
|
+
return {
|
|
135
|
+
raw: wasTruncated ? raw : line,
|
|
136
|
+
formatted,
|
|
137
|
+
level,
|
|
138
|
+
timestamp,
|
|
139
|
+
timestamp_display: timestampDisplay,
|
|
140
|
+
line_number: lineNumber,
|
|
141
|
+
is_stderr: isStderr,
|
|
142
|
+
structured,
|
|
143
|
+
tags,
|
|
144
|
+
message
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Parse multiple lines (batch processing).
|
|
149
|
+
*
|
|
150
|
+
* @param lines - Array of raw log lines
|
|
151
|
+
* @param startNumber - Starting line number (default: 1)
|
|
152
|
+
* @returns Array of parsed log entries
|
|
153
|
+
*/
|
|
154
|
+
parseLines(lines, startNumber = 1) {
|
|
155
|
+
return lines.map((line, index) => this.parseLine(line, startNumber + index));
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Parse logs with incremental state (for streaming).
|
|
159
|
+
*
|
|
160
|
+
* Maintains state between chunks for proper multiline log
|
|
161
|
+
* aggregation and line numbering. Applies multiline aggregation
|
|
162
|
+
* to mark continuation lines.
|
|
163
|
+
*
|
|
164
|
+
* @param chunk - New log chunk
|
|
165
|
+
* @param prevState - Previous parser state
|
|
166
|
+
* @returns Parsed entries and new state
|
|
167
|
+
*/
|
|
168
|
+
parseIncremental(chunk, prevState) {
|
|
169
|
+
const lines = (prevState.buffer + chunk).split("\n");
|
|
170
|
+
const lastLine = lines.pop() ?? "";
|
|
171
|
+
let currentLineNumber = prevState.line_number;
|
|
172
|
+
const entries = [];
|
|
173
|
+
for (const line of lines) if (line.length > 0) {
|
|
174
|
+
currentLineNumber++;
|
|
175
|
+
entries.push(this.parseLine(line, currentLineNumber));
|
|
176
|
+
}
|
|
177
|
+
const initialMultilineState = prevState.multiline_state ? {
|
|
178
|
+
buffer: [],
|
|
179
|
+
isMultiline: prevState.multiline_state.isMultiline,
|
|
180
|
+
depth: prevState.multiline_state.depth,
|
|
181
|
+
expectedClose: prevState.multiline_state.expectedClose,
|
|
182
|
+
parentEntry: prevState.multiline_state.parentEntry
|
|
183
|
+
} : void 0;
|
|
184
|
+
const { entries: aggregated, state: newMultilineState } = this.multilineAggregator.aggregate(entries, initialMultilineState);
|
|
185
|
+
const lastEntry = aggregated.length > 0 ? aggregated[aggregated.length - 1] : void 0;
|
|
186
|
+
return {
|
|
187
|
+
entries: aggregated,
|
|
188
|
+
newState: {
|
|
189
|
+
buffer: lastLine,
|
|
190
|
+
line_number: currentLineNumber,
|
|
191
|
+
last_level: lastEntry?.level ?? prevState.last_level,
|
|
192
|
+
last_timestamp: lastEntry?.timestamp ?? prevState.last_timestamp,
|
|
193
|
+
multiline_state: newMultilineState.isMultiline || newMultilineState.depth > 0 ? {
|
|
194
|
+
isMultiline: newMultilineState.isMultiline,
|
|
195
|
+
depth: newMultilineState.depth,
|
|
196
|
+
expectedClose: newMultilineState.expectedClose,
|
|
197
|
+
parentEntry: newMultilineState.parentEntry
|
|
198
|
+
} : void 0
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Format log entry for xterm.js display.
|
|
204
|
+
*
|
|
205
|
+
* Supports two modes:
|
|
206
|
+
*
|
|
207
|
+
* **'raw' mode (default for terminal):**
|
|
208
|
+
* - Returns the log AS-IS without modifications
|
|
209
|
+
* - Preserves original ANSI codes from the source (bun, supervisord, etc.)
|
|
210
|
+
* - No badges, no formatting, just the raw log line
|
|
211
|
+
* - Prevents ANSI mixing artifacts and visible escape codes
|
|
212
|
+
*
|
|
213
|
+
* **'parsed' mode (for React viewer):**
|
|
214
|
+
* - Strips ANSI codes first
|
|
215
|
+
* - Adds level badge, tag badges, timestamp badge
|
|
216
|
+
* - Formats message content for React display
|
|
217
|
+
* - Continuation lines get indented
|
|
218
|
+
*
|
|
219
|
+
* @param entry - Parsed log entry
|
|
220
|
+
* @param mode - Format mode: 'raw' (default) or 'parsed'
|
|
221
|
+
* @returns Formatted string for xterm.js or React viewer
|
|
222
|
+
*/
|
|
223
|
+
formatForTerminal(entry, mode = "raw") {
|
|
224
|
+
if (mode === "raw") return entry.raw;
|
|
225
|
+
if (entry.is_continuation) return " " + AnsiParser.stripAnsi(entry.raw).trimEnd();
|
|
226
|
+
const parts = [];
|
|
227
|
+
const levelBadge = this.badgeFormatter.createLevelBadge(entry.level);
|
|
228
|
+
parts.push(levelBadge);
|
|
229
|
+
if (entry.tags && entry.tags.length > 0) {
|
|
230
|
+
const tagBadges = this.badgeFormatter.createTagBadges(entry.tags);
|
|
231
|
+
if (tagBadges) parts.push(tagBadges);
|
|
232
|
+
}
|
|
233
|
+
const messageContent = entry.message ?? AnsiParser.stripAnsi(entry.raw);
|
|
234
|
+
parts.push(messageContent);
|
|
235
|
+
let line = parts.join(" ");
|
|
236
|
+
if (entry.timestamp_display) {
|
|
237
|
+
const timestampBadge = this.badgeFormatter.createTimestampBadge(entry.timestamp_display);
|
|
238
|
+
line = line + timestampBadge;
|
|
239
|
+
}
|
|
240
|
+
return line;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Check if line contains structured data (JSON).
|
|
244
|
+
*
|
|
245
|
+
* @param line - Log line to check
|
|
246
|
+
* @returns true if line contains valid JSON
|
|
247
|
+
*/
|
|
248
|
+
isStructured(line) {
|
|
249
|
+
const trimmed = line.trim();
|
|
250
|
+
if (trimmed.startsWith("{") && trimmed.endsWith("}") || trimmed.startsWith("[") && trimmed.endsWith("]")) try {
|
|
251
|
+
JSON.parse(trimmed);
|
|
252
|
+
return true;
|
|
253
|
+
} catch {
|
|
254
|
+
return false;
|
|
255
|
+
}
|
|
256
|
+
return false;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Filter log entries by criteria.
|
|
260
|
+
*
|
|
261
|
+
* @param entries - Array of parsed log entries
|
|
262
|
+
* @param filter - Filter options
|
|
263
|
+
* @returns Filtered array of entries
|
|
264
|
+
*/
|
|
265
|
+
filter(entries, filter) {
|
|
266
|
+
return entries.filter((entry) => {
|
|
267
|
+
if (filter.min_level !== void 0) {
|
|
268
|
+
if (LogLevelDetector.getSeverity(entry.level) < LogLevelDetector.getSeverity(filter.min_level)) return false;
|
|
269
|
+
}
|
|
270
|
+
if (filter.stderr_only !== void 0) {
|
|
271
|
+
if (filter.stderr_only && !entry.is_stderr) return false;
|
|
272
|
+
if (!filter.stderr_only && entry.is_stderr) return false;
|
|
273
|
+
}
|
|
274
|
+
if (filter.pattern) {
|
|
275
|
+
if (!filter.pattern.test(entry.raw)) return false;
|
|
276
|
+
}
|
|
277
|
+
if (filter.tags && filter.tags.length > 0) {
|
|
278
|
+
if (!entry.tags || !filter.tags.some((t) => entry.tags?.includes(t))) return false;
|
|
279
|
+
}
|
|
280
|
+
if (filter.after && entry.timestamp) {
|
|
281
|
+
if (entry.timestamp < filter.after) return false;
|
|
282
|
+
}
|
|
283
|
+
if (filter.before && entry.timestamp) {
|
|
284
|
+
if (entry.timestamp > filter.before) return false;
|
|
285
|
+
}
|
|
286
|
+
return true;
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Calculate statistics for log entries.
|
|
291
|
+
*
|
|
292
|
+
* @param entries - Array of parsed log entries
|
|
293
|
+
* @returns Log statistics
|
|
294
|
+
*/
|
|
295
|
+
calculateStats(entries) {
|
|
296
|
+
const byLevel = {
|
|
297
|
+
trace: 0,
|
|
298
|
+
debug: 0,
|
|
299
|
+
info: 0,
|
|
300
|
+
warn: 0,
|
|
301
|
+
error: 0,
|
|
302
|
+
fatal: 0,
|
|
303
|
+
unknown: 0
|
|
304
|
+
};
|
|
305
|
+
let bytes = 0;
|
|
306
|
+
let earliest;
|
|
307
|
+
let latest;
|
|
308
|
+
for (const entry of entries) {
|
|
309
|
+
byLevel[entry.level] = (byLevel[entry.level] ?? 0) + 1;
|
|
310
|
+
bytes += entry.raw.length;
|
|
311
|
+
if (entry.timestamp) {
|
|
312
|
+
if (!earliest || entry.timestamp < earliest) earliest = entry.timestamp;
|
|
313
|
+
if (!latest || entry.timestamp > latest) latest = entry.timestamp;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
return {
|
|
317
|
+
total: entries.length,
|
|
318
|
+
by_level: byLevel,
|
|
319
|
+
bytes,
|
|
320
|
+
earliest,
|
|
321
|
+
latest
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Create initial parser state.
|
|
326
|
+
*
|
|
327
|
+
* @returns Fresh parser state for incremental parsing
|
|
328
|
+
*/
|
|
329
|
+
createInitialState() {
|
|
330
|
+
return {
|
|
331
|
+
buffer: "",
|
|
332
|
+
line_number: 0,
|
|
333
|
+
last_level: "info",
|
|
334
|
+
last_timestamp: void 0,
|
|
335
|
+
multiline_state: void 0
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Extract timestamp from log line.
|
|
340
|
+
*
|
|
341
|
+
* Handles multiple timestamp formats including:
|
|
342
|
+
* - Double timestamp (ISO + time): 2026-02-05T22:41:05.372Z 22:41:05.372
|
|
343
|
+
* - Supervisord: 2026-02-05 22:22:38,372
|
|
344
|
+
* - Unix milliseconds: [1770328479225]
|
|
345
|
+
*
|
|
346
|
+
* @param line - Log line
|
|
347
|
+
* @returns ISO timestamp string or undefined
|
|
348
|
+
* @private
|
|
349
|
+
*/
|
|
350
|
+
extractTimestamp(line) {
|
|
351
|
+
for (const pattern of TIMESTAMP_PATTERNS) {
|
|
352
|
+
const match = line.match(pattern.regex);
|
|
353
|
+
if (match) {
|
|
354
|
+
const captured = match[pattern.extractIndex ?? 1];
|
|
355
|
+
if (pattern.format === "unix") return new Date(parseInt(captured, 10)).toISOString();
|
|
356
|
+
return captured;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Format timestamp for display.
|
|
362
|
+
*
|
|
363
|
+
* @param timestamp - ISO timestamp
|
|
364
|
+
* @returns Formatted timestamp string
|
|
365
|
+
* @private
|
|
366
|
+
*/
|
|
367
|
+
formatTimestamp(timestamp) {
|
|
368
|
+
if (!timestamp) return void 0;
|
|
369
|
+
switch (this.options.timestamp_format) {
|
|
370
|
+
case "none": return;
|
|
371
|
+
case "full": return timestamp;
|
|
372
|
+
case "time":
|
|
373
|
+
const timeMatch = timestamp.match(/(\d{2}:\d{2}:\d{2}(?:\.\d+)?)/);
|
|
374
|
+
return timeMatch ? timeMatch[1] : timestamp;
|
|
375
|
+
case "relative":
|
|
376
|
+
const date = new Date(timestamp);
|
|
377
|
+
const diff = (/* @__PURE__ */ new Date()).getTime() - date.getTime();
|
|
378
|
+
if (diff < 1e3) return "just now";
|
|
379
|
+
if (diff < 6e4) return `${Math.floor(diff / 1e3)}s ago`;
|
|
380
|
+
if (diff < 36e5) return `${Math.floor(diff / 6e4)}m ago`;
|
|
381
|
+
return `${Math.floor(diff / 36e5)}h ago`;
|
|
382
|
+
default: return timestamp;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Extract tags from log line.
|
|
387
|
+
*
|
|
388
|
+
* @param line - Log line
|
|
389
|
+
* @returns Array of extracted tags
|
|
390
|
+
* @private
|
|
391
|
+
*/
|
|
392
|
+
extractTags(line) {
|
|
393
|
+
const tags = [];
|
|
394
|
+
let match;
|
|
395
|
+
const bracketPattern = /\[([A-Z]+)\]/g;
|
|
396
|
+
bracketPattern.lastIndex = 0;
|
|
397
|
+
while ((match = bracketPattern.exec(line)) !== null) tags.push(match[1]);
|
|
398
|
+
const parenPattern = /\(([^)]+)\)/g;
|
|
399
|
+
parenPattern.lastIndex = 0;
|
|
400
|
+
while ((match = parenPattern.exec(line)) !== null) {
|
|
401
|
+
const tag = match[1].toUpperCase();
|
|
402
|
+
if (!tags.includes(tag)) tags.push(tag);
|
|
403
|
+
}
|
|
404
|
+
const anglePattern = /<([^>]+)>/g;
|
|
405
|
+
anglePattern.lastIndex = 0;
|
|
406
|
+
while ((match = anglePattern.exec(line)) !== null) {
|
|
407
|
+
const tag = match[1].toUpperCase();
|
|
408
|
+
if (!tags.includes(tag)) tags.push(tag);
|
|
409
|
+
}
|
|
410
|
+
TAG_PATTERN.lastIndex = 0;
|
|
411
|
+
while ((match = TAG_PATTERN.exec(line)) !== null) {
|
|
412
|
+
const tag = match[1];
|
|
413
|
+
if (!tags.includes(tag)) tags.push(tag);
|
|
414
|
+
}
|
|
415
|
+
return tags;
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* Extract message content from log line.
|
|
419
|
+
*
|
|
420
|
+
* Removes ALL metadata including timestamps, levels, tags, and source locations
|
|
421
|
+
* to return only the clean message content.
|
|
422
|
+
*
|
|
423
|
+
* @param line - Log line
|
|
424
|
+
* @param _timestamp - Extracted timestamp (unused, kept for API compatibility)
|
|
425
|
+
* @param _levelMatch - Level match string (unused, kept for API compatibility)
|
|
426
|
+
* @returns Message content
|
|
427
|
+
* @private
|
|
428
|
+
*/
|
|
429
|
+
extractMessage(line, _timestamp, _levelMatch) {
|
|
430
|
+
let message = line;
|
|
431
|
+
message = message.replace(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z?\s+\d{2}:\d{2}:\d{2}(?:\.\d+)?\s+/, "").replace(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z?\s*/, "").replace(/^\d{2}:\d{2}:\d{2}(?:\.\d+)?\s*/, "").replace(/^\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2},\d+\s+/, "").replace(/^\[\d{13,}\]\s*/, "").replace(/^\[\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2}\]\s*/, "").replace(/^[A-Z][a-z]{2}\s+\d{1,2}\s+\d{2}:\d{2}:\d{2}\s+/, "");
|
|
432
|
+
message = message.replace(/^\s*[ℹ️🔵💙📖📝]+\s+(?:INFO(?:RMATION)?\s*)?/i, "").replace(/^\s*[⚠️🟡⚡🔶]+\s*(?:WARN(?:ING)?\s*)?/i, "").replace(/^\s*[❌🔴❗🚨⛔]+\s*(?:ERROR\s*)?/i, "").replace(/^\s*[🐛🔍🔬⚙️]+\s*(?:DEBUG\s*)?/i, "").replace(/^\s*[💀🔥☠️⚰️]+\s*(?:FATAL|CRITICAL\s*)?/i, "").replace(/^\s*[▲✓✗⚡]+\s*/, "");
|
|
433
|
+
message = message.replace(/^\s*\[(?:TRACE|DEBUG|INFO|WARN(?:ING)?|ERROR|FATAL|CRITICAL)\]\s*/i, "").replace(/^\s*(?:TRACE|DEBUG|INFO|WARN(?:ING)?|ERROR|FATAL|CRITICAL):\s*/i, "");
|
|
434
|
+
message = message.replace(/⦗[^⦘]+⦘\s*/g, "");
|
|
435
|
+
message = message.replace(/\([^)]+\d+:\d+\)\s*/, "");
|
|
436
|
+
message = message.replace(/^\[[\w\s]+\]\s*/, "");
|
|
437
|
+
message = message.replace(/^\s*[ℹ️⚠️❌🐛💀🚨🔥☠️⚰️🔵🟡🔴💙📖📝🔍🔬⚙️🔶▲✓✗⚡]+\s*/, "");
|
|
438
|
+
message = message.replace(/^\s+/, "").replace(/\s+$/, "").replace(/^[,\s]+/, "").trim();
|
|
439
|
+
return message;
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* Parse structured data (JSON) from log line.
|
|
443
|
+
*
|
|
444
|
+
* @param line - Log line
|
|
445
|
+
* @returns Parsed object or undefined
|
|
446
|
+
* @private
|
|
447
|
+
*/
|
|
448
|
+
parseStructured(line) {
|
|
449
|
+
const jsonMatch = line.match(/\{[^{}]*\}/);
|
|
450
|
+
if (!jsonMatch) return void 0;
|
|
451
|
+
try {
|
|
452
|
+
return JSON.parse(jsonMatch[0]);
|
|
453
|
+
} catch {
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* Get ANSI color code for log level.
|
|
459
|
+
*
|
|
460
|
+
* @param level - Log level
|
|
461
|
+
* @returns ANSI SGR color code
|
|
462
|
+
* @private
|
|
463
|
+
*/
|
|
464
|
+
_getAnsiColorForLevel(level) {
|
|
465
|
+
return {
|
|
466
|
+
trace: 90,
|
|
467
|
+
debug: 36,
|
|
468
|
+
info: 34,
|
|
469
|
+
warn: 33,
|
|
470
|
+
error: 31,
|
|
471
|
+
fatal: 35,
|
|
472
|
+
unknown: 37
|
|
473
|
+
}[level] ?? 37;
|
|
474
|
+
}
|
|
475
|
+
};
|
|
476
|
+
|
|
477
|
+
//#endregion
|
|
478
|
+
export { LogParserService };
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Multiline log aggregator for JSON and structured data.
|
|
3
|
+
*
|
|
4
|
+
* Detects and aggregates multiline log entries such as JSON objects,
|
|
5
|
+
* tables, and structured data that span multiple lines. Prevents
|
|
6
|
+
* timestamp/level repetition on continuation lines.
|
|
7
|
+
*
|
|
8
|
+
* @module components/devenv/terminal/parsing/multiline
|
|
9
|
+
*/
|
|
10
|
+
import type { IParsedLogEntry, TLogLevel } from './LogParser.types';
|
|
11
|
+
/**
|
|
12
|
+
* Multiline aggregation state.
|
|
13
|
+
*
|
|
14
|
+
* Tracks buffer and context while aggregating multiline logs.
|
|
15
|
+
*/
|
|
16
|
+
export interface IMultilineState {
|
|
17
|
+
/** Buffered lines for current multiline entry */
|
|
18
|
+
buffer: string[];
|
|
19
|
+
/** Parent entry for continuation lines (only line_number is used) */
|
|
20
|
+
parentEntry?: {
|
|
21
|
+
line_number: number;
|
|
22
|
+
level: TLogLevel;
|
|
23
|
+
};
|
|
24
|
+
/** Whether currently in multiline mode */
|
|
25
|
+
isMultiline: boolean;
|
|
26
|
+
/** Expected closing bracket/brace for current multiline */
|
|
27
|
+
expectedClose?: '}' | ']';
|
|
28
|
+
/** Current depth of nested braces/brackets */
|
|
29
|
+
depth: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Multiline log aggregator class.
|
|
33
|
+
*
|
|
34
|
+
* Detects and aggregates lines that are part of a multiline JSON
|
|
35
|
+
* or structured data entry. Marks continuation lines so they don't
|
|
36
|
+
* get timestamp/level prefixes.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* const aggregator = new MultilineAggregator();
|
|
41
|
+
* const aggregated = aggregator.aggregate(entries);
|
|
42
|
+
* // Lines like '{', ' filter: {},', '}' get marked as continuation
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export declare class MultilineAggregator {
|
|
46
|
+
/**
|
|
47
|
+
* Detect if a line is a continuation of multiline JSON/structured data.
|
|
48
|
+
*
|
|
49
|
+
* Continuation indicators:
|
|
50
|
+
* - Line starts with `{` or `[` alone → opens multiline
|
|
51
|
+
* - Line has indentation + `key: value,` → continuation
|
|
52
|
+
* - Line is just `}` or `]` → closes multiline
|
|
53
|
+
* - Line ends with `{` or `[` without match → opens multiline
|
|
54
|
+
* - When in multiline mode: lines ending with comma or containing key-value patterns
|
|
55
|
+
*
|
|
56
|
+
* @param line - Line to check
|
|
57
|
+
* @param state - Current multiline state
|
|
58
|
+
* @returns true if line is a continuation
|
|
59
|
+
*/
|
|
60
|
+
detectContinuation(line: string, state: IMultilineState): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Aggregate entries, marking continuation lines.
|
|
63
|
+
*
|
|
64
|
+
* Processes entries and marks lines that are continuations
|
|
65
|
+
* of a previous multiline entry. Handles:
|
|
66
|
+
* - JSON/structured data blocks
|
|
67
|
+
* - Table borders (box-drawing characters)
|
|
68
|
+
* - Indented continuation lines
|
|
69
|
+
*
|
|
70
|
+
* @param entries - Parsed log entries to aggregate
|
|
71
|
+
* @param initialState - Optional initial multiline state (for persistence across chunks)
|
|
72
|
+
* @returns Entries with continuation marking and new multiline state
|
|
73
|
+
*/
|
|
74
|
+
aggregate(entries: IParsedLogEntry[], initialState?: IMultilineState): {
|
|
75
|
+
entries: IParsedLogEntry[];
|
|
76
|
+
state: IMultilineState;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Check if a line opens a multiline block.
|
|
80
|
+
*
|
|
81
|
+
* @param trimmed - Trimmed line to check
|
|
82
|
+
* @returns true if line opens multiline
|
|
83
|
+
* @private
|
|
84
|
+
*/
|
|
85
|
+
private opensMultiline;
|
|
86
|
+
/**
|
|
87
|
+
* Check if a line is an opening brace/bracket.
|
|
88
|
+
*
|
|
89
|
+
* @param trimmed - Trimmed line to check
|
|
90
|
+
* @returns true if line contains opening brace/bracket
|
|
91
|
+
* @private
|
|
92
|
+
*/
|
|
93
|
+
private isOpeningBrace;
|
|
94
|
+
/**
|
|
95
|
+
* Check if a line is a closing brace/bracket for expected type.
|
|
96
|
+
*
|
|
97
|
+
* @param trimmed - Trimmed line to check
|
|
98
|
+
* @param expected - Expected close type
|
|
99
|
+
* @returns true if line closes the multiline block
|
|
100
|
+
* @private
|
|
101
|
+
*/
|
|
102
|
+
private isClosingBrace;
|
|
103
|
+
/**
|
|
104
|
+
* Get the expected closing character for a line.
|
|
105
|
+
*
|
|
106
|
+
* @param trimmed - Trimmed line to check
|
|
107
|
+
* @returns Expected closing character or undefined
|
|
108
|
+
* @private
|
|
109
|
+
*/
|
|
110
|
+
private getExpectedClose;
|
|
111
|
+
/**
|
|
112
|
+
* Count opening braces/brackets in a line.
|
|
113
|
+
*
|
|
114
|
+
* @param trimmed - Trimmed line to check
|
|
115
|
+
* @returns Count of opening braces/brackets
|
|
116
|
+
* @private
|
|
117
|
+
*/
|
|
118
|
+
private countOpeningBraces;
|
|
119
|
+
/**
|
|
120
|
+
* Check if a line is a table line (contains box-drawing characters).
|
|
121
|
+
*
|
|
122
|
+
* @param trimmed - Trimmed line to check
|
|
123
|
+
* @returns true if line contains table borders
|
|
124
|
+
* @private
|
|
125
|
+
*/
|
|
126
|
+
private isTableLine;
|
|
127
|
+
/**
|
|
128
|
+
* Check if a line looks like a new log entry (not a continuation).
|
|
129
|
+
*
|
|
130
|
+
* New entries typically start with:
|
|
131
|
+
* - Timestamp followed by log level
|
|
132
|
+
* - HTTP method followed by path
|
|
133
|
+
* - Component/module tag
|
|
134
|
+
*
|
|
135
|
+
* @param trimmed - Trimmed line to check
|
|
136
|
+
* @returns true if line looks like a new entry
|
|
137
|
+
* @private
|
|
138
|
+
*/
|
|
139
|
+
private looksLikeNewEntry;
|
|
140
|
+
/**
|
|
141
|
+
* Check if a trimmed line is a JSON/structured data continuation.
|
|
142
|
+
*
|
|
143
|
+
* This handles lines that have their own timestamp/level metadata
|
|
144
|
+
* but are actually continuations of a multiline JSON block.
|
|
145
|
+
*
|
|
146
|
+
* Examples:
|
|
147
|
+
* - `container: "name",` - ends with comma
|
|
148
|
+
* - `tail: 100,` - ends with comma
|
|
149
|
+
* - `key: "value"` - key-value pattern
|
|
150
|
+
* - `}` - closing brace
|
|
151
|
+
* - Lines with pipe characters (table rows)
|
|
152
|
+
*
|
|
153
|
+
* @param trimmed - Trimmed line to check
|
|
154
|
+
* @returns true if line is a JSON continuation
|
|
155
|
+
* @private
|
|
156
|
+
*/
|
|
157
|
+
private isJsonContinuation;
|
|
158
|
+
/**
|
|
159
|
+
* Check if a line looks like a continuation line (indented content).
|
|
160
|
+
*
|
|
161
|
+
* @param line - Line to check (not trimmed, to check indentation)
|
|
162
|
+
* @returns true if line appears to be a continuation
|
|
163
|
+
* @private
|
|
164
|
+
*/
|
|
165
|
+
private isContinuationLine;
|
|
166
|
+
/**
|
|
167
|
+
* Create initial multiline state.
|
|
168
|
+
*
|
|
169
|
+
* @returns Fresh multiline state
|
|
170
|
+
*/
|
|
171
|
+
createInitialState(): IMultilineState;
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=MultilineAggregator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MultilineAggregator.d.ts","sourceRoot":"","sources":["../../../../../src/react-ui/blocks/Terminal/parsing/MultilineAggregator.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAapE;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,iDAAiD;IACjD,MAAM,EAAE,MAAM,EAAE,CAAC;IAEjB,qEAAqE;IACrE,WAAW,CAAC,EAAE;QACZ,WAAW,EAAE,MAAM,CAAC;QACpB,KAAK,EAAE,SAAS,CAAC;KAClB,CAAC;IAEF,0CAA0C;IAC1C,WAAW,EAAE,OAAO,CAAC;IAErB,2DAA2D;IAC3D,aAAa,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC;IAE1B,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;GAaG;AACH,qBAAa,mBAAmB;IAC9B;;;;;;;;;;;;;OAaG;IACH,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,GAAG,OAAO;IA6BjE;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,YAAY,CAAC,EAAE,eAAe,GAAG;QAAE,OAAO,EAAE,eAAe,EAAE,CAAC;QAAC,KAAK,EAAE,eAAe,CAAA;KAAE;IA+G7H;;;;;;OAMG;IACH,OAAO,CAAC,cAAc;IAyBtB;;;;;;OAMG;IACH,OAAO,CAAC,cAAc;IAItB;;;;;;;OAOG;IACH,OAAO,CAAC,cAAc;IAatB;;;;;;OAMG;IACH,OAAO,CAAC,gBAAgB;IAMxB;;;;;;OAMG;IACH,OAAO,CAAC,kBAAkB;IAM1B;;;;;;OAMG;IACH,OAAO,CAAC,WAAW;IAWnB;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,iBAAiB;IA2BzB;;;;;;;;;;;;;;;;OAgBG;IACH,OAAO,CAAC,kBAAkB;IA+C1B;;;;;;OAMG;IACH,OAAO,CAAC,kBAAkB;IAK1B;;;;OAIG;IACH,kBAAkB,IAAI,eAAe;CAOtC"}
|