@qqbrowser/qbot-claw-launcher 0.9.35 → 0.9.36

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.
@@ -1 +1 @@
1
- "use strict";var S=exports&&exports.__createBinding||(Object.create?function(e,n,a,t){t===void 0&&(t=a);var r=Object.getOwnPropertyDescriptor(n,a);(!r||("get"in r?!n.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return n[a]}}),Object.defineProperty(e,t,r)}:function(e,n,a,t){t===void 0&&(t=a),e[t]=n[a]}),O=exports&&exports.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),D=exports&&exports.__importStar||function(){var e=function(n){return e=Object.getOwnPropertyNames||function(a){var t=[];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(t[t.length]=r);return t},e(n)};return function(n){if(n&&n.__esModule)return n;var a={};if(n!=null)for(var t=e(n),r=0;r<t.length;r++)t[r]!=="default"&&S(a,n,t[r]);return O(a,n),a}}(),m=exports&&exports.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.fullScanClearQuarantine=v,exports.stopWatchWorkspaceQuarantine=I,exports.watchWorkspaceQuarantine=W;const d=m(require("path")),g=m(require("fs")),w=require("fs-xattr"),Q=D(require("@parcel/watcher")),_=require("./config"),i=require("./reportLog");let u=null;const T=new Set([".dylib",".so",".node"]),E=["/.npm-cache/","/_cacache/","/.pip-cache/","/__pycache__/","/.cache/","/tmp/","/node_modules/.bin/","/win32_","/linux_","/musl_","/openbsd_","/freebsd_"],P=new Set(["license","licence","readme","changelog","changes","history","authors","contributors","version","files","makefile","cname","copying","notice","patents","metadata"]);function b(e){for(const n of E)if(e.includes(n))return!0;return!1}function y(e){const n=d.default.extname(e).toLowerCase();if(n===""){const a=d.default.basename(e).toLowerCase();return!P.has(a)}return T.has(n)}async function A(e){try{await(0,w.removeAttribute)(e,"com.apple.quarantine"),(0,i.log)(`[quarantine] \u5DF2\u6E05\u9664 quarantine \u5C5E\u6027: ${e}`)}catch{}}let h=null,p=null;async function v(e){if(p){(0,i.log)(`[quarantine] \u8865\u507F\u626B\u63CF\u5DF2\u5728\u6267\u884C\u4E2D\uFF0C\u7B49\u5F85\u5176\u5B8C\u6210 (\u89E6\u53D1\u539F\u56E0: ${e})`),await p;return}const n=Date.now();(0,i.log)(`[quarantine] \u5F00\u59CB\u5168\u91CF\u8865\u507F\u626B\u63CF (\u539F\u56E0: ${e})`);let a;p=new Promise(t=>{a=t});try{let r=function(c){let f;try{f=g.default.readdirSync(c,{withFileTypes:!0})}catch{return}for(const s of f){const o=d.default.join(c,s.name);s.isDirectory()?b(o+"/")||r(o):s.isFile()&&!b(o)&&y(o)&&t.push(o)}};const t=[];r(_.QBOT_CLAW_DIR);const l=1e3;for(let c=0;c<t.length;c+=l){const f=t.slice(c,c+l);await Promise.all(f.map(s=>(0,w.removeAttribute)(s,"com.apple.quarantine").catch(()=>{})))}const q=Date.now()-n;(0,i.log)(`[quarantine] \u8865\u507F\u626B\u63CF\u5B8C\u6210: \u626B\u63CF\u5230 ${t.length} \u4E2A\u76EE\u6807\u6587\u4EF6, \u8017\u65F6 ${q}ms`)}catch(t){(0,i.log)(`[quarantine] \u8865\u507F\u626B\u63CF\u51FA\u9519: ${t.message}`)}finally{p=null,a()}}function C(e){h&&clearTimeout(h),h=setTimeout(()=>{h=null,v(e)},200)}async function I(){u&&((0,i.log)("[quarantine] \u505C\u6B62\u76D1\u542C\u76EE\u5F55"),await u.unsubscribe(),u=null)}async function W(){g.default.mkdirSync(_.QBOT_CLAW_DIR,{recursive:!0}),u&&((0,i.log)("[quarantine] \u5173\u95ED\u65E7\u7684 watcher\uFF0C\u51C6\u5907\u91CD\u5EFA"),await u.unsubscribe(),u=null);try{u=await Q.subscribe(_.QBOT_CLAW_DIR,(e,n)=>{if(e){(0,i.log)(`[quarantine] watcher \u53D1\u751F\u9519\u8BEF: ${e.message}`),e.message.includes("Events were dropped")&&C("FSEvents \u4E8B\u4EF6\u4E22\u5931");return}for(const a of n){if(a.type!=="create")continue;const t=a.path;b(t)||y(t)&&g.default.stat(t,(r,l)=>{r||!l.isFile()||A(t)})}},{backend:"fs-events",ignore:["**/.npm-cache/**","**/_cacache/**","**/.pip-cache/**","**/__pycache__/**","**/.cache/**","**/tmp/**","**/node_modules/.bin/**"]}),(0,i.log)(`[quarantine] \u5F00\u59CB\u76D1\u542C\u76EE\u5F55: ${_.QBOT_CLAW_DIR} (\u4F7F\u7528 @parcel/watcher, \u4F4E\u5EF6\u8FDF FSEvents)`)}catch(e){(0,i.log)(`[quarantine] \u542F\u52A8 watcher \u5931\u8D25: ${e.message}`)}}
1
+ "use strict";var S=exports&&exports.__createBinding||(Object.create?(function(e,n,a,t){t===void 0&&(t=a);var r=Object.getOwnPropertyDescriptor(n,a);(!r||("get"in r?!n.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return n[a]}}),Object.defineProperty(e,t,r)}):(function(e,n,a,t){t===void 0&&(t=a),e[t]=n[a]})),O=exports&&exports.__setModuleDefault||(Object.create?(function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}):function(e,n){e.default=n}),D=exports&&exports.__importStar||(function(){var e=function(n){return e=Object.getOwnPropertyNames||function(a){var t=[];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(t[t.length]=r);return t},e(n)};return function(n){if(n&&n.__esModule)return n;var a={};if(n!=null)for(var t=e(n),r=0;r<t.length;r++)t[r]!=="default"&&S(a,n,t[r]);return O(a,n),a}})(),m=exports&&exports.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.fullScanClearQuarantine=v,exports.stopWatchWorkspaceQuarantine=I,exports.watchWorkspaceQuarantine=W;const d=m(require("path")),g=m(require("fs")),w=require("fs-xattr"),Q=D(require("@parcel/watcher")),_=require("./config"),i=require("./reportLog");let u=null;const T=new Set([".dylib",".so",".node"]),E=["/.npm-cache/","/_cacache/","/.pip-cache/","/__pycache__/","/.cache/","/tmp/","/node_modules/.bin/","/win32_","/linux_","/musl_","/openbsd_","/freebsd_"],P=new Set(["license","licence","readme","changelog","changes","history","authors","contributors","version","files","makefile","cname","copying","notice","patents","metadata"]);function b(e){for(const n of E)if(e.includes(n))return!0;return!1}function y(e){const n=d.default.extname(e).toLowerCase();if(n===""){const a=d.default.basename(e).toLowerCase();return!P.has(a)}return T.has(n)}async function A(e){try{await(0,w.removeAttribute)(e,"com.apple.quarantine"),(0,i.log)(`[quarantine] \u5DF2\u6E05\u9664 quarantine \u5C5E\u6027: ${e}`)}catch{}}let h=null,p=null;async function v(e){if(p){(0,i.log)(`[quarantine] \u8865\u507F\u626B\u63CF\u5DF2\u5728\u6267\u884C\u4E2D\uFF0C\u7B49\u5F85\u5176\u5B8C\u6210 (\u89E6\u53D1\u539F\u56E0: ${e})`),await p;return}const n=Date.now();(0,i.log)(`[quarantine] \u5F00\u59CB\u5168\u91CF\u8865\u507F\u626B\u63CF (\u539F\u56E0: ${e})`);let a;p=new Promise(t=>{a=t});try{let r=function(c){let f;try{f=g.default.readdirSync(c,{withFileTypes:!0})}catch{return}for(const s of f){const o=d.default.join(c,s.name);s.isDirectory()?b(o+"/")||r(o):s.isFile()&&!b(o)&&y(o)&&t.push(o)}};const t=[];r(_.QBOT_CLAW_DIR);const l=1e3;for(let c=0;c<t.length;c+=l){const f=t.slice(c,c+l);await Promise.all(f.map(s=>(0,w.removeAttribute)(s,"com.apple.quarantine").catch(()=>{})))}const q=Date.now()-n;(0,i.log)(`[quarantine] \u8865\u507F\u626B\u63CF\u5B8C\u6210: \u626B\u63CF\u5230 ${t.length} \u4E2A\u76EE\u6807\u6587\u4EF6, \u8017\u65F6 ${q}ms`)}catch(t){(0,i.log)(`[quarantine] \u8865\u507F\u626B\u63CF\u51FA\u9519: ${t.message}`)}finally{p=null,a()}}function C(e){h&&clearTimeout(h),h=setTimeout(()=>{h=null,v(e)},200)}async function I(){u&&((0,i.log)("[quarantine] \u505C\u6B62\u76D1\u542C\u76EE\u5F55"),await u.unsubscribe(),u=null)}async function W(){g.default.mkdirSync(_.QBOT_CLAW_DIR,{recursive:!0}),u&&((0,i.log)("[quarantine] \u5173\u95ED\u65E7\u7684 watcher\uFF0C\u51C6\u5907\u91CD\u5EFA"),await u.unsubscribe(),u=null);try{u=await Q.subscribe(_.QBOT_CLAW_DIR,(e,n)=>{if(e){(0,i.log)(`[quarantine] watcher \u53D1\u751F\u9519\u8BEF: ${e.message}`),e.message.includes("Events were dropped")&&C("FSEvents \u4E8B\u4EF6\u4E22\u5931");return}for(const a of n){if(a.type!=="create")continue;const t=a.path;b(t)||y(t)&&g.default.stat(t,(r,l)=>{r||!l.isFile()||A(t)})}},{backend:"fs-events",ignore:["**/.npm-cache/**","**/_cacache/**","**/.pip-cache/**","**/__pycache__/**","**/.cache/**","**/tmp/**","**/node_modules/.bin/**"]}),(0,i.log)(`[quarantine] \u5F00\u59CB\u76D1\u542C\u76EE\u5F55: ${_.QBOT_CLAW_DIR} (\u4F7F\u7528 @parcel/watcher, \u4F4E\u5EF6\u8FDF FSEvents)`)}catch(e){(0,i.log)(`[quarantine] \u542F\u52A8 watcher \u5931\u8D25: ${e.message}`)}}
@@ -332,7 +332,7 @@ endif
332
332
 
333
333
  quiet_cmd_regen_makefile = ACTION Regenerating $@
334
334
  cmd_regen_makefile = cd $(srcdir); /Users/morris/.local/node/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/Users/morris/Library/Caches/node-gyp/24.14.0" "-Dnode_gyp_dir=/Users/morris/.local/node/lib/node_modules/npm/node_modules/node-gyp" "-Dnode_lib_file=/Users/morris/Library/Caches/node-gyp/24.14.0/<(target_arch)/node.lib" "-Dmodule_root_dir=/Users/morris/workspace/qbot-claw-launcher/fs-xattr" "-Dnode_engine=v8" "--depth=." "-Goutput_dir=." "--generator-output=build" -I/Users/morris/workspace/qbot-claw-launcher/fs-xattr/build/config.gypi -I/Users/morris/.local/node/lib/node_modules/npm/node_modules/node-gyp/addon.gypi -I/Users/morris/Library/Caches/node-gyp/24.14.0/include/node/common.gypi "--toplevel-dir=." binding.gyp
335
- Makefile: $(srcdir)/../../../.local/node/lib/node_modules/npm/node_modules/node-gyp/addon.gypi $(srcdir)/binding.gyp $(srcdir)/build/config.gypi $(srcdir)/../../../Library/Caches/node-gyp/24.14.0/include/node/common.gypi
335
+ Makefile: $(srcdir)/../../../Library/Caches/node-gyp/24.14.0/include/node/common.gypi $(srcdir)/build/config.gypi $(srcdir)/binding.gyp $(srcdir)/../../../.local/node/lib/node_modules/npm/node_modules/node-gyp/addon.gypi
336
336
  $(call do_cmd,regen_makefile)
337
337
 
338
338
  # "all" is a concatenation of the "all" targets from all the included
@@ -497,7 +497,6 @@
497
497
  "nodedir": "/Users/morris/Library/Caches/node-gyp/24.14.0",
498
498
  "python": "/Applications/Xcode15.4.app/Contents/Developer/usr/bin/python3",
499
499
  "standalone_static_library": 1,
500
- "save_dev": "true",
501
500
  "global_prefix": "/Users/morris/.nvm/versions/node/v24.14.0",
502
501
  "local_prefix": "/Users/morris/workspace/qbot-claw-launcher",
503
502
  "globalconfig": "/Users/morris/.nvm/versions/node/v24.14.0/etc/npmrc",
package/package.json CHANGED
@@ -1,12 +1,11 @@
1
1
  {
2
2
  "name": "@qqbrowser/qbot-claw-launcher",
3
- "version": "0.9.35",
3
+ "version": "0.9.36",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
7
7
  "qb-claw-launcher": "dist/index.js"
8
8
  },
9
- "types": "dist/index.d.ts",
10
9
  "files": [
11
10
  "dist",
12
11
  "node_modules"
@@ -30,9 +29,9 @@
30
29
  "license": "ISC",
31
30
  "devDependencies": {
32
31
  "@types/node": "^20.0.0",
33
- "esbuild": "^0.20.2",
34
- "ts-node": "^10.9.0",
35
- "typescript": "^5.0.0"
32
+ "esbuild": "0.25.10",
33
+ "ts-node": "10.9.2",
34
+ "typescript": "5.9.3"
36
35
  },
37
36
  "dependencies": {
38
37
  "@parcel/watcher": "file:./parcel-watcher",
package/dist/config.d.ts DELETED
@@ -1,12 +0,0 @@
1
- export declare const QBOT_CLAW_DIR: string;
2
- export declare const NODE_BIN: string;
3
- export declare const PYTHON_BIN: string;
4
- export declare const NPM_BIN: string;
5
- export declare const NPM_RC: string;
6
- export declare const NODE_BIN_DIR: string;
7
- export declare const QBOT_CLAW_CONFIG_PATH: string;
8
- export declare const NPM_PACKAGE_NAME = "@qqbrowser/openclaw-qbot";
9
- export declare const NPM_GLOBAL_MODULES: string;
10
- export declare const QBOTCLAW_BIN: string;
11
- export declare const MCPORTER_BIN: string;
12
- export declare const STATE_FILE: string;
package/dist/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
@@ -1,12 +0,0 @@
1
- import http from 'http';
2
- export interface InstallState {
3
- status: 'idle' | 'downloading' | 'success' | 'failed';
4
- message: string;
5
- startTime?: string;
6
- endTime?: string;
7
- }
8
- export declare let installState: InstallState;
9
- export declare const PYTHON_DIR: string;
10
- export declare function runQBotClaw(args: string[], res?: http.ServerResponse): Promise<void>;
11
- export declare function configAndRunQBotClaw(): Promise<void>;
12
- export declare function runInstall(res: http.ServerResponse, version: string): void;
@@ -1,3 +0,0 @@
1
- export declare function fullScanClearQuarantine(reason: string): Promise<void>;
2
- export declare function stopWatchWorkspaceQuarantine(): Promise<void>;
3
- export declare function watchWorkspaceQuarantine(): Promise<void>;
@@ -1,4 +0,0 @@
1
- export declare function flushLogs(): Promise<void>;
2
- export declare function log(body: string): void;
3
- export declare function refreshClawVersion(version: string): void;
4
- export declare function initLog(): void;
package/dist/server.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import http from 'http';
2
- export declare const server: http.Server<typeof http.IncomingMessage, typeof http.ServerResponse>;
3
- export declare function watchParentProcess(ppid?: number): void;
package/dist/service.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare function startService(ppid?: number, clawVersion?: string): Promise<void>;
2
- export declare function stopService(): void;
package/dist/state.d.ts DELETED
@@ -1,14 +0,0 @@
1
- export interface LauncherState {
2
- pid?: number;
3
- port?: number;
4
- ppid?: number;
5
- gatewayPid?: number;
6
- gatewayPort?: number;
7
- mcpHttpPort?: number;
8
- mcpWsPort?: number;
9
- }
10
- export declare function readState(): LauncherState;
11
- export declare function writeState(state: LauncherState): void;
12
- export declare function clearState(): void;
13
- export declare function isPortAvailable(port: number): Promise<boolean>;
14
- export declare function findAvailablePort(): Promise<number>;
package/dist/utils.d.ts DELETED
@@ -1,6 +0,0 @@
1
- import http from 'http';
2
- export declare function execCommand(cmd: string): Promise<string>;
3
- export declare function sendJSON(res: http.ServerResponse, statusCode: number, data: object): void;
4
- export declare function getQBotClawVersion(): Promise<string | null>;
5
- export declare function compareVersion(a: string, b: string): number;
6
- export declare function findAvailablePort(): Promise<number>;