@copilotkitnext/web-inspector 1.51.4-next.7 → 1.51.4
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 +13 -0
- package/dist/index.js +594 -189
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +594 -189
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +388 -139
- package/dist/index.umd.js.map +1 -1
- package/package.json +4 -5
- package/src/__tests__/web-inspector.spec.ts +25 -9
- package/src/components.d.ts +6 -10
- package/src/index.ts +958 -373
- package/src/lib/context-helpers.ts +60 -19
- package/src/lib/persistence.ts +16 -11
- package/src/lib/types.ts +4 -4
- package/tsup.config.ts +7 -7
- package/.turbo/turbo-build$colon$css.log +0 -7
- package/.turbo/turbo-build.log +0 -36
package/dist/index.js
CHANGED
|
@@ -60,15 +60,26 @@ function clampSize(size, viewport, edgeMargin, minWidth, minHeight) {
|
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
62
|
function constrainToViewport(state, position, viewport, edgeMargin) {
|
|
63
|
-
const maxX = Math.max(
|
|
64
|
-
|
|
63
|
+
const maxX = Math.max(
|
|
64
|
+
edgeMargin,
|
|
65
|
+
viewport.width - state.size.width - edgeMargin
|
|
66
|
+
);
|
|
67
|
+
const maxY = Math.max(
|
|
68
|
+
edgeMargin,
|
|
69
|
+
viewport.height - state.size.height - edgeMargin
|
|
70
|
+
);
|
|
65
71
|
return {
|
|
66
72
|
x: clamp(position.x, edgeMargin, maxX),
|
|
67
73
|
y: clamp(position.y, edgeMargin, maxY)
|
|
68
74
|
};
|
|
69
75
|
}
|
|
70
76
|
function keepPositionWithinViewport(state, viewport, edgeMargin) {
|
|
71
|
-
state.position = constrainToViewport(
|
|
77
|
+
state.position = constrainToViewport(
|
|
78
|
+
state,
|
|
79
|
+
state.position,
|
|
80
|
+
viewport,
|
|
81
|
+
edgeMargin
|
|
82
|
+
);
|
|
72
83
|
}
|
|
73
84
|
function centerContext(state, viewport, edgeMargin) {
|
|
74
85
|
const centered = {
|
|
@@ -85,18 +96,46 @@ function updateAnchorFromPosition(state, viewport, edgeMargin) {
|
|
|
85
96
|
const horizontal = centerX < viewport.width / 2 ? "left" : "right";
|
|
86
97
|
const vertical = centerY < viewport.height / 2 ? "top" : "bottom";
|
|
87
98
|
state.anchor = { horizontal, vertical };
|
|
88
|
-
const maxHorizontalOffset = Math.max(
|
|
89
|
-
|
|
99
|
+
const maxHorizontalOffset = Math.max(
|
|
100
|
+
edgeMargin,
|
|
101
|
+
viewport.width - state.size.width - edgeMargin
|
|
102
|
+
);
|
|
103
|
+
const maxVerticalOffset = Math.max(
|
|
104
|
+
edgeMargin,
|
|
105
|
+
viewport.height - state.size.height - edgeMargin
|
|
106
|
+
);
|
|
90
107
|
state.anchorOffset = {
|
|
91
|
-
x: horizontal === "left" ? clamp(state.position.x, edgeMargin, maxHorizontalOffset) : clamp(
|
|
92
|
-
|
|
108
|
+
x: horizontal === "left" ? clamp(state.position.x, edgeMargin, maxHorizontalOffset) : clamp(
|
|
109
|
+
viewport.width - state.position.x - state.size.width,
|
|
110
|
+
edgeMargin,
|
|
111
|
+
maxHorizontalOffset
|
|
112
|
+
),
|
|
113
|
+
y: vertical === "top" ? clamp(state.position.y, edgeMargin, maxVerticalOffset) : clamp(
|
|
114
|
+
viewport.height - state.position.y - state.size.height,
|
|
115
|
+
edgeMargin,
|
|
116
|
+
maxVerticalOffset
|
|
117
|
+
)
|
|
93
118
|
};
|
|
94
119
|
}
|
|
95
120
|
function applyAnchorPosition(state, viewport, edgeMargin) {
|
|
96
|
-
const maxHorizontalOffset = Math.max(
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
121
|
+
const maxHorizontalOffset = Math.max(
|
|
122
|
+
edgeMargin,
|
|
123
|
+
viewport.width - state.size.width - edgeMargin
|
|
124
|
+
);
|
|
125
|
+
const maxVerticalOffset = Math.max(
|
|
126
|
+
edgeMargin,
|
|
127
|
+
viewport.height - state.size.height - edgeMargin
|
|
128
|
+
);
|
|
129
|
+
const horizontalOffset = clamp(
|
|
130
|
+
state.anchorOffset.x,
|
|
131
|
+
edgeMargin,
|
|
132
|
+
maxHorizontalOffset
|
|
133
|
+
);
|
|
134
|
+
const verticalOffset = clamp(
|
|
135
|
+
state.anchorOffset.y,
|
|
136
|
+
edgeMargin,
|
|
137
|
+
maxVerticalOffset
|
|
138
|
+
);
|
|
100
139
|
const x = state.anchor.horizontal === "left" ? horizontalOffset : viewport.width - state.size.width - horizontalOffset;
|
|
101
140
|
const y = state.anchor.vertical === "top" ? verticalOffset : viewport.height - state.size.height - verticalOffset;
|
|
102
141
|
state.anchorOffset = { x: horizontalOffset, y: verticalOffset };
|
|
@@ -312,7 +351,10 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
312
351
|
if (this.pointerId !== event.pointerId || !this.dragStart || !this.pointerContext) {
|
|
313
352
|
return;
|
|
314
353
|
}
|
|
315
|
-
const distance = Math.hypot(
|
|
354
|
+
const distance = Math.hypot(
|
|
355
|
+
event.clientX - this.dragStart.x,
|
|
356
|
+
event.clientY - this.dragStart.y
|
|
357
|
+
);
|
|
316
358
|
if (!this.isDragging && distance < DRAG_THRESHOLD) {
|
|
317
359
|
return;
|
|
318
360
|
}
|
|
@@ -484,7 +526,9 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
484
526
|
this.flattenedEvents = [];
|
|
485
527
|
} else {
|
|
486
528
|
this.agentEvents.delete(this.selectedContext);
|
|
487
|
-
this.flattenedEvents = this.flattenedEvents.filter(
|
|
529
|
+
this.flattenedEvents = this.flattenedEvents.filter(
|
|
530
|
+
(event) => event.agentId !== this.selectedContext
|
|
531
|
+
);
|
|
488
532
|
}
|
|
489
533
|
this.expandedRows.clear();
|
|
490
534
|
this.copiedEvents.clear();
|
|
@@ -667,19 +711,39 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
667
711
|
this.recordAgentEvent(agentId, "TEXT_MESSAGE_START", event);
|
|
668
712
|
},
|
|
669
713
|
onTextMessageContentEvent: ({ event, textMessageBuffer }) => {
|
|
670
|
-
this.recordAgentEvent(agentId, "TEXT_MESSAGE_CONTENT", {
|
|
714
|
+
this.recordAgentEvent(agentId, "TEXT_MESSAGE_CONTENT", {
|
|
715
|
+
event,
|
|
716
|
+
textMessageBuffer
|
|
717
|
+
});
|
|
671
718
|
},
|
|
672
719
|
onTextMessageEndEvent: ({ event, textMessageBuffer }) => {
|
|
673
|
-
this.recordAgentEvent(agentId, "TEXT_MESSAGE_END", {
|
|
720
|
+
this.recordAgentEvent(agentId, "TEXT_MESSAGE_END", {
|
|
721
|
+
event,
|
|
722
|
+
textMessageBuffer
|
|
723
|
+
});
|
|
674
724
|
},
|
|
675
725
|
onToolCallStartEvent: ({ event }) => {
|
|
676
726
|
this.recordAgentEvent(agentId, "TOOL_CALL_START", event);
|
|
677
727
|
},
|
|
678
|
-
onToolCallArgsEvent: ({
|
|
679
|
-
|
|
728
|
+
onToolCallArgsEvent: ({
|
|
729
|
+
event,
|
|
730
|
+
toolCallBuffer,
|
|
731
|
+
toolCallName,
|
|
732
|
+
partialToolCallArgs
|
|
733
|
+
}) => {
|
|
734
|
+
this.recordAgentEvent(agentId, "TOOL_CALL_ARGS", {
|
|
735
|
+
event,
|
|
736
|
+
toolCallBuffer,
|
|
737
|
+
toolCallName,
|
|
738
|
+
partialToolCallArgs
|
|
739
|
+
});
|
|
680
740
|
},
|
|
681
741
|
onToolCallEndEvent: ({ event, toolCallArgs, toolCallName }) => {
|
|
682
|
-
this.recordAgentEvent(agentId, "TOOL_CALL_END", {
|
|
742
|
+
this.recordAgentEvent(agentId, "TOOL_CALL_END", {
|
|
743
|
+
event,
|
|
744
|
+
toolCallArgs,
|
|
745
|
+
toolCallName
|
|
746
|
+
});
|
|
683
747
|
},
|
|
684
748
|
onToolCallResultEvent: ({ event }) => {
|
|
685
749
|
this.recordAgentEvent(agentId, "TOOL_CALL_RESULT", event);
|
|
@@ -732,9 +796,15 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
732
796
|
payload: normalizedPayload
|
|
733
797
|
};
|
|
734
798
|
const currentAgentEvents = this.agentEvents.get(agentId) ?? [];
|
|
735
|
-
const nextAgentEvents = [event, ...currentAgentEvents].slice(
|
|
799
|
+
const nextAgentEvents = [event, ...currentAgentEvents].slice(
|
|
800
|
+
0,
|
|
801
|
+
MAX_AGENT_EVENTS
|
|
802
|
+
);
|
|
736
803
|
this.agentEvents.set(agentId, nextAgentEvents);
|
|
737
|
-
this.flattenedEvents = [event, ...this.flattenedEvents].slice(
|
|
804
|
+
this.flattenedEvents = [event, ...this.flattenedEvents].slice(
|
|
805
|
+
0,
|
|
806
|
+
MAX_TOTAL_EVENTS
|
|
807
|
+
);
|
|
738
808
|
this.refreshToolsSnapshot();
|
|
739
809
|
this.requestUpdate();
|
|
740
810
|
}
|
|
@@ -742,7 +812,9 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
742
812
|
if (!agent?.agentId) {
|
|
743
813
|
return;
|
|
744
814
|
}
|
|
745
|
-
const messages = this.normalizeAgentMessages(
|
|
815
|
+
const messages = this.normalizeAgentMessages(
|
|
816
|
+
agent.messages
|
|
817
|
+
);
|
|
746
818
|
if (messages) {
|
|
747
819
|
this.agentMessages.set(agent.agentId, messages);
|
|
748
820
|
} else {
|
|
@@ -767,7 +839,9 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
767
839
|
{ key: "all-agents", label: "All Agents" },
|
|
768
840
|
...Array.from(agentIds).sort((a, b) => a.localeCompare(b)).map((id) => ({ key: id, label: id }))
|
|
769
841
|
];
|
|
770
|
-
const optionsChanged = this.contextOptions.length !== nextOptions.length || this.contextOptions.some(
|
|
842
|
+
const optionsChanged = this.contextOptions.length !== nextOptions.length || this.contextOptions.some(
|
|
843
|
+
(option, index) => option.key !== nextOptions[index]?.key
|
|
844
|
+
);
|
|
771
845
|
if (optionsChanged) {
|
|
772
846
|
this.contextOptions = nextOptions;
|
|
773
847
|
}
|
|
@@ -784,13 +858,17 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
784
858
|
this.pendingSelectedContext = null;
|
|
785
859
|
}
|
|
786
860
|
}
|
|
787
|
-
const hasSelectedContext = nextOptions.some(
|
|
861
|
+
const hasSelectedContext = nextOptions.some(
|
|
862
|
+
(option) => option.key === this.selectedContext
|
|
863
|
+
);
|
|
788
864
|
if (!hasSelectedContext && this.pendingSelectedContext === null) {
|
|
789
865
|
let nextSelected = "all-agents";
|
|
790
866
|
if (agentIds.has("default")) {
|
|
791
867
|
nextSelected = "default";
|
|
792
868
|
} else if (agentIds.size > 0) {
|
|
793
|
-
nextSelected = Array.from(agentIds).sort(
|
|
869
|
+
nextSelected = Array.from(agentIds).sort(
|
|
870
|
+
(a, b) => a.localeCompare(b)
|
|
871
|
+
)[0];
|
|
794
872
|
}
|
|
795
873
|
if (this.selectedContext !== nextSelected) {
|
|
796
874
|
this.selectedContext = nextSelected;
|
|
@@ -814,7 +892,10 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
814
892
|
if (!query) {
|
|
815
893
|
return true;
|
|
816
894
|
}
|
|
817
|
-
const payloadText = this.stringifyPayload(
|
|
895
|
+
const payloadText = this.stringifyPayload(
|
|
896
|
+
event.payload,
|
|
897
|
+
false
|
|
898
|
+
).toLowerCase();
|
|
818
899
|
return event.type.toLowerCase().includes(query) || event.agentId.toLowerCase().includes(query) || payloadText.includes(query);
|
|
819
900
|
});
|
|
820
901
|
}
|
|
@@ -839,7 +920,9 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
839
920
|
if (events.length === 0) {
|
|
840
921
|
return "idle";
|
|
841
922
|
}
|
|
842
|
-
const runEvent = events.find(
|
|
923
|
+
const runEvent = events.find(
|
|
924
|
+
(e) => e.type === "RUN_STARTED" || e.type === "RUN_FINISHED" || e.type === "RUN_ERROR"
|
|
925
|
+
);
|
|
843
926
|
if (!runEvent) {
|
|
844
927
|
return "idle";
|
|
845
928
|
}
|
|
@@ -857,7 +940,10 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
857
940
|
getAgentStats(agentId) {
|
|
858
941
|
const events = this.agentEvents.get(agentId) ?? [];
|
|
859
942
|
const messages = this.agentMessages.get(agentId);
|
|
860
|
-
const toolCallCount = messages ? messages.reduce(
|
|
943
|
+
const toolCallCount = messages ? messages.reduce(
|
|
944
|
+
(count, message) => count + (message.toolCalls?.length ?? 0),
|
|
945
|
+
0
|
|
946
|
+
) : events.filter((e) => e.type === "TOOL_CALL_END").length;
|
|
861
947
|
const messageCount = messages?.length ?? 0;
|
|
862
948
|
return {
|
|
863
949
|
totalEvents: events.length,
|
|
@@ -876,14 +962,24 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
876
962
|
${toolCalls.map((call, index) => {
|
|
877
963
|
const functionName = call.function?.name ?? call.toolName ?? "Unknown function";
|
|
878
964
|
const callId = typeof call?.id === "string" ? call.id : `tool-call-${index + 1}`;
|
|
879
|
-
const argsString = this.formatToolCallArguments(
|
|
965
|
+
const argsString = this.formatToolCallArguments(
|
|
966
|
+
call.function?.arguments
|
|
967
|
+
);
|
|
880
968
|
return import_lit.html`
|
|
881
|
-
<div
|
|
882
|
-
|
|
969
|
+
<div
|
|
970
|
+
class="rounded-md border border-gray-200 bg-gray-50 p-3 text-xs text-gray-700"
|
|
971
|
+
>
|
|
972
|
+
<div
|
|
973
|
+
class="flex flex-wrap items-center justify-between gap-1 font-medium text-gray-900"
|
|
974
|
+
>
|
|
883
975
|
<span>${functionName}</span>
|
|
884
976
|
<span class="text-[10px] text-gray-500">ID: ${callId}</span>
|
|
885
977
|
</div>
|
|
886
|
-
${argsString ? import_lit.html`<pre
|
|
978
|
+
${argsString ? import_lit.html`<pre
|
|
979
|
+
class="mt-2 overflow-auto rounded bg-white p-2 text-[11px] leading-relaxed text-gray-800"
|
|
980
|
+
>
|
|
981
|
+
${argsString}</pre
|
|
982
|
+
>` : import_lit.nothing}
|
|
887
983
|
</div>
|
|
888
984
|
`;
|
|
889
985
|
})}
|
|
@@ -1035,7 +1131,9 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
1035
1131
|
}
|
|
1036
1132
|
|
|
1037
1133
|
.inspector-window[data-transitioning="true"] {
|
|
1038
|
-
transition:
|
|
1134
|
+
transition:
|
|
1135
|
+
width 300ms ease,
|
|
1136
|
+
height 300ms ease;
|
|
1039
1137
|
}
|
|
1040
1138
|
|
|
1041
1139
|
.inspector-window[data-docked="true"] {
|
|
@@ -1080,7 +1178,9 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
1080
1178
|
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
|
|
1081
1179
|
opacity: 0;
|
|
1082
1180
|
pointer-events: none;
|
|
1083
|
-
transition:
|
|
1181
|
+
transition:
|
|
1182
|
+
opacity 120ms ease,
|
|
1183
|
+
transform 120ms ease;
|
|
1084
1184
|
z-index: 4000;
|
|
1085
1185
|
}
|
|
1086
1186
|
|
|
@@ -1152,7 +1252,9 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
1152
1252
|
border-radius: 8px;
|
|
1153
1253
|
border: 1px solid rgba(148, 163, 184, 0.5);
|
|
1154
1254
|
background: rgba(248, 250, 252, 0.9);
|
|
1155
|
-
transition:
|
|
1255
|
+
transition:
|
|
1256
|
+
background 120ms ease,
|
|
1257
|
+
color 120ms ease;
|
|
1156
1258
|
}
|
|
1157
1259
|
|
|
1158
1260
|
.announcement-dismiss:hover {
|
|
@@ -1212,7 +1314,10 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
1212
1314
|
super.connectedCallback();
|
|
1213
1315
|
if (typeof window !== "undefined") {
|
|
1214
1316
|
window.addEventListener("resize", this.handleResize);
|
|
1215
|
-
window.addEventListener(
|
|
1317
|
+
window.addEventListener(
|
|
1318
|
+
"pointerdown",
|
|
1319
|
+
this.handleGlobalPointerDown
|
|
1320
|
+
);
|
|
1216
1321
|
this.hydrateStateFromStorageEarly();
|
|
1217
1322
|
this.tryAutoAttachCore();
|
|
1218
1323
|
this.ensureAnnouncementLoading();
|
|
@@ -1222,7 +1327,10 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
1222
1327
|
super.disconnectedCallback();
|
|
1223
1328
|
if (typeof window !== "undefined") {
|
|
1224
1329
|
window.removeEventListener("resize", this.handleResize);
|
|
1225
|
-
window.removeEventListener(
|
|
1330
|
+
window.removeEventListener(
|
|
1331
|
+
"pointerdown",
|
|
1332
|
+
this.handleGlobalPointerDown
|
|
1333
|
+
);
|
|
1226
1334
|
}
|
|
1227
1335
|
this.removeDockStyles();
|
|
1228
1336
|
this.detachFromCore();
|
|
@@ -1305,7 +1413,12 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
1305
1413
|
@click=${this.handleButtonClick}
|
|
1306
1414
|
>
|
|
1307
1415
|
${this.renderAnnouncementPreview()}
|
|
1308
|
-
<img
|
|
1416
|
+
<img
|
|
1417
|
+
src=${inspector_logo_icon_default}
|
|
1418
|
+
alt="Inspector logo"
|
|
1419
|
+
class="h-5 w-auto"
|
|
1420
|
+
loading="lazy"
|
|
1421
|
+
/>
|
|
1309
1422
|
</button>
|
|
1310
1423
|
`;
|
|
1311
1424
|
}
|
|
@@ -1323,7 +1436,9 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
1323
1436
|
const contextDropdown = hasContextDropdown ? this.renderContextDropdown() : import_lit.nothing;
|
|
1324
1437
|
const coreStatus = this.getCoreStatusSummary();
|
|
1325
1438
|
const agentSelector = hasContextDropdown ? contextDropdown : import_lit.html`
|
|
1326
|
-
<div
|
|
1439
|
+
<div
|
|
1440
|
+
class="flex items-center gap-2 rounded-md border border-dashed border-gray-200 px-2 py-1 text-xs text-gray-400"
|
|
1441
|
+
>
|
|
1327
1442
|
<span>${this.renderIcon("Bot")}</span>
|
|
1328
1443
|
<span class="truncate">No agents available</span>
|
|
1329
1444
|
</div>
|
|
@@ -1346,7 +1461,9 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
1346
1461
|
@pointercancel=${this.handleResizePointerCancel}
|
|
1347
1462
|
></div>
|
|
1348
1463
|
` : import_lit.nothing}
|
|
1349
|
-
<div
|
|
1464
|
+
<div
|
|
1465
|
+
class="flex flex-1 flex-col overflow-hidden bg-white text-gray-800"
|
|
1466
|
+
>
|
|
1350
1467
|
<div
|
|
1351
1468
|
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"}"
|
|
1352
1469
|
data-drag-context="window"
|
|
@@ -1357,12 +1474,15 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
1357
1474
|
>
|
|
1358
1475
|
<div class="flex flex-wrap items-center gap-3 px-4 py-3">
|
|
1359
1476
|
<div class="flex items-center min-w-0">
|
|
1360
|
-
<img
|
|
1477
|
+
<img
|
|
1478
|
+
src=${inspector_logo_default}
|
|
1479
|
+
alt="Inspector logo"
|
|
1480
|
+
class="h-6 w-auto"
|
|
1481
|
+
loading="lazy"
|
|
1482
|
+
/>
|
|
1361
1483
|
</div>
|
|
1362
1484
|
<div class="ml-auto flex min-w-0 items-center gap-2">
|
|
1363
|
-
<div class="min-w-[160px] max-w-xs">
|
|
1364
|
-
${agentSelector}
|
|
1365
|
-
</div>
|
|
1485
|
+
<div class="min-w-[160px] max-w-xs">${agentSelector}</div>
|
|
1366
1486
|
<div class="flex items-center gap-1">
|
|
1367
1487
|
${this.renderDockControls()}
|
|
1368
1488
|
<button
|
|
@@ -1377,7 +1497,9 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
1377
1497
|
</div>
|
|
1378
1498
|
</div>
|
|
1379
1499
|
</div>
|
|
1380
|
-
<div
|
|
1500
|
+
<div
|
|
1501
|
+
class="flex flex-wrap items-center gap-2 border-t border-gray-100 px-3 py-2 text-xs"
|
|
1502
|
+
>
|
|
1381
1503
|
${this.menuItems.map(({ key, label, icon }) => {
|
|
1382
1504
|
const isSelected = this.selectedMenu === key;
|
|
1383
1505
|
const tabClasses = [
|
|
@@ -1391,7 +1513,9 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
1391
1513
|
aria-pressed=${isSelected}
|
|
1392
1514
|
@click=${() => this.handleMenuSelect(key)}
|
|
1393
1515
|
>
|
|
1394
|
-
<span
|
|
1516
|
+
<span
|
|
1517
|
+
class="text-gray-400 ${isSelected ? "text-white" : ""}"
|
|
1518
|
+
>
|
|
1395
1519
|
${this.renderIcon(icon)}
|
|
1396
1520
|
</span>
|
|
1397
1521
|
<span>${label}</span>
|
|
@@ -1400,27 +1524,30 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
1400
1524
|
})}
|
|
1401
1525
|
</div>
|
|
1402
1526
|
</div>
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
<div
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1527
|
+
<div class="flex flex-1 flex-col overflow-hidden">
|
|
1528
|
+
<div class="flex-1 overflow-auto">
|
|
1529
|
+
${this.renderAnnouncementPanel()}
|
|
1530
|
+
${this.renderCoreWarningBanner()} ${this.renderMainContent()}
|
|
1531
|
+
<slot></slot>
|
|
1532
|
+
</div>
|
|
1533
|
+
<div class="border-t border-gray-200 bg-gray-50 px-4 py-2">
|
|
1534
|
+
<div
|
|
1535
|
+
class="flex items-center gap-2 rounded-md px-3 py-2 text-xs ${coreStatus.tone} w-full overflow-hidden my-1"
|
|
1536
|
+
title=${coreStatus.description}
|
|
1537
|
+
>
|
|
1538
|
+
<span
|
|
1539
|
+
class="flex h-6 w-6 items-center justify-center rounded bg-white/60"
|
|
1540
|
+
>
|
|
1541
|
+
${this.renderIcon("Activity")}
|
|
1542
|
+
</span>
|
|
1543
|
+
<span class="font-medium">${coreStatus.label}</span>
|
|
1544
|
+
<span class="truncate text-[11px] opacity-80"
|
|
1545
|
+
>${coreStatus.description}</span
|
|
1414
1546
|
>
|
|
1415
|
-
<span class="flex h-6 w-6 items-center justify-center rounded bg-white/60">
|
|
1416
|
-
${this.renderIcon("Activity")}
|
|
1417
|
-
</span>
|
|
1418
|
-
<span class="font-medium">${coreStatus.label}</span>
|
|
1419
|
-
<span class="truncate text-[11px] opacity-80">${coreStatus.description}</span>
|
|
1420
|
-
</div>
|
|
1421
1547
|
</div>
|
|
1422
1548
|
</div>
|
|
1423
1549
|
</div>
|
|
1550
|
+
</div>
|
|
1424
1551
|
<div
|
|
1425
1552
|
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"
|
|
1426
1553
|
role="presentation"
|
|
@@ -1460,7 +1587,9 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
1460
1587
|
this.dockMode = persisted.dockMode;
|
|
1461
1588
|
}
|
|
1462
1589
|
if (typeof persisted.selectedMenu === "string") {
|
|
1463
|
-
const validMenu = this.menuItems.find(
|
|
1590
|
+
const validMenu = this.menuItems.find(
|
|
1591
|
+
(item) => item.key === persisted.selectedMenu
|
|
1592
|
+
);
|
|
1464
1593
|
if (validMenu) {
|
|
1465
1594
|
this.selectedMenu = validMenu.key;
|
|
1466
1595
|
}
|
|
@@ -1499,7 +1628,9 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
1499
1628
|
this.contextState.window.anchorOffset = persistedWindow.anchorOffset;
|
|
1500
1629
|
}
|
|
1501
1630
|
if (isValidSize(persistedWindow.size)) {
|
|
1502
|
-
this.contextState.window.size = this.clampWindowSize(
|
|
1631
|
+
this.contextState.window.size = this.clampWindowSize(
|
|
1632
|
+
persistedWindow.size
|
|
1633
|
+
);
|
|
1503
1634
|
}
|
|
1504
1635
|
if (typeof persistedWindow.hasCustomPosition === "boolean") {
|
|
1505
1636
|
this.hasCustomPosition.window = persistedWindow.hasCustomPosition;
|
|
@@ -1515,7 +1646,9 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
1515
1646
|
}
|
|
1516
1647
|
measureContext(context) {
|
|
1517
1648
|
const selector = context === "window" ? ".inspector-window" : ".console-button";
|
|
1518
|
-
const element = this.renderRoot?.querySelector(
|
|
1649
|
+
const element = this.renderRoot?.querySelector(
|
|
1650
|
+
selector
|
|
1651
|
+
);
|
|
1519
1652
|
if (!element) {
|
|
1520
1653
|
return;
|
|
1521
1654
|
}
|
|
@@ -1544,7 +1677,11 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
1544
1677
|
}
|
|
1545
1678
|
const viewport = this.getViewportSize();
|
|
1546
1679
|
keepPositionWithinViewport(this.contextState.window, viewport, EDGE_MARGIN);
|
|
1547
|
-
updateAnchorFromPosition(
|
|
1680
|
+
updateAnchorFromPosition(
|
|
1681
|
+
this.contextState.window,
|
|
1682
|
+
viewport,
|
|
1683
|
+
EDGE_MARGIN
|
|
1684
|
+
);
|
|
1548
1685
|
this.updateHostTransform("window");
|
|
1549
1686
|
this.persistState();
|
|
1550
1687
|
}
|
|
@@ -1553,14 +1690,23 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
1553
1690
|
return position;
|
|
1554
1691
|
}
|
|
1555
1692
|
const viewport = this.getViewportSize();
|
|
1556
|
-
return constrainToViewport(
|
|
1693
|
+
return constrainToViewport(
|
|
1694
|
+
this.contextState[context],
|
|
1695
|
+
position,
|
|
1696
|
+
viewport,
|
|
1697
|
+
EDGE_MARGIN
|
|
1698
|
+
);
|
|
1557
1699
|
}
|
|
1558
1700
|
keepPositionWithinViewport(context) {
|
|
1559
1701
|
if (typeof window === "undefined") {
|
|
1560
1702
|
return;
|
|
1561
1703
|
}
|
|
1562
1704
|
const viewport = this.getViewportSize();
|
|
1563
|
-
keepPositionWithinViewport(
|
|
1705
|
+
keepPositionWithinViewport(
|
|
1706
|
+
this.contextState[context],
|
|
1707
|
+
viewport,
|
|
1708
|
+
EDGE_MARGIN
|
|
1709
|
+
);
|
|
1564
1710
|
}
|
|
1565
1711
|
getViewportSize() {
|
|
1566
1712
|
if (typeof window === "undefined") {
|
|
@@ -1601,7 +1747,13 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
1601
1747
|
};
|
|
1602
1748
|
}
|
|
1603
1749
|
const viewport = this.getViewportSize();
|
|
1604
|
-
return clampSize(
|
|
1750
|
+
return clampSize(
|
|
1751
|
+
size,
|
|
1752
|
+
viewport,
|
|
1753
|
+
EDGE_MARGIN,
|
|
1754
|
+
minWidth,
|
|
1755
|
+
MIN_WINDOW_HEIGHT
|
|
1756
|
+
);
|
|
1605
1757
|
}
|
|
1606
1758
|
setDockMode(mode) {
|
|
1607
1759
|
if (this.dockMode === mode) {
|
|
@@ -1699,7 +1851,11 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
1699
1851
|
return;
|
|
1700
1852
|
}
|
|
1701
1853
|
const viewport = this.getViewportSize();
|
|
1702
|
-
updateAnchorFromPosition(
|
|
1854
|
+
updateAnchorFromPosition(
|
|
1855
|
+
this.contextState[context],
|
|
1856
|
+
viewport,
|
|
1857
|
+
EDGE_MARGIN
|
|
1858
|
+
);
|
|
1703
1859
|
}
|
|
1704
1860
|
snapButtonToCorner() {
|
|
1705
1861
|
if (typeof window === "undefined") {
|
|
@@ -1721,7 +1877,11 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
1721
1877
|
return;
|
|
1722
1878
|
}
|
|
1723
1879
|
const viewport = this.getViewportSize();
|
|
1724
|
-
applyAnchorPosition(
|
|
1880
|
+
applyAnchorPosition(
|
|
1881
|
+
this.contextState[context],
|
|
1882
|
+
viewport,
|
|
1883
|
+
EDGE_MARGIN
|
|
1884
|
+
);
|
|
1725
1885
|
this.updateHostTransform(context);
|
|
1726
1886
|
this.persistState();
|
|
1727
1887
|
}
|
|
@@ -1849,7 +2009,11 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
1849
2009
|
this.setDockMode(mode);
|
|
1850
2010
|
}
|
|
1851
2011
|
serializeAttributes(attributes) {
|
|
1852
|
-
return Object.entries(attributes).filter(
|
|
2012
|
+
return Object.entries(attributes).filter(
|
|
2013
|
+
([key, value]) => key !== "key" && value !== void 0 && value !== null && value !== ""
|
|
2014
|
+
).map(
|
|
2015
|
+
([key, value]) => `${key}="${String(value).replace(/"/g, """)}"`
|
|
2016
|
+
).join(" ");
|
|
1853
2017
|
}
|
|
1854
2018
|
sanitizeForLogging(value, depth = 0, seen = /* @__PURE__ */ new WeakSet()) {
|
|
1855
2019
|
if (value === void 0) {
|
|
@@ -1871,7 +2035,9 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
1871
2035
|
if (depth >= 4) {
|
|
1872
2036
|
return "[Truncated depth]";
|
|
1873
2037
|
}
|
|
1874
|
-
return value.map(
|
|
2038
|
+
return value.map(
|
|
2039
|
+
(item) => this.sanitizeForLogging(item, depth + 1, seen)
|
|
2040
|
+
);
|
|
1875
2041
|
}
|
|
1876
2042
|
if (typeof value === "object") {
|
|
1877
2043
|
if (seen.has(value)) {
|
|
@@ -1882,7 +2048,9 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
1882
2048
|
return "[Truncated depth]";
|
|
1883
2049
|
}
|
|
1884
2050
|
const result = {};
|
|
1885
|
-
for (const [key, entry] of Object.entries(
|
|
2051
|
+
for (const [key, entry] of Object.entries(
|
|
2052
|
+
value
|
|
2053
|
+
)) {
|
|
1886
2054
|
result[key] = this.sanitizeForLogging(entry, depth + 1, seen);
|
|
1887
2055
|
}
|
|
1888
2056
|
return result;
|
|
@@ -1993,12 +2161,19 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
1993
2161
|
return import_lit.nothing;
|
|
1994
2162
|
}
|
|
1995
2163
|
return import_lit.html`
|
|
1996
|
-
<div
|
|
1997
|
-
|
|
2164
|
+
<div
|
|
2165
|
+
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"
|
|
2166
|
+
>
|
|
2167
|
+
<span class="mt-0.5 shrink-0 text-amber-600"
|
|
2168
|
+
>${this.renderIcon("AlertTriangle")}</span
|
|
2169
|
+
>
|
|
1998
2170
|
<div class="space-y-1">
|
|
1999
|
-
<div class="font-semibold text-amber-900">
|
|
2171
|
+
<div class="font-semibold text-amber-900">
|
|
2172
|
+
CopilotKit core not attached
|
|
2173
|
+
</div>
|
|
2000
2174
|
<p class="text-[11px] leading-snug text-amber-800">
|
|
2001
|
-
Pass a live <code>CopilotKitCore</code> instance to
|
|
2175
|
+
Pass a live <code>CopilotKitCore</code> instance to
|
|
2176
|
+
<code><cpk-web-inspector></code> or expose it on
|
|
2002
2177
|
<code>window.__COPILOTKIT_CORE__</code> for auto-attach.
|
|
2003
2178
|
</p>
|
|
2004
2179
|
</div>
|
|
@@ -2063,25 +2238,37 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
2063
2238
|
const selectedLabel = this.selectedContext === "all-agents" ? "all agents" : `agent ${this.selectedContext}`;
|
|
2064
2239
|
if (events.length === 0) {
|
|
2065
2240
|
return import_lit.html`
|
|
2066
|
-
<div
|
|
2241
|
+
<div
|
|
2242
|
+
class="flex h-full items-center justify-center px-4 py-8 text-center"
|
|
2243
|
+
>
|
|
2067
2244
|
<div class="max-w-md">
|
|
2068
|
-
<div
|
|
2245
|
+
<div
|
|
2246
|
+
class="mb-3 flex justify-center text-gray-300 [&>svg]:!h-8 [&>svg]:!w-8"
|
|
2247
|
+
>
|
|
2069
2248
|
${this.renderIcon("Zap")}
|
|
2070
2249
|
</div>
|
|
2071
2250
|
<p class="text-sm text-gray-600">No events yet</p>
|
|
2072
|
-
<p class="mt-2 text-xs text-gray-500">
|
|
2251
|
+
<p class="mt-2 text-xs text-gray-500">
|
|
2252
|
+
Trigger an agent run to see live activity.
|
|
2253
|
+
</p>
|
|
2073
2254
|
</div>
|
|
2074
2255
|
</div>
|
|
2075
2256
|
`;
|
|
2076
2257
|
}
|
|
2077
2258
|
if (filteredEvents.length === 0) {
|
|
2078
2259
|
return import_lit.html`
|
|
2079
|
-
<div
|
|
2260
|
+
<div
|
|
2261
|
+
class="flex h-full items-center justify-center px-4 py-8 text-center"
|
|
2262
|
+
>
|
|
2080
2263
|
<div class="max-w-md space-y-3">
|
|
2081
|
-
<div
|
|
2264
|
+
<div
|
|
2265
|
+
class="flex justify-center text-gray-300 [&>svg]:!h-8 [&>svg]:!w-8"
|
|
2266
|
+
>
|
|
2082
2267
|
${this.renderIcon("Filter")}
|
|
2083
2268
|
</div>
|
|
2084
|
-
<p class="text-sm text-gray-600">
|
|
2269
|
+
<p class="text-sm text-gray-600">
|
|
2270
|
+
No events match the current filters.
|
|
2271
|
+
</p>
|
|
2085
2272
|
<div>
|
|
2086
2273
|
<button
|
|
2087
2274
|
type="button"
|
|
@@ -2098,7 +2285,9 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
2098
2285
|
}
|
|
2099
2286
|
return import_lit.html`
|
|
2100
2287
|
<div class="flex h-full flex-col">
|
|
2101
|
-
<div
|
|
2288
|
+
<div
|
|
2289
|
+
class="flex flex-col gap-1.5 border-b border-gray-200 bg-white px-4 py-2.5"
|
|
2290
|
+
>
|
|
2102
2291
|
<div class="flex flex-wrap items-center gap-2">
|
|
2103
2292
|
<div class="relative min-w-[200px] flex-1">
|
|
2104
2293
|
<input
|
|
@@ -2116,7 +2305,9 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
2116
2305
|
>
|
|
2117
2306
|
<option value="all">All event types</option>
|
|
2118
2307
|
${AGENT_EVENT_TYPES.map(
|
|
2119
|
-
(type) => import_lit.html`<option value=${type}
|
|
2308
|
+
(type) => import_lit.html`<option value=${type}>
|
|
2309
|
+
${type.toLowerCase().replace(/_/g, " ")}
|
|
2310
|
+
</option>`
|
|
2120
2311
|
)}
|
|
2121
2312
|
</select>
|
|
2122
2313
|
<div class="flex items-center gap-1 text-[11px]">
|
|
@@ -2156,23 +2347,32 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
2156
2347
|
</div>
|
|
2157
2348
|
</div>
|
|
2158
2349
|
<div class="text-[11px] text-gray-500">
|
|
2159
|
-
Showing ${filteredEvents.length} of
|
|
2350
|
+
Showing ${filteredEvents.length} of
|
|
2351
|
+
${events.length}${this.selectedContext === "all-agents" ? "" : ` for ${selectedLabel}`}
|
|
2160
2352
|
</div>
|
|
2161
2353
|
</div>
|
|
2162
2354
|
<div class="relative h-full w-full overflow-y-auto overflow-x-hidden">
|
|
2163
2355
|
<table class="w-full table-fixed border-collapse text-xs box-border">
|
|
2164
2356
|
<thead class="sticky top-0 z-10">
|
|
2165
2357
|
<tr class="bg-white">
|
|
2166
|
-
<th
|
|
2358
|
+
<th
|
|
2359
|
+
class="border-b border-gray-200 bg-white px-3 py-2 text-left font-medium text-gray-900"
|
|
2360
|
+
>
|
|
2167
2361
|
Agent
|
|
2168
2362
|
</th>
|
|
2169
|
-
<th
|
|
2363
|
+
<th
|
|
2364
|
+
class="border-b border-gray-200 bg-white px-3 py-2 text-left font-medium text-gray-900"
|
|
2365
|
+
>
|
|
2170
2366
|
Time
|
|
2171
2367
|
</th>
|
|
2172
|
-
<th
|
|
2368
|
+
<th
|
|
2369
|
+
class="border-b border-gray-200 bg-white px-3 py-2 text-left font-medium text-gray-900"
|
|
2370
|
+
>
|
|
2173
2371
|
Event Type
|
|
2174
2372
|
</th>
|
|
2175
|
-
<th
|
|
2373
|
+
<th
|
|
2374
|
+
class="border-b border-gray-200 bg-white px-3 py-2 text-left font-medium text-gray-900"
|
|
2375
|
+
>
|
|
2176
2376
|
AG-UI Event
|
|
2177
2377
|
</th>
|
|
2178
2378
|
</tr>
|
|
@@ -2181,7 +2381,9 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
2181
2381
|
${filteredEvents.map((event, index) => {
|
|
2182
2382
|
const rowBg = index % 2 === 0 ? "bg-white" : "bg-gray-50/50";
|
|
2183
2383
|
const badgeClasses = this.getEventBadgeClasses(event.type);
|
|
2184
|
-
const extractedEvent = this.extractEventFromPayload(
|
|
2384
|
+
const extractedEvent = this.extractEventFromPayload(
|
|
2385
|
+
event.payload
|
|
2386
|
+
);
|
|
2185
2387
|
const inlineEvent = this.stringifyPayload(extractedEvent, false) || "\u2014";
|
|
2186
2388
|
const prettyEvent = this.stringifyPayload(extractedEvent, true) || inlineEvent;
|
|
2187
2389
|
const isExpanded = this.expandedRows.has(event.id);
|
|
@@ -2190,10 +2392,16 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
2190
2392
|
class="${rowBg} cursor-pointer transition hover:bg-blue-50/50"
|
|
2191
2393
|
@click=${() => this.toggleRowExpansion(event.id)}
|
|
2192
2394
|
>
|
|
2193
|
-
<td
|
|
2194
|
-
|
|
2395
|
+
<td
|
|
2396
|
+
class="border-l border-r border-b border-gray-200 px-3 py-2"
|
|
2397
|
+
>
|
|
2398
|
+
<span class="font-mono text-[11px] text-gray-600"
|
|
2399
|
+
>${event.agentId}</span
|
|
2400
|
+
>
|
|
2195
2401
|
</td>
|
|
2196
|
-
<td
|
|
2402
|
+
<td
|
|
2403
|
+
class="border-r border-b border-gray-200 px-3 py-2 font-mono text-[11px] text-gray-600"
|
|
2404
|
+
>
|
|
2197
2405
|
<span title=${new Date(event.timestamp).toLocaleString()}>
|
|
2198
2406
|
${new Date(event.timestamp).toLocaleTimeString()}
|
|
2199
2407
|
</span>
|
|
@@ -2201,12 +2409,20 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
2201
2409
|
<td class="border-r border-b border-gray-200 px-3 py-2">
|
|
2202
2410
|
<span class=${badgeClasses}>${event.type}</span>
|
|
2203
2411
|
</td>
|
|
2204
|
-
<td
|
|
2412
|
+
<td
|
|
2413
|
+
class="border-r border-b border-gray-200 px-3 py-2 font-mono text-[10px] text-gray-600 ${isExpanded ? "" : "truncate max-w-xs"}"
|
|
2414
|
+
>
|
|
2205
2415
|
${isExpanded ? import_lit.html`
|
|
2206
2416
|
<div class="group relative">
|
|
2207
|
-
<pre
|
|
2417
|
+
<pre
|
|
2418
|
+
class="m-0 whitespace-pre-wrap break-words text-[10px] font-mono text-gray-600"
|
|
2419
|
+
>
|
|
2420
|
+
${prettyEvent}</pre
|
|
2421
|
+
>
|
|
2208
2422
|
<button
|
|
2209
|
-
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(
|
|
2423
|
+
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(
|
|
2424
|
+
event.id
|
|
2425
|
+
) ? "bg-green-100 text-green-700" : "bg-gray-100 text-gray-600 hover:bg-gray-200 hover:text-gray-900"}"
|
|
2210
2426
|
@click=${(e) => {
|
|
2211
2427
|
e.stopPropagation();
|
|
2212
2428
|
this.copyToClipboard(prettyEvent, event.id);
|
|
@@ -2262,13 +2478,19 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
2262
2478
|
renderAgentsView() {
|
|
2263
2479
|
if (this.selectedContext === "all-agents") {
|
|
2264
2480
|
return import_lit.html`
|
|
2265
|
-
<div
|
|
2481
|
+
<div
|
|
2482
|
+
class="flex h-full items-center justify-center px-4 py-8 text-center"
|
|
2483
|
+
>
|
|
2266
2484
|
<div class="max-w-md">
|
|
2267
|
-
<div
|
|
2485
|
+
<div
|
|
2486
|
+
class="mb-3 flex justify-center text-gray-300 [&>svg]:!h-8 [&>svg]:!w-8"
|
|
2487
|
+
>
|
|
2268
2488
|
${this.renderIcon("Bot")}
|
|
2269
2489
|
</div>
|
|
2270
2490
|
<p class="text-sm text-gray-600">No agent selected</p>
|
|
2271
|
-
<p class="mt-2 text-xs text-gray-500">
|
|
2491
|
+
<p class="mt-2 text-xs text-gray-500">
|
|
2492
|
+
Select an agent from the dropdown above to view details.
|
|
2493
|
+
</p>
|
|
2272
2494
|
</div>
|
|
2273
2495
|
</div>
|
|
2274
2496
|
`;
|
|
@@ -2289,18 +2511,27 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
2289
2511
|
<div class="rounded-lg border border-gray-200 bg-white p-4">
|
|
2290
2512
|
<div class="flex items-start justify-between mb-4">
|
|
2291
2513
|
<div class="flex items-center gap-3">
|
|
2292
|
-
<div
|
|
2514
|
+
<div
|
|
2515
|
+
class="flex h-10 w-10 items-center justify-center rounded-lg bg-blue-100 text-blue-600"
|
|
2516
|
+
>
|
|
2293
2517
|
${this.renderIcon("Bot")}
|
|
2294
2518
|
</div>
|
|
2295
2519
|
<div>
|
|
2296
2520
|
<h3 class="font-semibold text-sm text-gray-900">${agentId}</h3>
|
|
2297
|
-
<span
|
|
2298
|
-
|
|
2521
|
+
<span
|
|
2522
|
+
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]"
|
|
2523
|
+
>
|
|
2524
|
+
<span
|
|
2525
|
+
class="h-1.5 w-1.5 rounded-full ${status === "running" ? "bg-emerald-500 animate-pulse" : status === "error" ? "bg-rose-500" : "bg-gray-400"}"
|
|
2526
|
+
></span>
|
|
2299
2527
|
${status.charAt(0).toUpperCase() + status.slice(1)}
|
|
2300
2528
|
</span>
|
|
2301
2529
|
</div>
|
|
2302
2530
|
</div>
|
|
2303
|
-
${stats.lastActivity ? import_lit.html`<span class="text-xs text-gray-500"
|
|
2531
|
+
${stats.lastActivity ? import_lit.html`<span class="text-xs text-gray-500"
|
|
2532
|
+
>Last activity:
|
|
2533
|
+
${new Date(stats.lastActivity).toLocaleTimeString()}</span
|
|
2534
|
+
>` : import_lit.nothing}
|
|
2304
2535
|
</div>
|
|
2305
2536
|
<div class="grid grid-cols-2 gap-4 md:grid-cols-4">
|
|
2306
2537
|
<button
|
|
@@ -2309,20 +2540,36 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
2309
2540
|
@click=${() => this.handleMenuSelect("ag-ui-events")}
|
|
2310
2541
|
title="View all events in AG-UI Events"
|
|
2311
2542
|
>
|
|
2312
|
-
<div class="truncate whitespace-nowrap text-xs text-gray-600">
|
|
2313
|
-
|
|
2543
|
+
<div class="truncate whitespace-nowrap text-xs text-gray-600">
|
|
2544
|
+
Total Events
|
|
2545
|
+
</div>
|
|
2546
|
+
<div class="text-lg font-semibold text-gray-900">
|
|
2547
|
+
${stats.totalEvents}
|
|
2548
|
+
</div>
|
|
2314
2549
|
</button>
|
|
2315
2550
|
<div class="rounded-md bg-gray-50 px-3 py-2 overflow-hidden">
|
|
2316
|
-
<div class="truncate whitespace-nowrap text-xs text-gray-600">
|
|
2317
|
-
|
|
2551
|
+
<div class="truncate whitespace-nowrap text-xs text-gray-600">
|
|
2552
|
+
Messages
|
|
2553
|
+
</div>
|
|
2554
|
+
<div class="text-lg font-semibold text-gray-900">
|
|
2555
|
+
${stats.messages}
|
|
2556
|
+
</div>
|
|
2318
2557
|
</div>
|
|
2319
2558
|
<div class="rounded-md bg-gray-50 px-3 py-2 overflow-hidden">
|
|
2320
|
-
<div class="truncate whitespace-nowrap text-xs text-gray-600">
|
|
2321
|
-
|
|
2559
|
+
<div class="truncate whitespace-nowrap text-xs text-gray-600">
|
|
2560
|
+
Tool Calls
|
|
2561
|
+
</div>
|
|
2562
|
+
<div class="text-lg font-semibold text-gray-900">
|
|
2563
|
+
${stats.toolCalls}
|
|
2564
|
+
</div>
|
|
2322
2565
|
</div>
|
|
2323
2566
|
<div class="rounded-md bg-gray-50 px-3 py-2 overflow-hidden">
|
|
2324
|
-
<div class="truncate whitespace-nowrap text-xs text-gray-600">
|
|
2325
|
-
|
|
2567
|
+
<div class="truncate whitespace-nowrap text-xs text-gray-600">
|
|
2568
|
+
Errors
|
|
2569
|
+
</div>
|
|
2570
|
+
<div class="text-lg font-semibold text-gray-900">
|
|
2571
|
+
${stats.errors}
|
|
2572
|
+
</div>
|
|
2326
2573
|
</div>
|
|
2327
2574
|
</div>
|
|
2328
2575
|
</div>
|
|
@@ -2334,11 +2581,17 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
2334
2581
|
</div>
|
|
2335
2582
|
<div class="overflow-auto p-4">
|
|
2336
2583
|
${this.hasRenderableState(state) ? import_lit.html`
|
|
2337
|
-
<pre
|
|
2584
|
+
<pre
|
|
2585
|
+
class="overflow-auto rounded-md bg-gray-50 p-3 text-xs text-gray-800 max-h-64"
|
|
2586
|
+
><code>${this.formatStateForDisplay(state)}</code></pre>
|
|
2338
2587
|
` : import_lit.html`
|
|
2339
|
-
<div
|
|
2588
|
+
<div
|
|
2589
|
+
class="flex h-40 items-center justify-center text-xs text-gray-500"
|
|
2590
|
+
>
|
|
2340
2591
|
<div class="flex items-center gap-2 text-gray-500">
|
|
2341
|
-
<span class="text-lg text-gray-400"
|
|
2592
|
+
<span class="text-lg text-gray-400"
|
|
2593
|
+
>${this.renderIcon("Database")}</span
|
|
2594
|
+
>
|
|
2342
2595
|
<span>State is empty</span>
|
|
2343
2596
|
</div>
|
|
2344
2597
|
</div>
|
|
@@ -2349,15 +2602,25 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
2349
2602
|
<!-- Current Messages Section -->
|
|
2350
2603
|
<div class="rounded-lg border border-gray-200 bg-white">
|
|
2351
2604
|
<div class="border-b border-gray-200 px-4 py-3">
|
|
2352
|
-
<h4 class="text-sm font-semibold text-gray-900">
|
|
2605
|
+
<h4 class="text-sm font-semibold text-gray-900">
|
|
2606
|
+
Current Messages
|
|
2607
|
+
</h4>
|
|
2353
2608
|
</div>
|
|
2354
2609
|
<div class="overflow-auto">
|
|
2355
2610
|
${messages && messages.length > 0 ? import_lit.html`
|
|
2356
2611
|
<table class="w-full text-xs">
|
|
2357
2612
|
<thead class="bg-gray-50">
|
|
2358
2613
|
<tr>
|
|
2359
|
-
<th
|
|
2360
|
-
|
|
2614
|
+
<th
|
|
2615
|
+
class="px-4 py-2 text-left font-medium text-gray-700"
|
|
2616
|
+
>
|
|
2617
|
+
Role
|
|
2618
|
+
</th>
|
|
2619
|
+
<th
|
|
2620
|
+
class="px-4 py-2 text-left font-medium text-gray-700"
|
|
2621
|
+
>
|
|
2622
|
+
Content
|
|
2623
|
+
</th>
|
|
2361
2624
|
</tr>
|
|
2362
2625
|
</thead>
|
|
2363
2626
|
<tbody class="divide-y divide-gray-200">
|
|
@@ -2377,12 +2640,22 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
2377
2640
|
return import_lit.html`
|
|
2378
2641
|
<tr>
|
|
2379
2642
|
<td class="px-4 py-2 align-top">
|
|
2380
|
-
<span
|
|
2643
|
+
<span
|
|
2644
|
+
class="inline-flex rounded px-2 py-0.5 text-[10px] font-medium ${roleColors[role] || roleColors.unknown}"
|
|
2645
|
+
>
|
|
2381
2646
|
${role}
|
|
2382
2647
|
</span>
|
|
2383
2648
|
</td>
|
|
2384
2649
|
<td class="px-4 py-2">
|
|
2385
|
-
${hasContent ? import_lit.html`<div
|
|
2650
|
+
${hasContent ? import_lit.html`<div
|
|
2651
|
+
class="max-w-2xl whitespace-pre-wrap break-words text-gray-700"
|
|
2652
|
+
>
|
|
2653
|
+
${rawContent}
|
|
2654
|
+
</div>` : import_lit.html`<div
|
|
2655
|
+
class="text-xs italic text-gray-400"
|
|
2656
|
+
>
|
|
2657
|
+
${contentFallback}
|
|
2658
|
+
</div>`}
|
|
2386
2659
|
${role === "assistant" && toolCalls.length > 0 ? this.renderToolCallDetails(toolCalls) : import_lit.nothing}
|
|
2387
2660
|
</td>
|
|
2388
2661
|
</tr>
|
|
@@ -2391,9 +2664,13 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
2391
2664
|
</tbody>
|
|
2392
2665
|
</table>
|
|
2393
2666
|
` : import_lit.html`
|
|
2394
|
-
<div
|
|
2667
|
+
<div
|
|
2668
|
+
class="flex h-40 items-center justify-center text-xs text-gray-500"
|
|
2669
|
+
>
|
|
2395
2670
|
<div class="flex items-center gap-2 text-gray-500">
|
|
2396
|
-
<span class="text-lg text-gray-400"
|
|
2671
|
+
<span class="text-lg text-gray-400"
|
|
2672
|
+
>${this.renderIcon("MessageSquare")}</span
|
|
2673
|
+
>
|
|
2397
2674
|
<span>No messages available</span>
|
|
2398
2675
|
</div>
|
|
2399
2676
|
</div>
|
|
@@ -2407,14 +2684,19 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
2407
2684
|
const filteredOptions = this.selectedMenu === "agents" ? this.contextOptions.filter((opt) => opt.key !== "all-agents") : this.contextOptions;
|
|
2408
2685
|
const selectedLabel = filteredOptions.find((opt) => opt.key === this.selectedContext)?.label ?? "";
|
|
2409
2686
|
return import_lit.html`
|
|
2410
|
-
<div
|
|
2687
|
+
<div
|
|
2688
|
+
class="relative z-40 min-w-0 flex-1"
|
|
2689
|
+
data-context-dropdown-root="true"
|
|
2690
|
+
>
|
|
2411
2691
|
<button
|
|
2412
2692
|
type="button"
|
|
2413
2693
|
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"
|
|
2414
2694
|
@pointerdown=${this.handleContextDropdownToggle}
|
|
2415
2695
|
>
|
|
2416
2696
|
<span class="truncate flex-1 text-left">${selectedLabel}</span>
|
|
2417
|
-
<span class="shrink-0 text-gray-400"
|
|
2697
|
+
<span class="shrink-0 text-gray-400"
|
|
2698
|
+
>${this.renderIcon("ChevronDown")}</span
|
|
2699
|
+
>
|
|
2418
2700
|
</button>
|
|
2419
2701
|
${this.contextMenuOpen ? import_lit.html`
|
|
2420
2702
|
<div
|
|
@@ -2429,8 +2711,13 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
2429
2711
|
data-context-dropdown-root="true"
|
|
2430
2712
|
@click=${() => this.handleContextOptionSelect(option.key)}
|
|
2431
2713
|
>
|
|
2432
|
-
<span
|
|
2433
|
-
|
|
2714
|
+
<span
|
|
2715
|
+
class="truncate ${option.key === this.selectedContext ? "text-gray-900 font-medium" : "text-gray-600"}"
|
|
2716
|
+
>${option.label}</span
|
|
2717
|
+
>
|
|
2718
|
+
${option.key === this.selectedContext ? import_lit.html`<span class="text-gray-500"
|
|
2719
|
+
>${this.renderIcon("Check")}</span
|
|
2720
|
+
>` : import_lit.nothing}
|
|
2434
2721
|
</button>
|
|
2435
2722
|
`
|
|
2436
2723
|
)}
|
|
@@ -2445,7 +2732,9 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
2445
2732
|
}
|
|
2446
2733
|
this.selectedMenu = key;
|
|
2447
2734
|
if (key === "agents" && this.selectedContext === "all-agents") {
|
|
2448
|
-
const agentOptions = this.contextOptions.filter(
|
|
2735
|
+
const agentOptions = this.contextOptions.filter(
|
|
2736
|
+
(opt) => opt.key !== "all-agents"
|
|
2737
|
+
);
|
|
2449
2738
|
if (agentOptions.length > 0) {
|
|
2450
2739
|
const defaultAgent = agentOptions.find((opt) => opt.key === "default");
|
|
2451
2740
|
this.selectedContext = defaultAgent ? defaultAgent.key : agentOptions[0].key;
|
|
@@ -2476,7 +2765,9 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
2476
2765
|
renderToolsView() {
|
|
2477
2766
|
if (!this._core) {
|
|
2478
2767
|
return import_lit.html`
|
|
2479
|
-
<div
|
|
2768
|
+
<div
|
|
2769
|
+
class="flex h-full items-center justify-center px-4 py-8 text-xs text-gray-500"
|
|
2770
|
+
>
|
|
2480
2771
|
No core instance available
|
|
2481
2772
|
</div>
|
|
2482
2773
|
`;
|
|
@@ -2485,18 +2776,27 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
2485
2776
|
const allTools = this.cachedTools;
|
|
2486
2777
|
if (allTools.length === 0) {
|
|
2487
2778
|
return import_lit.html`
|
|
2488
|
-
<div
|
|
2779
|
+
<div
|
|
2780
|
+
class="flex h-full items-center justify-center px-4 py-8 text-center"
|
|
2781
|
+
>
|
|
2489
2782
|
<div class="max-w-md">
|
|
2490
|
-
<div
|
|
2783
|
+
<div
|
|
2784
|
+
class="mb-3 flex justify-center text-gray-300 [&>svg]:!h-8 [&>svg]:!w-8"
|
|
2785
|
+
>
|
|
2491
2786
|
${this.renderIcon("Hammer")}
|
|
2492
2787
|
</div>
|
|
2493
2788
|
<p class="text-sm text-gray-600">No tools available</p>
|
|
2494
|
-
<p class="mt-2 text-xs text-gray-500">
|
|
2789
|
+
<p class="mt-2 text-xs text-gray-500">
|
|
2790
|
+
Tools will appear here once agents are configured with tool
|
|
2791
|
+
handlers or renderers.
|
|
2792
|
+
</p>
|
|
2495
2793
|
</div>
|
|
2496
2794
|
</div>
|
|
2497
2795
|
`;
|
|
2498
2796
|
}
|
|
2499
|
-
const filteredTools = this.selectedContext === "all-agents" ? allTools : allTools.filter(
|
|
2797
|
+
const filteredTools = this.selectedContext === "all-agents" ? allTools : allTools.filter(
|
|
2798
|
+
(tool) => !tool.agentId || tool.agentId === this.selectedContext
|
|
2799
|
+
);
|
|
2500
2800
|
return import_lit.html`
|
|
2501
2801
|
<div class="flex h-full flex-col overflow-hidden">
|
|
2502
2802
|
<div class="overflow-auto p-4">
|
|
@@ -2579,8 +2879,12 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
2579
2879
|
<div class="flex items-start justify-between gap-3">
|
|
2580
2880
|
<div class="flex-1 min-w-0">
|
|
2581
2881
|
<div class="flex items-center gap-2 mb-1">
|
|
2582
|
-
<span class="font-mono text-sm font-semibold text-gray-900"
|
|
2583
|
-
|
|
2882
|
+
<span class="font-mono text-sm font-semibold text-gray-900"
|
|
2883
|
+
>${tool.name}</span
|
|
2884
|
+
>
|
|
2885
|
+
<span
|
|
2886
|
+
class="inline-flex items-center rounded-sm border px-1.5 py-0.5 text-[10px] font-medium ${typeColors[tool.type]}"
|
|
2887
|
+
>
|
|
2584
2888
|
${tool.type}
|
|
2585
2889
|
</span>
|
|
2586
2890
|
</div>
|
|
@@ -2591,12 +2895,19 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
2591
2895
|
</span>
|
|
2592
2896
|
${schema.properties.length > 0 ? import_lit.html`
|
|
2593
2897
|
<span class="text-gray-300">•</span>
|
|
2594
|
-
<span
|
|
2898
|
+
<span
|
|
2899
|
+
>${schema.properties.length}
|
|
2900
|
+
parameter${schema.properties.length !== 1 ? "s" : ""}</span
|
|
2901
|
+
>
|
|
2595
2902
|
` : import_lit.nothing}
|
|
2596
2903
|
</div>
|
|
2597
|
-
${tool.description ? import_lit.html`<p class="mt-2 text-xs text-gray-600"
|
|
2904
|
+
${tool.description ? import_lit.html`<p class="mt-2 text-xs text-gray-600">
|
|
2905
|
+
${tool.description}
|
|
2906
|
+
</p>` : import_lit.nothing}
|
|
2598
2907
|
</div>
|
|
2599
|
-
<span
|
|
2908
|
+
<span
|
|
2909
|
+
class="shrink-0 text-gray-400 transition ${isExpanded ? "rotate-180" : ""}"
|
|
2910
|
+
>
|
|
2600
2911
|
${this.renderIcon("ChevronDown")}
|
|
2601
2912
|
</span>
|
|
2602
2913
|
</div>
|
|
@@ -2605,39 +2916,77 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
2605
2916
|
${isExpanded ? import_lit.html`
|
|
2606
2917
|
<div class="border-t border-gray-200 bg-gray-50/50 px-4 py-3">
|
|
2607
2918
|
${schema.properties.length > 0 ? import_lit.html`
|
|
2608
|
-
<h5 class="mb-3 text-xs font-semibold text-gray-700">
|
|
2919
|
+
<h5 class="mb-3 text-xs font-semibold text-gray-700">
|
|
2920
|
+
Parameters
|
|
2921
|
+
</h5>
|
|
2609
2922
|
<div class="space-y-3">
|
|
2610
|
-
${schema.properties.map(
|
|
2611
|
-
|
|
2612
|
-
<div
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2923
|
+
${schema.properties.map(
|
|
2924
|
+
(prop) => import_lit.html`
|
|
2925
|
+
<div
|
|
2926
|
+
class="rounded-md border border-gray-200 bg-white p-3"
|
|
2927
|
+
>
|
|
2928
|
+
<div
|
|
2929
|
+
class="flex items-start justify-between gap-2 mb-1"
|
|
2930
|
+
>
|
|
2931
|
+
<span
|
|
2932
|
+
class="font-mono text-xs font-medium text-gray-900"
|
|
2933
|
+
>${prop.name}</span
|
|
2934
|
+
>
|
|
2935
|
+
<div class="flex items-center gap-1.5 shrink-0">
|
|
2936
|
+
${prop.required ? import_lit.html`<span
|
|
2937
|
+
class="text-[9px] rounded border border-rose-200 bg-rose-50 px-1 py-0.5 font-medium text-rose-700"
|
|
2938
|
+
>required</span
|
|
2939
|
+
>` : import_lit.html`<span
|
|
2940
|
+
class="text-[9px] rounded border border-gray-200 bg-gray-50 px-1 py-0.5 font-medium text-gray-600"
|
|
2941
|
+
>optional</span
|
|
2942
|
+
>`}
|
|
2943
|
+
${prop.type ? import_lit.html`<span
|
|
2944
|
+
class="text-[9px] rounded border border-gray-200 bg-gray-50 px-1 py-0.5 font-mono text-gray-600"
|
|
2945
|
+
>${prop.type}</span
|
|
2946
|
+
>` : import_lit.nothing}
|
|
2947
|
+
</div>
|
|
2617
2948
|
</div>
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
<
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2949
|
+
${prop.description ? import_lit.html`<p class="mt-1 text-xs text-gray-600">
|
|
2950
|
+
${prop.description}
|
|
2951
|
+
</p>` : import_lit.nothing}
|
|
2952
|
+
${prop.defaultValue !== void 0 ? import_lit.html`
|
|
2953
|
+
<div
|
|
2954
|
+
class="mt-2 flex items-center gap-1.5 text-[10px] text-gray-500"
|
|
2955
|
+
>
|
|
2956
|
+
<span>Default:</span>
|
|
2957
|
+
<code
|
|
2958
|
+
class="rounded bg-gray-100 px-1 py-0.5 font-mono"
|
|
2959
|
+
>${JSON.stringify(
|
|
2960
|
+
prop.defaultValue
|
|
2961
|
+
)}</code
|
|
2962
|
+
>
|
|
2963
|
+
</div>
|
|
2964
|
+
` : import_lit.nothing}
|
|
2965
|
+
${prop.enum && prop.enum.length > 0 ? import_lit.html`
|
|
2966
|
+
<div class="mt-2">
|
|
2967
|
+
<span class="text-[10px] text-gray-500"
|
|
2968
|
+
>Allowed values:</span
|
|
2969
|
+
>
|
|
2970
|
+
<div class="mt-1 flex flex-wrap gap-1">
|
|
2971
|
+
${prop.enum.map(
|
|
2972
|
+
(val) => import_lit.html`
|
|
2973
|
+
<code
|
|
2974
|
+
class="rounded border border-gray-200 bg-gray-50 px-1.5 py-0.5 text-[10px] font-mono text-gray-700"
|
|
2975
|
+
>${JSON.stringify(val)}</code
|
|
2976
|
+
>
|
|
2977
|
+
`
|
|
2978
|
+
)}
|
|
2979
|
+
</div>
|
|
2633
2980
|
</div>
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2981
|
+
` : import_lit.nothing}
|
|
2982
|
+
</div>
|
|
2983
|
+
`
|
|
2984
|
+
)}
|
|
2638
2985
|
</div>
|
|
2639
2986
|
` : import_lit.html`
|
|
2640
|
-
<div
|
|
2987
|
+
<div
|
|
2988
|
+
class="flex items-center justify-center py-4 text-xs text-gray-500"
|
|
2989
|
+
>
|
|
2641
2990
|
<span>No parameters defined</span>
|
|
2642
2991
|
</div>
|
|
2643
2992
|
`}
|
|
@@ -2760,13 +3109,19 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
2760
3109
|
const contextEntries = Object.entries(this.contextStore);
|
|
2761
3110
|
if (contextEntries.length === 0) {
|
|
2762
3111
|
return import_lit.html`
|
|
2763
|
-
<div
|
|
3112
|
+
<div
|
|
3113
|
+
class="flex h-full items-center justify-center px-4 py-8 text-center"
|
|
3114
|
+
>
|
|
2764
3115
|
<div class="max-w-md">
|
|
2765
|
-
<div
|
|
3116
|
+
<div
|
|
3117
|
+
class="mb-3 flex justify-center text-gray-300 [&>svg]:!h-8 [&>svg]:!w-8"
|
|
3118
|
+
>
|
|
2766
3119
|
${this.renderIcon("FileText")}
|
|
2767
3120
|
</div>
|
|
2768
3121
|
<p class="text-sm text-gray-600">No context available</p>
|
|
2769
|
-
<p class="mt-2 text-xs text-gray-500">
|
|
3122
|
+
<p class="mt-2 text-xs text-gray-500">
|
|
3123
|
+
Context will appear here once added to CopilotKit.
|
|
3124
|
+
</p>
|
|
2770
3125
|
</div>
|
|
2771
3126
|
</div>
|
|
2772
3127
|
`;
|
|
@@ -2775,7 +3130,9 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
2775
3130
|
<div class="flex h-full flex-col overflow-hidden">
|
|
2776
3131
|
<div class="overflow-auto p-4">
|
|
2777
3132
|
<div class="space-y-3">
|
|
2778
|
-
${contextEntries.map(
|
|
3133
|
+
${contextEntries.map(
|
|
3134
|
+
([id, context]) => this.renderContextCard(id, context)
|
|
3135
|
+
)}
|
|
2779
3136
|
</div>
|
|
2780
3137
|
</div>
|
|
2781
3138
|
</div>
|
|
@@ -2797,14 +3154,20 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
2797
3154
|
<div class="flex-1 min-w-0">
|
|
2798
3155
|
<p class="text-sm font-medium text-gray-900 mb-1">${title}</p>
|
|
2799
3156
|
<div class="flex items-center gap-2 text-xs text-gray-500">
|
|
2800
|
-
<span
|
|
3157
|
+
<span
|
|
3158
|
+
class="font-mono truncate inline-block align-middle"
|
|
3159
|
+
style="max-width: 180px;"
|
|
3160
|
+
>${id}</span
|
|
3161
|
+
>
|
|
2801
3162
|
${hasValue ? import_lit.html`
|
|
2802
3163
|
<span class="text-gray-300">•</span>
|
|
2803
3164
|
<span class="truncate">${valuePreview}</span>
|
|
2804
3165
|
` : import_lit.nothing}
|
|
2805
3166
|
</div>
|
|
2806
3167
|
</div>
|
|
2807
|
-
<span
|
|
3168
|
+
<span
|
|
3169
|
+
class="shrink-0 text-gray-400 transition ${isExpanded ? "rotate-180" : ""}"
|
|
3170
|
+
>
|
|
2808
3171
|
${this.renderIcon("ChevronDown")}
|
|
2809
3172
|
</span>
|
|
2810
3173
|
</div>
|
|
@@ -2814,11 +3177,16 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
2814
3177
|
<div class="border-t border-gray-200 bg-gray-50/50 px-4 py-3">
|
|
2815
3178
|
<div class="mb-3">
|
|
2816
3179
|
<h5 class="mb-1 text-xs font-semibold text-gray-700">ID</h5>
|
|
2817
|
-
<code
|
|
3180
|
+
<code
|
|
3181
|
+
class="block rounded bg-white border border-gray-200 px-2 py-1 text-[10px] font-mono text-gray-600"
|
|
3182
|
+
>${id}</code
|
|
3183
|
+
>
|
|
2818
3184
|
</div>
|
|
2819
3185
|
${hasValue ? import_lit.html`
|
|
2820
3186
|
<div class="mb-2 flex items-center justify-between gap-2">
|
|
2821
|
-
<h5 class="text-xs font-semibold text-gray-700">
|
|
3187
|
+
<h5 class="text-xs font-semibold text-gray-700">
|
|
3188
|
+
Value
|
|
3189
|
+
</h5>
|
|
2822
3190
|
<button
|
|
2823
3191
|
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"
|
|
2824
3192
|
type="button"
|
|
@@ -2830,11 +3198,19 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
2830
3198
|
${this.copiedContextItems.has(id) ? "Copied" : "Copy JSON"}
|
|
2831
3199
|
</button>
|
|
2832
3200
|
</div>
|
|
2833
|
-
<div
|
|
2834
|
-
|
|
3201
|
+
<div
|
|
3202
|
+
class="rounded-md border border-gray-200 bg-white p-3"
|
|
3203
|
+
>
|
|
3204
|
+
<pre
|
|
3205
|
+
class="overflow-auto text-xs text-gray-800 max-h-96"
|
|
3206
|
+
><code>${this.formatContextValue(
|
|
3207
|
+
context.value
|
|
3208
|
+
)}</code></pre>
|
|
2835
3209
|
</div>
|
|
2836
3210
|
` : import_lit.html`
|
|
2837
|
-
<div
|
|
3211
|
+
<div
|
|
3212
|
+
class="flex items-center justify-center py-4 text-xs text-gray-500"
|
|
3213
|
+
>
|
|
2838
3214
|
<span>No value available</span>
|
|
2839
3215
|
</div>
|
|
2840
3216
|
`}
|
|
@@ -2928,9 +3304,13 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
2928
3304
|
return import_lit.nothing;
|
|
2929
3305
|
}
|
|
2930
3306
|
if (!this.announcementLoaded && !this.announcementMarkdown) {
|
|
2931
|
-
return import_lit.html`<div
|
|
3307
|
+
return import_lit.html`<div
|
|
3308
|
+
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)]"
|
|
3309
|
+
>
|
|
2932
3310
|
<div class="flex items-center gap-2 font-semibold">
|
|
2933
|
-
<span
|
|
3311
|
+
<span
|
|
3312
|
+
class="inline-flex h-6 w-6 items-center justify-center rounded-md bg-slate-900 text-white shadow-sm"
|
|
3313
|
+
>
|
|
2934
3314
|
${this.renderIcon("Megaphone")}
|
|
2935
3315
|
</span>
|
|
2936
3316
|
<span>Loading latest announcement…</span>
|
|
@@ -2938,31 +3318,53 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
2938
3318
|
</div>`;
|
|
2939
3319
|
}
|
|
2940
3320
|
if (this.announcementLoadError) {
|
|
2941
|
-
return import_lit.html`<div
|
|
3321
|
+
return import_lit.html`<div
|
|
3322
|
+
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)]"
|
|
3323
|
+
>
|
|
2942
3324
|
<div class="flex items-center gap-2 font-semibold">
|
|
2943
|
-
<span
|
|
3325
|
+
<span
|
|
3326
|
+
class="inline-flex h-6 w-6 items-center justify-center rounded-md bg-rose-600 text-white shadow-sm"
|
|
3327
|
+
>
|
|
2944
3328
|
${this.renderIcon("Megaphone")}
|
|
2945
3329
|
</span>
|
|
2946
3330
|
<span>Announcement unavailable</span>
|
|
2947
3331
|
</div>
|
|
2948
|
-
<p class="mt-2 text-xs text-rose-800">
|
|
3332
|
+
<p class="mt-2 text-xs text-rose-800">
|
|
3333
|
+
We couldn’t load the latest notice. Please try opening the inspector
|
|
3334
|
+
again.
|
|
3335
|
+
</p>
|
|
2949
3336
|
</div>`;
|
|
2950
3337
|
}
|
|
2951
3338
|
if (!this.announcementMarkdown) {
|
|
2952
3339
|
return import_lit.nothing;
|
|
2953
3340
|
}
|
|
2954
|
-
const content = this.announcementHtml ? (0, import_unsafe_html.unsafeHTML)(this.announcementHtml) : import_lit.html`<pre class="whitespace-pre-wrap text-sm text-gray-900"
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
3341
|
+
const content = this.announcementHtml ? (0, import_unsafe_html.unsafeHTML)(this.announcementHtml) : import_lit.html`<pre class="whitespace-pre-wrap text-sm text-gray-900">
|
|
3342
|
+
${this.announcementMarkdown}</pre
|
|
3343
|
+
>`;
|
|
3344
|
+
return import_lit.html`<div
|
|
3345
|
+
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)]"
|
|
3346
|
+
>
|
|
3347
|
+
<div
|
|
3348
|
+
class="mb-3 flex items-center gap-2 text-sm font-semibold text-slate-900"
|
|
3349
|
+
>
|
|
3350
|
+
<span
|
|
3351
|
+
class="inline-flex h-7 w-7 items-center justify-center rounded-md bg-slate-900 text-white shadow-sm"
|
|
3352
|
+
>
|
|
2958
3353
|
${this.renderIcon("Megaphone")}
|
|
2959
3354
|
</span>
|
|
2960
3355
|
<span>Announcement</span>
|
|
2961
|
-
<button
|
|
3356
|
+
<button
|
|
3357
|
+
class="announcement-dismiss ml-auto"
|
|
3358
|
+
type="button"
|
|
3359
|
+
@click=${this.handleDismissAnnouncement}
|
|
3360
|
+
aria-label="Dismiss announcement"
|
|
3361
|
+
>
|
|
2962
3362
|
Dismiss
|
|
2963
3363
|
</button>
|
|
2964
3364
|
</div>
|
|
2965
|
-
<div class="announcement-content text-sm leading-relaxed text-gray-900"
|
|
3365
|
+
<div class="announcement-content text-sm leading-relaxed text-gray-900">
|
|
3366
|
+
${content}
|
|
3367
|
+
</div>
|
|
2966
3368
|
</div>`;
|
|
2967
3369
|
}
|
|
2968
3370
|
ensureAnnouncementLoading() {
|
|
@@ -3029,7 +3431,10 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
3029
3431
|
}
|
|
3030
3432
|
appendRefParam(href) {
|
|
3031
3433
|
try {
|
|
3032
|
-
const url = new URL(
|
|
3434
|
+
const url = new URL(
|
|
3435
|
+
href,
|
|
3436
|
+
typeof window !== "undefined" ? window.location.href : "https://copilotkit.ai"
|
|
3437
|
+
);
|
|
3033
3438
|
if (!url.searchParams.has("ref")) {
|
|
3034
3439
|
url.searchParams.append("ref", "cpk-inspector");
|
|
3035
3440
|
}
|