Skip to content

feat(appkit): plugin manifest definition#82

Merged
MarioCadenas merged 10 commits intomainfrom
plugin-manifest-definition
Feb 16, 2026
Merged

feat(appkit): plugin manifest definition#82
MarioCadenas merged 10 commits intomainfrom
plugin-manifest-definition

Conversation

@MarioCadenas
Copy link
Collaborator

@MarioCadenas MarioCadenas commented Feb 3, 2026

Summary

This PR introduces a plugin manifest definition and resource registry so plugins can declare their Databricks resource requirements in a machine-readable way. Tooling can then derive app configuration (e.g. app.yaml / bundle resources) from those manifests.

Plugin manifest

  • Manifest is required: Every plugin must define a static manifest with name, displayName, description, and resources (required/optional).
  • Manifest format: JSON Schema in plugin-manifest.schema.json; built-in plugins (analytics, server) ship a manifest.json next to their code and a typed manifest.ts used at runtime.
  • Runtime requirements: Plugins can implement static getResourceRequirements(config) so optional resources can become required based on config (e.g. warehouse only when analytics is enabled).

Resource registry

  • ResourceRegistry: Collects resource requirements from all plugins at app creation, deduplicates by type + resourceKey, and merges permissions (e.g. takes the most permissive when several plugins need the same resource).
  • Resource types: Typed enum (ResourceType) and per-type permissions (e.g. sql_warehouseCAN_USE / CAN_MANAGE) in packages/appkit/src/registry/types.ts.
  • Validation: createApp() calls registry.collectResources(rawPlugins) then registry.enforceValidation() so missing or invalid manifests fail fast.

Manifest loader

  • getPluginManifest(plugin): Loads and validates the manifest from a plugin constructor; normalizes string type/permission into ResourceType / ResourcePermission.
  • getResourceRequirements(plugin, config?): Returns the flattened list of requirements (manifest + optional runtime from getResourceRequirements(config)).

CLI: appkit plugins sync

  • New command in @databricks/shared that discovers plugins from the app's server entrypoint (AST parsing of imports and plugin usage), reads their manifests from installed packages or local paths, and builds/updates appkit.plugins.json.
  • Template uses this file (and the new template-plugins.schema.json) so the template's plugin list and resource metadata stay in sync with the app.
  • Options: --write to write the file, --output <path> for custom path.

Template and docs

  • Template: appkit.plugins.json added; analytics bundle config simplified (fewer redundant YAML files); databricks.yml.tmpl and server wiring updated to use the new plugin manifest story.
  • Docs: Plugin docs and API reference updated (Plugin class, PluginManifest, ResourceRegistry, ResourceType, new functions), plus new schema docs and copy script for static schemas.

Other

  • Dev-playground: Reconnect and telemetry-example plugins updated to define a manifest.
  • Removals: env-validator and its exports removed from appkit.
  • Tests: New/updated tests for manifest loader, resource registry (including getResourceRequirements and permission merging), integration with createApp, and plugins-sync CLI.

Base automatically changed from refactor-move-core-plugins to main February 4, 2026 10:33
@MarioCadenas MarioCadenas force-pushed the plugin-manifest-definition branch 4 times, most recently from 780c458 to 14b339e Compare February 4, 2026 13:28
@MarioCadenas MarioCadenas marked this pull request as ready for review February 4, 2026 13:32
@MarioCadenas MarioCadenas requested a review from pkosiec February 4, 2026 13:32
Copy link
Member

@pkosiec pkosiec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM, just small comments

MarioCadenas and others added 9 commits February 13, 2026 16:40
chore: make plugin manifest required

All plugins must now declare a static manifest property with their
metadata and resource requirements. This simplifies the manifest loader
and provides better error messages.
Implement manifest loader with validation and error handling.
All plugins must have a static manifest property.

Features:
- getPluginManifest() - loads and validates plugin manifests
- getResourceRequirements() - extracts resource requirements
- Comprehensive validation with clear error messages
- Unit tests and integration tests with core plugins
@MarioCadenas MarioCadenas force-pushed the plugin-manifest-definition branch from 1bdcb17 to 465f50a Compare February 13, 2026 15:45
@MarioCadenas MarioCadenas changed the title chore: plugin manifest definition feat: plugin manifest definition Feb 13, 2026
@MarioCadenas MarioCadenas changed the title feat: plugin manifest definition feat(appkit): plugin manifest definition Feb 16, 2026
Copy link
Member

@pkosiec pkosiec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving as I already checked the PRs which were merged into this one

@MarioCadenas MarioCadenas merged commit b40f5ca into main Feb 16, 2026
6 checks passed
@MarioCadenas MarioCadenas deleted the plugin-manifest-definition branch February 16, 2026 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants