@workclaw/cli 1.0.331 → 1.0.333
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/configs/index.d.ts.map +1 -0
- package/dist/commands/box/configs/model.d.ts.map +1 -0
- package/dist/commands/box/error/index.d.ts.map +1 -0
- package/dist/commands/box/index.d.ts.map +1 -0
- package/dist/commands/box/installer/index.d.ts.map +1 -0
- package/dist/commands/box/installer/installer.d.ts.map +1 -0
- package/dist/{box/types → commands/box/schemas}/index.d.ts +2 -31
- package/dist/commands/box/schemas/index.d.ts.map +1 -0
- package/dist/commands/box/src/box.d.ts.map +1 -0
- package/dist/commands/box/types/index.d.ts +32 -0
- package/dist/commands/box/types/index.d.ts.map +1 -0
- package/dist/commands/local/apis/http.d.ts.map +1 -0
- package/dist/{local → commands/local}/apis/index.d.ts +2 -2
- package/dist/commands/local/apis/index.d.ts.map +1 -0
- package/dist/commands/local/configs/index.d.ts.map +1 -0
- package/dist/commands/local/configs/model.d.ts.map +1 -0
- package/dist/commands/local/error/index.d.ts.map +1 -0
- package/dist/commands/local/index.d.ts.map +1 -0
- package/dist/commands/local/installer/index.d.ts.map +1 -0
- package/dist/commands/local/installer/installer.d.ts.map +1 -0
- package/dist/{local/types → commands/local/schemas}/index.d.ts +9 -26
- package/dist/commands/local/schemas/index.d.ts.map +1 -0
- package/dist/commands/local/src/local.d.ts.map +1 -0
- package/dist/commands/local/types/index.d.ts +34 -0
- package/dist/commands/local/types/index.d.ts.map +1 -0
- package/dist/commands/local/utils/crypto.d.ts.map +1 -0
- package/dist/{local → commands/local}/utils/index.d.ts +0 -1
- package/dist/commands/local/utils/index.d.ts.map +1 -0
- package/dist/commands/local/utils/machine-id.d.ts.map +1 -0
- package/dist/configs/index.d.ts.map +1 -0
- package/dist/{index-b2rw2uLv.js → index-B2GxnJ-9.js} +110 -128
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -1
- package/dist/utils/debug.d.ts.map +1 -0
- package/dist/utils/env.d.ts.map +1 -0
- package/dist/utils/index.d.ts +7 -6
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/logger.d.ts +5 -7
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/object.d.ts +18 -0
- package/dist/utils/object.d.ts.map +1 -0
- package/dist/{shared/utils → utils}/path.d.ts +5 -0
- package/dist/utils/path.d.ts.map +1 -0
- package/dist/utils/validate.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/box/configs/index.d.ts.map +0 -1
- package/dist/box/configs/model.d.ts.map +0 -1
- package/dist/box/constants/index.d.ts.map +0 -1
- package/dist/box/constants/model.d.ts +0 -9
- package/dist/box/constants/model.d.ts.map +0 -1
- package/dist/box/error/index.d.ts.map +0 -1
- package/dist/box/index.d.ts.map +0 -1
- package/dist/box/installer/index.d.ts.map +0 -1
- package/dist/box/installer/installer.d.ts.map +0 -1
- package/dist/box/src/box.d.ts.map +0 -1
- package/dist/box/types/index.d.ts.map +0 -1
- package/dist/box/utils/index.d.ts +0 -2
- package/dist/box/utils/index.d.ts.map +0 -1
- package/dist/box/utils/path.d.ts +0 -2
- package/dist/box/utils/path.d.ts.map +0 -1
- package/dist/command/index.d.ts +0 -3
- package/dist/command/index.d.ts.map +0 -1
- package/dist/command/src/base-command.d.ts +0 -12
- package/dist/command/src/base-command.d.ts.map +0 -1
- package/dist/command/types/index.d.ts +0 -14
- package/dist/command/types/index.d.ts.map +0 -1
- package/dist/lib/command/base-command.d.ts +0 -16
- package/dist/lib/command/base-command.d.ts.map +0 -1
- package/dist/lib/index.d.ts +0 -2
- package/dist/lib/index.d.ts.map +0 -1
- package/dist/local/apis/index.d.ts.map +0 -1
- package/dist/local/configs/index.d.ts +0 -2
- package/dist/local/configs/index.d.ts.map +0 -1
- package/dist/local/configs/model.d.ts.map +0 -1
- package/dist/local/constants/index.d.ts +0 -2
- package/dist/local/constants/index.d.ts.map +0 -1
- package/dist/local/constants/model.d.ts +0 -4
- package/dist/local/constants/model.d.ts.map +0 -1
- package/dist/local/error/index.d.ts.map +0 -1
- package/dist/local/index.d.ts.map +0 -1
- package/dist/local/installer/index.d.ts.map +0 -1
- package/dist/local/installer/installer.d.ts.map +0 -1
- package/dist/local/src/local.d.ts.map +0 -1
- package/dist/local/types/index.d.ts.map +0 -1
- package/dist/local/utils/crypto.d.ts.map +0 -1
- package/dist/local/utils/index.d.ts.map +0 -1
- package/dist/local/utils/machine-id.d.ts.map +0 -1
- package/dist/local/utils/path.d.ts +0 -2
- package/dist/local/utils/path.d.ts.map +0 -1
- package/dist/shared/config/index.d.ts.map +0 -1
- package/dist/shared/utils/debug.d.ts.map +0 -1
- package/dist/shared/utils/env.d.ts.map +0 -1
- package/dist/shared/utils/index.d.ts +0 -7
- package/dist/shared/utils/index.d.ts.map +0 -1
- package/dist/shared/utils/logger.d.ts +0 -14
- package/dist/shared/utils/logger.d.ts.map +0 -1
- package/dist/shared/utils/path.d.ts.map +0 -1
- package/dist/shared/utils/validate.d.ts.map +0 -1
- package/dist/utils/config-default.d.ts +0 -28
- package/dist/utils/config-default.d.ts.map +0 -1
- package/dist/utils/config.d.ts +0 -28
- package/dist/utils/config.d.ts.map +0 -1
- package/dist/utils/crypto.d.ts +0 -13
- package/dist/utils/crypto.d.ts.map +0 -1
- package/dist/utils/error.d.ts +0 -36
- package/dist/utils/error.d.ts.map +0 -1
- package/dist/utils/http.d.ts.map +0 -1
- /package/dist/{box → commands/box}/configs/index.d.ts +0 -0
- /package/dist/{box → commands/box}/configs/model.d.ts +0 -0
- /package/dist/{box → commands/box}/error/index.d.ts +0 -0
- /package/dist/{box → commands/box}/index.d.ts +0 -0
- /package/dist/{box → commands/box}/installer/index.d.ts +0 -0
- /package/dist/{box → commands/box}/installer/installer.d.ts +0 -0
- /package/dist/{box → commands/box}/src/box.d.ts +0 -0
- /package/dist/{utils → commands/local/apis}/http.d.ts +0 -0
- /package/dist/{box/constants → commands/local/configs}/index.d.ts +0 -0
- /package/dist/{local → commands/local}/configs/model.d.ts +0 -0
- /package/dist/{local → commands/local}/error/index.d.ts +0 -0
- /package/dist/{local → commands/local}/index.d.ts +0 -0
- /package/dist/{local → commands/local}/installer/index.d.ts +0 -0
- /package/dist/{local → commands/local}/installer/installer.d.ts +0 -0
- /package/dist/{local → commands/local}/src/local.d.ts +0 -0
- /package/dist/{local → commands/local}/utils/crypto.d.ts +0 -0
- /package/dist/{local → commands/local}/utils/machine-id.d.ts +0 -0
- /package/dist/{shared/config → configs}/index.d.ts +0 -0
- /package/dist/{shared/utils → utils}/debug.d.ts +0 -0
- /package/dist/{shared/utils → utils}/env.d.ts +0 -0
- /package/dist/{shared/utils → utils}/validate.d.ts +0 -0
|
@@ -13,7 +13,7 @@ import { z as z$1 } from "zod";
|
|
|
13
13
|
import fs from "node:fs/promises";
|
|
14
14
|
import ora from "ora";
|
|
15
15
|
import tar from "tar";
|
|
16
|
-
import axios from "axios";
|
|
16
|
+
import axios, { AxiosError } from "axios";
|
|
17
17
|
import crypto from "node:crypto";
|
|
18
18
|
import os from "node:os";
|
|
19
19
|
const debug = new Debug();
|
|
@@ -59,6 +59,36 @@ function checkEnv() {
|
|
|
59
59
|
throw new AppError$1(ERROR_CODES$1.NPM_NOT_FOUND, "未检测到 npm,请先安装 Node.js 和 npm");
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
+
function getObjectHash(obj) {
|
|
63
|
+
return JSON.stringify(obj, Object.keys(obj).sort());
|
|
64
|
+
}
|
|
65
|
+
function deepMerge(target, source) {
|
|
66
|
+
const result = { ...target };
|
|
67
|
+
for (const key in source) {
|
|
68
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
69
|
+
const sourceValue = source[key];
|
|
70
|
+
const targetValue = target[key];
|
|
71
|
+
if (Array.isArray(sourceValue) && Array.isArray(targetValue)) {
|
|
72
|
+
if (targetValue.length > 0 && typeof targetValue[0] === "object" && targetValue[0] !== null) {
|
|
73
|
+
const existingHashes = new Set(targetValue.map((item) => getObjectHash(item)));
|
|
74
|
+
const newItems = sourceValue.filter((item) => !existingHashes.has(getObjectHash(item)));
|
|
75
|
+
result[key] = [...targetValue, ...newItems];
|
|
76
|
+
} else {
|
|
77
|
+
const mergedArray = [.../* @__PURE__ */ new Set([...targetValue, ...sourceValue])];
|
|
78
|
+
result[key] = mergedArray;
|
|
79
|
+
}
|
|
80
|
+
} else if (sourceValue !== void 0 && sourceValue !== null && typeof sourceValue === "object" && !Array.isArray(sourceValue) && typeof targetValue === "object" && targetValue !== null && !Array.isArray(targetValue)) {
|
|
81
|
+
result[key] = deepMerge(
|
|
82
|
+
targetValue,
|
|
83
|
+
sourceValue
|
|
84
|
+
);
|
|
85
|
+
} else if (sourceValue !== void 0) {
|
|
86
|
+
result[key] = sourceValue;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return result;
|
|
91
|
+
}
|
|
62
92
|
const EnvironmentSchema = z$1.enum(["test", "prod", "custom"], {
|
|
63
93
|
message: "环境类型必须是 test、prod 或 custom"
|
|
64
94
|
});
|
|
@@ -97,6 +127,9 @@ const wsUrlSchema = z$1.string().url({
|
|
|
97
127
|
message: "请输入有效的 WebSocket URL"
|
|
98
128
|
}).optional();
|
|
99
129
|
z$1.boolean();
|
|
130
|
+
function getHomeDir() {
|
|
131
|
+
return process$1.env.HOME || process$1.env.USERPROFILE || "";
|
|
132
|
+
}
|
|
100
133
|
function cleanWindowsLongPath(inputPath) {
|
|
101
134
|
return inputPath.replace(/^[\\?]+/, "");
|
|
102
135
|
}
|
|
@@ -190,23 +223,14 @@ class AppError2 extends Error {
|
|
|
190
223
|
this.name = "AppError";
|
|
191
224
|
}
|
|
192
225
|
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
const SUPPORTED_MODELS = [
|
|
197
|
-
"gpt-4.1-mini",
|
|
198
|
-
"gpt-4o-mini",
|
|
199
|
-
"gpt-5-chat",
|
|
200
|
-
"gpt-5-mini"
|
|
226
|
+
const DEFAULT_PROVIDER$1 = "mingto";
|
|
227
|
+
const SUPPORTED_MODELS$1 = [
|
|
228
|
+
"MiniMax-M2.5"
|
|
201
229
|
];
|
|
202
|
-
const DEFAULT_MODEL = "
|
|
203
|
-
const
|
|
204
|
-
"
|
|
205
|
-
"gpt-4o-mini": { id: "gpt-4o-mini", name: "GPT-4o-Mini" },
|
|
206
|
-
"gpt-5-chat": { id: "gpt-5-chat", name: "GPT-5-Chat" },
|
|
207
|
-
"gpt-5-mini": { id: "gpt-5-mini", name: "GPT-5-Mini" }
|
|
230
|
+
const DEFAULT_MODEL$1 = "MiniMax-M2.5";
|
|
231
|
+
const MODEL_NAME_MAP$1 = {
|
|
232
|
+
"MiniMax-M2.5": "MiniMax-M2.5"
|
|
208
233
|
};
|
|
209
|
-
const DEFAULT_PROVIDER$1 = "siliconflow-minimax";
|
|
210
234
|
const MODEL_GENERAL_CONFIG$1 = {
|
|
211
235
|
reasoning: false,
|
|
212
236
|
input: ["text"],
|
|
@@ -226,36 +250,6 @@ function execAsync$1(command, options) {
|
|
|
226
250
|
});
|
|
227
251
|
});
|
|
228
252
|
}
|
|
229
|
-
function getObjectHash$1(obj) {
|
|
230
|
-
return JSON.stringify(obj, Object.keys(obj).sort());
|
|
231
|
-
}
|
|
232
|
-
function deepMerge$1(target, source) {
|
|
233
|
-
const result = { ...target };
|
|
234
|
-
for (const key in source) {
|
|
235
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
236
|
-
const sourceValue = source[key];
|
|
237
|
-
const targetValue = target[key];
|
|
238
|
-
if (Array.isArray(sourceValue) && Array.isArray(targetValue)) {
|
|
239
|
-
if (targetValue.length > 0 && typeof targetValue[0] === "object" && targetValue[0] !== null) {
|
|
240
|
-
const existingHashes = new Set(targetValue.map((item) => getObjectHash$1(item)));
|
|
241
|
-
const newItems = sourceValue.filter((item) => !existingHashes.has(getObjectHash$1(item)));
|
|
242
|
-
result[key] = [...targetValue, ...newItems];
|
|
243
|
-
} else {
|
|
244
|
-
const mergedArray = [.../* @__PURE__ */ new Set([...targetValue, ...sourceValue])];
|
|
245
|
-
result[key] = mergedArray;
|
|
246
|
-
}
|
|
247
|
-
} else if (sourceValue !== void 0 && sourceValue !== null && typeof sourceValue === "object" && !Array.isArray(sourceValue) && typeof targetValue === "object" && targetValue !== null && !Array.isArray(targetValue)) {
|
|
248
|
-
result[key] = deepMerge$1(
|
|
249
|
-
targetValue,
|
|
250
|
-
sourceValue
|
|
251
|
-
);
|
|
252
|
-
} else if (sourceValue !== void 0) {
|
|
253
|
-
result[key] = sourceValue;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
return result;
|
|
258
|
-
}
|
|
259
253
|
class BoxInstaller {
|
|
260
254
|
constructor(config) {
|
|
261
255
|
this.config = config;
|
|
@@ -299,7 +293,7 @@ class BoxInstaller {
|
|
|
299
293
|
}
|
|
300
294
|
baseDir = normalizePath(this.config.openclawPath);
|
|
301
295
|
} else {
|
|
302
|
-
const home = getHomeDir
|
|
296
|
+
const home = getHomeDir();
|
|
303
297
|
baseDir = path.join(home, config.DIRS.OPENCLAW);
|
|
304
298
|
}
|
|
305
299
|
const extensionsDir = path.join(baseDir, config.DIRS.EXTENSIONS);
|
|
@@ -408,7 +402,7 @@ class BoxInstaller {
|
|
|
408
402
|
debug.log(`[下载插件] tarball 下载成功: ${tarballPath}`);
|
|
409
403
|
break;
|
|
410
404
|
} catch (error) {
|
|
411
|
-
lastError = error.message
|
|
405
|
+
lastError = error instanceof Error ? error.message : "未知错误";
|
|
412
406
|
debug.log(`[下载插件] 第 ${i} 次尝试失败: ${lastError}`);
|
|
413
407
|
if (i < maxRetries) {
|
|
414
408
|
this.spinner.text = chalk.cyan(`下载失败,3秒后重试...`);
|
|
@@ -451,7 +445,7 @@ class BoxInstaller {
|
|
|
451
445
|
});
|
|
452
446
|
debug.log("[下载插件] npm install 执行成功");
|
|
453
447
|
} catch (error) {
|
|
454
|
-
const errorMsg = error.message
|
|
448
|
+
const errorMsg = error instanceof Error ? error.message : "";
|
|
455
449
|
if (errorMsg.includes("npm warn") || errorMsg.includes("deprecated")) {
|
|
456
450
|
debug.log("[下载插件] npm install 有警告但可能成功,继续流程");
|
|
457
451
|
} else {
|
|
@@ -497,7 +491,7 @@ class BoxInstaller {
|
|
|
497
491
|
debug.log("[更新配置] 合并模式: merge(完整保留原有配置后合并)");
|
|
498
492
|
}
|
|
499
493
|
const config = getConfig(this.config.env || "test", this.config.customIp);
|
|
500
|
-
const
|
|
494
|
+
const model = this.config.model ?? DEFAULT_MODEL$1;
|
|
501
495
|
const newConfig = {
|
|
502
496
|
// diagnostics: 诊断配置
|
|
503
497
|
diagnostics: {
|
|
@@ -527,9 +521,9 @@ class BoxInstaller {
|
|
|
527
521
|
authHeader: true,
|
|
528
522
|
models: [{
|
|
529
523
|
// 模型 ID(provider/model 格式)
|
|
530
|
-
id:
|
|
524
|
+
id: model,
|
|
531
525
|
// 模型显示名称
|
|
532
|
-
name:
|
|
526
|
+
name: MODEL_NAME_MAP$1[model],
|
|
533
527
|
// 模型通用配置
|
|
534
528
|
...MODEL_GENERAL_CONFIG$1
|
|
535
529
|
}]
|
|
@@ -540,7 +534,7 @@ class BoxInstaller {
|
|
|
540
534
|
agents: {
|
|
541
535
|
defaults: {
|
|
542
536
|
// 默认使用的模型
|
|
543
|
-
model: { primary: `${DEFAULT_PROVIDER$1}/${
|
|
537
|
+
model: { primary: `${DEFAULT_PROVIDER$1}/${model}` },
|
|
544
538
|
// 工作区目录路径
|
|
545
539
|
workspace: paths.workspace,
|
|
546
540
|
// 会话压缩模式:'safeguard' 保守模式
|
|
@@ -649,7 +643,7 @@ class BoxInstaller {
|
|
|
649
643
|
// 网关端口
|
|
650
644
|
port: 18789,
|
|
651
645
|
// 绑定地址:'loopback' | 'lan' | 'all'
|
|
652
|
-
bind: "
|
|
646
|
+
bind: "lan",
|
|
653
647
|
// 认证模式(token字段未设置,是因为需要使用原始配置的token)
|
|
654
648
|
auth: {
|
|
655
649
|
mode: "token"
|
|
@@ -718,7 +712,7 @@ class BoxInstaller {
|
|
|
718
712
|
}
|
|
719
713
|
}
|
|
720
714
|
};
|
|
721
|
-
const finalConfig = deepMerge
|
|
715
|
+
const finalConfig = deepMerge(originalConfig, newConfig);
|
|
722
716
|
this.updateSpinner("正在写入配置...");
|
|
723
717
|
debug.log("[更新配置] 合并配置并写入文件(保留其他初始化数据)...");
|
|
724
718
|
await fs.writeFile(paths.config, JSON.stringify(finalConfig, null, 2), "utf-8");
|
|
@@ -796,9 +790,9 @@ async function createBoxCommand(options) {
|
|
|
796
790
|
type: "list",
|
|
797
791
|
name: "model",
|
|
798
792
|
message: chalk.cyan("请选择模型:"),
|
|
799
|
-
default: DEFAULT_MODEL,
|
|
800
|
-
choices: SUPPORTED_MODELS.map((m) => ({
|
|
801
|
-
name: m === DEFAULT_MODEL ? `${chalk.green(m)} ${chalk.dim("(默认)")}` : m,
|
|
793
|
+
default: DEFAULT_MODEL$1,
|
|
794
|
+
choices: SUPPORTED_MODELS$1.map((m) => ({
|
|
795
|
+
name: m === DEFAULT_MODEL$1 ? `${chalk.green(m)} ${chalk.dim("(默认)")}` : m,
|
|
802
796
|
value: m
|
|
803
797
|
}))
|
|
804
798
|
});
|
|
@@ -812,9 +806,9 @@ async function createBoxCommand(options) {
|
|
|
812
806
|
env = env || answers.env || "test";
|
|
813
807
|
appKey = appKey || answers.appKey;
|
|
814
808
|
appSecret = appSecret || answers.appSecret;
|
|
815
|
-
model = model || answers.model || DEFAULT_MODEL;
|
|
809
|
+
model = model || answers.model || DEFAULT_MODEL$1;
|
|
816
810
|
}
|
|
817
|
-
model = model || DEFAULT_MODEL;
|
|
811
|
+
model = model || DEFAULT_MODEL$1;
|
|
818
812
|
if (env === "custom" && !customIp) {
|
|
819
813
|
debug.log("[盒子安装] 自定义环境需要输入后端 IP");
|
|
820
814
|
const answer = await inquirer.prompt([{
|
|
@@ -839,6 +833,9 @@ async function createBoxCommand(options) {
|
|
|
839
833
|
debug.log(`[盒子安装] 使用命令行参数: customIp=${customIp}`);
|
|
840
834
|
}
|
|
841
835
|
const mergeMode = options.mergeMode || "merge";
|
|
836
|
+
if (!appKey || !appSecret) {
|
|
837
|
+
throw new Error("AppKey 和 AppSecret 不能为空");
|
|
838
|
+
}
|
|
842
839
|
debug.log(`[盒子安装] 最终参数: env=${env}, customIp=${customIp}, openclawPath=${options.openclawPath}, model=${model}, mergeMode=${mergeMode}`);
|
|
843
840
|
debug.log("[盒子安装] 创建 BoxInstaller 实例...");
|
|
844
841
|
const installer = new BoxInstaller({
|
|
@@ -885,7 +882,7 @@ async function createBoxCommand(options) {
|
|
|
885
882
|
}
|
|
886
883
|
}
|
|
887
884
|
function registerCommands$1(program2) {
|
|
888
|
-
program2.command("box").description("盒子设备安装(无需登录)").option("-e, --env <env>", "环境 (test/prod/custom)").option("--app-key <appKey>", "App Key").option("--app-secret <appSecret>", "App Secret").option("--
|
|
885
|
+
program2.command("box").description("盒子设备安装(无需登录)").option("-e, --env <env>", "环境 (test/prod/custom)").option("--app-key <appKey>", "App Key").option("--app-secret <appSecret>", "App Secret").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("--model <model>", `选择模型 (${SUPPORTED_MODELS$1.join("/")}),默认 ${DEFAULT_MODEL$1}`).option("--merge-mode <mode>", "配置合并模式 (merge: 保留旧配置合并 / replace: 完全重置 / reset-keys: 清除关键字段后合并),默认 reset-keys").option("--debug", "开启调试日志").action(createBoxCommand);
|
|
889
886
|
}
|
|
890
887
|
function createHttpClient(baseURL) {
|
|
891
888
|
return axios.create({
|
|
@@ -910,28 +907,32 @@ async function httpPost(url, data, config) {
|
|
|
910
907
|
data: response.data
|
|
911
908
|
};
|
|
912
909
|
} catch (error) {
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
910
|
+
if (error instanceof AxiosError) {
|
|
911
|
+
if (error.response) {
|
|
912
|
+
const responseData = error.response.data;
|
|
913
|
+
debug.log(`[HTTP POST] 响应状态: ${error.response.status}`);
|
|
914
|
+
debug.log(`[HTTP POST] 响应状态文本: ${error.response.statusText}`);
|
|
915
|
+
debug.log(`[HTTP POST] 响应数据: ${JSON.stringify(responseData)}`);
|
|
916
|
+
if (typeof responseData === "string") {
|
|
917
|
+
throw new AppError$1(ERROR_CODES$1.HTTP_ERROR, `请求失败 (${error.response.status}): ${responseData}`);
|
|
918
|
+
} else if (responseData && typeof responseData === "object" && "message" in responseData) {
|
|
919
|
+
throw new AppError$1(ERROR_CODES$1.HTTP_ERROR, `请求失败 (${error.response.status}): ${responseData.message}`);
|
|
920
|
+
} else {
|
|
921
|
+
throw new AppError$1(ERROR_CODES$1.HTTP_ERROR, `请求失败 (${error.response.status}): ${error.response.statusText}`);
|
|
922
|
+
}
|
|
923
|
+
} else if (error.request) {
|
|
924
|
+
debug.log(`[HTTP POST] 未收到响应`);
|
|
925
|
+
debug.log(`[HTTP POST] 错误信息: ${error.message}`);
|
|
926
|
+
throw new AppError$1(ERROR_CODES$1.NETWORK_ERROR, `网络错误: ${error.message}`);
|
|
923
927
|
} else {
|
|
924
|
-
|
|
928
|
+
debug.log(`[HTTP POST] 请求配置错误`);
|
|
929
|
+
debug.log(`[HTTP POST] 错误信息: ${error.message}`);
|
|
930
|
+
throw new AppError$1(ERROR_CODES$1.HTTP_ERROR, `请求配置错误: ${error.message}`);
|
|
925
931
|
}
|
|
926
|
-
} else if (axiosError.request) {
|
|
927
|
-
debug.log(`[HTTP POST] 未收到响应`);
|
|
928
|
-
debug.log(`[HTTP POST] 错误信息: ${axiosError.message}`);
|
|
929
|
-
throw new AppError$1(ERROR_CODES$1.NETWORK_ERROR, `网络错误: ${axiosError.message}`);
|
|
930
|
-
} else {
|
|
931
|
-
debug.log(`[HTTP POST] 请求配置错误`);
|
|
932
|
-
debug.log(`[HTTP POST] 错误信息: ${axiosError.message}`);
|
|
933
|
-
throw new AppError$1(ERROR_CODES$1.HTTP_ERROR, `请求配置错误: ${axiosError.message}`);
|
|
934
932
|
}
|
|
933
|
+
const errorMsg = error instanceof Error ? error.message : "未知错误";
|
|
934
|
+
debug.log(`[HTTP POST] 未知错误: ${errorMsg}`);
|
|
935
|
+
throw new AppError$1(ERROR_CODES$1.HTTP_ERROR, `请求失败: ${errorMsg}`);
|
|
935
936
|
}
|
|
936
937
|
}
|
|
937
938
|
async function login(phone, password, config) {
|
|
@@ -979,10 +980,10 @@ async function fetchBoundConfig(token, phone, localCode, config) {
|
|
|
979
980
|
debug.log(`[获取绑定配置] 响应数据: ${JSON.stringify(data)}`);
|
|
980
981
|
if (data.code === 200 && data.data) {
|
|
981
982
|
const boundConfig = {
|
|
982
|
-
appKey: data.data.app_key,
|
|
983
|
-
appSecret: data.data.app_secret,
|
|
983
|
+
appKey: data.data.app_key ?? "",
|
|
984
|
+
appSecret: data.data.app_secret ?? "",
|
|
984
985
|
userId: data.data.user_id,
|
|
985
|
-
agentId: data.data.agent_id
|
|
986
|
+
agentId: data.data.agent_id ?? data.data.agents?.[0]?.id ?? "",
|
|
986
987
|
modelApiKey: data.data.model_api_key,
|
|
987
988
|
modelApiBaseUrl: data.data.model_api_base_url
|
|
988
989
|
};
|
|
@@ -1009,6 +1010,14 @@ async function fetchBoundConfig(token, phone, localCode, config) {
|
|
|
1009
1010
|
throw new AppError$1(ERROR_CODES$1.GET_BOUND_CONFIG_FAILED, error.message);
|
|
1010
1011
|
}
|
|
1011
1012
|
}
|
|
1013
|
+
const DEFAULT_PROVIDER = "mingto";
|
|
1014
|
+
const SUPPORTED_MODELS = [
|
|
1015
|
+
"MiniMax-M2.5"
|
|
1016
|
+
];
|
|
1017
|
+
const DEFAULT_MODEL = "MiniMax-M2.5";
|
|
1018
|
+
const MODEL_NAME_MAP = {
|
|
1019
|
+
"MiniMax-M2.5": "MiniMax-M2.5"
|
|
1020
|
+
};
|
|
1012
1021
|
const LocalInstallerConfigSchema = z$1.object({
|
|
1013
1022
|
env: EnvironmentSchema.optional(),
|
|
1014
1023
|
customIp: ipv4Schema.optional(),
|
|
@@ -1017,7 +1026,9 @@ const LocalInstallerConfigSchema = z$1.object({
|
|
|
1017
1026
|
userPass: userPassSchema,
|
|
1018
1027
|
pluginVersion: pluginVersionSchema,
|
|
1019
1028
|
openclawPath: openclawPathSchema.optional(),
|
|
1020
|
-
mergeMode: z$1.enum(["merge", "replace", "reset-keys"]).optional().default("merge")
|
|
1029
|
+
mergeMode: z$1.enum(["merge", "replace", "reset-keys"]).optional().default("merge"),
|
|
1030
|
+
scene: z$1.enum(["test", "normal", "prd"]).optional().default("test"),
|
|
1031
|
+
model: z$1.enum(SUPPORTED_MODELS).optional().default(DEFAULT_MODEL)
|
|
1021
1032
|
}).refine(
|
|
1022
1033
|
(data) => {
|
|
1023
1034
|
if (data.env === "custom") {
|
|
@@ -4951,12 +4962,6 @@ function generateMachineId() {
|
|
|
4951
4962
|
function buildLocalCode(phone, machineId) {
|
|
4952
4963
|
return `${phone}-${machineId}`;
|
|
4953
4964
|
}
|
|
4954
|
-
function getHomeDir() {
|
|
4955
|
-
return process$1.env.HOME || process$1.env.USERPROFILE || "";
|
|
4956
|
-
}
|
|
4957
|
-
const DEFAULT_PROVIDER = "siliconflow-minimax";
|
|
4958
|
-
const DEFAULT_MODEL_ID = "MiniMax-M2.5";
|
|
4959
|
-
const DEFAULT_MODEL_NAME = "MiniMax-M2.5";
|
|
4960
4965
|
const MODEL_GENERAL_CONFIG = {
|
|
4961
4966
|
reasoning: false,
|
|
4962
4967
|
input: ["text"],
|
|
@@ -4976,36 +4981,6 @@ function execAsync(command, options) {
|
|
|
4976
4981
|
});
|
|
4977
4982
|
});
|
|
4978
4983
|
}
|
|
4979
|
-
function getObjectHash(obj) {
|
|
4980
|
-
return JSON.stringify(obj, Object.keys(obj).sort());
|
|
4981
|
-
}
|
|
4982
|
-
function deepMerge(target, source) {
|
|
4983
|
-
const result = { ...target };
|
|
4984
|
-
for (const key in source) {
|
|
4985
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
4986
|
-
const sourceValue = source[key];
|
|
4987
|
-
const targetValue = target[key];
|
|
4988
|
-
if (Array.isArray(sourceValue) && Array.isArray(targetValue)) {
|
|
4989
|
-
if (targetValue.length > 0 && typeof targetValue[0] === "object" && targetValue[0] !== null) {
|
|
4990
|
-
const existingHashes = new Set(targetValue.map((item) => getObjectHash(item)));
|
|
4991
|
-
const newItems = sourceValue.filter((item) => !existingHashes.has(getObjectHash(item)));
|
|
4992
|
-
result[key] = [...targetValue, ...newItems];
|
|
4993
|
-
} else {
|
|
4994
|
-
const mergedArray = [.../* @__PURE__ */ new Set([...targetValue, ...sourceValue])];
|
|
4995
|
-
result[key] = mergedArray;
|
|
4996
|
-
}
|
|
4997
|
-
} else if (sourceValue !== void 0 && sourceValue !== null && typeof sourceValue === "object" && !Array.isArray(sourceValue) && typeof targetValue === "object" && targetValue !== null && !Array.isArray(targetValue)) {
|
|
4998
|
-
result[key] = deepMerge(
|
|
4999
|
-
targetValue,
|
|
5000
|
-
sourceValue
|
|
5001
|
-
);
|
|
5002
|
-
} else if (sourceValue !== void 0) {
|
|
5003
|
-
result[key] = sourceValue;
|
|
5004
|
-
}
|
|
5005
|
-
}
|
|
5006
|
-
}
|
|
5007
|
-
return result;
|
|
5008
|
-
}
|
|
5009
4984
|
class LocalInstaller {
|
|
5010
4985
|
spinner;
|
|
5011
4986
|
prefixText = "";
|
|
@@ -5203,7 +5178,7 @@ class LocalInstaller {
|
|
|
5203
5178
|
debug.log(`[下载插件] tarball 下载成功: ${tarballPath}`);
|
|
5204
5179
|
break;
|
|
5205
5180
|
} catch (error) {
|
|
5206
|
-
lastError = error.message
|
|
5181
|
+
lastError = error instanceof Error ? error.message : "未知错误";
|
|
5207
5182
|
debug.log(`[下载插件] 第 ${i} 次尝试失败: ${lastError}`);
|
|
5208
5183
|
if (i < maxRetries) {
|
|
5209
5184
|
this.spinner.text = chalk.cyan(`下载失败,3秒后重试...`);
|
|
@@ -5299,6 +5274,7 @@ class LocalInstaller {
|
|
|
5299
5274
|
debug.log("[更新配置] 合并模式: merge(完整保留原有配置后合并)");
|
|
5300
5275
|
}
|
|
5301
5276
|
const config = this.envConfig;
|
|
5277
|
+
const model = this.config.model || DEFAULT_MODEL;
|
|
5302
5278
|
const newConfig = {
|
|
5303
5279
|
// diagnostics: 诊断配置
|
|
5304
5280
|
diagnostics: {
|
|
@@ -5319,8 +5295,8 @@ class LocalInstaller {
|
|
|
5319
5295
|
api: "openai-completions",
|
|
5320
5296
|
authHeader: true,
|
|
5321
5297
|
models: [{
|
|
5322
|
-
id:
|
|
5323
|
-
name:
|
|
5298
|
+
id: model,
|
|
5299
|
+
name: MODEL_NAME_MAP[model],
|
|
5324
5300
|
...MODEL_GENERAL_CONFIG
|
|
5325
5301
|
}]
|
|
5326
5302
|
}
|
|
@@ -5329,7 +5305,7 @@ class LocalInstaller {
|
|
|
5329
5305
|
// agents: 代理配置
|
|
5330
5306
|
agents: {
|
|
5331
5307
|
defaults: {
|
|
5332
|
-
model: { primary: `${DEFAULT_PROVIDER}/${
|
|
5308
|
+
model: { primary: `${DEFAULT_PROVIDER}/${model}` },
|
|
5333
5309
|
workspace: paths.workspace,
|
|
5334
5310
|
compaction: { mode: "safeguard" },
|
|
5335
5311
|
verboseDefault: "full",
|
|
@@ -5445,7 +5421,8 @@ class LocalInstaller {
|
|
|
5445
5421
|
[config.PLUGIN_NAME]: {
|
|
5446
5422
|
source: "npm",
|
|
5447
5423
|
spec: PLUGIN_PACKAGE_NAME,
|
|
5448
|
-
installPath: paths.target
|
|
5424
|
+
installPath: paths.target,
|
|
5425
|
+
scene: this.config.scene || "test"
|
|
5449
5426
|
}
|
|
5450
5427
|
},
|
|
5451
5428
|
entries: {
|
|
@@ -5560,7 +5537,10 @@ async function createLocalCommand(options) {
|
|
|
5560
5537
|
debug.log(`[初始化] 使用命令行参数: customIp=${customIp}`);
|
|
5561
5538
|
}
|
|
5562
5539
|
const mergeMode = options.mergeMode || "merge";
|
|
5563
|
-
|
|
5540
|
+
if (!phone || !userPass) {
|
|
5541
|
+
throw new Error("手机号和密码不能为空");
|
|
5542
|
+
}
|
|
5543
|
+
debug.log(`[初始化] 最终参数: env=${env}, phone=${phone}, customIp=${customIp}, pluginVersion=${options.pluginVersion}, openclawPath=${options.openclawPath}, mergeMode=${mergeMode}, scene=${options.scene}, model=${options.model}`);
|
|
5564
5544
|
debug.log("[初始化] 创建 LocalInstaller 实例...");
|
|
5565
5545
|
const installer = new LocalInstaller({
|
|
5566
5546
|
phone,
|
|
@@ -5570,7 +5550,9 @@ async function createLocalCommand(options) {
|
|
|
5570
5550
|
wsUrl: options.wsUrl,
|
|
5571
5551
|
pluginVersion: options.pluginVersion,
|
|
5572
5552
|
openclawPath: options.openclawPath,
|
|
5573
|
-
mergeMode
|
|
5553
|
+
mergeMode,
|
|
5554
|
+
scene: options.scene || "test",
|
|
5555
|
+
model: options.model || "MiniMax-M2.5"
|
|
5574
5556
|
});
|
|
5575
5557
|
debug.log("[初始化] 开始安装...");
|
|
5576
5558
|
await installer.install();
|
|
@@ -5610,7 +5592,7 @@ ${chalk.cyan("Token: ")}${token}`);
|
|
|
5610
5592
|
}
|
|
5611
5593
|
}
|
|
5612
5594
|
function registerCommands(program2) {
|
|
5613
|
-
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", "开启调试日志").action(createLocalCommand);
|
|
5595
|
+
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>", "场景 (test/normal/prd),默认 test").option("--model <model>", `选择模型 (${SUPPORTED_MODELS.join("/")}),默认 ${DEFAULT_MODEL}`).action(createLocalCommand);
|
|
5614
5596
|
}
|
|
5615
5597
|
const __filename$1 = fileURLToPath(import.meta.url);
|
|
5616
5598
|
const __dirname$1 = dirname(__filename$1);
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export default function (): void;
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAeA,MAAM,CAAC,OAAO,cAAc,IAAI,CAU/B"}
|
package/dist/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../src/utils/debug.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAErC,QAAA,MAAM,KAAK,OAAc,CAAA;AAEzB;;GAEG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAE/C;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,OAAO,CAErC;AAED,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/utils/env.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,wBAAgB,QAAQ,IAAI,IAAI,CAmB/B"}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
1
|
+
export { debug, isDebugMode, setDebug } from './debug';
|
|
2
|
+
export { checkEnv } from './env';
|
|
3
|
+
export { createLogger, logger } from './logger';
|
|
4
|
+
export type { Logger } from './logger';
|
|
5
|
+
export { deepMerge, getObjectHash } from './object';
|
|
6
|
+
export { getHomeDir, normalizePath, validateOpenclawPath } from './path';
|
|
7
|
+
export { absolutePathSchema, appKeySchema, appSecretSchema, booleanSchema, EnvironmentSchema, ipv4Schema, isValid, openclawPathSchema, phoneSchema, pluginVersionSchema, userPassSchema, validate, validateWithMessage, windowsPathSchema, withMessage, wsUrlSchema, } from './validate';
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAC/C,YAAY,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACtC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACnD,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAA;AACxE,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,UAAU,EACV,OAAO,EACP,kBAAkB,EAClB,WAAW,EACX,mBAAmB,EACnB,cAAc,EACd,QAAQ,EACR,mBAAmB,EACnB,iBAAiB,EACjB,WAAW,EACX,WAAW,GACZ,MAAM,YAAY,CAAA"}
|
package/dist/utils/logger.d.ts
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
export type LogLevel = 'info' | 'success' | 'warn' | 'error' | 'step';
|
|
1
|
+
export type LogLevel = 'info' | 'success' | 'warn' | 'error' | 'pending' | 'debug' | 'start' | 'complete';
|
|
3
2
|
export interface Logger {
|
|
4
3
|
info: (message: string) => void;
|
|
5
4
|
success: (message: string) => void;
|
|
6
5
|
warn: (message: string) => void;
|
|
7
6
|
error: (message: string) => void;
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
pending: (message: string) => void;
|
|
8
|
+
debug: (message: string) => void;
|
|
9
|
+
start: (message: string) => void;
|
|
10
|
+
complete: (message: string) => void;
|
|
10
11
|
}
|
|
11
|
-
/**
|
|
12
|
-
* 创建日志记录器
|
|
13
|
-
*/
|
|
14
12
|
export declare function createLogger(): Logger;
|
|
15
13
|
export declare const logger: Logger;
|
|
16
14
|
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,GAAG,UAAU,CAAA;AAEzG,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/B,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/B,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CACpC;AAED,wBAAgB,YAAY,IAAI,MAAM,CAkCrC;AAED,eAAO,MAAM,MAAM,QAAiB,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 计算对象的稳定哈希值,用于数组去重比较
|
|
3
|
+
* @param obj - 任意对象
|
|
4
|
+
* @returns 对象的字符串哈希
|
|
5
|
+
*/
|
|
6
|
+
export declare function getObjectHash(obj: unknown): string;
|
|
7
|
+
/**
|
|
8
|
+
* 深度合并两个对象
|
|
9
|
+
* - 对象数组:根据内容哈希去重后追加
|
|
10
|
+
* - 简单值数组:使用 Set 去重合并
|
|
11
|
+
* - 对象:递归深度合并
|
|
12
|
+
* - 其他类型:source 覆盖 target
|
|
13
|
+
* @param target - 目标对象
|
|
14
|
+
* @param source - 源对象
|
|
15
|
+
* @returns 合并后的新对象
|
|
16
|
+
*/
|
|
17
|
+
export declare function deepMerge<T extends Record<string, unknown>>(target: T, source: Partial<T>): T;
|
|
18
|
+
//# sourceMappingURL=object.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../src/utils/object.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAElD;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CA2C7F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../src/utils/path.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,wBAAgB,UAAU,IAAI,MAAM,CAEnC;AAYD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAIvD;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAU/D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/utils/validate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;EAE5B,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,WAErB,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,aAEtB,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,aAEzB,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,aAEvB,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,aAE1B,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,aAO9B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,aAK7B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,6CAA4C,CAAA;AAE3E;;GAEG;AACH,eAAO,MAAM,mBAAmB,4BAAwB,CAAA;AAExD;;GAEG;AACH,eAAO,MAAM,WAAW,4BAEX,CAAA;AAEb;;GAEG;AACH,eAAO,MAAM,aAAa,cAAc,CAAA;AAExC;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,EAChD,MAAM,EAAE,CAAC,EACT,OAAO,EAAE,MAAM,GACd,CAAC,CAIH;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,EAC7C,MAAM,EAAE,CAAC,EACT,KAAK,EAAE,OAAO,GACb,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAK7B;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,EAC5C,MAAM,EAAE,CAAC,EACT,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAErB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,EACxD,MAAM,EAAE,CAAC,EACT,KAAK,EAAE,OAAO,GACb;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CASxC"}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/box/configs/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../src/box/configs/model.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB;;;;;;;;;;;CAMhC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/box/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const SUPPORTED_MODELS: readonly ["gpt-4.1-mini", "gpt-4o-mini", "gpt-5-chat", "gpt-5-mini"];
|
|
2
|
-
export type ModelType = typeof SUPPORTED_MODELS[number];
|
|
3
|
-
export declare const DEFAULT_MODEL: ModelType;
|
|
4
|
-
export declare const MODEL_ID_MAP: Record<ModelType, {
|
|
5
|
-
id: string;
|
|
6
|
-
name: string;
|
|
7
|
-
}>;
|
|
8
|
-
export declare const DEFAULT_PROVIDER = "siliconflow-minimax";
|
|
9
|
-
//# sourceMappingURL=model.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../src/box/constants/model.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,sEAKnB,CAAA;AAEV,MAAM,MAAM,SAAS,GAAG,OAAO,gBAAgB,CAAC,MAAM,CAAC,CAAA;AAEvD,eAAO,MAAM,aAAa,EAAE,SAAwB,CAAA;AAEpD,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,SAAS,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAKxE,CAAA;AAED,eAAO,MAAM,gBAAgB,wBAAwB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/box/error/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;CAWd,CAAA;AAEV,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,WAAW,CAAA;AAEhD;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAWpD,CAAA;AAED;;GAEG;AACH,qBAAa,QAAS,SAAQ,KAAK;IAExB,IAAI,EAAE,SAAS;gBAAf,IAAI,EAAE,SAAS,EACtB,OAAO,EAAE,MAAM;CAKlB;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAUlD"}
|
package/dist/box/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/box/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAIxC,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAcvD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/box/installer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"installer.d.ts","sourceRoot":"","sources":["../../../src/box/installer/installer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAgB,MAAM,UAAU,CAAA;AAiFhE,qBAAa,YAAY;IAIX,OAAO,CAAC,MAAM;IAH1B,OAAO,CAAC,OAAO,CAAK;IACpB,OAAO,CAAC,UAAU,CAAa;gBAEX,MAAM,EAAE,kBAAkB;IAI9C,cAAc,IAAI,IAAI;IAyBtB,OAAO,CAAC,QAAQ;IAoChB,OAAO,CAAC,aAAa;IAMrB,aAAa,IAAI,MAAM;IAIvB,OAAO,CAAC,cAAc;IAOhB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;YA0BhB,eAAe;YA0Bf,iBAAiB;YAoHjB,cAAc;CA6R7B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"box.d.ts","sourceRoot":"","sources":["../../../src/box/src/box.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAU1C;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CA+KzE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/box/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAWvB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAE7C,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;;;GAGG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;iBAqBpC,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAEzE,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"}
|