openclaw-openviking-setup-helper 0.2.16-dev.2 → 0.2.16-dev.4
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/install.js +11 -4
- package/package.json +1 -1
package/install.js
CHANGED
|
@@ -57,7 +57,7 @@ const FALLBACK_CURRENT = {
|
|
|
57
57
|
id: "openviking",
|
|
58
58
|
kind: "context-engine",
|
|
59
59
|
slot: "contextEngine",
|
|
60
|
-
required: ["index.ts", "config.ts", "package.json"],
|
|
60
|
+
required: ["index.ts", "config.ts", "package.json", "openclaw.plugin.json"],
|
|
61
61
|
optional: [
|
|
62
62
|
"context-engine.ts",
|
|
63
63
|
"client.ts",
|
|
@@ -66,7 +66,6 @@ const FALLBACK_CURRENT = {
|
|
|
66
66
|
"text-utils.ts",
|
|
67
67
|
"tool-call-id.ts",
|
|
68
68
|
"session-transcript-repair.ts",
|
|
69
|
-
"openclaw.plugin.json",
|
|
70
69
|
"tsconfig.json",
|
|
71
70
|
"package-lock.json",
|
|
72
71
|
".gitignore",
|
|
@@ -1308,9 +1307,17 @@ async function downloadPlugin(destDir) {
|
|
|
1308
1307
|
async function createPluginStagingDir() {
|
|
1309
1308
|
const pluginId = resolvedPluginId || "openviking";
|
|
1310
1309
|
const extensionsDir = join(OPENCLAW_DIR, "extensions");
|
|
1311
|
-
const stagingDir = join(extensionsDir, `.${pluginId}.staging-${process.pid}-${Date.now()}`);
|
|
1312
1310
|
await mkdir(extensionsDir, { recursive: true });
|
|
1313
|
-
|
|
1311
|
+
const stagingPrefix = `.${pluginId}.staging-`;
|
|
1312
|
+
try {
|
|
1313
|
+
const entries = readdirSync(extensionsDir, { withFileTypes: true });
|
|
1314
|
+
for (const entry of entries) {
|
|
1315
|
+
if (entry.isDirectory() && entry.name.startsWith(stagingPrefix)) {
|
|
1316
|
+
await rm(join(extensionsDir, entry.name), { recursive: true, force: true });
|
|
1317
|
+
}
|
|
1318
|
+
}
|
|
1319
|
+
} catch {}
|
|
1320
|
+
const stagingDir = join(extensionsDir, `${stagingPrefix}${process.pid}-${Date.now()}`);
|
|
1314
1321
|
await mkdir(stagingDir, { recursive: true });
|
|
1315
1322
|
return stagingDir;
|
|
1316
1323
|
}
|