weacpx 0.7.0 → 0.7.2

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.
@@ -4,43 +4,25 @@ var __getProtoOf = Object.getPrototypeOf;
4
4
  var __defProp = Object.defineProperty;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- function __accessProp(key) {
8
- return this[key];
9
- }
10
- var __toESMCache_node;
11
- var __toESMCache_esm;
12
7
  var __toESM = (mod, isNodeMode, target) => {
13
- var canCache = mod != null && typeof mod === "object";
14
- if (canCache) {
15
- var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
16
- var cached = cache.get(mod);
17
- if (cached)
18
- return cached;
19
- }
20
8
  target = mod != null ? __create(__getProtoOf(mod)) : {};
21
9
  const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
22
10
  for (let key of __getOwnPropNames(mod))
23
11
  if (!__hasOwnProp.call(to, key))
24
12
  __defProp(to, key, {
25
- get: __accessProp.bind(mod, key),
13
+ get: () => mod[key],
26
14
  enumerable: true
27
15
  });
28
- if (canCache)
29
- cache.set(mod, to);
30
16
  return to;
31
17
  };
32
18
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
33
- var __returnValue = (v) => v;
34
- function __exportSetter(name, newValue) {
35
- this[name] = __returnValue.bind(null, newValue);
36
- }
37
19
  var __export = (target, all) => {
38
20
  for (var name in all)
39
21
  __defProp(target, name, {
40
22
  get: all[name],
41
23
  enumerable: true,
42
24
  configurable: true,
43
- set: __exportSetter.bind(all, name)
25
+ set: (newValue) => all[name] = () => newValue
44
26
  });
45
27
  };
46
28
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
package/dist/cli.js CHANGED
@@ -5,43 +5,25 @@ var __getProtoOf = Object.getPrototypeOf;
5
5
  var __defProp = Object.defineProperty;
6
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- function __accessProp(key) {
9
- return this[key];
10
- }
11
- var __toESMCache_node;
12
- var __toESMCache_esm;
13
8
  var __toESM = (mod, isNodeMode, target) => {
14
- var canCache = mod != null && typeof mod === "object";
15
- if (canCache) {
16
- var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
17
- var cached = cache.get(mod);
18
- if (cached)
19
- return cached;
20
- }
21
9
  target = mod != null ? __create(__getProtoOf(mod)) : {};
22
10
  const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
23
11
  for (let key of __getOwnPropNames(mod))
24
12
  if (!__hasOwnProp.call(to, key))
25
13
  __defProp(to, key, {
26
- get: __accessProp.bind(mod, key),
14
+ get: () => mod[key],
27
15
  enumerable: true
28
16
  });
29
- if (canCache)
30
- cache.set(mod, to);
31
17
  return to;
32
18
  };
33
19
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
34
- var __returnValue = (v) => v;
35
- function __exportSetter(name, newValue) {
36
- this[name] = __returnValue.bind(null, newValue);
37
- }
38
20
  var __export = (target, all) => {
39
21
  for (var name in all)
40
22
  __defProp(target, name, {
41
23
  get: all[name],
42
24
  enumerable: true,
43
25
  configurable: true,
44
- set: __exportSetter.bind(all, name)
26
+ set: (newValue) => all[name] = () => newValue
45
27
  });
46
28
  };
47
29
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
@@ -1798,7 +1780,7 @@ var require_cjs = __commonJS((exports) => {
1798
1780
 
1799
1781
  // node_modules/write-file-atomic/lib/index.js
1800
1782
  var require_lib = __commonJS((exports, module) => {
1801
- var __filename = "/home/runner/work/weacpx/weacpx/node_modules/write-file-atomic/lib/index.js";
1783
+ var __filename = "/Users/maijiazhen/Projects/weacpx-github/.worktrees/weacpx-0.7.x/node_modules/write-file-atomic/lib/index.js";
1802
1784
  module.exports = writeFile;
1803
1785
  module.exports.sync = writeFileSync;
1804
1786
  module.exports._getTmpname = getTmpname;
@@ -11486,7 +11468,7 @@ var init_api = __esm(() => {
11486
11468
  ILINK_APP_ID = (process.env.WEACPX_ILINK_APP_ID ?? "").trim();
11487
11469
  });
11488
11470
 
11489
- // node_modules/qrcode-terminal/vendor/QRCode/QRMode.js
11471
+ // ../../node_modules/qrcode-terminal/vendor/QRCode/QRMode.js
11490
11472
  var require_QRMode = __commonJS((exports, module) => {
11491
11473
  module.exports = {
11492
11474
  MODE_NUMBER: 1 << 0,
@@ -11496,7 +11478,7 @@ var require_QRMode = __commonJS((exports, module) => {
11496
11478
  };
11497
11479
  });
11498
11480
 
11499
- // node_modules/qrcode-terminal/vendor/QRCode/QR8bitByte.js
11481
+ // ../../node_modules/qrcode-terminal/vendor/QRCode/QR8bitByte.js
11500
11482
  var require_QR8bitByte = __commonJS((exports, module) => {
11501
11483
  var QRMode = require_QRMode();
11502
11484
  function QR8bitByte(data) {
@@ -11516,7 +11498,7 @@ var require_QR8bitByte = __commonJS((exports, module) => {
11516
11498
  module.exports = QR8bitByte;
11517
11499
  });
11518
11500
 
11519
- // node_modules/qrcode-terminal/vendor/QRCode/QRMath.js
11501
+ // ../../node_modules/qrcode-terminal/vendor/QRCode/QRMath.js
11520
11502
  var require_QRMath = __commonJS((exports, module) => {
11521
11503
  var QRMath = {
11522
11504
  glog: function(n) {
@@ -11552,7 +11534,7 @@ var require_QRMath = __commonJS((exports, module) => {
11552
11534
  module.exports = QRMath;
11553
11535
  });
11554
11536
 
11555
- // node_modules/qrcode-terminal/vendor/QRCode/QRPolynomial.js
11537
+ // ../../node_modules/qrcode-terminal/vendor/QRCode/QRPolynomial.js
11556
11538
  var require_QRPolynomial = __commonJS((exports, module) => {
11557
11539
  var QRMath = require_QRMath();
11558
11540
  function QRPolynomial(num, shift) {
@@ -11602,7 +11584,7 @@ var require_QRPolynomial = __commonJS((exports, module) => {
11602
11584
  module.exports = QRPolynomial;
11603
11585
  });
11604
11586
 
11605
- // node_modules/qrcode-terminal/vendor/QRCode/QRMaskPattern.js
11587
+ // ../../node_modules/qrcode-terminal/vendor/QRCode/QRMaskPattern.js
11606
11588
  var require_QRMaskPattern = __commonJS((exports, module) => {
11607
11589
  module.exports = {
11608
11590
  PATTERN000: 0,
@@ -11616,7 +11598,7 @@ var require_QRMaskPattern = __commonJS((exports, module) => {
11616
11598
  };
11617
11599
  });
11618
11600
 
11619
- // node_modules/qrcode-terminal/vendor/QRCode/QRUtil.js
11601
+ // ../../node_modules/qrcode-terminal/vendor/QRCode/QRUtil.js
11620
11602
  var require_QRUtil = __commonJS((exports, module) => {
11621
11603
  var QRMode = require_QRMode();
11622
11604
  var QRPolynomial = require_QRPolynomial();
@@ -11842,7 +11824,7 @@ var require_QRUtil = __commonJS((exports, module) => {
11842
11824
  module.exports = QRUtil;
11843
11825
  });
11844
11826
 
11845
- // node_modules/qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js
11827
+ // ../../node_modules/qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js
11846
11828
  var require_QRErrorCorrectLevel = __commonJS((exports, module) => {
11847
11829
  module.exports = {
11848
11830
  L: 1,
@@ -11852,7 +11834,7 @@ var require_QRErrorCorrectLevel = __commonJS((exports, module) => {
11852
11834
  };
11853
11835
  });
11854
11836
 
11855
- // node_modules/qrcode-terminal/vendor/QRCode/QRRSBlock.js
11837
+ // ../../node_modules/qrcode-terminal/vendor/QRCode/QRRSBlock.js
11856
11838
  var require_QRRSBlock = __commonJS((exports, module) => {
11857
11839
  var QRErrorCorrectLevel = require_QRErrorCorrectLevel();
11858
11840
  function QRRSBlock(totalCount, dataCount) {
@@ -12055,7 +12037,7 @@ var require_QRRSBlock = __commonJS((exports, module) => {
12055
12037
  module.exports = QRRSBlock;
12056
12038
  });
12057
12039
 
12058
- // node_modules/qrcode-terminal/vendor/QRCode/QRBitBuffer.js
12040
+ // ../../node_modules/qrcode-terminal/vendor/QRCode/QRBitBuffer.js
12059
12041
  var require_QRBitBuffer = __commonJS((exports, module) => {
12060
12042
  function QRBitBuffer() {
12061
12043
  this.buffer = [];
@@ -12088,7 +12070,7 @@ var require_QRBitBuffer = __commonJS((exports, module) => {
12088
12070
  module.exports = QRBitBuffer;
12089
12071
  });
12090
12072
 
12091
- // node_modules/qrcode-terminal/vendor/QRCode/index.js
12073
+ // ../../node_modules/qrcode-terminal/vendor/QRCode/index.js
12092
12074
  var require_QRCode = __commonJS((exports, module) => {
12093
12075
  var QR8bitByte = require_QR8bitByte();
12094
12076
  var QRUtil = require_QRUtil();
@@ -12409,7 +12391,7 @@ var require_QRCode = __commonJS((exports, module) => {
12409
12391
  module.exports = QRCode;
12410
12392
  });
12411
12393
 
12412
- // node_modules/qrcode-terminal/lib/main.js
12394
+ // ../../node_modules/qrcode-terminal/lib/main.js
12413
12395
  var require_main = __commonJS((exports, module) => {
12414
12396
  var QRCode = require_QRCode();
12415
12397
  var QRErrorCorrectLevel = require_QRErrorCorrectLevel();
@@ -34776,7 +34758,7 @@ function finalize(ctx, schema) {
34776
34758
  result.$schema = "http://json-schema.org/draft-07/schema#";
34777
34759
  } else if (ctx.target === "draft-04") {
34778
34760
  result.$schema = "http://json-schema.org/draft-04/schema#";
34779
- } else if (ctx.target === "openapi-3.0") {}
34761
+ } else if (ctx.target === "openapi-3.0") {} else {}
34780
34762
  if (ctx.external?.uri) {
34781
34763
  const id = ctx.external.registry.get(schema)?.id;
34782
34764
  if (!id)
@@ -34998,7 +34980,7 @@ var literalProcessor = (schema, ctx, json, _params) => {
34998
34980
  if (val === undefined) {
34999
34981
  if (ctx.unrepresentable === "throw") {
35000
34982
  throw new Error("Literal `undefined` cannot be represented in JSON Schema");
35001
- }
34983
+ } else {}
35002
34984
  } else if (typeof val === "bigint") {
35003
34985
  if (ctx.unrepresentable === "throw") {
35004
34986
  throw new Error("BigInt literals cannot be represented in JSON Schema");
@@ -45086,7 +45068,7 @@ async function removePluginPackage(input) {
45086
45068
  // src/cli-update.ts
45087
45069
  init_plugin_loader();
45088
45070
  init_validate_plugin();
45089
- var SUCCESSOR = { from: "weacpx", package: "xacpx", minVersion: "0.8.0" };
45071
+ var SUCCESSOR = { from: "weacpx", package: "@ganglion/xacpx", command: "xacpx", minVersion: "0.8.0" };
45090
45072
  async function handleUpdateCli(args, deps) {
45091
45073
  let all = false;
45092
45074
  const explicitTargets = [];
@@ -45102,7 +45084,9 @@ async function handleUpdateCli(args, deps) {
45102
45084
  return null;
45103
45085
  const config2 = await deps.loadConfig();
45104
45086
  const packageName = deps.packageName ?? await readPackageName();
45087
+ const pluginPackageManager = deps.getLatestVersion ? undefined : await detectPackageManager();
45105
45088
  const latestOf = deps.getLatestVersion ?? getLatestNpmVersion;
45089
+ const latestPluginVersion = deps.getLatestVersion ?? ((name) => getLatestPackageVersion(name, pluginPackageManager ?? "npm"));
45106
45090
  const successor = await resolveSuccessor(packageName, latestOf);
45107
45091
  const selfTarget = successor ? {
45108
45092
  kind: "self",
@@ -45123,7 +45107,7 @@ async function handleUpdateCli(args, deps) {
45123
45107
  name: plugin.name,
45124
45108
  currentVersion: plugin.version,
45125
45109
  pinned: Boolean(plugin.version),
45126
- latestVersion: await latestOf(plugin.name)
45110
+ latestVersion: await latestPluginVersion(plugin.name)
45127
45111
  });
45128
45112
  }
45129
45113
  deps.print("可更新项:");
@@ -45175,7 +45159,7 @@ async function handleUpdateCli(args, deps) {
45175
45159
  if (successorPackage) {
45176
45160
  await stopDaemon();
45177
45161
  await selfMigrator({ from: target.name, to: successorPackage, toVersion: target.latestVersion ?? undefined });
45178
- deps.print(`weacpx 已更名为 ${successorPackage},已迁移至 ${successorPackage} ${target.latestVersion ?? "latest"}。今后请使用 \`${successorPackage}\` 命令;若此前在后台运行,请用 \`${successorPackage} start\` 重新启动。`);
45162
+ deps.print(`weacpx 已更名为 ${successorPackage}(命令为 \`${SUCCESSOR.command}\`),已安装 ${successorPackage} ${target.latestVersion ?? "latest"} 并移除旧的 weacpx。今后请使用 \`${SUCCESSOR.command}\` 命令;若此前在后台运行,请用 \`${SUCCESSOR.command} start\` 重新启动。`);
45179
45163
  continue;
45180
45164
  }
45181
45165
  await selfUpdater(target.name);
@@ -45224,7 +45208,7 @@ function formatTarget(target) {
45224
45208
  }
45225
45209
  async function selectTargets(targets, candidates, input) {
45226
45210
  if (input.explicitTarget) {
45227
- const target = targets.find((entry) => entry.name === input.explicitTarget || entry.kind === "self" && (input.explicitTarget === "weacpx" || input.explicitTarget === entry.successorPackage));
45211
+ const target = targets.find((entry) => entry.name === input.explicitTarget || entry.kind === "self" && (input.explicitTarget === "weacpx" || input.explicitTarget === SUCCESSOR.command || input.explicitTarget === entry.successorPackage));
45228
45212
  if (!target)
45229
45213
  return { ok: false, message: `没有找到更新项:${input.explicitTarget}`, exitCode: 1 };
45230
45214
  if (!target.latestVersion)
@@ -45263,8 +45247,15 @@ async function selectTargets(targets, candidates, input) {
45263
45247
  }
45264
45248
  return { ok: true, targets: selected };
45265
45249
  }
45250
+ async function getLatestPackageVersion(packageName, packageManager, run = runCapture) {
45251
+ const result = packageManager === "bun" ? await run("bun", ["pm", "view", packageName, "version", "--json"]) : await run("npm", ["view", packageName, "version", "--json"]);
45252
+ return parseLatestVersionResult(result);
45253
+ }
45266
45254
  async function getLatestNpmVersion(packageName) {
45267
45255
  const result = await runCapture("npm", ["view", packageName, "version", "--json"]);
45256
+ return parseLatestVersionResult(result);
45257
+ }
45258
+ function parseLatestVersionResult(result) {
45268
45259
  if (result.code !== 0)
45269
45260
  return null;
45270
45261
  const raw = result.stdout.trim();
@@ -4,43 +4,25 @@ var __getProtoOf = Object.getPrototypeOf;
4
4
  var __defProp = Object.defineProperty;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- function __accessProp(key) {
8
- return this[key];
9
- }
10
- var __toESMCache_node;
11
- var __toESMCache_esm;
12
7
  var __toESM = (mod, isNodeMode, target) => {
13
- var canCache = mod != null && typeof mod === "object";
14
- if (canCache) {
15
- var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
16
- var cached = cache.get(mod);
17
- if (cached)
18
- return cached;
19
- }
20
8
  target = mod != null ? __create(__getProtoOf(mod)) : {};
21
9
  const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
22
10
  for (let key of __getOwnPropNames(mod))
23
11
  if (!__hasOwnProp.call(to, key))
24
12
  __defProp(to, key, {
25
- get: __accessProp.bind(mod, key),
13
+ get: () => mod[key],
26
14
  enumerable: true
27
15
  });
28
- if (canCache)
29
- cache.set(mod, to);
30
16
  return to;
31
17
  };
32
18
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
33
- var __returnValue = (v) => v;
34
- function __exportSetter(name, newValue) {
35
- this[name] = __returnValue.bind(null, newValue);
36
- }
37
19
  var __export = (target, all) => {
38
20
  for (var name in all)
39
21
  __defProp(target, name, {
40
22
  get: all[name],
41
23
  enumerable: true,
42
24
  configurable: true,
43
- set: __exportSetter.bind(all, name)
25
+ set: (newValue) => all[name] = () => newValue
44
26
  });
45
27
  };
46
28
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "weacpx",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "description": "使用微信 ClawBot 随时随地通过 `acpx` 控制 Claude Code、Codex 等 Agents。",
5
5
  "keywords": [
6
6
  "acpx",