@copilotkit/web-inspector 1.71.0 → 1.71.1

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
@@ -503,6 +503,10 @@ const AGENT_EVENT_TYPES = [
503
503
  "ACTIVITY_SNAPSHOT",
504
504
  "ACTIVITY_DELTA"
505
505
  ];
506
+ const THREADS_LOCKED_COPY = {
507
+ heading: "Production-grade chat threads without the complexity. Self hostable.",
508
+ description: "Chat threads that go beyond text with generative UI and multimodal inputs, built to replay missed events and stay in sync across tabs, sessions, and devices."
509
+ };
506
510
  const EMPTY_INSPECTOR_MESSAGES = [];
507
511
  function textFromUnknownContent(content) {
508
512
  if (typeof content === "string") return content;
@@ -5261,14 +5265,14 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
5261
5265
  const clipboard = this.getClipboard(event);
5262
5266
  if (!clipboard?.writeText) return false;
5263
5267
  try {
5264
- await clipboard.writeText(require_home_briefing.homeFeatureImplementationPrompt(service, { onboardingRunId }));
5268
+ await clipboard.writeText(require_onboarding_prompt.createFeatureOnboardingPrompt(service.id, onboardingRunId));
5265
5269
  return true;
5266
5270
  } catch {
5267
5271
  return false;
5268
5272
  }
5269
5273
  };
5270
5274
  this.handleLearningSetupCopy = async (event, recopy = false) => {
5271
- const service = this.getHomeFeaturePromptTarget("threads");
5275
+ const service = this.getHomeFeaturePromptTarget("memory");
5272
5276
  if (!service || !this.core?.runtimeUrl) return;
5273
5277
  const request = ++this.learningSetupCopyRequest;
5274
5278
  const copied = await this.copyFeaturePromptToClipboard(service, event, this.getOnboardingRunId());
@@ -8540,6 +8544,24 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
8540
8544
  );
8541
8545
  }
8542
8546
 
8547
+ /* With no news or setup actions, the dismissal is the whole HUD. */
8548
+ .cpk-launcher-hud[data-cpk-hud-dismiss-only] {
8549
+ --hud-dismiss-day-height: 36px;
8550
+ width: max-content;
8551
+ }
8552
+
8553
+ .cpk-launcher-hud[data-cpk-hud-dismiss-only][data-cpk-hud-vertical="top"] {
8554
+ top: calc((var(--cpk-launcher-size) - var(--hud-dismiss-day-height)) / 2);
8555
+ }
8556
+
8557
+ .cpk-launcher-hud[data-cpk-hud-dismiss-only][data-cpk-hud-vertical="bottom"] {
8558
+ bottom: calc((var(--cpk-launcher-size) - var(--hud-dismiss-day-height)) / 2);
8559
+ }
8560
+
8561
+ .cpk-launcher-hud[data-cpk-hud-dismiss-only] .cpk-launcher-hud__card {
8562
+ width: max-content;
8563
+ }
8564
+
8543
8565
  .cpk-launcher-hud__list {
8544
8566
  margin: 0;
8545
8567
  padding: 0;
@@ -8706,6 +8728,11 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
8706
8728
  color 120ms ease;
8707
8729
  }
8708
8730
 
8731
+ .cpk-launcher-hud[data-cpk-hud-dismiss-only] .cpk-launcher-hud__dismiss-day {
8732
+ font-size: 11px;
8733
+ white-space: nowrap;
8734
+ }
8735
+
8709
8736
  .cpk-launcher-hud__dismiss-day:hover,
8710
8737
  .cpk-launcher-hud__dismiss-day:focus-visible {
8711
8738
  border-color: var(--hud-accent);
@@ -9925,6 +9952,7 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
9925
9952
  return titleCharacters.length > HUD_ANNOUNCEMENT_TITLE_LIMIT ? `${titleCharacters.slice(0, HUD_ANNOUNCEMENT_TITLE_LIMIT).join("").trimEnd()}...` : title;
9926
9953
  }
9927
9954
  renderHudRow(args) {
9955
+ if (args.connected) return lit.nothing;
9928
9956
  const detailId = `cpk-hud-detail-${args.id}`;
9929
9957
  return lit.html`
9930
9958
  <li
@@ -9996,11 +10024,13 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
9996
10024
  const learningOn = homeModel.services.some((service) => service.id === "memory" && service.enabled);
9997
10025
  const announcementTitle = this.getUnreadAnnouncementTitle();
9998
10026
  const featureBlockIntroIndex = announcementTitle ? 1 : 0;
10027
+ const dismissOnly = !announcementTitle && threadsOn && learningOn;
9999
10028
  return lit.html`
10000
10029
  <div
10001
10030
  class="cpk-launcher-hud"
10002
10031
  id="cpk-launcher-hud"
10003
10032
  data-cpk-launcher-hud
10033
+ ?data-cpk-hud-dismiss-only=${dismissOnly}
10004
10034
  data-cpk-hud-side=${this.launcherHudSide}
10005
10035
  data-cpk-hud-vertical=${this.contextState.button.anchor.vertical}
10006
10036
  data-cpk-hud-intro=${this.launcherHudIntro ? "true" : lit.nothing}
@@ -10010,7 +10040,9 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
10010
10040
  "--cpk-launcher-hud-waterfall-duration": `${LAUNCHER_HUD_INTRO_MS.waterfallDuration}ms`
10011
10041
  })}
10012
10042
  >
10013
- <span class="cpk-launcher-hud__arrow" aria-hidden="true"></span>
10043
+ ${dismissOnly ? lit.nothing : lit.html`
10044
+ <span class="cpk-launcher-hud__arrow" aria-hidden="true"></span>
10045
+ `}
10014
10046
  <div class="cpk-launcher-hud__card">
10015
10047
  ${announcementTitle ? lit.html`
10016
10048
  <div
@@ -10049,31 +10081,33 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
10049
10081
  </div>
10050
10082
  </div>
10051
10083
  ` : lit.nothing}
10052
- <ul
10053
- class="cpk-launcher-hud__list cpk-launcher-hud__feature-list"
10054
- role="list"
10055
- style=${(0, lit_directives_style_map_js.styleMap)({ "--cpk-hud-waterfall-delay": launcherHudWaterfallDelay(featureBlockIntroIndex) })}
10056
- >
10057
- ${this.renderHudRow({
10084
+ ${threadsOn && learningOn ? lit.nothing : lit.html`
10085
+ <ul
10086
+ class="cpk-launcher-hud__list cpk-launcher-hud__feature-list"
10087
+ role="list"
10088
+ style=${(0, lit_directives_style_map_js.styleMap)({ "--cpk-hud-waterfall-delay": launcherHudWaterfallDelay(featureBlockIntroIndex) })}
10089
+ >
10090
+ ${this.renderHudRow({
10058
10091
  id: "threads",
10059
10092
  label: HUD_THREADS_LABEL,
10060
10093
  icon: "MessageSquare",
10061
10094
  connected: threadsOn,
10062
10095
  introIndex: featureBlockIntroIndex + 1
10063
10096
  })}
10064
- ${this.renderHudRow({
10097
+ ${this.renderHudRow({
10065
10098
  id: "learning",
10066
10099
  label: HUD_LEARNING_LABEL,
10067
10100
  icon: "Brain",
10068
10101
  connected: learningOn,
10069
- introIndex: featureBlockIntroIndex + 2
10102
+ introIndex: featureBlockIntroIndex + (threadsOn ? 1 : 2)
10070
10103
  })}
10071
- </ul>
10104
+ </ul>
10105
+ `}
10072
10106
  <button
10073
10107
  type="button"
10074
10108
  class="cpk-launcher-hud__dismiss-day"
10075
10109
  data-cpk-dismiss-inspector="day"
10076
- style=${(0, lit_directives_style_map_js.styleMap)({ "--cpk-hud-waterfall-delay": launcherHudWaterfallDelay(featureBlockIntroIndex + 3) })}
10110
+ style=${(0, lit_directives_style_map_js.styleMap)({ "--cpk-hud-waterfall-delay": launcherHudWaterfallDelay(dismissOnly ? 0 : featureBlockIntroIndex + Number(!threadsOn) + Number(!learningOn) + 1) })}
10077
10111
  @click=${this.handleHudDismissDayClick}
10078
10112
  @pointerdown=${(event) => event.stopPropagation()}
10079
10113
  >
@@ -13482,23 +13516,6 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
13482
13516
  </div>
13483
13517
  `;
13484
13518
  }
13485
- getThreadsLockedCopy() {
13486
- switch (this.inspectorMetadataProjection.licenseState) {
13487
- case "valid": return {
13488
- heading: "Finish setting up Rich Threads",
13489
- description: "Copy this prompt into your coding agent to finish the setup."
13490
- };
13491
- case "none":
13492
- case "unknown": return {
13493
- heading: "Production-grade chat threads without the complexity. Self hostable.",
13494
- description: "Chat threads that go beyond text with generative UI and multimodal inputs, built to replay missed events and stay in sync across tabs, sessions, and devices."
13495
- };
13496
- case "expired": return {
13497
- heading: "Renew Intelligence to inspect Threads.",
13498
- description: "Your Intelligence access has expired. Renew it to inspect saved thread history."
13499
- };
13500
- }
13501
- }
13502
13519
  /**
13503
13520
  * Renders the realtime-connection indicator in the memory-store header.
13504
13521
  * Only `"connected"` shows the live (green-dot) state; `"connecting"` shows a
@@ -13549,7 +13566,7 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
13549
13566
  videoTitle: "CopilotKit Learning overview",
13550
13567
  outlineItems: LEARNING_LOCKED_FEATURE_OUTLINE,
13551
13568
  setupPrompt: {
13552
- serviceId: "threads",
13569
+ serviceId: "memory",
13553
13570
  copyState: this.learningPromptCopyState,
13554
13571
  onClick: (event) => void this.handleLearningSetupCopy(event)
13555
13572
  }
@@ -13565,7 +13582,7 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
13565
13582
  .setupActive=${this.isLearningSetupActive()}
13566
13583
  .copyState=${this.learningPromptCopyState}
13567
13584
  .recopyState=${this.learningPromptRecopyState}
13568
- .setupPrompt=${this.getHomeFeaturePromptTarget("threads") ? require_home_briefing.homeFeatureImplementationPrompt(this.getHomeFeaturePromptTarget("threads"), { onboardingRunId: this.getOnboardingRunId() }) : ""}
13585
+ .setupPrompt=${require_onboarding_prompt.createFeatureOnboardingPrompt("memory", this.getOnboardingRunId())}
13569
13586
  @learning-retry=${() => this.refreshLearningSnapshot({ preserve: this.learningSnapshot !== null })}
13570
13587
  @learning-copy-setup=${(event) => this.handleLearningSetupCopy(event)}
13571
13588
  @learning-recopy-setup=${(event) => this.handleLearningSetupCopy(event, true)}
@@ -13807,12 +13824,11 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
13807
13824
  renderThreadsView() {
13808
13825
  if (!this.areThreadEndpointsAvailable()) {
13809
13826
  this.trackThreadsViewStateOnce("locked");
13810
- const lockedCopy = this.getThreadsLockedCopy();
13811
13827
  return this.renderLockedFeatureOverview({
13812
13828
  serviceId: "threads",
13813
13829
  featureName: "Rich Threads",
13814
- heading: lockedCopy.heading,
13815
- description: lockedCopy.description,
13830
+ heading: THREADS_LOCKED_COPY.heading,
13831
+ description: THREADS_LOCKED_COPY.description,
13816
13832
  videoUrl: THREADS_LOCKED_VIDEO_URL,
13817
13833
  videoTitle: "Rich Threads overview",
13818
13834
  outlineItems: THREADS_LOCKED_FEATURE_OUTLINE