Files
openclaw/src/plugins/manifest-contract-runtime.ts
Peter Steinberger 98e3f729bc refactor: remove dead plugin loader exports (#105937)
* refactor(plugins): trim activation and contract exports

* test(plugins): restore fixture cleanup

* refactor(plugins): trim install and loader exports

* test(plugins): fully reset loader caches

* refactor(plugins): trim metadata and catalog exports

* test(plugins): preserve catalog trust coverage

* refactor(plugins): trim provider and plugin exports

* refactor(plugins): trim runtime and tool exports

* test(plugins): update dead-export consumers

* test(plugins): remove empty dead-export suites

* refactor(plugins): align exports with split registry

* refactor(plugins): trim drifted loader exports

* style(plugins): format test fixtures

* refactor(scripts): use supported plugin APIs

* refactor(plugins): finish dead export cleanup

* chore(deadcode): refresh export baseline

* test(cli): mock production memory state

* chore(deadcode): sync latest export baseline

* fix(tests): keep plugin fixtures inside core

* chore(deadcode): refresh rebased export baseline

* chore(deadcode): sync current ratchets

* fix(plugins): retain reserved slot invariant

* fix(plugins): preserve dead-export invariants

* test(plugins): use neutral catalog query fixture

* test(plugins): satisfy catalog lint

* test(plugins): preserve integrity drift coverage

* fix(ci): register skill experience live proof
2026-07-13 01:29:33 -07:00

46 lines
1.6 KiB
TypeScript

// Resolves manifest contracts into runtime-facing plugin capabilities.
import { sortUniqueStrings } from "@openclaw/normalization-core/string-normalization";
import type { OpenClawConfig } from "../config/types.openclaw.js";
import {
hasManifestContractValue,
listAvailableManifestContractPlugins,
} from "./manifest-contract-eligibility.js";
import type { PluginManifestContractListKey } from "./manifest-registry.js";
import { loadPluginMetadataSnapshot } from "./plugin-metadata-snapshot.js";
type ManifestContractRuntimePluginResolution = {
pluginIds: string[];
bundledCompatPluginIds: string[];
};
export function resolveManifestContractRuntimePluginResolution(params: {
cfg?: OpenClawConfig;
contract: PluginManifestContractListKey;
value?: string;
}): ManifestContractRuntimePluginResolution {
const snapshot = loadPluginMetadataSnapshot({
config: params.cfg ?? {},
env: process.env,
});
const allContractPlugins = snapshot.plugins.filter((plugin) =>
hasManifestContractValue({
plugin,
contract: params.contract,
value: params.value,
}),
);
const bundledCompatPluginIds = allContractPlugins
.filter((plugin) => plugin.origin === "bundled")
.map((plugin) => plugin.id);
const pluginIds = listAvailableManifestContractPlugins({
snapshot: { index: snapshot.index, plugins: allContractPlugins },
contract: params.contract,
value: params.value,
config: params.cfg,
}).map((plugin) => plugin.id);
return {
pluginIds: sortUniqueStrings(pluginIds),
bundledCompatPluginIds: sortUniqueStrings(bundledCompatPluginIds),
};
}