Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
133 changes: 116 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,19 @@ Example:
"schemaVersion": 1,
"id": "com.example.notes",
"name": "Notes",
"version": "0.0.0",
"runtime": "route-source",
"permissions": [
"storage:readWrite"
],
"version": "0.1.0",
"runtime": "standalone",
"runtimeConfig": {
"engine": "react"
},
"permissions": ["storage:readWrite"],
"launch": {
"path": "/apps/com.example.notes"
},
"extensionPoints": {
"launcher": true,
"sidebar": true
},
"compatibility": {
"minPlatformVersion": "0.1.0"
}
Expand All @@ -183,21 +191,106 @@ Example:
Current runtime types:

```txt
route-source
iframe-local
iframe-remote
external
standalone
dom
iframe
```

Initial versions of Sovereign focus on:
## `standalone`

Apps loaded directly by the Sovereign platform.

Use this for trusted plugins that should be served or bundled by the platform itself.

Supported engines:

```txt
route-source
react
html
```

Example:

```json
{
"runtime": "standalone",
"runtimeConfig": {
"engine": "react"
}
}
```

Standalone HTML apps use a plugin-local entrypoint:

```json
{
"runtime": "standalone",
"runtimeConfig": {
"engine": "html",
"entrypoint": "index.html"
}
}
```

apps built directly into the platform runtime.
## `dom`

Sandboxed runtimes will be introduced later.
Apps served by a DOM application server and embedded by Sovereign.

Use this for Vite, React, or other DOM app development servers.

Example:

```json
{
"runtime": "dom",
"runtimeConfig": {
"engine": "react",
"host": "localhost",
"port": "4000"
}
}
```

## `iframe`

Apps hosted in an iframe. The iframe can point at a local plugin entrypoint, a local dev server, or a remote host.

Local HTML entrypoint:

```json
{
"runtime": "iframe",
"runtimeConfig": {
"engine": "html",
"entrypoint": "iframe/index.html"
}
}
```

Local or remote host:

```json
{
"runtime": "iframe",
"runtimeConfig": {
"engine": "*",
"host": "example.com",
"https": true,
"uri": "/#test"
}
}
```

The current manifest schema uses flat `runtimeConfig` fields:

```txt
engine
entrypoint
host
port
https
uri
```

---

Expand All @@ -209,10 +302,16 @@ Examples:

```txt
auth:profile
storage:readWrite
auth:read
auth:write
storage:read
storage:write
notifications:send
files:pick
notifications:recieve
fs:read
fs:write
events:publish
events:subscribe
```

Apps interact with platform features through the Sovereign SDK.
Expand Down Expand Up @@ -249,7 +348,7 @@ yarn generate
## Validate App Manifest

```bash
yarn validate:manifest plugins/com.sovereign.launcher/manifest.json
yarn validate:manifest plugins/com.sovereign-demo.iframe-html/manifest.json
```

---
Expand All @@ -272,4 +371,4 @@ Current focus areas:

# License

AGPL-3.0
AGPL-3.0
110 changes: 68 additions & 42 deletions packages/manifest/schema/manifest.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"version": { "type": "string" },
"runtime": {
"type": "string",
"enum": ["internal", "route-source", "iframe-local", "iframe-remote", "external"]
"enum": ["standalone", "dom", "iframe"]
},
"permissions": {
"type": "array",
Expand All @@ -42,40 +42,35 @@
"properties": {
"engine": {
"type": "string",
"enum": ["vite:react-ts"]
"enum": ["react", "html", "*"]
},
"iframeLocal": {
"type": "object",
"required": ["entrypoint"],
"properties": {
"entrypoint": {
"type": "string",
"pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$)).+$"
}
},
"additionalProperties": false
"host": {
"type": "string",
"minLength": 1
},
"iframeRemote": {
"type": "object",
"required": ["url"],
"properties": {
"url": {
"port": {
"oneOf": [
{
"type": "string",
"pattern": "^https://.+"
"pattern": "^[0-9]+$"
},
{
"type": "integer",
"minimum": 1,
"maximum": 65535
}
},
"additionalProperties": false
]
},
"external": {
"type": "object",
"required": ["url"],
"properties": {
"url": {
"type": "string",
"pattern": "^https://.+"
}
},
"additionalProperties": false
"https": {
"type": "boolean"
},
"uri": {
"type": "string",
"pattern": "^/"
},
"entrypoint": {
"type": "string",
"pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$)).+$"
}
},
"additionalProperties": false
Expand Down Expand Up @@ -107,7 +102,7 @@
{
"if": {
"properties": {
"runtime": { "const": "internal" }
"runtime": { "const": "standalone" }
},
"required": ["runtime"]
},
Expand All @@ -116,15 +111,20 @@
"properties": {
"runtimeConfig": {
"type": "object",
"required": ["engine"]
"required": ["engine"],
"properties": {
"engine": {
"enum": ["react", "html"]
}
}
}
}
}
},
{
"if": {
"properties": {
"runtime": { "const": "iframe-local" }
"runtime": { "const": "dom" }
},
"required": ["runtime"]
},
Expand All @@ -133,41 +133,67 @@
"properties": {
"runtimeConfig": {
"type": "object",
"required": ["iframeLocal"]
"required": ["engine", "host", "port"]
}
}
}
},
{
"if": {
"properties": {
"runtime": { "const": "iframe-remote" }
"runtime": { "const": "standalone" },
"runtimeConfig": {
"type": "object",
"properties": {
"engine": { "const": "html" }
},
"required": ["engine"]
}
},
"required": ["runtime"]
"required": ["runtime", "runtimeConfig"]
},
"then": {
"required": ["runtimeConfig"],
"properties": {
"runtimeConfig": {
"type": "object",
"required": ["iframeRemote"]
"required": ["entrypoint"]
}
}
}
},
{
"if": {
"properties": {
"runtime": { "const": "external" }
"runtime": { "const": "iframe" },
"runtimeConfig": {
"type": "object",
"required": ["entrypoint"]
}
},
"required": ["runtime"]
"required": ["runtime", "runtimeConfig"]
},
"then": {
"required": ["runtimeConfig"],
"properties": {
"runtimeConfig": {
"type": "object",
"required": ["external"]
"required": ["engine"]
}
}
},
"else": {
"if": {
"properties": {
"runtime": { "const": "iframe" }
},
"required": ["runtime"]
},
"then": {
"required": ["runtimeConfig"],
"properties": {
"runtimeConfig": {
"type": "object",
"required": ["engine", "host"]
}
}
}
}
Expand Down
Loading