@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,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-sandbox-machine liveness watchdog (CONTEXT.md "Sandbox exec").
|
|
3
|
+
*
|
|
4
|
+
* A `@DBOS.scheduled` parent fires every minute, lists the active-sandbox
|
|
5
|
+
* registry, shards by `hash(sandboxId) % SHARD_COUNT`, and `startWorkflow`s
|
|
6
|
+
* one child check workflow per non-empty shard. The fan-out invariant —
|
|
7
|
+
* "no single invocation polls every sandbox" — is the user's explicit
|
|
8
|
+
* constraint.
|
|
9
|
+
*
|
|
10
|
+
* Each child workflow walks its shard, calls `isAlive`, and on `false`
|
|
11
|
+
* gates on `DBOS.getWorkflowStatus`: if the owning workflow is still
|
|
12
|
+
* `PENDING` or `ENQUEUED`, the child sends a `synthetic-failure`
|
|
13
|
+
* done-marker on `exec-event:${execId}` to unblock `awaitExec`. The
|
|
14
|
+
* marker carries `signature: null` and `kind: "synthetic-failure"` so the
|
|
15
|
+
* recv loop accepts it from the trusted in-process sender (see the harness-sandbox-exec spec).
|
|
16
|
+
*
|
|
17
|
+
* The pure sharding and check logic is hoisted so it can be unit-tested
|
|
18
|
+
* without spinning a DBOS runtime; `registerWatchdog` is the thin
|
|
19
|
+
* production wiring.
|
|
20
|
+
*/
|
|
21
|
+
import type pino from "pino";
|
|
22
|
+
import type { ResultAsync } from "neverthrow";
|
|
23
|
+
import type { DbError } from "../lib/db-result.js";
|
|
24
|
+
import type { ActiveSandboxRow } from "../state/index.js";
|
|
25
|
+
import type { SandboxClient } from "./client.js";
|
|
26
|
+
import type { ExecEventMessage, ExecResult, SandboxLiveness, SandboxRef } from "./types.js";
|
|
27
|
+
export declare const SHARD_COUNT = 8;
|
|
28
|
+
/** Stable hash → shard mapping, exported for tests. */
|
|
29
|
+
export declare function shardIndex(sandboxId: string, shardCount?: number): number;
|
|
30
|
+
/** Partition the active-sandbox set into `shardCount` lists. */
|
|
31
|
+
export declare function shardActiveSandboxes(rows: ActiveSandboxRow[], shardCount?: number): ActiveSandboxRow[][];
|
|
32
|
+
export interface CheckShardDeps {
|
|
33
|
+
isAlive: (ref: SandboxRef) => Promise<SandboxLiveness>;
|
|
34
|
+
getStatus: (workflowId: string) => Promise<{
|
|
35
|
+
status: string;
|
|
36
|
+
} | null>;
|
|
37
|
+
/**
|
|
38
|
+
* Send a synthetic-failure marker on the per-exec topic. In production
|
|
39
|
+
* this is `DBOS.send`; injected here for testability.
|
|
40
|
+
*/
|
|
41
|
+
sendSynthetic: (workflowId: string, execId: string, failure: ExecResult, reason: string) => Promise<void>;
|
|
42
|
+
logger?: Pick<pino.Logger, "info" | "warn" | "error">;
|
|
43
|
+
}
|
|
44
|
+
export interface CheckShardSummary {
|
|
45
|
+
activeCount: number;
|
|
46
|
+
deadCount: number;
|
|
47
|
+
syntheticSends: number;
|
|
48
|
+
liveWorkflowsSkipped: number;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Pure check logic over a shard: enumerate, call `isAlive`, and on
|
|
52
|
+
* dead-and-still-in-flight send a synthetic-failure. The in-flight guard
|
|
53
|
+
* is critical — without it a real `complete` arriving microseconds before
|
|
54
|
+
* the watchdog would race with the synthetic and produce a duplicate
|
|
55
|
+
* notification.
|
|
56
|
+
*/
|
|
57
|
+
export declare function checkShard(rows: ActiveSandboxRow[], deps: CheckShardDeps): Promise<CheckShardSummary>;
|
|
58
|
+
/** Encodes the synthetic-failure marker on the per-exec topic envelope. */
|
|
59
|
+
export declare function syntheticFailureMessage(execId: string, failure: ExecResult, reason: string, nowSec: number): ExecEventMessage;
|
|
60
|
+
export interface WatchdogDeps {
|
|
61
|
+
queryActiveSandboxes: () => ResultAsync<ActiveSandboxRow[], DbError>;
|
|
62
|
+
sandboxClient: SandboxClient;
|
|
63
|
+
shardCount?: number;
|
|
64
|
+
logger?: Pick<pino.Logger, "info" | "warn" | "error">;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Production registration. Builds the parent + child registered workflows
|
|
68
|
+
* and the scheduled trigger. The parent fans out via `startWorkflow` so
|
|
69
|
+
* each child is durable in its own right (and recovers independently).
|
|
70
|
+
*/
|
|
71
|
+
export declare function registerWatchdog(deps: WatchdogDeps): void;
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-sandbox-machine liveness watchdog (CONTEXT.md "Sandbox exec").
|
|
3
|
+
*
|
|
4
|
+
* A `@DBOS.scheduled` parent fires every minute, lists the active-sandbox
|
|
5
|
+
* registry, shards by `hash(sandboxId) % SHARD_COUNT`, and `startWorkflow`s
|
|
6
|
+
* one child check workflow per non-empty shard. The fan-out invariant —
|
|
7
|
+
* "no single invocation polls every sandbox" — is the user's explicit
|
|
8
|
+
* constraint.
|
|
9
|
+
*
|
|
10
|
+
* Each child workflow walks its shard, calls `isAlive`, and on `false`
|
|
11
|
+
* gates on `DBOS.getWorkflowStatus`: if the owning workflow is still
|
|
12
|
+
* `PENDING` or `ENQUEUED`, the child sends a `synthetic-failure`
|
|
13
|
+
* done-marker on `exec-event:${execId}` to unblock `awaitExec`. The
|
|
14
|
+
* marker carries `signature: null` and `kind: "synthetic-failure"` so the
|
|
15
|
+
* recv loop accepts it from the trusted in-process sender (see the harness-sandbox-exec spec).
|
|
16
|
+
*
|
|
17
|
+
* The pure sharding and check logic is hoisted so it can be unit-tested
|
|
18
|
+
* without spinning a DBOS runtime; `registerWatchdog` is the thin
|
|
19
|
+
* production wiring.
|
|
20
|
+
*/
|
|
21
|
+
import { createHash } from "node:crypto";
|
|
22
|
+
import { DBOS } from "@dbos-inc/dbos-sdk";
|
|
23
|
+
import { unwrapOrThrow } from "../lib/result.js";
|
|
24
|
+
import { workflowIdFromExec } from "./exec-id.js";
|
|
25
|
+
import { syntheticFailureReason, syntheticFailureResult } from "./liveness.js";
|
|
26
|
+
export const SHARD_COUNT = 8;
|
|
27
|
+
const WATCHDOG_CRON = "*/60 * * * * *";
|
|
28
|
+
/** Stable hash → shard mapping, exported for tests. */
|
|
29
|
+
export function shardIndex(sandboxId, shardCount = SHARD_COUNT) {
|
|
30
|
+
const digest = createHash("sha1").update(sandboxId).digest();
|
|
31
|
+
const slice = digest.readUInt32BE(0);
|
|
32
|
+
return slice % shardCount;
|
|
33
|
+
}
|
|
34
|
+
/** Partition the active-sandbox set into `shardCount` lists. */
|
|
35
|
+
export function shardActiveSandboxes(rows, shardCount = SHARD_COUNT) {
|
|
36
|
+
const shards = Array.from({ length: shardCount }, () => []);
|
|
37
|
+
for (const row of rows) {
|
|
38
|
+
shards[shardIndex(row.sandboxRef.sandboxId, shardCount)].push(row);
|
|
39
|
+
}
|
|
40
|
+
return shards;
|
|
41
|
+
}
|
|
42
|
+
const ACTIVE_WORKFLOW_STATUSES = new Set(["PENDING", "ENQUEUED"]);
|
|
43
|
+
/**
|
|
44
|
+
* Pure check logic over a shard: enumerate, call `isAlive`, and on
|
|
45
|
+
* dead-and-still-in-flight send a synthetic-failure. The in-flight guard
|
|
46
|
+
* is critical — without it a real `complete` arriving microseconds before
|
|
47
|
+
* the watchdog would race with the synthetic and produce a duplicate
|
|
48
|
+
* notification.
|
|
49
|
+
*/
|
|
50
|
+
export async function checkShard(rows, deps) {
|
|
51
|
+
let deadCount = 0;
|
|
52
|
+
let syntheticSends = 0;
|
|
53
|
+
let liveWorkflowsSkipped = 0;
|
|
54
|
+
for (const row of rows) {
|
|
55
|
+
// We don't know the secret from here; reconstruct a minimal in-memory
|
|
56
|
+
// SandboxRef from the persisted shape. `isAlive` does not consult
|
|
57
|
+
// the secret, so this is safe.
|
|
58
|
+
const ref = {
|
|
59
|
+
...row.sandboxRef,
|
|
60
|
+
callbackSecret: "",
|
|
61
|
+
};
|
|
62
|
+
let liveness;
|
|
63
|
+
try {
|
|
64
|
+
liveness = await deps.isAlive(ref);
|
|
65
|
+
}
|
|
66
|
+
catch (err) {
|
|
67
|
+
deps.logger?.warn({ sandboxId: row.sandboxRef.sandboxId, err: err instanceof Error ? err.message : String(err) }, "[sandbox-watchdog] isAlive threw — skipping this round");
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
if (liveness.alive)
|
|
71
|
+
continue;
|
|
72
|
+
deadCount++;
|
|
73
|
+
const workflowId = row.execId ? workflowIdFromExec(row.execId) : null;
|
|
74
|
+
if (!workflowId || !row.execId) {
|
|
75
|
+
// No exec was in flight when this row was tagged; nothing to
|
|
76
|
+
// unblock. Future change: clear the registry row separately.
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
const status = await deps.getStatus(workflowId);
|
|
80
|
+
if (!status || !ACTIVE_WORKFLOW_STATUSES.has(status.status)) {
|
|
81
|
+
liveWorkflowsSkipped++;
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
const reason = syntheticFailureReason(liveness);
|
|
85
|
+
const failure = syntheticFailureResult(row.execId, reason);
|
|
86
|
+
await deps.sendSynthetic(workflowId, row.execId, failure, reason);
|
|
87
|
+
syntheticSends++;
|
|
88
|
+
}
|
|
89
|
+
const summary = {
|
|
90
|
+
activeCount: rows.length,
|
|
91
|
+
deadCount,
|
|
92
|
+
syntheticSends,
|
|
93
|
+
liveWorkflowsSkipped,
|
|
94
|
+
};
|
|
95
|
+
deps.logger?.info(summary, "[sandbox-watchdog] shard check completed");
|
|
96
|
+
return summary;
|
|
97
|
+
}
|
|
98
|
+
/** Encodes the synthetic-failure marker on the per-exec topic envelope. */
|
|
99
|
+
export function syntheticFailureMessage(execId, failure, reason, nowSec) {
|
|
100
|
+
return {
|
|
101
|
+
payload: {
|
|
102
|
+
done: true,
|
|
103
|
+
result: failure,
|
|
104
|
+
kind: "synthetic-failure",
|
|
105
|
+
reason,
|
|
106
|
+
},
|
|
107
|
+
signature: null,
|
|
108
|
+
timestamp: nowSec,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Production registration. Builds the parent + child registered workflows
|
|
113
|
+
* and the scheduled trigger. The parent fans out via `startWorkflow` so
|
|
114
|
+
* each child is durable in its own right (and recovers independently).
|
|
115
|
+
*/
|
|
116
|
+
export function registerWatchdog(deps) {
|
|
117
|
+
const shardCount = deps.shardCount ?? SHARD_COUNT;
|
|
118
|
+
const childCheckShard = DBOS.registerWorkflow(async (rows) => {
|
|
119
|
+
return checkShard(rows, {
|
|
120
|
+
isAlive: (ref) => deps.sandboxClient.isAlive(ref),
|
|
121
|
+
getStatus: async (workflowId) => (await DBOS.getWorkflowStatus(workflowId)),
|
|
122
|
+
sendSynthetic: async (workflowId, execId, failure, reason) => {
|
|
123
|
+
const msg = syntheticFailureMessage(execId, failure, reason, Math.floor((await DBOS.now()) / 1000));
|
|
124
|
+
await DBOS.send(workflowId, msg, `exec-event:${execId}`);
|
|
125
|
+
},
|
|
126
|
+
logger: deps.logger,
|
|
127
|
+
});
|
|
128
|
+
}, { name: "sandbox-watchdog-shard" });
|
|
129
|
+
// The scheduled target must itself be a registered workflow — DBOS's
|
|
130
|
+
// scheduler loop skips (and errors on) any `@scheduled` function that lacks
|
|
131
|
+
// a workflow registration. Register, then schedule the same callable.
|
|
132
|
+
const watchdogParent = DBOS.registerWorkflow(async () => {
|
|
133
|
+
// Checkpoint the live registry read: the row set gates how many
|
|
134
|
+
// `startWorkflow` calls fire below, so a differing set on replay would
|
|
135
|
+
// drift the recorded function-ID sequence (see the harness-durable-runtime spec).
|
|
136
|
+
const rows = await DBOS.runStep(async () => unwrapOrThrow(await deps.queryActiveSandboxes()), { name: "query-active-sandboxes" });
|
|
137
|
+
if (rows.length === 0)
|
|
138
|
+
return;
|
|
139
|
+
const shards = shardActiveSandboxes(rows, shardCount);
|
|
140
|
+
for (const shard of shards) {
|
|
141
|
+
if (shard.length === 0)
|
|
142
|
+
continue;
|
|
143
|
+
await DBOS.startWorkflow(childCheckShard)(shard);
|
|
144
|
+
}
|
|
145
|
+
}, { name: "sandbox-watchdog-parent" });
|
|
146
|
+
DBOS.registerScheduled(watchdogParent, {
|
|
147
|
+
name: "sandbox-watchdog-parent",
|
|
148
|
+
crontab: WATCHDOG_CRON,
|
|
149
|
+
});
|
|
150
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Artifact manifest schema — defines entries tracked in working memory.
|
|
3
|
+
*
|
|
4
|
+
* The manifest is updated deterministically by the workflow runner
|
|
5
|
+
* after each step completes, not by the LLM.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
/** Artifact type inferred from the step subdirectory. */
|
|
9
|
+
export declare const ArtifactTypeSchema: z.ZodEnum<{
|
|
10
|
+
output: "output";
|
|
11
|
+
script: "script";
|
|
12
|
+
figure: "figure";
|
|
13
|
+
log: "log";
|
|
14
|
+
notebook: "notebook";
|
|
15
|
+
}>;
|
|
16
|
+
export type ArtifactType = z.infer<typeof ArtifactTypeSchema>;
|
|
17
|
+
/** A single artifact manifest entry. */
|
|
18
|
+
export declare const ArtifactManifestEntrySchema: z.ZodObject<{
|
|
19
|
+
stepId: z.ZodString;
|
|
20
|
+
runId: z.ZodString;
|
|
21
|
+
path: z.ZodString;
|
|
22
|
+
size: z.ZodNumber;
|
|
23
|
+
type: z.ZodEnum<{
|
|
24
|
+
output: "output";
|
|
25
|
+
script: "script";
|
|
26
|
+
figure: "figure";
|
|
27
|
+
log: "log";
|
|
28
|
+
notebook: "notebook";
|
|
29
|
+
}>;
|
|
30
|
+
hash: z.ZodOptional<z.ZodString>;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
export type ArtifactManifestEntry = z.infer<typeof ArtifactManifestEntrySchema>;
|
|
33
|
+
/** Infer artifact type from a file path based on its parent subdirectory. */
|
|
34
|
+
export declare function inferArtifactType(filePath: string): ArtifactType;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Artifact manifest schema — defines entries tracked in working memory.
|
|
3
|
+
*
|
|
4
|
+
* The manifest is updated deterministically by the workflow runner
|
|
5
|
+
* after each step completes, not by the LLM.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
/** Artifact type inferred from the step subdirectory. */
|
|
9
|
+
export const ArtifactTypeSchema = z.enum(["output", "figure", "script", "log", "notebook"]);
|
|
10
|
+
/** A single artifact manifest entry. */
|
|
11
|
+
export const ArtifactManifestEntrySchema = z.object({
|
|
12
|
+
/** Step that produced this artifact. */
|
|
13
|
+
stepId: z.string(),
|
|
14
|
+
/** Workflow run ID. */
|
|
15
|
+
runId: z.string(),
|
|
16
|
+
/** Relative path within the workspace (e.g., runs/run-001/steps/de-analysis/output/results.csv). */
|
|
17
|
+
path: z.string(),
|
|
18
|
+
/** File size in bytes. */
|
|
19
|
+
size: z.number(),
|
|
20
|
+
/** Artifact type inferred from subdirectory. */
|
|
21
|
+
type: ArtifactTypeSchema,
|
|
22
|
+
/** SHA-256 content hash for integrity verification (e.g., sha256:abcdef...). */
|
|
23
|
+
hash: z.string().optional(),
|
|
24
|
+
});
|
|
25
|
+
/** Infer artifact type from a file path based on its parent subdirectory. */
|
|
26
|
+
export function inferArtifactType(filePath) {
|
|
27
|
+
if (filePath.includes("/figures/"))
|
|
28
|
+
return "figure";
|
|
29
|
+
if (filePath.includes("/scripts/"))
|
|
30
|
+
return "script";
|
|
31
|
+
if (filePath.includes("/logs/"))
|
|
32
|
+
return "log";
|
|
33
|
+
if (filePath.includes("/notebooks/"))
|
|
34
|
+
return "notebook";
|
|
35
|
+
return "output";
|
|
36
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schemas for data profiling.
|
|
3
|
+
*
|
|
4
|
+
* Defines the profiler structured output schema used by the data-profile
|
|
5
|
+
* task and sandbox agent.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
/** Per-file metadata — includes path so the agent can discover files itself. */
|
|
9
|
+
export declare const ProfilerFileSchema: z.ZodObject<{
|
|
10
|
+
path: z.ZodString;
|
|
11
|
+
description: z.ZodString;
|
|
12
|
+
dataType: z.ZodString;
|
|
13
|
+
format: z.ZodString;
|
|
14
|
+
rows: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
15
|
+
cols: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
16
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
17
|
+
warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
18
|
+
metrics: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
/**
|
|
21
|
+
* Where an extracted subject fact came from. Used so downstream agents can
|
|
22
|
+
* judge how much to trust a field and so this profiler can flag conflicts.
|
|
23
|
+
*/
|
|
24
|
+
export declare const SubjectSourceEnum: z.ZodEnum<{
|
|
25
|
+
metadata: "metadata";
|
|
26
|
+
document: "document";
|
|
27
|
+
filename: "filename";
|
|
28
|
+
"user-context": "user-context";
|
|
29
|
+
inferred: "inferred";
|
|
30
|
+
}>;
|
|
31
|
+
export type SubjectSource = z.infer<typeof SubjectSourceEnum>;
|
|
32
|
+
export declare const OrganismSchema: z.ZodObject<{
|
|
33
|
+
scientificName: z.ZodString;
|
|
34
|
+
taxonId: z.ZodString;
|
|
35
|
+
source: z.ZodEnum<{
|
|
36
|
+
metadata: "metadata";
|
|
37
|
+
document: "document";
|
|
38
|
+
filename: "filename";
|
|
39
|
+
"user-context": "user-context";
|
|
40
|
+
inferred: "inferred";
|
|
41
|
+
}>;
|
|
42
|
+
confidence: z.ZodEnum<{
|
|
43
|
+
high: "high";
|
|
44
|
+
medium: "medium";
|
|
45
|
+
low: "low";
|
|
46
|
+
}>;
|
|
47
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
export type Organism = z.infer<typeof OrganismSchema>;
|
|
50
|
+
export declare const ProfilerOutputSchema: z.ZodObject<{
|
|
51
|
+
files: z.ZodArray<z.ZodObject<{
|
|
52
|
+
path: z.ZodString;
|
|
53
|
+
description: z.ZodString;
|
|
54
|
+
dataType: z.ZodString;
|
|
55
|
+
format: z.ZodString;
|
|
56
|
+
rows: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
57
|
+
cols: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
58
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
59
|
+
warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
60
|
+
metrics: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
61
|
+
}, z.core.$strip>>;
|
|
62
|
+
analysisSummary: z.ZodString;
|
|
63
|
+
domain: z.ZodString;
|
|
64
|
+
subtype: z.ZodOptional<z.ZodString>;
|
|
65
|
+
organism: z.ZodNullable<z.ZodObject<{
|
|
66
|
+
scientificName: z.ZodString;
|
|
67
|
+
taxonId: z.ZodString;
|
|
68
|
+
source: z.ZodEnum<{
|
|
69
|
+
metadata: "metadata";
|
|
70
|
+
document: "document";
|
|
71
|
+
filename: "filename";
|
|
72
|
+
"user-context": "user-context";
|
|
73
|
+
inferred: "inferred";
|
|
74
|
+
}>;
|
|
75
|
+
confidence: z.ZodEnum<{
|
|
76
|
+
high: "high";
|
|
77
|
+
medium: "medium";
|
|
78
|
+
low: "low";
|
|
79
|
+
}>;
|
|
80
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
81
|
+
}, z.core.$strip>>;
|
|
82
|
+
tissue: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
83
|
+
cellType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
84
|
+
condition: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
85
|
+
accessions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
86
|
+
experimentalDesign: z.ZodOptional<z.ZodString>;
|
|
87
|
+
qualityAssessment: z.ZodOptional<z.ZodObject<{
|
|
88
|
+
concerns: z.ZodArray<z.ZodString>;
|
|
89
|
+
strengths: z.ZodArray<z.ZodString>;
|
|
90
|
+
}, z.core.$strip>>;
|
|
91
|
+
}, z.core.$strip>;
|
|
92
|
+
export type ProfilerOutput = z.infer<typeof ProfilerOutputSchema>;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schemas for data profiling.
|
|
3
|
+
*
|
|
4
|
+
* Defines the profiler structured output schema used by the data-profile
|
|
5
|
+
* task and sandbox agent.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
// ── Profiler structured output (sandbox agent) ─────────────────────
|
|
9
|
+
/** Per-file metadata — includes path so the agent can discover files itself. */
|
|
10
|
+
export const ProfilerFileSchema = z.object({
|
|
11
|
+
path: z.string().describe("File path relative to analysis root (e.g. data/inputs/{fileId}/counts.txt)"),
|
|
12
|
+
description: z.string().describe("What this file contains and its role in the analysis"),
|
|
13
|
+
dataType: z
|
|
14
|
+
.string()
|
|
15
|
+
.describe("Semantic data type: count-matrix, normalized-expression, variants, alignments, " +
|
|
16
|
+
"clinical-metadata, clinical-sdtm, clinical-adam, clinical-response, " +
|
|
17
|
+
"pharmacokinetic-data, adverse-events, safety-labs, " +
|
|
18
|
+
"molecular-structures, annotations"),
|
|
19
|
+
format: z.string().describe("File format (e.g. CSV, TSV, h5ad, MTX, VCF, BAM, SDF, FASTQ)"),
|
|
20
|
+
rows: z.number().nullish(),
|
|
21
|
+
cols: z.number().nullish(),
|
|
22
|
+
tags: z.array(z.string()).optional().describe("Searchable labels for downstream discovery"),
|
|
23
|
+
warnings: z.array(z.string()).optional().describe("Quality issues or concerns specific to this file"),
|
|
24
|
+
metrics: z
|
|
25
|
+
.record(z.string(), z.union([z.string(), z.number(), z.boolean()]))
|
|
26
|
+
.optional()
|
|
27
|
+
.describe("Format-specific profiling metrics as flat key-value pairs (e.g. sparsity, medianLibrarySize, tiTvRatio, gcContent, missingRate)"),
|
|
28
|
+
});
|
|
29
|
+
/**
|
|
30
|
+
* Where an extracted subject fact came from. Used so downstream agents can
|
|
31
|
+
* judge how much to trust a field and so this profiler can flag conflicts.
|
|
32
|
+
*/
|
|
33
|
+
export const SubjectSourceEnum = z.enum([
|
|
34
|
+
"metadata", // sample-sheet/header column, internal manifest
|
|
35
|
+
"document", // paper PDF, README, methods doc
|
|
36
|
+
"filename", // file or folder naming convention (GSExxx, "human_", etc.)
|
|
37
|
+
"user-context", // user-supplied analysis context
|
|
38
|
+
"inferred", // inferred from data content (e.g. gene symbol patterns)
|
|
39
|
+
]);
|
|
40
|
+
export const OrganismSchema = z.object({
|
|
41
|
+
scientificName: z.string().describe("Latin binomial, e.g. 'Homo sapiens', 'Macaca fascicularis', 'Mus musculus'."),
|
|
42
|
+
taxonId: z.string().describe("NCBI Taxonomy ID as a string, e.g. '9606' (human), '9541' (cynomolgus macaque), '10090' (mouse)."),
|
|
43
|
+
source: SubjectSourceEnum,
|
|
44
|
+
confidence: z
|
|
45
|
+
.enum(["high", "medium", "low"])
|
|
46
|
+
.describe("high: explicit organism column or paper/README statement. " +
|
|
47
|
+
"medium: filename convention or accession lookup. " +
|
|
48
|
+
"low: inferred from gene IDs or other indirect signals, OR sources disagree (in which case also record the conflict in qualityAssessment.concerns)."),
|
|
49
|
+
notes: z.string().optional().describe("Brief note when source is 'inferred' or confidence is 'low' (one sentence)."),
|
|
50
|
+
});
|
|
51
|
+
export const ProfilerOutputSchema = z.object({
|
|
52
|
+
files: z.array(ProfilerFileSchema),
|
|
53
|
+
analysisSummary: z.string().describe("Narrative overview of the dataset — structure, content, analytical potential, and limitations"),
|
|
54
|
+
domain: z.string().describe("Scientific domain (e.g. transcriptomics, proteomics, genomics, chemistry, clinical, imaging, metabolomics, multi-omics)"),
|
|
55
|
+
subtype: z.string().optional().describe("Specific subtype within domain (e.g. bulk-rna-seq, single-cell, LC-MS/MS, whole-genome-sequencing)"),
|
|
56
|
+
organism: OrganismSchema.nullable().describe("Subject organism, identified from any input (metadata files, paper PDFs, READMEs, filenames, accession patterns). " +
|
|
57
|
+
"Set to null ONLY when no input identifies the organism — never guess. " +
|
|
58
|
+
"A null organism is acceptable; a wrong taxon ID is not. " +
|
|
59
|
+
"If inputs disagree on organism, pick the most-trusted source, set confidence accordingly, and add the conflict to qualityAssessment.concerns."),
|
|
60
|
+
tissue: z
|
|
61
|
+
.string()
|
|
62
|
+
.nullable()
|
|
63
|
+
.optional()
|
|
64
|
+
.describe("Subject tissue or anatomical site when applicable (e.g. 'rectal mucosal biopsy', 'liver', 'PBMC', 'whole blood'). null if not applicable or unknown."),
|
|
65
|
+
cellType: z
|
|
66
|
+
.string()
|
|
67
|
+
.nullable()
|
|
68
|
+
.optional()
|
|
69
|
+
.describe("Subject cell type when applicable (e.g. 'CD4+ T cells', 'iPSC-derived hepatocytes', 'primary hepatocytes'). null if not applicable or unknown."),
|
|
70
|
+
condition: z
|
|
71
|
+
.string()
|
|
72
|
+
.nullable()
|
|
73
|
+
.optional()
|
|
74
|
+
.describe("Disease, treatment, or perturbation under study (e.g. 'Ulcerative Colitis vs healthy controls', 'cisplatin dose-response', 'CRISPR knockout of TP53'). null if not applicable or unknown."),
|
|
75
|
+
accessions: z
|
|
76
|
+
.array(z.string())
|
|
77
|
+
.optional()
|
|
78
|
+
.describe("Public dataset accessions found in any input (filenames, metadata, paper). " +
|
|
79
|
+
"GEO (GSE/GSM), SRA (SRP/SRR/SRX), BioProject (PRJNA/PRJEB/PRJDB), ArrayExpress (E-MTAB-xxxx), dbGaP (phs), EGA (EGAS/EGAD)."),
|
|
80
|
+
experimentalDesign: z.string().optional().describe("Description of experimental design — conditions, groups, comparisons, replicates, pairing"),
|
|
81
|
+
qualityAssessment: z
|
|
82
|
+
.object({
|
|
83
|
+
concerns: z
|
|
84
|
+
.array(z.string())
|
|
85
|
+
.describe("Dataset-wide quality issues (e.g. batch effects, sample imbalance, high missing rate, conflicting organism declarations across inputs)"),
|
|
86
|
+
strengths: z.array(z.string()).describe("Dataset strengths (e.g. deep coverage, balanced groups, low duplication)"),
|
|
87
|
+
})
|
|
88
|
+
.optional(),
|
|
89
|
+
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const FileMetadataSchema: z.ZodObject<{
|
|
3
|
+
role: z.ZodEnum<{
|
|
4
|
+
input: "input";
|
|
5
|
+
step_output: "step_output";
|
|
6
|
+
}>;
|
|
7
|
+
dataType: z.ZodString;
|
|
8
|
+
format: z.ZodString;
|
|
9
|
+
rows: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
cols: z.ZodOptional<z.ZodNumber>;
|
|
11
|
+
producerStep: z.ZodOptional<z.ZodString>;
|
|
12
|
+
producerRun: z.ZodOptional<z.ZodString>;
|
|
13
|
+
producerAgent: z.ZodOptional<z.ZodString>;
|
|
14
|
+
omicsType: z.ZodOptional<z.ZodString>;
|
|
15
|
+
organism: z.ZodOptional<z.ZodString>;
|
|
16
|
+
featureType: z.ZodOptional<z.ZodString>;
|
|
17
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
18
|
+
warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
19
|
+
}, z.core.$loose>;
|
|
20
|
+
export type FileMetadata = z.infer<typeof FileMetadataSchema>;
|
|
21
|
+
/**
|
|
22
|
+
* One file's metadata as submitted by the describer agent through the
|
|
23
|
+
* `submit_file_metadata` tool. Keyed by `path` — the tool validates each
|
|
24
|
+
* path against the known artifact set, so descriptions are matched to files
|
|
25
|
+
* by path, never by array position.
|
|
26
|
+
*/
|
|
27
|
+
export declare const SubmittedFileDescriptionSchema: z.ZodObject<{
|
|
28
|
+
path: z.ZodString;
|
|
29
|
+
description: z.ZodString;
|
|
30
|
+
dataType: z.ZodString;
|
|
31
|
+
format: z.ZodString;
|
|
32
|
+
rows: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
33
|
+
cols: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
34
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
35
|
+
warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
36
|
+
}, z.core.$strip>;
|
|
37
|
+
export type SubmittedFileDescription = z.infer<typeof SubmittedFileDescriptionSchema>;
|
|
38
|
+
/** Input contract for the `submit_file_metadata` tool. */
|
|
39
|
+
export declare const SubmitFileMetadataInputSchema: z.ZodObject<{
|
|
40
|
+
files: z.ZodArray<z.ZodObject<{
|
|
41
|
+
path: z.ZodString;
|
|
42
|
+
description: z.ZodString;
|
|
43
|
+
dataType: z.ZodString;
|
|
44
|
+
format: z.ZodString;
|
|
45
|
+
rows: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
46
|
+
cols: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
47
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
48
|
+
warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
49
|
+
}, z.core.$strip>>;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
export type SubmitFileMetadataInput = z.infer<typeof SubmitFileMetadataInputSchema>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const FileMetadataSchema = z
|
|
3
|
+
.object({
|
|
4
|
+
role: z.enum(["input", "step_output"]),
|
|
5
|
+
dataType: z.string(),
|
|
6
|
+
format: z.string(),
|
|
7
|
+
rows: z.number().optional(),
|
|
8
|
+
cols: z.number().optional(),
|
|
9
|
+
producerStep: z.string().optional(),
|
|
10
|
+
producerRun: z.string().optional(),
|
|
11
|
+
producerAgent: z.string().optional(),
|
|
12
|
+
omicsType: z.string().optional(),
|
|
13
|
+
organism: z.string().optional(),
|
|
14
|
+
featureType: z.string().optional(),
|
|
15
|
+
tags: z.array(z.string()).optional(),
|
|
16
|
+
warnings: z.array(z.string()).optional(),
|
|
17
|
+
})
|
|
18
|
+
.passthrough();
|
|
19
|
+
/**
|
|
20
|
+
* One file's metadata as submitted by the describer agent through the
|
|
21
|
+
* `submit_file_metadata` tool. Keyed by `path` — the tool validates each
|
|
22
|
+
* path against the known artifact set, so descriptions are matched to files
|
|
23
|
+
* by path, never by array position.
|
|
24
|
+
*/
|
|
25
|
+
export const SubmittedFileDescriptionSchema = z.object({
|
|
26
|
+
/** Exact path of the file being described, copied from the prompt's list. */
|
|
27
|
+
path: z.string(),
|
|
28
|
+
description: z.string(),
|
|
29
|
+
dataType: z.string(),
|
|
30
|
+
format: z.string(),
|
|
31
|
+
rows: z.number().nullish(),
|
|
32
|
+
cols: z.number().nullish(),
|
|
33
|
+
tags: z.array(z.string()).optional(),
|
|
34
|
+
warnings: z.array(z.string()).optional(),
|
|
35
|
+
});
|
|
36
|
+
/** Input contract for the `submit_file_metadata` tool. */
|
|
37
|
+
export const SubmitFileMetadataInputSchema = z.object({
|
|
38
|
+
files: z.array(SubmittedFileDescriptionSchema),
|
|
39
|
+
});
|