@workclaw/cli 1.0.336 → 1.0.337
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/commands/box/src/box.d.ts.map +1 -1
- package/dist/commands/box/types/index.d.ts +1 -0
- package/dist/commands/box/types/index.d.ts.map +1 -1
- package/dist/commands/local/schemas/index.d.ts +1 -2
- package/dist/commands/local/schemas/index.d.ts.map +1 -1
- package/dist/commands/local/src/local.d.ts.map +1 -1
- package/dist/commands/local/types/index.d.ts +5 -1
- package/dist/commands/local/types/index.d.ts.map +1 -1
- package/dist/configs/index.d.ts +2 -0
- package/dist/configs/index.d.ts.map +1 -1
- package/dist/{index-CGNIqbIG.js → index-Bj0IXUhh.js} +40 -11
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"box.d.ts","sourceRoot":"","sources":["../../../../src/commands/box/src/box.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"box.d.ts","sourceRoot":"","sources":["../../../../src/commands/box/src/box.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAa,MAAM,UAAU,CAAA;AASrD;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAoLzE"}
|
|
@@ -3,6 +3,7 @@ export declare const SUPPORTED_MODELS: readonly ["MiniMax-M2.5"];
|
|
|
3
3
|
export type ModelType = typeof SUPPORTED_MODELS[number];
|
|
4
4
|
export declare const DEFAULT_MODEL: ModelType;
|
|
5
5
|
export declare const MODEL_NAME_MAP: Record<ModelType, string>;
|
|
6
|
+
export declare const DEFAULT_MERGE_MODE: 'merge' | 'replace' | 'reset-keys';
|
|
6
7
|
export interface BoxOptions {
|
|
7
8
|
env?: string;
|
|
8
9
|
appKey?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/box/types/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,WAAW,CAAA;AAExC,eAAO,MAAM,gBAAgB,2BAEnB,CAAA;AAEV,MAAM,MAAM,SAAS,GAAG,OAAO,gBAAgB,CAAC,MAAM,CAAC,CAAA;AAEvD,eAAO,MAAM,aAAa,EAAE,SAA0B,CAAA;AAEtD,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAEpD,CAAA;AAED,MAAM,WAAW,UAAU;IACzB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,YAAY,CAAA;CAC/C;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;CACb;AAED,YAAY,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/box/types/index.ts"],"names":[],"mappings":"AAA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z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
24
24
|
test: "test";
|
|
25
|
-
|
|
26
|
-
prd: "prd";
|
|
25
|
+
production: "production";
|
|
27
26
|
}>>>;
|
|
28
27
|
model: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
29
28
|
"MiniMax-M2.5": "MiniMax-M2.5";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/local/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAYvB;;;GAGG;AACH,eAAO,MAAM,0BAA0B
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/local/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAYvB;;;GAGG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;iBAsBtC,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAE7E;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;iBAO5B,CAAA;AAEF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local.d.ts","sourceRoot":"","sources":["../../../../src/commands/local/src/local.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"local.d.ts","sourceRoot":"","sources":["../../../../src/commands/local/src/local.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAa,MAAM,UAAU,CAAA;AASvD;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA8L7E"}
|
|
@@ -3,6 +3,10 @@ export declare const SUPPORTED_MODELS: readonly ["MiniMax-M2.5"];
|
|
|
3
3
|
export type ModelType = typeof SUPPORTED_MODELS[number];
|
|
4
4
|
export declare const DEFAULT_MODEL: ModelType;
|
|
5
5
|
export declare const MODEL_NAME_MAP: Record<ModelType, string>;
|
|
6
|
+
export declare const SUPPORTED_SCENES: readonly ["test", "production"];
|
|
7
|
+
export type SceneType = typeof SUPPORTED_SCENES[number];
|
|
8
|
+
export declare const DEFAULT_SCENE: SceneType;
|
|
9
|
+
export declare const DEFAULT_MERGE_MODE: 'merge' | 'replace' | 'reset-keys';
|
|
6
10
|
export interface LocalOptions {
|
|
7
11
|
env?: string;
|
|
8
12
|
phone?: string;
|
|
@@ -14,7 +18,7 @@ export interface LocalOptions {
|
|
|
14
18
|
debug?: boolean;
|
|
15
19
|
printToken?: boolean;
|
|
16
20
|
mergeMode?: 'merge' | 'replace' | 'reset-keys';
|
|
17
|
-
scene?:
|
|
21
|
+
scene?: SceneType;
|
|
18
22
|
model?: ModelType;
|
|
19
23
|
}
|
|
20
24
|
export interface InstallResult {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/local/types/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,WAAW,CAAA;AAExC,eAAO,MAAM,gBAAgB,2BAEnB,CAAA;AAEV,MAAM,MAAM,SAAS,GAAG,OAAO,gBAAgB,CAAC,MAAM,CAAC,CAAA;AAEvD,eAAO,MAAM,aAAa,EAAE,SAA0B,CAAA;AAEtD,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAEpD,CAAA;AAED,MAAM,WAAW,YAAY;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CA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AS,GAAG,YAAY,CAAA;IAC9C,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,KAAK,CAAC,EAAE,SAAS,CAAA;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;CACb;AAED,YAAY,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA"}
|
package/dist/configs/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/configs/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAA;AAEpD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,WAAW;IACX,WAAW,EAAE,MAAM,CAAA;IACnB,eAAe;IACf,gBAAgB,EAAE,MAAM,CAAA;IACxB,oBAAoB;IACpB,cAAc,EAAE,MAAM,CAAA;IACtB,WAAW;IACX,IAAI,EAAE;QACJ,QAAQ,EAAE,MAAM,CAAA;QAChB,UAAU,EAAE,MAAM,CAAA;QAClB,OAAO,EAAE,MAAM,CAAA;QACf,WAAW,EAAE,MAAM,CAAA;QACnB,SAAS,EAAE,MAAM,CAAA;QACjB,IAAI,EAAE,MAAM,CAAA;KACb,CAAA;IACD,WAAW;IACX,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB,aAAa;IACb,GAAG,EAAE;QACH,cAAc,EAAE,MAAM,CAAA;QACtB,QAAQ,EAAE,MAAM,CAAA;QAChB,OAAO,EAAE,MAAM,CAAA;KAChB,CAAA;CACF;AAED;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/configs/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAA;AAEpD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,WAAW;IACX,WAAW,EAAE,MAAM,CAAA;IACnB,eAAe;IACf,gBAAgB,EAAE,MAAM,CAAA;IACxB,oBAAoB;IACpB,cAAc,EAAE,MAAM,CAAA;IACtB,eAAe;IACf,cAAc,EAAE,MAAM,CAAA;IACtB,WAAW;IACX,IAAI,EAAE;QACJ,QAAQ,EAAE,MAAM,CAAA;QAChB,UAAU,EAAE,MAAM,CAAA;QAClB,OAAO,EAAE,MAAM,CAAA;QACf,WAAW,EAAE,MAAM,CAAA;QACnB,SAAS,EAAE,MAAM,CAAA;QACjB,IAAI,EAAE,MAAM,CAAA;KACb,CAAA;IACD,WAAW;IACX,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB,aAAa;IACb,GAAG,EAAE;QACH,cAAc,EAAE,MAAM,CAAA;QACtB,QAAQ,EAAE,MAAM,CAAA;QAChB,OAAO,EAAE,MAAM,CAAA;KAChB,CAAA;CACF;AAED;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,eAmBpB,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,eAmBzB,CAAA;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,eAAe,CAwB9E"}
|
|
@@ -151,6 +151,7 @@ const CONFIG = {
|
|
|
151
151
|
PLUGIN_NAME: "openclaw-workclaw",
|
|
152
152
|
DEFAULT_BASE_URL: "https://workbrain.cn/backend-api",
|
|
153
153
|
DEFAULT_WS_URL: "wss://workbrain.cn/backend-api/open-apis/connect",
|
|
154
|
+
MODEL_BASE_URL: "https://maas-api.workbrain.cn/v1/",
|
|
154
155
|
DIRS: {
|
|
155
156
|
OPENCLAW: ".openclaw",
|
|
156
157
|
EXTENSIONS: "extensions",
|
|
@@ -170,6 +171,7 @@ const TEST_CONFIG = {
|
|
|
170
171
|
PLUGIN_NAME: "openclaw-workclaw",
|
|
171
172
|
DEFAULT_BASE_URL: "http://172.168.80.30:32005",
|
|
172
173
|
DEFAULT_WS_URL: "ws://172.168.80.30:32005/open-apis/connect",
|
|
174
|
+
MODEL_BASE_URL: "http://172.168.80.30:30005/v1",
|
|
173
175
|
DIRS: {
|
|
174
176
|
OPENCLAW: ".openclaw",
|
|
175
177
|
EXTENSIONS: "extensions",
|
|
@@ -198,6 +200,7 @@ function getConfig(env, customIp) {
|
|
|
198
200
|
...TEST_CONFIG,
|
|
199
201
|
DEFAULT_BASE_URL: replaceIp(TEST_CONFIG.DEFAULT_BASE_URL),
|
|
200
202
|
DEFAULT_WS_URL: replaceIp(TEST_CONFIG.DEFAULT_WS_URL),
|
|
203
|
+
MODEL_BASE_URL: replaceIp(TEST_CONFIG.MODEL_BASE_URL),
|
|
201
204
|
API: {
|
|
202
205
|
...TEST_CONFIG.API,
|
|
203
206
|
TUZAI_BASE_URL: replaceIp(TEST_CONFIG.API.TUZAI_BASE_URL),
|
|
@@ -229,6 +232,7 @@ const DEFAULT_MODEL$1 = "MiniMax-M2.5";
|
|
|
229
232
|
const MODEL_NAME_MAP$1 = {
|
|
230
233
|
"MiniMax-M2.5": "MiniMax-M2.5"
|
|
231
234
|
};
|
|
235
|
+
const DEFAULT_MERGE_MODE$1 = "merge";
|
|
232
236
|
const MODEL_GENERAL_CONFIG$1 = {
|
|
233
237
|
reasoning: false,
|
|
234
238
|
input: ["text"],
|
|
@@ -510,7 +514,7 @@ class BoxInstaller {
|
|
|
510
514
|
providers: {
|
|
511
515
|
[DEFAULT_PROVIDER$1]: {
|
|
512
516
|
// 模型 API 基础地址
|
|
513
|
-
baseUrl:
|
|
517
|
+
baseUrl: envConfig.MODEL_BASE_URL,
|
|
514
518
|
// API 密钥(留空,由外部提供)
|
|
515
519
|
apiKey: "",
|
|
516
520
|
// API 类型:'openai-completions' | 'openai-chat' 等
|
|
@@ -830,7 +834,7 @@ async function createBoxCommand(options) {
|
|
|
830
834
|
} else if (env === "custom" && customIp) {
|
|
831
835
|
debug.log(`[盒子安装] 使用命令行参数: customIp=${customIp}`);
|
|
832
836
|
}
|
|
833
|
-
const mergeMode = options.mergeMode ||
|
|
837
|
+
const mergeMode = options.mergeMode || DEFAULT_MERGE_MODE$1;
|
|
834
838
|
if (!appKey || !appSecret) {
|
|
835
839
|
throw new Error("AppKey 和 AppSecret 不能为空");
|
|
836
840
|
}
|
|
@@ -1016,6 +1020,12 @@ const DEFAULT_MODEL = "MiniMax-M2.5";
|
|
|
1016
1020
|
const MODEL_NAME_MAP = {
|
|
1017
1021
|
"MiniMax-M2.5": "MiniMax-M2.5"
|
|
1018
1022
|
};
|
|
1023
|
+
const SUPPORTED_SCENES = [
|
|
1024
|
+
"test",
|
|
1025
|
+
"production"
|
|
1026
|
+
];
|
|
1027
|
+
const DEFAULT_SCENE = "production";
|
|
1028
|
+
const DEFAULT_MERGE_MODE = "merge";
|
|
1019
1029
|
const LocalInstallerConfigSchema = z$1.object({
|
|
1020
1030
|
env: EnvironmentSchema.optional(),
|
|
1021
1031
|
customIp: ipv4Schema.optional(),
|
|
@@ -1025,7 +1035,7 @@ const LocalInstallerConfigSchema = z$1.object({
|
|
|
1025
1035
|
pluginVersion: pluginVersionSchema,
|
|
1026
1036
|
openclawPath: openclawPathSchema.optional(),
|
|
1027
1037
|
mergeMode: z$1.enum(["merge", "replace", "reset-keys"]).optional().default("merge"),
|
|
1028
|
-
scene: z$1.enum(
|
|
1038
|
+
scene: z$1.enum(SUPPORTED_SCENES).optional().default(DEFAULT_SCENE),
|
|
1029
1039
|
model: z$1.enum(SUPPORTED_MODELS).optional().default(DEFAULT_MODEL)
|
|
1030
1040
|
}).refine(
|
|
1031
1041
|
(data) => {
|
|
@@ -5288,7 +5298,7 @@ class LocalInstaller {
|
|
|
5288
5298
|
mode: "replace",
|
|
5289
5299
|
providers: {
|
|
5290
5300
|
[DEFAULT_PROVIDER]: {
|
|
5291
|
-
baseUrl: boundConfig.modelApiBaseUrl,
|
|
5301
|
+
baseUrl: boundConfig.modelApiBaseUrl || envConfig.MODEL_BASE_URL,
|
|
5292
5302
|
apiKey: boundConfig.modelApiKey,
|
|
5293
5303
|
api: "openai-completions",
|
|
5294
5304
|
authHeader: true,
|
|
@@ -5420,7 +5430,7 @@ class LocalInstaller {
|
|
|
5420
5430
|
source: "npm",
|
|
5421
5431
|
spec: PLUGIN_PACKAGE_NAME,
|
|
5422
5432
|
installPath: paths.target,
|
|
5423
|
-
scene: this.installOptions.scene ||
|
|
5433
|
+
scene: this.installOptions.scene || DEFAULT_SCENE
|
|
5424
5434
|
}
|
|
5425
5435
|
},
|
|
5426
5436
|
entries: {
|
|
@@ -5441,7 +5451,7 @@ class LocalInstaller {
|
|
|
5441
5451
|
async function createLocalCommand(options) {
|
|
5442
5452
|
setDebug(!!options.debug);
|
|
5443
5453
|
debug.log("[初始化] 开始处理...");
|
|
5444
|
-
debug.log(`[初始化] 参数: env=${options.env}, phone=${options.phone}, customIp=${options.customIp}, debug=${options.debug}`);
|
|
5454
|
+
debug.log(`[初始化] 参数: env=${options.env}, phone=${options.phone ? "***" : "未提供"}, customIp=${options.customIp}, debug=${options.debug}`);
|
|
5445
5455
|
checkEnv();
|
|
5446
5456
|
debug.log("[初始化] 环境检查通过");
|
|
5447
5457
|
try {
|
|
@@ -5449,6 +5459,7 @@ async function createLocalCommand(options) {
|
|
|
5449
5459
|
let phone = options.phone;
|
|
5450
5460
|
let userPass = options.userPass;
|
|
5451
5461
|
let customIp = options.customIp;
|
|
5462
|
+
let model = options.model;
|
|
5452
5463
|
const questions = [];
|
|
5453
5464
|
if (!env) {
|
|
5454
5465
|
debug.log("[初始化] 需要选择环境");
|
|
@@ -5503,6 +5514,21 @@ async function createLocalCommand(options) {
|
|
|
5503
5514
|
} else {
|
|
5504
5515
|
debug.log("[初始化] 使用命令行参数: userPass");
|
|
5505
5516
|
}
|
|
5517
|
+
if (!model) {
|
|
5518
|
+
debug.log("[初始化] 需要选择模型");
|
|
5519
|
+
questions.push({
|
|
5520
|
+
type: "list",
|
|
5521
|
+
name: "model",
|
|
5522
|
+
message: chalk.cyan("请选择模型:"),
|
|
5523
|
+
default: DEFAULT_MODEL,
|
|
5524
|
+
choices: SUPPORTED_MODELS.map((m) => ({
|
|
5525
|
+
name: m === DEFAULT_MODEL ? `${chalk.green(m)} ${chalk.dim("(默认)")}` : m,
|
|
5526
|
+
value: m
|
|
5527
|
+
}))
|
|
5528
|
+
});
|
|
5529
|
+
} else {
|
|
5530
|
+
debug.log(`[初始化] 使用命令行参数: model=${model}`);
|
|
5531
|
+
}
|
|
5506
5532
|
if (questions.length > 0) {
|
|
5507
5533
|
debug.log(`[初始化] 开始交互式问答,共 ${questions.length} 个问题`);
|
|
5508
5534
|
const answers = await inquirer.prompt(questions);
|
|
@@ -5510,7 +5536,9 @@ async function createLocalCommand(options) {
|
|
|
5510
5536
|
env = env || answers.env || "test";
|
|
5511
5537
|
phone = phone || answers.phone;
|
|
5512
5538
|
userPass = userPass || answers.userPass;
|
|
5539
|
+
model = model || answers.model || DEFAULT_MODEL;
|
|
5513
5540
|
}
|
|
5541
|
+
model = model || DEFAULT_MODEL;
|
|
5514
5542
|
if (env === "custom" && !customIp) {
|
|
5515
5543
|
debug.log("[初始化] 自定义环境需要输入后端 IP");
|
|
5516
5544
|
const answer = await inquirer.prompt([{
|
|
@@ -5534,11 +5562,12 @@ async function createLocalCommand(options) {
|
|
|
5534
5562
|
} else if (env === "custom" && customIp) {
|
|
5535
5563
|
debug.log(`[初始化] 使用命令行参数: customIp=${customIp}`);
|
|
5536
5564
|
}
|
|
5537
|
-
const mergeMode = options.mergeMode ||
|
|
5565
|
+
const mergeMode = options.mergeMode || DEFAULT_MERGE_MODE;
|
|
5566
|
+
const scene = options.scene || DEFAULT_SCENE;
|
|
5538
5567
|
if (!phone || !userPass) {
|
|
5539
5568
|
throw new Error("手机号和密码不能为空");
|
|
5540
5569
|
}
|
|
5541
|
-
debug.log(`[初始化] 最终参数: env=${env},
|
|
5570
|
+
debug.log(`[初始化] 最终参数: env=${env}, customIp=${customIp}, pluginVersion=${options.pluginVersion}, openclawPath=${options.openclawPath}, model=${model}, mergeMode=${mergeMode}, scene=${scene}`);
|
|
5542
5571
|
debug.log("[初始化] 创建 LocalInstaller 实例...");
|
|
5543
5572
|
const installer = new LocalInstaller({
|
|
5544
5573
|
phone,
|
|
@@ -5548,9 +5577,9 @@ async function createLocalCommand(options) {
|
|
|
5548
5577
|
wsUrl: options.wsUrl,
|
|
5549
5578
|
pluginVersion: options.pluginVersion,
|
|
5550
5579
|
openclawPath: options.openclawPath,
|
|
5580
|
+
model,
|
|
5551
5581
|
mergeMode,
|
|
5552
|
-
scene
|
|
5553
|
-
model: options.model || "MiniMax-M2.5"
|
|
5582
|
+
scene
|
|
5554
5583
|
});
|
|
5555
5584
|
debug.log("[初始化] 开始安装...");
|
|
5556
5585
|
await installer.install();
|
|
@@ -5590,7 +5619,7 @@ ${chalk.cyan("Token: ")}${token}`);
|
|
|
5590
5619
|
}
|
|
5591
5620
|
}
|
|
5592
5621
|
function registerCommands(program2) {
|
|
5593
|
-
program2.command("local").description("本地账户安装(需要登录)").option("-e, --env <env>", "环境 (test/prod/custom)").option("--phone <phone>", "手机号码").option("--user-pass <userPass>", "用户密码").option("--custom-ip <ip>", "自定义后端 IP(仅 custom 环境生效)").option("--ws-url <url>", "自定义 WebSocket URL(仅 custom 环境生效,默认自动生成)").option("--plugin-version <plugin-version>", "插件版本号(默认最新版)").option("--openclaw-path <path>", "OpenClaw 安装目录路径(默认 ~/.openclaw)").option("--merge-mode <mode>", "配置合并模式 (merge: 保留旧配置合并 / replace: 完全重置 / reset-keys: 清除关键字段后合并),默认 reset-keys").option("--debug", "开启调试日志").option("--scene <scene>",
|
|
5622
|
+
program2.command("local").description("本地账户安装(需要登录)").option("-e, --env <env>", "环境 (test/prod/custom)").option("--phone <phone>", "手机号码").option("--user-pass <userPass>", "用户密码").option("--custom-ip <ip>", "自定义后端 IP(仅 custom 环境生效)").option("--ws-url <url>", "自定义 WebSocket URL(仅 custom 环境生效,默认自动生成)").option("--plugin-version <plugin-version>", "插件版本号(默认最新版)").option("--openclaw-path <path>", "OpenClaw 安装目录路径(默认 ~/.openclaw)").option("--merge-mode <mode>", "配置合并模式 (merge: 保留旧配置合并 / replace: 完全重置 / reset-keys: 清除关键字段后合并),默认 reset-keys").option("--debug", "开启调试日志").option("--scene <scene>", `场景 (${SUPPORTED_SCENES.join("/")}),控制 plugin 日志输出,默认 ${DEFAULT_SCENE}`).option("--model <model>", `选择模型 (${SUPPORTED_MODELS.join("/")}),默认 ${DEFAULT_MODEL}`).action(createLocalCommand);
|
|
5594
5623
|
}
|
|
5595
5624
|
const __filename$1 = fileURLToPath(import.meta.url);
|
|
5596
5625
|
const __dirname$1 = dirname(__filename$1);
|
package/dist/index.js
CHANGED