mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-02 21:31:35 +00:00
* fix(browser): preserve tab cleanup across restarts * fix(browser): disambiguate restart tab aliases * fix(browser): keep untrack selection type private --------- Co-authored-by: Peter Steinberger <steipete@gmail.com>
19 lines
710 B
TypeScript
19 lines
710 B
TypeScript
import type { PluginStateSyncKeyedStore } from "openclaw/plugin-sdk/plugin-state-runtime";
|
|
// Browser plugin runtime state shared across lazy bundles and duplicate SDK module instances.
|
|
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
|
|
|
type BrowserStateRuntime = {
|
|
sessionTabs: PluginStateSyncKeyedStore<unknown>;
|
|
};
|
|
|
|
const {
|
|
setRuntime: setBrowserStateRuntime,
|
|
getRuntime: getBrowserStateRuntime,
|
|
tryGetRuntime: getOptionalBrowserStateRuntime,
|
|
} = createPluginRuntimeStore<BrowserStateRuntime>({
|
|
pluginId: "browser",
|
|
errorMessage: "Browser state runtime not initialized",
|
|
});
|
|
|
|
export { getBrowserStateRuntime, getOptionalBrowserStateRuntime, setBrowserStateRuntime };
|