@lifo-sh/core 0.5.0 → 0.5.6

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 (292) hide show
  1. package/dist/args-BhoL0JcG.js +58 -0
  2. package/dist/awk-DahiO6Jl.js +170 -0
  3. package/dist/base64-Dj_AnQAH.js +92 -0
  4. package/dist/basename-D8sjWfzX.js +14 -0
  5. package/dist/bc-CCuJi0IY.js +230 -0
  6. package/dist/browser-B0dadKCA.js +43 -0
  7. package/dist/cal-DQsLvArw.js +85 -0
  8. package/dist/cat-KYGveROo.js +32 -0
  9. package/dist/chmod-gYZdg3Kv.js +81 -0
  10. package/dist/chown-DoPi7NLO.js +32 -0
  11. package/dist/commands/net/curl.d.ts +2 -2
  12. package/dist/commands/net/curl.d.ts.map +1 -1
  13. package/dist/commands/net/forward.d.ts +14 -0
  14. package/dist/commands/net/forward.d.ts.map +1 -0
  15. package/dist/commands/net/host.d.ts +14 -0
  16. package/dist/commands/net/host.d.ts.map +1 -0
  17. package/dist/commands/net/ifconfig.d.ts +8 -0
  18. package/dist/commands/net/ifconfig.d.ts.map +1 -0
  19. package/dist/commands/net/ip.d.ts +14 -0
  20. package/dist/commands/net/ip.d.ts.map +1 -0
  21. package/dist/commands/net/netstat.d.ts +8 -0
  22. package/dist/commands/net/netstat.d.ts.map +1 -0
  23. package/dist/commands/net/ports.d.ts +8 -0
  24. package/dist/commands/net/ports.d.ts.map +1 -0
  25. package/dist/commands/net/route.d.ts +8 -0
  26. package/dist/commands/net/route.d.ts.map +1 -0
  27. package/dist/commands/net/test-registry.d.ts +8 -0
  28. package/dist/commands/net/test-registry.d.ts.map +1 -0
  29. package/dist/commands/net/tunnel-v2.d.ts +4 -0
  30. package/dist/commands/net/tunnel-v2.d.ts.map +1 -0
  31. package/dist/commands/net/tunnel.d.ts +6 -0
  32. package/dist/commands/net/tunnel.d.ts.map +1 -0
  33. package/dist/commands/registry.d.ts +1 -0
  34. package/dist/commands/registry.d.ts.map +1 -1
  35. package/dist/commands/system/kill.d.ts +2 -2
  36. package/dist/commands/system/kill.d.ts.map +1 -1
  37. package/dist/commands/system/lifo.d.ts +19 -2
  38. package/dist/commands/system/lifo.d.ts.map +1 -1
  39. package/dist/commands/system/newtab.d.ts +8 -0
  40. package/dist/commands/system/newtab.d.ts.map +1 -0
  41. package/dist/commands/system/node.d.ts +3 -2
  42. package/dist/commands/system/node.d.ts.map +1 -1
  43. package/dist/commands/system/npm.d.ts +20 -7
  44. package/dist/commands/system/npm.d.ts.map +1 -1
  45. package/dist/commands/system/ps.d.ts +3 -2
  46. package/dist/commands/system/ps.d.ts.map +1 -1
  47. package/dist/commands/system/systemctl.d.ts +4 -0
  48. package/dist/commands/system/systemctl.d.ts.map +1 -0
  49. package/dist/commands/system/top.d.ts +2 -2
  50. package/dist/commands/system/top.d.ts.map +1 -1
  51. package/dist/commands/system/watch.d.ts.map +1 -1
  52. package/dist/commands/system/whoami.d.ts.map +1 -1
  53. package/dist/commands/types.d.ts +3 -2
  54. package/dist/commands/types.d.ts.map +1 -1
  55. package/dist/cp-BP7-nkZi.js +29 -0
  56. package/dist/cut-Dg3Sxlw_.js +84 -0
  57. package/dist/date-DqL4oCg8.js +91 -0
  58. package/dist/df-CEHqyq91.js +47 -0
  59. package/dist/diff-aYLFp43G.js +250 -0
  60. package/dist/dig-0_V5UoWW.js +91 -0
  61. package/dist/dirname-ByojkmnI.js +14 -0
  62. package/dist/du-feoEC53Q.js +89 -0
  63. package/dist/env-CIcDulqw.js +10 -0
  64. package/dist/fastfetch-CRfsfb4t.js +378 -0
  65. package/dist/file-BHHCgjt9.js +79 -0
  66. package/dist/find-C-pGJyTZ.js +63 -0
  67. package/dist/free-DCkGta9v.js +33 -0
  68. package/dist/grep-Bv7fu1qw.js +179 -0
  69. package/dist/gunzip-BZk2000a.js +57 -0
  70. package/dist/gzip-D55LwDu8.js +70 -0
  71. package/dist/head-CQQ8pAha.js +66 -0
  72. package/dist/hostname-Ba0tnCzG.js +8 -0
  73. package/dist/index-GLjTMF7C.js +22717 -0
  74. package/dist/index.d.ts +44 -17
  75. package/dist/index.d.ts.map +1 -1
  76. package/dist/index.js +99 -72
  77. package/dist/less-C-8XcQ_A.js +294 -0
  78. package/dist/ln-CpXREm6e.js +15 -0
  79. package/dist/ls-Ce1mcASB.js +132 -0
  80. package/dist/{man-Dg26tZ-a.js → man-DjxHeM01.js} +46 -27
  81. package/dist/mime-B5knsVEw.js +101 -0
  82. package/dist/mkdir-CtDdaiaM.js +31 -0
  83. package/dist/mktemp-DwAY8Lz2.js +44 -0
  84. package/dist/mv-vS020rcy.js +29 -0
  85. package/dist/nano-DKfqXthq.js +445 -0
  86. package/dist/nl-DHh-MmKX.js +66 -0
  87. package/dist/ping-BQO3Z9CT.js +72 -0
  88. package/dist/pkg/PackageManager.d.ts +2 -2
  89. package/dist/pkg/PackageManager.d.ts.map +1 -1
  90. package/dist/pkg/lifo-dev.d.ts +6 -6
  91. package/dist/pkg/lifo-dev.d.ts.map +1 -1
  92. package/dist/pkg/lifo-runtime.d.ts +3 -3
  93. package/dist/pkg/lifo-runtime.d.ts.map +1 -1
  94. package/dist/pkg/loader.d.ts +2 -2
  95. package/dist/pkg/loader.d.ts.map +1 -1
  96. package/dist/printf-CdBVx2dT.js +81 -0
  97. package/dist/realpath-CZ_ja3FL.js +27 -0
  98. package/dist/rev-KZ9O5vNS.js +42 -0
  99. package/dist/rm-dW7YB25j.js +48 -0
  100. package/dist/rmdir-Db2wctQ6.js +42 -0
  101. package/dist/runtime/ContextSerialization.d.ts +7 -0
  102. package/dist/runtime/ContextSerialization.d.ts.map +1 -0
  103. package/dist/runtime/ProcessExecutor.d.ts +14 -0
  104. package/dist/runtime/ProcessExecutor.d.ts.map +1 -0
  105. package/dist/runtime/command-worker.d.ts +9 -0
  106. package/dist/runtime/command-worker.d.ts.map +1 -0
  107. package/dist/sandbox/Sandbox.d.ts +1 -2
  108. package/dist/sandbox/Sandbox.d.ts.map +1 -1
  109. package/dist/sandbox/SandboxFs.d.ts +2 -2
  110. package/dist/sandbox/SandboxFs.d.ts.map +1 -1
  111. package/dist/sandbox/types.d.ts +1 -2
  112. package/dist/sandbox/types.d.ts.map +1 -1
  113. package/dist/sed-BK_pjM2M.js +142 -0
  114. package/dist/seq-B0yurkx9.js +64 -0
  115. package/dist/sha256sum-BP0l9D35.js +85 -0
  116. package/dist/shell/ProcessRegistry.d.ts +152 -0
  117. package/dist/shell/ProcessRegistry.d.ts.map +1 -0
  118. package/dist/shell/ProcessRegistry.example.d.ts +8 -0
  119. package/dist/shell/ProcessRegistry.example.d.ts.map +1 -0
  120. package/dist/shell/ProcessRegistry.test.d.ts +2 -0
  121. package/dist/shell/ProcessRegistry.test.d.ts.map +1 -0
  122. package/dist/shell/Shell.d.ts +13 -4
  123. package/dist/shell/Shell.d.ts.map +1 -1
  124. package/dist/shell/completer.d.ts +2 -2
  125. package/dist/shell/completer.d.ts.map +1 -1
  126. package/dist/shell/expander.d.ts +2 -2
  127. package/dist/shell/expander.d.ts.map +1 -1
  128. package/dist/shell/history.d.ts +2 -2
  129. package/dist/shell/history.d.ts.map +1 -1
  130. package/dist/shell/interpreter.d.ts +8 -2
  131. package/dist/shell/interpreter.d.ts.map +1 -1
  132. package/dist/shell/test-builtin.d.ts +2 -2
  133. package/dist/shell/test-builtin.d.ts.map +1 -1
  134. package/dist/sl-BmMNz7ir.js +200 -0
  135. package/dist/sleep-C_3mjcFi.js +25 -0
  136. package/dist/sort-DYZuiMaO.js +87 -0
  137. package/dist/stat-CXSSmsrA.js +38 -0
  138. package/dist/strings-BwqQy-zL.js +63 -0
  139. package/dist/tac-CuZSbu_c.js +32 -0
  140. package/dist/tail-DH7xR0rW.js +62 -0
  141. package/dist/tar-AnR03GXP.js +155 -0
  142. package/dist/tee-ByHsMExU.js +29 -0
  143. package/dist/touch-CcmnMpg5.js +26 -0
  144. package/dist/tr-D_cg13q8.js +92 -0
  145. package/dist/tree-Ck1ymlSv.js +64 -0
  146. package/dist/uname-07bQ7DTD.js +50 -0
  147. package/dist/uniq-BHkwpex3.js +76 -0
  148. package/dist/unzip-DVjk3GA4.js +91 -0
  149. package/dist/uptime-ujk4Nb77.js +17 -0
  150. package/dist/utils/archive.d.ts +2 -2
  151. package/dist/utils/archive.d.ts.map +1 -1
  152. package/dist/utils/glob.d.ts +2 -2
  153. package/dist/utils/glob.d.ts.map +1 -1
  154. package/dist/wc-CK9Flybx.js +98 -0
  155. package/dist/wget-Cww1uNE2.js +84 -0
  156. package/dist/{which-D3u0cwyh.js → which-CJwCjtVK.js} +25 -14
  157. package/dist/whoami-EHyrQ1q-.js +25 -0
  158. package/dist/xargs-I1ZWqhOp.js +40 -0
  159. package/dist/yes-XolnW6bp.js +11 -0
  160. package/dist/zip-BTmRwUYQ.js +40 -0
  161. package/package.json +16 -10
  162. package/dist/args-CG6b9cZt.js +0 -43
  163. package/dist/awk-CC_Qo0hQ.js +0 -123
  164. package/dist/base64-BBckAmkE.js +0 -72
  165. package/dist/basename-BIICW06y.js +0 -12
  166. package/dist/bc-BYiKVTNg.js +0 -200
  167. package/dist/cal-DPULSAhj.js +0 -56
  168. package/dist/cat-Jv35D4BV.js +0 -29
  169. package/dist/chmod-Bh-u8XOr.js +0 -56
  170. package/dist/chown-Dv7xfl2a.js +0 -28
  171. package/dist/cp-CB-sGTRH.js +0 -19
  172. package/dist/cut-B79kgCm4.js +0 -65
  173. package/dist/date-C8NB8v8G.js +0 -86
  174. package/dist/df-CeZb4WOr.js +0 -34
  175. package/dist/diff-D5Ej-JEe.js +0 -150
  176. package/dist/dig-BEJ8Ky96.js +0 -69
  177. package/dist/dirname-w2Y6csox.js +0 -13
  178. package/dist/du-UupzdKc_.js +0 -77
  179. package/dist/env-DXzvDKsN.js +0 -9
  180. package/dist/fastfetch-aPM9Z3ym.js +0 -310
  181. package/dist/file-DOl4Wjtc.js +0 -70
  182. package/dist/find-C0T-P7sl.js +0 -36
  183. package/dist/free-DAxE4b2U.js +0 -23
  184. package/dist/grep-Blwrv9k5.js +0 -147
  185. package/dist/gunzip-R7EtgP15.js +0 -47
  186. package/dist/gzip-BxF7M1np.js +0 -57
  187. package/dist/head-CJwcsX18.js +0 -53
  188. package/dist/hostname-BxU2S3nT.js +0 -8
  189. package/dist/index-BjKSFBDg.js +0 -8640
  190. package/dist/kernel/index.d.ts +0 -26
  191. package/dist/kernel/index.d.ts.map +0 -1
  192. package/dist/kernel/persistence/PersistenceManager.d.ts +0 -12
  193. package/dist/kernel/persistence/PersistenceManager.d.ts.map +0 -1
  194. package/dist/kernel/persistence/backends.d.ts +0 -22
  195. package/dist/kernel/persistence/backends.d.ts.map +0 -1
  196. package/dist/kernel/persistence/index.d.ts +0 -6
  197. package/dist/kernel/persistence/index.d.ts.map +0 -1
  198. package/dist/kernel/persistence/serializer.d.ts +0 -21
  199. package/dist/kernel/persistence/serializer.d.ts.map +0 -1
  200. package/dist/kernel/samples.d.ts +0 -3
  201. package/dist/kernel/samples.d.ts.map +0 -1
  202. package/dist/kernel/storage/BlobStore.d.ts +0 -31
  203. package/dist/kernel/storage/BlobStore.d.ts.map +0 -1
  204. package/dist/kernel/storage/ContentStore.d.ts +0 -52
  205. package/dist/kernel/storage/ContentStore.d.ts.map +0 -1
  206. package/dist/kernel/storage/index.d.ts +0 -7
  207. package/dist/kernel/storage/index.d.ts.map +0 -1
  208. package/dist/kernel/vfs/VFS.d.ts +0 -64
  209. package/dist/kernel/vfs/VFS.d.ts.map +0 -1
  210. package/dist/kernel/vfs/index.d.ts +0 -7
  211. package/dist/kernel/vfs/index.d.ts.map +0 -1
  212. package/dist/kernel/vfs/providers/DevProvider.d.ts +0 -11
  213. package/dist/kernel/vfs/providers/DevProvider.d.ts.map +0 -1
  214. package/dist/kernel/vfs/providers/NativeFsProvider.d.ts +0 -63
  215. package/dist/kernel/vfs/providers/NativeFsProvider.d.ts.map +0 -1
  216. package/dist/kernel/vfs/providers/ProcProvider.d.ts +0 -14
  217. package/dist/kernel/vfs/providers/ProcProvider.d.ts.map +0 -1
  218. package/dist/kernel/vfs/types.d.ts +0 -70
  219. package/dist/kernel/vfs/types.d.ts.map +0 -1
  220. package/dist/less-B0gFLJ_7.js +0 -230
  221. package/dist/ln-Bf3f3jVA.js +0 -11
  222. package/dist/ls-YnhMRefh.js +0 -106
  223. package/dist/mkdir-DY1P3Jxj.js +0 -27
  224. package/dist/mktemp-BRzo2c8y.js +0 -31
  225. package/dist/mv-bH08L-F_.js +0 -19
  226. package/dist/nano-CueO2oS0.js +0 -304
  227. package/dist/nl-D26SSOD4.js +0 -51
  228. package/dist/node-compat/buffer.d.ts +0 -44
  229. package/dist/node-compat/buffer.d.ts.map +0 -1
  230. package/dist/node-compat/child_process.d.ts +0 -10
  231. package/dist/node-compat/child_process.d.ts.map +0 -1
  232. package/dist/node-compat/console.d.ts +0 -21
  233. package/dist/node-compat/console.d.ts.map +0 -1
  234. package/dist/node-compat/crypto.d.ts +0 -17
  235. package/dist/node-compat/crypto.d.ts.map +0 -1
  236. package/dist/node-compat/events.d.ts +0 -19
  237. package/dist/node-compat/events.d.ts.map +0 -1
  238. package/dist/node-compat/fs.d.ts +0 -175
  239. package/dist/node-compat/fs.d.ts.map +0 -1
  240. package/dist/node-compat/http.d.ts +0 -87
  241. package/dist/node-compat/http.d.ts.map +0 -1
  242. package/dist/node-compat/index.d.ts +0 -19
  243. package/dist/node-compat/index.d.ts.map +0 -1
  244. package/dist/node-compat/os.d.ts +0 -39
  245. package/dist/node-compat/os.d.ts.map +0 -1
  246. package/dist/node-compat/path.d.ts +0 -58
  247. package/dist/node-compat/path.d.ts.map +0 -1
  248. package/dist/node-compat/process.d.ts +0 -62
  249. package/dist/node-compat/process.d.ts.map +0 -1
  250. package/dist/node-compat/stream.d.ts +0 -36
  251. package/dist/node-compat/stream.d.ts.map +0 -1
  252. package/dist/node-compat/string_decoder.d.ts +0 -11
  253. package/dist/node-compat/string_decoder.d.ts.map +0 -1
  254. package/dist/node-compat/timers.d.ts +0 -16
  255. package/dist/node-compat/timers.d.ts.map +0 -1
  256. package/dist/node-compat/url.d.ts +0 -53
  257. package/dist/node-compat/url.d.ts.map +0 -1
  258. package/dist/node-compat/util.d.ts +0 -27
  259. package/dist/node-compat/util.d.ts.map +0 -1
  260. package/dist/node-compat/zlib.d.ts +0 -66
  261. package/dist/node-compat/zlib.d.ts.map +0 -1
  262. package/dist/ping-DtVEwwda.js +0 -50
  263. package/dist/printf-Cc2o7KZx.js +0 -70
  264. package/dist/realpath-BH29Lem_.js +0 -24
  265. package/dist/rev-ySwmRf_K.js +0 -39
  266. package/dist/rm-D7iWUUE2.js +0 -37
  267. package/dist/rmdir-BLtdNjt1.js +0 -35
  268. package/dist/sed-DwBPYYFb.js +0 -95
  269. package/dist/seq-B01YKIbO.js +0 -37
  270. package/dist/sha256sum-DED6ePiU.js +0 -64
  271. package/dist/sl-Dv4iPBN6.js +0 -138
  272. package/dist/sleep-B4C3fZiR.js +0 -19
  273. package/dist/sort-OXqZY83v.js +0 -64
  274. package/dist/stat-BvwNpE5B.js +0 -29
  275. package/dist/strings-BesRwUt_.js +0 -42
  276. package/dist/tac-D4BMSdj9.js +0 -31
  277. package/dist/tail-xVmLkzJK.js +0 -52
  278. package/dist/tar-BHRJ0-4j.js +0 -120
  279. package/dist/tee-DxygINEJ.js +0 -17
  280. package/dist/touch-DCb9Qn5q.js +0 -23
  281. package/dist/tr-DsCiwSIu.js +0 -60
  282. package/dist/tree-4QpgsnA0.js +0 -46
  283. package/dist/uname-BCn8HlJD.js +0 -37
  284. package/dist/uniq-xmgE0zRj.js +0 -54
  285. package/dist/unzip-CDKcoB0B.js +0 -81
  286. package/dist/uptime-CgBJegqU.js +0 -8
  287. package/dist/wc-B-jNRfLa.js +0 -69
  288. package/dist/wget-CO-45JoL.js +0 -53
  289. package/dist/whoami-Y18wqme3.js +0 -25
  290. package/dist/xargs-DfbCRFFd.js +0 -35
  291. package/dist/yes-DXEyHHD2.js +0 -10
  292. package/dist/zip-Cu1DzbAu.js +0 -33
@@ -0,0 +1,32 @@
1
+ import { r as resolve, V as VFSError } from "./index-GLjTMF7C.js";
2
+ const command = async (ctx) => {
3
+ if (ctx.args.length === 0) {
4
+ if (ctx.stdin) {
5
+ const content = await ctx.stdin.readAll();
6
+ ctx.stdout.write(content);
7
+ return 0;
8
+ }
9
+ ctx.stderr.write("cat: missing operand\n");
10
+ return 1;
11
+ }
12
+ let exitCode = 0;
13
+ for (const arg of ctx.args) {
14
+ const path = resolve(ctx.cwd, arg);
15
+ try {
16
+ const content = ctx.vfs.readFileString(path);
17
+ ctx.stdout.write(content);
18
+ } catch (e) {
19
+ if (e instanceof VFSError) {
20
+ ctx.stderr.write(`cat: ${arg}: ${e.message}
21
+ `);
22
+ exitCode = 1;
23
+ } else {
24
+ throw e;
25
+ }
26
+ }
27
+ }
28
+ return exitCode;
29
+ };
30
+ export {
31
+ command as default
32
+ };
@@ -0,0 +1,81 @@
1
+ import { r as resolve, V as VFSError } from "./index-GLjTMF7C.js";
2
+ function parseMode(modeStr, currentMode) {
3
+ if (/^[0-7]+$/.test(modeStr)) {
4
+ return parseInt(modeStr, 8);
5
+ }
6
+ let mode = currentMode;
7
+ const match = modeStr.match(/^([ugoa]*)([+\-=])([rwx]+)$/);
8
+ if (!match) return mode;
9
+ const who = match[1] || "a";
10
+ const op = match[2];
11
+ const perms = match[3];
12
+ let bits = 0;
13
+ if (perms.includes("r")) bits |= 4;
14
+ if (perms.includes("w")) bits |= 2;
15
+ if (perms.includes("x")) bits |= 1;
16
+ const targets = [];
17
+ if (who.includes("u") || who.includes("a")) targets.push(6);
18
+ if (who.includes("g") || who.includes("a")) targets.push(3);
19
+ if (who.includes("o") || who.includes("a")) targets.push(0);
20
+ for (const shift of targets) {
21
+ const shifted = bits << shift;
22
+ if (op === "+") mode |= shifted;
23
+ else if (op === "-") mode &= ~shifted;
24
+ else if (op === "=") {
25
+ mode &= ~(7 << shift);
26
+ mode |= shifted;
27
+ }
28
+ }
29
+ return mode;
30
+ }
31
+ const command = async (ctx) => {
32
+ let recursive = false;
33
+ let modeStr = "";
34
+ const files = [];
35
+ for (const arg of ctx.args) {
36
+ if (arg === "-R" || arg === "-r") {
37
+ recursive = true;
38
+ } else if (!modeStr) {
39
+ modeStr = arg;
40
+ } else {
41
+ files.push(arg);
42
+ }
43
+ }
44
+ if (!modeStr || files.length === 0) {
45
+ ctx.stderr.write("chmod: missing operand\n");
46
+ return 1;
47
+ }
48
+ function applyChmod(filePath) {
49
+ const st = ctx.vfs.stat(filePath);
50
+ parseMode(modeStr, st.mode);
51
+ if (st.type === "directory" && recursive) {
52
+ try {
53
+ const entries = ctx.vfs.readdir(filePath);
54
+ for (const entry of entries) {
55
+ const childPath = filePath === "/" ? "/" + entry.name : filePath + "/" + entry.name;
56
+ applyChmod(childPath);
57
+ }
58
+ } catch {
59
+ }
60
+ }
61
+ }
62
+ let exitCode = 0;
63
+ for (const file of files) {
64
+ const path = resolve(ctx.cwd, file);
65
+ try {
66
+ applyChmod(path);
67
+ } catch (e) {
68
+ if (e instanceof VFSError) {
69
+ ctx.stderr.write(`chmod: ${file}: ${e.message}
70
+ `);
71
+ exitCode = 1;
72
+ } else {
73
+ throw e;
74
+ }
75
+ }
76
+ }
77
+ return exitCode;
78
+ };
79
+ export {
80
+ command as default
81
+ };
@@ -0,0 +1,32 @@
1
+ import { p as parseArgs } from "./args-BhoL0JcG.js";
2
+ import { r as resolve, V as VFSError } from "./index-GLjTMF7C.js";
3
+ const spec = {
4
+ recursive: { type: "boolean", short: "R" }
5
+ };
6
+ const command = async (ctx) => {
7
+ const { positional } = parseArgs(ctx.args, spec);
8
+ if (positional.length < 2) {
9
+ ctx.stderr.write("chown: missing operand\n");
10
+ return 1;
11
+ }
12
+ const files = positional.slice(1);
13
+ let exitCode = 0;
14
+ for (const file of files) {
15
+ const path = resolve(ctx.cwd, file);
16
+ try {
17
+ ctx.vfs.stat(path);
18
+ } catch (e) {
19
+ if (e instanceof VFSError) {
20
+ ctx.stderr.write(`chown: ${file}: ${e.message}
21
+ `);
22
+ exitCode = 1;
23
+ } else {
24
+ throw e;
25
+ }
26
+ }
27
+ }
28
+ return exitCode;
29
+ };
30
+ export {
31
+ command as default
32
+ };
@@ -1,6 +1,6 @@
1
1
  import { Command } from '../types.js';
2
- import { VirtualRequestHandler } from '../../kernel/index.js';
3
- export declare function createCurlCommand(portRegistry: Map<number, VirtualRequestHandler>): Command;
2
+ import { Kernel } from '@lifo-sh/kernel';
3
+ export declare function createCurlCommand(kernel: Kernel): Command;
4
4
  declare const command: Command;
5
5
  export default command;
6
6
  //# sourceMappingURL=curl.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"curl.d.ts","sourceRoot":"","sources":["../../../src/commands/net/curl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AA2KnE,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,qBAAqB,CAAC,GAAG,OAAO,CAE3F;AAGD,QAAA,MAAM,OAAO,EAAE,OAA0B,CAAC;AAE1C,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"curl.d.ts","sourceRoot":"","sources":["../../../src/commands/net/curl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAiM9C,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEzD;AAGD,QAAA,MAAM,OAAO,EAAE,OAA0B,CAAC;AAE1C,eAAe,OAAO,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { Command } from '../types.js';
2
+ import { Kernel } from '@lifo-sh/kernel';
3
+ /**
4
+ * forward - Forward a virtual port to the host browser
5
+ * Usage: forward <port>
6
+ * Example: forward 3000
7
+ */
8
+ export declare function createForwardCommand(kernel: Kernel): Command;
9
+ /**
10
+ * unforward - Stop forwarding a virtual port
11
+ * Usage: unforward <port>
12
+ */
13
+ export declare function createUnforwardCommand(kernel: Kernel): Command;
14
+ //# sourceMappingURL=forward.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"forward.d.ts","sourceRoot":"","sources":["../../../src/commands/net/forward.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE9C;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAqD5D;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAsB9D"}
@@ -0,0 +1,14 @@
1
+ import { Command } from '../types.js';
2
+ import { Kernel } from '@lifo-sh/kernel';
3
+ /**
4
+ * host - DNS lookup and /etc/hosts management
5
+ *
6
+ * Usage:
7
+ * host <hostname> - DNS lookup
8
+ * host list - List /etc/hosts entries
9
+ * host add <hostname> <ip> - Add entry to /etc/hosts
10
+ * host remove <hostname> - Remove entry from /etc/hosts
11
+ * host reload - Reload /etc/hosts into DNS
12
+ */
13
+ export declare function createHostCommand(kernel: Kernel): Command;
14
+ //# sourceMappingURL=host.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../../src/commands/net/host.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE9C;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAwKzD"}
@@ -0,0 +1,8 @@
1
+ import { Command } from '../types.js';
2
+ import { Kernel } from '@lifo-sh/kernel';
3
+ /**
4
+ * ifconfig - Configure network interfaces
5
+ * Usage: ifconfig [interface] [options]
6
+ */
7
+ export declare function createIfconfigCommand(kernel: Kernel): Command;
8
+ //# sourceMappingURL=ifconfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ifconfig.d.ts","sourceRoot":"","sources":["../../../src/commands/net/ifconfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE9C;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CA8F7D"}
@@ -0,0 +1,14 @@
1
+ import { Command } from '../types.js';
2
+ import { Kernel } from '@lifo-sh/kernel';
3
+ /**
4
+ * ip - Modern Linux network configuration tool
5
+ *
6
+ * Subcommands:
7
+ * ip link - Manage network interfaces
8
+ * ip addr - Manage IP addresses
9
+ * ip route - Manage routing table
10
+ * ip tunnel - Manage tunnels
11
+ * ip netns - Manage network namespaces
12
+ */
13
+ export declare function createIPCommand(kernel: Kernel): Command;
14
+ //# sourceMappingURL=ip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ip.d.ts","sourceRoot":"","sources":["../../../src/commands/net/ip.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAG9C;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CA4CvD"}
@@ -0,0 +1,8 @@
1
+ import { Command } from '../types.js';
2
+ import { Kernel } from '@lifo-sh/kernel';
3
+ /**
4
+ * netstat - Print network connections, routing tables, interface statistics
5
+ * Usage: netstat [-r] [-i] [-a]
6
+ */
7
+ export declare function createNetstatCommand(kernel: Kernel): Command;
8
+ //# sourceMappingURL=netstat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"netstat.d.ts","sourceRoot":"","sources":["../../../src/commands/net/netstat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE9C;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAkG5D"}
@@ -0,0 +1,8 @@
1
+ import { Command } from '../types.js';
2
+ import { Kernel } from '@lifo-sh/kernel';
3
+ /**
4
+ * ports - List all ports in the portRegistry with details
5
+ * Usage: ports
6
+ */
7
+ export declare function createPortsCommand(kernel: Kernel): Command;
8
+ //# sourceMappingURL=ports.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ports.d.ts","sourceRoot":"","sources":["../../../src/commands/net/ports.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE9C;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAqC1D"}
@@ -0,0 +1,8 @@
1
+ import { Command } from '../types.js';
2
+ import { Kernel } from '@lifo-sh/kernel';
3
+ /**
4
+ * route - Show/manipulate IP routing table
5
+ * Usage: route [-n] [add|del] [destination] [gw gateway] [dev interface]
6
+ */
7
+ export declare function createRouteCommand(kernel: Kernel): Command;
8
+ //# sourceMappingURL=route.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../src/commands/net/route.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE9C;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CA0B1D"}
@@ -0,0 +1,8 @@
1
+ import { Command } from '../types.js';
2
+ import { Kernel } from '@lifo-sh/kernel';
3
+ /**
4
+ * test-registry - Test command to verify portRegistry is shared between tabs
5
+ * Usage: test-registry [set|get]
6
+ */
7
+ export declare function createTestRegistryCommand(kernel: Kernel): Command;
8
+ //# sourceMappingURL=test-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-registry.d.ts","sourceRoot":"","sources":["../../../src/commands/net/test-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE9C;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAqCjE"}
@@ -0,0 +1,4 @@
1
+ import { Command } from '../types.js';
2
+ import { Kernel } from '@lifo-sh/kernel';
3
+ export declare function createTunnelCommandV2(kernel: Kernel): Command;
4
+ //# sourceMappingURL=tunnel-v2.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tunnel-v2.d.ts","sourceRoot":"","sources":["../../../src/commands/net/tunnel-v2.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AA8C9C,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAqJ7D"}
@@ -0,0 +1,6 @@
1
+ import { Command } from '../types.js';
2
+ import { Kernel } from '@lifo-sh/kernel';
3
+ export declare function createTunnelCommand(kernel: Kernel): Command;
4
+ declare const command: Command;
5
+ export default command;
6
+ //# sourceMappingURL=tunnel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tunnel.d.ts","sourceRoot":"","sources":["../../../src/commands/net/tunnel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AA8R9C,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE3D;AAGD,QAAA,MAAM,OAAO,EAAE,OAA4B,CAAC;AAE5C,eAAe,OAAO,CAAC"}
@@ -8,6 +8,7 @@ export declare class CommandRegistry {
8
8
  }>): void;
9
9
  unregister(name: string): void;
10
10
  resolve(name: string): Promise<Command | undefined>;
11
+ has(name: string): boolean;
11
12
  list(): string[];
12
13
  }
13
14
  export declare function createDefaultRegistry(): CommandRegistry;
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/commands/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAA8B;IAC9C,OAAO,CAAC,IAAI,CAA0D;IAEtE,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI;IAI9C,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,GAAG,IAAI;IAI7E,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAKxB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC;IAezD,IAAI,IAAI,MAAM,EAAE;CAIjB;AAED,wBAAgB,qBAAqB,IAAI,eAAe,CA8FvD"}
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/commands/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAA8B;IAC9C,OAAO,CAAC,IAAI,CAA0D;IAEtE,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI;IAI9C,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,GAAG,IAAI;IAI7E,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAKxB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC;IAezD,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI1B,IAAI,IAAI,MAAM,EAAE;CAIjB;AAED,wBAAgB,qBAAqB,IAAI,eAAe,CA8FvD"}
@@ -1,4 +1,4 @@
1
1
  import { Command } from '../types.js';
2
- import { JobTable } from '../../shell/jobs.js';
3
- export declare function createKillCommand(jobTable: JobTable): Command;
2
+ import { ProcessRegistry } from '../../shell/ProcessRegistry.js';
3
+ export declare function createKillCommand(processRegistry: ProcessRegistry): Command;
4
4
  //# sourceMappingURL=kill.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"kill.d.ts","sourceRoot":"","sources":["../../../src/commands/system/kill.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAWpD,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAuF7D"}
1
+ {"version":3,"file":"kill.d.ts","sourceRoot":"","sources":["../../../src/commands/system/kill.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAWtE,wBAAgB,iBAAiB,CAAC,eAAe,EAAE,eAAe,GAAG,OAAO,CA4F3E"}
@@ -1,11 +1,28 @@
1
1
  import { Command } from '../types.js';
2
2
  import { CommandRegistry } from '../registry.js';
3
- import { VFS } from '../../kernel/vfs/index.js';
3
+ import { IKernelVfs } from '@lifo-sh/kernel';
4
4
  import { ShellExecuteFn } from './npm.js';
5
5
  export declare function createLifoPkgCommand(registry: CommandRegistry, _shellExecute?: ShellExecuteFn): Command;
6
6
  /**
7
7
  * Boot-time loader: restores dev-linked commands + re-registers
8
8
  * installed lifo packages with the lifo runtime.
9
9
  */
10
- export declare function bootLifoPackages(vfs: VFS, registry: CommandRegistry): void;
10
+ /**
11
+ * Re-register all globally installed packages into the command registry.
12
+ *
13
+ * Handles two kinds of packages:
14
+ * - lifo packages (have a lifo.json manifest) → registered via the lifo runtime
15
+ * - regular npm packages (have a "bin" field in package.json) → registered via node runner
16
+ *
17
+ * Called on every daemon boot so that packages installed via `npm install -g`
18
+ * or `lifo install` are available as shell commands, including after a snapshot
19
+ * restore where the VFS has the files but the registry is freshly created.
20
+ *
21
+ * Also restores dev-linked packages.
22
+ *
23
+ * Safe to call on a fresh VM — it is a no-op when /usr/lib/node_modules is empty.
24
+ */
25
+ export declare function rehydrateGlobalPackages(vfs: IKernelVfs, registry: CommandRegistry): void;
26
+ /** @deprecated Use rehydrateGlobalPackages() instead. */
27
+ export declare function bootLifoPackages(vfs: IKernelVfs, registry: CommandRegistry): void;
11
28
  //# sourceMappingURL=lifo.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lifo.d.ts","sourceRoot":"","sources":["../../../src/commands/system/lifo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAuC,MAAM,aAAa,CAAC;AAChF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAwY/C,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,eAAe,EACzB,aAAa,CAAC,EAAE,cAAc,GAC7B,OAAO,CAmCT;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,eAAe,GAAG,IAAI,CAkC1E"}
1
+ {"version":3,"file":"lifo.d.ts","sourceRoot":"","sources":["../../../src/commands/system/lifo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAuC,MAAM,aAAa,CAAC;AAChF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAwY/C,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,eAAe,EACzB,aAAa,CAAC,EAAE,cAAc,GAC7B,OAAO,CAmCT;AAED;;;GAGG;AACH;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,UAAU,EAAE,QAAQ,EAAE,eAAe,GAAG,IAAI,CAkDxF;AAED,yDAAyD;AACzD,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,UAAU,EAAE,QAAQ,EAAE,eAAe,GAAG,IAAI,CAEjF"}
@@ -0,0 +1,8 @@
1
+ import { Command } from '../types.js';
2
+ /**
3
+ * newtab - Add a new tab to the current session
4
+ * Usage: newtab [label]
5
+ * Note: Only works in browser environments with window.addHttpTab exposed
6
+ */
7
+ export declare function createNewtabCommand(): Command;
8
+ //# sourceMappingURL=newtab.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"newtab.d.ts","sourceRoot":"","sources":["../../../src/commands/system/newtab.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C;;;;GAIG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAoB7C"}
@@ -1,6 +1,7 @@
1
1
  import { Command } from '../types.js';
2
- import { VirtualRequestHandler } from '../../kernel/index.js';
3
- export declare function createNodeCommand(portRegistry: Map<number, VirtualRequestHandler>): Command;
2
+ import { VirtualRequestHandler, Kernel, IKernel } from '@lifo-sh/kernel';
3
+ export declare function createNodeImpl(kernelOrPortRegistry?: Kernel | IKernel | Map<number, VirtualRequestHandler>, shellExecuteFn?: (cmd: string, ctx: any) => Promise<number>): Command;
4
+ export declare function createNodeCommand(kernel: Kernel): Command;
4
5
  declare const command: Command;
5
6
  export default command;
6
7
  //# sourceMappingURL=node.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/commands/system/node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAS3C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AA2ZnE,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,qBAAqB,CAAC,GAAG,OAAO,CAE3F;AAGD,QAAA,MAAM,OAAO,EAAE,OAA0B,CAAC;AAE1C,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/commands/system/node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAO3C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAuC9E,wBAAgB,cAAc,CAC7B,oBAAoB,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,GAAG,CAAC,MAAM,EAAE,qBAAqB,CAAC,EAC5E,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC,MAAM,CAAC,GACzD,OAAO,CAgKT;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEzD;AAID,QAAA,MAAM,OAAO,EAAE,OAA6C,CAAC;AAE7D,eAAe,OAAO,CAAC"}
@@ -1,12 +1,25 @@
1
1
  import { Command, CommandContext } from '../types.js';
2
2
  import { CommandRegistry } from '../registry.js';
3
+ import { Kernel } from '@lifo-sh/kernel';
4
+ interface PackageJson {
5
+ name?: string;
6
+ version?: string;
7
+ description?: string;
8
+ main?: string;
9
+ bin?: string | Record<string, string>;
10
+ scripts?: Record<string, string>;
11
+ dependencies?: Record<string, string>;
12
+ devDependencies?: Record<string, string>;
13
+ license?: string;
14
+ author?: string | {
15
+ name: string;
16
+ };
17
+ }
3
18
  export type ShellExecuteFn = (cmd: string, ctx: CommandContext) => Promise<number>;
4
- export declare function createNpmCommand(registry: CommandRegistry, shellExecute?: ShellExecuteFn): Command;
5
- /**
6
- * Install a single npm package globally into the VFS.
7
- *
8
- * Called directly by `lifo install` to avoid the shell.execute()
9
- * round-trip which can silently swallow output and errors.
10
- */
19
+ export declare function getBinEntries(pkg: PackageJson): Record<string, string>;
20
+ export declare function registerBinCommand(registry: CommandRegistry, binName: string, scriptPath: string, kernel?: Kernel): void;
21
+ export declare function createNpmCommand(registry: CommandRegistry, shellExecute?: ShellExecuteFn, kernel?: Kernel): Command;
22
+ export declare function createNpxCommand(registry: CommandRegistry, shellExecute?: ShellExecuteFn): Command;
11
23
  export declare function npmInstallGlobal(packageName: string, ctx: CommandContext, registry: CommandRegistry): Promise<number>;
24
+ export {};
12
25
  //# sourceMappingURL=npm.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"npm.d.ts","sourceRoot":"","sources":["../../../src/commands/system/npm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAuB,MAAM,aAAa,CAAC;AAChF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAyCtD,MAAM,MAAM,cAAc,GAAG,CAC3B,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,cAAc,KAChB,OAAO,CAAC,MAAM,CAAC,CAAC;AA2sBrB,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,eAAe,EAAE,YAAY,CAAC,EAAE,cAAc,GAAG,OAAO,CA+ClG;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACpC,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,cAAc,EACnB,QAAQ,EAAE,eAAe,GACxB,OAAO,CAAC,MAAM,CAAC,CA2BjB"}
1
+ {"version":3,"file":"npm.d.ts","sourceRoot":"","sources":["../../../src/commands/system/npm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAuB,MAAM,aAAa,CAAC;AAChF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAuC9C,UAAU,WAAW;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,GAAG;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CACnC;AAmBD,MAAM,MAAM,cAAc,GAAG,CAC5B,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,cAAc,KACf,OAAO,CAAC,MAAM,CAAC,CAAC;AAoNrB,wBAAgB,aAAa,CAAC,GAAG,EAAE,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAMtE;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAaxH;AAumBD,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,eAAe,EAAE,YAAY,CAAC,EAAE,cAAc,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CA+CnH;AAiCD,wBAAgB,gBAAgB,CAC/B,QAAQ,EAAE,eAAe,EACzB,YAAY,CAAC,EAAE,cAAc,GAC3B,OAAO,CAyGT;AAED,wBAAsB,gBAAgB,CACrC,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,cAAc,EACnB,QAAQ,EAAE,eAAe,GACvB,OAAO,CAAC,MAAM,CAAC,CA2BjB"}
@@ -1,4 +1,5 @@
1
1
  import { Command } from '../types.js';
2
- import { JobTable } from '../../shell/jobs.js';
3
- export declare function createPsCommand(jobTable: JobTable): Command;
2
+ import { ProcessRegistry } from '../../shell/ProcessRegistry.js';
3
+ export declare function createPsCommand(processRegistry: ProcessRegistry): Command;
4
+ export declare function createPsCommandFromJobTable(jobTable: any): Command;
4
5
  //# sourceMappingURL=ps.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ps.d.ts","sourceRoot":"","sources":["../../../src/commands/system/ps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAuB3D"}
1
+ {"version":3,"file":"ps.d.ts","sourceRoot":"","sources":["../../../src/commands/system/ps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAW,MAAM,gCAAgC,CAAC;AAkE/E,wBAAgB,eAAe,CAAC,eAAe,EAAE,eAAe,GAAG,OAAO,CA4BzE;AAGD,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,GAAG,GAAG,OAAO,CAsBlE"}
@@ -0,0 +1,4 @@
1
+ import { Command } from '../types.js';
2
+ import { Kernel } from '@lifo-sh/kernel';
3
+ export declare function createSystemctlCommand(kernal: Kernel): Command;
4
+ //# sourceMappingURL=systemctl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"systemctl.d.ts","sourceRoot":"","sources":["../../../src/commands/system/systemctl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAezC,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CA8J9D"}
@@ -1,4 +1,4 @@
1
1
  import { Command } from '../types.js';
2
- import { JobTable } from '../../shell/jobs.js';
3
- export declare function createTopCommand(jobTable: JobTable): Command;
2
+ import { ProcessRegistry } from '../../shell/ProcessRegistry.js';
3
+ export declare function createTopCommand(processRegistry: ProcessRegistry): Command;
4
4
  //# sourceMappingURL=top.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"top.d.ts","sourceRoot":"","sources":["../../../src/commands/system/top.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAiD5D"}
1
+ {"version":3,"file":"top.d.ts","sourceRoot":"","sources":["../../../src/commands/system/top.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEtE,wBAAgB,gBAAgB,CAAC,eAAe,EAAE,eAAe,GAAG,OAAO,CA0C1E"}
@@ -1 +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"}
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,CA0ErE"}
@@ -1 +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;AAI3C,QAAA,MAAM,OAAO,EAAE,OAwBd,CAAC;AAEF,eAAe,OAAO,CAAC"}
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;AAK3C,QAAA,MAAM,OAAO,EAAE,OAwBd,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -1,4 +1,4 @@
1
- import { VFS } from '../kernel/vfs/index.js';
1
+ import { IKernel, IKernelVfs } from '@lifo-sh/kernel';
2
2
  export interface CommandOutputStream {
3
3
  write(text: string): void;
4
4
  }
@@ -7,10 +7,11 @@ export interface CommandInputStream {
7
7
  readAll(): Promise<string>;
8
8
  }
9
9
  export interface CommandContext {
10
+ kernel: IKernel;
10
11
  args: string[];
11
12
  env: Record<string, string>;
12
13
  cwd: string;
13
- vfs: VFS;
14
+ vfs: IKernelVfs;
14
15
  stdout: CommandOutputStream;
15
16
  stderr: CommandOutputStream;
16
17
  signal: AbortSignal;
@@ -1 +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;IAC3B,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CACzC;AAED,MAAM,MAAM,OAAO,GAAG,CAAC,GAAG,EAAE,cAAc,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/commands/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE3D,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,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,UAAU,CAAC;IAChB,MAAM,EAAE,mBAAmB,CAAC;IAC5B,MAAM,EAAE,mBAAmB,CAAC;IAC5B,MAAM,EAAE,WAAW,CAAC;IACpB,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CACzC;AAED,MAAM,MAAM,OAAO,GAAG,CAAC,GAAG,EAAE,cAAc,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { r as resolve, b as basename, V as VFSError } from "./index-GLjTMF7C.js";
2
+ const command = async (ctx) => {
3
+ if (ctx.args.length < 2) {
4
+ ctx.stderr.write("cp: missing operand\n");
5
+ return 1;
6
+ }
7
+ const src = resolve(ctx.cwd, ctx.args[0]);
8
+ let dest = resolve(ctx.cwd, ctx.args[1]);
9
+ try {
10
+ if (ctx.vfs.exists(dest)) {
11
+ const stat = ctx.vfs.stat(dest);
12
+ if (stat.type === "directory") {
13
+ dest = resolve(dest, basename(src));
14
+ }
15
+ }
16
+ ctx.vfs.copyFile(src, dest);
17
+ return 0;
18
+ } catch (e) {
19
+ if (e instanceof VFSError) {
20
+ ctx.stderr.write(`cp: ${e.message}
21
+ `);
22
+ return 1;
23
+ }
24
+ throw e;
25
+ }
26
+ };
27
+ export {
28
+ command as default
29
+ };