Skip to content

Plugin system: extend jsclaw without forking it #64

Closed

Description

@melvincarvalho

openclaw has plugins for channels, tools, and commands; jsclaw's extensibility story is 'import the library and wire it yourself' — honest, but no ecosystem can grow on it. The channel registry (#51) is already the right seam: let CHANNEL_FACTORIES (and later tool/command registries) load from installable packages, openclaw-plugin style. Scope: registry loading by package name from config, a plugin contract doc, one example external channel. Keep the core small — plugins are where dependencies get to live. Related: #44, #47.

Activity

  1. melvincarvalho commented on Jun 11, 2026

    @melvincarvalho
    ContributorAuthor

    Audit (2026-06-12) — openclaw's plugin system, from docs.openclaw.ai/tools/plugin + their shipped loader

    Findings

    1. Format: a plugin = openclaw.plugin.json manifest + an in-process JS runtime module loaded into the gateway. They additionally accept "compatible bundles" — Claude, Codex, and Cursor plugin layouts mapped into their inventory (ecosystem-greedy by design).

    2. Sources: clawhub:<pkg>, npm:<pkg>, git:github.com/<owner>/<repo>@<ref>, local paths (--link), marketplace. Bare names resolve bundled → official catalog → npm.

    3. Config shape (worth copying verbatim):

      plugins: {
        enabled: true,
        allow: [...], deny: [...],          // deny > allow > per-entry enabled
        load: { paths: ["~/my-plugin"] },
        slots: { memory: "memory-core" },   // exclusive categories
        entries: { "voice-call": { enabled: true, config: {...} } }
      }

      Mature policy details: workspace-origin plugins are default-disabled; plugin-owned tools respect plugins.allow independent of tool allowlists; security.installPolicy runs a trusted local command before any install.

    4. API surface: ~50 registration points (enumerated from their api-builder): registerChannel, registerTool, registerCommand, registerGatewayMethod, registerHttpRoute, registerCli, registerService, registerHook/typed api.on(...) with priority/merge/cancel, plus a provider zoo (speech, realtime voice, media understanding, image/video/music generation, web search/fetch, memory runtimes, context engines, model catalogs, agent harnesses…).

    The jsclaw mapping — plugins complete the loop

    This week built every seam a plugin system needs, without planning to:

    A jsclaw plugin is an external module registering into seams that already exist.

    Division of labor the audit clarified: plugins extend the gateway (host-side); MCP extends the agent (run-side). With MCP shipped both directions, plugins never need to touch the runners — the cleaner architecture openclaw itself can't have (their plugins and agent share a process).

    PoC scope

    1. jsclaw.plugin.json — { id, version, entry, description? }; entry module exports activate(api)
    2. api = { registerChannel, registerCommand, registerGatewayMethod, registerMcpTool, config, logger } — the four existing seams, nothing invented
    3. Config in openclaw's exact shape: plugins.{enabled, allow, deny, load.paths, entries.<id>.{enabled, config}}; deny > allow > entry; plugin config delivered to activate
    4. Loaded at gateway boot via dynamic import(); a failing plugin warns and is skipped, never crashes the gateway
    5. One example plugin in-repo (e.g. a trivial /ping command + a demo channel) as the contract's living documentation

    Deferred

    Install commands (clawhub/npm/git sources — load.paths only for PoC), slots, typed hooks, the provider zoo, compatible-bundle layouts, installPolicy. Runner-side tools intentionally out of scope forever (that's MCP's job).

  2. added a commit that references this issue on Jun 11, 2026
  3. melvincarvalho commented on Jun 11, 2026

    @melvincarvalho
    ContributorAuthor

    Shipped in #77 to the audited PoC scope: jsclaw.plugin.json + activate(api) registering into the four existing seams (channels, slash commands, gateway methods, MCP tools), openclaw's config shape and policy order (deny > allow > entry.enabled), warn-and-skip degradation, per-plugin config delivery, example plugin as living docs. Verified live on all three host surfaces in one run: /ping replied over chat.send, ping.echo answered as a WS method, and the ping MCP tool responded over POST /mcp. Deferred per audit: install sources (clawhub/npm/git), slots, typed hooks, provider zoo, compatible bundles. Runner-side tools intentionally never — that is MCP's job.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions