@telorun/kernel 0.58.0 → 0.60.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/bundle/files-integrity.d.ts +21 -12
- package/dist/bundle/files-integrity.d.ts.map +1 -1
- package/dist/bundle/files-integrity.js +27 -14
- package/dist/bundle/files-integrity.js.map +1 -1
- package/dist/bundle/module-artifact.d.ts +134 -0
- package/dist/bundle/module-artifact.d.ts.map +1 -0
- package/dist/bundle/module-artifact.js +300 -0
- package/dist/bundle/module-artifact.js.map +1 -0
- package/dist/bundle/module-manifest.d.ts +12 -4
- package/dist/bundle/module-manifest.d.ts.map +1 -1
- package/dist/bundle/module-manifest.js +8 -4
- package/dist/bundle/module-manifest.js.map +1 -1
- package/dist/controller-loader.d.ts +3 -2
- package/dist/controller-loader.d.ts.map +1 -1
- package/dist/controller-loader.js +8 -8
- package/dist/controller-loader.js.map +1 -1
- package/dist/controller-loaders/bundle-loader.d.ts +8 -6
- package/dist/controller-loaders/bundle-loader.d.ts.map +1 -1
- package/dist/controller-loaders/bundle-loader.js +52 -13
- package/dist/controller-loaders/bundle-loader.js.map +1 -1
- package/dist/controller-loaders/npm-loader.d.ts +0 -18
- package/dist/controller-loaders/npm-loader.d.ts.map +1 -1
- package/dist/controller-loaders/npm-loader.js +3 -190
- package/dist/controller-loaders/npm-loader.js.map +1 -1
- package/dist/controllers/resource-definition/resource-definition-controller.d.ts.map +1 -1
- package/dist/controllers/resource-definition/resource-definition-controller.js +6 -1
- package/dist/controllers/resource-definition/resource-definition-controller.js.map +1 -1
- package/dist/directory-lock.d.ts +27 -0
- package/dist/directory-lock.d.ts.map +1 -0
- package/dist/directory-lock.js +205 -0
- package/dist/directory-lock.js.map +1 -0
- package/dist/evaluation-context.d.ts.map +1 -1
- package/dist/evaluation-context.js +20 -6
- package/dist/evaluation-context.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/kernel.d.ts +32 -0
- package/dist/kernel.d.ts.map +1 -1
- package/dist/kernel.js +55 -1
- package/dist/kernel.js.map +1 -1
- package/dist/manifest-sources/local-manifest-cache-source.d.ts +1 -1
- package/dist/manifest-sources/local-manifest-cache-source.d.ts.map +1 -1
- package/dist/manifest-sources/local-manifest-cache-source.js +1 -1
- package/dist/manifest-sources/local-manifest-cache-source.js.map +1 -1
- package/dist/resource-context.d.ts +18 -0
- package/dist/resource-context.d.ts.map +1 -1
- package/dist/resource-context.js +72 -1
- package/dist/resource-context.js.map +1 -1
- package/dist/transports/oci/oci-client.d.ts +28 -1
- package/dist/transports/oci/oci-client.d.ts.map +1 -1
- package/dist/transports/oci/oci-client.js +24 -1
- package/dist/transports/oci/oci-client.js.map +1 -1
- package/dist/transports/oci/oci-transport.d.ts +20 -14
- package/dist/transports/oci/oci-transport.d.ts.map +1 -1
- package/dist/transports/oci/oci-transport.js +105 -46
- package/dist/transports/oci/oci-transport.js.map +1 -1
- package/dist/transports/registry-transport.d.ts +7 -2
- package/dist/transports/registry-transport.d.ts.map +1 -1
- package/dist/transports/registry-transport.js +8 -33
- package/dist/transports/registry-transport.js.map +1 -1
- package/dist/transports/transport-registry.d.ts +5 -4
- package/dist/transports/transport-registry.d.ts.map +1 -1
- package/dist/transports/transport-registry.js +4 -4
- package/dist/transports/transport-registry.js.map +1 -1
- package/dist/transports/transport.d.ts +27 -19
- package/dist/transports/transport.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/bundle/files-integrity.ts +34 -14
- package/src/bundle/module-artifact.ts +375 -0
- package/src/bundle/module-manifest.ts +22 -6
- package/src/controller-loader.ts +9 -4
- package/src/controller-loaders/bundle-loader.ts +57 -11
- package/src/controller-loaders/npm-loader.ts +3 -209
- package/src/controllers/resource-definition/resource-definition-controller.ts +19 -0
- package/src/directory-lock.ts +225 -0
- package/src/evaluation-context.ts +17 -7
- package/src/index.ts +10 -2
- package/src/kernel.ts +66 -0
- package/src/manifest-sources/local-manifest-cache-source.ts +1 -1
- package/src/resource-context.ts +78 -1
- package/src/transports/oci/oci-client.ts +32 -1
- package/src/transports/oci/oci-transport.ts +122 -51
- package/src/transports/registry-transport.ts +10 -38
- package/src/transports/transport-registry.ts +5 -5
- package/src/transports/transport.ts +32 -19
|
@@ -1,24 +1,31 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
ArtifactSelector,
|
|
3
|
+
LayerRole,
|
|
4
|
+
ManifestCacheCoords,
|
|
5
|
+
ManifestSource,
|
|
6
|
+
} from "@telorun/analyzer";
|
|
2
7
|
|
|
3
8
|
import type { PayloadFile } from "../bundle/files-integrity.js";
|
|
4
9
|
|
|
5
|
-
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
/** One layer of a module artifact as the CLI partitioned it, before publish
|
|
11
|
+
* assigns digests. `role` / `selector` become the layer's entry in the
|
|
12
|
+
* published `layers:` index. */
|
|
13
|
+
export interface PayloadLayer {
|
|
14
|
+
role: LayerRole;
|
|
15
|
+
/** Present on `controller` layers only. */
|
|
16
|
+
selector?: ArtifactSelector;
|
|
11
17
|
files: PayloadFile[];
|
|
12
18
|
}
|
|
13
19
|
|
|
14
20
|
/** The module bundle handed to a transport for publishing: the final,
|
|
15
|
-
* already-analyzed / pinned / canonicalized `telo.yaml` bytes plus the
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
21
|
+
* already-analyzed / pinned / canonicalized `telo.yaml` bytes plus the payload
|
|
22
|
+
* partitioned into layers (empty for a manifest-only module). The transport
|
|
23
|
+
* pushes each layer as its own blob, injects the resulting `layers:` index into
|
|
24
|
+
* the manifest, and only then pushes the manifest layer — the order that keeps
|
|
25
|
+
* the index non-circular. */
|
|
19
26
|
export interface PublishBundle {
|
|
20
27
|
manifest: string;
|
|
21
|
-
|
|
28
|
+
layers: PayloadLayer[];
|
|
22
29
|
}
|
|
23
30
|
|
|
24
31
|
export interface PublishResult {
|
|
@@ -52,8 +59,8 @@ export interface PublishOptions {
|
|
|
52
59
|
* `ManifestSource` is the browser-safe resolution primitive (also implemented
|
|
53
60
|
* by the cache / local / memory sources, which have no versions and nothing to
|
|
54
61
|
* publish), so it stays in `analyzer`, while the Node-only management methods
|
|
55
|
-
* (`cacheCoords
|
|
56
|
-
*
|
|
62
|
+
* (`cacheCoords`, `listVersions`, `fetchLayer`, `publish`) live on the Transport
|
|
63
|
+
* here in `kernel`. */
|
|
57
64
|
export interface Transport {
|
|
58
65
|
/** True when this transport owns the given ref (or publish destination). */
|
|
59
66
|
supports(ref: string): boolean;
|
|
@@ -102,11 +109,17 @@ export interface Transport {
|
|
|
102
109
|
* ref. Used by `telo upgrade`. */
|
|
103
110
|
withVersion(ref: string, version: string): string;
|
|
104
111
|
|
|
105
|
-
/**
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
* the
|
|
109
|
-
|
|
112
|
+
/** Pull **one** layer of `ref`'s artifact, addressed by the `blob` digest its
|
|
113
|
+
* entry in the pinned `layers:` index carries, and return its decompressed
|
|
114
|
+
* files. Addressing by digest is what keeps the untrusted OCI manifest out of
|
|
115
|
+
* the path: only the *manifest* layer is located through it, and those bytes
|
|
116
|
+
* are then checked against the import pin, so tampering is caught before any
|
|
117
|
+
* index is read. Content verification against the entry's `integrity` is the
|
|
118
|
+
* caller's (the artifact handle's), since only it knows the expected value.
|
|
119
|
+
*
|
|
120
|
+
* Throws when the transport cannot deliver payload layers at all — a module
|
|
121
|
+
* with a payload is an OCI artifact, and no other transport publishes one. */
|
|
122
|
+
fetchLayer(ref: string, blobDigest: string): Promise<PayloadFile[]>;
|
|
110
123
|
|
|
111
124
|
/** Cheap content-identity digest of what `ref` currently resolves to — no
|
|
112
125
|
* payload download. Opaque and transport-specific (OCI: the image manifest's
|