xshell 1.3.47 → 1.3.49

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/builder.js CHANGED
@@ -372,10 +372,8 @@ export class Bundler {
372
372
  onlyCompileBundledFiles: true,
373
373
  transpileOnly: !this.dts,
374
374
  compilerOptions: {
375
- module: 'ESNext',
376
- // 编译 using 和 await using
377
- // todo: 等 webpack 的 acorn 原生支持解析语法后可删去
378
- target: 'ES2024',
375
+ module: 'esnext',
376
+ target: 'esnext',
379
377
  moduleResolution: 'Bundler',
380
378
  declaration: this.dts,
381
379
  noEmit: false,
package/git.d.ts CHANGED
@@ -27,6 +27,7 @@ export declare class Git {
27
27
  hash: string;
28
28
  message: string;
29
29
  }[]>;
30
+ /** - short?: `true` */
30
31
  get_last_commit_hash(short?: boolean): Promise<string>;
31
32
  /** @example form.fetch({ remote: 'origin', args: ['pull/770/head:form-list-fields-value'] }) */
32
33
  fetch({ print, remote, args }?: {
package/git.js CHANGED
@@ -87,6 +87,7 @@ export class Git {
87
87
  };
88
88
  });
89
89
  }
90
+ /** - short?: `true` */
90
91
  async get_last_commit_hash(short = true) {
91
92
  const hash = (await fread(`${this.cwd}.git/refs/heads/${await this.get_branch()}`, noprint))
92
93
  .trim();
@@ -117,7 +118,7 @@ export class Git {
117
118
  if (print)
118
119
  console.log(colored((stderr ? '更新 ' : '') +
119
120
  `${this.cwd.fname.slice(0, -1)} 仓库` +
120
- (remote ? ` ${remote} 源` : '') +
121
+ (remote ? `源 ${remote} ` : '') +
121
122
  (args.length > 0 ? ` ${args.join(' ')} ` : '') +
122
123
  (stderr ? '成功' : '无更新'), 'green', Boolean(stderr)));
123
124
  return stderr;
package/net.common.d.ts CHANGED
@@ -197,7 +197,7 @@ export declare class Remote {
197
197
  try_send(message: Message): void;
198
198
  /** 处理接收到的 websocket message 并解析, 根据 message.id 或 message.func 分发到对应的 handler 进行处理,
199
199
  handler 处理完成后:
200
- - 传了 func: 调用函数的情况下 (通常是一元 rpc),总是将返回值包装为 message 回传
200
+ - 传了 func: 调用函数的情况下 (通常是一元 rpc,也有可能是仅 send),如果有 id,则总是将非 undefined 返回值包装为 message 回传
201
201
  - 未传 func: 通过 id 调用,如果 handler 返回非 undefined 的值,也包装为 message 回传
202
202
 
203
203
  如果 message.done == true 则对端指示当前 remote 可以清理 handler
package/net.common.js CHANGED
@@ -446,7 +446,7 @@ export class Remote {
446
446
  }
447
447
  /** 处理接收到的 websocket message 并解析, 根据 message.id 或 message.func 分发到对应的 handler 进行处理,
448
448
  handler 处理完成后:
449
- - 传了 func: 调用函数的情况下 (通常是一元 rpc),总是将返回值包装为 message 回传
449
+ - 传了 func: 调用函数的情况下 (通常是一元 rpc,也有可能是仅 send),如果有 id,则总是将非 undefined 返回值包装为 message 回传
450
450
  - 未传 func: 通过 id 调用,如果 handler 返回非 undefined 的值,也包装为 message 回传
451
451
 
452
452
  如果 message.done == true 则对端指示当前 remote 可以清理 handler
@@ -484,7 +484,9 @@ export class Remote {
484
484
  }
485
485
  if (handler) {
486
486
  const data = await handler(message, this);
487
- if (func || data !== undefined)
487
+ // 有 id 才能回复(说明需要回复),有 func 一定回,否则根据 data 返回
488
+ // 单方 .send({ 无 id 消息 }) 说明不需要回,也没法回
489
+ if (id && (func || data !== undefined))
488
490
  await this.send({ id, data });
489
491
  }
490
492
  else if (message.error)
package/net.js CHANGED
@@ -89,7 +89,7 @@ export async function request(url, options = {}) {
89
89
  let headers = {
90
90
  'accept-language': 'zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7,ja-JP;q=0.6,ja;q=0.5',
91
91
  'accept-encoding': 'gzip, deflate, br',
92
- 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36',
92
+ 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36',
93
93
  'sec-ch-ua-platform': '"Windows"',
94
94
  'sec-ch-ua-platform-version': '"19.0.0"',
95
95
  };
@@ -152,6 +152,12 @@ export async function request(url, options = {}) {
152
152
  if (decode && content_encoding) {
153
153
  assert(!content_encoding.includes(','));
154
154
  switch (content_encoding) {
155
+ case 'br':
156
+ body = pipeline(_body, zlib.createBrotliDecompress(), noop);
157
+ break;
158
+ case 'zstd':
159
+ body = pipeline(_body, zlib.createZstdDecompress(), noop);
160
+ break;
155
161
  case 'gzip':
156
162
  case 'x-gzip':
157
163
  body = pipeline(_body, zlib.createGunzip({
@@ -166,9 +172,6 @@ export async function request(url, options = {}) {
166
172
  case 'deflate':
167
173
  body = pipeline(_body, zlib.createInflate(), noop);
168
174
  break;
169
- case 'br':
170
- body = pipeline(_body, zlib.createBrotliDecompress(), noop);
171
- break;
172
175
  default:
173
176
  throw new Error(`不支持 content-encoding: ${content_encoding.quote()} 的 http 请求`);
174
177
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xshell",
3
- "version": "1.3.47",
3
+ "version": "1.3.49",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -50,46 +50,46 @@
50
50
  },
51
51
  "dependencies": {
52
52
  "@babel/core": "^7.29.0",
53
- "@babel/parser": "^7.29.0",
53
+ "@babel/parser": "^7.29.2",
54
54
  "@babel/traverse": "^7.29.0",
55
55
  "@koa/cors": "^5.0.0",
56
56
  "@stylistic/eslint-plugin": "^5.10.0",
57
57
  "@svgr/webpack": "^8.1.0",
58
58
  "@types/sass-loader": "^8.0.10",
59
- "@typescript-eslint/eslint-plugin": "^8.57.0",
60
- "@typescript-eslint/parser": "^8.57.0",
61
- "@typescript-eslint/utils": "^8.57.0",
59
+ "@typescript-eslint/eslint-plugin": "^8.57.2",
60
+ "@typescript-eslint/parser": "^8.57.2",
61
+ "@typescript-eslint/utils": "^8.57.2",
62
62
  "archiver": "^7.0.1",
63
63
  "chalk": "^5.6.2",
64
64
  "commander": "^14.0.3",
65
65
  "css-loader": "^7.1.4",
66
66
  "emoji-regex": "^10.6.0",
67
- "eslint": "^10.0.3",
67
+ "eslint": "^10.1.0",
68
68
  "eslint-plugin-react": "^7.37.5",
69
- "https-proxy-agent": "^7.0.6",
69
+ "https-proxy-agent": "^8.0.0",
70
70
  "i18next": "25.8.1",
71
71
  "i18next-scanner": "^4.6.0",
72
72
  "koa": "^3.1.2",
73
- "koa-compress": "^5.2.0",
73
+ "koa-compress": "^5.2.1",
74
74
  "license-webpack-plugin": "^4.0.2",
75
75
  "mime-types": "^3.0.2",
76
76
  "p-map": "^7.0.4",
77
77
  "react": "^19.2.4",
78
- "react-i18next": "^16.5.6",
78
+ "react-i18next": "^16.6.2",
79
79
  "resolve-path": "^1.4.0",
80
80
  "sass": "^1.98.0",
81
81
  "sass-loader": "^16.0.7",
82
82
  "source-map-loader": "^5.0.0",
83
83
  "strip-ansi": "^7.2.0",
84
84
  "style-loader": "^4.0.0",
85
- "tough-cookie": "^6.0.0",
85
+ "tough-cookie": "^6.0.1",
86
86
  "ts-loader": "^9.5.4",
87
87
  "tslib": "^2.8.1",
88
- "typescript": "^5.9.3",
89
- "undici": "^7.22.0",
88
+ "typescript": "^6.0.2",
89
+ "undici": "^7.24.5",
90
90
  "webpack": "^5.105.4",
91
91
  "webpack-bundle-analyzer": "^5.2.0",
92
- "ws": "^8.19.0"
92
+ "ws": "^8.20.0"
93
93
  },
94
94
  "devDependencies": {
95
95
  "@babel/types": "^7.29.0",
@@ -97,10 +97,10 @@
97
97
  "@types/babel__traverse": "^7.28.0",
98
98
  "@types/eslint": "^9.6.1",
99
99
  "@types/estree": "^1.0.8",
100
- "@types/koa": "^3.0.1",
100
+ "@types/koa": "^3.0.2",
101
101
  "@types/koa-compress": "^4.0.7",
102
102
  "@types/mime-types": "^3.0.1",
103
- "@types/node": "^25.4.0",
103
+ "@types/node": "^25.5.0",
104
104
  "@types/react": "^19.2.14",
105
105
  "@types/tough-cookie": "^4.0.5",
106
106
  "@types/vscode": "^1.110.0",
package/path.d.ts CHANGED
@@ -54,7 +54,7 @@ export declare function extname(path: string): string;
54
54
  /** `/` */
55
55
  export declare const sep = "/";
56
56
  /** The platform-specific file delimiter. ';' or ':'. */
57
- export declare const delimiter: ";" | ":";
57
+ export declare const delimiter: ":" | ";";
58
58
  /** Returns an object from a path string - the opposite of format().
59
59
  @param path path to evaluate.
60
60
  @throws {TypeError} if `path` is not a string. */
@@ -81,7 +81,7 @@ export declare let path: {
81
81
  basename: typeof basename;
82
82
  extname: typeof extname;
83
83
  sep: string;
84
- delimiter: ";" | ":";
84
+ delimiter: ":" | ";";
85
85
  parse: typeof parse;
86
86
  format: typeof format;
87
87
  toNamespacedPath: typeof toNamespacedPath;
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  function define(proto, key, func) {
2
3
  Object.defineProperty(proto, key, {
3
4
  configurable: true,
package/process.d.ts CHANGED
@@ -144,7 +144,7 @@ export declare class CallError<TOutput extends string | Buffer = string> extends
144
144
  constructor({ message, pid, stdout, stderr, code, signal, command, print }: CallResult<TOutput>);
145
145
  [inspect.custom](depth: number, options: InspectOptions, inspect: Function): string;
146
146
  }
147
- /** 调用 exe 启动子进程,等待并获取返回结果,错误时抛出 CallError
147
+ /** 调用 exe 启动子进程,等待并获取返回结果和输出,错误时抛出 CallError
148
148
  - exe: exe 路径或文件名 (建议使用路径,跳过 path 搜索,性能更高)
149
149
  - args?: `[ ]` 参数列表
150
150
  - options?: {@link CallOptions} 继承自 {@link BaseOptions}
@@ -2,7 +2,7 @@
2
2
  /******/ "use strict";
3
3
  /******/ var __webpack_modules__ = ({
4
4
 
5
- /***/ 763
5
+ /***/ 321
6
6
  /*!********************************************************************************************************************!*\
7
7
  !*** ./node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-client.production.js ***!
8
8
  \********************************************************************************************************************/
@@ -22,9 +22,9 @@
22
22
  Modernizr 3.0.0pre (Custom Build) | MIT
23
23
  */
24
24
 
25
- var Scheduler = __webpack_require__(/*! scheduler */ 174),
26
- React = __webpack_require__(/*! react */ 755),
27
- ReactDOM = __webpack_require__(/*! react-dom */ 317);
25
+ var Scheduler = __webpack_require__(/*! scheduler */ 476),
26
+ React = __webpack_require__(/*! react */ 277),
27
+ ReactDOM = __webpack_require__(/*! react-dom */ 499);
28
28
  function formatProdErrorMessage(code) {
29
29
  var url = "https://react.dev/errors/" + code;
30
30
  if (1 < arguments.length) {
@@ -16061,7 +16061,7 @@ exports.version = "19.2.4";
16061
16061
 
16062
16062
  /***/ },
16063
16063
 
16064
- /***/ 729
16064
+ /***/ 3
16065
16065
  /*!*************************************************************************************************************!*\
16066
16066
  !*** ./node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom.production.js ***!
16067
16067
  \*************************************************************************************************************/
@@ -16078,7 +16078,7 @@ exports.version = "19.2.4";
16078
16078
  */
16079
16079
 
16080
16080
 
16081
- var React = __webpack_require__(/*! react */ 755);
16081
+ var React = __webpack_require__(/*! react */ 277);
16082
16082
  function formatProdErrorMessage(code) {
16083
16083
  var url = "https://react.dev/errors/" + code;
16084
16084
  if (1 < arguments.length) {
@@ -16281,7 +16281,7 @@ exports.version = "19.2.4";
16281
16281
 
16282
16282
  /***/ },
16283
16283
 
16284
- /***/ 254
16284
+ /***/ 420
16285
16285
  /*!*******************************************************************************************!*\
16286
16286
  !*** ./node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/client.js ***!
16287
16287
  \*******************************************************************************************/
@@ -16313,14 +16313,14 @@ if (true) {
16313
16313
  // DCE check should happen before ReactDOM bundle executes so that
16314
16314
  // DevTools can report bad minification during injection.
16315
16315
  checkDCE();
16316
- module.exports = __webpack_require__(/*! ./cjs/react-dom-client.production.js */ 763);
16316
+ module.exports = __webpack_require__(/*! ./cjs/react-dom-client.production.js */ 321);
16317
16317
  } else // removed by dead control flow
16318
16318
  {}
16319
16319
 
16320
16320
 
16321
16321
  /***/ },
16322
16322
 
16323
- /***/ 317
16323
+ /***/ 499
16324
16324
  /*!******************************************************************************************!*\
16325
16325
  !*** ./node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/index.js ***!
16326
16326
  \******************************************************************************************/
@@ -16352,14 +16352,14 @@ if (true) {
16352
16352
  // DCE check should happen before ReactDOM bundle executes so that
16353
16353
  // DevTools can report bad minification during injection.
16354
16354
  checkDCE();
16355
- module.exports = __webpack_require__(/*! ./cjs/react-dom.production.js */ 729);
16355
+ module.exports = __webpack_require__(/*! ./cjs/react-dom.production.js */ 3);
16356
16356
  } else // removed by dead control flow
16357
16357
  {}
16358
16358
 
16359
16359
 
16360
16360
  /***/ },
16361
16361
 
16362
- /***/ 167
16362
+ /***/ 625
16363
16363
  /*!************************************************************************************************!*\
16364
16364
  !*** ./node_modules/.pnpm/react@19.2.4/node_modules/react/cjs/react-jsx-runtime.production.js ***!
16365
16365
  \************************************************************************************************/
@@ -16403,7 +16403,7 @@ exports.jsxs = jsxProd;
16403
16403
 
16404
16404
  /***/ },
16405
16405
 
16406
- /***/ 616
16406
+ /***/ 346
16407
16407
  /*!************************************************************************************!*\
16408
16408
  !*** ./node_modules/.pnpm/react@19.2.4/node_modules/react/cjs/react.production.js ***!
16409
16409
  \************************************************************************************/
@@ -16955,7 +16955,7 @@ exports.version = "19.2.4";
16955
16955
 
16956
16956
  /***/ },
16957
16957
 
16958
- /***/ 755
16958
+ /***/ 277
16959
16959
  /*!*********************************************************************!*\
16960
16960
  !*** ./node_modules/.pnpm/react@19.2.4/node_modules/react/index.js ***!
16961
16961
  \*********************************************************************/
@@ -16964,14 +16964,14 @@ exports.version = "19.2.4";
16964
16964
 
16965
16965
 
16966
16966
  if (true) {
16967
- module.exports = __webpack_require__(/*! ./cjs/react.production.js */ 616);
16967
+ module.exports = __webpack_require__(/*! ./cjs/react.production.js */ 346);
16968
16968
  } else // removed by dead control flow
16969
16969
  {}
16970
16970
 
16971
16971
 
16972
16972
  /***/ },
16973
16973
 
16974
- /***/ 195
16974
+ /***/ 881
16975
16975
  /*!***************************************************************************!*\
16976
16976
  !*** ./node_modules/.pnpm/react@19.2.4/node_modules/react/jsx-runtime.js ***!
16977
16977
  \***************************************************************************/
@@ -16980,14 +16980,14 @@ if (true) {
16980
16980
 
16981
16981
 
16982
16982
  if (true) {
16983
- module.exports = __webpack_require__(/*! ./cjs/react-jsx-runtime.production.js */ 167);
16983
+ module.exports = __webpack_require__(/*! ./cjs/react-jsx-runtime.production.js */ 625);
16984
16984
  } else // removed by dead control flow
16985
16985
  {}
16986
16986
 
16987
16987
 
16988
16988
  /***/ },
16989
16989
 
16990
- /***/ 485
16990
+ /***/ 319
16991
16991
  /*!************************************************************************************************!*\
16992
16992
  !*** ./node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js ***!
16993
16993
  \************************************************************************************************/
@@ -17337,7 +17337,7 @@ exports.unstable_wrapCallback = function (callback) {
17337
17337
 
17338
17338
  /***/ },
17339
17339
 
17340
- /***/ 174
17340
+ /***/ 476
17341
17341
  /*!*****************************************************************************!*\
17342
17342
  !*** ./node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/index.js ***!
17343
17343
  \*****************************************************************************/
@@ -17346,7 +17346,7 @@ exports.unstable_wrapCallback = function (callback) {
17346
17346
 
17347
17347
 
17348
17348
  if (true) {
17349
- module.exports = __webpack_require__(/*! ./cjs/scheduler.production.js */ 485);
17349
+ module.exports = __webpack_require__(/*! ./cjs/scheduler.production.js */ 319);
17350
17350
  } else // removed by dead control flow
17351
17351
  {}
17352
17352
 
@@ -17365,12 +17365,6 @@ if (true) {
17365
17365
  /******/ if (cachedModule !== undefined) {
17366
17366
  /******/ return cachedModule.exports;
17367
17367
  /******/ }
17368
- /******/ // Check if module exists (development only)
17369
- /******/ if (__webpack_modules__[moduleId] === undefined) {
17370
- /******/ var e = new Error("Cannot find module '" + moduleId + "'");
17371
- /******/ e.code = 'MODULE_NOT_FOUND';
17372
- /******/ throw e;
17373
- /******/ }
17374
17368
  /******/ // Create a new module (and put it into the cache)
17375
17369
  /******/ var module = __webpack_module_cache__[moduleId] = {
17376
17370
  /******/ // no module.id needed
@@ -17379,6 +17373,12 @@ if (true) {
17379
17373
  /******/ };
17380
17374
  /******/
17381
17375
  /******/ // Execute the module function
17376
+ /******/ if (!(moduleId in __webpack_modules__)) {
17377
+ /******/ delete __webpack_module_cache__[moduleId];
17378
+ /******/ var e = new Error("Cannot find module '" + moduleId + "'");
17379
+ /******/ e.code = 'MODULE_NOT_FOUND';
17380
+ /******/ throw e;
17381
+ /******/ }
17382
17382
  /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
17383
17383
  /******/
17384
17384
  /******/ // Return the exports of the module
@@ -17459,10 +17459,10 @@ __webpack_require__.r(__webpack_exports__);
17459
17459
  /* harmony export */ ReactDOMClient: () => (/* reexport fake namespace object from non-harmony */ react_dom_client__WEBPACK_IMPORTED_MODULE_3___namespace_cache || (react_dom_client__WEBPACK_IMPORTED_MODULE_3___namespace_cache = __webpack_require__.t(react_dom_client__WEBPACK_IMPORTED_MODULE_3__, 2))),
17460
17460
  /* harmony export */ ReactJSX: () => (/* reexport fake namespace object from non-harmony */ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___namespace_cache || (react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___namespace_cache = __webpack_require__.t(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__, 2)))
17461
17461
  /* harmony export */ });
17462
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 755);
17463
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ 195);
17464
- /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-dom */ 317);
17465
- /* harmony import */ var react_dom_client__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-dom/client */ 254);
17462
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 277);
17463
+ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ 881);
17464
+ /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-dom */ 499);
17465
+ /* harmony import */ var react_dom_client__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-dom/client */ 420);
17466
17466
 
17467
17467
 
17468
17468