Harness-neutral core: FlowOps + op specs as data + management API + AgentInvoker#49
Open
pallaoro wants to merge 1 commit into
Open
Harness-neutral core: FlowOps + op specs as data + management API + AgentInvoker#49pallaoro wants to merge 1 commit into
pallaoro wants to merge 1 commit into
Conversation
…+ management API
Preparation for multi-harness adapters (Hermes et al.) — no behavior change
for the OpenClaw plugin path.
- FlowOps (src/core/ops.ts): the eleven flow_* tool implementations move out
of the OpenClaw plugin wrapper into a harness-neutral class returning plain
{ text, details? } results.
- FLOW_OP_SPECS (src/core/op-specs.ts): tool names, descriptions, and
JSON-schema parameters as data, so every harness registers the same surface
from one source of truth.
- Management API (src/core/manage.ts): optional loopback-only HTTP server
(127.0.0.1, bearer token required, default port 18794) exposing the op
surface for out-of-process harness shims: GET /ops (spec discovery),
POST /ops/:name (execute), GET /ops/health. Started by the plugin only when
a token is configured (manage.token or CLAWFLOW_ADMIN_TOKEN).
- AgentInvoker (src/core/agent-invoker.ts): agent nodes now reach their
runtime through an interface; OpenClawCliInvoker preserves the existing CLI
behavior as the default. Other harnesses supply their own implementation
via PluginConfig.agentInvoker.
- The OpenClaw plugin (src/plugin/index.ts) shrinks to a thin adapter:
spec-driven tool registration + the approval gate + server startup.
- Tests: ops lifecycle, management server (auth, discovery, execute), custom
invoker routing. 181 pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Preparation for multi-harness adapters (first target: Hermes) — extracts everything harness-neutral out of the OpenClaw plugin wrapper. No behavior change for the OpenClaw path (tool surface, approval gate, webhook server all identical).
FlowOps (
src/core/ops.ts)The eleven
flow_*tool implementations move fromsrc/plugin/index.tsinto a harness-neutral class. Ops return plain{ text, details? }; harness wrappers adapt to their own tool-result shape.Op specs as data (
src/core/op-specs.ts)Tool names, descriptions, and JSON-schema parameters exported as
FLOW_OP_SPECS. The OpenClaw plugin now registers tools by iterating the specs — any other harness shim registers the identical surface from the same source of truth.Management API (
src/core/manage.ts)Optional loopback-only HTTP server for out-of-process shims (e.g. a Python Hermes plugin):
Security: binds
127.0.0.1only, never starts without a bearer token (manage.tokenorCLAWFLOW_ADMIN_TOKEN), constant-time token compare, 1 MB body cap. Default port 18794 (hook server is 18791, flow server 18793). Deliberately separate from the tunnel-exposed flow server.AgentInvoker (
src/core/agent-invoker.ts)agentnodes reach their runtime through an interface;OpenClawCliInvokerpreserves the existingopenclaw agentCLI behavior as the default. Other harnesses (or embedders/tests) inject their own viaPluginConfig.agentInvoker.Tests
181 pass (was 168): new ops lifecycle suite (create → list → read → edit → publish → run → delete → restore), management-server suite (auth rejection, discovery, end-to-end execute, error paths), and a custom-invoker routing test — agent nodes are now testable without the openclaw CLI.
Notes
v1.4.1 → v1.5.0(additive).