Remove the special cases for the old Browser package
A browser request now needs the session token of its window. Disabling an old runestone.browser package no longer stops the engine. One list of built-in modules starts the browser and the theme editor, and the plugin menus skip their tools. The access rules no longer treat the browser ID in a special way.
This commit is contained in:
+6
-2
@@ -31,6 +31,9 @@ The service writes `plugin-state.json` to a temporary file, then renames it. It
|
||||
After each change, the service sends the `plugins-changed` event to all windows. A settings write sends `plugin-settings-changed` with the plugin ID.
|
||||
The browser preview (`pnpm dev`) has no installed plugins unless a smoke test supplies a desktop mock.
|
||||
|
||||
The built-in browser and the theme editor use the plugin API, but they are not packages. `builtInModules` in `src/lib/plugins/external.ts` lists them. The host starts them in each window, and the plugin menus do not list their tools. A browser window starts only the browser.
|
||||
`builtInPackages` lists the IDs of old packages for features that RuneStone now includes. The host never loads such a package. Settings → Plug-ins shows it as included with RuneStone, so that the user can remove it.
|
||||
|
||||
### Scans
|
||||
|
||||
Each window asks for a new snapshot at these times:
|
||||
@@ -182,7 +185,7 @@ Workers that the app loads from its own files get no policy. Workers from Blob U
|
||||
| --- | --- | --- | --- |
|
||||
| `default.json` | `main`, `workspace-*`, `terminal-*` | All enabled plugins | All app commands |
|
||||
| `settings.json` | `settings-main`, `settings-workspace-*` | All enabled plugins | Settings, plugins, backgrounds, completion, browser |
|
||||
| `browser.json` | `browser-*` | Only the built-in browser (`src/routes/+page.svelte`) | Browser, `plugins_snapshot`, settings, spelling, and window controls |
|
||||
| `browser.json` | `browser-*` | Only the built-in browser (`builtInModules` in `src/lib/plugins/external.ts`) | Browser, `plugins_snapshot`, settings, spelling, and window controls |
|
||||
|
||||
A browser window loads no installed plugin, so its capability has no workspace, file, Git, terminal, or plugin package commands. `tests/unit/plugins/windowCapabilities.spec.ts` and `tests/smoke/browser/window.smoke.mjs` check this.
|
||||
|
||||
@@ -192,7 +195,8 @@ The other windows load every enabled plugin. A smaller command set for them woul
|
||||
- Settings windows use no `workspace_*`, `git_*`, or `pty_*` commands, but plugin settings views run there.
|
||||
- Commands that need a workspace (`workspace_*`, `git_*`, `pty_open`, `pty_new_window`) fail in a window without a bound workspace.
|
||||
- `pty_write`, `pty_resize`, and `pty_close` do not check the window that opened the terminal.
|
||||
- `backgrounds_*`, and `browser_request` without a browser session token, need a plugin lease of the calling window.
|
||||
- `backgrounds_*` need a plugin lease of the calling window.
|
||||
- `browser_request` needs the session token that `browser_connect` gives the window. A plugin lease does not replace it.
|
||||
- A new command for plugins goes in `default.json` and, if settings views need it, in `settings.json`. Add it to `browser.json` only when the built-in browser needs it.
|
||||
|
||||
## Modules and checks
|
||||
|
||||
Reference in New Issue
Block a user