@openclawbrain/cli 0.4.33 → 0.4.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/src/cli.js
CHANGED
|
@@ -1738,6 +1738,10 @@ function readInstallRuntimeFingerprint(openclawHome) {
|
|
|
1738
1738
|
function runOpenClawBrainConvergePluginStep(openclawHome) {
|
|
1739
1739
|
const before = readInstallRuntimeFingerprint(openclawHome);
|
|
1740
1740
|
const plan = planOpenClawBrainConvergePluginAction(before);
|
|
1741
|
+
const pluginManagerEnv = {
|
|
1742
|
+
...process.env,
|
|
1743
|
+
OPENCLAW_HOME: openclawHome
|
|
1744
|
+
};
|
|
1741
1745
|
if (plan.action === "noop") {
|
|
1742
1746
|
return {
|
|
1743
1747
|
plan,
|
|
@@ -1753,7 +1757,7 @@ function runOpenClawBrainConvergePluginStep(openclawHome) {
|
|
|
1753
1757
|
}
|
|
1754
1758
|
let uninstallCapture = null;
|
|
1755
1759
|
if (plan.action === "install" && shouldReplaceOpenClawBrainInstallBeforeConverge(before)) {
|
|
1756
|
-
uninstallCapture = runCapturedExternalCommand("openclaw", ["plugins", "uninstall", plan.pluginId]);
|
|
1760
|
+
uninstallCapture = runCapturedExternalCommand("openclaw", ["plugins", "uninstall", plan.pluginId], { env: pluginManagerEnv });
|
|
1757
1761
|
if (uninstallCapture.error !== null || uninstallCapture.exitCode !== 0) {
|
|
1758
1762
|
throw new Error(`OpenClaw plugin-manager uninstall failed while migrating ${path.resolve(openclawHome)} onto the canonical plugin lane. Tried \`${uninstallCapture.shellCommand}\`. Detail: ${summarizeCapturedCommandFailure(uninstallCapture)}`);
|
|
1759
1763
|
}
|
|
@@ -1761,7 +1765,7 @@ function runOpenClawBrainConvergePluginStep(openclawHome) {
|
|
|
1761
1765
|
const commandArgs = plan.action === "install"
|
|
1762
1766
|
? ["plugins", "install", plan.packageSpec]
|
|
1763
1767
|
: ["plugins", "update", plan.pluginId];
|
|
1764
|
-
const capture = runCapturedExternalCommand("openclaw", commandArgs);
|
|
1768
|
+
const capture = runCapturedExternalCommand("openclaw", commandArgs, { env: pluginManagerEnv });
|
|
1765
1769
|
if (capture.error !== null || capture.exitCode !== 0) {
|
|
1766
1770
|
const hasAuthoritativeNativePlugin = before.selectedInstall !== null && before.installLayout === "native_package_plugin";
|
|
1767
1771
|
if (plan.action === "update" && hasAuthoritativeNativePlugin) {
|
|
@@ -3375,7 +3379,11 @@ function readOpenClawRuntimePackageMetadata() {
|
|
|
3375
3379
|
function buildExtensionIndexTs(activationRoot) {
|
|
3376
3380
|
const templatePath = resolveExtensionTemplatePath();
|
|
3377
3381
|
const template = readFileSync(templatePath, "utf8");
|
|
3378
|
-
|
|
3382
|
+
const activationRootTemplateLinePattern = /^const ACTIVATION_ROOT = "__ACTIVATION_ROOT__";$/m;
|
|
3383
|
+
if (!activationRootTemplateLinePattern.test(template)) {
|
|
3384
|
+
throw new Error(`Extension template ${templatePath} does not expose a patchable ACTIVATION_ROOT line`);
|
|
3385
|
+
}
|
|
3386
|
+
return template.replace(activationRootTemplateLinePattern, `const ACTIVATION_ROOT = ${JSON.stringify(activationRoot)};`);
|
|
3379
3387
|
}
|
|
3380
3388
|
function buildExtensionPackageJson() {
|
|
3381
3389
|
const packageMetadata = readOpenClawPackageMetadata();
|
|
@@ -366,7 +366,7 @@ export function resolveOpenClawBrainInstallTarget(openclawHome) {
|
|
|
366
366
|
}
|
|
367
367
|
export function pinInstalledOpenClawBrainPluginActivationRoot(loaderEntryPath, activationRoot) {
|
|
368
368
|
const loaderSource = readFileSync(loaderEntryPath, "utf8");
|
|
369
|
-
const activationRootPattern =
|
|
369
|
+
const activationRootPattern = /^const\s+ACTIVATION_ROOT\s*=\s*["'`][^"'`]*["'`];$/m;
|
|
370
370
|
const pinnedActivationRoot = `const ACTIVATION_ROOT = ${JSON.stringify(activationRoot)};`;
|
|
371
371
|
const matchedActivationRoot = loaderSource.match(activationRootPattern)?.[0] ?? null;
|
|
372
372
|
if (matchedActivationRoot === null) {
|
package/package.json
CHANGED