feat(plugins): move install records to managed ledger

This commit is contained in:
Vincent Koc
2026-04-25 11:36:42 -07:00
parent e473577eaa
commit 888448facc
31 changed files with 721 additions and 74 deletions

View File

@@ -61,6 +61,7 @@ import {
} from "./config-state.js";
import { discoverOpenClawPlugins } from "./discovery.js";
import { getGlobalHookRunner, initializeGlobalHookRunner } from "./hook-runner-global.js";
import { loadPluginInstallRecordsSync } from "./install-ledger-store.js";
import {
clearPluginInteractiveHandlers,
listPluginInteractiveHandlers,
@@ -1039,6 +1040,7 @@ function resolvePluginLoadCacheContext(options: PluginLoadOptions = {}) {
const shouldInstallBundledRuntimeDeps = options.installBundledRuntimeDeps !== false;
const runtimeSubagentMode = resolveRuntimeSubagentMode(options.runtimeOptions);
const coreGatewayMethodNames = Object.keys(options.coreGatewayHandlers ?? {}).toSorted();
const installRecords = loadPluginInstallRecordsSync({ config: cfg, env });
const cacheKey = buildCacheKey({
workspaceDir: options.workspaceDir,
plugins: trustNormalized,
@@ -1046,7 +1048,7 @@ function resolvePluginLoadCacheContext(options: PluginLoadOptions = {}) {
activationSource,
autoEnabledReasons: options.autoEnabledReasons ?? {},
}),
installs: cfg.plugins?.installs,
installs: installRecords,
env,
onlyPluginIds,
includeSetupOnlyChannelPlugins,
@@ -1751,7 +1753,10 @@ function buildProvenanceIndex(params: {
}
const installRules = new Map<string, InstallTrackingRule>();
const installs = params.config.plugins?.installs ?? {};
const installs = loadPluginInstallRecordsSync({
config: params.config,
env: params.env,
});
for (const [pluginId, install] of Object.entries(installs)) {
const rule: InstallTrackingRule = {
trackedWithoutPaths: false,