feat(plugins): add plugin manager settings and operation locking - #10824
feat(plugins): add plugin manager settings and operation locking#10824iansherr wants to merge 15 commits into
Conversation
Greptile SummaryThe PR adds the Plugins settings experience, package metadata validation, hidden-note integration, and a process-local package-operation lease API. It also addresses the previously reported direct-manifest scheduling, prerelease ordering, and hidden-title localization defects.
Confidence Score: 4/5The PR should not merge until the remaining untranslated plugin statuses and error details on the settings page are localized. The direct-manifest scheduling, prerelease ordering, and hidden-note title issues are resolved, but the Plugins page still renders compatibility, maintenance, security, validation, and optional-dependency status text directly from hardcoded English helpers. Files Needing Attention: apps/client/src/widgets/type_widgets/options/plugins.tsx
|
| Filename | Overview |
|---|---|
| apps/client/src/widgets/type_widgets/options/plugins.tsx | Adds the complete Plugins settings UI, manifest validation, update discovery, installed-package controls, and catalog caching. |
| apps/client/src/services/search.ts | Adds hidden-note lookup through quick search for plugin-managed notes and transactions. |
| packages/trilium-core/src/services/hidden_subtree.ts | Adds the localized Plugins settings note to the hidden options subtree. |
| apps/server/src/services/package_operation_lock.ts | Implements a process-local renewable lease with owner validation and expiry handling. |
| apps/server/src/routes/api/package_operation_lock.ts | Exposes package-operation lock acquire, renew, release, and status handlers. |
| apps/server/src/routes/routes.ts | Registers the package-operation lock endpoints through the internal authenticated API routing layer. |
Sequence Diagram
sequenceDiagram
participant UI as Plugins settings
participant Catalog as Registry/direct manifests
participant Notes as Froca package notes
participant Lock as Package-operation lock API
UI->>Notes: Load installed packages and settings
UI->>Catalog: Fetch and validate configured sources
Catalog-->>UI: Valid packages and update state
UI->>Lock: Acquire operation lease
Lock-->>UI: Owner token and expiry
UI->>Lock: Renew or release lease
Reviews (5): Last reviewed commit: "Merge branch 'main' into agent/plugin-ma..." | Re-trigger Greptile
Why this PR exists
Trilium's current
mainbranch has no first-class plugin or addon ecosystem, no Plugins settings page, and no Community Packages manager. Before this work, extensions were commonly delivered by inserting or deploying JavaScript. During plugin development, a Community Packages note was created as a prototype catalog and manager, but it is not an upstream core capability or a durable plugin lifecycle boundary.As the number of plugins grows, users need a lightweight way to discover trusted plugins, understand what is installed, configure package-specific settings, see update and health state, and recover from incomplete operations. This PR introduces the first core settings, validation, and operation-coordination layer for that plugin ecosystem manager, while keeping the prototype catalog/package format and the manager unobtrusive when no plugin administration is needed.
What changed
Validation
pnpm typecheckpnpm --filter=client test --coveragepnpm --filter=server test --coveragegit diff --checkThe repository ESLint configuration currently imports
@stylistic/eslint-plugin, which is added by the separate development-harness PR; linting for this branch is therefore left to the corresponding repository/tooling check.Manual verification
Scope
This PR is limited to the plugin settings experience, package metadata validation, and the package-operation coordination API. Docker artifact handling and development-harness changes are submitted separately.
The operation lock is intentionally process-local. A future multi-process deployment would require a shared coordination backend.