fix: repair plugin CI on main · openclaw/openclaw@27ea024
steipete
·
2026-05-02
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -26,6 +26,9 @@
|
26 | 26 | "defaultChoice": "npm", |
27 | 27 | "minHostVersion": ">=2026.5.1-beta.1" |
28 | 28 | }, |
| 29 | +"bundle": { |
| 30 | +"includeInCore": false |
| 31 | + }, |
29 | 32 | "compat": { |
30 | 33 | "pluginApi": ">=2026.5.1-beta.1" |
31 | 34 | }, |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -7,7 +7,6 @@ import {
|
7 | 7 | SessionManager, |
8 | 8 | type FileEntry as PiSessionFileEntry, |
9 | 9 | } from "@mariozechner/pi-coding-agent"; |
10 | | -import { v7 as uuidv7 } from "uuid"; |
11 | 10 | import { updateSessionStore } from "../config/sessions.js"; |
12 | 11 | import type { |
13 | 12 | SessionCompactionCheckpoint, |
@@ -261,7 +260,7 @@ export async function forkCompactionCheckpointTranscriptAsync(params: {
|
261 | 260 | |
262 | 261 | const targetCwd = params.targetCwd ?? sourceHeader.cwd ?? process.cwd(); |
263 | 262 | const sessionDir = params.sessionDir ?? path.dirname(sourceFile); |
264 | | -const sessionId = uuidv7(); |
| 263 | +const sessionId = randomUUID(); |
265 | 264 | const timestamp = new Date().toISOString(); |
266 | 265 | const fileTimestamp = timestamp.replace(/[:.]/g, "-"); |
267 | 266 | const sessionFile = path.join(sessionDir, `${fileTimestamp}_${sessionId}.jsonl`); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -24,8 +24,11 @@ function readManifestRecords(): PluginManifest[] {
|
24 | 24 | return false; |
25 | 25 | } |
26 | 26 | const packageJson = JSON.parse(fs.readFileSync(packagePath, "utf-8")) as { |
27 | | -openclaw?: { extensions?: unknown }; |
| 27 | +openclaw?: { bundle?: { includeInCore?: unknown }; extensions?: unknown }; |
28 | 28 | }; |
| 29 | +if (packageJson.openclaw?.bundle?.includeInCore === false) { |
| 30 | +return false; |
| 31 | +} |
29 | 32 | return normalizeBundledPluginStringList(packageJson.openclaw?.extensions).length > 0; |
30 | 33 | }) |
31 | 34 | .map( |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -64,8 +64,25 @@ function readJsonRecord(filePath: string): Record<string, unknown> | undefined {
|
64 | 64 | } |
65 | 65 | } |
66 | 66 | |
| 67 | +function isExplicitlyDownloadablePlugin(packageJson: Record<string, unknown> | undefined): boolean { |
| 68 | +const openclaw = packageJson?.openclaw; |
| 69 | +if (!openclaw || typeof openclaw !== "object" || Array.isArray(openclaw)) { |
| 70 | +return false; |
| 71 | +} |
| 72 | +const bundle = (openclaw as { bundle?: unknown }).bundle; |
| 73 | +return ( |
| 74 | +bundle !== null && |
| 75 | +typeof bundle === "object" && |
| 76 | +!Array.isArray(bundle) && |
| 77 | +(bundle as { includeInCore?: unknown }).includeInCore === false |
| 78 | +); |
| 79 | +} |
| 80 | + |
67 | 81 | function readBundledCapabilityManifest(pluginDir: string): BundledCapabilityManifest | undefined { |
68 | 82 | const packageJson = readJsonRecord(path.join(pluginDir, "package.json")); |
| 83 | +if (isExplicitlyDownloadablePlugin(packageJson)) { |
| 84 | +return undefined; |
| 85 | +} |
69 | 86 | const extensions = normalizeBundledPluginStringList( |
70 | 87 | packageJson?.openclaw && typeof packageJson.openclaw === "object" |
71 | 88 | ? (packageJson.openclaw as { extensions?: unknown }).extensions |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1176,6 +1176,12 @@ function activatePluginRegistry(
|
1176 | 1176 | } |
1177 | 1177 | |
1178 | 1178 | export function loadOpenClawPlugins(options: PluginLoadOptions = {}): PluginRegistry { |
| 1179 | +const requestedOnlyPluginIds = normalizePluginIdScope(options.onlyPluginIds); |
| 1180 | +const requestedOnlyPluginIdSet = createPluginIdScopeSet(requestedOnlyPluginIds); |
| 1181 | +if (options.activate === false && requestedOnlyPluginIdSet?.size === 0) { |
| 1182 | +return createEmptyPluginRegistry(); |
| 1183 | +} |
| 1184 | + |
1179 | 1185 | const { |
1180 | 1186 | env, |
1181 | 1187 | cfg, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。