Files
openclaw/src/plugins/plugin-command-registry.ts
T
Peter Steinberger d6f70a96cb fix(plugins): native commands execute the selected plugin (#121544)
* fix(plugins): preserve selected command identity

* test(telegram): use scoped command registries

* test(telegram): isolate command runtime fixtures

* test(telegram): warm native command runtime

* refactor(plugins): keep command metadata private

* fix(plugins): accept synchronous command handlers

* fix(plugins): scope command drain bypass to live execution

* test(telegram): use scoped command registry fixtures

* test(telegram): isolate native menu runtime fixtures

* test(telegram): isolate login session store

* test(telegram): surface login flow failures

* test(telegram): preload native login module

* test(telegram): scope native command registries

* fix(plugins): complete command dispatch contracts

* fix(plugins): break command dispatch import cycles

* fix(plugins): stabilize command dispatch contracts

* fix(channels): keep plugin dispatch options internal

* fix(plugins): keep command dispatch carrier opaque

* test(channels): align delivery adapter fixtures

* test(delivery): align custody ownership coverage

* test(delivery): align latest queue reconciliation

* test(channels): drop obsolete delivery wrappers

* fix(plugins): rebind channel reload starts

* fix(plugins): scope command catalog reloads

* fix(ci): align current runtime contracts

* chore(plugin-sdk): refresh API baseline
2026-08-10 19:30:47 -07:00

25 lines
875 B
TypeScript

/** Exact registry projection helpers for plugin command runtimes. */
import type { PluginRegistry } from "./registry-types.js";
import { getPluginRegistryState } from "./runtime-state.js";
import { getPluginRuntimeGatewayRequestScope } from "./runtime/gateway-request-scope.js";
export function resolveSelectedPluginCommandRegistry(): PluginRegistry | null {
const state = getPluginRegistryState();
return (
state?.registrationContext?.registry ??
getPluginRuntimeGatewayRequestScope()?.pluginRegistry ??
state?.activeRegistry ??
null
);
}
export function listRegisteredPluginCommands(registry: PluginRegistry) {
return registry.commands.map((entry) => ({
...entry.command,
pluginId: entry.pluginId,
pluginName: entry.pluginName,
pluginRoot: entry.rootDir,
trustedOwnerStatusExposure: entry.trustedOwnerStatusExposure,
}));
}