@prozilla-os/terminal 1.1.17 → 1.1.18

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 (45) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +85 -85
  3. package/dist/chunks/{cat-F1pnUhWr.js → cat-DO8KEMio.js} +2 -2
  4. package/dist/chunks/{cat-F1pnUhWr.js.map → cat-DO8KEMio.js.map} +1 -1
  5. package/dist/chunks/{cd-SY_-kgyu.js → cd-DFGtb_Wk.js} +2 -2
  6. package/dist/chunks/{cd-SY_-kgyu.js.map → cd-DFGtb_Wk.js.map} +1 -1
  7. package/dist/chunks/{cmatrix-BI2_Y5OW.js → cmatrix-CVXcw_wK.js} +2 -2
  8. package/dist/chunks/{cmatrix-BI2_Y5OW.js.map → cmatrix-CVXcw_wK.js.map} +1 -1
  9. package/dist/chunks/{compgen-7prOo2oi.js → compgen-WxsGxWC9.js} +2 -2
  10. package/dist/chunks/{compgen-7prOo2oi.js.map → compgen-WxsGxWC9.js.map} +1 -1
  11. package/dist/chunks/{cowsay-B6TRoqbg.js → cowsay-DZHMvxAZ.js} +2 -2
  12. package/dist/chunks/{cowsay-B6TRoqbg.js.map → cowsay-DZHMvxAZ.js.map} +1 -1
  13. package/dist/chunks/eval-CnKC-mrj.js.map +1 -1
  14. package/dist/chunks/{help-BUCTSaeJ.js → help-DnMOR9rH.js} +2 -2
  15. package/dist/chunks/help-DnMOR9rH.js.map +1 -0
  16. package/dist/chunks/{lolcat-DiLqxxCO.js → lolcat-vYhIbqEJ.js} +2 -2
  17. package/dist/chunks/{lolcat-DiLqxxCO.js.map → lolcat-vYhIbqEJ.js.map} +1 -1
  18. package/dist/chunks/{ls-DScdmJPT.js → ls-23P3QzxI.js} +2 -2
  19. package/dist/chunks/{ls-DScdmJPT.js.map → ls-23P3QzxI.js.map} +1 -1
  20. package/dist/chunks/{main-CkpVfeUg.js → main-Dvaf0Ocd.js} +245 -245
  21. package/dist/chunks/main-Dvaf0Ocd.js.map +1 -0
  22. package/dist/chunks/{make-D_hXz4-L.js → make-CKvFYB_1.js} +2 -2
  23. package/dist/chunks/make-CKvFYB_1.js.map +1 -0
  24. package/dist/chunks/{man-C2UviS5N.js → man-BN3-oDjw.js} +2 -2
  25. package/dist/chunks/{man-C2UviS5N.js.map → man-BN3-oDjw.js.map} +1 -1
  26. package/dist/chunks/{neofetch-Bq355NBE.js → neofetch-UHKALL5e.js} +2 -2
  27. package/dist/chunks/{neofetch-Bq355NBE.js.map → neofetch-UHKALL5e.js.map} +1 -1
  28. package/dist/chunks/{reload-CnQb5yj-.js → reload-RsBNPWJI.js} +2 -2
  29. package/dist/chunks/reload-RsBNPWJI.js.map +1 -0
  30. package/dist/chunks/{rm-BwOe-Kq2.js → rm-B4-5j-xh.js} +2 -2
  31. package/dist/chunks/{rm-BwOe-Kq2.js.map → rm-B4-5j-xh.js.map} +1 -1
  32. package/dist/chunks/{rmdir-B9pGhEAU.js → rmdir-hAWOHScY.js} +2 -2
  33. package/dist/chunks/{rmdir-B9pGhEAU.js.map → rmdir-hAWOHScY.js.map} +1 -1
  34. package/dist/chunks/{sl-DaCRRvuh.js → sl-yhx6cve3.js} +2 -2
  35. package/dist/chunks/{sl-DaCRRvuh.js.map → sl-yhx6cve3.js.map} +1 -1
  36. package/dist/chunks/{touch-x95bWUyt.js → touch-DptR1Wm4.js} +2 -2
  37. package/dist/chunks/{touch-x95bWUyt.js.map → touch-DptR1Wm4.js.map} +1 -1
  38. package/dist/chunks/{whatis-DL62XQIi.js → whatis-CFFc4GDV.js} +2 -2
  39. package/dist/chunks/{whatis-DL62XQIi.js.map → whatis-CFFc4GDV.js.map} +1 -1
  40. package/dist/main.js +2 -2
  41. package/package.json +4 -4
  42. package/dist/chunks/help-BUCTSaeJ.js.map +0 -1
  43. package/dist/chunks/main-CkpVfeUg.js.map +0 -1
  44. package/dist/chunks/make-D_hXz4-L.js.map +0 -1
  45. package/dist/chunks/reload-CnQb5yj-.js.map +0 -1
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
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
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
21
  SOFTWARE.
package/README.md CHANGED
@@ -1,85 +1,85 @@
1
- <div align="center">
2
- <br />
3
- <p>
4
- <a href="https://os.prozilla.dev/"><img src="https://os.prozilla.dev/assets/logo.svg?v=2" height="200" alt="ProzillaOS" /></a>
5
- </p>
6
- <p>
7
- <a href="https://github.com/prozilla-os/ProzillaOS/blob/main/LICENSE.md"><img alt="License" src="https://img.shields.io/github/license/Prozilla/ProzillaOS?style=flat-square&color=FF4D5B&label=License"></a>
8
- <a href="https://github.com/prozilla-os/ProzillaOS"><img alt="Stars" src="https://img.shields.io/github/stars/Prozilla/ProzillaOS?style=flat-square&color=FED24C&label=%E2%AD%90"></a>
9
- <a href="https://github.com/prozilla-os/ProzillaOS"><img alt="Forks" src="https://img.shields.io/github/forks/Prozilla/ProzillaOS?style=flat-square&color=4D9CFF&label=Forks&logo=github"></a>
10
- <a href="https://www.npmjs.com/package/prozilla-os"><img alt="NPM Version" src="https://img.shields.io/npm/v/prozilla-os?logo=npm&style=flat-square&label=prozilla-os&color=FF4D5B"></a>
11
- </p>
12
- </div>
13
-
14
- ## About
15
-
16
- `@prozilla-os/terminal` is a terminal/shell application for ProzillaOS.
17
-
18
- ## Installation
19
-
20
- `@prozilla-os/core` is required to run this application.
21
-
22
- ```sh
23
- npm install @prozilla-os/core @prozilla-os/terminal
24
- yarn add @prozilla-os/core @prozilla-os/terminal
25
- pnpm add @prozilla-os/core @prozilla-os/terminal
26
- ```
27
-
28
- ## Usage
29
-
30
- ### Basic setup
31
-
32
- ```tsx
33
- import { Desktop, ModalsView, ProzillaOS, Taskbar, WindowsView, AppsConfig } from "@prozilla-os/core";
34
- import { terminal } from "@prozilla-os/terminal";
35
-
36
- function App() {
37
- return (
38
- <ProzillaOS
39
- systemName="Example"
40
- tagLine="Powered by ProzillaOS"
41
- config={{
42
- apps: new AppsConfig({
43
- apps: [ terminal ]
44
- })
45
- }}
46
- >
47
- <Taskbar/>
48
- <WindowsView/>
49
- <ModalsView/>
50
- <Desktop/>
51
- </ProzillaOS>
52
- );
53
- }
54
- ```
55
-
56
- ### Window options
57
-
58
- ```tsx
59
- /**
60
- * Initial path that the app will open
61
- * @default "~" - Home directory
62
- */
63
- path: string;
64
-
65
- /**
66
- * Initial input
67
- */
68
- input: string;
69
- ```
70
-
71
- ## Links
72
-
73
- - [Demo][demo]
74
- - [Docs][docs]
75
- - [GitHub][github]
76
- - [npm][npm]
77
- - [Discord][discord]
78
- - [Ko-fi][ko-fi]
79
-
80
- [demo]: https://os.prozilla.dev/terminal
81
- [docs]: https://os.prozilla.dev/docs/reference/apps/terminal
82
- [github]: https://github.com/prozilla-os/ProzillaOS/tree/main/packages/apps/terminal
83
- [npm]: https://www.npmjs.com/package/@prozilla-os/terminal
84
- [discord]: https://discord.gg/JwbyQP4tdz
85
- [ko-fi]: https://ko-fi.com/prozilla
1
+ <div align="center">
2
+ <br />
3
+ <p>
4
+ <a href="https://os.prozilla.dev/"><img src="https://os.prozilla.dev/assets/logo.svg?v=2" height="200" alt="ProzillaOS" /></a>
5
+ </p>
6
+ <p>
7
+ <a href="https://github.com/prozilla-os/ProzillaOS/blob/main/LICENSE.md"><img alt="License" src="https://img.shields.io/github/license/Prozilla/ProzillaOS?style=flat-square&color=FF4D5B&label=License"></a>
8
+ <a href="https://github.com/prozilla-os/ProzillaOS"><img alt="Stars" src="https://img.shields.io/github/stars/Prozilla/ProzillaOS?style=flat-square&color=FED24C&label=%E2%AD%90"></a>
9
+ <a href="https://github.com/prozilla-os/ProzillaOS"><img alt="Forks" src="https://img.shields.io/github/forks/Prozilla/ProzillaOS?style=flat-square&color=4D9CFF&label=Forks&logo=github"></a>
10
+ <a href="https://www.npmjs.com/package/prozilla-os"><img alt="NPM Version" src="https://img.shields.io/npm/v/prozilla-os?logo=npm&style=flat-square&label=prozilla-os&color=FF4D5B"></a>
11
+ </p>
12
+ </div>
13
+
14
+ ## About
15
+
16
+ `@prozilla-os/terminal` is a terminal/shell application for ProzillaOS.
17
+
18
+ ## Installation
19
+
20
+ `@prozilla-os/core` is required to run this application.
21
+
22
+ ```sh
23
+ npm install @prozilla-os/core @prozilla-os/terminal
24
+ yarn add @prozilla-os/core @prozilla-os/terminal
25
+ pnpm add @prozilla-os/core @prozilla-os/terminal
26
+ ```
27
+
28
+ ## Usage
29
+
30
+ ### Basic setup
31
+
32
+ ```tsx
33
+ import { Desktop, ModalsView, ProzillaOS, Taskbar, WindowsView, AppsConfig } from "@prozilla-os/core";
34
+ import { terminal } from "@prozilla-os/terminal";
35
+
36
+ function App() {
37
+ return (
38
+ <ProzillaOS
39
+ systemName="Example"
40
+ tagLine="Powered by ProzillaOS"
41
+ config={{
42
+ apps: new AppsConfig({
43
+ apps: [ terminal ]
44
+ })
45
+ }}
46
+ >
47
+ <Taskbar/>
48
+ <WindowsView/>
49
+ <ModalsView/>
50
+ <Desktop/>
51
+ </ProzillaOS>
52
+ );
53
+ }
54
+ ```
55
+
56
+ ### Window options
57
+
58
+ ```tsx
59
+ /**
60
+ * Initial path that the app will open
61
+ * @default "~" - Home directory
62
+ */
63
+ path: string;
64
+
65
+ /**
66
+ * Initial input
67
+ */
68
+ input: string;
69
+ ```
70
+
71
+ ## Links
72
+
73
+ - [Demo][demo]
74
+ - [Docs][docs]
75
+ - [GitHub][github]
76
+ - [npm][npm]
77
+ - [Discord][discord]
78
+ - [Ko-fi][ko-fi]
79
+
80
+ [demo]: https://os.prozilla.dev/terminal
81
+ [docs]: https://os.prozilla.dev/docs/reference/apps/terminal
82
+ [github]: https://github.com/prozilla-os/ProzillaOS/tree/main/packages/apps/terminal
83
+ [npm]: https://www.npmjs.com/package/@prozilla-os/terminal
84
+ [discord]: https://discord.gg/JwbyQP4tdz
85
+ [ko-fi]: https://ko-fi.com/prozilla
@@ -1,5 +1,5 @@
1
1
  import { VirtualFile as u } from "@prozilla-os/core";
2
- import { f as a } from "./main-CkpVfeUg.js";
2
+ import { f as a } from "./main-Dvaf0Ocd.js";
3
3
  import { C as l } from "./command-nBL1aO7T.js";
4
4
  const d = new l().setRequireArgs(!0).setManual({
5
5
  purpose: "Concetenate files and display on the terminal screen",
@@ -14,4 +14,4 @@ const d = new l().setRequireArgs(!0).setManual({
14
14
  export {
15
15
  d as cat
16
16
  };
17
- //# sourceMappingURL=cat-F1pnUhWr.js.map
17
+ //# sourceMappingURL=cat-DO8KEMio.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cat-F1pnUhWr.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
+ {"version":3,"file":"cat-DO8KEMio.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,5 +1,5 @@
1
1
  import { VirtualFile as a } from "@prozilla-os/core";
2
- import { f as c } from "./main-CkpVfeUg.js";
2
+ import { f as c } from "./main-Dvaf0Ocd.js";
3
3
  import { C as s } from "./command-nBL1aO7T.js";
4
4
  const d = new s().setManual({
5
5
  purpose: "Change the current directory",
@@ -13,4 +13,4 @@ const d = new s().setManual({
13
13
  export {
14
14
  d as cd
15
15
  };
16
- //# sourceMappingURL=cd-SY_-kgyu.js.map
16
+ //# sourceMappingURL=cd-DFGtb_Wk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cd-SY_-kgyu.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
+ {"version":3,"file":"cd-DFGtb_Wk.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,7 +1,7 @@
1
1
  import { Vector2 as x } from "@prozilla-os/core";
2
2
  import { randomRange as u, removeFromArray as d, randomFromArray as l, ANSI as m } from "@prozilla-os/shared";
3
3
  import { C as w } from "./command-nBL1aO7T.js";
4
- import { S as E } from "./main-CkpVfeUg.js";
4
+ import { S as E } from "./main-Dvaf0Ocd.js";
5
5
  const g = 1.25, c = 75, S = 20, z = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.*\\/()#@&$!?%°:<>[]", f = {
6
6
  framesBetweenSpawn: 30,
7
7
  fallSpeed: 1,
@@ -57,4 +57,4 @@ const N = new w().setManual({
57
57
  export {
58
58
  N as cmatrix
59
59
  };
60
- //# sourceMappingURL=cmatrix-BI2_Y5OW.js.map
60
+ //# sourceMappingURL=cmatrix-CVXcw_wK.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cmatrix-BI2_Y5OW.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,KAAK;AACvC,YAAAC,IAAYF,EAAS,SAAS,GAC9BG,IAAYH,EAAS,SAAS,IAAIC,IAAID,EAAS;AAEjD,MAAAG,IAAYb,KAAiBa,KAAa,MACtCR,EAAAQ,CAAS,EAAED,CAAS,IAAI;AAAA,IACjC;AAGI,QAAAF,EAAS,SAAS,IAAIA,EAAS,QAAQ,KAAKA,EAAS,SAAS,KAAKX;AAC/D,aAAAe,EAAgBJ,GAAUJ,CAAS;AAE3C,aAASK,IAAI,GAAGA,IAAID,EAAS,MAAMC,KAAK;AACvC,YAAMI,IAAYC,EAAgBf,EAAW,MAAM,EAAE,CAAC;AACtD,UAAIgB,IAAQN,KAAK,IAAIO,EAAK,GAAG,QAAQA,EAAK,GAAG;AAEzC,MAAAP,IAAID,EAAS,OAAO,MACvBO,IAAQC,EAAK,GAAG,QAAQA,EAAK,WAAW;AAEnC,YAAAN,IAAYF,EAAS,SAAS,GAC9BG,IAAYH,EAAS,SAAS,IAAIC;AAExC,MAAIC,IAAYb,KAAgBc,IAAYb,KAAiBa,KAAa,MACzER,EAAOQ,CAAS,EAAED,CAAS,IAAIK,IAAQF,IAAYG,EAAK;AAAA,IAE1D;AAAA,EAAA,CACA,GAEM,CAAC,GAAGb,EAAO,IAAI,CAACc,MAAQA,EAAI,KAAK,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK;AAAA,CAAI;AAClE;AAEO,MAAMC,IAAU,IAAIC,EAAQ,EACjC,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AACR,CAAC,EACA,WAAW,WAAW;AAChB,QAAAC,IAAS,IAAIC,KACbjB,IAAwB,CAAA,GAGxBD,IAAqB,CAAA;AAC3B,WAASmB,IAAI,GAAGA,IAAIxB,GAAewB,KAAK;AACvC,UAAML,IAAgB,CAAA;AACtB,aAASM,IAAI,GAAGA,IAAI1B,GAAc0B;AACjC,MAAAN,EAAI,KAAK,GAAG;AAEb,IAAAd,EAAO,KAAKc,CAAG;AAAA,EAChB;AAEA,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
+ {"version":3,"file":"cmatrix-CVXcw_wK.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,KAAK;AACvC,YAAAC,IAAYF,EAAS,SAAS,GAC9BG,IAAYH,EAAS,SAAS,IAAIC,IAAID,EAAS;AAEjD,MAAAG,IAAYb,KAAiBa,KAAa,MACtCR,EAAAQ,CAAS,EAAED,CAAS,IAAI;AAAA,IACjC;AAGI,QAAAF,EAAS,SAAS,IAAIA,EAAS,QAAQ,KAAKA,EAAS,SAAS,KAAKX;AAC/D,aAAAe,EAAgBJ,GAAUJ,CAAS;AAE3C,aAASK,IAAI,GAAGA,IAAID,EAAS,MAAMC,KAAK;AACvC,YAAMI,IAAYC,EAAgBf,EAAW,MAAM,EAAE,CAAC;AACtD,UAAIgB,IAAQN,KAAK,IAAIO,EAAK,GAAG,QAAQA,EAAK,GAAG;AAEzC,MAAAP,IAAID,EAAS,OAAO,MACvBO,IAAQC,EAAK,GAAG,QAAQA,EAAK,WAAW;AAEnC,YAAAN,IAAYF,EAAS,SAAS,GAC9BG,IAAYH,EAAS,SAAS,IAAIC;AAExC,MAAIC,IAAYb,KAAgBc,IAAYb,KAAiBa,KAAa,MACzER,EAAOQ,CAAS,EAAED,CAAS,IAAIK,IAAQF,IAAYG,EAAK;AAAA,IAE1D;AAAA,EAAA,CACA,GAEM,CAAC,GAAGb,EAAO,IAAI,CAACc,MAAQA,EAAI,KAAK,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK;AAAA,CAAI;AAClE;AAEO,MAAMC,IAAU,IAAIC,EAAQ,EACjC,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AACR,CAAC,EACA,WAAW,WAAW;AAChB,QAAAC,IAAS,IAAIC,KACbjB,IAAwB,CAAA,GAGxBD,IAAqB,CAAA;AAC3B,WAASmB,IAAI,GAAGA,IAAIxB,GAAewB,KAAK;AACvC,UAAML,IAAgB,CAAA;AACtB,aAASM,IAAI,GAAGA,IAAI1B,GAAc0B;AACjC,MAAAN,EAAI,KAAK,GAAG;AAEb,IAAAd,EAAO,KAAKc,CAAG;AAAA,EAChB;AAEA,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,5 +1,5 @@
1
1
  import { C as o } from "./command-nBL1aO7T.js";
2
- import { C as s } from "./main-CkpVfeUg.js";
2
+ import { C as s } from "./main-Dvaf0Ocd.js";
3
3
  const i = new o().setManual({
4
4
  purpose: "Display a list of all commands"
5
5
  }).setRequireOptions(!0).setExecute(function(t, n) {
@@ -11,4 +11,4 @@ const i = new o().setManual({
11
11
  export {
12
12
  i as compgen
13
13
  };
14
- //# sourceMappingURL=compgen-7prOo2oi.js.map
14
+ //# sourceMappingURL=compgen-WxsGxWC9.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"compgen-7prOo2oi.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
+ {"version":3,"file":"compgen-WxsGxWC9.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,4 +1,4 @@
1
- import { M as p } from "./main-CkpVfeUg.js";
1
+ import { M as p } from "./main-Dvaf0Ocd.js";
2
2
  import { C as _ } from "./command-nBL1aO7T.js";
3
3
  const m = `
4
4
  \\ ^__^
@@ -47,4 +47,4 @@ const m = `
47
47
  export {
48
48
  x as cowsay
49
49
  };
50
- //# sourceMappingURL=cowsay-B6TRoqbg.js.map
50
+ //# sourceMappingURL=cowsay-DZHMvxAZ.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cowsay-B6TRoqbg.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,gBAAAA,EAAe,MAAM,MAChCE,IAAkB,CAAA;AACxB,MAAIC,IAAc,IACdC,IAAe;AAEb,QAAAC,IAAU,CAACC,MAAiB;AACjC,IAAAA,IAAOA,EAAK,WACZJ,EAAM,KAAKI,CAAI,GACXA,EAAK,SAASF,MACjBA,IAAeE,EAAK;AAAA,EAAA,GAGhBC,IAAW,CAACC,MAAkB;AACnC,IAAAH,EAAQF,CAAW,GAEfK,IACHL,IAAcK,IAAO,MAEPL,IAAA;AAAA,EACf;AAGS,EAAAF,KAAA,QAAAA,EAAA,QAAQ,CAACQ,MAAY;AAE9B,QAAIA,MAAY,IAAI;AACJ,MAAAN,KAAA;AACf;AAAA,IACD;AAEM,UAAAO,IAAQD,EAAQ,MAAM;AAAA,CAAI;AAChC,aAASE,IAAI,GAAGA,IAAID,EAAM,QAAQC,KAAK;AAChC,YAAAH,IAAOE,EAAMC,CAAC;AAOf,UAJDA,IAAI,KACEJ,MAGLJ,IAAcK,GAAM,UAAUI;AAClC,QAAAT,KAAeK,IAAO;AAAA,eACZA,EAAK,SAASI,GAAW;AAC7B,cAAAC,IAAkBD,IAAYT,EAAY;AAEhD,QAAIU,KAAmB,KACtBR,EAAQF,IAAcK,EAAK,UAAU,GAAGK,IAAkB,CAAC,IAAI,GAAG,GAClEV,IAAcK,EAAK,UAAUK,IAAkB,CAAC,IAAI,OAEpDN,EAASC,CAAI;AAAA,MACd;AAEA,QAAAD,EAASC,CAAI;AAAA,IAEf;AAAA,EAAA,IAGGL,EAAY,SAAS,KACxBE,EAAQF,CAAW;AAGd,QAAAW,IAAe,CAAC,IAAI,IAAI,OAAOV,IAAe,CAAC,CAAC,GAAG;AAEzD,WAASO,IAAI,GAAGA,IAAIT,EAAM,QAAQS,KAAK;AAClC,QAAAL,IAAOJ,EAAMS,CAAC;AACZ,UAAAI,IAAgBX,IAAeE,EAAK;AAE1C,IAAIS,IAAgB,MACXT,KAAA,IAAI,OAAOS,CAAa,IAE7Bb,EAAM,SAAS,IACdS,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
+ {"version":3,"file":"cowsay-DZHMvxAZ.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,gBAAAA,EAAe,MAAM,MAChCE,IAAkB,CAAA;AACxB,MAAIC,IAAc,IACdC,IAAe;AAEb,QAAAC,IAAU,CAACC,MAAiB;AACjC,IAAAA,IAAOA,EAAK,WACZJ,EAAM,KAAKI,CAAI,GACXA,EAAK,SAASF,MACjBA,IAAeE,EAAK;AAAA,EAAA,GAGhBC,IAAW,CAACC,MAAkB;AACnC,IAAAH,EAAQF,CAAW,GAEfK,IACHL,IAAcK,IAAO,MAEPL,IAAA;AAAA,EACf;AAGS,EAAAF,KAAA,QAAAA,EAAA,QAAQ,CAACQ,MAAY;AAE9B,QAAIA,MAAY,IAAI;AACJ,MAAAN,KAAA;AACf;AAAA,IACD;AAEM,UAAAO,IAAQD,EAAQ,MAAM;AAAA,CAAI;AAChC,aAASE,IAAI,GAAGA,IAAID,EAAM,QAAQC,KAAK;AAChC,YAAAH,IAAOE,EAAMC,CAAC;AAOf,UAJDA,IAAI,KACEJ,MAGLJ,IAAcK,GAAM,UAAUI;AAClC,QAAAT,KAAeK,IAAO;AAAA,eACZA,EAAK,SAASI,GAAW;AAC7B,cAAAC,IAAkBD,IAAYT,EAAY;AAEhD,QAAIU,KAAmB,KACtBR,EAAQF,IAAcK,EAAK,UAAU,GAAGK,IAAkB,CAAC,IAAI,GAAG,GAClEV,IAAcK,EAAK,UAAUK,IAAkB,CAAC,IAAI,OAEpDN,EAASC,CAAI;AAAA,MACd;AAEA,QAAAD,EAASC,CAAI;AAAA,IAEf;AAAA,EAAA,IAGGL,EAAY,SAAS,KACxBE,EAAQF,CAAW;AAGd,QAAAW,IAAe,CAAC,IAAI,IAAI,OAAOV,IAAe,CAAC,CAAC,GAAG;AAEzD,WAASO,IAAI,GAAGA,IAAIT,EAAM,QAAQS,KAAK;AAClC,QAAAL,IAAOJ,EAAMS,CAAC;AACZ,UAAAI,IAAgBX,IAAeE,EAAK;AAE1C,IAAIS,IAAgB,MACXT,KAAA,IAAI,OAAOS,CAAa,IAE7Bb,EAAM,SAAS,IACdS,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 +1 @@
1
- {"version":3,"file":"eval-CnKC-mrj.js","sources":["../../src/core/commands/eval.ts"],"sourcesContent":["import { Command, CommandResponse } from \"../command\";\r\n\r\nconst evalCommand = new Command()\r\n\t.setRequireArgs(true)\r\n\t.setManual({\r\n\t\tpurpose: \"Evaluate and execute JavaScript code\",\r\n\t\tusage: \"eval [input]\",\r\n\t})\r\n\t.setRequireArgs(true)\r\n\t.setExecute(function(this: Command, args) {\r\n\t\tif (args == null || args.length == 0)\r\n\t\t\treturn;\r\n\t\t\r\n\t\tconst output = eval(args[0]) as CommandResponse ?? { blank: true };\r\n\t\treturn output;\r\n\t});\r\n\r\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
+ {"version":3,"file":"eval-CnKC-mrj.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,5 +1,5 @@
1
1
  import { ANSI as t } from "@prozilla-os/shared";
2
- import { C as u, f } from "./main-CkpVfeUg.js";
2
+ import { C as u, f } from "./main-Dvaf0Ocd.js";
3
3
  import { C as i } from "./command-nBL1aO7T.js";
4
4
  const d = new i().setExecute(function(n) {
5
5
  var m;
@@ -15,4 +15,4 @@ const d = new i().setExecute(function(n) {
15
15
  export {
16
16
  d as help
17
17
  };
18
- //# sourceMappingURL=help-BUCTSaeJ.js.map
18
+ //# sourceMappingURL=help-DnMOR9rH.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"help-DnMOR9rH.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,5 +1,5 @@
1
1
  import { ANSI as n } from "@prozilla-os/shared";
2
- import { r as O } from "./main-CkpVfeUg.js";
2
+ import { r as O } from "./main-Dvaf0Ocd.js";
3
3
  import { C as b } from "./command-nBL1aO7T.js";
4
4
  const o = 5, i = 2, u = [
5
5
  n.fg.red,
@@ -33,4 +33,4 @@ const o = 5, i = 2, u = [
33
33
  export {
34
34
  N as lolcat
35
35
  };
36
- //# sourceMappingURL=lolcat-DiLqxxCO.js.map
36
+ //# sourceMappingURL=lolcat-vYhIbqEJ.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"lolcat-DiLqxxCO.js","sources":["../../src/core/commands/lolcat.ts"],"sourcesContent":["import { ANSI } from \"@prozilla-os/shared\";\nimport { removeAnsi } from \"../_utils/terminal.utils\";\nimport { Command, ExecuteParams } from \"../command\";\n\nconst COLUMN_WIDTH = 5;\nconst ROW_OFFSET = 2;\n\nconst RAINBOW = [\n\tANSI.fg.red,\n\tANSI.fg.yellow,\n\tANSI.fg.green,\n\tANSI.fg.cyan,\n\tANSI.fg.blue,\n\tANSI.fg.magenta,\n];\n\nexport const lolcat = new Command()\n\t.setManual({\n\t\tpurpose: \"Display text with a rainbow effect\",\n\t})\n\t.setExecute(function(_args, params) {\n\t\tconst { rawInputValue, timestamp } = params as ExecuteParams;\n\t\tif (rawInputValue == null) return;\n\t\tlet rows = removeAnsi(rawInputValue).split(\"\\n\");\n\t\tconst offset = timestamp / 100;\n\n\t\trows = rows.map((row, index) => {\n\t\t\tconst columns: string[] = [];\n\n\t\t\tconst rowIndex = index + offset;\n\t\t\tconst rowOffset = COLUMN_WIDTH - ((ROW_OFFSET * rowIndex) % COLUMN_WIDTH);\n\t\t\tlet rainbowIndex = Math.floor(rowIndex / (COLUMN_WIDTH / ROW_OFFSET));\n\n\t\t\tconst addColumn = (start: number, end: number) => {\n\t\t\t\tconst column = row.substring(start, end);\n\t\t\t\tconst color = RAINBOW[rainbowIndex++ % RAINBOW.length];\n\t\t\t\tcolumns.push(color + column);\n\t\t\t};\n\n\t\t\tif (rowOffset > 0)\n\t\t\t\taddColumn(0, rowOffset);\n\t\n\t\t\tfor (let i = rowOffset; i < row.length; i += COLUMN_WIDTH + 1) {\n\t\t\t\taddColumn(i, i + COLUMN_WIDTH + 1);\n\t\t\t}\n\n\t\t\tif (row.length === 0)\n\t\t\t\treturn \"\";\n\n\t\t\treturn columns.join(\"\");\n\t\t});\n\n\t\treturn rows.join(\"\\n\");\n\t});"],"names":["COLUMN_WIDTH","ROW_OFFSET","RAINBOW","ANSI","lolcat","Command","_args","params","rawInputValue","timestamp","rows","removeAnsi","offset","row","index","columns","rowIndex","rowOffset","rainbowIndex","addColumn","start","end","column","color","i"],"mappings":";;;AAIA,MAAMA,IAAe,GACfC,IAAa,GAEbC,IAAU;AAAA,EACfC,EAAK,GAAG;AAAA,EACRA,EAAK,GAAG;AAAA,EACRA,EAAK,GAAG;AAAA,EACRA,EAAK,GAAG;AAAA,EACRA,EAAK,GAAG;AAAA,EACRA,EAAK,GAAG;AACT,GAEaC,IAAS,IAAIC,EAAQ,EAChC,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,SAASC,GAAOC,GAAQ;AAC7B,QAAA,EAAE,eAAAC,GAAe,WAAAC,EAAc,IAAAF;AACrC,MAAIC,KAAiB,KAAM;AAC3B,MAAIE,IAAOC,EAAWH,CAAa,EAAE,MAAM;AAAA,CAAI;AAC/C,QAAMI,IAASH,IAAY;AAE3B,SAAAC,IAAOA,EAAK,IAAI,CAACG,GAAKC,MAAU;AAC/B,UAAMC,IAAoB,CAAA,GAEpBC,IAAWF,IAAQF,GACnBK,IAAYjB,IAAiBC,IAAae,IAAYhB;AAC5D,QAAIkB,IAAe,KAAK,MAAMF,KAAYhB,IAAeC,EAAW;AAE9D,UAAAkB,IAAY,CAACC,GAAeC,MAAgB;AACjD,YAAMC,IAAST,EAAI,UAAUO,GAAOC,CAAG,GACjCE,IAAQrB,EAAQgB,MAAiBhB,EAAQ,MAAM;AAC7C,MAAAa,EAAA,KAAKQ,IAAQD,CAAM;AAAA,IAAA;AAG5B,IAAIL,IAAY,KACfE,EAAU,GAAGF,CAAS;AAEvB,aAASO,IAAIP,GAAWO,IAAIX,EAAI,QAAQW,KAAKxB,IAAe;AACjD,MAAAmB,EAAAK,GAAGA,IAAIxB,IAAe,CAAC;AAGlC,WAAIa,EAAI,WAAW,IACX,KAEDE,EAAQ,KAAK,EAAE;AAAA,EAAA,CACtB,GAEML,EAAK,KAAK;AAAA,CAAI;AACtB,CAAC;"}
1
+ {"version":3,"file":"lolcat-vYhIbqEJ.js","sources":["../../src/core/commands/lolcat.ts"],"sourcesContent":["import { ANSI } from \"@prozilla-os/shared\";\nimport { removeAnsi } from \"../_utils/terminal.utils\";\nimport { Command, ExecuteParams } from \"../command\";\n\nconst COLUMN_WIDTH = 5;\nconst ROW_OFFSET = 2;\n\nconst RAINBOW = [\n\tANSI.fg.red,\n\tANSI.fg.yellow,\n\tANSI.fg.green,\n\tANSI.fg.cyan,\n\tANSI.fg.blue,\n\tANSI.fg.magenta,\n];\n\nexport const lolcat = new Command()\n\t.setManual({\n\t\tpurpose: \"Display text with a rainbow effect\",\n\t})\n\t.setExecute(function(_args, params) {\n\t\tconst { rawInputValue, timestamp } = params as ExecuteParams;\n\t\tif (rawInputValue == null) return;\n\t\tlet rows = removeAnsi(rawInputValue).split(\"\\n\");\n\t\tconst offset = timestamp / 100;\n\n\t\trows = rows.map((row, index) => {\n\t\t\tconst columns: string[] = [];\n\n\t\t\tconst rowIndex = index + offset;\n\t\t\tconst rowOffset = COLUMN_WIDTH - ((ROW_OFFSET * rowIndex) % COLUMN_WIDTH);\n\t\t\tlet rainbowIndex = Math.floor(rowIndex / (COLUMN_WIDTH / ROW_OFFSET));\n\n\t\t\tconst addColumn = (start: number, end: number) => {\n\t\t\t\tconst column = row.substring(start, end);\n\t\t\t\tconst color = RAINBOW[rainbowIndex++ % RAINBOW.length];\n\t\t\t\tcolumns.push(color + column);\n\t\t\t};\n\n\t\t\tif (rowOffset > 0)\n\t\t\t\taddColumn(0, rowOffset);\n\t\n\t\t\tfor (let i = rowOffset; i < row.length; i += COLUMN_WIDTH + 1) {\n\t\t\t\taddColumn(i, i + COLUMN_WIDTH + 1);\n\t\t\t}\n\n\t\t\tif (row.length === 0)\n\t\t\t\treturn \"\";\n\n\t\t\treturn columns.join(\"\");\n\t\t});\n\n\t\treturn rows.join(\"\\n\");\n\t});"],"names":["COLUMN_WIDTH","ROW_OFFSET","RAINBOW","ANSI","lolcat","Command","_args","params","rawInputValue","timestamp","rows","removeAnsi","offset","row","index","columns","rowIndex","rowOffset","rainbowIndex","addColumn","start","end","column","color","i"],"mappings":";;;AAIA,MAAMA,IAAe,GACfC,IAAa,GAEbC,IAAU;AAAA,EACfC,EAAK,GAAG;AAAA,EACRA,EAAK,GAAG;AAAA,EACRA,EAAK,GAAG;AAAA,EACRA,EAAK,GAAG;AAAA,EACRA,EAAK,GAAG;AAAA,EACRA,EAAK,GAAG;AACT,GAEaC,IAAS,IAAIC,EAAQ,EAChC,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,SAASC,GAAOC,GAAQ;AAC7B,QAAA,EAAE,eAAAC,GAAe,WAAAC,EAAc,IAAAF;AACrC,MAAIC,KAAiB,KAAM;AAC3B,MAAIE,IAAOC,EAAWH,CAAa,EAAE,MAAM;AAAA,CAAI;AAC/C,QAAMI,IAASH,IAAY;AAE3B,SAAAC,IAAOA,EAAK,IAAI,CAACG,GAAKC,MAAU;AAC/B,UAAMC,IAAoB,CAAA,GAEpBC,IAAWF,IAAQF,GACnBK,IAAYjB,IAAiBC,IAAae,IAAYhB;AAC5D,QAAIkB,IAAe,KAAK,MAAMF,KAAYhB,IAAeC,EAAW;AAE9D,UAAAkB,IAAY,CAACC,GAAeC,MAAgB;AACjD,YAAMC,IAAST,EAAI,UAAUO,GAAOC,CAAG,GACjCE,IAAQrB,EAAQgB,MAAiBhB,EAAQ,MAAM;AAC7C,MAAAa,EAAA,KAAKQ,IAAQD,CAAM;AAAA,IAAA;AAG5B,IAAIL,IAAY,KACfE,EAAU,GAAGF,CAAS;AAEvB,aAASO,IAAIP,GAAWO,IAAIX,EAAI,QAAQW,KAAKxB,IAAe;AACjD,MAAAmB,EAAAK,GAAGA,IAAIxB,IAAe,CAAC;AAGlC,WAAIa,EAAI,WAAW,IACX,KAEDE,EAAQ,KAAK,EAAE;AAAA,EAAA,CACtB,GAEML,EAAK,KAAK;AAAA,CAAI;AACtB,CAAC;"}
@@ -1,4 +1,4 @@
1
- import { f } from "./main-CkpVfeUg.js";
1
+ import { f } from "./main-Dvaf0Ocd.js";
2
2
  import { C as l } from "./command-nBL1aO7T.js";
3
3
  import { ANSI as i } from "@prozilla-os/shared";
4
4
  const p = new l().setManual({
@@ -16,4 +16,4 @@ const p = new l().setManual({
16
16
  export {
17
17
  p as ls
18
18
  };
19
- //# sourceMappingURL=ls-DScdmJPT.js.map
19
+ //# sourceMappingURL=ls-23P3QzxI.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ls-DScdmJPT.js","sources":["../../src/core/commands/ls.ts"],"sourcesContent":["import { VirtualFolder } from \"@prozilla-os/core\";\nimport { formatError } from \"../_utils/terminal.utils\";\nimport { Command, ExecuteParams } from \"../command\";\nimport { ANSI } from \"@prozilla-os/shared\";\n\nexport const ls = new Command()\n\t.setManual({\n\t\tpurpose: \"List directory contents\",\n\t\tusage: \"ls [options] [files]\",\n\t\tdescription: \"List information about directories or files (the current directory by default).\",\n\t})\n\t.setExecute(function(this: Command, args, params) {\n\t\tconst { currentDirectory } = params as ExecuteParams;\n\t\tlet directory = currentDirectory;\n\t\n\t\tif (args != null && args.length > 0) {\n\t\t\tdirectory = currentDirectory.navigate((args)[0]) as VirtualFolder;\n\t\t}\n\t\n\t\tif (!directory)\n\t\t\treturn formatError(this.name, `Cannot access '${(args as string[])[0]}': No such file or directory`);\n\t\n\t\tconst folderNames = directory.subFolders.map((folder) => `${ANSI.fg.blue}${folder.id}${ANSI.reset}`);\n\t\tconst fileNames = directory.files.map((file) => file.id);\n\t\n\t\tconst contents = folderNames.concat(fileNames);\n\t\n\t\tif (contents.length === 0)\n\t\t\treturn { blank: true };\n\t\n\t\treturn contents.sort().join(\" \");\n\t});"],"names":["ls","Command","args","params","currentDirectory","directory","formatError","folderNames","folder","ANSI","fileNames","file","contents"],"mappings":";;;AAKO,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,EAAqB,IAAAD;AAC7B,MAAIE,IAAYD;AAMhB,MAJIF,KAAQ,QAAQA,EAAK,SAAS,MACjCG,IAAYD,EAAiB,SAAUF,EAAM,CAAC,CAAC,IAG5C,CAACG;AACJ,WAAOC,EAAY,KAAK,MAAM,kBAAmBJ,EAAkB,CAAC,CAAC,8BAA8B;AAEpG,QAAMK,IAAcF,EAAU,WAAW,IAAI,CAACG,MAAW,GAAGC,EAAK,GAAG,IAAI,GAAGD,EAAO,EAAE,GAAGC,EAAK,KAAK,EAAE,GAC7FC,IAAYL,EAAU,MAAM,IAAI,CAACM,MAASA,EAAK,EAAE,GAEjDC,IAAWL,EAAY,OAAOG,CAAS;AAE7C,SAAIE,EAAS,WAAW,IAChB,EAAE,OAAO,OAEVA,EAAS,KAAA,EAAO,KAAK,IAAI;AACjC,CAAC;"}
1
+ {"version":3,"file":"ls-23P3QzxI.js","sources":["../../src/core/commands/ls.ts"],"sourcesContent":["import { VirtualFolder } from \"@prozilla-os/core\";\nimport { formatError } from \"../_utils/terminal.utils\";\nimport { Command, ExecuteParams } from \"../command\";\nimport { ANSI } from \"@prozilla-os/shared\";\n\nexport const ls = new Command()\n\t.setManual({\n\t\tpurpose: \"List directory contents\",\n\t\tusage: \"ls [options] [files]\",\n\t\tdescription: \"List information about directories or files (the current directory by default).\",\n\t})\n\t.setExecute(function(this: Command, args, params) {\n\t\tconst { currentDirectory } = params as ExecuteParams;\n\t\tlet directory = currentDirectory;\n\t\n\t\tif (args != null && args.length > 0) {\n\t\t\tdirectory = currentDirectory.navigate((args)[0]) as VirtualFolder;\n\t\t}\n\t\n\t\tif (!directory)\n\t\t\treturn formatError(this.name, `Cannot access '${(args as string[])[0]}': No such file or directory`);\n\t\n\t\tconst folderNames = directory.subFolders.map((folder) => `${ANSI.fg.blue}${folder.id}${ANSI.reset}`);\n\t\tconst fileNames = directory.files.map((file) => file.id);\n\t\n\t\tconst contents = folderNames.concat(fileNames);\n\t\n\t\tif (contents.length === 0)\n\t\t\treturn { blank: true };\n\t\n\t\treturn contents.sort().join(\" \");\n\t});"],"names":["ls","Command","args","params","currentDirectory","directory","formatError","folderNames","folder","ANSI","fileNames","file","contents"],"mappings":";;;AAKO,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,EAAqB,IAAAD;AAC7B,MAAIE,IAAYD;AAMhB,MAJIF,KAAQ,QAAQA,EAAK,SAAS,MACjCG,IAAYD,EAAiB,SAAUF,EAAM,CAAC,CAAC,IAG5C,CAACG;AACJ,WAAOC,EAAY,KAAK,MAAM,kBAAmBJ,EAAkB,CAAC,CAAC,8BAA8B;AAEpG,QAAMK,IAAcF,EAAU,WAAW,IAAI,CAACG,MAAW,GAAGC,EAAK,GAAG,IAAI,GAAGD,EAAO,EAAE,GAAGC,EAAK,KAAK,EAAE,GAC7FC,IAAYL,EAAU,MAAM,IAAI,CAACM,MAASA,EAAK,EAAE,GAEjDC,IAAWL,EAAY,OAAOG,CAAS;AAE7C,SAAIE,EAAS,WAAW,IAChB,EAAE,OAAO,OAEVA,EAAS,KAAA,EAAO,KAAK,IAAI;AACjC,CAAC;"}