@galaxy-tool-util/gxwf-web 0.0.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/app.d.ts +27 -0
- package/dist/app.d.ts.map +1 -0
- package/dist/app.js +37 -0
- package/dist/app.js.map +1 -0
- package/dist/bin/gxwf-web.d.ts +3 -0
- package/dist/bin/gxwf-web.d.ts.map +1 -0
- package/dist/bin/gxwf-web.js +93 -0
- package/dist/bin/gxwf-web.js.map +1 -0
- package/dist/contents.d.ts +29 -0
- package/dist/contents.d.ts.map +1 -0
- package/dist/contents.js +408 -0
- package/dist/contents.js.map +1 -0
- package/dist/generated/api-types.d.ts +1512 -0
- package/dist/generated/api-types.d.ts.map +1 -0
- package/dist/generated/api-types.js +6 -0
- package/dist/generated/api-types.js.map +1 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/models.d.ts +26 -0
- package/dist/models.d.ts.map +1 -0
- package/dist/models.js +3 -0
- package/dist/models.js.map +1 -0
- package/dist/router.d.ts +20 -0
- package/dist/router.d.ts.map +1 -0
- package/dist/router.js +398 -0
- package/dist/router.js.map +1 -0
- package/dist/workflows.d.ts +126 -0
- package/dist/workflows.d.ts.map +1 -0
- package/dist/workflows.js +462 -0
- package/dist/workflows.js.map +1 -0
- package/openapi.json +2575 -0
- package/package.json +54 -0
- package/public/assets/atkinson-hyperlegible-latin-400-italic-D-qjh7ci.woff2 +0 -0
- package/public/assets/atkinson-hyperlegible-latin-400-italic-OoEIrRJc.woff +0 -0
- package/public/assets/atkinson-hyperlegible-latin-400-normal-BbWidj28.woff +0 -0
- package/public/assets/atkinson-hyperlegible-latin-400-normal-BrHNak5F.woff2 +0 -0
- package/public/assets/atkinson-hyperlegible-latin-700-normal-BK6Glc0m.woff +0 -0
- package/public/assets/atkinson-hyperlegible-latin-700-normal-GZI4o3u0.woff2 +0 -0
- package/public/assets/atkinson-hyperlegible-latin-ext-400-italic-3fJ3SmOv.woff2 +0 -0
- package/public/assets/atkinson-hyperlegible-latin-ext-400-italic-B-Yabllp.woff +0 -0
- package/public/assets/atkinson-hyperlegible-latin-ext-400-normal-Bbz-b3yf.woff +0 -0
- package/public/assets/atkinson-hyperlegible-latin-ext-400-normal-DRk46D-x.woff2 +0 -0
- package/public/assets/atkinson-hyperlegible-latin-ext-700-normal-BoVPHkS0.woff2 +0 -0
- package/public/assets/atkinson-hyperlegible-latin-ext-700-normal-CKkU2Dpt.woff +0 -0
- package/public/assets/index-DgcQmTAM.css +1 -0
- package/public/assets/index-DsYOTNI9.js +3595 -0
- package/public/assets/primeicons-C6QP2o4f.woff2 +0 -0
- package/public/assets/primeicons-DMOk5skT.eot +0 -0
- package/public/assets/primeicons-Dr5RGzOO.svg +345 -0
- package/public/assets/primeicons-MpK4pl85.ttf +0 -0
- package/public/assets/primeicons-WjwUDZjB.woff +0 -0
- package/public/index.html +13 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow discovery and per-workflow operations for the gxwf-web HTTP server.
|
|
3
|
+
*
|
|
4
|
+
* Discovery mirrors Python's `discover_workflows` in workflow_tree.py:
|
|
5
|
+
* - scans for .ga, .gxwf.yml, .gxwf.yaml files
|
|
6
|
+
* - validates content (a_galaxy_workflow / class: GalaxyWorkflow)
|
|
7
|
+
* - category = first parent directory of relative path, or "" for root
|
|
8
|
+
*
|
|
9
|
+
* Operations delegate to @galaxy-tool-util/schema and @galaxy-tool-util/cli.
|
|
10
|
+
*
|
|
11
|
+
* All six operation endpoints are POST. clean/export/convert are mutating by
|
|
12
|
+
* default — dry_run=true returns the would-be content without touching disk.
|
|
13
|
+
* validate/lint/roundtrip are read-only regardless.
|
|
14
|
+
*
|
|
15
|
+
* ## Parity status vs Python server
|
|
16
|
+
*
|
|
17
|
+
* | Endpoint | Python params | TS status |
|
|
18
|
+
* |-----------|----------------------------------------|------------------------------------------|
|
|
19
|
+
* | validate | strict, connections, mode, allow, deny | strict wired; rest accepted (no-op) |
|
|
20
|
+
* | lint | strict, allow, deny | strict wired; allow/deny accepted (no-op)|
|
|
21
|
+
* | clean | preserve, strip, dry_run | writes back; dry_run wired; preserve/strip no-op |
|
|
22
|
+
* | export | dry_run | full parity |
|
|
23
|
+
* | convert | dry_run | full parity |
|
|
24
|
+
* | roundtrip | strict_structure, strict_encoding, strict_state, include_content | full parity |
|
|
25
|
+
*
|
|
26
|
+
* TS extension not in Python spec: GET /api/schemas/structural?format=...
|
|
27
|
+
* mode=pydantic (Python default) maps to effect (TS default); mode=json-schema accepted (no-op).
|
|
28
|
+
* allow/deny/preserve/strip require StaleKeyPolicy — tracked as future work in stale-keys.ts.
|
|
29
|
+
*/
|
|
30
|
+
import type { ToolCache } from "@galaxy-tool-util/core";
|
|
31
|
+
import { type WorkflowFormat, type WorkflowIndex, type SingleValidationReport, type SingleLintReport, type SingleCleanReport, type SingleRoundTripReport } from "@galaxy-tool-util/schema";
|
|
32
|
+
import type { ConvertResult, ExportResult } from "./models.js";
|
|
33
|
+
/** Scan directory for workflow files, returning a WorkflowIndex (matches Python's discover_workflows). */
|
|
34
|
+
export declare function discoverWorkflows(directory: string): WorkflowIndex;
|
|
35
|
+
export interface WorkflowFile {
|
|
36
|
+
absPath: string;
|
|
37
|
+
data: Record<string, unknown>;
|
|
38
|
+
format: WorkflowFormat;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Resolve a relative workflow path within a directory and load its data.
|
|
42
|
+
* Throws HttpError 404 if not found, 400 if unreadable.
|
|
43
|
+
*/
|
|
44
|
+
export declare function loadWorkflowFile(directory: string, relPath: string): WorkflowFile;
|
|
45
|
+
export interface ValidateOptions {
|
|
46
|
+
/** Reject unknown keys at envelope/step level (mirrors Python strict_structure). */
|
|
47
|
+
strict_structure?: boolean;
|
|
48
|
+
/** Reject JSON-string tool_state and format2 field misuse (mirrors Python strict_encoding). */
|
|
49
|
+
strict_encoding?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Validate connections between steps. Not yet implemented in TS — accepted
|
|
52
|
+
* for API parity but silently ignored.
|
|
53
|
+
*/
|
|
54
|
+
connections?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Validation mode: "effect" (default) uses Effect Schema decode;
|
|
57
|
+
* "json-schema" uses AJV against the generated JSON Schema (mirrors Python --mode json-schema).
|
|
58
|
+
* Python default "pydantic" is treated as "effect".
|
|
59
|
+
*/
|
|
60
|
+
mode?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Run clean in-memory before validating. Results are embedded in the
|
|
63
|
+
* returned report as clean_report.
|
|
64
|
+
*/
|
|
65
|
+
clean_first?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Tool IDs whose stale keys are allowed. Accepted for API parity; requires
|
|
68
|
+
* StaleKeyPolicy (future work) — currently ignored.
|
|
69
|
+
*/
|
|
70
|
+
allow?: string[];
|
|
71
|
+
/**
|
|
72
|
+
* Tool IDs whose stale keys are denied. Accepted for API parity; requires
|
|
73
|
+
* StaleKeyPolicy (future work) — currently ignored.
|
|
74
|
+
*/
|
|
75
|
+
deny?: string[];
|
|
76
|
+
}
|
|
77
|
+
/** Validate a workflow's tool state. */
|
|
78
|
+
export declare function operateValidate(wf: WorkflowFile, cache: ToolCache, opts?: ValidateOptions): Promise<SingleValidationReport>;
|
|
79
|
+
export interface LintOptions {
|
|
80
|
+
strict_structure?: boolean;
|
|
81
|
+
strict_encoding?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Tool IDs whose stale keys are allowed. Accepted for API parity; requires
|
|
84
|
+
* StaleKeyPolicy (future work) — currently ignored.
|
|
85
|
+
*/
|
|
86
|
+
allow?: string[];
|
|
87
|
+
/**
|
|
88
|
+
* Tool IDs whose stale keys are denied. Accepted for API parity; requires
|
|
89
|
+
* StaleKeyPolicy (future work) — currently ignored.
|
|
90
|
+
*/
|
|
91
|
+
deny?: string[];
|
|
92
|
+
}
|
|
93
|
+
/** Lint a workflow — structural checks, best practices, tool state validation. */
|
|
94
|
+
export declare function operateLint(wf: WorkflowFile, cache: ToolCache, opts?: LintOptions): Promise<SingleLintReport>;
|
|
95
|
+
export interface CleanOptions {
|
|
96
|
+
/**
|
|
97
|
+
* Keys to preserve (not strip). Accepted for API parity; requires
|
|
98
|
+
* StaleKeyPolicy (future work) — currently ignored.
|
|
99
|
+
*/
|
|
100
|
+
preserve?: string[];
|
|
101
|
+
/**
|
|
102
|
+
* Keys to always strip. Accepted for API parity; requires
|
|
103
|
+
* StaleKeyPolicy (future work) — currently ignored.
|
|
104
|
+
*/
|
|
105
|
+
strip?: string[];
|
|
106
|
+
/** When true, return the cleaned content without writing it back to disk. */
|
|
107
|
+
dry_run?: boolean;
|
|
108
|
+
}
|
|
109
|
+
/** Clean stale tool state keys in a workflow; writes back to disk unless dry_run. */
|
|
110
|
+
export declare function operateClean(wf: WorkflowFile, opts?: CleanOptions): Promise<SingleCleanReport>;
|
|
111
|
+
export interface ExportConvertOptions {
|
|
112
|
+
dry_run?: boolean;
|
|
113
|
+
}
|
|
114
|
+
/** Export: write converted workflow alongside the original (or return content on dry_run). */
|
|
115
|
+
export declare function operateExport(wf: WorkflowFile, cache: ToolCache, opts?: ExportConvertOptions): Promise<ExportResult>;
|
|
116
|
+
/** Convert: like export, but also removes the original file. */
|
|
117
|
+
export declare function operateConvert(wf: WorkflowFile, cache: ToolCache, opts?: ExportConvertOptions): Promise<ConvertResult>;
|
|
118
|
+
export interface RoundtripOptions {
|
|
119
|
+
strict_structure?: boolean;
|
|
120
|
+
strict_encoding?: boolean;
|
|
121
|
+
strict_state?: boolean;
|
|
122
|
+
include_content?: boolean;
|
|
123
|
+
}
|
|
124
|
+
/** Run roundtrip validation (native → format2 → native). */
|
|
125
|
+
export declare function operateRoundtrip(wf: WorkflowFile, cache: ToolCache, opts?: RoundtripOptions): Promise<SingleRoundTripReport>;
|
|
126
|
+
//# sourceMappingURL=workflows.d.ts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AAC;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,4DAA4D;AAC5D,wBAAsB,gBAAgB,CACpC,EAAE,EAAE,YAAY,EAChB,KAAK,EAAE,SAAS,EAChB,IAAI,GAAE,gBAAqB,GAC1B,OAAO,CAAC,qBAAqB,CAAC,CAmFhC"}
|
|
@@ -0,0 +1,462 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow discovery and per-workflow operations for the gxwf-web HTTP server.
|
|
3
|
+
*
|
|
4
|
+
* Discovery mirrors Python's `discover_workflows` in workflow_tree.py:
|
|
5
|
+
* - scans for .ga, .gxwf.yml, .gxwf.yaml files
|
|
6
|
+
* - validates content (a_galaxy_workflow / class: GalaxyWorkflow)
|
|
7
|
+
* - category = first parent directory of relative path, or "" for root
|
|
8
|
+
*
|
|
9
|
+
* Operations delegate to @galaxy-tool-util/schema and @galaxy-tool-util/cli.
|
|
10
|
+
*
|
|
11
|
+
* All six operation endpoints are POST. clean/export/convert are mutating by
|
|
12
|
+
* default — dry_run=true returns the would-be content without touching disk.
|
|
13
|
+
* validate/lint/roundtrip are read-only regardless.
|
|
14
|
+
*
|
|
15
|
+
* ## Parity status vs Python server
|
|
16
|
+
*
|
|
17
|
+
* | Endpoint | Python params | TS status |
|
|
18
|
+
* |-----------|----------------------------------------|------------------------------------------|
|
|
19
|
+
* | validate | strict, connections, mode, allow, deny | strict wired; rest accepted (no-op) |
|
|
20
|
+
* | lint | strict, allow, deny | strict wired; allow/deny accepted (no-op)|
|
|
21
|
+
* | clean | preserve, strip, dry_run | writes back; dry_run wired; preserve/strip no-op |
|
|
22
|
+
* | export | dry_run | full parity |
|
|
23
|
+
* | convert | dry_run | full parity |
|
|
24
|
+
* | roundtrip | strict_structure, strict_encoding, strict_state, include_content | full parity |
|
|
25
|
+
*
|
|
26
|
+
* TS extension not in Python spec: GET /api/schemas/structural?format=...
|
|
27
|
+
* mode=pydantic (Python default) maps to effect (TS default); mode=json-schema accepted (no-op).
|
|
28
|
+
* allow/deny/preserve/strip require StaleKeyPolicy — tracked as future work in stale-keys.ts.
|
|
29
|
+
*/
|
|
30
|
+
import * as fs from "node:fs";
|
|
31
|
+
import * as path from "node:path";
|
|
32
|
+
import { parse as parseYaml } from "yaml";
|
|
33
|
+
import { cleanWorkflow, roundtripValidate, toFormat2Stateful, toNativeStateful, buildSingleValidationReport, buildSingleLintReport, buildSingleCleanReport, detectFormat, serializeWorkflow, } from "@galaxy-tool-util/schema";
|
|
34
|
+
import { validateNativeSteps, validateFormat2Steps, decodeStructureErrors, detectEncodingErrors, loadToolInputsForWorkflow, createDefaultResolver, lintWorkflowReport, validateNativeStepsJsonSchema, validateFormat2StepsJsonSchema, decodeStructureErrorsJsonSchema, } from "@galaxy-tool-util/cli";
|
|
35
|
+
import { HttpError } from "./contents.js";
|
|
36
|
+
// ── Discovery ────────────────────────────────────────────────────────────────
|
|
37
|
+
const EXCLUDE_DIRS = new Set([
|
|
38
|
+
".git",
|
|
39
|
+
".hg",
|
|
40
|
+
".venv",
|
|
41
|
+
"node_modules",
|
|
42
|
+
"__pycache__",
|
|
43
|
+
".snakemake",
|
|
44
|
+
".checkpoints",
|
|
45
|
+
".pytest_cache",
|
|
46
|
+
".mypy_cache",
|
|
47
|
+
".tox",
|
|
48
|
+
".ruff_cache",
|
|
49
|
+
]);
|
|
50
|
+
function classifyFilename(filename) {
|
|
51
|
+
if (filename.endsWith(".gxwf.yml") || filename.endsWith(".gxwf.yaml"))
|
|
52
|
+
return "format2";
|
|
53
|
+
if (filename.endsWith(".ga"))
|
|
54
|
+
return "native";
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
function isWorkflowContent(filePath, format) {
|
|
58
|
+
try {
|
|
59
|
+
const content = fs.readFileSync(filePath, "utf-8");
|
|
60
|
+
if (format === "native") {
|
|
61
|
+
const data = JSON.parse(content);
|
|
62
|
+
return data?.a_galaxy_workflow === "true";
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
const data = parseYaml(content);
|
|
66
|
+
return data?.class === "GalaxyWorkflow";
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function categoryOf(relPath) {
|
|
74
|
+
const sep = "/";
|
|
75
|
+
const idx = relPath.indexOf(sep);
|
|
76
|
+
return idx > 0 ? relPath.slice(0, idx) : "";
|
|
77
|
+
}
|
|
78
|
+
function walkDir(dirPath, root, entries) {
|
|
79
|
+
let names;
|
|
80
|
+
try {
|
|
81
|
+
names = fs.readdirSync(dirPath);
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
for (const name of names) {
|
|
87
|
+
if (EXCLUDE_DIRS.has(name))
|
|
88
|
+
continue;
|
|
89
|
+
const fullPath = path.join(dirPath, name);
|
|
90
|
+
let stat;
|
|
91
|
+
try {
|
|
92
|
+
stat = fs.statSync(fullPath);
|
|
93
|
+
}
|
|
94
|
+
catch {
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
if (stat.isDirectory()) {
|
|
98
|
+
walkDir(fullPath, root, entries);
|
|
99
|
+
}
|
|
100
|
+
else if (stat.isFile()) {
|
|
101
|
+
const format = classifyFilename(name);
|
|
102
|
+
if (!format)
|
|
103
|
+
continue;
|
|
104
|
+
if (!isWorkflowContent(fullPath, format))
|
|
105
|
+
continue;
|
|
106
|
+
// Always use forward slashes in relative paths
|
|
107
|
+
const relPath = path.relative(root, fullPath).split(path.sep).join("/");
|
|
108
|
+
entries.push({
|
|
109
|
+
relative_path: relPath,
|
|
110
|
+
format,
|
|
111
|
+
category: categoryOf(relPath),
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/** Scan directory for workflow files, returning a WorkflowIndex (matches Python's discover_workflows). */
|
|
117
|
+
export function discoverWorkflows(directory) {
|
|
118
|
+
const root = path.resolve(directory);
|
|
119
|
+
const entries = [];
|
|
120
|
+
walkDir(root, root, entries);
|
|
121
|
+
entries.sort((a, b) => a.relative_path.localeCompare(b.relative_path));
|
|
122
|
+
return { directory: root, workflows: entries };
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Resolve a relative workflow path within a directory and load its data.
|
|
126
|
+
* Throws HttpError 404 if not found, 400 if unreadable.
|
|
127
|
+
*/
|
|
128
|
+
export function loadWorkflowFile(directory, relPath) {
|
|
129
|
+
const root = path.resolve(directory);
|
|
130
|
+
const abs = path.resolve(root, relPath);
|
|
131
|
+
// Prevent path traversal
|
|
132
|
+
if (abs !== root && !abs.startsWith(root + path.sep)) {
|
|
133
|
+
throw new HttpError(403, "Path escapes configured directory");
|
|
134
|
+
}
|
|
135
|
+
if (!fs.existsSync(abs)) {
|
|
136
|
+
throw new HttpError(404, `Workflow not found: ${relPath}`);
|
|
137
|
+
}
|
|
138
|
+
let data;
|
|
139
|
+
try {
|
|
140
|
+
const content = fs.readFileSync(abs, "utf-8");
|
|
141
|
+
if (abs.endsWith(".ga")) {
|
|
142
|
+
data = JSON.parse(content);
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
data = parseYaml(content);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
catch (e) {
|
|
149
|
+
throw new HttpError(400, `Cannot read workflow file: ${String(e)}`);
|
|
150
|
+
}
|
|
151
|
+
const format = detectFormat(data);
|
|
152
|
+
if (!format) {
|
|
153
|
+
throw new HttpError(422, `Cannot detect workflow format for: ${relPath}`);
|
|
154
|
+
}
|
|
155
|
+
return { absPath: abs, data, format };
|
|
156
|
+
}
|
|
157
|
+
/** Validate a workflow's tool state. */
|
|
158
|
+
export async function operateValidate(wf, cache, opts = {}) {
|
|
159
|
+
const { absPath, format } = wf;
|
|
160
|
+
let { data } = wf;
|
|
161
|
+
const useJsonSchema = opts.mode === "json-schema";
|
|
162
|
+
const expansionOpts = {
|
|
163
|
+
resolver: createDefaultResolver({ workflowDirectory: path.dirname(absPath) }),
|
|
164
|
+
};
|
|
165
|
+
// Optional clean-first pass: run clean in-memory, validate on cleaned dict
|
|
166
|
+
let clean_report = null;
|
|
167
|
+
if (opts.clean_first) {
|
|
168
|
+
const cleanResult = await cleanWorkflow(data);
|
|
169
|
+
const cleanResults = cleanResult.results;
|
|
170
|
+
clean_report = buildSingleCleanReport(absPath, cleanResults);
|
|
171
|
+
data = cleanResult.workflow;
|
|
172
|
+
}
|
|
173
|
+
// Structural validation
|
|
174
|
+
const structureErrors = useJsonSchema
|
|
175
|
+
? decodeStructureErrorsJsonSchema(data, format)
|
|
176
|
+
: opts.strict_structure
|
|
177
|
+
? decodeStructureErrors(data, format)
|
|
178
|
+
: [];
|
|
179
|
+
// Encoding errors (only in strict_encoding mode via Effect path)
|
|
180
|
+
const encodingErrors = [];
|
|
181
|
+
if (opts.strict_encoding && !useJsonSchema) {
|
|
182
|
+
// decodeStructureErrors covers encoding signals; encoding errors surfaced via detectEncodingErrors
|
|
183
|
+
if ((await cache.index.listAll()).length > 0) {
|
|
184
|
+
const encErrors = await detectEncodingErrors(data, cache, format, expansionOpts);
|
|
185
|
+
encodingErrors.push(...encErrors);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
let results = [];
|
|
189
|
+
try {
|
|
190
|
+
if (useJsonSchema) {
|
|
191
|
+
if (format === "native") {
|
|
192
|
+
results = await validateNativeStepsJsonSchema(data, cache, undefined, "", expansionOpts);
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
results = await validateFormat2StepsJsonSchema(data, cache, undefined, "", expansionOpts);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
if (format === "native") {
|
|
200
|
+
results = await validateNativeSteps(data, cache, "", expansionOpts);
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
results = await validateFormat2Steps(data, cache, "", expansionOpts);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
catch (e) {
|
|
208
|
+
if (e instanceof Error && e.message.includes("legacy parameter encoding")) {
|
|
209
|
+
encodingErrors.push(e.message);
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
throw e;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
const report = buildSingleValidationReport(absPath, results, {
|
|
216
|
+
structure_errors: structureErrors,
|
|
217
|
+
encoding_errors: encodingErrors,
|
|
218
|
+
});
|
|
219
|
+
if (clean_report !== null) {
|
|
220
|
+
report.clean_report = clean_report;
|
|
221
|
+
}
|
|
222
|
+
return report;
|
|
223
|
+
}
|
|
224
|
+
/** Lint a workflow — structural checks, best practices, tool state validation. */
|
|
225
|
+
export async function operateLint(wf, cache, opts = {}) {
|
|
226
|
+
const { absPath, data, format } = wf;
|
|
227
|
+
const strict = {
|
|
228
|
+
strictEncoding: opts.strict_encoding ?? false,
|
|
229
|
+
strictStructure: opts.strict_structure ?? false,
|
|
230
|
+
strictState: false,
|
|
231
|
+
};
|
|
232
|
+
const report = await lintWorkflowReport(absPath, data, format, { cache, strict });
|
|
233
|
+
const lintErrors = report.structural.error_count + (report.bestPractices?.error_count ?? 0);
|
|
234
|
+
const lintWarnings = report.structural.warn_count + (report.bestPractices?.warn_count ?? 0);
|
|
235
|
+
// Always compute structure_errors from Effect Schema decode (matches CLI JSON mode)
|
|
236
|
+
const structureErrors = decodeStructureErrors(data, format);
|
|
237
|
+
// Detect legacy encoding errors (when cache is available)
|
|
238
|
+
let encodingErrors = [];
|
|
239
|
+
if ((await cache.index.listAll()).length > 0) {
|
|
240
|
+
const expansionOpts = {
|
|
241
|
+
resolver: createDefaultResolver({ workflowDirectory: path.dirname(absPath) }),
|
|
242
|
+
};
|
|
243
|
+
encodingErrors = await detectEncodingErrors(data, cache, format, expansionOpts);
|
|
244
|
+
}
|
|
245
|
+
return buildSingleLintReport(absPath, lintErrors, lintWarnings, report.stateValidation ?? [], {
|
|
246
|
+
structure_errors: structureErrors,
|
|
247
|
+
encoding_errors: encodingErrors,
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
/** Clean stale tool state keys in a workflow; writes back to disk unless dry_run. */
|
|
251
|
+
export async function operateClean(wf, opts = {}) {
|
|
252
|
+
const { absPath, data, format } = wf;
|
|
253
|
+
const before_content = fs.readFileSync(absPath, "utf-8");
|
|
254
|
+
const cleanResult = await cleanWorkflow(data);
|
|
255
|
+
// Match Python clean_single's after_content: indent=2, no trailing newline.
|
|
256
|
+
const after_content = serializeWorkflow(cleanResult.workflow, format, {
|
|
257
|
+
indent: 2,
|
|
258
|
+
trailingNewline: false,
|
|
259
|
+
});
|
|
260
|
+
if (!opts.dry_run) {
|
|
261
|
+
fs.writeFileSync(absPath, after_content);
|
|
262
|
+
}
|
|
263
|
+
const base = buildSingleCleanReport(absPath, cleanResult.results);
|
|
264
|
+
return {
|
|
265
|
+
...base,
|
|
266
|
+
before_content,
|
|
267
|
+
after_content,
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Compute the output path for an export/convert.
|
|
272
|
+
* Native `.ga` → `.gxwf.yml`; format2 `.gxwf.yml`/`.gxwf.yaml` → `.ga`.
|
|
273
|
+
*/
|
|
274
|
+
function computeOutputPath(absPath, sourceFormat) {
|
|
275
|
+
if (sourceFormat === "native") {
|
|
276
|
+
// foo.ga → foo.gxwf.yml
|
|
277
|
+
const base = absPath.endsWith(".ga") ? absPath.slice(0, -".ga".length) : absPath;
|
|
278
|
+
return `${base}.gxwf.yml`;
|
|
279
|
+
}
|
|
280
|
+
// foo.gxwf.yml / foo.gxwf.yaml → foo.ga
|
|
281
|
+
const dir = path.dirname(absPath);
|
|
282
|
+
const name = path.basename(absPath);
|
|
283
|
+
const stem = name.endsWith(".gxwf.yml")
|
|
284
|
+
? name.slice(0, -".gxwf.yml".length)
|
|
285
|
+
: name.endsWith(".gxwf.yaml")
|
|
286
|
+
? name.slice(0, -".gxwf.yaml".length)
|
|
287
|
+
: name.replace(/\.[^.]+$/, "");
|
|
288
|
+
return path.join(dir, `${stem}.ga`);
|
|
289
|
+
}
|
|
290
|
+
async function performExport(wf, cache) {
|
|
291
|
+
const { absPath, data, format } = wf;
|
|
292
|
+
const expansionOpts = {
|
|
293
|
+
resolver: createDefaultResolver({ workflowDirectory: path.dirname(absPath) }),
|
|
294
|
+
};
|
|
295
|
+
if (format === "native") {
|
|
296
|
+
const { resolver } = await loadToolInputsForWorkflow(data, "native", cache, expansionOpts);
|
|
297
|
+
const result = toFormat2Stateful(data, resolver);
|
|
298
|
+
const converted = result.steps.filter((s) => s.converted).length;
|
|
299
|
+
const fallback = result.steps.length - converted;
|
|
300
|
+
const report = {
|
|
301
|
+
workflow: absPath,
|
|
302
|
+
ok: fallback === 0,
|
|
303
|
+
steps_converted: converted,
|
|
304
|
+
steps_fallback: fallback,
|
|
305
|
+
summary: { converted, fallback },
|
|
306
|
+
};
|
|
307
|
+
return {
|
|
308
|
+
output_path: computeOutputPath(absPath, "native"),
|
|
309
|
+
content: serializeWorkflow(result.workflow, "format2"),
|
|
310
|
+
report,
|
|
311
|
+
source_format: "native",
|
|
312
|
+
target_format: "format2",
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
const { resolver } = await loadToolInputsForWorkflow(data, "format2", cache, expansionOpts);
|
|
316
|
+
const result = toNativeStateful(data, resolver);
|
|
317
|
+
const steps = result.steps.map((s) => ({
|
|
318
|
+
step_id: s.stepId,
|
|
319
|
+
step_label: null,
|
|
320
|
+
tool_id: s.toolId ?? null,
|
|
321
|
+
encoded: s.converted,
|
|
322
|
+
error: s.error ?? null,
|
|
323
|
+
}));
|
|
324
|
+
const allEncoded = steps.every((s) => s.encoded);
|
|
325
|
+
const encodedCount = steps.filter((s) => s.encoded).length;
|
|
326
|
+
const nativeDict = result.workflow;
|
|
327
|
+
const report = {
|
|
328
|
+
native_dict: nativeDict,
|
|
329
|
+
steps,
|
|
330
|
+
all_encoded: allEncoded,
|
|
331
|
+
summary: `${encodedCount}/${steps.length} steps encoded`,
|
|
332
|
+
};
|
|
333
|
+
return {
|
|
334
|
+
output_path: computeOutputPath(absPath, "format2"),
|
|
335
|
+
// Match Python format_native_json: JSON indent=4 + trailing newline.
|
|
336
|
+
content: serializeWorkflow(nativeDict, "native", { indent: 4 }),
|
|
337
|
+
report,
|
|
338
|
+
source_format: "format2",
|
|
339
|
+
target_format: "native",
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
/** Export: write converted workflow alongside the original (or return content on dry_run). */
|
|
343
|
+
export async function operateExport(wf, cache, opts = {}) {
|
|
344
|
+
const outcome = await performExport(wf, cache);
|
|
345
|
+
if (!opts.dry_run) {
|
|
346
|
+
fs.writeFileSync(outcome.output_path, outcome.content);
|
|
347
|
+
}
|
|
348
|
+
return {
|
|
349
|
+
source_path: wf.absPath,
|
|
350
|
+
output_path: outcome.output_path,
|
|
351
|
+
source_format: outcome.source_format,
|
|
352
|
+
target_format: outcome.target_format,
|
|
353
|
+
report: outcome.report,
|
|
354
|
+
dry_run: !!opts.dry_run,
|
|
355
|
+
content: opts.dry_run ? outcome.content : null,
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
/** Convert: like export, but also removes the original file. */
|
|
359
|
+
export async function operateConvert(wf, cache, opts = {}) {
|
|
360
|
+
const outcome = await performExport(wf, cache);
|
|
361
|
+
if (!opts.dry_run) {
|
|
362
|
+
fs.writeFileSync(outcome.output_path, outcome.content);
|
|
363
|
+
fs.unlinkSync(wf.absPath);
|
|
364
|
+
}
|
|
365
|
+
return {
|
|
366
|
+
source_path: wf.absPath,
|
|
367
|
+
output_path: outcome.output_path,
|
|
368
|
+
removed_path: wf.absPath,
|
|
369
|
+
source_format: outcome.source_format,
|
|
370
|
+
target_format: outcome.target_format,
|
|
371
|
+
report: outcome.report,
|
|
372
|
+
dry_run: !!opts.dry_run,
|
|
373
|
+
content: opts.dry_run ? outcome.content : null,
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
/** Run roundtrip validation (native → format2 → native). */
|
|
377
|
+
export async function operateRoundtrip(wf, cache, opts = {}) {
|
|
378
|
+
const { absPath, data, format } = wf;
|
|
379
|
+
if (format !== "native") {
|
|
380
|
+
throw new HttpError(422, "roundtrip requires a native (.ga) workflow");
|
|
381
|
+
}
|
|
382
|
+
const expansionOpts = {
|
|
383
|
+
resolver: createDefaultResolver({ workflowDirectory: path.dirname(absPath) }),
|
|
384
|
+
};
|
|
385
|
+
const { resolver } = await loadToolInputsForWorkflow(data, "native", cache, expansionOpts);
|
|
386
|
+
const result = roundtripValidate(data, resolver, {
|
|
387
|
+
strictStructure: opts.strict_structure,
|
|
388
|
+
strictEncoding: opts.strict_encoding,
|
|
389
|
+
strictState: opts.strict_state,
|
|
390
|
+
});
|
|
391
|
+
// Convert TS-internal RoundtripResult → Python-API RoundTripValidationResult
|
|
392
|
+
const allDiffs = result.stepResults.flatMap((s) => s.diffs);
|
|
393
|
+
const errorDiffs = allDiffs.filter((d) => d.severity === "error");
|
|
394
|
+
const benignDiffs = allDiffs.filter((d) => d.severity === "benign");
|
|
395
|
+
// Build a Python-shape RoundTripResult for conversion_result.
|
|
396
|
+
// Direction "forward+reverse" covers the full TS roundtrip.
|
|
397
|
+
const conversionStepResults = result.stepResults.map((s) => ({
|
|
398
|
+
step_id: s.stepId,
|
|
399
|
+
tool_id: s.toolId ?? null,
|
|
400
|
+
success: s.success,
|
|
401
|
+
failure_class: _mapRoundtripFailureClass(s.failureClass ?? null),
|
|
402
|
+
error: s.error ?? null,
|
|
403
|
+
diffs: s.diffs,
|
|
404
|
+
format2_state: null,
|
|
405
|
+
format2_connections: null,
|
|
406
|
+
}));
|
|
407
|
+
// Build conversion failure lines from forward/reverse step statuses
|
|
408
|
+
const conversionFailureLines = [
|
|
409
|
+
...result.forwardSteps
|
|
410
|
+
.filter((s) => !s.converted)
|
|
411
|
+
.map((s) => `forward step ${s.stepId}: ${s.error ?? s.failureClass ?? "unknown"}`),
|
|
412
|
+
...result.reverseSteps
|
|
413
|
+
.filter((s) => !s.converted)
|
|
414
|
+
.map((s) => `reverse step ${s.stepId}: ${s.error ?? s.failureClass ?? "unknown"}`),
|
|
415
|
+
];
|
|
416
|
+
const ok = result.success && result.clean;
|
|
417
|
+
const status = ok ? "ok" : errorDiffs.length > 0 ? "error" : "benign";
|
|
418
|
+
const summaryLine = `${ok ? "ok" : "fail"}: ${errorDiffs.length} error diff(s), ${benignDiffs.length} benign diff(s)`;
|
|
419
|
+
const validationResult = {
|
|
420
|
+
workflow_path: absPath,
|
|
421
|
+
category: "",
|
|
422
|
+
conversion_result: {
|
|
423
|
+
workflow_name: result.workflowName ?? absPath,
|
|
424
|
+
direction: "forward+reverse",
|
|
425
|
+
step_results: conversionStepResults,
|
|
426
|
+
},
|
|
427
|
+
diffs: allDiffs,
|
|
428
|
+
step_id_mapping: { mapping: {}, match_methods: {} },
|
|
429
|
+
stale_clean_results: null,
|
|
430
|
+
error: null,
|
|
431
|
+
skipped_reason: null,
|
|
432
|
+
structure_errors: result.structureErrors,
|
|
433
|
+
encoding_errors: result.encodingErrors,
|
|
434
|
+
error_diffs: errorDiffs,
|
|
435
|
+
benign_diffs: benignDiffs,
|
|
436
|
+
ok,
|
|
437
|
+
status,
|
|
438
|
+
conversion_failure_lines: conversionFailureLines,
|
|
439
|
+
summary_line: summaryLine,
|
|
440
|
+
};
|
|
441
|
+
const before_content = opts.include_content ? JSON.stringify(data, null, 2) : undefined;
|
|
442
|
+
const after_content = opts.include_content && result.reimportedWorkflow != null
|
|
443
|
+
? JSON.stringify(result.reimportedWorkflow, null, 2)
|
|
444
|
+
: undefined;
|
|
445
|
+
return {
|
|
446
|
+
workflow: absPath,
|
|
447
|
+
result: validationResult,
|
|
448
|
+
before_content: before_content ?? null,
|
|
449
|
+
after_content: after_content ?? null,
|
|
450
|
+
};
|
|
451
|
+
}
|
|
452
|
+
// ── Internal helpers ─────────────────────────────────────────────────────────
|
|
453
|
+
function _mapRoundtripFailureClass(cls) {
|
|
454
|
+
if (cls === null)
|
|
455
|
+
return null;
|
|
456
|
+
// "subworkflow_external_ref" is TS-specific; map to Python's "subworkflow"
|
|
457
|
+
if (cls === "subworkflow_external_ref")
|
|
458
|
+
return "subworkflow";
|
|
459
|
+
// All other TS failure classes happen to match Python FailureClass literals
|
|
460
|
+
return cls;
|
|
461
|
+
}
|
|
462
|
+
//# sourceMappingURL=workflows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflows.js","sourceRoot":"","sources":["../src/workflows.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAE1C,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,2BAA2B,EAC3B,qBAAqB,EACrB,sBAAsB,EACtB,YAAY,EACZ,iBAAiB,GAmBlB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,yBAAyB,EACzB,qBAAqB,EACrB,kBAAkB,EAClB,6BAA6B,EAC7B,8BAA8B,EAC9B,+BAA+B,GAChC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAG1C,gFAAgF;AAEhF,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC;IAC3B,MAAM;IACN,KAAK;IACL,OAAO;IACP,cAAc;IACd,aAAa;IACb,YAAY;IACZ,cAAc;IACd,eAAe;IACf,aAAa;IACb,MAAM;IACN,aAAa;CACd,CAAC,CAAC;AAIH,SAAS,gBAAgB,CAAC,QAAgB;IACxC,IAAI,QAAQ,CAAC,QAAQ,CAAC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