@delta-infra/cli 1.0.71 → 1.0.73
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/README.md +5 -1
- package/checksums.txt +5 -5
- package/package.json +1 -1
- package/scripts/install-wizard.js +31 -10
package/README.md
CHANGED
|
@@ -283,11 +283,15 @@ npx skills add delta-infra/delta-infra-cli -s delta-shared
|
|
|
283
283
|
|
|
284
284
|
# 安装 sandbox 操作技能
|
|
285
285
|
npx skills add delta-infra/delta-infra-cli -s delta-sandbox
|
|
286
|
+
|
|
287
|
+
# 安装 science 工具操作技能
|
|
288
|
+
npx skills add delta-infra/delta-infra-cli -s delta-science
|
|
286
289
|
```
|
|
287
290
|
|
|
288
291
|
Skill 文件位于 `skills/` 目录:
|
|
289
292
|
- `delta-shared/` — 全局通用规则(认证、配置、错误处理)
|
|
290
293
|
- `delta-sandbox/` — Sandbox 操作指南(生命周期、命令路由)
|
|
294
|
+
- `delta-science/` — Science 工具调用指南(secondary API、invoke、endpoints)
|
|
291
295
|
|
|
292
296
|
## 开发
|
|
293
297
|
|
|
@@ -375,7 +379,7 @@ make release
|
|
|
375
379
|
```bash
|
|
376
380
|
export GH_TOKEN=<your-github-pat>
|
|
377
381
|
export NPM_TOKEN=<your-npm-token>
|
|
378
|
-
./release.sh v1.0.
|
|
382
|
+
./release.sh v1.0.73
|
|
379
383
|
```
|
|
380
384
|
|
|
381
385
|
脚本执行步骤:
|
package/checksums.txt
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
8876ead6e40e32d66f031b0803093c36d2cab9caac736de386a98e1b3ec0ef6d delta-cli-darwin-amd64.tar.gz
|
|
2
|
+
593093e731ad55f1faaa8375ddd27e82c397bc7e26ec325994af53c5ce99887c delta-cli-darwin-arm64.tar.gz
|
|
3
|
+
99242ae51327ee64ab7a6f57812f03286e99dd57752dd314eeb7d00a3b0a1a28 delta-cli-linux-amd64.tar.gz
|
|
4
|
+
e39b2bd0ec5d5a16da22b8293e66559ee837c60573f64d808bfa2fc6eecff3f7 delta-cli-linux-arm64.tar.gz
|
|
5
|
+
bb78c56e5455ca5e880c6267bd201b5f9e25586246ae63fab28b3541c8e72581 delta-cli-windows-amd64.zip
|
package/package.json
CHANGED
|
@@ -14,6 +14,7 @@ const GH_MIRRORS = ["https://gh.ddlc.top", "https://ghproxy.net", "https://gh-pr
|
|
|
14
14
|
const CONFIG_DIR = path.join(osHomedir(), ".delta-infra");
|
|
15
15
|
const CONFIG_VERSION = 1;
|
|
16
16
|
const DEFAULT_BASE_URL = "https://delta-infra-nacos-test.yangtzeailab.com/sandbox/api/v1";
|
|
17
|
+
const DEFAULT_SCIENCE_BASE_URL = "http://8.141.101.94:8080/science_tool";
|
|
17
18
|
const isWindows = process.platform === "win32";
|
|
18
19
|
|
|
19
20
|
const PLATFORM_PATHS = {
|
|
@@ -41,7 +42,7 @@ const PLATFORM_LABELS = {
|
|
|
41
42
|
},
|
|
42
43
|
};
|
|
43
44
|
|
|
44
|
-
const SKILL_NAMES = ["delta-sandbox", "delta-shared"];
|
|
45
|
+
const SKILL_NAMES = ["delta-sandbox", "delta-shared", "delta-science"];
|
|
45
46
|
const LANG = "zh";
|
|
46
47
|
|
|
47
48
|
function platformSkillDir(platform) {
|
|
@@ -67,6 +68,8 @@ const messages = {
|
|
|
67
68
|
step2Skip: "已安装,跳过",
|
|
68
69
|
step2Fail: "Skills 安装失败。运行以下命令重试: npx skills add %s -y -g",
|
|
69
70
|
step3: "正在初始化配置...",
|
|
71
|
+
step3BaseUrl: "Sandbox API 地址",
|
|
72
|
+
step3ScienceUrl:"Science API 地址",
|
|
70
73
|
step3Skip: "跳过配置初始化",
|
|
71
74
|
step3Done: "配置已初始化",
|
|
72
75
|
step3Fail: "配置初始化失败。运行以下命令重试: delta-cli config init",
|
|
@@ -95,6 +98,8 @@ const messages = {
|
|
|
95
98
|
step2Skip: "Already installed. Skipped",
|
|
96
99
|
step2Fail: "Failed to install skills. Run manually: npx skills add %s -y -g",
|
|
97
100
|
step3: "Initializing config...",
|
|
101
|
+
step3BaseUrl: "Sandbox API URL",
|
|
102
|
+
step3ScienceUrl:"Science API URL",
|
|
98
103
|
step3Skip: "Skipped config initialization",
|
|
99
104
|
step3Done: "Config initialized",
|
|
100
105
|
step3Fail: "Failed to init config. Run manually: delta-cli config init",
|
|
@@ -236,18 +241,20 @@ function getExistingConfig() {
|
|
|
236
241
|
} catch { return null; }
|
|
237
242
|
}
|
|
238
243
|
|
|
239
|
-
function
|
|
244
|
+
function writeConfig({ baseUrl, scienceUrl, existing = null } = {}) {
|
|
240
245
|
fs.mkdirSync(CONFIG_DIR, { recursive: true });
|
|
241
246
|
const config = {
|
|
242
247
|
version: CONFIG_VERSION,
|
|
243
|
-
base_url: DEFAULT_BASE_URL,
|
|
248
|
+
base_url: baseUrl || DEFAULT_BASE_URL,
|
|
244
249
|
};
|
|
250
|
+
if (scienceUrl) {
|
|
251
|
+
config.science_base_url = scienceUrl;
|
|
252
|
+
} else if (existing && existing.science_base_url) {
|
|
253
|
+
config.science_base_url = existing.science_base_url;
|
|
254
|
+
}
|
|
245
255
|
if (existing && existing.token) {
|
|
246
256
|
config.token = existing.token;
|
|
247
257
|
}
|
|
248
|
-
if (existing && existing.science_base_url) {
|
|
249
|
-
config.science_base_url = existing.science_base_url;
|
|
250
|
-
}
|
|
251
258
|
fs.writeFileSync(path.join(CONFIG_DIR, "config.json"), JSON.stringify(config, null, 2) + "\n", { mode: 0o600 });
|
|
252
259
|
}
|
|
253
260
|
|
|
@@ -411,9 +418,9 @@ async function stepConfigInit(msg) {
|
|
|
411
418
|
s.start(msg.step3);
|
|
412
419
|
|
|
413
420
|
const existingConfig = getExistingConfig();
|
|
421
|
+
s.stop(msg.step3);
|
|
414
422
|
|
|
415
423
|
if (existingConfig && existingConfig.base_url) {
|
|
416
|
-
s.stop(msg.step3);
|
|
417
424
|
const reuse = await p.confirm({
|
|
418
425
|
message: `发现已有配置 (Server: ${existingConfig.base_url}),继续使用?`,
|
|
419
426
|
});
|
|
@@ -427,12 +434,26 @@ async function stepConfigInit(msg) {
|
|
|
427
434
|
}
|
|
428
435
|
}
|
|
429
436
|
|
|
437
|
+
const baseUrl = handleCancel(await p.text({
|
|
438
|
+
message: msg.step3BaseUrl,
|
|
439
|
+
initialValue: existingConfig && existingConfig.base_url
|
|
440
|
+
? existingConfig.base_url
|
|
441
|
+
: DEFAULT_BASE_URL,
|
|
442
|
+
}), msg);
|
|
443
|
+
|
|
444
|
+
const scienceUrl = handleCancel(await p.text({
|
|
445
|
+
message: msg.step3ScienceUrl,
|
|
446
|
+
initialValue: existingConfig && existingConfig.science_base_url
|
|
447
|
+
? existingConfig.science_base_url
|
|
448
|
+
: DEFAULT_SCIENCE_BASE_URL,
|
|
449
|
+
}), msg);
|
|
450
|
+
|
|
430
451
|
try {
|
|
431
|
-
|
|
432
|
-
|
|
452
|
+
writeConfig({ baseUrl, scienceUrl, existing: existingConfig });
|
|
453
|
+
p.log.success(msg.step3Done);
|
|
433
454
|
} catch (e) {
|
|
434
|
-
s.stop(msg.step3Fail);
|
|
435
455
|
p.log.error(e.message || String(e));
|
|
456
|
+
p.log.error(msg.step3Fail);
|
|
436
457
|
process.exit(1);
|
|
437
458
|
}
|
|
438
459
|
}
|