@telorun/analyzer 0.30.0 → 0.31.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 +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,EAAE,MAAM,EAA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;IAczB;;;;;;;;4FAQwF;IACxF,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAUhD,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,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
- const baseMap = this.getFieldMapForKind(resource.kind, aliases);
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 = aliases.resolveKind(resource.kind) ?? resource.kind;
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();
@@ -80,6 +80,11 @@ export interface LoadedGraph {
80
80
  * error for a major mismatch). Surfaced alongside `analyze()` diagnostics by
81
81
  * every consumer (CLI, editor, VS Code). */
82
82
  versionDiagnostics: AnalysisDiagnostic[];
83
+ /** YAML parse failures aggregated from every file's `parseErrors`. A file
84
+ * that fails to parse yields a mangled `toJSON()` projection, so these are
85
+ * fatal Error diagnostics — surfaced alongside `analyze()` output by every
86
+ * consumer (CLI, editor, VS Code) and treated as fatal by the kernel. */
87
+ parseDiagnostics: AnalysisDiagnostic[];
83
88
  /** Surface-level errors that did not abort the graph load (e.g. an import
84
89
  * whose target failed to fetch). */
85
90
  errors: GraphLoadError[];
@@ -1 +1 @@
1
- {"version":3,"file":"loaded-types.d.ts","sourceRoot":"","sources":["../src/loaded-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAE5D;;;;4EAI4E;AAC5E,MAAM,WAAW,UAAU;IACzB;+DAC2D;IAC3D,MAAM,EAAE,MAAM,CAAC;IACf;gEAC4D;IAC5D,YAAY,EAAE,MAAM,CAAC;IACrB,gDAAgD;IAChD,IA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AAO,CAAC,WAAW,CAAC;IAsH9E;;;;;;;;sBAQkB;IAClB,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM;IAOlE,OAAO,CAAC,6BAA6B;IAarC,OAAO,CAAC,mCAAmC;IAc3C,OAAO,CAAC,2BAA2B;YAkCrB,eAAe;IAmB7B;;;0CAGsC;IAChC,gBAAgB,CACpB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC;QAAE,KAAK,EAAE,WAAW,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CA0B5D"}
@@ -3,7 +3,27 @@ import { desugarLoadedFile } from "./inline-imports.js";
3
3
  import { isModuleKind } from "./module-kinds.js";
4
4
  import { parseLoadedFile } from "./parse-loaded-file.js";
5
5
  import { reconcileModuleVersions } from "./reconcile-module-versions.js";
6
- import { DEFAULT_MANIFEST_FILENAME, } from "./types.js";
6
+ import { DEFAULT_MANIFEST_FILENAME, DiagnosticSeverity, } from "./types.js";
7
+ /** Project every file's YAML `parseErrors` into fatal Error diagnostics. Each
8
+ * carries `data.filePath` so `findPositions` routes it to the failing file. */
9
+ function collectParseDiagnostics(modules) {
10
+ const diagnostics = [];
11
+ for (const mod of modules.values()) {
12
+ for (const file of [mod.owner, ...mod.partials]) {
13
+ for (const err of file.parseErrors) {
14
+ diagnostics.push({
15
+ severity: DiagnosticSeverity.Error,
16
+ code: "MANIFEST_PARSE_FAILED",
17
+ source: "telo-analyzer",
18
+ message: err.message,
19
+ range: err.range,
20
+ data: { filePath: file.source },
21
+ });
22
+ }
23
+ }
24
+ }
25
+ return diagnostics;
26
+ }
7
27
  const SYSTEM_KINDS = new Set([
8
28
  "Telo.Application",
9
29
  "Telo.Library",
@@ -268,6 +288,7 @@ export class Loader {
268
288
  importEdges,
269
289
  overrides,
270
290
  versionDiagnostics: diagnostics,
291
+ parseDiagnostics: collectParseDiagnostics(modules),
271
292
  errors,
272
293
  };
273
294
  }
@@ -1 +1 @@
1
- {"version":3,"file":"parse-loaded-file.d.ts","sourceRoot":"","sources":["../src/parse-loaded-file.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAKxD,OAAO,KAAK,EAAE,UAAU,EAAc,MAAM,mBAAmB,CAAC;AAIhE,MAAM,WAAW,YAAY;IAC3B;4EACwE;IACxE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,2EAA2E;IAC3E,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,oEAAoE;AACpE,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,YAAY,GACrB,UAAU,CA8CZ"}
1
+ {"version":3,"file":"parse-loaded-file.d.ts","sourceRoot":"","sources":["../src/parse-loaded-file.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAKxD,OAAO,KAAK,EAAE,UAAU,EAAc,MAAM,mBAAmB,CAAC;AAIhE,MAAM,WAAW,YAAY;IAC3B;4EACwE;IACxE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,2EAA2E;IAC3E,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AA4BD,oEAAoE;AACpE,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,YAAY,GACrB,UAAU,CA+CZ"}
@@ -3,6 +3,29 @@ import { parseAllDocuments } from "yaml";
3
3
  import { buildCelEnvironment } from "./cel-environment.js";
4
4
  import { buildDocumentPositions } from "./position-metadata.js";
5
5
  import { precompileDoc } from "./precompile.js";
6
+ /** Append an actionable hint to raw yaml-parser messages that are otherwise
7
+ * cryptic. The parser reports `BLOCK_AS_IMPLICIT_KEY` ("Nested mappings are
8
+ * not allowed in compact mappings") when a plain (unquoted) scalar contains
9
+ * `: ` (colon-space) — the parser reads the colon as a nested key. Telling the
10
+ * author to quote the value turns an opaque error into a one-step fix. */
11
+ function augmentParseMessage(err) {
12
+ if (err.code === "BLOCK_AS_IMPLICIT_KEY") {
13
+ return `${err.message}\n\nHint: a plain (unquoted) value cannot contain ': ' (colon followed by a space) — the parser reads it as a nested mapping. Wrap the value in quotes, e.g. \`description: "… \`encoding: base64\` …"\`.`;
14
+ }
15
+ return err.message;
16
+ }
17
+ /** The yaml lib reports 1-based `{line, col}` pairs; convert to a 0-based
18
+ * analyzer `Range`. Returns undefined when the error carried no position. */
19
+ function rangeFromLinePos(linePos) {
20
+ const start = linePos?.[0];
21
+ if (!start)
22
+ return undefined;
23
+ const end = linePos?.[1] ?? start;
24
+ return {
25
+ start: { line: start.line - 1, character: start.col - 1 },
26
+ end: { line: end.line - 1, character: end.col - 1 },
27
+ };
28
+ }
6
29
  /** Pure: text in, structured load result out. No I/O, no caches. */
7
30
  export function parseLoadedFile(source, requestedUrl, text, options) {
8
31
  const documents = parseAllDocuments(text, { customTags: defaultCustomTags() });
@@ -12,7 +35,8 @@ export function parseLoadedFile(source, requestedUrl, text, options) {
12
35
  for (const err of doc.errors) {
13
36
  parseErrors.push({
14
37
  documentIndex,
15
- message: err.message,
38
+ message: augmentParseMessage(err),
39
+ range: rangeFromLinePos(err.linePos),
16
40
  });
17
41
  }
18
42
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telorun/analyzer",
3
- "version": "0.30.0",
3
+ "version": "0.31.0",
4
4
  "description": "Telo Analyzer - Static manifest validator for Telo manifests.",
5
5
  "keywords": [
6
6
  "telo",
@@ -234,11 +234,22 @@ export class DefinitionRegistry {
234
234
  aliases: AliasResolver,
235
235
  aliasesByModule: Map<string, AliasResolver>,
236
236
  ): ReferenceFieldMap | undefined {
237
- const baseMap = this.getFieldMapForKind(resource.kind, aliases);
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 = aliases.resolveKind(resource.kind) ?? resource.kind;
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;
@@ -85,6 +85,11 @@ export interface LoadedGraph {
85
85
  * error for a major mismatch). Surfaced alongside `analyze()` diagnostics by
86
86
  * every consumer (CLI, editor, VS Code). */
87
87
  versionDiagnostics: AnalysisDiagnostic[];
88
+ /** YAML parse failures aggregated from every file's `parseErrors`. A file
89
+ * that fails to parse yields a mangled `toJSON()` projection, so these are
90
+ * fatal Error diagnostics — surfaced alongside `analyze()` output by every
91
+ * consumer (CLI, editor, VS Code) and treated as fatal by the kernel. */
92
+ parseDiagnostics: AnalysisDiagnostic[];
88
93
  /** Surface-level errors that did not abort the graph load (e.g. an import
89
94
  * whose target failed to fetch). */
90
95
  errors: GraphLoadError[];
@@ -13,12 +13,37 @@ import { isModuleKind } from "./module-kinds.js";
13
13
  import { parseLoadedFile } from "./parse-loaded-file.js";
14
14
  import { reconcileModuleVersions } from "./reconcile-module-versions.js";
15
15
  import {
16
+ type AnalysisDiagnostic,
16
17
  DEFAULT_MANIFEST_FILENAME,
18
+ DiagnosticSeverity,
17
19
  type LoadOptions,
18
20
  type LoaderInitOptions,
19
21
  type ManifestSource,
20
22
  } from "./types.js";
21
23
 
24
+ /** Project every file's YAML `parseErrors` into fatal Error diagnostics. Each
25
+ * carries `data.filePath` so `findPositions` routes it to the failing file. */
26
+ function collectParseDiagnostics(
27
+ modules: Map<string, LoadedModule>,
28
+ ): AnalysisDiagnostic[] {
29
+ const diagnostics: AnalysisDiagnostic[] = [];
30
+ for (const mod of modules.values()) {
31
+ for (const file of [mod.owner, ...mod.partials]) {
32
+ for (const err of file.parseErrors) {
33
+ diagnostics.push({
34
+ severity: DiagnosticSeverity.Error,
35
+ code: "MANIFEST_PARSE_FAILED",
36
+ source: "telo-analyzer",
37
+ message: err.message,
38
+ range: err.range,
39
+ data: { filePath: file.source },
40
+ });
41
+ }
42
+ }
43
+ }
44
+ return diagnostics;
45
+ }
46
+
22
47
  const SYSTEM_KINDS = new Set([
23
48
  "Telo.Application",
24
49
  "Telo.Library",
@@ -309,6 +334,7 @@ export class Loader {
309
334
  importEdges,
310
335
  overrides,
311
336
  versionDiagnostics: diagnostics,
337
+ parseDiagnostics: collectParseDiagnostics(modules),
312
338
  errors,
313
339
  };
314
340
  }
@@ -15,6 +15,32 @@ export interface ParseOptions {
15
15
  celEnv?: Environment;
16
16
  }
17
17
 
18
+ /** Append an actionable hint to raw yaml-parser messages that are otherwise
19
+ * cryptic. The parser reports `BLOCK_AS_IMPLICIT_KEY` ("Nested mappings are
20
+ * not allowed in compact mappings") when a plain (unquoted) scalar contains
21
+ * `: ` (colon-space) — the parser reads the colon as a nested key. Telling the
22
+ * author to quote the value turns an opaque error into a one-step fix. */
23
+ function augmentParseMessage(err: import("yaml").YAMLError): string {
24
+ if (err.code === "BLOCK_AS_IMPLICIT_KEY") {
25
+ return `${err.message}\n\nHint: a plain (unquoted) value cannot contain ': ' (colon followed by a space) — the parser reads it as a nested mapping. Wrap the value in quotes, e.g. \`description: "… \`encoding: base64\` …"\`.`;
26
+ }
27
+ return err.message;
28
+ }
29
+
30
+ /** The yaml lib reports 1-based `{line, col}` pairs; convert to a 0-based
31
+ * analyzer `Range`. Returns undefined when the error carried no position. */
32
+ function rangeFromLinePos(
33
+ linePos: import("yaml").YAMLError["linePos"],
34
+ ): import("./types.js").Range | undefined {
35
+ const start = linePos?.[0];
36
+ if (!start) return undefined;
37
+ const end = linePos?.[1] ?? start;
38
+ return {
39
+ start: { line: start.line - 1, character: start.col - 1 },
40
+ end: { line: end.line - 1, character: end.col - 1 },
41
+ };
42
+ }
43
+
18
44
  /** Pure: text in, structured load result out. No I/O, no caches. */
19
45
  export function parseLoadedFile(
20
46
  source: string,
@@ -30,7 +56,8 @@ export function parseLoadedFile(
30
56
  for (const err of doc.errors) {
31
57
  parseErrors.push({
32
58
  documentIndex,
33
- message: err.message,
59
+ message: augmentParseMessage(err),
60
+ range: rangeFromLinePos(err.linePos),
34
61
  });
35
62
  }
36
63
  });