@inflexa-ai/harness 0.45.0 → 0.45.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/dist/agents/conversation-agent.d.ts +10 -0
- package/dist/agents/conversation-agent.js +19 -1
- package/dist/agents/sandbox/shared.d.ts +23 -2
- package/dist/agents/sandbox/shared.js +51 -18
- package/dist/agents/sandbox/translational-safety-agent.js +26 -0
- package/dist/agents/sandbox/types.d.ts +24 -1
- package/dist/agents/sandbox-catalog.d.ts +14 -0
- package/dist/agents/sandbox-catalog.js +19 -0
- package/dist/app/approve-plan.d.ts +5 -2
- package/dist/app/approve-plan.js +1 -1
- package/dist/app/chat-turn.js +6 -3
- package/dist/config/environment-stores.d.ts +4 -2
- package/dist/contracts/chat-events.d.ts +12 -2
- package/dist/contracts/chat-events.js +1 -1
- package/dist/contracts/chat-frame.js +6 -2
- package/dist/contracts/index.d.ts +1 -1
- package/dist/contracts/schemas/chat-events.d.ts +25 -0
- package/dist/contracts/schemas/chat-events.js +7 -0
- package/dist/contracts/schemas/chat-parts.d.ts +39 -0
- package/dist/contracts/schemas/chat-parts.js +17 -0
- package/dist/contracts/schemas/index.d.ts +1 -1
- package/dist/contracts/schemas/index.js +1 -1
- package/dist/execution/dbos-workflow-purger.d.ts +2 -0
- package/dist/execution/dbos-workflow-purger.js +21 -14
- package/dist/execution/run-canceler.d.ts +33 -11
- package/dist/execution/run-canceler.js +129 -27
- package/dist/execution/run-end-record.d.ts +30 -0
- package/dist/execution/run-end-record.js +27 -0
- package/dist/index.d.ts +9 -5
- package/dist/index.js +11 -1
- package/dist/loop/call-guard.d.ts +50 -0
- package/dist/loop/call-guard.js +90 -0
- package/dist/loop/compaction.d.ts +5 -0
- package/dist/loop/compaction.js +17 -0
- package/dist/loop/run-agent.d.ts +9 -0
- package/dist/loop/run-agent.js +15 -1
- package/dist/loop/run-to-terminal.js +4 -1
- package/dist/loop/types.d.ts +6 -0
- package/dist/memory/conversation-display-recorder.d.ts +0 -2
- package/dist/memory/conversation-display-recorder.js +28 -3
- package/dist/memory/thread-history.d.ts +34 -7
- package/dist/memory/thread-history.js +151 -42
- package/dist/prompts/briefing.d.ts +57 -3
- package/dist/prompts/briefing.js +129 -2
- package/dist/prompts/planner.js +13 -2
- package/dist/provenance/seam.d.ts +23 -15
- package/dist/provenance/seam.js +7 -5
- package/dist/providers/ai-sdk.js +87 -7
- package/dist/providers/types.d.ts +6 -0
- package/dist/reference-data/catalog.js +141 -2
- package/dist/report-model/authoring-grammar.d.ts +26 -26
- package/dist/sandbox/image-packages.d.ts +26 -4
- package/dist/sandbox/image-packages.js +18 -4
- package/dist/schemas/data-profile-schemas.d.ts +12 -12
- package/dist/schemas/plan-schemas.d.ts +57 -3
- package/dist/schemas/plan-schemas.js +1 -1
- package/dist/schemas/workflow-state.d.ts +113 -0
- package/dist/schemas/workflow-state.js +54 -0
- package/dist/state/artifacts.d.ts +17 -1
- package/dist/state/artifacts.js +21 -3
- package/dist/state/index.d.ts +2 -2
- package/dist/state/index.js +1 -1
- package/dist/state/runs.d.ts +43 -9
- package/dist/state/runs.js +85 -14
- package/dist/state/step-executions.d.ts +9 -0
- package/dist/state/step-executions.js +22 -0
- package/dist/tools/ad-hoc-router.d.ts +2 -0
- package/dist/tools/ad-hoc-router.js +18 -2
- package/dist/tools/capability-data.d.ts +36 -0
- package/dist/tools/capability-data.js +73 -0
- package/dist/tools/execute-analysis.d.ts +37 -9
- package/dist/tools/execute-analysis.js +131 -21
- package/dist/tools/knowledge/check.d.ts +60 -0
- package/dist/tools/knowledge/check.js +92 -0
- package/dist/tools/knowledge/client.d.ts +382 -0
- package/dist/tools/knowledge/client.js +302 -0
- package/dist/tools/knowledge/environment.d.ts +78 -0
- package/dist/tools/knowledge/environment.js +105 -0
- package/dist/tools/knowledge/index.d.ts +49 -0
- package/dist/tools/knowledge/index.js +70 -0
- package/dist/tools/knowledge/local-slots.d.ts +62 -0
- package/dist/tools/knowledge/local-slots.js +177 -0
- package/dist/tools/knowledge/pin.d.ts +14 -0
- package/dist/tools/knowledge/pin.js +17 -0
- package/dist/tools/knowledge/recommend.d.ts +92 -0
- package/dist/tools/knowledge/recommend.js +98 -0
- package/dist/tools/knowledge/situation.d.ts +143 -0
- package/dist/tools/knowledge/situation.js +164 -0
- package/dist/tools/knowledge/skeleton.d.ts +69 -0
- package/dist/tools/knowledge/skeleton.js +202 -0
- package/dist/tools/knowledge/template.d.ts +137 -0
- package/dist/tools/knowledge/template.js +267 -0
- package/dist/tools/research/generate-plan.d.ts +23 -0
- package/dist/tools/research/generate-plan.js +203 -12
- package/dist/tools/research/guarded-address.d.ts +20 -0
- package/dist/tools/research/guarded-address.js +148 -0
- package/dist/tools/research/searxng-engine.d.ts +40 -0
- package/dist/tools/research/searxng-engine.js +120 -0
- package/dist/tools/research/web-fetch.d.ts +124 -0
- package/dist/tools/research/web-fetch.js +627 -0
- package/dist/tools/research/web-search.d.ts +75 -0
- package/dist/tools/research/web-search.js +112 -0
- package/dist/tools/sandbox/list-available-packages.d.ts +7 -4
- package/dist/tools/sandbox/list-available-packages.js +12 -4
- package/dist/tools/sandbox/list-available-refs.d.ts +21 -0
- package/dist/tools/sandbox/list-available-refs.js +60 -3
- package/dist/tools/sandbox/report-blocker.js +5 -1
- package/dist/tools/terminal-text.d.ts +11 -0
- package/dist/tools/terminal-text.js +19 -0
- package/dist/tools/workspace/decision-record.d.ts +81 -0
- package/dist/tools/workspace/decision-record.js +117 -0
- package/dist/tools/workspace/edit-file.d.ts +3 -1
- package/dist/tools/workspace/edit-file.js +20 -2
- package/dist/tools/workspace/execute-command.d.ts +17 -0
- package/dist/tools/workspace/execute-command.js +28 -1
- package/dist/tools/workspace/index.d.ts +1 -0
- package/dist/tools/workspace/index.js +1 -0
- package/dist/tools/workspace/mutator.d.ts +1 -1
- package/dist/workflows/execute-analysis.d.ts +58 -18
- package/dist/workflows/execute-analysis.js +273 -58
- package/dist/workflows/sandbox-step.d.ts +12 -0
- package/package.json +5 -1
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `knowledge_recommend` — one typed situation in, one plan skeleton out.
|
|
3
|
+
*
|
|
4
|
+
* The description is the whole contract with the planner: when to call, what
|
|
5
|
+
* to send, and where the answer goes (the `grounding` field of each method
|
|
6
|
+
* step). No prompt names this tool. Whether a model calls it from the
|
|
7
|
+
* description alone is a Phase 0 measurement.
|
|
8
|
+
*
|
|
9
|
+
* The model receives one representation. The procedure of the service is
|
|
10
|
+
* folded into `plan_skeleton` (the shape `submit_plan` accepts), and the
|
|
11
|
+
* claims ride beside it, cited by id from the steps. The procedure itself
|
|
12
|
+
* stays out of the tool result: the same fact would otherwise reach the
|
|
13
|
+
* model three times, as a procedure step, as a claim view, and as a skeleton
|
|
14
|
+
* step.
|
|
15
|
+
*/
|
|
16
|
+
import type { EnvironmentStorePaths } from "../../config/environment-stores.js";
|
|
17
|
+
import type { KnowledgeClient, KnowledgeRejected, KnowledgeSnapshotMismatch, KnowledgeUnavailable, RecommendResponse } from "./client.js";
|
|
18
|
+
import type { SnapshotPin } from "./pin.js";
|
|
19
|
+
import { type EnvironmentPaths, type RecommendWithEnvironment } from "./environment.js";
|
|
20
|
+
import { type SkeletonStep } from "./skeleton.js";
|
|
21
|
+
export interface KnowledgeRecommendDeps extends Omit<EnvironmentPaths, "farmLockFile"> {
|
|
22
|
+
readonly client: KnowledgeClient;
|
|
23
|
+
/** Host path of the farm `inflexa.lock`, or its resolver for each analysis. Absent, the packages read as unknown. */
|
|
24
|
+
readonly farmLockFile?: EnvironmentStorePaths["farmLockFile"];
|
|
25
|
+
/**
|
|
26
|
+
* Receives each answer the planner sees. The planner keeps the skeleton of
|
|
27
|
+
* the invocation, thus `submit_plan` can restore a grounding field that the
|
|
28
|
+
* model dropped when it copied a skeleton step.
|
|
29
|
+
*/
|
|
30
|
+
readonly onAnswer?: (answer: KnowledgeRecommendAnswer) => void;
|
|
31
|
+
/**
|
|
32
|
+
* The release of the plan. The first answer sets it, and each later call
|
|
33
|
+
* of this tool and of `knowledge_check` sends it, thus a service that moved
|
|
34
|
+
* to another release between two calls refuses instead of mixing releases.
|
|
35
|
+
*/
|
|
36
|
+
readonly pin?: SnapshotPin;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The model-facing answer of the tool: the skeleton and the claims, with the
|
|
40
|
+
* envelope of the service and the environment source. Never the procedure.
|
|
41
|
+
*/
|
|
42
|
+
export interface KnowledgeRecommendAnswer {
|
|
43
|
+
readonly match: RecommendResponse["match"];
|
|
44
|
+
readonly snapshot: RecommendResponse["snapshot"];
|
|
45
|
+
/** The situation as the service normalized it. */
|
|
46
|
+
readonly situation?: Readonly<Record<string, unknown>>;
|
|
47
|
+
readonly flags: RecommendResponse["flags"];
|
|
48
|
+
/** The step types a flag removed. Absent when none. */
|
|
49
|
+
readonly dropped?: readonly string[];
|
|
50
|
+
readonly uncovered: readonly string[];
|
|
51
|
+
/** The step types whose method has no eligible template: covered by the knowledge, not by a vetted script. Absent when none. */
|
|
52
|
+
readonly unrealized?: readonly string[];
|
|
53
|
+
readonly environment_source?: RecommendWithEnvironment["environment_source"];
|
|
54
|
+
readonly plan_skeleton: readonly SkeletonStep[];
|
|
55
|
+
readonly claims: RecommendResponse["claims"];
|
|
56
|
+
readonly nearest?: RecommendResponse["nearest"];
|
|
57
|
+
readonly reason?: string;
|
|
58
|
+
}
|
|
59
|
+
export type KnowledgeRecommendOutput = KnowledgeRecommendAnswer | KnowledgeUnavailable | KnowledgeRejected | KnowledgeSnapshotMismatch;
|
|
60
|
+
/** The one representation: the envelope, the skeleton, and the claims. The procedure stays host-side. */
|
|
61
|
+
export declare function toPlannerAnswer(joined: RecommendWithEnvironment): KnowledgeRecommendAnswer;
|
|
62
|
+
export declare function createKnowledgeRecommendTool(deps: KnowledgeRecommendDeps): import("../define-tool.js").Tool<{
|
|
63
|
+
question: "enrichment" | "differential_expression" | "qc" | "full_plan" | "tf_activity" | "deconvolution" | "coexpression" | "clustering" | "survival" | "signature_scoring";
|
|
64
|
+
modality: "bulk_rna_seq";
|
|
65
|
+
data_state: "fastq" | "counts" | "tpm_or_fpkm" | "log_normalized";
|
|
66
|
+
organism: "other" | "human" | "mouse";
|
|
67
|
+
n_groups: number;
|
|
68
|
+
n_per_group_min: number;
|
|
69
|
+
n_per_group_max: number;
|
|
70
|
+
paired: boolean;
|
|
71
|
+
batch: "none" | "known_balanced" | "known_confounded" | "known_unbalanced" | "suspected";
|
|
72
|
+
count_source?: "unknown" | "salmon" | "kallisto" | "star_featurecounts" | "rsem" | undefined;
|
|
73
|
+
import_state?: "unknown" | "quantifications" | "estimated_counts_with_lengths" | "corrected_counts" | "integer_counts" | undefined;
|
|
74
|
+
n_samples?: number | undefined;
|
|
75
|
+
n_events?: number | undefined;
|
|
76
|
+
blocking_factor?: "other" | "individual" | "cell_line" | "litter" | "site" | "pair" | null | undefined;
|
|
77
|
+
block_structure?: "crossed" | "nested" | undefined;
|
|
78
|
+
covariates?: ("other" | "technical" | "sex" | "age" | "clinical")[] | undefined;
|
|
79
|
+
n_timepoints?: number | null | undefined;
|
|
80
|
+
continuous_predictor?: "other" | "score" | "time" | "age" | "dose" | null | undefined;
|
|
81
|
+
technical_replicates?: boolean | undefined;
|
|
82
|
+
sample_exclusions?: boolean | undefined;
|
|
83
|
+
feature_level?: "gene" | "exon" | "transcript" | undefined;
|
|
84
|
+
library_type?: "unknown" | "total" | "polyA" | "three_prime" | undefined;
|
|
85
|
+
strandedness?: "unknown" | "verified" | "declared_unverified" | undefined;
|
|
86
|
+
interaction?: boolean | undefined;
|
|
87
|
+
classifier?: boolean | undefined;
|
|
88
|
+
extra_analyses?: ("tf_activity" | "deconvolution" | "coexpression" | "clustering" | "survival" | "signature_scoring" | "variance_partition" | "pathway_activity" | "transcript_level" | "annotation")[] | undefined;
|
|
89
|
+
preferred_language?: "R" | "python" | undefined;
|
|
90
|
+
enrichment_input?: "ranked_list" | "gene_list" | "sample_scores" | undefined;
|
|
91
|
+
quality_flags?: ("low_depth_sample" | "outlier_sample" | "sample_identity_doubt" | "high_duplication" | "degraded_rna")[] | undefined;
|
|
92
|
+
}, KnowledgeRecommendOutput>;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `knowledge_recommend` — one typed situation in, one plan skeleton out.
|
|
3
|
+
*
|
|
4
|
+
* The description is the whole contract with the planner: when to call, what
|
|
5
|
+
* to send, and where the answer goes (the `grounding` field of each method
|
|
6
|
+
* step). No prompt names this tool. Whether a model calls it from the
|
|
7
|
+
* description alone is a Phase 0 measurement.
|
|
8
|
+
*
|
|
9
|
+
* The model receives one representation. The procedure of the service is
|
|
10
|
+
* folded into `plan_skeleton` (the shape `submit_plan` accepts), and the
|
|
11
|
+
* claims ride beside it, cited by id from the steps. The procedure itself
|
|
12
|
+
* stays out of the tool result: the same fact would otherwise reach the
|
|
13
|
+
* model three times, as a procedure step, as a claim view, and as a skeleton
|
|
14
|
+
* step.
|
|
15
|
+
*/
|
|
16
|
+
import { ok } from "neverthrow";
|
|
17
|
+
import { defineTool } from "../define-tool.js";
|
|
18
|
+
import { joinEnvironment } from "./environment.js";
|
|
19
|
+
import { SITUATION_EXAMPLE, SituationFieldsSchema, toPreferences, toSituation } from "./situation.js";
|
|
20
|
+
import { buildPlanSkeleton } from "./skeleton.js";
|
|
21
|
+
function isRecord(value) {
|
|
22
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
23
|
+
}
|
|
24
|
+
function stringList(value) {
|
|
25
|
+
return Array.isArray(value) ? value.filter((item) => typeof item === "string") : undefined;
|
|
26
|
+
}
|
|
27
|
+
/** The one representation: the envelope, the skeleton, and the claims. The procedure stays host-side. */
|
|
28
|
+
export function toPlannerAnswer(joined) {
|
|
29
|
+
const dropped = stringList(joined.dropped);
|
|
30
|
+
const unrealized = stringList(joined.unrealized);
|
|
31
|
+
return {
|
|
32
|
+
match: joined.match,
|
|
33
|
+
snapshot: joined.snapshot,
|
|
34
|
+
...(isRecord(joined.situation) ? { situation: joined.situation } : {}),
|
|
35
|
+
flags: joined.flags,
|
|
36
|
+
...(dropped ? { dropped } : {}),
|
|
37
|
+
uncovered: joined.uncovered,
|
|
38
|
+
...(unrealized && unrealized.length > 0 ? { unrealized } : {}),
|
|
39
|
+
...(joined.environment_source ? { environment_source: joined.environment_source } : {}),
|
|
40
|
+
plan_skeleton: buildPlanSkeleton(joined),
|
|
41
|
+
claims: joined.claims,
|
|
42
|
+
...(joined.nearest ? { nearest: joined.nearest } : {}),
|
|
43
|
+
...(joined.reason !== undefined ? { reason: joined.reason } : {}),
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export function createKnowledgeRecommendTool(deps) {
|
|
47
|
+
return defineTool({
|
|
48
|
+
id: "knowledge_recommend",
|
|
49
|
+
description: "Get the cited, versioned procedure for a bulk RNA-seq analysis situation from the Inflexa knowledge service, folded into plan steps: " +
|
|
50
|
+
"which method for each step (QC, filter, normalize, model, test, shrinkage, multiple testing, enrichment, report), " +
|
|
51
|
+
"its settings with their sources, a tested script template per step, the rules that select them, and the evidence. " +
|
|
52
|
+
"Call it BEFORE you draft a method step for bulk RNA-seq differential expression, enrichment, or QC. " +
|
|
53
|
+
"Fill the situation from the Data Context (the design, the replicate counts, the batch structure, the data state, the quality concerns); never send a sample name or a file path. " +
|
|
54
|
+
`Example input: ${SITUATION_EXAMPLE}. ` +
|
|
55
|
+
"The answer holds one representation: `plan_skeleton`, the plan steps with the id, the name, the track, the agent, the packages, the dependencies, " +
|
|
56
|
+
"the caveats, the `alternatives`, the `forbids`, the `disputed` sides, the `environment`, and the `grounding` " +
|
|
57
|
+
"(the status, the snapshot, the claim ids, the template, the `settings`, and the reason) filled. " +
|
|
58
|
+
"`claims` holds one view per claim id the steps cite; cite a claim by its id, and never copy its text into the plan. " +
|
|
59
|
+
"Read the answer this way. `match: applicable`: copy each skeleton step into `submit_plan` as it is, including `grounding.settings`, " +
|
|
60
|
+
"then add the question, the acceptance criteria, the resources, and the step budget from the data profile. " +
|
|
61
|
+
"A skeleton step is the vetted default, not the only permitted method. When the design or the question does not fit its method, plan the step with your method: " +
|
|
62
|
+
"set `grounding.status: ungrounded`, keep the snapshot digest, cite no claim, and give the reason for the departure in `grounding.reason`. A departure the plan states is not a fault; a silent one is. " +
|
|
63
|
+
"`match: flag`: a rule changes the outcome (for example no replication, or a batch confounded with the condition); " +
|
|
64
|
+
"the skeleton step carries `status: flagged`, the rule id in its reason, and the flag message as its first caveat; obey the flag `outcome`. " +
|
|
65
|
+
"`dropped` lists the steps the procedure removed, because a flag removed inference or because the script of the test runs no such step (the shrinkage of limma and edgeR); do not plan them. " +
|
|
66
|
+
"`unrealized` lists the steps whose method has no vetted script template for this design; the skeleton step keeps the method and the claims, its caveat names the gap, " +
|
|
67
|
+
"and the plan states that the step runs without a vetted template instead of an invented one. " +
|
|
68
|
+
"`match: none`: no rule covers the central step; plan that step from your own knowledge with `status: ungrounded` and the reason, and keep the skeleton steps the answer holds. " +
|
|
69
|
+
"`match: unavailable`: the service did not answer; plan as usual and set `status: ungrounded`. " +
|
|
70
|
+
"`match: rejected`: a field was invalid; the answer names the field and the permitted values, so correct the call once. " +
|
|
71
|
+
"A step with `disputed` sides: choose one side and state the choice in the step. " +
|
|
72
|
+
"The `alternatives` of a step are also vetted methods; `forbids` names the method ids the rules forbid for the step, and a forbidden method stays forbidden. " +
|
|
73
|
+
"A caveat is one of: a warn flag; a parameter conflict between two rules (the step omits that parameter, so state the value you choose and both rule ids); " +
|
|
74
|
+
"a substitution (the template runs a substitute of the method of record, and the step method, package, and template are the substitute; the plan states it); " +
|
|
75
|
+
"a language limit (the requested language has no template that realizes the method for this design, or its template refuses a value of the rules; the step keeps the named template, and the plan states the limit). " +
|
|
76
|
+
"A step carries `environment` when the host bound the stores: `package.present` and its version from the packages installed in the sandbox, and `collection.present` with its path in the reference store. " +
|
|
77
|
+
"That is the environment answer; do not call the listing tools for a package or a collection the answer already reports. " +
|
|
78
|
+
"Call it once per situation; a second call with the same situation gives the same answer.",
|
|
79
|
+
inputSchema: SituationFieldsSchema,
|
|
80
|
+
describeCall: ({ question, n_per_group_min, n_per_group_max, batch }) => `${question}: ${n_per_group_min}-${n_per_group_max} per group, batch ${batch}`,
|
|
81
|
+
describeResult: (_input, result) => result.match === "applicable" ? `${result.plan_skeleton.length} steps, ${result.claims.length} claims` : result.match,
|
|
82
|
+
execute: async (input, ctx) => {
|
|
83
|
+
const answer = await deps.client.recommend(toSituation(input), "concise", toPreferences(input), deps.pin?.get());
|
|
84
|
+
if (answer.match === "unavailable" || answer.match === "rejected" || answer.match === "snapshot_mismatch")
|
|
85
|
+
return ok(answer);
|
|
86
|
+
deps.pin?.set(answer.snapshot.digest);
|
|
87
|
+
const farmLockFile = typeof deps.farmLockFile === "function" ? deps.farmLockFile(ctx.session.scope.analysisId) : deps.farmLockFile;
|
|
88
|
+
const joined = await joinEnvironment(answer, {
|
|
89
|
+
...(farmLockFile ? { farmLockFile } : {}),
|
|
90
|
+
...(deps.imagePackagesFile ? { imagePackagesFile: deps.imagePackagesFile } : {}),
|
|
91
|
+
...(deps.refStorePath ? { refStorePath: deps.refStorePath } : {}),
|
|
92
|
+
});
|
|
93
|
+
const planner = toPlannerAnswer(joined);
|
|
94
|
+
deps.onAnswer?.(planner);
|
|
95
|
+
return ok(planner);
|
|
96
|
+
},
|
|
97
|
+
});
|
|
98
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The situation fields as a flat tool input. Each `.describe()` is the whole
|
|
3
|
+
* of what the model knows about a field, thus the descriptions carry the
|
|
4
|
+
* definitions of the terms, and they tell the planner where in the Data
|
|
5
|
+
* Context each value comes from.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
import type { KnowledgeSituation, KnowledgePreferences } from "./client.js";
|
|
9
|
+
export declare const SituationFieldsSchema: z.ZodObject<{
|
|
10
|
+
question: z.ZodEnum<{
|
|
11
|
+
enrichment: "enrichment";
|
|
12
|
+
differential_expression: "differential_expression";
|
|
13
|
+
qc: "qc";
|
|
14
|
+
full_plan: "full_plan";
|
|
15
|
+
tf_activity: "tf_activity";
|
|
16
|
+
deconvolution: "deconvolution";
|
|
17
|
+
coexpression: "coexpression";
|
|
18
|
+
clustering: "clustering";
|
|
19
|
+
survival: "survival";
|
|
20
|
+
signature_scoring: "signature_scoring";
|
|
21
|
+
}>;
|
|
22
|
+
modality: z.ZodLiteral<"bulk_rna_seq">;
|
|
23
|
+
data_state: z.ZodEnum<{
|
|
24
|
+
fastq: "fastq";
|
|
25
|
+
counts: "counts";
|
|
26
|
+
tpm_or_fpkm: "tpm_or_fpkm";
|
|
27
|
+
log_normalized: "log_normalized";
|
|
28
|
+
}>;
|
|
29
|
+
count_source: z.ZodOptional<z.ZodEnum<{
|
|
30
|
+
unknown: "unknown";
|
|
31
|
+
salmon: "salmon";
|
|
32
|
+
kallisto: "kallisto";
|
|
33
|
+
star_featurecounts: "star_featurecounts";
|
|
34
|
+
rsem: "rsem";
|
|
35
|
+
}>>;
|
|
36
|
+
import_state: z.ZodOptional<z.ZodEnum<{
|
|
37
|
+
unknown: "unknown";
|
|
38
|
+
quantifications: "quantifications";
|
|
39
|
+
estimated_counts_with_lengths: "estimated_counts_with_lengths";
|
|
40
|
+
corrected_counts: "corrected_counts";
|
|
41
|
+
integer_counts: "integer_counts";
|
|
42
|
+
}>>;
|
|
43
|
+
organism: z.ZodEnum<{
|
|
44
|
+
other: "other";
|
|
45
|
+
human: "human";
|
|
46
|
+
mouse: "mouse";
|
|
47
|
+
}>;
|
|
48
|
+
n_groups: z.ZodNumber;
|
|
49
|
+
n_per_group_min: z.ZodNumber;
|
|
50
|
+
n_per_group_max: z.ZodNumber;
|
|
51
|
+
n_samples: z.ZodOptional<z.ZodNumber>;
|
|
52
|
+
n_events: z.ZodOptional<z.ZodNumber>;
|
|
53
|
+
paired: z.ZodBoolean;
|
|
54
|
+
blocking_factor: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
55
|
+
other: "other";
|
|
56
|
+
individual: "individual";
|
|
57
|
+
cell_line: "cell_line";
|
|
58
|
+
litter: "litter";
|
|
59
|
+
site: "site";
|
|
60
|
+
pair: "pair";
|
|
61
|
+
}>>>;
|
|
62
|
+
block_structure: z.ZodOptional<z.ZodEnum<{
|
|
63
|
+
crossed: "crossed";
|
|
64
|
+
nested: "nested";
|
|
65
|
+
}>>;
|
|
66
|
+
batch: z.ZodEnum<{
|
|
67
|
+
none: "none";
|
|
68
|
+
known_balanced: "known_balanced";
|
|
69
|
+
known_confounded: "known_confounded";
|
|
70
|
+
known_unbalanced: "known_unbalanced";
|
|
71
|
+
suspected: "suspected";
|
|
72
|
+
}>;
|
|
73
|
+
covariates: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
74
|
+
other: "other";
|
|
75
|
+
technical: "technical";
|
|
76
|
+
sex: "sex";
|
|
77
|
+
age: "age";
|
|
78
|
+
clinical: "clinical";
|
|
79
|
+
}>>>;
|
|
80
|
+
n_timepoints: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
81
|
+
continuous_predictor: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
82
|
+
other: "other";
|
|
83
|
+
score: "score";
|
|
84
|
+
time: "time";
|
|
85
|
+
age: "age";
|
|
86
|
+
dose: "dose";
|
|
87
|
+
}>>>;
|
|
88
|
+
technical_replicates: z.ZodOptional<z.ZodBoolean>;
|
|
89
|
+
sample_exclusions: z.ZodOptional<z.ZodBoolean>;
|
|
90
|
+
feature_level: z.ZodOptional<z.ZodEnum<{
|
|
91
|
+
gene: "gene";
|
|
92
|
+
exon: "exon";
|
|
93
|
+
transcript: "transcript";
|
|
94
|
+
}>>;
|
|
95
|
+
library_type: z.ZodOptional<z.ZodEnum<{
|
|
96
|
+
unknown: "unknown";
|
|
97
|
+
total: "total";
|
|
98
|
+
polyA: "polyA";
|
|
99
|
+
three_prime: "three_prime";
|
|
100
|
+
}>>;
|
|
101
|
+
strandedness: z.ZodOptional<z.ZodEnum<{
|
|
102
|
+
unknown: "unknown";
|
|
103
|
+
verified: "verified";
|
|
104
|
+
declared_unverified: "declared_unverified";
|
|
105
|
+
}>>;
|
|
106
|
+
interaction: z.ZodOptional<z.ZodBoolean>;
|
|
107
|
+
classifier: z.ZodOptional<z.ZodBoolean>;
|
|
108
|
+
extra_analyses: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
109
|
+
tf_activity: "tf_activity";
|
|
110
|
+
deconvolution: "deconvolution";
|
|
111
|
+
coexpression: "coexpression";
|
|
112
|
+
clustering: "clustering";
|
|
113
|
+
survival: "survival";
|
|
114
|
+
signature_scoring: "signature_scoring";
|
|
115
|
+
variance_partition: "variance_partition";
|
|
116
|
+
pathway_activity: "pathway_activity";
|
|
117
|
+
transcript_level: "transcript_level";
|
|
118
|
+
annotation: "annotation";
|
|
119
|
+
}>>>;
|
|
120
|
+
preferred_language: z.ZodOptional<z.ZodEnum<{
|
|
121
|
+
R: "R";
|
|
122
|
+
python: "python";
|
|
123
|
+
}>>;
|
|
124
|
+
enrichment_input: z.ZodOptional<z.ZodEnum<{
|
|
125
|
+
ranked_list: "ranked_list";
|
|
126
|
+
gene_list: "gene_list";
|
|
127
|
+
sample_scores: "sample_scores";
|
|
128
|
+
}>>;
|
|
129
|
+
quality_flags: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
130
|
+
low_depth_sample: "low_depth_sample";
|
|
131
|
+
outlier_sample: "outlier_sample";
|
|
132
|
+
sample_identity_doubt: "sample_identity_doubt";
|
|
133
|
+
high_duplication: "high_duplication";
|
|
134
|
+
degraded_rna: "degraded_rna";
|
|
135
|
+
}>>>;
|
|
136
|
+
}, z.core.$strip>;
|
|
137
|
+
export type SituationFields = z.infer<typeof SituationFieldsSchema>;
|
|
138
|
+
/** The situation as the client sends it: the fields as given, with an absent optional field omitted. */
|
|
139
|
+
export declare function toSituation(fields: SituationFields): KnowledgeSituation;
|
|
140
|
+
/** The preferences of the caller, beside the situation: the language of the template. */
|
|
141
|
+
export declare function toPreferences(fields: SituationFields): KnowledgePreferences | undefined;
|
|
142
|
+
/** One worked example, in the descriptions of the two planner tools. Examples raise complex-parameter accuracy. */
|
|
143
|
+
export declare const SITUATION_EXAMPLE: string;
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The situation fields as a flat tool input. Each `.describe()` is the whole
|
|
3
|
+
* of what the model knows about a field, thus the descriptions carry the
|
|
4
|
+
* definitions of the terms, and they tell the planner where in the Data
|
|
5
|
+
* Context each value comes from.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
export const SituationFieldsSchema = z.object({
|
|
9
|
+
question: z
|
|
10
|
+
.enum([
|
|
11
|
+
"differential_expression",
|
|
12
|
+
"enrichment",
|
|
13
|
+
"qc",
|
|
14
|
+
"full_plan",
|
|
15
|
+
"tf_activity",
|
|
16
|
+
"deconvolution",
|
|
17
|
+
"coexpression",
|
|
18
|
+
"clustering",
|
|
19
|
+
"survival",
|
|
20
|
+
"signature_scoring",
|
|
21
|
+
])
|
|
22
|
+
.describe("What the plan needs a procedure for. `full_plan` returns QC, filtering, the model, the test, shrinkage, multiple testing, enrichment, and the report in one answer. " +
|
|
23
|
+
"Use `differential_expression` when the research question does not ask for pathways or gene sets; an enrichment step the user did not ask for is unasked scope. " +
|
|
24
|
+
"Use `enrichment` when a results table is the input and no new test is fitted, and `qc` when the question stops at the sample structure. " +
|
|
25
|
+
"Use `tf_activity` for regulator or pathway activity, `deconvolution` for cell type proportions, `coexpression` for modules, `clustering` for sample subgroups, `survival` for an outcome association, " +
|
|
26
|
+
"and `signature_scoring` for a per-sample score, or with `classifier: true` for a classifier of the samples."),
|
|
27
|
+
modality: z.literal("bulk_rna_seq").describe("The assay. Phase 0 serves bulk RNA-seq only."),
|
|
28
|
+
data_state: z
|
|
29
|
+
.enum(["fastq", "counts", "tpm_or_fpkm", "log_normalized"])
|
|
30
|
+
.describe("The state of the expression data in the inputs: raw reads, a raw integer count matrix, TPM/FPKM/RPKM abundances, or log-scale normalized values (log-CPM, microarray)."),
|
|
31
|
+
count_source: z
|
|
32
|
+
.enum(["salmon", "kallisto", "star_featurecounts", "rsem", "unknown"])
|
|
33
|
+
.optional()
|
|
34
|
+
.describe("The quantifier that produced the counts, when the profile names one. The quantifier does not establish the length correction; `import_state` does."),
|
|
35
|
+
import_state: z
|
|
36
|
+
.enum(["quantifications", "estimated_counts_with_lengths", "corrected_counts", "integer_counts", "unknown"])
|
|
37
|
+
.optional()
|
|
38
|
+
.describe("The import state of a count table from a transcript quantifier (Salmon, kallisto, RSEM): whether the length correction occurred. Read it from the profile. " +
|
|
39
|
+
"`quantifications`: per-sample quantification files (quant.sf or abundance.h5) or a quantification directory, plus a transcript-to-gene map. " +
|
|
40
|
+
"`estimated_counts_with_lengths`: a fractional gene-by-sample matrix plus a table of average transcript lengths per gene and sample. " +
|
|
41
|
+
"`corrected_counts`: a table described as lengthScaledTPM or scaledTPM counts. " +
|
|
42
|
+
"`integer_counts`: integer counts from an aligner and a counter (STAR, featureCounts) or from a 3' protocol, with no length data. " +
|
|
43
|
+
"`unknown`: a count table from a quantifier with no statement of the correction. Omit when `data_state` is not `counts`."),
|
|
44
|
+
organism: z.enum(["human", "mouse", "other"]).describe("The organism of the samples."),
|
|
45
|
+
n_groups: z
|
|
46
|
+
.number()
|
|
47
|
+
.int()
|
|
48
|
+
.min(1)
|
|
49
|
+
.describe("The number of levels of the condition of interest (2 for a two-group comparison; 4 for a 2x2 design; 1 when `continuous_predictor` names the variable of interest)."),
|
|
50
|
+
n_per_group_min: z
|
|
51
|
+
.number()
|
|
52
|
+
.int()
|
|
53
|
+
.min(1)
|
|
54
|
+
.describe("The smallest number of biological samples in any group, after technical replicates are summed. 1 means a group has no replication. In a time course, the smallest number in one group at one time point. With a nested block, the smallest number of blocks (for example animals) in one group. With a continuous predictor, the number of samples."),
|
|
55
|
+
n_per_group_max: z
|
|
56
|
+
.number()
|
|
57
|
+
.int()
|
|
58
|
+
.min(1)
|
|
59
|
+
.describe("The largest number of biological samples in any group. In a time course, the largest number in one group at one time point. With a nested block, the largest number of blocks in one group. With a continuous predictor, the number of samples."),
|
|
60
|
+
n_samples: z
|
|
61
|
+
.number()
|
|
62
|
+
.int()
|
|
63
|
+
.min(1)
|
|
64
|
+
.optional()
|
|
65
|
+
.describe("The total number of biological samples in the analysis, after technical replicates are summed. Give it whenever the profile states it: the per-group extrema do not give the total for three or more groups, and the rules on a small cohort read it."),
|
|
66
|
+
n_events: z
|
|
67
|
+
.number()
|
|
68
|
+
.int()
|
|
69
|
+
.min(0)
|
|
70
|
+
.optional()
|
|
71
|
+
.describe("For a survival question, the number of samples with an observed event (event indicator 1) in the outcome column. Omit when the question is not survival or the count is not in the profile."),
|
|
72
|
+
paired: z.boolean().describe("True when each subject contributes a sample to more than one condition (paired or repeated measures)."),
|
|
73
|
+
blocking_factor: z
|
|
74
|
+
.enum(["individual", "cell_line", "litter", "site", "pair", "other"])
|
|
75
|
+
.nullable()
|
|
76
|
+
.optional()
|
|
77
|
+
.describe("The role of the blocking factor that is not the condition, never its column name: `individual` when the same subject, donor, or animal gives more than one sample; `cell_line`; `litter`; `site` for a center or a lab of a multi-site study; `pair` for matched pairs of different individuals; `other`. Omit when there is none. The column name stays in the step."),
|
|
78
|
+
block_structure: z
|
|
79
|
+
.enum(["crossed", "nested"])
|
|
80
|
+
.optional()
|
|
81
|
+
.describe("How the blocking factor relates to the condition: `crossed` when each block holds samples of more than one condition (a donor with a treated and a control sample); `nested` when each block lies inside one condition (several samples from one animal of one genotype), thus the block is the unit of replication. Omit when there is no blocking factor."),
|
|
82
|
+
batch: z
|
|
83
|
+
.enum(["none", "known_balanced", "known_confounded", "known_unbalanced", "suspected"])
|
|
84
|
+
.describe("The batch structure: none; a known batch whose levels each hold every condition; a known batch whose levels coincide with the conditions; a known batch whose levels do not each hold every condition but at least one level holds two conditions (estimable, unbalanced); or a suspected structure (dates, lanes, plates) the metadata does not name."),
|
|
85
|
+
covariates: z
|
|
86
|
+
.array(z.enum(["sex", "age", "clinical", "technical", "other"]))
|
|
87
|
+
.optional()
|
|
88
|
+
.describe('The role of each other sample covariate the design must hold, one entry per covariate and never a column name, for example ["sex", "age"]: `clinical` for a stage, a grade, or a diagnosis; `technical` for a variable that is not the batch, for example the RNA integrity. Omit when there are none. The column names stay in the step.'),
|
|
89
|
+
n_timepoints: z.number().int().min(1).nullable().optional().describe("The number of time points when the design is a time course. Omit otherwise."),
|
|
90
|
+
continuous_predictor: z
|
|
91
|
+
.enum(["dose", "time", "age", "score", "other"])
|
|
92
|
+
.nullable()
|
|
93
|
+
.optional()
|
|
94
|
+
.describe("The role of the numeric variable of interest, never its column name, when the research question is a trend over that value and not a comparison of groups: `dose`, `time`, `age`, `score`, or `other`. Then set `n_groups` to 1 and the per-group counts to the number of samples. Omit when the variable of interest is a factor. The column name stays in the step."),
|
|
95
|
+
technical_replicates: z
|
|
96
|
+
.boolean()
|
|
97
|
+
.optional()
|
|
98
|
+
.describe("Set true when some columns of the count table are technical replicates of one biological sample, for example one library sequenced on two lanes or two runs. Omit when each column is one biological sample."),
|
|
99
|
+
sample_exclusions: z
|
|
100
|
+
.boolean()
|
|
101
|
+
.optional()
|
|
102
|
+
.describe("Set true when the plan drops some delivered samples before the analysis, for example an on-treatment biopsy in a pre-treatment cohort or a failed library. The service then adds a cohort assembly step that counts the units per group after the drop, so the plan states no count before that step. Omit when every delivered sample enters the analysis."),
|
|
103
|
+
feature_level: z
|
|
104
|
+
.enum(["gene", "exon", "transcript"])
|
|
105
|
+
.optional()
|
|
106
|
+
.describe("The row unit of the count table: `gene` for one row per gene; `exon` for one row per exon or counting bin with the gene of each row, as featureCounts at the feature level writes it; `transcript` for one row per transcript, as tximport writes with txOut or a quantifier table delivers. Omit for a gene-level table or when `data_state` is not counts."),
|
|
107
|
+
library_type: z.enum(["polyA", "total", "three_prime", "unknown"]).optional().describe("The library preparation, when known."),
|
|
108
|
+
strandedness: z
|
|
109
|
+
.enum(["verified", "declared_unverified", "unknown"])
|
|
110
|
+
.optional()
|
|
111
|
+
.describe("Whether the strandedness was verified against the quantification, declared but not verified, or unknown."),
|
|
112
|
+
interaction: z.boolean().optional().describe("True when the question is the interaction of two factors (for example genotype by treatment)."),
|
|
113
|
+
classifier: z
|
|
114
|
+
.boolean()
|
|
115
|
+
.optional()
|
|
116
|
+
.describe("Set true when the question is a classifier of the samples into classes (a model that predicts the class of a sample from its expression, with cross-validation). Omit for a per-sample score."),
|
|
117
|
+
extra_analyses: z
|
|
118
|
+
.array(z.enum([
|
|
119
|
+
"variance_partition",
|
|
120
|
+
"tf_activity",
|
|
121
|
+
"pathway_activity",
|
|
122
|
+
"signature_scoring",
|
|
123
|
+
"deconvolution",
|
|
124
|
+
"coexpression",
|
|
125
|
+
"clustering",
|
|
126
|
+
"survival",
|
|
127
|
+
"transcript_level",
|
|
128
|
+
"annotation",
|
|
129
|
+
]))
|
|
130
|
+
.optional()
|
|
131
|
+
.describe("Analyses the research question asks for beside the question kind, for example a regulator activity beside a differential expression. Each joins the procedure at its place. " +
|
|
132
|
+
"Add `annotation` when the rows of the count table are not gene symbols (Ensembl or Entrez identifiers) and a later step needs symbols: the identifier map is then a vetted step with its own template, and no other step rebuilds it. Omit when none."),
|
|
133
|
+
preferred_language: z
|
|
134
|
+
.enum(["R", "python"])
|
|
135
|
+
.optional()
|
|
136
|
+
.describe("The script language the user asked for, when the user constraints name one. The answer then names the template in that language when the method has one. Omit otherwise."),
|
|
137
|
+
enrichment_input: z
|
|
138
|
+
.enum(["ranked_list", "gene_list", "sample_scores"])
|
|
139
|
+
.optional()
|
|
140
|
+
.describe("What the enrichment step takes: `ranked_list` for every tested gene ranked by a statistic (the default), `gene_list` for a discrete list such as the significant genes, `sample_scores` for a pathway score per sample. Omit when the question has no enrichment."),
|
|
141
|
+
quality_flags: z
|
|
142
|
+
.array(z.enum(["low_depth_sample", "outlier_sample", "sample_identity_doubt", "high_duplication", "degraded_rna"]))
|
|
143
|
+
.optional()
|
|
144
|
+
.describe("The quality concerns of the profile as typed flags: a sample with a library size far below the median; a sample that does not cluster with its group; a doubt about the identity of a sample; high duplication; degraded RNA (a low RNA integrity number, a 3' coverage bias, or formalin-fixed material)."),
|
|
145
|
+
});
|
|
146
|
+
/** The situation as the client sends it: the fields as given, with an absent optional field omitted. */
|
|
147
|
+
export function toSituation(fields) {
|
|
148
|
+
const situation = {};
|
|
149
|
+
for (const [key, value] of Object.entries(fields)) {
|
|
150
|
+
if (key === "preferred_language")
|
|
151
|
+
continue;
|
|
152
|
+
if (value !== undefined)
|
|
153
|
+
situation[key] = value;
|
|
154
|
+
}
|
|
155
|
+
// The schema above validated every field, thus the record has the shape of the client type.
|
|
156
|
+
return situation;
|
|
157
|
+
}
|
|
158
|
+
/** The preferences of the caller, beside the situation: the language of the template. */
|
|
159
|
+
export function toPreferences(fields) {
|
|
160
|
+
return fields.preferred_language ? { language: fields.preferred_language } : undefined;
|
|
161
|
+
}
|
|
162
|
+
/** One worked example, in the descriptions of the two planner tools. Examples raise complex-parameter accuracy. */
|
|
163
|
+
export const SITUATION_EXAMPLE = '{"question":"differential_expression","modality":"bulk_rna_seq","data_state":"counts","count_source":"salmon","import_state":"unknown","organism":"human",' +
|
|
164
|
+
'"n_groups":2,"n_per_group_min":6,"n_per_group_max":6,"paired":false,"batch":"none","quality_flags":["low_depth_sample"]}';
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The plan skeleton: the procedure of the service folded into the steps of a
|
|
3
|
+
* plan, with the agent, the packages, the dependencies, the caveats, the
|
|
4
|
+
* alternatives, the disputed sides, the forbidden methods, the environment,
|
|
5
|
+
* and the grounding of each step filled from the answer. It is
|
|
6
|
+
* the one representation the planner receives: the procedure itself never
|
|
7
|
+
* reaches the model, thus nothing the procedure holds may be lost here. A
|
|
8
|
+
* small model edits a skeleton where it fails to compose a plan from a
|
|
9
|
+
* procedure; a frontier model pays nothing for it. The skeleton carries only
|
|
10
|
+
* the fields the answer can fill. The question, the acceptance criteria, the
|
|
11
|
+
* resources, and the step budget come from the data profile, and the planner
|
|
12
|
+
* adds them.
|
|
13
|
+
*
|
|
14
|
+
* The fold is fixed: one cohort assembly step when the procedure holds one
|
|
15
|
+
* (the sample exclusions and the sum of technical replicates, before any
|
|
16
|
+
* other step reads the counts), one QC step, one differential expression
|
|
17
|
+
* step that holds the filter, the normalization, the design, the test, the
|
|
18
|
+
* shrinkage, and the multiple testing (the templates cover the same span),
|
|
19
|
+
* one enrichment step on its own track, and one report step. A group with
|
|
20
|
+
* no step in the procedure is absent from the skeleton.
|
|
21
|
+
*
|
|
22
|
+
* The central step of a group names the method of the skeleton step, and it
|
|
23
|
+
* gives the alternatives, the template, and the environment: an alternative
|
|
24
|
+
* of a folded step (a normalization in the differential expression group)
|
|
25
|
+
* is not a permitted replacement of the step method, and it stays out. The
|
|
26
|
+
* settings, the caveats, and the forbidden methods come from every step of
|
|
27
|
+
* the group, each setting with the step it belongs to. A parameter is a
|
|
28
|
+
* setting of the grounding, never a constraint of the step: the value is the
|
|
29
|
+
* vetted default, and the agent can state another value with its reason.
|
|
30
|
+
*/
|
|
31
|
+
import type { GroundingSetting } from "../../schemas/workflow-state.js";
|
|
32
|
+
import type { RecommendWithEnvironment, StepEnvironment } from "./environment.js";
|
|
33
|
+
export interface SkeletonAlternative {
|
|
34
|
+
readonly method: string;
|
|
35
|
+
readonly label: string;
|
|
36
|
+
readonly when: string;
|
|
37
|
+
readonly rules: readonly string[];
|
|
38
|
+
}
|
|
39
|
+
export interface SkeletonStep {
|
|
40
|
+
readonly id: string;
|
|
41
|
+
readonly name: string;
|
|
42
|
+
readonly track: string;
|
|
43
|
+
readonly step_type: string;
|
|
44
|
+
readonly agent: string;
|
|
45
|
+
readonly packages: readonly string[];
|
|
46
|
+
readonly depends_on: readonly string[];
|
|
47
|
+
readonly caveats: readonly string[];
|
|
48
|
+
/** The other permitted methods of the step, from the central procedure step. */
|
|
49
|
+
readonly alternatives: readonly SkeletonAlternative[];
|
|
50
|
+
/** A disputed rule of the group with its sides. The planner chooses one side and states the choice. */
|
|
51
|
+
readonly disputed?: {
|
|
52
|
+
readonly rule: string;
|
|
53
|
+
readonly sides: readonly string[];
|
|
54
|
+
};
|
|
55
|
+
/** The method ids the rules forbid in the steps of the group. */
|
|
56
|
+
readonly forbids: readonly string[];
|
|
57
|
+
/** The environment of the central step, when the host bound the stores: the package in the farm and the collection in the reference store. */
|
|
58
|
+
readonly environment?: StepEnvironment;
|
|
59
|
+
readonly grounding: {
|
|
60
|
+
readonly status: "grounded" | "ungrounded" | "flagged";
|
|
61
|
+
readonly snapshot: string;
|
|
62
|
+
readonly claims: readonly string[];
|
|
63
|
+
readonly template?: string;
|
|
64
|
+
/** One entry per parameter of the procedure steps of the group, with the step it belongs to. */
|
|
65
|
+
readonly settings: readonly GroundingSetting[];
|
|
66
|
+
readonly reason: string;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
export declare function buildPlanSkeleton(answer: RecommendWithEnvironment): SkeletonStep[];
|