eca icon indicating copy to clipboard operation
eca copied to clipboard

Feature request: transitive plugin dependency resolution

Open OiTAvO opened this issue 4 months ago • 0 comments

Hi! First of all, thank you for ECA - I use it daily as my main coding assistant (via eca-emacs) and it's been a great experience. Really appreciate the work you all put into this project.

Context

At work, we have a "meta-plugin" - a plugin whose only purpose is to bundle a curated set of other plugins behind a single install. It declares a dependencies array in its manifest so that installing it automatically pulls in all the plugins it depends on.

This pattern works well in Claude Code (≥ 2.1.143), which resolves the dependencies field transitively: one install brings the entire plugin set along. I initially expected ECA would also handle these dependencies, but after investigating the source code I found that ECA has its own independent plugin cache (~/.cache/eca/plugins) and its own resolution logic - there is no shared state between the two clients.

The problem

After investigating, I found that ECA's plugin system has no concept of dependencies:

  • resolve-all! processes only the flat "install" array from config.json - it never reads a dependencies field from marketplace entries.
  • The marketplace entry schema (.eca-plugin/marketplace.json) does not include a dependencies field.
  • Installing a meta-plugin via /plugin-install adds only the meta-plugin itself to the install list. None of its declared dependencies are resolved or installed.

As a workaround, each dependency must be installed individually, which defeats the purpose of the meta-plugin pattern.

How Claude Code handles this

Since the Claude Code source is not public, I pieced this together from the CHANGELOG and by inspecting ~/.claude/plugins/installed_plugins.json on disk:

  1. auto flag - Each plugin entry in installed_plugins.json can have "auto": true, which marks it as a dependency-installed plugin (as opposed to a direct user install).
  2. Transitive resolution - On install, Claude Code reads the dependencies array from plugin.json (or the marketplace entry), recursively resolves each dependency across configured marketplaces, and installs them with auto: true.
  3. Orphan pruning - claude plugin prune removes auto-installed plugins that are no longer depended on by any directly-installed plugin. claude plugin uninstall --prune cascades.
  4. Disable protection - claude plugin disable refuses when another enabled plugin depends on the target, and shows a disable-chain hint.
  5. Conflict detection - Reports range-conflict when a dependency version clashes with an already-installed plugin.

Possible approaches for ECA

I see a few ways this could work, each with different trade-offs:

A. Runtime-only expansion (minimal change)

In resolve-all!, after reading all marketplaces, expand the install list with transitive dependencies before loading plugins. Dependencies are resolved at startup but not persisted to config.json.

  • Pro: Simple, no config format changes, clean uninstall (remove parent, deps stop loading).
  • Con: Dependencies don't show up in /plugins list; no explicit tracking.

B. Persist with auto tracking (Claude Code model)

Track which plugins were auto-installed as dependencies vs. directly installed by the user. This could be a separate "auto-installed" key in the config, or an object format with an auto flag.

  • Pro: Full lifecycle - install, uninstall with prune, orphan cleanup, list with distinction.
  • Con: More complex; requires config format evolution and migration.

C. Expand at install time only

When a plugin is installed, read its dependencies and add them all to the flat "install" array.

  • Pro: Simple persistence, all deps visible.
  • Con: No way to distinguish direct vs. dependency installs; uninstall leaves orphans; shared deps are ambiguous.

Questions for maintainers

  • Is this a feature you'd be interested in supporting?
  • If so, do you have a preference on the approach? I'd lean toward A as an MVP (minimal, no config changes, immediate value) with B as a follow-up for full lifecycle support, but I'm happy to go with whatever fits the project's direction.
  • Any concerns about the marketplace entry format adding an optional dependencies field?

I'm happy to contribute a PR for this if there's interest. I've already explored the plugin system code in detail and have a working plan for the implementation.

Thanks for considering this!

OiTAvO avatar Jul 23 '26 15:07 OiTAvO