@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.
- package/LICENSE +21 -0
- package/dist/index.d.ts +87 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +62 -1
- package/dist/index.js.map +1 -1
- package/dist/schema/type-guards.d.ts +14 -0
- package/dist/schema/type-guards.d.ts.map +1 -0
- package/dist/schema/type-guards.js +25 -0
- package/dist/schema/type-guards.js.map +1 -0
- package/dist/test-format/cross-check/check.d.ts +18 -0
- package/dist/test-format/cross-check/check.d.ts.map +1 -0
- package/dist/test-format/cross-check/check.js +89 -0
- package/dist/test-format/cross-check/check.js.map +1 -0
- package/dist/test-format/cross-check/extract-format2.d.ts +13 -0
- package/dist/test-format/cross-check/extract-format2.d.ts.map +1 -0
- package/dist/test-format/cross-check/extract-format2.js +98 -0
- package/dist/test-format/cross-check/extract-format2.js.map +1 -0
- package/dist/test-format/cross-check/extract-native.d.ts +4 -0
- package/dist/test-format/cross-check/extract-native.d.ts.map +1 -0
- package/dist/test-format/cross-check/extract-native.js +89 -0
- package/dist/test-format/cross-check/extract-native.js.map +1 -0
- package/dist/test-format/cross-check/extract.d.ts +9 -0
- package/dist/test-format/cross-check/extract.d.ts.map +1 -0
- package/dist/test-format/cross-check/extract.js +16 -0
- package/dist/test-format/cross-check/extract.js.map +1 -0
- package/dist/test-format/cross-check/index.d.ts +7 -0
- package/dist/test-format/cross-check/index.d.ts.map +1 -0
- package/dist/test-format/cross-check/index.js +6 -0
- package/dist/test-format/cross-check/index.js.map +1 -0
- package/dist/test-format/cross-check/type-compat.d.ts +23 -0
- package/dist/test-format/cross-check/type-compat.d.ts.map +1 -0
- package/dist/test-format/cross-check/type-compat.js +48 -0
- package/dist/test-format/cross-check/type-compat.js.map +1 -0
- package/dist/test-format/cross-check/types.d.ts +23 -0
- package/dist/test-format/cross-check/types.d.ts.map +1 -0
- package/dist/test-format/cross-check/types.js +10 -0
- package/dist/test-format/cross-check/types.js.map +1 -0
- package/dist/test-format/index.d.ts +3 -0
- package/dist/test-format/index.d.ts.map +1 -0
- package/dist/test-format/index.js +3 -0
- package/dist/test-format/index.js.map +1 -0
- package/dist/test-format/tests.schema.generated.d.ts +5610 -0
- package/dist/test-format/tests.schema.generated.d.ts.map +1 -0
- package/dist/test-format/tests.schema.generated.js +6899 -0
- package/dist/test-format/tests.schema.generated.js.map +1 -0
- package/dist/test-format/validate.d.ts +20 -0
- package/dist/test-format/validate.d.ts.map +1 -0
- package/dist/test-format/validate.js +41 -0
- package/dist/test-format/validate.js.map +1 -0
- package/dist/tool-state-validator.d.ts +23 -0
- package/dist/tool-state-validator.d.ts.map +1 -0
- package/dist/tool-state-validator.js +59 -0
- package/dist/tool-state-validator.js.map +1 -0
- package/dist/workflow/clean.d.ts +56 -3
- package/dist/workflow/clean.d.ts.map +1 -1
- package/dist/workflow/clean.js +227 -27
- package/dist/workflow/clean.js.map +1 -1
- package/dist/workflow/coercions.d.ts +22 -0
- package/dist/workflow/coercions.d.ts.map +1 -0
- package/dist/workflow/coercions.js +67 -0
- package/dist/workflow/coercions.js.map +1 -0
- package/dist/workflow/index.d.ts +17 -4
- package/dist/workflow/index.d.ts.map +1 -1
- package/dist/workflow/index.js +18 -3
- package/dist/workflow/index.js.map +1 -1
- package/dist/workflow/lint-profiles.d.ts +27 -0
- package/dist/workflow/lint-profiles.d.ts.map +1 -0
- package/dist/workflow/lint-profiles.js +49 -0
- package/dist/workflow/lint-profiles.js.map +1 -0
- package/dist/workflow/lint-rules.d.ts +15 -0
- package/dist/workflow/lint-rules.d.ts.map +1 -0
- package/dist/workflow/lint-rules.js +15 -0
- package/dist/workflow/lint-rules.js.map +1 -0
- package/dist/workflow/lint.d.ts +4 -18
- package/dist/workflow/lint.d.ts.map +1 -1
- package/dist/workflow/lint.js +9 -30
- package/dist/workflow/lint.js.map +1 -1
- package/dist/workflow/lint_profiles.yml +41 -0
- package/dist/workflow/linting.d.ts +54 -0
- package/dist/workflow/linting.d.ts.map +1 -0
- package/dist/workflow/linting.js +71 -0
- package/dist/workflow/linting.js.map +1 -0
- package/dist/workflow/normalized/index.d.ts +5 -2
- package/dist/workflow/normalized/index.d.ts.map +1 -1
- package/dist/workflow/normalized/index.js +2 -0
- package/dist/workflow/normalized/index.js.map +1 -1
- package/dist/workflow/normalized/stateful-runner.d.ts +82 -0
- package/dist/workflow/normalized/stateful-runner.d.ts.map +1 -0
- package/dist/workflow/normalized/stateful-runner.js +122 -0
- package/dist/workflow/normalized/stateful-runner.js.map +1 -0
- package/dist/workflow/normalized/toFormat2.d.ts +19 -1
- package/dist/workflow/normalized/toFormat2.d.ts.map +1 -1
- package/dist/workflow/normalized/toFormat2.js +47 -16
- package/dist/workflow/normalized/toFormat2.js.map +1 -1
- package/dist/workflow/normalized/toFormat2Stateful.d.ts +30 -0
- package/dist/workflow/normalized/toFormat2Stateful.d.ts.map +1 -0
- package/dist/workflow/normalized/toFormat2Stateful.js +58 -0
- package/dist/workflow/normalized/toFormat2Stateful.js.map +1 -0
- package/dist/workflow/normalized/toNative.d.ts +10 -1
- package/dist/workflow/normalized/toNative.d.ts.map +1 -1
- package/dist/workflow/normalized/toNative.js +24 -8
- package/dist/workflow/normalized/toNative.js.map +1 -1
- package/dist/workflow/normalized/toNativeStateful.d.ts +31 -0
- package/dist/workflow/normalized/toNativeStateful.d.ts.map +1 -0
- package/dist/workflow/normalized/toNativeStateful.js +55 -0
- package/dist/workflow/normalized/toNativeStateful.js.map +1 -0
- package/dist/workflow/param-navigation.d.ts +26 -0
- package/dist/workflow/param-navigation.d.ts.map +1 -0
- package/dist/workflow/param-navigation.js +60 -0
- package/dist/workflow/param-navigation.js.map +1 -0
- package/dist/workflow/precheck.d.ts +54 -0
- package/dist/workflow/precheck.d.ts.map +1 -0
- package/dist/workflow/precheck.js +91 -0
- package/dist/workflow/precheck.js.map +1 -0
- package/dist/workflow/raw/gxformat2.effect.d.ts +97 -97
- package/dist/workflow/raw/gxformat2.effect.d.ts.map +1 -1
- package/dist/workflow/raw/gxformat2.effect.js +98 -88
- package/dist/workflow/raw/gxformat2.effect.js.map +1 -1
- package/dist/workflow/raw/native.d.ts +2 -2
- package/dist/workflow/raw/native.d.ts.map +1 -1
- package/dist/workflow/raw/native.effect.d.ts +33 -33
- package/dist/workflow/raw/native.effect.d.ts.map +1 -1
- package/dist/workflow/raw/native.effect.js +42 -32
- package/dist/workflow/raw/native.effect.js.map +1 -1
- package/dist/workflow/report-models.d.ts +412 -0
- package/dist/workflow/report-models.d.ts.map +1 -0
- package/dist/workflow/report-models.js +342 -0
- package/dist/workflow/report-models.js.map +1 -0
- package/dist/workflow/roundtrip.d.ts +77 -0
- package/dist/workflow/roundtrip.d.ts.map +1 -0
- package/dist/workflow/roundtrip.js +597 -0
- package/dist/workflow/roundtrip.js.map +1 -0
- package/dist/workflow/runtime-markers.d.ts +20 -0
- package/dist/workflow/runtime-markers.d.ts.map +1 -0
- package/dist/workflow/runtime-markers.js +26 -0
- package/dist/workflow/runtime-markers.js.map +1 -0
- package/dist/workflow/schema-rules.d.ts +38 -0
- package/dist/workflow/schema-rules.d.ts.map +1 -0
- package/dist/workflow/schema-rules.js +28 -0
- package/dist/workflow/schema-rules.js.map +1 -0
- package/dist/workflow/schema_rules.yml +69 -0
- package/dist/workflow/serialize.d.ts +30 -0
- package/dist/workflow/serialize.d.ts.map +1 -0
- package/dist/workflow/serialize.js +37 -0
- package/dist/workflow/serialize.js.map +1 -0
- package/dist/workflow/stale-keys.d.ts +16 -0
- package/dist/workflow/stale-keys.d.ts.map +1 -0
- package/dist/workflow/stale-keys.js +43 -0
- package/dist/workflow/stale-keys.js.map +1 -0
- package/dist/workflow/state-merge.d.ts +15 -32
- package/dist/workflow/state-merge.d.ts.map +1 -1
- package/dist/workflow/state-merge.js +31 -225
- package/dist/workflow/state-merge.js.map +1 -1
- package/dist/workflow/stateful-convert.d.ts +47 -0
- package/dist/workflow/stateful-convert.d.ts.map +1 -0
- package/dist/workflow/stateful-convert.js +151 -0
- package/dist/workflow/stateful-convert.js.map +1 -0
- package/dist/workflow/stateful-validate.d.ts +67 -0
- package/dist/workflow/stateful-validate.d.ts.map +1 -0
- package/dist/workflow/stateful-validate.js +123 -0
- package/dist/workflow/stateful-validate.js.map +1 -0
- package/dist/workflow/strict-checks.d.ts +22 -0
- package/dist/workflow/strict-checks.d.ts.map +1 -0
- package/dist/workflow/strict-checks.js +95 -0
- package/dist/workflow/strict-checks.js.map +1 -0
- package/dist/workflow/tool-state-io.d.ts +14 -0
- package/dist/workflow/tool-state-io.d.ts.map +1 -0
- package/dist/workflow/tool-state-io.js +33 -0
- package/dist/workflow/tool-state-io.js.map +1 -0
- package/dist/workflow/validators.d.ts +34 -0
- package/dist/workflow/validators.d.ts.map +1 -0
- package/dist/workflow/validators.js +83 -0
- package/dist/workflow/validators.js.map +1 -0
- package/dist/workflow/walk-helpers.d.ts +29 -0
- package/dist/workflow/walk-helpers.d.ts.map +1 -0
- package/dist/workflow/walk-helpers.js +89 -0
- package/dist/workflow/walk-helpers.js.map +1 -0
- package/dist/workflow/walker.d.ts +55 -0
- package/dist/workflow/walker.d.ts.map +1 -0
- package/dist/workflow/walker.js +199 -0
- package/dist/workflow/walker.js.map +1 -0
- package/package.json +21 -16
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/dist/index.d.ts
CHANGED
|
@@ -20,7 +20,25 @@ registeredValidatorTypes,
|
|
|
20
20
|
/** Extract the set of parameter types used in a tool bundle. */
|
|
21
21
|
collectParameterTypes,
|
|
22
22
|
/** Extract the set of validator types used in a tool bundle. */
|
|
23
|
-
collectValidatorTypes,
|
|
23
|
+
collectValidatorTypes, } from "./schema/index.js";
|
|
24
|
+
export {
|
|
25
|
+
/** Top-level bundle of tool parameters. */
|
|
26
|
+
type ToolParameterBundleModel,
|
|
27
|
+
/** Union of all tool parameter types (discriminated on parameter_type). */
|
|
28
|
+
type ToolParameterModel,
|
|
29
|
+
/** Union of leaf (non-container) Galaxy parameter types. */
|
|
30
|
+
type GalaxyParameterModel,
|
|
31
|
+
/** Union of container parameter types (section, repeat, conditional). */
|
|
32
|
+
type ContainerParameterModel,
|
|
33
|
+
/** Base fields shared by all leaf Galaxy parameter types. */
|
|
34
|
+
type BaseGalaxyParameterModel, type SelectParameterModel, type GenomeBuildParameterModel, type DrillDownParameterModel, type BooleanParameterModel, type SectionParameterModel, type RepeatParameterModel, type ConditionalParameterModel,
|
|
35
|
+
/** A single branch of a ConditionalParameterModel. */
|
|
36
|
+
type ConditionalWhen,
|
|
37
|
+
/** A label/value pair used in select and genomebuild options. */
|
|
38
|
+
type LabelValue, } from "./schema/bundle-types.js";
|
|
39
|
+
export {
|
|
40
|
+
/** True for gx_select, gx_genomebuild, gx_drill_down — params with an options list. */
|
|
41
|
+
isSelectLikeParam, isBooleanParam, isSectionParam, isRepeatParam, isConditionalParam, } from "./schema/type-guards.js";
|
|
24
42
|
export { type GalaxyWorkflow,
|
|
25
43
|
/** Union schema accepting any Galaxy workflow format (format2 or native). */
|
|
26
44
|
GalaxyWorkflowSchema, type NativeGalaxyWorkflow,
|
|
@@ -48,14 +66,40 @@ expandedFormat2,
|
|
|
48
66
|
expandedNative,
|
|
49
67
|
/** Check whether a string is a TRS (Tool Registry Service) URL. */
|
|
50
68
|
isTrsUrl, MAX_EXPANSION_DEPTH, type ExpandedFormat2Workflow, type ExpandedFormat2Step, type ExpandedNativeWorkflow, type ExpandedNativeStep, type RefResolver, type ExpansionOptions,
|
|
69
|
+
/** Convert native workflow to normalized Format2. */
|
|
70
|
+
toFormat2,
|
|
71
|
+
/** Convert Format2 workflow to normalized native. */
|
|
72
|
+
toNative,
|
|
73
|
+
/** Stateful native → format2 conversion using cached tool definitions. */
|
|
74
|
+
toFormat2Stateful,
|
|
75
|
+
/** Stateful format2 → native conversion using cached tool definitions. */
|
|
76
|
+
toNativeStateful, type StepConversionStatus, type StepConversionFailureClass, type StatefulExportResult, type StatefulNativeResult, type ToolInputsResolver,
|
|
77
|
+
/** Precheck a native workflow / step for stateful conversion compatibility. */
|
|
78
|
+
precheckNativeWorkflow, precheckNativeStep, type PrecheckResult, type StepPrecheckResult,
|
|
79
|
+
/** Effect Schema validation wrappers for stateful conversion (pre/post). */
|
|
80
|
+
ConversionValidationFailure, validateNativeStepState, validateFormat2StepState,
|
|
81
|
+
/** Strict format2 state validation — reports unknown keys as diagnostics. */
|
|
82
|
+
validateFormat2StepStateStrict, type ValidationPhase,
|
|
83
|
+
/** Navigate a tool parameter tree by path segments (for LSP completion/hover). */
|
|
84
|
+
findParamAtPath, type ParamNavigationResult,
|
|
85
|
+
/** Roundtrip a native workflow through format2 and back, diffing tool_state per step. */
|
|
86
|
+
roundtripValidate, type RoundtripResult, type RoundtripStrictOptions, type StepRoundtripResult, type BenignArtifactKind, type RoundtripFailureClass,
|
|
51
87
|
/** Scan native workflow tool_state for legacy parameter encoding signals. */
|
|
52
88
|
scanToolState, type LegacyEncodingClassification, type LegacyEncodingHit, type LegacyEncodingScanResult,
|
|
53
89
|
/** Clean a workflow — strip stale keys, decode legacy tool_state encoding. */
|
|
54
|
-
cleanWorkflow,
|
|
90
|
+
cleanWorkflow, type CleanWorkflowResult,
|
|
55
91
|
/** Detect whether a workflow dict is native (.ga) or format2 (.gxwf.yml). */
|
|
56
92
|
detectFormat, type WorkflowFormat,
|
|
93
|
+
/** Format-aware workflow serializer (JSON/YAML, configurable indent and newline). */
|
|
94
|
+
serializeWorkflow, type SerializeWorkflowOptions,
|
|
95
|
+
/** Resolve workflow format from an optional override, falling back to detectFormat. */
|
|
96
|
+
resolveFormat,
|
|
57
97
|
/** Lint context for tracking errors and warnings during workflow linting. */
|
|
58
98
|
LintContext,
|
|
99
|
+
/** Structured lint emission (message + level + linter + json_pointer). */
|
|
100
|
+
LintMessage,
|
|
101
|
+
/** Metadata-only base class for lint rules. */
|
|
102
|
+
Linter, LEVEL_ERROR, LEVEL_WARN,
|
|
59
103
|
/** Lint a native Galaxy workflow (.ga format). */
|
|
60
104
|
lintNative,
|
|
61
105
|
/** Lint a Format2 Galaxy workflow (.gxwf.yml format). */
|
|
@@ -65,5 +109,45 @@ lintWorkflow,
|
|
|
65
109
|
/** Lint best practices for a Format2 Galaxy workflow. */
|
|
66
110
|
lintBestPracticesFormat2,
|
|
67
111
|
/** Lint best practices for a native Galaxy workflow. */
|
|
68
|
-
lintBestPracticesNative, type LintResult,
|
|
112
|
+
lintBestPracticesNative, type LintLevel, type LintResult, type LinterRef, type EmitOptions,
|
|
113
|
+
/** Lint rule classes (one per rule id). */
|
|
114
|
+
NativeStepKeyNotInteger,
|
|
115
|
+
/** Lint profile catalog loader — parses `lint_profiles.yml`. */
|
|
116
|
+
parseLintProfiles, lintProfilesById, rulesForProfile, iwcRuleIds, LINT_PROFILES_FILENAME, IWC_PROFILE_NAMES, type LintProfile,
|
|
117
|
+
/** Strict encoding check — reject JSON-string tool_state (native) or tool_state field misuse (format2). */
|
|
118
|
+
validateEncodingNative, validateEncodingFormat2, checkStrictEncoding,
|
|
119
|
+
/** Strict structure check — reject unknown keys via onExcessProperty: "error". */
|
|
120
|
+
checkStrictStructure,
|
|
121
|
+
/** Inject `class` discriminator into workflow dict when missing (recursive over step subworkflows). */
|
|
122
|
+
withClass,
|
|
123
|
+
/** Effect-schema validator dispatch mirroring gxformat2/validators.py. */
|
|
124
|
+
validateFormat2, validateFormat2Strict, validateNative, validateNativeStrict, validatorForFixture, 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, type CleanWorkflowOptions, } from "./workflow/index.js";
|
|
125
|
+
export { ToolStateValidator, type ToolStateDiagnostic } from "./tool-state-validator.js";
|
|
126
|
+
export {
|
|
127
|
+
/** Validate a parsed *.gxwf-tests.yml / Planemo *-tests.yml document. */
|
|
128
|
+
validateTestsFile,
|
|
129
|
+
/** Raw JSON Schema synced from galaxy.tool_util_models.Tests (Python source of truth). */
|
|
130
|
+
testsSchema, type TestFormatDiagnostic,
|
|
131
|
+
/** Workflow-input DTO shared with the VS Code plugin. */
|
|
132
|
+
type WorkflowInput,
|
|
133
|
+
/** Workflow-output DTO shared with the VS Code plugin. */
|
|
134
|
+
type WorkflowOutput,
|
|
135
|
+
/** Workflow parameter type vocabulary (stringified; extractors don't canonicalize). */
|
|
136
|
+
type WorkflowDataType,
|
|
137
|
+
/** Workflow shape consumed by `checkTestsAgainstWorkflow`. */
|
|
138
|
+
type WorkflowShape,
|
|
139
|
+
/** Extract inputs from a parsed workflow dict (auto-detects format). */
|
|
140
|
+
extractWorkflowInputs,
|
|
141
|
+
/** Extract outputs from a parsed workflow dict (auto-detects format). */
|
|
142
|
+
extractWorkflowOutputs,
|
|
143
|
+
/** Format2-specific extractors (operate on raw parsed dicts, not AST). */
|
|
144
|
+
extractFormat2Inputs, extractFormat2Outputs,
|
|
145
|
+
/** Native (.ga) extractors (read step-level tool_state for default/optional). */
|
|
146
|
+
extractNativeInputs, extractNativeOutputs,
|
|
147
|
+
/** Coarse type compatibility used by cross-check; permissive default. Takes type *strings* on both sides. */
|
|
148
|
+
isCompatibleType,
|
|
149
|
+
/** Runtime type tag for a JS value, in the YAML-language-server AST vocabulary. */
|
|
150
|
+
jsTypeOf,
|
|
151
|
+
/** Cross-check a tests doc against workflow shape; emits JSON-pointer diagnostics. */
|
|
152
|
+
checkTestsAgainstWorkflow, } from "./test-format/index.js";
|
|
69
153
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO;AACL,0FAA0F;AAC1F,gBAAgB,EAChB,KAAK,mBAAmB;AACxB,4CAA4C;AAC5C,qBAAqB;AACrB,wEAAwE;AACxE,yBAAyB;AACzB,6DAA6D;AAC7D,wBAAwB;AACxB,wEAAwE;AACxE,yBAAyB;AACzB,6DAA6D;AAC7D,wBAAwB;AACxB,gEAAgE;AAChE,qBAAqB;AACrB,gEAAgE;AAChE,qBAAqB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO;AACL,0FAA0F;AAC1F,gBAAgB,EAChB,KAAK,mBAAmB;AACxB,4CAA4C;AAC5C,qBAAqB;AACrB,wEAAwE;AACxE,yBAAyB;AACzB,6DAA6D;AAC7D,wBAAwB;AACxB,wEAAwE;AACxE,yBAAyB;AACzB,6DAA6D;AAC7D,wBAAwB;AACxB,gEAAgE;AAChE,qBAAqB;AACrB,gEAAgE;AAChE,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAE3B,OAAO;AACL,2CAA2C;AAC3C,KAAK,wBAAwB;AAC7B,2EAA2E;AAC3E,KAAK,kBAAkB;AACvB,4DAA4D;AAC5D,KAAK,oBAAoB;AACzB,yEAAyE;AACzE,KAAK,uBAAuB;AAC5B,6DAA6D;AAC7D,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,yBAAyB;AAC9B,sDAAsD;AACtD,KAAK,eAAe;AACpB,iEAAiE;AACjE,KAAK,UAAU,GAChB,MAAM,0BAA0B,CAAC;AAElC,OAAO;AACL,uFAAuF;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zF,OAAO;AACL,yEAAyE;AACzE,iBAAiB;AACjB,0FAA0F;AAC1F,WAAW,EACX,KAAK,oBAAoB;AACzB,yDAAyD;AACzD,KAAK,aAAa;AAClB,0DAA0D;AAC1D,KAAK,cAAc;AACnB,uFAAuF;AACvF,KAAK,gBAAgB;AACrB,8DAA8D;AAC9D,KAAK,aAAa;AAClB,wEAAwE;AACxE,qBAAqB;AACrB,yEAAyE;AACzE,sBAAsB;AACtB,0EAA0E;AAC1E,oBAAoB,EACpB,qBAAqB;AACrB,iFAAiF;AACjF,mBAAmB,EACnB,oBAAoB;AACpB,6GAA6G;AAC7G,gBAAgB;AAChB,mFAAmF;AACnF,QAAQ;AACR,sFAAsF;AACtF,yBAAyB,GAC1B,MAAM,wBAAwB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -22,6 +22,9 @@ collectParameterTypes,
|
|
|
22
22
|
/** Extract the set of validator types used in a tool bundle. */
|
|
23
23
|
collectValidatorTypes, } from "./schema/index.js";
|
|
24
24
|
export {
|
|
25
|
+
/** True for gx_select, gx_genomebuild, gx_drill_down — params with an options list. */
|
|
26
|
+
isSelectLikeParam, isBooleanParam, isSectionParam, isRepeatParam, isConditionalParam, } from "./schema/type-guards.js";
|
|
27
|
+
export {
|
|
25
28
|
/** Union schema accepting any Galaxy workflow format (format2 or native). */
|
|
26
29
|
GalaxyWorkflowSchema,
|
|
27
30
|
/** Schema for raw native (.ga) Galaxy workflows. */
|
|
@@ -48,14 +51,40 @@ expandedFormat2,
|
|
|
48
51
|
expandedNative,
|
|
49
52
|
/** Check whether a string is a TRS (Tool Registry Service) URL. */
|
|
50
53
|
isTrsUrl, MAX_EXPANSION_DEPTH,
|
|
54
|
+
/** Convert native workflow to normalized Format2. */
|
|
55
|
+
toFormat2,
|
|
56
|
+
/** Convert Format2 workflow to normalized native. */
|
|
57
|
+
toNative,
|
|
58
|
+
/** Stateful native → format2 conversion using cached tool definitions. */
|
|
59
|
+
toFormat2Stateful,
|
|
60
|
+
/** Stateful format2 → native conversion using cached tool definitions. */
|
|
61
|
+
toNativeStateful,
|
|
62
|
+
/** Precheck a native workflow / step for stateful conversion compatibility. */
|
|
63
|
+
precheckNativeWorkflow, precheckNativeStep,
|
|
64
|
+
/** Effect Schema validation wrappers for stateful conversion (pre/post). */
|
|
65
|
+
ConversionValidationFailure, validateNativeStepState, validateFormat2StepState,
|
|
66
|
+
/** Strict format2 state validation — reports unknown keys as diagnostics. */
|
|
67
|
+
validateFormat2StepStateStrict,
|
|
68
|
+
/** Navigate a tool parameter tree by path segments (for LSP completion/hover). */
|
|
69
|
+
findParamAtPath,
|
|
70
|
+
/** Roundtrip a native workflow through format2 and back, diffing tool_state per step. */
|
|
71
|
+
roundtripValidate,
|
|
51
72
|
/** Scan native workflow tool_state for legacy parameter encoding signals. */
|
|
52
73
|
scanToolState,
|
|
53
74
|
/** Clean a workflow — strip stale keys, decode legacy tool_state encoding. */
|
|
54
75
|
cleanWorkflow,
|
|
55
76
|
/** Detect whether a workflow dict is native (.ga) or format2 (.gxwf.yml). */
|
|
56
77
|
detectFormat,
|
|
78
|
+
/** Format-aware workflow serializer (JSON/YAML, configurable indent and newline). */
|
|
79
|
+
serializeWorkflow,
|
|
80
|
+
/** Resolve workflow format from an optional override, falling back to detectFormat. */
|
|
81
|
+
resolveFormat,
|
|
57
82
|
/** Lint context for tracking errors and warnings during workflow linting. */
|
|
58
83
|
LintContext,
|
|
84
|
+
/** Structured lint emission (message + level + linter + json_pointer). */
|
|
85
|
+
LintMessage,
|
|
86
|
+
/** Metadata-only base class for lint rules. */
|
|
87
|
+
Linter, LEVEL_ERROR, LEVEL_WARN,
|
|
59
88
|
/** Lint a native Galaxy workflow (.ga format). */
|
|
60
89
|
lintNative,
|
|
61
90
|
/** Lint a Format2 Galaxy workflow (.gxwf.yml format). */
|
|
@@ -65,5 +94,37 @@ lintWorkflow,
|
|
|
65
94
|
/** Lint best practices for a Format2 Galaxy workflow. */
|
|
66
95
|
lintBestPracticesFormat2,
|
|
67
96
|
/** Lint best practices for a native Galaxy workflow. */
|
|
68
|
-
lintBestPracticesNative,
|
|
97
|
+
lintBestPracticesNative,
|
|
98
|
+
/** Lint rule classes (one per rule id). */
|
|
99
|
+
NativeStepKeyNotInteger,
|
|
100
|
+
/** Lint profile catalog loader — parses `lint_profiles.yml`. */
|
|
101
|
+
parseLintProfiles, lintProfilesById, rulesForProfile, iwcRuleIds, LINT_PROFILES_FILENAME, IWC_PROFILE_NAMES,
|
|
102
|
+
/** Strict encoding check — reject JSON-string tool_state (native) or tool_state field misuse (format2). */
|
|
103
|
+
validateEncodingNative, validateEncodingFormat2, checkStrictEncoding,
|
|
104
|
+
/** Strict structure check — reject unknown keys via onExcessProperty: "error". */
|
|
105
|
+
checkStrictStructure,
|
|
106
|
+
/** Inject `class` discriminator into workflow dict when missing (recursive over step subworkflows). */
|
|
107
|
+
withClass,
|
|
108
|
+
/** Effect-schema validator dispatch mirroring gxformat2/validators.py. */
|
|
109
|
+
validateFormat2, validateFormat2Strict, validateNative, validateNativeStrict, validatorForFixture, SKIP_STATUSES, validationSummary, validationFailures, cleanDisplayLabel, categoryOf, groupByCategory, buildSingleValidationReport, buildSingleLintReport, buildSingleCleanReport, buildWorkflowValidationResult, buildLintWorkflowResult, buildWorkflowCleanResult, buildTreeValidationReport, buildLintTreeReport, buildTreeCleanReport, buildWorkflowExportResult, buildExportTreeReport, buildWorkflowToNativeResult, buildToNativeTreeReport, buildRoundTripTreeReport, } from "./workflow/index.js";
|
|
110
|
+
export { ToolStateValidator } from "./tool-state-validator.js";
|
|
111
|
+
export {
|
|
112
|
+
/** Validate a parsed *.gxwf-tests.yml / Planemo *-tests.yml document. */
|
|
113
|
+
validateTestsFile,
|
|
114
|
+
/** Raw JSON Schema synced from galaxy.tool_util_models.Tests (Python source of truth). */
|
|
115
|
+
testsSchema,
|
|
116
|
+
/** Extract inputs from a parsed workflow dict (auto-detects format). */
|
|
117
|
+
extractWorkflowInputs,
|
|
118
|
+
/** Extract outputs from a parsed workflow dict (auto-detects format). */
|
|
119
|
+
extractWorkflowOutputs,
|
|
120
|
+
/** Format2-specific extractors (operate on raw parsed dicts, not AST). */
|
|
121
|
+
extractFormat2Inputs, extractFormat2Outputs,
|
|
122
|
+
/** Native (.ga) extractors (read step-level tool_state for default/optional). */
|
|
123
|
+
extractNativeInputs, extractNativeOutputs,
|
|
124
|
+
/** Coarse type compatibility used by cross-check; permissive default. Takes type *strings* on both sides. */
|
|
125
|
+
isCompatibleType,
|
|
126
|
+
/** Runtime type tag for a JS value, in the YAML-language-server AST vocabulary. */
|
|
127
|
+
jsTypeOf,
|
|
128
|
+
/** Cross-check a tests doc against workflow shape; emits JSON-pointer diagnostics. */
|
|
129
|
+
checkTestsAgainstWorkflow, } from "./test-format/index.js";
|
|
69
130
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO;AACL,0FAA0F;AAC1F,gBAAgB;AAEhB,4CAA4C;AAC5C,qBAAqB;AACrB,wEAAwE;AACxE,yBAAyB;AACzB,6DAA6D;AAC7D,wBAAwB;AACxB,wEAAwE;AACxE,yBAAyB;AACzB,6DAA6D;AAC7D,wBAAwB;AACxB,gEAAgE;AAChE,qBAAqB;AACrB,gEAAgE;AAChE,qBAAqB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO;AACL,0FAA0F;AAC1F,gBAAgB;AAEhB,4CAA4C;AAC5C,qBAAqB;AACrB,wEAAwE;AACxE,yBAAyB;AACzB,6DAA6D;AAC7D,wBAAwB;AACxB,wEAAwE;AACxE,yBAAyB;AACzB,6DAA6D;AAC7D,wBAAwB;AACxB,gEAAgE;AAChE,qBAAqB;AACrB,gEAAgE;AAChE,qBAAqB,GACtB,MAAM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
|
|
3
|
+
*
|
|
4
|
+
* Exported from the package index so consumers (e.g. language servers)
|
|
5
|
+
* don't need to duplicate these guards or reference bundle-types directly.
|
|
6
|
+
*/
|
|
7
|
+
import type { BooleanParameterModel, ConditionalParameterModel, DrillDownParameterModel, GenomeBuildParameterModel, RepeatParameterModel, SectionParameterModel, SelectParameterModel, ToolParameterModel } from "./bundle-types.js";
|
|
8
|
+
/** True for gx_select, gx_genomebuild, and gx_drill_down — params with a flat options list. */
|
|
9
|
+
export declare function isSelectLikeParam(p: ToolParameterModel): p is SelectParameterModel | GenomeBuildParameterModel | DrillDownParameterModel;
|
|
10
|
+
export declare function isBooleanParam(p: ToolParameterModel): p is BooleanParameterModel;
|
|
11
|
+
export declare function isSectionParam(p: ToolParameterModel): p is SectionParameterModel;
|
|
12
|
+
export declare function isRepeatParam(p: ToolParameterModel): p is RepeatParameterModel;
|
|
13
|
+
export declare function isConditionalParam(p: ToolParameterModel): p is ConditionalParameterModel;
|
|
14
|
+
//# sourceMappingURL=type-guards.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-guards.d.ts","sourceRoot":"","sources":["../../src/schema/type-guards.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,qBAAqB,EACrB,yBAAyB,EACzB,uBAAuB,EACvB,yBAAyB,EACzB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAE3B,+FAA+F;AAC/F,wBAAgB,iBAAiB,CAC/B,CAAC,EAAE,kBAAkB,GACpB,CAAC,IAAI,oBAAoB,GAAG,yBAAyB,GAAG,uBAAuB,CAMjF;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,kBAAkB,GAAG,CAAC,IAAI,qBAAqB,CAEhF;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,kBAAkB,GAAG,CAAC,IAAI,qBAAqB,CAEhF;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,kBAAkB,GAAG,CAAC,IAAI,oBAAoB,CAE9E;AAED,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,kBAAkB,GAAG,CAAC,IAAI,yBAAyB,CAExF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type guard predicates for ToolParameterModel discriminated union.
|
|
3
|
+
*
|
|
4
|
+
* Exported from the package index so consumers (e.g. language servers)
|
|
5
|
+
* don't need to duplicate these guards or reference bundle-types directly.
|
|
6
|
+
*/
|
|
7
|
+
/** True for gx_select, gx_genomebuild, and gx_drill_down — params with a flat options list. */
|
|
8
|
+
export function isSelectLikeParam(p) {
|
|
9
|
+
return (p.parameter_type === "gx_select" ||
|
|
10
|
+
p.parameter_type === "gx_genomebuild" ||
|
|
11
|
+
p.parameter_type === "gx_drill_down");
|
|
12
|
+
}
|
|
13
|
+
export function isBooleanParam(p) {
|
|
14
|
+
return p.parameter_type === "gx_boolean";
|
|
15
|
+
}
|
|
16
|
+
export function isSectionParam(p) {
|
|
17
|
+
return p.parameter_type === "gx_section";
|
|
18
|
+
}
|
|
19
|
+
export function isRepeatParam(p) {
|
|
20
|
+
return p.parameter_type === "gx_repeat";
|
|
21
|
+
}
|
|
22
|
+
export function isConditionalParam(p) {
|
|
23
|
+
return p.parameter_type === "gx_conditional";
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=type-guards.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-guards.js","sourceRoot":"","sources":["../../src/schema/type-guards.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAaH,+FAA+F;AAC/F,MAAM,UAAU,iBAAiB,CAC/B,CAAqB;IAErB,OAAO,CACL,CAAC,CAAC,cAAc,KAAK,WAAW;QAChC,CAAC,CAAC,cAAc,KAAK,gBAAgB;QACrC,CAAC,CAAC,cAAc,KAAK,eAAe,CACrC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,CAAqB;IAClD,OAAO,CAAC,CAAC,cAAc,KAAK,YAAY,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,CAAqB;IAClD,OAAO,CAAC,CAAC,cAAc,KAAK,YAAY,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,CAAqB;IACjD,OAAO,CAAC,CAAC,cAAc,KAAK,WAAW,CAAC;AAC1C,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,CAAqB;IACtD,OAAO,CAAC,CAAC,cAAc,KAAK,gBAAgB,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { TestFormatDiagnostic } from "../validate.js";
|
|
2
|
+
import type { WorkflowInput, WorkflowOutput } from "./types.js";
|
|
3
|
+
export interface WorkflowShape {
|
|
4
|
+
inputs: WorkflowInput[];
|
|
5
|
+
outputs: WorkflowOutput[];
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Cross-check a parsed tests document against workflow inputs/outputs. Emits
|
|
9
|
+
* one diagnostic per violation with a JSON-pointer path into the tests doc
|
|
10
|
+
* (matches Ajv's `instancePath`). Keywords:
|
|
11
|
+
*
|
|
12
|
+
* workflow_input_undefined job key not declared in workflow
|
|
13
|
+
* workflow_input_required required workflow input missing from job (and no default)
|
|
14
|
+
* workflow_input_type job value's JS type incompatible with declared type
|
|
15
|
+
* workflow_output_undefined output assertion name not declared in workflow
|
|
16
|
+
*/
|
|
17
|
+
export declare function checkTestsAgainstWorkflow(testsDoc: unknown, workflow: WorkflowShape): TestFormatDiagnostic[];
|
|
18
|
+
//# sourceMappingURL=check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../../src/test-format/cross-check/check.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAE3D,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAmBhE,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,OAAO,EAAE,cAAc,EAAE,CAAC;CAC3B;AAED;;;;;;;;;GASG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,OAAO,EACjB,QAAQ,EAAE,aAAa,GACtB,oBAAoB,EAAE,CA8DxB"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { isCompatibleType, jsTypeOf } from "./type-compat.js";
|
|
2
|
+
/**
|
|
3
|
+
* JSON-pointer escaping per RFC 6901 — `~` → `~0`, `/` → `~1`.
|
|
4
|
+
*/
|
|
5
|
+
function jptrEscape(s) {
|
|
6
|
+
return s.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
7
|
+
}
|
|
8
|
+
function jptr(parts) {
|
|
9
|
+
return "/" + parts.map((p) => jptrEscape(String(p))).join("/");
|
|
10
|
+
}
|
|
11
|
+
function asRecord(v) {
|
|
12
|
+
return v && typeof v === "object" && !Array.isArray(v)
|
|
13
|
+
? v
|
|
14
|
+
: undefined;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Cross-check a parsed tests document against workflow inputs/outputs. Emits
|
|
18
|
+
* one diagnostic per violation with a JSON-pointer path into the tests doc
|
|
19
|
+
* (matches Ajv's `instancePath`). Keywords:
|
|
20
|
+
*
|
|
21
|
+
* workflow_input_undefined job key not declared in workflow
|
|
22
|
+
* workflow_input_required required workflow input missing from job (and no default)
|
|
23
|
+
* workflow_input_type job value's JS type incompatible with declared type
|
|
24
|
+
* workflow_output_undefined output assertion name not declared in workflow
|
|
25
|
+
*/
|
|
26
|
+
export function checkTestsAgainstWorkflow(testsDoc, workflow) {
|
|
27
|
+
if (!Array.isArray(testsDoc))
|
|
28
|
+
return [];
|
|
29
|
+
const inputByName = new Map(workflow.inputs.map((i) => [i.name, i]));
|
|
30
|
+
const outputNames = new Set(workflow.outputs.map((o) => o.name));
|
|
31
|
+
const diagnostics = [];
|
|
32
|
+
for (let testIdx = 0; testIdx < testsDoc.length; testIdx++) {
|
|
33
|
+
const entry = asRecord(testsDoc[testIdx]);
|
|
34
|
+
if (!entry)
|
|
35
|
+
continue;
|
|
36
|
+
const job = asRecord(entry.job) ?? {};
|
|
37
|
+
const outputs = asRecord(entry.outputs) ?? {};
|
|
38
|
+
// Inputs: flag unknowns, check types.
|
|
39
|
+
for (const [name, value] of Object.entries(job)) {
|
|
40
|
+
const declared = inputByName.get(name);
|
|
41
|
+
if (!declared) {
|
|
42
|
+
diagnostics.push({
|
|
43
|
+
path: jptr([testIdx, "job", name]),
|
|
44
|
+
message: `Input '${name}' is not defined in the associated workflow.`,
|
|
45
|
+
keyword: "workflow_input_undefined",
|
|
46
|
+
params: { input: name },
|
|
47
|
+
});
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
const actualType = jsTypeOf(value);
|
|
51
|
+
if (!isCompatibleType(declared.type, actualType)) {
|
|
52
|
+
diagnostics.push({
|
|
53
|
+
path: jptr([testIdx, "job", name]),
|
|
54
|
+
message: `Input '${name}' has an invalid type. Expected '${declared.type}' but found '${actualType}'.`,
|
|
55
|
+
keyword: "workflow_input_type",
|
|
56
|
+
params: { input: name, declaredType: declared.type, actualType },
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
// Inputs: flag required ones missing from the job.
|
|
61
|
+
for (const declared of workflow.inputs) {
|
|
62
|
+
if (declared.optional === true)
|
|
63
|
+
continue;
|
|
64
|
+
if (declared.default !== undefined)
|
|
65
|
+
continue;
|
|
66
|
+
if (Object.prototype.hasOwnProperty.call(job, declared.name))
|
|
67
|
+
continue;
|
|
68
|
+
diagnostics.push({
|
|
69
|
+
path: jptr([testIdx, "job"]),
|
|
70
|
+
message: `Input '${declared.name}' is required but no value or default was provided.`,
|
|
71
|
+
keyword: "workflow_input_required",
|
|
72
|
+
params: { input: declared.name },
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
// Outputs: flag assertions for outputs the workflow doesn't declare.
|
|
76
|
+
for (const name of Object.keys(outputs)) {
|
|
77
|
+
if (!outputNames.has(name)) {
|
|
78
|
+
diagnostics.push({
|
|
79
|
+
path: jptr([testIdx, "outputs", name]),
|
|
80
|
+
message: `Output '${name}' is not defined in the associated workflow.`,
|
|
81
|
+
keyword: "workflow_output_undefined",
|
|
82
|
+
params: { output: name },
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return diagnostics;
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check.js","sourceRoot":"","sources":["../../../src/test-format/cross-check/check.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG9D;;GAEG;AACH,SAAS,UAAU,CAAC,CAAS;IAC3B,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AACpD,CAAC;AAED,SAAS,IAAI,CAAC,KAA0B;IACtC,OAAO,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACjE,CAAC;AAED,SAAS,QAAQ,CAAC,CAAU;IAC1B,OAAO,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QACpD,CAAC,CAAE,CAA6B;QAChC,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC;AAOD;;;;;;;;;GASG;AACH,MAAM,UAAU,yBAAyB,CACvC,QAAiB,EACjB,QAAuB;IAEvB,IAAI,CAAC,KA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GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC3B,WAAW,CAAC,IAAI,CAAC;oBACf,IAAI,EAAE,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;oBACtC,OAAO,EAAE,WAAW,IAAI,8CAA8C;oBACtE,OAAO,EAAE,2BAA2B;oBACpC,MAAM,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;iBACzB,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { WorkflowInput, WorkflowOutput } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Extract workflow inputs from a parsed Format2 (.gxwf.yml) workflow dict.
|
|
4
|
+
*
|
|
5
|
+
* Handles both dict form (`inputs: { name: { type: ... } }`) and list form
|
|
6
|
+
* (`inputs: [{ id: name, type: ... }]`). Plugin accepts both.
|
|
7
|
+
*/
|
|
8
|
+
export declare function extractFormat2Inputs(parsed: unknown): WorkflowInput[];
|
|
9
|
+
/**
|
|
10
|
+
* Extract workflow outputs from a parsed Format2 workflow dict.
|
|
11
|
+
*/
|
|
12
|
+
export declare function extractFormat2Outputs(parsed: unknown): WorkflowOutput[];
|
|
13
|
+
//# sourceMappingURL=extract-format2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract-format2.d.ts","sourceRoot":"","sources":["../../../src/test-format/cross-check/extract-format2.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAgChE;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,aAAa,EAAE,CAqBrE;AAUD;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,OAAO,GAAG,cAAc,EAAE,CAqBvE"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
function asRecord(v) {
|
|
2
|
+
return v && typeof v === "object" && !Array.isArray(v)
|
|
3
|
+
? v
|
|
4
|
+
: undefined;
|
|
5
|
+
}
|
|
6
|
+
function asString(v) {
|
|
7
|
+
return typeof v === "string" ? v : undefined;
|
|
8
|
+
}
|
|
9
|
+
function parseInputEntry(name, raw) {
|
|
10
|
+
// Shorthand: `name: File` or `name: int` — a bare string is the type.
|
|
11
|
+
if (typeof raw === "string") {
|
|
12
|
+
return { name, type: raw };
|
|
13
|
+
}
|
|
14
|
+
const entry = asRecord(raw);
|
|
15
|
+
if (!entry) {
|
|
16
|
+
return { name, type: "data" };
|
|
17
|
+
}
|
|
18
|
+
const type = asString(entry.type) ?? "data";
|
|
19
|
+
const doc = asString(entry.doc);
|
|
20
|
+
const optional = typeof entry.optional === "boolean" ? entry.optional : undefined;
|
|
21
|
+
const hasDefault = Object.prototype.hasOwnProperty.call(entry, "default");
|
|
22
|
+
const out = { name, type };
|
|
23
|
+
if (doc !== undefined)
|
|
24
|
+
out.doc = doc;
|
|
25
|
+
if (optional !== undefined)
|
|
26
|
+
out.optional = optional;
|
|
27
|
+
if (hasDefault)
|
|
28
|
+
out.default = entry.default;
|
|
29
|
+
return out;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Extract workflow inputs from a parsed Format2 (.gxwf.yml) workflow dict.
|
|
33
|
+
*
|
|
34
|
+
* Handles both dict form (`inputs: { name: { type: ... } }`) and list form
|
|
35
|
+
* (`inputs: [{ id: name, type: ... }]`). Plugin accepts both.
|
|
36
|
+
*/
|
|
37
|
+
export function extractFormat2Inputs(parsed) {
|
|
38
|
+
const wf = asRecord(parsed);
|
|
39
|
+
if (!wf)
|
|
40
|
+
return [];
|
|
41
|
+
const inputs = wf.inputs;
|
|
42
|
+
if (inputs === undefined || inputs === null)
|
|
43
|
+
return [];
|
|
44
|
+
if (Array.isArray(inputs)) {
|
|
45
|
+
const out = [];
|
|
46
|
+
for (const entry of inputs) {
|
|
47
|
+
const r = asRecord(entry);
|
|
48
|
+
if (!r)
|
|
49
|
+
continue;
|
|
50
|
+
const name = asString(r.id) ?? asString(r.name);
|
|
51
|
+
if (!name)
|
|
52
|
+
continue;
|
|
53
|
+
out.push(parseInputEntry(name, r));
|
|
54
|
+
}
|
|
55
|
+
return out;
|
|
56
|
+
}
|
|
57
|
+
const dict = asRecord(inputs);
|
|
58
|
+
if (!dict)
|
|
59
|
+
return [];
|
|
60
|
+
return Object.entries(dict).map(([name, raw]) => parseInputEntry(name, raw));
|
|
61
|
+
}
|
|
62
|
+
function parseOutputEntry(name, raw) {
|
|
63
|
+
const entry = asRecord(raw);
|
|
64
|
+
const doc = entry ? asString(entry.doc) : undefined;
|
|
65
|
+
const out = { name };
|
|
66
|
+
if (doc !== undefined)
|
|
67
|
+
out.doc = doc;
|
|
68
|
+
return out;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Extract workflow outputs from a parsed Format2 workflow dict.
|
|
72
|
+
*/
|
|
73
|
+
export function extractFormat2Outputs(parsed) {
|
|
74
|
+
const wf = asRecord(parsed);
|
|
75
|
+
if (!wf)
|
|
76
|
+
return [];
|
|
77
|
+
const outputs = wf.outputs;
|
|
78
|
+
if (outputs === undefined || outputs === null)
|
|
79
|
+
return [];
|
|
80
|
+
if (Array.isArray(outputs)) {
|
|
81
|
+
const out = [];
|
|
82
|
+
for (const entry of outputs) {
|
|
83
|
+
const r = asRecord(entry);
|
|
84
|
+
if (!r)
|
|
85
|
+
continue;
|
|
86
|
+
const name = asString(r.id) ?? asString(r.name);
|
|
87
|
+
if (!name)
|
|
88
|
+
continue;
|
|
89
|
+
out.push(parseOutputEntry(name, r));
|
|
90
|
+
}
|
|
91
|
+
return out;
|
|
92
|
+
}
|
|
93
|
+
const dict = asRecord(outputs);
|
|
94
|
+
if (!dict)
|
|
95
|
+
return [];
|
|
96
|
+
return Object.entries(dict).map(([name, raw]) => parseOutputEntry(name, raw));
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=extract-format2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract-format2.js","sourceRoot":"","sources":["../../../src/test-format/cross-check/extract-format2.ts"],"names":[],"mappings":"AAEA,SAAS,QAAQ,CAAC,CAAU;IAC1B,OAAO,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QACpD,CAAC,CAAE,CAA6B;QAChC,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC;AAED,SAAS,QAAQ,CAAC,CAAU;IAC1B,OAAO,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC/C,CAAC;AAED,SAAS,eAAe,CAAC,IAAY,EAAE,GAAY;IACjD,sEAAsE;IACtE,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;IAC7B,CAAC;IACD,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC5B,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAChC,CAAC;IACD,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC;IAC5C,MAAM,GAAG,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAChC,MAAM,QAAQ,GAAG,OAAO,KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;IAClF,MAAM,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IAC1E,MAAM,GAAG,GAAkB,EAA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AAI,EAAE,CAAC,CAAC,CAAC,CAAC;QACtC,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;IAED,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC/B,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IACrB,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,gBAAgB,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;AAChF,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { WorkflowInput, WorkflowOutput } from "./types.js";
|
|
2
|
+
export declare function extractNativeInputs(parsed: unknown): WorkflowInput[];
|
|
3
|
+
export declare function extractNativeOutputs(parsed: unknown): WorkflowOutput[];
|
|
4
|
+
//# sourceMappingURL=extract-native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract-native.d.ts","sourceRoot":"","sources":["../../../src/test-format/cross-check/extract-native.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAuChE,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,GAAG,aAAa,EAAE,CAqBpE;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,cAAc,EAAE,CAmBtE"}
|