yymaxapi 1.0.13 → 1.0.14

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/bin/yymaxapi.js +8 -8
  2. package/package.json +1 -1
package/bin/yymaxapi.js CHANGED
@@ -614,11 +614,11 @@ function detectGatewayEnv(port = 18789) {
614
614
  return 'native';
615
615
  }
616
616
 
617
- // 在 Gateway 环境中执行命令(WSL 自动包裹 wsl -- bash -c
617
+ // 在 Gateway 环境中执行命令(WSL 自动包裹 wsl -- bash -lc
618
618
  function execInGatewayEnv(cmd, options = {}) {
619
619
  if (detectGatewayEnv() === 'wsl') {
620
620
  const escaped = cmd.replace(/'/g, "'\\''");
621
- return safeExec(`wsl -- bash -c '${escaped}'`, options);
621
+ return safeExec(`wsl -- bash -lc '${escaped}'`, options);
622
622
  }
623
623
  return safeExec(cmd, options);
624
624
  }
@@ -627,7 +627,7 @@ function execInGatewayEnv(cmd, options = {}) {
627
627
  function execAsyncInGatewayEnv(cmd, options = {}) {
628
628
  if (detectGatewayEnv() === 'wsl') {
629
629
  const escaped = cmd.replace(/'/g, "'\\''");
630
- return { cmd: `wsl -- bash -c '${escaped}'`, options };
630
+ return { cmd: `wsl -- bash -lc '${escaped}'`, options };
631
631
  }
632
632
  return { cmd, options };
633
633
  }
@@ -662,7 +662,7 @@ function cleanupAgentProcesses() {
662
662
  // WSL 内的 agent 也要清理
663
663
  if (detectGatewayEnv() === 'wsl') {
664
664
  try {
665
- execSync('wsl -- bash -c "pkill -f \'openclaw.*agent\' 2>/dev/null; pkill -f \'clawdbot.*agent\' 2>/dev/null; pkill -f \'moltbot.*agent\' 2>/dev/null; true"', { stdio: 'ignore', timeout: 10000 });
665
+ execSync('wsl -- bash -lc "pkill -f \'openclaw.*agent\' 2>/dev/null; pkill -f \'clawdbot.*agent\' 2>/dev/null; pkill -f \'moltbot.*agent\' 2>/dev/null; true"', { stdio: 'ignore', timeout: 10000 });
666
666
  } catch { /* ignore */ }
667
667
  }
668
668
  } else {
@@ -2481,9 +2481,9 @@ async function restartGateway() {
2481
2481
  console.log(chalk.gray(' [检测] Gateway 运行在 WSL 中'));
2482
2482
  return new Promise((resolve) => {
2483
2483
  const wslCmds = [
2484
- 'wsl -- bash -c "openclaw gateway restart"',
2485
- 'wsl -- bash -c "clawdbot gateway restart"',
2486
- 'wsl -- bash -c "moltbot gateway restart"',
2484
+ 'wsl -- bash -lc "openclaw gateway restart"',
2485
+ 'wsl -- bash -lc "clawdbot gateway restart"',
2486
+ 'wsl -- bash -lc "moltbot gateway restart"',
2487
2487
  ];
2488
2488
  let tried = 0;
2489
2489
  const tryNext = () => {
@@ -2661,7 +2661,7 @@ function testGatewayViaAgent(model) {
2661
2661
  if (gwEnv === 'wsl') {
2662
2662
  // Gateway 在 WSL 中,agent 也要在 WSL 中执行
2663
2663
  const agentCmd = `openclaw agent --session-id ${sessionId} --message "请回复你的模型名称" --json --timeout 120 2>/dev/null || clawdbot agent --session-id ${sessionId} --message "请回复你的模型名称" --json --timeout 120 2>/dev/null || moltbot agent --session-id ${sessionId} --message "请回复你的模型名称" --json --timeout 120`;
2664
- cmd = `wsl -- bash -c '${agentCmd.replace(/'/g, "'\\''")}'`;
2664
+ cmd = `wsl -- bash -lc '${agentCmd.replace(/'/g, "'\\''")}'`;
2665
2665
  execOpts = { timeout: 120000 };
2666
2666
  } else {
2667
2667
  const { cliBinary, nodeMajor } = getCliMeta();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yymaxapi",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "跨平台 OpenClaw/Clawdbot 配置管理工具 - 管理中转地址、模型切换、API Keys、测速优化",
5
5
  "main": "bin/yymaxapi.js",
6
6
  "bin": {