@pipelex/mthds-ui 0.25.0 → 0.26.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,4 @@
1
- import { C as ConceptInfo, P as PipeBlueprintUnion, a as PresenceMarker, b as GraphSpec, V as ValidationIssue } from '../types-Bcsh7Z0U.js';
1
+ import { C as ConceptInfo, P as PipeBlueprintUnion, a as PresenceMarker, b as GraphSpec, V as ValidationIssue } from '../types-DgqW3Jg4.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";
@@ -3,8 +3,9 @@ import {
3
3
  parsePipeRef
4
4
  } from "../chunk-2N65P32H.js";
5
5
  import {
6
- KNOWN_PIPE_TYPES
7
- } from "../chunk-F3GBNU2I.js";
6
+ KNOWN_PIPE_TYPES,
7
+ isPluralMultiplicity
8
+ } from "../chunk-VCO4GZDZ.js";
8
9
  import {
9
10
  __spreadProps,
10
11
  __spreadValues
@@ -986,13 +987,19 @@ function registerConcept(ctx, concept) {
986
987
  function mintStuff(ctx, digest, name, concept, multiplicity) {
987
988
  const existing = ctx.stuffByDigest.get(digest);
988
989
  if (existing !== void 0) return existing;
989
- const record = { digest, name, concept, multiplicity };
990
+ const record = { digest, name, concept, multiplicity: multiplicity != null ? multiplicity : null };
990
991
  ctx.stuffByDigest.set(digest, record);
991
992
  registerConcept(ctx, concept);
992
993
  return record;
993
994
  }
994
995
  function ioItem(stuff, slotName) {
995
- return { name: slotName != null ? slotName : stuff.name, digest: stuff.digest, concept: stuff.concept.code };
996
+ const item = {
997
+ name: slotName != null ? slotName : stuff.name,
998
+ digest: stuff.digest,
999
+ concept: stuff.concept.code
1000
+ };
1001
+ if (isPluralMultiplicity(stuff.multiplicity)) item.multiplicity = stuff.multiplicity;
1002
+ return item;
996
1003
  }
997
1004
  function addEdge(ctx, kind, source, target, extras) {
998
1005
  const edge = { id: `static:edge_${ctx.edgeSeq++}`, source, target, kind };
@@ -1128,13 +1135,16 @@ function walkPipe(ctx, ref, currentDomain, nodeId, parentId, scope, inv) {
1128
1135
  ctx.stack.pop();
1129
1136
  }
1130
1137
  }
1131
- function walkSubPipe(ctx, sub, domain, nodeId, parentId, scope) {
1132
- if (sub.batch_params !== null) {
1138
+ function walkSubPipe(ctx, sub, domain, nodeId, parentId, scope, inheritedMultiplicity = null) {
1139
+ var _a, _b;
1140
+ if (sub.batch_params != null) {
1133
1141
  return walkInlineBatch(ctx, sub, domain, nodeId, parentId, scope);
1134
1142
  }
1135
1143
  return walkPipe(ctx, sub.pipe_code, domain, nodeId, parentId, scope, {
1136
- resultName: sub.output_name,
1137
- outputMultiplicity: sub.output_multiplicity
1144
+ resultName: (_a = sub.output_name) != null ? _a : null,
1145
+ // A step with no `nb_output`/`multiple_output` of its own runs under the one
1146
+ // its controller was invoked with, as the runtime copies the run params down.
1147
+ outputMultiplicity: (_b = sub.output_multiplicity) != null ? _b : inheritedMultiplicity
1138
1148
  });
1139
1149
  }
1140
1150
  function finishLeaf(ctx, node, blueprint, nodeId, inv) {
@@ -1175,11 +1185,12 @@ function finishSequence(ctx, node, blueprint, nodeId, scope, inv) {
1175
1185
  blueprint.domain_code,
1176
1186
  `${nodeId}/step_${index + 1}`,
1177
1187
  nodeId,
1178
- scope
1188
+ scope,
1189
+ inv.outputMultiplicity
1179
1190
  );
1180
1191
  if (result === null) return;
1181
1192
  if (result.output !== null) {
1182
- if (sub.output_name !== null) scope.set(sub.output_name, result.output);
1193
+ if (sub.output_name != null) scope.set(sub.output_name, result.output);
1183
1194
  lastOutput = result.output;
1184
1195
  }
1185
1196
  for (const [name, stuff] of result.eachOutputs) scope.set(name, stuff);
@@ -1204,7 +1215,7 @@ function finishParallel(ctx, node, blueprint, nodeId, scope, inv) {
1204
1215
  const eachOutputs = [];
1205
1216
  if (blueprint.add_each_output) {
1206
1217
  for (const { sub, result } of branchResults) {
1207
- if (sub.output_name !== null && result.output !== null) {
1218
+ if (sub.output_name != null && result.output !== null) {
1208
1219
  eachOutputs.push([sub.output_name, result.output]);
1209
1220
  }
1210
1221
  }
@@ -1231,7 +1242,7 @@ function finishParallel(ctx, node, blueprint, nodeId, scope, inv) {
1231
1242
  function finishCondition(ctx, node, blueprint, nodeId, scope, inv) {
1232
1243
  var _a, _b, _c, _d;
1233
1244
  const conditionScope = new Map(scope);
1234
- if (blueprint.add_alias_from_expression_to !== null) {
1245
+ if (blueprint.add_alias_from_expression_to != null) {
1235
1246
  const alias = blueprint.add_alias_from_expression_to;
1236
1247
  conditionScope.set(
1237
1248
  alias,
@@ -1270,7 +1281,9 @@ function finishCondition(ctx, node, blueprint, nodeId, scope, inv) {
1270
1281
  // The runtime stores whichever branch runs under the condition's own
1271
1282
  // slot name, so every branch's output carries it (dry-run parity).
1272
1283
  resultName: inv.resultName,
1273
- outputMultiplicity: null,
1284
+ // The chosen outcome runs under the condition's own run params, its
1285
+ // invocation's `nb_output`/`multiple_output` included.
1286
+ outputMultiplicity: inv.outputMultiplicity,
1274
1287
  outcomeValue: entry.values.join(" | ")
1275
1288
  }
1276
1289
  );
@@ -1348,7 +1361,7 @@ function finishBatch(ctx, node, blueprint, nodeId, scope, inv) {
1348
1361
  return { nodeId, output: aggregate, eachOutputs: [] };
1349
1362
  }
1350
1363
  function walkInlineBatch(ctx, sub, domain, nodeId, parentId, scope) {
1351
- var _a, _b, _c, _d, _e, _f, _g;
1364
+ var _a, _b, _c, _d, _e, _f, _g, _h;
1352
1365
  const params = sub.batch_params;
1353
1366
  const aliasIdx = sub.pipe_code.lastIndexOf("->");
1354
1367
  const refTail = aliasIdx === -1 ? sub.pipe_code : sub.pipe_code.slice(aliasIdx + 2);
@@ -1390,7 +1403,7 @@ function walkInlineBatch(ctx, sub, domain, nodeId, parentId, scope) {
1390
1403
  (_g = (_e = ctx.pipeRegistry)[_f = `${domain}.${code}`]) != null ? _g : _e[_f] = blueprint;
1391
1404
  const ioInputs = bindInputs(ctx, blueprint, scope);
1392
1405
  const inv = {
1393
- resultName: sub.output_name,
1406
+ resultName: (_h = sub.output_name) != null ? _h : null,
1394
1407
  outputMultiplicity: sub.output_multiplicity
1395
1408
  };
1396
1409
  const node = emitNode(ctx, {