@simon_he/vue-tui 1.0.2 → 1.1.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.
Files changed (125) hide show
  1. package/README.md +84 -26
  2. package/dist/TMermaidText-frVr8Ysb.js +885 -0
  3. package/dist/{TSelect-DR0FomSu.js → TSelect-tJ87rKPM.js} +59 -242
  4. package/dist/{TTree-kzhlB5P0.js → TTree-CGdE-CYu.js} +138 -102
  5. package/dist/agent/mermaid.cjs +2 -0
  6. package/dist/agent/mermaid.d.cts +2 -0
  7. package/dist/agent/mermaid.d.ts +2 -0
  8. package/dist/agent/mermaid.js +1 -0
  9. package/dist/agent.cjs +31188 -24907
  10. package/dist/agent.d.cts +11 -1
  11. package/dist/agent.d.ts +11 -1
  12. package/dist/agent.js +516 -11
  13. package/dist/{block-source-CKUOnkgT.js → block-source-CrlmaBM5.js} +1039 -66
  14. package/dist/cli/input.d.ts +8 -0
  15. package/dist/cli/stdin-buffer.d.ts +1 -1
  16. package/dist/cli/video/ffmpeg-frame-source.d.ts +10 -0
  17. package/dist/cli/video/png-frame-parser.d.ts +4 -0
  18. package/dist/cli/video/raw-frame-parser.d.ts +1 -0
  19. package/dist/cli/video/yt-dlp-frame-source.d.ts +11 -0
  20. package/dist/cli.cjs +5146 -6767
  21. package/dist/cli.d.cts +5 -1
  22. package/dist/cli.d.ts +5 -1
  23. package/dist/cli.js +2869 -154
  24. package/dist/core/buffer/eaw-ranges-unicode-17.d.ts +14 -0
  25. package/dist/core/perf/instrumentation-noop.d.ts +48 -0
  26. package/dist/core/perf/instrumentation.d.ts +136 -0
  27. package/dist/core/terminal/create-terminal.d.ts +1 -0
  28. package/dist/core.cjs +843 -1469
  29. package/dist/core.js +4 -5
  30. package/dist/create-terminal-app.d.ts +24 -1
  31. package/dist/debug-logger-CmsGI4of.js +74 -0
  32. package/dist/{dom-renderer-BniJSQyX.js → dom-renderer-DXx8fWzD.js} +2 -3
  33. package/dist/experimental/3d/bun/contributor-avatar-atlas.d.ts +12 -0
  34. package/dist/experimental/3d/bun/png.d.ts +1 -0
  35. package/dist/experimental/3d/bun/terminal-badge-scene.d.ts +11 -0
  36. package/dist/experimental/3d/bun/terminal-badge.wgsl.d.ts +1 -0
  37. package/dist/experimental/3d/bun/webgpu-renderer.d.ts +26 -0
  38. package/dist/experimental/3d/bun.cjs +7271 -0
  39. package/dist/experimental/3d/bun.d.cts +4 -0
  40. package/dist/experimental/3d/bun.d.ts +4 -0
  41. package/dist/experimental/3d/bun.js +7390 -0
  42. package/dist/experimental/video/node.cjs +497 -0
  43. package/dist/experimental/video/node.d.cts +4 -0
  44. package/dist/experimental/video/node.d.ts +4 -0
  45. package/dist/experimental/video/node.js +610 -0
  46. package/dist/experimental.cjs +6876 -6192
  47. package/dist/experimental.d.cts +7 -0
  48. package/dist/experimental.d.ts +7 -0
  49. package/dist/experimental.js +3005 -9
  50. package/dist/frame-perf-CHpWhbC4.js +111 -0
  51. package/dist/{create-terminal-DBFNYr8f.js → hyperlink-_1FAj7Wq.js} +440 -13
  52. package/dist/index.cjs +5017 -10339
  53. package/dist/index.js +14 -13
  54. package/dist/{linkify-D_gzn9Xq.js → linkify-D68T7rdW.js} +193 -3
  55. package/dist/markdown.cjs +21295 -12691
  56. package/dist/markdown.d.cts +1 -1
  57. package/dist/markdown.d.ts +1 -1
  58. package/dist/markdown.js +211 -51
  59. package/dist/mermaid-BNhM1jAZ.js +123 -0
  60. package/dist/mermaid.cjs +1707 -0
  61. package/dist/mermaid.d.cts +3 -0
  62. package/dist/mermaid.d.ts +3 -0
  63. package/dist/mermaid.js +6 -0
  64. package/dist/observability/frame-perf-store.d.ts +2 -1
  65. package/dist/observability/frame-perf.d.ts +33 -0
  66. package/dist/observability.cjs +106 -107
  67. package/dist/observability.d.cts +2 -2
  68. package/dist/observability.d.ts +2 -2
  69. package/dist/observability.js +3 -3
  70. package/dist/{wheel-scroll-vBRaQ7p-.js → rect-DUpeDfBg.js} +253 -117
  71. package/dist/renderer/cli/stdout-metrics.d.ts +10 -0
  72. package/dist/renderer/cli/stdout-renderer.d.ts +3 -0
  73. package/dist/renderer/terminal-graphic-render-queue.d.ts +50 -0
  74. package/dist/renderer/terminal-graphics-trace.d.ts +53 -0
  75. package/dist/renderer/terminal-graphics.d.ts +147 -0
  76. package/dist/renderer-dom.cjs +364 -903
  77. package/dist/renderer-dom.js +4 -5
  78. package/dist/runtime/index.d.ts +2 -0
  79. package/dist/{runtime-rfcZCyJq.js → runtime-Byf8XXOT.js} +28 -15
  80. package/dist/runtime.cjs +427 -889
  81. package/dist/runtime.js +2 -2
  82. package/dist/terminal-graphics-Bbe83wSr.js +597 -0
  83. package/dist/{terminal-selection-DBinO6p5.js → terminal-selection-4W1SJj4c.js} +4 -1
  84. package/dist/{tlog-theme-CvLFNMwk.js → tlog-theme-Bul2Na3u.js} +1237 -12
  85. package/dist/{trace-CjzYeIxN.js → trace-Bh8WnoMo.js} +5 -0
  86. package/dist/vue/agent/create-png-terminal-graphic-renderer.d.ts +19 -0
  87. package/dist/vue/components/T3DViewport.d.ts +473 -0
  88. package/dist/vue/components/TAgentTerminalGraphic.d.ts +494 -0
  89. package/dist/vue/components/TCharts.d.ts +1121 -0
  90. package/dist/vue/components/TFeedback.d.ts +1 -1
  91. package/dist/vue/components/TFlex.d.ts +389 -0
  92. package/dist/vue/components/TForm.d.ts +4 -4
  93. package/dist/vue/components/TLogSearchBar.d.ts +3 -3
  94. package/dist/vue/components/TLogSearchPager.d.ts +2 -2
  95. package/dist/vue/components/TMarkdownText.d.ts +162 -4
  96. package/dist/vue/components/TMermaidText.d.ts +900 -0
  97. package/dist/vue/components/TVideo.d.ts +291 -0
  98. package/dist/vue/components/TVirtualList.d.ts +9 -0
  99. package/dist/vue/components/TVirtualMarkdown.d.ts +170 -9
  100. package/dist/vue/components/TVirtualRows.d.ts +9 -0
  101. package/dist/vue/components/TerminalProvider.d.ts +2 -0
  102. package/dist/vue/context.d.ts +24 -0
  103. package/dist/vue/index.d.ts +5 -0
  104. package/dist/vue/layout/flex.d.ts +67 -0
  105. package/dist/vue/markdown/ast.d.ts +5 -2
  106. package/dist/vue/markdown/document.d.ts +5 -0
  107. package/dist/vue/markdown/image-actions.d.ts +14 -0
  108. package/dist/vue/markdown/image.d.ts +11 -0
  109. package/dist/vue/markdown/link-actions.d.ts +14 -0
  110. package/dist/vue/markdown/math-actions.d.ts +14 -0
  111. package/dist/vue/markdown/math.d.ts +6 -0
  112. package/dist/vue/markdown/render.d.ts +28 -0
  113. package/dist/vue/markdown/types.d.ts +78 -0
  114. package/dist/vue/mermaid/beautiful-mermaid.d.ts +1436 -0
  115. package/dist/vue/render/render-manager.d.ts +7 -0
  116. package/dist/vue/video/types.d.ts +39 -0
  117. package/dist/vue.cjs +7207 -12437
  118. package/dist/vue.js +704 -38
  119. package/dist/wheel-scroll-DASkEZr-.js +106 -0
  120. package/dist/{hyperlink-Bn02UXJb.js → width-GqllnV8C.js} +166 -111
  121. package/package.json +119 -14
  122. package/dist/frame-perf-C6Xfg85O.js +0 -24
  123. package/dist/sgr-BmzxEjAO.js +0 -304
  124. /package/dist/{ansi-palette-CNXqFciC.js → ansi-palette-CH6jc2Z7.js} +0 -0
  125. /package/dist/{path-suggest-BNqcuE3-.js → path-suggest-Dndu4dTi.js} +0 -0
package/README.md CHANGED
@@ -54,20 +54,72 @@ Development, release validation, and documentation builds are run on Node.js 20
54
54
 
55
55
  ## Entry Points
56
56
 
57
- | Import | Stability | Use it for |
58
- | --------------------------------- | ------------ | --------------------------------------------------------------------------------------------------------------------------- |
59
- | `@simon_he/vue-tui` | Public | Browser-safe terminal core, DOM renderer, stable Vue components, and input host plugin factory |
60
- | `@simon_he/vue-tui/core` | Public | Terminal core, buffer-facing types, ANSI/theme/path/hyperlink helpers |
61
- | `@simon_he/vue-tui/renderer/dom` | Public | DOM renderer factory and renderer capabilities |
62
- | `@simon_he/vue-tui/vue` | Advanced | Extended Vue components, composables, router helpers, and Vue runtime internals |
63
- | `@simon_he/vue-tui/runtime` | Advanced | Runtime wiring, selection helpers, and clipboard abstraction |
64
- | `@simon_he/vue-tui/observability` | Advanced | Frame perf store, profiler hooks, and trace helpers |
65
- | `@simon_he/vue-tui/cli` | Public | Node-only headless Vue app runtime, stdin driver, stdout renderer, path provider, recording, and terminal clipboard helpers |
66
- | `@simon_he/vue-tui/markdown` | Public | `TMarkdownText`, `TVirtualMarkdown`, markdown parser and layout helpers, streaming markdown block sources |
67
- | `@simon_he/vue-tui/experimental` | Experimental | `TVirtualList`, `TTranscriptView`, `TLogView`, TLog search/link/minimap companions, append-only log store, and TLog plugins |
68
- | `@simon_he/vue-tui/agent` | Experimental | Agent/console transcript, tool-call header, log, markdown, virtual list, render plane, and overlay component aggregation |
69
-
70
- The stable surface is terminal core, DOM rendering, CLI runtime, basic Vue components, and markdown APIs. High-throughput log, virtualization, and agent/console aggregation APIs stay under `/experimental` or `/agent` until their public surface settles; keep those imports isolated in application code.
57
+ | Import | Stability | Use it for |
58
+ | ------------------------------------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------- |
59
+ | `@simon_he/vue-tui` | Public | Browser-safe terminal core, DOM renderer, stable Vue components, and input host plugin factory |
60
+ | `@simon_he/vue-tui/core` | Public | Terminal core, buffer-facing types, ANSI/theme/path/hyperlink helpers |
61
+ | `@simon_he/vue-tui/renderer/dom` | Public | DOM renderer factory and renderer capabilities |
62
+ | `@simon_he/vue-tui/vue` | Advanced | Extended Vue components, composables, router helpers, and Vue runtime internals |
63
+ | `@simon_he/vue-tui/runtime` | Advanced | Runtime wiring, selection helpers, and clipboard abstraction |
64
+ | `@simon_he/vue-tui/observability` | Advanced | Frame perf store, profiler hooks, and trace helpers |
65
+ | `@simon_he/vue-tui/cli` | Public | Node-only headless Vue app runtime, stdin driver, stdout renderer, path provider, recording, and terminal clipboard helpers |
66
+ | `@simon_he/vue-tui/markdown` | Public | `TMarkdownText`, `TVirtualMarkdown`, markdown parser and layout helpers, streaming markdown block sources |
67
+ | `@simon_he/vue-tui/mermaid` | Public | Optional `beautiful-mermaid` bridge and wrapper for `TMermaidText` |
68
+ | `@simon_he/vue-tui/experimental` | Experimental | `T3DViewport`, `TVideo`, charts, `TVirtualList`, `TTranscriptView`, `TLogView`, TLog companions, and append-only log tooling |
69
+ | `@simon_he/vue-tui/experimental/video/node` | Experimental | Node-only lazy FFmpeg frame source plus optional yt-dlp resolver for supported video pages |
70
+ | `@simon_he/vue-tui/experimental/3d/bun` | Experimental | Bun-only raw WGSL/WebGPU Pull renderers, including the vue-tui terminal badge scene |
71
+ | `@simon_he/vue-tui/agent` | Experimental | Agent/console transcript, tool-call header, log, markdown, virtual list, render plane, and overlay component aggregation |
72
+ | `@simon_he/vue-tui/agent/mermaid` | Experimental | Agent namespace optional `beautiful-mermaid` bridge and wrapper for `TMermaidText` |
73
+
74
+ The stable surface is terminal core, DOM rendering, CLI runtime, basic Vue components, markdown APIs, and the optional Mermaid bridge. High-throughput log, virtualization, and agent/console aggregation APIs stay under `/experimental` or `/agent` until their public surface settles; keep those imports isolated in application code. Use `/agent/mermaid` when agent code wants the optional Mermaid wrapper without changing the `/agent` main entrypoint.
75
+
76
+ Experimental chart components are imported from the `/experimental` entrypoint:
77
+
78
+ ```ts
79
+ import {
80
+ TCandlestickChart,
81
+ TContributionGraph,
82
+ TLineChart,
83
+ TPieChart,
84
+ } from "@simon_he/vue-tui/experimental";
85
+ ```
86
+
87
+ `T3DViewport` is renderer-agnostic and Pull-based. The bundled WGSL renderer is isolated in the Bun-only entrypoint so browser-safe imports do not load native GPU code:
88
+
89
+ ```ts
90
+ import { T3DViewport } from "@simon_he/vue-tui/experimental";
91
+ import { createTerminalBadge3DRenderer } from "@simon_he/vue-tui/experimental/3d/bun";
92
+
93
+ const renderer = createTerminalBadge3DRenderer();
94
+ ```
95
+
96
+ Install the optional `bun-webgpu` peer, then run the complete direction-E terminal badge example with `bun run run:3d:terminal`. Drag to orbit and use a two-finger trackpad gesture or mouse wheel to zoom. CLI hover steering requires `createStdinDriver({ enableMouseMotion: true })`.
97
+
98
+ #### `experimental/3d/bun` platform requirements
99
+
100
+ | Requirement | Detail |
101
+ | --------------------------- | ---------------------------------------------------- |
102
+ | Runtime | **Bun only** — Node.js and browser are not supported |
103
+ | `bun-webgpu` peer | Must be installed manually: `bun add bun-webgpu` |
104
+ | macOS x64 / arm64 | ✅ Prebuilt binary available |
105
+ | Linux x64 | ✅ Prebuilt binary available |
106
+ | Windows x64 | ✅ Prebuilt binary available |
107
+ | Linux arm64 / musl (Alpine) | ❌ No prebuilt binary — must build from source |
108
+
109
+ > `T3DViewport` itself (from `/experimental`) has zero native dependencies and works everywhere. Only `experimental/3d/bun` requires Bun and the optional peer. `bun-webgpu` is an experimental library; see [bun-webgpu](https://github.com/kommander/bun-webgpu) for current status.
110
+
111
+ #### Terminal graphics protocol requirements
112
+
113
+ `TVideo` and `T3DViewport` automatically negotiate their output format based on the detected terminal:
114
+
115
+ | Terminal capability | Output quality |
116
+ | ----------------------------------- | ---------------------------------------------- |
117
+ | kitty or iTerm2 protocol | Pixel-accurate frames (PNG) |
118
+ | No graphics protocol (any terminal) | `gray8` ASCII art — functional, lower fidelity |
119
+
120
+ `TAgentTerminalGraphic` (mermaid diagrams, KaTeX math, images) requires kitty, iTerm2, or sixel to render visually; without a protocol it shows the `fallback` text prop. Always provide a meaningful `fallback` value so non-graphical terminals still convey the content.
121
+
122
+ > sixel terminals get graphics for `TAgentTerminalGraphic` but ASCII art for `TVideo` / `T3DViewport` — only kitty and iTerm2 support pixel-accurate video and 3D frames. See [docs/platform-contracts.md](./docs/platform-contracts.md) for the full degradation table.
71
123
 
72
124
  Do not deep import from `@simon_he/vue-tui/dist/...`; only the entry points above are part of the supported package contract.
73
125
 
@@ -229,18 +281,23 @@ Unhandled promise rejections stay host-owned by default. Setting `cleanupOnUnhan
229
281
 
230
282
  ## Components
231
283
 
232
- | Area | Import | Components / APIs |
233
- | -------------- | -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
234
- | Stable layout | `@simon_he/vue-tui` | `TBox`, `TView` |
235
- | Stable text | `@simon_he/vue-tui` | `TText`, `TLink`, `TLinkifyText` |
236
- | Stable input | `@simon_he/vue-tui` | `TInput`, `TList`, `TSelect` |
237
- | Stable overlay | `@simon_he/vue-tui` | `TDialog` |
238
- | Vue extended | `@simon_he/vue-tui/vue` | `TAnchor`, `TFlow`, `TRenderPlane`, `TRenderLayer`, `TTransition`, `TInputBox`, `TPathPicker`, `TJsonEditor`, `TMultilineModal`, `TDebugOverlay`, composables, router APIs |
239
- | Markdown | `@simon_he/vue-tui/markdown` | `TMarkdownText`, `TVirtualMarkdown` |
240
- | Experimental | `@simon_he/vue-tui/experimental` | `TVirtualList`, `TTranscriptView`, `TLogView`, `TLogSearchBar`, `TLogLinksPanel`, `TLogScrollbar`, `TLogMinimap` |
241
- | Agent console | `@simon_he/vue-tui/agent` | `TAgentTranscript`, `TToolCallView`, `TToolLogView`, `TVirtualMarkdown`, `TVirtualList`, `TRenderPlane` |
242
- | Runtime | `@simon_he/vue-tui/runtime` | runtime, event, and selection APIs |
243
- | CLI | `@simon_he/vue-tui/cli` | `createTerminalApp`, `createStdoutRenderer`, `createStdinDriver`, Node host adapters |
284
+ | Area | Import | Components / APIs |
285
+ | -------------- | ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
286
+ | Stable layout | `@simon_he/vue-tui` | `TBox`, `TView` |
287
+ | Stable text | `@simon_he/vue-tui` | `TText`, `TLink`, `TLinkifyText` |
288
+ | Stable input | `@simon_he/vue-tui` | `TInput`, `TList`, `TSelect` |
289
+ | Stable overlay | `@simon_he/vue-tui` | `TDialog` |
290
+ | Vue extended | `@simon_he/vue-tui/vue` | `TAnchor`, `TFlex`, `TFlexItem`, `TFlow`, `TRenderPlane`, `TRenderLayer`, `TTransition`, `TInputBox`, `TPathPicker`, `TJsonEditor`, `TMultilineModal`, `TDebugOverlay`, composables, router APIs |
291
+ | Markdown | `@simon_he/vue-tui/markdown` | `TMarkdownText`, `TVirtualMarkdown` |
292
+ | Mermaid | `@simon_he/vue-tui/mermaid` | `beautifulMermaidRenderer`, `TMermaid`, `TMermaidText`, `TBeautifulMermaidText` |
293
+ | Experimental | `@simon_he/vue-tui/experimental` | `TVideo`, `TContributionGraph`, `TLineChart`, `TCandlestickChart`, `TPieChart`, `TVirtualList`, `TTranscriptView`, `TLogView`, `TLogSearchBar`, `TLogLinksPanel`, `TLogScrollbar`, `TLogMinimap` |
294
+ | Video adapter | `@simon_he/vue-tui/experimental/video/node` | `createFfmpegVideoFrameSource`, `createYtDlpVideoFrameSource` |
295
+ | Agent console | `@simon_he/vue-tui/agent` | `TAgentTranscript`, `TToolCallView`, `TToolLogView`, `TVirtualMarkdown`, `TVirtualList`, `TRenderPlane` |
296
+ | Agent Mermaid | `@simon_he/vue-tui/agent/mermaid` | `beautifulMermaidRenderer`, `TMermaid`, `TMermaidText`, `TBeautifulMermaidText` |
297
+ | Runtime | `@simon_he/vue-tui/runtime` | runtime, event, and selection APIs |
298
+ | CLI | `@simon_he/vue-tui/cli` | `createTerminalApp`, `createStdoutRenderer`, `createStdinDriver`, Node host adapters |
299
+
300
+ For streaming Mermaid source, pass `streaming` with `final`. When `streaming=true` and `final=false`, transient renderer errors do not replace the last successfully rendered diagram; if no diagram has rendered yet, `incompleteText` is shown until the source becomes renderable or `final=true` surfaces the final error.
244
301
 
245
302
  This table is a category overview. The generated API reference for root, `/vue`, and `/experimental` components lives in [docs/generated/components-api.md](./docs/generated/components-api.md) for humans and [docs/generated/api-manifest.json](./docs/generated/api-manifest.json) for CI, release checks, and README/docs drift checks; the manifest also tracks package entrypoint exports.
246
303
 
@@ -341,6 +398,7 @@ pnpm run release:dry-run
341
398
 
342
399
  - The published package ships `dist` only.
343
400
  - Root, core, runtime, DOM renderer, observability, Vue, CLI, markdown, experimental, and agent entrypoints are available as ESM, CJS, and type declarations after build.
401
+ - The Mermaid bridge entrypoints ship ESM, CJS, and type declarations.
344
402
  - The root browser/core API does not require a Node runtime, but CLI usage expects a Node-like stdout/stdin environment.
345
403
  - Terminal emoji and East Asian width behavior still depends on the user terminal and font.
346
404