@chrysb/alphaclaw 0.8.7-beta.5 → 0.8.7-beta.6
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.
|
@@ -156,6 +156,49 @@ const applyManagedOpenclawPatch = ({
|
|
|
156
156
|
return true;
|
|
157
157
|
};
|
|
158
158
|
|
|
159
|
+
const kDisableBundledPluginPostinstallEnv =
|
|
160
|
+
"OPENCLAW_DISABLE_BUNDLED_PLUGIN_POSTINSTALL";
|
|
161
|
+
const kBundledPluginPostinstallFailureMarker =
|
|
162
|
+
"[postinstall] could not install bundled plugin deps:";
|
|
163
|
+
|
|
164
|
+
const runManagedOpenclawBundledPluginPostinstall = ({
|
|
165
|
+
execSyncImpl,
|
|
166
|
+
fsModule = fs,
|
|
167
|
+
logger = console,
|
|
168
|
+
runtimeDir,
|
|
169
|
+
} = {}) => {
|
|
170
|
+
const packageRoot = getManagedOpenclawPackageRoot({ runtimeDir });
|
|
171
|
+
const postinstallScriptPath = path.join(
|
|
172
|
+
packageRoot,
|
|
173
|
+
"scripts",
|
|
174
|
+
"postinstall-bundled-plugins.mjs",
|
|
175
|
+
);
|
|
176
|
+
if (!fsModule.existsSync(postinstallScriptPath)) {
|
|
177
|
+
return false;
|
|
178
|
+
}
|
|
179
|
+
const env = { ...process.env };
|
|
180
|
+
delete env[kDisableBundledPluginPostinstallEnv];
|
|
181
|
+
const output = String(
|
|
182
|
+
execSyncImpl(
|
|
183
|
+
`${shellQuote(process.execPath)} ${shellQuote(postinstallScriptPath)} 2>&1`,
|
|
184
|
+
{
|
|
185
|
+
cwd: packageRoot,
|
|
186
|
+
env,
|
|
187
|
+
encoding: "utf8",
|
|
188
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
189
|
+
timeout: 180000,
|
|
190
|
+
},
|
|
191
|
+
) || "",
|
|
192
|
+
).trim();
|
|
193
|
+
if (output) {
|
|
194
|
+
logger.log(output);
|
|
195
|
+
}
|
|
196
|
+
if (output.includes(kBundledPluginPostinstallFailureMarker)) {
|
|
197
|
+
throw new Error(output);
|
|
198
|
+
}
|
|
199
|
+
return true;
|
|
200
|
+
};
|
|
201
|
+
|
|
159
202
|
const installManagedOpenclawRuntime = ({
|
|
160
203
|
execSyncImpl,
|
|
161
204
|
fsModule = fs,
|
|
@@ -190,6 +233,10 @@ const installManagedOpenclawRuntime = ({
|
|
|
190
233
|
`npm install ${shellQuote(installTarget)} --omit=dev --no-save --save=false --package-lock=false --prefer-online`,
|
|
191
234
|
{
|
|
192
235
|
cwd: runtimeDir,
|
|
236
|
+
env: {
|
|
237
|
+
...process.env,
|
|
238
|
+
[kDisableBundledPluginPostinstallEnv]: "1",
|
|
239
|
+
},
|
|
193
240
|
stdio: "inherit",
|
|
194
241
|
timeout: 180000,
|
|
195
242
|
},
|
|
@@ -197,6 +244,12 @@ const installManagedOpenclawRuntime = ({
|
|
|
197
244
|
} finally {
|
|
198
245
|
packedSource?.cleanup?.();
|
|
199
246
|
}
|
|
247
|
+
runManagedOpenclawBundledPluginPostinstall({
|
|
248
|
+
execSyncImpl,
|
|
249
|
+
fsModule,
|
|
250
|
+
logger,
|
|
251
|
+
runtimeDir,
|
|
252
|
+
});
|
|
200
253
|
const installedVersion = readManagedOpenclawRuntimeVersion({
|
|
201
254
|
fsModule,
|
|
202
255
|
runtimeDir,
|
|
@@ -334,5 +387,6 @@ module.exports = {
|
|
|
334
387
|
prependManagedOpenclawBinToPath,
|
|
335
388
|
readBundledOpenclawVersion,
|
|
336
389
|
readManagedOpenclawRuntimeVersion,
|
|
390
|
+
runManagedOpenclawBundledPluginPostinstall,
|
|
337
391
|
syncManagedOpenclawRuntimeWithBundled,
|
|
338
392
|
};
|