@finos/legend-lego 2.0.211 → 2.0.213

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 (74) hide show
  1. package/lib/index.css +2 -2
  2. package/lib/index.css.map +1 -1
  3. package/lib/legend-ai/LegendAIDocEnrichment.d.ts +12 -12
  4. package/lib/legend-ai/LegendAIDocEnrichment.d.ts.map +1 -1
  5. package/lib/legend-ai/LegendAIDocEnrichment.js +317 -86
  6. package/lib/legend-ai/LegendAIDocEnrichment.js.map +1 -1
  7. package/lib/legend-ai/LegendAIHostIntegration.d.ts +31 -0
  8. package/lib/legend-ai/LegendAIHostIntegration.d.ts.map +1 -0
  9. package/lib/legend-ai/LegendAIHostIntegration.js +50 -0
  10. package/lib/legend-ai/LegendAIHostIntegration.js.map +1 -0
  11. package/lib/legend-ai/LegendAIServiceRetrieval.d.ts.map +1 -1
  12. package/lib/legend-ai/LegendAIServiceRetrieval.js +34 -35
  13. package/lib/legend-ai/LegendAIServiceRetrieval.js.map +1 -1
  14. package/lib/legend-ai/LegendAITypes.d.ts +85 -7
  15. package/lib/legend-ai/LegendAITypes.d.ts.map +1 -1
  16. package/lib/legend-ai/LegendAITypes.js +99 -1
  17. package/lib/legend-ai/LegendAITypes.js.map +1 -1
  18. package/lib/legend-ai/LegendAI_LegendApplicationPlugin_Extension.d.ts +36 -3
  19. package/lib/legend-ai/LegendAI_LegendApplicationPlugin_Extension.d.ts.map +1 -1
  20. package/lib/legend-ai/LegendAI_LegendApplicationPlugin_Extension.js +29 -0
  21. package/lib/legend-ai/LegendAI_LegendApplicationPlugin_Extension.js.map +1 -1
  22. package/lib/legend-ai/__test-utils__/LegendAITestUtils.d.ts.map +1 -1
  23. package/lib/legend-ai/__test-utils__/LegendAITestUtils.js +7 -0
  24. package/lib/legend-ai/__test-utils__/LegendAITestUtils.js.map +1 -1
  25. package/lib/legend-ai/components/LegendAICharts.d.ts.map +1 -1
  26. package/lib/legend-ai/components/LegendAICharts.js +6 -10
  27. package/lib/legend-ai/components/LegendAICharts.js.map +1 -1
  28. package/lib/legend-ai/components/LegendAIChat.d.ts.map +1 -1
  29. package/lib/legend-ai/components/LegendAIChat.js +263 -41
  30. package/lib/legend-ai/components/LegendAIChat.js.map +1 -1
  31. package/lib/legend-ai/components/LegendAIChatInput.d.ts +1 -1
  32. package/lib/legend-ai/components/LegendAIChatInput.d.ts.map +1 -1
  33. package/lib/legend-ai/components/LegendAIChatInput.js +2 -1
  34. package/lib/legend-ai/components/LegendAIChatInput.js.map +1 -1
  35. package/lib/legend-ai/index.d.ts +5 -2
  36. package/lib/legend-ai/index.d.ts.map +1 -1
  37. package/lib/legend-ai/index.js +5 -2
  38. package/lib/legend-ai/index.js.map +1 -1
  39. package/lib/legend-ai/stores/LegendAIChatProcessors.d.ts +9 -3
  40. package/lib/legend-ai/stores/LegendAIChatProcessors.d.ts.map +1 -1
  41. package/lib/legend-ai/stores/LegendAIChatProcessors.js +794 -220
  42. package/lib/legend-ai/stores/LegendAIChatProcessors.js.map +1 -1
  43. package/lib/legend-ai/stores/LegendAIChatState.d.ts.map +1 -1
  44. package/lib/legend-ai/stores/LegendAIChatState.js +47 -21
  45. package/lib/legend-ai/stores/LegendAIChatState.js.map +1 -1
  46. package/lib/legend-ai/stores/LegendAIJoinAnalysis.d.ts +29 -0
  47. package/lib/legend-ai/stores/LegendAIJoinAnalysis.d.ts.map +1 -0
  48. package/lib/legend-ai/stores/LegendAIJoinAnalysis.js +124 -0
  49. package/lib/legend-ai/stores/LegendAIJoinAnalysis.js.map +1 -0
  50. package/lib/legend-ai/stores/LegendAISqlHelpers.d.ts +25 -0
  51. package/lib/legend-ai/stores/LegendAISqlHelpers.d.ts.map +1 -0
  52. package/lib/legend-ai/stores/LegendAISqlHelpers.js +64 -0
  53. package/lib/legend-ai/stores/LegendAISqlHelpers.js.map +1 -0
  54. package/lib/legend-ai/stores/LegendAISqlJoinSanitizers.d.ts +22 -0
  55. package/lib/legend-ai/stores/LegendAISqlJoinSanitizers.d.ts.map +1 -0
  56. package/lib/legend-ai/stores/LegendAISqlJoinSanitizers.js +411 -0
  57. package/lib/legend-ai/stores/LegendAISqlJoinSanitizers.js.map +1 -0
  58. package/package.json +6 -6
  59. package/src/legend-ai/LegendAIDocEnrichment.ts +435 -97
  60. package/src/legend-ai/LegendAIHostIntegration.tsx +80 -0
  61. package/src/legend-ai/LegendAIServiceRetrieval.ts +50 -35
  62. package/src/legend-ai/LegendAITypes.ts +169 -5
  63. package/src/legend-ai/LegendAI_LegendApplicationPlugin_Extension.ts +73 -1
  64. package/src/legend-ai/__test-utils__/LegendAITestUtils.ts +10 -0
  65. package/src/legend-ai/components/LegendAICharts.tsx +30 -33
  66. package/src/legend-ai/components/LegendAIChat.tsx +555 -91
  67. package/src/legend-ai/components/LegendAIChatInput.tsx +6 -2
  68. package/src/legend-ai/index.ts +22 -3
  69. package/src/legend-ai/stores/LegendAIChatProcessors.ts +1286 -322
  70. package/src/legend-ai/stores/LegendAIChatState.ts +73 -28
  71. package/src/legend-ai/stores/LegendAIJoinAnalysis.ts +165 -0
  72. package/src/legend-ai/stores/LegendAISqlHelpers.ts +82 -0
  73. package/src/legend-ai/stores/LegendAISqlJoinSanitizers.ts +515 -0
  74. package/tsconfig.json +4 -0
@@ -23,7 +23,11 @@ import {
23
23
  CheckIcon,
24
24
  clsx,
25
25
  } from '@finos/legend-art';
26
- import type { LegendAIChatState, LegendAIScopeItem } from '../LegendAITypes.js';
26
+ import {
27
+ type LegendAIChatState,
28
+ type LegendAIScopeItem,
29
+ LEGEND_AI_DEFAULT_MODEL_LABEL,
30
+ } from '../LegendAITypes.js';
27
31
  import { LegendAIScopeSelector } from './LegendAIScopeSelector.js';
28
32
 
29
33
  const MAX_TEXTAREA_HEIGHT = 160;
@@ -38,7 +42,7 @@ export const LegendAIChatInput = (props: {
38
42
  const [isModelDropdownOpen, setIsModelDropdownOpen] = useState(false);
39
43
 
40
44
  const modelLabel = useMemo(() => {
41
- const modelName = state.selectedModelName ?? 'Auto';
45
+ const modelName = state.selectedModelName ?? LEGEND_AI_DEFAULT_MODEL_LABEL;
42
46
  return modelName.length > 18 ? `${modelName.slice(0, 17)}...` : modelName;
43
47
  }, [state.selectedModelName]);
44
48
 
@@ -16,6 +16,10 @@
16
16
 
17
17
  export * from './LegendAITypes.js';
18
18
  export * from './LegendAI_LegendApplicationPlugin_Extension.js';
19
+ export {
20
+ bridgeLegendAIServices,
21
+ useLegendAIChatTelemetryLogger,
22
+ } from './LegendAIHostIntegration.js';
19
23
  export {
20
24
  LegendAIChat,
21
25
  LEGEND_AI_ANCHOR_ID,
@@ -38,6 +42,7 @@ export {
38
42
  finishWithThinkingError,
39
43
  classifyError,
40
44
  buildConversationHistory,
45
+ filterHistoryForAccessPoints,
41
46
  buildGenerationFailureMessage,
42
47
  buildExecutionErrorMessage,
43
48
  generateAndJudgeSql,
@@ -55,8 +60,6 @@ export {
55
60
  analyzeOrchestratorResults,
56
61
  cleanLlmSqlResponse,
57
62
  isValidSqlCorrection,
58
- sanitizeJoinOrderBy,
59
- sanitizeJoinSameKeyColumns,
60
63
  sanitizeLiteralColumns,
61
64
  stripGuessedNonDateServiceParams,
62
65
  ensureDateParameters,
@@ -75,6 +78,18 @@ export {
75
78
  type LegendAIOperationContext,
76
79
  type MissingParamInfo,
77
80
  } from './stores/LegendAIChatProcessors.js';
81
+ export {
82
+ buildCrossJoinZeroRowExplanation,
83
+ buildJoinablePairSuggestions,
84
+ parseSampleValueSet,
85
+ } from './stores/LegendAIJoinAnalysis.js';
86
+ export {
87
+ boundCrossAccessPointJoinDrivingSide,
88
+ sanitizeJoinDuplicateColumns,
89
+ sanitizeJoinOrderBy,
90
+ sanitizeJoinSameKeyColumns,
91
+ wrapBareJoinAccessPoints,
92
+ } from './stores/LegendAISqlJoinSanitizers.js';
78
93
  export {
79
94
  preFilterServicesByRelevance,
80
95
  isFuzzyMatch,
@@ -101,12 +116,16 @@ export {
101
116
  enrichColumnsFromElementDocs,
102
117
  inferServiceRelationshipsFromAssociations,
103
118
  extractLambdaPreFilters,
104
- formatPreFiltersForContext,
105
119
  extractModelContext,
106
120
  buildEnrichedBusinessContext,
107
121
  buildModelContextEnrichmentText,
108
122
  findBestAlternateRoot,
109
123
  resolveEntitiesDeterministic,
124
+ rankEntities,
110
125
  buildSemanticPropertyIndex,
111
126
  splitIdentifierTokens,
127
+ buildDataQueryApproachText,
128
+ relaxExactStringFilters,
129
+ extractFilteredColumns,
130
+ buildProbedValueHints,
112
131
  } from './LegendAIDocEnrichment.js';