openclaw-openviking-setup-helper 0.3.0-beta.7 → 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 +11 -13
  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;
@@ -1419,9 +1419,11 @@ async function configureOpenClawPlugin({
1419
1419
 
1420
1420
  const ocEnv = getOpenClawEnv();
1421
1421
  const needWorkdirFlag = OPENCLAW_DIR !== DEFAULT_OPENCLAW_DIR;
1422
+ const workdirCmds = new Set(["config", "openviking", "status", "gateway", "logs"]);
1422
1423
 
1423
1424
  const oc = async (args) => {
1424
- const fullArgs = needWorkdirFlag ? [...args, "--workdir", OPENCLAW_DIR] : args;
1425
+ const useWorkdir = needWorkdirFlag && args.length > 0 && workdirCmds.has(args[0]);
1426
+ const fullArgs = useWorkdir ? ["--workdir", OPENCLAW_DIR, ...args] : args;
1425
1427
  const result = await runCapture("openclaw", fullArgs, { env: ocEnv, shell: IS_WIN });
1426
1428
  if (result.code !== 0) {
1427
1429
  const detail = result.err || result.out;
@@ -1486,11 +1488,11 @@ async function configureOpenClawPlugin({
1486
1488
  agent_prefix: remoteAgentPrefix,
1487
1489
  };
1488
1490
 
1489
- const setupArgs = [
1490
- "openviking", "setup",
1491
- "--base-url", effectiveRuntimeConfig.baseUrl || remoteBaseUrl,
1492
- "--json",
1493
- ];
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");
1494
1496
  if (effectiveRuntimeConfig.apiKey) {
1495
1497
  setupArgs.push("--api-key", effectiveRuntimeConfig.apiKey);
1496
1498
  }
@@ -1504,10 +1506,6 @@ async function configureOpenClawPlugin({
1504
1506
  setupArgs.push("--allow-offline");
1505
1507
  }
1506
1508
 
1507
- if (needWorkdirFlag) {
1508
- setupArgs.push("--workdir", OPENCLAW_DIR);
1509
- }
1510
-
1511
1509
  info(tr(
1512
1510
  "Delegating configuration to: openclaw openviking setup --json",
1513
1511
  "委托配置给: openclaw openviking setup --json",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openclaw-openviking-setup-helper",
3
- "version": "0.3.0-beta.7",
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": {