[loader] Add Electron plugin asset protocol #218
Labels
No labels
abandoned
active
audit
blocked
data-safety
difficulty:easy
difficulty:hard
difficulty:high
difficulty:medium
docs
done
duplicate
notebook-v0
open
priority:high
ready
release-critical
safe-mode
spec
spec-backlog
subsystem:api
subsystem:backlog
subsystem:bases
subsystem:ci
subsystem:command
subsystem:configuration
subsystem:consolidate
subsystem:dependencies
subsystem:desktop-electron
subsystem:diffmerge
subsystem:docker
subsystem:docs
subsystem:fuzzy
subsystem:graph
subsystem:hotkeys
subsystem:lapis
subsystem:maint
subsystem:maintenance
subsystem:markdown
subsystem:markdown-lint
subsystem:md018
subsystem:notebook
subsystem:notifications
subsystem:opfs
subsystem:package
subsystem:plugin-markdown
subsystem:plugin-tasks
subsystem:plugins
subsystem:registry
subsystem:release
subsystem:renovate
subsystem:restore
subsystem:scripts
subsystem:search
subsystem:settings
subsystem:spec
subsystem:tasks
subsystem:testing
subsystem:ui
subsystem:web
subsystem:workspace
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lapis-notes/lapis#218
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Electron renderer ESM plugin modules need a secure URL space for installed plugin files, including relative ESM imports, without exposing arbitrary filesystem or vault content.
Goal
Serve installed plugin assets to the Electron renderer through a narrow secure
lapis-plugin://protocol.Scope
lapis-pluginas a privileged, standard, secure, fetch-capable protocol beforeapp.ready.lapis-plugin://[vault-id]/[plugin-id]/[version-or-hash]/[path].Non-goals
Acceptance Criteria
lapis-plugin://.../main.mjs.Implementation Notes
lapis-host://protocol is explicitly needed.Active Implementation Plan
lapis-pluginas a privileged secure fetch-capable Electron scheme alongsidelapis-vault-resource.PluginAssetServerimplementation that verifies installed metadata through the active vault adapter, registers the plugin asset context with Electron main through a typed preload IPC command, and returns versionedlapis-plugin://URLs./.obsidian/plugins/<id>/, verifies size and SHA-256, and serves the file with the shared MIME policy.plugin-assetsso the workspace can distinguish Electron renderer asset support from generic file-resource support.Affected Packages and Files
packages/api/src/lib/plugin-asset-server.tspackages/api/src/lib/storage/desktop-native.tspackages/api/src/lib/__tests__/plugin-asset-server.test.tspackages/desktop-electron/src/main.tspackages/desktop-electron/src-electron/main.tspackages/desktop-electron/src-electron/preload.tsspec/src/20-packages/desktop-electron/index.mdspec/src/30-cross-package-contracts/plugin-runtime.mdSuggested Files or Specs To Inspect
spec/src/20-packages/desktop-electron/index.mdspec/src/30-cross-package-contracts/plugin-runtime.mdspec/src/30-cross-package-contracts/plugin-host-boundary.mdpackages/desktop-electron/src-electron/packages/api/src/lib/plugin-asset-server.tsValidation Commands
pnpm --filter @lapis-notes/api check:allpnpm --filter @lapis-notes/desktop-electron check:allpnpm check:allRelated Issues
Follow-up Tasks
Implementation Summary
Implemented the Electron lapis-plugin protocol path with renderer-side PluginAssetServer registration, preload capability metadata, main-process context tracking, path/version/hash verification, cleanup on window close, documentation, and validation coverage.