@effect-tui/react 0.1.1 → 0.1.4
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/jsx-runtime.d.ts +13 -0
- package/dist/jsx-runtime.d.ts.map +1 -1
- package/dist/jsx-runtime.js.map +1 -1
- package/dist/src/codeblock.d.ts.map +1 -1
- package/dist/src/codeblock.js.map +1 -1
- package/dist/src/components/Divider.d.ts +18 -0
- package/dist/src/components/Divider.d.ts.map +1 -0
- package/dist/src/components/Divider.js +17 -0
- package/dist/src/components/Divider.js.map +1 -0
- package/dist/src/components/Markdown.d.ts +66 -0
- package/dist/src/components/Markdown.d.ts.map +1 -0
- package/dist/src/components/Markdown.js +226 -0
- package/dist/src/components/Markdown.js.map +1 -0
- package/dist/src/components/MultilineTextInput.d.ts +65 -0
- package/dist/src/components/MultilineTextInput.d.ts.map +1 -0
- package/dist/src/components/MultilineTextInput.js +607 -0
- package/dist/src/components/MultilineTextInput.js.map +1 -0
- package/dist/src/components/Overlay.d.ts +46 -0
- package/dist/src/components/Overlay.d.ts.map +1 -0
- package/dist/src/components/Overlay.js +11 -0
- package/dist/src/components/Overlay.js.map +1 -0
- package/dist/src/components/Static.d.ts +44 -0
- package/dist/src/components/Static.d.ts.map +1 -0
- package/dist/src/components/Static.js +53 -0
- package/dist/src/components/Static.js.map +1 -0
- package/dist/src/components/TextInput.d.ts +53 -0
- package/dist/src/components/TextInput.d.ts.map +1 -0
- package/dist/src/components/TextInput.js +210 -0
- package/dist/src/components/TextInput.js.map +1 -0
- package/dist/src/components/index.d.ts +7 -0
- package/dist/src/components/index.d.ts.map +1 -0
- package/dist/src/components/index.js +7 -0
- package/dist/src/components/index.js.map +1 -0
- package/dist/src/components/text-editing.d.ts +62 -0
- package/dist/src/components/text-editing.d.ts.map +1 -0
- package/dist/src/components/text-editing.js +385 -0
- package/dist/src/components/text-editing.js.map +1 -0
- package/dist/src/console/ConsoleCapture.d.ts +36 -0
- package/dist/src/console/ConsoleCapture.d.ts.map +1 -0
- package/dist/src/console/ConsoleCapture.js +210 -0
- package/dist/src/console/ConsoleCapture.js.map +1 -0
- package/dist/src/console/ConsolePopover.d.ts +18 -0
- package/dist/src/console/ConsolePopover.d.ts.map +1 -0
- package/dist/src/console/ConsolePopover.js +324 -0
- package/dist/src/console/ConsolePopover.js.map +1 -0
- package/dist/src/console/clipboard.d.ts +10 -0
- package/dist/src/console/clipboard.d.ts.map +1 -0
- package/dist/src/console/clipboard.js +74 -0
- package/dist/src/console/clipboard.js.map +1 -0
- package/dist/src/console/index.d.ts +5 -0
- package/dist/src/console/index.d.ts.map +1 -0
- package/dist/src/console/index.js +33 -0
- package/dist/src/console/index.js.map +1 -0
- package/dist/src/console/useConsole.d.ts +44 -0
- package/dist/src/console/useConsole.d.ts.map +1 -0
- package/dist/src/console/useConsole.js +91 -0
- package/dist/src/console/useConsole.js.map +1 -0
- package/dist/src/debug/DebugOverlay.d.ts +49 -0
- package/dist/src/debug/DebugOverlay.d.ts.map +1 -0
- package/dist/src/debug/DebugOverlay.js +438 -0
- package/dist/src/debug/DebugOverlay.js.map +1 -0
- package/dist/src/debug/DiagnosticsPanel.d.ts.map +1 -1
- package/dist/src/debug/DiagnosticsPanel.js.map +1 -1
- package/dist/src/dev/Toast.d.ts +19 -0
- package/dist/src/dev/Toast.d.ts.map +1 -0
- package/dist/src/dev/Toast.js +72 -0
- package/dist/src/dev/Toast.js.map +1 -0
- package/dist/src/dev/index.d.ts +2 -0
- package/dist/src/dev/index.d.ts.map +1 -0
- package/dist/src/dev/index.js +3 -0
- package/dist/src/dev/index.js.map +1 -0
- package/dist/src/dev.d.ts +114 -0
- package/dist/src/dev.d.ts.map +1 -0
- package/dist/src/dev.js +373 -0
- package/dist/src/dev.js.map +1 -0
- package/dist/src/highlight.d.ts +3 -3
- package/dist/src/highlight.d.ts.map +1 -1
- package/dist/src/highlight.js.map +1 -1
- package/dist/src/hmr-plugin.d.ts +2 -0
- package/dist/src/hmr-plugin.d.ts.map +1 -0
- package/dist/src/hmr-plugin.js +53 -0
- package/dist/src/hmr-plugin.js.map +1 -0
- package/dist/src/hooks/index.d.ts +4 -0
- package/dist/src/hooks/index.d.ts.map +1 -1
- package/dist/src/hooks/index.js +2 -0
- package/dist/src/hooks/index.js.map +1 -1
- package/dist/src/hooks/use-keyboard.d.ts +11 -0
- package/dist/src/hooks/use-keyboard.d.ts.map +1 -1
- package/dist/src/hooks/use-keyboard.js +22 -4
- package/dist/src/hooks/use-keyboard.js.map +1 -1
- package/dist/src/hooks/use-mouse.d.ts +24 -0
- package/dist/src/hooks/use-mouse.d.ts.map +1 -0
- package/dist/src/hooks/use-mouse.js +41 -0
- package/dist/src/hooks/use-mouse.js.map +1 -0
- package/dist/src/hooks/use-paste.d.ts +11 -0
- package/dist/src/hooks/use-paste.d.ts.map +1 -1
- package/dist/src/hooks/use-paste.js +17 -3
- package/dist/src/hooks/use-paste.js.map +1 -1
- package/dist/src/hooks/use-scroll.d.ts +79 -0
- package/dist/src/hooks/use-scroll.d.ts.map +1 -0
- package/dist/src/hooks/use-scroll.js +239 -0
- package/dist/src/hooks/use-scroll.js.map +1 -0
- package/dist/src/hooks/useFrameStats.js.map +1 -1
- package/dist/src/hosts/base.d.ts +62 -1
- package/dist/src/hosts/base.d.ts.map +1 -1
- package/dist/src/hosts/base.js +118 -5
- package/dist/src/hosts/base.js.map +1 -1
- package/dist/src/hosts/box.d.ts +7 -7
- package/dist/src/hosts/box.d.ts.map +1 -1
- package/dist/src/hosts/box.js +31 -26
- package/dist/src/hosts/box.js.map +1 -1
- package/dist/src/hosts/canvas.d.ts +8 -8
- package/dist/src/hosts/canvas.d.ts.map +1 -1
- package/dist/src/hosts/canvas.js +13 -22
- package/dist/src/hosts/canvas.js.map +1 -1
- package/dist/src/hosts/codeblock.d.ts +7 -7
- package/dist/src/hosts/codeblock.d.ts.map +1 -1
- package/dist/src/hosts/codeblock.js +11 -20
- package/dist/src/hosts/codeblock.js.map +1 -1
- package/dist/src/hosts/flex-container.d.ts +45 -0
- package/dist/src/hosts/flex-container.d.ts.map +1 -0
- package/dist/src/hosts/flex-container.js +90 -0
- package/dist/src/hosts/flex-container.js.map +1 -0
- package/dist/src/hosts/hstack.d.ts +6 -11
- package/dist/src/hosts/hstack.d.ts.map +1 -1
- package/dist/src/hosts/hstack.js +6 -41
- package/dist/src/hosts/hstack.js.map +1 -1
- package/dist/src/hosts/index.d.ts +4 -0
- package/dist/src/hosts/index.d.ts.map +1 -1
- package/dist/src/hosts/index.js +10 -0
- package/dist/src/hosts/index.js.map +1 -1
- package/dist/src/hosts/overlay-item.d.ts +32 -0
- package/dist/src/hosts/overlay-item.d.ts.map +1 -0
- package/dist/src/hosts/overlay-item.js +54 -0
- package/dist/src/hosts/overlay-item.js.map +1 -0
- package/dist/src/hosts/overlay.d.ts +30 -0
- package/dist/src/hosts/overlay.d.ts.map +1 -0
- package/dist/src/hosts/overlay.js +105 -0
- package/dist/src/hosts/overlay.js.map +1 -0
- package/dist/src/hosts/scroll.d.ts +56 -0
- package/dist/src/hosts/scroll.d.ts.map +1 -0
- package/dist/src/hosts/scroll.js +204 -0
- package/dist/src/hosts/scroll.js.map +1 -0
- package/dist/src/hosts/single-child.d.ts +16 -0
- package/dist/src/hosts/single-child.d.ts.map +1 -0
- package/dist/src/hosts/single-child.js +45 -0
- package/dist/src/hosts/single-child.js.map +1 -0
- package/dist/src/hosts/spacer.d.ts.map +1 -1
- package/dist/src/hosts/spacer.js +7 -3
- package/dist/src/hosts/spacer.js.map +1 -1
- package/dist/src/hosts/text.d.ts +9 -6
- package/dist/src/hosts/text.d.ts.map +1 -1
- package/dist/src/hosts/text.js +49 -22
- package/dist/src/hosts/text.js.map +1 -1
- package/dist/src/hosts/vstack.d.ts +6 -11
- package/dist/src/hosts/vstack.d.ts.map +1 -1
- package/dist/src/hosts/vstack.js +6 -41
- package/dist/src/hosts/vstack.js.map +1 -1
- package/dist/src/hosts/zstack.d.ts.map +1 -1
- package/dist/src/hosts/zstack.js +16 -5
- package/dist/src/hosts/zstack.js.map +1 -1
- package/dist/src/index.d.ts +9 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +10 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/inline/index.d.ts.map +1 -1
- package/dist/src/inline/index.js.map +1 -1
- package/dist/src/motion/color-motion-value.d.ts.map +1 -1
- package/dist/src/motion/color-motion-value.js.map +1 -1
- package/dist/src/motion/color.d.ts +1 -29
- package/dist/src/motion/color.d.ts.map +1 -1
- package/dist/src/motion/color.js +2 -170
- package/dist/src/motion/color.js.map +1 -1
- package/dist/src/motion/color.test.js.map +1 -1
- package/dist/src/motion/event-emitter.d.ts.map +1 -1
- package/dist/src/motion/event-emitter.js.map +1 -1
- package/dist/src/motion/frame.js.map +1 -1
- package/dist/src/motion/hooks.d.ts.map +1 -1
- package/dist/src/motion/hooks.js +8 -3
- package/dist/src/motion/hooks.js.map +1 -1
- package/dist/src/motion/index.d.ts.map +1 -1
- package/dist/src/motion/index.js.map +1 -1
- package/dist/src/motion/motion-value.d.ts.map +1 -1
- package/dist/src/motion/motion-value.js.map +1 -1
- package/dist/src/motion/motion-value.test.js.map +1 -1
- package/dist/src/motion/spring-math.d.ts +6 -1
- package/dist/src/motion/spring-math.d.ts.map +1 -1
- package/dist/src/motion/spring-math.js +6 -1
- package/dist/src/motion/spring-math.js.map +1 -1
- package/dist/src/motion/types.d.ts.map +1 -1
- package/dist/src/motion/types.js.map +1 -1
- package/dist/src/profiler.js.map +1 -1
- package/dist/src/reconciler/host-config.d.ts +5 -5
- package/dist/src/reconciler/host-config.d.ts.map +1 -1
- package/dist/src/reconciler/host-config.js +43 -51
- package/dist/src/reconciler/host-config.js.map +1 -1
- package/dist/src/reconciler/noop-methods.d.ts +29 -0
- package/dist/src/reconciler/noop-methods.d.ts.map +1 -0
- package/dist/src/reconciler/noop-methods.js +43 -0
- package/dist/src/reconciler/noop-methods.js.map +1 -0
- package/dist/src/reconciler/types.d.ts +68 -14
- package/dist/src/reconciler/types.d.ts.map +1 -1
- package/dist/src/remote/Procedures.d.ts +22 -0
- package/dist/src/remote/Procedures.d.ts.map +1 -0
- package/dist/src/remote/Procedures.js +42 -0
- package/dist/src/remote/Procedures.js.map +1 -0
- package/dist/src/remote/Router.d.ts +20 -0
- package/dist/src/remote/Router.d.ts.map +1 -0
- package/dist/src/remote/Router.js +26 -0
- package/dist/src/remote/Router.js.map +1 -0
- package/dist/src/remote/Server.d.ts +6 -0
- package/dist/src/remote/Server.d.ts.map +1 -0
- package/dist/src/remote/Server.js +53 -0
- package/dist/src/remote/Server.js.map +1 -0
- package/dist/src/remote/index.d.ts +18 -0
- package/dist/src/remote/index.d.ts.map +1 -0
- package/dist/src/remote/index.js +74 -0
- package/dist/src/remote/index.js.map +1 -0
- package/dist/src/renderer/core/FrameBuilder.d.ts +18 -0
- package/dist/src/renderer/core/FrameBuilder.d.ts.map +1 -0
- package/dist/src/renderer/core/FrameBuilder.js +38 -0
- package/dist/src/renderer/core/FrameBuilder.js.map +1 -0
- package/dist/src/renderer/core/RendererState.d.ts +41 -0
- package/dist/src/renderer/core/RendererState.d.ts.map +1 -0
- package/dist/src/renderer/core/RendererState.js +70 -0
- package/dist/src/renderer/core/RendererState.js.map +1 -0
- package/dist/src/renderer/core/index.d.ts +3 -0
- package/dist/src/renderer/core/index.d.ts.map +1 -0
- package/dist/src/renderer/core/index.js +3 -0
- package/dist/src/renderer/core/index.js.map +1 -0
- package/dist/src/renderer/input/InputProcessor.d.ts +25 -0
- package/dist/src/renderer/input/InputProcessor.d.ts.map +1 -0
- package/dist/src/renderer/input/InputProcessor.js +81 -0
- package/dist/src/renderer/input/InputProcessor.js.map +1 -0
- package/dist/src/renderer/input/index.d.ts +2 -0
- package/dist/src/renderer/input/index.d.ts.map +1 -0
- package/dist/src/renderer/input/index.js +2 -0
- package/dist/src/renderer/input/index.js.map +1 -0
- package/dist/src/renderer/lifecycle/EventBus.d.ts +41 -0
- package/dist/src/renderer/lifecycle/EventBus.d.ts.map +1 -0
- package/dist/src/renderer/lifecycle/EventBus.js +78 -0
- package/dist/src/renderer/lifecycle/EventBus.js.map +1 -0
- package/dist/src/renderer/lifecycle/ResizeManager.d.ts +34 -0
- package/dist/src/renderer/lifecycle/ResizeManager.d.ts.map +1 -0
- package/dist/src/renderer/lifecycle/ResizeManager.js +47 -0
- package/dist/src/renderer/lifecycle/ResizeManager.js.map +1 -0
- package/dist/src/renderer/lifecycle/TerminalSetup.d.ts +36 -0
- package/dist/src/renderer/lifecycle/TerminalSetup.d.ts.map +1 -0
- package/dist/src/renderer/lifecycle/TerminalSetup.js +82 -0
- package/dist/src/renderer/lifecycle/TerminalSetup.js.map +1 -0
- package/dist/src/renderer/lifecycle/index.d.ts +4 -0
- package/dist/src/renderer/lifecycle/index.d.ts.map +1 -0
- package/dist/src/renderer/lifecycle/index.js +4 -0
- package/dist/src/renderer/lifecycle/index.js.map +1 -0
- package/dist/src/renderer/modes/FullscreenRenderer.d.ts +12 -0
- package/dist/src/renderer/modes/FullscreenRenderer.d.ts.map +1 -0
- package/dist/src/renderer/modes/FullscreenRenderer.js +52 -0
- package/dist/src/renderer/modes/FullscreenRenderer.js.map +1 -0
- package/dist/src/renderer/modes/InlineRenderer.d.ts +22 -0
- package/dist/src/renderer/modes/InlineRenderer.d.ts.map +1 -0
- package/dist/src/renderer/modes/InlineRenderer.js +154 -0
- package/dist/src/renderer/modes/InlineRenderer.js.map +1 -0
- package/dist/src/renderer/modes/RendererMode.d.ts +42 -0
- package/dist/src/renderer/modes/RendererMode.d.ts.map +1 -0
- package/dist/src/renderer/modes/RendererMode.js +2 -0
- package/dist/src/renderer/modes/RendererMode.js.map +1 -0
- package/dist/src/renderer/modes/StaticContentRenderer.d.ts +25 -0
- package/dist/src/renderer/modes/StaticContentRenderer.d.ts.map +1 -0
- package/dist/src/renderer/modes/StaticContentRenderer.js +47 -0
- package/dist/src/renderer/modes/StaticContentRenderer.js.map +1 -0
- package/dist/src/renderer/modes/index.d.ts +5 -0
- package/dist/src/renderer/modes/index.d.ts.map +1 -0
- package/dist/src/renderer/modes/index.js +4 -0
- package/dist/src/renderer/modes/index.js.map +1 -0
- package/dist/src/renderer-context.d.ts +9 -0
- package/dist/src/renderer-context.d.ts.map +1 -0
- package/dist/src/renderer-context.js +22 -0
- package/dist/src/renderer-context.js.map +1 -0
- package/dist/src/renderer-types.d.ts +103 -0
- package/dist/src/renderer-types.d.ts.map +1 -0
- package/dist/src/renderer-types.js +2 -0
- package/dist/src/renderer-types.js.map +1 -0
- package/dist/src/renderer.d.ts +4 -86
- package/dist/src/renderer.d.ts.map +1 -1
- package/dist/src/renderer.js +213 -384
- package/dist/src/renderer.js.map +1 -1
- package/dist/src/test/index.d.ts.map +1 -1
- package/dist/src/test/index.js.map +1 -1
- package/dist/src/test/mock-streams.d.ts.map +1 -1
- package/dist/src/test/mock-streams.js.map +1 -1
- package/dist/src/test/render-tui.d.ts.map +1 -1
- package/dist/src/test/render-tui.js +2 -5
- package/dist/src/test/render-tui.js.map +1 -1
- package/dist/src/trace/SpanTree.d.ts.map +1 -1
- package/dist/src/trace/SpanTree.js +21 -11
- package/dist/src/trace/SpanTree.js.map +1 -1
- package/dist/src/trace/format-value.d.ts +15 -0
- package/dist/src/trace/format-value.d.ts.map +1 -0
- package/dist/src/trace/format-value.js +77 -0
- package/dist/src/trace/format-value.js.map +1 -0
- package/dist/src/trace/index.d.ts.map +1 -1
- package/dist/src/trace/index.js.map +1 -1
- package/dist/src/trace/location.js +1 -1
- package/dist/src/trace/location.js.map +1 -1
- package/dist/src/trace/span-processor.d.ts.map +1 -1
- package/dist/src/trace/span-processor.js.map +1 -1
- package/dist/src/trace/span-state.d.ts +19 -2
- package/dist/src/trace/span-state.d.ts.map +1 -1
- package/dist/src/trace/span-state.js +62 -31
- package/dist/src/trace/span-state.js.map +1 -1
- package/dist/src/trace/tui-logger.js.map +1 -1
- package/dist/src/utils/border.d.ts +1 -1
- package/dist/src/utils/border.d.ts.map +1 -1
- package/dist/src/utils/border.js +6 -0
- package/dist/src/utils/border.js.map +1 -1
- package/dist/src/utils/flex-layout.d.ts +2 -1
- package/dist/src/utils/flex-layout.d.ts.map +1 -1
- package/dist/src/utils/flex-layout.js +22 -33
- package/dist/src/utils/flex-layout.js.map +1 -1
- package/dist/src/utils/index.d.ts +1 -1
- package/dist/src/utils/index.d.ts.map +1 -1
- package/dist/src/utils/index.js +1 -1
- package/dist/src/utils/index.js.map +1 -1
- package/dist/src/utils/padding.d.ts.map +1 -1
- package/dist/src/utils/padding.js.map +1 -1
- package/dist/src/utils/styles.d.ts +20 -1
- package/dist/src/utils/styles.d.ts.map +1 -1
- package/dist/src/utils/styles.js +36 -1
- package/dist/src/utils/styles.js.map +1 -1
- package/dist/src/visualize/index.d.ts +8 -19
- package/dist/src/visualize/index.d.ts.map +1 -1
- package/dist/src/visualize/index.js +11 -25
- package/dist/src/visualize/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/jsx-dev-runtime.ts +5 -0
- package/jsx-runtime.ts +54 -0
- package/package.json +124 -92
- package/src/codeblock.tsx +34 -34
- package/src/components/Divider.tsx +23 -0
- package/src/components/Markdown.tsx +380 -0
- package/src/components/MultilineTextInput.tsx +749 -0
- package/src/components/Overlay.tsx +56 -0
- package/src/components/Static.tsx +68 -0
- package/src/components/TextInput.tsx +285 -0
- package/src/components/index.ts +6 -0
- package/src/components/text-editing.ts +464 -0
- package/src/console/ConsoleCapture.ts +272 -0
- package/src/console/ConsolePopover.tsx +487 -0
- package/src/console/clipboard.ts +81 -0
- package/src/console/index.ts +42 -0
- package/src/console/useConsole.ts +129 -0
- package/src/debug/DebugOverlay.ts +557 -0
- package/src/debug/DiagnosticsPanel.tsx +27 -27
- package/src/dev/Toast.tsx +117 -0
- package/src/dev/index.ts +2 -0
- package/src/dev.tsx +489 -0
- package/src/highlight.ts +46 -46
- package/src/hmr-plugin.ts +61 -0
- package/src/hooks/index.ts +4 -0
- package/src/hooks/use-keyboard.ts +44 -24
- package/src/hooks/use-mouse.ts +51 -0
- package/src/hooks/use-paste.ts +21 -6
- package/src/hooks/use-scroll.ts +386 -0
- package/src/hooks/useFrameStats.ts +17 -17
- package/src/hosts/base.ts +180 -59
- package/src/hosts/box.ts +117 -96
- package/src/hosts/canvas.ts +137 -141
- package/src/hosts/codeblock.ts +117 -133
- package/src/hosts/flex-container.ts +124 -0
- package/src/hosts/hstack.ts +11 -59
- package/src/hosts/index.ts +24 -14
- package/src/hosts/overlay-item.ts +72 -0
- package/src/hosts/overlay.ts +125 -0
- package/src/hosts/scroll.ts +255 -0
- package/src/hosts/single-child.ts +52 -0
- package/src/hosts/spacer.ts +30 -26
- package/src/hosts/text.ts +198 -164
- package/src/hosts/vstack.ts +11 -59
- package/src/hosts/zstack.ts +79 -67
- package/src/index.ts +44 -19
- package/src/inline/index.tsx +123 -123
- package/src/motion/color-motion-value.ts +67 -67
- package/src/motion/color.test.ts +107 -107
- package/src/motion/color.ts +9 -190
- package/src/motion/event-emitter.ts +20 -20
- package/src/motion/frame.ts +35 -35
- package/src/motion/hooks.ts +144 -139
- package/src/motion/index.ts +10 -10
- package/src/motion/motion-value.test.ts +207 -207
- package/src/motion/motion-value.ts +112 -112
- package/src/motion/spring-math.ts +88 -83
- package/src/motion/types.ts +25 -25
- package/src/profiler.ts +50 -50
- package/src/reconciler/host-config.ts +152 -174
- package/src/reconciler/noop-methods.ts +55 -0
- package/src/reconciler/types.ts +112 -46
- package/src/remote/Procedures.ts +52 -0
- package/src/remote/Router.ts +58 -0
- package/src/remote/Server.ts +76 -0
- package/src/remote/index.ts +90 -0
- package/src/renderer/core/FrameBuilder.ts +49 -0
- package/src/renderer/core/RendererState.ts +80 -0
- package/src/renderer/core/index.ts +2 -0
- package/src/renderer/input/InputProcessor.ts +94 -0
- package/src/renderer/input/index.ts +1 -0
- package/src/renderer/lifecycle/EventBus.ts +90 -0
- package/src/renderer/lifecycle/ResizeManager.ts +65 -0
- package/src/renderer/lifecycle/TerminalSetup.ts +105 -0
- package/src/renderer/lifecycle/index.ts +3 -0
- package/src/renderer/modes/FullscreenRenderer.ts +53 -0
- package/src/renderer/modes/InlineRenderer.ts +178 -0
- package/src/renderer/modes/RendererMode.ts +46 -0
- package/src/renderer/modes/StaticContentRenderer.ts +56 -0
- package/src/renderer/modes/index.ts +4 -0
- package/src/renderer-context.ts +27 -0
- package/src/renderer-types.ts +109 -0
- package/src/renderer.ts +391 -642
- package/src/test/index.ts +5 -5
- package/src/test/mock-streams.ts +115 -115
- package/src/test/render-tui.ts +84 -87
- package/src/utils/border.ts +79 -73
- package/src/utils/flex-layout.ts +80 -93
- package/src/utils/index.ts +1 -1
- package/src/utils/padding.ts +27 -27
- package/src/utils/styles.ts +50 -7
- package/src/visualize/index.tsx +225 -240
- package/dist/src/output.d.ts +0 -47
- package/dist/src/output.d.ts.map +0 -1
- package/dist/src/output.js +0 -125
- package/dist/src/output.js.map +0 -1
- package/dist/src/terminal.d.ts +0 -37
- package/dist/src/terminal.d.ts.map +0 -1
- package/dist/src/terminal.js +0 -65
- package/dist/src/terminal.js.map +0 -1
- package/src/output.ts +0 -156
- package/src/terminal.ts +0 -67
- package/src/trace/SpanTree.tsx +0 -195
- package/src/trace/index.tsx +0 -205
- package/src/trace/location.ts +0 -90
- package/src/trace/span-processor.ts +0 -65
- package/src/trace/span-state.ts +0 -286
- package/src/trace/tui-logger.ts +0 -72
package/dist/src/output.js
DELETED
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Output helpers for rendering CellBuffer to ANSI strings.
|
|
3
|
-
* Extracts common logic from renderer.ts rendering paths.
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Emit a row of cells as an ANSI string with run-length SGR encoding.
|
|
7
|
-
* Handles wide characters (cellWidth=0 continuations) and style changes.
|
|
8
|
-
*
|
|
9
|
-
* @param buffer - The cell buffer to read from
|
|
10
|
-
* @param palette - Palette for SGR code generation
|
|
11
|
-
* @param y - Row index
|
|
12
|
-
* @param width - Terminal width
|
|
13
|
-
* @param startX - Start column (default 0)
|
|
14
|
-
* @param endX - End column exclusive (default width)
|
|
15
|
-
* @returns ANSI string for the row (no cursor positioning, no trailing reset)
|
|
16
|
-
*/
|
|
17
|
-
export function emitRow(buffer, palette, y, width, startX = 0, endX = width) {
|
|
18
|
-
const row = y * width;
|
|
19
|
-
let output = "";
|
|
20
|
-
let visualCol = startX;
|
|
21
|
-
let currentStyle = -1;
|
|
22
|
-
for (let x = startX; x < endX && visualCol < width; x++) {
|
|
23
|
-
const idx = row + x;
|
|
24
|
-
const glyph = buffer.g[idx];
|
|
25
|
-
const styleId = buffer.s[idx];
|
|
26
|
-
const cellWidth = buffer.cw[idx] || 1;
|
|
27
|
-
// Skip continuation cells (wide char second half)
|
|
28
|
-
if (cellWidth === 0)
|
|
29
|
-
continue;
|
|
30
|
-
// Stop if this char would overflow
|
|
31
|
-
if (visualCol + cellWidth > width)
|
|
32
|
-
break;
|
|
33
|
-
// Emit SGR only when style changes (run-length encoding)
|
|
34
|
-
if (styleId !== currentStyle) {
|
|
35
|
-
output += palette.sgr(styleId);
|
|
36
|
-
currentStyle = styleId;
|
|
37
|
-
}
|
|
38
|
-
output += glyph === 32 ? " " : String.fromCodePoint(glyph);
|
|
39
|
-
visualCol += cellWidth;
|
|
40
|
-
}
|
|
41
|
-
return { output, lastStyle: currentStyle };
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Emit a row and reset style if needed.
|
|
45
|
-
*/
|
|
46
|
-
export function emitRowWithReset(buffer, palette, y, width, startX = 0, endX = width) {
|
|
47
|
-
const { output, lastStyle } = emitRow(buffer, palette, y, width, startX, endX);
|
|
48
|
-
return lastStyle !== 0 ? output + palette.sgr(0) : output;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Check if a row changed between two buffers.
|
|
52
|
-
*/
|
|
53
|
-
export function rowChanged(prev, next, y, width) {
|
|
54
|
-
const row = y * width;
|
|
55
|
-
for (let x = 0; x < width; x++) {
|
|
56
|
-
const idx = row + x;
|
|
57
|
-
if (next.g[idx] !== prev.g[idx] || next.s[idx] !== prev.s[idx] || next.cw[idx] !== prev.cw[idx]) {
|
|
58
|
-
return true;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return false;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Find the rightmost column with content (non-space or styled).
|
|
65
|
-
* Returns 0 if row is empty.
|
|
66
|
-
*/
|
|
67
|
-
export function rowContentWidth(buffer, y, width) {
|
|
68
|
-
const row = y * width;
|
|
69
|
-
for (let x = width - 1; x >= 0; x--) {
|
|
70
|
-
const idx = row + x;
|
|
71
|
-
// Skip continuation cells
|
|
72
|
-
if (buffer.cw[idx] === 0)
|
|
73
|
-
continue;
|
|
74
|
-
// Found content if non-space or has style
|
|
75
|
-
if (buffer.g[idx] !== 32 || buffer.s[idx] !== 0) {
|
|
76
|
-
return x + 1;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return 0;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Find the change window between two buffers for a row.
|
|
83
|
-
* Returns the leftmost and rightmost changed columns, or null if no changes.
|
|
84
|
-
*/
|
|
85
|
-
export function findChangeWindow(prev, next, y, width) {
|
|
86
|
-
const row = y * width;
|
|
87
|
-
let left = 0;
|
|
88
|
-
let right = width - 1;
|
|
89
|
-
// Find leftmost change
|
|
90
|
-
while (left <= right) {
|
|
91
|
-
const i = row + left;
|
|
92
|
-
if (next.g[i] !== prev.g[i] || next.s[i] !== prev.s[i] || next.cw[i] !== prev.cw[i]) {
|
|
93
|
-
break;
|
|
94
|
-
}
|
|
95
|
-
left++;
|
|
96
|
-
}
|
|
97
|
-
// No changes found
|
|
98
|
-
if (left > right)
|
|
99
|
-
return null;
|
|
100
|
-
// Find rightmost change
|
|
101
|
-
while (right >= left) {
|
|
102
|
-
const i = row + right;
|
|
103
|
-
if (next.g[i] !== prev.g[i] || next.s[i] !== prev.s[i] || next.cw[i] !== prev.cw[i]) {
|
|
104
|
-
break;
|
|
105
|
-
}
|
|
106
|
-
right--;
|
|
107
|
-
}
|
|
108
|
-
return { left, right };
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Find the last row with content in a buffer.
|
|
112
|
-
*/
|
|
113
|
-
export function contentHeight(buffer, width, height) {
|
|
114
|
-
for (let y = height - 1; y >= 0; y--) {
|
|
115
|
-
const row = y * width;
|
|
116
|
-
for (let x = 0; x < width; x++) {
|
|
117
|
-
const glyph = buffer.g[row + x];
|
|
118
|
-
const style = buffer.s[row + x];
|
|
119
|
-
if (glyph !== 32 || style !== 0)
|
|
120
|
-
return y + 1;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
return 0;
|
|
124
|
-
}
|
|
125
|
-
//# sourceMappingURL=output.js.map
|
package/dist/src/output.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../src/output.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,OAAO,CACtB,MAAkB,EAClB,OAAgB,EAChB,CAAS,EACT,KAAa,EACb,MAAM,GAAG,CAAC,EACV,IAAI,GAAG,KAAK;IAEZ,MAAM,GAAG,GAAG,CAAC,GAAG,KAAK,CAAA;IACrB,IAAI,MAAM,GAAG,EAAE,CAAA;IACf,IAAI,SAAS,GAAG,MAAM,CAAA;IACtB,IAAI,YAAY,GAAG,CAAC,CAAC,CAAA;IAErB,KAAK,IAAI,CAAC,GAAG,MAAM,EAAE,CAAC,GAAG,IAAI,IAAI,SAAS,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;QACzD,MAAM,GAAG,GAAG,GAAG,GAAG,CAAC,CAAA;QACnB,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;QAC3B,MAAM,OAAO,GAAG,MAAM,CAAC,CA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AA;QACrB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;YAChC,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAA;YAC/B,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAA;YAC/B,IAAI,KAAK,KAAK,EAAE,IAAI,KAAK,KAAK,CAAC;gBAAE,OAAO,CAAC,GAAG,CAAC,CAAA;QAC9C,CAAC;IACF,CAAC;IACD,OAAO,CAAC,CAAA;AACT,CAAC"}
|
package/dist/src/terminal.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
export declare const ANSI: {
|
|
2
|
-
cursor: {
|
|
3
|
-
to: (x: number, y: number) => string;
|
|
4
|
-
toCol: (col: number) => string;
|
|
5
|
-
up: (n: number) => string;
|
|
6
|
-
down: (n: number) => string;
|
|
7
|
-
hide: string;
|
|
8
|
-
show: string;
|
|
9
|
-
startOfLine: string;
|
|
10
|
-
};
|
|
11
|
-
line: {
|
|
12
|
-
clear: string;
|
|
13
|
-
clearToEnd: string;
|
|
14
|
-
};
|
|
15
|
-
screen: {
|
|
16
|
-
enterAlt: string;
|
|
17
|
-
exitAlt: string;
|
|
18
|
-
clear: string;
|
|
19
|
-
clearToEnd: string;
|
|
20
|
-
};
|
|
21
|
-
style: (s: {
|
|
22
|
-
fg?: number;
|
|
23
|
-
bg?: number;
|
|
24
|
-
bold?: boolean;
|
|
25
|
-
italic?: boolean;
|
|
26
|
-
underline?: boolean;
|
|
27
|
-
inverse?: boolean;
|
|
28
|
-
}) => string;
|
|
29
|
-
resetStyle: string;
|
|
30
|
-
};
|
|
31
|
-
export declare const Terminal: {
|
|
32
|
-
enterFullscreen: string;
|
|
33
|
-
exitFullscreen: string;
|
|
34
|
-
hideCursor: string;
|
|
35
|
-
showCursor: string;
|
|
36
|
-
};
|
|
37
|
-
//# sourceMappingURL=terminal.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"terminal.d.ts","sourceRoot":"","sources":["../../src/terminal.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI;;gBAEL,MAAM,KAAK,MAAM;qBACZ,MAAM;gBACX,MAAM;kBACJ,MAAM;;;;;;;;;;;;;;;eAeP;QACT,EAAE,CAAC,EAAE,MAAM,CAAA;QACX,EAAE,CAAC,EAAE,MAAM,CAAA;QACX,IAAI,CAAC,EAAE,OAAO,CAAA;QACd,MAAM,CAAC,EAAE,OAAO,CAAA;QAChB,SAAS,CAAC,EAAE,OAAO,CAAA;QACnB,OAAO,CAAC,EAAE,OAAO,CAAA;KAClB;;CA8BF,CAAA;AAED,eAAO,MAAM,QAAQ;;;;;CAKpB,CAAA"}
|
package/dist/src/terminal.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
// ANSI escape sequences for terminal control
|
|
2
|
-
export const ANSI = {
|
|
3
|
-
cursor: {
|
|
4
|
-
to: (x, y) => `\x1b[${y};${x}H`,
|
|
5
|
-
toCol: (col) => `\x1b[${col}G`,
|
|
6
|
-
up: (n) => (n > 0 ? `\x1b[${n}A` : ""),
|
|
7
|
-
down: (n) => (n > 0 ? `\x1b[${n}B` : ""),
|
|
8
|
-
hide: "\x1b[?25l",
|
|
9
|
-
show: "\x1b[?25h",
|
|
10
|
-
startOfLine: "\r",
|
|
11
|
-
},
|
|
12
|
-
line: {
|
|
13
|
-
clear: "\x1b[2K",
|
|
14
|
-
clearToEnd: "\x1b[0K",
|
|
15
|
-
},
|
|
16
|
-
screen: {
|
|
17
|
-
enterAlt: "\x1b[?1049h",
|
|
18
|
-
exitAlt: "\x1b[?1049l",
|
|
19
|
-
clear: "\x1b[2J",
|
|
20
|
-
clearToEnd: "\x1b[J", // Clear from cursor to end of screen
|
|
21
|
-
},
|
|
22
|
-
style: (s) => {
|
|
23
|
-
const codes = [];
|
|
24
|
-
if (s.bold)
|
|
25
|
-
codes.push(1);
|
|
26
|
-
if (s.italic)
|
|
27
|
-
codes.push(3);
|
|
28
|
-
if (s.underline)
|
|
29
|
-
codes.push(4);
|
|
30
|
-
if (s.inverse)
|
|
31
|
-
codes.push(7);
|
|
32
|
-
if (s.fg !== undefined) {
|
|
33
|
-
if (s.fg < 256) {
|
|
34
|
-
codes.push(38, 5, s.fg);
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
// Truecolor: decode from packed RGB
|
|
38
|
-
const r = (s.fg >> 16) & 0xff;
|
|
39
|
-
const g = (s.fg >> 8) & 0xff;
|
|
40
|
-
const b = s.fg & 0xff;
|
|
41
|
-
codes.push(38, 2, r, g, b);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
if (s.bg !== undefined) {
|
|
45
|
-
if (s.bg < 256) {
|
|
46
|
-
codes.push(48, 5, s.bg);
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
const r = (s.bg >> 16) & 0xff;
|
|
50
|
-
const g = (s.bg >> 8) & 0xff;
|
|
51
|
-
const b = s.bg & 0xff;
|
|
52
|
-
codes.push(48, 2, r, g, b);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return codes.length > 0 ? `\x1b[${codes.join(";")}m` : "";
|
|
56
|
-
},
|
|
57
|
-
resetStyle: "\x1b[0m",
|
|
58
|
-
};
|
|
59
|
-
export const Terminal = {
|
|
60
|
-
enterFullscreen: ANSI.screen.enterAlt + ANSI.screen.clear + ANSI.cursor.hide,
|
|
61
|
-
exitFullscreen: ANSI.screen.exitAlt + ANSI.cursor.show,
|
|
62
|
-
hideCursor: ANSI.cursor.hide,
|
|
63
|
-
showCursor: ANSI.cursor.show,
|
|
64
|
-
};
|
|
65
|
-
//# sourceMappingURL=terminal.js.map
|
package/dist/src/terminal.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"terminal.js","sourceRoot":"","sources":["../../src/terminal.ts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,GAAG,CAAC,CAAC,CAAC,EAAE,CAAA;IAC3D,CAAC;IACD,UAAU,EAAE,SAAS;CACtB,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,eAAe,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI;IAC5E,cAAc,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI;IACtD,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI;IAC5B,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI;CAC7B,CAAA"}
|
package/src/output.ts
DELETED
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Output helpers for rendering CellBuffer to ANSI strings.
|
|
3
|
-
* Extracts common logic from renderer.ts rendering paths.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import type { CellBuffer, Palette } from "@effect-tui/core"
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Emit a row of cells as an ANSI string with run-length SGR encoding.
|
|
10
|
-
* Handles wide characters (cellWidth=0 continuations) and style changes.
|
|
11
|
-
*
|
|
12
|
-
* @param buffer - The cell buffer to read from
|
|
13
|
-
* @param palette - Palette for SGR code generation
|
|
14
|
-
* @param y - Row index
|
|
15
|
-
* @param width - Terminal width
|
|
16
|
-
* @param startX - Start column (default 0)
|
|
17
|
-
* @param endX - End column exclusive (default width)
|
|
18
|
-
* @returns ANSI string for the row (no cursor positioning, no trailing reset)
|
|
19
|
-
*/
|
|
20
|
-
export function emitRow(
|
|
21
|
-
buffer: CellBuffer,
|
|
22
|
-
palette: Palette,
|
|
23
|
-
y: number,
|
|
24
|
-
width: number,
|
|
25
|
-
startX = 0,
|
|
26
|
-
endX = width,
|
|
27
|
-
): { output: string; lastStyle: number } {
|
|
28
|
-
const row = y * width
|
|
29
|
-
let output = ""
|
|
30
|
-
let visualCol = startX
|
|
31
|
-
let currentStyle = -1
|
|
32
|
-
|
|
33
|
-
for (let x = startX; x < endX && visualCol < width; x++) {
|
|
34
|
-
const idx = row + x
|
|
35
|
-
const glyph = buffer.g[idx]
|
|
36
|
-
const styleId = buffer.s[idx]
|
|
37
|
-
const cellWidth = buffer.cw[idx] || 1
|
|
38
|
-
|
|
39
|
-
// Skip continuation cells (wide char second half)
|
|
40
|
-
if (cellWidth === 0) continue
|
|
41
|
-
|
|
42
|
-
// Stop if this char would overflow
|
|
43
|
-
if (visualCol + cellWidth > width) break
|
|
44
|
-
|
|
45
|
-
// Emit SGR only when style changes (run-length encoding)
|
|
46
|
-
if (styleId !== currentStyle) {
|
|
47
|
-
output += palette.sgr(styleId)
|
|
48
|
-
currentStyle = styleId
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
output += glyph === 32 ? " " : String.fromCodePoint(glyph)
|
|
52
|
-
visualCol += cellWidth
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return { output, lastStyle: currentStyle }
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Emit a row and reset style if needed.
|
|
60
|
-
*/
|
|
61
|
-
export function emitRowWithReset(
|
|
62
|
-
buffer: CellBuffer,
|
|
63
|
-
palette: Palette,
|
|
64
|
-
y: number,
|
|
65
|
-
width: number,
|
|
66
|
-
startX = 0,
|
|
67
|
-
endX = width,
|
|
68
|
-
): string {
|
|
69
|
-
const { output, lastStyle } = emitRow(buffer, palette, y, width, startX, endX)
|
|
70
|
-
return lastStyle !== 0 ? output + palette.sgr(0) : output
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Check if a row changed between two buffers.
|
|
75
|
-
*/
|
|
76
|
-
export function rowChanged(prev: CellBuffer, next: CellBuffer, y: number, width: number): boolean {
|
|
77
|
-
const row = y * width
|
|
78
|
-
for (let x = 0; x < width; x++) {
|
|
79
|
-
const idx = row + x
|
|
80
|
-
if (next.g[idx] !== prev.g[idx] || next.s[idx] !== prev.s[idx] || next.cw[idx] !== prev.cw[idx]) {
|
|
81
|
-
return true
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
return false
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Find the rightmost column with content (non-space or styled).
|
|
89
|
-
* Returns 0 if row is empty.
|
|
90
|
-
*/
|
|
91
|
-
export function rowContentWidth(buffer: CellBuffer, y: number, width: number): number {
|
|
92
|
-
const row = y * width
|
|
93
|
-
for (let x = width - 1; x >= 0; x--) {
|
|
94
|
-
const idx = row + x
|
|
95
|
-
// Skip continuation cells
|
|
96
|
-
if (buffer.cw[idx] === 0) continue
|
|
97
|
-
// Found content if non-space or has style
|
|
98
|
-
if (buffer.g[idx] !== 32 || buffer.s[idx] !== 0) {
|
|
99
|
-
return x + 1
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
return 0
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Find the change window between two buffers for a row.
|
|
107
|
-
* Returns the leftmost and rightmost changed columns, or null if no changes.
|
|
108
|
-
*/
|
|
109
|
-
export function findChangeWindow(
|
|
110
|
-
prev: CellBuffer,
|
|
111
|
-
next: CellBuffer,
|
|
112
|
-
y: number,
|
|
113
|
-
width: number,
|
|
114
|
-
): { left: number; right: number } | null {
|
|
115
|
-
const row = y * width
|
|
116
|
-
let left = 0
|
|
117
|
-
let right = width - 1
|
|
118
|
-
|
|
119
|
-
// Find leftmost change
|
|
120
|
-
while (left <= right) {
|
|
121
|
-
const i = row + left
|
|
122
|
-
if (next.g[i] !== prev.g[i] || next.s[i] !== prev.s[i] || next.cw[i] !== prev.cw[i]) {
|
|
123
|
-
break
|
|
124
|
-
}
|
|
125
|
-
left++
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
// No changes found
|
|
129
|
-
if (left > right) return null
|
|
130
|
-
|
|
131
|
-
// Find rightmost change
|
|
132
|
-
while (right >= left) {
|
|
133
|
-
const i = row + right
|
|
134
|
-
if (next.g[i] !== prev.g[i] || next.s[i] !== prev.s[i] || next.cw[i] !== prev.cw[i]) {
|
|
135
|
-
break
|
|
136
|
-
}
|
|
137
|
-
right--
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
return { left, right }
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Find the last row with content in a buffer.
|
|
145
|
-
*/
|
|
146
|
-
export function contentHeight(buffer: CellBuffer, width: number, height: number): number {
|
|
147
|
-
for (let y = height - 1; y >= 0; y--) {
|
|
148
|
-
const row = y * width
|
|
149
|
-
for (let x = 0; x < width; x++) {
|
|
150
|
-
const glyph = buffer.g[row + x]
|
|
151
|
-
const style = buffer.s[row + x]
|
|
152
|
-
if (glyph !== 32 || style !== 0) return y + 1
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
return 0
|
|
156
|
-
}
|
package/src/terminal.ts
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
// ANSI escape sequences for terminal control
|
|
2
|
-
|
|
3
|
-
export const ANSI = {
|
|
4
|
-
cursor: {
|
|
5
|
-
to: (x: number, y: number) => `\x1b[${y};${x}H`,
|
|
6
|
-
toCol: (col: number) => `\x1b[${col}G`,
|
|
7
|
-
up: (n: number) => (n > 0 ? `\x1b[${n}A` : ""),
|
|
8
|
-
down: (n: number) => (n > 0 ? `\x1b[${n}B` : ""),
|
|
9
|
-
hide: "\x1b[?25l",
|
|
10
|
-
show: "\x1b[?25h",
|
|
11
|
-
startOfLine: "\r",
|
|
12
|
-
},
|
|
13
|
-
line: {
|
|
14
|
-
clear: "\x1b[2K",
|
|
15
|
-
clearToEnd: "\x1b[0K",
|
|
16
|
-
},
|
|
17
|
-
screen: {
|
|
18
|
-
enterAlt: "\x1b[?1049h",
|
|
19
|
-
exitAlt: "\x1b[?1049l",
|
|
20
|
-
clear: "\x1b[2J",
|
|
21
|
-
clearToEnd: "\x1b[J", // Clear from cursor to end of screen
|
|
22
|
-
},
|
|
23
|
-
style: (s: {
|
|
24
|
-
fg?: number
|
|
25
|
-
bg?: number
|
|
26
|
-
bold?: boolean
|
|
27
|
-
italic?: boolean
|
|
28
|
-
underline?: boolean
|
|
29
|
-
inverse?: boolean
|
|
30
|
-
}) => {
|
|
31
|
-
const codes: number[] = []
|
|
32
|
-
if (s.bold) codes.push(1)
|
|
33
|
-
if (s.italic) codes.push(3)
|
|
34
|
-
if (s.underline) codes.push(4)
|
|
35
|
-
if (s.inverse) codes.push(7)
|
|
36
|
-
if (s.fg !== undefined) {
|
|
37
|
-
if (s.fg < 256) {
|
|
38
|
-
codes.push(38, 5, s.fg)
|
|
39
|
-
} else {
|
|
40
|
-
// Truecolor: decode from packed RGB
|
|
41
|
-
const r = (s.fg >> 16) & 0xff
|
|
42
|
-
const g = (s.fg >> 8) & 0xff
|
|
43
|
-
const b = s.fg & 0xff
|
|
44
|
-
codes.push(38, 2, r, g, b)
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
if (s.bg !== undefined) {
|
|
48
|
-
if (s.bg < 256) {
|
|
49
|
-
codes.push(48, 5, s.bg)
|
|
50
|
-
} else {
|
|
51
|
-
const r = (s.bg >> 16) & 0xff
|
|
52
|
-
const g = (s.bg >> 8) & 0xff
|
|
53
|
-
const b = s.bg & 0xff
|
|
54
|
-
codes.push(48, 2, r, g, b)
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return codes.length > 0 ? `\x1b[${codes.join(";")}m` : ""
|
|
58
|
-
},
|
|
59
|
-
resetStyle: "\x1b[0m",
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export const Terminal = {
|
|
63
|
-
enterFullscreen: ANSI.screen.enterAlt + ANSI.screen.clear + ANSI.cursor.hide,
|
|
64
|
-
exitFullscreen: ANSI.screen.exitAlt + ANSI.cursor.show,
|
|
65
|
-
hideCursor: ANSI.cursor.hide,
|
|
66
|
-
showCursor: ANSI.cursor.show,
|
|
67
|
-
}
|
package/src/trace/SpanTree.tsx
DELETED
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
// React component for visualizing span tree
|
|
2
|
-
|
|
3
|
-
import { Colors, type ColorValue } from "@effect-tui/core"
|
|
4
|
-
import type { SpanNode, SpanTreeState } from "./span-state.js"
|
|
5
|
-
|
|
6
|
-
const SPINNER_FRAMES = ["⠋", "⠙", "⠸", "⠴", "⠦", "⠇"] as const
|
|
7
|
-
|
|
8
|
-
function formatDuration(ms: number): string {
|
|
9
|
-
if (ms < 1000) return `${Math.round(ms)}ms`
|
|
10
|
-
return `${(ms / 1000).toFixed(1)}s`
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
// Map opacity (0-1) to gray level (8-23 for visible range)
|
|
14
|
-
function opacityToGray(opacity: number): number {
|
|
15
|
-
const minGray = 8
|
|
16
|
-
const maxGray = 23
|
|
17
|
-
return Math.round(minGray + opacity * (maxGray - minGray))
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// Interpolate RGB color based on opacity
|
|
21
|
-
function dimColor(r: number, g: number, b: number, opacity: number): ColorValue {
|
|
22
|
-
const minOpacity = 0.3 // Don't go completely dark
|
|
23
|
-
const factor = minOpacity + opacity * (1 - minOpacity)
|
|
24
|
-
return Colors.rgb(Math.round(r * factor), Math.round(g * factor), Math.round(b * factor))
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// Get log level color
|
|
28
|
-
function logLevelColor(level: string, opacity: number): ColorValue {
|
|
29
|
-
switch (level) {
|
|
30
|
-
case "ERROR":
|
|
31
|
-
return dimColor(255, 80, 80, opacity)
|
|
32
|
-
case "WARN":
|
|
33
|
-
return dimColor(255, 200, 0, opacity)
|
|
34
|
-
case "INFO":
|
|
35
|
-
return dimColor(100, 180, 255, opacity)
|
|
36
|
-
default:
|
|
37
|
-
return Colors.gray(opacityToGray(opacity))
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
interface SpanRowProps {
|
|
42
|
-
node: SpanNode
|
|
43
|
-
state: SpanTreeState
|
|
44
|
-
spinnerIndex: number
|
|
45
|
-
prefix: string
|
|
46
|
-
isLast: boolean
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function SpanRow({ node, state, spinnerIndex, prefix, isLast }: SpanRowProps) {
|
|
50
|
-
const connector = isLast ? "└─" : "├─"
|
|
51
|
-
const childPrefix = prefix + (isLast ? " " : "│ ")
|
|
52
|
-
|
|
53
|
-
const opacity = node.opacity
|
|
54
|
-
const grayLevel = opacityToGray(opacity)
|
|
55
|
-
|
|
56
|
-
const isSelected = state.selectedSpanId === node.id
|
|
57
|
-
const isExpanded = state.expandedSpanIds.has(node.id)
|
|
58
|
-
|
|
59
|
-
// Status icon
|
|
60
|
-
let icon: string
|
|
61
|
-
let iconColor: ColorValue | number
|
|
62
|
-
if (node.status === "running") {
|
|
63
|
-
icon = SPINNER_FRAMES[spinnerIndex]
|
|
64
|
-
iconColor = Colors.brightCyan
|
|
65
|
-
} else if (node.status === "success") {
|
|
66
|
-
icon = "✓"
|
|
67
|
-
iconColor = dimColor(0, 255, 0, opacity)
|
|
68
|
-
} else {
|
|
69
|
-
icon = "✗"
|
|
70
|
-
iconColor = dimColor(255, 80, 80, opacity)
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// Name color - selected gets blue bg with bright text
|
|
74
|
-
const nameColor = isSelected
|
|
75
|
-
? Colors.brightWhite
|
|
76
|
-
: node.status === "running"
|
|
77
|
-
? Colors.brightWhite
|
|
78
|
-
: Colors.gray(grayLevel)
|
|
79
|
-
const nameBg = isSelected ? Colors.rgb(30, 60, 120) : undefined
|
|
80
|
-
|
|
81
|
-
// Duration display
|
|
82
|
-
const durationStr =
|
|
83
|
-
node.duration !== undefined
|
|
84
|
-
? formatDuration(node.duration)
|
|
85
|
-
: node.status === "running"
|
|
86
|
-
? formatDuration(Date.now() - node.startTime)
|
|
87
|
-
: ""
|
|
88
|
-
const durationColor = Colors.gray(Math.max(8, grayLevel - 4))
|
|
89
|
-
|
|
90
|
-
// Log counts from logEntries
|
|
91
|
-
const logCounts = { info: 0, warn: 0, error: 0, debug: 0 }
|
|
92
|
-
for (const entry of node.logEntries) {
|
|
93
|
-
if (entry.level === "INFO") logCounts.info++
|
|
94
|
-
else if (entry.level === "WARN") logCounts.warn++
|
|
95
|
-
else if (entry.level === "ERROR") logCounts.error++
|
|
96
|
-
else logCounts.debug++
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
const logParts: Array<{ text: string; color: ColorValue | number }> = []
|
|
100
|
-
if (logCounts.error > 0) logParts.push({ text: `${logCounts.error} err`, color: dimColor(255, 80, 80, opacity) })
|
|
101
|
-
if (logCounts.warn > 0) logParts.push({ text: `${logCounts.warn} warn`, color: dimColor(255, 200, 0, opacity) })
|
|
102
|
-
if (logCounts.info > 0) logParts.push({ text: `${logCounts.info} info`, color: dimColor(100, 180, 255, opacity) })
|
|
103
|
-
if (logCounts.debug > 0) logParts.push({ text: `${logCounts.debug} dbg`, color: Colors.gray(grayLevel) })
|
|
104
|
-
|
|
105
|
-
return (
|
|
106
|
-
<vstack>
|
|
107
|
-
<hstack>
|
|
108
|
-
<text fg={Colors.gray(Math.max(8, grayLevel - 2))}>
|
|
109
|
-
{prefix}
|
|
110
|
-
{connector}
|
|
111
|
-
</text>
|
|
112
|
-
<text fg={iconColor}> {icon} </text>
|
|
113
|
-
<text fg={nameColor} bg={nameBg}>
|
|
114
|
-
{node.name}
|
|
115
|
-
</text>
|
|
116
|
-
{durationStr && <text fg={durationColor}> {durationStr}</text>}
|
|
117
|
-
{logParts.length > 0 && <text fg={durationColor}> [</text>}
|
|
118
|
-
{logParts.map((p, i) => (
|
|
119
|
-
<text key={i} fg={p.color}>
|
|
120
|
-
{i > 0 ? " " : ""}
|
|
121
|
-
{p.text}
|
|
122
|
-
</text>
|
|
123
|
-
))}
|
|
124
|
-
{logParts.length > 0 && <text fg={durationColor}>]</text>}
|
|
125
|
-
{node.error && <text fg={Colors.red}> ({node.error})</text>}
|
|
126
|
-
</hstack>
|
|
127
|
-
{/* Expanded log entries */}
|
|
128
|
-
{isExpanded &&
|
|
129
|
-
node.logEntries.map((entry, i) => (
|
|
130
|
-
<hstack key={i}>
|
|
131
|
-
<text fg={Colors.gray(10)}>
|
|
132
|
-
{childPrefix}
|
|
133
|
-
{node.children.length > 0 ? "│ " : " "}
|
|
134
|
-
</text>
|
|
135
|
-
<text fg={logLevelColor(entry.level, opacity)}>{entry.level}</text>
|
|
136
|
-
<text fg={Colors.gray(16)}> {entry.message}</text>
|
|
137
|
-
</hstack>
|
|
138
|
-
))}
|
|
139
|
-
{node.children.map((child, i) => (
|
|
140
|
-
<SpanRow
|
|
141
|
-
key={child.id}
|
|
142
|
-
node={child}
|
|
143
|
-
state={state}
|
|
144
|
-
spinnerIndex={spinnerIndex}
|
|
145
|
-
prefix={childPrefix}
|
|
146
|
-
isLast={i === node.children.length - 1}
|
|
147
|
-
/>
|
|
148
|
-
))}
|
|
149
|
-
</vstack>
|
|
150
|
-
)
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
interface SpanTreeProps {
|
|
154
|
-
state: SpanTreeState
|
|
155
|
-
spinnerIndex: number
|
|
156
|
-
serviceName?: string
|
|
157
|
-
showExitPrompt?: boolean
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
export function SpanTree({ state, spinnerIndex, serviceName, showExitPrompt }: SpanTreeProps) {
|
|
161
|
-
// No subscription needed - parent's 60fps loop drives re-renders
|
|
162
|
-
const roots = state.getRoots()
|
|
163
|
-
|
|
164
|
-
if (roots.length === 0) {
|
|
165
|
-
return <text fg={Colors.gray(10)}>Waiting for spans...</text>
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
const hasAnyLogs = state.getSpansWithLogs().length > 0
|
|
169
|
-
|
|
170
|
-
return (
|
|
171
|
-
<vstack>
|
|
172
|
-
{serviceName && (
|
|
173
|
-
<text fg={Colors.brightWhite} bold>
|
|
174
|
-
{serviceName}
|
|
175
|
-
</text>
|
|
176
|
-
)}
|
|
177
|
-
{roots.map((root, i) => (
|
|
178
|
-
<SpanRow
|
|
179
|
-
key={root.id}
|
|
180
|
-
node={root}
|
|
181
|
-
state={state}
|
|
182
|
-
spinnerIndex={spinnerIndex}
|
|
183
|
-
prefix=""
|
|
184
|
-
isLast={i === roots.length - 1}
|
|
185
|
-
/>
|
|
186
|
-
))}
|
|
187
|
-
{showExitPrompt && (
|
|
188
|
-
<text fg={Colors.gray(12)}>
|
|
189
|
-
{"\n"}
|
|
190
|
-
{hasAnyLogs ? "↑↓ navigate, Enter expand, O open, q to exit" : "q to exit"}
|
|
191
|
-
</text>
|
|
192
|
-
)}
|
|
193
|
-
</vstack>
|
|
194
|
-
)
|
|
195
|
-
}
|