@inflexa-ai/harness 0.28.1 → 0.30.0
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/dist/agents/conversation-agent.js +7 -4
- package/dist/agents/report-session-agent.js +1 -1
- package/dist/agents/sandbox/data-profiler.js +0 -1
- package/dist/agents/sandbox/immune-profiling-agent.js +3 -1
- package/dist/agents/sandbox/network-agent.js +0 -1
- package/dist/agents/sandbox/types.d.ts +1 -1
- package/dist/agents/sandbox/types.js +1 -1
- package/dist/app/data-profile-orientation.d.ts +52 -27
- package/dist/app/data-profile-orientation.js +331 -92
- package/dist/app/data-profile-view.d.ts +70 -0
- package/dist/app/data-profile-view.js +123 -0
- package/dist/app/synthesize-run.js +1 -1
- package/dist/config/resource-limits.d.ts +1 -1
- package/dist/config/resource-limits.js +1 -1
- package/dist/contracts/data-profile.d.ts +276 -25
- package/dist/contracts/index.d.ts +3 -1
- package/dist/contracts/index.js +1 -0
- package/dist/contracts/profile-vocabulary.d.ts +103 -0
- package/dist/contracts/profile-vocabulary.js +449 -0
- package/dist/contracts/schemas/chat-parts.d.ts +12 -12
- package/dist/contracts/severity.d.ts +2 -2
- package/dist/contracts/target-dossier.d.ts +91 -91
- package/dist/data/safety-panel-schema.d.ts +4 -4
- package/dist/execution/input-signature.d.ts +16 -3
- package/dist/execution/input-signature.js +0 -0
- package/dist/execution/post-step-pipeline.js +1 -1
- package/dist/execution/staged-input.d.ts +4 -4
- package/dist/index.d.ts +7 -2
- package/dist/index.js +14 -0
- package/dist/input-scan/clustering.d.ts +63 -0
- package/dist/input-scan/clustering.js +208 -0
- package/dist/input-scan/companions.d.ts +30 -0
- package/dist/input-scan/companions.js +138 -0
- package/dist/input-scan/decoder/container_readout.py +171 -0
- package/dist/input-scan/detect-sets.d.ts +24 -0
- package/dist/input-scan/detect-sets.js +279 -0
- package/dist/input-scan/enrich.d.ts +62 -19
- package/dist/input-scan/enrich.js +132 -187
- package/dist/input-scan/formats.d.ts +13 -5
- package/dist/input-scan/formats.js +13 -5
- package/dist/input-scan/index.d.ts +10 -4
- package/dist/input-scan/index.js +7 -4
- package/dist/input-scan/markers.d.ts +21 -0
- package/dist/input-scan/markers.js +89 -0
- package/dist/input-scan/menu.d.ts +127 -0
- package/dist/input-scan/menu.js +0 -0
- package/dist/input-scan/quarantine.d.ts +17 -0
- package/dist/input-scan/quarantine.js +69 -0
- package/dist/input-scan/readout-budget.d.ts +32 -0
- package/dist/input-scan/readout-budget.js +61 -0
- package/dist/input-scan/readout.d.ts +33 -0
- package/dist/input-scan/readout.js +336 -0
- package/dist/input-scan/scan.d.ts +5 -4
- package/dist/input-scan/scan.js +5 -5
- package/dist/input-scan/set-types.d.ts +209 -0
- package/dist/input-scan/set-types.js +15 -0
- package/dist/input-scan/templates.d.ts +93 -0
- package/dist/input-scan/templates.js +369 -0
- package/dist/input-scan/tokens.d.ts +94 -0
- package/dist/input-scan/tokens.js +267 -0
- package/dist/input-scan/tuning.d.ts +55 -0
- package/dist/input-scan/tuning.js +55 -0
- package/dist/input-scan/types.d.ts +2 -2
- package/dist/loop/run-agent.d.ts +13 -1
- package/dist/loop/run-agent.js +2 -1
- package/dist/prompts/SOUL.d.ts +2 -2
- package/dist/prompts/SOUL.js +17 -1
- package/dist/prompts/conversation.d.ts +1 -1
- package/dist/prompts/conversation.js +45 -71
- package/dist/prompts/planner.js +57 -10
- package/dist/prompts/report-session.d.ts +1 -1
- package/dist/prompts/report-session.js +3 -2
- package/dist/prompts/sandbox/bulk-transcriptomics-agent.d.ts +1 -1
- package/dist/prompts/sandbox/bulk-transcriptomics-agent.js +3 -1
- package/dist/prompts/sandbox/data-profiler.d.ts +10 -1
- package/dist/prompts/sandbox/data-profiler.js +197 -53
- package/dist/prompts/sandbox/dna-methylation-agent.d.ts +1 -1
- package/dist/prompts/sandbox/dna-methylation-agent.js +18 -12
- package/dist/prompts/sandbox/immune-profiling-agent.d.ts +1 -1
- package/dist/prompts/sandbox/immune-profiling-agent.js +6 -2
- package/dist/prompts/sandbox/metabolomics-agent.d.ts +1 -1
- package/dist/prompts/sandbox/metabolomics-agent.js +8 -4
- package/dist/prompts/sandbox/microbiome-agent.d.ts +1 -1
- package/dist/prompts/sandbox/microbiome-agent.js +12 -6
- package/dist/prompts/sandbox/network-agent.d.ts +1 -1
- package/dist/prompts/sandbox/network-agent.js +9 -6
- package/dist/prompts/sandbox/spatial-omics-agent.d.ts +1 -1
- package/dist/prompts/sandbox/spatial-omics-agent.js +4 -2
- package/dist/prompts/sandbox-standards.d.ts +1 -1
- package/dist/prompts/sandbox-standards.js +10 -7
- package/dist/providers/ai-sdk.js +34 -1
- package/dist/providers/reasoning.d.ts +65 -0
- package/dist/providers/reasoning.js +81 -0
- package/dist/providers/types.d.ts +14 -0
- package/dist/schemas/data-profile-schemas.d.ts +947 -84
- package/dist/schemas/data-profile-schemas.js +300 -115
- package/dist/schemas/run-synthesis.d.ts +4 -4
- package/dist/state/data-profile.d.ts +1 -1
- package/dist/state/index.d.ts +1 -1
- package/dist/state/vector-store.d.ts +13 -0
- package/dist/state/vector-store.js +8 -0
- package/dist/tasks/data-profile-absorb.d.ts +78 -0
- package/dist/tasks/data-profile-absorb.js +285 -0
- package/dist/tasks/data-profile-index.d.ts +34 -25
- package/dist/tasks/data-profile-index.js +160 -59
- package/dist/tasks/data-profile-resolve.d.ts +72 -0
- package/dist/tasks/data-profile-resolve.js +639 -0
- package/dist/tasks/data-profile.d.ts +16 -5
- package/dist/tasks/data-profile.js +270 -131
- package/dist/tools/bio/chembl.d.ts +1 -1
- package/dist/tools/bio/chembl.js +15 -10
- package/dist/tools/bio/comptox.js +5 -1
- package/dist/tools/bio/drug-gene-interactions.js +5 -2
- package/dist/tools/bio/gene-disease-evidence.d.ts +19 -9
- package/dist/tools/bio/gene-disease-evidence.js +78 -22
- package/dist/tools/bio/gene-preclinical-profile.d.ts +33 -13
- package/dist/tools/bio/gene-preclinical-profile.js +63 -22
- package/dist/tools/bio/lookup-annotation.d.ts +1 -0
- package/dist/tools/bio/lookup-annotation.js +28 -10
- package/dist/tools/bio/opentargets.d.ts +10 -2
- package/dist/tools/bio/opentargets.js +42 -13
- package/dist/tools/bio/pubchem.js +5 -2
- package/dist/tools/bio/pubmed.js +9 -3
- package/dist/tools/bio/search-clinical-trials.d.ts +25 -25
- package/dist/tools/bio/search-clinical-trials.js +56 -18
- package/dist/tools/bio/search-faers.d.ts +26 -6
- package/dist/tools/bio/search-faers.js +70 -18
- package/dist/tools/bio/search-gene.d.ts +19 -3
- package/dist/tools/bio/search-gene.js +69 -12
- package/dist/tools/bio/search-geo-datasets.js +4 -1
- package/dist/tools/bio/search-interactions.js +6 -2
- package/dist/tools/bio/target-safety.d.ts +2 -2
- package/dist/tools/bio/target-safety.js +3 -2
- package/dist/tools/lib/cbioportal-client.js +25 -6
- package/dist/tools/lib/chembl-client.d.ts +3 -1
- package/dist/tools/lib/chembl-client.js +6 -1
- package/dist/tools/lib/gwas-catalog-client.d.ts +7 -6
- package/dist/tools/lib/gwas-catalog-client.js +18 -6
- package/dist/tools/lib/openfda-client.d.ts +7 -5
- package/dist/tools/lib/openfda-client.js +17 -9
- package/dist/tools/lib/opentargets-client.d.ts +20 -0
- package/dist/tools/lib/opentargets-client.js +45 -0
- package/dist/tools/lib/pathway-client.d.ts +7 -0
- package/dist/tools/lib/pathway-client.js +68 -1
- package/dist/tools/research/context7-docs.js +3 -3
- package/dist/tools/research/generate-analogy-report.js +2 -2
- package/dist/tools/research/generate-plan.d.ts +3 -0
- package/dist/tools/research/generate-plan.js +64 -5
- package/dist/tools/research/inspect-data-profile.d.ts +48 -22
- package/dist/tools/research/inspect-data-profile.js +73 -54
- package/dist/tools/research/resolve-citation.js +8 -3
- package/dist/tools/research/search-arxiv.js +8 -3
- package/dist/tools/research/search-semantic-scholar.js +10 -4
- package/dist/tools/workspace/scan-inputs.d.ts +4 -4
- package/dist/tools/workspace/scan-inputs.js +13 -14
- package/dist/tools/workspace/workspace-search.d.ts +11 -2
- package/dist/tools/workspace/workspace-search.js +44 -16
- package/dist/workflows/sandbox-step.d.ts +6 -0
- package/dist/workflows/sandbox-step.js +31 -14
- package/dist/workflows/target-assessment/assemblers/safety.d.ts +1 -1
- package/dist/workflows/target-assessment/phase4-assemble.d.ts +38 -38
- package/dist/workflows/target-assessment/schemas.d.ts +12 -12
- package/dist/workflows/target-assessment/steps/phase2-aggregate.d.ts +6 -6
- package/dist/workflows/target-assessment/steps/phase3-aggregate.d.ts +6 -6
- package/dist/workflows/target-assessment/synthesis/index.d.ts +12 -12
- package/package.json +5 -3
- package/dist/input-scan/coverage.d.ts +0 -22
- package/dist/input-scan/coverage.js +0 -85
|
@@ -27,7 +27,7 @@ import { composeSystemPrompt } from "./system-prompt.js";
|
|
|
27
27
|
import { searchGeneTool, lookupAnnotationTool, searchInteractionsTool, chemblTool, pubchemTool, openTargetsTool, searchFaersTool, searchClinicalTrialsTool, searchGeoDatasetsTool, genePreclinicalProfileTool, targetSafetyTool, } from "../tools/bio/index.js";
|
|
28
28
|
import { createNcbiTools, createChemDbTools } from "../tools/bio/keys.js";
|
|
29
29
|
// Dependency-bearing tool factories.
|
|
30
|
-
import { createGeneratePlanTool,
|
|
30
|
+
import { createGeneratePlanTool, createInspectRunTool, createInspectDataProfileTool, createGenerateAnalogyReportTool, createSearchSemanticScholarTool, searchArxivTool, } from "../tools/research/index.js";
|
|
31
31
|
import { createFileStatTool, createGrepTool, createListFilesTool, createReadFileTool, createShowPlanTool, createWorkspaceSearchTool, showFileTool, } from "../tools/workspace/index.js";
|
|
32
32
|
import { showUserTool } from "../tools/display/index.js";
|
|
33
33
|
import { createUpdateWorkingMemoryTool } from "../tools/memory/index.js";
|
|
@@ -39,7 +39,7 @@ import { createResolveCitationTool } from "../tools/research/resolve-citation.js
|
|
|
39
39
|
/** Canonical agent id — the single source of truth. */
|
|
40
40
|
export const CONVERSATION_AGENT_ID = "conversation-agent";
|
|
41
41
|
/** Runaway guard — heavy tool-driving turns need generous headroom. */
|
|
42
|
-
const CONVERSATION_MAX_ITERATIONS =
|
|
42
|
+
const CONVERSATION_MAX_ITERATIONS = 200;
|
|
43
43
|
/** Build the conversation `AgentDefinition` with every tool fully dep-bound. */
|
|
44
44
|
export function createConversationAgent(deps) {
|
|
45
45
|
const { provider, pool, embedding, workspaceFs, model, utilityProvider, utilityModel, executeAnalysisWorkflow, runAuthorizer, runLauncher, bioKeys, chrome, resourcePolicy, hostTools, refStorePath, packagesFile, usageRecorder, citationResolver, } = deps;
|
|
@@ -57,6 +57,10 @@ export function createConversationAgent(deps) {
|
|
|
57
57
|
ncbi.pubmed,
|
|
58
58
|
// Verification of one caller-supplied citation (distinct from discovery).
|
|
59
59
|
createResolveCitationTool(citationResolver),
|
|
60
|
+
// Literature outside PubMed. A question about a method, a model or a
|
|
61
|
+
// preprint has no MEDLINE record, thus PubMed alone cannot answer it.
|
|
62
|
+
createSearchSemanticScholarTool({ ...(bioKeys.semanticScholar === undefined ? {} : { apiKey: bioKeys.semanticScholar }) }),
|
|
63
|
+
searchArxivTool,
|
|
60
64
|
// ChEMBL (compounds / drug / mechanism / bioactivity / targets behind one action).
|
|
61
65
|
chemblTool,
|
|
62
66
|
// PubChem (compound / crossrefs / assays behind one action).
|
|
@@ -95,6 +99,7 @@ export function createConversationAgent(deps) {
|
|
|
95
99
|
pool,
|
|
96
100
|
resourcePolicy,
|
|
97
101
|
usageRecorder,
|
|
102
|
+
bioKeys,
|
|
98
103
|
...(refStorePath ? { refStorePath } : {}),
|
|
99
104
|
...(packagesFile ? { packagesFile } : {}),
|
|
100
105
|
...(deps.logger ? { logger: deps.logger } : {}),
|
|
@@ -123,8 +128,6 @@ export function createConversationAgent(deps) {
|
|
|
123
128
|
showUserTool,
|
|
124
129
|
createShowPlanTool(pool),
|
|
125
130
|
showFileTool,
|
|
126
|
-
// Batch literature/biology research (sub-agent as a loop-driving tool).
|
|
127
|
-
createLiteratureReviewerTool({ provider, model, bioKeys, citationResolver, usageRecorder }),
|
|
128
131
|
// Cross-domain analogy generation (sub-agent as a loop-driving tool).
|
|
129
132
|
createGenerateAnalogyReportTool({ provider, model, bioKeys, usageRecorder }),
|
|
130
133
|
// Workspace semantic search + raw read/grep over the read seam.
|
|
@@ -35,7 +35,7 @@ export const REPORT_SESSION_AGENT_ID = "report-session";
|
|
|
35
35
|
* look, record — drives more small tool calls than a conversation turn, thus it
|
|
36
36
|
* gets the headroom of the report runner (REPORT_AGENT_MAX_STEPS).
|
|
37
37
|
*/
|
|
38
|
-
const REPORT_SESSION_MAX_ITERATIONS =
|
|
38
|
+
const REPORT_SESSION_MAX_ITERATIONS = 200;
|
|
39
39
|
/** Build the report `AgentDefinition` with every tool bound to its deps. */
|
|
40
40
|
export function createReportSessionAgent(deps) {
|
|
41
41
|
const { model, pool, embedding, workspaceFs, gateway, resolveWorkspaceRoot, store, threads, chrome, eyes, makeResolver, resolvePageAsset, logger } = deps;
|
|
@@ -15,7 +15,6 @@ export const meta = {
|
|
|
15
15
|
// differently. Declared rather than bolted on, so the resolved roster stays
|
|
16
16
|
// `meta.tools` plus the always-on set.
|
|
17
17
|
tools: [...BASE_SANDBOX_TOOLS, "scanInputs"],
|
|
18
|
-
defaultMaxSteps: 85,
|
|
19
18
|
plannable: false,
|
|
20
19
|
};
|
|
21
20
|
export function createDataProfilerAgent(deps) {
|
|
@@ -26,7 +26,9 @@ export const meta = {
|
|
|
26
26
|
// `single-cell` carries the scirpy reference, which is the route from 10x
|
|
27
27
|
// VDJ / AIRR files to called clonotypes — the input every repertoire metric
|
|
28
28
|
// in `immune-profiling` assumes it already has.
|
|
29
|
-
|
|
29
|
+
// `statistical-modeling` carries the survival-cutpoint correction and the
|
|
30
|
+
// multiplicity rules that the immune-clinical correlation work demands.
|
|
31
|
+
skills: ["immune-profiling", "single-cell", "statistical-modeling", "shared/omics-general"],
|
|
30
32
|
tools: [...BASE_SANDBOX_TOOLS, "pubmed", "searchGene", "lookupAnnotation", "searchInteractions", "searchGeoDatasets", "opentargets"],
|
|
31
33
|
};
|
|
32
34
|
export function createImmuneProfilingAgent(deps) {
|
|
@@ -9,7 +9,6 @@ export const meta = {
|
|
|
9
9
|
suitableFor: ["expression-matrices", "correlation-matrices", "general-omics"],
|
|
10
10
|
skills: ["network-regulatory", "shared/omics-general"],
|
|
11
11
|
tools: [...BASE_SANDBOX_TOOLS, "pubmed", "searchGene", "lookupAnnotation", "searchInteractions"],
|
|
12
|
-
defaultMaxSteps: 35,
|
|
13
12
|
};
|
|
14
13
|
export function createNetworkAgent(deps) {
|
|
15
14
|
return createSandboxAgent(deps, meta, networkAgentPrompt);
|
|
@@ -1,42 +1,67 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Data-profile orientation — the bounded projection of a persisted
|
|
3
|
-
* `DataProfileResult` into
|
|
4
|
-
*
|
|
3
|
+
* `DataProfileResult` into what an agent needs to know WHAT DATASET IT IS HOLDING
|
|
4
|
+
* before it does anything else.
|
|
5
5
|
*
|
|
6
|
-
* The persisted profile is deliberately rich
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
6
|
+
* The persisted profile is deliberately rich because the DB row is its only durable
|
|
7
|
+
* home — the profiler's scratch tree is deleted on completion. That richness is right
|
|
8
|
+
* for a pull-on-demand tool (`inspect_data_profile`) and wrong for anything injected
|
|
9
|
+
* unconditionally into a context window, which is what a step seed does. This is the
|
|
10
|
+
* lossy half of that pair: a hard character budget, a fixed section order, and visible
|
|
11
|
+
* truncation counts, so an agent that needs more knows to go pull it.
|
|
12
|
+
*
|
|
13
|
+
* What is lossy is the PROSE, not the structure. The submission schema bounds every array
|
|
14
|
+
* an agent authors — operations, dimensions, annotations — so the resolved record is small
|
|
15
|
+
* by construction, and a rendering that dropped half the groups to make room for a design
|
|
16
|
+
* note would be discarding the addressable facts to keep the summary of them. Groups
|
|
17
|
+
* therefore render one line each, all of them, each followed by the slots that vary across
|
|
18
|
+
* its members; dimensions and notable files follow; and the design note and the caveats
|
|
19
|
+
* take whatever budget is left. Groups are elided only when one line apiece already
|
|
20
|
+
* overruns the whole budget, and then the count that did not fit is stated outright.
|
|
21
|
+
*
|
|
22
|
+
* The census — kept files, groups, unclassified, quarantined, and whether the scan reached
|
|
23
|
+
* the whole tree — rides in the header on a reserved budget, so no clamp can remove the one
|
|
24
|
+
* line that says how much of the dataset the profile speaks for.
|
|
25
|
+
*
|
|
26
|
+
* Every elision is marked. A section fitted short, a list tail dropped, a prose value
|
|
27
|
+
* clamped: each ends the rendering with {@link ELISION_MARKER}, whose room is reserved
|
|
28
|
+
* before anything else is fitted. A rendering that silently lost a section reads as a
|
|
29
|
+
* profile that never had one.
|
|
13
30
|
*
|
|
14
31
|
* A pure function over the record — no I/O, no LLM, no pipeline. It is the whole
|
|
15
32
|
* mechanism.
|
|
16
33
|
*
|
|
17
|
-
* Every path it renders is projected into the frame-independent
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
34
|
+
* Every path it renders is projected into the frame-independent `/{analysisId}/…`
|
|
35
|
+
* form. The record stores a path relative to the analysis root, which is the correct
|
|
36
|
+
* form to store; but a step agent resolves a relative path against its own working
|
|
37
|
+
* directory, thus the stored form names a file that does not exist there. The absolute
|
|
38
|
+
* form resolves to the same file in every frame, including the conversation agent's, so
|
|
39
|
+
* the projection is unconditional.
|
|
23
40
|
*/
|
|
24
41
|
import type { DataProfileResult } from "../state/data-profile.js";
|
|
25
|
-
/** The character budget the projection guarantees it will not exceed. */
|
|
26
|
-
export declare const DATA_PROFILE_ORIENTATION_MAX_CHARS = 1200;
|
|
27
42
|
/**
|
|
28
|
-
*
|
|
29
|
-
* characters. The bound is a guarantee, not a target: the assembled text is
|
|
30
|
-
* hard-clamped, so no profile — however verbose — can blow a caller's budget.
|
|
43
|
+
* The character budget the projection guarantees it will not exceed.
|
|
31
44
|
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
45
|
+
* Sized from the record's own bounds rather than from a feel for how long a blurb should
|
|
46
|
+
* be: the census header, a group line plus a slots line for each of a submission's worth of
|
|
47
|
+
* groups, the dimension list, the notable files, and a prose tail. A profile past that
|
|
48
|
+
* elides its group tail with a stated count — which is the honest outcome, and a far
|
|
49
|
+
* cheaper one than a briefing that omits the groups an execution agent must address files
|
|
50
|
+
* by.
|
|
51
|
+
*/
|
|
52
|
+
export declare const DATA_PROFILE_ORIENTATION_MAX_CHARS = 6000;
|
|
53
|
+
/**
|
|
54
|
+
* Project a persisted profile into an orientation blurb of at most `maxChars`
|
|
55
|
+
* characters. The bound is a guarantee, not a target: every section is fitted against the
|
|
56
|
+
* remaining budget before it is rendered, so no profile — however verbose — can blow a
|
|
57
|
+
* caller's budget, and nothing the budget removed leaves a half-line behind.
|
|
36
58
|
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
59
|
+
* Section order is fixed: identity, census, groups with their slots, dimensions, the
|
|
60
|
+
* members the agent wrote about individually, the experimental design, then the caveats.
|
|
61
|
+
* The header holds its own reserved budget, so the census survives whatever the body cannot
|
|
62
|
+
* hold, and the prose sits last so that it — and not the structure — is what a clamp
|
|
63
|
+
* reaches first. Each list section states its true total, and the trailing marker states
|
|
64
|
+
* that the budget, rather than a per-section cap, is why something is missing.
|
|
40
65
|
*
|
|
41
66
|
* `analysisId` roots each rendered file path (see the module header). It is the
|
|
42
67
|
* id of the analysis the profile belongs to, and it is what the sandbox mounts
|