@bldrs-ai/conway 1.580.1549 → 1.588.1550

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.
@@ -30,7 +30,7 @@ var import_node_process = require("node:process");
30
30
  var readline = __toESM(require("node:readline"), 1);
31
31
 
32
32
  // compiled/src/version/version.js
33
- var versionString = "Conway v1.580.1549";
33
+ var versionString = "Conway v1.588.1550";
34
34
 
35
35
  // compiled/dependencies/conway-geom/interface/conway_geometry.js
36
36
  var wasmType = "";
@@ -14985,7 +14985,7 @@ ${t5.join("\n")}` : "";
14985
14985
  var import_process = require("process");
14986
14986
 
14987
14987
  // compiled/src/version/version.js
14988
- var versionString = "Conway v1.580.1549";
14988
+ var versionString = "Conway v1.588.1550";
14989
14989
 
14990
14990
  // compiled/dependencies/conway-geom/interface/conway_geometry.js
14991
14991
  function pThreadsAllowed() {
@@ -15963,7 +15963,7 @@ var ParsingBuffer = class {
15963
15963
  };
15964
15964
 
15965
15965
  // compiled/src/version/version.js
15966
- var versionString = "Conway v1.580.1549";
15966
+ var versionString = "Conway v1.588.1550";
15967
15967
 
15968
15968
  // compiled/dependencies/conway-geom/interface/conway_geometry.js
15969
15969
  function pThreadsAllowed() {
@@ -944,7 +944,7 @@ var EntityTypesIfcCount = 909;
944
944
  var entity_types_ifc_gen_default = EntityTypesIfc;
945
945
 
946
946
  // compiled/src/version/version.js
947
- var versionString = "Conway v1.580.1549";
947
+ var versionString = "Conway v1.588.1550";
948
948
 
949
949
  // compiled/dependencies/conway-geom/interface/conway_geometry.js
950
950
  var wasmType = "";
@@ -28,7 +28,11 @@ export interface ProductStructureNode {
28
28
  * nodes, `'solid'` for ephemeral sub-product solid nodes.
29
29
  */
30
30
  type: string;
31
- /** Display label: `product.name`, falling back to the NAUO name / reference designator. */
31
+ /**
32
+ * Display label: `product.name`, falling back to the NAUO name / reference
33
+ * designator, then to the part number (`product.id` / `product_definition.id`).
34
+ * `''` when the file names the node nowhere.
35
+ */
32
36
  name: string;
33
37
  /** Express id of the underlying `product_definition` (the part *type*). */
34
38
  productDefinitionExpressID: number;
@@ -204,13 +208,42 @@ export declare class AP214ProductStructureExtraction {
204
208
  * @param node The product/occurrence node to attach solid children to.
205
209
  */
206
210
  private appendSolidChildren;
211
+ /**
212
+ * Read one label candidate, treating anything unusable as absent.
213
+ *
214
+ * Every candidate below is a STEP string attribute, and the mandatory ones
215
+ * (`product.name`, `product.id`, `next_assembly_usage_occurrence.name`,
216
+ * `product_definition.id`) are extracted with `optional: false`, which
217
+ * throws `'Value in STEP was incorrectly typed'` when the slot actually
218
+ * holds `$` or a non-string — a shape exporters do emit. `formation` is an
219
+ * `extractElement` and can throw on a dangling reference the same way. A
220
+ * node label is cosmetic; a malformed one must never unwind
221
+ * {@link extractProductStructure} and cost the caller the entire tree, which
222
+ * is exactly what the derived-attribute read this replaced used to do.
223
+ *
224
+ * Whitespace-only counts as absent: the AP203 NIST files carry `' '` in
225
+ * `product_definition.description`, and a label of one space is not a label.
226
+ *
227
+ * @param read Thunk reading the candidate attribute.
228
+ * @return {string} The trimmed candidate, or `''` if it is absent, blank or
229
+ * unreadable.
230
+ */
231
+ private static labelCandidate;
207
232
  /**
208
233
  * Resolve a node label, preferring the product name, then the occurrence's
209
- * own name / reference designator.
234
+ * own name / reference designator, then the part number (`product.id`).
235
+ *
236
+ * Deliberately never reads `product_definition.name`: that attribute is
237
+ * DERIVED in AP214, and its generated getter calls `get_name_value()` in
238
+ * `ap214_functions.ts`, an unimplemented stub that throws. It is not a real
239
+ * attribute of the entity at all — `product_definition` carries only `id`
240
+ * and `description` as strings — so that read could only ever throw, and did:
241
+ * it killed the whole NavTree for any file that got this far.
210
242
  *
211
243
  * @param productDef The product definition for the node.
212
244
  * @param occurrence The NAUO edge, when this is an occurrence node.
213
- * @return {string} The best available human-readable label.
245
+ * @return {string} The best available human-readable label, or `''` when the
246
+ * file carries no usable identifier for the node.
214
247
  */
215
248
  private resolveLabel;
216
249
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ap214_product_structure_extraction.d.ts","sourceRoot":"","sources":["../../../src/AP214E3_2010/ap214_product_structure_extraction.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAkBhE;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,oBAAoB;IAEnC;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAA;IAEjB;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ,2FAA2F;IAC3F,IAAI,EAAE,MAAM,CAAA;IAEZ,2EAA2E;IAC3E,0BAA0B,EAAE,MAAM,CAAA;IAElC,mEAAmE;IACnE,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAE5B;;;;OAIG;IACH,cAAc,EAAE,MAAM,EAAE,CAAA;IAExB;;;;OAIG;IACH,sBAAsB,EAAE,MAAM,EAAE,CAAA;IAEhC,0EAA0E;IAC1E,QAAQ,EAAE,oBAAoB,EAAE,CAAA;IAEhC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IAEtC;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IAEvB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAE5B;;;;;;OAMG;IACH,0BAA0B,CAAC,EAAE,MAAM,CAAA;CACpC;AAED,yEAAyE;AACzE,eAAO,MAAM,8BAA8B,MAAM,CAAA;AAEjD,gFAAgF;AAChF,eAAO,MAAM,sCAAsC,KAAK,CAAA;AAmDxD;;;;;;;;;GASG;AACH,qBAAa,+BAA+B;IAqBtC,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC;IApBrC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAsD;IACrF,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAoB;IACxD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAwC;IACxE,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAA8B;IACrE,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAoC;IACxE,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAiC;IACvE,OAAO,CAAC,cAAc,CAAQ;IAC9B,OAAO,CAAC,oBAAoB,CAAiC;IAC7D,OAAO,CAAC,2BAA2B,CAAyC;IAE5E;;;;;;;OAOG;gBAEkB,KAAK,EAAE,cAAc,EACrB,eAAe,CAAC,EAAE,oBAAoB,YAAA;IAG3D;;;;;;;;;OASG;IACI,uBAAuB,CAAE,OAAO,CAAC,EAAE,uBAAuB,GAAI,oBAAoB,EAAE;IAuC3F;;;OAGG;IACH,OAAO,CAAC,uBAAuB;IAa/B;;;;OAIG;IACH,OAAO,CAAC,mBAAmB;IA0B3B;;;;;OAKG;IACH,OAAO,CAAC,yBAAyB;IAiCjC;;;;;;;;;OASG;IACH,OAAO,CAAC,WAAW;IAuEnB;;;;;;;OAOG;IACH,OAAO,CAAC,QAAQ;IAoBhB;;;;;OAKG;IACH,OAAO,CAAC,sBAAsB;IAc9B;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,SAAS;IA2DjB;;;;;;;;OAQG;IACH,OAAO,CAAC,mBAAmB;IA2C3B;;;;;;;OAOG;IACH,OAAO,CAAC,YAAY;IA0BpB;;;;;;;;;OASG;IACH,MAAM,CAAC,0BAA0B,CAC7B,UAAU,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,GAAI,MAAM,GAAG,SAAS;CAgBzE"}
1
+ {"version":3,"file":"ap214_product_structure_extraction.d.ts","sourceRoot":"","sources":["../../../src/AP214E3_2010/ap214_product_structure_extraction.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,oBAAoB,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AAC,sBAAsB,CAA8B;IACrE,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAoC;IACxE,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAiC;IACvE,OAAO,CAAC,cAAc,CAAQ;IAC9B,OAAO,CAAC,oBAAoB,CAAiC;IAC7D,OAAO,CAAC,2BAA2B,CAAyC;IAE5E;;;;;;;OAOG;gBAEkB,KAAK,EAAE,cAAc,EACrB,eAAe,CAAC,EAAE,oBAAoB,YAAA;IAG3D;;;;;;;;;OASG;IACI,uBAAuB,CAAE,OAAO,CAAC,EAAE,uBAAuB,GAAI,oBAAoB,EAAE;IAuC3F;;;OAGG;IACH,OAAO,CAAC,uBAAuB;IAa/B;;;;OAIG;IACH,OAAO,CAAC,mBAAmB;IA0B3B;;;;;OAKG;IACH,OAAO,CAAC,yBAAyB;IAiCjC;;;;;;;;;OASG;IACH,OAAO,CAAC,WAAW;IAuEnB;;;;;;;OAOG;IACH,OAAO,CAAC,QAAQ;IAoBhB;;;;;OAKG;IACH,OAAO,CAAC,sBAAsB;IAc9B;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,SAAS;IA2DjB;;;;;;;;OAQG;IACH,OAAO,CAAC,mBAAmB;IA2C3B;;;;;;;;;;;;;;;;;;;OAmBG;IACH,OAAO,CAAC,MAAM,CAAC,cAAc;IAS7B;;;;;;;;;;;;;;;OAeG;IACH,OAAO,CAAC,YAAY;IAmDpB;;;;;;;;;OASG;IACH,MAAM,CAAC,0BAA0B,CAC7B,UAAU,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,GAAI,MAAM,GAAG,SAAS;CAgBzE"}
@@ -367,29 +367,81 @@ export class AP214ProductStructureExtraction {
367
367
  });
368
368
  }
369
369
  }
370
+ /**
371
+ * Read one label candidate, treating anything unusable as absent.
372
+ *
373
+ * Every candidate below is a STEP string attribute, and the mandatory ones
374
+ * (`product.name`, `product.id`, `next_assembly_usage_occurrence.name`,
375
+ * `product_definition.id`) are extracted with `optional: false`, which
376
+ * throws `'Value in STEP was incorrectly typed'` when the slot actually
377
+ * holds `$` or a non-string — a shape exporters do emit. `formation` is an
378
+ * `extractElement` and can throw on a dangling reference the same way. A
379
+ * node label is cosmetic; a malformed one must never unwind
380
+ * {@link extractProductStructure} and cost the caller the entire tree, which
381
+ * is exactly what the derived-attribute read this replaced used to do.
382
+ *
383
+ * Whitespace-only counts as absent: the AP203 NIST files carry `' '` in
384
+ * `product_definition.description`, and a label of one space is not a label.
385
+ *
386
+ * @param read Thunk reading the candidate attribute.
387
+ * @return {string} The trimmed candidate, or `''` if it is absent, blank or
388
+ * unreadable.
389
+ */
390
+ static labelCandidate(read) {
391
+ try {
392
+ return read()?.trim() ?? "";
393
+ }
394
+ catch {
395
+ return "";
396
+ }
397
+ }
370
398
  /**
371
399
  * Resolve a node label, preferring the product name, then the occurrence's
372
- * own name / reference designator.
400
+ * own name / reference designator, then the part number (`product.id`).
401
+ *
402
+ * Deliberately never reads `product_definition.name`: that attribute is
403
+ * DERIVED in AP214, and its generated getter calls `get_name_value()` in
404
+ * `ap214_functions.ts`, an unimplemented stub that throws. It is not a real
405
+ * attribute of the entity at all — `product_definition` carries only `id`
406
+ * and `description` as strings — so that read could only ever throw, and did:
407
+ * it killed the whole NavTree for any file that got this far.
373
408
  *
374
409
  * @param productDef The product definition for the node.
375
410
  * @param occurrence The NAUO edge, when this is an occurrence node.
376
- * @return {string} The best available human-readable label.
411
+ * @return {string} The best available human-readable label, or `''` when the
412
+ * file carries no usable identifier for the node.
377
413
  */
378
414
  resolveLabel(productDef, occurrence) {
379
- const productName = productDef.formation?.of_product?.name;
380
- if (productName !== void 0 && productName.length > 0) {
415
+ const productName = AP214ProductStructureExtraction.labelCandidate(() => productDef.formation?.of_product?.name);
416
+ if (productName.length > 0) {
381
417
  return productName;
382
418
  }
383
419
  if (occurrence !== void 0) {
384
- if (occurrence.name.length > 0) {
385
- return occurrence.name;
420
+ const occurrenceName = AP214ProductStructureExtraction.labelCandidate(() => occurrence.name);
421
+ if (occurrenceName.length > 0) {
422
+ return occurrenceName;
386
423
  }
387
- const referenceDesignator = occurrence.reference_designator;
388
- if (referenceDesignator !== null && referenceDesignator.length > 0) {
424
+ const referenceDesignator = AP214ProductStructureExtraction.labelCandidate(() => occurrence.reference_designator);
425
+ if (referenceDesignator.length > 0) {
389
426
  return referenceDesignator;
390
427
  }
391
428
  }
392
- return productDef.name ?? "";
429
+ // `product.id` is the part number, and it is where the NIST PMI files that
430
+ // leave `product.name` blank actually put the part identity
431
+ // ('NIST PMI CTC 04 ASME1'). It is tried ahead of `product_definition.id`
432
+ // because that one is the definition *discriminator*, not a part name —
433
+ // literally 'design' in nist_stc_06_asme1_ap242-e3 — and is empty in four
434
+ // of the six corpus models that reach this line.
435
+ const productId = AP214ProductStructureExtraction.labelCandidate(() => productDef.formation?.of_product?.id);
436
+ if (productId.length > 0) {
437
+ return productId;
438
+ }
439
+ // Neither entity's `description` is in the chain: it is prose, not an
440
+ // identifier. In the same corpus it is empty, whitespace, or the sentence
441
+ // 'NIST PMI test model downloaded from http://go.usa.gov/mGVm' — worse as a
442
+ // tree label than the empty string a consumer can substitute a type name
443
+ // for.
444
+ return AP214ProductStructureExtraction.labelCandidate(() => productDef.id);
393
445
  }
394
446
  /**
395
447
  * Resolve the owning `product_definition` express id from a
@@ -198,3 +198,31 @@ describe("AP214ProductStructureExtraction ephemeral solid layer", () => {
198
198
  expect(solids.map((solid) => solid.name)).toEqual(["Body1", "Body2"]);
199
199
  });
200
200
  });
201
+ const UNNAMED_FIXTURE = "data/ap214-unnamed-product-labels.step";
202
+ const UNNAMED_ROOT_COUNT = 3;
203
+ describe("AP214ProductStructureExtraction labels for products with no name", () => {
204
+ // The regression itself. `product_definition.name` is a DERIVED attribute
205
+ // whose generated getter calls `get_name_value()`, an unimplemented stub that
206
+ // throws; resolveLabel used to end on it, so the first product that reached
207
+ // that line unwound extractProductStructure and Share got no NavTree at all
208
+ // for the model (red 'Error: Function not implemented.', tree collapsed to
209
+ // 'AuxScene > Object'). Every root in this fixture reaches that line.
210
+ test("yields a tree rather than throwing", () => {
211
+ expect(() => extractStructure(UNNAMED_FIXTURE)).not.toThrow();
212
+ expect(extractStructure(UNNAMED_FIXTURE).length).toBe(UNNAMED_ROOT_COUNT);
213
+ });
214
+ test("falls back to the part number on PRODUCT.id", () => {
215
+ const [root] = extractStructure(UNNAMED_FIXTURE);
216
+ expect(root.name).toBe("NIST PMI CTC 04 ASME1");
217
+ });
218
+ test("falls back to PRODUCT_DEFINITION.id when the product carries no id", () => {
219
+ const root = extractStructure(UNNAMED_FIXTURE)[1];
220
+ expect(root.name).toBe("BRACKET-REV-C");
221
+ });
222
+ test("is empty, not whitespace, when the file names the product nowhere", () => {
223
+ const root = extractStructure(UNNAMED_FIXTURE)[2];
224
+ // '' lets a consumer substitute a type label; ' ' would render as a blank
225
+ // NavTree row. nist_stc_09_asme1_ap242-e3 is this case for real.
226
+ expect(root.name).toBe("");
227
+ });
228
+ });
@@ -5,5 +5,5 @@
5
5
  // only the first segment (major) is meaningful and is the one CI carries forward.
6
6
  // Must stay in `vN.N.N` shape: the CI stamp regex, scripts/updateVersion.mjs, and
7
7
  // statistics.ts all match `v\d+\.\d+\.\d+`.
8
- const versionString = 'Conway v1.580.1549';
8
+ const versionString = 'Conway v1.588.1550';
9
9
  export { versionString };