@galaxy-tool-util/cli 1.4.0 → 1.6.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 (43) hide show
  1. package/dist/commands/draft-extract.d.ts +7 -0
  2. package/dist/commands/draft-extract.d.ts.map +1 -0
  3. package/dist/commands/draft-extract.js +75 -0
  4. package/dist/commands/draft-extract.js.map +1 -0
  5. package/dist/commands/draft-next-step.d.ts +6 -0
  6. package/dist/commands/draft-next-step.d.ts.map +1 -0
  7. package/dist/commands/draft-next-step.js +49 -0
  8. package/dist/commands/draft-next-step.js.map +1 -0
  9. package/dist/commands/draft-validate.d.ts +13 -0
  10. package/dist/commands/draft-validate.d.ts.map +1 -0
  11. package/dist/commands/draft-validate.js +272 -0
  12. package/dist/commands/draft-validate.js.map +1 -0
  13. package/dist/commands/report-output.d.ts +27 -1
  14. package/dist/commands/report-output.d.ts.map +1 -1
  15. package/dist/commands/report-output.js +32 -0
  16. package/dist/commands/report-output.js.map +1 -1
  17. package/dist/commands/validate-tool-source-tree.d.ts +28 -0
  18. package/dist/commands/validate-tool-source-tree.d.ts.map +1 -0
  19. package/dist/commands/validate-tool-source-tree.js +113 -0
  20. package/dist/commands/validate-tool-source-tree.js.map +1 -0
  21. package/dist/commands/validate-tool-source.d.ts +20 -0
  22. package/dist/commands/validate-tool-source.d.ts.map +1 -0
  23. package/dist/commands/validate-tool-source.js +52 -0
  24. package/dist/commands/validate-tool-source.js.map +1 -0
  25. package/dist/commands/validate-workflow.d.ts.map +1 -1
  26. package/dist/commands/validate-workflow.js +7 -1
  27. package/dist/commands/validate-workflow.js.map +1 -1
  28. package/dist/index.d.ts +6 -0
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js +4 -0
  31. package/dist/index.js.map +1 -1
  32. package/dist/meta/spec-types.d.ts +2 -0
  33. package/dist/meta/spec-types.d.ts.map +1 -1
  34. package/dist/programs/gxwf.d.ts.map +1 -1
  35. package/dist/programs/gxwf.js +10 -0
  36. package/dist/programs/gxwf.js.map +1 -1
  37. package/dist/spec/build-program.js +1 -1
  38. package/dist/spec/build-program.js.map +1 -1
  39. package/dist/workflow/_templates-bundled.d.ts.map +1 -1
  40. package/dist/workflow/_templates-bundled.js +117 -0
  41. package/dist/workflow/_templates-bundled.js.map +1 -1
  42. package/package.json +5 -5
  43. package/spec/gxwf.json +135 -0
@@ -0,0 +1,7 @@
1
+ export interface DraftExtractOptions {
2
+ output?: string;
3
+ reportJson?: string | boolean;
4
+ format?: string;
5
+ }
6
+ export declare function runDraftExtract(filePath: string, opts: DraftExtractOptions): Promise<void>;
7
+ //# sourceMappingURL=draft-extract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draft-extract.d.ts","sourceRoot":"","sources":["../../src/commands/draft-extract.ts"],"names":[],"mappings":"AA0BA,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAyDhG"}
@@ -0,0 +1,75 @@
1
+ /**
2
+ * `gxwf draft-extract` — extract the concrete subset of a draft workflow.
3
+ *
4
+ * Runs `extractConcreteSubset` from @galaxy-tool-util/schema, strips
5
+ * `_plan_*` planning fields, and promotes `class: GalaxyWorkflowDraft` →
6
+ * `class: GalaxyWorkflow` on any (sub)workflow that is now fully concrete.
7
+ * Emits the trimmed workflow to stdout (or `-o` file) and an optional
8
+ * sidecar JSON report.
9
+ *
10
+ * Exit codes:
11
+ * 0 — input parses + extract ran (including empty-extract case)
12
+ * 2 — parse/read failure, native input rejected, or stdout-sink collision
13
+ * (workflow → stdout AND --report-json → stdout simultaneously)
14
+ */
15
+ import { writeFile } from "node:fs/promises";
16
+ import { buildSingleDraftExtractReport, extractConcreteSubset, promoteFullyConcreteDrafts, resolveFormat, serializeWorkflow, stripPlanFields, } from "@galaxy-tool-util/schema";
17
+ import { readWorkflowFile, writeWorkflowOutput } from "./workflow-io.js";
18
+ import { findStdoutSinkCollision, targetsStdout } from "./report-output.js";
19
+ export async function runDraftExtract(filePath, opts) {
20
+ const collision = findStdoutSinkCollision([
21
+ { flag: "<workflow output>", toStdout: !opts.output },
22
+ { flag: "--report-json", toStdout: targetsStdout(opts.reportJson) },
23
+ ]);
24
+ if (collision) {
25
+ console.error(collision);
26
+ process.exitCode = 2;
27
+ return;
28
+ }
29
+ const data = await readWorkflowFile(filePath);
30
+ if (!data) {
31
+ process.exitCode = 2;
32
+ return;
33
+ }
34
+ const format = resolveFormat(data, opts.format);
35
+ if (format === "native") {
36
+ console.error("draft-extract requires format2 — native workflows cannot be drafts");
37
+ process.exitCode = 2;
38
+ return;
39
+ }
40
+ const extract = extractConcreteSubset(data);
41
+ stripPlanFields(extract.workflow);
42
+ const promote = promoteFullyConcreteDrafts(extract.workflow);
43
+ const trimmed = extract.workflow != null && typeof extract.workflow === "object"
44
+ ? extract.workflow
45
+ : {};
46
+ const classAfter = trimmed.class === "GalaxyWorkflow" ? "GalaxyWorkflow" : "GalaxyWorkflowDraft";
47
+ const outputFormat = outputFormatFor(opts.output, format);
48
+ const serialized = serializeWorkflow(trimmed, outputFormat);
49
+ await writeWorkflowOutput(serialized, opts.output, "Extracted workflow");
50
+ if (opts.reportJson !== undefined) {
51
+ const report = buildSingleDraftExtractReport(filePath, opts.output ?? null, extract, promote, classAfter);
52
+ const json = JSON.stringify(report, null, 2);
53
+ const dest = opts.reportJson;
54
+ if (dest === true || dest === "-") {
55
+ console.log(json);
56
+ }
57
+ else {
58
+ await writeFile(dest, json + "\n", "utf-8");
59
+ }
60
+ }
61
+ process.exitCode = 0;
62
+ }
63
+ /**
64
+ * Resolve the workflow serialization format from -o's extension, falling
65
+ * back to the detected input format. `.ga` / `.json` → native (JSON);
66
+ * `.gxwf.yml` / other → format2 (YAML).
67
+ */
68
+ function outputFormatFor(output, fallback) {
69
+ if (!output)
70
+ return fallback;
71
+ if (output.endsWith(".ga") || output.endsWith(".json"))
72
+ return "native";
73
+ return "format2";
74
+ }
75
+ //# sourceMappingURL=draft-extract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draft-extract.js","sourceRoot":"","sources":["../../src/commands/draft-extract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,EACrB,0BAA0B,EAC1B,aAAa,EACb,iBAAiB,EACjB,eAAe,GAChB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAQ5E,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,QAAgB,EAAE,IAAyB;IAC/E,MAAM,SAAS,GAAG,uBAAuB,CAAC;QACxC,EAAE,IAAI,EAAE,mBAAmB,EAAE,QAAQ,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE;QACrD,EAAE,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE;KACpE,CAAC,CAAC;IACH,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QACzB,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACrB,OAAO;IACT,CAAC;IAED,MAAM,IAAI,GAAG,MAAM,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC9C,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACrB,OAAO;IACT,CAAC;IAED,MAAM,MAAM,GAA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7B,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YAClC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACpB,CAAC;aAAM,CAAC;YACN,MAAM,SAAS,CAAC,IAAc,EAAE,IAAI,GAAG,IAAI,EAAE,OAAO,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;IAED,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC;AAED;;;;GAIG;AACH,SAAS,eAAe,CACtB,MAA0B,EAC1B,QAA8B;IAE9B,IAAI,CAAC,MAAM;QAAE,OAAO,QAAQ,CAAC;IAC7B,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC;QAAE,OAAO,QAAQ,CAAC;IACxE,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1,6 @@
1
+ export interface DraftNextStepOptions {
2
+ format?: string;
3
+ outputFormat?: "json" | "markdown" | string;
4
+ }
5
+ export declare function runDraftNextStep(filePath: string, opts: DraftNextStepOptions): Promise<void>;
6
+ //# sourceMappingURL=draft-next-step.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draft-next-step.d.ts","sourceRoot":"","sources":["../../src/commands/draft-next-step.ts"],"names":[],"mappings":"AAeA,MAAM,WAAW,oBAAoB;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,CAAC;CAC7C;AAED,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,oBAAoB,GACzB,OAAO,CAAC,IAAI,CAAC,CA4Bf"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * `gxwf draft-next-step` — pick the next step a downstream agent should
3
+ * work on. Wraps `nextDraftStep` from @galaxy-tool-util/schema.
4
+ *
5
+ * Default output is JSON (the agent-loop wire format); `--output-format
6
+ * markdown` renders a human-glance checklist. Pure pass-through — same
7
+ * input → byte-identical output.
8
+ *
9
+ * Exit codes:
10
+ * 0 — input parses + is a (possibly non-draft) workflow document
11
+ * 2 — parse/read failure or format mismatch (native rejected)
12
+ */
13
+ import { nextDraftStep, resolveFormat } from "@galaxy-tool-util/schema";
14
+ import { readWorkflowFile } from "./workflow-io.js";
15
+ export async function runDraftNextStep(filePath, opts) {
16
+ const data = await readWorkflowFile(filePath);
17
+ if (!data) {
18
+ process.exitCode = 2;
19
+ return;
20
+ }
21
+ const format = resolveFormat(data, opts.format);
22
+ if (format === "native") {
23
+ console.error("draft-next-step requires format2 — native workflows cannot be drafts");
24
+ process.exitCode = 2;
25
+ return;
26
+ }
27
+ const result = nextDraftStep(data);
28
+ const outputFormat = opts.outputFormat ?? "json";
29
+ if (outputFormat === "markdown") {
30
+ process.stdout.write(renderMarkdown(result));
31
+ }
32
+ else if (outputFormat === "json") {
33
+ console.log(JSON.stringify(result, null, 2));
34
+ }
35
+ else {
36
+ console.error(`unknown --output-format: ${outputFormat} (expected json or markdown)`);
37
+ process.exitCode = 2;
38
+ return;
39
+ }
40
+ process.exitCode = 0;
41
+ }
42
+ function renderMarkdown(result) {
43
+ if (!result.draft)
44
+ return "_No remaining draft work._\n";
45
+ const heading = `## Next step: \`${result.step.join(" / ")}\`\n\n`;
46
+ const items = result.work.map((w) => `- [ ] ${w}`).join("\n");
47
+ return heading + items + "\n";
48
+ }
49
+ //# sourceMappingURL=draft-next-step.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draft-next-step.js","sourceRoot":"","sources":["../../src/commands/draft-next-step.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,aAAa,EAAE,aAAa,EAAuB,MAAM,0BAA0B,CAAC;AAC7F,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAOpD,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,QAAgB,EAChB,IAA0B;I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I,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9D,OAAO,OAAO,GAAG,KAAK,GAAG,IAAI,CAAC;AAChC,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { type StrictOptions } from "./strict-options.js";
2
+ export interface DraftValidateOptions extends StrictOptions {
3
+ format?: string;
4
+ json?: boolean;
5
+ reportHtml?: string | boolean;
6
+ reportMarkdown?: string | boolean;
7
+ concrete?: boolean;
8
+ cacheDir?: string;
9
+ toolState?: boolean;
10
+ connections?: boolean;
11
+ }
12
+ export declare function runDraftValidate(filePath: string, opts: DraftValidateOptions): Promise<void>;
13
+ //# sourceMappingURL=draft-validate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draft-validate.d.ts","sourceRoot":"","sources":["../../src/commands/draft-validate.ts"],"names":[],"mappings":"AAuDA,OAAO,EAAwB,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAI/E,MAAM,WAAW,oBAAqB,SAAQ,aAAa;IACzD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC9B,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,oBAAoB,GACzB,OAAO,CAAC,IAAI,CAAC,CA4Cf"}
@@ -0,0 +1,272 @@
1
+ /**
2
+ * `gxwf draft-validate` — validate a draft Galaxy workflow
3
+ * (class: GalaxyWorkflowDraft).
4
+ *
5
+ * Wraps `validateDraft` from @galaxy-tool-util/schema. Single-file only; the
6
+ * tree variant is deferred to workstream v2.
7
+ *
8
+ * With `--concrete`, additionally runs the `draft-extract` pipeline
9
+ * (extractConcreteSubset + stripPlanFields + promoteFullyConcreteDrafts) and
10
+ * runs the regular `gxwf validate` checks on the trimmed workflow:
11
+ * - structural decode (always)
12
+ * - --strict-structure / --strict-encoding (when the strict flags are set)
13
+ * - tool-state validation (default on, --no-tool-state to skip, --cache-dir
14
+ * selects the cache)
15
+ * - --strict-state (when set, escalates skipped tool-state steps to errors)
16
+ * - --connections (when set, runs connection-type compatibility)
17
+ *
18
+ * When the extracted subset is still a draft (not fully promoted), every
19
+ * concrete-stage check is skipped, not failed. The concrete pass is also
20
+ * skipped entirely when the draft has structural errors (the projection
21
+ * isn't trustworthy in that case).
22
+ *
23
+ * Exit-code differences vs. `gxwf validate`: `gxwf validate` exits 2 on
24
+ * strict-structure / strict-encoding failures; here, those roll into the
25
+ * concrete report and escalate to exit 1 — the draft itself parsed; only the
26
+ * projection failed.
27
+ *
28
+ * Exit codes (per workstream C):
29
+ * 0 — clean draft (no structure/topology/semantic errors; warnings allowed)
30
+ * 1 — draft validation errors (topology or semantic errors), OR --concrete
31
+ * checks surfaced any failure
32
+ * 2 — parse failure, format mismatch, or structural decode failure
33
+ * (class !== GalaxyWorkflowDraft, schema decode error)
34
+ */
35
+ import { dirname } from "node:path";
36
+ import { makeNodeToolCache } from "@galaxy-tool-util/core/node";
37
+ import { buildSingleDraftValidationReport, checkStrictEncoding, checkStrictStructure, extractConcreteSubset, promoteFullyConcreteDrafts, resolveFormat, stripPlanFields, validateDraft, } from "@galaxy-tool-util/schema";
38
+ import { decodeStructureErrors, validateFormat2Steps } from "./validate-workflow.js";
39
+ import { readWorkflowFile } from "./workflow-io.js";
40
+ import { findStdoutSinkConflict, writeReportHtml, writeReportOutput } from "./report-output.js";
41
+ import { resolveStrictOptions } from "./strict-options.js";
42
+ import { buildConnectionReport } from "./connection-validation.js";
43
+ import { createDefaultResolver } from "./url-resolver.js";
44
+ export async function runDraftValidate(filePath, opts) {
45
+ const conflict = findStdoutSinkConflict(opts);
46
+ if (conflict) {
47
+ console.error(conflict);
48
+ process.exitCode = 2;
49
+ return;
50
+ }
51
+ const data = await readWorkflowFile(filePath);
52
+ if (!data) {
53
+ process.exitCode = 2;
54
+ return;
55
+ }
56
+ const format = resolveFormat(data, opts.format);
57
+ if (format === "native") {
58
+ console.error("draft-validate requires format2 — native workflows cannot be drafts");
59
+ process.exitCode = 2;
60
+ return;
61
+ }
62
+ warnUnusedConcreteFlags(opts);
63
+ const result = validateDraft(data);
64
+ // Gate the concrete pass on draft-structure cleanliness — extractConcreteSubset
65
+ // early-returns the input object verbatim when class != GalaxyWorkflowDraft,
66
+ // and stripPlanFields would then mutate the original `data`. Skipping also
67
+ // avoids running validate checks on a draft we know is structurally broken.
68
+ const concrete = opts.concrete && result.structureErrors.length === 0
69
+ ? await runConcretePass(filePath, data, opts)
70
+ : undefined;
71
+ const report = buildSingleDraftValidationReport(filePath, result, concrete);
72
+ if (opts.json) {
73
+ console.log(JSON.stringify(report, null, 2));
74
+ }
75
+ else {
76
+ printTextReport(report, result);
77
+ }
78
+ await writeReportOutput("draft_validate.md.j2", report, opts);
79
+ await writeReportHtml("draft-validate", report, opts.reportHtml);
80
+ process.exitCode = exitCodeFor(result, concrete);
81
+ }
82
+ function warnUnusedConcreteFlags(opts) {
83
+ if (opts.concrete) {
84
+ if (opts.toolState === false && opts.strictState) {
85
+ console.error("Warning: --strict-state has no effect when tool-state validation is disabled (--no-tool-state)");
86
+ }
87
+ return;
88
+ }
89
+ const ignored = [];
90
+ if (opts.cacheDir)
91
+ ignored.push("--cache-dir");
92
+ if (opts.toolState === false)
93
+ ignored.push("--no-tool-state");
94
+ if (opts.connections)
95
+ ignored.push("--connections");
96
+ if (opts.strict || opts.strictStructure || opts.strictEncoding || opts.strictState) {
97
+ ignored.push("--strict*");
98
+ }
99
+ if (ignored.length > 0) {
100
+ console.error(`Warning: ${ignored.join(", ")} only apply with --concrete; ignoring`);
101
+ }
102
+ }
103
+ async function runConcretePass(filePath, data, opts) {
104
+ const extract = extractConcreteSubset(data);
105
+ stripPlanFields(extract.workflow);
106
+ promoteFullyConcreteDrafts(extract.workflow);
107
+ const trimmed = extract.workflow != null && typeof extract.workflow === "object"
108
+ ? extract.workflow
109
+ : {};
110
+ const class_after = trimmed.class === "GalaxyWorkflow" ? "GalaxyWorkflow" : "GalaxyWorkflowDraft";
111
+ // Defense-in-depth: for any draft input the gate at the call site lets
112
+ // through, extract+strip+promote always promotes the outer class. The only
113
+ // way to hit this branch is an exotic shape (e.g. inline subworkflow draft
114
+ // that itself fails promotion). Leaving the check here keeps the contract
115
+ // explicit: never decode an unpromoted subset against GalaxyWorkflowSchema.
116
+ if (class_after !== "GalaxyWorkflow") {
117
+ return {
118
+ class_after,
119
+ skipped_reason: "extracted subset is still a draft — not fully promoted",
120
+ structure_errors: [],
121
+ // ok=null (not true) — concrete validation didn't run, so we cannot
122
+ // claim the subset would have validated. Downstream readers must treat
123
+ // null as "unknown," not as a pass.
124
+ ok: null,
125
+ };
126
+ }
127
+ const strict = resolveStrictOptions(opts);
128
+ const report = {
129
+ class_after,
130
+ skipped_reason: null,
131
+ structure_errors: decodeStructureErrors(trimmed, "format2"),
132
+ ok: true,
133
+ };
134
+ if (strict.strictStructure) {
135
+ report.strict_structure_errors = checkStrictStructure(trimmed, "format2");
136
+ }
137
+ if (strict.strictEncoding) {
138
+ report.strict_encoding_errors = checkStrictEncoding(trimmed, "format2");
139
+ }
140
+ // Tool-state defaults to ON (matches `gxwf validate`); --no-tool-state opts out.
141
+ const toolStateEnabled = opts.toolState !== false;
142
+ if (toolStateEnabled) {
143
+ const cache = makeNodeToolCache({ cacheDir: opts.cacheDir });
144
+ await cache.index.load();
145
+ const expansionOpts = {
146
+ resolver: createDefaultResolver({ workflowDirectory: dirname(filePath) }),
147
+ };
148
+ const stepResults = await validateFormat2Steps(trimmed, cache, "", expansionOpts);
149
+ report.tool_state = {
150
+ results: stepResults,
151
+ summary: summarize(stepResults),
152
+ };
153
+ if (strict.strictState) {
154
+ const skipped = stepResults.filter((r) => r.status !== "ok" && r.status !== "fail");
155
+ report.strict_state_errors = skipped.map((r) => `${r.step} (${r.tool_id ?? "?"}): skipped (${r.status})`);
156
+ }
157
+ if (opts.connections) {
158
+ report.connection_report = await buildConnectionReport(trimmed, cache);
159
+ }
160
+ }
161
+ else if (opts.connections) {
162
+ // --connections without tool-state still needs a cache to look up tools.
163
+ const cache = makeNodeToolCache({ cacheDir: opts.cacheDir });
164
+ await cache.index.load();
165
+ report.connection_report = await buildConnectionReport(trimmed, cache);
166
+ }
167
+ report.ok = isConcreteOk(report);
168
+ return report;
169
+ }
170
+ function summarize(results) {
171
+ let ok = 0;
172
+ let fail = 0;
173
+ let skip = 0;
174
+ for (const r of results) {
175
+ if (r.status === "ok")
176
+ ok++;
177
+ else if (r.status === "fail")
178
+ fail++;
179
+ else
180
+ skip++;
181
+ }
182
+ return { ok, fail, skip };
183
+ }
184
+ function isConcreteOk(c) {
185
+ if (c.skipped_reason !== null)
186
+ return null;
187
+ if (c.structure_errors.length > 0)
188
+ return false;
189
+ if (c.strict_structure_errors && c.strict_structure_errors.length > 0)
190
+ return false;
191
+ if (c.strict_encoding_errors && c.strict_encoding_errors.length > 0)
192
+ return false;
193
+ if (c.strict_state_errors && c.strict_state_errors.length > 0)
194
+ return false;
195
+ if (c.tool_state && c.tool_state.summary.fail > 0)
196
+ return false;
197
+ if (c.connection_report && !c.connection_report.valid)
198
+ return false;
199
+ return true;
200
+ }
201
+ function exitCodeFor(result, concrete) {
202
+ if (result.structureErrors.length > 0)
203
+ return 2;
204
+ if (result.topologyErrors.length > 0 || result.semanticErrors.length > 0)
205
+ return 1;
206
+ // Only explicit `false` escalates — `null` (skipped) is informational.
207
+ if (concrete && concrete.ok === false)
208
+ return 1;
209
+ return 0;
210
+ }
211
+ function printTextReport(report, result) {
212
+ console.log(`Draft validation: ${report.workflow}`);
213
+ console.log(` ${report.summary}`);
214
+ printBucket("Structure errors", result.structureErrors);
215
+ printBucket("Topology errors", result.topologyErrors);
216
+ printBucket("Semantic errors", result.semanticErrors);
217
+ printBucket("Warnings", result.warnings);
218
+ const survey = report.survey;
219
+ console.log(` Survey: ${survey.todo_count} TODO sentinel${survey.todo_count === 1 ? "" : "s"}` +
220
+ ` across ${survey.todo_paths.length} step path${survey.todo_paths.length === 1 ? "" : "s"};` +
221
+ ` ${survey.plan_step_paths.length} step${survey.plan_step_paths.length === 1 ? "" : "s"} with _plan_* fields`);
222
+ if (report.concrete)
223
+ printConcrete(report.concrete);
224
+ }
225
+ function printConcrete(concrete) {
226
+ if (concrete.skipped_reason) {
227
+ console.log(` Concrete: SKIPPED (${concrete.skipped_reason})`);
228
+ return;
229
+ }
230
+ console.log(` Concrete: ${concrete.ok === true ? "OK" : "FAIL"}`);
231
+ printList(" Structure errors", concrete.structure_errors);
232
+ if (concrete.strict_structure_errors)
233
+ printList(" Strict-structure errors", concrete.strict_structure_errors);
234
+ if (concrete.strict_encoding_errors)
235
+ printList(" Strict-encoding errors", concrete.strict_encoding_errors);
236
+ if (concrete.strict_state_errors)
237
+ printList(" Strict-state errors", concrete.strict_state_errors);
238
+ if (concrete.tool_state) {
239
+ const { ok, fail, skip } = concrete.tool_state.summary;
240
+ console.log(` Tool state: ${ok} ok, ${fail} fail, ${skip} skip`);
241
+ for (const r of concrete.tool_state.results) {
242
+ if (r.status === "ok")
243
+ continue;
244
+ const tag = r.tool_id ? `${r.step} (${r.tool_id})` : r.step;
245
+ console.log(` ${tag} [${r.status}]`);
246
+ for (const e of r.errors)
247
+ console.log(` ${e}`);
248
+ }
249
+ }
250
+ if (concrete.connection_report) {
251
+ const cr = concrete.connection_report;
252
+ const { ok = 0, invalid = 0, skip = 0 } = cr.summary;
253
+ console.log(` Connections: ${cr.valid ? "OK" : "INVALID"} — ${ok} ok, ${invalid} invalid, ${skip} skip`);
254
+ }
255
+ }
256
+ function printList(label, lines) {
257
+ if (lines.length === 0)
258
+ return;
259
+ console.log(`${label} (${lines.length}):`);
260
+ for (const line of lines)
261
+ console.log(` ${line}`);
262
+ }
263
+ function printBucket(label, diagnostics) {
264
+ if (diagnostics.length === 0)
265
+ return;
266
+ console.log(` ${label} (${diagnostics.length}):`);
267
+ for (const d of diagnostics) {
268
+ const where = d.path.length === 0 ? "<workflow>" : d.path.join("/");
269
+ console.log(` ${where}: ${d.message}`);
270
+ }
271
+ }
272
+ //# sourceMappingURL=draft-validate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draft-validate.js","sourceRoot":"","sources":["../../src/commands/draft-validate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EACL,gCAAgC,EAChC,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,0BAA0B,EAC1B,aAAa,EACb,eAAe,EACf,aAAa,GAOd,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAChG,OAAO,EAAE,oBAAoB,EAAsB,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAa1D,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,QAAgB,EAChB,IAA0B;IAE1B,MAAM,QAAQ,GAAG,sBAAsB,CAAC,IAAI,CAAC,CAAC;IAC9C,IAAI,QAAQ,EAAE,C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AAC,MAAM,KAAK,CAAC;QAAE,OAAO;IACrC,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,KAAK,WAAW,CAAC,MAAM,IAAI,CAAC,CAAC;IACnD,KAAK,MAAM,CAAC,IAAI,WAAW,EAAE,CAAC;QAC5B,MAAM,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACpE,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IAC5C,CAAC;AACH,CAAC"}
@@ -1,4 +1,4 @@
1
- export type ReportType = "validate" | "lint" | "clean" | "validate-tree" | "lint-tree" | "clean-tree" | "roundtrip-tree";
1
+ export type ReportType = "validate" | "lint" | "clean" | "draft-validate" | "validate-tree" | "lint-tree" | "clean-tree" | "roundtrip-tree";
2
2
  export interface ReportOutputOptions {
3
3
  /**
4
4
  * Path to write Markdown report to. Commander sets this to `true` (boolean)
@@ -9,6 +9,32 @@ export interface ReportOutputOptions {
9
9
  /** Same semantics as reportMarkdown but for HTML output. */
10
10
  reportHtml?: string | boolean;
11
11
  }
12
+ /** True if dest is unset to a filename and would write to stdout. */
13
+ declare function targetsStdout(dest: string | boolean | undefined): boolean;
14
+ /**
15
+ * If more than one sink in `candidates` would write to stdout, return an
16
+ * error message naming the conflicting flags. Otherwise null.
17
+ *
18
+ * Generalizes `findStdoutSinkConflict` for commands whose stdout sinks
19
+ * aren't drawn from the standard `--json` / `--report-{html,markdown}`
20
+ * set (e.g. `draft-extract` writes the trimmed workflow to stdout by
21
+ * default + `--report-json` may also target stdout).
22
+ */
23
+ export declare function findStdoutSinkCollision(candidates: Array<{
24
+ flag: string;
25
+ toStdout: boolean;
26
+ }>): string | null;
27
+ /**
28
+ * If more than one report sink (JSON + rendered reports) would write to
29
+ * stdout, return an error message describing the conflict. Otherwise null.
30
+ */
31
+ export declare function findStdoutSinkConflict(opts: {
32
+ json?: boolean;
33
+ reportHtml?: string | boolean;
34
+ reportMarkdown?: string | boolean;
35
+ }): string | null;
36
+ /** Re-export for command handlers that need their own collision-detection sites. */
37
+ export { targetsStdout };
12
38
  /**
13
39
  * Render and write report output if --report-markdown / --report-html flags
14
40
  * were passed. Both can be specified simultaneously.
@@ -1 +1 @@
1
- {"version":3,"file":"report-output.d.ts","sourceRoot":"","sources":["../../src/commands/report-output.ts"],"names":[],"mappings":"AAWA,MAAM,MAAM,UAAU,GAClB,UAAU,GACV,MAAM,GACN,OAAO,GACP,eAAe,GACf,WAAW,GACX,YAAY,GACZ,gBAAgB,CAAC;AAErB,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAClC,4DAA4D;IAC5D,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAC/B;AAED;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CACrC,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,mBAAmB,GACxB,OAAO,CAAC,IAAI,CAAC,CAUf;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,SAAgB,GAAG,MAAM,CAgB9F;AAED;;;GAGG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,OAAO,EACb,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,EAClC,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC,CAQf"}
1
+ {"version":3,"file":"report-output.d.ts","sourceRoot":"","sources":["../../src/commands/report-output.ts"],"names":[],"mappings":"AAWA,MAAM,MAAM,UAAU,GAClB,UAAU,GACV,MAAM,GACN,OAAO,GACP,gBAAgB,GAChB,eAAe,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38 @@ import { renderReport } from "../workflow/report-templates.js";
7
7
  // Bump when a new shell version with user-visible changes is released to npm.
8
8
  const SHELL_CDN_VERSION = "0.1.0";
9
9
  const SHELL_CDN_BASE = `https://cdn.jsdelivr.net/npm/@galaxy-tool-util/gxwf-report-shell@${SHELL_CDN_VERSION}/dist`;
10
+ /** True if dest is unset to a filename and would write to stdout. */
11
+ function targetsStdout(dest) {
12
+ return dest === true || dest === "-";
13
+ }
14
+ /**
15
+ * If more than one sink in `candidates` would write to stdout, return an
16
+ * error message naming the conflicting flags. Otherwise null.
17
+ *
18
+ * Generalizes `findStdoutSinkConflict` for commands whose stdout sinks
19
+ * aren't drawn from the standard `--json` / `--report-{html,markdown}`
20
+ * set (e.g. `draft-extract` writes the trimmed workflow to stdout by
21
+ * default + `--report-json` may also target stdout).
22
+ */
23
+ export function findStdoutSinkCollision(candidates) {
24
+ const sinks = candidates.filter((c) => c.toStdout).map((c) => c.flag);
25
+ if (sinks.length < 2)
26
+ return null;
27
+ return `cannot write ${sinks.join(" + ")} to stdout simultaneously — pick one, or redirect a report to a file`;
28
+ }
29
+ /**
30
+ * If more than one report sink (JSON + rendered reports) would write to
31
+ * stdout, return an error message describing the conflict. Otherwise null.
32
+ */
33
+ export function findStdoutSinkConflict(opts) {
34
+ return findStdoutSinkCollision([
35
+ { flag: "--json", toStdout: !!opts.json },
36
+ { flag: "--report-html", toStdout: targetsStdout(opts.reportHtml) },
37
+ { flag: "--report-markdown", toStdout: targetsStdout(opts.reportMarkdown) },
38
+ ]);
39
+ }
40
+ /** Re-export for command handlers that need their own collision-detection sites. */
41
+ export { targetsStdout };
10
42
  /**
11
43
  * Render and write report output if --report-markdown / --report-html flags
12
44
  * were passed. Both can be specified simultaneously.
@@ -1 +1 @@
1
- {"version":3,"file":"report-output.js","sourceRoot":"","sources":["../../src/commands/report-output.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO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GAAG,EAAE,CAAC;QAClC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAChC,CAAC;SAAM,CAAC;QACN,MAAM,SAAS,CAAC,IAAc,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACpD,CAAC;AACH,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * ``gxwf validate-tool-source-tree`` — batch-validate every user-defined tool
3
+ * source YAML under a directory. Discovery parses each candidate YAML and
4
+ * checks for ``class: GalaxyUserTool`` / ``class: GalaxyTool`` rather than
5
+ * relying on a filename suffix (UDTs don't have an established convention).
6
+ */
7
+ import { type UserToolSourceDiagnostic } from "@galaxy-tool-util/schema";
8
+ export interface ValidateToolSourceTreeOptions {
9
+ json?: boolean;
10
+ schemaOnly?: boolean;
11
+ }
12
+ export interface ToolSourceTreeFileReport {
13
+ path: string;
14
+ valid: boolean;
15
+ errors: UserToolSourceDiagnostic[];
16
+ }
17
+ export interface ValidateToolSourceTreeReport {
18
+ root: string;
19
+ files: ToolSourceTreeFileReport[];
20
+ summary: {
21
+ total: number;
22
+ ok: number;
23
+ fail: number;
24
+ error: number;
25
+ };
26
+ }
27
+ export declare function runValidateToolSourceTree(dir: string, opts?: ValidateToolSourceTreeOptions): Promise<void>;
28
+ //# sourceMappingURL=validate-tool-source-tree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-tool-source-tree.d.ts","sourceRoot":"","sources":["../../src/commands/validate-tool-source-tree.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAA0B,KAAK,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAEjG,MAAM,WAAW,6BAA6B;IAC5C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,wBAAwB,EAAE,CAAC;CACpC;AAED,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,wBAAwB,EAAE,CAAC;IAClC,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CACrE;AAqED,wBAAsB,yBAAyB,CAC7C,GAAG,EAAE,MAAM,EACX,IAAI,GAAE,6BAAkC,GACvC,OAAO,CAAC,IAAI,CAAC,CAyCf"}