@telorun/analyzer 0.30.0 → 0.30.1
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition-registry.d.ts","sourceRoot":"","sources":["../src/definition-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAIL,KAAK,iBAAiB,EACvB,MAAM,0BAA0B,CAAC;AAGlC,+EAA+E;AAC/E,qBAAa,kBAAkB;;IAK7B;;sFAEkF;IAClF,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAe;IACnC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAqB;IAEzD,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAyC;IAC9D,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAwC;IAClE,mEAAmE;IACnE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA+B;IAC1D;6DACyD;IACzD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA6B;IACzD;;0EAEsE;IACtE,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAA6B;IAEhE,QAAQ,CAAC,UAAU,EAAE,kBAAkB,GAAG,IAAI;IAiC9C,OAAO,CAAC,aAAa;IASrB;;;yFAGqF;IACrF,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI;IA+B1E;;;;iFAI6E;IAC7E,uBAAuB,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI;IAMtE;uFACmF;IACnF,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAIhC;4EACwE;IACxE,SAAS,CAAC,UAAU,EA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AAG,kBAAkB,GAAG,SAAS;IAIrD,+FAA+F;IAC/F,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS;IAIxD,gGAAgG;IAChG,kBAAkB,CAChB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE;QAAE,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;KAAE,GACvD,iBAAiB,GAAG,SAAS;IAOhC;;;;;;;;qFAQiF;IACjF,2BAA2B,CACzB,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,EAAE,aAAa,EACtB,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,GAC1C,iBAAiB,GAAG,SAAS;IAkChC,OAAO,CAAC,uBAAuB;IA+B/B;;qEAEiE;IACjE,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,kBAAkB,EAAE;IAgBxD,KAAK,IAAI,MAAM,EAAE;CAGlB"}
|
|
@@ -208,11 +208,20 @@ export class DefinitionRegistry {
|
|
|
208
208
|
* anchors depend on a sibling property at runtime and stay unexpanded; the
|
|
209
209
|
* analyzer's reference validation phase already flags the cases that matter. */
|
|
210
210
|
expandedFieldMapForResource(resource, aliases, aliasesByModule) {
|
|
211
|
-
|
|
211
|
+
// Resolve the resource's OWN kind through its module's alias scope, not the global
|
|
212
|
+
// aliases. A library-internal resource's kind uses a library-local alias
|
|
213
|
+
// (e.g. `Ai.AgentStream` in a library that imports `Ai`), which the root/global
|
|
214
|
+
// resolver doesn't know — using the global scope here left the base field map
|
|
215
|
+
// unresolved, so Phase-5 injection saw no ref fields and skipped injection.
|
|
216
|
+
const ownModule = resource.metadata?.module;
|
|
217
|
+
const moduleScope = (ownModule ? aliasesByModule.get(ownModule) : undefined) ?? aliases;
|
|
218
|
+
const baseMap = this.getFieldMapForKind(resource.kind, moduleScope);
|
|
212
219
|
if (!baseMap)
|
|
213
220
|
return undefined;
|
|
214
|
-
const resolvedKind =
|
|
221
|
+
const resolvedKind = moduleScope.resolveKind(resource.kind) ?? resource.kind;
|
|
215
222
|
const def = this.resolve(resource.kind) ?? this.resolve(resolvedKind);
|
|
223
|
+
// schema-from anchors resolve in the DEFINITION's module scope (where the anchor
|
|
224
|
+
// kind is declared), which may differ from the resource's own module.
|
|
216
225
|
const ownerModule = def?.metadata?.module;
|
|
217
226
|
const ownerScope = (ownerModule ? aliasesByModule.get(ownerModule) : undefined) ?? aliases;
|
|
218
227
|
const expanded = new Map();
|
package/package.json
CHANGED
|
@@ -234,11 +234,22 @@ export class DefinitionRegistry {
|
|
|
234
234
|
aliases: AliasResolver,
|
|
235
235
|
aliasesByModule: Map<string, AliasResolver>,
|
|
236
236
|
): ReferenceFieldMap | undefined {
|
|
237
|
-
|
|
237
|
+
// Resolve the resource's OWN kind through its module's alias scope, not the global
|
|
238
|
+
// aliases. A library-internal resource's kind uses a library-local alias
|
|
239
|
+
// (e.g. `Ai.AgentStream` in a library that imports `Ai`), which the root/global
|
|
240
|
+
// resolver doesn't know — using the global scope here left the base field map
|
|
241
|
+
// unresolved, so Phase-5 injection saw no ref fields and skipped injection.
|
|
242
|
+
const ownModule = (resource.metadata as { module?: string } | undefined)?.module;
|
|
243
|
+
const moduleScope =
|
|
244
|
+
(ownModule ? aliasesByModule.get(ownModule) : undefined) ?? aliases;
|
|
245
|
+
|
|
246
|
+
const baseMap = this.getFieldMapForKind(resource.kind, moduleScope);
|
|
238
247
|
if (!baseMap) return undefined;
|
|
239
248
|
|
|
240
|
-
const resolvedKind =
|
|
249
|
+
const resolvedKind = moduleScope.resolveKind(resource.kind) ?? resource.kind;
|
|
241
250
|
const def = this.resolve(resource.kind) ?? this.resolve(resolvedKind);
|
|
251
|
+
// schema-from anchors resolve in the DEFINITION's module scope (where the anchor
|
|
252
|
+
// kind is declared), which may differ from the resource's own module.
|
|
242
253
|
const ownerModule = (def?.metadata as { module?: string } | undefined)?.module;
|
|
243
254
|
const ownerScope =
|
|
244
255
|
(ownerModule ? aliasesByModule.get(ownerModule) : undefined) ?? aliases;
|