@copilotkitnext/web-inspector 0.0.13 → 0.0.15
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/.turbo/turbo-build$colon$css.log +9 -0
- package/.turbo/turbo-build.log +23 -29
- package/dist/index.d.mts +44 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.js +1206 -106
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1206 -106
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
- package/src/index.ts +1559 -111
- package/src/lib/persistence.ts +9 -1
- package/src/lib/types.ts +2 -0
- package/src/styles/generated.css +1 -1
package/dist/index.js
CHANGED
|
@@ -29,7 +29,7 @@ var import_lit = require("lit");
|
|
|
29
29
|
var import_style_map = require("lit/directives/style-map.js");
|
|
30
30
|
|
|
31
31
|
// src/styles/generated.css
|
|
32
|
-
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}';
|
|
32
|
+
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}}';
|
|
33
33
|
|
|
34
34
|
// src/assets/logo-mark.svg
|
|
35
35
|
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';
|
|
@@ -157,17 +157,22 @@ function isValidSize(value) {
|
|
|
157
157
|
function isFiniteNumber(value) {
|
|
158
158
|
return typeof value === "number" && Number.isFinite(value);
|
|
159
159
|
}
|
|
160
|
+
function isValidDockMode(value) {
|
|
161
|
+
return value === "floating" || value === "docked-left";
|
|
162
|
+
}
|
|
160
163
|
|
|
161
164
|
// src/index.ts
|
|
162
165
|
var WEB_INSPECTOR_TAG = "web-inspector";
|
|
163
166
|
var EDGE_MARGIN = 16;
|
|
164
167
|
var DRAG_THRESHOLD = 6;
|
|
165
|
-
var MIN_WINDOW_WIDTH =
|
|
168
|
+
var MIN_WINDOW_WIDTH = 600;
|
|
169
|
+
var MIN_WINDOW_WIDTH_DOCKED_LEFT = 420;
|
|
166
170
|
var MIN_WINDOW_HEIGHT = 200;
|
|
167
171
|
var COOKIE_NAME = "copilotkit_inspector_state";
|
|
168
172
|
var COOKIE_MAX_AGE_SECONDS = 60 * 60 * 24 * 30;
|
|
169
173
|
var DEFAULT_BUTTON_SIZE = { width: 48, height: 48 };
|
|
170
|
-
var DEFAULT_WINDOW_SIZE = { width:
|
|
174
|
+
var DEFAULT_WINDOW_SIZE = { width: 840, height: 560 };
|
|
175
|
+
var DOCKED_LEFT_WIDTH = 500;
|
|
171
176
|
var MAX_AGENT_EVENTS = 200;
|
|
172
177
|
var MAX_TOTAL_EVENTS = 500;
|
|
173
178
|
var WebInspectorElement = class extends import_lit.LitElement {
|
|
@@ -178,8 +183,11 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
178
183
|
this.coreUnsubscribe = null;
|
|
179
184
|
this.agentSubscriptions = /* @__PURE__ */ new Map();
|
|
180
185
|
this.agentEvents = /* @__PURE__ */ new Map();
|
|
186
|
+
this.agentMessages = /* @__PURE__ */ new Map();
|
|
187
|
+
this.agentStates = /* @__PURE__ */ new Map();
|
|
181
188
|
this.flattenedEvents = [];
|
|
182
189
|
this.eventCounter = 0;
|
|
190
|
+
this.contextStore = {};
|
|
183
191
|
this.pointerId = null;
|
|
184
192
|
this.dragStart = null;
|
|
185
193
|
this.dragOffset = { x: 0, y: 0 };
|
|
@@ -190,17 +198,21 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
190
198
|
this.ignoreNextButtonClick = false;
|
|
191
199
|
this.selectedMenu = "ag-ui-events";
|
|
192
200
|
this.contextMenuOpen = false;
|
|
201
|
+
this.dockMode = "floating";
|
|
202
|
+
this.previousBodyMargins = null;
|
|
203
|
+
this.transitionTimeoutId = null;
|
|
204
|
+
this.pendingSelectedContext = null;
|
|
193
205
|
this.contextState = {
|
|
194
206
|
button: {
|
|
195
207
|
position: { x: EDGE_MARGIN, y: EDGE_MARGIN },
|
|
196
208
|
size: { ...DEFAULT_BUTTON_SIZE },
|
|
197
|
-
anchor: { horizontal: "right", vertical: "
|
|
209
|
+
anchor: { horizontal: "right", vertical: "top" },
|
|
198
210
|
anchorOffset: { x: EDGE_MARGIN, y: EDGE_MARGIN }
|
|
199
211
|
},
|
|
200
212
|
window: {
|
|
201
213
|
position: { x: EDGE_MARGIN, y: EDGE_MARGIN },
|
|
202
214
|
size: { ...DEFAULT_WINDOW_SIZE },
|
|
203
|
-
anchor: { horizontal: "right", vertical: "
|
|
215
|
+
anchor: { horizontal: "right", vertical: "top" },
|
|
204
216
|
anchorOffset: { x: EDGE_MARGIN, y: EDGE_MARGIN }
|
|
205
217
|
}
|
|
206
218
|
};
|
|
@@ -219,6 +231,9 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
219
231
|
{ key: "agent-context", label: "Agent Context", icon: "FileText" }
|
|
220
232
|
];
|
|
221
233
|
this.handlePointerDown = (event) => {
|
|
234
|
+
if (this.dockMode !== "floating" && this.isOpen) {
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
222
237
|
const target = event.currentTarget;
|
|
223
238
|
const contextAttr = target?.dataset.dragContext;
|
|
224
239
|
const context = contextAttr === "window" ? "window" : "button";
|
|
@@ -268,16 +283,17 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
268
283
|
if (this.isDragging && this.pointerContext) {
|
|
269
284
|
event.preventDefault();
|
|
270
285
|
this.setDragging(false);
|
|
271
|
-
this.updateAnchorFromPosition(this.pointerContext);
|
|
272
286
|
if (this.pointerContext === "window") {
|
|
287
|
+
this.updateAnchorFromPosition(this.pointerContext);
|
|
273
288
|
this.hasCustomPosition.window = true;
|
|
289
|
+
this.applyAnchorPosition(this.pointerContext);
|
|
274
290
|
} else if (this.pointerContext === "button") {
|
|
291
|
+
this.snapButtonToCorner();
|
|
275
292
|
this.hasCustomPosition.button = true;
|
|
276
293
|
if (this.draggedDuringInteraction) {
|
|
277
294
|
this.ignoreNextButtonClick = true;
|
|
278
295
|
}
|
|
279
296
|
}
|
|
280
|
-
this.applyAnchorPosition(this.pointerContext);
|
|
281
297
|
} else if (context === "button" && !this.isOpen && !this.draggedDuringInteraction) {
|
|
282
298
|
this.openInspector();
|
|
283
299
|
}
|
|
@@ -323,6 +339,9 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
323
339
|
this.resizePointerId = event.pointerId;
|
|
324
340
|
this.resizeStart = { x: event.clientX, y: event.clientY };
|
|
325
341
|
this.resizeInitialSize = { ...this.contextState.window.size };
|
|
342
|
+
if (document.body && this.dockMode !== "floating") {
|
|
343
|
+
document.body.style.transition = "";
|
|
344
|
+
}
|
|
326
345
|
const target = event.currentTarget;
|
|
327
346
|
target?.setPointerCapture?.(event.pointerId);
|
|
328
347
|
};
|
|
@@ -334,12 +353,22 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
334
353
|
const deltaX = event.clientX - this.resizeStart.x;
|
|
335
354
|
const deltaY = event.clientY - this.resizeStart.y;
|
|
336
355
|
const state = this.contextState.window;
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
356
|
+
if (this.dockMode === "docked-left") {
|
|
357
|
+
state.size = this.clampWindowSize({
|
|
358
|
+
width: this.resizeInitialSize.width + deltaX,
|
|
359
|
+
height: state.size.height
|
|
360
|
+
});
|
|
361
|
+
if (document.body) {
|
|
362
|
+
document.body.style.marginLeft = `${state.size.width}px`;
|
|
363
|
+
}
|
|
364
|
+
} else {
|
|
365
|
+
state.size = this.clampWindowSize({
|
|
366
|
+
width: this.resizeInitialSize.width + deltaX,
|
|
367
|
+
height: this.resizeInitialSize.height + deltaY
|
|
368
|
+
});
|
|
369
|
+
this.keepPositionWithinViewport("window");
|
|
370
|
+
this.updateAnchorFromPosition("window");
|
|
371
|
+
}
|
|
343
372
|
this.requestUpdate();
|
|
344
373
|
this.updateHostTransform("window");
|
|
345
374
|
};
|
|
@@ -351,8 +380,11 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
351
380
|
if (target?.hasPointerCapture(this.resizePointerId)) {
|
|
352
381
|
target.releasePointerCapture(this.resizePointerId);
|
|
353
382
|
}
|
|
354
|
-
this.
|
|
355
|
-
|
|
383
|
+
if (this.dockMode === "floating") {
|
|
384
|
+
this.updateAnchorFromPosition("window");
|
|
385
|
+
this.applyAnchorPosition("window");
|
|
386
|
+
}
|
|
387
|
+
this.persistState();
|
|
356
388
|
this.resetResizeTracking();
|
|
357
389
|
};
|
|
358
390
|
this.handleResizePointerCancel = (event) => {
|
|
@@ -363,8 +395,11 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
363
395
|
if (target?.hasPointerCapture(this.resizePointerId)) {
|
|
364
396
|
target.releasePointerCapture(this.resizePointerId);
|
|
365
397
|
}
|
|
366
|
-
this.
|
|
367
|
-
|
|
398
|
+
if (this.dockMode === "floating") {
|
|
399
|
+
this.updateAnchorFromPosition("window");
|
|
400
|
+
this.applyAnchorPosition("window");
|
|
401
|
+
}
|
|
402
|
+
this.persistState();
|
|
368
403
|
this.resetResizeTracking();
|
|
369
404
|
};
|
|
370
405
|
this.handleResize = () => {
|
|
@@ -383,6 +418,9 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
383
418
|
];
|
|
384
419
|
this.selectedContext = "all-agents";
|
|
385
420
|
this.expandedRows = /* @__PURE__ */ new Set();
|
|
421
|
+
this.copiedEvents = /* @__PURE__ */ new Set();
|
|
422
|
+
this.expandedTools = /* @__PURE__ */ new Set();
|
|
423
|
+
this.expandedContextItems = /* @__PURE__ */ new Set();
|
|
386
424
|
this.handleGlobalPointerDown = (event) => {
|
|
387
425
|
if (!this.contextMenuOpen) {
|
|
388
426
|
return;
|
|
@@ -420,10 +458,17 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
420
458
|
this.coreSubscriber = {
|
|
421
459
|
onAgentsChanged: ({ agents }) => {
|
|
422
460
|
this.processAgentsChanged(agents);
|
|
461
|
+
},
|
|
462
|
+
onContextChanged: ({ context }) => {
|
|
463
|
+
this.contextStore = { ...context };
|
|
464
|
+
this.requestUpdate();
|
|
423
465
|
}
|
|
424
466
|
};
|
|
425
467
|
this.coreUnsubscribe = core.subscribe(this.coreSubscriber);
|
|
426
468
|
this.processAgentsChanged(core.agents);
|
|
469
|
+
if (core.context) {
|
|
470
|
+
this.contextStore = { ...core.context };
|
|
471
|
+
}
|
|
427
472
|
}
|
|
428
473
|
detachFromCore() {
|
|
429
474
|
if (this.coreUnsubscribe) {
|
|
@@ -439,6 +484,8 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
439
484
|
}
|
|
440
485
|
this.agentSubscriptions.clear();
|
|
441
486
|
this.agentEvents.clear();
|
|
487
|
+
this.agentMessages.clear();
|
|
488
|
+
this.agentStates.clear();
|
|
442
489
|
this.flattenedEvents = [];
|
|
443
490
|
this.eventCounter = 0;
|
|
444
491
|
}
|
|
@@ -455,6 +502,8 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
455
502
|
if (!seenAgentIds.has(agentId)) {
|
|
456
503
|
this.unsubscribeFromAgent(agentId);
|
|
457
504
|
this.agentEvents.delete(agentId);
|
|
505
|
+
this.agentMessages.delete(agentId);
|
|
506
|
+
this.agentStates.delete(agentId);
|
|
458
507
|
}
|
|
459
508
|
}
|
|
460
509
|
this.updateContextOptions(seenAgentIds);
|
|
@@ -499,12 +548,18 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
499
548
|
},
|
|
500
549
|
onStateSnapshotEvent: ({ event }) => {
|
|
501
550
|
this.recordAgentEvent(agentId, "STATE_SNAPSHOT", event);
|
|
551
|
+
this.syncAgentState(agent);
|
|
502
552
|
},
|
|
503
553
|
onStateDeltaEvent: ({ event }) => {
|
|
504
554
|
this.recordAgentEvent(agentId, "STATE_DELTA", event);
|
|
555
|
+
this.syncAgentState(agent);
|
|
505
556
|
},
|
|
506
557
|
onMessagesSnapshotEvent: ({ event }) => {
|
|
507
558
|
this.recordAgentEvent(agentId, "MESSAGES_SNAPSHOT", event);
|
|
559
|
+
this.syncAgentMessages(agent);
|
|
560
|
+
},
|
|
561
|
+
onMessagesChanged: () => {
|
|
562
|
+
this.syncAgentMessages(agent);
|
|
508
563
|
},
|
|
509
564
|
onRawEvent: ({ event }) => {
|
|
510
565
|
this.recordAgentEvent(agentId, "RAW_EVENT", event);
|
|
@@ -515,6 +570,8 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
515
570
|
};
|
|
516
571
|
const { unsubscribe } = agent.subscribe(subscriber);
|
|
517
572
|
this.agentSubscriptions.set(agentId, unsubscribe);
|
|
573
|
+
this.syncAgentMessages(agent);
|
|
574
|
+
this.syncAgentState(agent);
|
|
518
575
|
if (!this.agentEvents.has(agentId)) {
|
|
519
576
|
this.agentEvents.set(agentId, []);
|
|
520
577
|
}
|
|
@@ -541,6 +598,30 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
541
598
|
this.flattenedEvents = [event, ...this.flattenedEvents].slice(0, MAX_TOTAL_EVENTS);
|
|
542
599
|
this.requestUpdate();
|
|
543
600
|
}
|
|
601
|
+
syncAgentMessages(agent) {
|
|
602
|
+
if (!agent?.agentId) {
|
|
603
|
+
return;
|
|
604
|
+
}
|
|
605
|
+
const messages = agent.messages;
|
|
606
|
+
if (Array.isArray(messages)) {
|
|
607
|
+
this.agentMessages.set(agent.agentId, messages);
|
|
608
|
+
} else {
|
|
609
|
+
this.agentMessages.delete(agent.agentId);
|
|
610
|
+
}
|
|
611
|
+
this.requestUpdate();
|
|
612
|
+
}
|
|
613
|
+
syncAgentState(agent) {
|
|
614
|
+
if (!agent?.agentId) {
|
|
615
|
+
return;
|
|
616
|
+
}
|
|
617
|
+
const state = agent.state;
|
|
618
|
+
if (state === void 0 || state === null) {
|
|
619
|
+
this.agentStates.delete(agent.agentId);
|
|
620
|
+
} else {
|
|
621
|
+
this.agentStates.set(agent.agentId, state);
|
|
622
|
+
}
|
|
623
|
+
this.requestUpdate();
|
|
624
|
+
}
|
|
544
625
|
updateContextOptions(agentIds) {
|
|
545
626
|
const nextOptions = [
|
|
546
627
|
{ key: "all-agents", label: "All Agents" },
|
|
@@ -550,9 +631,32 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
550
631
|
if (optionsChanged) {
|
|
551
632
|
this.contextOptions = nextOptions;
|
|
552
633
|
}
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
634
|
+
const pendingContext = this.pendingSelectedContext;
|
|
635
|
+
if (pendingContext) {
|
|
636
|
+
const isPendingAvailable = pendingContext === "all-agents" || agentIds.has(pendingContext);
|
|
637
|
+
if (isPendingAvailable) {
|
|
638
|
+
if (this.selectedContext !== pendingContext) {
|
|
639
|
+
this.selectedContext = pendingContext;
|
|
640
|
+
this.expandedRows.clear();
|
|
641
|
+
}
|
|
642
|
+
this.pendingSelectedContext = null;
|
|
643
|
+
} else if (agentIds.size > 0) {
|
|
644
|
+
this.pendingSelectedContext = null;
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
const hasSelectedContext = nextOptions.some((option) => option.key === this.selectedContext);
|
|
648
|
+
if (!hasSelectedContext && this.pendingSelectedContext === null) {
|
|
649
|
+
let nextSelected = "all-agents";
|
|
650
|
+
if (agentIds.has("default")) {
|
|
651
|
+
nextSelected = "default";
|
|
652
|
+
} else if (agentIds.size > 0) {
|
|
653
|
+
nextSelected = Array.from(agentIds).sort((a, b) => a.localeCompare(b))[0];
|
|
654
|
+
}
|
|
655
|
+
if (this.selectedContext !== nextSelected) {
|
|
656
|
+
this.selectedContext = nextSelected;
|
|
657
|
+
this.expandedRows.clear();
|
|
658
|
+
this.persistState();
|
|
659
|
+
}
|
|
556
660
|
}
|
|
557
661
|
}
|
|
558
662
|
getEventsForSelectedContext() {
|
|
@@ -561,6 +665,146 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
561
665
|
}
|
|
562
666
|
return this.agentEvents.get(this.selectedContext) ?? [];
|
|
563
667
|
}
|
|
668
|
+
getLatestStateForAgent(agentId) {
|
|
669
|
+
if (this.agentStates.has(agentId)) {
|
|
670
|
+
return this.agentStates.get(agentId);
|
|
671
|
+
}
|
|
672
|
+
const events = this.agentEvents.get(agentId) ?? [];
|
|
673
|
+
const stateEvent = events.find((e) => e.type === "STATE_SNAPSHOT");
|
|
674
|
+
return stateEvent?.payload ?? null;
|
|
675
|
+
}
|
|
676
|
+
getLatestMessagesForAgent(agentId) {
|
|
677
|
+
const messages = this.agentMessages.get(agentId);
|
|
678
|
+
return messages ?? null;
|
|
679
|
+
}
|
|
680
|
+
getAgentStatus(agentId) {
|
|
681
|
+
const events = this.agentEvents.get(agentId) ?? [];
|
|
682
|
+
if (events.length === 0) {
|
|
683
|
+
return "idle";
|
|
684
|
+
}
|
|
685
|
+
const runEvent = events.find((e) => e.type === "RUN_STARTED" || e.type === "RUN_FINISHED" || e.type === "RUN_ERROR");
|
|
686
|
+
if (!runEvent) {
|
|
687
|
+
return "idle";
|
|
688
|
+
}
|
|
689
|
+
if (runEvent.type === "RUN_ERROR") {
|
|
690
|
+
return "error";
|
|
691
|
+
}
|
|
692
|
+
if (runEvent.type === "RUN_STARTED") {
|
|
693
|
+
const finishedAfter = events.find(
|
|
694
|
+
(e) => e.type === "RUN_FINISHED" && e.timestamp > runEvent.timestamp
|
|
695
|
+
);
|
|
696
|
+
return finishedAfter ? "idle" : "running";
|
|
697
|
+
}
|
|
698
|
+
return "idle";
|
|
699
|
+
}
|
|
700
|
+
getAgentStats(agentId) {
|
|
701
|
+
const events = this.agentEvents.get(agentId) ?? [];
|
|
702
|
+
const messages = this.agentMessages.get(agentId);
|
|
703
|
+
const toolCallCount = Array.isArray(messages) ? messages.reduce((count, rawMessage) => {
|
|
704
|
+
if (!rawMessage || typeof rawMessage !== "object") {
|
|
705
|
+
return count;
|
|
706
|
+
}
|
|
707
|
+
const toolCalls = rawMessage.toolCalls;
|
|
708
|
+
if (!Array.isArray(toolCalls)) {
|
|
709
|
+
return count;
|
|
710
|
+
}
|
|
711
|
+
return count + toolCalls.length;
|
|
712
|
+
}, 0) : events.filter((e) => e.type === "TOOL_CALL_END").length;
|
|
713
|
+
const messageCount = Array.isArray(messages) ? messages.length : 0;
|
|
714
|
+
return {
|
|
715
|
+
totalEvents: events.length,
|
|
716
|
+
lastActivity: events[0]?.timestamp ?? null,
|
|
717
|
+
messages: messageCount,
|
|
718
|
+
toolCalls: toolCallCount,
|
|
719
|
+
errors: events.filter((e) => e.type === "RUN_ERROR").length
|
|
720
|
+
};
|
|
721
|
+
}
|
|
722
|
+
renderToolCallDetails(toolCalls) {
|
|
723
|
+
if (!Array.isArray(toolCalls) || toolCalls.length === 0) {
|
|
724
|
+
return import_lit.nothing;
|
|
725
|
+
}
|
|
726
|
+
return import_lit.html`
|
|
727
|
+
<div class="mt-2 space-y-2">
|
|
728
|
+
${toolCalls.map((call, index) => {
|
|
729
|
+
const toolCall = call;
|
|
730
|
+
const functionName = typeof toolCall?.function?.name === "string" ? toolCall.function.name : "Unknown function";
|
|
731
|
+
const callId = typeof toolCall?.id === "string" ? toolCall.id : `tool-call-${index + 1}`;
|
|
732
|
+
const argsString = this.formatToolCallArguments(toolCall?.function?.arguments);
|
|
733
|
+
return import_lit.html`
|
|
734
|
+
<div class="rounded-md border border-gray-200 bg-gray-50 p-3 text-xs text-gray-700">
|
|
735
|
+
<div class="flex flex-wrap items-center justify-between gap-1 font-medium text-gray-900">
|
|
736
|
+
<span>${functionName}</span>
|
|
737
|
+
<span class="text-[10px] text-gray-500">ID: ${callId}</span>
|
|
738
|
+
</div>
|
|
739
|
+
${argsString ? import_lit.html`<pre class="mt-2 overflow-auto rounded bg-white p-2 text-[11px] leading-relaxed text-gray-800">${argsString}</pre>` : import_lit.nothing}
|
|
740
|
+
</div>
|
|
741
|
+
`;
|
|
742
|
+
})}
|
|
743
|
+
</div>
|
|
744
|
+
`;
|
|
745
|
+
}
|
|
746
|
+
formatToolCallArguments(args) {
|
|
747
|
+
if (args === void 0 || args === null || args === "") {
|
|
748
|
+
return null;
|
|
749
|
+
}
|
|
750
|
+
if (typeof args === "string") {
|
|
751
|
+
try {
|
|
752
|
+
const parsed = JSON.parse(args);
|
|
753
|
+
return JSON.stringify(parsed, null, 2);
|
|
754
|
+
} catch (error) {
|
|
755
|
+
return args;
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
if (typeof args === "object") {
|
|
759
|
+
try {
|
|
760
|
+
return JSON.stringify(args, null, 2);
|
|
761
|
+
} catch (error) {
|
|
762
|
+
return String(args);
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
return String(args);
|
|
766
|
+
}
|
|
767
|
+
hasRenderableState(state) {
|
|
768
|
+
if (state === null || state === void 0) {
|
|
769
|
+
return false;
|
|
770
|
+
}
|
|
771
|
+
if (Array.isArray(state)) {
|
|
772
|
+
return state.length > 0;
|
|
773
|
+
}
|
|
774
|
+
if (typeof state === "object") {
|
|
775
|
+
return Object.keys(state).length > 0;
|
|
776
|
+
}
|
|
777
|
+
if (typeof state === "string") {
|
|
778
|
+
const trimmed = state.trim();
|
|
779
|
+
return trimmed.length > 0 && trimmed !== "{}";
|
|
780
|
+
}
|
|
781
|
+
return true;
|
|
782
|
+
}
|
|
783
|
+
formatStateForDisplay(state) {
|
|
784
|
+
if (state === null || state === void 0) {
|
|
785
|
+
return "";
|
|
786
|
+
}
|
|
787
|
+
if (typeof state === "string") {
|
|
788
|
+
const trimmed = state.trim();
|
|
789
|
+
if (trimmed.length === 0) {
|
|
790
|
+
return "";
|
|
791
|
+
}
|
|
792
|
+
try {
|
|
793
|
+
const parsed = JSON.parse(trimmed);
|
|
794
|
+
return JSON.stringify(parsed, null, 2);
|
|
795
|
+
} catch {
|
|
796
|
+
return state;
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
if (typeof state === "object") {
|
|
800
|
+
try {
|
|
801
|
+
return JSON.stringify(state, null, 2);
|
|
802
|
+
} catch {
|
|
803
|
+
return String(state);
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
return String(state);
|
|
807
|
+
}
|
|
564
808
|
getEventBadgeClasses(type) {
|
|
565
809
|
const base = "font-mono text-[10px] font-medium inline-flex items-center rounded-sm px-1.5 py-0.5 border";
|
|
566
810
|
if (type.startsWith("RUN_")) {
|
|
@@ -597,6 +841,25 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
597
841
|
return String(payload);
|
|
598
842
|
}
|
|
599
843
|
}
|
|
844
|
+
extractEventFromPayload(payload) {
|
|
845
|
+
if (payload && typeof payload === "object" && "event" in payload) {
|
|
846
|
+
return payload.event;
|
|
847
|
+
}
|
|
848
|
+
return payload;
|
|
849
|
+
}
|
|
850
|
+
async copyToClipboard(text, eventId) {
|
|
851
|
+
try {
|
|
852
|
+
await navigator.clipboard.writeText(text);
|
|
853
|
+
this.copiedEvents.add(eventId);
|
|
854
|
+
this.requestUpdate();
|
|
855
|
+
setTimeout(() => {
|
|
856
|
+
this.copiedEvents.delete(eventId);
|
|
857
|
+
this.requestUpdate();
|
|
858
|
+
}, 2e3);
|
|
859
|
+
} catch (err) {
|
|
860
|
+
console.error("Failed to copy to clipboard:", err);
|
|
861
|
+
}
|
|
862
|
+
}
|
|
600
863
|
static {
|
|
601
864
|
this.styles = [
|
|
602
865
|
(0, import_lit.unsafeCSS)(generated_default),
|
|
@@ -610,16 +873,45 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
610
873
|
will-change: transform;
|
|
611
874
|
}
|
|
612
875
|
|
|
876
|
+
:host([data-transitioning="true"]) {
|
|
877
|
+
transition: transform 300ms ease;
|
|
878
|
+
}
|
|
879
|
+
|
|
613
880
|
.console-button {
|
|
614
881
|
transition:
|
|
615
|
-
transform
|
|
882
|
+
transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1),
|
|
616
883
|
opacity 160ms ease;
|
|
617
884
|
}
|
|
618
885
|
|
|
886
|
+
.console-button[data-dragging="true"] {
|
|
887
|
+
transition: opacity 160ms ease;
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
.inspector-window[data-transitioning="true"] {
|
|
891
|
+
transition: width 300ms ease, height 300ms ease;
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
.inspector-window[data-docked="true"] {
|
|
895
|
+
border-radius: 0 !important;
|
|
896
|
+
box-shadow: none !important;
|
|
897
|
+
}
|
|
898
|
+
|
|
619
899
|
.resize-handle {
|
|
620
900
|
touch-action: none;
|
|
621
901
|
user-select: none;
|
|
622
902
|
}
|
|
903
|
+
|
|
904
|
+
.dock-resize-handle {
|
|
905
|
+
position: absolute;
|
|
906
|
+
top: 0;
|
|
907
|
+
right: 0;
|
|
908
|
+
width: 10px;
|
|
909
|
+
height: 100%;
|
|
910
|
+
cursor: ew-resize;
|
|
911
|
+
touch-action: none;
|
|
912
|
+
z-index: 50;
|
|
913
|
+
background: transparent;
|
|
914
|
+
}
|
|
623
915
|
`
|
|
624
916
|
];
|
|
625
917
|
}
|
|
@@ -628,6 +920,7 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
628
920
|
if (typeof window !== "undefined") {
|
|
629
921
|
window.addEventListener("resize", this.handleResize);
|
|
630
922
|
window.addEventListener("pointerdown", this.handleGlobalPointerDown);
|
|
923
|
+
this.hydrateStateFromCookieEarly();
|
|
631
924
|
}
|
|
632
925
|
}
|
|
633
926
|
disconnectedCallback() {
|
|
@@ -636,6 +929,7 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
636
929
|
window.removeEventListener("resize", this.handleResize);
|
|
637
930
|
window.removeEventListener("pointerdown", this.handleGlobalPointerDown);
|
|
638
931
|
}
|
|
932
|
+
this.removeDockStyles();
|
|
639
933
|
this.detachFromCore();
|
|
640
934
|
}
|
|
641
935
|
firstUpdated() {
|
|
@@ -644,18 +938,23 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
644
938
|
}
|
|
645
939
|
this.measureContext("button");
|
|
646
940
|
this.measureContext("window");
|
|
647
|
-
this.contextState.button.anchor = { horizontal: "right", vertical: "
|
|
941
|
+
this.contextState.button.anchor = { horizontal: "right", vertical: "top" };
|
|
648
942
|
this.contextState.button.anchorOffset = { x: EDGE_MARGIN, y: EDGE_MARGIN };
|
|
649
|
-
this.contextState.window.anchor = { horizontal: "right", vertical: "
|
|
943
|
+
this.contextState.window.anchor = { horizontal: "right", vertical: "top" };
|
|
650
944
|
this.contextState.window.anchorOffset = { x: EDGE_MARGIN, y: EDGE_MARGIN };
|
|
651
945
|
this.hydrateStateFromCookie();
|
|
946
|
+
if (this.isOpen && this.dockMode !== "floating") {
|
|
947
|
+
this.applyDockStyles(true);
|
|
948
|
+
}
|
|
652
949
|
this.applyAnchorPosition("button");
|
|
653
|
-
if (this.
|
|
654
|
-
this.
|
|
655
|
-
|
|
656
|
-
|
|
950
|
+
if (this.dockMode === "floating") {
|
|
951
|
+
if (this.hasCustomPosition.window) {
|
|
952
|
+
this.applyAnchorPosition("window");
|
|
953
|
+
} else {
|
|
954
|
+
this.centerContext("window");
|
|
955
|
+
}
|
|
657
956
|
}
|
|
658
|
-
this.updateHostTransform("button");
|
|
957
|
+
this.updateHostTransform(this.isOpen ? "window" : "button");
|
|
659
958
|
}
|
|
660
959
|
render() {
|
|
661
960
|
return this.isOpen ? this.renderWindow() : this.renderButton();
|
|
@@ -698,6 +997,7 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
698
997
|
type="button"
|
|
699
998
|
aria-label="Web Inspector"
|
|
700
999
|
data-drag-context="button"
|
|
1000
|
+
data-dragging=${this.isDragging && this.pointerContext === "button" ? "true" : "false"}
|
|
701
1001
|
@pointerdown=${this.handlePointerDown}
|
|
702
1002
|
@pointermove=${this.handlePointerMove}
|
|
703
1003
|
@pointerup=${this.handlePointerUp}
|
|
@@ -710,7 +1010,10 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
710
1010
|
}
|
|
711
1011
|
renderWindow() {
|
|
712
1012
|
const windowState = this.contextState.window;
|
|
713
|
-
const
|
|
1013
|
+
const isDocked = this.dockMode !== "floating";
|
|
1014
|
+
const isTransitioning = this.hasAttribute("data-transitioning");
|
|
1015
|
+
const isCollapsed = this.dockMode === "docked-left";
|
|
1016
|
+
const windowStyles = isDocked ? this.getDockedWindowStyles() : {
|
|
714
1017
|
width: `${Math.round(windowState.size.width)}px`,
|
|
715
1018
|
height: `${Math.round(windowState.size.height)}px`,
|
|
716
1019
|
minWidth: `${MIN_WINDOW_WIDTH}px`,
|
|
@@ -722,39 +1025,57 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
722
1025
|
<section
|
|
723
1026
|
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"
|
|
724
1027
|
style=${(0, import_style_map.styleMap)(windowStyles)}
|
|
1028
|
+
data-docked=${isDocked}
|
|
1029
|
+
data-transitioning=${isTransitioning}
|
|
725
1030
|
>
|
|
1031
|
+
${isDocked ? import_lit.html`
|
|
1032
|
+
<div
|
|
1033
|
+
class="dock-resize-handle pointer-events-auto"
|
|
1034
|
+
role="presentation"
|
|
1035
|
+
aria-hidden="true"
|
|
1036
|
+
@pointerdown=${this.handleResizePointerDown}
|
|
1037
|
+
@pointermove=${this.handleResizePointerMove}
|
|
1038
|
+
@pointerup=${this.handleResizePointerUp}
|
|
1039
|
+
@pointercancel=${this.handleResizePointerCancel}
|
|
1040
|
+
></div>
|
|
1041
|
+
` : import_lit.nothing}
|
|
726
1042
|
<div class="flex flex-1 overflow-hidden bg-white text-gray-800">
|
|
727
1043
|
<nav
|
|
728
|
-
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"
|
|
1044
|
+
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"
|
|
729
1045
|
aria-label="Inspector sections"
|
|
730
1046
|
>
|
|
731
1047
|
<div class="flex flex-col gap-4 overflow-y-auto">
|
|
732
1048
|
<div
|
|
733
|
-
class="flex items-center gap-2 pl-1 touch-none select-none ${this.isDragging && this.pointerContext === "window" ? "cursor-grabbing" : "cursor-grab"}"
|
|
1049
|
+
class="flex items-center ${isCollapsed ? "justify-center" : "gap-2 pl-1"} touch-none select-none ${this.isDragging && this.pointerContext === "window" ? "cursor-grabbing" : "cursor-grab"}"
|
|
734
1050
|
data-drag-context="window"
|
|
735
1051
|
@pointerdown=${this.handlePointerDown}
|
|
736
1052
|
@pointermove=${this.handlePointerMove}
|
|
737
1053
|
@pointerup=${this.handlePointerUp}
|
|
738
1054
|
@pointercancel=${this.handlePointerCancel}
|
|
1055
|
+
title="${isCollapsed ? "Acme Inc - Enterprise" : ""}"
|
|
739
1056
|
>
|
|
740
1057
|
<span
|
|
741
1058
|
class="flex h-8 w-8 items-center justify-center rounded-lg bg-gray-900 text-white pointer-events-none"
|
|
742
1059
|
>
|
|
743
1060
|
${this.renderIcon("Building2")}
|
|
744
1061
|
</span>
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
1062
|
+
${!isCollapsed ? import_lit.html`
|
|
1063
|
+
<div class="flex flex-1 flex-col leading-tight pointer-events-none">
|
|
1064
|
+
<span class="text-sm font-semibold text-gray-900">Acme Inc</span>
|
|
1065
|
+
<span class="text-[10px] text-gray-500">Enterprise</span>
|
|
1066
|
+
</div>
|
|
1067
|
+
` : import_lit.nothing}
|
|
749
1068
|
</div>
|
|
750
1069
|
|
|
751
1070
|
<div class="flex flex-col gap-2 pt-2">
|
|
752
|
-
|
|
1071
|
+
${!isCollapsed ? import_lit.html`<div class="px-1 text-[10px] font-semibold uppercase tracking-wider text-gray-400">Platform</div>` : import_lit.nothing}
|
|
753
1072
|
<div class="flex flex-col gap-0.5">
|
|
754
1073
|
${this.menuItems.map(({ key, label, icon }) => {
|
|
755
1074
|
const isSelected = this.selectedMenu === key;
|
|
756
1075
|
const buttonClasses = [
|
|
757
|
-
"group flex w-full items-center
|
|
1076
|
+
"group flex w-full items-center",
|
|
1077
|
+
isCollapsed ? "justify-center p-2" : "gap-2 px-2 py-1.5",
|
|
1078
|
+
"rounded-md text-left text-xs transition focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gray-300",
|
|
758
1079
|
isSelected ? "bg-gray-900 text-white" : "text-gray-600 hover:bg-gray-100 hover:text-gray-900"
|
|
759
1080
|
].join(" ");
|
|
760
1081
|
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";
|
|
@@ -763,16 +1084,19 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
763
1084
|
type="button"
|
|
764
1085
|
class=${buttonClasses}
|
|
765
1086
|
aria-pressed=${isSelected}
|
|
1087
|
+
title="${isCollapsed ? label : ""}"
|
|
766
1088
|
@click=${() => this.handleMenuSelect(key)}
|
|
767
1089
|
>
|
|
768
1090
|
<span
|
|
769
|
-
class="flex h-6 w-6 items-center justify-center rounded ${badgeClasses}"
|
|
1091
|
+
class="flex h-6 w-6 items-center justify-center rounded ${isCollapsed && isSelected ? "text-white" : isCollapsed ? "text-gray-600" : badgeClasses}"
|
|
770
1092
|
aria-hidden="true"
|
|
771
1093
|
>
|
|
772
1094
|
${this.renderIcon(icon)}
|
|
773
1095
|
</span>
|
|
774
|
-
|
|
775
|
-
|
|
1096
|
+
${!isCollapsed ? import_lit.html`
|
|
1097
|
+
<span class="flex-1">${label}</span>
|
|
1098
|
+
<span class="text-gray-400 opacity-60">${this.renderIcon("ChevronRight")}</span>
|
|
1099
|
+
` : import_lit.nothing}
|
|
776
1100
|
</button>
|
|
777
1101
|
`;
|
|
778
1102
|
})}
|
|
@@ -781,50 +1105,61 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
781
1105
|
</div>
|
|
782
1106
|
|
|
783
1107
|
<div
|
|
784
|
-
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"
|
|
1108
|
+
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"
|
|
1109
|
+
title="${isCollapsed ? "John Snow - john@snow.com" : ""}"
|
|
785
1110
|
>
|
|
786
1111
|
<span
|
|
787
|
-
class="w-6 h-6 flex items-center justify-center overflow-hidden rounded bg-gray-100 text-[10px] font-semibold text-gray-700"
|
|
1112
|
+
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"
|
|
788
1113
|
>
|
|
789
1114
|
JS
|
|
790
1115
|
</span>
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
1116
|
+
${!isCollapsed ? import_lit.html`
|
|
1117
|
+
<div class="pl-2 flex flex-1 flex-col leading-tight">
|
|
1118
|
+
<span class="font-medium text-gray-900">John Snow</span>
|
|
1119
|
+
<span class="text-[10px] text-gray-500">john@snow.com</span>
|
|
1120
|
+
</div>
|
|
1121
|
+
<span class="text-gray-300">${this.renderIcon("ChevronRight")}</span>
|
|
1122
|
+
` : import_lit.nothing}
|
|
796
1123
|
</div>
|
|
797
1124
|
</nav>
|
|
798
1125
|
<div class="relative flex flex-1 flex-col overflow-hidden">
|
|
799
1126
|
<div
|
|
800
|
-
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"}"
|
|
1127
|
+
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"}"
|
|
801
1128
|
data-drag-context="window"
|
|
802
|
-
@pointerdown=${this.handlePointerDown}
|
|
803
|
-
@pointermove=${this.handlePointerMove}
|
|
804
|
-
@pointerup=${this.handlePointerUp}
|
|
805
|
-
@pointercancel=${this.handlePointerCancel}
|
|
1129
|
+
@pointerdown=${isDocked ? void 0 : this.handlePointerDown}
|
|
1130
|
+
@pointermove=${isDocked ? void 0 : this.handlePointerMove}
|
|
1131
|
+
@pointerup=${isDocked ? void 0 : this.handlePointerUp}
|
|
1132
|
+
@pointercancel=${isDocked ? void 0 : this.handlePointerCancel}
|
|
806
1133
|
>
|
|
807
|
-
<div class="flex items-center gap-2 text-xs text-gray-500">
|
|
808
|
-
<
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
1134
|
+
<div class="flex min-w-0 flex-1 items-center gap-2 text-xs text-gray-500">
|
|
1135
|
+
<div class="flex min-w-0 flex-1 items-center text-xs text-gray-600">
|
|
1136
|
+
<span class="flex shrink-0 items-center gap-1">
|
|
1137
|
+
<span>🪁</span>
|
|
1138
|
+
<span class="font-medium whitespace-nowrap">CopilotKit Inspector</span>
|
|
1139
|
+
</span>
|
|
1140
|
+
<span class="mx-3 h-3 w-px shrink-0 bg-gray-200"></span>
|
|
1141
|
+
<span class="shrink-0 text-gray-400">
|
|
1142
|
+
${this.renderIcon(this.getSelectedMenu().icon)}
|
|
1143
|
+
</span>
|
|
1144
|
+
<span class="ml-2 truncate">${this.getSelectedMenu().label}</span>
|
|
813
1145
|
${hasContextDropdown ? import_lit.html`
|
|
814
|
-
<span class="h-3 w-px bg-gray-200"></span>
|
|
815
|
-
<div class="
|
|
1146
|
+
<span class="mx-3 h-3 w-px shrink-0 bg-gray-200"></span>
|
|
1147
|
+
<div class="min-w-0">${contextDropdown}</div>
|
|
816
1148
|
` : import_lit.nothing}
|
|
817
1149
|
</div>
|
|
818
1150
|
</div>
|
|
819
|
-
<
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
1151
|
+
<div class="flex items-center gap-1">
|
|
1152
|
+
${this.renderDockControls()}
|
|
1153
|
+
<button
|
|
1154
|
+
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"
|
|
1155
|
+
type="button"
|
|
1156
|
+
aria-label="Close Web Inspector"
|
|
1157
|
+
@pointerdown=${this.handleClosePointerDown}
|
|
1158
|
+
@click=${this.handleCloseClick}
|
|
1159
|
+
>
|
|
1160
|
+
${this.renderIcon("X")}
|
|
1161
|
+
</button>
|
|
1162
|
+
</div>
|
|
828
1163
|
</div>
|
|
829
1164
|
<div class="flex-1 overflow-auto">
|
|
830
1165
|
${this.renderMainContent()}
|
|
@@ -856,6 +1191,31 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
856
1191
|
</section>
|
|
857
1192
|
`;
|
|
858
1193
|
}
|
|
1194
|
+
hydrateStateFromCookieEarly() {
|
|
1195
|
+
if (typeof document === "undefined" || typeof window === "undefined") {
|
|
1196
|
+
return;
|
|
1197
|
+
}
|
|
1198
|
+
const persisted = loadInspectorState(COOKIE_NAME);
|
|
1199
|
+
if (!persisted) {
|
|
1200
|
+
return;
|
|
1201
|
+
}
|
|
1202
|
+
if (typeof persisted.isOpen === "boolean") {
|
|
1203
|
+
this.isOpen = persisted.isOpen;
|
|
1204
|
+
}
|
|
1205
|
+
if (isValidDockMode(persisted.dockMode)) {
|
|
1206
|
+
this.dockMode = persisted.dockMode;
|
|
1207
|
+
}
|
|
1208
|
+
if (typeof persisted.selectedMenu === "string") {
|
|
1209
|
+
const validMenu = this.menuItems.find((item) => item.key === persisted.selectedMenu);
|
|
1210
|
+
if (validMenu) {
|
|
1211
|
+
this.selectedMenu = validMenu.key;
|
|
1212
|
+
}
|
|
1213
|
+
}
|
|
1214
|
+
if (typeof persisted.selectedContext === "string") {
|
|
1215
|
+
this.selectedContext = persisted.selectedContext;
|
|
1216
|
+
this.pendingSelectedContext = persisted.selectedContext;
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
859
1219
|
hydrateStateFromCookie() {
|
|
860
1220
|
if (typeof document === "undefined" || typeof window === "undefined") {
|
|
861
1221
|
return;
|
|
@@ -891,6 +1251,10 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
891
1251
|
this.hasCustomPosition.window = persistedWindow.hasCustomPosition;
|
|
892
1252
|
}
|
|
893
1253
|
}
|
|
1254
|
+
if (typeof persisted.selectedContext === "string") {
|
|
1255
|
+
this.selectedContext = persisted.selectedContext;
|
|
1256
|
+
this.pendingSelectedContext = persisted.selectedContext;
|
|
1257
|
+
}
|
|
894
1258
|
}
|
|
895
1259
|
get activeContext() {
|
|
896
1260
|
return this.isOpen ? "window" : "button";
|
|
@@ -965,26 +1329,111 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
965
1329
|
height: Math.round(this.contextState.window.size.height)
|
|
966
1330
|
},
|
|
967
1331
|
hasCustomPosition: this.hasCustomPosition.window
|
|
968
|
-
}
|
|
1332
|
+
},
|
|
1333
|
+
isOpen: this.isOpen,
|
|
1334
|
+
dockMode: this.dockMode,
|
|
1335
|
+
selectedMenu: this.selectedMenu,
|
|
1336
|
+
selectedContext: this.selectedContext
|
|
969
1337
|
};
|
|
970
1338
|
saveInspectorState(COOKIE_NAME, state, COOKIE_MAX_AGE_SECONDS);
|
|
1339
|
+
this.pendingSelectedContext = state.selectedContext ?? null;
|
|
971
1340
|
}
|
|
972
1341
|
clampWindowSize(size) {
|
|
1342
|
+
const minWidth = this.dockMode === "docked-left" ? MIN_WINDOW_WIDTH_DOCKED_LEFT : MIN_WINDOW_WIDTH;
|
|
973
1343
|
if (typeof window === "undefined") {
|
|
974
1344
|
return {
|
|
975
|
-
width: Math.max(
|
|
1345
|
+
width: Math.max(minWidth, size.width),
|
|
976
1346
|
height: Math.max(MIN_WINDOW_HEIGHT, size.height)
|
|
977
1347
|
};
|
|
978
1348
|
}
|
|
979
1349
|
const viewport = this.getViewportSize();
|
|
980
|
-
return clampSize(size, viewport, EDGE_MARGIN,
|
|
1350
|
+
return clampSize(size, viewport, EDGE_MARGIN, minWidth, MIN_WINDOW_HEIGHT);
|
|
1351
|
+
}
|
|
1352
|
+
setDockMode(mode) {
|
|
1353
|
+
if (this.dockMode === mode) {
|
|
1354
|
+
return;
|
|
1355
|
+
}
|
|
1356
|
+
this.startHostTransition();
|
|
1357
|
+
this.removeDockStyles();
|
|
1358
|
+
const previousMode = this.dockMode;
|
|
1359
|
+
this.dockMode = mode;
|
|
1360
|
+
if (mode !== "floating") {
|
|
1361
|
+
if (mode === "docked-left") {
|
|
1362
|
+
this.contextState.window.size.width = DOCKED_LEFT_WIDTH;
|
|
1363
|
+
}
|
|
1364
|
+
this.applyDockStyles();
|
|
1365
|
+
} else {
|
|
1366
|
+
this.contextState.window.size = { ...DEFAULT_WINDOW_SIZE };
|
|
1367
|
+
this.centerContext("window");
|
|
1368
|
+
}
|
|
1369
|
+
this.persistState();
|
|
1370
|
+
this.requestUpdate();
|
|
1371
|
+
this.updateHostTransform("window");
|
|
1372
|
+
}
|
|
1373
|
+
startHostTransition(duration = 300) {
|
|
1374
|
+
this.setAttribute("data-transitioning", "true");
|
|
1375
|
+
if (this.transitionTimeoutId !== null) {
|
|
1376
|
+
clearTimeout(this.transitionTimeoutId);
|
|
1377
|
+
}
|
|
1378
|
+
this.transitionTimeoutId = setTimeout(() => {
|
|
1379
|
+
this.removeAttribute("data-transitioning");
|
|
1380
|
+
this.transitionTimeoutId = null;
|
|
1381
|
+
}, duration);
|
|
1382
|
+
}
|
|
1383
|
+
applyDockStyles(skipTransition = false) {
|
|
1384
|
+
if (typeof document === "undefined" || !document.body) {
|
|
1385
|
+
return;
|
|
1386
|
+
}
|
|
1387
|
+
const computedStyle = window.getComputedStyle(document.body);
|
|
1388
|
+
this.previousBodyMargins = {
|
|
1389
|
+
left: computedStyle.marginLeft,
|
|
1390
|
+
bottom: computedStyle.marginBottom
|
|
1391
|
+
};
|
|
1392
|
+
if (!this.isResizing && !skipTransition) {
|
|
1393
|
+
document.body.style.transition = "margin 300ms ease";
|
|
1394
|
+
}
|
|
1395
|
+
if (this.dockMode === "docked-left") {
|
|
1396
|
+
document.body.style.marginLeft = `${this.contextState.window.size.width}px`;
|
|
1397
|
+
}
|
|
1398
|
+
if (!this.isResizing && !skipTransition) {
|
|
1399
|
+
setTimeout(() => {
|
|
1400
|
+
if (document.body) {
|
|
1401
|
+
document.body.style.transition = "";
|
|
1402
|
+
}
|
|
1403
|
+
}, 300);
|
|
1404
|
+
}
|
|
1405
|
+
}
|
|
1406
|
+
removeDockStyles() {
|
|
1407
|
+
if (typeof document === "undefined" || !document.body) {
|
|
1408
|
+
return;
|
|
1409
|
+
}
|
|
1410
|
+
if (!this.isResizing) {
|
|
1411
|
+
document.body.style.transition = "margin 300ms ease";
|
|
1412
|
+
}
|
|
1413
|
+
if (this.previousBodyMargins) {
|
|
1414
|
+
document.body.style.marginLeft = this.previousBodyMargins.left;
|
|
1415
|
+
document.body.style.marginBottom = this.previousBodyMargins.bottom;
|
|
1416
|
+
this.previousBodyMargins = null;
|
|
1417
|
+
} else {
|
|
1418
|
+
document.body.style.marginLeft = "";
|
|
1419
|
+
document.body.style.marginBottom = "";
|
|
1420
|
+
}
|
|
1421
|
+
setTimeout(() => {
|
|
1422
|
+
if (document.body) {
|
|
1423
|
+
document.body.style.transition = "";
|
|
1424
|
+
}
|
|
1425
|
+
}, 300);
|
|
981
1426
|
}
|
|
982
1427
|
updateHostTransform(context = this.activeContext) {
|
|
983
1428
|
if (context !== this.activeContext) {
|
|
984
1429
|
return;
|
|
985
1430
|
}
|
|
986
|
-
|
|
987
|
-
|
|
1431
|
+
if (this.isOpen && this.dockMode === "docked-left") {
|
|
1432
|
+
this.style.transform = `translate3d(0, 0, 0)`;
|
|
1433
|
+
} else {
|
|
1434
|
+
const { position } = this.contextState[context];
|
|
1435
|
+
this.style.transform = `translate3d(${position.x}px, ${position.y}px, 0)`;
|
|
1436
|
+
}
|
|
988
1437
|
}
|
|
989
1438
|
setDragging(value) {
|
|
990
1439
|
if (this.isDragging !== value) {
|
|
@@ -999,6 +1448,21 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
999
1448
|
const viewport = this.getViewportSize();
|
|
1000
1449
|
updateAnchorFromPosition(this.contextState[context], viewport, EDGE_MARGIN);
|
|
1001
1450
|
}
|
|
1451
|
+
snapButtonToCorner() {
|
|
1452
|
+
if (typeof window === "undefined") {
|
|
1453
|
+
return;
|
|
1454
|
+
}
|
|
1455
|
+
const viewport = this.getViewportSize();
|
|
1456
|
+
const state = this.contextState.button;
|
|
1457
|
+
const centerX = state.position.x + state.size.width / 2;
|
|
1458
|
+
const centerY = state.position.y + state.size.height / 2;
|
|
1459
|
+
const horizontal = centerX < viewport.width / 2 ? "left" : "right";
|
|
1460
|
+
const vertical = centerY < viewport.height / 2 ? "top" : "bottom";
|
|
1461
|
+
state.anchor = { horizontal, vertical };
|
|
1462
|
+
state.anchorOffset = { x: EDGE_MARGIN, y: EDGE_MARGIN };
|
|
1463
|
+
this.startHostTransition();
|
|
1464
|
+
this.applyAnchorPosition("button");
|
|
1465
|
+
}
|
|
1002
1466
|
applyAnchorPosition(context) {
|
|
1003
1467
|
if (typeof window === "undefined") {
|
|
1004
1468
|
return;
|
|
@@ -1026,14 +1490,22 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
1026
1490
|
return;
|
|
1027
1491
|
}
|
|
1028
1492
|
this.isOpen = true;
|
|
1493
|
+
this.persistState();
|
|
1494
|
+
if (this.dockMode !== "floating") {
|
|
1495
|
+
this.applyDockStyles();
|
|
1496
|
+
}
|
|
1029
1497
|
this.ensureWindowPlacement();
|
|
1030
1498
|
this.requestUpdate();
|
|
1031
1499
|
void this.updateComplete.then(() => {
|
|
1032
1500
|
this.measureContext("window");
|
|
1033
|
-
if (this.
|
|
1034
|
-
this.
|
|
1501
|
+
if (this.dockMode === "floating") {
|
|
1502
|
+
if (this.hasCustomPosition.window) {
|
|
1503
|
+
this.applyAnchorPosition("window");
|
|
1504
|
+
} else {
|
|
1505
|
+
this.centerContext("window");
|
|
1506
|
+
}
|
|
1035
1507
|
} else {
|
|
1036
|
-
this.
|
|
1508
|
+
this.updateHostTransform("window");
|
|
1037
1509
|
}
|
|
1038
1510
|
});
|
|
1039
1511
|
}
|
|
@@ -1042,6 +1514,10 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
1042
1514
|
return;
|
|
1043
1515
|
}
|
|
1044
1516
|
this.isOpen = false;
|
|
1517
|
+
if (this.dockMode !== "floating") {
|
|
1518
|
+
this.removeDockStyles();
|
|
1519
|
+
}
|
|
1520
|
+
this.persistState();
|
|
1045
1521
|
this.updateHostTransform("button");
|
|
1046
1522
|
this.requestUpdate();
|
|
1047
1523
|
void this.updateComplete.then(() => {
|
|
@@ -1067,6 +1543,56 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
1067
1543
|
const svgMarkup = `<svg ${this.serializeAttributes(svgAttrs)}>${iconNode.map(([tag, attrs]) => `<${tag} ${this.serializeAttributes(attrs)} />`).join("")}</svg>`;
|
|
1068
1544
|
return (0, import_unsafe_html.unsafeHTML)(svgMarkup);
|
|
1069
1545
|
}
|
|
1546
|
+
renderDockControls() {
|
|
1547
|
+
if (this.dockMode === "floating") {
|
|
1548
|
+
return import_lit.html`
|
|
1549
|
+
<button
|
|
1550
|
+
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"
|
|
1551
|
+
type="button"
|
|
1552
|
+
aria-label="Dock to left"
|
|
1553
|
+
title="Dock Left"
|
|
1554
|
+
@click=${() => this.handleDockClick("docked-left")}
|
|
1555
|
+
>
|
|
1556
|
+
${this.renderIcon("PanelLeft")}
|
|
1557
|
+
</button>
|
|
1558
|
+
`;
|
|
1559
|
+
} else {
|
|
1560
|
+
return import_lit.html`
|
|
1561
|
+
<button
|
|
1562
|
+
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"
|
|
1563
|
+
type="button"
|
|
1564
|
+
aria-label="Float window"
|
|
1565
|
+
title="Float"
|
|
1566
|
+
@click=${() => this.handleDockClick("floating")}
|
|
1567
|
+
>
|
|
1568
|
+
${this.renderIcon("Maximize2")}
|
|
1569
|
+
</button>
|
|
1570
|
+
`;
|
|
1571
|
+
}
|
|
1572
|
+
}
|
|
1573
|
+
getDockedWindowStyles() {
|
|
1574
|
+
if (this.dockMode === "docked-left") {
|
|
1575
|
+
return {
|
|
1576
|
+
position: "fixed",
|
|
1577
|
+
top: "0",
|
|
1578
|
+
left: "0",
|
|
1579
|
+
bottom: "0",
|
|
1580
|
+
width: `${Math.round(this.contextState.window.size.width)}px`,
|
|
1581
|
+
height: "100vh",
|
|
1582
|
+
minWidth: `${MIN_WINDOW_WIDTH_DOCKED_LEFT}px`,
|
|
1583
|
+
borderRadius: "0"
|
|
1584
|
+
};
|
|
1585
|
+
}
|
|
1586
|
+
return {
|
|
1587
|
+
width: `${Math.round(this.contextState.window.size.width)}px`,
|
|
1588
|
+
height: `${Math.round(this.contextState.window.size.height)}px`,
|
|
1589
|
+
minWidth: `${MIN_WINDOW_WIDTH}px`,
|
|
1590
|
+
minHeight: `${MIN_WINDOW_HEIGHT}px`
|
|
1591
|
+
};
|
|
1592
|
+
}
|
|
1593
|
+
handleDockClick(mode) {
|
|
1594
|
+
this.setDockMode(mode);
|
|
1595
|
+
}
|
|
1070
1596
|
serializeAttributes(attributes) {
|
|
1071
1597
|
return Object.entries(attributes).filter(([key, value]) => key !== "key" && value !== void 0 && value !== null && value !== "").map(([key, value]) => `${key}="${String(value).replace(/"/g, """)}"`).join(" ");
|
|
1072
1598
|
}
|
|
@@ -1078,6 +1604,15 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
1078
1604
|
if (this.selectedMenu === "ag-ui-events") {
|
|
1079
1605
|
return this.renderEventsTable();
|
|
1080
1606
|
}
|
|
1607
|
+
if (this.selectedMenu === "agents") {
|
|
1608
|
+
return this.renderAgentsView();
|
|
1609
|
+
}
|
|
1610
|
+
if (this.selectedMenu === "frontend-tools") {
|
|
1611
|
+
return this.renderToolsView();
|
|
1612
|
+
}
|
|
1613
|
+
if (this.selectedMenu === "agent-context") {
|
|
1614
|
+
return this.renderContextView();
|
|
1615
|
+
}
|
|
1081
1616
|
return import_lit.html`
|
|
1082
1617
|
<div class="flex flex-col gap-3 p-4">
|
|
1083
1618
|
<div class="h-24 rounded-lg bg-gray-50"></div>
|
|
@@ -1089,53 +1624,75 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
1089
1624
|
const events = this.getEventsForSelectedContext();
|
|
1090
1625
|
if (events.length === 0) {
|
|
1091
1626
|
return import_lit.html`
|
|
1092
|
-
<div class="flex h-full items-center justify-center px-4 py-8 text-
|
|
1093
|
-
|
|
1627
|
+
<div class="flex h-full items-center justify-center px-4 py-8 text-center">
|
|
1628
|
+
<div class="max-w-md">
|
|
1629
|
+
<div class="mb-3 flex justify-center text-gray-300 [&>svg]:!h-8 [&>svg]:!w-8">
|
|
1630
|
+
${this.renderIcon("Zap")}
|
|
1631
|
+
</div>
|
|
1632
|
+
<p class="text-sm text-gray-600">No events yet</p>
|
|
1633
|
+
<p class="mt-2 text-xs text-gray-500">Trigger an agent run to see live activity.</p>
|
|
1634
|
+
</div>
|
|
1094
1635
|
</div>
|
|
1095
1636
|
`;
|
|
1096
1637
|
}
|
|
1097
1638
|
return import_lit.html`
|
|
1098
|
-
<div class="overflow-
|
|
1099
|
-
<table class="w-full border-
|
|
1100
|
-
<thead>
|
|
1639
|
+
<div class="relative h-full overflow-auto">
|
|
1640
|
+
<table class="w-full border-separate border-spacing-0 text-xs">
|
|
1641
|
+
<thead class="sticky top-0 z-10">
|
|
1101
1642
|
<tr class="bg-white">
|
|
1102
|
-
<th class="border-
|
|
1103
|
-
|
|
1643
|
+
<th class="border-b border-gray-200 bg-white px-3 py-2 text-left font-medium text-gray-900">
|
|
1644
|
+
Agent
|
|
1104
1645
|
</th>
|
|
1105
|
-
<th class="border-
|
|
1646
|
+
<th class="border-b border-gray-200 bg-white px-3 py-2 text-left font-medium text-gray-900">
|
|
1106
1647
|
Time
|
|
1107
1648
|
</th>
|
|
1108
1649
|
<th class="border-b border-gray-200 bg-white px-3 py-2 text-left font-medium text-gray-900">
|
|
1109
|
-
|
|
1650
|
+
Event Type
|
|
1651
|
+
</th>
|
|
1652
|
+
<th class="border-b border-gray-200 bg-white px-3 py-2 text-left font-medium text-gray-900">
|
|
1653
|
+
AG-UI Event
|
|
1110
1654
|
</th>
|
|
1111
1655
|
</tr>
|
|
1112
1656
|
</thead>
|
|
1113
1657
|
<tbody>
|
|
1114
1658
|
${events.map((event, index) => {
|
|
1115
|
-
const isLastRow = index === events.length - 1;
|
|
1116
1659
|
const rowBg = index % 2 === 0 ? "bg-white" : "bg-gray-50/50";
|
|
1117
1660
|
const badgeClasses = this.getEventBadgeClasses(event.type);
|
|
1118
|
-
const
|
|
1119
|
-
const
|
|
1661
|
+
const extractedEvent = this.extractEventFromPayload(event.payload);
|
|
1662
|
+
const inlineEvent = this.stringifyPayload(extractedEvent, false) || "\u2014";
|
|
1663
|
+
const prettyEvent = this.stringifyPayload(extractedEvent, true) || inlineEvent;
|
|
1120
1664
|
const isExpanded = this.expandedRows.has(event.id);
|
|
1121
1665
|
return import_lit.html`
|
|
1122
1666
|
<tr
|
|
1123
|
-
class="${rowBg} transition hover:bg-blue-50/50"
|
|
1667
|
+
class="${rowBg} cursor-pointer transition hover:bg-blue-50/50"
|
|
1124
1668
|
@click=${() => this.toggleRowExpansion(event.id)}
|
|
1125
1669
|
>
|
|
1126
|
-
<td class="border-r
|
|
1127
|
-
<
|
|
1128
|
-
<span class=${badgeClasses}>${event.type}</span>
|
|
1129
|
-
<span class="font-mono text-[10px] text-gray-400">${event.agentId}</span>
|
|
1130
|
-
</div>
|
|
1670
|
+
<td class="border-l border-r border-b border-gray-200 px-3 py-2">
|
|
1671
|
+
<span class="font-mono text-[11px] text-gray-600">${event.agentId}</span>
|
|
1131
1672
|
</td>
|
|
1132
|
-
<td class="border-r
|
|
1673
|
+
<td class="border-r border-b border-gray-200 px-3 py-2 font-mono text-[11px] text-gray-600">
|
|
1133
1674
|
<span title=${new Date(event.timestamp).toLocaleString()}>
|
|
1134
1675
|
${new Date(event.timestamp).toLocaleTimeString()}
|
|
1135
1676
|
</span>
|
|
1136
1677
|
</td>
|
|
1137
|
-
<td class="
|
|
1138
|
-
|
|
1678
|
+
<td class="border-r border-b border-gray-200 px-3 py-2">
|
|
1679
|
+
<span class=${badgeClasses}>${event.type}</span>
|
|
1680
|
+
</td>
|
|
1681
|
+
<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"}">
|
|
1682
|
+
${isExpanded ? import_lit.html`
|
|
1683
|
+
<div class="group relative">
|
|
1684
|
+
<pre class="m-0 whitespace-pre-wrap text-[10px] font-mono text-gray-600">${prettyEvent}</pre>
|
|
1685
|
+
<button
|
|
1686
|
+
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"}"
|
|
1687
|
+
@click=${(e) => {
|
|
1688
|
+
e.stopPropagation();
|
|
1689
|
+
this.copyToClipboard(prettyEvent, event.id);
|
|
1690
|
+
}}
|
|
1691
|
+
>
|
|
1692
|
+
${this.copiedEvents.has(event.id) ? import_lit.html`<span>✓ Copied</span>` : import_lit.html`<span>Copy</span>`}
|
|
1693
|
+
</button>
|
|
1694
|
+
</div>
|
|
1695
|
+
` : inlineEvent}
|
|
1139
1696
|
</td>
|
|
1140
1697
|
</tr>
|
|
1141
1698
|
`;
|
|
@@ -1145,27 +1702,174 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
1145
1702
|
</div>
|
|
1146
1703
|
`;
|
|
1147
1704
|
}
|
|
1705
|
+
renderAgentsView() {
|
|
1706
|
+
if (this.selectedContext === "all-agents") {
|
|
1707
|
+
return import_lit.html`
|
|
1708
|
+
<div class="flex h-full items-center justify-center px-4 py-8 text-center">
|
|
1709
|
+
<div class="max-w-md">
|
|
1710
|
+
<div class="mb-3 flex justify-center text-gray-300 [&>svg]:!h-8 [&>svg]:!w-8">
|
|
1711
|
+
${this.renderIcon("Bot")}
|
|
1712
|
+
</div>
|
|
1713
|
+
<p class="text-sm text-gray-600">No agent selected</p>
|
|
1714
|
+
<p class="mt-2 text-xs text-gray-500">Select an agent from the dropdown above to view details.</p>
|
|
1715
|
+
</div>
|
|
1716
|
+
</div>
|
|
1717
|
+
`;
|
|
1718
|
+
}
|
|
1719
|
+
const agentId = this.selectedContext;
|
|
1720
|
+
const status = this.getAgentStatus(agentId);
|
|
1721
|
+
const stats = this.getAgentStats(agentId);
|
|
1722
|
+
const state = this.getLatestStateForAgent(agentId);
|
|
1723
|
+
const messages = this.getLatestMessagesForAgent(agentId);
|
|
1724
|
+
const statusColors = {
|
|
1725
|
+
running: "bg-emerald-50 text-emerald-700",
|
|
1726
|
+
idle: "bg-gray-100 text-gray-600",
|
|
1727
|
+
error: "bg-rose-50 text-rose-700"
|
|
1728
|
+
};
|
|
1729
|
+
return import_lit.html`
|
|
1730
|
+
<div class="flex flex-col gap-4 p-4 overflow-auto">
|
|
1731
|
+
<!-- Agent Overview Card -->
|
|
1732
|
+
<div class="rounded-lg border border-gray-200 bg-white p-4">
|
|
1733
|
+
<div class="flex items-start justify-between mb-4">
|
|
1734
|
+
<div class="flex items-center gap-3">
|
|
1735
|
+
<div class="flex h-10 w-10 items-center justify-center rounded-lg bg-blue-100 text-blue-600">
|
|
1736
|
+
${this.renderIcon("Bot")}
|
|
1737
|
+
</div>
|
|
1738
|
+
<div>
|
|
1739
|
+
<h3 class="font-semibold text-sm text-gray-900">${agentId}</h3>
|
|
1740
|
+
<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]">
|
|
1741
|
+
<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>
|
|
1742
|
+
${status.charAt(0).toUpperCase() + status.slice(1)}
|
|
1743
|
+
</span>
|
|
1744
|
+
</div>
|
|
1745
|
+
</div>
|
|
1746
|
+
${stats.lastActivity ? import_lit.html`<span class="text-xs text-gray-500">Last activity: ${new Date(stats.lastActivity).toLocaleTimeString()}</span>` : import_lit.nothing}
|
|
1747
|
+
</div>
|
|
1748
|
+
<div class="grid grid-cols-2 gap-4 md:grid-cols-4">
|
|
1749
|
+
<button
|
|
1750
|
+
type="button"
|
|
1751
|
+
class="rounded-md bg-gray-50 px-3 py-2 text-left transition hover:bg-gray-100 cursor-pointer overflow-hidden"
|
|
1752
|
+
@click=${() => this.handleMenuSelect("ag-ui-events")}
|
|
1753
|
+
title="View all events in AG-UI Events"
|
|
1754
|
+
>
|
|
1755
|
+
<div class="truncate whitespace-nowrap text-xs text-gray-600">Total Events</div>
|
|
1756
|
+
<div class="text-lg font-semibold text-gray-900">${stats.totalEvents}</div>
|
|
1757
|
+
</button>
|
|
1758
|
+
<div class="rounded-md bg-gray-50 px-3 py-2 overflow-hidden">
|
|
1759
|
+
<div class="truncate whitespace-nowrap text-xs text-gray-600">Messages</div>
|
|
1760
|
+
<div class="text-lg font-semibold text-gray-900">${stats.messages}</div>
|
|
1761
|
+
</div>
|
|
1762
|
+
<div class="rounded-md bg-gray-50 px-3 py-2 overflow-hidden">
|
|
1763
|
+
<div class="truncate whitespace-nowrap text-xs text-gray-600">Tool Calls</div>
|
|
1764
|
+
<div class="text-lg font-semibold text-gray-900">${stats.toolCalls}</div>
|
|
1765
|
+
</div>
|
|
1766
|
+
<div class="rounded-md bg-gray-50 px-3 py-2 overflow-hidden">
|
|
1767
|
+
<div class="truncate whitespace-nowrap text-xs text-gray-600">Errors</div>
|
|
1768
|
+
<div class="text-lg font-semibold text-gray-900">${stats.errors}</div>
|
|
1769
|
+
</div>
|
|
1770
|
+
</div>
|
|
1771
|
+
</div>
|
|
1772
|
+
|
|
1773
|
+
<!-- Current State Section -->
|
|
1774
|
+
<div class="rounded-lg border border-gray-200 bg-white">
|
|
1775
|
+
<div class="border-b border-gray-200 px-4 py-3">
|
|
1776
|
+
<h4 class="text-sm font-semibold text-gray-900">Current State</h4>
|
|
1777
|
+
</div>
|
|
1778
|
+
<div class="overflow-auto p-4">
|
|
1779
|
+
${this.hasRenderableState(state) ? import_lit.html`
|
|
1780
|
+
<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>
|
|
1781
|
+
` : import_lit.html`
|
|
1782
|
+
<div class="flex h-40 items-center justify-center text-xs text-gray-500">
|
|
1783
|
+
<div class="flex items-center gap-2 text-gray-500">
|
|
1784
|
+
<span class="text-lg text-gray-400">${this.renderIcon("Database")}</span>
|
|
1785
|
+
<span>State is empty</span>
|
|
1786
|
+
</div>
|
|
1787
|
+
</div>
|
|
1788
|
+
`}
|
|
1789
|
+
</div>
|
|
1790
|
+
</div>
|
|
1791
|
+
|
|
1792
|
+
<!-- Current Messages Section -->
|
|
1793
|
+
<div class="rounded-lg border border-gray-200 bg-white">
|
|
1794
|
+
<div class="border-b border-gray-200 px-4 py-3">
|
|
1795
|
+
<h4 class="text-sm font-semibold text-gray-900">Current Messages</h4>
|
|
1796
|
+
</div>
|
|
1797
|
+
<div class="overflow-auto">
|
|
1798
|
+
${messages && Array.isArray(messages) && messages.length > 0 ? import_lit.html`
|
|
1799
|
+
<table class="w-full text-xs">
|
|
1800
|
+
<thead class="bg-gray-50">
|
|
1801
|
+
<tr>
|
|
1802
|
+
<th class="px-4 py-2 text-left font-medium text-gray-700">Role</th>
|
|
1803
|
+
<th class="px-4 py-2 text-left font-medium text-gray-700">Content</th>
|
|
1804
|
+
</tr>
|
|
1805
|
+
</thead>
|
|
1806
|
+
<tbody class="divide-y divide-gray-200">
|
|
1807
|
+
${messages.map((msg, idx) => {
|
|
1808
|
+
const role = msg?.role ?? "unknown";
|
|
1809
|
+
const roleColors = {
|
|
1810
|
+
user: "bg-blue-100 text-blue-800",
|
|
1811
|
+
assistant: "bg-green-100 text-green-800",
|
|
1812
|
+
system: "bg-gray-100 text-gray-800",
|
|
1813
|
+
unknown: "bg-gray-100 text-gray-600"
|
|
1814
|
+
};
|
|
1815
|
+
const rawContent = typeof msg?.content === "string" ? msg.content : msg?.content != null ? JSON.stringify(msg.content) : "";
|
|
1816
|
+
const toolCalls = Array.isArray(msg?.toolCalls) ? msg.toolCalls : [];
|
|
1817
|
+
const hasContent = rawContent.trim().length > 0;
|
|
1818
|
+
const contentFallback = toolCalls.length > 0 ? "Invoked tool call" : "\u2014";
|
|
1819
|
+
return import_lit.html`
|
|
1820
|
+
<tr>
|
|
1821
|
+
<td class="px-4 py-2 align-top">
|
|
1822
|
+
<span class="inline-flex rounded px-2 py-0.5 text-[10px] font-medium ${roleColors[role] || roleColors.unknown}">
|
|
1823
|
+
${role}
|
|
1824
|
+
</span>
|
|
1825
|
+
</td>
|
|
1826
|
+
<td class="px-4 py-2">
|
|
1827
|
+
${hasContent ? import_lit.html`<div class="max-w-2xl whitespace-pre-wrap break-words text-gray-700">${rawContent}</div>` : import_lit.html`<div class="text-xs italic text-gray-400">${contentFallback}</div>`}
|
|
1828
|
+
${role === "assistant" && toolCalls.length > 0 ? this.renderToolCallDetails(toolCalls) : import_lit.nothing}
|
|
1829
|
+
</td>
|
|
1830
|
+
</tr>
|
|
1831
|
+
`;
|
|
1832
|
+
})}
|
|
1833
|
+
</tbody>
|
|
1834
|
+
</table>
|
|
1835
|
+
` : import_lit.html`
|
|
1836
|
+
<div class="flex h-40 items-center justify-center text-xs text-gray-500">
|
|
1837
|
+
<div class="flex items-center gap-2 text-gray-500">
|
|
1838
|
+
<span class="text-lg text-gray-400">${this.renderIcon("MessageSquare")}</span>
|
|
1839
|
+
<span>No messages available</span>
|
|
1840
|
+
</div>
|
|
1841
|
+
</div>
|
|
1842
|
+
`}
|
|
1843
|
+
</div>
|
|
1844
|
+
</div>
|
|
1845
|
+
</div>
|
|
1846
|
+
`;
|
|
1847
|
+
}
|
|
1148
1848
|
renderContextDropdown() {
|
|
1149
|
-
if (this.selectedMenu
|
|
1849
|
+
if (this.selectedMenu === "agent-context") {
|
|
1150
1850
|
return import_lit.nothing;
|
|
1151
1851
|
}
|
|
1152
|
-
|
|
1852
|
+
if (this.selectedMenu !== "ag-ui-events" && this.selectedMenu !== "agents" && this.selectedMenu !== "frontend-tools") {
|
|
1853
|
+
return import_lit.nothing;
|
|
1854
|
+
}
|
|
1855
|
+
const filteredOptions = this.selectedMenu === "agents" ? this.contextOptions.filter((opt) => opt.key !== "all-agents") : this.contextOptions;
|
|
1856
|
+
const selectedLabel = filteredOptions.find((opt) => opt.key === this.selectedContext)?.label ?? "";
|
|
1153
1857
|
return import_lit.html`
|
|
1154
|
-
<div class="relative" data-context-dropdown-root="true">
|
|
1858
|
+
<div class="relative min-w-0 flex-1" data-context-dropdown-root="true">
|
|
1155
1859
|
<button
|
|
1156
1860
|
type="button"
|
|
1157
|
-
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"
|
|
1861
|
+
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"
|
|
1158
1862
|
@pointerdown=${this.handleContextDropdownToggle}
|
|
1159
1863
|
>
|
|
1160
|
-
<span>${selectedLabel}</span>
|
|
1161
|
-
<span class="text-gray-400">${this.renderIcon("ChevronDown")}</span>
|
|
1864
|
+
<span class="truncate flex-1 text-left">${selectedLabel}</span>
|
|
1865
|
+
<span class="shrink-0 text-gray-400">${this.renderIcon("ChevronDown")}</span>
|
|
1162
1866
|
</button>
|
|
1163
1867
|
${this.contextMenuOpen ? import_lit.html`
|
|
1164
1868
|
<div
|
|
1165
1869
|
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"
|
|
1166
1870
|
data-context-dropdown-root="true"
|
|
1167
1871
|
>
|
|
1168
|
-
${
|
|
1872
|
+
${filteredOptions.map(
|
|
1169
1873
|
(option) => import_lit.html`
|
|
1170
1874
|
<button
|
|
1171
1875
|
type="button"
|
|
@@ -1173,7 +1877,7 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
1173
1877
|
data-context-dropdown-root="true"
|
|
1174
1878
|
@click=${() => this.handleContextOptionSelect(option.key)}
|
|
1175
1879
|
>
|
|
1176
|
-
<span class="${option.key === this.selectedContext ? "text-gray-900 font-medium" : "text-gray-600"}">${option.label}</span>
|
|
1880
|
+
<span class="truncate ${option.key === this.selectedContext ? "text-gray-900 font-medium" : "text-gray-600"}">${option.label}</span>
|
|
1177
1881
|
${option.key === this.selectedContext ? import_lit.html`<span class="text-gray-500">${this.renderIcon("Check")}</span>` : import_lit.nothing}
|
|
1178
1882
|
</button>
|
|
1179
1883
|
`
|
|
@@ -1188,7 +1892,15 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
1188
1892
|
return;
|
|
1189
1893
|
}
|
|
1190
1894
|
this.selectedMenu = key;
|
|
1895
|
+
if (key === "agents" && this.selectedContext === "all-agents") {
|
|
1896
|
+
const agentOptions = this.contextOptions.filter((opt) => opt.key !== "all-agents");
|
|
1897
|
+
if (agentOptions.length > 0) {
|
|
1898
|
+
const defaultAgent = agentOptions.find((opt) => opt.key === "default");
|
|
1899
|
+
this.selectedContext = defaultAgent ? defaultAgent.key : agentOptions[0].key;
|
|
1900
|
+
}
|
|
1901
|
+
}
|
|
1191
1902
|
this.contextMenuOpen = false;
|
|
1903
|
+
this.persistState();
|
|
1192
1904
|
this.requestUpdate();
|
|
1193
1905
|
}
|
|
1194
1906
|
handleContextDropdownToggle(event) {
|
|
@@ -1206,9 +1918,397 @@ var WebInspectorElement = class extends import_lit.LitElement {
|
|
|
1206
1918
|
this.expandedRows.clear();
|
|
1207
1919
|
}
|
|
1208
1920
|
this.contextMenuOpen = false;
|
|
1921
|
+
this.persistState();
|
|
1922
|
+
this.requestUpdate();
|
|
1923
|
+
}
|
|
1924
|
+
renderToolsView() {
|
|
1925
|
+
if (!this._core) {
|
|
1926
|
+
return import_lit.html`
|
|
1927
|
+
<div class="flex h-full items-center justify-center px-4 py-8 text-xs text-gray-500">
|
|
1928
|
+
No core instance available
|
|
1929
|
+
</div>
|
|
1930
|
+
`;
|
|
1931
|
+
}
|
|
1932
|
+
const allTools = this.extractToolsFromAgents();
|
|
1933
|
+
if (allTools.length === 0) {
|
|
1934
|
+
return import_lit.html`
|
|
1935
|
+
<div class="flex h-full items-center justify-center px-4 py-8 text-center">
|
|
1936
|
+
<div class="max-w-md">
|
|
1937
|
+
<div class="mb-3 flex justify-center text-gray-300 [&>svg]:!h-8 [&>svg]:!w-8">
|
|
1938
|
+
${this.renderIcon("Hammer")}
|
|
1939
|
+
</div>
|
|
1940
|
+
<p class="text-sm text-gray-600">No tools available</p>
|
|
1941
|
+
<p class="mt-2 text-xs text-gray-500">Tools will appear here once agents are configured with tool handlers or renderers.</p>
|
|
1942
|
+
</div>
|
|
1943
|
+
</div>
|
|
1944
|
+
`;
|
|
1945
|
+
}
|
|
1946
|
+
const filteredTools = this.selectedContext === "all-agents" ? allTools : allTools.filter((tool) => tool.agentId === this.selectedContext);
|
|
1947
|
+
return import_lit.html`
|
|
1948
|
+
<div class="flex h-full flex-col overflow-hidden">
|
|
1949
|
+
<div class="overflow-auto p-4">
|
|
1950
|
+
<div class="space-y-3">
|
|
1951
|
+
${filteredTools.map((tool) => this.renderToolCard(tool))}
|
|
1952
|
+
</div>
|
|
1953
|
+
</div>
|
|
1954
|
+
</div>
|
|
1955
|
+
`;
|
|
1956
|
+
}
|
|
1957
|
+
extractToolsFromAgents() {
|
|
1958
|
+
if (!this._core) {
|
|
1959
|
+
return [];
|
|
1960
|
+
}
|
|
1961
|
+
const tools = [];
|
|
1962
|
+
for (const [agentId, agent] of Object.entries(this._core.agents)) {
|
|
1963
|
+
if (!agent) continue;
|
|
1964
|
+
const handlers = agent.toolHandlers;
|
|
1965
|
+
if (handlers && typeof handlers === "object") {
|
|
1966
|
+
for (const [toolName, handler] of Object.entries(handlers)) {
|
|
1967
|
+
if (handler && typeof handler === "object") {
|
|
1968
|
+
const handlerObj = handler;
|
|
1969
|
+
tools.push({
|
|
1970
|
+
agentId,
|
|
1971
|
+
name: toolName,
|
|
1972
|
+
description: handlerObj.description || handlerObj.tool?.description,
|
|
1973
|
+
parameters: handlerObj.parameters || handlerObj.tool?.parameters,
|
|
1974
|
+
type: "handler"
|
|
1975
|
+
});
|
|
1976
|
+
}
|
|
1977
|
+
}
|
|
1978
|
+
}
|
|
1979
|
+
const renderers = agent.toolRenderers;
|
|
1980
|
+
if (renderers && typeof renderers === "object") {
|
|
1981
|
+
for (const [toolName, renderer] of Object.entries(renderers)) {
|
|
1982
|
+
if (!tools.some((t) => t.agentId === agentId && t.name === toolName)) {
|
|
1983
|
+
if (renderer && typeof renderer === "object") {
|
|
1984
|
+
const rendererObj = renderer;
|
|
1985
|
+
tools.push({
|
|
1986
|
+
agentId,
|
|
1987
|
+
name: toolName,
|
|
1988
|
+
description: rendererObj.description || rendererObj.tool?.description,
|
|
1989
|
+
parameters: rendererObj.parameters || rendererObj.tool?.parameters,
|
|
1990
|
+
type: "renderer"
|
|
1991
|
+
});
|
|
1992
|
+
}
|
|
1993
|
+
}
|
|
1994
|
+
}
|
|
1995
|
+
}
|
|
1996
|
+
}
|
|
1997
|
+
return tools.sort((a, b) => {
|
|
1998
|
+
const agentCompare = a.agentId.localeCompare(b.agentId);
|
|
1999
|
+
if (agentCompare !== 0) return agentCompare;
|
|
2000
|
+
return a.name.localeCompare(b.name);
|
|
2001
|
+
});
|
|
2002
|
+
}
|
|
2003
|
+
renderToolCard(tool) {
|
|
2004
|
+
const isExpanded = this.expandedTools.has(`${tool.agentId}:${tool.name}`);
|
|
2005
|
+
const schema = this.extractSchemaInfo(tool.parameters);
|
|
2006
|
+
const typeColors = {
|
|
2007
|
+
handler: "bg-blue-50 text-blue-700 border-blue-200",
|
|
2008
|
+
renderer: "bg-purple-50 text-purple-700 border-purple-200"
|
|
2009
|
+
};
|
|
2010
|
+
return import_lit.html`
|
|
2011
|
+
<div class="rounded-lg border border-gray-200 bg-white overflow-hidden">
|
|
2012
|
+
<button
|
|
2013
|
+
type="button"
|
|
2014
|
+
class="w-full px-4 py-3 text-left transition hover:bg-gray-50"
|
|
2015
|
+
@click=${() => this.toggleToolExpansion(`${tool.agentId}:${tool.name}`)}
|
|
2016
|
+
>
|
|
2017
|
+
<div class="flex items-start justify-between gap-3">
|
|
2018
|
+
<div class="flex-1 min-w-0">
|
|
2019
|
+
<div class="flex items-center gap-2 mb-1">
|
|
2020
|
+
<span class="font-mono text-sm font-semibold text-gray-900">${tool.name}</span>
|
|
2021
|
+
<span class="inline-flex items-center rounded-sm border px-1.5 py-0.5 text-[10px] font-medium ${typeColors[tool.type]}">
|
|
2022
|
+
${tool.type}
|
|
2023
|
+
</span>
|
|
2024
|
+
</div>
|
|
2025
|
+
<div class="flex items-center gap-2 text-xs text-gray-500">
|
|
2026
|
+
<span class="flex items-center gap-1">
|
|
2027
|
+
${this.renderIcon("Bot")}
|
|
2028
|
+
<span class="font-mono">${tool.agentId}</span>
|
|
2029
|
+
</span>
|
|
2030
|
+
${schema.properties.length > 0 ? import_lit.html`
|
|
2031
|
+
<span class="text-gray-300">•</span>
|
|
2032
|
+
<span>${schema.properties.length} parameter${schema.properties.length !== 1 ? "s" : ""}</span>
|
|
2033
|
+
` : import_lit.nothing}
|
|
2034
|
+
</div>
|
|
2035
|
+
${tool.description ? import_lit.html`<p class="mt-2 text-xs text-gray-600">${tool.description}</p>` : import_lit.nothing}
|
|
2036
|
+
</div>
|
|
2037
|
+
<span class="shrink-0 text-gray-400 transition ${isExpanded ? "rotate-180" : ""}">
|
|
2038
|
+
${this.renderIcon("ChevronDown")}
|
|
2039
|
+
</span>
|
|
2040
|
+
</div>
|
|
2041
|
+
</button>
|
|
2042
|
+
|
|
2043
|
+
${isExpanded ? import_lit.html`
|
|
2044
|
+
<div class="border-t border-gray-200 bg-gray-50/50 px-4 py-3">
|
|
2045
|
+
${schema.properties.length > 0 ? import_lit.html`
|
|
2046
|
+
<h5 class="mb-3 text-xs font-semibold text-gray-700">Parameters</h5>
|
|
2047
|
+
<div class="space-y-3">
|
|
2048
|
+
${schema.properties.map((prop) => import_lit.html`
|
|
2049
|
+
<div class="rounded-md border border-gray-200 bg-white p-3">
|
|
2050
|
+
<div class="flex items-start justify-between gap-2 mb-1">
|
|
2051
|
+
<span class="font-mono text-xs font-medium text-gray-900">${prop.name}</span>
|
|
2052
|
+
<div class="flex items-center gap-1.5 shrink-0">
|
|
2053
|
+
${prop.required ? import_lit.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>` : import_lit.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>`}
|
|
2054
|
+
${prop.type ? import_lit.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>` : import_lit.nothing}
|
|
2055
|
+
</div>
|
|
2056
|
+
</div>
|
|
2057
|
+
${prop.description ? import_lit.html`<p class="mt-1 text-xs text-gray-600">${prop.description}</p>` : import_lit.nothing}
|
|
2058
|
+
${prop.defaultValue !== void 0 ? import_lit.html`
|
|
2059
|
+
<div class="mt-2 flex items-center gap-1.5 text-[10px] text-gray-500">
|
|
2060
|
+
<span>Default:</span>
|
|
2061
|
+
<code class="rounded bg-gray-100 px-1 py-0.5 font-mono">${JSON.stringify(prop.defaultValue)}</code>
|
|
2062
|
+
</div>
|
|
2063
|
+
` : import_lit.nothing}
|
|
2064
|
+
${prop.enum && prop.enum.length > 0 ? import_lit.html`
|
|
2065
|
+
<div class="mt-2">
|
|
2066
|
+
<span class="text-[10px] text-gray-500">Allowed values:</span>
|
|
2067
|
+
<div class="mt-1 flex flex-wrap gap-1">
|
|
2068
|
+
${prop.enum.map((val) => import_lit.html`
|
|
2069
|
+
<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>
|
|
2070
|
+
`)}
|
|
2071
|
+
</div>
|
|
2072
|
+
</div>
|
|
2073
|
+
` : import_lit.nothing}
|
|
2074
|
+
</div>
|
|
2075
|
+
`)}
|
|
2076
|
+
</div>
|
|
2077
|
+
` : import_lit.html`
|
|
2078
|
+
<div class="flex items-center justify-center py-4 text-xs text-gray-500">
|
|
2079
|
+
<span>No parameters defined</span>
|
|
2080
|
+
</div>
|
|
2081
|
+
`}
|
|
2082
|
+
</div>
|
|
2083
|
+
` : import_lit.nothing}
|
|
2084
|
+
</div>
|
|
2085
|
+
`;
|
|
2086
|
+
}
|
|
2087
|
+
extractSchemaInfo(parameters) {
|
|
2088
|
+
const result = { properties: [] };
|
|
2089
|
+
if (!parameters || typeof parameters !== "object") {
|
|
2090
|
+
return result;
|
|
2091
|
+
}
|
|
2092
|
+
const zodDef = parameters._def;
|
|
2093
|
+
if (zodDef) {
|
|
2094
|
+
if (zodDef.typeName === "ZodObject") {
|
|
2095
|
+
const shape = zodDef.shape?.() || zodDef.shape;
|
|
2096
|
+
const requiredKeys = /* @__PURE__ */ new Set();
|
|
2097
|
+
if (zodDef.unknownKeys === "strict" || !zodDef.catchall) {
|
|
2098
|
+
Object.keys(shape || {}).forEach((key) => {
|
|
2099
|
+
const fieldDef = shape[key]?._def;
|
|
2100
|
+
if (fieldDef && !this.isZodOptional(shape[key])) {
|
|
2101
|
+
requiredKeys.add(key);
|
|
2102
|
+
}
|
|
2103
|
+
});
|
|
2104
|
+
}
|
|
2105
|
+
for (const [key, value] of Object.entries(shape || {})) {
|
|
2106
|
+
const fieldInfo = this.extractZodFieldInfo(value);
|
|
2107
|
+
result.properties.push({
|
|
2108
|
+
name: key,
|
|
2109
|
+
type: fieldInfo.type,
|
|
2110
|
+
description: fieldInfo.description,
|
|
2111
|
+
required: requiredKeys.has(key),
|
|
2112
|
+
defaultValue: fieldInfo.defaultValue,
|
|
2113
|
+
enum: fieldInfo.enum
|
|
2114
|
+
});
|
|
2115
|
+
}
|
|
2116
|
+
}
|
|
2117
|
+
} else if (parameters.type === "object" && parameters.properties) {
|
|
2118
|
+
const props = parameters.properties;
|
|
2119
|
+
const required = new Set(parameters.required || []);
|
|
2120
|
+
for (const [key, value] of Object.entries(props)) {
|
|
2121
|
+
const prop = value;
|
|
2122
|
+
result.properties.push({
|
|
2123
|
+
name: key,
|
|
2124
|
+
type: prop.type,
|
|
2125
|
+
description: prop.description,
|
|
2126
|
+
required: required.has(key),
|
|
2127
|
+
defaultValue: prop.default,
|
|
2128
|
+
enum: prop.enum
|
|
2129
|
+
});
|
|
2130
|
+
}
|
|
2131
|
+
}
|
|
2132
|
+
return result;
|
|
2133
|
+
}
|
|
2134
|
+
isZodOptional(zodSchema) {
|
|
2135
|
+
if (!zodSchema?._def) return false;
|
|
2136
|
+
const def = zodSchema._def;
|
|
2137
|
+
if (def.typeName === "ZodOptional" || def.typeName === "ZodNullable") {
|
|
2138
|
+
return true;
|
|
2139
|
+
}
|
|
2140
|
+
if (def.defaultValue !== void 0) {
|
|
2141
|
+
return true;
|
|
2142
|
+
}
|
|
2143
|
+
return false;
|
|
2144
|
+
}
|
|
2145
|
+
extractZodFieldInfo(zodSchema) {
|
|
2146
|
+
const info = {};
|
|
2147
|
+
if (!zodSchema?._def) return info;
|
|
2148
|
+
let currentSchema = zodSchema;
|
|
2149
|
+
let def = currentSchema._def;
|
|
2150
|
+
while (def.typeName === "ZodOptional" || def.typeName === "ZodNullable" || def.typeName === "ZodDefault") {
|
|
2151
|
+
if (def.typeName === "ZodDefault" && def.defaultValue !== void 0) {
|
|
2152
|
+
info.defaultValue = typeof def.defaultValue === "function" ? def.defaultValue() : def.defaultValue;
|
|
2153
|
+
}
|
|
2154
|
+
currentSchema = def.innerType;
|
|
2155
|
+
if (!currentSchema?._def) break;
|
|
2156
|
+
def = currentSchema._def;
|
|
2157
|
+
}
|
|
2158
|
+
info.description = def.description;
|
|
2159
|
+
const typeMap = {
|
|
2160
|
+
ZodString: "string",
|
|
2161
|
+
ZodNumber: "number",
|
|
2162
|
+
ZodBoolean: "boolean",
|
|
2163
|
+
ZodArray: "array",
|
|
2164
|
+
ZodObject: "object",
|
|
2165
|
+
ZodEnum: "enum",
|
|
2166
|
+
ZodLiteral: "literal",
|
|
2167
|
+
ZodUnion: "union",
|
|
2168
|
+
ZodAny: "any",
|
|
2169
|
+
ZodUnknown: "unknown"
|
|
2170
|
+
};
|
|
2171
|
+
info.type = typeMap[def.typeName] || def.typeName?.replace("Zod", "").toLowerCase();
|
|
2172
|
+
if (def.typeName === "ZodEnum" && Array.isArray(def.values)) {
|
|
2173
|
+
info.enum = def.values;
|
|
2174
|
+
} else if (def.typeName === "ZodLiteral" && def.value !== void 0) {
|
|
2175
|
+
info.enum = [def.value];
|
|
2176
|
+
}
|
|
2177
|
+
return info;
|
|
2178
|
+
}
|
|
2179
|
+
toggleToolExpansion(toolId) {
|
|
2180
|
+
if (this.expandedTools.has(toolId)) {
|
|
2181
|
+
this.expandedTools.delete(toolId);
|
|
2182
|
+
} else {
|
|
2183
|
+
this.expandedTools.add(toolId);
|
|
2184
|
+
}
|
|
2185
|
+
this.requestUpdate();
|
|
2186
|
+
}
|
|
2187
|
+
renderContextView() {
|
|
2188
|
+
const contextEntries = Object.entries(this.contextStore);
|
|
2189
|
+
if (contextEntries.length === 0) {
|
|
2190
|
+
return import_lit.html`
|
|
2191
|
+
<div class="flex h-full items-center justify-center px-4 py-8 text-center">
|
|
2192
|
+
<div class="max-w-md">
|
|
2193
|
+
<div class="mb-3 flex justify-center text-gray-300 [&>svg]:!h-8 [&>svg]:!w-8">
|
|
2194
|
+
${this.renderIcon("FileText")}
|
|
2195
|
+
</div>
|
|
2196
|
+
<p class="text-sm text-gray-600">No context available</p>
|
|
2197
|
+
<p class="mt-2 text-xs text-gray-500">Context will appear here once added to CopilotKit.</p>
|
|
2198
|
+
</div>
|
|
2199
|
+
</div>
|
|
2200
|
+
`;
|
|
2201
|
+
}
|
|
2202
|
+
return import_lit.html`
|
|
2203
|
+
<div class="flex h-full flex-col overflow-hidden">
|
|
2204
|
+
<div class="overflow-auto p-4">
|
|
2205
|
+
<div class="space-y-3">
|
|
2206
|
+
${contextEntries.map(([id, context]) => this.renderContextCard(id, context))}
|
|
2207
|
+
</div>
|
|
2208
|
+
</div>
|
|
2209
|
+
</div>
|
|
2210
|
+
`;
|
|
2211
|
+
}
|
|
2212
|
+
renderContextCard(id, context) {
|
|
2213
|
+
const isExpanded = this.expandedContextItems.has(id);
|
|
2214
|
+
const valuePreview = this.getContextValuePreview(context.value);
|
|
2215
|
+
const hasValue = context.value !== void 0 && context.value !== null;
|
|
2216
|
+
return import_lit.html`
|
|
2217
|
+
<div class="rounded-lg border border-gray-200 bg-white overflow-hidden">
|
|
2218
|
+
<button
|
|
2219
|
+
type="button"
|
|
2220
|
+
class="w-full px-4 py-3 text-left transition hover:bg-gray-50"
|
|
2221
|
+
@click=${() => this.toggleContextExpansion(id)}
|
|
2222
|
+
>
|
|
2223
|
+
<div class="flex items-start justify-between gap-3">
|
|
2224
|
+
<div class="flex-1 min-w-0">
|
|
2225
|
+
${context.description ? import_lit.html`<p class="text-sm font-medium text-gray-900 mb-1">${context.description}</p>` : import_lit.html`<p class="text-sm font-medium text-gray-500 italic mb-1">No description</p>`}
|
|
2226
|
+
<div class="flex items-center gap-2 text-xs text-gray-500">
|
|
2227
|
+
<span class="font-mono">${id.substring(0, 8)}...</span>
|
|
2228
|
+
${hasValue ? import_lit.html`
|
|
2229
|
+
<span class="text-gray-300">•</span>
|
|
2230
|
+
<span class="truncate">${valuePreview}</span>
|
|
2231
|
+
` : import_lit.nothing}
|
|
2232
|
+
</div>
|
|
2233
|
+
</div>
|
|
2234
|
+
<span class="shrink-0 text-gray-400 transition ${isExpanded ? "rotate-180" : ""}">
|
|
2235
|
+
${this.renderIcon("ChevronDown")}
|
|
2236
|
+
</span>
|
|
2237
|
+
</div>
|
|
2238
|
+
</button>
|
|
2239
|
+
|
|
2240
|
+
${isExpanded ? import_lit.html`
|
|
2241
|
+
<div class="border-t border-gray-200 bg-gray-50/50 px-4 py-3">
|
|
2242
|
+
<div class="mb-3">
|
|
2243
|
+
<h5 class="mb-1 text-xs font-semibold text-gray-700">ID</h5>
|
|
2244
|
+
<code class="block rounded bg-white border border-gray-200 px-2 py-1 text-[10px] font-mono text-gray-600">${id}</code>
|
|
2245
|
+
</div>
|
|
2246
|
+
${hasValue ? import_lit.html`
|
|
2247
|
+
<h5 class="mb-2 text-xs font-semibold text-gray-700">Value</h5>
|
|
2248
|
+
<div class="rounded-md border border-gray-200 bg-white p-3">
|
|
2249
|
+
<pre class="overflow-auto text-xs text-gray-800 max-h-96"><code>${this.formatContextValue(context.value)}</code></pre>
|
|
2250
|
+
</div>
|
|
2251
|
+
` : import_lit.html`
|
|
2252
|
+
<div class="flex items-center justify-center py-4 text-xs text-gray-500">
|
|
2253
|
+
<span>No value available</span>
|
|
2254
|
+
</div>
|
|
2255
|
+
`}
|
|
2256
|
+
</div>
|
|
2257
|
+
` : import_lit.nothing}
|
|
2258
|
+
</div>
|
|
2259
|
+
`;
|
|
2260
|
+
}
|
|
2261
|
+
getContextValuePreview(value) {
|
|
2262
|
+
if (value === void 0 || value === null) {
|
|
2263
|
+
return "\u2014";
|
|
2264
|
+
}
|
|
2265
|
+
if (typeof value === "string") {
|
|
2266
|
+
return value.length > 50 ? `${value.substring(0, 50)}...` : value;
|
|
2267
|
+
}
|
|
2268
|
+
if (typeof value === "number" || typeof value === "boolean") {
|
|
2269
|
+
return String(value);
|
|
2270
|
+
}
|
|
2271
|
+
if (Array.isArray(value)) {
|
|
2272
|
+
return `Array(${value.length})`;
|
|
2273
|
+
}
|
|
2274
|
+
if (typeof value === "object") {
|
|
2275
|
+
const keys = Object.keys(value);
|
|
2276
|
+
return `Object with ${keys.length} key${keys.length !== 1 ? "s" : ""}`;
|
|
2277
|
+
}
|
|
2278
|
+
if (typeof value === "function") {
|
|
2279
|
+
return "Function";
|
|
2280
|
+
}
|
|
2281
|
+
return String(value);
|
|
2282
|
+
}
|
|
2283
|
+
formatContextValue(value) {
|
|
2284
|
+
if (value === void 0) {
|
|
2285
|
+
return "undefined";
|
|
2286
|
+
}
|
|
2287
|
+
if (value === null) {
|
|
2288
|
+
return "null";
|
|
2289
|
+
}
|
|
2290
|
+
if (typeof value === "function") {
|
|
2291
|
+
return value.toString();
|
|
2292
|
+
}
|
|
2293
|
+
try {
|
|
2294
|
+
return JSON.stringify(value, null, 2);
|
|
2295
|
+
} catch (error) {
|
|
2296
|
+
return String(value);
|
|
2297
|
+
}
|
|
2298
|
+
}
|
|
2299
|
+
toggleContextExpansion(contextId) {
|
|
2300
|
+
if (this.expandedContextItems.has(contextId)) {
|
|
2301
|
+
this.expandedContextItems.delete(contextId);
|
|
2302
|
+
} else {
|
|
2303
|
+
this.expandedContextItems.add(contextId);
|
|
2304
|
+
}
|
|
1209
2305
|
this.requestUpdate();
|
|
1210
2306
|
}
|
|
1211
2307
|
toggleRowExpansion(eventId) {
|
|
2308
|
+
const selection = window.getSelection();
|
|
2309
|
+
if (selection && selection.toString().length > 0) {
|
|
2310
|
+
return;
|
|
2311
|
+
}
|
|
1212
2312
|
if (this.expandedRows.has(eventId)) {
|
|
1213
2313
|
this.expandedRows.delete(eventId);
|
|
1214
2314
|
} else {
|