@pipelex/mthds-ui 0.16.0 → 0.18.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.
Files changed (35) hide show
  1. package/README.md +38 -4
  2. package/dist/chunk-2N65P32H.js +17 -0
  3. package/dist/chunk-2N65P32H.js.map +1 -0
  4. package/dist/{chunk-UDA2XA23.js → chunk-BFQHQQ3E.js} +95 -189
  5. package/dist/chunk-BFQHQQ3E.js.map +1 -0
  6. package/dist/chunk-HASMGCVK.js +195 -0
  7. package/dist/chunk-HASMGCVK.js.map +1 -0
  8. package/dist/{chunk-HURB2U53.js → chunk-RJVEDP7M.js} +2 -16
  9. package/dist/chunk-RJVEDP7M.js.map +1 -0
  10. package/dist/form/react/RunPanel.css +131 -0
  11. package/dist/form/react/index.d.ts +188 -0
  12. package/dist/form/react/index.js +265 -0
  13. package/dist/form/react/index.js.map +1 -0
  14. package/dist/graph/index.d.ts +2 -2
  15. package/dist/graph/index.js +13 -9
  16. package/dist/graph/react/detail/DetailPanel.css +65 -0
  17. package/dist/graph/react/index.css +46 -0
  18. package/dist/graph/react/index.css.map +1 -1
  19. package/dist/graph/react/index.d.ts +2 -2
  20. package/dist/graph/react/index.js +608 -373
  21. package/dist/graph/react/index.js.map +1 -1
  22. package/dist/index.d.ts +1 -1
  23. package/dist/index.js +13 -9
  24. package/dist/shiki/index.js +8 -2
  25. package/dist/shiki/index.js.map +1 -1
  26. package/dist/standalone/graph-standalone.html +75 -10
  27. package/dist/standalone/graph-viewer.css +65 -0
  28. package/dist/standalone/graph-viewer.js +10 -10
  29. package/dist/static-graph/index.d.ts +4 -2
  30. package/dist/static-graph/index.js +64 -21
  31. package/dist/static-graph/index.js.map +1 -1
  32. package/dist/{types-DM_Ws3oW.d.ts → types-Cv5Elty8.d.ts} +101 -1
  33. package/package.json +12 -1
  34. package/dist/chunk-HURB2U53.js.map +0 -1
  35. package/dist/chunk-UDA2XA23.js.map +0 -1
@@ -1,8 +1,8 @@
1
- import { C as ConceptInfo, P as PipeBlueprintUnion, G as GraphSpec, V as ValidationIssue } from '../types-DM_Ws3oW.js';
1
+ import { C as ConceptInfo, P as PipeBlueprintUnion, a as PresenceMarker, b as GraphSpec, V as ValidationIssue } from '../types-Cv5Elty8.js';
2
2
  export { P as ParsedPipeRef, m as makePipeRef, p as parsePipeRef } from '../pipeRefs-BQJO5nh5.js';
3
3
 
4
4
  type DiagnosticSeverity = "error" | "warning";
5
- type DiagnosticCode = "toml-parse-error" | "missing-domain" | "invalid-bundle-shape" | "invalid-concept-entry" | "invalid-pipe-entry" | "unknown-pipe-type" | "retired-signature-tag" | "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";
5
+ type DiagnosticCode = "toml-parse-error" | "missing-domain" | "invalid-bundle-shape" | "invalid-concept-entry" | "invalid-pipe-entry" | "unknown-pipe-type" | "retired-signature-tag" | "invalid-concept-ref" | "missing-pipe-output" | "invalid-sub-pipe" | "incomplete-batch-spec" | "duplicate-concept" | "duplicate-pipe" | "signature-type-mismatch" | "unresolved-pipe-ref" | "cyclic-pipe-ref" | "missing-main-pipe" | "no-entry-pipe" | "conflicting-input-concept";
6
6
  /**
7
7
  * A non-fatal note collected while parsing or merging. `error` means a whole
8
8
  * unit could not be interpreted (unparseable TOML, a skipped pipe); `warning`
@@ -80,6 +80,8 @@ interface ConceptRefParts {
80
80
  code: string;
81
81
  /** `[]` → true (many), `[N]` → N, no suffix → null (single). */
82
82
  multiplicity: number | boolean | null;
83
+ /** `?` → "optional", `!` → "force", no suffix → "plain". */
84
+ presence: PresenceMarker;
83
85
  }
84
86
  /** Parse a concept ref string into its parts. Returns null when the ref is not interpretable. */
85
87
  declare function parseConceptRef(raw: unknown): ConceptRefParts | null;
@@ -1,8 +1,10 @@
1
1
  import {
2
- KNOWN_PIPE_TYPES,
3
2
  makePipeRef,
4
3
  parsePipeRef
5
- } from "../chunk-HURB2U53.js";
4
+ } from "../chunk-2N65P32H.js";
5
+ import {
6
+ KNOWN_PIPE_TYPES
7
+ } from "../chunk-RJVEDP7M.js";
6
8
  import {
7
9
  __spreadProps,
8
10
  __spreadValues
@@ -50,16 +52,22 @@ var NATIVE_CONCEPT_CODES = new Set(
50
52
  function isNativeConceptCode(code) {
51
53
  return Object.hasOwn(NATIVE_CONCEPT_DESCRIPTIONS, code);
52
54
  }
53
- var CONCEPT_REF_RE = /^(?:([A-Za-z0-9_][A-Za-z0-9_.]*)\.)?([A-Za-z0-9_]+)(?:\[(\d*)\])?$/;
55
+ var CONCEPT_REF_RE = /^(?:([A-Za-z0-9_][A-Za-z0-9_.]*)\.)?([A-Za-z0-9_]+)(?:\[(\d*)\])?([?!])?$/;
56
+ function presenceFromSymbol(symbol) {
57
+ if (symbol === "?") return "optional";
58
+ if (symbol === "!") return "force";
59
+ return "plain";
60
+ }
54
61
  function parseConceptRef(raw) {
55
62
  if (typeof raw !== "string") return null;
56
63
  const match = CONCEPT_REF_RE.exec(raw.trim());
57
64
  if (!match) return null;
58
- const [, domain, code, multiplicity] = match;
65
+ const [, domain, code, multiplicity, presence] = match;
59
66
  return {
60
67
  domain: domain != null ? domain : null,
61
68
  code,
62
- multiplicity: multiplicity === void 0 ? null : multiplicity === "" ? true : Number.parseInt(multiplicity, 10)
69
+ multiplicity: multiplicity === void 0 ? null : multiplicity === "" ? true : Number.parseInt(multiplicity, 10),
70
+ presence: presenceFromSymbol(presence)
63
71
  };
64
72
  }
65
73
  function qualifiedStructureClassName(domain, code) {
@@ -102,7 +110,8 @@ function resolveStuffSpec(raw, currentDomain, localConcepts) {
102
110
  if (parts === null) return null;
103
111
  return {
104
112
  concept: resolveConceptInfo(parts, currentDomain, localConcepts),
105
- multiplicity: parts.multiplicity
113
+ multiplicity: parts.multiplicity,
114
+ presence: parts.presence
106
115
  };
107
116
  }
108
117
 
@@ -161,7 +170,7 @@ function normalizeOutput(raw, pipeCode, ctx) {
161
170
  message: `pipe "${pipeCode}": missing or uninterpretable output \u2014 assuming native.Anything`,
162
171
  path: `pipe.${pipeCode}.output`
163
172
  });
164
- return { concept: nativeConceptInfo("Anything"), multiplicity: null };
173
+ return { concept: nativeConceptInfo("Anything"), multiplicity: null, presence: "plain" };
165
174
  }
166
175
  function normalizeSubPipe(raw, pipeCode, path, ctx) {
167
176
  var _a;
@@ -523,9 +532,18 @@ function deriveJsonSchema(structure, title, description) {
523
532
  properties
524
533
  }, required.length > 0 ? { required } : {});
525
534
  }
526
- function qualifyRefines(raw, domain, declaredCodes) {
535
+ function qualifyRefines(raw, domain, declaredCodes, conceptCode, diagnostics) {
527
536
  const parts = parseConceptRef(raw);
528
537
  if (parts === null) return null;
538
+ if (parts.multiplicity !== null || parts.presence !== "plain") {
539
+ diagnostics.push({
540
+ severity: "warning",
541
+ code: "invalid-concept-ref",
542
+ message: `concept "${conceptCode}": \`refines\` names a concept, so it takes no multiplicity or presence suffix \u2014 ignored`,
543
+ path: `concept.${conceptCode}.refines`
544
+ });
545
+ return null;
546
+ }
529
547
  if (parts.domain !== null) return `${parts.domain}.${parts.code}`;
530
548
  if (!declaredCodes.has(parts.code) && isNativeConceptCode(parts.code)) {
531
549
  return `${NATIVE_DOMAIN}.${parts.code}`;
@@ -573,7 +591,7 @@ function parseConcepts(raw, domain, diagnostics) {
573
591
  domain_code: domain,
574
592
  description,
575
593
  structure_class_name: structureClassName,
576
- refines: qualifyRefines(entry.refines, domain, declaredCodes),
594
+ refines: qualifyRefines(entry.refines, domain, declaredCodes, code, diagnostics),
577
595
  json_schema: deriveJsonSchema(entry.structure, structureClassName, description)
578
596
  };
579
597
  }
@@ -664,7 +682,7 @@ function enrichPipeConcepts(pipe, domains) {
664
682
  return __spreadProps(__spreadValues({}, pipe), { inputs, output: enrichSpec(pipe.output) });
665
683
  }
666
684
  function mergeBundles(bundles) {
667
- var _a, _b;
685
+ var _a, _b, _c;
668
686
  const diagnostics = [];
669
687
  const domains = {};
670
688
  let mainDomain = null;
@@ -693,17 +711,36 @@ function mergeBundles(bundles) {
693
711
  namespace.concepts[code] = concept;
694
712
  }
695
713
  for (const [code, pipe] of Object.entries(bundle.pipes)) {
696
- if (code in namespace.pipes) {
697
- diagnostics.push({
698
- severity: "warning",
699
- code: "duplicate-pipe",
700
- message: `pipe "${domain}.${code}" declared more than once \u2014 keeping the first declaration`,
701
- path: `pipe.${code}`,
702
- domain_code: domain
703
- });
714
+ const existing = namespace.pipes[code];
715
+ if (existing === void 0) {
716
+ namespace.pipes[code] = pipe;
704
717
  continue;
705
718
  }
706
- namespace.pipes[code] = pipe;
719
+ const existingIsSignature = existing.type === "PipeSignature";
720
+ const incomingIsSignature = pipe.type === "PipeSignature";
721
+ if (existingIsSignature !== incomingIsSignature) {
722
+ const signature = existing.type === "PipeSignature" ? existing : pipe;
723
+ const concrete = existing.type === "PipeSignature" ? pipe : existing;
724
+ if (existingIsSignature) namespace.pipes[code] = pipe;
725
+ const promised = signature.type === "PipeSignature" ? (_c = signature.signature_for) != null ? _c : null : null;
726
+ if (promised !== null && promised !== concrete.type) {
727
+ diagnostics.push({
728
+ severity: "warning",
729
+ code: "signature-type-mismatch",
730
+ message: `pipe "${domain}.${code}": the signature promises \`signature_for = "${promised}"\` but the concrete definition is a ${concrete.type} \u2014 using the concrete definition`,
731
+ path: `pipe.${code}`,
732
+ domain_code: domain
733
+ });
734
+ }
735
+ continue;
736
+ }
737
+ diagnostics.push({
738
+ severity: "warning",
739
+ code: "duplicate-pipe",
740
+ message: `pipe "${domain}.${code}" declared more than once \u2014 keeping the first declaration`,
741
+ path: `pipe.${code}`,
742
+ domain_code: domain
743
+ });
707
744
  }
708
745
  }
709
746
  for (const namespace of Object.values(domains)) {
@@ -1275,8 +1312,14 @@ function walkInlineBatch(ctx, sub, domain, nodeId, parentId, scope) {
1275
1312
  code,
1276
1313
  domain_code: domain,
1277
1314
  description: `Batch processing for ${branchTail}`,
1278
- inputs: { [params.input_list_stuff_name]: { concept: listConcept, multiplicity: null } },
1279
- output: { concept: outputSpec.concept, multiplicity: null },
1315
+ inputs: {
1316
+ [params.input_list_stuff_name]: {
1317
+ concept: listConcept,
1318
+ multiplicity: null,
1319
+ presence: "plain"
1320
+ }
1321
+ },
1322
+ output: { concept: outputSpec.concept, multiplicity: null, presence: "plain" },
1280
1323
  branch_pipe_code: sub.pipe_code,
1281
1324
  batch_params: params
1282
1325
  };