@platforma-open/milaboratories.sequence-embeddings 1.4.0 → 1.4.1

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/dist/index.js CHANGED
@@ -130,14 +130,14 @@ function isCompatible(feature, isHeavy, receptor, model) {
130
130
  return modelSupports(EMBEDDING_MODELS[model], feature, isHeavy, receptor);
131
131
  }
132
132
  //#endregion
133
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.2/node_modules/@platforma-sdk/model/dist/plugin_handle.js
133
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.10/node_modules/@platforma-sdk/model/dist/plugin_handle.js
134
134
  const PLUGIN_OUTPUT_PREFIX = "plugin-output#";
135
135
  /** Construct the output key for a plugin output in the block outputs map. */
136
136
  function pluginOutputKey(handle, outputKey) {
137
137
  return `${PLUGIN_OUTPUT_PREFIX}${handle}#${outputKey}`;
138
138
  }
139
139
  //#endregion
140
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.2/node_modules/@platforma-sdk/model/dist/block_storage.js
140
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.10/node_modules/@platforma-sdk/model/dist/block_storage.js
141
141
  /**
142
142
  * Discriminator key for BlockStorage format detection.
143
143
  * This unique hash-based key identifies data as BlockStorage vs legacy formats.
@@ -379,7 +379,7 @@ function getPluginData(rawStorage, handle) {
379
379
  return pluginEntry.__data;
380
380
  }
381
381
  //#endregion
382
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.2/node_modules/@platforma-sdk/model/dist/block_migrations.js
382
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.10/node_modules/@platforma-sdk/model/dist/block_migrations.js
383
383
  /** Create a DataVersioned wrapper with correct shape */
384
384
  function makeVersionedData(version, data) {
385
385
  return {
@@ -874,7 +874,7 @@ var DataModel = class DataModel {
874
874
  }
875
875
  };
876
876
  //#endregion
877
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.2/node_modules/@platforma-sdk/model/dist/internal.js
877
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.10/node_modules/@platforma-sdk/model/dist/internal.js
878
878
  /** Utility code helping to identify whether the code is running in actual UI environment */
879
879
  function isInUI() {
880
880
  return typeof globalThis.getPlatforma !== "undefined" || typeof globalThis.platforma !== "undefined";
@@ -944,7 +944,7 @@ function registerFutureAwait(handle, onResolve) {
944
944
  futureResolves.get(handle).push(onResolve);
945
945
  }
946
946
  //#endregion
947
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.2/node_modules/@platforma-sdk/model/dist/block_storage_facade.js
947
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.10/node_modules/@platforma-sdk/model/dist/block_storage_facade.js
948
948
  /**
949
949
  * All facade callback names as constants.
950
950
  * These are the source of truth - the interface is derived from these.
@@ -979,7 +979,7 @@ function registerFacadeCallbacks(callbacks) {
979
979
  for (const key of Object.values(BlockStorageFacadeCallbacks)) tryRegisterCallback(key, callbacks[key]);
980
980
  }
981
981
  //#endregion
982
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.2/node_modules/@platforma-sdk/model/dist/render/future.js
982
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.10/node_modules/@platforma-sdk/model/dist/render/future.js
983
983
  var FutureRef = class FutureRef {
984
984
  handle;
985
985
  postProcess;
@@ -4560,12 +4560,12 @@ objectType({
4560
4560
  to: numberType().min(1)
4561
4561
  });
4562
4562
  //#endregion
4563
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.1/node_modules/@milaboratories/pl-model-common/dist/util.js
4563
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.3/node_modules/@milaboratories/pl-model-common/dist/util.js
4564
4564
  function assertNever(x) {
4565
4565
  throw new Error("Unexpected object: " + x);
4566
4566
  }
4567
4567
  //#endregion
4568
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.1/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/data_info.js
4568
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.3/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/data_info.js
4569
4569
  /**
4570
4570
  * Type guard function that checks if the given value is a valid DataInfo.
4571
4571
  *
@@ -4756,7 +4756,7 @@ function entriesToDataInfo(dataInfoEntries) {
4756
4756
  }
4757
4757
  }
4758
4758
  //#endregion
4759
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.1/node_modules/@milaboratories/pl-model-common/dist/errors.js
4759
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.3/node_modules/@milaboratories/pl-model-common/dist/errors.js
4760
4760
  var ServiceError = class extends Error {
4761
4761
  name = "ServiceError";
4762
4762
  };
@@ -4780,7 +4780,7 @@ function ensureError(value) {
4780
4780
  return new Error(stringifyValue(value));
4781
4781
  }
4782
4782
  //#endregion
4783
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.1/node_modules/@milaboratories/pl-model-common/dist/json.js
4783
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.3/node_modules/@milaboratories/pl-model-common/dist/json.js
4784
4784
  var import_canonicalize = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
4785
4785
  module.exports = function serialize(object) {
4786
4786
  if (typeof object === "number" && isNaN(object)) throw new Error("NaN is not allowed");
@@ -4813,7 +4813,7 @@ function parseJsonSafely(value, fallback) {
4813
4813
  }
4814
4814
  }
4815
4815
  //#endregion
4816
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.1/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/spec.js
4816
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.3/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/spec.js
4817
4817
  function readMetadata(metadata, key) {
4818
4818
  return metadata?.[key];
4819
4819
  }
@@ -5030,7 +5030,7 @@ function hasCycleOfParents(axisSpec) {
5030
5030
  }
5031
5031
  /** Create list of normalized axisSpec (parents are in array of specs, not indexes) */
5032
5032
  function getNormalizedAxesList(axes) {
5033
- if (!axes.length) return [];
5033
+ if (axes.length === 0) return [];
5034
5034
  const modifiedAxes = axes.map((axis) => {
5035
5035
  const { parentAxes: _, ...copiedRest } = axis;
5036
5036
  return {
@@ -5102,7 +5102,7 @@ function matchAxisId(query, target) {
5102
5102
  return query.name === target.name && matchDomain$1(query.domain, target.domain) && matchDomain$1(query.contextDomain, target.contextDomain);
5103
5103
  }
5104
5104
  //#endregion
5105
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.1/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/query/utils.js
5105
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.3/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/query/utils.js
5106
5106
  /**
5107
5107
  * Recursively traverses a SpecQuery tree bottom-up, applying visitor callbacks.
5108
5108
  *
@@ -5183,7 +5183,7 @@ function mapSpecQueryColumns(query, visitor) {
5183
5183
  return traverseQuerySpec(query, visitor);
5184
5184
  }
5185
5185
  //#endregion
5186
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.1/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/table_calculate.js
5186
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.3/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/table_calculate.js
5187
5187
  function mapPTableDef(def, cb) {
5188
5188
  return {
5189
5189
  ...def,
@@ -5226,7 +5226,7 @@ function mapJoinEntry(entry, cb) {
5226
5226
  }
5227
5227
  }
5228
5228
  //#endregion
5229
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.1/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/filtered_column.js
5229
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.3/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/filtered_column.js
5230
5230
  function stringifyColumnFilteredId(key) {
5231
5231
  return canonicalizeJson(createColumnFilteredKey(key));
5232
5232
  }
@@ -5259,7 +5259,7 @@ function applyAxisFilters(spec, axisFilters) {
5259
5259
  };
5260
5260
  }
5261
5261
  //#endregion
5262
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.1/node_modules/@milaboratories/pl-model-common/dist/pool/spec.js
5262
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.3/node_modules/@milaboratories/pl-model-common/dist/pool/spec.js
5263
5263
  function isPObjectId(value) {
5264
5264
  if (typeof value !== "string") return false;
5265
5265
  return isPObjectKey(parseJsonSafely(value));
@@ -5343,13 +5343,13 @@ function extractAllColumns(entry) {
5343
5343
  }
5344
5344
  Array.isArray;
5345
5345
  //#endregion
5346
- //#region ../node_modules/.pnpm/@milaboratories+helpers@1.14.4/node_modules/@milaboratories/helpers/dist/error.js
5346
+ //#region ../node_modules/.pnpm/@milaboratories+helpers@1.14.5/node_modules/@milaboratories/helpers/dist/error.js
5347
5347
  function throwError(v) {
5348
5348
  if (typeof v === "string") throw new Error(v);
5349
5349
  else throw v;
5350
5350
  }
5351
5351
  //#endregion
5352
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.1/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/discovered_column.js
5352
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.3/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/discovered_column.js
5353
5353
  function isColumnDiscoveredKey(obj) {
5354
5354
  return typeof obj === "object" && obj !== null && "__isDiscovered" in obj;
5355
5355
  }
@@ -5433,7 +5433,7 @@ function isString(value) {
5433
5433
  return typeof value === "string";
5434
5434
  }
5435
5435
  //#endregion
5436
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.1/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/ids.js
5436
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.3/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/ids.js
5437
5437
  /**
5438
5438
  * Canonically serializes a column key to a branded string id. Accepts both
5439
5439
  * the new {@link ColumnUniversalKey} and the deprecated {@link UniversalPColumnId}
@@ -5464,7 +5464,7 @@ function extractPObjectId(id) {
5464
5464
  throw new Error(`extractPObjectId: unrecognized column id structure: ${JSON.stringify(id)}`);
5465
5465
  }
5466
5466
  //#endregion
5467
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.1/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/overridden.js
5467
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.3/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/overridden.js
5468
5468
  function isColumnOverriddenKey(obj) {
5469
5469
  return typeof obj === "object" && obj !== null && "__isOverridden" in obj;
5470
5470
  }
@@ -5586,7 +5586,7 @@ function mergeRecord(a, b) {
5586
5586
  };
5587
5587
  }
5588
5588
  //#endregion
5589
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.1/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/anchored.js
5589
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.3/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/anchored.js
5590
5590
  function axisKey(axis) {
5591
5591
  return (0, import_canonicalize.default)(getAxisId(axis));
5592
5592
  }
@@ -5832,7 +5832,7 @@ function isAnchorAxisRef(value) {
5832
5832
  return typeof value === "object" && "anchor" in value;
5833
5833
  }
5834
5834
  //#endregion
5835
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.1/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/selectors.js
5835
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.3/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/selectors.js
5836
5836
  /**
5837
5837
  * Determines if an axis ID matches an axis selector.
5838
5838
  *
@@ -5913,7 +5913,7 @@ function legacyColumnSelectorsToPredicate(predicateOrSelectors) {
5913
5913
  else return (spec) => isPColumnSpec(spec) && matchPColumn(spec, predicateOrSelectors);
5914
5914
  }
5915
5915
  //#endregion
5916
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.1/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/native_id.js
5916
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.3/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/native_id.js
5917
5917
  function deriveNativeId(spec) {
5918
5918
  const result = {
5919
5919
  kind: spec.kind,
@@ -5925,7 +5925,7 @@ function deriveNativeId(spec) {
5925
5925
  return (0, import_canonicalize.default)(result);
5926
5926
  }
5927
5927
  //#endregion
5928
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.1/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/linker_columns.js
5928
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.3/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/linker_columns.js
5929
5929
  var LinkerMap = class LinkerMap {
5930
5930
  /** Graph of linkers connected by axes (single or grouped by parents) */
5931
5931
  data;
@@ -6103,7 +6103,7 @@ var LinkerMap = class LinkerMap {
6103
6103
  }
6104
6104
  };
6105
6105
  //#endregion
6106
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.1/node_modules/@milaboratories/pl-model-common/dist/flags/block_flags.js
6106
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.3/node_modules/@milaboratories/pl-model-common/dist/flags/block_flags.js
6107
6107
  /**
6108
6108
  * Required PFrames version. Bump this in lockstep with the `@milaboratories/pframes-rs-*`
6109
6109
  * version in `pnpm-workspace.yaml` so blocks built against the new SDK refuse to load on
@@ -6146,7 +6146,7 @@ function withEnrichments(ref, requireEnrichments = true) {
6146
6146
  }
6147
6147
  }
6148
6148
  //#endregion
6149
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.1/node_modules/@milaboratories/pl-model-common/dist/value_or_error.js
6149
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.3/node_modules/@milaboratories/pl-model-common/dist/value_or_error.js
6150
6150
  function mapValueInVOE(voe, cb) {
6151
6151
  return voe.ok ? {
6152
6152
  ok: true,
@@ -6154,7 +6154,7 @@ function mapValueInVOE(voe, cb) {
6154
6154
  } : voe;
6155
6155
  }
6156
6156
  //#endregion
6157
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.1/node_modules/@milaboratories/pl-model-common/dist/resource_types.js
6157
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.3/node_modules/@milaboratories/pl-model-common/dist/resource_types.js
6158
6158
  /** Well-known resource type names used across the platform. */
6159
6159
  const ResourceTypeName = {
6160
6160
  StreamManager: "StreamManager",
@@ -6198,7 +6198,7 @@ const ResourceTypeName = {
6198
6198
  SharedEnvelope: "SharedEnvelope"
6199
6199
  };
6200
6200
  //#endregion
6201
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.1/node_modules/@milaboratories/pl-model-common/dist/services/service_types.js
6201
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.3/node_modules/@milaboratories/pl-model-common/dist/services/service_types.js
6202
6202
  const SERVICE_ID_PATTERN = /^[a-zA-Z][a-zA-Z0-9]*$/;
6203
6203
  const { service, isNodeService, isWasmService, isMainService, getServiceKind, getServiceModelMethods, getServiceUiMethods } = (() => {
6204
6204
  const typeMap = /* @__PURE__ */ new Map();
@@ -6237,7 +6237,7 @@ const { service, isNodeService, isWasmService, isMainService, getServiceKind, ge
6237
6237
  };
6238
6238
  })();
6239
6239
  //#endregion
6240
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.1/node_modules/@milaboratories/pl-model-common/dist/services/service_declarations.js
6240
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.3/node_modules/@milaboratories/pl-model-common/dist/services/service_declarations.js
6241
6241
  const Services = {
6242
6242
  PFrameSpec: service()({
6243
6243
  type: "wasm",
@@ -6331,7 +6331,7 @@ function resolveRequiredServices(flags) {
6331
6331
  }
6332
6332
  Object.fromEntries(Object.keys(Services).map((key) => [`requires${key}`, true]));
6333
6333
  //#endregion
6334
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.1/node_modules/@milaboratories/pl-model-common/dist/services/service_injectors.js
6334
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.3/node_modules/@milaboratories/pl-model-common/dist/services/service_injectors.js
6335
6335
  function buildMethodMap(pick) {
6336
6336
  const result = {};
6337
6337
  for (const id of Object.values(Services)) result[id] = [...pick(id)];
@@ -6340,7 +6340,7 @@ function buildMethodMap(pick) {
6340
6340
  buildMethodMap(getServiceUiMethods);
6341
6341
  buildMethodMap(getServiceModelMethods);
6342
6342
  //#endregion
6343
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.1/node_modules/@milaboratories/pl-model-common/dist/columns/accessor_traversal.js
6343
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.3/node_modules/@milaboratories/pl-model-common/dist/columns/accessor_traversal.js
6344
6344
  /** Resource types that hold column collections — DFS stops here and collects. */
6345
6345
  const COLLECT_TYPES = [ResourceTypeName.PFrame];
6346
6346
  /** Resource types DFS descends through when looking for PFrames. */
@@ -6448,7 +6448,7 @@ function indexPoolBlock(block) {
6448
6448
  return result;
6449
6449
  }
6450
6450
  //#endregion
6451
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.1/node_modules/@milaboratories/pl-model-common/dist/columns/column_registry.js
6451
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.3/node_modules/@milaboratories/pl-model-common/dist/columns/column_registry.js
6452
6452
  /**
6453
6453
  * Id-index over a set of {@link ColumnEntriesProvider}s. Sole job:
6454
6454
  * {@link PObjectId} → {@link LeafEntry}. Generic over the accessor flavour, so
@@ -6485,7 +6485,7 @@ var ColumnRegistry = class {
6485
6485
  }
6486
6486
  };
6487
6487
  //#endregion
6488
- //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.1/node_modules/@milaboratories/pl-model-common/dist/columns/providers.js
6488
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.47.3/node_modules/@milaboratories/pl-model-common/dist/columns/providers.js
6489
6489
  /**
6490
6490
  * Generic entries provider over a single accessor root. Walks `<root>` once
6491
6491
  * from the supplied `rootPath`, builds an id → {@link LeafEntry} map and
@@ -6542,7 +6542,7 @@ var ResultPoolEntriesProvider = class {
6542
6542
  }
6543
6543
  };
6544
6544
  //#endregion
6545
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.2/node_modules/@platforma-sdk/model/dist/render/accessor.js
6545
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.10/node_modules/@platforma-sdk/model/dist/render/accessor.js
6546
6546
  function ifDef(value, cb) {
6547
6547
  return value === void 0 ? void 0 : cb(value);
6548
6548
  }
@@ -6792,11 +6792,11 @@ var TreeNodeAccessor = class TreeNodeAccessor {
6792
6792
  }
6793
6793
  };
6794
6794
  //#endregion
6795
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.2/node_modules/@platforma-sdk/model/dist/render/internal.js
6795
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.10/node_modules/@platforma-sdk/model/dist/render/internal.js
6796
6796
  const MainAccessorName = "main";
6797
6797
  const StagingAccessorName = "staging";
6798
6798
  //#endregion
6799
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.2/node_modules/@platforma-sdk/model/dist/render/util/axis_filtering.js
6799
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.10/node_modules/@platforma-sdk/model/dist/render/util/axis_filtering.js
6800
6800
  function filterDataInfoEntries(dataInfoEntries, axisFilters) {
6801
6801
  const sortedFilters = [...axisFilters].sort((a, b) => b[0] - a[0]);
6802
6802
  const { type } = dataInfoEntries;
@@ -6860,31 +6860,229 @@ function filterDataInfoEntries(dataInfoEntries, axisFilters) {
6860
6860
  }
6861
6861
  }
6862
6862
  //#endregion
6863
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.2/node_modules/@platforma-sdk/model/dist/labels/derive_distinct_labels.js
6863
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.10/node_modules/@platforma-sdk/model/dist/labels/linked_column_postfix.js
6864
+ /**
6865
+ * Structural postfix derivation for linked columns (phase 2 of `deriveDistinctLabels`).
6866
+ *
6867
+ * A linked column is
6868
+ * reached by a CHAIN of linkers, and we distinguish two such columns by the same ideology the main
6869
+ * algorithm uses — "find the minimal difference, escalate until unique" — over two dimensions:
6870
+ *
6871
+ * - root: the single source axis of the chain, derived from `linkers[0]` (one of its axesSpec).
6872
+ * This is "the source" — it's what we prefer to show ("difference of sources").
6873
+ * - linkers: the linker chain itself (by `LinkLabel`), a per-step fallback used only where roots
6874
+ * coincide.
6875
+ *
6876
+ * Nothing is stored redundantly: the caller passes the linker path (`linkers`) and the hit spec;
6877
+ * root and every token are computed on the fly. The caller also supplies the `stem` (label+trace+
6878
+ * quals from the existing single-entity machinery); this module only adds the path postfix, and
6879
+ * only where stems collide.
6880
+ */
6881
+ function defaultLinkerFormatter(parts) {
6882
+ const chain = parts.linkers.map((l) => l.text).join(" > ");
6883
+ const pieces = [parts.root?.text, chain || void 0].filter((p) => !isNil(p));
6884
+ return pieces.length === 0 ? "" : `via ${pieces.join(" ")}`;
6885
+ }
6886
+ function extractAxisIdentity(axis) {
6887
+ const id = getAxisId(axis);
6888
+ return {
6889
+ label: readAnnotation(axis, Annotation.Label)?.trim() || void 0,
6890
+ name: id.name,
6891
+ domain: id.domain,
6892
+ contextDomain: id.contextDomain
6893
+ };
6894
+ }
6895
+ /**
6896
+ * A linker is named ONLY by its human label (`LinkLabel`/`Label`) — never by its technical column
6897
+ * name. Returns `undefined` for an unlabeled linker, which callers treat as "not renderable": such a
6898
+ * step is skipped, and disambiguation falls to another step or the root.
6899
+ */
6900
+ function extractLinkerIdentity(linker) {
6901
+ const label = (readAnnotation(linker, Annotation.LinkLabel) ?? readAnnotation(linker, Annotation.Label))?.trim();
6902
+ return label ? {
6903
+ label,
6904
+ name: label
6905
+ } : void 0;
6906
+ }
6907
+ /** Domain keys where `mine` differs from at least one competitor. */
6908
+ function differingKeys(mine, others) {
6909
+ const my = mine ?? {};
6910
+ const diffKeys = /* @__PURE__ */ new Set();
6911
+ for (const o of others) {
6912
+ const od = o ?? {};
6913
+ for (const k of Object.keys(my)) if (my[k] !== od[k]) diffKeys.add(k);
6914
+ for (const k of Object.keys(od)) if (my[k] !== od[k]) diffKeys.add(k);
6915
+ }
6916
+ return [...diffKeys];
6917
+ }
6918
+ function renderWithDomain(base, keys, domain) {
6919
+ if (keys.length === 0) return base;
6920
+ const d = domain ?? {};
6921
+ return `${base}[${keys.map((k) => `${k}=${d[k] ?? "∅"}`).join(", ")}]`;
6922
+ }
6923
+ /**
6924
+ * Minimal token distinguishing `mine` from `others`: label → name → only the differing domain keys.
6925
+ * Falls back to the bare label/name when indistinguishable at this dimension (another one covers it).
6926
+ */
6927
+ function deriveToken(mine, others) {
6928
+ const base = mine.label ?? mine.name;
6929
+ if (mine.label !== void 0 && others.every((o) => o.label !== mine.label)) return mine.label;
6930
+ if (others.every((o) => o.name !== mine.name)) return base;
6931
+ const dk = differingKeys(mine.domain, others.map((o) => o.domain));
6932
+ if (dk.length > 0) return renderWithDomain(base, dk, mine.domain);
6933
+ const ck = differingKeys(mine.contextDomain, others.map((o) => o.contextDomain));
6934
+ if (ck.length > 0) return renderWithDomain(base, ck, mine.contextDomain);
6935
+ return base;
6936
+ }
6937
+ /**
6938
+ * The chain's single root: the source-side axis of `linkers[0]`. A linker bridges two axis groups;
6939
+ * the side facing the next hop (`linkers[1]`, or the hit for a single-linker chain) is the target,
6940
+ * the other side is the source → its axis is the root. `undefined` if `linkers[0]` is not a
6941
+ * well-formed two-group linker.
6942
+ */
6943
+ function extractRoot(hit, linkers) {
6944
+ const first = linkers[0];
6945
+ if (first === void 0) return void 0;
6946
+ const axes = first.axesSpec;
6947
+ if (axes.length !== 2) return void 0;
6948
+ const second = linkers[1] ?? hit;
6949
+ return axes.find((a) => !second.axesSpec.some((b) => b.name === a.name));
6950
+ }
6951
+ const ABSENT = "__ABSENT__";
6952
+ function deriveSlotKey(group, slot, row) {
6953
+ if (slot.kind === "root") {
6954
+ const r = group.roots[row];
6955
+ return r === void 0 ? ABSENT : canonicalizeJson(getAxisId(r));
6956
+ } else {
6957
+ const l = group.entries[row].linkers?.[slot.i];
6958
+ const id = l && extractLinkerIdentity(l);
6959
+ return isNil(id) ? ABSENT : canonicalizeJson(id);
6960
+ }
6961
+ }
6962
+ function deriveSlotToken(group, slot, row) {
6963
+ if (slot.kind === "root") {
6964
+ const r = group.roots[row];
6965
+ if (r === void 0) return void 0;
6966
+ const comp = group.roots.filter((o, j) => j !== row && !isNil(o)).map((o) => extractAxisIdentity(o));
6967
+ return deriveToken(extractAxisIdentity(r), comp);
6968
+ }
6969
+ const l = group.entries[row].linkers?.[slot.i];
6970
+ const id = l && extractLinkerIdentity(l);
6971
+ if (isNil(id)) return void 0;
6972
+ return deriveToken(id, group.entries.filter((_, j) => j !== row).map((e) => e.linkers?.[slot.i]).map((x) => x ? extractLinkerIdentity(x) : void 0).filter((x) => !isNil(x)));
6973
+ }
6974
+ function getDiscriminates(group, slot) {
6975
+ return new Set(group.entries.map((_, r) => deriveSlotKey(group, slot, r))).size > 1;
6976
+ }
6977
+ /** Render one row against a chosen slot set: the distinguishing root + linker pieces, formatted. */
6978
+ function renderRow(group, slots, row) {
6979
+ const rootSpec = group.roots[row];
6980
+ const rootText = slots.some((s) => s.kind === "root") ? deriveSlotToken(group, { kind: "root" }, row) : void 0;
6981
+ const root = rootSpec !== void 0 && rootText !== void 0 ? {
6982
+ spec: rootSpec,
6983
+ text: rootText
6984
+ } : void 0;
6985
+ const linkers = slots.filter((s) => s.kind === "linker").sort((a, b) => a.i - b.i).map((s) => {
6986
+ const spec = group.entries[row].linkers?.[s.i];
6987
+ const text = deriveSlotToken(group, s, row);
6988
+ return spec !== void 0 && text !== void 0 ? {
6989
+ spec,
6990
+ text
6991
+ } : void 0;
6992
+ }).filter((l) => !isNil(l));
6993
+ if (root === void 0 && linkers.length === 0) return "";
6994
+ return group.format({
6995
+ root,
6996
+ linkers
6997
+ }, group.entries[row].hit, group.indices[row]) || "";
6998
+ }
6999
+ function renderAll(group, slots) {
7000
+ return group.entries.map((_, r) => renderRow(group, slots, r));
7001
+ }
7002
+ function allUnique(rendered) {
7003
+ return new Set(rendered).size === rendered.length;
7004
+ }
7005
+ /**
7006
+ * Minimal slot set that makes the group unique. Escalate by priority (root, then linkers by step),
7007
+ * then drop any redundant slot; render every row symmetrically against the result.
7008
+ *
7009
+ * KNOWN LIMITATION (review point): symmetric render can over-decorate a row in a mixed group (e.g.
7010
+ * `via Sample MapperA` where `via Sample` alone is already unique for that row). Per-row trimming is
7011
+ * a generalized `dropRedundantLinkerSuffix`; naive greedy trimming is unstable, so it's deferred.
7012
+ */
7013
+ function resolveGroup(entries, indices, format) {
7014
+ const group = {
7015
+ entries,
7016
+ roots: entries.map((e) => e.hit && e.linkers?.length ? extractRoot(e.hit, e.linkers) : void 0),
7017
+ indices,
7018
+ format
7019
+ };
7020
+ const maxLen = Math.max(0, ...entries.map((e) => e.linkers?.length ?? 0));
7021
+ const escalated = [{ kind: "root" }, ...Array.from({ length: maxLen }, (_, i) => ({
7022
+ kind: "linker",
7023
+ i
7024
+ }))].reduce((acc, slot) => allUnique(renderAll(group, acc)) || !getDiscriminates(group, slot) ? acc : (acc.push(slot), acc), []);
7025
+ return renderAll(group, escalated.reduce((acc, slot) => {
7026
+ const trial = acc.filter((s) => s !== slot);
7027
+ return allUnique(renderAll(group, trial)) ? trial : acc;
7028
+ }, escalated));
7029
+ }
7030
+ /**
7031
+ * Full label per entry: `stem` plus, where stems collide, a minimal postfix distinguishing the
7032
+ * linked columns by the difference between their sources.
7033
+ */
7034
+ function derivePostfixes(entries, format = defaultLinkerFormatter) {
7035
+ const postfix = [...entries.reduce((acc, e, idx) => acc.set(e.stem, [...acc.get(e.stem) ?? [], idx]), /* @__PURE__ */ new Map()).values()].reduce((acc, idxs) => {
7036
+ if (idxs.length < 2) return acc;
7037
+ const resolved = resolveGroup(idxs.map((i) => entries[i]), idxs, format);
7038
+ return idxs.reduce((m, i, k) => m.set(i, resolved[k]), acc);
7039
+ }, /* @__PURE__ */ new Map());
7040
+ return entries.map((e, i) => {
7041
+ const p = postfix.get(i);
7042
+ return p ? `${e.stem} ${p}` : e.stem;
7043
+ });
7044
+ }
7045
+ //#endregion
7046
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.10/node_modules/@platforma-sdk/model/dist/labels/derive_distinct_labels.js
6864
7047
  const DISTANCE_PENALTY = .001;
6865
7048
  const LABEL_TYPE = "__LABEL__";
6866
7049
  const LABEL_TYPE_FULL = "__LABEL__@1";
6867
- const LINKER_TYPE = "__LINKER__";
6868
- const LINKER_TYPE_FULL = "__LINKER__@1";
6869
7050
  const HIT_QUAL_TYPE = "__HIT_QUAL__";
6870
7051
  const ANCHOR_QUAL_TYPE_PREFIX = "__ANCHOR_QUAL__:";
6871
7052
  function isAnchorQualType(t) {
6872
7053
  return t.startsWith(ANCHOR_QUAL_TYPE_PREFIX);
6873
7054
  }
6874
7055
  function isSyntheticType(t) {
6875
- return t === LINKER_TYPE || t === HIT_QUAL_TYPE || isAnchorQualType(t);
7056
+ return t === HIT_QUAL_TYPE || isAnchorQualType(t);
6876
7057
  }
7058
+ /**
7059
+ * Distinct labels for a set of columns. Two phases:
7060
+ * 1. {@link deriveStems} — treats each column as a single entity (native label + trace + hit/anchor
7061
+ * qualifications) and produces the minimal distinguishing "stem".
7062
+ * 2. {@link derivePostfixes} — for columns still colliding on their stem, appends a "via …" postfix
7063
+ * describing the difference between their linker sources (root axis, then linker chain).
7064
+ */
6877
7065
  function deriveDistinctLabels(values, options = {}) {
7066
+ const stems = deriveStems(values, options);
7067
+ return derivePostfixes(values.map((v, i) => {
7068
+ const { spec, linkerPath } = extractEntryParts(v);
7069
+ return {
7070
+ stem: stems[i],
7071
+ hit: spec,
7072
+ linkers: (linkerPath ?? []).map((s) => s.spec)
7073
+ };
7074
+ }), options.formatters?.linker);
7075
+ }
7076
+ /** Phase 1: minimal per-column stem — native label + trace + hit/anchor qualifications, no linkers. */
7077
+ function deriveStems(values, options) {
6878
7078
  const forceTraceElements = options.forceTraceElements !== void 0 && options.forceTraceElements.length > 0 ? new Set(options.forceTraceElements) : void 0;
6879
7079
  const separator = options.separator ?? " / ";
6880
7080
  const records = values.map((v, i) => enrichRecord(v, i, options));
6881
7081
  const stats = collectTypeStats(records);
6882
7082
  const hasAnySynthetic = records.some((r) => r.fullTrace.some((ft) => isSyntheticType(ft.type)));
6883
7083
  const labelForced = (options.includeNativeLabel === true || hasAnySynthetic) && stats.countByType.has(LABEL_TYPE_FULL);
6884
- const linkerForced = stats.countByType.get(LINKER_TYPE_FULL) === values.length;
6885
7084
  const forcedSet = /* @__PURE__ */ new Set();
6886
7085
  if (labelForced) forcedSet.add(LABEL_TYPE_FULL);
6887
- if (linkerForced) forcedSet.add(LINKER_TYPE_FULL);
6888
7086
  const { mainTypes, secondaryTypes } = classifyTypes(stats, values.length);
6889
7087
  const build = (typeSet, force) => buildLabels(records, typeSet, forceTraceElements, separator, force);
6890
7088
  if (mainTypes.length === 0) {
@@ -6900,7 +7098,7 @@ function deriveDistinctLabels(values, options = {}) {
6900
7098
  const candidateResult = build(currentSet, false);
6901
7099
  if (candidateResult !== void 0 && countUniqueLabels(candidateResult) === values.length) {
6902
7100
  const minimized = minimizeTypeSet(currentSet, records, stats, forceTraceElements, forcedSet, separator);
6903
- return dropRedundantLinkerSuffix(records, minimized, forceTraceElements, forcedSet, separator, build(minimized, false) ?? throwError("Failed to derive unique labels"));
7101
+ return repairBareByPresence(build(minimized, false) ?? throwError("Failed to derive unique labels"), minimized, records, stats, forcedSet, forceTraceElements, separator);
6904
7102
  }
6905
7103
  additionalType++;
6906
7104
  if (additionalType >= mainTypes.length) {
@@ -6913,7 +7111,7 @@ function deriveDistinctLabels(values, options = {}) {
6913
7111
  ...mainTypes,
6914
7112
  ...secondaryTypes
6915
7113
  ]), records, stats, forceTraceElements, forcedSet, separator);
6916
- return dropRedundantLinkerSuffix(records, minimized, forceTraceElements, forcedSet, separator, build(minimized, true) ?? throwError("Failed to derive unique labels"));
7114
+ return repairBareByPresence(build(minimized, true) ?? throwError("Failed to derive unique labels"), minimized, records, stats, forcedSet, forceTraceElements, separator);
6917
7115
  }
6918
7116
  function extractEntryParts(entry) {
6919
7117
  if (!("spec" in entry && typeof entry.spec === "object")) return {
@@ -6939,13 +7137,6 @@ function formatQualification(q) {
6939
7137
  function formatQualifications(qs) {
6940
7138
  return qs.map(formatQualification).join("; ");
6941
7139
  }
6942
- function computeStepLabel(step, stepIndex, formatters) {
6943
- const base = (readAnnotation(step.spec, Annotation.LinkLabel) ?? readAnnotation(step.spec, Annotation.Label))?.trim();
6944
- if (isNil(base) || base.length === 0) return void 0;
6945
- if (step.qualifications === void 0 || step.qualifications.length === 0) return base;
6946
- const qualText = isFunction(formatters?.linkerStepQualification) ? formatters.linkerStepQualification(step.qualifications, stepIndex, step.spec) : `[${formatQualifications(step.qualifications)}]`;
6947
- return isNil(qualText) ? base : `${base} ${qualText}`;
6948
- }
6949
7140
  function buildFullTrace(trace) {
6950
7141
  const result = [];
6951
7142
  const occurrences = /* @__PURE__ */ new Map();
@@ -6963,7 +7154,7 @@ function buildFullTrace(trace) {
6963
7154
  return result;
6964
7155
  }
6965
7156
  function enrichRecord(value, index, options) {
6966
- const { spec, extraTrace, linkerPath, qualifications } = extractEntryParts(value);
7157
+ const { spec, extraTrace, qualifications } = extractEntryParts(value);
6967
7158
  const formatters = options.formatters;
6968
7159
  const rawLabel = readAnnotation(spec, Annotation.Label);
6969
7160
  const traceStr = readAnnotation(spec, Annotation.Trace);
@@ -6987,17 +7178,6 @@ function enrichRecord(value, index, options) {
6987
7178
  else trace.splice(0, 0, labelEntry);
6988
7179
  }
6989
7180
  }
6990
- if (linkerPath !== void 0 && linkerPath.length > 0) {
6991
- const stepLabels = linkerPath.map((step, i) => computeStepLabel(step, i, formatters)).filter((s) => !isNil(s));
6992
- if (stepLabels.length > 0) {
6993
- const linkerText = isFunction(formatters?.linker) ? formatters.linker(stepLabels, spec, index) : `via ${stepLabels.join(" > ")}`;
6994
- if (!isNil(linkerText)) trace.push({
6995
- type: LINKER_TYPE,
6996
- label: linkerText,
6997
- importance: -10
6998
- });
6999
- }
7000
- }
7001
7181
  if (qualifications !== void 0 && qualifications.forQueries !== void 0) {
7002
7182
  for (const [anchorId, qs] of Object.entries(qualifications.forQueries)) {
7003
7183
  if (qs.length === 0) continue;
@@ -7049,21 +7229,18 @@ function classifyTypes(stats, totalRecords) {
7049
7229
  function renderRecordLabel(record, includedTypes, forceTraceElements, separator) {
7050
7230
  const traceParts = [];
7051
7231
  const anchorParts = [];
7052
- let linkerLabel;
7053
7232
  let hitLabel;
7054
7233
  for (const ft of record.fullTrace) {
7055
7234
  if (!(includedTypes.has(ft.fullType) || forceTraceElements?.has(ft.type))) continue;
7056
- if (ft.type === LINKER_TYPE) linkerLabel = ft.label;
7057
- else if (ft.type === HIT_QUAL_TYPE) hitLabel = ft.label;
7235
+ if (ft.type === HIT_QUAL_TYPE) hitLabel = ft.label;
7058
7236
  else if (isAnchorQualType(ft.type)) anchorParts.push(ft.label);
7059
7237
  else traceParts.push(ft.label);
7060
7238
  }
7061
- if (traceParts.length === 0 && anchorParts.length === 0 && linkerLabel === void 0 && hitLabel === void 0) return void 0;
7239
+ if (traceParts.length === 0 && anchorParts.length === 0 && hitLabel === void 0) return void 0;
7062
7240
  let label = traceParts.join(separator);
7063
7241
  const append = (part) => {
7064
7242
  label = label.length === 0 ? part : `${label} ${part}`;
7065
7243
  };
7066
- if (linkerLabel !== void 0) append(linkerLabel);
7067
7244
  for (const a of anchorParts) append(a);
7068
7245
  if (hitLabel !== void 0) append(hitLabel);
7069
7246
  return label;
@@ -7081,32 +7258,6 @@ function buildLabels(records, includedTypes, forceTraceElements, separator, forc
7081
7258
  }
7082
7259
  return result;
7083
7260
  }
7084
- /**
7085
- * Drop the "via …" linker suffix from records whose label is already unique without it.
7086
- *
7087
- * Global minimization may include `LINKER_TYPE_FULL` solely to resolve a collision between a
7088
- * subset of records — but `buildLabels` then renders the suffix on every record that carries a
7089
- * linker trace entry, including ones whose stem is already unique. We strip the suffix where it
7090
- * isn't load-bearing while keeping the symmetric rendering required by `linkerForced` /
7091
- * `forceTraceElements`.
7092
- *
7093
- * Rule: a record's linker suffix is redundant iff its stem (label rendered without LINKER) does
7094
- * not appear anywhere else in the set.
7095
- */
7096
- function dropRedundantLinkerSuffix(records, globalTypeSet, forceTraceElements, forcedSet, separator, labels) {
7097
- if (!globalTypeSet.has(LINKER_TYPE_FULL)) return labels;
7098
- if (forcedSet.has(LINKER_TYPE_FULL) || forceTraceElements?.has(LINKER_TYPE)) return labels;
7099
- const setWithoutLinker = new Set(globalTypeSet);
7100
- setWithoutLinker.delete(LINKER_TYPE_FULL);
7101
- const stems = records.map((r) => renderRecordLabel(r, setWithoutLinker, forceTraceElements, separator));
7102
- const stemOccurrences = /* @__PURE__ */ new Map();
7103
- for (const s of stems) if (s !== void 0) stemOccurrences.set(s, (stemOccurrences.get(s) ?? 0) + 1);
7104
- return labels.map((label, i) => {
7105
- const stem = stems[i];
7106
- if (stem === void 0) return label;
7107
- return stemOccurrences.get(stem) === 1 ? stem : label;
7108
- });
7109
- }
7110
7261
  function countUniqueLabels(result) {
7111
7262
  if (result === void 0) return 0;
7112
7263
  return new Set(result).size;
@@ -7125,8 +7276,62 @@ function minimizeTypeSet(typeSet, records, stats, forceTraceElements, forcedSet,
7125
7276
  }
7126
7277
  return result;
7127
7278
  }
7279
+ const ABSENT_VALUE = "\0absent";
7280
+ /** Whether `fullType`'s rendered value differs across the group (absence counts as a value). */
7281
+ function typeDistinguishes(records, group, fullType) {
7282
+ const values = /* @__PURE__ */ new Set();
7283
+ for (const i of group) {
7284
+ const ft = records[i].fullTrace.find((e) => e.fullType === fullType);
7285
+ values.add(ft?.label ?? ABSENT_VALUE);
7286
+ if (values.size > 1) return true;
7287
+ }
7288
+ return false;
7289
+ }
7290
+ /** The highest-importance trace type this row HAS (outside `typeSet`) that sets it apart from its
7291
+ * group peers. `undefined` when the row carries nothing distinguishing of its own. */
7292
+ function bestDistinguishingType(records, group, row, typeSet, forcedSet, forceTraceElements, stats) {
7293
+ return records[row].fullTrace.reduce((best, ft) => {
7294
+ if (typeSet.has(ft.fullType) || forcedSet.has(ft.fullType) || forceTraceElements?.has(ft.type)) return best;
7295
+ if (!typeDistinguishes(records, group, ft.fullType)) return best;
7296
+ const imp = stats.importances.get(ft.fullType) ?? 0;
7297
+ return best === void 0 || imp > best.imp ? {
7298
+ type: ft.fullType,
7299
+ imp
7300
+ } : best;
7301
+ }, void 0)?.type;
7302
+ }
7303
+ /**
7304
+ * Un-bare columns distinguished only "by absence". After minimization a column can end up with a
7305
+ * bare trace zone (only the forced native label) while a peer sharing that same base renders extra
7306
+ * tokens — the column reads as unique purely because it LACKS what the peer has. For each such bare
7307
+ * column this re-renders JUST that column's label with the highest-importance trace type it actually
7308
+ * carries that tells it apart from its peers, so every colliding column is distinguished by a token
7309
+ * it HAS rather than by omission.
7310
+ *
7311
+ * Patches individual labels rather than the shared type set on purpose: the set is global, so adding
7312
+ * a type there would also decorate unrelated columns in other groups that happen to carry it. Only
7313
+ * bare columns' labels grow (a superset of their previous value), so uniqueness is preserved. Groups
7314
+ * are keyed by the base = the label rendered from the forced types alone.
7315
+ */
7316
+ function repairBareByPresence(labels, minimized, records, stats, forcedSet, forceTraceElements, separator) {
7317
+ const base = records.map((r) => renderRecordLabel(r, forcedSet, forceTraceElements, separator));
7318
+ const isBare = records.map((r, i) => renderRecordLabel(r, minimized, forceTraceElements, separator) === base[i]);
7319
+ const groups = records.reduce((acc, _, i) => acc.set(base[i] ?? "", [...acc.get(base[i] ?? "") ?? [], i]), /* @__PURE__ */ new Map());
7320
+ const patched = [...labels];
7321
+ for (const group of groups.values()) {
7322
+ if (!group.some((i) => !isBare[i])) continue;
7323
+ for (const i of group) {
7324
+ if (!isBare[i]) continue;
7325
+ const chosen = bestDistinguishingType(records, group, i, minimized, forcedSet, forceTraceElements, stats);
7326
+ if (chosen === void 0) continue;
7327
+ const withToken = /* @__PURE__ */ new Set([...minimized, chosen]);
7328
+ patched[i] = renderRecordLabel(records[i], withToken, forceTraceElements, separator) ?? patched[i];
7329
+ }
7330
+ }
7331
+ return patched;
7332
+ }
7128
7333
  //#endregion
7129
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.2/node_modules/@platforma-sdk/model/dist/render/util/label.js
7334
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.10/node_modules/@platforma-sdk/model/dist/render/util/label.js
7130
7335
  /** @deprecated Use deriveDistinctLabels */
7131
7336
  function deriveLabels(values, getSpec, options = {}) {
7132
7337
  return deriveDistinctLabels(values.map(getSpec), options).map((label, i) => ({
@@ -7135,7 +7340,7 @@ function deriveLabels(values, getSpec, options = {}) {
7135
7340
  }));
7136
7341
  }
7137
7342
  //#endregion
7138
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.2/node_modules/@platforma-sdk/model/dist/render/util/pcolumn_data.js
7343
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.10/node_modules/@platforma-sdk/model/dist/render/util/pcolumn_data.js
7139
7344
  const RT_RESOURCE_MAP = "PColumnData/ResourceMap";
7140
7345
  const RT_RESOURCE_MAP_PARTITIONED = "PColumnData/Partitioned/ResourceMap";
7141
7346
  const RT_JSON_PARTITIONED = "PColumnData/JsonPartitioned";
@@ -7433,7 +7638,7 @@ function allPColumnsReady(columns) {
7433
7638
  return columns.every(isPColumnReady);
7434
7639
  }
7435
7640
  //#endregion
7436
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.2/node_modules/@platforma-sdk/model/dist/render/util/column_collection.js
7641
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.10/node_modules/@platforma-sdk/model/dist/render/util/column_collection.js
7437
7642
  function isPColumnValues(value) {
7438
7643
  if (!Array.isArray(value)) return false;
7439
7644
  if (value.length === 0) return true;
@@ -7711,7 +7916,7 @@ var PColumnCollection = class {
7711
7916
  }
7712
7917
  };
7713
7918
  //#endregion
7714
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.2/node_modules/@platforma-sdk/model/dist/services/block_services.js
7919
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.10/node_modules/@platforma-sdk/model/dist/services/block_services.js
7715
7920
  /**
7716
7921
  * Services required by all V3 blocks by default.
7717
7922
  * Edit this when a new service should be available to all blocks.
@@ -7727,7 +7932,7 @@ const BLOCK_SERVICE_FLAGS = {
7727
7932
  };
7728
7933
  resolveRequiredServices(BLOCK_SERVICE_FLAGS);
7729
7934
  //#endregion
7730
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.2/node_modules/@platforma-sdk/model/dist/services/service_bridge.js
7935
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.10/node_modules/@platforma-sdk/model/dist/services/service_bridge.js
7731
7936
  /**
7732
7937
  * Builds a ServiceProxy from a ServiceDispatch.
7733
7938
  * Each service method call is forwarded to dispatch.callServiceMethod.
@@ -7736,7 +7941,7 @@ function createServiceProxy(dispatch) {
7736
7941
  return ((serviceId) => Object.freeze(Object.fromEntries(dispatch.getServiceMethods(serviceId).map((method) => [method, (...args) => dispatch.callServiceMethod(serviceId, method, ...args)]))));
7737
7942
  }
7738
7943
  //#endregion
7739
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.2/node_modules/@platforma-sdk/model/dist/services/get_services.js
7944
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.10/node_modules/@platforma-sdk/model/dist/services/get_services.js
7740
7945
  const cachedServices = /* @__PURE__ */ new WeakMap();
7741
7946
  function getService(name, deps) {
7742
7947
  const ctx = deps?.ctx ?? getCfgRenderCtx();
@@ -7750,7 +7955,7 @@ function getService(name, deps) {
7750
7955
  })();
7751
7956
  }
7752
7957
  //#endregion
7753
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.2/node_modules/@platforma-sdk/model/dist/render/util/pframe_upgraders.js
7958
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.10/node_modules/@platforma-sdk/model/dist/render/util/pframe_upgraders.js
7754
7959
  function patchInSetFilters(filters) {
7755
7960
  const inSetToOrEqual = (predicate) => {
7756
7961
  if (predicate.operator !== "InSet") return predicate;
@@ -7788,7 +7993,7 @@ function patchInSetFilters(filters) {
7788
7993
  return filters.map((filter) => mapFilter(filter, inSetToOrEqual));
7789
7994
  }
7790
7995
  //#endregion
7791
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.2/node_modules/@platforma-sdk/model/dist/render/api.js
7996
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.10/node_modules/@platforma-sdk/model/dist/render/api.js
7792
7997
  /**
7793
7998
  * Helper function to match domain objects
7794
7999
  * @param query Optional domain to match against
@@ -8237,27 +8442,27 @@ var PluginRenderCtx = class extends RenderCtxBase {
8237
8442
  }
8238
8443
  };
8239
8444
  //#endregion
8240
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.2/node_modules/@platforma-sdk/model/dist/version.js
8241
- const PlatformaSDKVersion = "1.80.2";
8445
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.10/node_modules/@platforma-sdk/model/dist/version.js
8446
+ const PlatformaSDKVersion = "1.80.10";
8242
8447
  //#endregion
8243
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.2/node_modules/@platforma-sdk/model/dist/bconfig/types.js
8448
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.10/node_modules/@platforma-sdk/model/dist/bconfig/types.js
8244
8449
  function isConfigLambda(cfgOrFh) {
8245
8450
  return cfgOrFh.__renderLambda === true;
8246
8451
  }
8247
8452
  //#endregion
8248
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.2/node_modules/@platforma-sdk/model/dist/bconfig/normalization.js
8453
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.10/node_modules/@platforma-sdk/model/dist/bconfig/normalization.js
8249
8454
  function downgradeCfgOrLambda(data) {
8250
8455
  if (data === void 0) return void 0;
8251
8456
  if (isConfigLambda(data)) return data.handle;
8252
8457
  return data;
8253
8458
  }
8254
8459
  //#endregion
8255
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.2/node_modules/@platforma-sdk/model/dist/plugin_model.js
8460
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.10/node_modules/@platforma-sdk/model/dist/plugin_model.js
8256
8461
  /** Internal plugin↔block handshake. `Symbol.for` (not `Symbol`) so it stays
8257
8462
  * identical across multiple `@platforma-sdk/model` copies in one process. */
8258
8463
  const CREATE_PLUGIN_MODEL = Symbol.for("@platforma-sdk/model:createPluginModel");
8259
8464
  //#endregion
8260
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.2/node_modules/@platforma-sdk/model/dist/block_storage_callbacks.js
8465
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.10/node_modules/@platforma-sdk/model/dist/block_storage_callbacks.js
8261
8466
  /**
8262
8467
  * BlockStorage Callback Implementations - wired to facade callbacks in BlockModelV3.done().
8263
8468
  *
@@ -8434,7 +8639,7 @@ function derivePrerunArgsFromStorage(storageJson, argsFunction, prerunArgsFuncti
8434
8639
  }
8435
8640
  }
8436
8641
  //#endregion
8437
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.2/node_modules/@platforma-sdk/model/dist/block_model.js
8642
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.10/node_modules/@platforma-sdk/model/dist/block_model.js
8438
8643
  /**
8439
8644
  * Merges two feature flag objects with type-aware logic:
8440
8645
  * - `supports*` (boolean): OR — `true` if either side is `true`
@@ -8746,7 +8951,7 @@ var BlockModelV3 = class BlockModelV3 {
8746
8951
  }
8747
8952
  };
8748
8953
  //#endregion
8749
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.2/node_modules/@platforma-sdk/model/dist/columns/column_recipes/leaf_rebrand.js
8954
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.10/node_modules/@platforma-sdk/model/dist/columns/column_recipes/leaf_rebrand.js
8750
8955
  /**
8751
8956
  * Replace every column leaf whose id equals `fromId` with `toId`, leaving
8752
8957
  * other column refs (linkers, sub-anchors) intact. Wrapper recipes
@@ -8764,7 +8969,7 @@ function rebrandLeafId(node, fromId, toId) {
8764
8969
  return mapSpecQueryColumns(node, { column: (id) => id === fromId ? toId : id });
8765
8970
  }
8766
8971
  //#endregion
8767
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.2/node_modules/@platforma-sdk/model/dist/columns/column_recipes/column_overrided_recipe.js
8972
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.10/node_modules/@platforma-sdk/model/dist/columns/column_recipes/column_overrided_recipe.js
8768
8973
  /**
8769
8974
  * Recipe wrapper that overlays {@link SpecOverrides} on top of any other
8770
8975
  * recipe. The id is `ColumnOverriddenKey { source: inner.id, specOverrides }`.
@@ -8859,7 +9064,7 @@ var ColumnOverriddenRecipe = class ColumnOverriddenRecipe {
8859
9064
  }
8860
9065
  };
8861
9066
  //#endregion
8862
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.2/node_modules/@platforma-sdk/model/dist/columns/column_recipes/column_discovered_recipe.js
9067
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.10/node_modules/@platforma-sdk/model/dist/columns/column_recipes/column_discovered_recipe.js
8863
9068
  /**
8864
9069
  * Recipe for columns identified by a {@link ColumnDiscoveredKey}: a base
8865
9070
  * column + a `path` of linkers + qualifications.
@@ -9030,7 +9235,7 @@ function referencedUniIdsOf(key) {
9030
9235
  return /* @__PURE__ */ new Set([key.column, ...(key.path ?? []).map((item) => item.column)]);
9031
9236
  }
9032
9237
  //#endregion
9033
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.2/node_modules/@platforma-sdk/model/dist/columns/column_recipes/column_filtered_recipe.js
9238
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.10/node_modules/@platforma-sdk/model/dist/columns/column_recipes/column_filtered_recipe.js
9034
9239
  /**
9035
9240
  * Recipe wrapper that fixes the values of selected axes of an inner recipe
9036
9241
  * (axis slicing). The id is `FilteredPColumnId { source: inner.id,
@@ -9793,7 +9998,7 @@ var T = (u) => !!u && u === Math.floor(u) && u > 0 && isFinite(u), G = (u) => T(
9793
9998
  }
9794
9999
  };
9795
10000
  //#endregion
9796
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.2/node_modules/@platforma-sdk/model/dist/columns/column_providers/providers.js
10001
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.10/node_modules/@platforma-sdk/model/dist/columns/column_providers/providers.js
9797
10002
  /**
9798
10003
  * Unified memoised factory dispatching to the right provider flavour by the
9799
10004
  * source shape:
@@ -9882,7 +10087,7 @@ function hashRawPool(rawPool) {
9882
10087
  return rawPool.map((b) => `${b.blockId}\x1f${b.prodCtx ?? ""}\x1f${b.stagingCtx ?? ""}\x1f${b.prodIncomplete ? 1 : 0}\x1f${b.stagingIncomplete ? 1 : 0}`).join("");
9883
10088
  }
9884
10089
  //#endregion
9885
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.2/node_modules/@platforma-sdk/model/dist/columns/column_providers/index.js
10090
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.10/node_modules/@platforma-sdk/model/dist/columns/column_providers/index.js
9886
10091
  /**
9887
10092
  * Build the default set of ColumnsProviders for the ambient render ctx:
9888
10093
  * - `AccessorColumnsProvider` over `outputs` (if present)
@@ -9912,7 +10117,7 @@ function getCtxProviders(deps) {
9912
10117
  return providers;
9913
10118
  }
9914
10119
  //#endregion
9915
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.2/node_modules/@platforma-sdk/model/dist/columns/column_lazy.js
10120
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.10/node_modules/@platforma-sdk/model/dist/columns/column_lazy.js
9916
10121
  /**
9917
10122
  * Thrown by leaf-recipe factories when the requested column is provably
9918
10123
  * absent in the active render ctx — i.e. every relevant accessor reports
@@ -10141,7 +10346,7 @@ function memoizeByEntry(fn) {
10141
10346
  };
10142
10347
  }
10143
10348
  //#endregion
10144
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.2/node_modules/@platforma-sdk/model/dist/columns/column_recipes/index.js
10349
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.10/node_modules/@platforma-sdk/model/dist/columns/column_recipes/index.js
10145
10350
  /**
10146
10351
  * Build a `ColumnRecipe` from a stringified id. Dispatches to the matching
10147
10352
  * concrete recipe variant based on the id's encoding and recurses on
@@ -10192,7 +10397,7 @@ function ColumnRecipeGetStatus(id, opts = {}) {
10192
10397
  }
10193
10398
  const ColumnRecipe = Object.assign(ColumnRecipeBuild, { getStatus: ColumnRecipeGetStatus });
10194
10399
  //#endregion
10195
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.2/node_modules/@platforma-sdk/model/dist/columns/column.js
10400
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.80.10/node_modules/@platforma-sdk/model/dist/columns/column.js
10196
10401
  /**
10197
10402
  * Unified entry point — routes between the two top-level dispatchers:
10198
10403
  * - string id (`PObjectId` / `ColumnUniversalId`) → {@link ColumnRecipe}
@@ -10311,8 +10516,12 @@ const blockDataModel = new DataModelBuilder().from("Ver_2026_05_29").migrate("Ve
10311
10516
  //#region ../model/dist/scopes.js
10312
10517
  /**
10313
10518
  * Selectors for candidate sequence columns under the `main` anchor's key axis.
10314
- * Peptide inputs match only the first; antibody/TCR inputs match the VDJ ones.
10315
- * Filtered on amino-acid alphabetembeddings read AA sequence.
10519
+ * Peptide-family inputs match the first two (`pl7.app/sequence` with a `peptide`
10520
+ * or `amplicon-sequence` featurethe latter is the synthetic-repertoire-profiler's
10521
+ * whole-variant sequence); antibody/TCR inputs match the VDJ ones. A selector's
10522
+ * domain is a single fixed map and can't OR two feature values, so the two
10523
+ * peptide-family features need two entries. All filtered on amino-acid alphabet —
10524
+ * embeddings read AA sequence.
10316
10525
  */
10317
10526
  const SEQUENCE_SELECTORS = [
10318
10527
  {
@@ -10326,6 +10535,17 @@ const SEQUENCE_SELECTORS = [
10326
10535
  "pl7.app/alphabet": "aminoacid"
10327
10536
  }
10328
10537
  },
10538
+ {
10539
+ axes: [{
10540
+ anchor: "main",
10541
+ idx: 1
10542
+ }],
10543
+ name: "pl7.app/sequence",
10544
+ domain: {
10545
+ "pl7.app/feature": "amplicon-sequence",
10546
+ "pl7.app/alphabet": "aminoacid"
10547
+ }
10548
+ },
10329
10549
  {
10330
10550
  axes: [{
10331
10551
  anchor: "main",
@@ -10394,7 +10614,7 @@ function buildScopeConfig(entries, receptor, bulkChain) {
10394
10614
  const name = e.spec.name;
10395
10615
  const d = e.spec.domain ?? {};
10396
10616
  const assembling = isAssembling(e.spec);
10397
- if (name === "pl7.app/sequence" && d["pl7.app/feature"] === "peptide") {
10617
+ if (name === "pl7.app/sequence" && (d["pl7.app/feature"] === "peptide" || d["pl7.app/feature"] === "amplicon-sequence")) {
10398
10618
  scopes.push({
10399
10619
  id: e.id,
10400
10620
  feature: "peptide",