@ifc-lite/parser 5.2.0 → 6.2.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.
Files changed (153) hide show
  1. package/dist/columnar-entity-preparation.d.ts +3 -0
  2. package/dist/columnar-entity-preparation.d.ts.map +1 -1
  3. package/dist/columnar-entity-preparation.js +101 -11
  4. package/dist/columnar-entity-preparation.js.map +1 -1
  5. package/dist/columnar-parser-indexes.d.ts +17 -1
  6. package/dist/columnar-parser-indexes.d.ts.map +1 -1
  7. package/dist/columnar-parser-indexes.js +31 -21
  8. package/dist/columnar-parser-indexes.js.map +1 -1
  9. package/dist/columnar-parser.d.ts +10 -1
  10. package/dist/columnar-parser.d.ts.map +1 -1
  11. package/dist/columnar-parser.js +14 -2
  12. package/dist/columnar-parser.js.map +1 -1
  13. package/dist/cost-extractor.d.ts +10 -0
  14. package/dist/cost-extractor.d.ts.map +1 -0
  15. package/dist/cost-extractor.js +369 -0
  16. package/dist/cost-extractor.js.map +1 -0
  17. package/dist/cost-schedule-2x3.d.ts +31 -0
  18. package/dist/cost-schedule-2x3.d.ts.map +1 -0
  19. package/dist/cost-schedule-2x3.js +75 -0
  20. package/dist/cost-schedule-2x3.js.map +1 -0
  21. package/dist/cost-types.d.ts +105 -0
  22. package/dist/cost-types.d.ts.map +1 -0
  23. package/dist/cost-types.js +5 -0
  24. package/dist/cost-types.js.map +1 -0
  25. package/dist/data-store-transport.d.ts +1 -0
  26. package/dist/data-store-transport.d.ts.map +1 -1
  27. package/dist/data-store-transport.js +5 -29
  28. package/dist/data-store-transport.js.map +1 -1
  29. package/dist/drop-census.d.ts +136 -0
  30. package/dist/drop-census.d.ts.map +1 -0
  31. package/dist/drop-census.js +53 -0
  32. package/dist/drop-census.js.map +1 -0
  33. package/dist/entity-scanner.d.ts.map +1 -1
  34. package/dist/entity-scanner.js +10 -5
  35. package/dist/entity-scanner.js.map +1 -1
  36. package/dist/generated/ifc2x3/schema-registry.d.ts +50 -0
  37. package/dist/generated/ifc2x3/schema-registry.d.ts.map +1 -0
  38. package/dist/generated/ifc2x3/schema-registry.js +50052 -0
  39. package/dist/generated/ifc2x3/schema-registry.js.map +1 -0
  40. package/dist/generated/ifc4x3/schema-registry.d.ts +50 -0
  41. package/dist/generated/ifc4x3/schema-registry.d.ts.map +1 -0
  42. package/dist/generated/ifc4x3/schema-registry.js +71299 -0
  43. package/dist/generated/ifc4x3/schema-registry.js.map +1 -0
  44. package/dist/generated/schema-registry-by-version.d.ts +61 -0
  45. package/dist/generated/schema-registry-by-version.d.ts.map +1 -0
  46. package/dist/generated/schema-registry-by-version.js +86 -0
  47. package/dist/generated/schema-registry-by-version.js.map +1 -0
  48. package/dist/georef-extractor.js +5 -5
  49. package/dist/georef-extractor.js.map +1 -1
  50. package/dist/group-assignment-factor.d.ts +13 -0
  51. package/dist/group-assignment-factor.d.ts.map +1 -0
  52. package/dist/group-assignment-factor.js +30 -0
  53. package/dist/group-assignment-factor.js.map +1 -0
  54. package/dist/ifczip.d.ts +7 -1
  55. package/dist/ifczip.d.ts.map +1 -1
  56. package/dist/ifczip.js +80 -14
  57. package/dist/ifczip.js.map +1 -1
  58. package/dist/index.d.ts +7 -2
  59. package/dist/index.d.ts.map +1 -1
  60. package/dist/index.js +13 -2
  61. package/dist/index.js.map +1 -1
  62. package/dist/on-demand-extractors.d.ts +1 -0
  63. package/dist/on-demand-extractors.d.ts.map +1 -1
  64. package/dist/on-demand-extractors.js +2 -1
  65. package/dist/on-demand-extractors.js.map +1 -1
  66. package/dist/property-value-parser.d.ts +10 -0
  67. package/dist/property-value-parser.d.ts.map +1 -1
  68. package/dist/property-value-parser.js +40 -1
  69. package/dist/property-value-parser.js.map +1 -1
  70. package/dist/scan-entities-balanced.d.ts.map +1 -1
  71. package/dist/scan-entities-balanced.js +11 -6
  72. package/dist/scan-entities-balanced.js.map +1 -1
  73. package/dist/scan-worker-lexing.d.ts +14 -0
  74. package/dist/scan-worker-lexing.d.ts.map +1 -0
  75. package/dist/scan-worker-lexing.js +106 -0
  76. package/dist/scan-worker-lexing.js.map +1 -0
  77. package/dist/scan-worker-source.d.ts +1 -1
  78. package/dist/scan-worker-source.d.ts.map +1 -1
  79. package/dist/scan-worker-source.js +64 -59
  80. package/dist/scan-worker-source.js.map +1 -1
  81. package/dist/schedule-extractor.d.ts +2 -80
  82. package/dist/schedule-extractor.d.ts.map +1 -1
  83. package/dist/schedule-extractor.js +100 -225
  84. package/dist/schedule-extractor.js.map +1 -1
  85. package/dist/schedule-serializer-builders.d.ts +28 -0
  86. package/dist/schedule-serializer-builders.d.ts.map +1 -0
  87. package/dist/schedule-serializer-builders.js +163 -0
  88. package/dist/schedule-serializer-builders.js.map +1 -0
  89. package/dist/schedule-serializer.d.ts +6 -0
  90. package/dist/schedule-serializer.d.ts.map +1 -1
  91. package/dist/schedule-serializer.js +26 -165
  92. package/dist/schedule-serializer.js.map +1 -1
  93. package/dist/schedule-types.d.ts +211 -0
  94. package/dist/schedule-types.d.ts.map +1 -0
  95. package/dist/schedule-types.js +221 -0
  96. package/dist/schedule-types.js.map +1 -0
  97. package/dist/spatial-hierarchy-ambiguity.d.ts +39 -0
  98. package/dist/spatial-hierarchy-ambiguity.d.ts.map +1 -0
  99. package/dist/spatial-hierarchy-ambiguity.js +25 -0
  100. package/dist/spatial-hierarchy-ambiguity.js.map +1 -0
  101. package/dist/spatial-hierarchy-attributes.d.ts +54 -0
  102. package/dist/spatial-hierarchy-attributes.d.ts.map +1 -0
  103. package/dist/spatial-hierarchy-attributes.js +145 -0
  104. package/dist/spatial-hierarchy-attributes.js.map +1 -0
  105. package/dist/spatial-hierarchy-builder.d.ts +0 -30
  106. package/dist/spatial-hierarchy-builder.d.ts.map +1 -1
  107. package/dist/spatial-hierarchy-builder.js +45 -167
  108. package/dist/spatial-hierarchy-builder.js.map +1 -1
  109. package/dist/spatial-hierarchy-canonical-parent.d.ts +52 -2
  110. package/dist/spatial-hierarchy-canonical-parent.d.ts.map +1 -1
  111. package/dist/spatial-hierarchy-canonical-parent.js +153 -4
  112. package/dist/spatial-hierarchy-canonical-parent.js.map +1 -1
  113. package/dist/step-lexing.d.ts +1 -1
  114. package/dist/step-lexing.d.ts.map +1 -1
  115. package/dist/step-lexing.js +1 -56
  116. package/dist/step-lexing.js.map +1 -1
  117. package/dist/step-record-boundary.d.ts +28 -0
  118. package/dist/step-record-boundary.d.ts.map +1 -0
  119. package/dist/step-record-boundary.js +133 -0
  120. package/dist/step-record-boundary.js.map +1 -0
  121. package/dist/step-record-boundary.vectors.d.ts +102 -0
  122. package/dist/step-record-boundary.vectors.d.ts.map +1 -0
  123. package/dist/step-record-boundary.vectors.js +131 -0
  124. package/dist/step-record-boundary.vectors.js.map +1 -0
  125. package/dist/structural-extractor.d.ts +9 -0
  126. package/dist/structural-extractor.d.ts.map +1 -0
  127. package/dist/structural-extractor.js +310 -0
  128. package/dist/structural-extractor.js.map +1 -0
  129. package/dist/structural-load-extractor.d.ts +147 -0
  130. package/dist/structural-load-extractor.d.ts.map +1 -0
  131. package/dist/structural-load-extractor.js +178 -0
  132. package/dist/structural-load-extractor.js.map +1 -0
  133. package/dist/structural-step-values.d.ts +51 -0
  134. package/dist/structural-step-values.d.ts.map +1 -0
  135. package/dist/structural-step-values.js +109 -0
  136. package/dist/structural-step-values.js.map +1 -0
  137. package/dist/structural-types.d.ts +145 -0
  138. package/dist/structural-types.d.ts.map +1 -0
  139. package/dist/structural-types.js +5 -0
  140. package/dist/structural-types.js.map +1 -0
  141. package/dist/tokenizer.d.ts +11 -5
  142. package/dist/tokenizer.d.ts.map +1 -1
  143. package/dist/tokenizer.js +78 -21
  144. package/dist/tokenizer.js.map +1 -1
  145. package/dist/wasm-init-retry.d.ts +6 -42
  146. package/dist/wasm-init-retry.d.ts.map +1 -1
  147. package/dist/wasm-init-retry.js +6 -99
  148. package/dist/wasm-init-retry.js.map +1 -1
  149. package/dist/wasm-panic-forward.d.ts +7 -63
  150. package/dist/wasm-panic-forward.d.ts.map +1 -1
  151. package/dist/wasm-panic-forward.js +7 -100
  152. package/dist/wasm-panic-forward.js.map +1 -1
  153. package/package.json +5 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structural-load-extractor.js","sourceRoot":"","sources":["../src/structural-load-extractor.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAiB/D,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAE5E,wFAAwF;AACxF,MAAM,SAAS,GAAG,MAAM,CAAC;AAEzB;;;;GAIG;AACH,MAAM,uBAAuB,GAAG;IAC9B,IAAI,EAAE,CAAC;IACP,MAAM,EAAE,CAAC;IACT,SAAS,EAAE,CAAC;CACJ,CAAC;AA8GX;;;GAGG;AACH,SAAS,aAAa,CAAC,KAAc;IACnC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAC5C,2EAA2E;IAC3E,2EAA2E;IAC3E,wEAAwE;IACxE,uEAAuE;IACvE,+CAA+C;IAC/C,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAAE,OAAO,SAAS,CAAC;IAC/D,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QACvB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;YAAE,OAAO,EAAE,CAAC;QACnC,MAAM,IAAI,GAAG,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC/B,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,CAAE,IAAiB,CAAC,CAAC,CAAC,EAAE,CAAC;IACtE,CAAC,CAAC,CA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SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC;AACnE,CAAC"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * STEP value coercions and schema-derived attribute lookup shared by the
3
+ * structural extractor and its load/boundary-condition reader.
4
+ *
5
+ * Shared rather than duplicated per module on purpose: the two readers walk
6
+ * the same `EntityExtractor` output, so a coercion that disagreed between them
7
+ * — one accepting `.T.` as a boolean, the other not — would be invisible until
8
+ * a file exercised both paths over one value.
9
+ */
10
+ import type { EntityExtractor } from './entity-extractor.js';
11
+ import type { IfcDataStore } from './columnar-parser.js';
12
+ /**
13
+ * Unwrap a STEP typed value. `EntityExtractor` returns `IFCFORCEMEASURE(-100.)`
14
+ * as `['IFCFORCEMEASURE', -100]`, so every coercion below has to look through
15
+ * that wrapper before testing the value.
16
+ */
17
+ export declare function unwrapTyped(value: unknown): unknown;
18
+ export declare function asString(value: unknown): string | undefined;
19
+ export declare function asNumber(value: unknown): number | undefined;
20
+ export declare function asBoolean(value: unknown): boolean | undefined;
21
+ /** A STEP enum reaches us as `.GLOBAL_COORDS.`; return the bare label. */
22
+ export declare function asEnum(value: unknown): string | undefined;
23
+ export declare function asRef(value: unknown): number | undefined;
24
+ export declare function asRefList(value: unknown): number[];
25
+ export declare function asNumberList(value: unknown): number[] | undefined;
26
+ /**
27
+ * Resolve an attribute's STEP position from the generated registry by its
28
+ * EXPRESS name, rather than writing the index literally. A type whose registry
29
+ * entry does not carry the name answers -1, and {@link readAttr} reports the
30
+ * attribute as absent instead of reading whatever sits at a guessed offset.
31
+ */
32
+ export declare function attrIndex(type: string, attrName: string): number;
33
+ export declare function readAttr(type: string, attrs: unknown[], attrName: string): unknown;
34
+ /** Push `value` onto `key`'s list without duplicating it. */
35
+ export declare function addUnique(map: Map<number, string[]>, key: number, value: string): void;
36
+ /** One extracted STEP record, reduced to what the structural readers need. */
37
+ export interface RawEntity {
38
+ expressId: number;
39
+ /**
40
+ * Canonical EXPRESS PascalCase. STEP stores type names uppercase, and the
41
+ * house rule is that a user-facing surface carries the exact EXPRESS name,
42
+ * so the raw `IFCSTRUCTURALCURVEMEMBER` is normalized once here rather than
43
+ * at each of the six places that build a public record from it.
44
+ */
45
+ type: string;
46
+ attrs: unknown[];
47
+ /** Attribute 0 for an IfcRoot descendant; '' when absent or unreadable. */
48
+ globalId: string;
49
+ }
50
+ export declare function readEntities(extractor: EntityExtractor, store: IfcDataStore, expressIds: readonly number[]): RawEntity[];
51
+ //# sourceMappingURL=structural-step-values.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structural-step-values.d.ts","sourceRoot":"","sources":["../src/structural-step-values.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGzD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAKnD;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAG3D;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAG3D;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,CAM7D;AAED,0EAA0E;AAC1E,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAKzD;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAExD;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,CAQlD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,GAAG,SAAS,CAQjE;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAGlF;AAED,6DAA6D;AAC7D,wBAAgB,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAOtF;AAED,8EAA8E;AAC9E,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;OAKG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,EAAE,CAAC;IACjB,2EAA2E;IAC3E,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,YAAY,CAC1B,SAAS,EAAE,eAAe,EAC1B,KAAK,EAAE,YAAY,EACnB,UAAU,EAAE,SAAS,MAAM,EAAE,GAC5B,SAAS,EAAE,CAgBb"}
@@ -0,0 +1,109 @@
1
+ /* This Source Code Form is subject to the terms of the Mozilla Public
2
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
+ import { getAttributeNames, normalizeIfcTypeName } from './ifc-schema.js';
5
+ /**
6
+ * Unwrap a STEP typed value. `EntityExtractor` returns `IFCFORCEMEASURE(-100.)`
7
+ * as `['IFCFORCEMEASURE', -100]`, so every coercion below has to look through
8
+ * that wrapper before testing the value.
9
+ */
10
+ export function unwrapTyped(value) {
11
+ if (Array.isArray(value) && value.length === 2 && typeof value[0] === 'string') {
12
+ return value[1];
13
+ }
14
+ return value;
15
+ }
16
+ export function asString(value) {
17
+ const inner = unwrapTyped(value);
18
+ return typeof inner === 'string' && inner.length > 0 ? inner : undefined;
19
+ }
20
+ export function asNumber(value) {
21
+ const inner = unwrapTyped(value);
22
+ return typeof inner === 'number' && Number.isFinite(inner) ? inner : undefined;
23
+ }
24
+ export function asBoolean(value) {
25
+ const inner = unwrapTyped(value);
26
+ if (typeof inner === 'boolean')
27
+ return inner;
28
+ if (inner === '.T.' || inner === 'T')
29
+ return true;
30
+ if (inner === '.F.' || inner === 'F')
31
+ return false;
32
+ return undefined;
33
+ }
34
+ /** A STEP enum reaches us as `.GLOBAL_COORDS.`; return the bare label. */
35
+ export function asEnum(value) {
36
+ const s = asString(value);
37
+ if (!s)
38
+ return undefined;
39
+ const m = s.match(/^\.([A-Za-z0-9_]+)\.$/);
40
+ return m ? m[1] : undefined;
41
+ }
42
+ export function asRef(value) {
43
+ return typeof value === 'number' && Number.isInteger(value) && value > 0 ? value : undefined;
44
+ }
45
+ export function asRefList(value) {
46
+ if (!Array.isArray(value))
47
+ return [];
48
+ const out = [];
49
+ for (const v of value) {
50
+ const id = asRef(v);
51
+ if (id !== undefined)
52
+ out.push(id);
53
+ }
54
+ return out;
55
+ }
56
+ export function asNumberList(value) {
57
+ if (!Array.isArray(value))
58
+ return undefined;
59
+ const out = [];
60
+ for (const v of value) {
61
+ const n = asNumber(v);
62
+ if (n !== undefined)
63
+ out.push(n);
64
+ }
65
+ return out.length > 0 ? out : undefined;
66
+ }
67
+ /**
68
+ * Resolve an attribute's STEP position from the generated registry by its
69
+ * EXPRESS name, rather than writing the index literally. A type whose registry
70
+ * entry does not carry the name answers -1, and {@link readAttr} reports the
71
+ * attribute as absent instead of reading whatever sits at a guessed offset.
72
+ */
73
+ export function attrIndex(type, attrName) {
74
+ return getAttributeNames(type).indexOf(attrName);
75
+ }
76
+ export function readAttr(type, attrs, attrName) {
77
+ const i = attrIndex(type, attrName);
78
+ return i >= 0 ? attrs[i] : undefined;
79
+ }
80
+ /** Push `value` onto `key`'s list without duplicating it. */
81
+ export function addUnique(map, key, value) {
82
+ let list = map.get(key);
83
+ if (!list) {
84
+ list = [];
85
+ map.set(key, list);
86
+ }
87
+ if (!list.includes(value))
88
+ list.push(value);
89
+ }
90
+ export function readEntities(extractor, store, expressIds) {
91
+ const out = [];
92
+ for (const expressId of expressIds) {
93
+ const ref = store.entityIndex.byId.get(expressId);
94
+ if (!ref)
95
+ continue;
96
+ const entity = extractor.extractEntity(ref);
97
+ if (!entity)
98
+ continue;
99
+ const attrs = entity.attributes || [];
100
+ out.push({
101
+ expressId,
102
+ type: normalizeIfcTypeName(entity.type),
103
+ attrs,
104
+ globalId: asString(attrs[0]) ?? '',
105
+ });
106
+ }
107
+ return out;
108
+ }
109
+ //# sourceMappingURL=structural-step-values.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structural-step-values.js","sourceRoot":"","sources":["../src/structural-step-values.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAc/D,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAE1E;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,KAAc;IACxC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE,CAAC;QAC/E,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,KAAc;IACrC,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;IACjC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AAC3E,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,KAAc;IACrC,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;IACjC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,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IACD,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC9C,CAAC;AAiBD,MAAM,UAAU,YAAY,CAC1B,SAA0B,EAC1B,KAAmB,EACnB,UAA6B;IAE7B,MAAM,GAAG,GAAgB,EAAE,CAAC;IAC5B,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,MAAM,GAAG,GAAG,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAClD,IAAI,CAAC,GAAG;YAAE,SAAS;QACnB,MAAM,MAAM,GAAG,SAAS,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QAC5C,IAAI,CAAC,MAAM;YAAE,SAAS;QACtB,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU,IAAI,EAAE,CAAC;QACtC,GAAG,CAAC,IAAI,CAAC;YACP,SAAS;YACT,IAAI,EAAE,oBAAoB,CAAC,MAAM,CAAC,IAAI,CAAC;YACvC,KAAK;YACL,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE;SACnC,CAAC,CAAC;IACL,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,145 @@
1
+ /**
2
+ * The public read model for structural analysis — the shapes
3
+ * `extractStructuralOnDemand` returns, held in their own module so the
4
+ * extractor stays orchestration and every later layer (query namespace,
5
+ * properties card, serializer) has one place to import the contract from.
6
+ *
7
+ * Every cross-link is a globalId, not an expressId, matching the schedule
8
+ * extraction's contract: a consumer federating two models is never handed an
9
+ * id it cannot place.
10
+ */
11
+ import type { BoundaryConditionInfo, StructuralLoadInfo } from './structural-load-extractor.js';
12
+ /** An `IfcStructuralMember` subtype occurrence. */
13
+ export interface StructuralMemberInfo {
14
+ expressId: number;
15
+ globalId: string;
16
+ /** Canonical EXPRESS type name, e.g. `IfcStructuralCurveMember`. */
17
+ type: string;
18
+ name?: string;
19
+ description?: string;
20
+ objectType?: string;
21
+ predefinedType?: string;
22
+ /** `IfcStructuralSurfaceMember.Thickness`, when the file carries it. */
23
+ thickness?: number;
24
+ /** Connections this member is joined to, via IfcRelConnectsStructuralMember. */
25
+ connectionGlobalIds: string[];
26
+ /** Activities applied to it, via IfcRelConnectsStructuralActivity. */
27
+ activityGlobalIds: string[];
28
+ /** Analysis models it belongs to, via IfcRelAssignsToGroup. */
29
+ analysisModelGlobalIds: string[];
30
+ }
31
+ /** An `IfcStructuralConnection` subtype occurrence. */
32
+ export interface StructuralConnectionInfo {
33
+ expressId: number;
34
+ globalId: string;
35
+ type: string;
36
+ name?: string;
37
+ description?: string;
38
+ objectType?: string;
39
+ /** The support condition, resolved from `AppliedCondition`. */
40
+ appliedCondition?: BoundaryConditionInfo;
41
+ memberGlobalIds: string[];
42
+ activityGlobalIds: string[];
43
+ analysisModelGlobalIds: string[];
44
+ }
45
+ /** An `IfcStructuralActivity` subtype occurrence — an action or a reaction. */
46
+ export interface StructuralActivityInfo {
47
+ expressId: number;
48
+ globalId: string;
49
+ type: string;
50
+ /**
51
+ * Which side of the analysis this is: an applied load (`Action`) or a
52
+ * computed result (`Reaction`). Derived from the inheritance chain, so a
53
+ * subtype outside the two named branches reports `Unknown` rather than being
54
+ * silently filed as a load.
55
+ */
56
+ kind: 'Action' | 'Reaction' | 'Unknown';
57
+ name?: string;
58
+ description?: string;
59
+ objectType?: string;
60
+ predefinedType?: string;
61
+ /** `IfcStructuralActivity.GlobalOrLocal`, e.g. `GLOBAL_COORDS`. */
62
+ globalOrLocal?: string;
63
+ /** `IfcStructuralAction.DestabilizingLoad`; absent on reactions. */
64
+ destabilizingLoad?: boolean;
65
+ /** `IfcStructuralActivity.AppliedLoad`, resolved. */
66
+ appliedLoad?: StructuralLoadInfo;
67
+ /** The member or connection it acts on, via IfcRelConnectsStructuralActivity. */
68
+ appliesToGlobalId?: string;
69
+ /**
70
+ * Every structural group this activity is assigned into via
71
+ * IfcRelAssignsToGroup — load groups, result groups **and** analysis models.
72
+ * Unlike a member's `analysisModelGlobalIds`, this one is not narrowed to a
73
+ * single role, because an activity legitimately belongs to several: a load
74
+ * case that owns it and an analysis model it was assigned straight into.
75
+ * Consumers wanting one role must filter by looking the globalId up in the
76
+ * matching collection.
77
+ */
78
+ groupGlobalIds: string[];
79
+ }
80
+ /** An `IfcStructuralLoadGroup` or `IfcStructuralLoadCase`. */
81
+ export interface StructuralLoadGroupInfo {
82
+ expressId: number;
83
+ globalId: string;
84
+ type: string;
85
+ name?: string;
86
+ description?: string;
87
+ objectType?: string;
88
+ predefinedType?: string;
89
+ actionType?: string;
90
+ actionSource?: string;
91
+ coefficient?: number;
92
+ purpose?: string;
93
+ /** `IfcStructuralLoadCase.SelfWeightCoefficients`, when present. */
94
+ selfWeightCoefficients?: number[];
95
+ activityGlobalIds: string[];
96
+ }
97
+ /** An `IfcStructuralResultGroup`. */
98
+ export interface StructuralResultGroupInfo {
99
+ expressId: number;
100
+ globalId: string;
101
+ name?: string;
102
+ description?: string;
103
+ objectType?: string;
104
+ theoryType?: string;
105
+ isLinear?: boolean;
106
+ resultForLoadGroupGlobalId?: string;
107
+ activityGlobalIds: string[];
108
+ }
109
+ /** An `IfcStructuralAnalysisModel`. */
110
+ export interface StructuralAnalysisModelInfo {
111
+ expressId: number;
112
+ globalId: string;
113
+ name?: string;
114
+ description?: string;
115
+ objectType?: string;
116
+ predefinedType?: string;
117
+ /** `LoadedBy` — load group globalIds. */
118
+ loadGroupGlobalIds: string[];
119
+ /** `HasResults` — result group globalIds. */
120
+ resultGroupGlobalIds: string[];
121
+ /** Members and connections assigned in via IfcRelAssignsToGroup. */
122
+ itemGlobalIds: string[];
123
+ }
124
+ export interface StructuralExtraction {
125
+ analysisModels: StructuralAnalysisModelInfo[];
126
+ members: StructuralMemberInfo[];
127
+ connections: StructuralConnectionInfo[];
128
+ activities: StructuralActivityInfo[];
129
+ loadGroups: StructuralLoadGroupInfo[];
130
+ resultGroups: StructuralResultGroupInfo[];
131
+ /** True if any structural entity was found (empty-state UI). */
132
+ hasStructural: boolean;
133
+ /**
134
+ * True when reading an activity's `AppliedLoad` hit one of the walk's own
135
+ * bounds — the nesting cap, the node budget, or a cycle — and so returned
136
+ * fewer nested loads than the file holds. A consumer showing a load
137
+ * configuration reads this before saying "2 loads": a truncated tree is
138
+ * shaped exactly like a genuinely small one, and reporting the two alike is
139
+ * how silent truncation becomes wrong data. The per-configuration detail is
140
+ * `appliedLoad.configuration.truncated` and the entry-level reason is
141
+ * `configuration.entries[i].dropped`.
142
+ */
143
+ loadsTruncated: boolean;
144
+ }
145
+ //# sourceMappingURL=structural-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structural-types.d.ts","sourceRoot":"","sources":["../src/structural-types.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEhG,mDAAmD;AACnD,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gFAAgF;IAChF,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,sEAAsE;IACtE,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,+DAA+D;IAC/D,sBAAsB,EAAE,MAAM,EAAE,CAAC;CAClC;AAED,uDAAuD;AACvD,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;I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EAAE,yBAAyB,EAAE,CAAC;IAC1C,gEAAgE;IAChE,aAAa,EAAE,OAAO,CAAC;IACvB;;;;;;;;;OASG;IACH,cAAc,EAAE,OAAO,CAAC;CACzB"}
@@ -0,0 +1,5 @@
1
+ /* This Source Code Form is subject to the terms of the Mozilla Public
2
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
+ export {};
5
+ //# sourceMappingURL=structural-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structural-types.js","sourceRoot":"","sources":["../src/structural-types.ts"],"names":[],"mappings":"AAAA;;+DAE+D"}
@@ -7,11 +7,17 @@ export declare class StepTokenizer {
7
7
  /** Records the last scan refused for an out-of-contract express id
8
8
  * (express-id.ts, #3395). Reset per scan; the caller reports it. */
9
9
  get oversizedIdCount(): number;
10
- /** 0 or 1: whether the last `scanEntitiesFast`/`scanEntities` run stopped
11
- * early on an unclosed `'` string, an unclosed block comment, or a
12
- * declaration cut off before its own '(' -- never a count of how many,
13
- * since the scan has no reliable way to resume past the first one it
14
- * hits. Reset at the start of every scan; the caller reports it. */
10
+ /** 0 or 1: whether the last run DROPPED a record for having no terminator
11
+ * of its own. Never a count of how many: the first is reported and later
12
+ * ones are not accumulated. Nor does it say the scan STOPPED.
13
+ *
14
+ * The two scans DISAGREE about which records exist, and this is where that
15
+ * shows. `scanEntitiesFast` applies the #4179 record-boundary rules, so
16
+ * `#1=IFCA(1);\n#2=IFCB(2)\n#3=IFCC(3);` gives ids [1, 3] and a count of
17
+ * 1: it drops the unterminated #2 and recovers. `scanEntities`
18
+ * (BalancedEntityScan) closes every record on the ')' balancing its '(' and
19
+ * never looks at the ';' at all, so the same input gives [1, 2, 3] and a
20
+ * count of 0. Reset at the start of every scan; the caller reports it. */
15
21
  get malformedRecordCount(): number;
16
22
  /**
17
23
  * Scan for all entity declarations (#EXPRESS_ID = TYPE(...))
@@ -1 +1 @@
1
- {"version":3,"file":"tokenizer.d.ts","sourceRoot":"","sources":["../src/tokenizer.ts"],"names":[],"mappings":"AAUA,OAAO,EAAsB,KAAK,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAUxF,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,YAAY,CAAa;IACjC,OAAO,CAAC,gBAAgB,CAAa;gBAEzB,MAAM,EAAE,UAAU;IAI9B;yEACqE;IACrE,IAAI,gBAAgB,IAAI,MAAM,CAA8B;IAE5D;;;;yEAIqE;IACrE,IAAI,oBAAoB,IAAI,MAAM,CAAkC;IAEpE;;;;;;;;OAQG;IACF,YAAY,IAAI,SAAS,CAAC,gBAAgB,CAAC;IAY5C;;;OAGG;IACF,gBAAgB,IAAI,SAAS,CAAC,gBAAgB,CAAC;CAqQjD"}
1
+ {"version":3,"file":"tokenizer.d.ts","sourceRoot":"","sources":["../src/tokenizer.ts"],"names":[],"mappings":"AAUA,OAAO,EAAsB,KAAK,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAmBxF,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,YAAY,CAAa;IACjC,OAAO,CAAC,gBAAgB,CAAa;gBAEzB,MAAM,EAAE,UAAU;IAI9B;yEACqE;IACrE,IAAI,gBAAgB,IAAI,MAAM,CAA8B;IAE5D;;;;;;;;;;+EAU2E;IAC3E,IAAI,oBAAoB,IAAI,MAAM,CAAkC;IAEpE;;;;;;;;OAQG;IACF,YAAY,IAAI,SAAS,CAAC,gBAAgB,CAAC;IAY5C;;;OAGG;IACF,gBAAgB,IAAI,SAAS,CAAC,gBAAgB,CAAC;CAgTjD"}
package/dist/tokenizer.js CHANGED
@@ -7,7 +7,10 @@
7
7
  */
8
8
  import { isIndexableExpressId } from './express-id.js';
9
9
  import { BalancedEntityScan } from './scan-entities-balanced.js';
10
- import { countNewlines, opensComment, opensLiteralOrComment, skipComment, skipLexical, skipTrivia, } from './step-lexing.js';
10
+ import { countNewlines, isSpaceByte, opensComment, opensLiteralOrComment, skipComment, skipLexical, skipTrivia, } from './step-lexing.js';
11
+ import { recordCloseOffset, semicolonClosesRecord, UNBALANCED_RECORD, } from './step-record-boundary.js';
12
+ /** `recordClose` before anything has computed it (both real failures are negative). */
13
+ const NOT_COMPUTED = -3;
11
14
  export class StepTokenizer {
12
15
  buffer;
13
16
  oversizedIds = 0;
@@ -18,11 +21,17 @@ export class StepTokenizer {
18
21
  /** Records the last scan refused for an out-of-contract express id
19
22
  * (express-id.ts, #3395). Reset per scan; the caller reports it. */
20
23
  get oversizedIdCount() { return this.oversizedIds; }
21
- /** 0 or 1: whether the last `scanEntitiesFast`/`scanEntities` run stopped
22
- * early on an unclosed `'` string, an unclosed block comment, or a
23
- * declaration cut off before its own '(' -- never a count of how many,
24
- * since the scan has no reliable way to resume past the first one it
25
- * hits. Reset at the start of every scan; the caller reports it. */
24
+ /** 0 or 1: whether the last run DROPPED a record for having no terminator
25
+ * of its own. Never a count of how many: the first is reported and later
26
+ * ones are not accumulated. Nor does it say the scan STOPPED.
27
+ *
28
+ * The two scans DISAGREE about which records exist, and this is where that
29
+ * shows. `scanEntitiesFast` applies the #4179 record-boundary rules, so
30
+ * `#1=IFCA(1);\n#2=IFCB(2)\n#3=IFCC(3);` gives ids [1, 3] and a count of
31
+ * 1: it drops the unterminated #2 and recovers. `scanEntities`
32
+ * (BalancedEntityScan) closes every record on the ')' balancing its '(' and
33
+ * never looks at the ';' at all, so the same input gives [1, 2, 3] and a
34
+ * count of 0. Reset at the start of every scan; the caller reports it. */
26
35
  get malformedRecordCount() { return this.malformedRecords; }
27
36
  /**
28
37
  * Scan for all entity declarations (#EXPRESS_ID = TYPE(...))
@@ -56,6 +65,7 @@ export class StepTokenizer {
56
65
  const HASH = 0x23; // '#'
57
66
  const EQUALS = 0x3D; // '='
58
67
  const LPAREN = 0x28; // '('
68
+ const RPAREN = 0x29; // ')'
59
69
  const SEMICOLON = 0x3B; // ';'
60
70
  const QUOTE = 0x27; // '\''
61
71
  const NEWLINE = 0x0A; // '\n'
@@ -264,9 +274,21 @@ export class StepTokenizer {
264
274
  continue;
265
275
  }
266
276
  declOpen = false; // Header complete: '(' found.
267
- // FAST: Skip to semicolon (handling strings)
277
+ // FAST: Skip to semicolon (handling strings), bounded to THIS
278
+ // record's own body so one missing its ';' cannot latch onto a later
279
+ // one and swallow what lies between (#4179). close_step_record in
280
+ // rust/core/src/parser/lexical.rs argues both rules and the
281
+ // recovery; step-record-boundary.ts is this file's TS half of them.
282
+ // Only the hot part is inline here, because it must be:
283
+ // '=' is one more test on a branch chain this loop already walks, and
284
+ // the ')' rule is settled ONCE per record, at the ';'.
285
+ const parenPos = pos;
268
286
  let inString = false;
269
287
  let foundTerminator = false;
288
+ // Memoised across the two places that need the record's own close: the
289
+ // exact ';' check and the recovery below would otherwise balance the
290
+ // same record twice.
291
+ let recordClose = NOT_COMPUTED;
270
292
  while (pos < len) {
271
293
  const c = buf[pos];
272
294
  if (c === QUOTE) {
@@ -282,18 +304,23 @@ export class StepTokenizer {
282
304
  // quotes and parens inside it text, the other half of the rule the
283
305
  // literal skip above provides in the opposite direction.
284
306
  const end = skipComment(buf, pos, len);
285
- if (end < 0) {
286
- // Unterminated: this record has no terminator, and neither has
287
- // anything after it. Drop it and stop, which is the None Rust's
288
- // find_entity_end returns on the same input.
289
- pos = len;
290
- break;
291
- }
307
+ if (end < 0)
308
+ break; // Unterminated: recovery below finds no ')'.
292
309
  line += countNewlines(buf, pos, end);
293
310
  pos = end;
294
311
  continue;
295
312
  }
296
313
  else if (c === SEMICOLON && !inString) {
314
+ // ')' modulo whitespace settles it for every record a real file
315
+ // holds; anything else defers to the cold, exact check.
316
+ let i = pos;
317
+ while (i > parenPos && isSpaceByte(buf[i - 1]))
318
+ i--;
319
+ if (buf[i - 1] !== RPAREN) {
320
+ recordClose = recordCloseOffset(buf, parenPos, startOffset);
321
+ if (!semicolonClosesRecord(buf, recordClose, pos))
322
+ break;
323
+ }
297
324
  // Found end of entity
298
325
  const entityLength = pos - startOffset + 1; // Include semicolon
299
326
  yield { expressId, type, offset: startOffset, length: entityLength, line: startLine };
@@ -301,19 +328,49 @@ export class StepTokenizer {
301
328
  foundTerminator = true;
302
329
  break;
303
330
  }
331
+ else if (c === EQUALS && !inString) {
332
+ // The next declaration started before this record was terminated.
333
+ break;
334
+ }
304
335
  else if (c === NEWLINE) {
305
336
  line++;
306
337
  }
307
338
  pos++;
308
339
  }
309
- // Ran off the end without an unquoted ';' usually an unescaped `'`
310
- // left open, or the unterminated-comment break above; `pos` is
311
- // already `len`, ending the scan here. Not resynced: with no known
312
- // terminator, guessing a resume point risks fabricating entities from
313
- // misaligned bytes. Recorded in `stopped`, not incremented here --
314
- // see the post-loop check below.
315
- if (!foundTerminator)
340
+ // No ';' of this record's own -- it ran off the end (an unescaped `'`
341
+ // left open, an unterminated comment), or one of the two #4179
342
+ // boundary rules refused the ';' it found. EVERY such exit lands here,
343
+ // so the recovery lives here once rather than at each `break`.
344
+ //
345
+ // Resume at the ')' balancing this record's own '(' when there is one,
346
+ // dropping just this record; otherwise run to `len`, ending the scan
347
+ // un-resynced rather than guessing a resume point from misaligned
348
+ // bytes. The pre-existing exits reach the second case, which is the
349
+ // `pos = len` they used to set for themselves. The balance walk stops
350
+ // at the next declaration's '=' (#4573), so a refusal costs this
351
+ // record's bytes, never a re-walk of the remainder per refusal.
352
+ if (!foundTerminator) {
316
353
  stopped = true;
354
+ if (recordClose === NOT_COMPUTED) {
355
+ recordClose = recordCloseOffset(buf, parenPos, startOffset);
356
+ }
357
+ if (recordClose > 0) {
358
+ pos = recordClose;
359
+ line = startLine + countNewlines(buf, startOffset, pos);
360
+ }
361
+ else if (recordClose === UNBALANCED_RECORD) {
362
+ // No balancing ')' before the next '=' (or EOF), but the bytes
363
+ // after are readable: re-hunt from past this record's '#' so the
364
+ // NEXT declaration is still found.
365
+ pos = startOffset + 1;
366
+ line = startLine;
367
+ }
368
+ else {
369
+ // UNREADABLE_RECORD: a literal or comment swallowed the rest of
370
+ // the input, so there is nothing to resume from (#3695).
371
+ pos = len;
372
+ }
373
+ }
317
374
  }
318
375
  else if (char === NEWLINE) {
319
376
  line++;
@@ -1 +1 @@
1
- {"version":3,"file":"tokenizer.js","sourceRoot":"","sources":["../src/tokenizer.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;GAGG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAyB,MAAM,6BAA6B,CAAC;AACxF,OAAO,EACL,aAAa,EACb,YAAY,EACZ,qBAAqB,EACrB,WAAW,EACX,WAAW,EACX,UAAU,GACX,MAAM,kBAAkB,CAAC;AAE1B,MAAM,OAAO,aAAa;IAChB,MAAM,CAAa;IACnB,YAAY,GAAW,CAAC,CAAC;IACzB,gBAAgB,GAAW,CAAC,CAAC;IAErC,YAAY,MAAkB;QAC5B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;yEACqE;IACrE,IAAI,gBAAgB,KAAa,OAAO,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;IAE5D;;;;yEAIqE;IACrE,IAAI,oBAAoB,KAAa,OAAO,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAEpE;;;;;;;;OAQG;IACH,CAAC,YAAY;QACX,MAAM,IAAI,GAAG,IAAI,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACjD,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;QACtB,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC;QAC1B,IAAI,CAAC;YACH,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;QACpB,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,gBAAgB,CAAC;YAC1C,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,oBAAoB,CAAC;QACpD,CAAC;IACH,CAA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E;gBACnE,mEAAmE;gBACnE,sDAAsD;gBACtD,kEAAkE;gBAClE,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;gBACxC,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC;gBACnB,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC;gBAChB,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;oBAAC,OAAO,GAAG,IAAI,CAAC;oBAAC,MAAM;gBAAC,CAAC;YAC3C,CAAC;iBAAM,CAAC;gBACN,GAAG,EAAE,CAAC;YACR,CAAC;QACH,CAAC;QAED,sEAAsE;QACtE,oEAAoE;QACpE,uEAAuE;QACvE,qEAAqE;QACrE,wDAAwD;QACxD,IAAI,OAAO,IAAI,QAAQ;YAAE,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC;IACrD,CAAC;CACF"}
@@ -1,46 +1,10 @@
1
1
  /**
2
- * Resilient one-shot retry around wasm-bindgen's `init()`.
2
+ * Re-export of the shared WASM load-retry classification (issue #4247).
3
3
  *
4
- * wasm-bindgen's streaming loader rethrows on a non-OK HTTP status or a failed
5
- * fetch of `ifc-lite_bg.wasm` (it only falls back to `arrayBuffer`+`instantiate`
6
- * for the wrong-MIME case), surfacing as `TypeError: Failed to execute
7
- * 'compile' on 'WebAssembly': HTTP status code is not ok`. A transient blip — a
8
- * cold CDN edge, a mid-deploy race, a flaky proxy/antivirus — can produce a
9
- * one-off failure that a second attempt recovers.
10
- *
11
- * Extracted from the worker so it is unit-testable without a real wasm bundle.
12
- */
13
- /**
14
- * True when `message` looks like a transient transport/download failure of the
15
- * engine binary (worth one retry) rather than a genuine corrupt-module or
16
- * validation error (which must propagate immediately so real bugs aren't
17
- * masked).
18
- *
19
- * Per the WebAssembly Web API, the streaming loader validates the HTTP response
20
- * (status, MIME, CORS) and rejects with a `TypeError` BEFORE compiling, so only
21
- * those transport failures are retry-worthy. Invalid bytes (corrupt module,
22
- * wrong magic header) reject with a `CompileError` — retrying just refetches
23
- * the same bad bytes, so those fail fast.
24
- */
25
- export declare function isTransientWasmLoadError(message: string): boolean;
26
- export interface InitWasmRetryOptions {
27
- /** Delay before the single retry. Default 300ms; pass 0 in tests. */
28
- retryDelayMs?: number;
29
- /** Injected sleep (tests pass an instant resolver). */
30
- sleep?: (ms: number) => Promise<void>;
31
- /** Injected logger (defaults to `console.warn`). */
32
- warn?: (message: string) => void;
33
- /** Context label for the log line. */
34
- label?: string;
35
- }
36
- /**
37
- * Run `init` once; on a transient-looking failure, wait and retry exactly once.
38
- * Non-transient failures propagate without a retry. The second failure (if any)
39
- * propagates to the caller — attributed to the engine binary when the browser's
40
- * own wording identifies nothing (see {@link attributeEngineLoadFailure}).
41
- *
42
- * @param init Thunk that performs the actual `init(...)` call (so callers can
43
- * bind their own wasm URL / arguments).
4
+ * The real implementation lives in `@ifc-lite/wasm-lifecycle` so
5
+ * `@ifc-lite/geometry` and `@ifc-lite/parser` share exactly one copy of the
6
+ * transient-vs-fatal WASM load-failure logic instead of maintaining two
7
+ * independently-editable "twin" files.
44
8
  */
45
- export declare function initWasmWithRetry(init: () => Promise<unknown>, options?: InitWasmRetryOptions): Promise<void>;
9
+ export { initWasmWithRetry, isTransientWasmLoadError, type InitWasmRetryOptions, } from '@ifc-lite/wasm-lifecycle';
46
10
  //# sourceMappingURL=wasm-init-retry.d.ts.map