@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,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* listAvailableRefs — list reference data available in the sandbox.
|
|
3
|
+
*/
|
|
4
|
+
import { readFile } from "node:fs/promises";
|
|
5
|
+
import { basename, join } from "node:path";
|
|
6
|
+
import { ok } from "neverthrow";
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
import { defineTool } from "../define-tool.js";
|
|
9
|
+
const REFS_ROOT = "/mnt/refs";
|
|
10
|
+
const REGISTRY_FILE = join(REFS_ROOT, "registry.json");
|
|
11
|
+
function formatCategory(category, entries) {
|
|
12
|
+
const labels = {
|
|
13
|
+
atlas_singlecell: "Single-cell reference atlases for label transfer (Pan-Cancer T cell — " +
|
|
14
|
+
"Zheng 2021, Pan-Cancer Myeloid — Cheng 2021, Tumor Immune Cell Atlas — " +
|
|
15
|
+
"Nieto 2021, Tabula Sapiens v2). Available as .h5ad (Python: anndata, " +
|
|
16
|
+
"scanpy, scvi-tools, symphonypy) and/or .rds (R: Seurat, ProjecTILs). " +
|
|
17
|
+
"Tabula Sapiens ships full + immune_subset variants. " +
|
|
18
|
+
"Use these for label transfer BEFORE falling back to marker genes.",
|
|
19
|
+
atlas_azimuth: "Azimuth references (Seurat-native): PBMC v1.0.0 and Tonsil v1.0.0. " +
|
|
20
|
+
"Each entry is a (ref.Rds, idx.annoy) pair stored under " +
|
|
21
|
+
"/mnt/refs/atlas_azimuth/{pbmc,tonsil}/. Load with " +
|
|
22
|
+
"Azimuth::LoadReference(path) where path is the directory containing " +
|
|
23
|
+
"ref.Rds + idx.annoy (e.g. '/mnt/refs/atlas_azimuth/pbmc'), then " +
|
|
24
|
+
"Azimuth::RunAzimuth(query, reference = path).",
|
|
25
|
+
atlas_projectils: "ProjecTILs reference atlases (Seurat .rds): human + mouse, CD8 + CD4. " +
|
|
26
|
+
"Use ProjecTILs::ProjecTILs.classifier() to assign every CD8 to one of " +
|
|
27
|
+
"the canonical TCF7+/GZMK+/TEX/TPEX/MAIT substates without re-deriving " +
|
|
28
|
+
"the classifier from scratch.",
|
|
29
|
+
celltypist_models: "Pre-staged CellTypist .pkl classifier models (Immune_All_Low backed by " +
|
|
30
|
+
"the Cross-Tissue Immune Cell Atlas; Immune_All_High; Pan_Fetal_Human; " +
|
|
31
|
+
"COVID19_Immune_Landscape). CELLTYPIST_FOLDER env var is preset, so " +
|
|
32
|
+
"celltypist.annotate_cells(model='Immune_All_Low') resolves with no " +
|
|
33
|
+
"network call.",
|
|
34
|
+
marker_panels: "Marker gene panels: PanglaoDB (community, parquet long-format), " +
|
|
35
|
+
"CellMarker 2.0 (tumor-context, parquet long-format), and the Cortex " +
|
|
36
|
+
"hand-curated panel for Stage 1 substates (TCF7+ memory CD8, exhausted " +
|
|
37
|
+
"CD8, effector-memory CD8, proliferating T, cDC1/cDC2/LAMP3+ DC, SPP1+ " +
|
|
38
|
+
"TAM, C1Q+ TAM, Tregs) — JSON with full provenance.",
|
|
39
|
+
gene_signatures: "Curated gene signatures from key tumor-immune papers: Sade-Feldman " +
|
|
40
|
+
"2018 exhausted CD8 (Table S2), Jerby-Arnon 2018 malignant resistance " +
|
|
41
|
+
"program (Table S1, Stage 3 classifier substrate), Tirosh 2016 AXL/MITF " +
|
|
42
|
+
"programs, Puram 2017 p-EMT (Table S5, HNSCC), Reactome cGAS-STING " +
|
|
43
|
+
"pathway (Stage 2.3 type-I IFN). JSON with PMID/DOI per entry.",
|
|
44
|
+
normal_reference: "Normal-tissue references for safety firing checks: GTEx v8 per-tissue " +
|
|
45
|
+
"median TPM (parquet) + sample attributes (parquet). Use to quantify " +
|
|
46
|
+
"off-target activation of any nominated classifier across healthy tissues.",
|
|
47
|
+
gene_mappings: "Gene ID Conversion Tables: Entrez/Ensembl/RefSeq/UniProt to symbol (NCBI); " +
|
|
48
|
+
"orthologs (Ensembl Compara) — file: orthologs_{tax_id}.parquet, columns: " +
|
|
49
|
+
"tax_id, ensembl_gene_id, entrez_id, symbol, relationship, other_tax_id, " +
|
|
50
|
+
"other_ensembl_gene_id, other_entrez_id, other_symbol; symmetric — to find " +
|
|
51
|
+
"human orthologs of Macaca fascicularis genes, open orthologs_9541.parquet " +
|
|
52
|
+
"and filter other_tax_id == '9606'; cross-division (e.g. yeast↔mouse) " +
|
|
53
|
+
"requires pivoting through human: yeast→human via orthologs_4896.parquet, " +
|
|
54
|
+
"then human→mouse via orthologs_9606.parquet",
|
|
55
|
+
omnipath: "OmniPath (interactions, regulons, annotations)",
|
|
56
|
+
reactome: "Reactome Pathways",
|
|
57
|
+
progeny: "PROGENy Pathway Weights (decoupler: source/target/weight/padj)",
|
|
58
|
+
collectri: "CollecTRI TF-Target Regulons (decoupler: source/target/mor)",
|
|
59
|
+
dorothea: "DoRothEA TF Regulons (decoupler: source/target/weight/confidence)",
|
|
60
|
+
lincs: "LINCS L1000 Drug Perturbation Consensus Signatures (up/down gene sets)",
|
|
61
|
+
hpa: "Human Protein Atlas (tissue RNA expression, target safety/secretome, full 107-column atlas)",
|
|
62
|
+
wikipathways: "WikiPathways Gene Sets",
|
|
63
|
+
msigdb: "MSigDB Gene Set Collections",
|
|
64
|
+
safety_targets: "Curated Off-Target Safety Panel (CSV + JSON: chembl_id, gene_symbol, uniprot, organ_system, severity, clinical_consequence)",
|
|
65
|
+
};
|
|
66
|
+
const lines = [`\n## ${labels[category] ?? category}`];
|
|
67
|
+
const grouped = new Map();
|
|
68
|
+
for (const e of entries) {
|
|
69
|
+
const key = e.organism ?? e.tax_id ?? e.subtype ?? "general";
|
|
70
|
+
if (!grouped.has(key))
|
|
71
|
+
grouped.set(key, []);
|
|
72
|
+
grouped.get(key).push(e);
|
|
73
|
+
}
|
|
74
|
+
for (const [group, items] of grouped) {
|
|
75
|
+
if (grouped.size > 1)
|
|
76
|
+
lines.push(`\n### ${group}`);
|
|
77
|
+
for (const e of items) {
|
|
78
|
+
const path = join(REFS_ROOT, e.local_path);
|
|
79
|
+
const name = basename(e.local_path);
|
|
80
|
+
const info = [e.rows != null ? `${e.rows.toLocaleString()} rows` : null, e.subtype, e.dataset].filter(Boolean).join(", ");
|
|
81
|
+
lines.push(` ${name}: ${path}${info ? ` (${info})` : ""}`);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return lines.join("\n");
|
|
85
|
+
}
|
|
86
|
+
export const listAvailableRefsTool = defineTool({
|
|
87
|
+
id: "list_available_refs",
|
|
88
|
+
description: "List all reference data available in the sandbox: single-cell atlases for " +
|
|
89
|
+
"label transfer (Pan-Cancer T/Myeloid, TICA, Tabula Sapiens, Azimuth PBMC/Tonsil), " +
|
|
90
|
+
"ProjecTILs CD8/CD4 atlases, CellTypist models, marker panels (PanglaoDB, " +
|
|
91
|
+
"CellMarker 2.0, Cortex curated), gene signatures (Sade-Feldman, Jerby-Arnon, " +
|
|
92
|
+
"Tirosh, Puram, cGAS-STING), normal-tissue references (GTEx v8), gene mappings, " +
|
|
93
|
+
"UniProt, OmniPath networks, Reactome, PROGENy, CollecTRI, DoRothEA, " +
|
|
94
|
+
"WikiPathways, MSigDB, LINCS L1000, HPA, and the curated off-target safety " +
|
|
95
|
+
"panel. Returns file paths for h5ad/rds/pkl/parquet/GMT/CSV/JSON resources. " +
|
|
96
|
+
"No data can be downloaded at runtime — only what this tool returns is available.",
|
|
97
|
+
inputSchema: z.object({}),
|
|
98
|
+
execute: async () => {
|
|
99
|
+
// A missing reference-store mount is an expected environment state —
|
|
100
|
+
// model it as an `available: false` data variant with a fallback note.
|
|
101
|
+
try {
|
|
102
|
+
const raw = await readFile(REGISTRY_FILE, "utf-8");
|
|
103
|
+
const registry = JSON.parse(raw);
|
|
104
|
+
const header = [
|
|
105
|
+
`Reference Store (build ${registry.build_id}, ${registry.generated_at})`,
|
|
106
|
+
`Total files: ${registry.summary.total_output_files}`,
|
|
107
|
+
`Mount: ${REFS_ROOT}`,
|
|
108
|
+
].join("\n");
|
|
109
|
+
const categoryOrder = [
|
|
110
|
+
"atlas_singlecell",
|
|
111
|
+
"atlas_azimuth",
|
|
112
|
+
"atlas_projectils",
|
|
113
|
+
"celltypist_models",
|
|
114
|
+
"marker_panels",
|
|
115
|
+
"gene_signatures",
|
|
116
|
+
"normal_reference",
|
|
117
|
+
"safety_targets",
|
|
118
|
+
"progeny",
|
|
119
|
+
"collectri",
|
|
120
|
+
"dorothea",
|
|
121
|
+
"omnipath",
|
|
122
|
+
"lincs",
|
|
123
|
+
"msigdb",
|
|
124
|
+
"wikipathways",
|
|
125
|
+
"reactome",
|
|
126
|
+
"hpa",
|
|
127
|
+
"gene_mappings",
|
|
128
|
+
];
|
|
129
|
+
const known = new Set(categoryOrder);
|
|
130
|
+
const allCategories = [
|
|
131
|
+
...categoryOrder.filter((c) => registry.files.by_category[c]),
|
|
132
|
+
...Object.keys(registry.files.by_category).filter((c) => !known.has(c)),
|
|
133
|
+
];
|
|
134
|
+
const sections = allCategories.map((c) => formatCategory(c, registry.files.by_category[c]));
|
|
135
|
+
return ok({ available: true, content: header + "\n" + sections.join("\n") });
|
|
136
|
+
}
|
|
137
|
+
catch {
|
|
138
|
+
return ok({
|
|
139
|
+
available: false,
|
|
140
|
+
content: "Reference store not available. The reference store may not be mounted at /mnt/refs. " +
|
|
141
|
+
"Gene mappings, UniProt, OmniPath, Reactome, PROGENy, CollecTRI, DoRothEA, " +
|
|
142
|
+
"WikiPathways, MSigDB, LINCS L1000, HPA, and the curated off-target safety panel " +
|
|
143
|
+
"cannot be loaded from pre-staged files.",
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `report_blocker` — a step agent's honest exit when it cannot fulfil its
|
|
3
|
+
* step (see the harness-sandbox-agents spec). There is no `submit`/`done` tool: a step's deliverable is
|
|
4
|
+
* its persisted files, so a clean end-of-turn after writing them is the
|
|
5
|
+
* implicit success. Calling `report_blocker` is the alternative to
|
|
6
|
+
* improvising an inline result the harness would launder into a green run.
|
|
7
|
+
*
|
|
8
|
+
* Mirrors the synthesizer's blocker (`execution/run-synthesis.ts`): the
|
|
9
|
+
* workflow body owns a per-run `BlockerHolder` and reads `holder.outcome`
|
|
10
|
+
* after `runAgent`. The tool only records the reason and tells the agent to
|
|
11
|
+
* stop — the body decides the terminal status.
|
|
12
|
+
*/
|
|
13
|
+
import { type Tool } from "../define-tool.js";
|
|
14
|
+
export interface BlockerOutcome {
|
|
15
|
+
readonly kind: "blocker";
|
|
16
|
+
readonly reason: string;
|
|
17
|
+
}
|
|
18
|
+
/** Per-run mutable cell the sandbox-step body reads after the loop. */
|
|
19
|
+
export interface BlockerHolder {
|
|
20
|
+
outcome: BlockerOutcome | null;
|
|
21
|
+
}
|
|
22
|
+
export declare function createBlockerHolder(): BlockerHolder;
|
|
23
|
+
export declare function createReportBlockerTool(holder: BlockerHolder): Tool;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `report_blocker` — a step agent's honest exit when it cannot fulfil its
|
|
3
|
+
* step (see the harness-sandbox-agents spec). There is no `submit`/`done` tool: a step's deliverable is
|
|
4
|
+
* its persisted files, so a clean end-of-turn after writing them is the
|
|
5
|
+
* implicit success. Calling `report_blocker` is the alternative to
|
|
6
|
+
* improvising an inline result the harness would launder into a green run.
|
|
7
|
+
*
|
|
8
|
+
* Mirrors the synthesizer's blocker (`execution/run-synthesis.ts`): the
|
|
9
|
+
* workflow body owns a per-run `BlockerHolder` and reads `holder.outcome`
|
|
10
|
+
* after `runAgent`. The tool only records the reason and tells the agent to
|
|
11
|
+
* stop — the body decides the terminal status.
|
|
12
|
+
*/
|
|
13
|
+
import { ok } from "neverthrow";
|
|
14
|
+
import { z } from "zod";
|
|
15
|
+
import { defineTool } from "../define-tool.js";
|
|
16
|
+
export function createBlockerHolder() {
|
|
17
|
+
return { outcome: null };
|
|
18
|
+
}
|
|
19
|
+
export function createReportBlockerTool(holder) {
|
|
20
|
+
return defineTool({
|
|
21
|
+
id: "report_blocker",
|
|
22
|
+
description: "Terminal. Call this when you cannot fulfil the step — required inputs " +
|
|
23
|
+
"are missing or unreadable, the requested analysis is infeasible with " +
|
|
24
|
+
"the available data/packages, or you cannot produce the persisted " +
|
|
25
|
+
"deliverables (scripts, output files, figures). Pass a clear reason. Do " +
|
|
26
|
+
"NOT improvise an inline result and narrate it; if you cannot persist " +
|
|
27
|
+
"real output files, report a blocker. Stop after calling.",
|
|
28
|
+
inputSchema: z.object({ reason: z.string().min(1) }),
|
|
29
|
+
execute: async (input) => {
|
|
30
|
+
if (holder.outcome === null) {
|
|
31
|
+
holder.outcome = { kind: "blocker", reason: input.reason };
|
|
32
|
+
}
|
|
33
|
+
return ok({
|
|
34
|
+
recorded: true,
|
|
35
|
+
message: "Blocker recorded. You are done — stop now and do not take further actions.",
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `skill_search` + `skill_read` — a sandbox agent's access to its declared
|
|
3
|
+
* skills (method decision trees, API references, worked examples) living as
|
|
4
|
+
* `SKILL.md` + reference files under `SKILLS_DIR/{skill}/`.
|
|
5
|
+
*
|
|
6
|
+
* Dependency-bearing factory (see the harness-durable-runtime spec): captures `skillsDir` and the agent's
|
|
7
|
+
* declared skill allowlist (`meta.skills`). Both tools are confined to that
|
|
8
|
+
* allowlist — an agent cannot read another agent's skills.
|
|
9
|
+
*
|
|
10
|
+
* `skill_search` is a keyword/substring match over the declared skills' text
|
|
11
|
+
* files (no embedding index): the per-agent skill set is a handful of
|
|
12
|
+
* directories, so a bounded scan is enough to route the agent to the right
|
|
13
|
+
* reference. Expected outcomes are data variants — never throws on a missing
|
|
14
|
+
* skill, an undeclared skill, or no matches.
|
|
15
|
+
*/
|
|
16
|
+
export interface SkillToolsDeps {
|
|
17
|
+
/** Absolute path to the skills tree (one subdirectory per skill). */
|
|
18
|
+
readonly skillsDir: string;
|
|
19
|
+
/** The agent's declared skills (`meta.skills`) — the access allowlist. */
|
|
20
|
+
readonly skills: readonly string[];
|
|
21
|
+
}
|
|
22
|
+
interface SkillMatch {
|
|
23
|
+
readonly skill: string;
|
|
24
|
+
readonly path: string;
|
|
25
|
+
readonly line: number;
|
|
26
|
+
readonly snippet: string;
|
|
27
|
+
readonly score: number;
|
|
28
|
+
}
|
|
29
|
+
type SkillSearchOutput = {
|
|
30
|
+
status: "no_skills";
|
|
31
|
+
} | {
|
|
32
|
+
status: "no_matches";
|
|
33
|
+
query: string;
|
|
34
|
+
} | {
|
|
35
|
+
status: "ok";
|
|
36
|
+
query: string;
|
|
37
|
+
matches: SkillMatch[];
|
|
38
|
+
};
|
|
39
|
+
type SkillReadOutput = {
|
|
40
|
+
status: "skill_not_declared";
|
|
41
|
+
skill: string;
|
|
42
|
+
} | {
|
|
43
|
+
status: "out_of_scope";
|
|
44
|
+
skill: string;
|
|
45
|
+
path: string;
|
|
46
|
+
} | {
|
|
47
|
+
status: "not_found";
|
|
48
|
+
skill: string;
|
|
49
|
+
path: string;
|
|
50
|
+
} | {
|
|
51
|
+
status: "truncated";
|
|
52
|
+
skill: string;
|
|
53
|
+
path: string;
|
|
54
|
+
content: string;
|
|
55
|
+
totalSize: number;
|
|
56
|
+
} | {
|
|
57
|
+
status: "ok";
|
|
58
|
+
skill: string;
|
|
59
|
+
path: string;
|
|
60
|
+
content: string;
|
|
61
|
+
};
|
|
62
|
+
export declare function createSkillTools(deps: SkillToolsDeps): {
|
|
63
|
+
skillSearch: import("../define-tool.js").Tool<{
|
|
64
|
+
query: string;
|
|
65
|
+
topK?: number | undefined;
|
|
66
|
+
}, SkillSearchOutput>;
|
|
67
|
+
skillRead: import("../define-tool.js").Tool<{
|
|
68
|
+
skill: string;
|
|
69
|
+
path: string;
|
|
70
|
+
}, SkillReadOutput>;
|
|
71
|
+
};
|
|
72
|
+
export {};
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `skill_search` + `skill_read` — a sandbox agent's access to its declared
|
|
3
|
+
* skills (method decision trees, API references, worked examples) living as
|
|
4
|
+
* `SKILL.md` + reference files under `SKILLS_DIR/{skill}/`.
|
|
5
|
+
*
|
|
6
|
+
* Dependency-bearing factory (see the harness-durable-runtime spec): captures `skillsDir` and the agent's
|
|
7
|
+
* declared skill allowlist (`meta.skills`). Both tools are confined to that
|
|
8
|
+
* allowlist — an agent cannot read another agent's skills.
|
|
9
|
+
*
|
|
10
|
+
* `skill_search` is a keyword/substring match over the declared skills' text
|
|
11
|
+
* files (no embedding index): the per-agent skill set is a handful of
|
|
12
|
+
* directories, so a bounded scan is enough to route the agent to the right
|
|
13
|
+
* reference. Expected outcomes are data variants — never throws on a missing
|
|
14
|
+
* skill, an undeclared skill, or no matches.
|
|
15
|
+
*/
|
|
16
|
+
import { readFile, readdir, stat } from "node:fs/promises";
|
|
17
|
+
import { join, relative, resolve, sep } from "node:path";
|
|
18
|
+
import { ok } from "neverthrow";
|
|
19
|
+
import { z } from "zod";
|
|
20
|
+
import { defineTool } from "../define-tool.js";
|
|
21
|
+
/** Bounds — keep a search over a deep skill tree cheap and context-safe. */
|
|
22
|
+
const MAX_FILE_BYTES = 512 * 1024;
|
|
23
|
+
const MAX_SNIPPET = 240;
|
|
24
|
+
const DEFAULT_TOP_K = 10;
|
|
25
|
+
const MAX_TOP_K = 25;
|
|
26
|
+
const TEXT_EXT = /\.(md|markdown|txt|py|r|R|json|ya?ml|csv|tsv)$/;
|
|
27
|
+
async function collectTextFiles(dir, acc) {
|
|
28
|
+
let entries;
|
|
29
|
+
try {
|
|
30
|
+
entries = await readdir(dir, { withFileTypes: true });
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
for (const e of entries) {
|
|
36
|
+
const full = join(dir, e.name);
|
|
37
|
+
if (e.isDirectory()) {
|
|
38
|
+
await collectTextFiles(full, acc);
|
|
39
|
+
}
|
|
40
|
+
else if (TEXT_EXT.test(e.name)) {
|
|
41
|
+
acc.push(full);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
export function createSkillTools(deps) {
|
|
46
|
+
const allowed = new Set(deps.skills);
|
|
47
|
+
const skillSearch = defineTool({
|
|
48
|
+
id: "skill_search",
|
|
49
|
+
description: "Search your skills (method decision trees, API references, worked " +
|
|
50
|
+
"examples) by keyword. Start here when picking a method or verifying an " +
|
|
51
|
+
"API detail. Returns matching skill files with a line snippet — then " +
|
|
52
|
+
"`skill_read` the file. No matches returns a data variant.",
|
|
53
|
+
inputSchema: z.object({
|
|
54
|
+
query: z.string().min(1).describe("Keywords to match (e.g. 'PyDESeq2 contrast syntax')."),
|
|
55
|
+
topK: z.number().int().min(1).max(MAX_TOP_K).optional().describe(`Max results to return. Defaults to ${DEFAULT_TOP_K}.`),
|
|
56
|
+
}),
|
|
57
|
+
execute: async ({ query, topK }) => {
|
|
58
|
+
if (allowed.size === 0) {
|
|
59
|
+
return ok({ status: "no_skills" });
|
|
60
|
+
}
|
|
61
|
+
const tokens = query.toLowerCase().split(/\s+/).filter(Boolean);
|
|
62
|
+
const matches = [];
|
|
63
|
+
for (const skill of allowed) {
|
|
64
|
+
const skillRoot = resolve(deps.skillsDir, skill);
|
|
65
|
+
const files = [];
|
|
66
|
+
await collectTextFiles(skillRoot, files);
|
|
67
|
+
for (const file of files) {
|
|
68
|
+
let content;
|
|
69
|
+
try {
|
|
70
|
+
const s = await stat(file);
|
|
71
|
+
if (s.size > MAX_FILE_BYTES)
|
|
72
|
+
continue;
|
|
73
|
+
content = await readFile(file, "utf8");
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
const lower = content.toLowerCase();
|
|
79
|
+
const distinct = tokens.filter((t) => lower.includes(t)).length;
|
|
80
|
+
if (distinct === 0)
|
|
81
|
+
continue;
|
|
82
|
+
const lines = content.split(/\r?\n/);
|
|
83
|
+
const hitIdx = lines.findIndex((l) => {
|
|
84
|
+
const ll = l.toLowerCase();
|
|
85
|
+
return tokens.some((t) => ll.includes(t));
|
|
86
|
+
});
|
|
87
|
+
const line = lines[hitIdx] ?? "";
|
|
88
|
+
matches.push({
|
|
89
|
+
skill,
|
|
90
|
+
path: relative(skillRoot, file).split(sep).join("/"),
|
|
91
|
+
line: hitIdx + 1,
|
|
92
|
+
snippet: line.trim().slice(0, MAX_SNIPPET),
|
|
93
|
+
score: distinct,
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if (matches.length === 0) {
|
|
98
|
+
return ok({ status: "no_matches", query });
|
|
99
|
+
}
|
|
100
|
+
matches.sort((a, b) => b.score - a.score);
|
|
101
|
+
return ok({
|
|
102
|
+
status: "ok",
|
|
103
|
+
query,
|
|
104
|
+
matches: matches.slice(0, topK ?? DEFAULT_TOP_K),
|
|
105
|
+
});
|
|
106
|
+
},
|
|
107
|
+
});
|
|
108
|
+
const skillRead = defineTool({
|
|
109
|
+
id: "skill_read",
|
|
110
|
+
description: "Read a file from one of your skills (e.g. its SKILL.md or a reference " +
|
|
111
|
+
"found via skill_search). Confined to your declared skills. Undeclared " +
|
|
112
|
+
"skills and missing paths return a data variant.",
|
|
113
|
+
inputSchema: z.object({
|
|
114
|
+
skill: z.string().min(1).describe("Skill name (one of your declared skills)."),
|
|
115
|
+
path: z.string().min(1).describe("File path within the skill, e.g. 'SKILL.md' or 'references/pydeseq2-api.md'."),
|
|
116
|
+
}),
|
|
117
|
+
execute: async ({ skill, path }) => {
|
|
118
|
+
if (!allowed.has(skill)) {
|
|
119
|
+
return ok({ status: "skill_not_declared", skill });
|
|
120
|
+
}
|
|
121
|
+
const skillRoot = resolve(deps.skillsDir, skill);
|
|
122
|
+
const target = resolve(skillRoot, path);
|
|
123
|
+
if (target !== skillRoot && !target.startsWith(skillRoot + sep)) {
|
|
124
|
+
return ok({ status: "out_of_scope", skill, path });
|
|
125
|
+
}
|
|
126
|
+
let content;
|
|
127
|
+
try {
|
|
128
|
+
const s = await stat(target);
|
|
129
|
+
if (!s.isFile())
|
|
130
|
+
return ok({ status: "not_found", skill, path });
|
|
131
|
+
if (s.size > MAX_FILE_BYTES) {
|
|
132
|
+
content = (await readFile(target)).subarray(0, MAX_FILE_BYTES).toString("utf8");
|
|
133
|
+
return ok({ status: "truncated", skill, path, content, totalSize: s.size });
|
|
134
|
+
}
|
|
135
|
+
content = await readFile(target, "utf8");
|
|
136
|
+
}
|
|
137
|
+
catch {
|
|
138
|
+
return ok({ status: "not_found", skill, path });
|
|
139
|
+
}
|
|
140
|
+
return ok({ status: "ok", skill, path, content });
|
|
141
|
+
},
|
|
142
|
+
});
|
|
143
|
+
return { skillSearch, skillRead };
|
|
144
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `edit_file` — sandbox-gated workspace edit, confined to the agent's writable
|
|
3
|
+
* working directory. Composes the read seam (fetch current content) with a
|
|
4
|
+
* search/replace and the `WorkspaceMutator` seam (write the result) — same
|
|
5
|
+
* resolution + confinement contract as `write_file`, no path logic of its own
|
|
6
|
+
* (see the harness-workspace-tools spec).
|
|
7
|
+
*
|
|
8
|
+
* Edit semantics: replace `old_string` with `new_string`. `old_string` MUST
|
|
9
|
+
* occur in the file; when `replace_all` is false (default) it MUST occur
|
|
10
|
+
* exactly once. Provenance hashes the post-edit content — recorded by the
|
|
11
|
+
* mutator.
|
|
12
|
+
*/
|
|
13
|
+
import type { WorkspaceFilesystem } from "../../workspace/filesystem.js";
|
|
14
|
+
import type { WorkspaceMutator, WriteFileResult } from "./mutator.js";
|
|
15
|
+
/** Outcome of an `edit_file` call — expected outcomes are data variants, never throws. */
|
|
16
|
+
export type EditFileResult = {
|
|
17
|
+
readonly status: "file_not_found";
|
|
18
|
+
readonly path: string;
|
|
19
|
+
} | {
|
|
20
|
+
readonly status: "not_found";
|
|
21
|
+
readonly path: string;
|
|
22
|
+
} | {
|
|
23
|
+
readonly status: "not_unique";
|
|
24
|
+
readonly path: string;
|
|
25
|
+
readonly occurrences: number;
|
|
26
|
+
} | Exclude<WriteFileResult, {
|
|
27
|
+
status: "ok";
|
|
28
|
+
}> | {
|
|
29
|
+
readonly status: "ok";
|
|
30
|
+
readonly path: string;
|
|
31
|
+
readonly replacements: number;
|
|
32
|
+
readonly bytesWritten: number;
|
|
33
|
+
};
|
|
34
|
+
export interface EditFileDeps {
|
|
35
|
+
readonly mutator: WorkspaceMutator;
|
|
36
|
+
/** Read seam used to fetch current file content for search/replace. */
|
|
37
|
+
readonly workspaceFilesystem: WorkspaceFilesystem;
|
|
38
|
+
/** Absolute host working directory — relative read/write paths resolve here. */
|
|
39
|
+
readonly workingDir: string;
|
|
40
|
+
}
|
|
41
|
+
export declare function createEditFileTool(deps: EditFileDeps): import("../define-tool.js").Tool<{
|
|
42
|
+
path: string;
|
|
43
|
+
old_string: string;
|
|
44
|
+
new_string: string;
|
|
45
|
+
replace_all: boolean;
|
|
46
|
+
}, EditFileResult>;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `edit_file` — sandbox-gated workspace edit, confined to the agent's writable
|
|
3
|
+
* working directory. Composes the read seam (fetch current content) with a
|
|
4
|
+
* search/replace and the `WorkspaceMutator` seam (write the result) — same
|
|
5
|
+
* resolution + confinement contract as `write_file`, no path logic of its own
|
|
6
|
+
* (see the harness-workspace-tools spec).
|
|
7
|
+
*
|
|
8
|
+
* Edit semantics: replace `old_string` with `new_string`. `old_string` MUST
|
|
9
|
+
* occur in the file; when `replace_all` is false (default) it MUST occur
|
|
10
|
+
* exactly once. Provenance hashes the post-edit content — recorded by the
|
|
11
|
+
* mutator.
|
|
12
|
+
*/
|
|
13
|
+
import { ok } from "neverthrow";
|
|
14
|
+
import { z } from "zod";
|
|
15
|
+
import { defineTool } from "../define-tool.js";
|
|
16
|
+
import { unwrapOrThrow } from "../../lib/result.js";
|
|
17
|
+
const EditFileInputSchema = z.object({
|
|
18
|
+
path: z
|
|
19
|
+
.string()
|
|
20
|
+
.min(1)
|
|
21
|
+
.describe("File path (relative to your working directory, or absolute " + "'/<analysisId>/...'). Read the file first to get the exact text to replace."),
|
|
22
|
+
old_string: z
|
|
23
|
+
.string()
|
|
24
|
+
.min(1)
|
|
25
|
+
.describe("The exact text to find and replace. Must occur in the file. When " +
|
|
26
|
+
"replace_all=false (default), must occur exactly once — include " +
|
|
27
|
+
"enough surrounding context to make it unique."),
|
|
28
|
+
new_string: z.string().describe("The replacement text."),
|
|
29
|
+
replace_all: z
|
|
30
|
+
.boolean()
|
|
31
|
+
.optional()
|
|
32
|
+
.default(false)
|
|
33
|
+
.describe("If true, replace every occurrence. If false (default), old_string " + "must occur exactly once or the edit returns a `not_unique` data variant."),
|
|
34
|
+
});
|
|
35
|
+
function replaceString(content, oldString, newString, replaceAll) {
|
|
36
|
+
if (!content.includes(oldString))
|
|
37
|
+
return { kind: "not_found" };
|
|
38
|
+
if (replaceAll) {
|
|
39
|
+
const parts = content.split(oldString);
|
|
40
|
+
return { kind: "ok", content: parts.join(newString), replacements: parts.length - 1 };
|
|
41
|
+
}
|
|
42
|
+
const first = content.indexOf(oldString);
|
|
43
|
+
const last = content.lastIndexOf(oldString);
|
|
44
|
+
if (first !== last) {
|
|
45
|
+
let count = 0;
|
|
46
|
+
let idx = -1;
|
|
47
|
+
while ((idx = content.indexOf(oldString, idx + 1)) !== -1)
|
|
48
|
+
count++;
|
|
49
|
+
return { kind: "not_unique", count };
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
kind: "ok",
|
|
53
|
+
content: content.slice(0, first) + newString + content.slice(first + oldString.length),
|
|
54
|
+
replacements: 1,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
export function createEditFileTool(deps) {
|
|
58
|
+
return defineTool({
|
|
59
|
+
id: "edit_file",
|
|
60
|
+
// Body-only `awaitExec`-recv → runs unwrapped in the workflow body (see the harness-tools spec).
|
|
61
|
+
executionMode: "workflow",
|
|
62
|
+
description: "Edit a file in your working directory by replacing specific text. " +
|
|
63
|
+
"Read the file first to get the exact text. When replace_all is false " +
|
|
64
|
+
"(default), old_string must occur exactly once. Returns `out_of_prefix` " +
|
|
65
|
+
"/ `out_of_scope` / `file_not_found` / `not_found` / `not_unique` data " +
|
|
66
|
+
"variants — never throws on expected outcomes.",
|
|
67
|
+
inputSchema: EditFileInputSchema,
|
|
68
|
+
execute: async ({ path, old_string, new_string, replace_all }, ctx) => {
|
|
69
|
+
const read = unwrapOrThrow(await deps.workspaceFilesystem.readFile({
|
|
70
|
+
session: ctx.session,
|
|
71
|
+
path,
|
|
72
|
+
workingDir: deps.workingDir,
|
|
73
|
+
}));
|
|
74
|
+
if (read.kind === "not_found")
|
|
75
|
+
return ok({ status: "file_not_found", path });
|
|
76
|
+
if (read.kind === "out_of_scope")
|
|
77
|
+
return ok({ status: "out_of_scope", path });
|
|
78
|
+
const replaced = replaceString(read.content.toString("utf8"), old_string, new_string, replace_all);
|
|
79
|
+
if (replaced.kind === "not_found")
|
|
80
|
+
return ok({ status: "not_found", path });
|
|
81
|
+
if (replaced.kind === "not_unique") {
|
|
82
|
+
return ok({ status: "not_unique", path, occurrences: replaced.count });
|
|
83
|
+
}
|
|
84
|
+
const result = await deps.mutator.writeFile({
|
|
85
|
+
path,
|
|
86
|
+
content: replaced.content,
|
|
87
|
+
toolName: "edit_file",
|
|
88
|
+
emit: ctx.emit,
|
|
89
|
+
});
|
|
90
|
+
if (result.status !== "ok")
|
|
91
|
+
return ok(result);
|
|
92
|
+
return ok({
|
|
93
|
+
status: "ok",
|
|
94
|
+
path: result.path,
|
|
95
|
+
replacements: replaced.replacements,
|
|
96
|
+
bytesWritten: result.bytesWritten,
|
|
97
|
+
});
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `execute_command` — the single chokepoint through which sandbox commands
|
|
3
|
+
* run.
|
|
4
|
+
*
|
|
5
|
+
* Dependency-bearing factory (see the harness-durable-runtime spec): captures a `SandboxClient`, the
|
|
6
|
+
* live `SandboxRef` for the step, and the per-call execId minter. No other
|
|
7
|
+
* tool, agent, or workflow step is permitted to POST to sandbox-server's
|
|
8
|
+
* `/exec` directly — `SandboxClient` is intentionally injected only here so
|
|
9
|
+
* the durability / idempotency / liveness story `harness-sandbox-exec`
|
|
10
|
+
* owns holds uniformly across all sandbox command execution.
|
|
11
|
+
*
|
|
12
|
+
* `execId` is derived as `${workflowId}:${stepId}:${functionId}` so replays
|
|
13
|
+
* land on the cached DBOS step output rather than re-submitting; the same
|
|
14
|
+
* `execId` is the step name `submitExec` uses (`sandbox.submit-exec.${execId}`).
|
|
15
|
+
*
|
|
16
|
+
* Provenance for files written *inside* the sandbox by the executed command
|
|
17
|
+
* is NOT recorded here — sandbox-server emits provenance frames (see
|
|
18
|
+
* `sandbox-provenance-tracking`), and artifact registration reconciles them.
|
|
19
|
+
* The harness-side mutate tools (`write_file`, `edit_file`) hash and record
|
|
20
|
+
* the writes *they* perform, but `execute_command`'s opaque commands do not.
|
|
21
|
+
*/
|
|
22
|
+
import type { SandboxClient } from "../../sandbox/client.js";
|
|
23
|
+
import type { SandboxRef } from "../../sandbox/types.js";
|
|
24
|
+
import type { ProvenanceCollector } from "../../provenance/collector.js";
|
|
25
|
+
export interface ExecuteCommandDeps {
|
|
26
|
+
readonly sandboxClient: SandboxClient;
|
|
27
|
+
/** Live sandbox handle for the step. Created once per step at composition root. */
|
|
28
|
+
readonly sandbox: SandboxRef;
|
|
29
|
+
/** Stable across replay. The workflow's DBOS workflow id. */
|
|
30
|
+
readonly workflowId: string;
|
|
31
|
+
/** Stable across replay. The sandbox step's identifier within the workflow. */
|
|
32
|
+
readonly stepId: string;
|
|
33
|
+
/**
|
|
34
|
+
* Mints a stable per-call function id. The composition root closes over a
|
|
35
|
+
* monotonic counter; the agent loop's tool-call order is replay-deterministic
|
|
36
|
+
* (the LLM call wrapping it is a cached DBOS step), so the counter reaches
|
|
37
|
+
* the same value at each call site on replay.
|
|
38
|
+
*/
|
|
39
|
+
readonly nextFunctionId: () => string;
|
|
40
|
+
/** Absolute unix-ms deadline for `awaitExec`. Typically derived from `step.timeout`. */
|
|
41
|
+
readonly deadlineMs: () => number;
|
|
42
|
+
/**
|
|
43
|
+
* In-sandbox absolute path of the agent's working directory (e.g.
|
|
44
|
+
* `/{resourceId}/runs/{runId}/{stepId}`). Used as the default `cwd` so a
|
|
45
|
+
* command's relative paths match `write_file`/`read_file` relative paths,
|
|
46
|
+
* and as the base a supplied relative `cwd` resolves against (see the harness-workspace-tools spec).
|
|
47
|
+
*/
|
|
48
|
+
readonly defaultCwd: string;
|
|
49
|
+
/** Tag the active-sandbox row with the in-flight execId for the liveness watchdog. */
|
|
50
|
+
readonly markExecActive?: (execId: string) => Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Step-scoped lineage collector. Each exec's `ExecResult.provenance`
|
|
53
|
+
* frame is fed here (reads → inputs, writes → outputs) so post-step
|
|
54
|
+
* registration carries real input/script edges. Omit to skip capture.
|
|
55
|
+
*/
|
|
56
|
+
readonly lineageCollector?: ProvenanceCollector;
|
|
57
|
+
/** Analysis resource mount root (`/{resourceId}`) — strips frame paths to relative. */
|
|
58
|
+
readonly mountRoot?: string;
|
|
59
|
+
}
|
|
60
|
+
export declare function createExecuteCommandTool(deps: ExecuteCommandDeps): import("../define-tool.js").Tool<{
|
|
61
|
+
command: string[];
|
|
62
|
+
cwd?: string | undefined;
|
|
63
|
+
env?: Record<string, string> | undefined;
|
|
64
|
+
timeoutSeconds?: number | undefined;
|
|
65
|
+
}, {
|
|
66
|
+
execId: string;
|
|
67
|
+
exitCode: number | null;
|
|
68
|
+
stdout: string;
|
|
69
|
+
stderr: string;
|
|
70
|
+
stdoutTruncated: boolean;
|
|
71
|
+
stderrTruncated: boolean;
|
|
72
|
+
stdoutTotalLength: number;
|
|
73
|
+
stderrTotalLength: number;
|
|
74
|
+
durationMs: number | null;
|
|
75
|
+
timedOut: boolean;
|
|
76
|
+
syntheticFailure?: {
|
|
77
|
+
readonly reason: string;
|
|
78
|
+
};
|
|
79
|
+
status: "ok";
|
|
80
|
+
}>;
|