@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,4 @@
1
+ import { Command } from '../types.js';
2
+ declare const command: Command;
3
+ export default command;
4
+ //# sourceMappingURL=uname.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uname.d.ts","sourceRoot":"","sources":["../../../src/commands/system/uname.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,QAAA,MAAM,OAAO,EAAE,OA4Cd,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { Command } from '../types.js';
2
+ declare const command: Command;
3
+ export default command;
4
+ //# sourceMappingURL=uptime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uptime.d.ts","sourceRoot":"","sources":["../../../src/commands/system/uptime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,QAAA,MAAM,OAAO,EAAE,OAcd,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { Command } from '../types.js';
2
+ import { CommandRegistry } from '../registry.js';
3
+ export declare function createWatchCommand(registry: CommandRegistry): Command;
4
+ //# sourceMappingURL=watch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../../../src/commands/system/watch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAuB,MAAM,aAAa,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,eAAe,GAAG,OAAO,CAyErE"}
@@ -0,0 +1,4 @@
1
+ import { Command } from '../types.js';
2
+ declare const command: Command;
3
+ export default command;
4
+ //# sourceMappingURL=which.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"which.d.ts","sourceRoot":"","sources":["../../../src/commands/system/which.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AA4B3C,QAAA,MAAM,OAAO,EAAE,OAoBd,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { Command } from '../types.js';
2
+ declare const command: Command;
3
+ export default command;
4
+ //# sourceMappingURL=whoami.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"whoami.d.ts","sourceRoot":"","sources":["../../../src/commands/system/whoami.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,QAAA,MAAM,OAAO,EAAE,OAId,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { Command } from '../types.js';
2
+ declare const command: Command;
3
+ export default command;
4
+ //# sourceMappingURL=awk.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"awk.d.ts","sourceRoot":"","sources":["../../../src/commands/text/awk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AA6G3C,QAAA,MAAM,OAAO,EAAE,OA4Fd,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { Command } from '../types.js';
2
+ declare const command: Command;
3
+ export default command;
4
+ //# sourceMappingURL=cut.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cut.d.ts","sourceRoot":"","sources":["../../../src/commands/text/cut.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAsB3C,QAAA,MAAM,OAAO,EAAE,OA6Dd,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { Command } from '../types.js';
2
+ declare const command: Command;
3
+ export default command;
4
+ //# sourceMappingURL=diff.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../../src/commands/text/diff.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAoO3C,QAAA,MAAM,OAAO,EAAE,OAsDd,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { Command } from '../types.js';
2
+ declare const command: Command;
3
+ export default command;
4
+ //# sourceMappingURL=grep.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grep.d.ts","sourceRoot":"","sources":["../../../src/commands/text/grep.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAI3C,QAAA,MAAM,OAAO,EAAE,OA2Jd,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { Command } from '../types.js';
2
+ declare const command: Command;
3
+ export default command;
4
+ //# sourceMappingURL=head.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"head.d.ts","sourceRoot":"","sources":["../../../src/commands/text/head.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAI3C,QAAA,MAAM,OAAO,EAAE,OAuDd,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { Command } from '../types.js';
2
+ declare const command: Command;
3
+ export default command;
4
+ //# sourceMappingURL=nl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nl.d.ts","sourceRoot":"","sources":["../../../src/commands/text/nl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAU3C,QAAA,MAAM,OAAO,EAAE,OAuDd,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { Command } from '../types.js';
2
+ declare const command: Command;
3
+ export default command;
4
+ //# sourceMappingURL=rev.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rev.d.ts","sourceRoot":"","sources":["../../../src/commands/text/rev.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAQ3C,QAAA,MAAM,OAAO,EAAE,OA6Bd,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { Command } from '../types.js';
2
+ declare const command: Command;
3
+ export default command;
4
+ //# sourceMappingURL=sed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sed.d.ts","sourceRoot":"","sources":["../../../src/commands/text/sed.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AA+D3C,QAAA,MAAM,OAAO,EAAE,OA0Fd,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { Command } from '../types.js';
2
+ declare const command: Command;
3
+ export default command;
4
+ //# sourceMappingURL=sort.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sort.d.ts","sourceRoot":"","sources":["../../../src/commands/text/sort.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAI3C,QAAA,MAAM,OAAO,EAAE,OA2Ed,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { Command } from '../types.js';
2
+ declare const command: Command;
3
+ export default command;
4
+ //# sourceMappingURL=tail.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tail.d.ts","sourceRoot":"","sources":["../../../src/commands/text/tail.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAI3C,QAAA,MAAM,OAAO,EAAE,OAkDd,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { Command } from '../types.js';
2
+ declare const command: Command;
3
+ export default command;
4
+ //# sourceMappingURL=tr.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tr.d.ts","sourceRoot":"","sources":["../../../src/commands/text/tr.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAqB3C,QAAA,MAAM,OAAO,EAAE,OAsFd,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { Command } from '../types.js';
2
+ declare const command: Command;
3
+ export default command;
4
+ //# sourceMappingURL=uniq.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uniq.d.ts","sourceRoot":"","sources":["../../../src/commands/text/uniq.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAI3C,QAAA,MAAM,OAAO,EAAE,OAgEd,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { Command } from '../types.js';
2
+ declare const command: Command;
3
+ export default command;
4
+ //# sourceMappingURL=wc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wc.d.ts","sourceRoot":"","sources":["../../../src/commands/text/wc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAI3C,QAAA,MAAM,OAAO,EAAE,OAkFd,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { VFS } from '../kernel/vfs/index.js';
2
+ export interface CommandOutputStream {
3
+ write(text: string): void;
4
+ }
5
+ export interface CommandInputStream {
6
+ read(): Promise<string | null>;
7
+ readAll(): Promise<string>;
8
+ }
9
+ export interface CommandContext {
10
+ args: string[];
11
+ env: Record<string, string>;
12
+ cwd: string;
13
+ vfs: VFS;
14
+ stdout: CommandOutputStream;
15
+ stderr: CommandOutputStream;
16
+ signal: AbortSignal;
17
+ stdin?: CommandInputStream;
18
+ }
19
+ export type Command = (ctx: CommandContext) => Promise<number>;
20
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/commands/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAElD,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC/B,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CAC5B;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,GAAG,CAAC;IACT,MAAM,EAAE,mBAAmB,CAAC;IAC5B,MAAM,EAAE,mBAAmB,CAAC;IAC5B,MAAM,EAAE,WAAW,CAAC;IACpB,KAAK,CAAC,EAAE,kBAAkB,CAAC;CAC5B;AAED,MAAM,MAAM,OAAO,GAAG,CAAC,GAAG,EAAE,cAAc,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { r as t, b as n, V as o } from "./index-Be1wosKt.js";
2
+ const f = async (s) => {
3
+ if (s.args.length < 2)
4
+ return s.stderr.write(`cp: missing operand
5
+ `), 1;
6
+ const a = t(s.cwd, s.args[0]);
7
+ let r = t(s.cwd, s.args[1]);
8
+ try {
9
+ return s.vfs.exists(r) && s.vfs.stat(r).type === "directory" && (r = t(r, n(a))), s.vfs.copyFile(a, r), 0;
10
+ } catch (e) {
11
+ if (e instanceof o)
12
+ return s.stderr.write(`cp: ${e.message}
13
+ `), 1;
14
+ throw e;
15
+ }
16
+ };
17
+ export {
18
+ f as default
19
+ };
@@ -0,0 +1,60 @@
1
+ import { r as d, V as c } from "./index-Be1wosKt.js";
2
+ function u(e) {
3
+ const r = [];
4
+ for (const n of e.split(",")) {
5
+ const i = n.split("-");
6
+ if (i.length === 2) {
7
+ const l = parseInt(i[0], 10), f = parseInt(i[1], 10);
8
+ if (!isNaN(l) && !isNaN(f))
9
+ for (let a = l; a <= f; a++) r.push(a);
10
+ } else {
11
+ const l = parseInt(n, 10);
12
+ isNaN(l) || r.push(l);
13
+ }
14
+ }
15
+ return r;
16
+ }
17
+ const h = async (e) => {
18
+ let r = " ", n = "";
19
+ const i = [];
20
+ for (let s = 0; s < e.args.length; s++) {
21
+ const t = e.args[s];
22
+ t === "-d" && s + 1 < e.args.length ? r = e.args[++s] : t === "-f" && s + 1 < e.args.length ? n = e.args[++s] : t.startsWith("-d") && t.length > 2 ? r = t.slice(2) : t.startsWith("-f") && t.length > 2 ? n = t.slice(2) : i.push(t);
23
+ }
24
+ if (!n)
25
+ return e.stderr.write(`cut: you must specify a list of fields
26
+ `), 1;
27
+ const l = u(n);
28
+ function f(s) {
29
+ const t = s.split(r);
30
+ return l.map((o) => t[o - 1] || "").join(r);
31
+ }
32
+ let a = "";
33
+ if (i.length === 0)
34
+ if (e.stdin)
35
+ a = await e.stdin.readAll();
36
+ else
37
+ return e.stderr.write(`cut: missing file operand
38
+ `), 1;
39
+ else
40
+ for (const s of i) {
41
+ const t = d(e.cwd, s);
42
+ try {
43
+ a += e.vfs.readFileString(t);
44
+ } catch (o) {
45
+ if (o instanceof c)
46
+ return e.stderr.write(`cut: ${s}: ${o.message}
47
+ `), 1;
48
+ throw o;
49
+ }
50
+ }
51
+ const p = a.replace(/\n$/, "").split(`
52
+ `);
53
+ for (const s of p)
54
+ e.stdout.write(f(s) + `
55
+ `);
56
+ return 0;
57
+ };
58
+ export {
59
+ h as default
60
+ };
@@ -0,0 +1,86 @@
1
+ const c = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], u = [
2
+ "January",
3
+ "February",
4
+ "March",
5
+ "April",
6
+ "May",
7
+ "June",
8
+ "July",
9
+ "August",
10
+ "September",
11
+ "October",
12
+ "November",
13
+ "December"
14
+ ];
15
+ function s(t, a = 2) {
16
+ return String(t).padStart(a, "0");
17
+ }
18
+ function o(t, a) {
19
+ let e = "", r = 0;
20
+ for (; r < t.length; )
21
+ if (t[r] === "%" && r + 1 < t.length) {
22
+ switch (r++, t[r]) {
23
+ case "Y":
24
+ e += a.getFullYear();
25
+ break;
26
+ case "m":
27
+ e += s(a.getMonth() + 1);
28
+ break;
29
+ case "d":
30
+ e += s(a.getDate());
31
+ break;
32
+ case "H":
33
+ e += s(a.getHours());
34
+ break;
35
+ case "M":
36
+ e += s(a.getMinutes());
37
+ break;
38
+ case "S":
39
+ e += s(a.getSeconds());
40
+ break;
41
+ case "A":
42
+ e += c[a.getDay()];
43
+ break;
44
+ case "B":
45
+ e += u[a.getMonth()];
46
+ break;
47
+ case "Z":
48
+ e += "UTC";
49
+ break;
50
+ case "s":
51
+ e += Math.floor(a.getTime() / 1e3);
52
+ break;
53
+ case "p":
54
+ e += a.getHours() >= 12 ? "PM" : "AM";
55
+ break;
56
+ case "I": {
57
+ const n = a.getHours() % 12;
58
+ e += s(n === 0 ? 12 : n);
59
+ break;
60
+ }
61
+ case "%":
62
+ e += "%";
63
+ break;
64
+ default:
65
+ e += "%" + t[r];
66
+ break;
67
+ }
68
+ r++;
69
+ } else
70
+ e += t[r], r++;
71
+ return e;
72
+ }
73
+ const g = async (t) => {
74
+ const a = /* @__PURE__ */ new Date();
75
+ if (t.args.length > 0 && t.args[0].startsWith("+")) {
76
+ const e = t.args[0].slice(1);
77
+ t.stdout.write(o(e, a) + `
78
+ `);
79
+ } else
80
+ t.stdout.write(a.toString() + `
81
+ `);
82
+ return 0;
83
+ };
84
+ export {
85
+ g as default
86
+ };
@@ -0,0 +1,34 @@
1
+ function a(t) {
2
+ return t < 1024 ? t + "B" : t < 1024 * 1024 ? (t / 1024).toFixed(1) + "K" : t < 1024 * 1024 * 1024 ? (t / (1024 * 1024)).toFixed(1) + "M" : (t / (1024 * 1024 * 1024)).toFixed(1) + "G";
3
+ }
4
+ const m = async (t) => {
5
+ let r = !1;
6
+ for (const o of t.args)
7
+ o === "-h" && (r = !0);
8
+ let d = 0, i = 0;
9
+ function u(o) {
10
+ try {
11
+ const c = t.vfs.readdir(o);
12
+ for (const s of c) {
13
+ const f = o === "/" ? "/" + s.name : o + "/" + s.name;
14
+ if (s.type === "file") {
15
+ d++;
16
+ const h = t.vfs.stat(f);
17
+ i += h.size;
18
+ } else
19
+ u(f);
20
+ }
21
+ } catch {
22
+ }
23
+ }
24
+ u("/");
25
+ const e = 256 * 1024 * 1024, n = i, l = e - n;
26
+ return r ? (t.stdout.write(`Filesystem Size Used Avail Use% Mounted on
27
+ `), t.stdout.write(`vfs ${a(e)} ${a(n)} ${a(l)} ${Math.round(n / e * 100)}% /
28
+ `)) : (t.stdout.write(`Filesystem 1K-blocks Used Available Use% Mounted on
29
+ `), t.stdout.write(`vfs ${Math.round(e / 1024)} ${Math.round(n / 1024)} ${Math.round(l / 1024)} ${Math.round(n / e * 100)}% /
30
+ `)), 0;
31
+ };
32
+ export {
33
+ m as default
34
+ };
@@ -0,0 +1,129 @@
1
+ import { p as m } from "./args-CG6b9cZt.js";
2
+ import { r as y, V as w } from "./index-Be1wosKt.js";
3
+ const C = {
4
+ unified: { type: "boolean", short: "u" }
5
+ };
6
+ function k(o, f) {
7
+ const d = o.length, n = f.length, s = Array.from({ length: d + 1 }, () => new Array(n + 1).fill(0));
8
+ for (let e = 1; e <= d; e++)
9
+ for (let l = 1; l <= n; l++)
10
+ o[e - 1] === f[l - 1] ? s[e][l] = s[e - 1][l - 1] + 1 : s[e][l] = Math.max(s[e - 1][l], s[e][l - 1]);
11
+ const u = [];
12
+ let i = d, r = n;
13
+ for (; i > 0 || r > 0; )
14
+ i > 0 && r > 0 && o[i - 1] === f[r - 1] ? (u.push({ type: "keep", oldLine: o[i - 1] }), i--, r--) : r > 0 && (i === 0 || s[i][r - 1] >= s[i - 1][r]) ? (u.push({ type: "insert", newLine: f[r - 1] }), r--) : (u.push({ type: "delete", oldLine: o[i - 1] }), i--);
15
+ return u.reverse();
16
+ }
17
+ function S(o) {
18
+ const f = [];
19
+ let d = 0, n = 0, s = 0;
20
+ for (; s < o.length; ) {
21
+ if (o[s].type === "keep") {
22
+ d++, n++, s++;
23
+ continue;
24
+ }
25
+ const i = d, r = n, e = [], l = [];
26
+ for (; s < o.length && o[s].type !== "keep"; )
27
+ o[s].type === "delete" ? (e.push(o[s].oldLine), d++) : (l.push(o[s].newLine), n++), s++;
28
+ const p = e.length === 1 ? `${i + 1}` : e.length > 0 ? `${i + 1},${i + e.length}` : `${i}`, t = l.length === 1 ? `${r + 1}` : l.length > 0 ? `${r + 1},${r + l.length}` : `${r}`;
29
+ if (e.length > 0 && l.length > 0) {
30
+ f.push(`${p}c${t}`);
31
+ for (const a of e) f.push(`< ${a}`);
32
+ f.push("---");
33
+ for (const a of l) f.push(`> ${a}`);
34
+ } else if (e.length > 0) {
35
+ f.push(`${p}d${t}`);
36
+ for (const a of e) f.push(`< ${a}`);
37
+ } else {
38
+ f.push(`${p}a${t}`);
39
+ for (const a of l) f.push(`> ${a}`);
40
+ }
41
+ }
42
+ return f.length > 0 ? f.join(`
43
+ `) + `
44
+ ` : "";
45
+ }
46
+ function L(o, f, d) {
47
+ if (o.every((t) => t.type === "keep")) return "";
48
+ const n = [];
49
+ let s = 0, u = 0;
50
+ for (const t of o)
51
+ t.type === "keep" ? (n.push({ type: "keep", line: t.oldLine, oldIdx: s, newIdx: u }), s++, u++) : t.type === "delete" ? (n.push({ type: "delete", line: t.oldLine, oldIdx: s, newIdx: u }), s++) : (n.push({ type: "insert", line: t.newLine, oldIdx: s, newIdx: u }), u++);
52
+ const i = 3, r = [];
53
+ let e = null, l = -1 / 0;
54
+ for (let t = 0; t < n.length; t++) {
55
+ const a = n[t];
56
+ if (a.type !== "keep") {
57
+ if (!e || t - l > i * 2 + 1) {
58
+ if (e) {
59
+ for (let h = l + 1; h < Math.min(l + 1 + i, n.length); h++)
60
+ n[h].type === "keep" && (e.lines.push(` ${n[h].line}`), e.oldCount++, e.newCount++);
61
+ r.push(e);
62
+ }
63
+ const c = Math.max(0, t - i);
64
+ let g = 0, $ = 0;
65
+ for (let h = 0; h < c; h++)
66
+ n[h].type !== "insert" && g++, n[h].type !== "delete" && $++;
67
+ e = {
68
+ oldStart: g + 1,
69
+ newStart: $ + 1,
70
+ oldCount: 0,
71
+ newCount: 0,
72
+ lines: []
73
+ };
74
+ for (let h = c; h < t; h++)
75
+ n[h].type === "keep" && (e.lines.push(` ${n[h].line}`), e.oldCount++, e.newCount++);
76
+ } else if (t - l > 1)
77
+ for (let c = l + 1; c < t; c++)
78
+ n[c].type === "keep" && (e.lines.push(` ${n[c].line}`), e.oldCount++, e.newCount++);
79
+ a.type === "delete" ? (e.lines.push(`-${a.line}`), e.oldCount++) : (e.lines.push(`+${a.line}`), e.newCount++), l = t;
80
+ }
81
+ }
82
+ if (e) {
83
+ for (let t = l + 1; t < Math.min(l + 1 + i, n.length); t++)
84
+ n[t].type === "keep" && (e.lines.push(` ${n[t].line}`), e.oldCount++, e.newCount++);
85
+ r.push(e);
86
+ }
87
+ const p = [];
88
+ p.push(`--- ${f}`), p.push(`+++ ${d}`);
89
+ for (const t of r)
90
+ p.push(`@@ -${t.oldStart},${t.oldCount} +${t.newStart},${t.newCount} @@`), p.push(...t.lines);
91
+ return p.join(`
92
+ `) + `
93
+ `;
94
+ }
95
+ const v = async (o) => {
96
+ const { flags: f, positional: d } = m(o.args, C);
97
+ if (d.length < 2)
98
+ return o.stderr.write(`diff: missing operand
99
+ `), 2;
100
+ const n = d[0], s = d[1];
101
+ let u, i;
102
+ try {
103
+ u = o.vfs.readFileString(y(o.cwd, n));
104
+ } catch (p) {
105
+ if (p instanceof w)
106
+ return o.stderr.write(`diff: ${n}: ${p.message}
107
+ `), 2;
108
+ throw p;
109
+ }
110
+ try {
111
+ i = o.vfs.readFileString(y(o.cwd, s));
112
+ } catch (p) {
113
+ if (p instanceof w)
114
+ return o.stderr.write(`diff: ${s}: ${p.message}
115
+ `), 2;
116
+ throw p;
117
+ }
118
+ if (u === i)
119
+ return 0;
120
+ const r = u.split(`
121
+ `), e = i.split(`
122
+ `);
123
+ r.length > 0 && r[r.length - 1] === "" && r.pop(), e.length > 0 && e[e.length - 1] === "" && e.pop();
124
+ const l = k(r, e);
125
+ return f.unified ? o.stdout.write(L(l, n, s)) : o.stdout.write(S(l)), 1;
126
+ };
127
+ export {
128
+ v as default
129
+ };
@@ -0,0 +1,69 @@
1
+ const i = {
2
+ 1: "A",
3
+ 2: "NS",
4
+ 5: "CNAME",
5
+ 6: "SOA",
6
+ 15: "MX",
7
+ 16: "TXT",
8
+ 28: "AAAA"
9
+ }, u = async (e) => {
10
+ let n = "A", o;
11
+ for (const s of e.args) {
12
+ if (s.startsWith("-") || s.startsWith("+")) continue;
13
+ const t = s.toUpperCase();
14
+ ["A", "AAAA", "CNAME", "MX", "NS", "TXT", "SOA"].includes(t) ? n = t : o = s;
15
+ }
16
+ if (!o)
17
+ return e.stderr.write(`dig: missing domain
18
+ `), e.stderr.write(`Usage: dig [type] domain
19
+ `), 1;
20
+ const a = `https://dns.google/resolve?name=${encodeURIComponent(o)}&type=${n}`;
21
+ try {
22
+ const s = await fetch(a, {
23
+ headers: { Accept: "application/dns-json" },
24
+ signal: e.signal
25
+ });
26
+ if (!s.ok)
27
+ return e.stderr.write(`dig: DNS query failed (HTTP ${s.status})
28
+ `), 1;
29
+ const t = await s.json();
30
+ if (e.stdout.write(`; <<>> Lifo dig <<>> ${n} ${o}
31
+ `), e.stdout.write(`;; Got answer:
32
+ `), e.stdout.write(`;; ->>HEADER<<- status: ${t.Status === 0 ? "NOERROR" : "NXDOMAIN"}
33
+ `), e.stdout.write(`
34
+ `), t.Question && t.Question.length > 0) {
35
+ e.stdout.write(`;; QUESTION SECTION:
36
+ `);
37
+ for (const r of t.Question)
38
+ e.stdout.write(`;${r.name}. IN ${i[r.type] ?? r.type}
39
+ `);
40
+ e.stdout.write(`
41
+ `);
42
+ }
43
+ if (t.Answer && t.Answer.length > 0) {
44
+ e.stdout.write(`;; ANSWER SECTION:
45
+ `);
46
+ for (const r of t.Answer) {
47
+ const d = i[r.type] ?? String(r.type);
48
+ e.stdout.write(`${r.name}. ${r.TTL} IN ${d} ${r.data}
49
+ `);
50
+ }
51
+ e.stdout.write(`
52
+ `);
53
+ } else
54
+ e.stdout.write(`;; No answers found.
55
+
56
+ `);
57
+ return e.stdout.write(`;; SERVER: dns.google
58
+ `), 0;
59
+ } catch (s) {
60
+ const t = s instanceof Error ? s.message : String(s);
61
+ return t.includes("Failed to fetch") || t.includes("NetworkError") ? (e.stderr.write(`dig: connection to DNS server failed
62
+ `), e.stderr.write(`Note: This may be a CORS restriction or network issue.
63
+ `)) : e.stderr.write(`dig: ${t}
64
+ `), 1;
65
+ }
66
+ };
67
+ export {
68
+ u as default
69
+ };
@@ -0,0 +1,13 @@
1
+ import { d as a } from "./index-Be1wosKt.js";
2
+ const s = async (r) => {
3
+ if (r.args.length === 0)
4
+ return r.stderr.write(`dirname: missing operand
5
+ `), 1;
6
+ for (const n of r.args)
7
+ r.stdout.write(a(n) + `
8
+ `);
9
+ return 0;
10
+ };
11
+ export {
12
+ s as default
13
+ };