@copilotkit/web-inspector 1.66.2 → 1.67.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.
Files changed (56) hide show
  1. package/README.md +92 -13
  2. package/dist/index.cjs +1444 -429
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.d.cts +118 -8
  5. package/dist/index.d.cts.map +1 -1
  6. package/dist/index.d.mts +118 -8
  7. package/dist/index.d.mts.map +1 -1
  8. package/dist/index.mjs +1446 -431
  9. package/dist/index.mjs.map +1 -1
  10. package/dist/index.umd.js +1729 -533
  11. package/dist/index.umd.js.map +1 -1
  12. package/dist/lib/inspector-metadata.cjs +60 -0
  13. package/dist/lib/inspector-metadata.cjs.map +1 -0
  14. package/dist/lib/inspector-metadata.mjs +60 -0
  15. package/dist/lib/inspector-metadata.mjs.map +1 -0
  16. package/dist/lib/telemetry.cjs +117 -32
  17. package/dist/lib/telemetry.cjs.map +1 -1
  18. package/dist/lib/telemetry.mjs +116 -33
  19. package/dist/lib/telemetry.mjs.map +1 -1
  20. package/dist/lib/thread-selection.cjs +36 -0
  21. package/dist/lib/thread-selection.cjs.map +1 -0
  22. package/dist/lib/thread-selection.mjs +35 -0
  23. package/dist/lib/thread-selection.mjs.map +1 -0
  24. package/dist/package.cjs +1 -1
  25. package/dist/package.mjs +1 -1
  26. package/dist/styles/generated.cjs +1 -1
  27. package/dist/styles/generated.cjs.map +1 -1
  28. package/dist/styles/generated.mjs +1 -1
  29. package/dist/styles/generated.mjs.map +1 -1
  30. package/package.json +9 -4
  31. package/CHANGELOG.md +0 -505
  32. package/dev/css-raw-import.spec.ts +0 -31
  33. package/dev/index.html +0 -115
  34. package/dev/main.ts +0 -165
  35. package/dev/vite.config.ts +0 -30
  36. package/src/__tests__/memory-recall.spec.ts +0 -76
  37. package/src/__tests__/telemetry-egress-guard.spec.ts +0 -41
  38. package/src/__tests__/web-inspector.spec.ts +0 -3911
  39. package/src/assets/inspector-logo-icon.svg +0 -8
  40. package/src/assets/inspector-logo.svg +0 -40
  41. package/src/components.d.ts +0 -20
  42. package/src/index.ts +0 -11839
  43. package/src/lib/__tests__/telemetry.test.ts +0 -557
  44. package/src/lib/context-helpers.ts +0 -166
  45. package/src/lib/persistence.ts +0 -206
  46. package/src/lib/telemetry.ts +0 -474
  47. package/src/lib/testing/telemetry-egress-guard.ts +0 -33
  48. package/src/lib/types.ts +0 -19
  49. package/src/styles/generated.css +0 -2
  50. package/src/styles/tailwind.css +0 -23
  51. package/src/types/css.d.ts +0 -4
  52. package/src/types/svg.d.ts +0 -4
  53. package/tsconfig.json +0 -14
  54. package/tsdown.config.ts +0 -45
  55. package/vitest.config.ts +0 -66
  56. package/vitest.setup.ts +0 -84
package/dist/index.umd.js CHANGED
@@ -1,12 +1,12 @@
1
1
  (function(global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('lit'), require('marked'), require('lit/directives/style-map.js'), require('lit/directives/unsafe-html.js'), require('lucide'), require('@copilotkit/core')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'lit', 'marked', 'lit/directives/style-map.js', 'lit/directives/unsafe-html.js', 'lucide', '@copilotkit/core'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.CopilotKitWebInspector = {}), global.Lit,global.marked,global.LitDirectivesStyleMap,global.LitDirectivesUnsafeHtml,global.lucide,global.CopilotKitCore));
5
- })(this, function(exports, lit, marked, lit_directives_style_map_js, lit_directives_unsafe_html_js, lucide, _copilotkit_core) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('lit'), require('marked'), require('lit/directives/style-map.js'), require('lit/directives/unsafe-html.js'), require('lucide'), require('@copilotkit/core'), require('@copilotkit/shared')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'lit', 'marked', 'lit/directives/style-map.js', 'lit/directives/unsafe-html.js', 'lucide', '@copilotkit/core', '@copilotkit/shared'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.CopilotKitWebInspector = {}), global.Lit,global.marked,global.LitDirectivesStyleMap,global.LitDirectivesUnsafeHtml,global.lucide,global.CopilotKitCore,global.CopilotKitShared));
5
+ })(this, function(exports, lit, marked, lit_directives_style_map_js, lit_directives_unsafe_html_js, lucide, _copilotkit_core, _copilotkit_shared) {
6
6
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
7
7
 
8
8
  //#region src/styles/generated.css
9
- var generated_default = "/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */\n@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace;--color-amber-50:oklch(98.7% .022 95.277);--color-amber-100:oklch(96.2% .059 95.617);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-600:oklch(66.6% .179 58.318);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-800:oklch(47.3% .137 46.201);--color-amber-900:oklch(41.4% .112 45.904);--color-green-100:oklch(96.2% .044 156.743);--color-green-700:oklch(52.7% .154 150.069);--color-green-800:oklch(44.8% .119 151.328);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-700:oklch(50.8% .118 165.612);--color-sky-50:oklch(97.7% .013 236.62);--color-sky-200:oklch(90.1% .058 230.902);--color-sky-700:oklch(50% .134 242.749);--color-blue-50:oklch(97% .014 254.604);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-200:oklch(88.2% .059 254.128);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--color-violet-50:oklch(96.9% .016 293.756);--color-violet-200:oklch(89.4% .057 293.283);--color-violet-700:oklch(49.1% .27 292.581);--color-purple-50:oklch(97.7% .014 308.299);--color-purple-200:oklch(90.2% .063 306.703);--color-purple-700:oklch(49.6% .265 301.924);--color-fuchsia-50:oklch(97.7% .017 320.058);--color-fuchsia-200:oklch(90.3% .076 319.62);--color-fuchsia-700:oklch(51.8% .253 323.949);--color-rose-50:oklch(96.9% .015 12.422);--color-rose-200:oklch(89.2% .058 10.001);--color-rose-500:oklch(64.5% .246 16.439);--color-rose-700:oklch(51.4% .222 16.935);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-500:oklch(55.4% .046 257.417);--color-slate-700:oklch(37.2% .044 257.287);--color-slate-800:oklch(27.9% .041 260.031);--color-slate-900:oklch(20.8% .042 265.755);--color-slate-950:oklch(12.9% .042 264.695);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-md:28rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--font-weight-medium:500;--font-weight-semibold:600;--leading-snug:1.375;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--blur-sm:8px;--blur-md:12px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}:host{font-family:var(--font-sans);color:var(--color-slate-900);background-color:#0000;display:block}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.top-0{top:calc(var(--spacing)*0)}.right-0{right:calc(var(--spacing)*0)}.right-1{right:calc(var(--spacing)*1)}.bottom-1{bottom:calc(var(--spacing)*1)}.left-0{left:calc(var(--spacing)*0)}.z-10{z-index:10}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.m-0{margin:calc(var(--spacing)*0)}.mx-4{margin-inline:calc(var(--spacing)*4)}.my-1{margin-block:calc(var(--spacing)*1)}.my-3{margin-block:calc(var(--spacing)*3)}.mt-0\\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-1\\.5{margin-top:calc(var(--spacing)*1.5)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-6{margin-top:calc(var(--spacing)*6)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.ml-auto{margin-left:auto}.box-border{box-sizing:border-box}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-1\\.5{height:calc(var(--spacing)*1.5)}.h-3{height:calc(var(--spacing)*3)}.h-3\\.5{height:calc(var(--spacing)*3.5)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-6{height:calc(var(--spacing)*6)}.h-8{height:calc(var(--spacing)*8)}.h-10{height:calc(var(--spacing)*10)}.h-12{height:calc(var(--spacing)*12)}.h-full{height:100%}.max-h-64{max-height:calc(var(--spacing)*64)}.w-1\\.5{width:calc(var(--spacing)*1.5)}.w-3{width:calc(var(--spacing)*3)}.w-3\\.5{width:calc(var(--spacing)*3.5)}.w-4{width:calc(var(--spacing)*4)}.w-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-8{width:calc(var(--spacing)*8)}.w-9{width:calc(var(--spacing)*9)}.w-10{width:calc(var(--spacing)*10)}.w-12{width:calc(var(--spacing)*12)}.w-40{width:calc(var(--spacing)*40)}.w-auto{width:auto}.w-full{width:100%}.max-w-\\[240px\\]{max-width:240px}.max-w-md{max-width:var(--container-md)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\\[160px\\]{min-width:160px}.min-w-\\[200px\\]{min-width:200px}.flex-1{flex:1}.flex-shrink,.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.table-fixed{table-layout:fixed}.border-collapse{border-collapse:collapse}.translate-x-0\\.5{--tw-translate-x:calc(var(--spacing)*.5);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-4{--tw-translate-x:calc(var(--spacing)*4);translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-\\[2px\\]{--tw-translate-y:calc(2px*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.cursor-grab{cursor:grab}.cursor-grabbing{cursor:grabbing}.cursor-nwse-resize{cursor:nwse-resize}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.resize{resize:both}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-gray-200>:not(:last-child)){border-color:var(--color-gray-200)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-amber-200{border-color:var(--color-amber-200)}.border-blue-200{border-color:var(--color-blue-200)}.border-emerald-200{border-color:var(--color-emerald-200)}.border-fuchsia-200{border-color:var(--color-fuchsia-200)}.border-gray-100{border-color:var(--color-gray-100)}.border-gray-200{border-color:var(--color-gray-200)}.border-purple-200{border-color:var(--color-purple-200)}.border-rose-200{border-color:var(--color-rose-200)}.border-sky-200{border-color:var(--color-sky-200)}.border-slate-200{border-color:var(--color-slate-200)}.border-violet-200{border-color:var(--color-violet-200)}.border-white\\/20{border-color:#fff3}@supports (color:color-mix(in lab, red, red)){.border-white\\/20{border-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.bg-amber-50{background-color:var(--color-amber-50)}.bg-amber-100{background-color:var(--color-amber-100)}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-100{background-color:var(--color-blue-100)}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-fuchsia-50{background-color:var(--color-fuchsia-50)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-50\\/50{background-color:#f9fafb80}@supports (color:color-mix(in lab, red, red)){.bg-gray-50\\/50{background-color:color-mix(in oklab,var(--color-gray-50)50%,transparent)}}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-300{background-color:var(--color-gray-300)}.bg-gray-400{background-color:var(--color-gray-400)}.bg-gray-800{background-color:var(--color-gray-800)}.bg-gray-900{background-color:var(--color-gray-900)}.bg-green-100{background-color:var(--color-green-100)}.bg-purple-50{background-color:var(--color-purple-50)}.bg-rose-50{background-color:var(--color-rose-50)}.bg-rose-500{background-color:var(--color-rose-500)}.bg-sky-50{background-color:var(--color-sky-50)}.bg-slate-900{background-color:var(--color-slate-900)}.bg-slate-950\\/95{background-color:#020618f2}@supports (color:color-mix(in lab, red, red)){.bg-slate-950\\/95{background-color:color-mix(in oklab,var(--color-slate-950)95%,transparent)}}.bg-violet-50{background-color:var(--color-violet-50)}.bg-white{background-color:var(--color-white)}.bg-white\\/60{background-color:#fff9}@supports (color:color-mix(in lab, red, red)){.bg-white\\/60{background-color:color-mix(in oklab,var(--color-white)60%,transparent)}}.bg-white\\/95{background-color:#fffffff2}@supports (color:color-mix(in lab, red, red)){.bg-white\\/95{background-color:color-mix(in oklab,var(--color-white)95%,transparent)}}.p-2{padding:calc(var(--spacing)*2)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.px-1{padding-inline:calc(var(--spacing)*1)}.px-1\\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.py-0\\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-8{padding-block:calc(var(--spacing)*8)}.py-10{padding-block:calc(var(--spacing)*10)}.text-center{text-align:center}.text-left{text-align:left}.align-middle{vertical-align:middle}.font-mono{font-family:var(--font-mono)}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[9px\\]{font-size:9px}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.break-words{overflow-wrap:break-word}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.text-amber-600{color:var(--color-amber-600)}.text-amber-700{color:var(--color-amber-700)}.text-amber-800{color:var(--color-amber-800)}.text-amber-900{color:var(--color-amber-900)}.text-blue-600{color:var(--color-blue-600)}.text-blue-700{color:var(--color-blue-700)}.text-blue-800{color:var(--color-blue-800)}.text-emerald-700{color:var(--color-emerald-700)}.text-fuchsia-700{color:var(--color-fuchsia-700)}.text-gray-300{color:var(--color-gray-300)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-gray-900{color:var(--color-gray-900)}.text-green-700{color:var(--color-green-700)}.text-green-800{color:var(--color-green-800)}.text-purple-700{color:var(--color-purple-700)}.text-rose-700{color:var(--color-rose-700)}.text-sky-700{color:var(--color-sky-700)}.text-slate-500{color:var(--color-slate-500)}.text-slate-700{color:var(--color-slate-700)}.text-slate-800{color:var(--color-slate-800)}.text-slate-900{color:var(--color-slate-900)}.text-violet-700{color:var(--color-violet-700)}.text-white{color:var(--color-white)}.italic{font-style:italic}.underline{text-decoration-line:underline}.opacity-0{opacity:0}.opacity-80{opacity:.8}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-black\\/5{--tw-ring-color:#0000000d}@supports (color:color-mix(in lab, red, red)){.ring-black\\/5{--tw-ring-color:color-mix(in oklab,var(--color-black)5%,transparent)}}.ring-transparent{--tw-ring-color:transparent}.ring-white\\/10{--tw-ring-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.ring-white\\/10{--tw-ring-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media (hover:hover){.group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}.hover\\:scale-105:hover{--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%;scale:var(--tw-scale-x)var(--tw-scale-y)}.hover\\:border-gray-300:hover{border-color:var(--color-gray-300)}.hover\\:border-white\\/30:hover{border-color:#ffffff4d}@supports (color:color-mix(in lab, red, red)){.hover\\:border-white\\/30:hover{border-color:color-mix(in oklab,var(--color-white)30%,transparent)}}.hover\\:bg-blue-50\\/50:hover{background-color:#eff6ff80}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-blue-50\\/50:hover{background-color:color-mix(in oklab,var(--color-blue-50)50%,transparent)}}.hover\\:bg-gray-50:hover{background-color:var(--color-gray-50)}.hover\\:bg-gray-100:hover{background-color:var(--color-gray-100)}.hover\\:bg-gray-200:hover{background-color:var(--color-gray-200)}.hover\\:bg-gray-800:hover{background-color:var(--color-gray-800)}.hover\\:bg-slate-900\\/95:hover{background-color:#0f172bf2}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-slate-900\\/95:hover{background-color:color-mix(in oklab,var(--color-slate-900)95%,transparent)}}.hover\\:text-gray-600:hover{color:var(--color-gray-600)}.hover\\:text-gray-900:hover{color:var(--color-gray-900)}.hover\\:text-slate-900:hover{color:var(--color-slate-900)}}.focus\\:border-gray-300:focus{border-color:var(--color-gray-300)}.focus\\:bg-gray-50:focus{background-color:var(--color-gray-50)}.focus\\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\\:ring-gray-200:focus{--tw-ring-color:var(--color-gray-200)}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\\:outline:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}.focus-visible\\:outline-2:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.focus-visible\\:outline-offset-2:focus-visible{outline-offset:2px}.focus-visible\\:outline-\\[\\#BEC2FF\\]:focus-visible{outline-color:#bec2ff}.focus-visible\\:outline-gray-300:focus-visible{outline-color:var(--color-gray-300)}.focus-visible\\:outline-gray-400:focus-visible{outline-color:var(--color-gray-400)}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}@media (min-width:48rem){.md\\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}.\\[\\&\\>svg\\]\\:\\!h-8>svg{height:calc(var(--spacing)*8)!important}.\\[\\&\\>svg\\]\\:\\!w-8>svg{width:calc(var(--spacing)*8)!important}.sr-only{clip:rect(0,0,0,0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}}@property --tw-translate-x{syntax:\"*\";inherits:false;initial-value:0}@property --tw-translate-y{syntax:\"*\";inherits:false;initial-value:0}@property --tw-translate-z{syntax:\"*\";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:\"*\";inherits:false}@property --tw-rotate-y{syntax:\"*\";inherits:false}@property --tw-rotate-z{syntax:\"*\";inherits:false}@property --tw-skew-x{syntax:\"*\";inherits:false}@property --tw-skew-y{syntax:\"*\";inherits:false}@property --tw-space-y-reverse{syntax:\"*\";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:\"*\";inherits:false;initial-value:0}@property --tw-border-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-leading{syntax:\"*\";inherits:false}@property --tw-font-weight{syntax:\"*\";inherits:false}@property --tw-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:\"*\";inherits:false}@property --tw-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:\"*\";inherits:false}@property --tw-inset-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:\"*\";inherits:false}@property --tw-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:\"*\";inherits:false}@property --tw-inset-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:\"*\";inherits:false}@property --tw-ring-offset-width{syntax:\"<length>\";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:\"*\";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-blur{syntax:\"*\";inherits:false}@property --tw-brightness{syntax:\"*\";inherits:false}@property --tw-contrast{syntax:\"*\";inherits:false}@property --tw-grayscale{syntax:\"*\";inherits:false}@property --tw-hue-rotate{syntax:\"*\";inherits:false}@property --tw-invert{syntax:\"*\";inherits:false}@property --tw-opacity{syntax:\"*\";inherits:false}@property --tw-saturate{syntax:\"*\";inherits:false}@property --tw-sepia{syntax:\"*\";inherits:false}@property --tw-drop-shadow{syntax:\"*\";inherits:false}@property --tw-drop-shadow-color{syntax:\"*\";inherits:false}@property --tw-drop-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:\"*\";inherits:false}@property --tw-backdrop-blur{syntax:\"*\";inherits:false}@property --tw-backdrop-brightness{syntax:\"*\";inherits:false}@property --tw-backdrop-contrast{syntax:\"*\";inherits:false}@property --tw-backdrop-grayscale{syntax:\"*\";inherits:false}@property --tw-backdrop-hue-rotate{syntax:\"*\";inherits:false}@property --tw-backdrop-invert{syntax:\"*\";inherits:false}@property --tw-backdrop-opacity{syntax:\"*\";inherits:false}@property --tw-backdrop-saturate{syntax:\"*\";inherits:false}@property --tw-backdrop-sepia{syntax:\"*\";inherits:false}@property --tw-scale-x{syntax:\"*\";inherits:false;initial-value:1}@property --tw-scale-y{syntax:\"*\";inherits:false;initial-value:1}@property --tw-scale-z{syntax:\"*\";inherits:false;initial-value:1}@keyframes pulse{50%{opacity:.5}}";
9
+ var generated_default = "/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */\n@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace;--color-amber-50:oklch(98.7% .022 95.277);--color-amber-100:oklch(96.2% .059 95.617);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-600:oklch(66.6% .179 58.318);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-800:oklch(47.3% .137 46.201);--color-amber-900:oklch(41.4% .112 45.904);--color-green-100:oklch(96.2% .044 156.743);--color-green-700:oklch(52.7% .154 150.069);--color-green-800:oklch(44.8% .119 151.328);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-700:oklch(50.8% .118 165.612);--color-sky-50:oklch(97.7% .013 236.62);--color-sky-200:oklch(90.1% .058 230.902);--color-sky-700:oklch(50% .134 242.749);--color-blue-50:oklch(97% .014 254.604);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-200:oklch(88.2% .059 254.128);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--color-violet-50:oklch(96.9% .016 293.756);--color-violet-200:oklch(89.4% .057 293.283);--color-violet-700:oklch(49.1% .27 292.581);--color-purple-50:oklch(97.7% .014 308.299);--color-purple-200:oklch(90.2% .063 306.703);--color-purple-700:oklch(49.6% .265 301.924);--color-fuchsia-50:oklch(97.7% .017 320.058);--color-fuchsia-200:oklch(90.3% .076 319.62);--color-fuchsia-700:oklch(51.8% .253 323.949);--color-rose-50:oklch(96.9% .015 12.422);--color-rose-200:oklch(89.2% .058 10.001);--color-rose-500:oklch(64.5% .246 16.439);--color-rose-700:oklch(51.4% .222 16.935);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-500:oklch(55.4% .046 257.417);--color-slate-700:oklch(37.2% .044 257.287);--color-slate-800:oklch(27.9% .041 260.031);--color-slate-900:oklch(20.8% .042 265.755);--color-slate-950:oklch(12.9% .042 264.695);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-md:28rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--font-weight-medium:500;--font-weight-semibold:600;--leading-snug:1.375;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--blur-sm:8px;--blur-md:12px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}:host{font-family:var(--font-sans);color:var(--color-slate-900);background-color:#0000;display:block}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.top-0{top:calc(var(--spacing)*0)}.right-0{right:calc(var(--spacing)*0)}.right-1{right:calc(var(--spacing)*1)}.bottom-1{bottom:calc(var(--spacing)*1)}.left-0{left:calc(var(--spacing)*0)}.z-10{z-index:10}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.m-0{margin:calc(var(--spacing)*0)}.mx-4{margin-inline:calc(var(--spacing)*4)}.my-1{margin-block:calc(var(--spacing)*1)}.my-3{margin-block:calc(var(--spacing)*3)}.mt-0\\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-1\\.5{margin-top:calc(var(--spacing)*1.5)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-6{margin-top:calc(var(--spacing)*6)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.ml-auto{margin-left:auto}.box-border{box-sizing:border-box}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-1\\.5{height:calc(var(--spacing)*1.5)}.h-3{height:calc(var(--spacing)*3)}.h-3\\.5{height:calc(var(--spacing)*3.5)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-6{height:calc(var(--spacing)*6)}.h-8{height:calc(var(--spacing)*8)}.h-10{height:calc(var(--spacing)*10)}.h-12{height:calc(var(--spacing)*12)}.h-full{height:100%}.max-h-64{max-height:calc(var(--spacing)*64)}.w-1\\.5{width:calc(var(--spacing)*1.5)}.w-3{width:calc(var(--spacing)*3)}.w-3\\.5{width:calc(var(--spacing)*3.5)}.w-4{width:calc(var(--spacing)*4)}.w-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-8{width:calc(var(--spacing)*8)}.w-9{width:calc(var(--spacing)*9)}.w-10{width:calc(var(--spacing)*10)}.w-12{width:calc(var(--spacing)*12)}.w-40{width:calc(var(--spacing)*40)}.w-auto{width:auto}.w-full{width:100%}.max-w-\\[240px\\]{max-width:240px}.max-w-md{max-width:var(--container-md)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\\[160px\\]{min-width:160px}.min-w-\\[200px\\]{min-width:200px}.flex-1{flex:1}.flex-shrink,.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.table-fixed{table-layout:fixed}.border-collapse{border-collapse:collapse}.translate-x-0\\.5{--tw-translate-x:calc(var(--spacing)*.5);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-4{--tw-translate-x:calc(var(--spacing)*4);translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-\\[2px\\]{--tw-translate-y:calc(2px*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.cursor-grab{cursor:grab}.cursor-grabbing{cursor:grabbing}.cursor-nwse-resize{cursor:nwse-resize}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.resize{resize:both}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-gray-200>:not(:last-child)){border-color:var(--color-gray-200)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-amber-200{border-color:var(--color-amber-200)}.border-blue-200{border-color:var(--color-blue-200)}.border-emerald-200{border-color:var(--color-emerald-200)}.border-fuchsia-200{border-color:var(--color-fuchsia-200)}.border-gray-200{border-color:var(--color-gray-200)}.border-purple-200{border-color:var(--color-purple-200)}.border-rose-200{border-color:var(--color-rose-200)}.border-sky-200{border-color:var(--color-sky-200)}.border-slate-200{border-color:var(--color-slate-200)}.border-violet-200{border-color:var(--color-violet-200)}.border-white\\/20{border-color:#fff3}@supports (color:color-mix(in lab, red, red)){.border-white\\/20{border-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.bg-amber-50{background-color:var(--color-amber-50)}.bg-amber-100{background-color:var(--color-amber-100)}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-100{background-color:var(--color-blue-100)}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-fuchsia-50{background-color:var(--color-fuchsia-50)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-50\\/50{background-color:#f9fafb80}@supports (color:color-mix(in lab, red, red)){.bg-gray-50\\/50{background-color:color-mix(in oklab,var(--color-gray-50)50%,transparent)}}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-300{background-color:var(--color-gray-300)}.bg-gray-400{background-color:var(--color-gray-400)}.bg-gray-800{background-color:var(--color-gray-800)}.bg-gray-900{background-color:var(--color-gray-900)}.bg-green-100{background-color:var(--color-green-100)}.bg-purple-50{background-color:var(--color-purple-50)}.bg-rose-50{background-color:var(--color-rose-50)}.bg-rose-500{background-color:var(--color-rose-500)}.bg-sky-50{background-color:var(--color-sky-50)}.bg-slate-900{background-color:var(--color-slate-900)}.bg-slate-950\\/95{background-color:#020618f2}@supports (color:color-mix(in lab, red, red)){.bg-slate-950\\/95{background-color:color-mix(in oklab,var(--color-slate-950)95%,transparent)}}.bg-violet-50{background-color:var(--color-violet-50)}.bg-white{background-color:var(--color-white)}.bg-white\\/60{background-color:#fff9}@supports (color:color-mix(in lab, red, red)){.bg-white\\/60{background-color:color-mix(in oklab,var(--color-white)60%,transparent)}}.bg-white\\/95{background-color:#fffffff2}@supports (color:color-mix(in lab, red, red)){.bg-white\\/95{background-color:color-mix(in oklab,var(--color-white)95%,transparent)}}.p-2{padding:calc(var(--spacing)*2)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.px-1{padding-inline:calc(var(--spacing)*1)}.px-1\\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.py-0\\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-8{padding-block:calc(var(--spacing)*8)}.py-10{padding-block:calc(var(--spacing)*10)}.text-center{text-align:center}.text-left{text-align:left}.align-middle{vertical-align:middle}.font-mono{font-family:var(--font-mono)}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[9px\\]{font-size:9px}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.break-words{overflow-wrap:break-word}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.text-amber-600{color:var(--color-amber-600)}.text-amber-700{color:var(--color-amber-700)}.text-amber-800{color:var(--color-amber-800)}.text-amber-900{color:var(--color-amber-900)}.text-blue-600{color:var(--color-blue-600)}.text-blue-700{color:var(--color-blue-700)}.text-blue-800{color:var(--color-blue-800)}.text-emerald-700{color:var(--color-emerald-700)}.text-fuchsia-700{color:var(--color-fuchsia-700)}.text-gray-300{color:var(--color-gray-300)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-gray-900{color:var(--color-gray-900)}.text-green-700{color:var(--color-green-700)}.text-green-800{color:var(--color-green-800)}.text-purple-700{color:var(--color-purple-700)}.text-rose-700{color:var(--color-rose-700)}.text-sky-700{color:var(--color-sky-700)}.text-slate-500{color:var(--color-slate-500)}.text-slate-700{color:var(--color-slate-700)}.text-slate-800{color:var(--color-slate-800)}.text-slate-900{color:var(--color-slate-900)}.text-violet-700{color:var(--color-violet-700)}.text-white{color:var(--color-white)}.italic{font-style:italic}.underline{text-decoration-line:underline}.opacity-0{opacity:0}.opacity-80{opacity:.8}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-black\\/5{--tw-ring-color:#0000000d}@supports (color:color-mix(in lab, red, red)){.ring-black\\/5{--tw-ring-color:color-mix(in oklab,var(--color-black)5%,transparent)}}.ring-transparent{--tw-ring-color:transparent}.ring-white\\/10{--tw-ring-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.ring-white\\/10{--tw-ring-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media (hover:hover){.group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}.hover\\:scale-105:hover{--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%;scale:var(--tw-scale-x)var(--tw-scale-y)}.hover\\:border-gray-300:hover{border-color:var(--color-gray-300)}.hover\\:border-white\\/30:hover{border-color:#ffffff4d}@supports (color:color-mix(in lab, red, red)){.hover\\:border-white\\/30:hover{border-color:color-mix(in oklab,var(--color-white)30%,transparent)}}.hover\\:bg-blue-50\\/50:hover{background-color:#eff6ff80}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-blue-50\\/50:hover{background-color:color-mix(in oklab,var(--color-blue-50)50%,transparent)}}.hover\\:bg-gray-50:hover{background-color:var(--color-gray-50)}.hover\\:bg-gray-100:hover{background-color:var(--color-gray-100)}.hover\\:bg-gray-200:hover{background-color:var(--color-gray-200)}.hover\\:bg-gray-800:hover{background-color:var(--color-gray-800)}.hover\\:bg-slate-900\\/95:hover{background-color:#0f172bf2}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-slate-900\\/95:hover{background-color:color-mix(in oklab,var(--color-slate-900)95%,transparent)}}.hover\\:text-gray-600:hover{color:var(--color-gray-600)}.hover\\:text-gray-900:hover{color:var(--color-gray-900)}.hover\\:text-slate-900:hover{color:var(--color-slate-900)}}.focus\\:border-gray-300:focus{border-color:var(--color-gray-300)}.focus\\:bg-gray-50:focus{background-color:var(--color-gray-50)}.focus\\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\\:ring-gray-200:focus{--tw-ring-color:var(--color-gray-200)}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\\:outline:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}.focus-visible\\:outline-2:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.focus-visible\\:outline-offset-2:focus-visible{outline-offset:2px}.focus-visible\\:outline-\\[\\#BEC2FF\\]:focus-visible{outline-color:#bec2ff}.focus-visible\\:outline-gray-300:focus-visible{outline-color:var(--color-gray-300)}.focus-visible\\:outline-gray-400:focus-visible{outline-color:var(--color-gray-400)}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}@media (min-width:48rem){.md\\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}.\\[\\&\\>svg\\]\\:\\!h-8>svg{height:calc(var(--spacing)*8)!important}.\\[\\&\\>svg\\]\\:\\!w-8>svg{width:calc(var(--spacing)*8)!important}.sr-only{clip:rect(0,0,0,0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}}.inspector-account-strip{color:#fff;background-color:#010507;width:100%;min-width:0}.inspector-account-logo{filter:brightness(0)invert()}.inspector-agent-placeholder{color:#afafb7;border-color:#ffffff47}.inspector-primary-navigation,.inspector-child-navigation{cursor:default;background-color:#fff;border-bottom:1px solid #dbdbe5;flex:none;align-items:center;gap:4px;width:100%;min-width:0;padding:6px 12px;display:flex}.inspector-primary-navigation{overflow:auto hidden}.inspector-child-navigation{overscroll-behavior-inline:contain;white-space:nowrap;overflow:auto hidden}.inspector-nav-control{color:#57575b;min-height:32px;font:inherit;outline-offset:2px;cursor:pointer;background-color:#0000;border:1px solid #0000;border-radius:4px;outline:2px solid #0000;flex:none;justify-content:center;align-items:center;gap:6px;padding:6px 9px;font-size:12px;font-weight:600;line-height:1.25;display:inline-flex}.inspector-nav-control:hover{color:#010507;background-color:#f0f0f4}.inspector-nav-control-active{color:#3f176f;background-color:#eee6fe;border-color:#bec2ff}.inspector-nav-icon{flex:none;align-items:center;display:inline-flex}.inspector-nav-icon svg{width:15px;height:15px}.inspector-nav-control:focus-visible,.inspector-nav-control:focus,.inspector-account-control:focus-visible,.inspector-account-control:focus,[data-inspector-thread-cta]:focus-visible,[data-inspector-thread-cta]:focus,[data-inspector-action-placement=threads-footer]:focus-visible,[data-inspector-action-placement=threads-footer]:focus{outline-offset:2px;outline:2px solid #6430ab!important}.inspector-account-control{color:#afafb7;outline-offset:2px;cursor:pointer;outline:2px solid #0000}.inspector-account-control:hover,.inspector-account-control-active{color:#fff;background-color:#ffffff1f}[data-inspector-thread-cta]{color:#57575b;white-space:nowrap;outline-offset:2px;cursor:pointer;background-color:#fff;border:1px solid #dbdbe5;border-radius:4px;outline:2px solid #0000;flex:none;justify-content:center;align-items:center;min-height:32px;margin-left:auto;padding:6px 9px;font-size:11px;font-weight:600;line-height:1.25;text-decoration:none;display:inline-flex}[data-inspector-account-strip] button,[data-inspector-account-strip] a{cursor:pointer}[data-inspector-thread-cta]:hover{color:#010507;background-color:#f7f7f9;border-color:#afafb7}[data-inspector-threads-setup-prompt],[data-inspector-threads-setup-link]{min-height:34px;font:inherit;outline-offset:2px;cursor:pointer;border:1px solid #dbdbe5;border-radius:6px;outline:2px solid #0000;justify-content:center;align-items:center;gap:6px;padding:8px 12px;font-size:12px;font-weight:600;line-height:1.25;text-decoration:none;display:inline-flex}[data-inspector-threads-setup-prompt]{color:#fff;background-color:#010507;border-color:#010507}[data-inspector-threads-setup-prompt]:hover{background-color:#2b2b2b;border-color:#2b2b2b}[data-inspector-threads-setup-link]{color:#57575b;background-color:#fff}[data-inspector-threads-setup-link]:hover{color:#010507;background-color:#f7f7f9;border-color:#afafb7}[data-inspector-threads-setup-prompt]:focus-visible,[data-inspector-threads-setup-link]:focus-visible{outline-offset:2px;outline:2px solid #6430ab}.inspector-threads-footer{color:#57575b;background-color:#f7f7f9;border-top:1px solid #dbdbe5;flex:none;gap:10px;padding:12px;font-size:11px;line-height:1.35;display:grid}.inspector-threads-usage{gap:6px;display:grid}[data-inspector-thread-count]{color:#010507;font-weight:600}[data-inspector-thread-expiry]{color:#57575b}.inspector-thread-progress{--inspector-thread-progress-color:#189370;width:100%;height:6px;accent-color:var(--inspector-thread-progress-color);border-radius:999px;overflow:hidden}.inspector-thread-progress[data-inspector-thread-capacity=warning]{--inspector-thread-progress-color:#b45309}.inspector-thread-progress[data-inspector-thread-capacity=critical]{--inspector-thread-progress-color:#be123c}.inspector-thread-progress::-webkit-progress-bar{background-color:#dbdbe5;border-radius:999px}.inspector-thread-progress::-webkit-progress-value{background-color:var(--inspector-thread-progress-color);border-radius:999px}.inspector-thread-progress::-moz-progress-bar{background-color:var(--inspector-thread-progress-color);border-radius:999px}[data-inspector-action-placement=threads-footer]{color:#57575b;outline-offset:2px;cursor:pointer;background-color:#fff;border:1px solid #dbdbe5;border-radius:4px;outline:2px solid #0000;justify-content:center;align-items:center;width:100%;min-height:32px;padding:6px 9px;font-size:11px;font-weight:600;line-height:1.25;text-decoration:none;display:inline-flex}[data-inspector-action-placement=threads-footer][data-inspector-action-intent=upgrade]{color:#fff;background-color:#6430ab;border-color:#6430ab}[data-inspector-action-placement=threads-footer][data-inspector-action-intent=upgrade]:hover{color:#fff;background-color:#3f176f;border-color:#3f176f}[data-inspector-action-placement=threads-footer]:hover{color:#010507;background-color:#fff;border-color:#afafb7}.cpk-threads-overview-video{opacity:0;transition:opacity .22s}.cpk-threads-overview-video[data-loaded=true]{opacity:1}.cpk-threads-overview-video-control{color:#3f176f;min-height:32px;font:inherit;outline-offset:2px;cursor:pointer;background-color:#fff;border:1px solid #dbdbe5;border-radius:4px;outline:2px solid #0000;justify-content:center;align-items:center;margin:0 0 14px;padding:6px 10px;font-size:12px;font-weight:600;line-height:1.25;display:inline-flex}.cpk-threads-overview-video-control:hover{color:#010507;background-color:#f7f7f9;border-color:#afafb7}.cpk-threads-overview-video-control:focus-visible{outline-offset:2px;outline:2px solid #6430ab}.cpk-threads-overview-video-fallback{color:#57575b;max-width:440px;margin:-4px 0 14px;font-size:12px;line-height:1.5}@media (prefers-reduced-motion:reduce){.cpk-threads-overview-video{transition:none}}@property --tw-translate-x{syntax:\"*\";inherits:false;initial-value:0}@property --tw-translate-y{syntax:\"*\";inherits:false;initial-value:0}@property --tw-translate-z{syntax:\"*\";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:\"*\";inherits:false}@property --tw-rotate-y{syntax:\"*\";inherits:false}@property --tw-rotate-z{syntax:\"*\";inherits:false}@property --tw-skew-x{syntax:\"*\";inherits:false}@property --tw-skew-y{syntax:\"*\";inherits:false}@property --tw-space-y-reverse{syntax:\"*\";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:\"*\";inherits:false;initial-value:0}@property --tw-border-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-leading{syntax:\"*\";inherits:false}@property --tw-font-weight{syntax:\"*\";inherits:false}@property --tw-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:\"*\";inherits:false}@property --tw-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:\"*\";inherits:false}@property --tw-inset-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:\"*\";inherits:false}@property --tw-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:\"*\";inherits:false}@property --tw-inset-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:\"*\";inherits:false}@property --tw-ring-offset-width{syntax:\"<length>\";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:\"*\";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-blur{syntax:\"*\";inherits:false}@property --tw-brightness{syntax:\"*\";inherits:false}@property --tw-contrast{syntax:\"*\";inherits:false}@property --tw-grayscale{syntax:\"*\";inherits:false}@property --tw-hue-rotate{syntax:\"*\";inherits:false}@property --tw-invert{syntax:\"*\";inherits:false}@property --tw-opacity{syntax:\"*\";inherits:false}@property --tw-saturate{syntax:\"*\";inherits:false}@property --tw-sepia{syntax:\"*\";inherits:false}@property --tw-drop-shadow{syntax:\"*\";inherits:false}@property --tw-drop-shadow-color{syntax:\"*\";inherits:false}@property --tw-drop-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:\"*\";inherits:false}@property --tw-backdrop-blur{syntax:\"*\";inherits:false}@property --tw-backdrop-brightness{syntax:\"*\";inherits:false}@property --tw-backdrop-contrast{syntax:\"*\";inherits:false}@property --tw-backdrop-grayscale{syntax:\"*\";inherits:false}@property --tw-backdrop-hue-rotate{syntax:\"*\";inherits:false}@property --tw-backdrop-invert{syntax:\"*\";inherits:false}@property --tw-backdrop-opacity{syntax:\"*\";inherits:false}@property --tw-backdrop-saturate{syntax:\"*\";inherits:false}@property --tw-backdrop-sepia{syntax:\"*\";inherits:false}@property --tw-scale-x{syntax:\"*\";inherits:false;initial-value:1}@property --tw-scale-y{syntax:\"*\";inherits:false;initial-value:1}@property --tw-scale-z{syntax:\"*\";inherits:false;initial-value:1}@keyframes pulse{50%{opacity:.5}}";
10
10
 
11
11
  //#endregion
12
12
  //#region src/assets/inspector-logo.svg
@@ -189,9 +189,100 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
189
189
  });
190
190
  }
191
191
 
192
+ //#endregion
193
+ //#region src/lib/inspector-metadata.ts
194
+ /** Maps the runtime's legacy license status to the inspector's four states. */
195
+ function normalizeRuntimeLicenseState(status) {
196
+ switch (status) {
197
+ case "valid":
198
+ case "expiring": return "valid";
199
+ case "none": return "none";
200
+ case "expired":
201
+ case "invalid": return "expired";
202
+ default: return "unknown";
203
+ }
204
+ }
205
+ function projectAction(state, action) {
206
+ if (state === "valid" && (action === null || action === void 0 ? void 0 : action.kind) === "manage_plan") return { threadsFooterAction: {
207
+ kind: action.kind,
208
+ url: action.url,
209
+ label: "Manage Your Plan"
210
+ } };
211
+ if (state === "none" && (action === null || action === void 0 ? void 0 : action.kind) === "enable_intelligence") return { lockedAction: {
212
+ kind: action.kind,
213
+ url: action.url,
214
+ label: "Enable Intelligence"
215
+ } };
216
+ if (state === "expired" && (action === null || action === void 0 ? void 0 : action.kind) === "renew") return { lockedAction: {
217
+ kind: action.kind,
218
+ url: action.url,
219
+ label: "Renew"
220
+ } };
221
+ if (state === "expired" && (action === null || action === void 0 ? void 0 : action.kind) === "manage_plan") return { lockedAction: {
222
+ kind: action.kind,
223
+ url: action.url,
224
+ label: "Manage Your Plan"
225
+ } };
226
+ return {};
227
+ }
228
+ /**
229
+ * Re-parses Core metadata at the UI boundary and exposes independent,
230
+ * render-safe slots without display math.
231
+ */
232
+ function projectInspectorMetadata(value, runtimeLicenseStatus) {
233
+ var _metadata$license;
234
+ const metadata = (0, _copilotkit_shared.parseInspectorMetadataV1)(value);
235
+ const runtimeState = normalizeRuntimeLicenseState(runtimeLicenseStatus);
236
+ const metadataState = metadata === null || metadata === void 0 || (_metadata$license = metadata.license) === null || _metadata$license === void 0 ? void 0 : _metadata$license.state;
237
+ const hasLicenseConflict = metadataState !== void 0 && metadataState !== "unknown" && runtimeState !== "unknown" && metadataState !== runtimeState;
238
+ const licenseState = hasLicenseConflict ? runtimeState : metadataState !== null && metadataState !== void 0 ? metadataState : runtimeState;
239
+ return {
240
+ ...(metadata === null || metadata === void 0 ? void 0 : metadata.identity) === void 0 ? {} : { identity: metadata.identity },
241
+ ...(metadata === null || metadata === void 0 ? void 0 : metadata.plan) === void 0 ? {} : { plan: metadata.plan },
242
+ ...(metadata === null || metadata === void 0 ? void 0 : metadata.usage) === void 0 ? {} : { usage: metadata.usage },
243
+ licenseState,
244
+ hasLicenseConflict,
245
+ ...hasLicenseConflict ? {} : projectAction(licenseState, metadata === null || metadata === void 0 ? void 0 : metadata.action)
246
+ };
247
+ }
248
+
249
+ //#endregion
250
+ //#region src/lib/thread-selection.ts
251
+ function parsedTimestamp(value) {
252
+ if (typeof value !== "string") return null;
253
+ const timestamp = Date.parse(value);
254
+ return Number.isFinite(timestamp) ? timestamp : null;
255
+ }
256
+ function compareNewestDate(left, right) {
257
+ const leftTimestamp = parsedTimestamp(left);
258
+ const rightTimestamp = parsedTimestamp(right);
259
+ if (leftTimestamp === null) return rightTimestamp === null ? 0 : 1;
260
+ if (rightTimestamp === null) return -1;
261
+ if (leftTimestamp === rightTimestamp) return 0;
262
+ return leftTimestamp > rightTimestamp ? -1 : 1;
263
+ }
264
+ function compareVisibleThreads(left, right) {
265
+ const updatedOrder = compareNewestDate(left.updatedAt, right.updatedAt);
266
+ if (updatedOrder !== 0) return updatedOrder;
267
+ const createdOrder = compareNewestDate(left.createdAt, right.createdAt);
268
+ if (createdOrder !== 0) return createdOrder;
269
+ if (left.id < right.id) return -1;
270
+ if (left.id > right.id) return 1;
271
+ return 0;
272
+ }
273
+ /**
274
+ * Keeps a visible explicit real-Thread selection or returns the deterministic
275
+ * newest visible real Thread without mutating the candidate list.
276
+ */
277
+ function selectVisibleRealThreadId(input) {
278
+ var _sort$0$id, _sort$;
279
+ if (input.selectedThreadId !== null && input.threads.some((thread) => thread.id === input.selectedThreadId)) return input.selectedThreadId;
280
+ return (_sort$0$id = (_sort$ = [...input.threads].sort(compareVisibleThreads)[0]) === null || _sort$ === void 0 ? void 0 : _sort$.id) !== null && _sort$0$id !== void 0 ? _sort$0$id : null;
281
+ }
282
+
192
283
  //#endregion
193
284
  //#region package.json
194
- var version = "1.66.2";
285
+ var version = "1.67.0";
195
286
 
196
287
  //#endregion
197
288
  //#region src/lib/telemetry.ts
@@ -214,7 +305,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
214
305
  threadsExampleTourDismissed: "oss.inspector.threads_example_tour_dismissed",
215
306
  threadsExampleTourCompleted: "oss.inspector.threads_example_tour_completed",
216
307
  threadsExampleTourReopened: "oss.inspector.threads_example_tour_reopened",
217
- memoriesTabClicked: "oss.inspector.memories_tab_clicked"
308
+ memoriesTabClicked: "oss.inspector.memories_tab_clicked",
309
+ metadataModuleViewed: "oss.inspector.metadata_module_viewed",
310
+ metadataActionClicked: "oss.inspector.metadata_action_clicked"
218
311
  };
219
312
  const TELEMETRY_INGEST_URL = "https://telemetry.copilotkit.ai/ingest";
220
313
  const TELEMETRY_DOCS_URL = "https://docs.copilotkit.ai/telemetry";
@@ -222,7 +315,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
222
315
  const PACKAGE_VERSION = version;
223
316
  const FETCH_TIMEOUT_MS = 3e3;
224
317
  function isEnrichedTelemetryEvent(event) {
225
- return event === TELEMETRY_EVENTS.opened || event === TELEMETRY_EVENTS.threadsTabClicked || event === TELEMETRY_EVENTS.threadsLockedViewed || event === TELEMETRY_EVENTS.threadsIntelligenceSignupClicked || event === TELEMETRY_EVENTS.threadsTalkToEngineerClicked || event === TELEMETRY_EVENTS.talkToEngineerClicked || event === TELEMETRY_EVENTS.threadsEmptyEnabledViewed || event === TELEMETRY_EVENTS.threadsEnabledViewed || event === TELEMETRY_EVENTS.threadsExampleViewed || event === TELEMETRY_EVENTS.threadsExampleSelected || event === TELEMETRY_EVENTS.threadsExampleTourStarted || event === TELEMETRY_EVENTS.threadsExampleTourStepViewed || event === TELEMETRY_EVENTS.threadsExampleTourDismissed || event === TELEMETRY_EVENTS.threadsExampleTourCompleted || event === TELEMETRY_EVENTS.threadsExampleTourReopened || event === TELEMETRY_EVENTS.memoriesTabClicked;
318
+ return event === TELEMETRY_EVENTS.opened || event === TELEMETRY_EVENTS.threadsTabClicked || event === TELEMETRY_EVENTS.threadsLockedViewed || event === TELEMETRY_EVENTS.threadsIntelligenceSignupClicked || event === TELEMETRY_EVENTS.threadsTalkToEngineerClicked || event === TELEMETRY_EVENTS.talkToEngineerClicked || event === TELEMETRY_EVENTS.threadsEmptyEnabledViewed || event === TELEMETRY_EVENTS.threadsEnabledViewed || event === TELEMETRY_EVENTS.threadsExampleViewed || event === TELEMETRY_EVENTS.threadsExampleSelected || event === TELEMETRY_EVENTS.threadsExampleTourStarted || event === TELEMETRY_EVENTS.threadsExampleTourStepViewed || event === TELEMETRY_EVENTS.threadsExampleTourDismissed || event === TELEMETRY_EVENTS.threadsExampleTourCompleted || event === TELEMETRY_EVENTS.threadsExampleTourReopened || event === TELEMETRY_EVENTS.memoriesTabClicked || event === TELEMETRY_EVENTS.metadataModuleViewed || event === TELEMETRY_EVENTS.metadataActionClicked;
226
319
  }
227
320
  function getRuntimeUrlType(runtimeUrl) {
228
321
  if (!runtimeUrl) return "missing";
@@ -248,15 +341,14 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
248
341
  */
249
342
  function track(event, properties = {}) {
250
343
  if (isTelemetryOptedOut()) return;
251
- const distinctId = getOrCreateTelemetryDistinctId();
252
- const enrichedProperties = isEnrichedTelemetryEvent(event) ? {
253
- package_name: PACKAGE_NAME,
254
- package_version: PACKAGE_VERSION,
255
- inspector_distinct_id: distinctId
256
- } : {};
257
- let body;
258
344
  try {
259
- body = JSON.stringify({
345
+ const distinctId = getOrCreateTelemetryDistinctId();
346
+ const enrichedProperties = isEnrichedTelemetryEvent(event) ? {
347
+ package_name: PACKAGE_NAME,
348
+ package_version: PACKAGE_VERSION,
349
+ inspector_distinct_id: distinctId
350
+ } : {};
351
+ postBestEffort(TELEMETRY_INGEST_URL, JSON.stringify({
260
352
  event,
261
353
  properties: {
262
354
  ...properties,
@@ -268,11 +360,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
268
360
  ...isEnrichedTelemetryEvent(event) ? { version: PACKAGE_VERSION } : {}
269
361
  },
270
362
  ts: Math.floor(Date.now() / 1e3)
271
- });
272
- } catch (_unused2) {
273
- return;
274
- }
275
- postBestEffort(TELEMETRY_INGEST_URL, body, distinctId);
363
+ }), distinctId);
364
+ } catch (_unused2) {}
276
365
  }
277
366
  function trackBannerViewed(props) {
278
367
  track(TELEMETRY_EVENTS.bannerViewed, props);
@@ -299,51 +388,135 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
299
388
  function trackInspectorOpened(props) {
300
389
  track(TELEMETRY_EVENTS.opened, props);
301
390
  }
391
+ /** Rebuild the common Thread payload from its closed coarse allowlist. */
392
+ function threadCommonProperties(props) {
393
+ return {
394
+ ...props.intelligence_status === void 0 ? {} : { intelligence_status: props.intelligence_status },
395
+ ...props.thread_service_status === void 0 ? {} : { thread_service_status: props.thread_service_status },
396
+ ...props.license_status === void 0 ? {} : { license_status: props.license_status },
397
+ ...props.runtime_mode === void 0 ? {} : { runtime_mode: props.runtime_mode },
398
+ ...props.runtime_url_type === void 0 ? {} : { runtime_url_type: props.runtime_url_type },
399
+ ...props.telemetry_disabled === void 0 ? {} : { telemetry_disabled: props.telemetry_disabled },
400
+ ...props.has_threads === void 0 ? {} : { has_threads: props.has_threads },
401
+ ...props.usage_bucket === void 0 ? {} : { usage_bucket: props.usage_bucket },
402
+ ...props.expiry_bucket === void 0 ? {} : { expiry_bucket: props.expiry_bucket },
403
+ ...props.group_key === void 0 ? {} : { group_key: props.group_key },
404
+ ...props.leaf_key === void 0 ? {} : { leaf_key: props.leaf_key }
405
+ };
406
+ }
407
+ /** Add only the fields used by the three Thread CTA funnels. */
408
+ function threadCtaProperties(props) {
409
+ return {
410
+ ...threadCommonProperties(props),
411
+ ...props.cta === void 0 ? {} : { cta: props.cta },
412
+ ...props.cta_surface === void 0 ? {} : { cta_surface: props.cta_surface },
413
+ ...props.posthog_distinct_id === void 0 ? {} : { posthog_distinct_id: props.posthog_distinct_id }
414
+ };
415
+ }
416
+ /** Add only the closed example kind used by example impressions/selections. */
417
+ function threadExampleProperties(props) {
418
+ return {
419
+ ...threadCommonProperties(props),
420
+ ...props.example_kind === void 0 ? {} : { example_kind: props.example_kind }
421
+ };
422
+ }
423
+ /** Add only a bounded example kind and tour step/tab pair. */
424
+ function threadTourProperties(props) {
425
+ return {
426
+ ...threadExampleProperties(props),
427
+ ...props.tour_step === void 0 ? {} : { tour_step: props.tour_step },
428
+ ...props.tour_tab === void 0 ? {} : { tour_tab: props.tour_tab }
429
+ };
430
+ }
431
+ /** Add the bounded dismissal leaf used only by terminal tour events. */
432
+ function threadTourTerminalProperties(props) {
433
+ return {
434
+ ...threadTourProperties(props),
435
+ ...props.dismiss_method === void 0 ? {} : { dismiss_method: props.dismiss_method }
436
+ };
437
+ }
302
438
  function trackThreadsTabClicked(props = {}) {
303
- track(TELEMETRY_EVENTS.threadsTabClicked, props);
439
+ track(TELEMETRY_EVENTS.threadsTabClicked, threadCommonProperties(props));
304
440
  }
305
441
  function trackThreadsLockedViewed(props) {
306
- track(TELEMETRY_EVENTS.threadsLockedViewed, props);
442
+ track(TELEMETRY_EVENTS.threadsLockedViewed, threadCommonProperties(props));
307
443
  }
308
444
  function trackThreadsIntelligenceSignupClicked(props) {
309
- track(TELEMETRY_EVENTS.threadsIntelligenceSignupClicked, props);
445
+ track(TELEMETRY_EVENTS.threadsIntelligenceSignupClicked, threadCtaProperties(props));
310
446
  }
311
447
  function trackThreadsTalkToEngineerClicked(props) {
312
- track(TELEMETRY_EVENTS.threadsTalkToEngineerClicked, props);
448
+ track(TELEMETRY_EVENTS.threadsTalkToEngineerClicked, threadCtaProperties(props));
313
449
  }
314
450
  function trackTalkToEngineerClicked(props) {
315
- track(TELEMETRY_EVENTS.talkToEngineerClicked, props);
451
+ track(TELEMETRY_EVENTS.talkToEngineerClicked, threadCtaProperties(props));
316
452
  }
317
453
  function trackThreadsEmptyEnabledViewed(props) {
318
- track(TELEMETRY_EVENTS.threadsEmptyEnabledViewed, props);
454
+ track(TELEMETRY_EVENTS.threadsEmptyEnabledViewed, threadCommonProperties(props));
319
455
  }
320
456
  function trackThreadsEnabledViewed(props) {
321
- track(TELEMETRY_EVENTS.threadsEnabledViewed, props);
457
+ track(TELEMETRY_EVENTS.threadsEnabledViewed, threadCommonProperties(props));
322
458
  }
323
459
  function trackThreadsExampleViewed(props) {
324
- track(TELEMETRY_EVENTS.threadsExampleViewed, props);
460
+ track(TELEMETRY_EVENTS.threadsExampleViewed, threadExampleProperties(props));
325
461
  }
326
462
  function trackThreadsExampleSelected(props) {
327
- track(TELEMETRY_EVENTS.threadsExampleSelected, props);
463
+ track(TELEMETRY_EVENTS.threadsExampleSelected, threadExampleProperties(props));
328
464
  }
329
465
  function trackThreadsExampleTourStarted(props) {
330
- track(TELEMETRY_EVENTS.threadsExampleTourStarted, props);
466
+ track(TELEMETRY_EVENTS.threadsExampleTourStarted, threadTourProperties(props));
331
467
  }
332
468
  function trackThreadsExampleTourStepViewed(props) {
333
- track(TELEMETRY_EVENTS.threadsExampleTourStepViewed, props);
469
+ track(TELEMETRY_EVENTS.threadsExampleTourStepViewed, threadTourProperties(props));
334
470
  }
335
471
  function trackThreadsExampleTourDismissed(props) {
336
- track(TELEMETRY_EVENTS.threadsExampleTourDismissed, props);
472
+ track(TELEMETRY_EVENTS.threadsExampleTourDismissed, threadTourTerminalProperties(props));
337
473
  }
338
474
  function trackThreadsExampleTourCompleted(props) {
339
- track(TELEMETRY_EVENTS.threadsExampleTourCompleted, props);
475
+ track(TELEMETRY_EVENTS.threadsExampleTourCompleted, threadTourTerminalProperties(props));
340
476
  }
341
477
  function trackThreadsExampleTourReopened(props) {
342
- track(TELEMETRY_EVENTS.threadsExampleTourReopened, props);
478
+ track(TELEMETRY_EVENTS.threadsExampleTourReopened, threadTourProperties(props));
343
479
  }
344
480
  function trackMemoriesTabClicked(props = {}) {
345
481
  track(TELEMETRY_EVENTS.memoriesTabClicked, props);
346
482
  }
483
+ function metadataCoarseProperties(props) {
484
+ const navigation = props.group_key === void 0 || props.leaf_key === void 0 ? {} : {
485
+ group_key: props.group_key,
486
+ leaf_key: props.leaf_key
487
+ };
488
+ return {
489
+ license_bucket: props.license_bucket,
490
+ usage_bucket: props.usage_bucket,
491
+ expiry_bucket: props.expiry_bucket,
492
+ ...navigation,
493
+ ...props.action_placement === void 0 ? {} : { action_placement: props.action_placement }
494
+ };
495
+ }
496
+ /**
497
+ * Tracks one visible Inspector metadata module using coarse fields only.
498
+ * Rebuilding the payload here prevents local labels, IDs, URLs, and usage
499
+ * values from crossing the telemetry boundary through extra object fields.
500
+ */
501
+ function trackMetadataModuleViewed(props) {
502
+ track(TELEMETRY_EVENTS.metadataModuleViewed, {
503
+ module: props.module,
504
+ ...props.action_kind === void 0 ? {} : { action_kind: props.action_kind },
505
+ ...metadataCoarseProperties(props)
506
+ });
507
+ }
508
+ /**
509
+ * Tracks clicks for managed plan and renewal actions. The existing
510
+ * Intelligence-enable funnel keeps its original event and never calls this
511
+ * helper, which prevents a single click from producing two wire events.
512
+ */
513
+ function trackMetadataActionClicked(props) {
514
+ track(TELEMETRY_EVENTS.metadataActionClicked, {
515
+ module: "action",
516
+ action_kind: props.action_kind,
517
+ ...metadataCoarseProperties(props)
518
+ });
519
+ }
347
520
  /**
348
521
  * Returns the inspector's anonymous distinct-ID for cross-domain
349
522
  * propagation onto outbound banner-CTA links, or `null` when the user
@@ -389,9 +562,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
389
562
  }
390
563
  async function postBestEffort(url, body, distinctId) {
391
564
  if (typeof fetch === "undefined") return;
392
- const controller = new AbortController();
393
- const timeoutId = setTimeout(() => controller.abort(), FETCH_TIMEOUT_MS);
565
+ let timeoutId;
394
566
  try {
567
+ const controller = new AbortController();
568
+ timeoutId = setTimeout(() => controller.abort(), FETCH_TIMEOUT_MS);
395
569
  await fetch(url, {
396
570
  method: "POST",
397
571
  headers: {
@@ -402,7 +576,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
402
576
  signal: controller.signal
403
577
  });
404
578
  } catch (_unused3) {} finally {
405
- clearTimeout(timeoutId);
579
+ if (timeoutId !== void 0) clearTimeout(timeoutId);
406
580
  }
407
581
  }
408
582
 
@@ -411,11 +585,47 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
411
585
  const WEB_INSPECTOR_TAG = "cpk-web-inspector";
412
586
  const THREAD_INSPECTOR_TAG = "cpk-thread-inspector";
413
587
  /**
414
- * User-facing label for the memory surface (nav item + view header). The menu
415
- * KEY stays "memories" for persistence/telemetry stability; only the label
416
- * changed from "Learning" to "Memory".
588
+ * User-facing label for the memory view header. The legacy menu key stays
589
+ * "memories" for persistence and telemetry stability.
417
590
  */
418
591
  const MEMORY_VIEW_LABEL = "Memory";
592
+ const INSPECTOR_GROUPS = {
593
+ threads: ["threads"],
594
+ agents: [
595
+ "ag-ui-events",
596
+ "agents",
597
+ "frontend-tools",
598
+ "capabilities",
599
+ "agent-context"
600
+ ],
601
+ learning: ["memories"]
602
+ };
603
+ const INSPECTOR_MENU_KEYS = [
604
+ ...INSPECTOR_GROUPS.threads,
605
+ ...INSPECTOR_GROUPS.agents,
606
+ ...INSPECTOR_GROUPS.learning
607
+ ];
608
+ /** Return whether persisted state names a legacy Inspector leaf. */
609
+ function isInspectorMenuKey(value) {
610
+ return typeof value === "string" && INSPECTOR_MENU_KEYS.some((menuKey) => menuKey === value);
611
+ }
612
+ const INSPECTOR_PRIMARY_NAVIGATION = [
613
+ {
614
+ key: "threads",
615
+ label: "Threads",
616
+ icon: "MessageSquare"
617
+ },
618
+ {
619
+ key: "agents",
620
+ label: "Agents",
621
+ icon: "Bot"
622
+ },
623
+ {
624
+ key: "learning",
625
+ label: "Learning",
626
+ icon: "Brain"
627
+ }
628
+ ];
419
629
  const EDGE_MARGIN = 16;
420
630
  const DRAG_THRESHOLD = 6;
421
631
  const MIN_WINDOW_WIDTH = 600;
@@ -434,21 +644,55 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
434
644
  };
435
645
  const DOCKED_LEFT_WIDTH = 500;
436
646
  const MAX_AGENT_EVENTS = 200;
647
+ const INTERACTIVE_FOCUS_BASE_STYLE = "outline-style:solid;outline-width:2px;outline-color:transparent;outline-offset:2px;cursor:pointer;";
437
648
  const MAX_PENDING_BANNER_VIEWED = 20;
438
649
  const MAX_TOTAL_EVENTS = 500;
439
650
  const INTELLIGENCE_SIGNUP_URL = "https://go.copilotkit.ai/intelligence-signup";
440
- const THREADS_INTELLIGENCE_SIGNIN_URL = "https://dashboard.operations.copilotkit.ai/sign-in";
441
651
  const TALK_TO_ENGINEER_URL = "https://www.copilotkit.ai/talk-to-an-engineer";
442
652
  const CAPABILITIES_TAB_LABEL = "Capabilities";
443
653
  const THREADS_DOCS_URL = "https://docs.copilotkit.ai/threads";
654
+ const THREADS_RUNTIME_SETUP_DOCS_URL = "https://docs.copilotkit.ai/backend/runtime-endpoints#enable-rich-threads-routes";
655
+ const THREADS_RUNTIME_SETUP_PROMPT = [
656
+ `Read ${THREADS_RUNTIME_SETUP_DOCS_URL} and finish setting up Rich Threads in this repository.`,
657
+ "",
658
+ "First inspect the repository's agent instructions, installed CopilotKit versions, Runtime adapter, frontend provider, route or proxy setup, and existing authentication. Preserve the current framework and deployment model. Preserve existing authentication middleware and access checks on every Runtime route.",
659
+ "",
660
+ "Follow the guide to enable the multi-route Runtime, align the frontend transport, scope identifyUser to the existing server-verified signed-in application user, and expose the full Runtime subtree for GET, POST, PATCH, and DELETE. Never use a fixed demo identity in production. If no trusted user identity exists, stop and ask me which auth source to use.",
661
+ "",
662
+ "Start the app and verify GET {basePath}/info reports threadEndpoints.list, inspect, mutations, and realtimeMetadata as true. Run focused tests, lint, and typecheck. Report the files changed, commands run, and verification result. If blocked, explain the missing input; do not invent setup."
663
+ ].join("\n");
444
664
  const SELF_HOSTED_INTELLIGENCE_URL = "https://docs.copilotkit.ai/premium/self-hosting";
445
665
  const THREADS_EXAMPLE_OVERVIEW_VIDEO_URL = "https://cdn.copilotkit.ai/corp-site/videos/copilotkit-generative-ui-agentic-frontend-demo.webm";
666
+ const THREADS_EXAMPLE_OVERVIEW_VIDEO_FALLBACK = "The demo video is unavailable. Use the example threads to explore Messages, AG-UI Events, and State.";
446
667
  const THREADS_EXAMPLE_TOUR_STORAGE_KEY = "cpk:inspector:threads-example-tour:v1";
447
668
  const THREADS_EXAMPLE_AGENT_ID = "threads-feature";
669
+ /**
670
+ * Selects the Thread store status with a stable object identity so loading-only
671
+ * transitions reach one of the Inspector's two existing store subscriptions.
672
+ */
673
+ function createThreadStoreStatusSelector() {
674
+ let previousError;
675
+ let previousIsLoading;
676
+ let previousStatus;
677
+ return (state) => {
678
+ const error = (0, _copilotkit_core.ɵselectThreadsError)(state);
679
+ const isLoading = (0, _copilotkit_core.ɵselectThreadsIsLoading)(state);
680
+ if (previousStatus && previousError === error && previousIsLoading === isLoading) return previousStatus;
681
+ previousError = error;
682
+ previousIsLoading = isLoading;
683
+ previousStatus = {
684
+ error,
685
+ isLoading
686
+ };
687
+ return previousStatus;
688
+ };
689
+ }
448
690
  const AGENT_EVENT_TYPES = [
449
691
  "RUN_STARTED",
450
692
  "RUN_FINISHED",
451
693
  "RUN_ERROR",
694
+ "STEP_STARTED",
695
+ "STEP_FINISHED",
452
696
  "TEXT_MESSAGE_START",
453
697
  "TEXT_MESSAGE_CONTENT",
454
698
  "TEXT_MESSAGE_END",
@@ -531,6 +775,15 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
531
775
  isExample: true
532
776
  }
533
777
  ];
778
+ /** Map Sam's fixed example IDs to a closed telemetry vocabulary. */
779
+ function getExampleKind(threadId) {
780
+ switch (threadId) {
781
+ case "example-realtime-sync": return "realtime_sync";
782
+ case "example-manage-history": return "manage_history";
783
+ case "example-inspect-runs": return "inspect_runs";
784
+ default: return;
785
+ }
786
+ }
534
787
  const THREADS_EXAMPLE_DETAILS = {
535
788
  "example-realtime-sync": {
536
789
  messages: [{
@@ -674,13 +927,13 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
674
927
  const THREADS_EXAMPLE_TOUR_STEPS = [
675
928
  {
676
929
  tab: "timeline",
677
- label: "Timeline",
930
+ label: "Messages",
678
931
  title: "Read the run as a story",
679
932
  body: "The timeline turns messages, tool calls, state changes, and run markers into a scannable debugging trail."
680
933
  },
681
934
  {
682
935
  tab: "raw-events",
683
- label: "Raw AG-UI Events",
936
+ label: "AG-UI Events",
684
937
  title: "Drop into the protocol payloads",
685
938
  body: "Raw events show the exact AG-UI stream behind the timeline when you need to verify ordering or payload shape."
686
939
  },
@@ -691,6 +944,28 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
691
944
  body: "The state tab shows the saved values that make a thread resumable across sessions."
692
945
  }
693
946
  ];
947
+ /** Return only the three supported tour step/tab pairs. */
948
+ function getExampleTourTelemetryPair(index) {
949
+ switch (index) {
950
+ case 0: return {
951
+ tour_step: 1,
952
+ tour_tab: "timeline"
953
+ };
954
+ case 1: return {
955
+ tour_step: 2,
956
+ tour_tab: "raw-events"
957
+ };
958
+ case 2: return {
959
+ tour_step: 3,
960
+ tour_tab: "state"
961
+ };
962
+ default: return;
963
+ }
964
+ }
965
+ /** Convert rendered action placement to its stable telemetry key. */
966
+ function getMetadataActionPlacement(placement) {
967
+ return placement === "threads-footer" ? "threads_footer" : "threads_locked";
968
+ }
694
969
  function escapeHtml(s) {
695
970
  return s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
696
971
  }
@@ -702,10 +977,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
702
977
  }
703
978
  const colors = {
704
979
  key: "#5558B2",
705
- str: "#189370",
706
- num: "#996300",
980
+ str: "#087653",
981
+ num: "#8a5900",
707
982
  bool: "#c0333a",
708
- nil: "#838389"
983
+ nil: "#68686e"
709
984
  };
710
985
  const json = JSON.stringify(obj, null, 2);
711
986
  if (!json) return "";
@@ -735,7 +1010,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
735
1010
  };
736
1011
  if (type.startsWith("TOOL_CALL")) return {
737
1012
  bg: "rgba(133,236,206,0.15)",
738
- fg: "#189370"
1013
+ fg: "#087653"
739
1014
  };
740
1015
  if (type.startsWith("STATE")) return {
741
1016
  bg: "rgba(190,194,255,0.102)",
@@ -747,11 +1022,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
747
1022
  };
748
1023
  if (type.startsWith("RUN_") || type.startsWith("STEP_")) return {
749
1024
  bg: "rgba(255,172,77,0.2)",
750
- fg: "#996300"
1025
+ fg: "#8a5900"
751
1026
  };
752
1027
  return {
753
1028
  bg: "#F7F7F9",
754
- fg: "#838389"
1029
+ fg: "#68686e"
755
1030
  };
756
1031
  }
757
1032
  function formatTimestamp(ts) {
@@ -771,6 +1046,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
771
1046
  this.threads = [];
772
1047
  this.selectedThreadId = null;
773
1048
  this.errorMessage = null;
1049
+ this.suppressEmptyState = false;
774
1050
  this._query = "";
775
1051
  this.onSearchInput = (event) => {
776
1052
  this._query = event.target.value;
@@ -822,11 +1098,13 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
822
1098
  ${filtered.map((thread) => {
823
1099
  var _thread$name;
824
1100
  return lit.html`
825
- <div
1101
+ <button
1102
+ type="button"
1103
+ aria-current=${this.selectedThreadId === thread.id ? "true" : lit.nothing}
826
1104
  class="cpk-tl__item ${this.selectedThreadId === thread.id ? "cpk-tl__item--active" : ""}"
827
1105
  @click=${() => this.onThreadClick(thread.id)}
828
1106
  >
829
- <div class="cpk-tl__row1">
1107
+ <span class="cpk-tl__row1">
830
1108
  <span
831
1109
  class="cpk-tl__name ${!thread.name ? "cpk-tl__name--unnamed" : ""}"
832
1110
  >${(_thread$name = thread.name) !== null && _thread$name !== void 0 ? _thread$name : "Untitled"}</span
@@ -834,17 +1112,17 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
834
1112
  <span class="cpk-tl__time"
835
1113
  >${this.relativeTime(thread.updatedAt)}</span
836
1114
  >
837
- </div>
838
- <div class="cpk-tl__meta">
1115
+ </span>
1116
+ <span class="cpk-tl__meta">
839
1117
  <span class="cpk-tl__pill">${thread.agentId}</span>
840
1118
  ${thread.isExample ? lit.html`
841
1119
  <span class="cpk-tl__pill cpk-tl__pill--example">Example</span>
842
1120
  ` : lit.nothing}
843
- </div>
844
- </div>
1121
+ </span>
1122
+ </button>
845
1123
  `;
846
1124
  })}
847
- ${filtered.length === 0 ? lit.html`
1125
+ ${filtered.length === 0 && !this.suppressEmptyState ? lit.html`
848
1126
  <div class="cpk-tl__empty">
849
1127
  ${this.errorMessage ? lit.html`
850
1128
  <svg
@@ -899,6 +1177,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
899
1177
  threads: { attribute: false },
900
1178
  selectedThreadId: { attribute: false },
901
1179
  errorMessage: { attribute: false },
1180
+ suppressEmptyState: { attribute: false },
902
1181
  _query: { state: true }
903
1182
  };
904
1183
  CpkThreadList.styles = lit.css`
@@ -953,7 +1232,18 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
953
1232
 
954
1233
  /* ── Thread item ── */
955
1234
  .cpk-tl__item {
1235
+ appearance: none;
1236
+ display: block;
1237
+ box-sizing: border-box;
1238
+ width: 100%;
1239
+ margin: 0;
1240
+ border: 0;
1241
+ border-radius: 0;
956
1242
  padding: 11px 13px;
1243
+ background: transparent;
1244
+ color: inherit;
1245
+ font: inherit;
1246
+ text-align: left;
957
1247
  cursor: pointer;
958
1248
  border-bottom: 1px solid #e9e9ef;
959
1249
  border-left: 3px solid transparent;
@@ -973,6 +1263,13 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
973
1263
  background: #bec2ff33;
974
1264
  }
975
1265
 
1266
+ .cpk-tl__item:focus-visible {
1267
+ outline-color: #5558b2;
1268
+ outline-offset: -2px;
1269
+ outline-style: solid;
1270
+ outline-width: 2px;
1271
+ }
1272
+
976
1273
  .cpk-tl__row1 {
977
1274
  display: flex;
978
1275
  align-items: center;
@@ -991,7 +1288,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
991
1288
  }
992
1289
 
993
1290
  .cpk-tl__name--unnamed {
994
- color: #838389;
1291
+ color: #68686e;
995
1292
  font-style: italic;
996
1293
  font-weight: 400;
997
1294
  }
@@ -999,7 +1296,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
999
1296
  .cpk-tl__time {
1000
1297
  font-family: "Spline Sans Mono", monospace;
1001
1298
  font-size: 10px;
1002
- color: #838389;
1299
+ color: #68686e;
1003
1300
  flex-shrink: 0;
1004
1301
  }
1005
1302
 
@@ -1024,14 +1321,14 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1024
1321
 
1025
1322
  .cpk-tl__pill--example {
1026
1323
  background: rgba(133, 236, 206, 0.22);
1027
- color: #189370;
1324
+ color: #087653;
1028
1325
  }
1029
1326
 
1030
1327
  /* ── Empty state ── */
1031
1328
  .cpk-tl__empty {
1032
1329
  padding: 32px 16px;
1033
1330
  text-align: center;
1034
- color: #838389;
1331
+ color: #68686e;
1035
1332
  font-size: 12px;
1036
1333
  display: flex;
1037
1334
  flex-direction: column;
@@ -1087,10 +1384,12 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1087
1384
  this._messagesAbort = null;
1088
1385
  this._eventsAbort = null;
1089
1386
  this._stateAbort = null;
1387
+ this._hasConnectedOnce = false;
1090
1388
  this._dividerResizing = false;
1091
1389
  this._dividerPointerId = -1;
1092
1390
  this._dividerStartX = 0;
1093
1391
  this._dividerStartWidth = 0;
1392
+ this.domIdPrefix = `cpk-thread-detail-${CpkThreadInspector.nextDomId++}`;
1094
1393
  this.onDetailDividerDown = (event) => {
1095
1394
  this._dividerResizing = true;
1096
1395
  this._dividerPointerId = event.pointerId;
@@ -1140,6 +1439,31 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1140
1439
  if (id === "state") return this.renderState();
1141
1440
  return this.renderEvents();
1142
1441
  }
1442
+ /** Returns the stable DOM ID for one tab in this inspector instance. */
1443
+ tabDomId(id) {
1444
+ return `${this.domIdPrefix}-tab-${id}`;
1445
+ }
1446
+ /** Returns the stable DOM ID for the panel controlled by one tab. */
1447
+ panelDomId(id) {
1448
+ return `${this.domIdPrefix}-panel-${id}`;
1449
+ }
1450
+ /** Selects and focuses the tab targeted by an ARIA tabs navigation key. */
1451
+ handleTabKeyDown(event, currentId) {
1452
+ var _this$shadowRoot;
1453
+ const currentIndex = CpkThreadInspector.TAB_LIST.findIndex((tab) => tab.id === currentId);
1454
+ if (currentIndex < 0) return;
1455
+ let targetIndex = null;
1456
+ if (event.key === "ArrowRight") targetIndex = (currentIndex + 1) % CpkThreadInspector.TAB_LIST.length;
1457
+ else if (event.key === "ArrowLeft") targetIndex = (currentIndex - 1 + CpkThreadInspector.TAB_LIST.length) % CpkThreadInspector.TAB_LIST.length;
1458
+ else if (event.key === "Home") targetIndex = 0;
1459
+ else if (event.key === "End") targetIndex = CpkThreadInspector.TAB_LIST.length - 1;
1460
+ if (targetIndex === null) return;
1461
+ const target = CpkThreadInspector.TAB_LIST[targetIndex];
1462
+ if (!target) return;
1463
+ event.preventDefault();
1464
+ this.activateTab(target.id);
1465
+ (_this$shadowRoot = this.shadowRoot) === null || _this$shadowRoot === void 0 || (_this$shadowRoot = _this$shadowRoot.querySelector(`#${this.tabDomId(target.id)}`)) === null || _this$shadowRoot === void 0 || _this$shadowRoot.focus();
1466
+ }
1143
1467
  activateTab(id) {
1144
1468
  if (this._tab === id) return;
1145
1469
  const isFirstActivation = !this._activatedTabs.has(id);
@@ -1167,6 +1491,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1167
1491
  }
1168
1492
  }
1169
1493
  updated(_changed) {
1494
+ if (!this.isConnected) return;
1170
1495
  const loadKey = this.currentLoadKey();
1171
1496
  if (loadKey !== this._lastLoadKey) {
1172
1497
  this._lastLoadKey = loadKey;
@@ -1190,6 +1515,16 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1190
1515
  this.fetchMessages(this.threadId, true);
1191
1516
  }
1192
1517
  }
1518
+ connectedCallback() {
1519
+ super.connectedCallback();
1520
+ if (this._hasConnectedOnce) this.requestUpdate();
1521
+ this._hasConnectedOnce = true;
1522
+ }
1523
+ disconnectedCallback() {
1524
+ super.disconnectedCallback();
1525
+ this.resetLoadedThreadData();
1526
+ this._lastLoadKey = null;
1527
+ }
1193
1528
  canFetchMessages() {
1194
1529
  var _this$provider;
1195
1530
  return !!((_this$provider = this.provider) === null || _this$provider === void 0 ? void 0 : _this$provider.getMessages) || !!this.runtimeUrl && this.threadInspectionAvailable;
@@ -1864,12 +2199,22 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1864
2199
  <div class="cpk-td__left">
1865
2200
  <!-- Tab bar -->
1866
2201
  <div class="cpk-td__tabs-header">
1867
- <div class="cpk-td__tab-group" role="tablist">
2202
+ <div
2203
+ class="cpk-td__tab-group"
2204
+ role="tablist"
2205
+ aria-label="Thread detail views"
2206
+ >
1868
2207
  ${CpkThreadInspector.TAB_LIST.map((tab) => lit.html`
1869
2208
  <button
2209
+ id=${this.tabDomId(tab.id)}
2210
+ type="button"
1870
2211
  role="tab"
2212
+ aria-controls=${this.panelDomId(tab.id)}
2213
+ aria-selected=${this._tab === tab.id ? "true" : "false"}
2214
+ tabindex=${this._tab === tab.id ? "0" : "-1"}
1871
2215
  class="cpk-td__tab ${this._tab === tab.id ? "cpk-td__tab--active" : ""}"
1872
2216
  @click=${() => this.activateTab(tab.id)}
2217
+ @keydown=${(event) => this.handleTabKeyDown(event, tab.id)}
1873
2218
  >
1874
2219
  ${tab.label}
1875
2220
  </button>
@@ -1885,8 +2230,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1885
2230
  <div class="cpk-td__status">Loading…</div>
1886
2231
  ` : lit.nothing}
1887
2232
  ${CpkThreadInspector.TAB_LIST.map((tab) => this._activatedTabs.has(tab.id) ? lit.html`<div
2233
+ id=${this.panelDomId(tab.id)}
1888
2234
  class="cpk-td__panel"
1889
- style=${this._tab === tab.id && !this._panelInitializing ? "" : "display:none"}
2235
+ role="tabpanel"
2236
+ aria-labelledby=${this.tabDomId(tab.id)}
2237
+ ?hidden=${this._tab !== tab.id || this._panelInitializing}
1890
2238
  >
1891
2239
  ${this.renderTabContent(tab.id)}
1892
2240
  </div>` : lit.nothing)}
@@ -1920,42 +2268,58 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1920
2268
  `;
1921
2269
  }
1922
2270
  renderMetadataStrip() {
1923
- var _metadata$id, _metadata$endUserId;
2271
+ var _ref5, _metadata$name, _this$thread, _ref6, _metadata$id;
1924
2272
  const metadata = this.metadata;
1925
- const pills = [
1926
- {
1927
- label: "Thread",
1928
- value: (_metadata$id = metadata === null || metadata === void 0 ? void 0 : metadata.id) !== null && _metadata$id !== void 0 ? _metadata$id : this.threadId
1929
- },
2273
+ const pills = [{
2274
+ label: "Name",
2275
+ value: (_ref5 = (_metadata$name = metadata === null || metadata === void 0 ? void 0 : metadata.name) !== null && _metadata$name !== void 0 ? _metadata$name : (_this$thread = this.thread) === null || _this$thread === void 0 ? void 0 : _this$thread.name) !== null && _ref5 !== void 0 ? _ref5 : "Untitled"
2276
+ }, {
2277
+ label: "ID",
2278
+ value: (_ref6 = (_metadata$id = metadata === null || metadata === void 0 ? void 0 : metadata.id) !== null && _metadata$id !== void 0 ? _metadata$id : this.threadId) !== null && _ref6 !== void 0 ? _ref6 : "—",
2279
+ wrap: true
2280
+ }];
2281
+ for (const fact of [
1930
2282
  {
1931
2283
  label: "Agent",
1932
2284
  value: metadata === null || metadata === void 0 ? void 0 : metadata.agentId
1933
2285
  },
1934
2286
  {
1935
- label: "End user",
1936
- value: (_metadata$endUserId = metadata === null || metadata === void 0 ? void 0 : metadata.endUserId) !== null && _metadata$endUserId !== void 0 ? _metadata$endUserId : metadata === null || metadata === void 0 ? void 0 : metadata.createdById
2287
+ label: "Created",
2288
+ value: metadata === null || metadata === void 0 ? void 0 : metadata.createdAt
1937
2289
  },
1938
2290
  {
1939
- label: "Status",
1940
- value: metadata === null || metadata === void 0 ? void 0 : metadata.status
2291
+ label: "Updated",
2292
+ value: metadata === null || metadata === void 0 ? void 0 : metadata.updatedAt
1941
2293
  }
1942
- ].filter((pill) => pill.value != null && pill.value !== "");
2294
+ ]) {
2295
+ if (fact.value == null || fact.value === "") continue;
2296
+ pills.push({
2297
+ label: fact.label,
2298
+ value: fact.label === "Created" || fact.label === "Updated" ? this.fmtTime(fact.value) : fact.value
2299
+ });
2300
+ }
1943
2301
  const bulkControls = this.renderActiveBulkControls();
1944
- if (pills.length === 0 && bulkControls === lit.nothing) return lit.nothing;
1945
2302
  return lit.html`
1946
- <div class="cpk-td__metadata-strip" aria-label="Thread metadata">
2303
+ <div
2304
+ class="cpk-td__metadata-strip"
2305
+ role="group"
2306
+ aria-label="Thread metadata"
2307
+ >
1947
2308
  <div class="cpk-td__metadata-pills">
1948
- ${pills.map((pill) => {
1949
- var _pill$value;
1950
- return lit.html`
1951
- <span class="cpk-td__metadata-pill" title=${(_pill$value = pill.value) !== null && _pill$value !== void 0 ? _pill$value : ""}>
2309
+ ${pills.map((pill) => lit.html`
2310
+ <span
2311
+ class="cpk-td__metadata-pill ${pill.wrap ? "cpk-td__metadata-pill--wrap" : ""}"
2312
+ role="group"
2313
+ title=${pill.value}
2314
+ aria-label=${`${pill.label}: ${pill.value}`}
2315
+ >
1952
2316
  <span class="cpk-td__metadata-label">${pill.label}</span>
1953
- <span class="cpk-td__metadata-value"
1954
- >${this.shortId(pill.value)}</span
2317
+ <span
2318
+ class="cpk-td__metadata-value ${pill.wrap ? "cpk-td__metadata-value--wrap" : ""}"
2319
+ >${pill.value}</span
1955
2320
  >
1956
2321
  </span>
1957
- `;
1958
- })}
2322
+ `)}
1959
2323
  </div>
1960
2324
  ${bulkControls}
1961
2325
  </div>
@@ -2013,8 +2377,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2013
2377
  this._tab = "raw-events";
2014
2378
  this.requestUpdate();
2015
2379
  requestAnimationFrame(() => {
2016
- var _this$shadowRoot, _source$scrollIntoVie;
2017
- const source = (_this$shadowRoot = this.shadowRoot) === null || _this$shadowRoot === void 0 ? void 0 : _this$shadowRoot.querySelector(`[data-source-index="${sourceIndex}"]`);
2380
+ var _this$shadowRoot2, _source$scrollIntoVie;
2381
+ const source = (_this$shadowRoot2 = this.shadowRoot) === null || _this$shadowRoot2 === void 0 ? void 0 : _this$shadowRoot2.querySelector(`[data-source-index="${sourceIndex}"]`);
2018
2382
  source === null || source === void 0 || (_source$scrollIntoVie = source.scrollIntoView) === null || _source$scrollIntoVie === void 0 || _source$scrollIntoVie.call(source, { block: "center" });
2019
2383
  });
2020
2384
  }
@@ -2049,8 +2413,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2049
2413
  <div class="cpk-td__empty-state">
2050
2414
  <span>No timeline events captured</span>
2051
2415
  <span class="cpk-td__empty-hint"
2052
- >Timeline rows are normalized from AG-UI events. Open Raw AG-UI Events or
2053
- State to inspect the available thread data.</span
2416
+ >Timeline rows are normalized from AG-UI events. Open AG-UI Events or State
2417
+ to inspect the available thread data.</span
2054
2418
  >
2055
2419
  </div>
2056
2420
  `;
@@ -2224,7 +2588,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2224
2588
  <svg width="10" height="10" viewBox="0 0 10 10" fill="none">
2225
2589
  <path
2226
2590
  d="M1 9C1 9 2 7 5 7C8 7 9 9 9 9M5 1C5 1 7 2.5 7 4.5C7 6.5 5 7 5 7C5 7 3 6.5 3 4.5C3 2.5 5 1 5 1Z"
2227
- stroke="#189370"
2591
+ stroke="#087653"
2228
2592
  stroke-width="1.2"
2229
2593
  stroke-linecap="round"
2230
2594
  stroke-linejoin="round"
@@ -2449,7 +2813,7 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
2449
2813
  `;
2450
2814
  }
2451
2815
  renderDetailPanel() {
2452
- var _metadata$name, _metadata$agentId, _metadata$endUserId2, _metadata$createdById, _metadata$status;
2816
+ var _ref7, _metadata$id2, _metadata$name2, _metadata$agentId, _metadata$endUserId, _metadata$createdById, _metadata$status;
2453
2817
  const counts = this.activityCounts;
2454
2818
  const metadata = this.metadata;
2455
2819
  return lit.html`
@@ -2458,12 +2822,12 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
2458
2822
  <div class="cpk-tdp__row">
2459
2823
  <span class="cpk-tdp__label">ID</span>
2460
2824
  <span class="cpk-tdp__value cpk-tdp__value--wrap"
2461
- >${this.shortId(metadata === null || metadata === void 0 ? void 0 : metadata.id)}</span
2825
+ >${(_ref7 = (_metadata$id2 = metadata === null || metadata === void 0 ? void 0 : metadata.id) !== null && _metadata$id2 !== void 0 ? _metadata$id2 : this.threadId) !== null && _ref7 !== void 0 ? _ref7 : "—"}</span
2462
2826
  >
2463
2827
  </div>
2464
2828
  <div class="cpk-tdp__row">
2465
2829
  <span class="cpk-tdp__label">Name</span>
2466
- <span class="cpk-tdp__value">${(_metadata$name = metadata === null || metadata === void 0 ? void 0 : metadata.name) !== null && _metadata$name !== void 0 ? _metadata$name : "—"}</span>
2830
+ <span class="cpk-tdp__value">${(_metadata$name2 = metadata === null || metadata === void 0 ? void 0 : metadata.name) !== null && _metadata$name2 !== void 0 ? _metadata$name2 : "—"}</span>
2467
2831
  </div>
2468
2832
  <div class="cpk-tdp__row">
2469
2833
  <span class="cpk-tdp__label">Agent</span>
@@ -2474,7 +2838,7 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
2474
2838
  <div class="cpk-tdp__row">
2475
2839
  <span class="cpk-tdp__label">End user</span>
2476
2840
  <span class="cpk-tdp__value cpk-tdp__value--truncate"
2477
- >${(_metadata$endUserId2 = metadata === null || metadata === void 0 ? void 0 : metadata.endUserId) !== null && _metadata$endUserId2 !== void 0 ? _metadata$endUserId2 : "—"}</span
2841
+ >${(_metadata$endUserId = metadata === null || metadata === void 0 ? void 0 : metadata.endUserId) !== null && _metadata$endUserId !== void 0 ? _metadata$endUserId : "—"}</span
2478
2842
  >
2479
2843
  </div>
2480
2844
  <div class="cpk-tdp__row">
@@ -2558,15 +2922,16 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
2558
2922
  _panelInitializing: { state: true },
2559
2923
  _activatedTabs: { state: true }
2560
2924
  };
2925
+ CpkThreadInspector.nextDomId = 1;
2561
2926
  CpkThreadInspector.COLLAPSE_THRESHOLD = 800;
2562
2927
  CpkThreadInspector.TAB_LIST = [
2563
2928
  {
2564
2929
  id: "timeline",
2565
- label: "Timeline"
2930
+ label: "Messages"
2566
2931
  },
2567
2932
  {
2568
2933
  id: "raw-events",
2569
- label: "Raw AG-UI Events"
2934
+ label: "AG-UI Events"
2570
2935
  },
2571
2936
  {
2572
2937
  id: "state",
@@ -2637,7 +3002,7 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
2637
3002
  border-bottom: 2px solid transparent;
2638
3003
  cursor: pointer;
2639
3004
  background: transparent;
2640
- color: #838389;
3005
+ color: #68686e;
2641
3006
  transition:
2642
3007
  color 0.12s,
2643
3008
  border-color 0.12s;
@@ -2648,6 +3013,12 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
2648
3013
  color: #010507;
2649
3014
  }
2650
3015
 
3016
+ .cpk-td__tab:focus-visible {
3017
+ outline: 2px solid #5558b2;
3018
+ outline-offset: -3px;
3019
+ border-radius: 4px;
3020
+ }
3021
+
2651
3022
  .cpk-td__tab--active {
2652
3023
  color: #010507;
2653
3024
  border-bottom-color: #bec2ff;
@@ -2667,7 +3038,7 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
2667
3038
  border: none;
2668
3039
  border-left: 1px solid #dbdbe5;
2669
3040
  background: transparent;
2670
- color: #838389;
3041
+ color: #68686e;
2671
3042
  cursor: pointer;
2672
3043
  flex-shrink: 0;
2673
3044
  transition:
@@ -2736,7 +3107,7 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
2736
3107
  }
2737
3108
 
2738
3109
  .cpk-td__metadata-label {
2739
- color: #838389;
3110
+ color: #68686e;
2740
3111
  text-transform: uppercase;
2741
3112
  font-size: 9px;
2742
3113
  }
@@ -2746,6 +3117,18 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
2746
3117
  text-overflow: ellipsis;
2747
3118
  }
2748
3119
 
3120
+ .cpk-td__metadata-pill--wrap {
3121
+ max-width: 100%;
3122
+ white-space: normal;
3123
+ }
3124
+
3125
+ .cpk-td__metadata-value--wrap {
3126
+ overflow: visible;
3127
+ text-overflow: clip;
3128
+ white-space: normal;
3129
+ overflow-wrap: anywhere;
3130
+ }
3131
+
2749
3132
  /*
2750
3133
  * Each tab's content is wrapped in this panel so the keep-mounted
2751
3134
  * inactive panels can be hidden via display:none without disturbing
@@ -2763,6 +3146,10 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
2763
3146
  flex-shrink: 0;
2764
3147
  }
2765
3148
 
3149
+ .cpk-td__panel[hidden] {
3150
+ display: none;
3151
+ }
3152
+
2766
3153
  /* ── Empty state ─────────────────────────────────────────────────── */
2767
3154
  .cpk-td__empty-state {
2768
3155
  flex: 1;
@@ -2771,14 +3158,14 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
2771
3158
  align-items: center;
2772
3159
  justify-content: center;
2773
3160
  gap: 8px;
2774
- color: #838389;
3161
+ color: #68686e;
2775
3162
  font-size: 13px;
2776
3163
  padding: 40px 0;
2777
3164
  }
2778
3165
 
2779
3166
  .cpk-td__empty-hint {
2780
3167
  font-size: 11px;
2781
- color: #838389;
3168
+ color: #68686e;
2782
3169
  text-align: center;
2783
3170
  max-width: 220px;
2784
3171
  line-height: 1.5;
@@ -2788,7 +3175,7 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
2788
3175
  .cpk-td__status {
2789
3176
  padding: 16px;
2790
3177
  font-size: 12px;
2791
- color: #838389;
3178
+ color: #68686e;
2792
3179
  text-align: center;
2793
3180
  }
2794
3181
 
@@ -2867,7 +3254,7 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
2867
3254
  font-family: "Spline Sans Mono", monospace;
2868
3255
  font-size: 10px;
2869
3256
  font-weight: 500;
2870
- color: #189370;
3257
+ color: #087653;
2871
3258
  text-transform: uppercase;
2872
3259
  flex: 1;
2873
3260
  }
@@ -2876,15 +3263,15 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
2876
3263
  font-family: "Spline Sans Mono", monospace;
2877
3264
  font-size: 9px;
2878
3265
  text-transform: uppercase;
2879
- color: #189370;
3266
+ color: #087653;
2880
3267
  }
2881
3268
 
2882
3269
  .cpk-td__tool-status--pending {
2883
- color: #996300;
3270
+ color: #8a5900;
2884
3271
  }
2885
3272
 
2886
3273
  .cpk-td__tool-chevron {
2887
- color: #838389;
3274
+ color: #68686e;
2888
3275
  font-size: 10px;
2889
3276
  }
2890
3277
 
@@ -2898,7 +3285,7 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
2898
3285
  font-family: "Spline Sans Mono", monospace;
2899
3286
  font-size: 9px;
2900
3287
  font-weight: 500;
2901
- color: #838389;
3288
+ color: #68686e;
2902
3289
  text-transform: uppercase;
2903
3290
  margin-bottom: 4px;
2904
3291
  letter-spacing: 0.3px;
@@ -2930,7 +3317,7 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
2930
3317
  background: rgba(133, 236, 206, 0.15);
2931
3318
  font-family: "Spline Sans Mono", monospace;
2932
3319
  font-size: 10px;
2933
- color: #189370;
3320
+ color: #087653;
2934
3321
  text-transform: uppercase;
2935
3322
  font-weight: 500;
2936
3323
  border-bottom: 1px solid #e9e9ef;
@@ -2952,7 +3339,7 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
2952
3339
  align-items: center;
2953
3340
  gap: 8px;
2954
3341
  padding: 5px 0;
2955
- color: #838389;
3342
+ color: #68686e;
2956
3343
  font-family: "Spline Sans Mono", monospace;
2957
3344
  font-size: 9px;
2958
3345
  text-transform: uppercase;
@@ -3009,7 +3396,7 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
3009
3396
  .cpk-td__timeline-time {
3010
3397
  font-family: "Spline Sans Mono", monospace;
3011
3398
  font-size: 9px;
3012
- color: #838389;
3399
+ color: #68686e;
3013
3400
  flex-shrink: 0;
3014
3401
  }
3015
3402
 
@@ -3187,7 +3574,7 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
3187
3574
  .cpk-td__event-time {
3188
3575
  font-family: "Spline Sans Mono", monospace;
3189
3576
  font-size: 9px;
3190
- color: #838389;
3577
+ color: #68686e;
3191
3578
  }
3192
3579
 
3193
3580
  .cpk-td__event-payload {
@@ -3259,7 +3646,7 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
3259
3646
  font-family: "Spline Sans Mono", monospace;
3260
3647
  font-size: 10px;
3261
3648
  font-weight: 500;
3262
- color: #838389;
3649
+ color: #68686e;
3263
3650
  text-transform: uppercase;
3264
3651
  letter-spacing: 0.6px;
3265
3652
  margin-bottom: 8px;
@@ -3280,7 +3667,7 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
3280
3667
  }
3281
3668
 
3282
3669
  .cpk-tdp__label {
3283
- color: #838389;
3670
+ color: #68686e;
3284
3671
  font-size: 11px;
3285
3672
  white-space: nowrap;
3286
3673
  flex-shrink: 0;
@@ -3662,7 +4049,7 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
3662
4049
  font-family: "Spline Sans Mono", monospace;
3663
4050
  font-size: 9px;
3664
4051
  margin-left: 4px;
3665
- color: #838389;
4052
+ color: #68686e;
3666
4053
  }
3667
4054
 
3668
4055
  /* ── List ── */
@@ -3729,7 +4116,7 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
3729
4116
  font-weight: 500;
3730
4117
  white-space: nowrap;
3731
4118
  background: #f0f0f5;
3732
- color: #838389;
4119
+ color: #68686e;
3733
4120
  }
3734
4121
 
3735
4122
  /* Content */
@@ -3751,7 +4138,7 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
3751
4138
 
3752
4139
  .cpk-ml__footer-threads {
3753
4140
  font-size: 10px;
3754
- color: #838389;
4141
+ color: #68686e;
3755
4142
  }
3756
4143
 
3757
4144
  .cpk-ml__footer-id {
@@ -3764,7 +4151,7 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
3764
4151
  .cpk-ml__empty {
3765
4152
  padding: 32px 16px;
3766
4153
  text-align: center;
3767
- color: #838389;
4154
+ color: #68686e;
3768
4155
  font-size: 12px;
3769
4156
  display: flex;
3770
4157
  flex-direction: column;
@@ -3845,7 +4232,7 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
3845
4232
  .cpk-ml__recall-clear {
3846
4233
  font-family: "Plus Jakarta Sans", sans-serif;
3847
4234
  font-size: 10px;
3848
- color: #838389;
4235
+ color: #68686e;
3849
4236
  background: none;
3850
4237
  border: none;
3851
4238
  cursor: pointer;
@@ -3856,7 +4243,7 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
3856
4243
  }
3857
4244
  .cpk-ml__recall-msg {
3858
4245
  font-size: 11px;
3859
- color: #838389;
4246
+ color: #68686e;
3860
4247
  line-height: 1.45;
3861
4248
  }
3862
4249
  .cpk-ml__recall-msg--error {
@@ -3880,7 +4267,7 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
3880
4267
  /* ── Scope badge variants ── */
3881
4268
  .cpk-ml__scope-badge--user {
3882
4269
  background: #f0f0f5;
3883
- color: #838389;
4270
+ color: #68686e;
3884
4271
  }
3885
4272
  .cpk-ml__scope-badge--project {
3886
4273
  background: #fef3c7;
@@ -3912,6 +4299,8 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
3912
4299
  this._recallQuery = "";
3913
4300
  this._recallSeq = 0;
3914
4301
  this.runtimeStatus = null;
4302
+ this.inspectorMetadataProjection = projectInspectorMetadata(void 0, void 0);
4303
+ this.metadataTelemetryFingerprints = /* @__PURE__ */ new Map();
3915
4304
  this.coreProperties = {};
3916
4305
  this.lastCoreError = null;
3917
4306
  this.agentSubscriptions = /* @__PURE__ */ new Map();
@@ -3933,8 +4322,19 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
3933
4322
  this.isOpen = false;
3934
4323
  this.draggedDuringInteraction = false;
3935
4324
  this.ignoreNextButtonClick = false;
3936
- this.selectedMenu = "ag-ui-events";
4325
+ this.selectedMenu = "threads";
4326
+ this.pendingPersistedMenu = null;
4327
+ this.hasResolvedCore = false;
4328
+ this.settingsOpen = false;
4329
+ this.lastSelectedMenuByGroup = {
4330
+ threads: "threads",
4331
+ agents: "ag-ui-events",
4332
+ learning: "memories"
4333
+ };
4334
+ this.lastScrolledAgentNavigationLayout = null;
3937
4335
  this.selectedThreadId = null;
4336
+ this.selectedRealThreadIsExplicit = false;
4337
+ this.selectedLocalExampleThreadId = null;
3938
4338
  this.threadListWidth = 290;
3939
4339
  this.threadDividerResizing = false;
3940
4340
  this.threadDividerPointerId = -1;
@@ -3944,7 +4344,10 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
3944
4344
  this._threadStoreSubscriptions = /* @__PURE__ */ new Map();
3945
4345
  this._threadsByAgent = /* @__PURE__ */ new Map();
3946
4346
  this._threadsErrorByAgent = /* @__PURE__ */ new Map();
4347
+ this._threadsLoadingByAgent = /* @__PURE__ */ new Map();
3947
4348
  this._ownedThreadStores = /* @__PURE__ */ new Map();
4349
+ this.threadCapabilityEnabled = null;
4350
+ this.threadCapabilityGeneration = 0;
3948
4351
  this.contextMenuOpen = false;
3949
4352
  this.dockMode = "floating";
3950
4353
  this.previousBodyMargins = null;
@@ -3977,18 +4380,28 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
3977
4380
  this.pendingBannerViewed = [];
3978
4381
  this.clickedBannerIds = /* @__PURE__ */ new Set();
3979
4382
  this.viewedThreadsTelemetryStates = /* @__PURE__ */ new Set();
3980
- this.viewedExampleThreadIds = /* @__PURE__ */ new Set();
3981
- this.selectedExampleThreadIds = /* @__PURE__ */ new Set();
4383
+ this.viewedExampleKinds = /* @__PURE__ */ new Set();
4384
+ this.selectedExampleKinds = /* @__PURE__ */ new Set();
3982
4385
  this.viewedExampleTourSteps = /* @__PURE__ */ new Set();
3983
4386
  this.exampleThreadProviders = /* @__PURE__ */ new Map();
3984
4387
  this.exampleTourDismissed = false;
3985
4388
  this.exampleTourActive = false;
3986
4389
  this.exampleTourStep = 0;
3987
4390
  this.exampleTourAutoShown = false;
3988
- this.threadsExampleOverviewVideoShouldLoad = false;
3989
- this.threadsExampleOverviewVideoReady = false;
4391
+ this.threadsExampleOverviewVideoState = "deferred";
4392
+ this.threadsExampleOverviewVideoLoaded = false;
4393
+ this.threadsExampleOverviewVideoReducedMotion = false;
3990
4394
  this.threadsExampleOverviewVideoLoadTimer = null;
3991
4395
  this.threadsExampleOverviewVideoIdleCallbackId = null;
4396
+ this.threadsExampleOverviewVideoElement = null;
4397
+ this.threadsExampleOverviewVideoListeners = null;
4398
+ this.threadsExampleOverviewVideoLifecycleGeneration = 0;
4399
+ this.threadsExampleOverviewVideoPlayAttemptGeneration = 0;
4400
+ this.threadsExampleOverviewVideoPlayPromise = null;
4401
+ this.threadsExampleOverviewVideoPlayOnNextBind = false;
4402
+ this.threadsSetupPromptCopyState = "idle";
4403
+ this.threadsSetupPromptCopyResetTimeoutId = null;
4404
+ this.threadsSetupPromptCopyGeneration = 0;
3992
4405
  this.contextState = {
3993
4406
  button: {
3994
4407
  position: {
@@ -4036,7 +4449,7 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
4036
4449
  const target = event.currentTarget;
4037
4450
  const context = (target === null || target === void 0 ? void 0 : target.dataset.dragContext) === "window" ? "window" : "button";
4038
4451
  const eventTarget = event.target;
4039
- if (context === "window" && (eventTarget === null || eventTarget === void 0 ? void 0 : eventTarget.closest("button"))) return;
4452
+ if (context === "window" && (eventTarget === null || eventTarget === void 0 ? void 0 : eventTarget.closest("button, a, nav"))) return;
4040
4453
  this.pointerContext = context;
4041
4454
  this.measureContext(context);
4042
4455
  event.preventDefault();
@@ -4184,8 +4597,10 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
4184
4597
  this.measureContext("button");
4185
4598
  this.applyAnchorPosition("button");
4186
4599
  this.measureContext("window");
4600
+ this.contextState.window.size = this.clampWindowSize(this.contextState.window.size);
4187
4601
  if (this.hasCustomPosition.window) this.applyAnchorPosition("window");
4188
4602
  else this.centerContext("window");
4603
+ this.requestUpdate();
4189
4604
  this.updateHostTransform();
4190
4605
  };
4191
4606
  this.contextOptions = [{
@@ -4198,29 +4613,36 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
4198
4613
  this.expandedTools = /* @__PURE__ */ new Set();
4199
4614
  this.expandedContextItems = /* @__PURE__ */ new Set();
4200
4615
  this.copiedContextItems = /* @__PURE__ */ new Set();
4201
- this.handleTalkToEngineerClick = () => {
4616
+ this.handleInspectorMetadataActionClick = (action, placement) => {
4202
4617
  var _this$core;
4203
- if ((_this$core = this.core) === null || _this$core === void 0 ? void 0 : _this$core.telemetryDisabled) return;
4204
- trackTalkToEngineerClicked(this.getThreadsTelemetryProps({
4205
- cta: "talk_to_engineer",
4206
- cta_surface: "threads_header"
4207
- }, { includeUrlAttribution: true }));
4618
+ if (!this.isOpen || this.runtimeStatus !== _copilotkit_core.CopilotKitCoreRuntimeConnectionStatus.Connected || ((_this$core = this.core) === null || _this$core === void 0 ? void 0 : _this$core.telemetryDisabled)) return;
4619
+ if (action.kind === "enable_intelligence") {
4620
+ this.handleThreadsIntelligenceSignupClick();
4621
+ return;
4622
+ }
4623
+ try {
4624
+ trackMetadataActionClicked({
4625
+ action_kind: action.kind,
4626
+ license_bucket: this.inspectorMetadataProjection.licenseState,
4627
+ ...this.getMetadataTelemetryContext(),
4628
+ action_placement: getMetadataActionPlacement(placement)
4629
+ });
4630
+ } catch (_unused3) {}
4208
4631
  };
4209
- this.handleThreadsIntelligenceSignupClick = () => {
4632
+ this.handleTalkToEngineerClick = () => {
4210
4633
  var _this$core2;
4211
4634
  if ((_this$core2 = this.core) === null || _this$core2 === void 0 ? void 0 : _this$core2.telemetryDisabled) return;
4212
- trackThreadsIntelligenceSignupClicked(this.getThreadsTelemetryProps({
4213
- cta: "signup",
4214
- cta_surface: "threads_locked"
4215
- }, { includeUrlAttribution: true }));
4635
+ trackTalkToEngineerClicked(this.getThreadsCtaTelemetryProps("talk_to_engineer", "threads_header"));
4216
4636
  };
4217
- this.handleThreadsTalkToEngineerClick = () => {
4637
+ this.handleThreadsIntelligenceSignupClick = () => {
4218
4638
  var _this$core3;
4219
4639
  if ((_this$core3 = this.core) === null || _this$core3 === void 0 ? void 0 : _this$core3.telemetryDisabled) return;
4220
- trackThreadsTalkToEngineerClicked(this.getThreadsTelemetryProps({
4221
- cta: "talk_to_engineer",
4222
- cta_surface: "threads_locked"
4223
- }, { includeUrlAttribution: true }));
4640
+ trackThreadsIntelligenceSignupClicked(this.getThreadsCtaTelemetryProps("signup", "threads_locked"));
4641
+ };
4642
+ this.handleThreadsTalkToEngineerClick = () => {
4643
+ var _this$core4;
4644
+ if ((_this$core4 = this.core) === null || _this$core4 === void 0 ? void 0 : _this$core4.telemetryDisabled) return;
4645
+ trackThreadsTalkToEngineerClicked(this.getThreadsCtaTelemetryProps("talk_to_engineer", "threads_locked"));
4224
4646
  };
4225
4647
  this.handleThreadDividerPointerDown = (event) => {
4226
4648
  this.threadDividerResizing = true;
@@ -4242,9 +4664,52 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
4242
4664
  if (target.hasPointerCapture(this.threadDividerPointerId)) target.releasePointerCapture(this.threadDividerPointerId);
4243
4665
  this.threadDividerResizing = false;
4244
4666
  };
4245
- this.handleThreadsExampleOverviewVideoLoaded = () => {
4246
- this.threadsExampleOverviewVideoReady = true;
4667
+ this.handleThreadsExampleOverviewVideoControl = () => {
4668
+ const video = this.threadsExampleOverviewVideoElement;
4669
+ if (!video) return;
4670
+ if (this.threadsExampleOverviewVideoState === "playing") {
4671
+ this.invalidateThreadsExampleOverviewVideoPlay();
4672
+ try {
4673
+ video.pause();
4674
+ } catch (_unused4) {}
4675
+ this.threadsExampleOverviewVideoState = "ready";
4676
+ this.requestUpdate();
4677
+ return;
4678
+ }
4679
+ if (this.threadsExampleOverviewVideoState === "failed") {
4680
+ this.cleanupThreadsExampleOverviewVideo();
4681
+ if (!this.isConnected || !video.isConnected) return;
4682
+ this.threadsExampleOverviewVideoPlayOnNextBind = true;
4683
+ this.requestUpdate();
4684
+ return;
4685
+ }
4686
+ this.cancelThreadsExampleOverviewVideoGate();
4687
+ const lifecycleGeneration = this.threadsExampleOverviewVideoLifecycleGeneration;
4688
+ if (this.threadsExampleOverviewVideoState === "deferred") {
4689
+ this.activateThreadsExampleOverviewVideo(video, lifecycleGeneration, true);
4690
+ return;
4691
+ }
4692
+ this.playThreadsExampleOverviewVideo(video, lifecycleGeneration);
4693
+ };
4694
+ this.handleThreadsSetupPromptCopy = async () => {
4695
+ var _navigator$clipboard;
4696
+ const generation = this.threadsSetupPromptCopyGeneration += 1;
4697
+ if (this.threadsSetupPromptCopyResetTimeoutId !== null) {
4698
+ window.clearTimeout(this.threadsSetupPromptCopyResetTimeoutId);
4699
+ this.threadsSetupPromptCopyResetTimeoutId = null;
4700
+ }
4701
+ this.threadsSetupPromptCopyState = "idle";
4247
4702
  this.requestUpdate();
4703
+ if (typeof navigator === "undefined" || !((_navigator$clipboard = navigator.clipboard) === null || _navigator$clipboard === void 0 ? void 0 : _navigator$clipboard.writeText)) {
4704
+ this.showThreadsSetupPromptCopyState("error", generation);
4705
+ return;
4706
+ }
4707
+ try {
4708
+ await navigator.clipboard.writeText(THREADS_RUNTIME_SETUP_PROMPT);
4709
+ this.showThreadsSetupPromptCopyState("copied", generation);
4710
+ } catch (_unused5) {
4711
+ this.showThreadsSetupPromptCopyState("error", generation);
4712
+ }
4248
4713
  };
4249
4714
  this.handleClearEvents = () => {
4250
4715
  if (this.selectedContext === "all-agents") {
@@ -4274,7 +4739,7 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
4274
4739
  };
4275
4740
  this.copyResetTimeouts = /* @__PURE__ */ new WeakMap();
4276
4741
  this.handleAnnouncementContentClick = (event) => {
4277
- var _button$getAttribute, _navigator$clipboard;
4742
+ var _button$getAttribute, _navigator$clipboard2;
4278
4743
  const target = event.target instanceof HTMLElement ? event.target : null;
4279
4744
  const button = target === null || target === void 0 ? void 0 : target.closest(".announcement-code__copy");
4280
4745
  if (!(button instanceof HTMLButtonElement)) {
@@ -4300,7 +4765,7 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
4300
4765
  }, 1500);
4301
4766
  this.copyResetTimeouts.set(button, id);
4302
4767
  };
4303
- if (typeof navigator !== "undefined" && ((_navigator$clipboard = navigator.clipboard) === null || _navigator$clipboard === void 0 ? void 0 : _navigator$clipboard.writeText)) navigator.clipboard.writeText(code).then(showCopied, () => {});
4768
+ if (typeof navigator !== "undefined" && ((_navigator$clipboard2 = navigator.clipboard) === null || _navigator$clipboard2 === void 0 ? void 0 : _navigator$clipboard2.writeText)) navigator.clipboard.writeText(code).then(showCopied, () => {});
4304
4769
  };
4305
4770
  }
4306
4771
  get core() {
@@ -4310,7 +4775,11 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
4310
4775
  const oldValue = this._core;
4311
4776
  if (oldValue === value) return;
4312
4777
  this.detachFromCore();
4778
+ const hadResolvedCore = this.hasResolvedCore;
4313
4779
  this._core = value !== null && value !== void 0 ? value : null;
4780
+ if (this._core) this.hasResolvedCore = true;
4781
+ if (!hadResolvedCore && this._core) this.resolvePendingPersistedMenu();
4782
+ else if (hadResolvedCore) this.reconcileSelectedMenuVisibility();
4314
4783
  this.requestUpdate("core", oldValue);
4315
4784
  if (this._core) this.attachToCore(this._core);
4316
4785
  }
@@ -4357,6 +4826,46 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
4357
4826
  }
4358
4827
  ];
4359
4828
  }
4829
+ /** Return the primary navigation group that owns a legacy leaf key. */
4830
+ getGroupForMenu(key) {
4831
+ for (const group of INSPECTOR_PRIMARY_NAVIGATION) if (INSPECTOR_GROUPS[group.key].some((menuKey) => menuKey === key)) return group.key;
4832
+ return "threads";
4833
+ }
4834
+ /** Return the primary group for the current legacy leaf selection. */
4835
+ get selectedGroup() {
4836
+ return this.getGroupForMenu(this.selectedMenu);
4837
+ }
4838
+ /** Return only currently visible legacy leaves owned by a group. */
4839
+ getVisibleMenuItemsForGroup(group) {
4840
+ return this.menuItems.filter((item) => INSPECTOR_GROUPS[group].some((menuKey) => menuKey === item.key));
4841
+ }
4842
+ /** Resolve a group's last visible leaf, falling back to its first leaf. */
4843
+ getMenuForGroup(group) {
4844
+ var _ref8, _visibleItems$find$ke, _visibleItems$find, _visibleItems$;
4845
+ const visibleItems = this.getVisibleMenuItemsForGroup(group);
4846
+ const rememberedMenu = this.lastSelectedMenuByGroup[group];
4847
+ return (_ref8 = (_visibleItems$find$ke = (_visibleItems$find = visibleItems.find((item) => item.key === rememberedMenu)) === null || _visibleItems$find === void 0 ? void 0 : _visibleItems$find.key) !== null && _visibleItems$find$ke !== void 0 ? _visibleItems$find$ke : (_visibleItems$ = visibleItems[0]) === null || _visibleItems$ === void 0 ? void 0 : _visibleItems$.key) !== null && _ref8 !== void 0 ? _ref8 : "threads";
4848
+ }
4849
+ /** Replace a leaf that became hidden with its group's first visible leaf. */
4850
+ reconcileSelectedMenuVisibility() {
4851
+ var _this$getVisibleMenuI;
4852
+ if (this.menuItems.some((item) => item.key === this.selectedMenu)) return;
4853
+ const group = this.getGroupForMenu(this.selectedMenu);
4854
+ const fallbackMenu = (_this$getVisibleMenuI = this.getVisibleMenuItemsForGroup(group)[0]) === null || _this$getVisibleMenuI === void 0 ? void 0 : _this$getVisibleMenuI.key;
4855
+ this.selectedMenu = fallbackMenu !== null && fallbackMenu !== void 0 ? fallbackMenu : "threads";
4856
+ this.lastSelectedMenuByGroup[group] = this.selectedMenu;
4857
+ this.persistState();
4858
+ }
4859
+ /** Open a primary group at its last currently visible legacy leaf. */
4860
+ handleGroupSelect(group) {
4861
+ this.handleMenuSelect(this.getMenuForGroup(group));
4862
+ }
4863
+ /** Toggle Settings without replacing or persisting the active legacy leaf. */
4864
+ handleSettingsToggle() {
4865
+ this.settingsOpen = !this.settingsOpen;
4866
+ this.contextMenuOpen = false;
4867
+ this.requestUpdate();
4868
+ }
4360
4869
  getThreadServiceStatus() {
4361
4870
  var _this$_core$threadEnd;
4362
4871
  if (!this._core) return "unknown";
@@ -4364,10 +4873,34 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
4364
4873
  return ((_this$_core$threadEnd = this._core.threadEndpoints) === null || _this$_core$threadEnd === void 0 ? void 0 : _this$_core$threadEnd.list) === false ? "unavailable" : "available";
4365
4874
  }
4366
4875
  areThreadEndpointsAvailable() {
4367
- return this.getThreadServiceStatus() !== "unavailable";
4876
+ var _this$_core3;
4877
+ const endpoints = (_this$_core3 = this._core) === null || _this$_core3 === void 0 ? void 0 : _this$_core3.threadEndpoints;
4878
+ return endpoints !== null && typeof endpoints === "object" && endpoints.list !== false;
4879
+ }
4880
+ synchronizeThreadCapability() {
4881
+ const enabled = this.areThreadEndpointsAvailable();
4882
+ if (this.threadCapabilityEnabled === enabled) return;
4883
+ this.threadCapabilityEnabled = enabled;
4884
+ this.threadCapabilityGeneration += 1;
4885
+ if (enabled) {
4886
+ const core = this.core;
4887
+ if (!core) return;
4888
+ const threadStores = typeof core.getThreadStores === "function" ? core.getThreadStores() : {};
4889
+ for (const [agentId, store] of Object.entries(threadStores)) this.subscribeToThreadStore(agentId, store);
4890
+ for (const agent of Object.values(core.agents)) if (agent === null || agent === void 0 ? void 0 : agent.agentId) this.ensureOwnedThreadStore(agent.agentId);
4891
+ return;
4892
+ }
4893
+ this.teardownThreadStoreSubscriptions();
4894
+ this.teardownOwnedThreadStores();
4895
+ if (this.selectedThreadId !== this.selectedLocalExampleThreadId) {
4896
+ this.selectedThreadId = null;
4897
+ this.selectedLocalExampleThreadId = null;
4898
+ }
4899
+ this.selectedRealThreadIsExplicit = false;
4900
+ this.requestUpdate();
4368
4901
  }
4369
4902
  getActiveThreadsState() {
4370
- var _this$_threadsByAgent;
4903
+ var _this$_threadsByAgent, _this$_threadsLoading;
4371
4904
  const displayThreads = this.selectedContext === "all-agents" ? this._threads : (_this$_threadsByAgent = this._threadsByAgent.get(this.selectedContext)) !== null && _this$_threadsByAgent !== void 0 ? _this$_threadsByAgent : [];
4372
4905
  let threadsErrorMessage = null;
4373
4906
  if (this.selectedContext === "all-agents") {
@@ -4378,29 +4911,74 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
4378
4911
  var _this$_threadsErrorBy, _this$_threadsErrorBy2;
4379
4912
  threadsErrorMessage = (_this$_threadsErrorBy = (_this$_threadsErrorBy2 = this._threadsErrorByAgent.get(this.selectedContext)) === null || _this$_threadsErrorBy2 === void 0 ? void 0 : _this$_threadsErrorBy2.message) !== null && _this$_threadsErrorBy !== void 0 ? _this$_threadsErrorBy : null;
4380
4913
  }
4914
+ const threadsLoading = this.selectedContext === "all-agents" ? Array.from(this._threadsLoadingByAgent.values()).some(Boolean) : (_this$_threadsLoading = this._threadsLoadingByAgent.get(this.selectedContext)) !== null && _this$_threadsLoading !== void 0 ? _this$_threadsLoading : false;
4381
4915
  return {
4382
4916
  displayThreads,
4383
- threadsErrorMessage
4917
+ threadsErrorMessage,
4918
+ threadsLoading
4384
4919
  };
4385
4920
  }
4386
- getThreadsTelemetryProps(extra = {}, options = {}) {
4387
- var _this$core4, _this$core$licenseSta, _this$core5, _this$core$runtimeMod, _this$core6, _this$core7, _this$core$telemetryD, _this$core8;
4388
- const distinctId = options.includeUrlAttribution && !((_this$core4 = this.core) === null || _this$core4 === void 0 ? void 0 : _this$core4.telemetryDisabled) ? getTelemetryDistinctIdForUrl() : null;
4921
+ /** Bucket trusted usage without retaining exact counts or limits. */
4922
+ getThreadsUsageBucket() {
4923
+ const usage = this.inspectorMetadataProjection.usage;
4924
+ if (!usage) return "absent";
4925
+ if (usage.used === 0) return "empty";
4926
+ if (usage.limit.kind === "finite") return usage.used < usage.limit.value ? "within_limit" : "at_or_over_limit";
4927
+ if (usage.limit.kind === "unlimited") return "unlimited";
4928
+ return "unknown_limit";
4929
+ }
4930
+ /** Classify finite usage for render-only capacity copy and color. */
4931
+ getThreadsCapacityState() {
4932
+ const usage = this.inspectorMetadataProjection.usage;
4933
+ if (!usage || usage.limit.kind !== "finite") return void 0;
4934
+ if (usage.used >= usage.limit.value) return "critical";
4935
+ const warningThreshold = usage.limit.value - Math.floor(usage.limit.value / 10);
4936
+ return usage.used >= warningThreshold ? "warning" : "normal";
4937
+ }
4938
+ /** Bucket trusted expiry data independently from the usage-limit bucket. */
4939
+ getThreadsExpiryBucket() {
4940
+ const usage = this.inspectorMetadataProjection.usage;
4941
+ if (!usage || !Object.prototype.hasOwnProperty.call(usage, "expiringSoonCount")) return "unavailable";
4942
+ if (usage.expiringSoonCount === 0) return "zero";
4943
+ return typeof usage.expiringSoonCount === "number" && usage.expiringSoonCount > 0 ? "positive" : "unavailable";
4944
+ }
4945
+ /** Report only real rows visible in the active, settled Threads view. */
4946
+ hasActiveVisibleThreads() {
4947
+ if (this.selectedMenu !== "threads" || this.settingsOpen || !this.areThreadEndpointsAvailable()) return false;
4948
+ const { displayThreads, threadsErrorMessage, threadsLoading } = this.getActiveThreadsState();
4949
+ return !threadsErrorMessage && !threadsLoading && displayThreads.length > 0;
4950
+ }
4951
+ /** Build the closed common property set shared by all Thread events. */
4952
+ getThreadsTelemetryProps() {
4953
+ var _this$core$licenseSta, _this$core5, _this$core$runtimeMod, _this$core6, _this$core7;
4389
4954
  const threadServiceStatus = this.getThreadServiceStatus();
4390
4955
  return {
4391
- posthog_distinct_id: distinctId !== null && distinctId !== void 0 ? distinctId : void 0,
4392
4956
  intelligence_status: threadServiceStatus === "available" ? "intelligence_enabled" : threadServiceStatus === "unavailable" ? "intelligence_not_enabled" : "unknown",
4393
4957
  thread_service_status: threadServiceStatus,
4394
4958
  license_status: (_this$core$licenseSta = (_this$core5 = this.core) === null || _this$core5 === void 0 ? void 0 : _this$core5.licenseStatus) !== null && _this$core$licenseSta !== void 0 ? _this$core$licenseSta : void 0,
4395
4959
  runtime_mode: (_this$core$runtimeMod = (_this$core6 = this.core) === null || _this$core6 === void 0 ? void 0 : _this$core6.runtimeMode) !== null && _this$core$runtimeMod !== void 0 ? _this$core$runtimeMod : void 0,
4396
4960
  runtime_url_type: getRuntimeUrlType((_this$core7 = this.core) === null || _this$core7 === void 0 ? void 0 : _this$core7.runtimeUrl),
4397
- telemetry_disabled: (_this$core$telemetryD = (_this$core8 = this.core) === null || _this$core8 === void 0 ? void 0 : _this$core8.telemetryDisabled) !== null && _this$core$telemetryD !== void 0 ? _this$core$telemetryD : false,
4398
- ...extra
4961
+ telemetry_disabled: false,
4962
+ has_threads: this.hasActiveVisibleThreads(),
4963
+ usage_bucket: this.getThreadsUsageBucket(),
4964
+ expiry_bucket: this.getThreadsExpiryBucket(),
4965
+ group_key: "threads",
4966
+ leaf_key: "threads"
4967
+ };
4968
+ }
4969
+ /** Add the frozen CTA leaves and anonymous URL attribution when allowed. */
4970
+ getThreadsCtaTelemetryProps(cta, ctaSurface) {
4971
+ const distinctId = getTelemetryDistinctIdForUrl();
4972
+ return {
4973
+ ...this.getThreadsTelemetryProps(),
4974
+ cta,
4975
+ cta_surface: ctaSurface,
4976
+ posthog_distinct_id: distinctId !== null && distinctId !== void 0 ? distinctId : void 0
4399
4977
  };
4400
4978
  }
4401
4979
  getMemoriesTelemetryProps() {
4402
- var _this$core9;
4403
- const distinctId = !((_this$core9 = this.core) === null || _this$core9 === void 0 ? void 0 : _this$core9.telemetryDisabled) ? getTelemetryDistinctIdForUrl() : null;
4980
+ var _this$core8;
4981
+ const distinctId = !((_this$core8 = this.core) === null || _this$core8 === void 0 ? void 0 : _this$core8.telemetryDisabled) ? getTelemetryDistinctIdForUrl() : null;
4404
4982
  return {
4405
4983
  posthog_distinct_id: distinctId !== null && distinctId !== void 0 ? distinctId : void 0,
4406
4984
  memory_count: this._memories.length,
@@ -4410,9 +4988,6 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
4410
4988
  getIntelligenceSignupUrl() {
4411
4989
  return this.appendRefParam(INTELLIGENCE_SIGNUP_URL, "cpk-inspector");
4412
4990
  }
4413
- getThreadsIntelligenceSignupUrl() {
4414
- return this.appendRefParam(THREADS_INTELLIGENCE_SIGNIN_URL, "cpk-inspector");
4415
- }
4416
4991
  getTalkToEngineerUrl() {
4417
4992
  return this.appendRefParam(TALK_TO_ENGINEER_URL, "cpk-inspector-threads");
4418
4993
  }
@@ -4422,29 +4997,54 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
4422
4997
  getThreadsDocsUrl() {
4423
4998
  return this.appendRefParam(THREADS_DOCS_URL, "cpk-inspector-threads");
4424
4999
  }
5000
+ getThreadsRuntimeSetupDocsUrl() {
5001
+ return this.appendRefParam(THREADS_RUNTIME_SETUP_DOCS_URL, "cpk-inspector-threads");
5002
+ }
5003
+ getThreadsIntelligenceSignupUrl() {
5004
+ return this.appendRefParam(INTELLIGENCE_SIGNUP_URL, "cpk-inspector-threads");
5005
+ }
4425
5006
  getSelfHostedIntelligenceUrl() {
4426
5007
  return this.appendRefParam(SELF_HOSTED_INTELLIGENCE_URL, "cpk-inspector-threads");
4427
5008
  }
5009
+ /** Selects the onboarding path for an enabled runtime with no saved Threads. */
5010
+ getThreadsEmptyOnboardingAction() {
5011
+ var _this$inspectorMetada;
5012
+ const planCode = (_this$inspectorMetada = this.inspectorMetadataProjection.plan) === null || _this$inspectorMetada === void 0 ? void 0 : _this$inspectorMetada.code.trim().toLowerCase();
5013
+ if (planCode === "team_self_hosted" || planCode === "team-self-hosted") return {
5014
+ href: this.getSelfHostedIntelligenceUrl(),
5015
+ label: "Explore self-hosted Intelligence"
5016
+ };
5017
+ return {
5018
+ href: this.getThreadsIntelligenceSignupUrl(),
5019
+ label: "Sign up for Intelligence"
5020
+ };
5021
+ }
4428
5022
  subscribeToThreadStore(agentId, store) {
4429
5023
  if (!this.areThreadEndpointsAvailable()) return;
4430
5024
  if (this._threadStoreSubscriptions.has(agentId)) return;
5025
+ const capabilityGeneration = this.threadCapabilityGeneration;
4431
5026
  const threadsSub = store.select(_copilotkit_core.ɵselectThreads).subscribe((threads) => {
5027
+ if (capabilityGeneration !== this.threadCapabilityGeneration || !this.areThreadEndpointsAvailable()) return;
4432
5028
  this._threadsByAgent.set(agentId, threads);
4433
5029
  this._threads = Array.from(this._threadsByAgent.values()).flat();
4434
5030
  this.autoSelectLatestThread();
4435
5031
  this.requestUpdate();
4436
5032
  });
4437
- const errorSub = store.select(_copilotkit_core.ɵselectThreadsError).subscribe((error) => {
5033
+ const statusSub = store.select(createThreadStoreStatusSelector()).subscribe(({ error, isLoading }) => {
5034
+ if (capabilityGeneration !== this.threadCapabilityGeneration || !this.areThreadEndpointsAvailable()) return;
4438
5035
  if (error) this._threadsErrorByAgent.set(agentId, error);
4439
5036
  else this._threadsErrorByAgent.delete(agentId);
5037
+ this._threadsLoadingByAgent.set(agentId, isLoading);
4440
5038
  this.requestUpdate();
4441
5039
  });
4442
5040
  this._threadStoreSubscriptions.set(agentId, () => {
4443
5041
  threadsSub.unsubscribe();
4444
- errorSub.unsubscribe();
5042
+ statusSub.unsubscribe();
4445
5043
  });
5044
+ if (capabilityGeneration !== this.threadCapabilityGeneration || !this.areThreadEndpointsAvailable()) return;
4446
5045
  const initialState = store.getState();
4447
5046
  this._threadsByAgent.set(agentId, (0, _copilotkit_core.ɵselectThreads)(initialState));
5047
+ this._threadsLoadingByAgent.set(agentId, (0, _copilotkit_core.ɵselectThreadsIsLoading)(initialState));
4448
5048
  const initialError = (0, _copilotkit_core.ɵselectThreadsError)(initialState);
4449
5049
  if (initialError) this._threadsErrorByAgent.set(agentId, initialError);
4450
5050
  else this._threadsErrorByAgent.delete(agentId);
@@ -4452,23 +5052,38 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
4452
5052
  this.autoSelectLatestThread();
4453
5053
  }
4454
5054
  autoSelectLatestThread() {
4455
- if (this._threads.length === 0) return;
4456
- if (!(this.selectedThreadId != null && !this.isExampleThreadId(this.selectedThreadId) && this._threads.some((t) => t.id === this.selectedThreadId))) this.selectedThreadId = this._threads[0].id;
5055
+ if (!this.areThreadEndpointsAvailable()) return;
5056
+ const { displayThreads } = this.getActiveThreadsState();
5057
+ const previousSelectedThreadId = this.selectedThreadId;
5058
+ if (this.selectedLocalExampleThreadId !== null && previousSelectedThreadId === this.selectedLocalExampleThreadId && displayThreads.length === 0) {
5059
+ this.selectedRealThreadIsExplicit = false;
5060
+ return;
5061
+ }
5062
+ if (this.selectedLocalExampleThreadId !== null) this.exampleTourActive = false;
5063
+ this.selectedLocalExampleThreadId = null;
5064
+ const explicitSelectedThreadId = this.selectedRealThreadIsExplicit ? previousSelectedThreadId : null;
5065
+ const nextSelectedThreadId = selectVisibleRealThreadId({
5066
+ threads: displayThreads,
5067
+ selectedThreadId: explicitSelectedThreadId
5068
+ });
5069
+ this.selectedThreadId = nextSelectedThreadId;
5070
+ this.selectedRealThreadIsExplicit = explicitSelectedThreadId !== null && nextSelectedThreadId === explicitSelectedThreadId;
4457
5071
  }
4458
5072
  teardownThreadStoreSubscriptions() {
4459
5073
  for (const unsub of this._threadStoreSubscriptions.values()) unsub();
4460
5074
  this._threadStoreSubscriptions.clear();
4461
5075
  this._threadsByAgent.clear();
4462
5076
  this._threadsErrorByAgent.clear();
5077
+ this._threadsLoadingByAgent.clear();
4463
5078
  this._threads = [];
4464
5079
  }
4465
5080
  ensureOwnedThreadStore(agentId) {
4466
- var _this$core10, _core$intelligence;
5081
+ var _this$core9, _core$intelligence;
5082
+ if (!this.areThreadEndpointsAvailable()) return;
4467
5083
  if (this._ownedThreadStores.has(agentId)) return;
4468
- if ((_this$core10 = this.core) === null || _this$core10 === void 0 ? void 0 : _this$core10.getThreadStore(agentId)) return;
5084
+ if ((_this$core9 = this.core) === null || _this$core9 === void 0 ? void 0 : _this$core9.getThreadStore(agentId)) return;
4469
5085
  const core = this.core;
4470
5086
  if (!(core === null || core === void 0 ? void 0 : core.runtimeUrl)) return;
4471
- if (!this.areThreadEndpointsAvailable()) return;
4472
5087
  const store = (0, _copilotkit_core.ɵcreateThreadStore)({ fetch: globalThis.fetch });
4473
5088
  store.start();
4474
5089
  store.setContext({
@@ -4482,11 +5097,13 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
4482
5097
  core.registerThreadStore(agentId, store);
4483
5098
  }
4484
5099
  refreshOwnedThreadStore(agentId) {
5100
+ if (!this.areThreadEndpointsAvailable()) return;
4485
5101
  const store = this._ownedThreadStores.get(agentId);
4486
5102
  if (!store) return;
4487
5103
  store.refresh();
4488
5104
  }
4489
5105
  updateOwnedThreadStoreHeaders(headers) {
5106
+ if (!this.areThreadEndpointsAvailable()) return;
4490
5107
  const core = this.core;
4491
5108
  if (!(core === null || core === void 0 ? void 0 : core.runtimeUrl)) return;
4492
5109
  for (const [agentId, store] of this._ownedThreadStores) {
@@ -4500,36 +5117,67 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
4500
5117
  }
4501
5118
  }
4502
5119
  removeOwnedThreadStore(agentId) {
4503
- var _this$core11;
5120
+ var _this$core10;
4504
5121
  const store = this._ownedThreadStores.get(agentId);
4505
5122
  if (!store) return;
4506
- store.stop();
4507
- (_this$core11 = this.core) === null || _this$core11 === void 0 || _this$core11.unregisterThreadStore(agentId);
4508
5123
  this._ownedThreadStores.delete(agentId);
5124
+ store.stop();
5125
+ if (((_this$core10 = this.core) === null || _this$core10 === void 0 ? void 0 : _this$core10.getThreadStore(agentId)) === store) this.core.unregisterThreadStore(agentId);
4509
5126
  }
4510
5127
  teardownOwnedThreadStores() {
4511
- for (const [agentId, store] of this._ownedThreadStores) {
4512
- var _this$core12;
5128
+ const ownedThreadStores = Array.from(this._ownedThreadStores);
5129
+ this._ownedThreadStores.clear();
5130
+ for (const [agentId, store] of ownedThreadStores) {
5131
+ var _this$core11;
4513
5132
  store.stop();
4514
- (_this$core12 = this.core) === null || _this$core12 === void 0 || _this$core12.unregisterThreadStore(agentId);
5133
+ if (((_this$core11 = this.core) === null || _this$core11 === void 0 ? void 0 : _this$core11.getThreadStore(agentId)) === store) this.core.unregisterThreadStore(agentId);
5134
+ }
5135
+ }
5136
+ coreSupportsInspectorMetadata(core) {
5137
+ try {
5138
+ return "inspectorMetadata" in core;
5139
+ } catch (_unused6) {
5140
+ return false;
4515
5141
  }
4516
- this._ownedThreadStores.clear();
5142
+ }
5143
+ readCoreInspectorMetadata(core) {
5144
+ if (!this.coreSupportsInspectorMetadata(core)) return;
5145
+ try {
5146
+ return core.inspectorMetadata;
5147
+ } catch (_unused7) {
5148
+ return;
5149
+ }
5150
+ }
5151
+ updateInspectorMetadataProjection(value) {
5152
+ this.inspectorMetadataValue = value;
5153
+ let runtimeLicense;
5154
+ try {
5155
+ var _this$_core4;
5156
+ runtimeLicense = (_this$_core4 = this._core) === null || _this$_core4 === void 0 ? void 0 : _this$_core4.licenseStatus;
5157
+ } catch (_unused8) {
5158
+ runtimeLicense = void 0;
5159
+ }
5160
+ this.inspectorMetadataProjection = projectInspectorMetadata(value, runtimeLicense);
4517
5161
  }
4518
5162
  attachToCore(core) {
4519
5163
  this.runtimeStatus = core.runtimeConnectionStatus;
4520
5164
  this.coreProperties = core.properties;
4521
5165
  this.lastCoreError = null;
5166
+ const supportsInspectorMetadata = this.coreSupportsInspectorMetadata(core);
5167
+ this.updateInspectorMetadataProjection(this.readCoreInspectorMetadata(core));
4522
5168
  this.coreSubscriber = {
4523
5169
  onRuntimeConnectionStatusChanged: ({ status }) => {
4524
5170
  this.runtimeStatus = status;
5171
+ this.updateInspectorMetadataProjection(this.inspectorMetadataValue);
5172
+ const threadCapabilityWasEnabled = this.threadCapabilityEnabled === true;
5173
+ this.synchronizeThreadCapability();
4525
5174
  if (status === "connected") {
4526
5175
  if (!core.telemetryDisabled) {
4527
5176
  ensureTelemetryDistinctId();
4528
5177
  maybeShowDisclosure();
4529
5178
  }
4530
5179
  this.flushPendingBannerViewed();
4531
- if (this.areThreadEndpointsAvailable()) for (const agentId of this._ownedThreadStores.keys()) this.refreshOwnedThreadStore(agentId);
4532
- else this.teardownOwnedThreadStores();
5180
+ if (threadCapabilityWasEnabled && this.areThreadEndpointsAvailable()) for (const agentId of this._ownedThreadStores.keys()) this.refreshOwnedThreadStore(agentId);
4533
5181
  } else {
4534
5182
  this._threadsByAgent.clear();
4535
5183
  this._threads = [];
@@ -4544,6 +5192,11 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
4544
5192
  this.updateOwnedThreadStoreHeaders(headers);
4545
5193
  this.requestUpdate();
4546
5194
  },
5195
+ ...supportsInspectorMetadata ? { onInspectorMetadataChanged: ({ inspectorMetadata }) => {
5196
+ if (this._core !== core) return;
5197
+ this.updateInspectorMetadataProjection(inspectorMetadata);
5198
+ this.requestUpdate();
5199
+ } } : {},
4547
5200
  onError: ({ code, error }) => {
4548
5201
  this.lastCoreError = {
4549
5202
  code,
@@ -4562,18 +5215,25 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
4562
5215
  this.requestUpdate();
4563
5216
  },
4564
5217
  onThreadStoreRegistered: ({ agentId, store }) => {
5218
+ if (!this.areThreadEndpointsAvailable()) return;
4565
5219
  this.subscribeToThreadStore(agentId, store);
4566
5220
  this.requestUpdate();
4567
5221
  },
4568
- onThreadStoreUnregistered: ({ agentId }) => {
5222
+ onThreadStoreUnregistered: ({ agentId, prevStore }) => {
4569
5223
  const unsub = this._threadStoreSubscriptions.get(agentId);
4570
5224
  if (unsub) {
4571
5225
  unsub();
4572
5226
  this._threadStoreSubscriptions.delete(agentId);
4573
5227
  }
5228
+ if (this._ownedThreadStores.get(agentId) === prevStore) {
5229
+ this._ownedThreadStores.delete(agentId);
5230
+ prevStore.stop();
5231
+ }
4574
5232
  this._threadsByAgent.delete(agentId);
4575
5233
  this._threadsErrorByAgent.delete(agentId);
5234
+ this._threadsLoadingByAgent.delete(agentId);
4576
5235
  this._threads = Array.from(this._threadsByAgent.values()).flat();
5236
+ this.autoSelectLatestThread();
4577
5237
  this.requestUpdate();
4578
5238
  }
4579
5239
  };
@@ -4587,7 +5247,7 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
4587
5247
  this.flushPendingBannerViewed();
4588
5248
  }
4589
5249
  const threadStores = typeof core.getThreadStores === "function" ? core.getThreadStores() : {};
4590
- for (const [agentId, store] of Object.entries(threadStores)) this.subscribeToThreadStore(agentId, store);
5250
+ if (this.areThreadEndpointsAvailable()) for (const [agentId, store] of Object.entries(threadStores)) this.subscribeToThreadStore(agentId, store);
4591
5251
  if (core.context) this.contextStore = this.normalizeContextStore(core.context);
4592
5252
  if (this.selectedMenu === "memories") this.ensureMemorySubscription();
4593
5253
  }
@@ -4651,10 +5311,10 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
4651
5311
  * reachable from the Intelligence-gated memory view, so it inherits the gate.
4652
5312
  */
4653
5313
  runRecall(query) {
4654
- var _this$_core3, _this$_core3$getMemor;
5314
+ var _this$_core5, _this$_core5$getMemor;
4655
5315
  const trimmed = query.trim();
4656
5316
  if (trimmed.length === 0) return;
4657
- const store = (_this$_core3 = this._core) === null || _this$_core3 === void 0 || (_this$_core3$getMemor = _this$_core3.getMemoryStore) === null || _this$_core3$getMemor === void 0 ? void 0 : _this$_core3$getMemor.call(_this$_core3);
5317
+ const store = (_this$_core5 = this._core) === null || _this$_core5 === void 0 || (_this$_core5$getMemor = _this$_core5.getMemoryStore) === null || _this$_core5$getMemor === void 0 ? void 0 : _this$_core5$getMemor.call(_this$_core5);
4658
5318
  if (!store || typeof store.recall !== "function") {
4659
5319
  this._recallResults = [];
4660
5320
  this._recallError = "Recall is not supported by this SDK version.";
@@ -4691,6 +5351,13 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
4691
5351
  }
4692
5352
  detachFromCore() {
4693
5353
  var _this$_memoryUnsub;
5354
+ this.threadCapabilityGeneration += 1;
5355
+ this.threadCapabilityEnabled = null;
5356
+ if (this.selectedThreadId !== this.selectedLocalExampleThreadId) {
5357
+ this.selectedThreadId = null;
5358
+ this.selectedLocalExampleThreadId = null;
5359
+ }
5360
+ this.selectedRealThreadIsExplicit = false;
4694
5361
  if (this.coreUnsubscribe) {
4695
5362
  this.coreUnsubscribe();
4696
5363
  this.coreUnsubscribe = null;
@@ -4711,6 +5378,9 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
4711
5378
  this._recallQuery = "";
4712
5379
  this.coreSubscriber = null;
4713
5380
  this.runtimeStatus = null;
5381
+ this.inspectorMetadataValue = void 0;
5382
+ this.inspectorMetadataProjection = projectInspectorMetadata(void 0, void 0);
5383
+ this.metadataTelemetryFingerprints.clear();
4714
5384
  this.lastCoreError = null;
4715
5385
  this.coreProperties = {};
4716
5386
  this.cachedTools = [];
@@ -4729,6 +5399,7 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
4729
5399
  this.eventCounter = 0;
4730
5400
  }
4731
5401
  processAgentsChanged(agents) {
5402
+ this.synchronizeThreadCapability();
4732
5403
  const seenAgentIds = /* @__PURE__ */ new Set();
4733
5404
  for (const agent of Object.values(agents)) {
4734
5405
  if (!(agent === null || agent === void 0 ? void 0 : agent.agentId)) continue;
@@ -4794,11 +5465,17 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
4794
5465
  event: params.event,
4795
5466
  result: "result" in params ? params.result : void 0
4796
5467
  });
4797
- this.refreshOwnedThreadStore(agentId);
5468
+ if (this.areThreadEndpointsAvailable()) this.refreshOwnedThreadStore(agentId);
4798
5469
  },
4799
5470
  onRunErrorEvent: ({ event }) => {
4800
5471
  this.recordAgentEvent(agentId, "RUN_ERROR", event);
4801
5472
  },
5473
+ onStepStartedEvent: ({ event }) => {
5474
+ this.recordAgentEvent(agentId, "STEP_STARTED", event);
5475
+ },
5476
+ onStepFinishedEvent: ({ event }) => {
5477
+ this.recordAgentEvent(agentId, "STEP_FINISHED", event);
5478
+ },
4802
5479
  onTextMessageStartEvent: ({ event }) => {
4803
5480
  this.recordAgentEvent(agentId, "TEXT_MESSAGE_START", event);
4804
5481
  },
@@ -4961,6 +5638,7 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
4961
5638
  }
4962
5639
  }
4963
5640
  updateContextOptions(agentIds) {
5641
+ let selectedContextChanged = false;
4964
5642
  const nextOptions = [{
4965
5643
  key: "all-agents",
4966
5644
  label: "All Agents"
@@ -4977,12 +5655,14 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
4977
5655
  if ((pendingContext === "all-agents" || agentIds.has(pendingContext)) && (pendingContext === "all-agents" || agentIds.size === 1)) {
4978
5656
  if (this.selectedContext !== pendingContext) {
4979
5657
  this.selectedContext = pendingContext;
5658
+ selectedContextChanged = true;
4980
5659
  this.expandedRows.clear();
4981
5660
  }
4982
5661
  this.pendingSelectedContext = null;
4983
5662
  } else if (agentIds.size > 0) {
4984
5663
  if (this.selectedContext !== "all-agents") {
4985
5664
  this.selectedContext = "all-agents";
5665
+ selectedContextChanged = true;
4986
5666
  this.expandedRows.clear();
4987
5667
  }
4988
5668
  this.pendingSelectedContext = null;
@@ -4993,10 +5673,12 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
4993
5673
  if (agentIds.size === 1) nextSelected = Array.from(agentIds)[0];
4994
5674
  if (this.selectedContext !== nextSelected) {
4995
5675
  this.selectedContext = nextSelected;
5676
+ selectedContextChanged = true;
4996
5677
  this.expandedRows.clear();
4997
5678
  this.persistState();
4998
5679
  }
4999
5680
  }
5681
+ if (selectedContextChanged) this.autoSelectLatestThread();
5000
5682
  }
5001
5683
  getEventsForSelectedContext() {
5002
5684
  var _this$agentEvents$get2;
@@ -5058,8 +5740,8 @@ ${(0, lit_directives_unsafe_html_js.unsafeHTML)(highlightedJson(stateValue))}</p
5058
5740
  return lit.html`
5059
5741
  <div class="mt-2 space-y-2">
5060
5742
  ${toolCalls.map((call, index) => {
5061
- var _ref5, _call$function$name, _call$function, _call$function2;
5062
- const functionName = (_ref5 = (_call$function$name = (_call$function = call.function) === null || _call$function === void 0 ? void 0 : _call$function.name) !== null && _call$function$name !== void 0 ? _call$function$name : call.toolName) !== null && _ref5 !== void 0 ? _ref5 : "Unknown function";
5743
+ var _ref9, _call$function$name, _call$function, _call$function2;
5744
+ const functionName = (_ref9 = (_call$function$name = (_call$function = call.function) === null || _call$function === void 0 ? void 0 : _call$function.name) !== null && _call$function$name !== void 0 ? _call$function$name : call.toolName) !== null && _ref9 !== void 0 ? _ref9 : "Unknown function";
5063
5745
  const callId = typeof (call === null || call === void 0 ? void 0 : call.id) === "string" ? call.id : `tool-call-${index + 1}`;
5064
5746
  const argsString = this.formatToolCallArguments((_call$function2 = call.function) === null || _call$function2 === void 0 ? void 0 : _call$function2.arguments);
5065
5747
  return lit.html`
@@ -5088,12 +5770,12 @@ ${argsString}</pre
5088
5770
  if (typeof args === "string") try {
5089
5771
  const parsed = JSON.parse(args);
5090
5772
  return JSON.stringify(parsed, null, 2);
5091
- } catch (_unused3) {
5773
+ } catch (_unused9) {
5092
5774
  return args;
5093
5775
  }
5094
5776
  if (typeof args === "object") try {
5095
5777
  return JSON.stringify(args, null, 2);
5096
- } catch (_unused4) {
5778
+ } catch (_unused10) {
5097
5779
  return String(args);
5098
5780
  }
5099
5781
  return String(args);
@@ -5116,13 +5798,13 @@ ${argsString}</pre
5116
5798
  try {
5117
5799
  const parsed = JSON.parse(trimmed);
5118
5800
  return JSON.stringify(parsed, null, 2);
5119
- } catch (_unused5) {
5801
+ } catch (_unused11) {
5120
5802
  return state;
5121
5803
  }
5122
5804
  }
5123
5805
  if (typeof state === "object") try {
5124
5806
  return JSON.stringify(state, null, 2);
5125
- } catch (_unused6) {
5807
+ } catch (_unused12) {
5126
5808
  return String(state);
5127
5809
  }
5128
5810
  return String(state);
@@ -5169,6 +5851,8 @@ ${argsString}</pre
5169
5851
  connectedCallback() {
5170
5852
  super.connectedCallback();
5171
5853
  if (typeof window !== "undefined") {
5854
+ var _window$matchMedia$ma, _window$matchMedia, _window;
5855
+ this.threadsExampleOverviewVideoReducedMotion = (_window$matchMedia$ma = (_window$matchMedia = (_window = window).matchMedia) === null || _window$matchMedia === void 0 ? void 0 : _window$matchMedia.call(_window, "(prefers-reduced-motion: reduce)").matches) !== null && _window$matchMedia$ma !== void 0 ? _window$matchMedia$ma : false;
5172
5856
  this.ensureBrandFonts();
5173
5857
  window.addEventListener("resize", this.handleResize);
5174
5858
  window.addEventListener("pointerdown", this.handleGlobalPointerDown);
@@ -5177,6 +5861,7 @@ ${argsString}</pre
5177
5861
  this.tryAutoAttachCore();
5178
5862
  this.ensureAnnouncementLoading();
5179
5863
  }
5864
+ this.requestUpdate();
5180
5865
  }
5181
5866
  ensureBrandFonts() {
5182
5867
  const FONT_LINK_ID = "cpk-inspector-brand-fonts";
@@ -5199,14 +5884,13 @@ ${argsString}</pre
5199
5884
  clearTimeout(this.transitionTimeoutId);
5200
5885
  this.transitionTimeoutId = null;
5201
5886
  }
5202
- if (this.threadsExampleOverviewVideoLoadTimer !== null) {
5203
- window.clearTimeout(this.threadsExampleOverviewVideoLoadTimer);
5204
- this.threadsExampleOverviewVideoLoadTimer = null;
5205
- }
5206
- if (this.threadsExampleOverviewVideoIdleCallbackId !== null && typeof window.cancelIdleCallback === "function") {
5207
- window.cancelIdleCallback(this.threadsExampleOverviewVideoIdleCallbackId);
5208
- this.threadsExampleOverviewVideoIdleCallbackId = null;
5887
+ this.threadsSetupPromptCopyGeneration += 1;
5888
+ if (this.threadsSetupPromptCopyResetTimeoutId !== null) {
5889
+ window.clearTimeout(this.threadsSetupPromptCopyResetTimeoutId);
5890
+ this.threadsSetupPromptCopyResetTimeoutId = null;
5209
5891
  }
5892
+ this.threadsSetupPromptCopyState = "idle";
5893
+ this.cleanupThreadsExampleOverviewVideo();
5210
5894
  this.removeDockStyles(true);
5211
5895
  this.detachFromCore();
5212
5896
  }
@@ -5232,6 +5916,7 @@ ${argsString}</pre
5232
5916
  y: EDGE_MARGIN
5233
5917
  };
5234
5918
  this.hydrateStateFromStorage();
5919
+ this.contextState.window.size = this.clampWindowSize(this.contextState.window.size);
5235
5920
  if (this.selectedMenu === "memories") this.ensureMemorySubscription();
5236
5921
  if (this.isOpen && this.dockMode !== "floating") this.applyDockStyles(true);
5237
5922
  this.applyAnchorPosition("button");
@@ -5243,6 +5928,36 @@ ${argsString}</pre
5243
5928
  render() {
5244
5929
  return this.isOpen ? this.renderWindow() : this.renderButton();
5245
5930
  }
5931
+ willUpdate() {
5932
+ this.reconcileSelectedMenuVisibility();
5933
+ }
5934
+ updated() {
5935
+ var _this$shadowRoot3;
5936
+ this.syncThreadsExampleOverviewVideo();
5937
+ this.maybeTrackInspectorMetadataViews();
5938
+ if (!this.isOpen || this.selectedGroup !== "agents") {
5939
+ this.lastScrolledAgentNavigationLayout = null;
5940
+ return;
5941
+ }
5942
+ const navigation = (_this$shadowRoot3 = this.shadowRoot) === null || _this$shadowRoot3 === void 0 ? void 0 : _this$shadowRoot3.querySelector("nav[aria-label=\"Agent navigation\"]");
5943
+ if (!navigation) return;
5944
+ const activeControl = navigation.querySelector("[aria-current=\"page\"]");
5945
+ if (!activeControl) return;
5946
+ const layoutKey = [
5947
+ this.selectedMenu,
5948
+ this.dockMode,
5949
+ Math.round(this.contextState.window.size.width),
5950
+ typeof window === "undefined" ? 0 : window.innerWidth,
5951
+ navigation.clientWidth,
5952
+ navigation.scrollWidth
5953
+ ].join(":");
5954
+ if (this.lastScrolledAgentNavigationLayout === layoutKey) return;
5955
+ if (typeof activeControl.scrollIntoView === "function") activeControl.scrollIntoView({
5956
+ block: "nearest",
5957
+ inline: "nearest"
5958
+ });
5959
+ this.lastScrolledAgentNavigationLayout = layoutKey;
5960
+ }
5246
5961
  renderButton() {
5247
5962
  return lit.html`
5248
5963
  <div class="console-button-wrapper">
@@ -5298,24 +6013,80 @@ ${argsString}</pre
5298
6013
  </button>
5299
6014
  ${this.renderAnnouncementPreview()}
5300
6015
  </div>
6016
+ `;
6017
+ }
6018
+ /** Render a trusted action with optional context-specific copy. */
6019
+ renderInspectorAction(action, placement, displayLabel = action.label) {
6020
+ const actionIntent = displayLabel === "Upgrade Your Plan" ? "upgrade" : void 0;
6021
+ return lit.html`
6022
+ <a
6023
+ data-inspector-action-placement=${placement}
6024
+ data-inspector-action-intent=${actionIntent !== null && actionIntent !== void 0 ? actionIntent : lit.nothing}
6025
+ href=${action.url}
6026
+ target="_blank"
6027
+ rel="noopener noreferrer"
6028
+ aria-label="${displayLabel} (opens in a new tab)"
6029
+ style=${placement === "threads-footer" ? "" : "display:inline-flex;min-height:34px;align-items:center;justify-content:center;gap:6px;border:1px solid #dbdbe5;border-radius:6px;background:#ffffff;padding:8px 12px;color:#57575b;font-size:12px;font-weight:600;text-decoration:none;outline-style:solid;outline-width:2px;outline-color:transparent;outline-offset:2px;cursor:pointer;"}
6030
+ @click=${() => this.handleInspectorMetadataActionClick(action, placement)}
6031
+ >
6032
+ ${displayLabel}
6033
+ </a>
6034
+ `;
6035
+ }
6036
+ renderInspectorMetadataHeader() {
6037
+ const { identity, plan } = this.inspectorMetadataProjection;
6038
+ if (!identity && !plan) return lit.nothing;
6039
+ return lit.html`
6040
+ <div
6041
+ style="display:flex;min-width:0;flex:1 1 220px;flex-wrap:wrap;align-items:center;gap:6px 8px;"
6042
+ role="group"
6043
+ aria-label="Inspector account details"
6044
+ >
6045
+ ${identity ? lit.html`
6046
+ <div
6047
+ data-inspector-metadata="identity"
6048
+ style="display:flex;min-width:0;max-width:100%;align-items:center;gap:6px;color:#e7e7ec;font-size:11px;line-height:1.3;"
6049
+ title="${identity.organizationName} / ${identity.projectName}"
6050
+ >
6051
+ <span style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"
6052
+ >${identity.organizationName}</span
6053
+ >
6054
+ <span aria-hidden="true" style="color:#68686e;">/</span>
6055
+ <span style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"
6056
+ >${identity.projectName}</span
6057
+ >
6058
+ </div>
6059
+ ` : lit.nothing}
6060
+ ${plan ? lit.html`
6061
+ <span
6062
+ data-inspector-metadata="plan"
6063
+ style="display:inline-flex;min-height:22px;align-items:center;border:1px solid rgba(133,236,206,0.5);border-radius:4px;background:rgba(133,236,206,0.14);padding:2px 7px;color:#85ecce;font-size:10px;font-weight:600;line-height:1.2;white-space:nowrap;"
6064
+ >${plan.label}</span
6065
+ >
6066
+ ` : lit.nothing}
6067
+ </div>
5301
6068
  `;
5302
6069
  }
5303
6070
  renderWindow() {
5304
6071
  const windowState = this.contextState.window;
5305
6072
  const isDocked = this.dockMode !== "floating";
5306
6073
  const isTransitioning = this.hasAttribute("data-transitioning");
5307
- const windowStyles = isDocked ? this.getDockedWindowStyles() : {
6074
+ const windowStyles = isDocked ? {
6075
+ ...this.getDockedWindowStyles(),
6076
+ overflowX: "hidden"
6077
+ } : {
5308
6078
  width: `${Math.round(windowState.size.width)}px`,
5309
6079
  height: `${Math.round(windowState.size.height)}px`,
5310
6080
  minWidth: `${MIN_WINDOW_WIDTH}px`,
5311
- minHeight: `${MIN_WINDOW_HEIGHT}px`
6081
+ minHeight: `${MIN_WINDOW_HEIGHT}px`,
6082
+ overflowX: "hidden"
5312
6083
  };
5313
- const hasContextDropdown = this.contextOptions.length > 0;
6084
+ const hasContextDropdown = this.contextOptions.some((option) => option.key !== "all-agents");
5314
6085
  const contextDropdown = hasContextDropdown ? this.renderContextDropdown() : lit.nothing;
5315
6086
  const coreStatus = this.getCoreStatusSummary();
5316
6087
  const agentSelector = hasContextDropdown ? contextDropdown : lit.html`
5317
6088
  <div
5318
- class="flex items-center gap-2 rounded-md border border-dashed border-gray-200 px-2 py-1 text-xs text-gray-400"
6089
+ class="inspector-agent-placeholder flex items-center gap-2 rounded-md border border-dashed px-2 py-1 text-xs"
5319
6090
  >
5320
6091
  <span>${this.renderIcon("Bot")}</span>
5321
6092
  <span class="truncate">No agents available</span>
@@ -5350,32 +6121,41 @@ ${argsString}</pre
5350
6121
  @pointerup=${isDocked ? void 0 : this.handlePointerUp}
5351
6122
  @pointercancel=${isDocked ? void 0 : this.handlePointerCancel}
5352
6123
  >
5353
- <div class="flex flex-wrap items-center gap-3 px-4 py-3">
6124
+ <div
6125
+ class="inspector-account-strip flex flex-wrap items-center gap-3 px-4 py-3"
6126
+ data-inspector-account-strip
6127
+ style="width:100%;min-width:0;background-color:#010507;color:#ffffff;"
6128
+ >
5354
6129
  <div class="flex items-center min-w-0">
5355
6130
  <img
5356
6131
  src=${inspector_logo_default}
5357
6132
  alt="Inspector logo"
5358
- class="h-6 w-auto"
6133
+ class="inspector-account-logo h-6 w-auto"
5359
6134
  loading="lazy"
5360
6135
  />
5361
6136
  </div>
6137
+ ${this.renderInspectorMetadataHeader()}
5362
6138
  <div class="ml-auto flex min-w-0 items-center gap-2">
5363
- <div class="min-w-[160px] max-w-xs">${agentSelector}</div>
6139
+ <div class="inspector-agent-selector min-w-[160px] max-w-xs">
6140
+ ${agentSelector}
6141
+ </div>
5364
6142
  <div class="flex items-center gap-1">
5365
6143
  ${this.renderDockControls()}
5366
6144
  <button
5367
- class="flex h-8 w-8 items-center justify-center rounded-md transition hover:bg-gray-100 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gray-400 ${this.selectedMenu === "settings" ? "bg-gray-100 text-gray-700" : "text-gray-400 hover:text-gray-600"}"
6145
+ class="inspector-account-control flex h-8 w-8 items-center justify-center rounded-md focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 ${this.settingsOpen ? "inspector-account-control-active" : ""}"
5368
6146
  type="button"
5369
6147
  aria-label="Settings"
5370
- aria-pressed=${this.selectedMenu === "settings"}
5371
- @click=${() => this.handleMenuSelect(this.selectedMenu === "settings" ? "ag-ui-events" : "settings")}
6148
+ aria-pressed=${this.settingsOpen}
6149
+ style=${INTERACTIVE_FOCUS_BASE_STYLE}
6150
+ @click=${this.handleSettingsToggle}
5372
6151
  >
5373
6152
  ${this.renderIcon("Settings")}
5374
6153
  </button>
5375
6154
  <button
5376
- class="flex h-8 w-8 items-center justify-center rounded-md text-gray-400 transition hover:bg-gray-100 hover:text-gray-600 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gray-400"
6155
+ class="inspector-account-control flex h-8 w-8 items-center justify-center rounded-md focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2"
5377
6156
  type="button"
5378
6157
  aria-label="Close Web Inspector"
6158
+ style=${INTERACTIVE_FOCUS_BASE_STYLE}
5379
6159
  @pointerdown=${this.handleClosePointerDown}
5380
6160
  @click=${this.handleCloseClick}
5381
6161
  >
@@ -5384,37 +6164,73 @@ ${argsString}</pre
5384
6164
  </div>
5385
6165
  </div>
5386
6166
  </div>
5387
- <div
5388
- class="flex flex-wrap items-center gap-2 border-t border-gray-100 px-3 py-2 text-xs"
6167
+ <nav
6168
+ class="inspector-primary-navigation"
6169
+ aria-label="Inspector primary navigation"
6170
+ style="overflow-x:auto;overflow-y:hidden;cursor:default;"
5389
6171
  >
5390
- ${this.menuItems.map(({ key, label, icon }) => {
5391
- const isSelected = this.selectedMenu === key;
6172
+ ${INSPECTOR_PRIMARY_NAVIGATION.map(({ key, label, icon }) => {
6173
+ const isSelected = this.selectedGroup === key;
6174
+ const legacyMenuKey = key === "threads" ? "threads" : key === "learning" ? "memories" : void 0;
5392
6175
  return lit.html`
5393
6176
  <button
5394
6177
  type="button"
5395
- class=${["inline-flex items-center gap-2 rounded-md px-3 py-2 transition focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gray-300", isSelected ? "cpk-tab-active" : "cpk-tab-inactive"].join(" ")}
5396
- aria-pressed=${isSelected}
5397
- @click=${() => this.handleMenuSelect(key)}
6178
+ class="inspector-nav-control inspector-primary-control ${isSelected ? "inspector-nav-control-active" : ""}"
6179
+ data-inspector-group=${key}
6180
+ data-inspector-menu-key=${legacyMenuKey !== null && legacyMenuKey !== void 0 ? legacyMenuKey : lit.nothing}
6181
+ aria-current=${isSelected ? "page" : lit.nothing}
6182
+ style=${INTERACTIVE_FOCUS_BASE_STYLE}
6183
+ @click=${() => this.handleGroupSelect(key)}
5398
6184
  >
5399
- <span class="cpk-tab-icon">
5400
- ${key in this.customTabIcons ? (0, lit_directives_unsafe_html_js.unsafeHTML)(this.customTabIcons[key]) : this.renderIcon(icon)}
6185
+ <span class="inspector-nav-icon" aria-hidden="true">
6186
+ ${key === "threads" ? (0, lit_directives_unsafe_html_js.unsafeHTML)(this.customTabIcons.threads) : this.renderIcon(icon)}
5401
6187
  </span>
5402
6188
  <span>${label}</span>
5403
6189
  </button>
5404
6190
  `;
5405
6191
  })}
5406
- ${this.selectedMenu === "threads" ? lit.html`
6192
+ ${this.selectedGroup === "threads" ? lit.html`
5407
6193
  <a
6194
+ data-inspector-thread-cta
5408
6195
  href=${this.getThreadsTalkToEngineerUrl()}
5409
6196
  target="_blank"
5410
- rel="noopener"
5411
- style="margin-left:auto;display:inline-flex;align-items:center;gap:6px;border-radius:6px;border:1px solid #dbdbe5;background:#ffffff;padding:7px 10px;font-size:12px;font-weight:600;color:#57575b;text-decoration:none;"
6197
+ rel="noopener noreferrer"
6198
+ aria-label="Talk to an Engineer (opens in a new tab)"
6199
+ style=${INTERACTIVE_FOCUS_BASE_STYLE}
5412
6200
  @click=${this.handleTalkToEngineerClick}
5413
6201
  >
5414
6202
  Talk to an Engineer
5415
6203
  </a>
5416
6204
  ` : lit.nothing}
5417
- </div>
6205
+ </nav>
6206
+ ${this.selectedGroup === "agents" ? lit.html`
6207
+ <nav
6208
+ class="inspector-child-navigation"
6209
+ aria-label="Agent navigation"
6210
+ style="overflow-x:auto;overflow-y:hidden;white-space:nowrap;cursor:default;"
6211
+ >
6212
+ ${this.getVisibleMenuItemsForGroup("agents").map(({ key, label, icon }) => {
6213
+ const isSelected = this.selectedMenu === key;
6214
+ return lit.html`
6215
+ <button
6216
+ type="button"
6217
+ class="inspector-nav-control inspector-child-control ${isSelected ? "inspector-nav-control-active" : ""}"
6218
+ data-inspector-menu-key=${key}
6219
+ aria-current=${isSelected ? "page" : lit.nothing}
6220
+ style=${INTERACTIVE_FOCUS_BASE_STYLE}
6221
+ @click=${() => this.handleMenuSelect(key)}
6222
+ >
6223
+ <span
6224
+ class="inspector-nav-icon"
6225
+ aria-hidden="true"
6226
+ >${this.renderIcon(icon)}</span
6227
+ >
6228
+ <span>${label}</span>
6229
+ </button>
6230
+ `;
6231
+ })}
6232
+ </nav>
6233
+ ` : lit.nothing}
5418
6234
  </div>
5419
6235
  <div class="flex flex-1 flex-col overflow-hidden">
5420
6236
  <div id="cpk-main-scroll" class="flex-1 overflow-auto">
@@ -5470,10 +6286,7 @@ ${argsString}</pre
5470
6286
  if (!persisted) return;
5471
6287
  if (typeof persisted.isOpen === "boolean") this.isOpen = persisted.isOpen;
5472
6288
  if (isValidDockMode(persisted.dockMode)) this.dockMode = persisted.dockMode;
5473
- if (typeof persisted.selectedMenu === "string") {
5474
- const validMenu = this.menuItems.find((item) => item.key === persisted.selectedMenu);
5475
- if (validMenu) this.selectedMenu = validMenu.key;
5476
- }
6289
+ this.restorePersistedMenu(persisted.selectedMenu);
5477
6290
  if (typeof persisted.selectedContext === "string") {
5478
6291
  this.selectedContext = persisted.selectedContext;
5479
6292
  this.pendingSelectedContext = persisted.selectedContext;
@@ -5483,6 +6296,7 @@ ${argsString}</pre
5483
6296
  if (typeof document === "undefined" || typeof window === "undefined") return;
5484
6297
  const persisted = loadInspectorState(INSPECTOR_STORAGE_KEY);
5485
6298
  if (!persisted) return;
6299
+ this.restorePersistedMenu(persisted.selectedMenu);
5486
6300
  const persistedButton = persisted.button;
5487
6301
  if (persistedButton) {
5488
6302
  if (isValidAnchor(persistedButton.anchor)) this.contextState.button.anchor = persistedButton.anchor;
@@ -5501,6 +6315,28 @@ ${argsString}</pre
5501
6315
  this.pendingSelectedContext = persisted.selectedContext;
5502
6316
  }
5503
6317
  }
6318
+ /** Restore a visible legacy leaf, or use Threads for stale state. */
6319
+ restorePersistedMenu(value) {
6320
+ this.selectedMenu = "threads";
6321
+ this.lastSelectedMenuByGroup.threads = "threads";
6322
+ this.pendingPersistedMenu = null;
6323
+ if (!isInspectorMenuKey(value)) return;
6324
+ const validMenu = this.menuItems.find((item) => item.key === value);
6325
+ if (!validMenu) {
6326
+ if (!this.hasResolvedCore) this.pendingPersistedMenu = value;
6327
+ return;
6328
+ }
6329
+ this.selectedMenu = validMenu.key;
6330
+ this.lastSelectedMenuByGroup[this.getGroupForMenu(validMenu.key)] = validMenu.key;
6331
+ }
6332
+ /** Resolve a valid stored leaf after the first Core exposes its sources. */
6333
+ resolvePendingPersistedMenu() {
6334
+ const pendingMenu = this.pendingPersistedMenu;
6335
+ if (!pendingMenu) return;
6336
+ this.pendingPersistedMenu = null;
6337
+ this.restorePersistedMenu(pendingMenu);
6338
+ this.persistState();
6339
+ }
5504
6340
  get activeContext() {
5505
6341
  return this.isOpen ? "window" : "button";
5506
6342
  }
@@ -5550,7 +6386,7 @@ ${argsString}</pre
5550
6386
  };
5551
6387
  }
5552
6388
  persistState() {
5553
- var _state$selectedContex;
6389
+ var _this$pendingPersiste, _state$selectedContex;
5554
6390
  const state = {
5555
6391
  button: {
5556
6392
  anchor: this.contextState.button.anchor,
@@ -5568,7 +6404,7 @@ ${argsString}</pre
5568
6404
  },
5569
6405
  isOpen: this.isOpen,
5570
6406
  dockMode: this.dockMode,
5571
- selectedMenu: this.selectedMenu,
6407
+ selectedMenu: (_this$pendingPersiste = this.pendingPersistedMenu) !== null && _this$pendingPersiste !== void 0 ? _this$pendingPersiste : this.selectedMenu,
5572
6408
  selectedContext: this.selectedContext
5573
6409
  };
5574
6410
  saveInspectorState(INSPECTOR_STORAGE_KEY, state);
@@ -5591,7 +6427,7 @@ ${argsString}</pre
5591
6427
  if (mode === "docked-left") this.contextState.window.size.width = DOCKED_LEFT_WIDTH;
5592
6428
  this.applyDockStyles();
5593
6429
  } else {
5594
- this.contextState.window.size = { ...DEFAULT_WINDOW_SIZE };
6430
+ this.contextState.window.size = this.clampWindowSize(DEFAULT_WINDOW_SIZE);
5595
6431
  this.centerContext("window");
5596
6432
  }
5597
6433
  this.persistState();
@@ -5750,6 +6586,7 @@ ${argsString}</pre
5750
6586
  type="button"
5751
6587
  aria-label="Dock to left"
5752
6588
  title="Dock Left"
6589
+ style=${INTERACTIVE_FOCUS_BASE_STYLE}
5753
6590
  @click=${() => this.handleDockClick("docked-left")}
5754
6591
  >
5755
6592
  ${this.renderIcon("PanelLeft")}
@@ -5761,6 +6598,7 @@ ${argsString}</pre
5761
6598
  type="button"
5762
6599
  aria-label="Float window"
5763
6600
  title="Float"
6601
+ style=${INTERACTIVE_FOCUS_BASE_STYLE}
5764
6602
  @click=${() => this.handleDockClick("floating")}
5765
6603
  >
5766
6604
  ${this.renderIcon("Maximize2")}
@@ -5831,7 +6669,7 @@ ${argsString}</pre
5831
6669
  if (content === null || content === void 0) return "";
5832
6670
  if (typeof content === "object") try {
5833
6671
  return JSON.stringify(this.sanitizeForLogging(content));
5834
- } catch (_unused7) {
6672
+ } catch (_unused13) {
5835
6673
  return "";
5836
6674
  }
5837
6675
  return String(content);
@@ -5940,6 +6778,7 @@ ${argsString}</pre
5940
6778
  };
5941
6779
  }
5942
6780
  renderMainContent() {
6781
+ if (this.settingsOpen) return this.renderSettingsPanel();
5943
6782
  if (this.selectedMenu === "ag-ui-events") return this.renderEventsTable();
5944
6783
  if (this.selectedMenu === "agents") return this.renderAgentsView();
5945
6784
  if (this.selectedMenu === "frontend-tools") return this.renderToolsView();
@@ -5947,12 +6786,11 @@ ${argsString}</pre
5947
6786
  if (this.selectedMenu === "agent-context") return this.renderContextView();
5948
6787
  if (this.selectedMenu === "threads") return this.renderThreadsView();
5949
6788
  if (this.selectedMenu === "memories") return this.renderMemoriesView();
5950
- if (this.selectedMenu === "settings") return this.renderSettingsPanel();
5951
6789
  return lit.nothing;
5952
6790
  }
5953
6791
  renderSettingsPanel() {
5954
- var _this$core$telemetryD2, _this$core13;
5955
- const optedOut = (_this$core$telemetryD2 = (_this$core13 = this.core) === null || _this$core13 === void 0 ? void 0 : _this$core13.telemetryDisabled) !== null && _this$core$telemetryD2 !== void 0 ? _this$core$telemetryD2 : false;
6792
+ var _this$core$telemetryD, _this$core12;
6793
+ const optedOut = (_this$core$telemetryD = (_this$core12 = this.core) === null || _this$core12 === void 0 ? void 0 : _this$core12.telemetryDisabled) !== null && _this$core$telemetryD !== void 0 ? _this$core$telemetryD : false;
5956
6794
  return lit.html`
5957
6795
  <div class="flex h-full flex-col overflow-hidden">
5958
6796
  <div class="overflow-auto p-4">
@@ -5985,18 +6823,107 @@ ${argsString}</pre
5985
6823
  `;
5986
6824
  }
5987
6825
  trackOpened(source, hadUnseenAnnouncement) {
5988
- var _this$core14, _this$core$licenseSta2, _this$core15, _this$core$runtimeMod2, _this$core16, _this$core17;
5989
- if ((_this$core14 = this.core) === null || _this$core14 === void 0 ? void 0 : _this$core14.telemetryDisabled) return;
6826
+ var _this$core13, _this$core$licenseSta2, _this$core14, _this$core$runtimeMod2, _this$core15, _this$core16;
6827
+ if ((_this$core13 = this.core) === null || _this$core13 === void 0 ? void 0 : _this$core13.telemetryDisabled) return;
5990
6828
  trackInspectorOpened({
5991
6829
  open_source: source,
5992
6830
  ...this.runtimeStatus === "connected" ? {
5993
- license_status: (_this$core$licenseSta2 = (_this$core15 = this.core) === null || _this$core15 === void 0 ? void 0 : _this$core15.licenseStatus) !== null && _this$core$licenseSta2 !== void 0 ? _this$core$licenseSta2 : void 0,
5994
- runtime_mode: (_this$core$runtimeMod2 = (_this$core16 = this.core) === null || _this$core16 === void 0 ? void 0 : _this$core16.runtimeMode) !== null && _this$core$runtimeMod2 !== void 0 ? _this$core$runtimeMod2 : void 0
6831
+ license_status: (_this$core$licenseSta2 = (_this$core14 = this.core) === null || _this$core14 === void 0 ? void 0 : _this$core14.licenseStatus) !== null && _this$core$licenseSta2 !== void 0 ? _this$core$licenseSta2 : void 0,
6832
+ runtime_mode: (_this$core$runtimeMod2 = (_this$core15 = this.core) === null || _this$core15 === void 0 ? void 0 : _this$core15.runtimeMode) !== null && _this$core$runtimeMod2 !== void 0 ? _this$core$runtimeMod2 : void 0
5995
6833
  } : {},
5996
- runtime_url_type: getRuntimeUrlType((_this$core17 = this.core) === null || _this$core17 === void 0 ? void 0 : _this$core17.runtimeUrl),
6834
+ runtime_url_type: getRuntimeUrlType((_this$core16 = this.core) === null || _this$core16 === void 0 ? void 0 : _this$core16.runtimeUrl),
5997
6835
  has_unseen_announcement: hadUnseenAnnouncement
5998
6836
  });
5999
6837
  }
6838
+ getVisibleInspectorMetadataAction() {
6839
+ const { threadsFooterAction, lockedAction } = this.inspectorMetadataProjection;
6840
+ if (threadsFooterAction && !this.settingsOpen && this.selectedMenu === "threads") return {
6841
+ action: threadsFooterAction,
6842
+ placement: "threads-footer"
6843
+ };
6844
+ if (lockedAction && !this.settingsOpen && this.selectedMenu === "threads" && !this.areThreadEndpointsAvailable()) return {
6845
+ action: lockedAction,
6846
+ placement: "locked"
6847
+ };
6848
+ }
6849
+ /** Return paired stable navigation keys, or neither for an invalid leaf. */
6850
+ getMetadataTelemetryNavigation() {
6851
+ const selectedLeaf = this.selectedMenu;
6852
+ if (!isInspectorMenuKey(selectedLeaf)) return {};
6853
+ for (const group of INSPECTOR_PRIMARY_NAVIGATION) if (INSPECTOR_GROUPS[group.key].some((menuKey) => menuKey === selectedLeaf)) return {
6854
+ group_key: group.key,
6855
+ leaf_key: selectedLeaf
6856
+ };
6857
+ return {};
6858
+ }
6859
+ /** Build metadata's shared coarse buckets and stable navigation context. */
6860
+ getMetadataTelemetryContext() {
6861
+ return {
6862
+ usage_bucket: this.getThreadsUsageBucket(),
6863
+ expiry_bucket: this.getThreadsExpiryBucket(),
6864
+ ...this.getMetadataTelemetryNavigation()
6865
+ };
6866
+ }
6867
+ trackMetadataModuleIfChanged(props, fingerprint) {
6868
+ if (this.metadataTelemetryFingerprints.get(props.module) === fingerprint) return;
6869
+ this.metadataTelemetryFingerprints.set(props.module, fingerprint);
6870
+ try {
6871
+ trackMetadataModuleViewed(props);
6872
+ } catch (_unused14) {}
6873
+ }
6874
+ maybeTrackInspectorMetadataViews() {
6875
+ var _this$core17, _telemetryContext$gro, _telemetryContext$lea;
6876
+ if (!this.isOpen || this.runtimeStatus !== _copilotkit_core.CopilotKitCoreRuntimeConnectionStatus.Connected || ((_this$core17 = this.core) === null || _this$core17 === void 0 ? void 0 : _this$core17.telemetryDisabled)) return;
6877
+ const { identity, plan } = this.inspectorMetadataProjection;
6878
+ const license_bucket = this.inspectorMetadataProjection.licenseState;
6879
+ const telemetryContext = this.getMetadataTelemetryContext();
6880
+ const contextFingerprint = [
6881
+ telemetryContext.usage_bucket,
6882
+ telemetryContext.expiry_bucket,
6883
+ (_telemetryContext$gro = telemetryContext.group_key) !== null && _telemetryContext$gro !== void 0 ? _telemetryContext$gro : null,
6884
+ (_telemetryContext$lea = telemetryContext.leaf_key) !== null && _telemetryContext$lea !== void 0 ? _telemetryContext$lea : null
6885
+ ];
6886
+ if (identity) this.trackMetadataModuleIfChanged({
6887
+ module: "identity",
6888
+ license_bucket,
6889
+ ...telemetryContext
6890
+ }, JSON.stringify([
6891
+ license_bucket,
6892
+ ...contextFingerprint,
6893
+ identity.organizationName,
6894
+ identity.projectName
6895
+ ]));
6896
+ else this.metadataTelemetryFingerprints.delete("identity");
6897
+ if (plan) this.trackMetadataModuleIfChanged({
6898
+ module: "plan",
6899
+ license_bucket,
6900
+ ...telemetryContext
6901
+ }, JSON.stringify([
6902
+ license_bucket,
6903
+ ...contextFingerprint,
6904
+ plan.code,
6905
+ plan.label
6906
+ ]));
6907
+ else this.metadataTelemetryFingerprints.delete("plan");
6908
+ const visibleAction = this.getVisibleInspectorMetadataAction();
6909
+ if (visibleAction) {
6910
+ const { action, placement } = visibleAction;
6911
+ const action_placement = getMetadataActionPlacement(placement);
6912
+ this.trackMetadataModuleIfChanged({
6913
+ module: "action",
6914
+ action_kind: action.kind,
6915
+ license_bucket,
6916
+ ...telemetryContext,
6917
+ action_placement
6918
+ }, JSON.stringify([
6919
+ license_bucket,
6920
+ ...contextFingerprint,
6921
+ action_placement,
6922
+ action.kind,
6923
+ action.url
6924
+ ]));
6925
+ } else this.metadataTelemetryFingerprints.delete("action");
6926
+ }
6000
6927
  trackBannerDismissedOnce(surface) {
6001
6928
  var _this$core18, _this$announcementCta;
6002
6929
  if ((_this$core18 = this.core) === null || _this$core18 === void 0 ? void 0 : _this$core18.telemetryDisabled) return;
@@ -6025,22 +6952,19 @@ ${argsString}</pre
6025
6952
  cta_label: (_this$announcementCta2 = this.announcementCtaLabel) !== null && _this$announcementCta2 !== void 0 ? _this$announcementCta2 : void 0
6026
6953
  });
6027
6954
  }
6028
- trackThreadsViewStateOnce(state, threadCount) {
6955
+ trackThreadsViewStateOnce(state) {
6029
6956
  var _this$core20;
6030
6957
  if ((_this$core20 = this.core) === null || _this$core20 === void 0 ? void 0 : _this$core20.telemetryDisabled) return;
6031
6958
  const key = `${state}:${this.getThreadServiceStatus()}`;
6032
6959
  if (this.viewedThreadsTelemetryStates.has(key)) return;
6033
6960
  this.viewedThreadsTelemetryStates.add(key);
6034
- const props = this.getThreadsTelemetryProps({ thread_count: threadCount });
6961
+ const props = this.getThreadsTelemetryProps();
6035
6962
  if (state === "locked") trackThreadsLockedViewed(props);
6036
6963
  else if (state === "empty_enabled") trackThreadsEmptyEnabledViewed(props);
6037
6964
  else trackThreadsEnabledViewed(props);
6038
6965
  }
6039
- shouldRenderExampleThreads(displayThreads, threadsErrorMessage) {
6040
- return this.areThreadEndpointsAvailable() && !threadsErrorMessage && displayThreads.length === 0;
6041
- }
6042
- getVisibleThreads(displayThreads, threadsErrorMessage) {
6043
- return this.shouldRenderExampleThreads(displayThreads, threadsErrorMessage) ? THREADS_EXAMPLE_THREADS : displayThreads;
6966
+ shouldRenderExampleThreads(locked, displayThreads, threadsErrorMessage, threadsLoading) {
6967
+ return locked || !threadsErrorMessage && !threadsLoading && displayThreads.length === 0;
6044
6968
  }
6045
6969
  isExampleThreadId(threadId) {
6046
6970
  return THREADS_EXAMPLE_THREADS.some((thread) => thread.id === threadId);
@@ -6057,6 +6981,7 @@ ${argsString}</pre
6057
6981
  agentId: thread.agentId,
6058
6982
  endUserId: "example-user",
6059
6983
  status: "completed",
6984
+ createdAt: thread.createdAt,
6060
6985
  updatedAt: thread.updatedAt
6061
6986
  } : null,
6062
6987
  getMessages: async () => {
@@ -6079,50 +7004,53 @@ ${argsString}</pre
6079
7004
  var _this$core21;
6080
7005
  if ((_this$core21 = this.core) === null || _this$core21 === void 0 ? void 0 : _this$core21.telemetryDisabled) return;
6081
7006
  for (const thread of THREADS_EXAMPLE_THREADS) {
6082
- if (this.viewedExampleThreadIds.has(thread.id)) continue;
6083
- this.viewedExampleThreadIds.add(thread.id);
6084
- trackThreadsExampleViewed(this.getThreadsTelemetryProps({
6085
- example_thread_id: thread.id,
6086
- thread_count: 0
6087
- }));
7007
+ const exampleKind = getExampleKind(thread.id);
7008
+ if (!exampleKind || this.viewedExampleKinds.has(exampleKind)) continue;
7009
+ this.viewedExampleKinds.add(exampleKind);
7010
+ trackThreadsExampleViewed({
7011
+ ...this.getThreadsTelemetryProps(),
7012
+ example_kind: exampleKind
7013
+ });
6088
7014
  }
6089
7015
  }
6090
7016
  trackThreadsExampleSelectedOnce(threadId) {
6091
7017
  var _this$core22;
6092
7018
  if ((_this$core22 = this.core) === null || _this$core22 === void 0 ? void 0 : _this$core22.telemetryDisabled) return;
6093
- if (this.selectedExampleThreadIds.has(threadId)) return;
6094
- this.selectedExampleThreadIds.add(threadId);
6095
- trackThreadsExampleSelected(this.getThreadsTelemetryProps({
6096
- example_thread_id: threadId,
6097
- thread_count: 0
6098
- }));
7019
+ const exampleKind = getExampleKind(threadId);
7020
+ if (!exampleKind || this.selectedExampleKinds.has(exampleKind)) return;
7021
+ this.selectedExampleKinds.add(exampleKind);
7022
+ trackThreadsExampleSelected({
7023
+ ...this.getThreadsTelemetryProps(),
7024
+ example_kind: exampleKind
7025
+ });
6099
7026
  }
6100
7027
  getCurrentExampleTourProps() {
6101
- var _THREADS_EXAMPLE_TOUR, _this$selectedThreadI;
6102
- const step = (_THREADS_EXAMPLE_TOUR = THREADS_EXAMPLE_TOUR_STEPS[this.exampleTourStep]) !== null && _THREADS_EXAMPLE_TOUR !== void 0 ? _THREADS_EXAMPLE_TOUR : THREADS_EXAMPLE_TOUR_STEPS[0];
6103
- return this.getThreadsTelemetryProps({
6104
- example_thread_id: (_this$selectedThreadI = this.selectedThreadId) !== null && _this$selectedThreadI !== void 0 ? _this$selectedThreadI : void 0,
6105
- thread_count: 0,
6106
- tour_step: this.exampleTourStep + 1,
6107
- tour_tab: step === null || step === void 0 ? void 0 : step.tab
6108
- });
7028
+ const exampleKind = this.selectedThreadId ? getExampleKind(this.selectedThreadId) : void 0;
7029
+ const tourPair = getExampleTourTelemetryPair(this.exampleTourStep);
7030
+ if (!exampleKind || !tourPair) return void 0;
7031
+ return {
7032
+ ...this.getThreadsTelemetryProps(),
7033
+ example_kind: exampleKind,
7034
+ ...tourPair
7035
+ };
6109
7036
  }
6110
7037
  trackThreadsExampleTourStepViewedOnce() {
6111
- var _this$core23, _THREADS_EXAMPLE_TOUR2;
7038
+ var _this$core23;
6112
7039
  if (((_this$core23 = this.core) === null || _this$core23 === void 0 ? void 0 : _this$core23.telemetryDisabled) || !this.selectedThreadId) return;
6113
- if (!((_THREADS_EXAMPLE_TOUR2 = THREADS_EXAMPLE_TOUR_STEPS[this.exampleTourStep]) !== null && _THREADS_EXAMPLE_TOUR2 !== void 0 ? _THREADS_EXAMPLE_TOUR2 : THREADS_EXAMPLE_TOUR_STEPS[0])) return;
6114
- const key = `${this.selectedThreadId}:${this.exampleTourStep}`;
7040
+ const props = this.getCurrentExampleTourProps();
7041
+ if (!props) return;
7042
+ const key = `${props.example_kind}:${props.tour_step}`;
6115
7043
  if (this.viewedExampleTourSteps.has(key)) return;
6116
7044
  this.viewedExampleTourSteps.add(key);
6117
- trackThreadsExampleTourStepViewed(this.getCurrentExampleTourProps());
7045
+ trackThreadsExampleTourStepViewed(props);
6118
7046
  }
6119
7047
  syncExampleTourTab() {
6120
- var _THREADS_EXAMPLE_TOUR3;
6121
- const step = (_THREADS_EXAMPLE_TOUR3 = THREADS_EXAMPLE_TOUR_STEPS[this.exampleTourStep]) !== null && _THREADS_EXAMPLE_TOUR3 !== void 0 ? _THREADS_EXAMPLE_TOUR3 : THREADS_EXAMPLE_TOUR_STEPS[0];
7048
+ var _THREADS_EXAMPLE_TOUR;
7049
+ const step = (_THREADS_EXAMPLE_TOUR = THREADS_EXAMPLE_TOUR_STEPS[this.exampleTourStep]) !== null && _THREADS_EXAMPLE_TOUR !== void 0 ? _THREADS_EXAMPLE_TOUR : THREADS_EXAMPLE_TOUR_STEPS[0];
6122
7050
  if (!step) return;
6123
7051
  this.updateComplete.then(() => {
6124
- var _this$shadowRoot2, _details$selectTab;
6125
- const details = (_this$shadowRoot2 = this.shadowRoot) === null || _this$shadowRoot2 === void 0 ? void 0 : _this$shadowRoot2.querySelector("cpk-thread-details");
7052
+ var _this$shadowRoot4, _details$selectTab;
7053
+ const details = (_this$shadowRoot4 = this.shadowRoot) === null || _this$shadowRoot4 === void 0 ? void 0 : _this$shadowRoot4.querySelector("cpk-thread-details");
6126
7054
  details === null || details === void 0 || (_details$selectTab = details.selectTab) === null || _details$selectTab === void 0 || _details$selectTab.call(details, step.tab);
6127
7055
  });
6128
7056
  }
@@ -6134,45 +7062,66 @@ ${argsString}</pre
6134
7062
  if (autoStarted) {
6135
7063
  var _this$core24;
6136
7064
  this.exampleTourAutoShown = true;
6137
- if (!((_this$core24 = this.core) === null || _this$core24 === void 0 ? void 0 : _this$core24.telemetryDisabled)) trackThreadsExampleTourStarted(this.getCurrentExampleTourProps());
6138
- } else if (!((_this$core25 = this.core) === null || _this$core25 === void 0 ? void 0 : _this$core25.telemetryDisabled)) trackThreadsExampleTourReopened(this.getCurrentExampleTourProps());
7065
+ if (!((_this$core24 = this.core) === null || _this$core24 === void 0 ? void 0 : _this$core24.telemetryDisabled)) {
7066
+ const props = this.getCurrentExampleTourProps();
7067
+ if (props) trackThreadsExampleTourStarted(props);
7068
+ }
7069
+ } else if (!((_this$core25 = this.core) === null || _this$core25 === void 0 ? void 0 : _this$core25.telemetryDisabled)) {
7070
+ const props = this.getCurrentExampleTourProps();
7071
+ if (props) trackThreadsExampleTourReopened(props);
7072
+ }
6139
7073
  this.trackThreadsExampleTourStepViewedOnce();
6140
7074
  this.syncExampleTourTab();
6141
7075
  this.requestUpdate();
6142
7076
  }
6143
7077
  setExampleTourStep(nextStep) {
7078
+ const telemetryStepIsValid = getExampleTourTelemetryPair(nextStep) !== void 0;
6144
7079
  this.exampleTourStep = Math.max(0, Math.min(THREADS_EXAMPLE_TOUR_STEPS.length - 1, nextStep));
6145
- this.trackThreadsExampleTourStepViewedOnce();
7080
+ if (telemetryStepIsValid) this.trackThreadsExampleTourStepViewedOnce();
6146
7081
  this.syncExampleTourTab();
6147
7082
  this.requestUpdate();
6148
7083
  }
6149
7084
  dismissExampleTour(method) {
6150
7085
  var _this$core26;
6151
7086
  if (!this.selectedThreadId) return;
6152
- const props = {
6153
- ...this.getCurrentExampleTourProps(),
6154
- dismiss_method: method
6155
- };
6156
7087
  this.exampleTourActive = false;
6157
7088
  this.exampleTourDismissed = true;
6158
7089
  this.writeThreadsExampleTourDismissed();
6159
- if (!((_this$core26 = this.core) === null || _this$core26 === void 0 ? void 0 : _this$core26.telemetryDisabled)) if (method === "done") trackThreadsExampleTourCompleted(props);
6160
- else trackThreadsExampleTourDismissed(props);
7090
+ if (!((_this$core26 = this.core) === null || _this$core26 === void 0 ? void 0 : _this$core26.telemetryDisabled)) {
7091
+ const currentProps = this.getCurrentExampleTourProps();
7092
+ if (currentProps) {
7093
+ const props = {
7094
+ ...currentProps,
7095
+ dismiss_method: method
7096
+ };
7097
+ if (method === "done") trackThreadsExampleTourCompleted(props);
7098
+ else trackThreadsExampleTourDismissed(props);
7099
+ }
7100
+ }
6161
7101
  this.requestUpdate();
6162
7102
  }
6163
7103
  handleThreadsThreadSelected(threadId, showingExamples) {
6164
- if (showingExamples && this.selectedThreadId === threadId) {
7104
+ if (showingExamples && this.selectedThreadId === threadId && this.selectedLocalExampleThreadId === threadId) {
6165
7105
  this.selectedThreadId = null;
7106
+ this.selectedRealThreadIsExplicit = false;
7107
+ this.selectedLocalExampleThreadId = null;
6166
7108
  this.exampleTourActive = false;
6167
7109
  this.requestUpdate();
6168
7110
  return;
6169
7111
  }
6170
7112
  this.selectedThreadId = threadId;
6171
7113
  if (showingExamples && this.isExampleThreadId(threadId)) {
7114
+ this.selectedRealThreadIsExplicit = false;
7115
+ this.selectedLocalExampleThreadId = threadId;
6172
7116
  this.trackThreadsExampleSelectedOnce(threadId);
6173
7117
  if (!this.exampleTourDismissed && !this.exampleTourAutoShown) this.startExampleTour(true);
6174
7118
  else this.exampleTourActive = false;
6175
- } else this.exampleTourActive = false;
7119
+ } else {
7120
+ const { displayThreads } = this.getActiveThreadsState();
7121
+ this.selectedRealThreadIsExplicit = displayThreads.some((thread) => thread.id === threadId);
7122
+ this.selectedLocalExampleThreadId = null;
7123
+ this.exampleTourActive = false;
7124
+ }
6176
7125
  this.requestUpdate();
6177
7126
  }
6178
7127
  readThreadsExampleTourDismissed() {
@@ -6181,7 +7130,7 @@ ${argsString}</pre
6181
7130
  const raw = window.localStorage.getItem(THREADS_EXAMPLE_TOUR_STORAGE_KEY);
6182
7131
  if (!raw) return false;
6183
7132
  return JSON.parse(raw).dismissed === true;
6184
- } catch (_unused8) {
7133
+ } catch (_unused15) {
6185
7134
  return false;
6186
7135
  }
6187
7136
  }
@@ -6189,45 +7138,232 @@ ${argsString}</pre
6189
7138
  if (typeof window === "undefined") return;
6190
7139
  try {
6191
7140
  window.localStorage.setItem(THREADS_EXAMPLE_TOUR_STORAGE_KEY, JSON.stringify({ dismissed: true }));
6192
- } catch (_unused9) {}
7141
+ } catch (_unused16) {}
6193
7142
  }
6194
- scheduleThreadsExampleOverviewVideoLoad() {
6195
- var _window$matchMedia, _window;
6196
- if (this.threadsExampleOverviewVideoShouldLoad || this.threadsExampleOverviewVideoLoadTimer !== null || this.threadsExampleOverviewVideoIdleCallbackId !== null || typeof window === "undefined") return;
6197
- if ((_window$matchMedia = (_window = window).matchMedia) === null || _window$matchMedia === void 0 ? void 0 : _window$matchMedia.call(_window, "(prefers-reduced-motion: reduce)").matches) return;
6198
- const loadVideo = () => {
7143
+ /** Cancels the one deferred gate without disturbing a newer lifecycle. */
7144
+ cancelThreadsExampleOverviewVideoGate() {
7145
+ if (this.threadsExampleOverviewVideoLoadTimer !== null) {
7146
+ if (typeof window !== "undefined") window.clearTimeout(this.threadsExampleOverviewVideoLoadTimer);
6199
7147
  this.threadsExampleOverviewVideoLoadTimer = null;
7148
+ }
7149
+ if (this.threadsExampleOverviewVideoIdleCallbackId !== null) {
7150
+ if (typeof window !== "undefined" && typeof window.cancelIdleCallback === "function") window.cancelIdleCallback(this.threadsExampleOverviewVideoIdleCallbackId);
6200
7151
  this.threadsExampleOverviewVideoIdleCallbackId = null;
6201
- this.threadsExampleOverviewVideoShouldLoad = true;
6202
- this.requestUpdate();
6203
- };
7152
+ }
7153
+ }
7154
+ /** Returns whether media work still belongs to the mounted lifecycle. */
7155
+ isCurrentThreadsExampleOverviewVideo(video, lifecycleGeneration) {
7156
+ return this.isConnected && video.isConnected && this.threadsExampleOverviewVideoElement === video && this.threadsExampleOverviewVideoLifecycleGeneration === lifecycleGeneration;
7157
+ }
7158
+ /** Invalidates any unresolved play request without exposing another state. */
7159
+ invalidateThreadsExampleOverviewVideoPlay() {
7160
+ this.threadsExampleOverviewVideoPlayAttemptGeneration += 1;
7161
+ this.threadsExampleOverviewVideoPlayPromise = null;
7162
+ }
7163
+ /** Moves a current media lifecycle into its readable failure state. */
7164
+ failThreadsExampleOverviewVideo(video, lifecycleGeneration) {
7165
+ if (!this.isCurrentThreadsExampleOverviewVideo(video, lifecycleGeneration)) return;
7166
+ this.invalidateThreadsExampleOverviewVideoPlay();
7167
+ this.threadsExampleOverviewVideoLoaded = false;
7168
+ this.threadsExampleOverviewVideoState = "failed";
7169
+ this.requestUpdate();
7170
+ }
7171
+ /** Settles one guarded play promise and ignores stale completion. */
7172
+ async settleThreadsExampleOverviewVideoPlay(video, lifecycleGeneration, playAttemptGeneration, playback) {
7173
+ try {
7174
+ await playback;
7175
+ if (this.isCurrentThreadsExampleOverviewVideo(video, lifecycleGeneration) && this.threadsExampleOverviewVideoPlayAttemptGeneration === playAttemptGeneration && this.threadsExampleOverviewVideoState !== "failed") {
7176
+ this.threadsExampleOverviewVideoState = "playing";
7177
+ this.requestUpdate();
7178
+ }
7179
+ } catch (_unused17) {
7180
+ if (this.isCurrentThreadsExampleOverviewVideo(video, lifecycleGeneration) && this.threadsExampleOverviewVideoPlayAttemptGeneration === playAttemptGeneration) this.failThreadsExampleOverviewVideo(video, lifecycleGeneration);
7181
+ } finally {
7182
+ if (this.threadsExampleOverviewVideoPlayAttemptGeneration === playAttemptGeneration) this.threadsExampleOverviewVideoPlayPromise = null;
7183
+ }
7184
+ }
7185
+ /** Starts at most one play request for the current media lifecycle. */
7186
+ playThreadsExampleOverviewVideo(video, lifecycleGeneration) {
7187
+ if (this.threadsExampleOverviewVideoPlayPromise !== null || this.threadsExampleOverviewVideoState === "deferred" || this.threadsExampleOverviewVideoState === "failed" || !this.isCurrentThreadsExampleOverviewVideo(video, lifecycleGeneration)) return;
7188
+ const playAttemptGeneration = this.threadsExampleOverviewVideoPlayAttemptGeneration + 1;
7189
+ this.threadsExampleOverviewVideoPlayAttemptGeneration = playAttemptGeneration;
7190
+ try {
7191
+ const playback = Promise.resolve(video.play());
7192
+ this.threadsExampleOverviewVideoPlayPromise = this.settleThreadsExampleOverviewVideoPlay(video, lifecycleGeneration, playAttemptGeneration, playback);
7193
+ } catch (_unused18) {
7194
+ this.failThreadsExampleOverviewVideo(video, lifecycleGeneration);
7195
+ }
7196
+ }
7197
+ /** Attaches the sole source for a generation and optionally starts playback. */
7198
+ activateThreadsExampleOverviewVideo(video, lifecycleGeneration, play) {
7199
+ if (this.threadsExampleOverviewVideoState !== "deferred" || !this.isCurrentThreadsExampleOverviewVideo(video, lifecycleGeneration)) return;
7200
+ this.threadsExampleOverviewVideoState = "ready";
7201
+ this.threadsExampleOverviewVideoLoaded = false;
7202
+ video.autoplay = !this.threadsExampleOverviewVideoReducedMotion;
7203
+ video.setAttribute("src", THREADS_EXAMPLE_OVERVIEW_VIDEO_URL);
7204
+ this.requestUpdate();
7205
+ if (play) this.playThreadsExampleOverviewVideo(video, lifecycleGeneration);
7206
+ }
7207
+ /** Schedules exactly one idle or timer gate for the current video. */
7208
+ scheduleThreadsExampleOverviewVideoLoad() {
7209
+ const video = this.threadsExampleOverviewVideoElement;
7210
+ if (!video || !this.isConnected || this.threadsExampleOverviewVideoState !== "deferred" || this.threadsExampleOverviewVideoLoadTimer !== null || this.threadsExampleOverviewVideoIdleCallbackId !== null || typeof window === "undefined") return;
7211
+ const lifecycleGeneration = this.threadsExampleOverviewVideoLifecycleGeneration;
6204
7212
  if (typeof window.requestIdleCallback === "function") {
6205
- this.threadsExampleOverviewVideoIdleCallbackId = window.requestIdleCallback(loadVideo, { timeout: 1200 });
7213
+ let idleCallbackId = 0;
7214
+ const loadVideo = () => {
7215
+ if (this.threadsExampleOverviewVideoIdleCallbackId !== idleCallbackId) return;
7216
+ this.threadsExampleOverviewVideoIdleCallbackId = null;
7217
+ this.activateThreadsExampleOverviewVideo(video, lifecycleGeneration, !this.threadsExampleOverviewVideoReducedMotion);
7218
+ };
7219
+ idleCallbackId = window.requestIdleCallback(loadVideo, { timeout: 1200 });
7220
+ this.threadsExampleOverviewVideoIdleCallbackId = idleCallbackId;
6206
7221
  return;
6207
7222
  }
6208
- this.threadsExampleOverviewVideoLoadTimer = window.setTimeout(loadVideo, 450);
7223
+ const loadTimer = window.setTimeout(() => {
7224
+ if (this.threadsExampleOverviewVideoLoadTimer !== loadTimer) return;
7225
+ this.threadsExampleOverviewVideoLoadTimer = null;
7226
+ this.activateThreadsExampleOverviewVideo(video, lifecycleGeneration, !this.threadsExampleOverviewVideoReducedMotion);
7227
+ }, 450);
7228
+ this.threadsExampleOverviewVideoLoadTimer = loadTimer;
7229
+ }
7230
+ /** Attaches one generation-scoped media listener set to the stable video. */
7231
+ bindThreadsExampleOverviewVideo(video) {
7232
+ const lifecycleGeneration = this.threadsExampleOverviewVideoLifecycleGeneration;
7233
+ const listeners = {
7234
+ loadeddata: () => {
7235
+ if (!this.isCurrentThreadsExampleOverviewVideo(video, lifecycleGeneration) || this.threadsExampleOverviewVideoState === "deferred" || this.threadsExampleOverviewVideoState === "failed") return;
7236
+ this.threadsExampleOverviewVideoLoaded = true;
7237
+ this.requestUpdate();
7238
+ },
7239
+ play: () => {
7240
+ if (this.isCurrentThreadsExampleOverviewVideo(video, lifecycleGeneration) && this.threadsExampleOverviewVideoState !== "deferred" && this.threadsExampleOverviewVideoState !== "failed") {
7241
+ this.threadsExampleOverviewVideoState = "playing";
7242
+ this.requestUpdate();
7243
+ }
7244
+ },
7245
+ pause: () => {
7246
+ if (this.isCurrentThreadsExampleOverviewVideo(video, lifecycleGeneration) && this.threadsExampleOverviewVideoState !== "deferred" && this.threadsExampleOverviewVideoState !== "failed") {
7247
+ this.invalidateThreadsExampleOverviewVideoPlay();
7248
+ this.threadsExampleOverviewVideoState = "ready";
7249
+ this.requestUpdate();
7250
+ }
7251
+ },
7252
+ error: () => {
7253
+ this.failThreadsExampleOverviewVideo(video, lifecycleGeneration);
7254
+ }
7255
+ };
7256
+ this.threadsExampleOverviewVideoElement = video;
7257
+ this.threadsExampleOverviewVideoListeners = listeners;
7258
+ video.addEventListener("loadeddata", listeners.loadeddata);
7259
+ video.addEventListener("play", listeners.play);
7260
+ video.addEventListener("pause", listeners.pause);
7261
+ video.addEventListener("error", listeners.error);
7262
+ video.muted = true;
7263
+ video.loop = true;
7264
+ video.playsInline = true;
7265
+ video.autoplay = this.threadsExampleOverviewVideoState !== "deferred" && !this.threadsExampleOverviewVideoReducedMotion;
7266
+ }
7267
+ /** Tears down gates, listeners, playback, and source in cleanup order. */
7268
+ cleanupThreadsExampleOverviewVideo() {
7269
+ const video = this.threadsExampleOverviewVideoElement;
7270
+ if (video) this.threadsExampleOverviewVideoLifecycleGeneration += 1;
7271
+ this.invalidateThreadsExampleOverviewVideoPlay();
7272
+ this.cancelThreadsExampleOverviewVideoGate();
7273
+ this.threadsExampleOverviewVideoPlayOnNextBind = false;
7274
+ const listeners = this.threadsExampleOverviewVideoListeners;
7275
+ if (video && listeners) {
7276
+ video.removeEventListener("loadeddata", listeners.loadeddata);
7277
+ video.removeEventListener("play", listeners.play);
7278
+ video.removeEventListener("pause", listeners.pause);
7279
+ video.removeEventListener("error", listeners.error);
7280
+ }
7281
+ this.threadsExampleOverviewVideoElement = null;
7282
+ this.threadsExampleOverviewVideoListeners = null;
7283
+ if (video) {
7284
+ try {
7285
+ video.pause();
7286
+ } catch (_unused19) {}
7287
+ video.removeAttribute("src");
7288
+ try {
7289
+ video.load();
7290
+ } catch (_unused20) {}
7291
+ }
7292
+ this.threadsExampleOverviewVideoLoaded = false;
7293
+ this.threadsExampleOverviewVideoState = "deferred";
7294
+ }
7295
+ /** Reconciles the rendered media node with its current lifecycle. */
7296
+ syncThreadsExampleOverviewVideo() {
7297
+ var _this$shadowRoot5;
7298
+ const video = (_this$shadowRoot5 = this.shadowRoot) === null || _this$shadowRoot5 === void 0 ? void 0 : _this$shadowRoot5.querySelector(".cpk-threads-overview-video");
7299
+ if (!video) {
7300
+ if (this.threadsExampleOverviewVideoElement || this.threadsExampleOverviewVideoState !== "deferred" || this.threadsExampleOverviewVideoLoadTimer !== null || this.threadsExampleOverviewVideoIdleCallbackId !== null || this.threadsExampleOverviewVideoPlayOnNextBind) this.cleanupThreadsExampleOverviewVideo();
7301
+ return;
7302
+ }
7303
+ if (this.threadsExampleOverviewVideoElement !== video) {
7304
+ if (this.threadsExampleOverviewVideoElement) this.cleanupThreadsExampleOverviewVideo();
7305
+ this.bindThreadsExampleOverviewVideo(video);
7306
+ }
7307
+ if (this.threadsExampleOverviewVideoPlayOnNextBind) {
7308
+ this.threadsExampleOverviewVideoPlayOnNextBind = false;
7309
+ this.activateThreadsExampleOverviewVideo(video, this.threadsExampleOverviewVideoLifecycleGeneration, true);
7310
+ return;
7311
+ }
7312
+ this.scheduleThreadsExampleOverviewVideoLoad();
6209
7313
  }
6210
7314
  renderThreadsExampleOverviewVideo() {
6211
- this.scheduleThreadsExampleOverviewVideoLoad();
7315
+ const isPlaying = this.threadsExampleOverviewVideoState === "playing";
7316
+ const sourceIsAttached = this.threadsExampleOverviewVideoState !== "deferred";
7317
+ const video = lit.html`<video
7318
+ class="cpk-threads-overview-video"
7319
+ data-loaded=${this.threadsExampleOverviewVideoLoaded}
7320
+ ?autoplay=${sourceIsAttached && !this.threadsExampleOverviewVideoReducedMotion}
7321
+ .autoplay=${sourceIsAttached && !this.threadsExampleOverviewVideoReducedMotion}
7322
+ loop
7323
+ .loop=${true}
7324
+ muted
7325
+ .muted=${true}
7326
+ playsinline
7327
+ .playsInline=${true}
7328
+ preload="metadata"
7329
+ ></video>`;
6212
7330
  return lit.html`
6213
7331
  <div class="cpk-threads-overview-video-frame" aria-hidden="true">
6214
- ${this.threadsExampleOverviewVideoShouldLoad ? lit.html`
6215
- <video
6216
- class="cpk-threads-overview-video"
6217
- data-ready=${this.threadsExampleOverviewVideoReady}
6218
- src=${THREADS_EXAMPLE_OVERVIEW_VIDEO_URL}
6219
- autoplay
6220
- loop
6221
- muted
6222
- playsinline
6223
- preload="metadata"
6224
- @loadeddata=${this.handleThreadsExampleOverviewVideoLoaded}
6225
- ></video>
6226
- ` : lit.nothing}
7332
+ ${this.threadsExampleOverviewVideoLifecycleGeneration % 2 === 0 ? lit.html`<!-- cpk-video-generation-even -->${video}` : lit.html`<!-- cpk-video-generation-odd -->${video}`}
6227
7333
  </div>
7334
+ <button
7335
+ class="cpk-threads-overview-video-control"
7336
+ type="button"
7337
+ aria-pressed=${isPlaying ? "false" : "true"}
7338
+ @click=${this.handleThreadsExampleOverviewVideoControl}
7339
+ >
7340
+ ${isPlaying ? "Pause demo" : "Play demo"}
7341
+ </button>
7342
+ ${this.threadsExampleOverviewVideoState === "failed" ? lit.html`
7343
+ <p class="cpk-threads-overview-video-fallback" role="status">
7344
+ ${THREADS_EXAMPLE_OVERVIEW_VIDEO_FALLBACK}
7345
+ </p>
7346
+ ` : lit.nothing}
6228
7347
  `;
6229
7348
  }
6230
- renderThreadsExampleOverview() {
7349
+ /** Show a copy result briefly and announce it to assistive technology. */
7350
+ showThreadsSetupPromptCopyState(state, generation) {
7351
+ if (!this.isConnected || generation !== this.threadsSetupPromptCopyGeneration) return;
7352
+ if (this.threadsSetupPromptCopyResetTimeoutId !== null) window.clearTimeout(this.threadsSetupPromptCopyResetTimeoutId);
7353
+ this.threadsSetupPromptCopyState = state;
7354
+ this.requestUpdate();
7355
+ this.threadsSetupPromptCopyResetTimeoutId = window.setTimeout(() => {
7356
+ if (!this.isConnected || generation !== this.threadsSetupPromptCopyGeneration) return;
7357
+ this.threadsSetupPromptCopyState = "idle";
7358
+ this.threadsSetupPromptCopyResetTimeoutId = null;
7359
+ this.requestUpdate();
7360
+ }, 2e3);
7361
+ }
7362
+ renderThreadsExampleOverview(locked) {
7363
+ var _lockedCopy$heading, _lockedCopy$descripti;
7364
+ const lockedCopy = locked ? this.getThreadsLockedCopy() : void 0;
7365
+ const { lockedAction } = this.inspectorMetadataProjection;
7366
+ const onboardingAction = this.getThreadsEmptyOnboardingAction();
6231
7367
  return lit.html`
6232
7368
  <div
6233
7369
  style="
@@ -6250,7 +7386,7 @@ ${argsString}</pre
6250
7386
  color: #010507;
6251
7387
  "
6252
7388
  >
6253
- Threads are persistent, inspectable conversations
7389
+ ${(_lockedCopy$heading = lockedCopy === null || lockedCopy === void 0 ? void 0 : lockedCopy.heading) !== null && _lockedCopy$heading !== void 0 ? _lockedCopy$heading : "Threads are persistent, inspectable conversations"}
6254
7390
  </h2>
6255
7391
  ${this.renderThreadsExampleOverviewVideo()}
6256
7392
  <p
@@ -6261,61 +7397,90 @@ ${argsString}</pre
6261
7397
  color: #57575b;
6262
7398
  "
6263
7399
  >
6264
- Take a tour with the example threads in the sidebar. Then, start
6265
- chatting in your app to create the first real thread.
7400
+ ${(_lockedCopy$descripti = lockedCopy === null || lockedCopy === void 0 ? void 0 : lockedCopy.description) !== null && _lockedCopy$descripti !== void 0 ? _lockedCopy$descripti : "Take a tour with the example threads in the sidebar. Then, start chatting in your app to create the first real thread."}
6266
7401
  </p>
6267
7402
  <div style="display:flex;flex-wrap:wrap;gap:8px;">
6268
- <a
6269
- href=${this.getThreadsDocsUrl()}
6270
- target="_blank"
6271
- rel="noopener"
6272
- style="
6273
- display: inline-flex;
6274
- align-items: center;
6275
- justify-content: center;
6276
- gap: 6px;
6277
- min-height: 34px;
6278
- border-radius: 6px;
6279
- background: #010507;
6280
- padding: 8px 12px;
6281
- font-size: 12px;
6282
- font-weight: 600;
6283
- color: #ffffff;
6284
- text-decoration: none;
6285
- "
6286
- >
6287
- Learn how Threads work
6288
- </a>
6289
- <a
6290
- href=${this.getSelfHostedIntelligenceUrl()}
6291
- target="_blank"
6292
- rel="noopener"
6293
- style="
6294
- display: inline-flex;
6295
- align-items: center;
6296
- justify-content: center;
6297
- gap: 6px;
6298
- min-height: 34px;
6299
- border-radius: 6px;
6300
- border: 1px solid #dbdbe5;
6301
- background: #ffffff;
6302
- padding: 8px 12px;
6303
- font-size: 12px;
6304
- font-weight: 600;
6305
- color: #010507;
6306
- text-decoration: none;
6307
- "
6308
- >
6309
- Explore self-hosted Intelligence
6310
- </a>
7403
+ ${locked ? lit.html`
7404
+ ${this.inspectorMetadataProjection.licenseState === "valid" ? lit.html`
7405
+ <button
7406
+ data-inspector-threads-setup-prompt
7407
+ type="button"
7408
+ aria-label=${this.threadsSetupPromptCopyState === "copied" ? "Setup prompt copied" : this.threadsSetupPromptCopyState === "error" ? "Copy setup prompt failed. Try again" : "Copy setup prompt for your coding agent"}
7409
+ @click=${this.handleThreadsSetupPromptCopy}
7410
+ >
7411
+ ${this.renderIcon(this.threadsSetupPromptCopyState === "copied" ? "Check" : "Copy")}
7412
+ ${this.threadsSetupPromptCopyState === "copied" ? "Copied" : this.threadsSetupPromptCopyState === "error" ? "Copy blocked" : "Copy prompt for your agent"}
7413
+ </button>
7414
+ <a
7415
+ data-inspector-threads-setup-link
7416
+ href=${this.getThreadsRuntimeSetupDocsUrl()}
7417
+ target="_blank"
7418
+ rel="noopener"
7419
+ aria-label="Open setup guide (opens in a new tab)"
7420
+ >
7421
+ Open setup guide
7422
+ </a>
7423
+ <span
7424
+ class="sr-only"
7425
+ data-inspector-threads-setup-copy-status
7426
+ aria-live="polite"
7427
+ >${this.threadsSetupPromptCopyState === "copied" ? "Setup prompt copied." : this.threadsSetupPromptCopyState === "error" ? "Setup prompt copy failed. Open the setup guide and copy it manually." : ""}</span
7428
+ >
7429
+ ` : lit.nothing}
7430
+ ${lockedAction ? this.renderInspectorAction(lockedAction, "locked") : lit.nothing}
7431
+ ` : lit.html`
7432
+ <a
7433
+ href=${this.getThreadsDocsUrl()}
7434
+ target="_blank"
7435
+ rel="noopener"
7436
+ style="
7437
+ display: inline-flex;
7438
+ align-items: center;
7439
+ justify-content: center;
7440
+ gap: 6px;
7441
+ min-height: 34px;
7442
+ border-radius: 6px;
7443
+ background: #010507;
7444
+ padding: 8px 12px;
7445
+ font-size: 12px;
7446
+ font-weight: 600;
7447
+ color: #ffffff;
7448
+ text-decoration: none;
7449
+ "
7450
+ >
7451
+ Learn how Threads work
7452
+ </a>
7453
+ <a
7454
+ href=${onboardingAction.href}
7455
+ target="_blank"
7456
+ rel="noopener"
7457
+ style="
7458
+ display: inline-flex;
7459
+ align-items: center;
7460
+ justify-content: center;
7461
+ gap: 6px;
7462
+ min-height: 34px;
7463
+ border-radius: 6px;
7464
+ border: 1px solid #dbdbe5;
7465
+ background: #ffffff;
7466
+ padding: 8px 12px;
7467
+ font-size: 12px;
7468
+ font-weight: 600;
7469
+ color: #010507;
7470
+ text-decoration: none;
7471
+ "
7472
+ >
7473
+ ${onboardingAction.label}
7474
+ </a>
7475
+ `}
6311
7476
  </div>
6312
7477
  </div>
6313
7478
  </div>
6314
7479
  `;
6315
7480
  }
6316
7481
  renderThreadsExampleTour() {
6317
- var _THREADS_EXAMPLE_TOUR4;
6318
- if (!this.selectedThreadId || !this.isExampleThreadId(this.selectedThreadId)) return lit.nothing;
7482
+ var _THREADS_EXAMPLE_TOUR2;
7483
+ if (!this.selectedThreadId || this.selectedThreadId !== this.selectedLocalExampleThreadId) return lit.nothing;
6319
7484
  if (!this.exampleTourActive) return lit.html`
6320
7485
  <button
6321
7486
  type="button"
@@ -6339,7 +7504,7 @@ ${argsString}</pre
6339
7504
  Show tour
6340
7505
  </button>
6341
7506
  `;
6342
- const step = (_THREADS_EXAMPLE_TOUR4 = THREADS_EXAMPLE_TOUR_STEPS[this.exampleTourStep]) !== null && _THREADS_EXAMPLE_TOUR4 !== void 0 ? _THREADS_EXAMPLE_TOUR4 : THREADS_EXAMPLE_TOUR_STEPS[0];
7507
+ const step = (_THREADS_EXAMPLE_TOUR2 = THREADS_EXAMPLE_TOUR_STEPS[this.exampleTourStep]) !== null && _THREADS_EXAMPLE_TOUR2 !== void 0 ? _THREADS_EXAMPLE_TOUR2 : THREADS_EXAMPLE_TOUR_STEPS[0];
6343
7508
  const isFirst = this.exampleTourStep === 0;
6344
7509
  const isLast = this.exampleTourStep === THREADS_EXAMPLE_TOUR_STEPS.length - 1;
6345
7510
  return lit.html`
@@ -6366,7 +7531,7 @@ ${argsString}</pre
6366
7531
  font-family: 'Spline Sans Mono', monospace;
6367
7532
  font-size: 10px;
6368
7533
  font-weight: 600;
6369
- color: #189370;
7534
+ color: #087653;
6370
7535
  text-transform: uppercase;
6371
7536
  "
6372
7537
  >
@@ -6397,7 +7562,7 @@ ${argsString}</pre
6397
7562
  >
6398
7563
  <button
6399
7564
  type="button"
6400
- style="border:0;background:transparent;color:#838389;font-size:12px;font-weight:600;cursor:pointer;padding:7px 0;"
7565
+ style="border:0;background:transparent;color:#68686e;font-size:12px;font-weight:600;cursor:pointer;padding:7px 0;"
6401
7566
  @click=${() => this.dismissExampleTour("skip")}
6402
7567
  >
6403
7568
  Skip
@@ -6576,124 +7741,25 @@ ${argsString}</pre
6576
7741
  </div>
6577
7742
  `;
6578
7743
  }
6579
- renderThreadsLockedView() {
6580
- this.trackThreadsViewStateOnce("locked", 0);
6581
- return lit.html`
6582
- <div
6583
- style="
6584
- position: relative;
6585
- height: 100%;
6586
- display: flex;
6587
- align-items: center;
6588
- justify-content: center;
6589
- padding: 32px;
6590
- overflow: hidden;
6591
- background: #ffffff;
6592
- "
6593
- >
6594
- ${this.renderThreadsLockedBackgroundMockup()}
6595
- <div
6596
- aria-hidden="true"
6597
- style="
6598
- position: absolute;
6599
- inset: 0;
6600
- pointer-events: none;
6601
- background:
6602
- radial-gradient(circle at center, rgba(255,255,255,0.9) 0, rgba(255,255,255,0.78) 24%, rgba(255,255,255,0.34) 48%, rgba(255,255,255,0.56) 100%);
6603
- "
6604
- ></div>
6605
- <div
6606
- style="
6607
- position: relative;
6608
- z-index: 1;
6609
- max-width: 440px;
6610
- text-align: center;
6611
- color: #57575b;
6612
- "
6613
- >
6614
- <div
6615
- aria-hidden="true"
6616
- style="
6617
- margin: 0 auto 18px;
6618
- display: flex;
6619
- justify-content: center;
6620
- "
6621
- >
6622
- <div
6623
- style="
6624
- display: flex;
6625
- height: 44px;
6626
- width: 44px;
6627
- align-items: center;
6628
- justify-content: center;
6629
- border: 1px solid #dfd6fb;
6630
- border-radius: 8px;
6631
- background: #eee6fe;
6632
- color: #57575b;
6633
- box-shadow: 0 8px 18px rgba(87, 87, 91, 0.14);
6634
- "
6635
- >
6636
- ${this.renderIcon("Lock")}
6637
- </div>
6638
- </div>
6639
- <h2
6640
- style="
6641
- margin: 0 0 8px;
6642
- font-size: 16px;
6643
- line-height: 1.35;
6644
- font-weight: 600;
6645
- color: #010507;
6646
- "
6647
- >
6648
- Enable Intelligence to inspect Threads.
6649
- </h2>
6650
- <p
6651
- style="
6652
- margin: 0 auto 18px;
6653
- max-width: 380px;
6654
- font-size: 13px;
6655
- line-height: 1.55;
6656
- color: #57575b;
6657
- "
6658
- >
6659
- Persist conversations and inspect saved thread history from the
6660
- Inspector.
6661
- </p>
6662
- <div
6663
- style="
6664
- display: flex;
6665
- flex-wrap: wrap;
6666
- justify-content: center;
6667
- gap: 8px;
6668
- "
6669
- >
6670
- <a
6671
- href=${this.getThreadsIntelligenceSignupUrl()}
6672
- target="_blank"
6673
- rel="noopener"
6674
- style="
6675
- display: inline-flex;
6676
- min-height: 34px;
6677
- align-items: center;
6678
- justify-content: center;
6679
- gap: 6px;
6680
- border-radius: 6px;
6681
- border: 1px solid #dbdbe5;
6682
- background: #ffffff;
6683
- padding: 8px 12px;
6684
- font-size: 12px;
6685
- font-weight: 600;
6686
- color: #57575b;
6687
- text-decoration: none;
6688
- "
6689
- @click=${this.handleThreadsIntelligenceSignupClick}
6690
- >
6691
- Sign up for Intelligence
6692
- </a>
6693
- </div>
6694
- </div>
6695
- </div>
6696
- `;
7744
+ getThreadsLockedCopy() {
7745
+ switch (this.inspectorMetadataProjection.licenseState) {
7746
+ case "valid": return {
7747
+ heading: "Finish setting up Rich Threads",
7748
+ description: "Copy this prompt into your coding agent to finish the setup."
7749
+ };
7750
+ case "none": return {
7751
+ heading: "Enable Intelligence to inspect Threads.",
7752
+ description: "Persist conversations and inspect saved thread history from the Inspector."
7753
+ };
7754
+ case "expired": return {
7755
+ heading: "Renew Intelligence to inspect Threads.",
7756
+ description: "Your Intelligence access has expired. Renew it to inspect saved thread history."
7757
+ };
7758
+ case "unknown": return {
7759
+ heading: "Threads are unavailable.",
7760
+ description: "This runtime does not expose Threads for the Inspector."
7761
+ };
7762
+ }
6697
7763
  }
6698
7764
  /**
6699
7765
  * Renders the realtime-connection indicator in the memory-store header.
@@ -6713,7 +7779,7 @@ ${argsString}</pre
6713
7779
  gap: 4px;
6714
7780
  font-size: 10px;
6715
7781
  font-weight: 500;
6716
- color: ${connected ? "#57575b" : "#838389"};
7782
+ color: ${connected ? "#57575b" : "#68686e"};
6717
7783
  "
6718
7784
  >
6719
7785
  <span
@@ -6877,7 +7943,7 @@ ${argsString}</pre
6877
7943
  align-items: center;
6878
7944
  justify-content: center;
6879
7945
  gap: 8px;
6880
- color: #838389;
7946
+ color: #68686e;
6881
7947
  "
6882
7948
  >
6883
7949
  <svg
@@ -6919,7 +7985,7 @@ ${argsString}</pre
6919
7985
  align-items: center;
6920
7986
  justify-content: center;
6921
7987
  gap: 8px;
6922
- color: #838389;
7988
+ color: #68686e;
6923
7989
  "
6924
7990
  >
6925
7991
  <svg
@@ -7011,18 +8077,66 @@ ${argsString}</pre
7011
8077
  ></cpk-memory-list>
7012
8078
  </div>
7013
8079
  </div>
8080
+ `;
8081
+ }
8082
+ /** Renders trusted Threads usage and its independent plan action. */
8083
+ renderThreadsUsageFooter() {
8084
+ const { usage, threadsFooterAction } = this.inspectorMetadataProjection;
8085
+ if (!usage && !threadsFooterAction) return lit.nothing;
8086
+ let countLabel;
8087
+ let progressMax;
8088
+ let progressValue;
8089
+ const capacityState = this.getThreadsCapacityState();
8090
+ if (usage) if (usage.limit.kind === "finite") {
8091
+ countLabel = `${usage.used > usage.limit.value ? `${usage.limit.value}+` : String(usage.used)} / ${usage.limit.value} Threads`;
8092
+ progressMax = usage.limit.value;
8093
+ progressValue = Math.min(usage.used, usage.limit.value);
8094
+ } else if (usage.limit.kind === "unlimited") countLabel = `${usage.used} Threads · Unlimited`;
8095
+ else countLabel = `${usage.used} Threads · Limit unavailable`;
8096
+ return lit.html`
8097
+ <footer
8098
+ class="inspector-threads-footer"
8099
+ data-inspector-threads-footer
8100
+ role="group"
8101
+ aria-label="Threads usage"
8102
+ >
8103
+ ${usage && countLabel ? lit.html`
8104
+ <div class="inspector-threads-usage">
8105
+ <span data-inspector-thread-count>${countLabel}</span>
8106
+ ${progressMax !== void 0 && progressValue !== void 0 ? lit.html`
8107
+ <progress
8108
+ class="inspector-thread-progress"
8109
+ data-inspector-thread-progress
8110
+ data-inspector-thread-capacity=${capacityState}
8111
+ max=${progressMax}
8112
+ value=${progressValue}
8113
+ aria-label=${capacityState === "warning" ? `${countLabel}. Near thread limit.` : capacityState === "critical" ? `${countLabel}. Thread limit reached.` : countLabel}
8114
+ >${countLabel}</progress
8115
+ >
8116
+ ` : lit.nothing}
8117
+ ${usage.expiringSoonCount !== void 0 ? lit.html`
8118
+ <span data-inspector-thread-expiry
8119
+ >${usage.expiringSoonCount} Expiring Soon</span
8120
+ >
8121
+ ` : lit.nothing}
8122
+ </div>
8123
+ ` : lit.nothing}
8124
+ ${threadsFooterAction ? this.renderInspectorAction(threadsFooterAction, "threads-footer", capacityState === "warning" || capacityState === "critical" ? "Upgrade Your Plan" : threadsFooterAction.label) : lit.nothing}
8125
+ </footer>
7014
8126
  `;
7015
8127
  }
7016
8128
  renderThreadsView() {
7017
- var _visibleThreads$find, _this$_core$runtimeUr, _this$_core4, _this$_core$headers, _this$_core5, _this$_core6, _this$liveMessageVers2, _this$agentEvents$get6;
7018
- if (!this.areThreadEndpointsAvailable()) return this.renderThreadsLockedView();
7019
- const { displayThreads, threadsErrorMessage } = this.getActiveThreadsState();
7020
- const showingExamples = this.shouldRenderExampleThreads(displayThreads, threadsErrorMessage);
7021
- const visibleThreads = this.getVisibleThreads(displayThreads, threadsErrorMessage);
8129
+ var _visibleThreads$find, _this$_core$runtimeUr, _this$_core6, _this$_core$headers, _this$_core7, _this$_core8, _this$liveMessageVers2, _this$agentEvents$get6;
8130
+ const locked = !this.areThreadEndpointsAvailable();
8131
+ const { displayThreads, threadsErrorMessage, threadsLoading } = this.getActiveThreadsState();
8132
+ const loadingWithoutRows = !locked && threadsLoading && !threadsErrorMessage && displayThreads.length === 0;
8133
+ const showingExamples = this.shouldRenderExampleThreads(locked, displayThreads, threadsErrorMessage, threadsLoading);
8134
+ const visibleThreads = !locked && (threadsErrorMessage || loadingWithoutRows) ? [] : showingExamples ? THREADS_EXAMPLE_THREADS : displayThreads;
7022
8135
  if (showingExamples) this.trackThreadsExampleViewedOnce();
7023
8136
  const selectedThread = this.selectedThreadId != null ? (_visibleThreads$find = visibleThreads.find((t) => t.id === this.selectedThreadId)) !== null && _visibleThreads$find !== void 0 ? _visibleThreads$find : null : null;
7024
- const selectedThreadIsExample = this.isExampleThreadId(selectedThread === null || selectedThread === void 0 ? void 0 : selectedThread.id);
7025
- if (!threadsErrorMessage) this.trackThreadsViewStateOnce(displayThreads.length === 0 ? "empty_enabled" : "enabled", displayThreads.length);
8137
+ const selectedThreadIsLocalExample = selectedThread !== null && selectedThread.id === this.selectedLocalExampleThreadId;
8138
+ if (locked) this.trackThreadsViewStateOnce("locked");
8139
+ else if (!threadsErrorMessage && (!threadsLoading || displayThreads.length > 0)) this.trackThreadsViewStateOnce(displayThreads.length === 0 ? "empty_enabled" : "enabled");
7026
8140
  return lit.html`
7027
8141
  <div style="display:flex;height:100%;overflow:hidden;flex-direction:column;">
7028
8142
  <div style="display:flex;min-height:0;flex:1;overflow:hidden;">
@@ -7031,14 +8145,16 @@ ${argsString}</pre
7031
8145
  style="width:${this.threadListWidth}px;flex-shrink:0;overflow:hidden;display:flex;flex-direction:column;border-right:1px solid #DBDBE5;"
7032
8146
  >
7033
8147
  <cpk-thread-list
7034
- style="height:100%;"
8148
+ style="min-height:0;flex:1;"
7035
8149
  .threads=${visibleThreads}
7036
8150
  .selectedThreadId=${this.selectedThreadId}
7037
8151
  .errorMessage=${threadsErrorMessage}
8152
+ .suppressEmptyState=${loadingWithoutRows}
7038
8153
  @threadSelected=${(e) => {
7039
8154
  this.handleThreadsThreadSelected(e.detail, showingExamples);
7040
8155
  }}
7041
8156
  ></cpk-thread-list>
8157
+ ${this.renderThreadsUsageFooter()}
7042
8158
  </div>
7043
8159
 
7044
8160
  <!-- Resize divider -->
@@ -7052,19 +8168,53 @@ ${argsString}</pre
7052
8168
 
7053
8169
  <!-- Center + right: thread details or empty state -->
7054
8170
  <div style="flex:1;min-width:0;overflow:hidden;display:flex;position:relative;">
7055
- ${selectedThread ? lit.html`<cpk-thread-details
8171
+ ${!locked && threadsErrorMessage ? lit.html`
8172
+ <div
8173
+ role="alert"
8174
+ style="
8175
+ display: flex;
8176
+ flex: 1;
8177
+ flex-direction: column;
8178
+ align-items: center;
8179
+ justify-content: center;
8180
+ gap: 6px;
8181
+ padding: 24px;
8182
+ color: #c0333a;
8183
+ text-align: center;
8184
+ "
8185
+ >
8186
+ <strong style="font-size:13px;">Failed to load threads</strong>
8187
+ <span style="max-width:440px;font-size:12px;line-height:1.5;"
8188
+ >${threadsErrorMessage}</span
8189
+ >
8190
+ </div>
8191
+ ` : loadingWithoutRows ? lit.html`
8192
+ <div
8193
+ role="status"
8194
+ style="
8195
+ display: flex;
8196
+ flex: 1;
8197
+ align-items: center;
8198
+ justify-content: center;
8199
+ color: #57575b;
8200
+ font-size: 13px;
8201
+ "
8202
+ >
8203
+ Loading threads…
8204
+ </div>
8205
+ ` : selectedThread ? lit.html`<cpk-thread-details
7056
8206
  style="flex:1;min-width:0;"
7057
8207
  .threadId=${selectedThread.id}
7058
8208
  .thread=${selectedThread}
7059
- .provider=${selectedThreadIsExample ? this.getExampleThreadProvider(selectedThread.id) : null}
7060
- .runtimeUrl=${(_this$_core$runtimeUr = (_this$_core4 = this._core) === null || _this$_core4 === void 0 ? void 0 : _this$_core4.runtimeUrl) !== null && _this$_core$runtimeUr !== void 0 ? _this$_core$runtimeUr : ""}
7061
- .headers=${(_this$_core$headers = (_this$_core5 = this._core) === null || _this$_core5 === void 0 ? void 0 : _this$_core5.headers) !== null && _this$_core$headers !== void 0 ? _this$_core$headers : {}}
7062
- .threadInspectionAvailable=${selectedThreadIsExample || ((_this$_core6 = this._core) === null || _this$_core6 === void 0 || (_this$_core6 = _this$_core6.threadEndpoints) === null || _this$_core6 === void 0 ? void 0 : _this$_core6.inspect) !== false}
8209
+ .provider=${selectedThreadIsLocalExample ? this.getExampleThreadProvider(selectedThread.id) : null}
8210
+ .runtimeUrl=${selectedThreadIsLocalExample ? "" : (_this$_core$runtimeUr = (_this$_core6 = this._core) === null || _this$_core6 === void 0 ? void 0 : _this$_core6.runtimeUrl) !== null && _this$_core$runtimeUr !== void 0 ? _this$_core$runtimeUr : ""}
8211
+ .headers=${(_this$_core$headers = (_this$_core7 = this._core) === null || _this$_core7 === void 0 ? void 0 : _this$_core7.headers) !== null && _this$_core$headers !== void 0 ? _this$_core$headers : {}}
8212
+ .threadInspectionAvailable=${selectedThreadIsLocalExample || this.areThreadEndpointsAvailable() && ((_this$_core8 = this._core) === null || _this$_core8 === void 0 || (_this$_core8 = _this$_core8.threadEndpoints) === null || _this$_core8 === void 0 ? void 0 : _this$_core8.inspect) !== false}
7063
8213
  .liveMessageVersion=${(_this$liveMessageVers2 = this.liveMessageVersion.get(selectedThread.id)) !== null && _this$liveMessageVers2 !== void 0 ? _this$liveMessageVers2 : 0}
7064
8214
  .agentStateInput=${this.getLatestStateForAgent(selectedThread.agentId)}
7065
8215
  .agentEventsInput=${(_this$agentEvents$get6 = this.agentEvents.get(selectedThread.agentId)) !== null && _this$agentEvents$get6 !== void 0 ? _this$agentEvents$get6 : []}
7066
8216
  ></cpk-thread-details>
7067
- ${selectedThreadIsExample ? this.renderThreadsExampleTour() : lit.nothing}` : showingExamples ? this.renderThreadsExampleOverview() : lit.html`
8217
+ ${selectedThreadIsLocalExample ? this.renderThreadsExampleTour() : lit.nothing}` : showingExamples ? this.renderThreadsExampleOverview(locked) : lit.html`
7068
8218
  <div
7069
8219
  style="
7070
8220
  flex: 1;
@@ -7073,7 +8223,7 @@ ${argsString}</pre
7073
8223
  align-items: center;
7074
8224
  justify-content: center;
7075
8225
  gap: 8px;
7076
- color: #838389;
8226
+ color: #68686e;
7077
8227
  "
7078
8228
  >
7079
8229
  <svg
@@ -7603,9 +8753,12 @@ ${prettyEvent}</pre
7603
8753
  `;
7604
8754
  }
7605
8755
  handleMenuSelect(key) {
7606
- if (key !== "settings" && !this.menuItems.some((item) => item.key === key)) return;
8756
+ if (!this.menuItems.some((item) => item.key === key)) return;
7607
8757
  const previousMenu = this.selectedMenu;
8758
+ this.pendingPersistedMenu = null;
7608
8759
  this.selectedMenu = key;
8760
+ this.settingsOpen = false;
8761
+ this.lastSelectedMenuByGroup[this.getGroupForMenu(key)] = key;
7609
8762
  if (key === "agents" && this.selectedContext === "all-agents") {
7610
8763
  const agentOptions = this.contextOptions.filter((opt) => opt.key !== "all-agents");
7611
8764
  if (agentOptions.length > 0) {
@@ -7634,8 +8787,8 @@ ${prettyEvent}</pre
7634
8787
  if (previousMenu !== "memories" && !((_this$core29 = this.core) === null || _this$core29 === void 0 ? void 0 : _this$core29.telemetryDisabled)) trackMemoriesTabClicked(this.getMemoriesTelemetryProps());
7635
8788
  }
7636
8789
  if (key === "ag-ui-events" || key === "agents") requestAnimationFrame(() => {
7637
- var _this$shadowRoot3;
7638
- const scroller = (_this$shadowRoot3 = this.shadowRoot) === null || _this$shadowRoot3 === void 0 ? void 0 : _this$shadowRoot3.getElementById("cpk-main-scroll");
8790
+ var _this$shadowRoot6;
8791
+ const scroller = (_this$shadowRoot6 = this.shadowRoot) === null || _this$shadowRoot6 === void 0 ? void 0 : _this$shadowRoot6.getElementById("cpk-main-scroll");
7639
8792
  if (scroller) scroller.scrollTop = 0;
7640
8793
  });
7641
8794
  this.contextMenuOpen = false;
@@ -7653,6 +8806,7 @@ ${prettyEvent}</pre
7653
8806
  if (this.selectedContext !== key) {
7654
8807
  this.selectedContext = key;
7655
8808
  this.expandedRows.clear();
8809
+ this.autoSelectLatestThread();
7656
8810
  }
7657
8811
  this.contextMenuOpen = false;
7658
8812
  this.persistState();
@@ -8042,9 +9196,9 @@ ${prettyEvent}</pre
8042
9196
  let currentSchema = schema;
8043
9197
  let def = currentSchema._def;
8044
9198
  while (def.typeName === "ZodOptional" || def.typeName === "ZodNullable" || def.typeName === "ZodDefault") {
8045
- var _ref6;
9199
+ var _ref10;
8046
9200
  if (def.typeName === "ZodDefault" && def.defaultValue !== void 0) info.defaultValue = typeof def.defaultValue === "function" ? def.defaultValue() : def.defaultValue;
8047
- currentSchema = (_ref6 = def.innerType) !== null && _ref6 !== void 0 ? _ref6 : currentSchema;
9201
+ currentSchema = (_ref10 = def.innerType) !== null && _ref10 !== void 0 ? _ref10 : currentSchema;
8048
9202
  if (!(currentSchema === null || currentSchema === void 0 ? void 0 : currentSchema._def)) break;
8049
9203
  def = currentSchema._def;
8050
9204
  }
@@ -8214,13 +9368,13 @@ ${prettyEvent}</pre
8214
9368
  if (typeof value === "function") return value.toString();
8215
9369
  try {
8216
9370
  return JSON.stringify(value, null, 2);
8217
- } catch (_unused10) {
9371
+ } catch (_unused21) {
8218
9372
  return String(value);
8219
9373
  }
8220
9374
  }
8221
9375
  async copyContextValue(value, contextId) {
8222
- var _navigator$clipboard2;
8223
- if (typeof navigator === "undefined" || !((_navigator$clipboard2 = navigator.clipboard) === null || _navigator$clipboard2 === void 0 ? void 0 : _navigator$clipboard2.writeText)) {
9376
+ var _navigator$clipboard3;
9377
+ if (typeof navigator === "undefined" || !((_navigator$clipboard3 = navigator.clipboard) === null || _navigator$clipboard3 === void 0 ? void 0 : _navigator$clipboard3.writeText)) {
8224
9378
  console.warn("Clipboard API is not available in this environment.");
8225
9379
  return;
8226
9380
  }
@@ -8431,7 +9585,7 @@ ${prettyEvent}</pre
8431
9585
  try {
8432
9586
  const url = new URL(href, typeof window !== "undefined" ? window.location.href : "https://copilotkit.ai");
8433
9587
  return url.protocol === "http:" || url.protocol === "https:" || url.protocol === "mailto:";
8434
- } catch (_unused11) {
9588
+ } catch (_unused22) {
8435
9589
  return false;
8436
9590
  }
8437
9591
  }
@@ -8461,7 +9615,7 @@ ${prettyEvent}</pre
8461
9615
  }
8462
9616
  if (isRootRelative) return `${url.pathname}${url.search}${url.hash}`;
8463
9617
  return url.toString();
8464
- } catch (_unused12) {
9618
+ } catch (_unused23) {
8465
9619
  return href;
8466
9620
  }
8467
9621
  }
@@ -8480,7 +9634,7 @@ ${prettyEvent}</pre
8480
9634
  const parsed = JSON.parse(raw);
8481
9635
  if (parsed && typeof parsed.timestamp === "string") return parsed.timestamp;
8482
9636
  return null;
8483
- } catch (_unused13) {}
9637
+ } catch (_unused24) {}
8484
9638
  return null;
8485
9639
  }
8486
9640
  persistAnnouncementTimestamp(timestamp) {
@@ -8488,7 +9642,7 @@ ${prettyEvent}</pre
8488
9642
  try {
8489
9643
  const payload = JSON.stringify({ timestamp });
8490
9644
  window.localStorage.setItem(ANNOUNCEMENT_STORAGE_KEY, payload);
8491
- } catch (_unused14) {}
9645
+ } catch (_unused25) {}
8492
9646
  }
8493
9647
  markAnnouncementSeen() {
8494
9648
  this.hasUnseenAnnouncement = false;
@@ -8670,7 +9824,7 @@ ${prettyEvent}</pre
8670
9824
  align-items: center;
8671
9825
  justify-content: center;
8672
9826
  border-radius: 6px;
8673
- color: #838389;
9827
+ color: #68686e;
8674
9828
  cursor: pointer;
8675
9829
  transition:
8676
9830
  background 120ms ease,
@@ -8691,7 +9845,7 @@ ${prettyEvent}</pre
8691
9845
  background: none;
8692
9846
  border: none;
8693
9847
  cursor: pointer;
8694
- color: #838389;
9848
+ color: #68686e;
8695
9849
  width: 28px;
8696
9850
  height: 28px;
8697
9851
  display: flex;
@@ -8740,7 +9894,7 @@ ${prettyEvent}</pre
8740
9894
  height: 24px;
8741
9895
  border-radius: 50%;
8742
9896
  background-color: #f0f0f4;
8743
- color: #838389;
9897
+ color: #68686e;
8744
9898
  flex-shrink: 0;
8745
9899
  transition: transform 0.2s;
8746
9900
  }
@@ -8857,7 +10011,7 @@ ${prettyEvent}</pre
8857
10011
  }
8858
10012
 
8859
10013
  .announcement-content a {
8860
- color: #757cf2;
10014
+ color: #5558b2;
8861
10015
  text-decoration: underline;
8862
10016
  }
8863
10017
 
@@ -8981,7 +10135,7 @@ ${prettyEvent}</pre
8981
10135
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
8982
10136
  font-size: 12px;
8983
10137
  font-weight: 500;
8984
- color: #757cf2;
10138
+ color: #5558b2;
8985
10139
  cursor: pointer;
8986
10140
  text-align: center;
8987
10141
  }
@@ -9052,14 +10206,14 @@ ${prettyEvent}</pre
9052
10206
  align-items: center;
9053
10207
  }
9054
10208
  .cpk-tab-active .cpk-tab-icon {
9055
- color: #757cf2;
10209
+ color: #5558b2;
9056
10210
  }
9057
10211
  .cpk-tab-inactive {
9058
10212
  background-color: transparent;
9059
10213
  color: #2b2b2b;
9060
10214
  }
9061
10215
  .cpk-tab-inactive .cpk-tab-icon {
9062
- color: #838389;
10216
+ color: #68686e;
9063
10217
  }
9064
10218
  .cpk-tab-inactive:hover {
9065
10219
  background-color: rgba(190, 194, 255, 0.08);
@@ -9092,24 +10246,40 @@ ${prettyEvent}</pre
9092
10246
  width: 100%;
9093
10247
  height: 100%;
9094
10248
  object-fit: cover;
9095
- opacity: 0;
9096
- transition: opacity 220ms ease;
9097
- }
9098
- .cpk-threads-overview-video[data-ready="true"] {
9099
- opacity: 1;
9100
10249
  }
9101
10250
 
9102
- /* ── Header control buttons (dock, close) — first row only ───── */
9103
- .drag-handle > div:first-child button {
9104
- color: #838389 !important;
10251
+ /* ── Header controls on the dark account strip ──────────────── */
10252
+ .drag-handle > div[data-inspector-account-strip] button {
10253
+ color: #afafb7 !important;
10254
+ cursor: pointer;
9105
10255
  }
9106
- .drag-handle > div:first-child button:hover {
9107
- background-color: #f0f0f4 !important;
9108
- color: #57575b !important;
10256
+ .drag-handle > div[data-inspector-account-strip] button,
10257
+ .inspector-nav-control,
10258
+ [data-inspector-thread-cta] {
10259
+ outline: 2px solid transparent;
10260
+ outline-offset: 2px;
9109
10261
  }
9110
- .drag-handle > div:first-child button:focus-visible {
10262
+ .drag-handle > div[data-inspector-account-strip] button:hover {
10263
+ background-color: rgba(255, 255, 255, 0.12) !important;
10264
+ color: #ffffff !important;
10265
+ }
10266
+ .drag-handle > div[data-inspector-account-strip] button:focus-visible {
9111
10267
  outline-color: #bec2ff !important;
9112
10268
  }
10269
+ .drag-handle > div[data-inspector-account-strip] button:focus,
10270
+ .drag-handle > div[data-inspector-account-strip] button:focus-visible {
10271
+ outline: 2px solid #bec2ff !important;
10272
+ outline-offset: 2px;
10273
+ }
10274
+ .inspector-nav-control:focus,
10275
+ .inspector-nav-control:focus-visible,
10276
+ [data-inspector-thread-cta]:focus,
10277
+ [data-inspector-thread-cta]:focus-visible,
10278
+ [data-inspector-action-placement="threads-footer"]:focus,
10279
+ [data-inspector-action-placement="threads-footer"]:focus-visible {
10280
+ outline: 2px solid #6430ab !important;
10281
+ outline-offset: 2px;
10282
+ }
9113
10283
 
9114
10284
  /* ── Agent/context dropdown ──────────────────────────────────── */
9115
10285
  [data-context-dropdown-root="true"] > button {
@@ -9121,7 +10291,7 @@ ${prettyEvent}</pre
9121
10291
  background-color: #f7f7f9 !important;
9122
10292
  }
9123
10293
  [data-context-dropdown-root="true"] > button > span:last-child {
9124
- color: #838389 !important;
10294
+ color: #68686e !important;
9125
10295
  }
9126
10296
  [data-context-dropdown-root="true"] > div {
9127
10297
  border-color: #dbdbe5 !important;
@@ -9131,6 +10301,28 @@ ${prettyEvent}</pre
9131
10301
  [data-context-dropdown-root="true"] > div button:focus {
9132
10302
  background-color: #f7f7f9 !important;
9133
10303
  }
10304
+ [data-inspector-account-strip]
10305
+ .inspector-agent-selector
10306
+ > [data-context-dropdown-root="true"]
10307
+ > button {
10308
+ border-color: rgba(255, 255, 255, 0.28) !important;
10309
+ background-color: transparent !important;
10310
+ color: #e7e7ec !important;
10311
+ }
10312
+ [data-inspector-account-strip]
10313
+ .inspector-agent-selector
10314
+ > [data-context-dropdown-root="true"]
10315
+ > button:hover {
10316
+ border-color: rgba(190, 194, 255, 0.7) !important;
10317
+ background-color: rgba(255, 255, 255, 0.08) !important;
10318
+ }
10319
+ [data-inspector-account-strip]
10320
+ .inspector-agent-selector
10321
+ > [data-context-dropdown-root="true"]
10322
+ > button
10323
+ > span:last-child {
10324
+ color: #afafb7 !important;
10325
+ }
9134
10326
 
9135
10327
  /* ── Status bar (bottom chrome) ──────────────────────────────── */
9136
10328
  .inspector-window > div > div:last-child {
@@ -9140,7 +10332,7 @@ ${prettyEvent}</pre
9140
10332
 
9141
10333
  /* ── Resize handle ───────────────────────────────────────────── */
9142
10334
  .resize-handle {
9143
- color: #838389 !important;
10335
+ color: #68686e !important;
9144
10336
  }
9145
10337
  .resize-handle:hover {
9146
10338
  color: #57575b !important;
@@ -9161,7 +10353,7 @@ ${prettyEvent}</pre
9161
10353
  /* Copy "copied" state: generic green → brand mint */
9162
10354
  button[class*="bg-green-100"] {
9163
10355
  background-color: rgba(133, 236, 206, 0.2) !important;
9164
- color: #189370 !important;
10356
+ color: #087653 !important;
9165
10357
  }
9166
10358
 
9167
10359
  /* ── Agents tab ──────────────────────────────────────────────── */
@@ -9170,14 +10362,14 @@ ${prettyEvent}</pre
9170
10362
  background-color: rgba(190, 194, 255, 0.15) !important;
9171
10363
  }
9172
10364
  span[class*="text-blue-600"] {
9173
- color: #757cf2 !important;
10365
+ color: #5558b2 !important;
9174
10366
  }
9175
10367
  /* Running badge: emerald → mint */
9176
10368
  span[class*="bg-emerald-50"] {
9177
10369
  background-color: rgba(133, 236, 206, 0.15) !important;
9178
10370
  }
9179
10371
  span[class*="text-emerald-700"] {
9180
- color: #189370 !important;
10372
+ color: #087653 !important;
9181
10373
  }
9182
10374
  /* Running status dot */
9183
10375
  span[class*="bg-emerald-500"] {
@@ -9197,7 +10389,7 @@ ${prettyEvent}</pre
9197
10389
  span[class*="bg-green-100"][class*="text-green-800"] {
9198
10390
  background-color: rgba(133, 236, 206, 0.18) !important;
9199
10391
  border: 1px solid rgba(133, 236, 206, 0.4) !important;
9200
- color: #189370 !important;
10392
+ color: #087653 !important;
9201
10393
  }
9202
10394
  /* Tool role badge (amber → orange brand) */
9203
10395
  span[class*="bg-amber-100"][class*="text-amber-800"] {
@@ -9238,13 +10430,17 @@ ${prettyEvent}</pre
9238
10430
  > div:last-child:has(div[class*="bg-emerald-50"]) {
9239
10431
  background-color: rgba(91, 228, 187, 0.08) !important;
9240
10432
  border-top-color: rgba(91, 228, 187, 0.3) !important;
9241
- color: #189370 !important;
10433
+ color: #087653 !important;
9242
10434
  }
9243
10435
  /* Inner badge — slightly more opaque on the mint bg */
9244
10436
  div[class*="bg-emerald-50"][class*="border-emerald-200"] {
9245
10437
  background-color: rgba(91, 228, 187, 0.12) !important;
9246
10438
  border-color: rgba(91, 228, 187, 0.4) !important;
9247
- color: #189370 !important;
10439
+ color: #087653 !important;
10440
+ }
10441
+ div[class*="bg-emerald-50"][class*="border-emerald-200"]
10442
+ span[class*="opacity-80"] {
10443
+ opacity: 1 !important;
9248
10444
  }
9249
10445
  /* Icon bubble inside connected badge → mint tint */
9250
10446
  div[class*="bg-emerald-50"] span[class*="bg-white"] {
@@ -9259,7 +10455,7 @@ ${prettyEvent}</pre
9259
10455
  span[class*="bg-slate-900"],
9260
10456
  div[class*="bg-slate-900"] {
9261
10457
  background-color: #eee6fe !important;
9262
- color: #757cf2 !important;
10458
+ color: #5558b2 !important;
9263
10459
  }
9264
10460
  span[class*="text-slate-800"],
9265
10461
  div[class*="text-slate-800"] {