@galaxy-tool-util/schema 0.1.0 → 0.4.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.
Files changed (182) hide show
  1. package/LICENSE +21 -0
  2. package/dist/index.d.ts +87 -3
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +62 -1
  5. package/dist/index.js.map +1 -1
  6. package/dist/schema/type-guards.d.ts +14 -0
  7. package/dist/schema/type-guards.d.ts.map +1 -0
  8. package/dist/schema/type-guards.js +25 -0
  9. package/dist/schema/type-guards.js.map +1 -0
  10. package/dist/test-format/cross-check/check.d.ts +18 -0
  11. package/dist/test-format/cross-check/check.d.ts.map +1 -0
  12. package/dist/test-format/cross-check/check.js +89 -0
  13. package/dist/test-format/cross-check/check.js.map +1 -0
  14. package/dist/test-format/cross-check/extract-format2.d.ts +13 -0
  15. package/dist/test-format/cross-check/extract-format2.d.ts.map +1 -0
  16. package/dist/test-format/cross-check/extract-format2.js +98 -0
  17. package/dist/test-format/cross-check/extract-format2.js.map +1 -0
  18. package/dist/test-format/cross-check/extract-native.d.ts +4 -0
  19. package/dist/test-format/cross-check/extract-native.d.ts.map +1 -0
  20. package/dist/test-format/cross-check/extract-native.js +89 -0
  21. package/dist/test-format/cross-check/extract-native.js.map +1 -0
  22. package/dist/test-format/cross-check/extract.d.ts +9 -0
  23. package/dist/test-format/cross-check/extract.d.ts.map +1 -0
  24. package/dist/test-format/cross-check/extract.js +16 -0
  25. package/dist/test-format/cross-check/extract.js.map +1 -0
  26. package/dist/test-format/cross-check/index.d.ts +7 -0
  27. package/dist/test-format/cross-check/index.d.ts.map +1 -0
  28. package/dist/test-format/cross-check/index.js +6 -0
  29. package/dist/test-format/cross-check/index.js.map +1 -0
  30. package/dist/test-format/cross-check/type-compat.d.ts +23 -0
  31. package/dist/test-format/cross-check/type-compat.d.ts.map +1 -0
  32. package/dist/test-format/cross-check/type-compat.js +48 -0
  33. package/dist/test-format/cross-check/type-compat.js.map +1 -0
  34. package/dist/test-format/cross-check/types.d.ts +23 -0
  35. package/dist/test-format/cross-check/types.d.ts.map +1 -0
  36. package/dist/test-format/cross-check/types.js +10 -0
  37. package/dist/test-format/cross-check/types.js.map +1 -0
  38. package/dist/test-format/index.d.ts +3 -0
  39. package/dist/test-format/index.d.ts.map +1 -0
  40. package/dist/test-format/index.js +3 -0
  41. package/dist/test-format/index.js.map +1 -0
  42. package/dist/test-format/tests.schema.generated.d.ts +5610 -0
  43. package/dist/test-format/tests.schema.generated.d.ts.map +1 -0
  44. package/dist/test-format/tests.schema.generated.js +6899 -0
  45. package/dist/test-format/tests.schema.generated.js.map +1 -0
  46. package/dist/test-format/validate.d.ts +20 -0
  47. package/dist/test-format/validate.d.ts.map +1 -0
  48. package/dist/test-format/validate.js +41 -0
  49. package/dist/test-format/validate.js.map +1 -0
  50. package/dist/tool-state-validator.d.ts +23 -0
  51. package/dist/tool-state-validator.d.ts.map +1 -0
  52. package/dist/tool-state-validator.js +59 -0
  53. package/dist/tool-state-validator.js.map +1 -0
  54. package/dist/workflow/clean.d.ts +56 -3
  55. package/dist/workflow/clean.d.ts.map +1 -1
  56. package/dist/workflow/clean.js +227 -27
  57. package/dist/workflow/clean.js.map +1 -1
  58. package/dist/workflow/coercions.d.ts +22 -0
  59. package/dist/workflow/coercions.d.ts.map +1 -0
  60. package/dist/workflow/coercions.js +67 -0
  61. package/dist/workflow/coercions.js.map +1 -0
  62. package/dist/workflow/index.d.ts +17 -4
  63. package/dist/workflow/index.d.ts.map +1 -1
  64. package/dist/workflow/index.js +18 -3
  65. package/dist/workflow/index.js.map +1 -1
  66. package/dist/workflow/lint-profiles.d.ts +27 -0
  67. package/dist/workflow/lint-profiles.d.ts.map +1 -0
  68. package/dist/workflow/lint-profiles.js +49 -0
  69. package/dist/workflow/lint-profiles.js.map +1 -0
  70. package/dist/workflow/lint-rules.d.ts +15 -0
  71. package/dist/workflow/lint-rules.d.ts.map +1 -0
  72. package/dist/workflow/lint-rules.js +15 -0
  73. package/dist/workflow/lint-rules.js.map +1 -0
  74. package/dist/workflow/lint.d.ts +4 -18
  75. package/dist/workflow/lint.d.ts.map +1 -1
  76. package/dist/workflow/lint.js +9 -30
  77. package/dist/workflow/lint.js.map +1 -1
  78. package/dist/workflow/lint_profiles.yml +41 -0
  79. package/dist/workflow/linting.d.ts +54 -0
  80. package/dist/workflow/linting.d.ts.map +1 -0
  81. package/dist/workflow/linting.js +71 -0
  82. package/dist/workflow/linting.js.map +1 -0
  83. package/dist/workflow/normalized/index.d.ts +5 -2
  84. package/dist/workflow/normalized/index.d.ts.map +1 -1
  85. package/dist/workflow/normalized/index.js +2 -0
  86. package/dist/workflow/normalized/index.js.map +1 -1
  87. package/dist/workflow/normalized/stateful-runner.d.ts +82 -0
  88. package/dist/workflow/normalized/stateful-runner.d.ts.map +1 -0
  89. package/dist/workflow/normalized/stateful-runner.js +122 -0
  90. package/dist/workflow/normalized/stateful-runner.js.map +1 -0
  91. package/dist/workflow/normalized/toFormat2.d.ts +19 -1
  92. package/dist/workflow/normalized/toFormat2.d.ts.map +1 -1
  93. package/dist/workflow/normalized/toFormat2.js +47 -16
  94. package/dist/workflow/normalized/toFormat2.js.map +1 -1
  95. package/dist/workflow/normalized/toFormat2Stateful.d.ts +30 -0
  96. package/dist/workflow/normalized/toFormat2Stateful.d.ts.map +1 -0
  97. package/dist/workflow/normalized/toFormat2Stateful.js +58 -0
  98. package/dist/workflow/normalized/toFormat2Stateful.js.map +1 -0
  99. package/dist/workflow/normalized/toNative.d.ts +10 -1
  100. package/dist/workflow/normalized/toNative.d.ts.map +1 -1
  101. package/dist/workflow/normalized/toNative.js +24 -8
  102. package/dist/workflow/normalized/toNative.js.map +1 -1
  103. package/dist/workflow/normalized/toNativeStateful.d.ts +31 -0
  104. package/dist/workflow/normalized/toNativeStateful.d.ts.map +1 -0
  105. package/dist/workflow/normalized/toNativeStateful.js +55 -0
  106. package/dist/workflow/normalized/toNativeStateful.js.map +1 -0
  107. package/dist/workflow/param-navigation.d.ts +26 -0
  108. package/dist/workflow/param-navigation.d.ts.map +1 -0
  109. package/dist/workflow/param-navigation.js +60 -0
  110. package/dist/workflow/param-navigation.js.map +1 -0
  111. package/dist/workflow/precheck.d.ts +54 -0
  112. package/dist/workflow/precheck.d.ts.map +1 -0
  113. package/dist/workflow/precheck.js +91 -0
  114. package/dist/workflow/precheck.js.map +1 -0
  115. package/dist/workflow/raw/gxformat2.effect.d.ts +97 -97
  116. package/dist/workflow/raw/gxformat2.effect.d.ts.map +1 -1
  117. package/dist/workflow/raw/gxformat2.effect.js +98 -88
  118. package/dist/workflow/raw/gxformat2.effect.js.map +1 -1
  119. package/dist/workflow/raw/native.d.ts +2 -2
  120. package/dist/workflow/raw/native.d.ts.map +1 -1
  121. package/dist/workflow/raw/native.effect.d.ts +33 -33
  122. package/dist/workflow/raw/native.effect.d.ts.map +1 -1
  123. package/dist/workflow/raw/native.effect.js +42 -32
  124. package/dist/workflow/raw/native.effect.js.map +1 -1
  125. package/dist/workflow/report-models.d.ts +412 -0
  126. package/dist/workflow/report-models.d.ts.map +1 -0
  127. package/dist/workflow/report-models.js +342 -0
  128. package/dist/workflow/report-models.js.map +1 -0
  129. package/dist/workflow/roundtrip.d.ts +77 -0
  130. package/dist/workflow/roundtrip.d.ts.map +1 -0
  131. package/dist/workflow/roundtrip.js +597 -0
  132. package/dist/workflow/roundtrip.js.map +1 -0
  133. package/dist/workflow/runtime-markers.d.ts +20 -0
  134. package/dist/workflow/runtime-markers.d.ts.map +1 -0
  135. package/dist/workflow/runtime-markers.js +26 -0
  136. package/dist/workflow/runtime-markers.js.map +1 -0
  137. package/dist/workflow/schema-rules.d.ts +38 -0
  138. package/dist/workflow/schema-rules.d.ts.map +1 -0
  139. package/dist/workflow/schema-rules.js +28 -0
  140. package/dist/workflow/schema-rules.js.map +1 -0
  141. package/dist/workflow/schema_rules.yml +69 -0
  142. package/dist/workflow/serialize.d.ts +30 -0
  143. package/dist/workflow/serialize.d.ts.map +1 -0
  144. package/dist/workflow/serialize.js +37 -0
  145. package/dist/workflow/serialize.js.map +1 -0
  146. package/dist/workflow/stale-keys.d.ts +16 -0
  147. package/dist/workflow/stale-keys.d.ts.map +1 -0
  148. package/dist/workflow/stale-keys.js +43 -0
  149. package/dist/workflow/stale-keys.js.map +1 -0
  150. package/dist/workflow/state-merge.d.ts +15 -32
  151. package/dist/workflow/state-merge.d.ts.map +1 -1
  152. package/dist/workflow/state-merge.js +31 -225
  153. package/dist/workflow/state-merge.js.map +1 -1
  154. package/dist/workflow/stateful-convert.d.ts +47 -0
  155. package/dist/workflow/stateful-convert.d.ts.map +1 -0
  156. package/dist/workflow/stateful-convert.js +151 -0
  157. package/dist/workflow/stateful-convert.js.map +1 -0
  158. package/dist/workflow/stateful-validate.d.ts +67 -0
  159. package/dist/workflow/stateful-validate.d.ts.map +1 -0
  160. package/dist/workflow/stateful-validate.js +123 -0
  161. package/dist/workflow/stateful-validate.js.map +1 -0
  162. package/dist/workflow/strict-checks.d.ts +22 -0
  163. package/dist/workflow/strict-checks.d.ts.map +1 -0
  164. package/dist/workflow/strict-checks.js +95 -0
  165. package/dist/workflow/strict-checks.js.map +1 -0
  166. package/dist/workflow/tool-state-io.d.ts +14 -0
  167. package/dist/workflow/tool-state-io.d.ts.map +1 -0
  168. package/dist/workflow/tool-state-io.js +33 -0
  169. package/dist/workflow/tool-state-io.js.map +1 -0
  170. package/dist/workflow/validators.d.ts +34 -0
  171. package/dist/workflow/validators.d.ts.map +1 -0
  172. package/dist/workflow/validators.js +83 -0
  173. package/dist/workflow/validators.js.map +1 -0
  174. package/dist/workflow/walk-helpers.d.ts +29 -0
  175. package/dist/workflow/walk-helpers.d.ts.map +1 -0
  176. package/dist/workflow/walk-helpers.js +89 -0
  177. package/dist/workflow/walk-helpers.js.map +1 -0
  178. package/dist/workflow/walker.d.ts +55 -0
  179. package/dist/workflow/walker.d.ts.map +1 -0
  180. package/dist/workflow/walker.js +199 -0
  181. package/dist/workflow/walker.js.map +1 -0
  182. package/package.json +21 -16
@@ -4,14 +4,40 @@
4
4
  * Port of Galaxy's workflow_state clean operation. Removes bookkeeping keys
5
5
  * (__page__, __rerun_remap_job_id__), runtime leak keys (chromInfo, __input_ext),
6
6
  * and decodes JSON-encoded tool_state strings into proper dicts.
7
+ *
8
+ * Also strips Galaxy-injected structural properties (`uuid`, `errors`) from both
9
+ * native and format2 workflow and step dicts.
10
+ *
11
+ * Also provides a tool-definition-aware strip (`stripStaleKeysToolAware`)
12
+ * that mirrors Galaxy's `clean._strip_recursive`: uses the declared
13
+ * parameter tree to drop any undeclared key (runtime leaks, stale-branch
14
+ * params, tool-upgrade residue) honoring conditional branch selection,
15
+ * repeat expansion, and section nesting.
7
16
  */
17
+ import { cleanDisplayLabel } from "./report-models.js";
18
+ import { detectFormat } from "./detect-format.js";
19
+ import { walkNativeState, walkFormat2State, SKIP_VALUE } from "./walker.js";
8
20
  /** Keys injected by Galaxy's tool form machinery — never meaningful in saved workflows. */
9
21
  const BOOKKEEPING_KEYS = new Set(["__page__", "__rerun_remap_job_id__"]);
22
+ /** Canonical position keys — only left/top are kept; browser-computed extras are stripped. */
23
+ const POSITION_CANONICAL_KEYS = new Set(["left", "top"]);
10
24
  /** Keys leaked from runtime context into saved state. */
11
25
  const RUNTIME_LEAK_KEYS = new Set(["chromInfo", "__input_ext"]);
12
26
  /** Internal indexing keys within conditionals and repeats. */
13
27
  const INTERNAL_KEYS = new Set(["__current_case__", "__index__"]);
14
28
  const STALE_KEYS = new Set([...BOOKKEEPING_KEYS, ...RUNTIME_LEAK_KEYS, ...INTERNAL_KEYS]);
29
+ /**
30
+ * Galaxy-injected structural properties — present on workflow and step dicts
31
+ * in both native and format2 exports, but not meaningful in saved/shared
32
+ * workflows. Stripped from workflow-level and step-level dicts.
33
+ *
34
+ * `position` is intentionally excluded — it is a legitimate workflow property
35
+ * that VS Code and other tools may use.
36
+ *
37
+ * `errors` is always stripped. `uuid` is stripped by default but can be
38
+ * suppressed with `CleanWorkflowOptions.skipUuid`.
39
+ */
40
+ const ALWAYS_STRIP_STEP_KEYS = new Set(["errors"]);
15
41
  /**
16
42
  * Decode a legacy JSON-encoded tool_state value. If the value is a string
17
43
  * that parses to a compound type (object/array), return the parsed value and
@@ -68,12 +94,14 @@ function parseToolState(toolState) {
68
94
  }
69
95
  return null;
70
96
  }
71
- /** Recursively remove stale keys from a tool_state dict. */
72
- function stripStaleKeys(state) {
97
+ /** Recursively remove stale keys from a tool_state dict, tracking removed top-level keys. */
98
+ function stripStaleKeys(state, removedKeys) {
73
99
  const result = {};
74
100
  for (const [key, value] of Object.entries(state)) {
75
- if (STALE_KEYS.has(key))
101
+ if (STALE_KEYS.has(key)) {
102
+ removedKeys?.push(key);
76
103
  continue;
104
+ }
77
105
  result[key] = stripStaleValue(value);
78
106
  }
79
107
  return result;
@@ -88,44 +116,216 @@ function stripStaleValue(value) {
88
116
  }
89
117
  return value;
90
118
  }
91
- /** Clean a single native step's tool_state in place. */
92
- function cleanNativeStep(stepDef) {
93
- const toolId = stepDef.tool_id;
94
- if (!toolId)
95
- return;
119
+ /**
120
+ * Strip Galaxy-injected structural properties from a step dict in-place.
121
+ * Always removes `errors`; removes `uuid` unless `skipUuid` is true.
122
+ * Returns the list of keys actually removed.
123
+ */
124
+ function stripStructuralStep(stepDict, skipUuid) {
125
+ const removed = [];
126
+ for (const key of ALWAYS_STRIP_STEP_KEYS) {
127
+ if (key in stepDict) {
128
+ delete stepDict[key];
129
+ removed.push(key);
130
+ }
131
+ }
132
+ if (!skipUuid && "uuid" in stepDict) {
133
+ delete stepDict.uuid;
134
+ removed.push("uuid");
135
+ }
136
+ return removed;
137
+ }
138
+ /** Clean a single native step's tool_state in place, returning step result info. */
139
+ async function cleanNativeStep(stepDef, stepLabel, opts) {
140
+ const toolId = stepDef.tool_id ?? null;
141
+ const toolVersion = stepDef.tool_version ?? null;
142
+ // Strip structural properties from the step dict itself (uuid, errors)
143
+ const removedKeys = stripStructuralStep(stepDef, opts.skipUuid ?? false);
144
+ if (!toolId) {
145
+ return {
146
+ step: stepLabel,
147
+ tool_id: null,
148
+ version: null,
149
+ removed_keys: removedKeys,
150
+ skipped: true,
151
+ skip_reason: "no tool_id",
152
+ display_label: cleanDisplayLabel(null, null),
153
+ };
154
+ }
96
155
  const rawState = stepDef.tool_state;
97
- if (rawState === undefined || rawState === null)
98
- return;
156
+ if (rawState === undefined || rawState === null) {
157
+ return {
158
+ step: stepLabel,
159
+ tool_id: toolId,
160
+ version: toolVersion,
161
+ removed_keys: removedKeys,
162
+ skipped: true,
163
+ skip_reason: "no tool_state",
164
+ display_label: cleanDisplayLabel(toolId, toolVersion),
165
+ };
166
+ }
99
167
  const parsed = parseToolState(rawState);
100
- if (!parsed)
101
- return;
102
- stepDef.tool_state = stripStaleKeys(parsed);
168
+ if (!parsed) {
169
+ return {
170
+ step: stepLabel,
171
+ tool_id: toolId,
172
+ version: toolVersion,
173
+ removed_keys: removedKeys,
174
+ skipped: true,
175
+ skip_reason: "unparseable tool_state",
176
+ display_label: cleanDisplayLabel(toolId, toolVersion),
177
+ };
178
+ }
179
+ let cleaned = stripStaleKeys(parsed, removedKeys);
180
+ // Tool-aware strip: drop keys not in the tool's parameter tree
181
+ if (opts.toolInputsResolver) {
182
+ const inputs = opts.toolInputsResolver(toolId, toolVersion);
183
+ if (inputs) {
184
+ const inputConnections = (stepDef.input_connections ?? {});
185
+ cleaned = stripStaleKeysToolAware(cleaned, inputs, inputConnections);
186
+ }
187
+ }
188
+ stepDef.tool_state = cleaned;
189
+ return {
190
+ step: stepLabel,
191
+ tool_id: toolId,
192
+ version: toolVersion,
193
+ removed_keys: removedKeys,
194
+ skipped: false,
195
+ skip_reason: "",
196
+ display_label: cleanDisplayLabel(toolId, toolVersion),
197
+ };
198
+ }
199
+ /** Normalize a step's position dict to only canonical keys (left, top). */
200
+ function normalizeStepPosition(stepDef) {
201
+ const pos = stepDef.position;
202
+ if (pos !== null && typeof pos === "object" && !Array.isArray(pos)) {
203
+ for (const key of Object.keys(pos)) {
204
+ if (!POSITION_CANONICAL_KEYS.has(key)) {
205
+ delete pos[key];
206
+ }
207
+ }
208
+ }
103
209
  }
104
210
  /** Recursively clean all steps in a native workflow dict. */
105
- function cleanNativeSteps(workflowDict) {
211
+ async function cleanNativeSteps(workflowDict, opts, prefix = "") {
106
212
  const steps = workflowDict.steps;
107
213
  if (!steps)
108
- return;
109
- for (const stepDef of Object.values(steps)) {
110
- // Subworkflow steps don't have meaningful tool_state — recurse into the
111
- // embedded subworkflow's steps instead.
214
+ return [];
215
+ const results = [];
216
+ for (const [key, stepDef] of Object.entries(steps)) {
217
+ const stepLabel = prefix ? `${prefix}${key}` : key;
218
+ normalizeStepPosition(stepDef);
112
219
  if (stepDef.type === "subworkflow" && stepDef.subworkflow) {
113
- cleanNativeSteps(stepDef.subworkflow);
220
+ results.push(...(await cleanNativeSteps(stepDef.subworkflow, opts, `${stepLabel}.`)));
114
221
  continue;
115
222
  }
116
- cleanNativeStep(stepDef);
223
+ results.push(await cleanNativeStep(stepDef, stepLabel, opts));
117
224
  }
225
+ return results;
226
+ }
227
+ /**
228
+ * Strip all keys from a native step's `tool_state` that are not declared in
229
+ * the tool's parameter tree. Mirrors Galaxy's `clean._strip_recursive`.
230
+ *
231
+ * Uses `walkNativeState` with an identity leaf callback: the walker builds
232
+ * its output from declared params only, silently dropping undeclared keys
233
+ * (runtime leaks like `|__identifier__`, stale-branch conditional params,
234
+ * tool-upgrade residue). Missing declared leaves are omitted via
235
+ * `SKIP_VALUE` rather than written back as `undefined`.
236
+ *
237
+ * Used by `roundtripValidate` to pre-clean the original workflow before
238
+ * diffing (matches Galaxy's `roundtrip_validate(clean_stale=True)`
239
+ * default).
240
+ *
241
+ * @param state - Raw tool_state dict (parsed, not a JSON string)
242
+ * @param toolInputs - Declared parameter models from the tool definition
243
+ * @param inputConnections - Flat connection map; only used for repeat
244
+ * instance-count inference. Pass `{}` if not relevant.
245
+ */
246
+ export function stripStaleKeysToolAware(state, toolInputs, inputConnections = {}) {
247
+ return walkNativeState(inputConnections, toolInputs, state, (_input, value) => value === undefined ? SKIP_VALUE : value);
248
+ }
249
+ /**
250
+ * Strip all keys from a format2 step's `state` that are not declared in
251
+ * the tool's parameter tree. Format2 analogue of `stripStaleKeysToolAware`.
252
+ */
253
+ function stripStaleKeysToolAwareFormat2(state, toolInputs) {
254
+ return walkFormat2State(toolInputs, state, (_input, value) => value === undefined ? SKIP_VALUE : value);
255
+ }
256
+ /** Clean a single format2 step dict in place, returning step result info. */
257
+ async function cleanFormat2Step(stepDef, stepLabel, opts) {
258
+ const toolId = stepDef.tool_id ?? null;
259
+ const toolVersion = stepDef.tool_version ?? null;
260
+ const removedKeys = stripStructuralStep(stepDef, opts.skipUuid ?? false);
261
+ // Tool-aware strip on `state` field
262
+ if (opts.toolInputsResolver && toolId) {
263
+ const inputs = opts.toolInputsResolver(toolId, toolVersion);
264
+ if (inputs) {
265
+ if (stepDef.state && typeof stepDef.state === "object" && !Array.isArray(stepDef.state)) {
266
+ stepDef.state = stripStaleKeysToolAwareFormat2(stepDef.state, inputs);
267
+ }
268
+ if (stepDef.tool_state &&
269
+ typeof stepDef.tool_state === "object" &&
270
+ !Array.isArray(stepDef.tool_state)) {
271
+ stepDef.tool_state = stripStaleKeysToolAwareFormat2(stepDef.tool_state, inputs);
272
+ }
273
+ }
274
+ }
275
+ return {
276
+ step: stepLabel,
277
+ tool_id: toolId,
278
+ version: toolVersion,
279
+ removed_keys: removedKeys,
280
+ skipped: false,
281
+ skip_reason: "",
282
+ display_label: cleanDisplayLabel(toolId, toolVersion),
283
+ };
284
+ }
285
+ /** Clean all steps in a format2 workflow dict. Steps may be a list or a dict. */
286
+ async function cleanFormat2Steps(workflowDict, opts) {
287
+ const rawSteps = workflowDict.steps;
288
+ if (!rawSteps)
289
+ return [];
290
+ const results = [];
291
+ if (Array.isArray(rawSteps)) {
292
+ for (let i = 0; i < rawSteps.length; i++) {
293
+ const stepDef = rawSteps[i];
294
+ const label = stepDef.label ?? stepDef.id ?? String(i);
295
+ results.push(await cleanFormat2Step(stepDef, label, opts));
296
+ }
297
+ }
298
+ else if (rawSteps !== null && typeof rawSteps === "object") {
299
+ for (const [key, stepDef] of Object.entries(rawSteps)) {
300
+ const step = stepDef;
301
+ const label = step.label ?? step.id ?? key;
302
+ results.push(await cleanFormat2Step(step, label, opts));
303
+ }
304
+ }
305
+ return results;
118
306
  }
119
- import { detectFormat } from "./detect-format.js";
120
307
  /**
121
- * Clean a workflow — strip stale keys and decode legacy tool_state encoding.
122
- * Mutates and returns the workflow dict. Format2 workflows pass through unchanged.
308
+ * Clean a workflow — strip structural properties (`uuid`, `errors`), stale
309
+ * tool_state bookkeeping keys, and decode legacy tool_state encoding.
310
+ *
311
+ * Mutates the workflow dict in place. Handles both native and format2 formats.
312
+ * Returns both the mutated workflow and per-step clean results.
313
+ *
314
+ * When `opts.toolInputsResolver` is provided, also performs tool-aware stale
315
+ * key removal: drops any `tool_state` / `state` keys not declared in the
316
+ * tool's parameter tree (native via `stripStaleKeysToolAware`, format2 via
317
+ * `walkFormat2State`). Steps whose tool is not found in the resolver are
318
+ * left unchanged.
123
319
  */
124
- export function cleanWorkflow(workflowDict) {
320
+ export async function cleanWorkflow(workflowDict, opts = {}) {
321
+ // Strip workflow-level uuid from both formats
322
+ if (!opts.skipUuid)
323
+ delete workflowDict.uuid;
125
324
  if (detectFormat(workflowDict) === "format2") {
126
- return workflowDict;
325
+ const results = await cleanFormat2Steps(workflowDict, opts);
326
+ return { workflow: workflowDict, results };
127
327
  }
128
- cleanNativeSteps(workflowDict);
129
- return workflowDict;
328
+ const results = await cleanNativeSteps(workflowDict, opts);
329
+ return { workflow: workflowDict, results };
130
330
  }
131
331
  //# sourceMappingURL=clean.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"clean.js","sourceRoot":"","sources":["../../src/workflow/clean.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,2FAA2F;AAC3F,MAAM,gBAAgB,GAAG,IAA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I,CAAC,CAAC,CAAC;QAC1D,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAgBD;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,YAAqC,EACrC,OAA6B,EAAE;IAE/B,8CAA8C;IAC9C,IAAI,CAAC,IAAI,CAAC,QAAQ;QAAE,OAAO,YAAY,CAAC,IAAI,CAAC;IAE7C,IAAI,YAAY,CAAC,YAAY,CAAC,KAAK,SAAS,EAAE,CAAC;QAC7C,MAAM,OAAO,GAAG,MAAM,iBAAiB,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;QAC5D,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC;IAC7C,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,gBAAgB,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IAC3D,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC;AAC7C,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Pure scalar coercion parsers shared by state-merge and stateful-convert.
3
+ *
4
+ * Each function returns the parsed value or `null` when the input can't be
5
+ * interpreted. Callers choose whether to fall back to the original value
6
+ * (passthrough: `parseX(v) ?? v`) or treat `null` as an error.
7
+ */
8
+ /** Parse boolean or "true"/"false" string → boolean. Case-insensitive. */
9
+ export declare function parseBool(value: unknown): boolean | null;
10
+ /** Parse number or non-empty numeric string → number. */
11
+ export declare function parseNumber(value: unknown): number | null;
12
+ /**
13
+ * Parse an array (passthrough) or comma-delimited string → string[].
14
+ * Empty string yields `[]`. Returns null for other inputs.
15
+ */
16
+ export declare function parseStringArray(value: unknown): string[] | null;
17
+ /**
18
+ * Parse an array or comma-delimited string → numeric array. Elements that
19
+ * can't be parsed as numbers are preserved as strings. Empty string → `[]`.
20
+ */
21
+ export declare function parseNumberArray(value: unknown): (number | string)[] | null;
22
+ //# sourceMappingURL=coercions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coercions.d.ts","sourceRoot":"","sources":["../../src/workflow/coercions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,0EAA0E;AAC1E,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,GAAG,IAAI,CAQxD;AAED,yDAAyD;AACzD,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAOzD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,GAAG,IAAI,CAOhE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,IAAI,CAe3E"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Pure scalar coercion parsers shared by state-merge and stateful-convert.
3
+ *
4
+ * Each function returns the parsed value or `null` when the input can't be
5
+ * interpreted. Callers choose whether to fall back to the original value
6
+ * (passthrough: `parseX(v) ?? v`) or treat `null` as an error.
7
+ */
8
+ /** Parse boolean or "true"/"false" string → boolean. Case-insensitive. */
9
+ export function parseBool(value) {
10
+ if (typeof value === "boolean")
11
+ return value;
12
+ if (typeof value === "string") {
13
+ const lower = value.toLowerCase();
14
+ if (lower === "true")
15
+ return true;
16
+ if (lower === "false")
17
+ return false;
18
+ }
19
+ return null;
20
+ }
21
+ /** Parse number or non-empty numeric string → number. */
22
+ export function parseNumber(value) {
23
+ if (typeof value === "number")
24
+ return value;
25
+ if (typeof value === "string" && value !== "") {
26
+ const n = Number(value);
27
+ if (!isNaN(n))
28
+ return n;
29
+ }
30
+ return null;
31
+ }
32
+ /**
33
+ * Parse an array (passthrough) or comma-delimited string → string[].
34
+ * Empty string yields `[]`. Returns null for other inputs.
35
+ */
36
+ export function parseStringArray(value) {
37
+ if (Array.isArray(value))
38
+ return value;
39
+ if (typeof value === "string") {
40
+ if (value === "")
41
+ return [];
42
+ return value.split(",");
43
+ }
44
+ return null;
45
+ }
46
+ /**
47
+ * Parse an array or comma-delimited string → numeric array. Elements that
48
+ * can't be parsed as numbers are preserved as strings. Empty string → `[]`.
49
+ */
50
+ export function parseNumberArray(value) {
51
+ if (Array.isArray(value)) {
52
+ return value.map((v) => {
53
+ const n = Number(v);
54
+ return isNaN(n) ? v : n;
55
+ });
56
+ }
57
+ if (typeof value === "string") {
58
+ if (value === "")
59
+ return [];
60
+ return value.split(",").map((s) => {
61
+ const n = Number(s);
62
+ return isNaN(n) ? s : n;
63
+ });
64
+ }
65
+ return null;
66
+ }
67
+ //# sourceMappingURL=coercions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coercions.js","sourceRoot":"","sources":["../../src/workflow/coercions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,0EAA0E;AAC1E,MAAM,UAAU,SAAS,CAAC,KAAc;IACtC,IAAI,OAAO,KAAK,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IAC7C,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,KAAK,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;QAClC,IAAI,KAAK,KAAK,MAAM;YAAE,OAAO,IAAI,CAAC;QAClC,IAAI,KAAK,KAAK,OAAO;YAAE,OAAO,KAAK,CAAC;IACtC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,yDAAyD;AACzD,MAAM,UAAU,WAAW,CAAC,KAAc;IACxC,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;QAC9C,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QACxB,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;YAAE,OAAO,CAAC,CAAC;IAC1B,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAiB,CAAC;IACnD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,IAAI,KAAK,KAAK,EAAE;YAAE,OAAO,EAAE,CAAC;QAC5B,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC1B,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;YACrB,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YACpB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,CAAY,CAAC,CAAC,CAAC,CAAC,CAAC;QACtC,CAAC,CAAC,CAAC;IACL,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,IAAI,KAAK,KAAK,EAAE;YAAE,OAAO,EAAE,CAAC;QAC5B,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;YAChC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YACpB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1B,CAAC,CAAC,CAAC;IACL,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -1,9 +1,22 @@
1
+ export { serializeWorkflow, resolveFormat, type SerializeWorkflowOptions } from "./serialize.js";
1
2
  export { type GalaxyWorkflow, GalaxyWorkflowSchema, type NativeGalaxyWorkflow, NativeGalaxyWorkflowSchema, } from "./raw/index.js";
2
- export { normalizedFormat2, NormalizedFormat2WorkflowSchema, NormalizedFormat2StepSchema, NormalizedFormat2InputSchema, NormalizedFormat2OutputSchema, NormalizedFormat2StepInputSchema, NormalizedFormat2StepOutputSchema, type NormalizedFormat2Workflow, type NormalizedFormat2Step, type NormalizedFormat2Input, type NormalizedFormat2Output, type NormalizedFormat2StepInput, type NormalizedFormat2StepOutput, normalizedNative, NormalizedNativeWorkflowSchema, NormalizedNativeStepSchema, ToolReferenceSchema, type NormalizedNativeWorkflow, type NormalizedNativeStep, type ToolReference, toFormat2, toNative, ensureFormat2, ensureNative, expandedFormat2, expandedNative, isTrsUrl, MAX_EXPANSION_DEPTH, type ExpandedFormat2Workflow, type ExpandedFormat2Step, type ExpandedNativeWorkflow, type ExpandedNativeStep, type RefResolver, type ExpansionOptions, flattenCommentData, unflattenCommentData, resolveSourceReference, UNLABELED_INPUT_PREFIX, UNLABELED_STEP_PREFIX, } from "./normalized/index.js";
3
- export { injectConnectionsIntoState, stripConnectedValues, flatStatePath, keysStartingWith, repeatInputsToArray, selectWhichWhen, } from "./state-merge.js";
3
+ export { normalizedFormat2, NormalizedFormat2WorkflowSchema, NormalizedFormat2StepSchema, NormalizedFormat2InputSchema, NormalizedFormat2OutputSchema, NormalizedFormat2StepInputSchema, NormalizedFormat2StepOutputSchema, type NormalizedFormat2Workflow, type NormalizedFormat2Step, type NormalizedFormat2Input, type NormalizedFormat2Output, type NormalizedFormat2StepInput, type NormalizedFormat2StepOutput, normalizedNative, NormalizedNativeWorkflowSchema, NormalizedNativeStepSchema, ToolReferenceSchema, type NormalizedNativeWorkflow, type NormalizedNativeStep, type ToolReference, toFormat2, type ToFormat2Options, type Format2StateOverride, toNative, type ToNativeOptions, toFormat2Stateful, toNativeStateful, type StepConversionStatus, type StepConversionFailureClass, type StatefulExportResult, type StatefulNativeResult, type ToolInputsResolver, ensureFormat2, ensureNative, expandedFormat2, expandedNative, isTrsUrl, MAX_EXPANSION_DEPTH, type ExpandedFormat2Workflow, type ExpandedFormat2Step, type ExpandedNativeWorkflow, type ExpandedNativeStep, type RefResolver, type ExpansionOptions, flattenCommentData, unflattenCommentData, resolveSourceReference, UNLABELED_INPUT_PREFIX, UNLABELED_STEP_PREFIX, } from "./normalized/index.js";
4
+ export { flatStatePath, keysStartingWith, repeatInputsToArray, selectWhichWhen, } from "./walk-helpers.js";
5
+ export { injectConnectionsIntoState, stripConnectedValues } from "./state-merge.js";
4
6
  export { scanForReplacements, type ReplacementClassification } from "./replacement-scan.js";
5
7
  export { scanToolState, type LegacyEncodingClassification, type LegacyEncodingHit, type LegacyEncodingScanResult, } from "./legacy-encoding.js";
6
- export { cleanWorkflow } from "./clean.js";
8
+ export { walkNativeState, walkFormat2State, SKIP_VALUE, UnknownKeyError, type LeafCallback, type WalkNativeOptions, } from "./walker.js";
9
+ export { convertScalarValue, reverseScalarValue, convertStateToFormat2, encodeStateToNative, type Format2ConvertedState, } from "./stateful-convert.js";
10
+ export { precheckNativeWorkflow, precheckNativeStep, type PrecheckResult, type StepPrecheckResult, } from "./precheck.js";
11
+ export { ConversionValidationFailure, validateNativeStepState, validateFormat2StepState, validateFormat2StepStateStrict, type ToolStateDiagnostic, type ValidationPhase, } from "./stateful-validate.js";
12
+ export { findParamAtPath, type ParamNavigationResult } from "./param-navigation.js";
13
+ export { roundtripValidate, type RoundtripResult, type RoundtripStrictOptions, type StepRoundtripResult, type BenignArtifactKind, type RoundtripFailureClass, } from "./roundtrip.js";
14
+ export { cleanWorkflow, type CleanWorkflowOptions, type CleanWorkflowResult } from "./clean.js";
7
15
  export { detectFormat, type WorkflowFormat } from "./detect-format.js";
8
- export { LintContext, lintNative, lintFormat2, lintWorkflow, lintBestPracticesFormat2, lintBestPracticesNative, type LintResult, } from "./lint.js";
16
+ export { withClass, validateFormat2, validateFormat2Strict, validateNative, validateNativeStrict, validatorForFixture, } from "./validators.js";
17
+ export { validateEncodingNative, validateEncodingFormat2, checkStrictEncoding, checkStrictStructure, } from "./strict-checks.js";
18
+ export { LintContext, LintMessage, Linter, LEVEL_ERROR, LEVEL_WARN, lintNative, lintFormat2, lintWorkflow, lintBestPracticesFormat2, lintBestPracticesNative, type LintLevel, type LintResult, type LinterRef, type EmitOptions, } from "./lint.js";
19
+ export { NativeStepKeyNotInteger } from "./lint-rules.js";
20
+ export { parseLintProfiles, lintProfilesById, rulesForProfile, iwcRuleIds, LINT_PROFILES_FILENAME, IWC_PROFILE_NAMES, type LintProfile, } from "./lint-profiles.js";
21
+ export { type StepStatus, SKIP_STATUSES, type ValidationStepResult, type CleanStepResult, type ResolvedOutputType, type ConnectionResult, type ConnectionStepResult, type ConnectionValidationReport, type WorkflowEntry, type WorkflowIndex, type SingleValidationReport, type SingleLintReport, type SingleCleanReport, type DiffType, type DiffSeverity, type BenignArtifact, type StepDiff, type SkipWorkflowReason, type FailureClass, type StepResult, type RoundTripResult, type StepIdMappingResult, type RoundTripValidationResult, type SingleRoundTripReport, type SingleExportReport, type StepEncodeStatus, type ToNativeResult, type WorkflowSourceFormat, type ExportResult, type ConvertResult, type WorkflowValidationResult, type LintWorkflowResult, type WorkflowCleanResult, type CategoryGroup, type TreeValidationReport, type LintTreeReport, type TreeCleanReport, type WorkflowExportResult, type ExportTreeReport, type WorkflowToNativeResult, type ToNativeTreeReport, type ToolFailureMode, type RoundTripTreeReport, validationSummary, validationFailures, cleanDisplayLabel, categoryOf, groupByCategory, buildSingleValidationReport, buildSingleLintReport, buildSingleCleanReport, buildWorkflowValidationResult, buildLintWorkflowResult, buildWorkflowCleanResult, buildTreeValidationReport, buildLintTreeReport, buildTreeCleanReport, buildWorkflowExportResult, buildExportTreeReport, buildWorkflowToNativeResult, buildToNativeTreeReport, buildRoundTripTreeReport, } from "./report-models.js";
9
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/workflow/index.ts"],"names":[],"mappings":"AACA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,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,UAAU,EACV,eAAe,EACf,2BAA2B,EAC3B,qBAAqB,EACrB,sBAAsB,EACtB,6BAA6B,EAC7B,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,EACzB,mBAAmB,EACnB,oBAAoB,EACpB,yBAAyB,EACzB,qBAAqB,EACrB,2BAA2B,EAC3B,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,oBAAoB,CAAC"}
@@ -1,11 +1,26 @@
1
+ // Format-aware serialization helpers
2
+ export { serializeWorkflow, resolveFormat } from "./serialize.js";
1
3
  // Raw (generated) workflow schema types
2
4
  export { GalaxyWorkflowSchema, NativeGalaxyWorkflowSchema, } from "./raw/index.js";
3
5
  // Normalized workflow types + normalizers
4
- export { normalizedFormat2, NormalizedFormat2WorkflowSchema, NormalizedFormat2StepSchema, NormalizedFormat2InputSchema, NormalizedFormat2OutputSchema, NormalizedFormat2StepInputSchema, NormalizedFormat2StepOutputSchema, normalizedNative, NormalizedNativeWorkflowSchema, NormalizedNativeStepSchema, ToolReferenceSchema, toFormat2, toNative, ensureFormat2, ensureNative, expandedFormat2, expandedNative, isTrsUrl, MAX_EXPANSION_DEPTH, flattenCommentData, unflattenCommentData, resolveSourceReference, UNLABELED_INPUT_PREFIX, UNLABELED_STEP_PREFIX, } from "./normalized/index.js";
5
- export { injectConnectionsIntoState, stripConnectedValues, flatStatePath, keysStartingWith, repeatInputsToArray, selectWhichWhen, } from "./state-merge.js";
6
+ export { normalizedFormat2, NormalizedFormat2WorkflowSchema, NormalizedFormat2StepSchema, NormalizedFormat2InputSchema, NormalizedFormat2OutputSchema, NormalizedFormat2StepInputSchema, NormalizedFormat2StepOutputSchema, normalizedNative, NormalizedNativeWorkflowSchema, NormalizedNativeStepSchema, ToolReferenceSchema, toFormat2, toNative, toFormat2Stateful, toNativeStateful, ensureFormat2, ensureNative, expandedFormat2, expandedNative, isTrsUrl, MAX_EXPANSION_DEPTH, flattenCommentData, unflattenCommentData, resolveSourceReference, UNLABELED_INPUT_PREFIX, UNLABELED_STEP_PREFIX, } from "./normalized/index.js";
7
+ export { flatStatePath, keysStartingWith, repeatInputsToArray, selectWhichWhen, } from "./walk-helpers.js";
8
+ export { injectConnectionsIntoState, stripConnectedValues } from "./state-merge.js";
6
9
  export { scanForReplacements } from "./replacement-scan.js";
7
10
  export { scanToolState, } from "./legacy-encoding.js";
11
+ export { walkNativeState, walkFormat2State, SKIP_VALUE, UnknownKeyError, } from "./walker.js";
12
+ export { convertScalarValue, reverseScalarValue, convertStateToFormat2, encodeStateToNative, } from "./stateful-convert.js";
13
+ export { precheckNativeWorkflow, precheckNativeStep, } from "./precheck.js";
14
+ export { ConversionValidationFailure, validateNativeStepState, validateFormat2StepState, validateFormat2StepStateStrict, } from "./stateful-validate.js";
15
+ export { findParamAtPath } from "./param-navigation.js";
16
+ export { roundtripValidate, } from "./roundtrip.js";
8
17
  export { cleanWorkflow } from "./clean.js";
9
18
  export { detectFormat } from "./detect-format.js";
10
- export { LintContext, lintNative, lintFormat2, lintWorkflow, lintBestPracticesFormat2, lintBestPracticesNative, } from "./lint.js";
19
+ export { withClass, validateFormat2, validateFormat2Strict, validateNative, validateNativeStrict, validatorForFixture, } from "./validators.js";
20
+ export { validateEncodingNative, validateEncodingFormat2, checkStrictEncoding, checkStrictStructure, } from "./strict-checks.js";
21
+ export { LintContext, LintMessage, Linter, LEVEL_ERROR, LEVEL_WARN, lintNative, lintFormat2, lintWorkflow, lintBestPracticesFormat2, lintBestPracticesNative, } from "./lint.js";
22
+ export { NativeStepKeyNotInteger } from "./lint-rules.js";
23
+ export { parseLintProfiles, lintProfilesById, rulesForProfile, iwcRuleIds, LINT_PROFILES_FILENAME, IWC_PROFILE_NAMES, } from "./lint-profiles.js";
24
+ // Structured report models (mirrors Python _report_models.py)
25
+ export { SKIP_STATUSES, validationSummary, validationFailures, cleanDisplayLabel, categoryOf, groupByCategory, buildSingleValidationReport, buildSingleLintReport, buildSingleCleanReport, buildWorkflowValidationResult, buildLintWorkflowResult, buildWorkflowCleanResult, buildTreeValidationReport, buildLintTreeReport, buildTreeCleanReport, buildWorkflowExportResult, buildExportTreeReport, buildWorkflowToNativeResult, buildToNativeTreeReport, buildRoundTripTreeReport, } from "./report-models.js";
11
26
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/workflow/index.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,OAAO,EAEL,oBAAoB,EAEpB,0BAA0B,GAC3B,MAAM,gBAAgB,CAAC;AAExB,0CAA0C;AAC1C,OAAO,EACL,iBAAiB,EACjB,+BAA+B,EAC/B,2BAA2B,EAC3B,4BAA4B,EAC5B,6BAA6B,EAC7B,gCAAgC,EAChC,iCAAiC,EAOjC,gBAAgB,EAChB,8BAA8B,EAC9B,0BAA0B,EAC1B,mBAAmB,EAInB,SAAS,EACT,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,eAAe,EACf,cAAc,EACd,QAAQ,EACR,mBAAmB,EAOnB,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,0BAA0B,EAC1B,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,mBAAmB,EAAkC,MAAM,uBAAuB,CAAC;AAE5F,OAAO,EACL,aAAa,GAId,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,aAA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qB,EACrB,2BAA2B,EAC3B,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Lint profile catalog types and parser.
3
+ *
4
+ * Mirrors gxformat2/lint_profiles.py. Profiles group lint-rule IDs into
5
+ * named sets (`structural`, `best-practices`, `release`). Unknown IDs are
6
+ * tolerated — audit tooling compares against registered `Linter` subclasses
7
+ * to flag unimplemented entries as INFO.
8
+ *
9
+ * The YAML file lives alongside this module at `./lint_profiles.yml`. This
10
+ * module stays fs-free so src/ remains browser-compatible — callers read
11
+ * the file themselves and hand the string to `parseLintProfiles`.
12
+ */
13
+ /** Relative path (from this module) to the profile catalog YAML. */
14
+ export declare const LINT_PROFILES_FILENAME = "lint_profiles.yml";
15
+ /** Canonical profile names whose union defines the IWC rule set. */
16
+ export declare const IWC_PROFILE_NAMES: readonly ["structural", "best-practices", "release"];
17
+ export interface LintProfile {
18
+ id: string;
19
+ description: string;
20
+ rules: string[];
21
+ }
22
+ export declare function parseLintProfiles(yamlContent: string): LintProfile[];
23
+ export declare function lintProfilesById(profiles: LintProfile[]): Map<string, LintProfile>;
24
+ export declare function rulesForProfile(profiles: LintProfile[], id: string): string[];
25
+ /** Union of rule ids across structural / best-practices / release profiles. */
26
+ export declare function iwcRuleIds(profiles: LintProfile[]): Set<string>;
27
+ //# sourceMappingURL=lint-profiles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lint-profiles.d.ts","sourceRoot":"","sources":["../../src/workflow/lint-profiles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,oEAAoE;AACpE,eAAO,MAAM,sBAAsB,sBAAsB,CAAC;AAE1D,oEAAoE;AACpE,eAAO,MAAM,iBAAiB,sDAAuD,CAAC;AAEtF,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAOD,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,WAAW,EAAE,CAOpE;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAElF;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,WAAW,EAAE,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE,CAM7E;AAED,+EAA+E;AAC/E,wBAAgB,UAAU,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,CAU/D"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Lint profile catalog types and parser.
3
+ *
4
+ * Mirrors gxformat2/lint_profiles.py. Profiles group lint-rule IDs into
5
+ * named sets (`structural`, `best-practices`, `release`). Unknown IDs are
6
+ * tolerated — audit tooling compares against registered `Linter` subclasses
7
+ * to flag unimplemented entries as INFO.
8
+ *
9
+ * The YAML file lives alongside this module at `./lint_profiles.yml`. This
10
+ * module stays fs-free so src/ remains browser-compatible — callers read
11
+ * the file themselves and hand the string to `parseLintProfiles`.
12
+ */
13
+ import * as yaml from "yaml";
14
+ /** Relative path (from this module) to the profile catalog YAML. */
15
+ export const LINT_PROFILES_FILENAME = "lint_profiles.yml";
16
+ /** Canonical profile names whose union defines the IWC rule set. */
17
+ export const IWC_PROFILE_NAMES = ["structural", "best-practices", "release"];
18
+ export function parseLintProfiles(yamlContent) {
19
+ const raw = (yaml.parse(yamlContent) ?? {});
20
+ return Object.entries(raw).map(([id, body]) => ({
21
+ id,
22
+ description: body.description ?? "",
23
+ rules: body.rules ?? [],
24
+ }));
25
+ }
26
+ export function lintProfilesById(profiles) {
27
+ return new Map(profiles.map((p) => [p.id, p]));
28
+ }
29
+ export function rulesForProfile(profiles, id) {
30
+ const profile = lintProfilesById(profiles).get(id);
31
+ if (!profile) {
32
+ throw new Error(`Unknown lint profile: ${id}`);
33
+ }
34
+ return profile.rules;
35
+ }
36
+ /** Union of rule ids across structural / best-practices / release profiles. */
37
+ export function iwcRuleIds(profiles) {
38
+ const byId = lintProfilesById(profiles);
39
+ const ids = new Set();
40
+ for (const name of IWC_PROFILE_NAMES) {
41
+ const profile = byId.get(name);
42
+ if (profile) {
43
+ for (const ruleId of profile.rules)
44
+ ids.add(ruleId);
45
+ }
46
+ }
47
+ return ids;
48
+ }
49
+ //# sourceMappingURL=lint-profiles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lint-profiles.js","sourceRoot":"","sources":["../../src/workflow/lint-profiles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,oEAAoE;AACpE,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AAE1D,oEAAoE;AACpE,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,YAAY,EAAE,gBAAgB,EAAE,SAAS,CAAU,CAAC;AAatF,MAAM,UAAU,iBAAiB,CAAC,WAAmB;IACnD,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,CAAmC,CAAC;IAC9E,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;QAC9C,EAAE;QACF,WAAW,EAAE,IAAI,CAAC,WAAW,IAAI,EAAE;QACnC,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,EAAE;KACxB,CAAC,CAAC,CAAC;AACN,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,QAAuB;IACtD,OAAO,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,QAAuB,EAAE,EAAU;IACjE,MAAM,OAAO,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACnD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,yBAAyB,EAAE,EAAE,CAAC,CAAC;IACjD,CAAC;IACD,OAAO,OAAO,CAAC,KAAK,CAAC;AACvB,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,UAAU,CAAC,QAAuB;IAChD,MAAM,IAAI,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACxC,MAAM,GAAG,GAAG,IAAI,GAAG,EAAU,CAAC;IAC9B,KAAK,MAAM,IAAI,IAAI,iBAAiB,EAAE,CAAC;QACrC,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC/B,IAAI,OAAO,EAAE,CAAC;YACZ,KAAK,MAAM,MAAM,IAAI,OAAO,CAAC,KAAK;gBAAE,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACtD,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Lint rule classes.
3
+ *
4
+ * Each `Linter` subclass carries metadata only (severity, applies_to,
5
+ * profile). Emission happens in `lint.ts` via `LintContext.warn`/`error`
6
+ * with `linter=<Subclass>`.
7
+ */
8
+ import { Linter } from "./linting.js";
9
+ /** Native workflow step keys must be string representations of integers. */
10
+ export declare class NativeStepKeyNotInteger extends Linter {
11
+ static severity: "error";
12
+ static applies_to: readonly ["native"];
13
+ static profile: string;
14
+ }
15
+ //# sourceMappingURL=lint-rules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lint-rules.d.ts","sourceRoot":"","sources":["../../src/workflow/lint-rules.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,4EAA4E;AAC5E,qBAAa,uBAAwB,SAAQ,MAAM;IACjD,MAAM,CAAC,QAAQ,EAAG,OAAO,CAAU;IACnC,MAAM,CAAC,UAAU,sBAAuB;IACxC,MAAM,CAAC,OAAO,SAAgB;CAC/B"}