mito-ai 0.1.31__py3-none-any.whl → 0.1.33__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.
Files changed (25) hide show
  1. mito_ai/_version.py +1 -1
  2. {mito_ai-0.1.31.data → mito_ai-0.1.33.data}/data/share/jupyter/labextensions/mito_ai/build_log.json +1 -1
  3. {mito_ai-0.1.31.data → mito_ai-0.1.33.data}/data/share/jupyter/labextensions/mito_ai/package.json +2 -2
  4. {mito_ai-0.1.31.data → mito_ai-0.1.33.data}/data/share/jupyter/labextensions/mito_ai/schemas/mito_ai/package.json.orig +1 -1
  5. mito_ai-0.1.31.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.4a24ec8bdd6fde22593c.js → mito_ai-0.1.33.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.281f4b9af60d620c6fb1.js +78 -67
  6. mito_ai-0.1.33.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.281f4b9af60d620c6fb1.js.map +1 -0
  7. mito_ai-0.1.31.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.1445025069f6d660a9b4.js → mito_ai-0.1.33.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.4f1d00fd0c58fcc05d8d.js +3 -3
  8. mito_ai-0.1.31.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.1445025069f6d660a9b4.js.map → mito_ai-0.1.33.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.4f1d00fd0c58fcc05d8d.js.map +1 -1
  9. {mito_ai-0.1.31.dist-info → mito_ai-0.1.33.dist-info}/METADATA +1 -1
  10. {mito_ai-0.1.31.dist-info → mito_ai-0.1.33.dist-info}/RECORD +24 -24
  11. mito_ai-0.1.31.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.4a24ec8bdd6fde22593c.js.map +0 -1
  12. {mito_ai-0.1.31.data → mito_ai-0.1.33.data}/data/etc/jupyter/jupyter_server_config.d/mito_ai.json +0 -0
  13. {mito_ai-0.1.31.data → mito_ai-0.1.33.data}/data/share/jupyter/labextensions/mito_ai/schemas/mito_ai/toolbar-buttons.json +0 -0
  14. {mito_ai-0.1.31.data → mito_ai-0.1.33.data}/data/share/jupyter/labextensions/mito_ai/static/style.js +0 -0
  15. {mito_ai-0.1.31.data → mito_ai-0.1.33.data}/data/share/jupyter/labextensions/mito_ai/static/style_index_js.06083e515de4862df010.js +0 -0
  16. {mito_ai-0.1.31.data → mito_ai-0.1.33.data}/data/share/jupyter/labextensions/mito_ai/static/style_index_js.06083e515de4862df010.js.map +0 -0
  17. {mito_ai-0.1.31.data → mito_ai-0.1.33.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_html2canvas_dist_html2canvas_js.ea47e8c8c906197f8d19.js +0 -0
  18. {mito_ai-0.1.31.data → mito_ai-0.1.33.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_html2canvas_dist_html2canvas_js.ea47e8c8c906197f8d19.js.map +0 -0
  19. {mito_ai-0.1.31.data → mito_ai-0.1.33.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_semver_index_js.9795f79265ddb416864b.js +0 -0
  20. {mito_ai-0.1.31.data → mito_ai-0.1.33.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_semver_index_js.9795f79265ddb416864b.js.map +0 -0
  21. {mito_ai-0.1.31.data → mito_ai-0.1.33.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_vscode-diff_dist_index_js.ea55f1f9346638aafbcf.js +0 -0
  22. {mito_ai-0.1.31.data → mito_ai-0.1.33.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_vscode-diff_dist_index_js.ea55f1f9346638aafbcf.js.map +0 -0
  23. {mito_ai-0.1.31.dist-info → mito_ai-0.1.33.dist-info}/WHEEL +0 -0
  24. {mito_ai-0.1.31.dist-info → mito_ai-0.1.33.dist-info}/entry_points.txt +0 -0
  25. {mito_ai-0.1.31.dist-info → mito_ai-0.1.33.dist-info}/licenses/LICENSE +0 -0
mito_ai/_version.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # This file is auto-generated by Hatchling. As such, do not:
2
2
  # - modify
3
3
  # - track in version control e.g. be sure to add to .gitignore
4
- __version__ = VERSION = '0.1.31'
4
+ __version__ = VERSION = '0.1.33'
@@ -710,7 +710,7 @@
710
710
  "semver": {},
711
711
  "vscode-diff": {},
712
712
  "mito_ai": {
713
- "version": "0.1.31",
713
+ "version": "0.1.33",
714
714
  "singleton": true,
715
715
  "import": "/home/runner/work/mito/mito/mito-ai/lib/index.js"
716
716
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mito_ai",
3
- "version": "0.1.31",
3
+ "version": "0.1.33",
4
4
  "description": "AI chat for JupyterLab",
5
5
  "keywords": [
6
6
  "jupyter",
@@ -138,7 +138,7 @@
138
138
  "outputDir": "mito_ai/labextension",
139
139
  "schemaDir": "schema",
140
140
  "_build": {
141
- "load": "static/remoteEntry.1445025069f6d660a9b4.js",
141
+ "load": "static/remoteEntry.4f1d00fd0c58fcc05d8d.js",
142
142
  "extension": "./extension",
143
143
  "style": "./style"
144
144
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mito_ai",
3
- "version": "0.1.31",
3
+ "version": "0.1.33",
4
4
  "description": "AI chat for JupyterLab",
5
5
  "keywords": [
6
6
  "jupyter",
@@ -2475,8 +2475,7 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
2475
2475
  app.commands.notifyCommandChanged(_commands__WEBPACK_IMPORTED_MODULE_18__.COMMAND_MITO_AI_CELL_TOOLBAR_ACCEPT_CODE);
2476
2476
  app.commands.notifyCommandChanged(_commands__WEBPACK_IMPORTED_MODULE_18__.COMMAND_MITO_AI_CELL_TOOLBAR_REJECT_CODE);
2477
2477
  };
2478
- // Create a WeakMap to store compartments per code cell
2479
- const codeDiffStripesCompartments = react__WEBPACK_IMPORTED_MODULE_2___default().useRef(new WeakMap());
2478
+ const codeDiffStripesCompartments = react__WEBPACK_IMPORTED_MODULE_2___default().useRef(new Map());
2480
2479
  // Function to update the extensions of code cells
2481
2480
  const updateCodeCellsExtensions = (unifiedDiffLines) => {
2482
2481
  var _a;
@@ -2485,42 +2484,38 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
2485
2484
  return;
2486
2485
  }
2487
2486
  const activeCellIndex = notebook.activeCellIndex;
2488
- try {
2489
- notebook.widgets.forEach((cell, index) => {
2490
- if (cell.model.type === 'code') {
2491
- const isActiveCodeCell = activeCellIndex === index;
2492
- // TODO: Instead of casting, we should rely on the type system to make
2493
- // sure we're using the correct types!
2494
- const codeCell = cell;
2495
- const cmEditor = codeCell.editor;
2496
- const editorView = cmEditor === null || cmEditor === void 0 ? void 0 : cmEditor.editor;
2497
- if (editorView) {
2498
- let compartment = codeDiffStripesCompartments.current.get(codeCell);
2499
- if (!compartment) {
2500
- // Create a new compartment and store it
2501
- compartment = new _codemirror_state__WEBPACK_IMPORTED_MODULE_1__.Compartment();
2502
- codeDiffStripesCompartments.current.set(codeCell, compartment);
2503
- // Apply the initial configuration
2504
- editorView.dispatch({
2505
- effects: _codemirror_state__WEBPACK_IMPORTED_MODULE_1__.StateEffect.appendConfig.of(compartment.of(unifiedDiffLines !== undefined && isActiveCodeCell ? (0,_CodeDiffDisplay__WEBPACK_IMPORTED_MODULE_19__.codeDiffStripesExtension)({ unifiedDiffLines: unifiedDiffLines }) : [])),
2506
- });
2507
- }
2508
- else {
2509
- // Reconfigure the compartment
2510
- editorView.dispatch({
2511
- effects: compartment.reconfigure(unifiedDiffLines !== undefined && isActiveCodeCell ? (0,_CodeDiffDisplay__WEBPACK_IMPORTED_MODULE_19__.codeDiffStripesExtension)({ unifiedDiffLines: unifiedDiffLines }) : []),
2512
- });
2513
- }
2487
+ notebook.widgets.forEach((cell, index) => {
2488
+ if (cell.model.type === 'code') {
2489
+ const isActiveCodeCell = activeCellIndex === index;
2490
+ // TODO: Instead of casting, we should rely on the type system to make
2491
+ // sure we're using the correct types!
2492
+ const codeCell = cell;
2493
+ const cmEditor = codeCell.editor;
2494
+ const editorView = cmEditor === null || cmEditor === void 0 ? void 0 : cmEditor.editor;
2495
+ if (editorView) {
2496
+ const cellId = codeCell.model.id;
2497
+ let compartment = codeDiffStripesCompartments.current.get(cellId);
2498
+ if (!compartment) {
2499
+ // Create a new compartment and store it
2500
+ compartment = new _codemirror_state__WEBPACK_IMPORTED_MODULE_1__.Compartment();
2501
+ codeDiffStripesCompartments.current.set(cellId, compartment);
2502
+ // Apply the initial configuration
2503
+ editorView.dispatch({
2504
+ effects: _codemirror_state__WEBPACK_IMPORTED_MODULE_1__.StateEffect.appendConfig.of(compartment.of(unifiedDiffLines !== undefined && isActiveCodeCell ? (0,_CodeDiffDisplay__WEBPACK_IMPORTED_MODULE_19__.codeDiffStripesExtension)({ unifiedDiffLines: unifiedDiffLines }) : [])),
2505
+ });
2514
2506
  }
2515
2507
  else {
2516
- console.log('Mito AI: editor view not found when applying code diff stripes');
2508
+ // Reconfigure the compartment
2509
+ editorView.dispatch({
2510
+ effects: compartment.reconfigure(unifiedDiffLines !== undefined && isActiveCodeCell ? (0,_CodeDiffDisplay__WEBPACK_IMPORTED_MODULE_19__.codeDiffStripesExtension)({ unifiedDiffLines: unifiedDiffLines }) : []),
2511
+ });
2517
2512
  }
2518
2513
  }
2519
- });
2520
- }
2521
- catch (error) {
2522
- console.error('Error updating code cells extensions', error);
2523
- }
2514
+ else {
2515
+ console.log('Mito AI: editor view not found when applying code diff stripes');
2516
+ }
2517
+ }
2518
+ });
2524
2519
  };
2525
2520
  const lastAIMessagesIndex = chatHistoryManager.getLastAIMessageIndex();
2526
2521
  return (react__WEBPACK_IMPORTED_MODULE_2___default().createElement("div", { className: "chat-taskpane" },
@@ -8743,46 +8738,62 @@ __webpack_require__.r(__webpack_exports__);
8743
8738
  This is used to wait for the notebook to be ready before sending the first message.
8744
8739
  */
8745
8740
  const waitForNotebookReady = async (notebookTracker) => {
8746
- const notebook = notebookTracker.currentWidget;
8747
- if (!notebook) {
8748
- console.warn('No active notebook found');
8749
- return;
8750
- }
8751
- // Wait for notebook to be ready and attached
8752
- await notebook.context.ready;
8753
- // Wait for attachment
8754
- if (!notebook.content.isAttached) {
8741
+ // This is not critical and we never want it to break the app.
8742
+ try {
8743
+ // First, wait for a notebook to exist with retry pattern
8744
+ let notebook = notebookTracker.currentWidget;
8745
+ let attempts = 0;
8746
+ const maxAttempts = 30; // Wait up to 30 seconds (30 attempts * 1 second each)
8747
+ while (!notebook && attempts < maxAttempts) {
8748
+ console.log(`🔍 Waiting for notebook to appear (attempt ${attempts + 1}/${maxAttempts})...`);
8749
+ await new Promise(resolve => setTimeout(resolve, 1000)); // Wait 1 second
8750
+ notebook = notebookTracker.currentWidget;
8751
+ attempts++;
8752
+ }
8753
+ if (!notebook) {
8754
+ throw new Error(`No active notebook found after ${maxAttempts} seconds`);
8755
+ }
8756
+ console.log('🔍 Notebook found, waiting for it to be ready...');
8757
+ // Wait for notebook to be ready and attached
8758
+ await notebook.context.ready;
8759
+ // Wait for attachment
8760
+ if (!notebook.content.isAttached) {
8761
+ await new Promise(resolve => {
8762
+ const checkAttached = () => {
8763
+ if (notebook.content.isAttached) {
8764
+ resolve();
8765
+ }
8766
+ else {
8767
+ setTimeout(checkAttached, 100);
8768
+ }
8769
+ };
8770
+ checkAttached();
8771
+ });
8772
+ }
8773
+ // Wait for all cells to be created and ready
8755
8774
  await new Promise(resolve => {
8756
- const checkAttached = () => {
8757
- if (notebook.content.isAttached) {
8775
+ const checkCellsReady = () => {
8776
+ const cells = notebook.content.widgets;
8777
+ // In large notebooks, not all of the cells are attatched I think.
8778
+ // So instead we just wait for any cell to be ready and then give it
8779
+ // another 500ms to be ready.
8780
+ const anyCellReady = cells.some(cell => cell.isAttached && cell.model);
8781
+ if (anyCellReady && cells.length > 0) {
8758
8782
  resolve();
8759
8783
  }
8760
8784
  else {
8761
- setTimeout(checkAttached, 100);
8785
+ setTimeout(checkCellsReady, 100);
8762
8786
  }
8763
8787
  };
8764
- checkAttached();
8788
+ checkCellsReady();
8765
8789
  });
8790
+ // Small buffer for final initialization
8791
+ await new Promise(resolve => setTimeout(resolve, 500));
8792
+ }
8793
+ catch (error) {
8794
+ console.error('Error waiting for notebook to be ready:', error);
8795
+ throw error;
8766
8796
  }
8767
- // Wait for all cells to be created and ready
8768
- await new Promise(resolve => {
8769
- const checkCellsReady = () => {
8770
- const cells = notebook.content.widgets;
8771
- // In large notebooks, not all of the cells are attatched I think.
8772
- // So instead we just wait for any cell to be ready and then give it
8773
- // another 500ms to be ready.
8774
- const anyCellReady = cells.some(cell => cell.isAttached && cell.model);
8775
- if (anyCellReady && cells.length > 0) {
8776
- resolve();
8777
- }
8778
- else {
8779
- setTimeout(checkCellsReady, 100);
8780
- }
8781
- };
8782
- checkCellsReady();
8783
- });
8784
- // Small buffer for final initialization
8785
- await new Promise(resolve => setTimeout(resolve, 500));
8786
8797
  };
8787
8798
 
8788
8799
 
@@ -14043,4 +14054,4 @@ var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js
14043
14054
  /***/ })
14044
14055
 
14045
14056
  }]);
14046
- //# sourceMappingURL=lib_index_js.4a24ec8bdd6fde22593c.js.map
14057
+ //# sourceMappingURL=lib_index_js.281f4b9af60d620c6fb1.js.map