Skip to content

An open-source, self-hosted system for apps built with web technologies.

Provide authoritative native Host Storage

zohayrslileh7f0c9290446e
diff --git a/bun.lock b/bun.lock
index 61c6613..90e1792 100644
--- a/bun.lock
+++ b/bun.lock
@@ -24,7 +24,7 @@
"devDependencies": {
"@babel/core": "^7.29.7",
"@babel/plugin-proposal-decorators": "^7.29.7",
- "@phreshos/core": "^0.1.13",
+ "@phreshos/core": "^0.1.14",
"@phreshos/react-ui": "^0.1.6",
"@rolldown/plugin-babel": "^0.2.3",
"@tailwindcss/vite": "^4.3.3",
@@ -230,7 +230,7 @@
"@oxc-project/types": ["@oxc-project/[email protected]", "", {}, "sha512-nuhZIOLuI6TFQ32I/WnUx+SCPY7SdSKwgnFHydAuoS1+Z4BRcaP+RRJmGzl9lw+0OFF7UmaESf7KQRXaNLHypg=="],
- "@phreshos/core": ["@phreshos/[email protected]", "", {}, "sha512-d/p6MVRwuM03R8xbtGlKDgXWFXYtncVuhItymxv+B97Wxxcz9Pu6LOnRfyzM5FZgrOQyquSK6xb5L5yNYGit4g=="],
+ "@phreshos/core": ["@phreshos/[email protected]", "", {}, "sha512-57Js6CmnWvbE3f/NQ35hbIIPQmmPmCaLs3dee+m4P367wDgeMP/52WNBpTZoiJYbONaJGDDpIPxg8d7ohX9MXQ=="],
"@phreshos/react-ui": ["@phreshos/[email protected]", "", { "dependencies": { "react-aria-components": "^1.20.0" }, "peerDependencies": { "@phreshos/core": "^0.1.13", "react": "^19.2.0", "react-dom": "^19.2.0" } }, "sha512-Vm5nHAe7DK3+CW3AX2CA745+jeLs/pJFZyRQKNOJtzic2m21X3WX2eHAmxlY+c6bjrz8kkT34PIY4synjPTh/Q=="],
diff --git a/package.json b/package.json
index fa8ac18..10af8d5 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "phreshos",
"displayName": "PhreshOS",
- "version": "0.1.28",
+ "version": "0.1.29",
"description": "The PhreshOS server, desktop, and authoritative system runtime.",
"type": "module",
"private": true,
@@ -54,7 +54,7 @@
"devDependencies": {
"@babel/core": "^7.29.7",
"@babel/plugin-proposal-decorators": "^7.29.7",
- "@phreshos/core": "^0.1.13",
+ "@phreshos/core": "^0.1.14",
"@phreshos/react-ui": "^0.1.6",
"@rolldown/plugin-babel": "^0.2.3",
"@tailwindcss/vite": "^4.3.3",
diff --git a/source/server/core/application.ts b/source/server/core/application.ts
index 451689e..ee45516 100644
--- a/source/server/core/application.ts
+++ b/source/server/core/application.ts
@@ -8,6 +8,8 @@ import ThemeManager from "./theme-manager"
import WallpaperManager from "./wallpaper-manager"
import openStore from "./open-store"
import Keyv from "keyv"
+import FileArea from "@libs/file-area"
+import { homedir } from "node:os"
export default class Application {
@@ -22,6 +24,9 @@ export default class Application {
public readonly storage: FileManager
+ /** Native operating-system home exposed as the Server Host's Storage root. */
+ public readonly home: FileArea
+
/** Internal application persistence, reached publicly through named methods. */
public readonly store: Keyv
@@ -51,6 +56,8 @@ export default class Application {
this.storage = payload.storage
+ this.home = payload.home
+
this.encryptor = payload.encryptor
this.store = payload.store
@@ -72,6 +79,8 @@ export default class Application {
const storage = storagePath ? new FileManager(storagePath) : FileManager.forApp(name)
+ const home = new FileArea(homedir(), "the native home directory")
+
const store = openStore(storage.path)
const encryptor = await Encryptor.initialize(storage.join("private.pem"))
@@ -84,7 +93,7 @@ export default class Application {
const wallpaperManager = await WallpaperManager.open(store, servedFiles)
- const application = new Application({ name, displayName, version, defaultProgramIcon, storage, store, encryptor, authentication, themeManager, wallpaperManager, servedFiles })
+ const application = new Application({ name, displayName, version, defaultProgramIcon, storage, home, store, encryptor, authentication, themeManager, wallpaperManager, servedFiles })
await application.linkManager.authManager.programManager.initialize()
@@ -106,6 +115,8 @@ interface ApplicationPayload {
storage: FileManager
+ home: FileArea
+
store: Keyv
encryptor: Encryptor
diff --git a/source/server/core/link-manager/auth-manager/process-manager/process-manager.ts b/source/server/core/link-manager/auth-manager/process-manager/process-manager.ts
index 5b001f2..b378fe1 100644
--- a/source/server/core/link-manager/auth-manager/process-manager/process-manager.ts
+++ b/source/server/core/link-manager/auth-manager/process-manager/process-manager.ts
@@ -1873,6 +1873,16 @@ export default class ProcessManager extends TheLink {
return [programManager.operate(program, word, "path", [])]
}
+ // Native filesystem work remains local to the Server SDK. The System
+ // supplies only its authoritative home root; Storage confines every
+ // operation performed beneath it.
+ if (word === "host-storage") {
+
+ if (rest[0] !== "path") throw new Error("A server half asks the host only for its Storage path")
+
+ return [this.authManager.linkManager.application.home.path]
+ }
+
// What a program has said, asked for and never told. The
// connection behind this is read-only, so a query that tries to
// change what it reads is refused by the database rather than by