openrune 0.3.12 → 0.3.13
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 +1 -1
- package/src/main.ts +13 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openrune",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.13",
|
|
4
4
|
"description": "Rune — File-based AI Agent Harness for Claude Code",
|
|
5
5
|
"keywords": ["ai", "agent", "claude", "desktop", "electron", "mcp", "claude-code", "harness", "automation"],
|
|
6
6
|
"repository": {
|
package/src/main.ts
CHANGED
|
@@ -344,9 +344,8 @@ async function createRuneWindow(filePath: string) {
|
|
|
344
344
|
|
|
345
345
|
const rune = readRuneFile(filePath)
|
|
346
346
|
const folderPath = path.dirname(filePath)
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
if (!port) port = await allocatePort()
|
|
347
|
+
// Always allocate a fresh port to avoid conflicts with stale ports
|
|
348
|
+
const port = await allocatePort()
|
|
350
349
|
|
|
351
350
|
// Sync name with filename & save port
|
|
352
351
|
const fileBaseName = path.basename(filePath, '.rune')
|
|
@@ -476,6 +475,17 @@ async function createRuneWindow(filePath: string) {
|
|
|
476
475
|
ptyProcesses.delete(id)
|
|
477
476
|
ptyOwnerWindows.delete(id)
|
|
478
477
|
}
|
|
478
|
+
// Clear port from .rune file so next session gets a fresh port
|
|
479
|
+
try {
|
|
480
|
+
const closeRune = readRuneFile(currentFilePath)
|
|
481
|
+
delete closeRune.port
|
|
482
|
+
writeRuneFile(currentFilePath, closeRune)
|
|
483
|
+
} catch {}
|
|
484
|
+
// Clean up .mcp.json if no other windows use this folder
|
|
485
|
+
const folderStillUsed = [...windowRegistry.values()].some(r => r.folderPath === folderPath && !r.window.isDestroyed())
|
|
486
|
+
if (!folderStillUsed) {
|
|
487
|
+
try { fs.unlinkSync(path.join(folderPath, '.mcp.json')) } catch {}
|
|
488
|
+
}
|
|
479
489
|
updateDockVisibility()
|
|
480
490
|
})
|
|
481
491
|
}
|