- expose agent to window in testbed

- ts-ignore setTimeout line causing errors
This commit is contained in:
Elijah R 2024-07-09 23:29:21 -04:00
parent 8d029c682f
commit 36ad3fe178
2 changed files with 3 additions and 2 deletions

View file

@ -37,7 +37,7 @@ class AgentAnimationState {
this.char.animationFinished(); this.char.animationFinished();
return; return;
} }
//@ts-ignore
this.interval = setTimeout(() => { this.interval = setTimeout(() => {
this.nextFrame(); this.nextFrame();
}, this.anim.frameInfo[this.frameIndex].frameDuration * 10) }, this.anim.frameInfo[this.frameIndex].frameDuration * 10)

View file

@ -2,7 +2,7 @@
// This will go away when it isn't needed // This will go away when it isn't needed
import * as msagent from "@msagent-chat/msagent.js"; import * as msagent from "@msagent-chat/msagent.js";
let w = window as any;
let input = document.getElementById("testbed-input") as HTMLInputElement; let input = document.getElementById("testbed-input") as HTMLInputElement;
input.addEventListener("change", async () => { input.addEventListener("change", async () => {
@ -10,6 +10,7 @@ input.addEventListener("change", async () => {
console.log("About to parse character"); console.log("About to parse character");
let agent = msagent.agentParseCharacterTestbed(new Uint8Array(buffer)); let agent = msagent.agentParseCharacterTestbed(new Uint8Array(buffer));
w.agent = agent;
agent.addToDom(document.body); agent.addToDom(document.body);
agent.show(); agent.show();