Files
openclaw/extensions/reef/index.ts
Peter Steinberger d361b4ccb8 feat(reef): headless openclaw reef CLI for agent-driven registration and pairing
Adds a non-interactive command surface (openclaw reef register|status|friend code|request|list|remove) so an agent can claim a handle and manage guarded friendships when its owner asks, without the interactive wizard. --json emits machine-readable output for automation. Registration is crash-safe and idempotent: guard defaults are provider-coupled, the full config is validated before the single-use magic-link token is consumed, a duplicate-handle claim recovers by proving key ownership and reconciling the relay's request policy, the exchanged session is cached scoped to relay+email (never printed) so reruns recover, one state dir is pinned to one identity, and friend removal revokes both the pin and the allowlist entry. Manifest gains commandAliases/onCommands so the CLI resolves; docs cover the agent-driven path.
2026-07-13 16:23:13 -07:00

34 lines
1.2 KiB
TypeScript

import {
defineBundledChannelEntry,
type OpenClawPluginApi,
} from "openclaw/plugin-sdk/channel-entry-contract";
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
import { registerReefCliMetadata } from "./cli-metadata.js";
const loadReefCommandsRuntime = createLazyRuntimeModule(() => import("./commands.runtime.js"));
function registerReefFullRuntime(api: OpenClawPluginApi): void {
api.registerCommand({
name: "reef",
description: "Manage Reef friends and owner review approvals",
acceptsArgs: true,
requireAuth: true,
handler: async (params) => {
const { handleReefCommand } = await loadReefCommandsRuntime();
return await handleReefCommand(params);
},
});
}
export default defineBundledChannelEntry({
id: "reef",
name: "Reef",
description: "Guarded end-to-end encrypted claw channel",
importMetaUrl: import.meta.url,
plugin: { specifier: "./channel-plugin-api.js", exportName: "reefPlugin" },
outbound: { specifier: "./api.js", exportName: "reefOutboundAdapter" },
runtime: { specifier: "./runtime-api.js", exportName: "setReefRuntime" },
registerCliMetadata: registerReefCliMetadata,
registerFull: registerReefFullRuntime,
});