@galaxy-tool-util/cli 1.0.0 → 1.2.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 (90) hide show
  1. package/dist/bin/galaxy-tool-cache.js +2 -63
  2. package/dist/bin/galaxy-tool-cache.js.map +1 -1
  3. package/dist/bin/gxwf.js +2 -156
  4. package/dist/bin/gxwf.js.map +1 -1
  5. package/dist/commands/annotate-connections.d.ts +30 -0
  6. package/dist/commands/annotate-connections.d.ts.map +1 -0
  7. package/dist/commands/annotate-connections.js +42 -0
  8. package/dist/commands/annotate-connections.js.map +1 -0
  9. package/dist/commands/connection-validation.d.ts +20 -0
  10. package/dist/commands/connection-validation.d.ts.map +1 -0
  11. package/dist/commands/connection-validation.js +26 -0
  12. package/dist/commands/connection-validation.js.map +1 -0
  13. package/dist/commands/cytoscapejs/_template-bundled.d.ts +2 -0
  14. package/dist/commands/cytoscapejs/_template-bundled.d.ts.map +1 -0
  15. package/dist/commands/cytoscapejs/_template-bundled.js +182 -0
  16. package/dist/commands/cytoscapejs/_template-bundled.js.map +1 -0
  17. package/dist/commands/cytoscapejs.d.ts +12 -0
  18. package/dist/commands/cytoscapejs.d.ts.map +1 -0
  19. package/dist/commands/cytoscapejs.js +62 -0
  20. package/dist/commands/cytoscapejs.js.map +1 -0
  21. package/dist/commands/lint.d.ts.map +1 -1
  22. package/dist/commands/lint.js +14 -1
  23. package/dist/commands/lint.js.map +1 -1
  24. package/dist/commands/mermaid.d.ts +2 -0
  25. package/dist/commands/mermaid.d.ts.map +1 -1
  26. package/dist/commands/mermaid.js +5 -1
  27. package/dist/commands/mermaid.js.map +1 -1
  28. package/dist/commands/repo-search.d.ts +31 -0
  29. package/dist/commands/repo-search.d.ts.map +1 -0
  30. package/dist/commands/repo-search.js +100 -0
  31. package/dist/commands/repo-search.js.map +1 -0
  32. package/dist/commands/tool-revisions.d.ts +15 -0
  33. package/dist/commands/tool-revisions.d.ts.map +1 -0
  34. package/dist/commands/tool-revisions.js +56 -0
  35. package/dist/commands/tool-revisions.js.map +1 -0
  36. package/dist/commands/tool-search.d.ts +17 -0
  37. package/dist/commands/tool-search.d.ts.map +1 -0
  38. package/dist/commands/tool-search.js +107 -0
  39. package/dist/commands/tool-search.js.map +1 -0
  40. package/dist/commands/tool-versions.d.ts +11 -0
  41. package/dist/commands/tool-versions.d.ts.map +1 -0
  42. package/dist/commands/tool-versions.js +70 -0
  43. package/dist/commands/tool-versions.js.map +1 -0
  44. package/dist/commands/validate-workflow.d.ts +1 -0
  45. package/dist/commands/validate-workflow.d.ts.map +1 -1
  46. package/dist/commands/validate-workflow.js +38 -3
  47. package/dist/commands/validate-workflow.js.map +1 -1
  48. package/dist/index.d.ts +3 -0
  49. package/dist/index.d.ts.map +1 -1
  50. package/dist/index.js +2 -0
  51. package/dist/index.js.map +1 -1
  52. package/dist/meta/extract-spec.d.ts +13 -0
  53. package/dist/meta/extract-spec.d.ts.map +1 -0
  54. package/dist/meta/extract-spec.js +90 -0
  55. package/dist/meta/extract-spec.js.map +1 -0
  56. package/dist/meta/index.d.ts +8 -0
  57. package/dist/meta/index.d.ts.map +1 -0
  58. package/dist/meta/index.js +21 -0
  59. package/dist/meta/index.js.map +1 -0
  60. package/dist/meta/spec-types.d.ts +40 -0
  61. package/dist/meta/spec-types.d.ts.map +1 -0
  62. package/dist/meta/spec-types.js +11 -0
  63. package/dist/meta/spec-types.js.map +1 -0
  64. package/dist/meta/specs.d.ts +4 -0
  65. package/dist/meta/specs.d.ts.map +1 -0
  66. package/dist/meta/specs.js +10 -0
  67. package/dist/meta/specs.js.map +1 -0
  68. package/dist/meta/types.d.ts +55 -0
  69. package/dist/meta/types.d.ts.map +1 -0
  70. package/dist/meta/types.js +9 -0
  71. package/dist/meta/types.js.map +1 -0
  72. package/dist/meta-build.d.ts +13 -0
  73. package/dist/meta-build.d.ts.map +1 -0
  74. package/dist/meta-build.js +60 -0
  75. package/dist/meta-build.js.map +1 -0
  76. package/dist/programs/galaxy-tool-cache.d.ts +7 -0
  77. package/dist/programs/galaxy-tool-cache.d.ts.map +1 -0
  78. package/dist/programs/galaxy-tool-cache.js +22 -0
  79. package/dist/programs/galaxy-tool-cache.js.map +1 -0
  80. package/dist/programs/gxwf.d.ts +9 -0
  81. package/dist/programs/gxwf.d.ts.map +1 -0
  82. package/dist/programs/gxwf.js +56 -0
  83. package/dist/programs/gxwf.js.map +1 -0
  84. package/dist/spec/build-program.d.ts +12 -0
  85. package/dist/spec/build-program.d.ts.map +1 -0
  86. package/dist/spec/build-program.js +102 -0
  87. package/dist/spec/build-program.js.map +1 -0
  88. package/package.json +10 -3
  89. package/spec/galaxy-tool-cache.json +152 -0
  90. package/spec/gxwf.json +693 -0
@@ -1,65 +1,4 @@
1
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 { runPopulateWorkflow } from "../commands/populate-workflow.js";
8
- import { runSchema } from "../commands/schema.js";
9
- import { runStructuralSchema } from "../commands/structural-schema.js";
10
- const program = new Command();
11
- program
12
- .name("galaxy-tool-cache")
13
- .description("Cache and inspect Galaxy tool metadata")
14
- .version("1.0.0");
15
- program
16
- .command("add")
17
- .description("Fetch a tool from ToolShed/Galaxy and cache it")
18
- .argument("<tool_id>", "Tool ID (full toolshed path or TRS ID)")
19
- .option("--version <ver>", "Tool version")
20
- .option("--cache-dir <dir>", "Cache directory")
21
- .option("--galaxy-url <url>", "Galaxy instance URL for fallback")
22
- .action(runAdd);
23
- program
24
- .command("list")
25
- .description("List cached tools")
26
- .option("--json", "Output as JSON")
27
- .option("--cache-dir <dir>", "Cache directory")
28
- .action(runList);
29
- program
30
- .command("info")
31
- .description("Show metadata for a cached tool")
32
- .argument("<tool_id>", "Tool ID")
33
- .option("--version <ver>", "Tool version")
34
- .option("--cache-dir <dir>", "Cache directory")
35
- .action(runInfo);
36
- program
37
- .command("clear")
38
- .description("Clear cached tools")
39
- .argument("[prefix]", "Only clear tools matching this prefix")
40
- .option("--cache-dir <dir>", "Cache directory")
41
- .action(runClear);
42
- program
43
- .command("schema")
44
- .description("Export JSON Schema for a cached tool's parameters")
45
- .argument("<tool_id>", "Tool ID")
46
- .option("--version <ver>", "Tool version")
47
- .option("--representation <rep>", "State representation (e.g., workflow_step)", "workflow_step")
48
- .option("--output <file>", "Output file (default: stdout)")
49
- .option("--cache-dir <dir>", "Cache directory")
50
- .action(runSchema);
51
- program
52
- .command("populate-workflow")
53
- .description("Scan a workflow and cache all referenced tools")
54
- .argument("<file>", "Workflow file (.ga, .gxwf.yml)")
55
- .option("--cache-dir <dir>", "Cache directory")
56
- .option("--galaxy-url <url>", "Galaxy instance URL for fallback")
57
- .action(runPopulateWorkflow);
58
- program
59
- .command("structural-schema")
60
- .description("Export the structural JSON Schema for Galaxy workflows")
61
- .option("--format <fmt>", "Workflow format: format2 (default) or native", "format2")
62
- .option("--output <file>", "Output file (default: stdout)")
63
- .action(runStructuralSchema);
64
- program.parse();
2
+ import { buildGalaxyToolCacheProgram } from "../programs/galaxy-tool-cache.js";
3
+ buildGalaxyToolCacheProgram().parse();
65
4
  //# sourceMappingURL=galaxy-tool-cache.js.map
@@ -1 +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,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,M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CAAC;KACjB,WAAW,CAAC,mDAAmD,CAAC;KAChE,QAAQ,CAAC,WAAW,EAAE,SAAS,CAAC;KAChC,MAAM,CAAC,iBAAiB,EAAE,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;KACJ,OAAO,CAAC,mBAAmB,CAAC;KAC5B,WAAW,CAAC,gDAAgD,CAAC;KAC7D,QAAQ,CAAC,QAAQ,EAAE,gCAAgC,CAAC;KACpD,MAAM,CAAC,mBAAmB,EAAE,iBAAiB,CAAC;KAC9C,MAAM,CAAC,oBAAoB,EAAE,kCAAkC,CAAC;KAChE,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAE/B,OAAO;KACJ,OAAO,CAAC,mBAAmB,CAAC;KAC5B,WAAW,CAAC,wDAAwD,CAAC;KACrE,MAAM,CAAC,gBAAgB,EAAE,8CAA8C,EAAE,SAAS,CAAC;KACnF,MAAM,CAAC,iBAAiB,EAAE,+BAA+B,CAAC;KAC1D,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAE/B,OAAO,CAAC,KAAK,EAAE,CAAC"}
1
+ {"version":3,"file":"galaxy-tool-cache.js","sourceRoot":"","sources":["../../src/bin/galaxy-tool-cache.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAE/E,2BAA2B,EAAE,CAAC,KAAK,EAAE,CAAC"}
package/dist/bin/gxwf.js CHANGED
@@ -1,158 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import { Command } from "commander";
3
- import { runClean } from "../commands/clean.js";
4
- import { runCleanTree } from "../commands/clean-tree.js";
5
- import { runConvert } from "../commands/convert.js";
6
- import { runConvertTree } from "../commands/convert-tree.js";
7
- import { runRoundtrip } from "../commands/roundtrip.js";
8
- import { runRoundtripTree } from "../commands/roundtrip-tree.js";
9
- import { runLint } from "../commands/lint.js";
10
- import { runMermaid } from "../commands/mermaid.js";
11
- import { runLintTree } from "../commands/lint-tree.js";
12
- import { runValidateWorkflow } from "../commands/validate-workflow.js";
13
- import { runValidateTests } from "../commands/validate-tests.js";
14
- import { runValidateTestsTree } from "../commands/validate-tests-tree.js";
15
- import { runValidateTree } from "../commands/validate-tree.js";
16
- import { addStrictOptions } from "../commands/strict-options.js";
17
- const program = new Command();
18
- program
19
- .name("gxwf")
20
- .description("Galaxy workflow operations — validate, clean, lint, convert (single-file and tree)")
21
- .version("1.0.0");
22
- addStrictOptions(program
23
- .command("validate")
24
- .description("Validate Galaxy workflow files (structure + optional tool state)")
25
- .argument("<file>", "Workflow file (.ga, .gxwf.yml)")
26
- .option("--format <fmt>", "Force format: native or format2 (auto-detected by default)")
27
- .option("--no-tool-state", "Skip tool state validation")
28
- .option("--cache-dir <dir>", "Tool cache directory")
29
- .option("--mode <mode>", "Validation backend: effect (default) or json-schema", "effect")
30
- .option("--tool-schema-dir <dir>", "Directory of pre-exported per-tool JSON Schemas (for offline json-schema mode)")
31
- .option("--json", "Output structured JSON report")
32
- .option("--report-html [file]", "Write HTML report to file (or stdout if omitted)")).action(runValidateWorkflow);
33
- program
34
- .command("validate-tests")
35
- .description("Validate a workflow-test file (*-tests.yml, *.gxwf-tests.yml) against the Galaxy Tests schema")
36
- .argument("<file>", "Tests file (*-tests.yml)")
37
- .option("--json", "Output structured JSON report")
38
- .option("--workflow <path>", "Cross-check job inputs + output assertions against a workflow (.ga / .gxwf.yml)")
39
- .action(runValidateTests);
40
- program
41
- .command("clean")
42
- .description("Strip stale keys and decode legacy tool_state encoding")
43
- .argument("<file>", "Workflow file (.ga, .gxwf.yml)")
44
- .option("--output <file>", "Write cleaned workflow to file (default: stdout)")
45
- .option("--diff", "Show diff of changes instead of writing output")
46
- .option("--format <fmt>", "Force format: native or format2 (auto-detected by default)")
47
- .option("--json", "Output structured JSON report")
48
- .option("--report-html [file]", "Write HTML report to file (or stdout if omitted)")
49
- .option("--skip-uuid", "Skip stripping uuid fields (errors are always stripped)")
50
- .action(runClean);
51
- addStrictOptions(program
52
- .command("lint")
53
- .description("Lint Galaxy workflow — structural checks, best practices, tool state validation")
54
- .argument("<file>", "Workflow file (.ga, .gxwf.yml)")
55
- .option("--skip-best-practices", "Skip annotation/creator/license/label checks")
56
- .option("--skip-state-validation", "Skip tool state validation against cached tool definitions")
57
- .option("--cache-dir <dir>", "Tool cache directory (for state validation)")
58
- .option("--format <fmt>", "Force format: native or format2 (auto-detected by default)")
59
- .option("--json", "Output structured JSON result")
60
- .option("--report-html [file]", "Write HTML report to file (or stdout if omitted)")).action(runLint);
61
- addStrictOptions(program
62
- .command("convert")
63
- .description("Convert between native (.ga) and format2 (.gxwf.yml) formats")
64
- .argument("<file>", "Workflow file (.ga, .gxwf.yml)")
65
- .option("--to <format>", "Target format: native or format2 (infers opposite by default)")
66
- .option("--output <file>", "Write result to file (default: stdout)")
67
- .option("--compact", "Omit position info in format2 output")
68
- .option("--json", "Force JSON output")
69
- .option("--yaml", "Force YAML output")
70
- .option("--format <fmt>", "Force source format (auto-detected by default)")
71
- .option("--stateful", "Use cached tool definitions for schema-aware state re-encoding")
72
- .option("--cache-dir <dir>", "Tool cache directory (for --stateful)")).action(runConvert);
73
- addStrictOptions(program
74
- .command("roundtrip")
75
- .description("Roundtrip-validate a native workflow: native → format2 → native, diff tool_state")
76
- .argument("<file>", "Native workflow file (.ga)")
77
- .option("--cache-dir <dir>", "Tool cache directory")
78
- .option("--format <fmt>", "Force source format (must resolve to native)")
79
- .option("--json", "Output structured JSON report")
80
- .option("--errors-only", "Suppress benign diffs and clean steps from output")
81
- .option("--benign-only", "Show only steps with benign diffs (no errors, no failures)")
82
- .option("--brief", "Omit per-diff list; show only the one-line summary")).action(runRoundtrip);
83
- program
84
- .command("mermaid")
85
- .description("Render a Galaxy workflow as a Mermaid flowchart diagram")
86
- .argument("<file>", "Workflow file (.ga, .gxwf.yml)")
87
- .argument("[output]", "Output path (.mmd for raw, .md for fenced code block); stdout if omitted")
88
- .option("--comments", "Render frame comments as Mermaid subgraphs")
89
- .action((file, output, opts) => runMermaid(file, { output, comments: opts.comments }));
90
- // -- Tree (batch) variants --
91
- addStrictOptions(program
92
- .command("validate-tree")
93
- .description("Batch validate all workflows under a directory")
94
- .argument("<dir>", "Directory to scan for workflows")
95
- .option("--format <fmt>", "Force format: native or format2 (auto-detected by default)")
96
- .option("--no-tool-state", "Skip tool state validation")
97
- .option("--cache-dir <dir>", "Tool cache directory")
98
- .option("--mode <mode>", "Validation backend: effect (default) or json-schema", "effect")
99
- .option("--tool-schema-dir <dir>", "Directory of pre-exported per-tool JSON Schemas (for offline json-schema mode)")
100
- .option("--json", "Output structured JSON report")
101
- .option("--report-markdown [file]", "Write Markdown report to file (or stdout if omitted)")
102
- .option("--report-html [file]", "Write HTML report to file (or stdout if omitted)")).action(runValidateTree);
103
- addStrictOptions(program
104
- .command("lint-tree")
105
- .description("Batch lint all workflows under a directory")
106
- .argument("<dir>", "Directory to scan for workflows")
107
- .option("--skip-best-practices", "Skip annotation/creator/license/label checks")
108
- .option("--skip-state-validation", "Skip tool state validation against cached tool definitions")
109
- .option("--cache-dir <dir>", "Tool cache directory (for state validation)")
110
- .option("--format <fmt>", "Force format: native or format2 (auto-detected by default)")
111
- .option("--json", "Output structured JSON report")
112
- .option("--report-markdown [file]", "Write Markdown report to file (or stdout if omitted)")
113
- .option("--report-html [file]", "Write HTML report to file (or stdout if omitted)")).action(runLintTree);
114
- program
115
- .command("clean-tree")
116
- .description("Batch clean all workflows under a directory")
117
- .argument("<dir>", "Directory to scan for workflows")
118
- .option("--output-dir <dir>", "Write cleaned workflows to directory (mirrors source tree)")
119
- .option("--format <fmt>", "Force format: native or format2 (auto-detected by default)")
120
- .option("--json", "Output structured JSON report")
121
- .option("--report-markdown [file]", "Write Markdown report to file (or stdout if omitted)")
122
- .option("--report-html [file]", "Write HTML report to file (or stdout if omitted)")
123
- .option("--skip-uuid", "Skip stripping uuid fields (errors are always stripped)")
124
- .action(runCleanTree);
125
- addStrictOptions(program
126
- .command("convert-tree")
127
- .description("Batch convert all workflows under a directory")
128
- .argument("<dir>", "Directory to scan for workflows")
129
- .option("--to <format>", "Target format: native or format2 (infers opposite by default)")
130
- .option("--output-dir <dir>", "Write converted workflows to directory (required)")
131
- .option("--compact", "Omit position info in format2 output")
132
- .option("--report-json", "Output structured JSON report")
133
- .option("--json", "Force JSON output for converted files")
134
- .option("--yaml", "Force YAML output")
135
- .option("--format <fmt>", "Force source format (auto-detected by default)")
136
- .option("--stateful", "Use cached tool definitions for schema-aware state re-encoding")
137
- .option("--cache-dir <dir>", "Tool cache directory (for --stateful)")).action(runConvertTree);
138
- addStrictOptions(program
139
- .command("roundtrip-tree")
140
- .description("Batch roundtrip-validate native workflows under a directory")
141
- .argument("<dir>", "Directory to scan for native workflows")
142
- .option("--cache-dir <dir>", "Tool cache directory")
143
- .option("--format <fmt>", "Force source format (must resolve to native)")
144
- .option("--json", "Output structured JSON report")
145
- .option("--errors-only", "List only files with errors or failures")
146
- .option("--benign-only", "List only files with benign diffs (no errors, no failures)")
147
- .option("--brief", "Omit per-file lines; print only the aggregate summary")
148
- .option("--report-markdown [file]", "Write Markdown report to file (or stdout if omitted)")
149
- .option("--report-html [file]", "Write HTML report to file (or stdout if omitted)")).action(runRoundtripTree);
150
- program
151
- .command("validate-tests-tree")
152
- .description("Batch validate workflow-test files (*-tests.yml / *.gxwf-tests.yml) under a directory")
153
- .argument("<dir>", "Directory to scan for test files")
154
- .option("--json", "Output structured JSON report")
155
- .option("--auto-workflow", "Pair each tests file with a sibling workflow by filename convention (foo.gxwf-tests.yml ↔ foo.gxwf.yml/foo.ga) and cross-check inputs/outputs")
156
- .action(runValidateTestsTree);
157
- program.parse();
2
+ import { buildGxwfProgram } from "../programs/gxwf.js";
3
+ buildGxwfProgram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AAmB,EAAE,uCAAuC,CAAC,CACxE,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;AAEzB,gBAAgB,CACd,OAAO;KACJ,OAAO,CAAC,gBAAgB,CAAC;KACzB,WAAW,CAAC,6DAA6D,CAAC;KAC1E,QAAQ,CAAC,OAAO,EAAE,wCAAwC,CAAC;KAC3D,MAAM,CAAC,mBAAmB,EAAE,sBAAsB,CAAC;KACnD,MAAM,CAAC,gBAAgB,EAAE,8CAA8C,CAAC;KACxE,MAAM,CAAC,QAAQ,EAAE,+BAA+B,CAAC;KACjD,MAAM,CAAC,eAAe,EAAE,yCAAyC,CAAC;KAClE,MAAM,CAAC,eAAe,EAAE,4DAA4D,CAAC;KACrF,MAAM,CAAC,SAAS,EAAE,uDAAuD,CAAC;KAC1E,MAAM,CAAC,0BAA0B,EAAE,sDAAsD,CAAC;KAC1F,MAAM,CAAC,sBAAsB,EAAE,kDAAkD,CAAC,CACtF,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAE3B,OAAO;KACJ,OAAO,CAAC,qBAAqB,CAAC;KAC9B,WAAW,CACV,uFAAuF,CACxF;KACA,QAAQ,CAAC,OAAO,EAAE,kCAAkC,CAAC;KACrD,MAAM,CAAC,QAAQ,EAAE,+BAA+B,CAAC;KACjD,MAAM,CACL,iBAAiB,EACjB,+IAA+I,CAChJ;KACA,MAAM,CAAC,oBAAoB,CAAC,CAAC;AAEhC,OAAO,CAAC,KAAK,EAAE,CAAC"}
1
+ {"version":3,"file":"gxwf.js","sourceRoot":"","sources":["../../src/bin/gxwf.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,gBAAgB,EAAE,CAAC,KAAK,EAAE,CAAC"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Helper for `gxwf mermaid` / `gxwf cytoscapejs` `--annotate-connections`:
3
+ * runs the connection validator against a workflow and returns the
4
+ * `EdgeAnnotation` lookup the emitters consume.
5
+ */
6
+ import { type EdgeAnnotation } from "@galaxy-tool-util/connection-validation";
7
+ import type { ToolCache } from "@galaxy-tool-util/core";
8
+ import type { ParsedTool } from "@galaxy-tool-util/schema";
9
+ export interface ResolveEdgeAnnotationsOptions {
10
+ cacheDir?: string;
11
+ }
12
+ export declare function resolveEdgeAnnotations(data: Record<string, unknown>, opts?: ResolveEdgeAnnotationsOptions): Promise<Map<string, EdgeAnnotation>>;
13
+ export declare function resolveEdgeAnnotationsWithCache(data: Record<string, unknown>, cache: ToolCache): Promise<Map<string, EdgeAnnotation>>;
14
+ export interface ResolvedToolSpec {
15
+ tool_id: string;
16
+ tool_version: string;
17
+ parsed: ParsedTool;
18
+ }
19
+ /**
20
+ * Variant of `resolveEdgeAnnotationsWithCache` that also returns the
21
+ * `ParsedTool` specs the validator consumed, keyed by `toolId@toolVersion`.
22
+ * The hybrid `gxwf-web` edge-annotations response uses this so co-resident
23
+ * browsers can write the specs into IndexedDB and warm the client-side
24
+ * `useToolInfoService` for free.
25
+ */
26
+ export declare function resolveEdgeAnnotationsAndSpecsWithCache(data: Record<string, unknown>, cache: ToolCache): Promise<{
27
+ annotations: Map<string, EdgeAnnotation>;
28
+ specs: Map<string, ResolvedToolSpec>;
29
+ }>;
30
+ //# sourceMappingURL=annotate-connections.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"annotate-connections.d.ts","sourceRoot":"","sources":["../../src/commands/annotate-connections.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,yCAAyC,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAK3D,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,IAAI,GAAE,6BAAkC,GACvC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAItC;AAED,wBAAsB,+BAA+B,CACnD,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,KAAK,EAAE,SAAS,GACf,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAKtC;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,UAAU,CAAC;CACpB;AAED;;;;;;GAMG;AACH,wBAAsB,uCAAuC,CAC3D,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,KAAK,EAAE,SAAS,GACf,OAAO,CAAC;IACT,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IACzC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;CACtC,CAAC,CAYD"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Helper for `gxwf mermaid` / `gxwf cytoscapejs` `--annotate-connections`:
3
+ * runs the connection validator against a workflow and returns the
4
+ * `EdgeAnnotation` lookup the emitters consume.
5
+ */
6
+ import { buildEdgeAnnotations, buildGetToolInfo as _buildGetToolInfo, buildWorkflowGraph, validateConnectionGraph, } from "@galaxy-tool-util/connection-validation";
7
+ import { makeNodeToolCache } from "@galaxy-tool-util/core/node";
8
+ import { buildGetToolInfo } from "./connection-validation.js";
9
+ import { isResolveError, loadCachedTool } from "./resolve-tool.js";
10
+ export async function resolveEdgeAnnotations(data, opts = {}) {
11
+ const cache = makeNodeToolCache({ cacheDir: opts.cacheDir });
12
+ await cache.index.load();
13
+ return resolveEdgeAnnotationsWithCache(data, cache);
14
+ }
15
+ export async function resolveEdgeAnnotationsWithCache(data, cache) {
16
+ const getToolInfo = await buildGetToolInfo(data, cache);
17
+ const graph = buildWorkflowGraph(data, getToolInfo);
18
+ const [report] = validateConnectionGraph(graph);
19
+ return buildEdgeAnnotations(report);
20
+ }
21
+ /**
22
+ * Variant of `resolveEdgeAnnotationsWithCache` that also returns the
23
+ * `ParsedTool` specs the validator consumed, keyed by `toolId@toolVersion`.
24
+ * The hybrid `gxwf-web` edge-annotations response uses this so co-resident
25
+ * browsers can write the specs into IndexedDB and warm the client-side
26
+ * `useToolInfoService` for free.
27
+ */
28
+ export async function resolveEdgeAnnotationsAndSpecsWithCache(data, cache) {
29
+ const specs = new Map();
30
+ const getToolInfo = await _buildGetToolInfo(data, async (id, version) => {
31
+ const r = await loadCachedTool(cache, id, version);
32
+ if (isResolveError(r))
33
+ return null;
34
+ const ver = r.tool.version ?? version ?? "";
35
+ specs.set(`${id}@${ver}`, { tool_id: id, tool_version: ver, parsed: r.tool });
36
+ return r.tool;
37
+ });
38
+ const graph = buildWorkflowGraph(data, getToolInfo);
39
+ const [report] = validateConnectionGraph(graph);
40
+ return { annotations: buildEdgeAnnotations(report), specs };
41
+ }
42
+ //# sourceMappingURL=annotate-connections.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"annotate-connections.js","sourceRoot":"","sources":["../../src/commands/annotate-connections.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,oBAAoB,EACpB,gBAAgB,IAAI,iBAAiB,EACrC,kBAAkB,EAClB,uBAAuB,GAExB,MAAM,yCAAyC,CAAC;AAEjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAGhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAMnE,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,IAA6B,EAC7B,OAAsC,EAAE;IAExC,MAAM,KAAK,GAAG,iBAAiB,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC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,CAAC,CAAC;IACpD,MAAM,CAAC,MAAM,CAAC,GAAG,uBAAuB,CAAC,KAAK,CAAC,CAAC;IAChD,OAAO,EAAE,WAAW,EAAE,oBAAoB,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;AAC9D,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * CLI integration for connection validation.
3
+ *
4
+ * Walks a workflow dict to collect every tool reference (recursing into
5
+ * subworkflows), preloads each tool from the cache, and runs
6
+ * `validateConnectionsReport`. The connection validator wants a sync
7
+ * `GetToolInfo` lookup, so async cache fetches happen up front.
8
+ *
9
+ * The walker + preloader live in `@galaxy-tool-util/connection-validation`
10
+ * (`collectToolRefs`, `buildGetToolInfo`); this module is a thin wrapper that
11
+ * adapts the CLI's on-disk `ToolCache` to the lifted helper's `AsyncToolFetcher`.
12
+ */
13
+ import { collectToolRefs, type GetToolInfo } from "@galaxy-tool-util/connection-validation";
14
+ import type { ToolCache } from "@galaxy-tool-util/core";
15
+ import type { ConnectionValidationReport } from "@galaxy-tool-util/schema";
16
+ export { collectToolRefs };
17
+ export type { ToolRef } from "@galaxy-tool-util/connection-validation";
18
+ export declare function buildConnectionReport(data: Record<string, unknown>, cache: ToolCache): Promise<ConnectionValidationReport>;
19
+ export declare function buildGetToolInfo(data: Record<string, unknown>, cache: ToolCache): Promise<GetToolInfo>;
20
+ //# sourceMappingURL=connection-validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection-validation.d.ts","sourceRoot":"","sources":["../../src/commands/connection-validation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAEL,eAAe,EAEf,KAAK,WAAW,EACjB,MAAM,yCAAyC,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAI3E,OAAO,EAAE,eAAe,EAAE,CAAC;AAC3B,YAAY,EAAE,OAAO,EAAE,MAAM,yCAAyC,CAAC;AAEvE,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,KAAK,EAAE,SAAS,GACf,OAAO,CAAC,0BAA0B,CAAC,CAGrC;AAED,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,KAAK,EAAE,SAAS,GACf,OAAO,CAAC,WAAW,CAAC,CAKtB"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * CLI integration for connection validation.
3
+ *
4
+ * Walks a workflow dict to collect every tool reference (recursing into
5
+ * subworkflows), preloads each tool from the cache, and runs
6
+ * `validateConnectionsReport`. The connection validator wants a sync
7
+ * `GetToolInfo` lookup, so async cache fetches happen up front.
8
+ *
9
+ * The walker + preloader live in `@galaxy-tool-util/connection-validation`
10
+ * (`collectToolRefs`, `buildGetToolInfo`); this module is a thin wrapper that
11
+ * adapts the CLI's on-disk `ToolCache` to the lifted helper's `AsyncToolFetcher`.
12
+ */
13
+ import { buildGetToolInfo as _buildGetToolInfo, collectToolRefs, validateConnectionsReport, } from "@galaxy-tool-util/connection-validation";
14
+ import { isResolveError, loadCachedTool } from "./resolve-tool.js";
15
+ export { collectToolRefs };
16
+ export async function buildConnectionReport(data, cache) {
17
+ const getToolInfo = await buildGetToolInfo(data, cache);
18
+ return validateConnectionsReport(data, getToolInfo);
19
+ }
20
+ export async function buildGetToolInfo(data, cache) {
21
+ return _buildGetToolInfo(data, async (id, version) => {
22
+ const r = await loadCachedTool(cache, id, version);
23
+ return isResolveError(r) ? null : r.tool;
24
+ });
25
+ }
26
+ //# sourceMappingURL=connection-validation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection-validation.js","sourceRoot":"","sources":["../../src/commands/connection-validation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACL,gBAAgB,IAAI,iBAAiB,EACrC,eAAe,EACf,yBAAyB,GAE1B,MAAM,yCAAyC,CAAC;AAIjD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,EAAE,eAAe,EAAE,CAAC;AAG3B,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,IAA6B,EAC7B,KAAgB;IAEhB,MAAM,WAAW,GAAG,MAAM,gBAAgB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACxD,OAAO,yBAAyB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;AACtD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,IAA6B,EAC7B,KAAgB;IAEhB,OAAO,iBAAiB,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE;QACnD,MAAM,CAAC,GAAG,MAAM,cAAc,CAAC,KAAK,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;QACnD,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC3C,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const CYTOSCAPE_HTML_TEMPLATE = "<!doctype html>\n\n<html>\n\n<head>\n <title>Galaxy Workflow</title>\n <script src=\"https://unpkg.com/cytoscape@3.33.2/dist/cytoscape.min.js\"></script>\n <script src=\"https://unpkg.com/dagre@0.8.5/dist/dagre.min.js\"></script>\n <script src=\"https://unpkg.com/cytoscape-dagre@2.5.0/cytoscape-dagre.js\"></script>\n <script src=\"https://unpkg.com/@popperjs/core@2.11.8/dist/umd/popper.min.js\"></script>\n <script src=\"https://unpkg.com/cytoscape-popper@2.0.0/cytoscape-popper.js\"></script>\n <script src=\"https://unpkg.com/tippy.js@6.3.7/dist/tippy.umd.min.js\"></script>\n <link rel=\"stylesheet\" href=\"https://unpkg.com/tippy.js@6.3.7/dist/tippy.css\" />\n <script>\ndocument.addEventListener(\"DOMContentLoaded\", function() {\n var requestedLayout = $layout;\n var dagreReady = (typeof cytoscapeDagre !== 'undefined');\n if (dagreReady && cytoscape.use) {\n try { cytoscape.use(cytoscapeDagre); } catch (e) { /* already registered */ }\n }\n var layoutConfig = (function(name) {\n if (name === 'dagre') {\n return dagreReady\n ? { name: 'dagre', rankDir: 'LR', nodeSep: 40, rankSep: 80 }\n : { name: 'preset' };\n }\n if (name === 'breadthfirst') return { name: 'breadthfirst', directed: true, spacingFactor: 1.2 };\n if (name === 'grid') return { name: 'grid' };\n if (name === 'cose') return { name: 'cose' };\n if (name === 'random') return { name: 'random' };\n if (name === 'topological') return { name: 'preset' };\n return { name: 'preset' };\n })(requestedLayout);\n var cy = cytoscape({\n container: document.getElementById('cy'),\n elements: $elements,\n layout: layoutConfig,\n // so we can see the ids\n style: [\n {\n selector: 'node',\n style: {\n 'label': 'data(label)'\n }\n },\n {\n selector: 'edge',\n style: {\n 'curve-style': 'bezier',\n 'target-arrow-shape': 'vee',\n 'arrow-scale': 2\n }\n },\n {\n selector: \".input\",\n style: {\n shape: 'diamond',\n 'background-color': '#d0bb46'\n }\n },\n {\n selector: \".runnable\",\n style: {\n shape: 'round-rectangle',\n 'background-color': '#2c3143'\n }\n },\n {\n selector: 'edge.mapover_1',\n style: { width: 4, 'line-color': '#5a8' }\n },\n {\n selector: 'edge.mapover_2',\n style: { width: 6, 'line-color': '#5a8' }\n },\n {\n selector: 'edge.mapover_3',\n style: { width: 8, 'line-color': '#5a8' }\n },\n {\n selector: 'edge.reduction',\n style: {\n 'line-style': 'dashed',\n 'line-color': '#a55',\n 'target-arrow-shape': 'tee',\n 'target-arrow-color': '#a55'\n }\n }\n ]\n });\n\n function makePopper(ele) {\n let ref = ele.popperRef(); // used only for positioning\n let dummyDomEle = document.createElement('div');\n\n ele.tippy = tippy(dummyDomEle, { // tippy options:\n getReferenceClientRect: ref.getBoundingClientRect.bind(ref),\n content: function() {\n let content = document.createElement('div');\n\n let innerHTML = '';\n if(ele.isNode()) {\n let stepType = ele.data(\"step_type\");\n innerHTML += \"<p><i>Step Type:</i> \" + stepType + \"</p>\";\n let toolId = ele.data(\"tool_id\");\n if (toolId) {\n innerHTML += \"<p><i>ToolID:</i> \" + toolId + \"</p>\";\n }\n let repoLink = ele.data(\"repo_link\");\n if (repoLink) {\n innerHTML += \"<a href=\" + repoLink + '\">Visit Tool Shed Repository</a>';\n }\n let doc = ele.data('doc');\n if (doc) {\n innerHTML += \"<p>\" + doc + \"</p>\";\n }\n } else {\n let output = ele.data(\"output\");\n let input = ele.data(\"input\");\n if(output) {\n innerHTML += \"Output named \" + output + \" connects to \" + input;\n } else {\n innerHTML += \"Connected to input \" + input;\n }\n let mapDepth = ele.data(\"map_depth\");\n if (mapDepth) {\n let mapping = ele.data(\"mapping\");\n innerHTML += \"<p><i>Map depth:</i> \" + mapDepth + (mapping ? \" (\" + mapping + \")\" : \"\") + \"</p>\";\n }\n if (ele.data(\"reduction\")) {\n innerHTML += \"<p><i>Reduction:</i> list \u2192 multi-data</p>\";\n }\n }\n content.innerHTML = innerHTML;\n\n return content;\n },\n delay: [0,1000],\n interactive: true,\n placement: 'bottom',\n trigger: 'manual', // probably want manual mode\n appendTo: document.body\n });\n }\n\n cy.ready(function() {\n cy.elements().forEach(function(ele) {\n makePopper(ele);\n });\n });\n\n cy.elements().unbind('mouseover');\n cy.elements().bind('mouseover', function(event) { event.target.tippy.show(); });\n\n cy.elements().unbind('mouseout');\n cy.elements().bind('mouseout', function(event) { event.target.tippy.hide(); });\n // document.querySelector('#cypng').setAttribute('src', cy.png());\n});\n\n </script>\n</head>\n\n<style>\n #cy {\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0px;\n left: 0px;\n }\n a {\n color: #d0bb46\n }\n</style>\n\n<body>\n <div id=\"cy\"></div>\n</body>\n</html>\n";
2
+ //# sourceMappingURL=_template-bundled.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_template-bundled.d.ts","sourceRoot":"","sources":["../../../src/commands/cytoscapejs/_template-bundled.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,uBAAuB,s/LAmLnC,CAAC"}
@@ -0,0 +1,182 @@
1
+ // AUTO-GENERATED by scripts/bundle-templates.mjs — do not edit.
2
+ export const CYTOSCAPE_HTML_TEMPLATE = `<!doctype html>
3
+
4
+ <html>
5
+
6
+ <head>
7
+ <title>Galaxy Workflow</title>
8
+ <script src="https://unpkg.com/cytoscape@3.33.2/dist/cytoscape.min.js"></script>
9
+ <script src="https://unpkg.com/dagre@0.8.5/dist/dagre.min.js"></script>
10
+ <script src="https://unpkg.com/cytoscape-dagre@2.5.0/cytoscape-dagre.js"></script>
11
+ <script src="https://unpkg.com/@popperjs/core@2.11.8/dist/umd/popper.min.js"></script>
12
+ <script src="https://unpkg.com/cytoscape-popper@2.0.0/cytoscape-popper.js"></script>
13
+ <script src="https://unpkg.com/tippy.js@6.3.7/dist/tippy.umd.min.js"></script>
14
+ <link rel="stylesheet" href="https://unpkg.com/tippy.js@6.3.7/dist/tippy.css" />
15
+ <script>
16
+ document.addEventListener("DOMContentLoaded", function() {
17
+ var requestedLayout = $layout;
18
+ var dagreReady = (typeof cytoscapeDagre !== 'undefined');
19
+ if (dagreReady && cytoscape.use) {
20
+ try { cytoscape.use(cytoscapeDagre); } catch (e) { /* already registered */ }
21
+ }
22
+ var layoutConfig = (function(name) {
23
+ if (name === 'dagre') {
24
+ return dagreReady
25
+ ? { name: 'dagre', rankDir: 'LR', nodeSep: 40, rankSep: 80 }
26
+ : { name: 'preset' };
27
+ }
28
+ if (name === 'breadthfirst') return { name: 'breadthfirst', directed: true, spacingFactor: 1.2 };
29
+ if (name === 'grid') return { name: 'grid' };
30
+ if (name === 'cose') return { name: 'cose' };
31
+ if (name === 'random') return { name: 'random' };
32
+ if (name === 'topological') return { name: 'preset' };
33
+ return { name: 'preset' };
34
+ })(requestedLayout);
35
+ var cy = cytoscape({
36
+ container: document.getElementById('cy'),
37
+ elements: $elements,
38
+ layout: layoutConfig,
39
+ // so we can see the ids
40
+ style: [
41
+ {
42
+ selector: 'node',
43
+ style: {
44
+ 'label': 'data(label)'
45
+ }
46
+ },
47
+ {
48
+ selector: 'edge',
49
+ style: {
50
+ 'curve-style': 'bezier',
51
+ 'target-arrow-shape': 'vee',
52
+ 'arrow-scale': 2
53
+ }
54
+ },
55
+ {
56
+ selector: ".input",
57
+ style: {
58
+ shape: 'diamond',
59
+ 'background-color': '#d0bb46'
60
+ }
61
+ },
62
+ {
63
+ selector: ".runnable",
64
+ style: {
65
+ shape: 'round-rectangle',
66
+ 'background-color': '#2c3143'
67
+ }
68
+ },
69
+ {
70
+ selector: 'edge.mapover_1',
71
+ style: { width: 4, 'line-color': '#5a8' }
72
+ },
73
+ {
74
+ selector: 'edge.mapover_2',
75
+ style: { width: 6, 'line-color': '#5a8' }
76
+ },
77
+ {
78
+ selector: 'edge.mapover_3',
79
+ style: { width: 8, 'line-color': '#5a8' }
80
+ },
81
+ {
82
+ selector: 'edge.reduction',
83
+ style: {
84
+ 'line-style': 'dashed',
85
+ 'line-color': '#a55',
86
+ 'target-arrow-shape': 'tee',
87
+ 'target-arrow-color': '#a55'
88
+ }
89
+ }
90
+ ]
91
+ });
92
+
93
+ function makePopper(ele) {
94
+ let ref = ele.popperRef(); // used only for positioning
95
+ let dummyDomEle = document.createElement('div');
96
+
97
+ ele.tippy = tippy(dummyDomEle, { // tippy options:
98
+ getReferenceClientRect: ref.getBoundingClientRect.bind(ref),
99
+ content: function() {
100
+ let content = document.createElement('div');
101
+
102
+ let innerHTML = '';
103
+ if(ele.isNode()) {
104
+ let stepType = ele.data("step_type");
105
+ innerHTML += "<p><i>Step Type:</i> " + stepType + "</p>";
106
+ let toolId = ele.data("tool_id");
107
+ if (toolId) {
108
+ innerHTML += "<p><i>ToolID:</i> " + toolId + "</p>";
109
+ }
110
+ let repoLink = ele.data("repo_link");
111
+ if (repoLink) {
112
+ innerHTML += "<a href=" + repoLink + '">Visit Tool Shed Repository</a>';
113
+ }
114
+ let doc = ele.data('doc');
115
+ if (doc) {
116
+ innerHTML += "<p>" + doc + "</p>";
117
+ }
118
+ } else {
119
+ let output = ele.data("output");
120
+ let input = ele.data("input");
121
+ if(output) {
122
+ innerHTML += "Output named " + output + " connects to " + input;
123
+ } else {
124
+ innerHTML += "Connected to input " + input;
125
+ }
126
+ let mapDepth = ele.data("map_depth");
127
+ if (mapDepth) {
128
+ let mapping = ele.data("mapping");
129
+ innerHTML += "<p><i>Map depth:</i> " + mapDepth + (mapping ? " (" + mapping + ")" : "") + "</p>";
130
+ }
131
+ if (ele.data("reduction")) {
132
+ innerHTML += "<p><i>Reduction:</i> list → multi-data</p>";
133
+ }
134
+ }
135
+ content.innerHTML = innerHTML;
136
+
137
+ return content;
138
+ },
139
+ delay: [0,1000],
140
+ interactive: true,
141
+ placement: 'bottom',
142
+ trigger: 'manual', // probably want manual mode
143
+ appendTo: document.body
144
+ });
145
+ }
146
+
147
+ cy.ready(function() {
148
+ cy.elements().forEach(function(ele) {
149
+ makePopper(ele);
150
+ });
151
+ });
152
+
153
+ cy.elements().unbind('mouseover');
154
+ cy.elements().bind('mouseover', function(event) { event.target.tippy.show(); });
155
+
156
+ cy.elements().unbind('mouseout');
157
+ cy.elements().bind('mouseout', function(event) { event.target.tippy.hide(); });
158
+ // document.querySelector('#cypng').setAttribute('src', cy.png());
159
+ });
160
+
161
+ </script>
162
+ </head>
163
+
164
+ <style>
165
+ #cy {
166
+ width: 100%;
167
+ height: 100%;
168
+ position: absolute;
169
+ top: 0px;
170
+ left: 0px;
171
+ }
172
+ a {
173
+ color: #d0bb46
174
+ }
175
+ </style>
176
+
177
+ <body>
178
+ <div id="cy"></div>
179
+ </body>
180
+ </html>
181
+ `;
182
+ //# sourceMappingURL=_template-bundled.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_template-bundled.js","sourceRoot":"","sources":["../../../src/commands/cytoscapejs/_template-bundled.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,MAAM,CAAC,MAAM,uBAAuB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmLtC,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { CytoscapeElements, LayoutName } from "@galaxy-tool-util/schema";
2
+ export interface CytoscapeJsCommandOptions {
3
+ output?: string;
4
+ html?: boolean;
5
+ json?: boolean;
6
+ annotateConnections?: boolean;
7
+ cacheDir?: string;
8
+ layout?: string;
9
+ }
10
+ export declare function renderHtml(elements: CytoscapeElements, layout?: LayoutName): string;
11
+ export declare function runCytoscapeJs(filePath: string, opts: CytoscapeJsCommandOptions): Promise<void>;
12
+ //# sourceMappingURL=cytoscapejs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cytoscapejs.d.ts","sourceRoot":"","sources":["../../src/commands/cytoscapejs.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAO9E,MAAM,WAAW,yBAAyB;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,UAAU,CAAC,QAAQ,EAAE,iBAAiB,EAAE,MAAM,GAAE,UAAqB,GAAG,MAAM,CAQ7F;AAmBD,wBAAsB,cAAc,CAClC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,yBAAyB,GAC9B,OAAO,CAAC,IAAI,CAAC,CA+Bf"}