mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-21 01:51:39 -06:00
7e8afba703
* feat(plugins): mirror local coding sessions to a remote Beam receiver * fix(plugins): satisfy static gates for the Beam mirror seam * fix(plugins): import the config type from the narrow contracts subpath * fix(plugins): require catalog consent and loopback-only plaintext for the Beam mirror
29 lines
996 B
TypeScript
29 lines
996 B
TypeScript
import { getActivePluginSessionExtensionRegistry } from "./runtime.js";
|
|
import type { SessionCatalogProvider } from "./session-catalog.js";
|
|
|
|
export type ActiveSessionCatalog = {
|
|
pluginId: string;
|
|
id: string;
|
|
label: string;
|
|
list: SessionCatalogProvider["list"];
|
|
read: SessionCatalogProvider["read"];
|
|
};
|
|
|
|
/**
|
|
* Read-only list/read facade over the active registered session catalogs.
|
|
* Deliberately excludes continue/archive/terminal so consumers cannot gain
|
|
* session control through this seam; mutation stays on the gateway RPCs.
|
|
*/
|
|
export function listActiveSessionCatalogs(): ActiveSessionCatalog[] {
|
|
const registrations = getActivePluginSessionExtensionRegistry()?.sessionCatalogs ?? [];
|
|
return registrations
|
|
.map(({ pluginId, provider }) => ({
|
|
pluginId,
|
|
id: provider.id,
|
|
label: provider.label,
|
|
list: provider.list.bind(provider),
|
|
read: provider.read.bind(provider),
|
|
}))
|
|
.toSorted((left, right) => left.id.localeCompare(right.id));
|
|
}
|