@inflexa-ai/harness 0.35.7 → 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/genai-spans.d.ts +20 -0
- package/dist/loop/genai-spans.js +53 -0
- package/dist/loop/run-agent.d.ts +1 -1
- package/dist/loop/run-agent.js +9 -4
- package/dist/providers/ai-sdk.js +8 -0
- 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 +9 -8
- 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,281 +0,0 @@
|
|
|
1
|
-
import type { ClinicalTrialAttribution, DiscoveryTrials, EvidenceItem } from "@inflexa-ai/harness/contracts/target-dossier.js";
|
|
2
|
-
import type { Phase2Bundle } from "../steps/phase2-aggregate.js";
|
|
3
|
-
import type { Phase3Bundle } from "../steps/phase3-aggregate.js";
|
|
4
|
-
import { HIGH_EXPRESSION_TPM_THRESHOLD } from "../lib/expression-constants.js";
|
|
5
|
-
export { HIGH_EXPRESSION_TPM_THRESHOLD };
|
|
6
|
-
type FanoutResults = Phase3Bundle["fanout"];
|
|
7
|
-
export declare function assemblePreclinicalLiterature(phase2: Phase2Bundle): {
|
|
8
|
-
rows: {
|
|
9
|
-
pmid: string;
|
|
10
|
-
claim: string;
|
|
11
|
-
excerpt: undefined;
|
|
12
|
-
model_system: string;
|
|
13
|
-
species: string;
|
|
14
|
-
}[];
|
|
15
|
-
total_claim_count: number;
|
|
16
|
-
truncated: boolean;
|
|
17
|
-
} | null;
|
|
18
|
-
export declare function assembleKeyPapers(phase2: Phase2Bundle, internalRefCounts: Map<string, number>): {
|
|
19
|
-
pmid: string;
|
|
20
|
-
title: string;
|
|
21
|
-
internal_reference_count: number;
|
|
22
|
-
year: number | undefined;
|
|
23
|
-
}[] | null;
|
|
24
|
-
export declare function tallyInternalReferences(evidenceArrays: EvidenceItem[][]): Map<string, number>;
|
|
25
|
-
export declare function looksLikeKoLiterature(title: string): boolean;
|
|
26
|
-
export declare function assembleKoSupportingLiterature(phase2: Phase2Bundle): EvidenceItem[];
|
|
27
|
-
type PpiSource = "string" | "literature";
|
|
28
|
-
type PpiInputPartner = {
|
|
29
|
-
proteinA: string;
|
|
30
|
-
proteinB: string;
|
|
31
|
-
score: number;
|
|
32
|
-
experimentalScore?: number;
|
|
33
|
-
databaseScore?: number;
|
|
34
|
-
textminingScore?: number;
|
|
35
|
-
};
|
|
36
|
-
export declare function assembleMolecularInteractions(phase2: Phase2Bundle, fanout: FanoutResults | undefined): {
|
|
37
|
-
partner_id: string | null;
|
|
38
|
-
partner_name: string;
|
|
39
|
-
predicate: string;
|
|
40
|
-
best_score: number;
|
|
41
|
-
source_count: number;
|
|
42
|
-
paper_count: number;
|
|
43
|
-
evidence: EvidenceItem[];
|
|
44
|
-
}[] | null;
|
|
45
|
-
export declare function assembleBiomarkerPotential(phase2: Phase2Bundle): {
|
|
46
|
-
partner_id: string | null;
|
|
47
|
-
partner_name: string;
|
|
48
|
-
predicate: string;
|
|
49
|
-
best_score: number;
|
|
50
|
-
source_count: number;
|
|
51
|
-
paper_count: number;
|
|
52
|
-
evidence: EvidenceItem[];
|
|
53
|
-
metrics: Record<string, never>;
|
|
54
|
-
}[] | null;
|
|
55
|
-
export declare function assembleResistanceEvidence(phase2: Phase2Bundle): {
|
|
56
|
-
partner_id: null;
|
|
57
|
-
partner_name: string;
|
|
58
|
-
predicate: string;
|
|
59
|
-
best_score: number;
|
|
60
|
-
source_count: number;
|
|
61
|
-
paper_count: number;
|
|
62
|
-
evidence: {
|
|
63
|
-
source: string;
|
|
64
|
-
predicate: string;
|
|
65
|
-
pmid: string;
|
|
66
|
-
excerpt: string;
|
|
67
|
-
metadata: {
|
|
68
|
-
year: string;
|
|
69
|
-
journal: string;
|
|
70
|
-
};
|
|
71
|
-
}[];
|
|
72
|
-
}[] | null;
|
|
73
|
-
export declare function assembleCombinationEvidence(phase2: Phase2Bundle): {
|
|
74
|
-
partner_id: null;
|
|
75
|
-
partner_name: string;
|
|
76
|
-
predicate: string;
|
|
77
|
-
best_score: number;
|
|
78
|
-
source_count: number;
|
|
79
|
-
paper_count: number;
|
|
80
|
-
evidence: {
|
|
81
|
-
source: string;
|
|
82
|
-
predicate: string;
|
|
83
|
-
pmid: string;
|
|
84
|
-
excerpt: string;
|
|
85
|
-
metadata: {
|
|
86
|
-
year: string;
|
|
87
|
-
journal: string;
|
|
88
|
-
};
|
|
89
|
-
}[];
|
|
90
|
-
}[] | null;
|
|
91
|
-
export declare function assembleEvidenceConflicts(phase2: Phase2Bundle): {
|
|
92
|
-
evidence_item_id: string;
|
|
93
|
-
predicate: string;
|
|
94
|
-
contradicting_predicates: string[];
|
|
95
|
-
surfaced_in_section: string;
|
|
96
|
-
evidence: EvidenceItem[];
|
|
97
|
-
}[] | null;
|
|
98
|
-
export declare function assembleAdditionalEvidence(phase2: Phase2Bundle): {
|
|
99
|
-
rows: {
|
|
100
|
-
predicate: string;
|
|
101
|
-
evidence: {
|
|
102
|
-
source: string;
|
|
103
|
-
pmid?: string | undefined;
|
|
104
|
-
doi?: string | undefined;
|
|
105
|
-
accession?: string | undefined;
|
|
106
|
-
predicate?: string | undefined;
|
|
107
|
-
score?: number | undefined;
|
|
108
|
-
strength?: string | undefined;
|
|
109
|
-
is_human?: boolean | undefined;
|
|
110
|
-
is_clinical?: boolean | undefined;
|
|
111
|
-
excerpt?: string | undefined;
|
|
112
|
-
metadata?: Record<string, unknown> | undefined;
|
|
113
|
-
regulatory_reference?: {
|
|
114
|
-
document: string;
|
|
115
|
-
section?: string | undefined;
|
|
116
|
-
doc_id?: string | undefined;
|
|
117
|
-
doc_url?: string | undefined;
|
|
118
|
-
} | undefined;
|
|
119
|
-
}[];
|
|
120
|
-
}[];
|
|
121
|
-
score_floor: number;
|
|
122
|
-
} | null;
|
|
123
|
-
export declare function dedupePpiPartners(partners: PpiInputPartner[]): {
|
|
124
|
-
partner_id: string | null;
|
|
125
|
-
partner_name: string;
|
|
126
|
-
string_score: number | null;
|
|
127
|
-
literature_score: number | null;
|
|
128
|
-
combined_score: number;
|
|
129
|
-
sources: PpiSource[];
|
|
130
|
-
has_human_evidence: boolean;
|
|
131
|
-
has_clinical_evidence: boolean;
|
|
132
|
-
}[];
|
|
133
|
-
export declare function isClinicalMeasurement(name: string): boolean;
|
|
134
|
-
/**
|
|
135
|
-
* Produce a discriminated `failure_category` block. The "safety" branch
|
|
136
|
-
* uses `safety_evidence_excerpt`; all other branches use
|
|
137
|
-
* `category_evidence_excerpt`.
|
|
138
|
-
*/
|
|
139
|
-
export declare function buildFailureCategoryDiscriminated(whyStopped: string): {
|
|
140
|
-
category: "safety";
|
|
141
|
-
safety_evidence_excerpt: string;
|
|
142
|
-
} | {
|
|
143
|
-
category: "efficacy";
|
|
144
|
-
category_evidence_excerpt: string;
|
|
145
|
-
} | {
|
|
146
|
-
category: "strategic";
|
|
147
|
-
category_evidence_excerpt: string;
|
|
148
|
-
} | {
|
|
149
|
-
category: "operational";
|
|
150
|
-
category_evidence_excerpt: string;
|
|
151
|
-
};
|
|
152
|
-
export declare function isSelfReference(canonicalId: string, diseaseId: string, symbol: string, diseaseName: string): boolean;
|
|
153
|
-
export declare const SOURCE_WEIGHTS: Record<string, number>;
|
|
154
|
-
export declare function indicationCompositeScore(evidenceScore: number, sources: string[], paperCount: number): {
|
|
155
|
-
composite: number;
|
|
156
|
-
breakdown: {
|
|
157
|
-
base: number;
|
|
158
|
-
source_bonuses: Record<string, number>;
|
|
159
|
-
paper_depth: number;
|
|
160
|
-
};
|
|
161
|
-
};
|
|
162
|
-
export declare function deterministicTranslationalCommentary(phase2: Phase2Bundle): Array<{
|
|
163
|
-
severity: "ok" | "caution" | "gap";
|
|
164
|
-
organ?: string;
|
|
165
|
-
species?: string;
|
|
166
|
-
text: string;
|
|
167
|
-
}>;
|
|
168
|
-
/**
|
|
169
|
-
* Dependency-injected context for resolving drug-to-target mappings.
|
|
170
|
-
* Allows tests to substitute a fake resolver without hitting ChEMBL APIs.
|
|
171
|
-
*/
|
|
172
|
-
export type AttributionContext = {
|
|
173
|
-
assessmentUniprot: string;
|
|
174
|
-
assessmentSymbol: string;
|
|
175
|
-
familyUniprots: string[];
|
|
176
|
-
drugTargetResolver: (chemblId: string) => Promise<string[]>;
|
|
177
|
-
};
|
|
178
|
-
/**
|
|
179
|
-
* Partition a list of trials into primary (on-target or unresolved) and
|
|
180
|
-
* related (off-target via a related family receptor). Each trial's
|
|
181
|
-
* `match_confidence` is derived from ChEMBL mechanism resolution via
|
|
182
|
-
* `classifyTrialAttribution`. When no `drugChemblId` is present on an
|
|
183
|
-
* intervention (because the upstream ctgov bundle carries only drug names),
|
|
184
|
-
* resolution is skipped and the trial lands in primary with confidence "low".
|
|
185
|
-
*/
|
|
186
|
-
export declare function partitionTrialsByAttribution<T extends {
|
|
187
|
-
nctId: string;
|
|
188
|
-
title: string;
|
|
189
|
-
interventions?: string[] | Array<{
|
|
190
|
-
drugChemblId: string | null;
|
|
191
|
-
name: string;
|
|
192
|
-
}>;
|
|
193
|
-
conditions?: string[];
|
|
194
|
-
}>(trials: T[], ctx: AttributionContext): Promise<{
|
|
195
|
-
primary: Array<T & {
|
|
196
|
-
match_confidence: "high" | "medium" | "low";
|
|
197
|
-
}>;
|
|
198
|
-
related: Array<T & {
|
|
199
|
-
match_confidence: "off_target";
|
|
200
|
-
}>;
|
|
201
|
-
}>;
|
|
202
|
-
type RelevanceBasis = {
|
|
203
|
-
kind: "drug_in_class_match";
|
|
204
|
-
drug_id: string;
|
|
205
|
-
matched_term: string;
|
|
206
|
-
} | {
|
|
207
|
-
kind: "title_keyword";
|
|
208
|
-
matched_term: string;
|
|
209
|
-
} | {
|
|
210
|
-
kind: "condition_match";
|
|
211
|
-
matched_term?: string;
|
|
212
|
-
};
|
|
213
|
-
/**
|
|
214
|
-
* Classify why a candidate trial is considered relevant to the assessment.
|
|
215
|
-
* Checks interventions against known class drug names first (strongest signal),
|
|
216
|
-
* then falls back to title keyword matching, then condition match (weakest).
|
|
217
|
-
*
|
|
218
|
-
* Rows with match_confidence="low" and kind="condition_match" are unreliable
|
|
219
|
-
* (they may be in the same broad disease area but use a completely different
|
|
220
|
-
* drug class — e.g., SGLT2 inhibitors appearing in a GLP-1R dossier).
|
|
221
|
-
* These rows are dropped by the caller before they reach the dossier.
|
|
222
|
-
*/
|
|
223
|
-
export declare function classifyRelevanceBasis(trial: {
|
|
224
|
-
interventions?: string[];
|
|
225
|
-
conditions?: string[];
|
|
226
|
-
title: string;
|
|
227
|
-
}, knownClassDrugNames: Set<string>, titleKeywordRx: RegExp): RelevanceBasis;
|
|
228
|
-
/**
|
|
229
|
-
* Classify match confidence for a clinical trial row in the
|
|
230
|
-
* `clinical_development.trials` section.
|
|
231
|
-
*
|
|
232
|
-
* Priority order:
|
|
233
|
-
* 1. "high" — gene symbol appears in intervention name or trial title.
|
|
234
|
-
* 2. "medium" — intervention name matches a known class drug (drug-in-class).
|
|
235
|
-
* 3. "medium" — gene symbol appears in a condition string.
|
|
236
|
-
* 4. "low" — no match on any signal.
|
|
237
|
-
*
|
|
238
|
-
* Drug-in-class matching uses case-insensitive substring comparison against
|
|
239
|
-
* `knownClassDrugNames` (uppercase strings from ChEMBL modulators). This
|
|
240
|
-
* promotes calcitonin-class interventions (e.g. "Calcitonin-salmon", "SMC021")
|
|
241
|
-
* for a CALCR assessment even when the gene symbol itself is absent from the
|
|
242
|
-
* intervention name.
|
|
243
|
-
*/
|
|
244
|
-
export declare function classifyClinicalTrialConfidence(trial: {
|
|
245
|
-
interventions?: string[];
|
|
246
|
-
conditions?: string[];
|
|
247
|
-
title: string;
|
|
248
|
-
}, geneSymbol: string, knownClassDrugNames: Set<string>): "high" | "medium" | "low";
|
|
249
|
-
export declare function assembleDiscoveryTrials(phase2: Phase2Bundle, symbol: string, attrCtx: AttributionContext, knownClassDrugNames: Set<string>, attachAttribution: <T extends {
|
|
250
|
-
nct_id: string;
|
|
251
|
-
}>(row: T) => T & {
|
|
252
|
-
attribution: ClinicalTrialAttribution;
|
|
253
|
-
eligible_for_toxicology_aggregation: boolean;
|
|
254
|
-
}): Promise<DiscoveryTrials>;
|
|
255
|
-
export declare function assembleEvidenceTimeline(phase2: Phase2Bundle): {
|
|
256
|
-
histogram: Record<string, number>;
|
|
257
|
-
first_reported_year: number | null;
|
|
258
|
-
last_reported_year: number | null;
|
|
259
|
-
trend_labels: string[];
|
|
260
|
-
} | null;
|
|
261
|
-
declare const TIER_ORDER: readonly ["computational", "basic_in_vitro", "complex_in_vitro", "in_vivo_animal", "ex_vivo_human", "clinical"];
|
|
262
|
-
type Tier = (typeof TIER_ORDER)[number];
|
|
263
|
-
export declare function computeTranslationalChainSummary(tiers: Array<{
|
|
264
|
-
tier: Tier;
|
|
265
|
-
claim_count: number;
|
|
266
|
-
paper_count: number;
|
|
267
|
-
}>): {
|
|
268
|
-
peak_evidence_tier: Tier | null;
|
|
269
|
-
progression_complete: boolean;
|
|
270
|
-
weakest_progression_gap: Tier | null;
|
|
271
|
-
};
|
|
272
|
-
export declare function assembleTranslationalChain(phase2: Phase2Bundle): {
|
|
273
|
-
tiers: {
|
|
274
|
-
tier: "computational" | "basic_in_vitro" | "complex_in_vitro" | "in_vivo_animal" | "ex_vivo_human" | "clinical";
|
|
275
|
-
claim_count: number;
|
|
276
|
-
paper_count: number;
|
|
277
|
-
}[];
|
|
278
|
-
peak_evidence_tier: "computational" | "basic_in_vitro" | "complex_in_vitro" | "in_vivo_animal" | "ex_vivo_human" | "clinical" | null;
|
|
279
|
-
progression_complete: boolean;
|
|
280
|
-
weakest_progression_gap: "computational" | "basic_in_vitro" | "complex_in_vitro" | "in_vivo_animal" | "ex_vivo_human" | "clinical" | null;
|
|
281
|
-
} | null;
|