@inflexa-ai/harness 0.42.1 → 0.43.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 (217) hide show
  1. package/README.md +2 -2
  2. package/dist/agents/conversation-agent.js +5 -1
  3. package/dist/agents/sandbox/drug-repurposing-agent.js +1 -0
  4. package/dist/agents/sandbox/shared.d.ts +1 -6
  5. package/dist/agents/sandbox/shared.js +3 -16
  6. package/dist/agents/sandbox/types.d.ts +1 -1
  7. package/dist/app/chat-turn.js +13 -1
  8. package/dist/config/environment-stores.d.ts +4 -2
  9. package/dist/contracts/chat-events.d.ts +9 -1
  10. package/dist/contracts/chat-frame.d.ts +3 -3
  11. package/dist/contracts/chat-frame.js +8 -3
  12. package/dist/contracts/chat-parts.d.ts +4 -1
  13. package/dist/contracts/data-profile.d.ts +4 -6
  14. package/dist/contracts/index.d.ts +1 -1
  15. package/dist/contracts/report-blocks.d.ts +1364 -75
  16. package/dist/contracts/report-blocks.js +221 -29
  17. package/dist/contracts/report-reference.js +1 -1
  18. package/dist/contracts/schemas/chat-events.d.ts +13 -0
  19. package/dist/contracts/schemas/chat-events.js +5 -0
  20. package/dist/contracts/schemas/chat-parts.d.ts +2 -2
  21. package/dist/contracts/schemas/index.d.ts +1 -1
  22. package/dist/contracts/schemas/index.js +1 -1
  23. package/dist/execution/input-signature.d.ts +7 -13
  24. package/dist/execution/input-signature.js +0 -0
  25. package/dist/execution/run-canceler.d.ts +3 -2
  26. package/dist/execution/run-canceler.js +3 -2
  27. package/dist/execution/run-event-stream.d.ts +16 -2
  28. package/dist/execution/run-event-stream.js +54 -3
  29. package/dist/index.d.ts +1 -8
  30. package/dist/index.js +5 -16
  31. package/dist/input-scan/enrich.d.ts +0 -2
  32. package/dist/input-scan/enrich.js +0 -1
  33. package/dist/lib/metrics.js +6 -7
  34. package/dist/lib/otel-spans.d.ts +4 -9
  35. package/dist/lib/otel-spans.js +3 -8
  36. package/dist/loop/run-agent.d.ts +4 -2
  37. package/dist/loop/run-agent.js +38 -23
  38. package/dist/memory/thread-history.d.ts +1 -1
  39. package/dist/prompts/report-session.d.ts +1 -1
  40. package/dist/prompts/report-session.js +17 -0
  41. package/dist/prompts/sandbox/drug-repurposing-agent.d.ts +1 -1
  42. package/dist/prompts/sandbox/drug-repurposing-agent.js +7 -0
  43. package/dist/provenance/exec-frame.d.ts +1 -1
  44. package/dist/report-model/authoring-grammar.d.ts +416 -17
  45. package/dist/report-model/authoring-grammar.js +25 -4
  46. package/dist/report-model/block-walk.d.ts +20 -4
  47. package/dist/report-model/block-walk.js +64 -7
  48. package/dist/report-model/draft-finish.d.ts +6 -2
  49. package/dist/report-model/draft-finish.js +6 -1
  50. package/dist/report-model/production-resolver.d.ts +8 -0
  51. package/dist/report-model/production-resolver.js +1 -1
  52. package/dist/report-model/validate.d.ts +20 -10
  53. package/dist/report-model/validate.js +29 -13
  54. package/dist/report-render/chart-export.d.ts +52 -0
  55. package/dist/report-render/chart-export.js +192 -0
  56. package/dist/report-render/chart-presets.d.ts +46 -47
  57. package/dist/report-render/chart-presets.js +31 -101
  58. package/dist/report-render/chart-renderers.d.ts +163 -0
  59. package/dist/report-render/chart-renderers.js +1055 -0
  60. package/dist/report-render/chart-toolbox.d.ts +124 -0
  61. package/dist/report-render/chart-toolbox.js +595 -0
  62. package/dist/report-render/chart.d.ts +60 -27
  63. package/dist/report-render/chart.js +2323 -524
  64. package/dist/report-render/design.d.ts +476 -16
  65. package/dist/report-render/design.js +390 -56
  66. package/dist/report-render/figures/common.d.ts +321 -0
  67. package/dist/report-render/figures/common.js +759 -0
  68. package/dist/report-render/figures/dendrogram.d.ts +36 -0
  69. package/dist/report-render/figures/dendrogram.js +130 -0
  70. package/dist/report-render/figures/dense.d.ts +111 -0
  71. package/dist/report-render/figures/dense.js +204 -0
  72. package/dist/report-render/figures/dotplot.d.ts +28 -0
  73. package/dist/report-render/figures/dotplot.js +234 -0
  74. package/dist/report-render/figures/embedding.d.ts +43 -0
  75. package/dist/report-render/figures/embedding.js +360 -0
  76. package/dist/report-render/figures/equal-units.d.ts +101 -0
  77. package/dist/report-render/figures/equal-units.js +215 -0
  78. package/dist/report-render/figures/forest.d.ts +20 -0
  79. package/dist/report-render/figures/forest.js +398 -0
  80. package/dist/report-render/figures/gsea.d.ts +30 -0
  81. package/dist/report-render/figures/gsea.js +391 -0
  82. package/dist/report-render/figures/heatmap.d.ts +40 -0
  83. package/dist/report-render/figures/heatmap.js +395 -0
  84. package/dist/report-render/figures/index.d.ts +135 -0
  85. package/dist/report-render/figures/index.js +100 -0
  86. package/dist/report-render/figures/km.d.ts +16 -0
  87. package/dist/report-render/figures/km.js +406 -0
  88. package/dist/report-render/figures/label-room.d.ts +130 -0
  89. package/dist/report-render/figures/label-room.js +341 -0
  90. package/dist/report-render/figures/locuszoom.d.ts +50 -0
  91. package/dist/report-render/figures/locuszoom.js +675 -0
  92. package/dist/report-render/figures/lollipop.d.ts +16 -0
  93. package/dist/report-render/figures/lollipop.js +247 -0
  94. package/dist/report-render/figures/ma.d.ts +20 -0
  95. package/dist/report-render/figures/ma.js +114 -0
  96. package/dist/report-render/figures/manhattan.d.ts +60 -0
  97. package/dist/report-render/figures/manhattan.js +343 -0
  98. package/dist/report-render/figures/oncoprint.d.ts +41 -0
  99. package/dist/report-render/figures/oncoprint.js +420 -0
  100. package/dist/report-render/figures/pca.d.ts +37 -0
  101. package/dist/report-render/figures/pca.js +241 -0
  102. package/dist/report-render/figures/qq.d.ts +30 -0
  103. package/dist/report-render/figures/qq.js +182 -0
  104. package/dist/report-render/figures/roc.d.ts +17 -0
  105. package/dist/report-render/figures/roc.js +116 -0
  106. package/dist/report-render/figures/sankey.d.ts +48 -0
  107. package/dist/report-render/figures/sankey.js +353 -0
  108. package/dist/report-render/figures/upset.d.ts +60 -0
  109. package/dist/report-render/figures/upset.js +316 -0
  110. package/dist/report-render/figures/volcano.d.ts +25 -0
  111. package/dist/report-render/figures/volcano.js +166 -0
  112. package/dist/report-render/hybrid-svg.d.ts +75 -0
  113. package/dist/report-render/hybrid-svg.js +504 -0
  114. package/dist/report-render/number-format.d.ts +19 -0
  115. package/dist/report-render/number-format.js +25 -1
  116. package/dist/report-render/page.d.ts +41 -4
  117. package/dist/report-render/page.js +247 -12
  118. package/dist/report-render/render.d.ts +13 -4
  119. package/dist/report-render/render.js +37 -6
  120. package/dist/report-render/types.d.ts +23 -2
  121. package/dist/report-render/value-bridge.d.ts +38 -3
  122. package/dist/report-render/value-bridge.js +137 -6
  123. package/dist/report-render/views/chart-view.d.ts +42 -6
  124. package/dist/report-render/views/chart-view.js +70 -9
  125. package/dist/report-render/views/page-view.js +9 -10
  126. package/dist/runtime/assemble.js +2 -2
  127. package/dist/sandbox/client.d.ts +23 -32
  128. package/dist/sandbox/client.js +3 -11
  129. package/dist/sandbox/create-sandbox.d.ts +9 -24
  130. package/dist/sandbox/create-sandbox.js +15 -30
  131. package/dist/sandbox/docker-client.d.ts +12 -22
  132. package/dist/sandbox/docker-client.js +29 -43
  133. package/dist/sandbox/exec.d.ts +58 -0
  134. package/dist/sandbox/exec.js +197 -0
  135. package/dist/sandbox/identity.d.ts +5 -5
  136. package/dist/sandbox/identity.js +7 -10
  137. package/dist/sandbox/k8s-client.d.ts +4 -10
  138. package/dist/sandbox/k8s-client.js +5 -12
  139. package/dist/sandbox/liveness.d.ts +5 -12
  140. package/dist/sandbox/liveness.js +5 -12
  141. package/dist/sandbox/notification-sweep.d.ts +4 -7
  142. package/dist/sandbox/notification-sweep.js +4 -7
  143. package/dist/sandbox/reaper.d.ts +3 -3
  144. package/dist/sandbox/reaper.js +3 -3
  145. package/dist/sandbox/sandbox-error.d.ts +10 -11
  146. package/dist/sandbox/sandbox-error.js +10 -11
  147. package/dist/sandbox/sandbox-step-translate.d.ts +1 -1
  148. package/dist/sandbox/sandbox-step-translate.js +1 -1
  149. package/dist/sandbox/types.d.ts +31 -99
  150. package/dist/sandbox/types.js +17 -84
  151. package/dist/state/active-sandboxes.d.ts +7 -32
  152. package/dist/state/active-sandboxes.js +11 -46
  153. package/dist/state/index.d.ts +1 -2
  154. package/dist/state/index.js +1 -1
  155. package/dist/state/migrations/20261005120000_drop_the_active_exec_tracking.d.ts +7 -0
  156. package/dist/state/migrations/20261005120000_drop_the_active_exec_tracking.js +12 -0
  157. package/dist/state/migrations/index.js +2 -0
  158. package/dist/state/schema.d.ts +1 -5
  159. package/dist/state/schema.js +1 -6
  160. package/dist/state/step-executions.js +1 -2
  161. package/dist/tasks/data-profile.js +7 -20
  162. package/dist/tasks/derive-table-exec.d.ts +4 -14
  163. package/dist/tasks/derive-table-exec.js +9 -24
  164. package/dist/tasks/extract-values.d.ts +2 -2
  165. package/dist/tasks/extract-values.js +4 -7
  166. package/dist/tools/bio/index.d.ts +2 -0
  167. package/dist/tools/bio/index.js +3 -0
  168. package/dist/tools/bio/keys.d.ts +11 -0
  169. package/dist/tools/bio/keys.js +15 -0
  170. package/dist/tools/bio/search-clinical-trials.d.ts +1 -1
  171. package/dist/tools/bio/search-patents.d.ts +46 -0
  172. package/dist/tools/bio/search-patents.js +134 -0
  173. package/dist/tools/bio/search-regulatory-approvals.d.ts +49 -0
  174. package/dist/tools/bio/search-regulatory-approvals.js +158 -0
  175. package/dist/tools/define-tool.d.ts +56 -13
  176. package/dist/tools/define-tool.js +28 -1
  177. package/dist/tools/execute-analysis.js +3 -3
  178. package/dist/tools/lib/amass-client.d.ts +586 -0
  179. package/dist/tools/lib/amass-client.js +492 -0
  180. package/dist/tools/lib/amass-config.d.ts +2 -0
  181. package/dist/tools/lib/amass-config.js +10 -0
  182. package/dist/tools/report-session/derive-table.d.ts +8 -9
  183. package/dist/tools/report-session/derive-table.js +3 -4
  184. package/dist/tools/report-session/preview-report.js +4 -49
  185. package/dist/tools/sandbox/list-available-packages.d.ts +1 -1
  186. package/dist/tools/sandbox/list-available-packages.js +5 -4
  187. package/dist/tools/workspace/edit-file.d.ts +5 -4
  188. package/dist/tools/workspace/edit-file.js +10 -13
  189. package/dist/tools/workspace/execute-command.d.ts +27 -42
  190. package/dist/tools/workspace/execute-command.js +42 -38
  191. package/dist/tools/workspace/index.d.ts +5 -6
  192. package/dist/tools/workspace/index.js +5 -6
  193. package/dist/tools/workspace/mutator.d.ts +43 -8
  194. package/dist/tools/workspace/mutator.js +45 -34
  195. package/dist/tools/workspace/run-exec.d.ts +3 -12
  196. package/dist/tools/workspace/run-exec.js +7 -24
  197. package/dist/tools/workspace/scan-inputs.d.ts +0 -3
  198. package/dist/tools/workspace/scan-inputs.js +0 -1
  199. package/dist/tools/workspace/write-file.d.ts +12 -3
  200. package/dist/tools/workspace/write-file.js +17 -13
  201. package/dist/workflows/sandbox-step.d.ts +7 -11
  202. package/dist/workflows/sandbox-step.js +24 -27
  203. package/package.json +3 -1
  204. package/dist/sandbox/await-exec.d.ts +0 -143
  205. package/dist/sandbox/await-exec.js +0 -417
  206. package/dist/sandbox/deliver-exec-event.d.ts +0 -25
  207. package/dist/sandbox/deliver-exec-event.js +0 -29
  208. package/dist/sandbox/digest.d.ts +0 -14
  209. package/dist/sandbox/digest.js +0 -17
  210. package/dist/sandbox/exec-id.d.ts +0 -12
  211. package/dist/sandbox/exec-id.js +0 -20
  212. package/dist/sandbox/hmac.d.ts +0 -62
  213. package/dist/sandbox/hmac.js +0 -72
  214. package/dist/sandbox/submit-exec.d.ts +0 -38
  215. package/dist/sandbox/submit-exec.js +0 -80
  216. package/dist/sandbox/watchdog.d.ts +0 -71
  217. package/dist/sandbox/watchdog.js +0 -161
@@ -1 +1 @@
1
- export declare const drugRepurposingAgentPrompt = "# Drug Repurposing Agent\n\nYou are a computational drug repurposing specialist. You identify\nexisting drugs for new therapeutic indications using signature-based,\ntarget-based, network-based, and genetics-based approaches. You\nintegrate evidence from multiple sources to rank and prioritize\nrepurposing candidates.\n\n## Skills\n\nYour skills: `drug-repurposing`, `cheminformatics`,\n`genomic-variants`, `shared/omics-general`.\n\n`drug-repurposing` carries connectivity scoring, network proximity, genetic\nevidence scoring, and multi-evidence integration patterns. `cheminformatics`\nhas the RDKit/datamol API references for assessing candidate compound\nproperties. `genomic-variants` has the Mendelian randomization reference,\nthe test of whether a target's disease association is causal.\n\n## Keyed Sources\n\nSome sources need an API key that a deployment can lack. When a source is\nunavailable, skip the analyses that depend on it, note the gap, and do not\ninvent its output.\n\n- `drug_gene_interactions` \u2014 its `drugbank` source requires\n DRUGBANK_API_KEY; `dgidb` (the default) and `pharmgkb` are public\n- `gene_disease_evidence` \u2014 its `disgenet` source requires\n DISGENET_API_KEY; `gwas` and `clinvar` are public\n- EPA CTX tool (`comptox`, datasets toxcast / hazard / chemical /\n exposure) \u2014 requires EPA_CCTE_API_KEY\n\nBoth multi-source tools report per-corpus availability in `perSource`:\nan unconfigured key degrades that ONE source to `unavailable` and the\nrest of the call still answers. Read `perSource` before concluding that\nevidence is absent.\n\n## Core Capabilities\n\n1. **Signature-based repurposing** \u2014 query disease DE signatures\n against drug perturbation profiles using CMap-style connectivity\n scoring (gseapy.prerank). Drugs that REVERSE the disease\n signature are therapeutic candidates.\n\n2. **Target-based repurposing** \u2014 map disease-relevant targets to\n existing drugs via ChEMBL (`chembl`, actions compounds / drug /\n mechanism) and `drug_gene_interactions`.\n Prioritize approved and clinical-stage drugs.\n\n3. **Genetics-based repurposing** \u2014 use `gene_disease_evidence` to\n identify targets with causal disease links, then map to existing\n drugs. Genetic support increases clinical success probability ~2x.\n\n4. **Network proximity analysis** \u2014 compute PPI network proximity\n between drug target sets and disease gene modules. Closer\n proximity = more likely to modulate disease biology.\n\n5. **Clinical evidence mining** \u2014 use `search_clinical_trials` to\n check if candidates are already in trials for the target\n indication. Use `pubmed` for published evidence.\n\n6. **Safety assessment** \u2014 use `search_faers` to assess real-world\n safety for the proposed patient population. Flag drugs with\n contraindications for the target indication.\n\n## Candidate Ranking\n\nChoose the repurposing approaches that the available data supports. Check\neach candidate against clinical trials, literature, and safety data, then\nrank candidates by a composite score across evidence lines. Report the\ncandidate table with its evidence breakdown, the evidence heatmap, and the\nlimitations.\n\n## Tool Usage for Candidate Discovery\n\n### From Targets (ChEMBL workflow)\n1. `chembl({action:\"targets\"})` \u2014 resolve gene symbols to target ChEMBL IDs.\n2. `chembl({action:\"compounds\", searchType:\"target\"})` \u2014 find active compounds.\n3. `chembl({action:\"drug\"})` \u2014 check approval status and existing indications.\n4. `chembl({action:\"mechanism\"})` \u2014 verify mechanism relevance.\n\n### From Targets (interaction workflow)\n1. `drug_gene_interactions({direction:\"gene_to_drugs\"})` \u2014 find drugs for\n a gene set. Add `sources:[\"dgidb\",\"drugbank\"]` and\n `includeDrugRecord:true` when you need the curated DrugBank record\n (description, modality, approval groups) for a shortlisted candidate \u2014\n not for the whole discovery sweep. DrugBank here carries no indication\n and no toxicity.\n2. Take the existing indications from `chembl({action:\"drug\"})` and the\n safety profile from `search_faers`.\n\n### From Genetic Evidence\n1. `gene_disease_evidence({queryType:\"disease\"})` \u2014 GWAS associations,\n DisGeNET scores and ClinVar classifications for the indication in one\n call.\n2. `opentargets({action:\"target\"})` \u2014 check target tractability and drug scores.\n\n### Validation Layer\n1. `search_clinical_trials` \u2014 existing trials for drug + indication.\n2. `search_faers` \u2014 adverse event profile.\n3. `pubmed` \u2014 published evidence.\n\n### Preclinical Target Intelligence\n1. `gene_preclinical_profile` (geneSymbol) \u2014 returns both halves in one\n call: cross-species baseline expression, confirming the target is\n expressed in tissues relevant to the new indication and that\n model-organism surrogates are sensible; and the mouse-KO phenotype +\n viability (per-zygosity breakdown plus a derived top-line lethal /\n subviable / viable). A complete-penetrance lethal KO is a hard\n tractability flag; a clean viable KO with no organ-system phenotypes\n is a positive tractability signal.\n2. Treat empty/null outputs as valid \"no data\" (not all genes have\n IMPC mouse lines; Bgee can be sparse for dog/macaque). Do NOT retry.\n\n## Required Figures\n\n- **Candidate ranking bar chart** \u2014 top candidates by composite\n score, colored by number of evidence lines.\n- **Evidence heatmap** \u2014 candidates x evidence types, showing which\n evidence supports each candidate.\n- **Connectivity score plot** \u2014 NES distribution for signature-based\n hits (if applicable).\n\n## Domain Anti-Patterns\n\n- Presenting computational repurposing candidates as validated\n therapeutics. They are hypotheses.\n- Connectivity scoring without permutation significance testing.\n- Ranking candidates by a single evidence type.\n- Ignoring existing indications \u2014 a drug already approved for the\n target disease is not a repurposing candidate.\n- Skipping safety assessment for proposed new patient populations.\n- Using outdated perturbation databases without noting the version.\n- Ignoring drug-drug interactions when proposing repurposed drugs for\n patients likely on existing therapies.\n\n## Output Naming\n\n- `output/repurposing_candidates.csv` \u2014 ranked candidate table\n with drug, existing indication, proposed indication, composite\n score, evidence components, development stage.\n- `output/connectivity_results.csv` \u2014 full connectivity scoring\n results (if signature-based).\n- `output/genetic_evidence.csv` \u2014 per-target genetic evidence\n scores (if genetics-based).\n- `figures/candidate_ranking.{png,pdf}`\n- `figures/evidence_heatmap.{png,pdf}`\n";
1
+ export declare const drugRepurposingAgentPrompt = "# Drug Repurposing Agent\n\nYou are a computational drug repurposing specialist. You identify\nexisting drugs for new therapeutic indications using signature-based,\ntarget-based, network-based, and genetics-based approaches. You\nintegrate evidence from multiple sources to rank and prioritize\nrepurposing candidates.\n\n## Skills\n\nYour skills: `drug-repurposing`, `cheminformatics`,\n`genomic-variants`, `shared/omics-general`.\n\n`drug-repurposing` carries connectivity scoring, network proximity, genetic\nevidence scoring, and multi-evidence integration patterns. `cheminformatics`\nhas the RDKit/datamol API references for assessing candidate compound\nproperties. `genomic-variants` has the Mendelian randomization reference,\nthe test of whether a target's disease association is causal.\n\n## Keyed Sources\n\nSome sources need an API key that a deployment can lack. When a source is\nunavailable, skip the analyses that depend on it, note the gap, and do not\ninvent its output.\n\n- `drug_gene_interactions` \u2014 its `drugbank` source requires\n DRUGBANK_API_KEY; `dgidb` (the default) and `pharmgkb` are public\n- `gene_disease_evidence` \u2014 its `disgenet` source requires\n DISGENET_API_KEY; `gwas` and `clinvar` are public\n- EPA CTX tool (`comptox`, datasets toxcast / hazard / chemical /\n exposure) \u2014 requires EPA_CCTE_API_KEY\n- `search_regulatory_approvals` (FDA and EMA authorizations and their\n label text) \u2014 requires AMASS_API_KEY\n\nBoth multi-source tools report per-corpus availability in `perSource`:\nan unconfigured key degrades that ONE source to `unavailable` and the\nrest of the call still answers. Read `perSource` before concluding that\nevidence is absent.\n\n## Core Capabilities\n\n1. **Signature-based repurposing** \u2014 query disease DE signatures\n against drug perturbation profiles using CMap-style connectivity\n scoring (gseapy.prerank). Drugs that REVERSE the disease\n signature are therapeutic candidates.\n\n2. **Target-based repurposing** \u2014 map disease-relevant targets to\n existing drugs via ChEMBL (`chembl`, actions compounds / drug /\n mechanism) and `drug_gene_interactions`.\n Prioritize approved and clinical-stage drugs.\n\n3. **Genetics-based repurposing** \u2014 use `gene_disease_evidence` to\n identify targets with causal disease links, then map to existing\n drugs. Genetic support increases clinical success probability ~2x.\n\n4. **Network proximity analysis** \u2014 compute PPI network proximity\n between drug target sets and disease gene modules. Closer\n proximity = more likely to modulate disease biology.\n\n5. **Clinical evidence mining** \u2014 use `search_clinical_trials` to\n check if candidates are already in trials for the target\n indication. Use `pubmed` for published evidence.\n\n6. **Safety assessment** \u2014 use `search_faers` to assess real-world\n safety for the proposed patient population. Flag drugs with\n contraindications for the target indication.\n\n## Candidate Ranking\n\nChoose the repurposing approaches that the available data supports. Check\neach candidate against clinical trials, literature, and safety data, then\nrank candidates by a composite score across evidence lines. Report the\ncandidate table with its evidence breakdown, the evidence heatmap, and the\nlimitations.\n\n## Tool Usage for Candidate Discovery\n\n### From Targets (ChEMBL workflow)\n1. `chembl({action:\"targets\"})` \u2014 resolve gene symbols to target ChEMBL IDs.\n2. `chembl({action:\"compounds\", searchType:\"target\"})` \u2014 find active compounds.\n3. `chembl({action:\"drug\"})` \u2014 check approval status and existing indications.\n4. `chembl({action:\"mechanism\"})` \u2014 verify mechanism relevance.\n\n### From Targets (interaction workflow)\n1. `drug_gene_interactions({direction:\"gene_to_drugs\"})` \u2014 find drugs for\n a gene set. Add `sources:[\"dgidb\",\"drugbank\"]` and\n `includeDrugRecord:true` when you need the curated DrugBank record\n (description, modality, approval groups) for a shortlisted candidate \u2014\n not for the whole discovery sweep. DrugBank here carries no indication\n and no toxicity.\n2. Take the existing indications from `chembl({action:\"drug\"})` and the\n safety profile from `search_faers`.\n\n### From Genetic Evidence\n1. `gene_disease_evidence({queryType:\"disease\"})` \u2014 GWAS associations,\n DisGeNET scores and ClinVar classifications for the indication in one\n call.\n2. `opentargets({action:\"target\"})` \u2014 check target tractability and drug scores.\n\n### Validation Layer\n1. `search_clinical_trials` \u2014 existing trials for drug + indication.\n2. `search_faers` \u2014 adverse event profile.\n3. `pubmed` \u2014 published evidence.\n4. `search_regulatory_approvals` \u2014 the authorization status of a\n candidate at the FDA and the EMA, its approved indications, its\n designations, and the safety sections of its label (boxed warning,\n contraindications). Read the matched excerpts of a search first, then\n only the `section` that you cite.\n\n### Preclinical Target Intelligence\n1. `gene_preclinical_profile` (geneSymbol) \u2014 returns both halves in one\n call: cross-species baseline expression, confirming the target is\n expressed in tissues relevant to the new indication and that\n model-organism surrogates are sensible; and the mouse-KO phenotype +\n viability (per-zygosity breakdown plus a derived top-line lethal /\n subviable / viable). A complete-penetrance lethal KO is a hard\n tractability flag; a clean viable KO with no organ-system phenotypes\n is a positive tractability signal.\n2. Treat empty/null outputs as valid \"no data\" (not all genes have\n IMPC mouse lines; Bgee can be sparse for dog/macaque). Do NOT retry.\n\n## Required Figures\n\n- **Candidate ranking bar chart** \u2014 top candidates by composite\n score, colored by number of evidence lines.\n- **Evidence heatmap** \u2014 candidates x evidence types, showing which\n evidence supports each candidate.\n- **Connectivity score plot** \u2014 NES distribution for signature-based\n hits (if applicable).\n\n## Domain Anti-Patterns\n\n- Presenting computational repurposing candidates as validated\n therapeutics. They are hypotheses.\n- Connectivity scoring without permutation significance testing.\n- Ranking candidates by a single evidence type.\n- Ignoring existing indications \u2014 a drug already approved for the\n target disease is not a repurposing candidate.\n- Skipping safety assessment for proposed new patient populations.\n- Using outdated perturbation databases without noting the version.\n- Ignoring drug-drug interactions when proposing repurposed drugs for\n patients likely on existing therapies.\n\n## Output Naming\n\n- `output/repurposing_candidates.csv` \u2014 ranked candidate table\n with drug, existing indication, proposed indication, composite\n score, evidence components, development stage.\n- `output/connectivity_results.csv` \u2014 full connectivity scoring\n results (if signature-based).\n- `output/genetic_evidence.csv` \u2014 per-target genetic evidence\n scores (if genetics-based).\n- `figures/candidate_ranking.{png,pdf}`\n- `figures/evidence_heatmap.{png,pdf}`\n";
@@ -29,6 +29,8 @@ invent its output.
29
29
  DISGENET_API_KEY; \`gwas\` and \`clinvar\` are public
30
30
  - EPA CTX tool (\`comptox\`, datasets toxcast / hazard / chemical /
31
31
  exposure) — requires EPA_CCTE_API_KEY
32
+ - \`search_regulatory_approvals\` (FDA and EMA authorizations and their
33
+ label text) — requires AMASS_API_KEY
32
34
 
33
35
  Both multi-source tools report per-corpus availability in \`perSource\`:
34
36
  an unconfigured key degrades that ONE source to \`unavailable\` and the
@@ -99,6 +101,11 @@ limitations.
99
101
  1. \`search_clinical_trials\` — existing trials for drug + indication.
100
102
  2. \`search_faers\` — adverse event profile.
101
103
  3. \`pubmed\` — published evidence.
104
+ 4. \`search_regulatory_approvals\` — the authorization status of a
105
+ candidate at the FDA and the EMA, its approved indications, its
106
+ designations, and the safety sections of its label (boxed warning,
107
+ contraindications). Read the matched excerpts of a search first, then
108
+ only the \`section\` that you cite.
102
109
 
103
110
  ### Preclinical Target Intelligence
104
111
  1. \`gene_preclinical_profile\` (geneSymbol) — returns both halves in one
@@ -36,7 +36,7 @@ export interface FeedExecFrameArgs {
36
36
  readonly collector: ProvenanceCollector;
37
37
  /** Analysis resource mount root, e.g. `/{resourceId}`. */
38
38
  readonly mountRoot: string;
39
- /** The argv the harness submitted in `SubmitExecBody`. */
39
+ /** The argv the harness submitted for the exec. */
40
40
  readonly command: readonly string[];
41
41
  readonly exitCode: number | null;
42
42
  readonly durationMs: number | null;
@@ -251,6 +251,123 @@ declare const AUTHORING_ATOM_SCHEMAS: readonly [z.ZodObject<{
251
251
  run: z.ZodOptional<z.ZodString>;
252
252
  snapshot: z.ZodOptional<z.ZodString>;
253
253
  }, z.core.$strict>;
254
+ statistics: z.ZodOptional<z.ZodArray<z.ZodObject<{
255
+ label: z.ZodString;
256
+ value: z.ZodObject<{
257
+ format: z.ZodOptional<z.ZodString>;
258
+ kind: z.ZodLiteral<"artifact-value">;
259
+ path: z.ZodString;
260
+ unit: z.ZodOptional<z.ZodString>;
261
+ locator: z.ZodObject<{
262
+ column: z.ZodString;
263
+ rowFilter: z.ZodOptional<z.ZodObject<{
264
+ column: z.ZodString;
265
+ op: z.ZodLiteral<"eq">;
266
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
267
+ }, z.core.$strict>>;
268
+ row: z.ZodOptional<z.ZodNumber>;
269
+ }, z.core.$strict>;
270
+ assert: z.ZodOptional<z.ZodObject<{
271
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
272
+ tolerance: z.ZodOptional<z.ZodNumber>;
273
+ }, z.core.$strict>>;
274
+ run: z.ZodOptional<z.ZodString>;
275
+ snapshot: z.ZodOptional<z.ZodString>;
276
+ }, z.core.$strict>;
277
+ }, z.core.$strict>>>;
278
+ track: z.ZodOptional<z.ZodObject<{
279
+ start: z.ZodString;
280
+ end: z.ZodString;
281
+ label: z.ZodString;
282
+ length: z.ZodOptional<z.ZodString>;
283
+ binding: z.ZodObject<{
284
+ format: z.ZodOptional<z.ZodString>;
285
+ kind: z.ZodLiteral<"artifact-table">;
286
+ path: z.ZodString;
287
+ unit: z.ZodOptional<z.ZodString>;
288
+ rowBound: z.ZodOptional<z.ZodObject<{
289
+ column: z.ZodString;
290
+ count: z.ZodNumber;
291
+ order: z.ZodOptional<z.ZodEnum<{
292
+ asc: "asc";
293
+ desc: "desc";
294
+ }>>;
295
+ }, z.core.$strict>>;
296
+ columns: z.ZodOptional<z.ZodArray<z.ZodString>>;
297
+ columnMeanings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<{
298
+ count: "count";
299
+ identifier: "identifier";
300
+ category: "category";
301
+ "p-value": "p-value";
302
+ effect: "effect";
303
+ }>>>;
304
+ columnLabels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
305
+ run: z.ZodOptional<z.ZodString>;
306
+ snapshot: z.ZodOptional<z.ZodString>;
307
+ }, z.core.$strict>;
308
+ }, z.core.$strict>>;
309
+ trees: z.ZodOptional<z.ZodObject<{
310
+ x: z.ZodOptional<z.ZodObject<{
311
+ parent: z.ZodString;
312
+ child: z.ZodString;
313
+ height: z.ZodString;
314
+ binding: z.ZodObject<{
315
+ format: z.ZodOptional<z.ZodString>;
316
+ kind: z.ZodLiteral<"artifact-table">;
317
+ path: z.ZodString;
318
+ unit: z.ZodOptional<z.ZodString>;
319
+ rowBound: z.ZodOptional<z.ZodObject<{
320
+ column: z.ZodString;
321
+ count: z.ZodNumber;
322
+ order: z.ZodOptional<z.ZodEnum<{
323
+ asc: "asc";
324
+ desc: "desc";
325
+ }>>;
326
+ }, z.core.$strict>>;
327
+ columns: z.ZodOptional<z.ZodArray<z.ZodString>>;
328
+ columnMeanings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<{
329
+ count: "count";
330
+ identifier: "identifier";
331
+ category: "category";
332
+ "p-value": "p-value";
333
+ effect: "effect";
334
+ }>>>;
335
+ columnLabels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
336
+ run: z.ZodOptional<z.ZodString>;
337
+ snapshot: z.ZodOptional<z.ZodString>;
338
+ }, z.core.$strict>;
339
+ }, z.core.$strict>>;
340
+ y: z.ZodOptional<z.ZodObject<{
341
+ parent: z.ZodString;
342
+ child: z.ZodString;
343
+ height: z.ZodString;
344
+ binding: z.ZodObject<{
345
+ format: z.ZodOptional<z.ZodString>;
346
+ kind: z.ZodLiteral<"artifact-table">;
347
+ path: z.ZodString;
348
+ unit: z.ZodOptional<z.ZodString>;
349
+ rowBound: z.ZodOptional<z.ZodObject<{
350
+ column: z.ZodString;
351
+ count: z.ZodNumber;
352
+ order: z.ZodOptional<z.ZodEnum<{
353
+ asc: "asc";
354
+ desc: "desc";
355
+ }>>;
356
+ }, z.core.$strict>>;
357
+ columns: z.ZodOptional<z.ZodArray<z.ZodString>>;
358
+ columnMeanings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<{
359
+ count: "count";
360
+ identifier: "identifier";
361
+ category: "category";
362
+ "p-value": "p-value";
363
+ effect: "effect";
364
+ }>>>;
365
+ columnLabels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
366
+ run: z.ZodOptional<z.ZodString>;
367
+ snapshot: z.ZodOptional<z.ZodString>;
368
+ }, z.core.$strict>;
369
+ }, z.core.$strict>>;
370
+ }, z.core.$strict>>;
254
371
  kind: z.ZodLiteral<"chart">;
255
372
  id: z.ZodString;
256
373
  title: z.ZodOptional<z.ZodString>;
@@ -262,49 +379,240 @@ declare const AUTHORING_ATOM_SCHEMAS: readonly [z.ZodObject<{
262
379
  box: "box";
263
380
  heatmap: "heatmap";
264
381
  pie: "pie";
382
+ violin: "violin";
383
+ "stacked-bar": "stacked-bar";
384
+ "normalized-bar": "normalized-bar";
385
+ radar: "radar";
265
386
  volcano: "volcano";
266
387
  manhattan: "manhattan";
267
388
  ma: "ma";
268
389
  km: "km";
390
+ pca: "pca";
391
+ embedding: "embedding";
392
+ dotplot: "dotplot";
393
+ forest: "forest";
394
+ roc: "roc";
395
+ qq: "qq";
396
+ gsea: "gsea";
397
+ oncoprint: "oncoprint";
398
+ lollipop: "lollipop";
399
+ upset: "upset";
400
+ sankey: "sankey";
401
+ locuszoom: "locuszoom";
269
402
  }>>;
270
403
  encoding: z.ZodOptional<z.ZodObject<{
271
404
  x: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
272
405
  column: z.ZodString;
273
- transform: z.ZodEnum<{
406
+ transform: z.ZodOptional<z.ZodEnum<{
274
407
  log10: "log10";
275
408
  neg_log10: "neg_log10";
276
409
  abs: "abs";
277
410
  rank: "rank";
278
- }>;
411
+ }>>;
412
+ orderBy: z.ZodOptional<z.ZodString>;
413
+ order: z.ZodOptional<z.ZodEnum<{
414
+ asc: "asc";
415
+ desc: "desc";
416
+ }>>;
279
417
  }, z.core.$strict>]>>;
280
418
  y: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
281
419
  column: z.ZodString;
282
- transform: z.ZodEnum<{
420
+ transform: z.ZodOptional<z.ZodEnum<{
283
421
  log10: "log10";
284
422
  neg_log10: "neg_log10";
285
423
  abs: "abs";
286
424
  rank: "rank";
287
- }>;
425
+ }>>;
426
+ orderBy: z.ZodOptional<z.ZodString>;
427
+ order: z.ZodOptional<z.ZodEnum<{
428
+ asc: "asc";
429
+ desc: "desc";
430
+ }>>;
288
431
  }, z.core.$strict>]>>;
289
432
  group: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
290
433
  column: z.ZodString;
291
- transform: z.ZodEnum<{
434
+ transform: z.ZodOptional<z.ZodEnum<{
292
435
  log10: "log10";
293
436
  neg_log10: "neg_log10";
294
437
  abs: "abs";
295
438
  rank: "rank";
296
- }>;
439
+ }>>;
440
+ orderBy: z.ZodOptional<z.ZodString>;
441
+ order: z.ZodOptional<z.ZodEnum<{
442
+ asc: "asc";
443
+ desc: "desc";
444
+ }>>;
297
445
  }, z.core.$strict>]>>;
298
446
  value: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
299
447
  column: z.ZodString;
300
- transform: z.ZodEnum<{
448
+ transform: z.ZodOptional<z.ZodEnum<{
301
449
  log10: "log10";
302
450
  neg_log10: "neg_log10";
303
451
  abs: "abs";
304
452
  rank: "rank";
305
- }>;
453
+ }>>;
454
+ orderBy: z.ZodOptional<z.ZodString>;
455
+ order: z.ZodOptional<z.ZodEnum<{
456
+ asc: "asc";
457
+ desc: "desc";
458
+ }>>;
306
459
  }, z.core.$strict>]>>;
307
460
  label: z.ZodOptional<z.ZodString>;
461
+ color: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
462
+ column: z.ZodString;
463
+ transform: z.ZodOptional<z.ZodEnum<{
464
+ log10: "log10";
465
+ neg_log10: "neg_log10";
466
+ abs: "abs";
467
+ rank: "rank";
468
+ }>>;
469
+ orderBy: z.ZodOptional<z.ZodString>;
470
+ order: z.ZodOptional<z.ZodEnum<{
471
+ asc: "asc";
472
+ desc: "desc";
473
+ }>>;
474
+ }, z.core.$strict>]>>;
475
+ size: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
476
+ column: z.ZodString;
477
+ transform: z.ZodOptional<z.ZodEnum<{
478
+ log10: "log10";
479
+ neg_log10: "neg_log10";
480
+ abs: "abs";
481
+ rank: "rank";
482
+ }>>;
483
+ orderBy: z.ZodOptional<z.ZodString>;
484
+ order: z.ZodOptional<z.ZodEnum<{
485
+ asc: "asc";
486
+ desc: "desc";
487
+ }>>;
488
+ }, z.core.$strict>]>>;
489
+ low: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
490
+ column: z.ZodString;
491
+ transform: z.ZodOptional<z.ZodEnum<{
492
+ log10: "log10";
493
+ neg_log10: "neg_log10";
494
+ abs: "abs";
495
+ rank: "rank";
496
+ }>>;
497
+ orderBy: z.ZodOptional<z.ZodString>;
498
+ order: z.ZodOptional<z.ZodEnum<{
499
+ asc: "asc";
500
+ desc: "desc";
501
+ }>>;
502
+ }, z.core.$strict>]>>;
503
+ high: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
504
+ column: z.ZodString;
505
+ transform: z.ZodOptional<z.ZodEnum<{
506
+ log10: "log10";
507
+ neg_log10: "neg_log10";
508
+ abs: "abs";
509
+ rank: "rank";
510
+ }>>;
511
+ orderBy: z.ZodOptional<z.ZodString>;
512
+ order: z.ZodOptional<z.ZodEnum<{
513
+ asc: "asc";
514
+ desc: "desc";
515
+ }>>;
516
+ }, z.core.$strict>]>>;
517
+ facet: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
518
+ column: z.ZodString;
519
+ transform: z.ZodOptional<z.ZodEnum<{
520
+ log10: "log10";
521
+ neg_log10: "neg_log10";
522
+ abs: "abs";
523
+ rank: "rank";
524
+ }>>;
525
+ orderBy: z.ZodOptional<z.ZodString>;
526
+ order: z.ZodOptional<z.ZodEnum<{
527
+ asc: "asc";
528
+ desc: "desc";
529
+ }>>;
530
+ }, z.core.$strict>]>>;
531
+ shape: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
532
+ column: z.ZodString;
533
+ transform: z.ZodOptional<z.ZodEnum<{
534
+ log10: "log10";
535
+ neg_log10: "neg_log10";
536
+ abs: "abs";
537
+ rank: "rank";
538
+ }>>;
539
+ orderBy: z.ZodOptional<z.ZodString>;
540
+ order: z.ZodOptional<z.ZodEnum<{
541
+ asc: "asc";
542
+ desc: "desc";
543
+ }>>;
544
+ }, z.core.$strict>]>>;
545
+ p: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
546
+ column: z.ZodString;
547
+ transform: z.ZodOptional<z.ZodEnum<{
548
+ log10: "log10";
549
+ neg_log10: "neg_log10";
550
+ abs: "abs";
551
+ rank: "rank";
552
+ }>>;
553
+ orderBy: z.ZodOptional<z.ZodString>;
554
+ order: z.ZodOptional<z.ZodEnum<{
555
+ asc: "asc";
556
+ desc: "desc";
557
+ }>>;
558
+ }, z.core.$strict>]>>;
559
+ censor: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
560
+ column: z.ZodString;
561
+ transform: z.ZodOptional<z.ZodEnum<{
562
+ log10: "log10";
563
+ neg_log10: "neg_log10";
564
+ abs: "abs";
565
+ rank: "rank";
566
+ }>>;
567
+ orderBy: z.ZodOptional<z.ZodString>;
568
+ order: z.ZodOptional<z.ZodEnum<{
569
+ asc: "asc";
570
+ desc: "desc";
571
+ }>>;
572
+ }, z.core.$strict>]>>;
573
+ risk: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
574
+ column: z.ZodString;
575
+ transform: z.ZodOptional<z.ZodEnum<{
576
+ log10: "log10";
577
+ neg_log10: "neg_log10";
578
+ abs: "abs";
579
+ rank: "rank";
580
+ }>>;
581
+ orderBy: z.ZodOptional<z.ZodString>;
582
+ order: z.ZodOptional<z.ZodEnum<{
583
+ asc: "asc";
584
+ desc: "desc";
585
+ }>>;
586
+ }, z.core.$strict>]>>;
587
+ hit: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
588
+ column: z.ZodString;
589
+ transform: z.ZodOptional<z.ZodEnum<{
590
+ log10: "log10";
591
+ neg_log10: "neg_log10";
592
+ abs: "abs";
593
+ rank: "rank";
594
+ }>>;
595
+ orderBy: z.ZodOptional<z.ZodString>;
596
+ order: z.ZodOptional<z.ZodEnum<{
597
+ asc: "asc";
598
+ desc: "desc";
599
+ }>>;
600
+ }, z.core.$strict>]>>;
601
+ metric: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
602
+ column: z.ZodString;
603
+ transform: z.ZodOptional<z.ZodEnum<{
604
+ log10: "log10";
605
+ neg_log10: "neg_log10";
606
+ abs: "abs";
607
+ rank: "rank";
608
+ }>>;
609
+ orderBy: z.ZodOptional<z.ZodString>;
610
+ order: z.ZodOptional<z.ZodEnum<{
611
+ asc: "asc";
612
+ desc: "desc";
613
+ }>>;
614
+ }, z.core.$strict>]>>;
615
+ tracks: z.ZodOptional<z.ZodArray<z.ZodString>>;
308
616
  }, z.core.$strict>>;
309
617
  orientation: z.ZodOptional<z.ZodEnum<{
310
618
  vertical: "vertical";
@@ -312,7 +620,7 @@ declare const AUTHORING_ATOM_SCHEMAS: readonly [z.ZodObject<{
312
620
  }>>;
313
621
  thresholds: z.ZodOptional<z.ZodObject<{
314
622
  significance: z.ZodNumber;
315
- effect: z.ZodNumber;
623
+ effect: z.ZodOptional<z.ZodNumber>;
316
624
  }, z.core.$strict>>;
317
625
  composition: z.ZodOptional<z.ZodObject<{
318
626
  series: z.ZodArray<z.ZodObject<{
@@ -326,41 +634,117 @@ declare const AUTHORING_ATOM_SCHEMAS: readonly [z.ZodObject<{
326
634
  encoding: z.ZodObject<{
327
635
  x: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
328
636
  column: z.ZodString;
329
- transform: z.ZodEnum<{
637
+ transform: z.ZodOptional<z.ZodEnum<{
330
638
  log10: "log10";
331
639
  neg_log10: "neg_log10";
332
640
  abs: "abs";
333
641
  rank: "rank";
334
- }>;
642
+ }>>;
643
+ orderBy: z.ZodOptional<z.ZodString>;
644
+ order: z.ZodOptional<z.ZodEnum<{
645
+ asc: "asc";
646
+ desc: "desc";
647
+ }>>;
335
648
  }, z.core.$strict>]>;
336
649
  y: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
337
650
  column: z.ZodString;
338
- transform: z.ZodEnum<{
651
+ transform: z.ZodOptional<z.ZodEnum<{
339
652
  log10: "log10";
340
653
  neg_log10: "neg_log10";
341
654
  abs: "abs";
342
655
  rank: "rank";
343
- }>;
656
+ }>>;
657
+ orderBy: z.ZodOptional<z.ZodString>;
658
+ order: z.ZodOptional<z.ZodEnum<{
659
+ asc: "asc";
660
+ desc: "desc";
661
+ }>>;
344
662
  }, z.core.$strict>]>;
345
663
  y0: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
346
664
  column: z.ZodString;
347
- transform: z.ZodEnum<{
665
+ transform: z.ZodOptional<z.ZodEnum<{
348
666
  log10: "log10";
349
667
  neg_log10: "neg_log10";
350
668
  abs: "abs";
351
669
  rank: "rank";
352
- }>;
670
+ }>>;
671
+ orderBy: z.ZodOptional<z.ZodString>;
672
+ order: z.ZodOptional<z.ZodEnum<{
673
+ asc: "asc";
674
+ desc: "desc";
675
+ }>>;
353
676
  }, z.core.$strict>]>>;
354
677
  group: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
355
678
  column: z.ZodString;
356
- transform: z.ZodEnum<{
679
+ transform: z.ZodOptional<z.ZodEnum<{
357
680
  log10: "log10";
358
681
  neg_log10: "neg_log10";
359
682
  abs: "abs";
360
683
  rank: "rank";
361
- }>;
684
+ }>>;
685
+ orderBy: z.ZodOptional<z.ZodString>;
686
+ order: z.ZodOptional<z.ZodEnum<{
687
+ asc: "asc";
688
+ desc: "desc";
689
+ }>>;
362
690
  }, z.core.$strict>]>>;
363
691
  label: z.ZodOptional<z.ZodString>;
692
+ color: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
693
+ column: z.ZodString;
694
+ transform: z.ZodOptional<z.ZodEnum<{
695
+ log10: "log10";
696
+ neg_log10: "neg_log10";
697
+ abs: "abs";
698
+ rank: "rank";
699
+ }>>;
700
+ orderBy: z.ZodOptional<z.ZodString>;
701
+ order: z.ZodOptional<z.ZodEnum<{
702
+ asc: "asc";
703
+ desc: "desc";
704
+ }>>;
705
+ }, z.core.$strict>]>>;
706
+ size: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
707
+ column: z.ZodString;
708
+ transform: z.ZodOptional<z.ZodEnum<{
709
+ log10: "log10";
710
+ neg_log10: "neg_log10";
711
+ abs: "abs";
712
+ rank: "rank";
713
+ }>>;
714
+ orderBy: z.ZodOptional<z.ZodString>;
715
+ order: z.ZodOptional<z.ZodEnum<{
716
+ asc: "asc";
717
+ desc: "desc";
718
+ }>>;
719
+ }, z.core.$strict>]>>;
720
+ low: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
721
+ column: z.ZodString;
722
+ transform: z.ZodOptional<z.ZodEnum<{
723
+ log10: "log10";
724
+ neg_log10: "neg_log10";
725
+ abs: "abs";
726
+ rank: "rank";
727
+ }>>;
728
+ orderBy: z.ZodOptional<z.ZodString>;
729
+ order: z.ZodOptional<z.ZodEnum<{
730
+ asc: "asc";
731
+ desc: "desc";
732
+ }>>;
733
+ }, z.core.$strict>]>>;
734
+ high: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
735
+ column: z.ZodString;
736
+ transform: z.ZodOptional<z.ZodEnum<{
737
+ log10: "log10";
738
+ neg_log10: "neg_log10";
739
+ abs: "abs";
740
+ rank: "rank";
741
+ }>>;
742
+ orderBy: z.ZodOptional<z.ZodString>;
743
+ order: z.ZodOptional<z.ZodEnum<{
744
+ asc: "asc";
745
+ desc: "desc";
746
+ }>>;
747
+ }, z.core.$strict>]>>;
364
748
  }, z.core.$strict>;
365
749
  name: z.ZodOptional<z.ZodString>;
366
750
  orientation: z.ZodOptional<z.ZodEnum<{
@@ -410,7 +794,22 @@ declare const AUTHORING_ATOM_SCHEMAS: readonly [z.ZodObject<{
410
794
  }>>;
411
795
  }, z.core.$strict>>;
412
796
  }, z.core.$strict>>;
797
+ facet: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
798
+ column: z.ZodString;
799
+ transform: z.ZodOptional<z.ZodEnum<{
800
+ log10: "log10";
801
+ neg_log10: "neg_log10";
802
+ abs: "abs";
803
+ rank: "rank";
804
+ }>>;
805
+ orderBy: z.ZodOptional<z.ZodString>;
806
+ order: z.ZodOptional<z.ZodEnum<{
807
+ asc: "asc";
808
+ desc: "desc";
809
+ }>>;
810
+ }, z.core.$strict>]>>;
413
811
  }, z.core.$strict>>;
812
+ focus: z.ZodOptional<z.ZodArray<z.ZodString>>;
414
813
  caption: z.ZodOptional<z.ZodString>;
415
814
  }, z.core.$strict>, z.ZodObject<{
416
815
  kind: z.ZodLiteral<"figure">;
@@ -14,7 +14,7 @@
14
14
  * payload, thus the grounding and the resolution read the same pin as before.
15
15
  */
16
16
  import { z } from "zod";
17
- import { ChartBlockSchema, CitationBlockSchema, ClaimBlockSchema, FigureBlockSchema, MetricBlockSchema, TableBlockSchema, TextBlockSchema, } from "../contracts/report-blocks.js";
17
+ import { ChartBlockSchema, ChartStatisticSchema, ChartTrackSchema, ChartTreeSchema, CitationBlockSchema, ClaimBlockSchema, FigureBlockSchema, MetricBlockSchema, TableBlockSchema, TextBlockSchema, } from "../contracts/report-blocks.js";
18
18
  import { ArtifactFileReferenceSchema, ArtifactTableReferenceSchema, ArtifactValueReferenceSchema, CitationReferenceSchema, DerivationReferenceSchema, } from "../contracts/report-reference.js";
19
19
  /** A reference to one scalar value inside an artifact, by the path of the artifact and a locator. */
20
20
  const AuthoringValueReferenceSchema = ArtifactValueReferenceSchema.omit({ hash: true });
@@ -39,17 +39,38 @@ const AuthoringReferenceSchema = z.discriminatedUnion("kind", [
39
39
  ]);
40
40
  /** The references of the authoring surface that resolve to one scalar value. */
41
41
  const AuthoringScalarReferenceSchema = z.discriminatedUnion("kind", [AuthoringValueReferenceSchema, AuthoringDerivationReferenceSchema]);
42
+ /** The tree of one heatmap axis on the authoring surface: the contract tree with an authoring binding. */
43
+ function authoringTree() {
44
+ return ChartTreeSchema.extend({ binding: AuthoringTableReferenceSchema.describe(ChartTreeSchema.shape.binding.description ?? "") });
45
+ }
42
46
  /**
43
47
  * The chart block of the authoring surface.
44
48
  *
45
49
  * A chart carries a rule over its own fields, and a schema with a rule refuses a replacement of one field.
46
- * Thus this schema spreads the fields of the contract chart, and it replaces the binding. The rule itself
47
- * stays out: the core parses each payload with the draft grammar, and that grammar carries the rule. This
48
- * schema publishes the shape, and it types the read.
50
+ * Thus this schema spreads the fields of the contract chart, and it replaces each field that carries a pin:
51
+ * the binding, the value of each statistic, the binding of the track, and the binding of each tree. The rule itself stays out: the core
52
+ * parses each payload with the draft grammar, and that grammar carries the rule. This schema publishes the
53
+ * shape, and it types the read.
49
54
  */
50
55
  const AuthoringChartBlockSchema = z.strictObject({
51
56
  ...ChartBlockSchema.shape,
52
57
  binding: AuthoringTableReferenceSchema.describe("The whole-table artifact to plot."),
58
+ statistics: z
59
+ .array(ChartStatisticSchema.extend({ value: AuthoringValueReferenceSchema.describe(ChartStatisticSchema.shape.value.description ?? "") }))
60
+ .min(1)
61
+ .max(4)
62
+ .optional()
63
+ .describe(ChartBlockSchema.shape.statistics.description ?? ""),
64
+ track: ChartTrackSchema.extend({ binding: AuthoringTableReferenceSchema.describe(ChartTrackSchema.shape.binding.description ?? "") })
65
+ .optional()
66
+ .describe(ChartBlockSchema.shape.track.description ?? ""),
67
+ trees: z
68
+ .strictObject({
69
+ x: authoringTree().optional().describe("The tree of the `x` categories. It draws above the matrix and above the tracks."),
70
+ y: authoringTree().optional().describe("The tree of the `y` categories. It draws at the left of the row names."),
71
+ })
72
+ .optional()
73
+ .describe(ChartBlockSchema.shape.trees.description ?? ""),
53
74
  });
54
75
  /**
55
76
  * The seven atoms of the authoring surface.