@copilotkitnext/web-inspector 1.51.4-next.7 → 1.51.4-next.8

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.mjs CHANGED
@@ -36,15 +36,26 @@ function clampSize(size, viewport, edgeMargin, minWidth, minHeight) {
36
36
  };
37
37
  }
38
38
  function constrainToViewport(state, position, viewport, edgeMargin) {
39
- const maxX = Math.max(edgeMargin, viewport.width - state.size.width - edgeMargin);
40
- const maxY = Math.max(edgeMargin, viewport.height - state.size.height - edgeMargin);
39
+ const maxX = Math.max(
40
+ edgeMargin,
41
+ viewport.width - state.size.width - edgeMargin
42
+ );
43
+ const maxY = Math.max(
44
+ edgeMargin,
45
+ viewport.height - state.size.height - edgeMargin
46
+ );
41
47
  return {
42
48
  x: clamp(position.x, edgeMargin, maxX),
43
49
  y: clamp(position.y, edgeMargin, maxY)
44
50
  };
45
51
  }
46
52
  function keepPositionWithinViewport(state, viewport, edgeMargin) {
47
- state.position = constrainToViewport(state, state.position, viewport, edgeMargin);
53
+ state.position = constrainToViewport(
54
+ state,
55
+ state.position,
56
+ viewport,
57
+ edgeMargin
58
+ );
48
59
  }
49
60
  function centerContext(state, viewport, edgeMargin) {
50
61
  const centered = {
@@ -61,18 +72,46 @@ function updateAnchorFromPosition(state, viewport, edgeMargin) {
61
72
  const horizontal = centerX < viewport.width / 2 ? "left" : "right";
62
73
  const vertical = centerY < viewport.height / 2 ? "top" : "bottom";
63
74
  state.anchor = { horizontal, vertical };
64
- const maxHorizontalOffset = Math.max(edgeMargin, viewport.width - state.size.width - edgeMargin);
65
- const maxVerticalOffset = Math.max(edgeMargin, viewport.height - state.size.height - edgeMargin);
75
+ const maxHorizontalOffset = Math.max(
76
+ edgeMargin,
77
+ viewport.width - state.size.width - edgeMargin
78
+ );
79
+ const maxVerticalOffset = Math.max(
80
+ edgeMargin,
81
+ viewport.height - state.size.height - edgeMargin
82
+ );
66
83
  state.anchorOffset = {
67
- x: horizontal === "left" ? clamp(state.position.x, edgeMargin, maxHorizontalOffset) : clamp(viewport.width - state.position.x - state.size.width, edgeMargin, maxHorizontalOffset),
68
- y: vertical === "top" ? clamp(state.position.y, edgeMargin, maxVerticalOffset) : clamp(viewport.height - state.position.y - state.size.height, edgeMargin, maxVerticalOffset)
84
+ x: horizontal === "left" ? clamp(state.position.x, edgeMargin, maxHorizontalOffset) : clamp(
85
+ viewport.width - state.position.x - state.size.width,
86
+ edgeMargin,
87
+ maxHorizontalOffset
88
+ ),
89
+ y: vertical === "top" ? clamp(state.position.y, edgeMargin, maxVerticalOffset) : clamp(
90
+ viewport.height - state.position.y - state.size.height,
91
+ edgeMargin,
92
+ maxVerticalOffset
93
+ )
69
94
  };
70
95
  }
71
96
  function applyAnchorPosition(state, viewport, edgeMargin) {
72
- const maxHorizontalOffset = Math.max(edgeMargin, viewport.width - state.size.width - edgeMargin);
73
- const maxVerticalOffset = Math.max(edgeMargin, viewport.height - state.size.height - edgeMargin);
74
- const horizontalOffset = clamp(state.anchorOffset.x, edgeMargin, maxHorizontalOffset);
75
- const verticalOffset = clamp(state.anchorOffset.y, edgeMargin, maxVerticalOffset);
97
+ const maxHorizontalOffset = Math.max(
98
+ edgeMargin,
99
+ viewport.width - state.size.width - edgeMargin
100
+ );
101
+ const maxVerticalOffset = Math.max(
102
+ edgeMargin,
103
+ viewport.height - state.size.height - edgeMargin
104
+ );
105
+ const horizontalOffset = clamp(
106
+ state.anchorOffset.x,
107
+ edgeMargin,
108
+ maxHorizontalOffset
109
+ );
110
+ const verticalOffset = clamp(
111
+ state.anchorOffset.y,
112
+ edgeMargin,
113
+ maxVerticalOffset
114
+ );
76
115
  const x = state.anchor.horizontal === "left" ? horizontalOffset : viewport.width - state.size.width - horizontalOffset;
77
116
  const y = state.anchor.vertical === "top" ? verticalOffset : viewport.height - state.size.height - verticalOffset;
78
117
  state.anchorOffset = { x: horizontalOffset, y: verticalOffset };
@@ -288,7 +327,10 @@ var WebInspectorElement = class extends LitElement {
288
327
  if (this.pointerId !== event.pointerId || !this.dragStart || !this.pointerContext) {
289
328
  return;
290
329
  }
291
- const distance = Math.hypot(event.clientX - this.dragStart.x, event.clientY - this.dragStart.y);
330
+ const distance = Math.hypot(
331
+ event.clientX - this.dragStart.x,
332
+ event.clientY - this.dragStart.y
333
+ );
292
334
  if (!this.isDragging && distance < DRAG_THRESHOLD) {
293
335
  return;
294
336
  }
@@ -460,7 +502,9 @@ var WebInspectorElement = class extends LitElement {
460
502
  this.flattenedEvents = [];
461
503
  } else {
462
504
  this.agentEvents.delete(this.selectedContext);
463
- this.flattenedEvents = this.flattenedEvents.filter((event) => event.agentId !== this.selectedContext);
505
+ this.flattenedEvents = this.flattenedEvents.filter(
506
+ (event) => event.agentId !== this.selectedContext
507
+ );
464
508
  }
465
509
  this.expandedRows.clear();
466
510
  this.copiedEvents.clear();
@@ -643,19 +687,39 @@ var WebInspectorElement = class extends LitElement {
643
687
  this.recordAgentEvent(agentId, "TEXT_MESSAGE_START", event);
644
688
  },
645
689
  onTextMessageContentEvent: ({ event, textMessageBuffer }) => {
646
- this.recordAgentEvent(agentId, "TEXT_MESSAGE_CONTENT", { event, textMessageBuffer });
690
+ this.recordAgentEvent(agentId, "TEXT_MESSAGE_CONTENT", {
691
+ event,
692
+ textMessageBuffer
693
+ });
647
694
  },
648
695
  onTextMessageEndEvent: ({ event, textMessageBuffer }) => {
649
- this.recordAgentEvent(agentId, "TEXT_MESSAGE_END", { event, textMessageBuffer });
696
+ this.recordAgentEvent(agentId, "TEXT_MESSAGE_END", {
697
+ event,
698
+ textMessageBuffer
699
+ });
650
700
  },
651
701
  onToolCallStartEvent: ({ event }) => {
652
702
  this.recordAgentEvent(agentId, "TOOL_CALL_START", event);
653
703
  },
654
- onToolCallArgsEvent: ({ event, toolCallBuffer, toolCallName, partialToolCallArgs }) => {
655
- this.recordAgentEvent(agentId, "TOOL_CALL_ARGS", { event, toolCallBuffer, toolCallName, partialToolCallArgs });
704
+ onToolCallArgsEvent: ({
705
+ event,
706
+ toolCallBuffer,
707
+ toolCallName,
708
+ partialToolCallArgs
709
+ }) => {
710
+ this.recordAgentEvent(agentId, "TOOL_CALL_ARGS", {
711
+ event,
712
+ toolCallBuffer,
713
+ toolCallName,
714
+ partialToolCallArgs
715
+ });
656
716
  },
657
717
  onToolCallEndEvent: ({ event, toolCallArgs, toolCallName }) => {
658
- this.recordAgentEvent(agentId, "TOOL_CALL_END", { event, toolCallArgs, toolCallName });
718
+ this.recordAgentEvent(agentId, "TOOL_CALL_END", {
719
+ event,
720
+ toolCallArgs,
721
+ toolCallName
722
+ });
659
723
  },
660
724
  onToolCallResultEvent: ({ event }) => {
661
725
  this.recordAgentEvent(agentId, "TOOL_CALL_RESULT", event);
@@ -708,9 +772,15 @@ var WebInspectorElement = class extends LitElement {
708
772
  payload: normalizedPayload
709
773
  };
710
774
  const currentAgentEvents = this.agentEvents.get(agentId) ?? [];
711
- const nextAgentEvents = [event, ...currentAgentEvents].slice(0, MAX_AGENT_EVENTS);
775
+ const nextAgentEvents = [event, ...currentAgentEvents].slice(
776
+ 0,
777
+ MAX_AGENT_EVENTS
778
+ );
712
779
  this.agentEvents.set(agentId, nextAgentEvents);
713
- this.flattenedEvents = [event, ...this.flattenedEvents].slice(0, MAX_TOTAL_EVENTS);
780
+ this.flattenedEvents = [event, ...this.flattenedEvents].slice(
781
+ 0,
782
+ MAX_TOTAL_EVENTS
783
+ );
714
784
  this.refreshToolsSnapshot();
715
785
  this.requestUpdate();
716
786
  }
@@ -718,7 +788,9 @@ var WebInspectorElement = class extends LitElement {
718
788
  if (!agent?.agentId) {
719
789
  return;
720
790
  }
721
- const messages = this.normalizeAgentMessages(agent.messages);
791
+ const messages = this.normalizeAgentMessages(
792
+ agent.messages
793
+ );
722
794
  if (messages) {
723
795
  this.agentMessages.set(agent.agentId, messages);
724
796
  } else {
@@ -743,7 +815,9 @@ var WebInspectorElement = class extends LitElement {
743
815
  { key: "all-agents", label: "All Agents" },
744
816
  ...Array.from(agentIds).sort((a, b) => a.localeCompare(b)).map((id) => ({ key: id, label: id }))
745
817
  ];
746
- const optionsChanged = this.contextOptions.length !== nextOptions.length || this.contextOptions.some((option, index) => option.key !== nextOptions[index]?.key);
818
+ const optionsChanged = this.contextOptions.length !== nextOptions.length || this.contextOptions.some(
819
+ (option, index) => option.key !== nextOptions[index]?.key
820
+ );
747
821
  if (optionsChanged) {
748
822
  this.contextOptions = nextOptions;
749
823
  }
@@ -760,13 +834,17 @@ var WebInspectorElement = class extends LitElement {
760
834
  this.pendingSelectedContext = null;
761
835
  }
762
836
  }
763
- const hasSelectedContext = nextOptions.some((option) => option.key === this.selectedContext);
837
+ const hasSelectedContext = nextOptions.some(
838
+ (option) => option.key === this.selectedContext
839
+ );
764
840
  if (!hasSelectedContext && this.pendingSelectedContext === null) {
765
841
  let nextSelected = "all-agents";
766
842
  if (agentIds.has("default")) {
767
843
  nextSelected = "default";
768
844
  } else if (agentIds.size > 0) {
769
- nextSelected = Array.from(agentIds).sort((a, b) => a.localeCompare(b))[0];
845
+ nextSelected = Array.from(agentIds).sort(
846
+ (a, b) => a.localeCompare(b)
847
+ )[0];
770
848
  }
771
849
  if (this.selectedContext !== nextSelected) {
772
850
  this.selectedContext = nextSelected;
@@ -790,7 +868,10 @@ var WebInspectorElement = class extends LitElement {
790
868
  if (!query) {
791
869
  return true;
792
870
  }
793
- const payloadText = this.stringifyPayload(event.payload, false).toLowerCase();
871
+ const payloadText = this.stringifyPayload(
872
+ event.payload,
873
+ false
874
+ ).toLowerCase();
794
875
  return event.type.toLowerCase().includes(query) || event.agentId.toLowerCase().includes(query) || payloadText.includes(query);
795
876
  });
796
877
  }
@@ -815,7 +896,9 @@ var WebInspectorElement = class extends LitElement {
815
896
  if (events.length === 0) {
816
897
  return "idle";
817
898
  }
818
- const runEvent = events.find((e) => e.type === "RUN_STARTED" || e.type === "RUN_FINISHED" || e.type === "RUN_ERROR");
899
+ const runEvent = events.find(
900
+ (e) => e.type === "RUN_STARTED" || e.type === "RUN_FINISHED" || e.type === "RUN_ERROR"
901
+ );
819
902
  if (!runEvent) {
820
903
  return "idle";
821
904
  }
@@ -833,7 +916,10 @@ var WebInspectorElement = class extends LitElement {
833
916
  getAgentStats(agentId) {
834
917
  const events = this.agentEvents.get(agentId) ?? [];
835
918
  const messages = this.agentMessages.get(agentId);
836
- const toolCallCount = messages ? messages.reduce((count, message) => count + (message.toolCalls?.length ?? 0), 0) : events.filter((e) => e.type === "TOOL_CALL_END").length;
919
+ const toolCallCount = messages ? messages.reduce(
920
+ (count, message) => count + (message.toolCalls?.length ?? 0),
921
+ 0
922
+ ) : events.filter((e) => e.type === "TOOL_CALL_END").length;
837
923
  const messageCount = messages?.length ?? 0;
838
924
  return {
839
925
  totalEvents: events.length,
@@ -852,14 +938,24 @@ var WebInspectorElement = class extends LitElement {
852
938
  ${toolCalls.map((call, index) => {
853
939
  const functionName = call.function?.name ?? call.toolName ?? "Unknown function";
854
940
  const callId = typeof call?.id === "string" ? call.id : `tool-call-${index + 1}`;
855
- const argsString = this.formatToolCallArguments(call.function?.arguments);
941
+ const argsString = this.formatToolCallArguments(
942
+ call.function?.arguments
943
+ );
856
944
  return html`
857
- <div class="rounded-md border border-gray-200 bg-gray-50 p-3 text-xs text-gray-700">
858
- <div class="flex flex-wrap items-center justify-between gap-1 font-medium text-gray-900">
945
+ <div
946
+ class="rounded-md border border-gray-200 bg-gray-50 p-3 text-xs text-gray-700"
947
+ >
948
+ <div
949
+ class="flex flex-wrap items-center justify-between gap-1 font-medium text-gray-900"
950
+ >
859
951
  <span>${functionName}</span>
860
952
  <span class="text-[10px] text-gray-500">ID: ${callId}</span>
861
953
  </div>
862
- ${argsString ? html`<pre class="mt-2 overflow-auto rounded bg-white p-2 text-[11px] leading-relaxed text-gray-800">${argsString}</pre>` : nothing}
954
+ ${argsString ? html`<pre
955
+ class="mt-2 overflow-auto rounded bg-white p-2 text-[11px] leading-relaxed text-gray-800"
956
+ >
957
+ ${argsString}</pre
958
+ >` : nothing}
863
959
  </div>
864
960
  `;
865
961
  })}
@@ -1011,7 +1107,9 @@ var WebInspectorElement = class extends LitElement {
1011
1107
  }
1012
1108
 
1013
1109
  .inspector-window[data-transitioning="true"] {
1014
- transition: width 300ms ease, height 300ms ease;
1110
+ transition:
1111
+ width 300ms ease,
1112
+ height 300ms ease;
1015
1113
  }
1016
1114
 
1017
1115
  .inspector-window[data-docked="true"] {
@@ -1056,7 +1154,9 @@ var WebInspectorElement = class extends LitElement {
1056
1154
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
1057
1155
  opacity: 0;
1058
1156
  pointer-events: none;
1059
- transition: opacity 120ms ease, transform 120ms ease;
1157
+ transition:
1158
+ opacity 120ms ease,
1159
+ transform 120ms ease;
1060
1160
  z-index: 4000;
1061
1161
  }
1062
1162
 
@@ -1128,7 +1228,9 @@ var WebInspectorElement = class extends LitElement {
1128
1228
  border-radius: 8px;
1129
1229
  border: 1px solid rgba(148, 163, 184, 0.5);
1130
1230
  background: rgba(248, 250, 252, 0.9);
1131
- transition: background 120ms ease, color 120ms ease;
1231
+ transition:
1232
+ background 120ms ease,
1233
+ color 120ms ease;
1132
1234
  }
1133
1235
 
1134
1236
  .announcement-dismiss:hover {
@@ -1188,7 +1290,10 @@ var WebInspectorElement = class extends LitElement {
1188
1290
  super.connectedCallback();
1189
1291
  if (typeof window !== "undefined") {
1190
1292
  window.addEventListener("resize", this.handleResize);
1191
- window.addEventListener("pointerdown", this.handleGlobalPointerDown);
1293
+ window.addEventListener(
1294
+ "pointerdown",
1295
+ this.handleGlobalPointerDown
1296
+ );
1192
1297
  this.hydrateStateFromStorageEarly();
1193
1298
  this.tryAutoAttachCore();
1194
1299
  this.ensureAnnouncementLoading();
@@ -1198,7 +1303,10 @@ var WebInspectorElement = class extends LitElement {
1198
1303
  super.disconnectedCallback();
1199
1304
  if (typeof window !== "undefined") {
1200
1305
  window.removeEventListener("resize", this.handleResize);
1201
- window.removeEventListener("pointerdown", this.handleGlobalPointerDown);
1306
+ window.removeEventListener(
1307
+ "pointerdown",
1308
+ this.handleGlobalPointerDown
1309
+ );
1202
1310
  }
1203
1311
  this.removeDockStyles();
1204
1312
  this.detachFromCore();
@@ -1281,7 +1389,12 @@ var WebInspectorElement = class extends LitElement {
1281
1389
  @click=${this.handleButtonClick}
1282
1390
  >
1283
1391
  ${this.renderAnnouncementPreview()}
1284
- <img src=${inspector_logo_icon_default} alt="Inspector logo" class="h-5 w-auto" loading="lazy" />
1392
+ <img
1393
+ src=${inspector_logo_icon_default}
1394
+ alt="Inspector logo"
1395
+ class="h-5 w-auto"
1396
+ loading="lazy"
1397
+ />
1285
1398
  </button>
1286
1399
  `;
1287
1400
  }
@@ -1299,7 +1412,9 @@ var WebInspectorElement = class extends LitElement {
1299
1412
  const contextDropdown = hasContextDropdown ? this.renderContextDropdown() : nothing;
1300
1413
  const coreStatus = this.getCoreStatusSummary();
1301
1414
  const agentSelector = hasContextDropdown ? contextDropdown : html`
1302
- <div class="flex items-center gap-2 rounded-md border border-dashed border-gray-200 px-2 py-1 text-xs text-gray-400">
1415
+ <div
1416
+ class="flex items-center gap-2 rounded-md border border-dashed border-gray-200 px-2 py-1 text-xs text-gray-400"
1417
+ >
1303
1418
  <span>${this.renderIcon("Bot")}</span>
1304
1419
  <span class="truncate">No agents available</span>
1305
1420
  </div>
@@ -1322,7 +1437,9 @@ var WebInspectorElement = class extends LitElement {
1322
1437
  @pointercancel=${this.handleResizePointerCancel}
1323
1438
  ></div>
1324
1439
  ` : nothing}
1325
- <div class="flex flex-1 flex-col overflow-hidden bg-white text-gray-800">
1440
+ <div
1441
+ class="flex flex-1 flex-col overflow-hidden bg-white text-gray-800"
1442
+ >
1326
1443
  <div
1327
1444
  class="drag-handle relative z-30 flex flex-col border-b border-gray-200 bg-white/95 backdrop-blur-sm ${isDocked ? "" : this.isDragging && this.pointerContext === "window" ? "cursor-grabbing" : "cursor-grab"}"
1328
1445
  data-drag-context="window"
@@ -1333,12 +1450,15 @@ var WebInspectorElement = class extends LitElement {
1333
1450
  >
1334
1451
  <div class="flex flex-wrap items-center gap-3 px-4 py-3">
1335
1452
  <div class="flex items-center min-w-0">
1336
- <img src=${inspector_logo_default} alt="Inspector logo" class="h-6 w-auto" loading="lazy" />
1453
+ <img
1454
+ src=${inspector_logo_default}
1455
+ alt="Inspector logo"
1456
+ class="h-6 w-auto"
1457
+ loading="lazy"
1458
+ />
1337
1459
  </div>
1338
1460
  <div class="ml-auto flex min-w-0 items-center gap-2">
1339
- <div class="min-w-[160px] max-w-xs">
1340
- ${agentSelector}
1341
- </div>
1461
+ <div class="min-w-[160px] max-w-xs">${agentSelector}</div>
1342
1462
  <div class="flex items-center gap-1">
1343
1463
  ${this.renderDockControls()}
1344
1464
  <button
@@ -1353,7 +1473,9 @@ var WebInspectorElement = class extends LitElement {
1353
1473
  </div>
1354
1474
  </div>
1355
1475
  </div>
1356
- <div class="flex flex-wrap items-center gap-2 border-t border-gray-100 px-3 py-2 text-xs">
1476
+ <div
1477
+ class="flex flex-wrap items-center gap-2 border-t border-gray-100 px-3 py-2 text-xs"
1478
+ >
1357
1479
  ${this.menuItems.map(({ key, label, icon }) => {
1358
1480
  const isSelected = this.selectedMenu === key;
1359
1481
  const tabClasses = [
@@ -1367,7 +1489,9 @@ var WebInspectorElement = class extends LitElement {
1367
1489
  aria-pressed=${isSelected}
1368
1490
  @click=${() => this.handleMenuSelect(key)}
1369
1491
  >
1370
- <span class="text-gray-400 ${isSelected ? "text-white" : ""}">
1492
+ <span
1493
+ class="text-gray-400 ${isSelected ? "text-white" : ""}"
1494
+ >
1371
1495
  ${this.renderIcon(icon)}
1372
1496
  </span>
1373
1497
  <span>${label}</span>
@@ -1376,27 +1500,30 @@ var WebInspectorElement = class extends LitElement {
1376
1500
  })}
1377
1501
  </div>
1378
1502
  </div>
1379
- <div class="flex flex-1 flex-col overflow-hidden">
1380
- <div class="flex-1 overflow-auto">
1381
- ${this.renderAnnouncementPanel()}
1382
- ${this.renderCoreWarningBanner()}
1383
- ${this.renderMainContent()}
1384
- <slot></slot>
1385
- </div>
1386
- <div class="border-t border-gray-200 bg-gray-50 px-4 py-2">
1387
- <div
1388
- class="flex items-center gap-2 rounded-md px-3 py-2 text-xs ${coreStatus.tone} w-full overflow-hidden my-1"
1389
- title=${coreStatus.description}
1503
+ <div class="flex flex-1 flex-col overflow-hidden">
1504
+ <div class="flex-1 overflow-auto">
1505
+ ${this.renderAnnouncementPanel()}
1506
+ ${this.renderCoreWarningBanner()} ${this.renderMainContent()}
1507
+ <slot></slot>
1508
+ </div>
1509
+ <div class="border-t border-gray-200 bg-gray-50 px-4 py-2">
1510
+ <div
1511
+ class="flex items-center gap-2 rounded-md px-3 py-2 text-xs ${coreStatus.tone} w-full overflow-hidden my-1"
1512
+ title=${coreStatus.description}
1513
+ >
1514
+ <span
1515
+ class="flex h-6 w-6 items-center justify-center rounded bg-white/60"
1516
+ >
1517
+ ${this.renderIcon("Activity")}
1518
+ </span>
1519
+ <span class="font-medium">${coreStatus.label}</span>
1520
+ <span class="truncate text-[11px] opacity-80"
1521
+ >${coreStatus.description}</span
1390
1522
  >
1391
- <span class="flex h-6 w-6 items-center justify-center rounded bg-white/60">
1392
- ${this.renderIcon("Activity")}
1393
- </span>
1394
- <span class="font-medium">${coreStatus.label}</span>
1395
- <span class="truncate text-[11px] opacity-80">${coreStatus.description}</span>
1396
- </div>
1397
1523
  </div>
1398
1524
  </div>
1399
1525
  </div>
1526
+ </div>
1400
1527
  <div
1401
1528
  class="resize-handle pointer-events-auto absolute bottom-1 right-1 flex h-5 w-5 cursor-nwse-resize items-center justify-center text-gray-400 transition hover:text-gray-600"
1402
1529
  role="presentation"
@@ -1436,7 +1563,9 @@ var WebInspectorElement = class extends LitElement {
1436
1563
  this.dockMode = persisted.dockMode;
1437
1564
  }
1438
1565
  if (typeof persisted.selectedMenu === "string") {
1439
- const validMenu = this.menuItems.find((item) => item.key === persisted.selectedMenu);
1566
+ const validMenu = this.menuItems.find(
1567
+ (item) => item.key === persisted.selectedMenu
1568
+ );
1440
1569
  if (validMenu) {
1441
1570
  this.selectedMenu = validMenu.key;
1442
1571
  }
@@ -1475,7 +1604,9 @@ var WebInspectorElement = class extends LitElement {
1475
1604
  this.contextState.window.anchorOffset = persistedWindow.anchorOffset;
1476
1605
  }
1477
1606
  if (isValidSize(persistedWindow.size)) {
1478
- this.contextState.window.size = this.clampWindowSize(persistedWindow.size);
1607
+ this.contextState.window.size = this.clampWindowSize(
1608
+ persistedWindow.size
1609
+ );
1479
1610
  }
1480
1611
  if (typeof persistedWindow.hasCustomPosition === "boolean") {
1481
1612
  this.hasCustomPosition.window = persistedWindow.hasCustomPosition;
@@ -1491,7 +1622,9 @@ var WebInspectorElement = class extends LitElement {
1491
1622
  }
1492
1623
  measureContext(context) {
1493
1624
  const selector = context === "window" ? ".inspector-window" : ".console-button";
1494
- const element = this.renderRoot?.querySelector(selector);
1625
+ const element = this.renderRoot?.querySelector(
1626
+ selector
1627
+ );
1495
1628
  if (!element) {
1496
1629
  return;
1497
1630
  }
@@ -1520,7 +1653,11 @@ var WebInspectorElement = class extends LitElement {
1520
1653
  }
1521
1654
  const viewport = this.getViewportSize();
1522
1655
  keepPositionWithinViewport(this.contextState.window, viewport, EDGE_MARGIN);
1523
- updateAnchorFromPosition(this.contextState.window, viewport, EDGE_MARGIN);
1656
+ updateAnchorFromPosition(
1657
+ this.contextState.window,
1658
+ viewport,
1659
+ EDGE_MARGIN
1660
+ );
1524
1661
  this.updateHostTransform("window");
1525
1662
  this.persistState();
1526
1663
  }
@@ -1529,14 +1666,23 @@ var WebInspectorElement = class extends LitElement {
1529
1666
  return position;
1530
1667
  }
1531
1668
  const viewport = this.getViewportSize();
1532
- return constrainToViewport(this.contextState[context], position, viewport, EDGE_MARGIN);
1669
+ return constrainToViewport(
1670
+ this.contextState[context],
1671
+ position,
1672
+ viewport,
1673
+ EDGE_MARGIN
1674
+ );
1533
1675
  }
1534
1676
  keepPositionWithinViewport(context) {
1535
1677
  if (typeof window === "undefined") {
1536
1678
  return;
1537
1679
  }
1538
1680
  const viewport = this.getViewportSize();
1539
- keepPositionWithinViewport(this.contextState[context], viewport, EDGE_MARGIN);
1681
+ keepPositionWithinViewport(
1682
+ this.contextState[context],
1683
+ viewport,
1684
+ EDGE_MARGIN
1685
+ );
1540
1686
  }
1541
1687
  getViewportSize() {
1542
1688
  if (typeof window === "undefined") {
@@ -1577,7 +1723,13 @@ var WebInspectorElement = class extends LitElement {
1577
1723
  };
1578
1724
  }
1579
1725
  const viewport = this.getViewportSize();
1580
- return clampSize(size, viewport, EDGE_MARGIN, minWidth, MIN_WINDOW_HEIGHT);
1726
+ return clampSize(
1727
+ size,
1728
+ viewport,
1729
+ EDGE_MARGIN,
1730
+ minWidth,
1731
+ MIN_WINDOW_HEIGHT
1732
+ );
1581
1733
  }
1582
1734
  setDockMode(mode) {
1583
1735
  if (this.dockMode === mode) {
@@ -1675,7 +1827,11 @@ var WebInspectorElement = class extends LitElement {
1675
1827
  return;
1676
1828
  }
1677
1829
  const viewport = this.getViewportSize();
1678
- updateAnchorFromPosition(this.contextState[context], viewport, EDGE_MARGIN);
1830
+ updateAnchorFromPosition(
1831
+ this.contextState[context],
1832
+ viewport,
1833
+ EDGE_MARGIN
1834
+ );
1679
1835
  }
1680
1836
  snapButtonToCorner() {
1681
1837
  if (typeof window === "undefined") {
@@ -1697,7 +1853,11 @@ var WebInspectorElement = class extends LitElement {
1697
1853
  return;
1698
1854
  }
1699
1855
  const viewport = this.getViewportSize();
1700
- applyAnchorPosition(this.contextState[context], viewport, EDGE_MARGIN);
1856
+ applyAnchorPosition(
1857
+ this.contextState[context],
1858
+ viewport,
1859
+ EDGE_MARGIN
1860
+ );
1701
1861
  this.updateHostTransform(context);
1702
1862
  this.persistState();
1703
1863
  }
@@ -1825,7 +1985,11 @@ var WebInspectorElement = class extends LitElement {
1825
1985
  this.setDockMode(mode);
1826
1986
  }
1827
1987
  serializeAttributes(attributes) {
1828
- return Object.entries(attributes).filter(([key, value]) => key !== "key" && value !== void 0 && value !== null && value !== "").map(([key, value]) => `${key}="${String(value).replace(/"/g, "&quot;")}"`).join(" ");
1988
+ return Object.entries(attributes).filter(
1989
+ ([key, value]) => key !== "key" && value !== void 0 && value !== null && value !== ""
1990
+ ).map(
1991
+ ([key, value]) => `${key}="${String(value).replace(/"/g, "&quot;")}"`
1992
+ ).join(" ");
1829
1993
  }
1830
1994
  sanitizeForLogging(value, depth = 0, seen = /* @__PURE__ */ new WeakSet()) {
1831
1995
  if (value === void 0) {
@@ -1847,7 +2011,9 @@ var WebInspectorElement = class extends LitElement {
1847
2011
  if (depth >= 4) {
1848
2012
  return "[Truncated depth]";
1849
2013
  }
1850
- return value.map((item) => this.sanitizeForLogging(item, depth + 1, seen));
2014
+ return value.map(
2015
+ (item) => this.sanitizeForLogging(item, depth + 1, seen)
2016
+ );
1851
2017
  }
1852
2018
  if (typeof value === "object") {
1853
2019
  if (seen.has(value)) {
@@ -1858,7 +2024,9 @@ var WebInspectorElement = class extends LitElement {
1858
2024
  return "[Truncated depth]";
1859
2025
  }
1860
2026
  const result = {};
1861
- for (const [key, entry] of Object.entries(value)) {
2027
+ for (const [key, entry] of Object.entries(
2028
+ value
2029
+ )) {
1862
2030
  result[key] = this.sanitizeForLogging(entry, depth + 1, seen);
1863
2031
  }
1864
2032
  return result;
@@ -1969,12 +2137,19 @@ var WebInspectorElement = class extends LitElement {
1969
2137
  return nothing;
1970
2138
  }
1971
2139
  return html`
1972
- <div class="mx-4 my-3 flex items-start gap-2 rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800">
1973
- <span class="mt-0.5 shrink-0 text-amber-600">${this.renderIcon("AlertTriangle")}</span>
2140
+ <div
2141
+ class="mx-4 my-3 flex items-start gap-2 rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800"
2142
+ >
2143
+ <span class="mt-0.5 shrink-0 text-amber-600"
2144
+ >${this.renderIcon("AlertTriangle")}</span
2145
+ >
1974
2146
  <div class="space-y-1">
1975
- <div class="font-semibold text-amber-900">CopilotKit core not attached</div>
2147
+ <div class="font-semibold text-amber-900">
2148
+ CopilotKit core not attached
2149
+ </div>
1976
2150
  <p class="text-[11px] leading-snug text-amber-800">
1977
- Pass a live <code>CopilotKitCore</code> instance to <code>&lt;cpk-web-inspector&gt;</code> or expose it on
2151
+ Pass a live <code>CopilotKitCore</code> instance to
2152
+ <code>&lt;cpk-web-inspector&gt;</code> or expose it on
1978
2153
  <code>window.__COPILOTKIT_CORE__</code> for auto-attach.
1979
2154
  </p>
1980
2155
  </div>
@@ -2039,25 +2214,37 @@ var WebInspectorElement = class extends LitElement {
2039
2214
  const selectedLabel = this.selectedContext === "all-agents" ? "all agents" : `agent ${this.selectedContext}`;
2040
2215
  if (events.length === 0) {
2041
2216
  return html`
2042
- <div class="flex h-full items-center justify-center px-4 py-8 text-center">
2217
+ <div
2218
+ class="flex h-full items-center justify-center px-4 py-8 text-center"
2219
+ >
2043
2220
  <div class="max-w-md">
2044
- <div class="mb-3 flex justify-center text-gray-300 [&>svg]:!h-8 [&>svg]:!w-8">
2221
+ <div
2222
+ class="mb-3 flex justify-center text-gray-300 [&>svg]:!h-8 [&>svg]:!w-8"
2223
+ >
2045
2224
  ${this.renderIcon("Zap")}
2046
2225
  </div>
2047
2226
  <p class="text-sm text-gray-600">No events yet</p>
2048
- <p class="mt-2 text-xs text-gray-500">Trigger an agent run to see live activity.</p>
2227
+ <p class="mt-2 text-xs text-gray-500">
2228
+ Trigger an agent run to see live activity.
2229
+ </p>
2049
2230
  </div>
2050
2231
  </div>
2051
2232
  `;
2052
2233
  }
2053
2234
  if (filteredEvents.length === 0) {
2054
2235
  return html`
2055
- <div class="flex h-full items-center justify-center px-4 py-8 text-center">
2236
+ <div
2237
+ class="flex h-full items-center justify-center px-4 py-8 text-center"
2238
+ >
2056
2239
  <div class="max-w-md space-y-3">
2057
- <div class="flex justify-center text-gray-300 [&>svg]:!h-8 [&>svg]:!w-8">
2240
+ <div
2241
+ class="flex justify-center text-gray-300 [&>svg]:!h-8 [&>svg]:!w-8"
2242
+ >
2058
2243
  ${this.renderIcon("Filter")}
2059
2244
  </div>
2060
- <p class="text-sm text-gray-600">No events match the current filters.</p>
2245
+ <p class="text-sm text-gray-600">
2246
+ No events match the current filters.
2247
+ </p>
2061
2248
  <div>
2062
2249
  <button
2063
2250
  type="button"
@@ -2074,7 +2261,9 @@ var WebInspectorElement = class extends LitElement {
2074
2261
  }
2075
2262
  return html`
2076
2263
  <div class="flex h-full flex-col">
2077
- <div class="flex flex-col gap-1.5 border-b border-gray-200 bg-white px-4 py-2.5">
2264
+ <div
2265
+ class="flex flex-col gap-1.5 border-b border-gray-200 bg-white px-4 py-2.5"
2266
+ >
2078
2267
  <div class="flex flex-wrap items-center gap-2">
2079
2268
  <div class="relative min-w-[200px] flex-1">
2080
2269
  <input
@@ -2092,7 +2281,9 @@ var WebInspectorElement = class extends LitElement {
2092
2281
  >
2093
2282
  <option value="all">All event types</option>
2094
2283
  ${AGENT_EVENT_TYPES.map(
2095
- (type) => html`<option value=${type}>${type.toLowerCase().replace(/_/g, " ")}</option>`
2284
+ (type) => html`<option value=${type}>
2285
+ ${type.toLowerCase().replace(/_/g, " ")}
2286
+ </option>`
2096
2287
  )}
2097
2288
  </select>
2098
2289
  <div class="flex items-center gap-1 text-[11px]">
@@ -2132,23 +2323,32 @@ var WebInspectorElement = class extends LitElement {
2132
2323
  </div>
2133
2324
  </div>
2134
2325
  <div class="text-[11px] text-gray-500">
2135
- Showing ${filteredEvents.length} of ${events.length}${this.selectedContext === "all-agents" ? "" : ` for ${selectedLabel}`}
2326
+ Showing ${filteredEvents.length} of
2327
+ ${events.length}${this.selectedContext === "all-agents" ? "" : ` for ${selectedLabel}`}
2136
2328
  </div>
2137
2329
  </div>
2138
2330
  <div class="relative h-full w-full overflow-y-auto overflow-x-hidden">
2139
2331
  <table class="w-full table-fixed border-collapse text-xs box-border">
2140
2332
  <thead class="sticky top-0 z-10">
2141
2333
  <tr class="bg-white">
2142
- <th class="border-b border-gray-200 bg-white px-3 py-2 text-left font-medium text-gray-900">
2334
+ <th
2335
+ class="border-b border-gray-200 bg-white px-3 py-2 text-left font-medium text-gray-900"
2336
+ >
2143
2337
  Agent
2144
2338
  </th>
2145
- <th class="border-b border-gray-200 bg-white px-3 py-2 text-left font-medium text-gray-900">
2339
+ <th
2340
+ class="border-b border-gray-200 bg-white px-3 py-2 text-left font-medium text-gray-900"
2341
+ >
2146
2342
  Time
2147
2343
  </th>
2148
- <th class="border-b border-gray-200 bg-white px-3 py-2 text-left font-medium text-gray-900">
2344
+ <th
2345
+ class="border-b border-gray-200 bg-white px-3 py-2 text-left font-medium text-gray-900"
2346
+ >
2149
2347
  Event Type
2150
2348
  </th>
2151
- <th class="border-b border-gray-200 bg-white px-3 py-2 text-left font-medium text-gray-900">
2349
+ <th
2350
+ class="border-b border-gray-200 bg-white px-3 py-2 text-left font-medium text-gray-900"
2351
+ >
2152
2352
  AG-UI Event
2153
2353
  </th>
2154
2354
  </tr>
@@ -2157,7 +2357,9 @@ var WebInspectorElement = class extends LitElement {
2157
2357
  ${filteredEvents.map((event, index) => {
2158
2358
  const rowBg = index % 2 === 0 ? "bg-white" : "bg-gray-50/50";
2159
2359
  const badgeClasses = this.getEventBadgeClasses(event.type);
2160
- const extractedEvent = this.extractEventFromPayload(event.payload);
2360
+ const extractedEvent = this.extractEventFromPayload(
2361
+ event.payload
2362
+ );
2161
2363
  const inlineEvent = this.stringifyPayload(extractedEvent, false) || "\u2014";
2162
2364
  const prettyEvent = this.stringifyPayload(extractedEvent, true) || inlineEvent;
2163
2365
  const isExpanded = this.expandedRows.has(event.id);
@@ -2166,10 +2368,16 @@ var WebInspectorElement = class extends LitElement {
2166
2368
  class="${rowBg} cursor-pointer transition hover:bg-blue-50/50"
2167
2369
  @click=${() => this.toggleRowExpansion(event.id)}
2168
2370
  >
2169
- <td class="border-l border-r border-b border-gray-200 px-3 py-2">
2170
- <span class="font-mono text-[11px] text-gray-600">${event.agentId}</span>
2371
+ <td
2372
+ class="border-l border-r border-b border-gray-200 px-3 py-2"
2373
+ >
2374
+ <span class="font-mono text-[11px] text-gray-600"
2375
+ >${event.agentId}</span
2376
+ >
2171
2377
  </td>
2172
- <td class="border-r border-b border-gray-200 px-3 py-2 font-mono text-[11px] text-gray-600">
2378
+ <td
2379
+ class="border-r border-b border-gray-200 px-3 py-2 font-mono text-[11px] text-gray-600"
2380
+ >
2173
2381
  <span title=${new Date(event.timestamp).toLocaleString()}>
2174
2382
  ${new Date(event.timestamp).toLocaleTimeString()}
2175
2383
  </span>
@@ -2177,12 +2385,20 @@ var WebInspectorElement = class extends LitElement {
2177
2385
  <td class="border-r border-b border-gray-200 px-3 py-2">
2178
2386
  <span class=${badgeClasses}>${event.type}</span>
2179
2387
  </td>
2180
- <td class="border-r border-b border-gray-200 px-3 py-2 font-mono text-[10px] text-gray-600 ${isExpanded ? "" : "truncate max-w-xs"}">
2388
+ <td
2389
+ class="border-r border-b border-gray-200 px-3 py-2 font-mono text-[10px] text-gray-600 ${isExpanded ? "" : "truncate max-w-xs"}"
2390
+ >
2181
2391
  ${isExpanded ? html`
2182
2392
  <div class="group relative">
2183
- <pre class="m-0 whitespace-pre-wrap break-words text-[10px] font-mono text-gray-600">${prettyEvent}</pre>
2393
+ <pre
2394
+ class="m-0 whitespace-pre-wrap break-words text-[10px] font-mono text-gray-600"
2395
+ >
2396
+ ${prettyEvent}</pre
2397
+ >
2184
2398
  <button
2185
- class="absolute right-0 top-0 cursor-pointer rounded px-2 py-1 text-[10px] opacity-0 transition group-hover:opacity-100 ${this.copiedEvents.has(event.id) ? "bg-green-100 text-green-700" : "bg-gray-100 text-gray-600 hover:bg-gray-200 hover:text-gray-900"}"
2399
+ class="absolute right-0 top-0 cursor-pointer rounded px-2 py-1 text-[10px] opacity-0 transition group-hover:opacity-100 ${this.copiedEvents.has(
2400
+ event.id
2401
+ ) ? "bg-green-100 text-green-700" : "bg-gray-100 text-gray-600 hover:bg-gray-200 hover:text-gray-900"}"
2186
2402
  @click=${(e) => {
2187
2403
  e.stopPropagation();
2188
2404
  this.copyToClipboard(prettyEvent, event.id);
@@ -2238,13 +2454,19 @@ var WebInspectorElement = class extends LitElement {
2238
2454
  renderAgentsView() {
2239
2455
  if (this.selectedContext === "all-agents") {
2240
2456
  return html`
2241
- <div class="flex h-full items-center justify-center px-4 py-8 text-center">
2457
+ <div
2458
+ class="flex h-full items-center justify-center px-4 py-8 text-center"
2459
+ >
2242
2460
  <div class="max-w-md">
2243
- <div class="mb-3 flex justify-center text-gray-300 [&>svg]:!h-8 [&>svg]:!w-8">
2461
+ <div
2462
+ class="mb-3 flex justify-center text-gray-300 [&>svg]:!h-8 [&>svg]:!w-8"
2463
+ >
2244
2464
  ${this.renderIcon("Bot")}
2245
2465
  </div>
2246
2466
  <p class="text-sm text-gray-600">No agent selected</p>
2247
- <p class="mt-2 text-xs text-gray-500">Select an agent from the dropdown above to view details.</p>
2467
+ <p class="mt-2 text-xs text-gray-500">
2468
+ Select an agent from the dropdown above to view details.
2469
+ </p>
2248
2470
  </div>
2249
2471
  </div>
2250
2472
  `;
@@ -2265,18 +2487,27 @@ var WebInspectorElement = class extends LitElement {
2265
2487
  <div class="rounded-lg border border-gray-200 bg-white p-4">
2266
2488
  <div class="flex items-start justify-between mb-4">
2267
2489
  <div class="flex items-center gap-3">
2268
- <div class="flex h-10 w-10 items-center justify-center rounded-lg bg-blue-100 text-blue-600">
2490
+ <div
2491
+ class="flex h-10 w-10 items-center justify-center rounded-lg bg-blue-100 text-blue-600"
2492
+ >
2269
2493
  ${this.renderIcon("Bot")}
2270
2494
  </div>
2271
2495
  <div>
2272
2496
  <h3 class="font-semibold text-sm text-gray-900">${agentId}</h3>
2273
- <span class="inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-xs font-medium ${statusColors[status]} relative -translate-y-[2px]">
2274
- <span class="h-1.5 w-1.5 rounded-full ${status === "running" ? "bg-emerald-500 animate-pulse" : status === "error" ? "bg-rose-500" : "bg-gray-400"}"></span>
2497
+ <span
2498
+ class="inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-xs font-medium ${statusColors[status]} relative -translate-y-[2px]"
2499
+ >
2500
+ <span
2501
+ class="h-1.5 w-1.5 rounded-full ${status === "running" ? "bg-emerald-500 animate-pulse" : status === "error" ? "bg-rose-500" : "bg-gray-400"}"
2502
+ ></span>
2275
2503
  ${status.charAt(0).toUpperCase() + status.slice(1)}
2276
2504
  </span>
2277
2505
  </div>
2278
2506
  </div>
2279
- ${stats.lastActivity ? html`<span class="text-xs text-gray-500">Last activity: ${new Date(stats.lastActivity).toLocaleTimeString()}</span>` : nothing}
2507
+ ${stats.lastActivity ? html`<span class="text-xs text-gray-500"
2508
+ >Last activity:
2509
+ ${new Date(stats.lastActivity).toLocaleTimeString()}</span
2510
+ >` : nothing}
2280
2511
  </div>
2281
2512
  <div class="grid grid-cols-2 gap-4 md:grid-cols-4">
2282
2513
  <button
@@ -2285,20 +2516,36 @@ var WebInspectorElement = class extends LitElement {
2285
2516
  @click=${() => this.handleMenuSelect("ag-ui-events")}
2286
2517
  title="View all events in AG-UI Events"
2287
2518
  >
2288
- <div class="truncate whitespace-nowrap text-xs text-gray-600">Total Events</div>
2289
- <div class="text-lg font-semibold text-gray-900">${stats.totalEvents}</div>
2519
+ <div class="truncate whitespace-nowrap text-xs text-gray-600">
2520
+ Total Events
2521
+ </div>
2522
+ <div class="text-lg font-semibold text-gray-900">
2523
+ ${stats.totalEvents}
2524
+ </div>
2290
2525
  </button>
2291
2526
  <div class="rounded-md bg-gray-50 px-3 py-2 overflow-hidden">
2292
- <div class="truncate whitespace-nowrap text-xs text-gray-600">Messages</div>
2293
- <div class="text-lg font-semibold text-gray-900">${stats.messages}</div>
2527
+ <div class="truncate whitespace-nowrap text-xs text-gray-600">
2528
+ Messages
2529
+ </div>
2530
+ <div class="text-lg font-semibold text-gray-900">
2531
+ ${stats.messages}
2532
+ </div>
2294
2533
  </div>
2295
2534
  <div class="rounded-md bg-gray-50 px-3 py-2 overflow-hidden">
2296
- <div class="truncate whitespace-nowrap text-xs text-gray-600">Tool Calls</div>
2297
- <div class="text-lg font-semibold text-gray-900">${stats.toolCalls}</div>
2535
+ <div class="truncate whitespace-nowrap text-xs text-gray-600">
2536
+ Tool Calls
2537
+ </div>
2538
+ <div class="text-lg font-semibold text-gray-900">
2539
+ ${stats.toolCalls}
2540
+ </div>
2298
2541
  </div>
2299
2542
  <div class="rounded-md bg-gray-50 px-3 py-2 overflow-hidden">
2300
- <div class="truncate whitespace-nowrap text-xs text-gray-600">Errors</div>
2301
- <div class="text-lg font-semibold text-gray-900">${stats.errors}</div>
2543
+ <div class="truncate whitespace-nowrap text-xs text-gray-600">
2544
+ Errors
2545
+ </div>
2546
+ <div class="text-lg font-semibold text-gray-900">
2547
+ ${stats.errors}
2548
+ </div>
2302
2549
  </div>
2303
2550
  </div>
2304
2551
  </div>
@@ -2310,11 +2557,17 @@ var WebInspectorElement = class extends LitElement {
2310
2557
  </div>
2311
2558
  <div class="overflow-auto p-4">
2312
2559
  ${this.hasRenderableState(state) ? html`
2313
- <pre class="overflow-auto rounded-md bg-gray-50 p-3 text-xs text-gray-800 max-h-64"><code>${this.formatStateForDisplay(state)}</code></pre>
2560
+ <pre
2561
+ class="overflow-auto rounded-md bg-gray-50 p-3 text-xs text-gray-800 max-h-64"
2562
+ ><code>${this.formatStateForDisplay(state)}</code></pre>
2314
2563
  ` : html`
2315
- <div class="flex h-40 items-center justify-center text-xs text-gray-500">
2564
+ <div
2565
+ class="flex h-40 items-center justify-center text-xs text-gray-500"
2566
+ >
2316
2567
  <div class="flex items-center gap-2 text-gray-500">
2317
- <span class="text-lg text-gray-400">${this.renderIcon("Database")}</span>
2568
+ <span class="text-lg text-gray-400"
2569
+ >${this.renderIcon("Database")}</span
2570
+ >
2318
2571
  <span>State is empty</span>
2319
2572
  </div>
2320
2573
  </div>
@@ -2325,15 +2578,25 @@ var WebInspectorElement = class extends LitElement {
2325
2578
  <!-- Current Messages Section -->
2326
2579
  <div class="rounded-lg border border-gray-200 bg-white">
2327
2580
  <div class="border-b border-gray-200 px-4 py-3">
2328
- <h4 class="text-sm font-semibold text-gray-900">Current Messages</h4>
2581
+ <h4 class="text-sm font-semibold text-gray-900">
2582
+ Current Messages
2583
+ </h4>
2329
2584
  </div>
2330
2585
  <div class="overflow-auto">
2331
2586
  ${messages && messages.length > 0 ? html`
2332
2587
  <table class="w-full text-xs">
2333
2588
  <thead class="bg-gray-50">
2334
2589
  <tr>
2335
- <th class="px-4 py-2 text-left font-medium text-gray-700">Role</th>
2336
- <th class="px-4 py-2 text-left font-medium text-gray-700">Content</th>
2590
+ <th
2591
+ class="px-4 py-2 text-left font-medium text-gray-700"
2592
+ >
2593
+ Role
2594
+ </th>
2595
+ <th
2596
+ class="px-4 py-2 text-left font-medium text-gray-700"
2597
+ >
2598
+ Content
2599
+ </th>
2337
2600
  </tr>
2338
2601
  </thead>
2339
2602
  <tbody class="divide-y divide-gray-200">
@@ -2353,12 +2616,22 @@ var WebInspectorElement = class extends LitElement {
2353
2616
  return html`
2354
2617
  <tr>
2355
2618
  <td class="px-4 py-2 align-top">
2356
- <span class="inline-flex rounded px-2 py-0.5 text-[10px] font-medium ${roleColors[role] || roleColors.unknown}">
2619
+ <span
2620
+ class="inline-flex rounded px-2 py-0.5 text-[10px] font-medium ${roleColors[role] || roleColors.unknown}"
2621
+ >
2357
2622
  ${role}
2358
2623
  </span>
2359
2624
  </td>
2360
2625
  <td class="px-4 py-2">
2361
- ${hasContent ? html`<div class="max-w-2xl whitespace-pre-wrap break-words text-gray-700">${rawContent}</div>` : html`<div class="text-xs italic text-gray-400">${contentFallback}</div>`}
2626
+ ${hasContent ? html`<div
2627
+ class="max-w-2xl whitespace-pre-wrap break-words text-gray-700"
2628
+ >
2629
+ ${rawContent}
2630
+ </div>` : html`<div
2631
+ class="text-xs italic text-gray-400"
2632
+ >
2633
+ ${contentFallback}
2634
+ </div>`}
2362
2635
  ${role === "assistant" && toolCalls.length > 0 ? this.renderToolCallDetails(toolCalls) : nothing}
2363
2636
  </td>
2364
2637
  </tr>
@@ -2367,9 +2640,13 @@ var WebInspectorElement = class extends LitElement {
2367
2640
  </tbody>
2368
2641
  </table>
2369
2642
  ` : html`
2370
- <div class="flex h-40 items-center justify-center text-xs text-gray-500">
2643
+ <div
2644
+ class="flex h-40 items-center justify-center text-xs text-gray-500"
2645
+ >
2371
2646
  <div class="flex items-center gap-2 text-gray-500">
2372
- <span class="text-lg text-gray-400">${this.renderIcon("MessageSquare")}</span>
2647
+ <span class="text-lg text-gray-400"
2648
+ >${this.renderIcon("MessageSquare")}</span
2649
+ >
2373
2650
  <span>No messages available</span>
2374
2651
  </div>
2375
2652
  </div>
@@ -2383,14 +2660,19 @@ var WebInspectorElement = class extends LitElement {
2383
2660
  const filteredOptions = this.selectedMenu === "agents" ? this.contextOptions.filter((opt) => opt.key !== "all-agents") : this.contextOptions;
2384
2661
  const selectedLabel = filteredOptions.find((opt) => opt.key === this.selectedContext)?.label ?? "";
2385
2662
  return html`
2386
- <div class="relative z-40 min-w-0 flex-1" data-context-dropdown-root="true">
2663
+ <div
2664
+ class="relative z-40 min-w-0 flex-1"
2665
+ data-context-dropdown-root="true"
2666
+ >
2387
2667
  <button
2388
2668
  type="button"
2389
2669
  class="relative z-40 flex w-full min-w-0 max-w-[240px] items-center gap-1.5 rounded-md border border-gray-200 px-2 py-1 text-xs font-medium text-gray-700 transition hover:border-gray-300 hover:bg-gray-50"
2390
2670
  @pointerdown=${this.handleContextDropdownToggle}
2391
2671
  >
2392
2672
  <span class="truncate flex-1 text-left">${selectedLabel}</span>
2393
- <span class="shrink-0 text-gray-400">${this.renderIcon("ChevronDown")}</span>
2673
+ <span class="shrink-0 text-gray-400"
2674
+ >${this.renderIcon("ChevronDown")}</span
2675
+ >
2394
2676
  </button>
2395
2677
  ${this.contextMenuOpen ? html`
2396
2678
  <div
@@ -2405,8 +2687,13 @@ var WebInspectorElement = class extends LitElement {
2405
2687
  data-context-dropdown-root="true"
2406
2688
  @click=${() => this.handleContextOptionSelect(option.key)}
2407
2689
  >
2408
- <span class="truncate ${option.key === this.selectedContext ? "text-gray-900 font-medium" : "text-gray-600"}">${option.label}</span>
2409
- ${option.key === this.selectedContext ? html`<span class="text-gray-500">${this.renderIcon("Check")}</span>` : nothing}
2690
+ <span
2691
+ class="truncate ${option.key === this.selectedContext ? "text-gray-900 font-medium" : "text-gray-600"}"
2692
+ >${option.label}</span
2693
+ >
2694
+ ${option.key === this.selectedContext ? html`<span class="text-gray-500"
2695
+ >${this.renderIcon("Check")}</span
2696
+ >` : nothing}
2410
2697
  </button>
2411
2698
  `
2412
2699
  )}
@@ -2421,7 +2708,9 @@ var WebInspectorElement = class extends LitElement {
2421
2708
  }
2422
2709
  this.selectedMenu = key;
2423
2710
  if (key === "agents" && this.selectedContext === "all-agents") {
2424
- const agentOptions = this.contextOptions.filter((opt) => opt.key !== "all-agents");
2711
+ const agentOptions = this.contextOptions.filter(
2712
+ (opt) => opt.key !== "all-agents"
2713
+ );
2425
2714
  if (agentOptions.length > 0) {
2426
2715
  const defaultAgent = agentOptions.find((opt) => opt.key === "default");
2427
2716
  this.selectedContext = defaultAgent ? defaultAgent.key : agentOptions[0].key;
@@ -2452,7 +2741,9 @@ var WebInspectorElement = class extends LitElement {
2452
2741
  renderToolsView() {
2453
2742
  if (!this._core) {
2454
2743
  return html`
2455
- <div class="flex h-full items-center justify-center px-4 py-8 text-xs text-gray-500">
2744
+ <div
2745
+ class="flex h-full items-center justify-center px-4 py-8 text-xs text-gray-500"
2746
+ >
2456
2747
  No core instance available
2457
2748
  </div>
2458
2749
  `;
@@ -2461,18 +2752,27 @@ var WebInspectorElement = class extends LitElement {
2461
2752
  const allTools = this.cachedTools;
2462
2753
  if (allTools.length === 0) {
2463
2754
  return html`
2464
- <div class="flex h-full items-center justify-center px-4 py-8 text-center">
2755
+ <div
2756
+ class="flex h-full items-center justify-center px-4 py-8 text-center"
2757
+ >
2465
2758
  <div class="max-w-md">
2466
- <div class="mb-3 flex justify-center text-gray-300 [&>svg]:!h-8 [&>svg]:!w-8">
2759
+ <div
2760
+ class="mb-3 flex justify-center text-gray-300 [&>svg]:!h-8 [&>svg]:!w-8"
2761
+ >
2467
2762
  ${this.renderIcon("Hammer")}
2468
2763
  </div>
2469
2764
  <p class="text-sm text-gray-600">No tools available</p>
2470
- <p class="mt-2 text-xs text-gray-500">Tools will appear here once agents are configured with tool handlers or renderers.</p>
2765
+ <p class="mt-2 text-xs text-gray-500">
2766
+ Tools will appear here once agents are configured with tool
2767
+ handlers or renderers.
2768
+ </p>
2471
2769
  </div>
2472
2770
  </div>
2473
2771
  `;
2474
2772
  }
2475
- const filteredTools = this.selectedContext === "all-agents" ? allTools : allTools.filter((tool) => !tool.agentId || tool.agentId === this.selectedContext);
2773
+ const filteredTools = this.selectedContext === "all-agents" ? allTools : allTools.filter(
2774
+ (tool) => !tool.agentId || tool.agentId === this.selectedContext
2775
+ );
2476
2776
  return html`
2477
2777
  <div class="flex h-full flex-col overflow-hidden">
2478
2778
  <div class="overflow-auto p-4">
@@ -2555,8 +2855,12 @@ var WebInspectorElement = class extends LitElement {
2555
2855
  <div class="flex items-start justify-between gap-3">
2556
2856
  <div class="flex-1 min-w-0">
2557
2857
  <div class="flex items-center gap-2 mb-1">
2558
- <span class="font-mono text-sm font-semibold text-gray-900">${tool.name}</span>
2559
- <span class="inline-flex items-center rounded-sm border px-1.5 py-0.5 text-[10px] font-medium ${typeColors[tool.type]}">
2858
+ <span class="font-mono text-sm font-semibold text-gray-900"
2859
+ >${tool.name}</span
2860
+ >
2861
+ <span
2862
+ class="inline-flex items-center rounded-sm border px-1.5 py-0.5 text-[10px] font-medium ${typeColors[tool.type]}"
2863
+ >
2560
2864
  ${tool.type}
2561
2865
  </span>
2562
2866
  </div>
@@ -2567,12 +2871,19 @@ var WebInspectorElement = class extends LitElement {
2567
2871
  </span>
2568
2872
  ${schema.properties.length > 0 ? html`
2569
2873
  <span class="text-gray-300">•</span>
2570
- <span>${schema.properties.length} parameter${schema.properties.length !== 1 ? "s" : ""}</span>
2874
+ <span
2875
+ >${schema.properties.length}
2876
+ parameter${schema.properties.length !== 1 ? "s" : ""}</span
2877
+ >
2571
2878
  ` : nothing}
2572
2879
  </div>
2573
- ${tool.description ? html`<p class="mt-2 text-xs text-gray-600">${tool.description}</p>` : nothing}
2880
+ ${tool.description ? html`<p class="mt-2 text-xs text-gray-600">
2881
+ ${tool.description}
2882
+ </p>` : nothing}
2574
2883
  </div>
2575
- <span class="shrink-0 text-gray-400 transition ${isExpanded ? "rotate-180" : ""}">
2884
+ <span
2885
+ class="shrink-0 text-gray-400 transition ${isExpanded ? "rotate-180" : ""}"
2886
+ >
2576
2887
  ${this.renderIcon("ChevronDown")}
2577
2888
  </span>
2578
2889
  </div>
@@ -2581,39 +2892,77 @@ var WebInspectorElement = class extends LitElement {
2581
2892
  ${isExpanded ? html`
2582
2893
  <div class="border-t border-gray-200 bg-gray-50/50 px-4 py-3">
2583
2894
  ${schema.properties.length > 0 ? html`
2584
- <h5 class="mb-3 text-xs font-semibold text-gray-700">Parameters</h5>
2895
+ <h5 class="mb-3 text-xs font-semibold text-gray-700">
2896
+ Parameters
2897
+ </h5>
2585
2898
  <div class="space-y-3">
2586
- ${schema.properties.map((prop) => html`
2587
- <div class="rounded-md border border-gray-200 bg-white p-3">
2588
- <div class="flex items-start justify-between gap-2 mb-1">
2589
- <span class="font-mono text-xs font-medium text-gray-900">${prop.name}</span>
2590
- <div class="flex items-center gap-1.5 shrink-0">
2591
- ${prop.required ? html`<span class="text-[9px] rounded border border-rose-200 bg-rose-50 px-1 py-0.5 font-medium text-rose-700">required</span>` : html`<span class="text-[9px] rounded border border-gray-200 bg-gray-50 px-1 py-0.5 font-medium text-gray-600">optional</span>`}
2592
- ${prop.type ? html`<span class="text-[9px] rounded border border-gray-200 bg-gray-50 px-1 py-0.5 font-mono text-gray-600">${prop.type}</span>` : nothing}
2899
+ ${schema.properties.map(
2900
+ (prop) => html`
2901
+ <div
2902
+ class="rounded-md border border-gray-200 bg-white p-3"
2903
+ >
2904
+ <div
2905
+ class="flex items-start justify-between gap-2 mb-1"
2906
+ >
2907
+ <span
2908
+ class="font-mono text-xs font-medium text-gray-900"
2909
+ >${prop.name}</span
2910
+ >
2911
+ <div class="flex items-center gap-1.5 shrink-0">
2912
+ ${prop.required ? html`<span
2913
+ class="text-[9px] rounded border border-rose-200 bg-rose-50 px-1 py-0.5 font-medium text-rose-700"
2914
+ >required</span
2915
+ >` : html`<span
2916
+ class="text-[9px] rounded border border-gray-200 bg-gray-50 px-1 py-0.5 font-medium text-gray-600"
2917
+ >optional</span
2918
+ >`}
2919
+ ${prop.type ? html`<span
2920
+ class="text-[9px] rounded border border-gray-200 bg-gray-50 px-1 py-0.5 font-mono text-gray-600"
2921
+ >${prop.type}</span
2922
+ >` : nothing}
2923
+ </div>
2593
2924
  </div>
2594
- </div>
2595
- ${prop.description ? html`<p class="mt-1 text-xs text-gray-600">${prop.description}</p>` : nothing}
2596
- ${prop.defaultValue !== void 0 ? html`
2597
- <div class="mt-2 flex items-center gap-1.5 text-[10px] text-gray-500">
2598
- <span>Default:</span>
2599
- <code class="rounded bg-gray-100 px-1 py-0.5 font-mono">${JSON.stringify(prop.defaultValue)}</code>
2600
- </div>
2601
- ` : nothing}
2602
- ${prop.enum && prop.enum.length > 0 ? html`
2603
- <div class="mt-2">
2604
- <span class="text-[10px] text-gray-500">Allowed values:</span>
2605
- <div class="mt-1 flex flex-wrap gap-1">
2606
- ${prop.enum.map((val) => html`
2607
- <code class="rounded border border-gray-200 bg-gray-50 px-1.5 py-0.5 text-[10px] font-mono text-gray-700">${JSON.stringify(val)}</code>
2608
- `)}
2925
+ ${prop.description ? html`<p class="mt-1 text-xs text-gray-600">
2926
+ ${prop.description}
2927
+ </p>` : nothing}
2928
+ ${prop.defaultValue !== void 0 ? html`
2929
+ <div
2930
+ class="mt-2 flex items-center gap-1.5 text-[10px] text-gray-500"
2931
+ >
2932
+ <span>Default:</span>
2933
+ <code
2934
+ class="rounded bg-gray-100 px-1 py-0.5 font-mono"
2935
+ >${JSON.stringify(
2936
+ prop.defaultValue
2937
+ )}</code
2938
+ >
2939
+ </div>
2940
+ ` : nothing}
2941
+ ${prop.enum && prop.enum.length > 0 ? html`
2942
+ <div class="mt-2">
2943
+ <span class="text-[10px] text-gray-500"
2944
+ >Allowed values:</span
2945
+ >
2946
+ <div class="mt-1 flex flex-wrap gap-1">
2947
+ ${prop.enum.map(
2948
+ (val) => html`
2949
+ <code
2950
+ class="rounded border border-gray-200 bg-gray-50 px-1.5 py-0.5 text-[10px] font-mono text-gray-700"
2951
+ >${JSON.stringify(val)}</code
2952
+ >
2953
+ `
2954
+ )}
2955
+ </div>
2609
2956
  </div>
2610
- </div>
2611
- ` : nothing}
2612
- </div>
2613
- `)}
2957
+ ` : nothing}
2958
+ </div>
2959
+ `
2960
+ )}
2614
2961
  </div>
2615
2962
  ` : html`
2616
- <div class="flex items-center justify-center py-4 text-xs text-gray-500">
2963
+ <div
2964
+ class="flex items-center justify-center py-4 text-xs text-gray-500"
2965
+ >
2617
2966
  <span>No parameters defined</span>
2618
2967
  </div>
2619
2968
  `}
@@ -2736,13 +3085,19 @@ var WebInspectorElement = class extends LitElement {
2736
3085
  const contextEntries = Object.entries(this.contextStore);
2737
3086
  if (contextEntries.length === 0) {
2738
3087
  return html`
2739
- <div class="flex h-full items-center justify-center px-4 py-8 text-center">
3088
+ <div
3089
+ class="flex h-full items-center justify-center px-4 py-8 text-center"
3090
+ >
2740
3091
  <div class="max-w-md">
2741
- <div class="mb-3 flex justify-center text-gray-300 [&>svg]:!h-8 [&>svg]:!w-8">
3092
+ <div
3093
+ class="mb-3 flex justify-center text-gray-300 [&>svg]:!h-8 [&>svg]:!w-8"
3094
+ >
2742
3095
  ${this.renderIcon("FileText")}
2743
3096
  </div>
2744
3097
  <p class="text-sm text-gray-600">No context available</p>
2745
- <p class="mt-2 text-xs text-gray-500">Context will appear here once added to CopilotKit.</p>
3098
+ <p class="mt-2 text-xs text-gray-500">
3099
+ Context will appear here once added to CopilotKit.
3100
+ </p>
2746
3101
  </div>
2747
3102
  </div>
2748
3103
  `;
@@ -2751,7 +3106,9 @@ var WebInspectorElement = class extends LitElement {
2751
3106
  <div class="flex h-full flex-col overflow-hidden">
2752
3107
  <div class="overflow-auto p-4">
2753
3108
  <div class="space-y-3">
2754
- ${contextEntries.map(([id, context]) => this.renderContextCard(id, context))}
3109
+ ${contextEntries.map(
3110
+ ([id, context]) => this.renderContextCard(id, context)
3111
+ )}
2755
3112
  </div>
2756
3113
  </div>
2757
3114
  </div>
@@ -2773,14 +3130,20 @@ var WebInspectorElement = class extends LitElement {
2773
3130
  <div class="flex-1 min-w-0">
2774
3131
  <p class="text-sm font-medium text-gray-900 mb-1">${title}</p>
2775
3132
  <div class="flex items-center gap-2 text-xs text-gray-500">
2776
- <span class="font-mono truncate inline-block align-middle" style="max-width: 180px;">${id}</span>
3133
+ <span
3134
+ class="font-mono truncate inline-block align-middle"
3135
+ style="max-width: 180px;"
3136
+ >${id}</span
3137
+ >
2777
3138
  ${hasValue ? html`
2778
3139
  <span class="text-gray-300">•</span>
2779
3140
  <span class="truncate">${valuePreview}</span>
2780
3141
  ` : nothing}
2781
3142
  </div>
2782
3143
  </div>
2783
- <span class="shrink-0 text-gray-400 transition ${isExpanded ? "rotate-180" : ""}">
3144
+ <span
3145
+ class="shrink-0 text-gray-400 transition ${isExpanded ? "rotate-180" : ""}"
3146
+ >
2784
3147
  ${this.renderIcon("ChevronDown")}
2785
3148
  </span>
2786
3149
  </div>
@@ -2790,11 +3153,16 @@ var WebInspectorElement = class extends LitElement {
2790
3153
  <div class="border-t border-gray-200 bg-gray-50/50 px-4 py-3">
2791
3154
  <div class="mb-3">
2792
3155
  <h5 class="mb-1 text-xs font-semibold text-gray-700">ID</h5>
2793
- <code class="block rounded bg-white border border-gray-200 px-2 py-1 text-[10px] font-mono text-gray-600">${id}</code>
3156
+ <code
3157
+ class="block rounded bg-white border border-gray-200 px-2 py-1 text-[10px] font-mono text-gray-600"
3158
+ >${id}</code
3159
+ >
2794
3160
  </div>
2795
3161
  ${hasValue ? html`
2796
3162
  <div class="mb-2 flex items-center justify-between gap-2">
2797
- <h5 class="text-xs font-semibold text-gray-700">Value</h5>
3163
+ <h5 class="text-xs font-semibold text-gray-700">
3164
+ Value
3165
+ </h5>
2798
3166
  <button
2799
3167
  class="flex items-center gap-1 rounded-md border border-gray-200 bg-white px-2 py-1 text-[10px] font-medium text-gray-700 transition hover:bg-gray-50"
2800
3168
  type="button"
@@ -2806,11 +3174,19 @@ var WebInspectorElement = class extends LitElement {
2806
3174
  ${this.copiedContextItems.has(id) ? "Copied" : "Copy JSON"}
2807
3175
  </button>
2808
3176
  </div>
2809
- <div class="rounded-md border border-gray-200 bg-white p-3">
2810
- <pre class="overflow-auto text-xs text-gray-800 max-h-96"><code>${this.formatContextValue(context.value)}</code></pre>
3177
+ <div
3178
+ class="rounded-md border border-gray-200 bg-white p-3"
3179
+ >
3180
+ <pre
3181
+ class="overflow-auto text-xs text-gray-800 max-h-96"
3182
+ ><code>${this.formatContextValue(
3183
+ context.value
3184
+ )}</code></pre>
2811
3185
  </div>
2812
3186
  ` : html`
2813
- <div class="flex items-center justify-center py-4 text-xs text-gray-500">
3187
+ <div
3188
+ class="flex items-center justify-center py-4 text-xs text-gray-500"
3189
+ >
2814
3190
  <span>No value available</span>
2815
3191
  </div>
2816
3192
  `}
@@ -2904,9 +3280,13 @@ var WebInspectorElement = class extends LitElement {
2904
3280
  return nothing;
2905
3281
  }
2906
3282
  if (!this.announcementLoaded && !this.announcementMarkdown) {
2907
- return html`<div class="mx-4 my-3 rounded-xl border border-slate-200 bg-white px-4 py-3 text-sm text-slate-800 shadow-[0_12px_30px_rgba(15,23,42,0.12)]">
3283
+ return html`<div
3284
+ class="mx-4 my-3 rounded-xl border border-slate-200 bg-white px-4 py-3 text-sm text-slate-800 shadow-[0_12px_30px_rgba(15,23,42,0.12)]"
3285
+ >
2908
3286
  <div class="flex items-center gap-2 font-semibold">
2909
- <span class="inline-flex h-6 w-6 items-center justify-center rounded-md bg-slate-900 text-white shadow-sm">
3287
+ <span
3288
+ class="inline-flex h-6 w-6 items-center justify-center rounded-md bg-slate-900 text-white shadow-sm"
3289
+ >
2910
3290
  ${this.renderIcon("Megaphone")}
2911
3291
  </span>
2912
3292
  <span>Loading latest announcement…</span>
@@ -2914,31 +3294,53 @@ var WebInspectorElement = class extends LitElement {
2914
3294
  </div>`;
2915
3295
  }
2916
3296
  if (this.announcementLoadError) {
2917
- return html`<div class="mx-4 my-3 rounded-xl border border-rose-200 bg-rose-50 px-4 py-3 text-sm text-rose-900 shadow-[0_12px_30px_rgba(15,23,42,0.12)]">
3297
+ return html`<div
3298
+ class="mx-4 my-3 rounded-xl border border-rose-200 bg-rose-50 px-4 py-3 text-sm text-rose-900 shadow-[0_12px_30px_rgba(15,23,42,0.12)]"
3299
+ >
2918
3300
  <div class="flex items-center gap-2 font-semibold">
2919
- <span class="inline-flex h-6 w-6 items-center justify-center rounded-md bg-rose-600 text-white shadow-sm">
3301
+ <span
3302
+ class="inline-flex h-6 w-6 items-center justify-center rounded-md bg-rose-600 text-white shadow-sm"
3303
+ >
2920
3304
  ${this.renderIcon("Megaphone")}
2921
3305
  </span>
2922
3306
  <span>Announcement unavailable</span>
2923
3307
  </div>
2924
- <p class="mt-2 text-xs text-rose-800">We couldn’t load the latest notice. Please try opening the inspector again.</p>
3308
+ <p class="mt-2 text-xs text-rose-800">
3309
+ We couldn’t load the latest notice. Please try opening the inspector
3310
+ again.
3311
+ </p>
2925
3312
  </div>`;
2926
3313
  }
2927
3314
  if (!this.announcementMarkdown) {
2928
3315
  return nothing;
2929
3316
  }
2930
- const content = this.announcementHtml ? unsafeHTML(this.announcementHtml) : html`<pre class="whitespace-pre-wrap text-sm text-gray-900">${this.announcementMarkdown}</pre>`;
2931
- return html`<div class="mx-4 my-3 rounded-xl border border-slate-200 bg-white px-4 py-4 shadow-[0_12px_30px_rgba(15,23,42,0.12)]">
2932
- <div class="mb-3 flex items-center gap-2 text-sm font-semibold text-slate-900">
2933
- <span class="inline-flex h-7 w-7 items-center justify-center rounded-md bg-slate-900 text-white shadow-sm">
3317
+ const content = this.announcementHtml ? unsafeHTML(this.announcementHtml) : html`<pre class="whitespace-pre-wrap text-sm text-gray-900">
3318
+ ${this.announcementMarkdown}</pre
3319
+ >`;
3320
+ return html`<div
3321
+ class="mx-4 my-3 rounded-xl border border-slate-200 bg-white px-4 py-4 shadow-[0_12px_30px_rgba(15,23,42,0.12)]"
3322
+ >
3323
+ <div
3324
+ class="mb-3 flex items-center gap-2 text-sm font-semibold text-slate-900"
3325
+ >
3326
+ <span
3327
+ class="inline-flex h-7 w-7 items-center justify-center rounded-md bg-slate-900 text-white shadow-sm"
3328
+ >
2934
3329
  ${this.renderIcon("Megaphone")}
2935
3330
  </span>
2936
3331
  <span>Announcement</span>
2937
- <button class="announcement-dismiss ml-auto" type="button" @click=${this.handleDismissAnnouncement} aria-label="Dismiss announcement">
3332
+ <button
3333
+ class="announcement-dismiss ml-auto"
3334
+ type="button"
3335
+ @click=${this.handleDismissAnnouncement}
3336
+ aria-label="Dismiss announcement"
3337
+ >
2938
3338
  Dismiss
2939
3339
  </button>
2940
3340
  </div>
2941
- <div class="announcement-content text-sm leading-relaxed text-gray-900">${content}</div>
3341
+ <div class="announcement-content text-sm leading-relaxed text-gray-900">
3342
+ ${content}
3343
+ </div>
2942
3344
  </div>`;
2943
3345
  }
2944
3346
  ensureAnnouncementLoading() {
@@ -3005,7 +3407,10 @@ var WebInspectorElement = class extends LitElement {
3005
3407
  }
3006
3408
  appendRefParam(href) {
3007
3409
  try {
3008
- const url = new URL(href, typeof window !== "undefined" ? window.location.href : "https://copilotkit.ai");
3410
+ const url = new URL(
3411
+ href,
3412
+ typeof window !== "undefined" ? window.location.href : "https://copilotkit.ai"
3413
+ );
3009
3414
  if (!url.searchParams.has("ref")) {
3010
3415
  url.searchParams.append("ref", "cpk-inspector");
3011
3416
  }