liangzimixin 0.2.11 → 0.2.12
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 +14 -22
- package/dist/index.d.cts +6 -9
- package/dist/setup-entry.cjs +14 -22
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -17463,11 +17463,11 @@ var AccountConfigSchema = external_exports.object({
|
|
|
17463
17463
|
*/
|
|
17464
17464
|
"quantum-url": external_exports.string().url().optional().default("https://cmsp.zdxlz.com:8552"),
|
|
17465
17465
|
/**
|
|
17466
|
-
* 🟡
|
|
17467
|
-
*
|
|
17468
|
-
*
|
|
17466
|
+
* 🟡 环境开关 — 切换 API 环境
|
|
17467
|
+
* production: 线上环境 (https://imtwo.zdxlz.com/open-apis/v1)
|
|
17468
|
+
* test: 联调环境 (https://mxpre.zdxlz.com:1443/open-apis/v1)
|
|
17469
17469
|
*/
|
|
17470
|
-
|
|
17470
|
+
env: external_exports.enum(["production", "test"]).optional().default("production"),
|
|
17471
17471
|
/**
|
|
17472
17472
|
* 🟡 Bot 自己的用户 ID — 用于 anti-loop 检查
|
|
17473
17473
|
* 如果不填,需要通过其他 API 在运行时获取。
|
|
@@ -17481,7 +17481,7 @@ var AccountConfigSchema = external_exports.object({
|
|
|
17481
17481
|
quantumAppSecret: raw["quantum-appSecret"],
|
|
17482
17482
|
pin: raw.pin,
|
|
17483
17483
|
quantumUrl: raw["quantum-url"],
|
|
17484
|
-
|
|
17484
|
+
env: raw.env,
|
|
17485
17485
|
botUserId: raw.botUserId
|
|
17486
17486
|
}));
|
|
17487
17487
|
var DEFAULT_INTERNAL_CONFIG = {
|
|
@@ -17520,11 +17520,14 @@ var DEFAULT_INTERNAL_CONFIG = {
|
|
|
17520
17520
|
allowPrivateNetwork: false
|
|
17521
17521
|
}
|
|
17522
17522
|
};
|
|
17523
|
+
var ENV_URL_MAP = {
|
|
17524
|
+
production: "https://imtwo.zdxlz.com/open-apis/v1",
|
|
17525
|
+
test: "https://mxpre.zdxlz.com:1443/open-apis/v1"
|
|
17526
|
+
};
|
|
17523
17527
|
function buildPluginConfig(accountConfig, internalOverrides) {
|
|
17524
17528
|
const internal = { ...DEFAULT_INTERNAL_CONFIG, ...internalOverrides };
|
|
17525
|
-
|
|
17526
|
-
|
|
17527
|
-
}
|
|
17529
|
+
const serverUrl = process.env.LZMX_AUTH_URL || ENV_URL_MAP[accountConfig.env] || ENV_URL_MAP.production;
|
|
17530
|
+
internal.auth = { ...internal.auth, serverUrl };
|
|
17528
17531
|
return {
|
|
17529
17532
|
...internal,
|
|
17530
17533
|
credentials: accountConfig
|
|
@@ -18876,8 +18879,6 @@ var quantumImPlugin = {
|
|
|
18876
18879
|
};
|
|
18877
18880
|
|
|
18878
18881
|
// src/crypto/quantun-plug-adapter.ts
|
|
18879
|
-
var import_node_module = require("module");
|
|
18880
|
-
var import_meta = {};
|
|
18881
18882
|
var log14 = createLogger("crypto/quantun-plug-adapter");
|
|
18882
18883
|
var SM4_MODE = {
|
|
18883
18884
|
ECB_NOPADDING: 1,
|
|
@@ -18886,26 +18887,17 @@ var SM4_MODE = {
|
|
|
18886
18887
|
CBC_PKCS7PADDING: 4
|
|
18887
18888
|
};
|
|
18888
18889
|
var DEFAULT_ENCRYPT_MODE = SM4_MODE.CBC_PKCS7PADDING;
|
|
18889
|
-
var require2 = (0, import_node_module.createRequire)(
|
|
18890
|
-
typeof __filename !== "undefined" ? __filename : import_meta.url
|
|
18891
|
-
);
|
|
18892
18890
|
var quantunPlug = null;
|
|
18893
|
-
|
|
18894
|
-
quantunPlug = require2("./sdk/index.min.cjs");
|
|
18895
|
-
log14.info("Quantum SDK loaded from sdk/index.min.cjs");
|
|
18896
|
-
} catch (err) {
|
|
18897
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
18898
|
-
log14.warn("Quantum SDK missing, only passthrough mode will work:", msg);
|
|
18899
|
-
}
|
|
18891
|
+
log14.info("Quantum SDK loading disabled \u2014 passthrough mode only");
|
|
18900
18892
|
var quantun_plug_adapter_default = quantunPlug;
|
|
18901
18893
|
|
|
18902
18894
|
// src/crypto/quantum-config-writer.ts
|
|
18903
18895
|
var import_node_fs = require("fs");
|
|
18904
18896
|
var import_node_path = require("path");
|
|
18905
18897
|
var import_node_url = require("url");
|
|
18906
|
-
var
|
|
18898
|
+
var import_meta = {};
|
|
18907
18899
|
var log15 = createLogger("crypto/quantum-config-writer");
|
|
18908
|
-
var currentDir = typeof __dirname !== "undefined" ? __dirname : (0, import_node_path.dirname)((0, import_node_url.fileURLToPath)(
|
|
18900
|
+
var currentDir = typeof __dirname !== "undefined" ? __dirname : (0, import_node_path.dirname)((0, import_node_url.fileURLToPath)(import_meta.url));
|
|
18909
18901
|
var QUANTUM_JSON_PATH = (0, import_node_path.join)(currentDir, "sdk", "quantum.json");
|
|
18910
18902
|
function writeQuantumConfig(credentials) {
|
|
18911
18903
|
const sdkConfig = {
|
package/dist/index.d.cts
CHANGED
|
@@ -23,7 +23,10 @@ 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
|
-
|
|
26
|
+
env: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
27
|
+
production: "production";
|
|
28
|
+
test: "test";
|
|
29
|
+
}>>>;
|
|
27
30
|
botUserId: z.ZodOptional<z.ZodString>;
|
|
28
31
|
}, z.core.$strip>, z.ZodTransform<{
|
|
29
32
|
appId: string;
|
|
@@ -33,7 +36,7 @@ declare const AccountConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
33
36
|
quantumAppSecret: string;
|
|
34
37
|
pin: string;
|
|
35
38
|
quantumUrl: string;
|
|
36
|
-
|
|
39
|
+
env: "production" | "test";
|
|
37
40
|
botUserId: string | undefined;
|
|
38
41
|
}, {
|
|
39
42
|
appId: string;
|
|
@@ -43,7 +46,7 @@ declare const AccountConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
43
46
|
'quantum-appSecret': string;
|
|
44
47
|
pin: string;
|
|
45
48
|
'quantum-url': string;
|
|
46
|
-
|
|
49
|
+
env: "production" | "test";
|
|
47
50
|
botUserId?: string | undefined;
|
|
48
51
|
}>>;
|
|
49
52
|
type AccountConfig = z.output<typeof AccountConfigSchema>;
|
|
@@ -120,12 +123,6 @@ interface PluginConfig extends InternalConfig {
|
|
|
120
123
|
/** 用户凭据(从 openclaw.json 解析并转换后的结果) */
|
|
121
124
|
credentials: AccountConfig;
|
|
122
125
|
}
|
|
123
|
-
/**
|
|
124
|
-
* 合并用户配置与内部配置,生成完整的运行时配置。
|
|
125
|
-
*
|
|
126
|
-
* @param accountConfig - 已解析的用户账户配置
|
|
127
|
-
* @param internalOverrides - 可选的内部配置覆盖(用于测试或特殊部署)
|
|
128
|
-
*/
|
|
129
126
|
declare function buildPluginConfig(accountConfig: AccountConfig, internalOverrides?: Partial<InternalConfig>): PluginConfig;
|
|
130
127
|
|
|
131
128
|
/**
|
package/dist/setup-entry.cjs
CHANGED
|
@@ -18019,11 +18019,11 @@ var AccountConfigSchema = external_exports.object({
|
|
|
18019
18019
|
*/
|
|
18020
18020
|
"quantum-url": external_exports.string().url().optional().default("https://cmsp.zdxlz.com:8552"),
|
|
18021
18021
|
/**
|
|
18022
|
-
* 🟡
|
|
18023
|
-
*
|
|
18024
|
-
*
|
|
18022
|
+
* 🟡 环境开关 — 切换 API 环境
|
|
18023
|
+
* production: 线上环境 (https://imtwo.zdxlz.com/open-apis/v1)
|
|
18024
|
+
* test: 联调环境 (https://mxpre.zdxlz.com:1443/open-apis/v1)
|
|
18025
18025
|
*/
|
|
18026
|
-
|
|
18026
|
+
env: external_exports.enum(["production", "test"]).optional().default("production"),
|
|
18027
18027
|
/**
|
|
18028
18028
|
* 🟡 Bot 自己的用户 ID — 用于 anti-loop 检查
|
|
18029
18029
|
* 如果不填,需要通过其他 API 在运行时获取。
|
|
@@ -18037,7 +18037,7 @@ var AccountConfigSchema = external_exports.object({
|
|
|
18037
18037
|
quantumAppSecret: raw["quantum-appSecret"],
|
|
18038
18038
|
pin: raw.pin,
|
|
18039
18039
|
quantumUrl: raw["quantum-url"],
|
|
18040
|
-
|
|
18040
|
+
env: raw.env,
|
|
18041
18041
|
botUserId: raw.botUserId
|
|
18042
18042
|
}));
|
|
18043
18043
|
var DEFAULT_INTERNAL_CONFIG = {
|
|
@@ -18076,11 +18076,14 @@ var DEFAULT_INTERNAL_CONFIG = {
|
|
|
18076
18076
|
allowPrivateNetwork: false
|
|
18077
18077
|
}
|
|
18078
18078
|
};
|
|
18079
|
+
var ENV_URL_MAP = {
|
|
18080
|
+
production: "https://imtwo.zdxlz.com/open-apis/v1",
|
|
18081
|
+
test: "https://mxpre.zdxlz.com:1443/open-apis/v1"
|
|
18082
|
+
};
|
|
18079
18083
|
function buildPluginConfig(accountConfig, internalOverrides) {
|
|
18080
18084
|
const internal = { ...DEFAULT_INTERNAL_CONFIG, ...internalOverrides };
|
|
18081
|
-
|
|
18082
|
-
|
|
18083
|
-
}
|
|
18085
|
+
const serverUrl = process.env.LZMX_AUTH_URL || ENV_URL_MAP[accountConfig.env] || ENV_URL_MAP.production;
|
|
18086
|
+
internal.auth = { ...internal.auth, serverUrl };
|
|
18084
18087
|
return {
|
|
18085
18088
|
...internal,
|
|
18086
18089
|
credentials: accountConfig
|
|
@@ -18088,8 +18091,6 @@ function buildPluginConfig(accountConfig, internalOverrides) {
|
|
|
18088
18091
|
}
|
|
18089
18092
|
|
|
18090
18093
|
// src/crypto/quantun-plug-adapter.ts
|
|
18091
|
-
var import_node_module = require("module");
|
|
18092
|
-
var import_meta = {};
|
|
18093
18094
|
var log5 = createLogger("crypto/quantun-plug-adapter");
|
|
18094
18095
|
var SM4_MODE = {
|
|
18095
18096
|
ECB_NOPADDING: 1,
|
|
@@ -18098,26 +18099,17 @@ var SM4_MODE = {
|
|
|
18098
18099
|
CBC_PKCS7PADDING: 4
|
|
18099
18100
|
};
|
|
18100
18101
|
var DEFAULT_ENCRYPT_MODE = SM4_MODE.CBC_PKCS7PADDING;
|
|
18101
|
-
var require2 = (0, import_node_module.createRequire)(
|
|
18102
|
-
typeof __filename !== "undefined" ? __filename : import_meta.url
|
|
18103
|
-
);
|
|
18104
18102
|
var quantunPlug = null;
|
|
18105
|
-
|
|
18106
|
-
quantunPlug = require2("./sdk/index.min.cjs");
|
|
18107
|
-
log5.info("Quantum SDK loaded from sdk/index.min.cjs");
|
|
18108
|
-
} catch (err) {
|
|
18109
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
18110
|
-
log5.warn("Quantum SDK missing, only passthrough mode will work:", msg);
|
|
18111
|
-
}
|
|
18103
|
+
log5.info("Quantum SDK loading disabled \u2014 passthrough mode only");
|
|
18112
18104
|
var quantun_plug_adapter_default = quantunPlug;
|
|
18113
18105
|
|
|
18114
18106
|
// src/crypto/quantum-config-writer.ts
|
|
18115
18107
|
var import_node_fs = require("fs");
|
|
18116
18108
|
var import_node_path = require("path");
|
|
18117
18109
|
var import_node_url = require("url");
|
|
18118
|
-
var
|
|
18110
|
+
var import_meta = {};
|
|
18119
18111
|
var log6 = createLogger("crypto/quantum-config-writer");
|
|
18120
|
-
var currentDir = typeof __dirname !== "undefined" ? __dirname : (0, import_node_path.dirname)((0, import_node_url.fileURLToPath)(
|
|
18112
|
+
var currentDir = typeof __dirname !== "undefined" ? __dirname : (0, import_node_path.dirname)((0, import_node_url.fileURLToPath)(import_meta.url));
|
|
18121
18113
|
var QUANTUM_JSON_PATH = (0, import_node_path.join)(currentDir, "sdk", "quantum.json");
|
|
18122
18114
|
function writeQuantumConfig(credentials) {
|
|
18123
18115
|
const sdkConfig = {
|