@workclaw/cli 1.0.338 → 1.0.339
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/index.d.ts.map +1 -1
- package/dist/commands/box/installer/installer.d.ts.map +1 -1
- package/dist/commands/box/schemas/index.d.ts +4 -0
- package/dist/commands/box/schemas/index.d.ts.map +1 -1
- package/dist/commands/box/src/box.d.ts.map +1 -1
- package/dist/commands/box/types/index.d.ts +4 -0
- package/dist/commands/box/types/index.d.ts.map +1 -1
- package/dist/{index-BQCrObL2.js → index-BduXJlOA.js} +12 -4
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/box/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAIxC,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/box/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAIxC,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAevD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installer.d.ts","sourceRoot":"","sources":["../../../../src/commands/box/installer/installer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAgB,MAAM,UAAU,CAAA;AA4BhE,qBAAa,YAAY;IAIX,OAAO,CAAC,cAAc;IAHlC,OAAO,CAAC,OAAO,CAAK;IACpB,OAAO,CAAC,UAAU,CAAa;gBAEX,cAAc,EAAE,kBAAkB;IAItD,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;
|
|
1
|
+
{"version":3,"file":"installer.d.ts","sourceRoot":"","sources":["../../../../src/commands/box/installer/installer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAgB,MAAM,UAAU,CAAA;AA4BhE,qBAAa,YAAY;IAIX,OAAO,CAAC,cAAc;IAHlC,OAAO,CAAC,OAAO,CAAK;IACpB,OAAO,CAAC,UAAU,CAAa;gBAEX,cAAc,EAAE,kBAAkB;IAItD,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;CAmS7B"}
|
|
@@ -23,6 +23,10 @@ export declare const BoxInstallerConfigSchema: z.ZodObject<{
|
|
|
23
23
|
merge: "merge";
|
|
24
24
|
"reset-keys": "reset-keys";
|
|
25
25
|
}>>>;
|
|
26
|
+
scene: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
27
|
+
test: "test";
|
|
28
|
+
production: "production";
|
|
29
|
+
}>>>;
|
|
26
30
|
}, z.core.$strip>;
|
|
27
31
|
export type BoxInstallerConfig = z.infer<typeof BoxInstallerConfigSchema>;
|
|
28
32
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/box/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAYvB;;;GAGG;AACH,eAAO,MAAM,wBAAwB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/box/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAYvB;;;GAGG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;iBAsBpC,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,CAsLzE"}
|
|
@@ -3,6 +3,9 @@ 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;
|
|
6
9
|
export declare const DEFAULT_MERGE_MODE: 'merge' | 'replace' | 'reset-keys';
|
|
7
10
|
export interface BoxOptions {
|
|
8
11
|
env?: string;
|
|
@@ -15,6 +18,7 @@ export interface BoxOptions {
|
|
|
15
18
|
debug?: boolean;
|
|
16
19
|
model?: ModelType;
|
|
17
20
|
mergeMode?: 'merge' | 'replace' | 'reset-keys';
|
|
21
|
+
scene?: SceneType;
|
|
18
22
|
}
|
|
19
23
|
export interface InstallResult {
|
|
20
24
|
success: boolean;
|
|
@@ -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,eAAO,MAAM,kBAAkB,EAAE,OAAO,GAAG,SAAS,GAAG,YAAsB,CAAA;AAE7E,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;
|
|
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,CA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$1 = "MiniMax-M2.5";
|
|
|
232
232
|
const MODEL_NAME_MAP$1 = {
|
|
233
233
|
"MiniMax-M2.5": "MiniMax-M2.5"
|
|
234
234
|
};
|
|
235
|
+
const SUPPORTED_SCENES$1 = [
|
|
236
|
+
"test",
|
|
237
|
+
"production"
|
|
238
|
+
];
|
|
239
|
+
const DEFAULT_SCENE$1 = "production";
|
|
235
240
|
const DEFAULT_MERGE_MODE$1 = "merge";
|
|
236
241
|
const MODEL_GENERAL_CONFIG$1 = {
|
|
237
242
|
reasoning: false,
|
|
@@ -706,7 +711,8 @@ class BoxInstaller {
|
|
|
706
711
|
[envConfig.PLUGIN_NAME]: {
|
|
707
712
|
source: "npm",
|
|
708
713
|
spec: PLUGIN_PACKAGE_NAME$1,
|
|
709
|
-
installPath: paths.target
|
|
714
|
+
installPath: paths.target,
|
|
715
|
+
scene: this.installOptions.scene || DEFAULT_SCENE$1
|
|
710
716
|
}
|
|
711
717
|
},
|
|
712
718
|
entries: {
|
|
@@ -840,10 +846,11 @@ async function createBoxCommand(options) {
|
|
|
840
846
|
debug.log(`[盒子安装] 使用命令行参数: customIp=${customIp}`);
|
|
841
847
|
}
|
|
842
848
|
const mergeMode = options.mergeMode || DEFAULT_MERGE_MODE$1;
|
|
849
|
+
const scene = options.scene || DEFAULT_SCENE$1;
|
|
843
850
|
if (!appKey || !appSecret) {
|
|
844
851
|
throw new Error("AppKey 和 AppSecret 不能为空");
|
|
845
852
|
}
|
|
846
|
-
debug.log(`[盒子安装] 最终参数: env=${env}, customIp=${customIp}, openclawPath=${options.openclawPath}, model=${model}, mergeMode=${mergeMode}`);
|
|
853
|
+
debug.log(`[盒子安装] 最终参数: env=${env}, customIp=${customIp}, openclawPath=${options.openclawPath}, model=${model}, mergeMode=${mergeMode}, scene=${scene}`);
|
|
847
854
|
debug.log("[盒子安装] 创建 BoxInstaller 实例...");
|
|
848
855
|
const installer = new BoxInstaller({
|
|
849
856
|
appKey,
|
|
@@ -854,7 +861,8 @@ async function createBoxCommand(options) {
|
|
|
854
861
|
pluginVersion: options.pluginVersion,
|
|
855
862
|
openclawPath: options.openclawPath,
|
|
856
863
|
model,
|
|
857
|
-
mergeMode
|
|
864
|
+
mergeMode,
|
|
865
|
+
scene
|
|
858
866
|
});
|
|
859
867
|
debug.log("[盒子安装] 开始安装...");
|
|
860
868
|
await installer.install();
|
|
@@ -889,7 +897,7 @@ async function createBoxCommand(options) {
|
|
|
889
897
|
}
|
|
890
898
|
}
|
|
891
899
|
function registerCommands$1(program2) {
|
|
892
|
-
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);
|
|
900
|
+
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("--scene <scene>", `场景 (${SUPPORTED_SCENES$1.join("/")}),控制 plugin 日志输出,默认 ${DEFAULT_SCENE$1}`).option("--debug", "开启调试日志").action(createBoxCommand);
|
|
893
901
|
}
|
|
894
902
|
function createHttpClient(baseURL) {
|
|
895
903
|
return axios.create({
|
package/dist/index.js
CHANGED