@copilotkitnext/web-inspector 0.0.13 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +44 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.js +1202 -102
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1202 -102
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
- package/src/index.ts +1555 -107
- package/src/lib/persistence.ts +9 -1
- package/src/lib/types.ts +2 -0
- package/src/styles/generated.css +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { LitElement, css, html, nothing, unsafeCSS } from "lit";
|
|
|
3
3
|
import { styleMap } from "lit/directives/style-map.js";
|
|
4
4
|
|
|
5
5
|
// src/styles/generated.css
|
|
6
|
-
var generated_default = '/*! tailwindcss v4.1.11 | 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-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking: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-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;--tw-outline-style:solid}}}@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-200:oklch(92.4% .12 95.746);--color-amber-700:oklch(55.5% .163 48.998);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-200:oklch(90.5% .093 164.15);--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-200:oklch(88.2% .059 254.128);--color-blue-700:oklch(48.8% .243 264.376);--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-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-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;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--font-weight-medium:500;--font-weight-semibold:600;--tracking-wider:.05em;--leading-tight:1.25;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--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}.pointer-events-none{pointer-events:none}.absolute{position:absolute}.relative{position:relative}.static{position:static}.right-1{right:calc(var(--spacing)*1)}.bottom-1{bottom:calc(var(--spacing)*1)}.left-0{left:calc(var(--spacing)*0)}.z-50{z-index:50}.m-0{margin:calc(var(--spacing)*0)}.mt-1\\.5{margin-top:calc(var(--spacing)*1.5)}.flex{display:flex}.inline-flex{display:inline-flex}.h-3{height:calc(var(--spacing)*3)}.h-3\\.5{height:calc(var(--spacing)*3.5)}.h-5{height:calc(var(--spacing)*5)}.h-6{height:calc(var(--spacing)*6)}.h-7{height:calc(var(--spacing)*7)}.h-8{height:calc(var(--spacing)*8)}.h-12{height:calc(var(--spacing)*12)}.h-20{height:calc(var(--spacing)*20)}.h-24{height:calc(var(--spacing)*24)}.h-full{height:100%}.w-3{width:calc(var(--spacing)*3)}.w-3\\.5{width:calc(var(--spacing)*3.5)}.w-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-7{width:calc(var(--spacing)*7)}.w-8{width:calc(var(--spacing)*8)}.w-12{width:calc(var(--spacing)*12)}.w-40{width:calc(var(--spacing)*40)}.w-56{width:calc(var(--spacing)*56)}.w-full{width:100%}.w-px{width:1px}.max-w-xs{max-width:var(--container-xs)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.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}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0\\.5{gap:calc(var(--spacing)*.5)}.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)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow: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-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-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-gray-200{border-color:var(--color-gray-200)}.border-rose-200{border-color:var(--color-rose-200)}.border-sky-200{border-color:var(--color-sky-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-blue-50{background-color:var(--color-blue-50)}.bg-emerald-50{background-color:var(--color-emerald-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-200{background-color:var(--color-gray-200)}.bg-gray-800{background-color:var(--color-gray-800)}.bg-gray-900{background-color:var(--color-gray-900)}.bg-rose-50{background-color:var(--color-rose-50)}.bg-sky-50{background-color:var(--color-sky-50)}.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)}.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-3{padding-block:calc(var(--spacing)*3)}.py-8{padding-block:calc(var(--spacing)*8)}.pt-2{padding-top:calc(var(--spacing)*2)}.pt-3{padding-top:calc(var(--spacing)*3)}.pr-3{padding-right:calc(var(--spacing)*3)}.pb-3{padding-bottom:calc(var(--spacing)*3)}.pl-1{padding-left:calc(var(--spacing)*1)}.pl-2{padding-left:calc(var(--spacing)*2)}.pl-3{padding-left:calc(var(--spacing)*3)}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.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-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.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)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.whitespace-pre-wrap{white-space:pre-wrap}.text-amber-700{color:var(--color-amber-700)}.text-blue-700{color:var(--color-blue-700)}.text-emerald-700{color:var(--color-emerald-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-rose-700{color:var(--color-rose-700)}.text-sky-700{color:var(--color-sky-700)}.text-violet-700{color:var(--color-violet-700)}.text-white{color:var(--color-white)}.uppercase{text-transform:uppercase}.opacity-60{opacity:.6}.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)}.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-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)}}.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,)}.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,visibility,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))}.select-none{-webkit-user-select:none;user-select:none}@media (hover:hover){.group-hover\\:border-gray-300:is(:where(.group):hover *){border-color:var(--color-gray-300)}.group-hover\\:text-gray-700:is(:where(.group):hover *){color:var(--color-gray-700)}.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-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-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)}}.focus\\:bg-gray-50:focus{background-color:var(--color-gray-50)}.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-gray-300:focus-visible{outline-color:var(--color-gray-300)}.focus-visible\\:outline-gray-400:focus-visible{outline-color:var(--color-gray-400)}.focus-visible\\:outline-rose-500:focus-visible{outline-color:var(--color-rose-500)}.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-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-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{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-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}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}';
|
|
6
|
+
var generated_default = '/*! tailwindcss v4.1.11 | 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-border-spacing-x:0;--tw-border-spacing-y:0;--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-tracking: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-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-duration:initial;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-outline-style:solid}}}@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-200:oklch(92.4% .12 95.746);--color-amber-700:oklch(55.5% .163 48.998);--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-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-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;--container-2xl:42rem;--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;--tracking-wider:.05em;--leading-tight:1.25;--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-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}.pointer-events-none{pointer-events:none}.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-50{z-index:50}.m-0{margin:calc(var(--spacing)*0)}.mx-3{margin-inline:calc(var(--spacing)*3)}.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)}.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-2{margin-left:calc(var(--spacing)*2)}.block{display:block}.flex{display:flex}.grid{display:grid}.inline-flex{display:inline-flex}.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-5{height:calc(var(--spacing)*5)}.h-6{height:calc(var(--spacing)*6)}.h-7{height:calc(var(--spacing)*7)}.h-8{height:calc(var(--spacing)*8)}.h-10{height:calc(var(--spacing)*10)}.h-12{height:calc(var(--spacing)*12)}.h-20{height:calc(var(--spacing)*20)}.h-24{height:calc(var(--spacing)*24)}.h-40{height:calc(var(--spacing)*40)}.h-full{height:100%}.max-h-64{max-height:calc(var(--spacing)*64)}.max-h-96{max-height:calc(var(--spacing)*96)}.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-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-7{width:calc(var(--spacing)*7)}.w-8{width:calc(var(--spacing)*8)}.w-10{width:calc(var(--spacing)*10)}.w-12{width:calc(var(--spacing)*12)}.w-16{width:calc(var(--spacing)*16)}.w-40{width:calc(var(--spacing)*40)}.w-56{width:calc(var(--spacing)*56)}.w-full{width:100%}.w-px{width:1px}.max-w-2xl{max-width:var(--container-2xl)}.max-w-\\[150px\\]{max-width:150px}.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)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.border-separate{border-collapse:separate}.border-spacing-0{--tw-border-spacing-x:calc(var(--spacing)*0);--tw-border-spacing-y:calc(var(--spacing)*0);border-spacing:var(--tw-border-spacing-x)var(--tw-border-spacing-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-0\\.5{gap:calc(var(--spacing)*.5)}.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-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-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-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-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-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-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-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-200{background-color:var(--color-gray-200)}.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-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)}.p-1{padding:calc(var(--spacing)*1)}.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-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-8{padding-block:calc(var(--spacing)*8)}.pt-2{padding-top:calc(var(--spacing)*2)}.pt-3{padding-top:calc(var(--spacing)*3)}.pb-3{padding-bottom:calc(var(--spacing)*3)}.pl-1{padding-left:calc(var(--spacing)*1)}.pl-2{padding-left:calc(var(--spacing)*2)}.text-center{text-align:center}.text-left{text-align:left}.align-top{vertical-align:top}.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-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.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)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-words{overflow-wrap:break-word}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-amber-700{color:var(--color-amber-700)}.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-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-violet-700{color:var(--color-violet-700)}.text-white{color:var(--color-white)}.uppercase{text-transform:uppercase}.italic{font-style:italic}.opacity-0{opacity:0}.opacity-60{opacity:.6}.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)}.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-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)}}.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,)}.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,visibility,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-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-300{--tw-duration:.3s;transition-duration:.3s}.select-none{-webkit-user-select:none;user-select:none}@media (hover:hover){.group-hover\\:border-gray-300:is(:where(.group):hover *){border-color:var(--color-gray-300)}.group-hover\\:text-gray-700:is(:where(.group):hover *){color:var(--color-gray-700)}.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-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-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)}}.focus\\:bg-gray-50:focus{background-color:var(--color-gray-50)}.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-gray-300:focus-visible{outline-color:var(--color-gray-300)}.focus-visible\\:outline-gray-400:focus-visible{outline-color:var(--color-gray-400)}.focus-visible\\:outline-rose-500:focus-visible{outline-color:var(--color-rose-500)}@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-border-spacing-x{syntax:"<length>";inherits:false;initial-value:0}@property --tw-border-spacing-y{syntax:"<length>";inherits:false;initial-value:0}@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-tracking{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-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-duration{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}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@keyframes pulse{50%{opacity:.5}}';
|
|
7
7
|
|
|
8
8
|
// src/assets/logo-mark.svg
|
|
9
9
|
var logo_mark_default = 'data:image/svg+xml,<?xml version="1.0" encoding="utf-8"?>%0A<svg xmlns="http://www.w3.org/2000/svg" width="55" height="60" viewBox="0 0 55 60" fill="none">%0A <g stroke="%23FFFFFF" stroke-width="3.3125" stroke-linejoin="round">%0A <path d="M0 21.9336L16.5449 0C40.8483 5.37332 53 8.05998 53 8.05998L43.123 56L0 21.9336Z" />%0A <line x1="16.5828" y1="0" x2="43.2454" y2="56" />%0A <line x1="0" y1="21.9336" x2="53" y2="8.48421" />%0A </g>%0A</svg>%0A';
|
|
@@ -131,17 +131,22 @@ function isValidSize(value) {
|
|
|
131
131
|
function isFiniteNumber(value) {
|
|
132
132
|
return typeof value === "number" && Number.isFinite(value);
|
|
133
133
|
}
|
|
134
|
+
function isValidDockMode(value) {
|
|
135
|
+
return value === "floating" || value === "docked-left";
|
|
136
|
+
}
|
|
134
137
|
|
|
135
138
|
// src/index.ts
|
|
136
139
|
var WEB_INSPECTOR_TAG = "web-inspector";
|
|
137
140
|
var EDGE_MARGIN = 16;
|
|
138
141
|
var DRAG_THRESHOLD = 6;
|
|
139
|
-
var MIN_WINDOW_WIDTH =
|
|
142
|
+
var MIN_WINDOW_WIDTH = 600;
|
|
143
|
+
var MIN_WINDOW_WIDTH_DOCKED_LEFT = 420;
|
|
140
144
|
var MIN_WINDOW_HEIGHT = 200;
|
|
141
145
|
var COOKIE_NAME = "copilotkit_inspector_state";
|
|
142
146
|
var COOKIE_MAX_AGE_SECONDS = 60 * 60 * 24 * 30;
|
|
143
147
|
var DEFAULT_BUTTON_SIZE = { width: 48, height: 48 };
|
|
144
|
-
var DEFAULT_WINDOW_SIZE = { width:
|
|
148
|
+
var DEFAULT_WINDOW_SIZE = { width: 840, height: 560 };
|
|
149
|
+
var DOCKED_LEFT_WIDTH = 500;
|
|
145
150
|
var MAX_AGENT_EVENTS = 200;
|
|
146
151
|
var MAX_TOTAL_EVENTS = 500;
|
|
147
152
|
var WebInspectorElement = class extends LitElement {
|
|
@@ -152,8 +157,11 @@ var WebInspectorElement = class extends LitElement {
|
|
|
152
157
|
this.coreUnsubscribe = null;
|
|
153
158
|
this.agentSubscriptions = /* @__PURE__ */ new Map();
|
|
154
159
|
this.agentEvents = /* @__PURE__ */ new Map();
|
|
160
|
+
this.agentMessages = /* @__PURE__ */ new Map();
|
|
161
|
+
this.agentStates = /* @__PURE__ */ new Map();
|
|
155
162
|
this.flattenedEvents = [];
|
|
156
163
|
this.eventCounter = 0;
|
|
164
|
+
this.contextStore = {};
|
|
157
165
|
this.pointerId = null;
|
|
158
166
|
this.dragStart = null;
|
|
159
167
|
this.dragOffset = { x: 0, y: 0 };
|
|
@@ -164,6 +172,10 @@ var WebInspectorElement = class extends LitElement {
|
|
|
164
172
|
this.ignoreNextButtonClick = false;
|
|
165
173
|
this.selectedMenu = "ag-ui-events";
|
|
166
174
|
this.contextMenuOpen = false;
|
|
175
|
+
this.dockMode = "floating";
|
|
176
|
+
this.previousBodyMargins = null;
|
|
177
|
+
this.transitionTimeoutId = null;
|
|
178
|
+
this.pendingSelectedContext = null;
|
|
167
179
|
this.contextState = {
|
|
168
180
|
button: {
|
|
169
181
|
position: { x: EDGE_MARGIN, y: EDGE_MARGIN },
|
|
@@ -193,6 +205,9 @@ var WebInspectorElement = class extends LitElement {
|
|
|
193
205
|
{ key: "agent-context", label: "Agent Context", icon: "FileText" }
|
|
194
206
|
];
|
|
195
207
|
this.handlePointerDown = (event) => {
|
|
208
|
+
if (this.dockMode !== "floating" && this.isOpen) {
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
196
211
|
const target = event.currentTarget;
|
|
197
212
|
const contextAttr = target?.dataset.dragContext;
|
|
198
213
|
const context = contextAttr === "window" ? "window" : "button";
|
|
@@ -242,16 +257,17 @@ var WebInspectorElement = class extends LitElement {
|
|
|
242
257
|
if (this.isDragging && this.pointerContext) {
|
|
243
258
|
event.preventDefault();
|
|
244
259
|
this.setDragging(false);
|
|
245
|
-
this.updateAnchorFromPosition(this.pointerContext);
|
|
246
260
|
if (this.pointerContext === "window") {
|
|
261
|
+
this.updateAnchorFromPosition(this.pointerContext);
|
|
247
262
|
this.hasCustomPosition.window = true;
|
|
263
|
+
this.applyAnchorPosition(this.pointerContext);
|
|
248
264
|
} else if (this.pointerContext === "button") {
|
|
265
|
+
this.snapButtonToCorner();
|
|
249
266
|
this.hasCustomPosition.button = true;
|
|
250
267
|
if (this.draggedDuringInteraction) {
|
|
251
268
|
this.ignoreNextButtonClick = true;
|
|
252
269
|
}
|
|
253
270
|
}
|
|
254
|
-
this.applyAnchorPosition(this.pointerContext);
|
|
255
271
|
} else if (context === "button" && !this.isOpen && !this.draggedDuringInteraction) {
|
|
256
272
|
this.openInspector();
|
|
257
273
|
}
|
|
@@ -297,6 +313,9 @@ var WebInspectorElement = class extends LitElement {
|
|
|
297
313
|
this.resizePointerId = event.pointerId;
|
|
298
314
|
this.resizeStart = { x: event.clientX, y: event.clientY };
|
|
299
315
|
this.resizeInitialSize = { ...this.contextState.window.size };
|
|
316
|
+
if (document.body && this.dockMode !== "floating") {
|
|
317
|
+
document.body.style.transition = "";
|
|
318
|
+
}
|
|
300
319
|
const target = event.currentTarget;
|
|
301
320
|
target?.setPointerCapture?.(event.pointerId);
|
|
302
321
|
};
|
|
@@ -308,12 +327,22 @@ var WebInspectorElement = class extends LitElement {
|
|
|
308
327
|
const deltaX = event.clientX - this.resizeStart.x;
|
|
309
328
|
const deltaY = event.clientY - this.resizeStart.y;
|
|
310
329
|
const state = this.contextState.window;
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
330
|
+
if (this.dockMode === "docked-left") {
|
|
331
|
+
state.size = this.clampWindowSize({
|
|
332
|
+
width: this.resizeInitialSize.width + deltaX,
|
|
333
|
+
height: state.size.height
|
|
334
|
+
});
|
|
335
|
+
if (document.body) {
|
|
336
|
+
document.body.style.marginLeft = `${state.size.width}px`;
|
|
337
|
+
}
|
|
338
|
+
} else {
|
|
339
|
+
state.size = this.clampWindowSize({
|
|
340
|
+
width: this.resizeInitialSize.width + deltaX,
|
|
341
|
+
height: this.resizeInitialSize.height + deltaY
|
|
342
|
+
});
|
|
343
|
+
this.keepPositionWithinViewport("window");
|
|
344
|
+
this.updateAnchorFromPosition("window");
|
|
345
|
+
}
|
|
317
346
|
this.requestUpdate();
|
|
318
347
|
this.updateHostTransform("window");
|
|
319
348
|
};
|
|
@@ -325,8 +354,11 @@ var WebInspectorElement = class extends LitElement {
|
|
|
325
354
|
if (target?.hasPointerCapture(this.resizePointerId)) {
|
|
326
355
|
target.releasePointerCapture(this.resizePointerId);
|
|
327
356
|
}
|
|
328
|
-
this.
|
|
329
|
-
|
|
357
|
+
if (this.dockMode === "floating") {
|
|
358
|
+
this.updateAnchorFromPosition("window");
|
|
359
|
+
this.applyAnchorPosition("window");
|
|
360
|
+
}
|
|
361
|
+
this.persistState();
|
|
330
362
|
this.resetResizeTracking();
|
|
331
363
|
};
|
|
332
364
|
this.handleResizePointerCancel = (event) => {
|
|
@@ -337,8 +369,11 @@ var WebInspectorElement = class extends LitElement {
|
|
|
337
369
|
if (target?.hasPointerCapture(this.resizePointerId)) {
|
|
338
370
|
target.releasePointerCapture(this.resizePointerId);
|
|
339
371
|
}
|
|
340
|
-
this.
|
|
341
|
-
|
|
372
|
+
if (this.dockMode === "floating") {
|
|
373
|
+
this.updateAnchorFromPosition("window");
|
|
374
|
+
this.applyAnchorPosition("window");
|
|
375
|
+
}
|
|
376
|
+
this.persistState();
|
|
342
377
|
this.resetResizeTracking();
|
|
343
378
|
};
|
|
344
379
|
this.handleResize = () => {
|
|
@@ -357,6 +392,9 @@ var WebInspectorElement = class extends LitElement {
|
|
|
357
392
|
];
|
|
358
393
|
this.selectedContext = "all-agents";
|
|
359
394
|
this.expandedRows = /* @__PURE__ */ new Set();
|
|
395
|
+
this.copiedEvents = /* @__PURE__ */ new Set();
|
|
396
|
+
this.expandedTools = /* @__PURE__ */ new Set();
|
|
397
|
+
this.expandedContextItems = /* @__PURE__ */ new Set();
|
|
360
398
|
this.handleGlobalPointerDown = (event) => {
|
|
361
399
|
if (!this.contextMenuOpen) {
|
|
362
400
|
return;
|
|
@@ -394,10 +432,17 @@ var WebInspectorElement = class extends LitElement {
|
|
|
394
432
|
this.coreSubscriber = {
|
|
395
433
|
onAgentsChanged: ({ agents }) => {
|
|
396
434
|
this.processAgentsChanged(agents);
|
|
435
|
+
},
|
|
436
|
+
onContextChanged: ({ context }) => {
|
|
437
|
+
this.contextStore = { ...context };
|
|
438
|
+
this.requestUpdate();
|
|
397
439
|
}
|
|
398
440
|
};
|
|
399
441
|
this.coreUnsubscribe = core.subscribe(this.coreSubscriber);
|
|
400
442
|
this.processAgentsChanged(core.agents);
|
|
443
|
+
if (core.context) {
|
|
444
|
+
this.contextStore = { ...core.context };
|
|
445
|
+
}
|
|
401
446
|
}
|
|
402
447
|
detachFromCore() {
|
|
403
448
|
if (this.coreUnsubscribe) {
|
|
@@ -413,6 +458,8 @@ var WebInspectorElement = class extends LitElement {
|
|
|
413
458
|
}
|
|
414
459
|
this.agentSubscriptions.clear();
|
|
415
460
|
this.agentEvents.clear();
|
|
461
|
+
this.agentMessages.clear();
|
|
462
|
+
this.agentStates.clear();
|
|
416
463
|
this.flattenedEvents = [];
|
|
417
464
|
this.eventCounter = 0;
|
|
418
465
|
}
|
|
@@ -429,6 +476,8 @@ var WebInspectorElement = class extends LitElement {
|
|
|
429
476
|
if (!seenAgentIds.has(agentId)) {
|
|
430
477
|
this.unsubscribeFromAgent(agentId);
|
|
431
478
|
this.agentEvents.delete(agentId);
|
|
479
|
+
this.agentMessages.delete(agentId);
|
|
480
|
+
this.agentStates.delete(agentId);
|
|
432
481
|
}
|
|
433
482
|
}
|
|
434
483
|
this.updateContextOptions(seenAgentIds);
|
|
@@ -473,12 +522,18 @@ var WebInspectorElement = class extends LitElement {
|
|
|
473
522
|
},
|
|
474
523
|
onStateSnapshotEvent: ({ event }) => {
|
|
475
524
|
this.recordAgentEvent(agentId, "STATE_SNAPSHOT", event);
|
|
525
|
+
this.syncAgentState(agent);
|
|
476
526
|
},
|
|
477
527
|
onStateDeltaEvent: ({ event }) => {
|
|
478
528
|
this.recordAgentEvent(agentId, "STATE_DELTA", event);
|
|
529
|
+
this.syncAgentState(agent);
|
|
479
530
|
},
|
|
480
531
|
onMessagesSnapshotEvent: ({ event }) => {
|
|
481
532
|
this.recordAgentEvent(agentId, "MESSAGES_SNAPSHOT", event);
|
|
533
|
+
this.syncAgentMessages(agent);
|
|
534
|
+
},
|
|
535
|
+
onMessagesChanged: () => {
|
|
536
|
+
this.syncAgentMessages(agent);
|
|
482
537
|
},
|
|
483
538
|
onRawEvent: ({ event }) => {
|
|
484
539
|
this.recordAgentEvent(agentId, "RAW_EVENT", event);
|
|
@@ -489,6 +544,8 @@ var WebInspectorElement = class extends LitElement {
|
|
|
489
544
|
};
|
|
490
545
|
const { unsubscribe } = agent.subscribe(subscriber);
|
|
491
546
|
this.agentSubscriptions.set(agentId, unsubscribe);
|
|
547
|
+
this.syncAgentMessages(agent);
|
|
548
|
+
this.syncAgentState(agent);
|
|
492
549
|
if (!this.agentEvents.has(agentId)) {
|
|
493
550
|
this.agentEvents.set(agentId, []);
|
|
494
551
|
}
|
|
@@ -515,6 +572,30 @@ var WebInspectorElement = class extends LitElement {
|
|
|
515
572
|
this.flattenedEvents = [event, ...this.flattenedEvents].slice(0, MAX_TOTAL_EVENTS);
|
|
516
573
|
this.requestUpdate();
|
|
517
574
|
}
|
|
575
|
+
syncAgentMessages(agent) {
|
|
576
|
+
if (!agent?.agentId) {
|
|
577
|
+
return;
|
|
578
|
+
}
|
|
579
|
+
const messages = agent.messages;
|
|
580
|
+
if (Array.isArray(messages)) {
|
|
581
|
+
this.agentMessages.set(agent.agentId, messages);
|
|
582
|
+
} else {
|
|
583
|
+
this.agentMessages.delete(agent.agentId);
|
|
584
|
+
}
|
|
585
|
+
this.requestUpdate();
|
|
586
|
+
}
|
|
587
|
+
syncAgentState(agent) {
|
|
588
|
+
if (!agent?.agentId) {
|
|
589
|
+
return;
|
|
590
|
+
}
|
|
591
|
+
const state = agent.state;
|
|
592
|
+
if (state === void 0 || state === null) {
|
|
593
|
+
this.agentStates.delete(agent.agentId);
|
|
594
|
+
} else {
|
|
595
|
+
this.agentStates.set(agent.agentId, state);
|
|
596
|
+
}
|
|
597
|
+
this.requestUpdate();
|
|
598
|
+
}
|
|
518
599
|
updateContextOptions(agentIds) {
|
|
519
600
|
const nextOptions = [
|
|
520
601
|
{ key: "all-agents", label: "All Agents" },
|
|
@@ -524,9 +605,32 @@ var WebInspectorElement = class extends LitElement {
|
|
|
524
605
|
if (optionsChanged) {
|
|
525
606
|
this.contextOptions = nextOptions;
|
|
526
607
|
}
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
608
|
+
const pendingContext = this.pendingSelectedContext;
|
|
609
|
+
if (pendingContext) {
|
|
610
|
+
const isPendingAvailable = pendingContext === "all-agents" || agentIds.has(pendingContext);
|
|
611
|
+
if (isPendingAvailable) {
|
|
612
|
+
if (this.selectedContext !== pendingContext) {
|
|
613
|
+
this.selectedContext = pendingContext;
|
|
614
|
+
this.expandedRows.clear();
|
|
615
|
+
}
|
|
616
|
+
this.pendingSelectedContext = null;
|
|
617
|
+
} else if (agentIds.size > 0) {
|
|
618
|
+
this.pendingSelectedContext = null;
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
const hasSelectedContext = nextOptions.some((option) => option.key === this.selectedContext);
|
|
622
|
+
if (!hasSelectedContext && this.pendingSelectedContext === null) {
|
|
623
|
+
let nextSelected = "all-agents";
|
|
624
|
+
if (agentIds.has("default")) {
|
|
625
|
+
nextSelected = "default";
|
|
626
|
+
} else if (agentIds.size > 0) {
|
|
627
|
+
nextSelected = Array.from(agentIds).sort((a, b) => a.localeCompare(b))[0];
|
|
628
|
+
}
|
|
629
|
+
if (this.selectedContext !== nextSelected) {
|
|
630
|
+
this.selectedContext = nextSelected;
|
|
631
|
+
this.expandedRows.clear();
|
|
632
|
+
this.persistState();
|
|
633
|
+
}
|
|
530
634
|
}
|
|
531
635
|
}
|
|
532
636
|
getEventsForSelectedContext() {
|
|
@@ -535,6 +639,146 @@ var WebInspectorElement = class extends LitElement {
|
|
|
535
639
|
}
|
|
536
640
|
return this.agentEvents.get(this.selectedContext) ?? [];
|
|
537
641
|
}
|
|
642
|
+
getLatestStateForAgent(agentId) {
|
|
643
|
+
if (this.agentStates.has(agentId)) {
|
|
644
|
+
return this.agentStates.get(agentId);
|
|
645
|
+
}
|
|
646
|
+
const events = this.agentEvents.get(agentId) ?? [];
|
|
647
|
+
const stateEvent = events.find((e) => e.type === "STATE_SNAPSHOT");
|
|
648
|
+
return stateEvent?.payload ?? null;
|
|
649
|
+
}
|
|
650
|
+
getLatestMessagesForAgent(agentId) {
|
|
651
|
+
const messages = this.agentMessages.get(agentId);
|
|
652
|
+
return messages ?? null;
|
|
653
|
+
}
|
|
654
|
+
getAgentStatus(agentId) {
|
|
655
|
+
const events = this.agentEvents.get(agentId) ?? [];
|
|
656
|
+
if (events.length === 0) {
|
|
657
|
+
return "idle";
|
|
658
|
+
}
|
|
659
|
+
const runEvent = events.find((e) => e.type === "RUN_STARTED" || e.type === "RUN_FINISHED" || e.type === "RUN_ERROR");
|
|
660
|
+
if (!runEvent) {
|
|
661
|
+
return "idle";
|
|
662
|
+
}
|
|
663
|
+
if (runEvent.type === "RUN_ERROR") {
|
|
664
|
+
return "error";
|
|
665
|
+
}
|
|
666
|
+
if (runEvent.type === "RUN_STARTED") {
|
|
667
|
+
const finishedAfter = events.find(
|
|
668
|
+
(e) => e.type === "RUN_FINISHED" && e.timestamp > runEvent.timestamp
|
|
669
|
+
);
|
|
670
|
+
return finishedAfter ? "idle" : "running";
|
|
671
|
+
}
|
|
672
|
+
return "idle";
|
|
673
|
+
}
|
|
674
|
+
getAgentStats(agentId) {
|
|
675
|
+
const events = this.agentEvents.get(agentId) ?? [];
|
|
676
|
+
const messages = this.agentMessages.get(agentId);
|
|
677
|
+
const toolCallCount = Array.isArray(messages) ? messages.reduce((count, rawMessage) => {
|
|
678
|
+
if (!rawMessage || typeof rawMessage !== "object") {
|
|
679
|
+
return count;
|
|
680
|
+
}
|
|
681
|
+
const toolCalls = rawMessage.toolCalls;
|
|
682
|
+
if (!Array.isArray(toolCalls)) {
|
|
683
|
+
return count;
|
|
684
|
+
}
|
|
685
|
+
return count + toolCalls.length;
|
|
686
|
+
}, 0) : events.filter((e) => e.type === "TOOL_CALL_END").length;
|
|
687
|
+
const messageCount = Array.isArray(messages) ? messages.length : 0;
|
|
688
|
+
return {
|
|
689
|
+
totalEvents: events.length,
|
|
690
|
+
lastActivity: events[0]?.timestamp ?? null,
|
|
691
|
+
messages: messageCount,
|
|
692
|
+
toolCalls: toolCallCount,
|
|
693
|
+
errors: events.filter((e) => e.type === "RUN_ERROR").length
|
|
694
|
+
};
|
|
695
|
+
}
|
|
696
|
+
renderToolCallDetails(toolCalls) {
|
|
697
|
+
if (!Array.isArray(toolCalls) || toolCalls.length === 0) {
|
|
698
|
+
return nothing;
|
|
699
|
+
}
|
|
700
|
+
return html`
|
|
701
|
+
<div class="mt-2 space-y-2">
|
|
702
|
+
${toolCalls.map((call, index) => {
|
|
703
|
+
const toolCall = call;
|
|
704
|
+
const functionName = typeof toolCall?.function?.name === "string" ? toolCall.function.name : "Unknown function";
|
|
705
|
+
const callId = typeof toolCall?.id === "string" ? toolCall.id : `tool-call-${index + 1}`;
|
|
706
|
+
const argsString = this.formatToolCallArguments(toolCall?.function?.arguments);
|
|
707
|
+
return html`
|
|
708
|
+
<div class="rounded-md border border-gray-200 bg-gray-50 p-3 text-xs text-gray-700">
|
|
709
|
+
<div class="flex flex-wrap items-center justify-between gap-1 font-medium text-gray-900">
|
|
710
|
+
<span>${functionName}</span>
|
|
711
|
+
<span class="text-[10px] text-gray-500">ID: ${callId}</span>
|
|
712
|
+
</div>
|
|
713
|
+
${argsString ? html`<pre class="mt-2 overflow-auto rounded bg-white p-2 text-[11px] leading-relaxed text-gray-800">${argsString}</pre>` : nothing}
|
|
714
|
+
</div>
|
|
715
|
+
`;
|
|
716
|
+
})}
|
|
717
|
+
</div>
|
|
718
|
+
`;
|
|
719
|
+
}
|
|
720
|
+
formatToolCallArguments(args) {
|
|
721
|
+
if (args === void 0 || args === null || args === "") {
|
|
722
|
+
return null;
|
|
723
|
+
}
|
|
724
|
+
if (typeof args === "string") {
|
|
725
|
+
try {
|
|
726
|
+
const parsed = JSON.parse(args);
|
|
727
|
+
return JSON.stringify(parsed, null, 2);
|
|
728
|
+
} catch (error) {
|
|
729
|
+
return args;
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
if (typeof args === "object") {
|
|
733
|
+
try {
|
|
734
|
+
return JSON.stringify(args, null, 2);
|
|
735
|
+
} catch (error) {
|
|
736
|
+
return String(args);
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
return String(args);
|
|
740
|
+
}
|
|
741
|
+
hasRenderableState(state) {
|
|
742
|
+
if (state === null || state === void 0) {
|
|
743
|
+
return false;
|
|
744
|
+
}
|
|
745
|
+
if (Array.isArray(state)) {
|
|
746
|
+
return state.length > 0;
|
|
747
|
+
}
|
|
748
|
+
if (typeof state === "object") {
|
|
749
|
+
return Object.keys(state).length > 0;
|
|
750
|
+
}
|
|
751
|
+
if (typeof state === "string") {
|
|
752
|
+
const trimmed = state.trim();
|
|
753
|
+
return trimmed.length > 0 && trimmed !== "{}";
|
|
754
|
+
}
|
|
755
|
+
return true;
|
|
756
|
+
}
|
|
757
|
+
formatStateForDisplay(state) {
|
|
758
|
+
if (state === null || state === void 0) {
|
|
759
|
+
return "";
|
|
760
|
+
}
|
|
761
|
+
if (typeof state === "string") {
|
|
762
|
+
const trimmed = state.trim();
|
|
763
|
+
if (trimmed.length === 0) {
|
|
764
|
+
return "";
|
|
765
|
+
}
|
|
766
|
+
try {
|
|
767
|
+
const parsed = JSON.parse(trimmed);
|
|
768
|
+
return JSON.stringify(parsed, null, 2);
|
|
769
|
+
} catch {
|
|
770
|
+
return state;
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
if (typeof state === "object") {
|
|
774
|
+
try {
|
|
775
|
+
return JSON.stringify(state, null, 2);
|
|
776
|
+
} catch {
|
|
777
|
+
return String(state);
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
return String(state);
|
|
781
|
+
}
|
|
538
782
|
getEventBadgeClasses(type) {
|
|
539
783
|
const base = "font-mono text-[10px] font-medium inline-flex items-center rounded-sm px-1.5 py-0.5 border";
|
|
540
784
|
if (type.startsWith("RUN_")) {
|
|
@@ -571,6 +815,25 @@ var WebInspectorElement = class extends LitElement {
|
|
|
571
815
|
return String(payload);
|
|
572
816
|
}
|
|
573
817
|
}
|
|
818
|
+
extractEventFromPayload(payload) {
|
|
819
|
+
if (payload && typeof payload === "object" && "event" in payload) {
|
|
820
|
+
return payload.event;
|
|
821
|
+
}
|
|
822
|
+
return payload;
|
|
823
|
+
}
|
|
824
|
+
async copyToClipboard(text, eventId) {
|
|
825
|
+
try {
|
|
826
|
+
await navigator.clipboard.writeText(text);
|
|
827
|
+
this.copiedEvents.add(eventId);
|
|
828
|
+
this.requestUpdate();
|
|
829
|
+
setTimeout(() => {
|
|
830
|
+
this.copiedEvents.delete(eventId);
|
|
831
|
+
this.requestUpdate();
|
|
832
|
+
}, 2e3);
|
|
833
|
+
} catch (err) {
|
|
834
|
+
console.error("Failed to copy to clipboard:", err);
|
|
835
|
+
}
|
|
836
|
+
}
|
|
574
837
|
static {
|
|
575
838
|
this.styles = [
|
|
576
839
|
unsafeCSS(generated_default),
|
|
@@ -584,16 +847,45 @@ var WebInspectorElement = class extends LitElement {
|
|
|
584
847
|
will-change: transform;
|
|
585
848
|
}
|
|
586
849
|
|
|
850
|
+
:host([data-transitioning="true"]) {
|
|
851
|
+
transition: transform 300ms ease;
|
|
852
|
+
}
|
|
853
|
+
|
|
587
854
|
.console-button {
|
|
588
855
|
transition:
|
|
589
|
-
transform
|
|
856
|
+
transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1),
|
|
590
857
|
opacity 160ms ease;
|
|
591
858
|
}
|
|
592
859
|
|
|
860
|
+
.console-button[data-dragging="true"] {
|
|
861
|
+
transition: opacity 160ms ease;
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
.inspector-window[data-transitioning="true"] {
|
|
865
|
+
transition: width 300ms ease, height 300ms ease;
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
.inspector-window[data-docked="true"] {
|
|
869
|
+
border-radius: 0 !important;
|
|
870
|
+
box-shadow: none !important;
|
|
871
|
+
}
|
|
872
|
+
|
|
593
873
|
.resize-handle {
|
|
594
874
|
touch-action: none;
|
|
595
875
|
user-select: none;
|
|
596
876
|
}
|
|
877
|
+
|
|
878
|
+
.dock-resize-handle {
|
|
879
|
+
position: absolute;
|
|
880
|
+
top: 0;
|
|
881
|
+
right: 0;
|
|
882
|
+
width: 10px;
|
|
883
|
+
height: 100%;
|
|
884
|
+
cursor: ew-resize;
|
|
885
|
+
touch-action: none;
|
|
886
|
+
z-index: 50;
|
|
887
|
+
background: transparent;
|
|
888
|
+
}
|
|
597
889
|
`
|
|
598
890
|
];
|
|
599
891
|
}
|
|
@@ -602,6 +894,7 @@ var WebInspectorElement = class extends LitElement {
|
|
|
602
894
|
if (typeof window !== "undefined") {
|
|
603
895
|
window.addEventListener("resize", this.handleResize);
|
|
604
896
|
window.addEventListener("pointerdown", this.handleGlobalPointerDown);
|
|
897
|
+
this.hydrateStateFromCookieEarly();
|
|
605
898
|
}
|
|
606
899
|
}
|
|
607
900
|
disconnectedCallback() {
|
|
@@ -610,6 +903,7 @@ var WebInspectorElement = class extends LitElement {
|
|
|
610
903
|
window.removeEventListener("resize", this.handleResize);
|
|
611
904
|
window.removeEventListener("pointerdown", this.handleGlobalPointerDown);
|
|
612
905
|
}
|
|
906
|
+
this.removeDockStyles();
|
|
613
907
|
this.detachFromCore();
|
|
614
908
|
}
|
|
615
909
|
firstUpdated() {
|
|
@@ -623,13 +917,18 @@ var WebInspectorElement = class extends LitElement {
|
|
|
623
917
|
this.contextState.window.anchor = { horizontal: "right", vertical: "bottom" };
|
|
624
918
|
this.contextState.window.anchorOffset = { x: EDGE_MARGIN, y: EDGE_MARGIN };
|
|
625
919
|
this.hydrateStateFromCookie();
|
|
920
|
+
if (this.isOpen && this.dockMode !== "floating") {
|
|
921
|
+
this.applyDockStyles(true);
|
|
922
|
+
}
|
|
626
923
|
this.applyAnchorPosition("button");
|
|
627
|
-
if (this.
|
|
628
|
-
this.
|
|
629
|
-
|
|
630
|
-
|
|
924
|
+
if (this.dockMode === "floating") {
|
|
925
|
+
if (this.hasCustomPosition.window) {
|
|
926
|
+
this.applyAnchorPosition("window");
|
|
927
|
+
} else {
|
|
928
|
+
this.centerContext("window");
|
|
929
|
+
}
|
|
631
930
|
}
|
|
632
|
-
this.updateHostTransform("button");
|
|
931
|
+
this.updateHostTransform(this.isOpen ? "window" : "button");
|
|
633
932
|
}
|
|
634
933
|
render() {
|
|
635
934
|
return this.isOpen ? this.renderWindow() : this.renderButton();
|
|
@@ -672,6 +971,7 @@ var WebInspectorElement = class extends LitElement {
|
|
|
672
971
|
type="button"
|
|
673
972
|
aria-label="Web Inspector"
|
|
674
973
|
data-drag-context="button"
|
|
974
|
+
data-dragging=${this.isDragging && this.pointerContext === "button" ? "true" : "false"}
|
|
675
975
|
@pointerdown=${this.handlePointerDown}
|
|
676
976
|
@pointermove=${this.handlePointerMove}
|
|
677
977
|
@pointerup=${this.handlePointerUp}
|
|
@@ -684,7 +984,10 @@ var WebInspectorElement = class extends LitElement {
|
|
|
684
984
|
}
|
|
685
985
|
renderWindow() {
|
|
686
986
|
const windowState = this.contextState.window;
|
|
687
|
-
const
|
|
987
|
+
const isDocked = this.dockMode !== "floating";
|
|
988
|
+
const isTransitioning = this.hasAttribute("data-transitioning");
|
|
989
|
+
const isCollapsed = this.dockMode === "docked-left";
|
|
990
|
+
const windowStyles = isDocked ? this.getDockedWindowStyles() : {
|
|
688
991
|
width: `${Math.round(windowState.size.width)}px`,
|
|
689
992
|
height: `${Math.round(windowState.size.height)}px`,
|
|
690
993
|
minWidth: `${MIN_WINDOW_WIDTH}px`,
|
|
@@ -696,39 +999,57 @@ var WebInspectorElement = class extends LitElement {
|
|
|
696
999
|
<section
|
|
697
1000
|
class="inspector-window pointer-events-auto relative flex flex-col overflow-hidden rounded-xl border border-gray-200 bg-white text-gray-900 shadow-lg"
|
|
698
1001
|
style=${styleMap(windowStyles)}
|
|
1002
|
+
data-docked=${isDocked}
|
|
1003
|
+
data-transitioning=${isTransitioning}
|
|
699
1004
|
>
|
|
1005
|
+
${isDocked ? html`
|
|
1006
|
+
<div
|
|
1007
|
+
class="dock-resize-handle pointer-events-auto"
|
|
1008
|
+
role="presentation"
|
|
1009
|
+
aria-hidden="true"
|
|
1010
|
+
@pointerdown=${this.handleResizePointerDown}
|
|
1011
|
+
@pointermove=${this.handleResizePointerMove}
|
|
1012
|
+
@pointerup=${this.handleResizePointerUp}
|
|
1013
|
+
@pointercancel=${this.handleResizePointerCancel}
|
|
1014
|
+
></div>
|
|
1015
|
+
` : nothing}
|
|
700
1016
|
<div class="flex flex-1 overflow-hidden bg-white text-gray-800">
|
|
701
1017
|
<nav
|
|
702
|
-
class="flex w-56 shrink-0 flex-col justify-between border-r border-gray-200 bg-gray-50/50 px-3 pb-3 pt-3 text-xs"
|
|
1018
|
+
class="flex ${isCollapsed ? "w-16" : "w-56"} shrink-0 flex-col justify-between border-r border-gray-200 bg-gray-50/50 px-3 pb-3 pt-3 text-xs transition-all duration-300"
|
|
703
1019
|
aria-label="Inspector sections"
|
|
704
1020
|
>
|
|
705
1021
|
<div class="flex flex-col gap-4 overflow-y-auto">
|
|
706
1022
|
<div
|
|
707
|
-
class="flex items-center gap-2 pl-1 touch-none select-none ${this.isDragging && this.pointerContext === "window" ? "cursor-grabbing" : "cursor-grab"}"
|
|
1023
|
+
class="flex items-center ${isCollapsed ? "justify-center" : "gap-2 pl-1"} touch-none select-none ${this.isDragging && this.pointerContext === "window" ? "cursor-grabbing" : "cursor-grab"}"
|
|
708
1024
|
data-drag-context="window"
|
|
709
1025
|
@pointerdown=${this.handlePointerDown}
|
|
710
1026
|
@pointermove=${this.handlePointerMove}
|
|
711
1027
|
@pointerup=${this.handlePointerUp}
|
|
712
1028
|
@pointercancel=${this.handlePointerCancel}
|
|
1029
|
+
title="${isCollapsed ? "Acme Inc - Enterprise" : ""}"
|
|
713
1030
|
>
|
|
714
1031
|
<span
|
|
715
1032
|
class="flex h-8 w-8 items-center justify-center rounded-lg bg-gray-900 text-white pointer-events-none"
|
|
716
1033
|
>
|
|
717
1034
|
${this.renderIcon("Building2")}
|
|
718
1035
|
</span>
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
1036
|
+
${!isCollapsed ? html`
|
|
1037
|
+
<div class="flex flex-1 flex-col leading-tight pointer-events-none">
|
|
1038
|
+
<span class="text-sm font-semibold text-gray-900">Acme Inc</span>
|
|
1039
|
+
<span class="text-[10px] text-gray-500">Enterprise</span>
|
|
1040
|
+
</div>
|
|
1041
|
+
` : nothing}
|
|
723
1042
|
</div>
|
|
724
1043
|
|
|
725
1044
|
<div class="flex flex-col gap-2 pt-2">
|
|
726
|
-
|
|
1045
|
+
${!isCollapsed ? html`<div class="px-1 text-[10px] font-semibold uppercase tracking-wider text-gray-400">Platform</div>` : nothing}
|
|
727
1046
|
<div class="flex flex-col gap-0.5">
|
|
728
1047
|
${this.menuItems.map(({ key, label, icon }) => {
|
|
729
1048
|
const isSelected = this.selectedMenu === key;
|
|
730
1049
|
const buttonClasses = [
|
|
731
|
-
"group flex w-full items-center
|
|
1050
|
+
"group flex w-full items-center",
|
|
1051
|
+
isCollapsed ? "justify-center p-2" : "gap-2 px-2 py-1.5",
|
|
1052
|
+
"rounded-md text-left text-xs transition focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gray-300",
|
|
732
1053
|
isSelected ? "bg-gray-900 text-white" : "text-gray-600 hover:bg-gray-100 hover:text-gray-900"
|
|
733
1054
|
].join(" ");
|
|
734
1055
|
const badgeClasses = isSelected ? "bg-gray-800 text-white" : "bg-white border border-gray-200 text-gray-500 group-hover:border-gray-300 group-hover:text-gray-700";
|
|
@@ -737,16 +1058,19 @@ var WebInspectorElement = class extends LitElement {
|
|
|
737
1058
|
type="button"
|
|
738
1059
|
class=${buttonClasses}
|
|
739
1060
|
aria-pressed=${isSelected}
|
|
1061
|
+
title="${isCollapsed ? label : ""}"
|
|
740
1062
|
@click=${() => this.handleMenuSelect(key)}
|
|
741
1063
|
>
|
|
742
1064
|
<span
|
|
743
|
-
class="flex h-6 w-6 items-center justify-center rounded ${badgeClasses}"
|
|
1065
|
+
class="flex h-6 w-6 items-center justify-center rounded ${isCollapsed && isSelected ? "text-white" : isCollapsed ? "text-gray-600" : badgeClasses}"
|
|
744
1066
|
aria-hidden="true"
|
|
745
1067
|
>
|
|
746
1068
|
${this.renderIcon(icon)}
|
|
747
1069
|
</span>
|
|
748
|
-
|
|
749
|
-
|
|
1070
|
+
${!isCollapsed ? html`
|
|
1071
|
+
<span class="flex-1">${label}</span>
|
|
1072
|
+
<span class="text-gray-400 opacity-60">${this.renderIcon("ChevronRight")}</span>
|
|
1073
|
+
` : nothing}
|
|
750
1074
|
</button>
|
|
751
1075
|
`;
|
|
752
1076
|
})}
|
|
@@ -755,50 +1079,61 @@ var WebInspectorElement = class extends LitElement {
|
|
|
755
1079
|
</div>
|
|
756
1080
|
|
|
757
1081
|
<div
|
|
758
|
-
class="relative flex items-center rounded-lg border border-gray-200 bg-white px-2 py-2 text-left text-xs text-gray-700 cursor-pointer hover:bg-gray-50 transition"
|
|
1082
|
+
class="relative flex items-center ${isCollapsed ? "justify-center p-1" : ""} rounded-lg border border-gray-200 bg-white ${isCollapsed ? "" : "px-2 py-2"} text-left text-xs text-gray-700 cursor-pointer hover:bg-gray-50 transition"
|
|
1083
|
+
title="${isCollapsed ? "John Snow - john@snow.com" : ""}"
|
|
759
1084
|
>
|
|
760
1085
|
<span
|
|
761
|
-
class="w-6 h-6 flex items-center justify-center overflow-hidden rounded bg-gray-100 text-[10px] font-semibold text-gray-700"
|
|
1086
|
+
class="${isCollapsed ? "w-8 h-8 shrink-0" : "w-6 h-6"} flex items-center justify-center overflow-hidden rounded bg-gray-100 text-[10px] font-semibold text-gray-700"
|
|
762
1087
|
>
|
|
763
1088
|
JS
|
|
764
1089
|
</span>
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
1090
|
+
${!isCollapsed ? html`
|
|
1091
|
+
<div class="pl-2 flex flex-1 flex-col leading-tight">
|
|
1092
|
+
<span class="font-medium text-gray-900">John Snow</span>
|
|
1093
|
+
<span class="text-[10px] text-gray-500">john@snow.com</span>
|
|
1094
|
+
</div>
|
|
1095
|
+
<span class="text-gray-300">${this.renderIcon("ChevronRight")}</span>
|
|
1096
|
+
` : nothing}
|
|
770
1097
|
</div>
|
|
771
1098
|
</nav>
|
|
772
1099
|
<div class="relative flex flex-1 flex-col overflow-hidden">
|
|
773
1100
|
<div
|
|
774
|
-
class="drag-handle flex items-center justify-between border-b border-gray-200 px-4 py-3 touch-none select-none ${this.isDragging && this.pointerContext === "window" ? "cursor-grabbing" : "cursor-grab"}"
|
|
1101
|
+
class="drag-handle flex items-center justify-between border-b border-gray-200 px-4 py-3 touch-none select-none ${isDocked ? "" : this.isDragging && this.pointerContext === "window" ? "cursor-grabbing" : "cursor-grab"}"
|
|
775
1102
|
data-drag-context="window"
|
|
776
|
-
@pointerdown=${this.handlePointerDown}
|
|
777
|
-
@pointermove=${this.handlePointerMove}
|
|
778
|
-
@pointerup=${this.handlePointerUp}
|
|
779
|
-
@pointercancel=${this.handlePointerCancel}
|
|
1103
|
+
@pointerdown=${isDocked ? void 0 : this.handlePointerDown}
|
|
1104
|
+
@pointermove=${isDocked ? void 0 : this.handlePointerMove}
|
|
1105
|
+
@pointerup=${isDocked ? void 0 : this.handlePointerUp}
|
|
1106
|
+
@pointercancel=${isDocked ? void 0 : this.handlePointerCancel}
|
|
780
1107
|
>
|
|
781
|
-
<div class="flex items-center gap-2 text-xs text-gray-500">
|
|
782
|
-
<
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
1108
|
+
<div class="flex min-w-0 flex-1 items-center gap-2 text-xs text-gray-500">
|
|
1109
|
+
<div class="flex min-w-0 flex-1 items-center text-xs text-gray-600">
|
|
1110
|
+
<span class="flex shrink-0 items-center gap-1">
|
|
1111
|
+
<span>🪁</span>
|
|
1112
|
+
<span class="font-medium whitespace-nowrap">CopilotKit Inspector</span>
|
|
1113
|
+
</span>
|
|
1114
|
+
<span class="mx-3 h-3 w-px shrink-0 bg-gray-200"></span>
|
|
1115
|
+
<span class="shrink-0 text-gray-400">
|
|
1116
|
+
${this.renderIcon(this.getSelectedMenu().icon)}
|
|
1117
|
+
</span>
|
|
1118
|
+
<span class="ml-2 truncate">${this.getSelectedMenu().label}</span>
|
|
787
1119
|
${hasContextDropdown ? html`
|
|
788
|
-
<span class="h-3 w-px bg-gray-200"></span>
|
|
789
|
-
<div class="
|
|
1120
|
+
<span class="mx-3 h-3 w-px shrink-0 bg-gray-200"></span>
|
|
1121
|
+
<div class="min-w-0">${contextDropdown}</div>
|
|
790
1122
|
` : nothing}
|
|
791
1123
|
</div>
|
|
792
1124
|
</div>
|
|
793
|
-
<
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
1125
|
+
<div class="flex items-center gap-1">
|
|
1126
|
+
${this.renderDockControls()}
|
|
1127
|
+
<button
|
|
1128
|
+
class="flex h-6 w-6 items-center justify-center rounded 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"
|
|
1129
|
+
type="button"
|
|
1130
|
+
aria-label="Close Web Inspector"
|
|
1131
|
+
@pointerdown=${this.handleClosePointerDown}
|
|
1132
|
+
@click=${this.handleCloseClick}
|
|
1133
|
+
>
|
|
1134
|
+
${this.renderIcon("X")}
|
|
1135
|
+
</button>
|
|
1136
|
+
</div>
|
|
802
1137
|
</div>
|
|
803
1138
|
<div class="flex-1 overflow-auto">
|
|
804
1139
|
${this.renderMainContent()}
|
|
@@ -830,6 +1165,31 @@ var WebInspectorElement = class extends LitElement {
|
|
|
830
1165
|
</section>
|
|
831
1166
|
`;
|
|
832
1167
|
}
|
|
1168
|
+
hydrateStateFromCookieEarly() {
|
|
1169
|
+
if (typeof document === "undefined" || typeof window === "undefined") {
|
|
1170
|
+
return;
|
|
1171
|
+
}
|
|
1172
|
+
const persisted = loadInspectorState(COOKIE_NAME);
|
|
1173
|
+
if (!persisted) {
|
|
1174
|
+
return;
|
|
1175
|
+
}
|
|
1176
|
+
if (typeof persisted.isOpen === "boolean") {
|
|
1177
|
+
this.isOpen = persisted.isOpen;
|
|
1178
|
+
}
|
|
1179
|
+
if (isValidDockMode(persisted.dockMode)) {
|
|
1180
|
+
this.dockMode = persisted.dockMode;
|
|
1181
|
+
}
|
|
1182
|
+
if (typeof persisted.selectedMenu === "string") {
|
|
1183
|
+
const validMenu = this.menuItems.find((item) => item.key === persisted.selectedMenu);
|
|
1184
|
+
if (validMenu) {
|
|
1185
|
+
this.selectedMenu = validMenu.key;
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
if (typeof persisted.selectedContext === "string") {
|
|
1189
|
+
this.selectedContext = persisted.selectedContext;
|
|
1190
|
+
this.pendingSelectedContext = persisted.selectedContext;
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
833
1193
|
hydrateStateFromCookie() {
|
|
834
1194
|
if (typeof document === "undefined" || typeof window === "undefined") {
|
|
835
1195
|
return;
|
|
@@ -865,6 +1225,10 @@ var WebInspectorElement = class extends LitElement {
|
|
|
865
1225
|
this.hasCustomPosition.window = persistedWindow.hasCustomPosition;
|
|
866
1226
|
}
|
|
867
1227
|
}
|
|
1228
|
+
if (typeof persisted.selectedContext === "string") {
|
|
1229
|
+
this.selectedContext = persisted.selectedContext;
|
|
1230
|
+
this.pendingSelectedContext = persisted.selectedContext;
|
|
1231
|
+
}
|
|
868
1232
|
}
|
|
869
1233
|
get activeContext() {
|
|
870
1234
|
return this.isOpen ? "window" : "button";
|
|
@@ -939,26 +1303,111 @@ var WebInspectorElement = class extends LitElement {
|
|
|
939
1303
|
height: Math.round(this.contextState.window.size.height)
|
|
940
1304
|
},
|
|
941
1305
|
hasCustomPosition: this.hasCustomPosition.window
|
|
942
|
-
}
|
|
1306
|
+
},
|
|
1307
|
+
isOpen: this.isOpen,
|
|
1308
|
+
dockMode: this.dockMode,
|
|
1309
|
+
selectedMenu: this.selectedMenu,
|
|
1310
|
+
selectedContext: this.selectedContext
|
|
943
1311
|
};
|
|
944
1312
|
saveInspectorState(COOKIE_NAME, state, COOKIE_MAX_AGE_SECONDS);
|
|
1313
|
+
this.pendingSelectedContext = state.selectedContext ?? null;
|
|
945
1314
|
}
|
|
946
1315
|
clampWindowSize(size) {
|
|
1316
|
+
const minWidth = this.dockMode === "docked-left" ? MIN_WINDOW_WIDTH_DOCKED_LEFT : MIN_WINDOW_WIDTH;
|
|
947
1317
|
if (typeof window === "undefined") {
|
|
948
1318
|
return {
|
|
949
|
-
width: Math.max(
|
|
1319
|
+
width: Math.max(minWidth, size.width),
|
|
950
1320
|
height: Math.max(MIN_WINDOW_HEIGHT, size.height)
|
|
951
1321
|
};
|
|
952
1322
|
}
|
|
953
1323
|
const viewport = this.getViewportSize();
|
|
954
|
-
return clampSize(size, viewport, EDGE_MARGIN,
|
|
1324
|
+
return clampSize(size, viewport, EDGE_MARGIN, minWidth, MIN_WINDOW_HEIGHT);
|
|
1325
|
+
}
|
|
1326
|
+
setDockMode(mode) {
|
|
1327
|
+
if (this.dockMode === mode) {
|
|
1328
|
+
return;
|
|
1329
|
+
}
|
|
1330
|
+
this.startHostTransition();
|
|
1331
|
+
this.removeDockStyles();
|
|
1332
|
+
const previousMode = this.dockMode;
|
|
1333
|
+
this.dockMode = mode;
|
|
1334
|
+
if (mode !== "floating") {
|
|
1335
|
+
if (mode === "docked-left") {
|
|
1336
|
+
this.contextState.window.size.width = DOCKED_LEFT_WIDTH;
|
|
1337
|
+
}
|
|
1338
|
+
this.applyDockStyles();
|
|
1339
|
+
} else {
|
|
1340
|
+
this.contextState.window.size = { ...DEFAULT_WINDOW_SIZE };
|
|
1341
|
+
this.centerContext("window");
|
|
1342
|
+
}
|
|
1343
|
+
this.persistState();
|
|
1344
|
+
this.requestUpdate();
|
|
1345
|
+
this.updateHostTransform("window");
|
|
1346
|
+
}
|
|
1347
|
+
startHostTransition(duration = 300) {
|
|
1348
|
+
this.setAttribute("data-transitioning", "true");
|
|
1349
|
+
if (this.transitionTimeoutId !== null) {
|
|
1350
|
+
clearTimeout(this.transitionTimeoutId);
|
|
1351
|
+
}
|
|
1352
|
+
this.transitionTimeoutId = setTimeout(() => {
|
|
1353
|
+
this.removeAttribute("data-transitioning");
|
|
1354
|
+
this.transitionTimeoutId = null;
|
|
1355
|
+
}, duration);
|
|
1356
|
+
}
|
|
1357
|
+
applyDockStyles(skipTransition = false) {
|
|
1358
|
+
if (typeof document === "undefined" || !document.body) {
|
|
1359
|
+
return;
|
|
1360
|
+
}
|
|
1361
|
+
const computedStyle = window.getComputedStyle(document.body);
|
|
1362
|
+
this.previousBodyMargins = {
|
|
1363
|
+
left: computedStyle.marginLeft,
|
|
1364
|
+
bottom: computedStyle.marginBottom
|
|
1365
|
+
};
|
|
1366
|
+
if (!this.isResizing && !skipTransition) {
|
|
1367
|
+
document.body.style.transition = "margin 300ms ease";
|
|
1368
|
+
}
|
|
1369
|
+
if (this.dockMode === "docked-left") {
|
|
1370
|
+
document.body.style.marginLeft = `${this.contextState.window.size.width}px`;
|
|
1371
|
+
}
|
|
1372
|
+
if (!this.isResizing && !skipTransition) {
|
|
1373
|
+
setTimeout(() => {
|
|
1374
|
+
if (document.body) {
|
|
1375
|
+
document.body.style.transition = "";
|
|
1376
|
+
}
|
|
1377
|
+
}, 300);
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
removeDockStyles() {
|
|
1381
|
+
if (typeof document === "undefined" || !document.body) {
|
|
1382
|
+
return;
|
|
1383
|
+
}
|
|
1384
|
+
if (!this.isResizing) {
|
|
1385
|
+
document.body.style.transition = "margin 300ms ease";
|
|
1386
|
+
}
|
|
1387
|
+
if (this.previousBodyMargins) {
|
|
1388
|
+
document.body.style.marginLeft = this.previousBodyMargins.left;
|
|
1389
|
+
document.body.style.marginBottom = this.previousBodyMargins.bottom;
|
|
1390
|
+
this.previousBodyMargins = null;
|
|
1391
|
+
} else {
|
|
1392
|
+
document.body.style.marginLeft = "";
|
|
1393
|
+
document.body.style.marginBottom = "";
|
|
1394
|
+
}
|
|
1395
|
+
setTimeout(() => {
|
|
1396
|
+
if (document.body) {
|
|
1397
|
+
document.body.style.transition = "";
|
|
1398
|
+
}
|
|
1399
|
+
}, 300);
|
|
955
1400
|
}
|
|
956
1401
|
updateHostTransform(context = this.activeContext) {
|
|
957
1402
|
if (context !== this.activeContext) {
|
|
958
1403
|
return;
|
|
959
1404
|
}
|
|
960
|
-
|
|
961
|
-
|
|
1405
|
+
if (this.isOpen && this.dockMode === "docked-left") {
|
|
1406
|
+
this.style.transform = `translate3d(0, 0, 0)`;
|
|
1407
|
+
} else {
|
|
1408
|
+
const { position } = this.contextState[context];
|
|
1409
|
+
this.style.transform = `translate3d(${position.x}px, ${position.y}px, 0)`;
|
|
1410
|
+
}
|
|
962
1411
|
}
|
|
963
1412
|
setDragging(value) {
|
|
964
1413
|
if (this.isDragging !== value) {
|
|
@@ -973,6 +1422,21 @@ var WebInspectorElement = class extends LitElement {
|
|
|
973
1422
|
const viewport = this.getViewportSize();
|
|
974
1423
|
updateAnchorFromPosition(this.contextState[context], viewport, EDGE_MARGIN);
|
|
975
1424
|
}
|
|
1425
|
+
snapButtonToCorner() {
|
|
1426
|
+
if (typeof window === "undefined") {
|
|
1427
|
+
return;
|
|
1428
|
+
}
|
|
1429
|
+
const viewport = this.getViewportSize();
|
|
1430
|
+
const state = this.contextState.button;
|
|
1431
|
+
const centerX = state.position.x + state.size.width / 2;
|
|
1432
|
+
const centerY = state.position.y + state.size.height / 2;
|
|
1433
|
+
const horizontal = centerX < viewport.width / 2 ? "left" : "right";
|
|
1434
|
+
const vertical = centerY < viewport.height / 2 ? "top" : "bottom";
|
|
1435
|
+
state.anchor = { horizontal, vertical };
|
|
1436
|
+
state.anchorOffset = { x: EDGE_MARGIN, y: EDGE_MARGIN };
|
|
1437
|
+
this.startHostTransition();
|
|
1438
|
+
this.applyAnchorPosition("button");
|
|
1439
|
+
}
|
|
976
1440
|
applyAnchorPosition(context) {
|
|
977
1441
|
if (typeof window === "undefined") {
|
|
978
1442
|
return;
|
|
@@ -1000,14 +1464,22 @@ var WebInspectorElement = class extends LitElement {
|
|
|
1000
1464
|
return;
|
|
1001
1465
|
}
|
|
1002
1466
|
this.isOpen = true;
|
|
1467
|
+
this.persistState();
|
|
1468
|
+
if (this.dockMode !== "floating") {
|
|
1469
|
+
this.applyDockStyles();
|
|
1470
|
+
}
|
|
1003
1471
|
this.ensureWindowPlacement();
|
|
1004
1472
|
this.requestUpdate();
|
|
1005
1473
|
void this.updateComplete.then(() => {
|
|
1006
1474
|
this.measureContext("window");
|
|
1007
|
-
if (this.
|
|
1008
|
-
this.
|
|
1475
|
+
if (this.dockMode === "floating") {
|
|
1476
|
+
if (this.hasCustomPosition.window) {
|
|
1477
|
+
this.applyAnchorPosition("window");
|
|
1478
|
+
} else {
|
|
1479
|
+
this.centerContext("window");
|
|
1480
|
+
}
|
|
1009
1481
|
} else {
|
|
1010
|
-
this.
|
|
1482
|
+
this.updateHostTransform("window");
|
|
1011
1483
|
}
|
|
1012
1484
|
});
|
|
1013
1485
|
}
|
|
@@ -1016,6 +1488,10 @@ var WebInspectorElement = class extends LitElement {
|
|
|
1016
1488
|
return;
|
|
1017
1489
|
}
|
|
1018
1490
|
this.isOpen = false;
|
|
1491
|
+
if (this.dockMode !== "floating") {
|
|
1492
|
+
this.removeDockStyles();
|
|
1493
|
+
}
|
|
1494
|
+
this.persistState();
|
|
1019
1495
|
this.updateHostTransform("button");
|
|
1020
1496
|
this.requestUpdate();
|
|
1021
1497
|
void this.updateComplete.then(() => {
|
|
@@ -1041,6 +1517,56 @@ var WebInspectorElement = class extends LitElement {
|
|
|
1041
1517
|
const svgMarkup = `<svg ${this.serializeAttributes(svgAttrs)}>${iconNode.map(([tag, attrs]) => `<${tag} ${this.serializeAttributes(attrs)} />`).join("")}</svg>`;
|
|
1042
1518
|
return unsafeHTML(svgMarkup);
|
|
1043
1519
|
}
|
|
1520
|
+
renderDockControls() {
|
|
1521
|
+
if (this.dockMode === "floating") {
|
|
1522
|
+
return html`
|
|
1523
|
+
<button
|
|
1524
|
+
class="flex h-6 w-6 items-center justify-center rounded 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"
|
|
1525
|
+
type="button"
|
|
1526
|
+
aria-label="Dock to left"
|
|
1527
|
+
title="Dock Left"
|
|
1528
|
+
@click=${() => this.handleDockClick("docked-left")}
|
|
1529
|
+
>
|
|
1530
|
+
${this.renderIcon("PanelLeft")}
|
|
1531
|
+
</button>
|
|
1532
|
+
`;
|
|
1533
|
+
} else {
|
|
1534
|
+
return html`
|
|
1535
|
+
<button
|
|
1536
|
+
class="flex h-6 w-6 items-center justify-center rounded 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"
|
|
1537
|
+
type="button"
|
|
1538
|
+
aria-label="Float window"
|
|
1539
|
+
title="Float"
|
|
1540
|
+
@click=${() => this.handleDockClick("floating")}
|
|
1541
|
+
>
|
|
1542
|
+
${this.renderIcon("Maximize2")}
|
|
1543
|
+
</button>
|
|
1544
|
+
`;
|
|
1545
|
+
}
|
|
1546
|
+
}
|
|
1547
|
+
getDockedWindowStyles() {
|
|
1548
|
+
if (this.dockMode === "docked-left") {
|
|
1549
|
+
return {
|
|
1550
|
+
position: "fixed",
|
|
1551
|
+
top: "0",
|
|
1552
|
+
left: "0",
|
|
1553
|
+
bottom: "0",
|
|
1554
|
+
width: `${Math.round(this.contextState.window.size.width)}px`,
|
|
1555
|
+
height: "100vh",
|
|
1556
|
+
minWidth: `${MIN_WINDOW_WIDTH_DOCKED_LEFT}px`,
|
|
1557
|
+
borderRadius: "0"
|
|
1558
|
+
};
|
|
1559
|
+
}
|
|
1560
|
+
return {
|
|
1561
|
+
width: `${Math.round(this.contextState.window.size.width)}px`,
|
|
1562
|
+
height: `${Math.round(this.contextState.window.size.height)}px`,
|
|
1563
|
+
minWidth: `${MIN_WINDOW_WIDTH}px`,
|
|
1564
|
+
minHeight: `${MIN_WINDOW_HEIGHT}px`
|
|
1565
|
+
};
|
|
1566
|
+
}
|
|
1567
|
+
handleDockClick(mode) {
|
|
1568
|
+
this.setDockMode(mode);
|
|
1569
|
+
}
|
|
1044
1570
|
serializeAttributes(attributes) {
|
|
1045
1571
|
return Object.entries(attributes).filter(([key, value]) => key !== "key" && value !== void 0 && value !== null && value !== "").map(([key, value]) => `${key}="${String(value).replace(/"/g, """)}"`).join(" ");
|
|
1046
1572
|
}
|
|
@@ -1052,6 +1578,15 @@ var WebInspectorElement = class extends LitElement {
|
|
|
1052
1578
|
if (this.selectedMenu === "ag-ui-events") {
|
|
1053
1579
|
return this.renderEventsTable();
|
|
1054
1580
|
}
|
|
1581
|
+
if (this.selectedMenu === "agents") {
|
|
1582
|
+
return this.renderAgentsView();
|
|
1583
|
+
}
|
|
1584
|
+
if (this.selectedMenu === "frontend-tools") {
|
|
1585
|
+
return this.renderToolsView();
|
|
1586
|
+
}
|
|
1587
|
+
if (this.selectedMenu === "agent-context") {
|
|
1588
|
+
return this.renderContextView();
|
|
1589
|
+
}
|
|
1055
1590
|
return html`
|
|
1056
1591
|
<div class="flex flex-col gap-3 p-4">
|
|
1057
1592
|
<div class="h-24 rounded-lg bg-gray-50"></div>
|
|
@@ -1063,53 +1598,75 @@ var WebInspectorElement = class extends LitElement {
|
|
|
1063
1598
|
const events = this.getEventsForSelectedContext();
|
|
1064
1599
|
if (events.length === 0) {
|
|
1065
1600
|
return html`
|
|
1066
|
-
<div class="flex h-full items-center justify-center px-4 py-8 text-
|
|
1067
|
-
|
|
1601
|
+
<div class="flex h-full items-center justify-center px-4 py-8 text-center">
|
|
1602
|
+
<div class="max-w-md">
|
|
1603
|
+
<div class="mb-3 flex justify-center text-gray-300 [&>svg]:!h-8 [&>svg]:!w-8">
|
|
1604
|
+
${this.renderIcon("Zap")}
|
|
1605
|
+
</div>
|
|
1606
|
+
<p class="text-sm text-gray-600">No events yet</p>
|
|
1607
|
+
<p class="mt-2 text-xs text-gray-500">Trigger an agent run to see live activity.</p>
|
|
1608
|
+
</div>
|
|
1068
1609
|
</div>
|
|
1069
1610
|
`;
|
|
1070
1611
|
}
|
|
1071
1612
|
return html`
|
|
1072
|
-
<div class="overflow-
|
|
1073
|
-
<table class="w-full border-
|
|
1074
|
-
<thead>
|
|
1613
|
+
<div class="relative h-full overflow-auto">
|
|
1614
|
+
<table class="w-full border-separate border-spacing-0 text-xs">
|
|
1615
|
+
<thead class="sticky top-0 z-10">
|
|
1075
1616
|
<tr class="bg-white">
|
|
1076
|
-
<th class="border-
|
|
1077
|
-
|
|
1617
|
+
<th class="border-b border-gray-200 bg-white px-3 py-2 text-left font-medium text-gray-900">
|
|
1618
|
+
Agent
|
|
1078
1619
|
</th>
|
|
1079
|
-
<th class="border-
|
|
1620
|
+
<th class="border-b border-gray-200 bg-white px-3 py-2 text-left font-medium text-gray-900">
|
|
1080
1621
|
Time
|
|
1081
1622
|
</th>
|
|
1082
1623
|
<th class="border-b border-gray-200 bg-white px-3 py-2 text-left font-medium text-gray-900">
|
|
1083
|
-
|
|
1624
|
+
Event Type
|
|
1625
|
+
</th>
|
|
1626
|
+
<th class="border-b border-gray-200 bg-white px-3 py-2 text-left font-medium text-gray-900">
|
|
1627
|
+
AG-UI Event
|
|
1084
1628
|
</th>
|
|
1085
1629
|
</tr>
|
|
1086
1630
|
</thead>
|
|
1087
1631
|
<tbody>
|
|
1088
1632
|
${events.map((event, index) => {
|
|
1089
|
-
const isLastRow = index === events.length - 1;
|
|
1090
1633
|
const rowBg = index % 2 === 0 ? "bg-white" : "bg-gray-50/50";
|
|
1091
1634
|
const badgeClasses = this.getEventBadgeClasses(event.type);
|
|
1092
|
-
const
|
|
1093
|
-
const
|
|
1635
|
+
const extractedEvent = this.extractEventFromPayload(event.payload);
|
|
1636
|
+
const inlineEvent = this.stringifyPayload(extractedEvent, false) || "\u2014";
|
|
1637
|
+
const prettyEvent = this.stringifyPayload(extractedEvent, true) || inlineEvent;
|
|
1094
1638
|
const isExpanded = this.expandedRows.has(event.id);
|
|
1095
1639
|
return html`
|
|
1096
1640
|
<tr
|
|
1097
|
-
class="${rowBg} transition hover:bg-blue-50/50"
|
|
1641
|
+
class="${rowBg} cursor-pointer transition hover:bg-blue-50/50"
|
|
1098
1642
|
@click=${() => this.toggleRowExpansion(event.id)}
|
|
1099
1643
|
>
|
|
1100
|
-
<td class="border-r
|
|
1101
|
-
<
|
|
1102
|
-
<span class=${badgeClasses}>${event.type}</span>
|
|
1103
|
-
<span class="font-mono text-[10px] text-gray-400">${event.agentId}</span>
|
|
1104
|
-
</div>
|
|
1644
|
+
<td class="border-l border-r border-b border-gray-200 px-3 py-2">
|
|
1645
|
+
<span class="font-mono text-[11px] text-gray-600">${event.agentId}</span>
|
|
1105
1646
|
</td>
|
|
1106
|
-
<td class="border-r
|
|
1647
|
+
<td class="border-r border-b border-gray-200 px-3 py-2 font-mono text-[11px] text-gray-600">
|
|
1107
1648
|
<span title=${new Date(event.timestamp).toLocaleString()}>
|
|
1108
1649
|
${new Date(event.timestamp).toLocaleTimeString()}
|
|
1109
1650
|
</span>
|
|
1110
1651
|
</td>
|
|
1111
|
-
<td class="
|
|
1112
|
-
|
|
1652
|
+
<td class="border-r border-b border-gray-200 px-3 py-2">
|
|
1653
|
+
<span class=${badgeClasses}>${event.type}</span>
|
|
1654
|
+
</td>
|
|
1655
|
+
<td class="border-r border-b border-gray-200 px-3 py-2 font-mono text-[10px] text-gray-600 ${isExpanded ? "" : "truncate max-w-xs"}">
|
|
1656
|
+
${isExpanded ? html`
|
|
1657
|
+
<div class="group relative">
|
|
1658
|
+
<pre class="m-0 whitespace-pre-wrap text-[10px] font-mono text-gray-600">${prettyEvent}</pre>
|
|
1659
|
+
<button
|
|
1660
|
+
class="absolute right-0 top-0 cursor-pointer rounded px-2 py-1 text-[10px] opacity-0 transition group-hover:opacity-100 ${this.copiedEvents.has(event.id) ? "bg-green-100 text-green-700" : "bg-gray-100 text-gray-600 hover:bg-gray-200 hover:text-gray-900"}"
|
|
1661
|
+
@click=${(e) => {
|
|
1662
|
+
e.stopPropagation();
|
|
1663
|
+
this.copyToClipboard(prettyEvent, event.id);
|
|
1664
|
+
}}
|
|
1665
|
+
>
|
|
1666
|
+
${this.copiedEvents.has(event.id) ? html`<span>✓ Copied</span>` : html`<span>Copy</span>`}
|
|
1667
|
+
</button>
|
|
1668
|
+
</div>
|
|
1669
|
+
` : inlineEvent}
|
|
1113
1670
|
</td>
|
|
1114
1671
|
</tr>
|
|
1115
1672
|
`;
|
|
@@ -1119,27 +1676,174 @@ var WebInspectorElement = class extends LitElement {
|
|
|
1119
1676
|
</div>
|
|
1120
1677
|
`;
|
|
1121
1678
|
}
|
|
1679
|
+
renderAgentsView() {
|
|
1680
|
+
if (this.selectedContext === "all-agents") {
|
|
1681
|
+
return html`
|
|
1682
|
+
<div class="flex h-full items-center justify-center px-4 py-8 text-center">
|
|
1683
|
+
<div class="max-w-md">
|
|
1684
|
+
<div class="mb-3 flex justify-center text-gray-300 [&>svg]:!h-8 [&>svg]:!w-8">
|
|
1685
|
+
${this.renderIcon("Bot")}
|
|
1686
|
+
</div>
|
|
1687
|
+
<p class="text-sm text-gray-600">No agent selected</p>
|
|
1688
|
+
<p class="mt-2 text-xs text-gray-500">Select an agent from the dropdown above to view details.</p>
|
|
1689
|
+
</div>
|
|
1690
|
+
</div>
|
|
1691
|
+
`;
|
|
1692
|
+
}
|
|
1693
|
+
const agentId = this.selectedContext;
|
|
1694
|
+
const status = this.getAgentStatus(agentId);
|
|
1695
|
+
const stats = this.getAgentStats(agentId);
|
|
1696
|
+
const state = this.getLatestStateForAgent(agentId);
|
|
1697
|
+
const messages = this.getLatestMessagesForAgent(agentId);
|
|
1698
|
+
const statusColors = {
|
|
1699
|
+
running: "bg-emerald-50 text-emerald-700",
|
|
1700
|
+
idle: "bg-gray-100 text-gray-600",
|
|
1701
|
+
error: "bg-rose-50 text-rose-700"
|
|
1702
|
+
};
|
|
1703
|
+
return html`
|
|
1704
|
+
<div class="flex flex-col gap-4 p-4 overflow-auto">
|
|
1705
|
+
<!-- Agent Overview Card -->
|
|
1706
|
+
<div class="rounded-lg border border-gray-200 bg-white p-4">
|
|
1707
|
+
<div class="flex items-start justify-between mb-4">
|
|
1708
|
+
<div class="flex items-center gap-3">
|
|
1709
|
+
<div class="flex h-10 w-10 items-center justify-center rounded-lg bg-blue-100 text-blue-600">
|
|
1710
|
+
${this.renderIcon("Bot")}
|
|
1711
|
+
</div>
|
|
1712
|
+
<div>
|
|
1713
|
+
<h3 class="font-semibold text-sm text-gray-900">${agentId}</h3>
|
|
1714
|
+
<span class="inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-xs font-medium ${statusColors[status]} relative -translate-y-[2px]">
|
|
1715
|
+
<span class="h-1.5 w-1.5 rounded-full ${status === "running" ? "bg-emerald-500 animate-pulse" : status === "error" ? "bg-rose-500" : "bg-gray-400"}"></span>
|
|
1716
|
+
${status.charAt(0).toUpperCase() + status.slice(1)}
|
|
1717
|
+
</span>
|
|
1718
|
+
</div>
|
|
1719
|
+
</div>
|
|
1720
|
+
${stats.lastActivity ? html`<span class="text-xs text-gray-500">Last activity: ${new Date(stats.lastActivity).toLocaleTimeString()}</span>` : nothing}
|
|
1721
|
+
</div>
|
|
1722
|
+
<div class="grid grid-cols-2 gap-4 md:grid-cols-4">
|
|
1723
|
+
<button
|
|
1724
|
+
type="button"
|
|
1725
|
+
class="rounded-md bg-gray-50 px-3 py-2 text-left transition hover:bg-gray-100 cursor-pointer overflow-hidden"
|
|
1726
|
+
@click=${() => this.handleMenuSelect("ag-ui-events")}
|
|
1727
|
+
title="View all events in AG-UI Events"
|
|
1728
|
+
>
|
|
1729
|
+
<div class="truncate whitespace-nowrap text-xs text-gray-600">Total Events</div>
|
|
1730
|
+
<div class="text-lg font-semibold text-gray-900">${stats.totalEvents}</div>
|
|
1731
|
+
</button>
|
|
1732
|
+
<div class="rounded-md bg-gray-50 px-3 py-2 overflow-hidden">
|
|
1733
|
+
<div class="truncate whitespace-nowrap text-xs text-gray-600">Messages</div>
|
|
1734
|
+
<div class="text-lg font-semibold text-gray-900">${stats.messages}</div>
|
|
1735
|
+
</div>
|
|
1736
|
+
<div class="rounded-md bg-gray-50 px-3 py-2 overflow-hidden">
|
|
1737
|
+
<div class="truncate whitespace-nowrap text-xs text-gray-600">Tool Calls</div>
|
|
1738
|
+
<div class="text-lg font-semibold text-gray-900">${stats.toolCalls}</div>
|
|
1739
|
+
</div>
|
|
1740
|
+
<div class="rounded-md bg-gray-50 px-3 py-2 overflow-hidden">
|
|
1741
|
+
<div class="truncate whitespace-nowrap text-xs text-gray-600">Errors</div>
|
|
1742
|
+
<div class="text-lg font-semibold text-gray-900">${stats.errors}</div>
|
|
1743
|
+
</div>
|
|
1744
|
+
</div>
|
|
1745
|
+
</div>
|
|
1746
|
+
|
|
1747
|
+
<!-- Current State Section -->
|
|
1748
|
+
<div class="rounded-lg border border-gray-200 bg-white">
|
|
1749
|
+
<div class="border-b border-gray-200 px-4 py-3">
|
|
1750
|
+
<h4 class="text-sm font-semibold text-gray-900">Current State</h4>
|
|
1751
|
+
</div>
|
|
1752
|
+
<div class="overflow-auto p-4">
|
|
1753
|
+
${this.hasRenderableState(state) ? html`
|
|
1754
|
+
<pre class="overflow-auto rounded-md bg-gray-50 p-3 text-xs text-gray-800 max-h-64"><code>${this.formatStateForDisplay(state)}</code></pre>
|
|
1755
|
+
` : html`
|
|
1756
|
+
<div class="flex h-40 items-center justify-center text-xs text-gray-500">
|
|
1757
|
+
<div class="flex items-center gap-2 text-gray-500">
|
|
1758
|
+
<span class="text-lg text-gray-400">${this.renderIcon("Database")}</span>
|
|
1759
|
+
<span>State is empty</span>
|
|
1760
|
+
</div>
|
|
1761
|
+
</div>
|
|
1762
|
+
`}
|
|
1763
|
+
</div>
|
|
1764
|
+
</div>
|
|
1765
|
+
|
|
1766
|
+
<!-- Current Messages Section -->
|
|
1767
|
+
<div class="rounded-lg border border-gray-200 bg-white">
|
|
1768
|
+
<div class="border-b border-gray-200 px-4 py-3">
|
|
1769
|
+
<h4 class="text-sm font-semibold text-gray-900">Current Messages</h4>
|
|
1770
|
+
</div>
|
|
1771
|
+
<div class="overflow-auto">
|
|
1772
|
+
${messages && Array.isArray(messages) && messages.length > 0 ? html`
|
|
1773
|
+
<table class="w-full text-xs">
|
|
1774
|
+
<thead class="bg-gray-50">
|
|
1775
|
+
<tr>
|
|
1776
|
+
<th class="px-4 py-2 text-left font-medium text-gray-700">Role</th>
|
|
1777
|
+
<th class="px-4 py-2 text-left font-medium text-gray-700">Content</th>
|
|
1778
|
+
</tr>
|
|
1779
|
+
</thead>
|
|
1780
|
+
<tbody class="divide-y divide-gray-200">
|
|
1781
|
+
${messages.map((msg, idx) => {
|
|
1782
|
+
const role = msg?.role ?? "unknown";
|
|
1783
|
+
const roleColors = {
|
|
1784
|
+
user: "bg-blue-100 text-blue-800",
|
|
1785
|
+
assistant: "bg-green-100 text-green-800",
|
|
1786
|
+
system: "bg-gray-100 text-gray-800",
|
|
1787
|
+
unknown: "bg-gray-100 text-gray-600"
|
|
1788
|
+
};
|
|
1789
|
+
const rawContent = typeof msg?.content === "string" ? msg.content : msg?.content != null ? JSON.stringify(msg.content) : "";
|
|
1790
|
+
const toolCalls = Array.isArray(msg?.toolCalls) ? msg.toolCalls : [];
|
|
1791
|
+
const hasContent = rawContent.trim().length > 0;
|
|
1792
|
+
const contentFallback = toolCalls.length > 0 ? "Invoked tool call" : "\u2014";
|
|
1793
|
+
return html`
|
|
1794
|
+
<tr>
|
|
1795
|
+
<td class="px-4 py-2 align-top">
|
|
1796
|
+
<span class="inline-flex rounded px-2 py-0.5 text-[10px] font-medium ${roleColors[role] || roleColors.unknown}">
|
|
1797
|
+
${role}
|
|
1798
|
+
</span>
|
|
1799
|
+
</td>
|
|
1800
|
+
<td class="px-4 py-2">
|
|
1801
|
+
${hasContent ? html`<div class="max-w-2xl whitespace-pre-wrap break-words text-gray-700">${rawContent}</div>` : html`<div class="text-xs italic text-gray-400">${contentFallback}</div>`}
|
|
1802
|
+
${role === "assistant" && toolCalls.length > 0 ? this.renderToolCallDetails(toolCalls) : nothing}
|
|
1803
|
+
</td>
|
|
1804
|
+
</tr>
|
|
1805
|
+
`;
|
|
1806
|
+
})}
|
|
1807
|
+
</tbody>
|
|
1808
|
+
</table>
|
|
1809
|
+
` : html`
|
|
1810
|
+
<div class="flex h-40 items-center justify-center text-xs text-gray-500">
|
|
1811
|
+
<div class="flex items-center gap-2 text-gray-500">
|
|
1812
|
+
<span class="text-lg text-gray-400">${this.renderIcon("MessageSquare")}</span>
|
|
1813
|
+
<span>No messages available</span>
|
|
1814
|
+
</div>
|
|
1815
|
+
</div>
|
|
1816
|
+
`}
|
|
1817
|
+
</div>
|
|
1818
|
+
</div>
|
|
1819
|
+
</div>
|
|
1820
|
+
`;
|
|
1821
|
+
}
|
|
1122
1822
|
renderContextDropdown() {
|
|
1123
|
-
if (this.selectedMenu
|
|
1823
|
+
if (this.selectedMenu === "agent-context") {
|
|
1124
1824
|
return nothing;
|
|
1125
1825
|
}
|
|
1126
|
-
|
|
1826
|
+
if (this.selectedMenu !== "ag-ui-events" && this.selectedMenu !== "agents" && this.selectedMenu !== "frontend-tools") {
|
|
1827
|
+
return nothing;
|
|
1828
|
+
}
|
|
1829
|
+
const filteredOptions = this.selectedMenu === "agents" ? this.contextOptions.filter((opt) => opt.key !== "all-agents") : this.contextOptions;
|
|
1830
|
+
const selectedLabel = filteredOptions.find((opt) => opt.key === this.selectedContext)?.label ?? "";
|
|
1127
1831
|
return html`
|
|
1128
|
-
<div class="relative" data-context-dropdown-root="true">
|
|
1832
|
+
<div class="relative min-w-0 flex-1" data-context-dropdown-root="true">
|
|
1129
1833
|
<button
|
|
1130
1834
|
type="button"
|
|
1131
|
-
class="flex items-center gap-1.5 rounded-md px-2 py-0.5 text-xs font-medium text-gray-600 transition hover:bg-gray-100 hover:text-gray-900"
|
|
1835
|
+
class="flex w-full min-w-0 max-w-[150px] items-center gap-1.5 rounded-md px-2 py-0.5 text-xs font-medium text-gray-600 transition hover:bg-gray-100 hover:text-gray-900"
|
|
1132
1836
|
@pointerdown=${this.handleContextDropdownToggle}
|
|
1133
1837
|
>
|
|
1134
|
-
<span>${selectedLabel}</span>
|
|
1135
|
-
<span class="text-gray-400">${this.renderIcon("ChevronDown")}</span>
|
|
1838
|
+
<span class="truncate flex-1 text-left">${selectedLabel}</span>
|
|
1839
|
+
<span class="shrink-0 text-gray-400">${this.renderIcon("ChevronDown")}</span>
|
|
1136
1840
|
</button>
|
|
1137
1841
|
${this.contextMenuOpen ? html`
|
|
1138
1842
|
<div
|
|
1139
1843
|
class="absolute left-0 z-50 mt-1.5 w-40 rounded-md border border-gray-200 bg-white py-1 shadow-md ring-1 ring-black/5"
|
|
1140
1844
|
data-context-dropdown-root="true"
|
|
1141
1845
|
>
|
|
1142
|
-
${
|
|
1846
|
+
${filteredOptions.map(
|
|
1143
1847
|
(option) => html`
|
|
1144
1848
|
<button
|
|
1145
1849
|
type="button"
|
|
@@ -1147,7 +1851,7 @@ var WebInspectorElement = class extends LitElement {
|
|
|
1147
1851
|
data-context-dropdown-root="true"
|
|
1148
1852
|
@click=${() => this.handleContextOptionSelect(option.key)}
|
|
1149
1853
|
>
|
|
1150
|
-
<span class="${option.key === this.selectedContext ? "text-gray-900 font-medium" : "text-gray-600"}">${option.label}</span>
|
|
1854
|
+
<span class="truncate ${option.key === this.selectedContext ? "text-gray-900 font-medium" : "text-gray-600"}">${option.label}</span>
|
|
1151
1855
|
${option.key === this.selectedContext ? html`<span class="text-gray-500">${this.renderIcon("Check")}</span>` : nothing}
|
|
1152
1856
|
</button>
|
|
1153
1857
|
`
|
|
@@ -1162,7 +1866,15 @@ var WebInspectorElement = class extends LitElement {
|
|
|
1162
1866
|
return;
|
|
1163
1867
|
}
|
|
1164
1868
|
this.selectedMenu = key;
|
|
1869
|
+
if (key === "agents" && this.selectedContext === "all-agents") {
|
|
1870
|
+
const agentOptions = this.contextOptions.filter((opt) => opt.key !== "all-agents");
|
|
1871
|
+
if (agentOptions.length > 0) {
|
|
1872
|
+
const defaultAgent = agentOptions.find((opt) => opt.key === "default");
|
|
1873
|
+
this.selectedContext = defaultAgent ? defaultAgent.key : agentOptions[0].key;
|
|
1874
|
+
}
|
|
1875
|
+
}
|
|
1165
1876
|
this.contextMenuOpen = false;
|
|
1877
|
+
this.persistState();
|
|
1166
1878
|
this.requestUpdate();
|
|
1167
1879
|
}
|
|
1168
1880
|
handleContextDropdownToggle(event) {
|
|
@@ -1180,9 +1892,397 @@ var WebInspectorElement = class extends LitElement {
|
|
|
1180
1892
|
this.expandedRows.clear();
|
|
1181
1893
|
}
|
|
1182
1894
|
this.contextMenuOpen = false;
|
|
1895
|
+
this.persistState();
|
|
1896
|
+
this.requestUpdate();
|
|
1897
|
+
}
|
|
1898
|
+
renderToolsView() {
|
|
1899
|
+
if (!this._core) {
|
|
1900
|
+
return html`
|
|
1901
|
+
<div class="flex h-full items-center justify-center px-4 py-8 text-xs text-gray-500">
|
|
1902
|
+
No core instance available
|
|
1903
|
+
</div>
|
|
1904
|
+
`;
|
|
1905
|
+
}
|
|
1906
|
+
const allTools = this.extractToolsFromAgents();
|
|
1907
|
+
if (allTools.length === 0) {
|
|
1908
|
+
return html`
|
|
1909
|
+
<div class="flex h-full items-center justify-center px-4 py-8 text-center">
|
|
1910
|
+
<div class="max-w-md">
|
|
1911
|
+
<div class="mb-3 flex justify-center text-gray-300 [&>svg]:!h-8 [&>svg]:!w-8">
|
|
1912
|
+
${this.renderIcon("Hammer")}
|
|
1913
|
+
</div>
|
|
1914
|
+
<p class="text-sm text-gray-600">No tools available</p>
|
|
1915
|
+
<p class="mt-2 text-xs text-gray-500">Tools will appear here once agents are configured with tool handlers or renderers.</p>
|
|
1916
|
+
</div>
|
|
1917
|
+
</div>
|
|
1918
|
+
`;
|
|
1919
|
+
}
|
|
1920
|
+
const filteredTools = this.selectedContext === "all-agents" ? allTools : allTools.filter((tool) => tool.agentId === this.selectedContext);
|
|
1921
|
+
return html`
|
|
1922
|
+
<div class="flex h-full flex-col overflow-hidden">
|
|
1923
|
+
<div class="overflow-auto p-4">
|
|
1924
|
+
<div class="space-y-3">
|
|
1925
|
+
${filteredTools.map((tool) => this.renderToolCard(tool))}
|
|
1926
|
+
</div>
|
|
1927
|
+
</div>
|
|
1928
|
+
</div>
|
|
1929
|
+
`;
|
|
1930
|
+
}
|
|
1931
|
+
extractToolsFromAgents() {
|
|
1932
|
+
if (!this._core) {
|
|
1933
|
+
return [];
|
|
1934
|
+
}
|
|
1935
|
+
const tools = [];
|
|
1936
|
+
for (const [agentId, agent] of Object.entries(this._core.agents)) {
|
|
1937
|
+
if (!agent) continue;
|
|
1938
|
+
const handlers = agent.toolHandlers;
|
|
1939
|
+
if (handlers && typeof handlers === "object") {
|
|
1940
|
+
for (const [toolName, handler] of Object.entries(handlers)) {
|
|
1941
|
+
if (handler && typeof handler === "object") {
|
|
1942
|
+
const handlerObj = handler;
|
|
1943
|
+
tools.push({
|
|
1944
|
+
agentId,
|
|
1945
|
+
name: toolName,
|
|
1946
|
+
description: handlerObj.description || handlerObj.tool?.description,
|
|
1947
|
+
parameters: handlerObj.parameters || handlerObj.tool?.parameters,
|
|
1948
|
+
type: "handler"
|
|
1949
|
+
});
|
|
1950
|
+
}
|
|
1951
|
+
}
|
|
1952
|
+
}
|
|
1953
|
+
const renderers = agent.toolRenderers;
|
|
1954
|
+
if (renderers && typeof renderers === "object") {
|
|
1955
|
+
for (const [toolName, renderer] of Object.entries(renderers)) {
|
|
1956
|
+
if (!tools.some((t) => t.agentId === agentId && t.name === toolName)) {
|
|
1957
|
+
if (renderer && typeof renderer === "object") {
|
|
1958
|
+
const rendererObj = renderer;
|
|
1959
|
+
tools.push({
|
|
1960
|
+
agentId,
|
|
1961
|
+
name: toolName,
|
|
1962
|
+
description: rendererObj.description || rendererObj.tool?.description,
|
|
1963
|
+
parameters: rendererObj.parameters || rendererObj.tool?.parameters,
|
|
1964
|
+
type: "renderer"
|
|
1965
|
+
});
|
|
1966
|
+
}
|
|
1967
|
+
}
|
|
1968
|
+
}
|
|
1969
|
+
}
|
|
1970
|
+
}
|
|
1971
|
+
return tools.sort((a, b) => {
|
|
1972
|
+
const agentCompare = a.agentId.localeCompare(b.agentId);
|
|
1973
|
+
if (agentCompare !== 0) return agentCompare;
|
|
1974
|
+
return a.name.localeCompare(b.name);
|
|
1975
|
+
});
|
|
1976
|
+
}
|
|
1977
|
+
renderToolCard(tool) {
|
|
1978
|
+
const isExpanded = this.expandedTools.has(`${tool.agentId}:${tool.name}`);
|
|
1979
|
+
const schema = this.extractSchemaInfo(tool.parameters);
|
|
1980
|
+
const typeColors = {
|
|
1981
|
+
handler: "bg-blue-50 text-blue-700 border-blue-200",
|
|
1982
|
+
renderer: "bg-purple-50 text-purple-700 border-purple-200"
|
|
1983
|
+
};
|
|
1984
|
+
return html`
|
|
1985
|
+
<div class="rounded-lg border border-gray-200 bg-white overflow-hidden">
|
|
1986
|
+
<button
|
|
1987
|
+
type="button"
|
|
1988
|
+
class="w-full px-4 py-3 text-left transition hover:bg-gray-50"
|
|
1989
|
+
@click=${() => this.toggleToolExpansion(`${tool.agentId}:${tool.name}`)}
|
|
1990
|
+
>
|
|
1991
|
+
<div class="flex items-start justify-between gap-3">
|
|
1992
|
+
<div class="flex-1 min-w-0">
|
|
1993
|
+
<div class="flex items-center gap-2 mb-1">
|
|
1994
|
+
<span class="font-mono text-sm font-semibold text-gray-900">${tool.name}</span>
|
|
1995
|
+
<span class="inline-flex items-center rounded-sm border px-1.5 py-0.5 text-[10px] font-medium ${typeColors[tool.type]}">
|
|
1996
|
+
${tool.type}
|
|
1997
|
+
</span>
|
|
1998
|
+
</div>
|
|
1999
|
+
<div class="flex items-center gap-2 text-xs text-gray-500">
|
|
2000
|
+
<span class="flex items-center gap-1">
|
|
2001
|
+
${this.renderIcon("Bot")}
|
|
2002
|
+
<span class="font-mono">${tool.agentId}</span>
|
|
2003
|
+
</span>
|
|
2004
|
+
${schema.properties.length > 0 ? html`
|
|
2005
|
+
<span class="text-gray-300">•</span>
|
|
2006
|
+
<span>${schema.properties.length} parameter${schema.properties.length !== 1 ? "s" : ""}</span>
|
|
2007
|
+
` : nothing}
|
|
2008
|
+
</div>
|
|
2009
|
+
${tool.description ? html`<p class="mt-2 text-xs text-gray-600">${tool.description}</p>` : nothing}
|
|
2010
|
+
</div>
|
|
2011
|
+
<span class="shrink-0 text-gray-400 transition ${isExpanded ? "rotate-180" : ""}">
|
|
2012
|
+
${this.renderIcon("ChevronDown")}
|
|
2013
|
+
</span>
|
|
2014
|
+
</div>
|
|
2015
|
+
</button>
|
|
2016
|
+
|
|
2017
|
+
${isExpanded ? html`
|
|
2018
|
+
<div class="border-t border-gray-200 bg-gray-50/50 px-4 py-3">
|
|
2019
|
+
${schema.properties.length > 0 ? html`
|
|
2020
|
+
<h5 class="mb-3 text-xs font-semibold text-gray-700">Parameters</h5>
|
|
2021
|
+
<div class="space-y-3">
|
|
2022
|
+
${schema.properties.map((prop) => html`
|
|
2023
|
+
<div class="rounded-md border border-gray-200 bg-white p-3">
|
|
2024
|
+
<div class="flex items-start justify-between gap-2 mb-1">
|
|
2025
|
+
<span class="font-mono text-xs font-medium text-gray-900">${prop.name}</span>
|
|
2026
|
+
<div class="flex items-center gap-1.5 shrink-0">
|
|
2027
|
+
${prop.required ? html`<span class="text-[9px] rounded border border-rose-200 bg-rose-50 px-1 py-0.5 font-medium text-rose-700">required</span>` : html`<span class="text-[9px] rounded border border-gray-200 bg-gray-50 px-1 py-0.5 font-medium text-gray-600">optional</span>`}
|
|
2028
|
+
${prop.type ? html`<span class="text-[9px] rounded border border-gray-200 bg-gray-50 px-1 py-0.5 font-mono text-gray-600">${prop.type}</span>` : nothing}
|
|
2029
|
+
</div>
|
|
2030
|
+
</div>
|
|
2031
|
+
${prop.description ? html`<p class="mt-1 text-xs text-gray-600">${prop.description}</p>` : nothing}
|
|
2032
|
+
${prop.defaultValue !== void 0 ? html`
|
|
2033
|
+
<div class="mt-2 flex items-center gap-1.5 text-[10px] text-gray-500">
|
|
2034
|
+
<span>Default:</span>
|
|
2035
|
+
<code class="rounded bg-gray-100 px-1 py-0.5 font-mono">${JSON.stringify(prop.defaultValue)}</code>
|
|
2036
|
+
</div>
|
|
2037
|
+
` : nothing}
|
|
2038
|
+
${prop.enum && prop.enum.length > 0 ? html`
|
|
2039
|
+
<div class="mt-2">
|
|
2040
|
+
<span class="text-[10px] text-gray-500">Allowed values:</span>
|
|
2041
|
+
<div class="mt-1 flex flex-wrap gap-1">
|
|
2042
|
+
${prop.enum.map((val) => html`
|
|
2043
|
+
<code class="rounded border border-gray-200 bg-gray-50 px-1.5 py-0.5 text-[10px] font-mono text-gray-700">${JSON.stringify(val)}</code>
|
|
2044
|
+
`)}
|
|
2045
|
+
</div>
|
|
2046
|
+
</div>
|
|
2047
|
+
` : nothing}
|
|
2048
|
+
</div>
|
|
2049
|
+
`)}
|
|
2050
|
+
</div>
|
|
2051
|
+
` : html`
|
|
2052
|
+
<div class="flex items-center justify-center py-4 text-xs text-gray-500">
|
|
2053
|
+
<span>No parameters defined</span>
|
|
2054
|
+
</div>
|
|
2055
|
+
`}
|
|
2056
|
+
</div>
|
|
2057
|
+
` : nothing}
|
|
2058
|
+
</div>
|
|
2059
|
+
`;
|
|
2060
|
+
}
|
|
2061
|
+
extractSchemaInfo(parameters) {
|
|
2062
|
+
const result = { properties: [] };
|
|
2063
|
+
if (!parameters || typeof parameters !== "object") {
|
|
2064
|
+
return result;
|
|
2065
|
+
}
|
|
2066
|
+
const zodDef = parameters._def;
|
|
2067
|
+
if (zodDef) {
|
|
2068
|
+
if (zodDef.typeName === "ZodObject") {
|
|
2069
|
+
const shape = zodDef.shape?.() || zodDef.shape;
|
|
2070
|
+
const requiredKeys = /* @__PURE__ */ new Set();
|
|
2071
|
+
if (zodDef.unknownKeys === "strict" || !zodDef.catchall) {
|
|
2072
|
+
Object.keys(shape || {}).forEach((key) => {
|
|
2073
|
+
const fieldDef = shape[key]?._def;
|
|
2074
|
+
if (fieldDef && !this.isZodOptional(shape[key])) {
|
|
2075
|
+
requiredKeys.add(key);
|
|
2076
|
+
}
|
|
2077
|
+
});
|
|
2078
|
+
}
|
|
2079
|
+
for (const [key, value] of Object.entries(shape || {})) {
|
|
2080
|
+
const fieldInfo = this.extractZodFieldInfo(value);
|
|
2081
|
+
result.properties.push({
|
|
2082
|
+
name: key,
|
|
2083
|
+
type: fieldInfo.type,
|
|
2084
|
+
description: fieldInfo.description,
|
|
2085
|
+
required: requiredKeys.has(key),
|
|
2086
|
+
defaultValue: fieldInfo.defaultValue,
|
|
2087
|
+
enum: fieldInfo.enum
|
|
2088
|
+
});
|
|
2089
|
+
}
|
|
2090
|
+
}
|
|
2091
|
+
} else if (parameters.type === "object" && parameters.properties) {
|
|
2092
|
+
const props = parameters.properties;
|
|
2093
|
+
const required = new Set(parameters.required || []);
|
|
2094
|
+
for (const [key, value] of Object.entries(props)) {
|
|
2095
|
+
const prop = value;
|
|
2096
|
+
result.properties.push({
|
|
2097
|
+
name: key,
|
|
2098
|
+
type: prop.type,
|
|
2099
|
+
description: prop.description,
|
|
2100
|
+
required: required.has(key),
|
|
2101
|
+
defaultValue: prop.default,
|
|
2102
|
+
enum: prop.enum
|
|
2103
|
+
});
|
|
2104
|
+
}
|
|
2105
|
+
}
|
|
2106
|
+
return result;
|
|
2107
|
+
}
|
|
2108
|
+
isZodOptional(zodSchema) {
|
|
2109
|
+
if (!zodSchema?._def) return false;
|
|
2110
|
+
const def = zodSchema._def;
|
|
2111
|
+
if (def.typeName === "ZodOptional" || def.typeName === "ZodNullable") {
|
|
2112
|
+
return true;
|
|
2113
|
+
}
|
|
2114
|
+
if (def.defaultValue !== void 0) {
|
|
2115
|
+
return true;
|
|
2116
|
+
}
|
|
2117
|
+
return false;
|
|
2118
|
+
}
|
|
2119
|
+
extractZodFieldInfo(zodSchema) {
|
|
2120
|
+
const info = {};
|
|
2121
|
+
if (!zodSchema?._def) return info;
|
|
2122
|
+
let currentSchema = zodSchema;
|
|
2123
|
+
let def = currentSchema._def;
|
|
2124
|
+
while (def.typeName === "ZodOptional" || def.typeName === "ZodNullable" || def.typeName === "ZodDefault") {
|
|
2125
|
+
if (def.typeName === "ZodDefault" && def.defaultValue !== void 0) {
|
|
2126
|
+
info.defaultValue = typeof def.defaultValue === "function" ? def.defaultValue() : def.defaultValue;
|
|
2127
|
+
}
|
|
2128
|
+
currentSchema = def.innerType;
|
|
2129
|
+
if (!currentSchema?._def) break;
|
|
2130
|
+
def = currentSchema._def;
|
|
2131
|
+
}
|
|
2132
|
+
info.description = def.description;
|
|
2133
|
+
const typeMap = {
|
|
2134
|
+
ZodString: "string",
|
|
2135
|
+
ZodNumber: "number",
|
|
2136
|
+
ZodBoolean: "boolean",
|
|
2137
|
+
ZodArray: "array",
|
|
2138
|
+
ZodObject: "object",
|
|
2139
|
+
ZodEnum: "enum",
|
|
2140
|
+
ZodLiteral: "literal",
|
|
2141
|
+
ZodUnion: "union",
|
|
2142
|
+
ZodAny: "any",
|
|
2143
|
+
ZodUnknown: "unknown"
|
|
2144
|
+
};
|
|
2145
|
+
info.type = typeMap[def.typeName] || def.typeName?.replace("Zod", "").toLowerCase();
|
|
2146
|
+
if (def.typeName === "ZodEnum" && Array.isArray(def.values)) {
|
|
2147
|
+
info.enum = def.values;
|
|
2148
|
+
} else if (def.typeName === "ZodLiteral" && def.value !== void 0) {
|
|
2149
|
+
info.enum = [def.value];
|
|
2150
|
+
}
|
|
2151
|
+
return info;
|
|
2152
|
+
}
|
|
2153
|
+
toggleToolExpansion(toolId) {
|
|
2154
|
+
if (this.expandedTools.has(toolId)) {
|
|
2155
|
+
this.expandedTools.delete(toolId);
|
|
2156
|
+
} else {
|
|
2157
|
+
this.expandedTools.add(toolId);
|
|
2158
|
+
}
|
|
2159
|
+
this.requestUpdate();
|
|
2160
|
+
}
|
|
2161
|
+
renderContextView() {
|
|
2162
|
+
const contextEntries = Object.entries(this.contextStore);
|
|
2163
|
+
if (contextEntries.length === 0) {
|
|
2164
|
+
return html`
|
|
2165
|
+
<div class="flex h-full items-center justify-center px-4 py-8 text-center">
|
|
2166
|
+
<div class="max-w-md">
|
|
2167
|
+
<div class="mb-3 flex justify-center text-gray-300 [&>svg]:!h-8 [&>svg]:!w-8">
|
|
2168
|
+
${this.renderIcon("FileText")}
|
|
2169
|
+
</div>
|
|
2170
|
+
<p class="text-sm text-gray-600">No context available</p>
|
|
2171
|
+
<p class="mt-2 text-xs text-gray-500">Context will appear here once added to CopilotKit.</p>
|
|
2172
|
+
</div>
|
|
2173
|
+
</div>
|
|
2174
|
+
`;
|
|
2175
|
+
}
|
|
2176
|
+
return html`
|
|
2177
|
+
<div class="flex h-full flex-col overflow-hidden">
|
|
2178
|
+
<div class="overflow-auto p-4">
|
|
2179
|
+
<div class="space-y-3">
|
|
2180
|
+
${contextEntries.map(([id, context]) => this.renderContextCard(id, context))}
|
|
2181
|
+
</div>
|
|
2182
|
+
</div>
|
|
2183
|
+
</div>
|
|
2184
|
+
`;
|
|
2185
|
+
}
|
|
2186
|
+
renderContextCard(id, context) {
|
|
2187
|
+
const isExpanded = this.expandedContextItems.has(id);
|
|
2188
|
+
const valuePreview = this.getContextValuePreview(context.value);
|
|
2189
|
+
const hasValue = context.value !== void 0 && context.value !== null;
|
|
2190
|
+
return html`
|
|
2191
|
+
<div class="rounded-lg border border-gray-200 bg-white overflow-hidden">
|
|
2192
|
+
<button
|
|
2193
|
+
type="button"
|
|
2194
|
+
class="w-full px-4 py-3 text-left transition hover:bg-gray-50"
|
|
2195
|
+
@click=${() => this.toggleContextExpansion(id)}
|
|
2196
|
+
>
|
|
2197
|
+
<div class="flex items-start justify-between gap-3">
|
|
2198
|
+
<div class="flex-1 min-w-0">
|
|
2199
|
+
${context.description ? html`<p class="text-sm font-medium text-gray-900 mb-1">${context.description}</p>` : html`<p class="text-sm font-medium text-gray-500 italic mb-1">No description</p>`}
|
|
2200
|
+
<div class="flex items-center gap-2 text-xs text-gray-500">
|
|
2201
|
+
<span class="font-mono">${id.substring(0, 8)}...</span>
|
|
2202
|
+
${hasValue ? html`
|
|
2203
|
+
<span class="text-gray-300">•</span>
|
|
2204
|
+
<span class="truncate">${valuePreview}</span>
|
|
2205
|
+
` : nothing}
|
|
2206
|
+
</div>
|
|
2207
|
+
</div>
|
|
2208
|
+
<span class="shrink-0 text-gray-400 transition ${isExpanded ? "rotate-180" : ""}">
|
|
2209
|
+
${this.renderIcon("ChevronDown")}
|
|
2210
|
+
</span>
|
|
2211
|
+
</div>
|
|
2212
|
+
</button>
|
|
2213
|
+
|
|
2214
|
+
${isExpanded ? html`
|
|
2215
|
+
<div class="border-t border-gray-200 bg-gray-50/50 px-4 py-3">
|
|
2216
|
+
<div class="mb-3">
|
|
2217
|
+
<h5 class="mb-1 text-xs font-semibold text-gray-700">ID</h5>
|
|
2218
|
+
<code class="block rounded bg-white border border-gray-200 px-2 py-1 text-[10px] font-mono text-gray-600">${id}</code>
|
|
2219
|
+
</div>
|
|
2220
|
+
${hasValue ? html`
|
|
2221
|
+
<h5 class="mb-2 text-xs font-semibold text-gray-700">Value</h5>
|
|
2222
|
+
<div class="rounded-md border border-gray-200 bg-white p-3">
|
|
2223
|
+
<pre class="overflow-auto text-xs text-gray-800 max-h-96"><code>${this.formatContextValue(context.value)}</code></pre>
|
|
2224
|
+
</div>
|
|
2225
|
+
` : html`
|
|
2226
|
+
<div class="flex items-center justify-center py-4 text-xs text-gray-500">
|
|
2227
|
+
<span>No value available</span>
|
|
2228
|
+
</div>
|
|
2229
|
+
`}
|
|
2230
|
+
</div>
|
|
2231
|
+
` : nothing}
|
|
2232
|
+
</div>
|
|
2233
|
+
`;
|
|
2234
|
+
}
|
|
2235
|
+
getContextValuePreview(value) {
|
|
2236
|
+
if (value === void 0 || value === null) {
|
|
2237
|
+
return "\u2014";
|
|
2238
|
+
}
|
|
2239
|
+
if (typeof value === "string") {
|
|
2240
|
+
return value.length > 50 ? `${value.substring(0, 50)}...` : value;
|
|
2241
|
+
}
|
|
2242
|
+
if (typeof value === "number" || typeof value === "boolean") {
|
|
2243
|
+
return String(value);
|
|
2244
|
+
}
|
|
2245
|
+
if (Array.isArray(value)) {
|
|
2246
|
+
return `Array(${value.length})`;
|
|
2247
|
+
}
|
|
2248
|
+
if (typeof value === "object") {
|
|
2249
|
+
const keys = Object.keys(value);
|
|
2250
|
+
return `Object with ${keys.length} key${keys.length !== 1 ? "s" : ""}`;
|
|
2251
|
+
}
|
|
2252
|
+
if (typeof value === "function") {
|
|
2253
|
+
return "Function";
|
|
2254
|
+
}
|
|
2255
|
+
return String(value);
|
|
2256
|
+
}
|
|
2257
|
+
formatContextValue(value) {
|
|
2258
|
+
if (value === void 0) {
|
|
2259
|
+
return "undefined";
|
|
2260
|
+
}
|
|
2261
|
+
if (value === null) {
|
|
2262
|
+
return "null";
|
|
2263
|
+
}
|
|
2264
|
+
if (typeof value === "function") {
|
|
2265
|
+
return value.toString();
|
|
2266
|
+
}
|
|
2267
|
+
try {
|
|
2268
|
+
return JSON.stringify(value, null, 2);
|
|
2269
|
+
} catch (error) {
|
|
2270
|
+
return String(value);
|
|
2271
|
+
}
|
|
2272
|
+
}
|
|
2273
|
+
toggleContextExpansion(contextId) {
|
|
2274
|
+
if (this.expandedContextItems.has(contextId)) {
|
|
2275
|
+
this.expandedContextItems.delete(contextId);
|
|
2276
|
+
} else {
|
|
2277
|
+
this.expandedContextItems.add(contextId);
|
|
2278
|
+
}
|
|
1183
2279
|
this.requestUpdate();
|
|
1184
2280
|
}
|
|
1185
2281
|
toggleRowExpansion(eventId) {
|
|
2282
|
+
const selection = window.getSelection();
|
|
2283
|
+
if (selection && selection.toString().length > 0) {
|
|
2284
|
+
return;
|
|
2285
|
+
}
|
|
1186
2286
|
if (this.expandedRows.has(eventId)) {
|
|
1187
2287
|
this.expandedRows.delete(eventId);
|
|
1188
2288
|
} else {
|