openclaw-openviking-setup-helper 0.3.0-beta.6 → 0.3.0-beta.8

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/install.js +13 -9
  2. package/package.json +1 -1
package/install.js CHANGED
@@ -97,9 +97,9 @@ let rollbackLastUpgrade = false;
97
97
  let showCurrentVersion = false;
98
98
 
99
99
  const selectedMode = "remote";
100
- let remoteBaseUrl = "http://127.0.0.1:1933";
101
- let remoteApiKey = "";
102
- let remoteAgentPrefix = "";
100
+ let remoteBaseUrl = (process.env.OPENVIKING_BASE_URL || "http://127.0.0.1:1933").trim();
101
+ let remoteApiKey = (process.env.OPENVIKING_API_KEY || "").trim();
102
+ let remoteAgentPrefix = (process.env.OPENVIKING_AGENT_PREFIX || "").trim();
103
103
  let upgradeRuntimeConfig = null;
104
104
  let installedUpgradeState = null;
105
105
  let upgradeAudit = null;
@@ -1418,9 +1418,13 @@ async function configureOpenClawPlugin({
1418
1418
  const pluginSlot = resolvedPluginSlot;
1419
1419
 
1420
1420
  const ocEnv = getOpenClawEnv();
1421
+ const needWorkdirFlag = OPENCLAW_DIR !== DEFAULT_OPENCLAW_DIR;
1422
+ const workdirCmds = new Set(["config", "openviking", "status", "gateway", "logs"]);
1421
1423
 
1422
1424
  const oc = async (args) => {
1423
- const result = await runCapture("openclaw", args, { env: ocEnv, shell: IS_WIN });
1425
+ const useWorkdir = needWorkdirFlag && args.length > 0 && workdirCmds.has(args[0]);
1426
+ const fullArgs = useWorkdir ? ["--workdir", OPENCLAW_DIR, ...args] : args;
1427
+ const result = await runCapture("openclaw", fullArgs, { env: ocEnv, shell: IS_WIN });
1424
1428
  if (result.code !== 0) {
1425
1429
  const detail = result.err || result.out;
1426
1430
  throw new Error(`openclaw ${args.join(" ")} failed (exit code ${result.code})${detail ? `: ${detail}` : ""}`);
@@ -1484,11 +1488,11 @@ async function configureOpenClawPlugin({
1484
1488
  agent_prefix: remoteAgentPrefix,
1485
1489
  };
1486
1490
 
1487
- const setupArgs = [
1488
- "openviking", "setup",
1489
- "--base-url", effectiveRuntimeConfig.baseUrl || remoteBaseUrl,
1490
- "--json",
1491
- ];
1491
+ const setupArgs = needWorkdirFlag
1492
+ ? ["--workdir", OPENCLAW_DIR, "openviking", "setup"]
1493
+ : ["openviking", "setup"];
1494
+ setupArgs.push("--base-url", effectiveRuntimeConfig.baseUrl || remoteBaseUrl);
1495
+ setupArgs.push("--json");
1492
1496
  if (effectiveRuntimeConfig.apiKey) {
1493
1497
  setupArgs.push("--api-key", effectiveRuntimeConfig.apiKey);
1494
1498
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openclaw-openviking-setup-helper",
3
- "version": "0.3.0-beta.6",
3
+ "version": "0.3.0-beta.8",
4
4
  "description": "Setup helper for installing OpenViking memory plugin into OpenClaw",
5
5
  "type": "module",
6
6
  "bin": {