@alfe.ai/integrations 0.0.6 → 0.0.7

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/index.d.ts CHANGED
@@ -614,6 +614,11 @@ declare class OpenClawApplier implements RuntimeApplier {
614
614
  private configPath;
615
615
  constructor(options: OpenClawApplierOptions);
616
616
  applyPlugin(pkg: string): Promise<void>;
617
+ /**
618
+ * Check if a plugin is already installed in ~/.openclaw/extensions/.
619
+ * OpenClaw names extension dirs as {pkg-name-with-dashes}-{hash}.
620
+ */
621
+ private isPluginInstalled;
617
622
  removePlugin(pkg: string): Promise<void>;
618
623
  applySkill(name: string, srcPath: string): Promise<void>;
619
624
  removeSkill(name: string): Promise<void>;
package/dist/index.js CHANGED
@@ -1193,16 +1193,28 @@ var OpenClawApplier = class {
1193
1193
  this.configPath = options.configPath ?? join(this.workspace, "config.json");
1194
1194
  }
1195
1195
  async applyPlugin(pkg) {
1196
+ if (this.isPluginInstalled(pkg)) return;
1196
1197
  await execFileAsync("openclaw", [
1197
1198
  "plugins",
1198
1199
  "install",
1199
1200
  pkg
1200
1201
  ], { timeout: 6e4 });
1201
1202
  }
1203
+ /**
1204
+ * Check if a plugin is already installed in ~/.openclaw/extensions/.
1205
+ * OpenClaw names extension dirs as {pkg-name-with-dashes}-{hash}.
1206
+ */
1207
+ isPluginInstalled(pkg) {
1208
+ const extensionsDir = join(homedir(), ".openclaw", "extensions");
1209
+ if (!existsSync(extensionsDir)) return false;
1210
+ const prefix = pkg.replaceAll("/", "-").replaceAll("@", "");
1211
+ return readdirSync(extensionsDir).some((dir) => dir.startsWith(prefix));
1212
+ }
1202
1213
  async removePlugin(pkg) {
1203
1214
  await execFileAsync("openclaw", [
1204
1215
  "plugins",
1205
1216
  "uninstall",
1217
+ "--force",
1206
1218
  pkg
1207
1219
  ], { timeout: 3e4 });
1208
1220
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfe.ai/integrations",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "Integration lifecycle management for Alfe — registry, resolution, installation, and state",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",