@telorun/cli 0.46.0 → 0.48.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.
@@ -1,10 +1,16 @@
1
1
  /**
2
2
  * Fetch a remote import's published `telo.yaml` and return its integrity hash
3
- * (`sha256-<base64url>`). Builds the URL exactly as `RegistrySource` does and
4
- * hashes the raw response bytes, so the value matches what the consumer's
5
- * `read()` verifies. Used by `telo publish` (import pinning) and `telo upgrade`
6
- * (re-pin on version change). Throws when the ref is not remote or the fetch
7
- * fails — callers decide whether that is fatal (`--frozen`) or best-effort.
3
+ * (`sha256-<base64url>`). Used by `telo publish` (import pinning) and `telo
4
+ * upgrade` (re-pin on version change). Throws when no transport owns the ref or
5
+ * the fetch fails callers decide whether that is fatal (`--frozen`) or
6
+ * best-effort.
7
+ *
8
+ * Dispatch is the transport registry, never a scheme branch here: each
9
+ * transport hashes exactly what its own `read()` verifies (registry/HTTP the
10
+ * raw bytes, OCI the UTF-8 text extracted from the tar layer), so a pin written
11
+ * at publish always matches at import. A caller-side branch cannot know which,
12
+ * and silently degrades the moment a transport is added — that is precisely how
13
+ * `oci://` refs came to be published unpinned.
8
14
  */
9
15
  export declare function fetchManifestHash(registryUrl: string, ref: string): Promise<string>;
10
16
  //# sourceMappingURL=registry-hash.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"registry-hash.d.ts","sourceRoot":"","sources":["../src/registry-hash.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAiBzF"}
1
+ {"version":3,"file":"registry-hash.d.ts","sourceRoot":"","sources":["../src/registry-hash.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,wBAAsB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAMzF"}
@@ -1,30 +1,23 @@
1
- import { isRegistryRef, parseModuleRef, sha256Base64Url } from "@telorun/analyzer";
1
+ import { defaultTransportRegistry } from "@telorun/kernel";
2
2
  /**
3
3
  * Fetch a remote import's published `telo.yaml` and return its integrity hash
4
- * (`sha256-<base64url>`). Builds the URL exactly as `RegistrySource` does and
5
- * hashes the raw response bytes, so the value matches what the consumer's
6
- * `read()` verifies. Used by `telo publish` (import pinning) and `telo upgrade`
7
- * (re-pin on version change). Throws when the ref is not remote or the fetch
8
- * fails — callers decide whether that is fatal (`--frozen`) or best-effort.
4
+ * (`sha256-<base64url>`). Used by `telo publish` (import pinning) and `telo
5
+ * upgrade` (re-pin on version change). Throws when no transport owns the ref or
6
+ * the fetch fails callers decide whether that is fatal (`--frozen`) or
7
+ * best-effort.
8
+ *
9
+ * Dispatch is the transport registry, never a scheme branch here: each
10
+ * transport hashes exactly what its own `read()` verifies (registry/HTTP the
11
+ * raw bytes, OCI the UTF-8 text extracted from the tar layer), so a pin written
12
+ * at publish always matches at import. A caller-side branch cannot know which,
13
+ * and silently degrades the moment a transport is added — that is precisely how
14
+ * `oci://` refs came to be published unpinned.
9
15
  */
10
16
  export async function fetchManifestHash(registryUrl, ref) {
11
- const trimmed = registryUrl.replace(/\/+$/, "");
12
- let url;
13
- if (isRegistryRef(ref)) {
14
- const { modulePath, version } = parseModuleRef(ref);
15
- url = `${trimmed}/${modulePath}/${version}/telo.yaml`;
16
- }
17
- else if (ref.startsWith("http://") || ref.startsWith("https://")) {
18
- url = ref.includes(".yaml") ? ref : `${ref.replace(/\/+$/, "")}/telo.yaml`;
19
- }
20
- else {
17
+ const transport = defaultTransportRegistry(registryUrl).forRef(ref);
18
+ if (!transport) {
21
19
  throw new Error(`cannot hash non-remote import '${ref}'`);
22
20
  }
23
- const res = await fetch(url);
24
- if (!res.ok) {
25
- throw new Error(`fetch ${url}: ${res.status} ${res.statusText}`);
26
- }
27
- const bytes = new Uint8Array(await res.arrayBuffer());
28
- return `sha256-${await sha256Base64Url(bytes)}`;
21
+ return transport.manifestHash(ref);
29
22
  }
30
23
  //# sourceMappingURL=registry-hash.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"registry-hash.js","sourceRoot":"","sources":["../src/registry-hash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEnF;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,WAAmB,EAAE,GAAW;IACtE,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAChD,IAAI,GAAW,CAAC;IAChB,IAAI,aAAa,CAAC,GAAG,CAAC,EAAE,CAAC;QACvB,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;QACpD,GAAG,GAAG,GAAG,OAAO,IAAI,UAAU,IAAI,OAAO,YAAY,CAAC;IACxD,CAAC;SAAM,IAAI,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QACnE,GAAG,GAAG,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC;IAC7E,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CAAC,kCAAkC,GAAG,GAAG,CAAC,CAAC;IAC5D,CAAC;IACD,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;IAC7B,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,SAAS,GAAG,KAAK,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC;IACnE,CAAC;IACD,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC;IACtD,OAAO,UAAU,MAAM,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;AAClD,CAAC"}
1
+ {"version":3,"file":"registry-hash.js","sourceRoot":"","sources":["../src/registry-hash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAE3D;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,WAAmB,EAAE,GAAW;IACtE,MAAM,SAAS,GAAG,wBAAwB,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACpE,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,kCAAkC,GAAG,GAAG,CAAC,CAAC;IAC5D,CAAC;IACD,OAAO,SAAS,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;AACrC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telorun/cli",
3
- "version": "0.46.0",
3
+ "version": "0.48.0",
4
4
  "description": "Telo CLI - Command-line interface for the Telo runtime.",
5
5
  "keywords": [
6
6
  "telo",
@@ -34,11 +34,11 @@
34
34
  "dist"
35
35
  ],
36
36
  "dependencies": {
37
- "@telorun/analyzer": "0.36.0",
37
+ "@telorun/analyzer": "0.38.0",
38
38
  "@telorun/glob": "0.2.0",
39
- "@telorun/ide-support": "0.4.42",
40
- "@telorun/kernel": "0.46.0",
41
- "@telorun/sdk": "0.44.0",
39
+ "@telorun/ide-support": "0.4.44",
40
+ "@telorun/kernel": "0.48.0",
41
+ "@telorun/sdk": "0.48.0",
42
42
  "@telorun/templating": "0.10.1",
43
43
  "dotenv": "^17.4.0",
44
44
  "packageurl-js": "^2.0.1",