@delta-infra/cli 1.0.79 → 1.0.81

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 (61) hide show
  1. package/README.md +427 -437
  2. package/checksums.txt +5 -5
  3. package/package.json +2 -13
  4. package/scripts/install-wizard.js +625 -616
  5. package/scripts/install.js +417 -417
  6. package/scripts/run.js +65 -65
  7. package/skills/delta-sandbox/SKILL.md +356 -356
  8. package/skills/delta-sandbox/agents/openai.yaml +4 -4
  9. package/skills/delta-sandbox/references/commands.md +56 -56
  10. package/skills/delta-sandbox/references/lifecycle.md +92 -92
  11. package/skills/delta-sandbox/references/recipes.md +133 -133
  12. package/skills/delta-science/SKILL.md +149 -170
  13. package/skills/delta-science/agents/openai.yaml +4 -4
  14. package/skills/delta-science/references/antbo.md +100 -0
  15. package/skills/delta-science/references/cli-contract.md +74 -75
  16. package/skills/delta-science/references/delta-bo.md +90 -0
  17. package/skills/{gsasii/references/endpoints.md → delta-science/references/gsasii.md} +116 -130
  18. package/skills/{lammps/references/endpoints.md → delta-science/references/lammps.md} +66 -61
  19. package/skills/{ldm-bo/references/endpoints.md → delta-science/references/ldm-bo.md} +127 -124
  20. package/skills/delta-science/references/ldm.md +72 -0
  21. package/skills/{pubchem/references/endpoints.md → delta-science/references/pubchem.md} +127 -122
  22. package/skills/{pymatgen/references/endpoints.md → delta-science/references/pymatgen.md} +68 -68
  23. package/skills/{rdkit/references/endpoints.md → delta-science/references/rdkit.md} +139 -133
  24. package/skills/delta-science/references/routing-index.md +36 -0
  25. package/skills/delta-science/references/strbo.md +87 -0
  26. package/skills/{synbo-service/references/endpoints.md → delta-science/references/synbo.md} +197 -157
  27. package/skills/delta-science/references/workflows.md +58 -41
  28. package/skills/delta-science/scripts/catalog.py +92 -0
  29. package/skills/delta-science/scripts/invoke.py +310 -227
  30. package/skills/delta-shared/SKILL.md +95 -95
  31. package/skills/delta-shared/agents/openai.yaml +4 -4
  32. package/skills/manifest.json +3 -1
  33. package/skills/antbo-ldm-guard/SKILL.md +0 -58
  34. package/skills/antbo-ldm-guard/agents/openai.yaml +0 -4
  35. package/skills/antbo-service/SKILL.md +0 -79
  36. package/skills/antbo-service/agents/openai.yaml +0 -4
  37. package/skills/antbo-service/references/operations.md +0 -45
  38. package/skills/delta-bo/SKILL.md +0 -36
  39. package/skills/delta-bo/agents/openai.yaml +0 -4
  40. package/skills/delta-bo/references/endpoints.md +0 -263
  41. package/skills/delta-science/references/generated-catalog.md +0 -48
  42. package/skills/delta-science/references/operation-contracts.md +0 -137
  43. package/skills/delta-science/references/services.md +0 -112
  44. package/skills/delta-science/scripts/generated_catalog.py +0 -69
  45. package/skills/gsasii/SKILL.md +0 -42
  46. package/skills/gsasii/agents/openai.yaml +0 -4
  47. package/skills/lammps/SKILL.md +0 -39
  48. package/skills/lammps/agents/openai.yaml +0 -4
  49. package/skills/ldm-bo/SKILL.md +0 -35
  50. package/skills/ldm-bo/agents/openai.yaml +0 -4
  51. package/skills/pubchem/SKILL.md +0 -93
  52. package/skills/pubchem/agents/openai.yaml +0 -4
  53. package/skills/pubchem/references/operations.md +0 -41
  54. package/skills/pymatgen/SKILL.md +0 -54
  55. package/skills/pymatgen/agents/openai.yaml +0 -4
  56. package/skills/rdkit/SKILL.md +0 -112
  57. package/skills/rdkit/agents/openai.yaml +0 -4
  58. package/skills/rdkit/references/operations.md +0 -64
  59. package/skills/science-tools.json +0 -127
  60. package/skills/synbo-service/SKILL.md +0 -36
  61. package/skills/synbo-service/agents/openai.yaml +0 -4
@@ -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,130 +1,116 @@
1
- # GSAS-II Endpoint Reference
2
-
3
- All paths are relative to `http://111.2.199.31:52317/api/v1`.
4
-
5
- ## Health
6
-
7
- `GET /chem/gsasii/health`
8
-
9
- Key response fields in `data`: `status`, `service`, `gsasii_available`,
10
- `metadata`, and `limits`.
11
-
12
- Use this before long simulations/refinements. A healthy service should report
13
- `data.status == "ok"` and `data.gsasii_available == true`.
14
-
15
- ## Powder Simulation
16
-
17
- `POST /chem/gsasii/powder/simulate`
18
-
19
- ```json
20
- {
21
- "cif": "<CIF text>",
22
- "phase_name": "phase",
23
- "instrument_parameters": "<GSAS-II instrument parameter text>",
24
- "histogram_name": "simulation",
25
- "t_min": 10.0,
26
- "t_max": 80.0,
27
- "t_step": 0.02,
28
- "include_profile": true,
29
- "max_profile_points": 1000,
30
- "include_reflections": true,
31
- "max_reflections": 1000,
32
- "return_refined_cif": false,
33
- "return_project": false
34
- }
35
- ```
36
-
37
- Use either `t_step` or `n_points`, not both. Optional fields include
38
- `wavelength`, `radiation`, `scale`, `include_profile`, `max_profile_points`,
39
- `include_reflections`, `max_reflections`, `return_refined_cif`, and
40
- `return_project`.
41
-
42
- The response includes `profile` points with `x`, `y_calc`, optional background,
43
- bounded `reflections` with hkl/d-spacing/2theta where available, and metadata.
44
- If `return_project` is true, `project_base64` contains the GSAS-II `.gpx`
45
- project. If `return_refined_cif` is true, `refined_cif` contains exported CIF
46
- text for pymatgen handoff when GSAS-II supports export for the phase.
47
-
48
- Notes:
49
-
50
- - `cif` should be valid CIF text. If the input is POSCAR/JSON/CSSR/XSF, use
51
- `/chem/pymatgen/structure/convert` first with `output_format: "cif"`.
52
- - `instrument_parameters` should be GSAS-II instrument parameter text such as
53
- `INST_XRY.PRM` when instrument-specific simulation is needed.
54
- - For quick simulation only, `instrument_parameters` may be omitted. The service
55
- then generates a simple CW X-ray instrument model from `wavelength` or
56
- `radiation` (`CuKa` by default; also supports aliases such as `MoKa`, `CoKa`,
57
- `CrKa`, and explicit numeric wavelength).
58
- - Refinement still requires real `instrument_parameters`.
59
- - `max_profile_points` controls response sampling. Use small values for smoke
60
- tests and larger values for profile comparison.
61
- - Older deployed gateway images may require `max_profile_points >= 10`.
62
-
63
- ## Powder Refinement
64
-
65
- `POST /chem/gsasii/powder/refine`
66
-
67
- ```json
68
- {
69
- "powder_data": "<two-column or three-column powder data text>",
70
- "powder_format": "xy",
71
- "instrument_parameters": "<GSAS-II instrument parameter text>",
72
- "phases": [
73
- {"name": "phase", "cif": "<CIF text>"}
74
- ],
75
- "refinement_mode": "rietveld",
76
- "refinement_steps": [],
77
- "max_cycles": 3,
78
- "histogram_name": "powder",
79
- "include_profile": true,
80
- "max_profile_points": 1000,
81
- "include_reflections": true,
82
- "max_reflections": 1000,
83
- "return_refined_cif": false,
84
- "return_project": false
85
- }
86
- ```
87
-
88
- Supported `powder_format` values: `xy`, `xye`, `fxye`, `gsas`, and `csv`.
89
-
90
- `refinement_mode: "rietveld"` is currently implemented. `pawley` and `lebail`
91
- return a clear not-implemented response until the service wires the
92
- mode-specific GSAS-II setup.
93
-
94
- The response includes fit `residuals` when available, phase summaries, sampled
95
- profile points, bounded `reflections`, warnings, optional `refined_cif`, and
96
- the optional `.gpx` project.
97
-
98
- Notes:
99
-
100
- - Use `xy` for simple whitespace-delimited `x y` rows, `xye` for `x y esd`,
101
- `csv` for numeric comma-separated rows, or `gsas`/`fxye` for GSAS-like powder
102
- formats.
103
- - `max_cycles: 0` is useful for project-construction smoke tests. Increase it
104
- only when the powder data, phase model, instrument file, and refinement steps
105
- are realistic.
106
- - `refinement_steps` is passed to `G2Project.do_refinements`. Keep recipes
107
- incremental and inspect `warnings`, `residuals`, and `lst` output.
108
- - Refinement may return `valid: false` with partial phase/profile information
109
- if GSAS-II constructed the project but a refinement step failed.
110
-
111
- ## Recommended Integration Scripts
112
-
113
- From this skill's `scripts/` directory:
114
-
115
- ```bash
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
- ```
1
+ # GSAS-II 详细规则
2
+
3
+ 所有调用只走统一 wrapper。模拟必须使用真实 CIF;精修必须使用真实 powder data、
4
+ instrument parameters 和 phase CIF,任何失败不得用合成数据补齐。输入不是 CIF 时,
5
+ 先使用当前任务中成功的 pymatgen `structure-convert` 结果。
6
+
7
+ ## Health
8
+
9
+ operation:`health`,无 body。
10
+
11
+ Key response fields in `data`: `status`, `service`, `gsasii_available`,
12
+ `metadata`, and `limits`.
13
+
14
+ 只有用户明确要求健康检查时才调用;不要在模拟或精修前自动增加 health。
15
+
16
+ ## Powder Simulation
17
+
18
+ operation:`powder-simulate`。
19
+
20
+ ```json
21
+ {
22
+ "cif": "<CIF text>",
23
+ "phase_name": "phase",
24
+ "instrument_parameters": "<GSAS-II instrument parameter text>",
25
+ "histogram_name": "simulation",
26
+ "t_min": 10.0,
27
+ "t_max": 80.0,
28
+ "t_step": 0.02,
29
+ "include_profile": true,
30
+ "max_profile_points": 1000,
31
+ "include_reflections": true,
32
+ "max_reflections": 1000,
33
+ "return_refined_cif": false,
34
+ "return_project": false
35
+ }
36
+ ```
37
+
38
+ Use either `t_step` or `n_points`, not both. Optional fields include
39
+ `wavelength`, `radiation`, `scale`, `include_profile`, `max_profile_points`,
40
+ `include_reflections`, `max_reflections`, `return_refined_cif`, and
41
+ `return_project`.
42
+
43
+ The response includes `profile` points with `x`, `y_calc`, optional background,
44
+ bounded `reflections` with hkl/d-spacing/2theta where available, and metadata.
45
+ If `return_project` is true, `project_base64` contains the GSAS-II `.gpx`
46
+ project. If `return_refined_cif` is true, `refined_cif` contains exported CIF
47
+ text for pymatgen handoff when GSAS-II supports export for the phase.
48
+
49
+ Notes:
50
+
51
+ - `cif` should be valid CIF text. If the input is POSCAR/JSON/CSSR/XSF, use
52
+ pymatgen `structure-convert` first with `output_format: "cif"`.
53
+ - `instrument_parameters` should be GSAS-II instrument parameter text such as
54
+ `INST_XRY.PRM` when instrument-specific simulation is needed.
55
+ - For quick simulation only, `instrument_parameters` may be omitted. The service
56
+ then generates a simple CW X-ray instrument model from `wavelength` or
57
+ `radiation` (`CuKa` by default; also supports aliases such as `MoKa`, `CoKa`,
58
+ `CrKa`, and explicit numeric wavelength).
59
+ - Refinement still requires real `instrument_parameters`.
60
+ - `max_profile_points` controls response sampling. Use small values for smoke
61
+ tests and larger values for profile comparison.
62
+ - Older deployed gateway images may require `max_profile_points >= 10`.
63
+
64
+ ## Powder Refinement
65
+
66
+ operation:`powder-refine`。
67
+
68
+ ```json
69
+ {
70
+ "powder_data": "<two-column or three-column powder data text>",
71
+ "powder_format": "xy",
72
+ "instrument_parameters": "<GSAS-II instrument parameter text>",
73
+ "phases": [
74
+ {"name": "phase", "cif": "<CIF text>"}
75
+ ],
76
+ "refinement_mode": "rietveld",
77
+ "refinement_steps": [],
78
+ "max_cycles": 3,
79
+ "histogram_name": "powder",
80
+ "include_profile": true,
81
+ "max_profile_points": 1000,
82
+ "include_reflections": true,
83
+ "max_reflections": 1000,
84
+ "return_refined_cif": false,
85
+ "return_project": false
86
+ }
87
+ ```
88
+
89
+ Supported `powder_format` values: `xy`, `xye`, `fxye`, `gsas`, and `csv`.
90
+
91
+ `refinement_mode: "rietveld"` is currently implemented. `pawley` and `lebail`
92
+ return a clear not-implemented response until the service wires the
93
+ mode-specific GSAS-II setup.
94
+
95
+ The response includes fit `residuals` when available, phase summaries, sampled
96
+ profile points, bounded `reflections`, warnings, optional `refined_cif`, and
97
+ the optional `.gpx` project.
98
+
99
+ Notes:
100
+
101
+ - Use `xy` for simple whitespace-delimited `x y` rows, `xye` for `x y esd`,
102
+ `csv` for numeric comma-separated rows, or `gsas`/`fxye` for GSAS-like powder
103
+ formats.
104
+ - `max_cycles: 0` is useful for project-construction smoke tests. Increase it
105
+ only when the powder data, phase model, instrument file, and refinement steps
106
+ are realistic.
107
+ - `refinement_steps` is passed to `G2Project.do_refinements`. Keep recipes
108
+ incremental and inspect `warnings`, `residuals`, and `lst` output.
109
+ - Refinement may return `valid: false` with partial phase/profile information
110
+ if GSAS-II constructed the project but a refinement step failed.
111
+
112
+ ## 跨工具交接
113
+
114
+ 结构转换、衍射模拟和精修必须在本 Skill 内通过 wrapper 逐步完成:
115
+ `pymatgen structure-convert -> gsasii powder-simulate/powder-refine`。下游只使用上一步
116
+ 成功 native 中的结构文本或 profile;不得执行本地脚本或直连服务。
@@ -1,61 +1,66 @@
1
- # LAMMPS Endpoint Reference
2
-
3
- All paths are relative to `http://111.2.199.31:52317/api/v1`.
4
-
5
- ## Health
6
-
7
- `GET /chem/lammps/health`
8
-
9
- Key response fields in `data`: `status`, `service`, `lammps_available`,
10
- `metadata`, and `limits`.
11
-
12
- Use this before long simulations. A healthy service should report
13
- `data.status == "ok"` and `data.lammps_available == true`.
14
-
15
- ## Built-In Lennard-Jones Example
16
-
17
- `GET /chem/lammps/examples/lj-melt`
18
-
19
- Returns a complete `request` payload for `/chem/lammps/run`, plus workflow notes
20
- showing where pymatgen and GSAS-II fit around LAMMPS.
21
-
22
- ## Run
23
-
24
- `POST /chem/lammps/run`
25
-
26
- ```json
27
- {
28
- "input_script": "<LAMMPS input script>",
29
- "files": [
30
- {"path": "system.data", "content": "<LAMMPS data file text>", "encoding": "text"}
31
- ],
32
- "timeout_seconds": 30,
33
- "max_thermo_rows": 1000,
34
- "log_tail_lines": 200,
35
- "output_files": ["dump.lammpstrj", "final.data"],
36
- "include_log": true,
37
- "include_stdout": false,
38
- "include_stderr": false
39
- }
40
- ```
41
-
42
- `files` are written into a fresh job working directory before LAMMPS starts.
43
- `encoding` can be `text` or `base64`.
44
-
45
- The response includes parsed thermo rows, the final thermo row, atom count when
46
- detectable, log tail, warnings, and requested output files. Text output files
47
- return `content`; binary output files return `content_base64`.
48
-
49
- Notes:
50
-
51
- - Use relative file paths only.
52
- - The service rejects unsafe commands such as `shell`, `python`, `plugin`, and
53
- `jump` by default.
54
- - `include <relative-file>` is allowed when the included file is supplied in
55
- `files`; absolute paths, parent-directory traversal, URLs, and `jump` loops
56
- are rejected.
57
- - Dump/data products are returned as raw requested output files, not structured
58
- parsed atom-frame objects.
59
- - The gateway is synchronous; keep interactive runs short.
60
- - Force-field choice is caller responsibility. The service executes explicit
61
- LAMMPS input and does not infer potentials from formulas or structures.
1
+ # LAMMPS 详细规则
2
+
3
+ 所有调用只走统一 wrapper。LAMMPS 不从化学式、CIF 或 POSCAR 自动推断 data、原子
4
+ 类型、势函数与边界条件。成功执行不表示物理收敛或生产可用。
5
+
6
+ ## Health
7
+
8
+ operation:`health`,无 body。
9
+
10
+ Key response fields in `data`: `status`, `service`, `lammps_available`,
11
+ `metadata`, and `limits`.
12
+
13
+ 只有用户明确要求健康检查时才调用;不要在模拟前自动增加 health。
14
+
15
+ ## Built-In Lennard-Jones Example
16
+
17
+ operation:`lj-melt-example`。
18
+
19
+ Returns a complete `request` payload for the `run` operation, plus workflow notes
20
+ showing where pymatgen and GSAS-II fit around LAMMPS.
21
+
22
+ ## Run
23
+
24
+ operation:`run`。
25
+
26
+ ```json
27
+ {
28
+ "input_script": "<LAMMPS input script>",
29
+ "files": [
30
+ {"path": "system.data", "content": "<LAMMPS data file text>", "encoding": "text"}
31
+ ],
32
+ "timeout_seconds": 30,
33
+ "max_thermo_rows": 1000,
34
+ "log_tail_lines": 200,
35
+ "output_files": ["dump.lammpstrj", "final.data"],
36
+ "include_log": true,
37
+ "include_stdout": false,
38
+ "include_stderr": false
39
+ }
40
+ ```
41
+
42
+ `files` are written into a fresh job working directory before LAMMPS starts.
43
+ `encoding` can be `text` or `base64`.
44
+
45
+ The response includes parsed thermo rows, the final thermo row, atom count when
46
+ detectable, log tail, warnings, and requested output files. Text output files
47
+ return `content`; binary output files return `content_base64`.
48
+
49
+ Notes:
50
+
51
+ - Use relative file paths only.
52
+ - The service rejects unsafe commands such as `shell`, `python`, `plugin`, and
53
+ `jump` by default.
54
+ - `include <relative-file>` is allowed when the included file is supplied in
55
+ `files`; absolute paths, parent-directory traversal, URLs, and `jump` loops
56
+ are rejected.
57
+ - Dump/data products are returned as raw requested output files, not structured
58
+ parsed atom-frame objects.
59
+ - The gateway is synchronous; keep interactive runs short.
60
+ - Force-field choice is caller responsibility. The service executes explicit
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。