Download extensions/bluebubbles/src/runtime.ts from Darochin/openskynet: direct link, hf CLI and curl.
- Browser
- Download file 1.03 kB
-
https://huggingface.co/Darochin/openskynet/resolve/main/extensions/bluebubbles/src/runtime.ts
- Command line
-
hf download hf://Darochin/openskynet/extensions/bluebubbles/src/runtime.ts
-
curl -L -o runtime.ts https://huggingface.co/Darochin/openskynet/resolve/main/extensions/bluebubbles/src/runtime.ts
1.03 kB
| import type { PluginRuntime } from "openclaw/plugin-sdk/bluebubbles"; | |
| import { createPluginRuntimeStore } from "openclaw/plugin-sdk/compat"; | |
| const runtimeStore = createPluginRuntimeStore<PluginRuntime>("BlueBubbles runtime not initialized"); | |
| type LegacyRuntimeLogShape = { log?: (message: string) => void }; | |
| export const setBlueBubblesRuntime = runtimeStore.setRuntime; | |
| export function clearBlueBubblesRuntime(): void { | |
| runtimeStore.clearRuntime(); | |
| } | |
| export function tryGetBlueBubblesRuntime(): PluginRuntime | null { | |
| return runtimeStore.tryGetRuntime(); | |
| } | |
| export function getBlueBubblesRuntime(): PluginRuntime { | |
| return runtimeStore.getRuntime(); | |
| } | |
| export function warnBlueBubbles(message: string): void { | |
| const formatted = `[bluebubbles] ${message}`; | |
| // Backward-compatible with tests/legacy injections that pass { log }. | |
| const log = (runtimeStore.tryGetRuntime() as unknown as LegacyRuntimeLogShape | null)?.log; | |
| if (typeof log === "function") { | |
| log(formatted); | |
| return; | |
| } | |
| console.warn(formatted); | |
| } | |