Release RuneStone 0.1.4 with installable plugins and settings

This commit is contained in:
Knotty Wyvern
2026-10-04 15:05:51 -07:00
parent 0268c5c9f0
commit 6b7af0d527
82 changed files with 4150 additions and 212 deletions
+112 -5
View File
@@ -1,7 +1,61 @@
# Development guide
# Developer README
[Back to RuneStone](../README.md)
## Test changes without a full rebuild
From the repository folder, run:
```powershell
pnpm tauri dev
```
For a fresh checkout, complete [Run from source](#run-from-source) first.
This command starts Vite and opens RuneStone in a native desktop window.
Keep the terminal open while you edit the source.
Svelte, TypeScript, and CSS changes update through hot module replacement (HMR), or a page reload when required.
Frontend changes do not need a Rust rebuild or an installer.
The first launch compiles the Rust app and its dependencies.
Later launches reuse Cargo's cached output.
Rust changes still need compilation, but Cargo reuses unchanged build output.
Tauri then restarts the app automatically.
See [Tauri development](https://v2.tauri.app/develop/) and [Vite HMR](https://vite.dev/guide/features.html#hot-module-replacement) for details.
### Daily workflow
1. Start `pnpm tauri dev` in a terminal at the repository root.
2. Open a test workspace with the folder button in the development window.
3. Edit a source file in your code editor.
4. Save the source file, then test the change in the development window.
5. To stop the development session, press Ctrl+C in its terminal.
Use sample documents for feature tests. The desktop app reads and writes real files.
Save open documents before a change that reloads or restarts the app.
A reload can reset editor state, and a Rust restart ends terminal sessions.
`pnpm tauri dev` starts `pnpm dev` through `beforeDevCommand` in `src-tauri/tauri.conf.json`.
Do not start a separate `pnpm dev` process for this workflow.
The frontend uses port 1420, and Tauri loads `http://localhost:1420`.
### What needs a rebuild?
| Change or task | Action |
| --- | --- |
| Svelte, TypeScript, or CSS under `src/` | Save the source file. Vite updates the interface without a Rust rebuild. |
| Feature source under `plugins/` | Run `pnpm build:plugins`, then uninstall and install the changed package through Settings. |
| Rust code under `src-tauri/src/` | Save the source file. Tauri rebuilds the changed Rust code and restarts the app. |
| Rust dependencies or build settings | Allow Cargo to compile the affected dependencies. These changes can take longer. |
| JavaScript dependencies after a pull or branch change | Stop development, run `pnpm install --frozen-lockfile`, then start `pnpm tauri dev` again. |
| Tauri configuration, capabilities, or Vite configuration | Restart `pnpm tauri dev` to check the new settings. Native changes can require compilation. |
| Release or installer behavior | Use the [release guide](releases.md). Packaging requires a release build. |
Keep `src-tauri/target/` between sessions so Cargo can reuse its build cache.
Do not run `cargo clean` as part of normal feature tests.
An installed copy from the Start menu uses its packaged code and does not show source changes.
Use the window that `pnpm tauri dev` opens.
## Stack
RuneStone uses Tauri 2 and Rust for the desktop host.
@@ -12,6 +66,7 @@ Windows is the first target. The older WriterHost component remains unused.
See the setup steps below to install dependencies and run the desktop app.
See the [roadmap](roadmap.md) for goals and milestones. See the [product scope](product-scope.md) for capabilities and architecture constraints.
Agent instructions and UI design rules live in [AGENTS.md](../AGENTS.md).
See the [plugin guide](plugins.md) to build and install feature packages, use the API, and understand current plugin boundaries.
## Run from source
@@ -35,9 +90,25 @@ See the [release guide](releases.md) to build a Windows installer.
## Checks
Run these commands from the repository folder:
Run checks from the repository folder in a second terminal.
These commands do not require an installer.
For type errors while you edit:
```powershell
pnpm check:watch
```
For one test file:
```powershell
node --experimental-strip-types --test scripts/tableSelection.spec.ts
```
For the full set of checks:
```sh
pnpm build:plugins
pnpm check
pnpm test
pnpm build
@@ -45,7 +116,9 @@ cargo test --manifest-path src-tauri/Cargo.toml --lib --offline
```
The offline Rust command requires cached dependencies. Omit `--offline` if Cargo needs to download them.
`pnpm build` builds the frontend. Use `pnpm tauri build` to build the desktop app.
`pnpm build` checks the production frontend build. It is not required after each source edit.
`pnpm preview` serves the last frontend build and does not watch source changes.
Use `pnpm tauri build` to build the release desktop app.
The Rust tests cover real terminal shells, working directories, Unicode output,
resizing, exit status, and session termination. Native terminal tests launch each
@@ -53,20 +126,54 @@ detected shell profile and check shell prompt integration.
## Browser smoke tests
`pnpm dev` starts only the Vite server at `http://127.0.0.1:1420`.
A browser can show the interface, but real folder access, file writes, and terminals require the desktop host.
Use `pnpm tauri dev` for manual tests of those features.
Run `pnpm build:plugins` before tests that use Terminal or Table formulas.
These tests load the compiled packages through the production module loader.
The browser tests use the real interface with mocked desktop communication.
They do not replace native desktop tests.
1. Install Playwright, or set `PLAYWRIGHT_MODULE` to a shared Playwright package.
2. Start the frontend with `pnpm dev`.
2. Start the frontend with `pnpm dev`, or reuse the server from an active `pnpm tauri dev` session.
3. In a second terminal, run a smoke script, such as `node scripts/workbench.smoke.mjs`.
Set `CHROME_PATH` if you need to select an installed browser executable.
Playwright is not a dependency in `package.json`.
Set `PLAYWRIGHT_MODULE` to the absolute path of an existing Playwright package if you use a shared installation.
That package must have Chromium installed, or you must select an installed browser with `CHROME_PATH`.
For example, in PowerShell, replace these example paths with your local paths:
```powershell
$env:PLAYWRIGHT_MODULE = "C:\tools\browser-tests\node_modules\playwright"
$env:CHROME_PATH = "C:\Program Files\Google\Chrome\Application\chrome.exe"
node scripts/workbench.smoke.mjs
```
| Script | Coverage |
| --- | --- |
| `scripts/workbench.smoke.mjs` | The Svelte, Monaco, and xterm interface |
| `scripts/pluginInstall.smoke.mjs` | Package review, external commands and views, the uninstall confirmation, and cleanup |
| `scripts/plugins.smoke.mjs` | Plugin toggles, formula source preservation, terminal cleanup, and preferences across windows |
| `scripts/terminal.smoke.mjs` | Terminal groups, single-session layout, menus, profiles, history, tasks, settings, and editor actions |
| `scripts/images.smoke.mjs` | Image drops, clipboard imports, source editing, zoom, undo, failed writes, and tab changes during imports |
| `scripts/imageNavigation.smoke.mjs` | Navigator pointer drags, hidden image source, selection, context actions, inline/reference images, and drag cancellation |
Additional smoke scripts live in `scripts/`.
## Development help
| Problem | Action |
| --- | --- |
| Port 1420 is already in use | Stop the other RuneStone development server in its terminal, then retry. Vite uses a fixed port. |
| The app still shows the old interface | Use the development window. Check the terminal for compile errors, then restart the development command if needed. |
| Browser view says desktop features require `pnpm tauri dev` | Start that command and use its native window for real workspace and terminal tests. |
| Windows cannot find `link.exe`, or Rust cannot link the app | Install the C++ build tools and Windows SDK from the Tauri prerequisites guide above. Open a new terminal. |
| A smoke test cannot find Playwright or Chromium | Set `PLAYWRIGHT_MODULE` to an installed package. Install its Chromium browser or set `CHROME_PATH`. |
| Cargo reports missing dependencies with `--offline` | Run the command without `--offline` while connected to the internet. |
Read Rust errors in the terminal that runs `pnpm tauri dev`.
In the Windows development window, press Ctrl+Shift+I to open the web inspector.
Use its console for frontend errors.
See [Tauri's inspector instructions](https://v2.tauri.app/develop/#opening-the-web-inspector).
+213
View File
@@ -0,0 +1,213 @@
# Plugins
[Back to development](development.md)
RuneStone installs local JavaScript plugins from package files or folders.
Open Settings → Plug-ins to install, enable, disable, or uninstall them.
Terminal and Table formulas use the same installed package system as all other plugins.
## Build and install the feature packages
1. Run `pnpm build:plugins` from the repository root.
2. In Settings → Plug-ins, choose Install from folder and select `plugin-packages/`.
3. Review both packages, then choose Install and enable.
No plugin starts automatically in a fresh installation.
The application build does not include these packages. Package builds include their JavaScript dependencies and terminal styles.
Build them again after source changes, then uninstall the old package and install the new folder.
The old bundled switches no longer apply. Existing terminal appearance settings remain available after installation.
Formula source stays in Markdown files when the plugin is absent, disabled, or removed.
Native pseudo-terminal services remain in the desktop host. The Terminal package supplies the interface, shortcuts, and session controls.
## Install a plugin
1. Choose Install from file or Install from folder.
2. Select the packages to install in the review dialog.
3. Choose Install to keep them disabled, or Install and enable to run them.
A plugin file uses the `.runestone-plugin` extension and ZIP format.
You can also select `plugin.json`, its containing folder, or a collection folder containing plugin folders and package files.
Collection discovery checks one level and accepts at most 100 entries.
RuneStone copies packages into its per-user application data directory. It never modifies the selected source.
The review shows the author, version, source, destination, and access level.
External plugins run with RuneStone's application access. Enable only code you trust.
Package metadata and hashes do not verify a publisher's identity. This version has no permission sandbox or marketplace.
Scanning and installation do not execute code, install dependencies, or run installation scripts.
Plugins cannot overwrite an existing ID. Uninstall the previous package before installing another version.
Each package succeeds or fails independently. The result identifies any failures.
A changed source requires a new review. Cancelling the review removes its temporary copies.
Try the example in `fixtures/plugins/workspace-overview/`.
Install that folder, then choose Install and enable.
Use the puzzle button in the main toolbar to run Show workspace overview or open the Workspace overview view.
## Uninstall with one confirmation
1. Choose Uninstall on the plugin's row.
2. Check its name, author, version, folder, and deletion message, then choose Uninstall and delete files.
The dialog initially focuses Cancel. Escape cancels the uninstall flow.
Cancel leaves the files and enabled state unchanged.
Disable instead keeps every installed file and turns the plugin off.
Each uninstall requires a new confirmation.
After confirmation, RuneStone disables the plugin in every window and waits for cleanup.
It deletes only the installed package. Source downloads, plugin settings, generated data, and workspace documents remain intact.
The app shows Restart required because already loaded JavaScript can remain in memory until RuneStone closes.
Cleanup failure blocks deletion and keeps the installed files. Restart RuneStone before trying again.
An interrupted file deletion shows Removal incomplete. Retry cleanup continues only that previously confirmed removal.
Changed files in the removal directory block further deletion. Inspect the path named in the error before retrying.
Reinstallation requires a new enable decision and can reuse retained settings.
```mermaid
flowchart LR
installed("Installed plugin") --> confirm("Confirm file deletion")
confirm --> cleanup("Stop in all windows")
cleanup --> removed("Delete package; retain data")
```
## Storage and recovery
RuneStone resolves the root through Tauri's `app_data_dir()`. Settings shows the complete path.
```text
<application-data>/
plugins/<plugin-id>/
plugin.json
main.js
assets/
plugin-data/<plugin-id>/settings.json
plugin-state.json
plugin-staging/
plugin-removals/
```
Rust stores desired enable states in `plugin-state.json` and broadcasts changes to open windows.
The browser preview has no installed plugins unless a smoke test supplies a desktop mock.
Startup, window focus, Refresh, and a five-second poll scan installed files.
Changed packages stop running and require another enable decision. Missing packages are never restored automatically.
Valid packages copied directly into the managed directory appear disabled.
Staging directories never participate in plugin discovery.
Each reviewed candidate belongs to one window and expires after 30 minutes.
Rust checks the source and staged content hashes before publishing a complete directory.
A duplicate destination blocks publication. A crash cannot enable a partial installation.
Removal plans belong to one window and expire after five minutes.
The backend accepts a single-use removal token when the user confirms deletion.
A changed package requires a new confirmation.
Runtime cleanup must complete in every window before the package moves into `plugin-removals/`.
A persisted record identifies that directory and the original file hashes.
Recovery deletes only unchanged remaining files from that confirmed transaction. It cannot target a newly installed copy.
Install and removal operations share one native service and serialize their state changes.
## Package contract
Place `plugin.json` at the root of the folder or archive:
```json
{
"schemaVersion": 1,
"id": "org.example.hello",
"name": "Hello",
"author": "Example author",
"description": "Open a small example view.",
"version": "1.0.0",
"apiVersion": 1,
"entry": "main.js",
"access": "full-app"
}
```
The package API is version 1. Its interface lives in `src/lib/plugins/sdk.ts`.
All packages use one API and the same installation, enable, disable, and removal lifecycle.
Versions use three numeric parts. Schema and API versions must match the supported version exactly.
The `runestone.*` prefix follows the same rules as other package IDs. It does not prove the publisher's identity.
Package names use ASCII letters, digits, dots, underscores, and hyphens, with forward slashes between directories.
IDs use lowercase letters, digits, dots, and hyphens and start with a letter.
Windows device names, parent traversal, absolute paths, links, junctions, and case-insensitive collisions are invalid.
Limits are 5,000 entries, 100 MiB of expanded data, and 25 MiB per file.
The manifest has a 64 KiB limit. The final installed path cannot exceed 240 characters.
The entry is one compiled `.js` or `.mjs` module. Bundle dependencies into it.
Relative module imports cannot resolve from its Blob URL. Read packaged assets through the API instead.
Raw TypeScript, Svelte source, native libraries, plugin dependencies, and automatic updates are unsupported.
## Plugin API
The entry exports `activate(api)`. Activation can return a cleanup function or a promise for that function.
The runtime limits activation and each cleanup callback to five seconds.
A timeout reports an error and blocks successful cleanup until the app restarts.
```js
export function activate(api) {
api.registerView({
id: "hello",
title: "Hello",
mount(container) {
const text = document.createElement("p");
text.textContent = "Hello from a RuneStone plugin.";
container.append(text);
return () => text.remove();
}
});
api.registerCommand({
id: "show-hello",
title: "Show hello",
run: () => api.openView("hello")
});
}
```
| API | Contract |
| --- | --- |
| `api.id` | The installed plugin ID |
| `api.signal` | An abort signal triggered before shutdown |
| `contribute(key, value)` | Register a typed terminal or table formula contribution |
| `registerCommand({ id, title, run })` | Add a command to the toolbar's plugin menu |
| `registerView({ id, title, mount })` | Add a view that mounts into a supplied DOM element |
| `openView(id)` | Open one of the plugin's registered views |
| `onDispose(callback)` | Register synchronous or asynchronous cleanup |
| `workspace.list(path?)` | List a directory in this window's active workspace |
| `workspace.read(path)` | Read a workspace text file |
| `workspace.write(path, contents, expected)` | Save only if the file still matches the original text |
| `settings.read()` / `settings.write(value)` | Read or write retained JSON settings, with a 1 MiB limit |
| `assets.read(path)` | Read package bytes as a `Uint8Array` |
Command and view IDs must be unique within their respective plugin collections.
Views can return asynchronous cleanup. Closing a view and disabling its plugin share the same cleanup promise.
Remove timers, listeners, and other resources in cleanup. Use the abort signal to stop pending work.
The SDK rejects calls after shutdown starts, but it does not isolate JavaScript with full application access.
Packages activate in every RuneStone window, including standalone terminal windows.
Contribution types live in `src/lib/plugins/contracts.ts`.
Only one active package can own each contribution. The runtime removes contributions before cleanup starts.
Terminal controls mount into a host element and return update, command, and disposal functions.
The plugin must stop its mounted controls and native sessions in `onDispose` before cleanup completes.
## Modules and checks
| Module | Owns |
| --- | --- |
| `src-tauri/src/plugins.rs` | Discovery, validation, installation, persistence, removal plans, and cleanup acknowledgments |
| `src/lib/plugins/PluginManager.svelte` | Package review, switches, and the uninstall dialog |
| `src/lib/plugins/sdk.ts` | External package types |
| `src/lib/plugins/externalSession.ts` | Activation, contributions, view disposal, and shutdown |
| `src/lib/plugins/external.ts` | Native state synchronization and external module loading |
| `src/lib/plugins/PluginTools.svelte` | External commands and views |
| `src/lib/plugins/registry.ts` / `contracts.ts` | Shared feature contributions and their types |
| `src/lib/plugins/TerminalSlot.svelte` | The host element for terminal controls |
| `plugins/terminal/` / `plugins/table-formulas/` | Separate feature packages |
| `scripts/buildPlugins.mjs` | Package compilation into `plugin-packages/` |
Run `pnpm build:plugins`, `pnpm check`, `pnpm test`, `pnpm build`, and `cargo test --manifest-path src-tauri/Cargo.toml --lib --offline`.
The Rust tests use real temporary files and archives. Browser tests mock desktop calls and exercise the real UI and module loader.
Run `scripts/pluginInstall.smoke.mjs`, `scripts/plugins.smoke.mjs`, and `scripts/settings.smoke.mjs` against the development server.
Native plugin packages and restricted permissions remain future work.
The core keeps basic Markdown tables, file editing, selection, sorting, and document access when optional features stop.
+21 -10
View File
@@ -5,16 +5,17 @@
This reference preserves intended capabilities and design constraints. Some features already exist.
See the [roadmap](roadmap.md) for goals and milestones, and the [user guide](user-guide.md) for current behavior and limitations.
The planned design keeps the core active and adds optional features through separately packaged plugins. Plugin support is not implemented yet.
The core stays active while installed packages supply optional Terminal and Table formulas features.
External JavaScript packages can add commands and views. See the [plugin guide](plugins.md) for current boundaries.
## Workspace and files
- Open one folder as the workspace.
- Keep notes, scripts, and images in the same tree.
- Honor `.gitignore` in the navigator.
- Show workspace files without applying `.gitignore`, `.ignore`, or global Git exclusions.
- Watch the folder for changes. Poll when the path is a network drive.
- Prefer a local Git clone. Do not treat a live network share as the sync path.
- Store display order, pins, bookmarks, and plugin settings in `.runestone/`.
- Store display order, pins, and bookmarks in `.runestone/`. Store plugin packages and retained plugin settings in application data.
- Open an existing Obsidian folder as files plus wiki links. Ignore `.obsidian`.
## Writer and IDE
@@ -47,15 +48,25 @@ The planned design keeps the core active and adds optional features through sepa
## Plugins
Plugin support is pending. In-house plugins ship with RuneStone as separate packages and use the same interfaces as external plugins.
Terminal and Table formulas use the same installed package system as all other plugins.
External JavaScript packages now support local installation, commands, views, retained settings, and removal with one confirmation.
Users can enable or disable each plugin. A marketplace is outside the planned scope.
Installation accepts plugin packages or folders and stores copies in the application data directory.
Uninstall requires one confirmation before RuneStone removes the installed plugin files.
Cancel preserves the plugin. Removal keeps settings, source packages, and workspace documents.
See the [installation and removal guide](plugins.md#uninstall-with-one-confirmation).
### Plugin to-do list
- [ ] Build the plugin system: package loading, version checks, permissions, settings, and enable or disable controls.
- [ ] Define shared interfaces for plugins to add commands, views, and workspace features.
- [ ] Move the terminal into a separate in-house plugin that ships with RuneStone.
- [ ] Move Excel-like table features, including formulas and spreadsheet operations, into a separate in-house plugin that ships with RuneStone.
- [x] Use one package system with API version checks, cleanup, saved preferences, and enable controls.
- [x] Add external package loading, exact API compatibility checks, and retained plugin settings.
- [x] Define an external API for commands, views, and workspace files.
- [x] Require one confirmation before removing installed plugin files.
- [ ] Add isolated execution and restricted permissions.
- [x] Move terminal views, shortcuts, settings, and desktop API calls into an external plugin package.
- [ ] Move native terminal services into a separate in-house package.
- [x] Move formula evaluation, rendered results, and help controls into an external Table formulas package.
- [ ] Move the remaining spreadsheet operations into a separate in-house package.
- [ ] Add a Kanban plugin for boards, columns, and task cards.
- [ ] Add a Gantt plugin for task timelines and dependencies.
- [ ] Add a Calendar plugin for dated tasks and events.
@@ -65,9 +76,9 @@ Keep basic Markdown table editing and rendering in the core. Users must retain a
Kanban, Gantt, and Calendar are separate plugins that share a task index.
Kanban boards are Markdown files. Headings are columns. Task list items are cards.
### Planned defaults
### Planned plugin lineup
Planned plugins enabled by default:
No plugin starts automatically in a fresh installation. The planned lineup includes:
- Terminal. Workspace shells, sessions, and script execution.
- Tables. Excel-like formulas and spreadsheet operations.
+4 -2
View File
@@ -44,8 +44,10 @@ and identify a reported code problem within the workspace.
**Objective:** Support different ways of working while keeping the core editor simple.
Plugin support is pending. Separately packaged plugins would let users choose tools for planning, tabletop play, and other workflows.
The terminal and Excel-like table features would ship as in-house plugins through the same plugin system.
Users can install, disable, and remove Terminal and Table formulas while retaining access to their files.
Separately packaged plugins can extend that choice to planning, tabletop play, and other workflows.
Users can now install local packages and remove them through one confirmation while retaining their data.
Restricted permissions and the remaining spreadsheet modules are still planned.
**Milestone:** A user can enable a packaged plugin, use it with workspace files,
and disable it while retaining access to those files in the core editor.
+27 -3
View File
@@ -2,10 +2,33 @@
[Back to RuneStone](../README.md)
Current features and limitations as of September 2026.
Current features and limitations as of October 2026.
## Settings and help
Use the gear beside the workspace selector to open Settings, or press Ctrl+,.
Use the question mark beside it to open Help and about, or press F1.
Both shortcuts work when the sidebar is hidden.
General settings control auto-save. It starts enabled, with a five-second interval.
Choose a whole number from 1 to 300 seconds, or turn auto-save off.
Changes apply when you leave the interval field and persist across restarts.
These preferences apply to all workspaces on this device. Other open windows receive changes immediately.
Restore defaults enables auto-save and sets the interval to five seconds.
Search settings to find a category. Plug-ins lists installed packages, including Terminal and Table formulas after installation.
No plugin starts automatically in a fresh installation. Enable changes persist across restarts and open windows.
Disabling Terminal ends its sessions. Disabling Table formulas keeps the formula source and basic table editing.
Use Install from file or Install from folder to add local plugins. The puzzle button opens their commands and views.
Uninstall requires one confirmation and preserves settings, source packages, and workspace documents.
See the [plugin guide](plugins.md) for package formats, removal, and current boundaries.
Help and about includes the app version, basic instructions, and keyboard shortcuts.
Press Escape or use the close button to return to your work.
## Workspace, editing, and terminals
- The navigator, Quick Open, and search do not apply `.gitignore`, `.ignore`, or global Git exclusions.
Internal folders (`.git`, `.obsidian`, and `.runestone`) and temporary save files stay hidden.
- The folder button and Ctrl+O open recent workspaces, with the current workspace
marked and full paths shown. The list remembers the 20 most recently opened
folders across restarts. Open another folder from the bottom of the menu, or
@@ -88,7 +111,8 @@ Current features and limitations as of September 2026.
- Right-click a tab for Move tab left and Move tab right. With a tab focused, use Alt+Shift+Left or Alt+Shift+Right.
Use the arrow keys, Home, or End to select tabs. Press Escape to cancel a drag.
- Click the + beside the tabs or press Ctrl T to open an empty tab. Open or create a file from there to use that tab. No file is created until you choose New file.
- Changed notes and scripts autosave every 5 seconds, including background tabs.
- Changed notes and scripts auto-save every five seconds by default, including background tabs.
Use Settings to change the interval or turn auto-save off.
Unchanged files are never rewritten. Ctrl+S saves immediately. Disk conflicts
and unavailable files preserve your edits for resolution instead of overwriting.
- The reader uses a Markdown parser for paragraphs, nested lists, tables, tasks,
@@ -143,6 +167,6 @@ Current features and limitations as of September 2026.
## Limitations
Vault-wide wiki-link resolution, backlinks and math rendering still need work.
Git UI, language servers, plugins, persistent tab restoration and crash recovery
Git UI, language servers, restricted plugin permissions, persistent tab restoration and crash recovery
are not implemented. Unsaved buffers and terminals last for the current app
session only.