@ifc-lite/mcp 0.17.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/authored-attribute-value.d.ts +3 -0
- package/dist/authored-attribute-value.d.ts.map +1 -0
- package/dist/authored-attribute-value.js +34 -0
- package/dist/authored-attribute-value.js.map +1 -0
- package/dist/backend-query-relationships.d.ts +5 -0
- package/dist/backend-query-relationships.d.ts.map +1 -0
- package/dist/backend-query-relationships.js +55 -0
- package/dist/backend-query-relationships.js.map +1 -0
- package/dist/backend-query.d.ts +3 -5
- package/dist/backend-query.d.ts.map +1 -1
- package/dist/backend-query.js +68 -106
- package/dist/backend-query.js.map +1 -1
- package/dist/headless-backend-cost-store.d.ts +14 -0
- package/dist/headless-backend-cost-store.d.ts.map +1 -0
- package/dist/headless-backend-cost-store.js +20 -0
- package/dist/headless-backend-cost-store.js.map +1 -0
- package/dist/headless-backend.d.ts.map +1 -1
- package/dist/headless-backend.js +4 -2
- package/dist/headless-backend.js.map +1 -1
- package/dist/overlay.d.ts +10 -22
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +44 -77
- package/dist/overlay.js.map +1 -1
- package/dist/tools/diff-authored-keys.d.ts +66 -0
- package/dist/tools/diff-authored-keys.d.ts.map +1 -0
- package/dist/tools/diff-authored-keys.js +144 -0
- package/dist/tools/diff-authored-keys.js.map +1 -0
- package/dist/tools/diff-content.d.ts +33 -0
- package/dist/tools/diff-content.d.ts.map +1 -0
- package/dist/tools/diff-content.js +158 -0
- package/dist/tools/diff-content.js.map +1 -0
- package/dist/tools/diff-fingerprints.d.ts +3 -1
- package/dist/tools/diff-fingerprints.d.ts.map +1 -1
- package/dist/tools/diff-fingerprints.js +19 -49
- package/dist/tools/diff-fingerprints.js.map +1 -1
- package/dist/tools/diff.d.ts.map +1 -1
- package/dist/tools/diff.js +33 -109
- package/dist/tools/diff.js.map +1 -1
- package/package.json +17 -17
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff-content.d.ts","sourceRoot":"","sources":["../../src/tools/diff-content.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAyB,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD;oEACoE;AACpE,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAEvC;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAiB5C;wDACwD;AACxD,wBAAgB,WAAW,CACzB,IAAI,EAAE,WAAW,EACjB,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE;IAAE,IAAI,EAAE,cAAc,GAAG,IAAI,CAAC;IAAC,KAAK,EAAE,cAAc,GAAG,IAAI,CAAA;CAAE,EACvE,UAAU,EAAE,MAAM,EAClB,eAAe,EAAE,MAAM,EACvB,WAAW,CAAC,EAAE,MAAM,EACpB,UAAU,CAAC,EAAE,OAAO,EACpB,UAAU,CAAC,EAAE,OAAO,GACnB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAwFzB;AAgBD,uEAAuE;AACvE,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAOvE"}
|
|
@@ -0,0 +1,158 @@
|
|
|
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
|
+
/**
|
|
5
|
+
* `model_diff`'s `by_content` half: the real `@ifc-lite/diff` engine run over
|
|
6
|
+
* two loaded models (issue #1891), plus `split_merge` / `successors`
|
|
7
|
+
* (issue #4956). Split out of `diff.ts` for size.
|
|
8
|
+
*
|
|
9
|
+
* **Data scope only.** This server has no geometry pipeline, so there is no
|
|
10
|
+
* world geometry hash and no bounding box; `scope: 'data'` is the honest
|
|
11
|
+
* description of what it can see, and every unambiguous 1:1 content match is
|
|
12
|
+
* therefore reported as `renamed` rather than `moved`/`reshaped`. `split_merge`
|
|
13
|
+
* and `successors` are geometry-only stages: they are threaded through to
|
|
14
|
+
* `diffModels` so the params exist and cost nothing today, but on this server
|
|
15
|
+
* they currently produce no claims either way (`diff.splitMerges` /
|
|
16
|
+
* `diff.successors` stay `undefined`, the engine's abstention) — they start
|
|
17
|
+
* producing claims the moment this server gains a geometry pass, with no
|
|
18
|
+
* further plumbing change. See `diff-fingerprints.ts`.
|
|
19
|
+
*/
|
|
20
|
+
import { diffModels } from '@ifc-lite/diff';
|
|
21
|
+
import { buildModelFingerprints } from './diff-fingerprints.js';
|
|
22
|
+
import { fallbackPairDuplicateAuthoredKeys } from './diff-authored-keys.js';
|
|
23
|
+
import { pendingMutationsField } from '../overlay.js';
|
|
24
|
+
/** Default cap on the listed `contentMatches`. Per-kind totals are reported
|
|
25
|
+
* whole, so the cap bounds the payload without hiding anything. */
|
|
26
|
+
export const DEFAULT_MAX_MATCHES = 200;
|
|
27
|
+
/**
|
|
28
|
+
* Default cap on the GlobalIds listed per side of one match.
|
|
29
|
+
*
|
|
30
|
+
* `max_matches` bounds how many groups come back, not how big one is, and a
|
|
31
|
+
* `duplicated` / `deduplicated` / `ambiguous` group is a set of candidates that
|
|
32
|
+
* in a repetitive model can run to thousands of entities on each side. Without
|
|
33
|
+
* this, `max_matches: 1` could still return a model-sized payload and overflow
|
|
34
|
+
* the context window the cap exists to protect.
|
|
35
|
+
*
|
|
36
|
+
* 20 is chosen against what the list is *for*. A group is the engine declining
|
|
37
|
+
* to guess, so its members are a hand-off to the caller; twenty candidates on a
|
|
38
|
+
* side is already past what anyone resolves by reading a list rather than by
|
|
39
|
+
* querying the two models. The overwhelmingly common match is a 1:1 `renamed`
|
|
40
|
+
* pair, which this never touches. Every group still reports `baseCount` and
|
|
41
|
+
* `headCount` whole, computed before the cap for the same reason
|
|
42
|
+
* `contentMatchCounts` is: truncation must never be what makes a model look
|
|
43
|
+
* cleanly matched.
|
|
44
|
+
*/
|
|
45
|
+
export const DEFAULT_MAX_GROUP_MEMBERS = 20;
|
|
46
|
+
/**
|
|
47
|
+
* Kinds an agent has to resolve itself, listed before the ones the engine
|
|
48
|
+
* already retired. Truncating the list must never be what drops the
|
|
49
|
+
* "we could not tell" groups.
|
|
50
|
+
*/
|
|
51
|
+
const UNRESOLVED_FIRST = [
|
|
52
|
+
'ambiguous',
|
|
53
|
+
'duplicated',
|
|
54
|
+
'deduplicated',
|
|
55
|
+
'moved',
|
|
56
|
+
'reshaped',
|
|
57
|
+
'respecified',
|
|
58
|
+
'renamed',
|
|
59
|
+
];
|
|
60
|
+
/** Run the real `@ifc-lite/diff` engine over two loaded models. See the
|
|
61
|
+
* module doc for the scope and abstention contract. */
|
|
62
|
+
export function contentDiff(left, right, overlays, maxMatches, maxGroupMembers, keyProperty, splitMerge, successors) {
|
|
63
|
+
// Authored keys (issue #4955): `prop:<value>` where the model maintains one,
|
|
64
|
+
// GlobalId otherwise; a value two entities share is refused for both and
|
|
65
|
+
// reported so the agent sees why those two fell back.
|
|
66
|
+
const duplicateAuthoredKeys = new Map();
|
|
67
|
+
const adapter = { keyProperty, duplicateAuthoredKeys };
|
|
68
|
+
const baseFingerprints = buildModelFingerprints(left.store, overlays.left, adapter);
|
|
69
|
+
const headFingerprints = buildModelFingerprints(right.store, overlays.right, adapter);
|
|
70
|
+
fallbackPairDuplicateAuthoredKeys([
|
|
71
|
+
{ fingerprints: baseFingerprints, store: left.store },
|
|
72
|
+
{ fingerprints: headFingerprints, store: right.store },
|
|
73
|
+
], duplicateAuthoredKeys);
|
|
74
|
+
const diff = diffModels(baseFingerprints, headFingerprints, {
|
|
75
|
+
scope: 'data',
|
|
76
|
+
matchUnpairedByContent: true,
|
|
77
|
+
detectSplitMerge: splitMerge,
|
|
78
|
+
detectSuccessors: successors,
|
|
79
|
+
});
|
|
80
|
+
const matches = [...(diff.contentMatches ?? [])].sort((a, b) => UNRESOLVED_FIRST.indexOf(a.kind) - UNRESOLVED_FIRST.indexOf(b.kind));
|
|
81
|
+
const byKind = {};
|
|
82
|
+
for (const match of matches)
|
|
83
|
+
byKind[match.kind] = (byKind[match.kind] ?? 0) + 1;
|
|
84
|
+
return {
|
|
85
|
+
scope: diff.scope,
|
|
86
|
+
keyProperty: keyProperty ?? null,
|
|
87
|
+
duplicateAuthoredKeys: [...duplicateAuthoredKeys.keys()].sort(),
|
|
88
|
+
counts: diff.counts,
|
|
89
|
+
// Whole totals, computed before the cap: an agent reading `contentMatches`
|
|
90
|
+
// can always tell whether the list it got is the whole story.
|
|
91
|
+
contentMatchCounts: byKind,
|
|
92
|
+
contentMatches: matches.slice(0, maxMatches).map((match) => ({
|
|
93
|
+
kind: match.kind,
|
|
94
|
+
ifcType: match.base[0]?.ifcType ?? match.head[0]?.ifcType,
|
|
95
|
+
// Groups are reported as groups. Collapsing a `duplicated` or
|
|
96
|
+
// `ambiguous` set to a single pair would be the engine guessing, which
|
|
97
|
+
// is exactly what it refuses to do (#1923). Long groups are cut to
|
|
98
|
+
// `maxGroupMembers` per side and say so, whole size included, so a cut
|
|
99
|
+
// group still reads as a group of that size.
|
|
100
|
+
...listSide('base', match.base, maxGroupMembers),
|
|
101
|
+
...listSide('head', match.head, maxGroupMembers),
|
|
102
|
+
...(match.distance !== undefined ? { distance: match.distance } : {}),
|
|
103
|
+
})),
|
|
104
|
+
truncatedMatches: Math.max(0, matches.length - maxMatches),
|
|
105
|
+
// Absent (not `[]`) exactly when the stage did not run, or ran and the
|
|
106
|
+
// geometry abstention fired — this server's current state, always, until
|
|
107
|
+
// it has a geometry pipeline. The engine's "absent means not proved"
|
|
108
|
+
// contract, preserved rather than flattened.
|
|
109
|
+
splitMerges: diff.splitMerges?.map((claim) => ({
|
|
110
|
+
kind: claim.kind,
|
|
111
|
+
confidence: claim.confidence,
|
|
112
|
+
whole: claim.whole.key,
|
|
113
|
+
pieces: claim.pieces.map((piece) => piece.key),
|
|
114
|
+
})),
|
|
115
|
+
successors: diff.successors?.map((claim) => ({
|
|
116
|
+
confidence: claim.confidence,
|
|
117
|
+
base: claim.base.key,
|
|
118
|
+
head: claim.head.key,
|
|
119
|
+
overlap: claim.overlap,
|
|
120
|
+
distance: claim.distance,
|
|
121
|
+
})),
|
|
122
|
+
// Uncommitted edits are folded into the comparison; saying how many there
|
|
123
|
+
// are is what separates "the two files differ" from "this session has
|
|
124
|
+
// edits it has not written yet". Absent when neither model has any.
|
|
125
|
+
//
|
|
126
|
+
// `pendingMutations` is the scalar every other payload carries; the split a
|
|
127
|
+
// two-model comparison can additionally give lives under its own name rather
|
|
128
|
+
// than overloading that one.
|
|
129
|
+
...pendingMutationsField(overlays.left, overlays.right),
|
|
130
|
+
...(overlays.left || overlays.right
|
|
131
|
+
? {
|
|
132
|
+
pendingMutationsBySide: {
|
|
133
|
+
base: overlays.left?.pendingMutations ?? 0,
|
|
134
|
+
head: overlays.right?.pendingMutations ?? 0,
|
|
135
|
+
},
|
|
136
|
+
}
|
|
137
|
+
: {}),
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
/** One side of a match: the (capped) keys, the whole count, and whether the
|
|
141
|
+
* list was cut. Emits `base`/`baseCount`/`baseTruncated` (or `head…`). */
|
|
142
|
+
function listSide(side, entities, maxGroupMembers) {
|
|
143
|
+
return {
|
|
144
|
+
[side]: entities.slice(0, maxGroupMembers).map((entity) => entity.key),
|
|
145
|
+
[`${side}Count`]: entities.length,
|
|
146
|
+
[`${side}Truncated`]: entities.length > maxGroupMembers,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
/** One-line human summary of the engine result, for the text block. */
|
|
150
|
+
export function describeCounts(content) {
|
|
151
|
+
const counts = content.counts;
|
|
152
|
+
const byKind = content.contentMatchCounts;
|
|
153
|
+
const kinds = Object.entries(byKind).map(([kind, n]) => `${n} ${kind}`).join(', ');
|
|
154
|
+
return `${counts.added} added, ${counts.modified} modified, ${counts.deleted} deleted, `
|
|
155
|
+
+ `${counts.unchanged} unchanged`
|
|
156
|
+
+ (kinds ? `; content matches: ${kinds}` : '; no content matches');
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=diff-content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff-content.js","sourceRoot":"","sources":["../../src/tools/diff-content.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,UAAU,EAA4C,MAAM,gBAAgB,CAAC;AACtF,OAAO,EAAE,sBAAsB,EAAgB,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,iCAAiC,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAuB,MAAM,eAAe,CAAC;AAG3E;oEACoE;AACpE,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAEvC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAE5C;;;;GAIG;AACH,MAAM,gBAAgB,GAAuB;IAC3C,WAAW;IACX,YAAY;IACZ,cAAc;IACd,OAAO;IACP,UAAU;IACV,aAAa;IACb,SAAS;CACV,CAAC;AAEF;wDACwD;AACxD,MAAM,UAAU,WAAW,CACzB,IAAiB,EACjB,KAAkB,EAClB,QAAuE,EACvE,UAAkB,EAClB,eAAuB,EACvB,WAAoB,EACpB,UAAoB,EACpB,UAAoB;IAEpB,6EAA6E;IAC7E,yEAAyE;IACzE,sDAAsD;IACtD,MAAM,qBAAqB,GAAG,IAAI,GAAG,EAAoB,CAAC;IAC1D,MAAM,OAAO,GAAG,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;IACvD,MAAM,gBAAgB,GAAG,sBAAsB,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACpF,MAAM,gBAAgB,GAAG,sBAAs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K,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnF,OAAO,GAAG,MAAM,CAAC,KAAK,WAAW,MAAM,CAAC,QAAQ,cAAc,MAAM,CAAC,OAAO,YAAY;UACpF,GAAG,MAAM,CAAC,SAAS,YAAY;UAC/B,CAAC,KAAK,CAAC,CAAC,CAAC,sBAAsB,KAAK,EAAE,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC;AACvE,CAAC"}
|
|
@@ -84,6 +84,8 @@
|
|
|
84
84
|
*/
|
|
85
85
|
import { type EntityFingerprint } from '@ifc-lite/diff';
|
|
86
86
|
import { type IfcDataStore } from '@ifc-lite/parser';
|
|
87
|
+
import { type FingerprintAdapterOptions } from './diff-authored-keys.js';
|
|
88
|
+
export { AUTHORED_KEY_PREFIX, type FingerprintAdapterOptions } from './diff-authored-keys.js';
|
|
87
89
|
import type { PendingOverlay } from '../overlay.js';
|
|
88
90
|
/** Adapter handle threaded through the diff: the entity's express id. */
|
|
89
91
|
export type DiffRef = number;
|
|
@@ -102,5 +104,5 @@ export type DiffRef = number;
|
|
|
102
104
|
* values. Omitting it (the CLI twin has no session to overlay) is the original
|
|
103
105
|
* store-only behaviour exactly.
|
|
104
106
|
*/
|
|
105
|
-
export declare function buildModelFingerprints(store: IfcDataStore, overlay?: PendingOverlay | null): EntityFingerprint<DiffRef>[];
|
|
107
|
+
export declare function buildModelFingerprints(store: IfcDataStore, overlay?: PendingOverlay | null, options?: FingerprintAdapterOptions): EntityFingerprint<DiffRef>[];
|
|
106
108
|
//# sourceMappingURL=diff-fingerprints.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diff-fingerprints.d.ts","sourceRoot":"","sources":["../../src/tools/diff-fingerprints.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmFG;AAEH,OAAO,EAIL,KAAK,iBAAiB,EACvB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAaL,KAAK,YAAY,EAClB,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"diff-fingerprints.d.ts","sourceRoot":"","sources":["../../src/tools/diff-fingerprints.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmFG;AAEH,OAAO,EAIL,KAAK,iBAAiB,EACvB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAaL,KAAK,YAAY,EAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAyD,KAAK,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAEhI,OAAO,EAAE,mBAAmB,EAAE,KAAK,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAC9F,OAAO,KAAK,EAAiB,cAAc,EAAE,MAAM,eAAe,CAAC;AAEnE,yEAAyE;AACzE,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC;AAwE7B;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,YAAY,EACnB,OAAO,CAAC,EAAE,cAAc,GAAG,IAAI,EAC/B,OAAO,GAAE,yBAA8B,GACtC,iBAAiB,CAAC,OAAO,CAAC,EAAE,CA4D9B"}
|
|
@@ -86,9 +86,11 @@
|
|
|
86
86
|
* fingerprints, which the paired tests check.
|
|
87
87
|
*/
|
|
88
88
|
import { buildComponentFingerprints, buildDataFingerprint, } from '@ifc-lite/diff';
|
|
89
|
-
import { RelationshipType } from '@ifc-lite/data';
|
|
90
|
-
import { EntityExtractor, extractAllEntityAttributes, extractClassificationsOnDemand, extractProjectUnits, extractPropertiesOnDemand, extractQuantitiesOnDemand, extractRootAttributesFromEntity,
|
|
89
|
+
import { RelationshipType, resolvedTypeName } from '@ifc-lite/data';
|
|
90
|
+
import { EntityExtractor, extractAllEntityAttributes, extractClassificationsOnDemand, extractProjectUnits, extractPropertiesOnDemand, extractQuantitiesOnDemand, extractRootAttributesFromEntity, spatialContainerPath, getInheritanceChainAcrossSchemas, quantitySiScale, roundToScale, scaledPropertyValue, } from '@ifc-lite/parser';
|
|
91
|
+
import { attributeAcrossSchemas, authoredKeyResolver, override } from './diff-authored-keys.js';
|
|
91
92
|
import { classificationLabel } from './diff-classification-label.js';
|
|
93
|
+
export { AUTHORED_KEY_PREFIX } from './diff-authored-keys.js';
|
|
92
94
|
/**
|
|
93
95
|
* Classify one STEP type against the three `IfcRoot` branches.
|
|
94
96
|
*
|
|
@@ -157,13 +159,14 @@ function classifyType(typeKey) {
|
|
|
157
159
|
* values. Omitting it (the CLI twin has no session to overlay) is the original
|
|
158
160
|
* store-only behaviour exactly.
|
|
159
161
|
*/
|
|
160
|
-
export function buildModelFingerprints(store, overlay) {
|
|
162
|
+
export function buildModelFingerprints(store, overlay, options = {}) {
|
|
161
163
|
const fingerprints = [];
|
|
162
164
|
const seen = new Set();
|
|
163
165
|
// One extractor for the whole model: the source read below only fires for
|
|
164
166
|
// the (small) set of object types the EntityTable declines to hold.
|
|
165
167
|
const extractor = new EntityExtractor(store.source);
|
|
166
168
|
const units = extractProjectUnits(store.source, store.entityIndex); // for quantitySiScale/scaledPropertyValue
|
|
169
|
+
const keyOf = authoredKeyResolver(store, overlay, options, extractor, (typeKey) => classifyType(typeKey).role === 'dependent');
|
|
167
170
|
for (const [typeKey, ids] of store.entityIndex.byType) {
|
|
168
171
|
// Classified once per type rather than once per entity — the geometry
|
|
169
172
|
// buckets (IfcCartesianPoint, IfcPolyLoop, …) are the bulk of a real model
|
|
@@ -198,13 +201,17 @@ export function buildModelFingerprints(store, overlay) {
|
|
|
198
201
|
// on every content match, so 'Unknown' would pair a task with an actor.
|
|
199
202
|
const ifcType = source && (!tableType || tableType === 'Unknown') ? type.name : tableType;
|
|
200
203
|
const input = buildDataInput(store, expressId, ifcType, source, type.typeObject, overlay, units);
|
|
201
|
-
|
|
202
|
-
key: globalId,
|
|
204
|
+
const fingerprint = {
|
|
205
|
+
key: keyOf(expressId, globalId),
|
|
203
206
|
ifcType,
|
|
204
207
|
dataHash: buildDataFingerprint(input),
|
|
205
208
|
components: buildComponentFingerprints(input),
|
|
206
209
|
ref: expressId,
|
|
207
|
-
}
|
|
210
|
+
};
|
|
211
|
+
const container = spatialContainerPath(store, expressId);
|
|
212
|
+
if (container !== undefined)
|
|
213
|
+
fingerprint.container = container;
|
|
214
|
+
fingerprints.push(fingerprint);
|
|
208
215
|
}
|
|
209
216
|
}
|
|
210
217
|
for (const entity of overlay?.created ?? []) {
|
|
@@ -238,6 +245,11 @@ export function buildModelFingerprints(store, overlay) {
|
|
|
238
245
|
* path exactly. Property sets and quantities never had the asymmetry — both
|
|
239
246
|
* were already read through the overlay.
|
|
240
247
|
*
|
|
248
|
+
* An authored key (`key_from`) is not resolved for a created entity either: it
|
|
249
|
+
* has no store row for `authoredKeyValue` to read, so it is keyed on the
|
|
250
|
+
* GlobalId the caller gave it. A created entity that duplicates a stored
|
|
251
|
+
* entity's authored value therefore reads as added rather than as a collision.
|
|
252
|
+
*
|
|
241
253
|
* `predefinedType` and `typeAssignments` are necessarily absent: both are read
|
|
242
254
|
* through the store, which has no row for an entity that exists only in the
|
|
243
255
|
* overlay, and neither is reachable through `entity_set_attribute`. A created
|
|
@@ -333,7 +345,7 @@ overlay, units) {
|
|
|
333
345
|
.map((typeId) => ({
|
|
334
346
|
globalId: store.entities.getGlobalId(typeId) || undefined,
|
|
335
347
|
name: store.entities.getName(typeId) || undefined,
|
|
336
|
-
type: store.entities
|
|
348
|
+
type: resolvedTypeName(store.entities, typeId),
|
|
337
349
|
}));
|
|
338
350
|
const classifications = extractClassificationsOnDemand(store, expressId).map(classificationLabel);
|
|
339
351
|
return {
|
|
@@ -357,46 +369,4 @@ overlay, units) {
|
|
|
357
369
|
typeAssignments,
|
|
358
370
|
};
|
|
359
371
|
}
|
|
360
|
-
/**
|
|
361
|
-
* One named attribute, read positionally through the **cross-schema** attribute
|
|
362
|
-
* list (issue #2021). The CLI's twin, and it must stay one.
|
|
363
|
-
*
|
|
364
|
-
* `extractAllEntityAttributes` names attributes through the parser's IFC4
|
|
365
|
-
* codegen pin, which answers an EMPTY list for a class the pin does not carry —
|
|
366
|
-
* so a `.find(name === 'Tag')` over it silently finds nothing on every
|
|
367
|
-
* IFC4X3-only type object (`IfcRailType`, `IfcTrackElementType`,
|
|
368
|
-
* `IfcSignalType`, …) while working perfectly on IFC2X3 and IFC4. That is a
|
|
369
|
-
* no-op nobody would notice: the entity is in scope, its class name is right,
|
|
370
|
-
* `isTypeObject` is right, and only the evidence is missing.
|
|
371
|
-
*
|
|
372
|
-
* This is the same pinned-registry family as the membership defect `#2001`
|
|
373
|
-
* fixed, and it has to be answered from the same place: the inheritance chain
|
|
374
|
-
* decides *whether* to read a `Tag`, so the attribute list that decides *where*
|
|
375
|
-
* it sits must span the same schemas. `getAttributeNamesAcrossSchemas` returns
|
|
376
|
-
* the pinned result unchanged for every class the pin does know, so this is
|
|
377
|
-
* additive — no IFC2X3 or IFC4 entity's hash moves because of it.
|
|
378
|
-
*
|
|
379
|
-
* Reads the raw STEP slot rather than reusing `extractAllEntityAttributes`'
|
|
380
|
-
* display normalization: this value is hashed, not shown, so `$` (absent) is
|
|
381
|
-
* the only case that needs interpreting and it arrives as null.
|
|
382
|
-
*/
|
|
383
|
-
function attributeAcrossSchemas(store, expressId, ifcType, attributeName) {
|
|
384
|
-
const index = getAttributeNamesAcrossSchemas(ifcType).indexOf(attributeName);
|
|
385
|
-
if (index < 0)
|
|
386
|
-
return undefined;
|
|
387
|
-
const ref = store.entityIndex.byId.get(expressId);
|
|
388
|
-
if (!ref)
|
|
389
|
-
return undefined;
|
|
390
|
-
const raw = new EntityExtractor(store.source).extractEntity(ref)?.attributes?.[index];
|
|
391
|
-
return typeof raw === 'string' || typeof raw === 'number' ? String(raw) : undefined;
|
|
392
|
-
}
|
|
393
|
-
/**
|
|
394
|
-
* An overlay override wins whenever one exists, including when it is empty —
|
|
395
|
-
* `entity_set_attribute` with `''` clears the attribute, and falling back to
|
|
396
|
-
* the stored value there would hash the edit away.
|
|
397
|
-
*/
|
|
398
|
-
function override(edited, stored) {
|
|
399
|
-
const value = edited !== undefined ? edited : stored;
|
|
400
|
-
return value ? value : undefined;
|
|
401
|
-
}
|
|
402
372
|
//# sourceMappingURL=diff-fingerprints.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diff-fingerprints.js","sourceRoot":"","sources":["../../src/tools/diff-fingerprints.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmFG;AAEH,OAAO,EACL,0BAA0B,EAC1B,oBAAoB,GAGrB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"diff-fingerprints.js","sourceRoot":"","sources":["../../src/tools/diff-fingerprints.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmFG;AAEH,OAAO,EACL,0BAA0B,EAC1B,oBAAoB,GAGrB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EACL,eAAe,EACf,0BAA0B,EAC1B,8BAA8B,EAC9B,mBAAmB,EACnB,yBAAyB,EACzB,yBAAyB,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C,MAAM,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,MAAM,EAAE,IAAI,CAAC;QACtF,WAAW,EAAE,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,aAAa,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,MAAM,EAAE,WAAW,CAAC;QAClH,UAAU,EAAE,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,YAAY,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,SAAS,CAAC,IAAI,MAAM,EAAE,UAAU,CAAC;QAC9G,cAAc,EAAE,cAAc,IAAI,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,SAAS;QAC3E,GAAG,EAAE,YAAY;YACf,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,EAAE,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YACjF,CAAC,CAAC,SAAS;QACb,YAAY;QACZ,YAAY;QACZ,eAAe;KAChB,CAAC;AACJ,CAAC"}
|
package/dist/tools/diff.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../src/tools/diff.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../src/tools/diff.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAwQvC,eAAO,MAAM,SAAS,EAAE,IAAI,EAA8B,CAAC"}
|
package/dist/tools/diff.js
CHANGED
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { EntityNode } from '@ifc-lite/query';
|
|
11
11
|
import { IFC_ENTITY_NAMES } from '@ifc-lite/data';
|
|
12
|
-
import { diffModels } from '@ifc-lite/diff';
|
|
13
12
|
import { okResult, assertModelAccess } from './util.js';
|
|
14
|
-
import {
|
|
13
|
+
import { parseAuthoredKeySpec } from '@ifc-lite/parser';
|
|
14
|
+
import { contentDiff, describeCounts, DEFAULT_MAX_GROUP_MEMBERS, DEFAULT_MAX_MATCHES, } from './diff-content.js';
|
|
15
15
|
import { foldedTypeCounts, pendingMutationsField, pendingOverlay } from '../overlay.js';
|
|
16
16
|
import { ToolErrorCode, ToolExecutionError } from '../errors.js';
|
|
17
17
|
import { firstNonBlank } from '../material-naming.js';
|
|
@@ -30,102 +30,6 @@ function resolveTwo(ctx, a, b) {
|
|
|
30
30
|
assertModelAccess(ctx, right);
|
|
31
31
|
return { left, right };
|
|
32
32
|
}
|
|
33
|
-
/** Default cap on the listed `contentMatches`. Per-kind totals are reported
|
|
34
|
-
* whole, so the cap bounds the payload without hiding anything. */
|
|
35
|
-
const DEFAULT_MAX_MATCHES = 200;
|
|
36
|
-
/**
|
|
37
|
-
* Default cap on the GlobalIds listed per side of one match.
|
|
38
|
-
*
|
|
39
|
-
* `max_matches` bounds how many groups come back, not how big one is, and a
|
|
40
|
-
* `duplicated` / `deduplicated` / `ambiguous` group is a set of candidates that
|
|
41
|
-
* in a repetitive model can run to thousands of entities on each side. Without
|
|
42
|
-
* this, `max_matches: 1` could still return a model-sized payload and overflow
|
|
43
|
-
* the context window the cap exists to protect.
|
|
44
|
-
*
|
|
45
|
-
* 20 is chosen against what the list is *for*. A group is the engine declining
|
|
46
|
-
* to guess, so its members are a hand-off to the caller; twenty candidates on a
|
|
47
|
-
* side is already past what anyone resolves by reading a list rather than by
|
|
48
|
-
* querying the two models. The overwhelmingly common match is a 1:1 `renamed`
|
|
49
|
-
* pair, which this never touches. Every group still reports `baseCount` and
|
|
50
|
-
* `headCount` whole, computed before the cap for the same reason
|
|
51
|
-
* `contentMatchCounts` is: truncation must never be what makes a model look
|
|
52
|
-
* cleanly matched.
|
|
53
|
-
*/
|
|
54
|
-
const DEFAULT_MAX_GROUP_MEMBERS = 20;
|
|
55
|
-
/**
|
|
56
|
-
* Kinds an agent has to resolve itself, listed before the ones the engine
|
|
57
|
-
* already retired. Truncating the list must never be what drops the
|
|
58
|
-
* "we could not tell" groups.
|
|
59
|
-
*/
|
|
60
|
-
const UNRESOLVED_FIRST = [
|
|
61
|
-
'ambiguous',
|
|
62
|
-
'duplicated',
|
|
63
|
-
'deduplicated',
|
|
64
|
-
'moved',
|
|
65
|
-
'reshaped',
|
|
66
|
-
'renamed',
|
|
67
|
-
];
|
|
68
|
-
/**
|
|
69
|
-
* Run the real `@ifc-lite/diff` engine over two loaded models (issue #1891).
|
|
70
|
-
*
|
|
71
|
-
* **Data scope only.** This server has no geometry pipeline, so there is no
|
|
72
|
-
* world geometry hash and no bounding box; `scope: 'data'` is the honest
|
|
73
|
-
* description of what it can see, and every unambiguous 1:1 content match is
|
|
74
|
-
* therefore reported as `renamed` rather than `moved`/`reshaped`. See
|
|
75
|
-
* `diff-fingerprints.ts`.
|
|
76
|
-
*/
|
|
77
|
-
function contentDiff(left, right, overlays, maxMatches, maxGroupMembers) {
|
|
78
|
-
const diff = diffModels(buildModelFingerprints(left.store, overlays.left), buildModelFingerprints(right.store, overlays.right), { scope: 'data', matchUnpairedByContent: true });
|
|
79
|
-
const matches = [...(diff.contentMatches ?? [])].sort((a, b) => UNRESOLVED_FIRST.indexOf(a.kind) - UNRESOLVED_FIRST.indexOf(b.kind));
|
|
80
|
-
const byKind = {};
|
|
81
|
-
for (const match of matches)
|
|
82
|
-
byKind[match.kind] = (byKind[match.kind] ?? 0) + 1;
|
|
83
|
-
return {
|
|
84
|
-
scope: diff.scope,
|
|
85
|
-
counts: diff.counts,
|
|
86
|
-
// Whole totals, computed before the cap: an agent reading `contentMatches`
|
|
87
|
-
// can always tell whether the list it got is the whole story.
|
|
88
|
-
contentMatchCounts: byKind,
|
|
89
|
-
contentMatches: matches.slice(0, maxMatches).map((match) => ({
|
|
90
|
-
kind: match.kind,
|
|
91
|
-
ifcType: match.base[0]?.ifcType ?? match.head[0]?.ifcType,
|
|
92
|
-
// Groups are reported as groups. Collapsing a `duplicated` or
|
|
93
|
-
// `ambiguous` set to a single pair would be the engine guessing, which
|
|
94
|
-
// is exactly what it refuses to do (#1923). Long groups are cut to
|
|
95
|
-
// `maxGroupMembers` per side and say so, whole size included, so a cut
|
|
96
|
-
// group still reads as a group of that size.
|
|
97
|
-
...listSide('base', match.base, maxGroupMembers),
|
|
98
|
-
...listSide('head', match.head, maxGroupMembers),
|
|
99
|
-
...(match.distance !== undefined ? { distance: match.distance } : {}),
|
|
100
|
-
})),
|
|
101
|
-
truncatedMatches: Math.max(0, matches.length - maxMatches),
|
|
102
|
-
// Uncommitted edits are folded into the comparison; saying how many there
|
|
103
|
-
// are is what separates "the two files differ" from "this session has
|
|
104
|
-
// edits it has not written yet". Absent when neither model has any.
|
|
105
|
-
//
|
|
106
|
-
// `pendingMutations` is the scalar every other payload carries; the split a
|
|
107
|
-
// two-model comparison can additionally give lives under its own name rather
|
|
108
|
-
// than overloading that one.
|
|
109
|
-
...pendingMutationsField(overlays.left, overlays.right),
|
|
110
|
-
...(overlays.left || overlays.right
|
|
111
|
-
? {
|
|
112
|
-
pendingMutationsBySide: {
|
|
113
|
-
base: overlays.left?.pendingMutations ?? 0,
|
|
114
|
-
head: overlays.right?.pendingMutations ?? 0,
|
|
115
|
-
},
|
|
116
|
-
}
|
|
117
|
-
: {}),
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
/** One side of a match: the (capped) keys, the whole count, and whether the
|
|
121
|
-
* list was cut. Emits `base`/`baseCount`/`baseTruncated` (or `head…`). */
|
|
122
|
-
function listSide(side, entities, maxGroupMembers) {
|
|
123
|
-
return {
|
|
124
|
-
[side]: entities.slice(0, maxGroupMembers).map((entity) => entity.key),
|
|
125
|
-
[`${side}Count`]: entities.length,
|
|
126
|
-
[`${side}Truncated`]: entities.length > maxGroupMembers,
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
33
|
const modelDiff = {
|
|
130
34
|
name: 'model_diff',
|
|
131
35
|
description: 'Compare two loaded models. Reports added/removed entities by GlobalId and per-type count deltas. '
|
|
@@ -144,7 +48,7 @@ const modelDiff = {
|
|
|
144
48
|
default: false,
|
|
145
49
|
description: 'Run the @ifc-lite/diff engine with content-keyed matching over every IfcObjectDefinition. '
|
|
146
50
|
+ 'Adds `contentDiff` with added/modified/deleted/unchanged counts and the content matches '
|
|
147
|
-
+ '(renamed / moved / reshaped are resolved; duplicated / deduplicated / ambiguous are listed '
|
|
51
|
+
+ '(renamed / moved / reshaped / respecified are resolved; duplicated / deduplicated / ambiguous are listed '
|
|
148
52
|
+ 'as groups for you to resolve). Data scope only — this server has no geometry pipeline.',
|
|
149
53
|
},
|
|
150
54
|
max_matches: {
|
|
@@ -154,6 +58,13 @@ const modelDiff = {
|
|
|
154
58
|
description: 'Cap on the listed content matches (by_content only). Unresolved groups are listed first and '
|
|
155
59
|
+ '`contentMatchCounts` always reports whole per-kind totals.',
|
|
156
60
|
},
|
|
61
|
+
key_from: {
|
|
62
|
+
type: 'string',
|
|
63
|
+
description: 'Compare on an authored identifier instead of GlobalId (by_content only): "Tag", or '
|
|
64
|
+
+ '"<PsetName>.<PropertyName>" such as "Pset_Asset.AssetId". An entity carrying a non-empty, '
|
|
65
|
+
+ 'unique value is keyed on it; the rest keep their GlobalId. Values shared by several entities '
|
|
66
|
+
+ 'are listed in duplicateAuthoredKeys.',
|
|
67
|
+
},
|
|
157
68
|
max_group_members: {
|
|
158
69
|
type: 'integer',
|
|
159
70
|
default: DEFAULT_MAX_GROUP_MEMBERS,
|
|
@@ -162,6 +73,21 @@ const modelDiff = {
|
|
|
162
73
|
+ 'deduplicated / ambiguous group can hold thousands. `baseCount` / `headCount` always report '
|
|
163
74
|
+ 'the whole size and `baseTruncated` / `headTruncated` say whether the list was cut.',
|
|
164
75
|
},
|
|
76
|
+
split_merge: {
|
|
77
|
+
type: 'boolean',
|
|
78
|
+
default: false,
|
|
79
|
+
description: 'Opt in to the split/merge detector (by_content only, issue #4956). Geometry-only stage: '
|
|
80
|
+
+ 'this server has no geometry pipeline yet, so `contentDiff.splitMerges` currently stays '
|
|
81
|
+
+ 'absent regardless of this flag — wired through so it starts producing claims the moment '
|
|
82
|
+
+ 'one lands, with no client-side change.',
|
|
83
|
+
},
|
|
84
|
+
successors: {
|
|
85
|
+
type: 'boolean',
|
|
86
|
+
default: false,
|
|
87
|
+
description: 'Opt in to the successor-match detector: suggestions that one deleted entity was replaced '
|
|
88
|
+
+ 'in place by one added entity (by_content only, issue #4956). Same geometry-only caveat as '
|
|
89
|
+
+ '`split_merge` — `contentDiff.successors` currently stays absent on this server.',
|
|
90
|
+
},
|
|
165
91
|
},
|
|
166
92
|
required: ['a', 'b'],
|
|
167
93
|
additionalProperties: false,
|
|
@@ -203,8 +129,15 @@ const modelDiff = {
|
|
|
203
129
|
// Opt-in, and deliberately so. An `ambiguous` group has no honest scalar
|
|
204
130
|
// form, so turning this on by default would change what `counts` means
|
|
205
131
|
// under agent scripts that already read this tool.
|
|
132
|
+
const keyFrom = typeof input.key_from === 'string' && input.key_from.trim() ? input.key_from.trim() : undefined;
|
|
133
|
+
if (keyFrom !== undefined && !parseAuthoredKeySpec(keyFrom)) {
|
|
134
|
+
throw new ToolExecutionError({
|
|
135
|
+
code: ToolErrorCode.INVALID_INPUT,
|
|
136
|
+
message: 'key_from must be "Tag" or "<PsetName>.<PropertyName>", got "' + keyFrom + '"',
|
|
137
|
+
});
|
|
138
|
+
}
|
|
206
139
|
const content = input.by_content ?? false
|
|
207
|
-
? contentDiff(left, right, { left: leftOverlay, right: rightOverlay }, input.max_matches ?? DEFAULT_MAX_MATCHES, input.max_group_members ?? DEFAULT_MAX_GROUP_MEMBERS)
|
|
140
|
+
? contentDiff(left, right, { left: leftOverlay, right: rightOverlay }, input.max_matches ?? DEFAULT_MAX_MATCHES, input.max_group_members ?? DEFAULT_MAX_GROUP_MEMBERS, keyFrom, input.split_merge ?? false, input.successors ?? false)
|
|
208
141
|
: null;
|
|
209
142
|
const pendingField = pendingMutationsField(leftOverlay, rightOverlay);
|
|
210
143
|
const pending = pendingField.pendingMutations ?? 0;
|
|
@@ -245,15 +178,6 @@ function collectGlobalIds(model, overlay) {
|
|
|
245
178
|
gids.add(entity.globalId);
|
|
246
179
|
return gids;
|
|
247
180
|
}
|
|
248
|
-
/** One-line human summary of the engine result, for the text block. */
|
|
249
|
-
function describeCounts(content) {
|
|
250
|
-
const counts = content.counts;
|
|
251
|
-
const byKind = content.contentMatchCounts;
|
|
252
|
-
const kinds = Object.entries(byKind).map(([kind, n]) => `${n} ${kind}`).join(', ');
|
|
253
|
-
return `${counts.added} added, ${counts.modified} modified, ${counts.deleted} deleted, `
|
|
254
|
-
+ `${counts.unchanged} unchanged`
|
|
255
|
-
+ (kinds ? `; content matches: ${kinds}` : '; no content matches');
|
|
256
|
-
}
|
|
257
181
|
const quantityDiff = {
|
|
258
182
|
name: 'quantity_diff',
|
|
259
183
|
description: 'Per-entity-type quantity comparison between two models, optionally grouped by storey.',
|
package/dist/tools/diff.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diff.js","sourceRoot":"","sources":["../../src/tools/diff.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,UAAU,EAA4C,MAAM,gBAAgB,CAAC;AAEtF,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAgB,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,cAAc,EAAuB,MAAM,eAAe,CAAC;AAE7G,OAAO,EA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