@delta-agentcloud/cli 0.0.0-stage → 1.1.22

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 +498 -2
  2. package/checksums.txt +5 -0
  3. package/package.json +47 -4
  4. package/scripts/install-wizard.js +683 -0
  5. package/scripts/install.js +435 -0
  6. package/scripts/run.js +65 -0
  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 -0
  52. package/skills/delta-sandbox/agents/openai.yaml +4 -0
  53. package/skills/delta-sandbox/references/commands.md +58 -0
  54. package/skills/delta-sandbox/references/lifecycle.md +100 -0
  55. package/skills/delta-sandbox/references/recipes.md +138 -0
  56. package/skills/delta-science/AGENTS.md +47 -0
  57. package/skills/delta-science/SKILL.md +227 -0
  58. package/skills/delta-science/agents/openai.yaml +4 -0
  59. package/skills/delta-science/references/antbo.md +105 -0
  60. package/skills/delta-science/references/delta-bo.md +92 -0
  61. package/skills/delta-science/references/gsasii.md +118 -0
  62. package/skills/delta-science/references/lammps.md +68 -0
  63. package/skills/delta-science/references/ldm-bo.md +132 -0
  64. package/skills/delta-science/references/materials-design.md +130 -0
  65. package/skills/delta-science/references/pubchem.md +128 -0
  66. package/skills/delta-science/references/pymatgen.md +69 -0
  67. package/skills/delta-science/references/qe.md +134 -0
  68. package/skills/delta-science/references/rdkit.md +141 -0
  69. package/skills/delta-science/references/strbo.md +95 -0
  70. package/skills/delta-science/references/synbo.md +201 -0
  71. package/skills/delta-science/references/xrd.md +688 -0
  72. package/skills/delta-science/scripts/catalog.py +92 -0
  73. package/skills/delta-science/scripts/generated_catalog.py +69 -0
  74. package/skills/delta-science/scripts/invoke.py +346 -0
  75. package/skills/delta-shared/SKILL.md +113 -0
  76. package/skills/delta-shared/agents/openai.yaml +4 -0
  77. package/skills/manifest.json +20 -0
@@ -0,0 +1,69 @@
1
+ # pymatgen reference
2
+
3
+ Make all calls with `delta-cli science invoke`. Prefer pymatgen for inorganic formulae,
4
+ composition and formula weight; do not use PubChem or a local element table as a substitute.
5
+ Structure operations require the complete structure text, not a local file path. Supported formats
6
+ are `cif`, `poscar`, `json`, `cssr` and `xsf`; LAMMPS data and dump files are not accepted.
7
+
8
+ ## Health
9
+
10
+ Operation: `health`; no request body.
11
+
12
+ ## Composition Parse
13
+
14
+ Operation: `composition-parse`.
15
+
16
+ ```json
17
+ {"formula": "LiFePO4", "format": "formula"}
18
+ ```
19
+
20
+ Key response fields in `data`: `valid`, `formula`, `reduced_formula`,
21
+ `alphabetic_formula`, `anonymous_formula`, `chemical_system`,
22
+ `number_of_atoms`, `weight`, `element_amounts`, `atomic_fractions`,
23
+ `weight_fractions`, `error`.
24
+
25
+ ## Structure Parse / Summary
26
+
27
+ Operation: `structure-parse` or `structure-summary`.
28
+
29
+ ```json
30
+ {"input": "<CIF text>", "format": "cif", "primitive": false}
31
+ ```
32
+
33
+ Input formats: `cif`, `poscar`, `json`, `cssr`, `xsf`.
34
+
35
+ Summary fields include `formula`, `reduced_formula`, `chemical_system`,
36
+ `nsites`, `nelements`, `density`, `volume`, `lattice`, `element_amounts`, and
37
+ `species`.
38
+
39
+ ## Structure Convert
40
+
41
+ Operation: `structure-convert`.
42
+
43
+ ```json
44
+ {
45
+ "input": "<CIF text>",
46
+ "input_format": "cif",
47
+ "output_format": "poscar",
48
+ "primitive": false
49
+ }
50
+ ```
51
+
52
+ Output formats: `cif`, `poscar`, `json`, `cssr`, `xsf`.
53
+
54
+ ## Symmetry
55
+
56
+ Operation: `structure-symmetry`.
57
+
58
+ ```json
59
+ {
60
+ "input": "<CIF text>",
61
+ "format": "cif",
62
+ "primitive": false,
63
+ "symprec": 0.01,
64
+ "angle_tolerance": 5.0
65
+ }
66
+ ```
67
+
68
+ Returns `space_group_symbol`, `space_group_number`, `crystal_system`,
69
+ `point_group_symbol`, `hall`, and `nsites`.
@@ -0,0 +1,134 @@
1
+ # Quantum ESPRESSO DFT reference
2
+
3
+ Use QE to run traceable, asynchronous Quantum ESPRESSO workflows through Chemistry Gateway.
4
+ The agent interacts only with the Gateway/Science Server contract: it does not run local `pw.x`,
5
+ call internal QE containers, or submit shell commands, scheduler scripts, `pseudo_dir`, `outdir`
6
+ or host paths.
7
+
8
+ The actual CLI tool for this reference is `qe`. Copy `tools.name` and `tool_endpoints.name`
9
+ exactly from the current CLI catalogue. The paths below describe the QE service contract; they
10
+ are not URLs to access directly or endpoint aliases that may be rewritten automatically.
11
+
12
+ ## Capability groups
13
+
14
+ | Service path | Purpose | Type |
15
+ | --- | --- | --- |
16
+ | `/chem/qe/health`, `/healthz`, `/readyz` | Runtime, scheduler, storage and PP readiness | Read-only |
17
+ | `/chem/qe/v1/qe/workflow-types` | Workflow catalogue and support status | Read-only |
18
+ | `/chem/qe/v1/pp-sets`, `/pp-locks/{digest}` | Published PP profiles/locks | Read-only |
19
+ | `/chem/qe/v1/pp-sets:resolve` | Resolve PP candidates for the complete set of campaign elements | Read-only/validation |
20
+ | `/chem/qe/v1/artifacts` | Upload, query and download structure/fixed-coordinate artifacts | File/binary |
21
+ | `/chem/qe/v1/qe/jobs` | Submit asynchronous calculations and query jobs | Remote mutation |
22
+ | `/chem/qe/v1/qe/jobs/{job_id}/events`, `steps`, `logs`, `artifacts` | Read job progress and results | Read-only |
23
+ | `/chem/qe/v1/qe/jobs/{job_id}:cancel`, `:retry`, `:review` | Cancel, retry and scientifically review a job | Remote mutation |
24
+
25
+ When selecting a new operation, first run:
26
+
27
+ ```text
28
+ delta-cli science list
29
+ delta-cli science endpoints list <exact tool name>
30
+ ```
31
+
32
+ Then call it using the exact names returned by the catalogue. If the catalogue has no schema, do
33
+ not guess the operation, path parameters, headers or body.
34
+
35
+ ## CLI file and idempotency boundaries
36
+
37
+ Structure artifact uploads require `application/octet-stream` and query metadata; QE job
38
+ submission requires a stable `Idempotency-Key`. `science invoke` remains for JSON/query only;
39
+ send files through `science file` and persistent jobs through `science task`:
40
+
41
+ - `delta-cli science file invoke --tool qe --endpoint artifact-upload --file <path>` uploads
42
+ a structure artifact; for `custom-pp-upload`, also provide `custom_pp_id` in `--data`;
43
+ - `delta-cli science task submit --tool qe --operation job-submit --input JSON
44
+ --idempotency-key KEY` submits a durable QE job; the worker passes the idempotency key to Gateway;
45
+ - `delta-cli science file download --tool qe --endpoint artifact-content --params JSON
46
+ --output <path>` downloads a raw artifact;
47
+ - Do not send structure text, file paths, base64, `Idempotency-Key` or QE service credentials as
48
+ ordinary business fields, and do not call public or private Gateway URLs or `qe-cloud-compute:18020`.
49
+
50
+ ## Correct sequence for a new job
51
+
52
+ 1. Read health. Read readiness only when diagnosing the deployment, and choose a currently
53
+ `supported` task from the workflow catalogue.
54
+ 2. Determine the complete `campaign_elements` set and use `pp-sets:resolve` to obtain a profile.
55
+ Production jobs must use the returned `pp_set_id` and immutable `lock_id`; do not infer the
56
+ lock from the profile name alone.
57
+ 3. Ask the service to validate the structure artifact. The job must reference only the returned
58
+ `sha256:<digest>` artifact ID.
59
+ 4. Submit to `qe/jobs` with stable idempotency semantics. A `202` response means accepted/queued,
60
+ not that QE has converged.
61
+ 5. Poll the job, events, steps, logs and artifacts; read the `execution`, `solver` and
62
+ `scientific` states independently.
63
+ 6. Verify each artifact's SHA-256 when downloading results. Report the selected backend, resource
64
+ telemetry, solver state, scientific review state and warnings separately.
65
+
66
+ The minimum business-data shape for PP resolution is shown below. Values must come from the
67
+ current service/catalogue; do not insert a fabricated production lock:
68
+
69
+ ```json
70
+ {
71
+ "campaign_id": "si-bulk-scf-v1",
72
+ "campaign_elements": ["Si", "O"],
73
+ "workflows": ["qe.pw.scf"],
74
+ "explicit_mode": null
75
+ }
76
+ ```
77
+
78
+ The core job structure is shown below. `workflow_inputs` must follow the current task schema:
79
+
80
+ ```json
81
+ {
82
+ "task": "qe.pw.scf",
83
+ "schema_version": "1.1",
84
+ "campaign_id": "si-bulk-scf-v1",
85
+ "campaign_elements": ["Si"],
86
+ "structure": {"format": "artifact", "artifact_id": "sha256:<64-hex>"},
87
+ "physics": {
88
+ "parameter_set": "<approved-parameter-set>",
89
+ "pp_policy": {
90
+ "mode": "sssp_single",
91
+ "pp_set_id": "<approved-pp-set>",
92
+ "lock_id": "sha256:<64-hex>"
93
+ },
94
+ "kpoints": [4, 4, 4]
95
+ },
96
+ "resources": {
97
+ "profile": "standard",
98
+ "nodes": 1,
99
+ "mpi_ranks_per_node": 1,
100
+ "omp_threads_per_rank": 1,
101
+ "walltime_seconds": 3600,
102
+ "gpu_policy": "cpu"
103
+ },
104
+ "client_request_id": "si-scf-v1",
105
+ "workflow_inputs": {}
106
+ }
107
+ ```
108
+
109
+ ## CPU/GPU and state interpretation
110
+
111
+ CPU is the default, particularly for small or medium interactive jobs, PP/structure/audit/archive
112
+ jobs, and cost-sensitive work. Use `gpu` only when the user explicitly requests it or the project
113
+ already has a GPU budget, and the live catalogue returns `gpu_support_status: "verified"`. Do not
114
+ silently fall back to CPU when GPU is required. Claim that GPU was used only when the result
115
+ explicitly returns `selected_backend: "gpu"`; `auto` does not prove GPU use.
116
+
117
+ Keep the three state channels separate:
118
+
119
+ - `execution`: prepared/submitted/queued/running/scheduler completion/cancelled/failed;
120
+ - `solver`: not started/running/converged/not converged/failed/unknown;
121
+ - `scientific`: unreviewed, scientifically accepted, accepted with limitations, needs
122
+ recalculation, not assessable, failed or archived.
123
+
124
+ scheduler completion does not mean solver convergence, and solver convergence does not mean
125
+ scientific acceptance. Branch on stable error codes rather than messages. Key codes include
126
+ `PP_SET_INCOMPLETE`, `PP_POLICY_INCOMPATIBLE`,
127
+ `PP_CAPABILITY_UNKNOWN`, `ARTIFACT_MISSING`, `SOLVER_NOT_CONVERGED`,
128
+ `SCIENTIFIC_GATE_FAILED`, `RESTART_INCOMPATIBLE`, `IDEMPOTENCY_CONFLICT`,
129
+ `EXECUTION_BACKEND_NOT_READY`, `GPU_UNSUPPORTED` and `GPU_UNAVAILABLE`.
130
+
131
+ Submission, cancellation, retry and review are remote mutations and require the user's explicit
132
+ authorisation. Do not retry when the outcome is unknown. Do not describe a GPU smoke test,
133
+ scheduler log or parseable QE output as a scientific conclusion or a customer-level performance
134
+ guarantee.
@@ -0,0 +1,141 @@
1
+ # RDKit reference
2
+
3
+ Call this tool only through `delta-cli science invoke`. Business responses are in the top-level
4
+ CLI `data`; read only the fields described here and do not search recursively. This document
5
+ records operation schemas and does not authorise direct HTTP access.
6
+
7
+ Make only the calls needed to meet the request. To validate, canonicalise and calculate basic
8
+ descriptors in one request, use `batch-parse-describe` with the `molecules:[{id,smiles}]` payload;
9
+ do not split it into parse and descriptors calls. For all-pairs similarity across multiple
10
+ molecules, use one `similarity-matrix` call. Its fixed ranking fields are `a`, `b` and
11
+ `similarity`, not `i`, `j` or `score`.
12
+
13
+ Report only descriptors actually present in the business response. When rendering a PNG, decode
14
+ only the field specified in the documentation and verify that the bytes begin with
15
+ `89 50 4e 47 0d 0a 1a 0a`; do not save a JSON envelope as an image.
16
+
17
+ ## Health
18
+
19
+ Operation: `health`; no request body.
20
+
21
+ ## Parse
22
+
23
+ Operation: `parse`.
24
+
25
+ ```json
26
+ {"input": "CCO", "format": "smiles", "sanitize": true}
27
+ ```
28
+
29
+ Formats: `smiles`, `inchi`, `molblock`.
30
+
31
+ Key response fields in `data`: `valid`, `canonical_smiles`, `formula`,
32
+ `molecular_weight`, `exact_molecular_weight`, `inchi_key`, `atom_count`,
33
+ `heavy_atom_count`, `bond_count`, `warnings`, `error`.
34
+
35
+ ## Descriptors
36
+
37
+ Operation: `descriptors`.
38
+
39
+ ```json
40
+ {"smiles": "CCO", "descriptor_set": "basic", "sanitize": true}
41
+ ```
42
+
43
+ `descriptor_set` currently supports `basic`. Descriptor keys include `Formula`,
44
+ `MolWt`, `ExactMolWt`, `HeavyAtomMolWt`, `TPSA`, `MolLogP`, `NumHDonors`,
45
+ `NumHAcceptors`, `NumRotatableBonds`, `RingCount`, `FractionCSP3`,
46
+ `HeavyAtomCount`, `AtomCount`, and `BondCount`.
47
+
48
+ ## Batch Descriptors
49
+
50
+ Operation: `batch-descriptors`.
51
+
52
+ ```json
53
+ {"smiles": ["CCO", "c1ccccc1"], "descriptor_set": "basic", "sanitize": true}
54
+ ```
55
+
56
+ Limits: 1-500 SMILES.
57
+
58
+ ## Batch Parse Describe
59
+
60
+ Operation: `batch-parse-describe`.
61
+
62
+ ```json
63
+ {
64
+ "molecules": [
65
+ {"id": "aspirin", "smiles": "CC(=O)Oc1ccccc1C(=O)O"},
66
+ {"id": "caffeine", "smiles": "Cn1cnc2c1c(=O)n(C)c(=O)n2C"}
67
+ ],
68
+ "descriptor_set": "basic",
69
+ "fingerprint": {"type": "morgan", "radius": 2, "n_bits": 2048},
70
+ "sanitize": true
71
+ }
72
+ ```
73
+
74
+ Limits: 1-500 molecules. Returns per-item `valid`, `canonical_smiles`, parse
75
+ fields, `descriptors`, optional `fingerprint_metadata`, `on_bits`, `bit_count`,
76
+ `warnings`, and `error`.
77
+
78
+ ## Render
79
+
80
+ Operation: `render`.
81
+
82
+ ```json
83
+ {"smiles": "CCO", "image_format": "svg", "width": 450, "height": 320}
84
+ ```
85
+
86
+ Image formats: `svg`, `png`. SVG returns text; PNG returns base64.
87
+ Width/height range: 150-2000.
88
+
89
+ ## Fingerprint
90
+
91
+ Operation: `fingerprint`.
92
+
93
+ ```json
94
+ {"smiles": "CCO", "radius": 2, "n_bits": 2048}
95
+ ```
96
+
97
+ Morgan fingerprint parameters: `radius` 1-6, `n_bits` 128-8192.
98
+
99
+ ## Similarity
100
+
101
+ Operation: `similarity`.
102
+
103
+ ```json
104
+ {"query_smiles": "CCO", "target_smiles": "CCCO", "radius": 2, "n_bits": 2048}
105
+ ```
106
+
107
+ Returns Tanimoto similarity.
108
+
109
+ ## Similarity Matrix
110
+
111
+ Operation: `similarity-matrix`.
112
+
113
+ ```json
114
+ {
115
+ "molecules": [
116
+ {"id": "aspirin", "smiles": "CC(=O)Oc1ccccc1C(=O)O"},
117
+ {"id": "ibuprofen", "smiles": "CC(C)Cc1ccc(cc1)[C@@H](C)C(=O)O"}
118
+ ],
119
+ "fingerprint": {"type": "morgan", "radius": 2, "n_bits": 2048},
120
+ "sanitize": true
121
+ }
122
+ ```
123
+
124
+ Returns `matrix` in input order and `ranked_pairs` sorted by descending
125
+ Tanimoto similarity. Each ranked record is named, not index-based:
126
+
127
+ ```json
128
+ {"a":"aspirin","b":"ibuprofen","similarity":0.195122}
129
+ ```
130
+
131
+ Do not expect `i`, `j`, or `score` fields.
132
+
133
+ ## Substructure
134
+
135
+ Operation: `substructure`.
136
+
137
+ ```json
138
+ {"query_smarts": "c1ccccc1", "target_smiles": ["c1ccccc1", "CCO"]}
139
+ ```
140
+
141
+ Limits: SMARTS max length 5000; target list size 1-500.
@@ -0,0 +1,95 @@
1
+ # STRBO reference
2
+
3
+ STRBO performs generative multi-objective optimisation for the server-fixed **KRAS G12D**
4
+ target. The objective order is fixed as `[vina, activity]`: lower Vina is better and higher
5
+ activity is better. `task` guides candidate generation but does not change the target; do not
6
+ claim that user-defined receptors are supported.
7
+
8
+ Use `tool="strbo"` for every call. Generation, suggestion, evaluation and job submission consume
9
+ remote resources, so call them only when the user actually asks for the relevant research task.
10
+ Do not retry if the outcome is unknown or the request times out.
11
+
12
+ ## Initialisation
13
+
14
+ - Synchronous operation: `molecules-init`
15
+ - Asynchronous operation: `molecules-init-job`
16
+ - Validation-only operation: `molecules-init-validate`
17
+
18
+ ```json
19
+ {
20
+ "task": "Generate candidate small molecules for KRAS G12D that balance binding and activity",
21
+ "num_initial": 3,
22
+ "seed": 42
23
+ }
24
+ ```
25
+
26
+ Use validate only when you need to check parameters. For a full run, do not validate before
27
+ submitting; that would make an unnecessary call. A successful result should contain the same
28
+ number of candidate SMILES as `num_initial`.
29
+
30
+ ## Suggest the next batch of candidates
31
+
32
+ - Synchronous operation: `molecules-suggest`
33
+ - Asynchronous operation: `molecules-suggest-job` (prefer it for heavy tasks)
34
+ - Validation-only operation: `molecules-suggest-validate`
35
+
36
+ ```json
37
+ {
38
+ "task": "Continue improving binding and activity for KRAS G12D",
39
+ "history_xs": ["CCO", "CCN", "CCC"],
40
+ "history_ys": [
41
+ [-6.8, 0.31],
42
+ [-7.1, 0.42],
43
+ [-6.5, 0.28]
44
+ ],
45
+ "num_suggestions": 2,
46
+ "seed": 42
47
+ }
48
+ ```
49
+
50
+ `history_xs` and `history_ys` must have the same length. Each `history_ys` item must contain two
51
+ finite numbers in the exact order `[vina, activity]`. Do not present predictions as wet-lab results.
52
+
53
+ ## Evaluate candidates
54
+
55
+ - Synchronous operation: `molecules-evaluate`
56
+ - Asynchronous operation: `molecules-evaluate-job`
57
+ - Validation-only operation: `molecules-evaluate-validate`
58
+
59
+ ```json
60
+ {
61
+ "designs": ["CCO", "CCN"]
62
+ }
63
+ ```
64
+
65
+ The number of scores in a successful result must match the number of designs, with exactly two
66
+ finite numbers per row. If any item explicitly fails, treat the entire run as failed; do not
67
+ report only the successful subset.
68
+
69
+ ## Asynchronous jobs
70
+
71
+ After submitting an asynchronous operation, read a non-empty `job_id` from the current business
72
+ response, then poll:
73
+
74
+ ```text
75
+ delta-cli science invoke --tool strbo --endpoint job-status --params JSON
76
+ ```
77
+
78
+ Read the result only once the status changes to `succeeded`:
79
+
80
+ ```text
81
+ delta-cli science invoke --tool strbo --endpoint job-result --params JSON
82
+ ```
83
+
84
+ `queued` and `running` do not mean the job is complete; stop immediately on `failed`. Status
85
+ queries may be repeated at intervals of about five seconds, but never repeat the submission
86
+ operation. The total wait for one user task is limited to 15 minutes. If that limit is reached,
87
+ report that the job is still incomplete and retain its `job_id`; do not claim it was cancelled
88
+ remotely.
89
+
90
+ ## Complete research workflow
91
+
92
+ When the user explicitly asks for a complete iteration, run `initialise → evaluate → suggest →
93
+ evaluate` sequentially. Use only verified business responses from the current calls as inputs to
94
+ the next step. If the user asks only for initial candidates or evaluation of supplied SMILES, do
95
+ not expand the task into a full loop.
@@ -0,0 +1,201 @@
1
+ # SynBO operation reference
2
+
3
+ Make all online calls with `delta-cli science invoke`; the service address comes from the CLI's
4
+ standard `base_url` configuration (`{base_url}/science_tool`). The paths here describe business
5
+ operations only and do not authorise direct HTTP access.
6
+
7
+ Use this section when the user asks to optimise reaction conditions, recommend the next batch of
8
+ experiments, continue a coupling reaction, or provides solvents, temperatures, catalysts, bases,
9
+ ligands and historical yields—even if they do not mention SynBO, BO, the CLI or field names. Make
10
+ at most one SynBO business call per user task. Stop immediately after success; for validation
11
+ errors, 502, 504, timeouts, disconnections or empty recommendations, do not change parameters or
12
+ models, or retry.
13
+
14
+ ## Health
15
+
16
+ Operation: `health`; no request body.
17
+
18
+ Reports SynBO import status, Torch/CUDA runtime availability, service limits,
19
+ default device and visible CUDA devices.
20
+
21
+ Important fields inside gateway `data`:
22
+
23
+ ```json
24
+ {
25
+ "status": "ok",
26
+ "synbo_available": true,
27
+ "metadata": {
28
+ "service": "synbo-service",
29
+ "engine": "synbo",
30
+ "version": "0.1.0",
31
+ "synbo_version": "0.1.0",
32
+ "default_device": "cpu",
33
+ "cuda_visible_devices": ""
34
+ },
35
+ "limits": {
36
+ "max_batch_size": 128,
37
+ "max_reaction_space_size": 200000,
38
+ "max_previous_rows": 10000
39
+ },
40
+ "runtime": {
41
+ "torch_available": true,
42
+ "cuda_available": false,
43
+ "cuda_device_count": 0,
44
+ "cuda_device_names": []
45
+ },
46
+ "warnings": []
47
+ }
48
+ ```
49
+
50
+ ## Initialize
51
+
52
+ Operation: `initialize`.
53
+
54
+ Use for initial condition sampling when no measured previous results exist.
55
+
56
+ Request body:
57
+
58
+ ```json
59
+ {
60
+ "condition_dict": {
61
+ "catalyst": ["Pd(OAc)2", "Pd(PPh3)4", "Pd2(dba)3"],
62
+ "solvent": ["THF", "Dioxane", "Toluene"],
63
+ "base": ["K2CO3", "NaOEt", "DBU"]
64
+ },
65
+ "opt_metrics": ["yield"],
66
+ "opt_metric_settings": [
67
+ {"opt_direct": "max", "opt_range": [0, 100], "metric_weight": 1.0}
68
+ ],
69
+ "batch_size": 3,
70
+ "sampling_method": "random",
71
+ "desc_normalize": "minmax",
72
+ "random_seed": 42
73
+ }
74
+ ```
75
+
76
+ Supported `sampling_method` values: `sobol`, `random`, `lhs`, `kmeans`.
77
+
78
+ ## Optimize
79
+
80
+ Operation: `optimize`.
81
+
82
+ Use after measured experiment rows are available. Each previous row must contain
83
+ all condition columns and all objective metric columns.
84
+
85
+ Request body:
86
+
87
+ ```json
88
+ {
89
+ "condition_dict": {
90
+ "catalyst": ["Pd(OAc)2", "Pd(PPh3)4", "Pd2(dba)3"],
91
+ "solvent": ["THF", "Dioxane", "Toluene"],
92
+ "base": ["K2CO3", "NaOEt", "DBU"]
93
+ },
94
+ "opt_metrics": ["yield"],
95
+ "previous_results": [
96
+ {"batch": 0, "catalyst": "Pd(OAc)2", "solvent": "THF", "base": "K2CO3", "yield": 42.0},
97
+ {"batch": 0, "catalyst": "Pd(PPh3)4", "solvent": "Dioxane", "base": "NaOEt", "yield": 55.0},
98
+ {"batch": 0, "catalyst": "Pd2(dba)3", "solvent": "Toluene", "base": "DBU", "yield": 63.0}
99
+ ],
100
+ "batch_size": 2,
101
+ "accuracy": "tiny",
102
+ "surrogate_model": "RF",
103
+ "acq_func": "UCB",
104
+ "device": "cpu",
105
+ "random_seed": 42
106
+ }
107
+ ```
108
+
109
+ ### Discretise numeric conditions first
110
+
111
+ SynBO's `condition_dict` accepts explicit lists only; it does not accept continuous range
112
+ objects. For a task with a temperature range of 40–100°C and catalyst loading of 0.5–2.0%, with
113
+ historical values at 60/70/80/90°C and 0.5/1.0/1.5/2.0%, use:
114
+
115
+ ```json
116
+ {
117
+ "condition_dict": {
118
+ "solvent": ["ethanol", "acetonitrile", "DMSO"],
119
+ "temperature_C": ["40", "60", "70", "80", "90", "100"],
120
+ "catalyst_loading_pct": ["0.5", "1.0", "1.5", "2.0"]
121
+ },
122
+ "opt_metrics": ["yield"],
123
+ "previous_results": [
124
+ {
125
+ "batch": 0,
126
+ "solvent": "ethanol",
127
+ "temperature_C": "60",
128
+ "catalyst_loading_pct": "1.0",
129
+ "yield": 55.0
130
+ }
131
+ ],
132
+ "batch_size": 3,
133
+ "accuracy": "tiny",
134
+ "surrogate_model": "RF",
135
+ "acq_func": "UCB",
136
+ "device": "cpu",
137
+ "random_seed": 42
138
+ }
139
+ ```
140
+
141
+ Constraints:
142
+
143
+ - Represent every condition value as a string and keep objective metrics numeric.
144
+ - Every condition value in each `previous_results` row must appear in the corresponding `condition_dict` list.
145
+ - The discretised grid for a continuous range must include the user's lower and upper bounds and all historical observations. State the actual grid in the final answer.
146
+ - Serialise condition values explicitly as strings, and ensure each historical row uses only values listed in `condition_dict`. For a small-data CPU configuration, pass `accuracy:"tiny"`, `surrogate_model:"RF"`, `acq_func:"UCB"` and `device:"cpu"` explicitly; do not assume the client supplies defaults.
147
+
148
+ Useful optional fields:
149
+
150
+ - `accuracy`: `tiny`, `low`, `medium`, `high`, or `ultra`.
151
+ - `acq_func`: `EHVI`, `UCB`, `ParEGO`, or `NEI`.
152
+ - `surrogate_model`: `GP`, `RF`, `BNN`, or `BayesianLinear`.
153
+ - `device`: `cpu`, `auto`, `cuda`, or `cuda:0`.
154
+ - `cuda_visible_devices`: request-level CUDA visibility hint. Use only when the
155
+ user explicitly asks for it and `/health` indicates a CUDA-capable runtime.
156
+ - `constraints`: map condition type to prohibited values.
157
+
158
+ ## Descriptors
159
+
160
+ If omitted, SynBO uses generated OneHot descriptors. To provide descriptors:
161
+
162
+ ```json
163
+ {
164
+ "descriptors": {
165
+ "solvent": [
166
+ {"name": "THF", "polarity": 0.207, "boiling_point_C": 66.0},
167
+ {"name": "Toluene", "polarity": 0.099, "boiling_point_C": 110.6}
168
+ ]
169
+ },
170
+ "descriptor_index_col": "name"
171
+ }
172
+ ```
173
+
174
+ `descriptors` must contain exactly the same keys as `condition_dict`. Descriptor
175
+ rows must include the configured index column and numeric descriptor columns.
176
+
177
+ ## Error Handling
178
+
179
+ Gateway errors have the standard envelope:
180
+
181
+ ```json
182
+ {
183
+ "code": 1,
184
+ "message": "SynBO service returned HTTP 400",
185
+ "data": {
186
+ "endpoint": "/synbo/optimize",
187
+ "synbo_response": {
188
+ "detail": "previous_results is missing metric columns: ['yield']"
189
+ }
190
+ }
191
+ }
192
+ ```
193
+
194
+ Common causes include an oversized condition space, duplicate condition values, historical
195
+ condition values absent from `condition_dict`, non-numeric descriptors, missing columns in
196
+ historical rows, non-numeric metrics, and a CUDA request when no GPU is available.
197
+
198
+ The server has a per-request timeout independent of the client. GP, EHVI, high accuracy or busy
199
+ shared resources may cause a timeout. Do not automatically change parameters and retry during an
200
+ ordinary user task. Report “no recommendations were produced”, preserve the error, and let the
201
+ user decide whether to start a separate, explicitly requested regression test.