replicas-engine 0.1.153 → 0.1.154
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/src/index.js +36 -1
- package/package.json +1 -1
package/dist/src/index.js
CHANGED
|
@@ -277,7 +277,7 @@ function parseReplicasConfigString(content, filename) {
|
|
|
277
277
|
}
|
|
278
278
|
|
|
279
279
|
// ../shared/src/engine/environment.ts
|
|
280
|
-
var DAYTONA_SNAPSHOT_ID = "10-05-2026-royal-york-
|
|
280
|
+
var DAYTONA_SNAPSHOT_ID = "10-05-2026-royal-york-v5";
|
|
281
281
|
|
|
282
282
|
// ../shared/src/engine/types.ts
|
|
283
283
|
var DEFAULT_CHAT_TITLES = {
|
|
@@ -1851,6 +1851,22 @@ var PreviewService = class {
|
|
|
1851
1851
|
const data = await readPreviewsFile();
|
|
1852
1852
|
return data.previews;
|
|
1853
1853
|
}
|
|
1854
|
+
async removePreview(port2) {
|
|
1855
|
+
const data = await readPreviewsFile();
|
|
1856
|
+
const before = data.previews.length;
|
|
1857
|
+
data.previews = data.previews.filter((p) => p.port !== port2);
|
|
1858
|
+
if (data.previews.length === before) {
|
|
1859
|
+
return false;
|
|
1860
|
+
}
|
|
1861
|
+
await writePreviewsFile(data);
|
|
1862
|
+
eventService.publish({
|
|
1863
|
+
id: randomUUID2(),
|
|
1864
|
+
ts: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1865
|
+
type: "preview.changed",
|
|
1866
|
+
payload: { previews: data.previews }
|
|
1867
|
+
});
|
|
1868
|
+
return true;
|
|
1869
|
+
}
|
|
1854
1870
|
};
|
|
1855
1871
|
var previewService = new PreviewService();
|
|
1856
1872
|
|
|
@@ -5123,6 +5139,25 @@ function createV1Routes(deps) {
|
|
|
5123
5139
|
return c.json(jsonError("Failed to create preview", details), 400);
|
|
5124
5140
|
}
|
|
5125
5141
|
});
|
|
5142
|
+
app2.delete("/previews/:port", async (c) => {
|
|
5143
|
+
try {
|
|
5144
|
+
const portParam = c.req.param("port");
|
|
5145
|
+
const port2 = parseInt(portParam, 10);
|
|
5146
|
+
if (isNaN(port2) || port2 < 1 || port2 > 65535) {
|
|
5147
|
+
return c.json(jsonError("Invalid port number"), 400);
|
|
5148
|
+
}
|
|
5149
|
+
const removed = await previewService.removePreview(port2);
|
|
5150
|
+
if (!removed) {
|
|
5151
|
+
return c.json(jsonError("Preview not found"), 404);
|
|
5152
|
+
}
|
|
5153
|
+
return c.json({ success: true, port: port2 });
|
|
5154
|
+
} catch (error) {
|
|
5155
|
+
return c.json(
|
|
5156
|
+
jsonError("Failed to delete preview", error instanceof Error ? error.message : "Unknown error"),
|
|
5157
|
+
500
|
|
5158
|
+
);
|
|
5159
|
+
}
|
|
5160
|
+
});
|
|
5126
5161
|
app2.get("/logs", async (c) => {
|
|
5127
5162
|
try {
|
|
5128
5163
|
const files = await readdir6(LOG_DIR).catch(() => []);
|