agent-theatre 1.2.0 → 1.2.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/README.md +2 -0
- package/dist/cli.js +12 -0
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/web/assets/browserAll-DpEOVFXE.js +2 -0
- package/web/assets/{browserAll-MBabRn1_.js.map → browserAll-DpEOVFXE.js.map} +1 -1
- package/web/assets/{index-DUimS_fe.css → index-DLvIe75m.css} +1 -1
- package/web/assets/{index-K7cJxdMz.js → index-vIjrCnHW.js} +76 -74
- package/web/assets/index-vIjrCnHW.js.map +1 -0
- package/web/assets/webworkerAll-BIhfsOqG.js +2 -0
- package/web/assets/{webworkerAll-tVQIHJQB.js.map → webworkerAll-BIhfsOqG.js.map} +1 -1
- package/web/index.html +2 -2
- package/web/assets/browserAll-MBabRn1_.js +0 -2
- package/web/assets/index-K7cJxdMz.js.map +0 -1
- package/web/assets/webworkerAll-tVQIHJQB.js +0 -2
package/dist/index.d.ts
CHANGED
|
@@ -34,9 +34,13 @@ declare class Theatre {
|
|
|
34
34
|
private routes;
|
|
35
35
|
/** Append events to the live session, direct them, and broadcast. */
|
|
36
36
|
ingest(events: AgentEvent[]): Beat[];
|
|
37
|
+
/** In-process subscribers (the VS Code extension relays these to its webview). */
|
|
38
|
+
readonly listeners: Set<(msg: unknown) => void>;
|
|
37
39
|
private broadcast;
|
|
38
40
|
listen(port?: number): Promise<number>;
|
|
39
41
|
close(): Promise<void>;
|
|
42
|
+
/** The live scene as /api/scene returns it. */
|
|
43
|
+
scene(): unknown;
|
|
40
44
|
get url(): string;
|
|
41
45
|
get name(): string;
|
|
42
46
|
}
|
package/dist/index.js
CHANGED
|
@@ -1272,7 +1272,15 @@ var Theatre = class {
|
|
|
1272
1272
|
this.broadcast({ type: "beats", beats: out, events });
|
|
1273
1273
|
return out;
|
|
1274
1274
|
}
|
|
1275
|
+
/** In-process subscribers (the VS Code extension relays these to its webview). */
|
|
1276
|
+
listeners = /* @__PURE__ */ new Set();
|
|
1275
1277
|
broadcast(msg) {
|
|
1278
|
+
for (const l of this.listeners) {
|
|
1279
|
+
try {
|
|
1280
|
+
l(msg);
|
|
1281
|
+
} catch {
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1276
1284
|
const data = JSON.stringify(msg);
|
|
1277
1285
|
for (const ws of this.wss?.clients ?? []) if (ws.readyState === 1) ws.send(data);
|
|
1278
1286
|
}
|
|
@@ -1315,6 +1323,10 @@ var Theatre = class {
|
|
|
1315
1323
|
this.wss?.close();
|
|
1316
1324
|
await new Promise((res) => this.server ? this.server.close(() => res()) : res());
|
|
1317
1325
|
}
|
|
1326
|
+
/** The live scene as /api/scene returns it. */
|
|
1327
|
+
scene() {
|
|
1328
|
+
return { mode: "live", repoId: this.opts.repoId, world: this.live.world, events: this.live.events, beats: this.live.beats, signal: this.signal };
|
|
1329
|
+
}
|
|
1318
1330
|
get url() {
|
|
1319
1331
|
return `http://127.0.0.1:${this.port}/`;
|
|
1320
1332
|
}
|