@ai-ecoverse/slicc-spectrum 1.27.2 → 1.27.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/slicc-ui.js CHANGED
@@ -19815,15 +19815,20 @@ var SliccChat = class extends ThemedElement {
19815
19815
  }),
19816
19816
  model.agent.on("agents", () => this.requestUpdate()),
19817
19817
  model.agent.on("messages", (agentId) => {
19818
- if (agentId === this.#id()) this.#refresh(true);
19818
+ if (agentId === this.#id()) this.#refresh(this.#sent(agentId));
19819
19819
  }),
19820
19820
  model.agent.on("message", ({ agentId }) => {
19821
- if (agentId === this.#id()) this.#refresh(false);
19821
+ if (agentId === this.#id()) this.#refresh(this.#sent(agentId));
19822
19822
  })
19823
19823
  ];
19824
19824
  }
19825
19825
  #stuck = true;
19826
19826
  #last = 0;
19827
+ #tail = "";
19828
+ #sent(agentId) {
19829
+ const last = this.model?.agent.messages(agentId).at(-1);
19830
+ return last?.role === "user" && last.id !== this.#tail && (last.origin ?? "user") === "user";
19831
+ }
19827
19832
  #resize = new ResizeObserver(() => this.#pin());
19828
19833
  #log() {
19829
19834
  return this.renderRoot.querySelector(".log");
@@ -19967,6 +19972,7 @@ var SliccChat = class extends ThemedElement {
19967
19972
  const agent = this.#agent();
19968
19973
  this.#handlers.readOnly = !!agent?.frozen;
19969
19974
  const messages = agent ? this.model?.agent.messages(agent.id) ?? [] : [];
19975
+ this.#tail = messages.at(-1)?.id ?? "";
19970
19976
  return b`
19971
19977
  <header>
19972
19978
  ${agent ? this.#meta(agent) : b`<span>No agent</span>`}