@galaxy-tool-util/cli 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/README.md +19 -0
  2. package/dist/bin/galaxy-tool-cache.d.ts +3 -0
  3. package/dist/bin/galaxy-tool-cache.d.ts.map +1 -0
  4. package/dist/bin/galaxy-tool-cache.js +50 -0
  5. package/dist/bin/galaxy-tool-cache.js.map +1 -0
  6. package/dist/bin/galaxy-workflow-validate.d.ts +3 -0
  7. package/dist/bin/galaxy-workflow-validate.d.ts.map +1 -0
  8. package/dist/bin/galaxy-workflow-validate.js +17 -0
  9. package/dist/bin/galaxy-workflow-validate.js.map +1 -0
  10. package/dist/commands/add.d.ts +7 -0
  11. package/dist/commands/add.d.ts.map +1 -0
  12. package/dist/commands/add.js +15 -0
  13. package/dist/commands/add.js.map +1 -0
  14. package/dist/commands/clear.d.ts +5 -0
  15. package/dist/commands/clear.d.ts.map +1 -0
  16. package/dist/commands/clear.js +16 -0
  17. package/dist/commands/clear.js.map +1 -0
  18. package/dist/commands/info.d.ts +6 -0
  19. package/dist/commands/info.d.ts.map +1 -0
  20. package/dist/commands/info.js +32 -0
  21. package/dist/commands/info.js.map +1 -0
  22. package/dist/commands/list.d.ts +6 -0
  23. package/dist/commands/list.d.ts.map +1 -0
  24. package/dist/commands/list.js +24 -0
  25. package/dist/commands/list.js.map +1 -0
  26. package/dist/commands/resolve-tool.d.ts +16 -0
  27. package/dist/commands/resolve-tool.d.ts.map +1 -0
  28. package/dist/commands/resolve-tool.js +17 -0
  29. package/dist/commands/resolve-tool.js.map +1 -0
  30. package/dist/commands/schema.d.ts +8 -0
  31. package/dist/commands/schema.d.ts.map +1 -0
  32. package/dist/commands/schema.js +55 -0
  33. package/dist/commands/schema.js.map +1 -0
  34. package/dist/commands/url-resolver.d.ts +23 -0
  35. package/dist/commands/url-resolver.d.ts.map +1 -0
  36. package/dist/commands/url-resolver.js +58 -0
  37. package/dist/commands/url-resolver.js.map +1 -0
  38. package/dist/commands/validate-workflow-json-schema.d.ts +16 -0
  39. package/dist/commands/validate-workflow-json-schema.d.ts.map +1 -0
  40. package/dist/commands/validate-workflow-json-schema.js +313 -0
  41. package/dist/commands/validate-workflow-json-schema.js.map +1 -0
  42. package/dist/commands/validate-workflow.d.ts +21 -0
  43. package/dist/commands/validate-workflow.d.ts.map +1 -0
  44. package/dist/commands/validate-workflow.js +257 -0
  45. package/dist/commands/validate-workflow.js.map +1 -0
  46. package/dist/index.d.ts +19 -0
  47. package/dist/index.d.ts.map +1 -0
  48. package/dist/index.js +19 -0
  49. package/dist/index.js.map +1 -0
  50. package/package.json +51 -0
package/README.md ADDED
@@ -0,0 +1,19 @@
1
+ # @galaxy-tool-util/cli
2
+
3
+ CLI tool for caching and inspecting Galaxy tool metadata.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install -g @galaxy-tool-util/cli
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```bash
14
+ galaxy-tool-cache --help
15
+ ```
16
+
17
+ ## License
18
+
19
+ MIT
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=galaxy-tool-cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"galaxy-tool-cache.d.ts","sourceRoot":"","sources":["../../src/bin/galaxy-tool-cache.ts"],"names":[],"mappings":""}
@@ -0,0 +1,50 @@
1
+ #!/usr/bin/env node
2
+ import { Command } from "commander";
3
+ import { runAdd } from "../commands/add.js";
4
+ import { runList } from "../commands/list.js";
5
+ import { runInfo } from "../commands/info.js";
6
+ import { runClear } from "../commands/clear.js";
7
+ import { runSchema } from "../commands/schema.js";
8
+ const program = new Command();
9
+ program
10
+ .name("galaxy-tool-cache")
11
+ .description("Cache and inspect Galaxy tool metadata")
12
+ .version("1.0.0");
13
+ program
14
+ .command("add")
15
+ .description("Fetch a tool from ToolShed/Galaxy and cache it")
16
+ .argument("<tool_id>", "Tool ID (full toolshed path or TRS ID)")
17
+ .option("--version <ver>", "Tool version")
18
+ .option("--cache-dir <dir>", "Cache directory")
19
+ .option("--galaxy-url <url>", "Galaxy instance URL for fallback")
20
+ .action(runAdd);
21
+ program
22
+ .command("list")
23
+ .description("List cached tools")
24
+ .option("--json", "Output as JSON")
25
+ .option("--cache-dir <dir>", "Cache directory")
26
+ .action(runList);
27
+ program
28
+ .command("info")
29
+ .description("Show metadata for a cached tool")
30
+ .argument("<tool_id>", "Tool ID")
31
+ .option("--version <ver>", "Tool version")
32
+ .option("--cache-dir <dir>", "Cache directory")
33
+ .action(runInfo);
34
+ program
35
+ .command("clear")
36
+ .description("Clear cached tools")
37
+ .argument("[prefix]", "Only clear tools matching this prefix")
38
+ .option("--cache-dir <dir>", "Cache directory")
39
+ .action(runClear);
40
+ program
41
+ .command("schema")
42
+ .description("Export JSON Schema for a cached tool's parameters")
43
+ .argument("<tool_id>", "Tool ID")
44
+ .option("--version <ver>", "Tool version")
45
+ .option("--representation <rep>", "State representation (e.g., workflow_step)", "workflow_step")
46
+ .option("--output <file>", "Output file (default: stdout)")
47
+ .option("--cache-dir <dir>", "Cache directory")
48
+ .action(runSchema);
49
+ program.parse();
50
+ //# sourceMappingURL=galaxy-tool-cache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"galaxy-tool-cache.js","sourceRoot":"","sources":["../../src/bin/galaxy-tool-cache.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,MAAM,OAAO,GAAG,IAAI,OAAO,E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AE,cAAc,CAAC;KACzC,MAAM,CAAC,wBAAwB,EAAE,4CAA4C,EAAE,eAAe,CAAC;KAC/F,MAAM,CAAC,iBAAiB,EAAE,+BAA+B,CAAC;KAC1D,MAAM,CAAC,mBAAmB,EAAE,iBAAiB,CAAC;KAC9C,MAAM,CAAC,SAAS,CAAC,CAAC;AAErB,OAAO,CAAC,KAAK,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=galaxy-workflow-validate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"galaxy-workflow-validate.d.ts","sourceRoot":"","sources":["../../src/bin/galaxy-workflow-validate.ts"],"names":[],"mappings":""}
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env node
2
+ import { Command } from "commander";
3
+ import { runValidateWorkflow } from "../commands/validate-workflow.js";
4
+ const program = new Command();
5
+ program
6
+ .name("galaxy-workflow-validate")
7
+ .description("Validate Galaxy workflow files (structure + optional tool state)")
8
+ .version("1.0.0")
9
+ .argument("<file>", "Workflow file (.ga, .gxwf.yml)")
10
+ .option("--format <fmt>", "Force format: native or format2 (auto-detected by default)")
11
+ .option("--no-tool-state", "Skip tool state validation")
12
+ .option("--cache-dir <dir>", "Tool cache directory")
13
+ .option("--mode <mode>", "Validation backend: effect (default) or json-schema", "effect")
14
+ .option("--tool-schema-dir <dir>", "Directory of pre-exported per-tool JSON Schemas (for offline json-schema mode)")
15
+ .action(runValidateWorkflow);
16
+ program.parse();
17
+ //# sourceMappingURL=galaxy-workflow-validate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"galaxy-workflow-validate.js","sourceRoot":"","sources":["../../src/bin/galaxy-workflow-validate.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAEvE,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,0BAA0B,CAAC;KAChC,WAAW,CAAC,kEAAkE,CAAC;KAC/E,OAAO,CAAC,OAAO,CAAC;KAChB,QAAQ,CAAC,QAAQ,EAAE,gCAAgC,CAAC;KACpD,MAAM,CAAC,gBAAgB,EAAE,4DAA4D,CAAC;KACtF,MAAM,CAAC,iBAAiB,EAAE,4BAA4B,CAAC;KACvD,MAAM,CAAC,mBAAmB,EAAE,sBAAsB,CAAC;KACnD,MAAM,CAAC,eAAe,EAAE,qDAAqD,EAAE,QAAQ,CAAC;KACxF,MAAM,CAAC,yBAAyB,EAAE,gFAAgF,CAAC;KACnH,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAE/B,OAAO,CAAC,KAAK,EAAE,CAAC"}
@@ -0,0 +1,7 @@
1
+ export interface AddOptions {
2
+ version?: string;
3
+ cacheDir?: string;
4
+ galaxyUrl?: string;
5
+ }
6
+ export declare function runAdd(toolId: string, opts: AddOptions): Promise<void>;
7
+ //# sourceMappingURL=add.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../src/commands/add.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAsB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAa5E"}
@@ -0,0 +1,15 @@
1
+ import { ToolInfoService } from "@galaxy-tool-util/core";
2
+ export async function runAdd(toolId, opts) {
3
+ const service = new ToolInfoService({
4
+ cacheDir: opts.cacheDir,
5
+ galaxyUrl: opts.galaxyUrl,
6
+ });
7
+ const result = await service.getToolInfo(toolId, opts.version);
8
+ if (result === null) {
9
+ console.error(`Failed to fetch tool: ${toolId}`);
10
+ process.exitCode = 1;
11
+ return;
12
+ }
13
+ console.log(`Cached: ${result.name} (${result.id} v${result.version})`);
14
+ }
15
+ //# sourceMappingURL=add.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add.js","sourceRoot":"","sources":["../../src/commands/add.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAQzD,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,MAAc,EAAE,IAAgB;IAC3D,MAAM,OAAO,GAAG,IAAI,eAAe,CAAC;QAClC,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,SAAS,EAAE,IAAI,CAAC,SAAS;KAC1B,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAC/D,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QACpB,OAAO,CAAC,KAAK,CAAC,yBAAyB,MAAM,EAAE,CAAC,CAAC;QACjD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACrB,OAAO;IACT,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,WAAW,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,EAAE,KAAK,MAAM,CAAC,OAAO,GAAG,CAAC,CAAC;AAC1E,CAAC"}
@@ -0,0 +1,5 @@
1
+ export interface ClearOptions {
2
+ cacheDir?: string;
3
+ }
4
+ export declare function runClear(prefix: string | undefined, opts: ClearOptions): Promise<void>;
5
+ //# sourceMappingURL=clear.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clear.d.ts","sourceRoot":"","sources":["../../src/commands/clear.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAY5F"}
@@ -0,0 +1,16 @@
1
+ import { ToolCache } from "@galaxy-tool-util/core";
2
+ export async function runClear(prefix, opts) {
3
+ const cache = new ToolCache({ cacheDir: opts.cacheDir });
4
+ await cache.index.load();
5
+ const before = cache.listCached().length;
6
+ await cache.clearCache(prefix);
7
+ const after = cache.listCached().length;
8
+ const removed = before - after;
9
+ if (prefix) {
10
+ console.log(`Removed ${removed} entries matching "${prefix}".`);
11
+ }
12
+ else {
13
+ console.log(`Cleared ${removed} entries from cache.`);
14
+ }
15
+ }
16
+ //# sourceMappingURL=clear.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clear.js","sourceRoot":"","sources":["../../src/commands/clear.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAMnD,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,MAA0B,EAAE,IAAkB;IAC3E,MAAM,KAAK,GAAG,IAAI,SAAS,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IACzD,MAAM,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IACzB,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,EAAE,CAAC,MAAM,CAAC;IACzC,MAAM,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IAC/B,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,EAAE,CAAC,MAAM,CAAC;IACxC,MAAM,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC;IAC/B,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,CAAC,GAAG,CAAC,WAAW,OAAO,sBAAsB,MAAM,IAAI,CAAC,CAAC;IAClE,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,WAAW,OAAO,sBAAsB,CAAC,CAAC;IACxD,CAAC;AACH,CAAC"}
@@ -0,0 +1,6 @@
1
+ export interface InfoOptions {
2
+ version?: string;
3
+ cacheDir?: string;
4
+ }
5
+ export declare function runInfo(toolId: string, opts: InfoOptions): Promise<void>;
6
+ //# sourceMappingURL=info.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"info.d.ts","sourceRoot":"","sources":["../../src/commands/info.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CA+B9E"}
@@ -0,0 +1,32 @@
1
+ import { ToolCache, cacheKey } from "@galaxy-tool-util/core";
2
+ export async function runInfo(toolId, opts) {
3
+ const cache = new ToolCache({ cacheDir: opts.cacheDir });
4
+ await cache.index.load();
5
+ const coords = cache.resolveToolCoordinates(toolId, opts.version);
6
+ if (coords.version === null) {
7
+ console.error(`No version specified for tool: ${toolId}`);
8
+ process.exitCode = 1;
9
+ return;
10
+ }
11
+ const key = cacheKey(coords.toolshedUrl, coords.trsToolId, coords.version);
12
+ const tool = await cache.loadCached(key);
13
+ if (tool === null) {
14
+ console.error(`Tool not found in cache: ${toolId}`);
15
+ process.exitCode = 1;
16
+ return;
17
+ }
18
+ const indexEntry = cache.index.listAll().find((e) => e.cache_key === key);
19
+ console.log(`Name: ${tool.name}`);
20
+ console.log(`ID: ${tool.id}`);
21
+ console.log(`Version: ${tool.version ?? "unknown"}`);
22
+ console.log(`Description: ${tool.description ?? ""}`);
23
+ console.log(`Inputs: ${tool.inputs.length}`);
24
+ console.log(`Outputs: ${tool.outputs.length}`);
25
+ console.log(`Profile: ${tool.profile ?? "none"}`);
26
+ console.log(`License: ${tool.license ?? "none"}`);
27
+ if (indexEntry) {
28
+ console.log(`Source: ${indexEntry.source}`);
29
+ console.log(`Cached at: ${indexEntry.cached_at}`);
30
+ }
31
+ }
32
+ //# sourceMappingURL=info.js.map
@@ -0,0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C,GAAG,CAAC,gBAAgB,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IACvC,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,CAAC,OAAO,IAAI,SAAS,EAAE,CAAC,CAAC;IACzD,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,CAAC,WAAW,IAAI,EAAE,EAAE,CAAC,CAAC;IACtD,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;IAClD,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACnD,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,CAAC,OAAO,IAAI,MAAM,EAAE,CAAC,CAAC;IACtD,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,CAAC,OAAO,IAAI,MAAM,EAAE,CAAC,CAAC;IACtD,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,CAAC,GAAG,CAAC,gBAAgB,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC;QACjD,OAAO,CAAC,GAAG,CAAC,gBAAgB,UAAU,CAAC,SAAS,EAAE,CAAC,CAAC;IACtD,CAAC;AACH,CAAC"}
@@ -0,0 +1,6 @@
1
+ export interface ListOptions {
2
+ json?: boolean;
3
+ cacheDir?: string;
4
+ }
5
+ export declare function runList(opts: ListOptions): Promise<void>;
6
+ //# sourceMappingURL=list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,OAAO,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CA0B9D"}
@@ -0,0 +1,24 @@
1
+ import { ToolCache } from "@galaxy-tool-util/core";
2
+ export async function runList(opts) {
3
+ const cache = new ToolCache({ cacheDir: opts.cacheDir });
4
+ await cache.index.load();
5
+ const entries = cache.listCached();
6
+ if (entries.length === 0) {
7
+ console.log("Cache is empty.");
8
+ return;
9
+ }
10
+ if (opts.json) {
11
+ console.log(JSON.stringify(entries, null, 2));
12
+ return;
13
+ }
14
+ const header = ["Tool ID", "Version", "Source", "Cached At"];
15
+ const rows = entries.map((e) => [e.tool_id, e.tool_version, e.source, e.cached_at]);
16
+ const widths = header.map((h, i) => Math.max(h.length, ...rows.map((r) => r[i].length)));
17
+ const sep = widths.map((w) => "-".repeat(w)).join(" ");
18
+ console.log(header.map((h, i) => h.padEnd(widths[i])).join(" "));
19
+ console.log(sep);
20
+ for (const row of rows) {
21
+ console.log(row.map((c, i) => c.padEnd(widths[i])).join(" "));
22
+ }
23
+ }
24
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAOnD,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,IAAiB;IAC7C,MAAM,KAAK,GAAG,IAAI,SAAS,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IACzD,MAAM,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IACzB,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,EAAE,CAAC;IAEnC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC/B,OAAO;IACT,CAAC;IAED,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;QACd,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAC9C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@ -0,0 +1,16 @@
1
+ import { type ToolCache, type ParsedTool } from "@galaxy-tool-util/core";
2
+ export interface ResolvedTool {
3
+ tool: ParsedTool;
4
+ key: string;
5
+ }
6
+ export type ResolveError = {
7
+ kind: "no_version";
8
+ toolId: string;
9
+ } | {
10
+ kind: "not_cached";
11
+ toolId: string;
12
+ key: string;
13
+ };
14
+ export declare function isResolveError(r: ResolvedTool | ResolveError): r is ResolveError;
15
+ export declare function loadCachedTool(cache: ToolCache, toolId: string, version?: string | null): Promise<ResolvedTool | ResolveError>;
16
+ //# sourceMappingURL=resolve-tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-tool.d.ts","sourceRoot":"","sources":["../../src/commands/resolve-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAY,KAAK,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEnF,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,UAAU,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,MAAM,YAAY,GACpB;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACtC;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAExD,wBAAgB,cAAc,CAAC,CAAC,EAAE,YAAY,GAAG,YAAY,GAAG,CAAC,IAAI,YAAY,CAEhF;AAED,wBAAsB,cAAc,CAClC,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GACtB,OAAO,CAAC,YAAY,GAAG,YAAY,CAAC,CAWtC"}
@@ -0,0 +1,17 @@
1
+ import { cacheKey } from "@galaxy-tool-util/core";
2
+ export function isResolveError(r) {
3
+ return "kind" in r;
4
+ }
5
+ export async function loadCachedTool(cache, toolId, version) {
6
+ const coords = cache.resolveToolCoordinates(toolId, version);
7
+ if (coords.version === null) {
8
+ return { kind: "no_version", toolId };
9
+ }
10
+ const key = cacheKey(coords.toolshedUrl, coords.trsToolId, coords.version);
11
+ const tool = await cache.loadCached(key);
12
+ if (tool === null) {
13
+ return { kind: "not_cached", toolId, key };
14
+ }
15
+ return { tool, key };
16
+ }
17
+ //# sourceMappingURL=resolve-tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-tool.js","sourceRoot":"","sources":["../../src/commands/resolve-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,QAAQ,EAAmB,MAAM,wBAAwB,CAAC;AAWnF,MAAM,UAAU,cAAc,CAAC,CAA8B;IAC3D,OAAO,MAAM,IAAI,CAAC,CAAC;AACrB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,KAAgB,EAChB,MAAc,EACd,OAAuB;IAEvB,MAAM,MAAM,GAAG,KAAK,CAAC,sBAAsB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7D,IAAI,MAAM,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;QAC5B,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC;IACxC,CAAC;IACD,MAAM,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IAC3E,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACzC,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAClB,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;IAC7C,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;AACvB,CAAC"}
@@ -0,0 +1,8 @@
1
+ export interface SchemaOptions {
2
+ version?: string;
3
+ representation?: string;
4
+ output?: string;
5
+ cacheDir?: string;
6
+ }
7
+ export declare function runSchema(toolId: string, opts: SchemaOptions): Promise<void>;
8
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/commands/schema.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAoDlF"}
@@ -0,0 +1,55 @@
1
+ import { ToolCache } from "@galaxy-tool-util/core";
2
+ import { createFieldModel, STATE_REPRESENTATIONS, } from "@galaxy-tool-util/schema";
3
+ import * as JSONSchema from "effect/JSONSchema";
4
+ import { writeFile } from "node:fs/promises";
5
+ import { isResolveError, loadCachedTool } from "./resolve-tool.js";
6
+ export async function runSchema(toolId, opts) {
7
+ const repName = opts.representation ?? "workflow_step";
8
+ if (!STATE_REPRESENTATIONS.includes(repName)) {
9
+ console.error(`Unknown representation: ${repName}. Available: ${STATE_REPRESENTATIONS.join(", ")}`);
10
+ process.exitCode = 1;
11
+ return;
12
+ }
13
+ const stateRep = repName;
14
+ const cache = new ToolCache({ cacheDir: opts.cacheDir });
15
+ await cache.index.load();
16
+ const result = await loadCachedTool(cache, toolId, opts.version);
17
+ if (isResolveError(result)) {
18
+ if (result.kind === "no_version") {
19
+ console.error(`No version specified for tool: ${toolId}`);
20
+ }
21
+ else {
22
+ console.error(`Tool not found in cache: ${toolId}. Run 'galaxy-tool-cache add' first.`);
23
+ }
24
+ process.exitCode = 1;
25
+ return;
26
+ }
27
+ const bundle = {
28
+ parameters: result.tool.inputs,
29
+ };
30
+ const effectSchema = createFieldModel(bundle, stateRep);
31
+ if (effectSchema === undefined) {
32
+ console.error(`Could not generate schema — tool may contain unsupported parameter types.`);
33
+ process.exitCode = 1;
34
+ return;
35
+ }
36
+ let jsonSchema;
37
+ try {
38
+ jsonSchema = JSONSchema.make(effectSchema);
39
+ }
40
+ catch (e) {
41
+ const msg = e instanceof Error ? e.message : String(e);
42
+ console.error(`JSON Schema generation failed: ${msg}`);
43
+ process.exitCode = 1;
44
+ return;
45
+ }
46
+ const output = JSON.stringify(jsonSchema, null, 2);
47
+ if (opts.output) {
48
+ await writeFile(opts.output, output);
49
+ console.log(`Schema written to ${opts.output}`);
50
+ }
51
+ else {
52
+ console.log(output);
53
+ }
54
+ }
55
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/commands/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EACL,gBAAgB,EAChB,qBAAqB,GAGtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AASnE,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,MAAc,EAAE,IAAmB;IACjE,MAAM,OAAO,GAAG,IAAI,CAAC,cAAc,IAAI,eAAe,CAAC;IACvD,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,OAA8B,CAAC,EAAE,CAAC;QACpE,OAAO,CAAC,KAAK,CACX,2BAA2B,OAAO,gBAAgB,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACrF,CAAC;QACF,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACrB,OAAO;IACT,CAAC;IACD,MAAM,QAAQ,GAAG,OAA8B,CAAC;IAEhD,MAAM,KAAK,GAAG,IAAI,SAAS,CAAC,E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QACrB,OAAO;IACT,CAAC;IACD,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAEnD,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;QAChB,MAAM,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACrC,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;IAClD,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACtB,CAAC;AACH,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Default URL resolver for subworkflow expansion.
3
+ *
4
+ * Handles:
5
+ * - base64:// URLs: base64-decode inline content, parse as YAML/JSON
6
+ * - TRS URLs (GA4GH pattern): fetch descriptor endpoint, extract `content`
7
+ * - Plain HTTP/HTTPS URLs: fetch and parse based on content-type
8
+ * - File paths (no ://): read from workflowDirectory
9
+ *
10
+ * Port of gxformat2/options.py default_url_resolver + resolve_import.
11
+ */
12
+ import { type RefResolver } from "@galaxy-tool-util/schema";
13
+ export interface DefaultResolverOptions {
14
+ /** Custom fetch implementation. Defaults to globalThis.fetch. */
15
+ fetcher?: typeof fetch;
16
+ /** Directory for resolving relative file path references. */
17
+ workflowDirectory?: string;
18
+ }
19
+ /**
20
+ * Create a default RefResolver that handles base64, TRS, HTTP, and file paths.
21
+ */
22
+ export declare function createDefaultResolver(opts?: DefaultResolverOptions): RefResolver;
23
+ //# sourceMappingURL=url-resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url-resolver.d.ts","sourceRoot":"","sources":["../../src/commands/url-resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,OAAO,EAAY,KAAK,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEtE,MAAM,WAAW,sBAAsB;IACrC,iEAAiE;IACjE,OAAO,CAAC,EAAE,OAAO,KAAK,CAAC;IACvB,6DAA6D;IAC7D,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,GAAE,sBAA2B,GAAG,WAAW,CA2CpF"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Default URL resolver for subworkflow expansion.
3
+ *
4
+ * Handles:
5
+ * - base64:// URLs: base64-decode inline content, parse as YAML/JSON
6
+ * - TRS URLs (GA4GH pattern): fetch descriptor endpoint, extract `content`
7
+ * - Plain HTTP/HTTPS URLs: fetch and parse based on content-type
8
+ * - File paths (no ://): read from workflowDirectory
9
+ *
10
+ * Port of gxformat2/options.py default_url_resolver + resolve_import.
11
+ */
12
+ import { readFile } from "node:fs/promises";
13
+ import { join } from "node:path";
14
+ import * as yaml from "yaml";
15
+ import { isTrsUrl } from "@galaxy-tool-util/schema";
16
+ /**
17
+ * Create a default RefResolver that handles base64, TRS, HTTP, and file paths.
18
+ */
19
+ export function createDefaultResolver(opts = {}) {
20
+ const fetcher = opts.fetcher ?? globalThis.fetch;
21
+ const workflowDirectory = opts.workflowDirectory;
22
+ return async (ref) => {
23
+ // base64:// — inline encoded workflow
24
+ if (ref.startsWith("base64://")) {
25
+ const encoded = ref.slice("base64://".length);
26
+ const content = Buffer.from(encoded, "base64").toString("utf-8");
27
+ return yaml.parse(content);
28
+ }
29
+ // URL — fetch via HTTP
30
+ if (ref.includes("://")) {
31
+ const response = await fetcher(ref, {
32
+ headers: { Accept: "application/json, application/x-yaml, text/yaml, */*" },
33
+ signal: AbortSignal.timeout(30_000),
34
+ });
35
+ if (!response.ok) {
36
+ throw new Error(`Failed to fetch ${ref}: ${response.status}`);
37
+ }
38
+ if (isTrsUrl(ref)) {
39
+ const descriptor = (await response.json());
40
+ return yaml.parse(descriptor.content);
41
+ }
42
+ const contentType = response.headers.get("content-type") ?? "";
43
+ if (contentType.includes("json")) {
44
+ return (await response.json());
45
+ }
46
+ const text = await response.text();
47
+ return yaml.parse(text);
48
+ }
49
+ // File path — read from workflowDirectory
50
+ if (!workflowDirectory) {
51
+ throw new Error(`Cannot resolve file path '${ref}' without workflowDirectory`);
52
+ }
53
+ const fullPath = join(workflowDirectory, ref);
54
+ const content = await readFile(fullPath, "utf-8");
55
+ return yaml.parse(content);
56
+ };
57
+ }
58
+ //# sourceMappingURL=url-resolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url-resolver.js","sourceRoot":"","sources":["../../src/commands/url-resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAoB,MAAM,0BAA0B,CAAC;AAStE;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,OAA+B,EAAE;IACrE,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,UAAU,CAAC,KAAK,CAAC;IACjD,MAAM,iBAAiB,GAAG,IAAI,CAAC,iBAAiB,CAAC;IAEjD,OAAO,KAAK,EAAE,GAAW,EAAoC,EAAE;QAC7D,sCAAsC;QACtC,IAAI,GAAG,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;YAChC,MAAM,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YAC9C,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YACjE,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAA4B,CAAC;QACxD,CAAC;QAED,uBAAuB;QACvB,IAAI,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YACxB,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,EA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
2
+ * JSON Schema-based workflow validation.
3
+ *
4
+ * Two-level validation using AJV Draft 2020-12:
5
+ * Level 1 (structural): validates workflow dict against generated JSON Schema
6
+ * Level 2 (per-step tool state): validates each step's state against tool-specific JSON Schema
7
+ *
8
+ * Mirrors Galaxy's validation_json_schema.py.
9
+ */
10
+ import { ToolCache } from "@galaxy-tool-util/core";
11
+ import { type ExpansionOptions } from "@galaxy-tool-util/schema";
12
+ import type { ValidateWorkflowOptions, WorkflowFormat, StepValidationResult } from "./validate-workflow.js";
13
+ export declare function runValidateWorkflowJsonSchema(data: Record<string, unknown>, format: WorkflowFormat, opts: ValidateWorkflowOptions, expansionOpts?: ExpansionOptions): Promise<void>;
14
+ export declare function validateNativeStepsJsonSchema(data: Record<string, unknown>, cache: ToolCache, toolSchemaDir?: string, prefix?: string, expansionOpts?: ExpansionOptions): Promise<StepValidationResult[]>;
15
+ export declare function validateFormat2StepsJsonSchema(data: Record<string, unknown>, cache: ToolCache, toolSchemaDir?: string, prefix?: string, expansionOpts?: ExpansionOptions): Promise<StepValidationResult[]>;
16
+ //# sourceMappingURL=validate-workflow-json-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-workflow-json-schema.d.ts","sourceRoot":"","sources":["../../src/commands/validate-workflow-json-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAcL,KAAK,gBAAgB,EACtB,MAAM,0BAA0B,CAAC;AAMlC,OAAO,KAAK,EAAE,uBAAuB,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAwH5G,wBAAsB,6BAA6B,CACjD,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,uBAAuB,EAC7B,aAAa,CAAC,EAAE,gBAAgB,GAC/B,OAAO,CAAC,IAAI,CAAC,CA0Ef;AAID,wBAAsB,6BAA6B,CACjD,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,KAAK,EAAE,SAAS,EAChB,aAAa,CAAC,EAAE,MAAM,EACtB,MAAM,SAAK,EACX,aAAa,CAAC,EAAE,gBAAgB,GAC/B,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAGjC;AAgFD,wBAAsB,8BAA8B,CAClD,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,KAAK,EAAE,SAAS,EAChB,aAAa,CAAC,EAAE,MAAM,EACtB,MAAM,SAAK,EACX,aAAa,CAAC,EAAE,gBAAgB,GAC/B,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAGjC"}