@copilotkit/web-inspector 1.56.1 → 1.56.2-canary.test-welcome-screen

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/index.cjs CHANGED
@@ -551,6 +551,9 @@ var WebInspectorElement = class extends lit.LitElement {
551
551
  onMessagesChanged: () => {
552
552
  this.syncAgentMessages(agent);
553
553
  },
554
+ onStateChanged: () => {
555
+ this.syncAgentState(agent);
556
+ },
554
557
  onRawEvent: ({ event }) => {
555
558
  this.recordAgentEvent(agentId, "RAW_EVENT", event);
556
559
  },
@@ -612,17 +615,25 @@ var WebInspectorElement = class extends lit.LitElement {
612
615
  }
613
616
  syncAgentMessages(agent) {
614
617
  if (!agent?.agentId) return;
615
- const messages = this.normalizeAgentMessages(agent.messages);
616
- if (messages) this.agentMessages.set(agent.agentId, messages);
617
- else this.agentMessages.delete(agent.agentId);
618
- this.requestUpdate();
618
+ try {
619
+ const messages = this.normalizeAgentMessages(agent.messages);
620
+ if (messages) this.agentMessages.set(agent.agentId, messages);
621
+ else this.agentMessages.delete(agent.agentId);
622
+ this.requestUpdate();
623
+ } catch (error) {
624
+ console.error(`[CopilotKit Inspector] Failed to sync messages for agent "${agent.agentId}":`, error);
625
+ }
619
626
  }
620
627
  syncAgentState(agent) {
621
628
  if (!agent?.agentId) return;
622
- const state = agent.state;
623
- if (state === void 0 || state === null) this.agentStates.delete(agent.agentId);
624
- else this.agentStates.set(agent.agentId, this.sanitizeForLogging(state));
625
- this.requestUpdate();
629
+ try {
630
+ const state = agent.state;
631
+ if (state === void 0 || state === null) this.agentStates.delete(agent.agentId);
632
+ else this.agentStates.set(agent.agentId, this.sanitizeForLogging(state));
633
+ this.requestUpdate();
634
+ } catch (error) {
635
+ console.error(`[CopilotKit Inspector] Failed to sync state for agent "${agent.agentId}":`, error);
636
+ }
626
637
  }
627
638
  updateContextOptions(agentIds) {
628
639
  const nextOptions = [{