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