@galaxy-tool-util/workflow-graph 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 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,15 @@
1
+ # @galaxy-tool-util/workflow-graph
2
+
3
+ Pure collection-type algebra and datatype subtyping primitives extracted from Galaxy's workflow editor.
4
+
5
+ Consumed by:
6
+
7
+ - Galaxy (re-exported from `client/src/components/Workflow/Editor/modules/` and
8
+ `client/src/components/Datatypes/`).
9
+ - The TypeScript workflow connection validator in this monorepo.
10
+ - Future tooling (CLI, VS Code plugin, gxwf-ui).
11
+
12
+ No runtime dependencies. Pure TypeScript / ESM.
13
+
14
+ See `TS_CONNECTION_REFACTOR_IN_GX_PLAN.md` and the `old/CONNECTION_VALIDATION.md`
15
+ historical note for context on why these primitives were extracted.
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Variant-array helpers for multi-accept inputs.
3
+ *
4
+ * Galaxy tools can declare `collection_types: string[]` on collection inputs,
5
+ * meaning the input accepts any of several collection types. These helpers
6
+ * mirror the inner loop of `InputCollectionTerminal._effectiveMapOver` in the
7
+ * Galaxy editor and the Python port's `_split_collection_type` helper, minus
8
+ * the sample_sheet asymmetry guard (which belongs in caller-side decision
9
+ * logic — see D4 in the extraction plan).
10
+ */
11
+ import type { CollectionTypeDescriptor } from "./collection-type.js";
12
+ /**
13
+ * True if `output`'s collection type matches any of the accepted `inputs`.
14
+ */
15
+ export declare function canMatchAny(output: CollectionTypeDescriptor, inputs: CollectionTypeDescriptor[]): boolean;
16
+ /**
17
+ * Compute the effective map-over for an output connecting to a multi-accept
18
+ * input. Mirrors `InputCollectionTerminal._effectiveMapOver`:
19
+ * - If any accepted input directly matches the output, no map-over is needed
20
+ * (returns NULL).
21
+ * - Otherwise, return the first non-null `output.effectiveMapOver(input)` for
22
+ * an input the output can map over.
23
+ * - Falls back to NULL when no variant accepts the output.
24
+ */
25
+ export declare function effectiveMapOverAny(output: CollectionTypeDescriptor, inputs: CollectionTypeDescriptor[]): CollectionTypeDescriptor;
26
+ //# sourceMappingURL=collection-type-variants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collection-type-variants.d.ts","sourceRoot":"","sources":["../src/collection-type-variants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAGrE;;GAEG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,wBAAwB,EAChC,MAAM,EAAE,wBAAwB,EAAE,GACjC,OAAO,CAET;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,wBAAwB,EAChC,MAAM,EAAE,wBAAwB,EAAE,GACjC,wBAAwB,CAa1B"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Variant-array helpers for multi-accept inputs.
3
+ *
4
+ * Galaxy tools can declare `collection_types: string[]` on collection inputs,
5
+ * meaning the input accepts any of several collection types. These helpers
6
+ * mirror the inner loop of `InputCollectionTerminal._effectiveMapOver` in the
7
+ * Galaxy editor and the Python port's `_split_collection_type` helper, minus
8
+ * the sample_sheet asymmetry guard (which belongs in caller-side decision
9
+ * logic — see D4 in the extraction plan).
10
+ */
11
+ import { NULL_COLLECTION_TYPE_DESCRIPTION } from "./collection-type.js";
12
+ /**
13
+ * True if `output`'s collection type matches any of the accepted `inputs`.
14
+ */
15
+ export function canMatchAny(output, inputs) {
16
+ return inputs.some((input) => input.canMatch(output));
17
+ }
18
+ /**
19
+ * Compute the effective map-over for an output connecting to a multi-accept
20
+ * input. Mirrors `InputCollectionTerminal._effectiveMapOver`:
21
+ * - If any accepted input directly matches the output, no map-over is needed
22
+ * (returns NULL).
23
+ * - Otherwise, return the first non-null `output.effectiveMapOver(input)` for
24
+ * an input the output can map over.
25
+ * - Falls back to NULL when no variant accepts the output.
26
+ */
27
+ export function effectiveMapOverAny(output, inputs) {
28
+ if (inputs.some((input) => input.canMatch(output))) {
29
+ return NULL_COLLECTION_TYPE_DESCRIPTION;
30
+ }
31
+ for (const input of inputs) {
32
+ if (output.canMapOver(input)) {
33
+ const effective = output.effectiveMapOver(input);
34
+ if (effective !== NULL_COLLECTION_TYPE_DESCRIPTION) {
35
+ return effective;
36
+ }
37
+ }
38
+ }
39
+ return NULL_COLLECTION_TYPE_DESCRIPTION;
40
+ }
41
+ //# sourceMappingURL=collection-type-variants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collection-type-variants.js","sourceRoot":"","sources":["../src/collection-type-variants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;AAExE;;GAEG;AACH,MAAM,UAAU,WAAW,CACzB,MAAgC,EAChC,MAAkC;IAElC,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;AACxD,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CACjC,MAAgC,EAChC,MAAkC;IAElC,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;QACnD,OAAO,gCAAgC,CAAC;IAC1C,CAAC;IACD,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;YAC7B,MAAM,SAAS,GAAG,MAAM,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;YACjD,IAAI,SAAS,KAAK,gCAAgC,EAAE,CAAC;gBACnD,OAAO,SAAS,CAAC;YACnB,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,gCAAgC,CAAC;AAC1C,CAAC"}
@@ -0,0 +1,28 @@
1
+ export interface CollectionTypeDescriptor {
2
+ isCollection: boolean;
3
+ collectionType: string | null;
4
+ rank: number;
5
+ canMatch(other: CollectionTypeDescriptor): boolean;
6
+ canMapOver(other: CollectionTypeDescriptor): boolean;
7
+ append(other: CollectionTypeDescriptor): CollectionTypeDescriptor;
8
+ equal(other: CollectionTypeDescriptor | null): boolean;
9
+ toString(): string;
10
+ effectiveMapOver(other: CollectionTypeDescriptor): CollectionTypeDescriptor;
11
+ }
12
+ export declare const NULL_COLLECTION_TYPE_DESCRIPTION: CollectionTypeDescriptor;
13
+ export declare const ANY_COLLECTION_TYPE_DESCRIPTION: CollectionTypeDescriptor;
14
+ export declare class CollectionTypeDescription implements CollectionTypeDescriptor {
15
+ collectionType: string;
16
+ isCollection: true;
17
+ rank: number;
18
+ constructor(collectionType: string);
19
+ append(other: CollectionTypeDescriptor): CollectionTypeDescriptor;
20
+ canMatch(other: CollectionTypeDescriptor): boolean;
21
+ canMapOver(other: CollectionTypeDescriptor): boolean;
22
+ effectiveMapOver(other: CollectionTypeDescriptor): CollectionTypeDescriptor;
23
+ equal(other: CollectionTypeDescriptor | null): boolean;
24
+ toString(): string;
25
+ _endsWith(str: string, suffix: string): boolean;
26
+ }
27
+ export declare function isValidCollectionTypeStr(collectionType: string | undefined): boolean;
28
+ //# sourceMappingURL=collection-type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collection-type.d.ts","sourceRoot":"","sources":["../src/collection-type.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,wBAAwB;IACvC,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC;IACnD,UAAU,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC;IACrD,MAAM,CAAC,KAAK,EAAE,wBAAwB,GAAG,wBAAwB,CAAC;IAClE,KAAK,CAAC,KAAK,EAAE,wBAAwB,GAAG,IAAI,GAAG,OAAO,CAAC;IACvD,QAAQ,IAAI,MAAM,CAAC;IACnB,gBAAgB,CAAC,KAAK,EAAE,wBAAwB,GAAG,wBAAwB,CAAC;CAC7E;AAED,eAAO,MAAM,gCAAgC,EAAE,wBAsB9C,CAAC;AAEF,eAAO,MAAM,+BAA+B,EAAE,wBAsB7C,CAAC;AAaF,qBAAa,yBAA0B,YAAW,wBAAwB;IACxE,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,IAAI,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;gBAED,cAAc,EAAE,MAAM;IAKlC,MAAM,CAAC,KAAK,EAAE,wBAAwB,GAAG,wBAAwB;IASjE,QAAQ,CAAC,KAAK,EAAE,wBAAwB;IA2BxC,UAAU,CAAC,KAAK,EAAE,wBAAwB;IAuC1C,gBAAgB,CAAC,KAAK,EAAE,wBAAwB,GAAG,wBAAwB;IAkD3E,KAAK,CAAC,KAAK,EAAE,wBAAwB,GAAG,IAAI;IAM5C,QAAQ;IAGR,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CAGtC;AAKD,wBAAgB,wBAAwB,CAAC,cAAc,EAAE,MAAM,GAAG,SAAS,WAM1E"}
@@ -0,0 +1,212 @@
1
+ /* classes for reasoning about collection map over state
2
+ null: not a collection?
3
+ NULL_COLLECTION_TYPE_DESCRIPTION: also not a collection. Is there any difference with null ?
4
+ ANY_COLLECTION_TYPE_DESCRIPTION: collection, but will never be mapped over (input has no collection_type)
5
+ CollectionTypeDescription: "normal" collection, with a `collection_type`
6
+ */
7
+ export const NULL_COLLECTION_TYPE_DESCRIPTION = {
8
+ isCollection: false,
9
+ collectionType: null,
10
+ rank: 0,
11
+ canMatch: function (_other) {
12
+ return false;
13
+ },
14
+ canMapOver: function () {
15
+ return false;
16
+ },
17
+ toString: function () {
18
+ return "NullCollectionType[]";
19
+ },
20
+ append: function (other) {
21
+ return other;
22
+ },
23
+ equal: function (other) {
24
+ return other === this;
25
+ },
26
+ effectiveMapOver: function (_other) {
27
+ return NULL_COLLECTION_TYPE_DESCRIPTION;
28
+ },
29
+ };
30
+ export const ANY_COLLECTION_TYPE_DESCRIPTION = {
31
+ isCollection: true,
32
+ collectionType: "any",
33
+ rank: -1,
34
+ canMatch: function (other) {
35
+ return NULL_COLLECTION_TYPE_DESCRIPTION !== other;
36
+ },
37
+ canMapOver: function () {
38
+ return false;
39
+ },
40
+ toString: function () {
41
+ return "AnyCollectionType[]";
42
+ },
43
+ append: function () {
44
+ return ANY_COLLECTION_TYPE_DESCRIPTION;
45
+ },
46
+ equal: function (other) {
47
+ return other === this;
48
+ },
49
+ effectiveMapOver: function (_other) {
50
+ return NULL_COLLECTION_TYPE_DESCRIPTION;
51
+ },
52
+ };
53
+ /**
54
+ * Normalize collection type for comparison purposes.
55
+ * sample_sheet behaves like list for mapping/matching.
56
+ */
57
+ function normalizeCollectionType(collectionType) {
58
+ if (collectionType.startsWith("sample_sheet")) {
59
+ return "list" + collectionType.slice("sample_sheet".length);
60
+ }
61
+ return collectionType;
62
+ }
63
+ export class CollectionTypeDescription {
64
+ collectionType;
65
+ isCollection;
66
+ rank;
67
+ constructor(collectionType) {
68
+ this.collectionType = collectionType;
69
+ this.isCollection = true;
70
+ this.rank = collectionType.split(":").length;
71
+ }
72
+ append(other) {
73
+ if (other === NULL_COLLECTION_TYPE_DESCRIPTION) {
74
+ return this;
75
+ }
76
+ if (other === ANY_COLLECTION_TYPE_DESCRIPTION) {
77
+ return other;
78
+ }
79
+ return new CollectionTypeDescription(`${this.collectionType}:${other.collectionType}`);
80
+ }
81
+ canMatch(other) {
82
+ const otherCollectionType = other.collectionType;
83
+ if (other === NULL_COLLECTION_TYPE_DESCRIPTION) {
84
+ return false;
85
+ }
86
+ if (other === ANY_COLLECTION_TYPE_DESCRIPTION) {
87
+ return true;
88
+ }
89
+ const normalizedThis = normalizeCollectionType(this.collectionType);
90
+ const normalizedOther = otherCollectionType
91
+ ? normalizeCollectionType(otherCollectionType)
92
+ : null;
93
+ if (normalizedOther === "paired" && normalizedThis == "paired_or_unpaired") {
94
+ return true;
95
+ }
96
+ if (normalizedThis.endsWith(":paired_or_unpaired")) {
97
+ const asPlainList = normalizedThis.slice(0, -":paired_or_unpaired".length);
98
+ if (normalizedOther === asPlainList) {
99
+ return true;
100
+ }
101
+ const asPairedList = `${asPlainList}:paired`;
102
+ if (normalizedOther === asPairedList) {
103
+ return true;
104
+ }
105
+ }
106
+ return normalizedOther == normalizedThis;
107
+ }
108
+ canMapOver(other) {
109
+ if (!other.collectionType || other.collectionType === "any") {
110
+ return false;
111
+ }
112
+ const normalizedThis = normalizeCollectionType(this.collectionType);
113
+ const normalizedOther = normalizeCollectionType(other.collectionType);
114
+ if (this.rank <= other.rank) {
115
+ if (normalizedOther == "paired_or_unpaired") {
116
+ // this can be thought of as a subcollection of anything except a pair
117
+ // since it would match a pair exactly
118
+ return !normalizedThis.endsWith("paired");
119
+ }
120
+ if (normalizedOther.endsWith(":paired_or_unpaired")) {
121
+ return !normalizedThis.endsWith(":paired");
122
+ }
123
+ // Cannot map over self...
124
+ return false;
125
+ }
126
+ const requiredSuffix = normalizedOther;
127
+ const directMatch = this._endsWith(normalizedThis, `:${requiredSuffix}`);
128
+ if (directMatch) {
129
+ return true;
130
+ }
131
+ // this really needs to be extended to include anything suffixed with :paired_or_unpaired
132
+ if (requiredSuffix == "paired_or_unpaired") {
133
+ // anything can be mapped over this since it can always act a dataset
134
+ return true;
135
+ }
136
+ else if (requiredSuffix.endsWith(":paired_or_unpaired")) {
137
+ const higherRanksRequired = requiredSuffix.substring(0, requiredSuffix.lastIndexOf(":"));
138
+ let higherRanks;
139
+ if (normalizedThis.endsWith(":paired")) {
140
+ higherRanks = normalizedThis.substring(0, normalizedThis.lastIndexOf(":"));
141
+ }
142
+ else {
143
+ higherRanks = normalizedThis;
144
+ }
145
+ return this._endsWith(higherRanks, higherRanksRequired);
146
+ }
147
+ return false;
148
+ }
149
+ effectiveMapOver(other) {
150
+ const thisCollectionType = this.collectionType;
151
+ if (other.collectionType && this.canMapOver(other)) {
152
+ const otherCollectionType = other.collectionType;
153
+ const normalizedThis = normalizeCollectionType(thisCollectionType);
154
+ const normalizedOther = normalizeCollectionType(otherCollectionType);
155
+ // needs to be extended to include ending in :paired_or_unpaired.
156
+ if (normalizedOther.endsWith("paired_or_unpaired")) {
157
+ if (normalizedOther == "paired_or_unpaired") {
158
+ if (normalizedThis.endsWith("list")) {
159
+ // the elements of the inner most list are consumed by the
160
+ // paired_or_unpaired input.
161
+ return new CollectionTypeDescription(thisCollectionType);
162
+ }
163
+ return new CollectionTypeDescription(thisCollectionType.substring(0, thisCollectionType.lastIndexOf(":")));
164
+ }
165
+ else if (normalizedThis.endsWith(":paired") || normalizedThis.endsWith(":list")) {
166
+ // otherCollectionType endswith :paired_or_unpaired
167
+ let currentCollectionType = thisCollectionType;
168
+ let currentOther = otherCollectionType;
169
+ while (currentOther.lastIndexOf(":") !== -1) {
170
+ currentOther = currentOther.substring(0, currentOther.lastIndexOf(":"));
171
+ currentCollectionType = currentCollectionType.substring(0, currentCollectionType.lastIndexOf(":"));
172
+ }
173
+ // and strip the last rank off for the remaining currentOther if
174
+ // the paired_or_unpaired consumed the inner paired collection
175
+ if (normalizedThis.endsWith(":paired")) {
176
+ currentCollectionType = currentCollectionType.substring(0, currentCollectionType.lastIndexOf(":"));
177
+ }
178
+ else {
179
+ // this was a list so paired_or_unpaired will consume the datasets of the
180
+ // inner list and we can just stop here.
181
+ }
182
+ return new CollectionTypeDescription(currentCollectionType);
183
+ }
184
+ }
185
+ const effectiveCollectionType = thisCollectionType.substring(0, thisCollectionType.length - otherCollectionType.length - 1);
186
+ return new CollectionTypeDescription(effectiveCollectionType);
187
+ }
188
+ return NULL_COLLECTION_TYPE_DESCRIPTION;
189
+ }
190
+ equal(other) {
191
+ if (!other) {
192
+ return false;
193
+ }
194
+ return other.collectionType == this.collectionType;
195
+ }
196
+ toString() {
197
+ return `CollectionType[${this.collectionType}]`;
198
+ }
199
+ _endsWith(str, suffix) {
200
+ return str.indexOf(suffix, str.length - suffix.length) !== -1;
201
+ }
202
+ }
203
+ const collectionTypeRegex = /^((list|paired|paired_or_unpaired|record)(:(list|paired|paired_or_unpaired|record))*|sample_sheet|sample_sheet:paired|sample_sheet:record|sample_sheet:paired_or_unpaired)$/;
204
+ export function isValidCollectionTypeStr(collectionType) {
205
+ if (collectionType) {
206
+ return collectionTypeRegex.test(collectionType);
207
+ }
208
+ else {
209
+ return true;
210
+ }
211
+ }
212
+ //# sourceMappingURL=collection-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collection-type.js","sourceRoot":"","sources":["../src/collection-type.ts"],"names":[],"mappings":"AAAA;;;;;EAKE;AAcF,MAAM,CAAC,MAAM,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IACD,KAAK,CAAC,KAAsC;QAC1C,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAO,KAAK,CAAC;QACf,CAAC;QACD,OAAO,KAAK,CAAC,cAAc,IAAI,IAAI,CAAC,cAAc,CAAC;IACrD,CAAC;IACD,QAAQ;QACN,OAAO,kBAAkB,IAAI,CAAC,cAAc,GAAG,CAAC;IAClD,CAAC;IACD,SAAS,CAAC,GAAW,EAAE,MAAc;QACnC,OAAO,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAChE,CAAC;CACF;AAED,MAAM,mBAAmB,GACvB,6KAA6K,CAAC;AAEhL,MAAM,UAAU,wBAAwB,CAAC,cAAkC;IACzE,IAAI,cAAc,EAAE,CAAC;QACnB,OAAO,mBAAmB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAClD,CAAC;SAAM,CAAC;QACN,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { DatatypesMapperModel } from "./datatypes-mapper.js";
2
+ export declare class ConnectionAcceptable {
3
+ reason: string | null;
4
+ canAccept: boolean;
5
+ constructor(canAccept: boolean, reason: string | null);
6
+ }
7
+ export declare function producesAcceptableDatatype(datatypesMapper: DatatypesMapperModel, inputDatatypes: string[], otherDatatypes: string[]): ConnectionAcceptable;
8
+ //# sourceMappingURL=connection-acceptable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection-acceptable.d.ts","sourceRoot":"","sources":["../src/connection-acceptable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAElE,qBAAa,oBAAoB;IAC/B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;gBACP,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;CAItD;AAED,wBAAgB,0BAA0B,CACxC,eAAe,EAAE,oBAAoB,EACrC,cAAc,EAAE,MAAM,EAAE,EACxB,cAAc,EAAE,MAAM,EAAE,wBAqCzB"}
@@ -0,0 +1,30 @@
1
+ export class ConnectionAcceptable {
2
+ reason;
3
+ canAccept;
4
+ constructor(canAccept, reason) {
5
+ this.canAccept = canAccept;
6
+ this.reason = reason;
7
+ }
8
+ }
9
+ export function producesAcceptableDatatype(datatypesMapper, inputDatatypes, otherDatatypes) {
10
+ for (const t in inputDatatypes) {
11
+ const thisDatatype = inputDatatypes[t];
12
+ if (thisDatatype === "input") {
13
+ return new ConnectionAcceptable(true, null);
14
+ }
15
+ // FIXME: No idea what to do about case when datatype is 'input'
16
+ const validMatch = otherDatatypes.some((otherDatatype) => otherDatatype === "input" ||
17
+ otherDatatype === "_sniff_" ||
18
+ datatypesMapper.isSubType(otherDatatype, thisDatatype));
19
+ if (validMatch) {
20
+ return new ConnectionAcceptable(true, null);
21
+ }
22
+ }
23
+ const datatypesSet = new Set(datatypesMapper.datatypes);
24
+ const invalidDatatypes = otherDatatypes.filter((datatype) => !datatypesSet.has(datatype));
25
+ if (invalidDatatypes.length) {
26
+ return new ConnectionAcceptable(false, `Effective output data type(s) [${invalidDatatypes.join(", ")}] unknown. This tool cannot be run on this Galaxy Server at this moment, please contact the Administrator.`);
27
+ }
28
+ return new ConnectionAcceptable(false, `Effective output data type(s) [${otherDatatypes.join(", ")}] do not appear to match input type(s) [${inputDatatypes.join(", ")}].`);
29
+ }
30
+ //# sourceMappingURL=connection-acceptable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection-acceptable.js","sourceRoot":"","sources":["../src/connection-acceptable.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,oBAAoB;IAC/B,MAAM,CAAgB;IACtB,SAAS,CAAU;IACnB,YAAY,SAAkB,EAAE,MAAqB;QACnD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAA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-written equivalent of Galaxy's generated
3
+ * `components["schemas"]["DatatypesCombinedMap"]` type.
4
+ *
5
+ * Galaxy's canonical definition lives in the Pydantic model
6
+ * `DatatypesCombinedMap` under `lib/galaxy/schema/`. The Galaxy-side re-export
7
+ * site enforces structural compatibility at compile time, so drift would be
8
+ * caught loudly. See the extraction plan (D2) for the decision rationale.
9
+ */
10
+ export interface DatatypesCombinedMap {
11
+ datatypes: string[];
12
+ datatypes_mapping: {
13
+ ext_to_class_name: Record<string, string>;
14
+ class_to_classes: Record<string, Record<string, boolean>>;
15
+ };
16
+ }
17
+ //# sourceMappingURL=datatypes-combined-map.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datatypes-combined-map.d.ts","sourceRoot":"","sources":["../src/datatypes-combined-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,iBAAiB,EAAE;QACjB,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC1C,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;KAC3D,CAAC;CACH"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=datatypes-combined-map.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datatypes-combined-map.js","sourceRoot":"","sources":["../src/datatypes-combined-map.ts"],"names":[],"mappings":""}
@@ -0,0 +1,18 @@
1
+ import type { DatatypesCombinedMap } from "./datatypes-combined-map.js";
2
+ export declare class DatatypesMapperModel {
3
+ datatypes: DatatypesCombinedMap["datatypes"];
4
+ datatypesMapping: DatatypesCombinedMap["datatypes_mapping"];
5
+ constructor(typesAndMapping: DatatypesCombinedMap);
6
+ /**
7
+ * Checks if a given child datatype is a subtype of a parent datatype.
8
+ * @param child - The child datatype extension as registered in the datatypes registry.
9
+ * @param parent - The parent datatype, which can be an extension or explicit class name
10
+ * Can also be used with extensionless abstract datatypes (e.g. "galaxy.datatypes.images.Image")
11
+ * @returns A boolean indicating whether the child is a subtype of the parent.
12
+ */
13
+ isSubType(child: string, parent: string): boolean;
14
+ isSubTypeOfAny(child: string, parents: DatatypesCombinedMap["datatypes"]): boolean;
15
+ /** For classes like `galaxy.datatypes.{parent}.{extension}`, get the extension's parent */
16
+ getParentDatatype(extension: string): string;
17
+ }
18
+ //# sourceMappingURL=datatypes-mapper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datatypes-mapper.d.ts","sourceRoot":"","sources":["../src/datatypes-mapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAExE,qBAAa,oBAAoB;IAC/B,SAAS,EAAE,oBAAoB,CAAC,WAAW,CAAC,CAAC;IAC7C,gBAAgB,EAAE,oBAAoB,CAAC,mBAAmB,CAAC,CAAC;gBAEhD,eAAe,EAAE,oBAAoB;IAQjD;;;;;;OAMG;IACH,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO;IAejD,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,oBAAoB,CAAC,WAAW,CAAC,GAAG,OAAO;IAIlF,2FAA2F;IAC3F,iBAAiB,CAAC,SAAS,EAAE,MAAM;CAIpC"}
@@ -0,0 +1,40 @@
1
+ export class DatatypesMapperModel {
2
+ datatypes;
3
+ datatypesMapping;
4
+ constructor(typesAndMapping) {
5
+ // create a shallow copy of the datatypes, otherwise sort mutates in place
6
+ // and causes a possible infinite render update loop.
7
+ this.datatypes = [...typesAndMapping.datatypes];
8
+ this.datatypes.sort();
9
+ this.datatypesMapping = typesAndMapping.datatypes_mapping;
10
+ }
11
+ /**
12
+ * Checks if a given child datatype is a subtype of a parent datatype.
13
+ * @param child - The child datatype extension as registered in the datatypes registry.
14
+ * @param parent - The parent datatype, which can be an extension or explicit class name
15
+ * Can also be used with extensionless abstract datatypes (e.g. "galaxy.datatypes.images.Image")
16
+ * @returns A boolean indicating whether the child is a subtype of the parent.
17
+ */
18
+ isSubType(child, parent) {
19
+ const mapping = this.datatypesMapping;
20
+ const childClassName = mapping.ext_to_class_name[child];
21
+ const parentClassName = mapping.ext_to_class_name[parent] || parent;
22
+ if (!childClassName || !parentClassName) {
23
+ return false;
24
+ }
25
+ const childClassMappings = mapping.class_to_classes[childClassName];
26
+ if (!childClassMappings) {
27
+ return false;
28
+ }
29
+ return parentClassName in childClassMappings;
30
+ }
31
+ isSubTypeOfAny(child, parents) {
32
+ return parents.some((parent) => this.isSubType(child, parent));
33
+ }
34
+ /** For classes like `galaxy.datatypes.{parent}.{extension}`, get the extension's parent */
35
+ getParentDatatype(extension) {
36
+ const fullClassName = this.datatypesMapping.ext_to_class_name[extension];
37
+ return fullClassName?.split(".")[2];
38
+ }
39
+ }
40
+ //# sourceMappingURL=datatypes-mapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datatypes-mapper.js","sourceRoot":"","sources":["../src/datatypes-mapper.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,oBAAoB;IAC/B,SAAS,CAAoC;IAC7C,gBAAgB,CAA4C;IAE5D,YAAY,eAAqC;QAC/C,0EAA0E;QAC1E,qDAAqD;QACrD,IAAI,CAAC,SAAS,GAAG,CAAC,GAAG,eAAe,CAAC,SAAS,CAAC,CAAC;QAChD,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;QACtB,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC,iBAAiB,CAAC;IAC5D,CAAC;IAED;;;;;;OAMG;IACH,SAAS,CAAC,KAAa,EAAE,MAAc;QACrC,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC;QACtC,MAAM,cAAc,GAAG,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;QACxD,MAAM,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC;QAEpE,IAAI,CAAC,cAAc,IAAI,CAAC,eAAe,EAAE,CAAC;YACxC,OAAO,KAAK,CAAC;QACf,CAAC;QACD,MAAM,kBAAkB,GAAG,OAAO,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;QACpE,IAAI,CAAC,kBAAkB,EAAE,CAAC;YACxB,OAAO,KAAK,CAAC;QACf,CAAC;QACD,OAAO,eAAe,IAAI,kBAAkB,CAAC;IAC/C,CAAC;IAED,cAAc,CAAC,KAAa,EAAE,OAA0C;QACtE,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;IACjE,CAAC;IAED,2FAA2F;IAC3F,iBAAiB,CAAC,SAAiB;QACjC,MAAM,aAAa,GAAG,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;QACzE,OAAO,aAAa,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACtC,CAAC;CACF"}
@@ -0,0 +1,6 @@
1
+ export { ANY_COLLECTION_TYPE_DESCRIPTION, CollectionTypeDescription, NULL_COLLECTION_TYPE_DESCRIPTION, isValidCollectionTypeStr, type CollectionTypeDescriptor, } from "./collection-type.js";
2
+ export { canMatchAny, effectiveMapOverAny } from "./collection-type-variants.js";
3
+ export type { DatatypesCombinedMap } from "./datatypes-combined-map.js";
4
+ export { DatatypesMapperModel } from "./datatypes-mapper.js";
5
+ export { ConnectionAcceptable, producesAcceptableDatatype } from "./connection-acceptable.js";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,+BAA+B,EAC/B,yBAAyB,EACzB,gCAAgC,EAChC,wBAAwB,EACxB,KAAK,wBAAwB,GAC9B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACjF,YAAY,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ export { ANY_COLLECTION_TYPE_DESCRIPTION, CollectionTypeDescription, NULL_COLLECTION_TYPE_DESCRIPTION, isValidCollectionTypeStr, } from "./collection-type.js";
2
+ export { canMatchAny, effectiveMapOverAny } from "./collection-type-variants.js";
3
+ export { DatatypesMapperModel } from "./datatypes-mapper.js";
4
+ export { ConnectionAcceptable, producesAcceptableDatatype } from "./connection-acceptable.js";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,+BAA+B,EAC/B,yBAAyB,EACzB,gCAAgC,EAChC,wBAAwB,GAEzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC"}
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@galaxy-tool-util/workflow-graph",
3
+ "version": "0.1.0",
4
+ "description": "Pure collection-type algebra and datatype subtyping primitives extracted from Galaxy's workflow editor",
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/workflow-graph"
23
+ },
24
+ "publishConfig": {
25
+ "access": "public",
26
+ "provenance": true
27
+ },
28
+ "keywords": [
29
+ "galaxy",
30
+ "workflow",
31
+ "collection-type",
32
+ "datatypes"
33
+ ],
34
+ "license": "MIT",
35
+ "scripts": {
36
+ "build": "tsc",
37
+ "typecheck": "tsc --noEmit",
38
+ "test": "tsc --noEmit && vitest run",
39
+ "test:watch": "vitest",
40
+ "lint": "eslint src/ test/",
41
+ "format": "prettier --check 'src/**/*.ts' 'test/**/*.ts'",
42
+ "format-fix": "prettier --write 'src/**/*.ts' 'test/**/*.ts'"
43
+ }
44
+ }