@finos/legend-extension-dsl-data-space 10.4.273 → 10.4.275

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.
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Copyright (c) 2026-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type { GenericLegendApplicationStore } from '@finos/legend-application';
17
+ import { type GraphManagerState } from '@finos/legend-graph';
18
+ import type { ActionState } from '@finos/legend-shared';
19
+ import type { DepotServerClient } from '@finos/legend-server-depot';
20
+ import type { EntitiesWithOrigin, Entity } from '@finos/legend-storage';
21
+ import { DataSpaceViewerState } from './DataSpaceViewerState.js';
22
+ export type DataSpaceViewerActions = Omit<ConstructorParameters<typeof DataSpaceViewerState>[7], 'retrieveGraphData'>;
23
+ export interface DataSpacePreviewOrigin {
24
+ groupId: string;
25
+ artifactId: string;
26
+ versionId: string;
27
+ }
28
+ /**
29
+ * The DataSpace to preview among *entities*: *preferredPath* when given -- and only
30
+ * that one, never another in its place -- else the only one the model has.
31
+ */
32
+ export declare const findDataSpaceEntity: (entities: Entity[], preferredPath?: string) => Entity;
33
+ /**
34
+ * A viewer for the DataSpace *dataSpacePath* of the model *graphManagerState*
35
+ * has built: the DataSpace analysed over *entities* (the model's own and its
36
+ * dependencies'), then viewed over that graph. Studio's editor preview passes
37
+ * the graph it already has; `previewDataSpaceFromEntities` builds one first.
38
+ */
39
+ export declare const previewDataSpace: (applicationStore: GenericLegendApplicationStore, graphManagerState: GraphManagerState, dataSpacePath: string, entities: () => Promise<Entity[]>, origin: DataSpacePreviewOrigin, depotServerClient: DepotServerClient | undefined, actions: DataSpaceViewerActions, actionState?: ActionState) => Promise<DataSpaceViewerState>;
40
+ /**
41
+ * A viewer for the DataSpace *dataSpacePath* of a model that exists only as
42
+ * entities -- unsaved or unreleased, as Studio previews one in its editor --
43
+ * with its dependencies' entities by project (as
44
+ * `collectIndexedDependencyEntities` gives them). The graph is built, not just
45
+ * handed to the analysis: the viewer reads graph data as soon as the DataSpace
46
+ * has a default execution context.
47
+ */
48
+ export declare const previewDataSpaceFromEntities: (applicationStore: GenericLegendApplicationStore, graphManagerState: GraphManagerState, ownEntities: Entity[], dependencyEntitiesIndex: Map<string, EntitiesWithOrigin>, dataSpacePath: string, origin: DataSpacePreviewOrigin, depotServerClient: DepotServerClient | undefined, actions: DataSpaceViewerActions) => Promise<DataSpaceViewerState>;
49
+ //# sourceMappingURL=DataSpacePreviewFromEntities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataSpacePreviewFromEntities.d.ts","sourceRoot":"","sources":["../../src/stores/DataSpacePreviewFromEntities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAqB,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAGxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,MAAM,MAAM,sBAAsB,GAAG,IAAI,CACvC,qBAAqB,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAAC,EACrD,mBAAmB,CACpB,CAAC;AAEF,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAC9B,UAAU,MAAM,EAAE,EAClB,gBAAgB,MAAM,KACrB,MAwBF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAC3B,kBAAkB,6BAA6B,EAC/C,mBAAmB,iBAAiB,EACpC,eAAe,MAAM,EACrB,UAAU,MAAM,OAAO,CAAC,MAAM,EAAE,CAAC,EACjC,QAAQ,sBAAsB,EAC9B,mBAAmB,iBAAiB,GAAG,SAAS,EAChD,SAAS,sBAAsB,EAC/B,cAAc,WAAW,KACxB,OAAO,CAAC,oBAAoB,CAiB9B,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,GACvC,kBAAkB,6BAA6B,EAC/C,mBAAmB,iBAAiB,EACpC,aAAa,MAAM,EAAE,EACrB,yBAAyB,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,EACxD,eAAe,MAAM,EACrB,QAAQ,sBAAsB,EAC9B,mBAAmB,iBAAiB,GAAG,SAAS,EAChD,SAAS,sBAAsB,KAC9B,OAAO,CAAC,oBAAoB,CA6B9B,CAAC"}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Copyright (c) 2026-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { InMemoryGraphData } from '@finos/legend-graph';
17
+ import { DATA_SPACE_ELEMENT_CLASSIFIER_PATH } from '../graph-manager/protocol/pure/DSL_DataSpace_PureProtocolProcessorPlugin.js';
18
+ import { DSL_DataSpace_getGraphManagerExtension } from '../graph-manager/protocol/pure/DSL_DataSpace_PureGraphManagerExtension.js';
19
+ import { DataSpaceViewerState } from './DataSpaceViewerState.js';
20
+ /**
21
+ * The DataSpace to preview among *entities*: *preferredPath* when given -- and only
22
+ * that one, never another in its place -- else the only one the model has.
23
+ */
24
+ export const findDataSpaceEntity = (entities, preferredPath) => {
25
+ const dataSpaces = entities.filter((entity) => entity.classifierPath === DATA_SPACE_ELEMENT_CLASSIFIER_PATH);
26
+ const has = `the model has: ${dataSpaces.map((entity) => entity.path).join(', ') || 'none'}`;
27
+ if (preferredPath !== undefined) {
28
+ const preferred = dataSpaces.find((entity) => entity.path === preferredPath);
29
+ if (!preferred) {
30
+ throw new Error(`No data product ${preferredPath} to preview; ${has}`);
31
+ }
32
+ return preferred;
33
+ }
34
+ if (dataSpaces.length !== 1) {
35
+ throw new Error(dataSpaces.length
36
+ ? `More than one data product to preview; ${has}`
37
+ : 'No data product to preview');
38
+ }
39
+ return dataSpaces[0];
40
+ };
41
+ /**
42
+ * A viewer for the DataSpace *dataSpacePath* of the model *graphManagerState*
43
+ * has built: the DataSpace analysed over *entities* (the model's own and its
44
+ * dependencies'), then viewed over that graph. Studio's editor preview passes
45
+ * the graph it already has; `previewDataSpaceFromEntities` builds one first.
46
+ */
47
+ export const previewDataSpace = async (applicationStore, graphManagerState, dataSpacePath, entities, origin, depotServerClient, actions, actionState) => {
48
+ const analysisResult = await DSL_DataSpace_getGraphManagerExtension(graphManagerState.graphManager).analyzeDataSpace(dataSpacePath, entities, undefined, actionState);
49
+ return new DataSpaceViewerState(applicationStore, graphManagerState, origin.groupId, origin.artifactId, origin.versionId, analysisResult, depotServerClient, {
50
+ ...actions,
51
+ retrieveGraphData: () => new InMemoryGraphData(graphManagerState.graph),
52
+ });
53
+ };
54
+ /**
55
+ * A viewer for the DataSpace *dataSpacePath* of a model that exists only as
56
+ * entities -- unsaved or unreleased, as Studio previews one in its editor --
57
+ * with its dependencies' entities by project (as
58
+ * `collectIndexedDependencyEntities` gives them). The graph is built, not just
59
+ * handed to the analysis: the viewer reads graph data as soon as the DataSpace
60
+ * has a default execution context.
61
+ */
62
+ export const previewDataSpaceFromEntities = async (applicationStore, graphManagerState, ownEntities, dependencyEntitiesIndex, dataSpacePath, origin, depotServerClient, actions) => {
63
+ await graphManagerState.initializeSystem();
64
+ const dependencyManager = graphManagerState.graphManager.createDependencyManager();
65
+ graphManagerState.graph.dependencyManager = dependencyManager;
66
+ await graphManagerState.graphManager.buildDependencies(graphManagerState.coreModel, graphManagerState.systemModel, dependencyManager, dependencyEntitiesIndex, graphManagerState.dependenciesBuildState);
67
+ await graphManagerState.graphManager.buildGraph(graphManagerState.graph, ownEntities, graphManagerState.graphBuildState);
68
+ const dependencyEntities = Array.from(dependencyEntitiesIndex.values()).flatMap((project) => project.entities);
69
+ return previewDataSpace(applicationStore, graphManagerState, dataSpacePath, () => Promise.resolve(ownEntities.concat(dependencyEntities)), origin, depotServerClient, actions);
70
+ };
71
+ //# sourceMappingURL=DataSpacePreviewFromEntities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataSpacePreviewFromEntities.js","sourceRoot":"","sources":["../../src/stores/DataSpacePreviewFromEntities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,iBAAiB,EAA0B,MAAM,qBAAqB,CAAC;AAIhF,OAAO,EAAE,kCAAkC,EAAE,MAAM,6EAA6E,CAAC;AACjI,OAAO,EAAE,sCAAsC,EAAE,MAAM,2EAA2E,CAAC;AACnI,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAajE;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,QAAkB,EAClB,aAAsB,EACd,EAAE;IACV,MAAM,UAAU,GAAG,QAAQ,CAAC,MA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CAAC;AACJ,CAAC,CAAC"}
@@ -14,14 +14,9 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { ActionState, type GeneratorFn } from '@finos/legend-shared';
17
+ import { QUALITY_LEVEL } from '@finos/legend-extension-dsl-data-product';
17
18
  import type { DataSpaceViewerState } from './DataSpaceViewerState.js';
18
- export declare enum DATA_SPACE_QUALITY_LEVEL {
19
- DIAMOND = "DIAMOND",
20
- PLATINUM = "PLATINUM",
21
- GOLD = "GOLD",
22
- SILVER = "SILVER",
23
- BRONZE = "BRONZE"
24
- }
19
+ export { QUALITY_LEVEL as DATA_SPACE_QUALITY_LEVEL };
25
20
  export type DataSpaceQualityBreakdown = {
26
21
  isDescriptionDocumented: boolean;
27
22
  isExecutablesPresent: boolean;
@@ -32,16 +27,16 @@ export type DataSpaceQualityBreakdown = {
32
27
  totalAttributeCount: number;
33
28
  };
34
29
  export type DataSpaceQualityResult = {
35
- qualityLevel: DATA_SPACE_QUALITY_LEVEL;
30
+ qualityLevel: QUALITY_LEVEL;
36
31
  qualityBreakdown: DataSpaceQualityBreakdown;
37
32
  };
38
33
  export declare class DataSpaceQualityState {
39
34
  readonly dataSpaceViewerState: DataSpaceViewerState;
40
- qualityLevel: DATA_SPACE_QUALITY_LEVEL | undefined;
35
+ qualityLevel: QUALITY_LEVEL | undefined;
41
36
  qualityBreakdown: DataSpaceQualityBreakdown | undefined;
42
37
  readonly computingQualityState: ActionState;
43
38
  constructor(dataSpaceViewerState: DataSpaceViewerState);
44
- setQualityLevel(val: DATA_SPACE_QUALITY_LEVEL | undefined): void;
39
+ setQualityLevel(val: QUALITY_LEVEL | undefined): void;
45
40
  setQualityBreakdown(val: DataSpaceQualityBreakdown | undefined): void;
46
41
  get isSupported(): boolean;
47
42
  computeQuality(): GeneratorFn<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"DataSpaceQualityState.d.ts","sourceRoot":"","sources":["../../src/stores/DataSpaceQualityState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;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L,WAAW,EAGX,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAKtE,OAAO,EAAE,aAAa,IAAI,wBAAwB,EAAE,CAAC;AAIrD,MAAM,MAAM,yBAAyB,GAAG;IACtC,uBAAuB,EAAE,OAAO,CAAC;IACjC,oBAAoB,EAAE,OAAO,CAAC;IAC9B,4BAA4B,EAAE,OAAO,CAAC;IACtC,wBAAwB,EAAE,OAAO,CAAC;IAClC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,wBAAwB,EAAE,MAAM,CAAC;IACjC,mBAAmB,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,YAAY,EAAE,aAAa,CAAC;IAC5B,gBAAgB,EAAE,yBAAyB,CAAC;CAC7C,CAAC;AAUF,qBAAa,qBAAqB;IAChC,QAAQ,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;IACpD,YAAY,EAAE,aAAa,GAAG,SAAS,CAAC;IACxC,gBAAgB,EAAE,yBAAyB,GAAG,SAAS,CAAC;IACxD,QAAQ,CAAC,qBAAqB,cAAwB;gBAE1C,oBAAoB,EAAE,oBAAoB;IAYtD,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,SAAS,GAAG,IAAI;IAIrD,mBAAmB,CAAC,GAAG,EAAE,yBAAyB,GAAG,SAAS,GAAG,IAAI;IAIrE,IAAI,WAAW,IAAI,OAAO,CAEzB;IAEA,cAAc,IAAI,WAAW,CAAC,IAAI,CAAC;CA2BrC"}
@@ -15,15 +15,11 @@
15
15
  */
16
16
  import { action, flow, makeObservable, observable } from 'mobx';
17
17
  import { ActionState, assertErrorThrown, LogEvent, } from '@finos/legend-shared';
18
+ import { QUALITY_LEVEL } from '@finos/legend-extension-dsl-data-product';
18
19
  import { DSL_DATASPACE_EVENT } from '../__lib__/DSL_DataSpace_Event.js';
19
- export var DATA_SPACE_QUALITY_LEVEL;
20
- (function (DATA_SPACE_QUALITY_LEVEL) {
21
- DATA_SPACE_QUALITY_LEVEL["DIAMOND"] = "DIAMOND";
22
- DATA_SPACE_QUALITY_LEVEL["PLATINUM"] = "PLATINUM";
23
- DATA_SPACE_QUALITY_LEVEL["GOLD"] = "GOLD";
24
- DATA_SPACE_QUALITY_LEVEL["SILVER"] = "SILVER";
25
- DATA_SPACE_QUALITY_LEVEL["BRONZE"] = "BRONZE";
26
- })(DATA_SPACE_QUALITY_LEVEL || (DATA_SPACE_QUALITY_LEVEL = {}));
20
+ // The tiers are the same for a data product and a data space: one enum, defined with the quality
21
+ // response models. This keeps the name existing consumers know it by.
22
+ export { QUALITY_LEVEL as DATA_SPACE_QUALITY_LEVEL };
27
23
  // The actual scoring (description/executables/Models Documentation checks, attribute
28
24
  // coverage thresholds) lives server-side — see vendor-data-marketplace's
29
25
  // `doc-quality/dataspace` endpoint — since SingleStore already has the dataspace's
@@ -1 +1 @@
1
- {"version":3,"file":"DataSpaceQualityState.js","sourceRoot":"","sources":["../../src/stores/DataSpaceQualityState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAChE,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,QAAQ,GAET,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAExE,MAAM,CAAN,IAAY,wBAMX;AAND,WAAY,wBAAwB;IAClC,+CAAmB,CAAA;IACnB,iDAAqB,CAAA;IACrB,yCAAa,CAAA;IACb,6CAAiB,CAAA;IACjB,6CAAiB,CAAA;AACnB,CAAC,EANW,wBAAwB,KAAxB,wBAAwB,QAMnC;AAmBD,qFAAqF;AACrF,yEAAyE;AACzE,mFAAmF;A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IAAI,CACxD,QAAQ,CAAC,MAAM,CAAC,mBAAmB,CAAC,8BAA8B,CAAC,EACnE,KAAK,CACN,CAAC;YACF,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finos/legend-extension-dsl-data-space",
3
- "version": "10.4.273",
3
+ "version": "10.4.275",
4
4
  "description": "Legend extension for Data Space DSL",
5
5
  "keywords": [
6
6
  "legend",
@@ -43,19 +43,19 @@
43
43
  "test:watch": "jest --watch"
44
44
  },
45
45
  "dependencies": {
46
- "@finos/legend-application": "16.1.3",
47
- "@finos/legend-art": "7.1.174",
48
- "@finos/legend-code-editor": "2.0.217",
49
- "@finos/legend-extension-dsl-data-product": "0.2.9",
50
- "@finos/legend-extension-dsl-diagram": "8.1.282",
51
- "@finos/legend-graph": "32.9.4",
52
- "@finos/legend-lego": "2.0.238",
53
- "@finos/legend-query-builder": "4.19.27",
54
- "@finos/legend-server-depot": "6.1.26",
55
- "@finos/legend-server-lakehouse": "0.4.6",
56
- "@finos/legend-server-sdlc": "5.5.4",
57
- "@finos/legend-shared": "11.0.33",
58
- "@finos/legend-storage": "3.0.155",
46
+ "@finos/legend-application": "16.1.4",
47
+ "@finos/legend-art": "7.1.175",
48
+ "@finos/legend-code-editor": "2.0.219",
49
+ "@finos/legend-extension-dsl-data-product": "0.2.11",
50
+ "@finos/legend-extension-dsl-diagram": "8.1.284",
51
+ "@finos/legend-graph": "32.10.1",
52
+ "@finos/legend-lego": "2.1.1",
53
+ "@finos/legend-query-builder": "4.19.29",
54
+ "@finos/legend-server-depot": "6.1.27",
55
+ "@finos/legend-server-lakehouse": "0.4.8",
56
+ "@finos/legend-server-sdlc": "5.5.5",
57
+ "@finos/legend-shared": "11.0.34",
58
+ "@finos/legend-storage": "3.0.156",
59
59
  "@mui/material": "7.3.4",
60
60
  "@testing-library/dom": "10.4.0",
61
61
  "@testing-library/react": "16.2.0",
@@ -20,6 +20,7 @@ import { type QueryExplicitExecutionContextInfo } from '@finos/legend-graph';
20
20
  import {
21
21
  LegendAIChat,
22
22
  LegendAIErrorBoundary,
23
+ collectLegendAIChatModes,
23
24
  findLegendAIPlugin,
24
25
  LegendAIChatTelemetryEventType,
25
26
  bridgeLegendAIServices,
@@ -83,6 +84,13 @@ const DataSpaceLegendAIIntegrationInner = observer(
83
84
  ),
84
85
  [dataSpaceViewerState],
85
86
  );
87
+ const chatModes = useMemo(
88
+ () =>
89
+ collectLegendAIChatModes(
90
+ dataSpaceViewerState.applicationStore.pluginManager.getApplicationPlugins(),
91
+ ),
92
+ [dataSpaceViewerState],
93
+ );
86
94
 
87
95
  const [services, setServices] = useState<TDSServiceSchema[]>([]);
88
96
  useEffect(
@@ -193,6 +201,7 @@ const DataSpaceLegendAIIntegrationInner = observer(
193
201
 
194
202
  return (
195
203
  <LegendAIChat
204
+ modes={chatModes}
196
205
  services={services}
197
206
  coordinates={coordinates}
198
207
  config={config}
@@ -17,71 +17,22 @@
17
17
  import { observer } from 'mobx-react-lite';
18
18
  import { flowResult } from 'mobx';
19
19
  import { useEffect } from 'react';
20
- import { CircularProgress, Tooltip } from '@mui/material';
21
- import { clsx } from '@finos/legend-art';
22
20
  import {
23
- DATA_SPACE_QUALITY_LEVEL,
24
- type DataSpaceQualityBreakdown,
25
- type DataSpaceQualityState,
21
+ QUALITY_LEVEL,
22
+ QualityEmote,
23
+ formatAttributeCoverageSuffix,
24
+ } from '@finos/legend-extension-dsl-data-product';
25
+ import type {
26
+ DataSpaceQualityBreakdown,
27
+ DataSpaceQualityState,
26
28
  } from '../stores/DataSpaceQualityState.js';
27
29
 
28
- const QUALITY_EMOTE_CLASS_NAME = clsx(
29
- 'data-space__viewer__header__actions',
30
- 'data-space__viewer__header__quality-emote',
31
- );
32
-
33
- const TIER_STATUS_ICON = {
34
- ACHIEVED: '✅',
35
- NEXT: '➡️',
36
- LOCKED: '🔒',
37
- };
38
-
39
- const QUALITY_EMOTE_CONFIG: Record<
40
- DATA_SPACE_QUALITY_LEVEL,
41
- { emoji: string; label: string }
42
- > = {
43
- [DATA_SPACE_QUALITY_LEVEL.DIAMOND]: {
44
- emoji: '💎',
45
- label: 'Diamond quality',
46
- },
47
- [DATA_SPACE_QUALITY_LEVEL.PLATINUM]: {
48
- emoji: '🏆',
49
- label: 'Platinum quality',
50
- },
51
- [DATA_SPACE_QUALITY_LEVEL.GOLD]: { emoji: '🥇', label: 'Gold quality' },
52
- [DATA_SPACE_QUALITY_LEVEL.SILVER]: { emoji: '🥈', label: 'Silver quality' },
53
- [DATA_SPACE_QUALITY_LEVEL.BRONZE]: { emoji: '🥉', label: 'Bronze quality' },
54
- };
55
-
56
- const AI_READY_QUALITY_LEVELS: DATA_SPACE_QUALITY_LEVEL[] = [
57
- DATA_SPACE_QUALITY_LEVEL.DIAMOND,
58
- DATA_SPACE_QUALITY_LEVEL.PLATINUM,
59
- ];
60
-
61
- // The full tier ladder, in order. Milestones are cumulative — reaching one implies every
62
- // requirement of the milestones before it is already satisfied — so a user's current tier
63
- // is exactly the last milestone they've achieved.
64
- const TIER_LADDER = [
65
- DATA_SPACE_QUALITY_LEVEL.BRONZE,
66
- DATA_SPACE_QUALITY_LEVEL.SILVER,
67
- DATA_SPACE_QUALITY_LEVEL.GOLD,
68
- DATA_SPACE_QUALITY_LEVEL.PLATINUM,
69
- DATA_SPACE_QUALITY_LEVEL.DIAMOND,
70
- ];
71
-
72
- const formatAttributeCoverageSuffix = (
73
- breakdown: DataSpaceQualityBreakdown,
74
- ): string =>
75
- breakdown.attributeCoverage !== undefined
76
- ? ` (currently ${Math.round(breakdown.attributeCoverage * 100)}%)`
77
- : '';
78
-
79
30
  const getMilestoneRequirement = (
80
- level: DATA_SPACE_QUALITY_LEVEL,
31
+ level: QUALITY_LEVEL,
81
32
  breakdown: DataSpaceQualityBreakdown,
82
33
  ): string => {
83
34
  switch (level) {
84
- case DATA_SPACE_QUALITY_LEVEL.SILVER: {
35
+ case QUALITY_LEVEL.SILVER: {
85
36
  const missing: string[] = [];
86
37
  if (!breakdown.isDescriptionDocumented) {
87
38
  missing.push('write a description (2+ sentences)');
@@ -98,68 +49,20 @@ const getMilestoneRequirement = (
98
49
  }
99
50
  return 'Write a description (2+ sentences), and make sure Executables and Models Documentation are present.';
100
51
  }
101
- case DATA_SPACE_QUALITY_LEVEL.GOLD:
52
+ case QUALITY_LEVEL.GOLD:
102
53
  return breakdown.isEveryServiceDocumented
103
54
  ? 'Describe at least 50% of attributes.'
104
55
  : 'Describe every executable, and describe at least 50% of attributes.';
105
- case DATA_SPACE_QUALITY_LEVEL.PLATINUM:
56
+ case QUALITY_LEVEL.PLATINUM:
106
57
  return `Describe 90%-95% of attributes${formatAttributeCoverageSuffix(breakdown)}.`;
107
- case DATA_SPACE_QUALITY_LEVEL.DIAMOND:
58
+ case QUALITY_LEVEL.DIAMOND:
108
59
  return `Describe 95%+ of attributes${formatAttributeCoverageSuffix(breakdown)}. Coming soon: will also require MCPs + Verified NLQs ground truth.`;
109
- case DATA_SPACE_QUALITY_LEVEL.BRONZE:
60
+ case QUALITY_LEVEL.BRONZE:
110
61
  default:
111
62
  return '';
112
63
  }
113
64
  };
114
65
 
115
- // Renders the full tier ladder up to Diamond, not just the next milestone, and marks which
116
- // tiers unlock the AI-Ready stamp.
117
- const QualityRoadmap = observer(
118
- (props: {
119
- qualityLevel: DATA_SPACE_QUALITY_LEVEL;
120
- breakdown: DataSpaceQualityBreakdown;
121
- }): React.ReactNode => {
122
- const { qualityLevel, breakdown } = props;
123
- const config = QUALITY_EMOTE_CONFIG[qualityLevel];
124
- const currentIndex = TIER_LADDER.indexOf(qualityLevel);
125
-
126
- return (
127
- <div style={{ display: 'flex', flexDirection: 'column', gap: '0.4rem' }}>
128
- <div style={{ fontWeight: 700 }}>
129
- {config.emoji} Current: {config.label}
130
- </div>
131
- {TIER_LADDER.slice(1).map((level, index) => {
132
- const levelIndex = index + 1;
133
- const isAchieved = currentIndex >= levelIndex;
134
- const isNext = currentIndex === levelIndex - 1;
135
- const levelConfig = QUALITY_EMOTE_CONFIG[level];
136
- const isAiReadyMilestone = AI_READY_QUALITY_LEVELS.includes(level);
137
- const statusIcon = isAchieved
138
- ? TIER_STATUS_ICON.ACHIEVED
139
- : isNext
140
- ? TIER_STATUS_ICON.NEXT
141
- : TIER_STATUS_ICON.LOCKED;
142
- return (
143
- <div
144
- key={level}
145
- style={{
146
- fontWeight: isNext ? 700 : 400,
147
- opacity: isNext ? 1 : 0.85,
148
- }}
149
- >
150
- {statusIcon} {levelConfig.emoji} {levelConfig.label}
151
- {isAiReadyMilestone ? ' (AI-Ready)' : ''}
152
- {!isAchieved
153
- ? `: ${getMilestoneRequirement(level, breakdown)}`
154
- : ''}
155
- </div>
156
- );
157
- })}
158
- </div>
159
- );
160
- },
161
- );
162
-
163
66
  export const DataSpaceQualityEmote = observer(
164
67
  (props: { qualityState: DataSpaceQualityState }) => {
165
68
  const { qualityState } = props;
@@ -172,54 +75,17 @@ export const DataSpaceQualityEmote = observer(
172
75
  return null;
173
76
  }
174
77
 
175
- if (
176
- qualityState.computingQualityState.isInInitialState ||
177
- qualityState.computingQualityState.isInProgress
178
- ) {
179
- return (
180
- <div className={QUALITY_EMOTE_CLASS_NAME}>
181
- <CircularProgress size={12} />
182
- </div>
183
- );
184
- }
185
-
186
- if (!qualityState.qualityLevel || !qualityState.qualityBreakdown) {
187
- return null;
188
- }
189
-
190
- const config = QUALITY_EMOTE_CONFIG[qualityState.qualityLevel];
191
- const isAIReady = AI_READY_QUALITY_LEVELS.includes(
192
- qualityState.qualityLevel,
193
- );
194
-
195
78
  return (
196
- <Tooltip
197
- title={
198
- <QualityRoadmap
199
- qualityLevel={qualityState.qualityLevel}
200
- breakdown={qualityState.qualityBreakdown}
201
- />
79
+ <QualityEmote
80
+ classNamePrefix="data-space"
81
+ isLoading={
82
+ qualityState.computingQualityState.isInInitialState ||
83
+ qualityState.computingQualityState.isInProgress
202
84
  }
203
- placement="bottom"
204
- >
205
- <div className={QUALITY_EMOTE_CLASS_NAME}>
206
- AI Readiness Badge:{' '}
207
- <span
208
- className="data-space__viewer__header__quality-emote__icon"
209
- aria-label={config.label}
210
- >
211
- {config.emoji}
212
- </span>
213
- {isAIReady && (
214
- <span
215
- className="data-space__viewer__header__quality-emote__ai-ready-stamp"
216
- title="Documentation quality is high enough for reliable AI consumption"
217
- >
218
- AI-Ready
219
- </span>
220
- )}
221
- </div>
222
- </Tooltip>
85
+ qualityLevel={qualityState.qualityLevel}
86
+ breakdown={qualityState.qualityBreakdown}
87
+ getMilestoneRequirement={getMilestoneRequirement}
88
+ />
223
89
  );
224
90
  },
225
91
  );
@@ -29,6 +29,13 @@ export {
29
29
  } from '../stores/DataSpaceViewerNavigation.js';
30
30
  export * from '../stores/DSL_DataSpace_LegendApplicationPlugin_Extension.js';
31
31
  export { DataSpaceViewerState } from '../stores/DataSpaceViewerState.js';
32
+ export {
33
+ type DataSpacePreviewOrigin,
34
+ type DataSpaceViewerActions,
35
+ findDataSpaceEntity,
36
+ previewDataSpace,
37
+ previewDataSpaceFromEntities,
38
+ } from '../stores/DataSpacePreviewFromEntities.js';
32
39
  export {
33
40
  DATA_SPACE_QUALITY_LEVEL,
34
41
  type DataSpaceQualityBreakdown,