agent-theatre 1.1.2 → 1.1.3

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
@@ -1212,11 +1212,12 @@ var Theatre = class {
1212
1212
  if (events.length) this.ingest(events);
1213
1213
  return c.body(null, 204);
1214
1214
  });
1215
+ const cors = { "access-control-allow-origin": "*", "access-control-allow-headers": "content-type", "access-control-allow-methods": "GET, POST, OPTIONS", "access-control-allow-private-network": "true" };
1215
1216
  a.use("/api/*", async (c, next) => {
1216
1217
  await next();
1217
- c.header("access-control-allow-origin", "*");
1218
+ for (const [k, v] of Object.entries(cors)) c.res.headers.set(k, v);
1218
1219
  });
1219
- a.options("/api/*", (c) => c.body(null, 204, { "access-control-allow-origin": "*", "access-control-allow-headers": "content-type" }));
1220
+ a.options("/api/*", (c) => c.body(null, 204, cors));
1220
1221
  a.get("/api/scene", (c) => c.json({ mode: "live", repoId: this.opts.repoId, world: this.live.world, events: this.live.events, beats: this.live.beats, signal: this.signal }));
1221
1222
  a.get("/api/sessions", (c) => c.json(listSessions(this.opts.cwd).map((s) => ({ id: s.id, title: s.title, mtime: s.mtime, bytes: s.bytes }))));
1222
1223
  a.get("/api/replay/:id", (c) => {