@copilotkit/web-inspector 1.77.1 → 1.77.2

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.umd.js CHANGED
@@ -3064,7 +3064,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
3064
3064
 
3065
3065
  //#endregion
3066
3066
  //#region package.json
3067
- var version = "1.77.1";
3067
+ var version = "1.77.2";
3068
3068
 
3069
3069
  //#endregion
3070
3070
  //#region src/lib/telemetry.ts
@@ -3632,8 +3632,46 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
3632
3632
  return FEATURE_ONBOARDING_PROMPT_TEMPLATE.replace(RUN_ID_PLACEHOLDER, runId).replace(INTENT_PLACEHOLDER, FEATURE_ONBOARDING_INTENT[serviceId]);
3633
3633
  }
3634
3634
 
3635
+ //#endregion
3636
+ //#region \0@oxc-project+runtime@0.112.0/helpers/checkPrivateRedeclaration.js
3637
+ function _checkPrivateRedeclaration(e, t) {
3638
+ if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object");
3639
+ }
3640
+
3641
+ //#endregion
3642
+ //#region \0@oxc-project+runtime@0.112.0/helpers/classPrivateMethodInitSpec.js
3643
+ function _classPrivateMethodInitSpec(e, a) {
3644
+ _checkPrivateRedeclaration(e, a), a.add(e);
3645
+ }
3646
+
3647
+ //#endregion
3648
+ //#region \0@oxc-project+runtime@0.112.0/helpers/classPrivateFieldInitSpec.js
3649
+ function _classPrivateFieldInitSpec(e, t, a) {
3650
+ _checkPrivateRedeclaration(e, t), t.set(e, a);
3651
+ }
3652
+
3653
+ //#endregion
3654
+ //#region \0@oxc-project+runtime@0.112.0/helpers/assertClassBrand.js
3655
+ function _assertClassBrand(e, t, n) {
3656
+ if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
3657
+ throw new TypeError("Private element is not present on this object");
3658
+ }
3659
+
3660
+ //#endregion
3661
+ //#region \0@oxc-project+runtime@0.112.0/helpers/classPrivateFieldGet2.js
3662
+ function _classPrivateFieldGet2(s, a) {
3663
+ return s.get(_assertClassBrand(s, a));
3664
+ }
3665
+
3666
+ //#endregion
3667
+ //#region \0@oxc-project+runtime@0.112.0/helpers/classPrivateFieldSet2.js
3668
+ function _classPrivateFieldSet2(s, a, r) {
3669
+ return s.set(_assertClassBrand(s, a), r), r;
3670
+ }
3671
+
3635
3672
  //#endregion
3636
3673
  //#region src/index.ts
3674
+ var _globalThis$HTMLEleme;
3637
3675
  const WEB_INSPECTOR_TAG = "cpk-web-inspector";
3638
3676
  const THREAD_INSPECTOR_TAG = "cpk-thread-inspector";
3639
3677
  /**
@@ -4444,7 +4482,96 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4444
4482
  return value;
4445
4483
  }
4446
4484
  }
4485
+ let inspectorJsonRenderer = null;
4486
+ let inspectorJsonSlotCount = 0;
4487
+ const JSON_BLOCK_TAG = "cpk-json-block";
4488
+ /**
4489
+ * Replaces the inspector's built-in JSON blocks (tool arguments and results,
4490
+ * state, events, and context) with a host renderer. Pass `null` to restore the
4491
+ * built-in blocks. Set it before the inspector renders: a block that is
4492
+ * already on screen changes at the inspector's next render.
4493
+ *
4494
+ * @example
4495
+ * ```ts
4496
+ * setInspectorJsonRenderer((container, value) => {
4497
+ * const root = createRoot(container);
4498
+ * root.render(<JsonView value={value} />);
4499
+ * return () => root.unmount();
4500
+ * });
4501
+ * ```
4502
+ */
4503
+ function setInspectorJsonRenderer(renderer) {
4504
+ inspectorJsonRenderer = renderer;
4505
+ }
4506
+ var _value = /* @__PURE__ */ new WeakMap();
4507
+ var _hasValue = /* @__PURE__ */ new WeakMap();
4508
+ var _cleanup = /* @__PURE__ */ new WeakMap();
4509
+ var _container = /* @__PURE__ */ new WeakMap();
4510
+ var _CpkJsonBlock_brand = /* @__PURE__ */ new WeakSet();
4511
+ /**
4512
+ * Hosts one value drawn by the host renderer. Inside a shadow root, the
4513
+ * container lives in the shadow host's light DOM and shows here through a
4514
+ * named slot, so the host page's own styles apply to what the renderer draws.
4515
+ */
4516
+ var CpkJsonBlock = class extends ((_globalThis$HTMLEleme = globalThis.HTMLElement) !== null && _globalThis$HTMLEleme !== void 0 ? _globalThis$HTMLEleme : class {}) {
4517
+ constructor(..._args) {
4518
+ super(..._args);
4519
+ _classPrivateMethodInitSpec(this, _CpkJsonBlock_brand);
4520
+ _classPrivateFieldInitSpec(this, _value, void 0);
4521
+ _classPrivateFieldInitSpec(this, _hasValue, false);
4522
+ _classPrivateFieldInitSpec(this, _cleanup, void 0);
4523
+ _classPrivateFieldInitSpec(this, _container, void 0);
4524
+ }
4525
+ get value() {
4526
+ return _classPrivateFieldGet2(_value, this);
4527
+ }
4528
+ set value(next) {
4529
+ if (_classPrivateFieldGet2(_hasValue, this) && Object.is(next, _classPrivateFieldGet2(_value, this))) return;
4530
+ _classPrivateFieldSet2(_value, this, next);
4531
+ _classPrivateFieldSet2(_hasValue, this, true);
4532
+ if (this.isConnected) _assertClassBrand(_CpkJsonBlock_brand, this, _render).call(this);
4533
+ }
4534
+ connectedCallback() {
4535
+ this.style.display = "block";
4536
+ _assertClassBrand(_CpkJsonBlock_brand, this, _render).call(this);
4537
+ }
4538
+ disconnectedCallback() {
4539
+ _assertClassBrand(_CpkJsonBlock_brand, this, _teardown).call(this);
4540
+ }
4541
+ };
4542
+ function _render() {
4543
+ _assertClassBrand(_CpkJsonBlock_brand, this, _teardown).call(this);
4544
+ const renderer = inspectorJsonRenderer;
4545
+ if (!renderer) return;
4546
+ const root = this.getRootNode();
4547
+ const container = this.ownerDocument.createElement("div");
4548
+ if (root.nodeType === Node.DOCUMENT_FRAGMENT_NODE && "host" in root) {
4549
+ inspectorJsonSlotCount += 1;
4550
+ const name = `cpk-json-${inspectorJsonSlotCount}`;
4551
+ const slot = this.ownerDocument.createElement("slot");
4552
+ slot.name = name;
4553
+ this.replaceChildren(slot);
4554
+ container.slot = name;
4555
+ root.host.append(container);
4556
+ } else this.replaceChildren(container);
4557
+ _classPrivateFieldSet2(_container, this, container);
4558
+ const cleanup = renderer(container, _classPrivateFieldGet2(_value, this));
4559
+ _classPrivateFieldSet2(_cleanup, this, typeof cleanup === "function" ? cleanup : void 0);
4560
+ }
4561
+ function _teardown() {
4562
+ var _classPrivateFieldGet2$1;
4563
+ const cleanup = _classPrivateFieldGet2(_cleanup, this);
4564
+ _classPrivateFieldSet2(_cleanup, this, void 0);
4565
+ cleanup === null || cleanup === void 0 || cleanup();
4566
+ (_classPrivateFieldGet2$1 = _classPrivateFieldGet2(_container, this)) === null || _classPrivateFieldGet2$1 === void 0 || _classPrivateFieldGet2$1.remove();
4567
+ _classPrivateFieldSet2(_container, this, void 0);
4568
+ this.replaceChildren();
4569
+ }
4447
4570
  function renderHighlightedJsonBlock(value, options = {}) {
4571
+ if (inspectorJsonRenderer) return lit.html`<cpk-json-block
4572
+ .value=${value}
4573
+ style=${options.maxHeight ? `overflow:auto;max-height:${options.maxHeight}` : lit.nothing}
4574
+ ></cpk-json-block>`;
4448
4575
  const parsed = coerceJsonValue(value);
4449
4576
  return lit.html`<pre class="cpk-json-block" style=${(options.maxHeight ? `max-height:${options.maxHeight}` : void 0) || lit.nothing}>
4450
4577
  ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(parsed))}</pre
@@ -4506,8 +4633,8 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(parsed))}</pre
4506
4633
  }
4507
4634
  };
4508
4635
  var CpkThreadList = class extends PortableLitElement {
4509
- constructor(..._args) {
4510
- super(..._args);
4636
+ constructor(..._args2) {
4637
+ super(..._args2);
4511
4638
  this.threads = [];
4512
4639
  this.selectedThreadId = null;
4513
4640
  this.inAppThreadId = null;
@@ -4861,8 +4988,8 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(parsed))}</pre
4861
4988
  }
4862
4989
  `;
4863
4990
  var CpkThreadInspector = class CpkThreadInspector extends PortableLitElement {
4864
- constructor(..._args2) {
4865
- super(..._args2);
4991
+ constructor(..._args3) {
4992
+ super(..._args3);
4866
4993
  this.showThreadTitle = true;
4867
4994
  this.threadId = null;
4868
4995
  this.provider = null;
@@ -8095,8 +8222,8 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(parsed))}</pre
8095
8222
  return Math.max(6, Math.min(100, Math.round(relevance * 100)));
8096
8223
  }
8097
8224
  var CpkMemoryList = class extends PortableLitElement {
8098
- constructor(..._args3) {
8099
- super(..._args3);
8225
+ constructor(..._args4) {
8226
+ super(..._args4);
8100
8227
  this.memories = [];
8101
8228
  this.recallResults = null;
8102
8229
  this.recallLoading = false;
@@ -8708,8 +8835,8 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(parsed))}</pre
8708
8835
  if (!registry.get(tag)) registry.define(tag, ctor);
8709
8836
  }
8710
8837
  var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
8711
- constructor(..._args4) {
8712
- super(..._args4);
8838
+ constructor(..._args5) {
8839
+ super(..._args5);
8713
8840
  this._core = null;
8714
8841
  this.coreSubscriber = null;
8715
8842
  this.coreUnsubscribe = null;
@@ -20055,6 +20182,7 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(parsed))}</pre
20055
20182
  defineElementOnce(registry, THREAD_INSPECTOR_TAG, CpkThreadInspector);
20056
20183
  defineElementOnce(registry, "cpk-thread-details", ɵCpkThreadDetails);
20057
20184
  defineElementOnce(registry, "cpk-memory-list", CpkMemoryList);
20185
+ defineElementOnce(registry, JSON_BLOCK_TAG, CpkJsonBlock);
20058
20186
  defineElementOnce(registry, WEB_INSPECTOR_TAG, WebInspectorElement);
20059
20187
  }
20060
20188
  /**
@@ -20077,6 +20205,7 @@ exports.WEB_INSPECTOR_TAG = WEB_INSPECTOR_TAG;
20077
20205
  exports.WebInspectorElement = WebInspectorElement;
20078
20206
  exports.configureWebInspectorElement = configureWebInspectorElement;
20079
20207
  exports.defineWebInspector = defineWebInspector;
20208
+ exports.setInspectorJsonRenderer = setInspectorJsonRenderer;
20080
20209
  exports.ɵCpkThreadDetails = ɵCpkThreadDetails;
20081
20210
  exports.ɵbuildCapabilityRows = buildCapabilityRows;
20082
20211
  exports.ɵmaxRecallScore = maxRecallScore;