@lifo-sh/core 0.1.0

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 (305) hide show
  1. package/dist/archive-D220So0m.js +192 -0
  2. package/dist/args-CG6b9cZt.js +43 -0
  3. package/dist/awk-rMPdpM91.js +118 -0
  4. package/dist/basename-C33A_Zse.js +12 -0
  5. package/dist/bc-BYiKVTNg.js +200 -0
  6. package/dist/cal-DPULSAhj.js +56 -0
  7. package/dist/cat-Crmqa4-2.js +29 -0
  8. package/dist/chmod-CcGyvoCX.js +56 -0
  9. package/dist/chown-CErsnGQX.js +28 -0
  10. package/dist/commands/archive/gunzip.d.ts +4 -0
  11. package/dist/commands/archive/gunzip.d.ts.map +1 -0
  12. package/dist/commands/archive/gzip.d.ts +4 -0
  13. package/dist/commands/archive/gzip.d.ts.map +1 -0
  14. package/dist/commands/archive/tar.d.ts +4 -0
  15. package/dist/commands/archive/tar.d.ts.map +1 -0
  16. package/dist/commands/archive/unzip.d.ts +4 -0
  17. package/dist/commands/archive/unzip.d.ts.map +1 -0
  18. package/dist/commands/archive/zip.d.ts +4 -0
  19. package/dist/commands/archive/zip.d.ts.map +1 -0
  20. package/dist/commands/fs/basename.d.ts +4 -0
  21. package/dist/commands/fs/basename.d.ts.map +1 -0
  22. package/dist/commands/fs/cat.d.ts +4 -0
  23. package/dist/commands/fs/cat.d.ts.map +1 -0
  24. package/dist/commands/fs/chmod.d.ts +4 -0
  25. package/dist/commands/fs/chmod.d.ts.map +1 -0
  26. package/dist/commands/fs/chown.d.ts +4 -0
  27. package/dist/commands/fs/chown.d.ts.map +1 -0
  28. package/dist/commands/fs/cp.d.ts +4 -0
  29. package/dist/commands/fs/cp.d.ts.map +1 -0
  30. package/dist/commands/fs/df.d.ts +4 -0
  31. package/dist/commands/fs/df.d.ts.map +1 -0
  32. package/dist/commands/fs/dirname.d.ts +4 -0
  33. package/dist/commands/fs/dirname.d.ts.map +1 -0
  34. package/dist/commands/fs/du.d.ts +4 -0
  35. package/dist/commands/fs/du.d.ts.map +1 -0
  36. package/dist/commands/fs/file.d.ts +4 -0
  37. package/dist/commands/fs/file.d.ts.map +1 -0
  38. package/dist/commands/fs/find.d.ts +4 -0
  39. package/dist/commands/fs/find.d.ts.map +1 -0
  40. package/dist/commands/fs/ln.d.ts +4 -0
  41. package/dist/commands/fs/ln.d.ts.map +1 -0
  42. package/dist/commands/fs/ls.d.ts +4 -0
  43. package/dist/commands/fs/ls.d.ts.map +1 -0
  44. package/dist/commands/fs/mkdir.d.ts +4 -0
  45. package/dist/commands/fs/mkdir.d.ts.map +1 -0
  46. package/dist/commands/fs/mktemp.d.ts +4 -0
  47. package/dist/commands/fs/mktemp.d.ts.map +1 -0
  48. package/dist/commands/fs/mv.d.ts +4 -0
  49. package/dist/commands/fs/mv.d.ts.map +1 -0
  50. package/dist/commands/fs/realpath.d.ts +4 -0
  51. package/dist/commands/fs/realpath.d.ts.map +1 -0
  52. package/dist/commands/fs/rm.d.ts +4 -0
  53. package/dist/commands/fs/rm.d.ts.map +1 -0
  54. package/dist/commands/fs/rmdir.d.ts +4 -0
  55. package/dist/commands/fs/rmdir.d.ts.map +1 -0
  56. package/dist/commands/fs/stat.d.ts +4 -0
  57. package/dist/commands/fs/stat.d.ts.map +1 -0
  58. package/dist/commands/fs/touch.d.ts +4 -0
  59. package/dist/commands/fs/touch.d.ts.map +1 -0
  60. package/dist/commands/fs/tree.d.ts +4 -0
  61. package/dist/commands/fs/tree.d.ts.map +1 -0
  62. package/dist/commands/index.d.ts +3 -0
  63. package/dist/commands/index.d.ts.map +1 -0
  64. package/dist/commands/io/printf.d.ts +4 -0
  65. package/dist/commands/io/printf.d.ts.map +1 -0
  66. package/dist/commands/io/tee.d.ts +4 -0
  67. package/dist/commands/io/tee.d.ts.map +1 -0
  68. package/dist/commands/io/xargs.d.ts +4 -0
  69. package/dist/commands/io/xargs.d.ts.map +1 -0
  70. package/dist/commands/io/yes.d.ts +4 -0
  71. package/dist/commands/io/yes.d.ts.map +1 -0
  72. package/dist/commands/net/curl.d.ts +6 -0
  73. package/dist/commands/net/curl.d.ts.map +1 -0
  74. package/dist/commands/net/dig.d.ts +4 -0
  75. package/dist/commands/net/dig.d.ts.map +1 -0
  76. package/dist/commands/net/ping.d.ts +4 -0
  77. package/dist/commands/net/ping.d.ts.map +1 -0
  78. package/dist/commands/net/wget.d.ts +4 -0
  79. package/dist/commands/net/wget.d.ts.map +1 -0
  80. package/dist/commands/registry.d.ts +13 -0
  81. package/dist/commands/registry.d.ts.map +1 -0
  82. package/dist/commands/system/bc.d.ts +4 -0
  83. package/dist/commands/system/bc.d.ts.map +1 -0
  84. package/dist/commands/system/cal.d.ts +4 -0
  85. package/dist/commands/system/cal.d.ts.map +1 -0
  86. package/dist/commands/system/date.d.ts +4 -0
  87. package/dist/commands/system/date.d.ts.map +1 -0
  88. package/dist/commands/system/env.d.ts +4 -0
  89. package/dist/commands/system/env.d.ts.map +1 -0
  90. package/dist/commands/system/free.d.ts +4 -0
  91. package/dist/commands/system/free.d.ts.map +1 -0
  92. package/dist/commands/system/help.d.ts +4 -0
  93. package/dist/commands/system/help.d.ts.map +1 -0
  94. package/dist/commands/system/hostname.d.ts +4 -0
  95. package/dist/commands/system/hostname.d.ts.map +1 -0
  96. package/dist/commands/system/kill.d.ts +4 -0
  97. package/dist/commands/system/kill.d.ts.map +1 -0
  98. package/dist/commands/system/man.d.ts +4 -0
  99. package/dist/commands/system/man.d.ts.map +1 -0
  100. package/dist/commands/system/node.d.ts +6 -0
  101. package/dist/commands/system/node.d.ts.map +1 -0
  102. package/dist/commands/system/pkg.d.ts +4 -0
  103. package/dist/commands/system/pkg.d.ts.map +1 -0
  104. package/dist/commands/system/ps.d.ts +4 -0
  105. package/dist/commands/system/ps.d.ts.map +1 -0
  106. package/dist/commands/system/sleep.d.ts +4 -0
  107. package/dist/commands/system/sleep.d.ts.map +1 -0
  108. package/dist/commands/system/top.d.ts +4 -0
  109. package/dist/commands/system/top.d.ts.map +1 -0
  110. package/dist/commands/system/uname.d.ts +4 -0
  111. package/dist/commands/system/uname.d.ts.map +1 -0
  112. package/dist/commands/system/uptime.d.ts +4 -0
  113. package/dist/commands/system/uptime.d.ts.map +1 -0
  114. package/dist/commands/system/watch.d.ts +4 -0
  115. package/dist/commands/system/watch.d.ts.map +1 -0
  116. package/dist/commands/system/which.d.ts +4 -0
  117. package/dist/commands/system/which.d.ts.map +1 -0
  118. package/dist/commands/system/whoami.d.ts +4 -0
  119. package/dist/commands/system/whoami.d.ts.map +1 -0
  120. package/dist/commands/text/awk.d.ts +4 -0
  121. package/dist/commands/text/awk.d.ts.map +1 -0
  122. package/dist/commands/text/cut.d.ts +4 -0
  123. package/dist/commands/text/cut.d.ts.map +1 -0
  124. package/dist/commands/text/diff.d.ts +4 -0
  125. package/dist/commands/text/diff.d.ts.map +1 -0
  126. package/dist/commands/text/grep.d.ts +4 -0
  127. package/dist/commands/text/grep.d.ts.map +1 -0
  128. package/dist/commands/text/head.d.ts +4 -0
  129. package/dist/commands/text/head.d.ts.map +1 -0
  130. package/dist/commands/text/nl.d.ts +4 -0
  131. package/dist/commands/text/nl.d.ts.map +1 -0
  132. package/dist/commands/text/rev.d.ts +4 -0
  133. package/dist/commands/text/rev.d.ts.map +1 -0
  134. package/dist/commands/text/sed.d.ts +4 -0
  135. package/dist/commands/text/sed.d.ts.map +1 -0
  136. package/dist/commands/text/sort.d.ts +4 -0
  137. package/dist/commands/text/sort.d.ts.map +1 -0
  138. package/dist/commands/text/tail.d.ts +4 -0
  139. package/dist/commands/text/tail.d.ts.map +1 -0
  140. package/dist/commands/text/tr.d.ts +4 -0
  141. package/dist/commands/text/tr.d.ts.map +1 -0
  142. package/dist/commands/text/uniq.d.ts +4 -0
  143. package/dist/commands/text/uniq.d.ts.map +1 -0
  144. package/dist/commands/text/wc.d.ts +4 -0
  145. package/dist/commands/text/wc.d.ts.map +1 -0
  146. package/dist/commands/types.d.ts +20 -0
  147. package/dist/commands/types.d.ts.map +1 -0
  148. package/dist/cp-CpjwiLUF.js +19 -0
  149. package/dist/cut-GfN8py4j.js +60 -0
  150. package/dist/date-C8NB8v8G.js +86 -0
  151. package/dist/df-CeZb4WOr.js +34 -0
  152. package/dist/diff-2wbVWmCT.js +129 -0
  153. package/dist/dig-BEJ8Ky96.js +69 -0
  154. package/dist/dirname-C5L53RA2.js +13 -0
  155. package/dist/du-B0shJpEL.js +77 -0
  156. package/dist/env-DXzvDKsN.js +9 -0
  157. package/dist/file-C2epVYvH.js +70 -0
  158. package/dist/find-DA-rpvsC.js +36 -0
  159. package/dist/free-DAxE4b2U.js +23 -0
  160. package/dist/grep-Bynq2w2E.js +140 -0
  161. package/dist/gunzip-B9b1Vph1.js +48 -0
  162. package/dist/gzip-CkXnPp5J.js +58 -0
  163. package/dist/head-DZJVLF1k.js +48 -0
  164. package/dist/hostname-BxU2S3nT.js +8 -0
  165. package/dist/index-Be1wosKt.js +6028 -0
  166. package/dist/index.d.ts +25 -0
  167. package/dist/index.d.ts.map +1 -0
  168. package/dist/index.js +51 -0
  169. package/dist/kernel/index.d.ts +25 -0
  170. package/dist/kernel/index.d.ts.map +1 -0
  171. package/dist/kernel/persistence/PersistenceManager.d.ts +10 -0
  172. package/dist/kernel/persistence/PersistenceManager.d.ts.map +1 -0
  173. package/dist/kernel/persistence/serializer.d.ts +13 -0
  174. package/dist/kernel/persistence/serializer.d.ts.map +1 -0
  175. package/dist/kernel/samples.d.ts +3 -0
  176. package/dist/kernel/samples.d.ts.map +1 -0
  177. package/dist/kernel/vfs/VFS.d.ts +36 -0
  178. package/dist/kernel/vfs/VFS.d.ts.map +1 -0
  179. package/dist/kernel/vfs/index.d.ts +4 -0
  180. package/dist/kernel/vfs/index.d.ts.map +1 -0
  181. package/dist/kernel/vfs/providers/DevProvider.d.ts +11 -0
  182. package/dist/kernel/vfs/providers/DevProvider.d.ts.map +1 -0
  183. package/dist/kernel/vfs/providers/ProcProvider.d.ts +14 -0
  184. package/dist/kernel/vfs/providers/ProcProvider.d.ts.map +1 -0
  185. package/dist/kernel/vfs/types.d.ts +43 -0
  186. package/dist/kernel/vfs/types.d.ts.map +1 -0
  187. package/dist/ln-Bf3f3jVA.js +11 -0
  188. package/dist/ls-CSeazevv.js +106 -0
  189. package/dist/man-CJ5pI0_W.js +122 -0
  190. package/dist/mkdir-B7p8krsP.js +27 -0
  191. package/dist/mktemp-88Nhvd7h.js +31 -0
  192. package/dist/mv-DRVvz9oK.js +19 -0
  193. package/dist/nl-G2vK3rR3.js +48 -0
  194. package/dist/node-compat/buffer.d.ts +17 -0
  195. package/dist/node-compat/buffer.d.ts.map +1 -0
  196. package/dist/node-compat/child_process.d.ts +10 -0
  197. package/dist/node-compat/child_process.d.ts.map +1 -0
  198. package/dist/node-compat/console.d.ts +21 -0
  199. package/dist/node-compat/console.d.ts.map +1 -0
  200. package/dist/node-compat/crypto.d.ts +17 -0
  201. package/dist/node-compat/crypto.d.ts.map +1 -0
  202. package/dist/node-compat/events.d.ts +19 -0
  203. package/dist/node-compat/events.d.ts.map +1 -0
  204. package/dist/node-compat/fs.d.ts +113 -0
  205. package/dist/node-compat/fs.d.ts.map +1 -0
  206. package/dist/node-compat/http.d.ts +87 -0
  207. package/dist/node-compat/http.d.ts.map +1 -0
  208. package/dist/node-compat/index.d.ts +19 -0
  209. package/dist/node-compat/index.d.ts.map +1 -0
  210. package/dist/node-compat/os.d.ts +39 -0
  211. package/dist/node-compat/os.d.ts.map +1 -0
  212. package/dist/node-compat/path.d.ts +58 -0
  213. package/dist/node-compat/path.d.ts.map +1 -0
  214. package/dist/node-compat/process.d.ts +62 -0
  215. package/dist/node-compat/process.d.ts.map +1 -0
  216. package/dist/node-compat/stream.d.ts +36 -0
  217. package/dist/node-compat/stream.d.ts.map +1 -0
  218. package/dist/node-compat/timers.d.ts +16 -0
  219. package/dist/node-compat/timers.d.ts.map +1 -0
  220. package/dist/node-compat/url.d.ts +53 -0
  221. package/dist/node-compat/url.d.ts.map +1 -0
  222. package/dist/node-compat/util.d.ts +27 -0
  223. package/dist/node-compat/util.d.ts.map +1 -0
  224. package/dist/ping-DtVEwwda.js +50 -0
  225. package/dist/pkg/PackageManager.d.ts +19 -0
  226. package/dist/pkg/PackageManager.d.ts.map +1 -0
  227. package/dist/pkg/loader.d.ts +4 -0
  228. package/dist/pkg/loader.d.ts.map +1 -0
  229. package/dist/printf-Cc2o7KZx.js +70 -0
  230. package/dist/realpath-C-kisl-F.js +24 -0
  231. package/dist/rev-9puwegeh.js +34 -0
  232. package/dist/rm-BXSq9iqP.js +37 -0
  233. package/dist/rmdir-CWgZ6q8D.js +35 -0
  234. package/dist/sandbox/HeadlessTerminal.d.ts +17 -0
  235. package/dist/sandbox/HeadlessTerminal.d.ts.map +1 -0
  236. package/dist/sandbox/Sandbox.d.ts +36 -0
  237. package/dist/sandbox/Sandbox.d.ts.map +1 -0
  238. package/dist/sandbox/SandboxCommands.d.ts +18 -0
  239. package/dist/sandbox/SandboxCommands.d.ts.map +1 -0
  240. package/dist/sandbox/SandboxFs.d.ts +38 -0
  241. package/dist/sandbox/SandboxFs.d.ts.map +1 -0
  242. package/dist/sandbox/index.d.ts +3 -0
  243. package/dist/sandbox/index.d.ts.map +1 -0
  244. package/dist/sandbox/types.d.ts +72 -0
  245. package/dist/sandbox/types.d.ts.map +1 -0
  246. package/dist/sed-BRxd2DlZ.js +90 -0
  247. package/dist/shell/Shell.d.ts +84 -0
  248. package/dist/shell/Shell.d.ts.map +1 -0
  249. package/dist/shell/completer.d.ts +19 -0
  250. package/dist/shell/completer.d.ts.map +1 -0
  251. package/dist/shell/expander.d.ts +20 -0
  252. package/dist/shell/expander.d.ts.map +1 -0
  253. package/dist/shell/history.d.ts +22 -0
  254. package/dist/shell/history.d.ts.map +1 -0
  255. package/dist/shell/interpreter.d.ts +67 -0
  256. package/dist/shell/interpreter.d.ts.map +1 -0
  257. package/dist/shell/jobs.d.ts +21 -0
  258. package/dist/shell/jobs.d.ts.map +1 -0
  259. package/dist/shell/lexer.d.ts +3 -0
  260. package/dist/shell/lexer.d.ts.map +1 -0
  261. package/dist/shell/parser.d.ts +7 -0
  262. package/dist/shell/parser.d.ts.map +1 -0
  263. package/dist/shell/pipe.d.ts +12 -0
  264. package/dist/shell/pipe.d.ts.map +1 -0
  265. package/dist/shell/terminal-stdin.d.ts +22 -0
  266. package/dist/shell/terminal-stdin.d.ts.map +1 -0
  267. package/dist/shell/test-builtin.d.ts +8 -0
  268. package/dist/shell/test-builtin.d.ts.map +1 -0
  269. package/dist/shell/types.d.ts +109 -0
  270. package/dist/shell/types.d.ts.map +1 -0
  271. package/dist/sleep-B4C3fZiR.js +19 -0
  272. package/dist/sort-B7K83hAD.js +59 -0
  273. package/dist/stat-C0qs7xMV.js +29 -0
  274. package/dist/tail-CYBTYnn3.js +47 -0
  275. package/dist/tar-mMS7gfb-.js +121 -0
  276. package/dist/tee-B8bXFHbI.js +17 -0
  277. package/dist/terminal/Terminal.d.ts +13 -0
  278. package/dist/terminal/Terminal.d.ts.map +1 -0
  279. package/dist/touch-CdAHKfLv.js +23 -0
  280. package/dist/tr-DsCiwSIu.js +60 -0
  281. package/dist/tree-BiWLXiUu.js +46 -0
  282. package/dist/uname-BCn8HlJD.js +37 -0
  283. package/dist/uniq-BZMOwoCc.js +51 -0
  284. package/dist/unzip-DP4I991d.js +82 -0
  285. package/dist/uptime-CgBJegqU.js +8 -0
  286. package/dist/utils/archive.d.ts +22 -0
  287. package/dist/utils/archive.d.ts.map +1 -0
  288. package/dist/utils/args.d.ts +12 -0
  289. package/dist/utils/args.d.ts.map +1 -0
  290. package/dist/utils/colors.d.ts +27 -0
  291. package/dist/utils/colors.d.ts.map +1 -0
  292. package/dist/utils/encoding.d.ts +4 -0
  293. package/dist/utils/encoding.d.ts.map +1 -0
  294. package/dist/utils/glob.d.ts +12 -0
  295. package/dist/utils/glob.d.ts.map +1 -0
  296. package/dist/utils/path.d.ts +12 -0
  297. package/dist/utils/path.d.ts.map +1 -0
  298. package/dist/wc-CpE5K4ZI.js +60 -0
  299. package/dist/wget-DIPI0-I3.js +53 -0
  300. package/dist/which-D3u0cwyh.js +105 -0
  301. package/dist/whoami-B1237V5e.js +8 -0
  302. package/dist/xargs-DfbCRFFd.js +35 -0
  303. package/dist/yes-DXEyHHD2.js +10 -0
  304. package/dist/zip-B_gQ6LXC.js +34 -0
  305. package/package.json +34 -0
@@ -0,0 +1,25 @@
1
+ export { Sandbox } from './sandbox/index.js';
2
+ export type { SandboxOptions, RunOptions, CommandResult, SandboxCommands, SandboxFs, } from './sandbox/index.js';
3
+ export { Kernel } from './kernel/index.js';
4
+ export type { VirtualRequest, VirtualResponse, VirtualRequestHandler } from './kernel/index.js';
5
+ export { VFS, VFSError, ErrorCode } from './kernel/vfs/index.js';
6
+ export type { INode, Stat, Dirent, FileType, ErrorCodeType, VirtualProvider, } from './kernel/vfs/index.js';
7
+ export { CommandRegistry, createDefaultRegistry } from './commands/registry.js';
8
+ export type { Command, CommandContext, CommandOutputStream, CommandInputStream, } from './commands/types.js';
9
+ export { createPkgCommand } from './commands/system/pkg.js';
10
+ export { createPsCommand } from './commands/system/ps.js';
11
+ export { createTopCommand } from './commands/system/top.js';
12
+ export { createKillCommand } from './commands/system/kill.js';
13
+ export { createWatchCommand } from './commands/system/watch.js';
14
+ export { createHelpCommand } from './commands/system/help.js';
15
+ export { createNodeCommand } from './commands/system/node.js';
16
+ export { createCurlCommand } from './commands/net/curl.js';
17
+ export { Shell } from './shell/Shell.js';
18
+ export { JobTable } from './shell/jobs.js';
19
+ export { Terminal } from './terminal/Terminal.js';
20
+ export { PackageManager } from './pkg/PackageManager.js';
21
+ export { loadInstalledPackages } from './pkg/loader.js';
22
+ export { createModuleMap, ProcessExitError } from './node-compat/index.js';
23
+ export type { NodeContext } from './node-compat/index.js';
24
+ export { RESET, BOLD, DIM, ITALIC, UNDERLINE, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, BRIGHT_RED, BRIGHT_GREEN, BRIGHT_YELLOW, BRIGHT_BLUE, BRIGHT_MAGENTA, BRIGHT_CYAN, red, green, yellow, blue, magenta, cyan, bold, dim, } from './utils/colors.js';
25
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,YAAY,EACV,cAAc,EACd,UAAU,EACV,aAAa,EACb,eAAe,EACf,SAAS,GACV,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAGhG,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACjE,YAAY,EACV,KAAK,EACL,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,aAAa,EACb,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAChF,YAAY,EACV,OAAO,EACP,cAAc,EACd,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAG3D,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAG3C,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAGlD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAGxD,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC3E,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAG1D,OAAO,EACL,KAAK,EACL,IAAI,EACJ,GAAG,EACH,MAAM,EACN,SAAS,EACT,GAAG,EACH,KAAK,EACL,MAAM,EACN,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,KAAK,EACL,UAAU,EACV,YAAY,EACZ,aAAa,EACb,WAAW,EACX,cAAc,EACd,WAAW,EACX,GAAG,EACH,KAAK,EACL,MAAM,EACN,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,GAAG,GACJ,MAAM,mBAAmB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,51 @@
1
+ import { a as e, B as r, i as o, j as m, k as E, l, m as t, n as d, C as n, o as c, D as C, E as R, G as T, I, J as G, K as B, M as L, P as N, p as H, q as g, R as A, S as i, s as D, T as M, U as _, t as P, V as S, W as b, Y as p, u, v as y, w as W, x as Y, y as k, z as x, A as O, F as U, H as F, L as K, N as V, O as f, Q as h, X as w, Z as J, _ as j, $ as q, a0 as v, a1 as z } from "./index-Be1wosKt.js";
2
+ export {
3
+ e as BLUE,
4
+ r as BOLD,
5
+ o as BRIGHT_BLUE,
6
+ m as BRIGHT_CYAN,
7
+ E as BRIGHT_GREEN,
8
+ l as BRIGHT_MAGENTA,
9
+ t as BRIGHT_RED,
10
+ d as BRIGHT_YELLOW,
11
+ n as CYAN,
12
+ c as CommandRegistry,
13
+ C as DIM,
14
+ R as ErrorCode,
15
+ T as GREEN,
16
+ I as ITALIC,
17
+ G as JobTable,
18
+ B as Kernel,
19
+ L as MAGENTA,
20
+ N as PackageManager,
21
+ H as ProcessExitError,
22
+ g as RED,
23
+ A as RESET,
24
+ i as Sandbox,
25
+ D as Shell,
26
+ M as Terminal,
27
+ _ as UNDERLINE,
28
+ P as VFS,
29
+ S as VFSError,
30
+ b as WHITE,
31
+ p as YELLOW,
32
+ u as blue,
33
+ y as bold,
34
+ W as createCurlCommand,
35
+ Y as createDefaultRegistry,
36
+ k as createHelpCommand,
37
+ x as createKillCommand,
38
+ O as createModuleMap,
39
+ U as createNodeCommand,
40
+ F as createPkgCommand,
41
+ K as createPsCommand,
42
+ V as createTopCommand,
43
+ f as createWatchCommand,
44
+ h as cyan,
45
+ w as dim,
46
+ J as green,
47
+ j as loadInstalledPackages,
48
+ q as magenta,
49
+ v as red,
50
+ z as yellow
51
+ };
@@ -0,0 +1,25 @@
1
+ import { VFS } from './vfs/index.js';
2
+ export interface VirtualRequest {
3
+ method: string;
4
+ url: string;
5
+ headers: Record<string, string>;
6
+ body: string;
7
+ }
8
+ export interface VirtualResponse {
9
+ statusCode: number;
10
+ headers: Record<string, string>;
11
+ body: string;
12
+ }
13
+ export type VirtualRequestHandler = (req: VirtualRequest, res: VirtualResponse) => void;
14
+ export declare class Kernel {
15
+ vfs: VFS;
16
+ portRegistry: Map<number, VirtualRequestHandler>;
17
+ private persistence;
18
+ constructor();
19
+ boot(options?: {
20
+ persist?: boolean;
21
+ }): Promise<void>;
22
+ initFilesystem(): void;
23
+ getDefaultEnv(): Record<string, string>;
24
+ }
25
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/kernel/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AA+BrC,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,qBAAqB,GAAG,CAAC,GAAG,EAAE,cAAc,EAAE,GAAG,EAAE,eAAe,KAAK,IAAI,CAAC;AAExF,qBAAa,MAAM;IACjB,GAAG,EAAE,GAAG,CAAC;IACT,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAa;IAC7D,OAAO,CAAC,WAAW,CAAqB;;IAOlC,IAAI,CAAC,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IA2B1D,cAAc,IAAI,IAAI;IAwCtB,aAAa,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;CAWxC"}
@@ -0,0 +1,10 @@
1
+ import { INode } from '../vfs/types.js';
2
+ export declare class PersistenceManager {
3
+ private db;
4
+ private timer;
5
+ open(): Promise<void>;
6
+ load(): Promise<INode | null>;
7
+ save(root: INode): Promise<void>;
8
+ scheduleSave(root: INode): void;
9
+ }
10
+ //# sourceMappingURL=PersistenceManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PersistenceManager.d.ts","sourceRoot":"","sources":["../../../src/kernel/persistence/PersistenceManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAQ7C,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,EAAE,CAA4B;IACtC,OAAO,CAAC,KAAK,CAA8C;IAErD,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAuBrB,IAAI,IAAI,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;IA6B7B,IAAI,CAAC,IAAI,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC;IAkBtC,YAAY,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI;CAShC"}
@@ -0,0 +1,13 @@
1
+ import { INode } from '../vfs/types.js';
2
+ export interface SerializedNode {
3
+ t: 'f' | 'd';
4
+ n: string;
5
+ d?: string;
6
+ c?: SerializedNode[];
7
+ ct: number;
8
+ mt: number;
9
+ m: number;
10
+ }
11
+ export declare function serialize(root: INode): SerializedNode;
12
+ export declare function deserialize(data: SerializedNode): INode;
13
+ //# sourceMappingURL=serializer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serializer.d.ts","sourceRoot":"","sources":["../../../src/kernel/persistence/serializer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,WAAW,cAAc;IAC7B,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,CAAC,EAAE,MAAM,CAAC;CACX;AAqBD,wBAAgB,SAAS,CAAC,IAAI,EAAE,KAAK,GAAG,cAAc,CAErD;AAqCD,wBAAgB,WAAW,CAAC,IAAI,EAAE,cAAc,GAAG,KAAK,CAEvD"}
@@ -0,0 +1,3 @@
1
+ import { VFS } from './vfs/index.js';
2
+ export declare function installSamples(vfs: VFS): void;
3
+ //# sourceMappingURL=samples.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"samples.d.ts","sourceRoot":"","sources":["../../src/kernel/samples.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAE1C,wBAAgB,cAAc,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAmB7C"}
@@ -0,0 +1,36 @@
1
+ import { INode, Stat, Dirent, VirtualProvider } from './types.js';
2
+ export declare class VFS {
3
+ private root;
4
+ private virtualProviders;
5
+ onChange?: () => void;
6
+ constructor();
7
+ registerProvider(prefix: string, provider: VirtualProvider): void;
8
+ getRoot(): INode;
9
+ loadFromSerialized(root: INode): void;
10
+ private getProvider;
11
+ private createNode;
12
+ private resolveNode;
13
+ private resolveParent;
14
+ private toAbsolute;
15
+ readFile(path: string): Uint8Array;
16
+ readFileString(path: string): string;
17
+ writeFile(path: string, content: string | Uint8Array): void;
18
+ appendFile(path: string, content: string | Uint8Array): void;
19
+ exists(path: string): boolean;
20
+ stat(path: string): Stat;
21
+ unlink(path: string): void;
22
+ rename(oldPath: string, newPath: string): void;
23
+ copyFile(src: string, dest: string): void;
24
+ touch(path: string): void;
25
+ mkdir(path: string, options?: {
26
+ recursive?: boolean;
27
+ }): void;
28
+ rmdir(path: string): void;
29
+ readdir(path: string): Dirent[];
30
+ readdirStat(path: string): Array<Dirent & Stat>;
31
+ /**
32
+ * Recursively remove a directory and all its contents.
33
+ */
34
+ rmdirRecursive(path: string): void;
35
+ }
36
+ //# sourceMappingURL=VFS.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VFS.d.ts","sourceRoot":"","sources":["../../../src/kernel/vfs/VFS.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAuB,eAAe,EAAE,MAAM,YAAY,CAAC;AAEvF,qBAAa,GAAG;IACd,OAAO,CAAC,IAAI,CAAQ;IACpB,OAAO,CAAC,gBAAgB,CAAsC;IAC9D,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;;IAMtB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,GAAG,IAAI;IAIjE,OAAO,IAAI,KAAK;IAIhB,kBAAkB,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI;IAIrC,OAAO,CAAC,WAAW;IAanB,OAAO,CAAC,UAAU;IAalB,OAAO,CAAC,WAAW;IAqBnB,OAAO,CAAC,aAAa;IAarB,OAAO,CAAC,UAAU;IAMlB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU;IAWlC,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAOpC,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI;IA6B3D,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI;IAsB5D,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAY7B,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAcxB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAe1B,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAgB9C,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAUzC,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAgBzB,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI;IA+B5D,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAkBzB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE;IA2B/B,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC;IAyB/C;;OAEG;IACH,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;CAiBnC"}
@@ -0,0 +1,4 @@
1
+ export { VFS } from './VFS.js';
2
+ export { VFSError, ErrorCode } from './types.js';
3
+ export type { INode, Stat, Dirent, FileType, ErrorCodeType, VirtualProvider } from './types.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/kernel/vfs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACjD,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { VirtualProvider, Stat, Dirent } from '../types.js';
2
+ export declare class DevProvider implements VirtualProvider {
3
+ private clipboardCache;
4
+ readFile(subpath: string): Uint8Array;
5
+ readFileString(subpath: string): string;
6
+ writeFile(subpath: string, content: string | Uint8Array): void;
7
+ exists(subpath: string): boolean;
8
+ stat(subpath: string): Stat;
9
+ readdir(subpath: string): Dirent[];
10
+ }
11
+ //# sourceMappingURL=DevProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DevProvider.d.ts","sourceRoot":"","sources":["../../../../src/kernel/vfs/providers/DevProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAMjE,qBAAa,WAAY,YAAW,eAAe;IACjD,OAAO,CAAC,cAAc,CAAM;IAE5B,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU;IAuBrC,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAuBvC,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI;IAuB9D,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAMhC,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAY3B,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE;CAOnC"}
@@ -0,0 +1,14 @@
1
+ import { VirtualProvider, Stat, Dirent } from '../types.js';
2
+ export declare class ProcProvider implements VirtualProvider {
3
+ private generators;
4
+ constructor();
5
+ private isNetPath;
6
+ private getNetInfo;
7
+ private generate;
8
+ readFile(subpath: string): Uint8Array;
9
+ readFileString(subpath: string): string;
10
+ exists(subpath: string): boolean;
11
+ stat(subpath: string): Stat;
12
+ readdir(subpath: string): Dirent[];
13
+ }
14
+ //# sourceMappingURL=ProcProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProcProvider.d.ts","sourceRoot":"","sources":["../../../../src/kernel/vfs/providers/ProcProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAIjE,qBAAa,YAAa,YAAW,eAAe;IAClD,OAAO,CAAC,UAAU,CAAmC;;IAqDrD,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,UAAU;IAgBlB,OAAO,CAAC,QAAQ;IAehB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU;IAIrC,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAIvC,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAOhC,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAmB3B,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE;CAgBnC"}
@@ -0,0 +1,43 @@
1
+ export type FileType = 'file' | 'directory';
2
+ export interface INode {
3
+ type: FileType;
4
+ name: string;
5
+ data: Uint8Array;
6
+ children: Map<string, INode>;
7
+ ctime: number;
8
+ mtime: number;
9
+ mode: number;
10
+ }
11
+ export interface Stat {
12
+ type: FileType;
13
+ size: number;
14
+ ctime: number;
15
+ mtime: number;
16
+ mode: number;
17
+ }
18
+ export interface Dirent {
19
+ name: string;
20
+ type: FileType;
21
+ }
22
+ export declare const ErrorCode: {
23
+ readonly ENOENT: "ENOENT";
24
+ readonly EEXIST: "EEXIST";
25
+ readonly ENOTDIR: "ENOTDIR";
26
+ readonly EISDIR: "EISDIR";
27
+ readonly ENOTEMPTY: "ENOTEMPTY";
28
+ readonly EINVAL: "EINVAL";
29
+ };
30
+ export type ErrorCodeType = (typeof ErrorCode)[keyof typeof ErrorCode];
31
+ export interface VirtualProvider {
32
+ readFile(subpath: string): Uint8Array;
33
+ readFileString(subpath: string): string;
34
+ writeFile?(subpath: string, content: string | Uint8Array): void;
35
+ exists(subpath: string): boolean;
36
+ stat(subpath: string): Stat;
37
+ readdir(subpath: string): Dirent[];
38
+ }
39
+ export declare class VFSError extends Error {
40
+ code: ErrorCodeType;
41
+ constructor(code: ErrorCodeType, message: string);
42
+ }
43
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/kernel/vfs/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAC;AAE5C,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED,eAAO,MAAM,SAAS;;;;;;;CAOZ,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;AAEvE,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,CAAC;IACtC,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IACxC,SAAS,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAAC;IAChE,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;IACjC,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CACpC;AAED,qBAAa,QAAS,SAAQ,KAAK;IACjC,IAAI,EAAE,aAAa,CAAC;gBAER,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM;CAKjD"}
@@ -0,0 +1,11 @@
1
+ const s = async (r) => {
2
+ let e = !1;
3
+ for (const n of r.args)
4
+ n === "-s" && (e = !0);
5
+ return e ? r.stderr.write(`ln: symbolic links are not supported in Lifo VFS
6
+ `) : r.stderr.write(`ln: hard links are not supported in Lifo VFS
7
+ `), 1;
8
+ };
9
+ export {
10
+ s as default
11
+ };
@@ -0,0 +1,106 @@
1
+ import { p as h } from "./args-CG6b9cZt.js";
2
+ import { r as m, V as d, B as w, a as y, R as $ } from "./index-Be1wosKt.js";
3
+ const S = {
4
+ long: { type: "boolean", short: "l" },
5
+ all: { type: "boolean", short: "a" },
6
+ one: { type: "boolean", short: "1" }
7
+ };
8
+ function D(t, e) {
9
+ const r = e ? "d" : "-", a = [
10
+ t & 256 ? "r" : "-",
11
+ t & 128 ? "w" : "-",
12
+ t & 64 ? "x" : "-",
13
+ t & 32 ? "r" : "-",
14
+ t & 16 ? "w" : "-",
15
+ t & 8 ? "x" : "-",
16
+ t & 4 ? "r" : "-",
17
+ t & 2 ? "w" : "-",
18
+ t & 1 ? "x" : "-"
19
+ ].join("");
20
+ return r + a;
21
+ }
22
+ function E(t) {
23
+ const e = new Date(t), a = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"][e.getMonth()], i = String(e.getDate()).padStart(2, " "), s = String(e.getHours()).padStart(2, "0"), f = String(e.getMinutes()).padStart(2, "0");
24
+ return `${a} ${i} ${s}:${f}`;
25
+ }
26
+ function g(t, e) {
27
+ const r = t.type === "directory" ? `${w}${y}${t.name}${$}` : t.name;
28
+ if (e) {
29
+ const a = D(t.mode, t.type === "directory"), i = String(t.size).padStart(6, " "), s = E(t.mtime);
30
+ return `${a} 1 user user ${i} ${s} ${r}
31
+ `;
32
+ }
33
+ return r;
34
+ }
35
+ function M(t, e, r) {
36
+ const a = r.vfs.readdirStat(t), i = e.all ? a : a.filter((s) => !s.name.startsWith("."));
37
+ return i.sort((s, f) => s.name.localeCompare(f.name)), i;
38
+ }
39
+ const z = async (t) => {
40
+ const { flags: e, positional: r } = h(t.args, S), a = r.length > 0 ? r : [t.cwd];
41
+ let i = 0;
42
+ const s = [], f = [];
43
+ for (const o of a) {
44
+ const c = m(t.cwd, o);
45
+ try {
46
+ const n = t.vfs.stat(c);
47
+ n.type === "file" ? s.push({
48
+ name: o,
49
+ type: n.type,
50
+ size: n.size,
51
+ mtime: n.mtime,
52
+ mode: n.mode
53
+ }) : f.push(o);
54
+ } catch (n) {
55
+ if (n instanceof d)
56
+ t.stderr.write(`ls: ${n.message}
57
+ `), i = 1;
58
+ else
59
+ throw n;
60
+ }
61
+ }
62
+ if (s.length > 0)
63
+ if (e.long)
64
+ for (const o of s)
65
+ t.stdout.write(g(o, !0));
66
+ else if (e.one)
67
+ for (const o of s)
68
+ t.stdout.write(g(o, !1) + `
69
+ `);
70
+ else {
71
+ const o = s.map((c) => g(c, !1));
72
+ t.stdout.write(o.join(" ") + `
73
+ `);
74
+ }
75
+ for (let o = 0; o < f.length; o++) {
76
+ const c = f[o], n = m(t.cwd, c);
77
+ (f.length > 1 || s.length > 0) && ((s.length > 0 || o > 0) && t.stdout.write(`
78
+ `), t.stdout.write(`${c}:
79
+ `));
80
+ try {
81
+ const l = M(n, e, t);
82
+ if (e.long)
83
+ for (const u of l)
84
+ t.stdout.write(g(u, !0));
85
+ else if (e.one)
86
+ for (const u of l)
87
+ t.stdout.write(g(u, !1) + `
88
+ `);
89
+ else {
90
+ const u = l.map((p) => g(p, !1));
91
+ u.length > 0 && t.stdout.write(u.join(" ") + `
92
+ `);
93
+ }
94
+ } catch (l) {
95
+ if (l instanceof d)
96
+ t.stderr.write(`ls: ${l.message}
97
+ `), i = 1;
98
+ else
99
+ throw l;
100
+ }
101
+ }
102
+ return i;
103
+ };
104
+ export {
105
+ z as default
106
+ };
@@ -0,0 +1,122 @@
1
+ const a = {
2
+ // Shell builtins
3
+ cd: { synopsis: "cd [DIR]", description: "Change the current working directory to DIR. If DIR is not specified, change to HOME." },
4
+ pwd: { synopsis: "pwd", description: "Print the current working directory." },
5
+ echo: { synopsis: "echo [STRING...]", description: "Write arguments to standard output, separated by spaces, followed by a newline." },
6
+ clear: { synopsis: "clear", description: "Clear the terminal screen." },
7
+ export: { synopsis: "export NAME=VALUE...", description: "Set environment variables." },
8
+ exit: { synopsis: "exit", description: "Exit the shell." },
9
+ true: { synopsis: "true", description: "Return a successful (zero) exit status." },
10
+ false: { synopsis: "false", description: "Return an unsuccessful (non-zero) exit status." },
11
+ jobs: { synopsis: "jobs", description: "List active background jobs." },
12
+ fg: { synopsis: "fg [JOB_ID]", description: "Move a background job to the foreground." },
13
+ bg: { synopsis: "bg [JOB_ID]", description: "Resume a stopped background job." },
14
+ history: { synopsis: "history", description: "Display the command history list." },
15
+ source: { synopsis: "source FILE", description: "Read and execute commands from FILE in the current shell environment." },
16
+ alias: { synopsis: "alias [NAME=VALUE...]", description: "Define or display aliases. Without arguments, lists all aliases." },
17
+ unalias: { synopsis: "unalias NAME...", description: "Remove alias definitions." },
18
+ // Filesystem
19
+ ls: { synopsis: "ls [-laR1h] [FILE...]", description: "List directory contents. -l for long format, -a to show hidden files, -R recursive, -1 one per line, -h human-readable sizes." },
20
+ cat: { synopsis: "cat [FILE...]", description: "Concatenate and print files to standard output." },
21
+ mkdir: { synopsis: "mkdir [-p] DIR...", description: "Create directories. -p creates parent directories as needed." },
22
+ rm: { synopsis: "rm [-rf] FILE...", description: "Remove files or directories. -r recursive, -f force (no error if missing)." },
23
+ cp: { synopsis: "cp [-r] SOURCE DEST", description: "Copy files and directories. -r for recursive copy." },
24
+ mv: { synopsis: "mv SOURCE DEST", description: "Move or rename files and directories." },
25
+ touch: { synopsis: "touch FILE...", description: "Create empty files or update access/modification times." },
26
+ find: { synopsis: "find [PATH] [-name PATTERN] [-type TYPE]", description: "Search for files in a directory hierarchy." },
27
+ tree: { synopsis: "tree [DIR]", description: "Display directory structure as a tree." },
28
+ stat: { synopsis: "stat FILE...", description: "Display file status and metadata." },
29
+ ln: { synopsis: "ln [-s] TARGET LINK", description: "Create links between files. -s for symbolic links." },
30
+ du: { synopsis: "du [-sh] [FILE...]", description: "Estimate file space usage. -s summary only, -h human-readable." },
31
+ df: { synopsis: "df [-h]", description: "Report filesystem disk space usage. -h human-readable." },
32
+ chmod: { synopsis: "chmod MODE FILE...", description: "Change file mode bits." },
33
+ file: { synopsis: "file FILE...", description: "Determine file type." },
34
+ rmdir: { synopsis: "rmdir [-p] DIR...", description: "Remove empty directories. -p removes parent directories as well." },
35
+ realpath: { synopsis: "realpath FILE...", description: "Print the resolved absolute path for each FILE." },
36
+ basename: { synopsis: "basename NAME [SUFFIX]", description: "Strip directory and optional SUFFIX from NAME." },
37
+ dirname: { synopsis: "dirname NAME...", description: "Strip last component from each NAME, outputting the parent directory." },
38
+ mktemp: { synopsis: "mktemp [-d] [-p DIR] [TEMPLATE]", description: "Create a temporary file or directory. -d creates a directory. TEMPLATE defaults to tmp.XXXXXXXXXX." },
39
+ chown: { synopsis: "chown [-R] OWNER[:GROUP] FILE...", description: "Change file owner and group (no-op in single-user Lifo)." },
40
+ // Text processing
41
+ grep: { synopsis: "grep [-invcrl] PATTERN [FILE...]", description: "Search for lines matching PATTERN. -i ignore case, -n line numbers, -v invert, -c count, -r recursive, -l files only." },
42
+ head: { synopsis: "head [-n NUM] [FILE...]", description: "Output the first NUM lines of each FILE (default 10)." },
43
+ tail: { synopsis: "tail [-n NUM] [FILE...]", description: "Output the last NUM lines of each FILE (default 10)." },
44
+ wc: { synopsis: "wc [-lwc] [FILE...]", description: "Print newline, word, and byte counts. -l lines, -w words, -c bytes." },
45
+ sort: { synopsis: "sort [-rnuk] [FILE...]", description: "Sort lines of text. -r reverse, -n numeric, -u unique, -k key field." },
46
+ uniq: { synopsis: "uniq [-cdi] [FILE]", description: "Report or omit repeated lines. -c count, -d only duplicates, -i ignore case." },
47
+ cut: { synopsis: "cut -d DELIM -f LIST [FILE...]", description: "Cut out selected fields from each line. -d delimiter, -f fields." },
48
+ tr: { synopsis: "tr [-ds] SET1 [SET2]", description: "Translate or delete characters. -d delete, -s squeeze repeats." },
49
+ sed: { synopsis: "sed [-i] SCRIPT [FILE...]", description: "Stream editor for filtering and transforming text." },
50
+ awk: { synopsis: "awk [-F SEP] 'PROGRAM' [FILE...]", description: "Pattern scanning and text processing language." },
51
+ diff: { synopsis: "diff [-u] FILE1 FILE2", description: "Compare files line by line. -u unified format. Exit: 0=same, 1=different, 2=error." },
52
+ nl: { synopsis: "nl [-b STYLE] [-w WIDTH] [FILE]", description: "Number lines. -b a (all), -b t (non-empty, default). -w sets number width (default 6)." },
53
+ rev: { synopsis: "rev [FILE...]", description: "Reverse characters in each line." },
54
+ // I/O
55
+ tee: { synopsis: "tee [-a] FILE...", description: "Read from stdin and write to stdout and files. -a append." },
56
+ xargs: { synopsis: "xargs [COMMAND [ARGS...]]", description: "Build and execute commands from standard input." },
57
+ yes: { synopsis: "yes [STRING]", description: 'Repeatedly output STRING (default "y") until killed.' },
58
+ printf: { synopsis: "printf FORMAT [ARGS...]", description: "Format and print data. Supports %s, %d, %f, %x, and escape sequences." },
59
+ // System
60
+ env: { synopsis: "env", description: "Print all environment variables." },
61
+ uname: { synopsis: "uname [-asnrm]", description: "Print system information. -a all, -s kernel name, -n hostname, -r release, -m machine." },
62
+ date: { synopsis: "date [+FORMAT]", description: "Display the current date and time. FORMAT uses % directives like %Y, %m, %d." },
63
+ sleep: { synopsis: "sleep SECONDS", description: "Delay for a specified number of seconds." },
64
+ uptime: { synopsis: "uptime", description: "Show how long the system has been running." },
65
+ whoami: { synopsis: "whoami", description: "Print the current user name." },
66
+ hostname: { synopsis: "hostname", description: "Print the system hostname." },
67
+ free: { synopsis: "free [-h]", description: "Display amount of free and used memory." },
68
+ which: { synopsis: "which COMMAND...", description: "Locate a command, showing if it is a builtin or external command." },
69
+ ps: { synopsis: "ps", description: "Report a snapshot of current processes. Shell is PID 1, background jobs follow." },
70
+ top: { synopsis: "top", description: "Display a single snapshot of system processes, memory, and CPU information." },
71
+ kill: { synopsis: "kill [-SIGNAL] PID|%JOB...", description: "Send a signal to a process or job. -l lists signals. Supports PID or %JOB notation." },
72
+ watch: { synopsis: "watch [-n SEC] COMMAND [ARGS...]", description: "Execute COMMAND repeatedly, displaying output. -n sets interval (default 2s). Ctrl+C to stop." },
73
+ cal: { synopsis: "cal [MONTH YEAR]", description: "Display a calendar. No args: current month. One arg >12: full year. Two args: specific month and year." },
74
+ bc: { synopsis: "bc [-e EXPR]", description: "An arbitrary precision calculator. Supports +, -, *, /, %, ^ (power), sqrt(), variables, and scale." },
75
+ man: { synopsis: "man [-k] COMMAND", description: "Display manual page for COMMAND. -k searches descriptions for a keyword." },
76
+ help: { synopsis: "help", description: "Display a list of all available commands grouped by category." },
77
+ // Network
78
+ curl: { synopsis: "curl [-sLo FILE] URL", description: "Transfer data from a URL. -s silent, -L follow redirects, -o output file." },
79
+ wget: { synopsis: "wget [-qO FILE] URL", description: "Download files from the web. -q quiet, -O output file." },
80
+ ping: { synopsis: "ping [-c COUNT] HOST", description: "Send ICMP echo requests to a host (simulated)." },
81
+ dig: { synopsis: "dig HOST [TYPE]", description: "DNS lookup utility (simulated)." },
82
+ // Archive
83
+ tar: { synopsis: "tar [-cxtzf] [FILE...]", description: "Archive utility. -c create, -x extract, -t list, -z gzip, -f archive file." },
84
+ gzip: { synopsis: "gzip [-dk] FILE...", description: "Compress files. -d decompress, -k keep original." },
85
+ gunzip: { synopsis: "gunzip [-k] FILE...", description: "Decompress gzip files. -k keep original." },
86
+ zip: { synopsis: "zip [-r] ARCHIVE FILE...", description: "Package and compress files. -r recursive." },
87
+ unzip: { synopsis: "unzip [-lo] ARCHIVE", description: "Extract files from a ZIP archive. -l list, -o overwrite." },
88
+ // Node.js
89
+ node: { synopsis: "node [-e CODE] [FILE]", description: "Execute JavaScript using the Node.js-compatible runtime." },
90
+ pkg: { synopsis: "pkg install|remove|list [PACKAGE]", description: "Package manager for installing and managing packages." }
91
+ }, p = async (s) => {
92
+ if (s.args.length === 0)
93
+ return s.stderr.write(`man: missing command name
94
+ `), s.stderr.write(`Usage: man [-k] COMMAND
95
+ `), 1;
96
+ if (s.args[0] === "-k") {
97
+ if (s.args.length < 2)
98
+ return s.stderr.write(`man: -k requires a keyword
99
+ `), 1;
100
+ const n = s.args[1].toLowerCase();
101
+ let t = !1;
102
+ for (const [o, r] of Object.entries(a))
103
+ (o.includes(n) || r.synopsis.toLowerCase().includes(n) || r.description.toLowerCase().includes(n)) && (s.stdout.write(`${o}(1) - ${r.description.split(".")[0]}
104
+ `), t = !0);
105
+ return t ? 0 : (s.stderr.write(`man: nothing appropriate for "${s.args[1]}"
106
+ `), 1);
107
+ }
108
+ const i = s.args[0], e = a[i];
109
+ return e ? (s.stdout.write(`NAME
110
+ ${i} - ${e.description.split(".")[0].toLowerCase()}
111
+
112
+ `), s.stdout.write(`SYNOPSIS
113
+ ${e.synopsis}
114
+
115
+ `), s.stdout.write(`DESCRIPTION
116
+ ${e.description}
117
+ `), 0) : (s.stderr.write(`man: no manual entry for ${i}
118
+ `), 1);
119
+ };
120
+ export {
121
+ p as default
122
+ };
@@ -0,0 +1,27 @@
1
+ import { p as i } from "./args-CG6b9cZt.js";
2
+ import { r as p, V as m } from "./index-Be1wosKt.js";
3
+ const d = {
4
+ parents: { type: "boolean", short: "p" }
5
+ }, l = async (r) => {
6
+ const { flags: a, positional: e } = i(r.args, d);
7
+ if (e.length === 0)
8
+ return r.stderr.write(`mkdir: missing operand
9
+ `), 1;
10
+ let o = 0;
11
+ for (const t of e) {
12
+ const n = p(r.cwd, t);
13
+ try {
14
+ r.vfs.mkdir(n, { recursive: a.parents });
15
+ } catch (s) {
16
+ if (s instanceof m)
17
+ r.stderr.write(`mkdir: ${t}: ${s.message}
18
+ `), o = 1;
19
+ else
20
+ throw s;
21
+ }
22
+ }
23
+ return o;
24
+ };
25
+ export {
26
+ l as default
27
+ };
@@ -0,0 +1,31 @@
1
+ import { p as d } from "./args-CG6b9cZt.js";
2
+ import { r as p } from "./index-Be1wosKt.js";
3
+ const f = {
4
+ directory: { type: "boolean", short: "d" },
5
+ tmpdir: { type: "string", short: "p" }
6
+ };
7
+ function c(t) {
8
+ const r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
9
+ let s = "";
10
+ for (let e = 0; e < t; e++)
11
+ s += r[Math.floor(Math.random() * r.length)];
12
+ return s;
13
+ }
14
+ const X = async (t) => {
15
+ const { flags: r, positional: s } = d(t.args, f), e = r.tmpdir || "/tmp", o = s[0] || "tmp.XXXXXXXXXX", i = o.match(/X+$/), a = i ? i[0].length : 0, m = a > 0 ? o.slice(0, -a) + c(a) : o + "." + c(10), n = p(e, m);
16
+ try {
17
+ try {
18
+ t.vfs.stat(e);
19
+ } catch {
20
+ t.vfs.mkdir(e, { recursive: !0 });
21
+ }
22
+ return r.directory ? t.vfs.mkdir(n) : t.vfs.writeFile(n, ""), t.stdout.write(n + `
23
+ `), 0;
24
+ } catch (l) {
25
+ return t.stderr.write(`mktemp: failed to create ${r.directory ? "directory" : "file"}: ${l.message}
26
+ `), 1;
27
+ }
28
+ };
29
+ export {
30
+ X as default
31
+ };
@@ -0,0 +1,19 @@
1
+ import { r as a, b as n, V as o } from "./index-Be1wosKt.js";
2
+ const f = async (r) => {
3
+ if (r.args.length < 2)
4
+ return r.stderr.write(`mv: missing operand
5
+ `), 1;
6
+ const t = a(r.cwd, r.args[0]);
7
+ let s = a(r.cwd, r.args[1]);
8
+ try {
9
+ return r.vfs.exists(s) && r.vfs.stat(s).type === "directory" && (s = a(s, n(t))), r.vfs.rename(t, s), 0;
10
+ } catch (e) {
11
+ if (e instanceof o)
12
+ return r.stderr.write(`mv: ${e.message}
13
+ `), 1;
14
+ throw e;
15
+ }
16
+ };
17
+ export {
18
+ f as default
19
+ };