@pipelex/mthds-ui 0.14.0 → 0.15.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,4 +1,5 @@
1
- import { C as ConceptInfo, P as PipeBlueprintUnion, G as GraphSpec, V as ValidationIssue } from '../types-CIH1Ae16.js';
1
+ import { C as ConceptInfo, P as PipeBlueprintUnion, G as GraphSpec, V as ValidationIssue } from '../types-DFIZ_rx6.js';
2
+ export { P as ParsedPipeRef, m as makePipeRef, p as parsePipeRef } from '../pipeRefs-BQJO5nh5.js';
2
3
 
3
4
  type DiagnosticSeverity = "error" | "warning";
4
5
  type DiagnosticCode = "toml-parse-error" | "missing-domain" | "invalid-bundle-shape" | "invalid-concept-entry" | "invalid-pipe-entry" | "unknown-pipe-type" | "invalid-concept-ref" | "missing-pipe-output" | "invalid-sub-pipe" | "incomplete-batch-spec" | "duplicate-concept" | "duplicate-pipe" | "unresolved-pipe-ref" | "cyclic-pipe-ref" | "missing-main-pipe" | "no-entry-pipe" | "conflicting-input-concept";
@@ -13,6 +14,19 @@ interface Diagnostic {
13
14
  message: string;
14
15
  /** TOML-style locator for the offending entry, e.g. `pipe.analyze_candidate.output`. */
15
16
  path?: string;
17
+ /**
18
+ * Domain of the bundle namespace the diagnostic belongs to — the declaring-file
19
+ * identity a host needs to qualify a `pipe.<code>` locator into a full pipe ref
20
+ * (`domain_code.pipe_code`). Stamped wherever the owning namespace is known:
21
+ * per-file diagnostics get their bundle's domain ({@link UNKNOWN_DOMAIN} when
22
+ * the bundle declares none), merge/walk diagnostics the namespace being
23
+ * processed, and entry selection stamps the diagnostics it can attribute (a
24
+ * missing or unresolvable `main_pipe` names its declaring domain). Absent only
25
+ * when no owning bundle can be resolved: unparseable TOML, or entry selection
26
+ * with no resolvable owner (no bundles, no pipes anywhere, or a host-supplied
27
+ * entry ref that matches nothing).
28
+ */
29
+ domain_code?: string;
16
30
  }
17
31
  /**
18
32
  * One `.mthds` file, parsed and normalized. Pipes are narrowed to the same
@@ -113,7 +127,7 @@ declare function buildStaticGraphSpecFromToml(tomlTexts: string | string[], opti
113
127
  * The TOML-style `path` becomes the locator chip; `origin: "static"` lets the
114
128
  * panel (and the host's issue policy) distinguish them from validator verdicts.
115
129
  * When the path identifies a pipe declaration or a precise invocation, the
116
- * targeting fields (`pipeCode` / `nodeId`) are filled so the viewer can
130
+ * targeting fields (`pipeRef` / `nodeId`) are filled so the viewer can
117
131
  * decorate the affected graph nodes.
118
132
  */
119
133
  declare function staticDiagnosticsToValidationIssues(diagnostics: Diagnostic[]): ValidationIssue[];
@@ -1,6 +1,8 @@
1
1
  import {
2
- KNOWN_PIPE_TYPES
3
- } from "../chunk-GS2KODND.js";
2
+ KNOWN_PIPE_TYPES,
3
+ makePipeRef,
4
+ parsePipeRef
5
+ } from "../chunk-YC7TW3BW.js";
4
6
  import {
5
7
  __spreadProps,
6
8
  __spreadValues
@@ -559,7 +561,7 @@ function emptyBundle() {
559
561
  };
560
562
  }
561
563
  function parseMthdsBundle(tomlText) {
562
- var _a;
564
+ var _a, _b;
563
565
  const diagnostics = [];
564
566
  let root;
565
567
  try {
@@ -613,6 +615,9 @@ function parseMthdsBundle(tomlText) {
613
615
  }
614
616
  }
615
617
  }
618
+ for (const diagnostic of diagnostics) {
619
+ (_b = diagnostic.domain_code) != null ? _b : diagnostic.domain_code = domain;
620
+ }
616
621
  return { bundle, diagnostics };
617
622
  }
618
623
 
@@ -651,7 +656,8 @@ function mergeBundles(bundles) {
651
656
  severity: "warning",
652
657
  code: "duplicate-concept",
653
658
  message: `concept "${domain}.${code}" declared more than once \u2014 keeping the first declaration`,
654
- path: `concept.${code}`
659
+ path: `concept.${code}`,
660
+ domain_code: domain
655
661
  });
656
662
  continue;
657
663
  }
@@ -663,7 +669,8 @@ function mergeBundles(bundles) {
663
669
  severity: "warning",
664
670
  code: "duplicate-pipe",
665
671
  message: `pipe "${domain}.${code}" declared more than once \u2014 keeping the first declaration`,
666
- path: `pipe.${code}`
672
+ path: `pipe.${code}`,
673
+ domain_code: domain
667
674
  });
668
675
  continue;
669
676
  }
@@ -806,13 +813,17 @@ function pickEntryPipe(set, explicitRef, diagnostics) {
806
813
  diagnostics.push({
807
814
  severity: "warning",
808
815
  code: "unresolved-pipe-ref",
809
- message: `main_pipe "${set.mainPipe}" not found \u2014 falling back to a root heuristic`
816
+ message: `main_pipe "${set.mainPipe}" not found \u2014 falling back to a root heuristic`,
817
+ // The owning bundle is known (the namespace that declares this main_pipe),
818
+ // so stamp it — this is not an ownerless diagnostic.
819
+ domain_code: fallbackDomain
810
820
  });
811
821
  } else {
812
822
  diagnostics.push({
813
823
  severity: "warning",
814
824
  code: "missing-main-pipe",
815
- message: "no main_pipe declared \u2014 falling back to a root heuristic"
825
+ message: "no main_pipe declared \u2014 falling back to a root heuristic",
826
+ domain_code: fallbackDomain
816
827
  });
817
828
  }
818
829
  const domainWithPipes = [fallbackDomain, ...domainsInOrder].find(
@@ -894,7 +905,8 @@ function bindInputs(ctx, blueprint, scope) {
894
905
  severity: "warning",
895
906
  code: "conflicting-input-concept",
896
907
  message: `pipe "${blueprint.code}": dangling input "${name}" is declared as ${conceptKey(spec.concept)} here but was first seen as ${conceptKey(bound.concept)} \u2014 keeping the first`,
897
- path: `pipe.${blueprint.code}.inputs.${name}`
908
+ path: `pipe.${blueprint.code}.inputs.${name}`,
909
+ domain_code: blueprint.domain_code
898
910
  });
899
911
  }
900
912
  }
@@ -934,7 +946,10 @@ function walkPipe(ctx, ref, currentDomain, nodeId, parentId, scope, inv) {
934
946
  severity: "warning",
935
947
  code: "unresolved-pipe-ref",
936
948
  message: `pipe ref "${ref}" cannot be resolved \u2014 node skipped`,
937
- path: nodeId
949
+ path: nodeId,
950
+ // The uttering file's domain: a bare ref belongs to the namespace that
951
+ // wrote it, mirroring the runtime's `_qualify_pipe_ref` inference.
952
+ domain_code: currentDomain
938
953
  });
939
954
  return null;
940
955
  }
@@ -960,7 +975,8 @@ function walkPipe(ctx, ref, currentDomain, nodeId, parentId, scope, inv) {
960
975
  severity: "warning",
961
976
  code: "cyclic-pipe-ref",
962
977
  message: `pipe "${qualified}" is invoked recursively \u2014 rendered as a leaf`,
963
- path: nodeId
978
+ path: nodeId,
979
+ domain_code: domain
964
980
  });
965
981
  return finishLeaf(ctx, node, blueprint, nodeId, inv);
966
982
  }
@@ -1256,12 +1272,12 @@ function walkInlineBatch(ctx, sub, domain, nodeId, parentId, scope) {
1256
1272
  }
1257
1273
 
1258
1274
  // src/static-graph/validationIssues.ts
1259
- function targetFromPath(path) {
1275
+ function targetFromPath(path, domainCode) {
1260
1276
  if (!path) return {};
1261
1277
  if (path.includes("/")) return { nodeId: path };
1262
1278
  if (path.startsWith("pipe.")) {
1263
1279
  const code = path.split(".")[1];
1264
- if (code) return { pipeCode: code };
1280
+ if (code && domainCode) return { pipeRef: makePipeRef(domainCode, code) };
1265
1281
  }
1266
1282
  return {};
1267
1283
  }
@@ -1271,7 +1287,7 @@ function staticDiagnosticsToValidationIssues(diagnostics) {
1271
1287
  message: diagnostic.message,
1272
1288
  context: diagnostic.path,
1273
1289
  origin: "static"
1274
- }, targetFromPath(diagnostic.path)));
1290
+ }, targetFromPath(diagnostic.path, diagnostic.domain_code)));
1275
1291
  }
1276
1292
  export {
1277
1293
  NATIVE_CONCEPT_CODES,
@@ -1279,9 +1295,11 @@ export {
1279
1295
  UNKNOWN_DOMAIN,
1280
1296
  buildStaticGraphSpec,
1281
1297
  buildStaticGraphSpecFromToml,
1298
+ makePipeRef,
1282
1299
  mergeBundles,
1283
1300
  parseConceptRef,
1284
1301
  parseMthdsBundle,
1302
+ parsePipeRef,
1285
1303
  staticDiagnosticsToValidationIssues
1286
1304
  };
1287
1305
  //# sourceMappingURL=index.js.map