mrmd-editor 0.3.1 → 0.3.2

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mrmd-editor",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Markdown editor with realtime collaboration - the core editor package",
5
5
  "type": "module",
6
6
  "main": "dist/mrmd.cjs",
@@ -59,7 +59,7 @@
59
59
  "codemirror": "^6.0.1",
60
60
  "codemirror-lang-r": "^0.1.1",
61
61
  "katex": "^0.16.27",
62
- "mrmd-js": "file:../mrmd-js",
62
+ "mrmd-js": "^2.0.0",
63
63
  "y-codemirror.next": "^0.3.5",
64
64
  "y-websocket": "^2.0.0",
65
65
  "yjs": "^13.6.18"
package/src/execution.js CHANGED
@@ -103,6 +103,15 @@ export class ExecutionManager {
103
103
  console.log('[ExecutionManager] Monitor mode enabled, runtimeUrl:', runtimeUrl, 'session:', this._monitorSession);
104
104
  }
105
105
 
106
+ /**
107
+ * Update the default runtime URL (for switching venvs without recreating the editor)
108
+ * @param {string} runtimeUrl - New runtime URL
109
+ */
110
+ setRuntimeUrl(runtimeUrl) {
111
+ this._defaultRuntimeUrl = runtimeUrl;
112
+ console.log('[ExecutionManager] Runtime URL updated:', runtimeUrl);
113
+ }
114
+
106
115
  /**
107
116
  * Disable monitor mode (use direct execution)
108
117
  */
package/src/mrp-client.js CHANGED
@@ -63,6 +63,9 @@ export class MRPClient {
63
63
  this.#defaultSession = options.session || 'default';
64
64
  this.#fallbackLanguages = options.languages || null;
65
65
 
66
+ // Expose runtime URL for ExecutionManager to use in monitor mode routing
67
+ this.runtimeUrl = this.#endpoint;
68
+
66
69
  // Auto-fetch capabilities (fire and forget)
67
70
  if (options.prefetch !== false) {
68
71
  this.#capabilitiesPromise = this.getCapabilities().catch(() => null);
@@ -544,6 +544,11 @@ export async function createStudio(target, options = {}) {
544
544
  editor.connectRuntime('python', sessionInfo.url);
545
545
  }
546
546
 
547
+ // IMPORTANT: Update ExecutionManager's runtime URL for monitor mode
548
+ if (editor?.execution?.setRuntimeUrl && sessionInfo.url) {
549
+ editor.execution.setRuntimeUrl(sessionInfo.url);
550
+ }
551
+
547
552
  // Update the legacy python state for status bar display
548
553
  shellState._set('runtimes.python.venv', path);
549
554
  shellState._set('runtimes.python.venvName', path.split('/').pop());