@inflexa-ai/harness 0.35.8 → 0.36.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.
- package/dist/auth/types.d.ts +5 -14
- package/dist/auth/types.js +3 -10
- package/dist/billing/usage-recorder.d.ts +1 -1
- package/dist/contracts/analogy-report.d.ts +1 -1
- package/dist/contracts/analogy-report.js +1 -1
- package/dist/contracts/chat-parts.d.ts +2 -3
- package/dist/contracts/index.d.ts +0 -4
- package/dist/contracts/index.js +0 -2
- package/dist/index.d.ts +0 -7
- package/dist/index.js +0 -21
- package/dist/lib/metrics.d.ts +1 -1
- package/dist/lib/otel-spans.d.ts +0 -2
- package/dist/lib/otel-spans.js +0 -2
- package/dist/loop/run-agent.d.ts +1 -1
- package/dist/runtime/assemble.d.ts +0 -3
- package/dist/runtime/assemble.js +0 -3
- package/dist/state/index.d.ts +0 -2
- package/dist/state/index.js +0 -1
- package/dist/state/init.js +1 -60
- package/dist/state/purge-analysis.d.ts +1 -2
- package/dist/state/purge-analysis.js +1 -2
- package/dist/tasks/regulatory-corpus-boot-refresh.js +1 -1
- package/dist/tools/bio/gene-preclinical-profile.d.ts +1 -3
- package/dist/tools/bio/gene-preclinical-profile.js +1 -3
- package/dist/tools/lib/chembl-client.d.ts +1 -4
- package/dist/tools/lib/chembl-client.js +1 -4
- package/dist/tools/lib/clinical-benchmarks-client.d.ts +1 -1
- package/dist/tools/lib/clinical-benchmarks-client.js +1 -1
- package/dist/tools/lib/clinical-trials-client.d.ts +0 -3
- package/dist/tools/lib/clinical-trials-client.js +0 -3
- package/dist/tools/lib/identifier-resolver.d.ts +5 -7
- package/dist/tools/lib/identifier-resolver.js +5 -7
- package/dist/tools/lib/iuphar-client.d.ts +1 -3
- package/dist/tools/lib/iuphar-client.js +1 -3
- package/dist/tools/lib/opentargets-client.d.ts +1 -1
- package/dist/tools/lib/opentargets-client.js +1 -1
- package/dist/tools/lib/protein-family-normalize.d.ts +5 -7
- package/dist/tools/lib/protein-family-normalize.js +5 -7
- package/dist/tools/lib/uniprot-client.d.ts +0 -7
- package/dist/tools/lib/uniprot-client.js +2 -9
- package/package.json +1 -1
- package/dist/contracts/target-assessment-row.d.ts +0 -85
- package/dist/contracts/target-assessment-row.js +0 -37
- package/dist/contracts/target-dossier.d.ts +0 -12423
- package/dist/contracts/target-dossier.js +0 -1282
- package/dist/prompts/target-assessment/briefs/executive-recommendation.d.ts +0 -1
- package/dist/prompts/target-assessment/briefs/executive-recommendation.js +0 -85
- package/dist/prompts/target-assessment/briefs/index.d.ts +0 -4
- package/dist/prompts/target-assessment/briefs/index.js +0 -4
- package/dist/prompts/target-assessment/briefs/liability-bullets.d.ts +0 -1
- package/dist/prompts/target-assessment/briefs/liability-bullets.js +0 -114
- package/dist/prompts/target-assessment/briefs/target-organ-liabilities.d.ts +0 -1
- package/dist/prompts/target-assessment/briefs/target-organ-liabilities.js +0 -37
- package/dist/prompts/target-assessment/briefs/translational-commentary.d.ts +0 -1
- package/dist/prompts/target-assessment/briefs/translational-commentary.js +0 -23
- package/dist/prompts/target-assessment/drugs-in-class.d.ts +0 -1
- package/dist/prompts/target-assessment/drugs-in-class.js +0 -29
- package/dist/prompts/target-assessment/investigation/adversarial-critique.d.ts +0 -1
- package/dist/prompts/target-assessment/investigation/adversarial-critique.js +0 -67
- package/dist/prompts/target-assessment/investigation/claim-reverification.d.ts +0 -1
- package/dist/prompts/target-assessment/investigation/claim-reverification.js +0 -49
- package/dist/prompts/target-assessment/investigation/index.d.ts +0 -3
- package/dist/prompts/target-assessment/investigation/index.js +0 -3
- package/dist/prompts/target-assessment/investigation/mechanism-proposal.d.ts +0 -1
- package/dist/prompts/target-assessment/investigation/mechanism-proposal.js +0 -49
- package/dist/prompts/target-assessment/modulator-triage.d.ts +0 -1
- package/dist/prompts/target-assessment/modulator-triage.js +0 -31
- package/dist/prompts/target-assessment/off-target-annotator.d.ts +0 -1
- package/dist/prompts/target-assessment/off-target-annotator.js +0 -28
- package/dist/prompts/target-assessment/tox-voice/core.d.ts +0 -1
- package/dist/prompts/target-assessment/tox-voice/core.js +0 -74
- package/dist/prompts/target-assessment/tox-voice/critique.d.ts +0 -7
- package/dist/prompts/target-assessment/tox-voice/critique.js +0 -109
- package/dist/prompts/target-assessment/tox-voice/exemplars.d.ts +0 -8
- package/dist/prompts/target-assessment/tox-voice/exemplars.js +0 -24
- package/dist/prompts/target-assessment/tox-voice/index.d.ts +0 -4
- package/dist/prompts/target-assessment/tox-voice/index.js +0 -4
- package/dist/prompts/target-assessment/tox-voice/vocabulary.d.ts +0 -18
- package/dist/prompts/target-assessment/tox-voice/vocabulary.js +0 -61
- package/dist/state/target-assessments.d.ts +0 -68
- package/dist/state/target-assessments.js +0 -222
- package/dist/workflows/execute-target-assessment.d.ts +0 -118
- package/dist/workflows/execute-target-assessment.js +0 -631
- package/dist/workflows/target-assessment/assemblers/index.d.ts +0 -5
- package/dist/workflows/target-assessment/assemblers/index.js +0 -4
- package/dist/workflows/target-assessment/assemblers/literature.d.ts +0 -281
- package/dist/workflows/target-assessment/assemblers/literature.js +0 -971
- package/dist/workflows/target-assessment/assemblers/orchestrator.d.ts +0 -118
- package/dist/workflows/target-assessment/assemblers/orchestrator.js +0 -945
- package/dist/workflows/target-assessment/assemblers/safety.d.ts +0 -374
- package/dist/workflows/target-assessment/assemblers/safety.js +0 -1068
- package/dist/workflows/target-assessment/assemblers/trials.d.ts +0 -30
- package/dist/workflows/target-assessment/assemblers/trials.js +0 -75
- package/dist/workflows/target-assessment/collectors/index.d.ts +0 -114
- package/dist/workflows/target-assessment/collectors/index.js +0 -538
- package/dist/workflows/target-assessment/coverage.d.ts +0 -97
- package/dist/workflows/target-assessment/coverage.js +0 -86
- package/dist/workflows/target-assessment/decisions/index.d.ts +0 -86
- package/dist/workflows/target-assessment/decisions/index.js +0 -127
- package/dist/workflows/target-assessment/fanout/index.d.ts +0 -32
- package/dist/workflows/target-assessment/fanout/index.js +0 -156
- package/dist/workflows/target-assessment/investigation/index.d.ts +0 -97
- package/dist/workflows/target-assessment/investigation/index.js +0 -419
- package/dist/workflows/target-assessment/lib/approval-precedents.d.ts +0 -73
- package/dist/workflows/target-assessment/lib/approval-precedents.js +0 -185
- package/dist/workflows/target-assessment/lib/citation-validator.d.ts +0 -46
- package/dist/workflows/target-assessment/lib/citation-validator.js +0 -316
- package/dist/workflows/target-assessment/lib/clinical-consequence-annotator.d.ts +0 -65
- package/dist/workflows/target-assessment/lib/clinical-consequence-annotator.js +0 -174
- package/dist/workflows/target-assessment/lib/clinical-evidence-attribution.d.ts +0 -44
- package/dist/workflows/target-assessment/lib/clinical-evidence-attribution.js +0 -152
- package/dist/workflows/target-assessment/lib/compute-derived.d.ts +0 -20
- package/dist/workflows/target-assessment/lib/compute-derived.js +0 -261
- package/dist/workflows/target-assessment/lib/compute-selectivity.d.ts +0 -15
- package/dist/workflows/target-assessment/lib/compute-selectivity.js +0 -18
- package/dist/workflows/target-assessment/lib/dedup-modulators.d.ts +0 -37
- package/dist/workflows/target-assessment/lib/dedup-modulators.js +0 -157
- package/dist/workflows/target-assessment/lib/evidence-conflict-detector.d.ts +0 -17
- package/dist/workflows/target-assessment/lib/evidence-conflict-detector.js +0 -100
- package/dist/workflows/target-assessment/lib/expression-constants.d.ts +0 -21
- package/dist/workflows/target-assessment/lib/expression-constants.js +0 -21
- package/dist/workflows/target-assessment/lib/family-complex-supplement.d.ts +0 -20
- package/dist/workflows/target-assessment/lib/family-complex-supplement.js +0 -36
- package/dist/workflows/target-assessment/lib/fda-label-safety.d.ts +0 -72
- package/dist/workflows/target-assessment/lib/fda-label-safety.js +0 -166
- package/dist/workflows/target-assessment/lib/heterodimer-filter.d.ts +0 -30
- package/dist/workflows/target-assessment/lib/heterodimer-filter.js +0 -44
- package/dist/workflows/target-assessment/lib/hpo-organ-map.d.ts +0 -34
- package/dist/workflows/target-assessment/lib/hpo-organ-map.js +0 -63
- package/dist/workflows/target-assessment/lib/impc-organ-map.d.ts +0 -19
- package/dist/workflows/target-assessment/lib/impc-organ-map.js +0 -39
- package/dist/workflows/target-assessment/lib/intended-polypharm-filter.d.ts +0 -4
- package/dist/workflows/target-assessment/lib/intended-polypharm-filter.js +0 -24
- package/dist/workflows/target-assessment/lib/llm-step.d.ts +0 -80
- package/dist/workflows/target-assessment/lib/llm-step.js +0 -101
- package/dist/workflows/target-assessment/lib/meddra-organ-map.d.ts +0 -40
- package/dist/workflows/target-assessment/lib/meddra-organ-map.js +0 -138
- package/dist/workflows/target-assessment/lib/recommendation-quality-gates.d.ts +0 -17
- package/dist/workflows/target-assessment/lib/recommendation-quality-gates.js +0 -99
- package/dist/workflows/target-assessment/lib/recommendation-sanitizer.d.ts +0 -2
- package/dist/workflows/target-assessment/lib/recommendation-sanitizer.js +0 -51
- package/dist/workflows/target-assessment/lib/regulatory-actions.d.ts +0 -25
- package/dist/workflows/target-assessment/lib/regulatory-actions.js +0 -176
- package/dist/workflows/target-assessment/lib/safety-corroboration.d.ts +0 -44
- package/dist/workflows/target-assessment/lib/safety-corroboration.js +0 -273
- package/dist/workflows/target-assessment/lib/structured-llm.d.ts +0 -61
- package/dist/workflows/target-assessment/lib/structured-llm.js +0 -102
- package/dist/workflows/target-assessment/lib/target-identity-filter.d.ts +0 -59
- package/dist/workflows/target-assessment/lib/target-identity-filter.js +0 -95
- package/dist/workflows/target-assessment/lib/therapeutic-programs.d.ts +0 -20
- package/dist/workflows/target-assessment/lib/therapeutic-programs.js +0 -68
- package/dist/workflows/target-assessment/metrics.d.ts +0 -16
- package/dist/workflows/target-assessment/metrics.js +0 -30
- package/dist/workflows/target-assessment/phase4-assemble.d.ts +0 -3182
- package/dist/workflows/target-assessment/phase4-assemble.js +0 -39
- package/dist/workflows/target-assessment/phase5-persist.d.ts +0 -59
- package/dist/workflows/target-assessment/phase5-persist.js +0 -349
- package/dist/workflows/target-assessment/progress-stream.d.ts +0 -75
- package/dist/workflows/target-assessment/progress-stream.js +0 -110
- package/dist/workflows/target-assessment/progress.d.ts +0 -39
- package/dist/workflows/target-assessment/progress.js +0 -77
- package/dist/workflows/target-assessment/schemas.d.ts +0 -970
- package/dist/workflows/target-assessment/schemas.js +0 -318
- package/dist/workflows/target-assessment/steps/collectors/pathways.d.ts +0 -15
- package/dist/workflows/target-assessment/steps/collectors/pathways.js +0 -58
- package/dist/workflows/target-assessment/steps/fanout/aes-for-one-class-drug-step.d.ts +0 -34
- package/dist/workflows/target-assessment/steps/fanout/aes-for-one-class-drug-step.js +0 -31
- package/dist/workflows/target-assessment/steps/fanout/aes-for-one-trial-step.d.ts +0 -57
- package/dist/workflows/target-assessment/steps/fanout/aes-for-one-trial-step.js +0 -54
- package/dist/workflows/target-assessment/steps/fanout/faers-for-one-modulator-step.d.ts +0 -35
- package/dist/workflows/target-assessment/steps/fanout/faers-for-one-modulator-step.js +0 -32
- package/dist/workflows/target-assessment/steps/fanout/index.d.ts +0 -14
- package/dist/workflows/target-assessment/steps/fanout/index.js +0 -10
- package/dist/workflows/target-assessment/steps/fanout/polypharm-for-one-modulator-step.d.ts +0 -29
- package/dist/workflows/target-assessment/steps/fanout/polypharm-for-one-modulator-step.js +0 -29
- package/dist/workflows/target-assessment/steps/phase2-aggregate.d.ts +0 -657
- package/dist/workflows/target-assessment/steps/phase2-aggregate.js +0 -34
- package/dist/workflows/target-assessment/steps/phase3-aggregate.d.ts +0 -806
- package/dist/workflows/target-assessment/steps/phase3-aggregate.js +0 -16
- package/dist/workflows/target-assessment/steps/synthesis/diagnostics.d.ts +0 -28
- package/dist/workflows/target-assessment/steps/synthesis/diagnostics.js +0 -27
- package/dist/workflows/target-assessment/sub-workflows/index.d.ts +0 -15
- package/dist/workflows/target-assessment/sub-workflows/index.js +0 -11
- package/dist/workflows/target-assessment/sub-workflows/per-class-drug-aes.d.ts +0 -41
- package/dist/workflows/target-assessment/sub-workflows/per-class-drug-aes.js +0 -12
- package/dist/workflows/target-assessment/sub-workflows/per-modulator-faers.d.ts +0 -41
- package/dist/workflows/target-assessment/sub-workflows/per-modulator-faers.js +0 -12
- package/dist/workflows/target-assessment/sub-workflows/per-modulator-polypharm.d.ts +0 -37
- package/dist/workflows/target-assessment/sub-workflows/per-modulator-polypharm.js +0 -12
- package/dist/workflows/target-assessment/sub-workflows/per-trial-aes.d.ts +0 -66
- package/dist/workflows/target-assessment/sub-workflows/per-trial-aes.js +0 -12
- package/dist/workflows/target-assessment/synthesis/index.d.ts +0 -607
- package/dist/workflows/target-assessment/synthesis/index.js +0 -354
- package/dist/workflows/target-assessment/synthesis-probes.d.ts +0 -56
- package/dist/workflows/target-assessment/synthesis-probes.js +0 -320
|
@@ -1,318 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared schemas for target-assessment workflow inter-step contracts.
|
|
3
|
-
*
|
|
4
|
-
* The workflow input/output schemas, the resolved-target shape used by
|
|
5
|
-
* every Phase-1 collector, and the keyed Phase-1/2/3 bundle shapes.
|
|
6
|
-
*/
|
|
7
|
-
import { z } from "zod";
|
|
8
|
-
import { EvidenceItemSchema } from "@inflexa-ai/harness/contracts/target-dossier.js";
|
|
9
|
-
import { withCoverage } from "./coverage.js";
|
|
10
|
-
export const TargetAssessmentInputSchema = z.object({
|
|
11
|
-
/** UUID of the target_assessments row already inserted by the trigger route. */
|
|
12
|
-
assessmentId: z.string().uuid(),
|
|
13
|
-
/** Free-form target identifier (gene symbol, alias, UniProt accession, ENSG, CHEMBL\d+). */
|
|
14
|
-
target: z.string().min(1),
|
|
15
|
-
/** Optional reviewer goal (carried into the dossier header). */
|
|
16
|
-
goal: z.string().nullable().optional(),
|
|
17
|
-
/** Organization id — used for scoping & billing. */
|
|
18
|
-
organizationId: z.string(),
|
|
19
|
-
/** Requesting user id (identity sub claim). */
|
|
20
|
-
requestedBy: z.string(),
|
|
21
|
-
});
|
|
22
|
-
export const ResolvedTargetSchema = z.object({
|
|
23
|
-
assessmentId: z.string().uuid(),
|
|
24
|
-
goal: z.string().nullable(),
|
|
25
|
-
canonicalId: z.string(),
|
|
26
|
-
canonicalOntology: z.enum(["hgnc", "ensembl"]),
|
|
27
|
-
geneSymbol: z.string(),
|
|
28
|
-
approvedName: z.string(),
|
|
29
|
-
ids: z.object({
|
|
30
|
-
hgnc: z.string().nullable(),
|
|
31
|
-
ensembl: z.string().nullable(),
|
|
32
|
-
uniprot: z.string().nullable(),
|
|
33
|
-
chembl: z.string().nullable(),
|
|
34
|
-
entrez: z.string().nullable(),
|
|
35
|
-
}),
|
|
36
|
-
synonyms: z.array(z.string()),
|
|
37
|
-
proteinSynonyms: z.array(z.string()),
|
|
38
|
-
proteinFamily: z.string().nullable(),
|
|
39
|
-
resolutionCoverage: z.object({
|
|
40
|
-
hgnc: z.boolean(),
|
|
41
|
-
uniprot: z.boolean(),
|
|
42
|
-
ensembl: z.boolean(),
|
|
43
|
-
chembl: z.boolean(),
|
|
44
|
-
}),
|
|
45
|
-
});
|
|
46
|
-
// ── Phase-1 collector output schemas ─────────────────────────────────
|
|
47
|
-
const AssociationSchema = z.object({
|
|
48
|
-
diseaseId: z.string(),
|
|
49
|
-
diseaseName: z.string(),
|
|
50
|
-
score: z.number(),
|
|
51
|
-
geneticAssociationScore: z.number().nullable(),
|
|
52
|
-
knownDrugScore: z.number().nullable(),
|
|
53
|
-
literatureScore: z.number().nullable(),
|
|
54
|
-
animalModelScore: z.number().nullable().default(null),
|
|
55
|
-
somaticMutationScore: z.number().nullable().default(null),
|
|
56
|
-
literaturePmids: z.array(z.string()).default([]),
|
|
57
|
-
});
|
|
58
|
-
export const OpenTargetsBundleSchema = z.object({
|
|
59
|
-
ensemblId: z.string(),
|
|
60
|
-
approvedSymbol: z.string(),
|
|
61
|
-
approvedName: z.string(),
|
|
62
|
-
tractability: z
|
|
63
|
-
.object({
|
|
64
|
-
smallMolecule: z.boolean().nullable(),
|
|
65
|
-
antibody: z.boolean().nullable(),
|
|
66
|
-
otherModalities: z.boolean().nullable(),
|
|
67
|
-
})
|
|
68
|
-
.nullable(),
|
|
69
|
-
associations: z.array(AssociationSchema),
|
|
70
|
-
safetyLiabilities: z.array(z.object({
|
|
71
|
-
event: z.string(),
|
|
72
|
-
biosamples: z.array(z.string()),
|
|
73
|
-
effects: z.string().nullable(),
|
|
74
|
-
source: z.string(),
|
|
75
|
-
})),
|
|
76
|
-
// One target carries rows of more than one datasource, and each datasource has
|
|
77
|
-
// its own unit. Thus `datasourceId` rides with the row, because a reader that
|
|
78
|
-
// compares two rows without it compares a TPM against a CPM. The
|
|
79
|
-
// `baselineExpression` surface carries no protein measurement, thus the bundle
|
|
80
|
-
// makes no protein claim.
|
|
81
|
-
baselineExpression: z.array(z.object({
|
|
82
|
-
tissueId: z.string(),
|
|
83
|
-
tissueLabel: z.string(),
|
|
84
|
-
organSystem: z.string().nullable(),
|
|
85
|
-
datasourceId: z.string(),
|
|
86
|
-
rna: z.object({ value: z.number(), unit: z.string() }).nullable(),
|
|
87
|
-
})),
|
|
88
|
-
});
|
|
89
|
-
export const ChemblModulatorsBundleSchema = z.object({
|
|
90
|
-
targetChemblId: z.string().nullable(),
|
|
91
|
-
modulators: z.array(z.object({
|
|
92
|
-
moleculeChemblId: z.string(),
|
|
93
|
-
parentChemblId: z.string().nullable(),
|
|
94
|
-
preferredName: z.string().nullable(),
|
|
95
|
-
maxPhase: z.number().nullable(),
|
|
96
|
-
moleculeType: z.string().nullable(),
|
|
97
|
-
firstApproval: z.number().nullable(),
|
|
98
|
-
/** Present only for entries discovered via the activity-table secondary path. */
|
|
99
|
-
evidence_source: z.literal("chembl_activity").optional(),
|
|
100
|
-
})),
|
|
101
|
-
});
|
|
102
|
-
export const CtgovInterventionSchema = z.object({
|
|
103
|
-
name: z.string(),
|
|
104
|
-
type: z.string().nullable(),
|
|
105
|
-
description: z.string().nullable(),
|
|
106
|
-
otherNames: z.array(z.string()),
|
|
107
|
-
});
|
|
108
|
-
export const CtgovTrialSchema = z.object({
|
|
109
|
-
nctId: z.string(),
|
|
110
|
-
title: z.string(),
|
|
111
|
-
officialTitle: z.string().nullable(),
|
|
112
|
-
status: z.string(),
|
|
113
|
-
phase: z.string().nullable(),
|
|
114
|
-
studyType: z.string().nullable(),
|
|
115
|
-
primaryPurpose: z.string().nullable(),
|
|
116
|
-
conditions: z.array(z.string()),
|
|
117
|
-
interventions: z.array(z.string()),
|
|
118
|
-
interventionDetails: z.array(CtgovInterventionSchema),
|
|
119
|
-
enrollmentCount: z.number().nullable(),
|
|
120
|
-
startDate: z.string().nullable(),
|
|
121
|
-
primaryCompletionDate: z.string().nullable(),
|
|
122
|
-
whyStopped: z.string().nullable(),
|
|
123
|
-
briefSummary: z.string().nullable(),
|
|
124
|
-
detailedDescription: z.string().nullable(),
|
|
125
|
-
sponsor: z.string().nullable(),
|
|
126
|
-
collection_query: z.string().optional(),
|
|
127
|
-
collection_channel: z.enum(["target_symbol", "class_modulator", "therapeutic_program", "biomarker_context", "failed_intervention"]).optional(),
|
|
128
|
-
});
|
|
129
|
-
export const CtgovBundleSchema = z.object({
|
|
130
|
-
active: z.array(CtgovTrialSchema),
|
|
131
|
-
failed: z.array(CtgovTrialSchema),
|
|
132
|
-
});
|
|
133
|
-
export const FaersByTargetBundleSchema = z.object({
|
|
134
|
-
drugProbed: z.string(),
|
|
135
|
-
totalReports: z.number().nullable(),
|
|
136
|
-
topReactions: z.array(z.object({ reaction: z.string(), count: z.number() })),
|
|
137
|
-
seriousness: z
|
|
138
|
-
.object({
|
|
139
|
-
totalReports: z.number(),
|
|
140
|
-
fatalCount: z.number(),
|
|
141
|
-
hospitalizationCount: z.number(),
|
|
142
|
-
lifeThreateningCount: z.number(),
|
|
143
|
-
disablingCount: z.number(),
|
|
144
|
-
congenitalAnomalyCount: z.number().default(0),
|
|
145
|
-
otherSeriousCount: z.number().default(0),
|
|
146
|
-
})
|
|
147
|
-
.nullable(),
|
|
148
|
-
});
|
|
149
|
-
// The rows come from the Open Targets `baselineExpression` surface, which carries
|
|
150
|
-
// no protein measurement. Thus a row states an RNA value only.
|
|
151
|
-
export const ExpressionHumanBundleSchema = z.object({
|
|
152
|
-
source: z.enum(["gtex", "hpa_consensus", "hpa_rna_tissue"]),
|
|
153
|
-
unit: z.enum(["tpm", "ntpm", "consensus_normalized"]),
|
|
154
|
-
normalization_notes: z.string().min(1),
|
|
155
|
-
tissues: z.array(z.object({
|
|
156
|
-
tissueLabel: z.string(),
|
|
157
|
-
organSystem: z.string().nullable(),
|
|
158
|
-
value: z.number().nullable(),
|
|
159
|
-
})),
|
|
160
|
-
});
|
|
161
|
-
export const ExpressionMultiSpeciesBundleSchema = z.object({
|
|
162
|
-
geneSymbol: z.string(),
|
|
163
|
-
humanEnsemblId: z.string().nullable(),
|
|
164
|
-
bySpecies: z.array(z.object({
|
|
165
|
-
species: z.string(),
|
|
166
|
-
taxonId: z.number(),
|
|
167
|
-
ensemblId: z.string(),
|
|
168
|
-
source: z.string(),
|
|
169
|
-
unit: z.string(),
|
|
170
|
-
normalization_notes: z.string(),
|
|
171
|
-
tissues: z.array(z.object({
|
|
172
|
-
tissue: z.string(),
|
|
173
|
-
rank: z.enum(["absent", "low", "medium", "high"]),
|
|
174
|
-
expressionScore: z.number().nullable(),
|
|
175
|
-
})),
|
|
176
|
-
})),
|
|
177
|
-
notFound: z.array(z.string()),
|
|
178
|
-
});
|
|
179
|
-
export const ClinvarBundleSchema = z.object({
|
|
180
|
-
totalFound: z.number(),
|
|
181
|
-
variants: z.array(z.object({
|
|
182
|
-
variationId: z.string(),
|
|
183
|
-
title: z.string(),
|
|
184
|
-
clinicalSignificance: z.string(),
|
|
185
|
-
reviewStatus: z.string(),
|
|
186
|
-
conditions: z.array(z.string()),
|
|
187
|
-
molecularConsequence: z.string(),
|
|
188
|
-
accession: z.string(),
|
|
189
|
-
})),
|
|
190
|
-
});
|
|
191
|
-
export const CbioportalBundleSchema = z.object({
|
|
192
|
-
entrezGeneId: z.number().nullable(),
|
|
193
|
-
rows: z.array(z.object({
|
|
194
|
-
cancerTypeId: z.string(),
|
|
195
|
-
cancerTypeName: z.string(),
|
|
196
|
-
totalSamples: z.number(),
|
|
197
|
-
mutatedSamples: z.number(),
|
|
198
|
-
frequency: z.number(),
|
|
199
|
-
studies: z.array(z.string()),
|
|
200
|
-
})),
|
|
201
|
-
});
|
|
202
|
-
export const ImpcBundleSchema = z.object({
|
|
203
|
-
mouseMarkerSymbol: z.string().nullable(),
|
|
204
|
-
mgiAccessionId: z.string().nullable(),
|
|
205
|
-
viability: z.enum(["lethal_pre_weaning", "subviable", "viable"]).nullable(),
|
|
206
|
-
viabilityCalls: z.array(z.object({
|
|
207
|
-
zygosity: z.string(),
|
|
208
|
-
parameterStableId: z.string(),
|
|
209
|
-
mpTerm: z.object({ id: z.string(), name: z.string() }).nullable(),
|
|
210
|
-
})),
|
|
211
|
-
mpTerms: z.array(z.object({ id: z.string(), term: z.string(), bestPValue: z.number().nullable() })),
|
|
212
|
-
organSystems: z.array(z.string()),
|
|
213
|
-
sexDimorphic: z.boolean(),
|
|
214
|
-
phenotypeCount: z.number(),
|
|
215
|
-
});
|
|
216
|
-
export const PubmedIndexBundleSchema = z.object({
|
|
217
|
-
totalFound: z.number(),
|
|
218
|
-
topPmids: z.array(z.string()),
|
|
219
|
-
results: z.array(z.object({
|
|
220
|
-
pmid: z.string(),
|
|
221
|
-
title: z.string(),
|
|
222
|
-
journal: z.string(),
|
|
223
|
-
year: z.string(),
|
|
224
|
-
authors: z.string(),
|
|
225
|
-
})),
|
|
226
|
-
});
|
|
227
|
-
export const PathwaysBundleSchema = z.object({
|
|
228
|
-
pathways: z.array(z.object({
|
|
229
|
-
id: z.string(),
|
|
230
|
-
name: z.string(),
|
|
231
|
-
source: z.enum(["kegg", "reactome"]),
|
|
232
|
-
url: z.string().optional(),
|
|
233
|
-
entity_uniprots: z.array(z.string()).optional(),
|
|
234
|
-
metadata: z.object({ species_present: z.array(z.string()).optional() }).optional(),
|
|
235
|
-
})),
|
|
236
|
-
});
|
|
237
|
-
export const StringPpiBundleSchema = z.object({
|
|
238
|
-
partners: z.array(z.object({
|
|
239
|
-
proteinA: z.string(),
|
|
240
|
-
proteinB: z.string(),
|
|
241
|
-
score: z.number(),
|
|
242
|
-
experimentalScore: z.number().optional(),
|
|
243
|
-
databaseScore: z.number().optional(),
|
|
244
|
-
textminingScore: z.number().optional(),
|
|
245
|
-
})),
|
|
246
|
-
});
|
|
247
|
-
/**
|
|
248
|
-
* Heterodimer / receptor-accessory complex inventory for the assessment
|
|
249
|
-
* target, sourced from IUPHAR Guide to Pharmacology. Drives runtime
|
|
250
|
-
* heterodimer-name detection (no hardcoded RAMP/MRAP/RGS regex) and the
|
|
251
|
-
* obligate-cofactor supplement in the off-target panel.
|
|
252
|
-
*/
|
|
253
|
-
export const FamilyComplexesBundleSchema = z.object({
|
|
254
|
-
primaryTargetGene: z.string(),
|
|
255
|
-
primaryTargetUniprot: z.string().nullable(),
|
|
256
|
-
accessoryProteinNames: z.array(z.string()),
|
|
257
|
-
complexes: z.array(z.object({
|
|
258
|
-
complexName: z.string(),
|
|
259
|
-
complexId: z.number().nullable(),
|
|
260
|
-
accessoryNames: z.array(z.string()),
|
|
261
|
-
subunitNames: z.array(z.string()),
|
|
262
|
-
})),
|
|
263
|
-
});
|
|
264
|
-
export const TherapeuticProgramsBundleSchema = z.object({
|
|
265
|
-
programs: z.array(z.object({
|
|
266
|
-
programId: z.string(),
|
|
267
|
-
name: z.string(),
|
|
268
|
-
targetSymbol: z.string(),
|
|
269
|
-
targetUniprot: z.string().nullable(),
|
|
270
|
-
modality: z.string(),
|
|
271
|
-
sponsor: z.string().nullable(),
|
|
272
|
-
mechanism: z.string(),
|
|
273
|
-
status: z.string(),
|
|
274
|
-
nctIds: z.array(z.string()),
|
|
275
|
-
pmids: z.array(z.string()),
|
|
276
|
-
evidence: z.array(EvidenceItemSchema),
|
|
277
|
-
confidence: z.enum(["high", "medium", "low"]),
|
|
278
|
-
})),
|
|
279
|
-
});
|
|
280
|
-
/**
|
|
281
|
-
* Curated human phenotype and causal-disease evidence from Monarch.
|
|
282
|
-
*
|
|
283
|
-
* `ancestorIds` is the HPO ancestor closure, carried through so the consumer
|
|
284
|
-
* resolves a phenotype onto an organ by identifier rather than by its label.
|
|
285
|
-
*/
|
|
286
|
-
export const MonarchBundleSchema = z.object({
|
|
287
|
-
geneCurie: z.string(),
|
|
288
|
-
phenotypes: z.array(z.object({
|
|
289
|
-
hpoId: z.string(),
|
|
290
|
-
label: z.string(),
|
|
291
|
-
ancestorIds: z.array(z.string()),
|
|
292
|
-
publications: z.array(z.string()),
|
|
293
|
-
diseaseContext: z.string().nullable(),
|
|
294
|
-
frequencyPercent: z.number().nullable(),
|
|
295
|
-
primaryKnowledgeSource: z.string().nullable(),
|
|
296
|
-
})),
|
|
297
|
-
});
|
|
298
|
-
// ── Phase-1 keyed bundle (output of phase1Aggregate) ─────────────────
|
|
299
|
-
export const Phase1BundleSchema = z.object({
|
|
300
|
-
resolved: ResolvedTargetSchema,
|
|
301
|
-
collectors: z.object({
|
|
302
|
-
opentargets: withCoverage(OpenTargetsBundleSchema),
|
|
303
|
-
chemblModulators: withCoverage(ChemblModulatorsBundleSchema),
|
|
304
|
-
ctgov: withCoverage(CtgovBundleSchema),
|
|
305
|
-
faersByTarget: withCoverage(FaersByTargetBundleSchema),
|
|
306
|
-
expressionHuman: withCoverage(ExpressionHumanBundleSchema),
|
|
307
|
-
expressionMultiSpecies: withCoverage(ExpressionMultiSpeciesBundleSchema),
|
|
308
|
-
clinvar: withCoverage(ClinvarBundleSchema),
|
|
309
|
-
cbioportal: withCoverage(CbioportalBundleSchema),
|
|
310
|
-
impc: withCoverage(ImpcBundleSchema),
|
|
311
|
-
pubmedIndex: withCoverage(PubmedIndexBundleSchema),
|
|
312
|
-
pathways: withCoverage(PathwaysBundleSchema),
|
|
313
|
-
stringPpi: withCoverage(StringPpiBundleSchema),
|
|
314
|
-
familyComplexes: withCoverage(FamilyComplexesBundleSchema),
|
|
315
|
-
monarch: withCoverage(MonarchBundleSchema),
|
|
316
|
-
therapeuticPrograms: withCoverage(TherapeuticProgramsBundleSchema).optional(),
|
|
317
|
-
}),
|
|
318
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export type PathwayRow = {
|
|
2
|
-
id: string;
|
|
3
|
-
name: string;
|
|
4
|
-
source: "reactome" | "kegg";
|
|
5
|
-
url: string;
|
|
6
|
-
entity_uniprots?: string[];
|
|
7
|
-
metadata?: {
|
|
8
|
-
species_present?: string[];
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
export declare function stripHtml(s: string): string;
|
|
12
|
-
export declare function dedupPathwaysAcrossSpecies(rows: PathwayRow[], opts?: {
|
|
13
|
-
geneSymbolEchoFilter?: string;
|
|
14
|
-
assessmentUniprot?: string;
|
|
15
|
-
}): PathwayRow[];
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { stripHtmlAndCollapseWs } from "../../../../tools/lib/pathway-client.js";
|
|
2
|
-
const REACTOME_ID_RE = /^R-([A-Z]+)-(\d+)/;
|
|
3
|
-
export function stripHtml(s) {
|
|
4
|
-
return stripHtmlAndCollapseWs(s);
|
|
5
|
-
}
|
|
6
|
-
export function dedupPathwaysAcrossSpecies(rows, opts = {}) {
|
|
7
|
-
// Group Reactome rows by stable suffix; KEGG/other sources pass through.
|
|
8
|
-
const reactomeGroups = new Map();
|
|
9
|
-
const others = [];
|
|
10
|
-
for (const r of rows) {
|
|
11
|
-
if (r.source !== "reactome") {
|
|
12
|
-
others.push(r);
|
|
13
|
-
continue;
|
|
14
|
-
}
|
|
15
|
-
const m = REACTOME_ID_RE.exec(r.id);
|
|
16
|
-
if (!m) {
|
|
17
|
-
others.push(r);
|
|
18
|
-
continue;
|
|
19
|
-
}
|
|
20
|
-
const suffix = m[2];
|
|
21
|
-
const arr = reactomeGroups.get(suffix) ?? [];
|
|
22
|
-
arr.push(r);
|
|
23
|
-
reactomeGroups.set(suffix, arr);
|
|
24
|
-
}
|
|
25
|
-
const collapsed = [];
|
|
26
|
-
for (const group of reactomeGroups.values()) {
|
|
27
|
-
const withSpecies = group.map((r) => ({
|
|
28
|
-
r,
|
|
29
|
-
species: REACTOME_ID_RE.exec(r.id)[1],
|
|
30
|
-
}));
|
|
31
|
-
const human = withSpecies.find((x) => x.species === "HSA");
|
|
32
|
-
const winner = (human ?? withSpecies[0]).r;
|
|
33
|
-
const species_present = withSpecies.map((x) => x.species);
|
|
34
|
-
collapsed.push({
|
|
35
|
-
...winner,
|
|
36
|
-
metadata: { ...(winner.metadata ?? {}), species_present },
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
const merged = [...collapsed, ...others];
|
|
40
|
-
let filtered = merged;
|
|
41
|
-
if (opts.assessmentUniprot) {
|
|
42
|
-
filtered = filtered.filter((r) => {
|
|
43
|
-
if (r.source !== "reactome")
|
|
44
|
-
return true; // only Reactome carries entity_uniprots
|
|
45
|
-
if (!r.entity_uniprots || r.entity_uniprots.length === 0)
|
|
46
|
-
return true; // graceful fallback when fetch failed
|
|
47
|
-
return r.entity_uniprots.includes(opts.assessmentUniprot);
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
if (opts.geneSymbolEchoFilter) {
|
|
51
|
-
const echo = opts.geneSymbolEchoFilter.toLowerCase();
|
|
52
|
-
filtered = filtered.filter((r) => r.name.toLowerCase() !== echo);
|
|
53
|
-
}
|
|
54
|
-
return filtered;
|
|
55
|
-
}
|
|
56
|
-
// `stripHtmlAndCollapseWs` is the underlying helper — kept in scope so the
|
|
57
|
-
// `stripHtml` re-export above stays callable.
|
|
58
|
-
void stripHtmlAndCollapseWs;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Per-class-drug AE — fan-out item schemas.
|
|
3
|
-
*
|
|
4
|
-
* The DBOS-driven implementation lives in `target-assessment/fanout/index.ts`
|
|
5
|
-
* (`aesForOneClassDrug`); this module is retained for its input/output
|
|
6
|
-
* schemas and inferred item types.
|
|
7
|
-
*/
|
|
8
|
-
import { z } from "zod";
|
|
9
|
-
export declare const ClassDrugItemSchema: z.ZodObject<{
|
|
10
|
-
moleculeChemblId: z.ZodString;
|
|
11
|
-
preferredName: z.ZodString;
|
|
12
|
-
maxPhase: z.ZodNullable<z.ZodNumber>;
|
|
13
|
-
firstApproval: z.ZodNullable<z.ZodNumber>;
|
|
14
|
-
}, z.core.$strip>;
|
|
15
|
-
export type ClassDrugItem = z.infer<typeof ClassDrugItemSchema>;
|
|
16
|
-
export declare const PerClassDrugAEsItemSchema: z.ZodObject<{
|
|
17
|
-
moleculeChemblId: z.ZodString;
|
|
18
|
-
preferredName: z.ZodString;
|
|
19
|
-
totalReports: z.ZodNullable<z.ZodNumber>;
|
|
20
|
-
topReactions: z.ZodArray<z.ZodObject<{
|
|
21
|
-
reaction: z.ZodString;
|
|
22
|
-
count: z.ZodNumber;
|
|
23
|
-
}, z.core.$strip>>;
|
|
24
|
-
seriousness: z.ZodNullable<z.ZodObject<{
|
|
25
|
-
totalReports: z.ZodNumber;
|
|
26
|
-
fatalCount: z.ZodNumber;
|
|
27
|
-
hospitalizationCount: z.ZodNumber;
|
|
28
|
-
lifeThreateningCount: z.ZodNumber;
|
|
29
|
-
disablingCount: z.ZodNumber;
|
|
30
|
-
congenitalAnomalyCount: z.ZodDefault<z.ZodNumber>;
|
|
31
|
-
otherSeriousCount: z.ZodDefault<z.ZodNumber>;
|
|
32
|
-
}, z.core.$strip>>;
|
|
33
|
-
}, z.core.$strip>;
|
|
34
|
-
export type PerClassDrugAEsItem = z.infer<typeof PerClassDrugAEsItemSchema>;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Per-class-drug AE — fan-out item schemas.
|
|
3
|
-
*
|
|
4
|
-
* The DBOS-driven implementation lives in `target-assessment/fanout/index.ts`
|
|
5
|
-
* (`aesForOneClassDrug`); this module is retained for its input/output
|
|
6
|
-
* schemas and inferred item types.
|
|
7
|
-
*/
|
|
8
|
-
import { z } from "zod";
|
|
9
|
-
export const ClassDrugItemSchema = z.object({
|
|
10
|
-
moleculeChemblId: z.string(),
|
|
11
|
-
preferredName: z.string(),
|
|
12
|
-
maxPhase: z.number().nullable(),
|
|
13
|
-
firstApproval: z.number().nullable(),
|
|
14
|
-
});
|
|
15
|
-
export const PerClassDrugAEsItemSchema = z.object({
|
|
16
|
-
moleculeChemblId: z.string(),
|
|
17
|
-
preferredName: z.string(),
|
|
18
|
-
totalReports: z.number().nullable(),
|
|
19
|
-
topReactions: z.array(z.object({ reaction: z.string(), count: z.number() })),
|
|
20
|
-
seriousness: z
|
|
21
|
-
.object({
|
|
22
|
-
totalReports: z.number(),
|
|
23
|
-
fatalCount: z.number(),
|
|
24
|
-
hospitalizationCount: z.number(),
|
|
25
|
-
lifeThreateningCount: z.number(),
|
|
26
|
-
disablingCount: z.number(),
|
|
27
|
-
congenitalAnomalyCount: z.number().default(0),
|
|
28
|
-
otherSeriousCount: z.number().default(0),
|
|
29
|
-
})
|
|
30
|
-
.nullable(),
|
|
31
|
-
});
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Per-trial AE — fan-out item schemas.
|
|
3
|
-
*
|
|
4
|
-
* The DBOS-driven implementation lives in `target-assessment/fanout/index.ts`
|
|
5
|
-
* (`aesForOneTrial`); this module is retained for its input/output schemas
|
|
6
|
-
* and inferred item types.
|
|
7
|
-
*/
|
|
8
|
-
import { z } from "zod";
|
|
9
|
-
export declare const TrialItemSchema: z.ZodObject<{
|
|
10
|
-
nctId: z.ZodString;
|
|
11
|
-
title: z.ZodString;
|
|
12
|
-
}, z.core.$strip>;
|
|
13
|
-
export type TrialItem = z.infer<typeof TrialItemSchema>;
|
|
14
|
-
export declare const PerTrialAEsItemSchema: z.ZodObject<{
|
|
15
|
-
nctId: z.ZodString;
|
|
16
|
-
title: z.ZodString;
|
|
17
|
-
whyStopped: z.ZodNullable<z.ZodString>;
|
|
18
|
-
outcomes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
19
|
-
type: z.ZodEnum<{
|
|
20
|
-
other: "other";
|
|
21
|
-
primary: "primary";
|
|
22
|
-
secondary: "secondary";
|
|
23
|
-
}>;
|
|
24
|
-
measure: z.ZodString;
|
|
25
|
-
description: z.ZodNullable<z.ZodString>;
|
|
26
|
-
timeFrame: z.ZodNullable<z.ZodString>;
|
|
27
|
-
effect: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
28
|
-
kind: z.ZodLiteral<"quantitative">;
|
|
29
|
-
value: z.ZodNumber;
|
|
30
|
-
units: z.ZodString;
|
|
31
|
-
ci_low: z.ZodOptional<z.ZodNumber>;
|
|
32
|
-
ci_high: z.ZodOptional<z.ZodNumber>;
|
|
33
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
34
|
-
kind: z.ZodLiteral<"not_extracted">;
|
|
35
|
-
reason: z.ZodEnum<{
|
|
36
|
-
ctgov_no_numeric_result: "ctgov_no_numeric_result";
|
|
37
|
-
ctgov_no_result_groups: "ctgov_no_result_groups";
|
|
38
|
-
}>;
|
|
39
|
-
}, z.core.$strip>], "kind">;
|
|
40
|
-
}, z.core.$strip>>>;
|
|
41
|
-
groups: z.ZodArray<z.ZodObject<{
|
|
42
|
-
groupId: z.ZodString;
|
|
43
|
-
title: z.ZodString;
|
|
44
|
-
description: z.ZodNullable<z.ZodString>;
|
|
45
|
-
}, z.core.$strip>>;
|
|
46
|
-
events: z.ZodArray<z.ZodObject<{
|
|
47
|
-
serious: z.ZodBoolean;
|
|
48
|
-
term: z.ZodString;
|
|
49
|
-
organSystem: z.ZodNullable<z.ZodString>;
|
|
50
|
-
counts: z.ZodArray<z.ZodObject<{
|
|
51
|
-
groupId: z.ZodString;
|
|
52
|
-
numAffected: z.ZodNullable<z.ZodNumber>;
|
|
53
|
-
numAtRisk: z.ZodNullable<z.ZodNumber>;
|
|
54
|
-
}, z.core.$strip>>;
|
|
55
|
-
}, z.core.$strip>>;
|
|
56
|
-
}, z.core.$strip>;
|
|
57
|
-
export type PerTrialAEsItem = z.infer<typeof PerTrialAEsItemSchema>;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Per-trial AE — fan-out item schemas.
|
|
3
|
-
*
|
|
4
|
-
* The DBOS-driven implementation lives in `target-assessment/fanout/index.ts`
|
|
5
|
-
* (`aesForOneTrial`); this module is retained for its input/output schemas
|
|
6
|
-
* and inferred item types.
|
|
7
|
-
*/
|
|
8
|
-
import { z } from "zod";
|
|
9
|
-
export const TrialItemSchema = z.object({
|
|
10
|
-
nctId: z.string(),
|
|
11
|
-
title: z.string(),
|
|
12
|
-
});
|
|
13
|
-
const OutcomeEffectSchema = z.discriminatedUnion("kind", [
|
|
14
|
-
z.object({
|
|
15
|
-
kind: z.literal("quantitative"),
|
|
16
|
-
value: z.number(),
|
|
17
|
-
units: z.string(),
|
|
18
|
-
ci_low: z.number().optional(),
|
|
19
|
-
ci_high: z.number().optional(),
|
|
20
|
-
}),
|
|
21
|
-
z.object({
|
|
22
|
-
kind: z.literal("not_extracted"),
|
|
23
|
-
reason: z.enum(["ctgov_no_numeric_result", "ctgov_no_result_groups"]),
|
|
24
|
-
}),
|
|
25
|
-
]);
|
|
26
|
-
export const PerTrialAEsItemSchema = z.object({
|
|
27
|
-
nctId: z.string(),
|
|
28
|
-
title: z.string(),
|
|
29
|
-
whyStopped: z.string().nullable(),
|
|
30
|
-
outcomes: z
|
|
31
|
-
.array(z.object({
|
|
32
|
-
type: z.enum(["primary", "secondary", "other"]),
|
|
33
|
-
measure: z.string(),
|
|
34
|
-
description: z.string().nullable(),
|
|
35
|
-
timeFrame: z.string().nullable(),
|
|
36
|
-
effect: OutcomeEffectSchema,
|
|
37
|
-
}))
|
|
38
|
-
.default([]),
|
|
39
|
-
groups: z.array(z.object({
|
|
40
|
-
groupId: z.string(),
|
|
41
|
-
title: z.string(),
|
|
42
|
-
description: z.string().nullable(),
|
|
43
|
-
})),
|
|
44
|
-
events: z.array(z.object({
|
|
45
|
-
serious: z.boolean(),
|
|
46
|
-
term: z.string(),
|
|
47
|
-
organSystem: z.string().nullable(),
|
|
48
|
-
counts: z.array(z.object({
|
|
49
|
-
groupId: z.string(),
|
|
50
|
-
numAffected: z.number().nullable(),
|
|
51
|
-
numAtRisk: z.number().nullable(),
|
|
52
|
-
})),
|
|
53
|
-
})),
|
|
54
|
-
});
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Per-modulator FAERS — fan-out item schemas.
|
|
3
|
-
*
|
|
4
|
-
* The DBOS-driven implementation lives in `target-assessment/fanout/index.ts`
|
|
5
|
-
* (`faersForOneModulator`); this module is retained for its input/output
|
|
6
|
-
* schemas and inferred item types.
|
|
7
|
-
*/
|
|
8
|
-
import { z } from "zod";
|
|
9
|
-
export declare const ModulatorItemSchema: z.ZodObject<{
|
|
10
|
-
moleculeChemblId: z.ZodString;
|
|
11
|
-
preferredName: z.ZodString;
|
|
12
|
-
maxPhase: z.ZodNullable<z.ZodNumber>;
|
|
13
|
-
firstApproval: z.ZodNullable<z.ZodNumber>;
|
|
14
|
-
rationale: z.ZodString;
|
|
15
|
-
}, z.core.$strip>;
|
|
16
|
-
export type ModulatorItem = z.infer<typeof ModulatorItemSchema>;
|
|
17
|
-
export declare const PerModulatorFaersItemSchema: z.ZodObject<{
|
|
18
|
-
moleculeChemblId: z.ZodString;
|
|
19
|
-
preferredName: z.ZodString;
|
|
20
|
-
totalReports: z.ZodNullable<z.ZodNumber>;
|
|
21
|
-
topReactions: z.ZodArray<z.ZodObject<{
|
|
22
|
-
reaction: z.ZodString;
|
|
23
|
-
count: z.ZodNumber;
|
|
24
|
-
}, z.core.$strip>>;
|
|
25
|
-
seriousness: z.ZodNullable<z.ZodObject<{
|
|
26
|
-
totalReports: z.ZodNumber;
|
|
27
|
-
fatalCount: z.ZodNumber;
|
|
28
|
-
hospitalizationCount: z.ZodNumber;
|
|
29
|
-
lifeThreateningCount: z.ZodNumber;
|
|
30
|
-
disablingCount: z.ZodNumber;
|
|
31
|
-
congenitalAnomalyCount: z.ZodDefault<z.ZodNumber>;
|
|
32
|
-
otherSeriousCount: z.ZodDefault<z.ZodNumber>;
|
|
33
|
-
}, z.core.$strip>>;
|
|
34
|
-
}, z.core.$strip>;
|
|
35
|
-
export type PerModulatorFaersItem = z.infer<typeof PerModulatorFaersItemSchema>;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Per-modulator FAERS — fan-out item schemas.
|
|
3
|
-
*
|
|
4
|
-
* The DBOS-driven implementation lives in `target-assessment/fanout/index.ts`
|
|
5
|
-
* (`faersForOneModulator`); this module is retained for its input/output
|
|
6
|
-
* schemas and inferred item types.
|
|
7
|
-
*/
|
|
8
|
-
import { z } from "zod";
|
|
9
|
-
export const ModulatorItemSchema = z.object({
|
|
10
|
-
moleculeChemblId: z.string(),
|
|
11
|
-
preferredName: z.string(),
|
|
12
|
-
maxPhase: z.number().nullable(),
|
|
13
|
-
firstApproval: z.number().nullable(),
|
|
14
|
-
rationale: z.string(),
|
|
15
|
-
});
|
|
16
|
-
export const PerModulatorFaersItemSchema = z.object({
|
|
17
|
-
moleculeChemblId: z.string(),
|
|
18
|
-
preferredName: z.string(),
|
|
19
|
-
totalReports: z.number().nullable(),
|
|
20
|
-
topReactions: z.array(z.object({ reaction: z.string(), count: z.number() })),
|
|
21
|
-
seriousness: z
|
|
22
|
-
.object({
|
|
23
|
-
totalReports: z.number(),
|
|
24
|
-
fatalCount: z.number(),
|
|
25
|
-
hospitalizationCount: z.number(),
|
|
26
|
-
lifeThreateningCount: z.number(),
|
|
27
|
-
disablingCount: z.number(),
|
|
28
|
-
congenitalAnomalyCount: z.number().default(0),
|
|
29
|
-
otherSeriousCount: z.number().default(0),
|
|
30
|
-
})
|
|
31
|
-
.nullable(),
|
|
32
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Phase-3 fan-out item schemas. Each schema describes one work item (one
|
|
3
|
-
* modulator, one trial, one class drug) and its coverage-tagged payload.
|
|
4
|
-
* The harness DBOS implementation lives in
|
|
5
|
-
* `../../fanout/index.ts` — these schemas are the shared type contract.
|
|
6
|
-
*/
|
|
7
|
-
export { ModulatorItemSchema, PerModulatorFaersItemSchema } from "./faers-for-one-modulator-step.js";
|
|
8
|
-
export type { ModulatorItem, PerModulatorFaersItem } from "./faers-for-one-modulator-step.js";
|
|
9
|
-
export { TrialItemSchema, PerTrialAEsItemSchema } from "./aes-for-one-trial-step.js";
|
|
10
|
-
export type { TrialItem, PerTrialAEsItem } from "./aes-for-one-trial-step.js";
|
|
11
|
-
export { PolypharmInputItemSchema, PerModulatorPolypharmItemSchema } from "./polypharm-for-one-modulator-step.js";
|
|
12
|
-
export type { PolypharmInputItem, PerModulatorPolypharmItem } from "./polypharm-for-one-modulator-step.js";
|
|
13
|
-
export { ClassDrugItemSchema, PerClassDrugAEsItemSchema } from "./aes-for-one-class-drug-step.js";
|
|
14
|
-
export type { ClassDrugItem, PerClassDrugAEsItem } from "./aes-for-one-class-drug-step.js";
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Phase-3 fan-out item schemas. Each schema describes one work item (one
|
|
3
|
-
* modulator, one trial, one class drug) and its coverage-tagged payload.
|
|
4
|
-
* The harness DBOS implementation lives in
|
|
5
|
-
* `../../fanout/index.ts` — these schemas are the shared type contract.
|
|
6
|
-
*/
|
|
7
|
-
export { ModulatorItemSchema, PerModulatorFaersItemSchema } from "./faers-for-one-modulator-step.js";
|
|
8
|
-
export { TrialItemSchema, PerTrialAEsItemSchema } from "./aes-for-one-trial-step.js";
|
|
9
|
-
export { PolypharmInputItemSchema, PerModulatorPolypharmItemSchema } from "./polypharm-for-one-modulator-step.js";
|
|
10
|
-
export { ClassDrugItemSchema, PerClassDrugAEsItemSchema } from "./aes-for-one-class-drug-step.js";
|