@prozilla-os/terminal 1.1.17 → 1.1.20
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.
- package/LICENSE +20 -20
- package/README.md +85 -85
- package/dist/chunks/cat-DGK7wWrK.js +16 -0
- package/dist/chunks/{cat-F1pnUhWr.js.map → cat-DGK7wWrK.js.map} +1 -1
- package/dist/chunks/{cd-SY_-kgyu.js → cd-DvjkW_6o.js} +5 -6
- package/dist/chunks/{cd-SY_-kgyu.js.map → cd-DvjkW_6o.js.map} +1 -1
- package/dist/chunks/{clear-DtYBxmDr.js → clear-BF9eb1Dq.js} +2 -2
- package/dist/chunks/{clear-DtYBxmDr.js.map → clear-BF9eb1Dq.js.map} +1 -1
- package/dist/chunks/{cmatrix-BI2_Y5OW.js → cmatrix-VYovsHQW.js} +4 -5
- package/dist/chunks/{cmatrix-BI2_Y5OW.js.map → cmatrix-VYovsHQW.js.map} +1 -1
- package/dist/chunks/compgen-3TwdgHm_.js +13 -0
- package/dist/chunks/{compgen-7prOo2oi.js.map → compgen-3TwdgHm_.js.map} +1 -1
- package/dist/chunks/{cowsay-B6TRoqbg.js → cowsay-IfArfPSJ.js} +4 -5
- package/dist/chunks/{cowsay-B6TRoqbg.js.map → cowsay-IfArfPSJ.js.map} +1 -1
- package/dist/chunks/{dir-BlrznBqV.js → dir-B_Ipo5xb.js} +2 -2
- package/dist/chunks/{dir-BlrznBqV.js.map → dir-B_Ipo5xb.js.map} +1 -1
- package/dist/chunks/{echo-PyZ6XYF6.js → echo-DX-Ar2Ut.js} +2 -2
- package/dist/chunks/{echo-PyZ6XYF6.js.map → echo-DX-Ar2Ut.js.map} +1 -1
- package/dist/chunks/{eval-CnKC-mrj.js → eval-C7InkmFY.js} +2 -2
- package/dist/chunks/eval-C7InkmFY.js.map +1 -0
- package/dist/chunks/{exit-CizX3N_u.js → exit-D7PPqtiE.js} +2 -2
- package/dist/chunks/{exit-CizX3N_u.js.map → exit-D7PPqtiE.js.map} +1 -1
- package/dist/chunks/{fortune-Cs0PtMgs.js → fortune-zyxpnYNP.js} +2 -2
- package/dist/chunks/{fortune-Cs0PtMgs.js.map → fortune-zyxpnYNP.js.map} +1 -1
- package/dist/chunks/{help-BUCTSaeJ.js → help-BEgNbwLL.js} +8 -9
- package/dist/chunks/help-BEgNbwLL.js.map +1 -0
- package/dist/chunks/{hostname-BBOQWx6L.js → hostname-DU1lQde2.js} +2 -2
- package/dist/chunks/{hostname-BBOQWx6L.js.map → hostname-DU1lQde2.js.map} +1 -1
- package/dist/chunks/lolcat-5-mBWD9l.js +35 -0
- package/dist/chunks/{lolcat-DiLqxxCO.js.map → lolcat-5-mBWD9l.js.map} +1 -1
- package/dist/chunks/{ls-DScdmJPT.js → ls-DnkSPHVM.js} +4 -5
- package/dist/chunks/{ls-DScdmJPT.js.map → ls-DnkSPHVM.js.map} +1 -1
- package/dist/chunks/{main-CkpVfeUg.js → main-CXiltWT-.js} +382 -332
- package/dist/chunks/main-CXiltWT-.js.map +1 -0
- package/dist/chunks/{make-D_hXz4-L.js → make-DqVQDThH.js} +2 -3
- package/dist/chunks/make-DqVQDThH.js.map +1 -0
- package/dist/chunks/{man-C2UviS5N.js → man-D_hBUTDt.js} +4 -5
- package/dist/chunks/{man-C2UviS5N.js.map → man-D_hBUTDt.js.map} +1 -1
- package/dist/chunks/{mkdir-BTSAC1PK.js → mkdir-BCvMrPTX.js} +2 -2
- package/dist/chunks/{mkdir-BTSAC1PK.js.map → mkdir-BCvMrPTX.js.map} +1 -1
- package/dist/chunks/{neofetch-Bq355NBE.js → neofetch-BFHOITJj.js} +10 -11
- package/dist/chunks/neofetch-BFHOITJj.js.map +1 -0
- package/dist/chunks/{pwd-CSapfDtw.js → pwd-C21tQanw.js} +2 -2
- package/dist/chunks/{pwd-CSapfDtw.js.map → pwd-C21tQanw.js.map} +1 -1
- package/dist/chunks/{reboot-Bwxhoa8q.js → reboot-C2t7a3Av.js} +2 -2
- package/dist/chunks/{reboot-Bwxhoa8q.js.map → reboot-C2t7a3Av.js.map} +1 -1
- package/dist/chunks/reload-C9o_dGZw.js +10 -0
- package/dist/chunks/reload-C9o_dGZw.js.map +1 -0
- package/dist/chunks/{rev-C8qQIyj_.js → rev-CBibYebM.js} +2 -2
- package/dist/chunks/{rev-C8qQIyj_.js.map → rev-CBibYebM.js.map} +1 -1
- package/dist/chunks/rm-ChTrwld4.js +12 -0
- package/dist/chunks/{rm-BwOe-Kq2.js.map → rm-ChTrwld4.js.map} +1 -1
- package/dist/chunks/rmdir-CUM4xt2w.js +11 -0
- package/dist/chunks/{rmdir-B9pGhEAU.js.map → rmdir-CUM4xt2w.js.map} +1 -1
- package/dist/chunks/{sl-DaCRRvuh.js → sl-DrATMkz6.js} +4 -5
- package/dist/chunks/{sl-DaCRRvuh.js.map → sl-DrATMkz6.js.map} +1 -1
- package/dist/chunks/touch-CqBIAjMe.js +19 -0
- package/dist/chunks/{touch-x95bWUyt.js.map → touch-CqBIAjMe.js.map} +1 -1
- package/dist/chunks/{uptime-BYmCcOUM.js → uptime-xM-0FRzA.js} +2 -2
- package/dist/chunks/{uptime-BYmCcOUM.js.map → uptime-xM-0FRzA.js.map} +1 -1
- package/dist/chunks/whatis-vXemLo9m.js +13 -0
- package/dist/chunks/{whatis-DL62XQIi.js.map → whatis-vXemLo9m.js.map} +1 -1
- package/dist/chunks/{whoami-CQNGmqxL.js → whoami-CnUR69yX.js} +2 -2
- package/dist/chunks/{whoami-CQNGmqxL.js.map → whoami-CnUR69yX.js.map} +1 -1
- package/dist/main.d.ts +101 -1
- package/dist/main.js +6 -3
- package/dist/main.js.map +1 -1
- package/package.json +4 -4
- package/dist/chunks/cat-F1pnUhWr.js +0 -17
- package/dist/chunks/command-nBL1aO7T.js +0 -43
- package/dist/chunks/command-nBL1aO7T.js.map +0 -1
- package/dist/chunks/compgen-7prOo2oi.js +0 -14
- package/dist/chunks/eval-CnKC-mrj.js.map +0 -1
- package/dist/chunks/help-BUCTSaeJ.js.map +0 -1
- package/dist/chunks/lolcat-DiLqxxCO.js +0 -36
- package/dist/chunks/main-CkpVfeUg.js.map +0 -1
- package/dist/chunks/make-D_hXz4-L.js.map +0 -1
- package/dist/chunks/neofetch-Bq355NBE.js.map +0 -1
- package/dist/chunks/reload-CnQb5yj-.js +0 -11
- package/dist/chunks/reload-CnQb5yj-.js.map +0 -1
- package/dist/chunks/rm-BwOe-Kq2.js +0 -13
- package/dist/chunks/rmdir-B9pGhEAU.js +0 -12
- package/dist/chunks/touch-x95bWUyt.js +0 -20
- package/dist/chunks/whatis-DL62XQIi.js +0 -14
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2023 Sieben De Beule
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Sieben De Beule
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,85 +1,85 @@
|
|
|
1
|
-
<div align="center">
|
|
2
|
-
<br />
|
|
3
|
-
<p>
|
|
4
|
-
<a href="https://os.prozilla.dev/"><img src="https://os.prozilla.dev/assets/logo.svg?v=2" height="200" alt="ProzillaOS" /></a>
|
|
5
|
-
</p>
|
|
6
|
-
<p>
|
|
7
|
-
<a href="https://github.com/prozilla-os/ProzillaOS/blob/main/LICENSE.md"><img alt="License" src="https://img.shields.io/github/license/Prozilla/ProzillaOS?style=flat-square&color=FF4D5B&label=License"></a>
|
|
8
|
-
<a href="https://github.com/prozilla-os/ProzillaOS"><img alt="Stars" src="https://img.shields.io/github/stars/Prozilla/ProzillaOS?style=flat-square&color=FED24C&label=%E2%AD%90"></a>
|
|
9
|
-
<a href="https://github.com/prozilla-os/ProzillaOS"><img alt="Forks" src="https://img.shields.io/github/forks/Prozilla/ProzillaOS?style=flat-square&color=4D9CFF&label=Forks&logo=github"></a>
|
|
10
|
-
<a href="https://www.npmjs.com/package/prozilla-os"><img alt="NPM Version" src="https://img.shields.io/npm/v/prozilla-os?logo=npm&style=flat-square&label=prozilla-os&color=FF4D5B"></a>
|
|
11
|
-
</p>
|
|
12
|
-
</div>
|
|
13
|
-
|
|
14
|
-
## About
|
|
15
|
-
|
|
16
|
-
`@prozilla-os/terminal` is a terminal/shell application for ProzillaOS.
|
|
17
|
-
|
|
18
|
-
## Installation
|
|
19
|
-
|
|
20
|
-
`@prozilla-os/core` is required to run this application.
|
|
21
|
-
|
|
22
|
-
```sh
|
|
23
|
-
npm install @prozilla-os/core @prozilla-os/terminal
|
|
24
|
-
yarn add @prozilla-os/core @prozilla-os/terminal
|
|
25
|
-
pnpm add @prozilla-os/core @prozilla-os/terminal
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## Usage
|
|
29
|
-
|
|
30
|
-
### Basic setup
|
|
31
|
-
|
|
32
|
-
```tsx
|
|
33
|
-
import { Desktop, ModalsView, ProzillaOS, Taskbar, WindowsView, AppsConfig } from "@prozilla-os/core";
|
|
34
|
-
import { terminal } from "@prozilla-os/terminal";
|
|
35
|
-
|
|
36
|
-
function App() {
|
|
37
|
-
return (
|
|
38
|
-
<ProzillaOS
|
|
39
|
-
systemName="Example"
|
|
40
|
-
tagLine="Powered by ProzillaOS"
|
|
41
|
-
config={{
|
|
42
|
-
apps: new AppsConfig({
|
|
43
|
-
apps: [ terminal ]
|
|
44
|
-
})
|
|
45
|
-
}}
|
|
46
|
-
>
|
|
47
|
-
<Taskbar/>
|
|
48
|
-
<WindowsView/>
|
|
49
|
-
<ModalsView/>
|
|
50
|
-
<Desktop/>
|
|
51
|
-
</ProzillaOS>
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
### Window options
|
|
57
|
-
|
|
58
|
-
```tsx
|
|
59
|
-
/**
|
|
60
|
-
* Initial path that the app will open
|
|
61
|
-
* @default "~" - Home directory
|
|
62
|
-
*/
|
|
63
|
-
path: string;
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Initial input
|
|
67
|
-
*/
|
|
68
|
-
input: string;
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
## Links
|
|
72
|
-
|
|
73
|
-
- [Demo][demo]
|
|
74
|
-
- [Docs][docs]
|
|
75
|
-
- [GitHub][github]
|
|
76
|
-
- [npm][npm]
|
|
77
|
-
- [Discord][discord]
|
|
78
|
-
- [Ko-fi][ko-fi]
|
|
79
|
-
|
|
80
|
-
[demo]: https://os.prozilla.dev/terminal
|
|
81
|
-
[docs]: https://os.prozilla.dev/docs/reference/apps/terminal
|
|
82
|
-
[github]: https://github.com/prozilla-os/ProzillaOS/tree/main/packages/apps/terminal
|
|
83
|
-
[npm]: https://www.npmjs.com/package/@prozilla-os/terminal
|
|
84
|
-
[discord]: https://discord.gg/JwbyQP4tdz
|
|
85
|
-
[ko-fi]: https://ko-fi.com/prozilla
|
|
1
|
+
<div align="center">
|
|
2
|
+
<br />
|
|
3
|
+
<p>
|
|
4
|
+
<a href="https://os.prozilla.dev/"><img src="https://os.prozilla.dev/assets/logo.svg?v=2" height="200" alt="ProzillaOS" /></a>
|
|
5
|
+
</p>
|
|
6
|
+
<p>
|
|
7
|
+
<a href="https://github.com/prozilla-os/ProzillaOS/blob/main/LICENSE.md"><img alt="License" src="https://img.shields.io/github/license/Prozilla/ProzillaOS?style=flat-square&color=FF4D5B&label=License"></a>
|
|
8
|
+
<a href="https://github.com/prozilla-os/ProzillaOS"><img alt="Stars" src="https://img.shields.io/github/stars/Prozilla/ProzillaOS?style=flat-square&color=FED24C&label=%E2%AD%90"></a>
|
|
9
|
+
<a href="https://github.com/prozilla-os/ProzillaOS"><img alt="Forks" src="https://img.shields.io/github/forks/Prozilla/ProzillaOS?style=flat-square&color=4D9CFF&label=Forks&logo=github"></a>
|
|
10
|
+
<a href="https://www.npmjs.com/package/prozilla-os"><img alt="NPM Version" src="https://img.shields.io/npm/v/prozilla-os?logo=npm&style=flat-square&label=prozilla-os&color=FF4D5B"></a>
|
|
11
|
+
</p>
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
## About
|
|
15
|
+
|
|
16
|
+
`@prozilla-os/terminal` is a terminal/shell application for ProzillaOS.
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
`@prozilla-os/core` is required to run this application.
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
npm install @prozilla-os/core @prozilla-os/terminal
|
|
24
|
+
yarn add @prozilla-os/core @prozilla-os/terminal
|
|
25
|
+
pnpm add @prozilla-os/core @prozilla-os/terminal
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
### Basic setup
|
|
31
|
+
|
|
32
|
+
```tsx
|
|
33
|
+
import { Desktop, ModalsView, ProzillaOS, Taskbar, WindowsView, AppsConfig } from "@prozilla-os/core";
|
|
34
|
+
import { terminal } from "@prozilla-os/terminal";
|
|
35
|
+
|
|
36
|
+
function App() {
|
|
37
|
+
return (
|
|
38
|
+
<ProzillaOS
|
|
39
|
+
systemName="Example"
|
|
40
|
+
tagLine="Powered by ProzillaOS"
|
|
41
|
+
config={{
|
|
42
|
+
apps: new AppsConfig({
|
|
43
|
+
apps: [ terminal ]
|
|
44
|
+
})
|
|
45
|
+
}}
|
|
46
|
+
>
|
|
47
|
+
<Taskbar/>
|
|
48
|
+
<WindowsView/>
|
|
49
|
+
<ModalsView/>
|
|
50
|
+
<Desktop/>
|
|
51
|
+
</ProzillaOS>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Window options
|
|
57
|
+
|
|
58
|
+
```tsx
|
|
59
|
+
/**
|
|
60
|
+
* Initial path that the app will open
|
|
61
|
+
* @default "~" - Home directory
|
|
62
|
+
*/
|
|
63
|
+
path: string;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Initial input
|
|
67
|
+
*/
|
|
68
|
+
input: string;
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Links
|
|
72
|
+
|
|
73
|
+
- [Demo][demo]
|
|
74
|
+
- [Docs][docs]
|
|
75
|
+
- [GitHub][github]
|
|
76
|
+
- [npm][npm]
|
|
77
|
+
- [Discord][discord]
|
|
78
|
+
- [Ko-fi][ko-fi]
|
|
79
|
+
|
|
80
|
+
[demo]: https://os.prozilla.dev/terminal
|
|
81
|
+
[docs]: https://os.prozilla.dev/docs/reference/apps/terminal
|
|
82
|
+
[github]: https://github.com/prozilla-os/ProzillaOS/tree/main/packages/apps/terminal
|
|
83
|
+
[npm]: https://www.npmjs.com/package/@prozilla-os/terminal
|
|
84
|
+
[discord]: https://discord.gg/JwbyQP4tdz
|
|
85
|
+
[ko-fi]: https://ko-fi.com/prozilla
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { VirtualFile as u } from "@prozilla-os/core";
|
|
2
|
+
import { C as a, f as l } from "./main-CXiltWT-.js";
|
|
3
|
+
const m = new a().setRequireArgs(!0).setManual({
|
|
4
|
+
purpose: "Concetenate files and display on the terminal screen",
|
|
5
|
+
usage: "cat [options] [files]",
|
|
6
|
+
description: "Concetenate files to standard output."
|
|
7
|
+
}).setExecute(function(r, s) {
|
|
8
|
+
const { currentDirectory: o, options: t } = s, n = r[0], { name: i, extension: c } = u.splitId(n), e = o.findFile(i, c);
|
|
9
|
+
return e ? e.content ? t != null && t.includes("e") ? e.content.split(`
|
|
10
|
+
`).join(`$
|
|
11
|
+
`) + "$" : e.content : e.source ? `Src: ${e.source}` : { blank: !0 } : l(this.name, `${n}: No such file`);
|
|
12
|
+
});
|
|
13
|
+
export {
|
|
14
|
+
m as cat
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=cat-DGK7wWrK.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cat-
|
|
1
|
+
{"version":3,"file":"cat-DGK7wWrK.js","sources":["../../src/core/commands/cat.ts"],"sourcesContent":["import { VirtualFile } from \"@prozilla-os/core\";\nimport { formatError } from \"../_utils/terminal.utils\";\nimport { Command, ExecuteParams } from \"../command\";\n\nexport const cat = new Command()\n\t.setRequireArgs(true)\n\t.setManual({\n\t\tpurpose: \"Concetenate files and display on the terminal screen\",\n\t\tusage: \"cat [options] [files]\",\n\t\tdescription: \"Concetenate files to standard output.\",\n\t})\n\t.setExecute(function(this: Command, args, params) {\n\t\tconst { currentDirectory, options } = params as ExecuteParams;\n\t\tconst fileId = (args as string[])[0];\n\t\tconst { name, extension } = VirtualFile.splitId(fileId);\n\t\tconst file = currentDirectory.findFile(name, extension);\n\n\t\tif (!file)\n\t\t\treturn formatError(this.name, `${fileId}: No such file`);\n\n\t\tif (file.content) {\n\t\t\tif (!options?.includes(\"e\")) {\n\t\t\t\treturn file.content;\n\t\t\t} else {\n\t\t\t\t// Append \"$\" at the end of every line\n\t\t\t\treturn file.content.split(\"\\n\").join(\"$\\n\") + \"$\";\n\t\t\t}\n\t\t} else if (file.source) {\n\t\t\treturn `Src: ${file.source}`;\n\t\t} else {\n\t\t\treturn { blank: true };\n\t\t}\n\t});"],"names":["cat","Command","args","params","currentDirectory","options","fileId","name","extension","VirtualFile","file","formatError"],"mappings":";;AAIO,MAAMA,IAAM,IAAIC,IACrB,eAAe,EAAI,EACnB,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AAAA,EACP,aAAa;AACd,CAAC,EACA,WAAW,SAAwBC,GAAMC,GAAQ;AAC3C,QAAA,EAAE,kBAAAC,GAAkB,SAAAC,EAAY,IAAAF,GAChCG,IAAUJ,EAAkB,CAAC,GAC7B,EAAE,MAAAK,GAAM,WAAAC,EAAA,IAAcC,EAAY,QAAQH,CAAM,GAChDI,IAAON,EAAiB,SAASG,GAAMC,CAAS;AAEtD,SAAKE,IAGDA,EAAK,UACHL,KAAA,QAAAA,EAAS,SAAS,OAIfK,EAAK,QAAQ,MAAM;AAAA,CAAI,EAAE,KAAK;AAAA,CAAK,IAAI,MAHvCA,EAAK,UAKHA,EAAK,SACR,QAAQA,EAAK,MAAM,KAEnB,EAAE,OAAO,OAZTC,EAAY,KAAK,MAAM,GAAGL,CAAM,gBAAgB;AAczD,CAAC;"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { VirtualFile as a } from "@prozilla-os/core";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const d = new s().setManual({
|
|
2
|
+
import { C as c, f as s } from "./main-CXiltWT-.js";
|
|
3
|
+
const f = new c().setManual({
|
|
5
4
|
purpose: "Change the current directory",
|
|
6
5
|
usage: "cd [PATH]",
|
|
7
6
|
description: "Change working directory to given path (the home directory by default)."
|
|
8
7
|
}).setExecute(function(r, o) {
|
|
9
8
|
const { currentDirectory: n, setCurrentDirectory: e } = o, i = r[0] ?? "~";
|
|
10
9
|
let t = n.navigate(i);
|
|
11
|
-
return t ? (t instanceof a && (t = t.parent), e == null || e(t), { blank: !0 }) :
|
|
10
|
+
return t ? (t instanceof a && (t = t.parent), e == null || e(t), { blank: !0 }) : s(this.name, `${r[0]}: No such file or directory`);
|
|
12
11
|
});
|
|
13
12
|
export {
|
|
14
|
-
|
|
13
|
+
f as cd
|
|
15
14
|
};
|
|
16
|
-
//# sourceMappingURL=cd-
|
|
15
|
+
//# sourceMappingURL=cd-DvjkW_6o.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cd-
|
|
1
|
+
{"version":3,"file":"cd-DvjkW_6o.js","sources":["../../src/core/commands/cd.ts"],"sourcesContent":["import { VirtualFile, VirtualFolder } from \"@prozilla-os/core\";\nimport { formatError } from \"../_utils/terminal.utils\";\nimport { Command, ExecuteParams } from \"../command\";\n\nexport const cd = new Command()\n\t.setManual({\n\t\tpurpose: \"Change the current directory\",\n\t\tusage: \"cd [PATH]\",\n\t\tdescription: \"Change working directory to given path (the home directory by default).\",\n\t})\n\t.setExecute(function(this: Command, args, params) {\n\t\tconst { currentDirectory, setCurrentDirectory } = params as ExecuteParams;\n\t\tconst path = (args as string[])[0] ?? \"~\";\n\t\tlet destination = currentDirectory.navigate(path);\n\t\n\t\tif (!destination)\n\t\t\treturn formatError(this.name, `${(args as string[])[0]}: No such file or directory`);\n\n\t\tif (destination instanceof VirtualFile)\n\t\t\tdestination = destination.parent as VirtualFolder;\n\t\n\t\tsetCurrentDirectory?.(destination);\n\t\treturn { blank: true };\n\t});"],"names":["cd","Command","args","params","currentDirectory","setCurrentDirectory","path","destination","VirtualFile","formatError"],"mappings":";;AAIO,MAAMA,IAAK,IAAIC,EAAQ,EAC5B,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AAAA,EACP,aAAa;AACd,CAAC,EACA,WAAW,SAAwBC,GAAMC,GAAQ;AAC3C,QAAA,EAAE,kBAAAC,GAAkB,qBAAAC,EAAwB,IAAAF,GAC5CG,IAAQJ,EAAkB,CAAC,KAAK;AAClC,MAAAK,IAAcH,EAAiB,SAASE,CAAI;AAEhD,SAAKC,KAGDA,aAAuBC,MAC1BD,IAAcA,EAAY,SAE3BF,KAAA,QAAAA,EAAsBE,IACf,EAAE,OAAO,QANRE,EAAY,KAAK,MAAM,GAAIP,EAAkB,CAAC,CAAC,6BAA6B;AAOrF,CAAC;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as n } from "./
|
|
1
|
+
import { C as n } from "./main-CXiltWT-.js";
|
|
2
2
|
const s = new n().setManual({
|
|
3
3
|
purpose: "Clear terminal screen"
|
|
4
4
|
}).setExecute(function(t, r) {
|
|
@@ -11,4 +11,4 @@ const s = new n().setManual({
|
|
|
11
11
|
export {
|
|
12
12
|
s as clear
|
|
13
13
|
};
|
|
14
|
-
//# sourceMappingURL=clear-
|
|
14
|
+
//# sourceMappingURL=clear-BF9eb1Dq.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clear-
|
|
1
|
+
{"version":3,"file":"clear-BF9eb1Dq.js","sources":["../../src/core/commands/clear.ts"],"sourcesContent":["import { Command, ExecuteParams } from \"../command\";\n\nexport const clear = new Command()\n\t.setManual({\n\t\tpurpose: \"Clear terminal screen\",\n\t})\n\t.setExecute(function(_args, params) {\n\t\tconst { pushHistory } = params as ExecuteParams;\n\t\tpushHistory?.({\n\t\t\tclear: true,\n\t\t\tisInput: false,\n\t\t});\n\t\n\t\treturn { blank: true };\n\t});"],"names":["clear","Command","_args","params","pushHistory"],"mappings":";AAEO,MAAMA,IAAQ,IAAIC,EAAQ,EAC/B,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,SAASC,GAAOC,GAAQ;AAC7B,QAAA,EAAE,aAAAC,EAAgB,IAAAD;AACV,SAAAC,KAAA,QAAAA,EAAA;AAAA,IACb,OAAO;AAAA,IACP,SAAS;AAAA,EAAA,IAGH,EAAE,OAAO;AACjB,CAAC;"}
|
|
@@ -1,7 +1,6 @@
|
|
|
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
|
-
import { C as w } from "./
|
|
4
|
-
import { S as E } from "./main-CkpVfeUg.js";
|
|
3
|
+
import { C as w, S as E } from "./main-CXiltWT-.js";
|
|
5
4
|
const g = 1.25, c = 75, S = 20, z = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.*\\/()#@&$!?%°:<>[]", f = {
|
|
6
5
|
framesBetweenSpawn: 30,
|
|
7
6
|
fallSpeed: 1,
|
|
@@ -34,7 +33,7 @@ function A(s, r, i) {
|
|
|
34
33
|
}), [...r.map((o) => o.join(""))].reverse().join(`
|
|
35
34
|
`);
|
|
36
35
|
}
|
|
37
|
-
const
|
|
36
|
+
const C = new w().setManual({
|
|
38
37
|
purpose: "Show a scrolling 'Matrix' like screen",
|
|
39
38
|
usage: "cmatrix"
|
|
40
39
|
}).setExecute(function() {
|
|
@@ -55,6 +54,6 @@ const N = new w().setManual({
|
|
|
55
54
|
}), s.start(), s;
|
|
56
55
|
});
|
|
57
56
|
export {
|
|
58
|
-
|
|
57
|
+
C as cmatrix
|
|
59
58
|
};
|
|
60
|
-
//# sourceMappingURL=cmatrix-
|
|
59
|
+
//# sourceMappingURL=cmatrix-VYovsHQW.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmatrix-
|
|
1
|
+
{"version":3,"file":"cmatrix-VYovsHQW.js","sources":["../../src/core/commands/cmatrix.ts"],"sourcesContent":["import { Vector2 } from \"@prozilla-os/core\";\nimport { ANSI, randomFromArray, randomRange, removeFromArray } from \"@prozilla-os/shared\";\nimport { Command } from \"../command\";\nimport { Stream } from \"../stream\";\n\nconst ANIMATION_SPEED = 1.25;\nconst SCREEN_WIDTH = 75;\nconst SCREEN_HEIGHT = 20;\nconst CHARACTERS = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.*\\\\/()#@&$!?%°:<>[]\";\n\nconst PARTICLES = {\n\tframesBetweenSpawn: 30,\n\tfallSpeed: 1,\n\tminSize: 5,\n\tmaxSize: 25,\n};\n\ntype Particle = {\n\tposition: Vector2,\n\tsize: number;\n};\n\nfunction generateScreen(frame: number, screen: string[][], particles: Particle[]): string {\n\t// Spawn new particles\n\tif (frame % PARTICLES.framesBetweenSpawn) {\n\t\tconst newParticle: Particle = {\n\t\t\tposition: new Vector2(randomRange(0, SCREEN_WIDTH), SCREEN_HEIGHT).round(),\n\t\t\tsize: Math.round(randomRange(PARTICLES.minSize, PARTICLES.maxSize)),\n\t\t};\n\t\tparticles.push(newParticle);\n\t}\n\n\t// Move and render particles\n\tparticles.forEach((particle) => {\n\t\tparticle.position.y -= PARTICLES.fallSpeed;\n\n\t\t// Clean previous render\n\t\tfor (let i = 0; i < PARTICLES.fallSpeed; i++) {\n\t\t\tconst positionX = particle.position.x;\n\t\t\tconst positionY = particle.position.y + i + particle.size;\n\n\t\t\tif (positionY < SCREEN_HEIGHT && positionY >= 0)\n\t\t\t\tscreen[positionY][positionX] = \" \";\n\t\t}\n\n\t\t// Remove offscreen particles\n\t\tif (particle.position.y + particle.size <= 0 || particle.position.x >= SCREEN_WIDTH)\n\t\t\treturn removeFromArray(particle, particles);\n\n\t\tfor (let i = 0; i < particle.size; i++) {\n\t\t\tconst character = randomFromArray(CHARACTERS.split(\"\"));\n\t\t\tlet color = i == 0 ? ANSI.fg.white : ANSI.fg.green;\n\n\t\t\tif (i > particle.size / 2)\n\t\t\t\tcolor = ANSI.fg.green + ANSI.decoration.dim;\n\n\t\t\tconst positionX = particle.position.x;\n\t\t\tconst positionY = particle.position.y + i;\n\n\t\t\tif (positionX < SCREEN_WIDTH && positionY < SCREEN_HEIGHT && positionY >= 0) {\n\t\t\t\tscreen[positionY][positionX] = color + character + ANSI.reset;\n\t\t\t}\n\t\t}\n\t});\n\n\treturn [...screen.map((row) => row.join(\"\"))].reverse().join(\"\\n\");\n}\n\nexport const cmatrix = new Command()\n\t.setManual({\n\t\tpurpose: \"Show a scrolling 'Matrix' like screen\",\n\t\tusage: \"cmatrix\",\n\t})\n\t.setExecute(function() {\n\t\tconst stream = new Stream();\n\t\tconst particles: Particle[] = [];\n\n\t\t// Create screen\n\t\tconst screen: string[][] = [];\n\t\tfor (let y = 0; y < SCREEN_HEIGHT; y++) {\n\t\t\tconst row: string[] = [];\n\t\t\tfor (let x = 0; x < SCREEN_WIDTH; x++) {\n\t\t\t\trow.push(\" \");\n\t\t\t}\n\t\t\tscreen.push(row);\n\t\t}\n\n\t\tlet frame = 0;\n\t\tconst interval = setInterval(() => {\n\t\t\tconst text = generateScreen(frame, screen, particles);\n\t\t\tstream.send(text);\n\t\t\tframe++;\n\t\t}, 100 / ANIMATION_SPEED);\n\n\t\tstream.on(Stream.EVENT_NAMES.stop, () => {\n\t\t\tclearInterval(interval);\n\t\t});\n\n\t\tstream.start();\n\n\t\treturn stream;\n\t});"],"names":["ANIMATION_SPEED","SCREEN_WIDTH","SCREEN_HEIGHT","CHARACTERS","PARTICLES","generateScreen","frame","screen","particles","newParticle","Vector2","randomRange","particle","i","positionX","positionY","removeFromArray","character","randomFromArray","color","ANSI","row","cmatrix","Command","stream","Stream","y","x","interval","text"],"mappings":";;;AAKA,MAAMA,IAAkB,MAClBC,IAAe,IACfC,IAAgB,IAChBC,IAAa,sFAEbC,IAAY;AAAA,EACjB,oBAAoB;AAAA,EACpB,WAAW;AAAA,EACX,SAAS;AAAA,EACT,SAAS;AACV;AAOA,SAASC,EAAeC,GAAeC,GAAoBC,GAA+B;AAErF,MAAAF,IAAQF,EAAU,oBAAoB;AACzC,UAAMK,IAAwB;AAAA,MAC7B,UAAU,IAAIC,EAAQC,EAAY,GAAGV,CAAY,GAAGC,CAAa,EAAE,MAAM;AAAA,MACzE,MAAM,KAAK,MAAMS,EAAYP,EAAU,SAASA,EAAU,OAAO,CAAC;AAAA,IAAA;AAEnE,IAAAI,EAAU,KAAKC,CAAW;AAAA,EAC3B;AAGU,SAAAD,EAAA,QAAQ,CAACI,MAAa;AACtB,IAAAA,EAAA,SAAS,KAAKR,EAAU;AAGjC,aAASS,IAAI,GAAGA,IAAIT,EAAU,WAAWS,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;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { C as s, a as o } from "./main-CXiltWT-.js";
|
|
2
|
+
const r = new s().setManual({
|
|
3
|
+
purpose: "Display a list of all commands"
|
|
4
|
+
}).setRequireOptions(!0).setExecute(function(t, e) {
|
|
5
|
+
const { options: a } = e;
|
|
6
|
+
if (a != null && a.includes("c"))
|
|
7
|
+
return o.COMMANDS.map((n) => n.name).sort().join(`
|
|
8
|
+
`);
|
|
9
|
+
});
|
|
10
|
+
export {
|
|
11
|
+
r as compgen
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=compgen-3TwdgHm_.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compgen-
|
|
1
|
+
{"version":3,"file":"compgen-3TwdgHm_.js","sources":["../../src/core/commands/compgen.ts"],"sourcesContent":["import { Command, ExecuteParams } from \"../command\";\nimport { CommandsManager } from \"../commands\";\n\nexport const compgen = new Command()\n\t.setManual({\n\t\tpurpose: \"Display a list of all commands\",\n\t})\n\t.setRequireOptions(true)\n\t.setExecute(function(_args, params) {\n\t\tconst { options } = params as ExecuteParams;\n\t\tif (options?.includes(\"c\")) {\n\t\t\treturn CommandsManager.COMMANDS.map((command) => command.name).sort().join(\"\\n\");\n\t\t}\n\t});"],"names":["compgen","Command","_args","params","options","CommandsManager","command"],"mappings":";AAGO,MAAMA,IAAU,IAAIC,EAAQ,EACjC,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,kBAAkB,EAAI,EACtB,WAAW,SAASC,GAAOC,GAAQ;AAC7B,QAAA,EAAE,SAAAC,EAAY,IAAAD;AAChB,MAAAC,KAAA,QAAAA,EAAS,SAAS;AACd,WAAAC,EAAgB,SAAS,IAAI,CAACC,MAAYA,EAAQ,IAAI,EAAE,KAAA,EAAO,KAAK;AAAA,CAAI;AAEjF,CAAC;"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { M as p } from "./main-
|
|
2
|
-
import { C as _ } from "./command-nBL1aO7T.js";
|
|
1
|
+
import { C as _, M as p } from "./main-CXiltWT-.js";
|
|
3
2
|
const m = `
|
|
4
3
|
\\ ^__^
|
|
5
4
|
\\ (oo)\\_______
|
|
6
5
|
(__)\\ )\\/\\
|
|
7
6
|
||----w |
|
|
8
|
-
|| ||`,
|
|
7
|
+
|| ||`, $ = new _().setRequireArgs(!0).setManual({
|
|
9
8
|
purpose: "Show a cow saying something",
|
|
10
9
|
usage: "cowsay text",
|
|
11
10
|
description: "Show ASCII art of a cow saying something."
|
|
@@ -45,6 +44,6 @@ const m = `
|
|
|
45
44
|
`) + m;
|
|
46
45
|
});
|
|
47
46
|
export {
|
|
48
|
-
|
|
47
|
+
$ as cowsay
|
|
49
48
|
};
|
|
50
|
-
//# sourceMappingURL=cowsay-
|
|
49
|
+
//# sourceMappingURL=cowsay-IfArfPSJ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cowsay-
|
|
1
|
+
{"version":3,"file":"cowsay-IfArfPSJ.js","sources":["../../src/core/commands/cowsay.ts"],"sourcesContent":["import { MAX_WIDTH } from \"../../constants/terminal.const\";\nimport { Command, ExecuteParams } from \"../command\";\n\nconst COW = `\n \\\\ ^__^\n \\\\ (oo)\\\\_______\n (__)\\\\ )\\\\/\\\\\n ||----w |\n || ||`;\n\nexport const cowsay = new Command()\n\t.setRequireArgs(true)\n\t.setManual({\n\t\tpurpose: \"Show a cow saying something\",\n\t\tusage: \"cowsay text\",\n\t\tdescription: \"Show ASCII art of a cow saying something.\",\n\t})\n\t.setExecute(function(_args, params) {\n\t\tconst { rawInputValue } = params as ExecuteParams;\n\n\t\t// Separate input value into lines\n\t\tconst segments = rawInputValue?.split(\" \");\n\t\tconst lines: string[] = [];\n\t\tlet currentLine = \"\";\n\t\tlet maxLineWidth = 0;\n\n\t\tconst addLine = (line: string) => {\n\t\t\tline = line.trimEnd();\n\t\t\tlines.push(line);\n\t\t\tif (line.length > maxLineWidth)\n\t\t\t\tmaxLineWidth = line.length;\n\t\t};\n\n\t\tconst nextLine = (word?: string) => {\n\t\t\taddLine(currentLine);\n\n\t\t\tif (word) {\n\t\t\t\tcurrentLine = word + \" \";\n\t\t\t} else {\n\t\t\t\tcurrentLine = \"\";\n\t\t\t}\n\t\t};\n\n\t\tsegments?.forEach((segment) => {\n\t\t\t// Add empty spaces preceding lines\n\t\t\tif (segment === \"\") {\n\t\t\t\tcurrentLine += \" \";\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst words = segment.split(\"\\n\");\n\t\t\tfor (let i = 0; i < words.length; i++) {\n\t\t\t\tconst word = words[i];\n\t\t\t\t\n\t\t\t\t// Handle next lines\n\t\t\t\tif (i > 0)\n\t\t\t\t\tnextLine();\n\n\t\t\t\t// Fit word on current line\n\t\t\t\tif ((currentLine + word).length <= MAX_WIDTH) {\n\t\t\t\t\tcurrentLine += word + \" \";\n\t\t\t\t} else if (word.length > MAX_WIDTH) {\n\t\t\t\t\tconst remainingSpaces = MAX_WIDTH - currentLine.length;\n\n\t\t\t\t\tif (remainingSpaces >= 2) {\n\t\t\t\t\t\taddLine(currentLine + word.substring(0, remainingSpaces - 1) + \"-\");\n\t\t\t\t\t\tcurrentLine = word.substring(remainingSpaces - 1) + \" \";\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnextLine(word);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tnextLine(word);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tif (currentLine.length > 0)\n\t\t\taddLine(currentLine);\n\n\t\t// Turn lines into speech bubble\n\t\tconst speechBubble = [` ${\"_\".repeat(maxLineWidth + 2)} `];\n\n\t\tfor (let i = 0; i < lines.length; i++) {\n\t\t\tlet line = lines[i];\n\t\t\tconst missingSpaces = maxLineWidth - line.length;\n\n\t\t\tif (missingSpaces > 0)\n\t\t\t\tline += \" \".repeat(missingSpaces);\n\n\t\t\tif (lines.length > 1) {\n\t\t\t\tif (i === 0) {\n\t\t\t\t\tline = `/ ${line} \\\\`;\n\t\t\t\t} else if (i === lines.length - 1) {\n\t\t\t\t\tline = `\\\\ ${line} /`;\n\t\t\t\t} else {\n\t\t\t\t\tline = `| ${line} |`;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tline = `< ${line} >`;\n\t\t\t}\n\n\t\t\tspeechBubble.push(line);\n\t\t}\n\n\t\tspeechBubble.push(` ${\"-\".repeat(maxLineWidth + 2)} `);\n\n\t\treturn speechBubble.join(\"\\n\") + COW;\n\t});"],"names":["COW","cowsay","Command","_args","params","rawInputValue","segments","lines","currentLine","maxLineWidth","addLine","line","nextLine","word","segment","words","i","MAX_WIDTH","remainingSpaces","speechBubble","missingSpaces"],"mappings":";AAGA,MAAMA,IAAM;AAAA;AAAA;AAAA;AAAA;AAAA,4BAOCC,IAAS,IAAIC,IACxB,eAAe,EAAI,EACnB,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AAAA,EACP,aAAa;AACd,CAAC,EACA,WAAW,SAASC,GAAOC,GAAQ;AAC7B,QAAA,EAAE,eAAAC,EAAkB,IAAAD,GAGpBE,IAAWD,KAAA,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,4 +1,4 @@
|
|
|
1
|
-
import { C as s } from "./
|
|
1
|
+
import { C as s } from "./main-CXiltWT-.js";
|
|
2
2
|
const c = new s().setManual({
|
|
3
3
|
purpose: "List all directories in the current directory"
|
|
4
4
|
}).setExecute(function(i, t) {
|
|
@@ -8,4 +8,4 @@ const c = new s().setManual({
|
|
|
8
8
|
export {
|
|
9
9
|
c as dir
|
|
10
10
|
};
|
|
11
|
-
//# sourceMappingURL=dir-
|
|
11
|
+
//# sourceMappingURL=dir-B_Ipo5xb.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dir-
|
|
1
|
+
{"version":3,"file":"dir-B_Ipo5xb.js","sources":["../../src/core/commands/dir.ts"],"sourcesContent":["import { Command, ExecuteParams } from \"../command\";\n\nexport const dir = new Command()\n\t.setManual({\n\t\tpurpose: \"List all directories in the current directory\",\n\t})\n\t.setExecute(function(_args, params) {\n\t\tconst { currentDirectory } = params as ExecuteParams;\n\t\tconst folderNames = currentDirectory.subFolders.map((folder) => folder.id);\n\t\n\t\tif (folderNames.length === 0)\n\t\t\treturn { blank: true };\n\t\n\t\treturn folderNames.sort((nameA, nameB) => nameA.localeCompare(nameB)).join(\" \");\n\t});"],"names":["dir","Command","_args","params","currentDirectory","folderNames","folder","nameA","nameB"],"mappings":";AAEO,MAAMA,IAAM,IAAIC,EAAQ,EAC7B,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,SAASC,GAAOC,GAAQ;AAC7B,QAAA,EAAE,kBAAAC,EAAqB,IAAAD,GACvBE,IAAcD,EAAiB,WAAW,IAAI,CAACE,MAAWA,EAAO,EAAE;AAEzE,SAAID,EAAY,WAAW,IACnB,EAAE,OAAO,OAEVA,EAAY,KAAK,CAACE,GAAOC,MAAUD,EAAM,cAAcC,CAAK,CAAC,EAAE,KAAK,GAAG;AAC/E,CAAC;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as n } from "./
|
|
1
|
+
import { C as n } from "./main-CXiltWT-.js";
|
|
2
2
|
const a = new n().setManual({
|
|
3
3
|
purpose: "Display text on the terminal screen"
|
|
4
4
|
}).setExecute(function(o, e) {
|
|
@@ -8,4 +8,4 @@ const a = new n().setManual({
|
|
|
8
8
|
export {
|
|
9
9
|
a as echo
|
|
10
10
|
};
|
|
11
|
-
//# sourceMappingURL=echo-
|
|
11
|
+
//# sourceMappingURL=echo-DX-Ar2Ut.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"echo-
|
|
1
|
+
{"version":3,"file":"echo-DX-Ar2Ut.js","sources":["../../src/core/commands/echo.ts"],"sourcesContent":["import { Command, ExecuteParams } from \"../command\";\n\nexport const echo = new Command()\n\t.setManual({\n\t\tpurpose: \"Display text on the terminal screen\",\n\t})\n\t.setExecute(function(_args, params) {\n\t\tconst { rawInputValue } = params as ExecuteParams;\n\t\treturn rawInputValue;\n\t});"],"names":["echo","Command","_args","params","rawInputValue"],"mappings":";AAEO,MAAMA,IAAO,IAAIC,EAAQ,EAC9B,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,SAASC,GAAOC,GAAQ;AAC7B,QAAA,EAAE,eAAAC,EAAkB,IAAAD;AACnB,SAAAC;AACR,CAAC;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as Command } from "./
|
|
1
|
+
import { C as Command } from "./main-CXiltWT-.js";
|
|
2
2
|
const evalCommand = new Command().setRequireArgs(!0).setManual({
|
|
3
3
|
purpose: "Evaluate and execute JavaScript code",
|
|
4
4
|
usage: "eval [input]"
|
|
@@ -11,4 +11,4 @@ const evalCommand = new Command().setRequireArgs(!0).setManual({
|
|
|
11
11
|
export {
|
|
12
12
|
evalCommand as eval
|
|
13
13
|
};
|
|
14
|
-
//# sourceMappingURL=eval-
|
|
14
|
+
//# sourceMappingURL=eval-C7InkmFY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eval-C7InkmFY.js","sources":["../../src/core/commands/eval.ts"],"sourcesContent":["import { Command, CommandResponse } from \"../command\";\n\nconst evalCommand = new Command()\n\t.setRequireArgs(true)\n\t.setManual({\n\t\tpurpose: \"Evaluate and execute JavaScript code\",\n\t\tusage: \"eval [input]\",\n\t})\n\t.setRequireArgs(true)\n\t.setExecute(function(this: Command, args) {\n\t\tif (args == null || args.length == 0)\n\t\t\treturn;\n\t\t\n\t\tconst output = eval(args[0]) as CommandResponse ?? { blank: true };\n\t\treturn output;\n\t});\n\nexport { evalCommand as eval };"],"names":[],"mappings":";AAEA,MAAM,cAAc,IAAI,UACtB,eAAe,EAAI,EACnB,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AACR,CAAC,EACA,eAAe,EAAI,EACnB,WAAW,SAAwB,MAAM;AACrC,MAAA,QAAQ,QAAQ,KAAK,UAAU;AAClC;AAEK,QAAA,SAAS,KAAK,KAAK,CAAC,CAAC,KAAwB,EAAE,OAAO;AACrD,SAAA;AACR,CAAC;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as n } from "./
|
|
1
|
+
import { C as n } from "./main-CXiltWT-.js";
|
|
2
2
|
const o = new n().setManual({
|
|
3
3
|
purpose: "Quit terminal interface"
|
|
4
4
|
}).setExecute(function(r, e) {
|
|
@@ -8,4 +8,4 @@ const o = new n().setManual({
|
|
|
8
8
|
export {
|
|
9
9
|
o as exit
|
|
10
10
|
};
|
|
11
|
-
//# sourceMappingURL=exit-
|
|
11
|
+
//# sourceMappingURL=exit-D7PPqtiE.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exit-
|
|
1
|
+
{"version":3,"file":"exit-D7PPqtiE.js","sources":["../../src/core/commands/exit.ts"],"sourcesContent":["import { Command, ExecuteParams } from \"../command\";\n\nexport const exit = new Command()\n\t.setManual({\n\t\tpurpose: \"Quit terminal interface\",\n\t})\n\t.setExecute(function(_args, params) {\n\t\tconst { exit } = params as ExecuteParams;\n\t\texit?.();\n\t\treturn { blank: true };\n\t});"],"names":["exit","Command","_args","params"],"mappings":";AAEO,MAAMA,IAAO,IAAIC,EAAQ,EAC9B,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,SAASC,GAAOC,GAAQ;AAC7B,QAAA,EAAE,MAAAH,EAAS,IAAAG;AACjBH,SAAAA,KAAAA,QAAAA,KACO,EAAE,OAAO;AACjB,CAAC;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { randomFromArray as e } from "@prozilla-os/shared";
|
|
2
|
-
import { C as o } from "./
|
|
2
|
+
import { C as o } from "./main-CXiltWT-.js";
|
|
3
3
|
const t = [
|
|
4
4
|
"Do not be afraid of competition.",
|
|
5
5
|
"An exciting opportunity lies ahead of you.",
|
|
@@ -56,4 +56,4 @@ const t = [
|
|
|
56
56
|
export {
|
|
57
57
|
n as fortune
|
|
58
58
|
};
|
|
59
|
-
//# sourceMappingURL=fortune-
|
|
59
|
+
//# sourceMappingURL=fortune-zyxpnYNP.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fortune-
|
|
1
|
+
{"version":3,"file":"fortune-zyxpnYNP.js","sources":["../../src/core/commands/fortune.ts"],"sourcesContent":["import { randomFromArray } from \"@prozilla-os/shared\";\nimport { Command } from \"../command\";\n\n/**\n * Source: https://github.com/shlomif/fortune-mod/blob/master/fortune-mod/datfiles/fortunes\n */\nconst FORTUNES = [\n\t\"Do not be afraid of competition.\",\n\t\"An exciting opportunity lies ahead of you.\",\n\t\"You love peace.\",\n\t\"Get your mind set... confidence will lead you on.\",\n\t\"You will always be surrounded by true friends.\",\n\t\"Sell your ideas-they have exceptional merit.\",\n\t\"You should be able to undertake and complete anything.\",\n\t\"You are kind and friendly.\",\n\t\"You are wise beyond your years.\",\n\t\"Your ability to juggle many tasks will take you far.\",\n\t\"A routine task will turn into an enchanting adventure.\",\n\t\"Beware of all enterprises that require new clothes.\",\n\t\"Be true to your work, your word, and your friend.\",\n\t\"Goodness is the only investment that never fails.\",\n\t\"A journey of a thousand miles begins with a single step.\",\n\t\"Forget injuries; never forget kindnesses.\",\n\t\"Respect yourself and others will respect you.\",\n\t\"A man cannot be comfortable without his own approval.\",\n\t\"Always do right. This will gratify some people and astonish the rest.\",\n\t\"It is easier to stay out than to get out.\",\n\t\"Sing everyday and chase the mean blues away.\",\n\t\"You will receive money from an unexpected source.\",\n\t\"Attitude is a little thing that makes a big difference.\",\n\t\"Plan for many pleasures ahead.\",\n\t\"Experience is the best teacher.\",\n\t\"You will be happy with your spouse.\",\n\t\"Expect the unexpected.\",\n\t\"Stay healthy. Walk a mile.\",\n\t\"The family that plays together stays together.\",\n\t\"Eat chocolate to have a sweeter life.\",\n\t\"Once you make a decision the universe conspires to make it happen.\",\n\t\"Make yourself necessary to someone.\",\n\t\"The only way to have a friend is to be one.\",\n\t\"Nothing great was ever achieved without enthusiasm.\",\n\t\"Dance as if no one is watching.\",\n\t\"Live this day as if it were your last.\",\n\t\"Your life will be happy and peaceful.\",\n\t\"Reach for joy and all else will follow.\",\n\t\"Move in the direction of your dreams.\",\n\t\"Bloom where you are planted.\",\n\t\"Appreciate. Appreciate. Appreciate.\",\n\t\"Happy News is on its way.\",\n\t\"A closed mouth gathers no feet.\",\n\t\"He who throws dirt is losing ground.\",\n\t\"Borrow money from a pessimist. They don't expect it back.\",\n\t\"Life is what happens to you while you are busy making other plans.\",\n\t\"Help! I'm being held prisoner in a fortune cookie factory.\",\n];\n\nexport const fortune = new Command()\n\t.setManual({\n\t\tpurpose: \"Tell fortune\",\n\t})\n\t.setExecute(function() {\n\t\treturn randomFromArray(FORTUNES);\n\t});"],"names":["FORTUNES","fortune","Command","randomFromArray"],"mappings":";;AAMA,MAAMA,IAAW;AAAA,EAChB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAEaC,IAAU,IAAIC,EAAQ,EACjC,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,WAAW;AACtB,SAAOC,EAAgBH,CAAQ;AAChC,CAAC;"}
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { ANSI as t } from "@prozilla-os/shared";
|
|
2
|
-
import { C as u, f } from "./main-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var m;
|
|
2
|
+
import { C as i, a as u, f } from "./main-CXiltWT-.js";
|
|
3
|
+
const l = new i().setExecute(function(n) {
|
|
4
|
+
var a;
|
|
6
5
|
if ((n == null ? void 0 : n.length) === 0)
|
|
7
6
|
return u.COMMANDS.map((e) => {
|
|
8
|
-
var
|
|
9
|
-
return (
|
|
7
|
+
var m;
|
|
8
|
+
return (m = e.manual) != null && m.purpose ? `${e.name} - ${t.fg.green}${t.decoration.dim}${e.manual.purpose}${t.reset}` : e.name;
|
|
10
9
|
}).sort().join(`
|
|
11
10
|
`);
|
|
12
11
|
const o = n[0].toLowerCase(), r = u.find(o);
|
|
13
|
-
return r ? (
|
|
12
|
+
return r ? (a = r.manual) != null && a.purpose ? r.manual.purpose : f(this.name, `${o}: No manual found`) : f(this.name, `${o}: Command not found`);
|
|
14
13
|
});
|
|
15
14
|
export {
|
|
16
|
-
|
|
15
|
+
l as help
|
|
17
16
|
};
|
|
18
|
-
//# sourceMappingURL=help-
|
|
17
|
+
//# sourceMappingURL=help-BEgNbwLL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"help-BEgNbwLL.js","sources":["../../src/core/commands/help.ts"],"sourcesContent":["import { ANSI } from \"@prozilla-os/shared\";\nimport { formatError } from \"../_utils/terminal.utils\";\nimport { Command } from \"../command\";\nimport { CommandsManager } from \"../commands\";\n\nexport const help = new Command()\n\t.setExecute(function(this: Command, args) {\n\t\tif (args?.length === 0) {\n\t\t\treturn CommandsManager.COMMANDS.map((command) => {\n\t\t\t\tif (command.manual?.purpose) {\n\t\t\t\t\treturn `${command.name} - ${ANSI.fg.green}${ANSI.decoration.dim}${command.manual.purpose}${ANSI.reset}`;\n\t\t\t\t} else {\n\t\t\t\t\treturn command.name;\n\t\t\t\t}\n\t\t\t}).sort().join(\"\\n\");\n\t\t}\n\n\t\tconst commandName = (args as string[])[0].toLowerCase();\n\t\tconst command = CommandsManager.find(commandName);\n\n\t\tif (!command)\n\t\t\treturn formatError(this.name, `${commandName}: Command not found`);\n\n\t\tif (!command.manual?.purpose)\n\t\t\treturn formatError(this.name, `${commandName}: No manual found`);\n\n\t\treturn command.manual.purpose;\n\t});"],"names":["help","Command","args","CommandsManager","command","ANSI","commandName","_a","formatError"],"mappings":";;AAKO,MAAMA,IAAO,IAAIC,EAAA,EACtB,WAAW,SAAwBC,GAAM;;AACrC,OAAAA,KAAA,gBAAAA,EAAM,YAAW;AACpB,WAAOC,EAAgB,SAAS,IAAI,CAACC,MAAY;;AAC5CA,cAAAA,IAAAA,EAAQ,WAARA,QAAAA,EAAgB,UACX,GAAGA,EAAQ,IAAI,MAAMC,EAAK,GAAG,KAAK,GAAGA,EAAK,WAAW,GAAG,GAAGD,EAAQ,OAAO,OAAO,GAAGC,EAAK,KAAK,KAE/FD,EAAQ;AAAA,IAEhB,CAAA,EAAE,KAAK,EAAE,KAAK;AAAA,CAAI;AAGpB,QAAME,IAAeJ,EAAkB,CAAC,EAAE,YAAY,GAChDE,IAAUD,EAAgB,KAAKG,CAAW;AAEhD,SAAKF,KAGAG,IAAAH,EAAQ,WAAR,QAAAG,EAAgB,UAGdH,EAAQ,OAAO,UAFdI,EAAY,KAAK,MAAM,GAAGF,CAAW,mBAAmB,IAHxDE,EAAY,KAAK,MAAM,GAAGF,CAAW,qBAAqB;AAMnE,CAAC;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as n } from "./
|
|
1
|
+
import { C as n } from "./main-CXiltWT-.js";
|
|
2
2
|
const a = new n().setManual({
|
|
3
3
|
purpose: "Display the hostname"
|
|
4
4
|
}).setExecute(function(o, t) {
|
|
@@ -8,4 +8,4 @@ const a = new n().setManual({
|
|
|
8
8
|
export {
|
|
9
9
|
a as hostname
|
|
10
10
|
};
|
|
11
|
-
//# sourceMappingURL=hostname-
|
|
11
|
+
//# sourceMappingURL=hostname-DU1lQde2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hostname-
|
|
1
|
+
{"version":3,"file":"hostname-DU1lQde2.js","sources":["../../src/core/commands/hostname.ts"],"sourcesContent":["import { Command, ExecuteParams } from \"../command\";\n\nexport const hostname = new Command()\n\t.setManual({\n\t\tpurpose: \"Display the hostname\",\n\t})\n\t.setExecute(function(_args, params) {\n\t\tconst { hostname } = params as ExecuteParams;\n\t\treturn hostname;\n\t});"],"names":["hostname","Command","_args","params"],"mappings":";AAEO,MAAMA,IAAW,IAAIC,EAAQ,EAClC,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,SAASC,GAAOC,GAAQ;AAC7B,QAAA,EAAE,UAAAH,EAAa,IAAAG;AACdH,SAAAA;AACR,CAAC;"}
|