@inflexa-ai/harness 0.1.1
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/LICENSE +202 -0
- package/NOTICE +5 -0
- package/README.md +58 -0
- package/dist/agents/conversation-agent.d.ts +105 -0
- package/dist/agents/conversation-agent.js +140 -0
- package/dist/agents/report-builder.d.ts +32 -0
- package/dist/agents/report-builder.js +31 -0
- package/dist/agents/sandbox/__fixtures__/deps.d.ts +23 -0
- package/dist/agents/sandbox/__fixtures__/deps.js +96 -0
- package/dist/agents/sandbox/bulk-transcriptomics-agent.d.ts +8 -0
- package/dist/agents/sandbox/bulk-transcriptomics-agent.js +22 -0
- package/dist/agents/sandbox/cheminformatics-agent.d.ts +9 -0
- package/dist/agents/sandbox/cheminformatics-agent.js +62 -0
- package/dist/agents/sandbox/chromatin-agent.d.ts +8 -0
- package/dist/agents/sandbox/chromatin-agent.js +24 -0
- package/dist/agents/sandbox/data-profiler.d.ts +10 -0
- package/dist/agents/sandbox/data-profiler.js +24 -0
- package/dist/agents/sandbox/dna-methylation-agent.d.ts +8 -0
- package/dist/agents/sandbox/dna-methylation-agent.js +24 -0
- package/dist/agents/sandbox/drug-repurposing-agent.d.ts +8 -0
- package/dist/agents/sandbox/drug-repurposing-agent.js +54 -0
- package/dist/agents/sandbox/enrichment-agent.d.ts +8 -0
- package/dist/agents/sandbox/enrichment-agent.js +24 -0
- package/dist/agents/sandbox/ephemeral-executor.d.ts +9 -0
- package/dist/agents/sandbox/ephemeral-executor.js +29 -0
- package/dist/agents/sandbox/genomic-variant-agent.d.ts +8 -0
- package/dist/agents/sandbox/genomic-variant-agent.js +27 -0
- package/dist/agents/sandbox/immune-profiling-agent.d.ts +8 -0
- package/dist/agents/sandbox/immune-profiling-agent.js +43 -0
- package/dist/agents/sandbox/index.d.ts +31 -0
- package/dist/agents/sandbox/index.js +96 -0
- package/dist/agents/sandbox/metabolomics-agent.d.ts +8 -0
- package/dist/agents/sandbox/metabolomics-agent.js +15 -0
- package/dist/agents/sandbox/microbiome-agent.d.ts +8 -0
- package/dist/agents/sandbox/microbiome-agent.js +15 -0
- package/dist/agents/sandbox/multi-omics-integration-agent.d.ts +8 -0
- package/dist/agents/sandbox/multi-omics-integration-agent.js +33 -0
- package/dist/agents/sandbox/multimodal-sc-agent.d.ts +8 -0
- package/dist/agents/sandbox/multimodal-sc-agent.js +15 -0
- package/dist/agents/sandbox/network-agent.d.ts +8 -0
- package/dist/agents/sandbox/network-agent.js +25 -0
- package/dist/agents/sandbox/pkpd-clinical-response-agent.d.ts +8 -0
- package/dist/agents/sandbox/pkpd-clinical-response-agent.js +59 -0
- package/dist/agents/sandbox/proteomics-agent.d.ts +8 -0
- package/dist/agents/sandbox/proteomics-agent.js +15 -0
- package/dist/agents/sandbox/scientific-executor.d.ts +9 -0
- package/dist/agents/sandbox/scientific-executor.js +56 -0
- package/dist/agents/sandbox/shared.d.ts +100 -0
- package/dist/agents/sandbox/shared.js +195 -0
- package/dist/agents/sandbox/single-cell-agent.d.ts +8 -0
- package/dist/agents/sandbox/single-cell-agent.js +25 -0
- package/dist/agents/sandbox/spatial-omics-agent.d.ts +8 -0
- package/dist/agents/sandbox/spatial-omics-agent.js +15 -0
- package/dist/agents/sandbox/statistical-modeling-agent.d.ts +8 -0
- package/dist/agents/sandbox/statistical-modeling-agent.js +37 -0
- package/dist/agents/sandbox/translational-safety-agent.d.ts +8 -0
- package/dist/agents/sandbox/translational-safety-agent.js +59 -0
- package/dist/agents/sandbox/types.d.ts +34 -0
- package/dist/agents/sandbox/types.js +15 -0
- package/dist/agents/sandbox/validate-skills.d.ts +18 -0
- package/dist/agents/sandbox/validate-skills.js +40 -0
- package/dist/agents/sandbox-catalog.d.ts +33 -0
- package/dist/agents/sandbox-catalog.js +44 -0
- package/dist/agents/system-prompt.d.ts +25 -0
- package/dist/agents/system-prompt.js +23 -0
- package/dist/app/chat-turn.d.ts +35 -0
- package/dist/app/chat-turn.js +64 -0
- package/dist/app/data-profile-policy.d.ts +36 -0
- package/dist/app/data-profile-policy.js +37 -0
- package/dist/app/message-assembly.d.ts +65 -0
- package/dist/app/message-assembly.js +61 -0
- package/dist/app/synthesize-run.d.ts +57 -0
- package/dist/app/synthesize-run.js +103 -0
- package/dist/auth/local-auth-context.d.ts +19 -0
- package/dist/auth/local-auth-context.js +20 -0
- package/dist/auth/local-run-authorizer.d.ts +10 -0
- package/dist/auth/local-run-authorizer.js +23 -0
- package/dist/auth/types.d.ts +166 -0
- package/dist/auth/types.js +61 -0
- package/dist/billing/cached-resolver.d.ts +23 -0
- package/dist/billing/cached-resolver.js +61 -0
- package/dist/billing/noop-resolver.d.ts +6 -0
- package/dist/billing/noop-resolver.js +7 -0
- package/dist/billing/noop-run-charge.d.ts +6 -0
- package/dist/billing/noop-run-charge.js +10 -0
- package/dist/billing/resolver.d.ts +64 -0
- package/dist/billing/resolver.js +24 -0
- package/dist/billing/run-charge.d.ts +24 -0
- package/dist/billing/run-charge.js +9 -0
- package/dist/config/resource-limits.d.ts +76 -0
- package/dist/config/resource-limits.js +116 -0
- package/dist/contracts/analogy-report.d.ts +120 -0
- package/dist/contracts/analogy-report.js +50 -0
- package/dist/contracts/chat-events.d.ts +61 -0
- package/dist/contracts/chat-events.js +13 -0
- package/dist/contracts/chat-parts.d.ts +308 -0
- package/dist/contracts/chat-parts.js +13 -0
- package/dist/contracts/content-url.d.ts +49 -0
- package/dist/contracts/content-url.js +56 -0
- package/dist/contracts/index.d.ts +12 -0
- package/dist/contracts/index.js +5 -0
- package/dist/contracts/message.d.ts +36 -0
- package/dist/contracts/message.js +9 -0
- package/dist/contracts/part-registry.d.ts +18 -0
- package/dist/contracts/part-registry.js +28 -0
- package/dist/contracts/schemas/chat-events.d.ts +90 -0
- package/dist/contracts/schemas/chat-events.js +43 -0
- package/dist/contracts/schemas/chat-parts.d.ts +683 -0
- package/dist/contracts/schemas/chat-parts.js +295 -0
- package/dist/contracts/schemas/index.d.ts +2 -0
- package/dist/contracts/schemas/index.js +2 -0
- package/dist/contracts/target-assessment-row.d.ts +85 -0
- package/dist/contracts/target-assessment-row.js +37 -0
- package/dist/contracts/target-dossier.d.ts +16720 -0
- package/dist/contracts/target-dossier.js +1339 -0
- package/dist/data/clinical-benchmarks.json +108 -0
- package/dist/data/protein-family-modality.json +101 -0
- package/dist/data/safety-panel-schema.d.ts +64 -0
- package/dist/data/safety-panel-schema.js +34 -0
- package/dist/data/safety-panel.json +436 -0
- package/dist/execution/artifact-metadata.d.ts +74 -0
- package/dist/execution/artifact-metadata.js +203 -0
- package/dist/execution/artifact-record.d.ts +19 -0
- package/dist/execution/artifact-record.js +7 -0
- package/dist/execution/artifact-registration.d.ts +36 -0
- package/dist/execution/artifact-registration.js +61 -0
- package/dist/execution/artifact-registry.d.ts +82 -0
- package/dist/execution/artifact-registry.js +17 -0
- package/dist/execution/dbos-run-launcher.d.ts +7 -0
- package/dist/execution/dbos-run-launcher.js +38 -0
- package/dist/execution/ephemeral-runner.d.ts +81 -0
- package/dist/execution/ephemeral-runner.js +161 -0
- package/dist/execution/filesystem-artifact-registry.d.ts +57 -0
- package/dist/execution/filesystem-artifact-registry.js +92 -0
- package/dist/execution/noop-artifact-registry.d.ts +11 -0
- package/dist/execution/noop-artifact-registry.js +17 -0
- package/dist/execution/post-step-pipeline.d.ts +70 -0
- package/dist/execution/post-step-pipeline.js +207 -0
- package/dist/execution/post-step.d.ts +20 -0
- package/dist/execution/post-step.js +65 -0
- package/dist/execution/reconcile-manifest.d.ts +25 -0
- package/dist/execution/reconcile-manifest.js +132 -0
- package/dist/execution/report-render.d.ts +39 -0
- package/dist/execution/report-render.js +98 -0
- package/dist/execution/report-runner.d.ts +87 -0
- package/dist/execution/report-runner.js +227 -0
- package/dist/execution/run-authorizer.d.ts +43 -0
- package/dist/execution/run-authorizer.js +17 -0
- package/dist/execution/run-launcher.d.ts +36 -0
- package/dist/execution/run-launcher.js +15 -0
- package/dist/execution/run-synthesis.d.ts +107 -0
- package/dist/execution/run-synthesis.js +329 -0
- package/dist/execution/staged-input.d.ts +41 -0
- package/dist/execution/staged-input.js +15 -0
- package/dist/execution/step-summary-metrics.d.ts +10 -0
- package/dist/execution/step-summary-metrics.js +22 -0
- package/dist/execution/step-summary.d.ts +55 -0
- package/dist/execution/step-summary.js +106 -0
- package/dist/execution/topo-sort.d.ts +33 -0
- package/dist/execution/topo-sort.js +99 -0
- package/dist/index.d.ts +112 -0
- package/dist/index.js +157 -0
- package/dist/input-sanitization.d.ts +22 -0
- package/dist/input-sanitization.js +64 -0
- package/dist/lib/async-utils.d.ts +10 -0
- package/dist/lib/async-utils.js +24 -0
- package/dist/lib/chrome.d.ts +15 -0
- package/dist/lib/chrome.js +95 -0
- package/dist/lib/db-result.d.ts +93 -0
- package/dist/lib/db-result.js +197 -0
- package/dist/lib/fs-helpers.d.ts +74 -0
- package/dist/lib/fs-helpers.js +119 -0
- package/dist/lib/fs-result.d.ts +98 -0
- package/dist/lib/fs-result.js +137 -0
- package/dist/lib/host-concurrency.d.ts +16 -0
- package/dist/lib/host-concurrency.js +60 -0
- package/dist/lib/identifiers.d.ts +8 -0
- package/dist/lib/identifiers.js +10 -0
- package/dist/lib/metrics.d.ts +7 -0
- package/dist/lib/metrics.js +12 -0
- package/dist/lib/mime-detect.d.ts +17 -0
- package/dist/lib/mime-detect.js +29 -0
- package/dist/lib/otel.d.ts +30 -0
- package/dist/lib/otel.js +102 -0
- package/dist/lib/regulatory-corpus/fetch-fda-guidance.d.ts +35 -0
- package/dist/lib/regulatory-corpus/fetch-fda-guidance.js +107 -0
- package/dist/lib/regulatory-corpus/fetch-ich.d.ts +46 -0
- package/dist/lib/regulatory-corpus/fetch-ich.js +173 -0
- package/dist/lib/regulatory-corpus.d.ts +88 -0
- package/dist/lib/regulatory-corpus.js +141 -0
- package/dist/lib/result.d.ts +87 -0
- package/dist/lib/result.js +103 -0
- package/dist/lib/storage.d.ts +29 -0
- package/dist/lib/storage.js +37 -0
- package/dist/lib/streamed-download.d.ts +28 -0
- package/dist/lib/streamed-download.js +111 -0
- package/dist/lib/trace-context.d.ts +11 -0
- package/dist/lib/trace-context.js +49 -0
- package/dist/loop/__fixtures__/scripted-provider.d.ts +31 -0
- package/dist/loop/__fixtures__/scripted-provider.js +57 -0
- package/dist/loop/budget-exceeded.d.ts +22 -0
- package/dist/loop/budget-exceeded.js +41 -0
- package/dist/loop/metrics.d.ts +25 -0
- package/dist/loop/metrics.js +46 -0
- package/dist/loop/run-agent.d.ts +28 -0
- package/dist/loop/run-agent.js +204 -0
- package/dist/loop/run-step.d.ts +29 -0
- package/dist/loop/run-step.js +34 -0
- package/dist/loop/run-to-terminal.d.ts +46 -0
- package/dist/loop/run-to-terminal.js +51 -0
- package/dist/loop/types.d.ts +95 -0
- package/dist/loop/types.js +10 -0
- package/dist/memory/ai-sdk-message-storage.d.ts +20 -0
- package/dist/memory/ai-sdk-message-storage.js +114 -0
- package/dist/memory/card-builders.d.ts +114 -0
- package/dist/memory/card-builders.js +231 -0
- package/dist/memory/content-to-cortex.d.ts +42 -0
- package/dist/memory/content-to-cortex.js +85 -0
- package/dist/memory/count-tokens.d.ts +18 -0
- package/dist/memory/count-tokens.js +64 -0
- package/dist/memory/derive-thread-title.d.ts +14 -0
- package/dist/memory/derive-thread-title.js +26 -0
- package/dist/memory/message-backfill.d.ts +2 -0
- package/dist/memory/message-backfill.js +38 -0
- package/dist/memory/reconstruct-cards.d.ts +23 -0
- package/dist/memory/reconstruct-cards.js +64 -0
- package/dist/memory/thread-history.d.ts +80 -0
- package/dist/memory/thread-history.js +187 -0
- package/dist/memory/thread-store.d.ts +66 -0
- package/dist/memory/thread-store.js +88 -0
- package/dist/memory/working-memory.d.ts +135 -0
- package/dist/memory/working-memory.js +185 -0
- package/dist/prompts/SOUL.d.ts +17 -0
- package/dist/prompts/SOUL.js +173 -0
- package/dist/prompts/analogical-reasoner.d.ts +1 -0
- package/dist/prompts/analogical-reasoner.js +170 -0
- package/dist/prompts/conversation.d.ts +1 -0
- package/dist/prompts/conversation.js +697 -0
- package/dist/prompts/execute-analysis/step-summary.d.ts +1 -0
- package/dist/prompts/execute-analysis/step-summary.js +38 -0
- package/dist/prompts/literature-reviewer.d.ts +1 -0
- package/dist/prompts/literature-reviewer.js +107 -0
- package/dist/prompts/planner.d.ts +2 -0
- package/dist/prompts/planner.js +259 -0
- package/dist/prompts/report-builder.d.ts +1 -0
- package/dist/prompts/report-builder.js +127 -0
- package/dist/prompts/sandbox/bulk-transcriptomics-agent.d.ts +1 -0
- package/dist/prompts/sandbox/bulk-transcriptomics-agent.js +78 -0
- package/dist/prompts/sandbox/cheminformatics-agent.d.ts +1 -0
- package/dist/prompts/sandbox/cheminformatics-agent.js +224 -0
- package/dist/prompts/sandbox/chromatin-agent.d.ts +1 -0
- package/dist/prompts/sandbox/chromatin-agent.js +100 -0
- package/dist/prompts/sandbox/data-profiler.d.ts +1 -0
- package/dist/prompts/sandbox/data-profiler.js +291 -0
- package/dist/prompts/sandbox/dna-methylation-agent.d.ts +1 -0
- package/dist/prompts/sandbox/dna-methylation-agent.js +96 -0
- package/dist/prompts/sandbox/drug-repurposing-agent.d.ts +1 -0
- package/dist/prompts/sandbox/drug-repurposing-agent.js +144 -0
- package/dist/prompts/sandbox/enrichment-agent.d.ts +1 -0
- package/dist/prompts/sandbox/enrichment-agent.js +89 -0
- package/dist/prompts/sandbox/ephemeral-executor.d.ts +1 -0
- package/dist/prompts/sandbox/ephemeral-executor.js +66 -0
- package/dist/prompts/sandbox/genomic-variant-agent.d.ts +1 -0
- package/dist/prompts/sandbox/genomic-variant-agent.js +83 -0
- package/dist/prompts/sandbox/immune-profiling-agent.d.ts +1 -0
- package/dist/prompts/sandbox/immune-profiling-agent.js +101 -0
- package/dist/prompts/sandbox/metabolomics-agent.d.ts +1 -0
- package/dist/prompts/sandbox/metabolomics-agent.js +89 -0
- package/dist/prompts/sandbox/microbiome-agent.d.ts +1 -0
- package/dist/prompts/sandbox/microbiome-agent.js +109 -0
- package/dist/prompts/sandbox/multi-omics-integration-agent.d.ts +1 -0
- package/dist/prompts/sandbox/multi-omics-integration-agent.js +122 -0
- package/dist/prompts/sandbox/multimodal-sc-agent.d.ts +1 -0
- package/dist/prompts/sandbox/multimodal-sc-agent.js +90 -0
- package/dist/prompts/sandbox/network-agent.d.ts +1 -0
- package/dist/prompts/sandbox/network-agent.js +95 -0
- package/dist/prompts/sandbox/pkpd-clinical-response-agent.d.ts +1 -0
- package/dist/prompts/sandbox/pkpd-clinical-response-agent.js +71 -0
- package/dist/prompts/sandbox/proteomics-agent.d.ts +1 -0
- package/dist/prompts/sandbox/proteomics-agent.js +93 -0
- package/dist/prompts/sandbox/scientific-executor.d.ts +1 -0
- package/dist/prompts/sandbox/scientific-executor.js +68 -0
- package/dist/prompts/sandbox/single-cell-agent.d.ts +1 -0
- package/dist/prompts/sandbox/single-cell-agent.js +129 -0
- package/dist/prompts/sandbox/spatial-omics-agent.d.ts +1 -0
- package/dist/prompts/sandbox/spatial-omics-agent.js +94 -0
- package/dist/prompts/sandbox/statistical-modeling-agent.d.ts +1 -0
- package/dist/prompts/sandbox/statistical-modeling-agent.js +112 -0
- package/dist/prompts/sandbox/translational-safety-agent.d.ts +1 -0
- package/dist/prompts/sandbox/translational-safety-agent.js +105 -0
- package/dist/prompts/sandbox-standards.d.ts +18 -0
- package/dist/prompts/sandbox-standards.js +358 -0
- package/dist/prompts/synthesis-agent.d.ts +1 -0
- package/dist/prompts/synthesis-agent.js +289 -0
- package/dist/prompts/target-assessment/briefs/executive-recommendation.d.ts +1 -0
- package/dist/prompts/target-assessment/briefs/executive-recommendation.js +85 -0
- package/dist/prompts/target-assessment/briefs/index.d.ts +4 -0
- package/dist/prompts/target-assessment/briefs/index.js +4 -0
- package/dist/prompts/target-assessment/briefs/liability-bullets.d.ts +1 -0
- package/dist/prompts/target-assessment/briefs/liability-bullets.js +114 -0
- package/dist/prompts/target-assessment/briefs/target-organ-liabilities.d.ts +1 -0
- package/dist/prompts/target-assessment/briefs/target-organ-liabilities.js +29 -0
- package/dist/prompts/target-assessment/briefs/translational-commentary.d.ts +1 -0
- package/dist/prompts/target-assessment/briefs/translational-commentary.js +23 -0
- package/dist/prompts/target-assessment/drugs-in-class.d.ts +1 -0
- package/dist/prompts/target-assessment/drugs-in-class.js +29 -0
- package/dist/prompts/target-assessment/modulator-triage.d.ts +1 -0
- package/dist/prompts/target-assessment/modulator-triage.js +31 -0
- package/dist/prompts/target-assessment/off-target-annotator.d.ts +1 -0
- package/dist/prompts/target-assessment/off-target-annotator.js +28 -0
- package/dist/prompts/target-assessment/tox-voice/core.d.ts +1 -0
- package/dist/prompts/target-assessment/tox-voice/core.js +74 -0
- package/dist/prompts/target-assessment/tox-voice/critique.d.ts +7 -0
- package/dist/prompts/target-assessment/tox-voice/critique.js +109 -0
- package/dist/prompts/target-assessment/tox-voice/exemplars.d.ts +8 -0
- package/dist/prompts/target-assessment/tox-voice/exemplars.js +24 -0
- package/dist/prompts/target-assessment/tox-voice/index.d.ts +4 -0
- package/dist/prompts/target-assessment/tox-voice/index.js +4 -0
- package/dist/prompts/target-assessment/tox-voice/vocabulary.d.ts +15 -0
- package/dist/prompts/target-assessment/tox-voice/vocabulary.js +72 -0
- package/dist/provenance/collector.d.ts +148 -0
- package/dist/provenance/collector.js +296 -0
- package/dist/provenance/exec-frame.d.ts +36 -0
- package/dist/provenance/exec-frame.js +49 -0
- package/dist/provenance/types.d.ts +95 -0
- package/dist/provenance/types.js +64 -0
- package/dist/providers/__fixtures__/session.d.ts +16 -0
- package/dist/providers/__fixtures__/session.js +20 -0
- package/dist/providers/ai-sdk.d.ts +47 -0
- package/dist/providers/ai-sdk.js +142 -0
- package/dist/providers/anthropic.d.ts +22 -0
- package/dist/providers/anthropic.js +26 -0
- package/dist/providers/embedding.d.ts +32 -0
- package/dist/providers/embedding.js +42 -0
- package/dist/providers/errors.d.ts +80 -0
- package/dist/providers/errors.js +137 -0
- package/dist/providers/llm-capabilities.d.ts +33 -0
- package/dist/providers/llm-capabilities.js +58 -0
- package/dist/providers/streaming-chat.d.ts +23 -0
- package/dist/providers/streaming-chat.js +61 -0
- package/dist/providers/types.d.ts +59 -0
- package/dist/providers/types.js +8 -0
- package/dist/runtime/assemble.d.ts +68 -0
- package/dist/runtime/assemble.js +46 -0
- package/dist/runtime/boot.d.ts +73 -0
- package/dist/runtime/boot.js +65 -0
- package/dist/runtime/connection-budget.d.ts +48 -0
- package/dist/runtime/connection-budget.js +57 -0
- package/dist/runtime/dbos.d.ts +94 -0
- package/dist/runtime/dbos.js +160 -0
- package/dist/runtime/lifecycle.d.ts +12 -0
- package/dist/runtime/lifecycle.js +19 -0
- package/dist/runtime/pools.d.ts +25 -0
- package/dist/runtime/pools.js +30 -0
- package/dist/runtime/shutdown.d.ts +33 -0
- package/dist/runtime/shutdown.js +39 -0
- package/dist/sandbox/await-exec.d.ts +143 -0
- package/dist/sandbox/await-exec.js +406 -0
- package/dist/sandbox/client.d.ts +82 -0
- package/dist/sandbox/client.js +23 -0
- package/dist/sandbox/create-sandbox.d.ts +105 -0
- package/dist/sandbox/create-sandbox.js +132 -0
- package/dist/sandbox/deliver-exec-event.d.ts +25 -0
- package/dist/sandbox/deliver-exec-event.js +29 -0
- package/dist/sandbox/docker-client.d.ts +75 -0
- package/dist/sandbox/docker-client.js +315 -0
- package/dist/sandbox/estimate-data-profile-resources.d.ts +5 -0
- package/dist/sandbox/estimate-data-profile-resources.js +73 -0
- package/dist/sandbox/exec-id.d.ts +12 -0
- package/dist/sandbox/exec-id.js +20 -0
- package/dist/sandbox/execution-id.d.ts +30 -0
- package/dist/sandbox/execution-id.js +47 -0
- package/dist/sandbox/hmac.d.ts +54 -0
- package/dist/sandbox/hmac.js +67 -0
- package/dist/sandbox/identity.d.ts +15 -0
- package/dist/sandbox/identity.js +22 -0
- package/dist/sandbox/ignored-dirs.d.ts +7 -0
- package/dist/sandbox/ignored-dirs.js +7 -0
- package/dist/sandbox/k8s-client.d.ts +71 -0
- package/dist/sandbox/k8s-client.js +488 -0
- package/dist/sandbox/liveness.d.ts +60 -0
- package/dist/sandbox/liveness.js +82 -0
- package/dist/sandbox/mount-plan.d.ts +77 -0
- package/dist/sandbox/mount-plan.js +84 -0
- package/dist/sandbox/notification-sweep.d.ts +42 -0
- package/dist/sandbox/notification-sweep.js +74 -0
- package/dist/sandbox/reaper.d.ts +70 -0
- package/dist/sandbox/reaper.js +124 -0
- package/dist/sandbox/sandbox-error.d.ts +105 -0
- package/dist/sandbox/sandbox-error.js +92 -0
- package/dist/sandbox/sandbox-step-translate.d.ts +35 -0
- package/dist/sandbox/sandbox-step-translate.js +76 -0
- package/dist/sandbox/submit-exec.d.ts +33 -0
- package/dist/sandbox/submit-exec.js +68 -0
- package/dist/sandbox/types.d.ts +277 -0
- package/dist/sandbox/types.js +147 -0
- package/dist/sandbox/watchdog.d.ts +71 -0
- package/dist/sandbox/watchdog.js +150 -0
- package/dist/schemas/artifact-manifest.d.ts +34 -0
- package/dist/schemas/artifact-manifest.js +36 -0
- package/dist/schemas/data-profile-schemas.d.ts +92 -0
- package/dist/schemas/data-profile-schemas.js +89 -0
- package/dist/schemas/file-metadata.d.ts +51 -0
- package/dist/schemas/file-metadata.js +39 -0
- package/dist/schemas/plan-schemas.d.ts +110 -0
- package/dist/schemas/plan-schemas.js +50 -0
- package/dist/schemas/render-step-prompt.d.ts +32 -0
- package/dist/schemas/render-step-prompt.js +76 -0
- package/dist/schemas/run-synthesis.d.ts +148 -0
- package/dist/schemas/run-synthesis.js +87 -0
- package/dist/schemas/step-summary.d.ts +18 -0
- package/dist/schemas/step-summary.js +20 -0
- package/dist/schemas/validate-plan.d.ts +39 -0
- package/dist/schemas/validate-plan.js +120 -0
- package/dist/schemas/workflow-state.d.ts +314 -0
- package/dist/schemas/workflow-state.js +139 -0
- package/dist/state/active-sandboxes.d.ts +58 -0
- package/dist/state/active-sandboxes.js +100 -0
- package/dist/state/analyses-metrics.d.ts +21 -0
- package/dist/state/analyses-metrics.js +59 -0
- package/dist/state/analyses.d.ts +58 -0
- package/dist/state/analyses.js +132 -0
- package/dist/state/artifacts.d.ts +53 -0
- package/dist/state/artifacts.js +175 -0
- package/dist/state/data-profile.d.ts +176 -0
- package/dist/state/data-profile.js +284 -0
- package/dist/state/db.d.ts +10 -0
- package/dist/state/db.js +9 -0
- package/dist/state/index.d.ts +29 -0
- package/dist/state/index.js +20 -0
- package/dist/state/init.d.ts +14 -0
- package/dist/state/init.js +406 -0
- package/dist/state/plans.d.ts +56 -0
- package/dist/state/plans.js +117 -0
- package/dist/state/runs.d.ts +69 -0
- package/dist/state/runs.js +206 -0
- package/dist/state/schema.d.ts +150 -0
- package/dist/state/schema.js +100 -0
- package/dist/state/step-executions.d.ts +77 -0
- package/dist/state/step-executions.js +175 -0
- package/dist/state/target-assessments.d.ts +68 -0
- package/dist/state/target-assessments.js +222 -0
- package/dist/state/vector-store.d.ts +53 -0
- package/dist/state/vector-store.js +89 -0
- package/dist/tasks/data-profile.d.ts +171 -0
- package/dist/tasks/data-profile.js +461 -0
- package/dist/tasks/refresh-regulatory-corpus.d.ts +59 -0
- package/dist/tasks/refresh-regulatory-corpus.js +146 -0
- package/dist/tasks/regulatory-corpus-boot-refresh.d.ts +55 -0
- package/dist/tasks/regulatory-corpus-boot-refresh.js +149 -0
- package/dist/tools/__fixtures__/tool-context.d.ts +13 -0
- package/dist/tools/__fixtures__/tool-context.js +18 -0
- package/dist/tools/bio/check-safety-panel.d.ts +35 -0
- package/dist/tools/bio/check-safety-panel.js +76 -0
- package/dist/tools/bio/find-approval-precedent.d.ts +32 -0
- package/dist/tools/bio/find-approval-precedent.js +72 -0
- package/dist/tools/bio/get-article-details.d.ts +11 -0
- package/dist/tools/bio/get-article-details.js +20 -0
- package/dist/tools/bio/get-article-full-text.d.ts +19 -0
- package/dist/tools/bio/get-article-full-text.js +32 -0
- package/dist/tools/bio/get-bioactivity.d.ts +11 -0
- package/dist/tools/bio/get-bioactivity.js +23 -0
- package/dist/tools/bio/get-drug-info.d.ts +9 -0
- package/dist/tools/bio/get-drug-info.js +22 -0
- package/dist/tools/bio/get-impc-ko-profile.d.ts +9 -0
- package/dist/tools/bio/get-impc-ko-profile.js +20 -0
- package/dist/tools/bio/get-mechanism.d.ts +8 -0
- package/dist/tools/bio/get-mechanism.js +18 -0
- package/dist/tools/bio/get-pubchem-assays.d.ts +22 -0
- package/dist/tools/bio/get-pubchem-assays.js +107 -0
- package/dist/tools/bio/get-pubchem-cross-refs.d.ts +15 -0
- package/dist/tools/bio/get-pubchem-cross-refs.js +68 -0
- package/dist/tools/bio/get-target-safety.d.ts +18 -0
- package/dist/tools/bio/get-target-safety.js +26 -0
- package/dist/tools/bio/index.d.ts +41 -0
- package/dist/tools/bio/index.js +48 -0
- package/dist/tools/bio/keys.d.ts +31 -0
- package/dist/tools/bio/keys.js +30 -0
- package/dist/tools/bio/lookup-go-term.d.ts +31 -0
- package/dist/tools/bio/lookup-go-term.js +116 -0
- package/dist/tools/bio/search-bgee-expression.d.ts +10 -0
- package/dist/tools/bio/search-bgee-expression.js +24 -0
- package/dist/tools/bio/search-clinical-trials.d.ts +12 -0
- package/dist/tools/bio/search-clinical-trials.js +21 -0
- package/dist/tools/bio/search-clinvar.d.ts +13 -0
- package/dist/tools/bio/search-clinvar.js +28 -0
- package/dist/tools/bio/search-compounds.d.ts +22 -0
- package/dist/tools/bio/search-compounds.js +160 -0
- package/dist/tools/bio/search-ctx-chemical.d.ts +50 -0
- package/dist/tools/bio/search-ctx-chemical.js +130 -0
- package/dist/tools/bio/search-ctx-exposure.d.ts +55 -0
- package/dist/tools/bio/search-ctx-exposure.js +176 -0
- package/dist/tools/bio/search-ctx-hazard.d.ts +111 -0
- package/dist/tools/bio/search-ctx-hazard.js +178 -0
- package/dist/tools/bio/search-dgidb.d.ts +43 -0
- package/dist/tools/bio/search-dgidb.js +199 -0
- package/dist/tools/bio/search-disgenet.d.ts +30 -0
- package/dist/tools/bio/search-disgenet.js +84 -0
- package/dist/tools/bio/search-drugbank.d.ts +38 -0
- package/dist/tools/bio/search-drugbank.js +109 -0
- package/dist/tools/bio/search-faers.d.ts +11 -0
- package/dist/tools/bio/search-faers.js +23 -0
- package/dist/tools/bio/search-gene.d.ts +11 -0
- package/dist/tools/bio/search-gene.js +19 -0
- package/dist/tools/bio/search-geo-datasets.d.ts +20 -0
- package/dist/tools/bio/search-geo-datasets.js +86 -0
- package/dist/tools/bio/search-gwas-catalog.d.ts +33 -0
- package/dist/tools/bio/search-gwas-catalog.js +172 -0
- package/dist/tools/bio/search-interactions.d.ts +17 -0
- package/dist/tools/bio/search-interactions.js +31 -0
- package/dist/tools/bio/search-opentargets.d.ts +11 -0
- package/dist/tools/bio/search-opentargets.js +25 -0
- package/dist/tools/bio/search-pathway.d.ts +12 -0
- package/dist/tools/bio/search-pathway.js +32 -0
- package/dist/tools/bio/search-pharmgkb.d.ts +17 -0
- package/dist/tools/bio/search-pharmgkb.js +46 -0
- package/dist/tools/bio/search-pubchem-compound.d.ts +26 -0
- package/dist/tools/bio/search-pubchem-compound.js +110 -0
- package/dist/tools/bio/search-pubmed.d.ts +17 -0
- package/dist/tools/bio/search-pubmed.js +31 -0
- package/dist/tools/bio/search-targets.d.ts +9 -0
- package/dist/tools/bio/search-targets.js +20 -0
- package/dist/tools/bio/search-toxcast.d.ts +36 -0
- package/dist/tools/bio/search-toxcast.js +141 -0
- package/dist/tools/define-tool.d.ts +80 -0
- package/dist/tools/define-tool.js +48 -0
- package/dist/tools/display/index.d.ts +4 -0
- package/dist/tools/display/index.js +4 -0
- package/dist/tools/display/show-user.d.ts +33 -0
- package/dist/tools/display/show-user.js +67 -0
- package/dist/tools/execute-plan.d.ts +64 -0
- package/dist/tools/execute-plan.js +208 -0
- package/dist/tools/iterate-report.d.ts +172 -0
- package/dist/tools/iterate-report.js +521 -0
- package/dist/tools/lib/api-utils.d.ts +80 -0
- package/dist/tools/lib/api-utils.js +128 -0
- package/dist/tools/lib/bgee-client.d.ts +36 -0
- package/dist/tools/lib/bgee-client.js +150 -0
- package/dist/tools/lib/cbioportal-client.d.ts +34 -0
- package/dist/tools/lib/cbioportal-client.js +159 -0
- package/dist/tools/lib/chembl-client.d.ts +123 -0
- package/dist/tools/lib/chembl-client.js +458 -0
- package/dist/tools/lib/chembl-config.d.ts +5 -0
- package/dist/tools/lib/chembl-config.js +3 -0
- package/dist/tools/lib/clinical-benchmarks-client.d.ts +33 -0
- package/dist/tools/lib/clinical-benchmarks-client.js +54 -0
- package/dist/tools/lib/clinical-trials-client.d.ts +216 -0
- package/dist/tools/lib/clinical-trials-client.js +339 -0
- package/dist/tools/lib/clinicaltrials-config.d.ts +4 -0
- package/dist/tools/lib/clinicaltrials-config.js +2 -0
- package/dist/tools/lib/clinvar-client.d.ts +25 -0
- package/dist/tools/lib/clinvar-client.js +126 -0
- package/dist/tools/lib/disgenet-config.d.ts +2 -0
- package/dist/tools/lib/disgenet-config.js +11 -0
- package/dist/tools/lib/drugbank-config.d.ts +2 -0
- package/dist/tools/lib/drugbank-config.js +12 -0
- package/dist/tools/lib/ema-client.d.ts +45 -0
- package/dist/tools/lib/ema-client.js +127 -0
- package/dist/tools/lib/ema-config.d.ts +7 -0
- package/dist/tools/lib/ema-config.js +7 -0
- package/dist/tools/lib/ensembl-client.d.ts +27 -0
- package/dist/tools/lib/ensembl-client.js +82 -0
- package/dist/tools/lib/gwas-catalog-config.d.ts +4 -0
- package/dist/tools/lib/gwas-catalog-config.js +2 -0
- package/dist/tools/lib/identifier-resolver.d.ts +85 -0
- package/dist/tools/lib/identifier-resolver.js +333 -0
- package/dist/tools/lib/impc-client.d.ts +44 -0
- package/dist/tools/lib/impc-client.js +239 -0
- package/dist/tools/lib/iuphar-client.d.ts +75 -0
- package/dist/tools/lib/iuphar-client.js +230 -0
- package/dist/tools/lib/iuphar-config.d.ts +5 -0
- package/dist/tools/lib/iuphar-config.js +3 -0
- package/dist/tools/lib/ncbi-utils.d.ts +58 -0
- package/dist/tools/lib/ncbi-utils.js +286 -0
- package/dist/tools/lib/openfda-client.d.ts +53 -0
- package/dist/tools/lib/openfda-client.js +192 -0
- package/dist/tools/lib/openfda-config.d.ts +2 -0
- package/dist/tools/lib/openfda-config.js +2 -0
- package/dist/tools/lib/opentargets-client.d.ts +64 -0
- package/dist/tools/lib/opentargets-client.js +290 -0
- package/dist/tools/lib/opentargets-config.d.ts +5 -0
- package/dist/tools/lib/opentargets-config.js +5 -0
- package/dist/tools/lib/path-validation.d.ts +14 -0
- package/dist/tools/lib/path-validation.js +26 -0
- package/dist/tools/lib/pathway-client.d.ts +27 -0
- package/dist/tools/lib/pathway-client.js +149 -0
- package/dist/tools/lib/pharmgkb-config.d.ts +4 -0
- package/dist/tools/lib/pharmgkb-config.js +2 -0
- package/dist/tools/lib/preview-lock.d.ts +20 -0
- package/dist/tools/lib/preview-lock.js +35 -0
- package/dist/tools/lib/protein-family-modality.d.ts +16 -0
- package/dist/tools/lib/protein-family-modality.js +42 -0
- package/dist/tools/lib/protein-family-normalize.d.ts +12 -0
- package/dist/tools/lib/protein-family-normalize.js +46 -0
- package/dist/tools/lib/pubchem-client.d.ts +40 -0
- package/dist/tools/lib/pubchem-client.js +128 -0
- package/dist/tools/lib/pubchem-config.d.ts +5 -0
- package/dist/tools/lib/pubchem-config.js +3 -0
- package/dist/tools/lib/pubmed-client.d.ts +28 -0
- package/dist/tools/lib/pubmed-client.js +91 -0
- package/dist/tools/lib/report-preflight.d.ts +39 -0
- package/dist/tools/lib/report-preflight.js +283 -0
- package/dist/tools/lib/string-client.d.ts +33 -0
- package/dist/tools/lib/string-client.js +93 -0
- package/dist/tools/lib/toxcast-config.d.ts +2 -0
- package/dist/tools/lib/toxcast-config.js +11 -0
- package/dist/tools/lib/uniprot-client.d.ts +28 -0
- package/dist/tools/lib/uniprot-client.js +103 -0
- package/dist/tools/lib/uniprot-config.d.ts +5 -0
- package/dist/tools/lib/uniprot-config.js +3 -0
- package/dist/tools/memory/index.d.ts +4 -0
- package/dist/tools/memory/index.js +4 -0
- package/dist/tools/memory/update-working-memory.d.ts +25 -0
- package/dist/tools/memory/update-working-memory.js +112 -0
- package/dist/tools/registry.d.ts +15 -0
- package/dist/tools/registry.js +26 -0
- package/dist/tools/report/build-report.d.ts +13 -0
- package/dist/tools/report/build-report.js +26 -0
- package/dist/tools/report/index.d.ts +14 -0
- package/dist/tools/report/index.js +14 -0
- package/dist/tools/report/mint-preview-url.d.ts +26 -0
- package/dist/tools/report/mint-preview-url.js +44 -0
- package/dist/tools/report/preview-publisher.d.ts +37 -0
- package/dist/tools/report/preview-publisher.js +25 -0
- package/dist/tools/report/preview-snapshot.d.ts +26 -0
- package/dist/tools/report/preview-snapshot.js +121 -0
- package/dist/tools/report/submit-report.d.ts +25 -0
- package/dist/tools/report/submit-report.js +126 -0
- package/dist/tools/report/version-fs.d.ts +15 -0
- package/dist/tools/report/version-fs.js +154 -0
- package/dist/tools/research/context7-docs.d.ts +31 -0
- package/dist/tools/research/context7-docs.js +61 -0
- package/dist/tools/research/generate-analogy-report.d.ts +60 -0
- package/dist/tools/research/generate-analogy-report.js +288 -0
- package/dist/tools/research/generate-plan.d.ts +39 -0
- package/dist/tools/research/generate-plan.js +393 -0
- package/dist/tools/research/index.d.ts +15 -0
- package/dist/tools/research/index.js +15 -0
- package/dist/tools/research/inspect-run.d.ts +54 -0
- package/dist/tools/research/inspect-run.js +85 -0
- package/dist/tools/research/literature-reviewer.d.ts +29 -0
- package/dist/tools/research/literature-reviewer.js +84 -0
- package/dist/tools/research/search-arxiv.d.ts +32 -0
- package/dist/tools/research/search-arxiv.js +123 -0
- package/dist/tools/research/search-github-repos.d.ts +32 -0
- package/dist/tools/research/search-github-repos.js +86 -0
- package/dist/tools/research/search-semantic-scholar.d.ts +33 -0
- package/dist/tools/research/search-semantic-scholar.js +93 -0
- package/dist/tools/run-ephemeral.d.ts +33 -0
- package/dist/tools/run-ephemeral.js +65 -0
- package/dist/tools/sandbox/index.d.ts +7 -0
- package/dist/tools/sandbox/index.js +7 -0
- package/dist/tools/sandbox/list-available-packages.d.ts +7 -0
- package/dist/tools/sandbox/list-available-packages.js +27 -0
- package/dist/tools/sandbox/list-available-refs.d.ts +7 -0
- package/dist/tools/sandbox/list-available-refs.js +147 -0
- package/dist/tools/sandbox/report-blocker.d.ts +23 -0
- package/dist/tools/sandbox/report-blocker.js +39 -0
- package/dist/tools/sandbox/skills.d.ts +72 -0
- package/dist/tools/sandbox/skills.js +144 -0
- package/dist/tools/workspace/edit-file.d.ts +46 -0
- package/dist/tools/workspace/edit-file.js +100 -0
- package/dist/tools/workspace/execute-command.d.ts +80 -0
- package/dist/tools/workspace/execute-command.js +95 -0
- package/dist/tools/workspace/file-stat.d.ts +24 -0
- package/dist/tools/workspace/file-stat.js +37 -0
- package/dist/tools/workspace/grep.d.ts +57 -0
- package/dist/tools/workspace/grep.js +154 -0
- package/dist/tools/workspace/index.d.ts +26 -0
- package/dist/tools/workspace/index.js +27 -0
- package/dist/tools/workspace/list-files.d.ts +24 -0
- package/dist/tools/workspace/list-files.js +38 -0
- package/dist/tools/workspace/mutator.d.ts +83 -0
- package/dist/tools/workspace/mutator.js +81 -0
- package/dist/tools/workspace/read-file.d.ts +39 -0
- package/dist/tools/workspace/read-file.js +93 -0
- package/dist/tools/workspace/result-bounds.d.ts +42 -0
- package/dist/tools/workspace/result-bounds.js +50 -0
- package/dist/tools/workspace/run-exec.d.ts +32 -0
- package/dist/tools/workspace/run-exec.js +34 -0
- package/dist/tools/workspace/show-file.d.ts +37 -0
- package/dist/tools/workspace/show-file.js +54 -0
- package/dist/tools/workspace/show-plan.d.ts +23 -0
- package/dist/tools/workspace/show-plan.js +44 -0
- package/dist/tools/workspace/workspace-search.d.ts +25 -0
- package/dist/tools/workspace/workspace-search.js +78 -0
- package/dist/tools/workspace/write-file.d.ts +16 -0
- package/dist/tools/workspace/write-file.js +33 -0
- package/dist/workflows/execute-analysis-scheduler.d.ts +94 -0
- package/dist/workflows/execute-analysis-scheduler.js +186 -0
- package/dist/workflows/execute-analysis.d.ts +271 -0
- package/dist/workflows/execute-analysis.js +746 -0
- package/dist/workflows/execute-target-assessment.d.ts +101 -0
- package/dist/workflows/execute-target-assessment.js +528 -0
- package/dist/workflows/metrics.d.ts +37 -0
- package/dist/workflows/metrics.js +55 -0
- package/dist/workflows/plan/level.d.ts +12 -0
- package/dist/workflows/plan/level.js +12 -0
- package/dist/workflows/register-workflows.d.ts +51 -0
- package/dist/workflows/register-workflows.js +48 -0
- package/dist/workflows/resume-execute-analysis.d.ts +70 -0
- package/dist/workflows/resume-execute-analysis.js +80 -0
- package/dist/workflows/sandbox-step.d.ts +243 -0
- package/dist/workflows/sandbox-step.js +573 -0
- package/dist/workflows/target-assessment/assemblers/index.d.ts +5 -0
- package/dist/workflows/target-assessment/assemblers/index.js +4 -0
- package/dist/workflows/target-assessment/assemblers/literature.d.ts +299 -0
- package/dist/workflows/target-assessment/assemblers/literature.js +987 -0
- package/dist/workflows/target-assessment/assemblers/orchestrator.d.ts +109 -0
- package/dist/workflows/target-assessment/assemblers/orchestrator.js +835 -0
- package/dist/workflows/target-assessment/assemblers/safety.d.ts +352 -0
- package/dist/workflows/target-assessment/assemblers/safety.js +985 -0
- package/dist/workflows/target-assessment/assemblers/trials.d.ts +30 -0
- package/dist/workflows/target-assessment/assemblers/trials.js +75 -0
- package/dist/workflows/target-assessment/collectors/index.d.ts +105 -0
- package/dist/workflows/target-assessment/collectors/index.js +468 -0
- package/dist/workflows/target-assessment/correction-loop.d.ts +45 -0
- package/dist/workflows/target-assessment/correction-loop.js +62 -0
- package/dist/workflows/target-assessment/coverage.d.ts +81 -0
- package/dist/workflows/target-assessment/coverage.js +82 -0
- package/dist/workflows/target-assessment/decisions/index.d.ts +86 -0
- package/dist/workflows/target-assessment/decisions/index.js +127 -0
- package/dist/workflows/target-assessment/fanout/index.d.ts +31 -0
- package/dist/workflows/target-assessment/fanout/index.js +155 -0
- package/dist/workflows/target-assessment/lib/approval-precedents.d.ts +52 -0
- package/dist/workflows/target-assessment/lib/approval-precedents.js +119 -0
- package/dist/workflows/target-assessment/lib/citation-validator.d.ts +46 -0
- package/dist/workflows/target-assessment/lib/citation-validator.js +316 -0
- package/dist/workflows/target-assessment/lib/clinical-consequence-annotator.d.ts +62 -0
- package/dist/workflows/target-assessment/lib/clinical-consequence-annotator.js +172 -0
- package/dist/workflows/target-assessment/lib/clinical-evidence-attribution.d.ts +45 -0
- package/dist/workflows/target-assessment/lib/clinical-evidence-attribution.js +156 -0
- package/dist/workflows/target-assessment/lib/compute-derived.d.ts +19 -0
- package/dist/workflows/target-assessment/lib/compute-derived.js +252 -0
- package/dist/workflows/target-assessment/lib/compute-selectivity.d.ts +15 -0
- package/dist/workflows/target-assessment/lib/compute-selectivity.js +18 -0
- package/dist/workflows/target-assessment/lib/dedup-modulators.d.ts +37 -0
- package/dist/workflows/target-assessment/lib/dedup-modulators.js +157 -0
- package/dist/workflows/target-assessment/lib/evidence-conflict-detector.d.ts +17 -0
- package/dist/workflows/target-assessment/lib/evidence-conflict-detector.js +100 -0
- package/dist/workflows/target-assessment/lib/expression-constants.d.ts +21 -0
- package/dist/workflows/target-assessment/lib/expression-constants.js +21 -0
- package/dist/workflows/target-assessment/lib/family-complex-supplement.d.ts +21 -0
- package/dist/workflows/target-assessment/lib/family-complex-supplement.js +37 -0
- package/dist/workflows/target-assessment/lib/heterodimer-filter.d.ts +39 -0
- package/dist/workflows/target-assessment/lib/heterodimer-filter.js +54 -0
- package/dist/workflows/target-assessment/lib/intended-polypharm-filter.d.ts +4 -0
- package/dist/workflows/target-assessment/lib/intended-polypharm-filter.js +24 -0
- package/dist/workflows/target-assessment/lib/llm-step.d.ts +77 -0
- package/dist/workflows/target-assessment/lib/llm-step.js +99 -0
- package/dist/workflows/target-assessment/lib/meddra-organ-map.d.ts +30 -0
- package/dist/workflows/target-assessment/lib/meddra-organ-map.js +126 -0
- package/dist/workflows/target-assessment/lib/recommendation-quality-gates.d.ts +17 -0
- package/dist/workflows/target-assessment/lib/recommendation-quality-gates.js +99 -0
- package/dist/workflows/target-assessment/lib/recommendation-sanitizer.d.ts +2 -0
- package/dist/workflows/target-assessment/lib/recommendation-sanitizer.js +51 -0
- package/dist/workflows/target-assessment/lib/regulatory-actions.d.ts +26 -0
- package/dist/workflows/target-assessment/lib/regulatory-actions.js +147 -0
- package/dist/workflows/target-assessment/lib/structured-llm.d.ts +58 -0
- package/dist/workflows/target-assessment/lib/structured-llm.js +101 -0
- package/dist/workflows/target-assessment/lib/target-identity-filter.d.ts +60 -0
- package/dist/workflows/target-assessment/lib/target-identity-filter.js +86 -0
- package/dist/workflows/target-assessment/lib/therapeutic-programs.d.ts +20 -0
- package/dist/workflows/target-assessment/lib/therapeutic-programs.js +68 -0
- package/dist/workflows/target-assessment/metrics.d.ts +21 -0
- package/dist/workflows/target-assessment/metrics.js +42 -0
- package/dist/workflows/target-assessment/phase4-assemble.d.ts +1841 -0
- package/dist/workflows/target-assessment/phase4-assemble.js +39 -0
- package/dist/workflows/target-assessment/phase5-persist.d.ts +57 -0
- package/dist/workflows/target-assessment/phase5-persist.js +461 -0
- package/dist/workflows/target-assessment/progress.d.ts +38 -0
- package/dist/workflows/target-assessment/progress.js +76 -0
- package/dist/workflows/target-assessment/schemas.d.ts +931 -0
- package/dist/workflows/target-assessment/schemas.js +293 -0
- package/dist/workflows/target-assessment/steps/collectors/pathways.d.ts +15 -0
- package/dist/workflows/target-assessment/steps/collectors/pathways.js +58 -0
- package/dist/workflows/target-assessment/steps/fanout/aes-for-one-class-drug-step.d.ts +34 -0
- package/dist/workflows/target-assessment/steps/fanout/aes-for-one-class-drug-step.js +31 -0
- package/dist/workflows/target-assessment/steps/fanout/aes-for-one-trial-step.d.ts +57 -0
- package/dist/workflows/target-assessment/steps/fanout/aes-for-one-trial-step.js +54 -0
- package/dist/workflows/target-assessment/steps/fanout/faers-for-one-modulator-step.d.ts +35 -0
- package/dist/workflows/target-assessment/steps/fanout/faers-for-one-modulator-step.js +32 -0
- package/dist/workflows/target-assessment/steps/fanout/index.d.ts +14 -0
- package/dist/workflows/target-assessment/steps/fanout/index.js +10 -0
- package/dist/workflows/target-assessment/steps/fanout/polypharm-for-one-modulator-step.d.ts +28 -0
- package/dist/workflows/target-assessment/steps/fanout/polypharm-for-one-modulator-step.js +27 -0
- package/dist/workflows/target-assessment/steps/phase0-resolve.d.ts +71 -0
- package/dist/workflows/target-assessment/steps/phase0-resolve.js +21 -0
- package/dist/workflows/target-assessment/steps/phase1-aggregate.d.ts +1018 -0
- package/dist/workflows/target-assessment/steps/phase1-aggregate.js +25 -0
- package/dist/workflows/target-assessment/steps/phase2-aggregate.d.ts +696 -0
- package/dist/workflows/target-assessment/steps/phase2-aggregate.js +38 -0
- package/dist/workflows/target-assessment/steps/phase3-aggregate.d.ts +936 -0
- package/dist/workflows/target-assessment/steps/phase3-aggregate.js +22 -0
- package/dist/workflows/target-assessment/steps/synthesis/diagnostics.d.ts +34 -0
- package/dist/workflows/target-assessment/steps/synthesis/diagnostics.js +45 -0
- package/dist/workflows/target-assessment/sub-workflows/index.d.ts +15 -0
- package/dist/workflows/target-assessment/sub-workflows/index.js +11 -0
- package/dist/workflows/target-assessment/sub-workflows/per-class-drug-aes.d.ts +41 -0
- package/dist/workflows/target-assessment/sub-workflows/per-class-drug-aes.js +12 -0
- package/dist/workflows/target-assessment/sub-workflows/per-modulator-faers.d.ts +41 -0
- package/dist/workflows/target-assessment/sub-workflows/per-modulator-faers.js +12 -0
- package/dist/workflows/target-assessment/sub-workflows/per-modulator-polypharm.d.ts +36 -0
- package/dist/workflows/target-assessment/sub-workflows/per-modulator-polypharm.js +12 -0
- package/dist/workflows/target-assessment/sub-workflows/per-trial-aes.d.ts +66 -0
- package/dist/workflows/target-assessment/sub-workflows/per-trial-aes.js +12 -0
- package/dist/workflows/target-assessment/synthesis/index.d.ts +560 -0
- package/dist/workflows/target-assessment/synthesis/index.js +351 -0
- package/dist/workflows/target-assessment/synthesis-probes.d.ts +56 -0
- package/dist/workflows/target-assessment/synthesis-probes.js +320 -0
- package/dist/workspace/filesystem.d.ts +117 -0
- package/dist/workspace/filesystem.js +304 -0
- package/dist/workspace/mount-strategy.d.ts +50 -0
- package/dist/workspace/mount-strategy.js +67 -0
- package/dist/workspace/paths.d.ts +185 -0
- package/dist/workspace/paths.js +219 -0
- package/dist/workspace/provenance-collector.d.ts +34 -0
- package/dist/workspace/provenance-collector.js +16 -0
- package/dist/workspace/search-config.d.ts +23 -0
- package/dist/workspace/search-config.js +43 -0
- package/dist/workspace/workspace-paths.d.ts +26 -0
- package/dist/workspace/workspace-paths.js +31 -0
- package/package.json +101 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* searchGwasCatalog — search NHGRI-EBI GWAS Catalog for SNP-trait associations.
|
|
3
|
+
*
|
|
4
|
+
* Public REST API, no key required. Three search modes:
|
|
5
|
+
* - 'gene' — gene-trait associations (via SNP-by-gene lookup, then assocs)
|
|
6
|
+
* - 'trait' — trait-gene associations (via EFO trait search, then assocs)
|
|
7
|
+
* - 'variant' — direct rsID lookup
|
|
8
|
+
*/
|
|
9
|
+
interface GwasAssociation {
|
|
10
|
+
rsId: string;
|
|
11
|
+
pValue: number;
|
|
12
|
+
pValueMantissa: number;
|
|
13
|
+
pValueExponent: number;
|
|
14
|
+
riskAllele: string;
|
|
15
|
+
riskFrequency: string;
|
|
16
|
+
orBeta: number | null;
|
|
17
|
+
ci: string;
|
|
18
|
+
trait: string;
|
|
19
|
+
mappedGenes: string[];
|
|
20
|
+
studyAccession: string;
|
|
21
|
+
pubmedId: string;
|
|
22
|
+
sampleSize: string;
|
|
23
|
+
}
|
|
24
|
+
export declare const searchGwasCatalogTool: import("../define-tool.js").Tool<{
|
|
25
|
+
query: string;
|
|
26
|
+
searchType: "gene" | "trait" | "variant";
|
|
27
|
+
pValueThreshold: number;
|
|
28
|
+
limit: number;
|
|
29
|
+
}, {
|
|
30
|
+
totalFound: number;
|
|
31
|
+
associations: GwasAssociation[];
|
|
32
|
+
}>;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* searchGwasCatalog — search NHGRI-EBI GWAS Catalog for SNP-trait associations.
|
|
3
|
+
*
|
|
4
|
+
* Public REST API, no key required. Three search modes:
|
|
5
|
+
* - 'gene' — gene-trait associations (via SNP-by-gene lookup, then assocs)
|
|
6
|
+
* - 'trait' — trait-gene associations (via EFO trait search, then assocs)
|
|
7
|
+
* - 'variant' — direct rsID lookup
|
|
8
|
+
*/
|
|
9
|
+
import { ok } from "neverthrow";
|
|
10
|
+
import { z } from "zod";
|
|
11
|
+
import { defineTool } from "../define-tool.js";
|
|
12
|
+
import { apiFetchValidated, describeApiError } from "../lib/api-utils.js";
|
|
13
|
+
import { GWAS_BASE, GWAS_HEADERS } from "../lib/gwas-catalog-config.js";
|
|
14
|
+
// GWAS Catalog raw wire shapes (HAL+JSON), validated at the fetch boundary.
|
|
15
|
+
// Every field is optional because the API omits absent values; leaf strings
|
|
16
|
+
// that the API can return as an explicit `null` are `.nullable()`.
|
|
17
|
+
const RawGwasStudySchema = z.object({
|
|
18
|
+
accessionId: z.string().optional(),
|
|
19
|
+
pubmedId: z.string().optional(),
|
|
20
|
+
initialSampleSize: z.string().optional(),
|
|
21
|
+
});
|
|
22
|
+
// `_snpRsId` is not on the wire — the 'gene' search path assigns it after
|
|
23
|
+
// parsing (`a._snpRsId = snp.rsId`), so it stays a writable optional field.
|
|
24
|
+
const RawGwasAssociationSchema = z.object({
|
|
25
|
+
_snpRsId: z.string().optional(),
|
|
26
|
+
loci: z
|
|
27
|
+
.array(z.object({
|
|
28
|
+
strongestRiskAlleles: z.array(z.object({ riskAlleleName: z.string().nullable().optional() })).optional(),
|
|
29
|
+
authorReportedGenes: z.array(z.object({ geneName: z.string().nullable().optional() })).optional(),
|
|
30
|
+
}))
|
|
31
|
+
.optional(),
|
|
32
|
+
efoTraits: z.array(z.object({ trait: z.string().nullable().optional() })).optional(),
|
|
33
|
+
study: RawGwasStudySchema.optional(),
|
|
34
|
+
pvalueMantissa: z.number().optional(),
|
|
35
|
+
pvalueExponent: z.number().optional(),
|
|
36
|
+
riskFrequency: z.string().optional(),
|
|
37
|
+
orPerCopyNum: z.number().nullable().optional(),
|
|
38
|
+
betaNum: z.number().nullable().optional(),
|
|
39
|
+
range: z.string().optional(),
|
|
40
|
+
});
|
|
41
|
+
const GwasEmbeddedSchema = z.object({
|
|
42
|
+
_embedded: z.object({ associations: z.array(RawGwasAssociationSchema).optional() }).optional(),
|
|
43
|
+
page: z.object({ totalElements: z.number().optional() }).optional(),
|
|
44
|
+
});
|
|
45
|
+
const GwasTraitSearchResponseSchema = z.object({
|
|
46
|
+
_embedded: z
|
|
47
|
+
.object({
|
|
48
|
+
efoTraits: z.array(z.object({ _links: z.object({ self: z.object({ href: z.string().optional() }).optional() }).optional() })).optional(),
|
|
49
|
+
})
|
|
50
|
+
.optional(),
|
|
51
|
+
});
|
|
52
|
+
const GwasSnpSearchResponseSchema = z.object({
|
|
53
|
+
_embedded: z
|
|
54
|
+
.object({
|
|
55
|
+
singleNucleotidePolymorphisms: z
|
|
56
|
+
.array(z.object({
|
|
57
|
+
rsId: z.string().optional(),
|
|
58
|
+
_links: z.object({ associations: z.object({ href: z.string().optional() }).optional() }).optional(),
|
|
59
|
+
}))
|
|
60
|
+
.optional(),
|
|
61
|
+
})
|
|
62
|
+
.optional(),
|
|
63
|
+
});
|
|
64
|
+
function mapAssociation(a) {
|
|
65
|
+
const loci = a.loci ?? [];
|
|
66
|
+
const riskAlleles = loci.flatMap((l) => l.strongestRiskAlleles?.map((ra) => String(ra.riskAlleleName ?? "")) ?? []);
|
|
67
|
+
const genes = loci.flatMap((l) => l.authorReportedGenes?.map((g) => String(g.geneName ?? "")) ?? []);
|
|
68
|
+
const traits = (a.efoTraits ?? []).map((t) => String(t.trait ?? ""));
|
|
69
|
+
const study = a.study ?? {};
|
|
70
|
+
const pMantissa = a.pvalueMantissa ?? 0;
|
|
71
|
+
const pExponent = a.pvalueExponent ?? 0;
|
|
72
|
+
return {
|
|
73
|
+
rsId: String(a._snpRsId ?? riskAlleles[0]?.split("-")[0] ?? ""),
|
|
74
|
+
pValue: pMantissa * Math.pow(10, pExponent),
|
|
75
|
+
pValueMantissa: pMantissa,
|
|
76
|
+
pValueExponent: pExponent,
|
|
77
|
+
riskAllele: riskAlleles.join(", "),
|
|
78
|
+
riskFrequency: String(a.riskFrequency ?? ""),
|
|
79
|
+
orBeta: (a.orPerCopyNum ?? a.betaNum ?? null),
|
|
80
|
+
ci: String(a.range ?? ""),
|
|
81
|
+
trait: traits.join("; "),
|
|
82
|
+
mappedGenes: [...new Set(genes)],
|
|
83
|
+
studyAccession: String(study.accessionId ?? ""),
|
|
84
|
+
pubmedId: String(study.pubmedId ?? ""),
|
|
85
|
+
sampleSize: String(study.initialSampleSize ?? ""),
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
export const searchGwasCatalogTool = defineTool({
|
|
89
|
+
id: "search_gwas_catalog",
|
|
90
|
+
description: "Search the NHGRI-EBI GWAS Catalog for genome-wide association study results. " +
|
|
91
|
+
"Returns SNP associations with traits/diseases, effect sizes, p-values, and mapped genes. " +
|
|
92
|
+
"Use to find genetic evidence linking genes to phenotypes for target validation or " +
|
|
93
|
+
"Mendelian randomization support.",
|
|
94
|
+
inputSchema: z.object({
|
|
95
|
+
query: z.string().describe("Gene symbol (e.g. PCSK9), trait keyword (e.g. cholesterol), or rsID (e.g. rs11591147)"),
|
|
96
|
+
searchType: z
|
|
97
|
+
.enum(["gene", "trait", "variant"])
|
|
98
|
+
.describe("'gene' for gene-trait associations, 'trait' for trait-gene associations, 'variant' for a specific rsID"),
|
|
99
|
+
pValueThreshold: z.number().default(5e-8).describe("P-value threshold for genome-wide significance"),
|
|
100
|
+
limit: z.number().int().min(1).max(100).default(25).describe("Max results to return"),
|
|
101
|
+
}),
|
|
102
|
+
execute: async ({ query, searchType, pValueThreshold = 5e-8, limit = 25 }) => {
|
|
103
|
+
let url;
|
|
104
|
+
if (searchType === "variant") {
|
|
105
|
+
const rsId = query.startsWith("rs") ? query : `rs${query}`;
|
|
106
|
+
url = `${GWAS_BASE}/singleNucleotidePolymorphisms/${rsId}/associations?projection=associationBySnp`;
|
|
107
|
+
}
|
|
108
|
+
else if (searchType === "gene") {
|
|
109
|
+
url = `${GWAS_BASE}/singleNucleotidePolymorphisms/search/findByGene?geneName=${encodeURIComponent(query)}&projection=snpByGene`;
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
url = `${GWAS_BASE}/efoTraits/search/findBySearchQuery?query=${encodeURIComponent(query)}`;
|
|
113
|
+
}
|
|
114
|
+
if (searchType === "trait") {
|
|
115
|
+
const traitRes = await apiFetchValidated(url, GwasTraitSearchResponseSchema, { headers: GWAS_HEADERS });
|
|
116
|
+
if (traitRes.isErr())
|
|
117
|
+
throw new Error(describeApiError(traitRes.error));
|
|
118
|
+
const traits = traitRes.value?._embedded?.efoTraits ?? [];
|
|
119
|
+
if (traits.length === 0) {
|
|
120
|
+
return ok({ totalFound: 0, associations: [] });
|
|
121
|
+
}
|
|
122
|
+
const traitUri = traits[0]?._links?.self?.href;
|
|
123
|
+
if (!traitUri) {
|
|
124
|
+
return ok({ totalFound: 0, associations: [] });
|
|
125
|
+
}
|
|
126
|
+
const traitId = traitUri.split("/").pop();
|
|
127
|
+
url = `${GWAS_BASE}/efoTraits/${traitId}/associations?size=${limit}`;
|
|
128
|
+
}
|
|
129
|
+
if (searchType === "gene") {
|
|
130
|
+
const snpRes = await apiFetchValidated(url, GwasSnpSearchResponseSchema, { headers: GWAS_HEADERS });
|
|
131
|
+
if (snpRes.isErr())
|
|
132
|
+
throw new Error(describeApiError(snpRes.error));
|
|
133
|
+
const snps = snpRes.value?._embedded?.singleNucleotidePolymorphisms ?? [];
|
|
134
|
+
const allAssocs = [];
|
|
135
|
+
for (const snp of snps.slice(0, Math.min(limit, 10))) {
|
|
136
|
+
const assocLink = snp?._links?.associations?.href;
|
|
137
|
+
if (!assocLink)
|
|
138
|
+
continue;
|
|
139
|
+
const aRes = await apiFetchValidated(assocLink, GwasEmbeddedSchema, {
|
|
140
|
+
headers: GWAS_HEADERS,
|
|
141
|
+
});
|
|
142
|
+
if (aRes.isOk()) {
|
|
143
|
+
for (const a of aRes.value?._embedded?.associations ?? []) {
|
|
144
|
+
a._snpRsId = snp.rsId;
|
|
145
|
+
allAssocs.push(a);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
if (allAssocs.length >= limit)
|
|
149
|
+
break;
|
|
150
|
+
}
|
|
151
|
+
return ok({
|
|
152
|
+
totalFound: allAssocs.length,
|
|
153
|
+
associations: allAssocs.slice(0, limit).map(mapAssociation),
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
const res = await apiFetchValidated(url, GwasEmbeddedSchema, { headers: GWAS_HEADERS });
|
|
157
|
+
if (res.isErr())
|
|
158
|
+
throw new Error(describeApiError(res.error));
|
|
159
|
+
const rawAssocs = res.value?._embedded?.associations ?? [];
|
|
160
|
+
const totalFound = res.value?.page?.totalElements ?? rawAssocs.length;
|
|
161
|
+
const filtered = rawAssocs
|
|
162
|
+
.filter((a) => {
|
|
163
|
+
const p = (a.pvalueMantissa ?? 1) * Math.pow(10, a.pvalueExponent ?? 0);
|
|
164
|
+
return p <= pValueThreshold;
|
|
165
|
+
})
|
|
166
|
+
.slice(0, limit);
|
|
167
|
+
return ok({
|
|
168
|
+
totalFound,
|
|
169
|
+
associations: filtered.map(mapAssociation),
|
|
170
|
+
});
|
|
171
|
+
},
|
|
172
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* searchInteractions — query protein-protein interactions via STRING DB.
|
|
3
|
+
*/
|
|
4
|
+
import { getEnrichment, getInteractionPartners } from "../lib/string-client.js";
|
|
5
|
+
type InteractionsOutput = {
|
|
6
|
+
enrichment: Awaited<ReturnType<typeof getEnrichment>>;
|
|
7
|
+
} | {
|
|
8
|
+
interactions: Awaited<ReturnType<typeof getInteractionPartners>>;
|
|
9
|
+
};
|
|
10
|
+
export declare const searchInteractionsTool: import("../define-tool.js").Tool<{
|
|
11
|
+
identifiers: string[];
|
|
12
|
+
species: number;
|
|
13
|
+
action: "partners" | "network" | "enrichment";
|
|
14
|
+
minScore: number;
|
|
15
|
+
limit: number;
|
|
16
|
+
}, InteractionsOutput>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* searchInteractions — query protein-protein interactions via STRING DB.
|
|
3
|
+
*/
|
|
4
|
+
import { ok } from "neverthrow";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import { defineTool } from "../define-tool.js";
|
|
7
|
+
import { getEnrichment, getInteractionNetwork, getInteractionPartners } from "../lib/string-client.js";
|
|
8
|
+
export const searchInteractionsTool = defineTool({
|
|
9
|
+
id: "search_interactions",
|
|
10
|
+
description: "Query protein-protein interactions from STRING DB. " +
|
|
11
|
+
"Actions: 'partners' finds interaction partners for proteins, " +
|
|
12
|
+
"'network' gets the full interaction network between listed proteins, " +
|
|
13
|
+
"'enrichment' returns functional enrichment analysis (GO, KEGG, Reactome).",
|
|
14
|
+
inputSchema: z.object({
|
|
15
|
+
identifiers: z.array(z.string()).min(1).max(100).describe("Protein/gene identifiers (e.g. ['TP53', 'BRCA1'])"),
|
|
16
|
+
species: z.number().int().default(9606).describe("NCBI Taxonomy ID (9606 = human, 10090 = mouse)"),
|
|
17
|
+
action: z.enum(["partners", "network", "enrichment"]).default("partners").describe("Query type"),
|
|
18
|
+
minScore: z.number().int().min(0).max(1000).default(400).describe("Minimum confidence score (400=medium, 700=high, 900=highest)"),
|
|
19
|
+
limit: z.number().int().min(1).max(100).default(20).describe("Max interaction partners (partners action only)"),
|
|
20
|
+
}),
|
|
21
|
+
execute: async ({ identifiers, species, action, minScore, limit }) => {
|
|
22
|
+
if (action === "enrichment") {
|
|
23
|
+
const enrichment = await getEnrichment(identifiers, species);
|
|
24
|
+
return ok({ enrichment });
|
|
25
|
+
}
|
|
26
|
+
const interactions = action === "partners"
|
|
27
|
+
? await getInteractionPartners(identifiers, { species, minScore, limit })
|
|
28
|
+
: await getInteractionNetwork(identifiers, { species, minScore });
|
|
29
|
+
return ok({ interactions });
|
|
30
|
+
},
|
|
31
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* searchOpenTargets — query Open Targets Platform for target-disease
|
|
3
|
+
* associations, genetic evidence, tractability, and known drug scores.
|
|
4
|
+
*/
|
|
5
|
+
export declare const searchOpenTargetsTool: import("../define-tool.js").Tool<{
|
|
6
|
+
query: string;
|
|
7
|
+
searchType: "target" | "disease";
|
|
8
|
+
limit: number;
|
|
9
|
+
}, {
|
|
10
|
+
associations: import("../lib/opentargets-client.js").Association[];
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* searchOpenTargets — query Open Targets Platform for target-disease
|
|
3
|
+
* associations, genetic evidence, tractability, and known drug scores.
|
|
4
|
+
*/
|
|
5
|
+
import { ok } from "neverthrow";
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import { defineTool } from "../define-tool.js";
|
|
8
|
+
import { searchDiseaseAssociations, searchTargetAssociations } from "../lib/opentargets-client.js";
|
|
9
|
+
export const searchOpenTargetsTool = defineTool({
|
|
10
|
+
id: "search_opentargets",
|
|
11
|
+
description: "Search Open Targets Platform for target-disease associations, genetic evidence, tractability, and known drug scores. Query by Ensembl gene ID (target mode) or EFO disease ID (disease mode).",
|
|
12
|
+
inputSchema: z.object({
|
|
13
|
+
query: z.string().describe("Ensembl gene ID (e.g. ENSG00000141510) or EFO disease ID (e.g. EFO_0000311)"),
|
|
14
|
+
searchType: z.enum(["target", "disease"]).describe("'target' to find diseases for a gene, 'disease' to find targets for a disease"),
|
|
15
|
+
limit: z.number().int().min(1).max(100).default(25).describe("Max results to return"),
|
|
16
|
+
}),
|
|
17
|
+
execute: async ({ query, searchType, limit = 25 }) => {
|
|
18
|
+
if (searchType === "target") {
|
|
19
|
+
const targetInfo = await searchTargetAssociations(query, limit);
|
|
20
|
+
return ok({ targetInfo, associations: targetInfo?.associations ?? [] });
|
|
21
|
+
}
|
|
22
|
+
const associations = await searchDiseaseAssociations(query, limit);
|
|
23
|
+
return ok({ associations });
|
|
24
|
+
},
|
|
25
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* searchPathway — search biological pathways via KEGG and Reactome.
|
|
3
|
+
*/
|
|
4
|
+
export declare const searchPathwayTool: import("../define-tool.js").Tool<{
|
|
5
|
+
query: string;
|
|
6
|
+
source: "kegg" | "reactome" | "both";
|
|
7
|
+
organism: string;
|
|
8
|
+
includeGenes: boolean;
|
|
9
|
+
maxResults: number;
|
|
10
|
+
}, {
|
|
11
|
+
pathways: import("../lib/pathway-client.js").Pathway[];
|
|
12
|
+
}>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* searchPathway — search biological pathways via KEGG and Reactome.
|
|
3
|
+
*/
|
|
4
|
+
import { ok } from "neverthrow";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import { defineTool } from "../define-tool.js";
|
|
7
|
+
import { searchPathways } from "../lib/pathway-client.js";
|
|
8
|
+
export const searchPathwayTool = defineTool({
|
|
9
|
+
id: "search_pathway",
|
|
10
|
+
description: "Search biological pathways in KEGG and/or Reactome databases. " +
|
|
11
|
+
"Returns pathway IDs, names, URLs, and optionally gene lists. " +
|
|
12
|
+
"Use source='both' to query both databases in parallel.",
|
|
13
|
+
inputSchema: z.object({
|
|
14
|
+
query: z.string().min(1).describe("Pathway search term (e.g. 'apoptosis', 'MAPK signaling')"),
|
|
15
|
+
source: z.enum(["kegg", "reactome", "both"]).default("both").describe("Which database to search"),
|
|
16
|
+
organism: z
|
|
17
|
+
.string()
|
|
18
|
+
.default("hsa")
|
|
19
|
+
.describe("KEGG organism code (e.g. 'hsa' for human, 'mmu' for mouse). " + "Automatically mapped to species name for Reactome."),
|
|
20
|
+
includeGenes: z.boolean().default(false).describe("Whether to fetch gene lists for each pathway (slower)"),
|
|
21
|
+
maxResults: z.number().int().min(1).max(50).default(10),
|
|
22
|
+
}),
|
|
23
|
+
execute: async ({ query, source, organism, includeGenes, maxResults }) => {
|
|
24
|
+
const pathways = await searchPathways(query, {
|
|
25
|
+
source,
|
|
26
|
+
organism,
|
|
27
|
+
includeGenes,
|
|
28
|
+
maxResults,
|
|
29
|
+
});
|
|
30
|
+
return ok({ pathways });
|
|
31
|
+
},
|
|
32
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* searchPharmgkb — search PharmGKB for pharmacogenomic clinical annotations.
|
|
3
|
+
*/
|
|
4
|
+
export declare const searchPharmgkbTool: import("../define-tool.js").Tool<{
|
|
5
|
+
query: string;
|
|
6
|
+
searchType: "drug" | "gene";
|
|
7
|
+
limit: number;
|
|
8
|
+
}, {
|
|
9
|
+
annotations: {
|
|
10
|
+
gene: string;
|
|
11
|
+
drug: string;
|
|
12
|
+
phenotype: null;
|
|
13
|
+
levelOfEvidence: string;
|
|
14
|
+
guidelineSource: null;
|
|
15
|
+
summary: null;
|
|
16
|
+
}[];
|
|
17
|
+
}>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* searchPharmgkb — search PharmGKB for pharmacogenomic clinical annotations.
|
|
3
|
+
*/
|
|
4
|
+
import { ok } from "neverthrow";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import { defineTool } from "../define-tool.js";
|
|
7
|
+
import { apiFetchValidated, describeApiError } from "../lib/api-utils.js";
|
|
8
|
+
import { PHARMGKB_BASE, PHARMGKB_HEADERS } from "../lib/pharmgkb-config.js";
|
|
9
|
+
// Raw PharmGKB clinicalAnnotation wire shape, validated at the fetch boundary.
|
|
10
|
+
// Every field is optional because the API omits absent values; the mapper in
|
|
11
|
+
// `execute` folds request context (`query`) into its output, so the schema
|
|
12
|
+
// models only the raw wire and the mapping stays where it is.
|
|
13
|
+
const PharmgkbAnnotationSchema = z.object({
|
|
14
|
+
location: z.object({ genes: z.array(z.object({ symbol: z.string().optional() })).optional() }).optional(),
|
|
15
|
+
relatedChemicals: z.array(z.object({ name: z.string().optional() })).optional(),
|
|
16
|
+
levelOfEvidence: z.object({ term: z.string().optional() }).optional(),
|
|
17
|
+
});
|
|
18
|
+
const PharmgkbResponseSchema = z.object({
|
|
19
|
+
data: z.array(PharmgkbAnnotationSchema).optional(),
|
|
20
|
+
});
|
|
21
|
+
export const searchPharmgkbTool = defineTool({
|
|
22
|
+
id: "search_pharmgkb",
|
|
23
|
+
description: "Search PharmGKB for pharmacogenomic clinical annotations — gene-drug interactions, dosing guidelines (CPIC/DPWG), and variant-level clinical significance. Use to determine if a gene variant affects drug metabolism, efficacy, or toxicity.",
|
|
24
|
+
inputSchema: z.object({
|
|
25
|
+
query: z.string().describe("Gene symbol (e.g. CYP2D6) or drug name (e.g. tamoxifen)"),
|
|
26
|
+
searchType: z.enum(["gene", "drug"]).describe("Search by gene or drug"),
|
|
27
|
+
limit: z.number().int().min(1).max(50).default(20).describe("Max results"),
|
|
28
|
+
}),
|
|
29
|
+
execute: async ({ query, searchType, limit = 20 }) => {
|
|
30
|
+
const filter = searchType === "gene" ? `location.genes.symbol=${encodeURIComponent(query)}` : `relatedChemicals.name=${encodeURIComponent(query)}`;
|
|
31
|
+
const endpoint = `${PHARMGKB_BASE}/clinicalAnnotation?${filter}`;
|
|
32
|
+
const res = await apiFetchValidated(endpoint, PharmgkbResponseSchema, { headers: PHARMGKB_HEADERS });
|
|
33
|
+
if (res.isErr())
|
|
34
|
+
throw new Error(describeApiError(res.error));
|
|
35
|
+
const data = res.value?.data ?? [];
|
|
36
|
+
const annotations = data.slice(0, limit).map((ann) => ({
|
|
37
|
+
gene: ann.location?.genes?.map((g) => g.symbol).join(", ") ?? query,
|
|
38
|
+
drug: ann.relatedChemicals?.map((c) => c.name).join(", ") ?? "",
|
|
39
|
+
phenotype: null,
|
|
40
|
+
levelOfEvidence: ann.levelOfEvidence?.term ?? "Unknown",
|
|
41
|
+
guidelineSource: null,
|
|
42
|
+
summary: null,
|
|
43
|
+
}));
|
|
44
|
+
return ok({ annotations });
|
|
45
|
+
},
|
|
46
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* searchPubchemCompound tool — resolve compounds against PubChem's 110M+ database.
|
|
3
|
+
*
|
|
4
|
+
* Supports search by name, SMILES, InChI, InChIKey, or CID.
|
|
5
|
+
* Returns compound identity and computed molecular properties.
|
|
6
|
+
*/
|
|
7
|
+
export declare const searchPubchemCompoundTool: import("../define-tool.js").Tool<{
|
|
8
|
+
query: string;
|
|
9
|
+
searchBy: "name" | "smiles" | "inchikey" | "cid" | "inchi";
|
|
10
|
+
}, {
|
|
11
|
+
results: {
|
|
12
|
+
cid: number;
|
|
13
|
+
canonicalSmiles: string | null;
|
|
14
|
+
molecularFormula: string | null;
|
|
15
|
+
molecularWeight: number | null;
|
|
16
|
+
iupacName: string | null;
|
|
17
|
+
inchi: string | null;
|
|
18
|
+
inchiKey: string | null;
|
|
19
|
+
xlogp: number | null;
|
|
20
|
+
tpsa: number | null;
|
|
21
|
+
hbondDonorCount: number | null;
|
|
22
|
+
hbondAcceptorCount: number | null;
|
|
23
|
+
rotatableBondCount: number | null;
|
|
24
|
+
complexity: number | null;
|
|
25
|
+
}[];
|
|
26
|
+
}>;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* searchPubchemCompound tool — resolve compounds against PubChem's 110M+ database.
|
|
3
|
+
*
|
|
4
|
+
* Supports search by name, SMILES, InChI, InChIKey, or CID.
|
|
5
|
+
* Returns compound identity and computed molecular properties.
|
|
6
|
+
*/
|
|
7
|
+
import { ok } from "neverthrow";
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
import { defineTool } from "../define-tool.js";
|
|
10
|
+
import { apiFetchValidated, describeApiError } from "../lib/api-utils.js";
|
|
11
|
+
import { PUBCHEM_HEADERS as HEADERS, PUBCHEM_BASE } from "../lib/pubchem-config.js";
|
|
12
|
+
const PROPERTY_LIST = [
|
|
13
|
+
"MolecularFormula",
|
|
14
|
+
"MolecularWeight",
|
|
15
|
+
"CanonicalSMILES",
|
|
16
|
+
"InChI",
|
|
17
|
+
"InChIKey",
|
|
18
|
+
"IUPACName",
|
|
19
|
+
"XLogP",
|
|
20
|
+
"TPSA",
|
|
21
|
+
"HBondDonorCount",
|
|
22
|
+
"HBondAcceptorCount",
|
|
23
|
+
"RotatableBondCount",
|
|
24
|
+
"Complexity",
|
|
25
|
+
].join(",");
|
|
26
|
+
// A single schema that both validates and normalizes one PUG-REST property row:
|
|
27
|
+
// the `.object(...)` half is the wire shape (every field optional — PubChem
|
|
28
|
+
// omits absent properties), the `.transform(...)` half maps it to the camelCase
|
|
29
|
+
// `Compound` we return. Parsing IS the validation, and because the transform
|
|
30
|
+
// rides on the schema, `z.infer` below is the OUTPUT type — no separate raw
|
|
31
|
+
// interface or mapper.
|
|
32
|
+
const PugPropertyRowSchema = z
|
|
33
|
+
.object({
|
|
34
|
+
CID: z.number().optional(),
|
|
35
|
+
CanonicalSMILES: z.string().optional(),
|
|
36
|
+
MolecularFormula: z.string().optional(),
|
|
37
|
+
// PUG-REST serializes MolecularWeight as a string (e.g. "180.16") to
|
|
38
|
+
// preserve significant figures; accept both and let the transform's
|
|
39
|
+
// `Number(...)` normalize it.
|
|
40
|
+
MolecularWeight: z.union([z.number(), z.string()]).optional(),
|
|
41
|
+
IUPACName: z.string().optional(),
|
|
42
|
+
InChI: z.string().optional(),
|
|
43
|
+
InChIKey: z.string().optional(),
|
|
44
|
+
XLogP: z.number().optional(),
|
|
45
|
+
TPSA: z.number().optional(),
|
|
46
|
+
HBondDonorCount: z.number().optional(),
|
|
47
|
+
HBondAcceptorCount: z.number().optional(),
|
|
48
|
+
RotatableBondCount: z.number().optional(),
|
|
49
|
+
Complexity: z.number().optional(),
|
|
50
|
+
})
|
|
51
|
+
.transform((raw) => ({
|
|
52
|
+
cid: raw.CID ?? 0,
|
|
53
|
+
canonicalSmiles: raw.CanonicalSMILES ?? null,
|
|
54
|
+
molecularFormula: raw.MolecularFormula ?? null,
|
|
55
|
+
molecularWeight: raw.MolecularWeight != null ? Number(raw.MolecularWeight) : null,
|
|
56
|
+
iupacName: raw.IUPACName ?? null,
|
|
57
|
+
inchi: raw.InChI ?? null,
|
|
58
|
+
inchiKey: raw.InChIKey ?? null,
|
|
59
|
+
xlogp: raw.XLogP ?? null,
|
|
60
|
+
tpsa: raw.TPSA ?? null,
|
|
61
|
+
hbondDonorCount: raw.HBondDonorCount ?? null,
|
|
62
|
+
hbondAcceptorCount: raw.HBondAcceptorCount ?? null,
|
|
63
|
+
rotatableBondCount: raw.RotatableBondCount ?? null,
|
|
64
|
+
complexity: raw.Complexity ?? null,
|
|
65
|
+
}));
|
|
66
|
+
const PubChemPropertyResponseSchema = z.object({
|
|
67
|
+
PropertyTable: z.object({ Properties: z.array(PugPropertyRowSchema).optional() }).optional(),
|
|
68
|
+
});
|
|
69
|
+
/** Build the PUG-REST URL path segment for the given search type. */
|
|
70
|
+
function buildNamespace(searchBy, query) {
|
|
71
|
+
switch (searchBy) {
|
|
72
|
+
case "name":
|
|
73
|
+
return `compound/name/${encodeURIComponent(query)}`;
|
|
74
|
+
case "smiles":
|
|
75
|
+
return `compound/smiles/${encodeURIComponent(query)}`;
|
|
76
|
+
case "inchi":
|
|
77
|
+
return `compound/inchi/${encodeURIComponent(query)}`;
|
|
78
|
+
case "inchikey":
|
|
79
|
+
return `compound/inchikey/${encodeURIComponent(query)}`;
|
|
80
|
+
case "cid":
|
|
81
|
+
return `compound/cid/${encodeURIComponent(query)}`;
|
|
82
|
+
default:
|
|
83
|
+
return `compound/name/${encodeURIComponent(query)}`;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
export const searchPubchemCompoundTool = defineTool({
|
|
87
|
+
id: "search_pubchem_compound",
|
|
88
|
+
description: "Search PubChem for a compound by name, SMILES, InChI, InChIKey, or CID. " +
|
|
89
|
+
"Returns compound identity (CID, SMILES, InChI, IUPAC name) and computed properties " +
|
|
90
|
+
"(molecular weight, XLogP, TPSA, HBD, HBA, rotatable bonds, complexity). " +
|
|
91
|
+
"PubChem covers 110M+ compounds — use when ChEMBL doesn't find the compound.",
|
|
92
|
+
inputSchema: z.object({
|
|
93
|
+
query: z.string().min(1).describe("Search term: compound name, SMILES, InChI, InChIKey, or CID"),
|
|
94
|
+
searchBy: z.enum(["name", "smiles", "inchi", "inchikey", "cid"]).describe("Identifier type for the query"),
|
|
95
|
+
}),
|
|
96
|
+
execute: async ({ query, searchBy }) => {
|
|
97
|
+
const namespace = buildNamespace(searchBy, query);
|
|
98
|
+
const url = `${PUBCHEM_BASE}/${namespace}/property/${PROPERTY_LIST}/JSON`;
|
|
99
|
+
const res = await apiFetchValidated(url, PubChemPropertyResponseSchema, { headers: HEADERS });
|
|
100
|
+
if (res.isErr()) {
|
|
101
|
+
// PubChem returns 404 when the query matches no compound — expected.
|
|
102
|
+
if (res.error.type === "http_status" && res.error.status === 404)
|
|
103
|
+
return ok({ results: [] });
|
|
104
|
+
throw new Error(describeApiError(res.error));
|
|
105
|
+
}
|
|
106
|
+
// Already validated + normalized by PugPropertyRowSchema's transform.
|
|
107
|
+
const rows = res.value.PropertyTable?.Properties ?? [];
|
|
108
|
+
return ok({ results: rows });
|
|
109
|
+
},
|
|
110
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* searchPubMed — search PubMed via NCBI E-utilities.
|
|
3
|
+
*/
|
|
4
|
+
export declare function createSearchPubMedTool(deps: {
|
|
5
|
+
ncbiApiKey?: string;
|
|
6
|
+
}): import("../define-tool.js").Tool<{
|
|
7
|
+
query: string;
|
|
8
|
+
maxResults: number;
|
|
9
|
+
sort: "date" | "relevance";
|
|
10
|
+
dateRange?: {
|
|
11
|
+
from: string;
|
|
12
|
+
to: string;
|
|
13
|
+
} | undefined;
|
|
14
|
+
}, {
|
|
15
|
+
totalFound: number;
|
|
16
|
+
results: import("../lib/ncbi-utils.js").PubMedSummary[];
|
|
17
|
+
}>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* searchPubMed — search PubMed via NCBI E-utilities.
|
|
3
|
+
*/
|
|
4
|
+
import { ok } from "neverthrow";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import { defineTool } from "../define-tool.js";
|
|
7
|
+
import { searchPubmed } from "../lib/pubmed-client.js";
|
|
8
|
+
export function createSearchPubMedTool(deps) {
|
|
9
|
+
return defineTool({
|
|
10
|
+
id: "search_pubmed",
|
|
11
|
+
description: "Search PubMed for scientific articles using NCBI E-utilities. " +
|
|
12
|
+
"The query uses PubMed search syntax — use MeSH terms (e.g., " +
|
|
13
|
+
'"breast neoplasms"[MeSH]), field tags ([Title/Abstract], [Author], [Gene]), ' +
|
|
14
|
+
"and Boolean operators (AND, OR, NOT). " +
|
|
15
|
+
'Example: "BRCA1"[Gene] AND "breast neoplasms"[MeSH] AND "drug resistance"[Title/Abstract]. ' +
|
|
16
|
+
"Returns PMIDs, titles, journal names, publication years, and author summaries.",
|
|
17
|
+
inputSchema: z.object({
|
|
18
|
+
query: z.string().describe("PubMed search query. Supports MeSH terms, field tags, and Boolean operators."),
|
|
19
|
+
maxResults: z.number().int().min(1).max(50).default(10).describe("Maximum number of results to return (1–50, default 10)"),
|
|
20
|
+
sort: z.enum(["relevance", "date"]).default("relevance").describe('Sort order: "relevance" or "date" (default "relevance")'),
|
|
21
|
+
dateRange: z
|
|
22
|
+
.object({
|
|
23
|
+
from: z.string().describe("Start date in YYYY/MM/DD format"),
|
|
24
|
+
to: z.string().describe("End date in YYYY/MM/DD format"),
|
|
25
|
+
})
|
|
26
|
+
.optional()
|
|
27
|
+
.describe("Optional date range filter"),
|
|
28
|
+
}),
|
|
29
|
+
execute: async ({ query, maxResults, sort, dateRange }) => ok(await searchPubmed(deps.ncbiApiKey, query, { maxResults, sort, dateRange })),
|
|
30
|
+
});
|
|
31
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* searchTargets tool — search ChEMBL for biological targets.
|
|
3
|
+
*/
|
|
4
|
+
import { ok } from "neverthrow";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import { defineTool } from "../define-tool.js";
|
|
7
|
+
import { searchTargets } from "../lib/chembl-client.js";
|
|
8
|
+
export const searchTargetsTool = defineTool({
|
|
9
|
+
id: "search_targets",
|
|
10
|
+
description: "Search ChEMBL for biological targets by gene symbol, protein name, or ChEMBL ID. " +
|
|
11
|
+
"Returns target metadata including ChEMBL IDs, target type, organism, and gene names.",
|
|
12
|
+
inputSchema: z.object({
|
|
13
|
+
query: z.string().min(1).describe("Search term: gene symbol (e.g. 'EGFR'), protein name, or ChEMBL target ID"),
|
|
14
|
+
limit: z.number().int().min(1).max(25).default(25).describe("Maximum number of targets to return"),
|
|
15
|
+
}),
|
|
16
|
+
execute: async ({ query, limit }) => {
|
|
17
|
+
const targets = await searchTargets(query, limit);
|
|
18
|
+
return ok({ targets });
|
|
19
|
+
},
|
|
20
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* searchToxcast — search EPA ToxCast/Tox21 high-throughput screening data
|
|
3
|
+
* for a chemical via the CTX Bioactivity API.
|
|
4
|
+
*/
|
|
5
|
+
interface ToxcastAssayResult {
|
|
6
|
+
aeid: number;
|
|
7
|
+
assayEndpoint: string;
|
|
8
|
+
ac50: number | null;
|
|
9
|
+
hitCall: number;
|
|
10
|
+
maxMean: number | null;
|
|
11
|
+
model: string;
|
|
12
|
+
flags: string[];
|
|
13
|
+
}
|
|
14
|
+
type ToxcastOutput = {
|
|
15
|
+
found: false;
|
|
16
|
+
query: string;
|
|
17
|
+
} | {
|
|
18
|
+
found: true;
|
|
19
|
+
chemical: {
|
|
20
|
+
dtxsid: string;
|
|
21
|
+
preferredName: string;
|
|
22
|
+
casrn: string | null;
|
|
23
|
+
totalAssays: number;
|
|
24
|
+
activeAssays: number;
|
|
25
|
+
activeHitRate: number;
|
|
26
|
+
results: ToxcastAssayResult[];
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export declare function createSearchToxcastTool(deps: {
|
|
30
|
+
apiKey: string;
|
|
31
|
+
}): import("../define-tool.js").Tool<{
|
|
32
|
+
query: string;
|
|
33
|
+
activeOnly: boolean;
|
|
34
|
+
limit: number;
|
|
35
|
+
}, ToxcastOutput>;
|
|
36
|
+
export {};
|