Operator Control operations
This client mirrors and verifies upstream-compatible behavior. Upstream runtimes remain the canonical protocol owners.
The operator-control folder composes the cavi-control operator plane — a plugin-gated surface that only exists when the cavi-control plugin is installed on the target harness (it runs the same on OpenClaw and Hermes). Its RPC methods (operator.status, operator.snapshot, operator.registry.get, operator.tasks.list, operator.memory.list, operator.worker.*) are the plugin's own methods, not native gateway RPC — so there is no upstream equivalent to be redundant with. The value-add is capability augmentation, per-section degrade-to-fallback with a structured contractGap, and the empty-snapshot builders that shape the degraded view.
Route/RPC owners: CAVI_CONTROL_OPERATOR_API, CAVI_CONTROL_OPERATOR_API_PLUGIN_ALIAS, and CAVI_CONTROL_OPERATOR_RPC_METHODS in extensions/cavi/contracts/paths.ts; surface keys cavi.operator.* in surfaces.ts.
Source: extensions/cavi/operator-control/.
Operations
withCaviControlOperatorCapabilities
Example
const caps = withCaviControlOperatorCapabilities(openClawClient.capabilities);
console.log(caps.features.caviControlOperator); // trueloadOperatorControlSection
Request body / Parameters
| Field | Type | Required | Description | |
|---|---|---|---|---|
| key | OperatorControlSectionKey | required | Section identifier (status, registry, tasks, …). | |
| run | () => Promise<TData> | required | The live loader (RPC or REST). | |
| fallback | () => TData | required | Degraded-mode data used when run fails. | |
| authoritative | boolean | required | Whether a successful load is authoritative. | |
| sampleLimit | `number \ | null` | yes | Sample cap surfaced in sectionStatus. |
| expectedContract | string | required | Contract summary embedded in the contractGap. | |
| note | string | required | Human-readable failure note. |
Example
const section = await loadOperatorControlSection({
key: "tasks",
run: () => wsClient.request("operator.tasks.list", {}),
fallback: () => createEmptyOperatorTasks(),
authoritative: true,
sampleLimit: OPERATOR_TASK_SAMPLE_LIMIT,
expectedContract: "WS operator.tasks.list",
note: "Operator tasks unavailable",
});
console.log(section.status.available, section.contractGap);Empty-snapshot / status builders
createEmptyOperatorStatus, createEmptyOperatorRegistry, createEmptyOperatorTasks, createEmptyOperatorMemory, createEmptyWorkerReady, createEmptyWorkerTasks, createEmptyOperatorSectionStatus, createOperatorSectionStatus, and the OPERATOR_*_SAMPLE_LIMIT constants are client-side (n/a capability) with no upstream equivalent. They provide the deterministic degraded-mode shapes that loadOperatorControlSection falls back to. Kept — they are the fallback data, not a duplicated capability.