@qqbrowser/qbot-claw-launcher 0.10.7 → 0.10.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.
package/dist/build.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.IS_DEBUG_BUILD=exports.LAUNCHER_VERSION=void 0,exports.LAUNCHER_VERSION="0.10.7",exports.IS_DEBUG_BUILD=!1;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.IS_DEBUG_BUILD=exports.LAUNCHER_VERSION=void 0,exports.LAUNCHER_VERSION="0.10.8",exports.IS_DEBUG_BUILD=!1;
package/dist/state.js CHANGED
@@ -1 +1,2 @@
1
- "use strict";var c=exports&&exports.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.readState=l,exports.writeState=s,exports.clearState=y,exports.stopGateway=p,exports.isPortAvailable=u,exports.findAvailablePort=E;const t=c(require("fs")),S=c(require("path")),_=c(require("net")),o=require("child_process"),n=require("./config"),w=require("./reportLog");let a=null;function l(){if(a)return a;try{if(t.default.existsSync(n.STATE_FILE)){const e=JSON.parse(t.default.readFileSync(n.STATE_FILE,"utf-8"));return a=e,e}}catch{}return{}}function s(e){a=e;const r=S.default.dirname(n.STATE_FILE);t.default.existsSync(r)||t.default.mkdirSync(r,{recursive:!0}),t.default.writeFileSync(n.STATE_FILE,JSON.stringify(e,null,2))}function y(){a=null,t.default.existsSync(n.STATE_FILE)&&t.default.unlinkSync(n.STATE_FILE)}function p(){const e=l();try{if(process.platform==="win32"){const d=Buffer.from("Get-CimInstance Win32_Process | Where-Object {$_.CommandLine -like '*.qbotclaw*' -and $_.CommandLine -like '*gateway*'} | ForEach-Object { & taskkill /F /T /PID $_.ProcessId 2>$null }","utf16le").toString("base64");(0,o.execSync)(`powershell.exe -NoProfile -EncodedCommand ${d}`,{stdio:"ignore",windowsHide:!0})}else(0,o.execSync)('pkill -f "openclaw-gateway" 2>/dev/null',{stdio:"ignore",windowsHide:!0});(0,w.log)("\u5DF2\u6E05\u7406\u6240\u6709 qbotclaw gateway \u6B8B\u7559\u8FDB\u7A0B")}catch{}const{gatewayPid:r,gatewayPort:i,mcpWsPort:g,...f}=e;s(f)}function u(e){return new Promise(r=>{const i=_.default.createServer();i.once("error",()=>r(!1)),i.once("listening",()=>{i.close(()=>r(!0))}),i.listen(e,"127.0.0.1")})}async function E(){for(;;){const e=Math.floor(Math.random()*5e4)+1e4;if(await u(e))return e}}
1
+ "use strict";var l=exports&&exports.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.readState=f,exports.writeState=d,exports.clearState=_,exports.stopGateway=g,exports.isPortAvailable=S,exports.findAvailablePort=P;const r=l(require("fs")),p=l(require("path")),y=l(require("net")),s=require("child_process"),a=require("./config"),u=require("./reportLog");let c=null;function f(){if(c)return c;try{if(r.default.existsSync(a.STATE_FILE)){const t=JSON.parse(r.default.readFileSync(a.STATE_FILE,"utf-8"));return c=t,t}}catch{}return{}}function d(t){c=t;const e=p.default.dirname(a.STATE_FILE);r.default.existsSync(e)||r.default.mkdirSync(e,{recursive:!0}),r.default.writeFileSync(a.STATE_FILE,JSON.stringify(t,null,2))}function _(){c=null,r.default.existsSync(a.STATE_FILE)&&r.default.unlinkSync(a.STATE_FILE)}function g(){const t=f();try{if(process.platform==="win32"){const w=Buffer.from("Get-CimInstance Win32_Process | Where-Object {$_.CommandLine -like '*.qbotclaw*' -and $_.CommandLine -like '*gateway*'} | ForEach-Object { & taskkill /F /T /PID $_.ProcessId 2>$null }","utf16le").toString("base64");(0,s.execSync)(`powershell.exe -NoProfile -EncodedCommand ${w}`,{stdio:"ignore",windowsHide:!0}),h(8766)}else(0,s.execSync)('pkill -f "openclaw-gateway" 2>/dev/null',{stdio:"ignore",windowsHide:!0});(0,u.log)("\u5DF2\u6E05\u7406\u6240\u6709 qbotclaw gateway \u6B8B\u7559\u8FDB\u7A0B")}catch{(0,u.log)("\u6E05\u7406 qbotclaw gateway \u6B8B\u7559\u8FDB\u7A0B\u5931\u8D25")}const{gatewayPid:e,gatewayPort:n,mcpWsPort:i,...o}=t;d(o)}function h(t){try{const e=(0,s.execSync)(`netstat -ano -p tcp | findstr ":${t} "`,{encoding:"utf-8",windowsHide:!0}),n=new Set;for(const i of e.split(`
2
+ `)){const o=i.trim().split(/\s+/);o.length>=5&&n.add(o[o.length-1])}for(const i of n)if(i&&i!=="0")try{(0,s.execSync)(`taskkill /F /T /PID ${i}`,{stdio:"ignore",windowsHide:!0})}catch{}}catch{}}function S(t){return new Promise(e=>{const n=y.default.createServer();n.once("error",()=>e(!1)),n.once("listening",()=>{n.close(()=>e(!0))}),n.listen(t,"127.0.0.1")})}async function P(){for(;;){const t=Math.floor(Math.random()*5e4)+1e4;if(await S(t))return t}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qqbrowser/qbot-claw-launcher",
3
- "version": "0.10.7",
3
+ "version": "0.10.8",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "bin": {