hermes - 💡(How to fix) Fix Feature Request: Support pure JS/TS platform plugins without Python wrapper

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Currently, platform plugins must be Python packages. There is no way to write a platform plugin in pure JavaScript/TypeScript — even if all business logic lives in a Node.js subprocess, a Python adapter.py + __init__.py wrapper is required.

This adds unnecessary friction for plugin authors working in the JS/TS ecosystem (e.g. XMTP, blockchain protocols, WebSocket-based platforms).

Root Cause

We're building an XMTP (E2E encrypted messaging) platform plugin for OKX A2A protocol. The entire SDK and business logic is TypeScript. The Python adapter exists solely because Hermes requires it — it contains zero business logic.

Fix Action

Fix / Workaround

Current workaround

Code Example

def _scan_bundled_plugin_platforms(cls) -> set:
    names: set = set()
    platforms_dir = Path(__file__).parent.parent / "plugins" / "platforms"
    if platforms_dir.is_dir():
        for child in platforms_dir.iterdir():
            if (
                child.is_dir()
                and (child / "__init__.py").exists()  # ← Python package required
                and (
                    (child / "plugin.yaml").exists()
                    or (child / "plugin.yml").exists()
                )
            ):
                names.add(child.name.lower())
    return names

---

Hermes Gateway (Python)
  └── adapter.py (Python wrapper, required by Hermes)
        └── JSON-RPC stdio → Node.js subprocess
              └── Actual platform logic (TypeScript)
RAW_BUFFERClick to expand / collapse

Summary

Currently, platform plugins must be Python packages. There is no way to write a platform plugin in pure JavaScript/TypeScript — even if all business logic lives in a Node.js subprocess, a Python adapter.py + __init__.py wrapper is required.

This adds unnecessary friction for plugin authors working in the JS/TS ecosystem (e.g. XMTP, blockchain protocols, WebSocket-based platforms).

Evidence from source code

1. Plugin discovery requires __init__.py

gateway/config.pyPlatform._scan_bundled_plugin_platforms():

def _scan_bundled_plugin_platforms(cls) -> set:
    names: set = set()
    platforms_dir = Path(__file__).parent.parent / "plugins" / "platforms"
    if platforms_dir.is_dir():
        for child in platforms_dir.iterdir():
            if (
                child.is_dir()
                and (child / "__init__.py").exists()  # ← Python package required
                and (
                    (child / "plugin.yaml").exists()
                    or (child / "plugin.yml").exists()
                )
            ):
                names.add(child.name.lower())
    return names

2. Plugin loading uses Python import

hermes_cli/plugins.py uses Python's import machinery to load plugins and call register(ctx).

3. Platform adapters must subclass a Python base class

gateway/platforms/base.py defines BasePlatformAdapter with required methods (connect(), disconnect(), send(), etc.). The gateway calls these methods directly as Python method calls.

4. Tool registration is Python-only

ctx.register_tool() and ctx.register_platform() are Python APIs. There is no JSON-RPC, HTTP, or stdio protocol for plugin registration.

Current workaround

We maintain a thin Python adapter (~360 lines) that:

  1. Spawns a Node.js subprocess (dist/server.js)
  2. Communicates via JSON-RPC over stdio
  3. Proxies tool schemas from TS → Python registration
  4. Proxies messages bidirectionally

This works but is fragile and adds an unnecessary layer:

Hermes Gateway (Python)
  └── adapter.py (Python wrapper, required by Hermes)
        └── JSON-RPC stdio → Node.js subprocess
              └── Actual platform logic (TypeScript)

Proposal

Support a kind: node or kind: js plugin type in plugin.yaml that:

  1. Launches a Node.js subprocess automatically (like MCP stdio servers)
  2. Communicates via a standardized JSON-RPC protocol for:
    • Platform registration (register_platform)
    • Tool registration (register_tool / get_tool_schemas)
    • Lifecycle (connect, disconnect)
    • Message handling (send, handle_message)
    • Notifications (ready, session_created, etc.)
  3. Requires only plugin.yaml + dist/server.js — no Python files

This would align with the existing MCP integration pattern (which already supports stdio transport for non-Python servers) and eliminate the need for boilerplate Python wrappers.

Context

We're building an XMTP (E2E encrypted messaging) platform plugin for OKX A2A protocol. The entire SDK and business logic is TypeScript. The Python adapter exists solely because Hermes requires it — it contains zero business logic.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING