@delta-infra/cli 1.0.97 → 1.0.99
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 +473 -471
- package/checksums.txt +5 -5
- package/package.json +2 -2
- package/scripts/install-wizard.js +701 -701
- package/scripts/install.js +442 -442
- package/scripts/run.js +65 -65
- package/skills/delta-sandbox/SKILL.md +382 -356
- package/skills/delta-sandbox/agents/openai.yaml +4 -4
- package/skills/delta-sandbox/references/commands.md +58 -56
- package/skills/delta-sandbox/references/lifecycle.md +100 -92
- package/skills/delta-sandbox/references/recipes.md +138 -133
- package/skills/delta-science/AGENTS.md +46 -49
- package/skills/delta-science/SKILL.md +130 -131
- package/skills/delta-science/agents/openai.yaml +4 -4
- package/skills/delta-science/references/antbo.md +100 -100
- package/skills/delta-science/references/delta-bo.md +89 -89
- package/skills/delta-science/references/gsasii.md +116 -116
- package/skills/delta-science/references/lammps.md +66 -66
- package/skills/delta-science/references/ldm-bo.md +129 -129
- package/skills/delta-science/references/pubchem.md +126 -126
- package/skills/delta-science/references/pymatgen.md +68 -68
- package/skills/delta-science/references/{qe-dft.md → qe.md} +4 -4
- package/skills/delta-science/references/rdkit.md +138 -138
- package/skills/delta-science/references/strbo.md +87 -87
- package/skills/delta-science/references/synbo.md +198 -198
- package/skills/delta-science/scripts/catalog.py +92 -92
- package/skills/delta-science/scripts/generated_catalog.py +69 -69
- package/skills/delta-science/scripts/invoke.py +302 -302
- package/skills/delta-shared/SKILL.md +97 -95
- package/skills/delta-shared/agents/openai.yaml +4 -4
- package/skills/manifest.json +19 -19
- package/skills/delta-science/references/cli-contract.md +0 -53
- package/skills/delta-science/references/generated-catalog.md +0 -48
- package/skills/delta-science/references/ldm.md +0 -73
- package/skills/delta-science/references/molecule-enrich.md +0 -59
- package/skills/delta-science/references/operation-contracts.md +0 -137
- package/skills/delta-science/references/routing-index.md +0 -45
- package/skills/delta-science/references/services.md +0 -112
- package/skills/delta-science/references/workflows.md +0 -98
|
@@ -1,95 +1,97 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: delta-shared
|
|
3
|
-
description: "delta-cli 全局共享规则:配置/认证检查、安全红线、错误处理、sandbox 销毁。"
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# delta-cli 共享规则
|
|
7
|
-
|
|
8
|
-
指导 AI 使用 `delta-cli` 的通用规则。核心原则:**只检查、不猜测、不泄露密钥**。
|
|
9
|
-
|
|
10
|
-
## 执行任何操作之前
|
|
11
|
-
|
|
12
|
-
1. 确认服务端地址:
|
|
13
|
-
```bash
|
|
14
|
-
delta-cli config show
|
|
15
|
-
```
|
|
16
|
-
2. 确认认证状态:
|
|
17
|
-
```bash
|
|
18
|
-
delta-cli auth status
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
- 若 `auth status` 显示 `method: token`,**直接执行目标命令**,不要重复登录或初始化配置。
|
|
22
|
-
- 若显示 `method: none`,或操作返回 `error.type: auth` / `permission`,才进入下面的“补全配置”流程。
|
|
23
|
-
|
|
24
|
-
## 补全配置
|
|
25
|
-
|
|
26
|
-
缺少服务端地址或凭证时,**向用户询问一次**,然后用 flag 初始化:
|
|
27
|
-
|
|
28
|
-
```bash
|
|
29
|
-
delta-cli config init --base-url <server-url> --token <token>
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
不要用交互式 `config init`(无 flag),避免在 stdin 不可用时卡住。
|
|
33
|
-
|
|
34
|
-
### 信息来源优先级
|
|
35
|
-
|
|
36
|
-
1. 环境变量:`DELTA_INFRA_BASE_URL`、`DELTA_INFRA_TOKEN`
|
|
37
|
-
2. `~/.delta-infra/config.json` 中的 `base_url` / `token`
|
|
38
|
-
3. 默认值:仅 `base_url` 有内部默认值
|
|
39
|
-
4. 以上都缺失时,**必须询问用户**,禁止虚构
|
|
40
|
-
|
|
41
|
-
### 运行时凭证
|
|
42
|
-
|
|
43
|
-
CLI 使用 `token` 发送请求头 `Authorization: Bearer <token>`,并自动从 JWT 中提取 `uid` 作为 `X-User-Uid`。
|
|
44
|
-
|
|
45
|
-
## 安全红线
|
|
46
|
-
|
|
47
|
-
- **禁止输出密钥**:`token` 不得出现在日志、消息、终端。
|
|
48
|
-
- **禁止自己拼 URL / 构造 HTTP 请求**:所有请求都走 `delta-cli`。
|
|
49
|
-
- **不要主动安装 CLI**:如果用户说没装,建议他去 README 或 install.sh,不要自己选安装方式。
|
|
50
|
-
- **写入/删除操作前确认意图**:`sandbox kill`、`sandbox finish`、`sandbox write` 等必须告诉用户影响。
|
|
51
|
-
- `~/.delta-infra/config.json` 权限为 `0600`,不要手动放宽。
|
|
52
|
-
- **sandbox 必须销毁**:调用 `sandbox create` 后,当前任务结束前必须调用 `sandbox kill`。server 端无自动清理,不销毁 = 永久占用 GPU;即使出错也不得跳过。
|
|
53
|
-
|
|
54
|
-
## JSON 输出约定
|
|
55
|
-
|
|
56
|
-
```json
|
|
57
|
-
{"ok":true,"data":{...}}
|
|
58
|
-
{"ok":false,"error":{"type":"auth","message":"...","hint":"..."}}
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
AI Agent 解析规则:
|
|
62
|
-
- 始终检查 `ok`,不要只看 exit code。
|
|
63
|
-
- `error.type` 是稳定分支字段:`auth`, `permission`, `not_found`, `validation`, `network`, `api`, `internal`。
|
|
64
|
-
- `error.hint` 可展示给用户。
|
|
65
|
-
|
|
66
|
-
## 退出码约定
|
|
67
|
-
|
|
68
|
-
| Type | Exit Code | 场景 |
|
|
69
|
-
|------|-----------|------|
|
|
70
|
-
| validation | 2 | flag / 参数错误 |
|
|
71
|
-
| auth | 3 | 未认证或认证失败 |
|
|
72
|
-
| permission | 4 | 权限不足 |
|
|
73
|
-
| not_found | 5 | sandbox/file 不存在 |
|
|
74
|
-
| network | 6 | DNS、超时、连接失败 |
|
|
75
|
-
| api | 7 | 服务端非 2xx |
|
|
76
|
-
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
| `error.type:
|
|
92
|
-
| `error.type:
|
|
93
|
-
| `error.type:
|
|
94
|
-
| `error.type:
|
|
95
|
-
|
|
|
1
|
+
---
|
|
2
|
+
name: delta-shared
|
|
3
|
+
description: "delta-cli 全局共享规则:配置/认证检查、安全红线、错误处理、sandbox 销毁。"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# delta-cli 共享规则
|
|
7
|
+
|
|
8
|
+
指导 AI 使用 `delta-cli` 的通用规则。核心原则:**只检查、不猜测、不泄露密钥**。
|
|
9
|
+
|
|
10
|
+
## 执行任何操作之前
|
|
11
|
+
|
|
12
|
+
1. 确认服务端地址:
|
|
13
|
+
```bash
|
|
14
|
+
delta-cli config show
|
|
15
|
+
```
|
|
16
|
+
2. 确认认证状态:
|
|
17
|
+
```bash
|
|
18
|
+
delta-cli auth status
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
- 若 `auth status` 显示 `method: token`,**直接执行目标命令**,不要重复登录或初始化配置。
|
|
22
|
+
- 若显示 `method: none`,或操作返回 `error.type: auth` / `permission`,才进入下面的“补全配置”流程。
|
|
23
|
+
|
|
24
|
+
## 补全配置
|
|
25
|
+
|
|
26
|
+
缺少服务端地址或凭证时,**向用户询问一次**,然后用 flag 初始化:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
delta-cli config init --base-url <server-url> --token <token>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
不要用交互式 `config init`(无 flag),避免在 stdin 不可用时卡住。
|
|
33
|
+
|
|
34
|
+
### 信息来源优先级
|
|
35
|
+
|
|
36
|
+
1. 环境变量:`DELTA_INFRA_BASE_URL`、`DELTA_INFRA_TOKEN`
|
|
37
|
+
2. `~/.delta-infra/config.json` 中的 `base_url` / `token`
|
|
38
|
+
3. 默认值:仅 `base_url` 有内部默认值
|
|
39
|
+
4. 以上都缺失时,**必须询问用户**,禁止虚构
|
|
40
|
+
|
|
41
|
+
### 运行时凭证
|
|
42
|
+
|
|
43
|
+
CLI 使用 `token` 发送请求头 `Authorization: Bearer <token>`,并自动从 JWT 中提取 `uid` 作为 `X-User-Uid`。
|
|
44
|
+
|
|
45
|
+
## 安全红线
|
|
46
|
+
|
|
47
|
+
- **禁止输出密钥**:`token` 不得出现在日志、消息、终端。
|
|
48
|
+
- **禁止自己拼 URL / 构造 HTTP 请求**:所有请求都走 `delta-cli`。
|
|
49
|
+
- **不要主动安装 CLI**:如果用户说没装,建议他去 README 或 install.sh,不要自己选安装方式。
|
|
50
|
+
- **写入/删除操作前确认意图**:`sandbox kill`、`sandbox finish`、`sandbox write` 等必须告诉用户影响。
|
|
51
|
+
- `~/.delta-infra/config.json` 权限为 `0600`,不要手动放宽。
|
|
52
|
+
- **sandbox 必须销毁**:调用 `sandbox create` 后,当前任务结束前必须调用 `sandbox kill`。server 端无自动清理,不销毁 = 永久占用 GPU;即使出错也不得跳过。
|
|
53
|
+
|
|
54
|
+
## JSON 输出约定
|
|
55
|
+
|
|
56
|
+
```json
|
|
57
|
+
{"ok":true,"data":{...}}
|
|
58
|
+
{"ok":false,"error":{"type":"auth","message":"...","hint":"..."}}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
AI Agent 解析规则:
|
|
62
|
+
- 始终检查 `ok`,不要只看 exit code。
|
|
63
|
+
- `error.type` 是稳定分支字段:`auth`, `permission`, `not_found`, `validation`, `network`, `api`, `command_failed`, `internal`。
|
|
64
|
+
- `error.hint` 可展示给用户。
|
|
65
|
+
|
|
66
|
+
## 退出码约定
|
|
67
|
+
|
|
68
|
+
| Type | Exit Code | 场景 |
|
|
69
|
+
|------|-----------|------|
|
|
70
|
+
| validation | 2 | flag / 参数错误 |
|
|
71
|
+
| auth | 3 | 未认证或认证失败 |
|
|
72
|
+
| permission | 4 | 权限不足 |
|
|
73
|
+
| not_found | 5 | sandbox/file 不存在 |
|
|
74
|
+
| network | 6 | DNS、超时、连接失败 |
|
|
75
|
+
| api | 7 | 服务端非 2xx |
|
|
76
|
+
| command_failed | 8 | sandbox 内命令执行失败(非零 exit_code 或报错);SSE 路径在 complete 帧后追加该 error 信封,**message 附 stderr 尾部**便于快速扫读 |
|
|
77
|
+
| internal | 10 | 客户端内部错误 |
|
|
78
|
+
|
|
79
|
+
## 升级检查
|
|
80
|
+
|
|
81
|
+
完成用户请求后,如果 JSON 中有 `_notice.update`,可建议:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
delta-cli upgrade
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## 常见恢复
|
|
88
|
+
|
|
89
|
+
| 错误 / 现象 | 恢复动作 |
|
|
90
|
+
|-------------|----------|
|
|
91
|
+
| `error.type: auth` / `method: none` | 询问用户后执行 `config init --base-url <url> --token <token>` |
|
|
92
|
+
| `error.type: permission` | 确认当前认证是否有权限;必要时换 token |
|
|
93
|
+
| `error.type: not_found` | 检查 `sandbox_id` / path |
|
|
94
|
+
| `error.type: network` | 检查 `base_url` 和网络连通性 |
|
|
95
|
+
| `error.type: validation` | 检查必填 flag 和参数格式 |
|
|
96
|
+
| `error.type: command_failed` | sandbox 内命令失败:信封 `message` 已带 stderr 尾部,可快速定位;完整 `stderr`/`result_summary` 在 complete 帧里,重试或修正命令 |
|
|
97
|
+
| 配置文件解析失败 | 检查 `~/.delta-infra/config.json` 是否为有效 JSON |
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
interface:
|
|
2
|
-
display_name: "Delta CLI 共享规则"
|
|
3
|
-
short_description: "处理 Delta CLI 的配置、认证、错误与安全边界"
|
|
4
|
-
default_prompt: "使用 $delta-shared 检查并处理 Delta CLI 的配置或认证问题。"
|
|
1
|
+
interface:
|
|
2
|
+
display_name: "Delta CLI 共享规则"
|
|
3
|
+
short_description: "处理 Delta CLI 的配置、认证、错误与安全边界"
|
|
4
|
+
default_prompt: "使用 $delta-shared 检查并处理 Delta CLI 的配置或认证问题。"
|
package/skills/manifest.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
{
|
|
2
|
-
"skills": [
|
|
3
|
-
"delta-sandbox",
|
|
4
|
-
"delta-shared",
|
|
5
|
-
"delta-science"
|
|
6
|
-
],
|
|
7
|
-
"retired_skills": [
|
|
8
|
-
"pubchem",
|
|
9
|
-
"rdkit",
|
|
10
|
-
"pymatgen",
|
|
11
|
-
"gsasii",
|
|
12
|
-
"lammps",
|
|
13
|
-
"delta-bo",
|
|
14
|
-
"ldm-bo",
|
|
15
|
-
"synbo-service",
|
|
16
|
-
"antbo-service",
|
|
17
|
-
"antbo-ldm-guard"
|
|
18
|
-
]
|
|
19
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"skills": [
|
|
3
|
+
"delta-sandbox",
|
|
4
|
+
"delta-shared",
|
|
5
|
+
"delta-science"
|
|
6
|
+
],
|
|
7
|
+
"retired_skills": [
|
|
8
|
+
"pubchem",
|
|
9
|
+
"rdkit",
|
|
10
|
+
"pymatgen",
|
|
11
|
+
"gsasii",
|
|
12
|
+
"lammps",
|
|
13
|
+
"delta-bo",
|
|
14
|
+
"ldm-bo",
|
|
15
|
+
"synbo-service",
|
|
16
|
+
"antbo-service",
|
|
17
|
+
"antbo-ldm-guard"
|
|
18
|
+
]
|
|
19
|
+
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
# Delta CLI 执行约定
|
|
2
|
-
|
|
3
|
-
## 使用 CLI
|
|
4
|
-
|
|
5
|
-
所有实时 Science 调用最终都使用已安装的 Delta CLI;CLI 是服务调用边界。标准命令为:
|
|
6
|
-
|
|
7
|
-
```text
|
|
8
|
-
delta-cli science invoke --tool TOOL --endpoint ENDPOINT --data JSON
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
`TOOL` 与 `ENDPOINT` 必须逐字使用当前 reference 或实时目录中的
|
|
12
|
-
`tools.name`、`tool_endpoints.name`;不得增加别名映射、裁剪前缀或在 `not_found` 后改名重试。
|
|
13
|
-
仅当 operation 文档明确要求查询参数时使用 `--params JSON`。不要同时传递 `--data` 和
|
|
14
|
-
`--params`,也不要改用 `curl`、`httpx`、`requests`、`Invoke-RestMethod` 或业务服务 URL。
|
|
15
|
-
|
|
16
|
-
CLI 使用其标准认证和由 `base_url` 派生出的 Science 服务地址(`{base_url}/science_tool`)。
|
|
17
|
-
Skill 不得通过环境变量、命令参数或临时配置改写服务路由,也不读取、修改或伪造凭据。
|
|
18
|
-
|
|
19
|
-
## 成功与结果
|
|
20
|
-
|
|
21
|
-
CLI 成功时输出单个 JSON 信封:
|
|
22
|
-
|
|
23
|
-
```json
|
|
24
|
-
{
|
|
25
|
-
"ok": true,
|
|
26
|
-
"data": {}
|
|
27
|
-
}
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
只有 CLI 退出码为 0 且顶层 `ok` 为 `true` 时,才能报告调用成功。顶层 `data` 保存服务响应。
|
|
31
|
-
按 operation reference 规定的响应结构读取字段:若文档明确说明网关或业务信封的 `data`,
|
|
32
|
-
可读取该已知层级;不得递归搜索字段,也不得将业务返回的 `valid:false`、空结果或警告误报为
|
|
33
|
-
CLI 传输失败。
|
|
34
|
-
|
|
35
|
-
退出码非 0 或顶层 `ok:false` 时,本次调用失败;转发 CLI 的原始错误短摘要,不得切换到
|
|
36
|
-
其他调用链、修改参数或重试可能已执行的远程变更。
|
|
37
|
-
|
|
38
|
-
## 实时目录
|
|
39
|
-
|
|
40
|
-
当用户点名 reference 以外的新工具,或 reference 缺失、过期或与 CLI 返回不一致时,依次执行:
|
|
41
|
-
|
|
42
|
-
```text
|
|
43
|
-
delta-cli science list
|
|
44
|
-
delta-cli science endpoints list TOOL
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
两次调用都必须满足成功条件。目录只用于获取精确名称;若其未提供足以安全构造请求的 schema,
|
|
48
|
-
说明该限制而不要猜测请求体。
|
|
49
|
-
|
|
50
|
-
## 二进制产物
|
|
51
|
-
|
|
52
|
-
operation 返回 base64 数据时,只解码 operation 文档指定的 `data` 字段。PNG 文件必须以
|
|
53
|
-
`89 50 4e 47 0d 0a 1a 0a` 开头。以 `7b`(`{`)开头的是 JSON,不能描述成图片。
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
# Science catalog(自动生成)
|
|
2
|
-
|
|
3
|
-
本文件由 `skills/science-tools.json` 生成;不要手工修改。规范名称供 CLI/Skill 使用,legacy 名称仅用于兼容已部署的 `/science_tool` catalog。
|
|
4
|
-
|
|
5
|
-
| 规范 tool | Skill | 类别 | operation | legacy endpoint |
|
|
6
|
-
| --- | --- | --- | --- | --- |
|
|
7
|
-
| pubchem | pubchem | molecule-information | health | chem_pubchem_health |
|
|
8
|
-
| pubchem | pubchem | molecule-information | compound-resolve-cids | chem_pubchem_compound_resolve-cids |
|
|
9
|
-
| pubchem | pubchem | molecule-information | compound-properties | chem_pubchem_compound_properties |
|
|
10
|
-
| pubchem | pubchem | molecule-information | compound-synonyms | chem_pubchem_compound_synonyms |
|
|
11
|
-
| pubchem | pubchem | molecule-information | compound-summary | chem_pubchem_compound_summary |
|
|
12
|
-
| pubchem | pubchem | molecule-information | compound-batch-summary | chem_pubchem_compound_batch-summary |
|
|
13
|
-
| rdkit | rdkit | cheminformatics | health | chem_rdkit_health |
|
|
14
|
-
| rdkit | rdkit | cheminformatics | parse | chem_rdkit_parse |
|
|
15
|
-
| rdkit | rdkit | cheminformatics | descriptors | chem_rdkit_descriptors |
|
|
16
|
-
| rdkit | rdkit | cheminformatics | batch-descriptors | chem_rdkit_batch-descriptors |
|
|
17
|
-
| rdkit | rdkit | cheminformatics | batch-parse-describe | chem_rdkit_batch-parse-describe |
|
|
18
|
-
| rdkit | rdkit | cheminformatics | render | chem_rdkit_render |
|
|
19
|
-
| rdkit | rdkit | cheminformatics | fingerprint | chem_rdkit_fingerprint |
|
|
20
|
-
| rdkit | rdkit | cheminformatics | similarity | chem_rdkit_similarity |
|
|
21
|
-
| rdkit | rdkit | cheminformatics | similarity-matrix | chem_rdkit_similarity-matrix |
|
|
22
|
-
| rdkit | rdkit | cheminformatics | substructure | chem_rdkit_substructure |
|
|
23
|
-
| pymatgen | pymatgen | materials-informatics | health | chem_pymatgen_health |
|
|
24
|
-
| pymatgen | pymatgen | materials-informatics | composition-parse | chem_pymatgen_composition_parse |
|
|
25
|
-
| pymatgen | pymatgen | materials-informatics | structure-parse | chem_pymatgen_structure_parse |
|
|
26
|
-
| pymatgen | pymatgen | materials-informatics | structure-summary | chem_pymatgen_structure_summary |
|
|
27
|
-
| pymatgen | pymatgen | materials-informatics | structure-convert | chem_pymatgen_structure_convert |
|
|
28
|
-
| pymatgen | pymatgen | materials-informatics | structure-symmetry | chem_pymatgen_structure_symmetry |
|
|
29
|
-
| gsasii | gsasii | diffraction | health | chem_gsasii_health |
|
|
30
|
-
| gsasii | gsasii | diffraction | powder-simulate | chem_gsasii_powder_simulate |
|
|
31
|
-
| gsasii | gsasii | diffraction | powder-refine | chem_gsasii_powder_refine |
|
|
32
|
-
| lammps | lammps | molecular-dynamics | health | chem_lammps_health |
|
|
33
|
-
| lammps | lammps | molecular-dynamics | lj-melt-example | chem_lammps_examples_lj-melt |
|
|
34
|
-
| lammps | lammps | molecular-dynamics | run | chem_lammps_run |
|
|
35
|
-
| delta-bo | delta-bo | optimization | commands | chem_delta-bo_commands |
|
|
36
|
-
| delta-bo | delta-bo | optimization | generate | chem_delta-bo_generate |
|
|
37
|
-
| ldm-bo | ldm-bo | molecule-optimization | health | chem_ldm-bo_health |
|
|
38
|
-
| ldm-bo | ldm-bo | molecule-optimization | recommend | chem_ldm-bo_recommend |
|
|
39
|
-
| ldm-bo | ldm-bo | molecule-optimization | trajectory | chem_ldm-bo_trajectory |
|
|
40
|
-
| synbo | synbo-service | reaction-optimization | health | chem_synbo_health |
|
|
41
|
-
| synbo | synbo-service | reaction-optimization | initialize | chem_synbo_initialize |
|
|
42
|
-
| synbo | synbo-service | reaction-optimization | optimize | chem_synbo_optimize |
|
|
43
|
-
| antbo | antbo-service | antibody-optimization | health | biology_antbo_health |
|
|
44
|
-
| antbo | antbo-service | antibody-optimization | run-default-job | biology_antbo_run_default_job |
|
|
45
|
-
| antbo | antbo-service | antibody-optimization | run | biology_antbo_run |
|
|
46
|
-
| antbo | antbo-service | antibody-optimization | log | biology_antbo_log |
|
|
47
|
-
| antbo | antbo-service | antibody-optimization | jobs | biology_antbo_jobs |
|
|
48
|
-
| antbo | antbo-service | antibody-optimization | stop | biology_antbo_stop |
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
# LDM 科研工作流
|
|
2
|
-
|
|
3
|
-
这里的 **LDM / 大发现模型** 是用户可见的科研工作流名称,不是可以直接访问网关的
|
|
4
|
-
tool。在线计算必须先按任务语义选择 `ldm-bo`、`strbo` 或 `antbo`,再通过
|
|
5
|
-
`delta-cli science invoke`
|
|
6
|
-
调用 Delta CLI;禁止运行旧 `large-discovery-model` Skill、`run_ldm_loop.py`、gateway
|
|
7
|
-
backend、`stream_widget` 中的联网命令或任何 HTTP 客户端。
|
|
8
|
-
|
|
9
|
-
## 路由
|
|
10
|
-
|
|
11
|
-
| 用户目标 | 实际 tool | 需要同时读取 |
|
|
12
|
-
| --- | --- | --- |
|
|
13
|
-
| 在给定 SMILES 候选池中推荐下一批,或运行 PDF2Dock/Vina+NN 轨迹 | `ldm-bo` | `references/ldm-bo.md` |
|
|
14
|
-
| 围绕服务端固定 KRAS G12D 生成、评估并迭代小分子 | `strbo` | `references/strbo.md` |
|
|
15
|
-
| 为指定抗原生成、评估并迭代 11-aa CDRH3 | `antbo` | `references/antbo.md` |
|
|
16
|
-
|
|
17
|
-
不得因为用户只说“LDM”“药物发现”就自动选择后端。根据实体、已有数据和目标判断;
|
|
18
|
-
仍无法区分时,结束并说明需要用户确认“小分子候选池、KRAS G12D 生成优化或抗体
|
|
19
|
-
CDRH3”中的哪一种。
|
|
20
|
-
|
|
21
|
-
## 最小执行范围
|
|
22
|
-
|
|
23
|
-
- 用户只要求检查参数时,只调用相应 `*-validate` operation。
|
|
24
|
-
- 用户只要求评估已有候选时,只调用 evaluate,不生成新候选。
|
|
25
|
-
- 用户只要求推荐下一批且已经给出历史记录时,只调用 suggest/recommend。
|
|
26
|
-
- 用户明确要求“完整迭代优化”时,才运行初始化、评估、建议、再评估的闭环。
|
|
27
|
-
- 用户未给轮数时,STRBO/AntBO 最多执行一个建议轮次;不得沿用旧 Skill 的 6/8 轮
|
|
28
|
-
隐式默认值。LDM-BO `trajectory` 的评估次数必须来自用户,缺失时先要求确认。
|
|
29
|
-
|
|
30
|
-
生成、评估、建议和 trajectory 都会消耗远端资源。一次自然语言中的“帮我优化”视为
|
|
31
|
-
执行授权,但不得擅自扩大候选数、轮数或切换后端。
|
|
32
|
-
|
|
33
|
-
## STRBO 完整闭环
|
|
34
|
-
|
|
35
|
-
1. 调用 `molecules-init` 或 `molecules-init-job`,取得初始 SMILES。
|
|
36
|
-
2. 调用 `molecules-evaluate` 或对应异步 operation,取得 `[vina, activity]`。
|
|
37
|
-
3. 使用当前成功业务响应中的 SMILES 和 scores 构造 `history_xs/history_ys`。
|
|
38
|
-
4. 调用一次 `molecules-suggest-job`,按 STRBO reference 轮询至成功。
|
|
39
|
-
5. 只评估新建议,并把结果与当前任务内历史合并后返回。
|
|
40
|
-
|
|
41
|
-
提交 operation 不得重试。任一步失败、超时或返回数量不一致,立即结束;不得用旧
|
|
42
|
-
gateway、离线 mock、本地 RDKit/Vina 或模型猜测补全。
|
|
43
|
-
|
|
44
|
-
## AntBO 完整闭环
|
|
45
|
-
|
|
46
|
-
1. 用户必须提供抗原;未提供时不得替用户选择。
|
|
47
|
-
2. 必要时调用一次 `ldm-health`,确认抗原与 CDRH3 长度约束。
|
|
48
|
-
3. 调用 `ldm-init` 取得初始 CDRH3,再调用 `evaluate` 取得结合能。
|
|
49
|
-
4. 使用当前成功业务响应构造一维 `history_ys`,调用一次 `ldm-suggest`。
|
|
50
|
-
5. 只评估新建议,并返回当前任务内的候选与结合能。
|
|
51
|
-
|
|
52
|
-
不得把 AntBO 的一维 score 改成 STRBO 的二维 score,也不得把 CDRH3 交给小分子
|
|
53
|
-
LDM-BO。
|
|
54
|
-
|
|
55
|
-
## 固定候选池与轨迹
|
|
56
|
-
|
|
57
|
-
- 已有候选池和历史分数,要求下一批:使用 `ldm-bo/recommend`。
|
|
58
|
-
- 用户明确要求完整 PDF2Dock/Vina+NN 搜索并给出评估次数:使用
|
|
59
|
-
`ldm-bo/trajectory`。
|
|
60
|
-
- 不得把 `ldm-bo` 的 provider、模型路径、密钥、GPU 或 Vina 配置放进请求;这些由
|
|
61
|
-
Science Server 管理。
|
|
62
|
-
|
|
63
|
-
## 结果与展示
|
|
64
|
-
|
|
65
|
-
只报告当前 Delta CLI 业务响应中真实存在的候选、目标值、warnings、job_id、状态和
|
|
66
|
-
服务端 provenance。不得自行添加相似度阈值、机制解释、湿实验结论或“最优”断言;
|
|
67
|
-
只有在方向明确且比较集合完整时,才能按实际目标值指出当前集合中的最好候选。
|
|
68
|
-
推荐结果中的 acquisition value 不是预测目标值、置信度或推荐理由;除非业务响应
|
|
69
|
-
明确给出语义和方向,否则只作为原始采集函数值报告。
|
|
70
|
-
|
|
71
|
-
LDM 的仪表盘是展示层,不是计算入口。用户明确要求图表时,先完成一次 CLI 计算,
|
|
72
|
-
再让外层使用同一份已验证结果绘图;禁止为了仪表盘再次提交远端任务。普通请求直接
|
|
73
|
-
返回简洁文本。
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
# Molecule Enrichment 详细规则
|
|
2
|
-
|
|
3
|
-
这是一个由 Science Server 编排的联合 workflow:先用 PubChem 批量解析输入,再按服务
|
|
4
|
-
返回的 SMILES 回退顺序调用 RDKit 批量解析/描述符/指纹。它适合用户明确要求“一次拿到
|
|
5
|
-
身份信息和结构计算结果”的场景;推荐结果仍只来自当前 CLI 业务响应。
|
|
6
|
-
|
|
7
|
-
当前 Science Server 的注册标签是 `chemistry`,operation 是 `molecule.enrich`。实际
|
|
8
|
-
名称必须以当前 catalog 返回值为准;该 operation 的存在不能通过直接访问
|
|
9
|
-
`/chem/molecule/enrich` 推断或替代。所有调用都使用:
|
|
10
|
-
|
|
11
|
-
```text
|
|
12
|
-
delta-cli science invoke --tool chemistry --endpoint molecule.enrich --data JSON
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Request
|
|
16
|
-
|
|
17
|
-
请求体:
|
|
18
|
-
|
|
19
|
-
```json
|
|
20
|
-
{
|
|
21
|
-
"inputs": ["aspirin", "caffeine"],
|
|
22
|
-
"namespace": "name",
|
|
23
|
-
"pubchem": {
|
|
24
|
-
"properties": ["MolecularFormula", "MolecularWeight", "CanonicalSMILES"],
|
|
25
|
-
"synonym_limit": 5
|
|
26
|
-
},
|
|
27
|
-
"rdkit": {
|
|
28
|
-
"descriptors": true,
|
|
29
|
-
"canonicalize": true,
|
|
30
|
-
"fingerprint": {"type": "morgan", "radius": 2, "n_bits": 2048},
|
|
31
|
-
"sanitize": true
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
`inputs` 接受 1–100 个字符串;`namespace` 为 `cid`、`name`、`smiles`、`inchi`、
|
|
37
|
-
`inchikey` 或 `formula`。`pubchem.properties` 和 `synonym_limit` 遵循 PubChem reference。
|
|
38
|
-
RDKit 默认执行 descriptors、canonicalize 和 sanitize;`fingerprint` 可为 `false` 或
|
|
39
|
-
Morgan 配置对象,radius 为 1–6,n_bits 为 128–8192。不要把一个服务的字段名改写成
|
|
40
|
-
另一个服务的字段名。
|
|
41
|
-
|
|
42
|
-
## Result
|
|
43
|
-
|
|
44
|
-
成功业务结果通常包含 `valid`、`count`、`failed_count`、`results`、`warnings` 和
|
|
45
|
-
`metadata`。每个 `results[*]` 保留:
|
|
46
|
-
|
|
47
|
-
- 原始输入 `input`;
|
|
48
|
-
- PubChem 的 `valid`、`cid`、`smiles`、`formula`、`properties`、`aliases`、`synonyms`
|
|
49
|
-
和 `error`;
|
|
50
|
-
- 可选 RDKit 的 `valid`、`canonical_smiles`、`descriptors`、`fingerprint_metadata`、
|
|
51
|
-
`on_bits`、`bit_count`、`warnings` 和 `error`。
|
|
52
|
-
|
|
53
|
-
SMILES 回退顺序固定为 `CanonicalSMILES -> ConnectivitySMILES -> SMILES ->
|
|
54
|
-
IsomericSMILES`。PubChem 没有可用 SMILES,或 RDKit 失败时,该条记录保持无效并计入
|
|
55
|
-
`failed_count`;不要用本地 RDKit/PubChem 或人工字符串补齐。
|
|
56
|
-
|
|
57
|
-
只要用户需要单一中间结果,就不要为了使用 workflow 额外调用另一服务。不要主动调用
|
|
58
|
-
health 或保存文件;用户明确要求图片时仍单独使用 RDKit `render`,不要把本 workflow 的
|
|
59
|
-
描述符响应当成图像。
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
# Delta Science operation 最小契约
|
|
2
|
-
|
|
3
|
-
本文只记录当前 CLI catalog 已暴露的 9 个 tools、42 个 operations。选择 operation 后
|
|
4
|
-
只读取对应小节。代码示例均在同一个 `python_repl` 中先定义以下函数;禁止 Bash、
|
|
5
|
-
目录探测、直接 HTTP 和字面 CLI 命令。
|
|
6
|
-
|
|
7
|
-
调用 `python_repl` 时工具参数必须严格为 `{"code":"..."}`;禁止添加 `deps`、
|
|
8
|
-
`dependencies`、`packages` 或任何其他字段。
|
|
9
|
-
|
|
10
|
-
```python
|
|
11
|
-
import json, os, subprocess, sys
|
|
12
|
-
|
|
13
|
-
wrapper = os.path.join(os.environ["SKILLS_ROOT"], "delta-science", "scripts", "invoke.py")
|
|
14
|
-
|
|
15
|
-
def invoke(tool, endpoint, data=None, params=None):
|
|
16
|
-
argv = [sys.executable, wrapper, "--tool", tool, "--endpoint", endpoint]
|
|
17
|
-
if data is not None:
|
|
18
|
-
argv += ["--data-json", json.dumps(data)]
|
|
19
|
-
if params is not None:
|
|
20
|
-
argv += ["--params-json", json.dumps(params)]
|
|
21
|
-
p = subprocess.run(argv, capture_output=True, text=True, shell=False)
|
|
22
|
-
if p.returncode != 0:
|
|
23
|
-
raise RuntimeError(p.stderr or p.stdout)
|
|
24
|
-
r = json.loads(p.stdout)
|
|
25
|
-
if r.get("ok") is not True or r.get("transport") != "delta-cli":
|
|
26
|
-
raise RuntimeError(r)
|
|
27
|
-
return r["native"]
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
每个代码示例只调用一次。将返回值投影成用户要求的有界 JSON 并显式 `print`,然后
|
|
31
|
-
调用 `step_finish(status="done", summary=<同一 JSON>)` 恰好一次。失败则
|
|
32
|
-
`step_finish(status="failed", summary=<原始错误短摘要>)`,禁止重试或改走其他链路。
|
|
33
|
-
|
|
34
|
-
## PubChem(tool=`pubchem`)
|
|
35
|
-
|
|
36
|
-
| operation | 人类情景 | 最小代码 | native 投影 |
|
|
37
|
-
| --- | --- | --- | --- |
|
|
38
|
-
| `health` | “PubChem 服务现在能用吗?” | `n=invoke("pubchem","health")` | status、availability、metadata、limits、warnings |
|
|
39
|
-
| `compound-resolve-cids` | “把 aspirin 解析成 CID。” | `n=invoke("pubchem","compound-resolve-cids",data={"identifier":"aspirin","namespace":"name","max_records":20})` | identifier、valid、cids、error |
|
|
40
|
-
| `compound-properties` | “查 aspirin 的分子式和分子量。” | `n=invoke("pubchem","compound-properties",data={"identifier":"aspirin","namespace":"name","properties":["MolecularFormula","MolecularWeight"]})` | cid、valid、properties、aliases、error |
|
|
41
|
-
| `compound-synonyms` | “列出 aspirin 的前 5 个同义词。” | `n=invoke("pubchem","compound-synonyms",data={"identifier":"aspirin","namespace":"name","max_synonyms":5})` | cid、valid、synonyms、error |
|
|
42
|
-
| `compound-summary` | “查阿司匹林的基础身份信息。” | `n=invoke("pubchem","compound-summary",data={"identifier":"aspirin","namespace":"name"})` | valid、cid、properties 中用户要求的键 |
|
|
43
|
-
| `compound-batch-summary` | “一次比较 aspirin 和 caffeine 的基础属性。” | `n=invoke("pubchem","compound-batch-summary",data={"identifiers":["aspirin","caffeine"],"namespace":"name"})` | results[*].input、valid/error、properties |
|
|
44
|
-
|
|
45
|
-
## RDKit(tool=`rdkit`)
|
|
46
|
-
|
|
47
|
-
| operation | 人类情景 | 最小代码 | native 投影 |
|
|
48
|
-
| --- | --- | --- | --- |
|
|
49
|
-
| `health` | “RDKit 服务可用吗?” | `n=invoke("rdkit","health")` | status、availability、metadata、limits、warnings |
|
|
50
|
-
| `parse` | “这个 SMILES 合法吗?” | `n=invoke("rdkit","parse",data={"input":"CCO","format":"smiles","sanitize":True})` | valid、canonical_smiles、formula、inchi_key、warnings/error |
|
|
51
|
-
| `descriptors` | “计算乙醇的基础 RDKit 描述符。” | `n=invoke("rdkit","descriptors",data={"smiles":"CCO","descriptor_set":"basic","sanitize":True})` | valid、descriptors、warnings/error |
|
|
52
|
-
| `batch-descriptors` | “批量算几个 SMILES 的描述符。” | `n=invoke("rdkit","batch-descriptors",data={"smiles":["CCO","c1ccccc1"],"descriptor_set":"basic","sanitize":True})` | results 中输入、valid、descriptors、error |
|
|
53
|
-
| `batch-parse-describe` | “校验阿司匹林并给基础描述符。” | `n=invoke("rdkit","batch-parse-describe",data={"molecules":[{"id":"aspirin","smiles":"CC(=O)OC1=CC=CC=C1C(=O)O"}],"descriptor_set":"basic","sanitize":True})` | results[*].id、valid、canonical_smiles、descriptors、warnings/error |
|
|
54
|
-
| `render` | “画一张乙醇结构图。” | `n=invoke("rdkit","render",data={"smiles":"CCO","image_format":"png","width":500,"height":400})` | 指定图像字段;PNG 解码后验证 magic bytes |
|
|
55
|
-
| `fingerprint` | “生成乙醇 Morgan 指纹。” | `n=invoke("rdkit","fingerprint",data={"smiles":"CCO","radius":2,"n_bits":2048})` | valid、fingerprint_metadata、on_bits、warnings/error |
|
|
56
|
-
| `similarity` | “比较乙醇和乙胺的结构相似度。” | `n=invoke("rdkit","similarity",data={"query_smiles":"CCO","target_smiles":"CCN","radius":2,"n_bits":2048})` | similarity、metric、fingerprint metadata |
|
|
57
|
-
| `similarity-matrix` | “比较一组分子的两两相似度。” | `n=invoke("rdkit","similarity-matrix",data={"molecules":[{"id":"a","smiles":"CCO"},{"id":"b","smiles":"CCN"}],"fingerprint":{"type":"morgan","radius":2,"n_bits":2048},"sanitize":True})` | matrix、ranked_pairs[{a,b,similarity}] |
|
|
58
|
-
| `substructure` | “筛出含羧酸子结构的分子。” | `n=invoke("rdkit","substructure",data={"query_smarts":"C(=O)O","target_smiles":["CC(=O)O","CCO"]})` | query 与每个目标的 match/matches、valid/error |
|
|
59
|
-
|
|
60
|
-
## pymatgen(tool=`pymatgen`)
|
|
61
|
-
|
|
62
|
-
| operation | 人类情景 | 最小代码 | native 投影 |
|
|
63
|
-
| --- | --- | --- | --- |
|
|
64
|
-
| `health` | “pymatgen 服务是否正常?” | `n=invoke("pymatgen","health")` | status、availability、metadata、limits、warnings |
|
|
65
|
-
| `composition-parse` | “解析 LiFePO4 的组成和式量。” | `n=invoke("pymatgen","composition-parse",data={"formula":"LiFePO4","format":"formula"})` | valid、formula、reduced_formula、chemical_system、weight、element_amounts |
|
|
66
|
-
| `structure-parse` | “校验这段 CIF 能否解析。” | `n=invoke("pymatgen","structure-parse",data={"input":cif_text,"format":"cif","primitive":False})` | valid、formula、nsites、lattice、warnings/error |
|
|
67
|
-
| `structure-summary` | “总结这段 CIF 的结构信息。” | `n=invoke("pymatgen","structure-summary",data={"input":cif_text,"format":"cif","primitive":False})` | formula、reduced_formula、density、volume、lattice、species |
|
|
68
|
-
| `structure-convert` | “把 CIF 转成 POSCAR。” | `n=invoke("pymatgen","structure-convert",data={"input":cif_text,"input_format":"cif","output_format":"poscar","primitive":False})` | valid、output_format、转换后的结构文本、warnings/error |
|
|
69
|
-
| `structure-symmetry` | “分析这段 CIF 的空间群。” | `n=invoke("pymatgen","structure-symmetry",data={"input":cif_text,"format":"cif","primitive":False,"symprec":0.01,"angle_tolerance":5.0})` | space_group_symbol/number、crystal_system、point_group_symbol、hall、nsites |
|
|
70
|
-
|
|
71
|
-
## GSAS-II(tool=`gsasii`)
|
|
72
|
-
|
|
73
|
-
| operation | 人类情景 | 最小代码 | native 投影 |
|
|
74
|
-
| --- | --- | --- | --- |
|
|
75
|
-
| `health` | “GSAS-II 服务能做衍射计算吗?” | `n=invoke("gsasii","health")` | status、gsasii_available、metadata、limits、warnings |
|
|
76
|
-
| `powder-simulate` | “用这个 CIF 模拟 Cu Kα 粉末衍射。” | `n=invoke("gsasii","powder-simulate",data={"cif":cif_text,"phase_name":"phase","radiation":"CuKa","t_min":10.0,"t_max":80.0,"t_step":0.02,"include_profile":True,"max_profile_points":1000,"include_reflections":True,"max_reflections":1000,"return_refined_cif":False,"return_project":False})` | valid、profile、reflections、metadata、warnings |
|
|
77
|
-
| `powder-refine` | “用真实粉末数据和仪器文件做 Rietveld 精修。” | `n=invoke("gsasii","powder-refine",data={"powder_data":powder_text,"powder_format":"xy","instrument_parameters":instrument_text,"phases":[{"name":"phase","cif":cif_text}],"refinement_mode":"rietveld","refinement_steps":[],"max_cycles":3,"histogram_name":"powder","include_profile":True,"max_profile_points":1000,"include_reflections":True,"max_reflections":1000,"return_refined_cif":False,"return_project":False})` | valid、residuals、phase summaries、profile、reflections、warnings |
|
|
78
|
-
|
|
79
|
-
## LAMMPS(tool=`lammps`)
|
|
80
|
-
|
|
81
|
-
| operation | 人类情景 | 最小代码 | native 投影 |
|
|
82
|
-
| --- | --- | --- | --- |
|
|
83
|
-
| `health` | “LAMMPS 服务可用吗?” | `n=invoke("lammps","health")` | status、lammps_available、metadata、limits、warnings |
|
|
84
|
-
| `lj-melt-example` | “给我跑部署自带的最小 LJ 示例做检查。” | `n=invoke("lammps","lj-melt-example")` | 示例说明与精确 `request`;此调用本身不执行模拟 |
|
|
85
|
-
| `run` | “执行刚才返回的最小 LJ 请求。” | `example=invoke("lammps","lj-melt-example"); n=invoke("lammps","run",data=example["request"])` | valid、last_thermo、thermo rows、warnings、请求的输出文件;此场景固定两次依赖调用 |
|
|
86
|
-
|
|
87
|
-
`run` 也可接收用户明确提供的 `input_script`、相对路径 files、timeout 和有界输出配置;
|
|
88
|
-
不得从化学式猜力场。长任务需明确授权,失败后不得重试。
|
|
89
|
-
|
|
90
|
-
## Delta-BO(tool=`delta-bo`)
|
|
91
|
-
|
|
92
|
-
| operation | 人类情景 | 最小代码 | native 投影 |
|
|
93
|
-
| --- | --- | --- | --- |
|
|
94
|
-
| `commands` | “当前 Delta-BO 支持哪些命令?” | `n=invoke("delta-bo","commands")` | 当前部署返回的命令列表,不从旧文档补充 |
|
|
95
|
-
| `generate` | “在 0 到 1 之间给两个随机初始实验点。” | `n=invoke("delta-bo","generate",data={"params":[{"name":"x","type":"numeric","low":0.0,"high":1.0}],"num_suggestions":2,"algorithm":"random-search","seed":42})` | suggestions、suggestion_metadata、warnings、diversity |
|
|
96
|
-
|
|
97
|
-
有历史观测且用户明确要求 BO 时,`generate` 可加入 objectives、object-form histories、
|
|
98
|
-
model/acquisition/solver;历史少于 5 条默认 random-search,不编造观测。
|
|
99
|
-
|
|
100
|
-
## LDM-BO(tool=`ldm-bo`)
|
|
101
|
-
|
|
102
|
-
只用于小分子 SMILES/PDF2Dock,不用于抗体、CDRH3 或 AntBO。
|
|
103
|
-
|
|
104
|
-
| operation | 人类情景 | 最小代码 | native 投影 |
|
|
105
|
-
| --- | --- | --- | --- |
|
|
106
|
-
| `health` | “分子 LDM-BO 服务可用吗?” | `n=invoke("ldm-bo","health")` | availability、Vina/ReaSyn/模型/LLM 配置状态、warnings |
|
|
107
|
-
| `recommend` | “从候选池给下一条小分子 SMILES。” | `n=invoke("ldm-bo","recommend",data={"method":"bo-tanimoto","pool":["CCO","CCN","CCC"],"history":[{"smiles":"CCO","scores":[-7.1]},{"smiles":"CCN","scores":[-6.8]}],"batch_size":1})` | recommendations、acquisition_values、n_objectives、llm diagnostics |
|
|
108
|
-
| `trajectory` | “跑一个有界的小分子 BO 轨迹。” | `n=invoke("ldm-bo","trajectory",data={"method":"bo-tanimoto","seed":42,"seed-smiles":"CCO,CCN,CCC","num-evaluations":4,"batch-size":1,"objective":"vina+nn"})` | config、history、summary、llm_trajectory;保留连字符字段 |
|
|
109
|
-
|
|
110
|
-
## SynBO(tool=`synbo`)
|
|
111
|
-
|
|
112
|
-
| operation | 人类情景 | 最小代码 | native 投影 |
|
|
113
|
-
| --- | --- | --- | --- |
|
|
114
|
-
| `health` | “SynBO 服务当前可用吗?” | `n=invoke("synbo","health")` | status、synbo_available、metadata、limits、runtime、warnings |
|
|
115
|
-
| `initialize` | “没有实验历史,先选三组反应条件。” | `n=invoke("synbo","initialize",data={"condition_dict":{"catalyst":["Pd(OAc)2","Pd(PPh3)4"],"solvent":["THF","Toluene"],"base":["K2CO3","DBU"]},"opt_metrics":["yield"],"opt_metric_settings":[{"opt_direct":"max","opt_range":[0,100],"metric_weight":1.0}],"batch_size":3,"sampling_method":"random","desc_normalize":"minmax","random_seed":42})` | recommendations/initial conditions、warnings、metadata |
|
|
116
|
-
| `optimize` | “根据真实历史收率推荐下一批条件。” | `n=invoke("synbo","optimize",data={"condition_dict":{"catalyst":["Pd(OAc)2","Pd(PPh3)4","Pd2(dba)3"],"solvent":["THF","Dioxane","Toluene"],"base":["K2CO3","NaOEt","DBU"]},"opt_metrics":["yield"],"previous_results":[{"batch":0,"catalyst":"Pd(OAc)2","solvent":"THF","base":"K2CO3","yield":42.0},{"batch":0,"catalyst":"Pd(PPh3)4","solvent":"Dioxane","base":"NaOEt","yield":55.0},{"batch":0,"catalyst":"Pd2(dba)3","solvent":"Toluene","base":"DBU","yield":63.0}],"batch_size":2,"accuracy":"tiny","device":"cpu","random_seed":42})` | recommendations、model/acquisition metadata、warnings;失败/空结果不得本地替代 |
|
|
117
|
-
|
|
118
|
-
## AntBO(tool=`antbo`)
|
|
119
|
-
|
|
120
|
-
抗体/CDRH3 场景即使出现 “LDM” 也必须路由到 AntBO,不得改用分子 LDM-BO。
|
|
121
|
-
|
|
122
|
-
| operation | 人类情景 | 最小代码 | native 投影 |
|
|
123
|
-
| --- | --- | --- | --- |
|
|
124
|
-
| `health` | “AntBO 环境可用吗?” | `n=invoke("antbo","health")` | status、antbo_available、metadata、limits、warnings |
|
|
125
|
-
| `run-default-job` | “启动标准 AntBO 后台任务。” | `n=invoke("antbo","run-default-job",params={"log_name":"antbo_<唯一时间戳>.log","append":False,"timeout_seconds":86400})` | started、pid、log_name/log_path、timeout_seconds |
|
|
126
|
-
| `run` | “用明确的受限配置同步跑一次 AntBO。” | `n=invoke("antbo","run",data={"script_path":"./bo/main.py","config_path":"./bo/config.yaml","n_trials":1,"seed":42,"antigens_file":"<项目根内路径>","extra_args":[],"timeout_seconds":86400,"cuda_visible_devices":"0","conda_env":"DGM","log_name":"antbo_custom.log","append":False})` | ok、returncode、timed_out、log_path、log_truncated |
|
|
127
|
-
| `log` | “查看 antbo_run.log 的尾部。” | `n=invoke("antbo","log",params={"log_name":"antbo_run.log"})` | log_name、log、log_truncated |
|
|
128
|
-
| `jobs` | “查看当前活动 AntBO 作业。” | `n=invoke("antbo","jobs")` | jobs[*].pid/running/returncode/log_name/log_path |
|
|
129
|
-
| `stop` | “停止 PID 12345。” | `n=invoke("antbo","stop",params={"pid":12345})` | stopped、pid、message |
|
|
130
|
-
|
|
131
|
-
`run-default-job`、`run`、`stop` 是远程变更,必须有用户明确授权,未知结果不得重试。
|
|
132
|
-
AntBO `ldm/suggest`、`ldm/initialize`、`ldm/evaluate` 当前不在 catalog:不调用工具,
|
|
133
|
-
固定报告“未暴露该 operation;未发送远端请求”。
|
|
134
|
-
|
|
135
|
-
注意:AntBO `health` 可能公布公司服务内部的 `ldm_suggest` 等 endpoint,但它们并不
|
|
136
|
-
因此成为 Delta CLI operation;禁止调用不存在的 `antbo/catalog`,也禁止根据 health
|
|
137
|
-
为 Memento 推导新的 endpoint。
|