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

TableWhat it stores
pluginPlugin identity, publisher, and optional private owner.
plugin_releaseImmutable author manifests, capability resources, index hashes, source, trust and platform metadata. Local native_metadata_json holds no program or Skill bytes.
plugin_release_capabilityCapabilities declared by a release. Validation and discovery do not grant user permission.
plugin_prepared_packageShort-lived local preparation receipt bound to owner, device generation, action and release. It holds no package bytes; installation checks expiry and device authority before claiming it.
plugin_package_blobStatic declaration-ingest metadata and digests. Local package bytes stay on Runner; this is not server binary storage.

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.

Installations and Permissions

TableWhat it stores
plugin_installationAn account’s selected release, device, and enabled state.
plugin_installation_operationAn install, update, enable, disable, repair, or uninstall request, its state, device receipt, and activation receipt.
plugin_connectionNon-secret provider identity, named local configuration, device, and credential version.
plugin_permissionAppend-only user permission revisions, scoped to an installation or capability.
plugin_secretEncrypted-secret records in the existing schema; not a third-party API credential storage interface.
plugin_oauth_attemptOAuth state / PKCE attempt records. Schema and routes do not establish a working general OAuth integration.

Devices and Agent Runtimes

TableWhat it stores
plugin_device_enrollmentDevice public key, release channel, online lease, and generation.
plugin_device_actionA short-lived action requiring interaction on a particular Desktop, such as profile setup or directory selection.
plugin_runtime_instanceA configured agent runtime such as a Codex profile. Ordinary business providers do not need this record.
plugin_runtime_sessionA chat bound to local agent execution, including device generation and execution checks.
plugin_runtime_eventRuntime events, ordering, digests, and projection progress; receipt is acknowledged after persistence.

External Operations and Messages

TableWhat it stores
plugin_effect_intentArguments, approval evidence, and outcome for external writes such as sending messages; used to reconcile uncertain results.
plugin_inbound_eventAuthenticated, deduplicated incoming events and processing state.
plugin_inbound_outboxPublication tasks for committed product events, not offline provider execution.
plugin_channel_routeExternal conversation to LiyanLabs chat mapping.
plugin_channel_outboxOutbound chat replies and execution outcomes.
plugin_webhook_endpointPublic ingress bindings and verifier material, without GitHub API tokens.
plugin_github_webhook_deliveryGitHub delivery deduplication and online Runner persistence receipts, without raw message bodies.
plugin_audit_eventRedacted audit records for installation, permissions, devices, and business actions.

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.