stashes 0.1.41 → 0.1.43
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/dist/cli.js
CHANGED
|
@@ -150,6 +150,18 @@ app.delete("/chats/:chatId", (c) => {
|
|
|
150
150
|
persistence.deleteChat(project.id, chatId);
|
|
151
151
|
return c.json({ data: { deleted: chatId } });
|
|
152
152
|
});
|
|
153
|
+
app.get("/dev-server-status", async (c) => {
|
|
154
|
+
const port = serverState.userDevPort;
|
|
155
|
+
try {
|
|
156
|
+
const res = await fetch(`http://localhost:${port}`, {
|
|
157
|
+
method: "HEAD",
|
|
158
|
+
signal: AbortSignal.timeout(2000)
|
|
159
|
+
});
|
|
160
|
+
return c.json({ up: res.status < 500, port });
|
|
161
|
+
} catch {
|
|
162
|
+
return c.json({ up: false, port });
|
|
163
|
+
}
|
|
164
|
+
});
|
|
153
165
|
app.get("/screenshots/:filename", (c) => {
|
|
154
166
|
const filename = c.req.param("filename");
|
|
155
167
|
const filePath = join(serverState.projectPath, ".stashes", "screenshots", filename);
|
|
@@ -1691,6 +1703,7 @@ class PreviewPool {
|
|
|
1691
1703
|
this.evictOldest();
|
|
1692
1704
|
}
|
|
1693
1705
|
const proxyPort = this.allocatePort();
|
|
1706
|
+
this.usedPorts.add(proxyPort);
|
|
1694
1707
|
const devPort = proxyPort + DEV_PORT_OFFSET;
|
|
1695
1708
|
const worktreePath = await this.worktreeManager.createPreviewForPool(stashId);
|
|
1696
1709
|
const process2 = Bun.spawn({
|
|
@@ -1711,7 +1724,6 @@ class PreviewPool {
|
|
|
1711
1724
|
lastHeartbeat: Date.now()
|
|
1712
1725
|
};
|
|
1713
1726
|
this.entries.set(stashId, entry);
|
|
1714
|
-
this.usedPorts.add(proxyPort);
|
|
1715
1727
|
logger.info("pool", `cold start: ${stashId} dev=:${devPort} proxy=:${proxyPort}`, { poolSize: this.entries.size });
|
|
1716
1728
|
await this.waitForPort(proxyPort, 60000);
|
|
1717
1729
|
return proxyPort;
|
package/dist/mcp.js
CHANGED
|
@@ -1546,6 +1546,18 @@ app.delete("/chats/:chatId", (c) => {
|
|
|
1546
1546
|
persistence.deleteChat(project.id, chatId);
|
|
1547
1547
|
return c.json({ data: { deleted: chatId } });
|
|
1548
1548
|
});
|
|
1549
|
+
app.get("/dev-server-status", async (c) => {
|
|
1550
|
+
const port = serverState.userDevPort;
|
|
1551
|
+
try {
|
|
1552
|
+
const res = await fetch(`http://localhost:${port}`, {
|
|
1553
|
+
method: "HEAD",
|
|
1554
|
+
signal: AbortSignal.timeout(2000)
|
|
1555
|
+
});
|
|
1556
|
+
return c.json({ up: res.status < 500, port });
|
|
1557
|
+
} catch {
|
|
1558
|
+
return c.json({ up: false, port });
|
|
1559
|
+
}
|
|
1560
|
+
});
|
|
1549
1561
|
app.get("/screenshots/:filename", (c) => {
|
|
1550
1562
|
const filename = c.req.param("filename");
|
|
1551
1563
|
const filePath = join7(serverState.projectPath, ".stashes", "screenshots", filename);
|
|
@@ -1887,6 +1899,7 @@ class PreviewPool {
|
|
|
1887
1899
|
this.evictOldest();
|
|
1888
1900
|
}
|
|
1889
1901
|
const proxyPort = this.allocatePort();
|
|
1902
|
+
this.usedPorts.add(proxyPort);
|
|
1890
1903
|
const devPort = proxyPort + DEV_PORT_OFFSET;
|
|
1891
1904
|
const worktreePath = await this.worktreeManager.createPreviewForPool(stashId);
|
|
1892
1905
|
const process2 = Bun.spawn({
|
|
@@ -1907,7 +1920,6 @@ class PreviewPool {
|
|
|
1907
1920
|
lastHeartbeat: Date.now()
|
|
1908
1921
|
};
|
|
1909
1922
|
this.entries.set(stashId, entry);
|
|
1910
|
-
this.usedPorts.add(proxyPort);
|
|
1911
1923
|
logger.info("pool", `cold start: ${stashId} dev=:${devPort} proxy=:${proxyPort}`, { poolSize: this.entries.size });
|
|
1912
1924
|
await this.waitForPort(proxyPort, 60000);
|
|
1913
1925
|
return proxyPort;
|