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.
@@ -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-DTCJJId8.js"></script>
10
- <link rel="stylesheet" crossorigin href="/assets/index-IoOJPMXl.css">
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)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent86-web",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "A browser interface for agent86. Runs a local bridge between your browser and `agent86 acp`.",
5
5
  "license": "MIT",
6
6
  "author": "Maetek Technologies",