@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,203 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-step artifact metadata generation — describes a step's output files
|
|
3
|
+
* via a focused `runAgent` tool-call loop on the harness `ChatProvider`.
|
|
4
|
+
*
|
|
5
|
+
* Design (mirrors `generate-plan.ts`): the describer agent communicates
|
|
6
|
+
* exclusively through one tool, `submit_file_metadata`, whose `execute`
|
|
7
|
+
* validates every entry's `path` against the known artifact set. Unknown
|
|
8
|
+
* paths (hallucinated files) are rejected with feedback; uncovered files are
|
|
9
|
+
* reported as `remaining` so the model resubmits. Descriptions are matched
|
|
10
|
+
* to files BY PATH — there is no positional array-index alignment, so a
|
|
11
|
+
* dropped, reordered, or extra entry can never attach a description to the
|
|
12
|
+
* wrong file.
|
|
13
|
+
*
|
|
14
|
+
* Lossless contract: every input artifact appears in the result exactly
|
|
15
|
+
* once. A file the model never describes (loop budget exhausted, persistent
|
|
16
|
+
* tool errors, model refusal) gets a deterministic fallback description
|
|
17
|
+
* synthesised from its path + inferred type + size. Fallbacks are logged —
|
|
18
|
+
* never silently dropped, never silently chunked out.
|
|
19
|
+
*
|
|
20
|
+
* `Session` is taken explicitly (see the harness-durable-runtime spec) — billing is a compile-time
|
|
21
|
+
* obligation on every provider call.
|
|
22
|
+
*/
|
|
23
|
+
import { ok } from "neverthrow";
|
|
24
|
+
import { forSubAgent } from "../auth/types.js";
|
|
25
|
+
import { runAgent } from "../loop/run-agent.js";
|
|
26
|
+
import { passthroughStep } from "../loop/run-step.js";
|
|
27
|
+
import { defineTool } from "../tools/define-tool.js";
|
|
28
|
+
import { createReadFileTool } from "../tools/workspace/read-file.js";
|
|
29
|
+
import { inferArtifactType } from "../schemas/artifact-manifest.js";
|
|
30
|
+
import { SubmitFileMetadataInputSchema } from "../schemas/file-metadata.js";
|
|
31
|
+
/** Sub-agent identity for the describer loop — provenance only. */
|
|
32
|
+
const DESCRIBER_AGENT_ID = "file-metadata-describer";
|
|
33
|
+
/**
|
|
34
|
+
* Iteration budget: one full submission + a few correction rounds. The
|
|
35
|
+
* fallback backstop means an exhausted budget degrades gracefully rather
|
|
36
|
+
* than dropping files, so the cap stays small.
|
|
37
|
+
*/
|
|
38
|
+
const DEFAULT_MAX_ITERATIONS = 8;
|
|
39
|
+
const SYSTEM_PROMPT = `You are a deterministic metadata describer for bioinformatics output files.
|
|
40
|
+
|
|
41
|
+
You describe files by calling the submit_file_metadata tool. For each file provide:
|
|
42
|
+
- path — copy the file's path EXACTLY from the list you are given.
|
|
43
|
+
- description — one sentence describing what the file contains.
|
|
44
|
+
- dataType — semantic type (e.g. "count matrix", "QC report").
|
|
45
|
+
- format — file format (e.g. "csv", "tsv", "h5ad", "png").
|
|
46
|
+
- rows, cols — optional integers when known.
|
|
47
|
+
- tags, warnings — optional string arrays.
|
|
48
|
+
|
|
49
|
+
Rules:
|
|
50
|
+
- Only describe files from the provided list. Never invent a path.
|
|
51
|
+
- Cover every file. You may submit in one call or several.
|
|
52
|
+
- The tool returns {accepted, unknownPaths, remaining}. If accepted is true,
|
|
53
|
+
every file is covered — STOP, do not call the tool again. Otherwise remove
|
|
54
|
+
any unknownPaths (they are not real files) and describe the remaining files.
|
|
55
|
+
- Prefer grounding descriptions in fact. Use the read_file tool to inspect a
|
|
56
|
+
file's actual contents (e.g. a CSV header or a report's body) when the path
|
|
57
|
+
alone is not enough to describe it accurately.
|
|
58
|
+
- Do not guess file contents you cannot infer; a terse, honest description is
|
|
59
|
+
better than a confident wrong one.`;
|
|
60
|
+
function buildPrompt(artifacts) {
|
|
61
|
+
const list = artifacts.map((a) => `- ${a.displayPath}`).join("\n");
|
|
62
|
+
return `Describe the following output files by calling submit_file_metadata. Copy each \`path\` EXACTLY from this list. Read a file with read_file when its path alone is not enough to describe it accurately:\n\n${list}`;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Drop a trailing partial assistant `tool_use` round from a loop transcript:
|
|
66
|
+
* it has no matching `tool_result`, so prefixing it onto a fresh loop turn
|
|
67
|
+
* would be an invalid message sequence.
|
|
68
|
+
*/
|
|
69
|
+
function sanitizeTranscript(messages) {
|
|
70
|
+
const out = [...messages];
|
|
71
|
+
while (out.length > 0) {
|
|
72
|
+
const last = out[out.length - 1];
|
|
73
|
+
const blocks = Array.isArray(last.content) ? last.content : [];
|
|
74
|
+
const hasOpenToolUse = last.role === "assistant" && blocks.some((b) => b.type === "tool-call");
|
|
75
|
+
if (hasOpenToolUse) {
|
|
76
|
+
out.pop();
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
return out;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* The single describer tool. Accumulates accepted descriptions into
|
|
85
|
+
* `holder` keyed by path; rejects paths outside `knownPaths`. Returns the
|
|
86
|
+
* coverage state the model uses to decide whether to continue.
|
|
87
|
+
*/
|
|
88
|
+
function buildSubmitTool(holder, knownPaths) {
|
|
89
|
+
return defineTool({
|
|
90
|
+
id: "submit_file_metadata",
|
|
91
|
+
description: "Submit metadata for output files. Each entry's `path` MUST exactly " +
|
|
92
|
+
"match one of the listed files. Returns {accepted, unknownPaths, " +
|
|
93
|
+
"remaining}: accepted=true means every file now has metadata — STOP. " +
|
|
94
|
+
"Otherwise drop the unknownPaths and describe the remaining files.",
|
|
95
|
+
inputSchema: SubmitFileMetadataInputSchema,
|
|
96
|
+
execute: async (input) => {
|
|
97
|
+
const unknownPaths = [];
|
|
98
|
+
for (const entry of input.files) {
|
|
99
|
+
if (!knownPaths.has(entry.path)) {
|
|
100
|
+
unknownPaths.push(entry.path);
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
holder.set(entry.path, entry);
|
|
104
|
+
}
|
|
105
|
+
const remaining = [...knownPaths].filter((p) => !holder.has(p));
|
|
106
|
+
return ok({
|
|
107
|
+
accepted: unknownPaths.length === 0 && remaining.length === 0,
|
|
108
|
+
unknownPaths,
|
|
109
|
+
remaining,
|
|
110
|
+
});
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
function buildEntry(artifact, desc, extra) {
|
|
115
|
+
const metadata = {
|
|
116
|
+
...extra,
|
|
117
|
+
dataType: desc.dataType,
|
|
118
|
+
format: desc.format,
|
|
119
|
+
};
|
|
120
|
+
if (desc.rows != null)
|
|
121
|
+
metadata.rows = desc.rows;
|
|
122
|
+
if (desc.cols != null)
|
|
123
|
+
metadata.cols = desc.cols;
|
|
124
|
+
if (desc.tags)
|
|
125
|
+
metadata.tags = desc.tags;
|
|
126
|
+
if (desc.warnings)
|
|
127
|
+
metadata.warnings = desc.warnings;
|
|
128
|
+
return { dbPath: artifact.dbPath, description: desc.description, metadata };
|
|
129
|
+
}
|
|
130
|
+
function fileExtension(displayPath) {
|
|
131
|
+
const base = displayPath.slice(displayPath.lastIndexOf("/") + 1);
|
|
132
|
+
const dot = base.lastIndexOf(".");
|
|
133
|
+
return dot > 0 ? base.slice(dot + 1).toLowerCase() : "unknown";
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Deterministic fallback for a file the model never described. No LLM call —
|
|
137
|
+
* composed from facts already on disk so search still finds the file.
|
|
138
|
+
*/
|
|
139
|
+
function fallbackEntry(artifact, extra) {
|
|
140
|
+
// Leading slash so `inferArtifactType` matches the `/figures/` etc. segment
|
|
141
|
+
// on a working-directory-relative display path.
|
|
142
|
+
const fileType = inferArtifactType(`/${artifact.displayPath}`);
|
|
143
|
+
const format = fileExtension(artifact.displayPath);
|
|
144
|
+
const sizePart = artifact.sizeBytes != null ? `, ${artifact.sizeBytes} bytes` : "";
|
|
145
|
+
const description = `${artifact.displayPath} — ${fileType} file (${format}${sizePart}); automated description unavailable.`;
|
|
146
|
+
return {
|
|
147
|
+
dbPath: artifact.dbPath,
|
|
148
|
+
description,
|
|
149
|
+
metadata: { ...extra, dataType: fileType, format },
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Describe a step's known artifacts via a tool-call loop. Non-fatal: a loop
|
|
154
|
+
* failure or partial coverage degrades to deterministic fallbacks, so the
|
|
155
|
+
* result always carries exactly one entry per input artifact.
|
|
156
|
+
*/
|
|
157
|
+
export async function generateFileMetadata(opts) {
|
|
158
|
+
if (opts.artifacts.length === 0) {
|
|
159
|
+
return { indexed: 0, entries: [] };
|
|
160
|
+
}
|
|
161
|
+
const knownPaths = new Set(opts.artifacts.map((a) => a.displayPath));
|
|
162
|
+
const holder = new Map();
|
|
163
|
+
const tools = [buildSubmitTool(holder, knownPaths)];
|
|
164
|
+
if (opts.workspaceFs) {
|
|
165
|
+
tools.push(createReadFileTool(opts.workspaceFs, opts.workingDir));
|
|
166
|
+
}
|
|
167
|
+
const describer = {
|
|
168
|
+
id: DESCRIBER_AGENT_ID,
|
|
169
|
+
systemPrompt: SYSTEM_PROMPT,
|
|
170
|
+
model: opts.modelId,
|
|
171
|
+
tools,
|
|
172
|
+
maxIterations: opts.maxIterations ?? DEFAULT_MAX_ITERATIONS,
|
|
173
|
+
};
|
|
174
|
+
const signal = opts.signal ?? new AbortController().signal;
|
|
175
|
+
const transcript = opts.messages ? sanitizeTranscript(opts.messages) : [];
|
|
176
|
+
try {
|
|
177
|
+
await runAgent(describer, [...transcript, { role: "user", content: buildPrompt(opts.artifacts) }], forSubAgent(opts.session, DESCRIBER_AGENT_ID), {
|
|
178
|
+
provider: opts.provider,
|
|
179
|
+
signal,
|
|
180
|
+
emit: () => { },
|
|
181
|
+
runStep: passthroughStep,
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
catch (err) {
|
|
185
|
+
console.warn(`[artifact-metadata] describer loop failed (resource=${opts.resourceId}); using fallbacks: ${err instanceof Error ? err.message : err}`);
|
|
186
|
+
}
|
|
187
|
+
const entries = [];
|
|
188
|
+
const fallbackPaths = [];
|
|
189
|
+
for (const artifact of opts.artifacts) {
|
|
190
|
+
const desc = holder.get(artifact.displayPath);
|
|
191
|
+
if (desc) {
|
|
192
|
+
entries.push(buildEntry(artifact, desc, opts.extraMetadata));
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
entries.push(fallbackEntry(artifact, opts.extraMetadata));
|
|
196
|
+
fallbackPaths.push(artifact.displayPath);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
if (fallbackPaths.length > 0) {
|
|
200
|
+
console.warn(`[artifact-metadata] ${fallbackPaths.length}/${opts.artifacts.length} file(s) used a deterministic fallback description (resource=${opts.resourceId}): ${fallbackPaths.join(", ")}`);
|
|
201
|
+
}
|
|
202
|
+
return { indexed: holder.size, entries };
|
|
203
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Artifact record — the shape post-step deps and the provenance collector
|
|
3
|
+
* read for each file the step produced (hash + size + tool provenance +
|
|
4
|
+
* write timestamp). Pure data type; lives in its own file because it is
|
|
5
|
+
* shared across `execution/` and `provenance/`.
|
|
6
|
+
*/
|
|
7
|
+
export interface ArtifactRecord {
|
|
8
|
+
path: string;
|
|
9
|
+
hash: string;
|
|
10
|
+
size: number;
|
|
11
|
+
/**
|
|
12
|
+
* The filesystem operation that created this artifact (`write_file`,
|
|
13
|
+
* `edit_file`). Undefined for files discovered by disk scan —
|
|
14
|
+
* their provenance comes from the collector.
|
|
15
|
+
*/
|
|
16
|
+
toolName?: string;
|
|
17
|
+
/** ISO 8601 timestamp captured at write time. */
|
|
18
|
+
timestamp: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Artifact record — the shape post-step deps and the provenance collector
|
|
3
|
+
* read for each file the step produced (hash + size + tool provenance +
|
|
4
|
+
* write timestamp). Pure data type; lives in its own file because it is
|
|
5
|
+
* shared across `execution/` and `provenance/`.
|
|
6
|
+
*/
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Artifact registration — registers a step's artifacts in the local ledger
|
|
3
|
+
* (cortex_artifacts) and with an injected provenance-agnostic
|
|
4
|
+
* `ArtifactRegistry`.
|
|
5
|
+
*
|
|
6
|
+
* The harness owns the local ledger: it builds the `cortex_artifacts` rows, upserts
|
|
7
|
+
* them, then calls `registry.register(...)` for external provenance and writes
|
|
8
|
+
* the returned external ids back onto the ledger rows. Which registry is wired
|
|
9
|
+
* (an external provenance ledger, or a filesystem index) is a composition-root
|
|
10
|
+
* decision — this module never names one.
|
|
11
|
+
*/
|
|
12
|
+
import type { Pool, PoolClient } from "pg";
|
|
13
|
+
import type { AgentSession } from "../auth/types.js";
|
|
14
|
+
import type { ArtifactRegistry, ArtifactRegistrationInput } from "./artifact-registry.js";
|
|
15
|
+
export type { ArtifactRegistrationInput };
|
|
16
|
+
export interface ArtifactRegistrationResult {
|
|
17
|
+
/** Number of artifacts written to the local ledger. */
|
|
18
|
+
localCount: number;
|
|
19
|
+
/** Number of artifacts registered externally and given external IDs. */
|
|
20
|
+
externalRegistered: number;
|
|
21
|
+
/** Number of external registration failures. */
|
|
22
|
+
externalFailed: number;
|
|
23
|
+
/** Per-artifact failure details from the registry (if any). */
|
|
24
|
+
failureDetails: Array<{
|
|
25
|
+
path: string;
|
|
26
|
+
error: string;
|
|
27
|
+
}>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Register step-level artifacts (paths under `runs/{runId}/{stepId}/`).
|
|
31
|
+
*
|
|
32
|
+
* Builds the `cortex_artifacts` rows from the manifest, upserts them, then
|
|
33
|
+
* delegates external provenance registration to the injected `ArtifactRegistry`
|
|
34
|
+
* and applies any returned external ids back onto the local rows.
|
|
35
|
+
*/
|
|
36
|
+
export declare function registerStepArtifacts(db: Pool | PoolClient, registry: ArtifactRegistry, input: ArtifactRegistrationInput, session: AgentSession): Promise<ArtifactRegistrationResult>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Artifact registration — registers a step's artifacts in the local ledger
|
|
3
|
+
* (cortex_artifacts) and with an injected provenance-agnostic
|
|
4
|
+
* `ArtifactRegistry`.
|
|
5
|
+
*
|
|
6
|
+
* The harness owns the local ledger: it builds the `cortex_artifacts` rows, upserts
|
|
7
|
+
* them, then calls `registry.register(...)` for external provenance and writes
|
|
8
|
+
* the returned external ids back onto the ledger rows. Which registry is wired
|
|
9
|
+
* (an external provenance ledger, or a filesystem index) is a composition-root
|
|
10
|
+
* decision — this module never names one.
|
|
11
|
+
*/
|
|
12
|
+
import { upsertArtifacts, updateArtifactId } from "../state/index.js";
|
|
13
|
+
// ── Registration ─────────────────────────────────────────────────────
|
|
14
|
+
/**
|
|
15
|
+
* Register step-level artifacts (paths under `runs/{runId}/{stepId}/`).
|
|
16
|
+
*
|
|
17
|
+
* Builds the `cortex_artifacts` rows from the manifest, upserts them, then
|
|
18
|
+
* delegates external provenance registration to the injected `ArtifactRegistry`
|
|
19
|
+
* and applies any returned external ids back onto the local rows.
|
|
20
|
+
*/
|
|
21
|
+
export async function registerStepArtifacts(db, registry, input, session) {
|
|
22
|
+
const { resourceId, runId, stepId, artifacts } = input;
|
|
23
|
+
if (artifacts.length === 0) {
|
|
24
|
+
return { localCount: 0, externalRegistered: 0, externalFailed: 0, failureDetails: [] };
|
|
25
|
+
}
|
|
26
|
+
const dbPathPrefix = `runs/${runId}/${stepId}/`;
|
|
27
|
+
const emptyHash = "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";
|
|
28
|
+
const localEntries = artifacts.map((a) => {
|
|
29
|
+
if (a.size === 0 || a.hash === emptyHash) {
|
|
30
|
+
console.warn(`[artifact-registration] empty artifact: path=${dbPathPrefix}${a.path} hash=${a.hash?.slice(0, 16)} size=${a.size} runId=${runId} stepId=${stepId}`);
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
resourceId,
|
|
34
|
+
path: `${dbPathPrefix}${a.path}`,
|
|
35
|
+
hash: a.hash ?? "",
|
|
36
|
+
size: a.size,
|
|
37
|
+
role: "step_output",
|
|
38
|
+
sourceStep: stepId,
|
|
39
|
+
sourceRun: runId,
|
|
40
|
+
fileType: a.type,
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
await upsertArtifacts(db, localEntries);
|
|
44
|
+
const localPaths = new Set(localEntries.map((e) => e.path));
|
|
45
|
+
const result = await registry.register(input, session);
|
|
46
|
+
let externalRegistered = 0;
|
|
47
|
+
for (const reg of result.registered) {
|
|
48
|
+
// Skip files the registry also returned that we didn't upsert locally
|
|
49
|
+
// (e.g., data inputs that were already born-synced).
|
|
50
|
+
if (!localPaths.has(reg.path))
|
|
51
|
+
continue;
|
|
52
|
+
await updateArtifactId(db, resourceId, reg.path, reg.externalId);
|
|
53
|
+
externalRegistered++;
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
localCount: localEntries.length,
|
|
57
|
+
externalRegistered,
|
|
58
|
+
externalFailed: result.failedCount,
|
|
59
|
+
failureDetails: result.failed,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `ArtifactRegistry` — provenance-agnostic seam for external artifact
|
|
3
|
+
* registration.
|
|
4
|
+
*
|
|
5
|
+
* The harness's `registerStepArtifacts` owns the local ledger (cortex_artifacts) and
|
|
6
|
+
* delegates external provenance registration to an injected `ArtifactRegistry`.
|
|
7
|
+
* The seam input is the high-level step input; the result is a flat per-path
|
|
8
|
+
* outcome. The seam deliberately mentions no host-managed vocabulary — a
|
|
9
|
+
* trivial no-op adapter satisfies it just as well as a managed adapter.
|
|
10
|
+
*
|
|
11
|
+
* Adapters:
|
|
12
|
+
* - a managed provenance adapter (harness/compose/) — builds the structured
|
|
13
|
+
* payload and calls the host provenance ledger.
|
|
14
|
+
* - `createNoopArtifactRegistry` (the harness, this dir) — registers nothing
|
|
15
|
+
* externally; the local `cortex_artifacts` ledger is the only record.
|
|
16
|
+
*/
|
|
17
|
+
import type { ArtifactManifestEntry } from "../schemas/artifact-manifest.js";
|
|
18
|
+
import type { ProvenanceCollector } from "../provenance/collector.js";
|
|
19
|
+
import type { AgentSession } from "../auth/types.js";
|
|
20
|
+
/** High-level input for registering one step's artifacts. */
|
|
21
|
+
export interface ArtifactRegistrationInput {
|
|
22
|
+
/** Analysis resource ID. */
|
|
23
|
+
resourceId: string;
|
|
24
|
+
/** Workflow run ID. */
|
|
25
|
+
runId: string;
|
|
26
|
+
/** Step ID that produced the artifacts. */
|
|
27
|
+
stepId: string;
|
|
28
|
+
/** Artifact manifest from the sandbox runner. */
|
|
29
|
+
artifacts: ArtifactManifestEntry[];
|
|
30
|
+
/** Provenance collector with tracked inputs/outputs. */
|
|
31
|
+
collector: ProvenanceCollector;
|
|
32
|
+
}
|
|
33
|
+
/** Step coordinates for a per-step artifact sync. */
|
|
34
|
+
export interface ArtifactSyncInput {
|
|
35
|
+
/** Analysis resource ID. */
|
|
36
|
+
resourceId: string;
|
|
37
|
+
/** Workflow run ID. */
|
|
38
|
+
runId: string;
|
|
39
|
+
/** Step ID whose registered artifacts are synced. */
|
|
40
|
+
stepId: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Outcome of external registration. Flat per-path results — no provenance-model
|
|
44
|
+
* vocabulary leaks across the seam.
|
|
45
|
+
*/
|
|
46
|
+
export interface ExternalRegistrationResult {
|
|
47
|
+
/**
|
|
48
|
+
* Artifacts the external registry accepted, with the external identity to
|
|
49
|
+
* write back onto the local ledger row. `path` is the analysis-scoped path
|
|
50
|
+
* (`runs/{runId}/{stepId}/...`) matching the local ledger row.
|
|
51
|
+
*/
|
|
52
|
+
registered: Array<{
|
|
53
|
+
path: string;
|
|
54
|
+
externalId: string;
|
|
55
|
+
}>;
|
|
56
|
+
/** Per-path rejections (persistent — transient errors are retried inside the adapter). */
|
|
57
|
+
failed: Array<{
|
|
58
|
+
path: string;
|
|
59
|
+
error: string;
|
|
60
|
+
}>;
|
|
61
|
+
/**
|
|
62
|
+
* Number of rows the external registry rejected. Usually `failed.length`, but
|
|
63
|
+
* an adapter may report a higher count when a single transport error rolls
|
|
64
|
+
* back a whole batch (`failed` then carries one summary entry).
|
|
65
|
+
*/
|
|
66
|
+
failedCount: number;
|
|
67
|
+
}
|
|
68
|
+
export interface ArtifactRegistry {
|
|
69
|
+
/**
|
|
70
|
+
* Register one step's artifacts with the external provenance system.
|
|
71
|
+
* Implementations MUST NOT touch the local `cortex_artifacts` ledger — that
|
|
72
|
+
* is the harness's responsibility, applied around this call. The `session` carries
|
|
73
|
+
* the run credential an adapter needs to address the external system.
|
|
74
|
+
*/
|
|
75
|
+
register(input: ArtifactRegistrationInput, session: AgentSession): Promise<ExternalRegistrationResult>;
|
|
76
|
+
/**
|
|
77
|
+
* Push a step's registered artifacts to permanent storage. A no-op when the
|
|
78
|
+
* adapter's bytes already live locally; the managed adapter uploads them.
|
|
79
|
+
* Throws on a persistent failure so the caller's fail-fast boundary fires.
|
|
80
|
+
*/
|
|
81
|
+
sync(input: ArtifactSyncInput, session: AgentSession): Promise<void>;
|
|
82
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `ArtifactRegistry` — provenance-agnostic seam for external artifact
|
|
3
|
+
* registration.
|
|
4
|
+
*
|
|
5
|
+
* The harness's `registerStepArtifacts` owns the local ledger (cortex_artifacts) and
|
|
6
|
+
* delegates external provenance registration to an injected `ArtifactRegistry`.
|
|
7
|
+
* The seam input is the high-level step input; the result is a flat per-path
|
|
8
|
+
* outcome. The seam deliberately mentions no host-managed vocabulary — a
|
|
9
|
+
* trivial no-op adapter satisfies it just as well as a managed adapter.
|
|
10
|
+
*
|
|
11
|
+
* Adapters:
|
|
12
|
+
* - a managed provenance adapter (harness/compose/) — builds the structured
|
|
13
|
+
* payload and calls the host provenance ledger.
|
|
14
|
+
* - `createNoopArtifactRegistry` (the harness, this dir) — registers nothing
|
|
15
|
+
* externally; the local `cortex_artifacts` ledger is the only record.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DBOS realization of the `RunLauncher` seam — the single production adapter,
|
|
3
|
+
* shared by every embedder. Host-neutral: it references only DBOS, which the harness
|
|
4
|
+
* already depends on, so it ships in the harness.
|
|
5
|
+
*/
|
|
6
|
+
import type { RunLauncher } from "./run-launcher.js";
|
|
7
|
+
export declare function createDbosRunLauncher(): RunLauncher;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DBOS realization of the `RunLauncher` seam — the single production adapter,
|
|
3
|
+
* shared by every embedder. Host-neutral: it references only DBOS, which the harness
|
|
4
|
+
* already depends on, so it ships in the harness.
|
|
5
|
+
*/
|
|
6
|
+
import { DBOS, Error as DBOSErrors } from "@dbos-inc/dbos-sdk";
|
|
7
|
+
export function createDbosRunLauncher() {
|
|
8
|
+
return {
|
|
9
|
+
async launch(workflow, opts, input) {
|
|
10
|
+
await DBOS.startWorkflow(workflow, { workflowID: opts.workflowId })(input);
|
|
11
|
+
},
|
|
12
|
+
async launchAndAwait(workflow, opts, input, runOpts) {
|
|
13
|
+
const handle = await DBOS.startWorkflow(workflow, {
|
|
14
|
+
workflowID: opts.workflowId,
|
|
15
|
+
})(input);
|
|
16
|
+
// Registered only after the workflow row is persisted — an abort racing a
|
|
17
|
+
// not-yet-started workflow would `cancelWorkflow` a missing row (no-op)
|
|
18
|
+
// and, being `{ once: true }`, never fire again, blocking `getResult`.
|
|
19
|
+
const cancel = () => {
|
|
20
|
+
void DBOS.cancelWorkflow(opts.workflowId);
|
|
21
|
+
};
|
|
22
|
+
if (runOpts.signal.aborted)
|
|
23
|
+
cancel();
|
|
24
|
+
else
|
|
25
|
+
runOpts.signal.addEventListener("abort", cancel, { once: true });
|
|
26
|
+
try {
|
|
27
|
+
const result = await handle.getResult();
|
|
28
|
+
return { status: "completed", result };
|
|
29
|
+
}
|
|
30
|
+
catch (e) {
|
|
31
|
+
if (e instanceof DBOSErrors.DBOSWorkflowCancelledError) {
|
|
32
|
+
return { status: "cancelled" };
|
|
33
|
+
}
|
|
34
|
+
throw e;
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ephemeral runner — read-only sandbox execution for ad-hoc data
|
|
3
|
+
* exploration, run as a turn-scoped DBOS workflow.
|
|
4
|
+
*
|
|
5
|
+
* The `run_ephemeral` conversation tool authorizes the run at the async
|
|
6
|
+
* edge, starts this workflow, and awaits its result inline within the chat
|
|
7
|
+
* turn. The workflow is "bare": it has no run-event stream, so `emit` is a
|
|
8
|
+
* no-op and live sandbox progress events are dropped. It is never recovered
|
|
9
|
+
* — chat disconnect cancels it (`DBOS.cancelWorkflow`), and a boot-time sweep
|
|
10
|
+
* cancels any `ephemeral:`-prefixed PENDING workflow a dead pod left behind.
|
|
11
|
+
*
|
|
12
|
+
* Lifecycle: create sandbox → build the ephemeral-executor with synthetic
|
|
13
|
+
* step coords (`runId = stepId = "ephemeral"`, the literal the host-managed
|
|
14
|
+
* billing rules key on) → drive `runAgent` over the executor with `durableStep` →
|
|
15
|
+
* final text + step count → teardown the sandbox in `finally` on every
|
|
16
|
+
* terminal path.
|
|
17
|
+
*
|
|
18
|
+
* Read-only is enforced, not aspirational: the executor agent is built with
|
|
19
|
+
* `readOnly: true` (no `write_file`/`edit_file` tools) and its sandbox is
|
|
20
|
+
* provisioned with no read-write mount — only the read-only analysis tree.
|
|
21
|
+
* Container-local `/tmp` stays writable (torn down with the sandbox); nothing
|
|
22
|
+
* persists. The prompt's "you physically cannot write files" is now true.
|
|
23
|
+
*/
|
|
24
|
+
import type { Pool } from "pg";
|
|
25
|
+
import type { RunSession } from "../auth/types.js";
|
|
26
|
+
import type { ResourcePolicy } from "../config/resource-limits.js";
|
|
27
|
+
import type { ChatProvider, EmbeddingProvider } from "../providers/types.js";
|
|
28
|
+
import type { SandboxClient } from "../sandbox/client.js";
|
|
29
|
+
import type { BioToolKeys } from "../tools/bio/keys.js";
|
|
30
|
+
import type { WorkspaceFilesystem } from "../workspace/filesystem.js";
|
|
31
|
+
import type { ResolveWorkspaceRoot } from "../workspace/paths.js";
|
|
32
|
+
/** Sub-agent identity — appended to `callPath`, set as `agentId`. */
|
|
33
|
+
export declare const EPHEMERAL_AGENT_ID = "ephemeral-executor";
|
|
34
|
+
/** Workflow-id prefix — the boot-time never-recover sweep matches on it. */
|
|
35
|
+
export declare const EPHEMERAL_WORKFLOW_PREFIX: "ephemeral:";
|
|
36
|
+
/** The body's construction-time deps — closed over at registration. */
|
|
37
|
+
export interface EphemeralDeps {
|
|
38
|
+
readonly provider: ChatProvider;
|
|
39
|
+
readonly pool: Pool;
|
|
40
|
+
readonly sandboxClient: SandboxClient;
|
|
41
|
+
readonly workspaceFs: WorkspaceFilesystem;
|
|
42
|
+
/** Embedding provider for the executor's in-sandbox `workspace_search`. */
|
|
43
|
+
readonly embedding: EmbeddingProvider;
|
|
44
|
+
/** Workspace-root resolution seam (see workspace/paths.ts). */
|
|
45
|
+
readonly resolveWorkspaceRoot: ResolveWorkspaceRoot;
|
|
46
|
+
/** Model id — provenance / metric label; the provider owns the wire model. */
|
|
47
|
+
readonly model: string;
|
|
48
|
+
/** API keys for the bio/chem tools the ephemeral executor may use. */
|
|
49
|
+
readonly bioKeys: BioToolKeys;
|
|
50
|
+
/** Host resource policy — its `ephemeral` spec overrides the default sandbox size. */
|
|
51
|
+
readonly resourcePolicy?: ResourcePolicy;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Workflow input. JSON-serialisable — the authorized `RunSession` carries the
|
|
55
|
+
* run credential; the body reads it and never re-authorizes.
|
|
56
|
+
*/
|
|
57
|
+
export interface EphemeralWorkflowInput {
|
|
58
|
+
readonly runSession: RunSession;
|
|
59
|
+
readonly prompt: string;
|
|
60
|
+
/** Optional cap on the inner agent's tool-call budget. */
|
|
61
|
+
readonly maxIterations?: number;
|
|
62
|
+
/** Optional deadline override for sandbox-server execs (unix ms). */
|
|
63
|
+
readonly deadlineMs?: number;
|
|
64
|
+
}
|
|
65
|
+
export interface EphemeralResult {
|
|
66
|
+
readonly text: string;
|
|
67
|
+
readonly durationMs: number;
|
|
68
|
+
readonly stepsUsed: number;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Register the ephemeral workflow with DBOS. Returns the registered callable
|
|
72
|
+
* so the `run_ephemeral` tool can dispatch via `DBOS.startWorkflow`.
|
|
73
|
+
*/
|
|
74
|
+
export declare function registerEphemeralWorkflow(deps: EphemeralDeps): (input: EphemeralWorkflowInput) => Promise<EphemeralResult>;
|
|
75
|
+
/**
|
|
76
|
+
* Run the ephemeral-executor agent against a fresh read-only sandbox.
|
|
77
|
+
* Throws on sandbox start failure; otherwise returns the agent's final
|
|
78
|
+
* text plus timing. Sandbox teardown fires on every terminal path —
|
|
79
|
+
* success, error, cancel.
|
|
80
|
+
*/
|
|
81
|
+
export declare function runEphemeralBody(input: EphemeralWorkflowInput, deps: EphemeralDeps): Promise<EphemeralResult>;
|