Files
openclaw/extensions/reef/src/runtime.ts
Peter Steinberger 882b2fe900 feat(channels): bundle Reef guarded claw-to-claw channel (#106232)
* feat(channels): bundle Reef guarded claw-to-claw channel

Moves the Reef channel extension from openclaw/reef into the bundled extensions tree with the wire protocol vendored under extensions/reef/protocol. Includes channelConfigs manifest metadata, runtime status reporting via setStatus/buildAccountSnapshot, abort-aware inbox shutdown, monotonic device-auth timestamps, and immutable-model guard admission (dated snapshots plus documented gpt-5.6 ids).

* fix(reef): pin zod exactly per dependency pin guard

* style(reef): satisfy extension lint gates

Curly braces in vendored protocol, explicit type re-exports, typed catch callbacks, Object.assign over map-spread, abort-aware loop restructure.

* fix(reef): CI gates — knip workspace, boundary tsconfig, facade imports, cycle break, contract baselines

- knip: reef workspace project includes vendored protocol/ (owns noble deps)
- tsconfig: conform to canonical extension package-boundary include/exclude; add @openclaw/plugin-sdk devDependency
- imports: channel-inbound/channel-outbound facades instead of deprecated subpaths
- protocol: home ReplayStore contract in envelope.ts to break the envelope<->replay type cycle
- baselines: reef in unguarded runtime-api list; regenerate bundled channel config metadata

* feat(reef): plugin catalog cover art, channel label, changelog revert

* fix(reef): drop unused error-class exports, register lint suppression

* fix(reef): knip entry surface for vendored protocol, explicit WebSocketLike export
2026-07-13 05:17:44 -07:00

29 lines
809 B
TypeScript

import type { PluginRuntime } from "openclaw/plugin-sdk/core";
import type { ReefMessageFlow } from "./flow.js";
import type { ReefFriendManager } from "./friends.js";
import type { ReviewApprovalStore } from "./state.js";
let runtime: PluginRuntime | undefined;
let active:
| { flow: ReefMessageFlow; friends: ReefFriendManager; reviews: ReviewApprovalStore }
| undefined;
export function setReefRuntime(value: PluginRuntime): void {
runtime = value;
}
export function getReefRuntime(): PluginRuntime {
if (!runtime) {
throw new Error("Reef runtime unavailable");
}
return runtime;
}
export function setActiveReef(value: typeof active): void {
active = value;
}
export function getActiveReef() {
if (!active) {
throw new Error("Reef channel is not running");
}
return active;
}