@telorun/analyzer 0.37.0 → 0.38.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 +14 -0
- package/dist/analysis-registry.d.ts.map +1 -1
- package/dist/analysis-registry.js +17 -0
- package/dist/builtins.d.ts.map +1 -1
- package/dist/builtins.js +23 -0
- package/package.json +2 -2
- package/src/analysis-registry.ts +20 -0
- package/src/builtins.ts +24 -0
|
@@ -96,6 +96,20 @@ export declare class AnalysisRegistry {
|
|
|
96
96
|
*/
|
|
97
97
|
builtinDefinitions(): ResourceDefinition[];
|
|
98
98
|
resolveDefinition(kind: string): ResourceDefinition | undefined;
|
|
99
|
+
/** A resolver scoped to `def`'s OWN module, for resolving that definition's
|
|
100
|
+
* `extends` target.
|
|
101
|
+
*
|
|
102
|
+
* `extends` aliases are lexically scoped to the declaring library — a library
|
|
103
|
+
* writes `extends: Cache.Store` against its own import map, and `Self.Host`
|
|
104
|
+
* against its own module name. The global alias table knows neither, so
|
|
105
|
+
* {@link resolveDefinition} silently returns undefined for them and callers
|
|
106
|
+
* fall back to an un-inherited view. Mirrors the module-scope selection in
|
|
107
|
+
* `expandedFieldMapForResource`. */
|
|
108
|
+
resolverForDefinition(def: {
|
|
109
|
+
metadata?: {
|
|
110
|
+
module?: string;
|
|
111
|
+
};
|
|
112
|
+
}): (kind: string) => ResourceDefinition | undefined;
|
|
99
113
|
/** Canonical kinds (`module.Name`) of every definition that extends the given
|
|
100
114
|
* abstract kind — the concrete implementations a caller may instantiate in
|
|
101
115
|
* its place. Empty when `kind` is not an abstract or has no implementations. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analysis-registry.d.ts","sourceRoot":"","sources":["../src/analysis-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAKzE,OAAO,EAAqC,KAAK,eAAe,EAAE,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AM,EAAE;IAIhC;wEACoE;IACpE,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAIhD;;;;;;;;iDAQ6C;IAC7C,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,SAAS;IAqB9D;;;;;gEAK4D;IAC5D,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS;IAiB7D,qFAAqF;IACrF,QAAQ,IAAI,eAAe;CAG5B"}
|
|
@@ -178,6 +178,23 @@ export class AnalysisRegistry {
|
|
|
178
178
|
const resolved = ctx.aliases?.resolveKind(kind);
|
|
179
179
|
return ctx.definitions?.resolve(kind) ?? (resolved ? ctx.definitions?.resolve(resolved) : undefined);
|
|
180
180
|
}
|
|
181
|
+
/** A resolver scoped to `def`'s OWN module, for resolving that definition's
|
|
182
|
+
* `extends` target.
|
|
183
|
+
*
|
|
184
|
+
* `extends` aliases are lexically scoped to the declaring library — a library
|
|
185
|
+
* writes `extends: Cache.Store` against its own import map, and `Self.Host`
|
|
186
|
+
* against its own module name. The global alias table knows neither, so
|
|
187
|
+
* {@link resolveDefinition} silently returns undefined for them and callers
|
|
188
|
+
* fall back to an un-inherited view. Mirrors the module-scope selection in
|
|
189
|
+
* `expandedFieldMapForResource`. */
|
|
190
|
+
resolverForDefinition(def) {
|
|
191
|
+
const ownModule = def?.metadata?.module;
|
|
192
|
+
const scope = (ownModule ? this.aliasesByModule.get(ownModule) : undefined) ?? this.aliases;
|
|
193
|
+
return (kind) => {
|
|
194
|
+
const canonical = scope.resolveKind(kind);
|
|
195
|
+
return this.defs.resolve(kind) ?? (canonical ? this.defs.resolve(canonical) : undefined);
|
|
196
|
+
};
|
|
197
|
+
}
|
|
181
198
|
/** Canonical kinds (`module.Name`) of every definition that extends the given
|
|
182
199
|
* abstract kind — the concrete implementations a caller may instantiate in
|
|
183
200
|
* its place. Empty when `kind` is not an abstract or has no implementations. */
|
package/dist/builtins.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builtins.d.ts","sourceRoot":"","sources":["../src/builtins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"builtins.d.ts","sourceRoot":"","sources":["../src/builtins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAwBvD,eAAO,MAAM,eAAe,EAAE,kBAAkB,EAyjB/C,CAAC"}
|
package/dist/builtins.js
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
/** Descriptive provenance a module declares about itself, shared by
|
|
2
|
+
* `Telo.Application` and `Telo.Library`.
|
|
3
|
+
*
|
|
4
|
+
* These are *descriptive*, never *addressing* — nothing resolves, fetches,
|
|
5
|
+
* caches, or publishes based on them, so they do not conflict with
|
|
6
|
+
* identity-is-the-ref (which bans metadata from determining an artifact's
|
|
7
|
+
* location). `repository` is the location of the module's **source code**, in
|
|
8
|
+
* the same spirit as npm's `repository` / `license` / `homepage`. It is named
|
|
9
|
+
* `repository` rather than `source` because `source:` already means "where to
|
|
10
|
+
* fetch a dependency from" in the `imports` map.
|
|
11
|
+
*
|
|
12
|
+
* A publish transport projects these into whatever its backend surfaces —
|
|
13
|
+
* OCI maps them onto the standard `org.opencontainers.image.*` annotations;
|
|
14
|
+
* the HTTP registry stores the manifest verbatim, so they are preserved as
|
|
15
|
+
* declared with nothing to translate. */
|
|
16
|
+
const PROVENANCE_METADATA = {
|
|
17
|
+
description: { type: "string" },
|
|
18
|
+
repository: { type: "string" },
|
|
19
|
+
license: { type: "string" },
|
|
20
|
+
documentation: { type: "string" },
|
|
21
|
+
};
|
|
1
22
|
export const KERNEL_BUILTINS = [
|
|
2
23
|
{ kind: "Telo.Abstract", metadata: { name: "Template", module: "Telo" } },
|
|
3
24
|
{ kind: "Telo.Abstract", metadata: { name: "Runnable", module: "Telo" } },
|
|
@@ -269,6 +290,7 @@ export const KERNEL_BUILTINS = [
|
|
|
269
290
|
version: { type: "string" },
|
|
270
291
|
source: { type: "string" },
|
|
271
292
|
module: { type: "string" },
|
|
293
|
+
...PROVENANCE_METADATA,
|
|
272
294
|
},
|
|
273
295
|
required: ["name"],
|
|
274
296
|
additionalProperties: true,
|
|
@@ -495,6 +517,7 @@ export const KERNEL_BUILTINS = [
|
|
|
495
517
|
version: { type: "string" },
|
|
496
518
|
source: { type: "string" },
|
|
497
519
|
module: { type: "string" },
|
|
520
|
+
...PROVENANCE_METADATA,
|
|
498
521
|
},
|
|
499
522
|
required: ["name"],
|
|
500
523
|
additionalProperties: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telorun/analyzer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.38.0",
|
|
4
4
|
"description": "Telo Analyzer - Static manifest validator for Telo manifests.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"telo",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@types/node": "^20.0.0",
|
|
49
49
|
"typescript": "^5.0.0",
|
|
50
50
|
"vitest": "^2.1.8",
|
|
51
|
-
"@telorun/sdk": "0.
|
|
51
|
+
"@telorun/sdk": "0.48.0"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"@telorun/sdk": "*"
|
package/src/analysis-registry.ts
CHANGED
|
@@ -218,6 +218,26 @@ export class AnalysisRegistry {
|
|
|
218
218
|
return ctx.definitions?.resolve(kind) ?? (resolved ? ctx.definitions?.resolve(resolved) : undefined);
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
+
/** A resolver scoped to `def`'s OWN module, for resolving that definition's
|
|
222
|
+
* `extends` target.
|
|
223
|
+
*
|
|
224
|
+
* `extends` aliases are lexically scoped to the declaring library — a library
|
|
225
|
+
* writes `extends: Cache.Store` against its own import map, and `Self.Host`
|
|
226
|
+
* against its own module name. The global alias table knows neither, so
|
|
227
|
+
* {@link resolveDefinition} silently returns undefined for them and callers
|
|
228
|
+
* fall back to an un-inherited view. Mirrors the module-scope selection in
|
|
229
|
+
* `expandedFieldMapForResource`. */
|
|
230
|
+
resolverForDefinition(def: {
|
|
231
|
+
metadata?: { module?: string };
|
|
232
|
+
}): (kind: string) => ResourceDefinition | undefined {
|
|
233
|
+
const ownModule = def?.metadata?.module;
|
|
234
|
+
const scope = (ownModule ? this.aliasesByModule.get(ownModule) : undefined) ?? this.aliases;
|
|
235
|
+
return (kind) => {
|
|
236
|
+
const canonical = scope.resolveKind(kind);
|
|
237
|
+
return this.defs.resolve(kind) ?? (canonical ? this.defs.resolve(canonical) : undefined);
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
|
|
221
241
|
/** Canonical kinds (`module.Name`) of every definition that extends the given
|
|
222
242
|
* abstract kind — the concrete implementations a caller may instantiate in
|
|
223
243
|
* its place. Empty when `kind` is not an abstract or has no implementations. */
|
package/src/builtins.ts
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
import type { ResourceDefinition } from "@telorun/sdk";
|
|
2
2
|
|
|
3
|
+
/** Descriptive provenance a module declares about itself, shared by
|
|
4
|
+
* `Telo.Application` and `Telo.Library`.
|
|
5
|
+
*
|
|
6
|
+
* These are *descriptive*, never *addressing* — nothing resolves, fetches,
|
|
7
|
+
* caches, or publishes based on them, so they do not conflict with
|
|
8
|
+
* identity-is-the-ref (which bans metadata from determining an artifact's
|
|
9
|
+
* location). `repository` is the location of the module's **source code**, in
|
|
10
|
+
* the same spirit as npm's `repository` / `license` / `homepage`. It is named
|
|
11
|
+
* `repository` rather than `source` because `source:` already means "where to
|
|
12
|
+
* fetch a dependency from" in the `imports` map.
|
|
13
|
+
*
|
|
14
|
+
* A publish transport projects these into whatever its backend surfaces —
|
|
15
|
+
* OCI maps them onto the standard `org.opencontainers.image.*` annotations;
|
|
16
|
+
* the HTTP registry stores the manifest verbatim, so they are preserved as
|
|
17
|
+
* declared with nothing to translate. */
|
|
18
|
+
const PROVENANCE_METADATA = {
|
|
19
|
+
description: { type: "string" },
|
|
20
|
+
repository: { type: "string" },
|
|
21
|
+
license: { type: "string" },
|
|
22
|
+
documentation: { type: "string" },
|
|
23
|
+
};
|
|
24
|
+
|
|
3
25
|
export const KERNEL_BUILTINS: ResourceDefinition[] = [
|
|
4
26
|
{ kind: "Telo.Abstract", metadata: { name: "Template", module: "Telo" } },
|
|
5
27
|
{ kind: "Telo.Abstract", metadata: { name: "Runnable", module: "Telo" } },
|
|
@@ -271,6 +293,7 @@ export const KERNEL_BUILTINS: ResourceDefinition[] = [
|
|
|
271
293
|
version: { type: "string" },
|
|
272
294
|
source: { type: "string" },
|
|
273
295
|
module: { type: "string" },
|
|
296
|
+
...PROVENANCE_METADATA,
|
|
274
297
|
},
|
|
275
298
|
required: ["name"],
|
|
276
299
|
additionalProperties: true,
|
|
@@ -497,6 +520,7 @@ export const KERNEL_BUILTINS: ResourceDefinition[] = [
|
|
|
497
520
|
version: { type: "string" },
|
|
498
521
|
source: { type: "string" },
|
|
499
522
|
module: { type: "string" },
|
|
523
|
+
...PROVENANCE_METADATA,
|
|
500
524
|
},
|
|
501
525
|
required: ["name"],
|
|
502
526
|
additionalProperties: true,
|