Files
openclaw/extensions/coven/index.ts
Val Alexander fc8ccde542 feat(acp): add opt-in Coven runtime bridge
Add the opt-in Coven ACP runtime bridge as a bundled extension while keeping ACPX as the default path.

Security hardening included before merge:
- fail closed by default instead of silently falling back;
- bounded health/socket requests and daemon response sizes;
- fixed Coven socket trust anchor and symlink/path validation;
- reject untrusted harness/session/event ids before exposing them;
- sanitize daemon-controlled terminal/status/error strings;
- use incremental event polling with bounded dedupe state;
- clean up launched Coven sessions before fallback when daemon ids are invalid.

Validation:
- pnpm test extensions/coven/src/config.test.ts extensions/coven/src/client.test.ts extensions/coven/src/runtime.test.ts
- pnpm check:changed
- GitHub CI green on a64eac20b9
- Greptile Review green
2026-04-27 12:22:29 -05:00

33 lines
1.1 KiB
TypeScript

import {
registerAcpRuntimeBackend,
unregisterAcpRuntimeBackend,
} from "openclaw/plugin-sdk/acp-runtime";
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
import { createCovenPluginConfigSchema, resolveCovenPluginConfig } from "./src/config.js";
import { CovenAcpRuntime, COVEN_BACKEND_ID } from "./src/runtime.js";
export default definePluginEntry({
id: COVEN_BACKEND_ID,
name: "Coven ACP Runtime",
description:
"Opt-in ACP runtime backend that launches coding tasks through a local Coven daemon.",
configSchema: () => createCovenPluginConfigSchema(),
register(api) {
api.registerService({
id: "coven-runtime",
async start(ctx) {
const config = resolveCovenPluginConfig({
rawConfig: api.pluginConfig,
workspaceDir: ctx.workspaceDir,
});
const runtime = new CovenAcpRuntime({ config, logger: ctx.logger });
registerAcpRuntimeBackend({ id: COVEN_BACKEND_ID, runtime });
ctx.logger.info("coven ACP runtime backend registered");
},
async stop() {
unregisterAcpRuntimeBackend(COVEN_BACKEND_ID);
},
});
},
});