@alfe.ai/integrations 0.0.5 → 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 +5 -0
- package/dist/index.js +23 -9
- package/package.json +1 -1
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
|
@@ -1161,7 +1161,7 @@ var IntegrationManager = class {
|
|
|
1161
1161
|
/**
|
|
1162
1162
|
* OpenClawApplier — applies plugins, skills, and config to the OpenClaw runtime.
|
|
1163
1163
|
*
|
|
1164
|
-
* Plugins are installed via `
|
|
1164
|
+
* Plugins are installed via `npm install` in the OpenClaw workspace directory.
|
|
1165
1165
|
* Skills are copied to ~/.alfe/skills/{name}.
|
|
1166
1166
|
* Config is deep-merged into the OpenClaw agent config, with per-integration
|
|
1167
1167
|
* tracking so changes can be cleanly removed on deactivation.
|
|
@@ -1193,16 +1193,30 @@ var OpenClawApplier = class {
|
|
|
1193
1193
|
this.configPath = options.configPath ?? join(this.workspace, "config.json");
|
|
1194
1194
|
}
|
|
1195
1195
|
async applyPlugin(pkg) {
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1196
|
+
if (this.isPluginInstalled(pkg)) return;
|
|
1197
|
+
await execFileAsync("openclaw", [
|
|
1198
|
+
"plugins",
|
|
1199
|
+
"install",
|
|
1200
|
+
pkg
|
|
1201
|
+
], { timeout: 6e4 });
|
|
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));
|
|
1200
1212
|
}
|
|
1201
1213
|
async removePlugin(pkg) {
|
|
1202
|
-
await execFileAsync("
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1214
|
+
await execFileAsync("openclaw", [
|
|
1215
|
+
"plugins",
|
|
1216
|
+
"uninstall",
|
|
1217
|
+
"--force",
|
|
1218
|
+
pkg
|
|
1219
|
+
], { timeout: 3e4 });
|
|
1206
1220
|
}
|
|
1207
1221
|
applySkill(name, srcPath) {
|
|
1208
1222
|
if (!existsSync(srcPath)) throw new Error(`Skill source path not found: ${srcPath}`);
|
package/package.json
CHANGED