@agentxm/extension-discovery 0.28.4-bootstrap.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +110 -0
- package/dist/src/discover.d.ts +34 -0
- package/dist/src/discover.js +133 -0
- package/dist/src/index.d.ts +13 -0
- package/dist/src/index.js +12 -0
- package/dist/src/internal/environment.d.ts +14 -0
- package/dist/src/internal/environment.js +15 -0
- package/dist/src/packaging/bazel.d.ts +27 -0
- package/dist/src/packaging/bazel.js +125 -0
- package/dist/src/packaging/cargo.d.ts +32 -0
- package/dist/src/packaging/cargo.js +270 -0
- package/dist/src/packaging/cocoapods.d.ts +26 -0
- package/dist/src/packaging/cocoapods.js +187 -0
- package/dist/src/packaging/composer.d.ts +26 -0
- package/dist/src/packaging/composer.js +144 -0
- package/dist/src/packaging/conan.d.ts +30 -0
- package/dist/src/packaging/conan.js +238 -0
- package/dist/src/packaging/conda.d.ts +26 -0
- package/dist/src/packaging/conda.js +320 -0
- package/dist/src/packaging/cpan.d.ts +29 -0
- package/dist/src/packaging/cpan.js +189 -0
- package/dist/src/packaging/cran.d.ts +29 -0
- package/dist/src/packaging/cran.js +176 -0
- package/dist/src/packaging/detect.d.ts +16 -0
- package/dist/src/packaging/detect.js +25 -0
- package/dist/src/packaging/detected-package.d.ts +14 -0
- package/dist/src/packaging/detected-package.js +20 -0
- package/dist/src/packaging/docker.d.ts +27 -0
- package/dist/src/packaging/docker.js +256 -0
- package/dist/src/packaging/gem.d.ts +26 -0
- package/dist/src/packaging/gem.js +234 -0
- package/dist/src/packaging/golang.d.ts +26 -0
- package/dist/src/packaging/golang.js +169 -0
- package/dist/src/packaging/hackage.d.ts +26 -0
- package/dist/src/packaging/hackage.js +305 -0
- package/dist/src/packaging/hex.d.ts +28 -0
- package/dist/src/packaging/hex.js +186 -0
- package/dist/src/packaging/huggingface.d.ts +20 -0
- package/dist/src/packaging/huggingface.js +112 -0
- package/dist/src/packaging/index.d.ts +44 -0
- package/dist/src/packaging/index.js +120 -0
- package/dist/src/packaging/jsr.d.ts +30 -0
- package/dist/src/packaging/jsr.js +227 -0
- package/dist/src/packaging/julia.d.ts +27 -0
- package/dist/src/packaging/julia.js +165 -0
- package/dist/src/packaging/luarocks.d.ts +28 -0
- package/dist/src/packaging/luarocks.js +159 -0
- package/dist/src/packaging/maven.d.ts +27 -0
- package/dist/src/packaging/maven.js +471 -0
- package/dist/src/packaging/mojo.d.ts +29 -0
- package/dist/src/packaging/mojo.js +148 -0
- package/dist/src/packaging/npm.d.ts +26 -0
- package/dist/src/packaging/npm.js +190 -0
- package/dist/src/packaging/nuget.d.ts +26 -0
- package/dist/src/packaging/nuget.js +240 -0
- package/dist/src/packaging/opam.d.ts +27 -0
- package/dist/src/packaging/opam.js +287 -0
- package/dist/src/packaging/pub.d.ts +26 -0
- package/dist/src/packaging/pub.js +357 -0
- package/dist/src/packaging/pypi.d.ts +23 -0
- package/dist/src/packaging/pypi.js +448 -0
- package/dist/src/packaging/read.d.ts +20 -0
- package/dist/src/packaging/read.js +31 -0
- package/dist/src/packaging/reader-io.d.ts +29 -0
- package/dist/src/packaging/reader-io.js +29 -0
- package/dist/src/packaging/swift.d.ts +26 -0
- package/dist/src/packaging/swift.js +141 -0
- package/dist/src/packaging/types.d.ts +43 -0
- package/dist/src/packaging/types.js +8 -0
- package/dist/src/packaging/zig.d.ts +32 -0
- package/dist/src/packaging/zig.js +151 -0
- package/package.json +54 -0
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hex package detector and reader for package-compatibility discovery.
|
|
3
|
+
*
|
|
4
|
+
* Supports both Elixir (mix.exs) and Gleam (gleam.toml) projects.
|
|
5
|
+
*
|
|
6
|
+
* @experimental This API is unstable and may change without notice.
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
import * as Effect from "effect/Effect";
|
|
10
|
+
import * as Option from "effect/Option";
|
|
11
|
+
import * as Path from "effect/Path";
|
|
12
|
+
import * as Result from "effect/Result";
|
|
13
|
+
import * as Schema from "effect/Schema";
|
|
14
|
+
import { PackageURL } from "packageurl-js";
|
|
15
|
+
import { parseTomlStringEntries, readTomlSection } from "@agentxm/extension-workspace";
|
|
16
|
+
import { PackageTypeSchema } from "@agentxm/extension-model/unstable/packaging/package-type";
|
|
17
|
+
import { decodeAxmMeta, decodePurl, parseJsonOptional, readFileOptional } from "./reader-io.js";
|
|
18
|
+
const hexType = Schema.decodeUnknownSync(PackageTypeSchema)("hex");
|
|
19
|
+
/**
|
|
20
|
+
* Returns true if the specifier is an exact semver version (no range operators).
|
|
21
|
+
*/
|
|
22
|
+
const isExactVersion = (specifier) => /^\d+\.\d+\.\d+(?:[-+][a-zA-Z0-9._+-]*)?$/.test(specifier);
|
|
23
|
+
/**
|
|
24
|
+
* Regex to detect :path or :git options which indicate non-registry deps.
|
|
25
|
+
*/
|
|
26
|
+
const PATH_OR_GIT_REGEX = /(?:path|git):\s*"/;
|
|
27
|
+
/**
|
|
28
|
+
* Parse mix.exs content and extract dependency tuples from the deps function.
|
|
29
|
+
*/
|
|
30
|
+
const parseMixExs = (content, source) => {
|
|
31
|
+
const results = [];
|
|
32
|
+
// Extract the full dep tuples to check for path/git options
|
|
33
|
+
const fullTuples = new Map();
|
|
34
|
+
let fullMatch;
|
|
35
|
+
const fullRegex = /\{:(\w+)[^}]*\}/g;
|
|
36
|
+
while ((fullMatch = fullRegex.exec(content)) !== null) {
|
|
37
|
+
const name = fullMatch[1];
|
|
38
|
+
if (name !== undefined) {
|
|
39
|
+
fullTuples.set(name, fullMatch[0]);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
// Now extract deps with version strings
|
|
43
|
+
let match;
|
|
44
|
+
const depRegex = /\{:(\w+),\s*"([^"]*)"/g;
|
|
45
|
+
while ((match = depRegex.exec(content)) !== null) {
|
|
46
|
+
const name = match[1];
|
|
47
|
+
const versionSpec = match[2];
|
|
48
|
+
if (name === undefined || versionSpec === undefined)
|
|
49
|
+
continue;
|
|
50
|
+
// Check if this dep has path: or git: options (skip if so)
|
|
51
|
+
const fullTuple = fullTuples.get(name);
|
|
52
|
+
if (fullTuple !== undefined && PATH_OR_GIT_REGEX.test(fullTuple))
|
|
53
|
+
continue;
|
|
54
|
+
const version = isExactVersion(versionSpec) ? versionSpec : undefined;
|
|
55
|
+
const purl = new PackageURL("hex", null, name, version ?? null, null, null);
|
|
56
|
+
const purlParts = decodePurl(purl.toString());
|
|
57
|
+
results.push({ purl: purlParts, type: hexType, source });
|
|
58
|
+
}
|
|
59
|
+
return results;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Parse a TOML-like section for dependencies.
|
|
63
|
+
* Handles simple `name = "version"` entries within a section block.
|
|
64
|
+
*/
|
|
65
|
+
const parseTomlDeps = (content, sectionName, source) => {
|
|
66
|
+
const results = [];
|
|
67
|
+
const sectionContent = readTomlSection(content, sectionName);
|
|
68
|
+
if (sectionContent === undefined)
|
|
69
|
+
return [];
|
|
70
|
+
for (const { key: name, value: versionSpec } of parseTomlStringEntries(sectionContent, "\\w+")) {
|
|
71
|
+
const version = isExactVersion(versionSpec) ? versionSpec : undefined;
|
|
72
|
+
const purl = new PackageURL("hex", null, name, version ?? null, null, null);
|
|
73
|
+
const purlParts = decodePurl(purl.toString());
|
|
74
|
+
results.push({ purl: purlParts, type: hexType, source });
|
|
75
|
+
}
|
|
76
|
+
return results;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Parse gleam.toml content and extract dependencies from [dependencies] and [dev-dependencies].
|
|
80
|
+
*/
|
|
81
|
+
const parseGleamToml = (content, source) => {
|
|
82
|
+
const deps = parseTomlDeps(content, "dependencies", source);
|
|
83
|
+
const devDeps = parseTomlDeps(content, "dev-dependencies", source);
|
|
84
|
+
return [...deps, ...devDeps];
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Parse Erlang term format hex_metadata.config to extract the extra.axm field.
|
|
88
|
+
* This is a simplified parser that extracts the axm JSON from the extra field.
|
|
89
|
+
*
|
|
90
|
+
* Erlang binary strings use `<<"...">>` delimiters. The axm value is a JSON
|
|
91
|
+
* string embedded as an Erlang binary, potentially with escaped quotes inside.
|
|
92
|
+
*/
|
|
93
|
+
const parseHexMetadataExtra = (content) => {
|
|
94
|
+
// Look for <<"axm">> key followed by its value in <<"...">> format
|
|
95
|
+
// The value may contain escaped quotes within the Erlang binary string
|
|
96
|
+
const axmMatch = /<<"axm">>,\s*<<"((?:[^"\\]|\\.)*)">>/m.exec(content);
|
|
97
|
+
if (axmMatch?.[1] !== undefined) {
|
|
98
|
+
// Unescape any escaped quotes from the Erlang binary string encoding
|
|
99
|
+
const jsonStr = axmMatch[1].replace(/\\"/g, '"');
|
|
100
|
+
try {
|
|
101
|
+
const parsed = JSON.parse(jsonStr);
|
|
102
|
+
return parsed;
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
return undefined;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return undefined;
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* Hex package detector.
|
|
112
|
+
*
|
|
113
|
+
* Scans `mix.exs` and `gleam.toml` in the project directory and extracts
|
|
114
|
+
* dependencies from Elixir dependency tuples and Gleam TOML sections.
|
|
115
|
+
*
|
|
116
|
+
* @experimental This API is unstable and may change without notice.
|
|
117
|
+
*/
|
|
118
|
+
export const hexDetector = {
|
|
119
|
+
type: hexType,
|
|
120
|
+
detect: Effect.fn("detect.hex")(function* (projectDir) {
|
|
121
|
+
const path = yield* Path.Path;
|
|
122
|
+
const results = [];
|
|
123
|
+
// Try mix.exs (Elixir)
|
|
124
|
+
const mixPath = path.join(projectDir, "mix.exs");
|
|
125
|
+
const mixContent = yield* readFileOptional(mixPath);
|
|
126
|
+
if (Option.isSome(mixContent)) {
|
|
127
|
+
const mixDeps = parseMixExs(mixContent.value, mixPath);
|
|
128
|
+
results.push(...mixDeps);
|
|
129
|
+
}
|
|
130
|
+
// Try gleam.toml (Gleam)
|
|
131
|
+
const gleamPath = path.join(projectDir, "gleam.toml");
|
|
132
|
+
const gleamContent = yield* readFileOptional(gleamPath);
|
|
133
|
+
if (Option.isSome(gleamContent)) {
|
|
134
|
+
const gleamDeps = parseGleamToml(gleamContent.value, gleamPath);
|
|
135
|
+
results.push(...gleamDeps);
|
|
136
|
+
}
|
|
137
|
+
return results;
|
|
138
|
+
}, Effect.annotateLogs({ detector: "hex" }), Effect.withSpan("detect.hex")),
|
|
139
|
+
};
|
|
140
|
+
/**
|
|
141
|
+
* Hex package reader.
|
|
142
|
+
*
|
|
143
|
+
* Reads `deps/<package-name>/axm.json` as the primary source, falling back to
|
|
144
|
+
* parsing `hex_metadata.config` for each detected Hex package.
|
|
145
|
+
*
|
|
146
|
+
* @experimental This API is unstable and may change without notice.
|
|
147
|
+
*/
|
|
148
|
+
export const hexReader = {
|
|
149
|
+
type: hexType,
|
|
150
|
+
read: Effect.fn("read.hex")(function* (pkg) {
|
|
151
|
+
const path = yield* Path.Path;
|
|
152
|
+
// Derive project directory from the source manifest path
|
|
153
|
+
const projectDir = path.dirname(pkg.source);
|
|
154
|
+
const pkgName = pkg.purl.name;
|
|
155
|
+
// Try axm.json sidecar first
|
|
156
|
+
const axmJsonPath = path.join(projectDir, "deps", pkgName, "axm.json");
|
|
157
|
+
const axmContent = yield* readFileOptional(axmJsonPath);
|
|
158
|
+
if (Option.isSome(axmContent)) {
|
|
159
|
+
const parsed = yield* parseJsonOptional(axmContent.value, `${pkgName}/axm.json`);
|
|
160
|
+
if (Option.isSome(parsed)) {
|
|
161
|
+
const metaResult = decodeAxmMeta(parsed.value);
|
|
162
|
+
if (Result.isFailure(metaResult)) {
|
|
163
|
+
yield* Effect.logWarning(`Invalid axm metadata in ${pkgName}/axm.json: schema validation failed`);
|
|
164
|
+
return Option.none();
|
|
165
|
+
}
|
|
166
|
+
return Option.some(metaResult.success.extensions);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
// Fall back to hex_metadata.config
|
|
170
|
+
const hexMetaPath = path.join(projectDir, "deps", pkgName, "hex_metadata.config");
|
|
171
|
+
const hexMetaContent = yield* readFileOptional(hexMetaPath);
|
|
172
|
+
if (Option.isSome(hexMetaContent)) {
|
|
173
|
+
const axmData = parseHexMetadataExtra(hexMetaContent.value);
|
|
174
|
+
if (axmData !== undefined) {
|
|
175
|
+
const metaResult = decodeAxmMeta(axmData);
|
|
176
|
+
if (Result.isFailure(metaResult)) {
|
|
177
|
+
yield* Effect.logWarning(`Invalid axm metadata in ${pkgName}/hex_metadata.config: schema validation failed`);
|
|
178
|
+
return Option.none();
|
|
179
|
+
}
|
|
180
|
+
return Option.some(metaResult.success.extensions);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return Option.none();
|
|
184
|
+
}, Effect.annotateLogs({ reader: "hex" }), Effect.withSpan("read.hex")),
|
|
185
|
+
};
|
|
186
|
+
//# sourceMappingURL=hex.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hugging Face (ML models) package reader for package-compatibility discovery.
|
|
3
|
+
*
|
|
4
|
+
* Reads YAML frontmatter from model cards in the Hugging Face cache directory.
|
|
5
|
+
* No detector is provided for this ecosystem.
|
|
6
|
+
*
|
|
7
|
+
* @experimental This API is unstable and may change without notice.
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
import type { PackageReader } from "./types.js";
|
|
11
|
+
/**
|
|
12
|
+
* Hugging Face model reader.
|
|
13
|
+
*
|
|
14
|
+
* Reads YAML frontmatter from model cards in
|
|
15
|
+
* `~/.cache/huggingface/hub/models--<id>/` and extracts axm metadata.
|
|
16
|
+
*
|
|
17
|
+
* @experimental This API is unstable and may change without notice.
|
|
18
|
+
*/
|
|
19
|
+
export declare const huggingfaceReader: PackageReader;
|
|
20
|
+
//# sourceMappingURL=huggingface.d.ts.map
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hugging Face (ML models) package reader for package-compatibility discovery.
|
|
3
|
+
*
|
|
4
|
+
* Reads YAML frontmatter from model cards in the Hugging Face cache directory.
|
|
5
|
+
* No detector is provided for this ecosystem.
|
|
6
|
+
*
|
|
7
|
+
* @experimental This API is unstable and may change without notice.
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
// Intentional escape hatch: node:os homedir() has no @effect/platform equivalent.
|
|
11
|
+
import * as os from "node:os";
|
|
12
|
+
import * as Effect from "effect/Effect";
|
|
13
|
+
import * as Option from "effect/Option";
|
|
14
|
+
import * as Path from "effect/Path";
|
|
15
|
+
import * as Result from "effect/Result";
|
|
16
|
+
import * as Schema from "effect/Schema";
|
|
17
|
+
import YAML from "yaml";
|
|
18
|
+
import { readEnv } from "../internal/environment.js";
|
|
19
|
+
import { PackageTypeSchema } from "@agentxm/extension-model/unstable/packaging/package-type";
|
|
20
|
+
import { decodeAxmMeta, readFileOptional } from "./reader-io.js";
|
|
21
|
+
const huggingfaceType = Schema.decodeUnknownSync(PackageTypeSchema)("huggingface");
|
|
22
|
+
// ---------------------------------------------------------------------------
|
|
23
|
+
// Helpers
|
|
24
|
+
// ---------------------------------------------------------------------------
|
|
25
|
+
/**
|
|
26
|
+
* Extract YAML frontmatter from a markdown file.
|
|
27
|
+
* Frontmatter is delimited by `---` at the start and end.
|
|
28
|
+
*/
|
|
29
|
+
const extractYamlFrontmatter = (content) => {
|
|
30
|
+
if (!content.startsWith("---"))
|
|
31
|
+
return undefined;
|
|
32
|
+
const endIdx = content.indexOf("\n---", 3);
|
|
33
|
+
if (endIdx === -1)
|
|
34
|
+
return undefined;
|
|
35
|
+
return content.slice(3, endIdx).trim();
|
|
36
|
+
};
|
|
37
|
+
/** Schema for extracting the axm field from model card frontmatter. */
|
|
38
|
+
const ModelCardAxmSchema = Schema.Struct({
|
|
39
|
+
axm: Schema.optional(Schema.Unknown),
|
|
40
|
+
});
|
|
41
|
+
const decodeModelCardAxm = Schema.decodeUnknownResult(ModelCardAxmSchema);
|
|
42
|
+
/**
|
|
43
|
+
* Resolve the Hugging Face cache directory.
|
|
44
|
+
* Checks HF_HOME, HUGGINGFACE_HUB_CACHE, then defaults to ~/.cache/huggingface/hub.
|
|
45
|
+
*/
|
|
46
|
+
const resolveHfCache = () => Effect.sync(() => readEnv("HUGGINGFACE_HUB_CACHE") ??
|
|
47
|
+
(readEnv("HF_HOME") ? `${readEnv("HF_HOME")}/hub` : `${os.homedir()}/.cache/huggingface/hub`));
|
|
48
|
+
// ---------------------------------------------------------------------------
|
|
49
|
+
// Reader
|
|
50
|
+
// ---------------------------------------------------------------------------
|
|
51
|
+
/**
|
|
52
|
+
* Hugging Face model reader.
|
|
53
|
+
*
|
|
54
|
+
* Reads YAML frontmatter from model cards in
|
|
55
|
+
* `~/.cache/huggingface/hub/models--<id>/` and extracts axm metadata.
|
|
56
|
+
*
|
|
57
|
+
* @experimental This API is unstable and may change without notice.
|
|
58
|
+
*/
|
|
59
|
+
export const huggingfaceReader = {
|
|
60
|
+
type: huggingfaceType,
|
|
61
|
+
read: Effect.fn("read.huggingface")(function* (pkg) {
|
|
62
|
+
const path = yield* Path.Path;
|
|
63
|
+
const hfCache = yield* resolveHfCache();
|
|
64
|
+
// Model IDs use -- as separator in the cache directory
|
|
65
|
+
// e.g., models--org--model-name for org/model-name
|
|
66
|
+
const namespace = pkg.purl.namespace;
|
|
67
|
+
const modelDirName = namespace
|
|
68
|
+
? `models--${namespace}--${pkg.purl.name}`
|
|
69
|
+
: `models--${pkg.purl.name}`;
|
|
70
|
+
// Look for README.md in the snapshot directory
|
|
71
|
+
const modelDir = path.join(hfCache, modelDirName);
|
|
72
|
+
// Find the latest snapshot by reading the refs/main file
|
|
73
|
+
const refsMainPath = path.join(modelDir, "refs", "main");
|
|
74
|
+
const refContent = yield* readFileOptional(refsMainPath);
|
|
75
|
+
if (Option.isNone(refContent))
|
|
76
|
+
return Option.none();
|
|
77
|
+
const snapshotHash = refContent.value.trim();
|
|
78
|
+
if (snapshotHash === "")
|
|
79
|
+
return Option.none();
|
|
80
|
+
const readmePath = path.join(modelDir, "snapshots", snapshotHash, "README.md");
|
|
81
|
+
const readmeContent = yield* readFileOptional(readmePath);
|
|
82
|
+
if (Option.isNone(readmeContent))
|
|
83
|
+
return Option.none();
|
|
84
|
+
// Extract YAML frontmatter
|
|
85
|
+
const frontmatter = extractYamlFrontmatter(readmeContent.value);
|
|
86
|
+
if (frontmatter === undefined)
|
|
87
|
+
return Option.none();
|
|
88
|
+
// Parse YAML frontmatter
|
|
89
|
+
const parsed = yield* Effect.try({
|
|
90
|
+
try: () => YAML.parse(frontmatter),
|
|
91
|
+
catch: () => ({ _tag: "YamlParseError" }),
|
|
92
|
+
}).pipe(Effect.option);
|
|
93
|
+
if (Option.isNone(parsed)) {
|
|
94
|
+
yield* Effect.logWarning(`Malformed YAML frontmatter in ${pkg.purl.name} model card, skipping`);
|
|
95
|
+
return Option.none();
|
|
96
|
+
}
|
|
97
|
+
// Extract axm metadata
|
|
98
|
+
const containerResult = decodeModelCardAxm(parsed.value);
|
|
99
|
+
if (Result.isFailure(containerResult))
|
|
100
|
+
return Option.none();
|
|
101
|
+
const axmRaw = containerResult.success.axm;
|
|
102
|
+
if (axmRaw === undefined)
|
|
103
|
+
return Option.none();
|
|
104
|
+
const metaResult = decodeAxmMeta(axmRaw);
|
|
105
|
+
if (Result.isFailure(metaResult)) {
|
|
106
|
+
yield* Effect.logWarning(`Invalid axm metadata in ${pkg.purl.name}: schema validation failed`);
|
|
107
|
+
return Option.none();
|
|
108
|
+
}
|
|
109
|
+
return Option.some(metaResult.success.extensions);
|
|
110
|
+
}, Effect.annotateLogs({ reader: "huggingface" }), Effect.withSpan("read.huggingface")),
|
|
111
|
+
};
|
|
112
|
+
//# sourceMappingURL=huggingface.js.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export type { DetectedPackage, PackageDetector, PackageReader } from "./types.js";
|
|
2
|
+
export { detectPackages } from "./detect.js";
|
|
3
|
+
export { readLocalRecommendations } from "./read.js";
|
|
4
|
+
import { npmDetector, npmReader } from "./npm.js";
|
|
5
|
+
import { golangDetector, golangReader } from "./golang.js";
|
|
6
|
+
import { pypiDetector, pypiReader } from "./pypi.js";
|
|
7
|
+
import { cargoDetector, cargoReader } from "./cargo.js";
|
|
8
|
+
import { gemDetector, gemReader } from "./gem.js";
|
|
9
|
+
import { mavenDetector, mavenReader } from "./maven.js";
|
|
10
|
+
import { nugetDetector, nugetReader } from "./nuget.js";
|
|
11
|
+
import { composerDetector, composerReader } from "./composer.js";
|
|
12
|
+
import { swiftDetector, swiftReader } from "./swift.js";
|
|
13
|
+
import { hexDetector, hexReader } from "./hex.js";
|
|
14
|
+
import { pubDetector, pubReader } from "./pub.js";
|
|
15
|
+
import { dockerDetector, dockerReader } from "./docker.js";
|
|
16
|
+
import { cocoapodsDetector, cocoapodsReader } from "./cocoapods.js";
|
|
17
|
+
import { condaDetector, condaReader } from "./conda.js";
|
|
18
|
+
import { conanDetector, conanReader } from "./conan.js";
|
|
19
|
+
import { cranDetector, cranReader } from "./cran.js";
|
|
20
|
+
import { huggingfaceReader } from "./huggingface.js";
|
|
21
|
+
import { cpanDetector, cpanReader } from "./cpan.js";
|
|
22
|
+
import { hackageDetector, hackageReader } from "./hackage.js";
|
|
23
|
+
import { juliaDetector, juliaReader } from "./julia.js";
|
|
24
|
+
import { luarocksDetector, luarocksReader } from "./luarocks.js";
|
|
25
|
+
import { opamDetector, opamReader } from "./opam.js";
|
|
26
|
+
import { bazelDetector, bazelReader } from "./bazel.js";
|
|
27
|
+
import { zigDetector, zigReader } from "./zig.js";
|
|
28
|
+
import { jsrDetector, denoReader } from "./jsr.js";
|
|
29
|
+
import { mojoDetector, mojoReader } from "./mojo.js";
|
|
30
|
+
import type { PackageDetector, PackageReader } from "./types.js";
|
|
31
|
+
export { npmDetector, npmReader, golangDetector, golangReader, pypiDetector, pypiReader, cargoDetector, cargoReader, gemDetector, gemReader, mavenDetector, mavenReader, nugetDetector, nugetReader, composerDetector, composerReader, swiftDetector, swiftReader, hexDetector, hexReader, pubDetector, pubReader, dockerDetector, dockerReader, cocoapodsDetector, cocoapodsReader, condaDetector, condaReader, conanDetector, conanReader, cranDetector, cranReader, huggingfaceReader, cpanDetector, cpanReader, hackageDetector, hackageReader, juliaDetector, juliaReader, luarocksDetector, luarocksReader, opamDetector, opamReader, bazelDetector, bazelReader, zigDetector, zigReader, jsrDetector, denoReader, mojoDetector, mojoReader, };
|
|
32
|
+
/**
|
|
33
|
+
* All registered package detectors.
|
|
34
|
+
*
|
|
35
|
+
* @experimental This API is unstable and may change without notice.
|
|
36
|
+
*/
|
|
37
|
+
export declare const packageDetectors: ReadonlyArray<PackageDetector>;
|
|
38
|
+
/**
|
|
39
|
+
* All registered package readers.
|
|
40
|
+
*
|
|
41
|
+
* @experimental This API is unstable and may change without notice.
|
|
42
|
+
*/
|
|
43
|
+
export declare const packageReaders: ReadonlyArray<PackageReader>;
|
|
44
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
export { detectPackages } from "./detect.js";
|
|
2
|
+
export { readLocalRecommendations } from "./read.js";
|
|
3
|
+
// Tier 1
|
|
4
|
+
import { npmDetector, npmReader } from "./npm.js";
|
|
5
|
+
import { golangDetector, golangReader } from "./golang.js";
|
|
6
|
+
import { pypiDetector, pypiReader } from "./pypi.js";
|
|
7
|
+
// Tier 2
|
|
8
|
+
import { cargoDetector, cargoReader } from "./cargo.js";
|
|
9
|
+
import { gemDetector, gemReader } from "./gem.js";
|
|
10
|
+
import { mavenDetector, mavenReader } from "./maven.js";
|
|
11
|
+
import { nugetDetector, nugetReader } from "./nuget.js";
|
|
12
|
+
// Tier 3
|
|
13
|
+
import { composerDetector, composerReader } from "./composer.js";
|
|
14
|
+
import { swiftDetector, swiftReader } from "./swift.js";
|
|
15
|
+
import { hexDetector, hexReader } from "./hex.js";
|
|
16
|
+
import { pubDetector, pubReader } from "./pub.js";
|
|
17
|
+
import { dockerDetector, dockerReader } from "./docker.js";
|
|
18
|
+
import { cocoapodsDetector, cocoapodsReader } from "./cocoapods.js";
|
|
19
|
+
import { condaDetector, condaReader } from "./conda.js";
|
|
20
|
+
// Tier 4
|
|
21
|
+
import { conanDetector, conanReader } from "./conan.js";
|
|
22
|
+
import { cranDetector, cranReader } from "./cran.js";
|
|
23
|
+
import { huggingfaceReader } from "./huggingface.js";
|
|
24
|
+
import { cpanDetector, cpanReader } from "./cpan.js";
|
|
25
|
+
import { hackageDetector, hackageReader } from "./hackage.js";
|
|
26
|
+
import { juliaDetector, juliaReader } from "./julia.js";
|
|
27
|
+
import { luarocksDetector, luarocksReader } from "./luarocks.js";
|
|
28
|
+
import { opamDetector, opamReader } from "./opam.js";
|
|
29
|
+
import { bazelDetector, bazelReader } from "./bazel.js";
|
|
30
|
+
// Tier 5
|
|
31
|
+
import { zigDetector, zigReader } from "./zig.js";
|
|
32
|
+
import { jsrDetector, denoReader } from "./jsr.js";
|
|
33
|
+
import { mojoDetector, mojoReader } from "./mojo.js";
|
|
34
|
+
export {
|
|
35
|
+
// Tier 1
|
|
36
|
+
npmDetector, npmReader, golangDetector, golangReader, pypiDetector, pypiReader,
|
|
37
|
+
// Tier 2
|
|
38
|
+
cargoDetector, cargoReader, gemDetector, gemReader, mavenDetector, mavenReader, nugetDetector, nugetReader,
|
|
39
|
+
// Tier 3
|
|
40
|
+
composerDetector, composerReader, swiftDetector, swiftReader, hexDetector, hexReader, pubDetector, pubReader, dockerDetector, dockerReader, cocoapodsDetector, cocoapodsReader, condaDetector, condaReader,
|
|
41
|
+
// Tier 4
|
|
42
|
+
conanDetector, conanReader, cranDetector, cranReader, huggingfaceReader, cpanDetector, cpanReader, hackageDetector, hackageReader, juliaDetector, juliaReader, luarocksDetector, luarocksReader, opamDetector, opamReader, bazelDetector, bazelReader,
|
|
43
|
+
// Tier 5
|
|
44
|
+
zigDetector, zigReader, jsrDetector, denoReader, mojoDetector, mojoReader, };
|
|
45
|
+
/**
|
|
46
|
+
* All registered package detectors.
|
|
47
|
+
*
|
|
48
|
+
* @experimental This API is unstable and may change without notice.
|
|
49
|
+
*/
|
|
50
|
+
export const packageDetectors = [
|
|
51
|
+
// Tier 1
|
|
52
|
+
npmDetector,
|
|
53
|
+
golangDetector,
|
|
54
|
+
pypiDetector,
|
|
55
|
+
// Tier 2
|
|
56
|
+
cargoDetector,
|
|
57
|
+
gemDetector,
|
|
58
|
+
mavenDetector,
|
|
59
|
+
nugetDetector,
|
|
60
|
+
// Tier 3
|
|
61
|
+
composerDetector,
|
|
62
|
+
swiftDetector,
|
|
63
|
+
hexDetector,
|
|
64
|
+
pubDetector,
|
|
65
|
+
dockerDetector,
|
|
66
|
+
cocoapodsDetector,
|
|
67
|
+
condaDetector,
|
|
68
|
+
// Tier 4
|
|
69
|
+
conanDetector,
|
|
70
|
+
cranDetector,
|
|
71
|
+
cpanDetector,
|
|
72
|
+
hackageDetector,
|
|
73
|
+
juliaDetector,
|
|
74
|
+
luarocksDetector,
|
|
75
|
+
opamDetector,
|
|
76
|
+
bazelDetector,
|
|
77
|
+
// Tier 5
|
|
78
|
+
zigDetector,
|
|
79
|
+
jsrDetector,
|
|
80
|
+
mojoDetector,
|
|
81
|
+
];
|
|
82
|
+
/**
|
|
83
|
+
* All registered package readers.
|
|
84
|
+
*
|
|
85
|
+
* @experimental This API is unstable and may change without notice.
|
|
86
|
+
*/
|
|
87
|
+
export const packageReaders = [
|
|
88
|
+
// Tier 1
|
|
89
|
+
npmReader,
|
|
90
|
+
golangReader,
|
|
91
|
+
pypiReader,
|
|
92
|
+
// Tier 2
|
|
93
|
+
cargoReader,
|
|
94
|
+
gemReader,
|
|
95
|
+
mavenReader,
|
|
96
|
+
nugetReader,
|
|
97
|
+
// Tier 3
|
|
98
|
+
composerReader,
|
|
99
|
+
swiftReader,
|
|
100
|
+
hexReader,
|
|
101
|
+
pubReader,
|
|
102
|
+
dockerReader,
|
|
103
|
+
cocoapodsReader,
|
|
104
|
+
condaReader,
|
|
105
|
+
// Tier 4
|
|
106
|
+
conanReader,
|
|
107
|
+
cranReader,
|
|
108
|
+
huggingfaceReader,
|
|
109
|
+
cpanReader,
|
|
110
|
+
hackageReader,
|
|
111
|
+
juliaReader,
|
|
112
|
+
luarocksReader,
|
|
113
|
+
opamReader,
|
|
114
|
+
bazelReader,
|
|
115
|
+
// Tier 5
|
|
116
|
+
zigReader,
|
|
117
|
+
denoReader,
|
|
118
|
+
mojoReader,
|
|
119
|
+
];
|
|
120
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSR package detector and Deno reader for package-compatibility discovery.
|
|
3
|
+
*
|
|
4
|
+
* Parses `deno.json`/`deno.jsonc` for `jsr:@scope/name` imports and reads
|
|
5
|
+
* axm metadata from Deno's module cache.
|
|
6
|
+
*
|
|
7
|
+
* @experimental This API is unstable and may change without notice.
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
import type { PackageDetector, PackageReader } from "./types.js";
|
|
11
|
+
/**
|
|
12
|
+
* JSR package detector.
|
|
13
|
+
*
|
|
14
|
+
* Scans `deno.json` and `deno.jsonc` in the project directory and extracts
|
|
15
|
+
* `jsr:@scope/name` imports, producing `pkg:jsr/<scope>/<name>` purls.
|
|
16
|
+
* npm-prefixed imports are skipped.
|
|
17
|
+
*
|
|
18
|
+
* @experimental This API is unstable and may change without notice.
|
|
19
|
+
*/
|
|
20
|
+
export declare const jsrDetector: PackageDetector;
|
|
21
|
+
/**
|
|
22
|
+
* Deno package reader.
|
|
23
|
+
*
|
|
24
|
+
* Reads axm metadata from cached module metadata in Deno's module cache.
|
|
25
|
+
* Checks for an `"axm"` field in cached `deno.json` files.
|
|
26
|
+
*
|
|
27
|
+
* @experimental This API is unstable and may change without notice.
|
|
28
|
+
*/
|
|
29
|
+
export declare const denoReader: PackageReader;
|
|
30
|
+
//# sourceMappingURL=jsr.d.ts.map
|