fix: repair plugin CI on main

This commit is contained in:
Peter Steinberger
2026-05-02 03:10:29 +01:00
parent 44a8c40114
commit 27ea0249bd
5 changed files with 31 additions and 3 deletions

View File

@@ -26,6 +26,9 @@
"defaultChoice": "npm",
"minHostVersion": ">=2026.5.1-beta.1"
},
"bundle": {
"includeInCore": false
},
"compat": {
"pluginApi": ">=2026.5.1-beta.1"
},

View File

@@ -7,7 +7,6 @@ import {
SessionManager,
type FileEntry as PiSessionFileEntry,
} from "@mariozechner/pi-coding-agent";
import { v7 as uuidv7 } from "uuid";
import { updateSessionStore } from "../config/sessions.js";
import type {
SessionCompactionCheckpoint,
@@ -261,7 +260,7 @@ export async function forkCompactionCheckpointTranscriptAsync(params: {
const targetCwd = params.targetCwd ?? sourceHeader.cwd ?? process.cwd();
const sessionDir = params.sessionDir ?? path.dirname(sourceFile);
const sessionId = uuidv7();
const sessionId = randomUUID();
const timestamp = new Date().toISOString();
const fileTimestamp = timestamp.replace(/[:.]/g, "-");
const sessionFile = path.join(sessionDir, `${fileTimestamp}_${sessionId}.jsonl`);

View File

@@ -24,8 +24,11 @@ function readManifestRecords(): PluginManifest[] {
return false;
}
const packageJson = JSON.parse(fs.readFileSync(packagePath, "utf-8")) as {
openclaw?: { extensions?: unknown };
openclaw?: { bundle?: { includeInCore?: unknown }; extensions?: unknown };
};
if (packageJson.openclaw?.bundle?.includeInCore === false) {
return false;
}
return normalizeBundledPluginStringList(packageJson.openclaw?.extensions).length > 0;
})
.map(

View File

@@ -64,8 +64,25 @@ function readJsonRecord(filePath: string): Record<string, unknown> | undefined {
}
}
function isExplicitlyDownloadablePlugin(packageJson: Record<string, unknown> | undefined): boolean {
const openclaw = packageJson?.openclaw;
if (!openclaw || typeof openclaw !== "object" || Array.isArray(openclaw)) {
return false;
}
const bundle = (openclaw as { bundle?: unknown }).bundle;
return (
bundle !== null &&
typeof bundle === "object" &&
!Array.isArray(bundle) &&
(bundle as { includeInCore?: unknown }).includeInCore === false
);
}
function readBundledCapabilityManifest(pluginDir: string): BundledCapabilityManifest | undefined {
const packageJson = readJsonRecord(path.join(pluginDir, "package.json"));
if (isExplicitlyDownloadablePlugin(packageJson)) {
return undefined;
}
const extensions = normalizeBundledPluginStringList(
packageJson?.openclaw && typeof packageJson.openclaw === "object"
? (packageJson.openclaw as { extensions?: unknown }).extensions

View File

@@ -1176,6 +1176,12 @@ function activatePluginRegistry(
}
export function loadOpenClawPlugins(options: PluginLoadOptions = {}): PluginRegistry {
const requestedOnlyPluginIds = normalizePluginIdScope(options.onlyPluginIds);
const requestedOnlyPluginIdSet = createPluginIdScopeSet(requestedOnlyPluginIds);
if (options.activate === false && requestedOnlyPluginIdSet?.size === 0) {
return createEmptyPluginRegistry();
}
const {
env,
cfg,