@trilogy-data/trilogy-studio-components 0.1.3 → 0.1.5

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 (143) hide show
  1. package/dist/{ChatCreatorModal-CrRORbVm.js → ChatCreatorModal-BdUJ9uoW.js} +1 -1
  2. package/dist/{Dashboard-CUPl-At6.js → Dashboard-BGpN0Ixs.js} +3 -3
  3. package/dist/{DashboardCreatorInline-C5qQWVmy.js → DashboardCreatorInline-CZQ5JsIB.js} +1 -1
  4. package/dist/{DashboardMobile-V9X7-wJV.js → DashboardMobile-leXuc7Vi.js} +18 -18
  5. package/dist/{LLMConnectionList-CWONtRCY.js → LLMConnectionList-BfseODm5.js} +115 -115
  6. package/dist/{LLMView-BnN9wjXa.js → LLMView-CkW6UDnK.js} +9 -9
  7. package/dist/Manager-sE56hYtJ.js +4 -0
  8. package/dist/ResultComponent-CcThUn60.js +271 -0
  9. package/dist/{Sidebar-6cjut4cK.js → Sidebar-gsKRqjCv.js} +3 -3
  10. package/dist/{TutorialPage-j03hgD_I.js → TutorialPage-DEOrK1-3.js} +4 -4
  11. package/dist/{WelcomePage-CuLo21YT.js → WelcomePage-DhWLhWSJ.js} +5 -5
  12. package/dist/chats/chat.d.ts +11 -3
  13. package/dist/chats/chat.d.ts.map +1 -1
  14. package/dist/components/SimpleEditor.vue.d.ts +3 -0
  15. package/dist/components/SimpleEditor.vue.d.ts.map +1 -1
  16. package/dist/components/StatusIcon.vue.d.ts +1 -1
  17. package/dist/components/StatusIcon.vue.d.ts.map +1 -1
  18. package/dist/components/SymbolsPane.vue.d.ts +3 -0
  19. package/dist/components/SymbolsPane.vue.d.ts.map +1 -1
  20. package/dist/components/VegaLiteChart.vue.d.ts +1 -1
  21. package/dist/components/VegaLiteChart.vue.d.ts.map +1 -1
  22. package/dist/components/dashboard/DashboardChart.vue.d.ts +1 -1
  23. package/dist/components/dashboard/DashboardChartEditor.vue.d.ts +3 -0
  24. package/dist/components/dashboard/DashboardChartEditor.vue.d.ts.map +1 -1
  25. package/dist/components/dashboard/DashboardHeader.vue.d.ts +2 -2
  26. package/dist/components/dashboard/DashboardMarkdownEditor.vue.d.ts +3 -0
  27. package/dist/components/dashboard/DashboardMarkdownEditor.vue.d.ts.map +1 -1
  28. package/dist/components/editor/Editor.vue.d.ts +75 -0
  29. package/dist/components/editor/Editor.vue.d.ts.map +1 -1
  30. package/dist/components/editor/ResultComponent.vue.d.ts +3885 -385
  31. package/dist/components/editor/ResultComponent.vue.d.ts.map +1 -1
  32. package/dist/components/editor/Results.vue.d.ts +33 -15
  33. package/dist/components/editor/Results.vue.d.ts.map +1 -1
  34. package/dist/components/layout/TabbedBrowser.vue.d.ts +15 -3
  35. package/dist/components/layout/TabbedBrowser.vue.d.ts.map +1 -1
  36. package/dist/components/llm/ChatArtifact.vue.d.ts +2 -2
  37. package/dist/components/llm/LLMChat.vue.d.ts +95 -23
  38. package/dist/components/llm/LLMChat.vue.d.ts.map +1 -1
  39. package/dist/components/llm/LLMChatSplitView.vue.d.ts +568 -110
  40. package/dist/components/llm/LLMChatSplitView.vue.d.ts.map +1 -1
  41. package/dist/components/llm/LLMEditorRefinement.vue.d.ts +2079 -0
  42. package/dist/components/llm/LLMEditorRefinement.vue.d.ts.map +1 -0
  43. package/dist/components/llm/LLMValidationView.vue.d.ts +20 -0
  44. package/dist/components/llm/LLMValidationView.vue.d.ts.map +1 -1
  45. package/dist/components/llm/index.d.ts +1 -1
  46. package/dist/components/llm/index.d.ts.map +1 -1
  47. package/dist/components/model/ModelCard.vue.d.ts +146 -0
  48. package/dist/components/model/ModelCard.vue.d.ts.map +1 -1
  49. package/dist/components/sidebar/ConnectionList.vue.d.ts +71 -0
  50. package/dist/components/sidebar/ConnectionList.vue.d.ts.map +1 -1
  51. package/dist/components/sidebar/EditorList.vue.d.ts +71 -0
  52. package/dist/components/sidebar/EditorList.vue.d.ts.map +1 -1
  53. package/dist/components/sidebar/LLMConnectionCreator.vue.d.ts.map +1 -1
  54. package/dist/components/sidebar/LLMConnectionList.vue.d.ts +4 -3
  55. package/dist/components/sidebar/LLMConnectionList.vue.d.ts.map +1 -1
  56. package/dist/components/sidebar/LLMConnectionListItem.vue.d.ts.map +1 -1
  57. package/dist/components/sidebar/LLMProviderIcon.vue.d.ts.map +1 -1
  58. package/dist/components/tutorial/TutorialPrompt.vue.d.ts +3965 -321
  59. package/dist/components/tutorial/TutorialPrompt.vue.d.ts.map +1 -1
  60. package/dist/composables/useChatWithTools.d.ts.map +1 -1
  61. package/dist/composables/useEditorRefinement.d.ts +60 -0
  62. package/dist/composables/useEditorRefinement.d.ts.map +1 -0
  63. package/dist/composables/useToolLoop.d.ts +41 -0
  64. package/dist/composables/useToolLoop.d.ts.map +1 -0
  65. package/dist/{cssMode-B_BSbR-W.js → cssMode-BqpD-bsS.js} +1 -1
  66. package/dist/dashboards/helpers.d.ts +1 -0
  67. package/dist/dashboards/helpers.d.ts.map +1 -1
  68. package/dist/data/githubStorage.d.ts.map +1 -1
  69. package/dist/data/localStorage.d.ts.map +1 -1
  70. package/dist/editors/editor.d.ts +33 -4
  71. package/dist/editors/editor.d.ts.map +1 -1
  72. package/dist/editors/results.d.ts.map +1 -1
  73. package/dist/{freemarker2-Bp8kNjJK.js → freemarker2-3f3Yc8DD.js} +1 -1
  74. package/dist/{handlebars-Bvjlp_mg.js → handlebars-BOGnwoZY.js} +1 -1
  75. package/dist/{html-B7c8qiJo.js → html-kwxiJtb9.js} +1 -1
  76. package/dist/{htmlMode-C6ZcBYOs.js → htmlMode-BSQWll85.js} +1 -1
  77. package/dist/{javascript-CHI4MyUe.js → javascript-Cw2M92n9.js} +1 -1
  78. package/dist/{jsonMode-CT9OdtWR.js → jsonMode-Cj3eACe9.js} +1 -1
  79. package/dist/{liquid-B6QT2GLn.js → liquid-D_YCsjzx.js} +1 -1
  80. package/dist/llm/anthropic.d.ts +28 -0
  81. package/dist/llm/anthropic.d.ts.map +1 -1
  82. package/dist/llm/base.d.ts +30 -1
  83. package/dist/llm/base.d.ts.map +1 -1
  84. package/dist/llm/chatAgentPrompt.d.ts +65 -78
  85. package/dist/llm/chatAgentPrompt.d.ts.map +1 -1
  86. package/dist/llm/chatHelpers.d.ts.map +1 -1
  87. package/dist/llm/consts.d.ts +1 -1
  88. package/dist/llm/data/conceptFilters.d.ts +15 -0
  89. package/dist/llm/data/conceptFilters.d.ts.map +1 -0
  90. package/dist/llm/data/constants.d.ts +1 -1
  91. package/dist/llm/data/constants.d.ts.map +1 -1
  92. package/dist/llm/data/prompts.d.ts.map +1 -1
  93. package/dist/llm/editorRefinementToolExecutor.d.ts +67 -0
  94. package/dist/llm/editorRefinementToolExecutor.d.ts.map +1 -0
  95. package/dist/llm/editorRefinementTools.d.ts +185 -0
  96. package/dist/llm/editorRefinementTools.d.ts.map +1 -0
  97. package/dist/llm/googlev2.d.ts +29 -1
  98. package/dist/llm/googlev2.d.ts.map +1 -1
  99. package/dist/llm/index.d.ts +5 -3
  100. package/dist/llm/index.d.ts.map +1 -1
  101. package/dist/llm/models.d.ts +1 -7
  102. package/dist/llm/models.d.ts.map +1 -1
  103. package/dist/llm/openai.d.ts +41 -0
  104. package/dist/llm/openai.d.ts.map +1 -0
  105. package/dist/llm/sharedToolSchemas.d.ts +93 -0
  106. package/dist/llm/sharedToolSchemas.d.ts.map +1 -0
  107. package/dist/llm/toolLoopCore.d.ts +67 -0
  108. package/dist/llm/toolLoopCore.d.ts.map +1 -0
  109. package/dist/llm/utils.d.ts +5 -1
  110. package/dist/llm/utils.d.ts.map +1 -1
  111. package/dist/{main-BzF_0455.js → main-CMnVPECM.js} +34920 -33616
  112. package/dist/main.css +1 -1
  113. package/dist/main.js +1 -1
  114. package/dist/main.umd.cjs +665 -595
  115. package/dist/{mdx-CDJtQyXd.js → mdx-D1QYgPt9.js} +1 -1
  116. package/dist/{python-BtP8pYzo.js → python-Bd7oj_ae.js} +1 -1
  117. package/dist/{razor-pQwJpgiM.js → razor-B-2sUawM.js} +1 -1
  118. package/dist/stores/Manager.vue.d.ts.map +1 -1
  119. package/dist/stores/chatStore.d.ts +3 -0
  120. package/dist/stores/chatStore.d.ts.map +1 -1
  121. package/dist/stores/editorStore.d.ts +119 -3
  122. package/dist/stores/editorStore.d.ts.map +1 -1
  123. package/dist/stores/llmStore.d.ts.map +1 -1
  124. package/dist/{tsMode-BaWVqjfv.js → tsMode-Ba44DEjT.js} +1 -1
  125. package/dist/{typescript-ChVL7Nc7.js → typescript-DV6B_8EM.js} +1 -1
  126. package/dist/{useDashboard-DW9y_StO.js → useDashboard-DyjtNooA.js} +136 -136
  127. package/dist/views/LLMView.vue.d.ts +2518 -412
  128. package/dist/views/LLMView.vue.d.ts.map +1 -1
  129. package/dist/views/ModelView.vue.d.ts +292 -0
  130. package/dist/views/ModelView.vue.d.ts.map +1 -1
  131. package/dist/views/TutorialPage.vue.d.ts +9605 -2028
  132. package/dist/views/TutorialPage.vue.d.ts.map +1 -1
  133. package/dist/{xml-CBuY2VW0.js → xml-7ZhThnGO.js} +1 -1
  134. package/dist/{yaml-GFIhDEhu.js → yaml-ngaWkYBh.js} +1 -1
  135. package/package.json +1 -1
  136. package/dist/Manager-C401-7UG.js +0 -4
  137. package/dist/ResultComponent-NZfe-7JE.js +0 -155
  138. package/dist/components/llm/LLMChatRefinement.vue.d.ts +0 -135
  139. package/dist/components/llm/LLMChatRefinement.vue.d.ts.map +0 -1
  140. package/dist/llm/mistral.d.ts +0 -12
  141. package/dist/llm/mistral.d.ts.map +0 -1
  142. package/dist/llm/openAI.d.ts +0 -13
  143. package/dist/llm/openAI.d.ts.map +0 -1
@@ -1,6 +1,19 @@
1
1
  import { ModelConceptInput } from './data/models';
2
2
  import { ChatImport } from '../chats/chat';
3
3
  export declare const CHAT_TOOLS: ({
4
+ readonly name: "connect_data_connection";
5
+ readonly description: "Connect or reconnect a data connection that is not currently active. Use this when a query fails because the connection is not active, or when you need to establish a connection before running queries.";
6
+ readonly input_schema: {
7
+ readonly type: "object";
8
+ readonly properties: {
9
+ readonly connection: {
10
+ readonly type: "string";
11
+ readonly description: "The name of the data connection to connect";
12
+ };
13
+ };
14
+ readonly required: readonly ["connection"];
15
+ };
16
+ } | {
4
17
  name: string;
5
18
  description: string;
6
19
  input_schema: {
@@ -34,75 +47,75 @@ export declare const CHAT_TOOLS: ({
34
47
  description: string;
35
48
  };
36
49
  chartConfig: {
37
- type: string;
38
50
  description: string;
51
+ type: "object";
39
52
  properties: {
40
- chartType: {
41
- type: string;
42
- enum: string[];
43
- description: string;
53
+ readonly chartType: {
54
+ readonly type: "string";
55
+ readonly enum: readonly ["line", "bar", "barh", "point", "geo-map", "tree", "area", "headline", "donut", "heatmap", "boxplot", "treemap", "beeswarm"];
56
+ readonly description: "Type of chart to render";
44
57
  };
45
- xField: {
46
- type: string;
47
- description: string;
58
+ readonly xField: {
59
+ readonly type: "string";
60
+ readonly description: "Field name for x-axis. Longitude for geo-map charts if geofield not provided.";
48
61
  };
49
- yField: {
50
- type: string;
51
- description: string;
62
+ readonly yField: {
63
+ readonly type: "string";
64
+ readonly description: "Field name for y-axis. Latitude for geo-map charts if geofield not provided.";
52
65
  };
53
- yField2: {
54
- type: string;
55
- description: string;
66
+ readonly yField2: {
67
+ readonly type: "string";
68
+ readonly description: "Secondary y-axis field (optional)";
56
69
  };
57
- colorField: {
58
- type: string;
59
- description: string;
70
+ readonly colorField: {
71
+ readonly type: "string";
72
+ readonly description: "Field for color encoding (optional)";
60
73
  };
61
- sizeField: {
62
- type: string;
63
- description: string;
74
+ readonly sizeField: {
75
+ readonly type: "string";
76
+ readonly description: "Field for size encoding (optional)";
64
77
  };
65
- groupField: {
66
- type: string;
67
- description: string;
78
+ readonly groupField: {
79
+ readonly type: "string";
80
+ readonly description: "Field for grouping data (optional)";
68
81
  };
69
- trellisField: {
70
- type: string;
71
- description: string;
82
+ readonly trellisField: {
83
+ readonly type: "string";
84
+ readonly description: "Field for small multiples/faceting columns (optional)";
72
85
  };
73
- trellisRowField: {
74
- type: string;
75
- description: string;
86
+ readonly trellisRowField: {
87
+ readonly type: "string";
88
+ readonly description: "Field for small multiples/faceting rows (optional)";
76
89
  };
77
- geoField: {
78
- type: string;
79
- description: string;
90
+ readonly geoField: {
91
+ readonly type: "string";
92
+ readonly description: "Field for geographic data (optional)";
80
93
  };
81
- annotationField: {
82
- type: string;
83
- description: string;
94
+ readonly annotationField: {
95
+ readonly type: "string";
96
+ readonly description: "Field for data point annotations/labels (optional)";
84
97
  };
85
- hideLegend: {
86
- type: string;
87
- description: string;
98
+ readonly hideLegend: {
99
+ readonly type: "boolean";
100
+ readonly description: "Whether to hide the legend (optional)";
88
101
  };
89
- showTitle: {
90
- type: string;
91
- description: string;
102
+ readonly showTitle: {
103
+ readonly type: "boolean";
104
+ readonly description: "Whether to show the chart title (optional)";
92
105
  };
93
- scaleX: {
94
- type: string;
95
- enum: string[];
96
- description: string;
106
+ readonly scaleX: {
107
+ readonly type: "string";
108
+ readonly enum: readonly ["linear", "log", "sqrt"];
109
+ readonly description: "Scale type for x-axis (optional)";
97
110
  };
98
- scaleY: {
99
- type: string;
100
- enum: string[];
101
- description: string;
111
+ readonly scaleY: {
112
+ readonly type: "string";
113
+ readonly enum: readonly ["linear", "log", "sqrt"];
114
+ readonly description: "Scale type for y-axis (optional)";
102
115
  };
103
- linkY2: {
104
- type: string;
105
- description: string;
116
+ readonly linkY2: {
117
+ readonly type: "boolean";
118
+ readonly description: "Whether to link the secondary y-axis scale to the primary y-axis (optional)";
106
119
  };
107
120
  };
108
121
  };
@@ -139,22 +152,6 @@ export declare const CHAT_TOOLS: ({
139
152
  };
140
153
  required: never[];
141
154
  };
142
- } | {
143
- name: string;
144
- description: string;
145
- input_schema: {
146
- type: string;
147
- properties: {
148
- connection: {
149
- type: string;
150
- description: string;
151
- };
152
- query?: undefined;
153
- chartConfig?: undefined;
154
- import_name?: undefined;
155
- };
156
- required: string[];
157
- };
158
155
  })[];
159
156
  export interface ChatAgentPromptOptions {
160
157
  dataConnectionName: string | null;
@@ -165,14 +162,4 @@ export interface ChatAgentPromptOptions {
165
162
  isDataConnectionActive?: boolean;
166
163
  }
167
164
  export declare function buildChatAgentSystemPrompt(options: ChatAgentPromptOptions): string;
168
- export interface ParsedToolCall {
169
- name: string;
170
- input: Record<string, any>;
171
- }
172
- export declare function parseToolCalls(response: string): ParsedToolCall[];
173
- export declare function formatToolResult(toolName: string, success: boolean, result?: {
174
- rowCount?: number;
175
- columnCount?: number;
176
- error?: string;
177
- }): string;
178
165
  //# sourceMappingURL=chatAgentPrompt.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chatAgentPrompt.d.ts","sourceRoot":"","sources":["../../llm/chatAgentPrompt.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAEtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAuB/C,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA2KtB,CAAA;AAED,MAAM,WAAW,sBAAsB;IACrC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,oBAAoB,EAAE,MAAM,EAAE,CAAA;IAC9B,iBAAiB,CAAC,EAAE,iBAAiB,EAAE,CAAA;IACvC,aAAa,CAAC,EAAE,UAAU,EAAE,CAAA;IAC5B,6BAA6B,CAAC,EAAE,UAAU,EAAE,CAAA;IAC5C,sBAAsB,CAAC,EAAE,OAAO,CAAA;CACjC;AAED,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,sBAAsB,GAAG,MAAM,CA+DlF;AAGD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAC3B;AAID,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,EAAE,CA8CjE;AAGD,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GACnE,MAAM,CAMR"}
1
+ {"version":3,"file":"chatAgentPrompt.d.ts","sourceRoot":"","sources":["../../llm/chatAgentPrompt.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAQ/C,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAsEtB,CAAA;AAED,MAAM,WAAW,sBAAsB;IACrC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,oBAAoB,EAAE,MAAM,EAAE,CAAA;IAC9B,iBAAiB,CAAC,EAAE,iBAAiB,EAAE,CAAA;IACvC,aAAa,CAAC,EAAE,UAAU,EAAE,CAAA;IAC5B,6BAA6B,CAAC,EAAE,UAAU,EAAE,CAAA;IAC5C,sBAAsB,CAAC,EAAE,OAAO,CAAA;CACjC;AAED,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,sBAAsB,GAAG,MAAM,CA+DlF"}
@@ -1 +1 @@
1
- {"version":3,"file":"chatHelpers.d.ts","sourceRoot":"","sources":["../../llm/chatHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AAExC;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,UAAU,EAAE,GAAG,MAAM,CAwBnE;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,oBAAoB,EAAE,MAAM,GAAG,MAAM,CA0B7E;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAInE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAwBxD"}
1
+ {"version":3,"file":"chatHelpers.d.ts","sourceRoot":"","sources":["../../llm/chatHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AAExC;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,UAAU,EAAE,GAAG,MAAM,CAwBnE;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,oBAAoB,EAAE,MAAM,GAAG,MAAM,CA6B7E;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAInE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAwBxD"}
@@ -1,3 +1,3 @@
1
- export declare const DEFAULT_TEMPERATURE = 0.7;
1
+ export declare const DEFAULT_TEMPERATURE = 0.5;
2
2
  export declare const DEFAULT_MAX_TOKENS = 10000;
3
3
  //# sourceMappingURL=consts.d.ts.map
@@ -0,0 +1,15 @@
1
+ export declare const DATE_PART_SUFFIXES: string[];
2
+ /**
3
+ * Checks if a concept/symbol name is an auto-derived date part concept.
4
+ * These are automatically generated from date fields (e.g., order_date.year, order_date.month).
5
+ */
6
+ export declare function isAutoDerivedDateConcept(name: string): boolean;
7
+ /**
8
+ * Filters out auto-derived date part concepts from an array.
9
+ * Works with any object that has a 'name' or 'label' property.
10
+ */
11
+ export declare function filterAutoDerivedConcepts<T extends {
12
+ name?: string;
13
+ label?: string;
14
+ }>(items: T[]): T[];
15
+ //# sourceMappingURL=conceptFilters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conceptFilters.d.ts","sourceRoot":"","sources":["../../../llm/data/conceptFilters.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB,UAY9B,CAAA;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE9D;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,SAAS;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,EACnF,KAAK,EAAE,CAAC,EAAE,GACT,CAAC,EAAE,CAKL"}
@@ -1,4 +1,4 @@
1
- export declare const rulesInput = "\nTrilogy statements define a semantic model or query. If a user is asking for data, they want a SELECT.\nSemantic model statements:\n- import <> imports a model to reuse. The output of imports will be visible in fields available to use.\n- key|property|auto|metric defines fields locally. The output will also be visible in fields available to use, so you generally don't need to edit these unless requested.\n- datasource statements define a datasource, which is a mapping of fields to a SQL database table. The left side is the SQL column name, the right side is the field name.\n\nSELECT RULES:\n- No FROM, JOIN, GROUP BY, SUB SELECTS, DISTINCT, UNION, or SELECT *.\n- All fields exist in a global namespace; field paths look like `order.product.id`. Always use the full path. NEVER include a from clause.\n- If a field has a grain defined, and that grain is not in the query output, aggregate it to get desired result. \n- If a field has a 'alias_for' defined, it is shorthand for that calculation. Use the field name instead of the calculation in your query to be concise. \n- Newly created fields at the output of the select must be aliased with as (e.g. `sum(births) as all_births`). \n- Aliases cannot happen inside calculations or in the where/having/order clause. Never alias fields with existing names. 'sum(revenue) as total_revenue' is valid, but '(sum(births) as total_revenue) +1 as revenue_plus_one' is not.\n- Implicit grouping: NEVER include a group by clause. Grouping is by non-aggregated fields in the SELECT clause.\n- You can dynamically group inline to get groups at different grains - ex: `sum(metric) by dim1, dim2 as sum_by_dim1_dm2` for grouping different from inferred by dimension fields. Aggregate by `*` to get the total regardless of select dimensions.\n- Count must specify a field (no `count(*)`) Counts are automatically deduplicated. Do not ever use DISTINCT.\n- Use a sum/count/avg/max/min over a field to get aggregates at different grains (e.g. `sum(births) over state as state_births`).\n- Since there are no underlying tables, sum/count of a constant should always specify a grain field (e.g. `sum(1) by x as count`). \n- Aggregates in SELECT must be filtered via HAVING. Use WHERE for pre-aggregation filters.\n- Use `field ? condition` for inline filters (e.g. `sum(x ? x > 0)`).\n- Always use a reasonable `LIMIT` for final queries unless the request is for a time series or line chart.\n- Window functions: `rank entity [optional over group] by field desc` (e.g. `rank name over state by sum(births) desc as top_name`) Do not use parentheses for over.\n- Functions. All function names have parenthese (e.g. `sum(births)`, `date_part('year', dep_time)`). For no arguments, use empty parentheses (e.g. `current_date()`).\n- For lag/lead, offset is first: lag/lead offset field order by expr asc/desc.\n- For lag/lead with a window clause: lag/lead offset field by window_clause order by expr asc/desc.\n- Use `::type` casting, e.g., `\"2020-01-01\"::date`.\n- Date_parts have no quotes; use `date_part(order_date, year)` instead of `date_part(order_date, 'year')`. date parts are: year, quarter, month, week, day, day_of_week, hour, minute, second.\n- date_parts can be accessed directly through dot notation, e.g., `order_date.year`.\n- Comments use `#` only, per line.\n- Use `--` before a field in a select to hide it from output. This is useful for having a field available for filtering without returning it when making charts, for example. Hidden fields are still available for use in WHERE, HAVING, ORDER BY, and calculations.\n- Two example queries: \"where year between 1940 and 1950\n select\n name,\n state,\n sum(births) by * as all_births_no_dims,\n sum(births) AS births_by_name_state,\n sum(births ? state = 'VT') AS vermont_births,\n rank name over state by all_births desc AS state_rank,\n rank name by sum(births) by name desc AS all_rank,\n -- sum(births ? state = 'MA') as hidden_mass_births\n having \n all_rank<11\n and state = 'ID'\n order by \n all_rank asc\n limit 5;\", \"where dep_time between '2002-01-01'::datetime and '2010-01-31'::datetime\n select\n carrier.name,\n count(id2) AS total_flights,\n total_flights / date_diff(min(dep_time.date), max(dep_time.date), DAY) AS average_daily_flights\n order by \n total_flights desc;\n \"";
1
+ export declare const rulesInput = "\nTrilogy statements define a semantic model or query. If a user is asking for data, they want a SELECT.\nSemantic model statements:\n- import <> imports a model to reuse. The output of imports will be visible in fields available to use.\n- key|property|auto|metric defines fields locally. The output will also be visible in fields available to use, so you generally don't need to edit these unless requested.\n- datasource statements define a datasource, which is a mapping of fields to a SQL database table. The left side is the SQL column name, the right side is the field name.\n\nSELECT RULES:\n- No FROM, JOIN, GROUP BY, SUB SELECTS, DISTINCT, UNION, or SELECT *.\n- All fields exist in a global namespace; field paths look like `order.product.id`. Always use the full path. NEVER include a from clause.\n- If a field has a grain defined, and that grain is not in the query output, aggregate it to get desired result. \n- If a field has a 'alias_for' defined, it is shorthand for that calculation. Use the field name instead of the calculation in your query to be concise. \n- Newly created fields at the output of the select must be aliased with as (e.g. `sum(births) as all_births`). \n- Aliases cannot happen inside calculations or in the where/having/order clause. Never alias fields with existing names. 'sum(revenue) as total_revenue' is valid, but '(sum(births) as total_revenue) +1 as revenue_plus_one' is not.\n- Implicit grouping: NEVER include a group by clause. Grouping is by non-aggregated fields in the SELECT clause.\n- You can dynamically group inline to get groups at different grains - ex: `sum(metric) by dim1, dim2 as sum_by_dim1_dm2` for grouping different from inferred by dimension fields. Aggregate by `*` to get the total regardless of select dimensions. Note: `by` changes the aggregation grain, while `over` creates a window function that doesn't collapse rows.\n- Count must specify a field (no `count(*)`). Counts are automatically deduplicated. Do not ever use DISTINCT. Use `count_distinct(field)` if you explicitly need distinct counting. COUNT/SUM(1) will always be 1 unless you group 1 by a field and then count/sum it.\n- Since there are no underlying tables, sum/count of a constant should always specify a key field. Never sum 1 to get a count, always count a key field explicitly: (e.g. `count(some_key)`, not `sum(1)`). Summing 1 by an explicit grouping will work, but should not be preferred.\n- Aggregates in SELECT must be filtered via HAVING. Use WHERE for pre-aggregation filters.\n- Use `field ? condition` for inline filters (e.g. `sum(x ? x > 0)`).\n- Always use a reasonable `LIMIT` for final queries unless the request is for a time series or line chart.\n- Window functions (row_number, rank, lag, lead): Prefer SQL-like syntax (both legacy and SQL-style input are accepted, but SQL-style is canonical):\n - `row_number(field) over (partition by group order by sort_field desc)` \n - `rank(field) over (partition by group order by sort_field desc)`\n - For lag/lead, offset goes inside parentheses: `lag(field, 2) over (order by sort_field asc)`\n - partition by and order by are both optional: `row_number(field) over (order by x)` or even `row_number(field) over ()`\n - Example: `rank(name) over (partition by state order by sum(births) desc) as state_rank`\n- Window aggregates (sum, avg, max, min, count as windows): Use legacy input syntax (renders as SQL-style):\n - Input: `sum field over partition_field order by sort_field asc`\n - Renders as: `sum(field) over (partition by partition_field order by sort_field asc)`\n - Note: `sum(field)` without over/by is a regular aggregate, not a window\n- Functions. All function names have parentheses (e.g. `sum(births)`, `date_part(dep_time, year)`). For no arguments, use empty parentheses (e.g. `current_date()`).\n- Use `::type` casting, e.g., `\"2020-01-01\"::date`.\n- Import the std.lib to access special rendering types; import std.display; at the top of a query will let you cast a field to ::percent which will render it properly.\n- Date_parts have no quotes; use `date_part(order_date, year)` instead of `date_part(order_date, 'year')`. date parts are: year, quarter, month, week, day, day_of_week, year_start, month_start, hour, minute, second.\n- date_parts can be accessed directly through dot notation, e.g., `order_date.year`.\n- Comments use `#` only, per line.\n- Use `--` before a field in a select to hide it from output. This is useful for having a field available for filtering without returning it when making charts, for example. Hidden fields are still available for use in WHERE, HAVING, ORDER BY, and calculations.\n- Two example queries: \"where year between 1940 and 1950\n select\n name,\n state,\n sum(births) by * as all_births_no_dims,\n sum(births) AS births_by_name_state,\n sum(births ? state = 'VT') AS vermont_births,\n sum(births) over (partition by name) as window_births_name,\n sum(births) over (partition by name order by state asc) as window_births_name_asc_order,\n rank(name) over (partition by state order by all_births desc) AS state_rank,\n rank(name) over (order by sum(births) by name desc) AS all_rank,\n lag(births, 1) over (partition by state order by year asc) as prev_year_births,\n -- sum(births ? state = 'MA') as hidden_mass_births\n having \n all_rank<11\n and state = 'ID'\n order by \n all_rank asc\n limit 5;\", \"where dep_time between '2002-01-01'::datetime and '2010-01-31'::datetime\n select\n carrier.name,\n count(id2) AS total_flights,\n total_flights / date_diff(min(dep_time.date), max(dep_time.date), DAY) AS average_daily_flights\n order by \n total_flights desc;\n \"";
2
2
  export declare const aggFunctions: string[];
3
3
  export declare const functions: string[];
4
4
  export declare const datatypes: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../llm/data/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,0yIAqDnB,CAAA;AAEJ,eAAO,MAAM,YAAY,UASxB,CAAA;AACD,eAAO,MAAM,SAAS,UAqFrB,CAAA;AAED,eAAO,MAAM,SAAS,UAoBrB,CAAA"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../llm/data/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,goLA+DnB,CAAA;AAEJ,eAAO,MAAM,YAAY,UASxB,CAAA;AACD,eAAO,MAAM,SAAS,UAuFrB,CAAA;AAED,eAAO,MAAM,SAAS,UAoBrB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../llm/data/prompts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAejD,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,iBAAiB,EAAE,GAAG,iBAAiB,EAAE,CAIzF;AAED,eAAO,MAAM,MAAM,QAelB,CAAA;AAGD,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,iBAAiB,EAAE,UAOvE;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,iBAAiB,EAAE,UAG7E;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,iBAAiB,EAAE,UAGnF;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,iBAAiB,EAAE,UAGtF"}
1
+ {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../llm/data/prompts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAIjD,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,iBAAiB,EAAE,GAAG,iBAAiB,EAAE,CAEzF;AAED,eAAO,MAAM,MAAM,QAelB,CAAA;AAED,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,iBAAiB,EAAE,UAOvE;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,iBAAiB,EAAE,UAG7E;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,iBAAiB,EAAE,UAGnF;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,iBAAiB,EAAE,UAGtF"}
@@ -0,0 +1,67 @@
1
+ import { default as QueryExecutionService } from '../stores/queryExecutionService';
2
+ import { ConnectionStoreType } from '../stores/connectionStore';
3
+ import { EditorStoreType } from '../stores/editorStore';
4
+ import { ChatArtifact } from '../chats/chat';
5
+ import { ChartConfig } from '../editors/results';
6
+ import { CompletionItem } from '../stores/resolver';
7
+ export interface ToolCallResult {
8
+ success: boolean;
9
+ artifact?: ChatArtifact;
10
+ error?: string;
11
+ message?: string;
12
+ executionTime?: number;
13
+ query?: string;
14
+ generatedSql?: string;
15
+ formattedQuery?: string;
16
+ terminatesLoop?: boolean;
17
+ awaitsUserInput?: boolean;
18
+ availableSymbols?: CompletionItem[];
19
+ }
20
+ export interface QueryExecutionResult {
21
+ success: boolean;
22
+ results?: {
23
+ headers: string[];
24
+ data: any[][];
25
+ };
26
+ error?: string;
27
+ executionTime?: number;
28
+ resultSize?: number;
29
+ columnCount?: number;
30
+ generatedSql?: string;
31
+ }
32
+ export interface EditorContext {
33
+ connectionName: string;
34
+ editorContents: string;
35
+ editorId?: string;
36
+ selectedText?: string;
37
+ selectionRange?: {
38
+ start: number;
39
+ end: number;
40
+ };
41
+ chartConfig?: ChartConfig;
42
+ onEditorContentChange: (content: string, replaceSelection?: boolean) => void;
43
+ onChartConfigChange: (config: ChartConfig) => void;
44
+ onFinish: (message?: string) => void;
45
+ onRunActiveEditorQuery?: () => Promise<QueryExecutionResult>;
46
+ }
47
+ export declare class EditorRefinementToolExecutor {
48
+ private queryExecutionService;
49
+ private connectionStore;
50
+ private editorStore;
51
+ private editorContext;
52
+ constructor(queryExecutionService: QueryExecutionService, connectionStore: ConnectionStoreType, editorContext: EditorContext, editorStore?: EditorStoreType);
53
+ executeToolCall(toolName: string, toolInput: Record<string, any>): Promise<ToolCallResult>;
54
+ private validateQuery;
55
+ private buildSymbolsSummary;
56
+ private runQuery;
57
+ private formatQuery;
58
+ private editChartConfig;
59
+ private editEditor;
60
+ private runActiveEditorQuery;
61
+ private requestClose;
62
+ private closeSession;
63
+ private connectDataConnection;
64
+ private buildQueryInput;
65
+ private buildExtraContent;
66
+ }
67
+ //# sourceMappingURL=editorRefinementToolExecutor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editorRefinementToolExecutor.d.ts","sourceRoot":"","sources":["../../llm/editorRefinementToolExecutor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,qBAAqB,MAAM,iCAAiC,CAAA;AAExE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,KAAK,EAAgB,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAGtE,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAA;IAChB,QAA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A;IACpC,sBAAsB,CAAC,EAAE,MAAM,OAAO,CAAC,oBAAoB,CAAC,CAAA;CAC7D;AAED,qBAAa,4BAA4B;IACvC,OAAO,CAAC,qBAAqB,CAAuB;IACpD,OAAO,CAAC,eAAe,CAAqB;IAC5C,OAAO,CAAC,WAAW,CAAwB;IAC3C,OAAO,CAAC,aAAa,CAAe;gBAGlC,qBAAqB,EAAE,qBAAqB,EAC5C,eAAe,EAAE,mBAAmB,EACpC,aAAa,EAAE,aAAa,EAC5B,WAAW,CAAC,EAAE,eAAe;IAQzB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC;YA+BlF,aAAa;IAgE3B,OAAO,CAAC,mBAAmB;YAKb,QAAQ;YA6FR,WAAW;IA0CzB,OAAO,CAAC,eAAe;YAsBT,UAAU;YAwCV,oBAAoB;IAsElC,OAAO,CAAC,YAAY;IAUpB,OAAO,CAAC,YAAY;YAgBN,qBAAqB;IAwCnC,OAAO,CAAC,eAAe;IAUvB,OAAO,CAAC,iBAAiB;CAsB1B"}
@@ -0,0 +1,185 @@
1
+ import { ModelConceptInput } from './data/models';
2
+ import { ChartConfig } from '../editors/results';
3
+ import { CompletionItem } from '../stores/resolver';
4
+ /**
5
+ * Convert CompletionItem[] to ModelConceptInput[] for use with conceptsToFieldPrompt.
6
+ * Filters to concepts only (trilogyType === 'concept').
7
+ */
8
+ export declare function completionItemsToConcepts(symbols: CompletionItem[]): ModelConceptInput[];
9
+ /**
10
+ * Format completion items to field prompt, reusing conceptsToFieldPrompt.
11
+ */
12
+ export declare function symbolsToFieldPrompt(symbols: CompletionItem[]): string;
13
+ export declare const EDITOR_REFINEMENT_TOOLS: ({
14
+ readonly name: "connect_data_connection";
15
+ readonly description: "Connect or reconnect a data connection that is not currently active. Use this when a query fails because the connection is not active, or when you need to establish a connection before running queries.";
16
+ readonly input_schema: {
17
+ readonly type: "object";
18
+ readonly properties: {
19
+ readonly connection: {
20
+ readonly type: "string";
21
+ readonly description: "The name of the data connection to connect";
22
+ };
23
+ };
24
+ readonly required: readonly ["connection"];
25
+ };
26
+ } | {
27
+ name: string;
28
+ description: string;
29
+ input_schema: {
30
+ type: string;
31
+ properties: {
32
+ query: {
33
+ type: string;
34
+ description: string;
35
+ };
36
+ chartConfig?: undefined;
37
+ content?: undefined;
38
+ message?: undefined;
39
+ };
40
+ required: string[];
41
+ };
42
+ } | {
43
+ name: string;
44
+ description: string;
45
+ input_schema: {
46
+ type: string;
47
+ properties: {
48
+ chartConfig: {
49
+ readonly type: "object";
50
+ readonly description: "Chart configuration object";
51
+ readonly properties: {
52
+ readonly chartType: {
53
+ readonly type: "string";
54
+ readonly enum: readonly ["line", "bar", "barh", "point", "geo-map", "tree", "area", "headline", "donut", "heatmap", "boxplot", "treemap", "beeswarm"];
55
+ readonly description: "Type of chart to render";
56
+ };
57
+ readonly xField: {
58
+ readonly type: "string";
59
+ readonly description: "Field name for x-axis. Longitude for geo-map charts if geofield not provided.";
60
+ };
61
+ readonly yField: {
62
+ readonly type: "string";
63
+ readonly description: "Field name for y-axis. Latitude for geo-map charts if geofield not provided.";
64
+ };
65
+ readonly yField2: {
66
+ readonly type: "string";
67
+ readonly description: "Secondary y-axis field (optional)";
68
+ };
69
+ readonly colorField: {
70
+ readonly type: "string";
71
+ readonly description: "Field for color encoding (optional)";
72
+ };
73
+ readonly sizeField: {
74
+ readonly type: "string";
75
+ readonly description: "Field for size encoding (optional)";
76
+ };
77
+ readonly groupField: {
78
+ readonly type: "string";
79
+ readonly description: "Field for grouping data (optional)";
80
+ };
81
+ readonly trellisField: {
82
+ readonly type: "string";
83
+ readonly description: "Field for small multiples/faceting columns (optional)";
84
+ };
85
+ readonly trellisRowField: {
86
+ readonly type: "string";
87
+ readonly description: "Field for small multiples/faceting rows (optional)";
88
+ };
89
+ readonly geoField: {
90
+ readonly type: "string";
91
+ readonly description: "Field for geographic data (optional)";
92
+ };
93
+ readonly annotationField: {
94
+ readonly type: "string";
95
+ readonly description: "Field for data point annotations/labels (optional)";
96
+ };
97
+ readonly hideLegend: {
98
+ readonly type: "boolean";
99
+ readonly description: "Whether to hide the legend (optional)";
100
+ };
101
+ readonly showTitle: {
102
+ readonly type: "boolean";
103
+ readonly description: "Whether to show the chart title (optional)";
104
+ };
105
+ readonly scaleX: {
106
+ readonly type: "string";
107
+ readonly enum: readonly ["linear", "log", "sqrt"];
108
+ readonly description: "Scale type for x-axis (optional)";
109
+ };
110
+ readonly scaleY: {
111
+ readonly type: "string";
112
+ readonly enum: readonly ["linear", "log", "sqrt"];
113
+ readonly description: "Scale type for y-axis (optional)";
114
+ };
115
+ readonly linkY2: {
116
+ readonly type: "boolean";
117
+ readonly description: "Whether to link the secondary y-axis scale to the primary y-axis (optional)";
118
+ };
119
+ };
120
+ };
121
+ query?: undefined;
122
+ content?: undefined;
123
+ message?: undefined;
124
+ };
125
+ required: string[];
126
+ };
127
+ } | {
128
+ name: string;
129
+ description: string;
130
+ input_schema: {
131
+ type: string;
132
+ properties: {
133
+ content: {
134
+ type: string;
135
+ description: string;
136
+ };
137
+ query?: undefined;
138
+ chartConfig?: undefined;
139
+ message?: undefined;
140
+ };
141
+ required: string[];
142
+ };
143
+ } | {
144
+ name: string;
145
+ description: string;
146
+ input_schema: {
147
+ type: string;
148
+ properties: {
149
+ query?: undefined;
150
+ chartConfig?: undefined;
151
+ content?: undefined;
152
+ message?: undefined;
153
+ };
154
+ required: never[];
155
+ };
156
+ } | {
157
+ name: string;
158
+ description: string;
159
+ input_schema: {
160
+ type: string;
161
+ properties: {
162
+ message: {
163
+ type: string;
164
+ description: string;
165
+ };
166
+ query?: undefined;
167
+ chartConfig?: undefined;
168
+ content?: undefined;
169
+ };
170
+ required: string[];
171
+ };
172
+ })[];
173
+ export interface EditorRefinementContext {
174
+ connectionName: string;
175
+ editorContents: string;
176
+ selectedText?: string;
177
+ selectionRange?: {
178
+ start: number;
179
+ end: number;
180
+ };
181
+ chartConfig?: ChartConfig;
182
+ completionSymbols?: CompletionItem[];
183
+ }
184
+ export declare function buildEditorRefinementPrompt(context: EditorRefinementContext): string;
185
+ //# sourceMappingURL=editorRefinementTools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editorRefinementTools.d.ts","sourceRoot":"","sources":["../../llm/editorRefinementTools.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAOxD;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,cAAc,EAAE,GAAG,iBAAiB,EAAE,CAUxF;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,cAAc,EAAE,GAAG,MAAM,CAEtE;AAGD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA8GnC,CAAA;AAED,MAAM,WAAW,uBAAuB;IACtC,cAAc,EAAE,MAAM,CAAA;IACtB,cAAc,EAAE,MAAM,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,cAAc,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAA;IAC/C,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,iBAAiB,CAAC,EAAE,cAAc,EAAE,CAAA;CACrC;AAED,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,uBAAuB,GAAG,MAAM,CA+EpF"}
@@ -1,4 +1,19 @@
1
1
  import { LLMProvider, LLMRequestOptions, LLMResponse, LLMMessage } from './base';
2
+ /**
3
+ * Parse Google model name into components.
4
+ * Examples: models/gemini-2.5-flash -> { major: 2, minor: 5, variant: 'flash' }
5
+ * gemini-2.0-pro -> { major: 2, minor: 0, variant: 'pro' }
6
+ * models/gemini-1.5-pro-latest -> { major: 1, minor: 5, variant: 'pro-latest' }
7
+ */
8
+ export declare function parseGoogleModelVersion(model: string): {
9
+ major: number;
10
+ minor: number;
11
+ variant: string | null;
12
+ } | null;
13
+ /**
14
+ * Compare two Google models for sorting (descending - higher version first, pro preferred over flash).
15
+ */
16
+ export declare function compareGoogleModels(a: string, b: string): number;
2
17
  export declare class GoogleProvider extends LLMProvider {
3
18
  private genAIClient;
4
19
  private baseModelUrl;
@@ -9,7 +24,20 @@ export declare class GoogleProvider extends LLMProvider {
9
24
  private withRetry;
10
25
  generateCompletion(options: LLMRequestOptions, history?: LLMMessage[] | null): Promise<LLMResponse>;
11
26
  private convertToGeminiTools;
12
- private extractResponseText;
27
+ private extractResponseData;
13
28
  private convertToGeminiHistory;
29
+ /**
30
+ * Filter Google models to only include recognized Gemini models.
31
+ * @param models - Array of model IDs from the API
32
+ * @returns Filtered and sorted array of model IDs (highest version first)
33
+ */
34
+ static filterModels(models: string[]): string[];
35
+ /**
36
+ * Get the default model to use for Google.
37
+ * Returns the latest Gemini model (preferring pro over flash).
38
+ * @param models - Array of model IDs (already filtered)
39
+ * @returns The default model ID to use
40
+ */
41
+ static getDefaultModel(models: string[]): string;
14
42
  }
15
43
  //# sourceMappingURL=googlev2.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"googlev2.d.ts","sourceRoot":"","sources":["../../llm/googlev2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,UAAU,EAAqB,MAAM,QAAQ,CAAA;AAgB3F,qBAAa,cAAe,SAAQ,WAAW;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,MAAM,EAAE,cAAc,GAAE,OAAe;IAKlF,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;YA4Dd,SAAS;IA2DjB,kBAAkB,CACtB,OAAO,EAAE,iBAAiB,EAC1B,OAAO,GAAE,UAAU,EAAE,GAAG,IAAW,GAClC,OAAO,CAAC,WAAW,CAAC;IAuFvB,OAAO,CAAC,oBAAoB;IAa5B,OAAO,CAAC,mBAAmB;IAgC3B,OAAO,CAAC,sBAAsB;IAyD9B;;;;OAIG;IACH,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE;IAM/C;;;;;OAKG;IACH,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM;CAKjD"}
@@ -1,11 +1,13 @@
1
1
  export { LLMProvider } from './base';
2
2
  export type { LLMRequestOptions, LLMResponse, LLMMessage } from './base';
3
- export { OpenAIProvider } from './openAI';
3
+ export { OpenAIProvider } from './openai';
4
4
  export { AnthropicProvider } from './anthropic';
5
- export { MistralProvider } from './mistral';
6
5
  export { GoogleProvider } from './googlev2';
7
6
  export { createPrompt, createFilterPrompt, createDashboardPrompt } from './data/prompts';
8
7
  export { createChatNamePrompt, extractChatName } from './chatHelpers';
9
8
  export type { ModelConceptInput } from './data/models';
10
- export type { ChatInteraction } from './models';
9
+ export { EDITOR_REFINEMENT_TOOLS, buildEditorRefinementPrompt } from './editorRefinementTools';
10
+ export type { EditorRefinementContext } from './editorRefinementTools';
11
+ export { EditorRefinementToolExecutor } from './editorRefinementToolExecutor';
12
+ export type { EditorContext, ToolCallResult } from './editorRefinementToolExecutor';
11
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../llm/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpC,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,UAAU,EAAE,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A"}
@@ -1,8 +1,2 @@
1
- import { LLMMessage } from './base';
2
- export interface ChatInteraction {
3
- messages: LLMMessage[];
4
- extractionFn: (message: string) => string;
5
- validationFn: (input: string) => Promise<boolean>;
6
- mutationFn: (input: string) => boolean;
7
- }
1
+ export {};
8
2
  //# sourceMappingURL=models.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../llm/models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,QAAQ,CAAA;AAExC,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,UAAU,EAAE,CAAA;IACtB,YAAY,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAA;IACzC,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;IACjD,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAA;CACvC"}
1
+ {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../llm/models.ts"],"names":[],"mappings":""}