@wayofmono/wo-tui 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 +18 -0
- package/dist/index.js +32 -0
- package/package.json +38 -0
- package/src/autocomplete.ts +783 -0
- package/src/components/box.ts +137 -0
- package/src/components/cancellable-loader.ts +40 -0
- package/src/components/editor.ts +2292 -0
- package/src/components/image.ts +121 -0
- package/src/components/input.ts +503 -0
- package/src/components/loader.ts +86 -0
- package/src/components/markdown.ts +797 -0
- package/src/components/select-list.ts +229 -0
- package/src/components/settings-list.ts +250 -0
- package/src/components/spacer.ts +28 -0
- package/src/components/text.ts +106 -0
- package/src/components/truncated-text.ts +65 -0
- package/src/editor-component.ts +74 -0
- package/src/fuzzy.ts +137 -0
- package/src/index.ts +106 -0
- package/src/keybindings.ts +244 -0
- package/src/keys.ts +1400 -0
- package/src/kill-ring.ts +46 -0
- package/src/stdin-buffer.ts +411 -0
- package/src/terminal-image.ts +423 -0
- package/src/terminal.ts +395 -0
- package/src/tui.ts +1319 -0
- package/src/undo-stack.ts +28 -0
- package/src/utils.ts +1140 -0
package/README.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# @wayofmono/wo-tui
|
|
2
|
+
|
|
3
|
+
A library of Terminal UI components and utilities for building interactive CLI applications.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @wayofmono/wo-tui
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
- **Component System**: Rich set of TUI components including selectors, inputs, and progress bars.
|
|
14
|
+
- **Terminal Management**: Handles terminal resizing, cursor control, and input events.
|
|
15
|
+
- **Theming**: Support for customizable themes and highlighting.
|
|
16
|
+
- **Accessibility**: Focus management and keyboard navigation built-in.
|
|
17
|
+
|
|
18
|
+
Used internally by the Way of Mono agent ecosystem to provide a polished interactive experience.
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Core TUI interfaces and classes
|
|
2
|
+
// Autocomplete support
|
|
3
|
+
export { CombinedAutocompleteProvider, } from "./autocomplete.js";
|
|
4
|
+
// Components
|
|
5
|
+
export { Box } from "./components/box.js";
|
|
6
|
+
export { CancellableLoader } from "./components/cancellable-loader.js";
|
|
7
|
+
export { Editor } from "./components/editor.js";
|
|
8
|
+
export { Image } from "./components/image.js";
|
|
9
|
+
export { Input } from "./components/input.js";
|
|
10
|
+
export { Loader } from "./components/loader.js";
|
|
11
|
+
export { Markdown } from "./components/markdown.js";
|
|
12
|
+
export { SelectList, } from "./components/select-list.js";
|
|
13
|
+
export { SettingsList } from "./components/settings-list.js";
|
|
14
|
+
export { Spacer } from "./components/spacer.js";
|
|
15
|
+
export { Text } from "./components/text.js";
|
|
16
|
+
export { TruncatedText } from "./components/truncated-text.js";
|
|
17
|
+
// Fuzzy matching
|
|
18
|
+
export { fuzzyFilter, fuzzyMatch } from "./fuzzy.js";
|
|
19
|
+
// Keybindings
|
|
20
|
+
export { getKeybindings, KeybindingsManager, setKeybindings, TUI_KEYBINDINGS, } from "./keybindings.js";
|
|
21
|
+
// Keyboard input handling
|
|
22
|
+
export { decodeKittyPrintable, isKeyRelease, isKeyRepeat, isKittyProtocolActive, Key, matchesKey, parseKey, setKittyProtocolActive, } from "./keys.js";
|
|
23
|
+
// Input buffering for batch splitting
|
|
24
|
+
export { StdinBuffer } from "./stdin-buffer.js";
|
|
25
|
+
// Terminal interface and implementations
|
|
26
|
+
export { ProcessTerminal } from "./terminal.js";
|
|
27
|
+
// Terminal image support
|
|
28
|
+
export { allocateImageId, calculateImageRows, deleteAllKittyImages, deleteKittyImage, detectCapabilities, encodeITerm2, encodeKitty, getCapabilities, getCellDimensions, getGifDimensions, getImageDimensions, getJpegDimensions, getPngDimensions, getWebpDimensions, hyperlink, imageFallback, renderImage, resetCapabilitiesCache, setCapabilities, setCellDimensions, } from "./terminal-image.js";
|
|
29
|
+
export { Container, CURSOR_MARKER, isFocusable, TUI, } from "./tui.js";
|
|
30
|
+
// Utilities
|
|
31
|
+
export { truncateToWidth, visibleWidth, wrapTextWithAnsi } from "./utils.js";
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@wayofmono/wo-tui",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Terminal User Interface library with differential rendering for efficient text-based applications",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"src",
|
|
16
|
+
"README.md"
|
|
17
|
+
],
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"get-east-asian-width": "^1.3.0",
|
|
20
|
+
"marked": "^15.0.12"
|
|
21
|
+
},
|
|
22
|
+
"optionalDependencies": {
|
|
23
|
+
"koffi": "^2.9.0"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@types/node": "^24.3.0",
|
|
27
|
+
"@xterm/headless": "^5.5.0",
|
|
28
|
+
"@xterm/xterm": "^5.5.0",
|
|
29
|
+
"chalk": "^5.5.0",
|
|
30
|
+
"typescript": "^6.0.3",
|
|
31
|
+
"vitest": "^4.1.1"
|
|
32
|
+
},
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "tsc",
|
|
35
|
+
"test": "vitest --run",
|
|
36
|
+
"typecheck": "tsc --noEmit"
|
|
37
|
+
}
|
|
38
|
+
}
|