@prozilla-os/terminal 1.1.9 → 1.1.11

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 (42) hide show
  1. package/dist/chunks/{cat-DzV_0CUU.js → cat-Ba26AkHD.js} +2 -2
  2. package/dist/chunks/{cat-DzV_0CUU.js.map → cat-Ba26AkHD.js.map} +1 -1
  3. package/dist/chunks/{cd-ByDAWGKF.js → cd-JZ3C2vu4.js} +2 -2
  4. package/dist/chunks/{cd-ByDAWGKF.js.map → cd-JZ3C2vu4.js.map} +1 -1
  5. package/dist/chunks/{cmatrix-Idv6FCk5.js → cmatrix-BB-P7e1N.js} +2 -2
  6. package/dist/chunks/{cmatrix-Idv6FCk5.js.map → cmatrix-BB-P7e1N.js.map} +1 -1
  7. package/dist/chunks/{compgen-DL1gfdlf.js → compgen-DD7WP8vc.js} +2 -2
  8. package/dist/chunks/{compgen-DL1gfdlf.js.map → compgen-DD7WP8vc.js.map} +1 -1
  9. package/dist/chunks/{cowsay-CnfiY6_H.js → cowsay-CNvgjDs2.js} +2 -2
  10. package/dist/chunks/{cowsay-CnfiY6_H.js.map → cowsay-CNvgjDs2.js.map} +1 -1
  11. package/dist/chunks/{help-CVuRqwjT.js → help-DX2vcxrF.js} +2 -2
  12. package/dist/chunks/{help-CVuRqwjT.js.map → help-DX2vcxrF.js.map} +1 -1
  13. package/dist/chunks/{lolcat-COIxoNFB.js → lolcat-CLNt_9YM.js} +2 -2
  14. package/dist/chunks/{lolcat-COIxoNFB.js.map → lolcat-CLNt_9YM.js.map} +1 -1
  15. package/dist/chunks/{ls-CDe60u5v.js → ls-D-LFwHDG.js} +2 -2
  16. package/dist/chunks/{ls-CDe60u5v.js.map → ls-D-LFwHDG.js.map} +1 -1
  17. package/dist/chunks/{main-ieLHBWKy.js → main-CMrprn9g.js} +3 -3
  18. package/dist/chunks/{main-ieLHBWKy.js.map → main-CMrprn9g.js.map} +1 -1
  19. package/dist/chunks/{make-BIp0siBJ.js → make-BfRg2_BS.js} +2 -2
  20. package/dist/chunks/{make-BIp0siBJ.js.map → make-BfRg2_BS.js.map} +1 -1
  21. package/dist/chunks/{man-BhyrCkvm.js → man-4nCU6H6z.js} +2 -2
  22. package/dist/chunks/{man-BhyrCkvm.js.map → man-4nCU6H6z.js.map} +1 -1
  23. package/dist/chunks/minimal-l0sNRNKZ.js +2 -0
  24. package/dist/chunks/minimal-l0sNRNKZ.js.map +1 -0
  25. package/dist/chunks/neofetch-Dq3l2NXs.js +205 -0
  26. package/dist/chunks/neofetch-Dq3l2NXs.js.map +1 -0
  27. package/dist/chunks/{reload-Dy-4yWsY.js → reload-C1uAeADY.js} +2 -2
  28. package/dist/chunks/{reload-Dy-4yWsY.js.map → reload-C1uAeADY.js.map} +1 -1
  29. package/dist/chunks/{rm-BssAo3hK.js → rm-CLmpe90B.js} +2 -2
  30. package/dist/chunks/{rm-BssAo3hK.js.map → rm-CLmpe90B.js.map} +1 -1
  31. package/dist/chunks/{rmdir-iKWxmkTT.js → rmdir-DraRExff.js} +2 -2
  32. package/dist/chunks/{rmdir-iKWxmkTT.js.map → rmdir-DraRExff.js.map} +1 -1
  33. package/dist/chunks/{sl-BbE5ahZH.js → sl-DxiVSnU2.js} +2 -2
  34. package/dist/chunks/{sl-BbE5ahZH.js.map → sl-DxiVSnU2.js.map} +1 -1
  35. package/dist/chunks/{touch-DP1jSzBq.js → touch-DH6TnyLa.js} +2 -2
  36. package/dist/chunks/{touch-DP1jSzBq.js.map → touch-DH6TnyLa.js.map} +1 -1
  37. package/dist/chunks/{whatis-Dd0ZBHZz.js → whatis-aS83GZZ-.js} +2 -2
  38. package/dist/chunks/{whatis-Dd0ZBHZz.js.map → whatis-aS83GZZ-.js.map} +1 -1
  39. package/dist/main.js +2 -2
  40. package/package.json +4 -3
  41. package/dist/chunks/neofetch-DDgAqQZC.js +0 -40
  42. package/dist/chunks/neofetch-DDgAqQZC.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { VirtualFile as u } from "@prozilla-os/core";
2
- import { f as a } from "./main-ieLHBWKy.js";
2
+ import { f as a } from "./main-CMrprn9g.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-DzV_0CUU.js.map
17
+ //# sourceMappingURL=cat-Ba26AkHD.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cat-DzV_0CUU.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-Ba26AkHD.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-ieLHBWKy.js";
2
+ import { f as c } from "./main-CMrprn9g.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-ByDAWGKF.js.map
16
+ //# sourceMappingURL=cd-JZ3C2vu4.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cd-ByDAWGKF.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-JZ3C2vu4.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-ieLHBWKy.js";
4
+ import { S as E } from "./main-CMrprn9g.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-Idv6FCk5.js.map
60
+ //# sourceMappingURL=cmatrix-BB-P7e1N.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cmatrix-Idv6FCk5.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-BB-P7e1N.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-ieLHBWKy.js";
2
+ import { C as s } from "./main-CMrprn9g.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-DL1gfdlf.js.map
14
+ //# sourceMappingURL=compgen-DD7WP8vc.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"compgen-DL1gfdlf.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-DD7WP8vc.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-ieLHBWKy.js";
1
+ import { M as p } from "./main-CMrprn9g.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-CnfiY6_H.js.map
50
+ //# sourceMappingURL=cowsay-CNvgjDs2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cowsay-CnfiY6_H.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-CNvgjDs2.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,5 +1,5 @@
1
1
  import { ANSI as t } from "@prozilla-os/shared";
2
- import { C as u, f } from "./main-ieLHBWKy.js";
2
+ import { C as u, f } from "./main-CMrprn9g.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-CVuRqwjT.js.map
18
+ //# sourceMappingURL=help-DX2vcxrF.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"help-CVuRqwjT.js","sources":["../../src/core/commands/help.ts"],"sourcesContent":["import { ANSI } from \"@prozilla-os/shared\";\r\nimport { formatError } from \"../_utils/terminal.utils\";\r\nimport { Command } from \"../command\";\r\nimport { CommandsManager } from \"../commands\";\r\n\r\nexport const help = new Command()\r\n\t.setExecute(function(this: Command, args) {\r\n\t\tif (args?.length === 0) {\r\n\t\t\treturn CommandsManager.COMMANDS.map((command) => {\r\n\t\t\t\tif (command.manual?.purpose) {\r\n\t\t\t\t\treturn `${command.name} - ${ANSI.fg.green}${ANSI.decoration.dim}${command.manual.purpose}${ANSI.reset}`;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn command.name;\r\n\t\t\t\t}\r\n\t\t\t}).sort().join(\"\\n\");\r\n\t\t}\r\n\r\n\t\tconst commandName = (args as string[])[0].toLowerCase();\r\n\t\tconst command = CommandsManager.find(commandName);\r\n\r\n\t\tif (!command)\r\n\t\t\treturn formatError(this.name, `${commandName}: Command not found`);\r\n\r\n\t\tif (!command.manual?.purpose)\r\n\t\t\treturn formatError(this.name, `${commandName}: No manual found`);\r\n\r\n\t\treturn command.manual.purpose;\r\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
+ {"version":3,"file":"help-DX2vcxrF.js","sources":["../../src/core/commands/help.ts"],"sourcesContent":["import { ANSI } from \"@prozilla-os/shared\";\r\nimport { formatError } from \"../_utils/terminal.utils\";\r\nimport { Command } from \"../command\";\r\nimport { CommandsManager } from \"../commands\";\r\n\r\nexport const help = new Command()\r\n\t.setExecute(function(this: Command, args) {\r\n\t\tif (args?.length === 0) {\r\n\t\t\treturn CommandsManager.COMMANDS.map((command) => {\r\n\t\t\t\tif (command.manual?.purpose) {\r\n\t\t\t\t\treturn `${command.name} - ${ANSI.fg.green}${ANSI.decoration.dim}${command.manual.purpose}${ANSI.reset}`;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn command.name;\r\n\t\t\t\t}\r\n\t\t\t}).sort().join(\"\\n\");\r\n\t\t}\r\n\r\n\t\tconst commandName = (args as string[])[0].toLowerCase();\r\n\t\tconst command = CommandsManager.find(commandName);\r\n\r\n\t\tif (!command)\r\n\t\t\treturn formatError(this.name, `${commandName}: Command not found`);\r\n\r\n\t\tif (!command.manual?.purpose)\r\n\t\t\treturn formatError(this.name, `${commandName}: No manual found`);\r\n\r\n\t\treturn command.manual.purpose;\r\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-ieLHBWKy.js";
2
+ import { r as O } from "./main-CMrprn9g.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-COIxoNFB.js.map
36
+ //# sourceMappingURL=lolcat-CLNt_9YM.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"lolcat-COIxoNFB.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-CLNt_9YM.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-ieLHBWKy.js";
1
+ import { f } from "./main-CMrprn9g.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-CDe60u5v.js.map
19
+ //# sourceMappingURL=ls-D-LFwHDG.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ls-CDe60u5v.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-D-LFwHDG.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;"}
@@ -683,7 +683,7 @@ function vt(e) {
683
683
  return e.replace(/\u001b\[([0-9]+)m/gm, "");
684
684
  }
685
685
  let G = [];
686
- const we = /* @__PURE__ */ Object.assign({ "./commands/cat.ts": () => import("./cat-DzV_0CUU.js"), "./commands/cd.ts": () => import("./cd-ByDAWGKF.js"), "./commands/clear.ts": () => import("./clear-DtYBxmDr.js"), "./commands/cmatrix.ts": () => import("./cmatrix-Idv6FCk5.js"), "./commands/compgen.ts": () => import("./compgen-DL1gfdlf.js"), "./commands/cowsay.ts": () => import("./cowsay-CnfiY6_H.js"), "./commands/dir.ts": () => import("./dir-BlrznBqV.js"), "./commands/echo.ts": () => import("./echo-PyZ6XYF6.js"), "./commands/eval.ts": () => import("./eval-CnKC-mrj.js"), "./commands/exit.ts": () => import("./exit-CizX3N_u.js"), "./commands/fortune.ts": () => import("./fortune-Cs0PtMgs.js"), "./commands/help.ts": () => import("./help-CVuRqwjT.js"), "./commands/history.ts": () => import("./history-l0sNRNKZ.js"), "./commands/hostname.ts": () => import("./hostname-BBOQWx6L.js"), "./commands/lolcat.ts": () => import("./lolcat-COIxoNFB.js"), "./commands/ls.ts": () => import("./ls-CDe60u5v.js"), "./commands/make.ts": () => import("./make-BIp0siBJ.js"), "./commands/man.ts": () => import("./man-BhyrCkvm.js"), "./commands/mkdir.ts": () => import("./mkdir-BTSAC1PK.js"), "./commands/neofetch.ts": () => import("./neofetch-DDgAqQZC.js"), "./commands/pwd.ts": () => import("./pwd-CSapfDtw.js"), "./commands/reboot.ts": () => import("./reboot-Bwxhoa8q.js"), "./commands/reload.ts": () => import("./reload-Dy-4yWsY.js"), "./commands/rev.ts": () => import("./rev-C8qQIyj_.js"), "./commands/rm.ts": () => import("./rm-BssAo3hK.js"), "./commands/rmdir.ts": () => import("./rmdir-iKWxmkTT.js"), "./commands/sl.ts": () => import("./sl-BbE5ahZH.js"), "./commands/touch.ts": () => import("./touch-DP1jSzBq.js"), "./commands/uptime.ts": () => import("./uptime-BYmCcOUM.js"), "./commands/whatis.ts": () => import("./whatis-Dd0ZBHZz.js"), "./commands/whoami.ts": () => import("./whoami-CQNGmqxL.js") }), Ce = () => {
686
+ const we = /* @__PURE__ */ Object.assign({ "./commands/cat.ts": () => import("./cat-Ba26AkHD.js"), "./commands/cd.ts": () => import("./cd-JZ3C2vu4.js"), "./commands/clear.ts": () => import("./clear-DtYBxmDr.js"), "./commands/cmatrix.ts": () => import("./cmatrix-BB-P7e1N.js"), "./commands/compgen.ts": () => import("./compgen-DD7WP8vc.js"), "./commands/cowsay.ts": () => import("./cowsay-CNvgjDs2.js"), "./commands/dir.ts": () => import("./dir-BlrznBqV.js"), "./commands/echo.ts": () => import("./echo-PyZ6XYF6.js"), "./commands/eval.ts": () => import("./eval-CnKC-mrj.js"), "./commands/exit.ts": () => import("./exit-CizX3N_u.js"), "./commands/fortune.ts": () => import("./fortune-Cs0PtMgs.js"), "./commands/help.ts": () => import("./help-DX2vcxrF.js"), "./commands/history.ts": () => import("./history-l0sNRNKZ.js"), "./commands/hostname.ts": () => import("./hostname-BBOQWx6L.js"), "./commands/lolcat.ts": () => import("./lolcat-CLNt_9YM.js"), "./commands/ls.ts": () => import("./ls-D-LFwHDG.js"), "./commands/make.ts": () => import("./make-BfRg2_BS.js"), "./commands/man.ts": () => import("./man-4nCU6H6z.js"), "./commands/mkdir.ts": () => import("./mkdir-BTSAC1PK.js"), "./commands/neofetch.ts": () => import("./neofetch-Dq3l2NXs.js"), "./commands/pwd.ts": () => import("./pwd-CSapfDtw.js"), "./commands/reboot.ts": () => import("./reboot-Bwxhoa8q.js"), "./commands/reload.ts": () => import("./reload-C1uAeADY.js"), "./commands/rev.ts": () => import("./rev-C8qQIyj_.js"), "./commands/rm.ts": () => import("./rm-CLmpe90B.js"), "./commands/rmdir.ts": () => import("./rmdir-DraRExff.js"), "./commands/sl.ts": () => import("./sl-DxiVSnU2.js"), "./commands/touch.ts": () => import("./touch-DH6TnyLa.js"), "./commands/uptime.ts": () => import("./uptime-BYmCcOUM.js"), "./commands/whatis.ts": () => import("./whatis-aS83GZZ-.js"), "./commands/whoami.ts": () => import("./whoami-CQNGmqxL.js") }), Ce = () => {
687
687
  G = [];
688
688
  for (const e in we)
689
689
  we[e]().then((s) => {
@@ -893,7 +893,7 @@ function ut({ app: e, path: s, input: n, setTitle: t, close: f, active: y, focus
893
893
  );
894
894
  }
895
895
  const ft = new xe("Terminal", "terminal", ut).setIconUrl("https://os.prozilla.dev/assets/apps/icons/terminal.svg").setRole(je.APP_ROLES.terminal).setCategory("Utilities & tools");
896
- ft.setMetadata({ name: "@prozilla-os/terminal", version: "1.1.8", author: "Prozilla" });
896
+ ft.setMetadata({ name: "@prozilla-os/terminal", version: "1.1.9", author: "Prozilla" });
897
897
  export {
898
898
  E as A,
899
899
  ee as C,
@@ -904,4 +904,4 @@ export {
904
904
  vt as r,
905
905
  ft as t
906
906
  };
907
- //# sourceMappingURL=main-ieLHBWKy.js.map
907
+ //# sourceMappingURL=main-CMrprn9g.js.map