liangzimixin 0.2.9 → 0.2.11

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/index.cjs CHANGED
@@ -17462,6 +17462,12 @@ var AccountConfigSchema = external_exports.object({
17462
17462
  * 生产环境: https://cmsp.zdxlz.com:8552
17463
17463
  */
17464
17464
  "quantum-url": external_exports.string().url().optional().default("https://cmsp.zdxlz.com:8552"),
17465
+ /**
17466
+ * 🟡 API 基础地址 — 认证/消息/文件等 API 的基础 URL
17467
+ * 联调环境: https://mxpre.zdxlz.com:1443/open-apis/v1
17468
+ * 线上环境: https://imtwo.zdxlz.com/open-apis/v1
17469
+ */
17470
+ "server-url": external_exports.string().url().optional().default("https://mxpre.zdxlz.com:1443/open-apis/v1"),
17465
17471
  /**
17466
17472
  * 🟡 Bot 自己的用户 ID — 用于 anti-loop 检查
17467
17473
  * 如果不填,需要通过其他 API 在运行时获取。
@@ -17475,6 +17481,7 @@ var AccountConfigSchema = external_exports.object({
17475
17481
  quantumAppSecret: raw["quantum-appSecret"],
17476
17482
  pin: raw.pin,
17477
17483
  quantumUrl: raw["quantum-url"],
17484
+ serverUrl: raw["server-url"],
17478
17485
  botUserId: raw.botUserId
17479
17486
  }));
17480
17487
  var DEFAULT_INTERNAL_CONFIG = {
@@ -17493,11 +17500,11 @@ var DEFAULT_INTERNAL_CONFIG = {
17493
17500
  }
17494
17501
  },
17495
17502
  auth: {
17496
- serverUrl: process.env.LZMX_AUTH_URL || "https://imtwo.zdxlz.com/open-apis/v1",
17503
+ serverUrl: process.env.LZMX_AUTH_URL || "https://mxpre.zdxlz.com:1443/open-apis/v1",
17497
17504
  refreshAheadMs: 3e5
17498
17505
  },
17499
17506
  crypto: {
17500
- enabled: true,
17507
+ enabled: false,
17501
17508
  keySource: "env",
17502
17509
  envKey: "QUANTUM_ENCRYPTION_KEY"
17503
17510
  },
@@ -17515,6 +17522,9 @@ var DEFAULT_INTERNAL_CONFIG = {
17515
17522
  };
17516
17523
  function buildPluginConfig(accountConfig, internalOverrides) {
17517
17524
  const internal = { ...DEFAULT_INTERNAL_CONFIG, ...internalOverrides };
17525
+ if (!process.env.LZMX_AUTH_URL && accountConfig.serverUrl) {
17526
+ internal.auth = { ...internal.auth, serverUrl: accountConfig.serverUrl };
17527
+ }
17518
17528
  return {
17519
17529
  ...internal,
17520
17530
  credentials: accountConfig
@@ -18970,7 +18980,10 @@ var CryptoEngine = class _CryptoEngine {
18970
18980
  return;
18971
18981
  }
18972
18982
  if (!this.plug) {
18973
- throw new Error("Quantum encryption SDK is missing. Cannot initialize in encryption mode (check dist/index.min.cjs).");
18983
+ log16.warn("Quantum SDK not found \u2014 falling back to passthrough mode (no encryption)");
18984
+ this.passthrough = true;
18985
+ this.initialized = true;
18986
+ return;
18974
18987
  }
18975
18988
  if (this.credentials) {
18976
18989
  writeQuantumConfig(this.credentials);
package/dist/index.d.cts CHANGED
@@ -23,6 +23,7 @@ declare const AccountConfigSchema: z.ZodPipe<z.ZodObject<{
23
23
  'quantum-appSecret': z.ZodString;
24
24
  pin: z.ZodString;
25
25
  'quantum-url': z.ZodDefault<z.ZodOptional<z.ZodString>>;
26
+ 'server-url': z.ZodDefault<z.ZodOptional<z.ZodString>>;
26
27
  botUserId: z.ZodOptional<z.ZodString>;
27
28
  }, z.core.$strip>, z.ZodTransform<{
28
29
  appId: string;
@@ -32,6 +33,7 @@ declare const AccountConfigSchema: z.ZodPipe<z.ZodObject<{
32
33
  quantumAppSecret: string;
33
34
  pin: string;
34
35
  quantumUrl: string;
36
+ serverUrl: string;
35
37
  botUserId: string | undefined;
36
38
  }, {
37
39
  appId: string;
@@ -41,6 +43,7 @@ declare const AccountConfigSchema: z.ZodPipe<z.ZodObject<{
41
43
  'quantum-appSecret': string;
42
44
  pin: string;
43
45
  'quantum-url': string;
46
+ 'server-url': string;
44
47
  botUserId?: string | undefined;
45
48
  }>>;
46
49
  type AccountConfig = z.output<typeof AccountConfigSchema>;
@@ -18018,6 +18018,12 @@ var AccountConfigSchema = external_exports.object({
18018
18018
  * 生产环境: https://cmsp.zdxlz.com:8552
18019
18019
  */
18020
18020
  "quantum-url": external_exports.string().url().optional().default("https://cmsp.zdxlz.com:8552"),
18021
+ /**
18022
+ * 🟡 API 基础地址 — 认证/消息/文件等 API 的基础 URL
18023
+ * 联调环境: https://mxpre.zdxlz.com:1443/open-apis/v1
18024
+ * 线上环境: https://imtwo.zdxlz.com/open-apis/v1
18025
+ */
18026
+ "server-url": external_exports.string().url().optional().default("https://mxpre.zdxlz.com:1443/open-apis/v1"),
18021
18027
  /**
18022
18028
  * 🟡 Bot 自己的用户 ID — 用于 anti-loop 检查
18023
18029
  * 如果不填,需要通过其他 API 在运行时获取。
@@ -18031,6 +18037,7 @@ var AccountConfigSchema = external_exports.object({
18031
18037
  quantumAppSecret: raw["quantum-appSecret"],
18032
18038
  pin: raw.pin,
18033
18039
  quantumUrl: raw["quantum-url"],
18040
+ serverUrl: raw["server-url"],
18034
18041
  botUserId: raw.botUserId
18035
18042
  }));
18036
18043
  var DEFAULT_INTERNAL_CONFIG = {
@@ -18049,11 +18056,11 @@ var DEFAULT_INTERNAL_CONFIG = {
18049
18056
  }
18050
18057
  },
18051
18058
  auth: {
18052
- serverUrl: process.env.LZMX_AUTH_URL || "https://imtwo.zdxlz.com/open-apis/v1",
18059
+ serverUrl: process.env.LZMX_AUTH_URL || "https://mxpre.zdxlz.com:1443/open-apis/v1",
18053
18060
  refreshAheadMs: 3e5
18054
18061
  },
18055
18062
  crypto: {
18056
- enabled: true,
18063
+ enabled: false,
18057
18064
  keySource: "env",
18058
18065
  envKey: "QUANTUM_ENCRYPTION_KEY"
18059
18066
  },
@@ -18071,6 +18078,9 @@ var DEFAULT_INTERNAL_CONFIG = {
18071
18078
  };
18072
18079
  function buildPluginConfig(accountConfig, internalOverrides) {
18073
18080
  const internal = { ...DEFAULT_INTERNAL_CONFIG, ...internalOverrides };
18081
+ if (!process.env.LZMX_AUTH_URL && accountConfig.serverUrl) {
18082
+ internal.auth = { ...internal.auth, serverUrl: accountConfig.serverUrl };
18083
+ }
18074
18084
  return {
18075
18085
  ...internal,
18076
18086
  credentials: accountConfig
@@ -18182,7 +18192,10 @@ var CryptoEngine = class _CryptoEngine {
18182
18192
  return;
18183
18193
  }
18184
18194
  if (!this.plug) {
18185
- throw new Error("Quantum encryption SDK is missing. Cannot initialize in encryption mode (check dist/index.min.cjs).");
18195
+ log7.warn("Quantum SDK not found \u2014 falling back to passthrough mode (no encryption)");
18196
+ this.passthrough = true;
18197
+ this.initialized = true;
18198
+ return;
18186
18199
  }
18187
18200
  if (this.credentials) {
18188
18201
  writeQuantumConfig(this.credentials);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "liangzimixin",
3
- "version": "0.2.9",
3
+ "version": "0.2.11",
4
4
  "description": "Quantum-encrypted IM channel plugin for OpenClaw",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",