Plugin Data Model
Use this reference when changing backend implementation or inspecting persisted state. Start with the Quickstart for authoring; understanding every table is not a prerequisite.
Data separates version declarations, user installations and permissions, device execution, and message processing. Fields and states are defined by service/migrations/, service/pkg/model/, and service/pkg/repo/plugin/.
Catalog and Versions
plugin.json.name is the stable identity. extensions["com.liyanlabs"].displayName declares the user-facing name in the immutable release manifest; omission displays the identity. Installation reads it from the package.
Tool List Presentation
“Tools provided to AI” projects immutable release declarations without adding installation, permission, or separate tool tables. Each local_provider derives tool_count from its validated catalog. An absent declaration omits the field; neither the provider count nor zero substitutes for an unknown count.
GET /liyanlabs/api/v1/plugins/catalog adds only the count. The existing GET /liyanlabs/api/v1/plugins/catalog/:plugin_key/releases/:version also returns tools, with only name, description, and read_only per entry. Public read_only comes from the author resource's readOnly. Preview does not return input schemas, configuration values, or device executable paths.
Clients fetch and cache the same account's release details on expansion, checking the release ID and digest. Omitted declarations do not assert zero tools; failed or mismatched details offer an error and Retry. Catalog metadata remains viewable before installation or while the device is offline, while actual calls retain installation, device, configuration, and permission checks.
Installations and Permissions
Devices and Agent Runtimes
External Operations and Messages
Permissions and State
Capability declarations describe what an author provides; plugin_permission holds user policy. Reads, device access, and inbound events use allow / deny; local reversible actions use prompt / allow / deny; external writes use prompt / deny. See service/pkg/core/plugin/permission/service.go.
Operations record both package and activation receipts. A succeeded state alone requires checking confirmation. API projections expose pending confirmation; see service/pkg/core/plugin/lifecycle/activation.go.
Feishu and GitHub operational credentials stay on the device. Current API wiring uses an unavailable provider OAuth exchanger in service/pkg/web/database_plugin_routes.go. Existing secret/OAuth tables do not constitute a supported server credential solution.
Client module graphs are projected from current installations, release capabilities, permissions and device state. There is no separate UI installation table. Web/native modules and their provider belong to one plugin release; updates and revocation invalidate old graphs. Module code is read from the exact authorized Runner.
Use the diagnostics guide to inspect operation, setup, and health before changing database state. Do not insert permission records directly.
Package Icons
A native package declares a PNG, JPEG or WebP through extensions["com.liyanlabs"].icon. The packer indexes its icon role, size and SHA-256. Native import and server admission validate the declaration, role, digest, decoded image format and dimensions. Limits are 256 KiB and 1024 pixels per side. The server persists this public presentation metadata and returns a bounded icon_data_url, without executable bytes or device paths. Undeclared icons use the generic plugin mark; builtins retain catalog brand icons. An icon grants no execution or data authority.