Skip to content

feat: config-loaded declarative site plugins - #27

Draft
shehrii9 wants to merge 1 commit into
mainfrom
cursor/config-plugins-ec5e
Draft

shehrii9 wants to merge 1 commit into
mainfrom
cursor/config-plugins-ec5e

Conversation

@shehrii9

Copy link
Copy Markdown
Owner

Summary

Adds config-loaded site plugins — declarative JSON workflows and recovery recipes merged with built-in plugins.

Configuration

  • plugins array in ber.config.json (inline specs)
  • pluginsFile — path to { "plugins": [ ... ] } (see examples/custom-plugins.example.json)
  • BER_PLUGINS / BER_PLUGINS_FILE — env override for plugin JSON path

Each plugin:

{
  "id": "my-store",
  "domains": ["store.example.com"],
  "workflows": { "checkout": [{ "type": "dismiss_overlays" }] },
  "recovery": {
    "cookie_banner": [[{ "type": "dismiss_overlays" }]]
  }
}
  • Workflows power builtin planner intents: run checkout on store.example.com
  • Recovery keys match ProblemKind (cookie_banner, dialog_blocking, …)

Wiring

  • loadBerConfig() → configPlugins: SitePlugin[]
  • createRuntimeFromEnv() uses createPluginRegistry(cfg.configPlugins)
  • BuiltinPlanner now shares the same registry as the runtime (fix for custom plugins)

npm run doctor prints configPlugins ids.

Testing

  • tests/config-plugins.test.ts (4 tests)
  • npm test
Open in Web Open in Cursor 

Parse plugins[] and pluginsFile (or BER_PLUGINS) into SitePlugin specs with
workflows and recovery action lists. Merge with built-in plugins via
createPluginRegistry; BuiltinPlanner shares the same registry.

Includes examples/custom-plugins.example.json, doctor configPlugins ids, tests.

Co-authored-by: Shaharyar Ahmad <shehrii9@users.noreply.github.com>
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