@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,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure translation between the agent-loop / sandbox event stream and the
|
|
3
|
+
* typed per-step parts the frontend renders. No DBOS, no per-run state — just the
|
|
4
|
+
* label mapping, the file-tree delta extraction/fold, and the chat-data-part
|
|
5
|
+
* narrowing the `sandbox-step` workflow body composes into its emitters.
|
|
6
|
+
*/
|
|
7
|
+
import type { ChatDataPart, EmitFn } from "../loop/types.js";
|
|
8
|
+
export declare function activityForTool(name: string, input?: unknown): string;
|
|
9
|
+
/** On-change working-tree delta the sandbox executor posts per exec (paths
|
|
10
|
+
* only; the executor skips directories). */
|
|
11
|
+
export interface SandboxTreeDelta {
|
|
12
|
+
added?: string[];
|
|
13
|
+
modified?: string[];
|
|
14
|
+
removed?: string[];
|
|
15
|
+
}
|
|
16
|
+
/** Extract the tree delta from a `data-sandbox-event` part, or null when the
|
|
17
|
+
* part is some other sandbox event. The wrapper shape is set by
|
|
18
|
+
* `run-exec.ts`: `{ type: "data-sandbox-event", data: { execId, event } }`
|
|
19
|
+
* where `event` is the executor's `eventPayload`. */
|
|
20
|
+
export declare function sandboxTreeDelta(part: {
|
|
21
|
+
type: string;
|
|
22
|
+
data?: unknown;
|
|
23
|
+
}): SandboxTreeDelta | null;
|
|
24
|
+
/** Apply one on-change delta to the per-step cumulative path set. `added`
|
|
25
|
+
* and `modified` add the path; `removed` deletes it. Folding many deltas
|
|
26
|
+
* (one stream per exec, all against the same step working dir) yields the
|
|
27
|
+
* full set of files the step has produced so far. */
|
|
28
|
+
export declare function applyTreeDelta(files: Set<string>, delta: SandboxTreeDelta): void;
|
|
29
|
+
/**
|
|
30
|
+
* Narrow an `EmitFn` payload to `ChatDataPart`. The discriminator is the
|
|
31
|
+
* `data-` prefix on `type`: orchestration events (`iteration`,
|
|
32
|
+
* `tool-started`, `tool-finished`) and `ChatStreamEvent` (`text-delta`,
|
|
33
|
+
* `done`) never start with `data-`.
|
|
34
|
+
*/
|
|
35
|
+
export declare function isChatDataPart(event: Parameters<EmitFn>[0]): event is ChatDataPart;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure translation between the agent-loop / sandbox event stream and the
|
|
3
|
+
* typed per-step parts the frontend renders. No DBOS, no per-run state — just the
|
|
4
|
+
* label mapping, the file-tree delta extraction/fold, and the chat-data-part
|
|
5
|
+
* narrowing the `sandbox-step` workflow body composes into its emitters.
|
|
6
|
+
*/
|
|
7
|
+
/** Friendly live-activity label per sandbox tool id. Falls back to the raw
|
|
8
|
+
* tool name so a newly added tool still reads sensibly. */
|
|
9
|
+
const TOOL_ACTIVITY = {
|
|
10
|
+
execute_command: "Running script",
|
|
11
|
+
write_file: "Writing file",
|
|
12
|
+
edit_file: "Editing file",
|
|
13
|
+
read_file: "Reading file",
|
|
14
|
+
grep: "Searching files",
|
|
15
|
+
list_files: "Listing files",
|
|
16
|
+
};
|
|
17
|
+
/** Last path segment of a posix/win path-like string. */
|
|
18
|
+
function baseName(p) {
|
|
19
|
+
const parts = p.split(/[\\/]/);
|
|
20
|
+
return parts[parts.length - 1] || p;
|
|
21
|
+
}
|
|
22
|
+
/** Display file name for a tool's live-activity label, or null when the input
|
|
23
|
+
* carries no sensible name. Path tools (`write_file`/`edit_file`/`read_file`)
|
|
24
|
+
* carry `path`; `execute_command` carries an argv `command` whose first
|
|
25
|
+
* script-like token names what's running. */
|
|
26
|
+
function activityFileName(name, input) {
|
|
27
|
+
if (input === null || typeof input !== "object")
|
|
28
|
+
return null;
|
|
29
|
+
const obj = input;
|
|
30
|
+
if (name === "execute_command") {
|
|
31
|
+
const cmd = obj.command;
|
|
32
|
+
if (!Array.isArray(cmd))
|
|
33
|
+
return null;
|
|
34
|
+
const script = cmd.find((a) => typeof a === "string" && /\.(py|R|r|sh|js|ts|ipynb)$/.test(a));
|
|
35
|
+
return script ? baseName(script) : null;
|
|
36
|
+
}
|
|
37
|
+
return typeof obj.path === "string" && obj.path.length > 0 ? baseName(obj.path) : null;
|
|
38
|
+
}
|
|
39
|
+
export function activityForTool(name, input) {
|
|
40
|
+
const label = TOOL_ACTIVITY[name] ?? `Running ${name}`;
|
|
41
|
+
const file = activityFileName(name, input);
|
|
42
|
+
return file ? `${label} ${file}` : label;
|
|
43
|
+
}
|
|
44
|
+
/** Extract the tree delta from a `data-sandbox-event` part, or null when the
|
|
45
|
+
* part is some other sandbox event. The wrapper shape is set by
|
|
46
|
+
* `run-exec.ts`: `{ type: "data-sandbox-event", data: { execId, event } }`
|
|
47
|
+
* where `event` is the executor's `eventPayload`. */
|
|
48
|
+
export function sandboxTreeDelta(part) {
|
|
49
|
+
if (part.type !== "data-sandbox-event")
|
|
50
|
+
return null;
|
|
51
|
+
const inner = part.data?.event;
|
|
52
|
+
if (!inner || inner.kind !== "file-tree" || !inner.tree)
|
|
53
|
+
return null;
|
|
54
|
+
return inner.tree;
|
|
55
|
+
}
|
|
56
|
+
/** Apply one on-change delta to the per-step cumulative path set. `added`
|
|
57
|
+
* and `modified` add the path; `removed` deletes it. Folding many deltas
|
|
58
|
+
* (one stream per exec, all against the same step working dir) yields the
|
|
59
|
+
* full set of files the step has produced so far. */
|
|
60
|
+
export function applyTreeDelta(files, delta) {
|
|
61
|
+
for (const p of delta.added ?? [])
|
|
62
|
+
files.add(p);
|
|
63
|
+
for (const p of delta.modified ?? [])
|
|
64
|
+
files.add(p);
|
|
65
|
+
for (const p of delta.removed ?? [])
|
|
66
|
+
files.delete(p);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Narrow an `EmitFn` payload to `ChatDataPart`. The discriminator is the
|
|
70
|
+
* `data-` prefix on `type`: orchestration events (`iteration`,
|
|
71
|
+
* `tool-started`, `tool-finished`) and `ChatStreamEvent` (`text-delta`,
|
|
72
|
+
* `done`) never start with `data-`.
|
|
73
|
+
*/
|
|
74
|
+
export function isChatDataPart(event) {
|
|
75
|
+
return typeof event.type === "string" && event.type.startsWith("data-");
|
|
76
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `submitExec` — backend-agnostic DBOS step that POSTs a command to
|
|
3
|
+
* sandbox-server's `/exec` and returns after the HTTP 202 ack (ADR
|
|
4
|
+
* 0002). `submitExec` wraps its own POST in a `DBOS.runStep` keyed
|
|
5
|
+
* `sandbox.submit-exec.${execId}`.
|
|
6
|
+
*
|
|
7
|
+
* Step name: `sandbox.submit-exec.${execId}` — `execId` is already unique
|
|
8
|
+
* across the workflow (`${workflowId}:${stepId}:${functionId}`), so it
|
|
9
|
+
* doubles as the DBOS step replay cache key. On replay the cached step
|
|
10
|
+
* output is returned without re-POSTing; any duplicate POST that
|
|
11
|
+
* actually reaches sandbox-server during a narrow in-flight window is
|
|
12
|
+
* deduped server-side (PR #3 change 4) on the same `execId`.
|
|
13
|
+
*
|
|
14
|
+
* A non-202 status throws — the step boundary is throw-based by design
|
|
15
|
+
* (the `resultStep` principle): durability records a step as failed only
|
|
16
|
+
* on a thrown exception, and a throw lets DBOS cancellation propagate
|
|
17
|
+
* untouched.
|
|
18
|
+
*/
|
|
19
|
+
import type { SandboxRef, SubmitExecBody } from "./types.js";
|
|
20
|
+
export interface SubmitExecDeps {
|
|
21
|
+
/** Injected for tests. Defaults to `globalThis.fetch`. */
|
|
22
|
+
fetch?: typeof fetch;
|
|
23
|
+
/** Injected for tests. Defaults to `DBOS.runStep`. */
|
|
24
|
+
runStep?: <T>(fn: () => Promise<T>, config: {
|
|
25
|
+
name: string;
|
|
26
|
+
}) => Promise<T>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Submit an exec as a DBOS step. The step name is unique per execId, so
|
|
30
|
+
* a workflow that has already submitted the exec replays without issuing
|
|
31
|
+
* another POST.
|
|
32
|
+
*/
|
|
33
|
+
export declare function submitExec(ref: SandboxRef, body: SubmitExecBody, deps?: SubmitExecDeps): Promise<void>;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `submitExec` — backend-agnostic DBOS step that POSTs a command to
|
|
3
|
+
* sandbox-server's `/exec` and returns after the HTTP 202 ack (ADR
|
|
4
|
+
* 0002). `submitExec` wraps its own POST in a `DBOS.runStep` keyed
|
|
5
|
+
* `sandbox.submit-exec.${execId}`.
|
|
6
|
+
*
|
|
7
|
+
* Step name: `sandbox.submit-exec.${execId}` — `execId` is already unique
|
|
8
|
+
* across the workflow (`${workflowId}:${stepId}:${functionId}`), so it
|
|
9
|
+
* doubles as the DBOS step replay cache key. On replay the cached step
|
|
10
|
+
* output is returned without re-POSTing; any duplicate POST that
|
|
11
|
+
* actually reaches sandbox-server during a narrow in-flight window is
|
|
12
|
+
* deduped server-side (PR #3 change 4) on the same `execId`.
|
|
13
|
+
*
|
|
14
|
+
* A non-202 status throws — the step boundary is throw-based by design
|
|
15
|
+
* (the `resultStep` principle): durability records a step as failed only
|
|
16
|
+
* on a thrown exception, and a throw lets DBOS cancellation propagate
|
|
17
|
+
* untouched.
|
|
18
|
+
*/
|
|
19
|
+
import { DBOS } from "@dbos-inc/dbos-sdk";
|
|
20
|
+
import { signCallback } from "./hmac.js";
|
|
21
|
+
const SUBMIT_HTTP_TIMEOUT_MS = 30_000;
|
|
22
|
+
async function postExec(fetchImpl, ref, body) {
|
|
23
|
+
const controller = new AbortController();
|
|
24
|
+
const timer = setTimeout(() => controller.abort(), SUBMIT_HTTP_TIMEOUT_MS);
|
|
25
|
+
try {
|
|
26
|
+
// Sign the exact bytes we send, over the same HMAC construction the
|
|
27
|
+
// sandbox uses for its callbacks — sandbox-server authenticates every
|
|
28
|
+
// inbound request. `Date.now()` is safe here: this whole POST runs inside
|
|
29
|
+
// a `DBOS.runStep` whose cached result is replayed without re-executing
|
|
30
|
+
// the body, so the timestamp never re-computes on recovery.
|
|
31
|
+
const raw = JSON.stringify(body);
|
|
32
|
+
const timestamp = Math.floor(Date.now() / 1000);
|
|
33
|
+
const signature = signCallback({ execId: body.execId, body: raw, timestamp, secret: ref.callbackSecret });
|
|
34
|
+
const res = await fetchImpl(`http://${ref.host}:${ref.port}/exec`, {
|
|
35
|
+
method: "POST",
|
|
36
|
+
headers: {
|
|
37
|
+
"content-type": "application/json",
|
|
38
|
+
"x-sandbox-signature": signature,
|
|
39
|
+
"x-sandbox-timestamp": String(timestamp),
|
|
40
|
+
},
|
|
41
|
+
body: raw,
|
|
42
|
+
signal: controller.signal,
|
|
43
|
+
});
|
|
44
|
+
if (res.status !== 202) {
|
|
45
|
+
const text = await res.text().catch(() => "");
|
|
46
|
+
throw Object.assign(new Error(`submitExec: sandbox-server returned ${res.status} for execId=${body.execId}: ${text}`), { statusCode: res.status });
|
|
47
|
+
}
|
|
48
|
+
// The 202 body carries either `{ status: "started" }` (fresh) or a
|
|
49
|
+
// dedup-hit summary. Both are success — read and discard so the
|
|
50
|
+
// socket is released.
|
|
51
|
+
await res.text().catch(() => "");
|
|
52
|
+
}
|
|
53
|
+
finally {
|
|
54
|
+
clearTimeout(timer);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Submit an exec as a DBOS step. The step name is unique per execId, so
|
|
59
|
+
* a workflow that has already submitted the exec replays without issuing
|
|
60
|
+
* another POST.
|
|
61
|
+
*/
|
|
62
|
+
export async function submitExec(ref, body, deps = {}) {
|
|
63
|
+
const fetchImpl = deps.fetch ?? fetch;
|
|
64
|
+
const runStep = deps.runStep ?? ((fn, c) => DBOS.runStep(fn, c));
|
|
65
|
+
await runStep(() => postExec(fetchImpl, ref, body), {
|
|
66
|
+
name: `sandbox.submit-exec.${body.execId}`,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sandbox-client types — the wire/persistence shapes that cross the
|
|
3
|
+
* submit/recv protocol (see the harness-sandbox-exec spec) and the active-sandbox registry.
|
|
4
|
+
*
|
|
5
|
+
* `SandboxRef` is the in-memory handle the harness uses to talk to a live
|
|
6
|
+
* sandbox; it carries the per-sandbox `callbackSecret` (see the harness-sandbox-exec spec). The
|
|
7
|
+
* persistable subset is `PersistedSandboxRef` (from `harness/state/schema.ts`)
|
|
8
|
+
* — that one OMITS the secret, which lives only in the cached
|
|
9
|
+
* `createSandbox` DBOS step output.
|
|
10
|
+
*/
|
|
11
|
+
import { z } from "zod";
|
|
12
|
+
import type { ResourceSpec } from "../config/resource-limits.js";
|
|
13
|
+
export declare const SandboxBackend: z.ZodEnum<{
|
|
14
|
+
docker: "docker";
|
|
15
|
+
k8s: "k8s";
|
|
16
|
+
}>;
|
|
17
|
+
export type SandboxBackend = z.infer<typeof SandboxBackend>;
|
|
18
|
+
/**
|
|
19
|
+
* How a command's progress events and terminal result reach the host. Chosen by
|
|
20
|
+
* the embedder at its composition root and carried into the container as
|
|
21
|
+
* `SANDBOX_TRANSPORT`; backend-independent. The OSS default is `poll`.
|
|
22
|
+
*
|
|
23
|
+
* - `poll`: the host polls `GET /exec/{execId}?since={cursor}`; the sandbox
|
|
24
|
+
* never dials out and needs no egress.
|
|
25
|
+
* - `callback`: the sandbox POSTs signed event/completion callbacks; the
|
|
26
|
+
* embedder runs an ingress. `GET /exec/{execId}` stays the recovery backstop.
|
|
27
|
+
*/
|
|
28
|
+
export declare const SandboxTransportSchema: z.ZodEnum<{
|
|
29
|
+
poll: "poll";
|
|
30
|
+
callback: "callback";
|
|
31
|
+
}>;
|
|
32
|
+
export type SandboxTransport = z.infer<typeof SandboxTransportSchema>;
|
|
33
|
+
/**
|
|
34
|
+
* Per-sandbox-machine liveness verdict. `oomKilled` is meaningful only when
|
|
35
|
+
* `alive` is false: true when the backend reports the machine was killed for
|
|
36
|
+
* exceeding its memory limit (Docker `State.OOMKilled`; K8s container
|
|
37
|
+
* terminated reason `OOMKilled`) — the watchdog surfaces it as the
|
|
38
|
+
* `sandbox-oom-killed` failure reason instead of the generic `sandbox-dead`.
|
|
39
|
+
*/
|
|
40
|
+
export interface SandboxLiveness {
|
|
41
|
+
readonly alive: boolean;
|
|
42
|
+
readonly oomKilled: boolean;
|
|
43
|
+
}
|
|
44
|
+
export declare const SandboxRefSchema: z.ZodObject<{
|
|
45
|
+
sandboxId: z.ZodString;
|
|
46
|
+
host: z.ZodString;
|
|
47
|
+
port: z.ZodNumber;
|
|
48
|
+
backend: z.ZodEnum<{
|
|
49
|
+
docker: "docker";
|
|
50
|
+
k8s: "k8s";
|
|
51
|
+
}>;
|
|
52
|
+
callbackSecret: z.ZodString;
|
|
53
|
+
}, z.core.$strip>;
|
|
54
|
+
export type SandboxRef = z.infer<typeof SandboxRefSchema>;
|
|
55
|
+
/** Strip the secret before persisting to the active-sandbox registry. */
|
|
56
|
+
export declare function toPersistedRef(ref: SandboxRef): {
|
|
57
|
+
sandboxId: string;
|
|
58
|
+
host: string;
|
|
59
|
+
port: number;
|
|
60
|
+
backend: SandboxBackend;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* One tracked file operation in the sandbox-server provenance frame.
|
|
64
|
+
* Mirrors Go's `ProvenanceEntry` (`images/sandbox-base/server/provenance.go`):
|
|
65
|
+
* an absolute container path plus the capture layers that observed it.
|
|
66
|
+
*/
|
|
67
|
+
export declare const ProvenanceFrameEntrySchema: z.ZodObject<{
|
|
68
|
+
path: z.ZodString;
|
|
69
|
+
layers: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
70
|
+
}, z.core.$strip>;
|
|
71
|
+
export type ProvenanceFrameEntry = z.infer<typeof ProvenanceFrameEntrySchema>;
|
|
72
|
+
/**
|
|
73
|
+
* Runtime file-I/O frame sandbox-server attaches to the `/complete`
|
|
74
|
+
* callback. Mirrors Go's `provenancePayload` — every field is
|
|
75
|
+
* `omitempty` on the wire, so each arm defaults so a completion that
|
|
76
|
+
* omits the frame (or any arm) still parses.
|
|
77
|
+
*/
|
|
78
|
+
export declare const ProvenanceFrameSchema: z.ZodObject<{
|
|
79
|
+
disabled: z.ZodDefault<z.ZodBoolean>;
|
|
80
|
+
reads: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
81
|
+
path: z.ZodString;
|
|
82
|
+
layers: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
83
|
+
}, z.core.$strip>>>;
|
|
84
|
+
writes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
85
|
+
path: z.ZodString;
|
|
86
|
+
layers: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
87
|
+
}, z.core.$strip>>>;
|
|
88
|
+
deletes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
89
|
+
path: z.ZodString;
|
|
90
|
+
layers: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
91
|
+
}, z.core.$strip>>>;
|
|
92
|
+
}, z.core.$strip>;
|
|
93
|
+
export type ProvenanceFrame = z.infer<typeof ProvenanceFrameSchema>;
|
|
94
|
+
/**
|
|
95
|
+
* Final outcome of a single exec, returned by `awaitExec`. Mirrors the
|
|
96
|
+
* sandbox-server completion payload plus a discriminant for synthetic
|
|
97
|
+
* (watchdog-emitted) failures.
|
|
98
|
+
*/
|
|
99
|
+
export declare const ExecResultSchema: z.ZodObject<{
|
|
100
|
+
execId: z.ZodString;
|
|
101
|
+
exitCode: z.ZodNullable<z.ZodNumber>;
|
|
102
|
+
stdout: z.ZodDefault<z.ZodString>;
|
|
103
|
+
stderr: z.ZodDefault<z.ZodString>;
|
|
104
|
+
durationMs: z.ZodNullable<z.ZodNumber>;
|
|
105
|
+
timedOut: z.ZodDefault<z.ZodBoolean>;
|
|
106
|
+
syntheticFailure: z.ZodOptional<z.ZodObject<{
|
|
107
|
+
reason: z.ZodString;
|
|
108
|
+
}, z.core.$strip>>;
|
|
109
|
+
provenance: z.ZodOptional<z.ZodObject<{
|
|
110
|
+
disabled: z.ZodDefault<z.ZodBoolean>;
|
|
111
|
+
reads: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
112
|
+
path: z.ZodString;
|
|
113
|
+
layers: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
114
|
+
}, z.core.$strip>>>;
|
|
115
|
+
writes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
116
|
+
path: z.ZodString;
|
|
117
|
+
layers: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
118
|
+
}, z.core.$strip>>>;
|
|
119
|
+
deletes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
120
|
+
path: z.ZodString;
|
|
121
|
+
layers: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
122
|
+
}, z.core.$strip>>>;
|
|
123
|
+
}, z.core.$strip>>;
|
|
124
|
+
}, z.core.$strip>;
|
|
125
|
+
export type ExecResult = z.infer<typeof ExecResultSchema>;
|
|
126
|
+
/**
|
|
127
|
+
* Per-message envelope on the per-exec DBOS topic. Real callbacks carry
|
|
128
|
+
* a non-null `signature` and `timestamp`; the in-process watchdog uses a
|
|
129
|
+
* `null` signature + a `synthetic-failure` payload (see `await-exec.ts`).
|
|
130
|
+
*
|
|
131
|
+
* `payloadRaw` is the exact bytes sandbox-server POSTed — sandbox-server's
|
|
132
|
+
* HMAC signs the raw body, and Go's `encoding/json` HTML-escapes `<`, `>`,
|
|
133
|
+
* `&` by default, so verifying against a JS re-serialization of the parsed
|
|
134
|
+
* payload would diverge for any output containing those characters
|
|
135
|
+
* (common in bioinformatics: FASTA headers, shell stderr, command pipelines).
|
|
136
|
+
* Optional only for back-compat with messages that pre-date this field.
|
|
137
|
+
*/
|
|
138
|
+
export declare const ExecEventMessageSchema: z.ZodObject<{
|
|
139
|
+
payload: z.ZodUnknown;
|
|
140
|
+
payloadRaw: z.ZodOptional<z.ZodString>;
|
|
141
|
+
signature: z.ZodNullable<z.ZodString>;
|
|
142
|
+
timestamp: z.ZodNullable<z.ZodNumber>;
|
|
143
|
+
}, z.core.$strip>;
|
|
144
|
+
export type ExecEventMessage = z.infer<typeof ExecEventMessageSchema>;
|
|
145
|
+
/**
|
|
146
|
+
* One buffered progress event in a poll response: the sandbox's monotonic
|
|
147
|
+
* per-exec sequence number (the poll cursor) plus the event payload the host
|
|
148
|
+
* forwards via `emit` — the same payload a callback-mode event POST carries.
|
|
149
|
+
*/
|
|
150
|
+
export declare const PollEventSchema: z.ZodObject<{
|
|
151
|
+
seq: z.ZodNumber;
|
|
152
|
+
payload: z.ZodUnknown;
|
|
153
|
+
}, z.core.$strip>;
|
|
154
|
+
export type PollEvent = z.infer<typeof PollEventSchema>;
|
|
155
|
+
/**
|
|
156
|
+
* Body of `GET /exec/{execId}?since={cursor}` in poll mode. Mirrors Go's
|
|
157
|
+
* `pollResponseBody`: the events newer than the caller's cursor, the new
|
|
158
|
+
* high-water `cursor`, a `truncated` marker set once the ring shed an event,
|
|
159
|
+
* and — once the exec is terminal — the completion `result` (with its
|
|
160
|
+
* provenance frame). The whole body is HMAC-signed, verified exactly as a
|
|
161
|
+
* pushed completion is.
|
|
162
|
+
*/
|
|
163
|
+
export declare const PollResponseSchema: z.ZodObject<{
|
|
164
|
+
status: z.ZodString;
|
|
165
|
+
events: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
166
|
+
seq: z.ZodNumber;
|
|
167
|
+
payload: z.ZodUnknown;
|
|
168
|
+
}, z.core.$strip>>>;
|
|
169
|
+
cursor: z.ZodNumber;
|
|
170
|
+
truncated: z.ZodDefault<z.ZodBoolean>;
|
|
171
|
+
result: z.ZodOptional<z.ZodObject<{
|
|
172
|
+
execId: z.ZodString;
|
|
173
|
+
exitCode: z.ZodNullable<z.ZodNumber>;
|
|
174
|
+
stdout: z.ZodDefault<z.ZodString>;
|
|
175
|
+
stderr: z.ZodDefault<z.ZodString>;
|
|
176
|
+
durationMs: z.ZodNullable<z.ZodNumber>;
|
|
177
|
+
timedOut: z.ZodDefault<z.ZodBoolean>;
|
|
178
|
+
syntheticFailure: z.ZodOptional<z.ZodObject<{
|
|
179
|
+
reason: z.ZodString;
|
|
180
|
+
}, z.core.$strip>>;
|
|
181
|
+
provenance: z.ZodOptional<z.ZodObject<{
|
|
182
|
+
disabled: z.ZodDefault<z.ZodBoolean>;
|
|
183
|
+
reads: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
184
|
+
path: z.ZodString;
|
|
185
|
+
layers: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
186
|
+
}, z.core.$strip>>>;
|
|
187
|
+
writes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
188
|
+
path: z.ZodString;
|
|
189
|
+
layers: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
190
|
+
}, z.core.$strip>>>;
|
|
191
|
+
deletes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
192
|
+
path: z.ZodString;
|
|
193
|
+
layers: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
194
|
+
}, z.core.$strip>>>;
|
|
195
|
+
}, z.core.$strip>>;
|
|
196
|
+
}, z.core.$strip>>;
|
|
197
|
+
}, z.core.$strip>;
|
|
198
|
+
export type PollResponse = z.infer<typeof PollResponseSchema>;
|
|
199
|
+
/**
|
|
200
|
+
* Done-marker shape the recv loop unwraps. Both real completion POSTs
|
|
201
|
+
* (wrapped by the `/complete` handler) and watchdog synthetic-failure
|
|
202
|
+
* sends use this discriminant.
|
|
203
|
+
*/
|
|
204
|
+
export interface DoneMarker {
|
|
205
|
+
done: true;
|
|
206
|
+
result: ExecResult;
|
|
207
|
+
}
|
|
208
|
+
export interface SyntheticFailureMarker {
|
|
209
|
+
done: true;
|
|
210
|
+
result: ExecResult;
|
|
211
|
+
kind: "synthetic-failure";
|
|
212
|
+
reason: string;
|
|
213
|
+
}
|
|
214
|
+
export declare function isDoneMarker(value: unknown): value is DoneMarker;
|
|
215
|
+
export declare function isSyntheticFailure(value: unknown): value is SyntheticFailureMarker;
|
|
216
|
+
/** Wire shape `submitExec` POSTs to sandbox-server's `/exec` (change 4). */
|
|
217
|
+
export interface SubmitExecBody {
|
|
218
|
+
command: string[];
|
|
219
|
+
execId: string;
|
|
220
|
+
cwd?: string;
|
|
221
|
+
env?: Record<string, string>;
|
|
222
|
+
timeoutSeconds?: number;
|
|
223
|
+
}
|
|
224
|
+
/** Step-meta passed to `createSandbox` — what the registry row needs. */
|
|
225
|
+
export interface CreateSandboxMeta {
|
|
226
|
+
runId: string;
|
|
227
|
+
stepId: string;
|
|
228
|
+
analysisId: string;
|
|
229
|
+
/** The first `execId` that will fire against this sandbox; nullable for
|
|
230
|
+
* early-create flows where the workflow mints the first execId later. */
|
|
231
|
+
execId?: string | null;
|
|
232
|
+
/** Owning DBOS child workflow id (`"${parentRunId}-${N}"`). Stamped onto the
|
|
233
|
+
* sandbox machine as the `cortex/owner-workflow-id` label so the reaper can
|
|
234
|
+
* map a cluster-side machine back to its workflow and check liveness. */
|
|
235
|
+
childWorkflowId: string;
|
|
236
|
+
/** Backend-specific extras carried through to the per-backend impl. */
|
|
237
|
+
image?: string;
|
|
238
|
+
extraEnv?: Record<string, string>;
|
|
239
|
+
/** CPU/memory/GPU request for the sandbox machine. Required of every
|
|
240
|
+
* caller — `createSandboxClient` clamps it to cluster limits and rejects
|
|
241
|
+
* a sandbox with none. */
|
|
242
|
+
resources: ResourceSpec;
|
|
243
|
+
/** Enforced read-only: provision with no read-write step mount, only the
|
|
244
|
+
* read-only analysis tree. Used by the ephemeral executor. */
|
|
245
|
+
readOnly?: boolean;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* The identity minted for a sandbox machine *before* it is spawned — the
|
|
249
|
+
* durable half of the two-step create (see the harness-sandbox-exec spec). Step 1 checkpoints this so a
|
|
250
|
+
* recovery re-run of the spawn step adopts the already-created machine under
|
|
251
|
+
* the same name and HMAC secret instead of leaking a second one.
|
|
252
|
+
*/
|
|
253
|
+
export interface SandboxIdentity {
|
|
254
|
+
/** `sbx-{run8}-{uuid4}` — informative for `kubectl`, not load-bearing; the
|
|
255
|
+
* checkpoint, not the name, is what makes create idempotent. */
|
|
256
|
+
sandboxId: string;
|
|
257
|
+
/** 32-byte base64 HMAC secret (see the harness-sandbox-exec spec); rides into the machine's env. */
|
|
258
|
+
callbackSecret: string;
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* A sandbox machine the backend is running that Cortex *manages*
|
|
262
|
+
* (`app.kubernetes.io/managed-by=cortex`), enumerated by the reaper for the
|
|
263
|
+
* cluster→registry sweep (see the harness-sandbox-exec spec). The `ownerWorkflowId` comes from the
|
|
264
|
+
* `cortex/owner-workflow-id` label and may be null for legacy/label-less
|
|
265
|
+
* machines, which are only reaped past a creation-time grace.
|
|
266
|
+
*/
|
|
267
|
+
export interface ManagedSandbox {
|
|
268
|
+
sandboxId: string;
|
|
269
|
+
ownerWorkflowId: string | null;
|
|
270
|
+
createdAtMs: number | null;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Per-step `emit` callback handed to `awaitExec`. May be async — `awaitExec`
|
|
274
|
+
* runs in the workflow body (see the harness-tools spec) and `await`s each emit so the body-path
|
|
275
|
+
* `DBOS.writeStream` it drives lands at a deterministic function-ID (see the harness-durable-runtime spec).
|
|
276
|
+
*/
|
|
277
|
+
export type ExecEmit = (event: unknown) => void | Promise<void>;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sandbox-client types — the wire/persistence shapes that cross the
|
|
3
|
+
* submit/recv protocol (see the harness-sandbox-exec spec) and the active-sandbox registry.
|
|
4
|
+
*
|
|
5
|
+
* `SandboxRef` is the in-memory handle the harness uses to talk to a live
|
|
6
|
+
* sandbox; it carries the per-sandbox `callbackSecret` (see the harness-sandbox-exec spec). The
|
|
7
|
+
* persistable subset is `PersistedSandboxRef` (from `harness/state/schema.ts`)
|
|
8
|
+
* — that one OMITS the secret, which lives only in the cached
|
|
9
|
+
* `createSandbox` DBOS step output.
|
|
10
|
+
*/
|
|
11
|
+
import { z } from "zod";
|
|
12
|
+
import { PersistedSandboxRefSchema } from "../state/schema.js";
|
|
13
|
+
export const SandboxBackend = z.enum(["docker", "k8s"]);
|
|
14
|
+
/**
|
|
15
|
+
* How a command's progress events and terminal result reach the host. Chosen by
|
|
16
|
+
* the embedder at its composition root and carried into the container as
|
|
17
|
+
* `SANDBOX_TRANSPORT`; backend-independent. The OSS default is `poll`.
|
|
18
|
+
*
|
|
19
|
+
* - `poll`: the host polls `GET /exec/{execId}?since={cursor}`; the sandbox
|
|
20
|
+
* never dials out and needs no egress.
|
|
21
|
+
* - `callback`: the sandbox POSTs signed event/completion callbacks; the
|
|
22
|
+
* embedder runs an ingress. `GET /exec/{execId}` stays the recovery backstop.
|
|
23
|
+
*/
|
|
24
|
+
export const SandboxTransportSchema = z.enum(["poll", "callback"]);
|
|
25
|
+
export const SandboxRefSchema = PersistedSandboxRefSchema.extend({
|
|
26
|
+
/**
|
|
27
|
+
* 32-byte high-entropy bytes, base64-encoded. Minted once at
|
|
28
|
+
* `createSandbox` and handed to the sandbox container via
|
|
29
|
+
* `SANDBOX_CALLBACK_SECRET`. Never persisted outside the DBOS
|
|
30
|
+
* step-output cache.
|
|
31
|
+
*/
|
|
32
|
+
callbackSecret: z.string(),
|
|
33
|
+
});
|
|
34
|
+
/** Strip the secret before persisting to the active-sandbox registry. */
|
|
35
|
+
export function toPersistedRef(ref) {
|
|
36
|
+
return {
|
|
37
|
+
sandboxId: ref.sandboxId,
|
|
38
|
+
host: ref.host,
|
|
39
|
+
port: ref.port,
|
|
40
|
+
backend: ref.backend,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* One tracked file operation in the sandbox-server provenance frame.
|
|
45
|
+
* Mirrors Go's `ProvenanceEntry` (`images/sandbox-base/server/provenance.go`):
|
|
46
|
+
* an absolute container path plus the capture layers that observed it.
|
|
47
|
+
*/
|
|
48
|
+
export const ProvenanceFrameEntrySchema = z.object({
|
|
49
|
+
path: z.string(),
|
|
50
|
+
layers: z.array(z.string()).default([]),
|
|
51
|
+
});
|
|
52
|
+
/**
|
|
53
|
+
* Runtime file-I/O frame sandbox-server attaches to the `/complete`
|
|
54
|
+
* callback. Mirrors Go's `provenancePayload` — every field is
|
|
55
|
+
* `omitempty` on the wire, so each arm defaults so a completion that
|
|
56
|
+
* omits the frame (or any arm) still parses.
|
|
57
|
+
*/
|
|
58
|
+
export const ProvenanceFrameSchema = z.object({
|
|
59
|
+
disabled: z.boolean().default(false),
|
|
60
|
+
reads: z.array(ProvenanceFrameEntrySchema).default([]),
|
|
61
|
+
writes: z.array(ProvenanceFrameEntrySchema).default([]),
|
|
62
|
+
/**
|
|
63
|
+
* Reserved. All four sandbox capture layers report deletes per the
|
|
64
|
+
* sandbox-provenance-tracking spec, but the harness has no consumer —
|
|
65
|
+
* `feedExecFrame` reads only `reads`/`writes`. Kept on the wire for a
|
|
66
|
+
* future invalidation mapping.
|
|
67
|
+
*/
|
|
68
|
+
deletes: z.array(ProvenanceFrameEntrySchema).default([]),
|
|
69
|
+
});
|
|
70
|
+
/**
|
|
71
|
+
* Final outcome of a single exec, returned by `awaitExec`. Mirrors the
|
|
72
|
+
* sandbox-server completion payload plus a discriminant for synthetic
|
|
73
|
+
* (watchdog-emitted) failures.
|
|
74
|
+
*/
|
|
75
|
+
export const ExecResultSchema = z.object({
|
|
76
|
+
execId: z.string(),
|
|
77
|
+
exitCode: z.number().nullable(),
|
|
78
|
+
stdout: z.string().default(""),
|
|
79
|
+
stderr: z.string().default(""),
|
|
80
|
+
durationMs: z.number().nullable(),
|
|
81
|
+
timedOut: z.boolean().default(false),
|
|
82
|
+
/** Set when the watchdog synthesises a completion for a dead sandbox. */
|
|
83
|
+
syntheticFailure: z
|
|
84
|
+
.object({
|
|
85
|
+
reason: z.string(),
|
|
86
|
+
})
|
|
87
|
+
.optional(),
|
|
88
|
+
/**
|
|
89
|
+
* Runtime file-I/O frame from sandbox-server. Optional so synthetic
|
|
90
|
+
* watchdog failures and pre-change cached recv messages parse; rides
|
|
91
|
+
* the recv payload into the durable DBOS step output.
|
|
92
|
+
*/
|
|
93
|
+
provenance: ProvenanceFrameSchema.optional(),
|
|
94
|
+
});
|
|
95
|
+
/**
|
|
96
|
+
* Per-message envelope on the per-exec DBOS topic. Real callbacks carry
|
|
97
|
+
* a non-null `signature` and `timestamp`; the in-process watchdog uses a
|
|
98
|
+
* `null` signature + a `synthetic-failure` payload (see `await-exec.ts`).
|
|
99
|
+
*
|
|
100
|
+
* `payloadRaw` is the exact bytes sandbox-server POSTed — sandbox-server's
|
|
101
|
+
* HMAC signs the raw body, and Go's `encoding/json` HTML-escapes `<`, `>`,
|
|
102
|
+
* `&` by default, so verifying against a JS re-serialization of the parsed
|
|
103
|
+
* payload would diverge for any output containing those characters
|
|
104
|
+
* (common in bioinformatics: FASTA headers, shell stderr, command pipelines).
|
|
105
|
+
* Optional only for back-compat with messages that pre-date this field.
|
|
106
|
+
*/
|
|
107
|
+
export const ExecEventMessageSchema = z.object({
|
|
108
|
+
payload: z.unknown(),
|
|
109
|
+
payloadRaw: z.string().optional(),
|
|
110
|
+
signature: z.string().nullable(),
|
|
111
|
+
timestamp: z.number().int().nullable(),
|
|
112
|
+
});
|
|
113
|
+
/**
|
|
114
|
+
* One buffered progress event in a poll response: the sandbox's monotonic
|
|
115
|
+
* per-exec sequence number (the poll cursor) plus the event payload the host
|
|
116
|
+
* forwards via `emit` — the same payload a callback-mode event POST carries.
|
|
117
|
+
*/
|
|
118
|
+
export const PollEventSchema = z.object({
|
|
119
|
+
seq: z.number().int(),
|
|
120
|
+
payload: z.unknown(),
|
|
121
|
+
});
|
|
122
|
+
/**
|
|
123
|
+
* Body of `GET /exec/{execId}?since={cursor}` in poll mode. Mirrors Go's
|
|
124
|
+
* `pollResponseBody`: the events newer than the caller's cursor, the new
|
|
125
|
+
* high-water `cursor`, a `truncated` marker set once the ring shed an event,
|
|
126
|
+
* and — once the exec is terminal — the completion `result` (with its
|
|
127
|
+
* provenance frame). The whole body is HMAC-signed, verified exactly as a
|
|
128
|
+
* pushed completion is.
|
|
129
|
+
*/
|
|
130
|
+
export const PollResponseSchema = z.object({
|
|
131
|
+
status: z.string(),
|
|
132
|
+
events: z.array(PollEventSchema).default([]),
|
|
133
|
+
cursor: z.number().int(),
|
|
134
|
+
/**
|
|
135
|
+
* Sticky ring-shed marker. Deliberately unused by the poll loop — the
|
|
136
|
+
* seq-gap arithmetic detects sheds without it — but kept on the wire for
|
|
137
|
+
* consumers that want the sandbox's own flag rather than deriving it.
|
|
138
|
+
*/
|
|
139
|
+
truncated: z.boolean().default(false),
|
|
140
|
+
result: ExecResultSchema.optional(),
|
|
141
|
+
});
|
|
142
|
+
export function isDoneMarker(value) {
|
|
143
|
+
return (typeof value === "object" && value !== null && value.done === true && typeof value.result === "object");
|
|
144
|
+
}
|
|
145
|
+
export function isSyntheticFailure(value) {
|
|
146
|
+
return isDoneMarker(value) && value.kind === "synthetic-failure";
|
|
147
|
+
}
|