@copilotkit/web-inspector 1.77.0 → 1.77.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
@@ -1,6 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_notifications = require('./lib/notifications.cjs');
3
3
  const require_notification_loader = require('./lib/notification-loader.cjs');
4
+ const require_hud_config = require('./lib/hud-config.cjs');
5
+ const require_hud_loader = require('./lib/hud-loader.cjs');
6
+ const require_hud_defaults = require('./lib/hud-defaults.cjs');
4
7
  const require_persistence = require('./lib/persistence.cjs');
5
8
  const require_generated = require('./styles/generated.cjs');
6
9
  const require_notification_article = require('./styles/notification-article.cjs');
@@ -121,9 +124,6 @@ const EVENT_ERROR_GUIDANCE = {
121
124
  const PILL_SUBLINE_LABEL = "Open Inspector for details";
122
125
  const HUD_INSPECTOR_LABEL = "CopilotKit Inspector";
123
126
  const HUD_ANNOUNCEMENT_TITLE_LIMIT = 80;
124
- const HUD_THREADS_LABEL = "Rich Threads";
125
- const HUD_LEARNING_LABEL = "Automatic Learning";
126
- const HUD_LEARN_MORE_LABEL = "Click to learn more";
127
127
  const INSPECTOR_DISMISSAL_MS = {
128
128
  day: 1440 * 60 * 1e3,
129
129
  week: 10080 * 60 * 1e3,
@@ -5225,6 +5225,9 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
5225
5225
  this.announcementId = null;
5226
5226
  this.announcementLoaded = false;
5227
5227
  this.announcementPromise = null;
5228
+ this.hudFeed = null;
5229
+ this.hudFeedPromise = null;
5230
+ this.hudContent = require_hud_defaults.HUD_DEFAULT_CONTENT;
5228
5231
  this.newsSignalArmed = false;
5229
5232
  this.pulsingSignal = null;
5230
5233
  this.pendingPulseSignal = null;
@@ -5567,7 +5570,8 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
5567
5570
  control,
5568
5571
  trigger
5569
5572
  }));
5570
- this.hudLandingMenu = row === "threads" ? "threads" : row === "learning" ? "memories" : "home";
5573
+ const destination = this.hudContent[row].destination;
5574
+ this.hudLandingMenu = require_inspector_nav.isInspectorMenuKey(destination) && this.menuItems.some((item) => item.key === destination) ? destination : row === "threads" ? "threads" : "memories";
5571
5575
  this.closeLauncherHud();
5572
5576
  this.openInspector("floating_button");
5573
5577
  };
@@ -8890,6 +8894,8 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
8890
8894
 
8891
8895
  .cpk-launcher-hud__label {
8892
8896
  min-width: 0;
8897
+ /* Remote copy can be one long word; wrap it inside the row. */
8898
+ overflow-wrap: anywhere;
8893
8899
  }
8894
8900
 
8895
8901
  .cpk-launcher-hud__feature-icon {
@@ -9692,7 +9698,8 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
9692
9698
  <div data-inspector-portal-anchor></div>
9693
9699
  ` : this.renderButton();
9694
9700
  }
9695
- willUpdate() {
9701
+ willUpdate(changed) {
9702
+ if (changed.has("notificationContext")) this.refreshHudContent();
9696
9703
  this.evaluateErrorSignals();
9697
9704
  this.reconcileSelectedMenuVisibility();
9698
9705
  if (this.isOpen && this.dockMode === "docked-left") this.setAttribute("data-docked", "true");
@@ -10077,6 +10084,7 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
10077
10084
  renderHudRow(args) {
10078
10085
  if (args.connected) return lit.nothing;
10079
10086
  const detailId = `cpk-hud-detail-${args.id}`;
10087
+ const { label, description } = this.hudContent[args.id];
10080
10088
  return lit.html`
10081
10089
  <li
10082
10090
  class="cpk-launcher-hud__row"
@@ -10090,7 +10098,7 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
10090
10098
  type="button"
10091
10099
  class="cpk-launcher-hud__action"
10092
10100
  data-cpk-hud-action
10093
- aria-label=${`Open ${args.label} in Inspector`}
10101
+ aria-label=${`Open ${label} in Inspector`}
10094
10102
  @click=${(event) => this.handleHudActionClick(event, args.id, "action")}
10095
10103
  @pointerdown=${(event) => event.stopPropagation()}
10096
10104
  >
@@ -10100,13 +10108,13 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
10100
10108
  aria-hidden="true"
10101
10109
  >${this.renderIcon(args.icon)}</span
10102
10110
  >
10103
- <span class="cpk-launcher-hud__label">${args.label}</span>
10111
+ <span class="cpk-launcher-hud__label">${label}</span>
10104
10112
  </button>
10105
10113
  <span
10106
10114
  class="cpk-launcher-hud__tooltip"
10107
10115
  id=${detailId}
10108
10116
  role="tooltip"
10109
- >${HUD_LEARN_MORE_LABEL}</span
10117
+ >${description}</span
10110
10118
  >
10111
10119
  </span>
10112
10120
  <span class="cpk-launcher-hud__controls">
@@ -10114,7 +10122,7 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
10114
10122
  type="button"
10115
10123
  class="cpk-launcher-hud__learn-more"
10116
10124
  data-cpk-hud-learn-more=${args.id}
10117
- aria-label=${`Learn more about ${args.label}`}
10125
+ aria-label=${`Learn more about ${label}`}
10118
10126
  aria-describedby=${detailId}
10119
10127
  @click=${(event) => this.handleHudActionClick(event, args.id, "learn_more")}
10120
10128
  @pointerdown=${(event) => event.stopPropagation()}
@@ -10126,7 +10134,7 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
10126
10134
  class="cpk-launcher-hud__toggle"
10127
10135
  data-cpk-hud-toggle=${args.id}
10128
10136
  data-enabled=${args.connected ? "true" : "false"}
10129
- aria-label=${args.connected ? `${args.label} is enabled` : `Open ${args.label} in Inspector`}
10137
+ aria-label=${args.connected ? `${label} is enabled` : `Open ${label} in Inspector`}
10130
10138
  ?disabled=${args.connected}
10131
10139
  @click=${(event) => this.handleHudActionClick(event, args.id, "toggle")}
10132
10140
  @pointerdown=${(event) => event.stopPropagation()}
@@ -10212,14 +10220,12 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
10212
10220
  >
10213
10221
  ${this.renderHudRow({
10214
10222
  id: "threads",
10215
- label: HUD_THREADS_LABEL,
10216
10223
  icon: "MessageSquare",
10217
10224
  connected: threadsOn,
10218
10225
  introIndex: featureBlockIntroIndex + 1
10219
10226
  })}
10220
10227
  ${this.renderHudRow({
10221
10228
  id: "learning",
10222
- label: HUD_LEARNING_LABEL,
10223
10229
  icon: "Brain",
10224
10230
  connected: learningOn,
10225
10231
  introIndex: featureBlockIntroIndex + (threadsOn ? 1 : 2)
@@ -16056,9 +16062,23 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
16056
16062
  require_telemetry.trackWhatsNewSignalViewed(props);
16057
16063
  }
16058
16064
  }
16065
+ /** Start the development-only remote feeds; neither blocks rendering. */
16059
16066
  ensureAnnouncementLoading() {
16060
- if (this.isInspectorDismissed || !this.notificationContext.development || !this.isConnected || this.announcementPromise || typeof window === "undefined" || typeof fetch === "undefined") return;
16061
- this.announcementPromise = this.fetchAnnouncement();
16067
+ if (this.isInspectorDismissed || !this.notificationContext.development || !this.isConnected || typeof window === "undefined" || typeof fetch === "undefined") return;
16068
+ this.announcementPromise ??= this.fetchAnnouncement();
16069
+ this.hudFeedPromise ??= this.fetchHudFeed();
16070
+ }
16071
+ async fetchHudFeed() {
16072
+ this.hudFeed = await require_hud_loader.loadHudFeed();
16073
+ this.refreshHudContent();
16074
+ this.requestUpdate();
16075
+ }
16076
+ /** Overlay the matching feed rule on the built-in HUD content. */
16077
+ refreshHudContent() {
16078
+ this.hudContent = require_hud_config.resolveHudContent(this.hudFeed, this.notificationContext, {
16079
+ defaults: require_hud_defaults.HUD_DEFAULT_CONTENT,
16080
+ supportedDestinations: require_inspector_nav.INSPECTOR_MENU_KEYS
16081
+ });
16062
16082
  }
16063
16083
  async fetchAnnouncement() {
16064
16084
  try {