mito-ai 0.1.38__py3-none-any.whl → 0.1.39__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/__init__.py +8 -0
- mito_ai/_version.py +1 -1
- mito_ai/app_builder/handlers.py +16 -11
- mito_ai/completions/handlers.py +1 -1
- mito_ai/completions/prompt_builders/agent_system_message.py +18 -45
- mito_ai/completions/prompt_builders/chat_name_prompt.py +6 -6
- mito_ai/openai_client.py +1 -1
- mito_ai/streamlit_conversion/agent_utils.py +116 -0
- mito_ai/streamlit_conversion/prompts/prompt_constants.py +59 -0
- mito_ai/streamlit_conversion/prompts/prompt_utils.py +10 -0
- mito_ai/streamlit_conversion/prompts/streamlit_app_creation_prompt.py +45 -0
- mito_ai/streamlit_conversion/prompts/streamlit_error_correction_prompt.py +28 -0
- mito_ai/streamlit_conversion/prompts/streamlit_finish_todo_prompt.py +44 -0
- mito_ai/streamlit_conversion/streamlit_agent_handler.py +72 -42
- mito_ai/streamlit_conversion/streamlit_system_prompt.py +19 -17
- mito_ai/streamlit_conversion/streamlit_utils.py +43 -5
- mito_ai/streamlit_conversion/validate_streamlit_app.py +116 -0
- mito_ai/streamlit_preview/handlers.py +7 -4
- mito_ai/tests/streamlit_conversion/test_streamlit_agent_handler.py +153 -66
- mito_ai/tests/streamlit_conversion/test_validate_streamlit_app.py +119 -0
- mito_ai/tests/utils/test_anthropic_utils.py +2 -2
- mito_ai/utils/anthropic_utils.py +4 -4
- mito_ai/utils/open_ai_utils.py +0 -4
- {mito_ai-0.1.38.data → mito_ai-0.1.39.data}/data/share/jupyter/labextensions/mito_ai/build_log.json +1 -1
- {mito_ai-0.1.38.data → mito_ai-0.1.39.data}/data/share/jupyter/labextensions/mito_ai/package.json +2 -2
- {mito_ai-0.1.38.data → mito_ai-0.1.39.data}/data/share/jupyter/labextensions/mito_ai/schemas/mito_ai/package.json.orig +1 -1
- mito_ai-0.1.38.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.5d1d7c234e2dc7c9d97b.js → mito_ai-0.1.39.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.16b532b655cd2906e04a.js +262 -65
- mito_ai-0.1.39.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.16b532b655cd2906e04a.js.map +1 -0
- mito_ai-0.1.38.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.bcce4ea34631acf6dbbe.js → mito_ai-0.1.39.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.606207904e6aaa42b1bf.js +3 -3
- mito_ai-0.1.38.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.bcce4ea34631acf6dbbe.js.map → mito_ai-0.1.39.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.606207904e6aaa42b1bf.js.map +1 -1
- {mito_ai-0.1.38.dist-info → mito_ai-0.1.39.dist-info}/METADATA +4 -1
- {mito_ai-0.1.38.dist-info → mito_ai-0.1.39.dist-info}/RECORD +44 -38
- mito_ai/streamlit_conversion/validate_and_run_streamlit_code.py +0 -208
- mito_ai/tests/streamlit_conversion/test_validate_and_run_streamlit_code.py +0 -418
- mito_ai-0.1.38.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.5d1d7c234e2dc7c9d97b.js.map +0 -1
- {mito_ai-0.1.38.data → mito_ai-0.1.39.data}/data/etc/jupyter/jupyter_server_config.d/mito_ai.json +0 -0
- {mito_ai-0.1.38.data → mito_ai-0.1.39.data}/data/share/jupyter/labextensions/mito_ai/schemas/mito_ai/toolbar-buttons.json +0 -0
- {mito_ai-0.1.38.data → mito_ai-0.1.39.data}/data/share/jupyter/labextensions/mito_ai/static/style.js +0 -0
- {mito_ai-0.1.38.data → mito_ai-0.1.39.data}/data/share/jupyter/labextensions/mito_ai/static/style_index_js.5876024bb17dbd6a3ee6.js +0 -0
- {mito_ai-0.1.38.data → mito_ai-0.1.39.data}/data/share/jupyter/labextensions/mito_ai/static/style_index_js.5876024bb17dbd6a3ee6.js.map +0 -0
- {mito_ai-0.1.38.data → mito_ai-0.1.39.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_semver_index_js.9795f79265ddb416864b.js +0 -0
- {mito_ai-0.1.38.data → mito_ai-0.1.39.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_semver_index_js.9795f79265ddb416864b.js.map +0 -0
- {mito_ai-0.1.38.data → mito_ai-0.1.39.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_vscode-diff_dist_index_js.ea55f1f9346638aafbcf.js +0 -0
- {mito_ai-0.1.38.data → mito_ai-0.1.39.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.38.dist-info → mito_ai-0.1.39.dist-info}/WHEEL +0 -0
- {mito_ai-0.1.38.dist-info → mito_ai-0.1.39.dist-info}/entry_points.txt +0 -0
- {mito_ai-0.1.38.dist-info → mito_ai-0.1.39.dist-info}/licenses/LICENSE +0 -0
|
@@ -278,8 +278,8 @@ class ChatHistoryManager {
|
|
|
278
278
|
});
|
|
279
279
|
}
|
|
280
280
|
deduplicateAssumptions(agentResponse) {
|
|
281
|
-
|
|
282
|
-
if (
|
|
281
|
+
// If there are no assumptions, return the original response
|
|
282
|
+
if ((agentResponse === null || agentResponse === void 0 ? void 0 : agentResponse.analysis_assumptions) === undefined || (agentResponse === null || agentResponse === void 0 ? void 0 : agentResponse.analysis_assumptions) === null) {
|
|
283
283
|
return agentResponse;
|
|
284
284
|
}
|
|
285
285
|
const newAssumptions = agentResponse.analysis_assumptions.filter(assumption => !this._allAssumptions.has(assumption));
|
|
@@ -906,14 +906,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
906
906
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
|
|
907
907
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
908
908
|
/* harmony import */ var _utils_classNames__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../utils/classNames */ "./lib/utils/classNames.js");
|
|
909
|
-
/* harmony import */ var
|
|
909
|
+
/* harmony import */ var _ChatDropdown__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./ChatDropdown */ "./lib/Extensions/AiChat/ChatMessage/ChatDropdown.js");
|
|
910
910
|
/* harmony import */ var _utils_notebook__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../utils/notebook */ "./lib/utils/notebook.js");
|
|
911
|
-
/* harmony import */ var _PythonCode__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./PythonCode */ "./lib/Extensions/AiChat/ChatMessage/PythonCode.js");
|
|
912
911
|
/* harmony import */ var _style_ChatInput_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../style/ChatInput.css */ "./style/ChatInput.css");
|
|
913
912
|
/* harmony import */ var _style_ChatDropdown_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../style/ChatDropdown.css */ "./style/ChatDropdown.css");
|
|
914
913
|
/* harmony import */ var _hooks_useDebouncedFunction__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../hooks/useDebouncedFunction */ "./lib/hooks/useDebouncedFunction.js");
|
|
915
|
-
/* harmony import */ var
|
|
916
|
-
/* harmony import */ var
|
|
914
|
+
/* harmony import */ var _components_SelectedContextContainer__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../components/SelectedContextContainer */ "./lib/components/SelectedContextContainer.js");
|
|
915
|
+
/* harmony import */ var _components_DatabaseButton__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../components/DatabaseButton */ "./lib/components/DatabaseButton.js");
|
|
917
916
|
/*
|
|
918
917
|
* Copyright (c) Saga Inc.
|
|
919
918
|
* Distributed under the terms of the GNU Affero General Public License v3.0 License.
|
|
@@ -927,14 +926,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
927
926
|
|
|
928
927
|
|
|
929
928
|
|
|
930
|
-
|
|
931
|
-
const ChatInput = ({ app, initialContent, placeholder, onSave, onCancel, isEditing, contextManager, notebookTracker, renderMimeRegistry, displayActiveCellCode = true, agentModeEnabled = false, agentExecutionStatus = 'idle', }) => {
|
|
929
|
+
const ChatInput = ({ app, initialContent, placeholder, onSave, onCancel, isEditing, contextManager, notebookTracker, agentModeEnabled = false, agentExecutionStatus = 'idle', }) => {
|
|
932
930
|
var _a;
|
|
933
931
|
const [input, setInput] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(initialContent);
|
|
934
932
|
const [expandedVariables, setExpandedVariables] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]);
|
|
935
933
|
const textAreaRef = react__WEBPACK_IMPORTED_MODULE_0___default().useRef(null);
|
|
936
|
-
const [isFocused, setIsFocused] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
|
|
937
934
|
const [activeCellID, setActiveCellID] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)((0,_utils_notebook__WEBPACK_IMPORTED_MODULE_3__.getActiveCellID)(notebookTracker));
|
|
935
|
+
const activeCellCode = (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_3__.getActiveCellCode)(notebookTracker) || '';
|
|
938
936
|
const [isDropdownVisible, setDropdownVisible] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
|
|
939
937
|
const [dropdownFilter, setDropdownFilter] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)('');
|
|
940
938
|
const [additionalContext, setAdditionalContext] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]);
|
|
@@ -1119,19 +1117,30 @@ const ChatInput = ({ app, initialContent, placeholder, onSave, onCancel, isEditi
|
|
|
1119
1117
|
];
|
|
1120
1118
|
setExpandedVariables(expandedVariables);
|
|
1121
1119
|
}, [contextManager === null || contextManager === void 0 ? void 0 : contextManager.variables, contextManager === null || contextManager === void 0 ? void 0 : contextManager.files]);
|
|
1122
|
-
//
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1120
|
+
// Automatically add active cell context when in Chat mode and there's active cell code
|
|
1121
|
+
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
1122
|
+
if (!agentModeEnabled) {
|
|
1123
|
+
// Check if active cell context is already present
|
|
1124
|
+
const hasActiveCellContext = additionalContext.some(context => context.type === 'active_cell');
|
|
1125
|
+
if (!hasActiveCellContext) {
|
|
1126
|
+
setAdditionalContext(prev => [...prev, {
|
|
1127
|
+
type: 'active_cell',
|
|
1128
|
+
value: 'Active Cell',
|
|
1129
|
+
display: 'Active Cell'
|
|
1130
|
+
}]);
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
else if (agentModeEnabled) {
|
|
1134
|
+
// Remove active cell context when in agent mode
|
|
1135
|
+
const hasActiveCellContext = additionalContext.some(context => context.type === 'active_cell');
|
|
1136
|
+
if (hasActiveCellContext) {
|
|
1137
|
+
setAdditionalContext(prev => prev.filter(context => context.type !== 'active_cell'));
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
}, [agentModeEnabled, additionalContext, activeCellCode]);
|
|
1141
|
+
return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: (0,_utils_classNames__WEBPACK_IMPORTED_MODULE_5__.classNames)("chat-input-container") },
|
|
1133
1142
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: 'context-container' },
|
|
1134
|
-
react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
|
|
1143
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_DatabaseButton__WEBPACK_IMPORTED_MODULE_6__["default"], { app: app }),
|
|
1135
1144
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { className: "context-button", onClick: () => {
|
|
1136
1145
|
var _a;
|
|
1137
1146
|
setDropdownVisible(true);
|
|
@@ -1139,7 +1148,7 @@ const ChatInput = ({ app, initialContent, placeholder, onSave, onCancel, isEditi
|
|
|
1139
1148
|
setIsDropdownFromButton(true);
|
|
1140
1149
|
(_a = textAreaRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
1141
1150
|
} }, "\uFF20 Add Context"),
|
|
1142
|
-
additionalContext.map((context, index) => (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
|
|
1151
|
+
additionalContext.map((context, index) => (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_SelectedContextContainer__WEBPACK_IMPORTED_MODULE_7__["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)), notebookTracker: notebookTracker, activeCellID: activeCellID })))),
|
|
1143
1152
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: 'chat-input-text-area-container' },
|
|
1144
1153
|
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, disabled: agentExecutionStatus === 'working' || agentExecutionStatus === 'stopping', onChange: handleInputChange, onKeyDown: (e) => {
|
|
1145
1154
|
// If dropdown is visible, only handle escape to close it
|
|
@@ -1159,7 +1168,6 @@ const ChatInput = ({ app, initialContent, placeholder, onSave, onCancel, isEditi
|
|
|
1159
1168
|
// Reset
|
|
1160
1169
|
setInput('');
|
|
1161
1170
|
setAdditionalContext([]);
|
|
1162
|
-
setIsFocused(false);
|
|
1163
1171
|
}
|
|
1164
1172
|
// Escape key cancels editing
|
|
1165
1173
|
if (e.key === 'Escape') {
|
|
@@ -1169,7 +1177,7 @@ const ChatInput = ({ app, initialContent, placeholder, onSave, onCancel, isEditi
|
|
|
1169
1177
|
}
|
|
1170
1178
|
}
|
|
1171
1179
|
} }),
|
|
1172
|
-
isDropdownVisible && (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
|
|
1180
|
+
isDropdownVisible && (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_ChatDropdown__WEBPACK_IMPORTED_MODULE_8__["default"], { options: expandedVariables, onSelect: handleOptionSelect, filterText: dropdownFilter, isDropdownFromButton: isDropdownFromButton, onFilterChange: setDropdownFilter, onClose: handleDropdownClose }))),
|
|
1173
1181
|
isEditing &&
|
|
1174
1182
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "message-edit-buttons" },
|
|
1175
1183
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { onClick: () => onSave(input, undefined, mapAdditionalContext()) }, "Save"),
|
|
@@ -1263,7 +1271,7 @@ const ChatMessage = ({ app, message, promptType, agentResponse, messageIndex, mi
|
|
|
1263
1271
|
setNextSteps(agentResponse.next_steps);
|
|
1264
1272
|
}
|
|
1265
1273
|
if (isEditing) {
|
|
1266
|
-
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,
|
|
1274
|
+
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, agentModeEnabled: false }));
|
|
1267
1275
|
}
|
|
1268
1276
|
if (mitoAIConnectionError) {
|
|
1269
1277
|
return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: (0,_utils_classNames__WEBPACK_IMPORTED_MODULE_5__.classNames)("message") },
|
|
@@ -1296,7 +1304,9 @@ const ChatMessage = ({ app, message, promptType, agentResponse, messageIndex, mi
|
|
|
1296
1304
|
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' }),
|
|
1297
1305
|
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' })),
|
|
1298
1306
|
message.role === 'user' && additionalContext && additionalContext.length > 0 &&
|
|
1299
|
-
react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, additionalContext
|
|
1307
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, additionalContext
|
|
1308
|
+
.filter(context => context.type !== 'active_cell') // Hide active cell context in chat messages
|
|
1309
|
+
.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.value}`, type: context.type, onRemove: () => { } }))))));
|
|
1300
1310
|
}
|
|
1301
1311
|
else {
|
|
1302
1312
|
// Return null for empty code blocks
|
|
@@ -2601,7 +2611,7 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
|
|
|
2601
2611
|
break;
|
|
2602
2612
|
}
|
|
2603
2613
|
}
|
|
2604
|
-
if (agentResponse.type === 'get_cell_output') {
|
|
2614
|
+
if (agentResponse.type === 'get_cell_output' && agentResponse.get_cell_output_cell_id !== null && agentResponse.get_cell_output_cell_id !== undefined) {
|
|
2605
2615
|
// Mark that we should send the cell output to the agent
|
|
2606
2616
|
// in the next loop iteration
|
|
2607
2617
|
sendCellIDOutput = agentResponse.get_cell_output_cell_id;
|
|
@@ -2946,7 +2956,7 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
|
|
|
2946
2956
|
agentExecutionStatus === 'stopping' ? 'Agent is stopping...' :
|
|
2947
2957
|
agentModeEnabled ? 'Ask agent to do anything' :
|
|
2948
2958
|
displayOptimizedChatHistory.length < 2 ? `Ask question (${operatingSystem === 'mac' ? '⌘' : 'Ctrl'}E), @ to mention`
|
|
2949
|
-
: `Ask followup (${operatingSystem === 'mac' ? '⌘' : 'Ctrl'}E), @ to mention`, onSave: agentModeEnabled ? startAgentExecution : sendChatInputMessage, onCancel: undefined, isEditing: false, contextManager: contextManager, notebookTracker: notebookTracker,
|
|
2959
|
+
: `Ask followup (${operatingSystem === 'mac' ? '⌘' : 'Ctrl'}E), @ to mention`, onSave: agentModeEnabled ? startAgentExecution : sendChatInputMessage, onCancel: undefined, isEditing: false, contextManager: contextManager, notebookTracker: notebookTracker, agentModeEnabled: agentModeEnabled, agentExecutionStatus: agentExecutionStatus })),
|
|
2950
2960
|
agentExecutionStatus !== 'working' && agentExecutionStatus !== 'stopping' && (react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: "chat-controls" },
|
|
2951
2961
|
react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: "chat-controls-left" },
|
|
2952
2962
|
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_ToggleButton__WEBPACK_IMPORTED_MODULE_37__["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) => {
|
|
@@ -3501,12 +3511,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3501
3511
|
/* harmony export */ });
|
|
3502
3512
|
/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/coreutils */ "webpack/sharing/consume/default/@jupyterlab/coreutils");
|
|
3503
3513
|
/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0__);
|
|
3504
|
-
/* harmony import */ var
|
|
3505
|
-
/* harmony import */ var
|
|
3506
|
-
/* harmony import */ var
|
|
3507
|
-
/* harmony import */ var
|
|
3508
|
-
/* harmony import */ var
|
|
3509
|
-
/* harmony import */ var
|
|
3514
|
+
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/apputils */ "webpack/sharing/consume/default/@jupyterlab/apputils");
|
|
3515
|
+
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__);
|
|
3516
|
+
/* harmony import */ var _requirementsUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./requirementsUtils */ "./lib/Extensions/AppBuilder/requirementsUtils.js");
|
|
3517
|
+
/* harmony import */ var _fileUtils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./fileUtils */ "./lib/Extensions/AppBuilder/fileUtils.js");
|
|
3518
|
+
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @lumino/coreutils */ "webpack/sharing/consume/default/@lumino/coreutils");
|
|
3519
|
+
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_2__);
|
|
3520
|
+
/* harmony import */ var _DeployAppNotification__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./DeployAppNotification */ "./lib/Extensions/AppBuilder/DeployAppNotification.js");
|
|
3521
|
+
/* harmony import */ var _auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./auth */ "./lib/Extensions/AppBuilder/auth.js");
|
|
3510
3522
|
/*
|
|
3511
3523
|
* Copyright (c) Saga Inc.
|
|
3512
3524
|
* Distributed under the terms of the GNU Affero General Public License v3.0 License.
|
|
@@ -3517,12 +3529,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3517
3529
|
|
|
3518
3530
|
|
|
3519
3531
|
|
|
3532
|
+
|
|
3520
3533
|
/*
|
|
3521
3534
|
This function generates a requirements.txt file that lists the dependencies for the streamlit app
|
|
3522
3535
|
*/
|
|
3523
3536
|
const convertNotebookToStreamlit = async (notebookTracker, appBuilderService) => {
|
|
3524
3537
|
// Check authentication before proceeding with deployment
|
|
3525
|
-
const isAuthenticated = await (0,
|
|
3538
|
+
const isAuthenticated = await (0,_auth__WEBPACK_IMPORTED_MODULE_3__.checkAuthenticationAndRedirect)();
|
|
3526
3539
|
if (!isAuthenticated) {
|
|
3527
3540
|
console.log('User not authenticated, redirected to signup');
|
|
3528
3541
|
return;
|
|
@@ -3539,24 +3552,31 @@ const convertNotebookToStreamlit = async (notebookTracker, appBuilderService) =>
|
|
|
3539
3552
|
console.log('Current working directory info:', notebookPanel.context);
|
|
3540
3553
|
// Build the requirements.txt file
|
|
3541
3554
|
console.debug("Building requirements.txt file");
|
|
3542
|
-
const requirementsContent = await (0,
|
|
3555
|
+
const requirementsContent = await (0,_requirementsUtils__WEBPACK_IMPORTED_MODULE_4__.generateRequirementsTxt)(notebookTracker);
|
|
3543
3556
|
// Save the files to the current directory
|
|
3544
|
-
await (0,
|
|
3557
|
+
await (0,_fileUtils__WEBPACK_IMPORTED_MODULE_5__.saveFileWithKernel)(notebookTracker, './requirements.txt', requirementsContent);
|
|
3545
3558
|
// After building the files, we need to send a request to the backend to deploy the app
|
|
3546
3559
|
if (appBuilderService) {
|
|
3547
3560
|
try {
|
|
3548
3561
|
console.log("Sending request to deploy the app");
|
|
3549
3562
|
// Get JWT token for authentication
|
|
3550
|
-
const jwtToken = (0,
|
|
3563
|
+
const jwtToken = (0,_auth__WEBPACK_IMPORTED_MODULE_3__.getJWTToken)();
|
|
3551
3564
|
const response = await appBuilderService.client.sendMessage({
|
|
3552
3565
|
type: 'build-app',
|
|
3553
|
-
message_id:
|
|
3566
|
+
message_id: _lumino_coreutils__WEBPACK_IMPORTED_MODULE_2__.UUID.uuid4(),
|
|
3554
3567
|
notebook_path: notebookPath,
|
|
3555
3568
|
jwt_token: jwtToken || appBuilderService.client.serverSettings.token
|
|
3556
3569
|
});
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3570
|
+
if (response.error) {
|
|
3571
|
+
_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Notification.emit(response.error.title, 'error', {
|
|
3572
|
+
autoClose: false
|
|
3573
|
+
});
|
|
3574
|
+
}
|
|
3575
|
+
else {
|
|
3576
|
+
console.log("App deployment response:", response);
|
|
3577
|
+
const url = response.url;
|
|
3578
|
+
(0,_DeployAppNotification__WEBPACK_IMPORTED_MODULE_6__.deployAppNotification)(url);
|
|
3579
|
+
}
|
|
3560
3580
|
}
|
|
3561
3581
|
catch (error) {
|
|
3562
3582
|
// TODO: Do something with the error
|
|
@@ -3600,11 +3620,23 @@ const client_id = '6ara3u3l8sss738hrhbq1qtiqf';
|
|
|
3600
3620
|
// Change this to domain_dev for dev deployments
|
|
3601
3621
|
const active_domain = domain_dev;
|
|
3602
3622
|
const currentUrl = window.location.href;
|
|
3623
|
+
let redirectUrl;
|
|
3624
|
+
// As of now we only support localhost:8888 because we have only allowed this redirect url on AWS conito
|
|
3625
|
+
// We can modify the redirect to include other ports in the future
|
|
3626
|
+
if (currentUrl.includes('localhost')) {
|
|
3627
|
+
redirectUrl = 'http://localhost:8888/lab';
|
|
3628
|
+
}
|
|
3629
|
+
else if (currentUrl.includes('trymito')) {
|
|
3630
|
+
redirectUrl = 'https://launch.trymito.io';
|
|
3631
|
+
}
|
|
3632
|
+
else {
|
|
3633
|
+
redirectUrl = currentUrl;
|
|
3634
|
+
}
|
|
3603
3635
|
console.log("currentUrl: ", currentUrl);
|
|
3604
3636
|
// AWS Cognito configuration
|
|
3605
3637
|
const COGNITO_CONFIG = {
|
|
3606
|
-
SIGNUP_URL: `${active_domain}/signup?client_id=${client_id}&response_type=code&scope=email+openid+profile&redirect_uri=${
|
|
3607
|
-
SIGNIN_URL: `${active_domain}/login?client_id=${client_id}&response_type=code&scope=email+openid+profile&redirect_uri=${
|
|
3638
|
+
SIGNUP_URL: `${active_domain}/signup?client_id=${client_id}&response_type=code&scope=email+openid+profile&redirect_uri=${redirectUrl}`,
|
|
3639
|
+
SIGNIN_URL: `${active_domain}/login?client_id=${client_id}&response_type=code&scope=email+openid+profile&redirect_uri=${redirectUrl}`,
|
|
3608
3640
|
JWT_COOKIE_NAME: 'mito-auth-token',
|
|
3609
3641
|
JWT_COOKIE_EXPIRY_HOURS: 1
|
|
3610
3642
|
};
|
|
@@ -4986,13 +5018,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
4986
5018
|
/* harmony export */ });
|
|
4987
5019
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
|
|
4988
5020
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
4989
|
-
/* harmony import */ var
|
|
5021
|
+
/* harmony import */ var _model__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./model */ "./lib/Extensions/SettingsManager/database/model.js");
|
|
5022
|
+
/* harmony import */ var _GettingStartedVideo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./GettingStartedVideo */ "./lib/Extensions/SettingsManager/database/GettingStartedVideo.js");
|
|
4990
5023
|
/*
|
|
4991
5024
|
* Copyright (c) Saga Inc.
|
|
4992
5025
|
* Distributed under the terms of the GNU Affero General Public License v3.0 License.
|
|
4993
5026
|
*/
|
|
4994
5027
|
|
|
4995
5028
|
|
|
5029
|
+
|
|
4996
5030
|
const ConnectionList = ({ connections, loading, error, onDelete }) => {
|
|
4997
5031
|
const [clickedDelete, setClickedDelete] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
|
|
4998
5032
|
if (loading) {
|
|
@@ -5004,7 +5038,10 @@ const ConnectionList = ({ connections, loading, error, onDelete }) => {
|
|
|
5004
5038
|
error);
|
|
5005
5039
|
}
|
|
5006
5040
|
if (Object.keys(connections).length === 0) {
|
|
5007
|
-
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement("
|
|
5041
|
+
return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "no-connections-container" },
|
|
5042
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", null, "No database connections found."),
|
|
5043
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "video-tutorial" },
|
|
5044
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_GettingStartedVideo__WEBPACK_IMPORTED_MODULE_1__.GettingStartedVideo, { width: "560", height: "315" }))));
|
|
5008
5045
|
}
|
|
5009
5046
|
return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "connections-grid" }, Object.entries(connections).map(([id, connection]) => {
|
|
5010
5047
|
var _a;
|
|
@@ -5013,7 +5050,7 @@ const ConnectionList = ({ connections, loading, error, onDelete }) => {
|
|
|
5013
5050
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("h3", { className: "connection-alias" }, connection.alias ? connection.alias : connection.database),
|
|
5014
5051
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: "connection-type" }, connection.type.toUpperCase())),
|
|
5015
5052
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "connection-divider" }),
|
|
5016
|
-
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "connection-details" }, (_a =
|
|
5053
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "connection-details" }, (_a = _model__WEBPACK_IMPORTED_MODULE_2__.databaseConfigs[connection.type]) === null || _a === void 0 ? void 0 : _a.fields.map(field => {
|
|
5017
5054
|
// Skip specific fields
|
|
5018
5055
|
if (field.type === 'password')
|
|
5019
5056
|
return null;
|
|
@@ -5053,6 +5090,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5053
5090
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
5054
5091
|
/* harmony import */ var _ConnectionList__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ConnectionList */ "./lib/Extensions/SettingsManager/database/ConnectionList.js");
|
|
5055
5092
|
/* harmony import */ var _ConnectionForm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ConnectionForm */ "./lib/Extensions/SettingsManager/database/ConnectionForm.js");
|
|
5093
|
+
/* harmony import */ var _GettingStartedVideo__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./GettingStartedVideo */ "./lib/Extensions/SettingsManager/database/GettingStartedVideo.js");
|
|
5056
5094
|
/* harmony import */ var _restAPI_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../restAPI/utils */ "./lib/restAPI/utils.js");
|
|
5057
5095
|
/* harmony import */ var _style_DatabasePage_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../style/DatabasePage.css */ "./style/DatabasePage.css");
|
|
5058
5096
|
/*
|
|
@@ -5064,11 +5102,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5064
5102
|
|
|
5065
5103
|
|
|
5066
5104
|
|
|
5105
|
+
|
|
5067
5106
|
const DatabasePage = () => {
|
|
5068
5107
|
const [connections, setConnections] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({});
|
|
5069
5108
|
const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true);
|
|
5070
5109
|
const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
|
|
5071
5110
|
const [showModal, setShowModal] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
|
|
5111
|
+
const [showVideoModal, setShowVideoModal] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
|
|
5072
5112
|
const [formData, setFormData] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({
|
|
5073
5113
|
type: 'snowflake',
|
|
5074
5114
|
username: '',
|
|
@@ -5141,15 +5181,54 @@ const DatabasePage = () => {
|
|
|
5141
5181
|
return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "db-connections" },
|
|
5142
5182
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "settings-header" },
|
|
5143
5183
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("h2", null, "Database Connections"),
|
|
5144
|
-
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("
|
|
5145
|
-
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("
|
|
5184
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "header-buttons" },
|
|
5185
|
+
Object.keys(connections).length > 0 && (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { className: "button-base button-gray", onClick: () => setShowVideoModal(true) },
|
|
5186
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("b", null, "Getting Started"))),
|
|
5187
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { className: "button-base button-purple", onClick: () => setShowModal(true) },
|
|
5188
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("b", null, "\uFF0B Add Connection")))),
|
|
5146
5189
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_ConnectionList__WEBPACK_IMPORTED_MODULE_3__.ConnectionList, { connections: connections, loading: loading, error: error, onDelete: handleDelete }),
|
|
5147
5190
|
showModal && (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "modal-overlay", onClick: () => setShowModal(false) },
|
|
5148
5191
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "modal-content", onClick: e => e.stopPropagation() },
|
|
5149
5192
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "modal-header" },
|
|
5150
5193
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("h3", null, "Add New Connection"),
|
|
5151
5194
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { className: "modal-close-button", onClick: () => setShowModal(false) }, "\u2715")),
|
|
5152
|
-
react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_ConnectionForm__WEBPACK_IMPORTED_MODULE_4__.ConnectionForm, { formData: formData, formError: formError, onInputChange: handleInputChange, onSubmit: handleSubmit, onClose: () => setShowModal(false) }))))
|
|
5195
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_ConnectionForm__WEBPACK_IMPORTED_MODULE_4__.ConnectionForm, { formData: formData, formError: formError, onInputChange: handleInputChange, onSubmit: handleSubmit, onClose: () => setShowModal(false) })))),
|
|
5196
|
+
showVideoModal && (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "modal-overlay", onClick: () => setShowVideoModal(false) },
|
|
5197
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "modal-content video-modal", onClick: e => e.stopPropagation() },
|
|
5198
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "modal-header" },
|
|
5199
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("h3", null, "Getting Started"),
|
|
5200
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { className: "modal-close-button", onClick: () => setShowVideoModal(false) }, "\u2715")),
|
|
5201
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_GettingStartedVideo__WEBPACK_IMPORTED_MODULE_5__.GettingStartedVideo, null),
|
|
5202
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "video-description" },
|
|
5203
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", null,
|
|
5204
|
+
"Still have questions? Check out our ",
|
|
5205
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", { href: "https://docs.trymito.io/mito-ai/database-connectors", target: "_blank", rel: "noopener noreferrer" }, "documentation"),
|
|
5206
|
+
" for more information.")))))));
|
|
5207
|
+
};
|
|
5208
|
+
|
|
5209
|
+
|
|
5210
|
+
/***/ }),
|
|
5211
|
+
|
|
5212
|
+
/***/ "./lib/Extensions/SettingsManager/database/GettingStartedVideo.js":
|
|
5213
|
+
/*!************************************************************************!*\
|
|
5214
|
+
!*** ./lib/Extensions/SettingsManager/database/GettingStartedVideo.js ***!
|
|
5215
|
+
\************************************************************************/
|
|
5216
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
5217
|
+
|
|
5218
|
+
__webpack_require__.r(__webpack_exports__);
|
|
5219
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5220
|
+
/* harmony export */ GettingStartedVideo: () => (/* binding */ GettingStartedVideo)
|
|
5221
|
+
/* harmony export */ });
|
|
5222
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
|
|
5223
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
5224
|
+
/*
|
|
5225
|
+
* Copyright (c) Saga Inc.
|
|
5226
|
+
* Distributed under the terms of the GNU Affero General Public License v3.0 License.
|
|
5227
|
+
*/
|
|
5228
|
+
|
|
5229
|
+
const GettingStartedVideo = ({ width = "100%", height = "400", className = "" }) => {
|
|
5230
|
+
return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: `video-container ${className}` },
|
|
5231
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("iframe", { width: width, height: height, src: "https://www.youtube.com/embed/sJgphOrmZb4?rel=0", title: "How to connect to your database with Mito", frameBorder: "0", allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture", allowFullScreen: true })));
|
|
5153
5232
|
};
|
|
5154
5233
|
|
|
5155
5234
|
|
|
@@ -6873,7 +6952,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6873
6952
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
|
|
6874
6953
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
6875
6954
|
/* harmony import */ var _style_ModelSelector_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../style/ModelSelector.css */ "./style/ModelSelector.css");
|
|
6876
|
-
/* harmony import */ var
|
|
6955
|
+
/* harmony import */ var _icons_NucleausIcon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../icons/NucleausIcon */ "./lib/icons/NucleausIcon.js");
|
|
6956
|
+
/* harmony import */ var _utils_models__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/models */ "./lib/utils/models.js");
|
|
6877
6957
|
/*
|
|
6878
6958
|
* Copyright (c) Saga Inc.
|
|
6879
6959
|
* Distributed under the terms of the GNU Affero General Public License v3.0 License.
|
|
@@ -6881,15 +6961,17 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6881
6961
|
|
|
6882
6962
|
|
|
6883
6963
|
|
|
6964
|
+
|
|
6884
6965
|
const MODEL_MAPPINGS = [
|
|
6966
|
+
{ displayName: _utils_models__WEBPACK_IMPORTED_MODULE_2__.GPT_DISPLAY_NAME, fullName: _utils_models__WEBPACK_IMPORTED_MODULE_2__.GPT_MODEL_NAME },
|
|
6885
6967
|
{ displayName: 'GPT 4.1', fullName: 'gpt-4.1' },
|
|
6886
|
-
{ displayName:
|
|
6887
|
-
{ displayName:
|
|
6968
|
+
{ displayName: _utils_models__WEBPACK_IMPORTED_MODULE_2__.CLAUDE_OPUS_DISPLAY_NAME, fullName: _utils_models__WEBPACK_IMPORTED_MODULE_2__.CLAUDE_OPUS_MODEL_NAME },
|
|
6969
|
+
{ displayName: _utils_models__WEBPACK_IMPORTED_MODULE_2__.CLAUDE_SONNET_DISPLAY_NAME, fullName: _utils_models__WEBPACK_IMPORTED_MODULE_2__.CLAUDE_SONNET_MODEL_NAME },
|
|
6888
6970
|
{ displayName: 'Gemini 2.5 Pro', fullName: 'gemini-2.5-pro-preview-03-25' }
|
|
6889
6971
|
];
|
|
6890
6972
|
const ALL_MODEL_DISPLAY_NAMES = MODEL_MAPPINGS.map(mapping => mapping.displayName);
|
|
6891
6973
|
// Maximum length for displayed model name before truncating
|
|
6892
|
-
const DEFAULT_MODEL =
|
|
6974
|
+
const DEFAULT_MODEL = _utils_models__WEBPACK_IMPORTED_MODULE_2__.CLAUDE_SONNET_DISPLAY_NAME;
|
|
6893
6975
|
const ModelSelector = ({ onConfigChange }) => {
|
|
6894
6976
|
const [selectedModel, setSelectedModel] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(DEFAULT_MODEL);
|
|
6895
6977
|
const [isOpen, setIsOpen] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
|
|
@@ -6949,7 +7031,7 @@ const ModelSelector = ({ onConfigChange }) => {
|
|
|
6949
7031
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: `model-selector-dropdown`, onClick: () => setIsOpen(!isOpen), title: selectedModel, "data-testid": "model-selector" },
|
|
6950
7032
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "selected-model" },
|
|
6951
7033
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: "model-icon" },
|
|
6952
|
-
react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
|
|
7034
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_icons_NucleausIcon__WEBPACK_IMPORTED_MODULE_3__["default"], { height: 10, width: 10 })),
|
|
6953
7035
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: "model-name" }, selectedModel),
|
|
6954
7036
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: "dropdown-arrow" }, "\u25BC")),
|
|
6955
7037
|
isOpen && (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: `model-options dropup`, style: { minWidth: '150px' } }, ALL_MODEL_DISPLAY_NAMES.map(model => (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { key: model, className: `model-option ${model === selectedModel ? 'selected' : ''}`, onClick: (e) => {
|
|
@@ -7043,6 +7125,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7043
7125
|
/* harmony import */ var _icons_RuleIcon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../icons/RuleIcon */ "./lib/icons/RuleIcon.js");
|
|
7044
7126
|
/* harmony import */ var _icons_CodeIcon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../icons/CodeIcon */ "./lib/icons/CodeIcon.js");
|
|
7045
7127
|
/* harmony import */ var _icons_DatabaseIcon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../icons/DatabaseIcon */ "./lib/icons/DatabaseIcon.js");
|
|
7128
|
+
/* harmony import */ var _utils_notebook__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/notebook */ "./lib/utils/notebook.js");
|
|
7046
7129
|
/*
|
|
7047
7130
|
* Copyright (c) Saga Inc.
|
|
7048
7131
|
* Distributed under the terms of the GNU Affero General Public License v3.0 License.
|
|
@@ -7052,7 +7135,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7052
7135
|
|
|
7053
7136
|
|
|
7054
7137
|
|
|
7055
|
-
|
|
7138
|
+
|
|
7139
|
+
const SelectedContextContainer = ({ title, type, onRemove, onClick, notebookTracker, activeCellID }) => {
|
|
7056
7140
|
const [isHovered, setIsHovered] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
|
|
7057
7141
|
let icon = react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_icons_RuleIcon__WEBPACK_IMPORTED_MODULE_2__["default"], null);
|
|
7058
7142
|
switch (type) {
|
|
@@ -7065,9 +7149,38 @@ const SelectedContextContainer = ({ title, type, onRemove }) => {
|
|
|
7065
7149
|
case 'db':
|
|
7066
7150
|
icon = react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_icons_DatabaseIcon__WEBPACK_IMPORTED_MODULE_4__["default"], null);
|
|
7067
7151
|
break;
|
|
7152
|
+
case 'active_cell':
|
|
7153
|
+
icon = react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_icons_CodeIcon__WEBPACK_IMPORTED_MODULE_3__["default"], null);
|
|
7154
|
+
break;
|
|
7068
7155
|
}
|
|
7069
|
-
|
|
7070
|
-
|
|
7156
|
+
const handleClick = () => {
|
|
7157
|
+
var _a;
|
|
7158
|
+
if (type === 'active_cell') {
|
|
7159
|
+
// Handle active cell context click
|
|
7160
|
+
if (notebookTracker && activeCellID) {
|
|
7161
|
+
// Find the cell
|
|
7162
|
+
const cell = (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_5__.getCellByID)(notebookTracker, activeCellID);
|
|
7163
|
+
if (cell) {
|
|
7164
|
+
// Scroll to the cell
|
|
7165
|
+
void ((_a = notebookTracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content.scrollToCell(cell, 'center'));
|
|
7166
|
+
// Highlight the cell
|
|
7167
|
+
setTimeout(() => {
|
|
7168
|
+
(0,_utils_notebook__WEBPACK_IMPORTED_MODULE_5__.highlightCodeCell)(notebookTracker, activeCellID);
|
|
7169
|
+
}, 500);
|
|
7170
|
+
}
|
|
7171
|
+
}
|
|
7172
|
+
// If notebookTracker or activeCellID are not available, do nothing
|
|
7173
|
+
}
|
|
7174
|
+
else if (onClick) {
|
|
7175
|
+
// Call the custom onClick handler for other context types
|
|
7176
|
+
onClick();
|
|
7177
|
+
}
|
|
7178
|
+
};
|
|
7179
|
+
return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { className: "selected-context-container", onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), onClick: handleClick, "data-testid": "selected-context-container" },
|
|
7180
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: `icon`, onClick: (e) => {
|
|
7181
|
+
e.stopPropagation(); // Prevent triggering the button's onClick
|
|
7182
|
+
onRemove();
|
|
7183
|
+
}, title: isHovered ? "Remove rule" : "Selected rule" }, isHovered && type !== 'active_cell' ? (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: "remove-icon" }, "X")) : (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: "icon" }, icon))),
|
|
7071
7184
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: "rule-name" }, title)));
|
|
7072
7185
|
};
|
|
7073
7186
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SelectedContextContainer);
|
|
@@ -8730,6 +8843,35 @@ const stripFileEnding = (rule) => {
|
|
|
8730
8843
|
};
|
|
8731
8844
|
|
|
8732
8845
|
|
|
8846
|
+
/***/ }),
|
|
8847
|
+
|
|
8848
|
+
/***/ "./lib/utils/models.js":
|
|
8849
|
+
/*!*****************************!*\
|
|
8850
|
+
!*** ./lib/utils/models.js ***!
|
|
8851
|
+
\*****************************/
|
|
8852
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
8853
|
+
|
|
8854
|
+
__webpack_require__.r(__webpack_exports__);
|
|
8855
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
8856
|
+
/* harmony export */ CLAUDE_OPUS_DISPLAY_NAME: () => (/* binding */ CLAUDE_OPUS_DISPLAY_NAME),
|
|
8857
|
+
/* harmony export */ CLAUDE_OPUS_MODEL_NAME: () => (/* binding */ CLAUDE_OPUS_MODEL_NAME),
|
|
8858
|
+
/* harmony export */ CLAUDE_SONNET_DISPLAY_NAME: () => (/* binding */ CLAUDE_SONNET_DISPLAY_NAME),
|
|
8859
|
+
/* harmony export */ CLAUDE_SONNET_MODEL_NAME: () => (/* binding */ CLAUDE_SONNET_MODEL_NAME),
|
|
8860
|
+
/* harmony export */ GPT_DISPLAY_NAME: () => (/* binding */ GPT_DISPLAY_NAME),
|
|
8861
|
+
/* harmony export */ GPT_MODEL_NAME: () => (/* binding */ GPT_MODEL_NAME)
|
|
8862
|
+
/* harmony export */ });
|
|
8863
|
+
/*
|
|
8864
|
+
* Copyright (c) Saga Inc.
|
|
8865
|
+
* Distributed under the terms of the GNU Affero General Public License v3.0 License.
|
|
8866
|
+
*/
|
|
8867
|
+
const CLAUDE_OPUS_DISPLAY_NAME = 'Claude 4.1 Opus';
|
|
8868
|
+
const CLAUDE_OPUS_MODEL_NAME = 'claude-opus-4-1-20250805';
|
|
8869
|
+
const CLAUDE_SONNET_DISPLAY_NAME = 'Claude 4 Sonnet';
|
|
8870
|
+
const CLAUDE_SONNET_MODEL_NAME = 'claude-sonnet-4-20250514';
|
|
8871
|
+
const GPT_DISPLAY_NAME = 'GPT 5 (max)';
|
|
8872
|
+
const GPT_MODEL_NAME = 'gpt-5';
|
|
8873
|
+
|
|
8874
|
+
|
|
8733
8875
|
/***/ }),
|
|
8734
8876
|
|
|
8735
8877
|
/***/ "./lib/utils/notebook.js":
|
|
@@ -11530,6 +11672,28 @@ ___CSS_LOADER_EXPORT___.push([module.id, `/*
|
|
|
11530
11672
|
* Distributed under the terms of the GNU Affero General Public License v3.0 License.
|
|
11531
11673
|
*/
|
|
11532
11674
|
|
|
11675
|
+
.settings-header {
|
|
11676
|
+
display: flex;
|
|
11677
|
+
justify-content: space-between;
|
|
11678
|
+
align-items: center;
|
|
11679
|
+
margin-bottom: 20px;
|
|
11680
|
+
}
|
|
11681
|
+
|
|
11682
|
+
.header-buttons {
|
|
11683
|
+
display: flex;
|
|
11684
|
+
gap: 12px;
|
|
11685
|
+
align-items: center;
|
|
11686
|
+
}
|
|
11687
|
+
|
|
11688
|
+
.header-buttons .button-base {
|
|
11689
|
+
min-width: 120px;
|
|
11690
|
+
height: 32px;
|
|
11691
|
+
display: flex;
|
|
11692
|
+
align-items: center;
|
|
11693
|
+
justify-content: center;
|
|
11694
|
+
padding: 8px 16px;
|
|
11695
|
+
}
|
|
11696
|
+
|
|
11533
11697
|
.connections-grid {
|
|
11534
11698
|
display: grid;
|
|
11535
11699
|
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
|
|
@@ -11620,7 +11784,39 @@ ___CSS_LOADER_EXPORT___.push([module.id, `/*
|
|
|
11620
11784
|
.confirmation-buttons {
|
|
11621
11785
|
display: flex;
|
|
11622
11786
|
gap: 8px;
|
|
11623
|
-
}
|
|
11787
|
+
}
|
|
11788
|
+
|
|
11789
|
+
/* No connections container styles */
|
|
11790
|
+
.no-connections-container {
|
|
11791
|
+
display: flex;
|
|
11792
|
+
flex-direction: column;
|
|
11793
|
+
align-items: center;
|
|
11794
|
+
justify-content: center;
|
|
11795
|
+
min-height: 400px;
|
|
11796
|
+
text-align: center;
|
|
11797
|
+
padding: 40px 20px;
|
|
11798
|
+
}
|
|
11799
|
+
|
|
11800
|
+
.no-connections-container p {
|
|
11801
|
+
font-size: 1.1em;
|
|
11802
|
+
color: var(--jp-ui-font-color2);
|
|
11803
|
+
margin-bottom: 32px;
|
|
11804
|
+
margin-top: 0;
|
|
11805
|
+
}
|
|
11806
|
+
|
|
11807
|
+
.video-tutorial {
|
|
11808
|
+
border-radius: 8px;
|
|
11809
|
+
display: block;
|
|
11810
|
+
border: 1px solid var(--purple-500);
|
|
11811
|
+
border-radius: 12px;
|
|
11812
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
|
|
11813
|
+
padding: 12px;
|
|
11814
|
+
}
|
|
11815
|
+
|
|
11816
|
+
.video-container iframe {
|
|
11817
|
+
border-radius: 8px;
|
|
11818
|
+
display: block;
|
|
11819
|
+
} `, "",{"version":3,"sources":["webpack://./style/DatabasePage.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;IACI,aAAa;IACb,8BAA8B;IAC9B,mBAAmB;IACnB,mBAAmB;AACvB;;AAEA;IACI,aAAa;IACb,SAAS;IACT,mBAAmB;AACvB;;AAEA;IACI,gBAAgB;IAChB,YAAY;IACZ,aAAa;IACb,mBAAmB;IACnB,uBAAuB;IACvB,iBAAiB;AACrB;;AAEA;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;;AAEA,oCAAoC;AACpC;IACI,aAAa;IACb,sBAAsB;IACtB,mBAAmB;IACnB,uBAAuB;IACvB,iBAAiB;IACjB,kBAAkB;IAClB,kBAAkB;AACtB;;AAEA;IACI,gBAAgB;IAChB,+BAA+B;IAC/B,mBAAmB;IACnB,aAAa;AACjB;;AAEA;IACI,kBAAkB;IAClB,cAAc;IACd,mCAAmC;IACnC,mBAAmB;IACnB,yCAAyC;IACzC,aAAa;AACjB;;AAEA;IACI,kBAAkB;IAClB,cAAc;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.settings-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 20px;\n}\n\n.header-buttons {\n display: flex;\n gap: 12px;\n align-items: center;\n}\n\n.header-buttons .button-base {\n min-width: 120px;\n height: 32px;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 8px 16px;\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}\n\n/* No connections container styles */\n.no-connections-container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n min-height: 400px;\n text-align: center;\n padding: 40px 20px;\n}\n\n.no-connections-container p {\n font-size: 1.1em;\n color: var(--jp-ui-font-color2);\n margin-bottom: 32px;\n margin-top: 0;\n}\n\n.video-tutorial {\n border-radius: 8px;\n display: block;\n border: 1px solid var(--purple-500);\n border-radius: 12px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);\n padding: 12px;\n}\n\n.video-container iframe {\n border-radius: 8px;\n display: block;\n} "],"sourceRoot":""}]);
|
|
11624
11820
|
// Exports
|
|
11625
11821
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
11626
11822
|
|
|
@@ -12224,7 +12420,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, `/*
|
|
|
12224
12420
|
}
|
|
12225
12421
|
|
|
12226
12422
|
/* On compact screens, show only the icon */
|
|
12227
|
-
@container (max-width:
|
|
12423
|
+
@container (max-width: 260px) {
|
|
12228
12424
|
|
|
12229
12425
|
/* Shift the dropdown to the left to help prevent right-edge overflow */
|
|
12230
12426
|
.model-options {
|
|
@@ -12238,7 +12434,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, `/*
|
|
|
12238
12434
|
.model-name {
|
|
12239
12435
|
display: none;
|
|
12240
12436
|
}
|
|
12241
|
-
}`, "",{"version":3,"sources":["webpack://./style/ModelSelector.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF,4DAA4D;;AAE5D;EACE,kBAAkB;EAClB,cAAc;EACd,aAAa;EACb,YAAY,EAAE,mCAAmC;EACjD,aAAa;EACb,mBAAmB,EAAE,sBAAsB;EAC3C,+BAA+B;AACjC;;AAEA;EACE,+BAA+B;AACjC;;AAEA;EACE,kBAAkB;EAClB,YAAY,EAAE,yCAAyC;EACvD,kBAAkB;EAClB,eAAe;EACf,aAAa;EACb,mBAAmB,EAAE,0CAA0C;EAC/D,kBAAkB;EAClB,eAAe;AACjB;;;AAGA;EACE,aAAa;EACb,mBAAmB;EACnB,8BAA8B;EAC9B,WAAW;EACX,YAAY;EACZ,cAAc;EACd,eAAe;EACf,gBAAgB;EAChB,cAAc;EACd,mBAAmB;EACnB,gBAAgB;EAChB,uBAAuB;AACzB;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,uBAAuB;EACvB,WAAW;EACX,YAAY;EACZ,cAAc;AAChB;;AAEA;EACE,cAAc;EACd,0BAA0B;EAC1B,gBAAgB;EAChB,cAAc,EAAE,iCAAiC;AACnD;;AAEA,2BAA2B;AAC3B;EACE,kBAAkB;EAClB,YAAY;EACZ,iBAAiB;EACjB,gBAAgB;EAChB,yCAAyC;EACzC,yCAAyC;EACzC,kBAAkB;EAClB,kBAAkB;EAClB,yCAAyC;EACzC,aAAa;EACb,WAAW;AACb;;AAEA;EACE,gBAAgB;EAChB,eAAe;EACf,mCAAmC;EACnC,oCAAoC;EACpC,eAAe;EACf,iCAAiC;EACjC,mBAAmB;EACnB,0BAA0B;AAC5B;;AAEA;EACE,yCAAyC;EACzC,wBAAwB;AAC1B;;AAEA;EACE,yCAAyC;EACzC,wBAAwB;AAC1B;;AAEA,4EAA4E;AAC5E;EACE,YAAY;EACZ,aAAa;EACb,mBAAmB;AACrB;;AAEA;EACE,YAAY;EACZ,kBAAkB;AACpB;;AAEA,iDAAiD;AACjD;EACE,aAAa;EACb,wCAAwC;AAC1C;;AAEA;EACE,qBAAqB;EACrB,gBAAgB;EAChB,gBAAgB;EAChB,uBAAuB;EACvB,mBAAmB;EACnB,sBAAsB;AACxB;;AAEA,qDAAqD;AACrD;EACE,aAAa;AACf;;AAEA;EACE,eAAe;AACjB;;AAEA,2CAA2C;AAC3C;;EAEE,uEAAuE;EACvE;IACE,WAAW;EACb;;EAEA;IACE,eAAe;EACjB;;EAEA;IACE,aAAa;EACf;AACF","sourcesContent":["/*\n * Copyright (c) Saga Inc.\n * Distributed under the terms of the GNU Affero General Public License v3.0 License.\n */\n\n/* ModelSelector.css - responsive design with compact mode */\n\n.model-selector {\n position: relative;\n flex: 0 0 auto;\n margin: 0 8px;\n height: 20px; /* Match height of other elements */\n display: flex;\n align-items: center; /* Center vertically */\n color: var(--jp-ui-font-color2);\n}\n\n.model-selector:hover {\n color: var(--jp-ui-font-color1);\n}\n\n.model-selector-dropdown {\n position: relative;\n height: 20px; /* Fixed height to match other elements */\n border-radius: 4px;\n cursor: pointer;\n display: flex;\n align-items: center; /* Ensure content is vertically centered */\n width: min-content;\n max-width: 18ch;\n}\n\n\n.selected-model {\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n height: 100%;\n padding: 0 8px;\n font-size: 12px;\n font-weight: 500;\n line-height: 1;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.model-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 14px;\n height: 14px;\n line-height: 1;\n}\n\n.dropdown-arrow {\n font-size: 8px;\n transition: transform 0.2s;\n margin-left: 4px;\n flex-shrink: 0; /* Prevent arrow from shrinking */\n}\n\n/* Model options dropdown */\n.model-options {\n position: absolute;\n bottom: 100%;\n max-height: 180px;\n overflow-y: auto;\n background-color: var(--jp-layout-color1);\n border: 1px solid var(--jp-layout-color2);\n border-radius: 4px;\n margin-bottom: 4px;\n box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.1);\n z-index: 1000;\n width: auto;\n}\n\n.model-option {\n padding: 4px 8px;\n font-size: 12px;\n /* Keep this size for readability */\n color: var(--jp-content-font-color1);\n cursor: pointer;\n transition: background-color 0.2s;\n white-space: nowrap;\n /* Prevent text wrapping */\n}\n\n.model-option:hover {\n background-color: var(--jp-layout-color2);\n color: var(--purple-700);\n}\n\n.model-option.selected {\n background-color: var(--jp-layout-color2);\n color: var(--purple-700);\n}\n\n/* When inside chat-controls - ensure proper alignment with other controls */\n.chat-controls .model-selector {\n height: 20px;\n display: flex;\n align-items: center;\n}\n\n.chat-controls .model-selector-dropdown {\n height: 20px;\n align-self: center;\n}\n\n/* Ensure dropdown appears above other elements */\n.model-options {\n z-index: 1010;\n /* Higher z-index to ensure visibility */\n}\n\n.model-name {\n display: inline-block;\n max-width: 120px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n vertical-align: bottom;\n}\n\n/* On wider screens, show only the name of the model*/\n.model-icon {\n display: none;\n}\n\n.model-name {\n display: inline;\n}\n\n/* On compact screens, show only the icon */\n@container (max-width:
|
|
12437
|
+
}`, "",{"version":3,"sources":["webpack://./style/ModelSelector.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF,4DAA4D;;AAE5D;EACE,kBAAkB;EAClB,cAAc;EACd,aAAa;EACb,YAAY,EAAE,mCAAmC;EACjD,aAAa;EACb,mBAAmB,EAAE,sBAAsB;EAC3C,+BAA+B;AACjC;;AAEA;EACE,+BAA+B;AACjC;;AAEA;EACE,kBAAkB;EAClB,YAAY,EAAE,yCAAyC;EACvD,kBAAkB;EAClB,eAAe;EACf,aAAa;EACb,mBAAmB,EAAE,0CAA0C;EAC/D,kBAAkB;EAClB,eAAe;AACjB;;;AAGA;EACE,aAAa;EACb,mBAAmB;EACnB,8BAA8B;EAC9B,WAAW;EACX,YAAY;EACZ,cAAc;EACd,eAAe;EACf,gBAAgB;EAChB,cAAc;EACd,mBAAmB;EACnB,gBAAgB;EAChB,uBAAuB;AACzB;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,uBAAuB;EACvB,WAAW;EACX,YAAY;EACZ,cAAc;AAChB;;AAEA;EACE,cAAc;EACd,0BAA0B;EAC1B,gBAAgB;EAChB,cAAc,EAAE,iCAAiC;AACnD;;AAEA,2BAA2B;AAC3B;EACE,kBAAkB;EAClB,YAAY;EACZ,iBAAiB;EACjB,gBAAgB;EAChB,yCAAyC;EACzC,yCAAyC;EACzC,kBAAkB;EAClB,kBAAkB;EAClB,yCAAyC;EACzC,aAAa;EACb,WAAW;AACb;;AAEA;EACE,gBAAgB;EAChB,eAAe;EACf,mCAAmC;EACnC,oCAAoC;EACpC,eAAe;EACf,iCAAiC;EACjC,mBAAmB;EACnB,0BAA0B;AAC5B;;AAEA;EACE,yCAAyC;EACzC,wBAAwB;AAC1B;;AAEA;EACE,yCAAyC;EACzC,wBAAwB;AAC1B;;AAEA,4EAA4E;AAC5E;EACE,YAAY;EACZ,aAAa;EACb,mBAAmB;AACrB;;AAEA;EACE,YAAY;EACZ,kBAAkB;AACpB;;AAEA,iDAAiD;AACjD;EACE,aAAa;EACb,wCAAwC;AAC1C;;AAEA;EACE,qBAAqB;EACrB,gBAAgB;EAChB,gBAAgB;EAChB,uBAAuB;EACvB,mBAAmB;EACnB,sBAAsB;AACxB;;AAEA,qDAAqD;AACrD;EACE,aAAa;AACf;;AAEA;EACE,eAAe;AACjB;;AAEA,2CAA2C;AAC3C;;EAEE,uEAAuE;EACvE;IACE,WAAW;EACb;;EAEA;IACE,eAAe;EACjB;;EAEA;IACE,aAAa;EACf;AACF","sourcesContent":["/*\n * Copyright (c) Saga Inc.\n * Distributed under the terms of the GNU Affero General Public License v3.0 License.\n */\n\n/* ModelSelector.css - responsive design with compact mode */\n\n.model-selector {\n position: relative;\n flex: 0 0 auto;\n margin: 0 8px;\n height: 20px; /* Match height of other elements */\n display: flex;\n align-items: center; /* Center vertically */\n color: var(--jp-ui-font-color2);\n}\n\n.model-selector:hover {\n color: var(--jp-ui-font-color1);\n}\n\n.model-selector-dropdown {\n position: relative;\n height: 20px; /* Fixed height to match other elements */\n border-radius: 4px;\n cursor: pointer;\n display: flex;\n align-items: center; /* Ensure content is vertically centered */\n width: min-content;\n max-width: 18ch;\n}\n\n\n.selected-model {\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n height: 100%;\n padding: 0 8px;\n font-size: 12px;\n font-weight: 500;\n line-height: 1;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.model-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 14px;\n height: 14px;\n line-height: 1;\n}\n\n.dropdown-arrow {\n font-size: 8px;\n transition: transform 0.2s;\n margin-left: 4px;\n flex-shrink: 0; /* Prevent arrow from shrinking */\n}\n\n/* Model options dropdown */\n.model-options {\n position: absolute;\n bottom: 100%;\n max-height: 180px;\n overflow-y: auto;\n background-color: var(--jp-layout-color1);\n border: 1px solid var(--jp-layout-color2);\n border-radius: 4px;\n margin-bottom: 4px;\n box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.1);\n z-index: 1000;\n width: auto;\n}\n\n.model-option {\n padding: 4px 8px;\n font-size: 12px;\n /* Keep this size for readability */\n color: var(--jp-content-font-color1);\n cursor: pointer;\n transition: background-color 0.2s;\n white-space: nowrap;\n /* Prevent text wrapping */\n}\n\n.model-option:hover {\n background-color: var(--jp-layout-color2);\n color: var(--purple-700);\n}\n\n.model-option.selected {\n background-color: var(--jp-layout-color2);\n color: var(--purple-700);\n}\n\n/* When inside chat-controls - ensure proper alignment with other controls */\n.chat-controls .model-selector {\n height: 20px;\n display: flex;\n align-items: center;\n}\n\n.chat-controls .model-selector-dropdown {\n height: 20px;\n align-self: center;\n}\n\n/* Ensure dropdown appears above other elements */\n.model-options {\n z-index: 1010;\n /* Higher z-index to ensure visibility */\n}\n\n.model-name {\n display: inline-block;\n max-width: 120px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n vertical-align: bottom;\n}\n\n/* On wider screens, show only the name of the model*/\n.model-icon {\n display: none;\n}\n\n.model-name {\n display: inline;\n}\n\n/* On compact screens, show only the icon */\n@container (max-width: 260px) {\n\n /* Shift the dropdown to the left to help prevent right-edge overflow */\n .model-options {\n left: -40px;\n }\n\n .model-icon {\n display: inline;\n }\n\n .model-name {\n display: none;\n }\n}"],"sourceRoot":""}]);
|
|
12242
12438
|
// Exports
|
|
12243
12439
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
12244
12440
|
|
|
@@ -13146,7 +13342,8 @@ ___CSS_LOADER_EXPORT___.push([module.id, `/*
|
|
|
13146
13342
|
justify-content: center;
|
|
13147
13343
|
width: 12px;
|
|
13148
13344
|
max-height: 14px;
|
|
13149
|
-
|
|
13345
|
+
color: var(--jp-content-font-color3);
|
|
13346
|
+
}`, "",{"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;EAChB,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.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 color: var(--jp-content-font-color3);\n}"],"sourceRoot":""}]);
|
|
13150
13347
|
// Exports
|
|
13151
13348
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
13152
13349
|
|
|
@@ -13409,7 +13606,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, `/*
|
|
|
13409
13606
|
gap: 8px;
|
|
13410
13607
|
min-width: 20px;
|
|
13411
13608
|
font-size: 12px;
|
|
13412
|
-
padding: 2px
|
|
13609
|
+
padding: 2px 8px;
|
|
13413
13610
|
}
|
|
13414
13611
|
|
|
13415
13612
|
.toggle-button-half:first-child {
|
|
@@ -13436,7 +13633,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, `/*
|
|
|
13436
13633
|
width: 16px;
|
|
13437
13634
|
height: 16px;
|
|
13438
13635
|
}
|
|
13439
|
-
`, "",{"version":3,"sources":["webpack://./style/ToggleButton.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;EACE,aAAa;EACb,QAAQ;EACR,yCAAyC;EACzC,0CAA0C;EAC1C,kBAAkB;EAClB,YAAY;EACZ,gBAAgB;AAClB;;AAEA;EACE,aAAa;EACb,aAAa;EACb,mBAAmB;EACnB,uBAAuB;EACvB,QAAQ;EACR,eAAe;EACf,eAAe;EACf,
|
|
13636
|
+
`, "",{"version":3,"sources":["webpack://./style/ToggleButton.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;EACE,aAAa;EACb,QAAQ;EACR,yCAAyC;EACzC,0CAA0C;EAC1C,kBAAkB;EAClB,YAAY;EACZ,gBAAgB;AAClB;;AAEA;EACE,aAAa;EACb,aAAa;EACb,mBAAmB;EACnB,uBAAuB;EACvB,QAAQ;EACR,eAAe;EACf,eAAe;EACf,gBAAgB;AAClB;;AAEA;EACE,kBAAkB;AACpB;;AAEA;EACE,kBAAkB;AACpB;;AAEA;EACE,UAAU;EACV,mCAAmC;EACnC,mCAAmC;AACrC;;AAEA;EACE,YAAY;EACZ,wCAAwC;EACxC,0CAA0C;AAC5C;;AAEA;EACE,WAAW;EACX,YAAY;AACd","sourcesContent":["/*\n * Copyright (c) Saga Inc.\n * Distributed under the terms of the GNU Affero General Public License v3.0 License.\n */\n\n.toggle-button-container {\n display: flex;\n gap: 1px;\n background-color: var(--jp-layout-color2);\n border: 1px solid var(--jp-ui-font-color3);\n border-radius: 2px;\n width: 100px;\n overflow: hidden;\n}\n\n.toggle-button-half {\n flex: 0 0 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n min-width: 20px;\n font-size: 12px;\n padding: 2px 8px;\n}\n\n.toggle-button-half:first-child {\n border-radius: 0px;\n}\n\n.toggle-button-half:last-child {\n border-radius: 0px;\n}\n\n.toggle-button-half.selected {\n opacity: 1;\n background-color: var(--purple-400);\n color: var(--purple-700) !important;\n}\n\n.toggle-button-half.unselected {\n opacity: 0.6;\n background-color: transparent !important;\n color: var(--jp-ui-font-color2) !important;\n}\n\n.toggle-button-icon {\n width: 16px;\n height: 16px;\n}\n"],"sourceRoot":""}]);
|
|
13440
13637
|
// Exports
|
|
13441
13638
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
13442
13639
|
|
|
@@ -15584,4 +15781,4 @@ var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js
|
|
|
15584
15781
|
/***/ })
|
|
15585
15782
|
|
|
15586
15783
|
}]);
|
|
15587
|
-
//# sourceMappingURL=lib_index_js.
|
|
15784
|
+
//# sourceMappingURL=lib_index_js.16b532b655cd2906e04a.js.map
|