@lifo-sh/core 0.1.0 → 0.2.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 (56) hide show
  1. package/README.md +65 -0
  2. package/dist/{archive-D220So0m.js → archive-nRHWNwjH.js} +1 -1
  3. package/dist/{awk-rMPdpM91.js → awk-CchAsBzt.js} +1 -1
  4. package/dist/{basename-C33A_Zse.js → basename-C2v8jn7p.js} +1 -1
  5. package/dist/{cat-Crmqa4-2.js → cat-B2exoWlk.js} +1 -1
  6. package/dist/{chmod-CcGyvoCX.js → chmod-CQS63aP7.js} +1 -1
  7. package/dist/{chown-CErsnGQX.js → chown-rgGwZwu9.js} +1 -1
  8. package/dist/{cp-CpjwiLUF.js → cp-C8mNek36.js} +1 -1
  9. package/dist/{cut-GfN8py4j.js → cut-BZez9bS1.js} +1 -1
  10. package/dist/{diff-2wbVWmCT.js → diff-tWPvmikU.js} +1 -1
  11. package/dist/{dirname-C5L53RA2.js → dirname-BY_Gu5i2.js} +1 -1
  12. package/dist/{du-B0shJpEL.js → du-D25egSeK.js} +1 -1
  13. package/dist/{file-C2epVYvH.js → file-BPs1dqg5.js} +1 -1
  14. package/dist/{find-DA-rpvsC.js → find-CRUAXbhO.js} +1 -1
  15. package/dist/{grep-Bynq2w2E.js → grep-B9pTCSNY.js} +1 -1
  16. package/dist/{gunzip-B9b1Vph1.js → gunzip-BYlJhPf7.js} +2 -2
  17. package/dist/{gzip-CkXnPp5J.js → gzip-DgE-9PzE.js} +2 -2
  18. package/dist/{head-DZJVLF1k.js → head-DzP_T5Wx.js} +1 -1
  19. package/dist/{index-Be1wosKt.js → index-DccAPaZF.js} +861 -879
  20. package/dist/index.d.ts +2 -1
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +12 -12
  23. package/dist/{ls-CSeazevv.js → ls-BiT10kLm.js} +1 -1
  24. package/dist/{mkdir-B7p8krsP.js → mkdir-DgzJ2JLj.js} +1 -1
  25. package/dist/{mktemp-88Nhvd7h.js → mktemp-Sh5DWxvc.js} +1 -1
  26. package/dist/{mv-DRVvz9oK.js → mv-Kp6DjQ8n.js} +1 -1
  27. package/dist/{nl-G2vK3rR3.js → nl-DBLFdpfC.js} +1 -1
  28. package/dist/{realpath-C-kisl-F.js → realpath-BOeYN6nD.js} +1 -1
  29. package/dist/{rev-9puwegeh.js → rev-CWRUIXWp.js} +1 -1
  30. package/dist/{rm-BXSq9iqP.js → rm-DA2w3xTR.js} +1 -1
  31. package/dist/{rmdir-CWgZ6q8D.js → rmdir-BiGbNDOT.js} +1 -1
  32. package/dist/sandbox/HeadlessTerminal.d.ts +2 -1
  33. package/dist/sandbox/HeadlessTerminal.d.ts.map +1 -1
  34. package/dist/sandbox/Sandbox.d.ts.map +1 -1
  35. package/dist/sandbox/types.d.ts +3 -2
  36. package/dist/sandbox/types.d.ts.map +1 -1
  37. package/dist/{sed-BRxd2DlZ.js → sed-ClWZ06zX.js} +1 -1
  38. package/dist/shell/Shell.d.ts +2 -2
  39. package/dist/shell/Shell.d.ts.map +1 -1
  40. package/dist/{sort-B7K83hAD.js → sort-CSzSGTdB.js} +1 -1
  41. package/dist/{stat-C0qs7xMV.js → stat-D0i1gTKB.js} +1 -1
  42. package/dist/{tail-CYBTYnn3.js → tail-tcIJLQnB.js} +1 -1
  43. package/dist/{tar-mMS7gfb-.js → tar-DkyzTzmT.js} +2 -2
  44. package/dist/{tee-B8bXFHbI.js → tee-RqoZ3qG-.js} +1 -1
  45. package/dist/terminal/ITerminal.d.ts +10 -0
  46. package/dist/terminal/ITerminal.d.ts.map +1 -0
  47. package/dist/{touch-CdAHKfLv.js → touch-k2NomRzL.js} +1 -1
  48. package/dist/{tree-BiWLXiUu.js → tree-B_j2_PsZ.js} +1 -1
  49. package/dist/{uniq-BZMOwoCc.js → uniq-hzJnHQOm.js} +1 -1
  50. package/dist/{unzip-DP4I991d.js → unzip-FwYCTDEZ.js} +2 -2
  51. package/dist/{wc-CpE5K4ZI.js → wc-Jp7nOops.js} +1 -1
  52. package/dist/{wget-DIPI0-I3.js → wget-2NAABIHc.js} +1 -1
  53. package/dist/{zip-B_gQ6LXC.js → zip--0ncHv0q.js} +2 -2
  54. package/package.json +35 -11
  55. package/dist/terminal/Terminal.d.ts +0 -13
  56. package/dist/terminal/Terminal.d.ts.map +0 -1
package/README.md ADDED
@@ -0,0 +1,65 @@
1
+ # @lifo-sh/core
2
+
3
+ Core engine for [Lifo](https://github.com/lifo-sh/lifo) -- a Linux-like OS that runs natively in JavaScript. Provides the kernel, virtual filesystem, shell, and 60+ commands.
4
+
5
+ Works in both browser and Node.js environments.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install @lifo-sh/core
11
+ ```
12
+
13
+ ## Quick Start
14
+
15
+ ### Headless / Programmatic
16
+
17
+ ```typescript
18
+ import { Sandbox } from '@lifo-sh/core';
19
+
20
+ const sandbox = await Sandbox.create();
21
+
22
+ const result = await sandbox.commands.run('echo hello world');
23
+ console.log(result.stdout); // "hello world\n"
24
+
25
+ await sandbox.fs.writeFile('/tmp/greeting.txt', 'Hi there');
26
+ const content = await sandbox.fs.readFile('/tmp/greeting.txt');
27
+ console.log(content); // "Hi there"
28
+ ```
29
+
30
+ ### Browser with Terminal UI
31
+
32
+ ```typescript
33
+ import { Sandbox } from '@lifo-sh/core';
34
+
35
+ // Requires @lifo-sh/ui as an optional peer dependency
36
+ const sandbox = await Sandbox.create({
37
+ terminal: '#terminal-container',
38
+ persist: true,
39
+ });
40
+ ```
41
+
42
+ ## What's Included
43
+
44
+ - **Kernel** -- virtual filesystem (VFS), virtual `/proc` and `/dev` providers, IndexedDB persistence
45
+ - **Shell** -- bash-like interpreter with pipes, redirects, globs, variables, job control, tab completion, history
46
+ - **60+ commands** -- `ls`, `grep`, `awk`, `sed`, `curl`, `node`, `tar`, `find`, and more
47
+ - **Sandbox API** -- high-level `commands.run()` and `fs.*` for programmatic use
48
+ - **Node.js compat layer** -- run JS files with `node script.js` using shimmed `fs`, `path`, `http`, etc.
49
+
50
+ ## Packages
51
+
52
+ | Package | Description |
53
+ |---|---|
54
+ | **@lifo-sh/core** | Kernel, shell, commands, sandbox API |
55
+ | [@lifo-sh/ui](https://www.npmjs.com/package/@lifo-sh/ui) | Terminal UI (xterm.js wrapper) |
56
+ | [lifo-sh](https://www.npmjs.com/package/lifo-sh) | CLI -- run Lifo in your terminal |
57
+
58
+ ## Links
59
+
60
+ - [GitHub](https://github.com/lifo-sh/lifo)
61
+ - [Issues](https://github.com/lifo-sh/lifo/issues)
62
+
63
+ ## License
64
+
65
+ MIT
@@ -1,4 +1,4 @@
1
- import { r as x, d as C, c as U, f as A, h as L } from "./index-Be1wosKt.js";
1
+ import { r as x, d as C, c as U, f as A, h as L } from "./index-DccAPaZF.js";
2
2
  const S = new Uint32Array(256);
3
3
  for (let t = 0; t < 256; t++) {
4
4
  let e = t;
@@ -1,4 +1,4 @@
1
- import { r as E, V as N } from "./index-Be1wosKt.js";
1
+ import { r as E, V as N } from "./index-DccAPaZF.js";
2
2
  function S(e) {
3
3
  const a = [];
4
4
  let t = e.trim();
@@ -1,4 +1,4 @@
1
- import { b as a } from "./index-Be1wosKt.js";
1
+ import { b as a } from "./index-DccAPaZF.js";
2
2
  const t = async (s) => {
3
3
  if (s.args.length === 0)
4
4
  return s.stderr.write(`basename: missing operand
@@ -1,4 +1,4 @@
1
- import { r as o, V as a } from "./index-Be1wosKt.js";
1
+ import { r as o, V as a } from "./index-DccAPaZF.js";
2
2
  const d = async (r) => {
3
3
  if (r.args.length === 0) {
4
4
  if (r.stdin) {
@@ -1,4 +1,4 @@
1
- import { r as u, V as l } from "./index-Be1wosKt.js";
1
+ import { r as u, V as l } from "./index-DccAPaZF.js";
2
2
  function h(t, d) {
3
3
  if (/^[0-7]+$/.test(t))
4
4
  return parseInt(t, 8);
@@ -1,5 +1,5 @@
1
1
  import { p as i } from "./args-CG6b9cZt.js";
2
- import { r as c, V as f } from "./index-Be1wosKt.js";
2
+ import { r as c, V as f } from "./index-DccAPaZF.js";
3
3
  const l = {
4
4
  recursive: { type: "boolean", short: "R" }
5
5
  }, d = async (s) => {
@@ -1,4 +1,4 @@
1
- import { r as t, b as n, V as o } from "./index-Be1wosKt.js";
1
+ import { r as t, b as n, V as o } from "./index-DccAPaZF.js";
2
2
  const f = async (s) => {
3
3
  if (s.args.length < 2)
4
4
  return s.stderr.write(`cp: missing operand
@@ -1,4 +1,4 @@
1
- import { r as d, V as c } from "./index-Be1wosKt.js";
1
+ import { r as d, V as c } from "./index-DccAPaZF.js";
2
2
  function u(e) {
3
3
  const r = [];
4
4
  for (const n of e.split(",")) {
@@ -1,5 +1,5 @@
1
1
  import { p as m } from "./args-CG6b9cZt.js";
2
- import { r as y, V as w } from "./index-Be1wosKt.js";
2
+ import { r as y, V as w } from "./index-DccAPaZF.js";
3
3
  const C = {
4
4
  unified: { type: "boolean", short: "u" }
5
5
  };
@@ -1,4 +1,4 @@
1
- import { d as a } from "./index-Be1wosKt.js";
1
+ import { d as a } from "./index-DccAPaZF.js";
2
2
  const s = async (r) => {
3
3
  if (r.args.length === 0)
4
4
  return r.stderr.write(`dirname: missing operand
@@ -1,4 +1,4 @@
1
- import { r as y, V as g } from "./index-Be1wosKt.js";
1
+ import { r as y, V as g } from "./index-DccAPaZF.js";
2
2
  function u(t) {
3
3
  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";
4
4
  }
@@ -1,4 +1,4 @@
1
- import { r as d, e as c, V as f } from "./index-Be1wosKt.js";
1
+ import { r as d, e as c, V as f } from "./index-DccAPaZF.js";
2
2
  const n = {
3
3
  ".txt": "ASCII text",
4
4
  ".md": "Markdown text",
@@ -1,4 +1,4 @@
1
- import { r as m, V as d, g as p } from "./index-Be1wosKt.js";
1
+ import { r as m, V as d, g as p } from "./index-DccAPaZF.js";
2
2
  const c = async (t) => {
3
3
  let f = ".", i = "", a = "", l = 1 / 0;
4
4
  for (let e = 0; e < t.args.length; e++) {
@@ -1,4 +1,4 @@
1
- import { r as M, V } from "./index-Be1wosKt.js";
1
+ import { r as M, V } from "./index-DccAPaZF.js";
2
2
  const A = async (r) => {
3
3
  const c = r.args;
4
4
  let w = !1, y = !1, b = !1, u = !1, k = !1, p = !1, m = !1, o = "";
@@ -1,5 +1,5 @@
1
- import { r as u, V as d } from "./index-Be1wosKt.js";
2
- import { d as p } from "./archive-D220So0m.js";
1
+ import { r as u, V as d } from "./index-DccAPaZF.js";
2
+ import { d as p } from "./archive-nRHWNwjH.js";
3
3
  const w = async (e) => {
4
4
  let o = !1;
5
5
  const t = [];
@@ -1,5 +1,5 @@
1
- import { r as p, V as l } from "./index-Be1wosKt.js";
2
- import { d as u, b as c } from "./archive-D220So0m.js";
1
+ import { r as p, V as l } from "./index-DccAPaZF.js";
2
+ import { d as u, b as c } from "./archive-nRHWNwjH.js";
3
3
  const g = async (e) => {
4
4
  let t = !1, d = !1;
5
5
  const o = [];
@@ -1,4 +1,4 @@
1
- import { r as d, V as f } from "./index-Be1wosKt.js";
1
+ import { r as d, V as f } from "./index-DccAPaZF.js";
2
2
  const h = async (e) => {
3
3
  let r = 10;
4
4
  const i = [];