@delta-infra/cli 1.1.17 → 1.1.19

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 (77) hide show
  1. package/README.md +520 -506
  2. package/checksums.txt +5 -5
  3. package/package.json +3 -2
  4. package/scripts/install-wizard.js +688 -701
  5. package/scripts/install.js +442 -442
  6. package/scripts/run.js +65 -65
  7. package/skills/delta-protein/AGENTS.md +73 -0
  8. package/skills/delta-protein/SKILL.md +389 -0
  9. package/skills/delta-protein/agents/openai.yaml +4 -0
  10. package/skills/delta-protein/references/bfitter.md +64 -0
  11. package/skills/delta-protein/references/catapro_predict.md +63 -0
  12. package/skills/delta-protein/references/catpred_predict.md +65 -0
  13. package/skills/delta-protein/references/caver_tunnel_analyze.md +63 -0
  14. package/skills/delta-protein/references/consensus_mutation.md +61 -0
  15. package/skills/delta-protein/references/consurf_predict.md +67 -0
  16. package/skills/delta-protein/references/crop_sequence.md +69 -0
  17. package/skills/delta-protein/references/dock.md +82 -0
  18. package/skills/delta-protein/references/dock_score.md +70 -0
  19. package/skills/delta-protein/references/easifa_predict_active_site.md +70 -0
  20. package/skills/delta-protein/references/ephod_predict_mutation.md +66 -0
  21. package/skills/delta-protein/references/ephod_predict_protein.md +61 -0
  22. package/skills/delta-protein/references/esmfold2_predict.md +67 -0
  23. package/skills/delta-protein/references/evcouplings_mutation.md +64 -0
  24. package/skills/delta-protein/references/fasta_to_sequence.md +59 -0
  25. package/skills/delta-protein/references/foldseek.md +61 -0
  26. package/skills/delta-protein/references/generate_msa.md +61 -0
  27. package/skills/delta-protein/references/interpro_analyze.md +63 -0
  28. package/skills/delta-protein/references/mpnn_design_sequence.md +71 -0
  29. package/skills/delta-protein/references/multievolve.md +73 -0
  30. package/skills/delta-protein/references/pisa_query.md +70 -0
  31. package/skills/delta-protein/references/plip_analyze.md +65 -0
  32. package/skills/delta-protein/references/pocket_prediction.md +63 -0
  33. package/skills/delta-protein/references/protein_design.md +65 -0
  34. package/skills/delta-protein/references/protein_evolution.md +77 -0
  35. package/skills/delta-protein/references/protein_sol_predict_mutation.md +66 -0
  36. package/skills/delta-protein/references/protein_sol_predict_protein.md +61 -0
  37. package/skills/delta-protein/references/protenix.md +66 -0
  38. package/skills/delta-protein/references/protrek_search.md +90 -0
  39. package/skills/delta-protein/references/pubchem_search.md +68 -0
  40. package/skills/delta-protein/references/pubmed_search.md +79 -0
  41. package/skills/delta-protein/references/reap_design_primer.md +69 -0
  42. package/skills/delta-protein/references/rfd3_design.md +65 -0
  43. package/skills/delta-protein/references/structure_to_sequence.md +61 -0
  44. package/skills/delta-protein/references/summarize_result.md +68 -0
  45. package/skills/delta-protein/references/surface_charge.md +84 -0
  46. package/skills/delta-protein/references/uniprot_batch_query.md +63 -0
  47. package/skills/delta-protein/references/uniprot_query.md +64 -0
  48. package/skills/delta-protein/references/zero_shot_mutant_candidates.md +76 -0
  49. package/skills/delta-protein/scripts/gen_references.py +167 -0
  50. package/skills/delta-protein/scripts/output_metadata.json +275 -0
  51. package/skills/delta-sandbox/SKILL.md +388 -388
  52. package/skills/delta-sandbox/agents/openai.yaml +4 -4
  53. package/skills/delta-sandbox/references/commands.md +58 -58
  54. package/skills/delta-sandbox/references/lifecycle.md +100 -100
  55. package/skills/delta-sandbox/references/recipes.md +138 -138
  56. package/skills/delta-science/AGENTS.md +47 -47
  57. package/skills/delta-science/SKILL.md +227 -185
  58. package/skills/delta-science/agents/openai.yaml +4 -4
  59. package/skills/delta-science/references/antbo.md +105 -100
  60. package/skills/delta-science/references/delta-bo.md +92 -89
  61. package/skills/delta-science/references/gsasii.md +118 -116
  62. package/skills/delta-science/references/lammps.md +68 -66
  63. package/skills/delta-science/references/ldm-bo.md +132 -129
  64. package/skills/delta-science/references/materials-design.md +130 -118
  65. package/skills/delta-science/references/pubchem.md +128 -126
  66. package/skills/delta-science/references/pymatgen.md +69 -68
  67. package/skills/delta-science/references/qe.md +134 -125
  68. package/skills/delta-science/references/rdkit.md +141 -138
  69. package/skills/delta-science/references/strbo.md +95 -87
  70. package/skills/delta-science/references/synbo.md +201 -198
  71. package/skills/delta-science/references/xrd.md +619 -101
  72. package/skills/delta-science/scripts/catalog.py +92 -92
  73. package/skills/delta-science/scripts/generated_catalog.py +69 -69
  74. package/skills/delta-science/scripts/invoke.py +346 -346
  75. package/skills/delta-shared/SKILL.md +113 -111
  76. package/skills/delta-shared/agents/openai.yaml +4 -4
  77. package/skills/manifest.json +20 -19
@@ -1,100 +1,105 @@
1
- # AntBO 详细规则
2
-
3
- 直接用 `delta-cli science invoke` 设置 `endpoint`、`data`、`params`。按本文件定义的
4
- CLI 服务响应字段读取业务结果。标为“变更”的 operation 只有用户明确授权时才能执行,且不得重试。
5
-
6
- 抗体/CDRH3 场景即使出现 “LDM” 也不得改用小分子 LDM-BO 或 STRBO。当前 catalog
7
- 同时暴露 CDRH3 生成/建议/评估接口和传统 AntBO 作业管理接口。
8
-
9
- ## health(只读)
10
-
11
- - 情景:检查远程 AntBO 环境是否可用。
12
- - 代码:`endpoint="health"; data=None; params=None`
13
- - 投影:status、antbo_available、metadata、limits、warnings。
14
-
15
- ## run-default-job(变更)
16
-
17
- - 情景:用户明确要求启动标准后台续跑任务。
18
- - 代码:`endpoint="run-default-job"; data=None; params={"log_name":"antbo_<唯一时间戳>.log","append":False,"timeout_seconds":86400}`
19
- - 投影:started、pid、log_name/log_path、timeout_seconds;未知结果禁止重试。
20
-
21
- 只有同一次业务响应同时包含 `started=true`、非空 `pid` 以及 `log_name` 或
22
- `log_path` 时,才能声称作业已启动;字段缺失时标记为未验证,不得重复提交。
23
-
24
- ## run(重型变更)
25
-
26
- - 情景:用户明确给出受限 AntBO 脚本、配置、抗原文件并要求同步执行。
27
- - 代码:`endpoint="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}; params=None`
28
- - 投影:ok、returncode、timed_out、log_path、日志截断状态;不在最终答复展开完整日志。
29
-
30
- ## log(只读)
31
-
32
- - 情景:用户提供已知 log_name 并要求查看尾部日志。
33
- - 代码:`endpoint="log"; data=None; params={"log_name":"antbo_run.log"}`
34
- - 投影:log_name、log、log_truncated;长日志只给有界尾部摘要。
35
-
36
- ## jobs(只读)
37
-
38
- - 情景:查看当前 service 容器登记的活动作业。
39
- - 代码:`endpoint="jobs"; data=None; params=None`
40
- - 投影:jobs 中 pid、running、returncode、log_name、log_path。
41
-
42
- ## stop(变更)
43
-
44
- - 情景:用户明确要求停止已确认 PID 的任务。
45
- - 代码:`endpoint="stop"; data=None; params={"pid":12345}`
46
- - 投影:stopped、pid、message;不得盲目重试或在多任务时无参数调用。
47
-
48
- ## CDRH3 生成与优化
49
-
50
- 服务端支持的抗原由 health 的 `supported_antigens` 决定;不得猜测或把任意蛋白文件
51
- 路径当成 antigen。部署通常支持 `1ADQ_A`、`1FBI_X`、`1H0D_C`、`1NSN_S`、
52
- `1OB1_C`,但执行前以当前服务响应和用户选择为准。
53
-
54
- ### ldm-health(只读)
55
-
56
- - 代码:`endpoint="ldm-health"; data=None; params=None`
57
- - 投影:supported_antigens、cdrh3_length、objective、Absolut/模型真实性字段。
58
-
59
- ### ldm-init / ldm-init-validate
60
-
61
- ```json
62
- {
63
- "task": "为指定抗原生成初始 CDRH3 候选",
64
- "num_initial": 3,
65
- "antigen": "1ADQ_A",
66
- "seed": 42
67
- }
68
- ```
69
-
70
- 只校验参数时使用 `ldm-init-validate`;正式生成使用 `ldm-init`。成功候选必须是服务
71
- 返回的 CDRH3 序列,不得由模型自行编造。
72
-
73
- ### ldm-suggest / ldm-suggest-validate
74
-
75
- ```json
76
- {
77
- "task": "继续降低抗原结合能",
78
- "history_xs": ["ARVGYSLYAMD", "AKYGGYDYAMD"],
79
- "history_ys": [-18.2, -17.4],
80
- "num_suggestions": 2,
81
- "antigen": "1ADQ_A",
82
- "seed": 42
83
- }
84
- ```
85
-
86
- AntBO 是单目标,`history_ys` 必须是一维有限数值数组,并与 `history_xs` 等长。
87
- 每条 CDRH3 必须是 11 个标准氨基酸字符;以 `ldm-health` 当前返回的
88
- `cdrh3_length` 为最终约束。
89
-
90
- ### evaluate / evaluate-validate
91
-
92
- ```json
93
- {
94
- "designs": ["ARVGYSLYAMD", "AKYGGYDYAMD"],
95
- "antigen": "1ADQ_A"
96
- }
97
- ```
98
-
99
- 成功 score 数量必须与 designs 一致;结合能越低越好。生成、建议和评估均为远端重型
100
- 调用,结果未知或超时时不得重试,也不得用本地随机分数补全。
1
+ # AntBO reference
2
+
3
+ Use `delta-cli science invoke` with `endpoint`, `data` and `params`. Read business results
4
+ from the CLI response fields defined in this document. Run operations marked as mutating only
5
+ with the user's explicit authorisation, and never retry them.
6
+
7
+ For antibody/CDRH3 tasks, do not switch to small-molecule LDM-BO or STRBO even if the user
8
+ mentions “LDM”. The current catalogue exposes both CDRH3 generation, suggestion and evaluation
9
+ operations and the traditional AntBO job-management operations.
10
+
11
+ ## health (read-only)
12
+
13
+ - Use case: Check whether the remote AntBO environment is available.
14
+ - Request: `endpoint="health"; data=None; params=None`
15
+ - Read from the response: `status`, `antbo_available`, `metadata`, `limits` and `warnings`.
16
+
17
+ ## run-default-job (mutating)
18
+
19
+ - Use case: The user explicitly asks to start the standard background continuation job.
20
+ - Request: `endpoint="run-default-job"; data=None; params={"log_name":"antbo_<unique-timestamp>.log","append":False,"timeout_seconds":86400}`
21
+ - Read from the response: `started`, `pid`, `log_name` or `log_path`, and `timeout_seconds`. Do not retry if the outcome is unknown.
22
+
23
+ Report the job as started only when the same business response contains `started=true`, a
24
+ non-empty `pid`, and either `log_name` or `log_path`. If any field is missing, mark the start
25
+ as unverified and do not submit again.
26
+
27
+ ## run (heavy, mutating)
28
+
29
+ - Use case: The user explicitly supplies an approved AntBO script, configuration and antigen file, and asks for synchronous execution.
30
+ - Request: `endpoint="run"; data={"script_path":"./bo/main.py","config_path":"./bo/config.yaml","n_trials":1,"seed":42,"antigens_file":"<path within project root>","extra_args":[],"timeout_seconds":86400,"cuda_visible_devices":"0","conda_env":"DGM","log_name":"antbo_custom.log","append":False}; params=None`
31
+ - Read from the response: `ok`, `returncode`, `timed_out`, `log_path` and whether the log was truncated. Do not include the full log in the final reply.
32
+
33
+ ## log (read-only)
34
+
35
+ - Use case: The user provides a known `log_name` and asks to inspect the end of the log.
36
+ - Request: `endpoint="log"; data=None; params={"log_name":"antbo_run.log"}`
37
+ - Read from the response: `log_name`, `log` and `log_truncated`. For long logs, provide only a bounded summary of the tail.
38
+
39
+ ## jobs (read-only)
40
+
41
+ - Use case: List the active jobs registered by the current service container.
42
+ - Request: `endpoint="jobs"; data=None; params=None`
43
+ - Read `pid`, `running`, `returncode`, `log_name` and `log_path` from each item in `jobs`.
44
+
45
+ ## stop (mutating)
46
+
47
+ - Use case: The user explicitly asks to stop a job with a confirmed PID.
48
+ - Request: `endpoint="stop"; data=None; params={"pid":12345}`
49
+ - Read from the response: `stopped`, `pid` and `message`. Do not retry blindly or call without parameters when multiple jobs exist.
50
+
51
+ ## CDRH3 generation and optimisation
52
+
53
+ The server's supported antigens are defined by `supported_antigens` in the health response.
54
+ Do not guess or treat an arbitrary protein-file path as an antigen. Deployments commonly support
55
+ `1ADQ_A`, `1FBI_X`, `1H0D_C`, `1NSN_S` and `1OB1_C`, but use the current service response
56
+ and the user's choice before execution.
57
+
58
+ ### ldm-health (read-only)
59
+
60
+ - Request: `endpoint="ldm-health"; data=None; params=None`
61
+ - Read from the response: `supported_antigens`, `cdrh3_length`, `objective`, and fields describing Absolut/model provenance.
62
+
63
+ ### ldm-init / ldm-init-validate
64
+
65
+ ```json
66
+ {
67
+ "task": "Generate initial CDRH3 candidates for the specified antigen",
68
+ "num_initial": 3,
69
+ "antigen": "1ADQ_A",
70
+ "seed": 42
71
+ }
72
+ ```
73
+
74
+ Use `ldm-init-validate` only to validate parameters; use `ldm-init` for generation. Successful
75
+ candidates must be CDRH3 sequences returned by the service. Do not invent candidates.
76
+
77
+ ### ldm-suggest / ldm-suggest-validate
78
+
79
+ ```json
80
+ {
81
+ "task": "Continue reducing antigen binding energy",
82
+ "history_xs": ["ARVGYSLYAMD", "AKYGGYDYAMD"],
83
+ "history_ys": [-18.2, -17.4],
84
+ "num_suggestions": 2,
85
+ "antigen": "1ADQ_A",
86
+ "seed": 42
87
+ }
88
+ ```
89
+
90
+ AntBO is single-objective. `history_ys` must be a one-dimensional array of finite numbers and
91
+ have the same length as `history_xs`. Each CDRH3 must contain 11 standard amino-acid characters;
92
+ use the current `cdrh3_length` returned by `ldm-health` as the final constraint.
93
+
94
+ ### evaluate / evaluate-validate
95
+
96
+ ```json
97
+ {
98
+ "designs": ["ARVGYSLYAMD", "AKYGGYDYAMD"],
99
+ "antigen": "1ADQ_A"
100
+ }
101
+ ```
102
+
103
+ The number of returned scores must match the number of designs; lower binding energy is better.
104
+ Generation, suggestion and evaluation are all heavy remote calls. Do not retry if the outcome is
105
+ unknown or times out, and do not fill in results with locally generated random scores.
@@ -1,89 +1,92 @@
1
- # Delta-BO 详细规则
2
-
3
- 所有在线调用直接使用 `delta-cli science invoke`,tool 固定为 `delta-bo`。当前 CLI catalog 只暴露
4
- `commands` 和 `generate`;禁止根据旧 HTTP 文档猜测或直连 stateful command API。
5
-
6
- ## commands
7
-
8
- 情景:用户要求查看当前部署支持的 Delta-BO 命令。
9
-
10
- ```text
11
- delta-cli science invoke --tool delta-bo --endpoint commands
12
- ```
13
-
14
- 无 body。只报告当前业务响应中的命令列表,不从历史文档补全。
15
-
16
- ## generate
17
-
18
- 情景:针对数值、整数或分类实验变量生成随机搜索或贝叶斯优化建议。
19
-
20
- 无真实历史,或历史少于 5 条且用户没有明确要求 BO 时,使用有界随机搜索:
21
-
22
- ```json
23
- {
24
- "params": [
25
- {"name": "x", "type": "numeric", "low": 0.0, "high": 1.0}
26
- ],
27
- "num_suggestions": 3,
28
- "algorithm": "random-search",
29
- "seed": 42
30
- }
31
- ```
32
-
33
- 有真实历史且用户明确要求 BO 时,可以使用:
34
-
35
- ```json
36
- {
37
- "params": [
38
- {"name": "temperature", "type": "numeric", "low": 20.0, "high": 120.0},
39
- {"name": "catalyst", "type": "categorical", "choices": ["A", "B", "C"]}
40
- ],
41
- "objectives": [{"name": "yield", "minimize": false}],
42
- "num_suggestions": 2,
43
- "algorithm": "bo",
44
- "model": {"name": "gp", "min_samples": 2, "train_steps": 50},
45
- "acq_target": {"name": "ucb", "beta": 2.0},
46
- "solver": {"name": "ga", "pop_size": 40, "n_gen": 10},
47
- "histories": {
48
- "decisions": [
49
- {"temperature": 40.0, "catalyst": "A"},
50
- {"temperature": 80.0, "catalyst": "B"}
51
- ],
52
- "observations": [
53
- {"yield": 0.42},
54
- {"yield": 0.61}
55
- ]
56
- },
57
- "seed": 7
58
- }
59
- ```
60
-
61
- 参数类型仅支持 `numeric`、`integer`、`categorical`。优先使用 object-form history,
62
- 避免数组列顺序歧义。不得编造 observation、目标值或所谓最优点。
63
-
64
- 可选去重与约束:
65
-
66
- ```json
67
- {
68
- "diversity": {
69
- "deduplicate": true,
70
- "min_numeric_distance": {"temperature": 5.0},
71
- "prefer_unique_categories": true
72
- },
73
- "constraints": [
74
- {"type": "unique_batch"},
75
- {"type": "avoid_seen_decisions"}
76
- ]
77
- }
78
- ```
79
-
80
- 只报告业务响应的 `suggestions`、`suggestion_metadata`、`warnings`、
81
- `generated_candidate_count` 和 `diversity` 中实际存在的字段。空 suggestions 或失败
82
- 不得用本地 GP、UCB 或随机数替代。
83
-
84
- ## 已知但未暴露的旧能力
85
-
86
- 旧服务曾包含 session、space、objective、policy、suggest、observe、loop、status、
87
- best 等有状态命令,但它们不是当前 Delta CLI operation。本 Skill 只保留这条能力
88
- 边界,不保留 URL 或 curl 示例,也不执行这些操作。需要扩展时,先由 Science Server
89
- 暴露 operation 和请求 schema,再更新本 reference。
1
+ # Delta-BO reference
2
+
3
+ Make all online calls with `delta-cli science invoke`; the tool is always `delta-bo`. The current
4
+ CLI catalogue exposes only `commands` and `generate`. Do not infer operations from old HTTP
5
+ documentation or call the stateful command API directly.
6
+
7
+ ## commands
8
+
9
+ Use case: The user asks which Delta-BO commands are supported by the current deployment.
10
+
11
+ ```text
12
+ delta-cli science invoke --tool delta-bo --endpoint commands
13
+ ```
14
+
15
+ No request body. Report only the command list in the current business response; do not fill it in from historical documentation.
16
+
17
+ ## generate
18
+
19
+ Use case: Generate random-search or Bayesian-optimisation suggestions for numeric, integer or categorical experimental variables.
20
+
21
+ When there is no real history, or fewer than five historical observations and the user has not explicitly requested BO, use bounded random search:
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
+ When real history is available and the user explicitly requests BO, you may use:
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
+ Supported parameter types are `numeric`, `integer` and `categorical`. Prefer object-form history
63
+ to avoid ambiguity about the order of array columns. Do not invent observations, objective values
64
+ or purported optima.
65
+
66
+ Optional deduplication and constraints:
67
+
68
+ ```json
69
+ {
70
+ "diversity": {
71
+ "deduplicate": true,
72
+ "min_numeric_distance": {"temperature": 5.0},
73
+ "prefer_unique_categories": true
74
+ },
75
+ "constraints": [
76
+ {"type": "unique_batch"},
77
+ {"type": "avoid_seen_decisions"}
78
+ ]
79
+ }
80
+ ```
81
+
82
+ Report only fields actually present in the business response: `suggestions`,
83
+ `suggestion_metadata`, `warnings`, `generated_candidate_count` and `diversity`. Do not replace
84
+ empty suggestions or a failure with local GP, UCB or random-number results.
85
+
86
+ ## Known legacy capabilities that are not exposed
87
+
88
+ The old service included stateful commands such as session, space, objective, policy, suggest,
89
+ observe, loop, status and best, but they are not current Delta CLI operations. This Skill records
90
+ only that capability boundary: it includes no URL or curl examples and does not run those
91
+ operations. To extend the interface, first expose the operation and request schema through Science
92
+ Server, then update this reference.
@@ -1,116 +1,118 @@
1
- # GSAS-II 详细规则
2
-
3
- 所有调用直接使用 `delta-cli science invoke`。模拟必须使用真实 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 内通过 CLI 逐步完成:
115
- `pymatgen structure-convert -> gsasii powder-simulate/powder-refine`。下游只使用上一步
116
- 成功业务响应中的结构文本或 profile;不得执行本地脚本或直连服务。
1
+ # GSAS-II reference
2
+
3
+ Make all calls with `delta-cli science invoke`. Simulation requires a real CIF; refinement
4
+ requires real powder data, instrument parameters and phase CIFs. Never fill in a failed result
5
+ with synthetic data. If the input is not a CIF, first use a successful pymatgen
6
+ `structure-convert` result from the current task.
7
+
8
+ ## Health
9
+
10
+ Operation: `health`; no request body.
11
+
12
+ Key response fields in `data`: `status`, `service`, `gsasii_available`,
13
+ `metadata`, and `limits`.
14
+
15
+ Call this only when the user explicitly asks for a health check; do not add a health call automatically before simulation or refinement.
16
+
17
+ ## Powder Simulation
18
+
19
+ Operation: `powder-simulate`.
20
+
21
+ ```json
22
+ {
23
+ "cif": "<CIF text>",
24
+ "phase_name": "phase",
25
+ "instrument_parameters": "<GSAS-II instrument parameter text>",
26
+ "histogram_name": "simulation",
27
+ "t_min": 10.0,
28
+ "t_max": 80.0,
29
+ "t_step": 0.02,
30
+ "include_profile": true,
31
+ "max_profile_points": 1000,
32
+ "include_reflections": true,
33
+ "max_reflections": 1000,
34
+ "return_refined_cif": false,
35
+ "return_project": false
36
+ }
37
+ ```
38
+
39
+ Use either `t_step` or `n_points`, not both. Optional fields include
40
+ `wavelength`, `radiation`, `scale`, `include_profile`, `max_profile_points`,
41
+ `include_reflections`, `max_reflections`, `return_refined_cif`, and
42
+ `return_project`.
43
+
44
+ The response includes `profile` points with `x`, `y_calc`, optional background,
45
+ bounded `reflections` with hkl/d-spacing/2theta where available, and metadata.
46
+ If `return_project` is true, `project_base64` contains the GSAS-II `.gpx`
47
+ project. If `return_refined_cif` is true, `refined_cif` contains exported CIF
48
+ text for pymatgen handoff when GSAS-II supports export for the phase.
49
+
50
+ Notes:
51
+
52
+ - `cif` should be valid CIF text. If the input is POSCAR/JSON/CSSR/XSF, use
53
+ pymatgen `structure-convert` first with `output_format: "cif"`.
54
+ - `instrument_parameters` should be GSAS-II instrument parameter text such as
55
+ `INST_XRY.PRM` when instrument-specific simulation is needed.
56
+ - For quick simulation only, `instrument_parameters` may be omitted. The service
57
+ then generates a simple CW X-ray instrument model from `wavelength` or
58
+ `radiation` (`CuKa` by default; also supports aliases such as `MoKa`, `CoKa`,
59
+ `CrKa`, and explicit numeric wavelength).
60
+ - Refinement still requires real `instrument_parameters`.
61
+ - `max_profile_points` controls response sampling. Use small values for smoke
62
+ tests and larger values for profile comparison.
63
+ - Older deployed gateway images may require `max_profile_points >= 10`.
64
+
65
+ ## Powder Refinement
66
+
67
+ Operation: `powder-refine`.
68
+
69
+ ```json
70
+ {
71
+ "powder_data": "<two-column or three-column powder data text>",
72
+ "powder_format": "xy",
73
+ "instrument_parameters": "<GSAS-II instrument parameter text>",
74
+ "phases": [
75
+ {"name": "phase", "cif": "<CIF text>"}
76
+ ],
77
+ "refinement_mode": "rietveld",
78
+ "refinement_steps": [],
79
+ "max_cycles": 3,
80
+ "histogram_name": "powder",
81
+ "include_profile": true,
82
+ "max_profile_points": 1000,
83
+ "include_reflections": true,
84
+ "max_reflections": 1000,
85
+ "return_refined_cif": false,
86
+ "return_project": false
87
+ }
88
+ ```
89
+
90
+ Supported `powder_format` values: `xy`, `xye`, `fxye`, `gsas`, and `csv`.
91
+
92
+ `refinement_mode: "rietveld"` is currently implemented. `pawley` and `lebail`
93
+ return a clear not-implemented response until the service wires the
94
+ mode-specific GSAS-II setup.
95
+
96
+ The response includes fit `residuals` when available, phase summaries, sampled
97
+ profile points, bounded `reflections`, warnings, optional `refined_cif`, and
98
+ the optional `.gpx` project.
99
+
100
+ Notes:
101
+
102
+ - Use `xy` for simple whitespace-delimited `x y` rows, `xye` for `x y esd`,
103
+ `csv` for numeric comma-separated rows, or `gsas`/`fxye` for GSAS-like powder
104
+ formats.
105
+ - `max_cycles: 0` is useful for project-construction smoke tests. Increase it
106
+ only when the powder data, phase model, instrument file, and refinement steps
107
+ are realistic.
108
+ - `refinement_steps` is passed to `G2Project.do_refinements`. Keep recipes
109
+ incremental and inspect `warnings`, `residuals`, and `lst` output.
110
+ - Refinement may return `valid: false` with partial phase/profile information
111
+ if GSAS-II constructed the project but a refinement step failed.
112
+
113
+ ## Cross-tool hand-off
114
+
115
+ Complete structure conversion, diffraction simulation and refinement step by step through the
116
+ CLI within this Skill: `pymatgen structure-convert -> gsasii powder-simulate/powder-refine`.
117
+ Use downstream only the structure text or profile from the preceding successful business response;
118
+ do not run local scripts or call the service directly.