agent-theatre 1.0.1 → 1.1.2

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,6 +1212,11 @@ var Theatre = class {
1212
1212
  if (events.length) this.ingest(events);
1213
1213
  return c.body(null, 204);
1214
1214
  });
1215
+ a.use("/api/*", async (c, next) => {
1216
+ await next();
1217
+ c.header("access-control-allow-origin", "*");
1218
+ });
1219
+ a.options("/api/*", (c) => c.body(null, 204, { "access-control-allow-origin": "*", "access-control-allow-headers": "content-type" }));
1215
1220
  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 }));
1216
1221
  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 }))));
1217
1222
  a.get("/api/replay/:id", (c) => {