@galaxy-tool-util/connection-validation 0.1.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/LICENSE +21 -0
- package/README.md +14 -0
- package/dist/collection-type-functions.d.ts +19 -0
- package/dist/collection-type-functions.d.ts.map +1 -0
- package/dist/collection-type-functions.js +96 -0
- package/dist/collection-type-functions.js.map +1 -0
- package/dist/connection-validator.d.ts +13 -0
- package/dist/connection-validator.d.ts.map +1 -0
- package/dist/connection-validator.js +304 -0
- package/dist/connection-validator.js.map +1 -0
- package/dist/get-tool-info.d.ts +5 -0
- package/dist/get-tool-info.d.ts.map +1 -0
- package/dist/get-tool-info.js +2 -0
- package/dist/get-tool-info.js.map +1 -0
- package/dist/graph-builder.d.ts +10 -0
- package/dist/graph-builder.d.ts.map +1 -0
- package/dist/graph-builder.js +358 -0
- package/dist/graph-builder.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/report-builder.d.ts +15 -0
- package/dist/report-builder.d.ts.map +1 -0
- package/dist/report-builder.js +62 -0
- package/dist/report-builder.js.map +1 -0
- package/dist/topsort.d.ts +7 -0
- package/dist/topsort.d.ts.map +1 -0
- package/dist/topsort.js +47 -0
- package/dist/topsort.js.map +1 -0
- package/dist/types.d.ts +70 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +51 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 John Chilton
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# @galaxy-tool-util/connection-validation
|
|
2
|
+
|
|
3
|
+
Connection validator for Galaxy workflows. Mirrors
|
|
4
|
+
`lib/galaxy/tool_util/workflow_state/connection_validation.py`.
|
|
5
|
+
|
|
6
|
+
Given a normalized native gxformat2 workflow and a `ParsedTool` lookup, walks
|
|
7
|
+
the workflow graph in topological order, validates each connection against
|
|
8
|
+
collection-type algebra (data ↔ collection, map-over, multi-data reduction),
|
|
9
|
+
and produces a structured report whose snake_case keys match Galaxy's
|
|
10
|
+
`ConnectionValidationReport` Pydantic model verbatim.
|
|
11
|
+
|
|
12
|
+
Parameter connections (`gx_text`, `gx_integer`, …) are not validated — Galaxy
|
|
13
|
+
parity. Connections referencing tools that the supplied `getToolInfo` cannot
|
|
14
|
+
resolve are skipped (status `"skip"`) with an explanatory error.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Free-function wrappers around CollectionTypeDescription algebra with NULL/ANY
|
|
3
|
+
* sentinel handling. Mirrors `connection_types.py` module-level functions:
|
|
4
|
+
* can_match, can_map_over, compatible, effective_map_over, is_list_like, collection_type_rank.
|
|
5
|
+
*
|
|
6
|
+
* Logic verified by truth-table tests in
|
|
7
|
+
* `packages/workflow-graph/test/connection-type-cases.test.ts` (91 cases).
|
|
8
|
+
*/
|
|
9
|
+
import { type CollectionTypeDescriptor } from "@galaxy-tool-util/workflow-graph";
|
|
10
|
+
export declare function isNullDesc(d: CollectionTypeDescriptor): boolean;
|
|
11
|
+
export declare function isAnyDesc(d: CollectionTypeDescriptor): boolean;
|
|
12
|
+
export declare function canMatch(output: CollectionTypeDescriptor, input: CollectionTypeDescriptor): boolean;
|
|
13
|
+
export declare function canMapOver(output: CollectionTypeDescriptor, input: CollectionTypeDescriptor): boolean;
|
|
14
|
+
export declare function compatible(a: CollectionTypeDescriptor, b: CollectionTypeDescriptor): boolean;
|
|
15
|
+
export declare function effectiveMapOver(output: CollectionTypeDescriptor, input: CollectionTypeDescriptor): CollectionTypeDescriptor | null;
|
|
16
|
+
export declare function isListLike(d: CollectionTypeDescriptor): boolean;
|
|
17
|
+
export declare function collectionTypeRank(d: CollectionTypeDescriptor): number;
|
|
18
|
+
export declare function describe(token: string | null | undefined): CollectionTypeDescriptor;
|
|
19
|
+
//# sourceMappingURL=collection-type-functions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collection-type-functions.d.ts","sourceRoot":"","sources":["../src/collection-type-functions.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAIL,KAAK,wBAAwB,EAC9B,MAAM,kCAAkC,CAAC;AAE1C,wBAAgB,UAAU,CAAC,CAAC,EAAE,wBAAwB,GAAG,OAAO,CAE/D;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,wBAAwB,GAAG,OAAO,CAE9D;AAQD,wBAAgB,QAAQ,CACtB,MAAM,EAAE,wBAAwB,EAChC,KAAK,EAAE,wBAAwB,GAC9B,OAAO,CAQT;AAED,wBAAgB,UAAU,CACxB,MAAM,EAAE,wBAAwB,EAChC,KAAK,EAAE,wBAAwB,GAC9B,OAAO,CAQT;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,wBAAwB,EAAE,CAAC,EAAE,wBAAwB,GAAG,OAAO,CAK5F;AAED,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,wBAAwB,EAChC,KAAK,EAAE,wBAAwB,GAC9B,wBAAwB,GAAG,IAAI,CAcjC;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,wBAAwB,GAAG,OAAO,CAS/D;AAED,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,wBAAwB,GAAG,MAAM,CAEtE;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,wBAAwB,CAInF"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Free-function wrappers around CollectionTypeDescription algebra with NULL/ANY
|
|
3
|
+
* sentinel handling. Mirrors `connection_types.py` module-level functions:
|
|
4
|
+
* can_match, can_map_over, compatible, effective_map_over, is_list_like, collection_type_rank.
|
|
5
|
+
*
|
|
6
|
+
* Logic verified by truth-table tests in
|
|
7
|
+
* `packages/workflow-graph/test/connection-type-cases.test.ts` (91 cases).
|
|
8
|
+
*/
|
|
9
|
+
import { ANY_COLLECTION_TYPE_DESCRIPTION, CollectionTypeDescription, NULL_COLLECTION_TYPE_DESCRIPTION, } from "@galaxy-tool-util/workflow-graph";
|
|
10
|
+
export function isNullDesc(d) {
|
|
11
|
+
return d === NULL_COLLECTION_TYPE_DESCRIPTION;
|
|
12
|
+
}
|
|
13
|
+
export function isAnyDesc(d) {
|
|
14
|
+
return d === ANY_COLLECTION_TYPE_DESCRIPTION;
|
|
15
|
+
}
|
|
16
|
+
function splitVariants(d) {
|
|
17
|
+
const ct = d.collectionType;
|
|
18
|
+
if (!ct || !ct.includes(","))
|
|
19
|
+
return [d];
|
|
20
|
+
return ct.split(",").map((t) => new CollectionTypeDescription(t.trim()));
|
|
21
|
+
}
|
|
22
|
+
export function canMatch(output, input) {
|
|
23
|
+
if (isNullDesc(output) || isNullDesc(input))
|
|
24
|
+
return false;
|
|
25
|
+
if (isAnyDesc(input))
|
|
26
|
+
return !isNullDesc(output);
|
|
27
|
+
if (isAnyDesc(output))
|
|
28
|
+
return false;
|
|
29
|
+
for (const variant of splitVariants(input)) {
|
|
30
|
+
if (variant.accepts(output))
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
export function canMapOver(output, input) {
|
|
36
|
+
if (isNullDesc(output) || isAnyDesc(output))
|
|
37
|
+
return false;
|
|
38
|
+
if (isAnyDesc(input))
|
|
39
|
+
return false;
|
|
40
|
+
if (isNullDesc(input))
|
|
41
|
+
return true;
|
|
42
|
+
for (const variant of splitVariants(input)) {
|
|
43
|
+
if (output.canMapOver(variant))
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
export function compatible(a, b) {
|
|
49
|
+
if (isNullDesc(a) && isNullDesc(b))
|
|
50
|
+
return true;
|
|
51
|
+
if (isNullDesc(a) || isNullDesc(b))
|
|
52
|
+
return false;
|
|
53
|
+
if (isAnyDesc(a) || isAnyDesc(b))
|
|
54
|
+
return true;
|
|
55
|
+
return a.compatible(b);
|
|
56
|
+
}
|
|
57
|
+
export function effectiveMapOver(output, input) {
|
|
58
|
+
if (!canMapOver(output, input))
|
|
59
|
+
return null;
|
|
60
|
+
if (isNullDesc(input)) {
|
|
61
|
+
if (output instanceof CollectionTypeDescription) {
|
|
62
|
+
return new CollectionTypeDescription(output.collectionType);
|
|
63
|
+
}
|
|
64
|
+
return output;
|
|
65
|
+
}
|
|
66
|
+
for (const variant of splitVariants(input)) {
|
|
67
|
+
if (output.canMapOver(variant)) {
|
|
68
|
+
return output.effectiveMapOver(variant);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
export function isListLike(d) {
|
|
74
|
+
if (!d.isCollection)
|
|
75
|
+
return false;
|
|
76
|
+
if (isAnyDesc(d))
|
|
77
|
+
return false;
|
|
78
|
+
let ct = d.collectionType;
|
|
79
|
+
if (!ct)
|
|
80
|
+
return false;
|
|
81
|
+
if (ct.startsWith("sample_sheet")) {
|
|
82
|
+
ct = "list" + ct.slice("sample_sheet".length);
|
|
83
|
+
}
|
|
84
|
+
return ct === "list" || ct.startsWith("list:");
|
|
85
|
+
}
|
|
86
|
+
export function collectionTypeRank(d) {
|
|
87
|
+
return d.rank;
|
|
88
|
+
}
|
|
89
|
+
export function describe(token) {
|
|
90
|
+
if (token == null || token === "NULL")
|
|
91
|
+
return NULL_COLLECTION_TYPE_DESCRIPTION;
|
|
92
|
+
if (token === "ANY")
|
|
93
|
+
return ANY_COLLECTION_TYPE_DESCRIPTION;
|
|
94
|
+
return new CollectionTypeDescription(token);
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=collection-type-functions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collection-type-functions.js","sourceRoot":"","sources":["../src/collection-type-functions.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,+BAA+B,EAC/B,yBAAyB,EACzB,gCAAgC,GAEjC,MAAM,kCAAkC,CAAC;AAE1C,MAAM,UAAU,UAAU,CAAC,CAA2B;IACpD,OAAO,CAAC,KAAK,gCAAgC,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,CAA2B;IACnD,OAAO,CAAC,KAAK,+BAA+B,CAAC;AAC/C,CAAC;AAED,SAAS,aAAa,CAAC,CAA2B;IAChD,MAAM,EAAE,GAAG,CAAC,CAAC,cAAc,CAAC;IAC5B,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,QA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,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IAChD,CAAC;IACD,OAAO,EAAE,KAAK,MAAM,IAAI,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,CAA2B;IAC5D,OAAO,CAAC,CAAC,IAAI,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,KAAgC;IACvD,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,MAAM;QAAE,OAAO,gCAAgC,CAAC;IAC/E,IAAI,KAAK,KAAK,KAAK;QAAE,OAAO,+BAA+B,CAAC;IAC5D,OAAO,IAAI,yBAAyB,CAAC,KAAK,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Connection validation engine. Mirrors `connection_validation.py`.
|
|
3
|
+
*
|
|
4
|
+
* Walks a typed workflow graph in topological order, validating each
|
|
5
|
+
* connection against collection-type algebra. Produces a structured result
|
|
6
|
+
* plus the resolved-output-type map (used by subworkflow recursion and
|
|
7
|
+
* report building).
|
|
8
|
+
*/
|
|
9
|
+
import type { GetToolInfo } from "./get-tool-info.js";
|
|
10
|
+
import type { StepOutputTypeMap, WorkflowConnectionResult, WorkflowGraph } from "./types.js";
|
|
11
|
+
export declare function validateConnections(workflow: unknown, getToolInfo: GetToolInfo): WorkflowConnectionResult;
|
|
12
|
+
export declare function validateConnectionGraph(graph: WorkflowGraph, seedOutputTypes?: StepOutputTypeMap): [WorkflowConnectionResult, StepOutputTypeMap];
|
|
13
|
+
//# sourceMappingURL=connection-validator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection-validator.d.ts","sourceRoot":"","sources":["../src/connection-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAmBH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAOV,iBAAiB,EACjB,wBAAwB,EACxB,aAAa,EACd,MAAM,YAAY,CAAC;AAEpB,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,OAAO,EACjB,WAAW,EAAE,WAAW,GACvB,wBAAwB,CAI1B;AAED,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,aAAa,EACpB,eAAe,CAAC,EAAE,iBAAiB,GAClC,CAAC,wBAAwB,EAAE,iBAAiB,CAAC,CA+E/C"}
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Connection validation engine. Mirrors `connection_validation.py`.
|
|
3
|
+
*
|
|
4
|
+
* Walks a typed workflow graph in topological order, validating each
|
|
5
|
+
* connection against collection-type algebra. Produces a structured result
|
|
6
|
+
* plus the resolved-output-type map (used by subworkflow recursion and
|
|
7
|
+
* report building).
|
|
8
|
+
*/
|
|
9
|
+
import { ANY_COLLECTION_TYPE_DESCRIPTION, CollectionTypeDescription, NULL_COLLECTION_TYPE_DESCRIPTION, } from "@galaxy-tool-util/workflow-graph";
|
|
10
|
+
import { canMatch, collectionTypeRank, compatible, effectiveMapOver, isAnyDesc, isListLike, isNullDesc, } from "./collection-type-functions.js";
|
|
11
|
+
import { buildWorkflowGraph } from "./graph-builder.js";
|
|
12
|
+
export function validateConnections(workflow, getToolInfo) {
|
|
13
|
+
const graph = buildWorkflowGraph(workflow, getToolInfo);
|
|
14
|
+
const [result] = validateConnectionGraph(graph);
|
|
15
|
+
return result;
|
|
16
|
+
}
|
|
17
|
+
export function validateConnectionGraph(graph, seedOutputTypes) {
|
|
18
|
+
const resolvedOutputTypes = {};
|
|
19
|
+
for (const [stepId, step] of Object.entries(graph.steps)) {
|
|
20
|
+
resolvedOutputTypes[stepId] = {};
|
|
21
|
+
for (const [outputName, output] of Object.entries(step.outputs)) {
|
|
22
|
+
resolvedOutputTypes[stepId][outputName] = _outputToType(output);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (seedOutputTypes) {
|
|
26
|
+
for (const [stepId, outputs] of Object.entries(seedOutputTypes)) {
|
|
27
|
+
if (resolvedOutputTypes[stepId]) {
|
|
28
|
+
Object.assign(resolvedOutputTypes[stepId], outputs);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
const stepResults = [];
|
|
33
|
+
for (const stepId of graph.sortedStepIds) {
|
|
34
|
+
const step = graph.steps[stepId];
|
|
35
|
+
const stepResult = {
|
|
36
|
+
stepId,
|
|
37
|
+
toolId: step.toolId,
|
|
38
|
+
toolVersion: step.toolVersion,
|
|
39
|
+
stepType: step.stepType,
|
|
40
|
+
mapOver: null,
|
|
41
|
+
connections: [],
|
|
42
|
+
errors: [],
|
|
43
|
+
};
|
|
44
|
+
if (Object.keys(step.connections).length === 0) {
|
|
45
|
+
stepResults.push(stepResult);
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
const mapOverContributions = [];
|
|
49
|
+
for (const [inputPath, refs] of Object.entries(step.connections)) {
|
|
50
|
+
for (const ref of refs) {
|
|
51
|
+
const connResult = _validateSingleConnection(ref.sourceStep, ref.outputName, stepId, inputPath, step.inputs[inputPath], resolvedOutputTypes);
|
|
52
|
+
stepResult.connections.push(connResult);
|
|
53
|
+
if (connResult.status === "ok" && connResult.mapping) {
|
|
54
|
+
mapOverContributions.push(new CollectionTypeDescription(connResult.mapping));
|
|
55
|
+
}
|
|
56
|
+
else if (connResult.status === "ok" || connResult.status === "skip") {
|
|
57
|
+
mapOverContributions.push(null);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
const stepMapOver = _resolveStepMapOver(mapOverContributions, stepResult);
|
|
62
|
+
if (stepMapOver) {
|
|
63
|
+
stepResult.mapOver = stepMapOver.collectionType;
|
|
64
|
+
}
|
|
65
|
+
if (step.stepType === "subworkflow" && step.innerGraph) {
|
|
66
|
+
_resolveSubworkflowOutputs(step, resolvedOutputTypes);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
_resolveOutputTypes(step, stepMapOver, resolvedOutputTypes);
|
|
70
|
+
}
|
|
71
|
+
stepResults.push(stepResult);
|
|
72
|
+
}
|
|
73
|
+
const result = {
|
|
74
|
+
stepResults,
|
|
75
|
+
valid: _isValid(stepResults),
|
|
76
|
+
summary: _summary(stepResults),
|
|
77
|
+
};
|
|
78
|
+
return [result, resolvedOutputTypes];
|
|
79
|
+
}
|
|
80
|
+
function _isValid(stepResults) {
|
|
81
|
+
for (const sr of stepResults) {
|
|
82
|
+
if (sr.errors.length > 0)
|
|
83
|
+
return false;
|
|
84
|
+
for (const cr of sr.connections) {
|
|
85
|
+
if (cr.status === "invalid")
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return true;
|
|
90
|
+
}
|
|
91
|
+
function _summary(stepResults) {
|
|
92
|
+
const counts = { ok: 0, invalid: 0, skip: 0 };
|
|
93
|
+
for (const sr of stepResults) {
|
|
94
|
+
for (const cr of sr.connections) {
|
|
95
|
+
counts[cr.status] = (counts[cr.status] ?? 0) + 1;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return counts;
|
|
99
|
+
}
|
|
100
|
+
function _validateSingleConnection(sourceStep, sourceOutput, targetStep, targetInput, targetResolvedInput, resolvedOutputTypes) {
|
|
101
|
+
const sourceTypes = resolvedOutputTypes[sourceStep] ?? {};
|
|
102
|
+
const sourceType = sourceTypes[sourceOutput];
|
|
103
|
+
if (sourceType === undefined) {
|
|
104
|
+
return {
|
|
105
|
+
sourceStep,
|
|
106
|
+
sourceOutput,
|
|
107
|
+
targetStep,
|
|
108
|
+
targetInput,
|
|
109
|
+
status: "skip",
|
|
110
|
+
errors: [`Cannot resolve output '${sourceOutput}' on step ${sourceStep}`],
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
if (targetResolvedInput === undefined) {
|
|
114
|
+
return {
|
|
115
|
+
sourceStep,
|
|
116
|
+
sourceOutput,
|
|
117
|
+
targetStep,
|
|
118
|
+
targetInput,
|
|
119
|
+
status: "skip",
|
|
120
|
+
errors: [`Cannot resolve input '${targetInput}' on step ${targetStep}`],
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
const targetType = _inputToType(targetResolvedInput);
|
|
124
|
+
const ok = (mapping) => ({
|
|
125
|
+
sourceStep,
|
|
126
|
+
sourceOutput,
|
|
127
|
+
targetStep,
|
|
128
|
+
targetInput,
|
|
129
|
+
status: "ok",
|
|
130
|
+
mapping: mapping ?? null,
|
|
131
|
+
errors: [],
|
|
132
|
+
});
|
|
133
|
+
if (isNullDesc(sourceType)) {
|
|
134
|
+
if (isNullDesc(targetType))
|
|
135
|
+
return ok();
|
|
136
|
+
// dataset -> collection: fall through to invalid
|
|
137
|
+
}
|
|
138
|
+
else if (isAnyDesc(sourceType)) {
|
|
139
|
+
return {
|
|
140
|
+
sourceStep,
|
|
141
|
+
sourceOutput,
|
|
142
|
+
targetStep,
|
|
143
|
+
targetInput,
|
|
144
|
+
status: "skip",
|
|
145
|
+
errors: [`Cannot determine output type for '${sourceOutput}' on step ${sourceStep}`],
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
// Source is a real collection type.
|
|
150
|
+
// Multi-data reduction: list-like -> data(multiple=True)
|
|
151
|
+
if (targetResolvedInput.multiple && targetResolvedInput.type === "data") {
|
|
152
|
+
if (sourceType instanceof CollectionTypeDescription && isListLike(sourceType)) {
|
|
153
|
+
const innerList = new CollectionTypeDescription("list");
|
|
154
|
+
if (sourceType.canMapOver(innerList)) {
|
|
155
|
+
const remaining = sourceType.effectiveMapOver(innerList);
|
|
156
|
+
return ok(remaining.collectionType);
|
|
157
|
+
}
|
|
158
|
+
return ok();
|
|
159
|
+
}
|
|
160
|
+
// Non-list-like: fall through to can_match / map_over
|
|
161
|
+
}
|
|
162
|
+
if (canMatch(sourceType, targetType))
|
|
163
|
+
return ok();
|
|
164
|
+
const mapOver = effectiveMapOver(sourceType, targetType);
|
|
165
|
+
if (mapOver !== null)
|
|
166
|
+
return ok(mapOver.collectionType);
|
|
167
|
+
}
|
|
168
|
+
return {
|
|
169
|
+
sourceStep,
|
|
170
|
+
sourceOutput,
|
|
171
|
+
targetStep,
|
|
172
|
+
targetInput,
|
|
173
|
+
status: "invalid",
|
|
174
|
+
errors: [
|
|
175
|
+
`Incompatible types: output is ${_typeDescription(sourceType)}, input expects ${_typeDescription(targetType)}`,
|
|
176
|
+
],
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
function _resolveStepMapOver(contributions, stepResult) {
|
|
180
|
+
const nonNone = contributions.filter((c) => c !== null);
|
|
181
|
+
if (nonNone.length === 0)
|
|
182
|
+
return null;
|
|
183
|
+
let best = nonNone[0];
|
|
184
|
+
for (let i = 1; i < nonNone.length; i++) {
|
|
185
|
+
const ctd = nonNone[i];
|
|
186
|
+
if (!compatible(best, ctd)) {
|
|
187
|
+
stepResult.errors.push(`Incompatible map-over types: ${best.collectionType} vs ${ctd.collectionType}`);
|
|
188
|
+
return best;
|
|
189
|
+
}
|
|
190
|
+
if (collectionTypeRank(ctd) > collectionTypeRank(best)) {
|
|
191
|
+
best = ctd;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
return best;
|
|
195
|
+
}
|
|
196
|
+
function _resolveOutputTypes(step, mapOver, resolvedOutputTypes) {
|
|
197
|
+
for (const [outputName, output] of Object.entries(step.outputs)) {
|
|
198
|
+
if (output.type === "collection") {
|
|
199
|
+
const baseType = _resolveCollectionOutputType(step, output, resolvedOutputTypes, mapOver);
|
|
200
|
+
if (baseType && mapOver) {
|
|
201
|
+
const combined = `${mapOver.collectionType}:${baseType}`;
|
|
202
|
+
resolvedOutputTypes[step.stepId][outputName] = new CollectionTypeDescription(combined);
|
|
203
|
+
}
|
|
204
|
+
else if (baseType) {
|
|
205
|
+
resolvedOutputTypes[step.stepId][outputName] = new CollectionTypeDescription(baseType);
|
|
206
|
+
}
|
|
207
|
+
// else: leave initialized (ANY_COLLECTION_TYPE)
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
if (mapOver) {
|
|
211
|
+
resolvedOutputTypes[step.stepId][outputName] = new CollectionTypeDescription(mapOver.collectionType ?? "list");
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
resolvedOutputTypes[step.stepId][outputName] = NULL_COLLECTION_TYPE_DESCRIPTION;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
function _resolveCollectionOutputType(step, output, resolvedOutputTypes, mapOver) {
|
|
220
|
+
if (output.collectionType)
|
|
221
|
+
return output.collectionType;
|
|
222
|
+
const sourceParam = output.collectionTypeSource ?? output.structuredLike;
|
|
223
|
+
if (sourceParam) {
|
|
224
|
+
return _resolveCollectionTypeSource(step, sourceParam, resolvedOutputTypes, mapOver);
|
|
225
|
+
}
|
|
226
|
+
return null;
|
|
227
|
+
}
|
|
228
|
+
function _resolveCollectionTypeSource(step, sourceParam, resolvedOutputTypes, mapOver) {
|
|
229
|
+
const refs = step.connections[sourceParam] ?? [];
|
|
230
|
+
if (refs.length === 0)
|
|
231
|
+
return null;
|
|
232
|
+
const ref = refs[0];
|
|
233
|
+
const sourceTypes = resolvedOutputTypes[ref.sourceStep] ?? {};
|
|
234
|
+
const sourceType = sourceTypes[ref.outputName];
|
|
235
|
+
if (sourceType === undefined || isNullDesc(sourceType) || isAnyDesc(sourceType)) {
|
|
236
|
+
return null;
|
|
237
|
+
}
|
|
238
|
+
if (!(sourceType instanceof CollectionTypeDescription))
|
|
239
|
+
return null;
|
|
240
|
+
let ct = sourceType.collectionType ?? "";
|
|
241
|
+
if (mapOver) {
|
|
242
|
+
const prefix = `${mapOver.collectionType}:`;
|
|
243
|
+
if (ct.startsWith(prefix)) {
|
|
244
|
+
ct = ct.slice(prefix.length);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
return ct || null;
|
|
248
|
+
}
|
|
249
|
+
function _resolveSubworkflowOutputs(step, resolvedOutputTypes) {
|
|
250
|
+
const innerGraph = step.innerGraph;
|
|
251
|
+
if (!innerGraph)
|
|
252
|
+
return;
|
|
253
|
+
const seed = {};
|
|
254
|
+
for (const refs of Object.values(step.connections)) {
|
|
255
|
+
for (const ref of refs) {
|
|
256
|
+
const innerStepId = ref.inputSubworkflowStepId;
|
|
257
|
+
if (!innerStepId)
|
|
258
|
+
continue;
|
|
259
|
+
const outerType = resolvedOutputTypes[ref.sourceStep]?.[ref.outputName];
|
|
260
|
+
if (outerType !== undefined && innerStepId in innerGraph.steps) {
|
|
261
|
+
if (!seed[innerStepId])
|
|
262
|
+
seed[innerStepId] = {};
|
|
263
|
+
seed[innerStepId].output = outerType;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
const [, innerResolved] = validateConnectionGraph(innerGraph, seed);
|
|
268
|
+
if (!resolvedOutputTypes[step.stepId])
|
|
269
|
+
resolvedOutputTypes[step.stepId] = {};
|
|
270
|
+
for (const [externalName, [innerStepId, innerOutputName]] of Object.entries(step.subworkflowOutputMap)) {
|
|
271
|
+
const innerType = innerResolved[innerStepId]?.[innerOutputName];
|
|
272
|
+
if (innerType !== undefined) {
|
|
273
|
+
resolvedOutputTypes[step.stepId][externalName] = innerType;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
function _outputToType(output) {
|
|
278
|
+
if (output.type === "collection") {
|
|
279
|
+
if (output.collectionType) {
|
|
280
|
+
return new CollectionTypeDescription(output.collectionType);
|
|
281
|
+
}
|
|
282
|
+
return ANY_COLLECTION_TYPE_DESCRIPTION;
|
|
283
|
+
}
|
|
284
|
+
return NULL_COLLECTION_TYPE_DESCRIPTION;
|
|
285
|
+
}
|
|
286
|
+
function _inputToType(input) {
|
|
287
|
+
if (input.type === "collection") {
|
|
288
|
+
if (input.collectionType) {
|
|
289
|
+
return new CollectionTypeDescription(input.collectionType);
|
|
290
|
+
}
|
|
291
|
+
return ANY_COLLECTION_TYPE_DESCRIPTION;
|
|
292
|
+
}
|
|
293
|
+
return NULL_COLLECTION_TYPE_DESCRIPTION;
|
|
294
|
+
}
|
|
295
|
+
function _typeDescription(t) {
|
|
296
|
+
if (isNullDesc(t))
|
|
297
|
+
return "dataset";
|
|
298
|
+
if (isAnyDesc(t))
|
|
299
|
+
return "collection (any type)";
|
|
300
|
+
if (t instanceof CollectionTypeDescription)
|
|
301
|
+
return `collection<${t.collectionType}>`;
|
|
302
|
+
return "unknown";
|
|
303
|
+
}
|
|
304
|
+
//# sourceMappingURL=connection-validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection-validator.js","sourceRoot":"","sources":["../src/connection-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,+BAA+B,EAC/B,yBAAyB,EACzB,gCAAgC,GAEjC,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EACL,QAAQ,EACR,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAChB,SAAS,EACT,UAAU,EACV,UAAU,GACX,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAcxD,MAAM,UAAU,mBAAmB,CACjC,QAAiB,EACjB,WAAwB;IAExB,MAAM,KAAK,GAAG,kBAAkB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;IACxD,MAAM,CAAC,MAAM,CAAC,GAAG,uBAAuB,CAAC,KAAK,CAAC,CAAC;IAChD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,uBAAuB,CACrC,KAAoB,EACpB,eAAmC;IAEnC,MAAM,mBAAmB,GAAsB,EAAE,CAAC;IAElD,KAAK,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;QACzD,mBAAmB,CAAC,MAAM,CAAC,GAAG,EA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["../src/get-tool-info.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE3D,MAAM,WAAW,WAAW;IAC1B,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,UAAU,GAAG,SAAS,CAAC;CAClF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-tool-info.js","sourceRoot":"","sources":["../src/get-tool-info.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow graph builder. Mirrors `connection_graph.py:build_workflow_graph`.
|
|
3
|
+
*
|
|
4
|
+
* Walks a normalized native workflow, resolves step types, extracts typed
|
|
5
|
+
* inputs/outputs from `ParsedTool` definitions, and topologically orders steps.
|
|
6
|
+
*/
|
|
7
|
+
import type { GetToolInfo } from "./get-tool-info.js";
|
|
8
|
+
import type { WorkflowGraph } from "./types.js";
|
|
9
|
+
export declare function buildWorkflowGraph(workflow: unknown, getToolInfo: GetToolInfo): WorkflowGraph;
|
|
10
|
+
//# sourceMappingURL=graph-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-builder.d.ts","sourceRoot":"","sources":["../src/graph-builder.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAOV,aAAa,EACd,MAAM,YAAY,CAAC;AAkBpB,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,GAAG,aAAa,CAG7F"}
|
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow graph builder. Mirrors `connection_graph.py:build_workflow_graph`.
|
|
3
|
+
*
|
|
4
|
+
* Walks a normalized native workflow, resolves step types, extracts typed
|
|
5
|
+
* inputs/outputs from `ParsedTool` definitions, and topologically orders steps.
|
|
6
|
+
*/
|
|
7
|
+
import { normalizedNative } from "@galaxy-tool-util/schema";
|
|
8
|
+
import { toNative } from "@galaxy-tool-util/schema";
|
|
9
|
+
import { topsort } from "./topsort.js";
|
|
10
|
+
const PARAMETER_INPUT_TYPES = new Set([
|
|
11
|
+
"gx_text",
|
|
12
|
+
"gx_integer",
|
|
13
|
+
"gx_float",
|
|
14
|
+
"gx_boolean",
|
|
15
|
+
"gx_color",
|
|
16
|
+
"gx_select",
|
|
17
|
+
]);
|
|
18
|
+
export function buildWorkflowGraph(workflow, getToolInfo) {
|
|
19
|
+
const native = _coerceNormalizedNative(workflow);
|
|
20
|
+
return _buildFromNormalized(native, getToolInfo);
|
|
21
|
+
}
|
|
22
|
+
function _coerceNormalizedNative(workflow) {
|
|
23
|
+
if (workflow == null || typeof workflow !== "object") {
|
|
24
|
+
throw new Error("buildWorkflowGraph: workflow must be an object");
|
|
25
|
+
}
|
|
26
|
+
const obj = workflow;
|
|
27
|
+
if (obj.class === "GalaxyWorkflow") {
|
|
28
|
+
return toNative(obj);
|
|
29
|
+
}
|
|
30
|
+
// Already native-shaped (raw .ga or already normalized).
|
|
31
|
+
return normalizedNative(obj);
|
|
32
|
+
}
|
|
33
|
+
function _buildFromNormalized(workflow, getToolInfo) {
|
|
34
|
+
const steps = {};
|
|
35
|
+
for (const [stepId, step] of Object.entries(workflow.steps)) {
|
|
36
|
+
steps[stepId] = _resolveStep(stepId, step, getToolInfo);
|
|
37
|
+
}
|
|
38
|
+
const sorted = _topologicalSort(steps);
|
|
39
|
+
return { steps, sortedStepIds: sorted };
|
|
40
|
+
}
|
|
41
|
+
function _resolveStep(stepId, step, getToolInfo) {
|
|
42
|
+
const stepType = step.type ?? "tool";
|
|
43
|
+
if (stepType === "data_input" ||
|
|
44
|
+
stepType === "data_collection_input" ||
|
|
45
|
+
stepType === "parameter_input") {
|
|
46
|
+
return _resolveInputStep(stepId, step, stepType);
|
|
47
|
+
}
|
|
48
|
+
if (stepType === "tool") {
|
|
49
|
+
return _resolveToolStep(stepId, step, getToolInfo);
|
|
50
|
+
}
|
|
51
|
+
if (stepType === "subworkflow") {
|
|
52
|
+
return _resolveSubworkflowStep(stepId, step, getToolInfo);
|
|
53
|
+
}
|
|
54
|
+
return _emptyStep(stepId, null, stepType);
|
|
55
|
+
}
|
|
56
|
+
function _emptyStep(stepId, toolId, stepType) {
|
|
57
|
+
return {
|
|
58
|
+
stepId,
|
|
59
|
+
toolId,
|
|
60
|
+
stepType,
|
|
61
|
+
inputs: {},
|
|
62
|
+
outputs: {},
|
|
63
|
+
connections: {},
|
|
64
|
+
subworkflowOutputMap: {},
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
function _resolveInputStep(stepId, step, stepType) {
|
|
68
|
+
const toolState = step.tool_state ?? {};
|
|
69
|
+
if (stepType === "data_input") {
|
|
70
|
+
return {
|
|
71
|
+
..._emptyStep(stepId, null, stepType),
|
|
72
|
+
outputs: { output: { name: "output", type: "data" } },
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
if (stepType === "data_collection_input") {
|
|
76
|
+
const collectionType = toolState.collection_type ?? "list";
|
|
77
|
+
return {
|
|
78
|
+
..._emptyStep(stepId, null, stepType),
|
|
79
|
+
outputs: {
|
|
80
|
+
output: { name: "output", type: "collection", collectionType },
|
|
81
|
+
},
|
|
82
|
+
declaredCollectionType: collectionType,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
// parameter_input
|
|
86
|
+
const paramType = toolState.parameter_type ?? "text";
|
|
87
|
+
return {
|
|
88
|
+
..._emptyStep(stepId, null, stepType),
|
|
89
|
+
outputs: {
|
|
90
|
+
output: {
|
|
91
|
+
name: "output",
|
|
92
|
+
type: paramType,
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
function _resolveToolStep(stepId, step, getToolInfo) {
|
|
98
|
+
const connections = _parseConnections(step);
|
|
99
|
+
let inputs = {};
|
|
100
|
+
let outputs = {};
|
|
101
|
+
if (step.tool_id) {
|
|
102
|
+
const parsed = getToolInfo.getToolInfo(step.tool_id, step.tool_version);
|
|
103
|
+
if (parsed) {
|
|
104
|
+
inputs = _collectInputs(parsed.inputs, step.tool_state ?? {});
|
|
105
|
+
outputs = _collectOutputs(parsed.outputs);
|
|
106
|
+
// Python additionally calls _resolve_rules_collection_types here to
|
|
107
|
+
// populate `collection_type` from a RuleSet mapping when the output
|
|
108
|
+
// declares `collection_type_from_rules`. RuleSet (galaxy.util.rules_dsl)
|
|
109
|
+
// is not yet ported — affected outputs stay unresolved (ANY) instead of
|
|
110
|
+
// gaining a concrete type. Outputs without rules-driven types behave
|
|
111
|
+
// identically to Python.
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (step.when && "when" in connections) {
|
|
115
|
+
inputs.when = { name: "when", statePath: "when", type: "boolean" };
|
|
116
|
+
}
|
|
117
|
+
return {
|
|
118
|
+
stepId,
|
|
119
|
+
toolId: step.tool_id ?? null,
|
|
120
|
+
toolVersion: step.tool_version ?? null,
|
|
121
|
+
stepType: "tool",
|
|
122
|
+
inputs,
|
|
123
|
+
outputs,
|
|
124
|
+
connections,
|
|
125
|
+
subworkflowOutputMap: {},
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
function _resolveSubworkflowStep(stepId, step, getToolInfo) {
|
|
129
|
+
const connections = _parseConnections(step);
|
|
130
|
+
let innerGraph;
|
|
131
|
+
let outputMap = {};
|
|
132
|
+
let inputs = {};
|
|
133
|
+
if (step.subworkflow != null) {
|
|
134
|
+
innerGraph = _buildFromNormalized(step.subworkflow, getToolInfo);
|
|
135
|
+
outputMap = _buildSubworkflowOutputMap(step.subworkflow);
|
|
136
|
+
inputs = _synthesizeSubworkflowInputs(connections, innerGraph);
|
|
137
|
+
}
|
|
138
|
+
if (step.when && "when" in connections) {
|
|
139
|
+
inputs.when = { name: "when", statePath: "when", type: "boolean" };
|
|
140
|
+
}
|
|
141
|
+
return {
|
|
142
|
+
stepId,
|
|
143
|
+
toolId: null,
|
|
144
|
+
stepType: "subworkflow",
|
|
145
|
+
inputs,
|
|
146
|
+
outputs: {},
|
|
147
|
+
connections,
|
|
148
|
+
innerGraph,
|
|
149
|
+
subworkflowOutputMap: outputMap,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
function _synthesizeSubworkflowInputs(connections, innerGraph) {
|
|
153
|
+
const inputs = {};
|
|
154
|
+
for (const [inputPath, refs] of Object.entries(connections)) {
|
|
155
|
+
for (const ref of refs) {
|
|
156
|
+
const innerId = ref.inputSubworkflowStepId;
|
|
157
|
+
if (innerId && innerId in innerGraph.steps) {
|
|
158
|
+
const innerStep = innerGraph.steps[innerId];
|
|
159
|
+
inputs[inputPath] = _inputFromInnerStep(innerStep, inputPath);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
return inputs;
|
|
164
|
+
}
|
|
165
|
+
function _inputFromInnerStep(innerStep, inputPath) {
|
|
166
|
+
if (innerStep.stepType === "data_collection_input") {
|
|
167
|
+
return {
|
|
168
|
+
name: inputPath,
|
|
169
|
+
statePath: inputPath,
|
|
170
|
+
type: "collection",
|
|
171
|
+
collectionType: innerStep.declaredCollectionType ?? null,
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
if (innerStep.stepType === "data_input") {
|
|
175
|
+
return { name: inputPath, statePath: inputPath, type: "data" };
|
|
176
|
+
}
|
|
177
|
+
if (innerStep.stepType === "parameter_input") {
|
|
178
|
+
const innerOutput = innerStep.outputs.output;
|
|
179
|
+
const paramType = (innerOutput?.type ?? "text");
|
|
180
|
+
return { name: inputPath, statePath: inputPath, type: paramType };
|
|
181
|
+
}
|
|
182
|
+
return { name: inputPath, statePath: inputPath, type: "data" };
|
|
183
|
+
}
|
|
184
|
+
function _buildSubworkflowOutputMap(subworkflow) {
|
|
185
|
+
const result = {};
|
|
186
|
+
for (const [stepId, step] of Object.entries(subworkflow.steps)) {
|
|
187
|
+
for (const wo of step.workflow_outputs ?? []) {
|
|
188
|
+
if (!wo.output_name)
|
|
189
|
+
continue;
|
|
190
|
+
const externalName = wo.label || `${stepId}:${wo.output_name}`;
|
|
191
|
+
result[externalName] = [stepId, wo.output_name];
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
return result;
|
|
195
|
+
}
|
|
196
|
+
function _parseConnections(step) {
|
|
197
|
+
const result = {};
|
|
198
|
+
for (const [statePath, raw] of Object.entries(step.input_connections ?? {})) {
|
|
199
|
+
const conns = raw;
|
|
200
|
+
const refs = [];
|
|
201
|
+
for (const conn of conns) {
|
|
202
|
+
const subwfId = conn.input_subworkflow_step_id;
|
|
203
|
+
refs.push({
|
|
204
|
+
sourceStep: String(conn.id),
|
|
205
|
+
outputName: conn.output_name,
|
|
206
|
+
inputSubworkflowStepId: subwfId !== null && subwfId !== undefined ? String(subwfId) : undefined,
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
if (refs.length > 0)
|
|
210
|
+
result[statePath] = refs;
|
|
211
|
+
}
|
|
212
|
+
return result;
|
|
213
|
+
}
|
|
214
|
+
function _collectInputs(params, toolState, prefix) {
|
|
215
|
+
const result = {};
|
|
216
|
+
for (const param of params) {
|
|
217
|
+
const name = param.name;
|
|
218
|
+
const statePath = prefix == null ? name : `${prefix}|${name}`;
|
|
219
|
+
if (param.parameter_type === "gx_data") {
|
|
220
|
+
result[statePath] = {
|
|
221
|
+
name,
|
|
222
|
+
statePath,
|
|
223
|
+
type: "data",
|
|
224
|
+
multiple: param.multiple ?? false,
|
|
225
|
+
optional: param.optional ?? false,
|
|
226
|
+
extensions: [...(param.extensions ?? ["data"])],
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
else if (param.parameter_type === "gx_data_collection") {
|
|
230
|
+
result[statePath] = {
|
|
231
|
+
name,
|
|
232
|
+
statePath,
|
|
233
|
+
type: "collection",
|
|
234
|
+
collectionType: param.collection_type ?? null,
|
|
235
|
+
optional: param.optional ?? false,
|
|
236
|
+
extensions: [...(param.extensions ?? ["data"])],
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
else if (PARAMETER_INPUT_TYPES.has(param.parameter_type)) {
|
|
240
|
+
const paramType = param.parameter_type.slice(3);
|
|
241
|
+
result[statePath] = { name, statePath, type: paramType };
|
|
242
|
+
}
|
|
243
|
+
else if (param.parameter_type === "gx_conditional") {
|
|
244
|
+
const cond = param;
|
|
245
|
+
const condState = _asRecord(toolState[name]);
|
|
246
|
+
const targetWhen = _selectWhich(cond, condState);
|
|
247
|
+
if (targetWhen) {
|
|
248
|
+
Object.assign(result, _collectInputs(targetWhen.parameters, condState, statePath));
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
for (const when of cond.whens) {
|
|
252
|
+
Object.assign(result, _collectInputs(when.parameters, condState, statePath));
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
else if (param.parameter_type === "gx_repeat") {
|
|
257
|
+
const innerParams = (param.parameters ?? []);
|
|
258
|
+
const repeatVal = toolState[name];
|
|
259
|
+
const instances = Array.isArray(repeatVal) ? repeatVal : [];
|
|
260
|
+
if (instances.length > 0) {
|
|
261
|
+
for (let idx = 0; idx < instances.length; idx++) {
|
|
262
|
+
const instance = _asRecord(instances[idx]);
|
|
263
|
+
const indexedPrefix = prefix == null ? `${name}_${idx}` : `${prefix}|${name}_${idx}`;
|
|
264
|
+
Object.assign(result, _collectInputs(innerParams, instance, indexedPrefix));
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
else {
|
|
268
|
+
Object.assign(result, _collectInputs(innerParams, {}, statePath));
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
else if (param.parameter_type === "gx_section") {
|
|
272
|
+
const sectionState = _asRecord(toolState[name]);
|
|
273
|
+
const innerParams = (param.parameters ?? []);
|
|
274
|
+
Object.assign(result, _collectInputs(innerParams, sectionState, statePath));
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
return result;
|
|
278
|
+
}
|
|
279
|
+
function _asRecord(v) {
|
|
280
|
+
if (v != null && typeof v === "object" && !Array.isArray(v)) {
|
|
281
|
+
return v;
|
|
282
|
+
}
|
|
283
|
+
return {};
|
|
284
|
+
}
|
|
285
|
+
function _selectWhich(cond, state) {
|
|
286
|
+
const testName = cond.test_parameter.name;
|
|
287
|
+
const testValueRaw = state[testName];
|
|
288
|
+
const testValue = testValueRaw === undefined || testValueRaw === null ? null : testValueRaw;
|
|
289
|
+
if (testValue !== null) {
|
|
290
|
+
for (const when of cond.whens) {
|
|
291
|
+
if (_discriminatorMatches(testValue, when.discriminator)) {
|
|
292
|
+
return when;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
for (const when of cond.whens) {
|
|
297
|
+
if (when.is_default_when)
|
|
298
|
+
return when;
|
|
299
|
+
}
|
|
300
|
+
return null;
|
|
301
|
+
}
|
|
302
|
+
function _discriminatorMatches(value, discriminator) {
|
|
303
|
+
if (typeof discriminator === "boolean" && typeof value === "boolean") {
|
|
304
|
+
return discriminator === value;
|
|
305
|
+
}
|
|
306
|
+
return String(value) === String(discriminator);
|
|
307
|
+
}
|
|
308
|
+
function _collectOutputs(rawOutputs) {
|
|
309
|
+
const result = {};
|
|
310
|
+
for (const raw of rawOutputs) {
|
|
311
|
+
if (!raw || typeof raw !== "object")
|
|
312
|
+
continue;
|
|
313
|
+
const o = raw;
|
|
314
|
+
const name = o.name;
|
|
315
|
+
if (!name)
|
|
316
|
+
continue;
|
|
317
|
+
const type = o.type;
|
|
318
|
+
if (type === "data") {
|
|
319
|
+
result[name] = {
|
|
320
|
+
name,
|
|
321
|
+
type: "data",
|
|
322
|
+
format: o.format ?? null,
|
|
323
|
+
formatSource: o.format_source ?? null,
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
else if (type === "collection") {
|
|
327
|
+
const structure = (o.structure ?? {});
|
|
328
|
+
result[name] = {
|
|
329
|
+
name,
|
|
330
|
+
type: "collection",
|
|
331
|
+
collectionType: structure.collection_type ?? null,
|
|
332
|
+
collectionTypeSource: structure.collection_type_source ?? null,
|
|
333
|
+
collectionTypeFromRules: structure.collection_type_from_rules ?? null,
|
|
334
|
+
structuredLike: structure.structured_like ?? null,
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
else if (type === "text" || type === "integer" || type === "float" || type === "boolean") {
|
|
338
|
+
result[name] = { name, type };
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
return result;
|
|
342
|
+
}
|
|
343
|
+
function _topologicalSort(steps) {
|
|
344
|
+
const allIds = new Set(Object.keys(steps));
|
|
345
|
+
const pairs = [];
|
|
346
|
+
for (const [stepId, step] of Object.entries(steps)) {
|
|
347
|
+
pairs.push([stepId, stepId]);
|
|
348
|
+
for (const refs of Object.values(step.connections)) {
|
|
349
|
+
for (const ref of refs) {
|
|
350
|
+
if (allIds.has(ref.sourceStep)) {
|
|
351
|
+
pairs.push([ref.sourceStep, stepId]);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
return topsort(pairs);
|
|
357
|
+
}
|
|
358
|
+
//# sourceMappingURL=graph-builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-builder.js","sourceRoot":"","sources":["../src/graph-builder.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAcpD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,qBAAqB,GAAwB,IAAI,GAAG,CAAC;IACzD,SAAS;IACT,YAAY;IACZ,UAAU;IACV,YAAY;IACZ,UAAU;IACV,WAAW;CACZ,CAAC,CAAC;AAQH,MAAM,UAAU,kBAAkB,CAAC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,IAAI,IAAI,EAAE,CAAC;gBACvB,IAAI,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;oBAC/B,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;gBACvC,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;AACxB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type { ConnectionRef, ResolvedInput, ResolvedInputType, ResolvedOutput, ResolvedOutputDataType, ResolvedStep, WorkflowGraph, ConnectionStatus, ConnectionValidationResult, StepConnectionResult, WorkflowConnectionResult, StepOutputTypeMap, } from "./types.js";
|
|
2
|
+
export { buildWorkflowGraph } from "./graph-builder.js";
|
|
3
|
+
export { validateConnections, validateConnectionGraph } from "./connection-validator.js";
|
|
4
|
+
export { validateConnectionsReport, toConnectionValidationReport } from "./report-builder.js";
|
|
5
|
+
export type { ConnectionValidationReport, ConnectionStepResult, ConnectionResult, ResolvedOutputType, } from "@galaxy-tool-util/schema";
|
|
6
|
+
export type { GetToolInfo } from "./get-tool-info.js";
|
|
7
|
+
export { canMatch, canMapOver, compatible, effectiveMapOver, isListLike, collectionTypeRank, isNullDesc, isAnyDesc, describe as describeCollectionType, } from "./collection-type-functions.js";
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,sBAAsB,EACtB,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,0BAA0B,EAC1B,oBAAoB,EACpB,wBAAwB,EACxB,iBAAiB,GAClB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACzF,OAAO,EAAE,yBAAyB,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAC9F,YAAY,EACV,0BAA0B,EAC1B,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EACL,QAAQ,EACR,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,kBAAkB,EAClB,UAAU,EACV,SAAS,EACT,QAAQ,IAAI,sBAAsB,GACnC,MAAM,gCAAgC,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { buildWorkflowGraph } from "./graph-builder.js";
|
|
2
|
+
export { validateConnections, validateConnectionGraph } from "./connection-validator.js";
|
|
3
|
+
export { validateConnectionsReport, toConnectionValidationReport } from "./report-builder.js";
|
|
4
|
+
export { canMatch, canMapOver, compatible, effectiveMapOver, isListLike, collectionTypeRank, isNullDesc, isAnyDesc, describe as describeCollectionType, } from "./collection-type-functions.js";
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACzF,OAAO,EAAE,yBAAyB,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAQ9F,OAAO,EACL,QAAQ,EACR,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,kBAAkB,EAClB,UAAU,EACV,SAAS,EACT,QAAQ,IAAI,sBAAsB,GACnC,MAAM,gCAAgC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert internal camelCase result + resolved-type map into the
|
|
3
|
+
* snake_case `ConnectionValidationReport` whose shape matches Galaxy's
|
|
4
|
+
* Pydantic model verbatim.
|
|
5
|
+
*
|
|
6
|
+
* Snake_case is the public contract here — `dictVerifyEach` walks this
|
|
7
|
+
* report directly with no further translation. Do not rename or omit
|
|
8
|
+
* fields without updating Python parity.
|
|
9
|
+
*/
|
|
10
|
+
import type { ConnectionValidationReport } from "@galaxy-tool-util/schema";
|
|
11
|
+
import type { GetToolInfo } from "./get-tool-info.js";
|
|
12
|
+
import type { StepOutputTypeMap, WorkflowConnectionResult } from "./types.js";
|
|
13
|
+
export declare function validateConnectionsReport(workflow: unknown, getToolInfo: GetToolInfo): ConnectionValidationReport;
|
|
14
|
+
export declare function toConnectionValidationReport(result: WorkflowConnectionResult, resolvedOutputTypes: StepOutputTypeMap): ConnectionValidationReport;
|
|
15
|
+
//# sourceMappingURL=report-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report-builder.d.ts","sourceRoot":"","sources":["../src/report-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAQH,OAAO,KAAK,EAGV,0BAA0B,EAE3B,MAAM,0BAA0B,CAAC;AAGlC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAE9E,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,OAAO,EACjB,WAAW,EAAE,WAAW,GACvB,0BAA0B,CAI5B;AAED,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,wBAAwB,EAChC,mBAAmB,EAAE,iBAAiB,GACrC,0BAA0B,CAoC5B"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert internal camelCase result + resolved-type map into the
|
|
3
|
+
* snake_case `ConnectionValidationReport` whose shape matches Galaxy's
|
|
4
|
+
* Pydantic model verbatim.
|
|
5
|
+
*
|
|
6
|
+
* Snake_case is the public contract here — `dictVerifyEach` walks this
|
|
7
|
+
* report directly with no further translation. Do not rename or omit
|
|
8
|
+
* fields without updating Python parity.
|
|
9
|
+
*/
|
|
10
|
+
import { ANY_COLLECTION_TYPE_DESCRIPTION, CollectionTypeDescription, NULL_COLLECTION_TYPE_DESCRIPTION, } from "@galaxy-tool-util/workflow-graph";
|
|
11
|
+
import { buildWorkflowGraph } from "./graph-builder.js";
|
|
12
|
+
import { validateConnectionGraph } from "./connection-validator.js";
|
|
13
|
+
export function validateConnectionsReport(workflow, getToolInfo) {
|
|
14
|
+
const graph = buildWorkflowGraph(workflow, getToolInfo);
|
|
15
|
+
const [result, resolved] = validateConnectionGraph(graph);
|
|
16
|
+
return toConnectionValidationReport(result, resolved);
|
|
17
|
+
}
|
|
18
|
+
export function toConnectionValidationReport(result, resolvedOutputTypes) {
|
|
19
|
+
const stepResults = result.stepResults.map((sr) => {
|
|
20
|
+
const connections = sr.connections.map((cr) => ({
|
|
21
|
+
source_step: cr.sourceStep,
|
|
22
|
+
source_output: cr.sourceOutput,
|
|
23
|
+
target_step: cr.targetStep,
|
|
24
|
+
target_input: cr.targetInput,
|
|
25
|
+
status: cr.status,
|
|
26
|
+
mapping: cr.mapping ?? null,
|
|
27
|
+
errors: cr.errors,
|
|
28
|
+
}));
|
|
29
|
+
const stepOutputs = resolvedOutputTypes[sr.stepId] ?? {};
|
|
30
|
+
const resolved_outputs = Object.entries(stepOutputs).map(([name, t]) => ({
|
|
31
|
+
name,
|
|
32
|
+
collection_type: _sentinelToCollectionType(t),
|
|
33
|
+
}));
|
|
34
|
+
return {
|
|
35
|
+
step: sr.stepId,
|
|
36
|
+
tool_id: sr.toolId ?? null,
|
|
37
|
+
version: sr.toolVersion ?? null,
|
|
38
|
+
step_type: sr.stepType,
|
|
39
|
+
map_over: sr.mapOver ?? null,
|
|
40
|
+
connections,
|
|
41
|
+
resolved_outputs,
|
|
42
|
+
errors: sr.errors,
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
const has_details = stepResults.some((sr) => sr.connections.length > 0 || sr.errors.length > 0);
|
|
46
|
+
return {
|
|
47
|
+
valid: result.valid,
|
|
48
|
+
step_results: stepResults,
|
|
49
|
+
summary: result.summary,
|
|
50
|
+
has_details,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function _sentinelToCollectionType(t) {
|
|
54
|
+
if (t === NULL_COLLECTION_TYPE_DESCRIPTION)
|
|
55
|
+
return null;
|
|
56
|
+
if (t === ANY_COLLECTION_TYPE_DESCRIPTION)
|
|
57
|
+
return null;
|
|
58
|
+
if (t instanceof CollectionTypeDescription)
|
|
59
|
+
return t.collectionType;
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=report-builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report-builder.js","sourceRoot":"","sources":["../src/report-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,+BAA+B,EAC/B,yBAAyB,EACzB,gCAAgC,GAEjC,MAAM,kCAAkC,CAAC;AAQ1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAGpE,MAAM,UAAU,yBAAyB,CACvC,QAAiB,EACjB,WAAwB;IAExB,MAAM,KAAK,GAAG,kBAAkB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;IACxD,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,uBAAuB,CAAC,KAAK,CAAC,CAAC;IAC1D,OAAO,4BAA4B,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AACxD,CAAC;AAED,MAAM,UAAU,4BAA4B,CAC1C,MAAgC,EAChC,mBAAsC;IAE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AAI,EAAE,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAEhG,OAAO;QACL,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,YAAY,EAAE,WAAW;QACzB,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,WAAW;KACZ,CAAC;AACJ,CAAC;AAED,SAAS,yBAAyB,CAAC,CAA2B;IAC5D,IAAI,CAAC,KAAK,gCAAgC;QAAE,OAAO,IAAI,CAAC;IACxD,IAAI,CAAC,KAAK,+BAA+B;QAAE,OAAO,IAAI,CAAC;IACvD,IAAI,CAAC,YAAY,yBAAyB;QAAE,OAAO,CAAC,CAAC,cAAc,CAAC;IACpE,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kahn's-algorithm topological sort over (predecessor, successor) pairs.
|
|
3
|
+
* Self-pairs (a, a) keep nodes that have no real edges in the result.
|
|
4
|
+
* Mirrors galaxy.util.topsort semantics for our purposes.
|
|
5
|
+
*/
|
|
6
|
+
export declare function topsort(pairs: Array<[string, string]>): string[];
|
|
7
|
+
//# sourceMappingURL=topsort.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"topsort.d.ts","sourceRoot":"","sources":["../src/topsort.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,EAAE,CAsChE"}
|
package/dist/topsort.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kahn's-algorithm topological sort over (predecessor, successor) pairs.
|
|
3
|
+
* Self-pairs (a, a) keep nodes that have no real edges in the result.
|
|
4
|
+
* Mirrors galaxy.util.topsort semantics for our purposes.
|
|
5
|
+
*/
|
|
6
|
+
export function topsort(pairs) {
|
|
7
|
+
const nodes = new Set();
|
|
8
|
+
const successors = new Map();
|
|
9
|
+
const indegree = new Map();
|
|
10
|
+
for (const [a, b] of pairs) {
|
|
11
|
+
nodes.add(a);
|
|
12
|
+
nodes.add(b);
|
|
13
|
+
if (!successors.has(a))
|
|
14
|
+
successors.set(a, new Set());
|
|
15
|
+
if (!indegree.has(a))
|
|
16
|
+
indegree.set(a, 0);
|
|
17
|
+
if (!indegree.has(b))
|
|
18
|
+
indegree.set(b, 0);
|
|
19
|
+
if (a === b)
|
|
20
|
+
continue;
|
|
21
|
+
if (!successors.get(a).has(b)) {
|
|
22
|
+
successors.get(a).add(b);
|
|
23
|
+
indegree.set(b, (indegree.get(b) ?? 0) + 1);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
const queue = [];
|
|
27
|
+
for (const n of nodes) {
|
|
28
|
+
if ((indegree.get(n) ?? 0) === 0)
|
|
29
|
+
queue.push(n);
|
|
30
|
+
}
|
|
31
|
+
const result = [];
|
|
32
|
+
while (queue.length > 0) {
|
|
33
|
+
const n = queue.shift();
|
|
34
|
+
result.push(n);
|
|
35
|
+
for (const m of successors.get(n) ?? []) {
|
|
36
|
+
const d = (indegree.get(m) ?? 0) - 1;
|
|
37
|
+
indegree.set(m, d);
|
|
38
|
+
if (d === 0)
|
|
39
|
+
queue.push(m);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (result.length !== nodes.size) {
|
|
43
|
+
throw new Error("topological sort: cycle detected");
|
|
44
|
+
}
|
|
45
|
+
return result;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=topsort.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"topsort.js","sourceRoot":"","sources":["../src/topsort.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,OAAO,CAAC,KAA8B;IACpD,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAChC,MAAM,UAAU,GAA6B,IAAI,GAAG,EAAE,CAAC;IACvD,MAAM,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M,GAAG,CAAC,EAAE,CAAC;QACxB,MAAM,CAAC,GAAG,KAAK,CAAC,KAAK,EAAG,CAAC;QACzB,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACf,KAAK,MAAM,CAAC,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;YACxC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;YACrC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YACnB,IAAI,CAAC,KAAK,CAAC;gBAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC;IAED,IAAI,MAAM,CAAC,MAAM,KAAK,KAAK,CAAC,IAAI,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IACtD,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { CollectionTypeDescriptor } from "@galaxy-tool-util/workflow-graph";
|
|
2
|
+
export interface ConnectionRef {
|
|
3
|
+
sourceStep: string;
|
|
4
|
+
outputName: string;
|
|
5
|
+
inputSubworkflowStepId?: string;
|
|
6
|
+
}
|
|
7
|
+
export type ResolvedInputType = "data" | "collection" | "text" | "integer" | "float" | "boolean" | "color" | "select";
|
|
8
|
+
export interface ResolvedInput {
|
|
9
|
+
name: string;
|
|
10
|
+
statePath: string;
|
|
11
|
+
type: ResolvedInputType;
|
|
12
|
+
collectionType?: string | null;
|
|
13
|
+
multiple?: boolean;
|
|
14
|
+
optional?: boolean;
|
|
15
|
+
extensions?: string[];
|
|
16
|
+
}
|
|
17
|
+
export type ResolvedOutputDataType = "data" | "collection" | "text" | "integer" | "float" | "boolean";
|
|
18
|
+
export interface ResolvedOutput {
|
|
19
|
+
name: string;
|
|
20
|
+
type: ResolvedOutputDataType;
|
|
21
|
+
collectionType?: string | null;
|
|
22
|
+
collectionTypeSource?: string | null;
|
|
23
|
+
collectionTypeFromRules?: string | null;
|
|
24
|
+
structuredLike?: string | null;
|
|
25
|
+
format?: string | null;
|
|
26
|
+
formatSource?: string | null;
|
|
27
|
+
}
|
|
28
|
+
export interface ResolvedStep {
|
|
29
|
+
stepId: string;
|
|
30
|
+
toolId?: string | null;
|
|
31
|
+
toolVersion?: string | null;
|
|
32
|
+
stepType: string;
|
|
33
|
+
inputs: Record<string, ResolvedInput>;
|
|
34
|
+
outputs: Record<string, ResolvedOutput>;
|
|
35
|
+
connections: Record<string, ConnectionRef[]>;
|
|
36
|
+
declaredCollectionType?: string | null;
|
|
37
|
+
innerGraph?: WorkflowGraph;
|
|
38
|
+
subworkflowOutputMap: Record<string, [string, string]>;
|
|
39
|
+
}
|
|
40
|
+
export interface WorkflowGraph {
|
|
41
|
+
steps: Record<string, ResolvedStep>;
|
|
42
|
+
sortedStepIds: string[];
|
|
43
|
+
}
|
|
44
|
+
export type ConnectionStatus = "ok" | "invalid" | "skip";
|
|
45
|
+
export interface ConnectionValidationResult {
|
|
46
|
+
sourceStep: string;
|
|
47
|
+
sourceOutput: string;
|
|
48
|
+
targetStep: string;
|
|
49
|
+
targetInput: string;
|
|
50
|
+
status: ConnectionStatus;
|
|
51
|
+
mapping?: string | null;
|
|
52
|
+
errors: string[];
|
|
53
|
+
}
|
|
54
|
+
export interface StepConnectionResult {
|
|
55
|
+
stepId: string;
|
|
56
|
+
toolId?: string | null;
|
|
57
|
+
toolVersion?: string | null;
|
|
58
|
+
stepType: string;
|
|
59
|
+
mapOver?: string | null;
|
|
60
|
+
connections: ConnectionValidationResult[];
|
|
61
|
+
errors: string[];
|
|
62
|
+
}
|
|
63
|
+
export interface WorkflowConnectionResult {
|
|
64
|
+
stepResults: StepConnectionResult[];
|
|
65
|
+
valid: boolean;
|
|
66
|
+
summary: Record<string, number>;
|
|
67
|
+
}
|
|
68
|
+
/** outputs[stepId][outputName] -> resolved type (collection descriptor for collections, sentinel for data/scalar) */
|
|
69
|
+
export type StepOutputTypeMap = Record<string, Record<string, CollectionTypeDescriptor>>;
|
|
70
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAEjF,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,MAAM,MAAM,iBAAiB,GACzB,MAAM,GACN,YAAY,GACZ,MAAM,GACN,SAAS,GACT,OAAO,GACP,SAAS,GACT,OAAO,GACP,QAAQ,CAAC;AAEb,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,iBAAiB,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,MAAM,sBAAsB,GAC9B,MAAM,GACN,YAAY,GACZ,MAAM,GACN,SAAS,GACT,OAAO,GACP,SAAS,CAAC;AAEd,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,sBAAsB,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,uBAAuB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,cAAc,CAAC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M,GAAG,IAAI,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,WAAW,EAAE,0BAA0B,EAAE,CAAC;IAC1C,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,wBAAwB;IACvC,WAAW,EAAE,oBAAoB,EAAE,CAAC;IACpC,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC;AAED,qHAAqH;AACrH,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC,CAAC"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@galaxy-tool-util/connection-validation",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Connection validator for Galaxy workflows — port of galaxy.tool_util.workflow_state.connection_validation",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.js"
|
|
11
|
+
},
|
|
12
|
+
"./package.json": "./package.json"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"README.md",
|
|
17
|
+
"LICENSE"
|
|
18
|
+
],
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "https://github.com/jmchilton/galaxy-tool-util-ts",
|
|
22
|
+
"directory": "packages/connection-validation"
|
|
23
|
+
},
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public",
|
|
26
|
+
"provenance": true
|
|
27
|
+
},
|
|
28
|
+
"keywords": [
|
|
29
|
+
"galaxy",
|
|
30
|
+
"workflow",
|
|
31
|
+
"connection",
|
|
32
|
+
"validation"
|
|
33
|
+
],
|
|
34
|
+
"license": "MIT",
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"yaml": "^2.8.3"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@galaxy-tool-util/schema": "1.1.0",
|
|
40
|
+
"@galaxy-tool-util/workflow-graph": "1.0.0"
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"build": "tsc",
|
|
44
|
+
"typecheck": "tsc --noEmit",
|
|
45
|
+
"test": "tsc --noEmit && vitest run",
|
|
46
|
+
"test:watch": "vitest",
|
|
47
|
+
"lint": "eslint src/ test/",
|
|
48
|
+
"format": "prettier --check 'src/**/*.ts' 'test/**/*.ts'",
|
|
49
|
+
"format-fix": "prettier --write 'src/**/*.ts' 'test/**/*.ts'"
|
|
50
|
+
}
|
|
51
|
+
}
|