@inflexa-ai/harness 0.1.1 → 0.2.0

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 (268) hide show
  1. package/dist/agents/conversation-agent.d.ts +12 -11
  2. package/dist/agents/conversation-agent.js +30 -33
  3. package/dist/agents/report-builder.js +2 -1
  4. package/dist/agents/sandbox/bulk-transcriptomics-agent.js +1 -1
  5. package/dist/agents/sandbox/cheminformatics-agent.js +1 -19
  6. package/dist/agents/sandbox/chromatin-agent.js +1 -10
  7. package/dist/agents/sandbox/dna-methylation-agent.js +1 -10
  8. package/dist/agents/sandbox/drug-repurposing-agent.js +4 -14
  9. package/dist/agents/sandbox/enrichment-agent.js +1 -10
  10. package/dist/agents/sandbox/ephemeral-executor.js +1 -10
  11. package/dist/agents/sandbox/genomic-variant-agent.js +1 -3
  12. package/dist/agents/sandbox/immune-profiling-agent.js +1 -13
  13. package/dist/agents/sandbox/metabolomics-agent.js +1 -1
  14. package/dist/agents/sandbox/microbiome-agent.js +1 -1
  15. package/dist/agents/sandbox/multi-omics-integration-agent.js +1 -12
  16. package/dist/agents/sandbox/multimodal-sc-agent.js +1 -1
  17. package/dist/agents/sandbox/network-agent.js +1 -10
  18. package/dist/agents/sandbox/pkpd-clinical-response-agent.js +2 -8
  19. package/dist/agents/sandbox/proteomics-agent.js +1 -1
  20. package/dist/agents/sandbox/scientific-executor.js +1 -10
  21. package/dist/agents/sandbox/shared.d.ts +17 -6
  22. package/dist/agents/sandbox/shared.js +49 -38
  23. package/dist/agents/sandbox/single-cell-agent.js +1 -1
  24. package/dist/agents/sandbox/spatial-omics-agent.js +1 -1
  25. package/dist/agents/sandbox/statistical-modeling-agent.js +1 -1
  26. package/dist/agents/sandbox/translational-safety-agent.js +3 -9
  27. package/dist/agents/sandbox/types.d.ts +1 -1
  28. package/dist/agents/system-prompt.d.ts +37 -11
  29. package/dist/agents/system-prompt.js +35 -12
  30. package/dist/app/data-profile-orientation.d.ts +34 -0
  31. package/dist/app/data-profile-orientation.js +117 -0
  32. package/dist/contracts/schemas/chat-parts.d.ts +9 -9
  33. package/dist/execution/artifact-metadata.js +2 -1
  34. package/dist/execution/ephemeral-runner.d.ts +13 -0
  35. package/dist/execution/ephemeral-runner.js +23 -1
  36. package/dist/execution/run-synthesis.js +20 -19
  37. package/dist/execution/step-summary.js +2 -1
  38. package/dist/index.d.ts +6 -2
  39. package/dist/index.js +19 -5
  40. package/dist/loop/__fixtures__/scripted-provider.d.ts +2 -2
  41. package/dist/loop/__fixtures__/scripted-provider.js +2 -1
  42. package/dist/loop/metrics.d.ts +33 -1
  43. package/dist/loop/metrics.js +56 -2
  44. package/dist/loop/run-agent.d.ts +13 -1
  45. package/dist/loop/run-agent.js +19 -4
  46. package/dist/memory/card-builders.d.ts +8 -1
  47. package/dist/memory/card-builders.js +20 -3
  48. package/dist/memory/reconstruct-cards.js +4 -3
  49. package/dist/memory/thread-history.d.ts +27 -2
  50. package/dist/memory/thread-history.js +45 -5
  51. package/dist/memory/working-memory.d.ts +93 -10
  52. package/dist/memory/working-memory.js +220 -84
  53. package/dist/prompts/SOUL.d.ts +22 -9
  54. package/dist/prompts/SOUL.js +56 -37
  55. package/dist/prompts/analogical-reasoner.d.ts +1 -1
  56. package/dist/prompts/analogical-reasoner.js +2 -2
  57. package/dist/prompts/briefing.d.ts +100 -0
  58. package/dist/prompts/briefing.js +166 -0
  59. package/dist/prompts/conversation.d.ts +1 -1
  60. package/dist/prompts/conversation.js +94 -440
  61. package/dist/prompts/literature-reviewer.d.ts +1 -1
  62. package/dist/prompts/literature-reviewer.js +10 -10
  63. package/dist/prompts/planner.js +28 -59
  64. package/dist/prompts/report-builder.d.ts +1 -1
  65. package/dist/prompts/report-builder.js +71 -24
  66. package/dist/prompts/sandbox/bulk-transcriptomics-agent.d.ts +1 -1
  67. package/dist/prompts/sandbox/bulk-transcriptomics-agent.js +2 -7
  68. package/dist/prompts/sandbox/cheminformatics-agent.d.ts +1 -1
  69. package/dist/prompts/sandbox/cheminformatics-agent.js +11 -15
  70. package/dist/prompts/sandbox/chromatin-agent.d.ts +1 -1
  71. package/dist/prompts/sandbox/chromatin-agent.js +3 -7
  72. package/dist/prompts/sandbox/data-profiler.d.ts +1 -1
  73. package/dist/prompts/sandbox/data-profiler.js +13 -8
  74. package/dist/prompts/sandbox/dna-methylation-agent.d.ts +1 -1
  75. package/dist/prompts/sandbox/dna-methylation-agent.js +2 -7
  76. package/dist/prompts/sandbox/drug-repurposing-agent.d.ts +1 -1
  77. package/dist/prompts/sandbox/drug-repurposing-agent.js +15 -16
  78. package/dist/prompts/sandbox/enrichment-agent.d.ts +1 -1
  79. package/dist/prompts/sandbox/enrichment-agent.js +2 -9
  80. package/dist/prompts/sandbox/genomic-variant-agent.d.ts +1 -1
  81. package/dist/prompts/sandbox/genomic-variant-agent.js +2 -6
  82. package/dist/prompts/sandbox/immune-profiling-agent.d.ts +1 -1
  83. package/dist/prompts/sandbox/immune-profiling-agent.js +3 -8
  84. package/dist/prompts/sandbox/metabolomics-agent.d.ts +1 -1
  85. package/dist/prompts/sandbox/metabolomics-agent.js +1 -7
  86. package/dist/prompts/sandbox/microbiome-agent.d.ts +1 -1
  87. package/dist/prompts/sandbox/microbiome-agent.js +2 -7
  88. package/dist/prompts/sandbox/multi-omics-integration-agent.d.ts +1 -1
  89. package/dist/prompts/sandbox/multi-omics-integration-agent.js +2 -8
  90. package/dist/prompts/sandbox/multimodal-sc-agent.d.ts +1 -1
  91. package/dist/prompts/sandbox/multimodal-sc-agent.js +2 -7
  92. package/dist/prompts/sandbox/network-agent.d.ts +1 -1
  93. package/dist/prompts/sandbox/network-agent.js +2 -7
  94. package/dist/prompts/sandbox/proteomics-agent.d.ts +1 -1
  95. package/dist/prompts/sandbox/proteomics-agent.js +2 -9
  96. package/dist/prompts/sandbox/single-cell-agent.d.ts +1 -1
  97. package/dist/prompts/sandbox/single-cell-agent.js +2 -9
  98. package/dist/prompts/sandbox/spatial-omics-agent.d.ts +1 -1
  99. package/dist/prompts/sandbox/spatial-omics-agent.js +3 -6
  100. package/dist/prompts/sandbox/statistical-modeling-agent.d.ts +1 -1
  101. package/dist/prompts/sandbox/statistical-modeling-agent.js +2 -7
  102. package/dist/prompts/sandbox/translational-safety-agent.d.ts +1 -1
  103. package/dist/prompts/sandbox/translational-safety-agent.js +13 -14
  104. package/dist/prompts/sandbox-standards.d.ts +22 -14
  105. package/dist/prompts/sandbox-standards.js +91 -71
  106. package/dist/prompts/synthesis-agent.d.ts +1 -1
  107. package/dist/prompts/synthesis-agent.js +33 -131
  108. package/dist/provenance/collector.js +1 -1
  109. package/dist/providers/ai-sdk.js +31 -4
  110. package/dist/providers/prompt-cache.d.ts +74 -0
  111. package/dist/providers/prompt-cache.js +77 -0
  112. package/dist/providers/types.d.ts +33 -0
  113. package/dist/reference-data/catalog.d.ts +131 -0
  114. package/dist/reference-data/catalog.js +348 -0
  115. package/dist/reference-data/receipt.d.ts +41 -0
  116. package/dist/reference-data/receipt.js +40 -0
  117. package/dist/schemas/data-profile-schemas.js +5 -3
  118. package/dist/schemas/plan-schemas.d.ts +21 -21
  119. package/dist/schemas/plan-schemas.js +9 -3
  120. package/dist/schemas/run-synthesis.d.ts +8 -4
  121. package/dist/schemas/run-synthesis.js +92 -56
  122. package/dist/schemas/validate-plan.js +1 -1
  123. package/dist/schemas/workflow-state.d.ts +7 -1
  124. package/dist/schemas/workflow-state.js +33 -19
  125. package/dist/state/artifacts.d.ts +13 -0
  126. package/dist/state/artifacts.js +27 -0
  127. package/dist/state/data-profile.d.ts +64 -5
  128. package/dist/state/index.d.ts +3 -3
  129. package/dist/state/index.js +1 -1
  130. package/dist/tasks/data-profile.d.ts +20 -2
  131. package/dist/tasks/data-profile.js +71 -22
  132. package/dist/tools/bio/chembl.d.ts +38 -0
  133. package/dist/tools/bio/chembl.js +138 -0
  134. package/dist/tools/bio/comptox.d.ts +50 -0
  135. package/dist/tools/bio/comptox.js +149 -0
  136. package/dist/tools/bio/get-impc-ko-profile.js +9 -6
  137. package/dist/tools/bio/index.d.ts +5 -17
  138. package/dist/tools/bio/index.js +5 -17
  139. package/dist/tools/bio/keys.d.ts +14 -9
  140. package/dist/tools/bio/keys.js +16 -16
  141. package/dist/tools/bio/opentargets.d.ts +38 -0
  142. package/dist/tools/bio/opentargets.js +89 -0
  143. package/dist/tools/bio/pubchem.d.ts +29 -0
  144. package/dist/tools/bio/pubchem.js +92 -0
  145. package/dist/tools/bio/pubmed.d.ts +51 -0
  146. package/dist/tools/bio/pubmed.js +100 -0
  147. package/dist/tools/bio/search-bgee-expression.js +12 -6
  148. package/dist/tools/bio/search-clinical-trials.js +16 -5
  149. package/dist/tools/bio/search-faers.js +8 -4
  150. package/dist/tools/bio/search-geo-datasets.js +20 -6
  151. package/dist/tools/bio/search-gwas-catalog.d.ts +1 -1
  152. package/dist/tools/bio/search-pharmgkb.js +10 -4
  153. package/dist/tools/display/index.d.ts +1 -0
  154. package/dist/tools/display/index.js +1 -0
  155. package/dist/tools/display/normalize-echart-spec.d.ts +61 -0
  156. package/dist/tools/display/normalize-echart-spec.js +211 -0
  157. package/dist/tools/display/show-user.d.ts +6 -1
  158. package/dist/tools/display/show-user.js +25 -12
  159. package/dist/tools/execute-plan.js +5 -2
  160. package/dist/tools/iterate-report.d.ts +168 -118
  161. package/dist/tools/iterate-report.js +334 -96
  162. package/dist/tools/lib/chembl-client.d.ts +12 -0
  163. package/dist/tools/lib/chembl-client.js +127 -0
  164. package/dist/tools/lib/ctx-ops.d.ts +224 -0
  165. package/dist/tools/lib/ctx-ops.js +450 -0
  166. package/dist/tools/lib/iuphar-client.js +10 -1
  167. package/dist/tools/lib/openfda-client.js +11 -3
  168. package/dist/tools/lib/pathway-client.js +10 -4
  169. package/dist/tools/lib/pubchem-ops.d.ts +74 -0
  170. package/dist/tools/lib/pubchem-ops.js +224 -0
  171. package/dist/tools/memory/update-working-memory.d.ts +45 -7
  172. package/dist/tools/memory/update-working-memory.js +111 -41
  173. package/dist/tools/report/index.d.ts +3 -2
  174. package/dist/tools/report/index.js +3 -2
  175. package/dist/tools/research/generate-analogy-report.js +25 -12
  176. package/dist/tools/research/generate-plan.d.ts +12 -5
  177. package/dist/tools/research/generate-plan.js +168 -37
  178. package/dist/tools/research/index.d.ts +1 -0
  179. package/dist/tools/research/index.js +1 -0
  180. package/dist/tools/research/inspect-data-profile.d.ts +85 -0
  181. package/dist/tools/research/inspect-data-profile.js +161 -0
  182. package/dist/tools/research/literature-reviewer.js +3 -4
  183. package/dist/tools/sandbox/list-available-packages.d.ts +79 -5
  184. package/dist/tools/sandbox/list-available-packages.js +152 -10
  185. package/dist/tools/sandbox/list-available-refs.d.ts +141 -5
  186. package/dist/tools/sandbox/list-available-refs.js +647 -134
  187. package/dist/tools/sandbox/report-blocker.d.ts +39 -9
  188. package/dist/tools/sandbox/report-blocker.js +43 -20
  189. package/dist/tools/workspace/read-file.js +4 -5
  190. package/dist/tools/workspace/run-exec.d.ts +4 -4
  191. package/dist/tools/workspace/run-exec.js +4 -4
  192. package/dist/tools/workspace/show-file.js +10 -6
  193. package/dist/tools/workspace/show-plan.js +12 -6
  194. package/dist/tools/workspace/workspace-search.d.ts +1 -1
  195. package/dist/tools/workspace/workspace-search.js +11 -5
  196. package/dist/workflows/execute-analysis.d.ts +43 -4
  197. package/dist/workflows/execute-analysis.js +107 -6
  198. package/dist/workflows/target-assessment/lib/citation-validator.js +2 -2
  199. package/dist/workflows/target-assessment/lib/clinical-consequence-annotator.js +2 -1
  200. package/dist/workspace/paths.d.ts +2 -2
  201. package/dist/workspace/paths.js +2 -2
  202. package/package.json +33 -33
  203. package/dist/execution/filesystem-artifact-registry.d.ts +0 -57
  204. package/dist/execution/filesystem-artifact-registry.js +0 -92
  205. package/dist/lib/identifiers.d.ts +0 -8
  206. package/dist/lib/identifiers.js +0 -10
  207. package/dist/lib/mime-detect.d.ts +0 -17
  208. package/dist/lib/mime-detect.js +0 -29
  209. package/dist/lib/streamed-download.d.ts +0 -28
  210. package/dist/lib/streamed-download.js +0 -111
  211. package/dist/lib/trace-context.d.ts +0 -11
  212. package/dist/lib/trace-context.js +0 -49
  213. package/dist/providers/llm-capabilities.d.ts +0 -33
  214. package/dist/providers/llm-capabilities.js +0 -58
  215. package/dist/schemas/render-step-prompt.d.ts +0 -32
  216. package/dist/schemas/render-step-prompt.js +0 -76
  217. package/dist/tools/bio/find-approval-precedent.d.ts +0 -32
  218. package/dist/tools/bio/find-approval-precedent.js +0 -72
  219. package/dist/tools/bio/get-article-details.d.ts +0 -11
  220. package/dist/tools/bio/get-article-details.js +0 -20
  221. package/dist/tools/bio/get-article-full-text.d.ts +0 -19
  222. package/dist/tools/bio/get-article-full-text.js +0 -32
  223. package/dist/tools/bio/get-bioactivity.d.ts +0 -11
  224. package/dist/tools/bio/get-bioactivity.js +0 -23
  225. package/dist/tools/bio/get-drug-info.d.ts +0 -9
  226. package/dist/tools/bio/get-drug-info.js +0 -22
  227. package/dist/tools/bio/get-mechanism.d.ts +0 -8
  228. package/dist/tools/bio/get-mechanism.js +0 -18
  229. package/dist/tools/bio/get-pubchem-assays.d.ts +0 -22
  230. package/dist/tools/bio/get-pubchem-assays.js +0 -107
  231. package/dist/tools/bio/get-pubchem-cross-refs.d.ts +0 -15
  232. package/dist/tools/bio/get-pubchem-cross-refs.js +0 -68
  233. package/dist/tools/bio/get-target-safety.d.ts +0 -18
  234. package/dist/tools/bio/get-target-safety.js +0 -26
  235. package/dist/tools/bio/search-compounds.d.ts +0 -22
  236. package/dist/tools/bio/search-compounds.js +0 -160
  237. package/dist/tools/bio/search-ctx-chemical.d.ts +0 -50
  238. package/dist/tools/bio/search-ctx-chemical.js +0 -130
  239. package/dist/tools/bio/search-ctx-exposure.d.ts +0 -55
  240. package/dist/tools/bio/search-ctx-exposure.js +0 -176
  241. package/dist/tools/bio/search-ctx-hazard.d.ts +0 -111
  242. package/dist/tools/bio/search-ctx-hazard.js +0 -178
  243. package/dist/tools/bio/search-opentargets.d.ts +0 -11
  244. package/dist/tools/bio/search-opentargets.js +0 -25
  245. package/dist/tools/bio/search-pubchem-compound.d.ts +0 -26
  246. package/dist/tools/bio/search-pubchem-compound.js +0 -110
  247. package/dist/tools/bio/search-pubmed.d.ts +0 -17
  248. package/dist/tools/bio/search-pubmed.js +0 -31
  249. package/dist/tools/bio/search-targets.d.ts +0 -9
  250. package/dist/tools/bio/search-targets.js +0 -20
  251. package/dist/tools/bio/search-toxcast.d.ts +0 -36
  252. package/dist/tools/bio/search-toxcast.js +0 -141
  253. package/dist/workflows/register-workflows.d.ts +0 -51
  254. package/dist/workflows/register-workflows.js +0 -48
  255. package/dist/workflows/resume-execute-analysis.d.ts +0 -70
  256. package/dist/workflows/resume-execute-analysis.js +0 -80
  257. package/dist/workflows/target-assessment/correction-loop.d.ts +0 -45
  258. package/dist/workflows/target-assessment/correction-loop.js +0 -62
  259. package/dist/workflows/target-assessment/steps/phase0-resolve.d.ts +0 -71
  260. package/dist/workflows/target-assessment/steps/phase0-resolve.js +0 -21
  261. package/dist/workflows/target-assessment/steps/phase1-aggregate.d.ts +0 -1018
  262. package/dist/workflows/target-assessment/steps/phase1-aggregate.js +0 -25
  263. package/dist/workspace/mount-strategy.d.ts +0 -50
  264. package/dist/workspace/mount-strategy.js +0 -67
  265. package/dist/workspace/provenance-collector.d.ts +0 -34
  266. package/dist/workspace/provenance-collector.js +0 -16
  267. package/dist/workspace/workspace-paths.d.ts +0 -26
  268. package/dist/workspace/workspace-paths.js +0 -31
@@ -1,160 +0,0 @@
1
- /**
2
- * searchCompounds tool — search ChEMBL for compounds by target, name, or SMILES.
3
- *
4
- * Supports three search modes:
5
- * - "target": resolves target ChEMBL ID, fetches activities, extracts unique molecules
6
- * - "compound": free-text search on molecule names
7
- * - "smiles": flexmatch on canonical SMILES
8
- */
9
- import { ok } from "neverthrow";
10
- import { z } from "zod";
11
- import { defineTool } from "../define-tool.js";
12
- import { apiFetchValidated, describeApiError } from "../lib/api-utils.js";
13
- import { CHEMBL_BASE, CHEMBL_HEADERS as HEADERS } from "../lib/chembl-config.js";
14
- // A single schema that both validates and normalizes one ChEMBL molecule
15
- // record: the `.object(...)` half is the snake_case wire shape (every field
16
- // optional — ChEMBL omits absent values), the `.transform(...)` half maps it to
17
- // the camelCase `Compound` we return. Parsing IS the validation, and because
18
- // the transform rides on the schema, `z.infer` below is the OUTPUT type — no
19
- // separate raw interface or mapper.
20
- const MoleculeSchema = z
21
- .object({
22
- molecule_chembl_id: z.string().optional(),
23
- // ChEMBL sends explicit `null` (not omission) for an unnamed compound, and
24
- // `null` for the whole structures/properties blocks on biologics/antibodies
25
- // — `.nullable()` so those rows parse instead of failing the `molecules` array.
26
- pref_name: z.string().nullable().optional(),
27
- molecule_structures: z
28
- .object({
29
- canonical_smiles: z.string().nullable().optional(),
30
- })
31
- .nullable()
32
- .optional(),
33
- molecule_properties: z
34
- .object({
35
- full_mwt: z.string().nullable().optional(),
36
- alogp: z.string().nullable().optional(),
37
- molecular_formula: z.string().nullable().optional(),
38
- })
39
- .nullable()
40
- .optional(),
41
- })
42
- .transform((raw) => ({
43
- chemblId: raw.molecule_chembl_id ?? "",
44
- preferredCompoundName: raw.pref_name ?? null,
45
- canonicalSmiles: raw.molecule_structures?.canonical_smiles ?? null,
46
- molecularWeight: raw.molecule_properties?.full_mwt ? parseFloat(raw.molecule_properties.full_mwt) : null,
47
- alogp: raw.molecule_properties?.alogp ? parseFloat(raw.molecule_properties.alogp) : null,
48
- molecularFormula: raw.molecule_properties?.molecular_formula ?? null,
49
- }));
50
- const TargetSearchResponseSchema = z.object({
51
- targets: z.array(z.object({ target_chembl_id: z.string().optional() })).optional(),
52
- });
53
- const ActivityResponseSchema = z.object({
54
- activities: z.array(z.object({ molecule_chembl_id: z.string().optional() })).optional(),
55
- });
56
- const MoleculeResponseSchema = z.object({
57
- molecules: z.array(MoleculeSchema).optional(),
58
- });
59
- async function searchByTarget(query, limit) {
60
- // Step 1: Search targets to resolve ChEMBL ID
61
- const targetRes = await apiFetchValidated(`${CHEMBL_BASE}/target/search.json?q=${encodeURIComponent(query)}&limit=1`, TargetSearchResponseSchema, {
62
- headers: HEADERS,
63
- });
64
- if (targetRes.isErr()) {
65
- if (targetRes.error.type === "http_status" && targetRes.error.status === 404)
66
- return [];
67
- throw new Error(describeApiError(targetRes.error));
68
- }
69
- if (!targetRes.value.targets?.length)
70
- return [];
71
- const targetChemblId = targetRes.value.targets[0].target_chembl_id;
72
- if (!targetChemblId)
73
- return [];
74
- // Step 2: Fetch activities for that target
75
- const activityRes = await apiFetchValidated(`${CHEMBL_BASE}/activity.json?target_chembl_id=${targetChemblId}&limit=${limit}`, ActivityResponseSchema, {
76
- headers: HEADERS,
77
- });
78
- if (activityRes.isErr()) {
79
- if (activityRes.error.type === "http_status" && activityRes.error.status === 404)
80
- return [];
81
- throw new Error(describeApiError(activityRes.error));
82
- }
83
- if (!activityRes.value.activities?.length)
84
- return [];
85
- // Step 3: Extract unique molecule IDs
86
- const uniqueIds = new Set();
87
- for (const act of activityRes.value.activities) {
88
- if (act.molecule_chembl_id)
89
- uniqueIds.add(act.molecule_chembl_id);
90
- }
91
- // Step 4: Fetch molecule details for unique compounds
92
- const compounds = [];
93
- const idArray = [...uniqueIds];
94
- // Fetch in batches of 50 to avoid overly long URLs
95
- const batchSize = 50;
96
- for (let i = 0; i < idArray.length; i += batchSize) {
97
- const batch = idArray.slice(i, i + batchSize);
98
- const idsParam = batch.join(";");
99
- const molRes = await apiFetchValidated(`${CHEMBL_BASE}/molecule/set/${idsParam}.json`, MoleculeResponseSchema, { headers: HEADERS });
100
- if (molRes.isErr()) {
101
- if (!(molRes.error.type === "http_status" && molRes.error.status === 404)) {
102
- throw new Error(describeApiError(molRes.error));
103
- }
104
- continue;
105
- }
106
- if (molRes.value.molecules) {
107
- for (const mol of molRes.value.molecules) {
108
- compounds.push(mol);
109
- }
110
- }
111
- }
112
- return compounds;
113
- }
114
- async function searchByCompound(query, limit) {
115
- const res = await apiFetchValidated(`${CHEMBL_BASE}/molecule/search.json?q=${encodeURIComponent(query)}&limit=${limit}`, MoleculeResponseSchema, {
116
- headers: HEADERS,
117
- });
118
- if (res.isErr()) {
119
- if (res.error.type === "http_status" && res.error.status === 404)
120
- return [];
121
- throw new Error(describeApiError(res.error));
122
- }
123
- return res.value.molecules ?? [];
124
- }
125
- async function searchBySmiles(smiles, limit) {
126
- const res = await apiFetchValidated(`${CHEMBL_BASE}/molecule.json?molecule_structures__canonical_smiles__flexmatch=${encodeURIComponent(smiles)}&limit=${limit}`, MoleculeResponseSchema, { headers: HEADERS });
127
- if (res.isErr()) {
128
- if (res.error.type === "http_status" && res.error.status === 404)
129
- return [];
130
- throw new Error(describeApiError(res.error));
131
- }
132
- return res.value.molecules ?? [];
133
- }
134
- export const searchCompoundsTool = defineTool({
135
- id: "search_compounds",
136
- description: "Search ChEMBL for compounds by target name/ChEMBL ID, compound name, or SMILES. " +
137
- "Returns compound metadata including ChEMBL IDs, SMILES, molecular weight, and LogP. " +
138
- "Use searchType='target' to find compounds active against a target, " +
139
- "'compound' for name search, 'smiles' for structure matching.",
140
- inputSchema: z.object({
141
- query: z.string().min(1).describe("Search term: target name/ID, compound name, or SMILES string"),
142
- searchType: z
143
- .enum(["target", "compound", "smiles"])
144
- .describe("What to search by: 'target' (find active compounds), 'compound' (name search), 'smiles' (structure match)"),
145
- limit: z.number().int().min(1).max(500).default(500).describe("Maximum number of results to return"),
146
- }),
147
- execute: async ({ query, searchType, limit = 500 }) => {
148
- let compounds;
149
- if (searchType === "target") {
150
- compounds = await searchByTarget(query, limit);
151
- }
152
- else if (searchType === "smiles") {
153
- compounds = await searchBySmiles(query, limit);
154
- }
155
- else {
156
- compounds = await searchByCompound(query, limit);
157
- }
158
- return ok({ compounds });
159
- },
160
- });
@@ -1,50 +0,0 @@
1
- /**
2
- * searchCtxChemical — look up chemical details and physicochemical
3
- * properties from EPA's CompTox Chemicals Dashboard (CTX API).
4
- */
5
- interface ChemicalDetail {
6
- dtxsid: string;
7
- dtxcid: string;
8
- casrn: string | null;
9
- preferredName: string;
10
- iupacName: string;
11
- molFormula: string;
12
- smiles: string;
13
- inchikey: string;
14
- monoisotopicMass: number | null;
15
- averageMass: number | null;
16
- qcLevel: number | null;
17
- totalAssays: number | null;
18
- activeAssays: number | null;
19
- percentAssays: number | null;
20
- pubchemCid: number | null;
21
- pubmedCount: number | null;
22
- sourcesCount: number | null;
23
- }
24
- interface PropertySummary {
25
- propName: string;
26
- unit: string;
27
- experimentalCount: number | null;
28
- experimentalMedian: number | null;
29
- experimentalMin: number | null;
30
- experimentalMax: number | null;
31
- predictedCount: number | null;
32
- predictedMedian: number | null;
33
- predictedMin: number | null;
34
- predictedMax: number | null;
35
- }
36
- type CtxChemicalOutput = {
37
- found: false;
38
- query: string;
39
- } | {
40
- found: true;
41
- detail: ChemicalDetail;
42
- properties?: PropertySummary[];
43
- };
44
- export declare function createSearchCtxChemicalTool(deps: {
45
- apiKey: string;
46
- }): import("../define-tool.js").Tool<{
47
- query: string;
48
- includeProperties: boolean;
49
- }, CtxChemicalOutput>;
50
- export {};
@@ -1,130 +0,0 @@
1
- /**
2
- * searchCtxChemical — look up chemical details and physicochemical
3
- * properties from EPA's CompTox Chemicals Dashboard (CTX API).
4
- */
5
- import { ok } from "neverthrow";
6
- import { z } from "zod";
7
- import { defineTool } from "../define-tool.js";
8
- import { apiFetchValidated, describeApiError } from "../lib/api-utils.js";
9
- import { EPA_CCTE_BASE, getEpaCcteHeaders } from "../lib/toxcast-config.js";
10
- // The chemical-search endpoint returns rows the code reads `[0].dtxsid` from
11
- // after a length guard, so `dtxsid` stays required — a row missing it is a
12
- // contract break surfaced as `invalid_response`, not a silent `undefined`.
13
- const CtxChemicalSearchRowSchema = z.object({
14
- dtxsid: z.string(),
15
- });
16
- // Raw CTX chemical-detail wire shape, validated at the fetch boundary. Every
17
- // field is optional (the API omits absent values); the mapper below normalizes
18
- // it into `ChemicalDetail`, folding in the resolved `dtxsid` fallback.
19
- const RawChemicalDetailSchema = z.object({
20
- dtxsid: z.string().optional(),
21
- dtxcid: z.string().nullable().optional(),
22
- casrn: z.string().nullable().optional(),
23
- preferredName: z.string().nullable().optional(),
24
- iupacName: z.string().nullable().optional(),
25
- molFormula: z.string().nullable().optional(),
26
- smiles: z.string().nullable().optional(),
27
- inchikey: z.string().nullable().optional(),
28
- monoisotopicMass: z.number().nullable().optional(),
29
- averageMass: z.number().nullable().optional(),
30
- qcLevel: z.number().nullable().optional(),
31
- totalAssays: z.number().nullable().optional(),
32
- activeAssays: z.number().nullable().optional(),
33
- percentAssays: z.number().nullable().optional(),
34
- pubchemCid: z.number().nullable().optional(),
35
- pubmedCount: z.number().nullable().optional(),
36
- sourcesCount: z.number().nullable().optional(),
37
- });
38
- const RawPropertySummarySchema = z.object({
39
- propName: z.string().nullable().optional(),
40
- unit: z.string().nullable().optional(),
41
- experimentalCount: z.number().nullable().optional(),
42
- experimentalMedian: z.number().nullable().optional(),
43
- experimentalMin: z.number().nullable().optional(),
44
- experimentalMax: z.number().nullable().optional(),
45
- predictedCount: z.number().nullable().optional(),
46
- predictedMedian: z.number().nullable().optional(),
47
- predictedMin: z.number().nullable().optional(),
48
- predictedMax: z.number().nullable().optional(),
49
- });
50
- export function createSearchCtxChemicalTool(deps) {
51
- return defineTool({
52
- id: "search_ctx_chemical",
53
- description: "Look up chemical details and physicochemical properties from EPA's CompTox Chemicals Dashboard (CTX API). " +
54
- "Returns chemical identifiers (DTXSID, CASRN, SMILES, InChIKey), molecular formula, mass, " +
55
- "and a summary of predicted and experimental properties (logP, water solubility, vapor pressure, " +
56
- "melting/boiling point, bioconcentration factor, Henry's law constant). " +
57
- "Use for ADMET property assessment, compound characterization, and safety-relevant physicochemical profiling. " +
58
- "Requires EPA_CCTE_API_KEY environment variable.",
59
- inputSchema: z.object({
60
- query: z
61
- .string()
62
- .describe("Chemical identifier: DTXSID (e.g. DTXSID7020182), CASRN (e.g. 80-05-7), " + "chemical name (e.g. bisphenol A), or InChIKey"),
63
- includeProperties: z.boolean().default(true).describe("Include predicted/experimental property summaries (logP, solubility, etc.)"),
64
- }),
65
- execute: async ({ query, includeProperties = true }) => {
66
- const headers = getEpaCcteHeaders(deps.apiKey);
67
- const resolved = await resolveDtxsid(query, headers);
68
- // "No chemical found" is an expected outcome — a data variant, not an error.
69
- if (!resolved)
70
- return ok({ found: false, query });
71
- const { dtxsid } = resolved;
72
- const detailUrl = `${EPA_CCTE_BASE}/chemical/detail/search/by-dtxsid/${dtxsid}?projection=chemicaldetailstandard`;
73
- const detailRes = await apiFetchValidated(detailUrl, RawChemicalDetailSchema, { headers });
74
- if (detailRes.isErr())
75
- throw new Error(describeApiError(detailRes.error));
76
- const d = detailRes.value ?? {};
77
- const detail = {
78
- dtxsid: d.dtxsid ?? dtxsid,
79
- dtxcid: d.dtxcid ?? "",
80
- casrn: d.casrn ?? null,
81
- preferredName: d.preferredName ?? "",
82
- iupacName: d.iupacName ?? "",
83
- molFormula: d.molFormula ?? "",
84
- smiles: d.smiles ?? "",
85
- inchikey: d.inchikey ?? "",
86
- monoisotopicMass: d.monoisotopicMass ?? null,
87
- averageMass: d.averageMass ?? null,
88
- qcLevel: d.qcLevel ?? null,
89
- totalAssays: d.totalAssays ?? null,
90
- activeAssays: d.activeAssays ?? null,
91
- percentAssays: d.percentAssays ?? null,
92
- pubchemCid: d.pubchemCid ?? null,
93
- pubmedCount: d.pubmedCount ?? null,
94
- sourcesCount: d.sourcesCount ?? null,
95
- };
96
- const result = { found: true, detail };
97
- if (includeProperties) {
98
- const propUrl = `${EPA_CCTE_BASE}/chemical/property/summary/search/by-dtxsid/${dtxsid}`;
99
- const propRes = await apiFetchValidated(propUrl, z.array(RawPropertySummarySchema), { headers });
100
- if (propRes.isOk() && Array.isArray(propRes.value)) {
101
- result.properties = propRes.value.map((p) => ({
102
- propName: p.propName ?? "",
103
- unit: p.unit ?? "",
104
- experimentalCount: p.experimentalCount ?? null,
105
- experimentalMedian: p.experimentalMedian ?? null,
106
- experimentalMin: p.experimentalMin ?? null,
107
- experimentalMax: p.experimentalMax ?? null,
108
- predictedCount: p.predictedCount ?? null,
109
- predictedMedian: p.predictedMedian ?? null,
110
- predictedMin: p.predictedMin ?? null,
111
- predictedMax: p.predictedMax ?? null,
112
- }));
113
- }
114
- }
115
- return ok(result);
116
- },
117
- });
118
- }
119
- async function resolveDtxsid(query, headers) {
120
- if (query.startsWith("DTXSID")) {
121
- return { dtxsid: query };
122
- }
123
- const url = `${EPA_CCTE_BASE}/chemical/search/equal/${encodeURIComponent(query)}`;
124
- const res = await apiFetchValidated(url, z.array(CtxChemicalSearchRowSchema), { headers });
125
- if (res.isErr())
126
- throw new Error(describeApiError(res.error));
127
- if (!res.value?.length)
128
- return null;
129
- return { dtxsid: res.value[0].dtxsid };
130
- }
@@ -1,55 +0,0 @@
1
- /**
2
- * searchCtxExposure — look up chemical exposure data from EPA's CTX
3
- * Exposure APIs.
4
- */
5
- interface SeemPrediction {
6
- dtxsid: string;
7
- productionVolume: number | null;
8
- units: string;
9
- probabilityDietary: number | null;
10
- probabilityResidential: number | null;
11
- probabilityPesticide: number | null;
12
- probabilityIndustrial: number | null;
13
- }
14
- interface HttkParameter {
15
- parameter: string;
16
- measured: number | null;
17
- predicted: number | null;
18
- units: string;
19
- model: string;
20
- species: string;
21
- reference: string;
22
- }
23
- interface FunctionalUse {
24
- functionCategory: string;
25
- reportedFunction: string;
26
- docTitle: string;
27
- }
28
- interface ProductData {
29
- productName: string;
30
- generalCategory: string;
31
- productFamily: string;
32
- productType: string;
33
- centralWeightFraction: number | null;
34
- weightFractionType: string;
35
- }
36
- interface ExposureOutput {
37
- found: true;
38
- dtxsid: string;
39
- seem?: SeemPrediction;
40
- httk?: HttkParameter[];
41
- functionalUse?: FunctionalUse[];
42
- productData?: ProductData[];
43
- }
44
- type ExposureResult = {
45
- found: false;
46
- query: string;
47
- } | ExposureOutput;
48
- export declare function createSearchCtxExposureTool(deps: {
49
- apiKey: string;
50
- }): import("../define-tool.js").Tool<{
51
- query: string;
52
- dataType: "all" | "seem" | "httk" | "functional-use" | "product-data";
53
- limit: number;
54
- }, ExposureResult>;
55
- export {};
@@ -1,176 +0,0 @@
1
- /**
2
- * searchCtxExposure — look up chemical exposure data from EPA's CTX
3
- * Exposure APIs.
4
- */
5
- import { ok } from "neverthrow";
6
- import { z } from "zod";
7
- import { defineTool } from "../define-tool.js";
8
- import { apiFetchValidated, describeApiError } from "../lib/api-utils.js";
9
- import { EPA_CCTE_BASE, getEpaCcteHeaders } from "../lib/toxcast-config.js";
10
- // The chemical-search endpoint returns rows the code reads `[0].dtxsid` from
11
- // after a length guard, so `dtxsid` stays required — a row missing it is a
12
- // contract break surfaced as `invalid_response`, not a silent `undefined`.
13
- const CtxChemicalSearchRowSchema = z.object({
14
- dtxsid: z.string(),
15
- });
16
- // SEEM exposure-prediction wire shape (endpoint returns a single object or an
17
- // array). `probabilityPesticde` is the API's own misspelling, read as a
18
- // fallback before the corrected `probabilityPesticide`, so both stay modeled.
19
- const RawSeemPredictionSchema = z.object({
20
- dtxsid: z.string().optional(),
21
- productionVolume: z.number().nullable().optional(),
22
- units: z.string().nullable().optional(),
23
- probabilityDietary: z.number().nullable().optional(),
24
- probabilityResidential: z.number().nullable().optional(),
25
- probabilityPesticde: z.number().nullable().optional(),
26
- probabilityPesticide: z.number().nullable().optional(),
27
- probabilityIndustrial: z.number().nullable().optional(),
28
- });
29
- const RawHttkRowSchema = z.object({
30
- parameter: z.string().nullable().optional(),
31
- measured: z.number().nullable().optional(),
32
- predicted: z.number().nullable().optional(),
33
- units: z.string().nullable().optional(),
34
- model: z.string().nullable().optional(),
35
- species: z.string().nullable().optional(),
36
- reference: z.string().nullable().optional(),
37
- });
38
- const RawFunctionalUseRowSchema = z.object({
39
- functioncategory: z.string().nullable().optional(),
40
- reportedfunction: z.string().nullable().optional(),
41
- doctitle: z.string().nullable().optional(),
42
- });
43
- const RawProductDataRowSchema = z.object({
44
- productname: z.string().nullable().optional(),
45
- gencat: z.string().nullable().optional(),
46
- prodfam: z.string().nullable().optional(),
47
- prodtype: z.string().nullable().optional(),
48
- centralweightfraction: z.number().nullable().optional(),
49
- weightfractiontype: z.string().nullable().optional(),
50
- });
51
- export function createSearchCtxExposureTool(deps) {
52
- return defineTool({
53
- id: "search_ctx_exposure",
54
- description: "Look up chemical exposure data from EPA's CTX Exposure APIs. Returns: " +
55
- "SEEM general exposure predictions (estimated daily intake, exposure pathway probabilities), " +
56
- "HTTK toxicokinetic parameters (Css, clearance, volume of distribution, protein binding), " +
57
- "functional use categories, and product composition data. " +
58
- "Use for exposure-based safety margin calculations (comparing ToxCast bioactivity AC50 " +
59
- "against predicted human exposure), IVIVE context, and exposure pathway characterization. " +
60
- "Requires EPA_CCTE_API_KEY environment variable.",
61
- inputSchema: z.object({
62
- query: z.string().describe("Chemical identifier: DTXSID (e.g. DTXSID7020182), CASRN (e.g. 80-05-7), " + "or chemical name (e.g. bisphenol A)"),
63
- dataType: z
64
- .enum(["seem", "httk", "functional-use", "product-data", "all"])
65
- .default("all")
66
- .describe("'seem' for SEEM exposure predictions, " +
67
- "'httk' for toxicokinetic parameters, " +
68
- "'functional-use' for chemical use categories, " +
69
- "'product-data' for consumer product composition, " +
70
- "'all' for combined results"),
71
- limit: z.number().int().min(1).max(100).default(25).describe("Max results per category (for functional-use and product-data)"),
72
- }),
73
- execute: async ({ query, dataType = "all", limit = 25 }) => {
74
- const headers = getEpaCcteHeaders(deps.apiKey);
75
- const resolved = await resolveDtxsid(query, headers);
76
- // "No chemical found" is an expected outcome — a data variant, not an error.
77
- if (!resolved)
78
- return ok({ found: false, query });
79
- const { dtxsid } = resolved;
80
- const result = { found: true, dtxsid };
81
- const fetchers = [];
82
- if (dataType === "seem" || dataType === "all") {
83
- fetchers.push(fetchSeem(dtxsid, headers).then((v) => {
84
- result.seem = v;
85
- }));
86
- }
87
- if (dataType === "httk" || dataType === "all") {
88
- fetchers.push(fetchHttk(dtxsid, headers).then((v) => {
89
- result.httk = v;
90
- }));
91
- }
92
- if (dataType === "functional-use" || dataType === "all") {
93
- fetchers.push(fetchFunctionalUse(dtxsid, headers, limit).then((v) => {
94
- result.functionalUse = v;
95
- }));
96
- }
97
- if (dataType === "product-data" || dataType === "all") {
98
- fetchers.push(fetchProductData(dtxsid, headers, limit).then((v) => {
99
- result.productData = v;
100
- }));
101
- }
102
- await Promise.all(fetchers);
103
- return ok(result);
104
- },
105
- });
106
- }
107
- async function resolveDtxsid(query, headers) {
108
- if (query.startsWith("DTXSID")) {
109
- return { dtxsid: query };
110
- }
111
- const url = `${EPA_CCTE_BASE}/chemical/search/equal/${encodeURIComponent(query)}`;
112
- const res = await apiFetchValidated(url, z.array(CtxChemicalSearchRowSchema), { headers });
113
- if (res.isErr())
114
- throw new Error(describeApiError(res.error));
115
- if (!res.value?.length)
116
- return null;
117
- return { dtxsid: res.value[0].dtxsid };
118
- }
119
- async function fetchSeem(dtxsid, headers) {
120
- const url = `${EPA_CCTE_BASE}/exposure/seem/general/search/by-dtxsid/${dtxsid}`;
121
- const res = await apiFetchValidated(url, z.union([RawSeemPredictionSchema, z.array(RawSeemPredictionSchema)]), { headers });
122
- if (res.isErr() || !res.value)
123
- return undefined;
124
- const d = Array.isArray(res.value) ? res.value[0] : res.value;
125
- if (!d)
126
- return undefined;
127
- return {
128
- dtxsid: d.dtxsid ?? dtxsid,
129
- productionVolume: d.productionVolume ?? null,
130
- units: d.units ?? "",
131
- probabilityDietary: d.probabilityDietary ?? null,
132
- probabilityResidential: d.probabilityResidential ?? null,
133
- probabilityPesticide: d.probabilityPesticde ?? d.probabilityPesticide ?? null,
134
- probabilityIndustrial: d.probabilityIndustrial ?? null,
135
- };
136
- }
137
- async function fetchHttk(dtxsid, headers) {
138
- const url = `${EPA_CCTE_BASE}/exposure/httk/search/by-dtxsid/${dtxsid}`;
139
- const res = await apiFetchValidated(url, z.array(RawHttkRowSchema), { headers });
140
- if (res.isErr() || !Array.isArray(res.value))
141
- return [];
142
- return res.value.map((r) => ({
143
- parameter: r.parameter ?? "",
144
- measured: r.measured ?? null,
145
- predicted: r.predicted ?? null,
146
- units: r.units ?? "",
147
- model: r.model ?? "",
148
- species: r.species ?? "",
149
- reference: r.reference ?? "",
150
- }));
151
- }
152
- async function fetchFunctionalUse(dtxsid, headers, limit) {
153
- const url = `${EPA_CCTE_BASE}/exposure/functional-use/search/by-dtxsid/${dtxsid}`;
154
- const res = await apiFetchValidated(url, z.array(RawFunctionalUseRowSchema), { headers });
155
- if (res.isErr() || !Array.isArray(res.value))
156
- return [];
157
- return res.value.slice(0, limit).map((r) => ({
158
- functionCategory: r.functioncategory ?? "",
159
- reportedFunction: r.reportedfunction ?? "",
160
- docTitle: r.doctitle ?? "",
161
- }));
162
- }
163
- async function fetchProductData(dtxsid, headers, limit) {
164
- const url = `${EPA_CCTE_BASE}/exposure/product-data/search/by-dtxsid/${dtxsid}`;
165
- const res = await apiFetchValidated(url, z.array(RawProductDataRowSchema), { headers });
166
- if (res.isErr() || !Array.isArray(res.value))
167
- return [];
168
- return res.value.slice(0, limit).map((r) => ({
169
- productName: r.productname ?? "",
170
- generalCategory: r.gencat ?? "",
171
- productFamily: r.prodfam ?? "",
172
- productType: r.prodtype ?? "",
173
- centralWeightFraction: r.centralweightfraction ?? null,
174
- weightFractionType: r.weightfractiontype ?? "",
175
- }));
176
- }
@@ -1,111 +0,0 @@
1
- /**
2
- * searchCtxHazard — search EPA CTX Hazard APIs (ToxValDB, ToxRefDB) for
3
- * toxicological hazard data on a chemical.
4
- */
5
- import { z } from "zod";
6
- declare const ToxValSchema: z.ZodPipe<z.ZodObject<{
7
- source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
8
- toxvalType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
9
- toxvalNumeric: z.ZodOptional<z.ZodUnknown>;
10
- toxvalUnits: z.ZodOptional<z.ZodNullable<z.ZodString>>;
11
- studyType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
12
- studyDurationClass: z.ZodOptional<z.ZodNullable<z.ZodString>>;
13
- speciesCommon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
14
- exposureRoute: z.ZodOptional<z.ZodNullable<z.ZodString>>;
15
- toxicologicalEffect: z.ZodOptional<z.ZodNullable<z.ZodString>>;
16
- riskAssessmentClass: z.ZodOptional<z.ZodNullable<z.ZodString>>;
17
- humanEco: z.ZodOptional<z.ZodNullable<z.ZodString>>;
18
- year: z.ZodOptional<z.ZodUnknown>;
19
- quality: z.ZodOptional<z.ZodNullable<z.ZodString>>;
20
- }, z.core.$strip>, z.ZodTransform<{
21
- source: string;
22
- toxvalType: string;
23
- toxvalNumeric: number | null;
24
- toxvalUnits: string;
25
- studyType: string;
26
- studyDurationClass: string;
27
- species: string;
28
- exposureRoute: string;
29
- toxicologicalEffect: string;
30
- riskAssessmentClass: string;
31
- humanEco: string;
32
- year: number | null;
33
- quality: string;
34
- }, {
35
- source?: string | null | undefined;
36
- toxvalType?: string | null | undefined;
37
- toxvalNumeric?: unknown;
38
- toxvalUnits?: string | null | undefined;
39
- studyType?: string | null | undefined;
40
- studyDurationClass?: string | null | undefined;
41
- speciesCommon?: string | null | undefined;
42
- exposureRoute?: string | null | undefined;
43
- toxicologicalEffect?: string | null | undefined;
44
- riskAssessmentClass?: string | null | undefined;
45
- humanEco?: string | null | undefined;
46
- year?: unknown;
47
- quality?: string | null | undefined;
48
- }>>;
49
- type ToxValEntry = z.infer<typeof ToxValSchema>;
50
- declare const GenetoxSchema: z.ZodPipe<z.ZodObject<{
51
- source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
52
- assayCategory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
53
- assayType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
54
- metabolicActivation: z.ZodOptional<z.ZodNullable<z.ZodString>>;
55
- species: z.ZodOptional<z.ZodNullable<z.ZodString>>;
56
- overallResult: z.ZodOptional<z.ZodNullable<z.ZodString>>;
57
- year: z.ZodOptional<z.ZodUnknown>;
58
- }, z.core.$strip>, z.ZodTransform<{
59
- source: string;
60
- assayCategory: string;
61
- assayType: string;
62
- metabolicActivation: string;
63
- species: string;
64
- overallResult: string;
65
- year: number | null;
66
- }, {
67
- source?: string | null | undefined;
68
- assayCategory?: string | null | undefined;
69
- assayType?: string | null | undefined;
70
- metabolicActivation?: string | null | undefined;
71
- species?: string | null | undefined;
72
- overallResult?: string | null | undefined;
73
- year?: unknown;
74
- }>>;
75
- type GenetoxSummary = z.infer<typeof GenetoxSchema>;
76
- declare const CancerSchema: z.ZodPipe<z.ZodObject<{
77
- source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
78
- classification: z.ZodOptional<z.ZodNullable<z.ZodString>>;
79
- cancerClassification: z.ZodOptional<z.ZodNullable<z.ZodString>>;
80
- url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
81
- }, z.core.$strip>, z.ZodTransform<{
82
- source: string;
83
- classification: string;
84
- url: string;
85
- }, {
86
- source?: string | null | undefined;
87
- classification?: string | null | undefined;
88
- cancerClassification?: string | null | undefined;
89
- url?: string | null | undefined;
90
- }>>;
91
- type CancerSummary = z.infer<typeof CancerSchema>;
92
- interface CtxHazardOutput {
93
- found: true;
94
- dtxsid: string;
95
- preferredName: string;
96
- toxval?: ToxValEntry[];
97
- genetox?: GenetoxSummary[];
98
- cancer?: CancerSummary[];
99
- }
100
- type CtxHazardResult = {
101
- found: false;
102
- query: string;
103
- } | CtxHazardOutput;
104
- export declare function createSearchCtxHazardTool(deps: {
105
- apiKey: string;
106
- }): import("../define-tool.js").Tool<{
107
- query: string;
108
- dataType: "toxval" | "genetox" | "cancer" | "all";
109
- limit: number;
110
- }, CtxHazardResult>;
111
- export {};