agent86-web 0.1.0 → 0.2.0
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/README.md +5 -2
- package/dist/cli.js +10 -6
- package/dist/public/assets/{engine-B6asLUEM.js → engine-uu4Pp8lX.js} +2 -2
- package/dist/public/assets/index-B2J10lb0.css +2 -0
- package/dist/public/assets/index-sMw9P5mz.js +107 -0
- package/dist/public/index.html +2 -2
- package/dist/server.js +13 -0
- package/package.json +1 -1
- package/dist/public/assets/index-DTCJJId8.js +0 -107
- package/dist/public/assets/index-IoOJPMXl.css +0 -2
package/dist/public/index.html
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
<meta name="referrer" content="no-referrer" />
|
|
7
7
|
<link rel="icon" type="image/png" href="/favicon.png" />
|
|
8
8
|
<title>agent86 web</title>
|
|
9
|
-
<script type="module" crossorigin src="/assets/index-
|
|
10
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
9
|
+
<script type="module" crossorigin src="/assets/index-sMw9P5mz.js"></script>
|
|
10
|
+
<link rel="stylesheet" crossorigin href="/assets/index-B2J10lb0.css">
|
|
11
11
|
</head>
|
|
12
12
|
<body>
|
|
13
13
|
<div id="root"></div>
|
package/dist/server.js
CHANGED
|
@@ -247,6 +247,19 @@ export async function startBridge(options) {
|
|
|
247
247
|
}
|
|
248
248
|
return json(res, 405, { error: "method_not_allowed" });
|
|
249
249
|
}
|
|
250
|
+
if (url.pathname === "/api/shutdown") {
|
|
251
|
+
if (req.method !== "POST")
|
|
252
|
+
return json(res, 405, { error: "method_not_allowed" });
|
|
253
|
+
if (!auth.originAllowed(req) || !Auth.hasCsrfHeader(req)) {
|
|
254
|
+
return json(res, 403, { error: "origin_not_allowed" });
|
|
255
|
+
}
|
|
256
|
+
const stop = options.onShutdownRequested;
|
|
257
|
+
if (!stop)
|
|
258
|
+
return json(res, 501, { error: "not_supported" });
|
|
259
|
+
log("stop requested from the browser");
|
|
260
|
+
res.once("finish", () => setImmediate(stop));
|
|
261
|
+
return json(res, 200, { stopping: true });
|
|
262
|
+
}
|
|
250
263
|
if (url.pathname === "/api/files" && req.method === "GET") {
|
|
251
264
|
const workspace = resolveWorkspace(url.searchParams.get("workspace") ?? "", options.roots);
|
|
252
265
|
if (!workspace)
|