mirror of
https://github.com/litruv/lit.ruv.wtf.git
synced 2026-11-26 16:38:52 +11:00
Add terminal commands for enhanced functionality
- Implemented 'about' command to provide information about the terminal. - Created 'banner' command to display a welcome message based on terminal width. - Added 'bluesky' command to fetch and display recent posts from Bluesky. - Introduced 'clear' command to clear the terminal screen. - Developed 'color' command to change the terminal's color scheme. - Added 'contact' command to display contact information. - Implemented 'date' command to show the current date and time. - Created 'echo' command to echo back user messages. - Added 'github' command to simulate opening the GitHub repository. - Implemented 'help' command to list available commands. - Developed 'history' command to show command history. - Added 'privacy' command to display the privacy policy. - Implemented 'whoami' command to show user information.
This commit is contained in:
1 parent
bf283e8425
commit
288b48ddab
18 files changed
+501
-274
No files matched your search
+1
-1
@@ -70,6 +70,6 @@
|
|||||||
<script src="https://cdn.jsdelivr.net/npm/xterm-addon-fit@0.8.0/lib/xterm-addon-fit.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/xterm-addon-fit@0.8.0/lib/xterm-addon-fit.min.js"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/xterm-addon-web-links@0.9.0/lib/xterm-addon-web-links.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/xterm-addon-web-links@0.9.0/lib/xterm-addon-web-links.min.js"></script>
|
||||||
<script src="boot.js"></script>
|
<script src="boot.js"></script>
|
||||||
<script src="terminal.js"></script>
|
<script type="module" src="terminal.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg width="100%" height="100%" viewBox="0 0 2179 650" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||||
|
<g id="Original" transform="matrix(1,0,0,1,-743.737,-423.996)">
|
||||||
|
<g id="LogoClip" transform="matrix(0.989767,0,0,1,766.014,423.996)">
|
||||||
|
<rect x="418" y="22" width="1759" height="622" style="fill:none;"/>
|
||||||
|
<clipPath id="_clip1">
|
||||||
|
<rect x="418" y="22" width="1759" height="622"/>
|
||||||
|
</clipPath>
|
||||||
|
<g clip-path="url(#_clip1)">
|
||||||
|
<g id="Logo" transform="matrix(1.01034,-0,-0,1,-22.5078,0)">
|
||||||
|
<use xlink:href="#_Image2" x="436" y="32.708" width="1741px" height="612px"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<g id="Bear">
|
||||||
|
<g transform="matrix(1,0,0,1,-2.24804,-1125.4)">
|
||||||
|
<path d="M1046,1583C1075,1584 1115,1592 1137,1603C1140,1599 1172,1566 1207,1566C1244,1566 1264,1577 1282,1604C1291,1618 1311,1670 1264,1710C1282,1747 1317,1839 1288,1920C1281,1945 1273,1956 1260,1939C1254,1951 1246,1963.67 1236,1977C1227,1991 1205,2014 1203,2049C1200,2084 1201,2117 1225,2161C1241,2190 1246,2191 1213,2195C1191,2198 1104,2211 1015,2164C1014,2175 1012,2196 982,2179C951,2162 924,2148 899,2119C897,2125 895,2135 888,2136C881,2137 810,2100 778,1983C774,1989 768,2001 762,1998C756,1995 712,1891 802,1728C770,1703 727,1635 791,1576C859,1519 930,1567 949,1596C971,1587 1017,1582 1046,1583" style="fill:rgb(29,18,0);"/>
|
||||||
|
</g>
|
||||||
|
<g transform="matrix(1,0,0,1,-2.24804,-1125.4)">
|
||||||
|
<path d="M1271,1908C1264,1896 1254,1882 1253,1883C1253,1906 1239,1941 1215,1971C1192.33,2001 1180.67,2030 1180,2058C1180,2085 1182,2134 1214,2179C1171,2182 1083,2196 984,2118C981,2116 991,2161 987,2158C978,2154 930,2127 885,2073C882.333,2076.33 880,2087.33 878,2106C836,2067 808,2045 791,1936L769,1957C764,1860 774,1818 833,1721C797,1704 748,1642 814,1584C851,1552 918,1565 937,1623C1003,1596 1068,1597 1146,1626C1162,1598 1198,1570 1243,1599C1267,1614 1291,1661 1234,1704C1259,1741 1293,1821 1271,1908" style="fill:url(#_Linear3);"/>
|
||||||
|
</g>
|
||||||
|
<g transform="matrix(1,0,0,1,-2.24804,-1125.4)">
|
||||||
|
<path d="M1164,1769C1164,1769 1206,1760 1213,1767C1220,1774 1239,1791 1244,1816C1248,1840 1254,1861 1253,1883C1253,1906 1239,1941 1215,1971C1192.33,2001 1180.67,2030 1180,2058C1180,2085 1182,2134 1214,2179C1198,2174 1042,2114 968,2061C894,2007 880,1988 860,1956C841,1925 828,1884 833,1859C840,1880 855,1913 877,1932C875.667,1920 875.667,1908 877,1896C879,1901 886,1943 934,1978C930,1961 920,1938 920,1924C929,1934 971,1986 1059,1988C1146.33,1990 1190.67,1954 1192,1880C1195,1806 1164,1769 1164,1769M958,1758C958,1758 988,1707 1047,1709C1106,1711 1103,1758 1074,1770C1071,1759 1074,1760 1059,1761L986,1757L958,1758Z" style="fill:rgb(90,42,2);"/>
|
||||||
|
</g>
|
||||||
|
<g transform="matrix(1,0,0,1,-2.24804,-1125.4)">
|
||||||
|
<path d="M1155,1758C1155,1758 1144,1718 1180,1714C1217,1710 1232,1753 1236,1768C1231,1762 1228,1755 1216,1760C1205,1764 1162,1763 1162,1763L1155,1758Z" style="fill:rgb(90,42,2);"/>
|
||||||
|
</g>
|
||||||
|
<g transform="matrix(1,0,0,1,-2.24804,-1125.4)">
|
||||||
|
<path d="M1215,1758L1221,1757C1221,1757 1213,1747 1201,1743C1189,1739 1179,1743 1174,1747C1169,1751 1163,1762 1167,1766C1171,1770 1178,1776 1193,1775C1207,1775 1212,1769 1213,1765L1215,1758Z" style="fill:rgb(29,18,0);"/>
|
||||||
|
</g>
|
||||||
|
<g transform="matrix(1,0,0,1,-2.24804,-1125.4)">
|
||||||
|
<path d="M1122,1737C1151,1737 1223,1809 1223,1867C1223,1916 1190,1965 1126,1965C1062,1965 1022,1931 1020,1881C1019,1819 1086,1737 1122,1737" style="fill:rgb(254,248,222);"/>
|
||||||
|
</g>
|
||||||
|
<g transform="matrix(1,0,0,1,-2.24804,-1125.4)">
|
||||||
|
<path d="M861,1692L914,1656C915,1654 915,1637 912,1633C908,1629 898,1616 887,1612C874.333,1608 864.667,1608 858,1612C851.333,1614 844.333,1620 837,1630C830,1640 861,1692 861,1692" style="fill:rgb(107,47,5);"/>
|
||||||
|
</g>
|
||||||
|
<g transform="matrix(1,0,0,1,-2.24804,-1125.4)">
|
||||||
|
<path d="M909,1661C909,1661 893,1620 863,1618C837,1616 830,1627 827,1643C824,1659 838,1683 859,1693L909,1661Z" style="fill:rgb(253,247,225);"/>
|
||||||
|
</g>
|
||||||
|
<g transform="matrix(1,0,0,1,-2.24804,-1125.4)">
|
||||||
|
<path d="M1161,1806C1189,1806 1206,1815 1210,1823C1213,1832 1213,1848 1200,1862C1187,1877 1175,1882 1172,1885L1170,1898C1170,1898 1205,1913 1193,1929C1189,1927 1176,1913 1158,1913C1136,1912 1108,1929 1098,1930C1087.33,1930.67 1084.33,1929.67 1089,1927C1094,1924 1114,1911 1154,1897L1157,1883C1157,1883 1136,1871 1128,1863C1120,1854 1101,1834 1122,1817C1130,1809.67 1143,1806 1161,1806M983,1755C997,1760 1011,1775 1031,1775C1053,1775 1059,1768 1071,1760C1063,1750 1056,1739 1032,1739C1010,1738 998,1747 983,1755" style="fill:rgb(29,18,0);"/>
|
||||||
|
</g>
|
||||||
|
<g transform="matrix(0.756,0,0,0.814,289.752,-814.404)">
|
||||||
|
<path d="M1178,1644C1178,1644 1176,1632 1180,1629C1186,1623 1204,1612 1217,1613C1245,1614 1254,1626 1258,1634C1262,1642 1264,1674 1226,1694C1217,1684 1212,1670 1178,1644" style="fill:rgb(107,47,5);"/>
|
||||||
|
</g>
|
||||||
|
<g transform="matrix(0.598,0,0,0.626,484.752,-496.404)">
|
||||||
|
<path d="M1170,1633C1170,1633 1188,1606 1216,1607C1244,1609 1259,1622 1267,1633C1274,1645 1275,1687 1236,1707C1228,1698 1204,1664 1170,1633" style="fill:rgb(254,248,222);"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<defs>
|
||||||
|
<image id="_Image2" width="1741px" height="612px" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABs0AAAJkCAYAAABahW8lAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAgAElEQVR4nOzdeXxcZd3//9dkaZo2TdrTQkvbU7pQWsq+lZbuC7RsAkIpu4jsciMCX73lhyj1lhu8kd0FUFSgWChQFllEBERBcAFFBBWVZVQEygCVRWTp749JStpMmmTmmpxZXs/HYx5JZs58zoc2nJ4573NdVwqVrDiiHujX7tEANK3zXGePvq3b1wH1rV/X/b6rn9t//w6wEngGeBx4MJ3hh0X8z5ckSZIkSZIkSeo1qaQbKEdxRA3dC656EnK1Pfq3vq8/2dCqlL0BXAdcmc7wUNLNSJIkSZIkSZIk5atiQ7M4IgUMBpqBATkePQm6GoCBrV8byY7i0tpuAf4nneFXSTciSZIkSZIkSZLUU2UfmsURmwKTgK2AbYFxwEbAkCT7qmJfSmc4M+kmJEmSJEmSJEmSeqKsQrM4YiQws/WxLbA12dFfKi13AYemM7ySdCOSJEmSJEmSJEndUfKhWRwxj2xItgDYKeF21H2PA3unMzybdCOSpNIWR2wFTCM7anwM2dHiLVTvjTHvtD5WrufxEvBMOsOrSTUpSZIkSZJUaUoyNGsNyhYD+wAbJNyO8vc4MNcRZ5KkdcURY4Ajyf57Pz7hdsrZX4AngMeAB9IZ7ku4H0mSJEmSpLJVMqFZHDEeOBY4BBiWcDsK5650ht2SbkKSVBriiBHAGcBxSfdSoVYBDwCPtn69P53h/WRbkiRJkiRJKg+Jh2ZxxCTgeODEpHtR0XwpneHMpJuQJCUrjjgeOA/ol3QvVeQ/wJ3AHcB16QyvJ9yPJEmSJElSyU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W24DYUebLQ5YS5IkSZIkqWA1AHFEM7BLnjVyjDLbwFFmkiRJFSKVSnHa5zodbZav3eOIhtBFJUmSJEmS8tU20izfwCynY0441VFmkiRJFWTegj3ZapsdoONos3ynaKwh8DmoJEmSJElSIdpCs90D1UulUin2WeTa7pIkSZXmkI8dE7rkrNAFJUmSJEmS8tUWmu2V5/s73Fm82eZbsdHwkfl3JEmSpJK0176L22YTCDXabGZhHUmSJEmSJIVTE0fMAzYIVXDuLnuEKiVJkqQS0jSgmd322i9kyclxxPCQBSVJkiRJkvJVQ7g7fFMA83Y1NJMkSapUiw/5eOiS00IXlCRJkiRJykcNMCXP93aYhicaPITtdpxaWEeSJEkqWTtOmUFT0wDoOEVjvvI9F5UkSZIkSQqqBtg2VLHZ8xaSSoW6fiJJkqRSU1dXx07TZuV6Kd91zYKdi0qSJEmSJBWihoDrmc3bdc9QpSRJklSips2YG7LcxJDFJEmSJEmS8lUTqE6qrq6OWXMXBConSZKkUjVt5ry2b0NMMbBRHDEwQB1JkiRJkqSC5BuadZh+Z9sdptDc4vUOSZKkSjdx0pahz/s2DVlMkiRJkiQpH6FGmjFp861DlZIkSVIJS6VSbDI+56yK+a5rZmgmSZIkSZISFyw0Gzt+QqhSkiRJKnFjxgXNucaGLCZJkiRJkpSPEKFZCmDcJoZmkiRJ1WLsJkFDszEhi0mSJEmSJOUj2EgzQzNJkqTqMTbsSLMhIYtJkiRJkiTlI0ho1rdvI8NHjgpRSpIkSWVg1Og1MyqmApQbGKCLine truncated
|
||||||
|
<linearGradient id="_Linear3" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(153.937,228.222,-228.222,153.937,843.428,1861.74)"><stop offset="0" style="stop-color:rgb(170,81,13);stop-opacity:1"/><stop offset="0.5" style="stop-color:rgb(152,72,11);stop-opacity:1"/><stop offset="1" style="stop-color:rgb(90,42,2);stop-opacity:1"/></linearGradient>
|
||||||
|
</defs>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 77 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 329 KiB After Width: | Height: | Size: 268 KiB |
@@ -0,0 +1,25 @@
|
|||||||
|
/**
|
||||||
|
* About command - Information about this terminal
|
||||||
|
*/
|
||||||
|
export default {
|
||||||
|
description: 'About this terminal',
|
||||||
|
execute: (term, writeClickable, VERSION) => {
|
||||||
|
return [
|
||||||
|
'',
|
||||||
|
'╔════════════════════════════════════════════════════════════╗',
|
||||||
|
'║ LIT.RUV.WTF TERMINAL ║',
|
||||||
|
'╚════════════════════════════════════════════════════════════╝',
|
||||||
|
'',
|
||||||
|
' A classic terminal interface built with xterm.js',
|
||||||
|
' Features: Keyboard navigation, Mouse support, CRT effects',
|
||||||
|
' Version: ' + VERSION,
|
||||||
|
' Built: ' + new Date().getFullYear(),
|
||||||
|
'',
|
||||||
|
' Technologies:',
|
||||||
|
' • xterm.js - Terminal emulator',
|
||||||
|
' • JavaScript - Terminal logic',
|
||||||
|
' • CSS3 - Classic CRT styling',
|
||||||
|
''
|
||||||
|
].join('\r\n');
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* Banner command - Display welcome banner
|
||||||
|
*/
|
||||||
|
export default {
|
||||||
|
description: 'Display welcome banner',
|
||||||
|
execute: (term, writeClickable, VERSION, args, commandHistory, welcomeBannerFull, welcomeBannerCompact, welcomeBannerMinimal) => {
|
||||||
|
const cols = term.cols;
|
||||||
|
if (cols >= 78) {
|
||||||
|
term.writeln(welcomeBannerFull.split('\r\n').slice(0, -3).join('\r\n'));
|
||||||
|
writeClickable(' Type [command=help] for available commands.');
|
||||||
|
term.writeln(' Use ↑/↓ arrows to navigate command history.');
|
||||||
|
term.writeln('');
|
||||||
|
} else if (cols >= 40) {
|
||||||
|
term.writeln(welcomeBannerCompact.split('\r\n').slice(0, -2).join('\r\n'));
|
||||||
|
writeClickable(' Welcome! Type [command=help] for commands.');
|
||||||
|
term.writeln('');
|
||||||
|
} else {
|
||||||
|
term.writeln(welcomeBannerMinimal.split('\r\n').slice(0, -2).join('\r\n'));
|
||||||
|
writeClickable(' Type [command=help]');
|
||||||
|
term.writeln('');
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
/**
|
||||||
|
* Bluesky command - Fetch recent posts from Bluesky
|
||||||
|
*/
|
||||||
|
export default {
|
||||||
|
description: 'Fetch recent posts from Bluesky',
|
||||||
|
execute: async (term, writeClickable, VERSION, args) => {
|
||||||
|
const actor = 'lit.mates.dev';
|
||||||
|
const limit = args[0] ? parseInt(args[0]) : 5;
|
||||||
|
|
||||||
|
try {
|
||||||
|
term.writeln('\r\n Fetching posts from Bluesky...\r\n');
|
||||||
|
|
||||||
|
const response = await fetch(
|
||||||
|
`https://public.api.bsky.app/xrpc/app.bsky.feed.getAuthorFeed?actor=${actor}&limit=${limit}`
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!response.ok) {
|
||||||
|
return ' Error: Unable to fetch Bluesky posts';
|
||||||
|
}
|
||||||
|
|
||||||
|
const data = await response.json();
|
||||||
|
|
||||||
|
if (!data.feed || data.feed.length === 0) {
|
||||||
|
return ' No posts found.';
|
||||||
|
}
|
||||||
|
|
||||||
|
let output = [' ╔════════════════════════════════════════════════════╗'];
|
||||||
|
output.push(' ║ BLUESKY POSTS - @lit.mates.dev ║');
|
||||||
|
output.push(' ╚════════════════════════════════════════════════════╝');
|
||||||
|
output.push('');
|
||||||
|
|
||||||
|
// Reverse to show oldest first, latest at bottom
|
||||||
|
const reversedFeed = [...data.feed].reverse();
|
||||||
|
|
||||||
|
reversedFeed.forEach((item, idx) => {
|
||||||
|
const post = item.post;
|
||||||
|
const text = post.record.text;
|
||||||
|
const createdAt = new Date(post.record.createdAt);
|
||||||
|
const date = createdAt.toLocaleDateString();
|
||||||
|
const time = createdAt.toLocaleTimeString('en-US', {
|
||||||
|
hour: '2-digit',
|
||||||
|
minute: '2-digit'
|
||||||
|
});
|
||||||
|
|
||||||
|
// Extract post ID from URI (at://did:plc:xxx/app.bsky.feed.post/{postId})
|
||||||
|
const postId = post.uri.split('/').pop();
|
||||||
|
const postUrl = `https://bsky.app/profile/${actor}/post/${postId}`;
|
||||||
|
|
||||||
|
output.push(` [${idx + 1}] ${date} ${time}`);
|
||||||
|
output.push(` ${postUrl}`);
|
||||||
|
output.push(' ────────────────────────────────────────');
|
||||||
|
|
||||||
|
// Wrap text to max 50 chars
|
||||||
|
const words = text.split(' ');
|
||||||
|
let line = ' ';
|
||||||
|
words.forEach(word => {
|
||||||
|
if (line.length + word.length + 1 > 52) {
|
||||||
|
output.push(line);
|
||||||
|
line = ' ' + word;
|
||||||
|
} else {
|
||||||
|
line += (line.length > 2 ? ' ' : '') + word;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (line.length > 2) output.push(line);
|
||||||
|
|
||||||
|
output.push('');
|
||||||
|
output.push(` ♡ ${post.likeCount || 0} ↻ ${post.repostCount || 0} 💬 ${post.replyCount || 0}`);
|
||||||
|
output.push('');
|
||||||
|
});
|
||||||
|
|
||||||
|
output.push(` Usage: bluesky [count] (default: 5, max: 20)`);
|
||||||
|
output.push('');
|
||||||
|
|
||||||
|
return output.join('\r\n');
|
||||||
|
} catch (error) {
|
||||||
|
return ' Error: Failed to connect to Bluesky API';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
/**
|
||||||
|
* Clear command - Clear terminal screen
|
||||||
|
*/
|
||||||
|
export default {
|
||||||
|
description: 'Clear terminal screen',
|
||||||
|
execute: (term) => {
|
||||||
|
term.clear();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
/**
|
||||||
|
* Color command - Change color scheme
|
||||||
|
*/
|
||||||
|
export default {
|
||||||
|
description: 'Change color scheme',
|
||||||
|
execute: (term, writeClickable, VERSION, args) => {
|
||||||
|
const scheme = args[0] || '';
|
||||||
|
const schemes = {
|
||||||
|
green: { bg: '#001800', fg: '#00ff00', border: '#0f0' },
|
||||||
|
amber: { bg: '#1a0f00', fg: '#ffb000', border: '#ffb000' },
|
||||||
|
blue: { bg: '#000818', fg: '#00a0ff', border: '#00a0ff' },
|
||||||
|
white: { bg: '#0a0a0a', fg: '#e0e0e0', border: '#999' }
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!scheme || !schemes[scheme]) {
|
||||||
|
return [
|
||||||
|
'',
|
||||||
|
' Available color schemes:',
|
||||||
|
' • green - Classic green terminal',
|
||||||
|
' • amber - Amber monochrome',
|
||||||
|
' • blue - IBM blue',
|
||||||
|
' • white - White phosphor',
|
||||||
|
'',
|
||||||
|
' Usage: color [scheme]',
|
||||||
|
''
|
||||||
|
].join('\r\n');
|
||||||
|
}
|
||||||
|
|
||||||
|
const colors = schemes[scheme];
|
||||||
|
term.options.theme.background = colors.bg;
|
||||||
|
term.options.theme.foreground = colors.fg;
|
||||||
|
document.querySelector('.container').style.borderColor = colors.border;
|
||||||
|
document.querySelector('.container').style.background = colors.bg;
|
||||||
|
document.body.style.color = colors.fg;
|
||||||
|
|
||||||
|
return `\r\n Color scheme changed to: ${scheme}\r\n`;
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
/**
|
||||||
|
* Contact command - Contact information
|
||||||
|
*/
|
||||||
|
export default {
|
||||||
|
description: 'Contact information',
|
||||||
|
execute: () => {
|
||||||
|
return [
|
||||||
|
'',
|
||||||
|
' Contact Information:',
|
||||||
|
' ────────────────────',
|
||||||
|
' Email: contact@lit.ruv.wtf',
|
||||||
|
' Web: https://lit.ruv.wtf',
|
||||||
|
''
|
||||||
|
].join('\r\n');
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
/**
|
||||||
|
* Date command - Display current date and time
|
||||||
|
*/
|
||||||
|
export default {
|
||||||
|
description: 'Display current date and time',
|
||||||
|
execute: () => {
|
||||||
|
const now = new Date();
|
||||||
|
return [
|
||||||
|
'',
|
||||||
|
' ' + now.toLocaleDateString('en-US', {
|
||||||
|
weekday: 'long',
|
||||||
|
year: 'numeric',
|
||||||
|
month: 'long',
|
||||||
|
day: 'numeric'
|
||||||
|
}),
|
||||||
|
' ' + now.toLocaleTimeString('en-US'),
|
||||||
|
''
|
||||||
|
].join('\r\n');
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
/**
|
||||||
|
* Echo command - Echo back message
|
||||||
|
*/
|
||||||
|
export default {
|
||||||
|
description: 'Echo back message',
|
||||||
|
execute: (term, writeClickable, VERSION, args) => {
|
||||||
|
return args.join(' ') || '';
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
/**
|
||||||
|
* GitHub command - Open GitHub repository
|
||||||
|
*/
|
||||||
|
export default {
|
||||||
|
description: 'Open GitHub repository',
|
||||||
|
execute: () => {
|
||||||
|
return '\r\n Opening GitHub...\r\n (This would open your repository URL)\r\n';
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
/**
|
||||||
|
* Help command - Display available commands
|
||||||
|
*/
|
||||||
|
export default {
|
||||||
|
description: 'Display available commands',
|
||||||
|
execute: (term, writeClickable) => {
|
||||||
|
term.writeln('');
|
||||||
|
term.writeln('╔════════════════════════════════════════════════════════════╗');
|
||||||
|
term.writeln('║ AVAILABLE COMMANDS ║');
|
||||||
|
term.writeln('╚════════════════════════════════════════════════════════════╝');
|
||||||
|
term.writeln('');
|
||||||
|
writeClickable(' [command=help] - Display this help message');
|
||||||
|
writeClickable(' [command=about] - Information about this terminal');
|
||||||
|
writeClickable(' [command=clear] - Clear the terminal screen');
|
||||||
|
term.writeln(' echo - Echo back your message (usage: echo [message])');
|
||||||
|
writeClickable(' [command=date] - Display current date and time');
|
||||||
|
writeClickable(' [command=whoami] - Display current user information');
|
||||||
|
writeClickable(' [command=history] - Show command history');
|
||||||
|
writeClickable(' [command=color] - Change terminal color scheme');
|
||||||
|
writeClickable(' [command=banner] - Display welcome banner');
|
||||||
|
writeClickable(' [command=bluesky] - Fetch recent posts from Bluesky');
|
||||||
|
writeClickable(' [command=chat] - Enter interactive chat (type /quit to exit)');
|
||||||
|
writeClickable(' [command=github] - Visit GitHub repository');
|
||||||
|
writeClickable(' [command=contact] - Display contact information');
|
||||||
|
writeClickable(' [command=privacy] - Display privacy policy');
|
||||||
|
term.writeln('');
|
||||||
|
term.writeln('Navigate: Use ↑/↓ arrows for command history');
|
||||||
|
term.writeln('Mouse: Click commands to run them');
|
||||||
|
term.writeln('');
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
/**
|
||||||
|
* History command - Show command history
|
||||||
|
*/
|
||||||
|
export default {
|
||||||
|
description: 'Show command history',
|
||||||
|
execute: (term, writeClickable, VERSION, args, commandHistory) => {
|
||||||
|
if (commandHistory.length === 0) {
|
||||||
|
return '\r\n No command history yet.\r\n';
|
||||||
|
}
|
||||||
|
let output = ['\r\n Command History:', ' ───────────────'];
|
||||||
|
commandHistory.forEach((cmd, idx) => {
|
||||||
|
output.push(` ${(idx + 1).toString().padStart(3, ' ')} ${cmd}`);
|
||||||
|
});
|
||||||
|
output.push('');
|
||||||
|
return output.join('\r\n');
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
/**
|
||||||
|
* Privacy command - Privacy policy
|
||||||
|
*/
|
||||||
|
export default {
|
||||||
|
description: 'Privacy policy',
|
||||||
|
execute: () => {
|
||||||
|
return [
|
||||||
|
'',
|
||||||
|
'╔════════════════════════════════════════════════════════════╗',
|
||||||
|
'║ PRIVACY POLICY ║',
|
||||||
|
'╚════════════════════════════════════════════════════════════╝',
|
||||||
|
'',
|
||||||
|
' Data Collection:',
|
||||||
|
' ────────────────',
|
||||||
|
' • This terminal uses localStorage to save your chat session',
|
||||||
|
' • Chat messages are stored on our Matrix homeserver',
|
||||||
|
' • No cookies or tracking scripts are used',
|
||||||
|
' • No analytics or third-party tracking',
|
||||||
|
'',
|
||||||
|
' Matrix Chat:',
|
||||||
|
' ────────────',
|
||||||
|
' • Chat credentials stored locally in your browser',
|
||||||
|
' • Messages sent through Matrix protocol (b.ruv.wtf)',
|
||||||
|
' • Use "chat disconnect" to clear stored credentials',
|
||||||
|
'',
|
||||||
|
' Your Rights:',
|
||||||
|
' ────────────',
|
||||||
|
' • Clear localStorage anytime via browser settings',
|
||||||
|
' • Request data deletion: contact@lit.ruv.wtf',
|
||||||
|
' • All code is open source and auditable',
|
||||||
|
'',
|
||||||
|
' Updates: Privacy policy last updated March 2026',
|
||||||
|
''
|
||||||
|
].join('\r\n');
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
/**
|
||||||
|
* Whoami command - Display user information
|
||||||
|
*/
|
||||||
|
export default {
|
||||||
|
description: 'Display user information',
|
||||||
|
execute: () => {
|
||||||
|
return [
|
||||||
|
'',
|
||||||
|
' User: visitor@lit.ruv.wtf',
|
||||||
|
' Session: ' + Date.now(),
|
||||||
|
' Terminal: xterm.js',
|
||||||
|
''
|
||||||
|
].join('\r\n');
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -489,6 +489,29 @@ body.keyboard-open .status-bar {
|
|||||||
padding: 3px 8px;
|
padding: 3px 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Small viewport (under 1280x720) - detected via JS */
|
||||||
|
body.small-viewport .crt-border-overlay {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.small-viewport .container,
|
||||||
|
body.small-viewport .boot-screen {
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
border-radius: 0;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.small-viewport .terminal-header {
|
||||||
|
border-bottom: 1px solid #0f0;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.small-viewport .status-bar {
|
||||||
|
border-top: 1px solid #0f0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Scrollbar styling */
|
/* Scrollbar styling */
|
||||||
::-webkit-scrollbar {
|
::-webkit-scrollbar {
|
||||||
width: 8px;
|
width: 8px;
|
||||||
|
|||||||
+91
-273
@@ -1,3 +1,18 @@
|
|||||||
|
// Import commands
|
||||||
|
import helpCmd from './scripts/commands/help.js';
|
||||||
|
import aboutCmd from './scripts/commands/about.js';
|
||||||
|
import clearCmd from './scripts/commands/clear.js';
|
||||||
|
import echoCmd from './scripts/commands/echo.js';
|
||||||
|
import dateCmd from './scripts/commands/date.js';
|
||||||
|
import whoamiCmd from './scripts/commands/whoami.js';
|
||||||
|
import historyCmd from './scripts/commands/history.js';
|
||||||
|
import colorCmd from './scripts/commands/color.js';
|
||||||
|
import bannerCmd from './scripts/commands/banner.js';
|
||||||
|
import githubCmd from './scripts/commands/github.js';
|
||||||
|
import contactCmd from './scripts/commands/contact.js';
|
||||||
|
import privacyCmd from './scripts/commands/privacy.js';
|
||||||
|
import blueskyCmd from './scripts/commands/bluesky.js';
|
||||||
|
|
||||||
// Version
|
// Version
|
||||||
const VERSION = '1.0.0';
|
const VERSION = '1.0.0';
|
||||||
|
|
||||||
@@ -108,7 +123,9 @@ term.registerLinkProvider({
|
|||||||
// Adjust font size based on screen width
|
// Adjust font size based on screen width
|
||||||
function adjustFontSize() {
|
function adjustFontSize() {
|
||||||
const width = window.innerWidth;
|
const width = window.innerWidth;
|
||||||
if (width < 480) {
|
if (width < 350) {
|
||||||
|
term.options.fontSize = 8;
|
||||||
|
} else if (width < 480) {
|
||||||
term.options.fontSize = 10;
|
term.options.fontSize = 10;
|
||||||
} else if (width < 768) {
|
} else if (width < 768) {
|
||||||
term.options.fontSize = 12;
|
term.options.fontSize = 12;
|
||||||
@@ -120,9 +137,24 @@ function adjustFontSize() {
|
|||||||
|
|
||||||
adjustFontSize();
|
adjustFontSize();
|
||||||
|
|
||||||
|
// Check viewport size for border display
|
||||||
|
function checkViewportSize() {
|
||||||
|
const width = window.innerWidth;
|
||||||
|
const height = window.innerHeight;
|
||||||
|
|
||||||
|
if (width < 1280 || height < 720) {
|
||||||
|
document.body.classList.add('small-viewport');
|
||||||
|
} else {
|
||||||
|
document.body.classList.remove('small-viewport');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
checkViewportSize();
|
||||||
|
|
||||||
// Make terminal responsive
|
// Make terminal responsive
|
||||||
window.addEventListener('resize', () => {
|
window.addEventListener('resize', () => {
|
||||||
adjustFontSize();
|
adjustFontSize();
|
||||||
|
checkViewportSize();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Mobile keyboard detection using Visual Viewport API
|
// Mobile keyboard detection using Visual Viewport API
|
||||||
@@ -147,6 +179,7 @@ function checkKeyboardState() {
|
|||||||
if (window.visualViewport) {
|
if (window.visualViewport) {
|
||||||
window.visualViewport.addEventListener('resize', () => {
|
window.visualViewport.addEventListener('resize', () => {
|
||||||
checkKeyboardState();
|
checkKeyboardState();
|
||||||
|
checkViewportSize();
|
||||||
adjustFontSize();
|
adjustFontSize();
|
||||||
setTimeout(positionInlineInput, 50);
|
setTimeout(positionInlineInput, 50);
|
||||||
});
|
});
|
||||||
@@ -156,6 +189,7 @@ if (window.visualViewport) {
|
|||||||
window.addEventListener('orientationchange', () => {
|
window.addEventListener('orientationchange', () => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
initialViewportHeight = window.innerHeight;
|
initialViewportHeight = window.innerHeight;
|
||||||
|
checkViewportSize();
|
||||||
}, 300);
|
}, 300);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -306,7 +340,12 @@ async function enterChatMode() {
|
|||||||
term.writeln('');
|
term.writeln('');
|
||||||
term.writeln('─'.repeat(term.cols || 60));
|
term.writeln('─'.repeat(term.cols || 60));
|
||||||
term.write('\x1b[1;32m>\x1b[0m ');
|
term.write('\x1b[1;32m>\x1b[0m ');
|
||||||
showInlineInput();
|
|
||||||
|
// Delay showing input to ensure terminal has rendered and cursor is positioned
|
||||||
|
setTimeout(() => {
|
||||||
|
showInlineInput();
|
||||||
|
}, 50);
|
||||||
|
|
||||||
updateQuickCommands('chat');
|
updateQuickCommands('chat');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -452,6 +491,12 @@ function renderChatMessage(msg) {
|
|||||||
|
|
||||||
// Redraw prompt with current input
|
// Redraw prompt with current input
|
||||||
term.write(`\x1b[1;32m>\x1b[0m ${chatMode.inputLine}`);
|
term.write(`\x1b[1;32m>\x1b[0m ${chatMode.inputLine}`);
|
||||||
|
|
||||||
|
// Scroll to bottom to show new message
|
||||||
|
term.scrollToBottom();
|
||||||
|
|
||||||
|
// Reposition the inline input after terminal updates
|
||||||
|
setTimeout(() => positionInlineInput(), 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Render chat input prompt (efficiently)
|
// Render chat input prompt (efficiently)
|
||||||
@@ -498,295 +543,56 @@ async function sendChatMessage(message) {
|
|||||||
// Available commands
|
// Available commands
|
||||||
const commands = {
|
const commands = {
|
||||||
help: {
|
help: {
|
||||||
description: 'Display available commands',
|
description: helpCmd.description,
|
||||||
execute: () => {
|
execute: (args) => helpCmd.execute(term, writeClickable, VERSION, args, commandHistory)
|
||||||
term.writeln('');
|
|
||||||
term.writeln('╔════════════════════════════════════════════════════════════╗');
|
|
||||||
term.writeln('║ AVAILABLE COMMANDS ║');
|
|
||||||
term.writeln('╚════════════════════════════════════════════════════════════╝');
|
|
||||||
term.writeln('');
|
|
||||||
writeClickable(' [command=help] - Display this help message');
|
|
||||||
writeClickable(' [command=about] - Information about this terminal');
|
|
||||||
writeClickable(' [command=clear] - Clear the terminal screen');
|
|
||||||
term.writeln(' echo - Echo back your message (usage: echo [message])');
|
|
||||||
writeClickable(' [command=date] - Display current date and time');
|
|
||||||
writeClickable(' [command=whoami] - Display current user information');
|
|
||||||
writeClickable(' [command=history] - Show command history');
|
|
||||||
writeClickable(' [command=color] - Change terminal color scheme');
|
|
||||||
writeClickable(' [command=banner] - Display welcome banner');
|
|
||||||
writeClickable(' [command=bluesky] - Fetch recent posts from Bluesky');
|
|
||||||
writeClickable(' [command=chat] - Enter interactive chat (type /quit to exit)');
|
|
||||||
writeClickable(' [command=github] - Visit GitHub repository');
|
|
||||||
writeClickable(' [command=contact] - Display contact information');
|
|
||||||
writeClickable(' [command=privacy] - Display privacy policy');
|
|
||||||
term.writeln('');
|
|
||||||
term.writeln('Navigate: Use ↑/↓ arrows for command history');
|
|
||||||
term.writeln('Mouse: Click commands to run them');
|
|
||||||
term.writeln('');
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
about: {
|
about: {
|
||||||
description: 'About this terminal',
|
description: aboutCmd.description,
|
||||||
execute: () => {
|
execute: (args) => aboutCmd.execute(term, writeClickable, VERSION, args, commandHistory)
|
||||||
return [
|
|
||||||
'',
|
|
||||||
'╔════════════════════════════════════════════════════════════╗',
|
|
||||||
'║ LIT.RUV.WTF TERMINAL ║',
|
|
||||||
'╚════════════════════════════════════════════════════════════╝',
|
|
||||||
'',
|
|
||||||
' A classic terminal interface built with xterm.js',
|
|
||||||
' Features: Keyboard navigation, Mouse support, CRT effects',
|
|
||||||
' Version: ' + VERSION,
|
|
||||||
' Built: ' + new Date().getFullYear(),
|
|
||||||
'',
|
|
||||||
' Technologies:',
|
|
||||||
' • xterm.js - Terminal emulator',
|
|
||||||
' • JavaScript - Terminal logic',
|
|
||||||
' • CSS3 - Classic CRT styling',
|
|
||||||
''
|
|
||||||
].join('\r\n');
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
clear: {
|
clear: {
|
||||||
description: 'Clear terminal screen',
|
description: clearCmd.description,
|
||||||
execute: () => {
|
execute: (args) => clearCmd.execute(term, writeClickable, VERSION, args, commandHistory)
|
||||||
term.clear();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
echo: {
|
echo: {
|
||||||
description: 'Echo back message',
|
description: echoCmd.description,
|
||||||
execute: (args) => {
|
execute: (args) => echoCmd.execute(term, writeClickable, VERSION, args, commandHistory)
|
||||||
return args.join(' ') || '';
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
date: {
|
date: {
|
||||||
description: 'Display current date and time',
|
description: dateCmd.description,
|
||||||
execute: () => {
|
execute: (args) => dateCmd.execute(term, writeClickable, VERSION, args, commandHistory)
|
||||||
const now = new Date();
|
|
||||||
return [
|
|
||||||
'',
|
|
||||||
' ' + now.toLocaleDateString('en-US', {
|
|
||||||
weekday: 'long',
|
|
||||||
year: 'numeric',
|
|
||||||
month: 'long',
|
|
||||||
day: 'numeric'
|
|
||||||
}),
|
|
||||||
' ' + now.toLocaleTimeString('en-US'),
|
|
||||||
''
|
|
||||||
].join('\r\n');
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
whoami: {
|
whoami: {
|
||||||
description: 'Display user information',
|
description: whoamiCmd.description,
|
||||||
execute: () => {
|
execute: (args) => whoamiCmd.execute(term, writeClickable, VERSION, args, commandHistory)
|
||||||
return [
|
|
||||||
'',
|
|
||||||
' User: visitor@lit.ruv.wtf',
|
|
||||||
' Session: ' + Date.now(),
|
|
||||||
' Terminal: xterm.js',
|
|
||||||
''
|
|
||||||
].join('\r\n');
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
history: {
|
history: {
|
||||||
description: 'Show command history',
|
description: historyCmd.description,
|
||||||
execute: () => {
|
execute: (args) => historyCmd.execute(term, writeClickable, VERSION, args, commandHistory)
|
||||||
if (commandHistory.length === 0) {
|
|
||||||
return '\r\n No command history yet.\r\n';
|
|
||||||
}
|
|
||||||
let output = ['\r\n Command History:', ' ───────────────'];
|
|
||||||
commandHistory.forEach((cmd, idx) => {
|
|
||||||
output.push(` ${(idx + 1).toString().padStart(3, ' ')} ${cmd}`);
|
|
||||||
});
|
|
||||||
output.push('');
|
|
||||||
return output.join('\r\n');
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
color: {
|
color: {
|
||||||
description: 'Change color scheme',
|
description: colorCmd.description,
|
||||||
execute: (args) => {
|
execute: (args) => colorCmd.execute(term, writeClickable, VERSION, args, commandHistory)
|
||||||
const scheme = args[0] || '';
|
|
||||||
const schemes = {
|
|
||||||
green: { bg: '#001800', fg: '#00ff00', border: '#0f0' },
|
|
||||||
amber: { bg: '#1a0f00', fg: '#ffb000', border: '#ffb000' },
|
|
||||||
blue: { bg: '#000818', fg: '#00a0ff', border: '#00a0ff' },
|
|
||||||
white: { bg: '#0a0a0a', fg: '#e0e0e0', border: '#999' }
|
|
||||||
};
|
|
||||||
|
|
||||||
if (!scheme || !schemes[scheme]) {
|
|
||||||
return [
|
|
||||||
'',
|
|
||||||
' Available color schemes:',
|
|
||||||
' • green - Classic green terminal',
|
|
||||||
' • amber - Amber monochrome',
|
|
||||||
' • blue - IBM blue',
|
|
||||||
' • white - White phosphor',
|
|
||||||
'',
|
|
||||||
' Usage: color [scheme]',
|
|
||||||
''
|
|
||||||
].join('\r\n');
|
|
||||||
}
|
|
||||||
|
|
||||||
const colors = schemes[scheme];
|
|
||||||
term.options.theme.background = colors.bg;
|
|
||||||
term.options.theme.foreground = colors.fg;
|
|
||||||
document.querySelector('.container').style.borderColor = colors.border;
|
|
||||||
document.querySelector('.container').style.background = colors.bg;
|
|
||||||
document.body.style.color = colors.fg;
|
|
||||||
|
|
||||||
return `\r\n Color scheme changed to: ${scheme}\r\n`;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
banner: {
|
banner: {
|
||||||
description: 'Display welcome banner',
|
description: bannerCmd.description,
|
||||||
execute: () => {
|
execute: (args) => bannerCmd.execute(term, writeClickable, VERSION, args, commandHistory, welcomeBannerFull, welcomeBannerCompact, welcomeBannerMinimal)
|
||||||
const cols = term.cols;
|
|
||||||
if (cols >= 78) {
|
|
||||||
term.writeln(welcomeBannerFull.split('\r\n').slice(0, -3).join('\r\n'));
|
|
||||||
writeClickable(' Type [command=help] for available commands.');
|
|
||||||
term.writeln(' Use ↑/↓ arrows to navigate command history.');
|
|
||||||
term.writeln('');
|
|
||||||
} else if (cols >= 40) {
|
|
||||||
term.writeln(welcomeBannerCompact.split('\r\n').slice(0, -2).join('\r\n'));
|
|
||||||
writeClickable(' Welcome! Type [command=help] for commands.');
|
|
||||||
term.writeln('');
|
|
||||||
} else {
|
|
||||||
term.writeln(welcomeBannerMinimal.split('\r\n').slice(0, -2).join('\r\n'));
|
|
||||||
writeClickable(' Type [command=help]');
|
|
||||||
term.writeln('');
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
github: {
|
github: {
|
||||||
description: 'Open GitHub repository',
|
description: githubCmd.description,
|
||||||
execute: () => {
|
execute: (args) => githubCmd.execute(term, writeClickable, VERSION, args, commandHistory)
|
||||||
return '\r\n Opening GitHub...\r\n (This would open your repository URL)\r\n';
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
contact: {
|
contact: {
|
||||||
description: 'Contact information',
|
description: contactCmd.description,
|
||||||
execute: () => {
|
execute: (args) => contactCmd.execute(term, writeClickable, VERSION, args, commandHistory)
|
||||||
return [
|
|
||||||
'',
|
|
||||||
' Contact Information:',
|
|
||||||
' ────────────────────',
|
|
||||||
' Email: contact@lit.ruv.wtf',
|
|
||||||
' Web: https://lit.ruv.wtf',
|
|
||||||
''
|
|
||||||
].join('\r\n');
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
privacy: {
|
privacy: {
|
||||||
description: 'Privacy policy',
|
description: privacyCmd.description,
|
||||||
execute: () => {
|
execute: (args) => privacyCmd.execute(term, writeClickable, VERSION, args, commandHistory)
|
||||||
return [
|
|
||||||
'',
|
|
||||||
'╔════════════════════════════════════════════════════════════╗',
|
|
||||||
'║ PRIVACY POLICY ║',
|
|
||||||
'╚════════════════════════════════════════════════════════════╝',
|
|
||||||
'',
|
|
||||||
' Data Collection:',
|
|
||||||
' ────────────────',
|
|
||||||
' • This terminal uses localStorage to save your chat session',
|
|
||||||
' • Chat messages are stored on our Matrix homeserver',
|
|
||||||
' • No cookies or tracking scripts are used',
|
|
||||||
' • No analytics or third-party tracking',
|
|
||||||
'',
|
|
||||||
' Matrix Chat:',
|
|
||||||
' ────────────',
|
|
||||||
' • Chat credentials stored locally in your browser',
|
|
||||||
' • Messages sent through Matrix protocol (b.ruv.wtf)',
|
|
||||||
' • Use "chat disconnect" to clear stored credentials',
|
|
||||||
'',
|
|
||||||
' Your Rights:',
|
|
||||||
' ────────────',
|
|
||||||
' • Clear localStorage anytime via browser settings',
|
|
||||||
' • Request data deletion: contact@lit.ruv.wtf',
|
|
||||||
' • All code is open source and auditable',
|
|
||||||
'',
|
|
||||||
' Updates: Privacy policy last updated March 2026',
|
|
||||||
''
|
|
||||||
].join('\r\n');
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
bluesky: {
|
bluesky: {
|
||||||
description: 'Fetch recent posts from Bluesky',
|
description: blueskyCmd.description,
|
||||||
execute: async (args) => {
|
execute: async (args) => await blueskyCmd.execute(term, writeClickable, VERSION, args, commandHistory)
|
||||||
const actor = 'lit.mates.dev';
|
|
||||||
const limit = args[0] ? parseInt(args[0]) : 5;
|
|
||||||
|
|
||||||
try {
|
|
||||||
term.writeln('\r\n Fetching posts from Bluesky...\r\n');
|
|
||||||
|
|
||||||
const response = await fetch(
|
|
||||||
`https://public.api.bsky.app/xrpc/app.bsky.feed.getAuthorFeed?actor=${actor}&limit=${limit}`
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!response.ok) {
|
|
||||||
return ' Error: Unable to fetch Bluesky posts';
|
|
||||||
}
|
|
||||||
|
|
||||||
const data = await response.json();
|
|
||||||
|
|
||||||
if (!data.feed || data.feed.length === 0) {
|
|
||||||
return ' No posts found.';
|
|
||||||
}
|
|
||||||
|
|
||||||
let output = [' ╔════════════════════════════════════════════════════╗'];
|
|
||||||
output.push(' ║ BLUESKY POSTS - @lit.mates.dev ║');
|
|
||||||
output.push(' ╚════════════════════════════════════════════════════╝');
|
|
||||||
output.push('');
|
|
||||||
|
|
||||||
// Reverse to show oldest first, latest at bottom
|
|
||||||
const reversedFeed = [...data.feed].reverse();
|
|
||||||
|
|
||||||
reversedFeed.forEach((item, idx) => {
|
|
||||||
const post = item.post;
|
|
||||||
const text = post.record.text;
|
|
||||||
const createdAt = new Date(post.record.createdAt);
|
|
||||||
const date = createdAt.toLocaleDateString();
|
|
||||||
const time = createdAt.toLocaleTimeString('en-US', {
|
|
||||||
hour: '2-digit',
|
|
||||||
minute: '2-digit'
|
|
||||||
});
|
|
||||||
|
|
||||||
// Extract post ID from URI (at://did:plc:xxx/app.bsky.feed.post/{postId})
|
|
||||||
const postId = post.uri.split('/').pop();
|
|
||||||
const postUrl = `https://bsky.app/profile/${actor}/post/${postId}`;
|
|
||||||
|
|
||||||
output.push(` [${idx + 1}] ${date} ${time}`);
|
|
||||||
output.push(` ${postUrl}`);
|
|
||||||
output.push(' ────────────────────────────────────────');
|
|
||||||
|
|
||||||
// Wrap text to max 50 chars
|
|
||||||
const words = text.split(' ');
|
|
||||||
let line = ' ';
|
|
||||||
words.forEach(word => {
|
|
||||||
if (line.length + word.length + 1 > 52) {
|
|
||||||
output.push(line);
|
|
||||||
line = ' ' + word;
|
|
||||||
} else {
|
|
||||||
line += (line.length > 2 ? ' ' : '') + word;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (line.length > 2) output.push(line);
|
|
||||||
|
|
||||||
output.push('');
|
|
||||||
output.push(` ♡ ${post.likeCount || 0} ↻ ${post.repostCount || 0} 💬 ${post.replyCount || 0}`);
|
|
||||||
output.push('');
|
|
||||||
});
|
|
||||||
|
|
||||||
output.push(` Usage: bluesky [count] (default: 5, max: 20)`);
|
|
||||||
output.push('');
|
|
||||||
|
|
||||||
return output.join('\r\n');
|
|
||||||
} catch (error) {
|
|
||||||
return ' Error: Failed to connect to Bluesky API';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
chat: {
|
chat: {
|
||||||
description: 'Connect to chat room',
|
description: 'Connect to chat room',
|
||||||
@@ -1039,7 +845,12 @@ const welcomeBannerMinimal = [
|
|||||||
// Get appropriate banner based on terminal width
|
// Get appropriate banner based on terminal width
|
||||||
function getWelcomeBanner() {
|
function getWelcomeBanner() {
|
||||||
const cols = term.cols;
|
const cols = term.cols;
|
||||||
if (cols >= 78) {
|
const width = window.innerWidth;
|
||||||
|
|
||||||
|
// Use minimal mode for very narrow screens
|
||||||
|
if (width < 350 || cols < 30) {
|
||||||
|
return welcomeBannerMinimal;
|
||||||
|
} else if (cols >= 78) {
|
||||||
return welcomeBannerFull;
|
return welcomeBannerFull;
|
||||||
} else if (cols >= 40) {
|
} else if (cols >= 40) {
|
||||||
return welcomeBannerCompact;
|
return welcomeBannerCompact;
|
||||||
@@ -1117,10 +928,10 @@ async function submitInlineInput() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write what user typed
|
|
||||||
term.write(rawValue + '\r\n');
|
|
||||||
|
|
||||||
if (cmd === '/help') {
|
if (cmd === '/help') {
|
||||||
|
// Move cursor up to separator, clear it and the prompt
|
||||||
|
term.write('\x1b[1A\x1b[2K\r');
|
||||||
|
|
||||||
term.writeln('\x1b[33mChat Commands:\x1b[0m');
|
term.writeln('\x1b[33mChat Commands:\x1b[0m');
|
||||||
term.writeln(' /help - Show this help message');
|
term.writeln(' /help - Show this help message');
|
||||||
term.writeln(' /nick [name] - Change your display name');
|
term.writeln(' /nick [name] - Change your display name');
|
||||||
@@ -1133,6 +944,10 @@ async function submitInlineInput() {
|
|||||||
|
|
||||||
if (cmd.startsWith('/nick ')) {
|
if (cmd.startsWith('/nick ')) {
|
||||||
const newNick = cmd.substring(6).trim();
|
const newNick = cmd.substring(6).trim();
|
||||||
|
|
||||||
|
// Move cursor up to separator, clear it
|
||||||
|
term.write('\x1b[1A\x1b[2K\r');
|
||||||
|
|
||||||
if (!newNick) {
|
if (!newNick) {
|
||||||
term.writeln('\x1b[31mError: /nick [name]\x1b[0m');
|
term.writeln('\x1b[31mError: /nick [name]\x1b[0m');
|
||||||
} else {
|
} else {
|
||||||
@@ -1171,15 +986,18 @@ async function submitInlineInput() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (cmd && !cmd.startsWith('/')) {
|
if (cmd && !cmd.startsWith('/')) {
|
||||||
|
// Don't write the message here - let sync handle it
|
||||||
await sendChatMessage(cmd);
|
await sendChatMessage(cmd);
|
||||||
setTimeout(() => positionInlineInput(), 10);
|
return;
|
||||||
} else if (cmd.startsWith('/')) {
|
} else if (cmd.startsWith('/')) {
|
||||||
|
// Move cursor up to separator, clear it
|
||||||
|
term.write('\x1b[1A\x1b[2K\r');
|
||||||
term.writeln(`\x1b[31mUnknown command: ${cmd.split(' ')[0]}. Type /help\x1b[0m`);
|
term.writeln(`\x1b[31mUnknown command: ${cmd.split(' ')[0]}. Type /help\x1b[0m`);
|
||||||
term.writeln('─'.repeat(term.cols || 60));
|
term.writeln('─'.repeat(term.cols || 60));
|
||||||
term.write('\x1b[1;32m>\x1b[0m ');
|
term.write('\x1b[1;32m>\x1b[0m ');
|
||||||
setTimeout(() => positionInlineInput(), 10);
|
setTimeout(() => positionInlineInput(), 10);
|
||||||
} else {
|
} else {
|
||||||
term.write('\x1b[1;32m>\x1b[0m ');
|
// Empty message, just reposition the prompt
|
||||||
setTimeout(() => positionInlineInput(), 10);
|
setTimeout(() => positionInlineInput(), 10);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in new issue
Block a user