@alfe.ai/integrations 0.0.11 → 0.0.13

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.
Files changed (2) hide show
  1. package/dist/index.js +26 -13
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1211,17 +1211,28 @@ var OpenClawApplier = class {
1211
1211
  this.trackingPath = options.configPath ?? join(this.workspace, "config.json");
1212
1212
  }
1213
1213
  async applyPlugin(pkg) {
1214
+ await this.ensurePluginsAllow(pkg);
1214
1215
  if (!this.isPluginInstalled(pkg)) {
1215
- await execFileAsync("openclaw", [
1216
- "plugins",
1217
- "install",
1218
- pkg
1219
- ], { timeout: 6e4 });
1216
+ try {
1217
+ await execFileAsync("openclaw", [
1218
+ "plugins",
1219
+ "install",
1220
+ pkg
1221
+ ], { timeout: 6e4 });
1222
+ } catch (err) {
1223
+ await new Promise((r) => {
1224
+ setTimeout(r, 500);
1225
+ });
1226
+ if (!this.isPluginInstalled(pkg)) throw err;
1227
+ log.warn({
1228
+ pkg,
1229
+ err: err instanceof Error ? err.message : String(err)
1230
+ }, "openclaw plugins install exited with warnings but plugin is installed");
1231
+ }
1220
1232
  await new Promise((r) => {
1221
1233
  setTimeout(r, 500);
1222
1234
  });
1223
1235
  }
1224
- await this.ensurePluginsAllow(pkg);
1225
1236
  }
1226
1237
  /**
1227
1238
  * Ensure the plugin is in plugins.allow in openclaw.json.
@@ -1299,21 +1310,23 @@ var OpenClawApplier = class {
1299
1310
  integrations[integrationId] = config;
1300
1311
  tracking._integrations = integrations;
1301
1312
  this.writeTracking(tracking);
1302
- const pairs = flattenConfig(config);
1303
- for (const [path, value] of pairs) try {
1313
+ const batch = flattenConfig(config).map(([path, value]) => ({
1314
+ path,
1315
+ value
1316
+ }));
1317
+ try {
1304
1318
  await execFileAsync("openclaw", [
1305
1319
  "config",
1306
1320
  "set",
1307
- path,
1308
- JSON.stringify(value),
1321
+ "--batch-json",
1322
+ JSON.stringify(batch),
1309
1323
  "--strict-json"
1310
1324
  ], { timeout: 1e4 });
1311
1325
  } catch (err) {
1312
1326
  log.error({
1313
1327
  err: err instanceof Error ? err.message : String(err),
1314
- path,
1315
- value
1316
- }, "Failed to set config via openclaw config set");
1328
+ batch
1329
+ }, "Failed to set config via openclaw config set --batch-json");
1317
1330
  throw err;
1318
1331
  }
1319
1332
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfe.ai/integrations",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
4
4
  "description": "Integration lifecycle management for Alfe — registry, resolution, installation, and state",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",