@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,195 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sandbox-agent composition root.
|
|
3
|
+
*
|
|
4
|
+
* `createSandboxAgent(deps, meta, body, opts?)` produces a fully dep-bound
|
|
5
|
+
* `AgentDefinition` for one sandbox agent (see the harness-durable-runtime spec): SOUL kernel + the
|
|
6
|
+
* agent's own prompt body + sandbox standards composed into a single
|
|
7
|
+
* static `systemPrompt` string (no processors at request time, see the harness-providers spec),
|
|
8
|
+
* the workspace mutate trio (`execute_command`, `write_file`, `edit_file`)
|
|
9
|
+
* bound to the shared `SandboxClient` and the step's `allowedWritePrefix`,
|
|
10
|
+
* the workspace read tools (`read_file`, `grep`) over the shared
|
|
11
|
+
* `WorkspaceFilesystem`, and the bio/literature/context7/run-inspection
|
|
12
|
+
* tools its `meta.tools` allowlist names.
|
|
13
|
+
*
|
|
14
|
+
* Tool resolution is a single registry lookup — every name in `meta.tools`
|
|
15
|
+
* must map to a concrete `Tool`; unknown names throw at composition time
|
|
16
|
+
* so misconfigured agents fail at startup, not at the first LLM call.
|
|
17
|
+
*/
|
|
18
|
+
import { sandboxOrientCorePrompt, sandboxAnalysisStepStandardsPrompt } from "../../prompts/sandbox-standards.js";
|
|
19
|
+
import { composeSystemPrompt } from "../system-prompt.js";
|
|
20
|
+
// Sandbox-environment introspection.
|
|
21
|
+
import { listAvailablePackagesTool, listAvailableRefsTool } from "../../tools/sandbox/index.js";
|
|
22
|
+
// Context7 docs (pure leaves).
|
|
23
|
+
import { queryDocsTool, resolveLibraryIdTool } from "../../tools/research/context7-docs.js";
|
|
24
|
+
// Run-inspection (dependency-bearing).
|
|
25
|
+
import { createInspectRunTool } from "../../tools/research/inspect-run.js";
|
|
26
|
+
// Bio leaf tools.
|
|
27
|
+
import { checkSafetyPanelTool, getBioactivityTool, getDrugInfoTool, getImpcKoProfileTool, getMechanismTool, getPubchemAssaysTool, getPubchemCrossRefsTool, getTargetSafetyTool, lookupGoTermTool, searchBgeeExpressionTool, searchClinicalTrialsTool, searchCompoundsTool, searchDgidbTool, searchFaersTool, searchGeneTool, searchGeoDatasetsTool, searchGwasCatalogTool, searchInteractionsTool, searchOpenTargetsTool, searchPathwayTool, searchPharmgkbTool, searchPubchemCompoundTool, searchTargetsTool, } from "../../tools/bio/index.js";
|
|
28
|
+
import { createNcbiTools, createChemDbTools } from "../../tools/bio/keys.js";
|
|
29
|
+
// Workspace read surface.
|
|
30
|
+
import { createFileStatTool, createGrepTool, createListFilesTool, createReadFileTool, createWorkspaceSearchTool } from "../../tools/workspace/index.js";
|
|
31
|
+
// Workspace mutate surface.
|
|
32
|
+
import { createEditFileTool, createExecuteCommandTool, createWorkspaceMutator, createWriteFileTool } from "../../tools/workspace/index.js";
|
|
33
|
+
// Skills (declared per agent via meta.skills).
|
|
34
|
+
import { createSkillTools } from "../../tools/sandbox/skills.js";
|
|
35
|
+
import { createReportBlockerTool } from "../../tools/sandbox/report-blocker.js";
|
|
36
|
+
import { toSandboxPath } from "../../workspace/paths.js";
|
|
37
|
+
import { setActiveExecId } from "../../state/index.js";
|
|
38
|
+
import { SANDBOX_AGENT_DEFAULT_MAX_ITERATIONS } from "./types.js";
|
|
39
|
+
/**
|
|
40
|
+
* Tools every sandbox agent receives — sandbox-environment introspection,
|
|
41
|
+
* library docs, and run inspection. Spread into each agent's
|
|
42
|
+
* `meta.tools` so planner-facing metadata and the resolved tool record
|
|
43
|
+
* stay in sync. Keep minimal — only tools every agent genuinely needs.
|
|
44
|
+
*/
|
|
45
|
+
export const BASE_SANDBOX_TOOLS = ["listAvailablePackages", "listAvailableRefs", "resolveLibraryId", "queryDocs", "inspectRun"];
|
|
46
|
+
/**
|
|
47
|
+
* Resolve `meta.tools` into the bio/research tools record. Workspace
|
|
48
|
+
* read/mutate tools are added by `createSandboxAgent` regardless of meta
|
|
49
|
+
* — they are the always-on substrate, not in the allowlist.
|
|
50
|
+
*/
|
|
51
|
+
function resolveSandboxTools(deps, tools) {
|
|
52
|
+
const ncbi = createNcbiTools(deps.bioKeys);
|
|
53
|
+
const chemDb = createChemDbTools(deps.bioKeys);
|
|
54
|
+
const registry = {
|
|
55
|
+
listAvailablePackages: listAvailablePackagesTool,
|
|
56
|
+
listAvailableRefs: listAvailableRefsTool,
|
|
57
|
+
resolveLibraryId: resolveLibraryIdTool,
|
|
58
|
+
queryDocs: queryDocsTool,
|
|
59
|
+
inspectRun: createInspectRunTool(deps.pool),
|
|
60
|
+
searchPubMed: ncbi.searchPubMed,
|
|
61
|
+
getArticleDetails: ncbi.getArticleDetails,
|
|
62
|
+
getArticleFullText: ncbi.getArticleFullText,
|
|
63
|
+
searchGene: searchGeneTool,
|
|
64
|
+
searchPathway: searchPathwayTool,
|
|
65
|
+
lookupGoTerm: lookupGoTermTool,
|
|
66
|
+
searchInteractions: searchInteractionsTool,
|
|
67
|
+
searchCompounds: searchCompoundsTool,
|
|
68
|
+
getBioactivity: getBioactivityTool,
|
|
69
|
+
searchTargets: searchTargetsTool,
|
|
70
|
+
getMechanism: getMechanismTool,
|
|
71
|
+
getDrugInfo: getDrugInfoTool,
|
|
72
|
+
searchPubchemCompound: searchPubchemCompoundTool,
|
|
73
|
+
getPubchemCrossRefs: getPubchemCrossRefsTool,
|
|
74
|
+
getPubchemAssays: getPubchemAssaysTool,
|
|
75
|
+
searchOpenTargets: searchOpenTargetsTool,
|
|
76
|
+
getTargetSafety: getTargetSafetyTool,
|
|
77
|
+
searchPharmgkb: searchPharmgkbTool,
|
|
78
|
+
searchFaers: searchFaersTool,
|
|
79
|
+
searchClinicalTrials: searchClinicalTrialsTool,
|
|
80
|
+
searchGeoDatasets: searchGeoDatasetsTool,
|
|
81
|
+
searchClinvar: ncbi.searchClinvar,
|
|
82
|
+
searchDgidb: searchDgidbTool,
|
|
83
|
+
searchGwasCatalog: searchGwasCatalogTool,
|
|
84
|
+
searchDisgenet: chemDb.searchDisgenet,
|
|
85
|
+
searchDrugbank: chemDb.searchDrugbank,
|
|
86
|
+
searchBgeeExpression: searchBgeeExpressionTool,
|
|
87
|
+
getImpcKoProfile: getImpcKoProfileTool,
|
|
88
|
+
checkSafetyPanel: checkSafetyPanelTool,
|
|
89
|
+
searchToxcast: chemDb.searchToxcast,
|
|
90
|
+
searchCtxHazard: chemDb.searchCtxHazard,
|
|
91
|
+
searchCtxChemical: chemDb.searchCtxChemical,
|
|
92
|
+
searchCtxExposure: chemDb.searchCtxExposure,
|
|
93
|
+
};
|
|
94
|
+
const seen = new Set();
|
|
95
|
+
const resolved = [];
|
|
96
|
+
for (const name of tools) {
|
|
97
|
+
if (seen.has(name))
|
|
98
|
+
continue;
|
|
99
|
+
seen.add(name);
|
|
100
|
+
const tool = registry[name];
|
|
101
|
+
if (!tool) {
|
|
102
|
+
throw new Error(`createSandboxAgent: unknown SandboxToolName "${name}" — ` + `agent meta references a tool with no harness implementation.`);
|
|
103
|
+
}
|
|
104
|
+
resolved.push(tool);
|
|
105
|
+
}
|
|
106
|
+
return resolved;
|
|
107
|
+
}
|
|
108
|
+
/** Build the workspace mutate + read tools every sandbox agent receives. In
|
|
109
|
+
* `readOnly` mode the write_file/edit_file pair is omitted; execute_command
|
|
110
|
+
* and the read tools stay. */
|
|
111
|
+
function buildWorkspaceTools(deps, readOnly) {
|
|
112
|
+
const { step, sandboxClient, workspaceFs, pool, embedding, lineageCollector } = deps;
|
|
113
|
+
// Registry tagging is a best-effort watchdog backstop (`run-exec.ts` already
|
|
114
|
+
// swallows a throw here); fold a `DbError` into a no-op so a registry write
|
|
115
|
+
// failure neither fails the exec nor surfaces as an unhandled rejection.
|
|
116
|
+
const markExecActive = (execId) => setActiveExecId(pool, step.runId, step.stepId, execId).match(() => { }, () => { });
|
|
117
|
+
// The agent's writable working directory: relative paths resolve here, and
|
|
118
|
+
// writes are confined here. `allowedWritePrefix` is its host path; the
|
|
119
|
+
// in-sandbox path (the `execute_command` default cwd, see the harness-workspace-tools spec) is the same
|
|
120
|
+
// location under the `/{analysisId}` mount — derived from the host path so
|
|
121
|
+
// it is correct for non-step agents (data profiler, ephemeral) too.
|
|
122
|
+
const hostWorkingDir = step.allowedWritePrefix;
|
|
123
|
+
const sandboxWorkingDir = toSandboxPath(step.workspaceRoot, step.analysisId, hostWorkingDir);
|
|
124
|
+
const mutateTools = readOnly
|
|
125
|
+
? []
|
|
126
|
+
: (() => {
|
|
127
|
+
const mutator = createWorkspaceMutator({
|
|
128
|
+
sandboxClient,
|
|
129
|
+
sandbox: step.sandbox,
|
|
130
|
+
workspaceRoot: step.workspaceRoot,
|
|
131
|
+
analysisId: step.analysisId,
|
|
132
|
+
stepId: step.stepId,
|
|
133
|
+
workflowId: step.workflowId,
|
|
134
|
+
workingDir: hostWorkingDir,
|
|
135
|
+
sandboxWorkingDir,
|
|
136
|
+
nextFunctionId: step.nextFunctionId,
|
|
137
|
+
deadlineMs: step.deadlineMs,
|
|
138
|
+
...(lineageCollector ? { lineageCollector } : {}),
|
|
139
|
+
});
|
|
140
|
+
return [createWriteFileTool({ mutator }), createEditFileTool({ mutator, workspaceFilesystem: workspaceFs, workingDir: hostWorkingDir })];
|
|
141
|
+
})();
|
|
142
|
+
return [
|
|
143
|
+
createExecuteCommandTool({
|
|
144
|
+
sandboxClient,
|
|
145
|
+
sandbox: step.sandbox,
|
|
146
|
+
workflowId: step.workflowId,
|
|
147
|
+
stepId: step.stepId,
|
|
148
|
+
nextFunctionId: step.nextFunctionId,
|
|
149
|
+
deadlineMs: step.deadlineMs,
|
|
150
|
+
defaultCwd: sandboxWorkingDir,
|
|
151
|
+
markExecActive,
|
|
152
|
+
...(lineageCollector ? { lineageCollector, mountRoot: `/${step.analysisId}` } : {}),
|
|
153
|
+
}),
|
|
154
|
+
...mutateTools,
|
|
155
|
+
createReadFileTool(workspaceFs, hostWorkingDir),
|
|
156
|
+
createListFilesTool(workspaceFs, hostWorkingDir),
|
|
157
|
+
createFileStatTool(workspaceFs, hostWorkingDir),
|
|
158
|
+
createGrepTool(workspaceFs, hostWorkingDir),
|
|
159
|
+
...(embedding ? [createWorkspaceSearchTool(pool, embedding)] : []),
|
|
160
|
+
];
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Build one sandbox `AgentDefinition`. The system prompt is composed once
|
|
164
|
+
* (SOUL kernel + agent body + sandbox standards) — no processors, no
|
|
165
|
+
* conversational layer (sandbox agents are not user-facing). Tools are
|
|
166
|
+
* resolved against the closed allowlist; the workspace surface is always
|
|
167
|
+
* wired regardless of meta.
|
|
168
|
+
*/
|
|
169
|
+
export function createSandboxAgent(deps, meta, body, opts = {}) {
|
|
170
|
+
const appendStandards = opts.appendAnalysisStepStandards ?? true;
|
|
171
|
+
const sandboxLayer = appendStandards ? [sandboxOrientCorePrompt, sandboxAnalysisStepStandardsPrompt] : [sandboxOrientCorePrompt];
|
|
172
|
+
const agentBody = [body, ...sandboxLayer].map((s) => s.trim()).join("\n\n");
|
|
173
|
+
// Substitute the concrete in-sandbox paths the agent sees so the orient-core
|
|
174
|
+
// path model is accurate per step (see the harness-workspace-tools spec), not boilerplate prose.
|
|
175
|
+
const analysisRoot = `/${deps.step.analysisId}`;
|
|
176
|
+
const workingDir = toSandboxPath(deps.step.workspaceRoot, deps.step.analysisId, deps.step.allowedWritePrefix);
|
|
177
|
+
const resolvedBody = agentBody.split("{{WORKING_DIR}}").join(workingDir).split("{{ANALYSIS_ROOT}}").join(analysisRoot);
|
|
178
|
+
const systemPrompt = composeSystemPrompt(resolvedBody, {
|
|
179
|
+
includeConversationalStyle: false,
|
|
180
|
+
});
|
|
181
|
+
const skillTools = deps.skillsDir ? Object.values(createSkillTools({ skillsDir: deps.skillsDir, skills: meta.skills })) : [];
|
|
182
|
+
const tools = [
|
|
183
|
+
...buildWorkspaceTools(deps, opts.readOnly ?? false),
|
|
184
|
+
...skillTools,
|
|
185
|
+
...resolveSandboxTools(deps, meta.tools),
|
|
186
|
+
...(deps.blockerHolder ? [createReportBlockerTool(deps.blockerHolder)] : []),
|
|
187
|
+
];
|
|
188
|
+
return {
|
|
189
|
+
id: meta.id,
|
|
190
|
+
systemPrompt,
|
|
191
|
+
model: deps.model,
|
|
192
|
+
tools,
|
|
193
|
+
maxIterations: meta.defaultMaxSteps ?? SANDBOX_AGENT_DEFAULT_MAX_ITERATIONS,
|
|
194
|
+
};
|
|
195
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single-Cell Agent — single-cell RNA-seq analysis specialist.
|
|
3
|
+
*/
|
|
4
|
+
import type { AgentDefinition } from "../../loop/types.js";
|
|
5
|
+
import { type SandboxAgentDeps } from "./shared.js";
|
|
6
|
+
import type { AgentMeta } from "./types.js";
|
|
7
|
+
export declare const meta: AgentMeta;
|
|
8
|
+
export declare function createSingleCellAgent(deps: SandboxAgentDeps): AgentDefinition;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single-Cell Agent — single-cell RNA-seq analysis specialist.
|
|
3
|
+
*/
|
|
4
|
+
import { singleCellAgentPrompt } from "../../prompts/sandbox/single-cell-agent.js";
|
|
5
|
+
import { BASE_SANDBOX_TOOLS, createSandboxAgent } from "./shared.js";
|
|
6
|
+
export const meta = {
|
|
7
|
+
id: "single-cell-agent",
|
|
8
|
+
capabilities: [
|
|
9
|
+
"quality control",
|
|
10
|
+
"normalization",
|
|
11
|
+
"clustering",
|
|
12
|
+
"cell type annotation",
|
|
13
|
+
"differential expression",
|
|
14
|
+
"trajectory inference",
|
|
15
|
+
"cell-cell communication",
|
|
16
|
+
"TF activity inference",
|
|
17
|
+
"RNA velocity",
|
|
18
|
+
],
|
|
19
|
+
suitableFor: ["scrna-seq", "snrna-seq", "cytof", "mass-cytometry"],
|
|
20
|
+
skills: ["single-cell", "shared/omics-general"],
|
|
21
|
+
tools: [...BASE_SANDBOX_TOOLS, "searchPubMed", "getArticleDetails", "getArticleFullText", "searchGeoDatasets"],
|
|
22
|
+
};
|
|
23
|
+
export function createSingleCellAgent(deps) {
|
|
24
|
+
return createSandboxAgent(deps, meta, singleCellAgentPrompt);
|
|
25
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spatial Omics Agent — spatially-resolved transcriptomics and proteomics specialist.
|
|
3
|
+
*/
|
|
4
|
+
import type { AgentDefinition } from "../../loop/types.js";
|
|
5
|
+
import { type SandboxAgentDeps } from "./shared.js";
|
|
6
|
+
import type { AgentMeta } from "./types.js";
|
|
7
|
+
export declare const meta: AgentMeta;
|
|
8
|
+
export declare function createSpatialOmicsAgent(deps: SandboxAgentDeps): AgentDefinition;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spatial Omics Agent — spatially-resolved transcriptomics and proteomics specialist.
|
|
3
|
+
*/
|
|
4
|
+
import { spatialOmicsAgentPrompt } from "../../prompts/sandbox/spatial-omics-agent.js";
|
|
5
|
+
import { BASE_SANDBOX_TOOLS, createSandboxAgent } from "./shared.js";
|
|
6
|
+
export const meta = {
|
|
7
|
+
id: "spatial-omics-agent",
|
|
8
|
+
capabilities: ["spatial statistics", "spatial domain detection", "deconvolution", "niche analysis", "spatial autocorrelation", "ligand-receptor spatial"],
|
|
9
|
+
suitableFor: ["visium", "merfish", "slide-seq", "codex", "xenium", "mibi", "imc"],
|
|
10
|
+
skills: ["spatial-omics", "shared/omics-general"],
|
|
11
|
+
tools: [...BASE_SANDBOX_TOOLS, "searchPubMed", "getArticleDetails", "getArticleFullText", "searchGeoDatasets"],
|
|
12
|
+
};
|
|
13
|
+
export function createSpatialOmicsAgent(deps) {
|
|
14
|
+
return createSandboxAgent(deps, meta, spatialOmicsAgentPrompt);
|
|
15
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Statistical Modeling Agent — survival analysis, ML, and biomarker discovery specialist.
|
|
3
|
+
*/
|
|
4
|
+
import type { AgentDefinition } from "../../loop/types.js";
|
|
5
|
+
import { type SandboxAgentDeps } from "./shared.js";
|
|
6
|
+
import type { AgentMeta } from "./types.js";
|
|
7
|
+
export declare const meta: AgentMeta;
|
|
8
|
+
export declare function createStatisticalModelingAgent(deps: SandboxAgentDeps): AgentDefinition;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Statistical Modeling Agent — survival analysis, ML, and biomarker discovery specialist.
|
|
3
|
+
*/
|
|
4
|
+
import { statisticalModelingAgentPrompt } from "../../prompts/sandbox/statistical-modeling-agent.js";
|
|
5
|
+
import { BASE_SANDBOX_TOOLS, createSandboxAgent } from "./shared.js";
|
|
6
|
+
export const meta = {
|
|
7
|
+
id: "statistical-modeling-agent",
|
|
8
|
+
capabilities: [
|
|
9
|
+
"survival analysis",
|
|
10
|
+
"machine learning",
|
|
11
|
+
"classification",
|
|
12
|
+
"regression",
|
|
13
|
+
"mixed-effects models",
|
|
14
|
+
"biomarker discovery",
|
|
15
|
+
"feature selection",
|
|
16
|
+
"biomarker qualification",
|
|
17
|
+
"predictive vs prognostic biomarker testing",
|
|
18
|
+
"cutpoint optimization",
|
|
19
|
+
"multi-marker panel development",
|
|
20
|
+
"ROC and precision-recall analysis",
|
|
21
|
+
],
|
|
22
|
+
suitableFor: [
|
|
23
|
+
"survival",
|
|
24
|
+
"classification",
|
|
25
|
+
"regression",
|
|
26
|
+
"mixed-models",
|
|
27
|
+
"biomarker-discovery",
|
|
28
|
+
"biomarker-qualification",
|
|
29
|
+
"treatment-response",
|
|
30
|
+
"patient-stratification",
|
|
31
|
+
],
|
|
32
|
+
skills: ["statistical-modeling", "shared/omics-general"],
|
|
33
|
+
tools: [...BASE_SANDBOX_TOOLS, "searchPubMed", "getArticleDetails", "getArticleFullText"],
|
|
34
|
+
};
|
|
35
|
+
export function createStatisticalModelingAgent(deps) {
|
|
36
|
+
return createSandboxAgent(deps, meta, statisticalModelingAgentPrompt);
|
|
37
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Translational Safety Agent — drug safety / toxicology / adverse-event specialist.
|
|
3
|
+
*/
|
|
4
|
+
import type { AgentDefinition } from "../../loop/types.js";
|
|
5
|
+
import { type SandboxAgentDeps } from "./shared.js";
|
|
6
|
+
import type { AgentMeta } from "./types.js";
|
|
7
|
+
export declare const meta: AgentMeta;
|
|
8
|
+
export declare function createTranslationalSafetyAgent(deps: SandboxAgentDeps): AgentDefinition;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Translational Safety Agent — drug safety / toxicology / adverse-event specialist.
|
|
3
|
+
*/
|
|
4
|
+
import { translationalSafetyAgentPrompt } from "../../prompts/sandbox/translational-safety-agent.js";
|
|
5
|
+
import { BASE_SANDBOX_TOOLS, createSandboxAgent } from "./shared.js";
|
|
6
|
+
export const meta = {
|
|
7
|
+
id: "translational-safety-agent",
|
|
8
|
+
capabilities: [
|
|
9
|
+
"safety biomarker analysis",
|
|
10
|
+
"structural safety assessment",
|
|
11
|
+
"adverse event profiling",
|
|
12
|
+
"target safety assessment",
|
|
13
|
+
"CYP liability analysis",
|
|
14
|
+
"drug-drug interaction assessment",
|
|
15
|
+
"in-vitro toxicology screening",
|
|
16
|
+
"CTCAE grading",
|
|
17
|
+
"hepatotoxicity assessment",
|
|
18
|
+
"cardiotoxicity assessment",
|
|
19
|
+
"nephrotoxicity assessment",
|
|
20
|
+
"hematological toxicity assessment",
|
|
21
|
+
"mouse KO phenotype lookup",
|
|
22
|
+
"cross-species baseline expression lookup",
|
|
23
|
+
],
|
|
24
|
+
suitableFor: [
|
|
25
|
+
"safety-biomarkers",
|
|
26
|
+
"adverse-events",
|
|
27
|
+
"toxicity-data",
|
|
28
|
+
"compound-safety",
|
|
29
|
+
"clinical-safety-labs",
|
|
30
|
+
"drug-interaction-data",
|
|
31
|
+
"pharmacogenomic-data",
|
|
32
|
+
],
|
|
33
|
+
skills: ["translational-safety", "cheminformatics", "shared/omics-general"],
|
|
34
|
+
tools: [
|
|
35
|
+
...BASE_SANDBOX_TOOLS,
|
|
36
|
+
"checkSafetyPanel",
|
|
37
|
+
"searchPubMed",
|
|
38
|
+
"getArticleDetails",
|
|
39
|
+
"getArticleFullText",
|
|
40
|
+
"searchGene",
|
|
41
|
+
"searchPathway",
|
|
42
|
+
"lookupGoTerm",
|
|
43
|
+
"searchInteractions",
|
|
44
|
+
"searchOpenTargets",
|
|
45
|
+
"getTargetSafety",
|
|
46
|
+
"searchFaers",
|
|
47
|
+
"searchPharmgkb",
|
|
48
|
+
"searchDgidb",
|
|
49
|
+
"searchToxcast",
|
|
50
|
+
"searchCtxHazard",
|
|
51
|
+
"searchCtxChemical",
|
|
52
|
+
"searchCtxExposure",
|
|
53
|
+
"searchBgeeExpression",
|
|
54
|
+
"getImpcKoProfile",
|
|
55
|
+
],
|
|
56
|
+
};
|
|
57
|
+
export function createTranslationalSafetyAgent(deps) {
|
|
58
|
+
return createSandboxAgent(deps, meta, translationalSafetyAgentPrompt);
|
|
59
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sandbox-agent shared types.
|
|
3
|
+
*
|
|
4
|
+
* `SandboxToolName` is the closed allowlist of tools any sandbox agent may
|
|
5
|
+
* declare in its `AgentMeta.tools`. The `createSandboxAgent` resolver maps
|
|
6
|
+
* each name to a concrete `Tool` (pure leaf or fully dep-bound factory
|
|
7
|
+
* output) — unknown names throw at composition time, not at first LLM call.
|
|
8
|
+
*
|
|
9
|
+
* `searchDisgenet` and `searchDrugbank` require keys (`DISGENET_API_KEY`,
|
|
10
|
+
* `DRUGBANK_API_KEY`); without the key the underlying header builder
|
|
11
|
+
* throws on first call, which the harness surfaces as a tool `is_error`
|
|
12
|
+
* envelope. `searchGwasCatalog` is fully public.
|
|
13
|
+
*/
|
|
14
|
+
/** Closed allowlist of tools any sandbox agent may declare. */
|
|
15
|
+
export type SandboxToolName = "listAvailablePackages" | "listAvailableRefs" | "resolveLibraryId" | "queryDocs" | "inspectRun" | "searchPubMed" | "getArticleDetails" | "getArticleFullText" | "searchGene" | "searchPathway" | "lookupGoTerm" | "searchInteractions" | "searchCompounds" | "getBioactivity" | "searchTargets" | "getMechanism" | "getDrugInfo" | "searchPubchemCompound" | "getPubchemCrossRefs" | "getPubchemAssays" | "searchOpenTargets" | "getTargetSafety" | "searchPharmgkb" | "searchFaers" | "searchClinicalTrials" | "searchGeoDatasets" | "searchClinvar" | "searchDgidb" | "searchGwasCatalog" | "searchDisgenet" | "searchDrugbank" | "searchBgeeExpression" | "getImpcKoProfile" | "checkSafetyPanel" | "searchToxcast" | "searchCtxHazard" | "searchCtxChemical" | "searchCtxExposure";
|
|
16
|
+
/** Planner-facing metadata + tool allowlist for one sandbox agent. */
|
|
17
|
+
export interface AgentMeta {
|
|
18
|
+
/** Stable agent id — also the key in the catalog and the `AgentDefinition.id`. */
|
|
19
|
+
readonly id: string;
|
|
20
|
+
/** Capabilities surfaced to the planner. */
|
|
21
|
+
readonly capabilities: readonly string[];
|
|
22
|
+
/** Omics / data types this agent handles. */
|
|
23
|
+
readonly suitableFor: readonly string[];
|
|
24
|
+
/** Skill directory names loaded into the agent's workspace. */
|
|
25
|
+
readonly skills: readonly string[];
|
|
26
|
+
/** Bio/literature tools the agent may use (workspace + sandbox tools are always wired). */
|
|
27
|
+
readonly tools: readonly SandboxToolName[];
|
|
28
|
+
/** Per-agent override for `maxIterations`; defaults to {@link SANDBOX_AGENT_DEFAULT_MAX_ITERATIONS}. */
|
|
29
|
+
readonly defaultMaxSteps?: number;
|
|
30
|
+
/** False for agents the planner must NOT assign to plan steps (executors, the profiler). */
|
|
31
|
+
readonly plannable?: boolean;
|
|
32
|
+
}
|
|
33
|
+
/** Default runaway-guard for sandbox agents. */
|
|
34
|
+
export declare const SANDBOX_AGENT_DEFAULT_MAX_ITERATIONS = 50;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sandbox-agent shared types.
|
|
3
|
+
*
|
|
4
|
+
* `SandboxToolName` is the closed allowlist of tools any sandbox agent may
|
|
5
|
+
* declare in its `AgentMeta.tools`. The `createSandboxAgent` resolver maps
|
|
6
|
+
* each name to a concrete `Tool` (pure leaf or fully dep-bound factory
|
|
7
|
+
* output) — unknown names throw at composition time, not at first LLM call.
|
|
8
|
+
*
|
|
9
|
+
* `searchDisgenet` and `searchDrugbank` require keys (`DISGENET_API_KEY`,
|
|
10
|
+
* `DRUGBANK_API_KEY`); without the key the underlying header builder
|
|
11
|
+
* throws on first call, which the harness surfaces as a tool `is_error`
|
|
12
|
+
* envelope. `searchGwasCatalog` is fully public.
|
|
13
|
+
*/
|
|
14
|
+
/** Default runaway-guard for sandbox agents. */
|
|
15
|
+
export const SANDBOX_AGENT_DEFAULT_MAX_ITERATIONS = 50;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Boot-time skill validation.
|
|
3
|
+
*
|
|
4
|
+
* Verifies that SKILLS_DIR exists and every skill name declared by a sandbox
|
|
5
|
+
* agent resolves to a readable SKILL.md. Catches Dockerfile drift and typos
|
|
6
|
+
* in agent meta before the first analysis runs.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Minimal shape this validator reads — `id` for diagnostics and `skills`
|
|
10
|
+
* for the per-agent skill list. Declared structurally so `AgentMeta` types
|
|
11
|
+
* with `readonly` arrays work without a cast at the call site.
|
|
12
|
+
*/
|
|
13
|
+
interface AgentMetaLike {
|
|
14
|
+
readonly id: string;
|
|
15
|
+
readonly skills: readonly string[];
|
|
16
|
+
}
|
|
17
|
+
export declare function validateAgentSkills(skillsDir: string, catalog: Readonly<Record<string, AgentMetaLike>>): void;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Boot-time skill validation.
|
|
3
|
+
*
|
|
4
|
+
* Verifies that SKILLS_DIR exists and every skill name declared by a sandbox
|
|
5
|
+
* agent resolves to a readable SKILL.md. Catches Dockerfile drift and typos
|
|
6
|
+
* in agent meta before the first analysis runs.
|
|
7
|
+
*/
|
|
8
|
+
import { statSync } from "node:fs";
|
|
9
|
+
import { join } from "node:path";
|
|
10
|
+
export function validateAgentSkills(skillsDir, catalog) {
|
|
11
|
+
try {
|
|
12
|
+
const s = statSync(skillsDir);
|
|
13
|
+
if (!s.isDirectory()) {
|
|
14
|
+
throw new Error(`SKILLS_DIR "${skillsDir}" is not a directory`);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
catch (err) {
|
|
18
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
19
|
+
throw new Error(`SKILLS_DIR "${skillsDir}" is not accessible: ${msg}. ` + `Set SKILLS_DIR to a directory containing skill subfolders (one SKILL.md each).`, { cause: err });
|
|
20
|
+
}
|
|
21
|
+
const missing = [];
|
|
22
|
+
for (const meta of Object.values(catalog)) {
|
|
23
|
+
for (const skill of meta.skills) {
|
|
24
|
+
const skillFile = join(skillsDir, skill, "SKILL.md");
|
|
25
|
+
try {
|
|
26
|
+
const s = statSync(skillFile);
|
|
27
|
+
if (!s.isFile()) {
|
|
28
|
+
missing.push({ agentId: meta.id, skill, expectedPath: skillFile });
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
missing.push({ agentId: meta.id, skill, expectedPath: skillFile });
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
if (missing.length > 0) {
|
|
37
|
+
const lines = missing.map((m) => ` - agent "${m.agentId}" declares skill "${m.skill}" but ${m.expectedPath} is missing`).join("\n");
|
|
38
|
+
throw new Error(`Skill validation failed: ${missing.length} declared skill(s) not found under SKILLS_DIR="${skillsDir}":\n${lines}`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Planner-facing sandbox-agent catalog.
|
|
3
|
+
*
|
|
4
|
+
* Derives from `harness/agents/sandbox/index.ts` `SANDBOX_AGENT_META` —
|
|
5
|
+
* the source of truth — by projecting `{ id, capabilities, suitableFor }`
|
|
6
|
+
* and filtering on the `plannable` flag. `generatePlan` consumes the
|
|
7
|
+
* rendered markdown via `formatAgentCatalog()` to fill its prompt's
|
|
8
|
+
* `{{AGENT_CATALOG}}` placeholder.
|
|
9
|
+
*/
|
|
10
|
+
/** Planner-facing metadata for one sandbox agent. */
|
|
11
|
+
export interface PlannerAgentMeta {
|
|
12
|
+
readonly id: string;
|
|
13
|
+
readonly capabilities: readonly string[];
|
|
14
|
+
readonly suitableFor: readonly string[];
|
|
15
|
+
}
|
|
16
|
+
/** The sandbox agents the planner may assign to analysis-plan steps. */
|
|
17
|
+
export declare const PLANNABLE_AGENT_CATALOG: readonly PlannerAgentMeta[];
|
|
18
|
+
/**
|
|
19
|
+
* Ids of the agents the planner may assign — the `z.enum` domain for
|
|
20
|
+
* `PlanStepSchema.agent`. A non-empty tuple, as `z.enum` requires.
|
|
21
|
+
*/
|
|
22
|
+
export declare const PLANNABLE_AGENT_IDS: readonly [string, ...string[]];
|
|
23
|
+
/**
|
|
24
|
+
* Every sandbox agent id — plannable agents plus the workflow-dedicated
|
|
25
|
+
* ones (`data-profiler`, the executors). Plan validation checks step
|
|
26
|
+
* assignments against this set.
|
|
27
|
+
*/
|
|
28
|
+
export declare const KNOWN_AGENT_IDS: readonly string[];
|
|
29
|
+
/**
|
|
30
|
+
* Render the catalog as the markdown block the planner prompt expects in
|
|
31
|
+
* place of its `{{AGENT_CATALOG}}` placeholder.
|
|
32
|
+
*/
|
|
33
|
+
export declare function formatAgentCatalog(catalog?: readonly PlannerAgentMeta[]): string;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Planner-facing sandbox-agent catalog.
|
|
3
|
+
*
|
|
4
|
+
* Derives from `harness/agents/sandbox/index.ts` `SANDBOX_AGENT_META` —
|
|
5
|
+
* the source of truth — by projecting `{ id, capabilities, suitableFor }`
|
|
6
|
+
* and filtering on the `plannable` flag. `generatePlan` consumes the
|
|
7
|
+
* rendered markdown via `formatAgentCatalog()` to fill its prompt's
|
|
8
|
+
* `{{AGENT_CATALOG}}` placeholder.
|
|
9
|
+
*/
|
|
10
|
+
import { SANDBOX_AGENT_META } from "./sandbox/index.js";
|
|
11
|
+
/** The sandbox agents the planner may assign to analysis-plan steps. */
|
|
12
|
+
export const PLANNABLE_AGENT_CATALOG = Object.values(SANDBOX_AGENT_META)
|
|
13
|
+
.filter((meta) => meta.plannable !== false)
|
|
14
|
+
.map((meta) => ({
|
|
15
|
+
id: meta.id,
|
|
16
|
+
capabilities: [...meta.capabilities],
|
|
17
|
+
suitableFor: [...meta.suitableFor],
|
|
18
|
+
}));
|
|
19
|
+
/**
|
|
20
|
+
* Ids of the agents the planner may assign — the `z.enum` domain for
|
|
21
|
+
* `PlanStepSchema.agent`. A non-empty tuple, as `z.enum` requires.
|
|
22
|
+
*/
|
|
23
|
+
export const PLANNABLE_AGENT_IDS = (() => {
|
|
24
|
+
const ids = PLANNABLE_AGENT_CATALOG.map((meta) => meta.id);
|
|
25
|
+
if (ids.length === 0) {
|
|
26
|
+
throw new Error("PLANNABLE_AGENT_CATALOG is empty");
|
|
27
|
+
}
|
|
28
|
+
return ids;
|
|
29
|
+
})();
|
|
30
|
+
/**
|
|
31
|
+
* Every sandbox agent id — plannable agents plus the workflow-dedicated
|
|
32
|
+
* ones (`data-profiler`, the executors). Plan validation checks step
|
|
33
|
+
* assignments against this set.
|
|
34
|
+
*/
|
|
35
|
+
export const KNOWN_AGENT_IDS = Object.keys(SANDBOX_AGENT_META);
|
|
36
|
+
/**
|
|
37
|
+
* Render the catalog as the markdown block the planner prompt expects in
|
|
38
|
+
* place of its `{{AGENT_CATALOG}}` placeholder.
|
|
39
|
+
*/
|
|
40
|
+
export function formatAgentCatalog(catalog = PLANNABLE_AGENT_CATALOG) {
|
|
41
|
+
return catalog
|
|
42
|
+
.map((meta) => `- **${meta.id}**: capabilities: [${meta.capabilities.join(", ")}], ` + `suitable for: [${meta.suitableFor.join(", ")}]`)
|
|
43
|
+
.join("\n");
|
|
44
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Harness system-prompt composition.
|
|
3
|
+
*
|
|
4
|
+
* SOUL is static text — there is no processor pipeline. `composeSystemPrompt`
|
|
5
|
+
* concatenates the SOUL kernel, the optional SOUL conversational layer, and an
|
|
6
|
+
* agent's own prompt into the single `AgentDefinition.systemPrompt` string the
|
|
7
|
+
* loop sends as the cacheable prefix.
|
|
8
|
+
*
|
|
9
|
+
* `includeConversationalStyle` toggles the conversational block: the
|
|
10
|
+
* user-facing conversation agent keeps it; internal tool-only specialists
|
|
11
|
+
* (planner, run-synthesizer) and sandbox agents omit it — their tight tool
|
|
12
|
+
* loops compete with conversational discipline.
|
|
13
|
+
*/
|
|
14
|
+
export interface ComposeSystemPromptOptions {
|
|
15
|
+
/**
|
|
16
|
+
* Include the SOUL conversational layer (personality, response policy,
|
|
17
|
+
* 7-step reasoning). Default `true` — opt out for internal specialists.
|
|
18
|
+
*/
|
|
19
|
+
readonly includeConversationalStyle?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Compose an agent's full system prompt: SOUL kernel, the optional SOUL
|
|
23
|
+
* conversational layer, then the agent's own prompt — joined by blank lines.
|
|
24
|
+
*/
|
|
25
|
+
export declare function composeSystemPrompt(agentPrompt: string, options?: ComposeSystemPromptOptions): string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Harness system-prompt composition.
|
|
3
|
+
*
|
|
4
|
+
* SOUL is static text — there is no processor pipeline. `composeSystemPrompt`
|
|
5
|
+
* concatenates the SOUL kernel, the optional SOUL conversational layer, and an
|
|
6
|
+
* agent's own prompt into the single `AgentDefinition.systemPrompt` string the
|
|
7
|
+
* loop sends as the cacheable prefix.
|
|
8
|
+
*
|
|
9
|
+
* `includeConversationalStyle` toggles the conversational block: the
|
|
10
|
+
* user-facing conversation agent keeps it; internal tool-only specialists
|
|
11
|
+
* (planner, run-synthesizer) and sandbox agents omit it — their tight tool
|
|
12
|
+
* loops compete with conversational discipline.
|
|
13
|
+
*/
|
|
14
|
+
import { SOULKernelPrompt, SOULConversationalPrompt } from "../prompts/SOUL.js";
|
|
15
|
+
/**
|
|
16
|
+
* Compose an agent's full system prompt: SOUL kernel, the optional SOUL
|
|
17
|
+
* conversational layer, then the agent's own prompt — joined by blank lines.
|
|
18
|
+
*/
|
|
19
|
+
export function composeSystemPrompt(agentPrompt, options = {}) {
|
|
20
|
+
const includeConversational = options.includeConversationalStyle ?? true;
|
|
21
|
+
const sections = includeConversational ? [SOULKernelPrompt, SOULConversationalPrompt, agentPrompt] : [SOULKernelPrompt, agentPrompt];
|
|
22
|
+
return sections.map((s) => s.trim()).join("\n\n");
|
|
23
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chat-turn preparation — the host-agnostic assembly half of one chat turn.
|
|
3
|
+
*
|
|
4
|
+
* This is the PREPARATION half of a conversation turn, lifted out of the HTTP
|
|
5
|
+
* route so callers other than the route (e.g. a CLI) can reuse it. It owns,
|
|
6
|
+
* in order: thread-ownership resolution, best-effort title seeding, analysis
|
|
7
|
+
* status load, and message assembly. It deliberately owns NONE of the
|
|
8
|
+
* transport orchestration (streaming/SSE/queue/status codes) — that stays in
|
|
9
|
+
* the caller. A turn is `prepareChatTurn → runAgent(own emit) → appendTurn`.
|
|
10
|
+
*
|
|
11
|
+
* Returns a typed result: `not_found` when the `threadId` is owned by a
|
|
12
|
+
* different analysis (indistinguishable from absent), otherwise `ok` with the
|
|
13
|
+
* assembled `messages` and the standalone `userMessage` the caller persists.
|
|
14
|
+
*/
|
|
15
|
+
import type { Pool } from "pg";
|
|
16
|
+
import { type AssembledMessages } from "./message-assembly.js";
|
|
17
|
+
export interface PrepareChatTurnDeps {
|
|
18
|
+
readonly pool: Pool;
|
|
19
|
+
}
|
|
20
|
+
export interface PrepareChatTurnParams {
|
|
21
|
+
readonly analysisId: string;
|
|
22
|
+
readonly threadId: string;
|
|
23
|
+
readonly userInput: string;
|
|
24
|
+
}
|
|
25
|
+
export type PrepareChatTurnResult = ({
|
|
26
|
+
readonly kind: "ok";
|
|
27
|
+
} & AssembledMessages) | {
|
|
28
|
+
readonly kind: "not_found";
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Prepare one chat turn: resolve thread ownership, seed the title, load
|
|
32
|
+
* analysis status, and assemble the message array. Input sanitization stays
|
|
33
|
+
* inside {@link assembleMessages} (applied once to the new user input only).
|
|
34
|
+
*/
|
|
35
|
+
export declare function prepareChatTurn(deps: PrepareChatTurnDeps, params: PrepareChatTurnParams): Promise<PrepareChatTurnResult>;
|