@delta-infra/cli 1.0.92 → 1.0.94
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
CHANGED
|
@@ -131,7 +131,7 @@ go install github.com/delta-infra/delta-infra-cli/cmd/delta-cli@latest
|
|
|
131
131
|
delta-cli config init
|
|
132
132
|
```
|
|
133
133
|
|
|
134
|
-
执行时会交互式提示输入服务端地址(默认:`https://delta-infra-nacos
|
|
134
|
+
执行时会交互式提示输入服务端地址(默认:`https://delta-infra-nacos.yangtzeailab.com`)以及 Bearer Token(可选,也可后续用 `auth login` 配置)。
|
|
135
135
|
|
|
136
136
|
非交互式环境(如 CI)会直接使用默认值,也可以通过 flag 或环境变量一次性指定:
|
|
137
137
|
|
|
@@ -258,9 +258,8 @@ delta-cli sandbox kill <sandbox_id>
|
|
|
258
258
|
|
|
259
259
|
### Science 工具
|
|
260
260
|
|
|
261
|
-
>
|
|
262
|
-
> `
|
|
263
|
-
> `DELTA_INFRA_SCIENCE_BASE_URL` 覆盖。
|
|
261
|
+
> Science Server 由 `base_url` 派生(`{base_url}/science_tool`),无需单独配置
|
|
262
|
+
> `science_base_url`;Sandbox API 同样由 `base_url` 派生(`{base_url}/sandbox/api/v1`)。
|
|
264
263
|
|
|
265
264
|
| 命令 | 说明 |
|
|
266
265
|
|------|------|
|
package/checksums.txt
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
1a680424f9d53ec58263ca23f8b4e55404929cabc4e2313dc562325f684480f4 delta-cli-darwin-amd64.tar.gz
|
|
2
|
+
da0d075b7fe9890449ff437159c52a741ba5eeb1f74d1adebdb4f432b8fafb27 delta-cli-darwin-arm64.tar.gz
|
|
3
|
+
ff5c95b561247352645db84688d9694e0198b79203223b2b9d50189e1305dd25 delta-cli-linux-amd64.tar.gz
|
|
4
|
+
d0cd2aa31ee177ec35e242674c822767f901b6d861c4da753c7cf3fd83b44877 delta-cli-linux-arm64.tar.gz
|
|
5
|
+
65984f247a4c45b44b29a905cf051c8fa19dc629eafc9cddc2e1a6eedfd2a52e delta-cli-windows-amd64.zip
|
package/package.json
CHANGED
|
@@ -13,9 +13,7 @@ const NPM_REGISTRIES = ["https://registry.npmmirror.com", "https://registry.npmj
|
|
|
13
13
|
const GH_MIRRORS = ["https://gh.ddlc.top", "https://ghproxy.net", "https://gh-proxy.com"];
|
|
14
14
|
const CONFIG_DIR = path.join(osHomedir(), ".delta-infra");
|
|
15
15
|
const CONFIG_VERSION = 1;
|
|
16
|
-
const DEFAULT_BASE_URL = "https://delta-infra-nacos
|
|
17
|
-
const DEFAULT_SCIENCE_BASE_URL = "http://8.141.101.94:8080/science_tool";
|
|
18
|
-
const DASHBOARD_API_KEYS_URL = "https://delta-infra-dashboard-test.yangtzeailab.com/dashboard/api-keys";
|
|
16
|
+
const DEFAULT_BASE_URL = "https://delta-infra-nacos.yangtzeailab.com";
|
|
19
17
|
const isWindows = process.platform === "win32";
|
|
20
18
|
|
|
21
19
|
const PLATFORM_PATHS = {
|
|
@@ -131,8 +129,7 @@ const messages = {
|
|
|
131
129
|
step2Skip: "已安装,跳过",
|
|
132
130
|
step2Fail: "Skills 安装失败。运行以下命令重试: npx skills add %s -y -g",
|
|
133
131
|
step3: "正在初始化配置...",
|
|
134
|
-
step3BaseUrl: "
|
|
135
|
-
step3ScienceUrl:"Science API 地址",
|
|
132
|
+
step3BaseUrl: "Delta Infra 服务器地址",
|
|
136
133
|
step3Skip: "跳过配置初始化",
|
|
137
134
|
step3Done: "配置已初始化",
|
|
138
135
|
step3Fail: "配置初始化失败。运行以下命令重试: delta-cli config init",
|
|
@@ -145,7 +142,7 @@ const messages = {
|
|
|
145
142
|
step4Fail: "认证失败。运行以下命令重试: delta-cli auth login",
|
|
146
143
|
done: "安装完成!\n现在可以让你的 AI 工具使用 delta-cli 管理 Delta Sandbox 资源或调用 Science 工具。",
|
|
147
144
|
cancelled: "安装已取消",
|
|
148
|
-
nonTtyHint: "要完成配置,请在终端中运行:\n delta-cli config init\n delta-cli auth login\n若还没有 API Key,请先在网页端生成:\n "
|
|
145
|
+
nonTtyHint: "要完成配置,请在终端中运行:\n delta-cli config init\n delta-cli auth login\n若还没有 API Key,请先在网页端生成:\n %s",
|
|
149
146
|
uninstallConfirm: "将移除全局包、AI Skills 和配置文件。是否继续?",
|
|
150
147
|
uninstallCancelled: "卸载已取消",
|
|
151
148
|
uninstallDone: "卸载完成",
|
|
@@ -167,8 +164,7 @@ const messages = {
|
|
|
167
164
|
step2Skip: "Already installed. Skipped",
|
|
168
165
|
step2Fail: "Failed to install skills. Run manually: npx skills add %s -y -g",
|
|
169
166
|
step3: "Initializing config...",
|
|
170
|
-
step3BaseUrl: "
|
|
171
|
-
step3ScienceUrl:"Science API URL",
|
|
167
|
+
step3BaseUrl: "Delta Infra server URL",
|
|
172
168
|
step3Skip: "Skipped config initialization",
|
|
173
169
|
step3Done: "Config initialized",
|
|
174
170
|
step3Fail: "Failed to init config. Run manually: delta-cli config init",
|
|
@@ -181,7 +177,7 @@ const messages = {
|
|
|
181
177
|
step4Fail: "Failed to authorize. Run delta-cli auth login to retry",
|
|
182
178
|
done: "You are all set!\nYour AI tool can now use delta-cli to manage Delta Sandbox resources or invoke Science tools.",
|
|
183
179
|
cancelled: "Installation cancelled",
|
|
184
|
-
nonTtyHint: "To complete setup, run interactively:\n delta-cli config init\n delta-cli auth login\nIf you don't have an API key yet, generate one first:\n "
|
|
180
|
+
nonTtyHint: "To complete setup, run interactively:\n delta-cli config init\n delta-cli auth login\nIf you don't have an API key yet, generate one first:\n %s",
|
|
185
181
|
uninstallConfirm: "This will remove the global package, AI Skills and config. Continue?",
|
|
186
182
|
uninstallCancelled: "Uninstall cancelled",
|
|
187
183
|
uninstallDone: "Uninstall complete",
|
|
@@ -240,6 +236,15 @@ function fmt(template, ...values) {
|
|
|
240
236
|
return template.replace(/%s/g, () => values[i++] ?? "");
|
|
241
237
|
}
|
|
242
238
|
|
|
239
|
+
// Choose the API-key management page for a base URL: the production dashboard
|
|
240
|
+
// for the main host, the test dashboard otherwise.
|
|
241
|
+
function dashboardAPIKeysUrl(baseUrl) {
|
|
242
|
+
const mainHost = "delta-infra-nacos.yangtzeailab.com";
|
|
243
|
+
const mainDashboard = "https://delta-infra-dashboard.yangtzeailab.com/dashboard/api-keys";
|
|
244
|
+
const testDashboard = "https://delta-infra-dashboard-test.yangtzeailab.com/dashboard/api-keys";
|
|
245
|
+
return String(baseUrl || "").includes(mainHost) ? mainDashboard : testDashboard;
|
|
246
|
+
}
|
|
247
|
+
|
|
243
248
|
function formatExecErr(err) {
|
|
244
249
|
if (!err) return "";
|
|
245
250
|
if (err.stderr) return err.stderr.toString().trim();
|
|
@@ -323,12 +328,11 @@ function getExistingConfig() {
|
|
|
323
328
|
} catch { return null; }
|
|
324
329
|
}
|
|
325
330
|
|
|
326
|
-
function writeConfig({ baseUrl,
|
|
331
|
+
function writeConfig({ baseUrl, existing = null } = {}) {
|
|
327
332
|
fs.mkdirSync(CONFIG_DIR, { recursive: true });
|
|
328
333
|
const config = {
|
|
329
334
|
version: CONFIG_VERSION,
|
|
330
335
|
base_url: baseUrl || DEFAULT_BASE_URL,
|
|
331
|
-
science_base_url: scienceUrl || existing?.science_base_url || DEFAULT_SCIENCE_BASE_URL,
|
|
332
336
|
};
|
|
333
337
|
if (existing && existing.token) {
|
|
334
338
|
config.token = existing.token;
|
|
@@ -529,15 +533,8 @@ async function stepConfigInit(msg) {
|
|
|
529
533
|
: DEFAULT_BASE_URL,
|
|
530
534
|
}), msg);
|
|
531
535
|
|
|
532
|
-
const scienceUrl = handleCancel(await p.text({
|
|
533
|
-
message: msg.step3ScienceUrl,
|
|
534
|
-
initialValue: existingConfig && existingConfig.science_base_url
|
|
535
|
-
? existingConfig.science_base_url
|
|
536
|
-
: DEFAULT_SCIENCE_BASE_URL,
|
|
537
|
-
}), msg);
|
|
538
|
-
|
|
539
536
|
try {
|
|
540
|
-
writeConfig({ baseUrl,
|
|
537
|
+
writeConfig({ baseUrl, existing: existingConfig });
|
|
541
538
|
p.log.success(msg.step3Done);
|
|
542
539
|
} catch (e) {
|
|
543
540
|
p.log.error(e.message || String(e));
|
|
@@ -567,7 +564,8 @@ async function stepAuthLogin(msg) {
|
|
|
567
564
|
|
|
568
565
|
p.log.step(msg.step4);
|
|
569
566
|
p.log.warn(msg.step4GuideTitle);
|
|
570
|
-
|
|
567
|
+
const existing = getExistingConfig();
|
|
568
|
+
p.log.info(fmt(msg.step4Guide, dashboardAPIKeysUrl(existing && existing.base_url)));
|
|
571
569
|
try {
|
|
572
570
|
run(deltaCli, ["auth", "login"]);
|
|
573
571
|
p.log.success(msg.step4Done);
|
|
@@ -655,7 +653,8 @@ async function doInstall() {
|
|
|
655
653
|
await stepInstallGlobally(msg);
|
|
656
654
|
const platforms = ["agents"];
|
|
657
655
|
await stepInstallSkills(msg, platforms);
|
|
658
|
-
|
|
656
|
+
const existing = getExistingConfig();
|
|
657
|
+
console.log(fmt(msg.nonTtyHint, dashboardAPIKeysUrl(existing && existing.base_url)));
|
|
659
658
|
}
|
|
660
659
|
}
|
|
661
660
|
|
|
@@ -16,8 +16,8 @@ Skill;工具选择、operation、参数、跨工具交接和结果校验都在
|
|
|
16
16
|
|
|
17
17
|
- 所有在线 Science 操作最终都经
|
|
18
18
|
`delta-cli science invoke -> Science Server`。
|
|
19
|
-
- 使用 CLI 的标准认证与 `
|
|
20
|
-
改写服务路由。
|
|
19
|
+
- 使用 CLI 的标准认证与 `base_url` 派生出的 Science 服务地址(`{base_url}/science_tool`)。
|
|
20
|
+
不得通过环境变量、命令参数或业务 URL 改写服务路由。
|
|
21
21
|
- 禁止使用 `curl`、`requests`、`httpx`、浏览器和 PowerShell Web 命令直接访问公司网关或
|
|
22
22
|
业务服务 URL。
|
|
23
23
|
- 不得将本地 RDKit、pymatgen、LAMMPS、BO、回归或 sandbox 结果冒充为 Science 结果。
|
|
@@ -13,8 +13,8 @@ delta-cli science invoke --tool TOOL --endpoint ENDPOINT --data JSON
|
|
|
13
13
|
仅当 operation 文档明确要求查询参数时使用 `--params JSON`。不要同时传递 `--data` 和
|
|
14
14
|
`--params`,也不要改用 `curl`、`httpx`、`requests`、`Invoke-RestMethod` 或业务服务 URL。
|
|
15
15
|
|
|
16
|
-
CLI
|
|
17
|
-
|
|
16
|
+
CLI 使用其标准认证和由 `base_url` 派生出的 Science 服务地址(`{base_url}/science_tool`)。
|
|
17
|
+
Skill 不得通过环境变量、命令参数或临时配置改写服务路由,也不读取、修改或伪造凭据。
|
|
18
18
|
|
|
19
19
|
## 成功与结果
|
|
20
20
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# SynBO operation 参考
|
|
2
2
|
|
|
3
3
|
所有在线调用都通过 `delta-cli science invoke`,服务地址来自 CLI 的标准
|
|
4
|
-
`
|
|
4
|
+
`base_url` 派生配置(`{base_url}/science_tool`)。这里的路径只说明业务 operation,不得据此直连 HTTP。
|
|
5
5
|
|
|
6
6
|
用户说“优化反应条件”“推荐下一批实验”“偶联反应怎么继续做”,或给出溶剂、温度、
|
|
7
7
|
催化剂、碱、配体和历史得率时,即使没有提到 SynBO、BO、CLI 或字段名也使用本节。
|