@galaxy-tool-util/core 0.2.0 → 1.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.
Files changed (72) hide show
  1. package/README.md +33 -0
  2. package/dist/cache/cache-index.d.ts +16 -12
  3. package/dist/cache/cache-index.d.ts.map +1 -1
  4. package/dist/cache/cache-index.js +34 -55
  5. package/dist/cache/cache-index.js.map +1 -1
  6. package/dist/cache/cache-key.d.ts +2 -1
  7. package/dist/cache/cache-key.d.ts.map +1 -1
  8. package/dist/cache/cache-key.js +7 -3
  9. package/dist/cache/cache-key.js.map +1 -1
  10. package/dist/cache/index.d.ts +5 -1
  11. package/dist/cache/index.d.ts.map +1 -1
  12. package/dist/cache/index.js +3 -1
  13. package/dist/cache/index.js.map +1 -1
  14. package/dist/cache/node.d.ts +30 -0
  15. package/dist/cache/node.d.ts.map +1 -0
  16. package/dist/cache/node.js +37 -0
  17. package/dist/cache/node.js.map +1 -0
  18. package/dist/cache/storage/filesystem.d.ts +17 -0
  19. package/dist/cache/storage/filesystem.d.ts.map +1 -0
  20. package/dist/cache/storage/filesystem.js +61 -0
  21. package/dist/cache/storage/filesystem.js.map +1 -0
  22. package/dist/cache/storage/indexeddb.d.ts +21 -0
  23. package/dist/cache/storage/indexeddb.d.ts.map +1 -0
  24. package/dist/cache/storage/indexeddb.js +87 -0
  25. package/dist/cache/storage/indexeddb.js.map +1 -0
  26. package/dist/cache/storage/interface.d.ts +17 -0
  27. package/dist/cache/storage/interface.d.ts.map +1 -0
  28. package/dist/cache/storage/interface.js +2 -0
  29. package/dist/cache/storage/interface.js.map +1 -0
  30. package/dist/cache/tool-cache-defaults.d.ts +7 -0
  31. package/dist/cache/tool-cache-defaults.d.ts.map +1 -0
  32. package/dist/cache/tool-cache-defaults.js +7 -0
  33. package/dist/cache/tool-cache-defaults.js.map +1 -0
  34. package/dist/cache/tool-cache.d.ts +16 -21
  35. package/dist/cache/tool-cache.d.ts.map +1 -1
  36. package/dist/cache/tool-cache.js +33 -47
  37. package/dist/cache/tool-cache.js.map +1 -1
  38. package/dist/client/index.d.ts +2 -0
  39. package/dist/client/index.d.ts.map +1 -1
  40. package/dist/client/index.js +1 -0
  41. package/dist/client/index.js.map +1 -1
  42. package/dist/client/toolshed.d.ts +1 -1
  43. package/dist/client/toolshed.js +1 -1
  44. package/dist/client/trs.d.ts +32 -0
  45. package/dist/client/trs.d.ts.map +1 -0
  46. package/dist/client/trs.js +66 -0
  47. package/dist/client/trs.js.map +1 -0
  48. package/dist/config-node.d.ts +7 -0
  49. package/dist/config-node.d.ts.map +1 -0
  50. package/dist/config-node.js +14 -0
  51. package/dist/config-node.js.map +1 -0
  52. package/dist/config.d.ts +75 -0
  53. package/dist/config.d.ts.map +1 -0
  54. package/dist/config.js +60 -0
  55. package/dist/config.js.map +1 -0
  56. package/dist/index.d.ts +14 -9
  57. package/dist/index.d.ts.map +1 -1
  58. package/dist/index.js +11 -8
  59. package/dist/index.js.map +1 -1
  60. package/dist/node.d.ts +12 -0
  61. package/dist/node.d.ts.map +1 -0
  62. package/dist/node.js +11 -0
  63. package/dist/node.js.map +1 -0
  64. package/dist/tool-info.d.ts +10 -3
  65. package/dist/tool-info.d.ts.map +1 -1
  66. package/dist/tool-info.js +34 -16
  67. package/dist/tool-info.js.map +1 -1
  68. package/package.json +18 -6
  69. package/dist/models/parsed-tool.d.ts +0 -46
  70. package/dist/models/parsed-tool.d.ts.map +0 -1
  71. package/dist/models/parsed-tool.js +0 -41
  72. package/dist/models/parsed-tool.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,11 +1,10 @@
1
1
  /**
2
2
  * @module @galaxy-tool-util/core
3
3
  *
4
- * Galaxy tool cache, ToolShed/Galaxy API client, and ParsedTool model.
5
- * Handles fetching tool metadata from remote sources and caching locally.
4
+ * Universal entry safe to import in Node or browser. Symbols that require
5
+ * Node built-ins (filesystem cache storage, YAML config loading) live under
6
+ * `@galaxy-tool-util/core/node`.
6
7
  */
7
- /** Effect Schema for parsed tool metadata (id, version, name, inputs, outputs, etc.). */
8
- export { ParsedTool, HelpContent, XrefDict, Citation } from "./models/parsed-tool.js";
9
8
  export {
10
9
  /** Parse a full ToolShed tool ID into ToolCoordinates (toolshedUrl, trsToolId, version). */
11
10
  parseToolshedToolId,
@@ -15,14 +14,20 @@ toolIdFromTrs,
15
14
  cacheKey,
16
15
  /** Cache metadata index — tracks tool IDs, versions, sources, and timestamps. */
17
16
  CacheIndex,
18
- /** Two-layer cache (memory + filesystem) for parsed tool metadata. */
19
- ToolCache,
20
- /** Resolve cache directory from explicit override, env var, or default. */
21
- getCacheDir, DEFAULT_CACHE_DIR, CACHE_DIR_ENV_VAR, DEFAULT_TOOLSHED_URL, TOOLSHED_URL_ENV_VAR, } from "./cache/index.js";
22
- export type { ToolCoordinates, CacheIndexEntry, CacheIndexData } from "./cache/index.js";
17
+ /** Two-layer cache (memory + storage) for parsed tool metadata. */
18
+ ToolCache, DEFAULT_TOOLSHED_URL, TOOLSHED_URL_ENV_VAR, } from "./cache/index.js";
19
+ export type { ToolCoordinates, CacheIndexEntry, CacheIndexData, CacheStorage, ResolvedCoordinates, } from "./cache/index.js";
20
+ /** IndexedDB-backed cache storage for browser/Web Worker contexts. */
21
+ export { IndexedDBCacheStorage } from "./cache/index.js";
23
22
  /** Fetch parsed tool metadata from a ToolShed instance via TRS API. */
24
23
  export { fetchFromToolShed, fetchFromGalaxy, ToolFetchError } from "./client/index.js";
24
+ /** Query TRS for the set of versions published for a tool. */
25
+ export { getTRSToolVersions, getLatestTRSToolVersion } from "./client/index.js";
26
+ export type { TRSToolVersion } from "./client/index.js";
25
27
  /** High-level service: fetch tools from multiple sources with automatic caching. */
26
28
  export { ToolInfoService } from "./tool-info.js";
27
29
  export type { ToolInfoOptions, ToolSource } from "./tool-info.js";
30
+ /** Shared YAML config schema for tool sources and cache settings. */
31
+ export { WorkflowToolConfig, ToolSourceConfig, ToolCacheConfig, toolInfoOptionsFromConfig, } from "./config.js";
32
+ export type { ConfigToolInfoOptions } from "./config.js";
28
33
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,yFAAyF;AACzF,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACtF,OAAO;AACL,4FAA4F;AAC5F,mBAAmB;AACnB,oEAAoE;AACpE,aAAa;AACb,sFAAsF;AACtF,QAAQ;AACR,iFAAiF;AACjF,UAAU;AACV,sEAAsE;AACtE,SAAS;AACT,2EAA2E;AAC3E,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACzF,uEAAuE;AACvE,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACvF,oFAAoF;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,YAAY,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO;AACL,4FAA4F;AAC5F,mBAAmB;AACnB,oEAAoE;AACpE,aAAa;AACb,sFAAsF;AACtF,QAAQ;AACR,iFAAiF;AACjF,UAAU;AACV,mEAAmE;AACnE,SAAS,EACT,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,eAAe,EACf,eAAe,EACf,cAAc,EACd,YAAY,EACZ,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAC1B,sEAAsE;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,uEAAuE;AACvE,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACvF,8DAA8D;AAC9D,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAChF,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,oFAAoF;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,YAAY,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAClE,qEAAqE;AACrE,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,yBAAyB,GAC1B,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC"}
package/dist/index.js CHANGED
@@ -1,11 +1,10 @@
1
1
  /**
2
2
  * @module @galaxy-tool-util/core
3
3
  *
4
- * Galaxy tool cache, ToolShed/Galaxy API client, and ParsedTool model.
5
- * Handles fetching tool metadata from remote sources and caching locally.
4
+ * Universal entry safe to import in Node or browser. Symbols that require
5
+ * Node built-ins (filesystem cache storage, YAML config loading) live under
6
+ * `@galaxy-tool-util/core/node`.
6
7
  */
7
- /** Effect Schema for parsed tool metadata (id, version, name, inputs, outputs, etc.). */
8
- export { ParsedTool, HelpContent, XrefDict, Citation } from "./models/parsed-tool.js";
9
8
  export {
10
9
  /** Parse a full ToolShed tool ID into ToolCoordinates (toolshedUrl, trsToolId, version). */
11
10
  parseToolshedToolId,
@@ -15,12 +14,16 @@ toolIdFromTrs,
15
14
  cacheKey,
16
15
  /** Cache metadata index — tracks tool IDs, versions, sources, and timestamps. */
17
16
  CacheIndex,
18
- /** Two-layer cache (memory + filesystem) for parsed tool metadata. */
19
- ToolCache,
20
- /** Resolve cache directory from explicit override, env var, or default. */
21
- getCacheDir, DEFAULT_CACHE_DIR, CACHE_DIR_ENV_VAR, DEFAULT_TOOLSHED_URL, TOOLSHED_URL_ENV_VAR, } from "./cache/index.js";
17
+ /** Two-layer cache (memory + storage) for parsed tool metadata. */
18
+ ToolCache, DEFAULT_TOOLSHED_URL, TOOLSHED_URL_ENV_VAR, } from "./cache/index.js";
19
+ /** IndexedDB-backed cache storage for browser/Web Worker contexts. */
20
+ export { IndexedDBCacheStorage } from "./cache/index.js";
22
21
  /** Fetch parsed tool metadata from a ToolShed instance via TRS API. */
23
22
  export { fetchFromToolShed, fetchFromGalaxy, ToolFetchError } from "./client/index.js";
23
+ /** Query TRS for the set of versions published for a tool. */
24
+ export { getTRSToolVersions, getLatestTRSToolVersion } from "./client/index.js";
24
25
  /** High-level service: fetch tools from multiple sources with automatic caching. */
25
26
  export { ToolInfoService } from "./tool-info.js";
27
+ /** Shared YAML config schema for tool sources and cache settings. */
28
+ export { WorkflowToolConfig, ToolSourceConfig, ToolCacheConfig, toolInfoOptionsFromConfig, } from "./config.js";
26
29
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,yFAAyF;AACzF,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACtF,OAAO;AACL,4FAA4F;AAC5F,mBAAmB;AACnB,oEAAoE;AACpE,aAAa;AACb,sFAAsF;AACtF,QAAQ;AACR,iFAAiF;AACjF,UAAU;AACV,sEAAsE;AACtE,SAAS;AACT,2EAA2E;AAC3E,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,kBAAkB,CAAC;AAE1B,uEAAuE;AACvE,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACvF,oFAAoF;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO;AACL,4FAA4F;AAC5F,mBAAmB;AACnB,oEAAoE;AACpE,aAAa;AACb,sFAAsF;AACtF,QAAQ;AACR,iFAAiF;AACjF,UAAU;AACV,mEAAmE;AACnE,SAAS,EACT,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,kBAAkB,CAAC;AAQ1B,sEAAsE;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,uEAAuE;AACvE,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACvF,8DAA8D;AAC9D,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAEhF,oFAAoF;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,qEAAqE;AACrE,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,yBAAyB,GAC1B,MAAM,aAAa,CAAC"}
package/dist/node.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @module @galaxy-tool-util/core/node
3
+ *
4
+ * Node-only surface: filesystem cache storage, YAML config loading, and
5
+ * helpers that assume Node built-ins (`fs`, `path`, `os`, `process.env`).
6
+ *
7
+ * Browser/Web Worker code should import from `@galaxy-tool-util/core` instead.
8
+ */
9
+ export { FilesystemCacheStorage, DEFAULT_CACHE_DIR, CACHE_DIR_ENV_VAR, getCacheDir, makeNodeToolCache, makeNodeToolInfoService, } from "./cache/node.js";
10
+ export type { NodeToolCacheOptions, NodeToolInfoOptions } from "./cache/node.js";
11
+ export { loadWorkflowToolConfig } from "./config-node.js";
12
+ //# sourceMappingURL=node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC"}
package/dist/node.js ADDED
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @module @galaxy-tool-util/core/node
3
+ *
4
+ * Node-only surface: filesystem cache storage, YAML config loading, and
5
+ * helpers that assume Node built-ins (`fs`, `path`, `os`, `process.env`).
6
+ *
7
+ * Browser/Web Worker code should import from `@galaxy-tool-util/core` instead.
8
+ */
9
+ export { FilesystemCacheStorage, DEFAULT_CACHE_DIR, CACHE_DIR_ENV_VAR, getCacheDir, makeNodeToolCache, makeNodeToolInfoService, } from "./cache/node.js";
10
+ export { loadWorkflowToolConfig } from "./config-node.js";
11
+ //# sourceMappingURL=node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.js","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC"}
@@ -1,5 +1,6 @@
1
- import type { ParsedTool } from "./models/parsed-tool.js";
1
+ import type { ParsedTool } from "@galaxy-tool-util/schema";
2
2
  import { ToolCache } from "./cache/tool-cache.js";
3
+ import type { CacheStorage } from "./cache/storage/interface.js";
3
4
  /** A remote source for fetching tool metadata. */
4
5
  export interface ToolSource {
5
6
  type: "toolshed" | "galaxy";
@@ -7,7 +8,8 @@ export interface ToolSource {
7
8
  }
8
9
  /** Options for constructing a {@link ToolInfoService}. */
9
10
  export interface ToolInfoOptions {
10
- cacheDir?: string;
11
+ /** Cache storage backend — FilesystemCacheStorage (Node) or IndexedDBCacheStorage (browser). */
12
+ storage: CacheStorage;
11
13
  defaultToolshedUrl?: string;
12
14
  /** Multiple sources tried in order. If provided, overrides defaultToolshedUrl/galaxyUrl. */
13
15
  sources?: ToolSource[];
@@ -23,8 +25,13 @@ export declare class ToolInfoService {
23
25
  readonly cache: ToolCache;
24
26
  private readonly sources;
25
27
  private readonly fetcher;
26
- constructor(opts?: ToolInfoOptions);
28
+ constructor(opts: ToolInfoOptions);
27
29
  getToolInfo(toolId: string, toolVersion?: string | null): Promise<ParsedTool | null>;
30
+ /**
31
+ * Resolve the latest TRS version for a tool on a Tool Shed. Returns `null`
32
+ * if the tool is unknown to the shed or has no published versions.
33
+ */
34
+ private resolveLatestVersion;
28
35
  addTool(toolId: string, toolVersion: string, parsedTool: ParsedTool, source?: string, sourceUrl?: string): Promise<string>;
29
36
  }
30
37
  //# sourceMappingURL=tool-info.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tool-info.d.ts","sourceRoot":"","sources":["../src/tool-info.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAIlD,kDAAkD;AAClD,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,UAAU,GAAG,QAAQ,CAAC;IAC5B,GAAG,EAAE,MAAM,CAAC;CACb;AAED,0DAA0D;AAC1D,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,4FAA4F;IAC5F,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;IACvB,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,KAAK,CAAC;CACxB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,CAAC,OAAO,CAAe;IACvC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAe;gBAE3B,IAAI,EAAE,eAAe;IAsB3B,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IAyD1F;;;OAGG;YACW,oBAAoB;IAa5B,OAAO,CACX,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,UAAU,EACtB,MAAM,GAAE,MAAgB,EACxB,SAAS,GAAE,MAAW,GACrB,OAAO,CAAC,MAAM,CAAC;CAOnB"}
package/dist/tool-info.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { ToolCache } from "./cache/tool-cache.js";
2
2
  import { cacheKey } from "./cache/cache-key.js";
3
3
  import { fetchFromToolShed, fetchFromGalaxy } from "./client/toolshed.js";
4
+ import { getLatestTRSToolVersion } from "./client/trs.js";
4
5
  /**
5
6
  * High-level service for fetching Galaxy tool metadata with automatic caching.
6
7
  * Tries configured sources in order and caches on first successful fetch.
@@ -11,33 +12,36 @@ export class ToolInfoService {
11
12
  fetcher;
12
13
  constructor(opts) {
13
14
  this.cache = new ToolCache({
14
- cacheDir: opts?.cacheDir,
15
- defaultToolshedUrl: opts?.defaultToolshedUrl,
15
+ storage: opts.storage,
16
+ defaultToolshedUrl: opts.defaultToolshedUrl,
16
17
  });
17
- this.fetcher = opts?.fetcher ?? globalThis.fetch;
18
- if (opts?.sources && opts.sources.length > 0) {
18
+ this.fetcher = opts.fetcher ?? globalThis.fetch;
19
+ if (opts.sources && opts.sources.length > 0) {
19
20
  this.sources = opts.sources;
20
21
  }
21
22
  else {
22
- // Build sources from legacy options
23
23
  this.sources = [
24
24
  {
25
25
  type: "toolshed",
26
- url: opts?.defaultToolshedUrl ?? this.cache.defaultToolshedUrl,
26
+ url: opts.defaultToolshedUrl ?? this.cache.defaultToolshedUrl,
27
27
  },
28
28
  ];
29
- if (opts?.galaxyUrl) {
29
+ if (opts.galaxyUrl) {
30
30
  this.sources.push({ type: "galaxy", url: opts.galaxyUrl });
31
31
  }
32
32
  }
33
33
  }
34
34
  async getToolInfo(toolId, toolVersion) {
35
35
  const coords = this.cache.resolveToolCoordinates(toolId, toolVersion);
36
- if (coords.version === null) {
37
- throw new Error(`No version available for tool: ${toolId}`);
36
+ let resolvedVersion = coords.version;
37
+ if (resolvedVersion === null) {
38
+ resolvedVersion = await this.resolveLatestVersion(coords.toolshedUrl, coords.trsToolId);
39
+ if (resolvedVersion === null) {
40
+ throw new Error(`No version available for tool: ${toolId}`);
41
+ }
38
42
  }
39
- const key = cacheKey(coords.toolshedUrl, coords.trsToolId, coords.version);
40
- // Check filesystem cache (ToolCache checks memory first internally)
43
+ const key = await cacheKey(coords.toolshedUrl, coords.trsToolId, resolvedVersion);
44
+ // Check storage cache (ToolCache checks memory first internally)
41
45
  const cached = await this.cache.loadCached(key);
42
46
  if (cached !== null)
43
47
  return cached;
@@ -48,16 +52,16 @@ export class ToolInfoService {
48
52
  let sourceLabel;
49
53
  let sourceUrl;
50
54
  if (source.type === "toolshed") {
51
- parsedTool = await fetchFromToolShed(source.url, coords.trsToolId, coords.version, this.fetcher);
55
+ parsedTool = await fetchFromToolShed(source.url, coords.trsToolId, resolvedVersion, this.fetcher);
52
56
  sourceLabel = "api";
53
- sourceUrl = `${source.url}/api/tools/${coords.trsToolId}/versions/${coords.version}`;
57
+ sourceUrl = `${source.url}/api/tools/${coords.trsToolId}/versions/${resolvedVersion}`;
54
58
  }
55
59
  else {
56
- parsedTool = await fetchFromGalaxy(source.url, toolId, toolVersion, this.fetcher);
60
+ parsedTool = await fetchFromGalaxy(source.url, toolId, resolvedVersion, this.fetcher);
57
61
  sourceLabel = "galaxy";
58
62
  sourceUrl = `${source.url}/api/tools/${encodeURIComponent(toolId)}/parsed`;
59
63
  }
60
- await this.cache.saveTool(key, parsedTool, coords.readableId, coords.version, sourceLabel, sourceUrl);
64
+ await this.cache.saveTool(key, parsedTool, coords.readableId, resolvedVersion, sourceLabel, sourceUrl);
61
65
  return parsedTool;
62
66
  }
63
67
  catch (err) {
@@ -67,10 +71,24 @@ export class ToolInfoService {
67
71
  }
68
72
  return null;
69
73
  }
74
+ /**
75
+ * Resolve the latest TRS version for a tool on a Tool Shed. Returns `null`
76
+ * if the tool is unknown to the shed or has no published versions.
77
+ */
78
+ async resolveLatestVersion(toolshedUrl, trsToolId) {
79
+ try {
80
+ return await getLatestTRSToolVersion(toolshedUrl, trsToolId, this.fetcher);
81
+ }
82
+ catch (err) {
83
+ const msg = err instanceof Error ? err.message : String(err);
84
+ console.debug(`TRS latest-version lookup failed for ${trsToolId} on ${toolshedUrl}: ${msg}`);
85
+ return null;
86
+ }
87
+ }
70
88
  async addTool(toolId, toolVersion, parsedTool, source = "local", sourceUrl = "") {
71
89
  const coords = this.cache.resolveToolCoordinates(toolId, toolVersion);
72
90
  const version = coords.version ?? toolVersion;
73
- const key = cacheKey(coords.toolshedUrl, coords.trsToolId, version);
91
+ const key = await cacheKey(coords.toolshedUrl, coords.trsToolId, version);
74
92
  await this.cache.saveTool(key, parsedTool, coords.readableId, version, source, sourceUrl);
75
93
  return key;
76
94
  }
@@ -1 +1 @@
1
- {"version":3,"file":"tool-info.js","sourceRoot":"","sources":["../src/tool-info.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAmB1E;;;GAGG;AACH,MAAM,OAAO,eAAe;IACjB,KAAK,CAAY;IACT,OAAO,CAAe;IACtB,OAAO,CAAe;IAEvC,YAAY,IAAsB;QAChC,IAAI,CAAC,KAAK,GAAG,IAAI,SAAS,CAAC;YACzB,QAAQ,EAAE,IAAI,EAAE,QAAQ;YACxB,kBAAkB,EAAE,IA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QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;OAGG;IACK,KAAK,CAAC,oBAAoB,CAChC,WAAmB,EACnB,SAAiB;QAEjB,IAAI,CAAC;YACH,OAAO,MAAM,uBAAuB,CAAC,WAAW,EAAE,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7E,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAC7D,OAAO,CAAC,KAAK,CAAC,wCAAwC,SAAS,OAAO,WAAW,KAAK,GAAG,EAAE,CAAC,CAAC;YAC7F,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,KAAK,CAAC,OAAO,CACX,MAAc,EACd,WAAmB,EACnB,UAAsB,EACtB,SAAiB,OAAO,EACxB,YAAoB,EAAE;QAEtB,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,sBAAsB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QACtE,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,WAAW,CAAC;QAC9C,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAC1E,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;QAC1F,OAAO,GAAG,CAAC;IACb,CAAC;CACF"}
package/package.json CHANGED
@@ -1,13 +1,20 @@
1
1
  {
2
2
  "name": "@galaxy-tool-util/core",
3
- "version": "0.2.0",
3
+ "version": "1.0.0",
4
4
  "description": "Galaxy tool cache, ToolShed client, and ParsedTool models",
5
5
  "type": "module",
6
+ "sideEffects": false,
6
7
  "exports": {
7
8
  ".": {
8
9
  "types": "./dist/index.d.ts",
10
+ "browser": "./dist/index.js",
9
11
  "import": "./dist/index.js"
10
- }
12
+ },
13
+ "./node": {
14
+ "types": "./dist/node.d.ts",
15
+ "import": "./dist/node.js"
16
+ },
17
+ "./package.json": "./package.json"
11
18
  },
12
19
  "files": [
13
20
  "dist",
@@ -25,11 +32,12 @@
25
32
  },
26
33
  "license": "MIT",
27
34
  "devDependencies": {
28
- "@types/node": "^25.5.0",
29
- "yaml": "^2.8.3"
35
+ "@types/node": "^25.5.0"
30
36
  },
31
37
  "dependencies": {
32
- "effect": "^3.21.0"
38
+ "effect": "^3.21.0",
39
+ "yaml": "^2.8.3",
40
+ "@galaxy-tool-util/schema": "1.0.0"
33
41
  },
34
42
  "scripts": {
35
43
  "build": "tsc",
@@ -38,6 +46,10 @@
38
46
  "test:watch": "vitest",
39
47
  "lint": "eslint src/ test/",
40
48
  "format": "prettier --check 'src/**/*.ts' 'test/**/*.ts'",
41
- "format-fix": "prettier --write 'src/**/*.ts' 'test/**/*.ts'"
49
+ "format-fix": "prettier --write 'src/**/*.ts' 'test/**/*.ts'",
50
+ "lint:pkg": "publint",
51
+ "check:types": "attw --pack . --profile esm-only",
52
+ "check:browser": "node scripts/verify-browser-entry.mjs",
53
+ "test:browser": "vitest run --config vitest.browser.config.ts"
42
54
  }
43
55
  }
@@ -1,46 +0,0 @@
1
- import * as S from "effect/Schema";
2
- /** Tool help content with format (rst, markdown, etc.) and rendered content. */
3
- export declare const HelpContent: S.Struct<{
4
- format: typeof S.String;
5
- content: typeof S.String;
6
- }>;
7
- /** External reference (e.g. bio.tools ID, bioconductor package). */
8
- export declare const XrefDict: S.Struct<{
9
- value: typeof S.String;
10
- type: typeof S.String;
11
- }>;
12
- /** Tool citation entry (bibtex, doi, etc.). */
13
- export declare const Citation: S.Struct<{
14
- type: typeof S.String;
15
- content: typeof S.String;
16
- }>;
17
- /**
18
- * Effect Schema for parsed Galaxy tool metadata as returned by the ToolShed TRS API
19
- * or Galaxy's /api/tools/:id/parsed endpoint.
20
- */
21
- export declare const ParsedTool: S.Struct<{
22
- id: typeof S.String;
23
- version: S.NullOr<typeof S.String>;
24
- name: typeof S.String;
25
- description: S.transform<S.NullOr<typeof S.String>, S.NullOr<typeof S.String>>;
26
- inputs: S.Array$<typeof S.Unknown>;
27
- outputs: S.Array$<typeof S.Unknown>;
28
- citations: S.Array$<S.Struct<{
29
- type: typeof S.String;
30
- content: typeof S.String;
31
- }>>;
32
- license: S.NullOr<typeof S.String>;
33
- profile: S.NullOr<typeof S.String>;
34
- edam_operations: S.Array$<typeof S.String>;
35
- edam_topics: S.Array$<typeof S.String>;
36
- xrefs: S.Array$<S.Struct<{
37
- value: typeof S.String;
38
- type: typeof S.String;
39
- }>>;
40
- help: S.optional<S.Union<[S.Struct<{
41
- format: typeof S.String;
42
- content: typeof S.String;
43
- }>, typeof S.Null]>>;
44
- }>;
45
- export type ParsedTool = S.Schema.Type<typeof ParsedTool>;
46
- //# sourceMappingURL=parsed-tool.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parsed-tool.d.ts","sourceRoot":"","sources":["../../src/models/parsed-tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,eAAe,CAAC;AAEnC,gFAAgF;AAChF,eAAO,MAAM,WAAW;;;EAGtB,CAAC;AAEH,oEAAoE;AACpE,eAAO,MAAM,QAAQ;;;EAGnB,CAAC;AAEH,+CAA+C;AAC/C,eAAO,MAAM,QAAQ;;;EAGnB,CAAC;AAQH;;;GAGG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;EAcrB,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC,CAAC"}
@@ -1,41 +0,0 @@
1
- import * as S from "effect/Schema";
2
- /** Tool help content with format (rst, markdown, etc.) and rendered content. */
3
- export const HelpContent = S.Struct({
4
- format: S.String,
5
- content: S.String,
6
- });
7
- /** External reference (e.g. bio.tools ID, bioconductor package). */
8
- export const XrefDict = S.Struct({
9
- value: S.String,
10
- type: S.String,
11
- });
12
- /** Tool citation entry (bibtex, doi, etc.). */
13
- export const Citation = S.Struct({
14
- type: S.String,
15
- content: S.String,
16
- });
17
- /** Normalize empty string to null for description field. */
18
- const NullableDescription = S.transform(S.NullOr(S.String), S.NullOr(S.String), {
19
- decode: (val) => (val === "" ? null : val),
20
- encode: (val) => val,
21
- });
22
- /**
23
- * Effect Schema for parsed Galaxy tool metadata as returned by the ToolShed TRS API
24
- * or Galaxy's /api/tools/:id/parsed endpoint.
25
- */
26
- export const ParsedTool = S.Struct({
27
- id: S.String,
28
- version: S.NullOr(S.String),
29
- name: S.String,
30
- description: NullableDescription,
31
- inputs: S.Array(S.Unknown),
32
- outputs: S.Array(S.Unknown),
33
- citations: S.Array(Citation),
34
- license: S.NullOr(S.String),
35
- profile: S.NullOr(S.String),
36
- edam_operations: S.Array(S.String),
37
- edam_topics: S.Array(S.String),
38
- xrefs: S.Array(XrefDict),
39
- help: S.optional(S.Union(HelpContent, S.Null)),
40
- });
41
- //# sourceMappingURL=parsed-tool.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parsed-tool.js","sourceRoot":"","sources":["../../src/models/parsed-tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,eAAe,CAAC;AAEnC,gFAAgF;AAChF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,MAAM,EAAE,CAAC,CAAC,MAAM;IAChB,OAAO,EAAE,CAAC,CAAC,MAAM;CAClB,CAAC,CAAC;AAEH,oEAAoE;AACpE,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/B,KAAK,EAAE,CAAC,CAAC,MAAM;IACf,IAAI,EAAE,CAAC,CAAC,MAAM;CACf,CAAC,CAAC;AAEH,+CAA+C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