@modularcore/registry-client 0.3.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.
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Raised by `createRegistryClient` on any deliberate failure (network error, 404, invalid
3
+ * JSON, schema mismatch). Extends `Error` directly — not the CLI's `CliError` — because this
4
+ * package has no dependency on `@modularcore/cli` and must stay usable from other consumers
5
+ * (e.g. the MCP server) that don't share the CLI's error hierarchy. Consumers that want the
6
+ * CLI's clean single-line error formatting should catch `instanceof RegistryClientError`
7
+ * alongside their own base error class.
8
+ */
9
+ export declare class RegistryClientError extends Error {
10
+ constructor(message: string);
11
+ }
12
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;gBAChC,OAAO,EAAE,MAAM;CAI5B"}
package/dist/errors.js ADDED
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Raised by `createRegistryClient` on any deliberate failure (network error, 404, invalid
3
+ * JSON, schema mismatch). Extends `Error` directly — not the CLI's `CliError` — because this
4
+ * package has no dependency on `@modularcore/cli` and must stay usable from other consumers
5
+ * (e.g. the MCP server) that don't share the CLI's error hierarchy. Consumers that want the
6
+ * CLI's clean single-line error formatting should catch `instanceof RegistryClientError`
7
+ * alongside their own base error class.
8
+ */
9
+ export class RegistryClientError extends Error {
10
+ constructor(message) {
11
+ super(message);
12
+ this.name = 'RegistryClientError';
13
+ }
14
+ }
15
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IAC5C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF"}
@@ -0,0 +1,34 @@
1
+ import type { RegistryFileWithContent, WriteResult } from '@modularcore/registry';
2
+ /**
3
+ * Anti-path-traversal clamp: resolves a registry file's `target` onto `cwd`, refusing any
4
+ * path that escapes the project root. Callers that remap conventional target prefixes onto
5
+ * project-specific paths (e.g. `paths.components`/`paths.lib` from `modularcore.json` — see
6
+ * `remapTarget` below) must apply that remap to `fileTarget` themselves before calling this.
7
+ */
8
+ export declare function resolveTargetPath(cwd: string, fileTarget: string): string;
9
+ /**
10
+ * Descriptor authors write conventional targets (`src/components/...`, `src/modularcore/...`);
11
+ * every writer (CLI `add`/`diff`/`update`, MCP server `install_component`) must remap those
12
+ * prefixes onto the project's configured `paths` from its `modularcore.json` before calling
13
+ * `resolveTargetPath`/`writeFilesTracked` — otherwise a component installed via one writer
14
+ * lands at a different on-disk path than the same component installed via another (Code Review
15
+ * Finding, Critical: `install_component` previously skipped this entirely, writing to the
16
+ * unremapped default path even in a project whose `modularcore.json` remaps `paths.lib`, so the
17
+ * CLI's own `diff`/`update` afterward couldn't find what MCP had installed). `init`'s defaults
18
+ * make this a no-op unless the project customized `paths`. Any other target is left untouched.
19
+ */
20
+ export declare function remapTarget(target: string, paths: Record<string, string>): string;
21
+ export interface TrackedWriteError extends Error {
22
+ filesWritten: WriteResult[];
23
+ }
24
+ export declare function isTrackedWriteError(error: unknown): error is TrackedWriteError;
25
+ /**
26
+ * Writes one file at a time (instead of delegating the whole `files[]` array to
27
+ * `writeRegistryEntryFiles` in one call) so that on failure mid-way (disk full, bad
28
+ * target) the caller can report exactly which files were already written instead of an
29
+ * opaque exception — required by the "add interrumpido deja estado consistente" success
30
+ * criterion. Still reuses `writeRegistryEntryFiles` per file for the clamp+decode logic.
31
+ * `files` targets must already be fully resolved (remapped) by the caller if applicable.
32
+ */
33
+ export declare function writeFilesTracked(files: RegistryFileWithContent[], projectRoot: string): Promise<WriteResult[]>;
34
+ //# sourceMappingURL=files.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../src/files.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAElF;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAEzE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAWjF;AAED,MAAM,WAAW,iBAAkB,SAAQ,KAAK;IAC9C,YAAY,EAAE,WAAW,EAAE,CAAC;CAC7B;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,iBAAiB,CAE9E;AAED;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CACrC,KAAK,EAAE,uBAAuB,EAAE,EAChC,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,WAAW,EAAE,CAAC,CAexB"}
package/dist/files.js ADDED
@@ -0,0 +1,61 @@
1
+ import { resolveWriteTargetPath, writeRegistryEntryFiles } from '@modularcore/registry';
2
+ /**
3
+ * Anti-path-traversal clamp: resolves a registry file's `target` onto `cwd`, refusing any
4
+ * path that escapes the project root. Callers that remap conventional target prefixes onto
5
+ * project-specific paths (e.g. `paths.components`/`paths.lib` from `modularcore.json` — see
6
+ * `remapTarget` below) must apply that remap to `fileTarget` themselves before calling this.
7
+ */
8
+ export function resolveTargetPath(cwd, fileTarget) {
9
+ return resolveWriteTargetPath(cwd, fileTarget);
10
+ }
11
+ /**
12
+ * Descriptor authors write conventional targets (`src/components/...`, `src/modularcore/...`);
13
+ * every writer (CLI `add`/`diff`/`update`, MCP server `install_component`) must remap those
14
+ * prefixes onto the project's configured `paths` from its `modularcore.json` before calling
15
+ * `resolveTargetPath`/`writeFilesTracked` — otherwise a component installed via one writer
16
+ * lands at a different on-disk path than the same component installed via another (Code Review
17
+ * Finding, Critical: `install_component` previously skipped this entirely, writing to the
18
+ * unremapped default path even in a project whose `modularcore.json` remaps `paths.lib`, so the
19
+ * CLI's own `diff`/`update` afterward couldn't find what MCP had installed). `init`'s defaults
20
+ * make this a no-op unless the project customized `paths`. Any other target is left untouched.
21
+ */
22
+ export function remapTarget(target, paths) {
23
+ const remaps = [
24
+ ['src/components/', paths.components],
25
+ ['src/modularcore/', paths.lib],
26
+ ];
27
+ for (const [prefix, replacement] of remaps) {
28
+ if (replacement && target.startsWith(prefix)) {
29
+ return `${replacement}/${target.slice(prefix.length)}`;
30
+ }
31
+ }
32
+ return target;
33
+ }
34
+ export function isTrackedWriteError(error) {
35
+ return error instanceof Error && 'filesWritten' in error;
36
+ }
37
+ /**
38
+ * Writes one file at a time (instead of delegating the whole `files[]` array to
39
+ * `writeRegistryEntryFiles` in one call) so that on failure mid-way (disk full, bad
40
+ * target) the caller can report exactly which files were already written instead of an
41
+ * opaque exception — required by the "add interrumpido deja estado consistente" success
42
+ * criterion. Still reuses `writeRegistryEntryFiles` per file for the clamp+decode logic.
43
+ * `files` targets must already be fully resolved (remapped) by the caller if applicable.
44
+ */
45
+ export async function writeFilesTracked(files, projectRoot) {
46
+ const written = [];
47
+ for (const file of files) {
48
+ try {
49
+ const [result] = await writeRegistryEntryFiles({ files: [file] }, projectRoot);
50
+ if (result)
51
+ written.push(result);
52
+ }
53
+ catch (error) {
54
+ const wrapped = new Error(`Fallo escribiendo "${file.target}": ${error.message}`);
55
+ wrapped.filesWritten = written;
56
+ throw wrapped;
57
+ }
58
+ }
59
+ return written;
60
+ }
61
+ //# sourceMappingURL=files.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"files.js","sourceRoot":"","sources":["../src/files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM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sB,IAAI,CAAC,MAAM,MAAO,KAAe,CAAC,OAAO,EAAE,CAC7C,CAAC;YACvB,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC;YAC/B,MAAM,OAAO,CAAC;QAChB,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,7 @@
1
+ export { createRegistryClient } from './registry-client.js';
2
+ export type { RegistryClient } from './registry-client.js';
3
+ export { RegistryClientError } from './errors.js';
4
+ export { isTrackedWriteError, remapTarget, resolveTargetPath, writeFilesTracked } from './files.js';
5
+ export type { TrackedWriteError } from './files.js';
6
+ export type { RegistryEntry, RegistryFileWithContent, RegistryIndexEntry, WriteResult, } from '@modularcore/registry';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpG,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,YAAY,EACV,aAAa,EACb,uBAAuB,EACvB,kBAAkB,EAClB,WAAW,GACZ,MAAM,uBAAuB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ export { createRegistryClient } from './registry-client.js';
2
+ export { RegistryClientError } from './errors.js';
3
+ export { isTrackedWriteError, remapTarget, resolveTargetPath, writeFilesTracked } from './files.js';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAG5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { RegistryEntry, RegistryIndexEntry } from '@modularcore/registry';
2
+ export interface RegistryClient {
3
+ getIndex(): Promise<RegistryIndexEntry[]>;
4
+ getDescriptor(name: string): Promise<RegistryEntry>;
5
+ getTarball(name: string): Promise<Buffer>;
6
+ }
7
+ export declare function createRegistryClient(registryUrl: string): RegistryClient;
8
+ //# sourceMappingURL=registry-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry-client.d.ts","sourceRoot":"","sources":["../src/registry-client.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAuC/E,MAAM,WAAW,cAAc;IAC7B,QAAQ,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC;IAC1C,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IACpD,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC3C;AAED,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,cAAc,CA0CxE"}
@@ -0,0 +1,68 @@
1
+ import { registryEntrySchema, registryIndexEntrySchema } from '@modularcore/registry';
2
+ import { z } from 'zod';
3
+ import { RegistryClientError } from './errors.js';
4
+ const registryIndexSchema = z.array(registryIndexEntrySchema);
5
+ const NOT_GENERATED_HINT = 'Corre `pnpm build:registry` en el repo del registry (o verifica `registryUrl`).';
6
+ function joinUrl(base, path) {
7
+ const trimmedBase = base.endsWith('/') ? base.slice(0, -1) : base;
8
+ return `${trimmedBase}/${path}`;
9
+ }
10
+ async function fetchJson(url, notFoundLabel) {
11
+ let response;
12
+ try {
13
+ response = await fetch(url);
14
+ }
15
+ catch (error) {
16
+ throw new RegistryClientError(`No se pudo conectar con el registry en "${url}": ${error.message}`);
17
+ }
18
+ if (response.status === 404) {
19
+ throw new RegistryClientError(`${notFoundLabel} (404 en "${url}"). ${NOT_GENERATED_HINT}`);
20
+ }
21
+ if (!response.ok) {
22
+ throw new RegistryClientError(`El registry respondió ${response.status} en "${url}". ${NOT_GENERATED_HINT}`);
23
+ }
24
+ const text = await response.text();
25
+ try {
26
+ return JSON.parse(text);
27
+ }
28
+ catch {
29
+ throw new RegistryClientError(`Respuesta no-JSON del registry en "${url}" (¿registry no generado?). ${NOT_GENERATED_HINT}`);
30
+ }
31
+ }
32
+ export function createRegistryClient(registryUrl) {
33
+ return {
34
+ async getIndex() {
35
+ const url = joinUrl(registryUrl, 'index.json');
36
+ const json = await fetchJson(url, 'Índice del registry no encontrado');
37
+ const parsed = registryIndexSchema.safeParse(json);
38
+ if (!parsed.success) {
39
+ throw new RegistryClientError(`El índice del registry en "${url}" no tiene el formato esperado: ${parsed.error.message}`);
40
+ }
41
+ return parsed.data;
42
+ },
43
+ async getDescriptor(name) {
44
+ const url = joinUrl(registryUrl, `${name}.json`);
45
+ const json = await fetchJson(url, `Componente "${name}" no encontrado en el registry`);
46
+ const parsed = registryEntrySchema.safeParse(json);
47
+ if (!parsed.success) {
48
+ throw new RegistryClientError(`El descriptor de "${name}" en "${url}" no es válido: ${parsed.error.message}`);
49
+ }
50
+ return parsed.data;
51
+ },
52
+ async getTarball(name) {
53
+ const url = joinUrl(registryUrl, `${name}.tar.gz`);
54
+ let response;
55
+ try {
56
+ response = await fetch(url);
57
+ }
58
+ catch (error) {
59
+ throw new RegistryClientError(`No se pudo conectar con el registry en "${url}": ${error.message}`);
60
+ }
61
+ if (!response.ok) {
62
+ throw new RegistryClientError(`No se pudo descargar el tarball de "${name}" (${response.status} en "${url}"). ${NOT_GENERATED_HINT}`);
63
+ }
64
+ return Buffer.from(await response.arrayBuffer());
65
+ },
66
+ };
67
+ }
68
+ //# sourceMappingURL=registry-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry-client.js","sourceRoot":"","sources":["../src/registry-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACtF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAIlD,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;AAE9D,MAAM,kBAAkB,GACtB,iFAAiF,CAAC;AAEpF,SAAS,OAAO,CAAC,IAAY,EAAE,IAAY;IACzC,MAAM,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAClE,OAAO,GAAG,WAAW,IAAI,IAAI,EAAE,CAAC;AAClC,CAAC;AAED,KAAK,UAAU,SAAS,CAAC,GAAW,EAAE,aAAqB;IACzD,IAAI,QAAkB,CAAC;IACvB,IAAI,CAAC;QACH,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;IAC9B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,mBAAmB,CAC3B,2CAA2C,GAAG,MAAO,KAAe,CAAC,OAAO,EAAE,CAC/E,CAAC;IACJ,CAAC;IACD,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;QAC5B,MAAM,IAAI,mBAAmB,CAAC,GAAG,aAAa,aAAa,GAAG,OAAO,kBAAkB,EAAE,CAAC,CAAC;IAC7F,CAAC;IACD,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,MAAM,IAAI,mBAAmB,CAC3B,yBAAyB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B,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,CAC/E,CAAC;YACJ,CAAC;YACD,OAAO,MAAM,CAAC,IAAI,CAAC;QACrB,CAAC;QACD,KAAK,CAAC,UAAU,CAAC,IAAY;YAC3B,MAAM,GAAG,GAAG,OAAO,CAAC,WAAW,EAAE,GAAG,IAAI,SAAS,CAAC,CAAC;YACnD,IAAI,QAAkB,CAAC;YACvB,IAAI,CAAC;gBACH,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;YAC9B,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,mBAAmB,CAC3B,2CAA2C,GAAG,MAAO,KAAe,CAAC,OAAO,EAAE,CAC/E,CAAC;YACJ,CAAC;YACD,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;gBACjB,MAAM,IAAI,mBAAmB,CAC3B,uCAAuC,IAAI,MAAM,QAAQ,CAAC,MAAM,QAAQ,GAAG,OAAO,kBAAkB,EAAE,CACvG,CAAC;YACJ,CAAC;YACD,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;QACnD,CAAC;KACF,CAAC;AACJ,CAAC"}
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@modularcore/registry-client",
3
+ "version": "0.3.0",
4
+ "private": false,
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "type": "module",
9
+ "main": "./dist/index.js",
10
+ "types": "./dist/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "default": "./dist/index.js"
15
+ }
16
+ },
17
+ "files": [
18
+ "dist"
19
+ ],
20
+ "dependencies": {
21
+ "zod": "^4.4.3",
22
+ "@modularcore/registry": "0.2.0"
23
+ },
24
+ "devDependencies": {
25
+ "@types/node": "^22.13.0"
26
+ },
27
+ "scripts": {
28
+ "build": "tsc -p tsconfig.json",
29
+ "typecheck": "tsc -p tsconfig.json --noEmit",
30
+ "test": "vitest run"
31
+ }
32
+ }