@copilotkit/web-inspector 1.55.2-next.1 → 1.55.3-canary.1776215089
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/CHANGELOG.md +6 -0
- package/dist/index.cjs +22 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +22 -8
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +22 -8
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/web-inspector.spec.ts +112 -35
- package/src/index.ts +41 -16
package/CHANGELOG.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -398,6 +398,9 @@ var WebInspectorElement = class extends lit.LitElement {
|
|
|
398
398
|
onAgentsChanged: ({ agents }) => {
|
|
399
399
|
this.processAgentsChanged(agents);
|
|
400
400
|
},
|
|
401
|
+
onAgentRunStarted: ({ agent }) => {
|
|
402
|
+
if (agent?.agentId) this.subscribeToAgent(agent);
|
|
403
|
+
},
|
|
401
404
|
onContextChanged: ({ context }) => {
|
|
402
405
|
this.contextStore = this.normalizeContextStore(context);
|
|
403
406
|
this.requestUpdate();
|
|
@@ -548,6 +551,9 @@ var WebInspectorElement = class extends lit.LitElement {
|
|
|
548
551
|
onMessagesChanged: () => {
|
|
549
552
|
this.syncAgentMessages(agent);
|
|
550
553
|
},
|
|
554
|
+
onStateChanged: () => {
|
|
555
|
+
this.syncAgentState(agent);
|
|
556
|
+
},
|
|
551
557
|
onRawEvent: ({ event }) => {
|
|
552
558
|
this.recordAgentEvent(agentId, "RAW_EVENT", event);
|
|
553
559
|
},
|
|
@@ -609,17 +615,25 @@ var WebInspectorElement = class extends lit.LitElement {
|
|
|
609
615
|
}
|
|
610
616
|
syncAgentMessages(agent) {
|
|
611
617
|
if (!agent?.agentId) return;
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
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
|
+
}
|
|
616
626
|
}
|
|
617
627
|
syncAgentState(agent) {
|
|
618
628
|
if (!agent?.agentId) return;
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
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
|
+
}
|
|
623
637
|
}
|
|
624
638
|
updateContextOptions(agentIds) {
|
|
625
639
|
const nextOptions = [{
|