mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
refactor: dedupe plugin runtime stores
This commit is contained in:
@@ -1,14 +1,6 @@
|
||||
import { createPluginRuntimeStore } from "openclaw/plugin-sdk";
|
||||
import type { PluginRuntime } from "openclaw/plugin-sdk/line";
|
||||
|
||||
let runtime: PluginRuntime | null = null;
|
||||
|
||||
export function setLineRuntime(r: PluginRuntime): void {
|
||||
runtime = r;
|
||||
}
|
||||
|
||||
export function getLineRuntime(): PluginRuntime {
|
||||
if (!runtime) {
|
||||
throw new Error("LINE runtime not initialized - plugin not registered");
|
||||
}
|
||||
return runtime;
|
||||
}
|
||||
const { setRuntime: setLineRuntime, getRuntime: getLineRuntime } =
|
||||
createPluginRuntimeStore<PluginRuntime>("LINE runtime not initialized - plugin not registered");
|
||||
export { getLineRuntime, setLineRuntime };
|
||||
|
||||
Reference in New Issue
Block a user