Skip to content

Harness-neutral core: FlowOps + op specs as data + management API + AgentInvoker#49

Open
pallaoro wants to merge 1 commit into
mainfrom
harness-neutral-core
Open

Harness-neutral core: FlowOps + op specs as data + management API + AgentInvoker#49
pallaoro wants to merge 1 commit into
mainfrom
harness-neutral-core

Conversation

@pallaoro

Copy link
Copy Markdown
Member

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 from src/plugin/index.ts into 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):

GET  /ops           # spec discovery
POST /ops/:name     # execute; JSON body = params → { text, details? }
GET  /ops/health

Security: binds 127.0.0.1 only, never starts without a bearer token (manage.token or CLAWFLOW_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)

agent nodes reach their runtime through an interface; OpenClawCliInvoker preserves the existing openclaw agent CLI behavior as the default. Other harnesses (or embedders/tests) inject their own via PluginConfig.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).
  • The Hermes shim itself is intentionally NOT here — it depends on the Phase-1 Hermes canary (clawnify PR #575) validating the real plugin/hook semantics first.

…+ 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.
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.

1 participant