Files
RuneStone/src-tauri/capabilities/default.json
T
Knotty Wyvern e83bf46268 Cache plugin package hashes, add a content security policy, and limit browser windows
Plugin runtime cost:
- Remove the timed plugin scan. Windows scan at start, on focus, on Refresh, and on plugins-changed.
- Keep one package check for each plugin folder. Read and hash the files again only when the
  entry names, sizes, or modification times change. Enable and load always read all files.
  An asset read checks the SHA-256 hash of its file.
- A changed package still stops and needs a new enable decision. Add tests for the cache,
  for changes that keep the metadata, and for the enable decision.
- Replace the 50 ms wait loops of update and removal with a condition variable. The limit
  stays at 10 seconds. Command names, arguments, and results do not change.

Content security policy:
- Set app.security.csp in tauri.conf.json. Keep Tauri from adding nonces to style-src.
- Add CSP mode to the smoke tests (pnpm smoke --csp). The dev server sends the same policy
  with each HTML page, and the harness fails a test on a policy violation.
- Decode data URLs without fetch in the background frame test.

Capabilities:
- Give browser windows their own capability. They load no installed plugin.
  Add a unit test and a browser window smoke test for the command set.

Document the scans, the hash cache, the policy, and the window capabilities.
2026-10-28 02:01:50 -07:00

109 lines
3.0 KiB
JSON

{
"$schema": "../gen/schemas/desktop-schema.json",
"identifier": "default",
"description": "Capability for the main window",
"windows": [
"main",
"workspace-*",
"terminal-*"
],
"permissions": [
"allow-spelling-menu-install",
"allow-spelling-suggestions",
"allow-theme-export",
"allow-spelling-menu-select",
"allow-spelling-menu-uninstall",
"allow-settings-open-window",
"allow-settings-read",
"allow-settings-write",
"allow-settings-migrate",
"allow-tab-transfer-offer",
"allow-tab-transfer-take",
"allow-tab-transfer-finish",
"allow-tab-transfer-cancel",
"allow-completion-request",
"allow-completion-cancel",
"allow-browser-request",
"allow-browser-connect",
"allow-browser-stop",
"allow-git-status",
"allow-git-diff",
"allow-git-stage",
"allow-git-unstage",
"allow-git-commit",
"allow-git-blame",
"allow-git-push",
"allow-git-pull",
"allow-git-graph",
"allow-git-commit-diff",
"allow-git-commit-details",
"core:default",
"core:window:allow-destroy",
"core:window:allow-close",
"core:window:allow-minimize",
"core:window:allow-toggle-maximize",
"core:window:allow-start-dragging",
"opener:default",
"dialog:default",
"allow-workspace-open",
"allow-workspace-open-window",
"allow-workspace-last-path",
"allow-workspace-recent",
"allow-workspace-forget",
"allow-workspace-new",
"allow-workspace-list",
"allow-workspace-list-markdown",
"allow-workspace-read",
"allow-workspace-read-many",
"allow-workspace-read-bytes",
"allow-workspace-write",
"allow-workspace-create",
"allow-workspace-rename",
"allow-workspace-delete",
"allow-workspace-read-data-url",
"allow-workspace-write-bytes",
"allow-workspace-copy",
"allow-workspace-abs-path",
"allow-workspace-reveal",
"allow-workspace-open-terminal",
"allow-workspace-open-default",
"allow-workspace-search",
"allow-plugins-snapshot",
"allow-plugins-choose",
"allow-plugins-from-git",
"allow-plugins-cancel",
"allow-plugins-install",
"allow-plugins-set-enabled",
"allow-plugins-load",
"allow-plugins-release",
"allow-plugins-prepare-remove",
"allow-plugins-remove",
"allow-plugins-retry-remove",
"allow-plugins-reveal",
"allow-plugins-data",
"allow-plugins-asset",
"allow-pty-open",
"allow-pty-write",
"allow-pty-resize",
"allow-pty-close",
"allow-pty-profiles",
"allow-pty-new-window",
"allow-pty-dictation",
"opener:allow-reveal-item-in-dir",
"allow-backgrounds-choose-folder",
"allow-backgrounds-default-folder",
"allow-backgrounds-list",
"allow-backgrounds-read",
"allow-backgrounds-read-image-settings",
"allow-backgrounds-write-image-settings",
"allow-folders-choose",
"allow-folders-picture",
"allow-folders-grants",
"allow-folders-revoke",
"allow-folders-list",
"allow-folders-read",
"allow-folders-read-sidecar",
"allow-folders-write-sidecar"
]
}