@pipelex/mthds-ui 0.17.0 → 0.19.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/README.md +38 -4
- package/dist/chunk-2N65P32H.js +17 -0
- package/dist/chunk-2N65P32H.js.map +1 -0
- package/dist/{chunk-CQTAXK76.js → chunk-BFQHQQ3E.js} +6 -189
- package/dist/chunk-BFQHQQ3E.js.map +1 -0
- package/dist/chunk-HASMGCVK.js +195 -0
- package/dist/chunk-HASMGCVK.js.map +1 -0
- package/dist/{chunk-3XFIKUSZ.js → chunk-RJVEDP7M.js} +2 -16
- package/dist/chunk-RJVEDP7M.js.map +1 -0
- package/dist/form/react/RunPanel.css +131 -0
- package/dist/form/react/index.d.ts +232 -0
- package/dist/form/react/index.js +275 -0
- package/dist/form/react/index.js.map +1 -0
- package/dist/graph/index.d.ts +2 -2
- package/dist/graph/index.js +13 -9
- package/dist/graph/react/index.d.ts +2 -2
- package/dist/graph/react/index.js +7 -4
- package/dist/graph/react/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +13 -9
- package/dist/shiki/index.js +8 -2
- package/dist/shiki/index.js.map +1 -1
- package/dist/standalone/graph-standalone.html +8 -8
- package/dist/standalone/graph-viewer.js +8 -8
- package/dist/static-graph/index.d.ts +4 -2
- package/dist/static-graph/index.js +64 -21
- package/dist/static-graph/index.js.map +1 -1
- package/dist/{types-DUSThVb4.d.ts → types-Cv5Elty8.d.ts} +10 -1
- package/package.json +12 -1
- package/dist/chunk-3XFIKUSZ.js.map +0 -1
- package/dist/chunk-CQTAXK76.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { C as ConceptInfo, P as PipeBlueprintUnion,
|
|
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-
|
|
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
|
-
|
|
697
|
-
|
|
698
|
-
|
|
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
|
-
|
|
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: {
|
|
1279
|
-
|
|
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
|
};
|