@copilotkit/web-inspector 1.75.2 → 1.77.0

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
@@ -126,8 +126,10 @@ const HUD_LEARNING_LABEL = "Automatic Learning";
126
126
  const HUD_LEARN_MORE_LABEL = "Click to learn more";
127
127
  const INSPECTOR_DISMISSAL_MS = {
128
128
  day: 1440 * 60 * 1e3,
129
- week: require_persistence.INSPECTOR_DISMISSAL_MAX_DURATION_MS
129
+ week: 10080 * 60 * 1e3,
130
+ forever: require_persistence.INSPECTOR_DISMISSAL_MAX_DURATION_MS
130
131
  };
132
+ const MAX_TIMER_DELAY_MS = 2 ** 31 - 1;
131
133
  const LAUNCHER_SIGNALS = {
132
134
  "whats-new": {
133
135
  tone: "news",
@@ -267,8 +269,18 @@ const DRAG_THRESHOLD = 6;
267
269
  const MIN_WINDOW_WIDTH = 880;
268
270
  const MIN_WINDOW_WIDTH_DOCKED_LEFT = 640;
269
271
  const MIN_WINDOW_HEIGHT = 480;
272
+ /**
273
+ * A window minimum that gives way on screens smaller than it, so the window
274
+ * (and its close control) never runs past the viewport edge.
275
+ */
276
+ const viewportCappedMin = (px, unit) => `min(${px}px, calc(100${unit} - ${EDGE_MARGIN * 2}px))`;
277
+ /**
278
+ * The floating window zooms down with the screen, never below this, once the
279
+ * viewport can no longer hold the default window at full size.
280
+ */
281
+ const MIN_WINDOW_SCALE = .8;
270
282
  const INSPECTOR_STORAGE_KEY = "cpk:inspector:state";
271
- const LAUNCHER_MIN_SIZE = 51.84;
283
+ const LAUNCHER_MIN_SIZE = 34;
272
284
  const LAUNCHER_MAX_SIZE = 62.208;
273
285
  const DEFAULT_BUTTON_SIZE = {
274
286
  width: LAUNCHER_MIN_SIZE,
@@ -1856,6 +1868,13 @@ var CpkThreadInspector = class CpkThreadInspector extends PortableLitElement {
1856
1868
  flex-direction: column;
1857
1869
  gap: 12px;
1858
1870
  }
1871
+ .cpk-td__panel--conversation {
1872
+ width: 100%;
1873
+ max-width: 800px;
1874
+ min-width: 0;
1875
+ margin-inline: auto;
1876
+ }
1877
+
1859
1878
  .cpk-td__panel > * {
1860
1879
  flex-shrink: 0;
1861
1880
  }
@@ -1974,123 +1993,148 @@ var CpkThreadInspector = class CpkThreadInspector extends PortableLitElement {
1974
1993
  border: 0;
1975
1994
  }
1976
1995
 
1977
- /* ── Tool call blocks ────────────────────────────────────────────── */
1996
+ /* Tool activity stays compact in the conversation; raw data is opt-in. */
1978
1997
  .cpk-td__tool-block {
1979
- border: 1px solid #e9e9ef;
1980
- border-radius: 12px;
1998
+ min-width: 0;
1999
+ }
2000
+ .cpk-td__tool-block:has(> .cpk-td__tool-header[aria-expanded="true"]) {
2001
+ border-radius: 10px;
1981
2002
  overflow: hidden;
2003
+ background: #ffffff;
2004
+ box-shadow: 0 0 0 1px oklch(0 0 0 / 0.08);
1982
2005
  }
1983
-
1984
2006
  .cpk-td__tool-header {
1985
2007
  display: flex;
1986
2008
  align-items: center;
1987
- gap: 6px;
1988
- padding: 12px;
1989
- background: #ffffff;
1990
- color: #71717a;
2009
+ gap: 10px;
2010
+ padding: 10px 12px;
2011
+ background: transparent;
2012
+ color: #68686e;
1991
2013
  cursor: pointer;
1992
2014
  width: 100%;
1993
2015
  border: 0;
1994
2016
  font-family: inherit;
1995
2017
  text-align: left;
1996
- font-size: 11px;
1997
- user-select: none;
2018
+ font-size: 12px;
2019
+ }
2020
+ .cpk-td__tool-header > svg {
2021
+ flex-shrink: 0;
1998
2022
  }
1999
-
2000
2023
  .cpk-td__tool-header:focus-visible {
2001
2024
  outline: 2px solid var(--cpk-primary-color, #7076b3);
2002
2025
  outline-offset: -2px;
2003
2026
  }
2004
-
2005
2027
  .cpk-td__tool-header:hover {
2006
- background: #fafafa;
2028
+ background: #f7f7f9;
2029
+ border-radius: 8px;
2030
+ }
2031
+ .cpk-td__tool-block:has(> .cpk-td__tool-header[aria-expanded="true"])
2032
+ .cpk-td__tool-header:hover {
2033
+ border-radius: 0;
2034
+ }
2035
+ .cpk-td__tool-copy {
2036
+ flex: 1;
2037
+ min-width: 0;
2038
+ }
2039
+ .cpk-td__tool-title {
2040
+ display: flex;
2041
+ flex-wrap: wrap;
2042
+ align-items: baseline;
2043
+ min-width: 0;
2007
2044
  }
2008
-
2009
2045
  .cpk-td__tool-name {
2010
2046
  font-size: 13px;
2011
2047
  font-weight: 500;
2012
- color: #18181b;
2048
+ line-height: 1.6;
2049
+ color: #57575b;
2013
2050
  overflow-wrap: anywhere;
2014
- min-width: 0;
2015
- flex: 1;
2016
2051
  }
2017
-
2018
2052
  .cpk-td__tool-status {
2019
- font-size: 10px;
2020
- font-weight: 500;
2021
- padding: 3px 7px;
2022
- border-radius: 999px;
2023
- background: #d1fae5;
2024
- color: #065f46;
2053
+ display: block;
2054
+ font-size: 11px;
2055
+ line-height: 1.6;
2056
+ color: #68686e;
2025
2057
  }
2026
-
2027
2058
  .cpk-td__tool-status--pending {
2028
- background: #fef3c7;
2029
2059
  color: #8a5900;
2030
2060
  }
2031
-
2032
2061
  .cpk-td__tool-chevron {
2033
- color: #68686e;
2034
- font-size: 10px;
2062
+ flex-shrink: 0;
2063
+ transition: transform 150ms;
2064
+ }
2065
+ .cpk-td__tool-header[aria-expanded="true"] .cpk-td__tool-chevron {
2066
+ transform: rotate(90deg);
2067
+ }
2068
+ .cpk-td__tool-name--streaming {
2069
+ width: fit-content;
2070
+ background: linear-gradient(100deg, #68686e 35%, #c9c9d5 50%, #68686e 65%);
2071
+ background-size: 250% 100%;
2072
+ background-clip: text;
2073
+ -webkit-background-clip: text;
2074
+ color: transparent;
2075
+ animation: cpk-tool-shimmer 2s linear infinite;
2076
+ }
2077
+ @keyframes cpk-tool-shimmer {
2078
+ from {
2079
+ background-position: 150% 0;
2080
+ }
2081
+ to {
2082
+ background-position: -100% 0;
2083
+ }
2084
+ }
2085
+ @media (prefers-reduced-motion: reduce) {
2086
+ .cpk-td__tool-name--streaming {
2087
+ animation: none;
2088
+ background: none;
2089
+ color: inherit;
2090
+ }
2091
+ .cpk-td__tool-chevron {
2092
+ transition: none;
2093
+ }
2035
2094
  }
2036
-
2037
2095
  .cpk-td__tool-body {
2038
- padding: 8px 10px;
2096
+ min-width: 0;
2097
+ padding-top: 4px;
2039
2098
  border-top: 1px solid #e9e9ef;
2040
- background: #ffffff;
2041
2099
  }
2042
-
2043
- .cpk-td__tool-section-label {
2044
- font-family: "Spline Sans Mono", monospace;
2045
- font-size: 9px;
2046
- font-weight: 500;
2100
+ .cpk-td__tool-identifier {
2101
+ margin-left: 0.35em;
2047
2102
  color: #68686e;
2048
- text-transform: uppercase;
2049
- margin-bottom: 4px;
2050
- letter-spacing: 0.3px;
2103
+ font:
2104
+ 11px/1.6 "Spline Sans Mono",
2105
+ monospace;
2106
+ overflow-wrap: anywhere;
2051
2107
  }
2052
-
2053
- .cpk-td__tool-pre {
2108
+ .cpk-td__tool-data {
2109
+ display: grid;
2110
+ gap: 0;
2111
+ }
2112
+ .cpk-td__tool-section-label {
2113
+ font-family: "Plus Jakarta Sans", sans-serif;
2114
+ font-size: 12px;
2115
+ font-weight: 600;
2116
+ line-height: 1.65;
2117
+ color: #68686e;
2054
2118
  margin: 0;
2055
- font-family: "Spline Sans Mono", monospace;
2119
+ padding: 8px 12px;
2120
+ }
2121
+ .cpk-td__tool-body .cpk-json-block {
2056
2122
  font-size: 12px;
2057
- background: #f7f7f9;
2058
- padding: 10px 12px;
2059
- border-radius: 6px;
2060
- overflow-x: auto;
2061
- white-space: pre-wrap;
2062
- overflow-wrap: anywhere;
2063
- word-break: normal;
2064
- color: #010507;
2065
2123
  line-height: 1.65;
2066
2124
  }
2067
-
2068
- /* ── Tool call group ─────────────────────────────────────────────── */
2125
+ .cpk-td__tool-result {
2126
+ border-top: 1px solid #e9e9ef;
2127
+ }
2069
2128
  .cpk-td__tool-group {
2070
- border: 1px solid #e9e9ef;
2071
- border-radius: 7px;
2072
- overflow: hidden;
2129
+ min-width: 0;
2073
2130
  }
2074
-
2075
2131
  .cpk-td__tool-group-header {
2076
- padding: 5px 10px;
2077
- background: rgba(133, 236, 206, 0.15);
2078
- font-family: "Spline Sans Mono", monospace;
2079
- font-size: 10px;
2080
- color: #087653;
2081
- text-transform: uppercase;
2082
- font-weight: 500;
2083
- border-bottom: 1px solid #e9e9ef;
2132
+ padding: 4px 12px;
2133
+ font-size: 11px;
2134
+ color: #68686e;
2084
2135
  }
2085
-
2086
2136
  .cpk-td__tool-group .cpk-td__tool-block {
2087
- border: none;
2088
- border-bottom: 1px solid #e9e9ef;
2089
- border-radius: 0;
2090
- }
2091
-
2092
- .cpk-td__tool-group .cpk-td__tool-block:last-child {
2093
- border-bottom: none;
2137
+ margin-left: 12px;
2094
2138
  }
2095
2139
 
2096
2140
  /* ── Inline chips (reasoning / state update) ─────────────────────── */
@@ -2376,17 +2420,24 @@ var CpkThreadInspector = class CpkThreadInspector extends PortableLitElement {
2376
2420
  }
2377
2421
 
2378
2422
  :host([data-color-scheme="dark"]) .cpk-td__tool-header {
2423
+ background: transparent;
2424
+ }
2425
+ :host([data-color-scheme="dark"])
2426
+ .cpk-td__tool-block:has(> .cpk-td__tool-header[aria-expanded="true"]) {
2379
2427
  background: #191c24;
2428
+ box-shadow: 0 0 0 1px oklch(1 0 0 / 0.12);
2429
+ }
2430
+ :host([data-color-scheme="dark"]) .cpk-td__tool-body,
2431
+ :host([data-color-scheme="dark"]) .cpk-td__tool-result {
2432
+ border-top-color: #343742;
2380
2433
  }
2381
2434
  :host([data-color-scheme="dark"]) .cpk-td__tool-name {
2382
2435
  color: #f4f4f5;
2383
2436
  }
2384
2437
  :host([data-color-scheme="dark"]) .cpk-td__tool-status {
2385
- background: #17392e;
2386
- color: #6ee7b7;
2438
+ color: #a1a1aa;
2387
2439
  }
2388
2440
  :host([data-color-scheme="dark"]) .cpk-td__tool-status--pending {
2389
- background: #3d3019;
2390
2441
  color: #fbbf24;
2391
2442
  }
2392
2443
 
@@ -2609,9 +2660,6 @@ var CpkThreadInspector = class CpkThreadInspector extends PortableLitElement {
2609
2660
  :host([data-color-scheme="dark"]) .cpk-td__metadata-strip,
2610
2661
  :host([data-color-scheme="dark"]) .cpk-td__metadata-pill,
2611
2662
  :host([data-color-scheme="dark"]) .cpk-td__try-from-here,
2612
- :host([data-color-scheme="dark"]) .cpk-td__tool-block,
2613
- :host([data-color-scheme="dark"]) .cpk-td__tool-header,
2614
- :host([data-color-scheme="dark"]) .cpk-td__tool-body,
2615
2663
  :host([data-color-scheme="dark"]) .cpk-td__event,
2616
2664
  :host([data-color-scheme="dark"]) .cpk-td__event-payload,
2617
2665
  :host([data-color-scheme="dark"]) .cpk-td__timeline-item,
@@ -2627,7 +2675,6 @@ var CpkThreadInspector = class CpkThreadInspector extends PortableLitElement {
2627
2675
 
2628
2676
  :host([data-color-scheme="dark"]) .cpk-td__metadata-pill,
2629
2677
  :host([data-color-scheme="dark"]) .cpk-td__try-from-here,
2630
- :host([data-color-scheme="dark"]) .cpk-td__tool-block,
2631
2678
  :host([data-color-scheme="dark"]) .cpk-td__event,
2632
2679
  :host([data-color-scheme="dark"]) .cpk-td__genui-card,
2633
2680
  :host([data-color-scheme="dark"]) .cpk-td__timeline-item,
@@ -2637,16 +2684,10 @@ var CpkThreadInspector = class CpkThreadInspector extends PortableLitElement {
2637
2684
  background: #191c24;
2638
2685
  }
2639
2686
 
2640
- :host([data-color-scheme="dark"]) .cpk-td__timeline-header,
2641
- :host([data-color-scheme="dark"]) .cpk-td__tool-body {
2687
+ :host([data-color-scheme="dark"]) .cpk-td__timeline-header {
2642
2688
  background: #171a22;
2643
2689
  }
2644
2690
 
2645
- :host([data-color-scheme="dark"]) .cpk-td__tool-pre {
2646
- background: #111319;
2647
- color: #f3f4f8;
2648
- }
2649
-
2650
2691
  :host([data-color-scheme="dark"]) .cpk-td__panel-toggle:hover,
2651
2692
  :host([data-color-scheme="dark"]) .cpk-td__tool-header:hover,
2652
2693
  :host([data-color-scheme="dark"]) .cpk-td__timeline-bulk-toggle:hover,
@@ -2780,7 +2821,6 @@ var CpkThreadInspector = class CpkThreadInspector extends PortableLitElement {
2780
2821
  :host([data-color-scheme="dark"]) .cpk-td__tab--active,
2781
2822
  :host([data-color-scheme="dark"]) .cpk-td__metadata-value,
2782
2823
  :host([data-color-scheme="dark"]) .cpk-td__tool-name,
2783
- :host([data-color-scheme="dark"]) .cpk-td__tool-pre,
2784
2824
  :host([data-color-scheme="dark"]) .cpk-td__timeline-title,
2785
2825
  :host([data-color-scheme="dark"]) .cpk-td__timeline-bulk-toggle,
2786
2826
  :host([data-color-scheme="dark"]) .cpk-td__timeline-details-toggle,
@@ -2789,6 +2829,28 @@ var CpkThreadInspector = class CpkThreadInspector extends PortableLitElement {
2789
2829
  color: #f3f4f8;
2790
2830
  }
2791
2831
 
2832
+ :host([data-color-scheme="dark"]) .cpk-td__tool-status,
2833
+ :host([data-color-scheme="dark"]) .cpk-td__tool-section-label,
2834
+ :host([data-color-scheme="dark"]) .cpk-td__tool-identifier,
2835
+ :host([data-color-scheme="dark"]) .cpk-td__tool-group-header {
2836
+ color: #aeb1bd;
2837
+ }
2838
+ :host([data-color-scheme="dark"]) .cpk-td__tool-name--streaming {
2839
+ color: transparent;
2840
+ background-image: linear-gradient(
2841
+ 100deg,
2842
+ #aeb1bd 35%,
2843
+ #ffffff 50%,
2844
+ #aeb1bd 65%
2845
+ );
2846
+ }
2847
+ @media (prefers-reduced-motion: reduce) {
2848
+ :host([data-color-scheme="dark"]) .cpk-td__tool-name--streaming {
2849
+ background: none;
2850
+ color: #f3f4f8;
2851
+ }
2852
+ }
2853
+
2792
2854
  :host([data-color-scheme="dark"]) .cpk-td__event-payload,
2793
2855
  :host([data-color-scheme="dark"]) .cpk-td__json-block,
2794
2856
  :host([data-color-scheme="dark"]) .cpk-json-block {
@@ -3622,7 +3684,7 @@ var CpkThreadInspector = class CpkThreadInspector extends PortableLitElement {
3622
3684
  ` : lit.nothing}
3623
3685
  ${CpkThreadInspector.TAB_LIST.map((tab) => this._activatedTabs.has(tab.id) ? lit.html`<div
3624
3686
  id=${this.panelDomId(tab.id)}
3625
- class="cpk-td__panel"
3687
+ class="cpk-td__panel ${tab.id === "timeline" && !this._showEventTimeline && this._conversation.length > 0 ? "cpk-td__panel--conversation" : ""}"
3626
3688
  role="tabpanel"
3627
3689
  aria-labelledby=${this.tabDomId(tab.id)}
3628
3690
  ?hidden=${this._tab !== tab.id || this._panelInitializing}
@@ -3896,11 +3958,13 @@ var CpkThreadInspector = class CpkThreadInspector extends PortableLitElement {
3896
3958
  `;
3897
3959
  const items = this.renderItems;
3898
3960
  const errors = this.conversationRunErrors(items);
3961
+ const streamingTools = this.streamingToolCallIds();
3899
3962
  return this.cachedPanelTpl("timeline-fallback", [
3900
3963
  this._conversation,
3901
3964
  this._expandedTools,
3902
3965
  this._expandedMessages,
3903
3966
  JSON.stringify(errors),
3967
+ JSON.stringify([...streamingTools]),
3904
3968
  this._expandedTimelineDetails
3905
3969
  ], () => {
3906
3970
  const errorsAfter = /* @__PURE__ */ new Map();
@@ -3912,10 +3976,29 @@ var CpkThreadInspector = class CpkThreadInspector extends PortableLitElement {
3912
3976
  const renderErrors = (after) => errorsAfter.get(after)?.map((item) => this.renderTimelineItem(item));
3913
3977
  return lit.html`
3914
3978
  ${renderErrors(-1)}
3915
- ${items.map((item, index) => lit.html`${this.renderRenderItem(item)}${renderErrors(index)}`)}
3979
+ ${items.map((item, index) => lit.html`${this.renderRenderItem(item, streamingTools)}${renderErrors(index)}`)}
3916
3980
  `;
3917
3981
  });
3918
3982
  }
3983
+ streamingToolCallIds() {
3984
+ const streaming = /* @__PURE__ */ new Set();
3985
+ let currentThread = false;
3986
+ for (let i = this.agentEventsInput.length - 1; i >= 0; i--) {
3987
+ const event = this.agentEventsInput[i];
3988
+ const payload = event.payload.event && typeof event.payload.event === "object" ? event.payload.event : event.payload;
3989
+ if (event.type === "RUN_STARTED") {
3990
+ streaming.clear();
3991
+ currentThread = payload.threadId === this.threadId;
3992
+ } else if (event.type === "RUN_FINISHED" || event.type === "RUN_ERROR") {
3993
+ streaming.clear();
3994
+ currentThread = false;
3995
+ } else if (currentThread && typeof payload.toolCallId === "string") {
3996
+ if (event.type === "TOOL_CALL_START") streaming.add(payload.toolCallId);
3997
+ if (event.type === "TOOL_CALL_END" || event.type === "TOOL_CALL_RESULT") streaming.delete(payload.toolCallId);
3998
+ }
3999
+ }
4000
+ return streaming;
4001
+ }
3919
4002
  conversationRunErrors(items) {
3920
4003
  const positions = /* @__PURE__ */ new Map();
3921
4004
  items.forEach((item, index) => {
@@ -3973,12 +4056,12 @@ var CpkThreadInspector = class CpkThreadInspector extends PortableLitElement {
3973
4056
  if (cached && cached.key.length === key.length && cached.key.every((v, i) => v === key[i])) return cached.tpl;
3974
4057
  return null;
3975
4058
  }
3976
- renderRenderItem(item) {
4059
+ renderRenderItem(item, streamingTools) {
3977
4060
  switch (item.type) {
3978
4061
  case "user":
3979
4062
  case "assistant": return this.renderBubble(item);
3980
- case "tool_call": return this.renderToolBlock(item);
3981
- case "tool_call_group": return this.renderToolGroup(item);
4063
+ case "tool_call": return this.renderToolBlock(item, streamingTools.has(item.toolCallId));
4064
+ case "tool_call_group": return this.renderToolGroup(item, streamingTools);
3982
4065
  case "reasoning": return lit.html`<div class="cpk-td__inline-chip">
3983
4066
  <span>Reasoned for ${item.duration}</span>
3984
4067
  </div>`;
@@ -4017,7 +4100,10 @@ var CpkThreadInspector = class CpkThreadInspector extends PortableLitElement {
4017
4100
  </div>
4018
4101
  `;
4019
4102
  }
4020
- renderToolBlock(item) {
4103
+ renderToolBlock(item, streaming = false) {
4104
+ streaming = streaming && !item.hasResult;
4105
+ const label = item.toolName.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ");
4106
+ const readableName = label.charAt(0).toUpperCase() + label.slice(1);
4021
4107
  const expanded = this._expandedTools.has(item.id);
4022
4108
  return lit.html`
4023
4109
  <div class="cpk-td__tool-block">
@@ -4036,45 +4122,41 @@ var CpkThreadInspector = class CpkThreadInspector extends PortableLitElement {
4036
4122
  stroke-linejoin="round"
4037
4123
  />
4038
4124
  </svg>
4039
- <span class="cpk-td__tool-name">${item.toolName}</span>
4040
- ${item.resultUnreadable ? lit.html`
4041
- <span class="cpk-td__tool-status cpk-td__tool-status--pending"
4042
- >Result unreadable</span
4043
- >
4044
- ` : item.hasResult ? lit.html`
4045
- <span class="cpk-td__tool-status">Result received</span>
4046
- ` : lit.html`
4047
- <span class="cpk-td__tool-status cpk-td__tool-status--pending"
4048
- >No result recorded</span
4049
- >
4050
- `}
4051
- <span class="cpk-td__tool-chevron">${expanded ? "▾" : "▸"}</span>
4125
+ <span class="cpk-td__tool-copy">
4126
+ <span class="cpk-td__tool-title">
4127
+ <span class="cpk-td__tool-name ${streaming ? "cpk-td__tool-name--streaming" : ""}">${readableName}</span><code class="cpk-td__tool-identifier">(${item.toolName})</code>
4128
+ </span>
4129
+ <span class="cpk-td__tool-status ${item.resultUnreadable || !item.hasResult && !streaming ? "cpk-td__tool-status--pending" : ""}">${streaming ? "Receiving arguments" : item.resultUnreadable ? "Result unreadable" : item.hasResult ? "Result received" : "No result recorded"}</span>
4130
+ </span>
4131
+ <svg class="cpk-td__tool-chevron" width="14" height="14" viewBox="0 0 24 24" fill="none" aria-hidden="true">
4132
+ <path d="m9 6 6 6-6 6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
4133
+ </svg>
4052
4134
  </button>
4053
4135
  ${expanded ? lit.html`
4054
4136
  <div class="cpk-td__tool-body">
4055
- <div class="cpk-td__tool-section-label">Arguments</div>
4056
- ${renderHighlightedJsonBlock(item.arguments)}
4057
- ${item.hasResult ? lit.html`
4058
- <div
4059
- class="cpk-td__tool-section-label"
4060
- style="margin-top:8px"
4061
- >
4062
- Result
4063
- </div>
4137
+ <div class="cpk-td__tool-data">
4138
+ <section>
4139
+ <div class="cpk-td__tool-section-label">Arguments</div>
4140
+ ${renderHighlightedJsonBlock(item.arguments)}
4141
+ </section>
4142
+ ${item.hasResult ? lit.html`
4143
+ <section class="cpk-td__tool-result">
4144
+ <div class="cpk-td__tool-section-label">Result</div>
4064
4145
  ${renderHighlightedJsonBlock(item.result)}
4065
- ` : lit.nothing}
4146
+ </section>` : lit.nothing}
4147
+ </div>
4066
4148
  </div>
4067
4149
  ` : lit.nothing}
4068
4150
  </div>
4069
4151
  `;
4070
4152
  }
4071
- renderToolGroup(group) {
4153
+ renderToolGroup(group, streamingTools) {
4072
4154
  return lit.html`
4073
4155
  <div class="cpk-td__tool-group">
4074
4156
  <div class="cpk-td__tool-group-header">
4075
4157
  ${group.items.length} tool call${group.items.length !== 1 ? "s" : ""}
4076
4158
  </div>
4077
- ${group.items.map((tc) => this.renderToolBlock(tc))}
4159
+ ${group.items.map((tc) => this.renderToolBlock(tc, streamingTools.has(tc.toolCallId)))}
4078
4160
  </div>
4079
4161
  `;
4080
4162
  }
@@ -5369,9 +5451,13 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
5369
5451
  const service = this.getHomeFeaturePromptTarget("memory");
5370
5452
  if (!service || !this.core?.runtimeUrl) return;
5371
5453
  const request = ++this.learningSetupCopyRequest;
5372
- const copied = await this.copyFeaturePromptToClipboard(service, event, this.getOnboardingRunId());
5454
+ const runId = this.getOnboardingRunId();
5455
+ const copied = await this.copyFeaturePromptToClipboard(service, event, runId);
5373
5456
  if (request !== this.learningSetupCopyRequest) return;
5374
- if (!this.core.telemetryDisabled) require_telemetry.trackLearningSetupPromptClicked({ outcome: copied ? "success" : "failure" });
5457
+ if (!this.core.telemetryDisabled) require_telemetry.trackLearningSetupPromptClicked({
5458
+ outcome: copied ? "success" : "failure",
5459
+ onboarding_run_id: runId
5460
+ });
5375
5461
  if (!copied) {
5376
5462
  if (recopy) {
5377
5463
  this.cancelLearningPromptRecopyReset();
@@ -5547,7 +5633,7 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
5547
5633
  const sidebarBounds = sidebar.getBoundingClientRect();
5548
5634
  this.sidebarRailTooltip = {
5549
5635
  label,
5550
- top: targetBounds.top - sidebarBounds.top + targetBounds.height / 2
5636
+ top: (targetBounds.top - sidebarBounds.top + targetBounds.height / 2) / this.getWindowScale()
5551
5637
  };
5552
5638
  this.requestUpdate();
5553
5639
  };
@@ -7699,7 +7785,7 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
7699
7785
  is the button's sibling, can clear the mark by the same length. */
7700
7786
  --cpk-launcher-size: clamp(
7701
7787
  ${LAUNCHER_MIN_SIZE}px,
7702
- 7vw,
7788
+ calc(22px + 2.8vw),
7703
7789
  ${LAUNCHER_MAX_SIZE}px
7704
7790
  );
7705
7791
  }
@@ -9803,7 +9889,7 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
9803
9889
  scheduleInspectorDismissalExpiry() {
9804
9890
  this.clearInspectorDismissalTimer();
9805
9891
  if (this.inspectorDismissedUntil === null) return;
9806
- const delay = Math.max(0, this.inspectorDismissedUntil - Date.now() + 25);
9892
+ const delay = Math.min(MAX_TIMER_DELAY_MS, Math.max(0, this.inspectorDismissedUntil - Date.now() + 25));
9807
9893
  this.inspectorDismissalTimer = setTimeout(() => {
9808
9894
  this.inspectorDismissalTimer = null;
9809
9895
  this.refreshInspectorDismissalState();
@@ -9836,7 +9922,8 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
9836
9922
  dismissInspectorFor(duration) {
9837
9923
  const now = Date.now();
9838
9924
  const until = now + INSPECTOR_DISMISSAL_MS[duration];
9839
- require_persistence.saveInspectorDismissedUntil(until, now);
9925
+ if (duration === "forever") require_persistence.saveInspectorDismissedForever(now);
9926
+ else require_persistence.saveInspectorDismissedUntil(until, now);
9840
9927
  this.inspectorDismissedUntil = until;
9841
9928
  this.scheduleInspectorDismissalExpiry();
9842
9929
  this.settingsOpen = false;
@@ -11362,6 +11449,7 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
11362
11449
  const isPoppedOut = this.isPoppedOut;
11363
11450
  const isTransitioning = this.hasAttribute("data-transitioning");
11364
11451
  const disableDrag = isDocked || isPoppedOut;
11452
+ const scale = this.getWindowScale();
11365
11453
  const windowStyles = isPoppedOut ? {
11366
11454
  position: "fixed",
11367
11455
  inset: "0",
@@ -11375,17 +11463,18 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
11375
11463
  ...this.getDockedWindowStyles(),
11376
11464
  overflowX: "hidden"
11377
11465
  } : {
11378
- width: `${Math.round(windowState.size.width)}px`,
11379
- height: `${Math.round(windowState.size.height)}px`,
11380
- minWidth: `${MIN_WINDOW_WIDTH}px`,
11381
- minHeight: `${MIN_WINDOW_HEIGHT}px`,
11382
- overflowX: "hidden"
11466
+ width: `${Math.round(windowState.size.width / scale)}px`,
11467
+ height: `${Math.round(windowState.size.height / scale)}px`,
11468
+ minWidth: viewportCappedMin(MIN_WINDOW_WIDTH, "vw"),
11469
+ minHeight: viewportCappedMin(MIN_WINDOW_HEIGHT, "vh"),
11470
+ overflowX: "hidden",
11471
+ ...scale < 1 ? { zoom: String(scale) } : {}
11383
11472
  };
11384
11473
  const hasContextDropdown = this.contextOptions.some((option) => option.key !== "all-agents");
11385
11474
  const viewportWidth = isPoppedOut ? this.popOut?.win.innerWidth ?? windowState.size.width : typeof window === "undefined" ? windowState.size.width : window.innerWidth;
11386
11475
  const automaticallyCollapsed = require_inspector_nav.shouldUseIconRail({
11387
11476
  dockedLeft: this.dockMode === "docked-left",
11388
- width: viewportWidth
11477
+ width: viewportWidth / scale
11389
11478
  });
11390
11479
  const iconRail = this.sidebarCollapsed || automaticallyCollapsed;
11391
11480
  const contextDropdown = hasContextDropdown ? this.renderContextDropdown(iconRail) : lit.nothing;
@@ -11715,8 +11804,9 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
11715
11804
  getRenderedInspectorWindowSize() {
11716
11805
  const inspectorWindow = this.shadowRoot?.querySelector(".inspector-window");
11717
11806
  if (inspectorWindow) {
11718
- const width = Math.round(Number.parseFloat(inspectorWindow.style.width));
11719
- const height = Math.round(Number.parseFloat(inspectorWindow.style.height));
11807
+ const scale = this.getWindowScale();
11808
+ const width = Math.round(Number.parseFloat(inspectorWindow.style.width) * scale);
11809
+ const height = Math.round(Number.parseFloat(inspectorWindow.style.height) * scale);
11720
11810
  if (Number.isFinite(width) && Number.isFinite(height)) return {
11721
11811
  width,
11722
11812
  height
@@ -11801,6 +11891,16 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
11801
11891
  height: window.innerHeight
11802
11892
  };
11803
11893
  }
11894
+ /**
11895
+ * Zoom for the floating window: 1 while the viewport holds the default
11896
+ * window, then proportional to the screen down to MIN_WINDOW_SCALE, so a
11897
+ * small screen gets the same layout smaller rather than a cramped one.
11898
+ */
11899
+ getWindowScale() {
11900
+ if (typeof window === "undefined" || this.isPoppedOut || this.dockMode !== "floating") return 1;
11901
+ const fit = Math.min(window.innerWidth / (DEFAULT_WINDOW_SIZE.width + EDGE_MARGIN * 2), window.innerHeight / (DEFAULT_WINDOW_SIZE.height + EDGE_MARGIN * 2));
11902
+ return Math.min(1, Math.max(MIN_WINDOW_SCALE, Math.round(fit * 20) / 20));
11903
+ }
11804
11904
  persistState() {
11805
11905
  const state = {
11806
11906
  button: {
@@ -12106,14 +12206,14 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
12106
12206
  bottom: "0",
12107
12207
  width: `${Math.round(this.contextState.window.size.width)}px`,
12108
12208
  height: "auto",
12109
- minWidth: `${MIN_WINDOW_WIDTH_DOCKED_LEFT}px`,
12209
+ minWidth: viewportCappedMin(MIN_WINDOW_WIDTH_DOCKED_LEFT, "vw"),
12110
12210
  borderRadius: "0"
12111
12211
  };
12112
12212
  return {
12113
12213
  width: `${Math.round(this.contextState.window.size.width)}px`,
12114
12214
  height: `${Math.round(this.contextState.window.size.height)}px`,
12115
- minWidth: `${MIN_WINDOW_WIDTH}px`,
12116
- minHeight: `${MIN_WINDOW_HEIGHT}px`
12215
+ minWidth: viewportCappedMin(MIN_WINDOW_WIDTH, "vw"),
12216
+ minHeight: viewportCappedMin(MIN_WINDOW_HEIGHT, "vh")
12117
12217
  };
12118
12218
  }
12119
12219
  handleDockClick(mode) {
@@ -12870,7 +12970,7 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
12870
12970
  </span>
12871
12971
  <div>
12872
12972
  <h2 id="inspector-settings-visibility-title">Visibility</h2>
12873
- <p>Temporarily hide the Inspector on this domain.</p>
12973
+ <p>Hide the Inspector on this domain.</p>
12874
12974
  </div>
12875
12975
  </div>
12876
12976
 
@@ -12892,6 +12992,27 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
12892
12992
  Hide Inspector for one week
12893
12993
  </button>
12894
12994
  </div>
12995
+
12996
+ <div class="inspector-settings-visibility">
12997
+ <div>
12998
+ <h3>Hide the Inspector indefinitely</h3>
12999
+ <p>
13000
+ Keep the Inspector hidden on this domain until you bring it
13001
+ back. To restore it, delete the
13002
+ <code>cpk_inspector_dismissed_until</code> cookie and the
13003
+ <code>cpk:inspector:dismissed_until</code> localStorage entry.
13004
+ </p>
13005
+ </div>
13006
+ <button
13007
+ type="button"
13008
+ class="inspector-settings-dismiss"
13009
+ data-cpk-dismiss-inspector="forever"
13010
+ @click=${() => this.dismissInspectorFor("forever")}
13011
+ >
13012
+ <span aria-hidden="true">${this.renderIcon("EyeOff")}</span>
13013
+ Always hide Inspector
13014
+ </button>
13015
+ </div>
12895
13016
  </section>
12896
13017
  </div>
12897
13018
  `;
@@ -13949,7 +14070,7 @@ var WebInspectorElement = class WebInspectorElement extends lit.LitElement {
13949
14070
  <div style="display:flex;min-height:0;flex:1;overflow:hidden;">
13950
14071
  <!-- Left sidebar: thread list -->
13951
14072
  <div
13952
- style="display:${this.threadListCollapsed ? "none" : "flex"};width:${this.threadListWidth}px;flex-shrink:0;overflow:hidden;flex-direction:column;border-right:1px solid #DBDBE5;"
14073
+ style="display:${this.threadListCollapsed ? "none" : "flex"};width:${this.threadListWidth}px;max-width:calc(100% - 160px);flex-shrink:0;overflow:hidden;flex-direction:column;border-right:1px solid #DBDBE5;"
13953
14074
  >
13954
14075
  ${ephemeral ? lit.html`
13955
14076
  <button type="button" class="cpk-ephemeral-threads-banner"