adam-agent-server 1.2.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -7
- package/dist/App-3OBJDI2C.js +9 -0
- package/dist/adam-tools-4LZYFB6J.js +1 -0
- package/dist/{approval-handler-JYIS2PKQ.js → approval-handler-RIJO3OBO.js} +1 -1
- package/dist/audit-manager-6FFPXID3.js +1 -0
- package/dist/bree-engine-2NOTIBAZ.js +1 -0
- package/dist/{channels-WZOYE4O4.js → channels-LUJ7GTSP.js} +1 -1
- package/dist/channels-TSZLEU3L.js +1 -0
- package/dist/{chunk-PMHNW5IL.js → chunk-4LSIHSCO.js} +1 -1
- package/dist/{chunk-KVSO3KGZ.js → chunk-4MJF77RD.js} +54 -5
- package/dist/{chunk-BIIP363C.js → chunk-4NW2DNDZ.js} +1 -1
- package/dist/{chunk-OEKM2W3K.js → chunk-6NUHSHS5.js} +1 -1
- package/dist/{chunk-IHP7JV6J.js → chunk-72VLUJ2S.js} +1 -1
- package/dist/chunk-7CJGPCSJ.js +49 -0
- package/dist/{chunk-KLQOILIJ.js → chunk-7IXLL673.js} +1 -1
- package/dist/{chunk-SBX3HMDA.js → chunk-7K4AQBDD.js} +1 -1
- package/dist/{chunk-GMCIKDTC.js → chunk-AKPLOO2V.js} +1 -1
- package/dist/{chunk-AJVN3KPM.js → chunk-AZBNUSM2.js} +1 -1
- package/dist/{chunk-SWPXG2CY.js → chunk-CLHSPXZ6.js} +1 -1
- package/dist/{chunk-KKLZIXBN.js → chunk-DBUEHITK.js} +2 -2
- package/dist/chunk-GSMC3VUM.js +1 -0
- package/dist/{chunk-EJVUUIAV.js → chunk-HFN7Y3IM.js} +1 -1
- package/dist/{chunk-6DXNXLYG.js → chunk-IKUBP3SY.js} +1 -1
- package/dist/{chunk-4TCP2AT7.js → chunk-IZGTTLTG.js} +1 -1
- package/dist/chunk-JZNBFZ7W.js +7 -0
- package/dist/{chunk-6YURWVQG.js → chunk-NDP6LWXX.js} +1 -1
- package/dist/{chunk-CDVIT7L5.js → chunk-NLD7WK3R.js} +1 -1
- package/dist/{chunk-OFOVSC72.js → chunk-NUTUI5KM.js} +1 -1
- package/dist/{chunk-B4WHT7DX.js → chunk-OTH4M5L3.js} +1 -1
- package/dist/{chunk-GUQAIWCQ.js → chunk-P6KWAGAY.js} +1 -1
- package/dist/chunk-PVYEGQEG.js +83 -0
- package/dist/{chunk-Z5ET7WW2.js → chunk-T33BLZV2.js} +1 -1
- package/dist/{chunk-2HN2TSP6.js → chunk-TCHBOWQ5.js} +1 -1
- package/dist/{chunk-RPTHFQX7.js → chunk-TKDT7EQO.js} +1 -1
- package/dist/{chunk-ZM6YED5F.js → chunk-UQJZU3R5.js} +1 -1
- package/dist/{chunk-7LBDLAUQ.js → chunk-WKS7QVIX.js} +1 -1
- package/dist/{chunk-EGS6U3V5.js → chunk-WTRM5VO7.js} +2 -2
- package/dist/chunk-XTHP5JMO.js +10 -0
- package/dist/chunk-YHVFZB6Q.js +1 -0
- package/dist/{chunk-QN6BEJF5.js → chunk-YPOTHL7X.js} +1 -1
- package/dist/chunk-ZKMDHQJY.js +104 -0
- package/dist/{chunk-AR2IZMM2.js → chunk-ZQYKT5UY.js} +1 -1
- package/dist/cli.js +2 -2
- package/dist/{config-EI3SCA4W.js → config-HR4MBTIS.js} +1 -1
- package/dist/config-XMQS2NPT.js +1 -0
- package/dist/{db-4NY7ZOS2.js → db-6KUGCGVR.js} +1 -1
- package/dist/{delivery-log-SC2ULFCK.js → delivery-log-7DJJTPXL.js} +1 -1
- package/dist/engine-HJUE6I4I.js +1 -0
- package/dist/{evolution-audit-KUBXFUHI.js → evolution-audit-I2ITWAEC.js} +1 -1
- package/dist/{external-api-A4JXX4ZE.js → external-api-7XV2PXPC.js} +1 -1
- package/dist/index.js +12 -11
- package/dist/{learner-B6XVQKBF.js → learner-CBPQZ3HL.js} +1 -1
- package/dist/{memories-FQCRKMK6.js → memories-HBBW44MG.js} +1 -1
- package/dist/{memory-extractor-FUOJ5D77.js → memory-extractor-XO2HJ22Y.js} +2 -2
- package/dist/memory-service-HIFTKEW2.js +1 -0
- package/dist/outbound-gateway-GGFMU5JW.js +1 -0
- package/dist/role-presets-W452Y3RV.js +1 -0
- package/dist/{roles-3UTFKSHI.js → roles-NYGWZMQI.js} +1 -1
- package/dist/{runtime-B2DP3JNB.js → runtime-VDBZZ4KG.js} +1 -1
- package/dist/{session-manager-Z6MIYRD3.js → session-manager-JICVE4CO.js} +1 -1
- package/dist/{task-templates-PSP7GOJJ.js → task-templates-NC7XIZIC.js} +1 -1
- package/dist/workflow-executor-QN4KP7B4.js +1 -0
- package/package.json +1 -1
- package/web/dist/assets/{ChannelDetail-DoQs1auJ.js → ChannelDetail-DX4QnE8j.js} +1 -1
- package/web/dist/assets/{Channels-Dc6QduC1.js → Channels-EXkNOQpB.js} +1 -1
- package/web/dist/assets/{Chat-NrKA_MiZ.js → Chat-Da-mCR0c.js} +1 -1
- package/web/dist/assets/{Dashboard-C67v0x7e.js → Dashboard-Bq6sEDdP.js} +1 -1
- package/web/dist/assets/EnvVarEditor-CNxXpVbD.js +1 -0
- package/web/dist/assets/{Evolution-CbFOTN2o.js → Evolution-DPdmbooj.js} +1 -1
- package/web/dist/assets/{GoalDetail-DYUbYJpT.js → GoalDetail-BamCfVzS.js} +1 -1
- package/web/dist/assets/{Goals-7eD9_7Qo.js → Goals-CHPEg0RK.js} +1 -1
- package/web/dist/assets/{Logs-CDFbfvQT.js → Logs-BHkBvH0T.js} +1 -1
- package/web/dist/assets/{Memories-D0J8Es-o.js → Memories-BY2pJhVd.js} +1 -1
- package/web/dist/assets/{Plugins-CXCUhsEZ.js → Plugins-C5xLM0BU.js} +1 -1
- package/web/dist/assets/{RoleDetail-C2lXyAjt.js → RoleDetail-Dnp-W14x.js} +2 -2
- package/web/dist/assets/{Roles-Bia_f3ml.js → Roles-BVOVoHvc.js} +1 -1
- package/web/dist/assets/Settings-eBHvn6s_.js +1 -0
- package/web/dist/assets/{Strategies-CRdpzdUe.js → Strategies-BbFbLKBJ.js} +1 -1
- package/web/dist/assets/{Switch-B05Q1L98.js → Switch-Q-inggPs.js} +1 -1
- package/web/dist/assets/{TaskDetail-4yYEVV6Z.js → TaskDetail-BEjZ1gco.js} +1 -1
- package/web/dist/assets/Work-CF2iLs8i.js +1 -0
- package/web/dist/assets/{index-oA-kWqT5.js → index-CaHdOfAc.js} +5 -5
- package/web/dist/assets/index-D0SvKqKc.css +2 -0
- package/web/dist/index.html +2 -2
- package/dist/App-RIYRYLKD.js +0 -9
- package/dist/adam-tools-V22LRDCP.js +0 -1
- package/dist/audit-manager-QDFDBK4E.js +0 -1
- package/dist/bree-engine-EKZFCS4Q.js +0 -1
- package/dist/channels-WMCY4QC3.js +0 -1
- package/dist/chunk-6HD6NYIB.js +0 -1
- package/dist/chunk-ITUBFUJQ.js +0 -67
- package/dist/chunk-IZWULGUS.js +0 -83
- package/dist/chunk-JNRCXAW3.js +0 -49
- package/dist/chunk-W3554FQ7.js +0 -7
- package/dist/config-7HYICF5P.js +0 -1
- package/dist/engine-5RJ7NJSM.js +0 -1
- package/dist/memory-service-ANR67OPY.js +0 -1
- package/dist/outbound-gateway-6FQRWYFF.js +0 -1
- package/dist/role-presets-LRP6P5O2.js +0 -1
- package/web/dist/assets/EnvVarEditor-DeCQryTm.js +0 -1
- package/web/dist/assets/Settings-CzgdtkLo.js +0 -1
- package/web/dist/assets/Work-CE6TB6LG.js +0 -1
- package/web/dist/assets/index-CaocwyO8.css +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */
|
|
2
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--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-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-space-x-reverse:0}}}@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, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-red-800:oklch(44.4% .177 26.899);--color-red-900:oklch(39.6% .141 25.723);--color-red-950:oklch(25.8% .092 26.042);--color-orange-400:oklch(75% .183 55.934);--color-orange-500:oklch(70.5% .213 47.604);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-800:oklch(47.3% .137 46.201);--color-amber-900:oklch(41.4% .112 45.904);--color-amber-950:oklch(27.9% .077 45.635);--color-yellow-300:oklch(90.5% .182 98.111);--color-yellow-400:oklch(85.2% .199 91.936);--color-yellow-500:oklch(79.5% .184 86.047);--color-yellow-600:oklch(68.1% .162 75.834);--color-yellow-800:oklch(47.6% .114 61.907);--color-yellow-900:oklch(42.1% .095 57.708);--color-yellow-950:oklch(28.6% .066 53.813);--color-green-300:oklch(87.1% .15 154.449);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-800:oklch(44.8% .119 151.328);--color-green-900:oklch(39.3% .095 152.535);--color-green-950:oklch(26.6% .065 152.934);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-800:oklch(43.2% .095 166.913);--color-emerald-900:oklch(37.8% .077 168.94);--color-teal-400:oklch(77.7% .152 181.912);--color-cyan-400:oklch(78.9% .154 211.53);--color-blue-200:oklch(88.2% .059 254.128);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--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-blue-900:oklch(37.9% .146 265.522);--color-purple-400:oklch(71.4% .203 305.504);--color-pink-400:oklch(71.8% .202 349.761);--color-slate-100:oklch(96.8% .007 247.896);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-400:oklch(70.4% .04 256.788);--color-slate-500:oklch(55.4% .046 257.417);--color-slate-600:oklch(44.6% .043 257.281);--color-slate-700:oklch(37.2% .044 257.287);--color-slate-800:oklch(27.9% .041 260.031);--color-slate-900:oklch(20.8% .042 265.755);--color-slate-950:oklch(12.9% .042 264.695);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-3xl:48rem;--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);--text-6xl:3.75rem;--text-6xl--line-height:1;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wide:.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-relaxed:1.625;--animate-spin:spin 1s linear infinite;--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;-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}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing) * 0)}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.top-1\/2{top:50%}.top-2{top:calc(var(--spacing) * 2)}.top-\[50\%\]{top:50%}.top-full{top:100%}.right-0{right:calc(var(--spacing) * 0)}.right-2{right:calc(var(--spacing) * 2)}.right-4{right:calc(var(--spacing) * 4)}.bottom-4{bottom:calc(var(--spacing) * 4)}.left-2{left:calc(var(--spacing) * 2)}.left-2\.5{left:calc(var(--spacing) * 2.5)}.left-\[50\%\]{left:50%}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.-mx-1{margin-inline:calc(var(--spacing) * -1)}.mx-1{margin-inline:calc(var(--spacing) * 1)}.mx-4{margin-inline:calc(var(--spacing) * 4)}.mx-auto{margin-inline:auto}.my-1{margin-block:calc(var(--spacing) * 1)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mr-1{margin-right:calc(var(--spacing) * 1)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.ml-0\.5{margin-left:calc(var(--spacing) * .5)}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-3{margin-left:calc(var(--spacing) * 3)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-12{height:calc(var(--spacing) * 12)}.h-14{height:calc(var(--spacing) * 14)}.h-64{height:calc(var(--spacing) * 64)}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-32{max-height:calc(var(--spacing) * 32)}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-64{max-height:calc(var(--spacing) * 64)}.max-h-96{max-height:calc(var(--spacing) * 96)}.max-h-\[80vh\]{max-height:80vh}.max-h-\[calc\(100vh-280px\)\]{max-height:calc(100vh - 280px)}.min-h-0{min-height:calc(var(--spacing) * 0)}.w-0\.5{width:calc(var(--spacing) * .5)}.w-2{width:calc(var(--spacing) * 2)}.w-2\.5{width:calc(var(--spacing) * 2.5)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-12{width:calc(var(--spacing) * 12)}.w-16{width:calc(var(--spacing) * 16)}.w-20{width:calc(var(--spacing) * 20)}.w-28{width:calc(var(--spacing) * 28)}.w-48{width:calc(var(--spacing) * 48)}.w-56{width:calc(var(--spacing) * 56)}.w-60{width:calc(var(--spacing) * 60)}.w-64{width:calc(var(--spacing) * 64)}.w-full{width:100%}.w-px{width:1px}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-\[80\%\]{max-width:80%}.max-w-\[120px\]{max-width:120px}.max-w-\[180px\]{max-width:180px}.max-w-\[280px\]{max-width:280px}.max-w-\[300px\]{max-width:300px}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-\[8rem\]{min-width:8rem}.min-w-\[140px\]{min-width:140px}.flex-1{flex:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.translate-x-\[-50\%\]{--tw-translate-x:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\[-50\%\]{--tw-translate-y:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.scale-75{--tw-scale-x:75%;--tw-scale-y:75%;--tw-scale-z:75%;scale:var(--tw-scale-x) var(--tw-scale-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-\[minmax\(0\,1fr\)_auto_auto\]{grid-template-columns:minmax(0,1fr) auto auto}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.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-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}:where(.space-y-0>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 0) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 0) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * 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-slate-800\/50>:not(:last-child)){border-color:#1d293d80}@supports (color:color-mix(in lab, red, red)){:where(.divide-slate-800\/50>:not(:last-child)){border-color:color-mix(in oklab, var(--color-slate-800) 50%, transparent)}}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) * .8)}.rounded-sm{border-radius:calc(var(--radius) * .6)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.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-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-amber-700{border-color:var(--color-amber-700)}.border-amber-800{border-color:var(--color-amber-800)}.border-amber-900\/50{border-color:#7b330680}@supports (color:color-mix(in lab, red, red)){.border-amber-900\/50{border-color:color-mix(in oklab, var(--color-amber-900) 50%, transparent)}}.border-blue-600{border-color:var(--color-blue-600)}.border-blue-800{border-color:var(--color-blue-800)}.border-blue-800\/50{border-color:#193cb880}@supports (color:color-mix(in lab, red, red)){.border-blue-800\/50{border-color:color-mix(in oklab, var(--color-blue-800) 50%, transparent)}}.border-emerald-800{border-color:var(--color-emerald-800)}.border-green-600{border-color:var(--color-green-600)}.border-green-800{border-color:var(--color-green-800)}.border-red-500{border-color:var(--color-red-500)}.border-red-500\/40{border-color:#fb2c3666}@supports (color:color-mix(in lab, red, red)){.border-red-500\/40{border-color:color-mix(in oklab, var(--color-red-500) 40%, transparent)}}.border-red-800{border-color:var(--color-red-800)}.border-slate-600{border-color:var(--color-slate-600)}.border-slate-700{border-color:var(--color-slate-700)}.border-slate-800{border-color:var(--color-slate-800)}.border-transparent{border-color:#0000}.border-yellow-600{border-color:var(--color-yellow-600)}.border-yellow-800{border-color:var(--color-yellow-800)}.border-t-blue-500{border-top-color:var(--color-blue-500)}.bg-amber-900\/50{background-color:#7b330680}@supports (color:color-mix(in lab, red, red)){.bg-amber-900\/50{background-color:color-mix(in oklab, var(--color-amber-900) 50%, transparent)}}.bg-amber-950{background-color:var(--color-amber-950)}.bg-amber-950\/20{background-color:#46190133}@supports (color:color-mix(in lab, red, red)){.bg-amber-950\/20{background-color:color-mix(in oklab, var(--color-amber-950) 20%, transparent)}}.bg-amber-950\/30{background-color:#4619014d}@supports (color:color-mix(in lab, red, red)){.bg-amber-950\/30{background-color:color-mix(in oklab, var(--color-amber-950) 30%, transparent)}}.bg-black{background-color:var(--color-black)}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab, red, red)){.bg-black\/60{background-color:color-mix(in oklab, var(--color-black) 60%, transparent)}}.bg-black\/80{background-color:#000c}@supports (color:color-mix(in lab, red, red)){.bg-black\/80{background-color:color-mix(in oklab, var(--color-black) 80%, transparent)}}.bg-blue-400{background-color:var(--color-blue-400)}.bg-blue-500{background-color:var(--color-blue-500)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-blue-900\/30{background-color:#1c398e4d}@supports (color:color-mix(in lab, red, red)){.bg-blue-900\/30{background-color:color-mix(in oklab, var(--color-blue-900) 30%, transparent)}}.bg-blue-900\/50{background-color:#1c398e80}@supports (color:color-mix(in lab, red, red)){.bg-blue-900\/50{background-color:color-mix(in oklab, var(--color-blue-900) 50%, transparent)}}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-emerald-900\/50{background-color:#004e3b80}@supports (color:color-mix(in lab, red, red)){.bg-emerald-900\/50{background-color:color-mix(in oklab, var(--color-emerald-900) 50%, transparent)}}.bg-green-500{background-color:var(--color-green-500)}.bg-green-900\/30{background-color:#0d542b4d}@supports (color:color-mix(in lab, red, red)){.bg-green-900\/30{background-color:color-mix(in oklab, var(--color-green-900) 30%, transparent)}}.bg-green-950{background-color:var(--color-green-950)}.bg-orange-500{background-color:var(--color-orange-500)}.bg-red-500{background-color:var(--color-red-500)}.bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab, red, red)){.bg-red-500\/10{background-color:color-mix(in oklab, var(--color-red-500) 10%, transparent)}}.bg-red-600{background-color:var(--color-red-600)}.bg-red-900\/30{background-color:#82181a4d}@supports (color:color-mix(in lab, red, red)){.bg-red-900\/30{background-color:color-mix(in oklab, var(--color-red-900) 30%, transparent)}}.bg-red-900\/50{background-color:#82181a80}@supports (color:color-mix(in lab, red, red)){.bg-red-900\/50{background-color:color-mix(in oklab, var(--color-red-900) 50%, transparent)}}.bg-red-950{background-color:var(--color-red-950)}.bg-red-950\/10{background-color:#4608091a}@supports (color:color-mix(in lab, red, red)){.bg-red-950\/10{background-color:color-mix(in oklab, var(--color-red-950) 10%, transparent)}}.bg-red-950\/30{background-color:#4608094d}@supports (color:color-mix(in lab, red, red)){.bg-red-950\/30{background-color:color-mix(in oklab, var(--color-red-950) 30%, transparent)}}.bg-slate-500{background-color:var(--color-slate-500)}.bg-slate-700{background-color:var(--color-slate-700)}.bg-slate-800{background-color:var(--color-slate-800)}.bg-slate-800\/30{background-color:#1d293d4d}@supports (color:color-mix(in lab, red, red)){.bg-slate-800\/30{background-color:color-mix(in oklab, var(--color-slate-800) 30%, transparent)}}.bg-slate-800\/50{background-color:#1d293d80}@supports (color:color-mix(in lab, red, red)){.bg-slate-800\/50{background-color:color-mix(in oklab, var(--color-slate-800) 50%, transparent)}}.bg-slate-900{background-color:var(--color-slate-900)}.bg-slate-900\/50{background-color:#0f172b80}@supports (color:color-mix(in lab, red, red)){.bg-slate-900\/50{background-color:color-mix(in oklab, var(--color-slate-900) 50%, transparent)}}.bg-slate-900\/60{background-color:#0f172b99}@supports (color:color-mix(in lab, red, red)){.bg-slate-900\/60{background-color:color-mix(in oklab, var(--color-slate-900) 60%, transparent)}}.bg-slate-950{background-color:var(--color-slate-950)}.bg-slate-950\/50{background-color:#02061880}@supports (color:color-mix(in lab, red, red)){.bg-slate-950\/50{background-color:color-mix(in oklab, var(--color-slate-950) 50%, transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-yellow-400{background-color:var(--color-yellow-400)}.bg-yellow-500{background-color:var(--color-yellow-500)}.bg-yellow-950{background-color:var(--color-yellow-950)}.bg-yellow-950\/50{background-color:#43200480}@supports (color:color-mix(in lab, red, red)){.bg-yellow-950\/50{background-color:color-mix(in oklab, var(--color-yellow-950) 50%, transparent)}}.fill-current{fill:currentColor}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:calc(var(--spacing) * 1)}.p-2{padding:calc(var(--spacing) * 2)}.p-2\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.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-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-16{padding-block:calc(var(--spacing) * 16)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-8{padding-left:calc(var(--spacing) * 8)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-6xl{font-size:var(--text-6xl);line-height:var(--tw-leading,var(--text-6xl--line-height))}.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}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.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-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-amber-200{color:var(--color-amber-200)}.text-amber-300{color:var(--color-amber-300)}.text-amber-400{color:var(--color-amber-400)}.text-amber-500{color:var(--color-amber-500)}.text-blue-200\/60{color:#bedbff99}@supports (color:color-mix(in lab, red, red)){.text-blue-200\/60{color:color-mix(in oklab, var(--color-blue-200) 60%, transparent)}}.text-blue-300{color:var(--color-blue-300)}.text-blue-400{color:var(--color-blue-400)}.text-blue-500{color:var(--color-blue-500)}.text-cyan-400{color:var(--color-cyan-400)}.text-emerald-400{color:var(--color-emerald-400)}.text-emerald-500{color:var(--color-emerald-500)}.text-green-300{color:var(--color-green-300)}.text-green-400{color:var(--color-green-400)}.text-green-500{color:var(--color-green-500)}.text-orange-400{color:var(--color-orange-400)}.text-pink-400{color:var(--color-pink-400)}.text-purple-400{color:var(--color-purple-400)}.text-red-300{color:var(--color-red-300)}.text-red-400{color:var(--color-red-400)}.text-red-500{color:var(--color-red-500)}.text-slate-100{color:var(--color-slate-100)}.text-slate-200{color:var(--color-slate-200)}.text-slate-300{color:var(--color-slate-300)}.text-slate-400{color:var(--color-slate-400)}.text-slate-500{color:var(--color-slate-500)}.text-slate-600{color:var(--color-slate-600)}.text-teal-400{color:var(--color-teal-400)}.text-white{color:var(--color-white)}.text-yellow-300{color:var(--color-yellow-300)}.text-yellow-400{color:var(--color-yellow-400)}.text-yellow-500{color:var(--color-yellow-500)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.italic{font-style:italic}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.placeholder-slate-500::placeholder{color:var(--color-slate-500)}.placeholder-slate-600::placeholder{color:var(--color-slate-600)}.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)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(0px + 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-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-red-400{--tw-ring-color:var(--color-red-400)}.ring-offset-slate-950{--tw-ring-offset-color:var(--color-slate-950)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.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))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.animate-in{--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial;animation-name:enter;animation-duration:.15s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.duration-200{animation-duration:.2s}.fade-in-0{--tw-enter-opacity:0}.paused{animation-play-state:paused}.running{animation-play-state:running}.slide-in-from-left-1\/2{--tw-enter-translate-x:-50%}.slide-in-from-top-\[48\%\]{--tw-enter-translate-y:-48%}.slide-out-to-left-1\/2{--tw-exit-translate-x:-50%}.slide-out-to-top-\[48\%\]{--tw-exit-translate-y:-48%}.zoom-in-95{--tw-enter-scale:.95}@media (hover:hover){.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}.group-hover\/install\:block:is(:where(.group\/install):hover *){display:block}}.group-\[\.toast\]\:bg-blue-600:is(:where(.group).toast *){background-color:var(--color-blue-600)}.group-\[\.toast\]\:bg-slate-800:is(:where(.group).toast *){background-color:var(--color-slate-800)}.group-\[\.toast\]\:text-slate-200:is(:where(.group).toast *){color:var(--color-slate-200)}.group-\[\.toast\]\:text-slate-400:is(:where(.group).toast *){color:var(--color-slate-400)}.group-\[\.toast\]\:text-white:is(:where(.group).toast *){color:var(--color-white)}.group-\[\.toaster\]\:border-slate-800:is(:where(.group).toaster *){border-color:var(--color-slate-800)}.group-\[\.toaster\]\:bg-slate-900:is(:where(.group).toaster *){background-color:var(--color-slate-900)}.group-\[\.toaster\]\:text-slate-200:is(:where(.group).toaster *){color:var(--color-slate-200)}.group-\[\.toaster\]\:shadow-lg:is(:where(.group).toaster *){--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)}.placeholder\:text-slate-500::placeholder{color:var(--color-slate-500)}.placeholder\:text-slate-600::placeholder{color:var(--color-slate-600)}@media (hover:hover){.hover\:border-slate-400:hover{border-color:var(--color-slate-400)}.hover\:border-slate-600:hover{border-color:var(--color-slate-600)}.hover\:bg-blue-500:hover{background-color:var(--color-blue-500)}.hover\:bg-green-900:hover{background-color:var(--color-green-900)}.hover\:bg-red-500:hover{background-color:var(--color-red-500)}.hover\:bg-red-700:hover{background-color:var(--color-red-700)}.hover\:bg-slate-700:hover{background-color:var(--color-slate-700)}.hover\:bg-slate-800:hover{background-color:var(--color-slate-800)}.hover\:bg-slate-800\/30:hover{background-color:#1d293d4d}@supports (color:color-mix(in lab, red, red)){.hover\:bg-slate-800\/30:hover{background-color:color-mix(in oklab, var(--color-slate-800) 30%, transparent)}}.hover\:bg-slate-800\/50:hover{background-color:#1d293d80}@supports (color:color-mix(in lab, red, red)){.hover\:bg-slate-800\/50:hover{background-color:color-mix(in oklab, var(--color-slate-800) 50%, transparent)}}.hover\:bg-slate-900:hover{background-color:var(--color-slate-900)}.hover\:bg-yellow-900:hover{background-color:var(--color-yellow-900)}.hover\:text-amber-200:hover{color:var(--color-amber-200)}.hover\:text-amber-300:hover{color:var(--color-amber-300)}.hover\:text-amber-400:hover{color:var(--color-amber-400)}.hover\:text-blue-300:hover{color:var(--color-blue-300)}.hover\:text-blue-400:hover{color:var(--color-blue-400)}.hover\:text-emerald-400:hover{color:var(--color-emerald-400)}.hover\:text-green-300:hover{color:var(--color-green-300)}.hover\:text-red-300:hover{color:var(--color-red-300)}.hover\:text-red-400:hover{color:var(--color-red-400)}.hover\:text-slate-100:hover{color:var(--color-slate-100)}.hover\:text-slate-200:hover{color:var(--color-slate-200)}.hover\:text-slate-300:hover{color:var(--color-slate-300)}.hover\:underline:hover{text-decoration-line:underline}}.focus\:not-sr-only:focus{clip-path:none;white-space:normal;width:auto;height:auto;margin:0;padding:0;position:static;overflow:visible}.focus\:fixed:focus{position:fixed}.focus\:top-4:focus{top:calc(var(--spacing) * 4)}.focus\:left-4:focus{left:calc(var(--spacing) * 4)}.focus\:z-50:focus{z-index:50}.focus\:rounded-md:focus{border-radius:calc(var(--radius) * .8)}.focus\:border-blue-500:focus{border-color:var(--color-blue-500)}.focus\:bg-blue-600:focus{background-color:var(--color-blue-600)}.focus\:bg-slate-800:focus{background-color:var(--color-slate-800)}.focus\:px-4:focus{padding-inline:calc(var(--spacing) * 4)}.focus\:py-2:focus{padding-block:calc(var(--spacing) * 2)}.focus\:text-sm:focus{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.focus\:font-medium:focus{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.focus\:text-slate-100:focus{color:var(--color-slate-100)}.focus\:text-white:focus{color:var(--color-white)}.focus\:ring-1:focus{--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)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-blue-500:focus{--tw-ring-color:var(--color-blue-500)}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus\:ring-offset-slate-900:focus{--tw-ring-offset-color:var(--color-slate-900)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\:ring-blue-500:focus-visible{--tw-ring-color:var(--color-blue-500)}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus-visible\:ring-offset-slate-900:focus-visible{--tw-ring-offset-color:var(--color-slate-900)}.focus-visible\:ring-offset-slate-950:focus-visible{--tw-ring-offset-color:var(--color-slate-950)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.active\:bg-blue-700:active{background-color:var(--color-blue-700)}.active\:bg-red-700:active{background-color:var(--color-red-700)}.active\:bg-slate-600:active{background-color:var(--color-slate-600)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:-.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:.5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:-.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:.5rem}.data-\[state\=active\]\:bg-slate-900[data-state=active]{background-color:var(--color-slate-900)}.data-\[state\=active\]\:text-slate-100[data-state=active]{color:var(--color-slate-100)}.data-\[state\=active\]\:shadow[data-state=active]{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.data-\[state\=checked\]\:translate-x-4[data-state=checked]{--tw-translate-x:calc(var(--spacing) * 4);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[state\=checked\]\:bg-blue-600[data-state=checked]{background-color:var(--color-blue-600)}.data-\[state\=closed\]\:animate-out[data-state=closed]{--tw-exit-opacity:initial;--tw-exit-scale:initial;--tw-exit-rotate:initial;--tw-exit-translate-x:initial;--tw-exit-translate-y:initial;animation-name:exit;animation-duration:.15s}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\[state\=closed\]\:slide-out-to-left-1\/2[data-state=closed]{--tw-exit-translate-x:-50%}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y:-48%}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\[state\=open\]\:bg-slate-800[data-state=open]{background-color:var(--color-slate-800)}.data-\[state\=open\]\:animate-in[data-state=open]{--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial;animation-name:enter;animation-duration:.15s}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\[state\=open\]\:slide-in-from-left-1\/2[data-state=open]{--tw-enter-translate-x:-50%}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y:-48%}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x:calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[state\=unchecked\]\:bg-slate-700[data-state=unchecked]{background-color:var(--color-slate-700)}@media (width>=40rem){.sm\:mt-0{margin-top:calc(var(--spacing) * 0)}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}:where(.sm\:space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * 2) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-x-reverse)))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:text-left{text-align:left}}@media (width>=48rem){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}}@media (width>=64rem){.lg\:block{display:block}.lg\:hidden{display:none}.lg\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:p-6{padding:calc(var(--spacing) * 6)}}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:size-4 svg{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}}:root{--background:oklch(100% 0 0);--foreground:oklch(14.5% 0 0);--card:oklch(100% 0 0);--card-foreground:oklch(14.5% 0 0);--popover:oklch(100% 0 0);--popover-foreground:oklch(14.5% 0 0);--primary:oklch(20.5% 0 0);--primary-foreground:oklch(98.5% 0 0);--secondary:oklch(97% 0 0);--secondary-foreground:oklch(20.5% 0 0);--muted:oklch(97% 0 0);--muted-foreground:oklch(55.6% 0 0);--accent:oklch(97% 0 0);--accent-foreground:oklch(20.5% 0 0);--destructive:oklch(57.7% .245 27.325);--border:oklch(92.2% 0 0);--input:oklch(92.2% 0 0);--ring:oklch(70.8% 0 0);--chart-1:oklch(87% 0 0);--chart-2:oklch(55.6% 0 0);--chart-3:oklch(43.9% 0 0);--chart-4:oklch(37.1% 0 0);--chart-5:oklch(26.9% 0 0);--radius:.625rem;--sidebar:oklch(98.5% 0 0);--sidebar-foreground:oklch(14.5% 0 0);--sidebar-primary:oklch(20.5% 0 0);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(97% 0 0);--sidebar-accent-foreground:oklch(20.5% 0 0);--sidebar-border:oklch(92.2% 0 0);--sidebar-ring:oklch(70.8% 0 0)}.dark{--background:oklch(14.5% 0 0);--foreground:oklch(98.5% 0 0);--card:oklch(20.5% 0 0);--card-foreground:oklch(98.5% 0 0);--popover:oklch(20.5% 0 0);--popover-foreground:oklch(98.5% 0 0);--primary:oklch(92.2% 0 0);--primary-foreground:oklch(20.5% 0 0);--secondary:oklch(26.9% 0 0);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(26.9% 0 0);--muted-foreground:oklch(70.8% 0 0);--accent:oklch(26.9% 0 0);--accent-foreground:oklch(98.5% 0 0);--destructive:oklch(70.4% .191 22.216);--border:oklch(100% 0 0/.1);--input:oklch(100% 0 0/.15);--ring:oklch(55.6% 0 0);--chart-1:oklch(87% 0 0);--chart-2:oklch(55.6% 0 0);--chart-3:oklch(43.9% 0 0);--chart-4:oklch(37.1% 0 0);--chart-5:oklch(26.9% 0 0);--sidebar:oklch(20.5% 0 0);--sidebar-foreground:oklch(98.5% 0 0);--sidebar-primary:oklch(48.8% .243 264.376);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(26.9% 0 0);--sidebar-accent-foreground:oklch(98.5% 0 0);--sidebar-border:oklch(100% 0 0/.1);--sidebar-ring:oklch(55.6% 0 0)}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:var(--color-slate-700);border-radius:3px}::-webkit-scrollbar-thumb:hover{background:var(--color-slate-600)}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0), var(--tw-enter-translate-y,0), 0) scale3d(var(--tw-enter-scale,1), var(--tw-enter-scale,1), var(--tw-enter-scale,1)) rotate(var(--tw-enter-rotate,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0), var(--tw-exit-translate-y,0), 0) scale3d(var(--tw-exit-scale,1), var(--tw-exit-scale,1), var(--tw-exit-scale,1)) rotate(var(--tw-exit-rotate,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-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-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-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@keyframes spin{to{transform:rotate(360deg)}}
|
package/web/dist/index.html
CHANGED
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/ui/favicon.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>Adam</title>
|
|
8
|
-
<script type="module" crossorigin src="/ui/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/ui/assets/index-CaHdOfAc.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/ui/assets/rolldown-runtime-Dw2cE7zH.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/ui/assets/vendor-icons-CkI4-NxL.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/ui/assets/vendor-react-DLRtONKt.js">
|
|
12
12
|
<link rel="modulepreload" crossorigin href="/ui/assets/dist-HyCSN_hp.js">
|
|
13
13
|
<link rel="modulepreload" crossorigin href="/ui/assets/vendor-state-B_-GdGNJ.js">
|
|
14
|
-
<link rel="stylesheet" crossorigin href="/ui/assets/index-
|
|
14
|
+
<link rel="stylesheet" crossorigin href="/ui/assets/index-D0SvKqKc.css">
|
|
15
15
|
</head>
|
|
16
16
|
<body class="bg-slate-950 text-slate-100">
|
|
17
17
|
<div id="root"></div>
|
package/dist/App-RIYRYLKD.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{b as v,d as Ht,e as Ro}from"./chunk-VRP4LTHY.js";import{a as Gt,f as Ao,h as Do}from"./chunk-WBAPIPST.js";import"./chunk-INNDBLZE.js";import"./chunk-FCV2DPZQ.js";import{Box as qt,Text as Pt,useInput as ls}from"ink";import{useState as cs,useEffect as so,useRef as wo}from"react";import{createContext as Dr,useContext as Rr,useReducer as Mr}from"react";import{jsx as _r}from"react/jsx-runtime";var Nr={connected:!1,serverInfo:null,activeTasks:0,queuedTasks:0,costToday:0,activeTaskId:null,activeTaskSubmitted:!1,pendingApproval:null,pendingPlanApproval:null,planTimeoutNotice:null,serverUnreachable:!1,view:"chat",configVersion:0,session:null,version:null};function Lr(e,t){switch(t.type){case"SET_CONNECTED":return{...e,connected:t.connected};case"SET_SERVER_INFO":return{...e,serverInfo:t.info};case"UPDATE_STATS":return{...e,activeTasks:t.activeTasks,queuedTasks:t.queuedTasks,costToday:t.costToday};case"SET_ACTIVE_TASK":return{...e,activeTaskId:t.taskId,activeTaskSubmitted:!1};case"TASK_SUBMITTED":return{...e,activeTaskSubmitted:!0};case"SET_PENDING_APPROVAL":return{...e,pendingApproval:t.approval};case"SET_SERVER_UNREACHABLE":return{...e,serverUnreachable:t.unreachable};case"SET_VIEW":return{...e,view:t.view};case"CONFIG_CHANGED":return{...e,configVersion:e.configVersion+1};case"SET_SESSION":return{...e,session:t.session};case"SET_PENDING_PLAN_APPROVAL":return{...e,pendingPlanApproval:t.approval};case"SET_PLAN_TIMEOUT_NOTICE":return{...e,pendingPlanApproval:null,planTimeoutNotice:t.planId?{planId:t.planId}:null};case"SET_VERSION":return{...e,version:t.version};default:return e}}var Mo=Dr(null);function No({children:e}){let[t,o]=Mr(Lr,Nr);return _r(Mo.Provider,{value:{state:t,dispatch:o},children:e})}function st(){let e=Rr(Mo);if(!e)throw new Error("useTuiState must be used within TuiProvider");return e}import{useEffect as Lo,useRef as _o}from"react";var Vr=15e3;function Vo(){let{state:e,dispatch:t}=st(),o=_o(null),c=_o(null);Lo(()=>{c.current=e.session?.id??null},[e.session?.id]),Lo(()=>{let u=!0,m=null,l=()=>{o.current&&(clearTimeout(o.current),o.current=null)},i=()=>{l(),o.current=setTimeout(()=>{u&&t({type:"SET_SERVER_UNREACHABLE",unreachable:!0})},Vr)};return(()=>{try{m=new Ht("/events"),m.on("task_status_change",()=>{}),m.on("approval_request",r=>{if(!u)return;let a=r;t({type:"SET_PENDING_APPROVAL",approval:{taskId:a.taskId,approvalId:a.approvalId,toolName:a.toolName,toolInput:a.toolInput,matchedPattern:a.matchedPattern}})}),m.on("plan_approval_request",r=>{if(!u)return;let a=r;t({type:"SET_PENDING_PLAN_APPROVAL",approval:{taskId:a.taskId,planId:a.planId,roleId:a.roleId,plan:a.plan}})}),m.on("plan_approval_decision",()=>{u&&t({type:"SET_PENDING_PLAN_APPROVAL",approval:null})}),m.on("config_changed",()=>{u&&t({type:"CONFIG_CHANGED"})}),m.on("execution_task_start",r=>{if(!u)return;let a=r,d=c.current;d&&(async()=>{try{let b=await v(`/tasks/${a.taskId}`);u&&b.sourceSessionId===d&&t({type:"SET_ACTIVE_TASK",taskId:a.taskId})}catch{}})()}),m.on("stats_update",r=>{if(!u)return;let a=r;t({type:"UPDATE_STATS",activeTasks:a.activeTasks,queuedTasks:a.queuedTasks,costToday:a.totalCostToday})}),m.connect().then(async()=>{if(u){l(),t({type:"SET_CONNECTED",connected:!0}),t({type:"SET_SERVER_UNREACHABLE",unreachable:!1});try{let r=await v("/version");t({type:"SET_VERSION",version:r.version})}catch{t({type:"SET_VERSION",version:null})}}}).catch(()=>{u&&(t({type:"SET_CONNECTED",connected:!1}),i())})}catch{u&&(t({type:"SET_CONNECTED",connected:!1}),i())}})(),()=>{u=!1,l(),m?.close()}},[t])}import{useEffect as $r,useRef as Or,useState as $o,useCallback as qr}from"react";function Oo(e){let[t,o]=$o([]),[c,u]=$o(!1),m=Or(null),l=qr(()=>{o([]),u(!1)},[]);return $r(()=>{if(!e)return;let i=!0;o([]),u(!0);try{let n=new Ro(e);return m.current=n,n.on("reasoning",r=>{if(!i)return;let d=r.content??"";o(b=>{let p=b[b.length-1];if(p?.type==="reasoning"){let y=[...b];return y[y.length-1]={...p,content:p.content+d},y}return[...b,{type:"reasoning",content:d,timestamp:Date.now()}]})}),n.on("tool_call",r=>{if(!i)return;let a=r;o(d=>[...d,{type:"tool_call",content:a.toolName??"unknown tool",timestamp:Date.now(),metadata:{toolName:a.toolName}}])}),n.on("tool_result",r=>{if(!i)return;let a=r;o(d=>[...d,{type:"tool_result",content:a.content??"",timestamp:Date.now()}])}),n.on("error",r=>{if(!i)return;let a=r;o(d=>[...d,{type:"error",content:a.error??"unknown error",timestamp:Date.now()}])}),n.on("complete",r=>{if(!i)return;let a=r;o(d=>[...d,{type:"complete",content:a.result??"",timestamp:Date.now(),metadata:{cost:a.costUsd,turns:a.numTurns,duration:a.totalDurationMs}}]),u(!1)}),n.connect().catch(()=>{i&&(o(r=>[...r,{type:"error",content:"Failed to connect to task stream",timestamp:Date.now()}]),u(!1))}),()=>{i=!1,n.close()}}catch{u(!1)}},[e]),{events:t,isStreaming:c,clearEvents:l}}import{useState as io,useEffect as Fr,useCallback as Dt}from"react";function ao(e){return{id:e.id,status:e.status,messageCount:e.messageCount,createdAt:e.createdAt,lastActiveAt:e.lastActiveAt,title:e.title}}function qo(){let[e,t]=io(null),[o,c]=io(!0),[u,m]=io(null),l=Dt(async()=>{try{let b=(await v("/chat/sessions?status=active")).sessions.find(p=>p.source.type==="tui");return b?ao(b):null}catch{return null}},[]),i=Dt(async()=>{try{let d=await v("/chat/sessions",{method:"POST",body:{source:{type:"tui"}}}),b=ao(d.session);return t(b),b}catch{return m("Failed to create session"),null}},[]),n=Dt(async d=>{try{let b=await v("/chat/messages",{method:"POST",body:{content:d,source:{type:"tui"}}});return t(p=>p&&{...p,messageCount:p.messageCount+1,lastActiveAt:Date.now()}),b}catch{return null}},[]),r=Dt(async()=>{if(!e)return!1;try{return await v(`/chat/sessions/${e.id}/archive`,{method:"POST"}),t(null),!0}catch{return!1}},[e]),a=Dt(async()=>{if(e)try{let d=await v(`/chat/sessions/${e.id}`);t(ao(d.session))}catch{t(null)}},[e]);return Fr(()=>{let d=!1;async function b(){c(!0);let p=await l();d||(p?t(p):await i(),d||c(!1))}return b(),()=>{d=!0}},[]),{session:e,loading:o,error:u,sendMessage:n,createNewSession:i,archiveCurrentSession:r,refreshSession:a,setSession:t}}import{useEffect as Fo,useRef as Ur,useState as Wr}from"react";function Uo(e){let[t,o]=Wr(null),c=Ur(new Set);return Fo(()=>{if(!e)return;let u=!0,m=null;try{m=new Ht("/chat/stream"),m.on("chat_message",l=>{if(!u)return;let n=l.message;n&&n.sessionId===e&&n.role==="assistant"&&(c.current.has(n.id)||(c.current.add(n.id),o(n)))}),m.connect().catch(()=>{})}catch{}return()=>{u=!1,m?.close()}},[e]),Fo(()=>{c.current.clear(),o(null)},[e]),{latestMessage:t}}import{Box as co,Text as Le}from"ink";import Ne from"chalk";var lo={connected:Ne.green,disconnected:Ne.red,warning:Ne.yellow,reasoning:Ne.gray,toolCall:Ne.blue,toolResult:Ne.green,error:Ne.red,dim:Ne.dim,bold:Ne.bold,statusUp:Ne.green("\u25CF"),statusDown:Ne.red("\u25CF")};import{Fragment as Gr,jsx as ut,jsxs as it}from"react/jsx-runtime";function Wo(){let{state:e}=st(),t=e.connected?`${lo.statusUp} Server: up`:`${lo.statusDown} Disconnected`,o=e.activeTasks>0?`${e.activeTasks} running, ${e.queuedTasks} queued`:"No active tasks",c=e.session,m=(c?Math.floor((Date.now()-c.lastActiveAt)/6e4):1/0)>=25;return it(co,{flexDirection:"column",borderStyle:"round",borderDimColor:!0,children:[it(co,{children:[ut(Le,{bold:!0,children:e.version?`Adam v${e.version}`:"Adam"}),ut(Le,{children:" \u2502 "}),ut(Le,{children:t}),ut(Le,{children:" \u2502 "}),it(Le,{children:["Tasks: ",e.activeTasks," active"]}),e.view==="chat"&&c&&it(Gr,{children:[ut(Le,{children:" \u2502 "}),it(Le,{children:["Session: ",c.messageCount===0?"(new)":`${c.id.slice(0,8)} (${c.messageCount} turns)`]}),m&&ut(Le,{color:"yellow",children:" timeout soon"})]})]}),it(co,{children:[it(Le,{children:["Tasks: ",o]}),ut(Le,{children:" \u2502 "}),it(Le,{children:["Cost: $",e.costToday.toFixed(2)," today"]})]})]})}import{Box as Kt,Text as jt,useInput as Kr}from"ink";import{useState as mo,useMemo as jr}from"react";import Qr from"ink-text-input";var Hr=[{name:"work",description:"Tasks, Automations & Goals"},{name:"config",description:"Configuration"},{name:"evolution",description:"Evolution audit"},{name:"webhooks",description:"Webhook triggers"},{name:"memories",description:"Memory browser"},{name:"strategies",description:"Strategy lab"},{name:"plugins",description:"Plugin management"},{name:"roles",description:"Role management"},{name:"settings",description:"Runtime settings"},{name:"back",description:"Return to chat"},{name:"quit",description:"Exit TUI"}];function uo(e){let t=e.toLowerCase();return Hr.filter(o=>o.name.startsWith(t))}function Go(e){let t=uo(e.toLowerCase());return t.length===1?t[0]:void 0}import{jsx as Qt,jsxs as Rt}from"react/jsx-runtime";function Ho({onSubmit:e}){let[t,o]=mo(""),[c,u]=mo(0),[m,l]=mo(!1),i=t.startsWith("/")&&t.length>=1,n=t.slice(1),r=jr(()=>i?uo(n):[],[i,n]),a=p=>{o(p),p.startsWith("/")?(l(!0),u(0)):l(!1)},d=()=>{let p=t.trim();if(p){if(p.startsWith("/")){let y=p.slice(1),s=Go(y);e(s?`/${s.name}`:p)}else e(p);o(""),l(!1)}},b=p=>{e(`/${p.name}`),o(""),l(!1)};return Kr((p,y)=>{if(!(!m||!i||r.length===0)){if(y.upArrow){u(s=>s<=0?r.length-1:s-1);return}if(y.downArrow){u(s=>s>=r.length-1?0:s+1);return}if(y.tab){let s=r[c];s&&b(s);return}if(y.escape){l(!1),o("");return}}},{isActive:m&&i&&r.length>0}),Rt(Kt,{flexDirection:"column",children:[m&&i&&r.length>0&&Qt(Kt,{flexDirection:"column",marginBottom:0,paddingX:1,children:r.map((p,y)=>{let s=y===c;return Rt(Kt,{children:[Qt(jt,{color:s?"cyan":"gray",bold:s,children:s?"\u25B8 ":" "}),Rt(jt,{color:s?"cyan":"white",bold:s,children:["/",p.name]}),Rt(jt,{dimColor:!0,children:[" \u2014 ",p.description]})]},p.name)})}),Rt(Kt,{borderStyle:"round",borderDimColor:!0,children:[Qt(jt,{bold:!0,children:"\u25B8 "}),Qt(Qr,{value:t,onChange:a,onSubmit:d,placeholder:"Type a message or / for commands..."})]})]})}import{Box as ht,Text as Se}from"ink";import{useState as Xr}from"react";import{jsx as Pe,jsxs as Ue}from"react/jsx-runtime";function zr({content:e}){let[t,o]=Xr(!1),c=e.split(`
|
|
2
|
-
`);return c.length<=5?Pe(Se,{color:"green",children:e}):t?Pe(Se,{color:"green",children:e}):Ue(Se,{color:"green",children:[c.slice(0,3).join(`
|
|
3
|
-
`),`
|
|
4
|
-
`,Ue(Se,{dimColor:!0,children:["(",c.length," lines) \u25B8 \u5C55\u5F00"]})]})}function Yr({event:e}){switch(e.type){case"reasoning":return Pe(ht,{children:Pe(Se,{color:"gray",children:e.content})});case"tool_call":return Pe(ht,{children:Ue(Se,{color:"blue",children:["[tool] ",e.metadata?.toolName??e.content]})});case"tool_result":return Ue(ht,{flexDirection:"column",children:[Pe(Se,{color:"blue",dimColor:!0,children:"[result]"}),Pe(zr,{content:e.content})]});case"error":return Pe(ht,{children:Ue(Se,{color:"red",children:["[error] ",e.content]})});case"complete":return Ue(ht,{flexDirection:"column",marginTop:1,children:[e.content&&Pe(Se,{children:e.content}),Pe(Se,{dimColor:!0,children:"\u2500\u2500\u2500 Task complete \u2500\u2500\u2500"}),e.metadata?.cost!==void 0&&Ue(Se,{dimColor:!0,children:["Cost: $",e.metadata.cost.toFixed(4)]}),e.metadata?.turns!==void 0&&Ue(Se,{dimColor:!0,children:["Turns: ",e.metadata.turns]}),e.metadata?.duration!==void 0&&Ue(Se,{dimColor:!0,children:["Duration: ",(e.metadata.duration/1e3).toFixed(1),"s"]})]});default:return null}}function Ko({events:e,isStreaming:t}){return e.length===0&&!t?null:Ue(ht,{flexDirection:"column",children:[t&&e.length===0&&Pe(Se,{dimColor:!0,children:"Waiting for response..."}),e.map((o,c)=>Pe(Yr,{event:o},c))]})}import{Box as jo,Text as Qo}from"ink";import{jsx as go,jsxs as Jr}from"react/jsx-runtime";function Xo({messages:e}){return e.length===0?null:go(jo,{flexDirection:"column",children:e.map((t,o)=>Jr(jo,{flexDirection:"column",marginBottom:1,children:[go(Qo,{dimColor:!0,bold:!0,children:t.role==="user"?"You:":"Adam:"}),go(Qo,{children:t.content})]},o))})}import{Box as Mt,Text as We,useInput as Zr}from"ink";import{jsx as Ge,jsxs as Nt}from"react/jsx-runtime";function zo({approval:e,onResolved:t}){return Zr(o=>{o==="a"?v(`/tasks/${e.taskId}/approve`,{method:"POST",body:{approvalId:e.approvalId}}).then(()=>t()).catch(()=>t()):o==="r"&&v(`/tasks/${e.taskId}/reject`,{method:"POST",body:{approvalId:e.approvalId,reason:"rejected by user"}}).then(()=>t()).catch(()=>t())}),Nt(Mt,{flexDirection:"column",borderStyle:"round",borderColor:"yellow",paddingX:1,children:[Ge(We,{bold:!0,color:"yellow",children:"\u26A0 APPROVAL REQUIRED"}),Nt(Mt,{marginTop:1,children:[Ge(We,{children:"Tool: "}),Ge(We,{bold:!0,children:e.toolName})]}),Nt(Mt,{children:[Ge(We,{children:"Input: "}),Ge(We,{children:JSON.stringify(e.toolInput)})]}),Nt(Mt,{children:[Ge(We,{children:"Pattern: "}),Ge(We,{dimColor:!0,children:e.matchedPattern})]}),Nt(Mt,{marginTop:1,children:[Ge(We,{color:"green",children:"[a] Approve"}),Ge(We,{children:" "}),Ge(We,{color:"red",children:"[r] Reject"})]})]})}import{Box as Lt,Text as he,useInput as en}from"ink";import{useState as tn,useEffect as on}from"react";import{jsx as ze,jsxs as _e}from"react/jsx-runtime";var rn=300;function Yo({approval:e,onResolved:t,onTimeout:o}){let[c,u]=tn(rn);on(()=>{let l=setInterval(()=>{u(i=>i<=1?(clearInterval(l),o(),0):i-1)},1e3);return()=>clearInterval(l)},[o]),en(l=>{l==="a"?v(`/tasks/${e.taskId}/approve-plan`,{method:"POST",body:{planId:e.planId,decision:"allow",approvalType:"once"}}).then(()=>t()).catch(()=>t()):l==="r"?v(`/tasks/${e.taskId}/approve-plan`,{method:"POST",body:{planId:e.planId,decision:"deny",reason:"rejected by user"}}).then(()=>t()).catch(()=>t()):l==="p"&&v(`/tasks/${e.taskId}/approve-plan`,{method:"POST",body:{planId:e.planId,decision:"allow",approvalType:"permanent"}}).then(()=>t()).catch(()=>t())});let m=e.plan.overallRisk==="high"?"red":e.plan.overallRisk==="medium"?"yellow":"green";return _e(Lt,{flexDirection:"column",borderStyle:"round",borderColor:"cyan",paddingX:1,children:[ze(he,{bold:!0,color:"cyan",children:"EXECUTION PLAN \u2014 APPROVAL REQUIRED"}),_e(he,{dimColor:!0,children:["Plan ID: ",e.planId]}),_e(he,{dimColor:!0,children:["Time remaining: ",c,"s"]}),_e(Lt,{marginTop:1,children:[ze(he,{children:"Overall Risk: "}),ze(he,{bold:!0,color:m,children:e.plan.overallRisk.toUpperCase()})]}),_e(he,{bold:!0,children:["Steps (",e.plan.steps.length,"):"]}),e.plan.steps.map(l=>{let i=l.riskLevel==="high"?"red":l.riskLevel==="medium"?"yellow":"green";return _e(Lt,{paddingLeft:2,children:[_e(he,{children:["[",l.index,"] "]}),ze(he,{children:l.description}),_e(he,{dimColor:!0,children:[" (",l.toolsNeeded.join(", "),")"]}),_e(he,{color:i,children:[" [",l.riskLevel,"]"]})]},l.index)}),_e(Lt,{marginTop:1,children:[ze(he,{dimColor:!0,children:"Permissions: "}),ze(he,{children:Object.keys(e.plan.requiredPermissions).join(", ")||"none"})]}),_e(Lt,{marginTop:1,children:[ze(he,{color:"green",children:"[a] Allow once "}),ze(he,{color:"green",children:"[p] Allow permanent "}),ze(he,{color:"red",children:"[r] Deny"})]})]})}import{Box as mt,Text as ie,useInput as an}from"ink";import{useEffect as ln,useState as Ye,useCallback as Zo}from"react";import{Box as te,Text as L,useInput as nn}from"ink";import{useState as fo,useEffect as sn}from"react";import{jsx as U,jsxs as K}from"react/jsx-runtime";function Jo({taskId:e,onBack:t}){let[o,c]=fo(null),[u,m]=fo([]),[l,i]=fo(null);if(sn(()=>{v(`/tasks/${e}`).then(r=>c(r)).catch(r=>i(r instanceof Error?r.message:String(r))),v(`/tasks/${e}/plan`).then(r=>m(r.plans)).catch(()=>m([]))},[e]),nn((r,a)=>{(r==="b"||a.escape)&&t()}),l)return K(te,{flexDirection:"column",children:[K(L,{color:"red",children:["Error: ",l]}),U(L,{dimColor:!0,children:"[b] Back"})]});if(!o)return K(L,{dimColor:!0,children:["Loading task ",e,"..."]});let n=u[0];return K(te,{flexDirection:"column",children:[U(L,{bold:!0,color:"cyan",children:"Task Detail"}),K(te,{marginTop:1,flexDirection:"column",children:[K(te,{children:[U(L,{children:"ID: "}),U(L,{dimColor:!0,children:String(o.id)})]}),K(te,{children:[U(L,{children:"Status: "}),U(L,{bold:!0,children:String(o.status)})]}),K(te,{children:[U(L,{children:"Prompt: "}),U(L,{children:String(o.prompt)})]}),o.result?K(te,{children:[U(L,{children:"Result: "}),U(L,{children:String(o.result).slice(0,200)})]}):null,o.error?K(te,{children:[U(L,{color:"red",children:"Error: "}),U(L,{children:String(o.error)})]}):null,o.deliverTo?.length?K(te,{children:[U(L,{children:"DeliverTo: "}),U(L,{dimColor:!0,children:o.deliverTo.map(r=>r.type==="channel"?`channel ${r.channelId?.slice(0,8)}`:`session ${r.sessionId?.slice(0,8)}`).join(", ")})]}):null,o.reportTo?.length?K(te,{children:[U(L,{children:"ReportTo: "}),U(L,{dimColor:!0,children:o.reportTo.map(r=>r.type==="channel"?`channel ${r.channelId?.slice(0,8)}`:`session ${r.sessionId?.slice(0,8)}`).join(", ")})]}):null]}),n&&K(te,{marginTop:1,flexDirection:"column",children:[U(L,{bold:!0,color:"cyan",children:"Execution Plan"}),K(te,{children:[U(L,{children:"Plan ID: "}),U(L,{dimColor:!0,children:n.id})]}),K(te,{children:[U(L,{children:"Status: "}),U(L,{children:n.status})]}),n.plan.overallRisk&&K(te,{children:[U(L,{children:"Overall Risk: "}),U(L,{bold:!0,color:n.plan.overallRisk==="high"?"red":n.plan.overallRisk==="medium"?"yellow":"green",children:n.plan.overallRisk.toUpperCase()})]}),K(L,{bold:!0,children:["Steps (",n.plan.steps.length,"):"]}),n.plan.steps.map(r=>{let a=r.riskLevel==="high"?"red":r.riskLevel==="medium"?"yellow":"green";return K(te,{paddingLeft:2,children:[K(L,{children:["[",r.index,"] ",r.description]}),K(L,{color:a,children:[" [",r.riskLevel,"]"]})]},r.index)}),n.deviationReport&&K(te,{marginTop:1,flexDirection:"column",children:[U(L,{bold:!0,color:"yellow",children:"Deviation Report"}),K(L,{children:["Planned: ",n.deviationReport.stepsPlanned," | Executed: ",n.deviationReport.stepsExecuted," | Accuracy: ",(n.deviationReport.overallAccuracy*100).toFixed(0),"%"]}),n.deviationReport.deviations.map((r,a)=>K(te,{paddingLeft:2,children:[K(L,{color:"yellow",children:["[",r.deviationType,"] "]}),K(L,{children:["Step ",r.stepIndex,": ",r.actual]})]},a))]}),n.learnedRules&&n.learnedRules.length>0&&K(te,{marginTop:1,flexDirection:"column",children:[U(L,{bold:!0,color:"blue",children:"Learned Rules"}),n.learnedRules.map((r,a)=>U(te,{paddingLeft:2,children:K(L,{children:["* ",r]})},a))]})]}),!n&&u.length===0&&U(te,{marginTop:1,children:U(L,{dimColor:!0,children:"No execution plan for this task."})}),U(te,{marginTop:1,children:U(L,{dimColor:!0,children:"[b] Back"})})]})}import{Fragment as un,jsx as ve,jsxs as Be}from"react/jsx-runtime";var cn={pending:"gray",queued:"gray",running:"yellow",paused:"yellow",completed:"green",failed:"red",cancelled:"gray"},Xt=["all","pending","queued","running","completed","failed","cancelled"],po=15;function zt({onBack:e}){let[t,o]=Ye([]),[c,u]=Ye(!0),[m,l]=Ye("list"),[i,n]=Ye(0),[r,a]=Ye("all"),[d,b]=Ye(0),[p,y]=Ye(0),[s,g]=Ye(null),[_,M]=Ye([]),Y=Zo(async()=>{u(!0);try{let I=new URLSearchParams({limit:"100"});r!=="all"&&I.set("status",r);let P=await v(`/tasks?${I}`);o(P.tasks)}catch{o([])}finally{u(!1)}},[r]);ln(()=>{Y()},[Y]);let H=Math.max(1,Math.ceil(t.length/po)),O=t.slice(p*po,(p+1)*po),X=Zo(async()=>{let I=O[i];if(I)try{await v(`/tasks/${I.id}/cancel`,{method:"POST"}),g(`Cancelled: ${I.id.slice(0,8)}`),l("list"),Y()}catch(P){g(`Failed: ${P instanceof Error?P.message:String(P)}`),l("list")}},[O,i,Y]);return an((I,P)=>{if(m==="detail"){(P.escape||P.return||I==="q")&&l("list");return}if(m==="cancelling"){I==="y"?X():l("list");return}if(m==="filter"){if(P.escape){l("list");return}P.upArrow&&d>0&&b(S=>S-1),P.downArrow&&d<Xt.length-1&&b(S=>S+1),P.return&&(a(Xt[d]),y(0),n(0),l("list"));return}if(P.escape||I==="q"){e();return}if(P.upArrow&&i>0&&n(S=>S-1),P.downArrow&&i<O.length-1&&n(S=>S+1),P.return){let S=O[i];S&&(M([]),l("detail"),v(`/tasks/${S.id}/logs?limit=20`).then(({logs:j})=>M(j)).catch(()=>M([])))}if(I==="x"&&O[i]){let S=O[i];["running","pending","queued","paused"].includes(S.status)?(l("cancelling"),g(null)):g(`Cannot cancel task in status: ${S.status}`)}I==="f"&&(b(Xt.indexOf(r)),l("filter")),I==="r"&&Y(),(P.pageDown||I==="n")&&p<H-1&&(y(S=>S+1),n(0)),(P.pageUp||I==="p")&&p>0&&(y(S=>S-1),n(0))}),c?ve(ie,{dimColor:!0,children:"Loading tasks..."}):m==="filter"?Be(mt,{flexDirection:"column",children:[ve(ie,{bold:!0,children:"Filter by status:"}),Xt.map((I,P)=>ve(mt,{children:Be(ie,{color:P===d?"cyan":"white",children:[P===d?"> ":" ",I,I===r?" (current)":""]})},I)),ve(ie,{dimColor:!0,children:"Enter: select Esc: cancel"})]}):m==="detail"&&O[i]?ve(Jo,{taskId:O[i].id,onBack:()=>l("list")}):m==="cancelling"&&O[i]?Be(mt,{flexDirection:"column",children:[Be(ie,{color:"red",children:['Cancel task "',O[i].id.slice(0,8),'"? (y/n)']}),s&&ve(ie,{color:"red",children:s})]}):Be(mt,{flexDirection:"column",children:[Be(mt,{children:[Be(ie,{bold:!0,children:["Tasks (",t.length,")"]}),r!=="all"&&Be(ie,{dimColor:!0,children:[" [filter: ",r,"]"]}),Be(ie,{dimColor:!0,children:[" \u2014 Page ",p+1,"/",H]})]}),s&&ve(ie,{color:s.startsWith("Failed")||s.startsWith("Cannot")?"red":"green",children:s}),t.length===0?Be(ie,{dimColor:!0,children:["No tasks found",r!=="all"?` with status "${r}"`:"","."]}):Be(un,{children:[ve(mt,{marginTop:1,children:Be(ie,{bold:!0,children:[" ",at("ID",10),at("STATUS",12),at("PROMPT",40),at("DURATION",10),"COST"]})}),O.map((I,P)=>{let S=P===i,j=I.totalDurationMs?`${(I.totalDurationMs/1e3).toFixed(0)}s`:"\u2014",J=I.costUsd!==void 0?`$${I.costUsd.toFixed(4)}`:"\u2014",Re=cn[I.status]??"white";return Be(mt,{children:[ve(ie,{color:S?"cyan":"white",children:S?"> ":" "}),ve(ie,{dimColor:!0,children:at(I.id.slice(0,8),10)}),ve(ie,{color:Re,children:at(I.status,12)}),ve(ie,{children:at(dn(I.prompt,38),40)}),ve(ie,{dimColor:!0,children:at(j,10)}),ve(ie,{dimColor:!0,children:J})]},I.id)})]}),ve(ie,{dimColor:!0,children:"Enter:detail x:cancel f:filter n/p:page r:refresh Esc/q:back"})]})}function at(e,t){return e?e.length>=t?e:e+" ".repeat(t-e.length):" ".repeat(t)}function dn(e,t){return e.length<=t?e:e.slice(0,t-3)+"..."}Do();import{Box as _t,Text as Ve,useInput as mn}from"ink";import{useEffect as gn,useState as er}from"react";import{readFileSync as fn,existsSync as pn}from"fs";import{parse as xn}from"yaml";import{Fragment as Tn,jsx as $e,jsxs as lt}from"react/jsx-runtime";function or({onBack:e}){let[t,o]=er(null),[c,u]=er(null);return mn((m,l)=>{(l.escape||m==="q")&&e()}),gn(()=>{try{let m=Ao;if(!pn(m)){u(`Config file not found: ${m}`);return}let l=fn(m,"utf-8");o(xn(l))}catch(m){u(m.message)}},[]),c?lt(_t,{flexDirection:"column",children:[$e(Ve,{color:"red",children:c}),$e(Ve,{dimColor:!0,children:"Press Esc to go back"})]}):t?lt(_t,{flexDirection:"column",children:[$e(Ve,{bold:!0,children:"Configuration (Esc to go back)"}),$e(_t,{marginTop:1,flexDirection:"column",children:$e(rr,{obj:t,indent:0})})]}):$e(Ve,{dimColor:!0,children:"Loading config..."})}function rr({obj:e,indent:t}){let o=" ".repeat(t);return $e(Tn,{children:Object.entries(e).map(([c,u])=>u&&typeof u=="object"&&!Array.isArray(u)?lt(_t,{flexDirection:"column",children:[lt(Ve,{children:[o,$e(Ve,{color:"cyan",children:c}),":"]}),$e(rr,{obj:u,indent:t+1})]},c):Array.isArray(u)?lt(_t,{flexDirection:"column",children:[lt(Ve,{children:[o,$e(Ve,{color:"cyan",children:c}),":"]}),u.map((m,l)=>lt(Ve,{children:[o," - ",tr(c,String(m))]},l))]},c):lt(Ve,{children:[o,$e(Ve,{color:"cyan",children:c}),": ",tr(c,String(u))]},c))})}function tr(e,t){return e.toLowerCase().includes("key")||e.toLowerCase().includes("token")?!t||t.length<8?"****":t.slice(0,4)+"****":t}import{Box as Yt,Text as Oe,useInput as hn}from"ink";import{useEffect as vn,useState as xo}from"react";import{jsx as Vt,jsxs as He}from"react/jsx-runtime";function nr({onBack:e}){let[t,o]=xo([]),[c,u]=xo(!0),[m,l]=xo(null);return hn((i,n)=>{(n.escape||i==="q")&&e()}),vn(()=>{v("/evolution-audit?limit=20").then(i=>{o(i),u(!1)}).catch(i=>{l(i.message),u(!1)})},[]),c?Vt(Oe,{dimColor:!0,children:"Loading evolution log..."}):m?He(Yt,{flexDirection:"column",children:[Vt(Oe,{color:"red",children:m}),Vt(Oe,{dimColor:!0,children:"Press Esc to go back"})]}):t.length===0?He(Yt,{flexDirection:"column",children:[Vt(Oe,{dimColor:!0,children:"No evolution records yet"}),Vt(Oe,{dimColor:!0,children:"Press Esc to go back"})]}):He(Yt,{flexDirection:"column",children:[He(Oe,{bold:!0,children:["Evolution Audit Log (",t.length," records) \u2014 Esc to go back"]}),t.map(i=>He(Yt,{flexDirection:"column",marginTop:1,children:[He(Oe,{bold:!0,children:["[",new Date(i.timestamp).toLocaleString(),"]"]}),i.triggerTaskId&&He(Oe,{dimColor:!0,children:[" Task: ",i.triggerTaskId.slice(0,8)]}),i.diff.split(`
|
|
5
|
-
`).map((n,r)=>n.startsWith("+")?He(Oe,{color:"green",children:[" ",n]},r):n.startsWith("-")?He(Oe,{color:"red",children:[" ",n]},r):He(Oe,{dimColor:!0,children:[" ",n]},r))]},i.id))]})}import{Box as Je,Text as oe,useInput as yn}from"ink";import bn from"ink-text-input";import{useEffect as Sn,useState as vt}from"react";import{jsx as Ce,jsxs as me}from"react/jsx-runtime";var Cn={pending:"gray",planning:"cyan",executing:"yellow",evaluating:"blue",replanning:"magenta",completed:"green",failed:"red",paused:"gray"};function wn(e,t=20){let o=Math.round(e*t),c=t-o;return"\u2588".repeat(o)+"\u2591".repeat(c)}function Bn(e){let t=Math.max(0,Math.floor((e-Date.now())/864e5));return t===0?"< 1d":`${t}d`}function Jt({onBack:e}){let[t,o]=vt([]),[c,u]=vt(null),[m,l]=vt("list"),[i,n]=vt(""),[r,a]=vt(!1),[d,b]=vt(null);yn((s,g)=>{if(m==="create"){g.escape&&(l("list"),n(""),b(null));return}(g.escape||s==="q")&&e(),s==="c"&&(l("create"),b(null)),s==="r"&&p()});let p=()=>{v("/goals?limit=20").then(({goals:s})=>o(s)).catch(s=>u(s.message))};Sn(()=>{p()},[]);let y=async s=>{if(s.trim()){a(!0),b(null);try{let g=await v("/goals",{method:"POST",body:{input:s.trim()}});b(`Goal created: ${g.goal.name}`),n(""),l("list"),p()}catch(g){b(`Failed: ${g instanceof Error?g.message:String(g)}`)}finally{a(!1)}}};return c?me(Je,{flexDirection:"column",children:[me(oe,{color:"red",children:["Failed to load goals: ",c]}),Ce(oe,{dimColor:!0,children:"Press Esc or q to return"})]}):m==="create"?me(Je,{flexDirection:"column",children:[Ce(oe,{bold:!0,children:"Create Goal"}),Ce(oe,{dimColor:!0,children:"Describe your SMART goal in natural language:"}),me(Je,{marginTop:1,children:[Ce(oe,{color:"cyan",children:"> "}),Ce(bn,{value:i,onChange:n,onSubmit:y})]}),r&&Ce(oe,{color:"yellow",children:"Creating goal..."}),d&&Ce(oe,{color:d.startsWith("Failed")?"red":"green",children:d}),Ce(oe,{dimColor:!0,children:"Press Esc to cancel"})]}):me(Je,{flexDirection:"column",children:[me(oe,{bold:!0,children:["Goal Dashboard (",t.length,")"]}),t.length===0?Ce(oe,{dimColor:!0,children:"No goals found. Press c to create one."}):Ce(Je,{marginTop:1,flexDirection:"column",children:t.map(s=>{let g=s.targetValue>0?s.currentValue/s.targetValue:0,_=Cn[s.status]??"white";return me(Je,{marginBottom:1,flexDirection:"column",children:[me(Je,{children:[Ce(oe,{bold:!0,color:_,children:s.name}),me(oe,{dimColor:!0,children:[" (",s.role,")"]}),Ce(oe,{dimColor:!0,children:" \u2014 "}),Ce(oe,{color:_,children:s.status})]}),me(Je,{children:[me(oe,{dimColor:!0,children:[" ",wn(g)," "]}),me(oe,{color:g>=1?"green":"white",children:[Math.round(g*100),"%"]}),me(oe,{dimColor:!0,children:[" (",s.currentValue,"/",s.targetValue," ",s.metricType,")"]})]}),me(Je,{children:[me(oe,{dimColor:!0,children:[" \u23F0 ",Bn(s.deadline)," left"]}),me(oe,{dimColor:!0,children:[" | \u{1F4B0} $",s.budgetUsd]}),me(oe,{dimColor:!0,children:[" | ID: ",s.id.slice(0,8)]})]})]},s.id)})}),Ce(oe,{dimColor:!0,children:"c:create r:refresh Esc/q:back"})]})}import{Box as yt,Text as Ae,useInput as En}from"ink";import{useEffect as In,useState as sr}from"react";import{jsx as et,jsxs as Ze}from"react/jsx-runtime";function kn(e,t,o=15){let c=e/(e+t),u=Math.round(c*o);return"\u2593".repeat(u)+"\u2591".repeat(o-u)}function ir({onBack:e}){let[t,o]=sr([]),[c,u]=sr(null);if(En((l,i)=>{(i.escape||l==="q")&&e()}),In(()=>{v("/strategies?limit=50").then(l=>o(l.strategies??[])).catch(l=>u(l.message))},[]),c)return Ze(yt,{flexDirection:"column",children:[Ze(Ae,{color:"red",children:["Failed to load strategies: ",c]}),et(Ae,{dimColor:!0,children:"Press Esc or q to return"})]});if(t.length===0)return Ze(yt,{flexDirection:"column",children:[et(Ae,{dimColor:!0,children:"No strategies yet. Strategies are created when goals are executed."}),et(Ae,{dimColor:!0,children:"Press Esc or q to return"})]});let m=new Map;for(let l of t){let i=`${l.role}/${l.taskType}`,n=m.get(i)??[];n.push(l),m.set(i,n)}return Ze(yt,{flexDirection:"column",children:[et(Ae,{bold:!0,children:"Strategy Lab"}),et(Ae,{dimColor:!0,children:"Thompson Sampling populations \u2014 higher bar = higher selection probability"}),et(yt,{marginTop:1,flexDirection:"column",children:Array.from(m.entries()).map(([l,i])=>Ze(yt,{marginBottom:1,flexDirection:"column",children:[et(Ae,{bold:!0,color:"cyan",children:l}),i.sort((n,r)=>{let a=n.alpha/(n.alpha+n.beta);return r.alpha/(r.alpha+r.beta)-a}).map(n=>{let r=n.alpha/(n.alpha+n.beta);return Ze(yt,{children:[et(Ae,{dimColor:!0,children:" "}),Ze(Ae,{children:[kn(n.alpha,n.beta)," "]}),Ze(Ae,{color:r>.6?"green":r>.4?"yellow":"red",children:[(r*100).toFixed(0),"%"]}),Ze(Ae,{dimColor:!0,children:[" ",n.name," (\u03B1=",n.alpha.toFixed(1)," \u03B2=",n.beta.toFixed(1)," trials=",n.totalTrials,")"]})]},n.id)})]},l))}),et(Ae,{dimColor:!0,children:"Press Esc or q to return"})]})}import{Box as Ee,Text as Z,useInput as Mn}from"ink";import To from"ink-text-input";import{useEffect as Nn,useState as tt,useCallback as bt}from"react";import{CronExpressionParser as Ln}from"cron-parser";import{useState as Pn,useEffect as An,useCallback as ar,useRef as Dn}from"react";var Rn=3e3;function ct(){let[e,t]=Pn(null),o=Dn(null),c=ar(()=>{o.current&&(clearTimeout(o.current),o.current=null),t(null)},[]),u=ar((m,l)=>{o.current&&(clearTimeout(o.current),o.current=null),t({text:m,type:l}),l==="success"&&(o.current=setTimeout(()=>{t(null),o.current=null},Rn))},[]);return An(()=>()=>{o.current&&clearTimeout(o.current)},[]),{message:e,setMessage:u,clearMessage:c}}import{jsx as ee,jsxs as xe}from"react/jsx-runtime";var ho=["manual","cron","event"],Zt={name:"",triggerType:"manual",cron:"",stepPrompt:""};function _n(e){try{return Ln.parse(e).next().toDate().toLocaleString()}catch{return"invalid"}}function to({onBack:e}){let[t,o]=tt([]),[c,u]=tt(!0),[m,l]=tt(0),[i,n]=tt("list"),[r,a]=tt({...Zt}),[d,b]=tt("name"),[p,y]=tt(null),{message:s,setMessage:g,clearMessage:_}=ct(),[M,Y]=tt(!1),[H,O]=tt(!1),X=bt(()=>{u(!0),v("/task-templates").then(({templates:C})=>{o(C),u(!1)}).catch(()=>u(!1))},[]);Nn(()=>{X()},[X]);let I=i==="create"||i==="edit",P=bt(async()=>{let C=t[m];if(!(!C||M)){Y(!0),g(`Triggering ${C.name}...`,"loading");try{let E=await v(`/task-templates/${C.id}/run`,{method:"POST"});g(`Triggered: ${C.name} (${E.executionId})`,"success")}catch(E){g(`Trigger failed: ${E instanceof Error?E.message:String(E)}`,"error")}finally{Y(!1)}}},[t,m,M,g]),S=bt(async()=>{let C=t[m];if(!C||H)return;if(C.trigger?.type!=="cron"&&C.trigger?.type!=="event"){g("Toggle not applicable for manual triggers","error");return}let E=!C.enabled;O(!0),g(`${C.name} \u2192 ${E?"enabling":"disabling"}...`,"loading");try{await v(`/task-templates/${C.id}`,{method:"PATCH",body:{enabled:E}}),o(R=>R.map(pe=>pe.id===C.id?{...pe,enabled:E}:pe)),g(`${C.name} ${E?"enabled":"disabled"}`,"success")}catch(R){g(`Toggle failed: ${R instanceof Error?R.message:String(R)}`,"error")}finally{O(!1)}},[t,m,H,g]),j=bt(async()=>{let C=t[m];if(C)try{await v(`/task-templates/${C.id}`,{method:"DELETE"}),g(`Deleted: ${C.name}`,"success"),X(),l(E=>Math.max(0,Math.min(E,t.length-2)))}catch(E){g(`Delete failed: ${E instanceof Error?E.message:String(E)}`,"error")}},[t,m,X]),J=bt(()=>{let C=t[m];C&&(y(C.id),a({name:C.name,triggerType:C.trigger?.type??"manual",cron:C.trigger?.cron??"",stepPrompt:C.steps?.[0]?.prompt??""}),b("name"),n("edit"))},[t,m]),Re=bt(async()=>{let C={name:r.name,trigger:{type:r.triggerType,...r.triggerType==="cron"?{cron:r.cron}:{}},steps:[{id:"step-1",prompt:r.stepPrompt}],enabled:!0};try{i==="create"?(await v("/task-templates",{method:"POST",body:C}),g(`Created: ${r.name}`,"success")):i==="edit"&&p&&(await v(`/task-templates/${p}`,{method:"PATCH",body:C}),g(`Updated: ${r.name}`,"success"))}catch(E){g(`Save failed: ${E instanceof Error?E.message:String(E)}`,"error")}n("list"),a({...Zt}),y(null),X()},[r,i,p,X]);return Mn((C,E)=>{if(I){if(E.escape){n("list"),a({...Zt}),y(null);return}if(E.return){let R=["name","triggerType","cron","stepPrompt"],pe=R.indexOf(d);if(pe<R.length-1){let ce=pe+1;if(R[ce]==="cron"&&r.triggerType!=="cron"&&ce++,ce<R.length){b(R[ce]);return}}Re();return}if(E.tab&&d==="triggerType"){a(R=>{let pe=ho.indexOf(R.triggerType);return{...R,triggerType:ho[(pe+1)%ho.length]}});return}return}if(E.escape||C==="q"){e();return}if(E.upArrow){l(R=>Math.max(0,R-1));return}if(E.downArrow){l(R=>Math.min(t.length-1,R+1));return}if(C==="t"){P();return}if(C==="d"){j();return}if(C==="e"){J();return}if(C==="c"){a({...Zt}),b("name"),n("create");return}if(C==="s"||C===" "){S();return}C==="r"&&(X(),_())}),c?ee(Z,{dimColor:!0,children:"Loading templates..."}):I?xe(Ee,{flexDirection:"column",children:[xe(Z,{bold:!0,children:[i==="create"?"Create Template":"Edit Template"," (Esc to cancel)"]}),xe(Ee,{marginTop:1,flexDirection:"column",children:[xe(Ee,{children:[xe(Z,{bold:d==="name",color:d==="name"?"cyan":void 0,children:["Name:"," "]}),d==="name"?ee(To,{value:r.name,onChange:C=>a(E=>({...E,name:C})),placeholder:"template name"}):ee(Z,{children:r.name||"(empty)"})]}),xe(Ee,{children:[xe(Z,{bold:d==="triggerType",color:d==="triggerType"?"cyan":void 0,children:["Trigger:"," "]}),ee(Z,{children:r.triggerType}),d==="triggerType"&&ee(Z,{dimColor:!0,children:" (Tab to cycle, Enter to continue)"})]}),r.triggerType==="cron"&&xe(Ee,{children:[xe(Z,{bold:d==="cron",color:d==="cron"?"cyan":void 0,children:["Cron:"," "]}),d==="cron"?ee(To,{value:r.cron,onChange:C=>a(E=>({...E,cron:C})),placeholder:"*/5 * * * *"}):ee(Z,{children:r.cron||"(empty)"})]}),xe(Ee,{children:[xe(Z,{bold:d==="stepPrompt",color:d==="stepPrompt"?"cyan":void 0,children:["Step Prompt:"," "]}),d==="stepPrompt"?ee(To,{value:r.stepPrompt,onChange:C=>a(E=>({...E,stepPrompt:C})),placeholder:"What should this template do?"}):ee(Z,{children:r.stepPrompt||"(empty)"})]})]}),ee(Ee,{marginTop:1,children:ee(Z,{dimColor:!0,children:"Enter: next field / submit | Esc: cancel"})})]}):xe(Ee,{flexDirection:"column",children:[xe(Z,{bold:!0,children:["Automations (",t.length,") (Esc to go back)"]}),s&&ee(Ee,{marginTop:1,children:xe(Z,{color:s.type==="success"?"green":s.type==="error"?"red":"gray",children:[s.type==="success"?"\u2713 ":s.type==="error"?"\u2717 ":"\u2192 ",s.text]})}),t.length===0?ee(Ee,{marginTop:1,children:ee(Z,{dimColor:!0,children:"No templates found. Press c to create one."})}):ee(Ee,{marginTop:1,flexDirection:"column",children:t.map((C,E)=>{let R=E===m,pe=C.trigger?.type==="cron"&&C.trigger?.cron?_n(C.trigger.cron):"";return xe(Ee,{children:[ee(Z,{color:R?"cyan":void 0,bold:R,children:R?"> ":" "}),ee(Z,{color:R?"cyan":void 0,bold:R,children:eo(C.name,24)}),ee(Z,{dimColor:!0,children:eo(C.trigger?.type,10)}),C.trigger?.type!=="cron"&&C.trigger?.type!=="event"?ee(Z,{dimColor:!0,children:eo("\u2014",6)}):ee(Z,{color:C.enabled?"green":"gray",children:eo(C.enabled?"on":"off",6)}),pe&&xe(Z,{dimColor:!0,children:["next: ",pe]})]},C.id)})}),ee(Ee,{marginTop:1,children:ee(Z,{dimColor:!0,children:"t:trigger s:toggle d:delete e:edit c:create r:refresh"})})]})}function eo(e,t){return e?e.length>=t?e:e+" ".repeat(t-e.length):" ".repeat(t)}import{Box as dt,Text as Ie,useInput as Vn}from"ink";import $n from"ink-text-input";import{useEffect as On,useState as St,useCallback as lr}from"react";import{jsx as ye,jsxs as gt}from"react/jsx-runtime";function cr({onBack:e}){let[t,o]=St([]),[c,u]=St(""),[m,l]=St(!0),[i,n]=St(!1),[r,a]=St(""),[d,b]=St(null),p=lr(()=>{l(!0),v("/webhooks").then(({webhooks:s,auth:g})=>{o(s),u(g),l(!1)}).catch(()=>l(!1))},[]);On(()=>{p()},[p]);let y=lr(async s=>{if(s.trim())try{let g=await v(`/webhooks/${encodeURIComponent(s.trim())}`,{method:"POST"});b(`Triggered: ${g.executionId}`)}catch(g){b(`Trigger failed: ${g instanceof Error?g.message:String(g)}`)}},[]);return Vn((s,g)=>{if(i){if(g.escape){n(!1),a("");return}if(g.return){y(r),n(!1),a("");return}return}if(g.escape||s==="q"){e();return}if(s==="t"){n(!0),a(""),b(null);return}s==="r"&&(p(),b(null))}),m?ye(Ie,{dimColor:!0,children:"Loading webhooks..."}):gt(dt,{flexDirection:"column",children:[gt(Ie,{bold:!0,children:["Webhooks (",t.length,") (Esc to go back)"]}),gt(Ie,{dimColor:!0,children:["Auth: ",c]}),d&&ye(dt,{marginTop:1,children:ye(Ie,{color:"yellow",children:d})}),i&>(dt,{marginTop:1,children:[ye(Ie,{bold:!0,color:"cyan",children:"Trigger webhook: "}),ye($n,{value:r,onChange:a,placeholder:"webhook name or ID"}),ye(Ie,{dimColor:!0,children:" (Enter to trigger, Esc to cancel)"})]}),t.length===0?ye(dt,{marginTop:1,children:ye(Ie,{dimColor:!0,children:"No webhooks available. Create templates with triggers to expose webhooks."})}):gt(dt,{marginTop:1,flexDirection:"column",children:[ye(dt,{children:gt(Ie,{bold:!0,children:[Ct("NAME",24),Ct("DESCRIPTION",36),Ct("TRIGGER",28),"TAGS"]})}),t.map(s=>gt(dt,{children:[ye(Ie,{children:Ct(s.displayName,24)}),ye(Ie,{dimColor:!0,children:Ct(qn(s.description??"",34),36)}),ye(Ie,{dimColor:!0,children:Ct(s.trigger,28)}),ye(Ie,{dimColor:!0,children:s.tags?.join(", ")??""})]},s.name))]}),ye(dt,{marginTop:1,children:ye(Ie,{dimColor:!0,children:"t:trigger r:refresh"})})]})}function Ct(e,t){return e?e.length>=t?e:e+" ".repeat(t-e.length):" ".repeat(t)}function qn(e,t){return e.length<=t?e:e.slice(0,t-3)+"..."}import{Box as Ke,Text as ae,useInput as Fn}from"ink";import Un from"ink-text-input";import{useEffect as dr,useState as ot,useCallback as vo}from"react";import{jsx as le,jsxs as qe}from"react/jsx-runtime";function Wn(e){return e>=4?"red":e===3?"yellow":"gray"}function Gn(e){return e>=4?"HIGH":e===3?"MED ":"LOW "}function Hn(e){return new Date(e).toLocaleDateString()}function mr({onBack:e}){let[t,o]=ot([]),[c,u]=ot(0),[m,l]=ot([]),[i,n]=ot(!0),[r,a]=ot(!1),[d,b]=ot(""),[p,y]=ot("all"),[s,g]=ot(null),[_,M]=ot(!1),Y=vo(()=>{v("/agents").then(({agents:S})=>{o(S),n(!1)}).catch(()=>n(!1))},[]);dr(()=>{Y()},[Y]);let H=t[c],O=vo(()=>{H&&(M(!1),v(`/memories/${H.id}`).then(({memories:S})=>{l(S),g(null)}).catch(S=>g(`Failed: ${S instanceof Error?S.message:String(S)}`)))},[H]);dr(()=>{H&&O()},[H,O]);let X=vo(async S=>{if(!(!H||!S.trim()))try{let j=await v("/memories/query",{method:"POST",body:{agentId:H.id,prompt:S.trim()}});l(j.memories),M(!0),g(`Search: ${j.count} results`)}catch(j){g(`Search failed: ${j instanceof Error?j.message:String(j)}`)}},[H]),I=r,P=m.filter(S=>p==="all"?!0:p==="high"?S.importance>3:p==="medium"?S.importance===3:S.importance<3);return Fn((S,j)=>{if(I){if(j.escape){a(!1),b("");return}if(j.return){X(d),a(!1),b("");return}return}if(j.escape||S==="q"){e();return}if(S==="a"){u(J=>(J+1)%Math.max(1,t.length));return}if(j.leftArrow){u(J=>(J-1+t.length)%Math.max(1,t.length));return}if(j.rightArrow){u(J=>(J+1)%Math.max(1,t.length));return}if(S==="s"){a(!0),b(""),g(null);return}if(S==="h"){y(J=>J==="high"?"all":"high");return}if(S==="m"){y(J=>J==="medium"?"all":"medium");return}if(S==="l"){y(J=>J==="low"?"all":"low");return}S==="r"&&O()}),i?le(ae,{dimColor:!0,children:"Loading agents..."}):t.length===0?qe(Ke,{flexDirection:"column",children:[le(ae,{dimColor:!0,children:"No agents found"}),le(ae,{dimColor:!0,children:"Press Esc to go back"})]}):qe(Ke,{flexDirection:"column",children:[le(ae,{bold:!0,children:"Memories (Esc to go back)"}),qe(Ke,{marginTop:1,children:[le(ae,{children:"Agent: "}),le(ae,{bold:!0,color:"cyan",children:H?.name??"?"}),qe(ae,{dimColor:!0,children:[" (",c+1,"/",t.length,") [a/arrows to switch]"]})]}),le(Ke,{children:qe(ae,{dimColor:!0,children:["Filter: ",p==="all"?"all":p," | ",_?"search results":"all memories"," (",P.length,")"]})}),s&&le(Ke,{children:le(ae,{color:"yellow",children:s})}),r&&qe(Ke,{marginTop:1,children:[le(ae,{bold:!0,color:"cyan",children:"Search: "}),le(Un,{value:d,onChange:b,placeholder:"search query..."}),le(ae,{dimColor:!0,children:" (Enter to search, Esc to cancel)"})]}),P.length===0?le(Ke,{marginTop:1,children:qe(ae,{dimColor:!0,children:["No memories",p!=="all"?` matching filter '${p}'`:""]})}):le(Ke,{marginTop:1,flexDirection:"column",children:P.map(S=>qe(Ke,{marginBottom:0,children:[qe(ae,{color:Wn(S.importance),bold:!0,children:[Gn(S.importance)," "]}),le(ae,{dimColor:!0,children:ur(S.type??"?",12)}),le(ae,{dimColor:!0,children:ur(`\xD7${S.retrievedCount??0}`,5)}),qe(ae,{children:[Kn(S.content,55)," "]}),le(ae,{dimColor:!0,children:Hn(S.createdAt)}),S.score!==void 0&&qe(ae,{dimColor:!0,children:[" (",S.score.toFixed(2),")"]})]},S.id))}),le(Ke,{marginTop:1,children:le(ae,{dimColor:!0,children:"s:search h:high m:medium l:low a:agent r:refresh"})})]})}function ur(e,t){return e?e.length>=t?e:e+" ".repeat(t-e.length):" ".repeat(t)}function Kn(e,t){return e.length<=t?e:e.slice(0,t-3)+"..."}import{Box as Fe,Text as re,useInput as jn}from"ink";import oo from"ink-text-input";import{useState as we,useEffect as gr,useCallback as yo}from"react";import{jsx as ge,jsxs as ue}from"react/jsx-runtime";var fr={Anthropic:["anthropic.apiKey","anthropic.baseUrl","anthropic.model","anthropic.defaultOpusModel","anthropic.defaultSonnetModel","anthropic.defaultHaikuModel","anthropic.smallFastModel"],Defaults:["defaults.model","defaults.effort","defaults.maxTurns","defaults.maxBudgetUsd","defaults.timeout","defaults.approvalTimeout"],Server:["server.port","server.host","server.apiKey","server.timezone"],Logging:["logging.level"],Evolution:["roles.evolution.triggerEvery","roles.evolution.reflectionThreshold"],Chat:["chat.sessionTimeoutMinutes","chat.maxSessionTurns","chat.autoTitle","chat.archiveExtractMemory"]},Qn={"anthropic.apiKey":"API Key","anthropic.baseUrl":"Base URL","anthropic.model":"Model","anthropic.defaultOpusModel":"Default Opus","anthropic.defaultSonnetModel":"Default Sonnet","anthropic.defaultHaikuModel":"Default Haiku","anthropic.smallFastModel":"Small Fast","defaults.model":"Default Model","defaults.effort":"Effort","defaults.maxTurns":"Max Turns","defaults.maxBudgetUsd":"Max Budget (USD)","defaults.timeout":"Timeout (sec)","defaults.approvalTimeout":"Approval Timeout (sec)","server.port":"Port","server.host":"Host","server.apiKey":"API Key","server.timezone":"Timezone","logging.level":"Log Level","roles.evolution.triggerEvery":"Evolution Trigger Every","chat.sessionTimeoutMinutes":"Session Timeout (min)","chat.maxSessionTurns":"Max Session Turns","chat.autoTitle":"Auto Title","chat.archiveExtractMemory":"Archive Extract Memory","roles.evolution.reflectionThreshold":"Reflection Threshold"};function pr({onBack:e}){let{state:t}=st(),[o,c]=we({}),[u,m]=we([]),[l,i]=we(null),[n,r]=we("view"),[a,d]=we(0),[b,p]=we(""),[y,s]=we(null),[g,_]=we(!1),[M,Y]=we([]),[H,O]=we({}),[X,I]=we(0),[P,S]=we(""),[j,J]=we(""),[Re,C]=we(""),E=Object.values(fr).flat(),R=yo(()=>{v("/config").then(D=>{c(D.config),m(D.mutable)}).catch(D=>i(D.message)),v("/config/env-diff").then(D=>{Y(D.diffs)}).catch(()=>{}),v("/config/env").then(D=>O(D.env??{})).catch(()=>{})},[]);gr(()=>{R()},[R]),gr(()=>{t.configVersion>0&&R()},[t.configVersion,R]);let pe=yo(async()=>{let D=E[a];if(D){_(!0),s(null);try{let $=b,q=o[D];if(q&&typeof q.value=="number"&&($=Number(b),isNaN($))){s("Invalid number"),_(!1);return}let ne=await v("/config",{method:"PATCH",body:{[D]:$}});ne.updated.length>0&&(s(`Updated: ${D}`),R()),ne.errors.length>0&&s(ne.errors[0]),r("view")}catch($){s(`Failed: ${$ instanceof Error?$.message:String($)}`)}finally{_(!1)}}},[E,a,b,o,R]),ce=Object.keys(H),je=yo(async D=>{try{await v("/config/env",{method:"PUT",body:D}),s("Env vars saved"),R()}catch($){s(`Failed: ${$ instanceof Error?$.message:String($)}`)}},[R]);if(jn((D,$)=>{if(n==="edit"){if($.escape){r("view");return}return}if(n==="env-list"){if($.escape){r("view");return}if($.upArrow&&X>0&&I(q=>q-1),$.downArrow&&X<ce.length-1&&I(q=>q+1),D==="a"){S(""),r("env-add-key");return}if(D==="d"&&ce.length>0){let q=ce[X],ne={...H};delete ne[q],je(ne),X>=ce.length-1&&X>0&&I(Qe=>Qe-1);return}if($.return&&ce.length>0){C(H[ce[X]]??""),r("env-edit-value");return}return}if(n==="env-add-key"){if($.escape){r("env-list");return}return}if(n==="env-add-value"){if($.escape){r("env-list");return}return}if(n==="env-edit-value"){if($.escape){r("env-list");return}return}if($.escape||D==="q"){e();return}if($.upArrow&&a>0&&d(q=>q-1),$.downArrow&&a<E.length-1&&d(q=>q+1),$.return||D==="e"){let q=E[a],ne=o[q];ne&&ne.mutable?(p(String(ne.value??"")),r("edit"),s(null)):ne&&!ne.mutable&&s("This setting requires a restart to change")}D==="v"&&(I(0),r("env-list"),s(null)),D==="r"&&(R(),s("Refreshed")),D==="s"&&M.length>0&&v("/config/sync-to-env",{method:"POST"}).then(()=>{s("Synced to .env"),Y([]),R()}),D==="l"&&M.length>0&&v("/config/load-from-env",{method:"POST"}).then(()=>{s("Loaded from .env"),R()})}),l)return ue(Fe,{flexDirection:"column",children:[ue(re,{color:"red",children:["Failed to load config: ",l]}),ge(re,{dimColor:!0,children:"Press Esc or q to return"})]});let pt=0;return ue(Fe,{flexDirection:"column",children:[ge(re,{bold:!0,children:"Settings"}),y&&ge(re,{color:y.startsWith("Failed")||y.startsWith("This setting")?"yellow":"green",children:y}),M&&M.length>0&&ue(Fe,{flexDirection:"column",marginBottom:1,children:[ue(re,{color:"yellow",children:[".env differs from DB (",M.length," key(s)): ",M.map(D=>D.envKey).join(", ")]}),ge(re,{dimColor:!0,children:"s:sync DB\u2192.env l:load .env\u2192DB"})]}),ge(Fe,{marginTop:1,flexDirection:"column",children:Object.entries(fr).map(([D,$])=>ue(Fe,{marginBottom:1,flexDirection:"column",children:[ge(re,{bold:!0,color:"cyan",children:D}),$.map(q=>{let ne=o[q],xt=pt++===a,Tt=u.includes(q),Ft=Qn[q]??q,Xe=ne?String(ne.value??""):"...";return n==="edit"&&xt?ue(Fe,{children:[ue(re,{color:"cyan",children:["> ",Ft,": "]}),ge(oo,{value:b,onChange:p,onSubmit:()=>{pe()}}),g&&ge(re,{color:"yellow",children:" saving..."})]},q):ue(Fe,{children:[ue(re,{color:xt?"cyan":"white",children:[xt?"> ":" ",Tt?" ":"\u{1F512} ",Ft,": "," "]}),ge(re,{color:Tt?"white":"gray",children:Xe}),!Tt&&ge(re,{dimColor:!0,children:" (restart required)"})]},q)})]},D))}),ge(re,{dimColor:!0,children:"Enter/e:edit v:env vars r:refresh Esc/q:back"}),n.startsWith("env")&&ue(Fe,{flexDirection:"column",marginTop:1,children:[ue(re,{bold:!0,color:"cyan",children:["Environment Variables (",ce.length,")"]}),ce.length===0&&n==="env-list"&&ge(re,{dimColor:!0,children:" No env vars. Press a to add."}),ce.map((D,$)=>{let q=$===X;return n==="env-edit-value"&&q?ue(Fe,{children:[ue(re,{color:"cyan",children:["> ",D," = "]}),ge(oo,{value:Re,onChange:C,onSubmit:()=>{je({...H,[D]:Re}),r("env-list")}})]},D):ue(re,{color:q&&n==="env-list"?"cyan":"white",children:[q&&n==="env-list"?"> ":" ",D," = ",H[D]]},D)}),n==="env-add-key"&&ue(Fe,{children:[ge(re,{color:"green",children:" New key: "}),ge(oo,{value:P,onChange:S,onSubmit:()=>{P.trim()&&(J(""),r("env-add-value"))}})]}),n==="env-add-value"&&ue(Fe,{children:[ue(re,{color:"green",children:[" ",P," = "]}),ge(oo,{value:j,onChange:J,onSubmit:()=>{je({...H,[P.trim()]:j}),r("env-list")}})]}),ge(re,{dimColor:!0,children:"a:add Enter:edit d:delete Esc:back"})]})]})}import{Box as ft,Text as be,useInput as Xn}from"ink";import{useEffect as zn,useState as bo,useCallback as Yn}from"react";import{jsx as Te,jsxs as Bt}from"react/jsx-runtime";function xr({onBack:e}){let[t,o]=bo([]),[c,u]=bo(!0),[m,l]=bo(0),{message:i,setMessage:n,clearMessage:r}=ct(),a=Yn(()=>{u(!0),v("/plugins").then(({plugins:d})=>{o(d),u(!1)}).catch(()=>u(!1))},[]);return zn(()=>{a()},[a]),Xn((d,b)=>{if(b.escape||d==="q"){e();return}if(b.upArrow){l(p=>Math.max(0,p-1));return}if(b.downArrow){l(p=>Math.min(t.length-1,p+1));return}d==="r"&&(a(),r())}),c?Te(be,{dimColor:!0,children:"Loading plugins..."}):Bt(ft,{flexDirection:"column",children:[Bt(be,{bold:!0,children:["Plugins (",t.length,") (Esc to go back)"]}),i&&Te(ft,{marginTop:1,children:Bt(be,{color:i.type==="success"?"green":i.type==="error"?"red":"gray",children:[i.type==="success"?"\u2713 ":i.type==="error"?"\u2717 ":"\u2192 ",i.text]})}),t.length===0?Te(ft,{marginTop:1,children:Te(be,{dimColor:!0,children:"No plugins installed."})}):Bt(ft,{marginTop:1,flexDirection:"column",children:[Bt(ft,{children:[Te(be,{dimColor:!0,children:" "}),Te(be,{dimColor:!0,children:wt("Name",24)}),Te(be,{dimColor:!0,children:wt("Scope",8)}),Te(be,{dimColor:!0,children:wt("User",6)}),Te(be,{dimColor:!0,children:"Path"})]}),t.map((d,b)=>{let p=b===m,y=d.id.split("@")[0];return Bt(ft,{children:[Te(be,{color:p?"cyan":void 0,bold:p,children:p?"> ":" "}),Te(be,{color:p?"cyan":void 0,bold:p,children:wt(y,24)}),Te(be,{color:p?"cyan":void 0,bold:p,children:wt(d.scope,8)}),Te(be,{color:d.globalEnabled?"green":"gray",children:wt(d.globalEnabled?"on":"off",6)}),Te(be,{dimColor:!0,children:d.installPath})]},d.id)})]}),Te(ft,{marginTop:1,children:Te(be,{dimColor:!0,children:"r:refresh"})})]})}function wt(e,t){return e?e.length>=t?e:e+" ".repeat(t-e.length):" ".repeat(t)}import{Box as ro,Text as Tr,useInput as Jn}from"ink";import{useState as Zn}from"react";import{jsx as Et,jsxs as So}from"react/jsx-runtime";var es=[{key:"1",id:"tasks",label:"Tasks"},{key:"2",id:"automations",label:"Automations"},{key:"3",id:"goals",label:"Goals"}];function hr({onBack:e}){let[t,o]=Zn("tasks");return Jn((c,u)=>{if(u.escape||c==="q"){e();return}if(c==="1"){o("tasks");return}if(c==="2"){o("automations");return}if(c==="3"){o("goals");return}}),So(ro,{flexDirection:"column",children:[So(ro,{gap:1,marginBottom:1,children:[es.map(c=>{let u=t===c.id;return Et(ro,{children:So(Tr,{color:u?"cyan":"gray",bold:u,underline:u,children:["[",c.key,":",c.label,"]"]})},c.id)}),Et(ro,{flexGrow:1}),Et(Tr,{dimColor:!0,children:"Esc: back"})]}),t==="tasks"&&Et(zt,{onBack:e}),t==="automations"&&Et(to,{onBack:e}),t==="goals"&&Et(Jt,{onBack:e})]})}import{Box as z,Text as W,useInput as ts}from"ink";import{useEffect as os,useState as $t}from"react";import{jsx as N,jsxs as fe}from"react/jsx-runtime";var vr={connected:"green",connecting:"yellow",disconnected:"gray",error:"red"};function yr({onBack:e}){let[t,o]=$t([]),[c,u]=$t(!0),[m,l]=$t(0),[i,n]=$t(null),[r,a]=$t("");os(()=>{d()},[]);async function d(){try{let y=await v("/channels");o(y.channels)}catch{}u(!1)}async function b(y){if(t.find(g=>g.id===y)?.platform==="wechat")try{a("Starting WeChat QR login...");let g=await v(`/channels/${y}/wechat/qr-start`,{method:"POST"});if(g.qrcodeUrl){a(`Scan QR: ${g.qrcodeUrl}
|
|
6
|
-
Waiting for scan...`);let _=await v(`/channels/${y}/wechat/qr-wait`,{method:"POST",body:{sessionKey:g.sessionKey,timeoutMs:12e4}});a(_.message)}else a(g.message);d()}catch{a("WeChat connect failed")}else try{await v(`/channels/${y}/connect`,{method:"POST"}),a("Connecting..."),d()}catch{a("Connect failed")}}async function p(y){try{await v(`/channels/${y}/disconnect`,{method:"POST"}),a("Disconnected"),d()}catch{a("Disconnect failed")}}return ts((y,s)=>{if(i){if(s.escape||y==="q"){n(null);return}if(y==="c"){b(i.id);return}if(y==="d"){p(i.id);return}return}if(s.escape){e();return}if(s.upArrow){l(g=>Math.max(0,g-1));return}if(s.downArrow){l(g=>Math.min(t.length-1,g+1));return}if(s.return&&t[m]){n(t[m]),a("");return}}),c?N(z,{flexDirection:"column",children:N(W,{dimColor:!0,children:"Loading channels..."})}):i?fe(z,{flexDirection:"column",children:[fe(z,{marginBottom:1,children:[fe(W,{bold:!0,children:["Channel: ",i.name]}),N(W,{dimColor:!0,children:" (Esc to go back)"})]}),fe(z,{flexDirection:"column",gap:0,children:[fe(W,{children:["ID: ",i.id]}),fe(W,{children:["Platform: ",i.platform]}),fe(W,{children:["Status: ",N(W,{color:vr[i.status]??"white",children:i.status})]}),fe(W,{children:["Enabled: ",i.enabled?"yes":"no"]}),fe(W,{children:["Messages: ",i.messageCount]}),fe(W,{children:["Config: ",JSON.stringify(i.config)]})]}),N(z,{marginTop:1,children:N(W,{dimColor:!0,children:"[c] Connect [d] Disconnect [Esc] Back"})}),r&&N(W,{color:"yellow",children:r})]}):fe(z,{flexDirection:"column",children:[fe(z,{marginBottom:1,children:[N(W,{bold:!0,children:"Channels"}),fe(W,{dimColor:!0,children:[" (",t.length," total) "]}),N(W,{dimColor:!0,children:"Arrow keys to select, Enter for detail, Esc to return"})]}),t.length===0?N(W,{dimColor:!0,children:"No channels configured. Add channels via API or config."}):fe(z,{flexDirection:"column",children:[fe(z,{children:[N(z,{width:3,children:N(W,{dimColor:!0,children:" "})}),N(z,{width:12,children:N(W,{bold:!0,dimColor:!0,children:"ID"})}),N(z,{width:16,children:N(W,{bold:!0,dimColor:!0,children:"Name"})}),N(z,{width:12,children:N(W,{bold:!0,dimColor:!0,children:"Platform"})}),N(z,{width:14,children:N(W,{bold:!0,dimColor:!0,children:"Status"})}),N(z,{width:10,children:N(W,{bold:!0,dimColor:!0,children:"Enabled"})}),N(z,{width:10,children:N(W,{bold:!0,dimColor:!0,children:"Messages"})})]}),t.map((y,s)=>fe(z,{children:[N(z,{width:3,children:N(W,{children:s===m?">":" "})}),N(z,{width:12,children:N(W,{inverse:s===m,children:y.id.slice(0,8)})}),N(z,{width:16,children:N(W,{children:y.name})}),N(z,{width:12,children:N(W,{children:y.platform})}),N(z,{width:14,children:fe(W,{color:vr[y.status]??"white",children:[y.status==="connected"?"\u25CF":y.status==="error"?"\u2717":"\u25CB"," ",y.status]})}),N(z,{width:10,children:N(W,{color:y.enabled?"green":"gray",children:y.enabled?"yes":"no"})}),N(z,{width:10,children:N(W,{children:y.messageCount})})]},y.id))]})]})}import{Box as kt,Text as nt,useInput as ns}from"ink";import{useEffect as ss,useState as Ot,useCallback as is}from"react";import{Box as A,Text as T,useInput as rs}from"ink";import rt from"ink-text-input";import{useEffect as br,useState as Q,useCallback as It}from"react";Do();import{Fragment as Sr,jsx as h,jsxs as B}from"react/jsx-runtime";function Cr({roleId:e,onBack:t}){let[o,c]=Q(null),[u,m]=Q([]),[l,i]=Q(!0),[n,r]=Q("view"),[a,d]=Q(""),[b,p]=Q(0),[y,s]=Q(""),[g,_]=Q([]),[M,Y]=Q(0),[H,O]=Q(new Set),[X,I]=Q("inline"),[P,S]=Q(""),[j,J]=Q(""),[Re,C]=Q([]),[E,R]=Q(new Set),[pe,ce]=Q(0),[je,pt]=Q("default"),[D,$]=Q(""),[q,ne]=Q(""),[Qe,xt]=Q("mode"),[Tt,Ft]=Q([]),[Xe,Ut]=Q(0),[Wt,Bo]=Q(""),[Eo,Io]=Q(""),[ko,Po]=Q(""),{message:V,setMessage:F}=ct(),se=It(()=>{i(!0),v(`/roles/${e}`).then(({role:f,boundPlugins:w})=>{c(f),m(w??[]),d(f.cagPrompt??""),O(new Set(f.allowedTools??[])),I(f.executionMode??"inline"),S(f.model??""),J(f.maxBudgetUsd!=null?String(f.maxBudgetUsd):""),i(!1)}).catch(()=>i(!1))},[e]);br(()=>{se(),v("/config").then(f=>{let w=f["defaults.deniedReadPaths"]?.value;Array.isArray(w)&&Ft(w)}).catch(()=>{})},[se]),br(()=>{I(o?.executionMode??"inline"),S(o?.model??""),J(o?.maxBudgetUsd!=null?String(o?.maxBudgetUsd):""),pt(o?.permissionMode??"default"),$((o?.allowedBashPatterns??[]).join(", ")),ne((o?.deniedBashPatterns??[]).join(", "))},[o?.id,o?.executionMode,o?.model,o?.maxBudgetUsd,o?.permissionMode,o?.allowedBashPatterns,o?.deniedBashPatterns]);let Br=It(async()=>{if(o)try{await v(`/roles/${o.id}`,{method:"PATCH",body:{cagPrompt:a}}),F("CAG prompt saved","success"),r("view"),se()}catch(f){F(`Save failed: ${f instanceof Error?f.message:String(f)}`,"error")}},[o,a,se,F]),Er=It(async()=>{if(o)try{await v(`/roles/${o.id}`,{method:"PATCH",body:{additionalDirectories:Me}}),F("Directories saved","success"),r("view"),se()}catch(f){F(`Save failed: ${f instanceof Error?f.message:String(f)}`,"error")}},[o,se,F]),Ir=It(async()=>{if(o)try{await v(`/roles/${o.id}`,{method:"PATCH",body:{allowedTools:Array.from(H)}}),F("Tool permissions saved","success"),r("view"),se()}catch(f){F(`Save failed: ${f instanceof Error?f.message:String(f)}`,"error")}},[o,H,se,F]),kr=It(async()=>{if(!o)return;let f={executionMode:X};P!==void 0&&(f.model=P);let w=parseFloat(j);isNaN(w)||(f.maxBudgetUsd=w);try{await v(`/roles/${o.id}`,{method:"PATCH",body:f}),F("Execution config saved","success"),r("view"),se()}catch(x){F(`Save failed: ${x instanceof Error?x.message:String(x)}`,"error")}},[o,X,P,j,se,F]),Pr=It(async()=>{if(!o)return;let f={permissionMode:je},w=D.split(",").map(k=>k.trim()).filter(Boolean),x=q.split(",").map(k=>k.trim()).filter(Boolean);f.allowedBashPatterns=w.length>0?w:[],f.deniedBashPatterns=x.length>0?x:[];try{await v(`/roles/${o.id}`,{method:"PATCH",body:f}),F("Permission config saved","success"),r("view"),se()}catch(k){F(`Save failed: ${k instanceof Error?k.message:String(k)}`,"error")}},[o,je,D,q,se,F]),Me=o?.additionalDirectories??[];if(rs((f,w)=>{if(w.escape){r("view");return}if(f==="r"){se();return}switch(n){case"view":{if(f==="c"){r("edit-cag");return}if(f==="d"){r("edit-dirs"),p(0),s("");return}if(f==="t"){r("edit-tools");return}if(f==="x"){r("edit-exec");return}if(f==="h"){v("/channels?enabled=true").then(({channels:x})=>{C(x.map(k=>({name:k.name,id:k.id}))),R(new Set(o?.allowedChannels??[])),ce(0),r("edit-channels")}).catch(()=>F("Failed to load channels","error"));return}if(f==="p"){pt(o?.permissionMode??"default"),$((o?.allowedBashPatterns??[]).join(", ")),ne((o?.deniedBashPatterns??[]).join(", ")),xt("mode"),r("edit-permissions");return}if(f==="v"){Ut(0),r("edit-env");return}if(f==="i"){if(!o)return;let x=!o.inheritUserSettings;v(`/roles/${o.id}`,{method:"PATCH",body:{inheritUserSettings:x}}).then(()=>{F(`Inherit user settings: ${x?"ON":"OFF"}`,"success"),se()}).catch(()=>F("Failed to toggle","error"));return}break}case"edit-cag":{if(w.ctrl&&f==="s"){Br();return}break}case"edit-dirs":{if(f==="s"){Er();return}if(f==="a"){r("edit-dirs-add");return}if(f==="m"&&Me.length>0){let x=Me[b];if(x){c(de=>de&&{...de,additionalDirectories:de.additionalDirectories?.map((ke,Ar)=>Ar===b?{...typeof ke=="string"?{path:ke}:ke,mode:ke.mode==="ro"?"rw":"ro"}:ke)});let k=x.mode==="ro"?"rw":"ro";F(`Mode set to ${k.toUpperCase()}`,"success")}return}if(f==="x"&&Me.length>0){c(x=>x&&{...x,additionalDirectories:Me.filter((k,de)=>de!==b)}),p(x=>Math.max(0,Math.min(x,Me.length-2)));return}if(w.upArrow){p(x=>Math.max(0,x-1));return}if(w.downArrow){p(x=>Math.min(Me.length-1,x+1));return}break}case"edit-dirs-add":{if(w.escape){r("edit-dirs"),s(""),_([]);return}if(w.return&&g.length>0){let x=g[M];x&&(s(x.endsWith("/")?x:x+"/"),_([]));return}if(w.return){let x=y.trim();x&&x.startsWith("/")?(c(k=>k&&{...k,additionalDirectories:[...k.additionalDirectories??[],{path:x,mode:"rw"}]}),s(""),_([]),r("edit-dirs")):F("Path must be absolute (must start with /)","error");return}if(w.tab){let x=y.trim();if(!x||!x.startsWith("/"))return;v(`/fs/suggest-dirs?prefix=${encodeURIComponent(x)}`).then(({suggestions:k})=>{k.length===1?(s(k[0]+"/"),_([])):k.length>1&&(_(k),Y(0))}).catch(()=>{_([])});return}if(w.upArrow&&g.length>0){Y(x=>Math.max(0,x-1));return}if(w.downArrow&&g.length>0){Y(x=>Math.min(g.length-1,x+1));return}break}case"edit-tools":{if(f==="s"){Ir();return}let x=parseInt(f,10)-1;if(!isNaN(x)&&x>=0&&x<Gt.length){let k=Gt[x];O(de=>{let ke=new Set(de);return ke.has(k)?ke.delete(k):ke.add(k),ke});return}break}case"edit-exec":{if(f==="s"){kr();return}if(w.tab){I(x=>x==="inline"?"isolated":"inline");return}break}case"edit-permissions":{if(f==="s"){Pr();return}if(w.tab){xt(x=>x==="mode"?"allowed":x==="allowed"?"denied":"mode");return}if(Qe==="mode"&&(w.upArrow||w.downArrow)){let x=["default","acceptEdits","dontAsk","bypassPermissions"],k=x.indexOf(je);w.upArrow&&pt(x[Math.max(0,k-1)]),w.downArrow&&pt(x[Math.min(x.length-1,k+1)]);return}break}case"edit-channels":{if(f==="s"){if(!o)return;let x=E.size>0?Array.from(E):[];v(`/roles/${o.id}`,{method:"PATCH",body:{allowedChannels:x}}).then(()=>{F("Channels saved","success"),r("view"),se()}).catch(()=>F("Save failed","error"));return}if(f==="u"){if(!o)return;v(`/roles/${o.id}`,{method:"PATCH",body:{allowedChannels:null}}).then(()=>{F("Channels: unrestricted","success"),r("view"),se()}).catch(()=>F("Save failed","error"));return}if(f===" "){let x=Re[pe];x&&R(k=>{let de=new Set(k);return de.has(x.name)?de.delete(x.name):de.add(x.name),de});return}if(w.upArrow){ce(x=>Math.max(0,x-1));return}if(w.downArrow){ce(x=>Math.min(Re.length-1,x+1));return}break}case"edit-env":{let x=Object.keys(o?.envVars??{});if(f==="a"){Bo(""),r("edit-env-add-key");return}if(f==="d"&&x.length>0){let k=x[Xe],de={...o?.envVars??{}};delete de[k],v(`/roles/${o.id}`,{method:"PATCH",body:{envVars:de}}).then(()=>{F("Deleted","success"),se()}).catch(()=>F("Delete failed","error")),Xe>=x.length-1&&Xe>0&&Ut(ke=>ke-1);return}if(w.return&&x.length>0){Po((o?.envVars??{})[x[Xe]]??""),r("edit-env-edit-value");return}w.upArrow&&Xe>0&&Ut(k=>k-1),w.downArrow&&Xe<x.length-1&&Ut(k=>k+1);break}case"edit-env-add-key":case"edit-env-add-value":case"edit-env-edit-value":break}}),l)return h(T,{dimColor:!0,children:"Loading role..."});if(!o)return h(T,{dimColor:!0,children:"Role not found."});if(n==="edit-cag")return B(A,{flexDirection:"column",children:[h(T,{bold:!0,children:"CAG Prompt \u2014 Edit (Esc cancel, Ctrl+S save)"}),h(rt,{value:a,onChange:d,placeholder:"Character And Guidance prompt..."}),V&&h(A,{marginTop:1,children:h(T,{color:V.type==="error"?"red":"green",children:V.text})})]});if(n==="edit-dirs-add")return B(A,{flexDirection:"column",children:[h(T,{bold:!0,children:"Add Directory (Enter confirm, Esc cancel, Tab:complete)"}),h(rt,{value:y,onChange:f=>{s(f),_([])},placeholder:"/absolute/path/to/directory"}),g.length>0&&B(A,{flexDirection:"column",marginTop:1,children:[g.map((f,w)=>B(T,{color:w===M?"cyan":void 0,dimColor:w!==M,children:[w===M?"> ":" ",f,"/"]},f)),h(T,{dimColor:!0,children:"\u2191\u2193 navigate, Enter select, Tab:confirm"})]}),V&&h(A,{marginTop:1,children:h(T,{color:V.type==="error"?"red":"green",children:V.text})})]});if(n==="edit-dirs")return B(A,{flexDirection:"column",children:[h(T,{bold:!0,children:"Additional Directories (\u2191\u2193 navigate, a:add m:mode x:remove s:save Esc:cancel)"}),V&&h(A,{children:h(T,{color:V.type==="error"?"red":V.type==="success"?"green":"gray",children:V.text})}),Me.length===0?h(T,{dimColor:!0,children:"No directories. Press a to add one."}):Me.map((f,w)=>{let x=typeof f=="string"?{path:f,mode:"rw"}:f,k=x.mode!=="ro";return B(A,{children:[h(T,{color:w===b?"cyan":void 0,bold:w===b,children:w===b?"> ":" "}),B(T,{color:k?"green":"yellow",children:["[",k?"RW":"RO","]"," "]}),h(T,{color:w===b?"cyan":void 0,children:x.path})]},x.path)})]});if(n==="edit-tools")return B(A,{flexDirection:"column",children:[h(T,{bold:!0,children:"Tool Permissions \u2014 toggle with number key (s:save Esc:cancel)"}),V&&h(A,{children:h(T,{color:V.type==="error"?"red":V.type==="success"?"green":"gray",children:V.text})}),Gt.map((f,w)=>{let x=H.has(f);return B(A,{children:[B(T,{dimColor:!0,children:[w+1,". "]}),h(T,{color:x?"green":"red",children:x?"[ON] ":"[OFF] "}),h(T,{children:f})]},f)})]});if(n==="edit-exec")return B(A,{flexDirection:"column",children:[h(T,{bold:!0,children:"Execution Config (Tab:cycle mode, Enter on field, s:save Esc:cancel)"}),B(A,{children:[h(T,{bold:!0,children:" Mode: "}),h(T,{color:"cyan",children:X}),h(T,{dimColor:!0,children:" (Tab to toggle)"})]}),B(A,{children:[h(T,{bold:!0,children:" Model: "}),h(rt,{value:P,onChange:S,placeholder:"sonnet, opus, haiku, or blank"})]}),B(A,{children:[h(T,{bold:!0,children:" Max Budget (USD): "}),h(rt,{value:j,onChange:J,placeholder:"0 = unlimited"})]}),V&&h(A,{children:h(T,{color:V.type==="error"?"red":V.type==="success"?"green":"gray",children:V.text})})]});if(n==="edit-permissions")return B(A,{flexDirection:"column",children:[h(T,{bold:!0,children:"Permission Config (Tab:cycle field, \u2191\u2193:mode, s:save, Esc:cancel)"}),B(A,{children:[h(T,{bold:!0,color:Qe==="mode"?"cyan":void 0,children:" Mode: "}),["default","acceptEdits","dontAsk","bypassPermissions"].map(w=>B(T,{color:w===je?"green":"gray",children:[w===je?`[${w}]`:` ${w} `," "]},w))]}),B(A,{children:[h(T,{bold:!0,color:Qe==="allowed"?"cyan":void 0,children:" Allowed Bash: "}),Qe==="allowed"?h(rt,{value:D,onChange:$,placeholder:"git add *, pnpm test*"}):h(T,{children:D||"(none)"})]}),B(A,{children:[h(T,{bold:!0,color:Qe==="denied"?"cyan":void 0,children:" Denied Bash: "}),Qe==="denied"?h(rt,{value:q,onChange:ne,placeholder:"rm -rf *, ssh *"}):h(T,{children:q||"(none)"})]}),h(T,{dimColor:!0,children:"Patterns: comma-separated, glob syntax (* = wildcard)"}),V&&h(A,{children:h(T,{color:V.type==="error"?"red":V.type==="success"?"green":"gray",children:V.text})})]});if(n==="edit-channels")return B(A,{flexDirection:"column",children:[h(T,{bold:!0,children:"Allowed Channels (Space:toggle, u:unrestricted, s:save, Esc:cancel)"}),Re.length===0?h(T,{dimColor:!0,children:"No channels available"}):Re.map((f,w)=>B(A,{children:[B(T,{children:[w===pe?">":" "," "]}),B(T,{color:E.has(f.name)?"green":"gray",children:["[",E.has(f.name)?"x":" ","] ",f.name]})]},f.id)),B(T,{dimColor:!0,children:["Selected: ",E.size>0?Array.from(E).join(", "):"none (= block all)"]}),V&&h(A,{children:h(T,{color:V.type==="error"?"red":V.type==="success"?"green":"gray",children:V.text})})]});if(n.startsWith("edit-env")){let f=Object.keys(o.envVars??{});return B(A,{flexDirection:"column",children:[B(T,{bold:!0,children:["Environment Variables (",f.length,")"]}),f.length===0&&n==="edit-env"&&h(T,{dimColor:!0,children:" No env vars. Press a to add."}),f.map((w,x)=>{let k=x===Xe;return n==="edit-env-edit-value"&&k?B(A,{children:[B(T,{color:"cyan",children:["> ",w," = "]}),h(rt,{value:ko,onChange:Po,onSubmit:()=>{let de={...o.envVars??{},[w]:ko};v(`/roles/${o.id}`,{method:"PATCH",body:{envVars:de}}).then(()=>{F("Saved","success"),se(),r("edit-env")}).catch(()=>F("Save failed","error"))}})]},w):B(T,{color:k&&n==="edit-env"?"cyan":"white",children:[k&&n==="edit-env"?"> ":" ",w," = ",(o.envVars??{})[w]]},w)}),n==="edit-env-add-key"&&B(A,{children:[h(T,{color:"green",children:" New key: "}),h(rt,{value:Wt,onChange:Bo,onSubmit:()=>{Wt.trim()&&(Io(""),r("edit-env-add-value"))}})]}),n==="edit-env-add-value"&&B(A,{children:[B(T,{color:"green",children:[" ",Wt," = "]}),h(rt,{value:Eo,onChange:Io,onSubmit:()=>{let w={...o.envVars??{},[Wt.trim()]:Eo};v(`/roles/${o.id}`,{method:"PATCH",body:{envVars:w}}).then(()=>{F("Added","success"),se(),r("edit-env")}).catch(()=>F("Add failed","error"))}})]}),h(T,{dimColor:!0,children:"a:add Enter:edit d:delete Esc:back"}),V&&h(T,{color:V.type==="error"?"red":"green",children:V.text})]})}return B(A,{flexDirection:"column",children:[B(T,{bold:!0,children:["Role: ",o.name]}),B(A,{children:[h(T,{dimColor:!0,children:"ID: "}),h(T,{children:o.id})]}),B(A,{children:[h(T,{dimColor:!0,children:"Status: "}),h(T,{color:o.status==="active"?"green":o.status==="probation"?"yellow":"red",children:o.status})]}),o.performanceScore!=null&&B(A,{children:[h(T,{dimColor:!0,children:"Score: "}),B(T,{children:[(o.performanceScore*100).toFixed(0),"%"]})]}),B(A,{children:[h(T,{dimColor:!0,children:"Created: "}),h(T,{children:new Date(o.createdAt).toLocaleString()})]}),B(A,{children:[h(T,{dimColor:!0,children:"Execution: "}),B(T,{children:[o.executionMode??"inline"," / ",o.model??"inherit"," / ",o.maxBudgetUsd!=null?`$${o.maxBudgetUsd}`:"no limit"]})]}),Me.length>0&&B(Sr,{children:[h(T,{bold:!0,children:"Additional Directories:"}),Me.map(f=>B(T,{dimColor:!0,children:[" ",f.path]},f.path))]}),B(A,{children:[h(T,{dimColor:!0,children:"Permission: "}),h(T,{children:o.permissionMode??"default"})]}),(o.allowedBashPatterns?.length??0)>0&&B(A,{children:[h(T,{dimColor:!0,children:" Bash Allow: "}),h(T,{children:o.allowedBashPatterns.join(", ")})]}),(o.deniedBashPatterns?.length??0)>0&&B(A,{children:[h(T,{dimColor:!0,children:" Bash Deny: "}),h(T,{children:o.deniedBashPatterns.join(", ")})]}),Tt.length>0&&B(A,{flexDirection:"column",children:[h(T,{dimColor:!0,children:"Denied Read Paths (global):"}),Tt.map(f=>B(T,{dimColor:!0,children:[" ",f]},f)),B(T,{dimColor:!0,italic:!0,children:[" (Settings ",">"," Advanced)"]})]}),B(A,{children:[h(T,{dimColor:!0,children:"Channels: "}),h(T,{children:o.allowedChannels===void 0?"Unrestricted":o.allowedChannels.length===0?"Blocked":o.allowedChannels.join(", ")})]}),B(A,{children:[h(T,{dimColor:!0,children:"Inherit User Settings: "}),h(T,{color:o.inheritUserSettings?"green":"gray",children:o.inheritUserSettings?"Yes":"No"})]}),o.learnedRules.length>0&&B(Sr,{children:[h(T,{bold:!0,children:"Learned Rules:"}),o.learnedRules.map(f=>B(T,{dimColor:!0,children:[" - ",f]},f))]}),V&&h(A,{children:h(T,{color:V.type==="error"?"red":V.type==="success"?"green":"gray",children:V.text})}),h(A,{marginTop:1,children:h(T,{dimColor:!0,children:"c:CAG d:dirs t:tools x:exec p:perms h:channels v:env i:inherit r:refresh Esc:back"})})]})}import{jsx as De,jsxs as no}from"react/jsx-runtime";function wr({onBack:e}){let[t,o]=Ot([]),[c,u]=Ot(!0),[m,l]=Ot(0),[i,n]=Ot("list"),[r,a]=Ot(null),{message:d,setMessage:b,clearMessage:p}=ct(),y=is(()=>{u(!0),v("/roles").then(({roles:s})=>{o(s.map(g=>({id:g.id,name:g.name,status:g.status,performanceScore:g.performanceScore,createdAt:g.createdAt}))),u(!1)}).catch(()=>u(!1))},[]);return ss(()=>{y()},[y]),ns((s,g)=>{if(g.escape||s==="q"){e();return}if(g.upArrow){l(_=>Math.max(0,_-1));return}if(g.downArrow){l(_=>Math.min(t.length-1,_+1));return}if(s==="r"&&(y(),p()),s===`
|
|
7
|
-
`||s==="o"||s==="e"){t.length>0&&(a(t[m].id),n("detail"));return}}),c?De(nt,{dimColor:!0,children:"Loading roles..."}):i==="detail"&&r?De(Cr,{roleId:r,onBack:()=>n("list")}):no(kt,{flexDirection:"column",children:[no(nt,{bold:!0,children:["Roles (",t.length,") (Esc to go back)"]}),d&&De(kt,{marginTop:1,children:no(nt,{color:d.type==="success"?"green":d.type==="error"?"red":"gray",children:[d.type==="success"?"\u2713 ":d.type==="error"?"\u2717 ":"\u2192 ",d.text]})}),t.length===0?De(kt,{marginTop:1,children:De(nt,{dimColor:!0,children:"No roles found. Roles define agent behavior and bind plugins."})}):De(kt,{marginTop:1,flexDirection:"column",children:t.map((s,g)=>{let _=g===m,M=s.performanceScore!=null?`${(s.performanceScore*100).toFixed(0)}%`:"\u2014";return no(kt,{children:[De(nt,{color:_?"cyan":void 0,bold:_,children:_?"> ":" "}),De(nt,{color:_?"cyan":void 0,bold:_,children:Co(s.name,24)}),De(nt,{color:as(s.status),children:Co(s.status,12)}),De(nt,{dimColor:!0,children:Co(M,8)})]},s.id)})}),De(kt,{marginTop:1,children:De(nt,{dimColor:!0,children:"Enter/O/E:open Esc:back r:refresh"})})]})}function as(e){return e==="active"?"green":e==="probation"?"yellow":e==="retired"||e==="dead"?"red":"gray"}function Co(e,t){return e?e.length>=t?e:e+" ".repeat(t-e.length):" ".repeat(t)}import{Fragment as gs,jsx as G,jsxs as At}from"react/jsx-runtime";function ds(){let{state:e,dispatch:t}=st(),{session:o,sendMessage:c,createNewSession:u,archiveCurrentSession:m}=qo(),[l,i]=cs([]);so(()=>{t({type:"SET_SESSION",session:o})},[o,t]),Vo();let{latestMessage:n}=Uo(o?.id??null),r=wo(null);so(()=>{n&&n.id!==r.current&&(r.current=n.id,i(M=>[...M,{role:"assistant",content:n.content}]))},[n]);let{events:a,isStreaming:d,clearEvents:b}=Oo(e.activeTaskId),p=a[a.length-1],y=p?.type==="complete"&&!d,s=wo(null),g=wo("");so(()=>{g.current=a.filter(M=>M.type==="reasoning").map(M=>M.content).join("")},[a]),so(()=>{if(y&&e.activeTaskId!==s.current){s.current=e.activeTaskId;let M=p?.content||g.current;M&&i(Y=>[...Y,{role:"assistant",content:M}])}},[y,p,e.activeTaskId]);let _=async M=>{let Y=M.trim().toLowerCase();if(["quit","exit","/quit","/exit"].includes(Y)&&process.exit(0),M.startsWith("/")){let O=M.slice(1),I={work:"work",tasks:"tasks",config:"config",evolution:"evolution",templates:"templates",memories:"memories",goals:"goals",strategies:"strategies",roles:"roles",settings:"settings",channels:"channels",plugins:"plugins",back:"chat"}[O];if(I){t({type:"SET_VIEW",view:I});return}if(O==="new"){if(await m()){let S=await u();i([]),b(),S&&i([{role:"assistant",content:`Session archived. New session started: ${S.id.slice(0,8)}`}])}return}if(O==="session"){let P=o?`Session: ${o.id}
|
|
8
|
-
Turns: ${o.messageCount}
|
|
9
|
-
Last active: ${new Date(o.lastActiveAt).toLocaleString()}`:"No active session";i(S=>[...S,{role:"assistant",content:P}]);return}}if(i(O=>[...O,{role:"user",content:M}]),b(),!await c(M)){i(O=>[...O,{role:"assistant",content:"Failed to send message. Server may be disconnected."}]);return}};return At(qt,{flexDirection:"column",paddingX:1,children:[G(Wo,{}),At(qt,{flexGrow:1,flexDirection:"column",paddingY:1,children:[e.view==="chat"&&At(gs,{children:[G(Xo,{messages:l}),G(Ko,{events:a,isStreaming:d}),!e.connected&&!e.serverUnreachable&&G(qt,{children:G(Pt,{color:"red",children:"Server disconnected. Attempting to reconnect..."})}),e.serverUnreachable&&At(qt,{flexDirection:"column",children:[G(Pt,{color:"red",bold:!0,children:"Server unreachable after 15s."}),G(Pt,{dimColor:!0,children:"Check: adam server logs"}),G(Pt,{dimColor:!0,children:"Type /quit to exit."})]})]}),e.view==="work"&&G(hr,{onBack:()=>t({type:"SET_VIEW",view:"chat"})}),e.view==="tasks"&&G(zt,{onBack:()=>t({type:"SET_VIEW",view:"chat"})}),e.view==="config"&&G(or,{onBack:()=>t({type:"SET_VIEW",view:"chat"})}),e.view==="evolution"&&G(nr,{onBack:()=>t({type:"SET_VIEW",view:"chat"})}),e.view==="goals"&&G(Jt,{onBack:()=>t({type:"SET_VIEW",view:"chat"})}),e.view==="strategies"&&G(ir,{onBack:()=>t({type:"SET_VIEW",view:"chat"})}),e.view==="templates"&&G(to,{onBack:()=>t({type:"SET_VIEW",view:"chat"})}),e.view==="webhooks"&&G(cr,{onBack:()=>t({type:"SET_VIEW",view:"chat"})}),e.view==="memories"&&G(mr,{onBack:()=>t({type:"SET_VIEW",view:"chat"})}),e.view==="plugins"&&G(xr,{onBack:()=>t({type:"SET_VIEW",view:"chat"})}),e.view==="roles"&&G(wr,{onBack:()=>t({type:"SET_VIEW",view:"chat"})}),e.view==="settings"&&G(pr,{onBack:()=>t({type:"SET_VIEW",view:"chat"})}),e.view==="channels"&&G(yr,{onBack:()=>t({type:"SET_VIEW",view:"chat"})})]}),e.pendingPlanApproval?G(Yo,{approval:e.pendingPlanApproval,onResolved:()=>t({type:"SET_PENDING_PLAN_APPROVAL",approval:null}),onTimeout:()=>t({type:"SET_PLAN_TIMEOUT_NOTICE",planId:e.pendingPlanApproval.planId})}):e.pendingApproval?G(zo,{approval:e.pendingApproval,onResolved:()=>t({type:"SET_PENDING_APPROVAL",approval:null})}):G(Ho,{onSubmit:_}),e.planTimeoutNotice&&G(us,{planId:e.planTimeoutNotice.planId,onDismiss:()=>t({type:"SET_PLAN_TIMEOUT_NOTICE",planId:null})})]})}function us({planId:e,onDismiss:t}){return ls(o=>{o==="d"&&t()}),At(qt,{borderStyle:"round",borderColor:"yellow",paddingX:1,children:[At(Pt,{color:"yellow",children:["Plan ",e," was auto-denied after 300s timeout."]}),G(Pt,{dimColor:!0,children:" [d] Dismiss"})]})}function ms(){return G(No,{children:G(ds,{})})}export{ms as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as a,o as b}from"./chunk-IZWULGUS.js";import"./chunk-5V36ACKZ.js";import"./chunk-OEKM2W3K.js";import"./chunk-EJVUUIAV.js";import"./chunk-GMCIKDTC.js";import"./chunk-6YURWVQG.js";import"./chunk-CDVIT7L5.js";import"./chunk-W3554FQ7.js";import"./chunk-RPTHFQX7.js";import"./chunk-AJVN3KPM.js";import"./chunk-AR2IZMM2.js";import"./chunk-SWPXG2CY.js";import"./chunk-KLQOILIJ.js";import"./chunk-L7JP7DUO.js";import"./chunk-GUQAIWCQ.js";import"./chunk-2CMR5AG7.js";import"./chunk-4TCP2AT7.js";import"./chunk-6DXNXLYG.js";import"./chunk-SBX3HMDA.js";import"./chunk-ZM6YED5F.js";import"./chunk-7IFLU3CY.js";import"./chunk-6HD6NYIB.js";import"./chunk-B4WHT7DX.js";import"./chunk-7LBDLAUQ.js";import"./chunk-KVSO3KGZ.js";import"./chunk-WBAPIPST.js";import"./chunk-INNDBLZE.js";import"./chunk-FCV2DPZQ.js";export{b as createAdamTools,a as getToolsFingerprint};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as a,j as b,k as c,l as d,m as e}from"./chunk-ITUBFUJQ.js";import"./chunk-QN6BEJF5.js";import"./chunk-OEKM2W3K.js";import"./chunk-EJVUUIAV.js";import"./chunk-GMCIKDTC.js";import"./chunk-W3554FQ7.js";import"./chunk-BIIP363C.js";import"./chunk-KLQOILIJ.js";import"./chunk-OFOVSC72.js";import"./chunk-L7JP7DUO.js";import"./chunk-GUQAIWCQ.js";import"./chunk-2CMR5AG7.js";import"./chunk-4TCP2AT7.js";import"./chunk-Z5ET7WW2.js";import"./chunk-6HD6NYIB.js";import"./chunk-B4WHT7DX.js";import"./chunk-7LBDLAUQ.js";import"./chunk-KVSO3KGZ.js";import"./chunk-WBAPIPST.js";import"./chunk-INNDBLZE.js";import"./chunk-FCV2DPZQ.js";export{a as evaluateTaskCompletion,e as getSecurityPosture,d as reportViolation,b as startAuditManager,c as stopAuditManager};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b,c}from"./chunk-JNRCXAW3.js";import"./chunk-CDVIT7L5.js";import"./chunk-W3554FQ7.js";import"./chunk-L7JP7DUO.js";import"./chunk-4TCP2AT7.js";import"./chunk-6DXNXLYG.js";import"./chunk-SBX3HMDA.js";import"./chunk-ZM6YED5F.js";import"./chunk-7IFLU3CY.js";import"./chunk-6HD6NYIB.js";import"./chunk-B4WHT7DX.js";import"./chunk-7LBDLAUQ.js";import"./chunk-KVSO3KGZ.js";import"./chunk-WBAPIPST.js";import"./chunk-INNDBLZE.js";import"./chunk-FCV2DPZQ.js";export{a as BreeEngine,b as getBreeEngine,c as setBreeEngine};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as a,d as b,e as c}from"./chunk-IHP7JV6J.js";import"./chunk-AR2IZMM2.js";import"./chunk-SWPXG2CY.js";import"./chunk-KVSO3KGZ.js";import"./chunk-WBAPIPST.js";import"./chunk-INNDBLZE.js";import"./chunk-FCV2DPZQ.js";export{c as channelRoutes,b as getChannelManager,a as setChannelManager};
|
package/dist/chunk-6HD6NYIB.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var f=["defaults.model","defaults.effort","defaults.maxTurns","defaults.maxBudgetUsd","defaults.timeout","logging.level","roles.evolution.triggerEvery","roles.evolution.reflectionThreshold","chat.sessionTimeoutMinutes","chat.maxSessionTurns","chat.autoTitle","chat.archiveExtractMemory","server.timezone","anthropic.apiKey","anthropic.baseUrl","anthropic.model","anthropic.defaultOpusModel","anthropic.defaultSonnetModel","anthropic.defaultHaikuModel","anthropic.smallFastModel","defaults.approvalTimeout","defaults.deniedReadPaths","defaults.approvalRequired"],g=["server.port","server.host","server.apiKey"],p={"anthropic.apiKey":"ANTHROPIC_API_KEY","anthropic.baseUrl":"ANTHROPIC_BASE_URL","anthropic.model":"ANTHROPIC_MODEL","anthropic.defaultOpusModel":"ANTHROPIC_DEFAULT_OPUS_MODEL","anthropic.defaultSonnetModel":"ANTHROPIC_DEFAULT_SONNET_MODEL","anthropic.defaultHaikuModel":"ANTHROPIC_DEFAULT_HAIKU_MODEL","anthropic.smallFastModel":"ANTHROPIC_SMALL_FAST_MODEL"},a=null;function A(t){a=JSON.parse(JSON.stringify(t))}function i(){if(!a)throw new Error("Runtime config not initialized. Call initRuntimeConfig first.");return a}function _(t){let r=i(),o=t();for(let[n,e]of Object.entries(o))d(r,n,e)}function R(){let t=i(),r={};for(let[o,n]of Object.entries(p)){let e=E(t,o);e&&typeof e=="string"&&e.length>0?r[n]=e:process.env[n]&&(r[n]=process.env[n])}return r}function c(t){let r={};for(let[o,n]of Object.entries(t))o.startsWith("ANTHROPIC_")||(r[o]=n);return r}var l=/key|token|secret|password|credential/i;function k(t){let r={};for(let[o,n]of Object.entries(t))r[o]=l.test(o)&&n.length>4?n.slice(0,4)+"****":l.test(o)&&n.length>0?"****":n;return r}function O(t){let o=i().defaults?.env??{};return{...process.env,...o,...R(),...c(t?.roleEnvVars??{}),...c(t?.taskEnv??{}),DISABLE_TELEMETRY:"1",DISABLE_ERROR_REPORTING:"1",CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC:"1",DISABLE_AUTOUPDATER:"1"}}function S(t,r){let o=i(),n=[],e=[];for(let[s,u]of Object.entries(t)){if(!h(s)){v(s)?e.push(`"${s}" requires restart. Cannot modify at runtime.`):e.push(`"${s}" is not a recognized config path.`);continue}d(o,s,u)&&(n.push(s),r?.(s,u))}return{success:e.length===0,updated:n,errors:e}}function d(t,r,o){let n=r.split("."),e=t;for(let s=0;s<n.length-1;s++)if(e&&typeof e=="object")e=e[n[s]];else return!1;return e&&typeof e=="object"?(e[n[n.length-1]]=o,!0):!1}function E(t,r){let o=r.split("."),n=t;for(let e of o)if(n&&typeof n=="object")n=n[e];else return;return n}function h(t){return f.includes(t)}function v(t){return g.includes(t)}export{f as a,g as b,A as c,i as d,_ as e,R as f,c as g,k as h,O as i,S as j,E as k,h as l,v as m};
|
package/dist/chunk-ITUBFUJQ.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import{a as $,e as Ke}from"./chunk-QN6BEJF5.js";import{b as We,k as Je,m as Ye}from"./chunk-OEKM2W3K.js";import{a as me,d as Fe,e as ge}from"./chunk-EJVUUIAV.js";import{a as Le,b as $e}from"./chunk-GMCIKDTC.js";import{b as Me,c as V,d as K,f as Oe}from"./chunk-W3554FQ7.js";import{a as je}from"./chunk-BIIP363C.js";import{e as Ue,f as Ve,j as qt}from"./chunk-KLQOILIJ.js";import{b as He}from"./chunk-OFOVSC72.js";import{a as m}from"./chunk-L7JP7DUO.js";import{b as Ge}from"./chunk-GUQAIWCQ.js";import{b as qe}from"./chunk-Z5ET7WW2.js";import{d as U,i as De}from"./chunk-6HD6NYIB.js";import{a as j,b as Be,e as x,g as O,h as pe,k as L}from"./chunk-B4WHT7DX.js";import{a as Ne,g as Wt}from"./chunk-7LBDLAUQ.js";import{b as I,d as Ae}from"./chunk-KVSO3KGZ.js";import{d as ue,h as Ft}from"./chunk-WBAPIPST.js";import{c as h,h as _}from"./chunk-INNDBLZE.js";Ae();function Gt(t){return{id:t.id,roleId:t.role_id,taskId:t.task_id,scores:JSON.parse(t.score_json),emaScore:t.ema_score,createdAt:t.created_at}}function Xe(t){I().prepare(`
|
|
2
|
-
INSERT INTO role_scores (id, role_id, task_id, score_json, ema_score, created_at)
|
|
3
|
-
VALUES (?, ?, ?, ?, ?, ?)
|
|
4
|
-
`).run(t.id,t.roleId,t.taskId,JSON.stringify(t.scores),t.emaScore,t.createdAt)}function X(t,e=50){return I().prepare("SELECT * FROM role_scores WHERE role_id = ? ORDER BY created_at DESC LIMIT ?").all(t,e).map(Gt)}function ze(t){return I().prepare("SELECT ema_score FROM role_scores WHERE role_id = ? ORDER BY created_at DESC LIMIT 1").get(t)?.ema_score}function Qe(t){let o=I().prepare(`
|
|
5
|
-
SELECT token_usage FROM tasks
|
|
6
|
-
WHERE role_id = ? AND status = 'completed' AND token_usage IS NOT NULL
|
|
7
|
-
ORDER BY completed_at DESC LIMIT 50
|
|
8
|
-
`).all(t);if(o.length===0)return 1e4;let n=o.map(r=>{let s=JSON.parse(r.token_usage);return(s.input??0)+(s.output??0)}).sort((r,s)=>r-s);return n[Math.floor(n.length/2)]}_();import{v4 as Jt}from"uuid";var Yt=h("audit"),z={taskSuccess:.3,planAccuracy:.25,permissionCompliance:.25,efficiency:.2},Ze=.3;function Kt(t,e){let o=Me(t),n=o?.status==="completed"?1:0,r=1,s=Fe(t);s?.deviationReport&&(r=s.deviationReport.overallAccuracy);let a=1,i=$e(t,1e3),l=i.filter(y=>y.type==="tool_result"||y.type==="permission_denied").length,c=i.filter(y=>y.type==="permission_denied").length;l>0&&(a=1-c/l);let f=1;if(o?.tokenUsage){let y=o.tokenUsage.input+o.tokenUsage.output,S=e?Qe(e):1e4;y>S&&(f=Math.max(0,1-(y-S)/S))}let k=n*z.taskSuccess+r*z.planAccuracy+a*z.permissionCompliance+f*z.efficiency;return{taskSuccess:n,planAccuracy:r,permissionCompliance:a,efficiency:f,weighted:k}}function et(t,e){let o=Kt(e,t),n=ze(t),r=n!==void 0?Ze*o.weighted+(1-Ze)*n:o.weighted;return Xe({id:Jt(),roleId:t,taskId:e,scores:o,emaScore:r,createdAt:Date.now()}),Yt.debug({roleId:t,taskId:e,scores:{...o,weighted:o.weighted.toFixed(3)},ema:r.toFixed(3)},"Task score recorded"),r}L();L();_();var Xt=h("audit");function Q(t,e=7){let o=x(t),n=X(t,100),r=Date.now(),s=r-e*24*60*60*1e3,a=n.filter(d=>d.createdAt>=s),i=a.map(d=>d.emaScore),l=a.length>0?a.reduce((d,E)=>d+E.scores.weighted,0)/a.length:1,c=[],f=a.filter(d=>d.scores.taskSuccess<.5);f.length>0&&c.push({category:"task_failures",count:f.length,examples:f.slice(0,3).map(d=>d.taskId)});let k=a.filter(d=>d.scores.planAccuracy<.5);k.length>0&&c.push({category:"plan_deviations",count:k.length,examples:k.slice(0,3).map(d=>d.taskId)});let y=a.filter(d=>d.scores.permissionCompliance<.8);y.length>0&&c.push({category:"permission_violations",count:y.length,examples:y.slice(0,3).map(d=>d.taskId)});let S=a.filter(d=>d.scores.efficiency<.3);S.length>0&&c.push({category:"inefficiency",count:S.length,examples:S.slice(0,3).map(d=>d.taskId)});let T=[],R=[];return f.length>a.length*.3&&(T.push("High task failure rate"),R.push({action:"add_rule",detail:"Add rule: verify task feasibility before execution"})),y.length>0&&(T.push("Permission boundary violations"),R.push({action:"adjust_permission",detail:"Review and expand allowedTools if tasks legitimately need wider access"})),k.length>a.length*.5&&(T.push("Frequent plan deviations"),R.push({action:"add_rule",detail:"Add rule: follow execution plan steps more closely, request plan revision if steps are unclear"})),Xt.info({roleId:t,taskCount:a.length,avgScore:l.toFixed(3),failureCategories:c.map(d=>d.category)},"Diagnostic report generated"),{roleId:t,agentName:o?.name??"Unknown",period:{start:s,end:r},taskCount:a.length,avgScore:l,scoreHistory:i,failureBehaviors:c,rootCauses:T,recommendations:R}}_();var Z=h("audit"),tt=.4,zt=5;function ot(t,e,o=tt){if(e>=o)return;let n=x(t);if(!n||n.status==="retired"||n.status==="dead")return;Z.warn({roleId:t,emaScore:e,threshold:o},"Agent EMA below threshold, retiring");let r=Q(t),s=JSON.stringify(n.learnedRules),a=Qt(n.learnedRules,r);O(t,{status:"retired",learnedRules:a});let i=[...r.failureBehaviors.map(c=>`${c.category}: ${c.count} occurrences`),...r.rootCauses.map(c=>`Root cause: ${c}`),...r.recommendations.map(c=>`Recommendation [${c.action}]: ${c.detail}`)].join(`
|
|
9
|
-
`),l=Ke(s,JSON.stringify(a));return $({timestamp:Date.now(),oldRules:s,newRules:JSON.stringify(a),diff:i?`--- Diagnostic Report ---
|
|
10
|
-
${i}
|
|
11
|
-
|
|
12
|
-
--- Rules Diff ---
|
|
13
|
-
${l}`:l,roleId:t,source:"audit"}),Z.info({roleId:t,oldRulesCount:n.learnedRules.length,newRulesCount:a.length,recommendations:r.recommendations.length},"Agent retired with targeted learnedRules modification"),r}function nt(t){let e=x(t);return!e||e.status!=="retired"?!1:(O(t,{status:"probation"}),$({timestamp:Date.now(),oldRules:"status: retired",newRules:"status: probation",diff:`- status: retired
|
|
14
|
-
+ status: probation`,roleId:t,source:"audit"}),Z.info({roleId:t},"Agent reinstated to probation"),!0)}function rt(t,e,o=tt,n=zt){let r=x(t);return!r||r.status!=="probation"||X(t,n+1).length<n?!1:e>=o?(O(t,{status:"active"}),$({timestamp:Date.now(),oldRules:"status: probation",newRules:"status: idle",diff:`- status: probation
|
|
15
|
-
+ status: idle (graduated, EMA: ${e.toFixed(3)})`,roleId:t,source:"audit"}),Z.info({roleId:t,emaScore:e},"Agent graduated from probation to active"),!0):!1}function Qt(t,e){let o=[...t];for(let n of e.recommendations){let r=`[audit:${n.action}] ${n.detail}`;o.includes(r)||o.push(r)}if(e.failureBehaviors.length>0){let r=`[audit:diagnostic] Failure patterns detected: ${e.failureBehaviors.map(s=>`${s.category}(${s.count})`).join(", ")}. Review and adjust behavior accordingly.`;o.includes(r)||o.push(r)}return o}import{spawn as It}from"child_process";L();import{accessSync as it,constants as at}from"fs";import{accessSync as Zt,constants as eo,existsSync as st,realpathSync as to}from"fs";import{join as fe}from"path";import{spawn as oo}from"child_process";import{execFileSync as no}from"child_process";var H=null;function F(){if(H)return H;let t=typeof import.meta.dirname=="string"?import.meta.dirname:__dirname??".",e=fe(t,"landlock-exec","landlock-exec");if(st(e))return H=e,e;let o=process.env.PATH?.split(":").find(n=>st(fe(n,"landlock-exec")));return o?(H=fe(o,"landlock-exec"),H):e}var ee=class{platform="landlock";async isAvailable(){if(process.platform!=="linux")return!1;try{Zt(F(),eo.X_OK)}catch{return!1}try{return no(F(),["--check"],{timeout:5e3,stdio:["ignore","pipe","pipe"]}),!0}catch{return!1}}spawn(e){let o=e.command??"node",n=e.args??[],r=[];for(let s of e.visiblePaths??[]){let a=s.mode==="rw"?"--rw":"--ro",i;try{i=to(s.path)}catch{i=s.path}r.push(a,i),i!==s.path&&r.push(a,s.path)}return r.push("--",o,...n),oo(F(),r,{cwd:e.cwd,env:e.env,stdio:"pipe",signal:e.signal})}};function lt(){if(process.platform==="linux")try{return it(F(),at.X_OK),"landlock"}catch{return"none"}if(process.platform==="darwin")try{return it("/usr/bin/sandbox-exec",at.X_OK),"sandbox-exec"}catch{return"none"}return"none"}_();import{spawn as ro}from"child_process";import{readFileSync as dt,writeFileSync as so,mkdtempSync as io,realpathSync as he,rmSync as ao}from"fs";import{join as C}from"path";import{tmpdir as lo}from"os";var ut=h("sandbox-macos"),ct="/usr/bin/sandbox-exec";function co(){let t=[C(typeof import.meta.dirname=="string"?import.meta.dirname:".","profiles","role-sandbox.sb"),C(typeof import.meta.dirname=="string"?import.meta.dirname:".","..","src","sandbox","profiles","role-sandbox.sb"),C(process.cwd(),"src","sandbox","profiles","role-sandbox.sb")];for(let e of t)try{return dt(e,"utf-8"),e}catch{}return t[t.length-1]}var uo=co();function te(t){if(!t.startsWith("/"))throw new Error(`Sandbox path must be absolute: ${t}`);if(t.includes('"')||t.includes(")")||t.includes("(")||t.includes("$"))throw new Error(`Sandbox path contains invalid characters for SBPL: ${t}`)}function po(t){let e=[`
|
|
16
|
-
; ===== Per-Role writable paths =====`];for(let o of t){if(o.mode!=="rw")continue;let n;try{n=he(o.path)}catch{n=o.path}te(n),e.push(`(allow file-write* (subpath "${n}"))`),n!==o.path&&(te(o.path),e.push(`(allow file-write* (subpath "${o.path}"))`))}return e.join(`
|
|
17
|
-
`)}function mo(t){if(!t.length)return"";let e=[`
|
|
18
|
-
; ===== Global read blacklist (deniedReadPaths) =====`];for(let o of t){let n;try{n=he(o)}catch{n=o}try{te(n),e.push(`(deny file-read-data (subpath "${n}"))`),e.push(`(deny file-read-metadata (subpath "${n}"))`),n!==o&&(te(o),e.push(`(deny file-read-data (subpath "${o}"))`),e.push(`(deny file-read-metadata (subpath "${o}"))`))}catch(r){ut.warn({path:o,error:r.message},"Skipping deniedReadPath: invalid for SBPL")}}return e.join(`
|
|
19
|
-
`)}var oe=class{platform="sandbox-exec";async isAvailable(){try{let{existsSync:e}=await import("fs");return e(ct)}catch{return!1}}spawn(e){let{command:o,args:n,cwd:r,env:s,signal:a,visiblePaths:i,deniedReadPaths:l}=e,c=dt(uo,"utf-8"),f=po(i),k=mo(l??[]),y=c+f+k+`
|
|
20
|
-
`,S=he(io(C(lo(),"adam-sandbox-"))),T=C(S,"role.sb");so(T,y,"utf-8");let R=S,d=s?.HOME??process.env.HOME??"/tmp",E={...s,TMPDIR:R,CLAUDE_CODE_TMPDIR:R,CLAUDE_CONFIG_DIR:C(d,".claude")};ut.debug({command:o,visiblePaths:i.length,profilePath:T},"Spawning sandboxed process");let N=ro(ct,["-f",T,"-D",`TMPDIR=${R}`,"-D",`CLAUDE_CONFIG=${C(d,".claude")}`,"-D",`HOME_CACHE=${C(d,"Library","Caches")}`,o,...n],{cwd:r,env:E,stdio:"pipe",signal:a});return N.on("exit",()=>{try{ao(S,{recursive:!0,force:!0})}catch{}}),N}};import{spawn as go}from"child_process";var B=null,pt=null,ne=null;function D(){if(B)return B;let t=pt??lt();return pt=t,t==="sandbox-exec"?B=new oe:t==="landlock"?B=new ee:B=new be(t),B}async function mt(){return ne!==null||(ne=await D().isAvailable()),ne}var be=class{platform;constructor(e){this.platform=e}async isAvailable(){return!1}spawn(e){let o=e.command??"node",n=e.args??[];return go(o,n,{cwd:e.cwd,env:e.env,stdio:"pipe",signal:e.signal})}};import{query as So}from"@anthropic-ai/claude-agent-sdk";import{v4 as kt}from"uuid";function gt(t){let e=t.roleName?`## Role Context
|
|
21
|
-
- Role: ${t.roleName}
|
|
22
|
-
${t.roleCagPrompt?`- CAG Prompt: ${t.roleCagPrompt}`:""}`:"",o=t.allowedTools&&t.allowedTools.length>0?`## Available Tools
|
|
23
|
-
You have access to: ${t.allowedTools.join(", ")}. Use them as needed to complete the task.`:"";return`# Execution Agent \u2014 Task Focus
|
|
24
|
-
|
|
25
|
-
You are executing a specific task assigned to you. Your job is to complete the work, not manage goals or strategies.
|
|
26
|
-
|
|
27
|
-
## Task
|
|
28
|
-
- Task ID: ${t.taskId}
|
|
29
|
-
- Prompt: ${t.prompt}
|
|
30
|
-
|
|
31
|
-
${e}
|
|
32
|
-
|
|
33
|
-
${o}
|
|
34
|
-
|
|
35
|
-
## Focus
|
|
36
|
-
- Focus entirely on completing the task
|
|
37
|
-
- Use the standard SDK tools to do the work
|
|
38
|
-
- Do NOT attempt strategic decisions \u2014 just execute
|
|
39
|
-
|
|
40
|
-
## Constraints
|
|
41
|
-
- You have standard SDK tools only (no adam-tools MCP)
|
|
42
|
-
- Stay within your assigned permissions and allowed paths
|
|
43
|
-
- Report completion with a clear result summary
|
|
44
|
-
- If WebSearch or WebFetch fails (network error, invalid params), report the failure honestly \u2014 do not fabricate data
|
|
45
|
-
- If a tool is unavailable, state it clearly in the result rather than guessing
|
|
46
|
-
`}Be();_();var fo=new Set(["Read","Glob","Grep","LSP"]),ho=new Set(["Edit","Write","NotebookEdit"]);function ye(t){let e=t.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*");return new RegExp(`^${e}$`)}function ft(t,e,o){return async(n,r,{agentID:s,blockedPath:a})=>{if(a){let l=j(a);if(o?.deniedReadPaths?.length)for(let c of o.deniedReadPaths){let f=j(c);if(l.startsWith(f))return bo.warn({toolName:n,blockedPath:a,agentID:s,deniedPath:c},"Denied: path in deniedReadPaths (absolute blacklist)"),{behavior:"deny",message:`Access denied: ${a} is in the global denied read paths list. This restriction is configured in Settings > Advanced and cannot be overridden by privilege escalation.`}}return e?await e(n,r,`blockedPath:${a}`,s):{behavior:"deny",message:`Access denied: ${a} is outside this role's allowed scope (cwd + additionalDirectories). Configure additionalDirectories to expand access.`}}if(fo.has(n))return{behavior:"allow",updatedInput:r};if(ho.has(n))return{behavior:"allow",updatedInput:r};let i=t(s??"");if(n==="Bash"&&i){let l=r.command??"";if(i.allowedBashPatterns?.length)for(let c of i.allowedBashPatterns)try{if(ye(c).test(l))return{behavior:"allow",updatedInput:r}}catch{}if(i.deniedBashPatterns?.length)for(let c of i.deniedBashPatterns)try{if(ye(c).test(l))return{behavior:"deny",message:`Bash command denied by pattern: ${c}`}}catch{}}if(i?.disallowedTools?.includes(n))return{behavior:"deny",message:`Tool ${n} is not allowed for this role.`};if(e&&i?.approvalRequired?.length){let l=n==="Bash"?r.command??"":`${n} ${JSON.stringify(r)}`;for(let c of i.approvalRequired)try{if(ye(c).test(l))return await e(n,r,c,s)}catch{}}return{behavior:"allow",updatedInput:r}}}var bo=h("manager");function ht(t){return{SessionStart:[{hooks:[async e=>{if(!t.roleId)return{};let o=e.source,n=t.roleId==="role-chat-manager";if(!n&&o!=="startup"&&o!=="resume")return{};try{let{queryMemoryByTier:r}=await import("./memory-service-ANR67OPY.js"),s=t.taskPrompt||"role context and recent interactions",a=n?["semantic","working"]:["semantic","episodic"],i=await r(t.roleId,s,a,{topK:5});if(i.length>0)return{hookSpecificOutput:{hookEventName:"SessionStart",additionalContext:`[Memory Context]
|
|
47
|
-
${i.map(f=>`- [${f.tier??"episodic"}] ${f.content}`).join(`
|
|
48
|
-
`)}
|
|
49
|
-
|
|
50
|
-
`}}}catch{}return{}}]}],SubagentStart:[{hooks:[async e=>{let o=t.roleId??e.agent_id;if(!o)return{};try{let n=t.taskPrompt||"role context",r=await Ge(n,o,5);if(r)return{hookSpecificOutput:{hookEventName:"SubagentStart",additionalContext:r}}}catch{}return{}}]}],SubagentStop:[{hooks:[async e=>{let o=e.agent_id;if(!o||!t.currentTaskId)return{};try{let{createMemory:n}=await import("./memories-FQCRKMK6.js"),{getDb:r}=await import("./db-4NY7ZOS2.js"),s=e.transcript;if(!s||s.length<=100)return{};if(r().prepare("SELECT 1 FROM memories WHERE source_task_id = ? AND type = 'thought' LIMIT 1").get(t.currentTaskId))return{};let i=`[Task ${t.currentTaskId} reasoning] ${s.slice(0,3e3)}`;n({id:`session-${Date.now()}`,roleId:t.roleId??o,type:"thought",content:i,keywords:[],importance:3,sourceType:"task_complete",sourceTaskId:t.currentTaskId,createdAt:Date.now(),lastAccessed:Date.now(),retrievedCount:0,tier:"episodic"})}catch{}return{}}]}],PostToolUse:[{hooks:[async e=>{if(!t.currentTaskId)return{};let o=e.tool_name,n=e.tool_input,r=e.tool_response,s=typeof r=="string"?r:JSON.stringify(r??"");try{Le({id:`step-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,taskId:t.currentTaskId,index:0,type:"tool_call",content:`${o}: ${JSON.stringify(n??{})} \u2192 ${s.slice(0,200)}`,toolName:o,toolInput:n,toolOutput:s,timestamp:Date.now()})}catch{}return{}}]}],PreCompact:[{hooks:[async e=>{let o=e.compact_summary;if(!o)return{};try{let{createMemory:n}=await import("./memories-FQCRKMK6.js");n({id:`compact-${Date.now()}`,roleId:t.roleId??"role-chat-manager",type:"thought",content:o.slice(0,5e3),keywords:["compaction","context","decisions"],importance:4,sourceType:"pre_compact",createdAt:Date.now(),lastAccessed:Date.now(),retrievedCount:0,tier:"working"})}catch{}return{}}]}]}}L();qt();Ft();_();Ae();import{randomUUID as yo}from"crypto";function bt(t,e,o){let r=I().prepare(`
|
|
51
|
-
INSERT INTO task_plugins (id, task_id, plugin_path, plugin_name, role_id, used_at)
|
|
52
|
-
VALUES (?, ?, ?, ?, ?, ?)
|
|
53
|
-
`),s=Date.now();for(let a of e){let i=a.split("/").pop()??a;r.run(yo(),t,a,i,o??null,s)}}function Rn(t){return I().prepare(`
|
|
54
|
-
SELECT plugin_name as pluginName, COUNT(*) as usageCount
|
|
55
|
-
FROM task_plugins
|
|
56
|
-
WHERE role_id = ?
|
|
57
|
-
GROUP BY plugin_path
|
|
58
|
-
ORDER BY usageCount DESC
|
|
59
|
-
`).all(t)}function Tn(t=50){return I().prepare(`
|
|
60
|
-
SELECT plugin_path as pluginPath, plugin_name as pluginName, COUNT(*) as usageCount, MAX(used_at) as lastUsed
|
|
61
|
-
FROM task_plugins
|
|
62
|
-
GROUP BY plugin_path
|
|
63
|
-
ORDER BY usageCount DESC
|
|
64
|
-
LIMIT ?
|
|
65
|
-
`).all(t)}L();import{createSdkMcpServer as wo,tool as yt}from"@anthropic-ai/claude-agent-sdk";import{z as wt}from"zod";async function xo(t){let{listChannels:e}=await import("./channels-WZOYE4O4.js"),o=e(),{listSessions:n}=await import("./session-manager-Z6MIYRD3.js"),r=[...n("active"),...n("archived")],s=o.find(l=>l.name.toLowerCase().includes(t.toLowerCase()));if(!s)return null;let i=r.find(l=>l.source.type==="channel"&&l.source.channelId===s.id&&l.source.chatId)?.source.chatId??s.config?.userId??"";return{channelId:s.id,chatId:i}}function W(t){return{content:[{type:"text",text:JSON.stringify(t)}]}}function xt(t){let e=t?x(t):void 0,o=[...Je(t),yt("list_channels","List all available channels. Use this to discover what channels can be used with send_to_channel.",{},async()=>{let{listChannels:n}=await import("./channels-WZOYE4O4.js"),r=n();return W({channels:r.map(s=>({id:s.id,name:s.name,enabled:s.enabled,type:s.config?.type??"unknown"}))})}),yt("send_to_channel","Send a message to a connected channel by name. This role can only send to channels in its allowedChannels list (if configured).",{channelName:wt.string().describe("The channel name, e.g., 'WeChat on iPad'"),message:wt.string().describe("The message content to send")},async n=>{if(e?.allowedChannels!==void 0){if(e.allowedChannels.length===0)return W({error:"This role is not allowed to send to any channels"});if(!e.allowedChannels.some(c=>c.toLowerCase()===n.channelName.toLowerCase()))return W({error:`Channel "${n.channelName}" is not in the allowed channels list for this role`})}let r=await xo(n.channelName);if(!r)return W({error:`Channel "${n.channelName}" not found or has no chatId available`});let{getOutboundGateway:s}=await import("./outbound-gateway-6FQRWYFF.js"),i=await s().send({channelId:r.channelId,chatId:r.chatId,content:n.message,messageType:"reply"});return W({success:i.success,channelName:n.channelName})})];return wo({name:"execution-tools",version:"1.0.0",tools:o})}Wt();Be();import{realpathSync as ko}from"fs";var b=h("execution"),St=new Set;async function vo(t,e){if(e&&St.has(e))return b.info({taskId:t,roleName:e},"Sandbox bypass: approved from session cache"),!0;let o=kt(),n={steps:[{index:0,description:"Execute task without OS sandbox \u2014 filesystem isolation not enforced",toolsNeeded:[],expectedOutput:"Task result or denial message",riskLevel:"high"}],requiredPermissions:{allowedTools:[],disallowedTools:[],approvalRequired:[],maxBudgetUsd:0,plugins:[]},overallRisk:"high"};return me({id:o,taskId:t,plan:n,status:"pending",createdAt:Date.now()}),m.emit({type:"plan_approval_request",taskId:t,planId:o,plan:n}),b.info({taskId:t,operationId:o,roleName:e},"Sandbox unavailable: awaiting privilege escalation decision"),new Promise(r=>{let a=setTimeout(()=>{l(),ge(o,"denied"),b.warn({taskId:t,operationId:o},"Sandbox bypass timed out, auto-denied"),r(!1)},12e4),i=c=>{c.planId===o&&(l(),c.decision==="allow"?(b.info({taskId:t,operationId:o},"Sandbox bypass approved by user"),e&&St.add(e),r(!0)):(b.info({taskId:t,operationId:o},"Sandbox bypass denied by user"),r(!1)))},l=()=>{clearTimeout(a),m.off("plan_approval_decision",i)};m.on("plan_approval_decision",i)})}var re=class{async execute(e,o){let n=Date.now(),r,s,a;V(e.id,{status:"running",startedAt:Date.now()}),m.emit({type:"task_status_change",taskId:e.id,oldStatus:e.status,newStatus:"running"}),b.info({taskId:e.id,roleId:e.roleId},"ExecutionManager: starting task");try{let i=e.roleId?x(e.roleId):void 0,l=ue;i&&(Ve(i),l=Ue(i.name));let c={taskId:e.id,prompt:e.prompt,roleName:i?.name,roleCagPrompt:i?.cagPrompt,allowedTools:i?.allowedTools},f=gt(c),k=ht({currentTaskId:e.id,roleId:e.roleId,taskPrompt:e.prompt}),y=e.config.approvalTimeout??300,S=async(u,p,g,A)=>{let w=kt(),_e=We(A??e.roleId,e.prompt,"medium");if(_e)return b.info({operationId:w,ruleId:_e.id,taskId:e.id},"Auto-approved by permanent rule"),{behavior:"allow",updatedInput:p};let Ie={steps:[{index:0,description:`${u}: ${JSON.stringify(p).slice(0,300)}`,toolsNeeded:[u],expectedOutput:"",riskLevel:"medium"}],requiredPermissions:{},overallRisk:"medium"};return me({id:w,taskId:e.id,roleId:A??e.roleId,plan:Ie,status:"pending",createdAt:Date.now()}),m.emit({type:"plan_approval_request",taskId:e.id,planId:w,plan:Ie}),b.info({taskId:e.id,operationId:w,toolName:u,matchedPattern:g},"Privilege escalation: awaiting user decision"),new Promise(de=>{let jt=setTimeout(()=>{Ee(),ge(w,"denied"),b.warn({taskId:e.id,operationId:w},"Privilege escalation timed out, auto-denied"),de({behavior:"deny",message:`Operation timed out after ${y}s. Auto-denied. Try a safer alternative that does not require approval.`})},y*1e3),Ce=M=>{if(M.planId===w)if(Ee(),M.decision==="allow")b.info({taskId:e.id,operationId:w,approvalType:M.approvalType},"Operation authorized by user"),de({behavior:"allow",updatedInput:p});else{let Ht=M.reason?`Operation denied by user: ${M.reason}. Try a safer alternative.`:"Operation denied by user. Try a safer alternative approach.";b.info({taskId:e.id,operationId:w,reason:M.reason??"no reason given"},"Operation denied by user"),de({behavior:"deny",message:Ht})}},Ee=()=>{clearTimeout(jt),m.off("plan_approval_decision",Ce)};m.on("plan_approval_decision",Ce)})},R=(Ne("defaults.deniedReadPaths")??[]).map(u=>{let p=j(u);try{return ko(p)}catch{return p}}),d=i?.additionalDirectories??[],E=i?Ye(i):[],N=[...d.map(u=>u.path)].filter((u,p,g)=>g.indexOf(u)===p),At=ft(u=>({disallowedTools:i?.disallowedTools,approvalRequired:i?.approvalRequired??e.config.approvalRequired,allowedBashPatterns:i?.allowedBashPatterns,deniedBashPatterns:i?.deniedBashPatterns}),S,{deniedReadPaths:R,roleScope:[l,...N]}),Mt=De({roleEnvVars:i?.envVars,taskEnv:e.config.env}),Ot=e.config.maxBudgetUsd??U().defaults.maxBudgetUsd,Lt=e.config.maxTurns??100,$t=xt(e.roleId??""),Bt=i?.mcpServers??{},Nt=e.config.mcpServers??{},Ut={...Bt,...Nt,"execution-tools":$t},le=[{path:l,mode:"rw"}];e.roleId===je&&le.push({path:ue,mode:"ro"});for(let u of d)le.push({path:u.path,mode:u.mode??"rw"});let ve=D();if(ve.platform==="none"&&!await vo(e.id,i?.name))return V(e.id,{status:"failed",error:"Sandbox unavailable; execution denied by user"}),{taskId:e.id,status:"failed",error:"Sandbox bypass denied"};let Pe=i?.permissionMode??"default",Vt=So({prompt:e.prompt,options:{cwd:l,additionalDirectories:N,systemPrompt:f,maxTurns:Lt,maxBudgetUsd:Ot,allowedTools:i?.allowedTools,model:i?.model,mcpServers:Ut,settingSources:i?.inheritUserSettings?["project","user"]:["project"],hooks:k,canUseTool:At,env:Mt,plugins:E.map(u=>({type:"local",path:u})),permissionMode:Pe,...Pe==="bypassPermissions"?{allowDangerouslySkipPermissions:!0}:{},spawnClaudeCodeProcess:u=>{let p=ve.spawn({command:u.command,args:u.args,cwd:u.cwd,env:u.env,signal:u.signal,visiblePaths:le,deniedReadPaths:R}),g=p;g.pid&&(vt(g.pid,e.roleId??"unknown",e.id),g.on("exit",()=>Pt(g.pid)));let A="";return g.stderr?.on("data",w=>{A+=w.toString()}),g.on("exit",w=>{w!==null&&w!==0&&A.includes("sandbox")&&(b.error({taskId:e.id,roleId:e.roleId,exitCode:w,stderr:A.slice(0,500)},"Sandbox wrapper failed \u2014 task process exited before execution"),se({roleId:e.roleId??"unknown",taskId:e.id,path:l,operation:`sandbox_init_failure:exit_${w}`,timestamp:Date.now()}))}),p},stderr:u=>{u.trim()&&b.debug({stderr:u.trim().slice(0,500)},"ExecutionManager SDK stderr")}}}),Y="",Re=0,Te=()=>{b.warn({taskId:e.id},"ExecutionManager: abort signal received")};o&&o.addEventListener("abort",Te);try{for await(let u of Vt){let p=u;if(b.debug({eventType:p.type,taskId:e.id},"ExecutionManager SDK event"),p.type==="result"&&typeof p.result=="string"&&(Y=p.result),p.type==="result"){Re++,typeof p.total_cost_usd=="number"&&(s=p.total_cost_usd);let g=p.usage;g?.input_tokens!==void 0&&g?.output_tokens!==void 0&&(r={input:g.input_tokens,output:g.output_tokens})}if(p.token_usage){let g=p.token_usage;g.input_tokens!==void 0&&g.output_tokens!==void 0&&(r={input:g.input_tokens,output:g.output_tokens})}}}finally{o&&o.removeEventListener("abort",Te)}a=Re;let ce=Date.now()-n;return V(e.id,{status:"completed",result:Y,completedAt:Date.now(),costUsd:s,tokenUsage:r,numTurns:a,totalDurationMs:ce}),m.emit({type:"task_status_change",taskId:e.id,oldStatus:"running",newStatus:"completed"}),m.emit({type:"task_complete_event",taskId:e.id,result:Y}),E.length>0&&bt(e.id,E,e.roleId),b.info({taskId:e.id,durationMs:ce,costUsd:s},"ExecutionManager: task completed"),{taskId:e.id,status:"completed",result:Y,costUsd:s,tokenUsage:r,numTurns:a,durationMs:ce}}catch(i){let l=i instanceof Error?i.message:String(i),c=Date.now()-n;return(l.includes("Prompt is too long")||l.includes("prompt is too long"))&&b.warn({taskId:e.id,error:l},"Task prompt exceeds model context window \u2014 task failed"),V(e.id,{status:"failed",error:l,completedAt:Date.now(),totalDurationMs:c}),m.emit({type:"task_status_change",taskId:e.id,oldStatus:"running",newStatus:"failed"}),m.emit({type:"task_complete_event",taskId:e.id,error:l}),b.error({taskId:e.id,error:i},"ExecutionManager: task failed"),{taskId:e.id,status:"failed",error:l,durationMs:c}}}};_();var v=h("execution-pool"),we=new Map;function vt(t,e,o){we.set(t,{roleId:e,taskId:o})}function Pt(t){we.delete(t)}function xe(t){return we.get(t)}var Rt=class{slots;running=!1;pollTimeoutId=null;executor;constructor(e,o){this.slots=Array.from({length:e},(n,r)=>({index:r,taskId:null,abortController:null})),this.executor=o??new re}async start(){if(this.running)return;this.running=!0,m.on("task_created",n=>{this.onTaskCreated(n.taskId)}),m.on("task_status_change",n=>{n.newStatus==="pending"&&this.pickupPendingTasks()});let o=U().execution?.pollIntervalMs??3e4;this.pollTimeoutId=setTimeout(this.poll,o),v.info({maxConcurrent:this.slots.length},"ExecutionPool started")}stop(){this.running=!1,this.pollTimeoutId&&(clearTimeout(this.pollTimeoutId),this.pollTimeoutId=null);for(let e of this.slots)e.abortController&&(e.abortController.abort(),e.taskId=null,e.abortController=null);v.info("ExecutionPool stopped")}poll=()=>{if(!this.running)return;this.pickupPendingTasks();let o=U().execution?.pollIntervalMs??3e4;this.pollTimeoutId=setTimeout(this.poll,o)};async onTaskCreated(e){this.running&&await this.pickupPendingTasks()}async pickupPendingTasks(){if(!this.running)return;let e=this.slots.find(i=>i.taskId===null);if(!e){v.debug("No free slots available");return}let o=K("pending");if(o.length===0)return;let r=[...o].sort((i,l)=>i.createdAt-l.createdAt)[0];e.taskId=r.id,e.abortController=new AbortController;let s=e.index,a=r.id;v.info({slotIndex:s,taskId:a},"ExecutionPool: claimed slot for task"),this.emitSlotChange(),this.executeTask(r,s).catch(i=>{v.error({taskId:a,error:i},"ExecutionPool: executeTask failed unexpectedly")})}async executeTask(e,o){let n=this.slots[o];if(!n)return;let r="completed";try{m.emit({type:"execution_task_start",taskId:e.id,slotIndex:o});let s=await this.executor.execute(e,n.abortController?.signal);r=s.status,v.info({taskId:e.id,status:s.status,slotIndex:o},"ExecutionPool: task finished")}finally{n.taskId=null,n.abortController=null,m.emit({type:"execution_task_end",taskId:e.id,slotIndex:o,status:r}),this.emitSlotChange(),this.runPostCompletion(e.id,e.roleId).catch(s=>{v.error({taskId:e.id,error:s},"Post-completion processing failed (non-fatal)")}),this.running&&this.pickupPendingTasks()}}emitSlotChange(){let e=this.slots.filter(r=>r.taskId!==null).length,o=K("pending");m.emit({type:"execution_slot_change",active:e,max:this.slots.length,queued:o.length});let n=qe();m.emit({type:"stats_update",activeTasks:e,queuedTasks:o.length,totalCostToday:Oe(n)})}async runPostCompletion(e,o){if(o){try{let{processTaskCompletion:n}=await import("./memory-extractor-FUOJ5D77.js"),r=await n(e,o);r>0&&v.debug({taskId:e,roleId:o,memoriesStored:r},"Post-completion: memories extracted")}catch(n){v.error({taskId:e,roleId:o,error:n},"Post-completion: memory extraction failed")}try{let{processTaskReview:n}=await import("./learner-B6XVQKBF.js");await n(e)}catch(n){v.error({taskId:e,roleId:o,error:n},"Post-completion: task review failed")}try{let{evaluateTaskCompletion:n}=await import("./audit-manager-QDFDBK4E.js");n(e,o)}catch(n){v.error({taskId:e,roleId:o,error:n},"Post-completion: audit evaluation failed")}}}getStatus(){let e=this.slots.filter(n=>n.taskId!==null).length,o=K("pending");return{active:e,max:this.slots.length,queued:o.length}}isHealthy(){return this.running}releaseSlot(e){let o=this.slots.find(n=>n.taskId===e);o&&(v.warn({taskId:e,slotIndex:o.index},"ExecutionPool: force-releasing slot"),o.abortController&&o.abortController.abort(),o.taskId=null,o.abortController=null,this.emitSlotChange(),this.running&&this.pickupPendingTasks())}};_();var P=h("audit"),Po="sandbox_violation",q=new Map,Se=1440*60*1e3,ie=[],Ro=100;function ke(t){let e=t.roleId,o=q.get(e)??{count:0,timestamps:[]};o.count++,o.timestamps.push(t.timestamp);let n=Date.now()-Se;if(o.timestamps=o.timestamps.filter(r=>r>=n),q.set(e,o),o.count%100===0)for(let[r,s]of q.entries()){let a=Date.now()-Se;s.timestamps.filter(i=>i>=a).length===0&&q.delete(r)}ie.push(t),ie.length>Ro&&ie.shift();try{He({id:`sv-${Date.now()}-${Math.random().toString(36).slice(2,7)}`,ruleId:void 0,taskId:t.taskId,status:"delivered",target:{type:"channel",channelId:"audit"},content:"",attempts:1,messageType:Po,source:"audit",createdAt:t.timestamp,deliveredAt:t.timestamp,expiresAt:t.timestamp+864e5,error:`${t.operation} on ${t.path}`})}catch(r){P.error({error:r},"Failed to record violation to delivery_log")}try{let r=x(t.roleId);$({timestamp:t.timestamp,oldRules:"sandbox_violation",newRules:`${t.operation} on ${t.path}`,diff:`Sandbox violation: ${t.operation} on ${t.path} (taskId=${t.taskId??"unknown"})`,roleId:t.roleId,source:"audit"})}catch(r){P.error({error:r},"Failed to record violation to evolution_audit")}m.emit({type:"sandbox_violation",roleId:t.roleId,taskId:t.taskId,path:t.path,operation:t.operation,timestamp:t.timestamp})}async function Ct(){let t=D();if(t.platform==="none")return P.info("Sandbox platform is 'none'; violation watcher not started"),()=>{};if(!await t.isAvailable())return P.warn({platform:t.platform},"Sandbox platform detected but not available; violation watcher not started"),()=>{};let o=null;return t.platform==="sandbox-exec"?o=To():t.platform==="landlock"&&(o=await _o()),()=>{if(o){let n=o;o=null,n.kill("SIGTERM");let r=setTimeout(()=>{try{n.kill("SIGKILL")}catch{}},2e3);n.on("exit",()=>clearTimeout(r))}P.info("Violation watcher stopped")}}function To(){let t=It("log",["stream","--predicate",'subsystem == "com.apple.sandbox"',"--style","ndjson","--signal","exit"],{stdio:["ignore","pipe","pipe"]});return t.stdout?.on("data",e=>{let o=e.toString().split(`
|
|
66
|
-
`).filter(Boolean);for(let n of o)try{let r=JSON.parse(n),s=r.eventMessage??r.message??"";if(s.includes("deny")&&(s.includes("file-read")||s.includes("file-write"))){let a=Io(r,s);a&&ke(a)}}catch{}}),t.stderr?.on("data",e=>{P.debug({msg:e.toString()},"log stream stderr")}),t.on("error",e=>{P.warn({error:e},"macOS violation watcher failed to start")}),P.info("macOS sandbox violation watcher started (log stream)"),t}async function _o(){let t=await Tt("journalctl",["-kf","--no-pager","-o","short","--grep","landlock"]);if(t)return _t(t),P.info("Linux violation watcher started (journalctl -kf)"),t;let e=await Tt("dmesg",["-w","-t"]);return e?(_t(e),P.info("Linux violation watcher started (dmesg -w)"),e):(P.warn("Linux violation watcher unavailable: neither journalctl nor dmesg accessible. Sandbox enforcement still active; monitoring disabled."),null)}async function Tt(t,e){return new Promise(o=>{let n=It(t,e,{stdio:["ignore","pipe","pipe"]}),r=setTimeout(()=>o(n),500);n.on("error",()=>{clearTimeout(r),o(null)}),n.on("exit",s=>{s!==0&&(clearTimeout(r),o(null))})})}function _t(t){t.stdout?.on("data",e=>{let o=e.toString().split(`
|
|
67
|
-
`).filter(Boolean);for(let n of o)if(n.includes("landlock")&&n.includes("denied")){let r=Co(n);r&&ke(r)}}),t.stderr?.on("data",e=>{P.debug({msg:e.toString().trim()},"Linux watcher stderr")})}function Io(t,e){let o=e.match(/(?:path|file)=["']([^"']+)["']/),n=e.match(/deny\s+(file-read|file-write|file-[^\s]+)/),r=o?.[1],s=n?.[1]??"unknown";if(!r)return null;let a=typeof t.processID=="number"?t.processID:void 0,i=a?xe(a):void 0;return{roleId:i?.roleId??"unknown",taskId:i?.taskId,path:r,operation:s,timestamp:Date.now(),count:1}}function Co(t){let e=t.match(/path="([^"]+)"/)??t.match(/\/[\w\-\.\/\+ ]+/g),o=t.match(/deny\s+(\w+)/),n=t.match(/pid=(\d+)/),r=Array.isArray(e)?e[e.length-1]:e?.[1],s=o?.[1]??"unknown";if(!r)return null;let a=n?parseInt(n[1],10):void 0,i=a?xe(a):void 0;return{roleId:i?.roleId??"unknown",taskId:i?.taskId,path:r,operation:s,timestamp:Date.now(),count:1}}function se(t){ke({roleId:t.roleId,taskId:t.taskId,path:t.path,operation:t.operation,timestamp:t.timestamp,count:1})}function Et(t){let e=q.get(t);if(!e)return 0;let o=Date.now()-Se;return e.timestamps.filter(n=>n>=o).length}function Dt(){return[...ie]}L();_();var G=h("audit"),Eo=.4,Do=1440*60*1e3,J=null,ae=null;function Tr(t,e,o=Eo){let n=x(e);if(!n||n.status==="retired"||n.status==="inactive"||n.status==="dead")return;let r=et(e,t);O(e,{performanceScore:r}),rt(e,r,o)?G.info({roleId:e,emaScore:r},"Probation role graduated"):r<o&&ot(e,r,o)&&nt(e)}async function _r(){J===null&&(J=setInterval(()=>{G.info("Running daily diagnostic reports");let t=pe(void 0,1e3);for(let e of t)if(!(e.status==="retired"||e.status==="inactive"))try{Q(e.id)}catch(o){G.error({roleId:e.id,error:o},"Daily diagnostic failed")}},Do),ae=await Ct(),G.info("AuditManager started"))}function Ir(){J!==null&&(clearInterval(J),J=null),ae!==null&&(ae(),ae=null),G.info("AuditManager stopped")}function Cr(t){se(t)}async function Er(){let t=D(),e=pe(void 0,1e3),n=Date.now()-1440*60*1e3,r=Dt(),s=r.filter(l=>l.timestamp>=n).length,a=e.map(l=>{let c=r.filter(k=>k.roleId===l.id),f=c[c.length-1];return{roleId:l.id,roleName:l.name,sandboxed:t.platform!=="none",violationCount:Et(l.id),lastViolation:f?.timestamp}}),i=await mt();return{platform:t.platform,available:i,violationCount24h:s,rolePostures:a}}export{X as a,ze as b,ft as c,ht as d,D as e,mt as f,Rn as g,Tn as h,Tr as i,_r as j,Ir as k,Cr as l,Er as m,Rt as n};
|