mito-ai 0.1.42__py3-none-any.whl → 0.1.43__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.
- mito_ai/_version.py +1 -1
- mito_ai/app_manager/handlers.py +5 -0
- mito_ai/app_manager/models.py +1 -2
- mito_ai/app_manager/utils.py +24 -0
- mito_ai/completions/completion_handlers/agent_execution_handler.py +1 -1
- mito_ai/completions/completion_handlers/chat_completion_handler.py +2 -2
- mito_ai/completions/completion_handlers/utils.py +27 -5
- mito_ai/completions/models.py +0 -2
- mito_ai/completions/prompt_builders/utils.py +1 -2
- mito_ai/file_uploads/handlers.py +49 -26
- mito_ai/tests/completions/completion_handlers_utils_test.py +156 -17
- mito_ai/tests/file_uploads/test_handlers.py +15 -0
- {mito_ai-0.1.42.data → mito_ai-0.1.43.data}/data/share/jupyter/labextensions/mito_ai/build_log.json +1 -1
- {mito_ai-0.1.42.data → mito_ai-0.1.43.data}/data/share/jupyter/labextensions/mito_ai/package.json +2 -2
- {mito_ai-0.1.42.data → mito_ai-0.1.43.data}/data/share/jupyter/labextensions/mito_ai/schemas/mito_ai/package.json.orig +1 -1
- mito_ai-0.1.42.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.a9a35b6fcc54a7bcb32c.js → mito_ai-0.1.43.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.81703ac2bc645e5c2fc2.js +457 -143
- mito_ai-0.1.43.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.81703ac2bc645e5c2fc2.js.map +1 -0
- mito_ai-0.1.42.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.c7d9d8635826165de52e.js → mito_ai-0.1.43.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.502aef26f0416fab7435.js +3 -3
- mito_ai-0.1.42.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.c7d9d8635826165de52e.js.map → mito_ai-0.1.43.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.502aef26f0416fab7435.js.map +1 -1
- {mito_ai-0.1.42.dist-info → mito_ai-0.1.43.dist-info}/METADATA +1 -1
- {mito_ai-0.1.42.dist-info → mito_ai-0.1.43.dist-info}/RECORD +45 -44
- mito_ai-0.1.42.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.a9a35b6fcc54a7bcb32c.js.map +0 -1
- {mito_ai-0.1.42.data → mito_ai-0.1.43.data}/data/etc/jupyter/jupyter_server_config.d/mito_ai.json +0 -0
- {mito_ai-0.1.42.data → mito_ai-0.1.43.data}/data/share/jupyter/labextensions/mito_ai/schemas/mito_ai/toolbar-buttons.json +0 -0
- {mito_ai-0.1.42.data → mito_ai-0.1.43.data}/data/share/jupyter/labextensions/mito_ai/static/node_modules_process_browser_js.4b128e94d31a81ebd209.js +0 -0
- {mito_ai-0.1.42.data → mito_ai-0.1.43.data}/data/share/jupyter/labextensions/mito_ai/static/node_modules_process_browser_js.4b128e94d31a81ebd209.js.map +0 -0
- {mito_ai-0.1.42.data → mito_ai-0.1.43.data}/data/share/jupyter/labextensions/mito_ai/static/style.js +0 -0
- {mito_ai-0.1.42.data → mito_ai-0.1.43.data}/data/share/jupyter/labextensions/mito_ai/static/style_index_js.5876024bb17dbd6a3ee6.js +0 -0
- {mito_ai-0.1.42.data → mito_ai-0.1.43.data}/data/share/jupyter/labextensions/mito_ai/static/style_index_js.5876024bb17dbd6a3ee6.js.map +0 -0
- {mito_ai-0.1.42.data → mito_ai-0.1.43.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_auth_dist_esm_providers_cognito_apis_signOut_mjs-node_module-75790d.688c25857e7b81b1740f.js +0 -0
- {mito_ai-0.1.42.data → mito_ai-0.1.43.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_auth_dist_esm_providers_cognito_apis_signOut_mjs-node_module-75790d.688c25857e7b81b1740f.js.map +0 -0
- {mito_ai-0.1.42.data → mito_ai-0.1.43.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_auth_dist_esm_providers_cognito_tokenProvider_tokenProvider_-72f1c8.a917210f057fcfe224ad.js +0 -0
- {mito_ai-0.1.42.data → mito_ai-0.1.43.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_auth_dist_esm_providers_cognito_tokenProvider_tokenProvider_-72f1c8.a917210f057fcfe224ad.js.map +0 -0
- {mito_ai-0.1.42.data → mito_ai-0.1.43.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_dist_esm_index_mjs.6bac1a8c4cc93f15f6b7.js +0 -0
- {mito_ai-0.1.42.data → mito_ai-0.1.43.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_dist_esm_index_mjs.6bac1a8c4cc93f15f6b7.js.map +0 -0
- {mito_ai-0.1.42.data → mito_ai-0.1.43.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_ui-react_dist_esm_index_mjs.4fcecd65bef9e9847609.js +0 -0
- {mito_ai-0.1.42.data → mito_ai-0.1.43.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_ui-react_dist_esm_index_mjs.4fcecd65bef9e9847609.js.map +0 -0
- {mito_ai-0.1.42.data → mito_ai-0.1.43.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_react-dom_client_js-node_modules_aws-amplify_ui-react_dist_styles_css.b43d4249e4d3dac9ad7b.js +0 -0
- {mito_ai-0.1.42.data → mito_ai-0.1.43.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_react-dom_client_js-node_modules_aws-amplify_ui-react_dist_styles_css.b43d4249e4d3dac9ad7b.js.map +0 -0
- {mito_ai-0.1.42.data → mito_ai-0.1.43.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_semver_index_js.3f6754ac5116d47de76b.js +0 -0
- {mito_ai-0.1.42.data → mito_ai-0.1.43.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_semver_index_js.3f6754ac5116d47de76b.js.map +0 -0
- {mito_ai-0.1.42.data → mito_ai-0.1.43.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_vscode-diff_dist_index_js.ea55f1f9346638aafbcf.js +0 -0
- {mito_ai-0.1.42.data → mito_ai-0.1.43.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_vscode-diff_dist_index_js.ea55f1f9346638aafbcf.js.map +0 -0
- {mito_ai-0.1.42.dist-info → mito_ai-0.1.43.dist-info}/WHEEL +0 -0
- {mito_ai-0.1.42.dist-info → mito_ai-0.1.43.dist-info}/entry_points.txt +0 -0
- {mito_ai-0.1.42.dist-info → mito_ai-0.1.43.dist-info}/licenses/LICENSE +0 -0
|
@@ -999,32 +999,24 @@ const ChatInput = ({ app, initialContent, placeholder, onSave, onCancel, isEditi
|
|
|
999
999
|
const [additionalContext, setAdditionalContext] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]);
|
|
1000
1000
|
const [isDropdownFromButton, setIsDropdownFromButton] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
|
|
1001
1001
|
const handleFileUpload = (file) => {
|
|
1002
|
+
let uploadType;
|
|
1002
1003
|
if (file.type.startsWith('image/')) {
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
// Add the uploaded file to the additional context
|
|
1008
|
-
setAdditionalContext(prev => [
|
|
1009
|
-
...prev, {
|
|
1010
|
-
type: file.type || 'image',
|
|
1011
|
-
value: base64Data || '',
|
|
1012
|
-
display: file.name
|
|
1013
|
-
}
|
|
1014
|
-
]);
|
|
1015
|
-
};
|
|
1016
|
-
reader.readAsDataURL(file);
|
|
1004
|
+
// If the file is an image, we want to preserve the file type.
|
|
1005
|
+
// The type is used to display the image icon in the SelectedContextContainer,
|
|
1006
|
+
// and is used to encode the image on the backend.
|
|
1007
|
+
uploadType = file.type;
|
|
1017
1008
|
}
|
|
1018
1009
|
else {
|
|
1019
|
-
|
|
1020
|
-
setAdditionalContext(prev => [
|
|
1021
|
-
...prev, {
|
|
1022
|
-
type: 'file',
|
|
1023
|
-
value: file.name,
|
|
1024
|
-
display: file.name
|
|
1025
|
-
}
|
|
1026
|
-
]);
|
|
1010
|
+
uploadType = 'file';
|
|
1027
1011
|
}
|
|
1012
|
+
// Add the uploaded file to the additional context
|
|
1013
|
+
setAdditionalContext(prev => [
|
|
1014
|
+
...prev, {
|
|
1015
|
+
type: uploadType,
|
|
1016
|
+
value: file.name,
|
|
1017
|
+
display: file.name
|
|
1018
|
+
}
|
|
1019
|
+
]);
|
|
1028
1020
|
};
|
|
1029
1021
|
// Debounce the active cell ID change to avoid multiple rerenders.
|
|
1030
1022
|
// We use this to avoid a flickering screen when the active cell changes.
|
|
@@ -1177,19 +1169,6 @@ const ChatInput = ({ app, initialContent, placeholder, onSave, onCancel, isEditi
|
|
|
1177
1169
|
value: contextItem.value
|
|
1178
1170
|
});
|
|
1179
1171
|
}
|
|
1180
|
-
else if (contextItem.type.startsWith('image/')) {
|
|
1181
|
-
// If the user uploaded an image, we:
|
|
1182
|
-
// 1. Keep the original context item. This is the base64 encoded image
|
|
1183
|
-
// that will be processed in ChatTaskpane.tsx.
|
|
1184
|
-
// 2. Add a second item to the additionalContext array, which will
|
|
1185
|
-
// have the image's filename, and be used in the prompt.
|
|
1186
|
-
result.push(contextItem);
|
|
1187
|
-
const fileName = contextItem.display || contextItem.value.split('/').pop() || 'image';
|
|
1188
|
-
result.push({
|
|
1189
|
-
type: 'img',
|
|
1190
|
-
value: fileName
|
|
1191
|
-
});
|
|
1192
|
-
}
|
|
1193
1172
|
else {
|
|
1194
1173
|
result.push(contextItem);
|
|
1195
1174
|
}
|
|
@@ -1979,37 +1958,38 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1979
1958
|
/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__);
|
|
1980
1959
|
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @lumino/coreutils */ "webpack/sharing/consume/default/@lumino/coreutils");
|
|
1981
1960
|
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_3__);
|
|
1982
|
-
/* harmony import */ var
|
|
1983
|
-
/* harmony import */ var
|
|
1984
|
-
/* harmony import */ var
|
|
1985
|
-
/* harmony import */ var
|
|
1986
|
-
/* harmony import */ var
|
|
1987
|
-
/* harmony import */ var
|
|
1961
|
+
/* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../commands */ "./lib/commands.js");
|
|
1962
|
+
/* harmony import */ var _components_AgentComponents_ErrorFixupToolUI__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../../components/AgentComponents/ErrorFixupToolUI */ "./lib/components/AgentComponents/ErrorFixupToolUI.js");
|
|
1963
|
+
/* harmony import */ var _components_DropdownMenu__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../../components/DropdownMenu */ "./lib/components/DropdownMenu.js");
|
|
1964
|
+
/* harmony import */ var _components_IconButton__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../../components/IconButton */ "./lib/components/IconButton.js");
|
|
1965
|
+
/* harmony import */ var _components_LoadingCircle__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ../../components/LoadingCircle */ "./lib/components/LoadingCircle.js");
|
|
1966
|
+
/* harmony import */ var _components_LoadingDots__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../../components/LoadingDots */ "./lib/components/LoadingDots.js");
|
|
1988
1967
|
/* harmony import */ var _components_ModelSelector__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../components/ModelSelector */ "./lib/components/ModelSelector.js");
|
|
1989
|
-
/* harmony import */ var
|
|
1990
|
-
/* harmony import */ var
|
|
1991
|
-
/* harmony import */ var
|
|
1992
|
-
/* harmony import */ var
|
|
1993
|
-
/* harmony import */ var
|
|
1994
|
-
/* harmony import */ var
|
|
1995
|
-
/* harmony import */ var
|
|
1996
|
-
/* harmony import */ var
|
|
1997
|
-
/* harmony import */ var
|
|
1998
|
-
/* harmony import */ var
|
|
1999
|
-
/* harmony import */ var
|
|
1968
|
+
/* harmony import */ var _components_NextStepsPills__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ../../components/NextStepsPills */ "./lib/components/NextStepsPills.js");
|
|
1969
|
+
/* harmony import */ var _components_TextAndIconButton__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../../components/TextAndIconButton */ "./lib/components/TextAndIconButton.js");
|
|
1970
|
+
/* harmony import */ var _components_ToggleButton__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ../../components/ToggleButton */ "./lib/components/ToggleButton.js");
|
|
1971
|
+
/* harmony import */ var _icons__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../../icons */ "./lib/icons/index.js");
|
|
1972
|
+
/* harmony import */ var _icons_MitoLogo__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../../icons/MitoLogo */ "./lib/icons/MitoLogo.js");
|
|
1973
|
+
/* harmony import */ var _icons_UndoIcon__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../../icons/UndoIcon */ "./lib/icons/UndoIcon.js");
|
|
1974
|
+
/* harmony import */ var _utils_agentActions__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../utils/agentActions */ "./lib/utils/agentActions.js");
|
|
1975
|
+
/* harmony import */ var _utils_blacklistedWords__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../utils/blacklistedWords */ "./lib/utils/blacklistedWords.js");
|
|
1976
|
+
/* harmony import */ var _utils_checkpoint__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../utils/checkpoint */ "./lib/utils/checkpoint.js");
|
|
1977
|
+
/* harmony import */ var _utils_chatHistory__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../../utils/chatHistory */ "./lib/utils/chatHistory.js");
|
|
1978
|
+
/* harmony import */ var _utils_codeDiff__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../utils/codeDiff */ "./lib/utils/codeDiff.js");
|
|
2000
1979
|
/* harmony import */ var _utils_notebook__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../utils/notebook */ "./lib/utils/notebook.js");
|
|
2001
1980
|
/* harmony import */ var _utils_scroll__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../utils/scroll */ "./lib/utils/scroll.js");
|
|
2002
|
-
/* harmony import */ var
|
|
1981
|
+
/* harmony import */ var _utils_strings__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../utils/strings */ "./lib/utils/strings.js");
|
|
2003
1982
|
/* harmony import */ var _utils_waitForNotebookReady__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../utils/waitForNotebookReady */ "./lib/utils/waitForNotebookReady.js");
|
|
2004
1983
|
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./utils */ "./lib/Extensions/AiChat/utils.js");
|
|
2005
|
-
/* harmony import */ var
|
|
2006
|
-
/* harmony import */ var
|
|
2007
|
-
/* harmony import */ var
|
|
1984
|
+
/* harmony import */ var _SettingsManager_SettingsManagerPlugin__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../SettingsManager/SettingsManagerPlugin */ "./lib/Extensions/SettingsManager/SettingsManagerPlugin.js");
|
|
1985
|
+
/* harmony import */ var _SettingsManager_profiler_ProfilerPage__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../SettingsManager/profiler/ProfilerPage */ "./lib/Extensions/SettingsManager/profiler/ProfilerPage.js");
|
|
1986
|
+
/* harmony import */ var _CTACarousel__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./CTACarousel */ "./lib/Extensions/AiChat/CTACarousel.js");
|
|
1987
|
+
/* harmony import */ var _CodeDiffDisplay__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./CodeDiffDisplay */ "./lib/Extensions/AiChat/CodeDiffDisplay.js");
|
|
2008
1988
|
/* harmony import */ var _FirstMessage__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./FirstMessage */ "./lib/Extensions/AiChat/FirstMessage.js");
|
|
2009
|
-
/* harmony import */ var
|
|
2010
|
-
/* harmony import */ var
|
|
2011
|
-
/* harmony import */ var
|
|
2012
|
-
/* harmony import */ var
|
|
1989
|
+
/* harmony import */ var _ChatMessage_ChatInput__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./ChatMessage/ChatInput */ "./lib/Extensions/AiChat/ChatMessage/ChatInput.js");
|
|
1990
|
+
/* harmony import */ var _ChatMessage_ChatMessage__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./ChatMessage/ChatMessage */ "./lib/Extensions/AiChat/ChatMessage/ChatMessage.js");
|
|
1991
|
+
/* harmony import */ var _ChatMessage_RevertQuestionnaire__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./ChatMessage/RevertQuestionnaire */ "./lib/Extensions/AiChat/ChatMessage/RevertQuestionnaire.js");
|
|
1992
|
+
/* harmony import */ var _ChatMessage_ScrollableSuggestions__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./ChatMessage/ScrollableSuggestions */ "./lib/Extensions/AiChat/ChatMessage/ScrollableSuggestions.js");
|
|
2013
1993
|
/* harmony import */ var _ChatHistoryManager__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ChatHistoryManager */ "./lib/Extensions/AiChat/ChatHistoryManager.js");
|
|
2014
1994
|
/* harmony import */ var _style_button_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../style/button.css */ "./style/button.css");
|
|
2015
1995
|
/* harmony import */ var _style_ChatTaskpane_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../style/ChatTaskpane.css */ "./style/ChatTaskpane.css");
|
|
@@ -2052,6 +2032,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2052
2032
|
|
|
2053
2033
|
|
|
2054
2034
|
|
|
2035
|
+
|
|
2055
2036
|
// Internal imports - Chat components
|
|
2056
2037
|
|
|
2057
2038
|
|
|
@@ -2451,8 +2432,6 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
|
|
|
2451
2432
|
if (messageIndex !== undefined) {
|
|
2452
2433
|
agentExecutionMetadata.index = messageIndex;
|
|
2453
2434
|
}
|
|
2454
|
-
// Extract images from additionalContext and update agentExecutionMetadata
|
|
2455
|
-
additionalContext = (0,_utils__WEBPACK_IMPORTED_MODULE_12__.extractImagesFromContext)(additionalContext, agentExecutionMetadata);
|
|
2456
2435
|
agentExecutionMetadata.base64EncodedActiveCellOutput = await (0,_utils__WEBPACK_IMPORTED_MODULE_12__.getBase64EncodedCellOutput)(notebookTracker, sendCellIDOutput);
|
|
2457
2436
|
setChatHistoryManager(newChatHistoryManager);
|
|
2458
2437
|
setLoadingAIResponse(true);
|
|
@@ -2493,8 +2472,6 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
|
|
|
2493
2472
|
if (activeCellOutput !== undefined) {
|
|
2494
2473
|
chatMessageMetadata.base64EncodedActiveCellOutput = activeCellOutput;
|
|
2495
2474
|
}
|
|
2496
|
-
// Extract images from additionalContext and update chatMessageMetadata
|
|
2497
|
-
additionalContext = (0,_utils__WEBPACK_IMPORTED_MODULE_12__.extractImagesFromContext)(additionalContext, chatMessageMetadata);
|
|
2498
2475
|
const completionRequest = {
|
|
2499
2476
|
type: 'chat',
|
|
2500
2477
|
message_id: _lumino_coreutils__WEBPACK_IMPORTED_MODULE_3__.UUID.uuid4(),
|
|
@@ -2515,6 +2492,8 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
|
|
|
2515
2492
|
};
|
|
2516
2493
|
const _sendMessageAndSaveResponse = async (completionRequest, newChatHistoryManager) => {
|
|
2517
2494
|
var _a, _b, _c, _d;
|
|
2495
|
+
// Capture the completion request for debugging
|
|
2496
|
+
(0,_SettingsManager_profiler_ProfilerPage__WEBPACK_IMPORTED_MODULE_14__.captureCompletionRequest)(completionRequest);
|
|
2518
2497
|
if (completionRequest.stream) {
|
|
2519
2498
|
// Reset the streaming response and set streaming state
|
|
2520
2499
|
streamingContentRef.current = '';
|
|
@@ -2650,7 +2629,7 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
|
|
|
2650
2629
|
setAgentExecutionStatus('idle');
|
|
2651
2630
|
};
|
|
2652
2631
|
const startAgentExecution = async (input, messageIndex, additionalContext) => {
|
|
2653
|
-
await (0,
|
|
2632
|
+
await (0,_utils_checkpoint__WEBPACK_IMPORTED_MODULE_15__.createCheckpoint)(app, setHasCheckpoint);
|
|
2654
2633
|
setAgentExecutionStatus('working');
|
|
2655
2634
|
// Enable follow mode when user starts agent execution
|
|
2656
2635
|
setAutoScrollFollowMode(true);
|
|
@@ -2682,9 +2661,9 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
|
|
|
2682
2661
|
const aiDisplayOptimizedChatItem = chatHistoryManagerRef.current.getLastAIDisplayOptimizedChatItem();
|
|
2683
2662
|
// # TODO: Make this is a helper function so we can also use it in the auto error fixup!
|
|
2684
2663
|
if (aiDisplayOptimizedChatItem) {
|
|
2685
|
-
const aiGeneratedCode = (0,
|
|
2664
|
+
const aiGeneratedCode = (0,_utils_strings__WEBPACK_IMPORTED_MODULE_16__.getCodeBlockFromMessage)(aiDisplayOptimizedChatItem.message);
|
|
2686
2665
|
if (aiGeneratedCode) {
|
|
2687
|
-
const securityCheck = (0,
|
|
2666
|
+
const securityCheck = (0,_utils_blacklistedWords__WEBPACK_IMPORTED_MODULE_17__.checkForBlacklistedWords)(aiGeneratedCode);
|
|
2688
2667
|
if (!securityCheck.safe) {
|
|
2689
2668
|
console.error('Security Warning:', securityCheck.reason);
|
|
2690
2669
|
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);
|
|
@@ -2711,8 +2690,8 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
|
|
|
2711
2690
|
}
|
|
2712
2691
|
if (agentResponse.type === 'cell_update' && agentResponse.cell_update) {
|
|
2713
2692
|
// Run the code and handle any errors
|
|
2714
|
-
await (0,
|
|
2715
|
-
const status = await (0,
|
|
2693
|
+
await (0,_utils_agentActions__WEBPACK_IMPORTED_MODULE_18__.acceptAndRunCellUpdate)(agentResponse.cell_update, notebookTracker, app, previewAICodeToActiveCell, acceptAICode);
|
|
2694
|
+
const status = await (0,_utils_agentActions__WEBPACK_IMPORTED_MODULE_18__.retryIfExecutionError)(notebookTracker, app, getDuplicateChatHistoryManager, addAIMessageFromResponseAndUpdateState, sendAgentSmartDebugMessage, previewAICodeToActiveCell, acceptAICode, shouldContinueAgentExecution, finalizeAgentStop, chatHistoryManagerRef);
|
|
2716
2695
|
if (status === 'interupted') {
|
|
2717
2696
|
break;
|
|
2718
2697
|
}
|
|
@@ -2732,12 +2711,12 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
|
|
|
2732
2711
|
sendCellIDOutput = agentResponse.get_cell_output_cell_id;
|
|
2733
2712
|
}
|
|
2734
2713
|
if (agentResponse.type === 'run_all_cells') {
|
|
2735
|
-
const result = await (0,
|
|
2714
|
+
const result = await (0,_utils_agentActions__WEBPACK_IMPORTED_MODULE_18__.runAllCells)(app, notebookTracker);
|
|
2736
2715
|
// If run_all_cells resulted in an error, handle it through the error fixup process
|
|
2737
2716
|
if (!result.success && result.errorMessage && result.errorCellId) {
|
|
2738
2717
|
// Set the error cell as active so the error retry logic can work with it
|
|
2739
2718
|
(0,_utils_notebook__WEBPACK_IMPORTED_MODULE_13__.setActiveCellByID)(notebookTracker, result.errorCellId);
|
|
2740
|
-
const status = await (0,
|
|
2719
|
+
const status = await (0,_utils_agentActions__WEBPACK_IMPORTED_MODULE_18__.retryIfExecutionError)(notebookTracker, app, getDuplicateChatHistoryManager, addAIMessageFromResponseAndUpdateState, sendAgentSmartDebugMessage, previewAICodeToActiveCell, acceptAICode, shouldContinueAgentExecution, finalizeAgentStop, chatHistoryManagerRef);
|
|
2741
2720
|
if (status === 'interupted') {
|
|
2742
2721
|
break;
|
|
2743
2722
|
}
|
|
@@ -2762,9 +2741,9 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
|
|
|
2762
2741
|
return;
|
|
2763
2742
|
}
|
|
2764
2743
|
// Extract the code from the AI's message and then calculate the code diffs
|
|
2765
|
-
const aiGeneratedCode = (0,
|
|
2766
|
-
const aiGeneratedCodeCleaned = (0,
|
|
2767
|
-
const { unifiedCodeString, unifiedDiffs } = (0,
|
|
2744
|
+
const aiGeneratedCode = (0,_utils_strings__WEBPACK_IMPORTED_MODULE_16__.getCodeBlockFromMessage)(aiMessage);
|
|
2745
|
+
const aiGeneratedCodeCleaned = (0,_utils_strings__WEBPACK_IMPORTED_MODULE_16__.removeMarkdownCodeFormatting)(aiGeneratedCode || '');
|
|
2746
|
+
const { unifiedCodeString, unifiedDiffs } = (0,_utils_codeDiff__WEBPACK_IMPORTED_MODULE_19__.getCodeDiffsAndUnifiedCodeString)(updateCellCode, aiGeneratedCodeCleaned);
|
|
2768
2747
|
// Store the code cell ID where we write the code diffs so that we can
|
|
2769
2748
|
// accept or reject the code diffs to the correct cell
|
|
2770
2749
|
cellStateBeforeDiff.current = { codeCellID: updateCellID, code: updateCellCode };
|
|
@@ -2793,7 +2772,7 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
|
|
|
2793
2772
|
if (!lastAIMessage || !cellStateBeforeDiff.current) {
|
|
2794
2773
|
return;
|
|
2795
2774
|
}
|
|
2796
|
-
const aiGeneratedCode = (0,
|
|
2775
|
+
const aiGeneratedCode = (0,_utils_strings__WEBPACK_IMPORTED_MODULE_16__.getCodeBlockFromMessage)(lastAIMessage.message);
|
|
2797
2776
|
if (!aiGeneratedCode) {
|
|
2798
2777
|
return;
|
|
2799
2778
|
}
|
|
@@ -2842,17 +2821,17 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
|
|
|
2842
2821
|
the first time we create the chat. Registering the command when it is already created causes
|
|
2843
2822
|
errors.
|
|
2844
2823
|
*/
|
|
2845
|
-
app.commands.addCommand(
|
|
2824
|
+
app.commands.addCommand(_commands__WEBPACK_IMPORTED_MODULE_20__.COMMAND_MITO_AI_PREVIEW_LATEST_CODE, {
|
|
2846
2825
|
execute: () => {
|
|
2847
2826
|
previewAICodeToActiveCell();
|
|
2848
2827
|
}
|
|
2849
2828
|
});
|
|
2850
|
-
app.commands.addCommand(
|
|
2829
|
+
app.commands.addCommand(_commands__WEBPACK_IMPORTED_MODULE_20__.COMMAND_MITO_AI_APPLY_LATEST_CODE, {
|
|
2851
2830
|
execute: () => {
|
|
2852
2831
|
acceptAICode();
|
|
2853
2832
|
}
|
|
2854
2833
|
});
|
|
2855
|
-
app.commands.addCommand(
|
|
2834
|
+
app.commands.addCommand(_commands__WEBPACK_IMPORTED_MODULE_20__.COMMAND_MITO_AI_REJECT_LATEST_CODE, {
|
|
2856
2835
|
execute: () => {
|
|
2857
2836
|
rejectAICode();
|
|
2858
2837
|
}
|
|
@@ -2861,19 +2840,19 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
|
|
|
2861
2840
|
Add a new command to the JupyterLab command registry that sends the current chat message.
|
|
2862
2841
|
We use this to automatically send the message when the user adds an error to the chat.
|
|
2863
2842
|
*/
|
|
2864
|
-
app.commands.addCommand(
|
|
2843
|
+
app.commands.addCommand(_commands__WEBPACK_IMPORTED_MODULE_20__.COMMAND_MITO_AI_SEND_DEBUG_ERROR_MESSAGE, {
|
|
2865
2844
|
execute: async (args) => {
|
|
2866
2845
|
if (args === null || args === void 0 ? void 0 : args.input) {
|
|
2867
2846
|
await sendSmartDebugMessage(args.input.toString());
|
|
2868
2847
|
}
|
|
2869
2848
|
}
|
|
2870
2849
|
});
|
|
2871
|
-
app.commands.addCommand(
|
|
2850
|
+
app.commands.addCommand(_commands__WEBPACK_IMPORTED_MODULE_20__.COMMAND_MITO_AI_SEND_EXPLAIN_CODE_MESSAGE, {
|
|
2872
2851
|
execute: async () => {
|
|
2873
2852
|
await sendExplainCodeMessage();
|
|
2874
2853
|
}
|
|
2875
2854
|
});
|
|
2876
|
-
app.commands.addCommand(
|
|
2855
|
+
app.commands.addCommand(_commands__WEBPACK_IMPORTED_MODULE_20__.COMMAND_MITO_AI_SEND_AGENT_MESSAGE, {
|
|
2877
2856
|
execute: async (args) => {
|
|
2878
2857
|
if (args === null || args === void 0 ? void 0 : args.input) {
|
|
2879
2858
|
// Make sure we're in agent mode
|
|
@@ -2892,7 +2871,7 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
|
|
|
2892
2871
|
/*
|
|
2893
2872
|
Register the code cell toolbar buttons for accepting and rejecting code.
|
|
2894
2873
|
*/
|
|
2895
|
-
app.commands.addCommand(
|
|
2874
|
+
app.commands.addCommand(_commands__WEBPACK_IMPORTED_MODULE_20__.COMMAND_MITO_AI_CELL_TOOLBAR_ACCEPT_CODE, {
|
|
2896
2875
|
label: `Accept ${operatingSystem === 'mac' ? '⌘Y' : 'Ctrl+Y'}`,
|
|
2897
2876
|
className: 'text-button-mito-ai button-base button-green',
|
|
2898
2877
|
caption: 'Accept Code',
|
|
@@ -2910,7 +2889,7 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
|
|
|
2910
2889
|
}
|
|
2911
2890
|
}
|
|
2912
2891
|
});
|
|
2913
|
-
app.commands.addCommand(
|
|
2892
|
+
app.commands.addCommand(_commands__WEBPACK_IMPORTED_MODULE_20__.COMMAND_MITO_AI_CELL_TOOLBAR_REJECT_CODE, {
|
|
2914
2893
|
label: `Reject ${operatingSystem === 'mac' ? '⌘U' : 'Ctrl+U'}`,
|
|
2915
2894
|
className: 'text-button-mito-ai button-base button-red',
|
|
2916
2895
|
caption: 'Reject Code',
|
|
@@ -2931,13 +2910,13 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
|
|
|
2931
2910
|
// Register keyboard shortcuts
|
|
2932
2911
|
const accelYDisposable = app.commands.addKeyBinding({
|
|
2933
2912
|
command: codeReviewStatus === 'chatPreview' ?
|
|
2934
|
-
|
|
2935
|
-
|
|
2913
|
+
_commands__WEBPACK_IMPORTED_MODULE_20__.COMMAND_MITO_AI_PREVIEW_LATEST_CODE :
|
|
2914
|
+
_commands__WEBPACK_IMPORTED_MODULE_20__.COMMAND_MITO_AI_APPLY_LATEST_CODE,
|
|
2936
2915
|
keys: ['Accel Y'],
|
|
2937
2916
|
selector: 'body',
|
|
2938
2917
|
});
|
|
2939
2918
|
const accelDDisposable = app.commands.addKeyBinding({
|
|
2940
|
-
command:
|
|
2919
|
+
command: _commands__WEBPACK_IMPORTED_MODULE_20__.COMMAND_MITO_AI_REJECT_LATEST_CODE,
|
|
2941
2920
|
keys: ['Accel U'],
|
|
2942
2921
|
selector: 'body',
|
|
2943
2922
|
preventDefault: true,
|
|
@@ -2954,8 +2933,8 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
|
|
|
2954
2933
|
// Without this, the user needs to take some action, like switching to a different cell
|
|
2955
2934
|
// and then switching back in order for the Jupyter to re-evaluate if it should
|
|
2956
2935
|
// show the toolbar buttons.
|
|
2957
|
-
app.commands.notifyCommandChanged(
|
|
2958
|
-
app.commands.notifyCommandChanged(
|
|
2936
|
+
app.commands.notifyCommandChanged(_commands__WEBPACK_IMPORTED_MODULE_20__.COMMAND_MITO_AI_CELL_TOOLBAR_ACCEPT_CODE);
|
|
2937
|
+
app.commands.notifyCommandChanged(_commands__WEBPACK_IMPORTED_MODULE_20__.COMMAND_MITO_AI_CELL_TOOLBAR_REJECT_CODE);
|
|
2959
2938
|
};
|
|
2960
2939
|
const codeDiffStripesCompartments = react__WEBPACK_IMPORTED_MODULE_1___default().useRef(new Map());
|
|
2961
2940
|
// Function to update the extensions of code cells
|
|
@@ -2983,13 +2962,13 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
|
|
|
2983
2962
|
codeDiffStripesCompartments.current.set(cellId, compartment);
|
|
2984
2963
|
// Apply the initial configuration
|
|
2985
2964
|
editorView.dispatch({
|
|
2986
|
-
effects: _codemirror_state__WEBPACK_IMPORTED_MODULE_0__.StateEffect.appendConfig.of(compartment.of(unifiedDiffLines !== undefined && isActiveCodeCell ? (0,
|
|
2965
|
+
effects: _codemirror_state__WEBPACK_IMPORTED_MODULE_0__.StateEffect.appendConfig.of(compartment.of(unifiedDiffLines !== undefined && isActiveCodeCell ? (0,_CodeDiffDisplay__WEBPACK_IMPORTED_MODULE_21__.codeDiffStripesExtension)({ unifiedDiffLines: unifiedDiffLines }) : [])),
|
|
2987
2966
|
});
|
|
2988
2967
|
}
|
|
2989
2968
|
else {
|
|
2990
2969
|
// Reconfigure the compartment
|
|
2991
2970
|
editorView.dispatch({
|
|
2992
|
-
effects: compartment.reconfigure(unifiedDiffLines !== undefined && isActiveCodeCell ? (0,
|
|
2971
|
+
effects: compartment.reconfigure(unifiedDiffLines !== undefined && isActiveCodeCell ? (0,_CodeDiffDisplay__WEBPACK_IMPORTED_MODULE_21__.codeDiffStripesExtension)({ unifiedDiffLines: unifiedDiffLines }) : []),
|
|
2993
2972
|
});
|
|
2994
2973
|
}
|
|
2995
2974
|
}
|
|
@@ -3004,7 +2983,7 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
|
|
|
3004
2983
|
// In agent mode, we group consecutive error messages together.
|
|
3005
2984
|
// In chat mode, we display messages individually as they were sent
|
|
3006
2985
|
if (agentModeEnabled) {
|
|
3007
|
-
processedDisplayOptimizedChatHistory = (0,
|
|
2986
|
+
processedDisplayOptimizedChatHistory = (0,_utils_chatHistory__WEBPACK_IMPORTED_MODULE_22__.processChatHistoryForErrorGrouping)(chatHistoryManager.getDisplayOptimizedHistory());
|
|
3008
2987
|
}
|
|
3009
2988
|
else {
|
|
3010
2989
|
processedDisplayOptimizedChatHistory = chatHistoryManager.getDisplayOptimizedHistory();
|
|
@@ -3016,16 +2995,16 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
|
|
|
3016
2995
|
return (react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: "chat-taskpane" },
|
|
3017
2996
|
react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: "chat-taskpane-header" },
|
|
3018
2997
|
react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: "chat-taskpane-header-left" },
|
|
3019
|
-
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
|
|
3020
|
-
void app.commands.execute(
|
|
2998
|
+
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_IconButton__WEBPACK_IMPORTED_MODULE_23__["default"], { icon: react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__.settingsIcon.react, null), title: "Mito AI Settings", onClick: () => {
|
|
2999
|
+
void app.commands.execute(_SettingsManager_SettingsManagerPlugin__WEBPACK_IMPORTED_MODULE_24__.COMMAND_MITO_AI_SETTINGS);
|
|
3021
3000
|
} })),
|
|
3022
3001
|
react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: "chat-taskpane-header-right" },
|
|
3023
|
-
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
|
|
3024
|
-
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
|
|
3002
|
+
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_IconButton__WEBPACK_IMPORTED_MODULE_23__["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(); } }),
|
|
3003
|
+
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_DropdownMenu__WEBPACK_IMPORTED_MODULE_25__["default"], { trigger: react__WEBPACK_IMPORTED_MODULE_1___default().createElement("button", { className: "icon-button", title: "Chat Threads", onClick: fetchChatThreads },
|
|
3025
3004
|
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__.historyIcon.react, null)), items: chatThreads.length > 0
|
|
3026
3005
|
? chatThreads.map(thread => ({
|
|
3027
3006
|
label: thread.name,
|
|
3028
|
-
primaryIcon: activeThreadIdRef.current === thread.thread_id ?
|
|
3007
|
+
primaryIcon: activeThreadIdRef.current === thread.thread_id ? _icons__WEBPACK_IMPORTED_MODULE_26__.OpenIndicatorLabIcon.react : undefined,
|
|
3029
3008
|
onClick: () => fetchChatHistoryAndSetActiveThread(thread.thread_id),
|
|
3030
3009
|
secondaryActions: [
|
|
3031
3010
|
{
|
|
@@ -3044,36 +3023,36 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
|
|
|
3044
3023
|
displayOptimizedChatHistory.length === 0 &&
|
|
3045
3024
|
react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: "chat-empty-message" },
|
|
3046
3025
|
react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { style: { margin: '0 auto 8px', display: 'block', textAlign: 'center' } },
|
|
3047
|
-
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
|
|
3026
|
+
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_icons_MitoLogo__WEBPACK_IMPORTED_MODULE_27__["default"], { width: "60", height: "30" })),
|
|
3048
3027
|
react__WEBPACK_IMPORTED_MODULE_1___default().createElement("span", { style: { display: 'block', textAlign: 'center', fontWeight: 'bold', fontSize: '20px', marginBottom: '15px' } }, "Data Copilot"),
|
|
3049
|
-
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
|
|
3028
|
+
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_CTACarousel__WEBPACK_IMPORTED_MODULE_28__["default"], { app: app })),
|
|
3050
3029
|
processedDisplayOptimizedChatHistory.map((displayOptimizedChat, index) => {
|
|
3051
3030
|
if (isGroupedErrorMessages(displayOptimizedChat)) {
|
|
3052
|
-
return (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
|
|
3031
|
+
return (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_AgentComponents_ErrorFixupToolUI__WEBPACK_IMPORTED_MODULE_29__["default"], { key: index, messages: displayOptimizedChat, renderMimeRegistry: renderMimeRegistry }));
|
|
3053
3032
|
}
|
|
3054
3033
|
else {
|
|
3055
|
-
return (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
|
|
3034
|
+
return (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_ChatMessage_ChatMessage__WEBPACK_IMPORTED_MODULE_30__["default"], { key: index, message: displayOptimizedChat.message, promptType: displayOptimizedChat.promptType, 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 }));
|
|
3056
3035
|
}
|
|
3057
3036
|
}).filter(message => message !== null),
|
|
3058
3037
|
loadingAIResponse &&
|
|
3059
3038
|
react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: "chat-loading-message" },
|
|
3060
3039
|
"Thinking ",
|
|
3061
|
-
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
|
|
3040
|
+
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_LoadingDots__WEBPACK_IMPORTED_MODULE_31__["default"], null)),
|
|
3062
3041
|
hasCheckpoint &&
|
|
3063
3042
|
agentModeEnabled &&
|
|
3064
3043
|
agentExecutionStatus === 'idle' &&
|
|
3065
3044
|
displayOptimizedChatHistory.length > 0 && (react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: 'message message-assistant-chat' },
|
|
3066
|
-
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
|
|
3067
|
-
void (0,
|
|
3045
|
+
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_TextAndIconButton__WEBPACK_IMPORTED_MODULE_32__["default"], { text: "Revert changes", icon: _icons_UndoIcon__WEBPACK_IMPORTED_MODULE_33__["default"], title: "Revert changes", onClick: () => {
|
|
3046
|
+
void (0,_utils_checkpoint__WEBPACK_IMPORTED_MODULE_15__.restoreCheckpoint)(app, notebookTracker, setHasCheckpoint);
|
|
3068
3047
|
setDisplayedNextStepsIfAvailable(false);
|
|
3069
3048
|
setHasCheckpoint(false);
|
|
3070
3049
|
setShowRevertQuestionnaire(true);
|
|
3071
3050
|
(0,_utils_scroll__WEBPACK_IMPORTED_MODULE_11__.scrollToDiv)(chatMessagesRef);
|
|
3072
3051
|
}, variant: "gray", width: "fit-contents", iconPosition: "left" }),
|
|
3073
3052
|
react__WEBPACK_IMPORTED_MODULE_1___default().createElement("p", { className: "text-muted text-sm" }, "Undo the most recent changes made by the agent"))),
|
|
3074
|
-
showRevertQuestionnaire && (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
|
|
3053
|
+
showRevertQuestionnaire && (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_ChatMessage_RevertQuestionnaire__WEBPACK_IMPORTED_MODULE_34__["default"], { onDestroy: () => setShowRevertQuestionnaire(false), getDuplicateChatHistoryManager: getDuplicateChatHistoryManager, setChatHistoryManager: setChatHistoryManager }))),
|
|
3075
3054
|
displayOptimizedChatHistory.length === 0 && (react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: "suggestions-container" },
|
|
3076
|
-
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
|
|
3055
|
+
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_ChatMessage_ScrollableSuggestions__WEBPACK_IMPORTED_MODULE_35__["default"], { onSelectSuggestion: (prompt) => {
|
|
3077
3056
|
if (agentModeEnabled) {
|
|
3078
3057
|
void startAgentExecution(prompt);
|
|
3079
3058
|
}
|
|
@@ -3082,15 +3061,15 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
|
|
|
3082
3061
|
}
|
|
3083
3062
|
} }))),
|
|
3084
3063
|
react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: `connected-input-container ${nextSteps.length > 0 ? 'has-next-steps' : ''}` },
|
|
3085
|
-
nextSteps.length > 0 && (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
|
|
3086
|
-
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
|
|
3064
|
+
nextSteps.length > 0 && (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_NextStepsPills__WEBPACK_IMPORTED_MODULE_36__["default"], { nextSteps: nextSteps, onSelectNextStep: agentModeEnabled ? startAgentExecution : sendChatInputMessage, displayedNextStepsIfAvailable: displayedNextStepsIfAvailable, setDisplayedNextStepsIfAvailable: setDisplayedNextStepsIfAvailable })),
|
|
3065
|
+
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_ChatMessage_ChatInput__WEBPACK_IMPORTED_MODULE_37__["default"], { app: app, initialContent: '', placeholder: agentExecutionStatus === 'working' ? 'Agent is working...' :
|
|
3087
3066
|
agentExecutionStatus === 'stopping' ? 'Agent is stopping...' :
|
|
3088
3067
|
agentModeEnabled ? 'Ask agent to do anything' :
|
|
3089
3068
|
displayOptimizedChatHistory.length < 2 ? `Ask question (${operatingSystem === 'mac' ? '⌘' : 'Ctrl'}E), @ to mention`
|
|
3090
3069
|
: `Ask followup (${operatingSystem === 'mac' ? '⌘' : 'Ctrl'}E), @ to mention`, onSave: agentModeEnabled ? startAgentExecution : sendChatInputMessage, onCancel: undefined, isEditing: false, contextManager: contextManager, notebookTracker: notebookTracker, agentModeEnabled: agentModeEnabled, agentExecutionStatus: agentExecutionStatus })),
|
|
3091
3070
|
agentExecutionStatus !== 'working' && agentExecutionStatus !== 'stopping' && (react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: "chat-controls" },
|
|
3092
3071
|
react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: "chat-controls-left" },
|
|
3093
|
-
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
|
|
3072
|
+
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_ToggleButton__WEBPACK_IMPORTED_MODULE_38__["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) => {
|
|
3094
3073
|
await startNewChat(); // TODO: delete thread instead of starting new chat
|
|
3095
3074
|
setAgentModeEnabled(!isLeftSelected);
|
|
3096
3075
|
// Clear agent checkpoint when switching modes
|
|
@@ -3126,7 +3105,7 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
|
|
|
3126
3105
|
" \u23CE"))),
|
|
3127
3106
|
(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" },
|
|
3128
3107
|
"Stopping",
|
|
3129
|
-
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
|
|
3108
|
+
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_LoadingCircle__WEBPACK_IMPORTED_MODULE_39__["default"], null),
|
|
3130
3109
|
" ")) : ('Stop Agent')))));
|
|
3131
3110
|
};
|
|
3132
3111
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ChatTaskpane);
|
|
@@ -3483,7 +3462,6 @@ const IChatTracker = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.Token('m
|
|
|
3483
3462
|
|
|
3484
3463
|
__webpack_require__.r(__webpack_exports__);
|
|
3485
3464
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3486
|
-
/* harmony export */ extractImagesFromContext: () => (/* binding */ extractImagesFromContext),
|
|
3487
3465
|
/* harmony export */ getBase64EncodedCellOutput: () => (/* binding */ getBase64EncodedCellOutput)
|
|
3488
3466
|
/* harmony export */ });
|
|
3489
3467
|
/* harmony import */ var _utils_notebook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/notebook */ "./lib/utils/notebook.js");
|
|
@@ -3513,18 +3491,6 @@ const getBase64EncodedCellOutput = async (notebookTracker, cellID) => {
|
|
|
3513
3491
|
}
|
|
3514
3492
|
return undefined;
|
|
3515
3493
|
};
|
|
3516
|
-
const extractImagesFromContext = (additionalContext, metadata) => {
|
|
3517
|
-
// Move any (base64 encoded) images from additionalContext into metadata.
|
|
3518
|
-
// The metadata is used on the backend to "attach" the image to the prompt;
|
|
3519
|
-
// plus the base64 encoded image is too big to include directly in the prompt.
|
|
3520
|
-
additionalContext === null || additionalContext === void 0 ? void 0 : additionalContext.map((context) => {
|
|
3521
|
-
if (context.type.startsWith('image/')) {
|
|
3522
|
-
metadata.base64EncodedUploadedImage = context.value;
|
|
3523
|
-
}
|
|
3524
|
-
});
|
|
3525
|
-
// Remove images from the additionalContext array and return the filtered result.
|
|
3526
|
-
return additionalContext === null || additionalContext === void 0 ? void 0 : additionalContext.filter(c => !c.type.startsWith('image/'));
|
|
3527
|
-
};
|
|
3528
3494
|
|
|
3529
3495
|
|
|
3530
3496
|
/***/ }),
|
|
@@ -4384,9 +4350,9 @@ const AppsList = ({ appManagerService }) => {
|
|
|
4384
4350
|
react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "app-item-status-container" },
|
|
4385
4351
|
react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", { className: "app-item-status-indicator", style: { backgroundColor: getStatusColor(app.status) } }),
|
|
4386
4352
|
react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", { className: "app-item-status-text" }, getStatusText(app.status))),
|
|
4387
|
-
react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "app-item-
|
|
4388
|
-
"
|
|
4389
|
-
app.
|
|
4353
|
+
react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "app-item-last-deployed" },
|
|
4354
|
+
"Last Deployed at: ",
|
|
4355
|
+
app.lastDeployedAt))),
|
|
4390
4356
|
react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "app-item-url-container" },
|
|
4391
4357
|
react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "app-item-url" }, app.url),
|
|
4392
4358
|
react__WEBPACK_IMPORTED_MODULE_0__.createElement("button", { onClick: () => copyToClipboard(app.url, app.name), className: "app-item-copy-button", title: `Copy URL for ${app.name}` },
|
|
@@ -4451,7 +4417,7 @@ const fetchUserApps = async (appManagerService) => {
|
|
|
4451
4417
|
name: app.app_name,
|
|
4452
4418
|
url: app.url,
|
|
4453
4419
|
status: (_a = app.status) === null || _a === void 0 ? void 0 : _a.toLowerCase(),
|
|
4454
|
-
|
|
4420
|
+
lastDeployedAt: app.last_deployed_at
|
|
4455
4421
|
});
|
|
4456
4422
|
});
|
|
4457
4423
|
return {
|
|
@@ -5369,7 +5335,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5369
5335
|
/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__);
|
|
5370
5336
|
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/apputils */ "webpack/sharing/consume/default/@jupyterlab/apputils");
|
|
5371
5337
|
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__);
|
|
5372
|
-
/* harmony import */ var
|
|
5338
|
+
/* harmony import */ var _SettingsWidget__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./SettingsWidget */ "./lib/Extensions/SettingsManager/SettingsWidget.js");
|
|
5339
|
+
/* harmony import */ var _ContextManager_ContextManagerPlugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../ContextManager/ContextManagerPlugin */ "./lib/Extensions/ContextManager/ContextManagerPlugin.js");
|
|
5373
5340
|
/*
|
|
5374
5341
|
* Copyright (c) Saga Inc.
|
|
5375
5342
|
* Distributed under the terms of the GNU Affero General Public License v3.0 License.
|
|
@@ -5377,6 +5344,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5377
5344
|
|
|
5378
5345
|
|
|
5379
5346
|
|
|
5347
|
+
|
|
5380
5348
|
const COMMAND_MITO_AI_SETTINGS = 'mito-ai:open-settings';
|
|
5381
5349
|
/**
|
|
5382
5350
|
* Initialization data for the mito settings extension.
|
|
@@ -5385,14 +5353,14 @@ const SettingsManagerPlugin = {
|
|
|
5385
5353
|
id: 'mito-ai:settings-manager',
|
|
5386
5354
|
description: 'Mito AI settings manager',
|
|
5387
5355
|
autoStart: true,
|
|
5388
|
-
requires: [_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.ICommandPalette],
|
|
5356
|
+
requires: [_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.ICommandPalette, _ContextManager_ContextManagerPlugin__WEBPACK_IMPORTED_MODULE_2__.IContextManager],
|
|
5389
5357
|
optional: [_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ILayoutRestorer],
|
|
5390
5358
|
activate: _activate
|
|
5391
5359
|
};
|
|
5392
|
-
function _activate(app, palette, restorer) {
|
|
5360
|
+
function _activate(app, palette, contextManager, restorer) {
|
|
5393
5361
|
// Create a widget creator function
|
|
5394
5362
|
const newWidget = () => {
|
|
5395
|
-
const content = new
|
|
5363
|
+
const content = new _SettingsWidget__WEBPACK_IMPORTED_MODULE_3__.SettingsWidget(contextManager);
|
|
5396
5364
|
const widget = new _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.MainAreaWidget({ content });
|
|
5397
5365
|
widget.id = 'mito-ai-settings';
|
|
5398
5366
|
widget.title.label = 'Mito AI Settings';
|
|
@@ -5457,9 +5425,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5457
5425
|
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/apputils */ "webpack/sharing/consume/default/@jupyterlab/apputils");
|
|
5458
5426
|
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__);
|
|
5459
5427
|
/* harmony import */ var _database_DatabasePage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./database/DatabasePage */ "./lib/Extensions/SettingsManager/database/DatabasePage.js");
|
|
5460
|
-
/* harmony import */ var
|
|
5428
|
+
/* harmony import */ var _support_SupportPage__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./support/SupportPage */ "./lib/Extensions/SettingsManager/support/SupportPage.js");
|
|
5461
5429
|
/* harmony import */ var _general_GeneralPage__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./general/GeneralPage */ "./lib/Extensions/SettingsManager/general/GeneralPage.js");
|
|
5462
5430
|
/* harmony import */ var _rules_RulesPage__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./rules/RulesPage */ "./lib/Extensions/SettingsManager/rules/RulesPage.js");
|
|
5431
|
+
/* harmony import */ var _profiler_ProfilerPage__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./profiler/ProfilerPage */ "./lib/Extensions/SettingsManager/profiler/ProfilerPage.js");
|
|
5463
5432
|
/* harmony import */ var _style_SettingsWidget_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../style/SettingsWidget.css */ "./style/SettingsWidget.css");
|
|
5464
5433
|
/*
|
|
5465
5434
|
* Copyright (c) Saga Inc.
|
|
@@ -5472,7 +5441,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5472
5441
|
|
|
5473
5442
|
|
|
5474
5443
|
|
|
5475
|
-
|
|
5444
|
+
|
|
5445
|
+
const TABS_CONFIG = (contextManager) => ({
|
|
5476
5446
|
database: {
|
|
5477
5447
|
label: 'Database',
|
|
5478
5448
|
component: _database_DatabasePage__WEBPACK_IMPORTED_MODULE_3__.DatabasePage
|
|
@@ -5485,31 +5455,37 @@ const TABS_CONFIG = {
|
|
|
5485
5455
|
label: 'Rules',
|
|
5486
5456
|
component: _rules_RulesPage__WEBPACK_IMPORTED_MODULE_5__.RulesPage
|
|
5487
5457
|
},
|
|
5458
|
+
profiler: {
|
|
5459
|
+
label: 'Profiler',
|
|
5460
|
+
component: () => react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_profiler_ProfilerPage__WEBPACK_IMPORTED_MODULE_6__.ProfilerPage, { contextManager: contextManager })
|
|
5461
|
+
},
|
|
5488
5462
|
support: {
|
|
5489
5463
|
label: 'Support',
|
|
5490
|
-
component:
|
|
5464
|
+
component: _support_SupportPage__WEBPACK_IMPORTED_MODULE_7__.SupportPage
|
|
5491
5465
|
},
|
|
5492
|
-
};
|
|
5493
|
-
const App = () => {
|
|
5466
|
+
});
|
|
5467
|
+
const App = ({ contextManager }) => {
|
|
5494
5468
|
const [activeTab, setActiveTab] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)('database');
|
|
5469
|
+
const tabsConfig = TABS_CONFIG(contextManager);
|
|
5495
5470
|
const renderContent = () => {
|
|
5496
|
-
const TabComponent =
|
|
5471
|
+
const TabComponent = tabsConfig[activeTab].component;
|
|
5497
5472
|
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(TabComponent, null);
|
|
5498
5473
|
};
|
|
5499
5474
|
return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "settings-widget" },
|
|
5500
5475
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "settings-layout" },
|
|
5501
5476
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "settings-sidebar" },
|
|
5502
5477
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("nav", null,
|
|
5503
|
-
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("ul", null, Object.entries(
|
|
5478
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("ul", null, Object.entries(tabsConfig).map(([key, { label }]) => (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", { key: key, className: activeTab === key ? 'active' : '', onClick: () => setActiveTab(key) }, label)))))),
|
|
5504
5479
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "settings-main" }, renderContent()))));
|
|
5505
5480
|
};
|
|
5506
5481
|
class SettingsWidget extends _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.ReactWidget {
|
|
5507
|
-
constructor() {
|
|
5482
|
+
constructor(contextManager) {
|
|
5508
5483
|
super();
|
|
5484
|
+
this.contextManager = contextManager;
|
|
5509
5485
|
this.addClass('jp-ReactWidget');
|
|
5510
5486
|
}
|
|
5511
5487
|
render() {
|
|
5512
|
-
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(App,
|
|
5488
|
+
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(App, { contextManager: this.contextManager });
|
|
5513
5489
|
}
|
|
5514
5490
|
}
|
|
5515
5491
|
|
|
@@ -6157,6 +6133,198 @@ const GeneralPage = () => {
|
|
|
6157
6133
|
};
|
|
6158
6134
|
|
|
6159
6135
|
|
|
6136
|
+
/***/ }),
|
|
6137
|
+
|
|
6138
|
+
/***/ "./lib/Extensions/SettingsManager/profiler/CapturedRequestsSection.js":
|
|
6139
|
+
/*!****************************************************************************!*\
|
|
6140
|
+
!*** ./lib/Extensions/SettingsManager/profiler/CapturedRequestsSection.js ***!
|
|
6141
|
+
\****************************************************************************/
|
|
6142
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
6143
|
+
|
|
6144
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6145
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6146
|
+
/* harmony export */ CapturedRequestsSection: () => (/* binding */ CapturedRequestsSection)
|
|
6147
|
+
/* harmony export */ });
|
|
6148
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
|
|
6149
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
6150
|
+
/* harmony import */ var _utils_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../utils/constants */ "./lib/utils/constants.js");
|
|
6151
|
+
/*
|
|
6152
|
+
* Copyright (c) Saga Inc.
|
|
6153
|
+
* Distributed under the terms of the GNU Affero General Public License v3.0 License.
|
|
6154
|
+
*/
|
|
6155
|
+
|
|
6156
|
+
|
|
6157
|
+
const CapturedRequestsSection = () => {
|
|
6158
|
+
const [capturedRequests, setCapturedRequests] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]);
|
|
6159
|
+
// Listen for captured completion requests
|
|
6160
|
+
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
6161
|
+
const handleCapturedRequest = (event) => {
|
|
6162
|
+
setCapturedRequests(prev => [event.detail, ...prev]);
|
|
6163
|
+
};
|
|
6164
|
+
window.addEventListener(_utils_constants__WEBPACK_IMPORTED_MODULE_1__.EVENT_NAMES.MITO_AI_CAPTURE_REQUEST, handleCapturedRequest);
|
|
6165
|
+
return () => {
|
|
6166
|
+
window.removeEventListener(_utils_constants__WEBPACK_IMPORTED_MODULE_1__.EVENT_NAMES.MITO_AI_CAPTURE_REQUEST, handleCapturedRequest);
|
|
6167
|
+
};
|
|
6168
|
+
}, []);
|
|
6169
|
+
const clearCapturedRequests = () => {
|
|
6170
|
+
setCapturedRequests([]);
|
|
6171
|
+
};
|
|
6172
|
+
const copyRequestToClipboard = async (request) => {
|
|
6173
|
+
try {
|
|
6174
|
+
await navigator.clipboard.writeText(JSON.stringify(request, null, 2));
|
|
6175
|
+
console.log('Request copied to clipboard');
|
|
6176
|
+
}
|
|
6177
|
+
catch (err) {
|
|
6178
|
+
console.error('Failed to copy request to clipboard:', err);
|
|
6179
|
+
}
|
|
6180
|
+
};
|
|
6181
|
+
return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null,
|
|
6182
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("h3", null, "Captured Completion Requests"),
|
|
6183
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { className: "button-base profiler-clear-button", onClick: clearCapturedRequests }, "Clear Captured Requests"),
|
|
6184
|
+
capturedRequests.length === 0 ? (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", { className: "profiler-no-requests" }, "No requests captured yet. Send a message in the AI chat to see captured requests here.")) : (capturedRequests.map((captured, index) => (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { key: index, className: "profiler-request-container" },
|
|
6185
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "profiler-request-header" },
|
|
6186
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("h4", null, capturedRequests.length - index),
|
|
6187
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { className: "button-base profiler-copy-button", onClick: () => copyRequestToClipboard(captured.request) }, "Copy")),
|
|
6188
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("pre", { className: "json-container" }, JSON.stringify(captured.request, null, 2))))))));
|
|
6189
|
+
};
|
|
6190
|
+
|
|
6191
|
+
|
|
6192
|
+
/***/ }),
|
|
6193
|
+
|
|
6194
|
+
/***/ "./lib/Extensions/SettingsManager/profiler/ContextManagerSection.js":
|
|
6195
|
+
/*!**************************************************************************!*\
|
|
6196
|
+
!*** ./lib/Extensions/SettingsManager/profiler/ContextManagerSection.js ***!
|
|
6197
|
+
\**************************************************************************/
|
|
6198
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
6199
|
+
|
|
6200
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6201
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6202
|
+
/* harmony export */ ContextManagerSection: () => (/* binding */ ContextManagerSection)
|
|
6203
|
+
/* harmony export */ });
|
|
6204
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
|
|
6205
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
6206
|
+
/*
|
|
6207
|
+
* Copyright (c) Saga Inc.
|
|
6208
|
+
* Distributed under the terms of the GNU Affero General Public License v3.0 License.
|
|
6209
|
+
*/
|
|
6210
|
+
|
|
6211
|
+
const ContextManagerSection = ({ contextManager }) => {
|
|
6212
|
+
const [refreshKey, setRefreshKey] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0);
|
|
6213
|
+
const handleRefreshContextManager = () => {
|
|
6214
|
+
// Force a re-render by toggling the state
|
|
6215
|
+
setRefreshKey(prev => prev + 1);
|
|
6216
|
+
};
|
|
6217
|
+
const copyContextManagerToClipboard = async () => {
|
|
6218
|
+
const jsonContent = JSON.stringify({
|
|
6219
|
+
variables: contextManager.variables,
|
|
6220
|
+
files: contextManager.files
|
|
6221
|
+
}, null, 2);
|
|
6222
|
+
try {
|
|
6223
|
+
await navigator.clipboard.writeText(jsonContent);
|
|
6224
|
+
console.log('Context Manager contents copied to clipboard');
|
|
6225
|
+
}
|
|
6226
|
+
catch (err) {
|
|
6227
|
+
console.error('Failed to copy to clipboard:', err);
|
|
6228
|
+
}
|
|
6229
|
+
};
|
|
6230
|
+
return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null,
|
|
6231
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("h3", null, "Context Manager"),
|
|
6232
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "profiler-button-container" },
|
|
6233
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { className: "button-base", onClick: handleRefreshContextManager }, "Refresh"),
|
|
6234
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { className: "button-base", onClick: copyContextManagerToClipboard }, "Copy")),
|
|
6235
|
+
refreshKey > 0 && (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "settings-option" },
|
|
6236
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("pre", { className: "json-container" }, JSON.stringify({
|
|
6237
|
+
variables: contextManager.variables,
|
|
6238
|
+
files: contextManager.files
|
|
6239
|
+
}, null, 2))))));
|
|
6240
|
+
};
|
|
6241
|
+
|
|
6242
|
+
|
|
6243
|
+
/***/ }),
|
|
6244
|
+
|
|
6245
|
+
/***/ "./lib/Extensions/SettingsManager/profiler/ProfilerPage.js":
|
|
6246
|
+
/*!*****************************************************************!*\
|
|
6247
|
+
!*** ./lib/Extensions/SettingsManager/profiler/ProfilerPage.js ***!
|
|
6248
|
+
\*****************************************************************/
|
|
6249
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
6250
|
+
|
|
6251
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6252
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6253
|
+
/* harmony export */ ProfilerPage: () => (/* binding */ ProfilerPage),
|
|
6254
|
+
/* harmony export */ captureCompletionRequest: () => (/* binding */ captureCompletionRequest)
|
|
6255
|
+
/* harmony export */ });
|
|
6256
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
|
|
6257
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
6258
|
+
/* harmony import */ var _ContextManagerSection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ContextManagerSection */ "./lib/Extensions/SettingsManager/profiler/ContextManagerSection.js");
|
|
6259
|
+
/* harmony import */ var _CapturedRequestsSection__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./CapturedRequestsSection */ "./lib/Extensions/SettingsManager/profiler/CapturedRequestsSection.js");
|
|
6260
|
+
/* harmony import */ var _utils_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../utils/constants */ "./lib/utils/constants.js");
|
|
6261
|
+
/* harmony import */ var _restAPI_RestAPI__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../restAPI/RestAPI */ "./lib/restAPI/RestAPI.js");
|
|
6262
|
+
/* harmony import */ var _style_ProfilerPage_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../style/ProfilerPage.css */ "./style/ProfilerPage.css");
|
|
6263
|
+
/*
|
|
6264
|
+
* Copyright (c) Saga Inc.
|
|
6265
|
+
* Distributed under the terms of the GNU Affero General Public License v3.0 License.
|
|
6266
|
+
*/
|
|
6267
|
+
|
|
6268
|
+
|
|
6269
|
+
|
|
6270
|
+
|
|
6271
|
+
|
|
6272
|
+
|
|
6273
|
+
// Simple event system for capturing completion requests.
|
|
6274
|
+
// These events are usually variables that are not stored in the context manager,
|
|
6275
|
+
// and are created dynamically. So we capture them before they are sent to the backend.
|
|
6276
|
+
const captureCompletionRequest = (request) => {
|
|
6277
|
+
const event = new CustomEvent(_utils_constants__WEBPACK_IMPORTED_MODULE_2__.EVENT_NAMES.MITO_AI_CAPTURE_REQUEST, {
|
|
6278
|
+
detail: {
|
|
6279
|
+
request,
|
|
6280
|
+
}
|
|
6281
|
+
});
|
|
6282
|
+
window.dispatchEvent(event);
|
|
6283
|
+
};
|
|
6284
|
+
const ProfilerPage = ({ contextManager }) => {
|
|
6285
|
+
const [hasAcceptedDisclaimer, setHasAcceptedDisclaimer] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
|
|
6286
|
+
// When we first open the page, check if the user has already accepted the disclaimer
|
|
6287
|
+
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
6288
|
+
const checkDisclaimerStatus = async () => {
|
|
6289
|
+
try {
|
|
6290
|
+
const disclaimerAccepted = await (0,_restAPI_RestAPI__WEBPACK_IMPORTED_MODULE_3__.getSetting)('profiler_disclaimer_accepted');
|
|
6291
|
+
setHasAcceptedDisclaimer(disclaimerAccepted === 'true');
|
|
6292
|
+
}
|
|
6293
|
+
catch (error) {
|
|
6294
|
+
console.error('Error checking disclaimer status:', error);
|
|
6295
|
+
// If there's an error, default to showing the disclaimer
|
|
6296
|
+
setHasAcceptedDisclaimer(false);
|
|
6297
|
+
}
|
|
6298
|
+
};
|
|
6299
|
+
void checkDisclaimerStatus();
|
|
6300
|
+
}, []);
|
|
6301
|
+
const handleAcceptDisclaimer = async () => {
|
|
6302
|
+
try {
|
|
6303
|
+
await (0,_restAPI_RestAPI__WEBPACK_IMPORTED_MODULE_3__.updateSettings)('profiler_disclaimer_accepted', 'true');
|
|
6304
|
+
setHasAcceptedDisclaimer(true);
|
|
6305
|
+
}
|
|
6306
|
+
catch (error) {
|
|
6307
|
+
console.error('Error accepting disclaimer:', error);
|
|
6308
|
+
}
|
|
6309
|
+
};
|
|
6310
|
+
// Show disclaimer if not yet accepted
|
|
6311
|
+
if (!hasAcceptedDisclaimer) {
|
|
6312
|
+
return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null,
|
|
6313
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "settings-header" },
|
|
6314
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("h2", null, "Profiler")),
|
|
6315
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", null, "The profiler is an internal debugging tool intended for use by the Mito development team. It is not designed, tested, or supported for general usage. Running the profiler may impact performance, produce unstable behavior, or generate incomplete results. Use at your own discretion."),
|
|
6316
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { className: "button-base button-gray", onClick: handleAcceptDisclaimer }, "Accept")));
|
|
6317
|
+
}
|
|
6318
|
+
// Show the actual profiler content after disclaimer is accepted
|
|
6319
|
+
return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null,
|
|
6320
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "settings-header" },
|
|
6321
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("h2", null, "Profiler")),
|
|
6322
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", { className: "profiler-warning" }, "For internal debugging only."),
|
|
6323
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_ContextManagerSection__WEBPACK_IMPORTED_MODULE_4__.ContextManagerSection, { contextManager: contextManager }),
|
|
6324
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_CapturedRequestsSection__WEBPACK_IMPORTED_MODULE_5__.CapturedRequestsSection, null)));
|
|
6325
|
+
};
|
|
6326
|
+
|
|
6327
|
+
|
|
6160
6328
|
/***/ }),
|
|
6161
6329
|
|
|
6162
6330
|
/***/ "./lib/Extensions/SettingsManager/rules/RulesForm.js":
|
|
@@ -7532,7 +7700,6 @@ const AttachFileButton = ({ onFileUploaded, notebookTracker }) => {
|
|
|
7532
7700
|
autoClose: 5 * 1000 // 5 seconds
|
|
7533
7701
|
});
|
|
7534
7702
|
console.error('Upload failed:', resp.error.message);
|
|
7535
|
-
throw new Error(resp.error.message);
|
|
7536
7703
|
}
|
|
7537
7704
|
else if (resp.data) {
|
|
7538
7705
|
console.log('File uploaded successfully:', resp.data);
|
|
@@ -9710,6 +9877,27 @@ const getCodeDiffsAndUnifiedCodeString = (originalCode, modifiedCode) => {
|
|
|
9710
9877
|
};
|
|
9711
9878
|
|
|
9712
9879
|
|
|
9880
|
+
/***/ }),
|
|
9881
|
+
|
|
9882
|
+
/***/ "./lib/utils/constants.js":
|
|
9883
|
+
/*!********************************!*\
|
|
9884
|
+
!*** ./lib/utils/constants.js ***!
|
|
9885
|
+
\********************************/
|
|
9886
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
9887
|
+
|
|
9888
|
+
__webpack_require__.r(__webpack_exports__);
|
|
9889
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
9890
|
+
/* harmony export */ EVENT_NAMES: () => (/* binding */ EVENT_NAMES)
|
|
9891
|
+
/* harmony export */ });
|
|
9892
|
+
/*
|
|
9893
|
+
* Copyright (c) Saga Inc.
|
|
9894
|
+
* Distributed under the terms of the GNU Affero General Public License v3.0 License.
|
|
9895
|
+
*/
|
|
9896
|
+
const EVENT_NAMES = {
|
|
9897
|
+
MITO_AI_CAPTURE_REQUEST: 'mito-ai-capture-request',
|
|
9898
|
+
};
|
|
9899
|
+
|
|
9900
|
+
|
|
9713
9901
|
/***/ }),
|
|
9714
9902
|
|
|
9715
9903
|
/***/ "./lib/utils/copyToClipboard.js":
|
|
@@ -11860,7 +12048,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, `/*
|
|
|
11860
12048
|
font-size: 12px;
|
|
11861
12049
|
}
|
|
11862
12050
|
|
|
11863
|
-
.app-item-
|
|
12051
|
+
.app-item-last-deployed {
|
|
11864
12052
|
color: var(--jp-ui-font-color2);
|
|
11865
12053
|
font-size: 11px;
|
|
11866
12054
|
}
|
|
@@ -11899,7 +12087,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, `/*
|
|
|
11899
12087
|
.app-item-copy-button:hover {
|
|
11900
12088
|
background-color: var(--jp-layout-color2);
|
|
11901
12089
|
}
|
|
11902
|
-
`, "",{"version":3,"sources":["webpack://./style/AppsList.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF,kBAAkB;AAClB;EACE,aAAa;EACb,eAAe;EACf,qCAAqC;AACvC;;AAEA;EACE,aAAa;EACb,8BAA8B;EAC9B,mBAAmB;EACnB,mBAAmB;AACrB;;AAEA;EACE,SAAS;EACT,eAAe;EACf,iBAAiB;EACjB,+BAA+B;AACjC;;AAEA;EACE,aAAa;EACb,QAAQ;AACV;;AAEA;EACE,gBAAgB;EAChB,eAAe;EACf,6BAA6B;EAC7B,+BAA+B;EAC/B,yCAAyC;EACzC,kBAAkB;EAClB,eAAe;EACf,mBAAmB;EACnB,sCAAsC;AACxC;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,mBAAmB;AACrB;;AAEA;EACE,wCAAwC;EACxC,YAAY;EACZ,YAAY;AACd;;AAEA;EACE,+BAA+B;EAC/B,kBAAkB;EAClB,eAAe;AACjB;;AAEA;EACE,cAAc;EACd,kBAAkB;EAClB,eAAe;EACf,yCAAyC;EACzC,yBAAyB;EACzB,kBAAkB;AACpB;;AAEA;EACE,eAAe;AACjB;;AAEA;EACE,+BAA+B;EAC/B,kBAAkB;EAClB,eAAe;AACjB;;AAEA;EACE,yCAAyC;EACzC,kBAAkB;EAClB,aAAa;EACb,kBAAkB;EAClB,yCAAyC;AAC3C;;AAEA;EACE,aAAa;EACb,8BAA8B;EAC9B,uBAAuB;EACvB,kBAAkB;AACpB;;AAEA;EACE,OAAO;AACT;;AAEA;EACE,iBAAiB;EACjB,+BAA+B;EAC/B,kBAAkB;AACpB;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,kBAAkB;AACpB;;AAEA;EACE,qBAAqB;EACrB,UAAU;EACV,WAAW;EACX,kBAAkB;EAClB,iBAAiB;AACnB;;AAEA;EACE,+BAA+B;EAC/B,eAAe;AACjB;;AAEA;EACE,+BAA+B;EAC/B,eAAe;AACjB;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,yCAAyC;EACzC,yCAAyC;EACzC,kBAAkB;EAClB,gBAAgB;AAClB;;AAEA;EACE,OAAO;EACP,+BAA+B;EAC/B,eAAe;EACf,gBAAgB;EAChB,uBAAuB;EACvB,mBAAmB;EACnB,uCAAuC;AACzC;;AAEA;EACE,YAAY;EACZ,uBAAuB;EACvB,eAAe;EACf,YAAY;EACZ,aAAa;EACb,mBAAmB;EACnB,uBAAuB;EACvB,gBAAgB;EAChB,kBAAkB;AACpB;;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/* apps-list.css */\n.apps-list-container {\n padding: 16px;\n font-size: 13px;\n font-family: var(--jp-ui-font-family);\n}\n\n.apps-list-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 16px;\n}\n\n.apps-list-title {\n margin: 0;\n font-size: 14px;\n font-weight: bold;\n color: var(--jp-ui-font-color1);\n}\n\n.apps-list-actions {\n display: flex;\n gap: 8px;\n}\n\n.apps-list-button {\n padding: 4px 8px;\n font-size: 11px;\n background-color: transparent;\n color: var(--jp-ui-font-color2);\n border: 1px solid var(--jp-border-color2);\n border-radius: 3px;\n cursor: pointer;\n font-weight: normal;\n transition: background-color 0.2s ease;\n}\n\n.apps-list-button:hover {\n background-color: var(--jp-layout-color2);\n}\n\n.apps-list-button:disabled {\n cursor: not-allowed;\n}\n\n.apps-list-button.primary {\n background-color: var(--jp-brand-color1);\n color: white;\n border: none;\n}\n\n.apps-list-loading {\n color: var(--jp-ui-font-color2);\n text-align: center;\n padding: 20px 0;\n}\n\n.apps-list-error {\n color: #f44336;\n text-align: center;\n padding: 20px 0;\n background-color: var(--jp-layout-color1);\n border: 1px solid #f44336;\n border-radius: 4px;\n}\n\n.apps-list-error-actions {\n margin-top: 8px;\n}\n\n.apps-list-empty {\n color: var(--jp-ui-font-color2);\n text-align: center;\n padding: 20px 0;\n}\n\n.app-item {\n border: 1px solid var(--jp-border-color1);\n border-radius: 4px;\n padding: 12px;\n margin-bottom: 8px;\n background-color: var(--jp-layout-color0);\n}\n\n.app-item-header {\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n margin-bottom: 8px;\n}\n\n.app-item-content {\n flex: 1;\n}\n\n.app-item-name {\n font-weight: bold;\n color: var(--jp-ui-font-color1);\n margin-bottom: 4px;\n}\n\n.app-item-status-container {\n display: flex;\n align-items: center;\n margin-bottom: 4px;\n}\n\n.app-item-status-indicator {\n display: inline-block;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n margin-right: 6px;\n}\n\n.app-item-status-text {\n color: var(--jp-ui-font-color2);\n font-size: 12px;\n}\n\n.app-item-
|
|
12090
|
+
`, "",{"version":3,"sources":["webpack://./style/AppsList.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF,kBAAkB;AAClB;EACE,aAAa;EACb,eAAe;EACf,qCAAqC;AACvC;;AAEA;EACE,aAAa;EACb,8BAA8B;EAC9B,mBAAmB;EACnB,mBAAmB;AACrB;;AAEA;EACE,SAAS;EACT,eAAe;EACf,iBAAiB;EACjB,+BAA+B;AACjC;;AAEA;EACE,aAAa;EACb,QAAQ;AACV;;AAEA;EACE,gBAAgB;EAChB,eAAe;EACf,6BAA6B;EAC7B,+BAA+B;EAC/B,yCAAyC;EACzC,kBAAkB;EAClB,eAAe;EACf,mBAAmB;EACnB,sCAAsC;AACxC;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,mBAAmB;AACrB;;AAEA;EACE,wCAAwC;EACxC,YAAY;EACZ,YAAY;AACd;;AAEA;EACE,+BAA+B;EAC/B,kBAAkB;EAClB,eAAe;AACjB;;AAEA;EACE,cAAc;EACd,kBAAkB;EAClB,eAAe;EACf,yCAAyC;EACzC,yBAAyB;EACzB,kBAAkB;AACpB;;AAEA;EACE,eAAe;AACjB;;AAEA;EACE,+BAA+B;EAC/B,kBAAkB;EAClB,eAAe;AACjB;;AAEA;EACE,yCAAyC;EACzC,kBAAkB;EAClB,aAAa;EACb,kBAAkB;EAClB,yCAAyC;AAC3C;;AAEA;EACE,aAAa;EACb,8BAA8B;EAC9B,uBAAuB;EACvB,kBAAkB;AACpB;;AAEA;EACE,OAAO;AACT;;AAEA;EACE,iBAAiB;EACjB,+BAA+B;EAC/B,kBAAkB;AACpB;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,kBAAkB;AACpB;;AAEA;EACE,qBAAqB;EACrB,UAAU;EACV,WAAW;EACX,kBAAkB;EAClB,iBAAiB;AACnB;;AAEA;EACE,+BAA+B;EAC/B,eAAe;AACjB;;AAEA;EACE,+BAA+B;EAC/B,eAAe;AACjB;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,yCAAyC;EACzC,yCAAyC;EACzC,kBAAkB;EAClB,gBAAgB;AAClB;;AAEA;EACE,OAAO;EACP,+BAA+B;EAC/B,eAAe;EACf,gBAAgB;EAChB,uBAAuB;EACvB,mBAAmB;EACnB,uCAAuC;AACzC;;AAEA;EACE,YAAY;EACZ,uBAAuB;EACvB,eAAe;EACf,YAAY;EACZ,aAAa;EACb,mBAAmB;EACnB,uBAAuB;EACvB,gBAAgB;EAChB,kBAAkB;AACpB;;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/* apps-list.css */\n.apps-list-container {\n padding: 16px;\n font-size: 13px;\n font-family: var(--jp-ui-font-family);\n}\n\n.apps-list-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 16px;\n}\n\n.apps-list-title {\n margin: 0;\n font-size: 14px;\n font-weight: bold;\n color: var(--jp-ui-font-color1);\n}\n\n.apps-list-actions {\n display: flex;\n gap: 8px;\n}\n\n.apps-list-button {\n padding: 4px 8px;\n font-size: 11px;\n background-color: transparent;\n color: var(--jp-ui-font-color2);\n border: 1px solid var(--jp-border-color2);\n border-radius: 3px;\n cursor: pointer;\n font-weight: normal;\n transition: background-color 0.2s ease;\n}\n\n.apps-list-button:hover {\n background-color: var(--jp-layout-color2);\n}\n\n.apps-list-button:disabled {\n cursor: not-allowed;\n}\n\n.apps-list-button.primary {\n background-color: var(--jp-brand-color1);\n color: white;\n border: none;\n}\n\n.apps-list-loading {\n color: var(--jp-ui-font-color2);\n text-align: center;\n padding: 20px 0;\n}\n\n.apps-list-error {\n color: #f44336;\n text-align: center;\n padding: 20px 0;\n background-color: var(--jp-layout-color1);\n border: 1px solid #f44336;\n border-radius: 4px;\n}\n\n.apps-list-error-actions {\n margin-top: 8px;\n}\n\n.apps-list-empty {\n color: var(--jp-ui-font-color2);\n text-align: center;\n padding: 20px 0;\n}\n\n.app-item {\n border: 1px solid var(--jp-border-color1);\n border-radius: 4px;\n padding: 12px;\n margin-bottom: 8px;\n background-color: var(--jp-layout-color0);\n}\n\n.app-item-header {\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n margin-bottom: 8px;\n}\n\n.app-item-content {\n flex: 1;\n}\n\n.app-item-name {\n font-weight: bold;\n color: var(--jp-ui-font-color1);\n margin-bottom: 4px;\n}\n\n.app-item-status-container {\n display: flex;\n align-items: center;\n margin-bottom: 4px;\n}\n\n.app-item-status-indicator {\n display: inline-block;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n margin-right: 6px;\n}\n\n.app-item-status-text {\n color: var(--jp-ui-font-color2);\n font-size: 12px;\n}\n\n.app-item-last-deployed {\n color: var(--jp-ui-font-color2);\n font-size: 11px;\n}\n\n.app-item-url-container {\n display: flex;\n align-items: center;\n background-color: var(--jp-layout-color1);\n border: 1px solid var(--jp-border-color2);\n border-radius: 3px;\n padding: 6px 8px;\n}\n\n.app-item-url {\n flex: 1;\n color: var(--jp-ui-font-color1);\n font-size: 11px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-family: var(--jp-code-font-family);\n}\n\n.app-item-copy-button {\n border: none;\n background: transparent;\n cursor: pointer;\n padding: 2px;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-left: 8px;\n border-radius: 2px;\n}\n\n.app-item-copy-button:hover {\n background-color: var(--jp-layout-color2);\n}\n"],"sourceRoot":""}]);
|
|
11903
12091
|
// Exports
|
|
11904
12092
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
11905
12093
|
|
|
@@ -14869,6 +15057,78 @@ ___CSS_LOADER_EXPORT___.push([module.id, `/*
|
|
|
14869
15057
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
14870
15058
|
|
|
14871
15059
|
|
|
15060
|
+
/***/ }),
|
|
15061
|
+
|
|
15062
|
+
/***/ "./node_modules/css-loader/dist/cjs.js!./style/ProfilerPage.css":
|
|
15063
|
+
/*!**********************************************************************!*\
|
|
15064
|
+
!*** ./node_modules/css-loader/dist/cjs.js!./style/ProfilerPage.css ***!
|
|
15065
|
+
\**********************************************************************/
|
|
15066
|
+
/***/ ((module, __webpack_exports__, __webpack_require__) => {
|
|
15067
|
+
|
|
15068
|
+
__webpack_require__.r(__webpack_exports__);
|
|
15069
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
15070
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
15071
|
+
/* harmony export */ });
|
|
15072
|
+
/* 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");
|
|
15073
|
+
/* 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__);
|
|
15074
|
+
/* 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");
|
|
15075
|
+
/* 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__);
|
|
15076
|
+
// Imports
|
|
15077
|
+
|
|
15078
|
+
|
|
15079
|
+
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()));
|
|
15080
|
+
// Module
|
|
15081
|
+
___CSS_LOADER_EXPORT___.push([module.id, `/*
|
|
15082
|
+
* Copyright (c) Saga Inc.
|
|
15083
|
+
* Distributed under the terms of the GNU Affero General Public License v3.0 License.
|
|
15084
|
+
*/
|
|
15085
|
+
|
|
15086
|
+
.profiler-warning {
|
|
15087
|
+
color: red;
|
|
15088
|
+
}
|
|
15089
|
+
|
|
15090
|
+
.profiler-button-container {
|
|
15091
|
+
display: flex;
|
|
15092
|
+
gap: 10px;
|
|
15093
|
+
margin-bottom: 10px;
|
|
15094
|
+
}
|
|
15095
|
+
|
|
15096
|
+
.json-container {
|
|
15097
|
+
overflow-y: auto;
|
|
15098
|
+
padding: 10px;
|
|
15099
|
+
background-color: var(--jp-input-background);
|
|
15100
|
+
}
|
|
15101
|
+
|
|
15102
|
+
.profiler-clear-button {
|
|
15103
|
+
margin-bottom: 10px;
|
|
15104
|
+
}
|
|
15105
|
+
|
|
15106
|
+
.profiler-no-requests {
|
|
15107
|
+
color: #666;
|
|
15108
|
+
font-style: italic;
|
|
15109
|
+
}
|
|
15110
|
+
|
|
15111
|
+
.profiler-request-container {
|
|
15112
|
+
margin-bottom: 20px;
|
|
15113
|
+
}
|
|
15114
|
+
|
|
15115
|
+
.profiler-request-header {
|
|
15116
|
+
display: flex;
|
|
15117
|
+
justify-content: space-between;
|
|
15118
|
+
align-items: center;
|
|
15119
|
+
margin-bottom: 5px;
|
|
15120
|
+
}
|
|
15121
|
+
|
|
15122
|
+
.profiler-copy-button {
|
|
15123
|
+
font-size: 12px;
|
|
15124
|
+
padding: 4px 8px;
|
|
15125
|
+
}
|
|
15126
|
+
|
|
15127
|
+
`, "",{"version":3,"sources":["webpack://./style/ProfilerPage.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;IACI,UAAU;AACd;;AAEA;IACI,aAAa;IACb,SAAS;IACT,mBAAmB;AACvB;;AAEA;IACI,gBAAgB;IAChB,aAAa;IACb,4CAA4C;AAChD;;AAEA;IACI,mBAAmB;AACvB;;AAEA;IACI,WAAW;IACX,kBAAkB;AACtB;;AAEA;IACI,mBAAmB;AACvB;;AAEA;IACI,aAAa;IACb,8BAA8B;IAC9B,mBAAmB;IACnB,kBAAkB;AACtB;;AAEA;IACI,eAAe;IACf,gBAAgB;AACpB","sourcesContent":["/*\n * Copyright (c) Saga Inc.\n * Distributed under the terms of the GNU Affero General Public License v3.0 License.\n */\n\n.profiler-warning {\n color: red;\n}\n\n.profiler-button-container {\n display: flex;\n gap: 10px;\n margin-bottom: 10px;\n}\n\n.json-container {\n overflow-y: auto;\n padding: 10px;\n background-color: var(--jp-input-background);\n}\n\n.profiler-clear-button {\n margin-bottom: 10px;\n}\n\n.profiler-no-requests {\n color: #666;\n font-style: italic;\n}\n\n.profiler-request-container {\n margin-bottom: 20px;\n}\n\n.profiler-request-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 5px;\n}\n\n.profiler-copy-button {\n font-size: 12px;\n padding: 4px 8px;\n}\n\n"],"sourceRoot":""}]);
|
|
15128
|
+
// Exports
|
|
15129
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
15130
|
+
|
|
15131
|
+
|
|
14872
15132
|
/***/ }),
|
|
14873
15133
|
|
|
14874
15134
|
/***/ "./node_modules/css-loader/dist/cjs.js!./style/PythonCode.css":
|
|
@@ -16946,6 +17206,60 @@ var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js
|
|
|
16946
17206
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_NotebookFooter_css__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_NotebookFooter_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_NotebookFooter_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);
|
|
16947
17207
|
|
|
16948
17208
|
|
|
17209
|
+
/***/ }),
|
|
17210
|
+
|
|
17211
|
+
/***/ "./style/ProfilerPage.css":
|
|
17212
|
+
/*!********************************!*\
|
|
17213
|
+
!*** ./style/ProfilerPage.css ***!
|
|
17214
|
+
\********************************/
|
|
17215
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
17216
|
+
|
|
17217
|
+
__webpack_require__.r(__webpack_exports__);
|
|
17218
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
17219
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
17220
|
+
/* harmony export */ });
|
|
17221
|
+
/* 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");
|
|
17222
|
+
/* 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__);
|
|
17223
|
+
/* 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");
|
|
17224
|
+
/* 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__);
|
|
17225
|
+
/* 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");
|
|
17226
|
+
/* 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__);
|
|
17227
|
+
/* 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");
|
|
17228
|
+
/* 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__);
|
|
17229
|
+
/* 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");
|
|
17230
|
+
/* 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__);
|
|
17231
|
+
/* 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");
|
|
17232
|
+
/* 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__);
|
|
17233
|
+
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ProfilerPage_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../node_modules/css-loader/dist/cjs.js!./ProfilerPage.css */ "./node_modules/css-loader/dist/cjs.js!./style/ProfilerPage.css");
|
|
17234
|
+
|
|
17235
|
+
|
|
17236
|
+
|
|
17237
|
+
|
|
17238
|
+
|
|
17239
|
+
|
|
17240
|
+
|
|
17241
|
+
|
|
17242
|
+
|
|
17243
|
+
|
|
17244
|
+
|
|
17245
|
+
var options = {};
|
|
17246
|
+
|
|
17247
|
+
options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
|
|
17248
|
+
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
|
|
17249
|
+
|
|
17250
|
+
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
|
|
17251
|
+
|
|
17252
|
+
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
|
|
17253
|
+
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());
|
|
17254
|
+
|
|
17255
|
+
var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ProfilerPage_css__WEBPACK_IMPORTED_MODULE_6__["default"], options);
|
|
17256
|
+
|
|
17257
|
+
|
|
17258
|
+
|
|
17259
|
+
|
|
17260
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ProfilerPage_css__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ProfilerPage_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ProfilerPage_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);
|
|
17261
|
+
|
|
17262
|
+
|
|
16949
17263
|
/***/ }),
|
|
16950
17264
|
|
|
16951
17265
|
/***/ "./style/PythonCode.css":
|
|
@@ -17435,4 +17749,4 @@ var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js
|
|
|
17435
17749
|
/***/ })
|
|
17436
17750
|
|
|
17437
17751
|
}]);
|
|
17438
|
-
//# sourceMappingURL=lib_index_js.
|
|
17752
|
+
//# sourceMappingURL=lib_index_js.81703ac2bc645e5c2fc2.js.map
|