@agntn/registries 0.3.0 → 0.3.1
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/README.md +26 -3
- package/dist/THIRD-PARTY-LICENSES.md +36 -0
- package/dist/_chunks/cache.mjs +15 -0
- package/dist/{cache/index.mjs.map → _chunks/cache.mjs.map} +1 -1
- package/dist/{commands/cache.mjs → _chunks/cache2.mjs} +6 -8
- package/dist/_chunks/cache2.mjs.map +1 -0
- package/dist/{cache → _chunks}/cached-registry.mjs +12 -8
- package/dist/_chunks/cached-registry.mjs.map +1 -0
- package/dist/{commands → _chunks}/deps.mjs +19 -13
- package/dist/_chunks/deps.mjs.map +1 -0
- package/dist/_chunks/helpers.mjs +53 -19
- package/dist/_chunks/helpers.mjs.map +1 -1
- package/dist/_chunks/index.d.mts +9 -23
- package/dist/_chunks/index.d.mts.map +1 -1
- package/dist/_chunks/index2.d.mts +181 -0
- package/dist/_chunks/index2.d.mts.map +1 -0
- package/dist/_chunks/index3.d.mts +188 -0
- package/dist/_chunks/index3.d.mts.map +1 -0
- package/dist/_chunks/info.mjs +105 -0
- package/dist/_chunks/info.mjs.map +1 -0
- package/dist/_chunks/libs/typebox.mjs +278 -0
- package/dist/_chunks/libs/typebox.mjs.map +1 -0
- package/dist/_chunks/lockfile.mjs +183 -0
- package/dist/_chunks/lockfile.mjs.map +1 -0
- package/dist/_chunks/maintainers.mjs +53 -0
- package/dist/_chunks/maintainers.mjs.map +1 -0
- package/dist/_chunks/mcp.mjs +15 -0
- package/dist/_chunks/mcp.mjs.map +1 -0
- package/dist/_chunks/registries.mjs +514 -245
- package/dist/_chunks/registries.mjs.map +1 -1
- package/dist/_chunks/registry.d.mts +121 -10
- package/dist/_chunks/registry.d.mts.map +1 -1
- package/dist/_chunks/registry.mjs +121 -31
- package/dist/_chunks/registry.mjs.map +1 -1
- package/dist/{commands → _chunks}/shared.mjs +15 -8
- package/dist/_chunks/shared.mjs.map +1 -0
- package/dist/_chunks/tool-operations.mjs +63 -0
- package/dist/_chunks/tool-operations.mjs.map +1 -0
- package/dist/_chunks/version.mjs +4 -0
- package/dist/_chunks/version.mjs.map +1 -0
- package/dist/{commands → _chunks}/versions.mjs +10 -9
- package/dist/_chunks/versions.mjs.map +1 -0
- package/dist/ai.d.mts +4 -4
- package/dist/ai.mjs +0 -1
- package/dist/ai.mjs.map +1 -1
- package/dist/cache/index.d.mts +3 -23
- package/dist/cache/index.mjs +4 -11
- package/dist/cli.mjs +9 -7
- package/dist/cli.mjs.map +1 -1
- package/dist/index.d.mts +4 -56
- package/dist/index.mjs +4 -7
- package/dist/mcp.d.mts +7 -0
- package/dist/mcp.d.mts.map +1 -0
- package/dist/mcp.mjs +155 -0
- package/dist/mcp.mjs.map +1 -0
- package/dist/registries/index.d.mts +0 -1
- package/dist/registries/index.mjs +0 -1
- package/dist/tool-operations.d.mts +36 -0
- package/dist/tool-operations.d.mts.map +1 -0
- package/dist/tool-operations.mjs +5 -0
- package/package.json +55 -9
- package/packages/omp/extensions/registries.ts +112 -0
- package/packages/pi/extensions/registries.ts +125 -0
- package/dist/_chunks/errors.d.mts +0 -90
- package/dist/_chunks/errors.d.mts.map +0 -1
- package/dist/_chunks/purl.mjs +0 -200
- package/dist/_chunks/purl.mjs.map +0 -1
- package/dist/_chunks/types.d.mts +0 -73
- package/dist/_chunks/types.d.mts.map +0 -1
- package/dist/cache/cached-registry.d.mts +0 -35
- package/dist/cache/cached-registry.d.mts.map +0 -1
- package/dist/cache/cached-registry.mjs.map +0 -1
- package/dist/cache/index.d.mts.map +0 -1
- package/dist/cache/lockfile.d.mts +0 -50
- package/dist/cache/lockfile.d.mts.map +0 -1
- package/dist/cache/lockfile.mjs +0 -68
- package/dist/cache/lockfile.mjs.map +0 -1
- package/dist/cache/paths.d.mts +0 -11
- package/dist/cache/paths.d.mts.map +0 -1
- package/dist/cache/paths.mjs +0 -26
- package/dist/cache/paths.mjs.map +0 -1
- package/dist/cache/storage.d.mts +0 -22
- package/dist/cache/storage.d.mts.map +0 -1
- package/dist/cache/storage.mjs +0 -40
- package/dist/cache/storage.mjs.map +0 -1
- package/dist/commands/cache.d.mts +0 -7
- package/dist/commands/cache.d.mts.map +0 -1
- package/dist/commands/cache.mjs.map +0 -1
- package/dist/commands/deps.d.mts +0 -23
- package/dist/commands/deps.d.mts.map +0 -1
- package/dist/commands/deps.mjs.map +0 -1
- package/dist/commands/info.d.mts +0 -26
- package/dist/commands/info.d.mts.map +0 -1
- package/dist/commands/info.mjs +0 -54
- package/dist/commands/info.mjs.map +0 -1
- package/dist/commands/maintainers.d.mts +0 -23
- package/dist/commands/maintainers.d.mts.map +0 -1
- package/dist/commands/maintainers.mjs +0 -46
- package/dist/commands/maintainers.mjs.map +0 -1
- package/dist/commands/shared.d.mts +0 -27
- package/dist/commands/shared.d.mts.map +0 -1
- package/dist/commands/shared.mjs.map +0 -1
- package/dist/commands/versions.d.mts +0 -31
- package/dist/commands/versions.d.mts.map +0 -1
- package/dist/commands/versions.mjs.map +0 -1
- package/dist/core/index.d.mts +0 -4
- package/dist/core/index.mjs +0 -3
- package/dist/index.d.mts.map +0 -1
- package/dist/types.d.mts +0 -3
- package/dist/types.mjs +0 -1
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { l as Version } from "../_chunks/types.mjs";
|
|
2
|
-
import * as citty from "citty";
|
|
3
|
-
|
|
4
|
-
//#region src/commands/versions.d.ts
|
|
5
|
-
declare function selectRecentVersions(versions: Version[], limit: number): Version[];
|
|
6
|
-
declare const _default: citty.CommandDef<{
|
|
7
|
-
readonly purl: {
|
|
8
|
-
readonly type: "positional";
|
|
9
|
-
readonly description: "Package PURL (e.g. pkg:npm/lodash, cargo/serde)";
|
|
10
|
-
readonly required: true;
|
|
11
|
-
};
|
|
12
|
-
readonly limit: {
|
|
13
|
-
readonly type: "string";
|
|
14
|
-
readonly alias: "l";
|
|
15
|
-
readonly description: "Max versions to show";
|
|
16
|
-
readonly default: "20";
|
|
17
|
-
};
|
|
18
|
-
readonly json: {
|
|
19
|
-
readonly type: "boolean";
|
|
20
|
-
readonly description: "Output as JSON";
|
|
21
|
-
readonly default: false;
|
|
22
|
-
};
|
|
23
|
-
readonly "no-cache": {
|
|
24
|
-
readonly type: "boolean";
|
|
25
|
-
readonly description: "Bypass cache, fetch fresh data";
|
|
26
|
-
readonly default: false;
|
|
27
|
-
};
|
|
28
|
-
}>;
|
|
29
|
-
//#endregion
|
|
30
|
-
export { _default as default, selectRecentVersions };
|
|
31
|
-
//# sourceMappingURL=versions.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"versions.d.mts","names":[],"sources":["../../src/commands/versions.ts"],"mappings":";;;;iBAKgB,oBAAA,CAAqB,QAAA,EAAU,OAAA,IAAW,KAAA,WAAgB,OAAA;AAAA,cAQzE,QAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"versions.mjs","names":[],"sources":["../../src/commands/versions.ts"],"sourcesContent":["import { defineCommand } from \"citty\";\nimport consola from \"consola\";\nimport type { Version } from \"../core/types.ts\";\n\nimport { sharedArgs, resolvePURL, withErrorHandling } from \"./shared.ts\";\nexport function selectRecentVersions(versions: Version[], limit: number): Version[] {\n return versions\n .toSorted((a, b) => {\n if (a.publishedAt === null) return b.publishedAt === null ? 0 : 1;\n if (b.publishedAt === null) return -1;\n return b.publishedAt.getTime() - a.publishedAt.getTime();\n })\n .slice(0, limit);\n}\n\nexport default defineCommand({\n meta: {\n name: \"versions\",\n description: \"List package versions\",\n },\n args: {\n ...sharedArgs,\n purl: {\n type: \"positional\",\n description: \"Package PURL (e.g. pkg:npm/lodash, cargo/serde)\",\n required: true,\n },\n limit: {\n type: \"string\",\n alias: \"l\",\n description: \"Max versions to show\",\n default: \"20\",\n },\n },\n async run({ args }) {\n await withErrorHandling(async () => {\n const [reg, name] = resolvePURL(args.purl, !args[\"no-cache\"]);\n const versions = await reg.fetchVersions(name);\n const limit = Number.parseInt(args.limit, 10) || 20;\n const shown = selectRecentVersions(versions, limit);\n\n if (args.json) {\n console.log(JSON.stringify(shown, null, 2));\n return;\n }\n\n consola.log(\"\");\n consola.log(\n ` \\x1b[1m${name}\\x1b[0m — ${versions.length} version${versions.length === 1 ? \"\" : \"s\"}`,\n );\n consola.log(\"\");\n\n for (const v of shown) {\n const status = v.status ? ` \\x1b[33m[${v.status}]\\x1b[0m` : \"\";\n const date = v.publishedAt\n ? ` \\x1b[90m${v.publishedAt.toISOString().slice(0, 10)}\\x1b[0m`\n : \"\";\n consola.log(` ${v.number}${status}${date}`);\n }\n\n if (versions.length > limit) {\n consola.log(\n `\\n \\x1b[90m... and ${versions.length - limit} more (use --limit to show more)\\x1b[0m`,\n );\n }\n consola.log(\"\");\n });\n },\n});\n"],"mappings":";;;;;;AAKA,SAAgB,qBAAqB,UAAqB,OAA0B;AAClF,QAAO,SACJ,UAAU,GAAG,MAAM;AAClB,MAAI,EAAE,gBAAgB,KAAM,QAAO,EAAE,gBAAgB,OAAO,IAAI;AAChE,MAAI,EAAE,gBAAgB,KAAM,QAAO;AACnC,SAAO,EAAE,YAAY,SAAS,GAAG,EAAE,YAAY,SAAS;GACxD,CACD,MAAM,GAAG,MAAM;;AAGpB,IAAA,mBAAe,cAAc;CAC3B,MAAM;EACJ,MAAM;EACN,aAAa;EACd;CACD,MAAM;EACJ,GAAG;EACH,MAAM;GACJ,MAAM;GACN,aAAa;GACb,UAAU;GACX;EACD,OAAO;GACL,MAAM;GACN,OAAO;GACP,aAAa;GACb,SAAS;;EAEZ;CACD,MAAM,IAAI,EAAE,QAAQ;AAClB,QAAM,kBAAkB,YAAY;GAClC,MAAM,CAAC,KAAK,QAAQ,YAAY,KAAK,MAAM,CAAC,KAAK,YAAY;GAC7D,MAAM,WAAW,MAAM,IAAI,cAAc,KAAK;GAC9C,MAAM,QAAQ,OAAO,SAAS,KAAK,OAAO,GAAG,IAAI;GACjD,MAAM,QAAQ,qBAAqB,UAAU,MAAM;AAEnD,OAAI,KAAK,MAAM;AACb,YAAQ,IAAI,KAAK,UAAU,OAAO,MAAM,EAAE,CAAC;AAC3C;;AAGF,WAAQ,IAAI,GAAG;AACf,WAAQ,IACN,YAAY,KAAK,YAAY,SAAS,OAAO,UAAU,SAAS,WAAW,IAAI,KAAK,MACrF;AACD,WAAQ,IAAI,GAAG;AAEf,QAAK,MAAM,KAAK,OAAO;IACrB,MAAM,SAAS,EAAE,SAAS,aAAa,EAAE,OAAO,YAAY;IAC5D,MAAM,OAAO,EAAE,cACX,aAAa,EAAE,YAAY,aAAa,CAAC,MAAM,GAAG,GAAG,CAAC,WACtD;AACJ,YAAQ,IAAI,KAAK,EAAE,SAAS,SAAS,OAAO;;AAG9C,OAAI,SAAS,SAAS,MACpB,SAAQ,IACN,uBAAuB,SAAS,SAAS,MAAM,yCAChD;AAEH,WAAQ,IAAI,GAAG;IACf;;CAEL,CAAC"}
|
package/dist/core/index.d.mts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { a as ParsedPURL, c as URLBuilder, i as Package, l as Version, n as Dependency, o as RateLimiter, r as Maintainer, s as Scope, t as ClientOptions, u as VersionStatus } from "../_chunks/types.mjs";
|
|
2
|
-
import { a as register, i as has, n as create, o as Client, r as ecosystems, s as defaultClient, t as Registry } from "../_chunks/registry.mjs";
|
|
3
|
-
import { a as RateLimitError, c as combineLicenses, d as createFromPURL, f as fullName, i as PkioError, l as normalizeLicense, n as InvalidPURLError, o as UnknownEcosystemError, p as parsePURL, r as NotFoundError, s as normalizeRepositoryURL, t as HTTPError, u as buildPURL } from "../_chunks/errors.mjs";
|
|
4
|
-
export { Client, type ClientOptions, type Dependency, HTTPError, InvalidPURLError, type Maintainer, NotFoundError, type Package, type ParsedPURL, PkioError, RateLimitError, type RateLimiter, Registry, type Scope, type URLBuilder, UnknownEcosystemError, type Version, type VersionStatus, buildPURL, combineLicenses, create, createFromPURL, defaultClient, ecosystems, fullName, has, normalizeLicense, normalizeRepositoryURL, parsePURL, register };
|
package/dist/core/index.mjs
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { a as register, c as HTTPError, d as PkioError, f as RateLimitError, i as has, l as InvalidPURLError, n as create, o as Client, p as UnknownEcosystemError, r as ecosystems, s as defaultClient, t as Registry, u as NotFoundError } from "../_chunks/registry.mjs";
|
|
2
|
-
import { a as normalizeRepositoryURL, i as parsePURL, n as createFromPURL, o as combineLicenses, r as fullName, s as normalizeLicense, t as buildPURL } from "../_chunks/purl.mjs";
|
|
3
|
-
export { Client, HTTPError, InvalidPURLError, NotFoundError, PkioError, RateLimitError, Registry, UnknownEcosystemError, buildPURL, combineLicenses, create, createFromPURL, defaultClient, ecosystems, fullName, has, normalizeLicense, normalizeRepositoryURL, parsePURL, register };
|
package/dist/index.d.mts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/helpers.ts"],"mappings":";;;;;;;;;;;;iBAMsB,oBAAA,CACpB,IAAA,UACA,MAAA,GAAS,WAAA,EACT,MAAA,GAAS,MAAA,GACR,OAAA,CAAQ,OAAA;;iBAMW,qBAAA,CACpB,IAAA,UACA,MAAA,GAAS,WAAA,EACT,MAAA,GAAS,MAAA,GACR,OAAA,CAAQ,OAAA;;iBAMW,yBAAA,CACpB,IAAA,UACA,MAAA,GAAS,WAAA,EACT,MAAA,GAAS,MAAA,GACR,OAAA,CAAQ,UAAA;;iBASW,wBAAA,CACpB,IAAA,UACA,MAAA,GAAS,WAAA,EACT,MAAA,GAAS,MAAA,GACR,OAAA,CAAQ,UAAA;;iBAQW,iBAAA,CACpB,KAAA,YACA,OAAA;EAAY,WAAA;EAAsB,MAAA,GAAS,WAAA;EAAa,MAAA,GAAS,MAAA;AAAA,IAChE,OAAA,CAAQ,GAAA,SAAY,OAAA;;;;;;;;;;;iBAoCP,aAAA,CACd,QAAA,EAAU,OAAA,IACV,OAAA;EACE,SAAA;EACA,MAAA;AAAA,IAED,OAAA;;;;;;;;;iBAiCa,cAAA,CAAe,GAAA,EAAK,OAAA,EAAS,IAAA,EAAM,UAAA,EAAY,OAAA;;;;;;iBAS/C,gBAAA,CAAiB,GAAA,EAAK,OAAA,EAAS,IAAA,EAAM,UAAA,EAAY,OAAA"}
|
package/dist/types.d.mts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { a as ParsedPURL, c as URLBuilder, i as Package, l as Version, n as Dependency, o as RateLimiter, r as Maintainer, s as Scope, t as ClientOptions, u as VersionStatus } from "./_chunks/types.mjs";
|
|
2
|
-
import { t as Registry } from "./_chunks/registry.mjs";
|
|
3
|
-
export { type ClientOptions, type Dependency, type Maintainer, type Package, type ParsedPURL, type RateLimiter, type Registry, type Scope, type URLBuilder, type Version, type VersionStatus };
|
package/dist/types.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|