Commit Graph

538 Commits

Author SHA1 Message Date
Sam Atkins
bec2d62e2f Phoenix: Use regular code path to run built-in apps
Now launchApp() can always be awaited, we can run built-in apps using
the same code path for other apps, and eventually have SIGINT close
them.
2024-04-18 15:00:38 +01:00
Sam Atkins
3526d5d9eb 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-18 15:00:38 +01:00
Sam Atkins
2890f19bfd Report when a non-SDK app closes
puter.ui.launchApp() returns a Promise that needs to resolve whether the
app uses the Puter SDK or not. Non-SDK apps are tricky because they
don't send a READY message on startup, and we don't know in advance
whether an app will use the SDK or not.

This is a workaround to ensure that launchApp() always resolves. When an
app is closed, if it wasn't using the SDK, we send an artificial
notification that it launched, followed by an extra notification that
it has closed (because the original close notification was sent before
this point). This means any users of launchApp() can await it, and get
an AppConnection, and listen to the close event. They can't otherwise
interact with a non-SDK app because it will have closed already, but we
can improve this in the future without breaking the API.
2024-04-18 15:00:38 +01:00
Sam Atkins
cce5cda640 Let AppConnection know if its target app uses the Puter SDK
Apps are not required to use the Puter SDK. If they don't, then we can
still launch them, close them, and listen to their close event, but are
unable to send messages to them.
2024-04-18 15:00:38 +01:00
Sam Atkins
b03f6fae6d Extract some helper functions for accessing a window/iframe by uuid 2024-04-18 15:00:38 +01:00
Eric Dubé
04a641adc2
Merge pull request #291 from AtkinsSJ/test-submodules
Re-enable Phoenix tests
2024-04-17 10:08:43 -04:00
Eric Dubé
2210652643
Merge pull request #295 from AtkinsSJ/remove-phoenix-css
Phoenix: Remove unwanted CSS includes
2024-04-17 10:07:33 -04:00
Sam Atkins
f2e8b5ee3e Phoenix: Remove unwanted CSS includes 2024-04-17 11:05:03 +01:00
KernelDeimos
7e0c6c6470 Fix last_activity_ts 2024-04-16 19:30:30 -04:00
KernelDeimos
19c49db538 Improve sessions 2024-04-16 18:57:02 -04:00
Sam Atkins
ea40ac1e53 Re-enable Phoenix tests
This also runs the tests for contextlink, which I think we previously
never ran. I don't see any other packages that define an `npm test`
command. Having to manually list all the sub-package test directories in
the top-level package.json is a bit unfortunate, but it works.

For Puter itself we support Node 16.x IIRC, but Phoenix requires at
least 20.x currently.
2024-04-16 13:57:02 +01:00
KernelDeimos
653898b463 Report proper error when an operation is invalid 2024-04-15 22:27:03 -04:00
KernelDeimos
c07d0a2bc7 Set NO_VAR_RUNTIME in Dockerfile 2024-04-15 20:47:27 -04:00
KernelDeimos
9bb221a0d7 Fix Dockerfile 2024-04-15 19:03:00 -04:00
Eric Dubé
e4f2c4a28b
Merge pull request #280 from vineeth-vk11/#206
fixing on conflict issue in sqlite kv write
2024-04-15 17:55:52 -04:00
Eric Dubé
3a4858b83c
Merge pull request #286 from AtkinsSJ/background-settings
Settings: Organise code to be grouped by tab, and add desktop background picker
2024-04-15 17:55:09 -04:00
KernelDeimos
826ea36502 Add use_bundled_gui option 2024-04-15 17:50:44 -04:00
KernelDeimos
397819d45e Add missing endpoint /down 2024-04-15 16:38:03 -04:00
KernelDeimos
66fecf88ef Fix funny context menu on task manager 2024-04-15 15:58:07 -04:00
KernelDeimos
e8dc220981 This is 2.1.0 I decided 2024-04-15 15:37:13 -04:00
KernelDeimos
1c2b05d8f6 Fix phoenix for auto ports 2024-04-15 15:34:58 -04:00
KernelDeimos
f3495f3098 Fix xterm.css not loading 2024-04-15 14:46:16 -04:00
KernelDeimos
081b093e7e Add missing asset for xterm, fix SDK url 2024-04-15 14:43:15 -04:00
KernelDeimos
4d30753958 Fix more phoenix dev issues 2024-04-15 14:25:40 -04:00
KernelDeimos
c72e0cb0e0 Fix phoenix watcher 2024-04-15 14:08:50 -04:00
KernelDeimos
25f8dbf120 Add postinstall for phoenix 2024-04-15 14:02:49 -04:00
Sam Atkins
868202ba41 Settings: Add desktop-background setting to 'Personalization' tab 2024-04-15 17:41:19 +01:00
Sam Atkins
c6b0ed32bf Settings: Move 'Clock' tab into its own file 2024-04-15 17:41:19 +01:00
Sam Atkins
17adef11a6 Settings: Move 'Language' tab into its own file
Also implement an optional `on_show` callback for settings tabs, to
support the "select and clear the search field" behaviour we had before.
2024-04-15 17:41:19 +01:00
Sam Atkins
6d1c807879 Settings: Move 'Personalization' tab into its own file 2024-04-15 17:41:19 +01:00
Sam Atkins
0ed5b20627 Settings: Move 'Account' tab into its own file 2024-04-15 17:41:19 +01:00
Sam Atkins
f5175941d9 Settings: Move 'Usage' tab into its own file 2024-04-15 17:41:19 +01:00
Sam Atkins
e2f048ec2d Settings: Move 'About'-specific logic and data into UITabAbout.js
Keeping all the logic and data for the tab together should make it
easier to modify.
2024-04-15 17:41:19 +01:00
KernelDeimos
2717444c29 Oops 2024-04-15 12:17:09 -04:00
KernelDeimos
b21755b5a3 Fix casualty of phoenix due to Docker naming conventions 2024-04-15 12:12:28 -04:00
KernelDeimos
37ff97b52f Thanks minify 2024-04-15 03:59:39 -04:00
Eric Dubé
b897598fac
Merge pull request #282 from HeyPuter/eric/task-manager
Add a task manager
2024-04-15 03:53:51 -04:00
Eric Dubé
95cb92abed
Remove outdated information 2024-04-15 03:50:46 -04:00
KernelDeimos
5730dc642a Add process ending and i18n 2024-04-15 03:37:04 -04:00
KernelDeimos
7c2a3b4612 Portal shows up as 'app' 2024-04-15 02:12:39 -04:00
Nariman Jelveh
dbf796d698 Update index.js 2024-04-14 21:27:25 -07:00
Nariman Jelveh
7f739a53f8
Merge pull request #281 from HeyPuter/change-email-feature
Change email feature
2024-04-14 21:10:57 -07:00
Nariman Jelveh
2dbde52338 live-update email address after change 2024-04-14 21:09:41 -07:00
KernelDeimos
61f1caa122 Add type column 2024-04-14 23:58:14 -04:00
Nariman Jelveh
695d7b8654 Update UIDesktop.js 2024-04-14 20:53:31 -07:00
KernelDeimos
6e7fd2ca95 Add polling 2024-04-14 23:52:53 -04:00
KernelDeimos
79bfcf226b Integrate ProcessService with task manager 2024-04-14 23:52:53 -04:00
KernelDeimos
9d9e091a7a Add process management 2024-04-14 23:52:53 -04:00
KernelDeimos
be1bb6bc06 Improve task manager style 2024-04-14 23:52:53 -04:00
KernelDeimos
d39bb412f3 Begin work on task manager 2024-04-14 23:52:53 -04:00