@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,138 +1,138 @@
1
- # 标准任务请求模式
2
-
3
- 本文件提供 `delta-sandbox` 处理常见任务时的推荐请求写法。这些示例是语言无关的模板,实际代码由 skill 在 sandbox 内部生成或写入。
4
-
5
- ## Planner 调用本 skill 时的 required_outputs
6
-
7
- 所有直接调用 `delta-sandbox` 的 plan step 都应该声明会落盘一个 `.json` 文件。这样 skill 运行命令后把 sandbox `log_file` 写入本地 `result.json` 时,host 可以正确通过 Phase-10B deliverable 校验。
8
-
9
- ```yaml
10
- required_outputs:
11
- - kind: file
12
- extensions: [".json"]
13
- ```
14
-
15
- > 说明:这是声明 skill 会创建 `.json` 结果文件,不是要求用户请求中出现 `.json`。用户请求仍按下面的模板使用中性动词。
16
-
17
- ## 通用脚本输出模板
18
-
19
- 为了让 skill 用同一套流程生成 `RESULT:` 并避免大模型去摘要长日志,推荐任何 sandbox 脚本在**执行结束时**打印一行结构化 JSON:
20
-
21
- ```json
22
- {"status":"ok","key_metric_1":"value_1","key_metric_2":123}
23
- ```
24
-
25
- > SSE 路径下 `sandbox run` / `run-bg --wait` 的 **complete 帧已带 `result_summary`**(CLI 检测 stdout 末尾 50 行内的合法 JSON 对象并注入,无需手动 read+parse)。脚本作者保证 stdout 最后一行是合法 JSON 即可,skill 端直接从 complete 帧取 `result_summary`;仅当 complete 帧缺失该字段(末尾无合法 JSON)时才退化为 `sandbox read` 读取 `log_file` 反向扫描提取。`--summary` 富化(含 hints)仍仅旧服务器回退路径生效。
26
-
27
- SKILL 会把它提取为 `result.json` 的 `summary`,并生成 `result_summary` 与最终 `RESULT:` 行。
28
-
29
- **不要**再输出 `FINAL_ANSWER: ...` 这样的标记行,也不要在 JSON 里使用 `final_answer` 字段。summary 里的语义字段(如 `output`、`result`、`generated_text`、`final_accuracy`)已经足够表达结果。
30
-
31
- 不同任务的关键字段示例:
32
-
33
- - **CUDA 检查**:`status`, `torch_version`, `cuda_available`, `device_name`
34
- - **训练任务**:`status`, `epochs`, `final_loss`, `final_accuracy`, `model_file`
35
- - **推理任务**:`status`, `input_samples`, `output_file`, `avg_latency_ms`
36
- - **数据处理**:`status`, `input_rows`, `output_rows`, `output_file`
37
- - **编译/构建**:`status`, `build_time_s`, `output_binary`, `tests_passed`
38
-
39
- ## 1. GPU / CUDA 可用性检查
40
-
41
- 用户请求示例:
42
-
43
- ```text
44
- 在 GPU sandbox 中运行标准 PyTorch CUDA 自检脚本,返回 exit_code、torch 版本、CUDA 是否可用、CUDA/cuDNN 版本、GPU 名称与显存信息。
45
- ```
46
-
47
- 说明:
48
-
49
- - 不要在请求里出现 `torch.cuda.is_available()` 等完整代码 token,避免被 host 误判为 `.cuda` 文件承诺。对应的 plan step 仍按上面模板声明 `.json` 输出。
50
- - 推荐让脚本在 `stdout` 末尾输出一行结构化 JSON,例如:
51
- ```json
52
- {"torch_version":"2.7.0+cu128","cuda_available":true,"device_count":1,
53
- "device_name":"NVIDIA GeForce RTX 3090","tensor_op":"[101.0]",
54
- "memory_before_mb":{"allocated":0,"reserved":0,"max_allocated":0},
55
- "memory_after_mb":{"allocated":0.0005,"reserved":2.0,"max_allocated":0.001}}
56
- ```
57
- - skill 会从 `log_file` 提取这个 JSON 作为本地 `result.json` 的 `summary`,最终只输出一行 `RESULT: ...`。
58
- - 完整 `nvidia-smi` 原始输出保留在 sandbox 的 `log_file` 中。
59
-
60
- ## 2. 运行用户已有的脚本
61
-
62
- ```text
63
- 在 sandbox <sandbox_id> 中运行 <wd>/train.py,参数为 --epochs 10 --batch-size 32。
64
- ```
65
-
66
- > `<wd>` 为该 sandbox 的 working-directory(`/workspace/{user_id}/{sandbox_id}`,先 `delta-cli sandbox working-directory <id>` 查询)。
67
-
68
- 说明:文件已存在,用中性动词 `运行`,不使用 `创建` 等承诺动词。
69
-
70
- ## 3. 安装依赖并执行命令
71
-
72
- ```text
73
- 在 sandbox 中运行 pip install -r <wd>/requirements.txt,然后运行 python <wd>/app.py。
74
- ```
75
-
76
- 说明:依赖安装和命令执行都没有落盘新文件,使用中性动词描述。
77
-
78
- ## 4. 训练并将指标落盘
79
-
80
- ```text
81
- 在 GPU sandbox 中运行训练脚本(例如基于 PyTorch 的 MNIST 训练),训练完成后在 stdout 末尾打印包含 epochs、final_loss、final_accuracy、model_file 的结构化 JSON。
82
- ```
83
-
84
- 说明:
85
-
86
- - 训练日志可能很长,不要让 skill 去读整段日志再摘要;让脚本自己输出关键指标。
87
- - 推荐脚本最终打印:`{"status":"ok","epochs":10,"final_loss":0.023,"final_accuracy":0.992,"model_file":"<wd>/model.pt"}`
88
- - skill 会把它提取为 `result.json` 的 `summary`,最终输出 `RESULT: exit_code=0, status=ok, epochs=10, ...`。
89
- - 如需保存完整模型文件,可再用 `sandbox read` 或 `sandbox upload` 处理,不属于 `result.json` 的摘要范围。
90
-
91
- ## 5. 通用数据处理
92
-
93
- ```text
94
- 在 sandbox 中运行数据处理命令,读取 <wd>/input.csv,输出 <wd>/output.csv,并在 stdout 末尾打印包含 input_rows、output_rows、output_file 的结构化 JSON。
95
- ```
96
-
97
- 说明:
98
-
99
- - 推荐脚本最终打印:`{"status":"ok","input_rows":10000,"output_rows":9876,"output_file":"<wd>/output.csv"}`
100
- - skill 会把它提取为 `result.json` 的 `summary`,最终输出 `RESULT: exit_code=0, status=ok, input_rows=10000, output_rows=9876, output_file=<wd>/output.csv`。
101
-
102
- ## 6. 模型推理(Qwen / LLM / 视觉等)
103
-
104
- 用户请求示例:
105
-
106
- ```text
107
- 在 GPU sandbox 中用 ModelScope 上的 Qwen/Qwen2.5-0.5B-Instruct 运行一次推理,输入 "100+10",返回模型的输出结果及 CUDA 可用性摘要。
108
- ```
109
-
110
- 说明:
111
-
112
- - 请求里不要贴完整 Python 代码,也不要指定宿主文件路径(如 `@ROOT/inference.py`、本地绝对路径等),更不要要求脚本输出 `FINAL_ANSWER:` 标记行。脚本内容、模型下载、执行路径都由 skill 内部通过 `delta-cli sandbox write` 写入 sandbox 后运行。
113
- - 推荐让脚本在 `stdout` 末尾打印一行结构化 JSON,例如:
114
- ```json
115
- {"status":"ok","cuda_available":true,"device":"cuda","model":"Qwen/Qwen2.5-0.5B-Instruct","input":"100+10","generated_text":"110"}
116
- ```
117
- - skill 会把它提取为 `result.json` 的 `summary`,最终输出 `RESULT: exit_code=0, status=ok, cuda_available=True, generated_text=110, ...`。
118
-
119
- > **GPU 显存与模型匹配**:创建 sandbox 时的 `--gpu-mem`(单位 MiB)必须匹配实际运行的模型。模型参数量/精度越大,所需显存越大;把大模型塞进过小的 `--gpu-mem` 会直接 OOM。上面的示例用的是 `Qwen2.5-0.5B`(0.5B 小模型),**不要把它当作更大模型(如 7B/9B/13B)的显存参考**。跑较大模型前先评估其显存需求、适当调大 `--gpu-mem`,并建议先用小模型验证流程是否跑通。
120
-
121
- ## 注意事项
122
-
123
- - 尽量用自然语言描述任务,完整代码由 skill 内部处理。
124
- - 只有在 skill 会真实创建文件时,才在请求中显式写出 `*.py` / `*.json` / `*.csv` 等扩展名。
125
- - 不要使用 `脚本需输出...` 这类把代码片段直接跟在承诺动词后的句式。
126
- - **任务完成的标准是执行结果,不是脚本文件存在**。Planner 和 skill 都要以本地 `result.json` 的生成作为完成标志;`required_outputs` 必须声明 `.json`,不要只声明 `{"kind": "file"}`。
127
- - **`skill_request` 里不要出现完整代码块或宿主文件路径概念**(如 `@ROOT/...`、`/Users/...`)。脚本应通过 `delta-cli sandbox write <id> --source <文件名>` 写入 sandbox 的 working-directory(`/workspace/{user_id}/{sandbox_id}/...`)。
128
-
129
- ## 本地 `result.json` 的内容约定
130
-
131
- - **SSE 首选路径(推荐,一步到位)**:`sandbox run` / `run-bg --wait` 的 **complete 帧直接带 `result_summary`**(CLI 检测 stdout 末尾 JSON 注入),skill 从 complete 帧提取即可,无需 read+parse。
132
- - **SSE 回退路径**:complete 帧缺失 `result_summary`(stdout 末尾无合法 JSON)时,`delta-cli sandbox read <id> --path <log_file>` 读取 run envelope 日志文件 + 反向扫描 stdout 末尾 JSON 提取。`log_file` 路径来自 SSE `complete` 帧(CLI 已兜底补全)或 `sandbox logs` 快照(`finished=true` 后)。
133
- - **旧服务器回退路径**:`run` / `run-bg --wait` 走轮询回退时返回 `CommandResult` 信封,可直接复用 `data.result_summary` 字段。
134
- - 本地 `result.json` 是一份**精简摘要**,用于 host deliverable 校验,不是完整日志存档。
135
- - 必须包含 `result_summary` 字段,内容与最终 `RESULT:` 行一致,方便 Runner 直接读取结论。
136
- - 只写入关键字段(`exit_code`、`finished`、`summary`、`result_summary`、`error`)。**不要**额外添加 `final_answer` 等字段。
137
- - 不要把完整原始 `stdout` 塞进 `result.json`,否则 host 的 `read_file` 工具预览时会截断,Runner 可能误以为文件被截断。
138
- - 完整原始输出保留在 sandbox 的 `log_file` 中,需要时再 `sandbox read`。
1
+ # Standard task request patterns
2
+
3
+ This file provides recommended request patterns for common tasks handled by `delta-sandbox`. The examples are language-agnostic templates; the actual code is generated or written by the skill inside the sandbox.
4
+
5
+ ## `required_outputs` when the Planner calls this skill
6
+
7
+ Every plan step that directly calls `delta-sandbox` should declare that it will write a `.json` file to disk. This allows the host to validate the deliverable in Phase-10B when the skill writes the sandbox `log_file` to the local `result.json` after running the command.
8
+
9
+ ```yaml
10
+ required_outputs:
11
+ - kind: file
12
+ extensions: [".json"]
13
+ ```
14
+
15
+ > This declares that the skill will create a `.json` result file; it does not require `.json` to appear in the user's request. Keep the user's request neutral in its wording, following the templates below.
16
+
17
+ ## General script output template
18
+
19
+ To let the skill generate `RESULT:` consistently and avoid asking an LLM to summarise long logs, we recommend that every sandbox script print one line of structured JSON **at the end of execution**:
20
+
21
+ ```json
22
+ {"status":"ok","key_metric_1":"value_1","key_metric_2":123}
23
+ ```
24
+
25
+ > On the SSE path, the **complete frame for `sandbox run` / `run-bg --wait` already includes `result_summary`** (the CLI detects a valid JSON object in the last 50 lines of stdout and injects it, so there is no need to read and parse it manually). The script author only needs to ensure that the last line of stdout is valid JSON; the skill can then take `result_summary` directly from the complete frame. Only if the complete frame lacks this field (because there is no valid JSON at the end) should it fall back to `sandbox read` to read the `log_file` and scan backwards. `--summary` enrichment (including hints) still takes effect only on the legacy-server fallback path.
26
+
27
+ The skill extracts this as the `summary` in `result.json`, then generates `result_summary` and the final `RESULT:` line.
28
+
29
+ **Do not** output marker lines such as `FINAL_ANSWER: ...` or use a `final_answer` field in the JSON. Semantic fields in the summary (such as `output`, `result`, `generated_text` and `final_accuracy`) are enough to express the result.
30
+
31
+ Examples of key fields for different tasks:
32
+
33
+ - **CUDA check**: `status`, `torch_version`, `cuda_available`, `device_name`
34
+ - **Training task**: `status`, `epochs`, `final_loss`, `final_accuracy`, `model_file`
35
+ - **Inference task**: `status`, `input_samples`, `output_file`, `avg_latency_ms`
36
+ - **Data processing**: `status`, `input_rows`, `output_rows`, `output_file`
37
+ - **Compilation/build**: `status`, `build_time_s`, `output_binary`, `tests_passed`
38
+
39
+ ## 1. GPU / CUDA availability check
40
+
41
+ Example user request:
42
+
43
+ ```text
44
+ Run the standard PyTorch CUDA self-check script in a GPU sandbox; return exit_code, the torch version, whether CUDA is available, CUDA/cuDNN versions, the GPU name and memory information.
45
+ ```
46
+
47
+ Notes:
48
+
49
+ - Do not include full code expressions such as `torch.cuda.is_available()` in the request; the host may mistake them for a `.cuda` file commitment. The corresponding plan step should still declare `.json` output using the template above.
50
+ - We recommend that the script print one line of structured JSON at the end of `stdout`, for example:
51
+ ```json
52
+ {"torch_version":"2.7.0+cu128","cuda_available":true,"device_count":1,
53
+ "device_name":"NVIDIA GeForce RTX 3090","tensor_op":"[101.0]",
54
+ "memory_before_mb":{"allocated":0,"reserved":0,"max_allocated":0},
55
+ "memory_after_mb":{"allocated":0.0005,"reserved":2.0,"max_allocated":0.001}}
56
+ ```
57
+ - The skill extracts this JSON from `log_file` as the `summary` in the local `result.json`, then outputs only one `RESULT: ...` line.
58
+ - The full raw `nvidia-smi` output remains in the sandbox `log_file`.
59
+
60
+ ## 2. Run a script the user already has
61
+
62
+ ```text
63
+ In sandbox <sandbox_id>, run <wd>/train.py with the arguments --epochs 10 --batch-size 32.
64
+ ```
65
+
66
+ > `<wd>` is this sandbox's working directory (`/workspace/{user_id}/{sandbox_id}`; first check it with `delta-cli sandbox working-directory <id>`).
67
+
68
+ Notes: the file already exists, so use the neutral verb `run` rather than a commitment verb such as `create`.
69
+
70
+ ## 3. Install dependencies and run a command
71
+
72
+ ```text
73
+ In the sandbox, run pip install -r <wd>/requirements.txt, then run python <wd>/app.py.
74
+ ```
75
+
76
+ Notes: neither dependency installation nor command execution creates a new deliverable file, so describe them with neutral verbs.
77
+
78
+ ## 4. Train and write metrics to disk
79
+
80
+ ```text
81
+ In a GPU sandbox, run a training script (for example, PyTorch-based MNIST training). When training finishes, print structured JSON at the end of stdout containing epochs, final_loss, final_accuracy and model_file.
82
+ ```
83
+
84
+ Notes:
85
+
86
+ - Training logs can be long; do not have the skill read the entire log and then summarise it. Have the script output the key metrics itself.
87
+ - We recommend that the script finish by printing: `{"status":"ok","epochs":10,"final_loss":0.023,"final_accuracy":0.992,"model_file":"<wd>/model.pt"}`
88
+ - The skill extracts this as the `summary` in `result.json`, then outputs `RESULT: exit_code=0, status=ok, epochs=10, ...`.
89
+ - To save the complete model file, use `sandbox read` or `sandbox upload` as needed; the model file is outside the scope of the `result.json` summary.
90
+
91
+ ## 5. General data processing
92
+
93
+ ```text
94
+ In the sandbox, run a data-processing command that reads <wd>/input.csv and writes <wd>/output.csv, then prints structured JSON at the end of stdout containing input_rows, output_rows and output_file.
95
+ ```
96
+
97
+ Notes:
98
+
99
+ - We recommend that the script finish by printing: `{"status":"ok","input_rows":10000,"output_rows":9876,"output_file":"<wd>/output.csv"}`
100
+ - The skill extracts this as the `summary` in `result.json`, then outputs `RESULT: exit_code=0, status=ok, input_rows=10000, output_rows=9876, output_file=<wd>/output.csv`.
101
+
102
+ ## 6. Model inference (Qwen / LLM / vision, etc.)
103
+
104
+ Example user request:
105
+
106
+ ```text
107
+ Run one inference in a GPU sandbox using Qwen/Qwen2.5-0.5B-Instruct from ModelScope, with "100+10" as input; return the model's output and a summary of CUDA availability.
108
+ ```
109
+
110
+ Notes:
111
+
112
+ - Do not paste complete Python code into the request or specify a host file path (such as `@ROOT/inference.py` or a local absolute path), and do not ask the script to output a `FINAL_ANSWER:` marker line. The skill writes the script, downloads the model and sets the execution path inside the sandbox using `delta-cli sandbox write`.
113
+ - We recommend that the script print one line of structured JSON at the end of `stdout`, for example:
114
+ ```json
115
+ {"status":"ok","cuda_available":true,"device":"cuda","model":"Qwen/Qwen2.5-0.5B-Instruct","input":"100+10","generated_text":"110"}
116
+ ```
117
+ - The skill extracts this as the `summary` in `result.json`, then outputs `RESULT: exit_code=0, status=ok, cuda_available=True, generated_text=110, ...`.
118
+
119
+ > **Match GPU memory to the model:** The `--gpu-mem` value (in MiB) used to create the sandbox must match the model being run. Larger models and higher precision require more memory; putting a large model in a sandbox with too little `--gpu-mem` will cause OOM directly. The example above uses `Qwen2.5-0.5B` (a small 0.5B model); **do not use it as a memory reference for larger models such as 7B/9B/13B**. Before running a larger model, assess its memory requirements, increase `--gpu-mem` as appropriate, and consider verifying the workflow with a smaller model first.
120
+
121
+ ## Notes
122
+
123
+ - Describe tasks in natural language where possible; the skill handles the full code internally.
124
+ - Mention extensions such as `*.py` / `*.json` / `*.csv` explicitly in the request only when the skill will actually create a file.
125
+ - Do not use phrasing such as `The script should output...` that puts a code fragment immediately after a commitment verb.
126
+ - **Task completion is determined by the execution result, not by the presence of a script file.** The Planner and skill should both treat the creation of the local `result.json` as the completion criterion. `required_outputs` must declare `.json`; do not declare only `{"kind": "file"}`.
127
+ - **Do not include complete code blocks or host-file-path concepts in `skill_request`** (such as `@ROOT/...` or `/Users/...`). The script should be written to the sandbox working directory (`/workspace/{user_id}/{sandbox_id}/...`) with `delta-cli sandbox write <id> --source <filename>`.
128
+
129
+ ## Local `result.json` content contract
130
+
131
+ - **Preferred SSE path (recommended, one step):** The **complete frame for `sandbox run` / `run-bg --wait` includes `result_summary` directly** (the CLI injects detected trailing JSON from stdout), so the skill can extract it from the complete frame without reading and parsing the log.
132
+ - **SSE fallback path:** If the complete frame lacks `result_summary` (there is no valid JSON at the end of stdout), `delta-cli sandbox read <id> --path <log_file>` reads the run-envelope log file, then scans backwards through stdout to extract trailing JSON. The `log_file` path comes from the SSE `complete` frame (the CLI fills it in if needed) or the `sandbox logs` snapshot (after `finished=true`).
133
+ - **Legacy-server fallback path:** When `run` / `run-bg --wait` falls back to polling, it returns a `CommandResult` envelope whose `data.result_summary` field can be reused directly.
134
+ - The local `result.json` is a **concise summary** for host deliverable validation, not a complete log archive.
135
+ - It must include the `result_summary` field, with content matching the final `RESULT:` line, so the Runner can read the conclusion directly.
136
+ - Write only the key fields (`exit_code`, `finished`, `summary`, `result_summary`, `error`). **Do not** add fields such as `final_answer`.
137
+ - Do not put the full raw `stdout` in `result.json`; the host's `read_file` preview would be truncated, and the Runner might mistake this for a truncated file.
138
+ - Keep the full raw output in the sandbox `log_file` and use `sandbox read` to inspect it when needed.
@@ -1,47 +1,47 @@
1
- # skills/delta-science — Science Skill Package
2
-
3
- **Generated:** 2026-09-07
4
- **Parent:** `../AGENTS.md`
5
-
6
- ## OVERVIEW
7
-
8
- Single public `delta-science` skill: the company online-Science unified entrypoint. It is host-neutral and routed exclusively through Delta CLI (`science invoke`, durable `science task`, or controlled `science file`) to the Science Server. Per-tool operation contracts live in `references/` and are loaded on demand; there are no separate planner-visible per-tool skills.
9
-
10
- ## STRUCTURE
11
-
12
- ```
13
- delta-science/
14
- ├── SKILL.md # single entrypoint: routing, CLI-only execution, cross-tool handoff
15
- ├── agents/
16
- │ └── openai.yaml # host agent registration
17
- └── references/
18
- └── <tool>.md # one real tool's operation contract (pubchem, rdkit, pymatgen,
19
- # gsasii, lammps, delta-bo, ldm-bo, materials-design, qe,
20
- # strbo, synbo, antbo, xrd)
21
- ```
22
-
23
- ## WHERE TO LOOK
24
-
25
- | Path | Content |
26
- |------|---------|
27
- | `SKILL.md` | Service boundary, 安全红线 (no curl/requests/httpx/browser direct gateway), invoke/task/file templates, cross-tool handoff |
28
- | `references/<tool>.md` | One real tool's authoritative operation, request-field, response and failure schema |
29
-
30
- ## CONVENTIONS
31
-
32
- - JSON endpoint operations go through `delta-cli science invoke`; durable jobs go through `delta-cli science task`; raw/multipart operations go through `delta-cli science file`; no direct HTTP alternate routes
33
- - Tool/endpoint names are exact contracts from the server DB — read the matching reference first; never invent fields/enums from memory
34
- - Success is reported only when subprocess exit is 0 AND top-level JSON `ok` is `true`; `data` holds the service response
35
- - `references/` contains only one real tool per file; routing, service maps, catalogs and workflows belong in `SKILL.md` or live CLI discovery, not here
36
- - `retired_skills` (old per-tool skills) are removed, not referenced
37
- - Host-neutral: `delta-cli` is the sole service boundary; no host-specific tool/env dependencies
38
- - Discover newly-deployed tools via `delta-cli science list` / `delta-cli science endpoints list <tool>`; do not copy the server registry into the Skill
39
-
40
- ## ANTI-PATTERNS
41
-
42
- - Do not call `curl`/`requests`/`httpx`/browser/PowerShell web directly against the gateway
43
- - Do not bypass delta-cli via the legacy `large-discovery-model` Skill or gateway scripts
44
- - Do not fabricate science data or mislabel local-tool (RDKit/pymatgen/LAMMPS/etc.) results as Science results
45
- - Do not create extra JSON/CSV/report/image artifacts unless the user explicitly asks to save/export/plot
46
- - Do not embed realistic credentials or API keys in examples
47
- - Do not break relative links between SKILL.md and `references/`
1
+ # skills/delta-science — Science Skill Package
2
+
3
+ **Generated:** 2026-09-07
4
+ **Parent:** `../AGENTS.md`
5
+
6
+ ## OVERVIEW
7
+
8
+ Single public `delta-science` skill: the company online-Science unified entrypoint. It is host-neutral and routed exclusively through Delta CLI (`science invoke`, durable `science task`, or controlled `science file`) to the Science Server. Per-tool operation contracts live in `references/` and are loaded on demand; there are no separate planner-visible per-tool skills.
9
+
10
+ ## STRUCTURE
11
+
12
+ ```
13
+ delta-science/
14
+ ├── SKILL.md # single entrypoint: routing, CLI-only execution, cross-tool handoff
15
+ ├── agents/
16
+ │ └── openai.yaml # host agent registration
17
+ └── references/
18
+ └── <tool>.md # one real tool's operation contract (pubchem, rdkit, pymatgen,
19
+ # gsasii, lammps, delta-bo, ldm-bo, materials-design, qe,
20
+ # strbo, synbo, antbo, xrd)
21
+ ```
22
+
23
+ ## WHERE TO LOOK
24
+
25
+ | Path | Content |
26
+ |------|---------|
27
+ | `SKILL.md` | Service boundary, security guardrails (no curl/requests/httpx/browser direct gateway), invoke/task/file templates, cross-tool handoff |
28
+ | `references/<tool>.md` | One real tool's authoritative operation, request-field, response and failure schema |
29
+
30
+ ## CONVENTIONS
31
+
32
+ - JSON endpoint operations go through `delta-cli science invoke`; durable jobs go through `delta-cli science task`; raw/multipart operations go through `delta-cli science file`; no direct HTTP alternate routes
33
+ - Tool/endpoint names are exact contracts from the server DB — read the matching reference first; never invent fields/enums from memory
34
+ - Success is reported only when subprocess exit is 0 AND top-level JSON `ok` is `true`; `data` holds the service response
35
+ - `references/` contains only one real tool per file; routing, service maps, catalogs and workflows belong in `SKILL.md` or live CLI discovery, not here
36
+ - `retired_skills` (old per-tool skills) are removed, not referenced
37
+ - Host-neutral: `delta-cli` is the sole service boundary; no host-specific tool/env dependencies
38
+ - Discover newly-deployed tools via `delta-cli science list` / `delta-cli science endpoints list <tool>`; do not copy the server registry into the Skill
39
+
40
+ ## ANTI-PATTERNS
41
+
42
+ - Do not call `curl`/`requests`/`httpx`/browser/PowerShell web directly against the gateway
43
+ - Do not bypass delta-cli via the legacy `large-discovery-model` Skill or gateway scripts
44
+ - Do not fabricate science data or mislabel local-tool (RDKit/pymatgen/LAMMPS/etc.) results as Science results
45
+ - Do not create extra JSON/CSV/report/image artifacts unless the user explicitly asks to save/export/plot
46
+ - Do not embed realistic credentials or API keys in examples
47
+ - Do not break relative links between SKILL.md and `references/`