@copilotkit/web-inspector 1.71.1 → 1.71.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.cjs CHANGED
@@ -4982,6 +4982,7 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
4982
4982
  };
4983
4983
  this.lastScrolledAgentNavigationLayout = null;
4984
4984
  this.selectedThreadId = null;
4985
+ this.ephemeralThreadsSetupOpen = false;
4985
4986
  this.inAppThreadId = null;
4986
4987
  this.inAppAgentId = null;
4987
4988
  this.inAppSource = null;
@@ -6068,6 +6069,7 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
6068
6069
  if (oldValue === value) return;
6069
6070
  this.detachFromCore();
6070
6071
  const hadResolvedCore = this.hasResolvedCore;
6072
+ this.ephemeralThreadsSetupOpen = false;
6071
6073
  this._core = value ?? null;
6072
6074
  if (this._core) this.hasResolvedCore = true;
6073
6075
  if (!hadResolvedCore && this._core) this.resolvePendingPersistedMenu();
@@ -6237,7 +6239,7 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
6237
6239
  }
6238
6240
  /** Report only real rows visible in the active, settled Threads view. */
6239
6241
  hasActiveVisibleThreads() {
6240
- if (this.selectedMenu !== "threads" || this.settingsOpen || !this.areThreadEndpointsAvailable()) return false;
6242
+ if (this.selectedMenu !== "threads" || this.settingsOpen || this.ephemeralThreadsSetupOpen || !this.areThreadEndpointsAvailable()) return false;
6241
6243
  const { displayThreads, threadsErrorMessage, threadsLoading } = this.getActiveThreadsState();
6242
6244
  return !threadsErrorMessage && !threadsLoading && displayThreads.length > 0;
6243
6245
  }
@@ -13822,9 +13824,27 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
13822
13824
  `;
13823
13825
  }
13824
13826
  renderThreadsView() {
13825
- if (!this.areThreadEndpointsAvailable()) {
13827
+ const { displayThreads, threadsErrorMessage, threadsLoading } = this.getActiveThreadsState();
13828
+ const ephemeral = !this._core?.intelligence;
13829
+ const available = this.areThreadEndpointsAvailable();
13830
+ const hasEphemeralThreads = ephemeral && available && displayThreads.length > 0;
13831
+ if (!ephemeral) this.ephemeralThreadsSetupOpen = false;
13832
+ if (!available || ephemeral && displayThreads.length === 0 && !threadsLoading && !threadsErrorMessage || this.ephemeralThreadsSetupOpen) {
13826
13833
  this.trackThreadsViewStateOnce("locked");
13827
- return this.renderLockedFeatureOverview({
13834
+ return lit.html`
13835
+ ${hasEphemeralThreads ? lit.html`
13836
+ <nav class="cpk-threads-setup-navigation" aria-label="Threads setup navigation">
13837
+ <button type="button" class="cpk-threads-setup-back"
13838
+ data-inspector-ephemeral-back
13839
+ @click=${() => {
13840
+ this.ephemeralThreadsSetupOpen = false;
13841
+ this.requestUpdate();
13842
+ }}>
13843
+ <span aria-hidden="true">←</span> Back to your threads
13844
+ </button>
13845
+ </nav>
13846
+ ` : lit.nothing}
13847
+ ${this.renderLockedFeatureOverview({
13828
13848
  serviceId: "threads",
13829
13849
  featureName: "Rich Threads",
13830
13850
  heading: THREADS_LOCKED_COPY.heading,
@@ -13832,9 +13852,8 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
13832
13852
  videoUrl: THREADS_LOCKED_VIDEO_URL,
13833
13853
  videoTitle: "Rich Threads overview",
13834
13854
  outlineItems: THREADS_LOCKED_FEATURE_OUTLINE
13835
- });
13855
+ })}`;
13836
13856
  }
13837
- const { displayThreads, threadsErrorMessage, threadsLoading } = this.getActiveThreadsState();
13838
13857
  const loadingWithoutRows = threadsLoading && !threadsErrorMessage && displayThreads.length === 0;
13839
13858
  const showingExamples = this.shouldRenderExampleThreads(displayThreads, threadsErrorMessage, threadsLoading);
13840
13859
  const visibleThreads = threadsErrorMessage || loadingWithoutRows ? [] : showingExamples ? THREADS_EXAMPLE_THREADS : displayThreads;
@@ -13851,6 +13870,24 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
13851
13870
  <div
13852
13871
  style="width:${this.threadListWidth}px;flex-shrink:0;overflow:hidden;display:flex;flex-direction:column;border-right:1px solid #DBDBE5;"
13853
13872
  >
13873
+ ${ephemeral ? lit.html`
13874
+ <button type="button" class="cpk-ephemeral-threads-banner"
13875
+ data-inspector-ephemeral-banner data-inspector-ephemeral-upgrade
13876
+ aria-label="Make threads permanent. Ephemeral history can disappear on restart."
13877
+ @click=${() => {
13878
+ this.ephemeralThreadsSetupOpen = true;
13879
+ this.requestUpdate();
13880
+ }}>
13881
+ <span class="cpk-ephemeral-threads-icon" aria-hidden="true">${this.renderIcon("Clock")}</span>
13882
+ <span class="cpk-ephemeral-threads-copy">
13883
+ <span class="cpk-ephemeral-threads-headline">
13884
+ <strong>Keep your threads.</strong>
13885
+ </span>
13886
+ <span class="cpk-ephemeral-threads-description">Ephemeral history can disappear on restart.</span>
13887
+ <span class="cpk-ephemeral-threads-upgrade">Make them permanent <span aria-hidden="true">${this.renderIcon("ArrowRight")}</span></span>
13888
+ </span>
13889
+ </button>
13890
+ ` : lit.nothing}
13854
13891
  <cpk-thread-list
13855
13892
  style="min-height:0;flex:1;"
13856
13893
  data-color-scheme=${this.colorScheme}