Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion examples/openclaw-memory-plugin/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ function Download-Plugin {
"examples/openclaw-memory-plugin/openclaw.plugin.json",
"examples/openclaw-memory-plugin/package.json",
"examples/openclaw-memory-plugin/package-lock.json",
"examples/openclaw-memory-plugin/tsconfig.json",
"examples/openclaw-memory-plugin/.gitignore"
)

Expand Down Expand Up @@ -386,7 +387,14 @@ function Configure-OpenClawPlugin {
$mergedPaths = @($existingPaths + @($PluginDest) | Select-Object -Unique)

$cfg["plugins"]["enabled"] = $true
$cfg["plugins"]["allow"] = @("memory-openviking")
$existingAllow = @()
if ($cfg["plugins"].ContainsKey("allow") -and $cfg["plugins"]["allow"]) {
$existingAllow = @($cfg["plugins"]["allow"])
}
if ($existingAllow -notcontains "memory-openviking") {
$existingAllow += "memory-openviking"
}
$cfg["plugins"]["allow"] = $existingAllow
$cfg["plugins"]["slots"]["memory"] = "memory-openviking"
$cfg["plugins"]["load"]["paths"] = $mergedPaths

Expand Down
1 change: 1 addition & 0 deletions examples/openclaw-memory-plugin/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ download_plugin() {
"examples/openclaw-memory-plugin/openclaw.plugin.json"
"examples/openclaw-memory-plugin/package.json"
"examples/openclaw-memory-plugin/package-lock.json"
"examples/openclaw-memory-plugin/tsconfig.json"
"examples/openclaw-memory-plugin/.gitignore"
)
local total=${#files[@]}
Expand Down
2 changes: 1 addition & 1 deletion examples/openclaw-memory-plugin/openclaw.plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
},
"recallLimit": {
"label": "Recall Limit",
"placeholder": "20",
"placeholder": "6",
"advanced": true
},
"recallScoreThreshold": {
Expand Down
19 changes: 16 additions & 3 deletions examples/openclaw-memory-plugin/setup-helper/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,14 @@ async function fetchPluginFromGitHub(dest) {
const files = [
"examples/openclaw-memory-plugin/index.ts",
"examples/openclaw-memory-plugin/config.ts",
"examples/openclaw-memory-plugin/client.ts",
"examples/openclaw-memory-plugin/process-manager.ts",
"examples/openclaw-memory-plugin/memory-ranking.ts",
"examples/openclaw-memory-plugin/text-utils.ts",
"examples/openclaw-memory-plugin/openclaw.plugin.json",
"examples/openclaw-memory-plugin/package.json",
"examples/openclaw-memory-plugin/package-lock.json",
"examples/openclaw-memory-plugin/tsconfig.json",
"examples/openclaw-memory-plugin/.gitignore",
];
await mkdir(dest, { recursive: true });
Expand Down Expand Up @@ -534,14 +539,22 @@ async function configureOpenclawViaCli(pluginPath, serverPort, installMode, plug
}
await run("openclaw", ["plugins", "install", "-l", pluginPath], extraEnv);
} else {
await runNoShell("openclaw", ["config", "set", "plugins.load.paths", JSON.stringify([pluginPath])], { silent: true }).catch(() => {});
// Merge into existing load paths instead of overwriting
let currentPaths = [];
try {
const rawPaths = await runCapture("openclaw", ["config", "get", "plugins.load.paths", "--json"], { ...extraEnv });
currentPaths = JSON.parse(rawPaths.out || "[]");
} catch {}
if (!Array.isArray(currentPaths)) currentPaths = [];
if (!currentPaths.includes(pluginPath)) currentPaths.push(pluginPath);
await runNoShell("openclaw", ["config", "set", "plugins.load.paths", JSON.stringify(currentPaths), "--json"], { silent: true }).catch(() => {});
}
await runNoShell("openclaw", ["config", "set", "plugins.enabled", "true"]);
// Merge into existing allow list instead of overwriting
let currentAllow = [];
try {
const raw = await run("openclaw", ["config", "get", "plugins.allow", "--json"], { ...extraEnv, silent: true });
currentAllow = JSON.parse(raw.stdout || "[]");
const raw = await runCapture("openclaw", ["config", "get", "plugins.allow", "--json"], { ...extraEnv });
currentAllow = JSON.parse(raw.out || "[]");
} catch {}
if (!Array.isArray(currentAllow)) currentAllow = [];
if (!currentAllow.includes("memory-openviking")) currentAllow.push("memory-openviking");
Expand Down
Loading
Loading