{"_id":"@adezdev/adam-tui","_rev":"9-3596c09e39cb79e00f68f2083a2b4141","name":"@adezdev/adam-tui","dist-tags":{"latest":"0.5.9"},"versions":{"0.5.1":{"name":"@adezdev/adam-tui","version":"0.5.1","keywords":["tui","terminal","ui","text-editor","differential-rendering","typescript","cli"],"author":{"name":"Mario Zechner"},"license":"MIT","_id":"@adezdev/adam-tui@0.5.1","maintainers":[{"name":"adezdev","email":"paredezdev@gmail.com"}],"homepage":"https://github.com/adezdev/adam#readme","bugs":{"url":"https://github.com/adezdev/adam/issues"},"dist":{"shasum":"8a6eba3475afb8d62840ec03213b2441f8278da5","tarball":"https://registry.npmjs.org/@adezdev/adam-tui/-/adam-tui-0.5.1.tgz","fileCount":38,"integrity":"sha512-QsM8ZJHjfwk0WtgmtePgxJRvcjRy36eehUHgPqxK/Il8mbQqtyttSC2aoGSVILbXAnav/piJPOTL96N/6LnqNQ==","signatures":[{"sig":"MEUCIDdhET0aPM4/Jd7YZk2Reac9GiTAGrrbkzWWsoHk/aX4AiEAxjGwWr/4Peh0GLhdGO7tiZlo0mm8NyzlcszQtTid6DA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":186765},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20.0.0"},"gitHead":"809f0348c62ef7f4eddcf32841b403f00dd9f224","scripts":{"build":"tsc -p tsconfig.build.json","check":"biome check --write .","clean":"node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\""},"_npmUser":{"name":"adezdev","email":"paredezdev@gmail.com"},"repository":{"url":"git+https://github.com/adezdev/adam.git","type":"git","directory":"packages/tui"},"_npmVersion":"11.17.0","description":"Terminal User Interface library with differential rendering for efficient text-based applications","directories":{},"_nodeVersion":"24.19.0","dependencies":{"chalk":"^5.5.0","marked":"^15.0.12","mime-types":"^3.0.1","@types/mime-types":"^2.1.4"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/adam-tui_0.5.1_1786598147144_0.8911780088454053","host":"s3://npm-registry-packages-npm-production"}},"0.5.2":{"name":"@adezdev/adam-tui","version":"0.5.2","keywords":["tui","terminal","ui","text-editor","differential-rendering","typescript","cli"],"author":{"name":"Mario Zechner"},"license":"MIT","_id":"@adezdev/adam-tui@0.5.2","maintainers":[{"name":"adezdev","email":"paredezdev@gmail.com"}],"homepage":"https://github.com/adezdev/adam#readme","bugs":{"url":"https://github.com/adezdev/adam/issues"},"dist":{"shasum":"af5a93a9351ce90accf053f06c297486a7038832","tarball":"https://registry.npmjs.org/@adezdev/adam-tui/-/adam-tui-0.5.2.tgz","fileCount":38,"integrity":"sha512-3J4PzlfrUAoMaIdhFrFsZzJi/DsIxaJ1M+BT1fXOZLSl4GrFGDBNOJ4feCU1jMBKmTQtbfh0EFCWPuPC9bHphA==","signatures":[{"sig":"MEQCIDGUziiKL4UtugDy6xVPdBvAgrjgRHKKTvPzuHhiHIPbAiAtkmwNVM3r9TYX+LVawFFMpWUg2aFTA8Z9vw89sRuoiA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":186915},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20.0.0"},"gitHead":"51c2ce6e7a35dc740931e29afce7d8e87d120553","scripts":{"build":"tsc -p tsconfig.build.json","check":"biome check --write .","clean":"node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\""},"_npmUser":{"name":"adezdev","email":"paredezdev@gmail.com"},"repository":{"url":"git+https://github.com/adezdev/adam.git","type":"git","directory":"packages/tui"},"_npmVersion":"11.17.0","description":"Terminal User Interface library with differential rendering for efficient text-based applications","directories":{},"_nodeVersion":"24.19.0","dependencies":{"chalk":"^5.5.0","marked":"^15.0.12","mime-types":"^3.0.1","@types/mime-types":"^2.1.4"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/adam-tui_0.5.2_1786598656214_0.8026072355449012","host":"s3://npm-registry-packages-npm-production"}},"0.5.3":{"name":"@adezdev/adam-tui","version":"0.5.3","keywords":["tui","terminal","ui","text-editor","differential-rendering","typescript","cli"],"author":{"name":"Mario Zechner"},"license":"MIT","_id":"@adezdev/adam-tui@0.5.3","maintainers":[{"name":"adezdev","email":"paredezdev@gmail.com"}],"homepage":"https://github.com/adezdev/adam#readme","bugs":{"url":"https://github.com/adezdev/adam/issues"},"dist":{"shasum":"24ca4059e63d804fc60000d1eb4dbdccb023673d","tarball":"https://registry.npmjs.org/@adezdev/adam-tui/-/adam-tui-0.5.3.tgz","fileCount":38,"integrity":"sha512-KmL7ycm/ov9QyyaOLyPdOzOgD7/UPwr7QCSJaP42g+U+l8PbdbvFujAMwH3vxI6scRl6f3co8wokR1xkAhsczg==","signatures":[{"sig":"MEYCIQDCJr+5bbYkjuBAh1sWY8p1cnL/E/Irs31hWHfq0d86pQIhAMWgSpqsIEE5wkHjzps4YHRNjlonjUIqzHTokoGWVVBb","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":186915},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20.0.0"},"gitHead":"877a010073b277da839864a6c2ebbaafdde6be42","scripts":{"build":"tsc -p tsconfig.build.json","check":"biome check --write .","clean":"node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\""},"_npmUser":{"name":"adezdev","email":"paredezdev@gmail.com"},"repository":{"url":"git+https://github.com/adezdev/adam.git","type":"git","directory":"packages/tui"},"_npmVersion":"11.17.0","description":"Terminal User Interface library with differential rendering for efficient text-based applications","directories":{},"_nodeVersion":"24.19.0","dependencies":{"chalk":"^5.5.0","marked":"^15.0.12","mime-types":"^3.0.1","@types/mime-types":"^2.1.4"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/adam-tui_0.5.3_1786599428474_0.20848284820079122","host":"s3://npm-registry-packages-npm-production"}},"0.5.4":{"name":"@adezdev/adam-tui","version":"0.5.4","keywords":["tui","terminal","ui","text-editor","differential-rendering","typescript","cli"],"author":{"name":"Mario Zechner"},"license":"MIT","_id":"@adezdev/adam-tui@0.5.4","maintainers":[{"name":"adezdev","email":"paredezdev@gmail.com"}],"homepage":"https://github.com/adezdev/adam#readme","bugs":{"url":"https://github.com/adezdev/adam/issues"},"dist":{"shasum":"c7f4169ddaf15c8f2404cd8730a900e036478eeb","tarball":"https://registry.npmjs.org/@adezdev/adam-tui/-/adam-tui-0.5.4.tgz","fileCount":38,"integrity":"sha512-tAhu6q+biUfIXxQv+fdTrP+wIlNKQWbasKm3ag2OleGjNxmdVkT0AhT5IOMN/d3rs0XPYo/JWWKeYZObQWxINA==","signatures":[{"sig":"MEQCIGKTfhXZvRViciEunasCG8+4h81VgWoycYorrCrgqvkCAiBv9RjVZ8/NSFiSoM5kUnZj5T8/58KiHVwbCigp2BrJzg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":186915},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20.0.0"},"gitHead":"537f6f9daa5cdc2132c9616aaed5f3624f4423b8","scripts":{"build":"tsc -p tsconfig.build.json","check":"biome check --write .","clean":"node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\""},"_npmUser":{"name":"adezdev","email":"paredezdev@gmail.com"},"repository":{"url":"git+https://github.com/adezdev/adam.git","type":"git","directory":"packages/tui"},"_npmVersion":"11.17.0","description":"Terminal User Interface library with differential rendering for efficient text-based applications","directories":{},"_nodeVersion":"24.19.0","dependencies":{"chalk":"^5.5.0","marked":"^15.0.12","mime-types":"^3.0.1","@types/mime-types":"^2.1.4"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/adam-tui_0.5.4_1786600189205_0.5811291698745558","host":"s3://npm-registry-packages-npm-production"}},"0.5.5":{"name":"@adezdev/adam-tui","version":"0.5.5","keywords":["tui","terminal","ui","text-editor","differential-rendering","typescript","cli"],"author":{"name":"Mario Zechner"},"license":"MIT","_id":"@adezdev/adam-tui@0.5.5","maintainers":[{"name":"adezdev","email":"paredezdev@gmail.com"}],"homepage":"https://github.com/adezdev/adam#readme","bugs":{"url":"https://github.com/adezdev/adam/issues"},"dist":{"shasum":"6b3707b5fd9380846742819139be688b674aa72e","tarball":"https://registry.npmjs.org/@adezdev/adam-tui/-/adam-tui-0.5.5.tgz","fileCount":38,"integrity":"sha512-0Z7lc2aQ/9FAfybbVmeDhwtNG9Ex//ofPJYdnyhsIhd+9Te9WK6YrFwV0XPTVI8M7ltMPT/fRtPi2HC+XAbYWA==","signatures":[{"sig":"MEQCIEnkP5av2Qph45Lhx8Cj4/ndC4wSlp9TXdTi0adTt3+kAiBxzYTGmmKKo913JqC+jSFnCxsh/8hvWZCW/q3lnE5T/A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":186915},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20.0.0"},"gitHead":"8f3e0f0d544a40cc995d8c6a10d31a17702d8eae","scripts":{"build":"tsc -p tsconfig.build.json","check":"biome check --write .","clean":"node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\""},"_npmUser":{"name":"adezdev","email":"paredezdev@gmail.com"},"repository":{"url":"git+https://github.com/adezdev/adam.git","type":"git","directory":"packages/tui"},"_npmVersion":"11.17.0","description":"Terminal User Interface library with differential rendering for efficient text-based applications","directories":{},"_nodeVersion":"24.19.0","dependencies":{"chalk":"^5.5.0","marked":"^15.0.12","mime-types":"^3.0.1","@types/mime-types":"^2.1.4"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/adam-tui_0.5.5_1786600877457_0.81525227704769","host":"s3://npm-registry-packages-npm-production"}},"0.5.6":{"name":"@adezdev/adam-tui","version":"0.5.6","keywords":["tui","terminal","ui","text-editor","differential-rendering","typescript","cli"],"author":{"name":"Mario Zechner"},"license":"MIT","_id":"@adezdev/adam-tui@0.5.6","maintainers":[{"name":"adezdev","email":"paredezdev@gmail.com"}],"homepage":"https://github.com/adezdev/adam#readme","bugs":{"url":"https://github.com/adezdev/adam/issues"},"dist":{"shasum":"455887f1b1c7bb945649afa57637811fcf9c0365","tarball":"https://registry.npmjs.org/@adezdev/adam-tui/-/adam-tui-0.5.6.tgz","fileCount":38,"integrity":"sha512-Xlj/rQoNp1R4/1ggO0MObKlG03/nyvuQ/j3Gj45Ga/Doo3LzwaoL0kfjTUTMAnEzv3u7Ou4pyhHAxaOnkFfJTw==","signatures":[{"sig":"MEYCIQDFd8D+yvO8o8YOkYDL/ZbRWNLv6G4j2OPydVaIW8ni1AIhAO8xVs/Y49XMhR9tOFkdZkeOultQQi/is6UpZUtB2019","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":186915},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20.0.0"},"gitHead":"dffbf5b247cc0b1d21a2f878ffb8b71ef58b3823","scripts":{"build":"tsc -p tsconfig.build.json","check":"biome check --write .","clean":"node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\""},"_npmUser":{"name":"adezdev","email":"paredezdev@gmail.com"},"repository":{"url":"git+https://github.com/adezdev/adam.git","type":"git","directory":"packages/tui"},"_npmVersion":"11.17.0","description":"Terminal User Interface library with differential rendering for efficient text-based applications","directories":{},"_nodeVersion":"24.19.0","dependencies":{"chalk":"^5.5.0","marked":"^15.0.12","mime-types":"^3.0.1","@types/mime-types":"^2.1.4"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/adam-tui_0.5.6_1786601360303_0.7218780634778335","host":"s3://npm-registry-packages-npm-production"}},"0.5.7":{"name":"@adezdev/adam-tui","version":"0.5.7","keywords":["tui","terminal","ui","text-editor","differential-rendering","typescript","cli"],"author":{"name":"Mario Zechner"},"license":"MIT","_id":"@adezdev/adam-tui@0.5.7","maintainers":[{"name":"adezdev","email":"paredezdev@gmail.com"}],"homepage":"https://github.com/adezdev/adam#readme","bugs":{"url":"https://github.com/adezdev/adam/issues"},"dist":{"shasum":"6da588b90fa5a7400a36c3c1a6072f2d7d74ba66","tarball":"https://registry.npmjs.org/@adezdev/adam-tui/-/adam-tui-0.5.7.tgz","fileCount":38,"integrity":"sha512-InH5FX6MVlHxlvD10n+FIwAJRBtVEcCPY+0d4J5ZCtYkEuRAzN9sVP9NTF8s0MWocah043mt4DM1rqnhtx4+HA==","signatures":[{"sig":"MEUCIEChTvQy8jmI9MF2LvSAmG7fMPr31ctGJjEsQWwoVZSUAiEA0AmM/eVdngAAJ5jiOtHuig4nqsRsgoEYmGbfwg/G/L8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":186915},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20.0.0"},"gitHead":"65a0d79890c05342acc64b231e6fdd95ee28e332","scripts":{"build":"tsc -p tsconfig.build.json","check":"biome check --write .","clean":"node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\""},"_npmUser":{"name":"adezdev","email":"paredezdev@gmail.com"},"repository":{"url":"git+https://github.com/adezdev/adam.git","type":"git","directory":"packages/tui"},"_npmVersion":"11.17.0","description":"Terminal User Interface library with differential rendering for efficient text-based applications","directories":{},"_nodeVersion":"24.19.0","dependencies":{"chalk":"^5.5.0","marked":"^15.0.12","mime-types":"^3.0.1","@types/mime-types":"^2.1.4"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/adam-tui_0.5.7_1786601918447_0.7002281756078956","host":"s3://npm-registry-packages-npm-production"}},"0.5.8":{"name":"@adezdev/adam-tui","version":"0.5.8","keywords":["tui","terminal","ui","text-editor","differential-rendering","typescript","cli"],"author":{"name":"Mario Zechner"},"license":"MIT","_id":"@adezdev/adam-tui@0.5.8","maintainers":[{"name":"adezdev","email":"paredezdev@gmail.com"}],"homepage":"https://github.com/adezdev/adam#readme","bugs":{"url":"https://github.com/adezdev/adam/issues"},"dist":{"shasum":"d82b1e2833a99ae6d5c4fbf8bd7026dc5aba0178","tarball":"https://registry.npmjs.org/@adezdev/adam-tui/-/adam-tui-0.5.8.tgz","fileCount":38,"integrity":"sha512-e+ofx3Wpx5rSRwSPo0rc2s2Q1T2JLSWU3/+eglDgPC39W9kk39WuRb3uKCfaTecuaZuG0YhkqcG5XiGX3LzV1w==","signatures":[{"sig":"MEQCIBMEeA5B+Vbx1djMmF8meJQ00l29865iNE3pKHF4qcAKAiAWsk35PPffPVyscJG5VH/Q094DkOTbaUQB2+gj+q1bhg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":186915},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20.0.0"},"gitHead":"f6f7c4be23d35bfc2bf01e3a67fb265d7cee3421","scripts":{"build":"tsc -p tsconfig.build.json","check":"biome check --write .","clean":"node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\""},"_npmUser":{"name":"adezdev","email":"paredezdev@gmail.com"},"repository":{"url":"git+https://github.com/adezdev/adam.git","type":"git","directory":"packages/tui"},"_npmVersion":"11.17.0","description":"Terminal User Interface library with differential rendering for efficient text-based applications","directories":{},"_nodeVersion":"24.19.0","dependencies":{"chalk":"^5.5.0","marked":"^15.0.12","mime-types":"^3.0.1","@types/mime-types":"^2.1.4"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/adam-tui_0.5.8_1786602244327_0.06350212566463709","host":"s3://npm-registry-packages-npm-production"}},"0.5.9":{"name":"@adezdev/adam-tui","version":"0.5.9","description":"Terminal User Interface library with differential rendering for efficient text-based applications","type":"module","main":"dist/index.js","scripts":{"clean":"node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\"","build":"tsc -p tsconfig.build.json","check":"biome check --write ."},"keywords":["tui","terminal","ui","text-editor","differential-rendering","typescript","cli"],"author":{"name":"Mario Zechner"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/adezdev/adam.git","directory":"packages/tui"},"engines":{"node":">=20.0.0"},"devDependencies":{},"types":"./dist/index.d.ts","dependencies":{"@types/mime-types":"^2.1.4","chalk":"^5.5.0","marked":"^15.0.12","mime-types":"^3.0.1"},"gitHead":"8f0039b324ad950d43222f82808e71434949e5a4","_id":"@adezdev/adam-tui@0.5.9","bugs":{"url":"https://github.com/adezdev/adam/issues"},"homepage":"https://github.com/adezdev/adam#readme","_nodeVersion":"24.19.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-sYPI4DmC+esTKk1BG9fP+5Gxaxd/WmWMwP1agPcY7trbqLBJCqIXgerTSdkkkH7wgme8b/ucU4NsQ+HOspTbBQ==","shasum":"2d942d6764e93b815823f81710791d141ce5520a","tarball":"https://registry.npmjs.org/@adezdev/adam-tui/-/adam-tui-0.5.9.tgz","fileCount":38,"unpackedSize":186915,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCpOGeQxoz1BqVnzj+N1a711p8S6AdTrBWTGjgHcRl2jgIhAPXqS/GLf6Q/nTuMvoN+fIb+0TN7HzdorJTfhzZ+E/CT"}]},"_npmUser":{"name":"adezdev","email":"paredezdev@gmail.com"},"directories":{},"maintainers":[{"name":"adezdev","email":"paredezdev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/adam-tui_0.5.9_1786603406008_0.6631186591915097"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-13T05:15:46.949Z","modified":"2026-08-13T06:43:26.342Z","0.5.1":"2026-08-13T05:15:47.293Z","0.5.2":"2026-08-13T05:24:16.367Z","0.5.3":"2026-08-13T05:37:08.637Z","0.5.4":"2026-08-13T05:49:49.357Z","0.5.5":"2026-08-13T06:01:17.607Z","0.5.6":"2026-08-13T06:09:20.458Z","0.5.7":"2026-08-13T06:18:38.593Z","0.5.8":"2026-08-13T06:24:04.487Z","0.5.9":"2026-08-13T06:43:26.161Z"},"bugs":{"url":"https://github.com/adezdev/adam/issues"},"author":{"name":"Mario Zechner"},"license":"MIT","homepage":"https://github.com/adezdev/adam#readme","keywords":["tui","terminal","ui","text-editor","differential-rendering","typescript","cli"],"repository":{"type":"git","url":"git+https://github.com/adezdev/adam.git","directory":"packages/tui"},"description":"Terminal User Interface library with differential rendering for efficient text-based applications","maintainers":[{"name":"adezdev","email":"paredezdev@gmail.com"}],"readme":"# @adezdev/adam-tui\r\n\r\nTerminal UI framework with differential rendering for building interactive CLI applications.\r\n\r\n## Features\r\n\r\n- **Differential Rendering**: Only re-renders content that has changed for optimal performance\r\n- **Interactive Components**: Text editor, autocomplete, selection lists, and markdown rendering\r\n- **Composable Architecture**: Container-based component system with proper lifecycle management\r\n- **Text Editor Autocomplete System**: File completion and slash commands with provider interface\r\n\r\n## Quick Start\r\n\r\n```typescript\r\nimport { TUI, Container, TextComponent, TextEditor } from \"@adezdev/adam-tui\";\r\n\r\n// Create TUI manager\r\nconst ui = new TUI();\r\n\r\n// Create components\r\nconst header = new TextComponent(\"🚀 My TUI App\");\r\nconst chatContainer = new Container();\r\nconst editor = new TextEditor();\r\n\r\n// Add components to UI\r\nui.addChild(header);\r\nui.addChild(chatContainer);\r\nui.addChild(editor);\r\n\r\n// Set focus to the editor\r\nui.setFocus(editor);\r\n\r\n// Handle editor submissions\r\neditor.onSubmit = (text: string) => {\r\n\tif (text.trim()) {\r\n\t\tconst message = new TextComponent(`💬 ${text}`);\r\n\t\tchatContainer.addChild(message);\r\n\t\tui.requestRender();\r\n\t}\r\n};\r\n\r\n// Start the UI\r\nui.start();\r\n```\r\n\r\n## Core Components\r\n\r\n### TUI\r\n\r\nMain TUI manager that handles rendering, input, and component coordination.\r\n\r\n**Methods:**\r\n\r\n- `addChild(component)` - Add a component to the TUI\r\n- `removeChild(component)` - Remove a component from the TUI\r\n- `setFocus(component)` - Set which component receives keyboard input\r\n- `start()` - Start the TUI (enables raw mode)\r\n- `stop()` - Stop the TUI (disables raw mode)\r\n- `requestRender()` - Request a re-render on next tick\r\n- `configureLogging(config)` - Configure debug logging\r\n- `cleanupSentinels()` - Remove placeholder components after removal operations\r\n- `findComponent(component)` - Check if a component exists in the hierarchy (private)\r\n- `findInContainer(container, component)` - Search for component in container (private)\r\n\r\n### Container\r\n\r\nComponent that manages child components with differential rendering.\r\n\r\n**Constructor:**\r\n\r\n```typescript\r\nnew Container(parentTui?: TUI | undefined)\r\n```\r\n\r\n**Methods:**\r\n\r\n- `addChild(component)` - Add a child component\r\n- `removeChild(component)` - Remove a child component\r\n- `getChild(index)` - Get a specific child component\r\n- `getChildCount()` - Get the number of child components\r\n- `clear()` - Remove all child components\r\n- `setParentTui(tui)` - Set the parent TUI reference\r\n- `cleanupSentinels()` - Clean up removed component placeholders\r\n- `render(width)` - Render all child components (returns ContainerRenderResult)\r\n\r\n### TextEditor\r\n\r\nInteractive multiline text editor with cursor support and comprehensive keyboard shortcuts.\r\n\r\n**Constructor:**\r\n\r\n```typescript\r\nnew TextEditor(config?: TextEditorConfig)\r\n```\r\n\r\n**Configuration:**\r\n\r\n```typescript\r\ninterface TextEditorConfig {\r\n\t// Configuration options for text editor\r\n}\r\n\r\neditor.configure(config: Partial<TextEditorConfig>)\r\n```\r\n\r\n**Properties:**\r\n\r\n- `onSubmit?: (text: string) => void` - Callback when user presses Enter\r\n- `onChange?: (text: string) => void` - Callback when text content changes\r\n\r\n**Methods:**\r\n\r\n- `getText()` - Get current text content\r\n- `setText(text)` - Set text content and move cursor to end\r\n- `setAutocompleteProvider(provider)` - Set autocomplete provider for Tab completion\r\n- `render(width)` - Render the editor with current state\r\n- `handleInput(data)` - Process keyboard input\r\n\r\n**Keyboard Shortcuts:**\r\n\r\n**Navigation:**\r\n\r\n- `Arrow Keys` - Move cursor\r\n- `Home` / `Ctrl+A` - Move to start of line\r\n- `End` / `Ctrl+E` - Move to end of line\r\n\r\n**Editing:**\r\n\r\n- `Backspace` - Delete character before cursor\r\n- `Delete` / `Fn+Backspace` - Delete character at cursor\r\n- `Ctrl+K` - Delete current line\r\n- `Enter` - Submit text (calls onSubmit)\r\n- `Shift+Enter` / `Option+Enter` - Add new line\r\n- `Tab` - Trigger autocomplete\r\n\r\n**Autocomplete (when active):**\r\n\r\n- `Tab` - Apply selected completion\r\n- `Arrow Up/Down` - Navigate suggestions\r\n- `Escape` - Cancel autocomplete\r\n- `Enter` - Cancel autocomplete and submit\r\n\r\n**Paste Detection:**\r\n\r\n- Automatically handles multi-line paste\r\n- Converts tabs to 4 spaces\r\n- Filters non-printable characters\r\n\r\n### TextComponent\r\n\r\nSimple text component with automatic text wrapping and differential rendering.\r\n\r\n**Constructor:**\r\n\r\n```typescript\r\nnew TextComponent(text: string, padding?: Padding)\r\n\r\ninterface Padding {\r\n\ttop?: number;\r\n\tbottom?: number;\r\n\tleft?: number;\r\n\tright?: number;\r\n}\r\n```\r\n\r\n**Methods:**\r\n\r\n- `setText(text)` - Update the text content\r\n- `getText()` - Get current text content\r\n- `render(width)` - Render with word wrapping\r\n\r\n**Features:**\r\n\r\n- Automatic text wrapping to fit terminal width\r\n- Configurable padding on all sides\r\n- Preserves line breaks in source text\r\n- Uses differential rendering to avoid unnecessary updates\r\n\r\n### MarkdownComponent\r\n\r\nRenders markdown content with syntax highlighting and proper formatting.\r\n\r\n**Constructor:**\r\n\r\n```typescript\r\nnew MarkdownComponent(text?: string)\r\n```\r\n\r\n**Methods:**\r\n\r\n- `setText(text)` - Update markdown content\r\n- `render(width)` - Render parsed markdown\r\n\r\n**Features:**\r\n\r\n- **Headings**: Styled with colors and formatting\r\n- **Code blocks**: Syntax highlighting with gray background\r\n- **Lists**: Bullet points (•) and numbered lists\r\n- **Emphasis**: **Bold** and _italic_ text\r\n- **Links**: Underlined with URL display\r\n- **Blockquotes**: Styled with left border\r\n- **Inline code**: Highlighted with background\r\n- **Horizontal rules**: Terminal-width separator lines\r\n- Differential rendering for performance\r\n\r\n### SelectList\r\n\r\nInteractive selection component for choosing from options.\r\n\r\n**Constructor:**\r\n\r\n```typescript\r\nnew SelectList(items: SelectItem[], maxVisible?: number)\r\n\r\ninterface SelectItem {\r\n\tvalue: string;\r\n\tlabel: string;\r\n\tdescription?: string;\r\n}\r\n```\r\n\r\n**Properties:**\r\n\r\n- `onSelect?: (item: SelectItem) => void` - Called when item is selected\r\n- `onCancel?: () => void` - Called when selection is cancelled\r\n\r\n**Methods:**\r\n\r\n- `setFilter(filter)` - Filter items by value\r\n- `getSelectedItem()` - Get currently selected item\r\n- `handleInput(keyData)` - Handle keyboard navigation\r\n- `render(width)` - Render the selection list\r\n\r\n**Features:**\r\n\r\n- Keyboard navigation (arrow keys, Enter)\r\n- Search/filter functionality\r\n- Scrolling for long lists\r\n- Custom option rendering with descriptions\r\n- Visual selection indicator (→)\r\n- Scroll position indicator\r\n\r\n### Autocomplete System\r\n\r\nComprehensive autocomplete system supporting slash commands and file paths.\r\n\r\n#### AutocompleteProvider Interface\r\n\r\n```typescript\r\ninterface AutocompleteProvider {\r\n\tgetSuggestions(\r\n\t\tlines: string[],\r\n\t\tcursorLine: number,\r\n\t\tcursorCol: number,\r\n\t): {\r\n\t\titems: AutocompleteItem[];\r\n\t\tprefix: string;\r\n\t} | null;\r\n\r\n\tapplyCompletion(\r\n\t\tlines: string[],\r\n\t\tcursorLine: number,\r\n\t\tcursorCol: number,\r\n\t\titem: AutocompleteItem,\r\n\t\tprefix: string,\r\n\t): {\r\n\t\tlines: string[];\r\n\t\tcursorLine: number;\r\n\t\tcursorCol: number;\r\n\t};\r\n}\r\n\r\ninterface AutocompleteItem {\r\n\tvalue: string;\r\n\tlabel: string;\r\n\tdescription?: string;\r\n}\r\n```\r\n\r\n#### CombinedAutocompleteProvider\r\n\r\nBuilt-in provider supporting slash commands and file completion.\r\n\r\n**Constructor:**\r\n\r\n```typescript\r\nnew CombinedAutocompleteProvider(\r\n\tcommands: (SlashCommand | AutocompleteItem)[] = [],\r\n\tbasePath: string = process.cwd()\r\n)\r\n\r\ninterface SlashCommand {\r\n\tname: string;\r\n\tdescription?: string;\r\n\tgetArgumentCompletions?(argumentPrefix: string): AutocompleteItem[] | null;\r\n}\r\n```\r\n\r\n**Features:**\r\n\r\n**Slash Commands:**\r\n\r\n- Type `/` to trigger command completion\r\n- Auto-completion for command names\r\n- Argument completion for commands that support it\r\n- Space after command name for argument input\r\n\r\n**File Completion:**\r\n\r\n- `Tab` key triggers file completion\r\n- `@` prefix for file attachments\r\n- Home directory expansion (`~/`)\r\n- Relative and absolute path support\r\n- Directory-first sorting\r\n- Filters to attachable files for `@` prefix\r\n\r\n**Path Patterns:**\r\n\r\n- `./` and `../` - Relative paths\r\n- `~/` - Home directory\r\n- `@path` - File attachment syntax\r\n- Tab completion from any context\r\n\r\n**Methods:**\r\n\r\n- `getSuggestions()` - Get completions for current context\r\n- `getForceFileSuggestions()` - Force file completion (Tab key)\r\n- `shouldTriggerFileCompletion()` - Check if file completion should trigger\r\n- `applyCompletion()` - Apply selected completion\r\n\r\n## Differential Rendering\r\n\r\nThe core concept: components return `{lines: string[], changed: boolean, keepLines?: number}`:\r\n\r\n- `lines`: All lines the component should display\r\n- `changed`: Whether the component has changed since last render\r\n- `keepLines`: (Containers only) How many lines from the beginning are unchanged\r\n\r\n**How it works:**\r\n\r\n1. TUI calculates total unchanged lines from top (`keepLines`)\r\n2. Moves cursor up by `(totalLines - keepLines)` positions\r\n3. Clears from cursor position down with `\\x1b[0J`\r\n4. Prints only the changing lines: `result.lines.slice(keepLines)`\r\n\r\nThis approach minimizes screen updates and provides smooth performance even with large amounts of text.\r\n\r\n**Important:** Don't add extra cursor positioning after printing - it interferes with terminal scrolling and causes rendering artifacts.\r\n\r\n## Advanced Examples\r\n\r\n### Chat Application with Autocomplete\r\n\r\n```typescript\r\nimport { TUI, Container, TextEditor, MarkdownComponent, CombinedAutocompleteProvider } from \"@adezdev/adam-tui\";\r\n\r\nconst ui = new TUI();\r\nconst chatHistory = new Container();\r\nconst editor = new TextEditor();\r\n\r\n// Set up autocomplete with slash commands\r\nconst autocompleteProvider = new CombinedAutocompleteProvider([\r\n\t{ name: \"clear\", description: \"Clear chat history\" },\r\n\t{ name: \"help\", description: \"Show help information\" },\r\n\t{\r\n\t\tname: \"attach\",\r\n\t\tdescription: \"Attach a file\",\r\n\t\tgetArgumentCompletions: (prefix) => {\r\n\t\t\t// Return file suggestions for attach command\r\n\t\t\treturn null; // Use default file completion\r\n\t\t},\r\n\t},\r\n]);\r\n\r\neditor.setAutocompleteProvider(autocompleteProvider);\r\n\r\neditor.onSubmit = (text) => {\r\n\t// Handle slash commands\r\n\tif (text.startsWith(\"/\")) {\r\n\t\tconst [command, ...args] = text.slice(1).split(\" \");\r\n\t\tif (command === \"clear\") {\r\n\t\t\tchatHistory.clear();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (command === \"help\") {\r\n\t\t\tconst help = new MarkdownComponent(`\r\n## Available Commands\r\n- \\`/clear\\` - Clear chat history\r\n- \\`/help\\` - Show this help\r\n- \\`/attach <file>\\` - Attach a file\r\n\t\t\t`);\r\n\t\t\tchatHistory.addChild(help);\r\n\t\t\tui.requestRender();\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\r\n\t// Regular message\r\n\tconst message = new MarkdownComponent(`**You:** ${text}`);\r\n\tchatHistory.addChild(message);\r\n\r\n\t// Add AI response (simulated)\r\n\tsetTimeout(() => {\r\n\t\tconst response = new MarkdownComponent(`**AI:** Response to \"${text}\"`);\r\n\t\tchatHistory.addChild(response);\r\n\t\tui.requestRender();\r\n\t}, 1000);\r\n};\r\n\r\nui.addChild(chatHistory);\r\nui.addChild(editor);\r\nui.setFocus(editor);\r\nui.start();\r\n```\r\n\r\n### File Browser\r\n\r\n```typescript\r\nimport { TUI, SelectList } from \"@adezdev/adam-tui\";\r\nimport { readdirSync, statSync } from \"fs\";\r\nimport { join } from \"path\";\r\n\r\nconst ui = new TUI();\r\nlet currentPath = process.cwd();\r\n\r\nfunction createFileList(path: string) {\r\n\tconst entries = readdirSync(path).map((entry) => {\r\n\t\tconst fullPath = join(path, entry);\r\n\t\tconst isDir = statSync(fullPath).isDirectory();\r\n\t\treturn {\r\n\t\t\tvalue: entry,\r\n\t\t\tlabel: entry,\r\n\t\t\tdescription: isDir ? \"directory\" : \"file\",\r\n\t\t};\r\n\t});\r\n\r\n\t// Add parent directory option\r\n\tif (path !== \"/\") {\r\n\t\tentries.unshift({\r\n\t\t\tvalue: \"..\",\r\n\t\t\tlabel: \"..\",\r\n\t\t\tdescription: \"parent directory\",\r\n\t\t});\r\n\t}\r\n\r\n\treturn entries;\r\n}\r\n\r\nfunction showDirectory(path: string) {\r\n\tui.clear();\r\n\r\n\tconst entries = createFileList(path);\r\n\tconst fileList = new SelectList(entries, 10);\r\n\r\n\tfileList.onSelect = (item) => {\r\n\t\tif (item.value === \"..\") {\r\n\t\t\tcurrentPath = join(currentPath, \"..\");\r\n\t\t\tshowDirectory(currentPath);\r\n\t\t} else if (item.description === \"directory\") {\r\n\t\t\tcurrentPath = join(currentPath, item.value);\r\n\t\t\tshowDirectory(currentPath);\r\n\t\t} else {\r\n\t\t\tconsole.log(`Selected file: ${join(currentPath, item.value)}`);\r\n\t\t\tui.stop();\r\n\t\t}\r\n\t};\r\n\r\n\tui.addChild(fileList);\r\n\tui.setFocus(fileList);\r\n}\r\n\r\nshowDirectory(currentPath);\r\nui.start();\r\n```\r\n\r\n### Multi-Component Layout\r\n\r\n```typescript\r\nimport { TUI, Container, TextComponent, TextEditor, MarkdownComponent } from \"@adezdev/adam-tui\";\r\n\r\nconst ui = new TUI();\r\n\r\n// Create layout containers\r\nconst header = new TextComponent(\"📝 Advanced TUI Demo\", { bottom: 1 });\r\nconst mainContent = new Container();\r\nconst sidebar = new Container();\r\nconst footer = new TextComponent(\"Press Ctrl+C to exit\", { top: 1 });\r\n\r\n// Sidebar content\r\nsidebar.addChild(new TextComponent(\"📁 Files:\", { bottom: 1 }));\r\nsidebar.addChild(new TextComponent(\"- config.json\"));\r\nsidebar.addChild(new TextComponent(\"- README.md\"));\r\nsidebar.addChild(new TextComponent(\"- package.json\"));\r\n\r\n// Main content area\r\nconst chatArea = new Container();\r\nconst inputArea = new TextEditor();\r\n\r\n// Add welcome message\r\nchatArea.addChild(\r\n\tnew MarkdownComponent(`\r\n# Welcome to the TUI Demo\r\n\r\nThis demonstrates multiple components working together:\r\n\r\n- **Header**: Static title with padding\r\n- **Sidebar**: File list (simulated)\r\n- **Chat Area**: Scrollable message history\r\n- **Input**: Interactive text editor\r\n- **Footer**: Status information\r\n\r\nTry typing a message and pressing Enter!\r\n`),\r\n);\r\n\r\ninputArea.onSubmit = (text) => {\r\n\tif (text.trim()) {\r\n\t\tconst message = new MarkdownComponent(`\r\n**${new Date().toLocaleTimeString()}:** ${text}\r\n\t\t`);\r\n\t\tchatArea.addChild(message);\r\n\t\tui.requestRender();\r\n\t}\r\n};\r\n\r\n// Build layout\r\nmainContent.addChild(chatArea);\r\nmainContent.addChild(inputArea);\r\n\r\nui.addChild(header);\r\nui.addChild(mainContent);\r\nui.addChild(footer);\r\nui.setFocus(inputArea);\r\n\r\n// Configure debug logging\r\nui.configureLogging({\r\n\tenabled: true,\r\n\tlevel: \"info\",\r\n\tlogFile: \"tui-debug.log\",\r\n});\r\n\r\nui.start();\r\n```\r\n\r\n## Interfaces and Types\r\n\r\n### Core Types\r\n\r\n```typescript\r\ninterface ComponentRenderResult {\r\n\tlines: string[];\r\n\tchanged: boolean;\r\n}\r\n\r\ninterface ContainerRenderResult extends ComponentRenderResult {\r\n\tkeepLines: number;\r\n}\r\n\r\ninterface Component {\r\n\trender(width: number): ComponentRenderResult;\r\n\thandleInput?(keyData: string): void;\r\n}\r\n\r\ninterface Padding {\r\n\ttop?: number;\r\n\tbottom?: number;\r\n\tleft?: number;\r\n\tright?: number;\r\n}\r\n```\r\n\r\n### Autocomplete Types\r\n\r\n```typescript\r\ninterface AutocompleteItem {\r\n\tvalue: string;\r\n\tlabel: string;\r\n\tdescription?: string;\r\n}\r\n\r\ninterface SlashCommand {\r\n\tname: string;\r\n\tdescription?: string;\r\n\tgetArgumentCompletions?(argumentPrefix: string): AutocompleteItem[] | null;\r\n}\r\n\r\ninterface AutocompleteProvider {\r\n\tgetSuggestions(\r\n\t\tlines: string[],\r\n\t\tcursorLine: number,\r\n\t\tcursorCol: number,\r\n\t): {\r\n\t\titems: AutocompleteItem[];\r\n\t\tprefix: string;\r\n\t} | null;\r\n\r\n\tapplyCompletion(\r\n\t\tlines: string[],\r\n\t\tcursorLine: number,\r\n\t\tcursorCol: number,\r\n\t\titem: AutocompleteItem,\r\n\t\tprefix: string,\r\n\t): {\r\n\t\tlines: string[];\r\n\t\tcursorLine: number;\r\n\t\tcursorCol: number;\r\n\t};\r\n}\r\n```\r\n\r\n### Selection Types\r\n\r\n```typescript\r\ninterface SelectItem {\r\n\tvalue: string;\r\n\tlabel: string;\r\n\tdescription?: string;\r\n}\r\n```\r\n\r\n## Development\r\n\r\n```bash\r\n# Install dependencies (from monorepo root)\r\nnpm install\r\n\r\n# Build the package\r\nnpm run build\r\n\r\n# Run type checking\r\nnpm run check\r\n```\r\n\r\n**Testing:**\r\nCreate a test file and run it with tsx:\r\n\r\n```bash\r\n# From packages/tui directory\r\nnpx tsx test/demo.ts\r\n```\r\n\r\nSpecial input keywords for simulation: \"TAB\", \"ENTER\", \"SPACE\", \"ESC\"\r\n\r\n**Debugging:**\r\nEnable logging to see detailed component behavior:\r\n\r\n```typescript\r\nui.configureLogging({\r\n\tenabled: true,\r\n\tlevel: \"debug\", // \"error\" | \"warn\" | \"info\" | \"debug\"\r\n\tlogFile: \"tui-debug.log\",\r\n});\r\n```\r\n\r\nCheck the log file to debug rendering issues, input handling, and component lifecycle.\r\n","readmeFilename":"README.md"}