@copilotkit/web-inspector 1.79.2-canary.1792172552 → 1.81.0
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/components/generative-ui-view.cjs +939 -0
- package/dist/components/generative-ui-view.cjs.map +1 -0
- package/dist/components/generative-ui-view.d.mts +3 -0
- package/dist/components/generative-ui-view.mjs +940 -0
- package/dist/components/generative-ui-view.mjs.map +1 -0
- package/dist/components/learning-view.cjs +145 -10
- package/dist/components/learning-view.cjs.map +1 -1
- package/dist/components/learning-view.mjs +145 -10
- package/dist/components/learning-view.mjs.map +1 -1
- package/dist/index.cjs +79 -155
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -23
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +7 -23
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +63 -139
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +1427 -289
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/inspector-nav.cjs +2 -1
- package/dist/lib/inspector-nav.cjs.map +1 -1
- package/dist/lib/inspector-nav.mjs +2 -1
- package/dist/lib/inspector-nav.mjs.map +1 -1
- package/dist/lib/json-block.cjs +139 -0
- package/dist/lib/json-block.cjs.map +1 -0
- package/dist/lib/json-block.d.cts +26 -0
- package/dist/lib/json-block.d.cts.map +1 -0
- package/dist/lib/json-block.d.mts +28 -0
- package/dist/lib/json-block.d.mts.map +1 -0
- package/dist/lib/json-block.mjs +134 -0
- package/dist/lib/json-block.mjs.map +1 -0
- package/dist/lib/telemetry.cjs.map +1 -1
- package/dist/lib/telemetry.mjs.map +1 -1
- package/dist/package.cjs +1 -1
- package/dist/package.mjs +1 -1
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -10,6 +10,8 @@ const require_notification_article = require('./styles/notification-article.cjs'
|
|
|
10
10
|
const require_inspector_logo = require('./assets/inspector-logo.cjs');
|
|
11
11
|
const require_inspector_logo_kite = require('./assets/inspector-logo-kite.cjs');
|
|
12
12
|
const require_learning_view = require('./components/learning-view.cjs');
|
|
13
|
+
const require_json_block = require('./lib/json-block.cjs');
|
|
14
|
+
require('./components/generative-ui-view.cjs');
|
|
13
15
|
const require_context_helpers = require('./lib/context-helpers.cjs');
|
|
14
16
|
const require_learning_setup = require('./lib/learning-setup.cjs');
|
|
15
17
|
const require_inspector_learning = require('./lib/inspector-learning.cjs');
|
|
@@ -801,132 +803,6 @@ function getExampleTourTelemetryPair(index) {
|
|
|
801
803
|
function getMetadataActionPlacement(placement) {
|
|
802
804
|
return placement === "threads-footer" ? "threads_footer" : "threads_locked";
|
|
803
805
|
}
|
|
804
|
-
function escapeHtml(s) {
|
|
805
|
-
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
806
|
-
}
|
|
807
|
-
const highlightedJsonCache = /* @__PURE__ */ new WeakMap();
|
|
808
|
-
function highlightedJson(obj) {
|
|
809
|
-
if (typeof obj === "object" && obj !== null) {
|
|
810
|
-
const cached = highlightedJsonCache.get(obj);
|
|
811
|
-
if (cached !== void 0) return cached;
|
|
812
|
-
}
|
|
813
|
-
const json = JSON.stringify(obj, null, 2);
|
|
814
|
-
if (!json) return "";
|
|
815
|
-
const parts = [];
|
|
816
|
-
let lastIndex = 0;
|
|
817
|
-
const re = /("(?:\\u[a-fA-F0-9]{4}|\\[^u]|[^\\"])*"(?:\s*:)?|\b(?:true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+-]?\d+)?)/g;
|
|
818
|
-
let match;
|
|
819
|
-
while ((match = re.exec(json)) !== null) {
|
|
820
|
-
parts.push(escapeHtml(json.slice(lastIndex, match.index)));
|
|
821
|
-
const m = match[0];
|
|
822
|
-
let token = "num";
|
|
823
|
-
if (m.startsWith("\"")) token = m.trimEnd().endsWith(":") ? "key" : "str";
|
|
824
|
-
else if (m === "true" || m === "false") token = "bool";
|
|
825
|
-
else if (m === "null") token = "nil";
|
|
826
|
-
parts.push(`<span class="cpk-json-token cpk-json-token--${token}">${escapeHtml(m)}</span>`);
|
|
827
|
-
lastIndex = match.index + m.length;
|
|
828
|
-
}
|
|
829
|
-
parts.push(escapeHtml(json.slice(lastIndex)));
|
|
830
|
-
const result = parts.join("");
|
|
831
|
-
if (typeof obj === "object" && obj !== null) highlightedJsonCache.set(obj, result);
|
|
832
|
-
return result;
|
|
833
|
-
}
|
|
834
|
-
function coerceJsonValue(value) {
|
|
835
|
-
if (typeof value !== "string") return value;
|
|
836
|
-
const trimmed = value.trim();
|
|
837
|
-
if (trimmed.length === 0) return value;
|
|
838
|
-
if (!(trimmed.startsWith("{") && trimmed.endsWith("}") || trimmed.startsWith("[") && trimmed.endsWith("]"))) return value;
|
|
839
|
-
try {
|
|
840
|
-
return JSON.parse(trimmed);
|
|
841
|
-
} catch {
|
|
842
|
-
return value;
|
|
843
|
-
}
|
|
844
|
-
}
|
|
845
|
-
let inspectorJsonRenderer = null;
|
|
846
|
-
let inspectorJsonSlotCount = 0;
|
|
847
|
-
const JSON_BLOCK_TAG = "cpk-json-block";
|
|
848
|
-
/**
|
|
849
|
-
* Replaces the inspector's built-in JSON blocks (tool arguments and results,
|
|
850
|
-
* state, events, and context) with a host renderer. Pass `null` to restore the
|
|
851
|
-
* built-in blocks. Set it before the inspector renders: a block that is
|
|
852
|
-
* already on screen changes at the inspector's next render.
|
|
853
|
-
*
|
|
854
|
-
* @example
|
|
855
|
-
* ```ts
|
|
856
|
-
* setInspectorJsonRenderer((container, value) => {
|
|
857
|
-
* const root = createRoot(container);
|
|
858
|
-
* root.render(<JsonView value={value} />);
|
|
859
|
-
* return () => root.unmount();
|
|
860
|
-
* });
|
|
861
|
-
* ```
|
|
862
|
-
*/
|
|
863
|
-
function setInspectorJsonRenderer(renderer) {
|
|
864
|
-
inspectorJsonRenderer = renderer;
|
|
865
|
-
}
|
|
866
|
-
/**
|
|
867
|
-
* Hosts one value drawn by the host renderer. Inside a shadow root, the
|
|
868
|
-
* container lives in the shadow host's light DOM and shows here through a
|
|
869
|
-
* named slot, so the host page's own styles apply to what the renderer draws.
|
|
870
|
-
*/
|
|
871
|
-
var CpkJsonBlock = class extends (globalThis.HTMLElement ?? class {}) {
|
|
872
|
-
#value = void 0;
|
|
873
|
-
#hasValue = false;
|
|
874
|
-
#cleanup;
|
|
875
|
-
#container;
|
|
876
|
-
get value() {
|
|
877
|
-
return this.#value;
|
|
878
|
-
}
|
|
879
|
-
set value(next) {
|
|
880
|
-
if (this.#hasValue && Object.is(next, this.#value)) return;
|
|
881
|
-
this.#value = next;
|
|
882
|
-
this.#hasValue = true;
|
|
883
|
-
if (this.isConnected) this.#render();
|
|
884
|
-
}
|
|
885
|
-
connectedCallback() {
|
|
886
|
-
this.style.display = "block";
|
|
887
|
-
this.#render();
|
|
888
|
-
}
|
|
889
|
-
disconnectedCallback() {
|
|
890
|
-
this.#teardown();
|
|
891
|
-
}
|
|
892
|
-
#render() {
|
|
893
|
-
this.#teardown();
|
|
894
|
-
const renderer = inspectorJsonRenderer;
|
|
895
|
-
if (!renderer) return;
|
|
896
|
-
const root = this.getRootNode();
|
|
897
|
-
const container = this.ownerDocument.createElement("div");
|
|
898
|
-
if (root.nodeType === Node.DOCUMENT_FRAGMENT_NODE && "host" in root) {
|
|
899
|
-
inspectorJsonSlotCount += 1;
|
|
900
|
-
const name = `cpk-json-${inspectorJsonSlotCount}`;
|
|
901
|
-
const slot = this.ownerDocument.createElement("slot");
|
|
902
|
-
slot.name = name;
|
|
903
|
-
this.replaceChildren(slot);
|
|
904
|
-
container.slot = name;
|
|
905
|
-
root.host.append(container);
|
|
906
|
-
} else this.replaceChildren(container);
|
|
907
|
-
this.#container = container;
|
|
908
|
-
const cleanup = renderer(container, this.#value);
|
|
909
|
-
this.#cleanup = typeof cleanup === "function" ? cleanup : void 0;
|
|
910
|
-
}
|
|
911
|
-
#teardown() {
|
|
912
|
-
const cleanup = this.#cleanup;
|
|
913
|
-
this.#cleanup = void 0;
|
|
914
|
-
cleanup?.();
|
|
915
|
-
this.#container?.remove();
|
|
916
|
-
this.#container = void 0;
|
|
917
|
-
this.replaceChildren();
|
|
918
|
-
}
|
|
919
|
-
};
|
|
920
|
-
function renderHighlightedJsonBlock(value, options = {}) {
|
|
921
|
-
if (inspectorJsonRenderer) return lit.html`<cpk-json-block
|
|
922
|
-
.value=${value}
|
|
923
|
-
style=${options.maxHeight ? `overflow:auto;max-height:${options.maxHeight}` : lit.nothing}
|
|
924
|
-
></cpk-json-block>`;
|
|
925
|
-
const parsed = coerceJsonValue(value);
|
|
926
|
-
return lit.html`<pre class="cpk-json-block" style=${(options.maxHeight ? `max-height:${options.maxHeight}` : void 0) || lit.nothing}>
|
|
927
|
-
${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(parsed))}</pre
|
|
928
|
-
>`;
|
|
929
|
-
}
|
|
930
806
|
function humanizeEventType(type) {
|
|
931
807
|
const words = type.trim().split(/[_\s]+/).filter(Boolean).map((word) => word.toLowerCase());
|
|
932
808
|
if (words.length === 0) return "Event";
|
|
@@ -4058,7 +3934,7 @@ var CpkThreadInspector = class CpkThreadInspector extends PortableLitElement {
|
|
|
4058
3934
|
<span>${detailsExpanded ? "Hide details" : "Show details"}</span>
|
|
4059
3935
|
</button>` : lit.nothing}
|
|
4060
3936
|
${item.body ? lit.html`<div class="cpk-td__timeline-body">${item.body}</div>` : lit.nothing}
|
|
4061
|
-
${item.details && detailsExpanded ? renderHighlightedJsonBlock(item.details) : lit.nothing}
|
|
3937
|
+
${item.details && detailsExpanded ? require_json_block.renderHighlightedJsonBlock(item.details) : lit.nothing}
|
|
4062
3938
|
</div>
|
|
4063
3939
|
`;
|
|
4064
3940
|
}
|
|
@@ -4267,12 +4143,12 @@ var CpkThreadInspector = class CpkThreadInspector extends PortableLitElement {
|
|
|
4267
4143
|
<div class="cpk-td__tool-data">
|
|
4268
4144
|
<section>
|
|
4269
4145
|
<div class="cpk-td__tool-section-label">Arguments</div>
|
|
4270
|
-
${renderHighlightedJsonBlock(item.arguments)}
|
|
4146
|
+
${require_json_block.renderHighlightedJsonBlock(item.arguments)}
|
|
4271
4147
|
</section>
|
|
4272
4148
|
${item.hasResult ? lit.html`
|
|
4273
4149
|
<section class="cpk-td__tool-result">
|
|
4274
4150
|
<div class="cpk-td__tool-section-label">Result</div>
|
|
4275
|
-
${renderHighlightedJsonBlock(item.result)}
|
|
4151
|
+
${require_json_block.renderHighlightedJsonBlock(item.result)}
|
|
4276
4152
|
</section>` : lit.nothing}
|
|
4277
4153
|
</div>
|
|
4278
4154
|
</div>
|
|
@@ -4357,7 +4233,7 @@ var CpkThreadInspector = class CpkThreadInspector extends PortableLitElement {
|
|
|
4357
4233
|
`;
|
|
4358
4234
|
const stateValue = this.activeState;
|
|
4359
4235
|
return this.cachedPanelTpl("state", [stateValue], () => {
|
|
4360
|
-
return renderHighlightedJsonBlock(stateValue);
|
|
4236
|
+
return require_json_block.renderHighlightedJsonBlock(stateValue);
|
|
4361
4237
|
});
|
|
4362
4238
|
}
|
|
4363
4239
|
renderEvents() {
|
|
@@ -4435,7 +4311,7 @@ var CpkThreadInspector = class CpkThreadInspector extends PortableLitElement {
|
|
|
4435
4311
|
>${detailsExpanded ? "Hide details" : "Show details"}</span
|
|
4436
4312
|
>
|
|
4437
4313
|
</button>
|
|
4438
|
-
${detailsExpanded ? renderHighlightedJsonBlock(event.rawEvent ?? event) : lit.nothing}
|
|
4314
|
+
${detailsExpanded ? require_json_block.renderHighlightedJsonBlock(event.rawEvent ?? event) : lit.nothing}
|
|
4439
4315
|
</div>
|
|
4440
4316
|
`;
|
|
4441
4317
|
})}`;
|
|
@@ -5205,6 +5081,7 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
|
|
|
5205
5081
|
this._memoriesAvailable = true;
|
|
5206
5082
|
this._memoriesRealtimeStatus = "connecting";
|
|
5207
5083
|
this._memoryUnsub = null;
|
|
5084
|
+
this._generativeUIUnsub = null;
|
|
5208
5085
|
this._memorySubscribed = false;
|
|
5209
5086
|
this._memoryStoreUnsupported = false;
|
|
5210
5087
|
this.learningSnapshot = null;
|
|
@@ -5539,14 +5416,9 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
|
|
|
5539
5416
|
}
|
|
5540
5417
|
} catch (error) {
|
|
5541
5418
|
if (generation !== this.learningRequestGeneration || controller.signal.aborted) return;
|
|
5542
|
-
if (error instanceof require_inspector_learning.InspectorLearningUnsupportedError)
|
|
5543
|
-
|
|
5544
|
-
|
|
5545
|
-
this.learningSnapshot = null;
|
|
5546
|
-
} else {
|
|
5547
|
-
this.learningError = error instanceof Error ? error.message : "Learning data is unavailable.";
|
|
5548
|
-
this.learningPollFailureCount += 1;
|
|
5549
|
-
}
|
|
5419
|
+
if (error instanceof require_inspector_learning.InspectorLearningUnsupportedError) loadOutcome = "unsupported";
|
|
5420
|
+
this.learningError = "Learning status unavailable";
|
|
5421
|
+
this.learningPollFailureCount += 1;
|
|
5550
5422
|
} finally {
|
|
5551
5423
|
if (generation === this.learningRequestGeneration) {
|
|
5552
5424
|
this.learningLoading = false;
|
|
@@ -5751,6 +5623,13 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
|
|
|
5751
5623
|
this.queueHudTelemetry(() => require_telemetry.trackHudHideClicked({ trigger }));
|
|
5752
5624
|
this.dismissInspectorFor("day");
|
|
5753
5625
|
};
|
|
5626
|
+
this.retryLearningStatus = (event) => {
|
|
5627
|
+
event.stopPropagation();
|
|
5628
|
+
this.refreshLearningSnapshot().catch(() => {
|
|
5629
|
+
this.learningError = "Learning status unavailable";
|
|
5630
|
+
this.requestUpdate();
|
|
5631
|
+
});
|
|
5632
|
+
};
|
|
5754
5633
|
this.handleSidebarToggle = () => {
|
|
5755
5634
|
this.sidebarRailTooltip = null;
|
|
5756
5635
|
this.sidebarCollapsed = !this.sidebarCollapsed;
|
|
@@ -6472,6 +6351,11 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
|
|
|
6472
6351
|
label: "Context",
|
|
6473
6352
|
icon: "FileText"
|
|
6474
6353
|
},
|
|
6354
|
+
...this._core?.ɵgenerativeUIDebugSource ? [{
|
|
6355
|
+
key: "generative-ui",
|
|
6356
|
+
label: "Generative UI",
|
|
6357
|
+
icon: "LayoutTemplate"
|
|
6358
|
+
}] : [],
|
|
6475
6359
|
{
|
|
6476
6360
|
key: "threads",
|
|
6477
6361
|
label: "Rich Threads",
|
|
@@ -6939,6 +6823,10 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
|
|
|
6939
6823
|
}
|
|
6940
6824
|
};
|
|
6941
6825
|
this.coreUnsubscribe = core.subscribe(this.coreSubscriber).unsubscribe;
|
|
6826
|
+
this._generativeUIUnsub = core.ɵsubscribeToGenerativeUIDebugSource?.(() => {
|
|
6827
|
+
this.reconcileSelectedMenuVisibility();
|
|
6828
|
+
this.requestUpdate();
|
|
6829
|
+
}) ?? null;
|
|
6942
6830
|
this.processAgentsChanged(core.agents);
|
|
6943
6831
|
if (core.runtimeConnectionStatus === "connected") {
|
|
6944
6832
|
if (!core.telemetryDisabled) {
|
|
@@ -7132,6 +7020,8 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
|
|
|
7132
7020
|
}
|
|
7133
7021
|
this._memoryUnsub?.();
|
|
7134
7022
|
this._memoryUnsub = null;
|
|
7023
|
+
this._generativeUIUnsub?.();
|
|
7024
|
+
this._generativeUIUnsub = null;
|
|
7135
7025
|
this._memories = [];
|
|
7136
7026
|
this._memoriesLoading = false;
|
|
7137
7027
|
this._memoriesError = null;
|
|
@@ -7563,7 +7453,7 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
|
|
|
7563
7453
|
${toolError.message}
|
|
7564
7454
|
</p>` : lit.nothing}
|
|
7565
7455
|
${argsString ? lit.html`<div class="mt-2">
|
|
7566
|
-
${renderHighlightedJsonBlock(coerceJsonValue(call.function?.arguments))}
|
|
7456
|
+
${require_json_block.renderHighlightedJsonBlock(require_json_block.coerceJsonValue(call.function?.arguments))}
|
|
7567
7457
|
</div>` : lit.nothing}
|
|
7568
7458
|
</div>
|
|
7569
7459
|
`;
|
|
@@ -10213,8 +10103,22 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
|
|
|
10213
10103
|
const titleCharacters = Array.from(title);
|
|
10214
10104
|
return titleCharacters.length > HUD_ANNOUNCEMENT_TITLE_LIMIT ? `${titleCharacters.slice(0, HUD_ANNOUNCEMENT_TITLE_LIMIT).join("").trimEnd()}...` : title;
|
|
10215
10105
|
}
|
|
10106
|
+
/** A failed or pending read must never imply that Learning is disabled. */
|
|
10107
|
+
getLearningStatus() {
|
|
10108
|
+
if (this.learningError) return "unavailable";
|
|
10109
|
+
if (this.learningSupported && !this.learningSnapshot) return "checking";
|
|
10110
|
+
return this.learningSnapshot?.configuration.state === "configured" ? "configured" : "not_configured";
|
|
10111
|
+
}
|
|
10216
10112
|
renderHudRow(args) {
|
|
10217
10113
|
if (args.connected) return lit.nothing;
|
|
10114
|
+
const learningStatus = args.id === "learning" ? this.getLearningStatus() : null;
|
|
10115
|
+
if (learningStatus === "unavailable" || learningStatus === "checking") return lit.html`
|
|
10116
|
+
<li class="cpk-launcher-hud__row" data-cpk-hud-row="learning">
|
|
10117
|
+
<span class="cpk-launcher-hud__label" role="status">${learningStatus === "unavailable" ? "Learning status unavailable" : "Checking Learning status"}</span>
|
|
10118
|
+
<button type="button" class="cpk-launcher-hud__action" aria-label="Retry Learning status"
|
|
10119
|
+
?disabled=${this.learningLoading || this.learningRefreshing}
|
|
10120
|
+
@click=${this.retryLearningStatus}>Retry</button>
|
|
10121
|
+
</li>`;
|
|
10218
10122
|
const detailId = `cpk-hud-detail-${args.id}`;
|
|
10219
10123
|
const { label, description } = this.hudContent[args.id];
|
|
10220
10124
|
return lit.html`
|
|
@@ -11045,17 +10949,26 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
|
|
|
11045
10949
|
}
|
|
11046
10950
|
renderHomeFeatures(model) {
|
|
11047
10951
|
const enabledServices = model.services.filter((service) => service.enabled);
|
|
11048
|
-
const
|
|
10952
|
+
const learningStatus = this.getLearningStatus();
|
|
10953
|
+
const unavailableServices = model.services.filter((service) => service.id === "memory" && (learningStatus === "unavailable" || learningStatus === "checking"));
|
|
10954
|
+
const disabledServices = model.services.filter((service) => !service.enabled && !unavailableServices.includes(service));
|
|
11049
10955
|
const renderService = (service) => {
|
|
11050
10956
|
const copyState = this.homeFeaturePromptCopyState?.serviceId === service.id ? this.homeFeaturePromptCopyState.state : "idle";
|
|
11051
|
-
const
|
|
10957
|
+
const learningStatus = service.id === "memory" ? this.getLearningStatus() : null;
|
|
10958
|
+
const learningUnavailable = learningStatus === "unavailable" || learningStatus === "checking";
|
|
10959
|
+
const stateDescription = learningStatus ? {
|
|
10960
|
+
configured: "Learning configured",
|
|
10961
|
+
not_configured: "Learning not configured",
|
|
10962
|
+
unavailable: "Learning status unavailable",
|
|
10963
|
+
checking: "Checking Learning status"
|
|
10964
|
+
}[learningStatus] : `${service.label} is ${service.enabled ? "enabled in your runtime" : "not enabled in your runtime"}`;
|
|
11052
10965
|
const copyLabel = copyState === "copied" ? "Copied" : copyState === "error" ? "Copy failed" : "Copy prompt";
|
|
11053
10966
|
const copyTitle = copyLabel;
|
|
11054
10967
|
return lit.html`
|
|
11055
10968
|
<div
|
|
11056
10969
|
class="inspector-home-feature"
|
|
11057
10970
|
data-inspector-service=${service.id}
|
|
11058
|
-
data-state=${service.enabled ? "on" : "off"}
|
|
10971
|
+
data-state=${learningUnavailable ? "unavailable" : service.enabled ? "on" : "off"}
|
|
11059
10972
|
role="listitem"
|
|
11060
10973
|
>
|
|
11061
10974
|
<span
|
|
@@ -11074,13 +10987,16 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
|
|
|
11074
10987
|
rel="noopener noreferrer"
|
|
11075
10988
|
aria-label="Open ${service.label} documentation in a new tab"
|
|
11076
10989
|
>
|
|
11077
|
-
<span>${service.label}</span>
|
|
10990
|
+
<span>${learningStatus ? stateDescription : service.label}</span>
|
|
11078
10991
|
<span class="inspector-home-feature-label-icon" aria-hidden="true"
|
|
11079
10992
|
>${this.renderIcon("ArrowUpRight")}</span
|
|
11080
10993
|
>
|
|
11081
10994
|
</a>
|
|
11082
10995
|
<span class="inspector-home-feature-actions">
|
|
11083
|
-
${
|
|
10996
|
+
${learningUnavailable ? lit.html`<button type="button" class="inspector-home-feature-action" aria-label="Retry Learning status"
|
|
10997
|
+
?disabled=${this.learningLoading || this.learningRefreshing}
|
|
10998
|
+
@click=${this.retryLearningStatus}>Retry</button>` : lit.nothing}
|
|
10999
|
+
${service.enabled || learningUnavailable ? lit.nothing : lit.html`
|
|
11084
11000
|
<button
|
|
11085
11001
|
type="button"
|
|
11086
11002
|
class="inspector-home-feature-action inspector-system-health-url"
|
|
@@ -11124,6 +11040,10 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
|
|
|
11124
11040
|
</p>
|
|
11125
11041
|
` : lit.html`
|
|
11126
11042
|
<div class="inspector-home-feature-groups">
|
|
11043
|
+
${unavailableServices.length ? lit.html`
|
|
11044
|
+
<section class="inspector-home-feature-group" data-feature-state-group="unavailable" aria-label="Feature status unavailable">
|
|
11045
|
+
<div class="inspector-home-feature-list" role="list">${unavailableServices.map(renderService)}</div>
|
|
11046
|
+
</section>` : lit.nothing}
|
|
11127
11047
|
<section
|
|
11128
11048
|
class="inspector-home-feature-group"
|
|
11129
11049
|
data-feature-state-group="active"
|
|
@@ -12709,6 +12629,10 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
|
|
|
12709
12629
|
if (this.selectedMenu === "frontend-tools") return this.renderToolsView();
|
|
12710
12630
|
if (this.selectedMenu === "capabilities") return this.renderCapabilitiesView();
|
|
12711
12631
|
if (this.selectedMenu === "agent-context") return this.renderContextView();
|
|
12632
|
+
if (this.selectedMenu === "generative-ui") return lit.html`<cpk-generative-ui-view
|
|
12633
|
+
data-color-scheme=${this.colorScheme}
|
|
12634
|
+
.source=${this._core?.ɵgenerativeUIDebugSource}
|
|
12635
|
+
></cpk-generative-ui-view>`;
|
|
12712
12636
|
if (this.selectedMenu === "threads") return this.renderThreadsView();
|
|
12713
12637
|
if (this.selectedMenu === "memories") return this.renderMemoriesView();
|
|
12714
12638
|
return lit.nothing;
|
|
@@ -14560,7 +14484,7 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
|
|
|
14560
14484
|
>
|
|
14561
14485
|
${isExpanded ? lit.html`
|
|
14562
14486
|
<div class="group relative">
|
|
14563
|
-
${renderHighlightedJsonBlock(extractedEvent)}
|
|
14487
|
+
${require_json_block.renderHighlightedJsonBlock(extractedEvent)}
|
|
14564
14488
|
<button
|
|
14565
14489
|
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"}"
|
|
14566
14490
|
@click=${(e) => {
|
|
@@ -14759,7 +14683,7 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
|
|
|
14759
14683
|
<h4>Current State</h4>
|
|
14760
14684
|
</div>
|
|
14761
14685
|
<div class="overflow-auto p-4">
|
|
14762
|
-
${this.hasRenderableState(state) ? renderHighlightedJsonBlock(state, { maxHeight: "16rem" }) : lit.html`
|
|
14686
|
+
${this.hasRenderableState(state) ? require_json_block.renderHighlightedJsonBlock(state, { maxHeight: "16rem" }) : lit.html`
|
|
14763
14687
|
<div
|
|
14764
14688
|
class="flex h-12 items-center justify-center text-xs text-gray-500"
|
|
14765
14689
|
>
|
|
@@ -15585,7 +15509,7 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
|
|
|
15585
15509
|
${this.copiedContextItems.has(id) ? "Copied" : "Copy JSON"}
|
|
15586
15510
|
</button>
|
|
15587
15511
|
</div>
|
|
15588
|
-
${renderHighlightedJsonBlock(context.value, { maxHeight: "180px" })}
|
|
15512
|
+
${require_json_block.renderHighlightedJsonBlock(context.value, { maxHeight: "180px" })}
|
|
15589
15513
|
` : lit.html`
|
|
15590
15514
|
<div class="flex items-center justify-center py-4 text-xs text-gray-500">
|
|
15591
15515
|
<span>No value available</span>
|
|
@@ -15597,7 +15521,7 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
|
|
|
15597
15521
|
`;
|
|
15598
15522
|
}
|
|
15599
15523
|
getContextValuePreview(value) {
|
|
15600
|
-
const parsed = coerceJsonValue(value);
|
|
15524
|
+
const parsed = require_json_block.coerceJsonValue(value);
|
|
15601
15525
|
if (parsed === void 0 || parsed === null) return "—";
|
|
15602
15526
|
if (typeof parsed === "string") return parsed.length > 50 ? `${parsed.slice(0, 50)}...` : parsed;
|
|
15603
15527
|
if (typeof parsed === "number" || typeof parsed === "boolean") return String(parsed);
|
|
@@ -15643,7 +15567,7 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
|
|
|
15643
15567
|
if (value === void 0) return "undefined";
|
|
15644
15568
|
if (value === null) return "null";
|
|
15645
15569
|
if (typeof value === "function") return value.toString();
|
|
15646
|
-
const pretty = this.formatStateForDisplay(coerceJsonValue(value));
|
|
15570
|
+
const pretty = this.formatStateForDisplay(require_json_block.coerceJsonValue(value));
|
|
15647
15571
|
return pretty.length > 0 ? pretty : String(value);
|
|
15648
15572
|
}
|
|
15649
15573
|
async copyContextValue(value, contextId, event) {
|
|
@@ -16269,10 +16193,10 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
|
|
|
16269
16193
|
renderer.link = (href, title, text) => {
|
|
16270
16194
|
return `<a href="${this.escapeHtmlAttr(this.isSafeAnnouncementHref(href ?? "") ? this.appendRefParam(href ?? "") : "#")}" target="_blank" rel="noopener"${title ? ` title="${this.escapeHtmlAttr(title)}"` : ""}>${text}</a>`;
|
|
16271
16195
|
};
|
|
16272
|
-
renderer.html = (html) => escapeHtml(html);
|
|
16196
|
+
renderer.html = (html) => require_json_block.escapeHtml(html);
|
|
16273
16197
|
renderer.code = (code, lang) => {
|
|
16274
16198
|
const safeLang = (lang ?? "").replace(/[^a-z0-9-]/gi, "");
|
|
16275
|
-
return `<div class="announcement-code"><pre><code${safeLang ? ` class="language-${safeLang}"` : ""}>${escapeHtml(code)}</code></pre><div class="announcement-code__copy-shield"><button type="button" class="announcement-code__copy" data-copy="${this.encodeBase64(code)}" aria-label="Copy code">Copy</button></div></div>`;
|
|
16199
|
+
return `<div class="announcement-code"><pre><code${safeLang ? ` class="language-${safeLang}"` : ""}>${require_json_block.escapeHtml(code)}</code></pre><div class="announcement-code__copy-shield"><button type="button" class="announcement-code__copy" data-copy="${this.encodeBase64(code)}" aria-label="Copy code">Copy</button></div></div>`;
|
|
16276
16200
|
};
|
|
16277
16201
|
return marked.marked.parse(markdown, {
|
|
16278
16202
|
renderer,
|
|
@@ -16321,7 +16245,7 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
|
|
|
16321
16245
|
return hostname === "copilotkit.ai" || hostname.endsWith(".copilotkit.ai");
|
|
16322
16246
|
}
|
|
16323
16247
|
escapeHtmlAttr(value) {
|
|
16324
|
-
return escapeHtml(value).replace(/"/g, """).replace(/'/g, "'");
|
|
16248
|
+
return require_json_block.escapeHtml(value).replace(/"/g, """).replace(/'/g, "'");
|
|
16325
16249
|
}
|
|
16326
16250
|
};
|
|
16327
16251
|
function defineWebInspector(registry = globalThis.customElements) {
|
|
@@ -16330,7 +16254,7 @@ function defineWebInspector(registry = globalThis.customElements) {
|
|
|
16330
16254
|
defineElementOnce(registry, THREAD_INSPECTOR_TAG, CpkThreadInspector);
|
|
16331
16255
|
defineElementOnce(registry, "cpk-thread-details", ɵCpkThreadDetails);
|
|
16332
16256
|
defineElementOnce(registry, "cpk-memory-list", CpkMemoryList);
|
|
16333
|
-
defineElementOnce(registry, JSON_BLOCK_TAG, CpkJsonBlock);
|
|
16257
|
+
defineElementOnce(registry, require_json_block.JSON_BLOCK_TAG, require_json_block.CpkJsonBlock);
|
|
16334
16258
|
defineElementOnce(registry, WEB_INSPECTOR_TAG, WebInspectorElement);
|
|
16335
16259
|
}
|
|
16336
16260
|
/**
|
|
@@ -16353,7 +16277,7 @@ exports.WEB_INSPECTOR_TAG = WEB_INSPECTOR_TAG;
|
|
|
16353
16277
|
exports.WebInspectorElement = WebInspectorElement;
|
|
16354
16278
|
exports.configureWebInspectorElement = configureWebInspectorElement;
|
|
16355
16279
|
exports.defineWebInspector = defineWebInspector;
|
|
16356
|
-
exports.setInspectorJsonRenderer = setInspectorJsonRenderer;
|
|
16280
|
+
exports.setInspectorJsonRenderer = require_json_block.setInspectorJsonRenderer;
|
|
16357
16281
|
exports.ɵCpkThreadDetails = ɵCpkThreadDetails;
|
|
16358
16282
|
exports.ɵbuildCapabilityRows = buildCapabilityRows;
|
|
16359
16283
|
exports.ɵmaxRecallScore = maxRecallScore;
|