@simon_he/vue-tui 0.0.8 → 1.0.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/README.md +142 -30
- package/dist/TSelect-BwJJbuTt.js +6089 -0
- package/dist/TTree-DK_DQBYm.js +6480 -0
- package/dist/agent.cjs +39416 -0
- package/dist/agent.d.cts +44 -0
- package/dist/agent.d.ts +44 -0
- package/dist/agent.js +828 -0
- package/dist/ansi-palette-CNXqFciC.js +57 -0
- package/dist/ansi-styles.d.ts +200 -0
- package/dist/block-source-CKUOnkgT.js +1663 -0
- package/dist/cli/headless-renderer.d.ts +29 -0
- package/dist/cli/input.d.ts +49 -0
- package/dist/cli/node-file-writers.d.ts +13 -0
- package/dist/cli/node-module.d.ts +2 -0
- package/dist/cli/parse-kitty.d.ts +2 -0
- package/dist/cli/parse-mouse.d.ts +2 -0
- package/dist/cli/parse-utils.d.ts +14 -0
- package/dist/cli/parse-xterm.d.ts +2 -0
- package/dist/cli/path-provider-types.d.ts +1 -0
- package/dist/cli/path-provider.d.ts +4 -0
- package/dist/cli/path-suggest-core.d.ts +1 -0
- package/dist/cli/path-suggest.d.ts +15 -0
- package/dist/cli/recording.d.ts +4 -0
- package/dist/cli/stdin-buffer.d.ts +33 -0
- package/dist/cli.cjs +11061 -0
- package/dist/cli.d.cts +23 -0
- package/dist/cli.d.ts +23 -0
- package/dist/cli.js +9875 -0
- package/dist/core/ansi/capability.d.ts +20 -0
- package/dist/core/ansi/colors.d.ts +41 -0
- package/dist/core/ansi/sgr.d.ts +7 -0
- package/dist/core/ansi/theme.d.ts +6 -0
- package/dist/core/ansi-palette.d.ts +14 -0
- package/dist/core/buffer/buffer.d.ts +54 -0
- package/dist/core/buffer/width.d.ts +4 -0
- package/dist/core/debug-logger.d.ts +18 -0
- package/dist/core/hyperlink.d.ts +9 -0
- package/dist/core/index.d.ts +4 -0
- package/dist/core/path-provider-types.d.ts +24 -0
- package/dist/core/path-suggest.d.ts +35 -0
- package/dist/core/render-plane.d.ts +3 -0
- package/dist/core/terminal/create-terminal.d.ts +8 -0
- package/dist/core/terminal/emitter.d.ts +7 -0
- package/dist/core/types.d.ts +107 -0
- package/dist/core.cjs +3153 -0
- package/dist/core.d.cts +14 -0
- package/dist/core.d.ts +14 -0
- package/dist/core.js +424 -0
- package/dist/create-terminal-C2oiWFJU.js +1434 -0
- package/dist/create-terminal-app.d.ts +36 -0
- package/dist/dom-renderer-BqGijQID.js +1173 -0
- package/dist/env-Cl8qmNFN.js +19 -0
- package/dist/events/index.d.ts +6 -0
- package/dist/events/manager/cli-event-manager.d.ts +22 -0
- package/dist/events/manager/event-manager.d.ts +30 -0
- package/dist/events/manager/selection-suppression.d.ts +3 -0
- package/dist/events/manager/types.d.ts +108 -0
- package/dist/events/recording.d.ts +44 -0
- package/dist/experimental.cjs +4412 -1641
- package/dist/experimental.d.cts +42 -0
- package/dist/experimental.d.ts +42 -825
- package/dist/experimental.js +31 -7392
- package/dist/frame-perf-C6Xfg85O.js +24 -0
- package/dist/hyperlink-Bn02UXJb.js +419 -0
- package/dist/index.cjs +14765 -17582
- package/dist/index.d.cts +35 -0
- package/dist/index.d.ts +35 -1528
- package/dist/index.js +17 -20026
- package/dist/linkify-D_gzn9Xq.js +562 -0
- package/dist/markdown.cjs +9321 -7623
- package/dist/markdown.d.cts +11 -0
- package/dist/markdown.d.ts +11 -112
- package/dist/markdown.js +36 -1427
- package/dist/observability/cli-latency-node.d.ts +3 -0
- package/dist/observability/cli-latency-types.d.ts +41 -0
- package/dist/observability/cli-latency.d.ts +3 -0
- package/dist/observability/frame-perf-store.d.ts +18 -0
- package/dist/observability/frame-perf.d.ts +40 -0
- package/dist/observability/perf-sink.d.ts +56 -0
- package/dist/observability/trace.d.ts +40 -0
- package/dist/observability/tui-profiler.d.ts +33 -0
- package/dist/observability.cjs +221 -0
- package/dist/observability.d.cts +8 -0
- package/dist/observability.d.ts +8 -0
- package/dist/observability.js +4 -0
- package/dist/path-mnSgEpCm.js +81 -0
- package/dist/path-suggest-BNqcuE3-.js +274 -0
- package/dist/path-suggest-Dk9TRLh5.js +3 -0
- package/dist/{path-suggest-DmrmeueH.js → path-suggest-bvR9SY6Q.js} +86 -18
- package/dist/renderer/capabilities.d.ts +13 -0
- package/dist/renderer/cli/index.d.ts +2 -0
- package/dist/renderer/cli/stdout-metrics.d.ts +18 -0
- package/dist/renderer/cli/stdout-renderer.d.ts +48 -0
- package/dist/renderer/dom/dom-renderer.d.ts +157 -0
- package/dist/renderer/dom/index.d.ts +2 -0
- package/dist/renderer/index.d.ts +2 -0
- package/dist/renderer-dom.cjs +1505 -0
- package/dist/renderer-dom.d.cts +4 -0
- package/dist/renderer-dom.d.ts +4 -0
- package/dist/renderer-dom.js +7 -0
- package/dist/runtime/index.d.ts +36 -0
- package/dist/runtime/osc52.d.ts +9 -0
- package/dist/runtime-rfcZCyJq.js +1197 -0
- package/dist/runtime.cjs +1698 -0
- package/dist/runtime.d.cts +9 -0
- package/dist/runtime.d.ts +9 -0
- package/dist/runtime.js +4 -0
- package/dist/selection/terminal-selection.d.ts +123 -0
- package/dist/sgr-BmzxEjAO.js +304 -0
- package/dist/terminal-selection-DBinO6p5.js +330 -0
- package/dist/tlog-theme-qPBt5rge.js +9254 -0
- package/dist/trace-CjzYeIxN.js +182 -0
- package/dist/utils/env.d.ts +3 -0
- package/dist/utils/grapheme.d.ts +5 -0
- package/dist/utils/newlines.d.ts +1 -0
- package/dist/utils/path.d.ts +7 -0
- package/dist/utils/url-safety.d.ts +2 -0
- package/dist/vue/agent/view-models.d.ts +98 -0
- package/dist/vue/components/TAnchor.d.ts +108 -0
- package/dist/vue/components/TBox.d.ts +144 -0
- package/dist/vue/components/TCommandPalette.d.ts +587 -0
- package/dist/vue/components/TDataTable.d.ts +367 -0
- package/dist/vue/components/TDebugOverlay.d.ts +43 -0
- package/dist/vue/components/TDialog.d.ts +255 -0
- package/dist/vue/components/TFeedback.d.ts +635 -0
- package/dist/vue/components/TFlow.d.ts +85 -0
- package/dist/vue/components/TForm.d.ts +1230 -0
- package/dist/vue/components/TInput.d.ts +545 -0
- package/dist/vue/components/TInputBox.d.ts +158 -0
- package/dist/vue/components/TJsonEditor.d.ts +165 -0
- package/dist/vue/components/TLink.d.ts +239 -0
- package/dist/vue/components/TLinkifyText.d.ts +141 -0
- package/dist/vue/components/TList.d.ts +119 -0
- package/dist/vue/components/TLogLinksPanel.d.ts +238 -0
- package/dist/vue/components/TLogMinimap.d.ts +263 -0
- package/dist/vue/components/TLogScrollbar.d.ts +236 -0
- package/dist/vue/components/TLogSearchBar.d.ts +267 -0
- package/dist/vue/components/TLogSearchPager.d.ts +162 -0
- package/dist/vue/components/TLogSearchResults.d.ts +200 -0
- package/dist/vue/components/TLogView.d.ts +536 -0
- package/dist/vue/components/TLogVirtualLinksPanel.d.ts +141 -0
- package/dist/vue/components/TLogVirtualSearchResults.d.ts +146 -0
- package/dist/vue/components/TMarkdownText.d.ts +134 -0
- package/dist/vue/components/TMultilineModal.d.ts +62 -0
- package/dist/vue/components/TNavigation.d.ts +324 -0
- package/dist/vue/components/TOverlay.d.ts +366 -0
- package/dist/vue/components/TPanels.d.ts +244 -0
- package/dist/vue/components/TPathPicker.d.ts +213 -0
- package/dist/vue/components/TRenderLayer.d.ts +16 -0
- package/dist/vue/components/TRenderPlane.d.ts +17 -0
- package/dist/vue/components/TSelect.d.ts +335 -0
- package/dist/vue/components/TTable.d.ts +317 -0
- package/dist/vue/components/TText.d.ts +116 -0
- package/dist/vue/components/TThinkingView.d.ts +233 -0
- package/dist/vue/components/TToolCallView.d.ts +384 -0
- package/dist/vue/components/TTranscriptView.d.ts +221 -0
- package/dist/vue/components/TTransition.d.ts +83 -0
- package/dist/vue/components/TTree.d.ts +200 -0
- package/dist/vue/components/TUserMessageView.d.ts +344 -0
- package/dist/vue/components/TView.d.ts +127 -0
- package/dist/vue/components/TVirtualList.d.ts +182 -0
- package/dist/vue/components/TVirtualMarkdown.d.ts +168 -0
- package/dist/vue/components/TVirtualRows.d.ts +247 -0
- package/dist/vue/components/TerminalProvider.d.ts +218 -0
- package/dist/vue/components/input/host.d.ts +17 -0
- package/dist/vue/components/input/plugins/hostPlugin.d.ts +7 -0
- package/dist/vue/components/input/plugins/hostPlugin.node.d.ts +15 -0
- package/dist/vue/components/input/plugins/mentionUtils.d.ts +17 -0
- package/dist/vue/components/input/plugins/nodeMentionPathProvider.d.ts +2 -0
- package/dist/vue/components/input/plugins/promptMentionPlugin.d.ts +8 -0
- package/dist/vue/components/input/plugins/promptMentionState.d.ts +98 -0
- package/dist/vue/components/input/plugins/restrictText.d.ts +27 -0
- package/dist/vue/components/input/plugins/types.d.ts +90 -0
- package/dist/vue/components/input/utils/inlineText.d.ts +57 -0
- package/dist/vue/components/input/utils/inlineTextTokens.d.ts +34 -0
- package/dist/vue/components/input/utils/primitives.d.ts +3 -0
- package/dist/vue/components/input/utils/wordNavigation.d.ts +6 -0
- package/dist/vue/components/link/host.d.ts +15 -0
- package/dist/vue/components/list/list-geometry.d.ts +16 -0
- package/dist/vue/components/list/list-paint.d.ts +1 -0
- package/dist/vue/components/list/scroll-state.d.ts +25 -0
- package/dist/vue/components/list/selection-state.d.ts +6 -0
- package/dist/vue/components/simple-utils.d.ts +5 -0
- package/dist/vue/components/terminal-provider/copy-toast.d.ts +6 -0
- package/dist/vue/components/terminal-provider/portals.d.ts +17 -0
- package/dist/vue/components/terminal-provider/scheduler.d.ts +29 -0
- package/dist/vue/components/terminal-provider/selection-config.d.ts +15 -0
- package/dist/vue/components/terminal-provider/utils.d.ts +5 -0
- package/dist/vue/composables/use-layout.d.ts +2 -0
- package/dist/vue/composables/use-render-node.d.ts +19 -0
- package/dist/vue/composables/use-render-stack.d.ts +3 -0
- package/dist/vue/composables/use-runtime.d.ts +5 -0
- package/dist/vue/composables/use-terminal-node.d.ts +14 -0
- package/dist/vue/composables/use-terminal.d.ts +2 -0
- package/dist/vue/composables/use-visibility.d.ts +12 -0
- package/dist/vue/context.d.ts +153 -0
- package/dist/vue/index.d.ts +69 -0
- package/dist/vue/injection-key.d.ts +2 -0
- package/dist/vue/linkify.d.ts +11 -0
- package/dist/vue/log/append-only-log-store.d.ts +2 -0
- package/dist/vue/log/tlog-keymap.d.ts +28 -0
- package/dist/vue/log/tlog-plugins.d.ts +144 -0
- package/dist/vue/log/tlog-session.d.ts +81 -0
- package/dist/vue/log/tlog-theme.d.ts +68 -0
- package/dist/vue/log/types.d.ts +43 -0
- package/dist/vue/log/use-tlog-link-controller.d.ts +31 -0
- package/dist/vue/log/use-tlog-retained-index.d.ts +26 -0
- package/dist/vue/log/use-tlog-search-controller.d.ts +51 -0
- package/dist/vue/log/use-tlog-search-results-page.d.ts +31 -0
- package/dist/vue/log/use-tlog-virtual-search-results.d.ts +22 -0
- package/dist/vue/markdown/ast.d.ts +3 -0
- package/dist/vue/markdown/block-source.d.ts +22 -0
- package/dist/vue/markdown/document.d.ts +20 -0
- package/dist/vue/markdown/layout.d.ts +21 -0
- package/dist/vue/markdown/parser.d.ts +11 -0
- package/dist/vue/markdown/render.d.ts +10 -0
- package/dist/vue/markdown/theme.d.ts +186 -0
- package/dist/vue/markdown/types.d.ts +59 -0
- package/dist/vue/overlay.d.ts +27 -0
- package/dist/vue/render/context.d.ts +3 -0
- package/dist/vue/render/render-manager.d.ts +94 -0
- package/dist/vue/router/RouterView.d.ts +25 -0
- package/dist/vue/router/composables.d.ts +4 -0
- package/dist/vue/router/context.d.ts +4 -0
- package/dist/vue/router/router.d.ts +7 -0
- package/dist/vue/router/types.d.ts +29 -0
- package/dist/vue/scheduler/frame-mailbox.d.ts +55 -0
- package/dist/vue/scheduler/frame-scheduler.d.ts +51 -0
- package/dist/vue/theme.d.ts +48 -0
- package/dist/vue/transcript/hit-regions.d.ts +2 -0
- package/dist/vue/transcript/layout.d.ts +20 -0
- package/dist/vue/transcript/plain-text.d.ts +2 -0
- package/dist/vue/transcript/types.d.ts +122 -0
- package/dist/vue/utils/frame-task.d.ts +6 -0
- package/dist/vue/utils/rect.d.ts +4 -0
- package/dist/vue/utils/row-scroll.d.ts +25 -0
- package/dist/vue/utils/style-cache.d.ts +3 -0
- package/dist/vue/utils/text.d.ts +27 -0
- package/dist/vue/utils/wheel-scroll.d.ts +18 -0
- package/dist/vue.cjs +23668 -0
- package/dist/vue.d.cts +1 -0
- package/dist/vue.d.ts +1 -0
- package/dist/vue.js +3957 -0
- package/dist/{wheel-scroll-CiNsasLf.js → wheel-scroll-vBRaQ7p-.js} +404 -405
- package/package.json +185 -35
- package/dist/path-suggest-BeV6n7m-.js +0 -3
- package/dist/sgr-Tko2EQ0U.js +0 -484
- package/dist/theme-Bsm65g8k.d.ts +0 -32
- package/dist/types-ClIV2h1o.d.ts +0 -103
package/README.md
CHANGED
|
@@ -12,27 +12,96 @@ Use it when you want:
|
|
|
12
12
|
## Install
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
|
-
pnpm add @simon_he/vue-tui vue
|
|
15
|
+
pnpm add @simon_he/vue-tui@rc vue
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
Vue is a peer dependency. The current package supports Vue `>=3.3.0 <4`.
|
|
19
19
|
|
|
20
|
+
## Runtime Support
|
|
21
|
+
|
|
22
|
+
The published package supports Node.js `>=16.17` for CLI/runtime consumers.
|
|
23
|
+
|
|
24
|
+
Development, release validation, and documentation builds are run on Node.js 20 in CI because the repository toolchain uses modern build/test tooling.
|
|
25
|
+
|
|
20
26
|
## Entry Points
|
|
21
27
|
|
|
22
|
-
| Import
|
|
23
|
-
|
|
|
24
|
-
| `@simon_he/vue-tui`
|
|
25
|
-
| `@simon_he/vue-tui/
|
|
26
|
-
| `@simon_he/vue-tui/
|
|
28
|
+
| Import | Stability | Use it for |
|
|
29
|
+
| --------------------------------- | ------------ | --------------------------------------------------------------------------------------------------------------------------- |
|
|
30
|
+
| `@simon_he/vue-tui` | Public | Browser-safe terminal core, DOM renderer, stable Vue components, and input host plugin factory |
|
|
31
|
+
| `@simon_he/vue-tui/core` | Public | Terminal core, buffer-facing types, ANSI/theme/path/hyperlink helpers |
|
|
32
|
+
| `@simon_he/vue-tui/renderer/dom` | Public | DOM renderer factory and renderer capabilities |
|
|
33
|
+
| `@simon_he/vue-tui/vue` | Advanced | Extended Vue components, composables, router helpers, and Vue runtime internals |
|
|
34
|
+
| `@simon_he/vue-tui/runtime` | Advanced | Runtime wiring, selection helpers, and clipboard abstraction |
|
|
35
|
+
| `@simon_he/vue-tui/observability` | Advanced | Frame perf store, profiler hooks, and trace helpers |
|
|
36
|
+
| `@simon_he/vue-tui/cli` | Public | Node-only headless Vue app runtime, stdin driver, stdout renderer, path provider, recording, and terminal clipboard helpers |
|
|
37
|
+
| `@simon_he/vue-tui/markdown` | Public | `TMarkdownText`, `TVirtualMarkdown`, markdown parser and layout helpers, streaming markdown block sources |
|
|
38
|
+
| `@simon_he/vue-tui/experimental` | Experimental | `TVirtualList`, `TTranscriptView`, `TLogView`, TLog search/link/minimap companions, append-only log store, and TLog plugins |
|
|
39
|
+
| `@simon_he/vue-tui/agent` | Experimental | Agent/console transcript, tool-call header, log, markdown, virtual list, render plane, and overlay component aggregation |
|
|
40
|
+
|
|
41
|
+
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.
|
|
42
|
+
|
|
43
|
+
Do not deep import from `@simon_he/vue-tui/dist/...`; only the entry points above are part of the supported package contract.
|
|
44
|
+
|
|
45
|
+
### Migration: Node Host Adapter Moved To `/cli`
|
|
46
|
+
|
|
47
|
+
Node-specific input host defaults are no longer exported from the browser-safe root entrypoint.
|
|
48
|
+
|
|
49
|
+
Before:
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
import { createDefaultTInputHostAdapter, defaultTInputHostPlugin } from "@simon_he/vue-tui";
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
After:
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
import { createTInputHostPlugin } from "@simon_he/vue-tui";
|
|
59
|
+
import { createDefaultTInputHostAdapter, defaultTInputHostPlugin } from "@simon_he/vue-tui/cli";
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Migration: Root Entry Was Narrowed
|
|
63
|
+
|
|
64
|
+
The root entrypoint now keeps only stable browser-safe APIs. Extended Vue components and Vue router/composable helpers move to `@simon_he/vue-tui/vue`.
|
|
65
|
+
|
|
66
|
+
| Before root import | New import |
|
|
67
|
+
| ------------------ | ----------------------- |
|
|
68
|
+
| `TAnchor` | `@simon_he/vue-tui/vue` |
|
|
69
|
+
| `TFlow` | `@simon_he/vue-tui/vue` |
|
|
70
|
+
| `TInputBox` | `@simon_he/vue-tui/vue` |
|
|
71
|
+
| `TPathPicker` | `@simon_he/vue-tui/vue` |
|
|
72
|
+
| `TJsonEditor` | `@simon_he/vue-tui/vue` |
|
|
73
|
+
| `TRenderPlane` | `@simon_he/vue-tui/vue` |
|
|
74
|
+
| `TRenderLayer` | `@simon_he/vue-tui/vue` |
|
|
75
|
+
| `TTransition` | `@simon_he/vue-tui/vue` |
|
|
76
|
+
| router/composables | `@simon_he/vue-tui/vue` |
|
|
77
|
+
| Node host defaults | `@simon_he/vue-tui/cli` |
|
|
27
78
|
|
|
28
|
-
|
|
79
|
+
Before:
|
|
80
|
+
|
|
81
|
+
```ts
|
|
82
|
+
import { TAnchor, TFlow } from "@simon_he/vue-tui";
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
After:
|
|
86
|
+
|
|
87
|
+
```ts
|
|
88
|
+
import { TAnchor, TFlow } from "@simon_he/vue-tui/vue";
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Hyperlinks
|
|
92
|
+
|
|
93
|
+
DOM renderer link rendering is opt-in through `domRendererOptions.links`. Once enabled, DOM anchors allow safe absolute and relative targets such as `https:`, `http:`, `mailto:`, `/path`, `./path`, `../path`, `#hash`, and `?q=1`. Link callbacks preserve native browser behavior unless they return `false`.
|
|
94
|
+
|
|
95
|
+
CLI/stdout rendering uses OSC8 hyperlinks and keeps a stricter boundary: only safe absolute `https:`, `http:`, and `mailto:` hrefs are emitted by default. `file:` links stay opt-in for terminal-specific providers and lower-level `Style.href` writers.
|
|
96
|
+
|
|
97
|
+
`TLink` is the public component-level link primitive. It renders DOM-safe `Style.href` metadata for absolute `https:` / `http:` / `mailto:` and relative targets, supports focus, click, keyboard activation, and host-controlled attempted opens through `TerminalProvider.linkOpener` or `createTerminalApp({ linkOpener })`. `TLinkifyText` detects safe URLs in plain text and writes the same href metadata without owning activation. Browser `TerminalProvider` defaults to `window.open`; CLI/headless apps must opt in. `TLink` intentionally rejects `file:` URLs; use lower-level `Style.href` writers plus terminal-specific opt-in when exposing file links.
|
|
29
98
|
|
|
30
99
|
## Browser Usage
|
|
31
100
|
|
|
32
101
|
```vue
|
|
33
102
|
<script setup lang="ts">
|
|
34
103
|
import { ref } from "vue";
|
|
35
|
-
import { TerminalProvider, TBox, TInput, TText } from "@simon_he/vue-tui";
|
|
104
|
+
import { TerminalProvider, TBox, TInput, TLink, TLinkifyText, TText } from "@simon_he/vue-tui";
|
|
36
105
|
|
|
37
106
|
const input = ref("");
|
|
38
107
|
</script>
|
|
@@ -41,6 +110,8 @@ const input = ref("");
|
|
|
41
110
|
<TerminalProvider :cols="80" :rows="24" :default-style="{ fg: 'whiteBright' }">
|
|
42
111
|
<TBox :x="0" :y="0" :w="80" :h="24" border title="Demo" :padding="1">
|
|
43
112
|
<TText :x="0" :y="0" :w="78" value="Vue TUI is running" />
|
|
113
|
+
<TLink :x="0" :y="2" href="https://github.com/Simon-He95/vue-tui" label="Project link" />
|
|
114
|
+
<TLinkifyText :x="0" :y="3" :w="78" value="Docs: https://github.com/Simon-He95/vue-tui" />
|
|
44
115
|
<TInput :x="0" :y="20" :w="78" v-model="input" placeholder="Type..." />
|
|
45
116
|
</TBox>
|
|
46
117
|
</TerminalProvider>
|
|
@@ -54,7 +125,13 @@ const input = ref("");
|
|
|
54
125
|
For a real terminal, mount a headless Vue app and attach stdout/stdin:
|
|
55
126
|
|
|
56
127
|
```ts
|
|
57
|
-
import {
|
|
128
|
+
import {
|
|
129
|
+
createStdinDriver,
|
|
130
|
+
createStdoutRenderer,
|
|
131
|
+
createTerminalApp,
|
|
132
|
+
installTerminalCleanup,
|
|
133
|
+
type TerminalCleanupHandle,
|
|
134
|
+
} from "@simon_he/vue-tui/cli";
|
|
58
135
|
import App from "./App.vue";
|
|
59
136
|
|
|
60
137
|
const app = createTerminalApp({
|
|
@@ -70,47 +147,73 @@ const renderer = createStdoutRenderer(app.terminal, {
|
|
|
70
147
|
output: process.stdout,
|
|
71
148
|
hideCursor: true,
|
|
72
149
|
colorMode: "auto",
|
|
150
|
+
allowFileUrls: true,
|
|
73
151
|
});
|
|
74
152
|
|
|
75
153
|
app.scheduler.flush();
|
|
76
154
|
|
|
77
|
-
|
|
155
|
+
let driver: ReturnType<typeof createStdinDriver> | null = null;
|
|
156
|
+
let terminalCleanup: TerminalCleanupHandle | null = null;
|
|
157
|
+
let disposed = false;
|
|
158
|
+
|
|
159
|
+
const cleanup = () => {
|
|
160
|
+
if (disposed) return;
|
|
161
|
+
disposed = true;
|
|
162
|
+
terminalCleanup?.uninstall();
|
|
163
|
+
driver?.dispose();
|
|
164
|
+
renderer.dispose();
|
|
165
|
+
app.dispose();
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
const exit = () => {
|
|
169
|
+
cleanup();
|
|
170
|
+
process.exit(0);
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
terminalCleanup = installTerminalCleanup(cleanup, {
|
|
174
|
+
signalPolicy: "reraise",
|
|
175
|
+
cleanupOnUnhandledRejection: false,
|
|
176
|
+
});
|
|
177
|
+
driver = createStdinDriver({
|
|
78
178
|
dispatch(event) {
|
|
79
179
|
const prevented = app.events.dispatch(event);
|
|
80
180
|
app.scheduler.flush();
|
|
81
181
|
return prevented;
|
|
82
182
|
},
|
|
83
183
|
enableMouse: true,
|
|
84
|
-
onExit
|
|
85
|
-
driver.dispose();
|
|
86
|
-
renderer.dispose();
|
|
87
|
-
app.dispose();
|
|
88
|
-
process.exit(0);
|
|
89
|
-
},
|
|
184
|
+
onExit: exit,
|
|
90
185
|
});
|
|
91
186
|
```
|
|
92
187
|
|
|
188
|
+
Signal cleanup restores terminal state first. `installTerminalCleanup()` returns a cleanup handle: call `handle.uninstall()` to remove process listeners without disposing the app, or `handle.cleanup()` to run cleanup manually. By default, signal handling uses `signalPolicy: "reraise"`: the helper cleans up, removes its own listeners, and re-sends the original signal when no other listener owns that signal. If the host process has other listeners for the same signal, those listeners keep ownership of termination. Set `signalPolicy: "cleanup-only"` only when the host explicitly owns termination, or `signalPolicy: "exit"` when vue-tui should exit with the conventional signal exit code after cleanup.
|
|
189
|
+
|
|
190
|
+
Unhandled promise rejections stay host-owned by default. Setting `cleanupOnUnhandledRejection: true` cleans up and rethrows by default. Set `rethrowUnhandledRejection: false` only when the host explicitly wants to suppress the rejection.
|
|
191
|
+
|
|
93
192
|
## Core Concepts
|
|
94
193
|
|
|
95
194
|
- `createTerminal({ cols, rows })` owns the cell buffer, cursor, planes, scrollback, and commit events.
|
|
96
195
|
- `createDomRenderer(terminal, container)` renders terminal cells to DOM with row caching and fast paths for plain and styled rows.
|
|
97
|
-
- `createStdoutRenderer(terminal, options)` emits ANSI output for real terminal UIs
|
|
196
|
+
- `createStdoutRenderer(terminal, options)` emits ANSI output for real terminal UIs from `/cli`.
|
|
98
197
|
- `TerminalProvider` is the browser-facing Vue runtime provider.
|
|
99
198
|
- `createTerminalApp()` is the headless runtime for CLI apps and deterministic tests.
|
|
100
199
|
- `TRenderPlane` separates transcript, chrome, input, and overlay surfaces so small updates do not repaint large panes.
|
|
101
200
|
|
|
102
201
|
## Components
|
|
103
202
|
|
|
104
|
-
| Area
|
|
105
|
-
|
|
|
106
|
-
|
|
|
107
|
-
|
|
|
108
|
-
|
|
|
109
|
-
|
|
|
110
|
-
|
|
|
111
|
-
|
|
|
112
|
-
|
|
113
|
-
|
|
203
|
+
| Area | Import | Components / APIs |
|
|
204
|
+
| -------------- | -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
205
|
+
| Stable layout | `@simon_he/vue-tui` | `TBox`, `TView` |
|
|
206
|
+
| Stable text | `@simon_he/vue-tui` | `TText`, `TLink`, `TLinkifyText` |
|
|
207
|
+
| Stable input | `@simon_he/vue-tui` | `TInput`, `TList`, `TSelect` |
|
|
208
|
+
| Stable overlay | `@simon_he/vue-tui` | `TDialog` |
|
|
209
|
+
| Vue extended | `@simon_he/vue-tui/vue` | `TAnchor`, `TFlow`, `TRenderPlane`, `TRenderLayer`, `TTransition`, `TInputBox`, `TPathPicker`, `TJsonEditor`, `TMultilineModal`, `TDebugOverlay`, composables, router APIs |
|
|
210
|
+
| Markdown | `@simon_he/vue-tui/markdown` | `TMarkdownText`, `TVirtualMarkdown` |
|
|
211
|
+
| Experimental | `@simon_he/vue-tui/experimental` | `TVirtualList`, `TTranscriptView`, `TLogView`, `TLogSearchBar`, `TLogLinksPanel`, `TLogScrollbar`, `TLogMinimap` |
|
|
212
|
+
| Agent console | `@simon_he/vue-tui/agent` | `TAgentTranscript`, `TToolCallView`, `TToolLogView`, `TVirtualMarkdown`, `TVirtualList`, `TRenderPlane` |
|
|
213
|
+
| Runtime | `@simon_he/vue-tui/runtime` | runtime, event, and selection APIs |
|
|
214
|
+
| CLI | `@simon_he/vue-tui/cli` | `createTerminalApp`, `createStdoutRenderer`, `createStdinDriver`, Node host adapters |
|
|
215
|
+
|
|
216
|
+
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.
|
|
114
217
|
|
|
115
218
|
## Documentation
|
|
116
219
|
|
|
@@ -120,9 +223,13 @@ See [docs/components.md](./docs/components.md) and [docs/generated/components-ap
|
|
|
120
223
|
| [Examples index](./docs/examples.md) | Browser, terminal, and smoke example commands |
|
|
121
224
|
| [Core API](./docs/api.md) | Terminal, renderer, events, runtime, planes, and scheduler contracts |
|
|
122
225
|
| [Performance](./docs/performance.md) | Practical performance guidance |
|
|
226
|
+
| [Benchmarks](./docs/benchmarks.md) | Release benchmark budgets, sample results, and comparison boundaries |
|
|
227
|
+
| [OpenTUI Solid comparison](./docs/compare-opentui-solid.md) | Same-scenario comparison protocol and public claim boundaries |
|
|
123
228
|
| [High-throughput rendering](./docs/high-throughput-rendering.md) | Scheduler, dirty rows, mailbox, log, and renderer architecture |
|
|
229
|
+
| [Component acceptance](./docs/components-acceptance.md) | Release readiness checks for component API and behavior |
|
|
124
230
|
| [Agent Console](./docs/agent-console.md) | Streaming transcript example stack |
|
|
125
|
-
| [Release candidate](./docs/release-candidate.md) | 0
|
|
231
|
+
| [Release candidate](./docs/release-candidate.md) | 1.0 RC validation, package export checks, and migration notes |
|
|
232
|
+
| [Security policy](./SECURITY.md) | Vulnerability reporting and terminal permission boundaries |
|
|
126
233
|
|
|
127
234
|
Run the docs locally:
|
|
128
235
|
|
|
@@ -138,6 +245,7 @@ pnpm -C examples/basic dev
|
|
|
138
245
|
pnpm run build:examples
|
|
139
246
|
pnpm run build:examples:terminal
|
|
140
247
|
pnpm run run:basic:terminal
|
|
248
|
+
pnpm run run:agent-console:terminal
|
|
141
249
|
pnpm run example:tlog-view-lab
|
|
142
250
|
pnpm run example:agent-console
|
|
143
251
|
pnpm run example:agent-console:smoke
|
|
@@ -152,7 +260,7 @@ The smoke commands are deterministic and avoid real LLM APIs, real TTY dependenc
|
|
|
152
260
|
- Use `TLogView` with `createAppendOnlyLogStore({ maxLines })` for retained streaming logs.
|
|
153
261
|
- Provide stable line keys for custom `TLogView` sources; mutable rows should change keys or call the explicit invalidation APIs.
|
|
154
262
|
- Split high-volume content and frequently changing chrome into different `TRenderPlane`s.
|
|
155
|
-
- Reuse style objects on hot paths
|
|
263
|
+
- Style objects are treated as immutable. Reuse stable style objects on hot paths, but pass a new object when a style changes.
|
|
156
264
|
|
|
157
265
|
Useful checks:
|
|
158
266
|
|
|
@@ -167,12 +275,15 @@ pnpm run bench:phase2
|
|
|
167
275
|
- Report bugs: [new bug report](https://github.com/Simon-He95/vue-tui/issues/new?template=bug_report.yml)
|
|
168
276
|
- Request features: [new feature request](https://github.com/Simon-He95/vue-tui/issues/new?template=feature_request.yml)
|
|
169
277
|
- Report documentation issues: [new docs issue](https://github.com/Simon-He95/vue-tui/issues/new?template=docs.yml)
|
|
278
|
+
- Report vulnerabilities privately: [Security policy](./SECURITY.md)
|
|
170
279
|
- Browse existing issues: [GitHub issues](https://github.com/Simon-He95/vue-tui/issues)
|
|
171
280
|
|
|
172
281
|
For renderer, scheduler, or terminal behavior bugs, include the renderer target (`DOM`, `stdout`, or headless), the relevant command, and a minimal reproduction when possible.
|
|
173
282
|
|
|
174
283
|
## Development
|
|
175
284
|
|
|
285
|
+
Use Node.js 20 for repository development, release validation, and documentation builds. This is a toolchain requirement, not the runtime requirement for the published package.
|
|
286
|
+
|
|
176
287
|
```bash
|
|
177
288
|
pnpm install
|
|
178
289
|
pnpm run format:check
|
|
@@ -189,11 +300,12 @@ pnpm run release:dry-run
|
|
|
189
300
|
```
|
|
190
301
|
|
|
191
302
|
`release:dry-run` runs checks, tests, docs build, benchmarks, examples smoke, and packed package install smoke.
|
|
303
|
+
`release:ci` aliases `release:dry-run` for validation-only CI usage. The GitHub Release workflow is preferred because it publishes the already-verified tarball with npm provenance. If workflow token/provenance is unavailable, `release:local:dry-run` and `release:local` publish the locally verified tarball with the `rc` dist-tag. `release` and `release:workflow-only` intentionally fail to avoid accidental direct publishing.
|
|
192
304
|
|
|
193
305
|
## Package Notes
|
|
194
306
|
|
|
195
307
|
- The published package ships `dist` only.
|
|
196
|
-
- Root, markdown, and
|
|
308
|
+
- Root, core, runtime, DOM renderer, observability, Vue, CLI, markdown, experimental, and agent entrypoints are available as ESM, CJS, and type declarations after build.
|
|
197
309
|
- The root browser/core API does not require a Node runtime, but CLI usage expects a Node-like stdout/stdin environment.
|
|
198
310
|
- Terminal emoji and East Asian width behavior still depends on the user terminal and font.
|
|
199
311
|
|