@prozilla-os/core 2.0.2 → 2.1.2

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 (147) hide show
  1. package/README.md +105 -113
  2. package/dist/chunks/afire-DlRwSfiJ.js +68 -0
  3. package/dist/chunks/afire-DlRwSfiJ.js.map +1 -0
  4. package/dist/chunks/banner-jSvYkuqB.js +351 -0
  5. package/dist/chunks/banner-jSvYkuqB.js.map +1 -0
  6. package/dist/chunks/cat-B_KOgu80.js +37 -0
  7. package/dist/chunks/cat-B_KOgu80.js.map +1 -0
  8. package/dist/chunks/clear-C8xhqHmC.js +12 -0
  9. package/dist/chunks/clear-C8xhqHmC.js.map +1 -0
  10. package/dist/chunks/compgen-2kLzA1wV.js +11 -0
  11. package/dist/chunks/compgen-2kLzA1wV.js.map +1 -0
  12. package/dist/chunks/{cowsay-hTKzWScw.js → cowsay-CTLxUPtF.js} +13 -13
  13. package/dist/chunks/cowsay-CTLxUPtF.js.map +1 -0
  14. package/dist/chunks/date-CA1ub92R.js +33 -0
  15. package/dist/chunks/date-CA1ub92R.js.map +1 -0
  16. package/dist/chunks/dir-w2XNd6oI.js +11 -0
  17. package/dist/chunks/dir-w2XNd6oI.js.map +1 -0
  18. package/dist/chunks/doubleBracket-B5nqIccY.js +78 -0
  19. package/dist/chunks/doubleBracket-B5nqIccY.js.map +1 -0
  20. package/dist/chunks/{echo-Gmh-b8f5.js → echo-_hDVbupR.js} +5 -5
  21. package/dist/chunks/echo-_hDVbupR.js.map +1 -0
  22. package/dist/chunks/{eval-DINS_Vhl.js → eval-4uLqmhXl.js} +5 -5
  23. package/dist/chunks/eval-4uLqmhXl.js.map +1 -0
  24. package/dist/chunks/false-D6AWAlcU.js +12 -0
  25. package/dist/chunks/false-D6AWAlcU.js.map +1 -0
  26. package/dist/chunks/{fortune-DkIZpYa_.js → fortune-D8ZK6xtX.js} +7 -7
  27. package/dist/chunks/fortune-D8ZK6xtX.js.map +1 -0
  28. package/dist/chunks/grep-DZO92KaH.js +41 -0
  29. package/dist/chunks/grep-DZO92KaH.js.map +1 -0
  30. package/dist/chunks/head-C_bbNyUc.js +50 -0
  31. package/dist/chunks/head-C_bbNyUc.js.map +1 -0
  32. package/dist/chunks/help-OHTeCzgo.js +19 -0
  33. package/dist/chunks/help-OHTeCzgo.js.map +1 -0
  34. package/dist/chunks/history-DeQor0w1.js +17 -0
  35. package/dist/chunks/history-DeQor0w1.js.map +1 -0
  36. package/dist/chunks/hostname-B-lPyRps.js +10 -0
  37. package/dist/chunks/hostname-B-lPyRps.js.map +1 -0
  38. package/dist/chunks/install-9Dikj7i2.js +27 -0
  39. package/dist/chunks/install-9Dikj7i2.js.map +1 -0
  40. package/dist/chunks/less-wELkkcQx.js +98 -0
  41. package/dist/chunks/less-wELkkcQx.js.map +1 -0
  42. package/dist/chunks/{lolcat-Dyjbg15t.js → lolcat-xpDAXsIt.js} +20 -20
  43. package/dist/chunks/lolcat-xpDAXsIt.js.map +1 -0
  44. package/dist/chunks/{ls-DnmR50y0.js → ls-D2Ln7mue.js} +7 -7
  45. package/dist/chunks/ls-D2Ln7mue.js.map +1 -0
  46. package/dist/chunks/man-E9nMmKZ1.js +58 -0
  47. package/dist/chunks/man-E9nMmKZ1.js.map +1 -0
  48. package/dist/chunks/nano-DsRjsQ-k.js +79 -0
  49. package/dist/chunks/nano-DsRjsQ-k.js.map +1 -0
  50. package/dist/chunks/neofetch-Dyre2Ik0.js +46 -0
  51. package/dist/chunks/neofetch-Dyre2Ik0.js.map +1 -0
  52. package/dist/chunks/pipes-CQ-pK6Kv.js +89 -0
  53. package/dist/chunks/pipes-CQ-pK6Kv.js.map +1 -0
  54. package/dist/chunks/printenv-Cq-skM9d.js +22 -0
  55. package/dist/chunks/printenv-Cq-skM9d.js.map +1 -0
  56. package/dist/chunks/pwd-CZ9IWAfu.js +11 -0
  57. package/dist/chunks/pwd-CZ9IWAfu.js.map +1 -0
  58. package/dist/chunks/rain-DT-V01dD.js +63 -0
  59. package/dist/chunks/rain-DT-V01dD.js.map +1 -0
  60. package/dist/chunks/reload-CE3ZVq6O.js +10 -0
  61. package/dist/chunks/reload-CE3ZVq6O.js.map +1 -0
  62. package/dist/chunks/rev-C5m1qeoZ.js +15 -0
  63. package/dist/chunks/rev-C5m1qeoZ.js.map +1 -0
  64. package/dist/chunks/rm-Uxuv-dEz.js.map +1 -1
  65. package/dist/chunks/rmdir-BYWer3pb.js.map +1 -1
  66. package/dist/chunks/sh-CIyBHb8C.js +11 -0
  67. package/dist/chunks/sh-CIyBHb8C.js.map +1 -0
  68. package/dist/chunks/{sl-CLAmugya.js → sl-CVLteJLH.js} +10 -10
  69. package/dist/chunks/{sl-CLAmugya.js.map → sl-CVLteJLH.js.map} +1 -1
  70. package/dist/chunks/sleep-hEBW30R3.js +26 -0
  71. package/dist/chunks/sleep-hEBW30R3.js.map +1 -0
  72. package/dist/chunks/snow-DAlyPPxX.js +76 -0
  73. package/dist/chunks/snow-DAlyPPxX.js.map +1 -0
  74. package/dist/chunks/tail-BLlaoTxA.js +50 -0
  75. package/dist/chunks/tail-BLlaoTxA.js.map +1 -0
  76. package/dist/chunks/terminalUIApp-Bmiaqvd9.js +63 -0
  77. package/dist/chunks/terminalUIApp-Bmiaqvd9.js.map +1 -0
  78. package/dist/chunks/textEditorApp-BM3EiMoV.js +56 -0
  79. package/dist/chunks/textEditorApp-BM3EiMoV.js.map +1 -0
  80. package/dist/chunks/true-j1Uf2Nz9.js +12 -0
  81. package/dist/chunks/true-j1Uf2Nz9.js.map +1 -0
  82. package/dist/chunks/uniq-LncLpnFY.js +44 -0
  83. package/dist/chunks/uniq-LncLpnFY.js.map +1 -0
  84. package/dist/chunks/uptime-pYltXMOi.js +10 -0
  85. package/dist/chunks/uptime-pYltXMOi.js.map +1 -0
  86. package/dist/chunks/vi-Cgo3qLR9.js +121 -0
  87. package/dist/chunks/vi-Cgo3qLR9.js.map +1 -0
  88. package/dist/chunks/watch-B4Tgzgbn.js +53 -0
  89. package/dist/chunks/watch-B4Tgzgbn.js.map +1 -0
  90. package/dist/chunks/whatis-BPKA-MNF.js +17 -0
  91. package/dist/chunks/whatis-BPKA-MNF.js.map +1 -0
  92. package/dist/chunks/whoami-BS3xdQEI.js +10 -0
  93. package/dist/chunks/whoami-BS3xdQEI.js.map +1 -0
  94. package/dist/chunks/yes-ilM2l2xq.js +18 -0
  95. package/dist/chunks/yes-ilM2l2xq.js.map +1 -0
  96. package/dist/main.d.ts +803 -73
  97. package/dist/main.js +17714 -16034
  98. package/dist/main.js.map +1 -1
  99. package/package.json +19 -18
  100. package/dist/chunks/cat-DH-kPf08.js +0 -44
  101. package/dist/chunks/cat-DH-kPf08.js.map +0 -1
  102. package/dist/chunks/clear-DC-frUcf.js +0 -13
  103. package/dist/chunks/clear-DC-frUcf.js.map +0 -1
  104. package/dist/chunks/compgen-OhvISbst.js +0 -11
  105. package/dist/chunks/compgen-OhvISbst.js.map +0 -1
  106. package/dist/chunks/cowsay-hTKzWScw.js.map +0 -1
  107. package/dist/chunks/date-D8cnHZuY.js +0 -33
  108. package/dist/chunks/date-D8cnHZuY.js.map +0 -1
  109. package/dist/chunks/dir-BmNeEPzy.js +0 -11
  110. package/dist/chunks/dir-BmNeEPzy.js.map +0 -1
  111. package/dist/chunks/echo-Gmh-b8f5.js.map +0 -1
  112. package/dist/chunks/eval-DINS_Vhl.js.map +0 -1
  113. package/dist/chunks/fortune-DkIZpYa_.js.map +0 -1
  114. package/dist/chunks/grep-CR3FMStR.js +0 -41
  115. package/dist/chunks/grep-CR3FMStR.js.map +0 -1
  116. package/dist/chunks/help-Drx0UDCY.js +0 -19
  117. package/dist/chunks/help-Drx0UDCY.js.map +0 -1
  118. package/dist/chunks/history-BEJhnsrb.js +0 -17
  119. package/dist/chunks/history-BEJhnsrb.js.map +0 -1
  120. package/dist/chunks/hostname-D8sxyWIy.js +0 -10
  121. package/dist/chunks/hostname-D8sxyWIy.js.map +0 -1
  122. package/dist/chunks/lolcat-Dyjbg15t.js.map +0 -1
  123. package/dist/chunks/ls-DnmR50y0.js.map +0 -1
  124. package/dist/chunks/man-7W6T7lda.js +0 -60
  125. package/dist/chunks/man-7W6T7lda.js.map +0 -1
  126. package/dist/chunks/neofetch--vHMIS9v.js +0 -40
  127. package/dist/chunks/neofetch--vHMIS9v.js.map +0 -1
  128. package/dist/chunks/printenv-6OpJKd7g.js +0 -24
  129. package/dist/chunks/printenv-6OpJKd7g.js.map +0 -1
  130. package/dist/chunks/pwd-9JYDUbov.js +0 -11
  131. package/dist/chunks/pwd-9JYDUbov.js.map +0 -1
  132. package/dist/chunks/reload-CjTJVt5Z.js +0 -10
  133. package/dist/chunks/reload-CjTJVt5Z.js.map +0 -1
  134. package/dist/chunks/rev--2pyt1P8.js +0 -12
  135. package/dist/chunks/rev--2pyt1P8.js.map +0 -1
  136. package/dist/chunks/sh-B67OTc-j.js +0 -15
  137. package/dist/chunks/sh-B67OTc-j.js.map +0 -1
  138. package/dist/chunks/uniq-Dx_4r3B5.js +0 -44
  139. package/dist/chunks/uniq-Dx_4r3B5.js.map +0 -1
  140. package/dist/chunks/uptime-DjJ5V7hu.js +0 -10
  141. package/dist/chunks/uptime-DjJ5V7hu.js.map +0 -1
  142. package/dist/chunks/watch-BjJ8bCnP.js +0 -52
  143. package/dist/chunks/watch-BjJ8bCnP.js.map +0 -1
  144. package/dist/chunks/whatis-CFZWdHZ4.js +0 -17
  145. package/dist/chunks/whatis-CFZWdHZ4.js.map +0 -1
  146. package/dist/chunks/whoami-D-es0JvS.js +0 -10
  147. package/dist/chunks/whoami-D-es0JvS.js.map +0 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@prozilla-os/core",
3
3
  "description": "A React component library written in TypeScript for building web-based operating systems, made by Prozilla.",
4
- "version": "2.0.2",
4
+ "version": "2.1.2",
5
5
  "homepage": "https://os.prozilla.dev",
6
6
  "author": {
7
7
  "name": "Prozilla",
@@ -19,31 +19,32 @@
19
19
  },
20
20
  "license": "MIT",
21
21
  "dependencies": {
22
- "@fortawesome/fontawesome-svg-core": "^7.1.0",
23
- "@fortawesome/free-regular-svg-icons": "^7.1.0",
24
- "@fortawesome/free-solid-svg-icons": "^7.1.0",
25
- "@fortawesome/react-fontawesome": "^3.1.1",
22
+ "@fortawesome/fontawesome-svg-core": "^7.2.0",
23
+ "@fortawesome/free-regular-svg-icons": "^7.2.0",
24
+ "@fortawesome/free-solid-svg-icons": "^7.2.0",
25
+ "@fortawesome/react-fontawesome": "^3.3.1",
26
26
  "lz-string": "^1.5.0",
27
27
  "react": "^18.3.1",
28
28
  "react-dom": "^18.3.1",
29
- "react-draggable": "^4.4.6",
30
- "react-error-boundary": "^4.0.13",
29
+ "react-router-dom": "^6.30.3",
30
+ "react-draggable": "^4.5.0",
31
+ "react-error-boundary": "^4.1.2",
31
32
  "react-ga4": "^2.1.0",
32
- "react-svg": "^16.1.34",
33
- "valtio": "^2.3.1",
34
- "@prozilla-os/shared": "1.3.0",
33
+ "react-svg": "^17.2.4",
34
+ "valtio": "^2.3.2",
35
+ "@prozilla-os/shared": "1.4.0",
35
36
  "@prozilla-os/skins": "1.1.9"
36
37
  },
37
38
  "devDependencies": {
38
- "@types/node": "^20.14.5",
39
- "@types/react": "^18.3.27",
40
- "@vitejs/plugin-react-swc": "^3.7.0",
41
- "glob": "^11.0.0",
42
- "typescript": "^5.5.4",
43
- "vite": "^7.3.1",
44
- "vite-plugin-css-injected-by-js": "^3.5.1",
39
+ "@types/node": "^20.19.39",
40
+ "@types/react": "^18.3.28",
41
+ "@vitejs/plugin-react-swc": "^3.11.0",
42
+ "glob": "^11.1.0",
43
+ "typescript": "^5.9.3",
44
+ "vite": "^7.3.2",
45
+ "vite-plugin-css-injected-by-js": "^3.5.2",
45
46
  "vite-plugin-dts": "^4.5.4",
46
- "vitest": "^4.0.18"
47
+ "vitest": "^4.1.5"
47
48
  },
48
49
  "peerDependencies": {
49
50
  "react": "^18.3.1"
@@ -1,44 +0,0 @@
1
- import { Command as w, EXIT_CODE as E, Stream as i, Shell as s } from "../main.js";
2
- const T = new w().setManual({
3
- purpose: "Concatenate files and display on the terminal screen",
4
- usage: "cat [OPTION]... [FILE]...",
5
- description: "Concatenate FILE(s) to standard output. With no FILE, or when FILE is -, read standard input.",
6
- options: {
7
- "-e": "Display $ at end of each line"
8
- }
9
- }).addOption({ short: "e", long: "show-ends", isInput: !1 }).setExecute(async function(r, { workingDirectory: f, options: p, stdout: d, stderr: c, stdin: n }) {
10
- let o = E.success;
11
- const a = (t) => {
12
- let e = t;
13
- p.includes("e") && (e = e.split(`
14
- `).join(`$
15
- `) + "$"), d.write(e);
16
- };
17
- if (r.length === 0)
18
- return n.on(i.DATA_EVENT, (t) => {
19
- a(t);
20
- }), n.wait(E.success);
21
- for (const t of r) {
22
- if (t === "-") {
23
- const l = (h) => a(h);
24
- n.on(i.DATA_EVENT, l), await n.wait(), n.off(i.DATA_EVENT, l);
25
- continue;
26
- }
27
- const e = f.navigate(t);
28
- if (!e) {
29
- o = s.writeError(c, this.name, `${t}: ${s.INVALID_PATH_ERROR}`);
30
- continue;
31
- }
32
- if (e.isFolder()) {
33
- o = s.writeError(c, this.name, `${t}: Is a directory`);
34
- continue;
35
- }
36
- const u = await e.read();
37
- u != null && a(u);
38
- }
39
- return o;
40
- });
41
- export {
42
- T as cat
43
- };
44
- //# sourceMappingURL=cat-DH-kPf08.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cat-DH-kPf08.js","sources":["../../src/features/shell/commands/cat.ts"],"sourcesContent":["import { EXIT_CODE } from \"../../../constants\";\nimport { Command } from \"../command\";\nimport { Shell } from \"../shell\";\nimport { Stream } from \"../stream\";\n\nexport const cat = new Command()\n\t.setManual({\n\t\tpurpose: \"Concatenate files and display on the terminal screen\",\n\t\tusage: \"cat [OPTION]... [FILE]...\",\n\t\tdescription: \"Concatenate FILE(s) to standard output. With no FILE, or when FILE is -, read standard input.\",\n\t\toptions: {\n\t\t\t\"-e\": \"Display $ at end of each line\",\n\t\t},\n\t})\n\t.addOption({ short: \"e\", long: \"show-ends\", isInput: false })\n\t.setExecute(async function(this: Command, args, { workingDirectory, options, stdout, stderr, stdin }) {\n\t\tlet exitCode: number = EXIT_CODE.success;\n\n\t\t// Helper to format and write content with options\n\t\tconst writeContent = (content: string) => {\n\t\t\tlet output = content;\n\t\t\tif (options.includes(\"e\")) {\n\t\t\t\toutput = output.split(\"\\n\").join(\"$\\n\") + \"$\";\n\t\t\t}\n\t\t\tstdout.write(output);\n\t\t};\n\n\t\t// Read from stdin\n\t\tif (args.length === 0) {\n\t\t\tstdin.on(Stream.DATA_EVENT, (data) => {\n\t\t\t\twriteContent(data);\n\t\t\t});\n\t\t\treturn stdin.wait(EXIT_CODE.success);\n\t\t}\n\n\t\t// Iterate through file arguments\n\t\tfor (const path of args) {\n\t\t\tif (path === \"-\") {\n\t\t\t\tconst onData = (data: string) => writeContent(data);\n\t\t\t\tstdin.on(Stream.DATA_EVENT, onData);\n\t\t\t\tawait stdin.wait();\n\t\t\t\tstdin.off(Stream.DATA_EVENT, onData);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst target = workingDirectory.navigate(path);\n\n\t\t\tif (!target) {\n\t\t\t\texitCode = Shell.writeError(stderr, this.name, `${path}: ${Shell.INVALID_PATH_ERROR}`);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (target.isFolder()) {\n\t\t\t\texitCode = Shell.writeError(stderr, this.name, `${path}: Is a directory`);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst content = await target.read();\n\t\t\tif (content != null) {\n\t\t\t\twriteContent(content);\n\t\t\t}\n\t\t}\n\n\t\treturn exitCode;\n\t});"],"names":["cat","Command","args","workingDirectory","options","stdout","stderr","stdin","exitCode","EXIT_CODE","writeContent","content","output","Stream","data","path","onData","target","Shell"],"mappings":";AAKO,MAAMA,IAAM,IAAIC,EAAA,EACrB,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AAAA,EACP,aAAa;AAAA,EACb,SAAS;AAAA,IACR,MAAM;AAAA,EAAA;AAER,CAAC,EACA,UAAU,EAAE,OAAO,KAAK,MAAM,aAAa,SAAS,GAAA,CAAO,EAC3D,WAAW,eAA8BC,GAAM,EAAE,kBAAAC,GAAkB,SAAAC,GAAS,QAAAC,GAAQ,QAAAC,GAAQ,OAAAC,KAAS;AACrG,MAAIC,IAAmBC,EAAU;AAGjC,QAAMC,IAAe,CAACC,MAAoB;AACzC,QAAIC,IAASD;AACb,IAAIP,EAAQ,SAAS,GAAG,MACvBQ,IAASA,EAAO,MAAM;AAAA,CAAI,EAAE,KAAK;AAAA,CAAK,IAAI,MAE3CP,EAAO,MAAMO,CAAM;AAAA,EACpB;AAGA,MAAIV,EAAK,WAAW;AACnB,WAAAK,EAAM,GAAGM,EAAO,YAAY,CAACC,MAAS;AACrC,MAAAJ,EAAaI,CAAI;AAAA,IAClB,CAAC,GACMP,EAAM,KAAKE,EAAU,OAAO;AAIpC,aAAWM,KAAQb,GAAM;AACxB,QAAIa,MAAS,KAAK;AACjB,YAAMC,IAAS,CAACF,MAAiBJ,EAAaI,CAAI;AAClD,MAAAP,EAAM,GAAGM,EAAO,YAAYG,CAAM,GAClC,MAAMT,EAAM,KAAA,GACZA,EAAM,IAAIM,EAAO,YAAYG,CAAM;AACnC;AAAA,IACD;AAEA,UAAMC,IAASd,EAAiB,SAASY,CAAI;AAE7C,QAAI,CAACE,GAAQ;AACZ,MAAAT,IAAWU,EAAM,WAAWZ,GAAQ,KAAK,MAAM,GAAGS,CAAI,KAAKG,EAAM,kBAAkB,EAAE;AACrF;AAAA,IACD;AAEA,QAAID,EAAO,YAAY;AACtB,MAAAT,IAAWU,EAAM,WAAWZ,GAAQ,KAAK,MAAM,GAAGS,CAAI,kBAAkB;AACxE;AAAA,IACD;AAEA,UAAMJ,IAAU,MAAMM,EAAO,KAAA;AAC7B,IAAIN,KAAW,QACdD,EAAaC,CAAO;AAAA,EAEtB;AAEA,SAAOH;AACR,CAAC;"}
@@ -1,13 +0,0 @@
1
- import { Command as r } from "../main.js";
2
- const t = new r().setManual({
3
- purpose: "Clear terminal screen"
4
- }).setExecute(function(a, { shell: e }) {
5
- e.pushHistory({
6
- clear: !0,
7
- isCommand: !1
8
- });
9
- });
10
- export {
11
- t as clear
12
- };
13
- //# sourceMappingURL=clear-DC-frUcf.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"clear-DC-frUcf.js","sources":["../../src/features/shell/commands/clear.ts"],"sourcesContent":["import { Command } from \"../command\";\n\nexport const clear = new Command()\n\t.setManual({\n\t\tpurpose: \"Clear terminal screen\",\n\t})\n\t.setExecute(function(_args, { shell }) {\n\t\tshell.pushHistory({\n\t\t\tclear: true,\n\t\t\tisCommand: false,\n\t\t});\n\t});"],"names":["clear","Command","_args","shell"],"mappings":";AAEO,MAAMA,IAAQ,IAAIC,EAAA,EACvB,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,SAASC,GAAO,EAAE,OAAAC,KAAS;AACtC,EAAAA,EAAM,YAAY;AAAA,IACjB,OAAO;AAAA,IACP,WAAW;AAAA,EAAA,CACX;AACF,CAAC;"}
@@ -1,11 +0,0 @@
1
- import { Command as a, CommandsManager as s } from "../main.js";
2
- const i = new a().setManual({
3
- purpose: "Display a list of all commands"
4
- }).setRequireOptions(!0).setExecute(function(t, { options: e, stdout: n }) {
5
- e.includes("c") && n.write(s.COMMANDS.map((o) => o.name).sort().join(`
6
- `));
7
- });
8
- export {
9
- i as compgen
10
- };
11
- //# sourceMappingURL=compgen-OhvISbst.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"compgen-OhvISbst.js","sources":["../../src/features/shell/commands/compgen.ts"],"sourcesContent":["import { Command } 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, { options, stdout }) {\n\t\tif (options.includes(\"c\")) {\n\t\t\tstdout.write(CommandsManager.COMMANDS.map((command) => command.name).sort().join(\"\\n\"));\n\t\t}\n\t});"],"names":["compgen","Command","_args","options","stdout","CommandsManager","command"],"mappings":";AAGO,MAAMA,IAAU,IAAIC,EAAA,EACzB,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,kBAAkB,EAAI,EACtB,WAAW,SAASC,GAAO,EAAE,SAAAC,GAAS,QAAAC,KAAU;AAChD,EAAID,EAAQ,SAAS,GAAG,KACvBC,EAAO,MAAMC,EAAgB,SAAS,IAAI,CAACC,MAAYA,EAAQ,IAAI,EAAE,KAAA,EAAO,KAAK;AAAA,CAAI,CAAC;AAExF,CAAC;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"cowsay-hTKzWScw.js","sources":["../../src/features/shell/commands/cowsay.ts"],"sourcesContent":["import { MAX_WIDTH } from \"../../../constants/shell.const\";\nimport { Command } from \"../command\";\nimport { Shell } from \"../shell\";\n\nconst COW = `\n \\\\ ^__^\n \\\\ (oo)\\\\_______\n (__)\\\\ )\\\\/\\\\\n ||----w |\n || ||`;\n\nfunction renderCowsay(text: string): string {\n\t// Separate input value into lines\n\tconst segments = text.split(\" \");\n\tconst lines: string[] = [];\n\tlet currentLine = \"\";\n\tlet maxLineWidth = 0;\n\n\tconst addLine = (line: string) => {\n\t\tline = line.trimEnd();\n\t\tlines.push(line);\n\t\tif (line.length > maxLineWidth)\n\t\t\tmaxLineWidth = line.length;\n\t};\n\n\tconst nextLine = (word?: string) => {\n\t\taddLine(currentLine);\n\t\tcurrentLine = word ? word + \" \" : \"\";\n\t};\n\n\tsegments.forEach((segment) => {\n\t\t// Add empty spaces preceding lines\n\t\tif (segment === \"\") {\n\t\t\tcurrentLine += \" \";\n\t\t\treturn;\n\t\t}\n\n\t\tconst words = segment.split(\"\\n\");\n\t\tfor (let i = 0; i < words.length; i++) {\n\t\t\tconst word = words[i];\n\n\t\t\t// Handle next lines\n\t\t\tif (i > 0)\n\t\t\t\tnextLine();\n\n\t\t\t// Fit word on current line\n\t\t\tif ((currentLine + word).length <= MAX_WIDTH) {\n\t\t\t\tcurrentLine += word + \" \";\n\t\t\t} else if (word.length > MAX_WIDTH) {\n\t\t\t\tconst remainingSpaces = MAX_WIDTH - currentLine.length;\n\n\t\t\t\tif (remainingSpaces >= 2) {\n\t\t\t\t\taddLine(currentLine + word.substring(0, remainingSpaces - 1) + \"-\");\n\t\t\t\t\tcurrentLine = word.substring(remainingSpaces - 1) + \" \";\n\t\t\t\t} else {\n\t\t\t\t\tnextLine(word);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnextLine(word);\n\t\t\t}\n\t\t}\n\t});\n\n\tif (currentLine.length > 0)\n\t\taddLine(currentLine);\n\n\t// Turn lines into speech bubble\n\tconst speechBubble = [` ${\"_\".repeat(maxLineWidth + 2)} `];\n\t\n\tfor (let i = 0; i < lines.length; i++) {\n\t\tlet line = lines[i];\n\t\tconst missingSpaces = maxLineWidth - line.length;\n\n\t\tif (missingSpaces > 0)\n\t\t\tline += \" \".repeat(missingSpaces);\n\n\t\tif (lines.length > 1) {\n\t\t\tif (i === 0) {\n\t\t\t\tline = `/ ${line} \\\\`;\n\t\t\t} else if (i === lines.length - 1) {\n\t\t\t\tline = `\\\\ ${line} /`;\n\t\t\t} else {\n\t\t\t\tline = `| ${line} |`;\n\t\t\t}\n\t\t} else {\n\t\t\tline = `< ${line} >`;\n\t\t}\n\n\t\tspeechBubble.push(line);\n\t}\n\n\tspeechBubble.push(` ${\"-\".repeat(maxLineWidth + 2)} `);\n\n\treturn speechBubble.join(\"\\n\") + COW + \"\\n\";\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, { rawLine, stdout, stdin }) {\n\t\treturn Shell.readInput(rawLine, stdin, (text) => {\n\t\t\tstdout.write(renderCowsay(text));\n\t\t});\n\t});"],"names":["COW","renderCowsay","text","segments","lines","currentLine","maxLineWidth","addLine","line","nextLine","word","segment","words","i","MAX_WIDTH","remainingSpaces","speechBubble","missingSpaces","cowsay","Command","_args","rawLine","stdout","stdin","Shell"],"mappings":";AAIA,MAAMA,IAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAOZ,SAASC,EAAaC,GAAsB;AAE3C,QAAMC,IAAWD,EAAK,MAAM,GAAG,GACzBE,IAAkB,CAAA;AACxB,MAAIC,IAAc,IACdC,IAAe;AAEnB,QAAMC,IAAU,CAACC,MAAiB;AACjC,IAAAA,IAAOA,EAAK,QAAA,GACZJ,EAAM,KAAKI,CAAI,GACXA,EAAK,SAASF,MACjBA,IAAeE,EAAK;AAAA,EACtB,GAEMC,IAAW,CAACC,MAAkB;AACnC,IAAAH,EAAQF,CAAW,GACnBA,IAAcK,IAAOA,IAAO,MAAM;AAAA,EACnC;AAEA,EAAAP,EAAS,QAAQ,CAACQ,MAAY;AAE7B,QAAIA,MAAY,IAAI;AACnB,MAAAN,KAAe;AACf;AAAA,IACD;AAEA,UAAMO,IAAQD,EAAQ,MAAM;AAAA,CAAI;AAChC,aAASE,IAAI,GAAGA,IAAID,EAAM,QAAQC,KAAK;AACtC,YAAMH,IAAOE,EAAMC,CAAC;AAOpB,UAJIA,IAAI,KACPJ,EAAA,IAGIJ,IAAcK,GAAM,UAAUI;AAClC,QAAAT,KAAeK,IAAO;AAAA,eACZA,EAAK,SAASI,GAAW;AACnC,cAAMC,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,MAEf;AACC,QAAAD,EAASC,CAAI;AAAA,IAEf;AAAA,EACD,CAAC,GAEGL,EAAY,SAAS,KACxBE,EAAQF,CAAW;AAGpB,QAAMW,IAAe,CAAC,IAAI,IAAI,OAAOV,IAAe,CAAC,CAAC,GAAG;AAEzD,WAASO,IAAI,GAAGA,IAAIT,EAAM,QAAQS,KAAK;AACtC,QAAIL,IAAOJ,EAAMS,CAAC;AAClB,UAAMI,IAAgBX,IAAeE,EAAK;AAE1C,IAAIS,IAAgB,MACnBT,KAAQ,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,IAAIhB,IAAM;AAAA;AACxC;AAEO,MAAMkB,IAAS,IAAIC,EAAA,EACxB,eAAe,EAAI,EACnB,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AAAA,EACP,aAAa;AACd,CAAC,EACA,WAAW,SAASC,GAAO,EAAE,SAAAC,GAAS,QAAAC,GAAQ,OAAAC,KAAS;AACvD,SAAOC,EAAM,UAAUH,GAASE,GAAO,CAACrB,MAAS;AAChD,IAAAoB,EAAO,MAAMrB,EAAaC,CAAI,CAAC;AAAA,EAChC,CAAC;AACF,CAAC;"}
@@ -1,33 +0,0 @@
1
- import { Command as U } from "../main.js";
2
- const h = new U().setManual({
3
- purpose: "Display or set the date and time",
4
- usage: "date [option] [+format]",
5
- description: "Display the current time in the given FORMAT.",
6
- options: {
7
- "-u": "Display UTC (Coordinated Universal Time)"
8
- }
9
- }).addOption({ short: "u", long: "utc" }).setExecute(function(p, { stdout: r, options: m }) {
10
- const t = /* @__PURE__ */ new Date(), n = m.includes("u"), i = p.find((o) => o.startsWith("+"));
11
- if (!i) {
12
- r.write(n ? t.toUTCString() : t.toString());
13
- return;
14
- }
15
- const e = (o) => o.toString().padStart(2, "0"), a = n ? t.getUTCFullYear() : t.getFullYear(), c = (n ? t.getUTCMonth() : t.getMonth()) + 1, u = n ? t.getUTCDate() : t.getDate(), g = n ? t.getUTCHours() : t.getHours(), d = n ? t.getUTCMinutes() : t.getMinutes(), l = n ? t.getUTCSeconds() : t.getSeconds(), T = {
16
- "%Y": a.toString(),
17
- "%m": e(c),
18
- "%d": e(u),
19
- "%H": e(g),
20
- "%M": e(d),
21
- "%S": e(l),
22
- "%T": `${e(g)}:${e(d)}:${e(l)}`,
23
- "%D": `${e(c)}/${e(u)}/${a.toString().slice(-2)}`
24
- };
25
- let s = i.substring(1);
26
- for (const [o, C] of Object.entries(T))
27
- s = s.replaceAll(o, C);
28
- r.write(s);
29
- });
30
- export {
31
- h as date
32
- };
33
- //# sourceMappingURL=date-D8cnHZuY.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"date-D8cnHZuY.js","sources":["../../src/features/shell/commands/date.ts"],"sourcesContent":["import { Command } from \"../command\";\n\nexport const date = new Command()\n\t.setManual({\n\t\tpurpose: \"Display or set the date and time\",\n\t\tusage: \"date [option] [+format]\",\n\t\tdescription: \"Display the current time in the given FORMAT.\",\n\t\toptions: {\n\t\t\t\"-u\": \"Display UTC (Coordinated Universal Time)\",\n\t\t},\n\t})\n\t.addOption({ short: \"u\", long: \"utc\" })\n\t.setExecute(function(this: Command, args, { stdout, options }) {\n\t\tconst now = new Date();\n\t\tconst isUtc = options.includes(\"u\");\n\t\tconst formatArgument = args.find((arg) => arg.startsWith(\"+\"));\n\n\t\tif (!formatArgument) {\n\t\t\tstdout.write(isUtc ? now.toUTCString() : now.toString());\n\t\t\treturn;\n\t\t}\n\n\t\tconst pad = (value: number) => value.toString().padStart(2, \"0\");\n\n\t\tconst year = isUtc ? now.getUTCFullYear() : now.getFullYear();\n\t\tconst month = (isUtc ? now.getUTCMonth() : now.getMonth()) + 1;\n\t\tconst day = isUtc ? now.getUTCDate() : now.getDate();\n\t\tconst hours = isUtc ? now.getUTCHours() : now.getHours();\n\t\tconst minutes = isUtc ? now.getUTCMinutes() : now.getMinutes();\n\t\tconst seconds = isUtc ? now.getUTCSeconds() : now.getSeconds();\n\n\t\tconst formatMap: Record<string, string> = {\n\t\t\t\"%Y\": year.toString(),\n\t\t\t\"%m\": pad(month),\n\t\t\t\"%d\": pad(day),\n\t\t\t\"%H\": pad(hours),\n\t\t\t\"%M\": pad(minutes),\n\t\t\t\"%S\": pad(seconds),\n\t\t\t\"%T\": `${pad(hours)}:${pad(minutes)}:${pad(seconds)}`,\n\t\t\t\"%D\": `${pad(month)}/${pad(day)}/${year.toString().slice(-2)}`,\n\t\t};\n\n\t\tlet result = formatArgument.substring(1);\n\n\t\tfor (const [key, value] of Object.entries(formatMap)) {\n\t\t\tresult = result.replaceAll(key, value);\n\t\t}\n\n\t\tstdout.write(result);\n\t});"],"names":["date","Command","args","stdout","options","now","isUtc","formatArgument","arg","pad","value","year","month","day","hours","minutes","seconds","formatMap","result","key"],"mappings":";AAEO,MAAMA,IAAO,IAAIC,EAAA,EACtB,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AAAA,EACP,aAAa;AAAA,EACb,SAAS;AAAA,IACR,MAAM;AAAA,EAAA;AAER,CAAC,EACA,UAAU,EAAE,OAAO,KAAK,MAAM,OAAO,EACrC,WAAW,SAAwBC,GAAM,EAAE,QAAAC,GAAQ,SAAAC,KAAW;AAC9D,QAAMC,wBAAU,KAAA,GACVC,IAAQF,EAAQ,SAAS,GAAG,GAC5BG,IAAiBL,EAAK,KAAK,CAACM,MAAQA,EAAI,WAAW,GAAG,CAAC;AAE7D,MAAI,CAACD,GAAgB;AACpB,IAAAJ,EAAO,MAAMG,IAAQD,EAAI,gBAAgBA,EAAI,UAAU;AACvD;AAAA,EACD;AAEA,QAAMI,IAAM,CAACC,MAAkBA,EAAM,WAAW,SAAS,GAAG,GAAG,GAEzDC,IAAOL,IAAQD,EAAI,eAAA,IAAmBA,EAAI,YAAA,GAC1CO,KAASN,IAAQD,EAAI,gBAAgBA,EAAI,cAAc,GACvDQ,IAAMP,IAAQD,EAAI,WAAA,IAAeA,EAAI,QAAA,GACrCS,IAAQR,IAAQD,EAAI,YAAA,IAAgBA,EAAI,SAAA,GACxCU,IAAUT,IAAQD,EAAI,cAAA,IAAkBA,EAAI,WAAA,GAC5CW,IAAUV,IAAQD,EAAI,cAAA,IAAkBA,EAAI,WAAA,GAE5CY,IAAoC;AAAA,IACzC,MAAMN,EAAK,SAAA;AAAA,IACX,MAAMF,EAAIG,CAAK;AAAA,IACf,MAAMH,EAAII,CAAG;AAAA,IACb,MAAMJ,EAAIK,CAAK;AAAA,IACf,MAAML,EAAIM,CAAO;AAAA,IACjB,MAAMN,EAAIO,CAAO;AAAA,IACjB,MAAM,GAAGP,EAAIK,CAAK,CAAC,IAAIL,EAAIM,CAAO,CAAC,IAAIN,EAAIO,CAAO,CAAC;AAAA,IACnD,MAAM,GAAGP,EAAIG,CAAK,CAAC,IAAIH,EAAII,CAAG,CAAC,IAAIF,EAAK,SAAA,EAAW,MAAM,EAAE,CAAC;AAAA,EAAA;AAG7D,MAAIO,IAASX,EAAe,UAAU,CAAC;AAEvC,aAAW,CAACY,GAAKT,CAAK,KAAK,OAAO,QAAQO,CAAS;AAClD,IAAAC,IAASA,EAAO,WAAWC,GAAKT,CAAK;AAGtC,EAAAP,EAAO,MAAMe,CAAM;AACpB,CAAC;"}
@@ -1,11 +0,0 @@
1
- import { Command as n } from "../main.js";
2
- const c = new n().setManual({
3
- purpose: "List all directories in the current directory"
4
- }).setExecute(function(s, { workingDirectory: t, stdout: o }) {
5
- const r = t.subFolders.map((e) => e.id);
6
- r.length !== 0 && o.write(r.sort((e, i) => e.localeCompare(i)).join(" "));
7
- });
8
- export {
9
- c as dir
10
- };
11
- //# sourceMappingURL=dir-BmNeEPzy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dir-BmNeEPzy.js","sources":["../../src/features/shell/commands/dir.ts"],"sourcesContent":["import { Command } from \"../command\";\n\nexport const dir = new Command()\n\t.setManual({\n\t\tpurpose: \"List all directories in the current directory\",\n\t})\n\t.setExecute(function(_args, { workingDirectory, stdout }) {\n\t\tconst folderNames = workingDirectory.subFolders.map((folder) => folder.id);\n\t\n\t\tif (folderNames.length === 0)\n\t\t\treturn;\n\t\n\t\tstdout.write(folderNames.sort((nameA, nameB) => nameA.localeCompare(nameB)).join(\" \"));\n\t});"],"names":["dir","Command","_args","workingDirectory","stdout","folderNames","folder","nameA","nameB"],"mappings":";AAEO,MAAMA,IAAM,IAAIC,EAAA,EACrB,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,SAASC,GAAO,EAAE,kBAAAC,GAAkB,QAAAC,KAAU;AACzD,QAAMC,IAAcF,EAAiB,WAAW,IAAI,CAACG,MAAWA,EAAO,EAAE;AAEzE,EAAID,EAAY,WAAW,KAG3BD,EAAO,MAAMC,EAAY,KAAK,CAACE,GAAOC,MAAUD,EAAM,cAAcC,CAAK,CAAC,EAAE,KAAK,GAAG,CAAC;AACtF,CAAC;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"echo-Gmh-b8f5.js","sources":["../../src/features/shell/commands/echo.ts"],"sourcesContent":["import { Command } from \"../command\";\n\nexport const echo = new Command()\n\t.setManual({\n\t\tpurpose: \"Display a line of text\",\n\t\tusage: \"echo [option] [string ...]\",\n\t\tdescription: \"Write arguments to the standard output.\",\n\t\toptions: {\n\t\t\t\"-n\": \"Do not output the trailing newline\",\n\t\t},\n\t})\n\t.addOption({ short: \"n\", long: \"no-newline\", isInput: false })\n\t.setExecute(function(this: Command, args, { stdout, options }) {\n\t\tconst output = args.join(\" \");\n\t\tconst ending = options.includes(\"n\") ? \"\" : \"\\n\";\n\n\t\tstdout.write(output + ending);\n\t});"],"names":["echo","Command","args","stdout","options","output","ending"],"mappings":";AAEO,MAAMA,IAAO,IAAIC,EAAA,EACtB,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AAAA,EACP,aAAa;AAAA,EACb,SAAS;AAAA,IACR,MAAM;AAAA,EAAA;AAER,CAAC,EACA,UAAU,EAAE,OAAO,KAAK,MAAM,cAAc,SAAS,GAAA,CAAO,EAC5D,WAAW,SAAwBC,GAAM,EAAE,QAAAC,GAAQ,SAAAC,KAAW;AAC9D,QAAMC,IAASH,EAAK,KAAK,GAAG,GACtBI,IAASF,EAAQ,SAAS,GAAG,IAAI,KAAK;AAAA;AAE5C,EAAAD,EAAO,MAAME,IAASC,CAAM;AAC7B,CAAC;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"eval-DINS_Vhl.js","sources":["../../src/features/shell/commands/eval.ts"],"sourcesContent":["import { EXIT_CODE } from \"../../../constants\";\nimport { Command } from \"../command\";\nimport { Shell, ShellContext } from \"../shell\";\n\nexport const 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\tdescription: \"Executes JavaScript code with access to the shell.\",\n\t})\n\t.setExecute(function(this: Command, args, context) {\n\t\tconst { stdout, stderr } = context;\n\t\tconst code = args.join(\" \");\n\n\t\ttry {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-implied-eval\n\t\t\tconst runner = new Function(\"context\", `\n\t\t\t\twith(context) { \n\t\t\t\t\treturn (${code}); \n\t\t\t\t}\n\t\t\t`) as (context: ShellContext) => unknown;\n\n\t\t\tconst result = runner(context);\n\n\t\t\tif (result !== undefined) {\n\t\t\t\tstdout.write(String(result as unknown));\n\t\t\t}\n\n\t\t\treturn EXIT_CODE.success;\n\t\t} catch (error) {\n\t\t\tconst message = error instanceof Error ? error.message : \"Execution error\";\n\t\t\treturn Shell.writeError(stderr, this.name, message);\n\t\t}\n\t});\n\nexport { evalCommand as eval };"],"names":["evalCommand","Command","args","context","stdout","stderr","code","result","EXIT_CODE","error","message","Shell"],"mappings":";AAIO,MAAMA,IAAc,IAAIC,EAAA,EAC7B,eAAe,EAAI,EACnB,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AAAA,EACP,aAAa;AACd,CAAC,EACA,WAAW,SAAwBC,GAAMC,GAAS;AAClD,QAAM,EAAE,QAAAC,GAAQ,QAAAC,EAAA,IAAWF,GACrBG,IAAOJ,EAAK,KAAK,GAAG;AAE1B,MAAI;AAQH,UAAMK,IANS,IAAI,SAAS,WAAW;AAAA;AAAA,eAE3BD,CAAI;AAAA;AAAA,IAEf,EAEqBH,CAAO;AAE7B,WAAII,MAAW,UACdH,EAAO,MAAM,OAAOG,CAAiB,CAAC,GAGhCC,EAAU;AAAA,EAClB,SAASC,GAAO;AACf,UAAMC,IAAUD,aAAiB,QAAQA,EAAM,UAAU;AACzD,WAAOE,EAAM,WAAWN,GAAQ,KAAK,MAAMK,CAAO;AAAA,EACnD;AACD,CAAC;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"fortune-DkIZpYa_.js","sources":["../../src/features/shell/commands/fortune.ts"],"sourcesContent":["import { randomFromArray } from \"@prozilla-os/shared\";\nimport { Command } from \"../command\";\n\n/**\n * @see [Source](https://github.com/shlomif/fortune-mod/blob/master/fortune-mod/datfiles/fortunes)\n */\nconst FORTUNES = [\n\t\"Do not be afraid of competition.\",\n\t\"An exciting opportunity lies ahead of you.\",\n\t\"You love peace.\",\n\t\"Get your mind set... confidence will lead you on.\",\n\t\"You will always be surrounded by true friends.\",\n\t\"Sell your ideas-they have exceptional merit.\",\n\t\"You should be able to undertake and complete anything.\",\n\t\"You are kind and friendly.\",\n\t\"You are wise beyond your years.\",\n\t\"Your ability to juggle many tasks will take you far.\",\n\t\"A routine task will turn into an enchanting adventure.\",\n\t\"Beware of all enterprises that require new clothes.\",\n\t\"Be true to your work, your word, and your friend.\",\n\t\"Goodness is the only investment that never fails.\",\n\t\"A journey of a thousand miles begins with a single step.\",\n\t\"Forget injuries; never forget kindnesses.\",\n\t\"Respect yourself and others will respect you.\",\n\t\"A man cannot be comfortable without his own approval.\",\n\t\"Always do right. This will gratify some people and astonish the rest.\",\n\t\"It is easier to stay out than to get out.\",\n\t\"Sing everyday and chase the mean blues away.\",\n\t\"You will receive money from an unexpected source.\",\n\t\"Attitude is a little thing that makes a big difference.\",\n\t\"Plan for many pleasures ahead.\",\n\t\"Experience is the best teacher.\",\n\t\"You will be happy with your spouse.\",\n\t\"Expect the unexpected.\",\n\t\"Stay healthy. Walk a mile.\",\n\t\"The family that plays together stays together.\",\n\t\"Eat chocolate to have a sweeter life.\",\n\t\"Once you make a decision the universe conspires to make it happen.\",\n\t\"Make yourself necessary to someone.\",\n\t\"The only way to have a friend is to be one.\",\n\t\"Nothing great was ever achieved without enthusiasm.\",\n\t\"Dance as if no one is watching.\",\n\t\"Live this day as if it were your last.\",\n\t\"Your life will be happy and peaceful.\",\n\t\"Reach for joy and all else will follow.\",\n\t\"Move in the direction of your dreams.\",\n\t\"Bloom where you are planted.\",\n\t\"Appreciate. Appreciate. Appreciate.\",\n\t\"Happy News is on its way.\",\n\t\"A closed mouth gathers no feet.\",\n\t\"He who throws dirt is losing ground.\",\n\t\"Borrow money from a pessimist. They don't expect it back.\",\n\t\"Life is what happens to you while you are busy making other plans.\",\n\t\"Help! I'm being held prisoner in a fortune cookie factory.\",\n];\n\nexport const fortune = new Command()\n\t.setManual({\n\t\tpurpose: \"Tell fortune\",\n\t})\n\t.setExecute(function(_args, { stdout }) {\n\t\tstdout.write(randomFromArray(FORTUNES));\n\t});"],"names":["FORTUNES","fortune","Command","_args","stdout","randomFromArray"],"mappings":";;AAMA,MAAMA,IAAW;AAAA,EAChB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAEaC,IAAU,IAAIC,EAAA,EACzB,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,SAASC,GAAO,EAAE,QAAAC,KAAU;AACvC,EAAAA,EAAO,MAAMC,EAAgBL,CAAQ,CAAC;AACvC,CAAC;"}
@@ -1,41 +0,0 @@
1
- import { Command as w, Shell as o, EXIT_CODE as h } from "../main.js";
2
- const I = new w().setManual({
3
- purpose: "Search for patterns in text",
4
- usage: "grep [option...] pattern [file...]",
5
- description: "Search for PATTERN in each FILE.",
6
- options: {
7
- "-i": "Ignore case distinctions",
8
- "-v": "Invert match: select non-matching lines",
9
- "-n": "Print line number with output lines"
10
- }
11
- }).addOption({ short: "i", long: "ignore-case" }).addOption({ short: "v", long: "invert-match" }).addOption({ short: "n", long: "line-number" }).setExecute(async function(c, { stdout: f, stderr: a, stdin: p, workingDirectory: d, options: i }) {
12
- if (!c.length)
13
- return o.writeError(a, this.name, "Pattern is required");
14
- const [m, ...r] = c, g = new RegExp(m, i.includes("i") ? "i" : ""), l = (e, t) => {
15
- e.split(`
16
- `).forEach((n, E) => {
17
- const u = g.test(n);
18
- if (i.includes("v") ? !u : u) {
19
- let s = "";
20
- t && r.length > 1 && (s += `${t}:`), i.includes("n") && (s += `${E + 1}:`), f.write(s + n);
21
- }
22
- });
23
- };
24
- if (r.length > 0) {
25
- for (const e of r) {
26
- const t = d.navigateToFile(e);
27
- if (!t) {
28
- o.writeError(a, this.name, `${e}: No such file`);
29
- continue;
30
- }
31
- const n = await t.read();
32
- n != null && l(n, e);
33
- }
34
- return h.success;
35
- }
36
- return o.readInput("", p, (e) => (l(e), h.success));
37
- });
38
- export {
39
- I as grep
40
- };
41
- //# sourceMappingURL=grep-CR3FMStR.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"grep-CR3FMStR.js","sources":["../../src/features/shell/commands/grep.ts"],"sourcesContent":["import { EXIT_CODE } from \"../../../constants\";\nimport { Command } from \"../command\";\nimport { Shell } from \"../shell\";\n\nexport const grep = new Command()\n\t.setManual({\n\t\tpurpose: \"Search for patterns in text\",\n\t\tusage: \"grep [option...] pattern [file...]\",\n\t\tdescription: \"Search for PATTERN in each FILE.\",\n\t\toptions: {\n\t\t\t\"-i\": \"Ignore case distinctions\",\n\t\t\t\"-v\": \"Invert match: select non-matching lines\",\n\t\t\t\"-n\": \"Print line number with output lines\",\n\t\t},\n\t})\n\t.addOption({ short: \"i\", long: \"ignore-case\" })\n\t.addOption({ short: \"v\", long: \"invert-match\" })\n\t.addOption({ short: \"n\", long: \"line-number\" })\n\t.setExecute(async function(this: Command, args, { stdout, stderr, stdin, workingDirectory, options }) {\n\t\tif (!args.length)\n\t\t\treturn Shell.writeError(stderr, this.name, \"Pattern is required\");\n\n\t\tconst [pattern, ...fileNames] = args;\n\t\tconst regex = new RegExp(pattern, options.includes(\"i\") ? \"i\" : \"\");\n\n\t\tconst search = (text: string, origin?: string) => {\n\t\t\ttext.split(\"\\n\").forEach((line, index) => {\n\t\t\t\tconst match = regex.test(line);\n\t\t\t\tconst shouldMatch = options.includes(\"v\") ? !match : match;\n\n\t\t\t\tif (shouldMatch) {\n\t\t\t\t\tlet prefix = \"\";\n\t\t\t\t\tif (origin && fileNames.length > 1) prefix += `${origin}:`;\n\t\t\t\t\tif (options.includes(\"n\")) prefix += `${index + 1}:`;\n\t\t\t\t\tstdout.write(prefix + line);\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\tif (fileNames.length > 0) {\n\t\t\tfor (const name of fileNames) {\n\t\t\t\tconst file = workingDirectory.navigateToFile(name);\n\t\t\t\tif (!file) {\n\t\t\t\t\tShell.writeError(stderr, this.name, `${name}: No such file`);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n \n\t\t\t\tconst text = await file.read();\n\t\t\t\tif (text != null)\n\t\t\t\t\tsearch(text, name);\n\t\t\t}\n\t\t\treturn EXIT_CODE.success;\n\t\t}\n\n\t\treturn Shell.readInput(\"\", stdin, (data) => {\n\t\t\tsearch(data);\n\t\t\treturn EXIT_CODE.success;\n\t\t});\n\t});"],"names":["grep","Command","args","stdout","stderr","stdin","workingDirectory","options","Shell","pattern","fileNames","regex","search","text","origin","line","index","match","prefix","name","file","EXIT_CODE","data"],"mappings":";AAIO,MAAMA,IAAO,IAAIC,EAAA,EACtB,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AAAA,EACP,aAAa;AAAA,EACb,SAAS;AAAA,IACR,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,EAAA;AAER,CAAC,EACA,UAAU,EAAE,OAAO,KAAK,MAAM,cAAA,CAAe,EAC7C,UAAU,EAAE,OAAO,KAAK,MAAM,gBAAgB,EAC9C,UAAU,EAAE,OAAO,KAAK,MAAM,cAAA,CAAe,EAC7C,WAAW,eAA8BC,GAAM,EAAE,QAAAC,GAAQ,QAAAC,GAAQ,OAAAC,GAAO,kBAAAC,GAAkB,SAAAC,KAAW;AACrG,MAAI,CAACL,EAAK;AACT,WAAOM,EAAM,WAAWJ,GAAQ,KAAK,MAAM,qBAAqB;AAEjE,QAAM,CAACK,GAAS,GAAGC,CAAS,IAAIR,GAC1BS,IAAQ,IAAI,OAAOF,GAASF,EAAQ,SAAS,GAAG,IAAI,MAAM,EAAE,GAE5DK,IAAS,CAACC,GAAcC,MAAoB;AACjD,IAAAD,EAAK,MAAM;AAAA,CAAI,EAAE,QAAQ,CAACE,GAAMC,MAAU;AACzC,YAAMC,IAAQN,EAAM,KAAKI,CAAI;AAG7B,UAFoBR,EAAQ,SAAS,GAAG,IAAI,CAACU,IAAQA,GAEpC;AAChB,YAAIC,IAAS;AACb,QAAIJ,KAAUJ,EAAU,SAAS,MAAGQ,KAAU,GAAGJ,CAAM,MACnDP,EAAQ,SAAS,GAAG,MAAGW,KAAU,GAAGF,IAAQ,CAAC,MACjDb,EAAO,MAAMe,IAASH,CAAI;AAAA,MAC3B;AAAA,IACD,CAAC;AAAA,EACF;AAEA,MAAIL,EAAU,SAAS,GAAG;AACzB,eAAWS,KAAQT,GAAW;AAC7B,YAAMU,IAAOd,EAAiB,eAAea,CAAI;AACjD,UAAI,CAACC,GAAM;AACV,QAAAZ,EAAM,WAAWJ,GAAQ,KAAK,MAAM,GAAGe,CAAI,gBAAgB;AAC3D;AAAA,MACD;AAEA,YAAMN,IAAO,MAAMO,EAAK,KAAA;AACxB,MAAIP,KAAQ,QACXD,EAAOC,GAAMM,CAAI;AAAA,IACnB;AACA,WAAOE,EAAU;AAAA,EAClB;AAEA,SAAOb,EAAM,UAAU,IAAIH,GAAO,CAACiB,OAClCV,EAAOU,CAAI,GACJD,EAAU,QACjB;AACF,CAAC;"}
@@ -1,19 +0,0 @@
1
- import { ANSI as o } from "@prozilla-os/shared";
2
- import { Command as p, CommandsManager as u, EXIT_CODE as f, Shell as i } from "../main.js";
3
- const $ = new p().setExecute(function(t, { stdout: a, stderr: m }) {
4
- if (t.length === 0) {
5
- const s = u.COMMANDS.map((e) => e.manual?.purpose ? `${e.name} - ${o.fg.green}${o.decoration.dim}${e.manual.purpose}${o.reset}` : e.name).sort().join(`
6
- `);
7
- return a.write(s), f.success;
8
- }
9
- const n = t[0].toLowerCase(), r = u.find(n);
10
- if (!r)
11
- return i.writeError(m, this.name, `${n}: Command not found`);
12
- if (!r.manual?.purpose)
13
- return i.writeError(m, this.name, `${n}: No manual found`);
14
- a.write(r.manual.purpose);
15
- });
16
- export {
17
- $ as help
18
- };
19
- //# sourceMappingURL=help-Drx0UDCY.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"help-Drx0UDCY.js","sources":["../../src/features/shell/commands/help.ts"],"sourcesContent":["import { ANSI } from \"@prozilla-os/shared\";\nimport { Shell } from \"../shell\";\nimport { Command } from \"../command\";\nimport { CommandsManager } from \"../commands\";\nimport { EXIT_CODE } from \"../../../constants\";\n\nexport const help = new Command()\n\t.setExecute(function(this: Command, args: string[], { stdout, stderr }) {\n\t\tif (args.length === 0) {\n\t\t\tconst output = 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\n\t\t\tstdout.write(output);\n\t\t\treturn EXIT_CODE.success;\n\t\t}\n\n\t\tconst commandName = args[0].toLowerCase();\n\t\tconst command = CommandsManager.find(commandName);\n\n\t\tif (!command) {\n\t\t\treturn Shell.writeError(stderr, this.name, `${commandName}: Command not found`);\n\t\t}\n\n\t\tif (!command.manual?.purpose) {\n\t\t\treturn Shell.writeError(stderr, this.name, `${commandName}: No manual found`);\n\t\t}\n\n\t\tstdout.write(command.manual.purpose);\n\t});"],"names":["help","Command","args","stdout","stderr","output","CommandsManager","command","ANSI","EXIT_CODE","commandName","Shell"],"mappings":";;AAMO,MAAMA,IAAO,IAAIC,EAAA,EACtB,WAAW,SAAwBC,GAAgB,EAAE,QAAAC,GAAQ,QAAAC,KAAU;AACvE,MAAIF,EAAK,WAAW,GAAG;AACtB,UAAMG,IAASC,EAAgB,SAAS,IAAI,CAACC,MACxCA,EAAQ,QAAQ,UACZ,GAAGA,EAAQ,IAAI,MAAMC,EAAK,GAAG,KAAK,GAAGA,EAAK,WAAW,GAAG,GAAGD,EAAQ,OAAO,OAAO,GAAGC,EAAK,KAAK,KAE9FD,EAAQ,IAEhB,EAAE,OAAO,KAAK;AAAA,CAAI;AAEnB,WAAAJ,EAAO,MAAME,CAAM,GACZI,EAAU;AAAA,EAClB;AAEA,QAAMC,IAAcR,EAAK,CAAC,EAAE,YAAA,GACtBK,IAAUD,EAAgB,KAAKI,CAAW;AAEhD,MAAI,CAACH;AACJ,WAAOI,EAAM,WAAWP,GAAQ,KAAK,MAAM,GAAGM,CAAW,qBAAqB;AAG/E,MAAI,CAACH,EAAQ,QAAQ;AACpB,WAAOI,EAAM,WAAWP,GAAQ,KAAK,MAAM,GAAGM,CAAW,mBAAmB;AAG7E,EAAAP,EAAO,MAAMI,EAAQ,OAAO,OAAO;AACpC,CAAC;"}
@@ -1,17 +0,0 @@
1
- import { Command as u, EXIT_CODE as e } from "../main.js";
2
- const m = new u().setManual({
3
- purpose: "Display the command history list with line numbers",
4
- usage: "history",
5
- description: "Display the list of commands typed since the shell session started."
6
- }).setExecute(function(a, { stdout: n, shell: i }) {
7
- const s = i.state.history.filter(({ isCommand: t }) => t);
8
- if (s.length === 0)
9
- return e.success;
10
- const r = s.map((t, o) => `${(o + 1).toString().padStart(5, " ")} ${t.value}`).join(`
11
- `);
12
- return n.write(r), e.success;
13
- });
14
- export {
15
- m as history
16
- };
17
- //# sourceMappingURL=history-BEJhnsrb.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"history-BEJhnsrb.js","sources":["../../src/features/shell/commands/history.ts"],"sourcesContent":["import { Command } from \"../command\";\nimport { EXIT_CODE } from \"../../../constants\";\n\nexport const history = new Command()\n\t.setManual({\n\t\tpurpose: \"Display the command history list with line numbers\",\n\t\tusage: \"history\",\n\t\tdescription: \"Display the list of commands typed since the shell session started.\",\n\t})\n\t.setExecute(function(this: Command, _args, { stdout, shell }) {\n\t\tconst inputHistory = shell.state.history.filter(({ isCommand }) => isCommand);\n\n\t\tif (inputHistory.length === 0) \n\t\t\treturn EXIT_CODE.success;\n\n\t\tconst output = inputHistory\n\t\t\t.map((entry, index) => {\n\t\t\t\tconst lineNumber = (index + 1).toString().padStart(5, \" \");\n\t\t\t\treturn `${lineNumber} ${entry.value}`;\n\t\t\t})\n\t\t\t.join(\"\\n\");\n\n\t\tstdout.write(output);\n\n\t\treturn EXIT_CODE.success;\n\t});"],"names":["history","Command","_args","stdout","shell","inputHistory","isCommand","EXIT_CODE","output","entry","index"],"mappings":";AAGO,MAAMA,IAAU,IAAIC,EAAA,EACzB,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AAAA,EACP,aAAa;AACd,CAAC,EACA,WAAW,SAAwBC,GAAO,EAAE,QAAAC,GAAQ,OAAAC,KAAS;AAC7D,QAAMC,IAAeD,EAAM,MAAM,QAAQ,OAAO,CAAC,EAAE,WAAAE,EAAA,MAAgBA,CAAS;AAE5E,MAAID,EAAa,WAAW;AAC3B,WAAOE,EAAU;AAElB,QAAMC,IAASH,EACb,IAAI,CAACI,GAAOC,MAEL,IADaA,IAAQ,GAAG,WAAW,SAAS,GAAG,GAAG,CACrC,KAAKD,EAAM,KAAK,EACpC,EACA,KAAK;AAAA,CAAI;AAEX,SAAAN,EAAO,MAAMK,CAAM,GAEZD,EAAU;AAClB,CAAC;"}
@@ -1,10 +0,0 @@
1
- import { Command as o } from "../main.js";
2
- const a = new o().setManual({
3
- purpose: "Display the hostname"
4
- }).setExecute(function(n, { hostname: e, stdout: t }) {
5
- t.write(e);
6
- });
7
- export {
8
- a as hostname
9
- };
10
- //# sourceMappingURL=hostname-D8sxyWIy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hostname-D8sxyWIy.js","sources":["../../src/features/shell/commands/hostname.ts"],"sourcesContent":["import { Command } from \"../command\";\n\nexport const hostname = new Command()\n\t.setManual({\n\t\tpurpose: \"Display the hostname\",\n\t})\n\t.setExecute(function(_args, { hostname, stdout }) {\n\t\tstdout.write(hostname);\n\t});"],"names":["hostname","Command","_args","stdout"],"mappings":";AAEO,MAAMA,IAAW,IAAIC,EAAA,EAC1B,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,SAASC,GAAO,EAAE,UAAAF,GAAU,QAAAG,KAAU;AACjD,EAAAA,EAAO,MAAMH,CAAQ;AACtB,CAAC;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"lolcat-Dyjbg15t.js","sources":["../../src/features/shell/commands/lolcat.ts"],"sourcesContent":["import { ANSI, parseOptionalFloat } from \"@prozilla-os/shared\";\nimport { Command } from \"../command\";\nimport { Stream } from \"../stream\";\nimport { EXIT_CODE } from \"../../../constants\";\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\tusage: \"lolcat [ -p spread ] [ -F freq ] [ -S seed ]\",\n\t\toptions: {\n\t\t\t\"-p spread\": \"Rainbow spread (default: 3.0)\",\n\t\t\t\"-F freq\": \"Rainbow frequency (default: 0.1)\",\n\t\t\t\"-S seed\": \"Rainbow seed (default: 0)\",\n\t\t},\n\t})\n\t.addOption({\n\t\tshort: \"p\",\n\t\tlong: \"spread\",\n\t\tisInput: true,\n\t})\n\t.addOption({\n\t\tshort: \"F\",\n\t\tlong: \"freq\",\n\t\tisInput: true,\n\t})\n\t.addOption({\n\t\tshort: \"S\",\n\t\tlong: \"seed\",\n\t\tisInput: true,\n\t})\n\t.setExecute(function(this: Command, _args, { timestamp, stdout, stdin, inputs }) {\n\t\tconst spread = parseOptionalFloat(inputs.p, 3.0);\n\t\tconst freq = parseOptionalFloat(inputs.F, 0.1);\n\t\tconst seed = parseOptionalFloat(inputs.S);\n\n\t\tlet lineIndex = 0;\n\n\t\tconst processText = (text: string) => {\n\t\t\tlet output = \"\";\n\t\t\tlet i = 0;\n\t\t\tlet colIndex = 0;\n\t\t\tconst offset = timestamp / 1000;\n\n\t\t\twhile (i < text.length) {\n\t\t\t\tconst char = text[i];\n\n\t\t\t\tif (char === \"\\x1b\") {\n\t\t\t\t\tconst remaining = text.substring(i);\n\t\t\t\t\t// eslint-disable-next-line no-control-regex\n\t\t\t\t\tconst match = remaining.match(/^\\u001b\\[[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/);\n\t\t\t\t\t\n\t\t\t\t\tif (match) {\n\t\t\t\t\t\tconst seq = match[0];\n\t\t\t\t\t\toutput += seq;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (seq === ANSI.screen.home || seq === ANSI.screen.clear) {\n\t\t\t\t\t\t\tlineIndex = 0;\n\t\t\t\t\t\t\tcolIndex = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\ti += seq.length;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (char === \"\\n\") {\n\t\t\t\t\toutput += \"\\n\";\n\t\t\t\t\tlineIndex++;\n\t\t\t\t\tcolIndex = 0;\n\t\t\t\t} else if (char === \"\\r\" || char === \"\\t\" || char === \" \") {\n\t\t\t\t\toutput += char;\n\t\t\t\t\tcolIndex++;\n\t\t\t\t} else {\n\t\t\t\t\tconst iVal = freq * (seed + lineIndex + colIndex / spread + offset);\n\t\t\t\t\tconst rainbowIndex = Math.floor(Math.abs(iVal) * RAINBOW.length);\n\t\t\t\t\tconst color = RAINBOW[rainbowIndex % RAINBOW.length];\n\n\t\t\t\t\toutput += color + char + ANSI.reset;\n\t\t\t\t\tcolIndex++;\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t}\n\n\t\t\tstdout.write(output);\n\t\t};\n\n\t\tstdin.on(Stream.DATA_EVENT, (data) => {\n\t\t\tprocessText(data);\n\t\t});\n\n\t\treturn stdin.wait(EXIT_CODE.success);\n\t});"],"names":["RAINBOW","ANSI","lolcat","Command","_args","timestamp","stdout","stdin","inputs","spread","parseOptionalFloat","freq","seed","lineIndex","processText","text","output","i","colIndex","offset","char","match","seq","iVal","rainbowIndex","color","Stream","data","EXIT_CODE"],"mappings":";;AAKA,MAAMA,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,EAAA,EACxB,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AAAA,EACP,SAAS;AAAA,IACR,aAAa;AAAA,IACb,WAAW;AAAA,IACX,WAAW;AAAA,EAAA;AAEb,CAAC,EACA,UAAU;AAAA,EACV,OAAO;AAAA,EACP,MAAM;AAAA,EACN,SAAS;AACV,CAAC,EACA,UAAU;AAAA,EACV,OAAO;AAAA,EACP,MAAM;AAAA,EACN,SAAS;AACV,CAAC,EACA,UAAU;AAAA,EACV,OAAO;AAAA,EACP,MAAM;AAAA,EACN,SAAS;AACV,CAAC,EACA,WAAW,SAAwBC,GAAO,EAAE,WAAAC,GAAW,QAAAC,GAAQ,OAAAC,GAAO,QAAAC,KAAU;AAChF,QAAMC,IAASC,EAAmBF,EAAO,GAAG,CAAG,GACzCG,IAAOD,EAAmBF,EAAO,GAAG,GAAG,GACvCI,IAAOF,EAAmBF,EAAO,CAAC;AAExC,MAAIK,IAAY;AAEhB,QAAMC,IAAc,CAACC,MAAiB;AACrC,QAAIC,IAAS,IACTC,IAAI,GACJC,IAAW;AACf,UAAMC,IAASd,IAAY;AAE3B,WAAOY,IAAIF,EAAK,UAAQ;AACvB,YAAMK,IAAOL,EAAKE,CAAC;AAEnB,UAAIG,MAAS,QAAQ;AAGpB,cAAMC,IAFYN,EAAK,UAAUE,CAAC,EAEV,MAAM,sEAAsE;AAEpG,YAAII,GAAO;AACV,gBAAMC,IAAMD,EAAM,CAAC;AACnB,UAAAL,KAAUM,IAENA,MAAQrB,EAAK,OAAO,QAAQqB,MAAQrB,EAAK,OAAO,WACnDY,IAAY,GACZK,IAAW,IAGZD,KAAKK,EAAI;AACT;AAAA,QACD;AAAA,MACD;AAEA,UAAIF,MAAS;AAAA;AACZ,QAAAJ,KAAU;AAAA,GACVH,KACAK,IAAW;AAAA,eACDE,MAAS,QAAQA,MAAS,OAAQA,MAAS;AACrD,QAAAJ,KAAUI,GACVF;AAAA,WACM;AACN,cAAMK,IAAOZ,KAAQC,IAAOC,IAAYK,IAAWT,IAASU,IACtDK,IAAe,KAAK,MAAM,KAAK,IAAID,CAAI,IAAIvB,EAAQ,MAAM,GACzDyB,IAAQzB,EAAQwB,IAAexB,EAAQ,MAAM;AAEnD,QAAAgB,KAAUS,IAAQL,IAAOnB,EAAK,OAC9BiB;AAAA,MACD;AACA,MAAAD;AAAA,IACD;AAEA,IAAAX,EAAO,MAAMU,CAAM;AAAA,EACpB;AAEA,SAAAT,EAAM,GAAGmB,EAAO,YAAY,CAACC,MAAS;AACrC,IAAAb,EAAYa,CAAI;AAAA,EACjB,CAAC,GAEMpB,EAAM,KAAKqB,EAAU,OAAO;AACpC,CAAC;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ls-DnmR50y0.js","sources":["../../src/features/shell/commands/ls.ts"],"sourcesContent":["import { VirtualFolder } from \"../../virtual-drive\";\nimport { Shell } from \"../shell\";\nimport { Command } 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, { workingDirectory, stdout, stderr }) {\n\t\tlet directory: VirtualFolder | null = workingDirectory;\n\t\n\t\tif (args.length) {\n\t\t\tdirectory = workingDirectory.navigateToFolder(args[0]);\n\t\t}\n\t\n\t\tif (!directory)\n\t\t\treturn Shell.writeError(stderr, this.name, `Cannot access '${args[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\tstdout.write(contents.sort().join(\" \"));\n\t\t}\n\t});"],"names":["ls","Command","args","workingDirectory","stdout","stderr","directory","Shell","folderNames","folder","ANSI","fileNames","file","contents"],"mappings":";;AAKO,MAAMA,IAAK,IAAIC,EAAA,EACpB,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AAAA,EACP,aAAa;AACd,CAAC,EACA,WAAW,SAAwBC,GAAM,EAAE,kBAAAC,GAAkB,QAAAC,GAAQ,QAAAC,KAAU;AAC/E,MAAIC,IAAkCH;AAMtC,MAJID,EAAK,WACRI,IAAYH,EAAiB,iBAAiBD,EAAK,CAAC,CAAC,IAGlD,CAACI;AACJ,WAAOC,EAAM,WAAWF,GAAQ,KAAK,MAAM,kBAAkBH,EAAK,CAAC,CAAC,8BAA8B;AAEnG,QAAMM,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,EAAIE,EAAS,SAAS,KACrBT,EAAO,MAAMS,EAAS,KAAA,EAAO,KAAK,IAAI,CAAC;AAEzC,CAAC;"}
@@ -1,60 +0,0 @@
1
- import { ANSI as h, Ansi as r } from "@prozilla-os/shared";
2
- import { Command as N, CommandsManager as g, Shell as w } from "../main.js";
3
- const O = 5, C = new N().setRequireArgs(!0).setManual({
4
- purpose: "Show system reference manuals",
5
- usage: `man [options] page
6
- man -k [options] regexp`,
7
- description: `Each page arguments given to man is normally the name of a command.
8
- The manual page associated with this command is then found and displayed.`,
9
- options: {
10
- "-k": "Search for manual page using regexp"
11
- }
12
- }).addOption({
13
- short: "k",
14
- long: "apropos"
15
- }).setExecute(function(u, { options: S, stdout: l, stderr: c }) {
16
- if (S.includes("k")) {
17
- const a = g.search(u[0].toLowerCase()).map((n) => n.manual?.purpose ? `${n.name} - ${n.manual.purpose}` : n.name).sort().join(`
18
- `);
19
- l.write(a + `
20
- `);
21
- return;
22
- }
23
- const s = u[0].toLowerCase(), p = g.find(s);
24
- if (!p)
25
- return w.writeError(c, this.name, `${s}: Command not found`);
26
- const o = p.manual;
27
- if (!o)
28
- return w.writeError(c, this.name, `${s}: No manual found`);
29
- const i = (e) => e.split(`
30
- `).map((n) => " ".repeat(O) + n).join(`
31
- `), t = [["NAME"]];
32
- o.purpose ? t[0].push(i(`${s} - ${h.decoration.dim}${r.yellow(o.purpose)}`)) : t[0].push(i(s)), o.usage && t.push([
33
- "SYNOPSIS",
34
- i(o.usage)
35
- ]), o.description && t.push([
36
- "DESCRIPTION",
37
- i(o.description)
38
- ]), o.options && t.push([
39
- "OPTIONS",
40
- i(Object.entries(o.options).map(([e, a]) => {
41
- let n = e.split(" ");
42
- const d = n[0].slice(1);
43
- n = n.slice(1);
44
- let m = "-" + d;
45
- const f = p.options.find((y) => y.short == d);
46
- return f !== void 0 && (m += ", --" + f.long), n.length && (m += " " + r.dim(n.join(" "))), `${m} ${h.decoration.dim}${r.yellow(String(a))}`;
47
- }).join(`
48
- `))
49
- ]);
50
- const $ = t.map((e) => (e[0] = r.yellow(e[0]), e.join(`
51
- `))).join(`
52
-
53
- `);
54
- l.write($ + `
55
- `);
56
- });
57
- export {
58
- C as man
59
- };
60
- //# sourceMappingURL=man-7W6T7lda.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"man-7W6T7lda.js","sources":["../../src/features/shell/commands/man.ts"],"sourcesContent":["import { Ansi, ANSI } from \"@prozilla-os/shared\";\nimport { Shell } from \"../shell\";\nimport { Command } from \"../command\";\nimport { CommandsManager } from \"../commands\";\n\nconst MARGIN = 5;\n\nexport const man = new Command()\n\t.setRequireArgs(true)\n\t.setManual({\n\t\tpurpose: \"Show system reference manuals\",\n\t\tusage: \"man [options] page\\n\"\n\t\t\t+ \"man -k [options] regexp\",\n\t\tdescription: \"Each page arguments given to man is normally the name of a command.\\n\"\n\t\t\t+ \"The manual page associated with this command is then found and displayed.\",\n\t\toptions: {\n\t\t\t\"-k\": \"Search for manual page using regexp\",\n\t\t},\n\t})\n\t.addOption({\n\t\tshort: \"k\",\n\t\tlong: \"apropos\",\n\t})\n\t.setExecute(function(this: Command, args, { options, stdout, stderr }) {\n\t\t// Search function\n\t\tif (options.includes(\"k\")) {\n\t\t\tconst commands = CommandsManager.search(args[0].toLowerCase());\n\t\t\tconst output = commands.map((command) => {\n\t\t\t\tif (command.manual?.purpose) {\n\t\t\t\t\treturn `${command.name} - ${command.manual.purpose}`;\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\n\t\t\tstdout.write(output + \"\\n\");\n\t\t\treturn;\n\t\t}\n\n\t\tconst commandName = args[0].toLowerCase();\n\t\tconst command = CommandsManager.find(commandName);\n\n\t\tif (!command)\n\t\t\treturn Shell.writeError(stderr, this.name, `${commandName}: Command not found`);\n\n\t\tconst manual = command.manual;\n\n\t\tif (!manual)\n\t\t\treturn Shell.writeError(stderr, this.name, `${commandName}: No manual found`);\n\n\t\tconst formatText = (text: string) => {\n\t\t\tconst lines = text.split(\"\\n\").map((line) => \" \".repeat(MARGIN) + line);\n\t\t\treturn lines.join(\"\\n\");\n\t\t};\n\n\t\tconst sections = [[\"NAME\"]];\n\n\t\tif (manual.purpose) {\n\t\t\tsections[0].push(formatText(`${commandName} - ${ANSI.decoration.dim}${Ansi.yellow(manual.purpose)}`));\n\t\t} else {\n\t\t\tsections[0].push(formatText(commandName));\n\t\t}\n\n\t\tif (manual.usage) {\n\t\t\tsections.push([\n\t\t\t\t\"SYNOPSIS\",\n\t\t\t\tformatText(manual.usage),\n\t\t\t]);\n\t\t}\n\t\t\n\t\tif (manual.description) {\n\t\t\tsections.push([\n\t\t\t\t\"DESCRIPTION\",\n\t\t\t\tformatText(manual.description),\n\t\t\t]);\n\t\t}\n\n\t\tif (manual.options) {\n\t\t\tsections.push([\n\t\t\t\t\"OPTIONS\",\n\t\t\t\tformatText(Object.entries(manual.options).map(([key, value]) => {\n\t\t\t\t\tlet rawOptionSyntax = key.split(\" \");\n\t\t\t\t\tconst shortOption = rawOptionSyntax[0].slice(1);\n\t\t\t\t\trawOptionSyntax = rawOptionSyntax.slice(1);\n\n\t\t\t\t\tlet optionSyntax = \"-\" + shortOption;\n\t\t\t\t\tconst option = command.options.find((option) => option.short == shortOption);\n\t\t\t\t\tif (option !== undefined) {\n\t\t\t\t\t\toptionSyntax += \", --\" + option.long;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (rawOptionSyntax.length) {\n\t\t\t\t\t\toptionSyntax += \" \" + Ansi.dim(rawOptionSyntax.join(\" \"));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\treturn `${optionSyntax} ${ANSI.decoration.dim}${Ansi.yellow(String(value))}`;\n\t\t\t\t}).join(\"\\n\")),\n\t\t\t]);\n\t\t}\n\n\t\tconst output = sections.map((section) => {\n\t\t\tsection[0] = Ansi.yellow(section[0]);\n\t\t\treturn section.join(\"\\n\");\n\t\t}).join(\"\\n\\n\");\n\n\t\tstdout.write(output + \"\\n\");\n\t});"],"names":["MARGIN","man","Command","args","options","stdout","stderr","output","CommandsManager","command","commandName","Shell","manual","formatText","text","line","sections","ANSI","Ansi","key","value","rawOptionSyntax","shortOption","optionSyntax","option","section"],"mappings":";;AAKA,MAAMA,IAAS,GAEFC,IAAM,IAAIC,EAAA,EACrB,eAAe,EAAI,EACnB,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AAAA;AAAA,EAEP,aAAa;AAAA;AAAA,EAEb,SAAS;AAAA,IACR,MAAM;AAAA,EAAA;AAER,CAAC,EACA,UAAU;AAAA,EACV,OAAO;AAAA,EACP,MAAM;AACP,CAAC,EACA,WAAW,SAAwBC,GAAM,EAAE,SAAAC,GAAS,QAAAC,GAAQ,QAAAC,KAAU;AAEtE,MAAIF,EAAQ,SAAS,GAAG,GAAG;AAE1B,UAAMG,IADWC,EAAgB,OAAOL,EAAK,CAAC,EAAE,aAAa,EACrC,IAAI,CAACM,MACxBA,EAAQ,QAAQ,UACZ,GAAGA,EAAQ,IAAI,MAAMA,EAAQ,OAAO,OAAO,KAE3CA,EAAQ,IAEhB,EAAE,OAAO,KAAK;AAAA,CAAI;AAEnB,IAAAJ,EAAO,MAAME,IAAS;AAAA,CAAI;AAC1B;AAAA,EACD;AAEA,QAAMG,IAAcP,EAAK,CAAC,EAAE,YAAA,GACtBM,IAAUD,EAAgB,KAAKE,CAAW;AAEhD,MAAI,CAACD;AACJ,WAAOE,EAAM,WAAWL,GAAQ,KAAK,MAAM,GAAGI,CAAW,qBAAqB;AAE/E,QAAME,IAASH,EAAQ;AAEvB,MAAI,CAACG;AACJ,WAAOD,EAAM,WAAWL,GAAQ,KAAK,MAAM,GAAGI,CAAW,mBAAmB;AAE7E,QAAMG,IAAa,CAACC,MACLA,EAAK,MAAM;AAAA,CAAI,EAAE,IAAI,CAACC,MAAS,IAAI,OAAOf,CAAM,IAAIe,CAAI,EACzD,KAAK;AAAA,CAAI,GAGjBC,IAAW,CAAC,CAAC,MAAM,CAAC;AAE1B,EAAIJ,EAAO,UACVI,EAAS,CAAC,EAAE,KAAKH,EAAW,GAAGH,CAAW,MAAMO,EAAK,WAAW,GAAG,GAAGC,EAAK,OAAON,EAAO,OAAO,CAAC,EAAE,CAAC,IAEpGI,EAAS,CAAC,EAAE,KAAKH,EAAWH,CAAW,CAAC,GAGrCE,EAAO,SACVI,EAAS,KAAK;AAAA,IACb;AAAA,IACAH,EAAWD,EAAO,KAAK;AAAA,EAAA,CACvB,GAGEA,EAAO,eACVI,EAAS,KAAK;AAAA,IACb;AAAA,IACAH,EAAWD,EAAO,WAAW;AAAA,EAAA,CAC7B,GAGEA,EAAO,WACVI,EAAS,KAAK;AAAA,IACb;AAAA,IACAH,EAAW,OAAO,QAAQD,EAAO,OAAO,EAAE,IAAI,CAAC,CAACO,GAAKC,CAAK,MAAM;AAC/D,UAAIC,IAAkBF,EAAI,MAAM,GAAG;AACnC,YAAMG,IAAcD,EAAgB,CAAC,EAAE,MAAM,CAAC;AAC9C,MAAAA,IAAkBA,EAAgB,MAAM,CAAC;AAEzC,UAAIE,IAAe,MAAMD;AACzB,YAAME,IAASf,EAAQ,QAAQ,KAAK,CAACe,MAAWA,EAAO,SAASF,CAAW;AAC3E,aAAIE,MAAW,WACdD,KAAgB,SAASC,EAAO,OAG7BH,EAAgB,WACnBE,KAAgB,MAAML,EAAK,IAAIG,EAAgB,KAAK,GAAG,CAAC,IAGlD,GAAGE,CAAY,IAAIN,EAAK,WAAW,GAAG,GAAGC,EAAK,OAAO,OAAOE,CAAK,CAAC,CAAC;AAAA,IAC3E,CAAC,EAAE,KAAK;AAAA,CAAI,CAAC;AAAA,EAAA,CACb;AAGF,QAAMb,IAASS,EAAS,IAAI,CAACS,OAC5BA,EAAQ,CAAC,IAAIP,EAAK,OAAOO,EAAQ,CAAC,CAAC,GAC5BA,EAAQ,KAAK;AAAA,CAAI,EACxB,EAAE,KAAK;AAAA;AAAA,CAAM;AAEd,EAAApB,EAAO,MAAME,IAAS;AAAA,CAAI;AAC3B,CAAC;"}
@@ -1,40 +0,0 @@
1
- import { ANSI as n } from "@prozilla-os/shared";
2
- import { Command as C, Settings as A, ANSI_LOGO_COLOR as I, ANSI_ASCII_LOGO as O } from "../main.js";
3
- import { Theme as s } from "@prozilla-os/skins";
4
- const _ = new C().setManual({
5
- purpose: "Fetch system information"
6
- }).setExecute(async function(x, { username: m, hostname: l, app: w, systemManager: g, settingsManager: S, stdout: d }) {
7
- const f = O.split(`
8
- `), c = m.length + l.length + 1, a = (await S.getSettings(A.THEME).get("theme")).value;
9
- let h = s[s.Dark];
10
- a != null && parseInt(a) && (h = s[parseInt(a)]);
11
- const r = navigator.userAgent;
12
- let o;
13
- r.match(/Firefox\//) ? o = "Mozilla Firefox" : r.match(/Edg\//) ? o = "Microsoft Edge" : r.match(/Chrome\//) ? o = "Google Chrome" : r.match(/Safari\//) ? o = "Apple Safari" : o = "Unknown";
14
- const e = (t, i) => n.fg.cyan + t.toUpperCase() + n.reset + ": " + i, p = [
15
- `${n.fg.cyan + m + n.reset}@${n.fg.cyan + l + n.reset}`,
16
- "-".repeat(c),
17
- e("os", g.systemName),
18
- e("uptime", g.getUptime(2)),
19
- e("resolution", window.innerWidth + "x" + window.innerHeight),
20
- e("theme", h),
21
- e("icons", "Font Awesome"),
22
- e("terminal", w?.name ?? "Unknown"),
23
- e("browser", o),
24
- e("platform", navigator.platform),
25
- e("language", navigator.language),
26
- "",
27
- Object.values(n.fg).map((t) => t + "███").join("") + n.reset
28
- ], u = [];
29
- for (let t = 1; t < f.length; t++) {
30
- let i = `${I + f[t] + n.reset} `;
31
- t <= p.length ? i += p[t - 1] : i += " ".repeat(c), u.push(i);
32
- }
33
- d.write(u.join(`
34
- `) + `
35
- `);
36
- });
37
- export {
38
- _ as neofetch
39
- };
40
- //# sourceMappingURL=neofetch--vHMIS9v.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"neofetch--vHMIS9v.js","sources":["../../src/features/shell/commands/neofetch.ts"],"sourcesContent":["import { ANSI } from \"@prozilla-os/shared\";\nimport { ANSI_ASCII_LOGO, ANSI_LOGO_COLOR } from \"../../../constants/shell.const\";\nimport { Command } from \"../command\";\nimport { Theme } from \"@prozilla-os/skins\";\nimport { Settings } from \"../../settings/settings\";\n\nexport const neofetch = new Command()\n\t.setManual({\n\t\tpurpose: \"Fetch system information\",\n\t})\n\t.setExecute(async function(_arguments, { username, hostname, app, systemManager, settingsManager, stdout }) {\n\t\tconst leftColumn = ANSI_ASCII_LOGO.split(\"\\n\");\n\t\tconst rightColumnWidth = username.length + hostname.length + 1;\n\n\t\tconst themeSetting = await settingsManager.getSettings(Settings.THEME).get(\"theme\");\n\t\tconst themeIndex = themeSetting.value;\n\t\t\n\t\tlet theme = Theme[Theme.Dark];\n\t\tif (themeIndex != null && parseInt(themeIndex)) {\n\t\t\ttheme = Theme[parseInt(themeIndex)];\n\t\t}\n\n\t\tconst userAgent = navigator.userAgent;\n\n\t\t// Check for the browser name using regular expressions\n\t\tlet browserName;\n\t\tif (userAgent.match(/Firefox\\//)) {\n\t\t\tbrowserName = \"Mozilla Firefox\";\n\t\t} else if (userAgent.match(/Edg\\//)) {\n\t\t\tbrowserName = \"Microsoft Edge\";\n\t\t} else if (userAgent.match(/Chrome\\//)) {\n\t\t\tbrowserName = \"Google Chrome\";\n\t\t} else if (userAgent.match(/Safari\\//)) {\n\t\t\tbrowserName = \"Apple Safari\";\n\t\t} else {\n\t\t\tbrowserName = \"Unknown\";\n\t\t}\n\n\t\tconst formatLine = (label: string, text: string) => ANSI.fg.cyan + label.toUpperCase() + ANSI.reset + \": \" + text;\n\n\t\tconst rightColumn = [\n\t\t\t`${ANSI.fg.cyan + username + ANSI.reset}@${ANSI.fg.cyan + hostname + ANSI.reset}`,\n\t\t\t\"-\".repeat(rightColumnWidth),\n\t\t\tformatLine(\"os\", systemManager.systemName),\n\t\t\tformatLine(\"uptime\", systemManager.getUptime(2)),\n\t\t\tformatLine(\"resolution\", window.innerWidth + \"x\" + window.innerHeight),\n\t\t\tformatLine(\"theme\", theme),\n\t\t\tformatLine(\"icons\", \"Font Awesome\"),\n\t\t\tformatLine(\"terminal\", app?.name ?? \"Unknown\"),\n\t\t\tformatLine(\"browser\", browserName),\n\t\t\tformatLine(\"platform\", navigator.platform),\n\t\t\tformatLine(\"language\", navigator.language),\n\t\t\t\"\",\n\t\t\tObject.values(ANSI.fg).map((colorCode) => colorCode + \"███\").join(\"\") + ANSI.reset,\n\t\t];\n\n\t\tconst combined = [];\n\t\tfor (let i = 1; i < leftColumn.length; i++) {\n\t\t\tlet line = `${ANSI_LOGO_COLOR + leftColumn[i] + ANSI.reset} `;\n\n\t\t\tif (i <= rightColumn.length) {\n\t\t\t\tline += rightColumn[i - 1];\n\t\t\t} else {\n\t\t\t\t// This fixes a weird display bug on Safari mobile\n\t\t\t\tline += \" \".repeat(rightColumnWidth);\n\t\t\t}\n\n\t\t\tcombined.push(line);\n\t\t}\n\n\t\tstdout.write(combined.join(\"\\n\") + \"\\n\");\n\t});"],"names":["neofetch","Command","_arguments","username","hostname","app","systemManager","settingsManager","stdout","leftColumn","ANSI_ASCII_LOGO","rightColumnWidth","themeIndex","Settings","theme","Theme","userAgent","browserName","formatLine","label","text","ANSI","rightColumn","colorCode","combined","i","line","ANSI_LOGO_COLOR"],"mappings":";;;AAMO,MAAMA,IAAW,IAAIC,EAAA,EAC1B,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,eAAeC,GAAY,EAAE,UAAAC,GAAU,UAAAC,GAAU,KAAAC,GAAK,eAAAC,GAAe,iBAAAC,GAAiB,QAAAC,KAAU;AAC3G,QAAMC,IAAaC,EAAgB,MAAM;AAAA,CAAI,GACvCC,IAAmBR,EAAS,SAASC,EAAS,SAAS,GAGvDQ,KADe,MAAML,EAAgB,YAAYM,EAAS,KAAK,EAAE,IAAI,OAAO,GAClD;AAEhC,MAAIC,IAAQC,EAAMA,EAAM,IAAI;AAC5B,EAAIH,KAAc,QAAQ,SAASA,CAAU,MAC5CE,IAAQC,EAAM,SAASH,CAAU,CAAC;AAGnC,QAAMI,IAAY,UAAU;AAG5B,MAAIC;AACJ,EAAID,EAAU,MAAM,WAAW,IAC9BC,IAAc,oBACJD,EAAU,MAAM,OAAO,IACjCC,IAAc,mBACJD,EAAU,MAAM,UAAU,IACpCC,IAAc,kBACJD,EAAU,MAAM,UAAU,IACpCC,IAAc,iBAEdA,IAAc;AAGf,QAAMC,IAAa,CAACC,GAAeC,MAAiBC,EAAK,GAAG,OAAOF,EAAM,YAAA,IAAgBE,EAAK,QAAQ,OAAOD,GAEvGE,IAAc;AAAA,IACnB,GAAGD,EAAK,GAAG,OAAOlB,IAAWkB,EAAK,KAAK,IAAIA,EAAK,GAAG,OAAOjB,IAAWiB,EAAK,KAAK;AAAA,IAC/E,IAAI,OAAOV,CAAgB;AAAA,IAC3BO,EAAW,MAAMZ,EAAc,UAAU;AAAA,IACzCY,EAAW,UAAUZ,EAAc,UAAU,CAAC,CAAC;AAAA,IAC/CY,EAAW,cAAc,OAAO,aAAa,MAAM,OAAO,WAAW;AAAA,IACrEA,EAAW,SAASJ,CAAK;AAAA,IACzBI,EAAW,SAAS,cAAc;AAAA,IAClCA,EAAW,YAAYb,GAAK,QAAQ,SAAS;AAAA,IAC7Ca,EAAW,WAAWD,CAAW;AAAA,IACjCC,EAAW,YAAY,UAAU,QAAQ;AAAA,IACzCA,EAAW,YAAY,UAAU,QAAQ;AAAA,IACzC;AAAA,IACA,OAAO,OAAOG,EAAK,EAAE,EAAE,IAAI,CAACE,MAAcA,IAAY,KAAK,EAAE,KAAK,EAAE,IAAIF,EAAK;AAAA,EAAA,GAGxEG,IAAW,CAAA;AACjB,WAASC,IAAI,GAAGA,IAAIhB,EAAW,QAAQgB,KAAK;AAC3C,QAAIC,IAAO,GAAGC,IAAkBlB,EAAWgB,CAAC,IAAIJ,EAAK,KAAK;AAE1D,IAAII,KAAKH,EAAY,SACpBI,KAAQJ,EAAYG,IAAI,CAAC,IAGzBC,KAAQ,IAAI,OAAOf,CAAgB,GAGpCa,EAAS,KAAKE,CAAI;AAAA,EACnB;AAEA,EAAAlB,EAAO,MAAMgB,EAAS,KAAK;AAAA,CAAI,IAAI;AAAA,CAAI;AACxC,CAAC;"}
@@ -1,24 +0,0 @@
1
- import { Command as a } from "../main.js";
2
- const p = new a().setManual({
3
- purpose: "Print all or part of environment",
4
- usage: "printenv [VARIABLE]...",
5
- description: "Print the values of the specified environment VARIABLE(s). If no VARIABLE is specified, print name and value pairs for them all."
6
- }).setExecute(function(t, { stdout: r, env: o }) {
7
- const i = o.exportedVariables;
8
- if (t.length > 0) {
9
- t.forEach((n) => {
10
- const e = i[n];
11
- e !== void 0 && r.write(`${e}
12
- `);
13
- });
14
- return;
15
- }
16
- Object.entries(i).forEach(([n, e]) => {
17
- r.write(`${n}=${e}
18
- `);
19
- });
20
- });
21
- export {
22
- p as printenv
23
- };
24
- //# sourceMappingURL=printenv-6OpJKd7g.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"printenv-6OpJKd7g.js","sources":["../../src/features/shell/commands/printenv.ts"],"sourcesContent":["import { Command } from \"../command\";\n\nexport const printenv = new Command()\n\t.setManual({\n\t\tpurpose: \"Print all or part of environment\",\n\t\tusage: \"printenv [VARIABLE]...\",\n\t\tdescription: \"Print the values of the specified environment VARIABLE(s). If no VARIABLE is specified, print name and value pairs for them all.\",\n\t})\n\t.setExecute(function(this: Command, args, { stdout, env }) {\n\t\tconst exportedVars = env.exportedVariables;\n\n\t\tif (args.length > 0) {\n\t\t\targs.forEach((arg) => {\n\t\t\t\tconst value = exportedVars[arg];\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n\t\t\t\tif (value !== undefined) stdout.write(`${value}\\n`);\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\tObject.entries(exportedVars).forEach(([key, value]) => {\n\t\t\tstdout.write(`${key}=${value}\\n`);\n\t\t});\n\t});"],"names":["printenv","Command","args","stdout","env","exportedVars","arg","value","key"],"mappings":";AAEO,MAAMA,IAAW,IAAIC,EAAA,EAC1B,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AAAA,EACP,aAAa;AACd,CAAC,EACA,WAAW,SAAwBC,GAAM,EAAE,QAAAC,GAAQ,KAAAC,KAAO;AAC1D,QAAMC,IAAeD,EAAI;AAEzB,MAAIF,EAAK,SAAS,GAAG;AACpB,IAAAA,EAAK,QAAQ,CAACI,MAAQ;AACrB,YAAMC,IAAQF,EAAaC,CAAG;AAE9B,MAAIC,MAAU,UAAWJ,EAAO,MAAM,GAAGI,CAAK;AAAA,CAAI;AAAA,IACnD,CAAC;AACD;AAAA,EACD;AAEA,SAAO,QAAQF,CAAY,EAAE,QAAQ,CAAC,CAACG,GAAKD,CAAK,MAAM;AACtD,IAAAJ,EAAO,MAAM,GAAGK,CAAG,IAAID,CAAK;AAAA,CAAI;AAAA,EACjC,CAAC;AACF,CAAC;"}
@@ -1,11 +0,0 @@
1
- import { Command as r } from "../main.js";
2
- const p = new r().setManual({
3
- purpose: "Display path of the current directory"
4
- }).setExecute(function(a, { workingDirectory: t, stdout: o }) {
5
- let e = t.absolutePath;
6
- t.root && (e = "/"), o.write(e);
7
- });
8
- export {
9
- p as pwd
10
- };
11
- //# sourceMappingURL=pwd-9JYDUbov.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pwd-9JYDUbov.js","sources":["../../src/features/shell/commands/pwd.ts"],"sourcesContent":["import { Command } from \"../command\";\n\nexport const pwd = new Command()\n\t.setManual({\n\t\tpurpose: \"Display path of the current directory\",\n\t})\n\t.setExecute(function(_arguments, { workingDirectory: currentDirectory, stdout }) {\n\t\tlet path = currentDirectory.absolutePath;\n\n\t\tif (currentDirectory.root) {\n\t\t\tpath = \"/\";\n\t\t}\n\n\t\tstdout.write(path);\n\t});"],"names":["pwd","Command","_arguments","currentDirectory","stdout","path"],"mappings":";AAEO,MAAMA,IAAM,IAAIC,EAAA,EACrB,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,SAASC,GAAY,EAAE,kBAAkBC,GAAkB,QAAAC,KAAU;AAChF,MAAIC,IAAOF,EAAiB;AAE5B,EAAIA,EAAiB,SACpBE,IAAO,MAGRD,EAAO,MAAMC,CAAI;AAClB,CAAC;"}
@@ -1,10 +0,0 @@
1
- import { Command as e, CommandsManager as o } from "../main.js";
2
- const n = new e().setManual({
3
- purpose: "Reload the terminal"
4
- }).setExecute(function() {
5
- o.reload();
6
- });
7
- export {
8
- n as reload
9
- };
10
- //# sourceMappingURL=reload-CjTJVt5Z.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reload-CjTJVt5Z.js","sources":["../../src/features/shell/commands/reload.ts"],"sourcesContent":["import { Command } from \"../command\";\nimport { CommandsManager } from \"../commands\";\n\nexport const reload = new Command()\n\t.setManual({\n\t\tpurpose: \"Reload the terminal\",\n\t})\n\t.setExecute(function() {\n\t\tCommandsManager.reload();\n\t});"],"names":["reload","Command","CommandsManager"],"mappings":";AAGO,MAAMA,IAAS,IAAIC,EAAA,EACxB,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,WAAW;AACtB,EAAAC,EAAgB,OAAA;AACjB,CAAC;"}
@@ -1,12 +0,0 @@
1
- import { Command as o, Shell as s } from "../main.js";
2
- const i = new o().setManual({
3
- purpose: "Display the reverse of a text"
4
- }).setExecute(function(a, { rawLine: e, stdin: r, stdout: t }) {
5
- return s.readInput(e, r, (n) => {
6
- t.write(n.split("").reverse().join(""));
7
- });
8
- });
9
- export {
10
- i as rev
11
- };
12
- //# sourceMappingURL=rev--2pyt1P8.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rev--2pyt1P8.js","sources":["../../src/features/shell/commands/rev.ts"],"sourcesContent":["import { Command } from \"../command\";\nimport { Shell } from \"../shell\";\n\nexport const rev = new Command()\n\t.setManual({\n\t\tpurpose: \"Display the reverse of a text\",\n\t})\n\t.setExecute(function(_args, { rawLine, stdin, stdout }) {\n\t\treturn Shell.readInput(rawLine, stdin, (text) => {\n\t\t\tstdout.write(text.split(\"\").reverse().join(\"\"));\n\t\t});\n\t});"],"names":["rev","Command","_args","rawLine","stdin","stdout","Shell","text"],"mappings":";AAGO,MAAMA,IAAM,IAAIC,EAAA,EACrB,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,SAASC,GAAO,EAAE,SAAAC,GAAS,OAAAC,GAAO,QAAAC,KAAU;AACvD,SAAOC,EAAM,UAAUH,GAASC,GAAO,CAACG,MAAS;AAChD,IAAAF,EAAO,MAAME,EAAK,MAAM,EAAE,EAAE,QAAA,EAAU,KAAK,EAAE,CAAC;AAAA,EAC/C,CAAC;AACF,CAAC;"}