mito-ai 0.1.36__py3-none-any.whl → 0.1.37__py3-none-any.whl

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.

Potentially problematic release.


This version of mito-ai might be problematic. Click here for more details.

Files changed (54) hide show
  1. mito_ai/__init__.py +6 -4
  2. mito_ai/_version.py +1 -1
  3. mito_ai/anthropic_client.py +3 -10
  4. mito_ai/app_builder/handlers.py +89 -11
  5. mito_ai/app_builder/models.py +3 -0
  6. mito_ai/auth/README.md +18 -0
  7. mito_ai/auth/__init__.py +6 -0
  8. mito_ai/auth/handlers.py +96 -0
  9. mito_ai/auth/urls.py +13 -0
  10. mito_ai/completions/completion_handlers/chat_completion_handler.py +2 -2
  11. mito_ai/completions/models.py +7 -6
  12. mito_ai/completions/prompt_builders/agent_execution_prompt.py +8 -3
  13. mito_ai/completions/prompt_builders/agent_system_message.py +21 -7
  14. mito_ai/completions/prompt_builders/chat_prompt.py +18 -11
  15. mito_ai/completions/prompt_builders/utils.py +53 -10
  16. mito_ai/constants.py +11 -1
  17. mito_ai/streamlit_conversion/streamlit_agent_handler.py +112 -0
  18. mito_ai/streamlit_conversion/streamlit_system_prompt.py +42 -0
  19. mito_ai/streamlit_conversion/streamlit_utils.py +96 -0
  20. mito_ai/streamlit_conversion/validate_and_run_streamlit_code.py +207 -0
  21. mito_ai/tests/providers/test_stream_mito_server_utils.py +140 -0
  22. mito_ai/tests/streamlit_conversion/__init__.py +3 -0
  23. mito_ai/tests/streamlit_conversion/test_streamlit_agent_handler.py +265 -0
  24. mito_ai/tests/streamlit_conversion/test_streamlit_utils.py +197 -0
  25. mito_ai/tests/streamlit_conversion/test_validate_and_run_streamlit_code.py +418 -0
  26. mito_ai/tests/test_constants.py +18 -3
  27. mito_ai/utils/anthropic_utils.py +18 -70
  28. mito_ai/utils/gemini_utils.py +22 -73
  29. mito_ai/utils/mito_server_utils.py +147 -4
  30. mito_ai/utils/open_ai_utils.py +18 -107
  31. {mito_ai-0.1.36.data → mito_ai-0.1.37.data}/data/share/jupyter/labextensions/mito_ai/build_log.json +100 -100
  32. {mito_ai-0.1.36.data → mito_ai-0.1.37.data}/data/share/jupyter/labextensions/mito_ai/package.json +2 -2
  33. {mito_ai-0.1.36.data → mito_ai-0.1.37.data}/data/share/jupyter/labextensions/mito_ai/schemas/mito_ai/package.json.orig +1 -1
  34. mito_ai-0.1.36.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.a20772bc113422d0f505.js → mito_ai-0.1.37.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.831f63b48760c7119b9b.js +1165 -539
  35. mito_ai-0.1.37.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.831f63b48760c7119b9b.js.map +1 -0
  36. mito_ai-0.1.36.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.5c9333902dce30642119.js → mito_ai-0.1.37.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.93ecc9bc0edba61535cc.js +18 -14
  37. mito_ai-0.1.37.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.93ecc9bc0edba61535cc.js.map +1 -0
  38. mito_ai-0.1.36.data/data/share/jupyter/labextensions/mito_ai/static/style_index_js.76efcc5c3be4056457ee.js → mito_ai-0.1.37.data/data/share/jupyter/labextensions/mito_ai/static/style_index_js.5876024bb17dbd6a3ee6.js +6 -2
  39. mito_ai-0.1.37.data/data/share/jupyter/labextensions/mito_ai/static/style_index_js.5876024bb17dbd6a3ee6.js.map +1 -0
  40. {mito_ai-0.1.36.dist-info → mito_ai-0.1.37.dist-info}/METADATA +1 -1
  41. {mito_ai-0.1.36.dist-info → mito_ai-0.1.37.dist-info}/RECORD +51 -38
  42. mito_ai-0.1.36.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.a20772bc113422d0f505.js.map +0 -1
  43. mito_ai-0.1.36.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.5c9333902dce30642119.js.map +0 -1
  44. mito_ai-0.1.36.data/data/share/jupyter/labextensions/mito_ai/static/style_index_js.76efcc5c3be4056457ee.js.map +0 -1
  45. {mito_ai-0.1.36.data → mito_ai-0.1.37.data}/data/etc/jupyter/jupyter_server_config.d/mito_ai.json +0 -0
  46. {mito_ai-0.1.36.data → mito_ai-0.1.37.data}/data/share/jupyter/labextensions/mito_ai/schemas/mito_ai/toolbar-buttons.json +0 -0
  47. {mito_ai-0.1.36.data → mito_ai-0.1.37.data}/data/share/jupyter/labextensions/mito_ai/static/style.js +0 -0
  48. {mito_ai-0.1.36.data → mito_ai-0.1.37.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_semver_index_js.9795f79265ddb416864b.js +0 -0
  49. {mito_ai-0.1.36.data → mito_ai-0.1.37.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_semver_index_js.9795f79265ddb416864b.js.map +0 -0
  50. {mito_ai-0.1.36.data → mito_ai-0.1.37.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_vscode-diff_dist_index_js.ea55f1f9346638aafbcf.js +0 -0
  51. {mito_ai-0.1.36.data → mito_ai-0.1.37.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_vscode-diff_dist_index_js.ea55f1f9346638aafbcf.js.map +0 -0
  52. {mito_ai-0.1.36.dist-info → mito_ai-0.1.37.dist-info}/WHEEL +0 -0
  53. {mito_ai-0.1.36.dist-info → mito_ai-0.1.37.dist-info}/entry_points.txt +0 -0
  54. {mito_ai-0.1.36.dist-info → mito_ai-0.1.37.dist-info}/licenses/LICENSE +0 -0
@@ -17,12 +17,17 @@ __webpack_require__.r(__webpack_exports__);
17
17
  /* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__);
18
18
  /* harmony import */ var _jupyterlab_notebook__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @jupyterlab/notebook */ "webpack/sharing/consume/default/@jupyterlab/notebook");
19
19
  /* harmony import */ var _jupyterlab_notebook__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_notebook__WEBPACK_IMPORTED_MODULE_2__);
20
- /* harmony import */ var _ChatWidget__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ChatWidget */ "./lib/Extensions/AiChat/ChatWidget.js");
20
+ /* harmony import */ var _ChatWidget__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./ChatWidget */ "./lib/Extensions/AiChat/ChatWidget.js");
21
21
  /* harmony import */ var _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @jupyterlab/rendermime */ "webpack/sharing/consume/default/@jupyterlab/rendermime");
22
22
  /* harmony import */ var _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_3__);
23
- /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../commands */ "./lib/commands.js");
24
- /* harmony import */ var _token__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./token */ "./lib/Extensions/AiChat/token.js");
25
- /* harmony import */ var _ContextManager_ContextManagerPlugin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../ContextManager/ContextManagerPlugin */ "./lib/Extensions/ContextManager/ContextManagerPlugin.js");
23
+ /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../commands */ "./lib/commands.js");
24
+ /* harmony import */ var _token__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./token */ "./lib/Extensions/AiChat/token.js");
25
+ /* harmony import */ var _ContextManager_ContextManagerPlugin__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../ContextManager/ContextManagerPlugin */ "./lib/Extensions/ContextManager/ContextManagerPlugin.js");
26
+ /* harmony import */ var _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @jupyterlab/settingregistry */ "webpack/sharing/consume/default/@jupyterlab/settingregistry");
27
+ /* harmony import */ var _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_4__);
28
+ /* harmony import */ var _jupyterSettingsManager__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./jupyterSettingsManager */ "./lib/Extensions/AiChat/jupyterSettingsManager.js");
29
+ /* harmony import */ var _jupyterlab_docmanager__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @jupyterlab/docmanager */ "webpack/sharing/consume/default/@jupyterlab/docmanager");
30
+ /* harmony import */ var _jupyterlab_docmanager__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_docmanager__WEBPACK_IMPORTED_MODULE_5__);
26
31
  /*
27
32
  * Copyright (c) Saga Inc.
28
33
  * Distributed under the terms of the GNU Affero General Public License v3.0 License.
@@ -35,6 +40,9 @@ __webpack_require__.r(__webpack_exports__);
35
40
 
36
41
 
37
42
 
43
+
44
+
45
+
38
46
  // The Widget Rank determins where the ChatIcon is displayed
39
47
  // in the left hand toolbar
40
48
  const WIDGET_RANK = 2000;
@@ -50,21 +58,23 @@ const AiChatPlugin = {
50
58
  _jupyterlab_notebook__WEBPACK_IMPORTED_MODULE_2__.INotebookTracker,
51
59
  _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.ICommandPalette,
52
60
  _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_3__.IRenderMimeRegistry,
53
- _ContextManager_ContextManagerPlugin__WEBPACK_IMPORTED_MODULE_4__.IContextManager
61
+ _ContextManager_ContextManagerPlugin__WEBPACK_IMPORTED_MODULE_6__.IContextManager,
62
+ _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_4__.ISettingRegistry,
63
+ _jupyterlab_docmanager__WEBPACK_IMPORTED_MODULE_5__.IDocumentManager
54
64
  ],
55
65
  optional: [_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ILayoutRestorer],
56
- provides: _token__WEBPACK_IMPORTED_MODULE_5__.IChatTracker,
57
- activate: (app, labShell, notebookTracker, palette, rendermime, contextManager, restorer) => {
66
+ provides: _token__WEBPACK_IMPORTED_MODULE_7__.IChatTracker,
67
+ activate: (app, labShell, notebookTracker, palette, rendermime, contextManager, settingRegistry, documentManager, restorer) => {
58
68
  // Define a widget creator function,
59
69
  // then call it to make a new widget
60
70
  const newWidget = () => {
61
71
  // Create a blank content widget inside of a MainAreaWidget
62
- const chatWidget = (0,_ChatWidget__WEBPACK_IMPORTED_MODULE_6__.buildChatWidget)(app, notebookTracker, rendermime, contextManager);
72
+ const chatWidget = (0,_ChatWidget__WEBPACK_IMPORTED_MODULE_8__.buildChatWidget)(app, notebookTracker, rendermime, contextManager);
63
73
  return chatWidget;
64
74
  };
65
75
  let widget = newWidget();
66
76
  // Add an application command
67
- app.commands.addCommand(_commands__WEBPACK_IMPORTED_MODULE_7__.COMMAND_MITO_AI_OPEN_CHAT, {
77
+ app.commands.addCommand(_commands__WEBPACK_IMPORTED_MODULE_9__.COMMAND_MITO_AI_OPEN_CHAT, {
68
78
  label: 'Your friendly Python Expert chat bot',
69
79
  execute: (args) => {
70
80
  // In order for the widget to be accessible, the widget must be:
@@ -98,14 +108,14 @@ const AiChatPlugin = {
98
108
  }
99
109
  });
100
110
  app.commands.addKeyBinding({
101
- command: _commands__WEBPACK_IMPORTED_MODULE_7__.COMMAND_MITO_AI_OPEN_CHAT,
111
+ command: _commands__WEBPACK_IMPORTED_MODULE_9__.COMMAND_MITO_AI_OPEN_CHAT,
102
112
  keys: ['Accel E'],
103
113
  selector: 'body'
104
114
  });
105
115
  app.shell.add(widget, 'left', { rank: WIDGET_RANK });
106
116
  // Add the command to the palette.
107
117
  palette.addItem({
108
- command: _commands__WEBPACK_IMPORTED_MODULE_7__.COMMAND_MITO_AI_OPEN_CHAT,
118
+ command: _commands__WEBPACK_IMPORTED_MODULE_9__.COMMAND_MITO_AI_OPEN_CHAT,
109
119
  category: 'AI Chat'
110
120
  });
111
121
  // Track and restore the widget state
@@ -128,6 +138,8 @@ const AiChatPlugin = {
128
138
  // This will override the default file browser selection
129
139
  labShell.activateById(widget.id);
130
140
  });
141
+ // Update jupyter settings to work best with mito-ai
142
+ void (0,_jupyterSettingsManager__WEBPACK_IMPORTED_MODULE_10__.setRenameUntitledFileOnSave)(settingRegistry, documentManager);
131
143
  // By returning a tracker token, we can require the token in other
132
144
  // plugins. This allows us to force plugin load order. For example,
133
145
  // we can ensure that the COMMAND_MITO_AI_OPEN_CHAT is created
@@ -265,7 +277,7 @@ class ChatHistoryManager {
265
277
  promptType: 'chat'
266
278
  });
267
279
  }
268
- async addChatInputMessage(input, activeThreadId, messageIndex, selectedRules) {
280
+ async addChatInputMessage(input, activeThreadId, messageIndex, additionalContext) {
269
281
  const activeCellCode = (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_0__.getActiveCellCode)(this.notebookTracker) || '';
270
282
  const activeCellID = (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_0__.getActiveCellID)(this.notebookTracker) || '';
271
283
  const chatMessageMetadata = {
@@ -277,17 +289,18 @@ class ChatHistoryManager {
277
289
  input: input,
278
290
  threadId: activeThreadId,
279
291
  index: messageIndex,
280
- selectedRules: selectedRules
292
+ additionalContext: additionalContext
281
293
  };
282
294
  this.displayOptimizedChatHistory.push({
283
295
  message: getDisplayedOptimizedUserMessage(input, activeCellCode),
284
296
  type: 'openai message',
285
297
  codeCellID: activeCellID,
286
- promptType: 'chat'
298
+ promptType: 'chat',
299
+ additionalContext: additionalContext
287
300
  });
288
301
  return chatMessageMetadata;
289
302
  }
290
- addAgentExecutionMessage(activeThreadId, input, selectedRules) {
303
+ addAgentExecutionMessage(activeThreadId, input, additionalContext) {
291
304
  const aiOptimizedCells = (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_0__.getAIOptimizedCells)(this.notebookTracker);
292
305
  const agentExecutionMetadata = {
293
306
  promptType: 'agent:execution',
@@ -297,7 +310,7 @@ class ChatHistoryManager {
297
310
  input: input || '',
298
311
  threadId: activeThreadId,
299
312
  isChromeBrowser: (0,_utils_user__WEBPACK_IMPORTED_MODULE_1__.isChromeBasedBrowser)(),
300
- selectedRules: selectedRules
313
+ additionalContext: additionalContext
301
314
  };
302
315
  // We use this function in two ways:
303
316
  // 1. When the user sends the original agent:execution message to start the agent
@@ -317,6 +330,7 @@ class ChatHistoryManager {
317
330
  message: userMessage,
318
331
  type: 'openai message',
319
332
  promptType: 'chat',
333
+ additionalContext: additionalContext
320
334
  });
321
335
  return agentExecutionMetadata;
322
336
  }
@@ -576,8 +590,8 @@ __webpack_require__.r(__webpack_exports__);
576
590
  /* harmony export */ });
577
591
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
578
592
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
579
- /* harmony import */ var _utils_classNames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../utils/classNames */ "./lib/utils/classNames.js");
580
593
  /* harmony import */ var _restAPI_RestAPI__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../restAPI/RestAPI */ "./lib/restAPI/RestAPI.js");
594
+ /* harmony import */ var _ChatDropdownItems__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ChatDropdownItems */ "./lib/Extensions/AiChat/ChatMessage/ChatDropdownItems.js");
581
595
  /*
582
596
  * Copyright (c) Saga Inc.
583
597
  * Distributed under the terms of the GNU Affero General Public License v3.0 License.
@@ -585,38 +599,100 @@ __webpack_require__.r(__webpack_exports__);
585
599
 
586
600
 
587
601
 
588
- const ChatDropdown = ({ options, onSelect, filterText, maxDropdownItems = 10, }) => {
602
+ const ChatDropdown = ({ options, onSelect, filterText, maxDropdownItems = 10, isDropdownFromButton = false, onFilterChange, onClose, }) => {
589
603
  const [selectedIndex, setSelectedIndex] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0);
604
+ const [localFilterText, setLocalFilterText] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(filterText);
605
+ const searchInputRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
590
606
  const [rules, setRules] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]);
607
+ const [databaseConnections, setDatabaseConnections] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({});
591
608
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
592
609
  const fetchRules = async () => {
593
610
  const rules = await (0,_restAPI_RestAPI__WEBPACK_IMPORTED_MODULE_1__.getRules)();
594
611
  setRules(rules);
595
612
  };
613
+ const fetchDatabaseConnections = async () => {
614
+ const databaseConnections = await (0,_restAPI_RestAPI__WEBPACK_IMPORTED_MODULE_1__.getDatabaseConnections)();
615
+ setDatabaseConnections(databaseConnections);
616
+ };
596
617
  void fetchRules();
618
+ void fetchDatabaseConnections();
597
619
  }, []);
620
+ // Focus search input when dropdown opens with search input
621
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
622
+ if (isDropdownFromButton && searchInputRef.current) {
623
+ searchInputRef.current.focus();
624
+ }
625
+ }, [isDropdownFromButton]);
626
+ // Use local filter text when search input is shown, otherwise use prop
627
+ const effectiveFilterText = isDropdownFromButton ? localFilterText : filterText;
598
628
  // Create a list of all options with the format
599
629
  // ['type': 'variable', "expandedVariable": variable]
600
630
  // ['type': 'rule', "rule": rule]
631
+ // ['type': 'file', "file": file]
601
632
  const allOptions = [
602
- ...options.map((variable) => ({
603
- type: 'variable',
604
- variable: variable
605
- })),
633
+ // Rules first
606
634
  ...rules.map((rule) => ({
607
635
  type: 'rule',
608
636
  rule: rule
609
637
  })),
638
+ // Files second
639
+ ...options
640
+ .filter(variable => variable.file_name) // Only files
641
+ .map((file) => ({
642
+ type: 'file',
643
+ file: file
644
+ })),
645
+ // Databases third
646
+ ...Object.entries(databaseConnections).map(([connectionId, connection]) => ({
647
+ type: 'db',
648
+ variable: {
649
+ variable_name: connection.alias || connection.database,
650
+ type: "db",
651
+ value: connectionId + " - " + connection.type,
652
+ parent_df: connection.type
653
+ }
654
+ })),
655
+ // Dataframes fourth
656
+ ...options
657
+ .filter(variable => !variable.file_name && variable.type === "pd.DataFrame")
658
+ .map((variable) => ({
659
+ type: 'variable',
660
+ variable: variable
661
+ })),
662
+ // Columns fifth
663
+ ...options
664
+ .filter(variable => !variable.file_name && variable.parent_df && variable.type !== "pd.DataFrame")
665
+ .map((variable) => ({
666
+ type: 'variable',
667
+ variable: variable
668
+ })),
669
+ // Other variables last
670
+ ...options
671
+ .filter(variable => !variable.file_name && !variable.parent_df && variable.type !== "pd.DataFrame")
672
+ .map((variable) => ({
673
+ type: 'variable',
674
+ variable: variable
675
+ })),
610
676
  ];
611
- const filteredOptions = allOptions.filter((option) => option.type === 'variable' ?
612
- option.variable.variable_name.toLowerCase().includes(filterText.toLowerCase()) &&
613
- option.variable.type !== "<class 'module'>" &&
614
- option.variable.variable_name !== "FUNCTIONS" // This is default exported from mitosheet when you run from mitosheet import * as FUNCTIONS
615
- :
616
- option.rule.toLowerCase().includes(filterText.toLowerCase())).slice(0, maxDropdownItems);
677
+ const filteredOptions = allOptions.filter((option) => {
678
+ if (option.type === 'variable') {
679
+ return option.variable.variable_name.toLowerCase().includes(effectiveFilterText.toLowerCase()) &&
680
+ option.variable.type !== "<class 'module'>" &&
681
+ option.variable.variable_name !== "FUNCTIONS"; // This is default exported from mitosheet when you run from mitosheet import * as FUNCTIONS
682
+ }
683
+ else if (option.type === 'file') {
684
+ return option.file.variable_name.toLowerCase().includes(effectiveFilterText.toLowerCase());
685
+ }
686
+ else if (option.type === 'db') {
687
+ return option.variable.value.toLowerCase().includes(effectiveFilterText.toLowerCase());
688
+ }
689
+ else {
690
+ return option.rule.toLowerCase().includes(effectiveFilterText.toLowerCase());
691
+ }
692
+ }).slice(0, maxDropdownItems);
617
693
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
618
694
  setSelectedIndex(0);
619
- }, [options, rules, filterText]);
695
+ }, [options, rules, effectiveFilterText]);
620
696
  const handleKeyDown = (event) => {
621
697
  switch (event.key) {
622
698
  case 'ArrowDown':
@@ -650,28 +726,96 @@ const ChatDropdown = ({ options, onSelect, filterText, maxDropdownItems = 10, })
650
726
  document.addEventListener('keydown', handleKeyDown);
651
727
  return () => document.removeEventListener('keydown', handleKeyDown);
652
728
  }, [filteredOptions, selectedIndex]);
729
+ // Handle click outside to close dropdown
730
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
731
+ const handleClickOutside = (event) => {
732
+ const target = event.target;
733
+ const dropdownElement = document.querySelector('.chat-dropdown');
734
+ if (dropdownElement && !dropdownElement.contains(target)) {
735
+ if (onClose) {
736
+ onClose();
737
+ }
738
+ }
739
+ };
740
+ document.addEventListener('mousedown', handleClickOutside);
741
+ return () => document.removeEventListener('mousedown', handleClickOutside);
742
+ }, [onClose]);
743
+ const handleSearchInputChange = (event) => {
744
+ const newFilterText = event.target.value;
745
+ setLocalFilterText(newFilterText);
746
+ if (onFilterChange) {
747
+ onFilterChange(newFilterText);
748
+ }
749
+ };
750
+ const handleSearchInputKeyDown = (event) => {
751
+ if (event.key === 'Escape') {
752
+ event.preventDefault();
753
+ event.stopPropagation();
754
+ if (onFilterChange) {
755
+ onFilterChange(''); // Clear the filter
756
+ }
757
+ if (onClose) {
758
+ onClose(); // Close the dropdown
759
+ }
760
+ }
761
+ };
653
762
  return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: `chat-dropdown`, "data-testid": "chat-dropdown" },
763
+ isDropdownFromButton && (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "chat-dropdown-search" },
764
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("input", { ref: searchInputRef, type: "text", placeholder: "Search variables and rules...", value: localFilterText, onChange: handleSearchInputChange, onKeyDown: handleSearchInputKeyDown, className: "chat-dropdown-search-input" }))),
654
765
  react__WEBPACK_IMPORTED_MODULE_0___default().createElement("ul", { className: "chat-dropdown-list", "data-testid": "chat-dropdown-list" },
655
766
  filteredOptions.length === 0 && (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", { className: "chat-dropdown-item", "data-testid": "chat-dropdown-empty-item" }, "No variables found")),
656
767
  filteredOptions.map((option, index) => {
657
- let uniqueKey;
658
- if (option.type === 'variable') {
659
- uniqueKey = option.variable.parent_df
660
- ? `${option.variable.parent_df}.${option.variable.variable_name}`
661
- : option.variable.variable_name;
662
- }
663
- else {
664
- uniqueKey = option.rule;
665
- }
666
- if (option.type === 'variable') {
667
- return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(VariableDropdownItem, { key: uniqueKey, variable: option.variable, index: index, selectedIndex: selectedIndex, onSelect: () => onSelect(option) }));
668
- }
669
- else {
670
- return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(RuleDropdownItem, { key: uniqueKey, rule: option.rule, index: index, selectedIndex: selectedIndex, onSelect: () => onSelect(option) }));
768
+ switch (option.type) {
769
+ case 'variable': {
770
+ const uniqueKey = option.variable.parent_df
771
+ ? `${option.variable.parent_df}.${option.variable.variable_name}`
772
+ : option.variable.variable_name;
773
+ return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_ChatDropdownItems__WEBPACK_IMPORTED_MODULE_2__.VariableDropdownItem, { key: uniqueKey, variable: option.variable, index: index, selectedIndex: selectedIndex, onSelect: () => onSelect(option) }));
774
+ }
775
+ case 'file': {
776
+ const uniqueKey = option.file.variable_name;
777
+ return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_ChatDropdownItems__WEBPACK_IMPORTED_MODULE_2__.FileDropdownItem, { key: uniqueKey, file: option.file, index: index, selectedIndex: selectedIndex, onSelect: () => onSelect(option) }));
778
+ }
779
+ case 'rule': {
780
+ const uniqueKey = option.rule;
781
+ return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_ChatDropdownItems__WEBPACK_IMPORTED_MODULE_2__.RuleDropdownItem, { key: uniqueKey, rule: option.rule, index: index, selectedIndex: selectedIndex, onSelect: () => onSelect(option) }));
782
+ }
783
+ case 'db': {
784
+ const uniqueKey = option.variable.variable_name;
785
+ // You can replace VariableDropdownItem with a custom DBDropdownItem if you want
786
+ return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_ChatDropdownItems__WEBPACK_IMPORTED_MODULE_2__.VariableDropdownItem, { key: uniqueKey, variable: option.variable, index: index, selectedIndex: selectedIndex, onSelect: () => onSelect(option) }));
787
+ }
788
+ default:
789
+ return null;
671
790
  }
672
791
  }))));
673
792
  };
674
793
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ChatDropdown);
794
+
795
+
796
+ /***/ }),
797
+
798
+ /***/ "./lib/Extensions/AiChat/ChatMessage/ChatDropdownItems.js":
799
+ /*!****************************************************************!*\
800
+ !*** ./lib/Extensions/AiChat/ChatMessage/ChatDropdownItems.js ***!
801
+ \****************************************************************/
802
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
803
+
804
+ __webpack_require__.r(__webpack_exports__);
805
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
806
+ /* harmony export */ FileDropdownItem: () => (/* binding */ FileDropdownItem),
807
+ /* harmony export */ RuleDropdownItem: () => (/* binding */ RuleDropdownItem),
808
+ /* harmony export */ VariableDropdownItem: () => (/* binding */ VariableDropdownItem)
809
+ /* harmony export */ });
810
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
811
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
812
+ /* harmony import */ var _utils_classNames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../utils/classNames */ "./lib/utils/classNames.js");
813
+ /*
814
+ * Copyright (c) Saga Inc.
815
+ * Distributed under the terms of the GNU Affero General Public License v3.0 License.
816
+ */
817
+
818
+
675
819
  const VariableDropdownItem = ({ variable, index, selectedIndex, onSelect }) => {
676
820
  const getShortType = (type) => {
677
821
  var _a;
@@ -686,7 +830,7 @@ const VariableDropdownItem = ({ variable, index, selectedIndex, onSelect }) => {
686
830
  }
687
831
  return type;
688
832
  };
689
- return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", { className: (0,_utils_classNames__WEBPACK_IMPORTED_MODULE_2__.classNames)("chat-dropdown-item", { selected: index === selectedIndex }), onClick: () => onSelect(variable.variable_name, variable.parent_df), "data-testid": `chat-dropdown-item-${variable.variable_name}` },
833
+ return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", { className: (0,_utils_classNames__WEBPACK_IMPORTED_MODULE_1__.classNames)("chat-dropdown-item", { selected: index === selectedIndex }), onClick: () => onSelect(variable.variable_name, variable.parent_df), "data-testid": `chat-dropdown-item-${variable.variable_name}` },
690
834
  react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: "chat-dropdown-item-type", title: getShortType(variable.type), "data-testid": `chat-dropdown-item-type-${variable.variable_name}` }, getShortType(variable.type)),
691
835
  react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: "chat-dropdown-item-name", title: variable.variable_name, "data-testid": `chat-dropdown-item-name-${variable.variable_name}`, ref: (el) => {
692
836
  // Show full text on hover if the text is too long
@@ -696,8 +840,25 @@ const VariableDropdownItem = ({ variable, index, selectedIndex, onSelect }) => {
696
840
  } }, variable.variable_name),
697
841
  variable.parent_df && (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: "chat-dropdown-item-parent-df" }, variable.parent_df))));
698
842
  };
843
+ const FileDropdownItem = ({ file, index, selectedIndex, onSelect }) => {
844
+ return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", { className: (0,_utils_classNames__WEBPACK_IMPORTED_MODULE_1__.classNames)("chat-dropdown-item", { selected: index === selectedIndex }), onClick: () => onSelect(file), "data-testid": `chat-dropdown-item-${file.variable_name}` },
845
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: "chat-dropdown-item-type", title: file.type, "data-testid": `chat-dropdown-item-type-${file.variable_name}` }, file.type),
846
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: "chat-dropdown-item-name", title: file.variable_name, "data-testid": `chat-dropdown-item-name-${file.variable_name}`, ref: (el) => {
847
+ // Show full text on hover if the text is too long
848
+ if (el) {
849
+ el.title = el.scrollWidth > el.clientWidth ? file.variable_name : '';
850
+ }
851
+ } }, file.variable_name)));
852
+ };
699
853
  const RuleDropdownItem = ({ rule, index, selectedIndex, onSelect }) => {
700
- return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", { className: (0,_utils_classNames__WEBPACK_IMPORTED_MODULE_2__.classNames)("chat-dropdown-item", { selected: index === selectedIndex }), onClick: () => onSelect(rule), "data-testid": `chat-dropdown-item-${rule}` }, rule));
854
+ return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", { className: (0,_utils_classNames__WEBPACK_IMPORTED_MODULE_1__.classNames)("chat-dropdown-item", { selected: index === selectedIndex }), onClick: () => onSelect(rule), "data-testid": `chat-dropdown-item-${rule}` },
855
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: "chat-dropdown-item-type", title: "rule", "data-testid": `chat-dropdown-item-type-${rule}` }, "rule"),
856
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: "chat-dropdown-item-name", title: rule, "data-testid": `chat-dropdown-item-name-${rule}`, ref: (el) => {
857
+ // Show full text on hover if the text is too long
858
+ if (el) {
859
+ el.title = el.scrollWidth > el.clientWidth ? rule : '';
860
+ }
861
+ } }, rule)));
701
862
  };
702
863
 
703
864
 
@@ -716,13 +877,14 @@ __webpack_require__.r(__webpack_exports__);
716
877
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
717
878
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
718
879
  /* harmony import */ var _utils_classNames__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../utils/classNames */ "./lib/utils/classNames.js");
719
- /* harmony import */ var _ChatDropdown__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./ChatDropdown */ "./lib/Extensions/AiChat/ChatMessage/ChatDropdown.js");
880
+ /* harmony import */ var _ChatDropdown__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./ChatDropdown */ "./lib/Extensions/AiChat/ChatMessage/ChatDropdown.js");
720
881
  /* harmony import */ var _utils_notebook__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../utils/notebook */ "./lib/utils/notebook.js");
721
- /* harmony import */ var _PythonCode__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./PythonCode */ "./lib/Extensions/AiChat/ChatMessage/PythonCode.js");
882
+ /* harmony import */ var _PythonCode__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./PythonCode */ "./lib/Extensions/AiChat/ChatMessage/PythonCode.js");
722
883
  /* harmony import */ var _style_ChatInput_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../style/ChatInput.css */ "./style/ChatInput.css");
723
884
  /* harmony import */ var _style_ChatDropdown_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../style/ChatDropdown.css */ "./style/ChatDropdown.css");
724
885
  /* harmony import */ var _hooks_useDebouncedFunction__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../hooks/useDebouncedFunction */ "./lib/hooks/useDebouncedFunction.js");
725
- /* harmony import */ var _components_SelectedContextContainer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../components/SelectedContextContainer */ "./lib/components/SelectedContextContainer.js");
886
+ /* harmony import */ var _components_SelectedContextContainer__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../components/SelectedContextContainer */ "./lib/components/SelectedContextContainer.js");
887
+ /* harmony import */ var _components_DatabaseButton__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../components/DatabaseButton */ "./lib/components/DatabaseButton.js");
726
888
  /*
727
889
  * Copyright (c) Saga Inc.
728
890
  * Distributed under the terms of the GNU Affero General Public License v3.0 License.
@@ -736,7 +898,8 @@ __webpack_require__.r(__webpack_exports__);
736
898
 
737
899
 
738
900
 
739
- const ChatInput = ({ initialContent, placeholder, onSave, onCancel, isEditing, contextManager, notebookTracker, renderMimeRegistry, displayActiveCellCode = true, agentModeEnabled = false, }) => {
901
+
902
+ const ChatInput = ({ app, initialContent, placeholder, onSave, onCancel, isEditing, contextManager, notebookTracker, renderMimeRegistry, displayActiveCellCode = true, agentModeEnabled = false, }) => {
740
903
  var _a;
741
904
  const [input, setInput] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(initialContent);
742
905
  const [expandedVariables, setExpandedVariables] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]);
@@ -745,7 +908,8 @@ const ChatInput = ({ initialContent, placeholder, onSave, onCancel, isEditing, c
745
908
  const [activeCellID, setActiveCellID] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)((0,_utils_notebook__WEBPACK_IMPORTED_MODULE_3__.getActiveCellID)(notebookTracker));
746
909
  const [isDropdownVisible, setDropdownVisible] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
747
910
  const [dropdownFilter, setDropdownFilter] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)('');
748
- const [selectedRules, setSelectedRules] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]);
911
+ const [additionalContext, setAdditionalContext] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]);
912
+ const [isDropdownFromButton, setIsDropdownFromButton] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
749
913
  // Debounce the active cell ID change to avoid multiple rerenders.
750
914
  // We use this to avoid a flickering screen when the active cell changes.
751
915
  const debouncedSetActiveCellID = (0,_hooks_useDebouncedFunction__WEBPACK_IMPORTED_MODULE_4__.useDebouncedFunction)((newID) => {
@@ -788,13 +952,49 @@ const ChatInput = ({ initialContent, placeholder, onSave, onCancel, isEditing, c
788
952
  const query = currentWord.slice(1);
789
953
  setDropdownFilter(query);
790
954
  setDropdownVisible(true);
955
+ setIsDropdownFromButton(false);
791
956
  }
792
957
  else {
793
958
  setDropdownVisible(false);
794
959
  setDropdownFilter('');
960
+ setIsDropdownFromButton(false);
795
961
  }
796
962
  };
797
963
  const handleOptionSelect = (option) => {
964
+ if (isDropdownFromButton) {
965
+ // When triggered by "Add Context" button, add to SelectedContextContainer
966
+ if (option.type === 'variable') {
967
+ // For variables, we'll add them as a special context type
968
+ const contextName = option.variable.parent_df
969
+ ? `${option.variable.parent_df}.${option.variable.variable_name}`
970
+ : option.variable.variable_name;
971
+ setAdditionalContext(prev => [...prev, { type: 'variable', value: contextName }]);
972
+ }
973
+ else if (option.type === 'file') {
974
+ setAdditionalContext(prev => [...prev, { type: 'file', value: option.file.variable_name }]);
975
+ }
976
+ else if (option.type === 'rule') {
977
+ setAdditionalContext(prev => [...prev, { type: 'rule', value: option.rule }]);
978
+ }
979
+ else if (option.type === 'db') {
980
+ setAdditionalContext(prev => [
981
+ ...prev,
982
+ {
983
+ type: 'db',
984
+ value: option.variable.value,
985
+ display: option.variable.variable_name
986
+ }
987
+ ]);
988
+ }
989
+ setDropdownVisible(false);
990
+ // Use setTimeout to ensure this happens after React's state update cycle
991
+ setTimeout(() => {
992
+ var _a;
993
+ (_a = textAreaRef.current) === null || _a === void 0 ? void 0 : _a.focus();
994
+ }, 0);
995
+ return;
996
+ }
997
+ // Original behavior for @ dropdown - add to text input
798
998
  const textarea = textAreaRef.current;
799
999
  if (!textarea)
800
1000
  return;
@@ -811,13 +1011,26 @@ const ChatInput = ({ initialContent, placeholder, onSave, onCancel, isEditing, c
811
1011
  contextChatRepresentation = `\`${option.variable.variable_name}\``;
812
1012
  }
813
1013
  }
1014
+ else if (option.type === 'file') {
1015
+ // For files, add them as both back-ticked elements and the additional context container
1016
+ contextChatRepresentation = `\`${option.file.variable_name}\``;
1017
+ setAdditionalContext([...additionalContext, { type: 'file', value: option.file.variable_name }]);
1018
+ }
814
1019
  else if (option.type === 'rule') {
815
1020
  // We don't add the rule as an back ticked element in the chat input,
816
1021
  // and instead just add it as plain text because we also add it as
817
1022
  // a context container above the chat input and we want the user to
818
1023
  // delete the context from there if they want to.
819
1024
  contextChatRepresentation = option.rule;
820
- setSelectedRules([...selectedRules, option.rule]);
1025
+ setAdditionalContext([...additionalContext, { type: 'rule', value: option.rule }]);
1026
+ }
1027
+ else if (option.type === 'db') {
1028
+ // For databases, add them as back-ticked elements
1029
+ contextChatRepresentation = `\`${option.variable.variable_name}\``;
1030
+ setAdditionalContext([
1031
+ ...additionalContext,
1032
+ { type: 'db', value: option.variable.value, display: option.variable.variable_name }
1033
+ ]);
821
1034
  }
822
1035
  const newValue = input.slice(0, atIndex) +
823
1036
  contextChatRepresentation +
@@ -834,6 +1047,11 @@ const ChatInput = ({ initialContent, placeholder, onSave, onCancel, isEditing, c
834
1047
  }
835
1048
  }, 0);
836
1049
  };
1050
+ const handleDropdownClose = () => {
1051
+ setDropdownVisible(false);
1052
+ setDropdownFilter('');
1053
+ setIsDropdownFromButton(false);
1054
+ };
837
1055
  // Update the expandedVariables arr when the variable manager changes
838
1056
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
839
1057
  const expandedVariables = [
@@ -867,12 +1085,21 @@ const ChatInput = ({ initialContent, placeholder, onSave, onCancel, isEditing, c
867
1085
  return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: (0,_utils_classNames__WEBPACK_IMPORTED_MODULE_5__.classNames)("chat-input-container"), onFocus: () => setIsFocused(true), onBlur: () => {
868
1086
  setIsFocused(false);
869
1087
  } },
870
- selectedRules.length > 0 && (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: 'context-container' }, selectedRules.map((rule) => (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_SelectedContextContainer__WEBPACK_IMPORTED_MODULE_6__["default"], { key: rule, title: rule, onRemove: () => setSelectedRules(selectedRules.filter((r) => r !== rule)) }))))),
871
1088
  displayActiveCellCode && activeCellCodePreview.length > 0 && !agentModeEnabled
872
1089
  && (isFocused || input.length > 0)
873
1090
  && react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: 'active-cell-preview-container', "data-testid": 'active-cell-preview-container' },
874
1091
  react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: 'code-block-container' },
875
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_PythonCode__WEBPACK_IMPORTED_MODULE_7__["default"], { code: activeCellCodePreview, renderMimeRegistry: renderMimeRegistry }))),
1092
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_PythonCode__WEBPACK_IMPORTED_MODULE_6__["default"], { code: activeCellCodePreview, renderMimeRegistry: renderMimeRegistry }))),
1093
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: 'context-container' },
1094
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_DatabaseButton__WEBPACK_IMPORTED_MODULE_7__["default"], { app: app }),
1095
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { className: "context-button", onClick: () => {
1096
+ var _a;
1097
+ setDropdownVisible(true);
1098
+ setDropdownFilter('');
1099
+ setIsDropdownFromButton(true);
1100
+ (_a = textAreaRef.current) === null || _a === void 0 ? void 0 : _a.focus();
1101
+ } }, "\uFF20 Add Context"),
1102
+ additionalContext.map((context, index) => (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_SelectedContextContainer__WEBPACK_IMPORTED_MODULE_8__["default"], { key: `${context.type}-${context.value}-${index}`, title: context.type === 'db' && context.display ? context.display : context.value, type: context.type, onRemove: () => setAdditionalContext(additionalContext.filter((_, i) => i !== index)) })))),
876
1103
  react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: 'chat-input-text-area-container' },
877
1104
  react__WEBPACK_IMPORTED_MODULE_0___default().createElement("textarea", { ref: textAreaRef, className: (0,_utils_classNames__WEBPACK_IMPORTED_MODULE_5__.classNames)("message", "message-user", 'chat-input', { "agent-mode": agentModeEnabled }), placeholder: placeholder, value: input, onChange: handleInputChange, onKeyDown: (e) => {
878
1105
  // If dropdown is visible, only handle escape to close it
@@ -888,10 +1115,10 @@ const ChatInput = ({ initialContent, placeholder, onSave, onCancel, isEditing, c
888
1115
  if (e.key === 'Enter' && !e.shiftKey) {
889
1116
  e.preventDefault();
890
1117
  adjustHeight(true);
891
- onSave(input, undefined, selectedRules);
1118
+ onSave(input, undefined, additionalContext.map(ctx => ctx.type === 'db' ? { type: ctx.type, value: ctx.value } : ctx));
892
1119
  // Reset
893
1120
  setInput('');
894
- setSelectedRules([]);
1121
+ setAdditionalContext([]);
895
1122
  setIsFocused(false);
896
1123
  }
897
1124
  // Escape key cancels editing
@@ -902,10 +1129,10 @@ const ChatInput = ({ initialContent, placeholder, onSave, onCancel, isEditing, c
902
1129
  }
903
1130
  }
904
1131
  } }),
905
- isDropdownVisible && (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_ChatDropdown__WEBPACK_IMPORTED_MODULE_8__["default"], { options: expandedVariables, onSelect: handleOptionSelect, filterText: dropdownFilter }))),
1132
+ isDropdownVisible && (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_ChatDropdown__WEBPACK_IMPORTED_MODULE_9__["default"], { options: expandedVariables, onSelect: handleOptionSelect, filterText: dropdownFilter, isDropdownFromButton: isDropdownFromButton, onFilterChange: setDropdownFilter, onClose: handleDropdownClose }))),
906
1133
  isEditing &&
907
1134
  react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "message-edit-buttons" },
908
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { onClick: () => onSave(input, undefined, selectedRules) }, "Save"),
1135
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { onClick: () => onSave(input, undefined, additionalContext.map(ctx => ctx.type === 'db' ? { type: ctx.type, value: ctx.value } : ctx)) }, "Save"),
909
1136
  react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { onClick: onCancel }, "Cancel"))));
910
1137
  };
911
1138
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ChatInput);
@@ -929,9 +1156,9 @@ __webpack_require__.r(__webpack_exports__);
929
1156
  /* harmony import */ var _UserCodeBlock__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./UserCodeBlock */ "./lib/Extensions/AiChat/ChatMessage/UserCodeBlock.js");
930
1157
  /* harmony import */ var _AssistantCodeBlock__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./AssistantCodeBlock */ "./lib/Extensions/AiChat/ChatMessage/AssistantCodeBlock.js");
931
1158
  /* harmony import */ var _AlertBlock__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./AlertBlock */ "./lib/Extensions/AiChat/ChatMessage/AlertBlock.js");
932
- /* harmony import */ var _MarkdownBlock__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./MarkdownBlock */ "./lib/Extensions/AiChat/ChatMessage/MarkdownBlock.js");
1159
+ /* harmony import */ var _MarkdownBlock__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./MarkdownBlock */ "./lib/Extensions/AiChat/ChatMessage/MarkdownBlock.js");
933
1160
  /* harmony import */ var _utils_strings__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../utils/strings */ "./lib/utils/strings.js");
934
- /* harmony import */ var _icons_Pencil__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../icons/Pencil */ "./lib/icons/Pencil.js");
1161
+ /* harmony import */ var _icons_Pencil__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../icons/Pencil */ "./lib/icons/Pencil.js");
935
1162
  /* harmony import */ var _ChatInput__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ChatInput */ "./lib/Extensions/AiChat/ChatMessage/ChatInput.js");
936
1163
  /* harmony import */ var _components_TextAndIconButton__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../components/TextAndIconButton */ "./lib/components/TextAndIconButton.js");
937
1164
  /* harmony import */ var _icons_PlayButtonIcon__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../icons/PlayButtonIcon */ "./lib/icons/PlayButtonIcon.js");
@@ -940,7 +1167,9 @@ __webpack_require__.r(__webpack_exports__);
940
1167
  /* harmony import */ var _components_TextButton__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../components/TextButton */ "./lib/components/TextButton.js");
941
1168
  /* harmony import */ var _style_ChatMessage_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../style/ChatMessage.css */ "./style/ChatMessage.css");
942
1169
  /* harmony import */ var _style_MarkdownMessage_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../style/MarkdownMessage.css */ "./style/MarkdownMessage.css");
943
- /* harmony import */ var _components_AgentComponents_GetCellOutputToolUI__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../components/AgentComponents/GetCellOutputToolUI */ "./lib/components/AgentComponents/GetCellOutputToolUI.js");
1170
+ /* harmony import */ var _components_AgentComponents_GetCellOutputToolUI__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../components/AgentComponents/GetCellOutputToolUI */ "./lib/components/AgentComponents/GetCellOutputToolUI.js");
1171
+ /* harmony import */ var _components_AgentComponents_AssumptionToolUI__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../components/AgentComponents/AssumptionToolUI */ "./lib/components/AgentComponents/AssumptionToolUI.js");
1172
+ /* harmony import */ var _components_SelectedContextContainer__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../components/SelectedContextContainer */ "./lib/components/SelectedContextContainer.js");
944
1173
  /*
945
1174
  * Copyright (c) Saga Inc.
946
1175
  * Distributed under the terms of the GNU Affero General Public License v3.0 License.
@@ -962,7 +1191,9 @@ __webpack_require__.r(__webpack_exports__);
962
1191
 
963
1192
 
964
1193
 
965
- const ChatMessage = ({ message, messageType, promptType, agentResponse, messageIndex, mitoAIConnectionError, mitoAIConnectionErrorType, notebookTracker, renderMimeRegistry, isLastAiMessage, isLastMessage, operatingSystem, previewAICode, acceptAICode, rejectAICode, onUpdateMessage, contextManager, codeReviewStatus, setNextSteps, agentModeEnabled, }) => {
1194
+
1195
+
1196
+ const ChatMessage = ({ app, message, messageType, promptType, agentResponse, messageIndex, mitoAIConnectionError, mitoAIConnectionErrorType, notebookTracker, renderMimeRegistry, isLastAiMessage, isLastMessage, operatingSystem, previewAICode, acceptAICode, rejectAICode, onUpdateMessage, contextManager, codeReviewStatus, setNextSteps, agentModeEnabled, additionalContext, }) => {
966
1197
  const [isEditing, setIsEditing] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
967
1198
  if (message.role !== 'user' && message.role !== 'assistant') {
968
1199
  return null;
@@ -973,14 +1204,16 @@ const ChatMessage = ({ message, messageType, promptType, agentResponse, messageI
973
1204
  const handleEditClick = () => {
974
1205
  setIsEditing(true);
975
1206
  };
976
- const handleSave = (content) => {
1207
+ const handleSave = (content, _index, _selectedRules, _additionalContext) => {
977
1208
  onUpdateMessage(messageIndex, content, messageType);
978
1209
  setIsEditing(false);
979
1210
  };
980
1211
  const handleCancel = () => {
981
1212
  setIsEditing(false);
982
1213
  };
983
- if (isLastMessage && (agentResponse === null || agentResponse === void 0 ? void 0 : agentResponse.type) === 'finished_task' && agentResponse.next_steps && agentResponse.next_steps.length > 0) {
1214
+ if (isLastMessage && (agentResponse === null || agentResponse === void 0 ? void 0 : agentResponse.type) === 'finished_task' &&
1215
+ agentResponse.next_steps &&
1216
+ agentResponse.next_steps.length > 0) {
984
1217
  /*
985
1218
  We only want to set the next steps if the message is the last message in the chat.
986
1219
  This is because the next steps are only available after the agent has finished its task.
@@ -990,7 +1223,7 @@ const ChatMessage = ({ message, messageType, promptType, agentResponse, messageI
990
1223
  setNextSteps(agentResponse.next_steps);
991
1224
  }
992
1225
  if (isEditing) {
993
- return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_ChatInput__WEBPACK_IMPORTED_MODULE_4__["default"], { initialContent: message.content.replace(/```[\s\S]*?```/g, '').trim(), placeholder: "Edit your message", onSave: handleSave, onCancel: handleCancel, isEditing: isEditing, contextManager: contextManager, notebookTracker: notebookTracker, renderMimeRegistry: renderMimeRegistry, displayActiveCellCode: true, agentModeEnabled: false }));
1226
+ return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_ChatInput__WEBPACK_IMPORTED_MODULE_4__["default"], { app: app, initialContent: message.content.replace(/```[\s\S]*?```/g, '').trim(), placeholder: "Edit your message", onSave: handleSave, onCancel: handleCancel, isEditing: isEditing, contextManager: contextManager, notebookTracker: notebookTracker, renderMimeRegistry: renderMimeRegistry, displayActiveCellCode: true, agentModeEnabled: false }));
994
1227
  }
995
1228
  if (mitoAIConnectionError) {
996
1229
  return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: (0,_utils_classNames__WEBPACK_IMPORTED_MODULE_5__.classNames)("message") },
@@ -1004,6 +1237,7 @@ const ChatMessage = ({ message, messageType, promptType, agentResponse, messageI
1004
1237
  // Users end up applying the code in the middle of streaming and it gets very confusing
1005
1238
  // very quickly for users.
1006
1239
  let isCodeComplete = false;
1240
+ console.log(messageContentParts);
1007
1241
  return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: (0,_utils_classNames__WEBPACK_IMPORTED_MODULE_5__.classNames)("message", { "message-user": message.role === 'user' }, { 'message-assistant-chat': message.role === 'assistant' }) },
1008
1242
  messageContentParts.map((messagePart, index) => {
1009
1243
  var _a, _b;
@@ -1021,7 +1255,9 @@ const ChatMessage = ({ message, messageType, promptType, agentResponse, messageI
1021
1255
  isLastAiMessage && isCodeComplete && codeReviewStatus === 'codeCellPreview' &&
1022
1256
  react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: 'chat-message-buttons' },
1023
1257
  react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_TextButton__WEBPACK_IMPORTED_MODULE_13__["default"], { onClick: () => { acceptAICode(); }, text: `Accept code ${operatingSystem === 'mac' ? '⌘Y' : 'Ctrl+Y'}`, title: 'Accept the Ai generated code', variant: 'green', width: 'fit-contents' }),
1024
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_TextButton__WEBPACK_IMPORTED_MODULE_13__["default"], { onClick: () => { rejectAICode(); }, text: `Reject code ${operatingSystem === 'mac' ? '⌘U' : 'Ctrl+U'}`, title: 'Reject the Ai generated code and revert to the previous version of the code cell', variant: 'red', width: 'fit-contents' }))));
1258
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_TextButton__WEBPACK_IMPORTED_MODULE_13__["default"], { onClick: () => { rejectAICode(); }, text: `Reject code ${operatingSystem === 'mac' ? '⌘U' : 'Ctrl+U'}`, title: 'Reject the Ai generated code and revert to the previous version of the code cell', variant: 'red', width: 'fit-contents' })),
1259
+ message.role === 'user' && additionalContext && additionalContext.length > 0 &&
1260
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, additionalContext.map((context, index) => (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_SelectedContextContainer__WEBPACK_IMPORTED_MODULE_14__["default"], { key: `${context.type}-${context.value}-${index}`, title: `${context.type.charAt(0).toUpperCase() + context.type.slice(1)}: ${context.value}`, type: context.type, onRemove: () => { } }))))));
1025
1261
  }
1026
1262
  else {
1027
1263
  // Return null for empty code blocks
@@ -1037,15 +1273,17 @@ const ChatMessage = ({ message, messageType, promptType, agentResponse, messageI
1037
1273
  }
1038
1274
  } }, message.role === 'user' && promptType === 'smartDebug' ? (
1039
1275
  /* Use a pre tag to preserve the newline and indentation of the error message */
1040
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement("pre", { className: "chat-taskpane-smart-debug-error-message" }, messagePart)) : (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_MarkdownBlock__WEBPACK_IMPORTED_MODULE_14__["default"], { markdown: messagePart, renderMimeRegistry: renderMimeRegistry, notebookTracker: notebookTracker })))));
1276
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("pre", { className: "chat-taskpane-smart-debug-error-message" }, messagePart)) : (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_MarkdownBlock__WEBPACK_IMPORTED_MODULE_15__["default"], { markdown: messagePart, renderMimeRegistry: renderMimeRegistry, notebookTracker: notebookTracker }))),
1277
+ (agentResponse === null || agentResponse === void 0 ? void 0 : agentResponse.analysis_assumptions) &&
1278
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_AgentComponents_AssumptionToolUI__WEBPACK_IMPORTED_MODULE_16__["default"], { assumptions: agentResponse.analysis_assumptions })));
1041
1279
  }
1042
1280
  }),
1043
1281
  editable &&
1044
1282
  react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "message-action-buttons" },
1045
1283
  react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { className: "message-start-editing-button", onClick: handleEditClick, title: "Edit message" },
1046
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_icons_Pencil__WEBPACK_IMPORTED_MODULE_15__["default"], null))),
1284
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_icons_Pencil__WEBPACK_IMPORTED_MODULE_17__["default"], null))),
1047
1285
  (agentResponse === null || agentResponse === void 0 ? void 0 : agentResponse.type) === 'get_cell_output' &&
1048
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_AgentComponents_GetCellOutputToolUI__WEBPACK_IMPORTED_MODULE_16__["default"], null)));
1286
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_AgentComponents_GetCellOutputToolUI__WEBPACK_IMPORTED_MODULE_18__["default"], null)));
1049
1287
  };
1050
1288
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ChatMessage);
1051
1289
 
@@ -1531,39 +1769,40 @@ __webpack_require__.r(__webpack_exports__);
1531
1769
  /* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__);
1532
1770
  /* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @lumino/coreutils */ "webpack/sharing/consume/default/@lumino/coreutils");
1533
1771
  /* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_3__);
1534
- /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../commands */ "./lib/commands.js");
1535
- /* harmony import */ var _components_AgentComponents_ErrorFixupToolUI__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../../components/AgentComponents/ErrorFixupToolUI */ "./lib/components/AgentComponents/ErrorFixupToolUI.js");
1536
- /* harmony import */ var _components_DropdownMenu__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../../components/DropdownMenu */ "./lib/components/DropdownMenu.js");
1537
- /* harmony import */ var _components_IconButton__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../../components/IconButton */ "./lib/components/IconButton.js");
1538
- /* harmony import */ var _components_LoadingCircle__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ../../components/LoadingCircle */ "./lib/components/LoadingCircle.js");
1539
- /* harmony import */ var _components_LoadingDots__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../../components/LoadingDots */ "./lib/components/LoadingDots.js");
1772
+ /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../commands */ "./lib/commands.js");
1773
+ /* harmony import */ var _components_AgentComponents_ErrorFixupToolUI__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../../components/AgentComponents/ErrorFixupToolUI */ "./lib/components/AgentComponents/ErrorFixupToolUI.js");
1774
+ /* harmony import */ var _components_DropdownMenu__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../../components/DropdownMenu */ "./lib/components/DropdownMenu.js");
1775
+ /* harmony import */ var _components_IconButton__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../../components/IconButton */ "./lib/components/IconButton.js");
1776
+ /* harmony import */ var _components_LoadingCircle__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ../../components/LoadingCircle */ "./lib/components/LoadingCircle.js");
1777
+ /* harmony import */ var _components_LoadingDots__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../../components/LoadingDots */ "./lib/components/LoadingDots.js");
1540
1778
  /* harmony import */ var _components_ModelSelector__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../components/ModelSelector */ "./lib/components/ModelSelector.js");
1541
- /* harmony import */ var _components_NextStepsPills__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../../components/NextStepsPills */ "./lib/components/NextStepsPills.js");
1542
- /* harmony import */ var _components_TextAndIconButton__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../../components/TextAndIconButton */ "./lib/components/TextAndIconButton.js");
1543
- /* harmony import */ var _components_ToggleButton__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../../components/ToggleButton */ "./lib/components/ToggleButton.js");
1544
- /* harmony import */ var _icons__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../../icons */ "./lib/icons/index.js");
1545
- /* harmony import */ var _icons_MitoLogo__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../../icons/MitoLogo */ "./lib/icons/MitoLogo.js");
1546
- /* harmony import */ var _icons_UndoIcon__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../../icons/UndoIcon */ "./lib/icons/UndoIcon.js");
1547
- /* harmony import */ var _utils_agentActions__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../utils/agentActions */ "./lib/utils/agentActions.js");
1548
- /* harmony import */ var _utils_blacklistedWords__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../utils/blacklistedWords */ "./lib/utils/blacklistedWords.js");
1549
- /* harmony import */ var _utils_checkpoint__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../utils/checkpoint */ "./lib/utils/checkpoint.js");
1550
- /* harmony import */ var _utils_chatHistory__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../utils/chatHistory */ "./lib/utils/chatHistory.js");
1551
- /* harmony import */ var _utils_codeDiff__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../utils/codeDiff */ "./lib/utils/codeDiff.js");
1552
- /* harmony import */ var _utils_notebook__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../utils/notebook */ "./lib/utils/notebook.js");
1779
+ /* harmony import */ var _components_NextStepsPills__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../../components/NextStepsPills */ "./lib/components/NextStepsPills.js");
1780
+ /* harmony import */ var _components_TextAndIconButton__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../../components/TextAndIconButton */ "./lib/components/TextAndIconButton.js");
1781
+ /* harmony import */ var _components_ToggleButton__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ../../components/ToggleButton */ "./lib/components/ToggleButton.js");
1782
+ /* harmony import */ var _icons__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../../icons */ "./lib/icons/index.js");
1783
+ /* harmony import */ var _icons_MitoLogo__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../../icons/MitoLogo */ "./lib/icons/MitoLogo.js");
1784
+ /* harmony import */ var _icons_UndoIcon__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../../icons/UndoIcon */ "./lib/icons/UndoIcon.js");
1785
+ /* harmony import */ var _utils_agentActions__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../utils/agentActions */ "./lib/utils/agentActions.js");
1786
+ /* harmony import */ var _utils_blacklistedWords__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../utils/blacklistedWords */ "./lib/utils/blacklistedWords.js");
1787
+ /* harmony import */ var _utils_checkpoint__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../utils/checkpoint */ "./lib/utils/checkpoint.js");
1788
+ /* harmony import */ var _utils_chatHistory__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../../utils/chatHistory */ "./lib/utils/chatHistory.js");
1789
+ /* harmony import */ var _utils_codeDiff__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../utils/codeDiff */ "./lib/utils/codeDiff.js");
1790
+ /* harmony import */ var _utils_notebook__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../utils/notebook */ "./lib/utils/notebook.js");
1553
1791
  /* harmony import */ var _utils_scroll__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../utils/scroll */ "./lib/utils/scroll.js");
1554
- /* harmony import */ var _utils_strings__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../utils/strings */ "./lib/utils/strings.js");
1792
+ /* harmony import */ var _utils_strings__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../utils/strings */ "./lib/utils/strings.js");
1555
1793
  /* harmony import */ var _utils_waitForNotebookReady__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../utils/waitForNotebookReady */ "./lib/utils/waitForNotebookReady.js");
1556
- /* harmony import */ var _SettingsManager_SettingsManagerPlugin__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../SettingsManager/SettingsManagerPlugin */ "./lib/Extensions/SettingsManager/SettingsManagerPlugin.js");
1557
- /* harmony import */ var _CTACarousel__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./CTACarousel */ "./lib/Extensions/AiChat/CTACarousel.js");
1558
- /* harmony import */ var _CodeDiffDisplay__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./CodeDiffDisplay */ "./lib/Extensions/AiChat/CodeDiffDisplay.js");
1794
+ /* harmony import */ var _SettingsManager_SettingsManagerPlugin__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../SettingsManager/SettingsManagerPlugin */ "./lib/Extensions/SettingsManager/SettingsManagerPlugin.js");
1795
+ /* harmony import */ var _CTACarousel__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./CTACarousel */ "./lib/Extensions/AiChat/CTACarousel.js");
1796
+ /* harmony import */ var _CodeDiffDisplay__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./CodeDiffDisplay */ "./lib/Extensions/AiChat/CodeDiffDisplay.js");
1559
1797
  /* harmony import */ var _FirstMessage__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./FirstMessage */ "./lib/Extensions/AiChat/FirstMessage.js");
1560
- /* harmony import */ var _ChatMessage_ChatInput__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./ChatMessage/ChatInput */ "./lib/Extensions/AiChat/ChatMessage/ChatInput.js");
1561
- /* harmony import */ var _ChatMessage_ChatMessage__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./ChatMessage/ChatMessage */ "./lib/Extensions/AiChat/ChatMessage/ChatMessage.js");
1562
- /* harmony import */ var _ChatMessage_ScrollableSuggestions__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./ChatMessage/ScrollableSuggestions */ "./lib/Extensions/AiChat/ChatMessage/ScrollableSuggestions.js");
1798
+ /* harmony import */ var _ChatMessage_ChatInput__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./ChatMessage/ChatInput */ "./lib/Extensions/AiChat/ChatMessage/ChatInput.js");
1799
+ /* harmony import */ var _ChatMessage_ChatMessage__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./ChatMessage/ChatMessage */ "./lib/Extensions/AiChat/ChatMessage/ChatMessage.js");
1800
+ /* harmony import */ var _ChatMessage_ScrollableSuggestions__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./ChatMessage/ScrollableSuggestions */ "./lib/Extensions/AiChat/ChatMessage/ScrollableSuggestions.js");
1563
1801
  /* harmony import */ var _ChatHistoryManager__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ChatHistoryManager */ "./lib/Extensions/AiChat/ChatHistoryManager.js");
1564
1802
  /* harmony import */ var _style_button_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../style/button.css */ "./style/button.css");
1565
1803
  /* harmony import */ var _style_ChatTaskpane_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../style/ChatTaskpane.css */ "./style/ChatTaskpane.css");
1566
1804
  /* harmony import */ var _style_TextButton_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../style/TextButton.css */ "./style/TextButton.css");
1805
+ /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./utils */ "./lib/Extensions/AiChat/utils.js");
1567
1806
  /*
1568
1807
  * Copyright (c) Saga Inc.
1569
1808
  * Distributed under the terms of the GNU Affero General Public License v3.0 License.
@@ -1613,6 +1852,7 @@ __webpack_require__.r(__webpack_exports__);
1613
1852
 
1614
1853
 
1615
1854
 
1855
+
1616
1856
  const AGENT_EXECUTION_DEPTH_LIMIT = 20;
1617
1857
  const getDefaultChatHistoryManager = (notebookTracker, contextManager) => {
1618
1858
  const chatHistoryManager = new _ChatHistoryManager__WEBPACK_IMPORTED_MODULE_7__.ChatHistoryManager(contextManager, notebookTracker);
@@ -1982,7 +2222,7 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
1982
2222
  await _sendMessageAndSaveResponse(explainCompletionRequest, newChatHistoryManager);
1983
2223
  // Step 3: No post processing step needed for explaining code.
1984
2224
  };
1985
- const sendAgentExecutionMessage = async (input, messageIndex, sendActiveCellOutput = false, selectedRules) => {
2225
+ const sendAgentExecutionMessage = async (input, messageIndex, sendCellIDOutput = undefined, additionalContext) => {
1986
2226
  // Step 0: reset the state for a new message
1987
2227
  resetForNewMessage();
1988
2228
  // Step 1: Add the user's message to the chat history
@@ -1991,16 +2231,11 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
1991
2231
  // Drop all of the messages starting at the message index
1992
2232
  newChatHistoryManager.dropMessagesStartingAtIndex(messageIndex);
1993
2233
  }
1994
- const agentExecutionMetadata = newChatHistoryManager.addAgentExecutionMessage(activeThreadIdRef.current, input, selectedRules);
2234
+ const agentExecutionMetadata = newChatHistoryManager.addAgentExecutionMessage(activeThreadIdRef.current, input, additionalContext);
1995
2235
  if (messageIndex !== undefined) {
1996
2236
  agentExecutionMetadata.index = messageIndex;
1997
2237
  }
1998
- if (sendActiveCellOutput) {
1999
- const activeCellOutput = await (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_12__.getActiveCellOutput)(notebookTracker);
2000
- if (activeCellOutput !== undefined) {
2001
- agentExecutionMetadata.base64EncodedActiveCellOutput = activeCellOutput;
2002
- }
2003
- }
2238
+ agentExecutionMetadata.base64EncodedActiveCellOutput = await (0,_utils__WEBPACK_IMPORTED_MODULE_12__.getBase64EncodedCellOutput)(notebookTracker, sendCellIDOutput);
2004
2239
  setChatHistoryManager(newChatHistoryManager);
2005
2240
  setLoadingAIResponse(true);
2006
2241
  // Step 2: Send the message to the AI
@@ -2015,7 +2250,7 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
2015
2250
  /*
2016
2251
  Send whatever message is currently in the chat input
2017
2252
  */
2018
- const sendChatInputMessage = async (input, messageIndex, selectedRules) => {
2253
+ const sendChatInputMessage = async (input, messageIndex, additionalContext) => {
2019
2254
  // Step 0: reset the state for a new message
2020
2255
  resetForNewMessage();
2021
2256
  // Enable follow mode when user sends a new message
@@ -2026,7 +2261,7 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
2026
2261
  // Drop all of the messages starting at the message index
2027
2262
  newChatHistoryManager.dropMessagesStartingAtIndex(messageIndex);
2028
2263
  }
2029
- const chatMessageMetadata = await newChatHistoryManager.addChatInputMessage(input, activeThreadIdRef.current, messageIndex, selectedRules);
2264
+ const chatMessageMetadata = await newChatHistoryManager.addChatInputMessage(input, activeThreadIdRef.current, messageIndex, additionalContext);
2030
2265
  setChatHistoryManager(newChatHistoryManager);
2031
2266
  setLoadingAIResponse(true);
2032
2267
  // Yield control briefly to allow React to re-render the UI
@@ -2036,7 +2271,7 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
2036
2271
  // Add the active cell output to the metadata afterwards setting the chatHistoryManager so that
2037
2272
  // we don't have to wait on turning the output into a base64 image before we can add the user's message
2038
2273
  // to the chat.
2039
- const activeCellOutput = await (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_12__.getActiveCellOutput)(notebookTracker);
2274
+ const activeCellOutput = await (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_13__.getActiveCellOutput)(notebookTracker);
2040
2275
  if (activeCellOutput !== undefined) {
2041
2276
  chatMessageMetadata.base64EncodedActiveCellOutput = activeCellOutput;
2042
2277
  }
@@ -2194,8 +2429,8 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
2194
2429
  // Reset agent to idle state
2195
2430
  setAgentExecutionStatus('idle');
2196
2431
  };
2197
- const startAgentExecution = async (input, messageIndex, selectedRules) => {
2198
- await (0,_utils_checkpoint__WEBPACK_IMPORTED_MODULE_13__.createCheckpoint)(app, setHasCheckpoint);
2432
+ const startAgentExecution = async (input, messageIndex, additionalContext) => {
2433
+ await (0,_utils_checkpoint__WEBPACK_IMPORTED_MODULE_14__.createCheckpoint)(app, setHasCheckpoint);
2199
2434
  setAgentExecutionStatus('working');
2200
2435
  // Enable follow mode when user starts agent execution
2201
2436
  setAutoScrollFollowMode(true);
@@ -2203,7 +2438,7 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
2203
2438
  shouldContinueAgentExecution.current = true;
2204
2439
  let isAgentFinished = false;
2205
2440
  let agentExecutionDepth = 1;
2206
- let sendActiveCellOutput = false;
2441
+ let sendCellIDOutput = undefined;
2207
2442
  // Loop through each message in the plan and send it to the AI
2208
2443
  while (!isAgentFinished && agentExecutionDepth <= AGENT_EXECUTION_DEPTH_LIMIT) {
2209
2444
  // Check if we should continue execution
@@ -2214,12 +2449,12 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
2214
2449
  // Only the first message sent to the Agent should contain the user's input.
2215
2450
  // All other messages only contain updated information about the state of the notebook.
2216
2451
  if (agentExecutionDepth === 1) {
2217
- await sendAgentExecutionMessage(input, messageIndex, false, selectedRules);
2452
+ await sendAgentExecutionMessage(input, messageIndex, undefined, additionalContext);
2218
2453
  }
2219
2454
  else {
2220
- await sendAgentExecutionMessage('', undefined, sendActiveCellOutput);
2455
+ await sendAgentExecutionMessage('', undefined, sendCellIDOutput);
2221
2456
  // Reset flag back to false until the agent requests the active cell output again
2222
- sendActiveCellOutput = false;
2457
+ sendCellIDOutput = undefined;
2223
2458
  }
2224
2459
  // Iterate the agent execution depth
2225
2460
  agentExecutionDepth++;
@@ -2227,9 +2462,9 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
2227
2462
  const aiDisplayOptimizedChatItem = chatHistoryManagerRef.current.getLastAIDisplayOptimizedChatItem();
2228
2463
  // # TODO: Make this is a helper function so we can also use it in the auto error fixup!
2229
2464
  if (aiDisplayOptimizedChatItem) {
2230
- const aiGeneratedCode = (0,_utils_strings__WEBPACK_IMPORTED_MODULE_14__.getCodeBlockFromMessage)(aiDisplayOptimizedChatItem.message);
2465
+ const aiGeneratedCode = (0,_utils_strings__WEBPACK_IMPORTED_MODULE_15__.getCodeBlockFromMessage)(aiDisplayOptimizedChatItem.message);
2231
2466
  if (aiGeneratedCode) {
2232
- const securityCheck = (0,_utils_blacklistedWords__WEBPACK_IMPORTED_MODULE_15__.checkForBlacklistedWords)(aiGeneratedCode);
2467
+ const securityCheck = (0,_utils_blacklistedWords__WEBPACK_IMPORTED_MODULE_16__.checkForBlacklistedWords)(aiGeneratedCode);
2233
2468
  if (!securityCheck.safe) {
2234
2469
  console.error('Security Warning:', securityCheck.reason);
2235
2470
  addAIMessageFromResponseAndUpdateState(`I cannot execute this code without your approval because this code did not pass my security checks. ${securityCheck.reason}. For your safety, I am stopping execution of this plan.`, 'agent:execution', chatHistoryManager);
@@ -2256,8 +2491,8 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
2256
2491
  }
2257
2492
  if (agentResponse.type === 'cell_update' && agentResponse.cell_update) {
2258
2493
  // Run the code and handle any errors
2259
- await (0,_utils_agentActions__WEBPACK_IMPORTED_MODULE_16__.acceptAndRunCellUpdate)(agentResponse.cell_update, notebookTracker, app, previewAICodeToActiveCell, acceptAICode);
2260
- const status = await (0,_utils_agentActions__WEBPACK_IMPORTED_MODULE_16__.retryIfExecutionError)(notebookTracker, app, getDuplicateChatHistoryManager, addAIMessageFromResponseAndUpdateState, sendAgentSmartDebugMessage, previewAICodeToActiveCell, acceptAICode, shouldContinueAgentExecution, finalizeAgentStop, chatHistoryManagerRef);
2494
+ await (0,_utils_agentActions__WEBPACK_IMPORTED_MODULE_17__.acceptAndRunCellUpdate)(agentResponse.cell_update, notebookTracker, app, previewAICodeToActiveCell, acceptAICode);
2495
+ const status = await (0,_utils_agentActions__WEBPACK_IMPORTED_MODULE_17__.retryIfExecutionError)(notebookTracker, app, getDuplicateChatHistoryManager, addAIMessageFromResponseAndUpdateState, sendAgentSmartDebugMessage, previewAICodeToActiveCell, acceptAICode, shouldContinueAgentExecution, finalizeAgentStop, chatHistoryManagerRef);
2261
2496
  if (status === 'interupted') {
2262
2497
  break;
2263
2498
  }
@@ -2272,9 +2507,9 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
2272
2507
  }
2273
2508
  }
2274
2509
  if (agentResponse.type === 'get_cell_output') {
2275
- // Mark that we should send the active cell output to the agent
2510
+ // Mark that we should send the cell output to the agent
2276
2511
  // in the next loop iteration
2277
- sendActiveCellOutput = true;
2512
+ sendCellIDOutput = agentResponse.cell_id;
2278
2513
  }
2279
2514
  }
2280
2515
  if (agentExecutionDepth > AGENT_EXECUTION_DEPTH_LIMIT) {
@@ -2286,33 +2521,33 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
2286
2521
  if (!aiMessage) {
2287
2522
  return;
2288
2523
  }
2289
- const updateCellCode = (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_12__.getCellCodeByID)(notebookTracker, updateCellID);
2524
+ const updateCellCode = (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_13__.getCellCodeByID)(notebookTracker, updateCellID);
2290
2525
  if (updateCellID === undefined || updateCellCode === undefined) {
2291
2526
  return;
2292
2527
  }
2293
2528
  // Extract the code from the AI's message and then calculate the code diffs
2294
- const aiGeneratedCode = (0,_utils_strings__WEBPACK_IMPORTED_MODULE_14__.getCodeBlockFromMessage)(aiMessage);
2295
- const aiGeneratedCodeCleaned = (0,_utils_strings__WEBPACK_IMPORTED_MODULE_14__.removeMarkdownCodeFormatting)(aiGeneratedCode || '');
2296
- const { unifiedCodeString, unifiedDiffs } = (0,_utils_codeDiff__WEBPACK_IMPORTED_MODULE_17__.getCodeDiffsAndUnifiedCodeString)(updateCellCode, aiGeneratedCodeCleaned);
2529
+ const aiGeneratedCode = (0,_utils_strings__WEBPACK_IMPORTED_MODULE_15__.getCodeBlockFromMessage)(aiMessage);
2530
+ const aiGeneratedCodeCleaned = (0,_utils_strings__WEBPACK_IMPORTED_MODULE_15__.removeMarkdownCodeFormatting)(aiGeneratedCode || '');
2531
+ const { unifiedCodeString, unifiedDiffs } = (0,_utils_codeDiff__WEBPACK_IMPORTED_MODULE_18__.getCodeDiffsAndUnifiedCodeString)(updateCellCode, aiGeneratedCodeCleaned);
2297
2532
  // Store the code cell ID where we write the code diffs so that we can
2298
2533
  // accept or reject the code diffs to the correct cell
2299
2534
  cellStateBeforeDiff.current = { codeCellID: updateCellID, code: updateCellCode };
2300
2535
  // Temporarily write the unified code string to the active cell so we can display
2301
2536
  // the code diffs to the user
2302
- (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_12__.writeCodeToCellByID)(notebookTracker, unifiedCodeString, updateCellID);
2537
+ (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_13__.writeCodeToCellByID)(notebookTracker, unifiedCodeString, updateCellID);
2303
2538
  updateCodeCellsExtensions(unifiedDiffs);
2304
2539
  // Briefly highlight the code cell to draw the user's attention to it
2305
- (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_12__.highlightCodeCell)(notebookTracker, updateCellID);
2540
+ (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_13__.highlightCodeCell)(notebookTracker, updateCellID);
2306
2541
  };
2307
2542
  const displayOptimizedChatHistory = chatHistoryManager.getDisplayOptimizedHistory();
2308
2543
  const previewAICodeToActiveCell = () => {
2309
2544
  setCodeReviewStatus('codeCellPreview');
2310
- const activeCellID = (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_12__.getActiveCellID)(notebookTracker);
2545
+ const activeCellID = (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_13__.getActiveCellID)(notebookTracker);
2311
2546
  const lastAIDisplayMessage = chatHistoryManagerRef.current.getLastAIDisplayOptimizedChatItem();
2312
2547
  if (activeCellID === undefined || lastAIDisplayMessage === undefined) {
2313
2548
  return;
2314
2549
  }
2315
- (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_12__.scrollToCell)(notebookTracker, activeCellID, undefined, 'end');
2550
+ (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_13__.scrollToCell)(notebookTracker, activeCellID, undefined, 'end');
2316
2551
  updateCodeDiffStripes(lastAIDisplayMessage.message, activeCellID);
2317
2552
  updateCellToolbarButtons();
2318
2553
  };
@@ -2322,7 +2557,7 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
2322
2557
  if (!lastAIMessage || !cellStateBeforeDiff.current) {
2323
2558
  return;
2324
2559
  }
2325
- const aiGeneratedCode = (0,_utils_strings__WEBPACK_IMPORTED_MODULE_14__.getCodeBlockFromMessage)(lastAIMessage.message);
2560
+ const aiGeneratedCode = (0,_utils_strings__WEBPACK_IMPORTED_MODULE_15__.getCodeBlockFromMessage)(lastAIMessage.message);
2326
2561
  if (!aiGeneratedCode) {
2327
2562
  return;
2328
2563
  }
@@ -2331,10 +2566,10 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
2331
2566
  // Write to the cell that has the code diffs
2332
2567
  writeCodeToCellAndTurnOffDiffs(aiGeneratedCode, targetCellID);
2333
2568
  // Focus on the active cell after the code is written
2334
- const targetCell = (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_12__.getCellByID)(notebookTracker, targetCellID);
2569
+ const targetCell = (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_13__.getCellByID)(notebookTracker, targetCellID);
2335
2570
  if (targetCell) {
2336
2571
  // Make the target cell the active cell
2337
- (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_12__.setActiveCellByID)(notebookTracker, targetCellID);
2572
+ (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_13__.setActiveCellByID)(notebookTracker, targetCellID);
2338
2573
  // Focus on the active cell
2339
2574
  targetCell.activate();
2340
2575
  }
@@ -2359,7 +2594,7 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
2359
2594
  updateCodeCellsExtensions(undefined);
2360
2595
  cellStateBeforeDiff.current = undefined;
2361
2596
  if (codeCellID !== undefined) {
2362
- (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_12__.writeCodeToCellByID)(notebookTracker, code, codeCellID);
2597
+ (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_13__.writeCodeToCellByID)(notebookTracker, code, codeCellID);
2363
2598
  updateCellToolbarButtons();
2364
2599
  }
2365
2600
  };
@@ -2370,17 +2605,17 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
2370
2605
  the first time we create the chat. Registering the command when it is already created causes
2371
2606
  errors.
2372
2607
  */
2373
- app.commands.addCommand(_commands__WEBPACK_IMPORTED_MODULE_18__.COMMAND_MITO_AI_PREVIEW_LATEST_CODE, {
2608
+ app.commands.addCommand(_commands__WEBPACK_IMPORTED_MODULE_19__.COMMAND_MITO_AI_PREVIEW_LATEST_CODE, {
2374
2609
  execute: () => {
2375
2610
  previewAICodeToActiveCell();
2376
2611
  }
2377
2612
  });
2378
- app.commands.addCommand(_commands__WEBPACK_IMPORTED_MODULE_18__.COMMAND_MITO_AI_APPLY_LATEST_CODE, {
2613
+ app.commands.addCommand(_commands__WEBPACK_IMPORTED_MODULE_19__.COMMAND_MITO_AI_APPLY_LATEST_CODE, {
2379
2614
  execute: () => {
2380
2615
  acceptAICode();
2381
2616
  }
2382
2617
  });
2383
- app.commands.addCommand(_commands__WEBPACK_IMPORTED_MODULE_18__.COMMAND_MITO_AI_REJECT_LATEST_CODE, {
2618
+ app.commands.addCommand(_commands__WEBPACK_IMPORTED_MODULE_19__.COMMAND_MITO_AI_REJECT_LATEST_CODE, {
2384
2619
  execute: () => {
2385
2620
  rejectAICode();
2386
2621
  }
@@ -2389,19 +2624,19 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
2389
2624
  Add a new command to the JupyterLab command registry that sends the current chat message.
2390
2625
  We use this to automatically send the message when the user adds an error to the chat.
2391
2626
  */
2392
- app.commands.addCommand(_commands__WEBPACK_IMPORTED_MODULE_18__.COMMAND_MITO_AI_SEND_DEBUG_ERROR_MESSAGE, {
2627
+ app.commands.addCommand(_commands__WEBPACK_IMPORTED_MODULE_19__.COMMAND_MITO_AI_SEND_DEBUG_ERROR_MESSAGE, {
2393
2628
  execute: async (args) => {
2394
2629
  if (args === null || args === void 0 ? void 0 : args.input) {
2395
2630
  await sendSmartDebugMessage(args.input.toString());
2396
2631
  }
2397
2632
  }
2398
2633
  });
2399
- app.commands.addCommand(_commands__WEBPACK_IMPORTED_MODULE_18__.COMMAND_MITO_AI_SEND_EXPLAIN_CODE_MESSAGE, {
2634
+ app.commands.addCommand(_commands__WEBPACK_IMPORTED_MODULE_19__.COMMAND_MITO_AI_SEND_EXPLAIN_CODE_MESSAGE, {
2400
2635
  execute: async () => {
2401
2636
  await sendExplainCodeMessage();
2402
2637
  }
2403
2638
  });
2404
- app.commands.addCommand(_commands__WEBPACK_IMPORTED_MODULE_18__.COMMAND_MITO_AI_SEND_AGENT_MESSAGE, {
2639
+ app.commands.addCommand(_commands__WEBPACK_IMPORTED_MODULE_19__.COMMAND_MITO_AI_SEND_AGENT_MESSAGE, {
2405
2640
  execute: async (args) => {
2406
2641
  if (args === null || args === void 0 ? void 0 : args.input) {
2407
2642
  // Make sure we're in agent mode
@@ -2420,7 +2655,7 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
2420
2655
  /*
2421
2656
  Register the code cell toolbar buttons for accepting and rejecting code.
2422
2657
  */
2423
- app.commands.addCommand(_commands__WEBPACK_IMPORTED_MODULE_18__.COMMAND_MITO_AI_CELL_TOOLBAR_ACCEPT_CODE, {
2658
+ app.commands.addCommand(_commands__WEBPACK_IMPORTED_MODULE_19__.COMMAND_MITO_AI_CELL_TOOLBAR_ACCEPT_CODE, {
2424
2659
  label: `Accept ${operatingSystem === 'mac' ? '⌘Y' : 'Ctrl+Y'}`,
2425
2660
  className: 'text-button-mito-ai button-base button-green',
2426
2661
  caption: 'Accept Code',
@@ -2438,7 +2673,7 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
2438
2673
  }
2439
2674
  }
2440
2675
  });
2441
- app.commands.addCommand(_commands__WEBPACK_IMPORTED_MODULE_18__.COMMAND_MITO_AI_CELL_TOOLBAR_REJECT_CODE, {
2676
+ app.commands.addCommand(_commands__WEBPACK_IMPORTED_MODULE_19__.COMMAND_MITO_AI_CELL_TOOLBAR_REJECT_CODE, {
2442
2677
  label: `Reject ${operatingSystem === 'mac' ? '⌘U' : 'Ctrl+U'}`,
2443
2678
  className: 'text-button-mito-ai button-base button-red',
2444
2679
  caption: 'Reject Code',
@@ -2459,13 +2694,13 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
2459
2694
  // Register keyboard shortcuts
2460
2695
  const accelYDisposable = app.commands.addKeyBinding({
2461
2696
  command: codeReviewStatus === 'chatPreview' ?
2462
- _commands__WEBPACK_IMPORTED_MODULE_18__.COMMAND_MITO_AI_PREVIEW_LATEST_CODE :
2463
- _commands__WEBPACK_IMPORTED_MODULE_18__.COMMAND_MITO_AI_APPLY_LATEST_CODE,
2697
+ _commands__WEBPACK_IMPORTED_MODULE_19__.COMMAND_MITO_AI_PREVIEW_LATEST_CODE :
2698
+ _commands__WEBPACK_IMPORTED_MODULE_19__.COMMAND_MITO_AI_APPLY_LATEST_CODE,
2464
2699
  keys: ['Accel Y'],
2465
2700
  selector: 'body',
2466
2701
  });
2467
2702
  const accelDDisposable = app.commands.addKeyBinding({
2468
- command: _commands__WEBPACK_IMPORTED_MODULE_18__.COMMAND_MITO_AI_REJECT_LATEST_CODE,
2703
+ command: _commands__WEBPACK_IMPORTED_MODULE_19__.COMMAND_MITO_AI_REJECT_LATEST_CODE,
2469
2704
  keys: ['Accel U'],
2470
2705
  selector: 'body',
2471
2706
  preventDefault: true,
@@ -2482,8 +2717,8 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
2482
2717
  // Without this, the user needs to take some action, like switching to a different cell
2483
2718
  // and then switching back in order for the Jupyter to re-evaluate if it should
2484
2719
  // show the toolbar buttons.
2485
- app.commands.notifyCommandChanged(_commands__WEBPACK_IMPORTED_MODULE_18__.COMMAND_MITO_AI_CELL_TOOLBAR_ACCEPT_CODE);
2486
- app.commands.notifyCommandChanged(_commands__WEBPACK_IMPORTED_MODULE_18__.COMMAND_MITO_AI_CELL_TOOLBAR_REJECT_CODE);
2720
+ app.commands.notifyCommandChanged(_commands__WEBPACK_IMPORTED_MODULE_19__.COMMAND_MITO_AI_CELL_TOOLBAR_ACCEPT_CODE);
2721
+ app.commands.notifyCommandChanged(_commands__WEBPACK_IMPORTED_MODULE_19__.COMMAND_MITO_AI_CELL_TOOLBAR_REJECT_CODE);
2487
2722
  };
2488
2723
  const codeDiffStripesCompartments = react__WEBPACK_IMPORTED_MODULE_1___default().useRef(new Map());
2489
2724
  // Function to update the extensions of code cells
@@ -2511,13 +2746,13 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
2511
2746
  codeDiffStripesCompartments.current.set(cellId, compartment);
2512
2747
  // Apply the initial configuration
2513
2748
  editorView.dispatch({
2514
- effects: _codemirror_state__WEBPACK_IMPORTED_MODULE_0__.StateEffect.appendConfig.of(compartment.of(unifiedDiffLines !== undefined && isActiveCodeCell ? (0,_CodeDiffDisplay__WEBPACK_IMPORTED_MODULE_19__.codeDiffStripesExtension)({ unifiedDiffLines: unifiedDiffLines }) : [])),
2749
+ effects: _codemirror_state__WEBPACK_IMPORTED_MODULE_0__.StateEffect.appendConfig.of(compartment.of(unifiedDiffLines !== undefined && isActiveCodeCell ? (0,_CodeDiffDisplay__WEBPACK_IMPORTED_MODULE_20__.codeDiffStripesExtension)({ unifiedDiffLines: unifiedDiffLines }) : [])),
2515
2750
  });
2516
2751
  }
2517
2752
  else {
2518
2753
  // Reconfigure the compartment
2519
2754
  editorView.dispatch({
2520
- effects: compartment.reconfigure(unifiedDiffLines !== undefined && isActiveCodeCell ? (0,_CodeDiffDisplay__WEBPACK_IMPORTED_MODULE_19__.codeDiffStripesExtension)({ unifiedDiffLines: unifiedDiffLines }) : []),
2755
+ effects: compartment.reconfigure(unifiedDiffLines !== undefined && isActiveCodeCell ? (0,_CodeDiffDisplay__WEBPACK_IMPORTED_MODULE_20__.codeDiffStripesExtension)({ unifiedDiffLines: unifiedDiffLines }) : []),
2521
2756
  });
2522
2757
  }
2523
2758
  }
@@ -2532,7 +2767,7 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
2532
2767
  // In agent mode, we group consecutive error messages together.
2533
2768
  // In chat mode, we display messages individually as they were sent
2534
2769
  if (agentModeEnabled) {
2535
- processedDisplayOptimizedChatHistory = (0,_utils_chatHistory__WEBPACK_IMPORTED_MODULE_20__.processChatHistoryForErrorGrouping)(chatHistoryManager.getDisplayOptimizedHistory());
2770
+ processedDisplayOptimizedChatHistory = (0,_utils_chatHistory__WEBPACK_IMPORTED_MODULE_21__.processChatHistoryForErrorGrouping)(chatHistoryManager.getDisplayOptimizedHistory());
2536
2771
  }
2537
2772
  else {
2538
2773
  processedDisplayOptimizedChatHistory = chatHistoryManager.getDisplayOptimizedHistory();
@@ -2544,16 +2779,16 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
2544
2779
  return (react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: "chat-taskpane" },
2545
2780
  react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: "chat-taskpane-header" },
2546
2781
  react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: "chat-taskpane-header-left" },
2547
- react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_IconButton__WEBPACK_IMPORTED_MODULE_21__["default"], { icon: react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__.settingsIcon.react, null), title: "Mito AI Settings", onClick: () => {
2548
- void app.commands.execute(_SettingsManager_SettingsManagerPlugin__WEBPACK_IMPORTED_MODULE_22__.COMMAND_MITO_AI_SETTINGS);
2782
+ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_IconButton__WEBPACK_IMPORTED_MODULE_22__["default"], { icon: react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__.settingsIcon.react, null), title: "Mito AI Settings", onClick: () => {
2783
+ void app.commands.execute(_SettingsManager_SettingsManagerPlugin__WEBPACK_IMPORTED_MODULE_23__.COMMAND_MITO_AI_SETTINGS);
2549
2784
  } })),
2550
2785
  react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: "chat-taskpane-header-right" },
2551
- react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_IconButton__WEBPACK_IMPORTED_MODULE_21__["default"], { icon: react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__.addIcon.react, null), title: "Start New Chat", onClick: async () => { await startNewChat(); } }),
2552
- react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_DropdownMenu__WEBPACK_IMPORTED_MODULE_23__["default"], { trigger: react__WEBPACK_IMPORTED_MODULE_1___default().createElement("button", { className: "icon-button", title: "Chat Threads", onClick: fetchChatThreads },
2786
+ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_IconButton__WEBPACK_IMPORTED_MODULE_22__["default"], { icon: react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__.addIcon.react, null), title: "Start New Chat", onClick: async () => { await startNewChat(); } }),
2787
+ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_DropdownMenu__WEBPACK_IMPORTED_MODULE_24__["default"], { trigger: react__WEBPACK_IMPORTED_MODULE_1___default().createElement("button", { className: "icon-button", title: "Chat Threads", onClick: fetchChatThreads },
2553
2788
  react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__.historyIcon.react, null)), items: chatThreads.length > 0
2554
2789
  ? chatThreads.map(thread => ({
2555
2790
  label: thread.name,
2556
- primaryIcon: activeThreadIdRef.current === thread.thread_id ? _icons__WEBPACK_IMPORTED_MODULE_24__.OpenIndicatorLabIcon.react : undefined,
2791
+ primaryIcon: activeThreadIdRef.current === thread.thread_id ? _icons__WEBPACK_IMPORTED_MODULE_25__.OpenIndicatorLabIcon.react : undefined,
2557
2792
  onClick: () => fetchChatHistoryAndSetActiveThread(thread.thread_id),
2558
2793
  secondaryActions: [
2559
2794
  {
@@ -2572,29 +2807,29 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
2572
2807
  displayOptimizedChatHistory.length === 0 &&
2573
2808
  react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: "chat-empty-message" },
2574
2809
  react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { style: { margin: '0 auto 8px', display: 'block', textAlign: 'center' } },
2575
- react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_icons_MitoLogo__WEBPACK_IMPORTED_MODULE_25__["default"], { width: "60", height: "30" })),
2810
+ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_icons_MitoLogo__WEBPACK_IMPORTED_MODULE_26__["default"], { width: "60", height: "30" })),
2576
2811
  react__WEBPACK_IMPORTED_MODULE_1___default().createElement("span", { style: { display: 'block', textAlign: 'center', fontWeight: 'bold', fontSize: '20px', marginBottom: '15px' } }, "Data Copilot"),
2577
- react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_CTACarousel__WEBPACK_IMPORTED_MODULE_26__["default"], { app: app })),
2812
+ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_CTACarousel__WEBPACK_IMPORTED_MODULE_27__["default"], { app: app })),
2578
2813
  processedDisplayOptimizedChatHistory.map((displayOptimizedChat, index) => {
2579
2814
  if (isGroupedErrorMessages(displayOptimizedChat)) {
2580
- return (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_AgentComponents_ErrorFixupToolUI__WEBPACK_IMPORTED_MODULE_27__["default"], { key: index, messages: displayOptimizedChat, renderMimeRegistry: renderMimeRegistry }));
2815
+ return (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_AgentComponents_ErrorFixupToolUI__WEBPACK_IMPORTED_MODULE_28__["default"], { key: index, messages: displayOptimizedChat, renderMimeRegistry: renderMimeRegistry }));
2581
2816
  }
2582
2817
  else {
2583
- return (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_ChatMessage_ChatMessage__WEBPACK_IMPORTED_MODULE_28__["default"], { key: index, message: displayOptimizedChat.message, promptType: displayOptimizedChat.promptType, messageType: displayOptimizedChat.type, agentResponse: displayOptimizedChat.agentResponse, codeCellID: displayOptimizedChat.codeCellID, mitoAIConnectionError: displayOptimizedChat.type === 'connection error', mitoAIConnectionErrorType: displayOptimizedChat.mitoAIConnectionErrorType || null, messageIndex: index, notebookTracker: notebookTracker, renderMimeRegistry: renderMimeRegistry, app: app, isLastAiMessage: index === lastAIMessagesIndex, isLastMessage: index === displayOptimizedChatHistory.length - 1, operatingSystem: operatingSystem, previewAICode: previewAICodeToActiveCell, acceptAICode: acceptAICode, rejectAICode: rejectAICode, onUpdateMessage: handleUpdateMessage, contextManager: contextManager, codeReviewStatus: codeReviewStatus, setNextSteps: setNextSteps, agentModeEnabled: agentModeEnabled }));
2818
+ return (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_ChatMessage_ChatMessage__WEBPACK_IMPORTED_MODULE_29__["default"], { key: index, message: displayOptimizedChat.message, promptType: displayOptimizedChat.promptType, messageType: displayOptimizedChat.type, agentResponse: displayOptimizedChat.agentResponse, codeCellID: displayOptimizedChat.codeCellID, mitoAIConnectionError: displayOptimizedChat.type === 'connection error', mitoAIConnectionErrorType: displayOptimizedChat.mitoAIConnectionErrorType || null, messageIndex: index, notebookTracker: notebookTracker, renderMimeRegistry: renderMimeRegistry, app: app, isLastAiMessage: index === lastAIMessagesIndex, isLastMessage: index === displayOptimizedChatHistory.length - 1, operatingSystem: operatingSystem, previewAICode: previewAICodeToActiveCell, acceptAICode: acceptAICode, rejectAICode: rejectAICode, onUpdateMessage: handleUpdateMessage, contextManager: contextManager, codeReviewStatus: codeReviewStatus, setNextSteps: setNextSteps, agentModeEnabled: agentModeEnabled, additionalContext: displayOptimizedChat.additionalContext }));
2584
2819
  }
2585
2820
  }).filter(message => message !== null),
2586
2821
  loadingAIResponse &&
2587
2822
  react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: "chat-loading-message" },
2588
2823
  "Thinking ",
2589
- react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_LoadingDots__WEBPACK_IMPORTED_MODULE_29__["default"], null)),
2824
+ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_LoadingDots__WEBPACK_IMPORTED_MODULE_30__["default"], null)),
2590
2825
  hasCheckpoint &&
2591
2826
  agentModeEnabled &&
2592
2827
  agentExecutionStatus === 'idle' &&
2593
2828
  displayOptimizedChatHistory.length > 0 && (react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: 'message message-assistant-chat' },
2594
- react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_TextAndIconButton__WEBPACK_IMPORTED_MODULE_30__["default"], { text: "Revert changes", icon: _icons_UndoIcon__WEBPACK_IMPORTED_MODULE_31__["default"], title: "Revert changes", onClick: () => (0,_utils_checkpoint__WEBPACK_IMPORTED_MODULE_13__.restoreCheckpoint)(app, notebookTracker, setHasCheckpoint, getDuplicateChatHistoryManager, setChatHistoryManager), variant: "gray", width: "fit-contents", iconPosition: "left" }),
2829
+ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_TextAndIconButton__WEBPACK_IMPORTED_MODULE_31__["default"], { text: "Revert changes", icon: _icons_UndoIcon__WEBPACK_IMPORTED_MODULE_32__["default"], title: "Revert changes", onClick: () => (0,_utils_checkpoint__WEBPACK_IMPORTED_MODULE_14__.restoreCheckpoint)(app, notebookTracker, setHasCheckpoint, getDuplicateChatHistoryManager, setChatHistoryManager), variant: "gray", width: "fit-contents", iconPosition: "left" }),
2595
2830
  react__WEBPACK_IMPORTED_MODULE_1___default().createElement("p", { className: "text-muted text-sm" }, "Undo the most recent changes made by the agent")))),
2596
2831
  displayOptimizedChatHistory.length === 0 && (react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: "suggestions-container" },
2597
- react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_ChatMessage_ScrollableSuggestions__WEBPACK_IMPORTED_MODULE_32__["default"], { onSelectSuggestion: (prompt) => {
2832
+ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_ChatMessage_ScrollableSuggestions__WEBPACK_IMPORTED_MODULE_33__["default"], { onSelectSuggestion: (prompt) => {
2598
2833
  if (agentModeEnabled) {
2599
2834
  void startAgentExecution(prompt);
2600
2835
  }
@@ -2603,15 +2838,15 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
2603
2838
  }
2604
2839
  } }))),
2605
2840
  react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: `connected-input-container ${nextSteps.length > 0 ? 'has-next-steps' : ''}` },
2606
- nextSteps.length > 0 && (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_NextStepsPills__WEBPACK_IMPORTED_MODULE_33__["default"], { nextSteps: nextSteps, onSelectNextStep: agentModeEnabled ? startAgentExecution : sendChatInputMessage, displayedNextStepsIfAvailable: displayedNextStepsIfAvailable, setDisplayedNextStepsIfAvailable: setDisplayedNextStepsIfAvailable })),
2607
- react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_ChatMessage_ChatInput__WEBPACK_IMPORTED_MODULE_34__["default"], { initialContent: '', placeholder: agentExecutionStatus === 'working' ? 'Agent is working...' :
2841
+ nextSteps.length > 0 && (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_NextStepsPills__WEBPACK_IMPORTED_MODULE_34__["default"], { nextSteps: nextSteps, onSelectNextStep: agentModeEnabled ? startAgentExecution : sendChatInputMessage, displayedNextStepsIfAvailable: displayedNextStepsIfAvailable, setDisplayedNextStepsIfAvailable: setDisplayedNextStepsIfAvailable })),
2842
+ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_ChatMessage_ChatInput__WEBPACK_IMPORTED_MODULE_35__["default"], { app: app, initialContent: '', placeholder: agentExecutionStatus === 'working' ? 'Agent is working...' :
2608
2843
  agentExecutionStatus === 'stopping' ? 'Agent is stopping...' :
2609
2844
  agentModeEnabled ? 'Ask agent to do anything' :
2610
2845
  displayOptimizedChatHistory.length < 2 ? `Ask question (${operatingSystem === 'mac' ? '⌘' : 'Ctrl'}E), @ to mention`
2611
2846
  : `Ask followup (${operatingSystem === 'mac' ? '⌘' : 'Ctrl'}E), @ to mention`, onSave: agentModeEnabled ? startAgentExecution : sendChatInputMessage, onCancel: undefined, isEditing: false, contextManager: contextManager, notebookTracker: notebookTracker, renderMimeRegistry: renderMimeRegistry, agentModeEnabled: agentModeEnabled })),
2612
2847
  agentExecutionStatus !== 'working' && agentExecutionStatus !== 'stopping' && (react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: "chat-controls" },
2613
2848
  react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: "chat-controls-left" },
2614
- react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_ToggleButton__WEBPACK_IMPORTED_MODULE_35__["default"], { leftText: "Chat", leftTooltip: "Chat mode suggests an edit to the active cell and let's you decide to accept or reject it.", rightText: "Agent", rightTooltip: "Agent mode writes and executes code until it's finished your request.", isLeftSelected: !agentModeEnabled, onChange: async (isLeftSelected) => {
2849
+ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_ToggleButton__WEBPACK_IMPORTED_MODULE_36__["default"], { leftText: "Chat", leftTooltip: "Chat mode suggests an edit to the active cell and let's you decide to accept or reject it.", rightText: "Agent", rightTooltip: "Agent mode writes and executes code until it's finished your request.", isLeftSelected: !agentModeEnabled, onChange: async (isLeftSelected) => {
2615
2850
  await startNewChat(); // TODO: delete thread instead of starting new chat
2616
2851
  setAgentModeEnabled(!isLeftSelected);
2617
2852
  // Clear agent checkpoint when switching modes
@@ -2646,7 +2881,7 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
2646
2881
  " \u23CE"))),
2647
2882
  (agentExecutionStatus === 'working' || agentExecutionStatus === 'stopping') && (react__WEBPACK_IMPORTED_MODULE_1___default().createElement("button", { className: "button-base button-red stop-agent-button", onClick: markAgentForStopping, disabled: agentExecutionStatus === 'stopping', "data-testid": "stop-agent-button" }, agentExecutionStatus === 'stopping' ? (react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: "stop-agent-button-content" },
2648
2883
  "Stopping",
2649
- react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_LoadingCircle__WEBPACK_IMPORTED_MODULE_36__["default"], null),
2884
+ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_LoadingCircle__WEBPACK_IMPORTED_MODULE_37__["default"], null),
2650
2885
  " ")) : ('Stop Agent')))));
2651
2886
  };
2652
2887
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ChatTaskpane);
@@ -2920,6 +3155,37 @@ const getFirstMessageFromCookie = () => {
2920
3155
  };
2921
3156
 
2922
3157
 
3158
+ /***/ }),
3159
+
3160
+ /***/ "./lib/Extensions/AiChat/jupyterSettingsManager.js":
3161
+ /*!*********************************************************!*\
3162
+ !*** ./lib/Extensions/AiChat/jupyterSettingsManager.js ***!
3163
+ \*********************************************************/
3164
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3165
+
3166
+ __webpack_require__.r(__webpack_exports__);
3167
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3168
+ /* harmony export */ setRenameUntitledFileOnSave: () => (/* binding */ setRenameUntitledFileOnSave)
3169
+ /* harmony export */ });
3170
+ /*
3171
+ * Copyright (c) Saga Inc.
3172
+ * Distributed under the terms of the GNU Affero General Public License v3.0 License.
3173
+ */
3174
+ // Document manager plugin ID
3175
+ const DOCMANAGER_PLUGIN_ID = '@jupyterlab/docmanager-extension:plugin';
3176
+ // Set renameUntitledFileOnSave to false when the extension loads
3177
+ const setRenameUntitledFileOnSave = async (settingRegistry, _documentManager) => {
3178
+ // Note we don't use the documentManager, but we require it as a parameter to make sure
3179
+ // that we leave the documentManager as a required token in the AiChatPlugin.ts file.
3180
+ try {
3181
+ await settingRegistry.set(DOCMANAGER_PLUGIN_ID, 'renameUntitledFileOnSave', false);
3182
+ }
3183
+ catch (error) {
3184
+ console.error('Failed to set renameUntitledFileOnSave setting:', error);
3185
+ }
3186
+ };
3187
+
3188
+
2923
3189
  /***/ }),
2924
3190
 
2925
3191
  /***/ "./lib/Extensions/AiChat/token.js":
@@ -2952,6 +3218,47 @@ This makes sure that the chat plugin is loaded before these other extensions.
2952
3218
  const IChatTracker = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.Token('mito-ai/IChatTracker', 'Widget tracker for the chat sidebar.');
2953
3219
 
2954
3220
 
3221
+ /***/ }),
3222
+
3223
+ /***/ "./lib/Extensions/AiChat/utils.js":
3224
+ /*!****************************************!*\
3225
+ !*** ./lib/Extensions/AiChat/utils.js ***!
3226
+ \****************************************/
3227
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3228
+
3229
+ __webpack_require__.r(__webpack_exports__);
3230
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3231
+ /* harmony export */ getBase64EncodedCellOutput: () => (/* binding */ getBase64EncodedCellOutput)
3232
+ /* harmony export */ });
3233
+ /* harmony import */ var _utils_notebook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/notebook */ "./lib/utils/notebook.js");
3234
+ /* harmony import */ var _restAPI_RestAPI__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../restAPI/RestAPI */ "./lib/restAPI/RestAPI.js");
3235
+ /*
3236
+ * Copyright (c) Saga Inc.
3237
+ * Distributed under the terms of the GNU Affero General Public License v3.0 License.
3238
+ */
3239
+
3240
+
3241
+ const getBase64EncodedCellOutput = async (notebookTracker, cellID) => {
3242
+ if (cellID === undefined) {
3243
+ return undefined;
3244
+ }
3245
+ // Check if the cell id is part of the notebook
3246
+ const cellIndex = (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_0__.getCellIndexByID)(notebookTracker, cellID);
3247
+ if (cellIndex === undefined) {
3248
+ // Log that the cell id is not part of the notebook
3249
+ console.log(`Cell with id ${cellID} not found in notebook`);
3250
+ void (0,_restAPI_RestAPI__WEBPACK_IMPORTED_MODULE_1__.logEvent)('get_cell_output_requested_non_existent_cell');
3251
+ return undefined;
3252
+ }
3253
+ (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_0__.scrollToCell)(notebookTracker, cellID, 0);
3254
+ const activeCellOutput = await (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_0__.getActiveCellOutput)(notebookTracker);
3255
+ if (activeCellOutput !== undefined) {
3256
+ return activeCellOutput;
3257
+ }
3258
+ return undefined;
3259
+ };
3260
+
3261
+
2955
3262
  /***/ }),
2956
3263
 
2957
3264
  /***/ "./lib/Extensions/AppBuilder/AppBuilderPlugin.js":
@@ -3088,18 +3395,14 @@ __webpack_require__.r(__webpack_exports__);
3088
3395
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3089
3396
  /* harmony export */ convertNotebookToStreamlit: () => (/* binding */ convertNotebookToStreamlit)
3090
3397
  /* harmony export */ });
3091
- /* harmony import */ var _jupyterlab_cells__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/cells */ "webpack/sharing/consume/default/@jupyterlab/cells");
3092
- /* harmony import */ var _jupyterlab_cells__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_cells__WEBPACK_IMPORTED_MODULE_0__);
3093
- /* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/coreutils */ "webpack/sharing/consume/default/@jupyterlab/coreutils");
3094
- /* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_1__);
3095
- /* harmony import */ var _utils_notebook__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils/notebook */ "./lib/utils/notebook.js");
3096
- /* harmony import */ var _cellConversionUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./cellConversionUtils */ "./lib/Extensions/AppBuilder/cellConversionUtils.js");
3097
- /* harmony import */ var _requirementsUtils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./requirementsUtils */ "./lib/Extensions/AppBuilder/requirementsUtils.js");
3098
- /* harmony import */ var _fileUtils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./fileUtils */ "./lib/Extensions/AppBuilder/fileUtils.js");
3099
- /* harmony import */ var _visualizationConversionUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./visualizationConversionUtils */ "./lib/Extensions/AppBuilder/visualizationConversionUtils.js");
3100
- /* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @lumino/coreutils */ "webpack/sharing/consume/default/@lumino/coreutils");
3101
- /* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_2__);
3102
- /* harmony import */ var _DeployAppNotification__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./DeployAppNotification */ "./lib/Extensions/AppBuilder/DeployAppNotification.js");
3398
+ /* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/coreutils */ "webpack/sharing/consume/default/@jupyterlab/coreutils");
3399
+ /* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0__);
3400
+ /* harmony import */ var _requirementsUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./requirementsUtils */ "./lib/Extensions/AppBuilder/requirementsUtils.js");
3401
+ /* harmony import */ var _fileUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./fileUtils */ "./lib/Extensions/AppBuilder/fileUtils.js");
3402
+ /* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @lumino/coreutils */ "webpack/sharing/consume/default/@lumino/coreutils");
3403
+ /* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__);
3404
+ /* harmony import */ var _DeployAppNotification__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./DeployAppNotification */ "./lib/Extensions/AppBuilder/DeployAppNotification.js");
3405
+ /* harmony import */ var _auth__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./auth */ "./lib/Extensions/AppBuilder/auth.js");
3103
3406
  /*
3104
3407
  * Copyright (c) Saga Inc.
3105
3408
  * Distributed under the terms of the GNU Affero General Public License v3.0 License.
@@ -3110,113 +3413,49 @@ __webpack_require__.r(__webpack_exports__);
3110
3413
 
3111
3414
 
3112
3415
 
3113
-
3114
-
3115
-
3116
3416
  /*
3117
- This function converts a notebook into a streamlit app. It processes each cell one by one,
3118
- and makes sure to convert specific functionality from the jupyter to streamlit equivalents.
3119
- For example, in Jupyter, you can display a streamlit graph by calling plt.show(), whereas in Streamlit,
3120
- you need to call st.plotly_chart().
3121
-
3122
- This function returns:
3123
- 1. A <notebook-name>-streamlit-app.py file
3124
- 2. A requirements.txt file that lists the dependencies for the streamlit app
3417
+ This function generates a requirements.txt file that lists the dependencies for the streamlit app
3125
3418
  */
3126
3419
  const convertNotebookToStreamlit = async (notebookTracker, appBuilderService) => {
3420
+ // Check authentication before proceeding with deployment
3421
+ const isAuthenticated = await (0,_auth__WEBPACK_IMPORTED_MODULE_2__.checkAuthenticationAndRedirect)();
3422
+ if (!isAuthenticated) {
3423
+ console.log('User not authenticated, redirected to signup');
3424
+ return;
3425
+ }
3127
3426
  const notebookPanel = notebookTracker.currentWidget;
3128
3427
  if (!notebookPanel) {
3129
3428
  console.error('No notebook is currently active');
3130
3429
  return;
3131
3430
  }
3132
3431
  const notebookPath = notebookPanel.context.path;
3133
- const notebookName = _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_1__.PathExt.basename(notebookPath, '.ipynb');
3134
- const appFilePath = `./app.py`;
3135
- // Initialize Streamlit code with imports
3136
- let streamlitCode = [
3137
- "import streamlit as st",
3138
- "",
3139
- `st.title('${notebookName}')`,
3140
- (0,_visualizationConversionUtils__WEBPACK_IMPORTED_MODULE_3__.generateDisplayVizFunction)(),
3141
- ""
3142
- ];
3143
- // TODO: we can set the app favicon https://docs.streamlit.io/develop/api-reference/configuration/st.set_page_config
3144
- console.log("Converting notebook code to streamlit app");
3145
- // Process each cell
3146
- notebookPanel.content.widgets.forEach((cellWidget) => {
3147
- const cellModel = cellWidget.model;
3148
- let cellContent = (0,_cellConversionUtils__WEBPACK_IMPORTED_MODULE_4__.getCellContent)(cellModel);
3149
- // Check if the cell is marked to skip.
3150
- const includeCellInApp = (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_5__.getIncludeCellInApp)(notebookTracker, cellModel.id);
3151
- if (!includeCellInApp) {
3152
- return;
3153
- }
3154
- // Check if it's an empty code cell
3155
- if (cellModel.type === 'code' && !cellModel.sharedModel.source.trim()) {
3156
- return;
3157
- }
3158
- if (cellWidget instanceof _jupyterlab_cells__WEBPACK_IMPORTED_MODULE_0__.MarkdownCell) {
3159
- streamlitCode.push("\n# Converting Markdown Cell");
3160
- // Convert markdown cells to st.markdown
3161
- // TODO: The single # Heading markdown in Streamlit is as big as the title, maybe larger.
3162
- // So we might want to downsize them all by one # to make it look nicer.
3163
- const escapedContent = cellContent.replace(/"""/g, '\\"\\"\\"');
3164
- streamlitCode.push(`st.markdown("""${escapedContent}""")`);
3165
- streamlitCode.push("");
3166
- }
3167
- else if (cellWidget instanceof _jupyterlab_cells__WEBPACK_IMPORTED_MODULE_0__.CodeCell) {
3168
- streamlitCode.push("\n# Converting Code Cell");
3169
- // Convert the Mito App Input into Streamlit components
3170
- // Temporarily replace \\n with a placeholder
3171
- const placeholder = '__ESCAPED_NEWLINE_PLACEHOLDER__';
3172
- cellContent = cellContent.replace(/\\n/g, placeholder);
3173
- cellContent = (0,_cellConversionUtils__WEBPACK_IMPORTED_MODULE_4__.removeInvalidLines)(cellContent);
3174
- // Now split on actual newlines safely
3175
- cellContent = cellContent.split('\n').map(line => {
3176
- return (0,_cellConversionUtils__WEBPACK_IMPORTED_MODULE_4__.transformMitoAppInput)(line);
3177
- }).join('\n');
3178
- // Transform the cell for visualizations using our new unified approach
3179
- cellContent = (0,_visualizationConversionUtils__WEBPACK_IMPORTED_MODULE_3__.transformVisualizationCell)(cellContent);
3180
- // Restore the \\n sequences
3181
- cellContent = cellContent.replace(new RegExp(placeholder, 'g'), '\\n');
3182
- streamlitCode = streamlitCode.concat(cellContent);
3183
- /*
3184
- Displaying dataframes:
3185
-
3186
- Streamlit automatically renders variables that appear alone on a line,
3187
- similar to Jupyter's behavior with the last line of a cell.
3188
-
3189
- Benefits:
3190
- - Default Mito dataframe output works without modification
3191
-
3192
- TODO: Edge cases to handle:
3193
- 1. User/AI-generated display(df) calls. We can tell the AI to not generate this. Users almost never do.
3194
- 2. mitosheet.sheet() calls - consider converting to Mito spreadsheet component or just dataframe output
3195
- */
3196
- }
3197
- });
3198
- // Create the streamlit app.py file
3199
- const streamlitSourceCode = streamlitCode.join('\n');
3432
+ const notebookName = _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0__.PathExt.basename(notebookPath, '.ipynb');
3433
+ // Get full path to folder
3434
+ const pathToFolder = _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0__.PathExt.dirname(notebookPath);
3435
+ console.log('Notebook path:', notebookPath);
3436
+ console.log('Notebook name:', notebookName);
3437
+ console.log('Current working directory info:', notebookPanel.context);
3200
3438
  // Build the requirements.txt file
3201
3439
  console.debug("Building requirements.txt file");
3202
- const requirementsContent = await (0,_requirementsUtils__WEBPACK_IMPORTED_MODULE_6__.generateRequirementsTxt)(notebookTracker);
3440
+ const requirementsContent = await (0,_requirementsUtils__WEBPACK_IMPORTED_MODULE_3__.generateRequirementsTxt)(notebookTracker);
3203
3441
  // Save the files to the current directory
3204
- await (0,_fileUtils__WEBPACK_IMPORTED_MODULE_7__.saveFileWithKernel)(notebookTracker, './requirements.txt', requirementsContent);
3205
- await (0,_fileUtils__WEBPACK_IMPORTED_MODULE_7__.saveFileWithKernel)(notebookTracker, appFilePath, streamlitSourceCode);
3206
- // Get the full path to the folder
3207
- const pathToFolder = _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_1__.PathExt.dirname(notebookPath);
3442
+ await (0,_fileUtils__WEBPACK_IMPORTED_MODULE_4__.saveFileWithKernel)(notebookTracker, './requirements.txt', requirementsContent);
3208
3443
  // After building the files, we need to send a request to the backend to deploy the app
3209
3444
  if (appBuilderService) {
3210
3445
  try {
3211
3446
  console.log("Sending request to deploy the app");
3447
+ // Get JWT token for authentication
3448
+ const jwtToken = (0,_auth__WEBPACK_IMPORTED_MODULE_2__.getJWTToken)();
3212
3449
  const response = await appBuilderService.client.sendMessage({
3213
3450
  type: 'build-app',
3214
- message_id: _lumino_coreutils__WEBPACK_IMPORTED_MODULE_2__.UUID.uuid4(),
3215
- path: pathToFolder
3451
+ message_id: _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__.UUID.uuid4(),
3452
+ notebook_path: notebookPath,
3453
+ app_path: pathToFolder,
3454
+ jwt_token: jwtToken || appBuilderService.client.serverSettings.token
3216
3455
  });
3217
3456
  console.log("App deployment response:", response);
3218
3457
  const url = response.url;
3219
- (0,_DeployAppNotification__WEBPACK_IMPORTED_MODULE_8__.deployAppNotification)(url);
3458
+ (0,_DeployAppNotification__WEBPACK_IMPORTED_MODULE_5__.deployAppNotification)(url);
3220
3459
  }
3221
3460
  catch (error) {
3222
3461
  // TODO: Do something with the error
@@ -3231,78 +3470,171 @@ const convertNotebookToStreamlit = async (notebookTracker, appBuilderService) =>
3231
3470
 
3232
3471
  /***/ }),
3233
3472
 
3234
- /***/ "./lib/Extensions/AppBuilder/cellConversionUtils.js":
3235
- /*!**********************************************************!*\
3236
- !*** ./lib/Extensions/AppBuilder/cellConversionUtils.js ***!
3237
- \**********************************************************/
3473
+ /***/ "./lib/Extensions/AppBuilder/auth.js":
3474
+ /*!*******************************************!*\
3475
+ !*** ./lib/Extensions/AppBuilder/auth.js ***!
3476
+ \*******************************************/
3238
3477
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3239
3478
 
3240
3479
  __webpack_require__.r(__webpack_exports__);
3241
3480
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3242
- /* harmony export */ getCellContent: () => (/* binding */ getCellContent),
3243
- /* harmony export */ getCellType: () => (/* binding */ getCellType),
3244
- /* harmony export */ removeInvalidLines: () => (/* binding */ removeInvalidLines),
3245
- /* harmony export */ transformMitoAppInput: () => (/* binding */ transformMitoAppInput)
3481
+ /* harmony export */ checkAuthenticationAndRedirect: () => (/* binding */ checkAuthenticationAndRedirect),
3482
+ /* harmony export */ exchangeCodeForTokens: () => (/* binding */ exchangeCodeForTokens),
3483
+ /* harmony export */ getAuthHeaders: () => (/* binding */ getAuthHeaders),
3484
+ /* harmony export */ getJWTToken: () => (/* binding */ getJWTToken),
3485
+ /* harmony export */ isUserAuthenticated: () => (/* binding */ isUserAuthenticated),
3486
+ /* harmony export */ redirectToSignin: () => (/* binding */ redirectToSignin),
3487
+ /* harmony export */ redirectToSignup: () => (/* binding */ redirectToSignup),
3488
+ /* harmony export */ removeJWTToken: () => (/* binding */ removeJWTToken),
3489
+ /* harmony export */ setJWTToken: () => (/* binding */ setJWTToken)
3246
3490
  /* harmony export */ });
3491
+ /* harmony import */ var _restAPI_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../restAPI/utils */ "./lib/restAPI/utils.js");
3247
3492
  /*
3248
3493
  * Copyright (c) Saga Inc.
3249
3494
  * Distributed under the terms of the GNU Affero General Public License v3.0 License.
3250
3495
  */
3251
- // Helper function to get cell content
3252
- const getCellContent = (cell) => {
3253
- return cell.sharedModel.source;
3496
+
3497
+ const domain_dev = 'https://mito-app-auth.auth.us-east-1.amazoncognito.com';
3498
+ const client_id = '6ara3u3l8sss738hrhbq1qtiqf';
3499
+ // Change this to domain_dev for dev deployments
3500
+ const active_domain = domain_dev;
3501
+ const currentUrl = window.location.href;
3502
+ console.log("currentUrl: ", currentUrl);
3503
+ // AWS Cognito configuration
3504
+ const COGNITO_CONFIG = {
3505
+ SIGNUP_URL: `${active_domain}/signup?client_id=${client_id}&response_type=code&scope=email+openid+profile&redirect_uri=${currentUrl}`,
3506
+ SIGNIN_URL: `${active_domain}/login?client_id=${client_id}&response_type=code&scope=email+openid+profile&redirect_uri=${currentUrl}`,
3507
+ JWT_COOKIE_NAME: 'mito-auth-token',
3508
+ JWT_COOKIE_EXPIRY_HOURS: 1
3254
3509
  };
3255
- // Helper function to get cell type
3256
- const getCellType = (cell) => {
3257
- return cell.type;
3510
+ /**
3511
+ * Check if user is authenticated by looking for JWT token in cookies
3512
+ */
3513
+ const isUserAuthenticated = () => {
3514
+ const token = getJWTToken();
3515
+ return token !== null && token !== undefined && token !== '';
3258
3516
  };
3259
- const getVariableNameDefaultAndLabel = (line, identifier) => {
3260
- var _a, _b;
3261
- // Split on the equal sign to get the variable name. We must use this full
3262
- // name because its what the python script uses.
3263
- const variableName = ((_a = line.split(' ')[0]) === null || _a === void 0 ? void 0 : _a.trim()) || '';
3264
- // Split on the identifier to get the unique label for this variable
3265
- let variableLabel = (variableName === null || variableName === void 0 ? void 0 : variableName.split(identifier)[1]) || '';
3266
- if (variableLabel.startsWith("_")) {
3267
- variableLabel = variableLabel.slice(1);
3517
+ /**
3518
+ * Get JWT token from cookies
3519
+ */
3520
+ const getJWTToken = () => {
3521
+ const cookies = document.cookie.split(';');
3522
+ const jwtCookie = cookies.find(cookie => cookie.trim().startsWith(`${COGNITO_CONFIG.JWT_COOKIE_NAME}=`));
3523
+ if (jwtCookie) {
3524
+ const token = jwtCookie.split('=')[1];
3525
+ return token || null;
3268
3526
  }
3269
- // Get the value after the equal sign to get the default value for the variable
3270
- const defaultValue = ((_b = line.split('=')[1]) === null || _b === void 0 ? void 0 : _b.trim()) || '';
3271
- return [variableName, variableLabel, defaultValue];
3527
+ return null;
3272
3528
  };
3273
- const transformMitoAppInput = (line) => {
3274
- const textInputIdentifer = 'mito_app_text_input';
3275
- if (line.startsWith(textInputIdentifer)) {
3276
- const [variableName, variableLabel, defaultValue] = getVariableNameDefaultAndLabel(line, textInputIdentifer);
3277
- return `${variableName} = st.text_input('${variableLabel}', ${defaultValue})`;
3529
+ /**
3530
+ * Set JWT token as a cookie
3531
+ */
3532
+ const setJWTToken = (token) => {
3533
+ const date = new Date();
3534
+ date.setTime(date.getTime() + (COGNITO_CONFIG.JWT_COOKIE_EXPIRY_HOURS * 60 * 60 * 1000));
3535
+ const expires = "expires=" + date.toUTCString();
3536
+ // Set cookie for all subdomains of trymito.io (production)
3537
+ document.cookie = `${COGNITO_CONFIG.JWT_COOKIE_NAME}=${token}; ${expires}; path=/; domain=.trymito.io; SameSite=Lax; Secure`;
3538
+ // For localhost development
3539
+ if (window.location.hostname === 'localhost') {
3540
+ document.cookie = `${COGNITO_CONFIG.JWT_COOKIE_NAME}=${token}; ${expires}; path=/`;
3278
3541
  }
3279
- const numberInputIdentifier = 'mito_app_number_input';
3280
- if (line.startsWith(numberInputIdentifier)) {
3281
- const [variableName, variableLabel, defaultValue] = getVariableNameDefaultAndLabel(line, numberInputIdentifier);
3282
- return `${variableName} = st.number_input('${variableLabel}', ${defaultValue})`;
3542
+ };
3543
+ /**
3544
+ * Remove JWT token from cookies
3545
+ */
3546
+ const removeJWTToken = () => {
3547
+ // Delete for current domain
3548
+ document.cookie = `${COGNITO_CONFIG.JWT_COOKIE_NAME}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`;
3549
+ // Delete for all subdomains
3550
+ document.cookie = `${COGNITO_CONFIG.JWT_COOKIE_NAME}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; domain=.trymito.io;`;
3551
+ };
3552
+ /**
3553
+ * Exchange authorization code for JWT tokens
3554
+ */
3555
+ const exchangeCodeForTokens = async (code) => {
3556
+ try {
3557
+ const response = await (0,_restAPI_utils__WEBPACK_IMPORTED_MODULE_0__.requestAPI)('auth/token', {
3558
+ method: 'POST',
3559
+ body: JSON.stringify({ code })
3560
+ });
3561
+ if (response.error) {
3562
+ console.error('Failed to exchange code for tokens:', response.error);
3563
+ return false;
3564
+ }
3565
+ if (response.data) {
3566
+ const data = response.data;
3567
+ const { access_token } = data;
3568
+ // Store the access token as the JWT token
3569
+ if (access_token) {
3570
+ setJWTToken(access_token);
3571
+ return true;
3572
+ }
3573
+ }
3574
+ return false;
3283
3575
  }
3284
- const dateInputIdentifier = 'mito_app_date_input';
3285
- if (line.startsWith(dateInputIdentifier)) {
3286
- const [variableName, variableLabel, defaultValue] = getVariableNameDefaultAndLabel(line, dateInputIdentifier);
3287
- // The user is responsible for making sure the right hand side is a valid option:
3288
- // "today", datetime.date, datetime.datetime, "YYYY-MM-DD".
3289
- return `${variableName} = st.date_input('${variableLabel}', ${defaultValue})`;
3576
+ catch (error) {
3577
+ console.error('Error exchanging code for tokens:', error);
3578
+ return false;
3290
3579
  }
3291
- const booleanInputIdentifier = 'mito_app_boolean_input';
3292
- if (line.startsWith(booleanInputIdentifier)) {
3293
- const [variableName, variableLabel, defaultValue] = getVariableNameDefaultAndLabel(line, booleanInputIdentifier);
3294
- return `${variableName} = st.checkbox('${variableLabel}', ${defaultValue})`;
3580
+ };
3581
+ /**
3582
+ * Redirect user to AWS Cognito signup page
3583
+ */
3584
+ const redirectToSignup = () => {
3585
+ window.location.href = COGNITO_CONFIG.SIGNUP_URL;
3586
+ };
3587
+ /**
3588
+ * Redirect user to AWS Cognito signin page
3589
+ */
3590
+ const redirectToSignin = () => {
3591
+ window.location.href = COGNITO_CONFIG.SIGNIN_URL;
3592
+ };
3593
+ /**
3594
+ * Handle authentication check and redirect if needed
3595
+ * Returns true if user is authenticated, false if redirected
3596
+ */
3597
+ const checkAuthenticationAndRedirect = async () => {
3598
+ if (!isUserAuthenticated()) {
3599
+ // Check if there's a code parameter in the URL (indicating return from Cognito)
3600
+ const urlParams = new URLSearchParams(window.location.search);
3601
+ const code = urlParams.get('code');
3602
+ if (code) {
3603
+ // User has returned from Cognito with authorization code
3604
+ console.log('Received authorization code from Cognito:', code);
3605
+ // Exchange the code for JWT tokens
3606
+ const success = await exchangeCodeForTokens(code);
3607
+ if (success) {
3608
+ // Clean up URL
3609
+ const newUrl = window.location.pathname;
3610
+ window.history.replaceState({}, document.title, newUrl);
3611
+ return true;
3612
+ }
3613
+ else {
3614
+ // Failed to exchange code, redirect to signup
3615
+ redirectToSignup();
3616
+ return false;
3617
+ }
3618
+ }
3619
+ else {
3620
+ // No token and no code, redirect to signup
3621
+ redirectToSignup();
3622
+ return false;
3623
+ }
3295
3624
  }
3296
- // If there was no text_input to create, then just return the original line.
3297
- return line;
3625
+ return true;
3298
3626
  };
3299
- const removeInvalidLines = (cellContent) => {
3300
- // Remove lines that are special to ipython and won't work in streamlit. These lines start with:
3301
- // ! -> like !pip install pandas
3302
- // % -> like %pip install pandas
3303
- // %% -> like %%pip install pandas
3304
- const invalidLinesPrefixes = ['!', '%', '%%'];
3305
- return cellContent.split('\n').filter(line => !invalidLinesPrefixes.some(prefix => line.trim().startsWith(prefix))).join('\n');
3627
+ /**
3628
+ * Get authentication headers for API requests
3629
+ */
3630
+ const getAuthHeaders = () => {
3631
+ const token = getJWTToken();
3632
+ if (token) {
3633
+ return {
3634
+ 'Authorization': `Bearer ${token}`
3635
+ };
3636
+ }
3637
+ return {};
3306
3638
  };
3307
3639
 
3308
3640
 
@@ -3409,7 +3741,15 @@ const generateRequirementsTxt = async (notebookTracker) => {
3409
3741
  // Gather all code cells content
3410
3742
  notebook.widgets.forEach(cell => {
3411
3743
  if (cell.model.type === 'code') {
3412
- codeContent += cell.model.sharedModel.source + '\n\n';
3744
+ const source = cell.model.sharedModel.source;
3745
+ // Filter out lines that start with shell commands
3746
+ const filteredLines = source.split('\n').filter(line => {
3747
+ const trimmed = line.trim();
3748
+ return !trimmed.startsWith('!') && !trimmed.startsWith('%');
3749
+ });
3750
+ if (filteredLines.length > 0) {
3751
+ codeContent += filteredLines.join('\n') + '\n\n';
3752
+ }
3413
3753
  }
3414
3754
  });
3415
3755
  // Create Python code to run pipreqs on a temporary directory
@@ -3508,154 +3848,6 @@ with tempfile.TemporaryDirectory() as temp_dir:
3508
3848
  };
3509
3849
 
3510
3850
 
3511
- /***/ }),
3512
-
3513
- /***/ "./lib/Extensions/AppBuilder/visualizationConversionUtils.js":
3514
- /*!*******************************************************************!*\
3515
- !*** ./lib/Extensions/AppBuilder/visualizationConversionUtils.js ***!
3516
- \*******************************************************************/
3517
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3518
-
3519
- __webpack_require__.r(__webpack_exports__);
3520
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3521
- /* harmony export */ extractVisualizationVariables: () => (/* binding */ extractVisualizationVariables),
3522
- /* harmony export */ generateDisplayVizFunction: () => (/* binding */ generateDisplayVizFunction),
3523
- /* harmony export */ transformVisualizationCell: () => (/* binding */ transformVisualizationCell)
3524
- /* harmony export */ });
3525
- /*
3526
- * Copyright (c) Saga Inc.
3527
- * Distributed under the terms of the GNU Affero General Public License v3.0 License.
3528
- */
3529
- // Generate the display_viz helper function for Streamlit
3530
- const generateDisplayVizFunction = () => {
3531
- return `
3532
- def display_viz(fig):
3533
- """Display a visualization in Streamlit based on its type."""
3534
-
3535
- # Check for SymPy plot objects first (most specific)
3536
- if hasattr(fig, '_backend'):
3537
- fig._backend.process_series()
3538
- matplotlib_fig = fig._backend.plt.gcf()
3539
- st.pyplot(matplotlib_fig)
3540
- return
3541
-
3542
- # Check for Plotly figure
3543
- if hasattr(fig, 'update_layout') or str(type(fig)).find('plotly') >= 0:
3544
- st.plotly_chart(fig)
3545
- return
3546
-
3547
- # Check for Matplotlib figure (be more specific to avoid SymPy conflicts)
3548
- if hasattr(fig, 'add_subplot') and hasattr(fig, 'savefig'):
3549
- st.pyplot(fig)
3550
- return
3551
-
3552
- # Fallback - try pyplot as it's most common
3553
- try:
3554
- st.pyplot(fig)
3555
- except Exception as e:
3556
- st.error(f"Couldn't display visualization of type: {type(fig)}. Error: {str(e)}")
3557
- st.write(fig) # Show the object for debugging
3558
- `;
3559
- };
3560
- // Extract all potential visualization variable names from a code cell
3561
- const extractVisualizationVariables = (cellContent) => {
3562
- // Clean up the content and trim whitespace
3563
- const trimmedContent = cellContent.trim();
3564
- const vizVariables = [];
3565
- // Check for common visualization patterns for various libraries
3566
- const vizPatterns = [
3567
- // Plotly patterns
3568
- /([a-zA-Z_][a-zA-Z0-9_]*)\s*=\s*px\./,
3569
- /([a-zA-Z_][a-zA-Z0-9_]*)\s*=\s*go\.Figure/,
3570
- /([a-zA-Z_][a-zA-Z0-9_]*)\s*=\s*ff\./,
3571
- /([a-zA-Z_][a-zA-Z0-9_]*)\s*=\s*plotly\./,
3572
- // Matplotlib patterns
3573
- /([a-zA-Z_][a-zA-Z0-9_]*)\s*=\s*plt\.figure/,
3574
- /([a-zA-Z_][a-zA-Z0-9_]*)\s*,\s*([a-zA-Z_][a-zA-Z0-9_]*)\s*=\s*plt\.subplots/,
3575
- // Generic patterns that might be visualizations
3576
- /([a-zA-Z_][a-zA-Z0-9_]*)\s*=\s*.*\.(plot|scatter|bar|hist|pie|boxplot|violin)/,
3577
- /([a-zA-Z_][a-zA-Z0-9_]*)\s*=\s*.*\.(figure|Figure)/,
3578
- // Any variable involved in a show() call
3579
- /([a-zA-Z_][a-zA-Z0-9_]*)\.show\(/
3580
- ];
3581
- const lines = trimmedContent.split('\n');
3582
- // Find all variable assignments that match visualization patterns
3583
- for (const line of lines) {
3584
- for (const pattern of vizPatterns) {
3585
- const matches = [...line.matchAll(new RegExp(pattern, 'g'))];
3586
- for (const match of matches) {
3587
- // For plt.subplots(), capture both fig and ax variables
3588
- if (pattern.toString().includes('subplots') && match[2]) {
3589
- if (match[1] && !vizVariables.includes(match[1])) {
3590
- vizVariables.push(match[1]); // fig variable
3591
- }
3592
- if (match[2] && !vizVariables.includes(match[2])) {
3593
- vizVariables.push(match[2]); // ax variable
3594
- }
3595
- }
3596
- else if (match[1] && !vizVariables.includes(match[1])) {
3597
- // Check if it's not a Python keyword
3598
- const pythonKeywords = ['if', 'else', 'elif', 'for', 'while', 'def', 'class', 'return', 'import', 'from', 'print'];
3599
- if (!pythonKeywords.includes(match[1])) {
3600
- vizVariables.push(match[1]);
3601
- }
3602
- }
3603
- }
3604
- }
3605
- }
3606
- return vizVariables;
3607
- };
3608
- // Transform visualization code for Streamlit using runtime detection
3609
- const transformVisualizationCell = (cellContent) => {
3610
- var _a;
3611
- const lines = cellContent.split('\n');
3612
- const transformedLines = [];
3613
- // Extract figure variable names
3614
- const figVariables = extractVisualizationVariables(cellContent);
3615
- for (let i = 0; i < lines.length; i++) {
3616
- const line = (_a = lines[i]) !== null && _a !== void 0 ? _a : '';
3617
- let replacedLine = false;
3618
- // Check for plt.show() calls We need to replace these with display_viz(plt.gcf())
3619
- // because we need to make sure we display the current figure.
3620
- if (line.trim().match(/plt\.show\(/)) {
3621
- transformedLines.push("display_viz(plt.gcf())");
3622
- replacedLine = true;
3623
- }
3624
- // Check for SymPy plot calls
3625
- else if (line.trim().match(/(sp|sym|sy|sm|sympy)\.plot\s*\(.*show\s*=\s*True.*\)/)) {
3626
- const modifiedLine = line.replace(/(.*?)(sp|sym|sy|sm|sympy)\.plot\s*\(/, '$1display_viz($2.plot(') + ')';
3627
- transformedLines.push(modifiedLine);
3628
- replacedLine = true;
3629
- }
3630
- // If show=False, do not call display_viz, just keep the line as is
3631
- else if (line.trim().match(/((sp|sym|sy|sm|sympy)\.)?plot\s*\(.*show\s*=\s*False.*\)/)) {
3632
- // Do nothing, just let it fall through to the original line
3633
- }
3634
- // Check for direct plot(...) calls
3635
- else if (line.trim().match(/^plot\s*\(/)) {
3636
- const modifiedLine = line.replace(/^plot\s*\(/, 'display_viz(plot(') + ')';
3637
- transformedLines.push(modifiedLine);
3638
- replacedLine = true;
3639
- }
3640
- // Check for figure.show() calls for any detected figure variables
3641
- else {
3642
- for (const figVar of figVariables) {
3643
- if (line.trim().startsWith(`${figVar}.show`)) {
3644
- transformedLines.push(`display_viz(${figVar})`);
3645
- replacedLine = true;
3646
- break;
3647
- }
3648
- }
3649
- }
3650
- // If we didn't replace the line, keep the original
3651
- if (!replacedLine) {
3652
- transformedLines.push(line);
3653
- }
3654
- }
3655
- return transformedLines.join('\n');
3656
- };
3657
-
3658
-
3659
3851
  /***/ }),
3660
3852
 
3661
3853
  /***/ "./lib/Extensions/ContextManager/ContextManagerPlugin.js":
@@ -4717,11 +4909,15 @@ const ConnectionList = ({ connections, loading, error, onDelete }) => {
4717
4909
  var _a;
4718
4910
  return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { key: id, className: "connection-card" },
4719
4911
  react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "connection-card-header" },
4720
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement("h3", null, connection.type)),
4912
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("h3", { className: "connection-alias" }, connection.alias ? connection.alias : connection.database),
4913
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: "connection-type" }, connection.type.toUpperCase())),
4914
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "connection-divider" }),
4721
4915
  react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "connection-details" }, (_a = _model__WEBPACK_IMPORTED_MODULE_1__.databaseConfigs[connection.type]) === null || _a === void 0 ? void 0 : _a.fields.map(field => {
4722
- // Skip password fields for security
4916
+ // Skip specific fields
4723
4917
  if (field.type === 'password')
4724
4918
  return null;
4919
+ if (field.name === 'alias')
4920
+ return null;
4725
4921
  const value = connection[field.name];
4726
4922
  // Only show fields that have values
4727
4923
  if (value === undefined || value === '')
@@ -4872,12 +5068,20 @@ __webpack_require__.r(__webpack_exports__);
4872
5068
  * Copyright (c) Saga Inc.
4873
5069
  * Distributed under the terms of the GNU Affero General Public License v3.0 License.
4874
5070
  */
5071
+ const ALIAS_PLACEHOLDER = 'Enter a nickname for this database';
4875
5072
  const databaseConfigs = {
4876
5073
  mssql: {
4877
5074
  type: 'mssql',
4878
5075
  displayName: 'Microsoft SQL Server',
4879
5076
  alertText: 'Microsoft SQL Server requires an additional driver. If you\'ve already installed it, you can safely ignore this message. For more info, consult the <a href="https://docs.trymito.io/mito-ai/database-connectors/microsoft-sql-server" target="_blank">Mito docs</a>.',
4880
5077
  fields: [
5078
+ {
5079
+ name: 'alias',
5080
+ type: 'text',
5081
+ label: 'Alias',
5082
+ placeholder: ALIAS_PLACEHOLDER,
5083
+ required: true
5084
+ },
4881
5085
  {
4882
5086
  name: 'username',
4883
5087
  type: 'text',
@@ -4926,6 +5130,13 @@ const databaseConfigs = {
4926
5130
  type: 'mysql',
4927
5131
  displayName: 'MySQL',
4928
5132
  fields: [
5133
+ {
5134
+ name: 'alias',
5135
+ type: 'text',
5136
+ label: 'Alias',
5137
+ placeholder: ALIAS_PLACEHOLDER,
5138
+ required: true
5139
+ },
4929
5140
  {
4930
5141
  name: 'username',
4931
5142
  type: 'text',
@@ -4967,6 +5178,13 @@ const databaseConfigs = {
4967
5178
  type: 'oracle',
4968
5179
  displayName: 'Oracle',
4969
5180
  fields: [
5181
+ {
5182
+ name: 'alias',
5183
+ type: 'text',
5184
+ label: 'Alias',
5185
+ placeholder: ALIAS_PLACEHOLDER,
5186
+ required: true
5187
+ },
4970
5188
  {
4971
5189
  name: 'username',
4972
5190
  type: 'text',
@@ -5008,6 +5226,13 @@ const databaseConfigs = {
5008
5226
  type: 'postgres',
5009
5227
  displayName: 'PostgreSQL',
5010
5228
  fields: [
5229
+ {
5230
+ name: 'alias',
5231
+ type: 'text',
5232
+ label: 'Alias',
5233
+ placeholder: ALIAS_PLACEHOLDER,
5234
+ required: true
5235
+ },
5011
5236
  {
5012
5237
  name: 'username',
5013
5238
  type: 'text',
@@ -5049,6 +5274,13 @@ const databaseConfigs = {
5049
5274
  type: 'snowflake',
5050
5275
  displayName: 'Snowflake',
5051
5276
  fields: [
5277
+ {
5278
+ name: 'alias',
5279
+ type: 'text',
5280
+ label: 'Alias',
5281
+ placeholder: ALIAS_PLACEHOLDER,
5282
+ required: true
5283
+ },
5052
5284
  {
5053
5285
  name: 'username',
5054
5286
  type: 'text',
@@ -5083,6 +5315,13 @@ const databaseConfigs = {
5083
5315
  type: 'sqlite',
5084
5316
  displayName: 'SQLite',
5085
5317
  fields: [
5318
+ {
5319
+ name: 'alias',
5320
+ type: 'text',
5321
+ label: 'Alias',
5322
+ placeholder: ALIAS_PLACEHOLDER,
5323
+ required: true
5324
+ },
5086
5325
  {
5087
5326
  name: 'database',
5088
5327
  type: 'text',
@@ -5996,6 +6235,39 @@ const AgentComponentHeader = ({ icon, text, onClick, isExpanded, displayBorder =
5996
6235
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AgentComponentHeader);
5997
6236
 
5998
6237
 
6238
+ /***/ }),
6239
+
6240
+ /***/ "./lib/components/AgentComponents/AssumptionToolUI.js":
6241
+ /*!************************************************************!*\
6242
+ !*** ./lib/components/AgentComponents/AssumptionToolUI.js ***!
6243
+ \************************************************************/
6244
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6245
+
6246
+ __webpack_require__.r(__webpack_exports__);
6247
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6248
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
6249
+ /* harmony export */ });
6250
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
6251
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
6252
+ /* harmony import */ var _utils_classNames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utils/classNames */ "./lib/utils/classNames.js");
6253
+ /* harmony import */ var _style_AssumptionTool_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../style/AssumptionTool.css */ "./style/AssumptionTool.css");
6254
+ /*
6255
+ * Copyright (c) Saga Inc.
6256
+ * Distributed under the terms of the GNU Affero General Public License v3.0 License.
6257
+ */
6258
+
6259
+
6260
+
6261
+ const AssumptionToolUI = ({ assumptions, }) => {
6262
+ return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: (0,_utils_classNames__WEBPACK_IMPORTED_MODULE_2__.classNames)('assumption-tool-container') },
6263
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "assumption-header-label" }, "Assumption"),
6264
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", { className: (0,_utils_classNames__WEBPACK_IMPORTED_MODULE_2__.classNames)('assumption-content') },
6265
+ assumptions.length > 1 && (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("ul", null, assumptions.map((assumption, index) => (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", { key: index }, assumption))))),
6266
+ assumptions.length === 1 && (assumptions[0]))));
6267
+ };
6268
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AssumptionToolUI);
6269
+
6270
+
5999
6271
  /***/ }),
6000
6272
 
6001
6273
  /***/ "./lib/components/AgentComponents/ErrorFixupToolUI.js":
@@ -6106,6 +6378,62 @@ const GetCellOutputToolUI = () => {
6106
6378
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (GetCellOutputToolUI);
6107
6379
 
6108
6380
 
6381
+ /***/ }),
6382
+
6383
+ /***/ "./lib/components/DatabaseButton.js":
6384
+ /*!******************************************!*\
6385
+ !*** ./lib/components/DatabaseButton.js ***!
6386
+ \******************************************/
6387
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6388
+
6389
+ __webpack_require__.r(__webpack_exports__);
6390
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6391
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
6392
+ /* harmony export */ });
6393
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
6394
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
6395
+ /* harmony import */ var _IconButton__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./IconButton */ "./lib/components/IconButton.js");
6396
+ /* harmony import */ var _icons_DatabaseOutlineIcon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../icons/DatabaseOutlineIcon */ "./lib/icons/DatabaseOutlineIcon.js");
6397
+ /* harmony import */ var _Extensions_SettingsManager_SettingsManagerPlugin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Extensions/SettingsManager/SettingsManagerPlugin */ "./lib/Extensions/SettingsManager/SettingsManagerPlugin.js");
6398
+ /* harmony import */ var _restAPI_RestAPI__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../restAPI/RestAPI */ "./lib/restAPI/RestAPI.js");
6399
+ /*
6400
+ * Copyright (c) Saga Inc.
6401
+ * Distributed under the terms of the GNU Affero General Public License v3.0 License.
6402
+ */
6403
+
6404
+
6405
+
6406
+
6407
+
6408
+ const DatabaseButton = ({ app }) => {
6409
+ const [databaseConnections, setDatabaseConnections] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({});
6410
+ const [isIconVisible, setIsIconVisible] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true);
6411
+ // Fetch database connections
6412
+ const fetchDatabaseConnections = async () => {
6413
+ const databaseConnections = await (0,_restAPI_RestAPI__WEBPACK_IMPORTED_MODULE_1__.getDatabaseConnections)();
6414
+ setDatabaseConnections(databaseConnections);
6415
+ };
6416
+ // Fetch database connections
6417
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
6418
+ void fetchDatabaseConnections();
6419
+ }, []);
6420
+ // Determine notification dot type based on connections
6421
+ const getNotificationDotType = () => {
6422
+ if (!isIconVisible) {
6423
+ return null;
6424
+ }
6425
+ return Object.keys(databaseConnections).length > 0 ? 'success' : 'warning';
6426
+ };
6427
+ return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_IconButton__WEBPACK_IMPORTED_MODULE_2__["default"], { icon: react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_icons_DatabaseOutlineIcon__WEBPACK_IMPORTED_MODULE_3__["default"], null), title: 'Add Database', onClick: () => {
6428
+ void app.commands.execute(_Extensions_SettingsManager_SettingsManagerPlugin__WEBPACK_IMPORTED_MODULE_4__.COMMAND_MITO_AI_SETTINGS);
6429
+ setIsIconVisible(false);
6430
+ }, notificationDotType: getNotificationDotType(), className: 'icon-button-hover', style: {
6431
+ height: 'var(--chat-context-button-height)'
6432
+ } }));
6433
+ };
6434
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DatabaseButton);
6435
+
6436
+
6109
6437
  /***/ }),
6110
6438
 
6111
6439
  /***/ "./lib/components/DropdownMenu.js":
@@ -6197,8 +6525,10 @@ __webpack_require__.r(__webpack_exports__);
6197
6525
 
6198
6526
 
6199
6527
 
6200
- const IconButton = ({ icon, onClick, title, style }) => {
6201
- return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { className: (0,_utils_classNames__WEBPACK_IMPORTED_MODULE_3__.classNames)("icon-button"), onClick: onClick, title: title, style: style }, icon));
6528
+ const IconButton = ({ icon, onClick, title, style, notificationDotType = null, className }) => {
6529
+ return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { className: (0,_utils_classNames__WEBPACK_IMPORTED_MODULE_3__.classNames)("icon-button", className), onClick: onClick, title: title, style: style },
6530
+ icon,
6531
+ notificationDotType && react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: `notification-dot notification-dot-${notificationDotType}` })));
6202
6532
  };
6203
6533
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (IconButton);
6204
6534
 
@@ -6459,6 +6789,8 @@ __webpack_require__.r(__webpack_exports__);
6459
6789
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
6460
6790
  /* harmony import */ var _style_SelectedContextContainer_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../style/SelectedContextContainer.css */ "./style/SelectedContextContainer.css");
6461
6791
  /* harmony import */ var _icons_RuleIcon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../icons/RuleIcon */ "./lib/icons/RuleIcon.js");
6792
+ /* harmony import */ var _icons_CodeIcon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../icons/CodeIcon */ "./lib/icons/CodeIcon.js");
6793
+ /* harmony import */ var _icons_DatabaseIcon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../icons/DatabaseIcon */ "./lib/icons/DatabaseIcon.js");
6462
6794
  /*
6463
6795
  * Copyright (c) Saga Inc.
6464
6796
  * Distributed under the terms of the GNU Affero General Public License v3.0 License.
@@ -6466,10 +6798,24 @@ __webpack_require__.r(__webpack_exports__);
6466
6798
 
6467
6799
 
6468
6800
 
6469
- const SelectedContextContainer = ({ title, onRemove }) => {
6801
+
6802
+
6803
+ const SelectedContextContainer = ({ title, type, onRemove }) => {
6470
6804
  const [isHovered, setIsHovered] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
6805
+ let icon = react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_icons_RuleIcon__WEBPACK_IMPORTED_MODULE_2__["default"], null);
6806
+ switch (type) {
6807
+ case 'rule':
6808
+ icon = react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_icons_RuleIcon__WEBPACK_IMPORTED_MODULE_2__["default"], null);
6809
+ break;
6810
+ case 'variable':
6811
+ icon = react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_icons_CodeIcon__WEBPACK_IMPORTED_MODULE_3__["default"], null);
6812
+ break;
6813
+ case 'db':
6814
+ icon = react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_icons_DatabaseIcon__WEBPACK_IMPORTED_MODULE_4__["default"], null);
6815
+ break;
6816
+ }
6471
6817
  return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { className: "selected-context-container", onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), "data-testid": "selected-context-container" },
6472
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: `icon`, onClick: () => onRemove(), title: isHovered ? "Remove rule" : "Selected rule" }, isHovered ? (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: "icon" }, "\u2715")) : (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_icons_RuleIcon__WEBPACK_IMPORTED_MODULE_2__["default"], null))),
6818
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: `icon`, onClick: () => onRemove(), title: isHovered ? "Remove rule" : "Selected rule" }, isHovered ? (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: "remove-icon" }, "X")) : (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: "icon" }, icon))),
6473
6819
  react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: "rule-name" }, title)));
6474
6820
  };
6475
6821
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SelectedContextContainer);
@@ -6675,16 +7021,69 @@ __webpack_require__.r(__webpack_exports__);
6675
7021
 
6676
7022
  const AlertIcon = () => (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", { width: "14", height: "14", viewBox: "0 0 96 84", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
6677
7023
  react__WEBPACK_IMPORTED_MODULE_0___default().createElement("g", { fill: "currentColor" },
6678
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", { d: "M94.0805 67.8053L57.025 5.49763C55.1179 2.28364 51.657 0.313801 47.9194 0.313801C44.1818 0.313801 40.7209 2.28355 38.8137 5.49763L1.91856 67.8053C0.0350518 71.0665 0.0267897 75.0839 1.89611 78.3535C3.76543 81.6232 7.23119 83.6541 10.9969 83.6862H85.1079C88.8549 83.6177 92.2873 81.5723 94.1307 78.3088C95.974 75.0452 95.9546 71.0513 94.0805 67.8053ZM48.0531 73.0989C46.6493 73.0989 45.3023 72.5412 44.3097 71.5486C43.3172 70.5561 42.7594 69.209 42.7594 67.8053C42.7594 66.4015 43.3172 65.0545 44.3097 64.0619C45.3023 63.0694 46.6493 62.5116 48.0531 62.5116C49.4568 62.5116 50.8039 63.0694 51.7964 64.0619C52.789 65.0545 53.3467 66.4015 53.3467 67.8053C53.3467 69.209 52.789 70.5561 51.7964 71.5486C50.8039 72.5412 49.4568 73.0989 48.0531 73.0989ZM53.3467 49.2775C53.3467 51.1693 52.3376 52.9168 50.6999 53.8621C49.0622 54.8074 47.044 54.8074 45.4063 53.8621C43.7686 52.9168 42.7594 51.1692 42.7594 49.2775V28.103C42.7594 26.2112 43.7685 24.4637 45.4063 23.5184C47.044 22.5731 49.0622 22.5731 50.6999 23.5184C52.3376 24.4637 53.3467 26.2113 53.3467 28.103V49.2775Z" }))));
6679
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AlertIcon);
7024
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", { d: "M94.0805 67.8053L57.025 5.49763C55.1179 2.28364 51.657 0.313801 47.9194 0.313801C44.1818 0.313801 40.7209 2.28355 38.8137 5.49763L1.91856 67.8053C0.0350518 71.0665 0.0267897 75.0839 1.89611 78.3535C3.76543 81.6232 7.23119 83.6541 10.9969 83.6862H85.1079C88.8549 83.6177 92.2873 81.5723 94.1307 78.3088C95.974 75.0452 95.9546 71.0513 94.0805 67.8053ZM48.0531 73.0989C46.6493 73.0989 45.3023 72.5412 44.3097 71.5486C43.3172 70.5561 42.7594 69.209 42.7594 67.8053C42.7594 66.4015 43.3172 65.0545 44.3097 64.0619C45.3023 63.0694 46.6493 62.5116 48.0531 62.5116C49.4568 62.5116 50.8039 63.0694 51.7964 64.0619C52.789 65.0545 53.3467 66.4015 53.3467 67.8053C53.3467 69.209 52.789 70.5561 51.7964 71.5486C50.8039 72.5412 49.4568 73.0989 48.0531 73.0989ZM53.3467 49.2775C53.3467 51.1693 52.3376 52.9168 50.6999 53.8621C49.0622 54.8074 47.044 54.8074 45.4063 53.8621C43.7686 52.9168 42.7594 51.1692 42.7594 49.2775V28.103C42.7594 26.2112 43.7685 24.4637 45.4063 23.5184C47.044 22.5731 49.0622 22.5731 50.6999 23.5184C52.3376 24.4637 53.3467 26.2113 53.3467 28.103V49.2775Z" }))));
7025
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AlertIcon);
7026
+
7027
+
7028
+ /***/ }),
7029
+
7030
+ /***/ "./lib/icons/CodeIcon.js":
7031
+ /*!*******************************!*\
7032
+ !*** ./lib/icons/CodeIcon.js ***!
7033
+ \*******************************/
7034
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
7035
+
7036
+ __webpack_require__.r(__webpack_exports__);
7037
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7038
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
7039
+ /* harmony export */ });
7040
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
7041
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
7042
+ /*
7043
+ * Copyright (c) Saga Inc.
7044
+ * Distributed under the terms of the GNU Affero General Public License v3.0 License.
7045
+ */
7046
+
7047
+ const CodeIcon = () => (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", { width: "14", height: "14", viewBox: "0 0 20 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
7048
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("g", { fill: "currentColor" },
7049
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", { d: "M12.3162 0.0513449C12.8027 0.213518 13.0817 0.713391 12.9792 1.20347L12.9487 1.31624L8.94868 13.3162C8.77403 13.8402 8.20773 14.1233 7.68378 13.9487C7.19726 13.7865 6.91835 13.2866 7.02082 12.7966L7.05134 12.6838L11.0513 0.683791C11.226 0.159848 11.7923 -0.123303 12.3162 0.0513449ZM5.79999 3.40001C6.10587 3.80785 6.05312 4.37331 5.69568 4.71852L5.59998 4.8L2.667 7.00001L5.59998 9.20003C6.00782 9.50591 6.1155 10.0635 5.86902 10.495L5.79999 10.6C5.49411 11.0079 4.9365 11.1155 4.50501 10.869L4.40003 10.8L0.40003 7.8C-0.0977483 7.42667 -0.130987 6.7049 0.30042 6.28511L0.40003 6.20003L4.40003 3.20003C4.84186 2.86866 5.46862 2.95818 5.79999 3.40001ZM15.495 3.131L15.6 3.20003L19.6 6.20003C20.0978 6.57336 20.131 7.29513 19.6996 7.71492L19.6 7.8L15.6 10.8C15.1582 11.1314 14.5314 11.0418 14.2 10.6C13.8941 10.1922 13.9469 9.62672 14.3043 9.28151L14.4 9.20003L17.333 7.00001L14.4 4.8C13.9922 4.49412 13.8845 3.93654 14.131 3.50505L14.2 3.40001C14.5059 2.99217 15.0635 2.88452 15.495 3.131Z" }))));
7050
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CodeIcon);
7051
+
7052
+
7053
+ /***/ }),
7054
+
7055
+ /***/ "./lib/icons/CopyIcon.js":
7056
+ /*!*******************************!*\
7057
+ !*** ./lib/icons/CopyIcon.js ***!
7058
+ \*******************************/
7059
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
7060
+
7061
+ __webpack_require__.r(__webpack_exports__);
7062
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7063
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
7064
+ /* harmony export */ });
7065
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
7066
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
7067
+ /*
7068
+ * Copyright (c) Saga Inc.
7069
+ * Distributed under the terms of the GNU Affero General Public License v3.0 License.
7070
+ */
7071
+
7072
+ const CopyIcon = () => (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 10 11", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
7073
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("g", { fill: "currentColor" },
7074
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", { d: "M3.12502 4.03283H4.27968C4.35507 4.02072 4.4082 3.95276 4.40156 3.87658V2.59542C4.25976 2.64425 4.13359 2.72979 4.03593 2.84385L3.32343 3.65323C3.22929 3.76299 3.16172 3.89307 3.125 4.03291L3.12502 4.03283Z" }),
7075
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", { d: "M7.75784 2.55308H4.70626V3.87342C4.71524 4.12263 4.5211 4.33201 4.27188 4.34217H3.0813V9.2C3.08208 9.56993 3.38012 9.8707 3.75005 9.875H7.75788C7.93757 9.87578 8.11022 9.80508 8.23757 9.67852C8.3653 9.55195 8.43717 9.37969 8.43757 9.2V3.22808C8.43718 3.0484 8.3653 2.87613 8.23757 2.74957C8.11022 2.623 7.93757 2.5523 7.75788 2.55308H7.75784Z" }),
7076
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", { d: "M3.80163 2.62967C4.01452 2.38553 4.32155 2.24373 4.64538 2.2406H6.91879V1.79998C6.91801 1.43005 6.61997 1.12928 6.25004 1.12498H3.19221V2.44531C3.20119 2.69453 3.00705 2.9039 2.75783 2.91406H1.5625V7.77189C1.56328 8.14416 1.86523 8.44611 2.2375 8.44689H2.76407V4.30631C2.76172 3.98795 2.87578 3.67974 3.08438 3.43914L3.80163 2.62967Z" }),
7077
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", { d: "M2.75783 2.60467C2.83322 2.59256 2.88635 2.52459 2.87971 2.44842V1.16725C2.74182 1.21569 2.61916 1.29928 2.52346 1.40943L1.80783 2.21881C1.71096 2.33013 1.64065 2.46217 1.60315 2.60474L2.75783 2.60467Z" }))));
7078
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CopyIcon);
6680
7079
 
6681
7080
 
6682
7081
  /***/ }),
6683
7082
 
6684
- /***/ "./lib/icons/CodeIcon.js":
6685
- /*!*******************************!*\
6686
- !*** ./lib/icons/CodeIcon.js ***!
6687
- \*******************************/
7083
+ /***/ "./lib/icons/DatabaseIcon.js":
7084
+ /*!***********************************!*\
7085
+ !*** ./lib/icons/DatabaseIcon.js ***!
7086
+ \***********************************/
6688
7087
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6689
7088
 
6690
7089
  __webpack_require__.r(__webpack_exports__);
@@ -6698,18 +7097,18 @@ __webpack_require__.r(__webpack_exports__);
6698
7097
  * Distributed under the terms of the GNU Affero General Public License v3.0 License.
6699
7098
  */
6700
7099
 
6701
- const CodeIcon = () => (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", { width: "14", height: "14", viewBox: "0 0 20 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
7100
+ const DatabaseIcon = () => (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", { width: "10", height: "10", viewBox: "0 0 100 100", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
6702
7101
  react__WEBPACK_IMPORTED_MODULE_0___default().createElement("g", { fill: "currentColor" },
6703
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", { d: "M12.3162 0.0513449C12.8027 0.213518 13.0817 0.713391 12.9792 1.20347L12.9487 1.31624L8.94868 13.3162C8.77403 13.8402 8.20773 14.1233 7.68378 13.9487C7.19726 13.7865 6.91835 13.2866 7.02082 12.7966L7.05134 12.6838L11.0513 0.683791C11.226 0.159848 11.7923 -0.123303 12.3162 0.0513449ZM5.79999 3.40001C6.10587 3.80785 6.05312 4.37331 5.69568 4.71852L5.59998 4.8L2.667 7.00001L5.59998 9.20003C6.00782 9.50591 6.1155 10.0635 5.86902 10.495L5.79999 10.6C5.49411 11.0079 4.9365 11.1155 4.50501 10.869L4.40003 10.8L0.40003 7.8C-0.0977483 7.42667 -0.130987 6.7049 0.30042 6.28511L0.40003 6.20003L4.40003 3.20003C4.84186 2.86866 5.46862 2.95818 5.79999 3.40001ZM15.495 3.131L15.6 3.20003L19.6 6.20003C20.0978 6.57336 20.131 7.29513 19.6996 7.71492L19.6 7.8L15.6 10.8C15.1582 11.1314 14.5314 11.0418 14.2 10.6C13.8941 10.1922 13.9469 9.62672 14.3043 9.28151L14.4 9.20003L17.333 7.00001L14.4 4.8C13.9922 4.49412 13.8845 3.93654 14.131 3.50505L14.2 3.40001C14.5059 2.99217 15.0635 2.88452 15.495 3.131Z" }))));
6704
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CodeIcon);
7102
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", { d: "M50 43.839C71.447 43.839 89.737 41.166 96.839 37.411C98.881 38.49 100 39.659 100 40.88V59.12C100 64.586 77.614 69.017 50 69.017C22.386 69.017 0 64.585 0 59.12V40.88C0 39.659 1.12 38.49 3.161 37.411C10.263 41.166 28.553 43.839 50 43.839ZM3.161 68.393C1.12 69.473 0 70.642 0 71.862V90.102C0 95.568 22.386 100 50 100C77.614 100 100 95.568 100 90.103V71.863C100 70.642 98.881 69.473 96.839 68.393C89.737 72.147 71.447 74.821 50 74.821C28.553 74.821 10.263 72.147 3.161 68.393ZM50 0C22.386 0 0 4.432 0 9.898V28.137C0 33.604 22.386 38.035 50 38.035C77.614 38.035 100 33.604 100 28.137V9.898C100 4.432 77.614 0 50 0Z" }))));
7103
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DatabaseIcon);
6705
7104
 
6706
7105
 
6707
7106
  /***/ }),
6708
7107
 
6709
- /***/ "./lib/icons/CopyIcon.js":
6710
- /*!*******************************!*\
6711
- !*** ./lib/icons/CopyIcon.js ***!
6712
- \*******************************/
7108
+ /***/ "./lib/icons/DatabaseOutlineIcon.js":
7109
+ /*!******************************************!*\
7110
+ !*** ./lib/icons/DatabaseOutlineIcon.js ***!
7111
+ \******************************************/
6713
7112
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6714
7113
 
6715
7114
  __webpack_require__.r(__webpack_exports__);
@@ -6723,13 +7122,10 @@ __webpack_require__.r(__webpack_exports__);
6723
7122
  * Distributed under the terms of the GNU Affero General Public License v3.0 License.
6724
7123
  */
6725
7124
 
6726
- const CopyIcon = () => (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 10 11", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
7125
+ const DatabaseOutlineIcon = () => (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", { width: "14", height: "14", viewBox: "0 0 82 96", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
6727
7126
  react__WEBPACK_IMPORTED_MODULE_0___default().createElement("g", { fill: "currentColor" },
6728
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", { d: "M3.12502 4.03283H4.27968C4.35507 4.02072 4.4082 3.95276 4.40156 3.87658V2.59542C4.25976 2.64425 4.13359 2.72979 4.03593 2.84385L3.32343 3.65323C3.22929 3.76299 3.16172 3.89307 3.125 4.03291L3.12502 4.03283Z" }),
6729
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", { d: "M7.75784 2.55308H4.70626V3.87342C4.71524 4.12263 4.5211 4.33201 4.27188 4.34217H3.0813V9.2C3.08208 9.56993 3.38012 9.8707 3.75005 9.875H7.75788C7.93757 9.87578 8.11022 9.80508 8.23757 9.67852C8.3653 9.55195 8.43717 9.37969 8.43757 9.2V3.22808C8.43718 3.0484 8.3653 2.87613 8.23757 2.74957C8.11022 2.623 7.93757 2.5523 7.75788 2.55308H7.75784Z" }),
6730
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", { d: "M3.80163 2.62967C4.01452 2.38553 4.32155 2.24373 4.64538 2.2406H6.91879V1.79998C6.91801 1.43005 6.61997 1.12928 6.25004 1.12498H3.19221V2.44531C3.20119 2.69453 3.00705 2.9039 2.75783 2.91406H1.5625V7.77189C1.56328 8.14416 1.86523 8.44611 2.2375 8.44689H2.76407V4.30631C2.76172 3.98795 2.87578 3.67974 3.08438 3.43914L3.80163 2.62967Z" }),
6731
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", { d: "M2.75783 2.60467C2.83322 2.59256 2.88635 2.52459 2.87971 2.44842V1.16725C2.74182 1.21569 2.61916 1.29928 2.52346 1.40943L1.80783 2.21881C1.71096 2.33013 1.64065 2.46217 1.60315 2.60474L2.75783 2.60467Z" }))));
6732
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CopyIcon);
7127
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", { d: "M41 95.5C61.0983 95.5 81.4446 90.198 81.4446 80.0651V15.9349C81.4403 5.80206 61.0963 0.5 41 0.5C20.9037 0.5 0.559864 5.80206 0.555621 15.9349L0.55542 80.0651C0.55542 90.198 20.9017 95.5 41 95.5ZM41 6.83333C63.0713 6.83333 75.1112 12.8476 75.1112 15.938C75.1112 19.0284 63.0713 25.0432 41 25.0432C18.9287 25.0432 6.88875 19.0284 6.88875 15.938C6.88875 12.8476 18.9287 6.83333 41 6.83333ZM6.88875 24.6315C14.4639 29.0832 27.7848 31.3765 41 31.3765C54.2152 31.3765 67.5361 29.0832 75.1112 24.6315V37.3079C75.1112 40.4003 63.0713 46.4198 41 46.4198C18.9287 46.4198 6.88875 40.4003 6.88875 37.3079L6.88875 24.6315ZM6.88875 46.0052C14.4639 50.4589 27.7848 52.7531 41 52.7531C54.2152 52.7531 67.5361 50.4589 75.1112 46.0052V58.6916C75.1112 61.7805 63.0713 67.7932 41 67.7932C18.9287 67.7932 6.88875 61.7805 6.88875 58.6916L6.88875 46.0052ZM6.88875 67.383C14.4639 71.8337 27.7848 74.1265 41 74.1265C54.2152 74.1265 67.5361 71.8337 75.1112 67.383V80.0651C75.1112 83.1544 63.0713 89.1667 41 89.1667C18.9287 89.1667 6.88875 83.1544 6.88875 80.0651L6.88875 67.383Z" }))));
7128
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DatabaseOutlineIcon);
6733
7129
 
6734
7130
 
6735
7131
  /***/ }),
@@ -7166,6 +7562,7 @@ __webpack_require__.r(__webpack_exports__);
7166
7562
 
7167
7563
  __webpack_require__.r(__webpack_exports__);
7168
7564
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7565
+ /* harmony export */ getDatabaseConnections: () => (/* binding */ getDatabaseConnections),
7169
7566
  /* harmony export */ getRule: () => (/* binding */ getRule),
7170
7567
  /* harmony export */ getRules: () => (/* binding */ getRules),
7171
7568
  /* harmony export */ getSetting: () => (/* binding */ getSetting),
@@ -7249,6 +7646,18 @@ const getRules = async () => {
7249
7646
  }
7250
7647
  return resp.data || [];
7251
7648
  };
7649
+ /************************************
7650
+
7651
+ DATABASE ENDPOINTS
7652
+
7653
+ ************************************/
7654
+ const getDatabaseConnections = async () => {
7655
+ const resp = await (0,_utils__WEBPACK_IMPORTED_MODULE_0__.requestAPI)('db/connections');
7656
+ if (resp.error) {
7657
+ throw new Error(resp.error.message);
7658
+ }
7659
+ return resp.data || {};
7660
+ };
7252
7661
 
7253
7662
 
7254
7663
  /***/ }),
@@ -9522,13 +9931,13 @@ ___CSS_LOADER_EXPORT___.push([module.id, `/*
9522
9931
 
9523
9932
  .agent-component-header {
9524
9933
  cursor: pointer;
9525
- padding: 10px;
9934
+ padding: 10px var(--chat-taskpane-tool-call-horizontal-padding);
9526
9935
  color: var(--jp-ui-font-color2);
9527
9936
  display: flex;
9528
9937
  justify-content: space-between;
9529
9938
  align-items: center;
9530
9939
  border: 1px solid var(--jp-cell-editor-border-color);
9531
- border-radius: 5px;
9940
+ border-radius: var(--chat-taskpane-item-border-radius);
9532
9941
  transition: background-color 0.2s ease, border-color 0.2s ease;
9533
9942
  }
9534
9943
 
@@ -9573,7 +9982,78 @@ ___CSS_LOADER_EXPORT___.push([module.id, `/*
9573
9982
 
9574
9983
  .agent-component-header-expand-icon.expanded {
9575
9984
  transform: rotate(90deg);
9576
- } `, "",{"version":3,"sources":["webpack://./style/AgentComponentHeader.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;IACI,eAAe;IACf,aAAa;IACb,+BAA+B;IAC/B,aAAa;IACb,8BAA8B;IAC9B,mBAAmB;IACnB,oDAAoD;IACpD,kBAAkB;IAClB,8DAA8D;AAClE;;AAEA;IACI,yCAAyC;AAC7C;;AAEA;IACI,YAAY;AAChB;;AAEA;IACI,YAAY;IACZ,0BAA0B;IAC1B,yCAAyC;AAC7C;;AAEA;IACI,YAAY;AAChB;;AAEA;IACI,yCAAyC;AAC7C;;AAEA;IACI,aAAa;IACb,mBAAmB;IACnB,SAAS;IACT,OAAO;IACP,YAAY;AAChB;;AAEA;IACI,cAAc;AAClB;;AAEA;IACI,cAAc;IACd,+BAA+B;AACnC;;AAEA;IACI,wBAAwB;AAC5B","sourcesContent":["/*\n * Copyright (c) Saga Inc.\n * Distributed under the terms of the GNU Affero General Public License v3.0 License.\n */\n\n.agent-component-header {\n cursor: pointer;\n padding: 10px;\n color: var(--jp-ui-font-color2);\n display: flex;\n justify-content: space-between;\n align-items: center;\n border: 1px solid var(--jp-cell-editor-border-color);\n border-radius: 5px;\n transition: background-color 0.2s ease, border-color 0.2s ease;\n}\n\n.agent-component-header:hover {\n background-color: var(--jp-layout-color3);\n}\n\n.agent-component-header.no-border {\n border: none;\n}\n\n.agent-component-header.expanded {\n border: none;\n border-radius: 5px 5px 0 0;\n background-color: var(--jp-layout-color2);\n}\n\n.agent-component-header.error-fixup {\n border: none;\n}\n\n.agent-component-header.error-fixup.expanded {\n background-color: var(--jp-layout-color2);\n}\n\n.agent-component-header-content {\n display: flex;\n align-items: center;\n gap: 10px;\n flex: 1;\n min-width: 0;\n}\n\n.agent-component-header-content svg {\n flex-shrink: 0;\n}\n\n.agent-component-header-expand-icon {\n flex-shrink: 0;\n transition: transform 0.2s ease;\n}\n\n.agent-component-header-expand-icon.expanded {\n transform: rotate(90deg);\n} "],"sourceRoot":""}]);
9985
+ } `, "",{"version":3,"sources":["webpack://./style/AgentComponentHeader.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;IACI,eAAe;IACf,+DAA+D;IAC/D,+BAA+B;IAC/B,aAAa;IACb,8BAA8B;IAC9B,mBAAmB;IACnB,oDAAoD;IACpD,sDAAsD;IACtD,8DAA8D;AAClE;;AAEA;IACI,yCAAyC;AAC7C;;AAEA;IACI,YAAY;AAChB;;AAEA;IACI,YAAY;IACZ,0BAA0B;IAC1B,yCAAyC;AAC7C;;AAEA;IACI,YAAY;AAChB;;AAEA;IACI,yCAAyC;AAC7C;;AAEA;IACI,aAAa;IACb,mBAAmB;IACnB,SAAS;IACT,OAAO;IACP,YAAY;AAChB;;AAEA;IACI,cAAc;AAClB;;AAEA;IACI,cAAc;IACd,+BAA+B;AACnC;;AAEA;IACI,wBAAwB;AAC5B","sourcesContent":["/*\n * Copyright (c) Saga Inc.\n * Distributed under the terms of the GNU Affero General Public License v3.0 License.\n */\n\n.agent-component-header {\n cursor: pointer;\n padding: 10px var(--chat-taskpane-tool-call-horizontal-padding);\n color: var(--jp-ui-font-color2);\n display: flex;\n justify-content: space-between;\n align-items: center;\n border: 1px solid var(--jp-cell-editor-border-color);\n border-radius: var(--chat-taskpane-item-border-radius);\n transition: background-color 0.2s ease, border-color 0.2s ease;\n}\n\n.agent-component-header:hover {\n background-color: var(--jp-layout-color3);\n}\n\n.agent-component-header.no-border {\n border: none;\n}\n\n.agent-component-header.expanded {\n border: none;\n border-radius: 5px 5px 0 0;\n background-color: var(--jp-layout-color2);\n}\n\n.agent-component-header.error-fixup {\n border: none;\n}\n\n.agent-component-header.error-fixup.expanded {\n background-color: var(--jp-layout-color2);\n}\n\n.agent-component-header-content {\n display: flex;\n align-items: center;\n gap: 10px;\n flex: 1;\n min-width: 0;\n}\n\n.agent-component-header-content svg {\n flex-shrink: 0;\n}\n\n.agent-component-header-expand-icon {\n flex-shrink: 0;\n transition: transform 0.2s ease;\n}\n\n.agent-component-header-expand-icon.expanded {\n transform: rotate(90deg);\n} "],"sourceRoot":""}]);
9986
+ // Exports
9987
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
9988
+
9989
+
9990
+ /***/ }),
9991
+
9992
+ /***/ "./node_modules/css-loader/dist/cjs.js!./style/AssumptionTool.css":
9993
+ /*!************************************************************************!*\
9994
+ !*** ./node_modules/css-loader/dist/cjs.js!./style/AssumptionTool.css ***!
9995
+ \************************************************************************/
9996
+ /***/ ((module, __webpack_exports__, __webpack_require__) => {
9997
+
9998
+ __webpack_require__.r(__webpack_exports__);
9999
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10000
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
10001
+ /* harmony export */ });
10002
+ /* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
10003
+ /* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
10004
+ /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
10005
+ /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
10006
+ // Imports
10007
+
10008
+
10009
+ var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
10010
+ // Module
10011
+ ___CSS_LOADER_EXPORT___.push([module.id, `/*
10012
+ * Copyright (c) Saga Inc.
10013
+ * Distributed under the terms of the GNU Affero General Public License v3.0 License.
10014
+ */
10015
+
10016
+ .assumption-tool-container {
10017
+ color: var(--jp-ui-font-color2);
10018
+ display: flex;
10019
+ justify-content: space-between;
10020
+ align-items: center;
10021
+ margin-top: 10px;
10022
+ margin-bottom: 10px;
10023
+ position: relative;
10024
+ padding: 8px var(--chat-taskpane-tool-call-horizontal-padding);
10025
+ border-radius: var(--chat-taskpane-item-border-radius);
10026
+ border: 1px solid var(--jp-cell-editor-border-color);
10027
+ cursor: default;
10028
+ }
10029
+
10030
+ .assumption-header-label {
10031
+ position: absolute;
10032
+ top: -10px;
10033
+ left: 12px;
10034
+ background-color: var(--chat-background-color);
10035
+ padding: 2px 8px;
10036
+ border-radius: 4px;
10037
+ font-size: 12px;
10038
+ color: var(--jp-ui-font-color2);
10039
+ font-style: italic;
10040
+ }
10041
+
10042
+ .assumption-content {
10043
+ display: flex;
10044
+ align-items: flex-start;
10045
+ gap: 8px;
10046
+ color: var(--jp-ui-font-color2);
10047
+ font-size: 14px;
10048
+ line-height: 1.4;
10049
+ margin: 0;
10050
+ padding: 10px 10px 5px 10px;
10051
+ }
10052
+
10053
+ .assumption-content ul {
10054
+ margin: 0;
10055
+ padding-left: 10px;
10056
+ }`, "",{"version":3,"sources":["webpack://./style/AssumptionTool.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;IACI,+BAA+B;IAC/B,aAAa;IACb,8BAA8B;IAC9B,mBAAmB;IACnB,gBAAgB;IAChB,mBAAmB;IACnB,kBAAkB;IAClB,8DAA8D;IAC9D,sDAAsD;IACtD,oDAAoD;IACpD,eAAe;AACnB;;AAEA;IACI,kBAAkB;IAClB,UAAU;IACV,UAAU;IACV,8CAA8C;IAC9C,gBAAgB;IAChB,kBAAkB;IAClB,eAAe;IACf,+BAA+B;IAC/B,kBAAkB;AACtB;;AAEA;IACI,aAAa;IACb,uBAAuB;IACvB,QAAQ;IACR,+BAA+B;IAC/B,eAAe;IACf,gBAAgB;IAChB,SAAS;IACT,2BAA2B;AAC/B;;AAEA;IACI,SAAS;IACT,kBAAkB;AACtB","sourcesContent":["/*\n * Copyright (c) Saga Inc.\n * Distributed under the terms of the GNU Affero General Public License v3.0 License.\n */\n\n.assumption-tool-container {\n color: var(--jp-ui-font-color2);\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-top: 10px;\n margin-bottom: 10px;\n position: relative;\n padding: 8px var(--chat-taskpane-tool-call-horizontal-padding);\n border-radius: var(--chat-taskpane-item-border-radius);\n border: 1px solid var(--jp-cell-editor-border-color);\n cursor: default;\n}\n\n.assumption-header-label {\n position: absolute;\n top: -10px;\n left: 12px;\n background-color: var(--chat-background-color);\n padding: 2px 8px;\n border-radius: 4px;\n font-size: 12px;\n color: var(--jp-ui-font-color2);\n font-style: italic;\n}\n\n.assumption-content {\n display: flex;\n align-items: flex-start;\n gap: 8px;\n color: var(--jp-ui-font-color2);\n font-size: 14px;\n line-height: 1.4;\n margin: 0;\n padding: 10px 10px 5px 10px;\n}\n\n.assumption-content ul {\n margin: 0;\n padding-left: 10px;\n}"],"sourceRoot":""}]);
9577
10057
  // Exports
9578
10058
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
9579
10059
 
@@ -9692,9 +10172,10 @@ ___CSS_LOADER_EXPORT___.push([module.id, `/*
9692
10172
 
9693
10173
  /* Style the dropdown */
9694
10174
  display: flex;
9695
- justify-content: space-evenly;
9696
- align-items: baseline;
10175
+ flex-direction: column;
9697
10176
  width: 100%;
10177
+ border: 1px solid var(--jp-border-color1);
10178
+ border-radius: 5px;
9698
10179
  }
9699
10180
 
9700
10181
  .chat-dropdown-list {
@@ -9716,6 +10197,9 @@ ___CSS_LOADER_EXPORT___.push([module.id, `/*
9716
10197
  align-items: center;
9717
10198
  gap: 8px;
9718
10199
  color: var(--jp-content-font-color1);
10200
+ overflow: hidden;
10201
+ text-overflow: ellipsis;
10202
+ white-space: nowrap;
9719
10203
  }
9720
10204
 
9721
10205
  .chat-dropdown-item:hover,
@@ -9723,18 +10207,6 @@ ___CSS_LOADER_EXPORT___.push([module.id, `/*
9723
10207
  background-color: var(--jp-layout-color3);
9724
10208
  }
9725
10209
 
9726
- .chat-dropdown-item:first-child {
9727
- /* Add rounded corners to the top of the first selected dropdown item */
9728
- border-top-left-radius: 5px;
9729
- border-top-right-radius: 5px;
9730
- }
9731
-
9732
- .chat-dropdown-item:last-child {
9733
- /* Add rounded corners to the bottom of the last selected dropdown item */
9734
- border-bottom-left-radius: 5px;
9735
- border-bottom-right-radius: 5px;
9736
- }
9737
-
9738
10210
  .chat-dropdown-item-type {
9739
10211
  color: var(--jp-brand-color1);
9740
10212
  font-family: var(--jp-code-font-family);
@@ -9771,7 +10243,36 @@ ___CSS_LOADER_EXPORT___.push([module.id, `/*
9771
10243
  .dropdown-item-disabled:hover {
9772
10244
  background-color: inherit;
9773
10245
  }
9774
- `, "",{"version":3,"sources":["webpack://./style/ChatDropdown.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;EACE,4CAA4C;EAC5C,kBAAkB;EAClB,aAAa;EACb,YAAY;EACZ,kBAAkB;;EAElB,uBAAuB;EACvB,aAAa;EACb,6BAA6B;EAC7B,qBAAqB;EACrB,WAAW;AACb;;AAEA;EACE,kBAAkB;EAClB,WAAW;EACX,kBAAkB;EAClB,yCAAyC;EACzC,qBAAqB;EACrB,UAAU;EACV,SAAS;EACT,WAAW;EACX,wCAAwC;AAC1C;;AAEA;EACE,YAAY;EACZ,eAAe;EACf,aAAa;EACb,mBAAmB;EACnB,QAAQ;EACR,oCAAoC;AACtC;;AAEA;;EAEE,yCAAyC;AAC3C;;AAEA;EACE,uEAAuE;EACvE,2BAA2B;EAC3B,4BAA4B;AAC9B;;AAEA;EACE,yEAAyE;EACzE,8BAA8B;EAC9B,+BAA+B;AACjC;;AAEA;EACE,6BAA6B;EAC7B,uCAAuC;EACvC,eAAe;EACf,WAAW;EACX,mBAAmB;EACnB,gBAAgB;EAChB,uBAAuB;AACzB;;AAEA;EACE,eAAe;EACf,aAAa;EACb,mBAAmB;EACnB,mBAAmB;EACnB,gBAAgB;EAChB,uBAAuB;AACzB;;AAEA;EACE,8BAA8B;EAC9B,eAAe;EACf,gBAAgB;EAChB,mBAAmB;EACnB,gBAAgB;EAChB,uBAAuB;AACzB;;AAEA;EACE,YAAY;EACZ,mBAAmB;AACrB;;AAEA;EACE,yBAAyB;AAC3B","sourcesContent":["/*\n * Copyright (c) Saga Inc.\n * Distributed under the terms of the GNU Affero General Public License v3.0 License.\n */\n\n.chat-dropdown {\n /* Position the dropdown in the right place*/\n position: absolute;\n z-index: 9999;\n bottom: 100%;\n margin-bottom: 5px;\n\n /* Style the dropdown */\n display: flex;\n justify-content: space-evenly;\n align-items: baseline;\n width: 100%;\n}\n\n.chat-dropdown-list {\n position: relative;\n border: 0px;\n border-radius: 5px;\n background-color: var(--jp-layout-color1);\n list-style-type: none;\n padding: 0;\n margin: 0;\n width: 100%;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n}\n\n.chat-dropdown-item {\n padding: 8px;\n cursor: pointer;\n display: flex;\n align-items: center;\n gap: 8px;\n color: var(--jp-content-font-color1);\n}\n\n.chat-dropdown-item:hover,\n.chat-dropdown-item.selected {\n background-color: var(--jp-layout-color3);\n}\n\n.chat-dropdown-item:first-child {\n /* Add rounded corners to the top of the first selected dropdown item */\n border-top-left-radius: 5px;\n border-top-right-radius: 5px;\n}\n\n.chat-dropdown-item:last-child {\n /* Add rounded corners to the bottom of the last selected dropdown item */\n border-bottom-left-radius: 5px;\n border-bottom-right-radius: 5px;\n}\n\n.chat-dropdown-item-type {\n color: var(--jp-brand-color1);\n font-family: var(--jp-code-font-family);\n min-width: 35px;\n width: 35px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.chat-dropdown-item-name {\n font-size: 15px;\n display: flex;\n align-items: center;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.chat-dropdown-item-parent-df {\n color: var(--muted-text-color);\n font-size: 12px;\n margin-left: 4px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.dropdown-item-disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.dropdown-item-disabled:hover {\n background-color: inherit;\n}\n"],"sourceRoot":""}]);
10246
+
10247
+ .chat-dropdown-search {
10248
+ padding: 8px;
10249
+ background-color: var(--jp-layout-color1);
10250
+ border-top-left-radius: 5px;
10251
+ border-top-right-radius: 5px;
10252
+ }
10253
+
10254
+ .chat-dropdown-search-input {
10255
+ width: 100%;
10256
+ padding: 6px 8px;
10257
+ border-radius: 3px;
10258
+ font-size: 12px;
10259
+ font-family: var(--jp-ui-font-family);
10260
+ background-color: var(--jp-layout-color1);
10261
+ color: var(--jp-content-font-color1);
10262
+ outline: none;
10263
+ border: none;
10264
+ box-sizing: border-box;
10265
+ }
10266
+
10267
+ .chat-dropdown-search-input:focus {
10268
+ outline: none;
10269
+ border: none;
10270
+ }
10271
+
10272
+ .chat-dropdown-search-input::placeholder {
10273
+ color: var(--jp-content-font-color3);
10274
+ }
10275
+ `, "",{"version":3,"sources":["webpack://./style/ChatDropdown.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;EACE,4CAA4C;EAC5C,kBAAkB;EAClB,aAAa;EACb,YAAY;EACZ,kBAAkB;;EAElB,uBAAuB;EACvB,aAAa;EACb,sBAAsB;EACtB,WAAW;EACX,yCAAyC;EACzC,kBAAkB;AACpB;;AAEA;EACE,kBAAkB;EAClB,WAAW;EACX,kBAAkB;EAClB,yCAAyC;EACzC,qBAAqB;EACrB,UAAU;EACV,SAAS;EACT,WAAW;EACX,wCAAwC;AAC1C;;AAEA;EACE,YAAY;EACZ,eAAe;EACf,aAAa;EACb,mBAAmB;EACnB,QAAQ;EACR,oCAAoC;EACpC,gBAAgB;EAChB,uBAAuB;EACvB,mBAAmB;AACrB;;AAEA;;EAEE,yCAAyC;AAC3C;;AAEA;EACE,6BAA6B;EAC7B,uCAAuC;EACvC,eAAe;EACf,WAAW;EACX,mBAAmB;EACnB,gBAAgB;EAChB,uBAAuB;AACzB;;AAEA;EACE,eAAe;EACf,aAAa;EACb,mBAAmB;EACnB,mBAAmB;EACnB,gBAAgB;EAChB,uBAAuB;AACzB;;AAEA;EACE,8BAA8B;EAC9B,eAAe;EACf,gBAAgB;EAChB,mBAAmB;EACnB,gBAAgB;EAChB,uBAAuB;AACzB;;AAEA;EACE,YAAY;EACZ,mBAAmB;AACrB;;AAEA;EACE,yBAAyB;AAC3B;;AAEA;EACE,YAAY;EACZ,yCAAyC;EACzC,2BAA2B;EAC3B,4BAA4B;AAC9B;;AAEA;EACE,WAAW;EACX,gBAAgB;EAChB,kBAAkB;EAClB,eAAe;EACf,qCAAqC;EACrC,yCAAyC;EACzC,oCAAoC;EACpC,aAAa;EACb,YAAY;EACZ,sBAAsB;AACxB;;AAEA;EACE,aAAa;EACb,YAAY;AACd;;AAEA;EACE,oCAAoC;AACtC","sourcesContent":["/*\n * Copyright (c) Saga Inc.\n * Distributed under the terms of the GNU Affero General Public License v3.0 License.\n */\n\n.chat-dropdown {\n /* Position the dropdown in the right place*/\n position: absolute;\n z-index: 9999;\n bottom: 100%;\n margin-bottom: 5px;\n\n /* Style the dropdown */\n display: flex;\n flex-direction: column;\n width: 100%;\n border: 1px solid var(--jp-border-color1);\n border-radius: 5px;\n}\n\n.chat-dropdown-list {\n position: relative;\n border: 0px;\n border-radius: 5px;\n background-color: var(--jp-layout-color1);\n list-style-type: none;\n padding: 0;\n margin: 0;\n width: 100%;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n}\n\n.chat-dropdown-item {\n padding: 8px;\n cursor: pointer;\n display: flex;\n align-items: center;\n gap: 8px;\n color: var(--jp-content-font-color1);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.chat-dropdown-item:hover,\n.chat-dropdown-item.selected {\n background-color: var(--jp-layout-color3);\n}\n\n.chat-dropdown-item-type {\n color: var(--jp-brand-color1);\n font-family: var(--jp-code-font-family);\n min-width: 35px;\n width: 35px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.chat-dropdown-item-name {\n font-size: 15px;\n display: flex;\n align-items: center;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.chat-dropdown-item-parent-df {\n color: var(--muted-text-color);\n font-size: 12px;\n margin-left: 4px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.dropdown-item-disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.dropdown-item-disabled:hover {\n background-color: inherit;\n}\n\n.chat-dropdown-search {\n padding: 8px;\n background-color: var(--jp-layout-color1);\n border-top-left-radius: 5px;\n border-top-right-radius: 5px;\n}\n\n.chat-dropdown-search-input {\n width: 100%;\n padding: 6px 8px;\n border-radius: 3px;\n font-size: 12px;\n font-family: var(--jp-ui-font-family);\n background-color: var(--jp-layout-color1);\n color: var(--jp-content-font-color1);\n outline: none;\n border: none;\n box-sizing: border-box;\n}\n\n.chat-dropdown-search-input:focus {\n outline: none;\n border: none;\n}\n\n.chat-dropdown-search-input::placeholder {\n color: var(--jp-content-font-color3);\n}\n"],"sourceRoot":""}]);
9775
10276
  // Exports
9776
10277
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
9777
10278
 
@@ -9841,7 +10342,6 @@ ___CSS_LOADER_EXPORT___.push([module.id, `/*
9841
10342
 
9842
10343
  .active-cell-preview-container {
9843
10344
  padding: 10px;
9844
- background-color: var(--chat-user-message-background-color);
9845
10345
  }
9846
10346
 
9847
10347
  .chat-input-container:focus-within {
@@ -9864,7 +10364,24 @@ ___CSS_LOADER_EXPORT___.push([module.id, `/*
9864
10364
  .chat-input:focus::placeholder {
9865
10365
  color: var(--jp-ui-font-color3);
9866
10366
  }
9867
- `, "",{"version":3,"sources":["webpack://./style/ChatInput.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;EACE,gBAAgB;EAChB,SAAS;EACT,cAAc;EACd,gBAAgB;EAChB,2DAA2D;EAC3D;;;iCAG+B;EAC/B,WAAW;EACX,mBAAmB;EACnB,iDAAiD;AACnD;;AAEA;EACE,kBAAkB;EAClB,mBAAmB;AACrB;;AAEA;EACE,aAAa;EACb,YAAY;EACZ,YAAY;EACZ,WAAW;EACX,aAAa;EACb,kBAAkB;EAClB,sBAAsB;EACtB,yBAAyB;EACzB,2DAA2D;EAC3D,eAAe;EACf,gBAAgB;EAChB,qCAAqC;EACrC,gBAAgB;EAChB,iDAAiD;AACnD;;AAEA;EACE,aAAa;EACb,2DAA2D;AAC7D;;AAEA;EACE,2BAA2B;EAC3B;;;iCAG+B;AACjC;;AAEA;EACE,+BAA+B;AACjC;;AAEA;EACE,+BAA+B;EAC/B,2BAA2B;AAC7B;;AAEA;EACE,+BAA+B;AACjC","sourcesContent":["/*\n * Copyright (c) Saga Inc.\n * Distributed under the terms of the GNU Affero General Public License v3.0 License.\n */\n\n.chat-input-container {\n position: sticky;\n bottom: 0;\n margin: 10px 0;\n margin-top: auto;\n background-color: var(--chat-user-message-background-color);\n box-shadow: \n 0 4px 12px rgba(0, 0, 0, 0.08),\n 0 2px 4px rgba(0, 0, 0, 0.06),\n 0 0 0 1px rgba(0, 0, 0, 0.02);\n width: 100%;\n border-radius: 12px;\n transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n.chat-input-text-area-container {\n position: relative;\n height: min-content;\n}\n\n.chat-input {\n outline: none;\n border: none;\n resize: none;\n width: 100%;\n padding: 10px;\n overflow-y: hidden;\n box-sizing: border-box;\n flex-shrink: 0 !important;\n background-color: var(--chat-user-message-background-color);\n font-size: 12px;\n font-weight: 400;\n font-family: var(--jp-ui-font-family);\n line-height: 1.2;\n transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n.active-cell-preview-container {\n padding: 10px;\n background-color: var(--chat-user-message-background-color);\n}\n\n.chat-input-container:focus-within {\n transform: translateY(-1px);\n box-shadow: \n 0 2px 8px rgba(0, 0, 0, 0.12),\n 0 8px 16px rgba(0, 0, 0, 0.08),\n 0 0 0 1px rgba(0, 0, 0, 0.04);\n}\n\n.chat-input:focus {\n color: var(--jp-ui-font-color1);\n}\n\n.chat-input::placeholder {\n color: var(--jp-ui-font-color2);\n transition: color 0.2s ease;\n}\n\n.chat-input:focus::placeholder {\n color: var(--jp-ui-font-color3);\n}\n"],"sourceRoot":""}]);
10367
+
10368
+ .context-button {
10369
+ display: flex;
10370
+ align-items: center;
10371
+ background-color: var(--jp-layout-color2);
10372
+ border: 1px solid var(--jp-border-color1);
10373
+ border-radius: 3px;
10374
+ padding: 4px 8px;
10375
+ font-size: 12px;
10376
+ height: var(--chat-context-button-height);
10377
+ cursor: pointer;
10378
+ color: var(--jp-content-font-color1);
10379
+ transition: background-color 0.2s ease;
10380
+ }
10381
+
10382
+ .context-button:hover {
10383
+ background-color: var(--jp-layout-color3);
10384
+ }`, "",{"version":3,"sources":["webpack://./style/ChatInput.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;EACE,gBAAgB;EAChB,SAAS;EACT,cAAc;EACd,gBAAgB;EAChB,2DAA2D;EAC3D;;;iCAG+B;EAC/B,WAAW;EACX,mBAAmB;EACnB,iDAAiD;AACnD;;AAEA;EACE,kBAAkB;EAClB,mBAAmB;AACrB;;AAEA;EACE,aAAa;EACb,YAAY;EACZ,YAAY;EACZ,WAAW;EACX,aAAa;EACb,kBAAkB;EAClB,sBAAsB;EACtB,yBAAyB;EACzB,2DAA2D;EAC3D,eAAe;EACf,gBAAgB;EAChB,qCAAqC;EACrC,gBAAgB;EAChB,iDAAiD;AACnD;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,2BAA2B;EAC3B;;;iCAG+B;AACjC;;AAEA;EACE,+BAA+B;AACjC;;AAEA;EACE,+BAA+B;EAC/B,2BAA2B;AAC7B;;AAEA;EACE,+BAA+B;AACjC;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,yCAAyC;EACzC,yCAAyC;EACzC,kBAAkB;EAClB,gBAAgB;EAChB,eAAe;EACf,yCAAyC;EACzC,eAAe;EACf,oCAAoC;EACpC,sCAAsC;AACxC;;AAEA;EACE,yCAAyC;AAC3C","sourcesContent":["/*\n * Copyright (c) Saga Inc.\n * Distributed under the terms of the GNU Affero General Public License v3.0 License.\n */\n\n.chat-input-container {\n position: sticky;\n bottom: 0;\n margin: 10px 0;\n margin-top: auto;\n background-color: var(--chat-user-message-background-color);\n box-shadow: \n 0 4px 12px rgba(0, 0, 0, 0.08),\n 0 2px 4px rgba(0, 0, 0, 0.06),\n 0 0 0 1px rgba(0, 0, 0, 0.02);\n width: 100%;\n border-radius: 12px;\n transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n.chat-input-text-area-container {\n position: relative;\n height: min-content;\n}\n\n.chat-input {\n outline: none;\n border: none;\n resize: none;\n width: 100%;\n padding: 10px;\n overflow-y: hidden;\n box-sizing: border-box;\n flex-shrink: 0 !important;\n background-color: var(--chat-user-message-background-color);\n font-size: 12px;\n font-weight: 400;\n font-family: var(--jp-ui-font-family);\n line-height: 1.2;\n transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n.active-cell-preview-container {\n padding: 10px;\n}\n\n.chat-input-container:focus-within {\n transform: translateY(-1px);\n box-shadow: \n 0 2px 8px rgba(0, 0, 0, 0.12),\n 0 8px 16px rgba(0, 0, 0, 0.08),\n 0 0 0 1px rgba(0, 0, 0, 0.04);\n}\n\n.chat-input:focus {\n color: var(--jp-ui-font-color1);\n}\n\n.chat-input::placeholder {\n color: var(--jp-ui-font-color2);\n transition: color 0.2s ease;\n}\n\n.chat-input:focus::placeholder {\n color: var(--jp-ui-font-color3);\n}\n\n.context-button {\n display: flex;\n align-items: center;\n background-color: var(--jp-layout-color2);\n border: 1px solid var(--jp-border-color1);\n border-radius: 3px;\n padding: 4px 8px;\n font-size: 12px;\n height: var(--chat-context-button-height);\n cursor: pointer;\n color: var(--jp-content-font-color1);\n transition: background-color 0.2s ease;\n}\n\n.context-button:hover {\n background-color: var(--jp-layout-color3);\n}"],"sourceRoot":""}]);
9868
10385
  // Exports
9869
10386
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
9870
10387
 
@@ -9901,7 +10418,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, `/*
9901
10418
  box-sizing: border-box;
9902
10419
  width: 100%;
9903
10420
  font-size: 14px;
9904
- border-radius: 5px;
10421
+ border-radius: var(--chat-taskpane-item-border-radius);
9905
10422
  padding: 0 var(--chat-taskpane-item-indent);
9906
10423
  }
9907
10424
 
@@ -9928,7 +10445,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, `/*
9928
10445
  flex-direction: row;
9929
10446
  gap: 8px;
9930
10447
  margin-top: 10px;
9931
- margin-bottom: 10px;
10448
+ margin-bottom: 4px;
9932
10449
  flex-wrap: wrap;
9933
10450
  }
9934
10451
 
@@ -10043,7 +10560,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, `/*
10043
10560
  color: var(--purple-700);
10044
10561
  text-decoration: underline;
10045
10562
  }
10046
- `, "",{"version":3,"sources":["webpack://./style/ChatMessage.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;EACE,kBAAkB;EAClB,mBAAmB;EACnB,sBAAsB;EACtB,WAAW;EACX,eAAe;EACf,kBAAkB;EAClB,2CAA2C;AAC7C;;AAEA;EACE,mBAAmB;AACrB;;AAEA;EACE,qBAAqB;AACvB;;AAEA;EACE,2DAA2D;EAC3D,0CAA0C;EAC1C,aAAa;AACf;;AAEA;EACE,+CAA+C;AACjD;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,QAAQ;EACR,gBAAgB;EAChB,mBAAmB;EACnB,eAAe;AACjB;;AAEA;EACE,gBAAgB;EAChB,sBAAsB;EACtB,SAAS;EACT,gBAAgB;AAClB;;AAEA;EACE,mBAAmB;AACrB;;AAEA,qCAAqC;AACrC;EACE,kBAAkB;EAClB,WAAW;EACX,UAAU;EACV,aAAa;EACb,kBAAkB;EAClB,gBAAgB,EAAE,0DAA0D;AAC9E;;AAEA,qCAAqC;AACrC;;EAEE,eAAe;EACf,UAAU;EACV;;qCAEmC;EACnC,yCAAyC;EACzC,YAAY;EACZ,aAAa;EACb,mBAAmB;EACnB,uBAAuB;EACvB,oCAAoC;AACtC;;AAEA,gCAAgC;AAChC;EACE,WAAW;EACX,YAAY;EACZ,UAAU;EACV,gBAAgB,EAAE,oCAAoC;AACxD;;AAEA,yCAAyC;AACzC;EACE,+CAA+C;AACjD;;AAEA,8FAA8F;AAC9F;;EAEE,gBAAgB;AAClB;;AAEA,2BAA2B;AAC3B;EACE,kBAAkB;EAClB,YAAY;EACZ,kBAAkB;AACpB;;AAEA,mBAAmB;AACnB;EACE,oCAAoC;AACtC;;AAEA,iBAAiB;AACjB;;EAEE,yCAAyC;AAC3C;;AAEA,kCAAkC;AAClC;;EAEE,UAAU;AACZ;;AAEA;EACE,aAAa;EACb,QAAQ;EACR,YAAY;AACd;;AAEA;EACE,iBAAiB;EACjB,kBAAkB;EAClB,yCAAyC;EACzC,oCAAoC;EACpC,yCAAyC;EACzC,eAAe;AACjB;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,mCAAmC;EACnC,kBAAkB;EAClB,aAAa;EACb,mCAAmC;EACnC,sBAAsB;AACxB;;AAEA;EACE,wBAAwB;EACxB,0BAA0B;AAC5B","sourcesContent":["/*\n * Copyright (c) Saga Inc.\n * Distributed under the terms of the GNU Affero General Public License v3.0 License.\n */\n\n.message {\n position: relative;\n height: min-content;\n box-sizing: border-box;\n width: 100%;\n font-size: 14px;\n border-radius: 5px;\n padding: 0 var(--chat-taskpane-item-indent);\n}\n\n.message:not(.chat-input) {\n margin-bottom: 20px;\n}\n\n.message:hover .message-start-editing-button {\n opacity: 1 !important;\n}\n\n.message-user {\n background-color: var(--chat-user-message-background-color);\n color: var(--chat-user-message-font-color);\n padding: 10px;\n}\n\n.message-assistant-chat {\n color: var(--chat-assistant-message-font-color);\n}\n\n.chat-message-buttons {\n display: flex;\n flex-direction: row;\n gap: 8px;\n margin-top: 10px;\n margin-bottom: 10px;\n flex-wrap: wrap;\n}\n\n.chat-taskpane-smart-debug-error-message {\n white-space: pre;\n font-family: monospace;\n margin: 0;\n overflow-x: auto;\n}\n\n.message-text {\n align-items: center;\n}\n\n/* Message Action Buttons Container */\n.message-action-buttons {\n position: absolute;\n bottom: 8px;\n right: 8px;\n display: flex;\n border-radius: 4px;\n overflow: hidden; /* Ensures inner buttons don't break the rounded corners */\n}\n\n/* Common styles for action buttons */\n.message-action-buttons button,\n.message-start-editing-button {\n cursor: pointer;\n opacity: 0;\n transition:\n opacity 0.2s ease-in-out,\n background-color 0.2s ease-in-out;\n background-color: var(--jp-layout-color3);\n border: none;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--jp-content-font-color1);\n}\n\n/* Action buttons in the group */\n.message-action-buttons button {\n width: 28px;\n height: 28px;\n padding: 0;\n border-radius: 0; /* Remove individual button radius */\n}\n\n/* Add subtle separator between buttons */\n.message-action-buttons button:not(:last-child) {\n border-right: 1px solid var(--jp-border-color1);\n}\n\n/* Remove the individual button radius styles since we're handling it at the container level */\n.message-action-buttons button:first-child,\n.message-action-buttons button:last-child {\n border-radius: 0;\n}\n\n/* Standalone edit button */\n.message-start-editing-button {\n position: relative;\n padding: 4px;\n border-radius: 4px;\n}\n\n/* SVG icon color */\n.message-action-buttons button svg {\n color: var(--jp-content-font-color1);\n}\n\n/* Hover states */\n.message-action-buttons button:hover,\n.message-start-editing-button:hover {\n background-color: var(--jp-layout-color4);\n}\n\n/* Show buttons on message hover */\n.message:hover .message-action-buttons button,\n.message:hover .message-start-editing-button {\n opacity: 1;\n}\n\n.message-edit-buttons {\n display: flex;\n gap: 8px;\n padding: 5px;\n}\n\n.message-edit-buttons button {\n padding: 4px 12px;\n border-radius: 4px;\n background-color: var(--jp-layout-color1);\n color: var(--jp-content-font-color1);\n border: 1px solid var(--jp-border-color1);\n cursor: pointer;\n}\n\n.message-edit-buttons button:hover {\n background-color: var(--jp-layout-color2);\n}\n\n.chat-message-alert {\n background-color: var(--purple-300);\n border-radius: 5px;\n padding: 10px;\n border: 1px solid var(--purple-500);\n color: var(--grey-900);\n}\n\n.chat-message-alert a {\n color: var(--purple-700);\n text-decoration: underline;\n}\n"],"sourceRoot":""}]);
10563
+ `, "",{"version":3,"sources":["webpack://./style/ChatMessage.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;EACE,kBAAkB;EAClB,mBAAmB;EACnB,sBAAsB;EACtB,WAAW;EACX,eAAe;EACf,sDAAsD;EACtD,2CAA2C;AAC7C;;AAEA;EACE,mBAAmB;AACrB;;AAEA;EACE,qBAAqB;AACvB;;AAEA;EACE,2DAA2D;EAC3D,0CAA0C;EAC1C,aAAa;AACf;;AAEA;EACE,+CAA+C;AACjD;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,QAAQ;EACR,gBAAgB;EAChB,kBAAkB;EAClB,eAAe;AACjB;;AAEA;EACE,gBAAgB;EAChB,sBAAsB;EACtB,SAAS;EACT,gBAAgB;AAClB;;AAEA;EACE,mBAAmB;AACrB;;AAEA,qCAAqC;AACrC;EACE,kBAAkB;EAClB,WAAW;EACX,UAAU;EACV,aAAa;EACb,kBAAkB;EAClB,gBAAgB,EAAE,0DAA0D;AAC9E;;AAEA,qCAAqC;AACrC;;EAEE,eAAe;EACf,UAAU;EACV;;qCAEmC;EACnC,yCAAyC;EACzC,YAAY;EACZ,aAAa;EACb,mBAAmB;EACnB,uBAAuB;EACvB,oCAAoC;AACtC;;AAEA,gCAAgC;AAChC;EACE,WAAW;EACX,YAAY;EACZ,UAAU;EACV,gBAAgB,EAAE,oCAAoC;AACxD;;AAEA,yCAAyC;AACzC;EACE,+CAA+C;AACjD;;AAEA,8FAA8F;AAC9F;;EAEE,gBAAgB;AAClB;;AAEA,2BAA2B;AAC3B;EACE,kBAAkB;EAClB,YAAY;EACZ,kBAAkB;AACpB;;AAEA,mBAAmB;AACnB;EACE,oCAAoC;AACtC;;AAEA,iBAAiB;AACjB;;EAEE,yCAAyC;AAC3C;;AAEA,kCAAkC;AAClC;;EAEE,UAAU;AACZ;;AAEA;EACE,aAAa;EACb,QAAQ;EACR,YAAY;AACd;;AAEA;EACE,iBAAiB;EACjB,kBAAkB;EAClB,yCAAyC;EACzC,oCAAoC;EACpC,yCAAyC;EACzC,eAAe;AACjB;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,mCAAmC;EACnC,kBAAkB;EAClB,aAAa;EACb,mCAAmC;EACnC,sBAAsB;AACxB;;AAEA;EACE,wBAAwB;EACxB,0BAA0B;AAC5B","sourcesContent":["/*\n * Copyright (c) Saga Inc.\n * Distributed under the terms of the GNU Affero General Public License v3.0 License.\n */\n\n.message {\n position: relative;\n height: min-content;\n box-sizing: border-box;\n width: 100%;\n font-size: 14px;\n border-radius: var(--chat-taskpane-item-border-radius);\n padding: 0 var(--chat-taskpane-item-indent);\n}\n\n.message:not(.chat-input) {\n margin-bottom: 20px;\n}\n\n.message:hover .message-start-editing-button {\n opacity: 1 !important;\n}\n\n.message-user {\n background-color: var(--chat-user-message-background-color);\n color: var(--chat-user-message-font-color);\n padding: 10px;\n}\n\n.message-assistant-chat {\n color: var(--chat-assistant-message-font-color);\n}\n\n.chat-message-buttons {\n display: flex;\n flex-direction: row;\n gap: 8px;\n margin-top: 10px;\n margin-bottom: 4px;\n flex-wrap: wrap;\n}\n\n.chat-taskpane-smart-debug-error-message {\n white-space: pre;\n font-family: monospace;\n margin: 0;\n overflow-x: auto;\n}\n\n.message-text {\n align-items: center;\n}\n\n/* Message Action Buttons Container */\n.message-action-buttons {\n position: absolute;\n bottom: 8px;\n right: 8px;\n display: flex;\n border-radius: 4px;\n overflow: hidden; /* Ensures inner buttons don't break the rounded corners */\n}\n\n/* Common styles for action buttons */\n.message-action-buttons button,\n.message-start-editing-button {\n cursor: pointer;\n opacity: 0;\n transition:\n opacity 0.2s ease-in-out,\n background-color 0.2s ease-in-out;\n background-color: var(--jp-layout-color3);\n border: none;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--jp-content-font-color1);\n}\n\n/* Action buttons in the group */\n.message-action-buttons button {\n width: 28px;\n height: 28px;\n padding: 0;\n border-radius: 0; /* Remove individual button radius */\n}\n\n/* Add subtle separator between buttons */\n.message-action-buttons button:not(:last-child) {\n border-right: 1px solid var(--jp-border-color1);\n}\n\n/* Remove the individual button radius styles since we're handling it at the container level */\n.message-action-buttons button:first-child,\n.message-action-buttons button:last-child {\n border-radius: 0;\n}\n\n/* Standalone edit button */\n.message-start-editing-button {\n position: relative;\n padding: 4px;\n border-radius: 4px;\n}\n\n/* SVG icon color */\n.message-action-buttons button svg {\n color: var(--jp-content-font-color1);\n}\n\n/* Hover states */\n.message-action-buttons button:hover,\n.message-start-editing-button:hover {\n background-color: var(--jp-layout-color4);\n}\n\n/* Show buttons on message hover */\n.message:hover .message-action-buttons button,\n.message:hover .message-start-editing-button {\n opacity: 1;\n}\n\n.message-edit-buttons {\n display: flex;\n gap: 8px;\n padding: 5px;\n}\n\n.message-edit-buttons button {\n padding: 4px 12px;\n border-radius: 4px;\n background-color: var(--jp-layout-color1);\n color: var(--jp-content-font-color1);\n border: 1px solid var(--jp-border-color1);\n cursor: pointer;\n}\n\n.message-edit-buttons button:hover {\n background-color: var(--jp-layout-color2);\n}\n\n.chat-message-alert {\n background-color: var(--purple-300);\n border-radius: 5px;\n padding: 10px;\n border: 1px solid var(--purple-500);\n color: var(--grey-900);\n}\n\n.chat-message-alert a {\n color: var(--purple-700);\n text-decoration: underline;\n}\n"],"sourceRoot":""}]);
10047
10564
  // Exports
10048
10565
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
10049
10566
 
@@ -10741,20 +11258,32 @@ ___CSS_LOADER_EXPORT___.push([module.id, `/*
10741
11258
  display: flex;
10742
11259
  justify-content: space-between;
10743
11260
  align-items: center;
10744
- margin-bottom: 12px;
11261
+ margin-bottom: 8px;
10745
11262
  }
10746
11263
 
10747
- .connection-card-header h3 {
10748
- margin: 0;
10749
- font-size: 1.1em;
11264
+ .connection-alias {
11265
+ font-size: 1.2em;
11266
+ font-weight: bold;
10750
11267
  color: var(--jp-ui-font-color1);
11268
+ margin: 0;
10751
11269
  }
10752
11270
 
10753
11271
  .connection-type {
10754
- font-size: 0.9em;
10755
- color: var(--jp-ui-font-color2);
11272
+ background: var(--purple-100);
11273
+ color: var(--purple-700);
11274
+ border-radius: 12px;
11275
+ padding: 2px 10px;
11276
+ font-size: 0.85em;
11277
+ font-weight: 500;
10756
11278
  text-transform: capitalize;
10757
- margin-bottom: 8px;
11279
+ margin-left: 8px;
11280
+ }
11281
+
11282
+ .connection-divider {
11283
+ height: 1px;
11284
+ background: var(--jp-border-color2);
11285
+ margin: 8px 0 12px 0;
11286
+ width: 100%;
10758
11287
  }
10759
11288
 
10760
11289
  .connection-details {
@@ -10794,7 +11323,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, `/*
10794
11323
  .confirmation-buttons {
10795
11324
  display: flex;
10796
11325
  gap: 8px;
10797
- } `, "",{"version":3,"sources":["webpack://./style/DatabasePage.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;IACI,aAAa;IACb,4DAA4D;IAC5D,SAAS;IACT,gBAAgB;AACpB;;AAEA;IACI,mCAAmC;IACnC,yCAAyC;IACzC,kBAAkB;IAClB,aAAa;IACb,yBAAyB;IACzB,aAAa;IACb,sBAAsB;AAC1B;;AAEA;IACI,mCAAmC;AACvC;;AAEA;IACI,aAAa;IACb,8BAA8B;IAC9B,mBAAmB;IACnB,mBAAmB;AACvB;;AAEA;IACI,SAAS;IACT,gBAAgB;IAChB,+BAA+B;AACnC;;AAEA;IACI,gBAAgB;IAChB,+BAA+B;IAC/B,0BAA0B;IAC1B,kBAAkB;AACtB;;AAEA;IACI,YAAY;AAChB;;AAEA;IACI,aAAa;IACb,gBAAgB;IAChB,+BAA+B;AACnC;;AAEA;IACI,aAAa;IACb,gBAAgB;IAChB,QAAQ;AACZ;;AAEA;IACI,gBAAgB;IAChB,gBAAgB;AACpB;;AAEA;IACI,6BAA6B;AACjC;;AAEA;IACI,wCAAwC;IACxC,YAAY;AAChB;;AAEA;IACI,kBAAkB;AACtB;;AAEA;IACI,aAAa;IACb,QAAQ;AACZ","sourcesContent":["/*\n * Copyright (c) Saga Inc.\n * Distributed under the terms of the GNU Affero General Public License v3.0 License.\n */\n\n.connections-grid {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));\n gap: 20px;\n margin-top: 20px;\n}\n\n.connection-card {\n background: var(--jp-layout-color0);\n border: 1px solid var(--jp-border-color1);\n border-radius: 8px;\n padding: 16px;\n transition: all 0.2s ease;\n display: flex;\n flex-direction: column;\n}\n\n.connection-card:hover {\n border: 1px solid var(--purple-500);\n}\n\n.connection-card-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 12px;\n}\n\n.connection-card-header h3 {\n margin: 0;\n font-size: 1.1em;\n color: var(--jp-ui-font-color1);\n}\n\n.connection-type {\n font-size: 0.9em;\n color: var(--jp-ui-font-color2);\n text-transform: capitalize;\n margin-bottom: 8px;\n}\n\n.connection-details {\n flex-grow: 1;\n}\n\n.connection-details p {\n margin: 4px 0;\n font-size: 0.9em;\n color: var(--jp-ui-font-color2);\n}\n\n.connection-actions {\n display: flex;\n margin-top: 12px;\n gap: 8px;\n}\n\n.connection-actions button {\n padding: 4px 8px;\n font-size: 0.9em;\n}\n\n.connection-actions .delete-button {\n color: var(--jp-error-color1);\n}\n\n.connection-actions .delete-button:hover {\n background-color: var(--jp-error-color2);\n color: white;\n}\n\n.delete-container {\n position: relative;\n}\n\n.confirmation-buttons {\n display: flex;\n gap: 8px;\n} "],"sourceRoot":""}]);
11326
+ } `, "",{"version":3,"sources":["webpack://./style/DatabasePage.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;IACI,aAAa;IACb,4DAA4D;IAC5D,SAAS;IACT,gBAAgB;AACpB;;AAEA;IACI,mCAAmC;IACnC,yCAAyC;IACzC,kBAAkB;IAClB,aAAa;IACb,yBAAyB;IACzB,aAAa;IACb,sBAAsB;AAC1B;;AAEA;IACI,mCAAmC;AACvC;;AAEA;IACI,aAAa;IACb,8BAA8B;IAC9B,mBAAmB;IACnB,kBAAkB;AACtB;;AAEA;IACI,gBAAgB;IAChB,iBAAiB;IACjB,+BAA+B;IAC/B,SAAS;AACb;;AAEA;IACI,6BAA6B;IAC7B,wBAAwB;IACxB,mBAAmB;IACnB,iBAAiB;IACjB,iBAAiB;IACjB,gBAAgB;IAChB,0BAA0B;IAC1B,gBAAgB;AACpB;;AAEA;IACI,WAAW;IACX,mCAAmC;IACnC,oBAAoB;IACpB,WAAW;AACf;;AAEA;IACI,YAAY;AAChB;;AAEA;IACI,aAAa;IACb,gBAAgB;IAChB,+BAA+B;AACnC;;AAEA;IACI,aAAa;IACb,gBAAgB;IAChB,QAAQ;AACZ;;AAEA;IACI,gBAAgB;IAChB,gBAAgB;AACpB;;AAEA;IACI,6BAA6B;AACjC;;AAEA;IACI,wCAAwC;IACxC,YAAY;AAChB;;AAEA;IACI,kBAAkB;AACtB;;AAEA;IACI,aAAa;IACb,QAAQ;AACZ","sourcesContent":["/*\n * Copyright (c) Saga Inc.\n * Distributed under the terms of the GNU Affero General Public License v3.0 License.\n */\n\n.connections-grid {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));\n gap: 20px;\n margin-top: 20px;\n}\n\n.connection-card {\n background: var(--jp-layout-color0);\n border: 1px solid var(--jp-border-color1);\n border-radius: 8px;\n padding: 16px;\n transition: all 0.2s ease;\n display: flex;\n flex-direction: column;\n}\n\n.connection-card:hover {\n border: 1px solid var(--purple-500);\n}\n\n.connection-card-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 8px;\n}\n\n.connection-alias {\n font-size: 1.2em;\n font-weight: bold;\n color: var(--jp-ui-font-color1);\n margin: 0;\n}\n\n.connection-type {\n background: var(--purple-100);\n color: var(--purple-700);\n border-radius: 12px;\n padding: 2px 10px;\n font-size: 0.85em;\n font-weight: 500;\n text-transform: capitalize;\n margin-left: 8px;\n}\n\n.connection-divider {\n height: 1px;\n background: var(--jp-border-color2);\n margin: 8px 0 12px 0;\n width: 100%;\n}\n\n.connection-details {\n flex-grow: 1;\n}\n\n.connection-details p {\n margin: 4px 0;\n font-size: 0.9em;\n color: var(--jp-ui-font-color2);\n}\n\n.connection-actions {\n display: flex;\n margin-top: 12px;\n gap: 8px;\n}\n\n.connection-actions button {\n padding: 4px 8px;\n font-size: 0.9em;\n}\n\n.connection-actions .delete-button {\n color: var(--jp-error-color1);\n}\n\n.connection-actions .delete-button:hover {\n background-color: var(--jp-error-color2);\n color: white;\n}\n\n.delete-container {\n position: relative;\n}\n\n.confirmation-buttons {\n display: flex;\n gap: 8px;\n} "],"sourceRoot":""}]);
10798
11327
  // Exports
10799
11328
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
10800
11329
 
@@ -11163,12 +11692,35 @@ ___CSS_LOADER_EXPORT___.push([module.id, `/*
11163
11692
  .icon-button {
11164
11693
  display: flex;
11165
11694
  align-items: center;
11695
+ text-align: center;
11166
11696
  justify-content: center;
11167
11697
  background-color: transparent;
11168
11698
  border: none;
11169
11699
  cursor: pointer;
11700
+ position: relative;
11701
+ }
11702
+
11703
+ .icon-button-hover:hover {
11704
+ background-color: var(--jp-layout-color3);
11705
+ }
11706
+
11707
+ .notification-dot {
11708
+ position: absolute;
11709
+ top: -1px;
11710
+ right: 1px;
11711
+ width: 8px;
11712
+ height: 8px;
11713
+ border-radius: 50%;
11714
+ border: 1px solid white;
11170
11715
  }
11171
- `, "",{"version":3,"sources":["webpack://./style/IconButton.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;EACE,aAAa;EACb,mBAAmB;EACnB,uBAAuB;EACvB,6BAA6B;EAC7B,YAAY;EACZ,eAAe;AACjB","sourcesContent":["/*\n * Copyright (c) Saga Inc.\n * Distributed under the terms of the GNU Affero General Public License v3.0 License.\n */\n\n.icon-button {\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: transparent;\n border: none;\n cursor: pointer;\n}\n"],"sourceRoot":""}]);
11716
+
11717
+ .notification-dot-success {
11718
+ background-color: var(--green-600);
11719
+ }
11720
+
11721
+ .notification-dot-warning {
11722
+ background-color: var(--yellow-600);
11723
+ }`, "",{"version":3,"sources":["webpack://./style/IconButton.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;EACE,aAAa;EACb,mBAAmB;EACnB,kBAAkB;EAClB,uBAAuB;EACvB,6BAA6B;EAC7B,YAAY;EACZ,eAAe;EACf,kBAAkB;AACpB;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,kBAAkB;EAClB,SAAS;EACT,UAAU;EACV,UAAU;EACV,WAAW;EACX,kBAAkB;EAClB,uBAAuB;AACzB;;AAEA;EACE,kCAAkC;AACpC;;AAEA;EACE,mCAAmC;AACrC","sourcesContent":["/*\n * Copyright (c) Saga Inc.\n * Distributed under the terms of the GNU Affero General Public License v3.0 License.\n */\n\n.icon-button {\n display: flex;\n align-items: center;\n text-align: center;\n justify-content: center;\n background-color: transparent;\n border: none;\n cursor: pointer;\n position: relative;\n}\n\n.icon-button-hover:hover {\n background-color: var(--jp-layout-color3);\n}\n\n.notification-dot {\n position: absolute;\n top: -1px;\n right: 1px;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n border: 1px solid white;\n}\n\n.notification-dot-success {\n background-color: var(--green-600);\n}\n\n.notification-dot-warning {\n background-color: var(--yellow-600);\n}"],"sourceRoot":""}]);
11172
11724
  // Exports
11173
11725
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
11174
11726
 
@@ -12126,36 +12678,56 @@ ___CSS_LOADER_EXPORT___.push([module.id, `/*
12126
12678
  * Distributed under the terms of the GNU Affero General Public License v3.0 License.
12127
12679
  */
12128
12680
 
12681
+ .context-container {
12682
+ display: flex;
12683
+ flex-wrap: wrap;
12684
+ align-items: center;
12685
+ gap: 4px;
12686
+ padding: 8px 10px;
12687
+ }
12688
+
12689
+ /* Consistent spacing for all children of context container */
12690
+ .context-container>* {
12691
+ margin: 2px;
12692
+ }
12693
+
12129
12694
  .selected-context-container {
12130
- display: flex;
12131
- align-items: center;
12132
- text-align: center;
12133
- background-color: var(--jp-layout-color2);
12134
- border-radius: 3px;
12135
- padding: 4px 8px;
12136
- margin: 4px;
12695
+ display: flex;
12696
+ align-items: center;
12697
+ text-align: center;
12698
+ background-color: var(--jp-layout-color2);
12699
+ border-radius: 3px;
12700
+ padding: 4px 8px;
12701
+ margin: 2px;
12137
12702
 
12138
- font-size: 12px;
12139
- height: 20px;
12140
- width: fit-content;
12703
+ font-size: 12px;
12704
+ height: 20px;
12705
+ width: fit-content;
12141
12706
 
12142
- border: 1px solid var(--jp-border-color1);
12143
- cursor: pointer;
12707
+ border: 1px solid var(--jp-border-color1);
12708
+ cursor: pointer;
12144
12709
 
12145
- &:hover {
12146
- background-color: var(--jp-layout-color3);
12147
- }
12710
+ &:hover {
12711
+ background-color: var(--jp-layout-color3);
12712
+ }
12148
12713
  }
12149
12714
 
12150
12715
  .selected-context-container .rule-name {
12151
- margin-left: 6px;
12152
- color: var(--jp-content-font-color1);
12716
+ margin-left: 6px;
12717
+ color: var(--jp-content-font-color1);
12718
+ white-space: nowrap;
12719
+ overflow: hidden;
12720
+ text-overflow: ellipsis;
12721
+ max-width: 200px;
12153
12722
  }
12154
12723
 
12155
12724
  .selected-context-container .icon {
12156
- width: 12px;
12157
- height: 12px;
12158
- }`, "",{"version":3,"sources":["webpack://./style/SelectedContextContainer.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;IACI,aAAa;IACb,mBAAmB;IACnB,kBAAkB;IAClB,yCAAyC;IACzC,kBAAkB;IAClB,gBAAgB;IAChB,WAAW;;IAEX,eAAe;IACf,YAAY;IACZ,kBAAkB;;IAElB,yCAAyC;IACzC,eAAe;;IAEf;QACI,yCAAyC;IAC7C;AACJ;;AAEA;IACI,gBAAgB;IAChB,oCAAoC;AACxC;;AAEA;IACI,WAAW;IACX,YAAY;AAChB","sourcesContent":["/*\n * Copyright (c) Saga Inc.\n * Distributed under the terms of the GNU Affero General Public License v3.0 License.\n */\n\n.selected-context-container {\n display: flex;\n align-items: center;\n text-align: center;\n background-color: var(--jp-layout-color2);\n border-radius: 3px;\n padding: 4px 8px;\n margin: 4px;\n\n font-size: 12px;\n height: 20px;\n width: fit-content;\n\n border: 1px solid var(--jp-border-color1);\n cursor: pointer;\n\n &:hover {\n background-color: var(--jp-layout-color3);\n }\n}\n\n.selected-context-container .rule-name {\n margin-left: 6px;\n color: var(--jp-content-font-color1);\n}\n\n.selected-context-container .icon {\n width: 12px;\n height: 12px;\n}"],"sourceRoot":""}]);
12725
+ display: flex;
12726
+ flex-direction: column;
12727
+ justify-content: center;
12728
+ width: 12px;
12729
+ max-height: 14px;
12730
+ }`, "",{"version":3,"sources":["webpack://./style/SelectedContextContainer.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;EACE,aAAa;EACb,eAAe;EACf,mBAAmB;EACnB,QAAQ;EACR,iBAAiB;AACnB;;AAEA,6DAA6D;AAC7D;EACE,WAAW;AACb;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,kBAAkB;EAClB,yCAAyC;EACzC,kBAAkB;EAClB,gBAAgB;EAChB,WAAW;;EAEX,eAAe;EACf,YAAY;EACZ,kBAAkB;;EAElB,yCAAyC;EACzC,eAAe;;EAEf;IACE,yCAAyC;EAC3C;AACF;;AAEA;EACE,gBAAgB;EAChB,oCAAoC;EACpC,mBAAmB;EACnB,gBAAgB;EAChB,uBAAuB;EACvB,gBAAgB;AAClB;;AAEA;EACE,aAAa;EACb,sBAAsB;EACtB,uBAAuB;EACvB,WAAW;EACX,gBAAgB;AAClB","sourcesContent":["/*\n * Copyright (c) Saga Inc.\n * Distributed under the terms of the GNU Affero General Public License v3.0 License.\n */\n\n.context-container {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 4px;\n padding: 8px 10px;\n}\n\n/* Consistent spacing for all children of context container */\n.context-container>* {\n margin: 2px;\n}\n\n.selected-context-container {\n display: flex;\n align-items: center;\n text-align: center;\n background-color: var(--jp-layout-color2);\n border-radius: 3px;\n padding: 4px 8px;\n margin: 2px;\n\n font-size: 12px;\n height: 20px;\n width: fit-content;\n\n border: 1px solid var(--jp-border-color1);\n cursor: pointer;\n\n &:hover {\n background-color: var(--jp-layout-color3);\n }\n}\n\n.selected-context-container .rule-name {\n margin-left: 6px;\n color: var(--jp-content-font-color1);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 200px;\n}\n\n.selected-context-container .icon {\n display: flex;\n flex-direction: column;\n justify-content: center;\n width: 12px;\n max-height: 14px;\n}"],"sourceRoot":""}]);
12159
12731
  // Exports
12160
12732
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
12161
12733
 
@@ -13065,6 +13637,60 @@ var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js
13065
13637
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_AgentComponentHeader_css__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_AgentComponentHeader_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_AgentComponentHeader_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);
13066
13638
 
13067
13639
 
13640
+ /***/ }),
13641
+
13642
+ /***/ "./style/AssumptionTool.css":
13643
+ /*!**********************************!*\
13644
+ !*** ./style/AssumptionTool.css ***!
13645
+ \**********************************/
13646
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
13647
+
13648
+ __webpack_require__.r(__webpack_exports__);
13649
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13650
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
13651
+ /* harmony export */ });
13652
+ /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
13653
+ /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
13654
+ /* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
13655
+ /* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
13656
+ /* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
13657
+ /* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
13658
+ /* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
13659
+ /* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
13660
+ /* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
13661
+ /* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
13662
+ /* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
13663
+ /* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
13664
+ /* harmony import */ var _node_modules_css_loader_dist_cjs_js_AssumptionTool_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../node_modules/css-loader/dist/cjs.js!./AssumptionTool.css */ "./node_modules/css-loader/dist/cjs.js!./style/AssumptionTool.css");
13665
+
13666
+
13667
+
13668
+
13669
+
13670
+
13671
+
13672
+
13673
+
13674
+
13675
+
13676
+ var options = {};
13677
+
13678
+ options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
13679
+ options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
13680
+
13681
+ options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
13682
+
13683
+ options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
13684
+ options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());
13685
+
13686
+ var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_AssumptionTool_css__WEBPACK_IMPORTED_MODULE_6__["default"], options);
13687
+
13688
+
13689
+
13690
+
13691
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_AssumptionTool_css__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_AssumptionTool_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_AssumptionTool_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);
13692
+
13693
+
13068
13694
  /***/ }),
13069
13695
 
13070
13696
  /***/ "./style/CTACarousel.css":
@@ -14472,4 +15098,4 @@ var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js
14472
15098
  /***/ })
14473
15099
 
14474
15100
  }]);
14475
- //# sourceMappingURL=lib_index_js.a20772bc113422d0f505.js.map
15101
+ //# sourceMappingURL=lib_index_js.831f63b48760c7119b9b.js.map