@delta-infra/cli 1.0.79 → 1.0.80
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 +17 -27
- package/checksums.txt +5 -5
- package/package.json +2 -13
- package/scripts/install-wizard.js +14 -5
- package/skills/delta-science/SKILL.md +128 -149
- package/skills/delta-science/agents/openai.yaml +3 -3
- package/skills/{antbo-service/references/operations.md → delta-science/references/antbo.md} +59 -4
- package/skills/delta-science/references/cli-contract.md +18 -19
- package/skills/delta-science/references/delta-bo.md +90 -0
- package/skills/{gsasii/references/endpoints.md → delta-science/references/gsasii.md} +13 -27
- package/skills/{lammps/references/endpoints.md → delta-science/references/lammps.md} +13 -8
- package/skills/{ldm-bo/references/endpoints.md → delta-science/references/ldm-bo.md} +12 -9
- package/skills/delta-science/references/ldm.md +72 -0
- package/skills/{pubchem/references/endpoints.md → delta-science/references/pubchem.md} +15 -10
- package/skills/{pymatgen/references/endpoints.md → delta-science/references/pymatgen.md} +9 -9
- package/skills/{rdkit/references/endpoints.md → delta-science/references/rdkit.md} +20 -14
- package/skills/delta-science/references/routing-index.md +36 -0
- package/skills/delta-science/references/strbo.md +87 -0
- package/skills/{synbo-service/references/endpoints.md → delta-science/references/synbo.md} +57 -17
- package/skills/delta-science/references/workflows.md +24 -7
- package/skills/delta-science/scripts/catalog.py +92 -0
- package/skills/delta-science/scripts/invoke.py +162 -79
- package/skills/manifest.json +3 -1
- package/skills/antbo-ldm-guard/SKILL.md +0 -58
- package/skills/antbo-ldm-guard/agents/openai.yaml +0 -4
- package/skills/antbo-service/SKILL.md +0 -79
- package/skills/antbo-service/agents/openai.yaml +0 -4
- package/skills/delta-bo/SKILL.md +0 -36
- package/skills/delta-bo/agents/openai.yaml +0 -4
- package/skills/delta-bo/references/endpoints.md +0 -263
- package/skills/delta-science/references/generated-catalog.md +0 -48
- package/skills/delta-science/references/operation-contracts.md +0 -137
- package/skills/delta-science/references/services.md +0 -112
- package/skills/delta-science/scripts/generated_catalog.py +0 -69
- package/skills/gsasii/SKILL.md +0 -42
- package/skills/gsasii/agents/openai.yaml +0 -4
- package/skills/lammps/SKILL.md +0 -39
- package/skills/lammps/agents/openai.yaml +0 -4
- package/skills/ldm-bo/SKILL.md +0 -35
- package/skills/ldm-bo/agents/openai.yaml +0 -4
- package/skills/pubchem/SKILL.md +0 -93
- package/skills/pubchem/agents/openai.yaml +0 -4
- package/skills/pubchem/references/operations.md +0 -41
- package/skills/pymatgen/SKILL.md +0 -54
- package/skills/pymatgen/agents/openai.yaml +0 -4
- package/skills/rdkit/SKILL.md +0 -112
- package/skills/rdkit/agents/openai.yaml +0 -4
- package/skills/rdkit/references/operations.md +0 -64
- package/skills/science-tools.json +0 -127
- package/skills/synbo-service/SKILL.md +0 -36
- package/skills/synbo-service/agents/openai.yaml +0 -4
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
## 只能通过内置 wrapper 调用
|
|
4
4
|
|
|
5
|
-
实时 Science
|
|
6
|
-
`
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
实时 Science 调用只能由宿主可用的 shell 或 Python 执行内置 wrapper。先定位当前
|
|
6
|
+
`SKILL.md` 所在目录,再执行该目录下 `scripts/invoke.py` 的绝对路径;不得直接执行
|
|
7
|
+
`delta-cli`,也不得改用直接 HTTP。Claude Code 可使用 `CLAUDE_SKILL_DIR` 定位当前
|
|
8
|
+
Skill;Codex 应以当前已加载 Skill 的目录为工作目录,或在已安装的 Skills 目录中查找
|
|
9
|
+
精确的 `delta-science/scripts/invoke.py`。不得依赖宿主私有环境变量。
|
|
10
10
|
|
|
11
|
-
使用 Python 执行 wrapper
|
|
11
|
+
使用 Python 执行 wrapper。下面的 `wrapper` 必须是上述方法定位到的绝对路径:
|
|
12
12
|
|
|
13
13
|
```python
|
|
14
|
-
import json,
|
|
14
|
+
import json, subprocess, sys
|
|
15
15
|
|
|
16
|
-
wrapper =
|
|
16
|
+
wrapper = "/absolute/path/to/delta-science/scripts/invoke.py"
|
|
17
17
|
payload = {"input": "CCO", "format": "smiles"}
|
|
18
18
|
completed = subprocess.run(
|
|
19
19
|
[sys.executable, wrapper, "--tool", "rdkit", "--endpoint", "parse",
|
|
@@ -56,28 +56,27 @@ CLI 从 `~/.delta-infra/config.json` 读取 `science_base_url`。显式 `--scien
|
|
|
56
56
|
"transport": "delta-cli",
|
|
57
57
|
"tool": "rdkit",
|
|
58
58
|
"endpoint": "parse",
|
|
59
|
-
"resolved_tool": "rdkit",
|
|
60
|
-
"resolved_endpoint": "chem_rdkit_parse",
|
|
61
|
-
"catalog_profile": "legacy",
|
|
62
59
|
"elapsed_seconds": 1.23,
|
|
63
60
|
"envelope_depth": 2,
|
|
64
61
|
"native": {}
|
|
65
62
|
}
|
|
66
63
|
```
|
|
67
64
|
|
|
68
|
-
Skill
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
`--catalog-profile canonical|legacy` 或 `runtime.local.json` 的 `catalog_profile`
|
|
73
|
-
显式覆盖自动判断。
|
|
65
|
+
`tools.name` 和 `tool_endpoints.name` 是唯一权威名称。Skill 代码始终把 reference 中的
|
|
66
|
+
tool/operation 原样传给 CLI,CLI 再原样提交给 Science Server;任何一层都不执行旧
|
|
67
|
+
名称映射、前缀裁剪、profile 判断或失败后的改名重试。若 reference 与数据库名称不一致,
|
|
68
|
+
本次调用按 `not_found` 失败结束,应修正数据库配置或 reference,而不是在客户端添加映射。
|
|
74
69
|
|
|
75
|
-
wrapper 校验 CLI 的 `{ok,data}` 信封,只解包已知的 Infra 转发结果
|
|
70
|
+
wrapper 校验 CLI 的 `{ok,data}` 信封,只解包已知的 Infra 转发结果
|
|
71
|
+
`{status_code,headers,data}` 和业务服务信封 `{code,message,data}`。它不会在任意嵌套
|
|
72
|
+
字段中搜索看似合理的结果。`ok=false` 会包含稳定的 `stage`、`error_type`、
|
|
73
|
+
`cli_exit_code` 和错误文本。宿主 shell/Python 的进程成功状态不能覆盖这些字段。
|
|
76
74
|
|
|
77
75
|
解包成功后,业务结果直接位于 `result["native"]` 顶层。禁止读取
|
|
78
76
|
`result["native"]["data"]`,也禁止递归搜索字段。
|
|
79
77
|
|
|
80
|
-
即使存在部分数据,`ok=false`
|
|
78
|
+
即使存在部分数据,`ok=false` 仍必须视为失败。禁止静默切换到其他调用链,也不得在
|
|
79
|
+
最终统计中写“无错误”。业务成功后立即结束,不得为比较模型而追加请求。
|
|
81
80
|
|
|
82
81
|
## 二进制产物
|
|
83
82
|
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Delta-BO 详细规则
|
|
2
|
+
|
|
3
|
+
所有在线调用只走统一 wrapper,tool 固定为 `delta-bo`。当前 CLI catalog 只暴露
|
|
4
|
+
`commands` 和 `generate`;禁止根据旧 HTTP 文档猜测或直连 stateful command API。
|
|
5
|
+
|
|
6
|
+
## commands
|
|
7
|
+
|
|
8
|
+
情景:用户要求查看当前部署支持的 Delta-BO 命令。
|
|
9
|
+
|
|
10
|
+
```python
|
|
11
|
+
result = invoke("delta-bo", "commands")
|
|
12
|
+
native = result["native"]
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
无 body。只报告当前 native 命令列表,不从历史文档补全。
|
|
16
|
+
|
|
17
|
+
## generate
|
|
18
|
+
|
|
19
|
+
情景:针对数值、整数或分类实验变量生成随机搜索或贝叶斯优化建议。
|
|
20
|
+
|
|
21
|
+
无真实历史,或历史少于 5 条且用户没有明确要求 BO 时,使用有界随机搜索:
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"params": [
|
|
26
|
+
{"name": "x", "type": "numeric", "low": 0.0, "high": 1.0}
|
|
27
|
+
],
|
|
28
|
+
"num_suggestions": 3,
|
|
29
|
+
"algorithm": "random-search",
|
|
30
|
+
"seed": 42
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
有真实历史且用户明确要求 BO 时,可以使用:
|
|
35
|
+
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"params": [
|
|
39
|
+
{"name": "temperature", "type": "numeric", "low": 20.0, "high": 120.0},
|
|
40
|
+
{"name": "catalyst", "type": "categorical", "choices": ["A", "B", "C"]}
|
|
41
|
+
],
|
|
42
|
+
"objectives": [{"name": "yield", "minimize": false}],
|
|
43
|
+
"num_suggestions": 2,
|
|
44
|
+
"algorithm": "bo",
|
|
45
|
+
"model": {"name": "gp", "min_samples": 2, "train_steps": 50},
|
|
46
|
+
"acq_target": {"name": "ucb", "beta": 2.0},
|
|
47
|
+
"solver": {"name": "ga", "pop_size": 40, "n_gen": 10},
|
|
48
|
+
"histories": {
|
|
49
|
+
"decisions": [
|
|
50
|
+
{"temperature": 40.0, "catalyst": "A"},
|
|
51
|
+
{"temperature": 80.0, "catalyst": "B"}
|
|
52
|
+
],
|
|
53
|
+
"observations": [
|
|
54
|
+
{"yield": 0.42},
|
|
55
|
+
{"yield": 0.61}
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
"seed": 7
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
参数类型仅支持 `numeric`、`integer`、`categorical`。优先使用 object-form history,
|
|
63
|
+
避免数组列顺序歧义。不得编造 observation、目标值或所谓最优点。
|
|
64
|
+
|
|
65
|
+
可选去重与约束:
|
|
66
|
+
|
|
67
|
+
```json
|
|
68
|
+
{
|
|
69
|
+
"diversity": {
|
|
70
|
+
"deduplicate": true,
|
|
71
|
+
"min_numeric_distance": {"temperature": 5.0},
|
|
72
|
+
"prefer_unique_categories": true
|
|
73
|
+
},
|
|
74
|
+
"constraints": [
|
|
75
|
+
{"type": "unique_batch"},
|
|
76
|
+
{"type": "avoid_seen_decisions"}
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
只报告 native 的 `suggestions`、`suggestion_metadata`、`warnings`、
|
|
82
|
+
`generated_candidate_count` 和 `diversity` 中实际存在的字段。空 suggestions 或失败
|
|
83
|
+
不得用本地 GP、UCB 或随机数替代。
|
|
84
|
+
|
|
85
|
+
## 已知但未暴露的旧能力
|
|
86
|
+
|
|
87
|
+
旧服务曾包含 session、space、objective、policy、suggest、observe、loop、status、
|
|
88
|
+
best 等有状态命令,但它们不是当前 Delta CLI operation。本 Skill 只保留这条能力
|
|
89
|
+
边界,不保留 URL 或 curl 示例,也不执行这些操作。需要扩展时,先由 Science Server
|
|
90
|
+
暴露 operation 和请求 schema,再更新本 reference。
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
# GSAS-II
|
|
1
|
+
# GSAS-II 详细规则
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
所有调用只走统一 wrapper。模拟必须使用真实 CIF;精修必须使用真实 powder data、
|
|
4
|
+
instrument parameters 和 phase CIF,任何失败不得用合成数据补齐。输入不是 CIF 时,
|
|
5
|
+
先使用当前任务中成功的 pymatgen `structure-convert` 结果。
|
|
4
6
|
|
|
5
7
|
## Health
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
operation:`health`,无 body。
|
|
8
10
|
|
|
9
11
|
Key response fields in `data`: `status`, `service`, `gsasii_available`,
|
|
10
12
|
`metadata`, and `limits`.
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
`data.status == "ok"` and `data.gsasii_available == true`.
|
|
14
|
+
只有用户明确要求健康检查时才调用;不要在模拟或精修前自动增加 health。
|
|
14
15
|
|
|
15
16
|
## Powder Simulation
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
operation:`powder-simulate`。
|
|
18
19
|
|
|
19
20
|
```json
|
|
20
21
|
{
|
|
@@ -48,7 +49,7 @@ text for pymatgen handoff when GSAS-II supports export for the phase.
|
|
|
48
49
|
Notes:
|
|
49
50
|
|
|
50
51
|
- `cif` should be valid CIF text. If the input is POSCAR/JSON/CSSR/XSF, use
|
|
51
|
-
|
|
52
|
+
pymatgen `structure-convert` first with `output_format: "cif"`.
|
|
52
53
|
- `instrument_parameters` should be GSAS-II instrument parameter text such as
|
|
53
54
|
`INST_XRY.PRM` when instrument-specific simulation is needed.
|
|
54
55
|
- For quick simulation only, `instrument_parameters` may be omitted. The service
|
|
@@ -62,7 +63,7 @@ Notes:
|
|
|
62
63
|
|
|
63
64
|
## Powder Refinement
|
|
64
65
|
|
|
65
|
-
|
|
66
|
+
operation:`powder-refine`。
|
|
66
67
|
|
|
67
68
|
```json
|
|
68
69
|
{
|
|
@@ -108,23 +109,8 @@ Notes:
|
|
|
108
109
|
- Refinement may return `valid: false` with partial phase/profile information
|
|
109
110
|
if GSAS-II constructed the project but a refinement step failed.
|
|
110
111
|
|
|
111
|
-
##
|
|
112
|
+
## 跨工具交接
|
|
112
113
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
python3 scripts/smoke_gsasii.py
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
Runs health, PbSO4 powder simulation, and project-return smoke tests.
|
|
120
|
-
|
|
121
|
-
```bash
|
|
122
|
-
python3 scripts/workflow_pymatgen_gsasii.py
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
Runs the cross-service workflow:
|
|
126
|
-
|
|
127
|
-
```text
|
|
128
|
-
pymatgen summary/symmetry -> pymatgen CIF conversion -> GSAS-II simulation
|
|
129
|
-
-> profile comparison -> GSAS-II refinement -> pymatgen final check
|
|
130
|
-
```
|
|
114
|
+
结构转换、衍射模拟和精修必须在本 Skill 内通过 wrapper 逐步完成:
|
|
115
|
+
`pymatgen structure-convert -> gsasii powder-simulate/powder-refine`。下游只使用上一步
|
|
116
|
+
成功 native 中的结构文本或 profile;不得执行本地脚本或直连服务。
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
# LAMMPS
|
|
1
|
+
# LAMMPS 详细规则
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
所有调用只走统一 wrapper。LAMMPS 不从化学式、CIF 或 POSCAR 自动推断 data、原子
|
|
4
|
+
类型、势函数与边界条件。成功执行不表示物理收敛或生产可用。
|
|
4
5
|
|
|
5
6
|
## Health
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
operation:`health`,无 body。
|
|
8
9
|
|
|
9
10
|
Key response fields in `data`: `status`, `service`, `lammps_available`,
|
|
10
11
|
`metadata`, and `limits`.
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
`data.status == "ok"` and `data.lammps_available == true`.
|
|
13
|
+
只有用户明确要求健康检查时才调用;不要在模拟前自动增加 health。
|
|
14
14
|
|
|
15
15
|
## Built-In Lennard-Jones Example
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
operation:`lj-melt-example`。
|
|
18
18
|
|
|
19
|
-
Returns a complete `request` payload for
|
|
19
|
+
Returns a complete `request` payload for the `run` operation, plus workflow notes
|
|
20
20
|
showing where pymatgen and GSAS-II fit around LAMMPS.
|
|
21
21
|
|
|
22
22
|
## Run
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
operation:`run`。
|
|
25
25
|
|
|
26
26
|
```json
|
|
27
27
|
{
|
|
@@ -59,3 +59,8 @@ Notes:
|
|
|
59
59
|
- The gateway is synchronous; keep interactive runs short.
|
|
60
60
|
- Force-field choice is caller responsibility. The service executes explicit
|
|
61
61
|
LAMMPS input and does not infer potentials from formulas or structures.
|
|
62
|
+
|
|
63
|
+
最终只复制当前 native 的 `last_thermo`、final step/temperature/total energy、
|
|
64
|
+
warnings 和用户要求的输出文件摘要。禁止把总能量除以原子数、替换步数、换算单位或
|
|
65
|
+
推测收敛性、稳定性。最小示例必须先调用 `lj-melt-example`,再把其
|
|
66
|
+
`native["request"]` 原样交给 `run`;不得传 wrapper 外层 envelope。
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
# LDM-BO
|
|
1
|
+
# LDM-BO 详细规则
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
runner.
|
|
3
|
+
所有调用只走统一 wrapper,不是本地 PDF2Dock runner。仅用于小分子 SMILES;
|
|
4
|
+
抗体、CDRH3 或 AntBO 场景必须使用 AntBO 能力边界。
|
|
5
|
+
provider、模型路径、Vina/ReaSyn/GPU/LLM 配置由服务端注入,不放入请求 JSON。
|
|
7
6
|
|
|
8
7
|
## Health
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
operation:`health`,无 body。
|
|
11
10
|
|
|
12
11
|
The response reports whether the adapter can see the mounted PDF2Dock
|
|
13
12
|
interpreter, `bo_api.py`, Vina binary, ReaSyn repo/interpreter/checkpoints, NN
|
|
@@ -16,7 +15,7 @@ settings degrade health because LDM methods need them.
|
|
|
16
15
|
|
|
17
16
|
## One-Step Recommend
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
operation:`recommend`。
|
|
20
19
|
|
|
21
20
|
Wraps `bo_api.recommend_next_smiles`.
|
|
22
21
|
|
|
@@ -46,9 +45,14 @@ Typical native response inside gateway `data`:
|
|
|
46
45
|
|
|
47
46
|
LDM methods may include an `llm` diagnostics object.
|
|
48
47
|
|
|
48
|
+
`acquisition_values` 只能按 native 原值报告。除非当前 native 明确给出字段定义,否则
|
|
49
|
+
不得把它描述为预测 Vina、预测 objective、不确定性、置信度、expected improvement,
|
|
50
|
+
也不得自行判断“越大/越小越好”。服务未返回推荐理由时,明确写“服务未返回推荐
|
|
51
|
+
理由”,不得根据分子骨架、杂原子或模型机制补写解释。
|
|
52
|
+
|
|
49
53
|
## Full Trajectory
|
|
50
54
|
|
|
51
|
-
|
|
55
|
+
operation:`trajectory`。
|
|
52
56
|
|
|
53
57
|
Wraps `bo_api.run_search_trajectory`.
|
|
54
58
|
|
|
@@ -88,7 +92,6 @@ returns a standard error envelope:
|
|
|
88
92
|
"message": "AutoDock Vina executable not found...",
|
|
89
93
|
"data": {
|
|
90
94
|
"endpoint": "/v1/trajectory",
|
|
91
|
-
"service_url": "http://ldm-bo-service:8895",
|
|
92
95
|
"ldm_bo_response": {
|
|
93
96
|
"error": "...",
|
|
94
97
|
"error_type": "ValueError",
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# LDM 科研工作流
|
|
2
|
+
|
|
3
|
+
这里的 **LDM / 大发现模型** 是用户可见的科研工作流名称,不是可以直接访问网关的
|
|
4
|
+
tool。在线计算必须先按任务语义选择 `ldm-bo`、`strbo` 或 `antbo`,再通过统一 wrapper
|
|
5
|
+
调用 Delta CLI;禁止运行旧 `large-discovery-model` Skill、`run_ldm_loop.py`、gateway
|
|
6
|
+
backend、`stream_widget` 中的联网命令或任何 HTTP 客户端。
|
|
7
|
+
|
|
8
|
+
## 路由
|
|
9
|
+
|
|
10
|
+
| 用户目标 | 实际 tool | 需要同时读取 |
|
|
11
|
+
| --- | --- | --- |
|
|
12
|
+
| 在给定 SMILES 候选池中推荐下一批,或运行 PDF2Dock/Vina+NN 轨迹 | `ldm-bo` | `references/ldm-bo.md` |
|
|
13
|
+
| 围绕服务端固定 KRAS G12D 生成、评估并迭代小分子 | `strbo` | `references/strbo.md` |
|
|
14
|
+
| 为指定抗原生成、评估并迭代 11-aa CDRH3 | `antbo` | `references/antbo.md` |
|
|
15
|
+
|
|
16
|
+
不得因为用户只说“LDM”“药物发现”就自动选择后端。根据实体、已有数据和目标判断;
|
|
17
|
+
仍无法区分时,结束并说明需要用户确认“小分子候选池、KRAS G12D 生成优化或抗体
|
|
18
|
+
CDRH3”中的哪一种。
|
|
19
|
+
|
|
20
|
+
## 最小执行范围
|
|
21
|
+
|
|
22
|
+
- 用户只要求检查参数时,只调用相应 `*-validate` operation。
|
|
23
|
+
- 用户只要求评估已有候选时,只调用 evaluate,不生成新候选。
|
|
24
|
+
- 用户只要求推荐下一批且已经给出历史记录时,只调用 suggest/recommend。
|
|
25
|
+
- 用户明确要求“完整迭代优化”时,才运行初始化、评估、建议、再评估的闭环。
|
|
26
|
+
- 用户未给轮数时,STRBO/AntBO 最多执行一个建议轮次;不得沿用旧 Skill 的 6/8 轮
|
|
27
|
+
隐式默认值。LDM-BO `trajectory` 的评估次数必须来自用户,缺失时先要求确认。
|
|
28
|
+
|
|
29
|
+
生成、评估、建议和 trajectory 都会消耗远端资源。一次自然语言中的“帮我优化”视为
|
|
30
|
+
执行授权,但不得擅自扩大候选数、轮数或切换后端。
|
|
31
|
+
|
|
32
|
+
## STRBO 完整闭环
|
|
33
|
+
|
|
34
|
+
1. 调用 `molecules-init` 或 `molecules-init-job`,取得初始 SMILES。
|
|
35
|
+
2. 调用 `molecules-evaluate` 或对应异步 operation,取得 `[vina, activity]`。
|
|
36
|
+
3. 使用当前成功 native 中的 SMILES 和 scores 构造 `history_xs/history_ys`。
|
|
37
|
+
4. 调用一次 `molecules-suggest-job`,按 STRBO reference 轮询至成功。
|
|
38
|
+
5. 只评估新建议,并把结果与当前任务内历史合并后返回。
|
|
39
|
+
|
|
40
|
+
提交 operation 不得重试。任一步失败、超时或返回数量不一致,立即结束;不得用旧
|
|
41
|
+
gateway、离线 mock、本地 RDKit/Vina 或模型猜测补全。
|
|
42
|
+
|
|
43
|
+
## AntBO 完整闭环
|
|
44
|
+
|
|
45
|
+
1. 用户必须提供抗原;未提供时不得替用户选择。
|
|
46
|
+
2. 必要时调用一次 `ldm-health`,确认抗原与 CDRH3 长度约束。
|
|
47
|
+
3. 调用 `ldm-init` 取得初始 CDRH3,再调用 `evaluate` 取得结合能。
|
|
48
|
+
4. 使用当前成功 native 构造一维 `history_ys`,调用一次 `ldm-suggest`。
|
|
49
|
+
5. 只评估新建议,并返回当前任务内的候选与结合能。
|
|
50
|
+
|
|
51
|
+
不得把 AntBO 的一维 score 改成 STRBO 的二维 score,也不得把 CDRH3 交给小分子
|
|
52
|
+
LDM-BO。
|
|
53
|
+
|
|
54
|
+
## 固定候选池与轨迹
|
|
55
|
+
|
|
56
|
+
- 已有候选池和历史分数,要求下一批:使用 `ldm-bo/recommend`。
|
|
57
|
+
- 用户明确要求完整 PDF2Dock/Vina+NN 搜索并给出评估次数:使用
|
|
58
|
+
`ldm-bo/trajectory`。
|
|
59
|
+
- 不得把 `ldm-bo` 的 provider、模型路径、密钥、GPU 或 Vina 配置放进请求;这些由
|
|
60
|
+
Science Server 管理。
|
|
61
|
+
|
|
62
|
+
## 结果与展示
|
|
63
|
+
|
|
64
|
+
只报告当前 Delta CLI native 中真实存在的候选、目标值、warnings、job_id、状态和
|
|
65
|
+
服务端 provenance。不得自行添加相似度阈值、机制解释、湿实验结论或“最优”断言;
|
|
66
|
+
只有在方向明确且比较集合完整时,才能按实际目标值指出当前集合中的最好候选。
|
|
67
|
+
推荐结果中的 acquisition value 不是预测目标值、置信度或推荐理由;除非 native
|
|
68
|
+
明确给出语义和方向,否则只作为原始采集函数值报告。
|
|
69
|
+
|
|
70
|
+
LDM 的仪表盘是展示层,不是计算入口。用户明确要求图表时,先完成一次 CLI 计算,
|
|
71
|
+
再让外层使用同一份已验证结果绘图;禁止为了仪表盘再次提交远端任务。普通请求直接
|
|
72
|
+
返回简洁文本。
|
|
@@ -1,21 +1,26 @@
|
|
|
1
|
-
# PubChem
|
|
1
|
+
# PubChem 详细规则
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
只能通过当前 Skill 目录下的 `scripts/invoke.py` 调用。wrapper 已解包服务
|
|
4
4
|
信封,因此以下文档所说的业务 `data` 在 wrapper 结果中就是 `result["native"]`
|
|
5
5
|
顶层;禁止再读取 `result["native"]["data"]`。本文件中的 URL 只用于说明 endpoint
|
|
6
|
-
schema,不授权直接 HTTP
|
|
6
|
+
schema,不授权直接 HTTP。普通名称基础查询只调用一次 `compound-summary`;多个名称
|
|
7
|
+
只调用一次 `compound-batch-summary`,默认 body 仅包含 `identifiers` 和
|
|
8
|
+
`namespace:"name"`,不得先调用 health/schema。
|
|
7
9
|
|
|
8
|
-
|
|
10
|
+
结果直接从 `native` 投影。批量记录位于 `native.results[*]`,原始标签在 `input`,
|
|
11
|
+
属性在嵌套 `properties`。SMILES 回退顺序固定为
|
|
12
|
+
`CanonicalSMILES -> ConnectivitySMILES -> SMILES -> IsomericSMILES`。
|
|
13
|
+
PubChem `XLogP` 与 RDKit `MolLogP` 不得互换;not_found 不得用本地计算补值。
|
|
9
14
|
|
|
10
15
|
Namespaces: `cid`, `name`, `smiles`, `inchi`, `inchikey`, `formula`.
|
|
11
16
|
|
|
12
17
|
## Health
|
|
13
18
|
|
|
14
|
-
|
|
19
|
+
operation:`health`,无 body。
|
|
15
20
|
|
|
16
21
|
## Resolve CIDs
|
|
17
22
|
|
|
18
|
-
|
|
23
|
+
operation:`compound-resolve-cids`。
|
|
19
24
|
|
|
20
25
|
```json
|
|
21
26
|
{"identifier": "aspirin", "namespace": "name", "max_records": 20}
|
|
@@ -25,7 +30,7 @@ Namespaces: `cid`, `name`, `smiles`, `inchi`, `inchikey`, `formula`.
|
|
|
25
30
|
|
|
26
31
|
## Properties
|
|
27
32
|
|
|
28
|
-
|
|
33
|
+
operation:`compound-properties`。
|
|
29
34
|
|
|
30
35
|
```json
|
|
31
36
|
{
|
|
@@ -45,7 +50,7 @@ Allowed properties include `MolecularFormula`, `MolecularWeight`,
|
|
|
45
50
|
|
|
46
51
|
## Synonyms
|
|
47
52
|
|
|
48
|
-
|
|
53
|
+
operation:`compound-synonyms`。
|
|
49
54
|
|
|
50
55
|
```json
|
|
51
56
|
{"identifier": "2244", "namespace": "cid", "max_synonyms": 50}
|
|
@@ -55,7 +60,7 @@ Allowed properties include `MolecularFormula`, `MolecularWeight`,
|
|
|
55
60
|
|
|
56
61
|
## Summary
|
|
57
62
|
|
|
58
|
-
|
|
63
|
+
operation:`compound-summary`。
|
|
59
64
|
|
|
60
65
|
```json
|
|
61
66
|
{
|
|
@@ -76,7 +81,7 @@ an equivalent key such as `ConnectivitySMILES`.
|
|
|
76
81
|
|
|
77
82
|
## Batch Summary
|
|
78
83
|
|
|
79
|
-
|
|
84
|
+
operation:`compound-batch-summary`。
|
|
80
85
|
|
|
81
86
|
```json
|
|
82
87
|
{
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
# pymatgen
|
|
1
|
+
# pymatgen 详细规则
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
所有调用只走统一 wrapper。无机化学式、组成和式量优先使用 pymatgen,不用 PubChem
|
|
4
|
+
或本地元素表替代。结构 operation 必须发送完整结构文本,不能发送本地文件路径;
|
|
5
|
+
支持 `cif`、`poscar`、`json`、`cssr`、`xsf`,不接收 LAMMPS data/dump。
|
|
4
6
|
|
|
5
7
|
## Health
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
operation:`health`,无 body。
|
|
8
10
|
|
|
9
11
|
## Composition Parse
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
operation:`composition-parse`。
|
|
12
14
|
|
|
13
15
|
```json
|
|
14
16
|
{"formula": "LiFePO4", "format": "formula"}
|
|
@@ -21,9 +23,7 @@ Key response fields in `data`: `valid`, `formula`, `reduced_formula`,
|
|
|
21
23
|
|
|
22
24
|
## Structure Parse / Summary
|
|
23
25
|
|
|
24
|
-
`
|
|
25
|
-
|
|
26
|
-
`POST /chem/pymatgen/structure/summary`
|
|
26
|
+
operation:`structure-parse` 或 `structure-summary`。
|
|
27
27
|
|
|
28
28
|
```json
|
|
29
29
|
{"input": "<CIF text>", "format": "cif", "primitive": false}
|
|
@@ -37,7 +37,7 @@ Summary fields include `formula`, `reduced_formula`, `chemical_system`,
|
|
|
37
37
|
|
|
38
38
|
## Structure Convert
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
operation:`structure-convert`。
|
|
41
41
|
|
|
42
42
|
```json
|
|
43
43
|
{
|
|
@@ -52,7 +52,7 @@ Output formats: `cif`, `poscar`, `json`, `cssr`, `xsf`.
|
|
|
52
52
|
|
|
53
53
|
## Symmetry
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
operation:`structure-symmetry`。
|
|
56
56
|
|
|
57
57
|
```json
|
|
58
58
|
{
|
|
@@ -1,18 +1,24 @@
|
|
|
1
|
-
# RDKit
|
|
1
|
+
# RDKit 详细规则
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
只能通过当前 Skill 目录下的 `scripts/invoke.py` 调用。wrapper 已解包服务
|
|
4
4
|
信封,因此以下业务响应在 wrapper 结果中位于 `result["native"]` 顶层;禁止读取
|
|
5
|
-
`result["native"]["data"]
|
|
5
|
+
`result["native"]["data"]`。这里只记录 operation schema,不授权直接 HTTP。
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
一个请求只执行完成目标所需的最少调用。同时校验、规范化并计算基础描述符时使用一次
|
|
8
|
+
`batch-parse-describe`,payload 使用 `molecules:[{id,smiles}]`,不得拆成 parse 和
|
|
9
|
+
descriptors。多个分子的全对相似度使用一次 `similarity-matrix`;排名字段固定为
|
|
10
|
+
`a`、`b`、`similarity`,不是 `i`、`j`、`score`。
|
|
11
|
+
|
|
12
|
+
只报告 native 实际存在的描述符。渲染 PNG 时只解码文档指定字段,并验证字节以
|
|
13
|
+
`89 50 4e 47 0d 0a 1a 0a` 开头;不得把 JSON envelope 保存成图片。
|
|
8
14
|
|
|
9
15
|
## Health
|
|
10
16
|
|
|
11
|
-
|
|
17
|
+
operation:`health`,无 body。
|
|
12
18
|
|
|
13
19
|
## Parse
|
|
14
20
|
|
|
15
|
-
|
|
21
|
+
operation:`parse`。
|
|
16
22
|
|
|
17
23
|
```json
|
|
18
24
|
{"input": "CCO", "format": "smiles", "sanitize": true}
|
|
@@ -26,7 +32,7 @@ Key response fields in `data`: `valid`, `canonical_smiles`, `formula`,
|
|
|
26
32
|
|
|
27
33
|
## Descriptors
|
|
28
34
|
|
|
29
|
-
|
|
35
|
+
operation:`descriptors`。
|
|
30
36
|
|
|
31
37
|
```json
|
|
32
38
|
{"smiles": "CCO", "descriptor_set": "basic", "sanitize": true}
|
|
@@ -39,7 +45,7 @@ Key response fields in `data`: `valid`, `canonical_smiles`, `formula`,
|
|
|
39
45
|
|
|
40
46
|
## Batch Descriptors
|
|
41
47
|
|
|
42
|
-
|
|
48
|
+
operation:`batch-descriptors`。
|
|
43
49
|
|
|
44
50
|
```json
|
|
45
51
|
{"smiles": ["CCO", "c1ccccc1"], "descriptor_set": "basic", "sanitize": true}
|
|
@@ -49,7 +55,7 @@ Limits: 1-500 SMILES.
|
|
|
49
55
|
|
|
50
56
|
## Batch Parse Describe
|
|
51
57
|
|
|
52
|
-
|
|
58
|
+
operation:`batch-parse-describe`。
|
|
53
59
|
|
|
54
60
|
```json
|
|
55
61
|
{
|
|
@@ -69,7 +75,7 @@ fields, `descriptors`, optional `fingerprint_metadata`, `on_bits`, `bit_count`,
|
|
|
69
75
|
|
|
70
76
|
## Render
|
|
71
77
|
|
|
72
|
-
|
|
78
|
+
operation:`render`。
|
|
73
79
|
|
|
74
80
|
```json
|
|
75
81
|
{"smiles": "CCO", "image_format": "svg", "width": 450, "height": 320}
|
|
@@ -80,7 +86,7 @@ Width/height range: 150-2000.
|
|
|
80
86
|
|
|
81
87
|
## Fingerprint
|
|
82
88
|
|
|
83
|
-
|
|
89
|
+
operation:`fingerprint`。
|
|
84
90
|
|
|
85
91
|
```json
|
|
86
92
|
{"smiles": "CCO", "radius": 2, "n_bits": 2048}
|
|
@@ -90,7 +96,7 @@ Morgan fingerprint parameters: `radius` 1-6, `n_bits` 128-8192.
|
|
|
90
96
|
|
|
91
97
|
## Similarity
|
|
92
98
|
|
|
93
|
-
|
|
99
|
+
operation:`similarity`。
|
|
94
100
|
|
|
95
101
|
```json
|
|
96
102
|
{"query_smiles": "CCO", "target_smiles": "CCCO", "radius": 2, "n_bits": 2048}
|
|
@@ -100,7 +106,7 @@ Returns Tanimoto similarity.
|
|
|
100
106
|
|
|
101
107
|
## Similarity Matrix
|
|
102
108
|
|
|
103
|
-
|
|
109
|
+
operation:`similarity-matrix`。
|
|
104
110
|
|
|
105
111
|
```json
|
|
106
112
|
{
|
|
@@ -124,7 +130,7 @@ Do not expect `i`, `j`, or `score` fields.
|
|
|
124
130
|
|
|
125
131
|
## Substructure
|
|
126
132
|
|
|
127
|
-
|
|
133
|
+
operation:`substructure`。
|
|
128
134
|
|
|
129
135
|
```json
|
|
130
136
|
{"query_smarts": "c1ccccc1", "target_smiles": ["c1ccccc1", "CCO"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Delta Science 路由索引
|
|
2
|
+
|
|
3
|
+
本文件只描述稳定的科研意图边界,不复制 Science Server 的工具和 endpoint 清单。
|
|
4
|
+
实际可用工具以 `delta-cli science list` 和 `delta-cli science endpoints list` 返回的
|
|
5
|
+
实时目录为准。
|
|
6
|
+
|
|
7
|
+
## 路由优先级
|
|
8
|
+
|
|
9
|
+
- 普通化合物名称、CID 和公共属性使用 PubChem;已有 SMILES/InChI 且需要结构计算时
|
|
10
|
+
使用 RDKit。
|
|
11
|
+
- 无机化学式、组成、CIF、POSCAR 和空间群使用 pymatgen;粉末衍射模拟或 Rietveld
|
|
12
|
+
精修使用 GSAS-II。
|
|
13
|
+
- 明确的 LAMMPS input、data 和力场任务使用 LAMMPS;不得从化学式或 CIF 猜测势函数。
|
|
14
|
+
- 通用数值、整数或分类实验变量优化使用 Delta-BO。
|
|
15
|
+
- 固定 SMILES 候选池或 PDF2Dock 轨迹使用 LDM-BO;固定 KRAS G12D 生成式优化使用
|
|
16
|
+
STRBO;反应条件与真实历史得率使用 SynBO;抗体 CDRH3 使用 AntBO。
|
|
17
|
+
- “LDM/大发现模型”是跨上述三类能力的工作流意图,先读取 `ldm.md` 决定唯一后端,
|
|
18
|
+
不是服务端 tool,也不得路由到旧 `large-discovery-model` Skill。
|
|
19
|
+
|
|
20
|
+
## 已验证 reference
|
|
21
|
+
|
|
22
|
+
- [pubchem.md](pubchem.md)
|
|
23
|
+
- [rdkit.md](rdkit.md)
|
|
24
|
+
- [pymatgen.md](pymatgen.md)
|
|
25
|
+
- [gsasii.md](gsasii.md)
|
|
26
|
+
- [lammps.md](lammps.md)
|
|
27
|
+
- [delta-bo.md](delta-bo.md)
|
|
28
|
+
- [ldm-bo.md](ldm-bo.md)
|
|
29
|
+
- [ldm.md](ldm.md)
|
|
30
|
+
- [strbo.md](strbo.md)
|
|
31
|
+
- [synbo.md](synbo.md)
|
|
32
|
+
- [antbo.md](antbo.md)
|
|
33
|
+
|
|
34
|
+
以上 reference 是已验证参数契约,不是服务端完整目录。用户明确点名新工具时,按
|
|
35
|
+
`SKILL.md` 的实时 catalog 流程发现工具和 endpoint;若目录未返回请求 schema,不猜测
|
|
36
|
+
请求体。
|