@telorun/analyzer 0.67.0 → 0.69.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/dist/analysis-registry.d.ts +12 -0
- package/dist/analysis-registry.d.ts.map +1 -1
- package/dist/analysis-registry.js +26 -0
- package/dist/analyzer.d.ts.map +1 -1
- package/dist/analyzer.js +23 -0
- package/dist/call-graph.d.ts +80 -1
- package/dist/call-graph.d.ts.map +1 -1
- package/dist/call-graph.js +145 -12
- package/dist/extends-resolution.d.ts +20 -0
- package/dist/extends-resolution.d.ts.map +1 -1
- package/dist/extends-resolution.js +29 -0
- package/dist/import-resolution-diagnostics.d.ts.map +1 -1
- package/dist/import-resolution-diagnostics.js +22 -8
- package/dist/index.d.ts +8 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -6
- package/dist/invocation-contract.d.ts +20 -0
- package/dist/invocation-contract.d.ts.map +1 -1
- package/dist/invocation-contract.js +74 -0
- package/dist/loaded-types.d.ts +4 -4
- package/dist/loaded-types.d.ts.map +1 -1
- package/dist/manifest-analysis.d.ts +19 -0
- package/dist/manifest-analysis.d.ts.map +1 -1
- package/dist/manifest-analysis.js +27 -0
- package/dist/manifest-loader.d.ts +3 -4
- package/dist/manifest-loader.d.ts.map +1 -1
- package/dist/manifest-loader.js +4 -5
- package/dist/manifest-schemas.d.ts +2 -0
- package/dist/manifest-schemas.d.ts.map +1 -1
- package/dist/manifest-schemas.js +4 -0
- package/dist/module-graph.d.ts +500 -0
- package/dist/module-graph.d.ts.map +1 -0
- package/dist/module-graph.js +1411 -0
- package/dist/reconcile-module-versions.d.ts.map +1 -1
- package/dist/reconcile-module-versions.js +10 -11
- package/dist/release/release-plan.d.ts +1 -1
- package/dist/resolve-zone-containment.d.ts +9 -1
- package/dist/resolve-zone-containment.d.ts.map +1 -1
- package/dist/resolve-zone-containment.js +34 -6
- package/dist/resolve-zone-requirements.d.ts.map +1 -1
- package/dist/resolve-zone-requirements.js +4 -2
- package/dist/schema-keywords.d.ts +16 -1
- package/dist/schema-keywords.d.ts.map +1 -1
- package/dist/schema-keywords.js +20 -0
- package/dist/sources/default-sources.d.ts +6 -6
- package/dist/sources/default-sources.d.ts.map +1 -1
- package/dist/sources/default-sources.js +7 -8
- package/dist/sources/integrity.d.ts +3 -2
- package/dist/sources/integrity.d.ts.map +1 -1
- package/dist/sources/integrity.js +26 -3
- package/dist/sources/versioned-ref.d.ts +17 -12
- package/dist/sources/versioned-ref.d.ts.map +1 -1
- package/dist/sources/versioned-ref.js +22 -24
- package/dist/telo-version.d.ts +1 -1
- package/dist/telo-version.js +1 -1
- package/dist/validate-extends.d.ts.map +1 -1
- package/dist/validate-extends.js +42 -1
- package/dist/validate-sensitive-slots.d.ts +28 -0
- package/dist/validate-sensitive-slots.d.ts.map +1 -0
- package/dist/validate-sensitive-slots.js +75 -0
- package/dist/value-type-keyword.d.ts +1 -1
- package/dist/value-type-keyword.d.ts.map +1 -1
- package/dist/value-type-keyword.js +1 -0
- package/package.json +1 -1
- package/src/analysis-registry.ts +37 -0
- package/src/analyzer.ts +26 -0
- package/src/call-graph.ts +207 -14
- package/src/extends-resolution.ts +33 -0
- package/src/import-resolution-diagnostics.ts +24 -7
- package/src/index.ts +42 -5
- package/src/invocation-contract.ts +71 -0
- package/src/loaded-types.ts +4 -4
- package/src/manifest-analysis.ts +39 -0
- package/src/manifest-loader.ts +4 -5
- package/src/manifest-schemas.ts +4 -0
- package/src/module-graph.ts +2005 -0
- package/src/reconcile-module-versions.ts +10 -11
- package/src/release/release-plan.ts +1 -1
- package/src/resolve-zone-containment.ts +49 -9
- package/src/resolve-zone-requirements.ts +7 -2
- package/src/schema-keywords.ts +33 -1
- package/src/sources/default-sources.ts +7 -8
- package/src/sources/integrity.ts +28 -3
- package/src/sources/versioned-ref.ts +26 -28
- package/src/telo-version.ts +1 -1
- package/src/validate-extends.ts +51 -1
- package/src/validate-sensitive-slots.ts +109 -0
- package/src/value-type-keyword.ts +1 -0
- package/dist/sources/module-ref.d.ts +0 -21
- package/dist/sources/module-ref.d.ts.map +0 -1
- package/dist/sources/module-ref.js +0 -36
- package/dist/sources/registry-source.d.ts +0 -14
- package/dist/sources/registry-source.d.ts.map +0 -1
- package/dist/sources/registry-source.js +0 -45
- package/src/sources/module-ref.ts +0 -49
- package/src/sources/registry-source.ts +0 -52
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type ManifestSource } from "../types.js";
|
|
2
|
-
export declare class RegistrySource implements ManifestSource {
|
|
3
|
-
private registryUrl;
|
|
4
|
-
constructor(registryUrl?: string);
|
|
5
|
-
supports(url: string): boolean;
|
|
6
|
-
read(moduleRef: string): Promise<{
|
|
7
|
-
text: string;
|
|
8
|
-
source: string;
|
|
9
|
-
}>;
|
|
10
|
-
resolveRelative(base: string, relative: string): string;
|
|
11
|
-
private toRegistryModuleBase;
|
|
12
|
-
private toRegistryUrl;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=registry-source.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry-source.d.ts","sourceRoot":"","sources":["../../src/sources/registry-source.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAM7E,qBAAa,cAAe,YAAW,cAAc;IACvC,OAAO,CAAC,WAAW;gBAAX,WAAW,SAAuB;IAEtD,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAIxB,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAuBxE,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM;IAMvD,OAAO,CAAC,oBAAoB;IAM5B,OAAO,CAAC,aAAa;CAGtB"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { DEFAULT_MANIFEST_FILENAME } from "../types.js";
|
|
2
|
-
import { splitIntegrity, verifiedFetch } from "./integrity.js";
|
|
3
|
-
import { isRegistryRef, parseModuleRef } from "./module-ref.js";
|
|
4
|
-
const DEFAULT_REGISTRY_URL = "https://registry.telo.run";
|
|
5
|
-
export class RegistrySource {
|
|
6
|
-
registryUrl;
|
|
7
|
-
constructor(registryUrl = DEFAULT_REGISTRY_URL) {
|
|
8
|
-
this.registryUrl = registryUrl;
|
|
9
|
-
}
|
|
10
|
-
supports(url) {
|
|
11
|
-
return isRegistryRef(url);
|
|
12
|
-
}
|
|
13
|
-
async read(moduleRef) {
|
|
14
|
-
const { base, integrity } = splitIntegrity(moduleRef);
|
|
15
|
-
const fetchUrl = this.toRegistryUrl(base);
|
|
16
|
-
const { text } = await verifiedFetch(fetchUrl, integrity, base);
|
|
17
|
-
// Some object-storage backends (e.g. Cloudflare R2 / S3) surface auth or
|
|
18
|
-
// permission failures by returning a 200 status with an XML error body.
|
|
19
|
-
// Catch this here so the loader produces a precise error rather than
|
|
20
|
-
// silently parsing the XML as YAML and reporting a downstream UNDEFINED_KIND.
|
|
21
|
-
if (text.trimStart().startsWith("<?xml") || text.trimStart().startsWith("<Error")) {
|
|
22
|
-
const codeMatch = text.match(/<Code>([^<]+)<\/Code>/);
|
|
23
|
-
const messageMatch = text.match(/<Message>([^<]+)<\/Message>/);
|
|
24
|
-
const detail = codeMatch && messageMatch
|
|
25
|
-
? `${codeMatch[1]}: ${messageMatch[1]}`
|
|
26
|
-
: text.slice(0, 200);
|
|
27
|
-
throw new Error(`Registry returned a non-manifest response for ${base} ` +
|
|
28
|
-
`(URL: ${fetchUrl}): ${detail}`);
|
|
29
|
-
}
|
|
30
|
-
return { text, source: fetchUrl };
|
|
31
|
-
}
|
|
32
|
-
resolveRelative(base, relative) {
|
|
33
|
-
const baseUrl = this.supports(base) ? this.toRegistryModuleBase(base) : base;
|
|
34
|
-
const baseWithSlash = baseUrl.endsWith("/") ? baseUrl : `${baseUrl}/`;
|
|
35
|
-
return new URL(relative, baseWithSlash).href;
|
|
36
|
-
}
|
|
37
|
-
toRegistryModuleBase(moduleRef) {
|
|
38
|
-
const parsed = parseModuleRef(moduleRef);
|
|
39
|
-
const normalizedBase = this.registryUrl.replace(/\/+$/, "");
|
|
40
|
-
return `${normalizedBase}/${parsed.modulePath}/${parsed.version}`;
|
|
41
|
-
}
|
|
42
|
-
toRegistryUrl(moduleRef) {
|
|
43
|
-
return `${this.toRegistryModuleBase(moduleRef)}/${DEFAULT_MANIFEST_FILENAME}`;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { splitIntegrity } from "./integrity.js";
|
|
2
|
-
|
|
3
|
-
/** A parsed registry module reference. `modulePath` is `namespace/name`,
|
|
4
|
-
* `version` has any leading `v` stripped, and `integrity` carries the inline
|
|
5
|
-
* `sha256-<base64url>` hash when the ref was pinned. */
|
|
6
|
-
export interface ParsedModuleRef {
|
|
7
|
-
modulePath: string;
|
|
8
|
-
version: string;
|
|
9
|
-
integrity?: string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/** True when `url` has the bare registry-ref shape `namespace/name@version`
|
|
13
|
-
* (no scheme of any kind, no leading `/` or `.`, contains both `@` and `/`).
|
|
14
|
-
* The integrity fragment, if any, does not affect the classification.
|
|
15
|
-
*
|
|
16
|
-
* A registry ref never carries a `scheme://` — that guard is what keeps an
|
|
17
|
-
* `oci://…@ver` (or future `s3://…`) ref from being misrouted here, so a
|
|
18
|
-
* scheme-owning transport claims it instead. */
|
|
19
|
-
export function isRegistryRef(url: string): boolean {
|
|
20
|
-
const { base } = splitIntegrity(url);
|
|
21
|
-
return (
|
|
22
|
-
!base.includes("://") &&
|
|
23
|
-
!base.startsWith("/") &&
|
|
24
|
-
!base.startsWith(".") &&
|
|
25
|
-
base.includes("@") &&
|
|
26
|
-
base.includes("/")
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/** Canonical parser for `namespace/name@version[#sha256-...]` refs. The single
|
|
31
|
-
* source of truth shared by the registry source, the kernel manifest cache,
|
|
32
|
-
* and the CLI (install / upgrade / bundle). Throws on a malformed ref. */
|
|
33
|
-
export function parseModuleRef(ref: string): ParsedModuleRef {
|
|
34
|
-
const { base, integrity } = splitIntegrity(ref);
|
|
35
|
-
const atIdx = base.lastIndexOf("@");
|
|
36
|
-
if (atIdx <= 0 || atIdx === base.length - 1) {
|
|
37
|
-
throw new Error(`Invalid module reference '${ref}', expected namespace/name@version`);
|
|
38
|
-
}
|
|
39
|
-
const modulePath = base.slice(0, atIdx);
|
|
40
|
-
if (!modulePath.includes("/")) {
|
|
41
|
-
throw new Error(`Invalid module reference '${ref}', expected namespace/name@version`);
|
|
42
|
-
}
|
|
43
|
-
const rawVersion = base.slice(atIdx + 1);
|
|
44
|
-
const version = rawVersion.startsWith("v") ? rawVersion.slice(1) : rawVersion;
|
|
45
|
-
if (!version) {
|
|
46
|
-
throw new Error(`Invalid module reference '${ref}', expected namespace/name@version`);
|
|
47
|
-
}
|
|
48
|
-
return { modulePath, version, integrity };
|
|
49
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { DEFAULT_MANIFEST_FILENAME, type ManifestSource } from "../types.js";
|
|
2
|
-
import { splitIntegrity, verifiedFetch } from "./integrity.js";
|
|
3
|
-
import { isRegistryRef, parseModuleRef } from "./module-ref.js";
|
|
4
|
-
|
|
5
|
-
const DEFAULT_REGISTRY_URL = "https://registry.telo.run";
|
|
6
|
-
|
|
7
|
-
export class RegistrySource implements ManifestSource {
|
|
8
|
-
constructor(private registryUrl = DEFAULT_REGISTRY_URL) {}
|
|
9
|
-
|
|
10
|
-
supports(url: string): boolean {
|
|
11
|
-
return isRegistryRef(url);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
async read(moduleRef: string): Promise<{ text: string; source: string }> {
|
|
15
|
-
const { base, integrity } = splitIntegrity(moduleRef);
|
|
16
|
-
const fetchUrl = this.toRegistryUrl(base);
|
|
17
|
-
const { text } = await verifiedFetch(fetchUrl, integrity, base);
|
|
18
|
-
// Some object-storage backends (e.g. Cloudflare R2 / S3) surface auth or
|
|
19
|
-
// permission failures by returning a 200 status with an XML error body.
|
|
20
|
-
// Catch this here so the loader produces a precise error rather than
|
|
21
|
-
// silently parsing the XML as YAML and reporting a downstream UNDEFINED_KIND.
|
|
22
|
-
if (text.trimStart().startsWith("<?xml") || text.trimStart().startsWith("<Error")) {
|
|
23
|
-
const codeMatch = text.match(/<Code>([^<]+)<\/Code>/);
|
|
24
|
-
const messageMatch = text.match(/<Message>([^<]+)<\/Message>/);
|
|
25
|
-
const detail =
|
|
26
|
-
codeMatch && messageMatch
|
|
27
|
-
? `${codeMatch[1]}: ${messageMatch[1]}`
|
|
28
|
-
: text.slice(0, 200);
|
|
29
|
-
throw new Error(
|
|
30
|
-
`Registry returned a non-manifest response for ${base} ` +
|
|
31
|
-
`(URL: ${fetchUrl}): ${detail}`,
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
return { text, source: fetchUrl };
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
resolveRelative(base: string, relative: string): string {
|
|
38
|
-
const baseUrl = this.supports(base) ? this.toRegistryModuleBase(base) : base;
|
|
39
|
-
const baseWithSlash = baseUrl.endsWith("/") ? baseUrl : `${baseUrl}/`;
|
|
40
|
-
return new URL(relative, baseWithSlash).href;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
private toRegistryModuleBase(moduleRef: string): string {
|
|
44
|
-
const parsed = parseModuleRef(moduleRef);
|
|
45
|
-
const normalizedBase = this.registryUrl.replace(/\/+$/, "");
|
|
46
|
-
return `${normalizedBase}/${parsed.modulePath}/${parsed.version}`;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
private toRegistryUrl(moduleRef: string): string {
|
|
50
|
-
return `${this.toRegistryModuleBase(moduleRef)}/${DEFAULT_MANIFEST_FILENAME}`;
|
|
51
|
-
}
|
|
52
|
-
}
|