@prozilla-os/terminal 1.1.21 → 1.1.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/dist/main.d.ts +1602 -64
  2. package/dist/main.js +744 -7
  3. package/dist/main.js.map +1 -1
  4. package/package.json +9 -8
  5. package/dist/chunks/cat-DGK7wWrK.js +0 -16
  6. package/dist/chunks/cat-DGK7wWrK.js.map +0 -1
  7. package/dist/chunks/cd-DvjkW_6o.js +0 -15
  8. package/dist/chunks/cd-DvjkW_6o.js.map +0 -1
  9. package/dist/chunks/clear-BF9eb1Dq.js +0 -14
  10. package/dist/chunks/clear-BF9eb1Dq.js.map +0 -1
  11. package/dist/chunks/cmatrix-VYovsHQW.js +0 -59
  12. package/dist/chunks/cmatrix-VYovsHQW.js.map +0 -1
  13. package/dist/chunks/compgen-3TwdgHm_.js +0 -13
  14. package/dist/chunks/compgen-3TwdgHm_.js.map +0 -1
  15. package/dist/chunks/cowsay-IfArfPSJ.js +0 -49
  16. package/dist/chunks/cowsay-IfArfPSJ.js.map +0 -1
  17. package/dist/chunks/dir-B_Ipo5xb.js +0 -11
  18. package/dist/chunks/dir-B_Ipo5xb.js.map +0 -1
  19. package/dist/chunks/echo-DX-Ar2Ut.js +0 -11
  20. package/dist/chunks/echo-DX-Ar2Ut.js.map +0 -1
  21. package/dist/chunks/eval-C7InkmFY.js +0 -14
  22. package/dist/chunks/eval-C7InkmFY.js.map +0 -1
  23. package/dist/chunks/exit-D7PPqtiE.js +0 -11
  24. package/dist/chunks/exit-D7PPqtiE.js.map +0 -1
  25. package/dist/chunks/fortune-zyxpnYNP.js +0 -59
  26. package/dist/chunks/fortune-zyxpnYNP.js.map +0 -1
  27. package/dist/chunks/help-BEgNbwLL.js +0 -17
  28. package/dist/chunks/help-BEgNbwLL.js.map +0 -1
  29. package/dist/chunks/history-l0sNRNKZ.js +0 -2
  30. package/dist/chunks/history-l0sNRNKZ.js.map +0 -1
  31. package/dist/chunks/hostname-DU1lQde2.js +0 -11
  32. package/dist/chunks/hostname-DU1lQde2.js.map +0 -1
  33. package/dist/chunks/lolcat-5-mBWD9l.js +0 -35
  34. package/dist/chunks/lolcat-5-mBWD9l.js.map +0 -1
  35. package/dist/chunks/ls-DnkSPHVM.js +0 -18
  36. package/dist/chunks/ls-DnkSPHVM.js.map +0 -1
  37. package/dist/chunks/main-CXiltWT-.js +0 -957
  38. package/dist/chunks/main-CXiltWT-.js.map +0 -1
  39. package/dist/chunks/make-DqVQDThH.js +0 -9
  40. package/dist/chunks/make-DqVQDThH.js.map +0 -1
  41. package/dist/chunks/man-D_hBUTDt.js +0 -47
  42. package/dist/chunks/man-D_hBUTDt.js.map +0 -1
  43. package/dist/chunks/mkdir-BCvMrPTX.js +0 -11
  44. package/dist/chunks/mkdir-BCvMrPTX.js.map +0 -1
  45. package/dist/chunks/neofetch-BFHOITJj.js +0 -40
  46. package/dist/chunks/neofetch-BFHOITJj.js.map +0 -1
  47. package/dist/chunks/pwd-C21tQanw.js +0 -11
  48. package/dist/chunks/pwd-C21tQanw.js.map +0 -1
  49. package/dist/chunks/reboot-C2t7a3Av.js +0 -11
  50. package/dist/chunks/reboot-C2t7a3Av.js.map +0 -1
  51. package/dist/chunks/reload-C9o_dGZw.js +0 -10
  52. package/dist/chunks/reload-C9o_dGZw.js.map +0 -1
  53. package/dist/chunks/rev-CBibYebM.js +0 -11
  54. package/dist/chunks/rev-CBibYebM.js.map +0 -1
  55. package/dist/chunks/rm-ChTrwld4.js +0 -12
  56. package/dist/chunks/rm-ChTrwld4.js.map +0 -1
  57. package/dist/chunks/rmdir-CUM4xt2w.js +0 -11
  58. package/dist/chunks/rmdir-CUM4xt2w.js.map +0 -1
  59. package/dist/chunks/sl-DrATMkz6.js +0 -166
  60. package/dist/chunks/sl-DrATMkz6.js.map +0 -1
  61. package/dist/chunks/touch-CqBIAjMe.js +0 -19
  62. package/dist/chunks/touch-CqBIAjMe.js.map +0 -1
  63. package/dist/chunks/uptime-xM-0FRzA.js +0 -11
  64. package/dist/chunks/uptime-xM-0FRzA.js.map +0 -1
  65. package/dist/chunks/whatis-vXemLo9m.js +0 -13
  66. package/dist/chunks/whatis-vXemLo9m.js.map +0 -1
  67. package/dist/chunks/whoami-CnUR69yX.js +0 -11
  68. package/dist/chunks/whoami-CnUR69yX.js.map +0 -1
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
1
+ {"version":3,"file":"main.js","sources":["../../../../node_modules/anser/lib/index.js","../../../../node_modules/escape-carriage/index.js","../src/components/Ansi.tsx","../src/components/OutputLine.tsx","../src/components/InputLine.tsx","../src/components/Terminal.tsx","../src/core/terminalApp.ts","../src/main.ts"],"sourcesContent":["\"use strict\";\n\n// This file was originally written by @drudru (https://github.com/drudru/ansi_up), MIT, 2011\n\nconst ANSI_COLORS = [\n [\n { color: \"0, 0, 0\", \"class\": \"ansi-black\" }\n , { color: \"187, 0, 0\", \"class\": \"ansi-red\" }\n , { color: \"0, 187, 0\", \"class\": \"ansi-green\" }\n , { color: \"187, 187, 0\", \"class\": \"ansi-yellow\" }\n , { color: \"0, 0, 187\", \"class\": \"ansi-blue\" }\n , { color: \"187, 0, 187\", \"class\": \"ansi-magenta\" }\n , { color: \"0, 187, 187\", \"class\": \"ansi-cyan\" }\n , { color: \"255,255,255\", \"class\": \"ansi-white\" }\n ]\n , [\n { color: \"85, 85, 85\", \"class\": \"ansi-bright-black\" }\n , { color: \"255, 85, 85\", \"class\": \"ansi-bright-red\" }\n , { color: \"0, 255, 0\", \"class\": \"ansi-bright-green\" }\n , { color: \"255, 255, 85\", \"class\": \"ansi-bright-yellow\" }\n , { color: \"85, 85, 255\", \"class\": \"ansi-bright-blue\" }\n , { color: \"255, 85, 255\", \"class\": \"ansi-bright-magenta\" }\n , { color: \"85, 255, 255\", \"class\": \"ansi-bright-cyan\" }\n , { color: \"255, 255, 255\", \"class\": \"ansi-bright-white\" }\n ]\n];\n// https://datatracker.ietf.org/doc/html/rfc3986#appendix-A\nconst linkRegex = /(https?:\\/\\/(?:[A-Za-z0-9#;/?:@=+$',_.!~*()[\\]-]|&amp;|%[A-Fa-f0-9]{2})+)/gm;\n\nclass Anser {\n\n /**\n * Anser.escapeForHtml\n * Escape the input HTML.\n *\n * This does the minimum escaping of text to make it compliant with HTML.\n * In particular, the '&','<', and '>' characters are escaped. This should\n * be run prior to `ansiToHtml`.\n *\n * @name Anser.escapeForHtml\n * @function\n * @param {String} txt The input text (containing the ANSI snippets).\n * @returns {String} The escaped html.\n */\n static escapeForHtml (txt) {\n return new Anser().escapeForHtml(txt);\n }\n\n /**\n * Anser.linkify\n * Adds the links in the HTML.\n *\n * This replaces any links in the text with anchor tags that display the\n * link. You should apply this after you have run `ansiToHtml` on the text.\n *\n * @name Anser.linkify\n * @function\n * @param {String} txt The input text.\n * @returns {String} The HTML containing the <a> tags (unescaped).\n */\n static linkify (txt) {\n return new Anser().linkify(txt);\n }\n\n /**\n * Anser.ansiToHtml\n * This replaces ANSI terminal escape codes with SPAN tags that wrap the\n * content.\n *\n * This function only interprets ANSI SGR (Select Graphic Rendition) codes\n * that can be represented in HTML.\n * For example, cursor movement codes are ignored and hidden from output.\n * The default style uses colors that are very close to the prescribed\n * standard. The standard assumes that the text will have a black\n * background. These colors are set as inline styles on the SPAN tags.\n *\n * Another option is to set `use_classes: true` in the options argument.\n * This will instead set classes on the spans so the colors can be set via\n * CSS. The class names used are of the format `ansi-*-fg/bg` and\n * `ansi-bright-*-fg/bg` where `*` is the color name,\n * i.e black/red/green/yellow/blue/magenta/cyan/white.\n *\n * @name Anser.ansiToHtml\n * @function\n * @param {String} txt The input text.\n * @param {Object} options The options passed to the ansiToHTML method.\n * @returns {String} The HTML output.\n */\n static ansiToHtml (txt, options) {\n return new Anser().ansiToHtml(txt, options);\n }\n\n /**\n * Anser.ansiToJson\n * Converts ANSI input into JSON output.\n *\n * @name Anser.ansiToJson\n * @function\n * @param {String} txt The input text.\n * @param {Object} options The options passed to the ansiToHTML method.\n * @returns {String} The HTML output.\n */\n static ansiToJson (txt, options) {\n return new Anser().ansiToJson(txt, options);\n }\n\n /**\n * Anser.ansiToText\n * Converts ANSI input into text output.\n *\n * @name Anser.ansiToText\n * @function\n * @param {String} txt The input text.\n * @returns {String} The text output.\n */\n static ansiToText (txt) {\n return new Anser().ansiToText(txt);\n }\n\n /**\n * Anser\n * The `Anser` class.\n *\n * @name Anser\n * @function\n * @returns {Anser}\n */\n constructor () {\n this.fg = this.bg = this.fg_truecolor = this.bg_truecolor = null;\n this.bright = 0;\n this.decorations = [];\n }\n\n /**\n * setupPalette\n * Sets up the palette.\n *\n * @name setupPalette\n * @function\n */\n setupPalette () {\n this.PALETTE_COLORS = [];\n\n // Index 0..15 : System color\n for (let i = 0; i < 2; ++i) {\n for (let j = 0; j < 8; ++j) {\n this.PALETTE_COLORS.push(ANSI_COLORS[i][j].color);\n }\n }\n\n // Index 16..231 : RGB 6x6x6\n // https://gist.github.com/jasonm23/2868981#file-xterm-256color-yaml\n let levels = [0, 95, 135, 175, 215, 255];\n let format = (r, g, b) => levels[r] + \", \" + levels[g] + \", \" + levels[b];\n let r, g, b;\n for (let r = 0; r < 6; ++r) {\n for (let g = 0; g < 6; ++g) {\n for (let b = 0; b < 6; ++b) {\n this.PALETTE_COLORS.push(format(r, g, b));\n }\n }\n }\n\n // Index 232..255 : Grayscale\n let level = 8;\n for (let i = 0; i < 24; ++i, level += 10) {\n this.PALETTE_COLORS.push(level + \", \" + level + \", \" + level);\n }\n }\n\n /**\n * escapeForHtml\n * Escapes the input text.\n *\n * @name escapeForHtml\n * @function\n * @param {String} txt The input text.\n * @returns {String} The escpaed HTML output.\n */\n escapeForHtml (txt) {\n return txt.replace(/[&<>\\\"]/gm, str =>\n str == \"&\" ? \"&amp;\" :\n str == '\"' ? \"&quot;\" :\n str == \"<\" ? \"&lt;\" :\n str == \">\" ? \"&gt;\" : \"\"\n );\n }\n\n /**\n * linkify\n * Adds HTML link elements.\n *\n * @name linkify\n * @function\n * @param {String} txt The input text.\n * @returns {String} The HTML output containing link elements.\n */\n linkify (txt) {\n return txt.replace(linkRegex, str => `<a href=\"${str}\">${str}</a>`);\n }\n\n /**\n * ansiToHtml\n * Converts ANSI input into HTML output.\n *\n * @name ansiToHtml\n * @function\n * @param {String} txt The input text.\n * @param {Object} options The options passed ot the `process` method.\n * @returns {String} The HTML output.\n */\n ansiToHtml (txt, options) {\n return this.process(txt, options, true);\n }\n\n /**\n * ansiToJson\n * Converts ANSI input into HTML output.\n *\n * @name ansiToJson\n * @function\n * @param {String} txt The input text.\n * @param {Object} options The options passed ot the `process` method.\n * @returns {String} The JSON output.\n */\n ansiToJson (txt, options) {\n options = options || {};\n options.json = true;\n options.clearLine = false;\n return this.process(txt, options, true);\n }\n\n /**\n * ansiToText\n * Converts ANSI input into HTML output.\n *\n * @name ansiToText\n * @function\n * @param {String} txt The input text.\n * @returns {String} The text output.\n */\n ansiToText (txt) {\n return this.process(txt, {}, false);\n }\n\n /**\n * process\n * Processes the input.\n *\n * @name process\n * @function\n * @param {String} txt The input text.\n * @param {Object} options An object passed to `processChunk` method, extended with:\n *\n * - `json` (Boolean): If `true`, the result will be an object.\n * - `use_classes` (Boolean): If `true`, HTML classes will be appended to the HTML output.\n *\n * @param {Boolean} markup\n */\n process (txt, options, markup) {\n let self = this;\n let raw_text_chunks = txt.split(/\\033\\[/);\n let first_chunk = raw_text_chunks.shift(); // the first chunk is not the result of the split\n\n if (options === undefined || options === null) {\n options = {};\n }\n options.clearLine = /\\r/.test(txt); // check for Carriage Return\n let color_chunks = raw_text_chunks.map(chunk => this.processChunk(chunk, options, markup))\n\n if (options && options.json) {\n let first = self.processChunkJson(\"\");\n first.content = first_chunk;\n first.clearLine = options.clearLine;\n color_chunks.unshift(first);\n if (options.remove_empty) {\n color_chunks = color_chunks.filter(c => !c.isEmpty());\n }\n return color_chunks;\n } else {\n color_chunks.unshift(first_chunk);\n }\n\n return color_chunks.join(\"\");\n }\n\n /**\n * processChunkJson\n * Processes the current chunk into json output.\n *\n * @name processChunkJson\n * @function\n * @param {String} text The input text.\n * @param {Object} options An object containing the following fields:\n *\n * - `json` (Boolean): If `true`, the result will be an object.\n * - `use_classes` (Boolean): If `true`, HTML classes will be appended to the HTML output.\n *\n * @param {Boolean} markup If false, the colors will not be parsed.\n * @return {Object} The result object:\n *\n * - `content` (String): The text.\n * - `fg` (String|null): The foreground color.\n * - `bg` (String|null): The background color.\n * - `fg_truecolor` (String|null): The foreground true color (if 16m color is enabled).\n * - `bg_truecolor` (String|null): The background true color (if 16m color is enabled).\n * - `clearLine` (Boolean): `true` if a carriageReturn \\r was fount at end of line.\n * - `was_processed` (Bolean): `true` if the colors were processed, `false` otherwise.\n * - `isEmpty` (Function): A function returning `true` if the content is empty, or `false` otherwise.\n *\n */\n processChunkJson (text, options, markup) {\n\n // Are we using classes or styles?\n options = typeof options == \"undefined\" ? {} : options;\n let use_classes = options.use_classes = typeof options.use_classes != \"undefined\" && options.use_classes;\n let key = options.key = use_classes ? \"class\" : \"color\";\n\n let result = {\n content: text\n , fg: null\n , bg: null\n , fg_truecolor: null\n , bg_truecolor: null\n , isInverted: false\n , clearLine: options.clearLine\n , decoration: null\n , decorations: []\n , was_processed: false\n , isEmpty: () => !result.content\n };\n\n // Each \"chunk\" is the text after the CSI (ESC + \"[\") and before the next CSI/EOF.\n //\n // This regex matches four groups within a chunk.\n //\n // The first and third groups match code type.\n // We supported only SGR command. It has empty first group and \"m\" in third.\n //\n // The second group matches all of the number+semicolon command sequences\n // before the \"m\" (or other trailing) character.\n // These are the graphics or SGR commands.\n //\n // The last group is the text (including newlines) that is colored by\n // the other group\"s commands.\n let matches = text.match(/^([!\\x3c-\\x3f]*)([\\d;]*)([\\x20-\\x2c]*[\\x40-\\x7e])([\\s\\S]*)/m);\n\n if (!matches) return result;\n\n let orig_txt = result.content = matches[4];\n let nums = matches[2].split(\";\");\n\n // We currently support only \"SGR\" (Select Graphic Rendition)\n // Simply ignore if not a SGR command.\n if (matches[1] !== \"\" || matches[3] !== \"m\") {\n return result;\n }\n\n if (!markup) {\n return result;\n }\n\n let self = this;\n\n while (nums.length > 0) {\n let num_str = nums.shift();\n let num = parseInt(num_str);\n\n if (isNaN(num) || num === 0) {\n self.fg = self.bg = null;\n self.decorations = [];\n } else if (num === 1) {\n self.decorations.push(\"bold\");\n } else if (num === 2) {\n self.decorations.push(\"dim\");\n // Enable code 2 to get string\n } else if (num === 3) {\n self.decorations.push(\"italic\");\n } else if (num === 4) {\n self.decorations.push(\"underline\");\n } else if (num === 5) {\n self.decorations.push(\"blink\");\n } else if (num === 7) {\n self.decorations.push(\"reverse\");\n } else if (num === 8) {\n self.decorations.push(\"hidden\");\n // Enable code 9 to get strikethrough\n } else if (num === 9) {\n self.decorations.push(\"strikethrough\");\n /**\n * Add several widely used style codes\n * @see https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters\n */\n } else if (num === 21) {\n self.removeDecoration(\"bold\");\n } else if (num === 22) {\n self.removeDecoration(\"bold\");\n self.removeDecoration(\"dim\");\n } else if (num === 23) {\n self.removeDecoration(\"italic\");\n } else if (num === 24) {\n self.removeDecoration(\"underline\");\n } else if (num === 25) {\n self.removeDecoration(\"blink\");\n } else if (num === 27) {\n self.removeDecoration(\"reverse\");\n } else if (num === 28) {\n self.removeDecoration(\"hidden\");\n } else if (num === 29) {\n self.removeDecoration(\"strikethrough\");\n } else if (num === 39) {\n self.fg = null;\n } else if (num === 49) {\n self.bg = null;\n // Foreground color\n } else if ((num >= 30) && (num < 38)) {\n self.fg = ANSI_COLORS[0][(num % 10)][key];\n // Foreground bright color\n } else if ((num >= 90) && (num < 98)) {\n self.fg = ANSI_COLORS[1][(num % 10)][key];\n // Background color\n } else if ((num >= 40) && (num < 48)) {\n self.bg = ANSI_COLORS[0][(num % 10)][key];\n // Background bright color\n } else if ((num >= 100) && (num < 108)) {\n self.bg = ANSI_COLORS[1][(num % 10)][key];\n } else if (num === 38 || num === 48) { // extend color (38=fg, 48=bg)\n let is_foreground = (num === 38);\n if (nums.length >= 1) {\n let mode = nums.shift();\n if (mode === \"5\" && nums.length >= 1) { // palette color\n let palette_index = parseInt(nums.shift());\n if (palette_index >= 0 && palette_index <= 255) {\n if (!use_classes) {\n if (!this.PALETTE_COLORS) {\n self.setupPalette();\n }\n if (is_foreground) {\n self.fg = this.PALETTE_COLORS[palette_index];\n } else {\n self.bg = this.PALETTE_COLORS[palette_index];\n }\n } else {\n let klass = (palette_index >= 16)\n ? (\"ansi-palette-\" + palette_index)\n : ANSI_COLORS[palette_index > 7 ? 1 : 0][palette_index % 8][\"class\"];\n if (is_foreground) {\n self.fg = klass;\n } else {\n self.bg = klass;\n }\n }\n }\n } else if(mode === \"2\" && nums.length >= 3) { // true color\n let r = parseInt(nums.shift());\n let g = parseInt(nums.shift());\n let b = parseInt(nums.shift());\n if ((r >= 0 && r <= 255) && (g >= 0 && g <= 255) && (b >= 0 && b <= 255)) {\n let color = r + \", \" + g + \", \" + b;\n if (!use_classes) {\n if (is_foreground) {\n self.fg = color;\n } else {\n self.bg = color;\n }\n } else {\n if (is_foreground) {\n self.fg = \"ansi-truecolor\";\n self.fg_truecolor = color;\n } else {\n self.bg = \"ansi-truecolor\";\n self.bg_truecolor = color;\n }\n }\n }\n }\n }\n }\n }\n\n if ((self.fg === null) && (self.bg === null) && (self.decorations.length === 0)) {\n return result;\n } else {\n let styles = [];\n let classes = [];\n let data = {};\n\n result.fg = self.fg;\n result.bg = self.bg;\n result.fg_truecolor = self.fg_truecolor;\n result.bg_truecolor = self.bg_truecolor;\n result.decorations = self.decorations;\n result.decoration = self.decorations.slice(-1).pop() || null;\n result.was_processed = true;\n\n return result;\n }\n }\n\n /**\n * processChunk\n * Processes the current chunk of text.\n *\n * @name processChunk\n * @function\n * @param {String} text The input text.\n * @param {Object} options An object containing the following fields:\n *\n * - `json` (Boolean): If `true`, the result will be an object.\n * - `use_classes` (Boolean): If `true`, HTML classes will be appended to the HTML output.\n *\n * @param {Boolean} markup If false, the colors will not be parsed.\n * @return {Object|String} The result (object if `json` is wanted back or string otherwise).\n */\n processChunk (text, options, markup) {\n options = options || {};\n let jsonChunk = this.processChunkJson(text, options, markup);\n let use_classes = options.use_classes;\n\n // \"reverse\" decoration reverses foreground and background colors\n jsonChunk.decorations = jsonChunk.decorations\n .filter((decoration) => {\n if (decoration === \"reverse\") {\n // when reversing, missing colors are defaulted to black (bg) and white (fg)\n if (!jsonChunk.fg) {\n jsonChunk.fg = ANSI_COLORS[0][7][use_classes ? \"class\" : \"color\"];\n }\n if (!jsonChunk.bg) {\n jsonChunk.bg = ANSI_COLORS[0][0][use_classes ? \"class\" : \"color\"];\n }\n let tmpFg = jsonChunk.fg;\n jsonChunk.fg = jsonChunk.bg;\n jsonChunk.bg = tmpFg;\n let tmpFgTrue = jsonChunk.fg_truecolor;\n jsonChunk.fg_truecolor = jsonChunk.bg_truecolor;\n jsonChunk.bg_truecolor = tmpFgTrue;\n jsonChunk.isInverted = true;\n return false;\n }\n return true;\n });\n\n if (options.json) { return jsonChunk; }\n if (jsonChunk.isEmpty()) { return \"\"; }\n if (!jsonChunk.was_processed) { return jsonChunk.content; }\n\n let colors = [];\n let decorations = [];\n let textDecorations = [];\n let data = {};\n\n let render_data = data => {\n let fragments = [];\n let key;\n for (key in data) {\n if (data.hasOwnProperty(key)) {\n fragments.push(\"data-\" + key + \"=\\\"\" + this.escapeForHtml(data[key]) + \"\\\"\");\n }\n }\n return fragments.length > 0 ? \" \" + fragments.join(\" \") : \"\";\n };\n\n if (jsonChunk.isInverted) {\n data[\"ansi-is-inverted\"] = \"true\";\n }\n\n if (jsonChunk.fg) {\n if (use_classes) {\n colors.push(jsonChunk.fg + \"-fg\");\n if (jsonChunk.fg_truecolor !== null) {\n data[\"ansi-truecolor-fg\"] = jsonChunk.fg_truecolor;\n jsonChunk.fg_truecolor = null;\n }\n } else {\n colors.push(\"color:rgb(\" + jsonChunk.fg + \")\");\n }\n }\n\n if (jsonChunk.bg) {\n if (use_classes) {\n colors.push(jsonChunk.bg + \"-bg\");\n if (jsonChunk.bg_truecolor !== null) {\n data[\"ansi-truecolor-bg\"] = jsonChunk.bg_truecolor;\n jsonChunk.bg_truecolor = null;\n }\n } else {\n colors.push(\"background-color:rgb(\" + jsonChunk.bg + \")\");\n }\n }\n\n jsonChunk.decorations.forEach((decoration) => {\n // use classes\n if (use_classes) {\n decorations.push(\"ansi-\" + decoration);\n return;\n }\n // use styles\n if (decoration === \"bold\") {\n decorations.push(\"font-weight:bold\");\n } else if (decoration === \"dim\") {\n decorations.push(\"opacity:0.5\");\n } else if (decoration === \"italic\") {\n decorations.push(\"font-style:italic\");\n } else if (decoration === \"hidden\") {\n decorations.push(\"visibility:hidden\");\n } else if (decoration === \"strikethrough\") {\n textDecorations.push(\"line-through\");\n } else {\n // underline and blink are treated here\n textDecorations.push(decoration);\n }\n });\n\n if (textDecorations.length) {\n decorations.push(\"text-decoration:\" + textDecorations.join(\" \"));\n }\n\n if (use_classes) {\n return \"<span class=\\\"\" + colors.concat(decorations).join(\" \") + \"\\\"\" + render_data(data) + \">\" + jsonChunk.content + \"</span>\";\n } else {\n return \"<span style=\\\"\" + colors.concat(decorations).join(\";\") + \"\\\"\" + render_data(data) + \">\" + jsonChunk.content + \"</span>\";\n }\n }\n\n removeDecoration(decoration) {\n const index = this.decorations.indexOf(decoration);\n\n if (index >= 0) {\n this.decorations.splice(index, 1);\n }\n }\n}\n\nmodule.exports = Anser;\n","/**\n * Escape carrigage returns like a terminal\n * @param {string} txt - String to escape.\n * @return {string} - Escaped string.\n */\nfunction escapeCarriageReturn(txt) {\n if (!txt) return \"\";\n if (!/\\r/.test(txt)) return txt;\n txt = txt.replace(/\\r+\\n/gm, \"\\n\"); // \\r followed by \\n --> newline\n while (/\\r./.test(txt)) {\n txt = txt.replace(/^([^\\r\\n]*)\\r+([^\\r\\n]+)/gm, function (_, base, insert) {\n return insert + base.slice(insert.length);\n });\n }\n return txt;\n}\n\nfunction findLongestString(arr) {\n var longest = 0;\n for (var i = 0; i < arr.length; i++) {\n if (arr[longest].length <= arr[i].length) {\n longest = i;\n }\n }\n return longest;\n}\n\nfunction escapeSingleLineSafe(txt) {\n if (!/\\r/.test(txt)) return txt;\n var arr = txt.split(\"\\r\");\n var res = [];\n\n while (arr.length > 0) {\n var longest = findLongestString(arr);\n res.push(arr[longest]);\n arr = arr.slice(longest + 1);\n }\n\n return res.join(\"\\r\");\n}\n\n/**\n * Safely escape carrigage returns like a terminal.\n * This allows to escape carrigage returns while allowing future output to be appended\n * without loosing information.\n * Use this as a intermediate escape step if your stream hasn't completed yet.\n * @param {string} txt - String to escape.\n * @return {string} - Escaped string.\n */\nfunction escapeCarriageReturnSafe(txt) {\n if (!txt) return \"\";\n if (!/\\r/.test(txt)) return txt;\n if (!/\\n/.test(txt)) return escapeSingleLineSafe(txt);\n txt = txt.replace(/\\r+\\n/gm, \"\\n\"); // \\r followed by \\n --> newline\n var idx = txt.lastIndexOf(\"\\n\");\n\n return (\n escapeCarriageReturn(txt.slice(0, idx)) +\n \"\\n\" +\n escapeSingleLineSafe(txt.slice(idx + 1))\n );\n}\n\nmodule.exports = escapeCarriageReturn;\nmodule.exports.escapeCarriageReturn = escapeCarriageReturn;\nmodule.exports.escapeCarriageReturnSafe = escapeCarriageReturnSafe;\n","import Anser, { AnserJsonEntry } from \"anser\";\nimport { escapeCarriageReturn } from \"escape-carriage\";\nimport * as React from \"react\";\nimport styles from \"./Terminal.module.css\";\n\n/**\n * Source:\n * https://github.com/nteract/ansi-to-react/blob/master/src/index.ts.\n */\n\n/**\n * Converts ANSI strings into JSON output.\n * @param input - The input string.\n * @param useClasses - If `true`, HTML classes will be appended\n * to the HTML output.\n * @returns The parsed input.\n */\nfunction ansiToJSON(input: string, useClasses: boolean | undefined): AnserJsonEntry[] {\n\tinput = escapeCarriageReturn(fixBackspace(input));\n\treturn Anser.ansiToJson(input, {\n\t\tjson: true,\n\t\t// eslint-disable-next-line @typescript-eslint/naming-convention\n\t\t\"remove_empty\": true,\n\t\t// eslint-disable-next-line @typescript-eslint/naming-convention\n\t\t\"use_classes\": useClasses,\n\t});\n}\n\n/**\n * Create a class string.\n * @returns Class name(s).\n */\nfunction createClass(bundle: AnserJsonEntry): string | null {\n\tconst classNames = [];\n\n\tif (bundle.bg) {\n\t\tclassNames.push(styles[`${bundle.bg}-bg`]);\n\t}\n\tif (bundle.fg) {\n\t\tclassNames.push(styles[`${bundle.fg}-fg`]);\n\t}\n\tif (bundle.decoration) {\n\t\tclassNames.push(styles[`ansi-${bundle.decoration}`]);\n\t}\n\n\tif (classNames.length === 0) {\n\t\treturn null;\n\t}\n\n\treturn classNames.join(\" \");\n}\n\n/**\n * Create the style attribute.\n * @param bundle\n * @returns Returns the style object.\n */\nfunction createStyle(bundle: AnserJsonEntry): object {\n\tconst style: Record<string, string> = {};\n\tif (bundle.bg) {\n\t\tstyle.backgroundColor = `rgb(${bundle.bg})`;\n\t}\n\tif (bundle.fg) {\n\t\tstyle.color = `rgb(${bundle.fg})`;\n\t}\n\tswitch (bundle.decoration) {\n\t\tcase \"bold\":\n\t\t\tstyle.fontWeight = \"bold\";\n\t\t\tbreak;\n\t\tcase \"dim\":\n\t\t\tstyle.opacity = \"0.5\";\n\t\t\tbreak;\n\t\tcase \"italic\":\n\t\t\tstyle.fontStyle = \"italic\";\n\t\t\tbreak;\n\t\tcase \"hidden\":\n\t\t\tstyle.visibility = \"hidden\";\n\t\t\tbreak;\n\t\tcase \"strikethrough\":\n\t\t\tstyle.textDecoration = \"line-through\";\n\t\t\tbreak;\n\t\tcase \"underline\":\n\t\t\tstyle.textDecoration = \"underline\";\n\t\t\tbreak;\n\t\tcase \"blink\":\n\t\t\tstyle.textDecoration = \"blink\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t}\n\treturn style;\n}\n\n/**\n * Converts an Anser bundle into a React Node.\n * @param linkify - Whether links should be converting into clickable anchor tags.\n * @param useClasses - Should render the span with a class instead of style.\n * @param bundle - Anser output.\n */\nfunction convertBundleIntoReact(linkify: boolean, useClasses: boolean, bundle: AnserJsonEntry, key: number) {\n\tconst style = useClasses ? null : createStyle(bundle);\n\tconst className = useClasses ? createClass(bundle) : null;\n\n\tif (!linkify) {\n\t\treturn React.createElement(\n\t\t\t\"pre\",\n\t\t\t{ style, key, className },\n\t\t\tbundle.content\n\t\t);\n\t}\n\n\tconst content = [];\n\tconst linkRegex = /(\\s|^)(https?:\\/\\/(?:www\\.|(?!www))[^\\s.]+\\.[^\\s]{2,}|www\\.[^\\s]+\\.[^\\s]{2,})/g;\n\n\tlet index = 0;\n\tlet match: RegExpExecArray | null;\n\twhile ((match = linkRegex.exec(bundle.content)) !== null) {\n\t\tconst [, pre, url] = match;\n\n\t\tconst startIndex = match.index + pre.length;\n\t\tif (startIndex > index) {\n\t\t\tcontent.push(bundle.content.substring(index, startIndex));\n\t\t}\n\n\t\t// Make sure the href we generate from the link is fully qualified. We assume http\n\t\t// if it starts with a www because many sites don't support https\n\t\tconst href = url.startsWith(\"www.\") ? `http://${url}` : url;\n\t\tcontent.push(\n\t\t\tReact.createElement(\n\t\t\t\t\"a\",\n\t\t\t\t{\n\t\t\t\t\tkey: index,\n\t\t\t\t\thref,\n\t\t\t\t\ttarget: \"_blank\",\n\t\t\t\t},\n\t\t\t\t`${url}`\n\t\t\t)\n\t\t);\n\n\t\tindex = linkRegex.lastIndex;\n\t}\n\n\tif (index < bundle.content.length) {\n\t\tcontent.push(bundle.content.substring(index));\n\t}\n\n\treturn React.createElement(\"span\", { style, key, className }, content);\n}\n\nexport function Ansi(props: { children?: string | undefined; linkify?: boolean | undefined; className?: string | undefined; useClasses?: boolean | undefined; }) {\n\tconst { className, useClasses, children, linkify } = props;\n\treturn React.createElement(\n\t\t\"code\",\n\t\t{ className },\n\t\tansiToJSON(children ?? \"\", useClasses ?? false).map(\n\t\t\tconvertBundleIntoReact.bind(null, linkify ?? false, useClasses ?? false)\n\t\t)\n\t);\n}\n\n// This is copied from the Jupyter Classic source code\n// notebook/static/base/js/utils.js to handle \\b in a way\n// that is **compatible with Jupyter classic**. One can\n// argue that this behavior is questionable:\n// https://stackoverflow.com/questions/55440152/multiple-b-doesnt-work-as-expected-in-jupyter#\nfunction fixBackspace(txt: string) {\n\tlet tmp = txt;\n\tdo {\n\t\ttxt = tmp;\n\t\t// Cancel out anything-but-newline followed by backspace\n\t\t// eslint-disable-next-line no-control-regex\n\t\ttmp = txt.replace(/[^\\n]\\x08/gm, \"\");\n\t} while (tmp.length < txt.length);\n\treturn txt;\n}\n","import { FC, forwardRef } from \"react\";\nimport { Ansi } from \"./Ansi\";\nimport styles from \"./Terminal.module.css\";\n\ninterface OutputLineProps {\n\ttext?: string;\n}\n\nexport const OutputLine: FC<OutputLineProps> = forwardRef<HTMLDivElement>(({ text }: OutputLineProps, ref) => {\n\tconst lines = text?.split(\"\\n\");\n\n\treturn <div ref={ref}>\n\t\t{lines?.map((line, index) =>\n\t\t\t<Ansi key={index} className={styles.Output} useClasses>{line === \"\" ? \" \" : line}</Ansi>\n\t\t)}\n\t</div>;\n}) as FC;","import { ChangeEvent, KeyboardEvent, RefObject, useLayoutEffect, useRef, useState } from \"react\";\nimport styles from \"./Terminal.module.css\";\nimport { Ansi } from \"./Ansi\";\n\ninterface InputLineProps {\n value: string;\n prefix: string;\n onChange: (event: ChangeEvent<HTMLInputElement>) => void;\n onKeyUp?: (event: KeyboardEvent<HTMLInputElement>) => void;\n onKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void;\n inputRef: RefObject<HTMLInputElement>;\n}\n\nexport function InputLine({ value, prefix, onChange, onKeyUp, onKeyDown, inputRef }: InputLineProps) {\n\tconst [cursorPosition, setCursorPosition] = useState(0);\n\tconst selectionReference = useRef<number | null>(null);\n\n\tuseLayoutEffect(() => {\n\t\tconst input = inputRef.current;\n\t\tif (input && selectionReference.current !== null) {\n\t\t\tinput.setSelectionRange(selectionReference.current, selectionReference.current);\n\t\t\tsetCursorPosition(selectionReference.current);\n\t\t\tselectionReference.current = null;\n\t\t} else if (input && input.selectionStart !== null) {\n\t\t\tsetCursorPosition(input.selectionStart);\n\t\t}\n\t}, [value, inputRef]);\n\n\tconst checkCursorPosition = () => {\n\t\tconst selectionStart = inputRef.current?.selectionStart;\n\t\tif (selectionStart != null) setCursorPosition(selectionStart);\n\t};\n\n\treturn <span className={styles.Input}>\n\t\t{prefix && <Ansi className={styles.Prefix} useClasses>{prefix}</Ansi>}\n\t\t<span className={styles[\"Input-container\"]} style={{ \"--cursor-offset\": cursorPosition }}>\n\t\t\t<span aria-hidden=\"true\">{value}</span>\n\t\t\t<input\n\t\t\t\tid=\"input\"\n\t\t\t\tvalue={value}\n\t\t\t\taria-label=\"Command input\"\n\t\t\t\tonChange={(event) => {\n\t\t\t\t\tselectionReference.current = event.target.selectionStart;\n\t\t\t\t\tonChange(event);\n\t\t\t\t}}\n\t\t\t\tref={inputRef}\n\t\t\t\tonKeyUp={onKeyUp}\n\t\t\t\tonKeyDown={(event) => {\n\t\t\t\t\tonKeyDown?.(event);\n\t\t\t\t\tcheckCursorPosition();\n\t\t\t\t}}\n\t\t\t\tonClick={checkCursorPosition}\n\t\t\t\tonSelect={checkCursorPosition}\n\t\t\t\tspellCheck={false}\n\t\t\t\tautoComplete=\"off\"\n\t\t\t\tautoFocus\n\t\t\t/>\n\t\t</span>\n\t</span>;\n}","import { ChangeEventHandler, KeyboardEventHandler, MouseEventHandler, useEffect, useRef, useState } from \"react\";\nimport styles from \"./Terminal.module.css\";\nimport { OutputLine } from \"./OutputLine\";\nimport { InputLine } from \"./InputLine\";\nimport { HOSTNAME, USERNAME, useShell, WindowProps } from \"@prozilla-os/core\";\nimport { Vector2 } from \"@prozilla-os/shared\";\n\nexport interface TerminalProps extends WindowProps {\n\tpath?: string;\n\tinput?: string;\n}\n\nexport function Terminal({ app, path: startPath, input, setTitle, close: exit, active, focus }: TerminalProps) {\n\tconst ref = useRef<HTMLDivElement>(null);\n\tconst inputRef = useRef<HTMLInputElement>(null);\n\tconst sizeRef = useRef(Vector2.ZERO);\n\tconst [inputKey, setInputKey] = useState(0);\n\tconst [shell, state] = useShell({\n\t\tapp,\n\t\tpath: startPath,\n\t\tinput,\n\t\texit: exit!,\n\t\tsizeRef,\n\t});\n\n\tuseEffect(() => {\n\t\tsetTitle?.(`${USERNAME}@${HOSTNAME}: ${state.workingDirectory.root ? \"/\" : state.workingDirectory.path}`);\n\t}, [state.workingDirectory.path, state.workingDirectory.root, setTitle]);\n\n\t// Handle initial focus and focus recovery after streaming\n\tuseEffect(() => {\n\t\tif (!active) return;\n\n\t\tif (state.stream) {\n\t\t\tref.current?.focus();\n\t\t} else {\n\t\t\tinputRef.current?.focus();\n\t\t}\n\t}, [active, state.stream]);\n\n\tuseEffect(() => {\n\t\tif (inputRef.current && !state.stream) {\n\t\t\tconst length = state.line.length;\n\t\t\tinputRef.current.setSelectionRange(length, length);\n\t\t}\n\t}, [state.historyOffset]);\n\n\tconst scrollDown = () => {\n\t\tif (ref.current) ref.current.scrollTop = ref.current.scrollHeight;\n\t};\n\n\tuseEffect(() => {\n\t\tscrollDown();\n\t}, [state.history.length, state.line, state.ttyBuffer]);\n\n\tuseEffect(() => {\n\t\tif (!ref.current) return;\n\n\t\tconst measure = () => {\n\t\t\tif (!ref.current) return;\n\n\t\t\tconst style = getComputedStyle(ref.current);\n\t\t\tconst fontSize = parseFloat(style.fontSize);\n\t\t\tconst charWidth = 0.585 * fontSize;\n\t\t\tconst charHeight = 1.25 * fontSize;\n\t\t\tconst { width, height } = ref.current.getBoundingClientRect();\n\n\t\t\tsizeRef.current.set(\n\t\t\t\tMath.ceil(width / charWidth),\n\t\t\t\tMath.ceil(height / charHeight)\n\t\t\t);\n\t\t};\n\n\t\tconst observer = new ResizeObserver(measure);\n\t\tobserver.observe(ref.current);\n\t\tmeasure();\n\n\t\treturn () => observer.disconnect();\n\t}, []);\n\n\tconst onKeyDown: KeyboardEventHandler<HTMLDivElement> = (event) => {\n\t\tconst { key } = event;\n\n\t\tif ((event.ctrlKey || event.metaKey) && key === \"c\" && !event.shiftKey) {\n\t\t\tevent.preventDefault();\n\t\t\tshell.interrupt();\n\t\t\treturn;\n\t\t}\n\n\t\tif (state.stream) return;\n\n\t\tif (key === \"Tab\") {\n\t\t\tevent.preventDefault();\n\t\t\tshell.autoComplete();\n\t\t} else if (key === \"Enter\") {\n\t\t\tconst value = (event.target as HTMLInputElement).value;\n\t\t\tvoid shell.run(value);\n\t\t\tsetInputKey((previousKey) => previousKey + 1);\n\t\t} else if (key === \"ArrowUp\") {\n\t\t\tevent.preventDefault();\n\t\t\tshell.historySearch(1);\n\t\t} else if (key === \"ArrowDown\") {\n\t\t\tevent.preventDefault();\n\t\t\tshell.historySearch(-1);\n\t\t}\n\t};\n\n\tconst onChange: ChangeEventHandler<HTMLInputElement> = (event) => {\n\t\tshell.setLine(event.target.value);\n\t};\n\n\tconst renderOutput = () => {\n\t\tif (state.isUsingAltScreen) {\n\t\t\treturn state.ttyBuffer ? <OutputLine text={state.ttyBuffer}/> : null;\n\t\t}\n\n\t\tlet startIndex = 0;\n\t\tfor (let i = state.history.length - 1; i >= 0; i--) {\n\t\t\tif (state.history[i].clear) {\n\t\t\t\tstartIndex = i + 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn <>\n\t\t\t{state.history.slice(startIndex).map((entry, index) => \n\t\t\t\t<OutputLine text={entry.text} key={index}/>\n\t\t\t)}\n\t\t\t{state.ttyBuffer && <OutputLine text={state.ttyBuffer}/>}\n\t\t</>;\n\t};\n\n\tconst onMouseDown: MouseEventHandler<HTMLDivElement> = (event) => {\n\t\tfocus?.(event);\n\n\t\tif (event.button === 2) {\n\t\t\tevent.preventDefault();\n\t\t\tvoid navigator.clipboard.readText().then((text) => {\n\t\t\t\tconst input = inputRef.current;\n\t\t\t\tif (!input) return;\n\n\t\t\t\tconst start = input.selectionStart ?? state.line.length;\n\t\t\t\tconst end = input.selectionEnd ?? state.line.length;\n\t\t\t\t\n\t\t\t\tshell.setLine((line) => {\n\t\t\t\t\treturn line.substring(0, start) + text + line.substring(end);\n\t\t\t\t});\n\n\t\t\t\t// Re-focus and position cursor after paste\n\t\t\t\tconst newPos = start + text.length;\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tinput.focus();\n\t\t\t\t\tinput.setSelectionRange(newPos, newPos);\n\t\t\t\t}, 0);\n\t\t\t}).catch((error) => {\n\t\t\t\tconsole.error(error);\n\t\t\t});\n\t\t}\n\t};\n\n\tconst onContextMenu: MouseEventHandler<HTMLDivElement> = (event) => {\n\t\tevent.preventDefault();\n\t};\n\n\treturn <div\n\t\tref={ref} \n\t\ttabIndex={0}\n\t\tclassName={styles.Terminal}\n\t\tonKeyDown={onKeyDown}\n\t\tonMouseDown={onMouseDown}\n\t\tonContextMenu={onContextMenu}\n\t\tonClick={(event) => {\n\t\t\tif (window.getSelection()?.toString() === \"\") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif (state.stream) {\n\t\t\t\t\tref.current?.focus();\n\t\t\t\t} else {\n\t\t\t\t\tinputRef.current?.focus();\n\t\t\t\t}\n\t\t\t}\n\t\t}}\n\t>\n\t\t<div className={styles.History}>\n\t\t\t{renderOutput()}\n\t\t</div>\n\t\t{!state.isUsingAltScreen && (\n\t\t\t!state.stream\n\t\t\t\t? <InputLine\n\t\t\t\t\tkey={inputKey}\n\t\t\t\t\tvalue={state.line}\n\t\t\t\t\tprefix={state.prompt}\n\t\t\t\t\tonChange={onChange}\n\t\t\t\t\tinputRef={inputRef}\n\t\t\t\t/>\n\t\t\t\t: null\n\t\t)}\n\t</div>;\n}","import { App, AppsConfig, Command, CommandsManager } from \"@prozilla-os/core\";\nimport { Terminal, TerminalProps } from \"../components/Terminal\";\n\nexport class TerminalApp extends App<TerminalProps> {\n\n\tconstructor() {\n\t\tsuper(\"Terminal\", \"terminal\", Terminal);\n\t\tthis.setIconUrl(\"https://os.prozilla.dev/assets/apps/icons/terminal.svg\");\n\t\tthis.setRole(AppsConfig.APP_ROLES.terminal);\n\t\tthis.setCategory(\"Utilities & tools\");\n\t}\n\n\taddCommands(commands: Command[]) {\n\t\tcommands.forEach((command) => this.addCommand(command));\n\t\treturn this;\n\t}\n\n\n\taddCommand(command: Command) {\n\t\tCommandsManager.addCommand(command);\n\t\treturn this;\n\t}\n\n}","import { TerminalApp } from \"./core/terminalApp\";\n\nconst terminal = new TerminalApp();\n\nexport { terminal, TerminalApp };"],"names":["ANSI_COLORS","linkRegex","Anser","txt","options","i","j","levels","format","r","g","b","level","str","markup","self","raw_text_chunks","first_chunk","color_chunks","chunk","first","c","text","use_classes","key","result","matches","nums","num_str","num","is_foreground","mode","palette_index","klass","color","jsonChunk","decoration","tmpFg","tmpFgTrue","colors","decorations","textDecorations","data","render_data","fragments","index","lib","escapeCarriageReturn","_","base","insert","findLongestString","arr","longest","escapeSingleLineSafe","res","escapeCarriageReturnSafe","idx","escapeCarriageModule","ansiToJSON","input","useClasses","fixBackspace","createClass","bundle","classNames","styles","createStyle","style","convertBundleIntoReact","linkify","className","React","content","match","pre","url","startIndex","href","Ansi","props","children","tmp","OutputLine","forwardRef","ref","lines","jsx","line","InputLine","value","prefix","onChange","onKeyUp","onKeyDown","inputRef","cursorPosition","setCursorPosition","useState","selectionReference","useRef","useLayoutEffect","checkCursorPosition","selectionStart","jsxs","event","Terminal","app","startPath","setTitle","exit","active","focus","sizeRef","Vector2","inputKey","setInputKey","shell","state","useShell","useEffect","USERNAME","HOSTNAME","length","scrollDown","measure","fontSize","charWidth","charHeight","width","height","observer","previousKey","renderOutput","Fragment","entry","onMouseDown","start","end","newPos","error","onContextMenu","TerminalApp","App","AppsConfig","commands","command","CommandsManager","terminal"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,QAAMA,IAAc;AAAA,IAChB;AAAA,MACI,EAAE,OAAO,WAAkB,OAAS,aAAY;AAAA,MA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AAW,wDAAwD,GACxE,KAAK,QAAQsC,EAAW,UAAU,QAAQ,GAC1C,KAAK,YAAY,mBAAmB;AAAA,EACrC;AAAA,EAEA,YAAYC,GAAqB;AAChC,WAAAA,EAAS,QAAQ,CAACC,MAAY,KAAK,WAAWA,CAAO,CAAC,GAC/C;AAAA,EACR;AAAA,EAGA,WAAWA,GAAkB;AAC5B,WAAAC,EAAgB,WAAWD,CAAO,GAC3B;AAAA,EACR;AAED;ACrBA,MAAME,KAAW,IAAIN,GAAA;;","x_google_ignoreList":[0,1]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@prozilla-os/terminal",
3
3
  "description": "A terminal/shell application for ProzillaOS.",
4
- "version": "1.1.21",
4
+ "version": "1.1.24",
5
5
  "homepage": "https://os.prozilla.dev/terminal",
6
6
  "author": {
7
7
  "name": "Prozilla",
@@ -22,25 +22,26 @@
22
22
  "anser": "^2.1.1",
23
23
  "escape-carriage": "^1.3.1",
24
24
  "react": "^18.3.1",
25
- "@prozilla-os/core": "1.3.14",
25
+ "valtio": "^2.3.1",
26
+ "@prozilla-os/core": "2.0.2",
26
27
  "@prozilla-os/skins": "1.1.9",
27
- "@prozilla-os/shared": "1.2.1"
28
+ "@prozilla-os/shared": "1.3.0"
28
29
  },
29
30
  "devDependencies": {
30
31
  "@types/node": "^20.14.5",
31
- "@types/react": "^18.3.3",
32
+ "@types/react": "^18.3.27",
32
33
  "@vitejs/plugin-react-swc": "^3.7.0",
33
34
  "typescript": "^5.5.4",
34
- "vite": "^5.4.8",
35
- "vite-plugin-dts": "^3.9.1",
35
+ "vite": "^7.3.1",
36
+ "vite-plugin-dts": "^4.5.4",
36
37
  "vite-plugin-lib-inject-css": "^2.1.1",
37
- "@prozilla-os/dev-tools": "1.1.11"
38
+ "@prozilla-os/dev-tools": "1.1.14"
38
39
  },
39
40
  "files": [
40
41
  "dist"
41
42
  ],
42
43
  "sideEffects": [
43
- "**/*.css"
44
+ "dist/main.js"
44
45
  ],
45
46
  "publishConfig": {
46
47
  "registry": "https://registry.npmjs.org/",
@@ -1,16 +0,0 @@
1
- import { VirtualFile as u } from "@prozilla-os/core";
2
- import { C as a, f as l } from "./main-CXiltWT-.js";
3
- const m = new a().setRequireArgs(!0).setManual({
4
- purpose: "Concetenate files and display on the terminal screen",
5
- usage: "cat [options] [files]",
6
- description: "Concetenate files to standard output."
7
- }).setExecute(function(r, s) {
8
- const { currentDirectory: o, options: t } = s, n = r[0], { name: i, extension: c } = u.splitId(n), e = o.findFile(i, c);
9
- return e ? e.content ? t != null && t.includes("e") ? e.content.split(`
10
- `).join(`$
11
- `) + "$" : e.content : e.source ? `Src: ${e.source}` : { blank: !0 } : l(this.name, `${n}: No such file`);
12
- });
13
- export {
14
- m as cat
15
- };
16
- //# sourceMappingURL=cat-DGK7wWrK.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cat-DGK7wWrK.js","sources":["../../src/core/commands/cat.ts"],"sourcesContent":["import { VirtualFile } from \"@prozilla-os/core\";\nimport { formatError } from \"../_utils/terminal.utils\";\nimport { Command, ExecuteParams } from \"../command\";\n\nexport const cat = new Command()\n\t.setRequireArgs(true)\n\t.setManual({\n\t\tpurpose: \"Concetenate files and display on the terminal screen\",\n\t\tusage: \"cat [options] [files]\",\n\t\tdescription: \"Concetenate files to standard output.\",\n\t})\n\t.setExecute(function(this: Command, args, params) {\n\t\tconst { currentDirectory, options } = params as ExecuteParams;\n\t\tconst fileId = (args as string[])[0];\n\t\tconst { name, extension } = VirtualFile.splitId(fileId);\n\t\tconst file = currentDirectory.findFile(name, extension);\n\n\t\tif (!file)\n\t\t\treturn formatError(this.name, `${fileId}: No such file`);\n\n\t\tif (file.content) {\n\t\t\tif (!options?.includes(\"e\")) {\n\t\t\t\treturn file.content;\n\t\t\t} else {\n\t\t\t\t// Append \"$\" at the end of every line\n\t\t\t\treturn file.content.split(\"\\n\").join(\"$\\n\") + \"$\";\n\t\t\t}\n\t\t} else if (file.source) {\n\t\t\treturn `Src: ${file.source}`;\n\t\t} else {\n\t\t\treturn { blank: true };\n\t\t}\n\t});"],"names":["cat","Command","args","params","currentDirectory","options","fileId","name","extension","VirtualFile","file","formatError"],"mappings":";;AAIO,MAAMA,IAAM,IAAIC,IACrB,eAAe,EAAI,EACnB,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AAAA,EACP,aAAa;AACd,CAAC,EACA,WAAW,SAAwBC,GAAMC,GAAQ;AAC3C,QAAA,EAAE,kBAAAC,GAAkB,SAAAC,EAAY,IAAAF,GAChCG,IAAUJ,EAAkB,CAAC,GAC7B,EAAE,MAAAK,GAAM,WAAAC,EAAA,IAAcC,EAAY,QAAQH,CAAM,GAChDI,IAAON,EAAiB,SAASG,GAAMC,CAAS;AAEtD,SAAKE,IAGDA,EAAK,UACHL,KAAA,QAAAA,EAAS,SAAS,OAIfK,EAAK,QAAQ,MAAM;AAAA,CAAI,EAAE,KAAK;AAAA,CAAK,IAAI,MAHvCA,EAAK,UAKHA,EAAK,SACR,QAAQA,EAAK,MAAM,KAEnB,EAAE,OAAO,OAZTC,EAAY,KAAK,MAAM,GAAGL,CAAM,gBAAgB;AAczD,CAAC;"}
@@ -1,15 +0,0 @@
1
- import { VirtualFile as a } from "@prozilla-os/core";
2
- import { C as c, f as s } from "./main-CXiltWT-.js";
3
- const f = new c().setManual({
4
- purpose: "Change the current directory",
5
- usage: "cd [PATH]",
6
- description: "Change working directory to given path (the home directory by default)."
7
- }).setExecute(function(r, o) {
8
- const { currentDirectory: n, setCurrentDirectory: e } = o, i = r[0] ?? "~";
9
- let t = n.navigate(i);
10
- return t ? (t instanceof a && (t = t.parent), e == null || e(t), { blank: !0 }) : s(this.name, `${r[0]}: No such file or directory`);
11
- });
12
- export {
13
- f as cd
14
- };
15
- //# sourceMappingURL=cd-DvjkW_6o.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cd-DvjkW_6o.js","sources":["../../src/core/commands/cd.ts"],"sourcesContent":["import { VirtualFile, VirtualFolder } from \"@prozilla-os/core\";\nimport { formatError } from \"../_utils/terminal.utils\";\nimport { Command, ExecuteParams } from \"../command\";\n\nexport const cd = new Command()\n\t.setManual({\n\t\tpurpose: \"Change the current directory\",\n\t\tusage: \"cd [PATH]\",\n\t\tdescription: \"Change working directory to given path (the home directory by default).\",\n\t})\n\t.setExecute(function(this: Command, args, params) {\n\t\tconst { currentDirectory, setCurrentDirectory } = params as ExecuteParams;\n\t\tconst path = (args as string[])[0] ?? \"~\";\n\t\tlet destination = currentDirectory.navigate(path);\n\t\n\t\tif (!destination)\n\t\t\treturn formatError(this.name, `${(args as string[])[0]}: No such file or directory`);\n\n\t\tif (destination instanceof VirtualFile)\n\t\t\tdestination = destination.parent as VirtualFolder;\n\t\n\t\tsetCurrentDirectory?.(destination);\n\t\treturn { blank: true };\n\t});"],"names":["cd","Command","args","params","currentDirectory","setCurrentDirectory","path","destination","VirtualFile","formatError"],"mappings":";;AAIO,MAAMA,IAAK,IAAIC,EAAQ,EAC5B,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AAAA,EACP,aAAa;AACd,CAAC,EACA,WAAW,SAAwBC,GAAMC,GAAQ;AAC3C,QAAA,EAAE,kBAAAC,GAAkB,qBAAAC,EAAwB,IAAAF,GAC5CG,IAAQJ,EAAkB,CAAC,KAAK;AAClC,MAAAK,IAAcH,EAAiB,SAASE,CAAI;AAEhD,SAAKC,KAGDA,aAAuBC,MAC1BD,IAAcA,EAAY,SAE3BF,KAAA,QAAAA,EAAsBE,IACf,EAAE,OAAO,QANRE,EAAY,KAAK,MAAM,GAAIP,EAAkB,CAAC,CAAC,6BAA6B;AAOrF,CAAC;"}
@@ -1,14 +0,0 @@
1
- import { C as n } from "./main-CXiltWT-.js";
2
- const s = new n().setManual({
3
- purpose: "Clear terminal screen"
4
- }).setExecute(function(t, r) {
5
- const { pushHistory: e } = r;
6
- return e == null || e({
7
- clear: !0,
8
- isInput: !1
9
- }), { blank: !0 };
10
- });
11
- export {
12
- s as clear
13
- };
14
- //# sourceMappingURL=clear-BF9eb1Dq.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"clear-BF9eb1Dq.js","sources":["../../src/core/commands/clear.ts"],"sourcesContent":["import { Command, ExecuteParams } from \"../command\";\n\nexport const clear = new Command()\n\t.setManual({\n\t\tpurpose: \"Clear terminal screen\",\n\t})\n\t.setExecute(function(_args, params) {\n\t\tconst { pushHistory } = params as ExecuteParams;\n\t\tpushHistory?.({\n\t\t\tclear: true,\n\t\t\tisInput: false,\n\t\t});\n\t\n\t\treturn { blank: true };\n\t});"],"names":["clear","Command","_args","params","pushHistory"],"mappings":";AAEO,MAAMA,IAAQ,IAAIC,EAAQ,EAC/B,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,SAASC,GAAOC,GAAQ;AAC7B,QAAA,EAAE,aAAAC,EAAgB,IAAAD;AACV,SAAAC,KAAA,QAAAA,EAAA;AAAA,IACb,OAAO;AAAA,IACP,SAAS;AAAA,EAAA,IAGH,EAAE,OAAO;AACjB,CAAC;"}
@@ -1,59 +0,0 @@
1
- import { Vector2 as x } from "@prozilla-os/core";
2
- import { randomRange as u, removeFromArray as d, randomFromArray as l, ANSI as m } from "@prozilla-os/shared";
3
- import { C as w, S as E } from "./main-CXiltWT-.js";
4
- const g = 1.25, c = 75, S = 20, z = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.*\\/()#@&$!?%°:<>[]", f = {
5
- framesBetweenSpawn: 30,
6
- fallSpeed: 1,
7
- minSize: 5,
8
- maxSize: 25
9
- };
10
- function A(s, r, i) {
11
- if (s % f.framesBetweenSpawn) {
12
- const o = {
13
- position: new x(u(0, c), S).round(),
14
- size: Math.round(u(f.minSize, f.maxSize))
15
- };
16
- i.push(o);
17
- }
18
- return i.forEach((o) => {
19
- o.position.y -= f.fallSpeed;
20
- for (let n = 0; n < f.fallSpeed; n++) {
21
- const t = o.position.x, e = o.position.y + n + o.size;
22
- e < S && e >= 0 && (r[e][t] = " ");
23
- }
24
- if (o.position.y + o.size <= 0 || o.position.x >= c)
25
- return d(o, i);
26
- for (let n = 0; n < o.size; n++) {
27
- const t = l(z.split(""));
28
- let e = n == 0 ? m.fg.white : m.fg.green;
29
- n > o.size / 2 && (e = m.fg.green + m.decoration.dim);
30
- const a = o.position.x, p = o.position.y + n;
31
- a < c && p < S && p >= 0 && (r[p][a] = e + t + m.reset);
32
- }
33
- }), [...r.map((o) => o.join(""))].reverse().join(`
34
- `);
35
- }
36
- const C = new w().setManual({
37
- purpose: "Show a scrolling 'Matrix' like screen",
38
- usage: "cmatrix"
39
- }).setExecute(function() {
40
- const s = new E(), r = [], i = [];
41
- for (let t = 0; t < S; t++) {
42
- const e = [];
43
- for (let a = 0; a < c; a++)
44
- e.push(" ");
45
- i.push(e);
46
- }
47
- let o = 0;
48
- const n = setInterval(() => {
49
- const t = A(o, i, r);
50
- s.send(t), o++;
51
- }, 100 / g);
52
- return s.on(E.EVENT_NAMES.stop, () => {
53
- clearInterval(n);
54
- }), s.start(), s;
55
- });
56
- export {
57
- C as cmatrix
58
- };
59
- //# sourceMappingURL=cmatrix-VYovsHQW.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cmatrix-VYovsHQW.js","sources":["../../src/core/commands/cmatrix.ts"],"sourcesContent":["import { Vector2 } from \"@prozilla-os/core\";\nimport { ANSI, randomFromArray, randomRange, removeFromArray } from \"@prozilla-os/shared\";\nimport { Command } from \"../command\";\nimport { Stream } from \"../stream\";\n\nconst ANIMATION_SPEED = 1.25;\nconst SCREEN_WIDTH = 75;\nconst SCREEN_HEIGHT = 20;\nconst CHARACTERS = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.*\\\\/()#@&$!?%°:<>[]\";\n\nconst PARTICLES = {\n\tframesBetweenSpawn: 30,\n\tfallSpeed: 1,\n\tminSize: 5,\n\tmaxSize: 25,\n};\n\ntype Particle = {\n\tposition: Vector2,\n\tsize: number;\n};\n\nfunction generateScreen(frame: number, screen: string[][], particles: Particle[]): string {\n\t// Spawn new particles\n\tif (frame % PARTICLES.framesBetweenSpawn) {\n\t\tconst newParticle: Particle = {\n\t\t\tposition: new Vector2(randomRange(0, SCREEN_WIDTH), SCREEN_HEIGHT).round(),\n\t\t\tsize: Math.round(randomRange(PARTICLES.minSize, PARTICLES.maxSize)),\n\t\t};\n\t\tparticles.push(newParticle);\n\t}\n\n\t// Move and render particles\n\tparticles.forEach((particle) => {\n\t\tparticle.position.y -= PARTICLES.fallSpeed;\n\n\t\t// Clean previous render\n\t\tfor (let i = 0; i < PARTICLES.fallSpeed; i++) {\n\t\t\tconst positionX = particle.position.x;\n\t\t\tconst positionY = particle.position.y + i + particle.size;\n\n\t\t\tif (positionY < SCREEN_HEIGHT && positionY >= 0)\n\t\t\t\tscreen[positionY][positionX] = \" \";\n\t\t}\n\n\t\t// Remove offscreen particles\n\t\tif (particle.position.y + particle.size <= 0 || particle.position.x >= SCREEN_WIDTH)\n\t\t\treturn removeFromArray(particle, particles);\n\n\t\tfor (let i = 0; i < particle.size; i++) {\n\t\t\tconst character = randomFromArray(CHARACTERS.split(\"\"));\n\t\t\tlet color = i == 0 ? ANSI.fg.white : ANSI.fg.green;\n\n\t\t\tif (i > particle.size / 2)\n\t\t\t\tcolor = ANSI.fg.green + ANSI.decoration.dim;\n\n\t\t\tconst positionX = particle.position.x;\n\t\t\tconst positionY = particle.position.y + i;\n\n\t\t\tif (positionX < SCREEN_WIDTH && positionY < SCREEN_HEIGHT && positionY >= 0) {\n\t\t\t\tscreen[positionY][positionX] = color + character + ANSI.reset;\n\t\t\t}\n\t\t}\n\t});\n\n\treturn [...screen.map((row) => row.join(\"\"))].reverse().join(\"\\n\");\n}\n\nexport const cmatrix = new Command()\n\t.setManual({\n\t\tpurpose: \"Show a scrolling 'Matrix' like screen\",\n\t\tusage: \"cmatrix\",\n\t})\n\t.setExecute(function() {\n\t\tconst stream = new Stream();\n\t\tconst particles: Particle[] = [];\n\n\t\t// Create screen\n\t\tconst screen: string[][] = [];\n\t\tfor (let y = 0; y < SCREEN_HEIGHT; y++) {\n\t\t\tconst row: string[] = [];\n\t\t\tfor (let x = 0; x < SCREEN_WIDTH; x++) {\n\t\t\t\trow.push(\" \");\n\t\t\t}\n\t\t\tscreen.push(row);\n\t\t}\n\n\t\tlet frame = 0;\n\t\tconst interval = setInterval(() => {\n\t\t\tconst text = generateScreen(frame, screen, particles);\n\t\t\tstream.send(text);\n\t\t\tframe++;\n\t\t}, 100 / ANIMATION_SPEED);\n\n\t\tstream.on(Stream.EVENT_NAMES.stop, () => {\n\t\t\tclearInterval(interval);\n\t\t});\n\n\t\tstream.start();\n\n\t\treturn stream;\n\t});"],"names":["ANIMATION_SPEED","SCREEN_WIDTH","SCREEN_HEIGHT","CHARACTERS","PARTICLES","generateScreen","frame","screen","particles","newParticle","Vector2","randomRange","particle","i","positionX","positionY","removeFromArray","character","randomFromArray","color","ANSI","row","cmatrix","Command","stream","Stream","y","x","interval","text"],"mappings":";;;AAKA,MAAMA,IAAkB,MAClBC,IAAe,IACfC,IAAgB,IAChBC,IAAa,sFAEbC,IAAY;AAAA,EACjB,oBAAoB;AAAA,EACpB,WAAW;AAAA,EACX,SAAS;AAAA,EACT,SAAS;AACV;AAOA,SAASC,EAAeC,GAAeC,GAAoBC,GAA+B;AAErF,MAAAF,IAAQF,EAAU,oBAAoB;AACzC,UAAMK,IAAwB;AAAA,MAC7B,UAAU,IAAIC,EAAQC,EAAY,GAAGV,CAAY,GAAGC,CAAa,EAAE,MAAM;AAAA,MACzE,MAAM,KAAK,MAAMS,EAAYP,EAAU,SAASA,EAAU,OAAO,CAAC;AAAA,IAAA;AAEnE,IAAAI,EAAU,KAAKC,CAAW;AAAA,EAC3B;AAGU,SAAAD,EAAA,QAAQ,CAACI,MAAa;AACtB,IAAAA,EAAA,SAAS,KAAKR,EAAU;AAGjC,aAASS,IAAI,GAAGA,IAAIT,EAAU,WAAWS,KA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MAAIf,IAAQ;AACN,QAAAsB,IAAW,YAAY,MAAM;AAClC,UAAMC,IAAOxB,EAAeC,GAAOC,GAAQC,CAAS;AACpD,IAAAgB,EAAO,KAAKK,CAAI,GAChBvB;AAAA,EAAA,GACE,MAAMN,CAAe;AAExB,SAAAwB,EAAO,GAAGC,EAAO,YAAY,MAAM,MAAM;AACxC,kBAAcG,CAAQ;AAAA,EAAA,CACtB,GAEDJ,EAAO,MAAM,GAENA;AACR,CAAC;"}
@@ -1,13 +0,0 @@
1
- import { C as s, a as o } from "./main-CXiltWT-.js";
2
- const r = new s().setManual({
3
- purpose: "Display a list of all commands"
4
- }).setRequireOptions(!0).setExecute(function(t, e) {
5
- const { options: a } = e;
6
- if (a != null && a.includes("c"))
7
- return o.COMMANDS.map((n) => n.name).sort().join(`
8
- `);
9
- });
10
- export {
11
- r as compgen
12
- };
13
- //# sourceMappingURL=compgen-3TwdgHm_.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"compgen-3TwdgHm_.js","sources":["../../src/core/commands/compgen.ts"],"sourcesContent":["import { Command, ExecuteParams } from \"../command\";\nimport { CommandsManager } from \"../commands\";\n\nexport const compgen = new Command()\n\t.setManual({\n\t\tpurpose: \"Display a list of all commands\",\n\t})\n\t.setRequireOptions(true)\n\t.setExecute(function(_args, params) {\n\t\tconst { options } = params as ExecuteParams;\n\t\tif (options?.includes(\"c\")) {\n\t\t\treturn CommandsManager.COMMANDS.map((command) => command.name).sort().join(\"\\n\");\n\t\t}\n\t});"],"names":["compgen","Command","_args","params","options","CommandsManager","command"],"mappings":";AAGO,MAAMA,IAAU,IAAIC,EAAQ,EACjC,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,kBAAkB,EAAI,EACtB,WAAW,SAASC,GAAOC,GAAQ;AAC7B,QAAA,EAAE,SAAAC,EAAY,IAAAD;AAChB,MAAAC,KAAA,QAAAA,EAAS,SAAS;AACd,WAAAC,EAAgB,SAAS,IAAI,CAACC,MAAYA,EAAQ,IAAI,EAAE,KAAA,EAAO,KAAK;AAAA,CAAI;AAEjF,CAAC;"}
@@ -1,49 +0,0 @@
1
- import { C as _, M as p } from "./main-CXiltWT-.js";
2
- const m = `
3
- \\ ^__^
4
- \\ (oo)\\_______
5
- (__)\\ )\\/\\
6
- ||----w |
7
- || ||`, $ = new _().setRequireArgs(!0).setManual({
8
- purpose: "Show a cow saying something",
9
- usage: "cowsay text",
10
- description: "Show ASCII art of a cow saying something."
11
- }).setExecute(function(w, u) {
12
- const { rawInputValue: c } = u, l = c == null ? void 0 : c.split(" "), o = [];
13
- let s = "", r = 0;
14
- const a = (e) => {
15
- e = e.trimEnd(), o.push(e), e.length > r && (r = e.length);
16
- }, h = (e) => {
17
- a(s), e ? s = e + " " : s = "";
18
- };
19
- l == null || l.forEach((e) => {
20
- if (e === "") {
21
- s += " ";
22
- return;
23
- }
24
- const t = e.split(`
25
- `);
26
- for (let n = 0; n < t.length; n++) {
27
- const i = t[n];
28
- if (n > 0 && h(), (s + i).length <= p)
29
- s += i + " ";
30
- else if (i.length > p) {
31
- const f = p - s.length;
32
- f >= 2 ? (a(s + i.substring(0, f - 1) + "-"), s = i.substring(f - 1) + " ") : h(i);
33
- } else
34
- h(i);
35
- }
36
- }), s.length > 0 && a(s);
37
- const g = [` ${"_".repeat(r + 2)} `];
38
- for (let e = 0; e < o.length; e++) {
39
- let t = o[e];
40
- const n = r - t.length;
41
- n > 0 && (t += " ".repeat(n)), o.length > 1 ? e === 0 ? t = `/ ${t} \\` : e === o.length - 1 ? t = `\\ ${t} /` : t = `| ${t} |` : t = `< ${t} >`, g.push(t);
42
- }
43
- return g.push(` ${"-".repeat(r + 2)} `), g.join(`
44
- `) + m;
45
- });
46
- export {
47
- $ as cowsay
48
- };
49
- //# sourceMappingURL=cowsay-IfArfPSJ.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cowsay-IfArfPSJ.js","sources":["../../src/core/commands/cowsay.ts"],"sourcesContent":["import { MAX_WIDTH } from \"../../constants/terminal.const\";\nimport { Command, ExecuteParams } from \"../command\";\n\nconst COW = `\n \\\\ ^__^\n \\\\ (oo)\\\\_______\n (__)\\\\ )\\\\/\\\\\n ||----w |\n || ||`;\n\nexport const cowsay = new Command()\n\t.setRequireArgs(true)\n\t.setManual({\n\t\tpurpose: \"Show a cow saying something\",\n\t\tusage: \"cowsay text\",\n\t\tdescription: \"Show ASCII art of a cow saying something.\",\n\t})\n\t.setExecute(function(_args, params) {\n\t\tconst { rawInputValue } = params as ExecuteParams;\n\n\t\t// Separate input value into lines\n\t\tconst segments = rawInputValue?.split(\" \");\n\t\tconst lines: string[] = [];\n\t\tlet currentLine = \"\";\n\t\tlet maxLineWidth = 0;\n\n\t\tconst addLine = (line: string) => {\n\t\t\tline = line.trimEnd();\n\t\t\tlines.push(line);\n\t\t\tif (line.length > maxLineWidth)\n\t\t\t\tmaxLineWidth = line.length;\n\t\t};\n\n\t\tconst nextLine = (word?: string) => {\n\t\t\taddLine(currentLine);\n\n\t\t\tif (word) {\n\t\t\t\tcurrentLine = word + \" \";\n\t\t\t} else {\n\t\t\t\tcurrentLine = \"\";\n\t\t\t}\n\t\t};\n\n\t\tsegments?.forEach((segment) => {\n\t\t\t// Add empty spaces preceding lines\n\t\t\tif (segment === \"\") {\n\t\t\t\tcurrentLine += \" \";\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst words = segment.split(\"\\n\");\n\t\t\tfor (let i = 0; i < words.length; i++) {\n\t\t\t\tconst word = words[i];\n\t\t\t\t\n\t\t\t\t// Handle next lines\n\t\t\t\tif (i > 0)\n\t\t\t\t\tnextLine();\n\n\t\t\t\t// Fit word on current line\n\t\t\t\tif ((currentLine + word).length <= MAX_WIDTH) {\n\t\t\t\t\tcurrentLine += word + \" \";\n\t\t\t\t} else if (word.length > MAX_WIDTH) {\n\t\t\t\t\tconst remainingSpaces = MAX_WIDTH - currentLine.length;\n\n\t\t\t\t\tif (remainingSpaces >= 2) {\n\t\t\t\t\t\taddLine(currentLine + word.substring(0, remainingSpaces - 1) + \"-\");\n\t\t\t\t\t\tcurrentLine = word.substring(remainingSpaces - 1) + \" \";\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnextLine(word);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tnextLine(word);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tif (currentLine.length > 0)\n\t\t\taddLine(currentLine);\n\n\t\t// Turn lines into speech bubble\n\t\tconst speechBubble = [` ${\"_\".repeat(maxLineWidth + 2)} `];\n\n\t\tfor (let i = 0; i < lines.length; i++) {\n\t\t\tlet line = lines[i];\n\t\t\tconst missingSpaces = maxLineWidth - line.length;\n\n\t\t\tif (missingSpaces > 0)\n\t\t\t\tline += \" \".repeat(missingSpaces);\n\n\t\t\tif (lines.length > 1) {\n\t\t\t\tif (i === 0) {\n\t\t\t\t\tline = `/ ${line} \\\\`;\n\t\t\t\t} else if (i === lines.length - 1) {\n\t\t\t\t\tline = `\\\\ ${line} /`;\n\t\t\t\t} else {\n\t\t\t\t\tline = `| ${line} |`;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tline = `< ${line} >`;\n\t\t\t}\n\n\t\t\tspeechBubble.push(line);\n\t\t}\n\n\t\tspeechBubble.push(` ${\"-\".repeat(maxLineWidth + 2)} `);\n\n\t\treturn speechBubble.join(\"\\n\") + COW;\n\t});"],"names":["COW","cowsay","Command","_args","params","rawInputValue","segments","lines","currentLine","maxLineWidth","addLine","line","nextLine","word","segment","words","i","MAX_WIDTH","remainingSpaces","speechBubble","missingSpaces"],"mappings":";AAGA,MAAMA,IAAM;AAAA;AAAA;AAAA;AAAA;AAAA,4BAOCC,IAAS,IAAIC,IACxB,eAAe,EAAI,EACnB,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AAAA,EACP,aAAa;AACd,CAAC,EACA,WAAW,SAASC,GAAOC,GAAQ;AAC7B,QAAA,EAAE,eAAAC,EAAkB,IAAAD,GAGpBE,IAAWD,KAAA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,MAAM,IACTL,IAAO,KAAKA,CAAI,QACNK,MAAMT,EAAM,SAAS,IAC/BI,IAAO,MAAMA,CAAI,OAEjBA,IAAO,KAAKA,CAAI,OAGjBA,IAAO,KAAKA,CAAI,MAGjBQ,EAAa,KAAKR,CAAI;AAAA,EACvB;AAEA,SAAAQ,EAAa,KAAK,IAAI,IAAI,OAAOV,IAAe,CAAC,CAAC,GAAG,GAE9CU,EAAa,KAAK;AAAA,CAAI,IAAInB;AAClC,CAAC;"}
@@ -1,11 +0,0 @@
1
- import { C as s } from "./main-CXiltWT-.js";
2
- const c = new s().setManual({
3
- purpose: "List all directories in the current directory"
4
- }).setExecute(function(i, t) {
5
- const { currentDirectory: o } = t, e = o.subFolders.map((r) => r.id);
6
- return e.length === 0 ? { blank: !0 } : e.sort((r, n) => r.localeCompare(n)).join(" ");
7
- });
8
- export {
9
- c as dir
10
- };
11
- //# sourceMappingURL=dir-B_Ipo5xb.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dir-B_Ipo5xb.js","sources":["../../src/core/commands/dir.ts"],"sourcesContent":["import { Command, ExecuteParams } from \"../command\";\n\nexport const dir = new Command()\n\t.setManual({\n\t\tpurpose: \"List all directories in the current directory\",\n\t})\n\t.setExecute(function(_args, params) {\n\t\tconst { currentDirectory } = params as ExecuteParams;\n\t\tconst folderNames = currentDirectory.subFolders.map((folder) => folder.id);\n\t\n\t\tif (folderNames.length === 0)\n\t\t\treturn { blank: true };\n\t\n\t\treturn folderNames.sort((nameA, nameB) => nameA.localeCompare(nameB)).join(\" \");\n\t});"],"names":["dir","Command","_args","params","currentDirectory","folderNames","folder","nameA","nameB"],"mappings":";AAEO,MAAMA,IAAM,IAAIC,EAAQ,EAC7B,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,SAASC,GAAOC,GAAQ;AAC7B,QAAA,EAAE,kBAAAC,EAAqB,IAAAD,GACvBE,IAAcD,EAAiB,WAAW,IAAI,CAACE,MAAWA,EAAO,EAAE;AAEzE,SAAID,EAAY,WAAW,IACnB,EAAE,OAAO,OAEVA,EAAY,KAAK,CAACE,GAAOC,MAAUD,EAAM,cAAcC,CAAK,CAAC,EAAE,KAAK,GAAG;AAC/E,CAAC;"}
@@ -1,11 +0,0 @@
1
- import { C as n } from "./main-CXiltWT-.js";
2
- const a = new n().setManual({
3
- purpose: "Display text on the terminal screen"
4
- }).setExecute(function(o, e) {
5
- const { rawInputValue: t } = e;
6
- return t;
7
- });
8
- export {
9
- a as echo
10
- };
11
- //# sourceMappingURL=echo-DX-Ar2Ut.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"echo-DX-Ar2Ut.js","sources":["../../src/core/commands/echo.ts"],"sourcesContent":["import { Command, ExecuteParams } from \"../command\";\n\nexport const echo = new Command()\n\t.setManual({\n\t\tpurpose: \"Display text on the terminal screen\",\n\t})\n\t.setExecute(function(_args, params) {\n\t\tconst { rawInputValue } = params as ExecuteParams;\n\t\treturn rawInputValue;\n\t});"],"names":["echo","Command","_args","params","rawInputValue"],"mappings":";AAEO,MAAMA,IAAO,IAAIC,EAAQ,EAC9B,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,SAASC,GAAOC,GAAQ;AAC7B,QAAA,EAAE,eAAAC,EAAkB,IAAAD;AACnB,SAAAC;AACR,CAAC;"}
@@ -1,14 +0,0 @@
1
- import { C as Command } from "./main-CXiltWT-.js";
2
- const evalCommand = new Command().setRequireArgs(!0).setManual({
3
- purpose: "Evaluate and execute JavaScript code",
4
- usage: "eval [input]"
5
- }).setRequireArgs(!0).setExecute(function(args) {
6
- if (args == null || args.length == 0)
7
- return;
8
- const output = eval(args[0]) ?? { blank: !0 };
9
- return output;
10
- });
11
- export {
12
- evalCommand as eval
13
- };
14
- //# sourceMappingURL=eval-C7InkmFY.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"eval-C7InkmFY.js","sources":["../../src/core/commands/eval.ts"],"sourcesContent":["import { Command, CommandResponse } from \"../command\";\n\nconst evalCommand = new Command()\n\t.setRequireArgs(true)\n\t.setManual({\n\t\tpurpose: \"Evaluate and execute JavaScript code\",\n\t\tusage: \"eval [input]\",\n\t})\n\t.setRequireArgs(true)\n\t.setExecute(function(this: Command, args) {\n\t\tif (args == null || args.length == 0)\n\t\t\treturn;\n\t\t\n\t\tconst output = eval(args[0]) as CommandResponse ?? { blank: true };\n\t\treturn output;\n\t});\n\nexport { evalCommand as eval };"],"names":[],"mappings":";AAEA,MAAM,cAAc,IAAI,UACtB,eAAe,EAAI,EACnB,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AACR,CAAC,EACA,eAAe,EAAI,EACnB,WAAW,SAAwB,MAAM;AACrC,MAAA,QAAQ,QAAQ,KAAK,UAAU;AAClC;AAEK,QAAA,SAAS,KAAK,KAAK,CAAC,CAAC,KAAwB,EAAE,OAAO;AACrD,SAAA;AACR,CAAC;"}
@@ -1,11 +0,0 @@
1
- import { C as n } from "./main-CXiltWT-.js";
2
- const o = new n().setManual({
3
- purpose: "Quit terminal interface"
4
- }).setExecute(function(r, e) {
5
- const { exit: t } = e;
6
- return t == null || t(), { blank: !0 };
7
- });
8
- export {
9
- o as exit
10
- };
11
- //# sourceMappingURL=exit-D7PPqtiE.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"exit-D7PPqtiE.js","sources":["../../src/core/commands/exit.ts"],"sourcesContent":["import { Command, ExecuteParams } from \"../command\";\n\nexport const exit = new Command()\n\t.setManual({\n\t\tpurpose: \"Quit terminal interface\",\n\t})\n\t.setExecute(function(_args, params) {\n\t\tconst { exit } = params as ExecuteParams;\n\t\texit?.();\n\t\treturn { blank: true };\n\t});"],"names":["exit","Command","_args","params"],"mappings":";AAEO,MAAMA,IAAO,IAAIC,EAAQ,EAC9B,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,SAASC,GAAOC,GAAQ;AAC7B,QAAA,EAAE,MAAAH,EAAS,IAAAG;AACjBH,SAAAA,KAAAA,QAAAA,KACO,EAAE,OAAO;AACjB,CAAC;"}
@@ -1,59 +0,0 @@
1
- import { randomFromArray as e } from "@prozilla-os/shared";
2
- import { C as o } from "./main-CXiltWT-.js";
3
- const t = [
4
- "Do not be afraid of competition.",
5
- "An exciting opportunity lies ahead of you.",
6
- "You love peace.",
7
- "Get your mind set... confidence will lead you on.",
8
- "You will always be surrounded by true friends.",
9
- "Sell your ideas-they have exceptional merit.",
10
- "You should be able to undertake and complete anything.",
11
- "You are kind and friendly.",
12
- "You are wise beyond your years.",
13
- "Your ability to juggle many tasks will take you far.",
14
- "A routine task will turn into an enchanting adventure.",
15
- "Beware of all enterprises that require new clothes.",
16
- "Be true to your work, your word, and your friend.",
17
- "Goodness is the only investment that never fails.",
18
- "A journey of a thousand miles begins with a single step.",
19
- "Forget injuries; never forget kindnesses.",
20
- "Respect yourself and others will respect you.",
21
- "A man cannot be comfortable without his own approval.",
22
- "Always do right. This will gratify some people and astonish the rest.",
23
- "It is easier to stay out than to get out.",
24
- "Sing everyday and chase the mean blues away.",
25
- "You will receive money from an unexpected source.",
26
- "Attitude is a little thing that makes a big difference.",
27
- "Plan for many pleasures ahead.",
28
- "Experience is the best teacher.",
29
- "You will be happy with your spouse.",
30
- "Expect the unexpected.",
31
- "Stay healthy. Walk a mile.",
32
- "The family that plays together stays together.",
33
- "Eat chocolate to have a sweeter life.",
34
- "Once you make a decision the universe conspires to make it happen.",
35
- "Make yourself necessary to someone.",
36
- "The only way to have a friend is to be one.",
37
- "Nothing great was ever achieved without enthusiasm.",
38
- "Dance as if no one is watching.",
39
- "Live this day as if it were your last.",
40
- "Your life will be happy and peaceful.",
41
- "Reach for joy and all else will follow.",
42
- "Move in the direction of your dreams.",
43
- "Bloom where you are planted.",
44
- "Appreciate. Appreciate. Appreciate.",
45
- "Happy News is on its way.",
46
- "A closed mouth gathers no feet.",
47
- "He who throws dirt is losing ground.",
48
- "Borrow money from a pessimist. They don't expect it back.",
49
- "Life is what happens to you while you are busy making other plans.",
50
- "Help! I'm being held prisoner in a fortune cookie factory."
51
- ], n = new o().setManual({
52
- purpose: "Tell fortune"
53
- }).setExecute(function() {
54
- return e(t);
55
- });
56
- export {
57
- n as fortune
58
- };
59
- //# sourceMappingURL=fortune-zyxpnYNP.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fortune-zyxpnYNP.js","sources":["../../src/core/commands/fortune.ts"],"sourcesContent":["import { randomFromArray } from \"@prozilla-os/shared\";\nimport { Command } from \"../command\";\n\n/**\n * Source: https://github.com/shlomif/fortune-mod/blob/master/fortune-mod/datfiles/fortunes\n */\nconst FORTUNES = [\n\t\"Do not be afraid of competition.\",\n\t\"An exciting opportunity lies ahead of you.\",\n\t\"You love peace.\",\n\t\"Get your mind set... confidence will lead you on.\",\n\t\"You will always be surrounded by true friends.\",\n\t\"Sell your ideas-they have exceptional merit.\",\n\t\"You should be able to undertake and complete anything.\",\n\t\"You are kind and friendly.\",\n\t\"You are wise beyond your years.\",\n\t\"Your ability to juggle many tasks will take you far.\",\n\t\"A routine task will turn into an enchanting adventure.\",\n\t\"Beware of all enterprises that require new clothes.\",\n\t\"Be true to your work, your word, and your friend.\",\n\t\"Goodness is the only investment that never fails.\",\n\t\"A journey of a thousand miles begins with a single step.\",\n\t\"Forget injuries; never forget kindnesses.\",\n\t\"Respect yourself and others will respect you.\",\n\t\"A man cannot be comfortable without his own approval.\",\n\t\"Always do right. This will gratify some people and astonish the rest.\",\n\t\"It is easier to stay out than to get out.\",\n\t\"Sing everyday and chase the mean blues away.\",\n\t\"You will receive money from an unexpected source.\",\n\t\"Attitude is a little thing that makes a big difference.\",\n\t\"Plan for many pleasures ahead.\",\n\t\"Experience is the best teacher.\",\n\t\"You will be happy with your spouse.\",\n\t\"Expect the unexpected.\",\n\t\"Stay healthy. Walk a mile.\",\n\t\"The family that plays together stays together.\",\n\t\"Eat chocolate to have a sweeter life.\",\n\t\"Once you make a decision the universe conspires to make it happen.\",\n\t\"Make yourself necessary to someone.\",\n\t\"The only way to have a friend is to be one.\",\n\t\"Nothing great was ever achieved without enthusiasm.\",\n\t\"Dance as if no one is watching.\",\n\t\"Live this day as if it were your last.\",\n\t\"Your life will be happy and peaceful.\",\n\t\"Reach for joy and all else will follow.\",\n\t\"Move in the direction of your dreams.\",\n\t\"Bloom where you are planted.\",\n\t\"Appreciate. Appreciate. Appreciate.\",\n\t\"Happy News is on its way.\",\n\t\"A closed mouth gathers no feet.\",\n\t\"He who throws dirt is losing ground.\",\n\t\"Borrow money from a pessimist. They don't expect it back.\",\n\t\"Life is what happens to you while you are busy making other plans.\",\n\t\"Help! I'm being held prisoner in a fortune cookie factory.\",\n];\n\nexport const fortune = new Command()\n\t.setManual({\n\t\tpurpose: \"Tell fortune\",\n\t})\n\t.setExecute(function() {\n\t\treturn randomFromArray(FORTUNES);\n\t});"],"names":["FORTUNES","fortune","Command","randomFromArray"],"mappings":";;AAMA,MAAMA,IAAW;AAAA,EAChB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAEaC,IAAU,IAAIC,EAAQ,EACjC,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,WAAW;AACtB,SAAOC,EAAgBH,CAAQ;AAChC,CAAC;"}
@@ -1,17 +0,0 @@
1
- import { ANSI as t } from "@prozilla-os/shared";
2
- import { C as i, a as u, f } from "./main-CXiltWT-.js";
3
- const l = new i().setExecute(function(n) {
4
- var a;
5
- if ((n == null ? void 0 : n.length) === 0)
6
- return u.COMMANDS.map((e) => {
7
- var m;
8
- return (m = e.manual) != null && m.purpose ? `${e.name} - ${t.fg.green}${t.decoration.dim}${e.manual.purpose}${t.reset}` : e.name;
9
- }).sort().join(`
10
- `);
11
- const o = n[0].toLowerCase(), r = u.find(o);
12
- return r ? (a = r.manual) != null && a.purpose ? r.manual.purpose : f(this.name, `${o}: No manual found`) : f(this.name, `${o}: Command not found`);
13
- });
14
- export {
15
- l as help
16
- };
17
- //# sourceMappingURL=help-BEgNbwLL.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"help-BEgNbwLL.js","sources":["../../src/core/commands/help.ts"],"sourcesContent":["import { ANSI } from \"@prozilla-os/shared\";\nimport { formatError } from \"../_utils/terminal.utils\";\nimport { Command } from \"../command\";\nimport { CommandsManager } from \"../commands\";\n\nexport const help = new Command()\n\t.setExecute(function(this: Command, args) {\n\t\tif (args?.length === 0) {\n\t\t\treturn CommandsManager.COMMANDS.map((command) => {\n\t\t\t\tif (command.manual?.purpose) {\n\t\t\t\t\treturn `${command.name} - ${ANSI.fg.green}${ANSI.decoration.dim}${command.manual.purpose}${ANSI.reset}`;\n\t\t\t\t} else {\n\t\t\t\t\treturn command.name;\n\t\t\t\t}\n\t\t\t}).sort().join(\"\\n\");\n\t\t}\n\n\t\tconst commandName = (args as string[])[0].toLowerCase();\n\t\tconst command = CommandsManager.find(commandName);\n\n\t\tif (!command)\n\t\t\treturn formatError(this.name, `${commandName}: Command not found`);\n\n\t\tif (!command.manual?.purpose)\n\t\t\treturn formatError(this.name, `${commandName}: No manual found`);\n\n\t\treturn command.manual.purpose;\n\t});"],"names":["help","Command","args","CommandsManager","command","ANSI","commandName","_a","formatError"],"mappings":";;AAKO,MAAMA,IAAO,IAAIC,EAAA,EACtB,WAAW,SAAwBC,GAAM;;AACrC,OAAAA,KAAA,gBAAAA,EAAM,YAAW;AACpB,WAAOC,EAAgB,SAAS,IAAI,CAACC,MAAY;;AAC5CA,cAAAA,IAAAA,EAAQ,WAARA,QAAAA,EAAgB,UACX,GAAGA,EAAQ,IAAI,MAAMC,EAAK,GAAG,KAAK,GAAGA,EAAK,WAAW,GAAG,GAAGD,EAAQ,OAAO,OAAO,GAAGC,EAAK,KAAK,KAE/FD,EAAQ;AAAA,IAEhB,CAAA,EAAE,KAAK,EAAE,KAAK;AAAA,CAAI;AAGpB,QAAME,IAAeJ,EAAkB,CAAC,EAAE,YAAY,GAChDE,IAAUD,EAAgB,KAAKG,CAAW;AAEhD,SAAKF,KAGAG,IAAAH,EAAQ,WAAR,QAAAG,EAAgB,UAGdH,EAAQ,OAAO,UAFdI,EAAY,KAAK,MAAM,GAAGF,CAAW,mBAAmB,IAHxDE,EAAY,KAAK,MAAM,GAAGF,CAAW,qBAAqB;AAMnE,CAAC;"}
@@ -1,2 +0,0 @@
1
-
2
- //# sourceMappingURL=history-l0sNRNKZ.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"history-l0sNRNKZ.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,11 +0,0 @@
1
- import { C as n } from "./main-CXiltWT-.js";
2
- const a = new n().setManual({
3
- purpose: "Display the hostname"
4
- }).setExecute(function(o, t) {
5
- const { hostname: e } = t;
6
- return e;
7
- });
8
- export {
9
- a as hostname
10
- };
11
- //# sourceMappingURL=hostname-DU1lQde2.js.map