puter/packages/phoenix
Sam Atkins e355c77a4a Phoenix: Wait for apps to finish executing, and connect stdio to them
After launching an app, if successful, we connect stdio streams to it,
and wait for it to exit before we return to the prompt.

stdio is implemented as regular AppConnection messages:
- stdin:  `{ $: 'stdin',  data: Uint8Array }` from phoenix -> child
- stdout: `{ $: 'stdout', data: Uint8Array }` from child -> phoenix

Terminal and Phoenix now communicate with each other using the same
style, instead of 'input' and 'output' messages. This will help with
eventually running subshells.

SIGINT currently is not sent. We also suffer from the same "one more
read from stdin happens after app exits" bug that's in
PathCommandProvider where I copied the stdin code from.
2024-04-19 15:52:59 +01:00
..
assets Phoenix: Remove unwanted CSS includes 2024-04-17 11:05:03 +01:00
config Copy over phoenix 2024-04-12 20:53:44 -04:00
doc Copy over phoenix 2024-04-12 20:53:44 -04:00
packages Copy over phoenix 2024-04-12 20:53:44 -04:00
src Phoenix: Wait for apps to finish executing, and connect stdio to them 2024-04-19 15:52:59 +01:00
test Phoenix: Support older Node versions in test harness 2024-04-18 14:41:06 +01:00
tools Copy over phoenix 2024-04-12 20:53:44 -04:00
.gitignore Copy over phoenix 2024-04-12 20:53:44 -04:00
LICENSE Copy over phoenix 2024-04-12 20:53:44 -04:00
notalicense-license-checker-config.json Copy over phoenix 2024-04-12 20:53:44 -04:00
package-lock.json Add postinstall for phoenix 2024-04-15 14:02:49 -04:00
package.json Make node-pty not required 2024-04-13 13:56:57 -04:00
README.md Update README.md files for monorepo'd projects 2024-04-12 23:54:41 -04:00
rollup.config.js Fix more phoenix dev issues 2024-04-15 14:25:40 -04:00
run.json5 Copy over phoenix 2024-04-12 20:53:44 -04:00
test.js Copy over phoenix 2024-04-12 20:53:44 -04:00

Phoenix

Puter's pure-javascript shell


phoenix is a pure-javascript shell built for puter.com. Following the spirit of open-source initiatives we've seen like SerenityOS, we've built much of the shell's functionality from scratch. Some interesting portions of this shell include:

  • A shell parser which produces a Concrete-Syntax-Tree
  • Pipeline constructs built on top of the Streams API
  • Platform support for Puter

The shell is a work in progress. The following improvements are considered in-scope:

  • Anything specified in POSIX.1-2017 Chapter 2
  • UX improvements over traditional shells

    examples include: readline syntax highlighting, hex view for binary streams

  • Platform support, so phoenix can run in more environments

Running Phoenix

In a Browser

You can use the terminal on Puter, including self-hosted installations.

Running in Node

Under node.js Phoenix acts as a shell for your operating system. This is a work-in-progress and lots of things are not working yet. If you'd like to try it out you can run src/main_cli.js. Check this issue for updated information on our progress.

Testing

You can find our tests in the test/ directory. Testing is done with mocha. Make sure it's installed, then run:

npm test

What's on the Roadmap?

We're looking to continue improving the shell and broaden its usefulness. Here are a few ideas we have for the future: