@prozilla-os/terminal 1.0.9 → 1.1.1

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 (83) hide show
  1. package/LICENSE +674 -0
  2. package/dist/{cat-Dp7MxLJO.js → cat-FW5-WCC9.js} +2 -2
  3. package/dist/{cat-Dp7MxLJO.js.map → cat-FW5-WCC9.js.map} +1 -1
  4. package/dist/{cd-zk1UnOo7.js → cd-CJ_-Ao6a.js} +2 -2
  5. package/dist/{cd-zk1UnOo7.js.map → cd-CJ_-Ao6a.js.map} +1 -1
  6. package/dist/{cmatrix-O49Zkqb8.js → cmatrix-Dp2xw_1D.js} +2 -2
  7. package/dist/{cmatrix-O49Zkqb8.js.map → cmatrix-Dp2xw_1D.js.map} +1 -1
  8. package/dist/{compgen-CA_GMRpy.js → compgen-yV_rUCTl.js} +2 -2
  9. package/dist/{compgen-CA_GMRpy.js.map → compgen-yV_rUCTl.js.map} +1 -1
  10. package/dist/{cowsay-BAYsU72K.js → cowsay-DhGebg2w.js} +2 -2
  11. package/dist/{cowsay-BAYsU72K.js.map → cowsay-DhGebg2w.js.map} +1 -1
  12. package/dist/eval-CnKC-mrj.js +14 -0
  13. package/dist/eval-CnKC-mrj.js.map +1 -0
  14. package/dist/{help-CYIno6WY.js → help-K3OSEH-4.js} +2 -2
  15. package/dist/{help-CYIno6WY.js.map → help-K3OSEH-4.js.map} +1 -1
  16. package/dist/{lolcat-LdzLGQur.js → lolcat-e6AdhtPY.js} +2 -2
  17. package/dist/{lolcat-LdzLGQur.js.map → lolcat-e6AdhtPY.js.map} +1 -1
  18. package/dist/{ls-Csd6ypmW.js → ls-Cv8zACh_.js} +2 -2
  19. package/dist/{ls-Csd6ypmW.js.map → ls-Cv8zACh_.js.map} +1 -1
  20. package/dist/{main-tAp_mbfZ.js → main-BY8DgnTe.js} +91 -90
  21. package/dist/{main-tAp_mbfZ.js.map → main-BY8DgnTe.js.map} +1 -1
  22. package/dist/main.js +1 -1
  23. package/dist/{make-DOc--PtL.js → make-Cr6zPi10.js} +2 -2
  24. package/dist/{make-DOc--PtL.js.map → make-Cr6zPi10.js.map} +1 -1
  25. package/dist/{man-CZoHwxyo.js → man-B0gSJec-.js} +2 -2
  26. package/dist/{man-CZoHwxyo.js.map → man-B0gSJec-.js.map} +1 -1
  27. package/dist/{neofetch-KcdwHJSJ.js → neofetch-Cq2qUtOn.js} +2 -2
  28. package/dist/{neofetch-KcdwHJSJ.js.map → neofetch-Cq2qUtOn.js.map} +1 -1
  29. package/dist/{reload-zi8L0xNG.js → reload-BMeeiK59.js} +2 -2
  30. package/dist/{reload-zi8L0xNG.js.map → reload-BMeeiK59.js.map} +1 -1
  31. package/dist/{rm-KQ9gM6fT.js → rm-DrsNwyIE.js} +2 -2
  32. package/dist/{rm-KQ9gM6fT.js.map → rm-DrsNwyIE.js.map} +1 -1
  33. package/dist/{rmdir-UqUqHZTI.js → rmdir-BZAP4H6B.js} +2 -2
  34. package/dist/{rmdir-UqUqHZTI.js.map → rmdir-BZAP4H6B.js.map} +1 -1
  35. package/dist/{sl-BOyfa7Iu.js → sl-iFJMGBu9.js} +2 -2
  36. package/dist/{sl-BOyfa7Iu.js.map → sl-iFJMGBu9.js.map} +1 -1
  37. package/dist/{touch-D_kKTiUQ.js → touch-4AvKZiqp.js} +2 -2
  38. package/dist/{touch-D_kKTiUQ.js.map → touch-4AvKZiqp.js.map} +1 -1
  39. package/dist/{whatis-CYD52uq2.js → whatis-iNlzdd4F.js} +2 -2
  40. package/dist/{whatis-CYD52uq2.js.map → whatis-iNlzdd4F.js.map} +1 -1
  41. package/package.json +4 -4
  42. package/LICENSE.md +0 -21
  43. package/dist/src/components/Ansi.d.ts +0 -9
  44. package/dist/src/components/InputLine.d.ts +0 -11
  45. package/dist/src/components/OutputLine.d.ts +0 -6
  46. package/dist/src/components/Terminal.d.ts +0 -6
  47. package/dist/src/constants/terminal.const.d.ts +0 -7
  48. package/dist/src/core/_utils/terminal.utils.d.ts +0 -2
  49. package/dist/src/core/command.d.ts +0 -50
  50. package/dist/src/core/commands/cat.d.ts +0 -2
  51. package/dist/src/core/commands/cd.d.ts +0 -2
  52. package/dist/src/core/commands/clear.d.ts +0 -2
  53. package/dist/src/core/commands/cmatrix.d.ts +0 -2
  54. package/dist/src/core/commands/compgen.d.ts +0 -2
  55. package/dist/src/core/commands/cowsay.d.ts +0 -2
  56. package/dist/src/core/commands/dir.d.ts +0 -2
  57. package/dist/src/core/commands/echo.d.ts +0 -2
  58. package/dist/src/core/commands/exit.d.ts +0 -2
  59. package/dist/src/core/commands/fortune.d.ts +0 -2
  60. package/dist/src/core/commands/help.d.ts +0 -2
  61. package/dist/src/core/commands/hostname.d.ts +0 -2
  62. package/dist/src/core/commands/lolcat.d.ts +0 -2
  63. package/dist/src/core/commands/ls.d.ts +0 -2
  64. package/dist/src/core/commands/make.d.ts +0 -2
  65. package/dist/src/core/commands/man.d.ts +0 -2
  66. package/dist/src/core/commands/mkdir.d.ts +0 -2
  67. package/dist/src/core/commands/neofetch.d.ts +0 -2
  68. package/dist/src/core/commands/pwd.d.ts +0 -2
  69. package/dist/src/core/commands/reboot.d.ts +0 -2
  70. package/dist/src/core/commands/reload.d.ts +0 -2
  71. package/dist/src/core/commands/rev.d.ts +0 -2
  72. package/dist/src/core/commands/rm.d.ts +0 -2
  73. package/dist/src/core/commands/rmdir.d.ts +0 -2
  74. package/dist/src/core/commands/sl.d.ts +0 -2
  75. package/dist/src/core/commands/touch.d.ts +0 -2
  76. package/dist/src/core/commands/uptime.d.ts +0 -2
  77. package/dist/src/core/commands/whatis.d.ts +0 -2
  78. package/dist/src/core/commands/whoami.d.ts +0 -2
  79. package/dist/src/core/commands.d.ts +0 -7
  80. package/dist/src/core/stream.d.ts +0 -18
  81. package/dist/src/main.d.ts +0 -4
  82. package/dist/tsconfig.tsbuildinfo +0 -1
  83. package/dist/vite.config.d.ts +0 -2
@@ -1,4 +1,4 @@
1
- import { f as p, S as g } from "./main-tAp_mbfZ.js";
1
+ import { f as p, S as g } from "./main-BY8DgnTe.js";
2
2
  import { C as w } from "./command-nBL1aO7T.js";
3
3
  const I = 1.25, i = [
4
4
  [
@@ -164,4 +164,4 @@ sl -w number`,
164
164
  export {
165
165
  M as sl
166
166
  };
167
- //# sourceMappingURL=sl-BOyfa7Iu.js.map
167
+ //# sourceMappingURL=sl-iFJMGBu9.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sl-BOyfa7Iu.js","sources":["../src/core/commands/sl.ts"],"sourcesContent":["import { formatError } from \"../_utils/terminal.utils\";\r\nimport { Command, ExecuteParams } from \"../command\";\r\nimport { Stream } from \"../stream\";\r\n\r\nconst ANIMATION_SPEED = 1.25;\r\n\r\nconst LOCOMOTIVE_SMOKE = [\r\n\t[\r\n\t\t\" (@@) ( ) (@) ( ) @@ () @ o @ o\",\r\n\t\t\" ( )\",\r\n\t\t\" (@@@@)\",\r\n\t\t\" ( )\",\r\n\t\t\"\",\r\n\t\t\" (@@@)\",\r\n\t],\r\n\t[\r\n\t\t\" ( ) (@@) ( ) (@) () @@ o @ o @\",\r\n\t\t\" (@@@)\",\r\n\t\t\" ( )\",\r\n\t\t\" (@@@@)\",\r\n\t\t\"\",\r\n\t\t\" ( )\",\r\n\t]\r\n];\r\n\r\nconst LOCOMOTIVE_TOP = [\r\n\t\" ==== ________ ___________\",\r\n\t\" _D _| |_______/ \\\\__I_I_____===__|_________|\",\r\n\t\" |(_)--- | H\\\\________/ | | =|___ ___| \",\r\n\t\" / | | H | | | | ||_| |_|| \",\r\n\t\" | | | H |__--------------------| [___] | \",\r\n\t\" | ________|___H__/__|_____/[][]~\\\\_______| | \",\r\n\t\" |/ | |-----------I_____I [][] [] D |=======|__\",\r\n];\r\n\r\nconst LOCOMOTIVE_BOTTOM = [\r\n\t[\r\n\t\t\"__/ =| o |=-~~\\\\ /~~\\\\ /~~\\\\ /~~\\\\ ____Y___________|__\",\r\n\t\t\" |/-=|___|= || || || |_____/~\\\\___/ \",\r\n\t\t\" \\\\_/ \\\\O=====O=====O=====O_/ \\\\_/ \",\r\n\t],\r\n\t[\r\n\t\t\"__/ =| o |=-~~\\\\ /~~\\\\ /~~\\\\ /~~\\\\ ____Y___________|__\",\r\n\t\t\" |/-=|___|=O=====O=====O=====O |_____/~\\\\___/ \",\r\n\t\t\" \\\\_/ \\\\__/ \\\\__/ \\\\__/ \\\\__/ \\\\_/ \",\r\n\t],\r\n\t[\r\n\t\t\"__/ =| o |=-O=====O=====O=====O \\\\ ____Y___________|__\",\r\n\t\t\" |/-=|___|= || || || |_____/~\\\\___/ \",\r\n\t\t\" \\\\_/ \\\\__/ \\\\__/ \\\\__/ \\\\__/ \\\\_/ \",\r\n\t],\r\n\t[\r\n\t\t\"__/ =| o |=-~O=====O=====O=====O\\\\ ____Y___________|__\",\r\n\t\t\" |/-=|___|= || || || |_____/~\\\\___/ \",\r\n\t\t\" \\\\_/ \\\\__/ \\\\__/ \\\\__/ \\\\__/ \\\\_/ \",\r\n\t],\r\n\t[\r\n\t\t\"__/ =| o |=-~~\\\\ /~~\\\\ /~~\\\\ /~~\\\\ ____Y___________|__\",\r\n\t\t\" |/-=|___|= O=====O=====O=====O|_____/~\\\\___/ \",\r\n\t\t\" \\\\_/ \\\\__/ \\\\__/ \\\\__/ \\\\__/ \\\\_/ \",\r\n\t],\r\n\t[\r\n\t\t\"__/ =| o |=-~~\\\\ /~~\\\\ /~~\\\\ /~~\\\\ ____Y___________|__\",\r\n\t\t\" |/-=|___|= || || || |_____/~\\\\___/ \",\r\n\t\t\" \\\\_/ \\\\_O=====O=====O=====O/ \\\\_/ \",\r\n\t]\r\n].reverse();\r\n\r\nconst COAL_WAGON = [\r\n\t\" \",\r\n\t\" _________________ \",\r\n\t\" _| \\\\_____A \",\r\n\t\" =| | \",\r\n\t\" -| | \",\r\n\t\"__|________________________|_\",\r\n\t\"|__________________________|_\",\r\n\t\" |_D__D__D_| |_D__D__D_| \",\r\n\t\" \\\\_/ \\\\_/ \\\\_/ \\\\_/ \",\r\n];\r\n\r\nconst EXTRA_WAGONS = [\r\n\t[\r\n\t\t\" _______================_______ \",\r\n\t\t\" | | ___ ___ ___ ___ | | \",\r\n\t\t\" | | | | | | | | | | | | \",\r\n\t\t\" | | |_| |_| |_| |_| | | \",\r\n\t\t\" | | | | \",\r\n\t\t\"__|__|____________________|__|__\",\r\n\t\t\"_|____________________________|_\",\r\n\t\t\" |_D__D__D_| |_D__D__D_| \",\r\n\t\t\" \\\\_/ \\\\_/ \\\\_/ \\\\_/ \",\r\n\t],\r\n\t[\r\n\t\t\" \",\r\n\t\t\" ________========__HH____ \",\r\n\t\t\" / HH \\\\ \",\r\n\t\t\"/ HH \\\\ \",\r\n\t\t\"\\\\ HH / \",\r\n\t\t\"_\\\\__________________HH____/__\",\r\n\t\t\"|__________________________|_\",\r\n\t\t\" |_D__D__D_| |_D__D__D_| \",\r\n\t\t\" \\\\_/ \\\\_/ \\\\_/ \\\\_/ \",\r\n\t],\r\n\t[\r\n\t\t\" \",\r\n\t\t\" \",\r\n\t\t\" \",\r\n\t\t\" \",\r\n\t\t\" \",\r\n\t\t\"_____________________________\",\r\n\t\t\"|__________________________|_\",\r\n\t\t\" |_D__D__D_| |_D__D__D_| \",\r\n\t\t\" \\\\_/ \\\\_/ \\\\_/ \\\\_/ \",\r\n\t],\r\n\t[\r\n\t\t\" \",\r\n\t\t\" _|__|___________|__|___ \",\r\n\t\t\" (_|__|___________|__|___) \",\r\n\t\t\" _(|__|___________|__|__)_ \",\r\n\t\t\" (__|__|___________|__|____)\",\r\n\t\t\"_(___|__|___________|__|__)__\",\r\n\t\t\"|__________________________|_\",\r\n\t\t\" |_D__D__D_| |_D__D__D_| \",\r\n\t\t\" \\\\_/ \\\\_/ \\\\_/ \\\\_/ \",\r\n\t],\r\n\t[\r\n\t\t\" \",\r\n\t\t\" ___________________________ \",\r\n\t\t\" \\\\ | | / \",\r\n\t\t\" \\\\ | | / \",\r\n\t\t\" |\\\\ | | /| \",\r\n\t\t\"__|_\\\\___|___________|___/_|__\",\r\n\t\t\"|__________________________|_\",\r\n\t\t\" |_D__D__D_| |_D__D__D_| \",\r\n\t\t\" \\\\_/ \\\\_/ \\\\_/ \\\\_/ \",\r\n\t],\r\n];\r\n\r\nfunction generateLocomotive(frame: number, wagonCount = 1) {\r\n\tconst smokeHeight = LOCOMOTIVE_SMOKE[0].length;\r\n\tconst locomotiveHeight = LOCOMOTIVE_TOP.length + LOCOMOTIVE_BOTTOM[0].length;\r\n\tconst wagonHeight = COAL_WAGON.length;\r\n\r\n\tconst wagonStart = smokeHeight + locomotiveHeight - wagonHeight;\r\n\r\n\tconst smoke = LOCOMOTIVE_SMOKE[Math.round(frame / 4) % LOCOMOTIVE_SMOKE.length];\r\n\tconst top = LOCOMOTIVE_TOP;\r\n\tconst bottom = LOCOMOTIVE_BOTTOM[frame % LOCOMOTIVE_BOTTOM.length];\r\n\r\n\tconst distance = 50 - frame;\r\n\tconst locomotive = smoke.concat(top, bottom).map((line, index) => {\r\n\t\tif (index >= wagonStart && wagonCount > 0) {\r\n\t\t\tfor (let i = 0; i < wagonCount; i++) {\r\n\t\t\t\tif (i === 0) {\r\n\t\t\t\t\tline += COAL_WAGON[index - wagonStart];\r\n\t\t\t\t} else {\r\n\t\t\t\t\tline += EXTRA_WAGONS[(i - 1) % EXTRA_WAGONS.length][index - wagonStart];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (distance === 0) {\r\n\t\t\treturn line;\r\n\t\t} else if (distance > 0) {\r\n\t\t\treturn \" \".repeat(distance) + line;\r\n\t\t} else {\r\n\t\t\tline = line.slice(-distance);\r\n\t\t\treturn line;\r\n\t\t}\r\n\t}).join(\"\\n\");\r\n\r\n\treturn `\\n${locomotive}\\n`;\r\n}\r\n\r\nexport const sl = new Command()\r\n\t.setManual({\r\n\t\tpurpose: \"Show animations aimed to correct users who accidentally enter sl instead of ls. SL stands for Steam Locomotive.\",\r\n\t\tusage: \"sl\\n\"\r\n\t\t\t+ \"sl -w number\",\r\n\t\toptions: {\r\n\t\t\t\"-w number\": \"Set the amount of wagons (defaults to 1)\"\r\n\t\t}\r\n\t})\r\n\t.addOption({\r\n\t\tshort: \"w\",\r\n\t\tlong: \"wagons\",\r\n\t\tisInput: true\r\n\t})\r\n\t.setExecute(function(this: Command, args, params) {\r\n\t\tconst { inputs } = params as ExecuteParams;\r\n\t\tlet wagonCount = 1;\r\n\r\n\t\tif (inputs?.w) {\r\n\t\t\twagonCount = parseInt(inputs.w);\r\n\r\n\t\t\tif (!wagonCount || wagonCount < 0) {\r\n\t\t\t\treturn formatError(this.name, \"Please specify a valid amount of wagons\"); \r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tconst stream = new Stream();\r\n\r\n\t\tlet frame = 0;\r\n\t\tconst interval = setInterval(() => {\r\n\t\t\tconst text = generateLocomotive(frame, wagonCount);\r\n\t\t\tstream.send(text);\r\n\t\t\tframe++;\r\n\r\n\t\t\tif (text.trim().length === 0)\r\n\t\t\t\tstream.stop();\r\n\t\t}, 100 / ANIMATION_SPEED);\r\n\r\n\t\tstream.on(Stream.EVENT_NAMES.stop, () => {\r\n\t\t\tclearInterval(interval);\r\n\t\t});\r\n\r\n\t\tstream.start();\r\n\r\n\t\treturn stream;\r\n\t});"],"names":["ANIMATION_SPEED","LOCOMOTIVE_SMOKE","LOCOMOTIVE_TOP","LOCOMOTIVE_BOTTOM","COAL_WAGON","EXTRA_WAGONS","generateLocomotive","frame","wagonCount","smokeHeight","locomotiveHeight","wagonHeight","wagonStart","smoke","top","bottom","distance","line","index","i","sl","Command","args","params","inputs","formatError","stream","Stream","interval","text"],"mappings":";;AAIA,MAAMA,IAAkB,MAElBC,IAAmB;AAAA,EACxB;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EACA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD,GAEMC,IAAiB;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAEMC,IAAoB;AAAA,EACzB;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EACA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EACA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EACA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EACA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EACA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD,EAAE,QAAQ,GAEJC,IAAa;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAEMC,IAAe;AAAA,EACpB;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EACA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EACA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EACA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EACA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD;AAEA,SAASC,EAAmBC,GAAeC,IAAa,GAAG;AACpD,QAAAC,IAAcR,EAAiB,CAAC,EAAE,QAClCS,IAAmBR,EAAe,SAASC,EAAkB,CAAC,EAAE,QAChEQ,IAAcP,EAAW,QAEzBQ,IAAaH,IAAcC,IAAmBC,GAE9CE,IAAQZ,EAAiB,KAAK,MAAMM,IAAQ,CAAC,IAAIN,EAAiB,MAAM,GACxEa,IAAMZ,GACNa,IAASZ,EAAkBI,IAAQJ,EAAkB,MAAM,GAE3Da,IAAW,KAAKT;AAsBf,SAAA;AAAA,EArBYM,EAAM,OAAOC,GAAKC,CAAM,EAAE,IAAI,CAACE,GAAMC,MAAU;AAC7D,QAAAA,KAASN,KAAcJ,IAAa;AACvC,eAASW,IAAI,GAAGA,IAAIX,GAAYW;AAC/B,QAAIA,MAAM,IACDF,KAAAb,EAAWc,IAAQN,CAAU,IAErCK,KAAQZ,GAAcc,IAAI,KAAKd,EAAa,MAAM,EAAEa,IAAQN,CAAU;AAKzE,WAAII,MAAa,IACTC,IACGD,IAAW,IACd,IAAI,OAAOA,CAAQ,IAAIC,KAEvBA,IAAAA,EAAK,MAAM,CAACD,CAAQ,GACpBC;AAAA,EACR,CACA,EAAE,KAAK;AAAA,CAAI,CAEU;AAAA;AACvB;AAEO,MAAMG,IAAK,IAAIC,EAAQ,EAC5B,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AAAA;AAAA,EAEP,SAAS;AAAA,IACR,aAAa;AAAA,EACd;AACD,CAAC,EACA,UAAU;AAAA,EACV,OAAO;AAAA,EACP,MAAM;AAAA,EACN,SAAS;AACV,CAAC,EACA,WAAW,SAAwBC,GAAMC,GAAQ;AAC3C,QAAA,EAAE,QAAAC,EAAW,IAAAD;AACnB,MAAIf,IAAa;AAEjB,MAAIgB,KAAA,QAAAA,EAAQ,MACEhB,IAAA,SAASgB,EAAO,CAAC,GAE1B,CAAChB,KAAcA,IAAa;AACxB,WAAAiB,EAAY,KAAK,MAAM,yCAAyC;AAInE,QAAAC,IAAS,IAAIC;AAEnB,MAAIpB,IAAQ;AACN,QAAAqB,IAAW,YAAY,MAAM;AAC5B,UAAAC,IAAOvB,EAAmBC,GAAOC,CAAU;AACjD,IAAAkB,EAAO,KAAKG,CAAI,GAChBtB,KAEIsB,EAAK,OAAO,WAAW,KAC1BH,EAAO,KAAK;AAAA,EAAA,GACX,MAAM1B,CAAe;AAExB,SAAA0B,EAAO,GAAGC,EAAO,YAAY,MAAM,MAAM;AACxC,kBAAcC,CAAQ;AAAA,EAAA,CACtB,GAEDF,EAAO,MAAM,GAENA;AACR,CAAC;"}
1
+ {"version":3,"file":"sl-iFJMGBu9.js","sources":["../src/core/commands/sl.ts"],"sourcesContent":["import { formatError } from \"../_utils/terminal.utils\";\r\nimport { Command, ExecuteParams } from \"../command\";\r\nimport { Stream } from \"../stream\";\r\n\r\nconst ANIMATION_SPEED = 1.25;\r\n\r\nconst LOCOMOTIVE_SMOKE = [\r\n\t[\r\n\t\t\" (@@) ( ) (@) ( ) @@ () @ o @ o\",\r\n\t\t\" ( )\",\r\n\t\t\" (@@@@)\",\r\n\t\t\" ( )\",\r\n\t\t\"\",\r\n\t\t\" (@@@)\",\r\n\t],\r\n\t[\r\n\t\t\" ( ) (@@) ( ) (@) () @@ o @ o @\",\r\n\t\t\" (@@@)\",\r\n\t\t\" ( )\",\r\n\t\t\" (@@@@)\",\r\n\t\t\"\",\r\n\t\t\" ( )\",\r\n\t]\r\n];\r\n\r\nconst LOCOMOTIVE_TOP = [\r\n\t\" ==== ________ ___________\",\r\n\t\" _D _| |_______/ \\\\__I_I_____===__|_________|\",\r\n\t\" |(_)--- | H\\\\________/ | | =|___ ___| \",\r\n\t\" / | | H | | | | ||_| |_|| \",\r\n\t\" | | | H |__--------------------| [___] | \",\r\n\t\" | ________|___H__/__|_____/[][]~\\\\_______| | \",\r\n\t\" |/ | |-----------I_____I [][] [] D |=======|__\",\r\n];\r\n\r\nconst LOCOMOTIVE_BOTTOM = [\r\n\t[\r\n\t\t\"__/ =| o |=-~~\\\\ /~~\\\\ /~~\\\\ /~~\\\\ ____Y___________|__\",\r\n\t\t\" |/-=|___|= || || || |_____/~\\\\___/ \",\r\n\t\t\" \\\\_/ \\\\O=====O=====O=====O_/ \\\\_/ \",\r\n\t],\r\n\t[\r\n\t\t\"__/ =| o |=-~~\\\\ /~~\\\\ /~~\\\\ /~~\\\\ ____Y___________|__\",\r\n\t\t\" |/-=|___|=O=====O=====O=====O |_____/~\\\\___/ \",\r\n\t\t\" \\\\_/ \\\\__/ \\\\__/ \\\\__/ \\\\__/ \\\\_/ \",\r\n\t],\r\n\t[\r\n\t\t\"__/ =| o |=-O=====O=====O=====O \\\\ ____Y___________|__\",\r\n\t\t\" |/-=|___|= || || || |_____/~\\\\___/ \",\r\n\t\t\" \\\\_/ \\\\__/ \\\\__/ \\\\__/ \\\\__/ \\\\_/ \",\r\n\t],\r\n\t[\r\n\t\t\"__/ =| o |=-~O=====O=====O=====O\\\\ ____Y___________|__\",\r\n\t\t\" |/-=|___|= || || || |_____/~\\\\___/ \",\r\n\t\t\" \\\\_/ \\\\__/ \\\\__/ \\\\__/ \\\\__/ \\\\_/ \",\r\n\t],\r\n\t[\r\n\t\t\"__/ =| o |=-~~\\\\ /~~\\\\ /~~\\\\ /~~\\\\ ____Y___________|__\",\r\n\t\t\" |/-=|___|= O=====O=====O=====O|_____/~\\\\___/ \",\r\n\t\t\" \\\\_/ \\\\__/ \\\\__/ \\\\__/ \\\\__/ \\\\_/ \",\r\n\t],\r\n\t[\r\n\t\t\"__/ =| o |=-~~\\\\ /~~\\\\ /~~\\\\ /~~\\\\ ____Y___________|__\",\r\n\t\t\" |/-=|___|= || || || |_____/~\\\\___/ \",\r\n\t\t\" \\\\_/ \\\\_O=====O=====O=====O/ \\\\_/ \",\r\n\t]\r\n].reverse();\r\n\r\nconst COAL_WAGON = [\r\n\t\" \",\r\n\t\" _________________ \",\r\n\t\" _| \\\\_____A \",\r\n\t\" =| | \",\r\n\t\" -| | \",\r\n\t\"__|________________________|_\",\r\n\t\"|__________________________|_\",\r\n\t\" |_D__D__D_| |_D__D__D_| \",\r\n\t\" \\\\_/ \\\\_/ \\\\_/ \\\\_/ \",\r\n];\r\n\r\nconst EXTRA_WAGONS = [\r\n\t[\r\n\t\t\" _______================_______ \",\r\n\t\t\" | | ___ ___ ___ ___ | | \",\r\n\t\t\" | | | | | | | | | | | | \",\r\n\t\t\" | | |_| |_| |_| |_| | | \",\r\n\t\t\" | | | | \",\r\n\t\t\"__|__|____________________|__|__\",\r\n\t\t\"_|____________________________|_\",\r\n\t\t\" |_D__D__D_| |_D__D__D_| \",\r\n\t\t\" \\\\_/ \\\\_/ \\\\_/ \\\\_/ \",\r\n\t],\r\n\t[\r\n\t\t\" \",\r\n\t\t\" ________========__HH____ \",\r\n\t\t\" / HH \\\\ \",\r\n\t\t\"/ HH \\\\ \",\r\n\t\t\"\\\\ HH / \",\r\n\t\t\"_\\\\__________________HH____/__\",\r\n\t\t\"|__________________________|_\",\r\n\t\t\" |_D__D__D_| |_D__D__D_| \",\r\n\t\t\" \\\\_/ \\\\_/ \\\\_/ \\\\_/ \",\r\n\t],\r\n\t[\r\n\t\t\" \",\r\n\t\t\" \",\r\n\t\t\" \",\r\n\t\t\" \",\r\n\t\t\" \",\r\n\t\t\"_____________________________\",\r\n\t\t\"|__________________________|_\",\r\n\t\t\" |_D__D__D_| |_D__D__D_| \",\r\n\t\t\" \\\\_/ \\\\_/ \\\\_/ \\\\_/ \",\r\n\t],\r\n\t[\r\n\t\t\" \",\r\n\t\t\" _|__|___________|__|___ \",\r\n\t\t\" (_|__|___________|__|___) \",\r\n\t\t\" _(|__|___________|__|__)_ \",\r\n\t\t\" (__|__|___________|__|____)\",\r\n\t\t\"_(___|__|___________|__|__)__\",\r\n\t\t\"|__________________________|_\",\r\n\t\t\" |_D__D__D_| |_D__D__D_| \",\r\n\t\t\" \\\\_/ \\\\_/ \\\\_/ \\\\_/ \",\r\n\t],\r\n\t[\r\n\t\t\" \",\r\n\t\t\" ___________________________ \",\r\n\t\t\" \\\\ | | / \",\r\n\t\t\" \\\\ | | / \",\r\n\t\t\" |\\\\ | | /| \",\r\n\t\t\"__|_\\\\___|___________|___/_|__\",\r\n\t\t\"|__________________________|_\",\r\n\t\t\" |_D__D__D_| |_D__D__D_| \",\r\n\t\t\" \\\\_/ \\\\_/ \\\\_/ \\\\_/ \",\r\n\t],\r\n];\r\n\r\nfunction generateLocomotive(frame: number, wagonCount = 1) {\r\n\tconst smokeHeight = LOCOMOTIVE_SMOKE[0].length;\r\n\tconst locomotiveHeight = LOCOMOTIVE_TOP.length + LOCOMOTIVE_BOTTOM[0].length;\r\n\tconst wagonHeight = COAL_WAGON.length;\r\n\r\n\tconst wagonStart = smokeHeight + locomotiveHeight - wagonHeight;\r\n\r\n\tconst smoke = LOCOMOTIVE_SMOKE[Math.round(frame / 4) % LOCOMOTIVE_SMOKE.length];\r\n\tconst top = LOCOMOTIVE_TOP;\r\n\tconst bottom = LOCOMOTIVE_BOTTOM[frame % LOCOMOTIVE_BOTTOM.length];\r\n\r\n\tconst distance = 50 - frame;\r\n\tconst locomotive = smoke.concat(top, bottom).map((line, index) => {\r\n\t\tif (index >= wagonStart && wagonCount > 0) {\r\n\t\t\tfor (let i = 0; i < wagonCount; i++) {\r\n\t\t\t\tif (i === 0) {\r\n\t\t\t\t\tline += COAL_WAGON[index - wagonStart];\r\n\t\t\t\t} else {\r\n\t\t\t\t\tline += EXTRA_WAGONS[(i - 1) % EXTRA_WAGONS.length][index - wagonStart];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (distance === 0) {\r\n\t\t\treturn line;\r\n\t\t} else if (distance > 0) {\r\n\t\t\treturn \" \".repeat(distance) + line;\r\n\t\t} else {\r\n\t\t\tline = line.slice(-distance);\r\n\t\t\treturn line;\r\n\t\t}\r\n\t}).join(\"\\n\");\r\n\r\n\treturn `\\n${locomotive}\\n`;\r\n}\r\n\r\nexport const sl = new Command()\r\n\t.setManual({\r\n\t\tpurpose: \"Show animations aimed to correct users who accidentally enter sl instead of ls. SL stands for Steam Locomotive.\",\r\n\t\tusage: \"sl\\n\"\r\n\t\t\t+ \"sl -w number\",\r\n\t\toptions: {\r\n\t\t\t\"-w number\": \"Set the amount of wagons (defaults to 1)\"\r\n\t\t}\r\n\t})\r\n\t.addOption({\r\n\t\tshort: \"w\",\r\n\t\tlong: \"wagons\",\r\n\t\tisInput: true\r\n\t})\r\n\t.setExecute(function(this: Command, args, params) {\r\n\t\tconst { inputs } = params as ExecuteParams;\r\n\t\tlet wagonCount = 1;\r\n\r\n\t\tif (inputs?.w) {\r\n\t\t\twagonCount = parseInt(inputs.w);\r\n\r\n\t\t\tif (!wagonCount || wagonCount < 0) {\r\n\t\t\t\treturn formatError(this.name, \"Please specify a valid amount of wagons\"); \r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tconst stream = new Stream();\r\n\r\n\t\tlet frame = 0;\r\n\t\tconst interval = setInterval(() => {\r\n\t\t\tconst text = generateLocomotive(frame, wagonCount);\r\n\t\t\tstream.send(text);\r\n\t\t\tframe++;\r\n\r\n\t\t\tif (text.trim().length === 0)\r\n\t\t\t\tstream.stop();\r\n\t\t}, 100 / ANIMATION_SPEED);\r\n\r\n\t\tstream.on(Stream.EVENT_NAMES.stop, () => {\r\n\t\t\tclearInterval(interval);\r\n\t\t});\r\n\r\n\t\tstream.start();\r\n\r\n\t\treturn stream;\r\n\t});"],"names":["ANIMATION_SPEED","LOCOMOTIVE_SMOKE","LOCOMOTIVE_TOP","LOCOMOTIVE_BOTTOM","COAL_WAGON","EXTRA_WAGONS","generateLocomotive","frame","wagonCount","smokeHeight","locomotiveHeight","wagonHeight","wagonStart","smoke","top","bottom","distance","line","index","i","sl","Command","args","params","inputs","formatError","stream","Stream","interval","text"],"mappings":";;AAIA,MAAMA,IAAkB,MAElBC,IAAmB;AAAA,EACxB;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EACA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD,GAEMC,IAAiB;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAEMC,IAAoB;AAAA,EACzB;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EACA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EACA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EACA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EACA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EACA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD,EAAE,QAAQ,GAEJC,IAAa;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAEMC,IAAe;AAAA,EACpB;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EACA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EACA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EACA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EACA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD;AAEA,SAASC,EAAmBC,GAAeC,IAAa,GAAG;AACpD,QAAAC,IAAcR,EAAiB,CAAC,EAAE,QAClCS,IAAmBR,EAAe,SAASC,EAAkB,CAAC,EAAE,QAChEQ,IAAcP,EAAW,QAEzBQ,IAAaH,IAAcC,IAAmBC,GAE9CE,IAAQZ,EAAiB,KAAK,MAAMM,IAAQ,CAAC,IAAIN,EAAiB,MAAM,GACxEa,IAAMZ,GACNa,IAASZ,EAAkBI,IAAQJ,EAAkB,MAAM,GAE3Da,IAAW,KAAKT;AAsBf,SAAA;AAAA,EArBYM,EAAM,OAAOC,GAAKC,CAAM,EAAE,IAAI,CAACE,GAAMC,MAAU;AAC7D,QAAAA,KAASN,KAAcJ,IAAa;AACvC,eAASW,IAAI,GAAGA,IAAIX,GAAYW;AAC/B,QAAIA,MAAM,IACDF,KAAAb,EAAWc,IAAQN,CAAU,IAErCK,KAAQZ,GAAcc,IAAI,KAAKd,EAAa,MAAM,EAAEa,IAAQN,CAAU;AAKzE,WAAII,MAAa,IACTC,IACGD,IAAW,IACd,IAAI,OAAOA,CAAQ,IAAIC,KAEvBA,IAAAA,EAAK,MAAM,CAACD,CAAQ,GACpBC;AAAA,EACR,CACA,EAAE,KAAK;AAAA,CAAI,CAEU;AAAA;AACvB;AAEO,MAAMG,IAAK,IAAIC,EAAQ,EAC5B,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AAAA;AAAA,EAEP,SAAS;AAAA,IACR,aAAa;AAAA,EACd;AACD,CAAC,EACA,UAAU;AAAA,EACV,OAAO;AAAA,EACP,MAAM;AAAA,EACN,SAAS;AACV,CAAC,EACA,WAAW,SAAwBC,GAAMC,GAAQ;AAC3C,QAAA,EAAE,QAAAC,EAAW,IAAAD;AACnB,MAAIf,IAAa;AAEjB,MAAIgB,KAAA,QAAAA,EAAQ,MACEhB,IAAA,SAASgB,EAAO,CAAC,GAE1B,CAAChB,KAAcA,IAAa;AACxB,WAAAiB,EAAY,KAAK,MAAM,yCAAyC;AAInE,QAAAC,IAAS,IAAIC;AAEnB,MAAIpB,IAAQ;AACN,QAAAqB,IAAW,YAAY,MAAM;AAC5B,UAAAC,IAAOvB,EAAmBC,GAAOC,CAAU;AACjD,IAAAkB,EAAO,KAAKG,CAAI,GAChBtB,KAEIsB,EAAK,OAAO,WAAW,KAC1BH,EAAO,KAAK;AAAA,EAAA,GACX,MAAM1B,CAAe;AAExB,SAAA0B,EAAO,GAAGC,EAAO,YAAY,MAAM,MAAM;AACxC,kBAAcC,CAAQ;AAAA,EAAA,CACtB,GAEDF,EAAO,MAAM,GAENA;AACR,CAAC;"}
@@ -1,5 +1,5 @@
1
1
  import { VirtualFile as s } from "@prozilla-os/core";
2
- import { f as a } from "./main-tAp_mbfZ.js";
2
+ import { f as a } from "./main-BY8DgnTe.js";
3
3
  import { C as c } from "./command-nBL1aO7T.js";
4
4
  const l = new c().setRequireArgs(!0).setManual({
5
5
  purpose: "Change file timestamps",
@@ -17,4 +17,4 @@ A file argument that does not exist is created empty.`
17
17
  export {
18
18
  l as touch
19
19
  };
20
- //# sourceMappingURL=touch-D_kKTiUQ.js.map
20
+ //# sourceMappingURL=touch-4AvKZiqp.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"touch-D_kKTiUQ.js","sources":["../src/core/commands/touch.ts"],"sourcesContent":["import { VirtualFile } from \"@prozilla-os/core\";\r\nimport { formatError } from \"../_utils/terminal.utils\";\r\nimport { Command, ExecuteParams } from \"../command\";\r\n\r\nexport const touch = new Command()\r\n\t.setRequireArgs(true)\r\n\t.setManual({\r\n\t\tpurpose: \"Change file timestamps\",\r\n\t\tusage: \"touch [options] files\",\r\n\t\tdescription: \"Update the access and modification times of each FILE to the current time.\\n\\n\"\r\n\t\t\t+ \"A file argument that does not exist is created empty.\"\r\n\t})\r\n\t.setExecute(function(this: Command, args, params) {\r\n\t\tconst { currentDirectory } = params as ExecuteParams;\r\n\t\tconst fileId = (args as string[])[0];\r\n\r\n\t\tif (fileId === \"girls\\\\\" && (args as string[])[1] === \"boo**\")\r\n\t\t\treturn formatError((this).name, \"Cannot touch 'girls boo**': Permission denied\");\r\n\t\r\n\t\tconst { name, extension } = VirtualFile.splitId(fileId);\r\n\t\r\n\t\tif (currentDirectory.findFile(name, extension))\r\n\t\t\treturn { blank: true };\r\n\t\r\n\t\tcurrentDirectory.createFile(name, extension as string | undefined);\r\n\t\treturn { blank: true };\r\n\t});"],"names":["touch","Command","args","params","currentDirectory","fileId","formatError","name","extension","VirtualFile"],"mappings":";;;AAIO,MAAMA,IAAQ,IAAIC,IACvB,eAAe,EAAI,EACnB,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AAAA,EACP,aAAa;AAAA;AAAA;AAEd,CAAC,EACA,WAAW,SAAwBC,GAAMC,GAAQ;AAC3C,QAAA,EAAE,kBAAAC,EAAqB,IAAAD,GACvBE,IAAUH,EAAkB,CAAC;AAEnC,MAAIG,MAAW,aAAcH,EAAkB,CAAC,MAAM;AAC9C,WAAAI,EAAa,KAAM,MAAM,+CAA+C;AAEhF,QAAM,EAAE,MAAAC,GAAM,WAAAC,EAAA,IAAcC,EAAY,QAAQJ,CAAM;AAElD,SAAAD,EAAiB,SAASG,GAAMC,CAAS,IACrC,EAAE,OAAO,QAEAJ,EAAA,WAAWG,GAAMC,CAA+B,GAC1D,EAAE,OAAO;AACjB,CAAC;"}
1
+ {"version":3,"file":"touch-4AvKZiqp.js","sources":["../src/core/commands/touch.ts"],"sourcesContent":["import { VirtualFile } from \"@prozilla-os/core\";\r\nimport { formatError } from \"../_utils/terminal.utils\";\r\nimport { Command, ExecuteParams } from \"../command\";\r\n\r\nexport const touch = new Command()\r\n\t.setRequireArgs(true)\r\n\t.setManual({\r\n\t\tpurpose: \"Change file timestamps\",\r\n\t\tusage: \"touch [options] files\",\r\n\t\tdescription: \"Update the access and modification times of each FILE to the current time.\\n\\n\"\r\n\t\t\t+ \"A file argument that does not exist is created empty.\"\r\n\t})\r\n\t.setExecute(function(this: Command, args, params) {\r\n\t\tconst { currentDirectory } = params as ExecuteParams;\r\n\t\tconst fileId = (args as string[])[0];\r\n\r\n\t\tif (fileId === \"girls\\\\\" && (args as string[])[1] === \"boo**\")\r\n\t\t\treturn formatError((this).name, \"Cannot touch 'girls boo**': Permission denied\");\r\n\t\r\n\t\tconst { name, extension } = VirtualFile.splitId(fileId);\r\n\t\r\n\t\tif (currentDirectory.findFile(name, extension))\r\n\t\t\treturn { blank: true };\r\n\t\r\n\t\tcurrentDirectory.createFile(name, extension as string | undefined);\r\n\t\treturn { blank: true };\r\n\t});"],"names":["touch","Command","args","params","currentDirectory","fileId","formatError","name","extension","VirtualFile"],"mappings":";;;AAIO,MAAMA,IAAQ,IAAIC,IACvB,eAAe,EAAI,EACnB,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AAAA,EACP,aAAa;AAAA;AAAA;AAEd,CAAC,EACA,WAAW,SAAwBC,GAAMC,GAAQ;AAC3C,QAAA,EAAE,kBAAAC,EAAqB,IAAAD,GACvBE,IAAUH,EAAkB,CAAC;AAEnC,MAAIG,MAAW,aAAcH,EAAkB,CAAC,MAAM;AAC9C,WAAAI,EAAa,KAAM,MAAM,+CAA+C;AAEhF,QAAM,EAAE,MAAAC,GAAM,WAAAC,EAAA,IAAcC,EAAY,QAAQJ,CAAM;AAElD,SAAAD,EAAiB,SAASG,GAAMC,CAAS,IACrC,EAAE,OAAO,QAEAJ,EAAA,WAAWG,GAAMC,CAA+B,GAC1D,EAAE,OAAO;AACjB,CAAC;"}
@@ -1,5 +1,5 @@
1
1
  import { ANSI as t } from "@prozilla-os/core";
2
- import { C as e, f as a } from "./main-tAp_mbfZ.js";
2
+ import { C as e, f as a } from "./main-BY8DgnTe.js";
3
3
  import { C as s } from "./command-nBL1aO7T.js";
4
4
  const p = new s().setRequireArgs(!0).setManual({
5
5
  purpose: "Show information about a command"
@@ -11,4 +11,4 @@ const p = new s().setRequireArgs(!0).setManual({
11
11
  export {
12
12
  p as whatis
13
13
  };
14
- //# sourceMappingURL=whatis-CYD52uq2.js.map
14
+ //# sourceMappingURL=whatis-iNlzdd4F.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"whatis-CYD52uq2.js","sources":["../src/core/commands/whatis.ts"],"sourcesContent":["import { ANSI } from \"@prozilla-os/core\";\r\nimport { formatError } from \"../_utils/terminal.utils\";\r\nimport { Command } from \"../command\";\r\nimport { CommandsManager } from \"../commands\";\r\n\r\nexport const whatis = new Command()\r\n\t.setRequireArgs(true)\r\n\t.setManual({\r\n\t\tpurpose: \"Show information about a command\"\r\n\t})\r\n\t.setExecute(function(this: Command, args) {\r\n\t\tconst commandName = (args as string[])[0].toLowerCase();\r\n\t\tconst command = CommandsManager.find(commandName);\r\n\r\n\t\tif (!command)\r\n\t\t\treturn formatError(this.name, `${commandName}: Command not found`);\r\n\r\n\t\tif (!command.manual?.purpose)\r\n\t\t\treturn formatError(this.name, `${commandName}: No information found`);\r\n\r\n\t\treturn `${commandName} - ${ANSI.fg.green}${command.manual.purpose}`;\r\n\t});"],"names":["whatis","Command","args","commandName","command","CommandsManager","_a","ANSI","formatError"],"mappings":";;;AAKO,MAAMA,IAAS,IAAIC,IACxB,eAAe,EAAI,EACnB,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,SAAwBC,GAAM;;AACzC,QAAMC,IAAeD,EAAkB,CAAC,EAAE,YAAY,GAChDE,IAAUC,EAAgB,KAAKF,CAAW;AAEhD,SAAKC,KAGAE,IAAAF,EAAQ,WAAR,QAAAE,EAAgB,UAGd,GAAGH,CAAW,MAAMI,EAAK,GAAG,KAAK,GAAGH,EAAQ,OAAO,OAAO,KAFzDI,EAAY,KAAK,MAAM,GAAGL,CAAW,wBAAwB,IAH7DK,EAAY,KAAK,MAAM,GAAGL,CAAW,qBAAqB;AAMnE,CAAC;"}
1
+ {"version":3,"file":"whatis-iNlzdd4F.js","sources":["../src/core/commands/whatis.ts"],"sourcesContent":["import { ANSI } from \"@prozilla-os/core\";\r\nimport { formatError } from \"../_utils/terminal.utils\";\r\nimport { Command } from \"../command\";\r\nimport { CommandsManager } from \"../commands\";\r\n\r\nexport const whatis = new Command()\r\n\t.setRequireArgs(true)\r\n\t.setManual({\r\n\t\tpurpose: \"Show information about a command\"\r\n\t})\r\n\t.setExecute(function(this: Command, args) {\r\n\t\tconst commandName = (args as string[])[0].toLowerCase();\r\n\t\tconst command = CommandsManager.find(commandName);\r\n\r\n\t\tif (!command)\r\n\t\t\treturn formatError(this.name, `${commandName}: Command not found`);\r\n\r\n\t\tif (!command.manual?.purpose)\r\n\t\t\treturn formatError(this.name, `${commandName}: No information found`);\r\n\r\n\t\treturn `${commandName} - ${ANSI.fg.green}${command.manual.purpose}`;\r\n\t});"],"names":["whatis","Command","args","commandName","command","CommandsManager","_a","ANSI","formatError"],"mappings":";;;AAKO,MAAMA,IAAS,IAAIC,IACxB,eAAe,EAAI,EACnB,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,SAAwBC,GAAM;;AACzC,QAAMC,IAAeD,EAAkB,CAAC,EAAE,YAAY,GAChDE,IAAUC,EAAgB,KAAKF,CAAW;AAEhD,SAAKC,KAGAE,IAAAF,EAAQ,WAAR,QAAAE,EAAgB,UAGd,GAAGH,CAAW,MAAMI,EAAK,GAAG,KAAK,GAAGH,EAAQ,OAAO,OAAO,KAFzDI,EAAY,KAAK,MAAM,GAAGL,CAAW,wBAAwB,IAH7DK,EAAY,KAAK,MAAM,GAAGL,CAAW,qBAAqB;AAMnE,CAAC;"}
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.0.9",
4
+ "version": "1.1.1",
5
5
  "homepage": "https://os.prozilla.dev/terminal",
6
6
  "author": {
7
7
  "name": "Prozilla",
@@ -16,12 +16,12 @@
16
16
  "url": "git+https://github.com/prozilla-os/ProzillaOS.git",
17
17
  "directory": "packages/apps/terminal"
18
18
  },
19
- "license": "MIT",
19
+ "license": "GPL-3.0-only",
20
20
  "dependencies": {
21
21
  "anser": "^2.1.1",
22
22
  "escape-carriage": "^1.3.1",
23
23
  "react": "^18.3.1",
24
- "@prozilla-os/core": "1.1.2"
24
+ "@prozilla-os/core": "1.2.0"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@types/node": "^20.14.5",
@@ -31,7 +31,7 @@
31
31
  "vite": "^5.3.1",
32
32
  "vite-plugin-dts": "^3.9.1",
33
33
  "vite-plugin-lib-inject-css": "^2.1.1",
34
- "@prozilla-os/shared": "1.0.4"
34
+ "@prozilla-os/shared": "1.1.0"
35
35
  },
36
36
  "files": [
37
37
  "dist"
package/LICENSE.md DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2023 Sieben De Beule
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,9 +0,0 @@
1
- import * as React from "react";
2
- export declare function Ansi(props: {
3
- children?: string | undefined;
4
- linkify?: boolean | undefined;
5
- className?: string | undefined;
6
- useClasses?: boolean | undefined;
7
- }): React.DetailedReactHTMLElement<{
8
- className: string | undefined;
9
- }, HTMLElement>;
@@ -1,11 +0,0 @@
1
- import { MutableRefObject } from "react";
2
- interface InputLineProps {
3
- value: string;
4
- prefix: string;
5
- onChange: Function;
6
- onKeyUp?: Function;
7
- onKeyDown?: Function;
8
- inputRef: MutableRefObject<HTMLInputElement>;
9
- }
10
- export declare function InputLine({ value, prefix, onChange, onKeyUp, onKeyDown, inputRef }: InputLineProps): import("react/jsx-runtime").JSX.Element;
11
- export {};
@@ -1,6 +0,0 @@
1
- import { FC } from "react";
2
- interface OutputLineProps {
3
- text?: string;
4
- }
5
- export declare const OutputLine: FC<OutputLineProps>;
6
- export {};
@@ -1,6 +0,0 @@
1
- import { WindowProps } from "@prozilla-os/core";
2
- export interface TerminalProps extends WindowProps {
3
- path?: string;
4
- input?: string;
5
- }
6
- export declare function Terminal({ app, path: startPath, input, setTitle, close: exit, active, focus }: TerminalProps): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +0,0 @@
1
- export declare const USERNAME = "user";
2
- export declare const HOSTNAME = "prozilla-os";
3
- export declare const MAX_WIDTH = 50;
4
- export declare const WELCOME_MESSAGE: string;
5
- export declare const ASCII_LOGO = "\n :. \n -==. \n .=====: \n ---::..:=======-. \n :===+=----------::.. \n =+=---------------:.. \n --------------------:. \n.:-+=----*###*--*####=---. \n:==+----#%+-+%#-##%*+----:.\n .=----#%+-+%#-*+-%#+---:.\n ==----*###*--*###*----. \n ==+-------------------:. \n ...::---------------:. \n .::---------::.. \n ....::... ";
6
- export declare const ANSI_LOGO_COLOR: string;
7
- export declare const ANSI_ASCII_LOGO: string;
@@ -1,2 +0,0 @@
1
- export declare function formatError(commandName: string, error: string): string;
2
- export declare function removeAnsi(string: string): string;
@@ -1,50 +0,0 @@
1
- import { App, SettingsManager, SystemManager, VirtualFolder, VirtualRoot } from "@prozilla-os/core";
2
- import { Stream } from "./stream";
3
- type Option = {
4
- long: string;
5
- short: string;
6
- isInput: boolean;
7
- };
8
- export type CommandResponse = string | {
9
- blank: boolean;
10
- } | void | Stream;
11
- export type ExecuteParams = {
12
- promptOutput?: Function;
13
- pushHistory?: Function;
14
- virtualRoot?: VirtualRoot;
15
- currentDirectory: VirtualFolder;
16
- setCurrentDirectory?: Function;
17
- username?: string;
18
- hostname?: string;
19
- rawInputValue?: string;
20
- options?: string[];
21
- exit?: Function;
22
- inputs?: Record<string, string>;
23
- timestamp: number;
24
- settingsManager: SettingsManager;
25
- systemManager: SystemManager;
26
- app: App;
27
- };
28
- type Execute = (args?: string[], params?: ExecuteParams) => CommandResponse | Promise<CommandResponse>;
29
- type Manual = {
30
- purpose?: string;
31
- usage?: string;
32
- description?: string;
33
- options?: object;
34
- };
35
- export declare class Command {
36
- name: string;
37
- options: Option[];
38
- manual: Manual | undefined;
39
- requireArgs: boolean | undefined;
40
- requireOptions: boolean | undefined;
41
- execute: Execute;
42
- setName(name: string): Command;
43
- setExecute(execute: Execute): Command;
44
- setRequireArgs(value: boolean): Command;
45
- setRequireOptions(value: boolean): Command;
46
- setManual({ purpose, usage, description, options }: Manual): Command;
47
- addOption({ short, long, isInput }: Option): Command;
48
- getOption(key: string): Option | null;
49
- }
50
- export {};
@@ -1,2 +0,0 @@
1
- import { Command } from "../command";
2
- export declare const cat: Command;
@@ -1,2 +0,0 @@
1
- import { Command } from "../command";
2
- export declare const cd: Command;
@@ -1,2 +0,0 @@
1
- import { Command } from "../command";
2
- export declare const clear: Command;
@@ -1,2 +0,0 @@
1
- import { Command } from "../command";
2
- export declare const cmatrix: Command;
@@ -1,2 +0,0 @@
1
- import { Command } from "../command";
2
- export declare const compgen: Command;
@@ -1,2 +0,0 @@
1
- import { Command } from "../command";
2
- export declare const cowsay: Command;
@@ -1,2 +0,0 @@
1
- import { Command } from "../command";
2
- export declare const dir: Command;
@@ -1,2 +0,0 @@
1
- import { Command } from "../command";
2
- export declare const echo: Command;
@@ -1,2 +0,0 @@
1
- import { Command } from "../command";
2
- export declare const exit: Command;
@@ -1,2 +0,0 @@
1
- import { Command } from "../command";
2
- export declare const fortune: Command;
@@ -1,2 +0,0 @@
1
- import { Command } from "../command";
2
- export declare const help: Command;
@@ -1,2 +0,0 @@
1
- import { Command } from "../command";
2
- export declare const hostname: Command;
@@ -1,2 +0,0 @@
1
- import { Command } from "../command";
2
- export declare const lolcat: Command;
@@ -1,2 +0,0 @@
1
- import { Command } from "../command";
2
- export declare const ls: Command;
@@ -1,2 +0,0 @@
1
- import { Command } from "../command";
2
- export declare const make: Command;
@@ -1,2 +0,0 @@
1
- import { Command } from "../command";
2
- export declare const man: Command;
@@ -1,2 +0,0 @@
1
- import { Command } from "../command";
2
- export declare const mkdir: Command;
@@ -1,2 +0,0 @@
1
- import { Command } from "../command";
2
- export declare const neofetch: Command;
@@ -1,2 +0,0 @@
1
- import { Command } from "../command";
2
- export declare const pwd: Command;
@@ -1,2 +0,0 @@
1
- import { Command } from "../command";
2
- export declare const reboot: Command;
@@ -1,2 +0,0 @@
1
- import { Command } from "../command";
2
- export declare const reload: Command;
@@ -1,2 +0,0 @@
1
- import { Command } from "../command";
2
- export declare const rev: Command;
@@ -1,2 +0,0 @@
1
- import { Command } from "../command";
2
- export declare const rm: Command;
@@ -1,2 +0,0 @@
1
- import { Command } from "../command";
2
- export declare const rmdir: Command;
@@ -1,2 +0,0 @@
1
- import { Command } from "../command";
2
- export declare const sl: Command;
@@ -1,2 +0,0 @@
1
- import { Command } from "../command";
2
- export declare const touch: Command;
@@ -1,2 +0,0 @@
1
- import { Command } from "../command";
2
- export declare const uptime: Command;
@@ -1,2 +0,0 @@
1
- import { Command } from "../command";
2
- export declare const whatis: Command;
@@ -1,2 +0,0 @@
1
- import { Command } from "../command";
2
- export declare const whoami: Command;
@@ -1,7 +0,0 @@
1
- import { Command } from "./command";
2
- export declare class CommandsManager {
3
- static COMMANDS: Command[];
4
- static find(name: string): Command | null;
5
- static search(pattern: string): Command[];
6
- static reload(): void;
7
- }
@@ -1,18 +0,0 @@
1
- import { EventEmitter } from "@prozilla-os/core";
2
- declare const StreamEvents: {
3
- readonly new: "new";
4
- readonly start: "start";
5
- readonly stop: "stop";
6
- };
7
- export declare class Stream extends EventEmitter<typeof StreamEvents> {
8
- static EVENT_NAMES: {
9
- readonly new: "new";
10
- readonly start: "start";
11
- readonly stop: "stop";
12
- };
13
- enabled: boolean;
14
- start(callback?: Function): Stream;
15
- stop(): Stream;
16
- send(text: string): Stream;
17
- }
18
- export {};
@@ -1,4 +0,0 @@
1
- import { App } from "@prozilla-os/core";
2
- import { TerminalProps } from "./components/Terminal";
3
- declare const terminal: App<TerminalProps>;
4
- export { terminal };