@delta-infra/cli 1.0.75 → 1.0.77

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.
Files changed (54) hide show
  1. package/README.md +427 -411
  2. package/checksums.txt +5 -5
  3. package/package.json +2 -1
  4. package/scripts/install-wizard.js +596 -596
  5. package/scripts/install.js +400 -400
  6. package/scripts/run.js +65 -65
  7. package/skills/antbo-ldm-guard/SKILL.md +58 -54
  8. package/skills/antbo-ldm-guard/agents/openai.yaml +4 -4
  9. package/skills/antbo-service/SKILL.md +79 -74
  10. package/skills/antbo-service/agents/openai.yaml +4 -4
  11. package/skills/antbo-service/references/operations.md +45 -45
  12. package/skills/delta-bo/SKILL.md +36 -31
  13. package/skills/delta-bo/agents/openai.yaml +4 -4
  14. package/skills/delta-bo/references/endpoints.md +263 -263
  15. package/skills/delta-sandbox/SKILL.md +356 -356
  16. package/skills/delta-sandbox/agents/openai.yaml +4 -4
  17. package/skills/delta-sandbox/references/commands.md +56 -56
  18. package/skills/delta-sandbox/references/lifecycle.md +92 -92
  19. package/skills/delta-sandbox/references/recipes.md +133 -133
  20. package/skills/delta-science/SKILL.md +171 -166
  21. package/skills/delta-science/agents/openai.yaml +4 -4
  22. package/skills/delta-science/references/cli-contract.md +84 -84
  23. package/skills/delta-science/references/generated-catalog.md +48 -0
  24. package/skills/delta-science/references/services.md +112 -112
  25. package/skills/delta-science/references/workflows.md +44 -44
  26. package/skills/delta-science/scripts/generated_catalog.py +69 -0
  27. package/skills/delta-science/scripts/invoke.py +263 -329
  28. package/skills/delta-shared/SKILL.md +95 -95
  29. package/skills/delta-shared/agents/openai.yaml +4 -4
  30. package/skills/gsasii/SKILL.md +42 -37
  31. package/skills/gsasii/agents/openai.yaml +4 -4
  32. package/skills/gsasii/references/endpoints.md +130 -130
  33. package/skills/lammps/SKILL.md +39 -34
  34. package/skills/lammps/agents/openai.yaml +4 -4
  35. package/skills/lammps/references/endpoints.md +61 -61
  36. package/skills/ldm-bo/SKILL.md +35 -30
  37. package/skills/ldm-bo/agents/openai.yaml +4 -4
  38. package/skills/ldm-bo/references/endpoints.md +127 -127
  39. package/skills/manifest.json +17 -17
  40. package/skills/pubchem/SKILL.md +93 -88
  41. package/skills/pubchem/agents/openai.yaml +4 -4
  42. package/skills/pubchem/references/endpoints.md +122 -122
  43. package/skills/pubchem/references/operations.md +41 -41
  44. package/skills/pymatgen/SKILL.md +54 -49
  45. package/skills/pymatgen/agents/openai.yaml +4 -4
  46. package/skills/pymatgen/references/endpoints.md +66 -66
  47. package/skills/rdkit/SKILL.md +112 -107
  48. package/skills/rdkit/agents/openai.yaml +4 -4
  49. package/skills/rdkit/references/endpoints.md +133 -133
  50. package/skills/rdkit/references/operations.md +64 -64
  51. package/skills/science-tools.json +127 -0
  52. package/skills/synbo-service/SKILL.md +36 -31
  53. package/skills/synbo-service/agents/openai.yaml +4 -4
  54. package/skills/synbo-service/references/endpoints.md +157 -157
@@ -1,68 +1,68 @@
1
- # pymatgen Endpoint Reference
2
-
3
- All paths are relative to `http://111.2.199.31:52317/api/v1`.
4
-
5
- ## Health
6
-
7
- `GET /chem/pymatgen/health`
8
-
9
- ## Composition Parse
10
-
11
- `POST /chem/pymatgen/composition/parse`
12
-
13
- ```json
14
- {"formula": "LiFePO4", "format": "formula"}
15
- ```
16
-
17
- Key response fields in `data`: `valid`, `formula`, `reduced_formula`,
18
- `alphabetic_formula`, `anonymous_formula`, `chemical_system`,
19
- `number_of_atoms`, `weight`, `element_amounts`, `atomic_fractions`,
20
- `weight_fractions`, `error`.
21
-
22
- ## Structure Parse / Summary
23
-
24
- `POST /chem/pymatgen/structure/parse`
25
-
26
- `POST /chem/pymatgen/structure/summary`
27
-
28
- ```json
29
- {"input": "<CIF text>", "format": "cif", "primitive": false}
30
- ```
31
-
32
- Input formats: `cif`, `poscar`, `json`, `cssr`, `xsf`.
33
-
34
- Summary fields include `formula`, `reduced_formula`, `chemical_system`,
35
- `nsites`, `nelements`, `density`, `volume`, `lattice`, `element_amounts`, and
36
- `species`.
37
-
38
- ## Structure Convert
39
-
40
- `POST /chem/pymatgen/structure/convert`
41
-
42
- ```json
43
- {
44
- "input": "<CIF text>",
45
- "input_format": "cif",
46
- "output_format": "poscar",
47
- "primitive": false
48
- }
49
- ```
50
-
51
- Output formats: `cif`, `poscar`, `json`, `cssr`, `xsf`.
52
-
53
- ## Symmetry
54
-
55
- `POST /chem/pymatgen/structure/symmetry`
56
-
57
- ```json
58
- {
59
- "input": "<CIF text>",
60
- "format": "cif",
61
- "primitive": false,
62
- "symprec": 0.01,
63
- "angle_tolerance": 5.0
64
- }
65
- ```
66
-
1
+ # pymatgen Endpoint Reference
2
+
3
+ All paths are relative to `http://111.2.199.31:52317/api/v1`.
4
+
5
+ ## Health
6
+
7
+ `GET /chem/pymatgen/health`
8
+
9
+ ## Composition Parse
10
+
11
+ `POST /chem/pymatgen/composition/parse`
12
+
13
+ ```json
14
+ {"formula": "LiFePO4", "format": "formula"}
15
+ ```
16
+
17
+ Key response fields in `data`: `valid`, `formula`, `reduced_formula`,
18
+ `alphabetic_formula`, `anonymous_formula`, `chemical_system`,
19
+ `number_of_atoms`, `weight`, `element_amounts`, `atomic_fractions`,
20
+ `weight_fractions`, `error`.
21
+
22
+ ## Structure Parse / Summary
23
+
24
+ `POST /chem/pymatgen/structure/parse`
25
+
26
+ `POST /chem/pymatgen/structure/summary`
27
+
28
+ ```json
29
+ {"input": "<CIF text>", "format": "cif", "primitive": false}
30
+ ```
31
+
32
+ Input formats: `cif`, `poscar`, `json`, `cssr`, `xsf`.
33
+
34
+ Summary fields include `formula`, `reduced_formula`, `chemical_system`,
35
+ `nsites`, `nelements`, `density`, `volume`, `lattice`, `element_amounts`, and
36
+ `species`.
37
+
38
+ ## Structure Convert
39
+
40
+ `POST /chem/pymatgen/structure/convert`
41
+
42
+ ```json
43
+ {
44
+ "input": "<CIF text>",
45
+ "input_format": "cif",
46
+ "output_format": "poscar",
47
+ "primitive": false
48
+ }
49
+ ```
50
+
51
+ Output formats: `cif`, `poscar`, `json`, `cssr`, `xsf`.
52
+
53
+ ## Symmetry
54
+
55
+ `POST /chem/pymatgen/structure/symmetry`
56
+
57
+ ```json
58
+ {
59
+ "input": "<CIF text>",
60
+ "format": "cif",
61
+ "primitive": false,
62
+ "symprec": 0.01,
63
+ "angle_tolerance": 5.0
64
+ }
65
+ ```
66
+
67
67
  Returns `space_group_symbol`, `space_group_number`, `crystal_system`,
68
68
  `point_group_symbol`, `hall`, and `nsites`.
@@ -1,107 +1,112 @@
1
- ---
2
- name: rdkit
3
- description: 当用户需要通过已部署的 Delta Science 服务校验或规范化 SMILES/InChI、计算 RDKit 描述符、指纹、相似度、渲染或子结构筛选时使用。所有实时请求只能由 python_repl 直接执行 delta-science Skill 的 invoke.py;禁止 Bash、目录探测、直接 HTTP、本地 RDKit 和 native.data 路径。
4
- ---
5
-
6
- # RDKit 服务
7
-
8
- ## 不可违反的执行规则
9
-
10
- 1. 第一个且唯一允许用于实时 Science 调用的工具是 `python_repl`。
11
- `python_repl` 的工具参数对象只能包含 `code`;禁止 `deps`、`dependencies`、
12
- `packages` 或其他参数。
13
- 2. 在 `python_repl` 中直接执行同级 Skill 的
14
- `$SKILLS_ROOT/delta-science/scripts/invoke.py`。`SKILLS_ROOT` 只能通过
15
- `os.environ["SKILLS_ROOT"]` 读取,不能把 `@SKILLS_ROOT` 当成目录。
16
- 3. 禁止使用 Bash、`list_dir`、`read_file`、`which`、`where`、`ls`,禁止检查
17
- wrapper 或寻找 CLI,禁止执行字面命令 `CLI`、`cli`、`delta-cli`。
18
- 4. 禁止 `curl`、`requests`、`httpx`、浏览器和本地 RDKit 回退。
19
- 5. wrapper 成功后,业务结果就在 `result["native"]` 顶层;绝不读取
20
- `result["native"]["data"]`。
21
- 6. 一个请求只执行完成任务所需的最少调用。失败后不得自行探测路径、改走 HTTP
22
- 或改用本地计算。
23
-
24
- ## 唯一调用模板
25
-
26
- ```python
27
- import json, os, subprocess, sys
28
- wrapper = os.path.join(os.environ["SKILLS_ROOT"], "delta-science", "scripts", "invoke.py")
29
- payload = {
30
- "molecules": [{"id": "aspirin", "smiles": "CC(=O)OC1=CC=CC=C1C(=O)O"}],
31
- "descriptor_set": "basic",
32
- "sanitize": True,
33
- }
34
- p = subprocess.run(
35
- [sys.executable, wrapper, "--tool", "rdkit", "--endpoint", "batch-parse-describe",
36
- "--data-json", json.dumps(payload)],
37
- capture_output=True, text=True, shell=False,
38
- )
39
- if p.returncode != 0:
40
- raise RuntimeError(p.stderr or p.stdout)
41
- r = json.loads(p.stdout)
42
- if r.get("ok") is not True or r.get("transport") != "delta-cli":
43
- raise RuntimeError(r)
44
- n = r["native"]
45
- item = n["results"][0]
46
- answer = {
47
- "endpoint": r["endpoint"],
48
- "valid": item["valid"],
49
- "canonical_smiles": item.get("canonical_smiles"),
50
- "descriptors": item.get("descriptors"),
51
- "warnings": item.get("warnings", []),
52
- }
53
- print(json.dumps(answer, ensure_ascii=False))
54
- ```
55
-
56
- 只替换 payload 和逻辑 endpoint。不要先调用 health,也不要增加第二次 parse 或
57
- descriptors 调用。只要进程退出码、`ok`、`transport` 和解析均成功,本次调用就已
58
- 完成;不得因为界面未显示 Python 表达式值而重复调用,不得通过打印 stdout、stderr
59
- 或完整 native 调试。
60
-
61
- 成功打印有界 JSON 后,立即调用 `step_finish(status="done", summary=<该 JSON>)`
62
- 恰好一次,不设置 `output_ref`,随后不得输出自由文本或调用工具。失败时调用
63
- `step_finish(status="failed", summary=<原始错误的短摘要>)`,禁止重试、调试打印或
64
- 路径探测。
65
-
66
- ## 端点选择
67
-
68
- - 同时要求解析和基础描述符:只调用一次 `batch-parse-describe`,payload 必须使用
69
- `molecules`,每项使用 `id` 和 `smiles`;`descriptor_set` 为 `basic`,
70
- `sanitize` 为 `true`。
71
- - 只解析或规范化一个输入:`parse`,payload 为
72
- `{"input":"...","format":"smiles"}` 或相应 InChI 格式。
73
- - 只计算描述符:`descriptors`;批量只计算描述符:`batch-descriptors`。
74
- - 两个分子的相似度:`similarity`;多个分子的全对相似度:
75
- `similarity-matrix`。
76
- - 渲染:`render`;指纹:`fingerprint`;SMARTS 筛选:`substructure`。
77
-
78
- 非默认 operation 先读 `references/operations.md` 中对应小节;完整字段和允许值再见
79
- `references/endpoints.md`。不要根据其他服务相似端点猜 schema。
80
-
81
- ## 多分子相似度
82
-
83
- 名称必须先由 PubChem Skill 得到 SMILES,再执行一次 `similarity-matrix`:
84
-
85
- ```python
86
- payload = {
87
- "molecules": [{"id": name, "smiles": smiles} for name, smiles in resolved],
88
- "fingerprint": {"type": "morgan", "radius": 2, "n_bits": 2048},
89
- "sanitize": True,
90
- }
91
- ```
92
-
93
- 结果从 `n["matrix"]` 和 `n["ranked_pairs"]` 读取。每个排名项固定为
94
- `{"a": 名称, "b": 名称, "similarity": 数值}`;禁止读取 `i`、`j`、
95
- `score`,禁止自行重算或添加阈值解释。
96
-
97
- ## 结果与失败边界
98
-
99
- - 只报告本次 `native` 返回的字段、数值和警告,不用记忆补值。
100
- - 描述符只能逐项复制 `item["descriptors"]` 中实际存在的键和值;不得补充
101
- `NumAromaticRings`、形式电荷、官能团、手性、结构原因、单位或解释,除非这些字段
102
- 确实由本次 native 返回且用户明确要求。
103
- - `valid: false` 是化学输入校验失败,原样报告 `error`/`warnings`。
104
- - wrapper、CLI 或后端失败时,报告实际阶段和错误;不要继续探测或回退。
105
- - 渲染结果只有在解码后的字节以 PNG magic bytes 开头时才能保存为 `.png`;禁止
106
- 把 JSON envelope 保存成图片。
107
- - PubChem 的 `XLogP` 与 RDKit 的 `MolLogP` 不是同一来源,不得互相替代。
1
+ ---
2
+ name: rdkit
3
+ description: 当用户需要通过已部署的 Delta Science 服务校验或规范化 SMILES/InChI、计算 RDKit 描述符、指纹、相似度、渲染或子结构筛选时使用。所有实时请求只能由 python_repl 直接执行 delta-science Skill 的 invoke.py;禁止 Bash、目录探测、直接 HTTP、本地 RDKit 和 native.data 路径。
4
+ metadata:
5
+ allowed-tools:
6
+ - read_file
7
+ - python_repl
8
+ - step_finish
9
+ ---
10
+
11
+ # RDKit 服务
12
+
13
+ ## 不可违反的执行规则
14
+
15
+ 1. 第一个且唯一允许用于实时 Science 调用的工具是 `python_repl`。
16
+ `python_repl` 的工具参数对象只能包含 `code`;禁止 `deps`、`dependencies`、
17
+ `packages` 或其他参数。
18
+ 2. 在 `python_repl` 中直接执行同级 Skill 的
19
+ `$SKILLS_ROOT/delta-science/scripts/invoke.py`。`SKILLS_ROOT` 只能通过
20
+ `os.environ["SKILLS_ROOT"]` 读取,不能把 `@SKILLS_ROOT` 当成目录。
21
+ 3. 禁止使用 Bash、`list_dir`、`read_file`、`which`、`where`、`ls`,禁止检查
22
+ wrapper 或寻找 CLI,禁止执行字面命令 `CLI`、`cli`、`delta-cli`。
23
+ 4. 禁止 `curl`、`requests`、`httpx`、浏览器和本地 RDKit 回退。
24
+ 5. wrapper 成功后,业务结果就在 `result["native"]` 顶层;绝不读取
25
+ `result["native"]["data"]`。
26
+ 6. 一个请求只执行完成任务所需的最少调用。失败后不得自行探测路径、改走 HTTP
27
+ 或改用本地计算。
28
+
29
+ ## 唯一调用模板
30
+
31
+ ```python
32
+ import json, os, subprocess, sys
33
+ wrapper = os.path.join(os.environ["SKILLS_ROOT"], "delta-science", "scripts", "invoke.py")
34
+ payload = {
35
+ "molecules": [{"id": "aspirin", "smiles": "CC(=O)OC1=CC=CC=C1C(=O)O"}],
36
+ "descriptor_set": "basic",
37
+ "sanitize": True,
38
+ }
39
+ p = subprocess.run(
40
+ [sys.executable, wrapper, "--tool", "rdkit", "--endpoint", "batch-parse-describe",
41
+ "--data-json", json.dumps(payload)],
42
+ capture_output=True, text=True, shell=False,
43
+ )
44
+ if p.returncode != 0:
45
+ raise RuntimeError(p.stderr or p.stdout)
46
+ r = json.loads(p.stdout)
47
+ if r.get("ok") is not True or r.get("transport") != "delta-cli":
48
+ raise RuntimeError(r)
49
+ n = r["native"]
50
+ item = n["results"][0]
51
+ answer = {
52
+ "endpoint": r["endpoint"],
53
+ "valid": item["valid"],
54
+ "canonical_smiles": item.get("canonical_smiles"),
55
+ "descriptors": item.get("descriptors"),
56
+ "warnings": item.get("warnings", []),
57
+ }
58
+ print(json.dumps(answer, ensure_ascii=False))
59
+ ```
60
+
61
+ 只替换 payload 和逻辑 endpoint。不要先调用 health,也不要增加第二次 parse 或
62
+ descriptors 调用。只要进程退出码、`ok`、`transport` 和解析均成功,本次调用就已
63
+ 完成;不得因为界面未显示 Python 表达式值而重复调用,不得通过打印 stdout、stderr
64
+ 或完整 native 调试。
65
+
66
+ 成功打印有界 JSON 后,立即调用 `step_finish(status="done", summary=<该 JSON>)`
67
+ 恰好一次,不设置 `output_ref`,随后不得输出自由文本或调用工具。失败时调用
68
+ `step_finish(status="failed", summary=<原始错误的短摘要>)`,禁止重试、调试打印或
69
+ 路径探测。
70
+
71
+ ## 端点选择
72
+
73
+ - 同时要求解析和基础描述符:只调用一次 `batch-parse-describe`,payload 必须使用
74
+ `molecules`,每项使用 `id` 和 `smiles`;`descriptor_set` 为 `basic`,
75
+ `sanitize` 为 `true`。
76
+ - 只解析或规范化一个输入:`parse`,payload 为
77
+ `{"input":"...","format":"smiles"}` 或相应 InChI 格式。
78
+ - 只计算描述符:`descriptors`;批量只计算描述符:`batch-descriptors`。
79
+ - 两个分子的相似度:`similarity`;多个分子的全对相似度:
80
+ `similarity-matrix`。
81
+ - 渲染:`render`;指纹:`fingerprint`;SMARTS 筛选:`substructure`。
82
+
83
+ 非默认 operation 先读 `references/operations.md` 中对应小节;完整字段和允许值再见
84
+ `references/endpoints.md`。不要根据其他服务相似端点猜 schema。
85
+
86
+ ## 多分子相似度
87
+
88
+ 名称必须先由 PubChem Skill 得到 SMILES,再执行一次 `similarity-matrix`:
89
+
90
+ ```python
91
+ payload = {
92
+ "molecules": [{"id": name, "smiles": smiles} for name, smiles in resolved],
93
+ "fingerprint": {"type": "morgan", "radius": 2, "n_bits": 2048},
94
+ "sanitize": True,
95
+ }
96
+ ```
97
+
98
+ 结果从 `n["matrix"]` 和 `n["ranked_pairs"]` 读取。每个排名项固定为
99
+ `{"a": 名称, "b": 名称, "similarity": 数值}`;禁止读取 `i`、`j`、
100
+ `score`,禁止自行重算或添加阈值解释。
101
+
102
+ ## 结果与失败边界
103
+
104
+ - 只报告本次 `native` 返回的字段、数值和警告,不用记忆补值。
105
+ - 描述符只能逐项复制 `item["descriptors"]` 中实际存在的键和值;不得补充
106
+ `NumAromaticRings`、形式电荷、官能团、手性、结构原因、单位或解释,除非这些字段
107
+ 确实由本次 native 返回且用户明确要求。
108
+ - `valid: false` 是化学输入校验失败,原样报告 `error`/`warnings`。
109
+ - wrapper、CLI 或后端失败时,报告实际阶段和错误;不要继续探测或回退。
110
+ - 渲染结果只有在解码后的字节以 PNG magic bytes 开头时才能保存为 `.png`;禁止
111
+ 把 JSON envelope 保存成图片。
112
+ - PubChem 的 `XLogP` 与 RDKit 的 `MolLogP` 不是同一来源,不得互相替代。
@@ -1,4 +1,4 @@
1
- interface:
2
- display_name: "RDKit ?????"
3
- short_description: "?? Delta CLI ?????????????????"
4
- default_prompt: "?? $rdkit ???????????????????"
1
+ interface:
2
+ display_name: "RDKit 化学信息学"
3
+ short_description: "通过 Delta CLI 解析分子并计算描述符、相似度和子结构"
4
+ default_prompt: "使用 $rdkit 校验这些分子并完成所需的结构计算。"
@@ -1,133 +1,133 @@
1
- # RDKit Endpoint Reference
2
-
3
- 在 Memento 中只能通过 `delta-science/scripts/invoke.py` 调用。wrapper 已解包服务
4
- 信封,因此以下业务响应在 wrapper 结果中位于 `result["native"]` 顶层;禁止读取
5
- `result["native"]["data"]`。本文件中的 URL 只说明 schema,不授权直接 HTTP。
6
-
7
- All paths are relative to `http://111.2.199.31:52317/api/v1`.
8
-
9
- ## Health
10
-
11
- `GET /chem/rdkit/health`
12
-
13
- ## Parse
14
-
15
- `POST /chem/rdkit/parse`
16
-
17
- ```json
18
- {"input": "CCO", "format": "smiles", "sanitize": true}
19
- ```
20
-
21
- Formats: `smiles`, `inchi`, `molblock`.
22
-
23
- Key response fields in `data`: `valid`, `canonical_smiles`, `formula`,
24
- `molecular_weight`, `exact_molecular_weight`, `inchi_key`, `atom_count`,
25
- `heavy_atom_count`, `bond_count`, `warnings`, `error`.
26
-
27
- ## Descriptors
28
-
29
- `POST /chem/rdkit/descriptors`
30
-
31
- ```json
32
- {"smiles": "CCO", "descriptor_set": "basic", "sanitize": true}
33
- ```
34
-
35
- `descriptor_set` currently supports `basic`. Descriptor keys include `Formula`,
36
- `MolWt`, `ExactMolWt`, `HeavyAtomMolWt`, `TPSA`, `MolLogP`, `NumHDonors`,
37
- `NumHAcceptors`, `NumRotatableBonds`, `RingCount`, `FractionCSP3`,
38
- `HeavyAtomCount`, `AtomCount`, and `BondCount`.
39
-
40
- ## Batch Descriptors
41
-
42
- `POST /chem/rdkit/batch-descriptors`
43
-
44
- ```json
45
- {"smiles": ["CCO", "c1ccccc1"], "descriptor_set": "basic", "sanitize": true}
46
- ```
47
-
48
- Limits: 1-500 SMILES.
49
-
50
- ## Batch Parse Describe
51
-
52
- `POST /chem/rdkit/batch-parse-describe`
53
-
54
- ```json
55
- {
56
- "molecules": [
57
- {"id": "aspirin", "smiles": "CC(=O)Oc1ccccc1C(=O)O"},
58
- {"id": "caffeine", "smiles": "Cn1cnc2c1c(=O)n(C)c(=O)n2C"}
59
- ],
60
- "descriptor_set": "basic",
61
- "fingerprint": {"type": "morgan", "radius": 2, "n_bits": 2048},
62
- "sanitize": true
63
- }
64
- ```
65
-
66
- Limits: 1-500 molecules. Returns per-item `valid`, `canonical_smiles`, parse
67
- fields, `descriptors`, optional `fingerprint_metadata`, `on_bits`, `bit_count`,
68
- `warnings`, and `error`.
69
-
70
- ## Render
71
-
72
- `POST /chem/rdkit/render`
73
-
74
- ```json
75
- {"smiles": "CCO", "image_format": "svg", "width": 450, "height": 320}
76
- ```
77
-
78
- Image formats: `svg`, `png`. SVG returns text; PNG returns base64.
79
- Width/height range: 150-2000.
80
-
81
- ## Fingerprint
82
-
83
- `POST /chem/rdkit/fingerprint`
84
-
85
- ```json
86
- {"smiles": "CCO", "radius": 2, "n_bits": 2048}
87
- ```
88
-
89
- Morgan fingerprint parameters: `radius` 1-6, `n_bits` 128-8192.
90
-
91
- ## Similarity
92
-
93
- `POST /chem/rdkit/similarity`
94
-
95
- ```json
96
- {"query_smiles": "CCO", "target_smiles": "CCCO", "radius": 2, "n_bits": 2048}
97
- ```
98
-
99
- Returns Tanimoto similarity.
100
-
101
- ## Similarity Matrix
102
-
103
- `POST /chem/rdkit/similarity-matrix`
104
-
105
- ```json
106
- {
107
- "molecules": [
108
- {"id": "aspirin", "smiles": "CC(=O)Oc1ccccc1C(=O)O"},
109
- {"id": "ibuprofen", "smiles": "CC(C)Cc1ccc(cc1)[C@@H](C)C(=O)O"}
110
- ],
111
- "fingerprint": {"type": "morgan", "radius": 2, "n_bits": 2048},
112
- "sanitize": true
113
- }
114
- ```
115
-
116
- Returns `matrix` in input order and `ranked_pairs` sorted by descending
117
- Tanimoto similarity. Each ranked record is named, not index-based:
118
-
119
- ```json
120
- {"a":"aspirin","b":"ibuprofen","similarity":0.195122}
121
- ```
122
-
123
- Do not expect `i`, `j`, or `score` fields.
124
-
125
- ## Substructure
126
-
127
- `POST /chem/rdkit/substructure`
128
-
129
- ```json
130
- {"query_smarts": "c1ccccc1", "target_smiles": ["c1ccccc1", "CCO"]}
131
- ```
132
-
133
- Limits: SMARTS max length 5000; target list size 1-500.
1
+ # RDKit Endpoint Reference
2
+
3
+ 在 Memento 中只能通过 `delta-science/scripts/invoke.py` 调用。wrapper 已解包服务
4
+ 信封,因此以下业务响应在 wrapper 结果中位于 `result["native"]` 顶层;禁止读取
5
+ `result["native"]["data"]`。本文件中的 URL 只说明 schema,不授权直接 HTTP。
6
+
7
+ All paths are relative to `http://111.2.199.31:52317/api/v1`.
8
+
9
+ ## Health
10
+
11
+ `GET /chem/rdkit/health`
12
+
13
+ ## Parse
14
+
15
+ `POST /chem/rdkit/parse`
16
+
17
+ ```json
18
+ {"input": "CCO", "format": "smiles", "sanitize": true}
19
+ ```
20
+
21
+ Formats: `smiles`, `inchi`, `molblock`.
22
+
23
+ Key response fields in `data`: `valid`, `canonical_smiles`, `formula`,
24
+ `molecular_weight`, `exact_molecular_weight`, `inchi_key`, `atom_count`,
25
+ `heavy_atom_count`, `bond_count`, `warnings`, `error`.
26
+
27
+ ## Descriptors
28
+
29
+ `POST /chem/rdkit/descriptors`
30
+
31
+ ```json
32
+ {"smiles": "CCO", "descriptor_set": "basic", "sanitize": true}
33
+ ```
34
+
35
+ `descriptor_set` currently supports `basic`. Descriptor keys include `Formula`,
36
+ `MolWt`, `ExactMolWt`, `HeavyAtomMolWt`, `TPSA`, `MolLogP`, `NumHDonors`,
37
+ `NumHAcceptors`, `NumRotatableBonds`, `RingCount`, `FractionCSP3`,
38
+ `HeavyAtomCount`, `AtomCount`, and `BondCount`.
39
+
40
+ ## Batch Descriptors
41
+
42
+ `POST /chem/rdkit/batch-descriptors`
43
+
44
+ ```json
45
+ {"smiles": ["CCO", "c1ccccc1"], "descriptor_set": "basic", "sanitize": true}
46
+ ```
47
+
48
+ Limits: 1-500 SMILES.
49
+
50
+ ## Batch Parse Describe
51
+
52
+ `POST /chem/rdkit/batch-parse-describe`
53
+
54
+ ```json
55
+ {
56
+ "molecules": [
57
+ {"id": "aspirin", "smiles": "CC(=O)Oc1ccccc1C(=O)O"},
58
+ {"id": "caffeine", "smiles": "Cn1cnc2c1c(=O)n(C)c(=O)n2C"}
59
+ ],
60
+ "descriptor_set": "basic",
61
+ "fingerprint": {"type": "morgan", "radius": 2, "n_bits": 2048},
62
+ "sanitize": true
63
+ }
64
+ ```
65
+
66
+ Limits: 1-500 molecules. Returns per-item `valid`, `canonical_smiles`, parse
67
+ fields, `descriptors`, optional `fingerprint_metadata`, `on_bits`, `bit_count`,
68
+ `warnings`, and `error`.
69
+
70
+ ## Render
71
+
72
+ `POST /chem/rdkit/render`
73
+
74
+ ```json
75
+ {"smiles": "CCO", "image_format": "svg", "width": 450, "height": 320}
76
+ ```
77
+
78
+ Image formats: `svg`, `png`. SVG returns text; PNG returns base64.
79
+ Width/height range: 150-2000.
80
+
81
+ ## Fingerprint
82
+
83
+ `POST /chem/rdkit/fingerprint`
84
+
85
+ ```json
86
+ {"smiles": "CCO", "radius": 2, "n_bits": 2048}
87
+ ```
88
+
89
+ Morgan fingerprint parameters: `radius` 1-6, `n_bits` 128-8192.
90
+
91
+ ## Similarity
92
+
93
+ `POST /chem/rdkit/similarity`
94
+
95
+ ```json
96
+ {"query_smiles": "CCO", "target_smiles": "CCCO", "radius": 2, "n_bits": 2048}
97
+ ```
98
+
99
+ Returns Tanimoto similarity.
100
+
101
+ ## Similarity Matrix
102
+
103
+ `POST /chem/rdkit/similarity-matrix`
104
+
105
+ ```json
106
+ {
107
+ "molecules": [
108
+ {"id": "aspirin", "smiles": "CC(=O)Oc1ccccc1C(=O)O"},
109
+ {"id": "ibuprofen", "smiles": "CC(C)Cc1ccc(cc1)[C@@H](C)C(=O)O"}
110
+ ],
111
+ "fingerprint": {"type": "morgan", "radius": 2, "n_bits": 2048},
112
+ "sanitize": true
113
+ }
114
+ ```
115
+
116
+ Returns `matrix` in input order and `ranked_pairs` sorted by descending
117
+ Tanimoto similarity. Each ranked record is named, not index-based:
118
+
119
+ ```json
120
+ {"a":"aspirin","b":"ibuprofen","similarity":0.195122}
121
+ ```
122
+
123
+ Do not expect `i`, `j`, or `score` fields.
124
+
125
+ ## Substructure
126
+
127
+ `POST /chem/rdkit/substructure`
128
+
129
+ ```json
130
+ {"query_smarts": "c1ccccc1", "target_smiles": ["c1ccccc1", "CCO"]}
131
+ ```
132
+
133
+ Limits: SMARTS max length 5000; target list size 1-500.