@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,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* literatureReviewer — a sub-agent packaged as a loop-driving tool.
|
|
3
|
+
*
|
|
4
|
+
* The conversation agent delegates batch literature/biology research by
|
|
5
|
+
* calling this tool. `execute` derives a child `Session` (`forSubAgent`)
|
|
6
|
+
* and runs `runAgent` over a focused literature-reviewer agent: a research
|
|
7
|
+
* brief in, a structured evidence report out. The child's transcript is
|
|
8
|
+
* ephemeral — it lives only for this call and is never persisted (see the harness-thread-store spec).
|
|
9
|
+
*
|
|
10
|
+
* This is the whole of sub-agent delegation in the harness. There is no
|
|
11
|
+
* `agents: {}` config, no `messageFilter`, no `stripParentToolParts`: the
|
|
12
|
+
* child cannot see the parent's tool history because it is simply handed
|
|
13
|
+
* none — only the brief. The child loop uses `passthroughStep` because the
|
|
14
|
+
* entire tool call is one step in the parent loop (PR #3 caches it whole,
|
|
15
|
+
* so the child never replays).
|
|
16
|
+
*/
|
|
17
|
+
import { ok } from "neverthrow";
|
|
18
|
+
import { z } from "zod";
|
|
19
|
+
import { finalText, runAgent } from "../../loop/run-agent.js";
|
|
20
|
+
import { passthroughStep } from "../../loop/run-step.js";
|
|
21
|
+
import { literatureReviewerPrompt } from "../../prompts/literature-reviewer.js";
|
|
22
|
+
import { forSubAgent } from "../../auth/types.js";
|
|
23
|
+
import { defineTool } from "../define-tool.js";
|
|
24
|
+
import { createNcbiTools } from "../bio/keys.js";
|
|
25
|
+
import { getImpcKoProfileTool } from "../bio/get-impc-ko-profile.js";
|
|
26
|
+
import { lookupGoTermTool } from "../bio/lookup-go-term.js";
|
|
27
|
+
import { searchBgeeExpressionTool } from "../bio/search-bgee-expression.js";
|
|
28
|
+
import { searchDgidbTool } from "../bio/search-dgidb.js";
|
|
29
|
+
import { searchGeneTool } from "../bio/search-gene.js";
|
|
30
|
+
import { searchInteractionsTool } from "../bio/search-interactions.js";
|
|
31
|
+
import { searchPathwayTool } from "../bio/search-pathway.js";
|
|
32
|
+
/** Sub-agent identity — appended to `callPath`, set as `agentId`. */
|
|
33
|
+
const AGENT_ID = "literature-reviewer";
|
|
34
|
+
/** Multi-tool research budget — search → read → synthesize over many genes. */
|
|
35
|
+
const REVIEWER_MAX_ITERATIONS = 30;
|
|
36
|
+
/** Build the `literature_reviewer` delegation tool bound to its provider. */
|
|
37
|
+
export function createLiteratureReviewerTool(deps) {
|
|
38
|
+
const ncbi = createNcbiTools(deps.bioKeys);
|
|
39
|
+
const reviewerTools = [
|
|
40
|
+
searchGeneTool,
|
|
41
|
+
searchPathwayTool,
|
|
42
|
+
lookupGoTermTool,
|
|
43
|
+
searchInteractionsTool,
|
|
44
|
+
ncbi.searchPubMed,
|
|
45
|
+
ncbi.getArticleDetails,
|
|
46
|
+
ncbi.getArticleFullText,
|
|
47
|
+
searchDgidbTool,
|
|
48
|
+
searchBgeeExpressionTool,
|
|
49
|
+
getImpcKoProfileTool,
|
|
50
|
+
];
|
|
51
|
+
const agent = {
|
|
52
|
+
id: AGENT_ID,
|
|
53
|
+
systemPrompt: literatureReviewerPrompt,
|
|
54
|
+
model: deps.model,
|
|
55
|
+
tools: reviewerTools,
|
|
56
|
+
maxIterations: REVIEWER_MAX_ITERATIONS,
|
|
57
|
+
};
|
|
58
|
+
return defineTool({
|
|
59
|
+
id: "literature_reviewer",
|
|
60
|
+
description: "Delegate batch literature/biology research: looking up multiple " +
|
|
61
|
+
"genes or pathways, validating findings against published knowledge, " +
|
|
62
|
+
"or building evidence profiles. Pass a self-contained brief — the " +
|
|
63
|
+
"reviewer has no access to this conversation. Returns a structured " +
|
|
64
|
+
"evidence report. Do NOT delegate simple single-gene lookups; handle " +
|
|
65
|
+
"those directly with your own bio-lookup tools.",
|
|
66
|
+
inputSchema: z.object({
|
|
67
|
+
brief: z
|
|
68
|
+
.string()
|
|
69
|
+
.min(1)
|
|
70
|
+
.describe("A self-contained research brief: the genes, pathways, or " +
|
|
71
|
+
"biological features to investigate and the experimental " +
|
|
72
|
+
"context. The reviewer sees only this — include everything it needs."),
|
|
73
|
+
}),
|
|
74
|
+
execute: async ({ brief }, ctx) => {
|
|
75
|
+
const { messages: transcript } = await runAgent(agent, [{ role: "user", content: brief }], forSubAgent(ctx.session, AGENT_ID), {
|
|
76
|
+
provider: deps.provider,
|
|
77
|
+
signal: ctx.signal,
|
|
78
|
+
emit: ctx.emit,
|
|
79
|
+
runStep: passthroughStep,
|
|
80
|
+
});
|
|
81
|
+
return ok({ report: finalText(transcript) });
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Search arXiv for preprints. Returns Atom XML which we parse without a
|
|
3
|
+
* dependency. arXiv is the primary source for ML / physics / math /
|
|
4
|
+
* control-theory preprints; Semantic Scholar lags it by months.
|
|
5
|
+
*
|
|
6
|
+
* Same wire call and envelope as the legacy tool. Stateless HTTP; no deps.
|
|
7
|
+
*/
|
|
8
|
+
type SearchArxivOutput = {
|
|
9
|
+
success: false;
|
|
10
|
+
error: string;
|
|
11
|
+
papers: ArxivPaper[];
|
|
12
|
+
} | {
|
|
13
|
+
success: true;
|
|
14
|
+
papers: ArxivPaper[];
|
|
15
|
+
};
|
|
16
|
+
export interface ArxivPaper {
|
|
17
|
+
id: string;
|
|
18
|
+
title: string;
|
|
19
|
+
abstract: string;
|
|
20
|
+
authors: string[];
|
|
21
|
+
published: string;
|
|
22
|
+
categories: string[];
|
|
23
|
+
url: string;
|
|
24
|
+
pdfUrl?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare function parseArxivAtom(xml: string): ArxivPaper[];
|
|
27
|
+
export declare const searchArxivTool: import("../define-tool.js").Tool<{
|
|
28
|
+
query: string;
|
|
29
|
+
limit: number;
|
|
30
|
+
categories?: string[] | undefined;
|
|
31
|
+
}, SearchArxivOutput>;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Search arXiv for preprints. Returns Atom XML which we parse without a
|
|
3
|
+
* dependency. arXiv is the primary source for ML / physics / math /
|
|
4
|
+
* control-theory preprints; Semantic Scholar lags it by months.
|
|
5
|
+
*
|
|
6
|
+
* Same wire call and envelope as the legacy tool. Stateless HTTP; no deps.
|
|
7
|
+
*/
|
|
8
|
+
import { ok } from "neverthrow";
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
import { defineTool } from "../define-tool.js";
|
|
11
|
+
import { apiFetch, describeApiError } from "../lib/api-utils.js";
|
|
12
|
+
const BASE_URL = "https://export.arxiv.org/api/query";
|
|
13
|
+
const stripCdata = (s) => s.replace(/<!\[CDATA\[([\s\S]*?)\]\]>/g, "$1");
|
|
14
|
+
const decodeXmlEntities = (s) => s
|
|
15
|
+
.replace(/</g, "<")
|
|
16
|
+
.replace(/>/g, ">")
|
|
17
|
+
.replace(/"/g, '"')
|
|
18
|
+
.replace(/'/g, "'")
|
|
19
|
+
.replace(/&#x([0-9a-fA-F]+);/g, (_, h) => String.fromCodePoint(parseInt(h, 16)))
|
|
20
|
+
.replace(/&#(\d+);/g, (_, d) => String.fromCodePoint(parseInt(d, 10)))
|
|
21
|
+
.replace(/&/g, "&"); // amp last so we don't double-decode
|
|
22
|
+
const collapseWs = (s) => decodeXmlEntities(stripCdata(s)).replace(/\s+/g, " ").trim();
|
|
23
|
+
const extractEntries = (xml) => {
|
|
24
|
+
const re = /<entry\b[^>]*>([\s\S]*?)<\/entry>/g;
|
|
25
|
+
const out = [];
|
|
26
|
+
let m;
|
|
27
|
+
while ((m = re.exec(xml)) !== null)
|
|
28
|
+
out.push(m[1]);
|
|
29
|
+
return out;
|
|
30
|
+
};
|
|
31
|
+
const firstMatch = (entry, tag) => {
|
|
32
|
+
const re = new RegExp(`<${tag}\\b[^>]*>([\\s\\S]*?)</${tag}>`);
|
|
33
|
+
const m = entry.match(re);
|
|
34
|
+
return m?.[1];
|
|
35
|
+
};
|
|
36
|
+
const allMatches = (entry, tag) => {
|
|
37
|
+
const re = new RegExp(`<${tag}\\b[^>]*>([\\s\\S]*?)</${tag}>`, "g");
|
|
38
|
+
const out = [];
|
|
39
|
+
let m;
|
|
40
|
+
while ((m = re.exec(entry)) !== null)
|
|
41
|
+
out.push(m[1]);
|
|
42
|
+
return out;
|
|
43
|
+
};
|
|
44
|
+
const linkAttr = (entry, predicate) => {
|
|
45
|
+
const re = /<link\b([^>]*)\/>/g;
|
|
46
|
+
let m;
|
|
47
|
+
while ((m = re.exec(entry)) !== null) {
|
|
48
|
+
if (predicate(m[1])) {
|
|
49
|
+
const hrefMatch = m[1].match(/href="([^"]+)"/);
|
|
50
|
+
if (hrefMatch)
|
|
51
|
+
return hrefMatch[1];
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return undefined;
|
|
55
|
+
};
|
|
56
|
+
const categoryTerms = (entry) => {
|
|
57
|
+
const re = /<category\b([^>]*)\/>/g;
|
|
58
|
+
const out = [];
|
|
59
|
+
let m;
|
|
60
|
+
while ((m = re.exec(entry)) !== null) {
|
|
61
|
+
const termMatch = m[1].match(/term="([^"]+)"/);
|
|
62
|
+
if (termMatch)
|
|
63
|
+
out.push(termMatch[1]);
|
|
64
|
+
}
|
|
65
|
+
return out;
|
|
66
|
+
};
|
|
67
|
+
export function parseArxivAtom(xml) {
|
|
68
|
+
return extractEntries(xml).flatMap((entry) => {
|
|
69
|
+
const idRaw = firstMatch(entry, "id");
|
|
70
|
+
const title = firstMatch(entry, "title");
|
|
71
|
+
if (!idRaw || !title)
|
|
72
|
+
return [];
|
|
73
|
+
const idMatch = idRaw.match(/abs\/(.+)$/);
|
|
74
|
+
const authors = allMatches(entry, "author")
|
|
75
|
+
.map((a) => firstMatch(a, "name"))
|
|
76
|
+
.filter((n) => !!n)
|
|
77
|
+
.map(collapseWs);
|
|
78
|
+
const htmlUrl = linkAttr(entry, (a) => /rel="alternate"/.test(a) && /type="text\/html"/.test(a));
|
|
79
|
+
const pdfUrl = linkAttr(entry, (a) => /title="pdf"/.test(a));
|
|
80
|
+
return [
|
|
81
|
+
{
|
|
82
|
+
id: idMatch?.[1] ?? collapseWs(idRaw),
|
|
83
|
+
title: collapseWs(title),
|
|
84
|
+
abstract: collapseWs(firstMatch(entry, "summary") ?? ""),
|
|
85
|
+
authors,
|
|
86
|
+
published: collapseWs(firstMatch(entry, "published") ?? ""),
|
|
87
|
+
categories: categoryTerms(entry),
|
|
88
|
+
url: htmlUrl ?? collapseWs(idRaw),
|
|
89
|
+
pdfUrl,
|
|
90
|
+
},
|
|
91
|
+
];
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
export const searchArxivTool = defineTool({
|
|
95
|
+
id: "search_arxiv",
|
|
96
|
+
description: "Search arXiv for preprints in ML, physics, math, control theory, " +
|
|
97
|
+
"economics, and related quantitative fields. Returns id, title, " +
|
|
98
|
+
"abstract, authors, publication date, arXiv categories, and URLs.",
|
|
99
|
+
inputSchema: z.object({
|
|
100
|
+
query: z.string().describe('Free-text query. Example: "adaptive control feedback stabilization".'),
|
|
101
|
+
categories: z
|
|
102
|
+
.array(z.string())
|
|
103
|
+
.optional()
|
|
104
|
+
.describe('Optional arXiv category filters (e.g., ["cs.LG", "math.OC"]). ' + "Combined with the query using AND."),
|
|
105
|
+
limit: z.number().int().min(1).max(20).default(10).describe("Maximum results (1–20, default 10)."),
|
|
106
|
+
}),
|
|
107
|
+
execute: async ({ query, categories, limit }) => {
|
|
108
|
+
const catPart = categories && categories.length > 0 ? ` AND (${categories.map((c) => `cat:${c}`).join(" OR ")})` : "";
|
|
109
|
+
const params = new URLSearchParams({
|
|
110
|
+
search_query: `all:${query}${catPart}`,
|
|
111
|
+
max_results: String(limit),
|
|
112
|
+
sortBy: "relevance",
|
|
113
|
+
sortOrder: "descending",
|
|
114
|
+
});
|
|
115
|
+
const res = await apiFetch(`${BASE_URL}?${params}`, {
|
|
116
|
+
parseAs: "text",
|
|
117
|
+
});
|
|
118
|
+
if (res.isErr()) {
|
|
119
|
+
return ok({ success: false, error: describeApiError(res.error), papers: [] });
|
|
120
|
+
}
|
|
121
|
+
return ok({ success: true, papers: parseArxivAtom(res.value) });
|
|
122
|
+
},
|
|
123
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Search GitHub for code repositories. Used by the analogical-reasoner to
|
|
3
|
+
* find implementations of cross-domain methods. Works unauthenticated
|
|
4
|
+
* (lower rate limit); `GITHUB_TOKEN` raises the limit.
|
|
5
|
+
*
|
|
6
|
+
* Same wire call and envelope as the legacy tool. Stateless HTTP; no deps.
|
|
7
|
+
*/
|
|
8
|
+
type SearchGithubReposOutput = {
|
|
9
|
+
success: false;
|
|
10
|
+
error: string;
|
|
11
|
+
repos: GithubRepo[];
|
|
12
|
+
} | {
|
|
13
|
+
success: true;
|
|
14
|
+
repos: GithubRepo[];
|
|
15
|
+
};
|
|
16
|
+
export interface GithubRepo {
|
|
17
|
+
url: string;
|
|
18
|
+
fullName: string;
|
|
19
|
+
description?: string;
|
|
20
|
+
stars: number;
|
|
21
|
+
language?: string;
|
|
22
|
+
lastUpdated?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare function parseGithubReposResponse(raw: unknown): GithubRepo[];
|
|
25
|
+
export declare function createSearchGithubReposTool(deps: {
|
|
26
|
+
githubToken?: string;
|
|
27
|
+
}): import("../define-tool.js").Tool<{
|
|
28
|
+
query: string;
|
|
29
|
+
limit: number;
|
|
30
|
+
language?: string | undefined;
|
|
31
|
+
}, SearchGithubReposOutput>;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Search GitHub for code repositories. Used by the analogical-reasoner to
|
|
3
|
+
* find implementations of cross-domain methods. Works unauthenticated
|
|
4
|
+
* (lower rate limit); `GITHUB_TOKEN` raises the limit.
|
|
5
|
+
*
|
|
6
|
+
* Same wire call and envelope as the legacy tool. Stateless HTTP; no deps.
|
|
7
|
+
*/
|
|
8
|
+
import { ok } from "neverthrow";
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
import { defineTool } from "../define-tool.js";
|
|
11
|
+
import { apiFetchValidated, describeApiError } from "../lib/api-utils.js";
|
|
12
|
+
const BASE_URL = "https://api.github.com/search/repositories";
|
|
13
|
+
// Raw GitHub search wire shape, validated at the fetch boundary. Every field is
|
|
14
|
+
// optional — `parseGithubReposResponse` already filters out items missing the
|
|
15
|
+
// fields it needs, so an over-strict schema would drop otherwise-usable pages.
|
|
16
|
+
// `description` and `language` are also `.nullable()` because GitHub sends an
|
|
17
|
+
// explicit JSON `null` (not omission) for repos lacking them — the common case,
|
|
18
|
+
// which a bare `.optional()` would reject and take the whole page down with it.
|
|
19
|
+
const GithubReposResponseSchema = z.object({
|
|
20
|
+
items: z
|
|
21
|
+
.array(z.object({
|
|
22
|
+
html_url: z.string().optional(),
|
|
23
|
+
full_name: z.string().optional(),
|
|
24
|
+
description: z.string().nullable().optional(),
|
|
25
|
+
stargazers_count: z.number().optional(),
|
|
26
|
+
language: z.string().nullable().optional(),
|
|
27
|
+
updated_at: z.string().optional(),
|
|
28
|
+
}))
|
|
29
|
+
.optional(),
|
|
30
|
+
});
|
|
31
|
+
export function parseGithubReposResponse(raw) {
|
|
32
|
+
const items = raw?.items;
|
|
33
|
+
if (!Array.isArray(items))
|
|
34
|
+
return [];
|
|
35
|
+
return items
|
|
36
|
+
.filter((i) => typeof i === "object" &&
|
|
37
|
+
i !== null &&
|
|
38
|
+
typeof i.html_url === "string" &&
|
|
39
|
+
typeof i.full_name === "string")
|
|
40
|
+
.map((i) => ({
|
|
41
|
+
url: String(i.html_url),
|
|
42
|
+
fullName: String(i.full_name),
|
|
43
|
+
description: typeof i.description === "string" ? i.description : undefined,
|
|
44
|
+
stars: typeof i.stargazers_count === "number" ? i.stargazers_count : 0,
|
|
45
|
+
language: typeof i.language === "string" ? i.language : undefined,
|
|
46
|
+
lastUpdated: typeof i.updated_at === "string" ? i.updated_at : undefined,
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
49
|
+
export function createSearchGithubReposTool(deps) {
|
|
50
|
+
return defineTool({
|
|
51
|
+
id: "search_github_repos",
|
|
52
|
+
description: "Search GitHub for code repositories matching a free-text query, " +
|
|
53
|
+
"optionally filtered by programming language. Returns URL, full " +
|
|
54
|
+
"name (owner/repo), description, star count, primary language, " +
|
|
55
|
+
"and last-updated timestamp. Use to find implementations of " +
|
|
56
|
+
"cross-domain methods cited in analogical-reasoning results.",
|
|
57
|
+
inputSchema: z.object({
|
|
58
|
+
query: z
|
|
59
|
+
.string()
|
|
60
|
+
.describe("GitHub search syntax. Plain text matches anywhere; qualifiers " + 'like "topic:bioinformatics" or "stars:>100" are supported.'),
|
|
61
|
+
language: z.string().optional().describe('Optional language filter (e.g., "python").'),
|
|
62
|
+
limit: z.number().int().min(1).max(20).default(10).describe("Maximum results (1–20, default 10)."),
|
|
63
|
+
}),
|
|
64
|
+
execute: async ({ query, language, limit }) => {
|
|
65
|
+
const q = language ? `${query} language:${language}` : query;
|
|
66
|
+
const params = new URLSearchParams({
|
|
67
|
+
q,
|
|
68
|
+
per_page: String(limit),
|
|
69
|
+
sort: "stars",
|
|
70
|
+
order: "desc",
|
|
71
|
+
});
|
|
72
|
+
const headers = {
|
|
73
|
+
Accept: "application/vnd.github+json",
|
|
74
|
+
"X-GitHub-Api-Version": "2022-11-28",
|
|
75
|
+
};
|
|
76
|
+
if (deps.githubToken) {
|
|
77
|
+
headers.Authorization = `Bearer ${deps.githubToken}`;
|
|
78
|
+
}
|
|
79
|
+
const res = await apiFetchValidated(`${BASE_URL}?${params}`, GithubReposResponseSchema, { headers });
|
|
80
|
+
if (res.isErr()) {
|
|
81
|
+
return ok({ success: false, error: describeApiError(res.error), repos: [] });
|
|
82
|
+
}
|
|
83
|
+
return ok({ success: true, repos: parseGithubReposResponse(res.value) });
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Search Semantic Scholar Graph API for academic papers across all
|
|
3
|
+
* sciences. No API key required; rate-limited but reasonable for agent
|
|
4
|
+
* use. Used by the analogical-reasoner for cross-domain analogical search.
|
|
5
|
+
*
|
|
6
|
+
* Same wire call and envelope as the legacy tool, packaged as `defineTool`.
|
|
7
|
+
* Stateless HTTP; no deps.
|
|
8
|
+
*/
|
|
9
|
+
export interface SemanticScholarPaper {
|
|
10
|
+
id: string;
|
|
11
|
+
title: string;
|
|
12
|
+
abstract?: string;
|
|
13
|
+
year?: number;
|
|
14
|
+
venue?: string;
|
|
15
|
+
citationCount?: number;
|
|
16
|
+
url?: string;
|
|
17
|
+
authors: string[];
|
|
18
|
+
externalIds?: Record<string, string>;
|
|
19
|
+
}
|
|
20
|
+
type SearchSemanticScholarOutput = {
|
|
21
|
+
success: false;
|
|
22
|
+
error: string;
|
|
23
|
+
papers: SemanticScholarPaper[];
|
|
24
|
+
} | {
|
|
25
|
+
success: true;
|
|
26
|
+
papers: SemanticScholarPaper[];
|
|
27
|
+
};
|
|
28
|
+
export declare function parseSemanticScholarResponse(raw: unknown): SemanticScholarPaper[];
|
|
29
|
+
export declare const searchSemanticScholarTool: import("../define-tool.js").Tool<{
|
|
30
|
+
query: string;
|
|
31
|
+
limit: number;
|
|
32
|
+
}, SearchSemanticScholarOutput>;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Search Semantic Scholar Graph API for academic papers across all
|
|
3
|
+
* sciences. No API key required; rate-limited but reasonable for agent
|
|
4
|
+
* use. Used by the analogical-reasoner for cross-domain analogical search.
|
|
5
|
+
*
|
|
6
|
+
* Same wire call and envelope as the legacy tool, packaged as `defineTool`.
|
|
7
|
+
* Stateless HTTP; no deps.
|
|
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
|
+
const BASE_URL = "https://api.semanticscholar.org/graph/v1";
|
|
14
|
+
const DEFAULT_FIELDS = "paperId,title,abstract,year,venue,citationCount,url,authors,externalIds";
|
|
15
|
+
// Raw Semantic Scholar wire shape, validated at the fetch boundary. Every field
|
|
16
|
+
// is optional — `parseSemanticScholarResponse` already filters/coerces defensively,
|
|
17
|
+
// so a partial-but-valid response must still parse; `externalIds` values stay
|
|
18
|
+
// unconstrained (`z.unknown`) since the mapper only checks the container is an object.
|
|
19
|
+
// The scalar fields are also `.nullable()`: Semantic Scholar sends an explicit
|
|
20
|
+
// `null` for a missing abstract/year/venue/url/externalIds (very common), which a
|
|
21
|
+
// bare `.optional()` would reject — failing the whole `data` array on one such paper.
|
|
22
|
+
const SemanticScholarResponseSchema = z.object({
|
|
23
|
+
data: z
|
|
24
|
+
.array(z.object({
|
|
25
|
+
paperId: z.string().optional(),
|
|
26
|
+
title: z.string().optional(),
|
|
27
|
+
abstract: z.string().nullable().optional(),
|
|
28
|
+
year: z.number().nullable().optional(),
|
|
29
|
+
venue: z.string().nullable().optional(),
|
|
30
|
+
citationCount: z.number().nullable().optional(),
|
|
31
|
+
url: z.string().nullable().optional(),
|
|
32
|
+
authors: z.array(z.object({ name: z.string().nullable().optional() })).optional(),
|
|
33
|
+
externalIds: z.record(z.string(), z.unknown()).nullable().optional(),
|
|
34
|
+
}))
|
|
35
|
+
.optional(),
|
|
36
|
+
});
|
|
37
|
+
export function parseSemanticScholarResponse(raw) {
|
|
38
|
+
const data = raw?.data;
|
|
39
|
+
if (!Array.isArray(data))
|
|
40
|
+
return [];
|
|
41
|
+
return data
|
|
42
|
+
.filter((p) => typeof p === "object" && p !== null && "paperId" in p && "title" in p)
|
|
43
|
+
.map((p) => {
|
|
44
|
+
const authors = Array.isArray(p.authors)
|
|
45
|
+
? p.authors.map((a) => a?.name).filter((n) => typeof n === "string")
|
|
46
|
+
: [];
|
|
47
|
+
return {
|
|
48
|
+
id: String(p.paperId),
|
|
49
|
+
title: String(p.title),
|
|
50
|
+
abstract: typeof p.abstract === "string" ? p.abstract : undefined,
|
|
51
|
+
year: typeof p.year === "number" ? p.year : undefined,
|
|
52
|
+
venue: typeof p.venue === "string" ? p.venue : undefined,
|
|
53
|
+
citationCount: typeof p.citationCount === "number" ? p.citationCount : undefined,
|
|
54
|
+
url: typeof p.url === "string" ? p.url : undefined,
|
|
55
|
+
authors,
|
|
56
|
+
externalIds: p.externalIds && typeof p.externalIds === "object" ? p.externalIds : undefined,
|
|
57
|
+
};
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
export const searchSemanticScholarTool = defineTool({
|
|
61
|
+
id: "search_semantic_scholar",
|
|
62
|
+
description: "Search Semantic Scholar for academic papers across all sciences " +
|
|
63
|
+
"(biology, ML, physics, math, economics, engineering, etc.). Returns " +
|
|
64
|
+
"paper id, title, abstract, year, venue, citation count, authors, and " +
|
|
65
|
+
"external IDs (DOI, ArXiv). Best for cross-domain analogical search.",
|
|
66
|
+
inputSchema: z.object({
|
|
67
|
+
query: z
|
|
68
|
+
.string()
|
|
69
|
+
.describe("Free-text query. Use natural language phrases such as " + '"reinforcement learning for control" or "feedback stabilisation in oscillators".'),
|
|
70
|
+
limit: z.number().int().min(1).max(20).default(10).describe("Maximum number of results to return (1–20, default 10)."),
|
|
71
|
+
}),
|
|
72
|
+
execute: async ({ query, limit }) => {
|
|
73
|
+
const params = new URLSearchParams({
|
|
74
|
+
query,
|
|
75
|
+
limit: String(limit),
|
|
76
|
+
fields: DEFAULT_FIELDS,
|
|
77
|
+
});
|
|
78
|
+
const apiKey = process.env.SEMANTIC_SCHOLAR_API_KEY;
|
|
79
|
+
const headers = {};
|
|
80
|
+
if (apiKey)
|
|
81
|
+
headers["x-api-key"] = apiKey;
|
|
82
|
+
const res = await apiFetchValidated(`${BASE_URL}/paper/search?${params}`, SemanticScholarResponseSchema, {
|
|
83
|
+
headers,
|
|
84
|
+
});
|
|
85
|
+
if (res.isErr()) {
|
|
86
|
+
return ok({ success: false, error: describeApiError(res.error), papers: [] });
|
|
87
|
+
}
|
|
88
|
+
return ok({
|
|
89
|
+
success: true,
|
|
90
|
+
papers: parseSemanticScholarResponse(res.value),
|
|
91
|
+
});
|
|
92
|
+
},
|
|
93
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* run_ephemeral — ad-hoc data exploration in a read-only sandbox.
|
|
3
|
+
*
|
|
4
|
+
* Authorizes the run at the async edge via the RunAuthorizer seam, then starts
|
|
5
|
+
* the ephemeral workflow through the RunLauncher seam and awaits its result
|
|
6
|
+
* inline within the chat turn. Chat disconnect cancels the run; the
|
|
7
|
+
* authorization is revoked on every terminal path. The workflow is never
|
|
8
|
+
* recovered — a turn-scoped exploration outliving its turn has no value.
|
|
9
|
+
*
|
|
10
|
+
* Available to: conversation-agent.
|
|
11
|
+
*/
|
|
12
|
+
import type { RunAuthorizer } from "../execution/run-authorizer.js";
|
|
13
|
+
import type { RunLauncher } from "../execution/run-launcher.js";
|
|
14
|
+
import { type EphemeralResult, type EphemeralWorkflowInput } from "../execution/ephemeral-runner.js";
|
|
15
|
+
export interface RunEphemeralToolDeps {
|
|
16
|
+
/** Registered ephemeral workflow callable. */
|
|
17
|
+
readonly workflow: (input: EphemeralWorkflowInput) => Promise<EphemeralResult>;
|
|
18
|
+
/** Authorizes the run at the async edge and revokes on the terminal path. */
|
|
19
|
+
readonly runAuthorizer: RunAuthorizer;
|
|
20
|
+
/** Starts the durable run — the durability engine stays behind this seam. */
|
|
21
|
+
readonly runLauncher: RunLauncher;
|
|
22
|
+
}
|
|
23
|
+
export interface RunEphemeralToolOutput {
|
|
24
|
+
readonly text: string;
|
|
25
|
+
readonly durationMs: number;
|
|
26
|
+
}
|
|
27
|
+
/** Build the `run_ephemeral` tool bound to the registered workflow + mint deps. */
|
|
28
|
+
export declare function createRunEphemeralTool(deps: RunEphemeralToolDeps): import("./define-tool.js").Tool<{
|
|
29
|
+
prompt: string;
|
|
30
|
+
}, {
|
|
31
|
+
text: string;
|
|
32
|
+
durationMs: number;
|
|
33
|
+
}>;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* run_ephemeral — ad-hoc data exploration in a read-only sandbox.
|
|
3
|
+
*
|
|
4
|
+
* Authorizes the run at the async edge via the RunAuthorizer seam, then starts
|
|
5
|
+
* the ephemeral workflow through the RunLauncher seam and awaits its result
|
|
6
|
+
* inline within the chat turn. Chat disconnect cancels the run; the
|
|
7
|
+
* authorization is revoked on every terminal path. The workflow is never
|
|
8
|
+
* recovered — a turn-scoped exploration outliving its turn has no value.
|
|
9
|
+
*
|
|
10
|
+
* Available to: conversation-agent.
|
|
11
|
+
*/
|
|
12
|
+
import { ok } from "neverthrow";
|
|
13
|
+
import { z } from "zod";
|
|
14
|
+
import { EPHEMERAL_WORKFLOW_PREFIX } from "../execution/ephemeral-runner.js";
|
|
15
|
+
import { generateExecutionId } from "../sandbox/execution-id.js";
|
|
16
|
+
import { defineTool } from "./define-tool.js";
|
|
17
|
+
const inputSchema = z.object({
|
|
18
|
+
prompt: z
|
|
19
|
+
.string()
|
|
20
|
+
.min(1)
|
|
21
|
+
.describe("What to compute. Be specific: which files to read, what analysis to " + "run, what output format to return (table, statistics, base64 plot)."),
|
|
22
|
+
});
|
|
23
|
+
/** Build the `run_ephemeral` tool bound to the registered workflow + mint deps. */
|
|
24
|
+
export function createRunEphemeralTool(deps) {
|
|
25
|
+
return defineTool({
|
|
26
|
+
id: "run_ephemeral",
|
|
27
|
+
description: "Run a quick computation on the analysis data in a read-only sandbox. " +
|
|
28
|
+
"Use for ad-hoc data exploration: inspect a CSV, compute statistics, " +
|
|
29
|
+
"generate plot data, preview transformations. The sandbox cannot " +
|
|
30
|
+
"create or save files — results are returned inline. For persistent " +
|
|
31
|
+
"analyses that produce artifacts, use generate_plan + executePlan instead.",
|
|
32
|
+
inputSchema,
|
|
33
|
+
execute: async (input, ctx) => {
|
|
34
|
+
const { session } = ctx;
|
|
35
|
+
if (session.scope.kind !== "analysis") {
|
|
36
|
+
throw new Error("run_ephemeral requires an analysis-scoped session — got " + session.scope.kind);
|
|
37
|
+
}
|
|
38
|
+
if (!session.auth) {
|
|
39
|
+
throw new Error("run_ephemeral: session is missing its auth capability");
|
|
40
|
+
}
|
|
41
|
+
const authorization = await deps.runAuthorizer.authorize({
|
|
42
|
+
auth: session.auth,
|
|
43
|
+
scope: session.scope,
|
|
44
|
+
provenance: session.provenance,
|
|
45
|
+
frame: { runId: "ephemeral", stepId: "ephemeral" },
|
|
46
|
+
});
|
|
47
|
+
const { runSession } = authorization;
|
|
48
|
+
const execId = generateExecutionId("ephemeral-executor");
|
|
49
|
+
const workflowId = `${EPHEMERAL_WORKFLOW_PREFIX}${execId}`;
|
|
50
|
+
try {
|
|
51
|
+
const outcome = await deps.runLauncher.launchAndAwait(deps.workflow, { workflowId }, { runSession, prompt: input.prompt }, { signal: ctx.signal });
|
|
52
|
+
if (outcome.status === "cancelled") {
|
|
53
|
+
return ok({ text: "(ephemeral exploration cancelled)", durationMs: 0 });
|
|
54
|
+
}
|
|
55
|
+
return ok({
|
|
56
|
+
text: outcome.result.text,
|
|
57
|
+
durationMs: outcome.result.durationMs,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
finally {
|
|
61
|
+
await deps.runAuthorizer.revoke(authorization, "ephemeral-completed").catch(() => { });
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sandbox barrel — sandbox-environment introspection (available lib-store
|
|
3
|
+
* packages and reference datasets). Consumed by sandbox agents.
|
|
4
|
+
*/
|
|
5
|
+
export * from "./list-available-packages.js";
|
|
6
|
+
export * from "./list-available-refs.js";
|
|
7
|
+
export * from "./report-blocker.js";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sandbox barrel — sandbox-environment introspection (available lib-store
|
|
3
|
+
* packages and reference datasets). Consumed by sandbox agents.
|
|
4
|
+
*/
|
|
5
|
+
export * from "./list-available-packages.js";
|
|
6
|
+
export * from "./list-available-refs.js";
|
|
7
|
+
export * from "./report-blocker.js";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* listAvailablePackages — list R/Python/CLI packages available in the sandbox.
|
|
3
|
+
*/
|
|
4
|
+
import { readFile } from "node:fs/promises";
|
|
5
|
+
import { ok } from "neverthrow";
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import { defineTool } from "../define-tool.js";
|
|
8
|
+
const PACKAGES_FILE = "/mnt/libs/current/packages.txt";
|
|
9
|
+
export const listAvailablePackagesTool = defineTool({
|
|
10
|
+
id: "list_available_packages",
|
|
11
|
+
description: "List all R, Python, and CLI packages available in the sandbox environment. Use this before writing analysis scripts to verify which packages you can import. No packages can be installed at runtime — only what this tool returns is available.",
|
|
12
|
+
inputSchema: z.object({}),
|
|
13
|
+
execute: async () => {
|
|
14
|
+
// A missing library-store mount is an expected environment state — model
|
|
15
|
+
// it as an `available: false` data variant with a helpful fallback note.
|
|
16
|
+
try {
|
|
17
|
+
const content = await readFile(PACKAGES_FILE, "utf-8");
|
|
18
|
+
return ok({ available: true, content });
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return ok({
|
|
22
|
+
available: false,
|
|
23
|
+
content: "Package list not available. The library store may not be mounted. Assume standard bioinformatics packages (numpy, pandas, scanpy, DESeq2, etc.) are available, but do not attempt to install anything.",
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
});
|