@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.umd.js CHANGED
@@ -2025,19 +2025,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2025
2025
 
2026
2026
  //#endregion
2027
2027
  //#region src/lib/home-briefing.ts
2028
- /**
2029
- * A self-contained handoff for a coding agent. It answers the onboarding
2030
- * workflow's session and feedback consent gates up front, while keeping the
2031
- * feature guide—not a generic product-onboarding branch—in control of the
2032
- * implementation plan.
2033
- */
2034
- function homeFeatureImplementationPrompt(service, context) {
2035
- return `Identify your coding-agent slug (for example, \`codex\` or \`claude-code\`). From the target project root, run \`npx copilotkit@latest onboard start --run ${context.onboardingRunId} --coding-agent <coding-agent-slug>\` and use its output as onboarding context. If it requires a CopilotKit CLI session check, you have permission to run it; never reveal credentials or send optional diagnostic feedback reports.
2036
-
2037
- This task is specifically to enable ${service.label}, not to re-onboard the application. First inspect the existing CopilotKit runtime, provider, agent, and UI wiring, and confirm that ${service.label} is not already enabled. Then read the ${service.label} guide (${service.docsUrl}) and make a short plan before editing. Preserve the project's framework, package manager, installed CopilotKit version, existing agent IDs, routes, provider layout, and working behavior. Do not create, select, or alter a CopilotKit Intelligence project—or add Intelligence configuration—unless this feature's official guide explicitly requires it or the user asks.
2038
-
2039
- Implement the smallest complete integration: wire every feature-required client and runtime configuration into the chat-to-agent path people already use, reuse local patterns, and do not invent environment values or hardcode secrets. Add or update focused tests and run the relevant project checks. Finish only after local validation proves ${service.label} works—not merely that the code compiles. Use a feature-specific runtime or Inspector capability check and, when the feature supports one, a representative UI interaction that proves the user-facing result. If the project overrides default rendering (for example, with a wildcard tool renderer), make that override compatible with this feature; a capability flag alone is not success. Summarize the changed files, validation, and any manual setup still required.`;
2040
- }
2041
2028
  const SERVICE_DOCS_URL = {
2042
2029
  threads: "https://docs.copilotkit.ai/threads",
2043
2030
  memory: "https://docs.copilotkit.ai/intelligence/intelligence-platform",
@@ -2416,7 +2403,7 @@ Implement the smallest complete integration: wire every feature-required client
2416
2403
 
2417
2404
  //#endregion
2418
2405
  //#region package.json
2419
- var version = "1.71.0";
2406
+ var version = "1.71.1";
2420
2407
 
2421
2408
  //#endregion
2422
2409
  //#region src/lib/telemetry.ts
@@ -2862,9 +2849,26 @@ Implement the smallest complete integration: wire every feature-required client
2862
2849
  * Intelligence app (`apps/app-frontend/react-shell/src/home/intelligence-home.tsx`).
2863
2850
  * The CLI resolves `onboard start` against a prompt graph, so the two surfaces
2864
2851
  * must not drift — if the CLI's entry point changes, both change together.
2852
+ *
2853
+ * Two lines, and deliberately nothing else. It used to open by telling the
2854
+ * agent to identify itself and pass the slug as a flag -- two sentences of
2855
+ * instruction to a machine, in the one piece of text a human reads, decides on
2856
+ * and pastes. The graph asks for the slug itself now, with `onboard identify`,
2857
+ * which is the surface that talks to the agent for the rest of the run
2858
+ * (Intelligence OSS-1157).
2859
+ *
2860
+ * This one stays generic, and so do the docs and Intelligence web-app copies
2861
+ * of it (OSS-1150). Those three are entry points for a developer with no
2862
+ * CopilotKit app yet, and every `--intent` route requires an existing app: it
2863
+ * inspects for one first and reads `feature/stop` when it is missing. The
2864
+ * feature buttons on Home are the surface that knows which feature the
2865
+ * developer is looking at, so they are the surface that names an intent — see
2866
+ * `FEATURE_ONBOARDING_PROMPT_TEMPLATE` below.
2865
2867
  */
2866
2868
  const RUN_ID_PLACEHOLDER = "<run-id>";
2867
- const ONBOARDING_PROMPT_TEMPLATE = `Identify which coding-agent product you are, using a short slug such as \`codex\` or \`claude-code\`. From the root of the project where you want CopilotKit, run \`npx --yes copilotkit@latest onboard start --run ${RUN_ID_PLACEHOLDER} --coding-agent <coding-agent-slug>\`. Follow the Markdown instructions it prints until onboarding is complete.`;
2869
+ const ONBOARDING_PROMPT_TEMPLATE = `Help me get started with CopilotKit. Run this command and follow the instructions:
2870
+
2871
+ npx --yes copilotkit@latest onboard start --run ${RUN_ID_PLACEHOLDER}`;
2868
2872
  /** Length and alphabet are the CLI's, so a run id copied here resolves there. */
2869
2873
  const RUN_ID_LENGTH = 12;
2870
2874
  /**
@@ -2891,6 +2895,53 @@ Implement the smallest complete integration: wire every feature-required client
2891
2895
  function createOnboardingPrompt(runId) {
2892
2896
  return ONBOARDING_PROMPT_TEMPLATE.replace(RUN_ID_PLACEHOLDER, runId);
2893
2897
  }
2898
+ /**
2899
+ * Which feature outcome each Home tile asks the CLI for.
2900
+ *
2901
+ * The two vocabularies stay separate on purpose. A `HomeServiceId` names a
2902
+ * tile and the pane behind it, so `websocket` and `audio` are the right words
2903
+ * for it; an intent names the work to be done, so `add-realtime-sync` and
2904
+ * `add-voice` are the right words for that. One table maps between them, and
2905
+ * `Record<HomeServiceId, OnboardingIntent>` makes a new tile or a renamed
2906
+ * slug a type error rather than a missing button.
2907
+ *
2908
+ * `memory` maps to `add-learning` because the tile is the Learning tile: it is
2909
+ * enabled by a *configured Learning container* (see `learningOn` in
2910
+ * `index.ts`), which is exactly what `feature/learning` sets up. The tile id
2911
+ * and the `memories` menu key are older names for that same pane.
2912
+ */
2913
+ const FEATURE_ONBOARDING_INTENT = {
2914
+ threads: "add-rich-threads",
2915
+ memory: "add-learning",
2916
+ a2ui: "add-a2ui",
2917
+ "open-gen-ui": "add-open-generative-ui",
2918
+ suggestions: "add-chat-suggestions",
2919
+ audio: "add-voice",
2920
+ websocket: "add-realtime-sync"
2921
+ };
2922
+ const INTENT_PLACEHOLDER = "<intent>";
2923
+ /**
2924
+ * The prompt a Home feature button copies.
2925
+ *
2926
+ * It carries no feature-specific instruction, and it must not gain any. The
2927
+ * `--intent` route owns the plan, the guide links, the per-phase check-ins,
2928
+ * the refusal when a prerequisite is missing, and the proof step; prose copied
2929
+ * here would duplicate all of that and then drift from it the next time the
2930
+ * underlying API changes.
2931
+ *
2932
+ * What is left is the caller's own business: identify yourself, run this
2933
+ * command, and the standing permission for the session check that the
2934
+ * developer granted by copying the prompt.
2935
+ */
2936
+ const FEATURE_ONBOARDING_PROMPT_TEMPLATE = `Help me set this up in my CopilotKit app. Run this command and follow the instructions:
2937
+
2938
+ npx --yes copilotkit@latest onboard start --run ${RUN_ID_PLACEHOLDER} --intent ${INTENT_PLACEHOLDER}
2939
+
2940
+ If it requires a CopilotKit CLI session check, you have permission to run it. Never reveal credentials or send optional diagnostic feedback reports.`;
2941
+ /** Bind one run id and one tile's feature outcome into the copied prompt. */
2942
+ function createFeatureOnboardingPrompt(serviceId, runId) {
2943
+ return FEATURE_ONBOARDING_PROMPT_TEMPLATE.replace(RUN_ID_PLACEHOLDER, runId).replace(INTENT_PLACEHOLDER, FEATURE_ONBOARDING_INTENT[serviceId]);
2944
+ }
2894
2945
 
2895
2946
  //#endregion
2896
2947
  //#region src/index.ts
@@ -3376,6 +3427,10 @@ Implement the smallest complete integration: wire every feature-required client
3376
3427
  "ACTIVITY_SNAPSHOT",
3377
3428
  "ACTIVITY_DELTA"
3378
3429
  ];
3430
+ const THREADS_LOCKED_COPY = {
3431
+ heading: "Production-grade chat threads without the complexity. Self hostable.",
3432
+ 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."
3433
+ };
3379
3434
  const EMPTY_INSPECTOR_MESSAGES = [];
3380
3435
  function textFromUnknownContent(content) {
3381
3436
  if (typeof content === "string") return content;
@@ -8170,7 +8225,7 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(parsed))}</pre
8170
8225
  const clipboard = this.getClipboard(event);
8171
8226
  if (!(clipboard === null || clipboard === void 0 ? void 0 : clipboard.writeText)) return false;
8172
8227
  try {
8173
- await clipboard.writeText(homeFeatureImplementationPrompt(service, { onboardingRunId }));
8228
+ await clipboard.writeText(createFeatureOnboardingPrompt(service.id, onboardingRunId));
8174
8229
  return true;
8175
8230
  } catch (_unused4) {
8176
8231
  return false;
@@ -8178,7 +8233,7 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(parsed))}</pre
8178
8233
  };
8179
8234
  this.handleLearningSetupCopy = async (event, recopy = false) => {
8180
8235
  var _this$core;
8181
- const service = this.getHomeFeaturePromptTarget("threads");
8236
+ const service = this.getHomeFeaturePromptTarget("memory");
8182
8237
  if (!service || !((_this$core = this.core) === null || _this$core === void 0 ? void 0 : _this$core.runtimeUrl)) return;
8183
8238
  const request = ++this.learningSetupCopyRequest;
8184
8239
  const copied = await this.copyFeaturePromptToClipboard(service, event, this.getOnboardingRunId());
@@ -10737,6 +10792,7 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(parsed))}</pre
10737
10792
  return titleCharacters.length > HUD_ANNOUNCEMENT_TITLE_LIMIT ? `${titleCharacters.slice(0, HUD_ANNOUNCEMENT_TITLE_LIMIT).join("").trimEnd()}...` : title;
10738
10793
  }
10739
10794
  renderHudRow(args) {
10795
+ if (args.connected) return lit.nothing;
10740
10796
  const detailId = `cpk-hud-detail-${args.id}`;
10741
10797
  return lit.html`
10742
10798
  <li
@@ -10808,11 +10864,13 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(parsed))}</pre
10808
10864
  const learningOn = homeModel.services.some((service) => service.id === "memory" && service.enabled);
10809
10865
  const announcementTitle = this.getUnreadAnnouncementTitle();
10810
10866
  const featureBlockIntroIndex = announcementTitle ? 1 : 0;
10867
+ const dismissOnly = !announcementTitle && threadsOn && learningOn;
10811
10868
  return lit.html`
10812
10869
  <div
10813
10870
  class="cpk-launcher-hud"
10814
10871
  id="cpk-launcher-hud"
10815
10872
  data-cpk-launcher-hud
10873
+ ?data-cpk-hud-dismiss-only=${dismissOnly}
10816
10874
  data-cpk-hud-side=${this.launcherHudSide}
10817
10875
  data-cpk-hud-vertical=${this.contextState.button.anchor.vertical}
10818
10876
  data-cpk-hud-intro=${this.launcherHudIntro ? "true" : lit.nothing}
@@ -10822,7 +10880,9 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(parsed))}</pre
10822
10880
  "--cpk-launcher-hud-waterfall-duration": `${LAUNCHER_HUD_INTRO_MS.waterfallDuration}ms`
10823
10881
  })}
10824
10882
  >
10825
- <span class="cpk-launcher-hud__arrow" aria-hidden="true"></span>
10883
+ ${dismissOnly ? lit.nothing : lit.html`
10884
+ <span class="cpk-launcher-hud__arrow" aria-hidden="true"></span>
10885
+ `}
10826
10886
  <div class="cpk-launcher-hud__card">
10827
10887
  ${announcementTitle ? lit.html`
10828
10888
  <div
@@ -10861,31 +10921,33 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(parsed))}</pre
10861
10921
  </div>
10862
10922
  </div>
10863
10923
  ` : lit.nothing}
10864
- <ul
10865
- class="cpk-launcher-hud__list cpk-launcher-hud__feature-list"
10866
- role="list"
10867
- style=${(0, lit_directives_style_map_js.styleMap)({ "--cpk-hud-waterfall-delay": launcherHudWaterfallDelay(featureBlockIntroIndex) })}
10868
- >
10869
- ${this.renderHudRow({
10924
+ ${threadsOn && learningOn ? lit.nothing : lit.html`
10925
+ <ul
10926
+ class="cpk-launcher-hud__list cpk-launcher-hud__feature-list"
10927
+ role="list"
10928
+ style=${(0, lit_directives_style_map_js.styleMap)({ "--cpk-hud-waterfall-delay": launcherHudWaterfallDelay(featureBlockIntroIndex) })}
10929
+ >
10930
+ ${this.renderHudRow({
10870
10931
  id: "threads",
10871
10932
  label: HUD_THREADS_LABEL,
10872
10933
  icon: "MessageSquare",
10873
10934
  connected: threadsOn,
10874
10935
  introIndex: featureBlockIntroIndex + 1
10875
10936
  })}
10876
- ${this.renderHudRow({
10937
+ ${this.renderHudRow({
10877
10938
  id: "learning",
10878
10939
  label: HUD_LEARNING_LABEL,
10879
10940
  icon: "Brain",
10880
10941
  connected: learningOn,
10881
- introIndex: featureBlockIntroIndex + 2
10942
+ introIndex: featureBlockIntroIndex + (threadsOn ? 1 : 2)
10882
10943
  })}
10883
- </ul>
10944
+ </ul>
10945
+ `}
10884
10946
  <button
10885
10947
  type="button"
10886
10948
  class="cpk-launcher-hud__dismiss-day"
10887
10949
  data-cpk-dismiss-inspector="day"
10888
- style=${(0, lit_directives_style_map_js.styleMap)({ "--cpk-hud-waterfall-delay": launcherHudWaterfallDelay(featureBlockIntroIndex + 3) })}
10950
+ style=${(0, lit_directives_style_map_js.styleMap)({ "--cpk-hud-waterfall-delay": launcherHudWaterfallDelay(dismissOnly ? 0 : featureBlockIntroIndex + Number(!threadsOn) + Number(!learningOn) + 1) })}
10889
10951
  @click=${this.handleHudDismissDayClick}
10890
10952
  @pointerdown=${(event) => event.stopPropagation()}
10891
10953
  >
@@ -14370,23 +14432,6 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(parsed))}</pre
14370
14432
  </div>
14371
14433
  `;
14372
14434
  }
14373
- getThreadsLockedCopy() {
14374
- switch (this.inspectorMetadataProjection.licenseState) {
14375
- case "valid": return {
14376
- heading: "Finish setting up Rich Threads",
14377
- description: "Copy this prompt into your coding agent to finish the setup."
14378
- };
14379
- case "none":
14380
- case "unknown": return {
14381
- heading: "Production-grade chat threads without the complexity. Self hostable.",
14382
- 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."
14383
- };
14384
- case "expired": return {
14385
- heading: "Renew Intelligence to inspect Threads.",
14386
- description: "Your Intelligence access has expired. Renew it to inspect saved thread history."
14387
- };
14388
- }
14389
- }
14390
14435
  /**
14391
14436
  * Renders the realtime-connection indicator in the memory-store header.
14392
14437
  * Only `"connected"` shows the live (green-dot) state; `"connecting"` shows a
@@ -14437,7 +14482,7 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(parsed))}</pre
14437
14482
  videoTitle: "CopilotKit Learning overview",
14438
14483
  outlineItems: LEARNING_LOCKED_FEATURE_OUTLINE,
14439
14484
  setupPrompt: {
14440
- serviceId: "threads",
14485
+ serviceId: "memory",
14441
14486
  copyState: this.learningPromptCopyState,
14442
14487
  onClick: (event) => void this.handleLearningSetupCopy(event)
14443
14488
  }
@@ -14453,7 +14498,7 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(parsed))}</pre
14453
14498
  .setupActive=${this.isLearningSetupActive()}
14454
14499
  .copyState=${this.learningPromptCopyState}
14455
14500
  .recopyState=${this.learningPromptRecopyState}
14456
- .setupPrompt=${this.getHomeFeaturePromptTarget("threads") ? homeFeatureImplementationPrompt(this.getHomeFeaturePromptTarget("threads"), { onboardingRunId: this.getOnboardingRunId() }) : ""}
14501
+ .setupPrompt=${createFeatureOnboardingPrompt("memory", this.getOnboardingRunId())}
14457
14502
  @learning-retry=${() => this.refreshLearningSnapshot({ preserve: this.learningSnapshot !== null })}
14458
14503
  @learning-copy-setup=${(event) => this.handleLearningSetupCopy(event)}
14459
14504
  @learning-recopy-setup=${(event) => this.handleLearningSetupCopy(event, true)}
@@ -14699,12 +14744,11 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(parsed))}</pre
14699
14744
  var _visibleThreads$find, _this$_core$runtimeUr2, _this$_core20, _this$_core$headers, _this$_core21, _this$_core22, _this$liveMessageVers2, _this$agentEvents$get6, _this$_core23;
14700
14745
  if (!this.areThreadEndpointsAvailable()) {
14701
14746
  this.trackThreadsViewStateOnce("locked");
14702
- const lockedCopy = this.getThreadsLockedCopy();
14703
14747
  return this.renderLockedFeatureOverview({
14704
14748
  serviceId: "threads",
14705
14749
  featureName: "Rich Threads",
14706
- heading: lockedCopy.heading,
14707
- description: lockedCopy.description,
14750
+ heading: THREADS_LOCKED_COPY.heading,
14751
+ description: THREADS_LOCKED_COPY.description,
14708
14752
  videoUrl: THREADS_LOCKED_VIDEO_URL,
14709
14753
  videoTitle: "Rich Threads overview",
14710
14754
  outlineItems: THREADS_LOCKED_FEATURE_OUTLINE
@@ -18051,6 +18095,24 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(parsed))}</pre
18051
18095
  );
18052
18096
  }
18053
18097
 
18098
+ /* With no news or setup actions, the dismissal is the whole HUD. */
18099
+ .cpk-launcher-hud[data-cpk-hud-dismiss-only] {
18100
+ --hud-dismiss-day-height: 36px;
18101
+ width: max-content;
18102
+ }
18103
+
18104
+ .cpk-launcher-hud[data-cpk-hud-dismiss-only][data-cpk-hud-vertical="top"] {
18105
+ top: calc((var(--cpk-launcher-size) - var(--hud-dismiss-day-height)) / 2);
18106
+ }
18107
+
18108
+ .cpk-launcher-hud[data-cpk-hud-dismiss-only][data-cpk-hud-vertical="bottom"] {
18109
+ bottom: calc((var(--cpk-launcher-size) - var(--hud-dismiss-day-height)) / 2);
18110
+ }
18111
+
18112
+ .cpk-launcher-hud[data-cpk-hud-dismiss-only] .cpk-launcher-hud__card {
18113
+ width: max-content;
18114
+ }
18115
+
18054
18116
  .cpk-launcher-hud__list {
18055
18117
  margin: 0;
18056
18118
  padding: 0;
@@ -18217,6 +18279,11 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(parsed))}</pre
18217
18279
  color 120ms ease;
18218
18280
  }
18219
18281
 
18282
+ .cpk-launcher-hud[data-cpk-hud-dismiss-only] .cpk-launcher-hud__dismiss-day {
18283
+ font-size: 11px;
18284
+ white-space: nowrap;
18285
+ }
18286
+
18220
18287
  .cpk-launcher-hud__dismiss-day:hover,
18221
18288
  .cpk-launcher-hud__dismiss-day:focus-visible {
18222
18289
  border-color: var(--hud-accent);