adam-agent-server 0.5.0 → 1.1.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 +2 -4
- package/dist/App-RIYRYLKD.js +9 -0
- package/dist/adam-tools-YBKSTHVJ.js +1 -0
- package/dist/approval-handler-JYIS2PKQ.js +1 -0
- package/dist/audit-manager-7M2CDMP5.js +1 -0
- package/dist/bree-engine-Y24K4PXN.js +1 -0
- package/dist/channels-WMCY4QC3.js +1 -0
- package/dist/channels-WZOYE4O4.js +1 -0
- package/dist/chunk-2CMR5AG7.js +1 -0
- package/dist/chunk-2HN2TSP6.js +5 -0
- package/dist/{chunk-L7426WNY.js → chunk-3RAFA6QK.js} +1 -1
- package/dist/{chunk-HAWA62R2.js → chunk-4TCP2AT7.js} +1 -1
- package/dist/chunk-5V36ACKZ.js +1 -0
- package/dist/{chunk-VF6GJGD6.js → chunk-6DXNXLYG.js} +1 -1
- package/dist/chunk-6HD6NYIB.js +1 -0
- package/dist/chunk-6KLG4APZ.js +1 -0
- package/dist/{chunk-KICPHTI2.js → chunk-6YURWVQG.js} +1 -1
- package/dist/chunk-7IFLU3CY.js +4 -0
- package/dist/chunk-7LBDLAUQ.js +2 -0
- package/dist/{chunk-5ASEAZCR.js → chunk-AJVN3KPM.js} +1 -1
- package/dist/{chunk-742NWPTQ.js → chunk-AR2IZMM2.js} +1 -1
- package/dist/chunk-B4WHT7DX.js +8 -0
- package/dist/{chunk-TN6H2WM2.js → chunk-BIIP363C.js} +3 -3
- package/dist/{chunk-WXN3PSVX.js → chunk-CDVIT7L5.js} +1 -1
- package/dist/chunk-EGS6U3V5.js +3 -0
- package/dist/{chunk-IXF3XBGX.js → chunk-EJVUUIAV.js} +1 -1
- package/dist/{chunk-AXMXXUPO.js → chunk-GMCIKDTC.js} +1 -1
- package/dist/{chunk-2GXYBWLS.js → chunk-GUQAIWCQ.js} +1 -1
- package/dist/chunk-IHP7JV6J.js +1 -0
- package/dist/chunk-INNDBLZE.js +1 -0
- package/dist/chunk-JTMFEUDA.js +1 -0
- package/dist/chunk-KLQOILIJ.js +21 -0
- package/dist/{chunk-PCSZW2PE.js → chunk-KVSO3KGZ.js} +7 -7
- package/dist/{chunk-FUGJMHY4.js → chunk-MPRAVJUO.js} +1 -1
- package/dist/chunk-OEKM2W3K.js +4 -0
- package/dist/{chunk-FDWW245P.js → chunk-OFOVSC72.js} +1 -1
- package/dist/chunk-PMHNW5IL.js +49 -0
- package/dist/chunk-Q4YE5BU7.js +49 -0
- package/dist/{chunk-B6S2AEOD.js → chunk-QN6BEJF5.js} +1 -1
- package/dist/{chunk-PQ7KPALO.js → chunk-SWPXG2CY.js} +1 -1
- package/dist/chunk-U5NRQNBB.js +67 -0
- package/dist/chunk-UW3OJG7U.js +83 -0
- package/dist/chunk-VRP4LTHY.js +1 -0
- package/dist/chunk-WBAPIPST.js +1 -0
- package/dist/chunk-WVGNP2LQ.js +3 -0
- package/dist/cli.js +5 -5
- package/dist/config-EI3SCA4W.js +1 -0
- package/dist/config-OH6Q2D2Y.js +1 -0
- package/dist/db-4NY7ZOS2.js +1 -0
- package/dist/delivery-log-SC2ULFCK.js +1 -0
- package/dist/engine-JKSNQQDM.js +1 -0
- package/dist/evolution-audit-KUBXFUHI.js +1 -0
- package/dist/external-api-I6CENLIS.js +1 -0
- package/dist/index.js +12 -57
- package/dist/learner-UYDFNURD.js +1 -0
- package/dist/logger-QCJUU7GV.js +1 -0
- package/dist/memories-FQCRKMK6.js +1 -0
- package/dist/{memory-extractor-GOISDQTO.js → memory-extractor-FUOJ5D77.js} +2 -2
- package/dist/memory-service-ANR67OPY.js +1 -0
- package/dist/outbound-gateway-6FQRWYFF.js +1 -0
- package/dist/role-presets-LRP6P5O2.js +1 -0
- package/dist/roles-3UTFKSHI.js +1 -0
- package/dist/runtime-B2DP3JNB.js +1 -0
- package/dist/session-manager-VYKNKQ46.js +1 -0
- package/dist/task-templates-PSP7GOJJ.js +1 -0
- package/package.json +2 -1
- package/web/dist/assets/Card-4mOZntHG.js +1 -0
- package/web/dist/assets/ChannelDetail-e6rVX_y8.js +1 -0
- package/web/dist/assets/Channels-DJvZPKer.js +12 -0
- package/web/dist/assets/Chat-hTZdEwyE.js +1 -0
- package/web/dist/assets/Dashboard-B4rL_ePs.js +1 -0
- package/web/dist/assets/{EmptyState-DBFJc4PL.js → EmptyState-BlgMMAr-.js} +1 -1
- package/web/dist/assets/EnvVarEditor-C8kRWejV.js +1 -0
- package/web/dist/assets/Evolution-BGwFCo7X.js +6 -0
- package/web/dist/assets/GoalDetail-BH2ku-0t.js +1 -0
- package/web/dist/assets/Goals-DynDtpMC.js +1 -0
- package/web/dist/assets/Logs-CyJFouE6.js +1 -0
- package/web/dist/assets/Memories-ClcFD7OG.js +1 -0
- package/web/dist/assets/{NotFound-Cidygwnn.js → NotFound-CSjhzSGa.js} +1 -1
- package/web/dist/assets/Plugins-SNOQNNcL.js +1 -0
- package/web/dist/assets/RoleDetail-vlTPiYwY.js +33 -0
- package/web/dist/assets/Roles-CFcuHIvA.js +1 -0
- package/web/dist/assets/Settings-C9Kuz-6D.js +1 -0
- package/web/dist/assets/Strategies-DZWlQCHp.js +1 -0
- package/web/dist/assets/Switch-DOi0EFHj.js +1 -0
- package/web/dist/assets/Table-BxbnOSbq.js +1 -0
- package/web/dist/assets/TaskDetail-DjmmnldI.js +2 -0
- package/web/dist/assets/Work-CvESHC3Y.js +1 -0
- package/web/dist/assets/index-BFmC20R2.js +52 -0
- package/web/dist/assets/index-CaocwyO8.css +2 -0
- package/web/dist/assets/{vendor-icons-ZPvC5PUS.js → vendor-icons-CkI4-NxL.js} +1 -1
- package/web/dist/assets/{vendor-react--nRVf2Ep.js → vendor-react-DLRtONKt.js} +1 -1
- package/web/dist/assets/vendor-state-B_-GdGNJ.js +1 -0
- package/web/dist/index.html +5 -5
- package/dist/App-XZABZ2AF.js +0 -9
- package/dist/adam-tools-BB7WQGVT.js +0 -1
- package/dist/approval-handler-HK7GQPHU.js +0 -4
- package/dist/bree-engine-25VACELK.js +0 -1
- package/dist/channels-JEBBMFUQ.js +0 -1
- package/dist/channels-VEUBY2NZ.js +0 -1
- package/dist/chunk-3DAK2XWP.js +0 -1
- package/dist/chunk-5JLMSNIW.js +0 -1
- package/dist/chunk-7SPKRIMZ.js +0 -15
- package/dist/chunk-BREBCBG4.js +0 -49
- package/dist/chunk-D6WM2OQS.js +0 -86
- package/dist/chunk-DWMMWYLD.js +0 -1
- package/dist/chunk-ETQ7KC73.js +0 -1
- package/dist/chunk-FYDFMYUP.js +0 -1
- package/dist/chunk-JXD6ZPV7.js +0 -2
- package/dist/chunk-NSJAV7IH.js +0 -1
- package/dist/chunk-NXTTKAQX.js +0 -3
- package/dist/chunk-SFUS33SO.js +0 -1
- package/dist/chunk-T25NLVMY.js +0 -1
- package/dist/chunk-T7WVM27S.js +0 -52
- package/dist/chunk-U36NBCR3.js +0 -17
- package/dist/chunk-URW2DJQF.js +0 -1
- package/dist/chunk-WZOMGJSY.js +0 -1
- package/dist/chunk-XNWZZYAV.js +0 -7
- package/dist/config-WHXCZCI4.js +0 -1
- package/dist/config-Y4QWELO3.js +0 -1
- package/dist/db-PNZ3UJOE.js +0 -1
- package/dist/delivery-log-VYTYUFCK.js +0 -1
- package/dist/engine-3PNNEZNK.js +0 -1
- package/dist/evolution-audit-B7WKMOVR.js +0 -1
- package/dist/external-api-XGEOKAWR.js +0 -1
- package/dist/learner-VMD5NQCD.js +0 -1
- package/dist/logger-BEG4WFIM.js +0 -1
- package/dist/memories-EFQ4SFZG.js +0 -1
- package/dist/memory-service-BKLZIRK6.js +0 -1
- package/dist/monitor-K7CGTLA6.js +0 -1
- package/dist/outbound-gateway-DZTXBUTP.js +0 -1
- package/dist/role-presets-FN2RWUCP.js +0 -1
- package/dist/roles-SG2YAR64.js +0 -1
- package/dist/runtime-6UTYEONR.js +0 -1
- package/dist/session-manager-45LFTPBA.js +0 -1
- package/dist/task-templates-7LSQ6OST.js +0 -1
- package/web/dist/assets/Card-BecEmnPW.js +0 -1
- package/web/dist/assets/ChannelDetail-dZfZlLgQ.js +0 -1
- package/web/dist/assets/Channels-Cw04c7YJ.js +0 -12
- package/web/dist/assets/Chat-D4PHqHPE.js +0 -1
- package/web/dist/assets/Dashboard-BFewwmAg.js +0 -1
- package/web/dist/assets/Evolution-DY1OC6Oc.js +0 -6
- package/web/dist/assets/GoalDetail-DZIEpHs2.js +0 -1
- package/web/dist/assets/Goals-COCCVLnp.js +0 -1
- package/web/dist/assets/Logs-DsDeimLt.js +0 -1
- package/web/dist/assets/Memories-D5IEEI1u.js +0 -1
- package/web/dist/assets/Plugins-DUwZVjPc.js +0 -1
- package/web/dist/assets/RoleDetail-B-GKMfMG.js +0 -33
- package/web/dist/assets/Roles-JeVjD0Ew.js +0 -1
- package/web/dist/assets/Settings-CvEyZp5t.js +0 -1
- package/web/dist/assets/Strategies-KAmpqrcQ.js +0 -1
- package/web/dist/assets/Switch-Jpdn6Yux.js +0 -1
- package/web/dist/assets/Table-tkJ-cuiE.js +0 -1
- package/web/dist/assets/TaskDetail-C4NpqwNT.js +0 -2
- package/web/dist/assets/Work-DhaxNYnd.js +0 -1
- package/web/dist/assets/index-CfKqiQIe.js +0 -52
- package/web/dist/assets/index-LDFr0VVR.css +0 -2
- package/web/dist/assets/vendor-state-CH64feAE.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,t}from"./rolldown-runtime-Dw2cE7zH.js";var n=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var I=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},L={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=L,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:F}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,I)}catch(e){I(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.4`})),r=t(((e,t)=>{t.exports=n()})),i=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),a=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),o=e=>{let t=a(e);return t.charAt(0).toUpperCase()+t.slice(1)},s=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),c=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0},l={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},u=e(r()),d=(0,u.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...d},f)=>(0,u.createElement)(`svg`,{ref:f,...l,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:s(`lucide`,i),...!a&&!c(d)&&{"aria-hidden":`true`},...d},[...o.map(([e,t])=>(0,u.createElement)(e,t)),...Array.isArray(a)?a:[a]])),f=(e,t)=>{let n=(0,u.forwardRef)(({className:n,...r},a)=>(0,u.createElement)(d,{ref:a,iconNode:t,className:s(`lucide-${i(o(e))}`,`lucide-${e}`,n),...r}));return n.displayName=o(e),n},p=f(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),m=f(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),h=f(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),g=f(`brain`,[[`path`,{d:`M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z`,key:`l5xja`}],[`path`,{d:`M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z`,key:`ep3f8r`}],[`path`,{d:`M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4`,key:`1p4c4q`}],[`path`,{d:`M17.599 6.5a3 3 0 0 0 .399-1.375`,key:`tmeiqw`}],[`path`,{d:`M6.003 5.125A3 3 0 0 0 6.401 6.5`,key:`105sqy`}],[`path`,{d:`M3.477 10.896a4 4 0 0 1 .585-.396`,key:`ql3yin`}],[`path`,{d:`M19.938 10.5a4 4 0 0 1 .585.396`,key:`1qfode`}],[`path`,{d:`M6 18a4 4 0 0 1-1.967-.516`,key:`2e4loj`}],[`path`,{d:`M19.967 17.484A4 4 0 0 1 18 18`,key:`159ez6`}]]),_=f(`chart-column`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]]),v=f(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),y=f(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),b=f(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),x=f(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),S=f(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),C=f(`circle-dollar-sign`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8`,key:`1h4pet`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}]]),w=f(`circle-user`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}],[`path`,{d:`M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662`,key:`154egf`}]]),T=f(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),E=f(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16 14`,key:`68esgv`}]]),D=f(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),O=f(`dollar-sign`,[[`line`,{x1:`12`,x2:`12`,y1:`2`,y2:`22`,key:`7eqyqh`}],[`path`,{d:`M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6`,key:`1b0p4s`}]]),k=f(`file-code`,[[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z`,key:`1mlx9k`}]]),A=f(`git-branch`,[[`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`,key:`17qcm7`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M18 9a9 9 0 0 1-9 9`,key:`n2h4wq`}]]),j=f(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),M=f(`hash`,[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]),N=f(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),P=f(`layout-dashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),F=f(`lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),I=f(`list-todo`,[[`rect`,{x:`3`,y:`5`,width:`6`,height:`6`,rx:`1`,key:`1defrl`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`M13 6h8`,key:`15sg57`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 18h8`,key:`oe0vm4`}]]),L=f(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),R=f(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),z=f(`menu`,[[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 18h16`,key:`19g7jn`}],[`path`,{d:`M4 6h16`,key:`1o0s65`}]]),B=f(`message-circle`,[[`path`,{d:`M7.9 20A9 9 0 1 0 4 16.1L2 22Z`,key:`vv11sd`}]]),V=f(`message-square`,[[`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`,key:`1lielz`}]]),H=f(`pause`,[[`rect`,{x:`14`,y:`4`,width:`4`,height:`16`,rx:`1`,key:`zuxfzm`}],[`rect`,{x:`6`,y:`4`,width:`4`,height:`16`,rx:`1`,key:`1okwgv`}]]),U=f(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),W=f(`play`,[[`polygon`,{points:`6 3 20 12 6 21 6 3`,key:`1oa8hb`}]]),G=f(`plug-zap`,[[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m18 3-4 4h6l-4 4`,key:`16psg9`}]]),K=f(`plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M9 8V2`,key:`14iosj`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z`,key:`osxo6l`}]]),q=f(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),J=f(`puzzle`,[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]),Y=f(`radio`,[[`path`,{d:`M4.9 19.1C1 15.2 1 8.8 4.9 4.9`,key:`1vaf9d`}],[`path`,{d:`M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5`,key:`u1ii0m`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5`,key:`1j5fej`}],[`path`,{d:`M19.1 4.9C23 8.8 23 15.1 19.1 19`,key:`10b0cb`}]]),X=f(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Z=f(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),Q=f(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),$=f(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),ee=f(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),te=f(`settings`,[[`path`,{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`,key:`1qme2f`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),ne=f(`target`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`6`,key:`1vlfrh`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),re=f(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),ie=f(`trash-2`,[[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`,key:`4alrt4`}],[`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2`,key:`v07s0e`}],[`line`,{x1:`10`,x2:`10`,y1:`11`,y2:`17`,key:`1uufr5`}],[`line`,{x1:`14`,x2:`14`,y1:`11`,y2:`17`,key:`xtxkd`}]]),ae=f(`user`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),oe=f(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),se=f(`wifi`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M2 8.82a15 15 0 0 1 20 0`,key:`dnpr2z`}],[`path`,{d:`M5 12.859a10 10 0 0 1 14 0`,key:`1x1e6c`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}]]),ce=f(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);export{N as A,C as B,B as C,I as D,L as E,O as F,v as G,x as H,D as I,h as J,_ as K,E as L,j as M,A as N,F as O,k as P,T as R,V as S,R as T,b as U,S as V,y as W,p as X,m as Y,r as Z,K as _,ie as a,U as b,te as c,Q as d,Z as f,q as g,J as h,ae as i,M as j,P as k,ee as l,Y as m,se as n,re as o,X as p,g as q,oe as r,ne as s,ce as t,$ as u,G as v,z as w,H as x,W as y,w as z};
|
|
1
|
+
import{r as e,t}from"./rolldown-runtime-Dw2cE7zH.js";var n=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var I=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},L={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=L,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:F}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,I)}catch(e){I(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.4`})),r=t(((e,t)=>{t.exports=n()})),i=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),a=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),o=e=>{let t=a(e);return t.charAt(0).toUpperCase()+t.slice(1)},s=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),c=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0},l={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},u=e(r()),d=(0,u.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...d},f)=>(0,u.createElement)(`svg`,{ref:f,...l,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:s(`lucide`,i),...!a&&!c(d)&&{"aria-hidden":`true`},...d},[...o.map(([e,t])=>(0,u.createElement)(e,t)),...Array.isArray(a)?a:[a]])),f=(e,t)=>{let n=(0,u.forwardRef)(({className:n,...r},a)=>(0,u.createElement)(d,{ref:a,iconNode:t,className:s(`lucide-${i(o(e))}`,`lucide-${e}`,n),...r}));return n.displayName=o(e),n},p=f(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),m=f(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),h=f(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),g=f(`brain`,[[`path`,{d:`M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z`,key:`l5xja`}],[`path`,{d:`M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z`,key:`ep3f8r`}],[`path`,{d:`M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4`,key:`1p4c4q`}],[`path`,{d:`M17.599 6.5a3 3 0 0 0 .399-1.375`,key:`tmeiqw`}],[`path`,{d:`M6.003 5.125A3 3 0 0 0 6.401 6.5`,key:`105sqy`}],[`path`,{d:`M3.477 10.896a4 4 0 0 1 .585-.396`,key:`ql3yin`}],[`path`,{d:`M19.938 10.5a4 4 0 0 1 .585.396`,key:`1qfode`}],[`path`,{d:`M6 18a4 4 0 0 1-1.967-.516`,key:`2e4loj`}],[`path`,{d:`M19.967 17.484A4 4 0 0 1 18 18`,key:`159ez6`}]]),_=f(`chart-column`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]]),v=f(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),y=f(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),b=f(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),x=f(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),S=f(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),C=f(`circle-dollar-sign`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8`,key:`1h4pet`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}]]),w=f(`circle-user`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}],[`path`,{d:`M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662`,key:`154egf`}]]),T=f(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),E=f(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16 14`,key:`68esgv`}]]),D=f(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),O=f(`dollar-sign`,[[`line`,{x1:`12`,x2:`12`,y1:`2`,y2:`22`,key:`7eqyqh`}],[`path`,{d:`M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6`,key:`1b0p4s`}]]),k=f(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),A=f(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),j=f(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),M=f(`file-code`,[[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z`,key:`1mlx9k`}]]),N=f(`git-branch`,[[`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`,key:`17qcm7`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M18 9a9 9 0 0 1-9 9`,key:`n2h4wq`}]]),P=f(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),F=f(`hash`,[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]),I=f(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),L=f(`layout-dashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),ee=f(`lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),R=f(`list-todo`,[[`rect`,{x:`3`,y:`5`,width:`6`,height:`6`,rx:`1`,key:`1defrl`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`M13 6h8`,key:`15sg57`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 18h8`,key:`oe0vm4`}]]),z=f(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),B=f(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),V=f(`menu`,[[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 18h16`,key:`19g7jn`}],[`path`,{d:`M4 6h16`,key:`1o0s65`}]]),H=f(`message-circle`,[[`path`,{d:`M7.9 20A9 9 0 1 0 4 16.1L2 22Z`,key:`vv11sd`}]]),U=f(`message-square`,[[`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`,key:`1lielz`}]]),W=f(`pause`,[[`rect`,{x:`14`,y:`4`,width:`4`,height:`16`,rx:`1`,key:`zuxfzm`}],[`rect`,{x:`6`,y:`4`,width:`4`,height:`16`,rx:`1`,key:`1okwgv`}]]),G=f(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),K=f(`play`,[[`polygon`,{points:`6 3 20 12 6 21 6 3`,key:`1oa8hb`}]]),q=f(`plug-zap`,[[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m18 3-4 4h6l-4 4`,key:`16psg9`}]]),J=f(`plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M9 8V2`,key:`14iosj`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z`,key:`osxo6l`}]]),Y=f(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),X=f(`puzzle`,[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]),Z=f(`radio`,[[`path`,{d:`M4.9 19.1C1 15.2 1 8.8 4.9 4.9`,key:`1vaf9d`}],[`path`,{d:`M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5`,key:`u1ii0m`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5`,key:`1j5fej`}],[`path`,{d:`M19.1 4.9C23 8.8 23 15.1 19.1 19`,key:`10b0cb`}]]),Q=f(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),te=f(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),ne=f(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),re=f(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),ie=f(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),ae=f(`settings`,[[`path`,{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`,key:`1qme2f`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),oe=f(`store`,[[`path`,{d:`m2 7 4.41-4.41A2 2 0 0 1 7.83 2h8.34a2 2 0 0 1 1.42.59L22 7`,key:`ztvudi`}],[`path`,{d:`M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8`,key:`1b2hhj`}],[`path`,{d:`M15 22v-4a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2v4`,key:`2ebpfo`}],[`path`,{d:`M2 7h20`,key:`1fcdvo`}],[`path`,{d:`M22 7v3a2 2 0 0 1-2 2a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 16 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 12 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 8 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 4 12a2 2 0 0 1-2-2V7`,key:`6c3vgh`}]]),se=f(`target`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`6`,key:`1vlfrh`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),$=f(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),ce=f(`trash-2`,[[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`,key:`4alrt4`}],[`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2`,key:`v07s0e`}],[`line`,{x1:`10`,x2:`10`,y1:`11`,y2:`17`,key:`1uufr5`}],[`line`,{x1:`14`,x2:`14`,y1:`11`,y2:`17`,key:`xtxkd`}]]),le=f(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),ue=f(`user`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),de=f(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),fe=f(`wifi`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M2 8.82a15 15 0 0 1 20 0`,key:`dnpr2z`}],[`path`,{d:`M5 12.859a10 10 0 0 1 14 0`,key:`1x1e6c`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}]]),pe=f(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);export{h as $,ee as A,O as B,W as C,B as D,V as E,N as F,C as G,E as H,M as I,b as J,S as K,j as L,I as M,F as N,z as O,P,g as Q,A as R,G as S,H as T,T as U,D as V,w as W,v as X,y as Y,_ as Z,X as _,le as a,q as b,se as c,ie as d,m as et,re as f,Z as g,Q as h,ue as i,L as j,R as k,oe as l,te as m,fe as n,r as nt,ce as o,ne as p,x as q,de as r,$ as s,pe as t,p as tt,ae as u,Y as v,U as w,K as x,J as y,k as z};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e,t}from"./rolldown-runtime-Dw2cE7zH.js";import{Z as n}from"./vendor-icons-ZPvC5PUS.js";var r=t((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&te(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&te(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var ee=new MessageChannel,k=ee.port2;ee.port1.onmessage=D,O=function(){k.postMessage(null)}}else O=function(){_(D,0)};function te(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,te(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),i=t(((e,t)=>{t.exports=r()})),a=t((e=>{var t=n();function r(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(r(299));return s(e,t,null,n)},e.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.4`})),o=t(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=a()})),s=t((e=>{var t=i(),r=n(),a=o();function s(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function u(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function f(e){if(l(e)!==e)throw Error(s(188))}function p(e){var t=e.alternate;if(!t){if(t=l(e),t===null)throw Error(s(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return f(i),e;if(a===r)return f(i),t;a=a.sibling}throw Error(s(188))}if(n.return!==r.return)n=i,r=a;else{for(var o=!1,c=i.child;c;){if(c===n){o=!0,n=i,r=a;break}if(c===r){o=!0,r=i,n=a;break}c=c.sibling}if(!o){for(c=a.child;c;){if(c===n){o=!0,n=a,r=i;break}if(c===r){o=!0,r=a,n=i;break}c=c.sibling}if(!o)throw Error(s(189))}}if(n.alternate!==r)throw Error(s(190))}if(n.tag!==3)throw Error(s(188));return n.stateNode.current===n?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),ee=Symbol.for(`react.activity`),k=Symbol.for(`react.memo_cache_sentinel`),te=Symbol.iterator;function ne(e){return typeof e!=`object`||!e?null:(e=te&&e[te]||e[`@@iterator`],typeof e==`function`?e:null)}var re=Symbol.for(`react.client.reference`);function ie(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===re?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case ee:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?ie(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return ie(e(t))}catch{}}return null}var ae=Array.isArray,A=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe={pending:!1,data:null,method:null,action:null},se=[],ce=-1;function le(e){return{current:e}}function M(e){0>ce||(e.current=se[ce],se[ce]=null,ce--)}function N(e,t){ce++,se[ce]=e.current,e.current=t}var ue=le(null),P=le(null),de=le(null),fe=le(null);function pe(e,t){switch(N(de,t),N(P,e),N(ue,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}M(ue),N(ue,e)}function me(){M(ue),M(P),M(de)}function he(e){e.memoizedState!==null&&N(fe,e);var t=ue.current,n=Hd(t,e.type);t!==n&&(N(P,e),N(ue,n))}function ge(e){P.current===e&&(M(ue),M(P)),fe.current===e&&(M(fe),Qf._currentValue=oe)}var _e,ve;function ye(e){if(_e===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);_e=t&&t[1]||``,ve=-1<e.stack.indexOf(`
|
|
1
|
+
import{r as e,t}from"./rolldown-runtime-Dw2cE7zH.js";import{nt as n}from"./vendor-icons-CkI4-NxL.js";var r=t((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&te(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&te(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var ee=new MessageChannel,k=ee.port2;ee.port1.onmessage=D,O=function(){k.postMessage(null)}}else O=function(){_(D,0)};function te(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,te(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),i=t(((e,t)=>{t.exports=r()})),a=t((e=>{var t=n();function r(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(r(299));return s(e,t,null,n)},e.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.4`})),o=t(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=a()})),s=t((e=>{var t=i(),r=n(),a=o();function s(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function u(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function f(e){if(l(e)!==e)throw Error(s(188))}function p(e){var t=e.alternate;if(!t){if(t=l(e),t===null)throw Error(s(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return f(i),e;if(a===r)return f(i),t;a=a.sibling}throw Error(s(188))}if(n.return!==r.return)n=i,r=a;else{for(var o=!1,c=i.child;c;){if(c===n){o=!0,n=i,r=a;break}if(c===r){o=!0,r=i,n=a;break}c=c.sibling}if(!o){for(c=a.child;c;){if(c===n){o=!0,n=a,r=i;break}if(c===r){o=!0,r=a,n=i;break}c=c.sibling}if(!o)throw Error(s(189))}}if(n.alternate!==r)throw Error(s(190))}if(n.tag!==3)throw Error(s(188));return n.stateNode.current===n?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),ee=Symbol.for(`react.activity`),k=Symbol.for(`react.memo_cache_sentinel`),te=Symbol.iterator;function ne(e){return typeof e!=`object`||!e?null:(e=te&&e[te]||e[`@@iterator`],typeof e==`function`?e:null)}var re=Symbol.for(`react.client.reference`);function ie(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===re?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case ee:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?ie(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return ie(e(t))}catch{}}return null}var ae=Array.isArray,A=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe={pending:!1,data:null,method:null,action:null},se=[],ce=-1;function le(e){return{current:e}}function M(e){0>ce||(e.current=se[ce],se[ce]=null,ce--)}function N(e,t){ce++,se[ce]=e.current,e.current=t}var ue=le(null),P=le(null),de=le(null),fe=le(null);function pe(e,t){switch(N(de,t),N(P,e),N(ue,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}M(ue),N(ue,e)}function me(){M(ue),M(P),M(de)}function he(e){e.memoizedState!==null&&N(fe,e);var t=ue.current,n=Hd(t,e.type);t!==n&&(N(P,e),N(ue,n))}function ge(e){P.current===e&&(M(ue),M(P)),fe.current===e&&(M(fe),Qf._currentValue=oe)}var _e,ve;function ye(e){if(_e===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);_e=t&&t[1]||``,ve=-1<e.stack.indexOf(`
|
|
2
2
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
3
3
|
`+_e+e+ve}var be=!1;function xe(e,t){if(!e||be)return``;be=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
4
4
|
`),l=s.split(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{nt as t}from"./vendor-icons-CkI4-NxL.js";var n=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},r=(e=>e?n(e):n),i=e(t(),1),a=e=>e;function o(e,t=a){let n=i.useSyncExternalStore(e.subscribe,i.useCallback(()=>t(e.getState()),[e,t]),i.useCallback(()=>t(e.getInitialState()),[e,t]));return i.useDebugValue(n),n}var s=e=>{let t=r(e),n=e=>o(t,e);return Object.assign(n,t),n},c=(e=>e?s(e):s);export{c as t};
|
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-BFmC20R2.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/ui/assets/rolldown-runtime-Dw2cE7zH.js">
|
|
10
|
-
<link rel="modulepreload" crossorigin href="/ui/assets/vendor-icons-
|
|
11
|
-
<link rel="modulepreload" crossorigin href="/ui/assets/vendor-react
|
|
10
|
+
<link rel="modulepreload" crossorigin href="/ui/assets/vendor-icons-CkI4-NxL.js">
|
|
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
|
-
<link rel="modulepreload" crossorigin href="/ui/assets/vendor-state-
|
|
14
|
-
<link rel="stylesheet" crossorigin href="/ui/assets/index-
|
|
13
|
+
<link rel="modulepreload" crossorigin href="/ui/assets/vendor-state-B_-GdGNJ.js">
|
|
14
|
+
<link rel="stylesheet" crossorigin href="/ui/assets/index-CaocwyO8.css">
|
|
15
15
|
</head>
|
|
16
16
|
<body class="bg-slate-950 text-slate-100">
|
|
17
17
|
<div id="root"></div>
|
package/dist/App-XZABZ2AF.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{b as T,d as Dt,e as mo}from"./chunk-NSJAV7IH.js";import{a as At,e as co,g as uo}from"./chunk-SFUS33SO.js";import"./chunk-3DAK2XWP.js";import"./chunk-FCV2DPZQ.js";import{Box as kt,Text as xt,useInput as Fn}from"ink";import{useState as Wn,useEffect as Ht,useRef as lo}from"react";import{createContext as dr,useContext as ur,useReducer as mr}from"react";import{jsx as pr}from"react/jsx-runtime";var gr={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 fr(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 go=dr(null);function fo({children:e}){let[t,o]=mr(fr,gr);return pr(go.Provider,{value:{state:t,dispatch:o},children:e})}function Xe(){let e=ur(go);if(!e)throw new Error("useTuiState must be used within TuiProvider");return e}import{useEffect as po,useRef as xo}from"react";var xr=15e3;function To(){let{state:e,dispatch:t}=Xe(),o=xo(null),d=xo(null);po(()=>{d.current=e.session?.id??null},[e.session?.id]),po(()=>{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})},xr)};return(()=>{try{m=new Dt("/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,c=d.current;c&&(async()=>{try{let h=await T(`/tasks/${a.taskId}`);u&&h.sourceSessionId===c&&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 T("/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 Tr,useRef as hr,useState as ho,useCallback as yr}from"react";function yo(e){let[t,o]=ho([]),[d,u]=ho(!1),m=hr(null),l=yr(()=>{o([]),u(!1)},[]);return Tr(()=>{if(!e)return;let i=!0;o([]),u(!0);try{let s=new mo(e);return m.current=s,s.on("reasoning",r=>{if(!i)return;let c=r.content??"";o(h=>{let f=h[h.length-1];if(f?.type==="reasoning"){let x=[...h];return x[x.length-1]={...f,content:f.content+c},x}return[...h,{type:"reasoning",content:c,timestamp:Date.now()}]})}),s.on("tool_call",r=>{if(!i)return;let a=r;o(c=>[...c,{type:"tool_call",content:a.toolName??"unknown tool",timestamp:Date.now(),metadata:{toolName:a.toolName}}])}),s.on("tool_result",r=>{if(!i)return;let a=r;o(c=>[...c,{type:"tool_result",content:a.content??"",timestamp:Date.now()}])}),s.on("error",r=>{if(!i)return;let a=r;o(c=>[...c,{type:"error",content:a.error??"unknown error",timestamp:Date.now()}])}),s.on("complete",r=>{if(!i)return;let a=r;o(c=>[...c,{type:"complete",content:a.result??"",timestamp:Date.now(),metadata:{cost:a.costUsd,turns:a.numTurns,duration:a.totalDurationMs}}]),u(!1)}),s.connect().catch(()=>{i&&(o(r=>[...r,{type:"error",content:"Failed to connect to task stream",timestamp:Date.now()}]),u(!1))}),()=>{i=!1,s.close()}}catch{u(!1)}},[e]),{events:t,isStreaming:d,clearEvents:l}}import{useState as Kt,useEffect as br,useCallback as ht}from"react";function jt(e){return{id:e.id,status:e.status,messageCount:e.messageCount,createdAt:e.createdAt,lastActiveAt:e.lastActiveAt,title:e.title}}function bo(){let[e,t]=Kt(null),[o,d]=Kt(!0),[u,m]=Kt(null),l=ht(async()=>{try{let h=(await T("/chat/sessions?status=active")).sessions.find(f=>f.source.type==="tui");return h?jt(h):null}catch{return null}},[]),i=ht(async()=>{try{let c=await T("/chat/sessions",{method:"POST",body:{source:{type:"tui"}}}),h=jt(c.session);return t(h),h}catch{return m("Failed to create session"),null}},[]),s=ht(async c=>{try{let h=await T("/chat/messages",{method:"POST",body:{content:c,source:{type:"tui"}}});return t(f=>f&&{...f,messageCount:f.messageCount+1,lastActiveAt:Date.now()}),h}catch{return null}},[]),r=ht(async()=>{if(!e)return!1;try{return await T(`/chat/sessions/${e.id}/archive`,{method:"POST"}),t(null),!0}catch{return!1}},[e]),a=ht(async()=>{if(e)try{let c=await T(`/chat/sessions/${e.id}`);t(jt(c.session))}catch{t(null)}},[e]);return br(()=>{let c=!1;async function h(){d(!0);let f=await l();c||(f?t(f):await i(),c||d(!1))}return h(),()=>{c=!0}},[]),{session:e,loading:o,error:u,sendMessage:s,createNewSession:i,archiveCurrentSession:r,refreshSession:a,setSession:t}}import{useEffect as So,useRef as Sr,useState as Cr}from"react";function Co(e){let[t,o]=Cr(null),d=Sr(new Set);return So(()=>{if(!e)return;let u=!0,m=null;try{m=new Dt("/chat/stream"),m.on("chat_message",l=>{if(!u)return;let s=l.message;s&&s.sessionId===e&&s.role==="assistant"&&(d.current.has(s.id)||(d.current.add(s.id),o(s)))}),m.connect().catch(()=>{})}catch{}return()=>{u=!1,m?.close()}},[e]),So(()=>{d.current.clear(),o(null)},[e]),{latestMessage:t}}import{Box as Xt,Text as ve}from"ink";import Ce from"chalk";var Qt={connected:Ce.green,disconnected:Ce.red,warning:Ce.yellow,reasoning:Ce.gray,toolCall:Ce.blue,toolResult:Ce.green,error:Ce.red,dim:Ce.dim,bold:Ce.bold,statusUp:Ce.green("\u25CF"),statusDown:Ce.red("\u25CF")};import{Fragment as vr,jsx as tt,jsxs as ze}from"react/jsx-runtime";function vo(){let{state:e}=Xe(),t=e.connected?`${Qt.statusUp} Server: up`:`${Qt.statusDown} Disconnected`,o=e.activeTasks>0?`${e.activeTasks} running, ${e.queuedTasks} queued`:"No active tasks",d=e.session,m=(d?Math.floor((Date.now()-d.lastActiveAt)/6e4):1/0)>=25;return ze(Xt,{flexDirection:"column",borderStyle:"round",borderDimColor:!0,children:[ze(Xt,{children:[tt(ve,{bold:!0,children:e.version?`Adam v${e.version}`:"Adam"}),tt(ve,{children:" \u2502 "}),tt(ve,{children:t}),tt(ve,{children:" \u2502 "}),ze(ve,{children:["Tasks: ",e.activeTasks," active"]}),e.view==="chat"&&d&&ze(vr,{children:[tt(ve,{children:" \u2502 "}),ze(ve,{children:["Session: ",d.messageCount===0?"(new)":`${d.id.slice(0,8)} (${d.messageCount} turns)`]}),m&&tt(ve,{color:"yellow",children:" timeout soon"})]})]}),ze(Xt,{children:[ze(ve,{children:["Tasks: ",o]}),tt(ve,{children:" \u2502 "}),ze(ve,{children:["Cost: $",e.costToday.toFixed(2)," today"]})]})]})}import{Box as Rt,Text as Mt,useInput as wr}from"ink";import{useState as Yt,useMemo as Br}from"react";import Ir from"ink-text-input";var Er=[{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 zt(e){let t=e.toLowerCase();return Er.filter(o=>o.name.startsWith(t))}function Eo(e){let t=zt(e.toLowerCase());return t.length===1?t[0]:void 0}import{jsx as Nt,jsxs as yt}from"react/jsx-runtime";function wo({onSubmit:e}){let[t,o]=Yt(""),[d,u]=Yt(0),[m,l]=Yt(!1),i=t.startsWith("/")&&t.length>=1,s=t.slice(1),r=Br(()=>i?zt(s):[],[i,s]),a=f=>{o(f),f.startsWith("/")?(l(!0),u(0)):l(!1)},c=()=>{let f=t.trim();if(f){if(f.startsWith("/")){let x=f.slice(1),n=Eo(x);e(n?`/${n.name}`:f)}else e(f);o(""),l(!1)}},h=f=>{e(`/${f.name}`),o(""),l(!1)};return wr((f,x)=>{if(!(!m||!i||r.length===0)){if(x.upArrow){u(n=>n<=0?r.length-1:n-1);return}if(x.downArrow){u(n=>n>=r.length-1?0:n+1);return}if(x.tab){let n=r[d];n&&h(n);return}if(x.escape){l(!1),o("");return}}},{isActive:m&&i&&r.length>0}),yt(Rt,{flexDirection:"column",children:[m&&i&&r.length>0&&Nt(Rt,{flexDirection:"column",marginBottom:0,paddingX:1,children:r.map((f,x)=>{let n=x===d;return yt(Rt,{children:[Nt(Mt,{color:n?"cyan":"gray",bold:n,children:n?"\u25B8 ":" "}),yt(Mt,{color:n?"cyan":"white",bold:n,children:["/",f.name]}),yt(Mt,{dimColor:!0,children:[" \u2014 ",f.description]})]},f.name)})}),yt(Rt,{borderStyle:"round",borderDimColor:!0,children:[Nt(Mt,{bold:!0,children:"\u25B8 "}),Nt(Ir,{value:t,onChange:a,onSubmit:c,placeholder:"Type a message or / for commands..."})]})]})}import{Box as it,Text as ge}from"ink";import{useState as kr}from"react";import{jsx as ye,jsxs as Ae}from"react/jsx-runtime";function Pr({content:e}){let[t,o]=kr(!1),d=e.split(`
|
|
2
|
-
`);return d.length<=5?ye(ge,{color:"green",children:e}):t?ye(ge,{color:"green",children:e}):Ae(ge,{color:"green",children:[d.slice(0,3).join(`
|
|
3
|
-
`),`
|
|
4
|
-
`,Ae(ge,{dimColor:!0,children:["(",d.length," lines) \u25B8 \u5C55\u5F00"]})]})}function Ar({event:e}){switch(e.type){case"reasoning":return ye(it,{children:ye(ge,{color:"gray",children:e.content})});case"tool_call":return ye(it,{children:Ae(ge,{color:"blue",children:["[tool] ",e.metadata?.toolName??e.content]})});case"tool_result":return Ae(it,{flexDirection:"column",children:[ye(ge,{color:"blue",dimColor:!0,children:"[result]"}),ye(Pr,{content:e.content})]});case"error":return ye(it,{children:Ae(ge,{color:"red",children:["[error] ",e.content]})});case"complete":return Ae(it,{flexDirection:"column",marginTop:1,children:[e.content&&ye(ge,{children:e.content}),ye(ge,{dimColor:!0,children:"\u2500\u2500\u2500 Task complete \u2500\u2500\u2500"}),e.metadata?.cost!==void 0&&Ae(ge,{dimColor:!0,children:["Cost: $",e.metadata.cost.toFixed(4)]}),e.metadata?.turns!==void 0&&Ae(ge,{dimColor:!0,children:["Turns: ",e.metadata.turns]}),e.metadata?.duration!==void 0&&Ae(ge,{dimColor:!0,children:["Duration: ",(e.metadata.duration/1e3).toFixed(1),"s"]})]});default:return null}}function Bo({events:e,isStreaming:t}){return e.length===0&&!t?null:Ae(it,{flexDirection:"column",children:[t&&e.length===0&&ye(ge,{dimColor:!0,children:"Waiting for response..."}),e.map((o,d)=>ye(Ar,{event:o},d))]})}import{Box as Io,Text as ko}from"ink";import{jsx as Jt,jsxs as Dr}from"react/jsx-runtime";function Po({messages:e}){return e.length===0?null:Jt(Io,{flexDirection:"column",children:e.map((t,o)=>Dr(Io,{flexDirection:"column",marginBottom:1,children:[Jt(ko,{dimColor:!0,bold:!0,children:t.role==="user"?"You:":"Adam:"}),Jt(ko,{children:t.content})]},o))})}import{Box as bt,Text as De,useInput as Rr}from"ink";import{jsx as Re,jsxs as St}from"react/jsx-runtime";function Ao({approval:e,onResolved:t}){return Rr(o=>{o==="a"?T(`/tasks/${e.taskId}/approve`,{method:"POST",body:{approvalId:e.approvalId}}).then(()=>t()).catch(()=>t()):o==="r"&&T(`/tasks/${e.taskId}/reject`,{method:"POST",body:{approvalId:e.approvalId,reason:"rejected by user"}}).then(()=>t()).catch(()=>t())}),St(bt,{flexDirection:"column",borderStyle:"round",borderColor:"yellow",paddingX:1,children:[Re(De,{bold:!0,color:"yellow",children:"\u26A0 APPROVAL REQUIRED"}),St(bt,{marginTop:1,children:[Re(De,{children:"Tool: "}),Re(De,{bold:!0,children:e.toolName})]}),St(bt,{children:[Re(De,{children:"Input: "}),Re(De,{children:JSON.stringify(e.toolInput)})]}),St(bt,{children:[Re(De,{children:"Pattern: "}),Re(De,{dimColor:!0,children:e.matchedPattern})]}),St(bt,{marginTop:1,children:[Re(De,{color:"green",children:"[a] Approve"}),Re(De,{children:" "}),Re(De,{color:"red",children:"[r] Reject"})]})]})}import{Box as Ct,Text as le,useInput as Mr}from"ink";import{useState as Nr,useEffect as Lr}from"react";import{jsx as Oe,jsxs as Ee}from"react/jsx-runtime";var _r=300;function Do({approval:e,onResolved:t,onTimeout:o}){let[d,u]=Nr(_r);Lr(()=>{let l=setInterval(()=>{u(i=>i<=1?(clearInterval(l),o(),0):i-1)},1e3);return()=>clearInterval(l)},[o]),Mr(l=>{l==="a"?T(`/tasks/${e.taskId}/approve-plan`,{method:"POST",body:{planId:e.planId,decision:"allow",approvalType:"once"}}).then(()=>t()).catch(()=>t()):l==="r"?T(`/tasks/${e.taskId}/approve-plan`,{method:"POST",body:{planId:e.planId,decision:"deny",reason:"rejected by user"}}).then(()=>t()).catch(()=>t()):l==="p"&&T(`/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 Ee(Ct,{flexDirection:"column",borderStyle:"round",borderColor:"cyan",paddingX:1,children:[Oe(le,{bold:!0,color:"cyan",children:"EXECUTION PLAN \u2014 APPROVAL REQUIRED"}),Ee(le,{dimColor:!0,children:["Plan ID: ",e.planId]}),Ee(le,{dimColor:!0,children:["Time remaining: ",d,"s"]}),Ee(Ct,{marginTop:1,children:[Oe(le,{children:"Overall Risk: "}),Oe(le,{bold:!0,color:m,children:e.plan.overallRisk.toUpperCase()})]}),Ee(le,{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 Ee(Ct,{paddingLeft:2,children:[Ee(le,{children:["[",l.index,"] "]}),Oe(le,{children:l.description}),Ee(le,{dimColor:!0,children:[" (",l.toolsNeeded.join(", "),")"]}),Ee(le,{color:i,children:[" [",l.riskLevel,"]"]})]},l.index)}),Ee(Ct,{marginTop:1,children:[Oe(le,{dimColor:!0,children:"Permissions: "}),Oe(le,{children:Object.keys(e.plan.requiredPermissions).join(", ")||"none"})]}),Ee(Ct,{marginTop:1,children:[Oe(le,{color:"green",children:"[a] Allow once "}),Oe(le,{color:"green",children:"[p] Allow permanent "}),Oe(le,{color:"red",children:"[r] Deny"})]})]})}import{Box as ot,Text as J,useInput as Vr}from"ink";import{useEffect as qr,useState as Ve,useCallback as Mo}from"react";import{Box as Q,Text as D,useInput as $r}from"ink";import{useState as Zt,useEffect as Or}from"react";import{jsx as $,jsxs as U}from"react/jsx-runtime";function Ro({taskId:e,onBack:t}){let[o,d]=Zt(null),[u,m]=Zt([]),[l,i]=Zt(null);if(Or(()=>{T(`/tasks/${e}`).then(r=>d(r)).catch(r=>i(r instanceof Error?r.message:String(r))),T(`/tasks/${e}/plan`).then(r=>m(r.plans)).catch(()=>m([]))},[e]),$r((r,a)=>{(r==="b"||a.escape)&&t()}),l)return U(Q,{flexDirection:"column",children:[U(D,{color:"red",children:["Error: ",l]}),$(D,{dimColor:!0,children:"[b] Back"})]});if(!o)return U(D,{dimColor:!0,children:["Loading task ",e,"..."]});let s=u[0];return U(Q,{flexDirection:"column",children:[$(D,{bold:!0,color:"cyan",children:"Task Detail"}),U(Q,{marginTop:1,flexDirection:"column",children:[U(Q,{children:[$(D,{children:"ID: "}),$(D,{dimColor:!0,children:String(o.id)})]}),U(Q,{children:[$(D,{children:"Status: "}),$(D,{bold:!0,children:String(o.status)})]}),U(Q,{children:[$(D,{children:"Prompt: "}),$(D,{children:String(o.prompt)})]}),o.result?U(Q,{children:[$(D,{children:"Result: "}),$(D,{children:String(o.result).slice(0,200)})]}):null,o.error?U(Q,{children:[$(D,{color:"red",children:"Error: "}),$(D,{children:String(o.error)})]}):null,o.deliverTo?.length?U(Q,{children:[$(D,{children:"DeliverTo: "}),$(D,{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?U(Q,{children:[$(D,{children:"ReportTo: "}),$(D,{dimColor:!0,children:o.reportTo.map(r=>r.type==="channel"?`channel ${r.channelId?.slice(0,8)}`:`session ${r.sessionId?.slice(0,8)}`).join(", ")})]}):null]}),s&&U(Q,{marginTop:1,flexDirection:"column",children:[$(D,{bold:!0,color:"cyan",children:"Execution Plan"}),U(Q,{children:[$(D,{children:"Plan ID: "}),$(D,{dimColor:!0,children:s.id})]}),U(Q,{children:[$(D,{children:"Status: "}),$(D,{children:s.status})]}),s.plan.overallRisk&&U(Q,{children:[$(D,{children:"Overall Risk: "}),$(D,{bold:!0,color:s.plan.overallRisk==="high"?"red":s.plan.overallRisk==="medium"?"yellow":"green",children:s.plan.overallRisk.toUpperCase()})]}),U(D,{bold:!0,children:["Steps (",s.plan.steps.length,"):"]}),s.plan.steps.map(r=>{let a=r.riskLevel==="high"?"red":r.riskLevel==="medium"?"yellow":"green";return U(Q,{paddingLeft:2,children:[U(D,{children:["[",r.index,"] ",r.description]}),U(D,{color:a,children:[" [",r.riskLevel,"]"]})]},r.index)}),s.deviationReport&&U(Q,{marginTop:1,flexDirection:"column",children:[$(D,{bold:!0,color:"yellow",children:"Deviation Report"}),U(D,{children:["Planned: ",s.deviationReport.stepsPlanned," | Executed: ",s.deviationReport.stepsExecuted," | Accuracy: ",(s.deviationReport.overallAccuracy*100).toFixed(0),"%"]}),s.deviationReport.deviations.map((r,a)=>U(Q,{paddingLeft:2,children:[U(D,{color:"yellow",children:["[",r.deviationType,"] "]}),U(D,{children:["Step ",r.stepIndex,": ",r.actual]})]},a))]}),s.learnedRules&&s.learnedRules.length>0&&U(Q,{marginTop:1,flexDirection:"column",children:[$(D,{bold:!0,color:"blue",children:"Learned Rules"}),s.learnedRules.map((r,a)=>$(Q,{paddingLeft:2,children:U(D,{children:["* ",r]})},a))]})]}),!s&&u.length===0&&$(Q,{marginTop:1,children:$(D,{dimColor:!0,children:"No execution plan for this task."})}),$(Q,{marginTop:1,children:$(D,{dimColor:!0,children:"[b] Back"})})]})}import{Fragment as Wr,jsx as ce,jsxs as pe}from"react/jsx-runtime";var Ur={pending:"gray",queued:"gray",running:"yellow",paused:"yellow",completed:"green",failed:"red",cancelled:"gray"},Lt=["all","pending","queued","running","completed","failed","cancelled"],eo=15;function _t({onBack:e}){let[t,o]=Ve([]),[d,u]=Ve(!0),[m,l]=Ve("list"),[i,s]=Ve(0),[r,a]=Ve("all"),[c,h]=Ve(0),[f,x]=Ve(0),[n,g]=Ve(null),[R,k]=Ve([]),H=Mo(async()=>{u(!0);try{let B=new URLSearchParams({limit:"100"});r!=="all"&&B.set("status",r);let S=await T(`/tasks?${B}`);o(S.tasks)}catch{o([])}finally{u(!1)}},[r]);qr(()=>{H()},[H]);let W=Math.max(1,Math.ceil(t.length/eo)),I=t.slice(f*eo,(f+1)*eo),te=Mo(async()=>{let B=I[i];if(B)try{await T(`/tasks/${B.id}/cancel`,{method:"POST"}),g(`Cancelled: ${B.id.slice(0,8)}`),l("list"),H()}catch(S){g(`Failed: ${S instanceof Error?S.message:String(S)}`),l("list")}},[I,i,H]);return Vr((B,S)=>{if(m==="detail"){(S.escape||S.return||B==="q")&&l("list");return}if(m==="cancelling"){B==="y"?te():l("list");return}if(m==="filter"){if(S.escape){l("list");return}S.upArrow&&c>0&&h(p=>p-1),S.downArrow&&c<Lt.length-1&&h(p=>p+1),S.return&&(a(Lt[c]),x(0),s(0),l("list"));return}if(S.escape||B==="q"){e();return}if(S.upArrow&&i>0&&s(p=>p-1),S.downArrow&&i<I.length-1&&s(p=>p+1),S.return){let p=I[i];p&&(k([]),l("detail"),T(`/tasks/${p.id}/logs?limit=20`).then(({logs:P})=>k(P)).catch(()=>k([])))}if(B==="x"&&I[i]){let p=I[i];["running","pending","queued","paused"].includes(p.status)?(l("cancelling"),g(null)):g(`Cannot cancel task in status: ${p.status}`)}B==="f"&&(h(Lt.indexOf(r)),l("filter")),B==="r"&&H(),(S.pageDown||B==="n")&&f<W-1&&(x(p=>p+1),s(0)),(S.pageUp||B==="p")&&f>0&&(x(p=>p-1),s(0))}),d?ce(J,{dimColor:!0,children:"Loading tasks..."}):m==="filter"?pe(ot,{flexDirection:"column",children:[ce(J,{bold:!0,children:"Filter by status:"}),Lt.map((B,S)=>ce(ot,{children:pe(J,{color:S===c?"cyan":"white",children:[S===c?"> ":" ",B,B===r?" (current)":""]})},B)),ce(J,{dimColor:!0,children:"Enter: select Esc: cancel"})]}):m==="detail"&&I[i]?ce(Ro,{taskId:I[i].id,onBack:()=>l("list")}):m==="cancelling"&&I[i]?pe(ot,{flexDirection:"column",children:[pe(J,{color:"red",children:['Cancel task "',I[i].id.slice(0,8),'"? (y/n)']}),n&&ce(J,{color:"red",children:n})]}):pe(ot,{flexDirection:"column",children:[pe(ot,{children:[pe(J,{bold:!0,children:["Tasks (",t.length,")"]}),r!=="all"&&pe(J,{dimColor:!0,children:[" [filter: ",r,"]"]}),pe(J,{dimColor:!0,children:[" \u2014 Page ",f+1,"/",W]})]}),n&&ce(J,{color:n.startsWith("Failed")||n.startsWith("Cannot")?"red":"green",children:n}),t.length===0?pe(J,{dimColor:!0,children:["No tasks found",r!=="all"?` with status "${r}"`:"","."]}):pe(Wr,{children:[ce(ot,{marginTop:1,children:pe(J,{bold:!0,children:[" ",Ye("ID",10),Ye("STATUS",12),Ye("PROMPT",40),Ye("DURATION",10),"COST"]})}),I.map((B,S)=>{let p=S===i,P=B.totalDurationMs?`${(B.totalDurationMs/1e3).toFixed(0)}s`:"\u2014",N=B.costUsd!==void 0?`$${B.costUsd.toFixed(4)}`:"\u2014",_e=Ur[B.status]??"white";return pe(ot,{children:[ce(J,{color:p?"cyan":"white",children:p?"> ":" "}),ce(J,{dimColor:!0,children:Ye(B.id.slice(0,8),10)}),ce(J,{color:_e,children:Ye(B.status,12)}),ce(J,{children:Ye(Fr(B.prompt,38),40)}),ce(J,{dimColor:!0,children:Ye(P,10)}),ce(J,{dimColor:!0,children:N})]},B.id)})]}),ce(J,{dimColor:!0,children:"Enter:detail x:cancel f:filter n/p:page r:refresh Esc/q:back"})]})}function Ye(e,t){return e?e.length>=t?e:e+" ".repeat(t-e.length):" ".repeat(t)}function Fr(e,t){return e.length<=t?e:e.slice(0,t-3)+"..."}uo();import{Box as vt,Text as we,useInput as Gr}from"ink";import{useEffect as Hr,useState as No}from"react";import{readFileSync as Kr,existsSync as jr}from"fs";import{parse as Qr}from"yaml";import{Fragment as Xr,jsx as Be,jsxs as Je}from"react/jsx-runtime";function _o({onBack:e}){let[t,o]=No(null),[d,u]=No(null);return Gr((m,l)=>{(l.escape||m==="q")&&e()}),Hr(()=>{try{let m=co;if(!jr(m)){u(`Config file not found: ${m}`);return}let l=Kr(m,"utf-8");o(Qr(l))}catch(m){u(m.message)}},[]),d?Je(vt,{flexDirection:"column",children:[Be(we,{color:"red",children:d}),Be(we,{dimColor:!0,children:"Press Esc to go back"})]}):t?Je(vt,{flexDirection:"column",children:[Be(we,{bold:!0,children:"Configuration (Esc to go back)"}),Be(vt,{marginTop:1,flexDirection:"column",children:Be($o,{obj:t,indent:0})})]}):Be(we,{dimColor:!0,children:"Loading config..."})}function $o({obj:e,indent:t}){let o=" ".repeat(t);return Be(Xr,{children:Object.entries(e).map(([d,u])=>u&&typeof u=="object"&&!Array.isArray(u)?Je(vt,{flexDirection:"column",children:[Je(we,{children:[o,Be(we,{color:"cyan",children:d}),":"]}),Be($o,{obj:u,indent:t+1})]},d):Array.isArray(u)?Je(vt,{flexDirection:"column",children:[Je(we,{children:[o,Be(we,{color:"cyan",children:d}),":"]}),u.map((m,l)=>Je(we,{children:[o," - ",Lo(d,String(m))]},l))]},d):Je(we,{children:[o,Be(we,{color:"cyan",children:d}),": ",Lo(d,String(u))]},d))})}function Lo(e,t){return e.toLowerCase().includes("key")||e.toLowerCase().includes("token")?!t||t.length<8?"****":t.slice(0,4)+"****":t}import{Box as $t,Text as Ie,useInput as zr}from"ink";import{useEffect as Yr,useState as to}from"react";import{jsx as Et,jsxs as Me}from"react/jsx-runtime";function Oo({onBack:e}){let[t,o]=to([]),[d,u]=to(!0),[m,l]=to(null);return zr((i,s)=>{(s.escape||i==="q")&&e()}),Yr(()=>{T("/evolution-audit?limit=20").then(i=>{o(i),u(!1)}).catch(i=>{l(i.message),u(!1)})},[]),d?Et(Ie,{dimColor:!0,children:"Loading evolution log..."}):m?Me($t,{flexDirection:"column",children:[Et(Ie,{color:"red",children:m}),Et(Ie,{dimColor:!0,children:"Press Esc to go back"})]}):t.length===0?Me($t,{flexDirection:"column",children:[Et(Ie,{dimColor:!0,children:"No evolution records yet"}),Et(Ie,{dimColor:!0,children:"Press Esc to go back"})]}):Me($t,{flexDirection:"column",children:[Me(Ie,{bold:!0,children:["Evolution Audit Log (",t.length," records) \u2014 Esc to go back"]}),t.map(i=>Me($t,{flexDirection:"column",marginTop:1,children:[Me(Ie,{bold:!0,children:["[",new Date(i.timestamp).toLocaleString(),"]"]}),i.triggerTaskId&&Me(Ie,{dimColor:!0,children:[" Task: ",i.triggerTaskId.slice(0,8)]}),i.diff.split(`
|
|
5
|
-
`).map((s,r)=>s.startsWith("+")?Me(Ie,{color:"green",children:[" ",s]},r):s.startsWith("-")?Me(Ie,{color:"red",children:[" ",s]},r):Me(Ie,{dimColor:!0,children:[" ",s]},r))]},i.id))]})}import{Box as qe,Text as X,useInput as Jr}from"ink";import Zr from"ink-text-input";import{useEffect as en,useState as at}from"react";import{jsx as fe,jsxs as oe}from"react/jsx-runtime";var tn={pending:"gray",planning:"cyan",executing:"yellow",evaluating:"blue",replanning:"magenta",completed:"green",failed:"red",paused:"gray"};function on(e,t=20){let o=Math.round(e*t),d=t-o;return"\u2588".repeat(o)+"\u2591".repeat(d)}function rn(e){let t=Math.max(0,Math.floor((e-Date.now())/864e5));return t===0?"< 1d":`${t}d`}function Ot({onBack:e}){let[t,o]=at([]),[d,u]=at(null),[m,l]=at("list"),[i,s]=at(""),[r,a]=at(!1),[c,h]=at(null);Jr((n,g)=>{if(m==="create"){g.escape&&(l("list"),s(""),h(null));return}(g.escape||n==="q")&&e(),n==="c"&&(l("create"),h(null)),n==="r"&&f()});let f=()=>{T("/goals?limit=20").then(({goals:n})=>o(n)).catch(n=>u(n.message))};en(()=>{f()},[]);let x=async n=>{if(n.trim()){a(!0),h(null);try{let g=await T("/goals",{method:"POST",body:{input:n.trim()}});h(`Goal created: ${g.goal.name}`),s(""),l("list"),f()}catch(g){h(`Failed: ${g instanceof Error?g.message:String(g)}`)}finally{a(!1)}}};return d?oe(qe,{flexDirection:"column",children:[oe(X,{color:"red",children:["Failed to load goals: ",d]}),fe(X,{dimColor:!0,children:"Press Esc or q to return"})]}):m==="create"?oe(qe,{flexDirection:"column",children:[fe(X,{bold:!0,children:"Create Goal"}),fe(X,{dimColor:!0,children:"Describe your SMART goal in natural language:"}),oe(qe,{marginTop:1,children:[fe(X,{color:"cyan",children:"> "}),fe(Zr,{value:i,onChange:s,onSubmit:x})]}),r&&fe(X,{color:"yellow",children:"Creating goal..."}),c&&fe(X,{color:c.startsWith("Failed")?"red":"green",children:c}),fe(X,{dimColor:!0,children:"Press Esc to cancel"})]}):oe(qe,{flexDirection:"column",children:[oe(X,{bold:!0,children:["Goal Dashboard (",t.length,")"]}),t.length===0?fe(X,{dimColor:!0,children:"No goals found. Press c to create one."}):fe(qe,{marginTop:1,flexDirection:"column",children:t.map(n=>{let g=n.targetValue>0?n.currentValue/n.targetValue:0,R=tn[n.status]??"white";return oe(qe,{marginBottom:1,flexDirection:"column",children:[oe(qe,{children:[fe(X,{bold:!0,color:R,children:n.name}),oe(X,{dimColor:!0,children:[" (",n.role,")"]}),fe(X,{dimColor:!0,children:" \u2014 "}),fe(X,{color:R,children:n.status})]}),oe(qe,{children:[oe(X,{dimColor:!0,children:[" ",on(g)," "]}),oe(X,{color:g>=1?"green":"white",children:[Math.round(g*100),"%"]}),oe(X,{dimColor:!0,children:[" (",n.currentValue,"/",n.targetValue," ",n.metricType,")"]})]}),oe(qe,{children:[oe(X,{dimColor:!0,children:[" \u23F0 ",rn(n.deadline)," left"]}),oe(X,{dimColor:!0,children:[" | \u{1F4B0} $",n.budgetUsd]}),oe(X,{dimColor:!0,children:[" | ID: ",n.id.slice(0,8)]})]})]},n.id)})}),fe(X,{dimColor:!0,children:"c:create r:refresh Esc/q:back"})]})}import{Box as lt,Text as be,useInput as nn}from"ink";import{useEffect as sn,useState as Vo}from"react";import{jsx as Fe,jsxs as Ue}from"react/jsx-runtime";function an(e,t,o=15){let d=e/(e+t),u=Math.round(d*o);return"\u2593".repeat(u)+"\u2591".repeat(o-u)}function qo({onBack:e}){let[t,o]=Vo([]),[d,u]=Vo(null);if(nn((l,i)=>{(i.escape||l==="q")&&e()}),sn(()=>{T("/strategies?limit=50").then(l=>o(l.strategies??[])).catch(l=>u(l.message))},[]),d)return Ue(lt,{flexDirection:"column",children:[Ue(be,{color:"red",children:["Failed to load strategies: ",d]}),Fe(be,{dimColor:!0,children:"Press Esc or q to return"})]});if(t.length===0)return Ue(lt,{flexDirection:"column",children:[Fe(be,{dimColor:!0,children:"No strategies yet. Strategies are created when goals are executed."}),Fe(be,{dimColor:!0,children:"Press Esc or q to return"})]});let m=new Map;for(let l of t){let i=`${l.role}/${l.taskType}`,s=m.get(i)??[];s.push(l),m.set(i,s)}return Ue(lt,{flexDirection:"column",children:[Fe(be,{bold:!0,children:"Strategy Lab"}),Fe(be,{dimColor:!0,children:"Thompson Sampling populations \u2014 higher bar = higher selection probability"}),Fe(lt,{marginTop:1,flexDirection:"column",children:Array.from(m.entries()).map(([l,i])=>Ue(lt,{marginBottom:1,flexDirection:"column",children:[Fe(be,{bold:!0,color:"cyan",children:l}),i.sort((s,r)=>{let a=s.alpha/(s.alpha+s.beta);return r.alpha/(r.alpha+r.beta)-a}).map(s=>{let r=s.alpha/(s.alpha+s.beta);return Ue(lt,{children:[Fe(be,{dimColor:!0,children:" "}),Ue(be,{children:[an(s.alpha,s.beta)," "]}),Ue(be,{color:r>.6?"green":r>.4?"yellow":"red",children:[(r*100).toFixed(0),"%"]}),Ue(be,{dimColor:!0,children:[" ",s.name," (\u03B1=",s.alpha.toFixed(1)," \u03B2=",s.beta.toFixed(1)," trials=",s.totalTrials,")"]})]},s.id)})]},l))}),Fe(be,{dimColor:!0,children:"Press Esc or q to return"})]})}import{Box as xe,Text as K,useInput as mn}from"ink";import oo from"ink-text-input";import{useEffect as gn,useState as We,useCallback as ct}from"react";import{CronExpressionParser as fn}from"cron-parser";import{useState as ln,useEffect as cn,useCallback as Uo,useRef as dn}from"react";var un=3e3;function Ze(){let[e,t]=ln(null),o=dn(null),d=Uo(()=>{o.current&&(clearTimeout(o.current),o.current=null),t(null)},[]),u=Uo((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},un))},[]);return cn(()=>()=>{o.current&&clearTimeout(o.current)},[]),{message:e,setMessage:u,clearMessage:d}}import{jsx as j,jsxs as se}from"react/jsx-runtime";var ro=["manual","cron","event"],Vt={name:"",triggerType:"manual",cron:"",stepPrompt:""};function pn(e){try{return fn.parse(e).next().toDate().toLocaleString()}catch{return"invalid"}}function Ut({onBack:e}){let[t,o]=We([]),[d,u]=We(!0),[m,l]=We(0),[i,s]=We("list"),[r,a]=We({...Vt}),[c,h]=We("name"),[f,x]=We(null),{message:n,setMessage:g,clearMessage:R}=Ze(),[k,H]=We(!1),[W,I]=We(!1),te=ct(()=>{u(!0),T("/task-templates").then(({templates:b})=>{o(b),u(!1)}).catch(()=>u(!1))},[]);gn(()=>{te()},[te]);let B=i==="create"||i==="edit",S=ct(async()=>{let b=t[m];if(!(!b||k)){H(!0),g(`Triggering ${b.name}...`,"loading");try{let w=await T(`/task-templates/${b.id}/run`,{method:"POST"});g(`Triggered: ${b.name} (${w.executionId})`,"success")}catch(w){g(`Trigger failed: ${w instanceof Error?w.message:String(w)}`,"error")}finally{H(!1)}}},[t,m,k,g]),p=ct(async()=>{let b=t[m];if(!b||W)return;if(b.trigger?.type!=="cron"&&b.trigger?.type!=="event"){g("Toggle not applicable for manual triggers","error");return}let w=!b.enabled;I(!0),g(`${b.name} \u2192 ${w?"enabling":"disabling"}...`,"loading");try{await T(`/task-templates/${b.id}`,{method:"PATCH",body:{enabled:w}}),o(_=>_.map(ne=>ne.id===b.id?{...ne,enabled:w}:ne)),g(`${b.name} ${w?"enabled":"disabled"}`,"success")}catch(_){g(`Toggle failed: ${_ instanceof Error?_.message:String(_)}`,"error")}finally{I(!1)}},[t,m,W,g]),P=ct(async()=>{let b=t[m];if(b)try{await T(`/task-templates/${b.id}`,{method:"DELETE"}),g(`Deleted: ${b.name}`,"success"),te(),l(w=>Math.max(0,Math.min(w,t.length-2)))}catch(w){g(`Delete failed: ${w instanceof Error?w.message:String(w)}`,"error")}},[t,m,te]),N=ct(()=>{let b=t[m];b&&(x(b.id),a({name:b.name,triggerType:b.trigger?.type??"manual",cron:b.trigger?.cron??"",stepPrompt:b.steps?.[0]?.prompt??""}),h("name"),s("edit"))},[t,m]),_e=ct(async()=>{let b={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 T("/task-templates",{method:"POST",body:b}),g(`Created: ${r.name}`,"success")):i==="edit"&&f&&(await T(`/task-templates/${f}`,{method:"PATCH",body:b}),g(`Updated: ${r.name}`,"success"))}catch(w){g(`Save failed: ${w instanceof Error?w.message:String(w)}`,"error")}s("list"),a({...Vt}),x(null),te()},[r,i,f,te]);return mn((b,w)=>{if(B){if(w.escape){s("list"),a({...Vt}),x(null);return}if(w.return){let _=["name","triggerType","cron","stepPrompt"],ne=_.indexOf(c);if(ne<_.length-1){let je=ne+1;if(_[je]==="cron"&&r.triggerType!=="cron"&&je++,je<_.length){h(_[je]);return}}_e();return}if(w.tab&&c==="triggerType"){a(_=>{let ne=ro.indexOf(_.triggerType);return{..._,triggerType:ro[(ne+1)%ro.length]}});return}return}if(w.escape||b==="q"){e();return}if(w.upArrow){l(_=>Math.max(0,_-1));return}if(w.downArrow){l(_=>Math.min(t.length-1,_+1));return}if(b==="t"){S();return}if(b==="d"){P();return}if(b==="e"){N();return}if(b==="c"){a({...Vt}),h("name"),s("create");return}if(b==="s"||b===" "){p();return}b==="r"&&(te(),R())}),d?j(K,{dimColor:!0,children:"Loading templates..."}):B?se(xe,{flexDirection:"column",children:[se(K,{bold:!0,children:[i==="create"?"Create Template":"Edit Template"," (Esc to cancel)"]}),se(xe,{marginTop:1,flexDirection:"column",children:[se(xe,{children:[se(K,{bold:c==="name",color:c==="name"?"cyan":void 0,children:["Name:"," "]}),c==="name"?j(oo,{value:r.name,onChange:b=>a(w=>({...w,name:b})),placeholder:"template name"}):j(K,{children:r.name||"(empty)"})]}),se(xe,{children:[se(K,{bold:c==="triggerType",color:c==="triggerType"?"cyan":void 0,children:["Trigger:"," "]}),j(K,{children:r.triggerType}),c==="triggerType"&&j(K,{dimColor:!0,children:" (Tab to cycle, Enter to continue)"})]}),r.triggerType==="cron"&&se(xe,{children:[se(K,{bold:c==="cron",color:c==="cron"?"cyan":void 0,children:["Cron:"," "]}),c==="cron"?j(oo,{value:r.cron,onChange:b=>a(w=>({...w,cron:b})),placeholder:"*/5 * * * *"}):j(K,{children:r.cron||"(empty)"})]}),se(xe,{children:[se(K,{bold:c==="stepPrompt",color:c==="stepPrompt"?"cyan":void 0,children:["Step Prompt:"," "]}),c==="stepPrompt"?j(oo,{value:r.stepPrompt,onChange:b=>a(w=>({...w,stepPrompt:b})),placeholder:"What should this template do?"}):j(K,{children:r.stepPrompt||"(empty)"})]})]}),j(xe,{marginTop:1,children:j(K,{dimColor:!0,children:"Enter: next field / submit | Esc: cancel"})})]}):se(xe,{flexDirection:"column",children:[se(K,{bold:!0,children:["Automations (",t.length,") (Esc to go back)"]}),n&&j(xe,{marginTop:1,children:se(K,{color:n.type==="success"?"green":n.type==="error"?"red":"gray",children:[n.type==="success"?"\u2713 ":n.type==="error"?"\u2717 ":"\u2192 ",n.text]})}),t.length===0?j(xe,{marginTop:1,children:j(K,{dimColor:!0,children:"No templates found. Press c to create one."})}):j(xe,{marginTop:1,flexDirection:"column",children:t.map((b,w)=>{let _=w===m,ne=b.trigger?.type==="cron"&&b.trigger?.cron?pn(b.trigger.cron):"";return se(xe,{children:[j(K,{color:_?"cyan":void 0,bold:_,children:_?"> ":" "}),j(K,{color:_?"cyan":void 0,bold:_,children:qt(b.name,24)}),j(K,{dimColor:!0,children:qt(b.trigger?.type,10)}),b.trigger?.type!=="cron"&&b.trigger?.type!=="event"?j(K,{dimColor:!0,children:qt("\u2014",6)}):j(K,{color:b.enabled?"green":"gray",children:qt(b.enabled?"on":"off",6)}),ne&&se(K,{dimColor:!0,children:["next: ",ne]})]},b.id)})}),j(xe,{marginTop:1,children:j(K,{dimColor:!0,children:"t:trigger s:toggle d:delete e:edit c:create r:refresh"})})]})}function qt(e,t){return e?e.length>=t?e:e+" ".repeat(t-e.length):" ".repeat(t)}import{Box as et,Text as Te,useInput as xn}from"ink";import Tn from"ink-text-input";import{useEffect as hn,useState as dt,useCallback as Fo}from"react";import{jsx as de,jsxs as rt}from"react/jsx-runtime";function Wo({onBack:e}){let[t,o]=dt([]),[d,u]=dt(""),[m,l]=dt(!0),[i,s]=dt(!1),[r,a]=dt(""),[c,h]=dt(null),f=Fo(()=>{l(!0),T("/webhooks").then(({webhooks:n,auth:g})=>{o(n),u(g),l(!1)}).catch(()=>l(!1))},[]);hn(()=>{f()},[f]);let x=Fo(async n=>{if(n.trim())try{let g=await T(`/webhooks/${encodeURIComponent(n.trim())}`,{method:"POST"});h(`Triggered: ${g.executionId}`)}catch(g){h(`Trigger failed: ${g instanceof Error?g.message:String(g)}`)}},[]);return xn((n,g)=>{if(i){if(g.escape){s(!1),a("");return}if(g.return){x(r),s(!1),a("");return}return}if(g.escape||n==="q"){e();return}if(n==="t"){s(!0),a(""),h(null);return}n==="r"&&(f(),h(null))}),m?de(Te,{dimColor:!0,children:"Loading webhooks..."}):rt(et,{flexDirection:"column",children:[rt(Te,{bold:!0,children:["Webhooks (",t.length,") (Esc to go back)"]}),rt(Te,{dimColor:!0,children:["Auth: ",d]}),c&&de(et,{marginTop:1,children:de(Te,{color:"yellow",children:c})}),i&&rt(et,{marginTop:1,children:[de(Te,{bold:!0,color:"cyan",children:"Trigger webhook: "}),de(Tn,{value:r,onChange:a,placeholder:"webhook name or ID"}),de(Te,{dimColor:!0,children:" (Enter to trigger, Esc to cancel)"})]}),t.length===0?de(et,{marginTop:1,children:de(Te,{dimColor:!0,children:"No webhooks available. Create templates with triggers to expose webhooks."})}):rt(et,{marginTop:1,flexDirection:"column",children:[de(et,{children:rt(Te,{bold:!0,children:[ut("NAME",24),ut("DESCRIPTION",36),ut("TRIGGER",28),"TAGS"]})}),t.map(n=>rt(et,{children:[de(Te,{children:ut(n.displayName,24)}),de(Te,{dimColor:!0,children:ut(yn(n.description??"",34),36)}),de(Te,{dimColor:!0,children:ut(n.trigger,28)}),de(Te,{dimColor:!0,children:n.tags?.join(", ")??""})]},n.name))]}),de(et,{marginTop:1,children:de(Te,{dimColor:!0,children:"t:trigger r:refresh"})})]})}function ut(e,t){return e?e.length>=t?e:e+" ".repeat(t-e.length):" ".repeat(t)}function yn(e,t){return e.length<=t?e:e.slice(0,t-3)+"..."}import{Box as Ne,Text as Z,useInput as bn}from"ink";import Sn from"ink-text-input";import{useEffect as Go,useState as Ge,useCallback as no}from"react";import{jsx as ee,jsxs as ke}from"react/jsx-runtime";function Cn(e){return e>=4?"red":e===3?"yellow":"gray"}function vn(e){return e>=4?"HIGH":e===3?"MED ":"LOW "}function En(e){return new Date(e).toLocaleDateString()}function Ko({onBack:e}){let[t,o]=Ge([]),[d,u]=Ge(0),[m,l]=Ge([]),[i,s]=Ge(!0),[r,a]=Ge(!1),[c,h]=Ge(""),[f,x]=Ge("all"),[n,g]=Ge(null),[R,k]=Ge(!1),H=no(()=>{T("/agents").then(({agents:p})=>{o(p),s(!1)}).catch(()=>s(!1))},[]);Go(()=>{H()},[H]);let W=t[d],I=no(()=>{W&&(k(!1),T(`/memories/${W.id}`).then(({memories:p})=>{l(p),g(null)}).catch(p=>g(`Failed: ${p instanceof Error?p.message:String(p)}`)))},[W]);Go(()=>{W&&I()},[W,I]);let te=no(async p=>{if(!(!W||!p.trim()))try{let P=await T("/memories/query",{method:"POST",body:{agentId:W.id,prompt:p.trim()}});l(P.memories),k(!0),g(`Search: ${P.count} results`)}catch(P){g(`Search failed: ${P instanceof Error?P.message:String(P)}`)}},[W]),B=r,S=m.filter(p=>f==="all"?!0:f==="high"?p.importance>3:f==="medium"?p.importance===3:p.importance<3);return bn((p,P)=>{if(B){if(P.escape){a(!1),h("");return}if(P.return){te(c),a(!1),h("");return}return}if(P.escape||p==="q"){e();return}if(p==="a"){u(N=>(N+1)%Math.max(1,t.length));return}if(P.leftArrow){u(N=>(N-1+t.length)%Math.max(1,t.length));return}if(P.rightArrow){u(N=>(N+1)%Math.max(1,t.length));return}if(p==="s"){a(!0),h(""),g(null);return}if(p==="h"){x(N=>N==="high"?"all":"high");return}if(p==="m"){x(N=>N==="medium"?"all":"medium");return}if(p==="l"){x(N=>N==="low"?"all":"low");return}p==="r"&&I()}),i?ee(Z,{dimColor:!0,children:"Loading agents..."}):t.length===0?ke(Ne,{flexDirection:"column",children:[ee(Z,{dimColor:!0,children:"No agents found"}),ee(Z,{dimColor:!0,children:"Press Esc to go back"})]}):ke(Ne,{flexDirection:"column",children:[ee(Z,{bold:!0,children:"Memories (Esc to go back)"}),ke(Ne,{marginTop:1,children:[ee(Z,{children:"Agent: "}),ee(Z,{bold:!0,color:"cyan",children:W?.name??"?"}),ke(Z,{dimColor:!0,children:[" (",d+1,"/",t.length,") [a/arrows to switch]"]})]}),ee(Ne,{children:ke(Z,{dimColor:!0,children:["Filter: ",f==="all"?"all":f," | ",R?"search results":"all memories"," (",S.length,")"]})}),n&&ee(Ne,{children:ee(Z,{color:"yellow",children:n})}),r&&ke(Ne,{marginTop:1,children:[ee(Z,{bold:!0,color:"cyan",children:"Search: "}),ee(Sn,{value:c,onChange:h,placeholder:"search query..."}),ee(Z,{dimColor:!0,children:" (Enter to search, Esc to cancel)"})]}),S.length===0?ee(Ne,{marginTop:1,children:ke(Z,{dimColor:!0,children:["No memories",f!=="all"?` matching filter '${f}'`:""]})}):ee(Ne,{marginTop:1,flexDirection:"column",children:S.map(p=>ke(Ne,{marginBottom:0,children:[ke(Z,{color:Cn(p.importance),bold:!0,children:[vn(p.importance)," "]}),ee(Z,{dimColor:!0,children:Ho(p.type??"?",12)}),ee(Z,{dimColor:!0,children:Ho(`\xD7${p.retrievedCount??0}`,5)}),ke(Z,{children:[wn(p.content,55)," "]}),ee(Z,{dimColor:!0,children:En(p.createdAt)}),p.score!==void 0&&ke(Z,{dimColor:!0,children:[" (",p.score.toFixed(2),")"]})]},p.id))}),ee(Ne,{marginTop:1,children:ee(Z,{dimColor:!0,children:"s:search h:high m:medium l:low a:agent r:refresh"})})]})}function Ho(e,t){return e?e.length>=t?e:e+" ".repeat(t-e.length):" ".repeat(t)}function wn(e,t){return e.length<=t?e:e.slice(0,t-3)+"..."}import{Box as nt,Text as he,useInput as Bn}from"ink";import In from"ink-text-input";import{useState as He,useEffect as jo,useCallback as Qo}from"react";import{jsx as Pe,jsxs as Le}from"react/jsx-runtime";var Xo={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"],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"]},kn={"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)","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 zo({onBack:e}){let{state:t}=Xe(),[o,d]=He({}),[u,m]=He([]),[l,i]=He(null),[s,r]=He("view"),[a,c]=He(0),[h,f]=He(""),[x,n]=He(null),[g,R]=He(!1),[k,H]=He([]),W=Object.values(Xo).flat(),I=Qo(()=>{T("/config").then(S=>{d(S.config),m(S.mutable)}).catch(S=>i(S.message)),T("/config/env-diff").then(S=>{H(S.diffs)}).catch(()=>{})},[]);jo(()=>{I()},[I]),jo(()=>{t.configVersion>0&&I()},[t.configVersion,I]);let te=Qo(async()=>{let S=W[a];if(S){R(!0),n(null);try{let p=h,P=o[S];if(P&&typeof P.value=="number"&&(p=Number(h),isNaN(p))){n("Invalid number"),R(!1);return}let N=await T("/config",{method:"PATCH",body:{[S]:p}});N.updated.length>0&&(n(`Updated: ${S}`),I()),N.errors.length>0&&n(N.errors[0]),r("view")}catch(p){n(`Failed: ${p instanceof Error?p.message:String(p)}`)}finally{R(!1)}}},[W,a,h,o,I]);if(Bn((S,p)=>{if(s==="edit"){if(p.escape){r("view");return}return}if(p.escape||S==="q"){e();return}if(p.upArrow&&a>0&&c(P=>P-1),p.downArrow&&a<W.length-1&&c(P=>P+1),p.return||S==="e"){let P=W[a],N=o[P];N&&N.mutable?(f(String(N.value??"")),r("edit"),n(null)):N&&!N.mutable&&n("This setting requires a restart to change")}S==="r"&&(I(),n("Refreshed")),S==="s"&&k.length>0&&T("/config/sync-to-env",{method:"POST"}).then(()=>{n("Synced to .env"),H([]),I()}),S==="l"&&k.length>0&&T("/config/load-from-env",{method:"POST"}).then(()=>{n("Loaded from .env"),I()})}),l)return Le(nt,{flexDirection:"column",children:[Le(he,{color:"red",children:["Failed to load config: ",l]}),Pe(he,{dimColor:!0,children:"Press Esc or q to return"})]});let B=0;return Le(nt,{flexDirection:"column",children:[Pe(he,{bold:!0,children:"Settings"}),x&&Pe(he,{color:x.startsWith("Failed")||x.startsWith("This setting")?"yellow":"green",children:x}),k&&k.length>0&&Le(nt,{flexDirection:"column",marginBottom:1,children:[Le(he,{color:"yellow",children:[".env differs from DB (",k.length," key(s)): ",k.map(S=>S.envKey).join(", ")]}),Pe(he,{dimColor:!0,children:"s:sync DB\u2192.env l:load .env\u2192DB"})]}),Pe(nt,{marginTop:1,flexDirection:"column",children:Object.entries(Xo).map(([S,p])=>Le(nt,{marginBottom:1,flexDirection:"column",children:[Pe(he,{bold:!0,color:"cyan",children:S}),p.map(P=>{let N=o[P],b=B++===a,w=u.includes(P),_=kn[P]??P,ne=N?String(N.value??""):"...";return s==="edit"&&b?Le(nt,{children:[Le(he,{color:"cyan",children:["> ",_,": "]}),Pe(In,{value:h,onChange:f,onSubmit:()=>{te()}}),g&&Pe(he,{color:"yellow",children:" saving..."})]},P):Le(nt,{children:[Le(he,{color:b?"cyan":"white",children:[b?"> ":" ",w?" ":"\u{1F512} ",_,": "," "]}),Pe(he,{color:w?"white":"gray",children:ne}),!w&&Pe(he,{dimColor:!0,children:" (restart required)"})]},P)})]},S))}),Pe(he,{dimColor:!0,children:"Enter/e:edit r:refresh Esc/q:back"})]})}import{Box as st,Text as ue,useInput as Pn}from"ink";import{useEffect as An,useState as so,useCallback as Dn}from"react";import{jsx as ie,jsxs as gt}from"react/jsx-runtime";function Yo({onBack:e}){let[t,o]=so([]),[d,u]=so(!0),[m,l]=so(0),{message:i,setMessage:s,clearMessage:r}=Ze(),a=Dn(()=>{u(!0),T("/plugins").then(({plugins:c})=>{o(c),u(!1)}).catch(()=>u(!1))},[]);return An(()=>{a()},[a]),Pn((c,h)=>{if(h.escape||c==="q"){e();return}if(h.upArrow){l(f=>Math.max(0,f-1));return}if(h.downArrow){l(f=>Math.min(t.length-1,f+1));return}c==="r"&&(a(),r())}),d?ie(ue,{dimColor:!0,children:"Loading plugins..."}):gt(st,{flexDirection:"column",children:[gt(ue,{bold:!0,children:["Plugins (",t.length,") (Esc to go back)"]}),i&&ie(st,{marginTop:1,children:gt(ue,{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?ie(st,{marginTop:1,children:ie(ue,{dimColor:!0,children:"No plugins installed."})}):gt(st,{marginTop:1,flexDirection:"column",children:[gt(st,{children:[ie(ue,{dimColor:!0,children:" "}),ie(ue,{dimColor:!0,children:mt("Name",24)}),ie(ue,{dimColor:!0,children:mt("Scope",8)}),ie(ue,{dimColor:!0,children:mt("User",6)}),ie(ue,{dimColor:!0,children:"Path"})]}),t.map((c,h)=>{let f=h===m,x=c.id.split("@")[0];return gt(st,{children:[ie(ue,{color:f?"cyan":void 0,bold:f,children:f?"> ":" "}),ie(ue,{color:f?"cyan":void 0,bold:f,children:mt(x,24)}),ie(ue,{color:f?"cyan":void 0,bold:f,children:mt(c.scope,8)}),ie(ue,{color:c.globalEnabled?"green":"gray",children:mt(c.globalEnabled?"on":"off",6)}),ie(ue,{dimColor:!0,children:c.installPath})]},c.id)})]}),ie(st,{marginTop:1,children:ie(ue,{dimColor:!0,children:"r:refresh"})})]})}function mt(e,t){return e?e.length>=t?e:e+" ".repeat(t-e.length):" ".repeat(t)}import{Box as Ft,Text as Jo,useInput as Rn}from"ink";import{useState as Mn}from"react";import{jsx as ft,jsxs as io}from"react/jsx-runtime";var Nn=[{key:"1",id:"tasks",label:"Tasks"},{key:"2",id:"automations",label:"Automations"},{key:"3",id:"goals",label:"Goals"}];function Zo({onBack:e}){let[t,o]=Mn("tasks");return Rn((d,u)=>{if(u.escape||d==="q"){e();return}if(d==="1"){o("tasks");return}if(d==="2"){o("automations");return}if(d==="3"){o("goals");return}}),io(Ft,{flexDirection:"column",children:[io(Ft,{gap:1,marginBottom:1,children:[Nn.map(d=>{let u=t===d.id;return ft(Ft,{children:io(Jo,{color:u?"cyan":"gray",bold:u,underline:u,children:["[",d.key,":",d.label,"]"]})},d.id)}),ft(Ft,{flexGrow:1}),ft(Jo,{dimColor:!0,children:"Esc: back"})]}),t==="tasks"&&ft(_t,{onBack:e}),t==="automations"&&ft(Ut,{onBack:e}),t==="goals"&&ft(Ot,{onBack:e})]})}import{Box as G,Text as O,useInput as Ln}from"ink";import{useEffect as _n,useState as wt}from"react";import{jsx as A,jsxs as re}from"react/jsx-runtime";var er={connected:"green",connecting:"yellow",disconnected:"gray",error:"red"};function tr({onBack:e}){let[t,o]=wt([]),[d,u]=wt(!0),[m,l]=wt(0),[i,s]=wt(null),[r,a]=wt("");_n(()=>{c()},[]);async function c(){try{let x=await T("/channels");o(x.channels)}catch{}u(!1)}async function h(x){if(t.find(g=>g.id===x)?.platform==="wechat")try{a("Starting WeChat QR login...");let g=await T(`/channels/${x}/wechat/qr-start`,{method:"POST"});if(g.qrcodeUrl){a(`Scan QR: ${g.qrcodeUrl}
|
|
6
|
-
Waiting for scan...`);let R=await T(`/channels/${x}/wechat/qr-wait`,{method:"POST",body:{sessionKey:g.sessionKey,timeoutMs:12e4}});a(R.message)}else a(g.message);c()}catch{a("WeChat connect failed")}else try{await T(`/channels/${x}/connect`,{method:"POST"}),a("Connecting..."),c()}catch{a("Connect failed")}}async function f(x){try{await T(`/channels/${x}/disconnect`,{method:"POST"}),a("Disconnected"),c()}catch{a("Disconnect failed")}}return Ln((x,n)=>{if(i){if(n.escape||x==="q"){s(null);return}if(x==="c"){h(i.id);return}if(x==="d"){f(i.id);return}return}if(n.escape){e();return}if(n.upArrow){l(g=>Math.max(0,g-1));return}if(n.downArrow){l(g=>Math.min(t.length-1,g+1));return}if(n.return&&t[m]){s(t[m]),a("");return}}),d?A(G,{flexDirection:"column",children:A(O,{dimColor:!0,children:"Loading channels..."})}):i?re(G,{flexDirection:"column",children:[re(G,{marginBottom:1,children:[re(O,{bold:!0,children:["Channel: ",i.name]}),A(O,{dimColor:!0,children:" (Esc to go back)"})]}),re(G,{flexDirection:"column",gap:0,children:[re(O,{children:["ID: ",i.id]}),re(O,{children:["Platform: ",i.platform]}),re(O,{children:["Status: ",A(O,{color:er[i.status]??"white",children:i.status})]}),re(O,{children:["Enabled: ",i.enabled?"yes":"no"]}),re(O,{children:["Messages: ",i.messageCount]}),re(O,{children:["Config: ",JSON.stringify(i.config)]})]}),A(G,{marginTop:1,children:A(O,{dimColor:!0,children:"[c] Connect [d] Disconnect [Esc] Back"})}),r&&A(O,{color:"yellow",children:r})]}):re(G,{flexDirection:"column",children:[re(G,{marginBottom:1,children:[A(O,{bold:!0,children:"Channels"}),re(O,{dimColor:!0,children:[" (",t.length," total) "]}),A(O,{dimColor:!0,children:"Arrow keys to select, Enter for detail, Esc to return"})]}),t.length===0?A(O,{dimColor:!0,children:"No channels configured. Add channels via API or config."}):re(G,{flexDirection:"column",children:[re(G,{children:[A(G,{width:3,children:A(O,{dimColor:!0,children:" "})}),A(G,{width:12,children:A(O,{bold:!0,dimColor:!0,children:"ID"})}),A(G,{width:16,children:A(O,{bold:!0,dimColor:!0,children:"Name"})}),A(G,{width:12,children:A(O,{bold:!0,dimColor:!0,children:"Platform"})}),A(G,{width:14,children:A(O,{bold:!0,dimColor:!0,children:"Status"})}),A(G,{width:10,children:A(O,{bold:!0,dimColor:!0,children:"Enabled"})}),A(G,{width:10,children:A(O,{bold:!0,dimColor:!0,children:"Messages"})})]}),t.map((x,n)=>re(G,{children:[A(G,{width:3,children:A(O,{children:n===m?">":" "})}),A(G,{width:12,children:A(O,{inverse:n===m,children:x.id.slice(0,8)})}),A(G,{width:16,children:A(O,{children:x.name})}),A(G,{width:12,children:A(O,{children:x.platform})}),A(G,{width:14,children:re(O,{color:er[x.status]??"white",children:[x.status==="connected"?"\u25CF":x.status==="error"?"\u2717":"\u25CB"," ",x.status]})}),A(G,{width:10,children:A(O,{color:x.enabled?"green":"gray",children:x.enabled?"yes":"no"})}),A(G,{width:10,children:A(O,{children:x.messageCount})})]},x.id))]})]})}import{Box as pt,Text as Ke,useInput as On}from"ink";import{useEffect as Vn,useState as It,useCallback as qn}from"react";import{Box as V,Text as E,useInput as $n}from"ink";import Wt from"ink-text-input";import{useEffect as or,useState as ae,useCallback as Bt}from"react";uo();import{Fragment as rr,jsx as v,jsxs as M}from"react/jsx-runtime";function nr({roleId:e,onBack:t}){let[o,d]=ae(null),[u,m]=ae([]),[l,i]=ae(!0),[s,r]=ae("view"),[a,c]=ae(""),[h,f]=ae(0),[x,n]=ae(""),[g,R]=ae([]),[k,H]=ae(0),[W,I]=ae(new Set),[te,B]=ae("inline"),[S,p]=ae(""),[P,N]=ae(""),[_e,b]=ae([]),[w,_]=ae(new Set),[ne,je]=ae(0),{message:F,setMessage:z}=Ze(),me=Bt(()=>{i(!0),T(`/roles/${e}`).then(({role:y,boundPlugins:L})=>{d(y),m(L??[]),c(y.cagPrompt??""),I(new Set(y.allowedTools??[])),B(y.executionMode??"inline"),p(y.model??""),N(y.maxBudgetUsd!=null?String(y.maxBudgetUsd):""),i(!1)}).catch(()=>i(!1))},[e]);or(()=>{me()},[me]),or(()=>{B(o?.executionMode??"inline"),p(o?.model??""),N(o?.maxBudgetUsd!=null?String(o?.maxBudgetUsd):"")},[o?.id,o?.executionMode,o?.model,o?.maxBudgetUsd]);let ir=Bt(async()=>{if(o)try{await T(`/roles/${o.id}`,{method:"PATCH",body:{cagPrompt:a}}),z("CAG prompt saved","success"),r("view"),me()}catch(y){z(`Save failed: ${y instanceof Error?y.message:String(y)}`,"error")}},[o,a,me,z]),ar=Bt(async()=>{if(o)try{await T(`/roles/${o.id}`,{method:"PATCH",body:{additionalDirectories:$e}}),z("Directories saved","success"),r("view"),me()}catch(y){z(`Save failed: ${y instanceof Error?y.message:String(y)}`,"error")}},[o,me,z]),lr=Bt(async()=>{if(o)try{await T(`/roles/${o.id}`,{method:"PATCH",body:{allowedTools:Array.from(W)}}),z("Tool permissions saved","success"),r("view"),me()}catch(y){z(`Save failed: ${y instanceof Error?y.message:String(y)}`,"error")}},[o,W,me,z]),cr=Bt(async()=>{if(!o)return;let y={executionMode:te};S!==void 0&&(y.model=S);let L=parseFloat(P);isNaN(L)||(y.maxBudgetUsd=L);try{await T(`/roles/${o.id}`,{method:"PATCH",body:y}),z("Execution config saved","success"),r("view"),me()}catch(C){z(`Save failed: ${C instanceof Error?C.message:String(C)}`,"error")}},[o,te,S,P,me,z]),$e=o?.additionalDirectories??[];return $n((y,L)=>{if(L.escape){r("view");return}if(y==="r"){me();return}switch(s){case"view":{if(y==="c"){r("edit-cag");return}if(y==="d"){r("edit-dirs"),f(0),n("");return}if(y==="t"){r("edit-tools");return}if(y==="x"){r("edit-exec");return}if(y==="h"){T("/channels?enabled=true").then(({channels:C})=>{b(C.map(Y=>({name:Y.name,id:Y.id}))),_(new Set(o?.allowedChannels??[])),je(0),r("edit-channels")}).catch(()=>z("Failed to load channels","error"));return}if(y==="i"){if(!o)return;let C=!o.inheritUserSettings;T(`/roles/${o.id}`,{method:"PATCH",body:{inheritUserSettings:C}}).then(()=>{z(`Inherit user settings: ${C?"ON":"OFF"}`,"success"),me()}).catch(()=>z("Failed to toggle","error"));return}break}case"edit-cag":{if(L.ctrl&&y==="s"){ir();return}break}case"edit-dirs":{if(y==="s"){ar();return}if(y==="a"){r("edit-dirs-add");return}if(y==="x"&&$e.length>0){d(C=>C&&{...C,additionalDirectories:$e.filter((Y,Qe)=>Qe!==h)}),f(C=>Math.max(0,Math.min(C,$e.length-2)));return}if(L.upArrow){f(C=>Math.max(0,C-1));return}if(L.downArrow){f(C=>Math.min($e.length-1,C+1));return}break}case"edit-dirs-add":{if(L.escape){r("edit-dirs"),n(""),R([]);return}if(L.return&&g.length>0){let C=g[k];C&&(n(C.endsWith("/")?C:C+"/"),R([]));return}if(L.return){let C=x.trim();C&&C.startsWith("/")?(d(Y=>Y&&{...Y,additionalDirectories:[...Y.additionalDirectories??[],{path:C}]}),n(""),R([]),r("edit-dirs")):z("Path must be absolute (must start with /)","error");return}if(L.tab){let C=x.trim();if(!C||!C.startsWith("/"))return;T(`/fs/suggest-dirs?prefix=${encodeURIComponent(C)}`).then(({suggestions:Y})=>{Y.length===1?(n(Y[0]+"/"),R([])):Y.length>1&&(R(Y),H(0))}).catch(()=>{R([])});return}if(L.upArrow&&g.length>0){H(C=>Math.max(0,C-1));return}if(L.downArrow&&g.length>0){H(C=>Math.min(g.length-1,C+1));return}break}case"edit-tools":{if(y==="s"){lr();return}let C=parseInt(y,10)-1;if(!isNaN(C)&&C>=0&&C<At.length){let Y=At[C];I(Qe=>{let Pt=new Set(Qe);return Pt.has(Y)?Pt.delete(Y):Pt.add(Y),Pt});return}break}case"edit-exec":{if(y==="s"){cr();return}if(L.tab){B(C=>C==="inline"?"isolated":"inline");return}break}case"edit-channels":{if(y==="s"){if(!o)return;let C=w.size>0?Array.from(w):[];T(`/roles/${o.id}`,{method:"PATCH",body:{allowedChannels:C}}).then(()=>{z("Channels saved","success"),r("view"),me()}).catch(()=>z("Save failed","error"));return}if(y==="u"){if(!o)return;T(`/roles/${o.id}`,{method:"PATCH",body:{allowedChannels:null}}).then(()=>{z("Channels: unrestricted","success"),r("view"),me()}).catch(()=>z("Save failed","error"));return}if(y===" "){let C=_e[ne];C&&_(Y=>{let Qe=new Set(Y);return Qe.has(C.name)?Qe.delete(C.name):Qe.add(C.name),Qe});return}if(L.upArrow){je(C=>Math.max(0,C-1));return}if(L.downArrow){je(C=>Math.min(_e.length-1,C+1));return}break}}}),l?v(E,{dimColor:!0,children:"Loading role..."}):o?s==="edit-cag"?M(V,{flexDirection:"column",children:[v(E,{bold:!0,children:"CAG Prompt \u2014 Edit (Esc cancel, Ctrl+S save)"}),v(Wt,{value:a,onChange:c,placeholder:"Character And Guidance prompt..."}),F&&v(V,{marginTop:1,children:v(E,{color:F.type==="error"?"red":"green",children:F.text})})]}):s==="edit-dirs-add"?M(V,{flexDirection:"column",children:[v(E,{bold:!0,children:"Add Directory (Enter confirm, Esc cancel, Tab:complete)"}),v(Wt,{value:x,onChange:y=>{n(y),R([])},placeholder:"/absolute/path/to/directory"}),g.length>0&&M(V,{flexDirection:"column",marginTop:1,children:[g.map((y,L)=>M(E,{color:L===k?"cyan":void 0,dimColor:L!==k,children:[L===k?"> ":" ",y,"/"]},y)),v(E,{dimColor:!0,children:"\u2191\u2193 navigate, Enter select, Tab:confirm"})]}),F&&v(V,{marginTop:1,children:v(E,{color:F.type==="error"?"red":"green",children:F.text})})]}):s==="edit-dirs"?M(V,{flexDirection:"column",children:[v(E,{bold:!0,children:"Additional Directories (\u2191\u2193 navigate, a:add x:remove s:save Esc:cancel)"}),F&&v(V,{children:v(E,{color:F.type==="error"?"red":F.type==="success"?"green":"gray",children:F.text})}),$e.length===0?v(E,{dimColor:!0,children:"No directories. Press a to add one."}):$e.map((y,L)=>M(V,{children:[v(E,{color:L===h?"cyan":void 0,bold:L===h,children:L===h?"> ":" "}),v(E,{color:L===h?"cyan":void 0,children:y.path})]},y.path))]}):s==="edit-tools"?M(V,{flexDirection:"column",children:[v(E,{bold:!0,children:"Tool Permissions \u2014 toggle with number key (s:save Esc:cancel)"}),F&&v(V,{children:v(E,{color:F.type==="error"?"red":F.type==="success"?"green":"gray",children:F.text})}),At.map((y,L)=>{let C=W.has(y);return M(V,{children:[M(E,{dimColor:!0,children:[L+1,". "]}),v(E,{color:C?"green":"red",children:C?"[ON] ":"[OFF] "}),v(E,{children:y})]},y)})]}):s==="edit-exec"?M(V,{flexDirection:"column",children:[v(E,{bold:!0,children:"Execution Config (Tab:cycle mode, Enter on field, s:save Esc:cancel)"}),M(V,{children:[v(E,{bold:!0,children:" Mode: "}),v(E,{color:"cyan",children:te}),v(E,{dimColor:!0,children:" (Tab to toggle)"})]}),M(V,{children:[v(E,{bold:!0,children:" Model: "}),v(Wt,{value:S,onChange:p,placeholder:"sonnet, opus, haiku, or blank"})]}),M(V,{children:[v(E,{bold:!0,children:" Max Budget (USD): "}),v(Wt,{value:P,onChange:N,placeholder:"0 = unlimited"})]}),F&&v(V,{children:v(E,{color:F.type==="error"?"red":F.type==="success"?"green":"gray",children:F.text})})]}):s==="edit-channels"?M(V,{flexDirection:"column",children:[v(E,{bold:!0,children:"Allowed Channels (Space:toggle, u:unrestricted, s:save, Esc:cancel)"}),_e.length===0?v(E,{dimColor:!0,children:"No channels available"}):_e.map((y,L)=>M(V,{children:[M(E,{children:[L===ne?">":" "," "]}),M(E,{color:w.has(y.name)?"green":"gray",children:["[",w.has(y.name)?"x":" ","] ",y.name]})]},y.id)),M(E,{dimColor:!0,children:["Selected: ",w.size>0?Array.from(w).join(", "):"none (= block all)"]}),F&&v(V,{children:v(E,{color:F.type==="error"?"red":F.type==="success"?"green":"gray",children:F.text})})]}):M(V,{flexDirection:"column",children:[M(E,{bold:!0,children:["Role: ",o.name]}),M(V,{children:[v(E,{dimColor:!0,children:"ID: "}),v(E,{children:o.id})]}),M(V,{children:[v(E,{dimColor:!0,children:"Status: "}),v(E,{color:o.status==="active"?"green":o.status==="probation"?"yellow":"red",children:o.status})]}),o.performanceScore!=null&&M(V,{children:[v(E,{dimColor:!0,children:"Score: "}),M(E,{children:[(o.performanceScore*100).toFixed(0),"%"]})]}),M(V,{children:[v(E,{dimColor:!0,children:"Created: "}),v(E,{children:new Date(o.createdAt).toLocaleString()})]}),M(V,{children:[v(E,{dimColor:!0,children:"Execution: "}),M(E,{children:[o.executionMode??"inline"," / ",o.model??"inherit"," / ",o.maxBudgetUsd!=null?`$${o.maxBudgetUsd}`:"no limit"]})]}),$e.length>0&&M(rr,{children:[v(E,{bold:!0,children:"Additional Directories:"}),$e.map(y=>M(E,{dimColor:!0,children:[" ",y.path]},y.path))]}),M(V,{children:[v(E,{dimColor:!0,children:"Channels: "}),v(E,{children:o.allowedChannels===void 0?"Unrestricted":o.allowedChannels.length===0?"Blocked":o.allowedChannels.join(", ")})]}),M(V,{children:[v(E,{dimColor:!0,children:"Inherit User Settings: "}),v(E,{color:o.inheritUserSettings?"green":"gray",children:o.inheritUserSettings?"Yes":"No"})]}),o.learnedRules.length>0&&M(rr,{children:[v(E,{bold:!0,children:"Learned Rules:"}),o.learnedRules.map(y=>M(E,{dimColor:!0,children:[" - ",y]},y))]}),F&&v(V,{children:v(E,{color:F.type==="error"?"red":F.type==="success"?"green":"gray",children:F.text})}),v(V,{marginTop:1,children:v(E,{dimColor:!0,children:"c:CAG d:dirs t:tools x:exec h:channels i:inherit r:refresh Esc:back"})})]}):v(E,{dimColor:!0,children:"Role not found."})}import{jsx as Se,jsxs as Gt}from"react/jsx-runtime";function sr({onBack:e}){let[t,o]=It([]),[d,u]=It(!0),[m,l]=It(0),[i,s]=It("list"),[r,a]=It(null),{message:c,setMessage:h,clearMessage:f}=Ze(),x=qn(()=>{u(!0),T("/roles").then(({roles:n})=>{o(n.map(g=>({id:g.id,name:g.name,status:g.status,performanceScore:g.performanceScore,createdAt:g.createdAt}))),u(!1)}).catch(()=>u(!1))},[]);return Vn(()=>{x()},[x]),On((n,g)=>{if(g.escape||n==="q"){e();return}if(g.upArrow){l(R=>Math.max(0,R-1));return}if(g.downArrow){l(R=>Math.min(t.length-1,R+1));return}if(n==="r"&&(x(),f()),n===`
|
|
7
|
-
`||n==="o"||n==="e"){t.length>0&&(a(t[m].id),s("detail"));return}}),d?Se(Ke,{dimColor:!0,children:"Loading roles..."}):i==="detail"&&r?Se(nr,{roleId:r,onBack:()=>s("list")}):Gt(pt,{flexDirection:"column",children:[Gt(Ke,{bold:!0,children:["Roles (",t.length,") (Esc to go back)"]}),c&&Se(pt,{marginTop:1,children:Gt(Ke,{color:c.type==="success"?"green":c.type==="error"?"red":"gray",children:[c.type==="success"?"\u2713 ":c.type==="error"?"\u2717 ":"\u2192 ",c.text]})}),t.length===0?Se(pt,{marginTop:1,children:Se(Ke,{dimColor:!0,children:"No roles found. Roles define agent behavior and bind plugins."})}):Se(pt,{marginTop:1,flexDirection:"column",children:t.map((n,g)=>{let R=g===m,k=n.performanceScore!=null?`${(n.performanceScore*100).toFixed(0)}%`:"\u2014";return Gt(pt,{children:[Se(Ke,{color:R?"cyan":void 0,bold:R,children:R?"> ":" "}),Se(Ke,{color:R?"cyan":void 0,bold:R,children:ao(n.name,24)}),Se(Ke,{color:Un(n.status),children:ao(n.status,12)}),Se(Ke,{dimColor:!0,children:ao(k,8)})]},n.id)})}),Se(pt,{marginTop:1,children:Se(Ke,{dimColor:!0,children:"Enter/O/E:open Esc:back r:refresh"})})]})}function Un(e){return e==="active"?"green":e==="probation"?"yellow":e==="retired"||e==="dead"?"red":"gray"}function ao(e,t){return e?e.length>=t?e:e+" ".repeat(t-e.length):" ".repeat(t)}import{Fragment as jn,jsx as q,jsxs as Tt}from"react/jsx-runtime";function Gn(){let{state:e,dispatch:t}=Xe(),{session:o,sendMessage:d,createNewSession:u,archiveCurrentSession:m}=bo(),[l,i]=Wn([]);Ht(()=>{t({type:"SET_SESSION",session:o})},[o,t]),To();let{latestMessage:s}=Co(o?.id??null),r=lo(null);Ht(()=>{s&&s.id!==r.current&&(r.current=s.id,i(k=>[...k,{role:"assistant",content:s.content}]))},[s]);let{events:a,isStreaming:c,clearEvents:h}=yo(e.activeTaskId),f=a[a.length-1],x=f?.type==="complete"&&!c,n=lo(null),g=lo("");Ht(()=>{g.current=a.filter(k=>k.type==="reasoning").map(k=>k.content).join("")},[a]),Ht(()=>{if(x&&e.activeTaskId!==n.current){n.current=e.activeTaskId;let k=f?.content||g.current;k&&i(H=>[...H,{role:"assistant",content:k}])}},[x,f,e.activeTaskId]);let R=async k=>{let H=k.trim().toLowerCase();if(["quit","exit","/quit","/exit"].includes(H)&&process.exit(0),k.startsWith("/")){let I=k.slice(1),B={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"}[I];if(B){t({type:"SET_VIEW",view:B});return}if(I==="new"){if(await m()){let p=await u();i([]),h(),p&&i([{role:"assistant",content:`Session archived. New session started: ${p.id.slice(0,8)}`}])}return}if(I==="session"){let S=o?`Session: ${o.id}
|
|
8
|
-
Turns: ${o.messageCount}
|
|
9
|
-
Last active: ${new Date(o.lastActiveAt).toLocaleString()}`:"No active session";i(p=>[...p,{role:"assistant",content:S}]);return}}if(i(I=>[...I,{role:"user",content:k}]),h(),!await d(k)){i(I=>[...I,{role:"assistant",content:"Failed to send message. Server may be disconnected."}]);return}};return Tt(kt,{flexDirection:"column",paddingX:1,children:[q(vo,{}),Tt(kt,{flexGrow:1,flexDirection:"column",paddingY:1,children:[e.view==="chat"&&Tt(jn,{children:[q(Po,{messages:l}),q(Bo,{events:a,isStreaming:c}),!e.connected&&!e.serverUnreachable&&q(kt,{children:q(xt,{color:"red",children:"Server disconnected. Attempting to reconnect..."})}),e.serverUnreachable&&Tt(kt,{flexDirection:"column",children:[q(xt,{color:"red",bold:!0,children:"Server unreachable after 15s."}),q(xt,{dimColor:!0,children:"Check: adam server logs"}),q(xt,{dimColor:!0,children:"Type /quit to exit."})]})]}),e.view==="work"&&q(Zo,{onBack:()=>t({type:"SET_VIEW",view:"chat"})}),e.view==="tasks"&&q(_t,{onBack:()=>t({type:"SET_VIEW",view:"chat"})}),e.view==="config"&&q(_o,{onBack:()=>t({type:"SET_VIEW",view:"chat"})}),e.view==="evolution"&&q(Oo,{onBack:()=>t({type:"SET_VIEW",view:"chat"})}),e.view==="goals"&&q(Ot,{onBack:()=>t({type:"SET_VIEW",view:"chat"})}),e.view==="strategies"&&q(qo,{onBack:()=>t({type:"SET_VIEW",view:"chat"})}),e.view==="templates"&&q(Ut,{onBack:()=>t({type:"SET_VIEW",view:"chat"})}),e.view==="webhooks"&&q(Wo,{onBack:()=>t({type:"SET_VIEW",view:"chat"})}),e.view==="memories"&&q(Ko,{onBack:()=>t({type:"SET_VIEW",view:"chat"})}),e.view==="plugins"&&q(Yo,{onBack:()=>t({type:"SET_VIEW",view:"chat"})}),e.view==="roles"&&q(sr,{onBack:()=>t({type:"SET_VIEW",view:"chat"})}),e.view==="settings"&&q(zo,{onBack:()=>t({type:"SET_VIEW",view:"chat"})}),e.view==="channels"&&q(tr,{onBack:()=>t({type:"SET_VIEW",view:"chat"})})]}),e.pendingPlanApproval?q(Do,{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?q(Ao,{approval:e.pendingApproval,onResolved:()=>t({type:"SET_PENDING_APPROVAL",approval:null})}):q(wo,{onSubmit:R}),e.planTimeoutNotice&&q(Hn,{planId:e.planTimeoutNotice.planId,onDismiss:()=>t({type:"SET_PLAN_TIMEOUT_NOTICE",planId:null})})]})}function Hn({planId:e,onDismiss:t}){return Fn(o=>{o==="d"&&t()}),Tt(kt,{borderStyle:"round",borderColor:"yellow",paddingX:1,children:[Tt(xt,{color:"yellow",children:["Plan ",e," was auto-denied after 300s timeout."]}),q(xt,{dimColor:!0,children:" [d] Dismiss"})]})}function Kn(){return q(fo,{children:q(Gn,{})})}export{Kn as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{x as a,y as b}from"./chunk-D6WM2OQS.js";import"./chunk-5JLMSNIW.js";import"./chunk-IXF3XBGX.js";import"./chunk-AXMXXUPO.js";import"./chunk-KICPHTI2.js";import"./chunk-FUGJMHY4.js";import"./chunk-5ASEAZCR.js";import"./chunk-742NWPTQ.js";import"./chunk-PQ7KPALO.js";import"./chunk-2GXYBWLS.js";import"./chunk-WZOMGJSY.js";import"./chunk-WXN3PSVX.js";import"./chunk-L7426WNY.js";import"./chunk-L7JP7DUO.js";import"./chunk-HAWA62R2.js";import"./chunk-VF6GJGD6.js";import"./chunk-T25NLVMY.js";import"./chunk-ETQ7KC73.js";import"./chunk-FYDFMYUP.js";import"./chunk-U36NBCR3.js";import"./chunk-XNWZZYAV.js";import"./chunk-PCSZW2PE.js";import"./chunk-SFUS33SO.js";import"./chunk-3DAK2XWP.js";import"./chunk-FCV2DPZQ.js";export{b as createAdamTools,a as getToolsFingerprint};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{b as y}from"./chunk-NXTTKAQX.js";import{b as m}from"./chunk-PQ7KPALO.js";import"./chunk-FDWW245P.js";import"./chunk-L7JP7DUO.js";import"./chunk-PCSZW2PE.js";import"./chunk-SFUS33SO.js";import{c as f}from"./chunk-3DAK2XWP.js";import"./chunk-FCV2DPZQ.js";var s=f("channels"),c=new Map,h=3e5,v=new Set(["telegram"]);function A(n){let a=n.trim().toLowerCase().match(/^(yes|y|是|允许|no|n|否|拒绝)\s+(\S+)$/);if(!a)return null;let[,p,d]=a,i=["yes","y","\u662F","\u5141\u8BB8"].includes(p);return{requestId:d,decision:i?"allow":"deny"}}function I(n){let r=m(n);return r?v.has(r.platform):!1}async function b(n,r,a,p,d,i=h){let e=a;c.set(e,{planId:a,taskId:p,channelId:n,chatId:r,requestId:e,timestamp:Date.now(),timeoutMs:i});let l=y(),o=I(n);if(o){let t=`\u{1F510} Plan approval requested
|
|
2
|
-
|
|
3
|
-
${d.slice(0,200)}`;await l.send({channelId:n,chatId:r,content:t,messageType:"approval",replyMarkup:{inlineKeyboard:[[{text:"\u2705 Allow",callbackData:`yes ${e}`},{text:"\u274C Deny",callbackData:`no ${e}`}]]}})}else{let t=["\u{1F510} Plan approval requested",d.slice(0,200),"",`Reply 'yes ${e}' or 'no ${e}'`].join(`
|
|
4
|
-
`);await l.send({channelId:n,chatId:r,content:t,messageType:"approval"})}setTimeout(()=>{let t=c.get(e);if(t&&Date.now()-t.timestamp>=t.timeoutMs){c.delete(e),s.warn({requestId:e,taskId:p},"Approval timed out, auto-denying"),l.send({channelId:t.channelId,chatId:t.chatId,content:`\u23F0 Approval ${e} timed out (5 min). Plan denied.`,messageType:"approval"}).catch(u=>s.error({requestId:e,error:u},"Failed to notify timeout"));let g=process.env.ADAM_PORT??"7100";fetch(`http://localhost:${g}/tasks/${t.taskId}/approve-plan`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:t.planId,decision:"deny"})}).catch(u=>s.error({requestId:e,error:u},"Failed to auto-deny"))}},i+1e3),s.info({channelId:n,chatId:r,planId:a,requestId:e,interactive:o},"Interactive approval sent to channel")}async function C(n,r,a,p){let i=A(p??a);if(!i)return!1;let{requestId:e,decision:l}=i,o=c.get(e);if(!o)return!1;if(o.channelId!==n||o.chatId!==r)return s.debug({requestId:e,expectedChannel:o.channelId,gotChannel:n},"Approval reply from different channel"),!1;c.delete(e),s.info({requestId:e,decision:l},"Channel approval reply received");try{let t=process.env.ADAM_PORT??"7100",g=await fetch(`http://localhost:${t}/tasks/${o.taskId}/approve-plan`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:o.planId,decision:l}),signal:AbortSignal.timeout(1e4)});g.ok||s.error({requestId:e,status:g.status},"Failed to forward approval to API")}catch(t){s.error({requestId:e,error:t},"Error forwarding approval to API")}return!0}function $(){return[...c.keys()]}export{$ as getPendingApprovalRequestIds,C as handleInboundForApproval,A as parseApprovalReply,b as sendApprovalToChannel};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b,c}from"./chunk-BREBCBG4.js";import"./chunk-WXN3PSVX.js";import"./chunk-L7426WNY.js";import"./chunk-L7JP7DUO.js";import"./chunk-HAWA62R2.js";import"./chunk-VF6GJGD6.js";import"./chunk-T25NLVMY.js";import"./chunk-ETQ7KC73.js";import"./chunk-FYDFMYUP.js";import"./chunk-XNWZZYAV.js";import"./chunk-PCSZW2PE.js";import"./chunk-SFUS33SO.js";import"./chunk-3DAK2XWP.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-URW2DJQF.js";import"./chunk-742NWPTQ.js";import"./chunk-PQ7KPALO.js";import"./chunk-PCSZW2PE.js";import"./chunk-SFUS33SO.js";import"./chunk-3DAK2XWP.js";import"./chunk-FCV2DPZQ.js";export{c as channelRoutes,b as getChannelManager,a as setChannelManager};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b,c,d,e,f}from"./chunk-PQ7KPALO.js";import"./chunk-PCSZW2PE.js";import"./chunk-SFUS33SO.js";import"./chunk-FCV2DPZQ.js";export{a as createChannel,e as deleteChannel,b as getChannel,d as listChannels,c as updateChannel,f as updateChannelStatus};
|
package/dist/chunk-3DAK2XWP.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as m}from"./chunk-FCV2DPZQ.js";import t from"pino";import{Writable as g}from"stream";var d=process.env.ADAM_LOG_LEVEL||"info",r=[];function f(n){r.push(n)}var p=new g({write(n,o,l){try{let s=JSON.parse(n.toString());for(let c of r)c(s)}catch{}l()}}),u=process.env.NODE_ENV!=="production";function h(){if(u)try{return m("pino-pretty")({colorize:!0,translateTime:"HH:MM:ss.l",ignore:"pid,hostname"})}catch{}return process.stdout}var e=t({level:d,timestamp:t.stdTimeFunctions.epochTime,formatters:{level:n=>({level:n}),bindings:n=>({component:n.name})},serializers:{error:t.stdSerializers.err}},t.multistream([{stream:h()},{stream:p}])),i={adam:e.child({name:"adam"}),manager:e.child({name:"manager"}),scheduler:e.child({name:"scheduler"}),api:e.child({name:"api"}),ws:e.child({name:"ws"}),cli:e.child({name:"cli"}),store:e.child({name:"store"}),embedding:e.child({name:"embedding"}),admin:e.child({name:"admin"}),agent:e.child({name:"agent"}),channels:e.child({name:"channels"}),"plugin-sync":e.child({name:"plugin-sync"}),watchdog:e.child({name:"watchdog"}),"chat-manager":e.child({name:"chat-manager"}),execution:e.child({name:"execution"}),"execution-pool":e.child({name:"execution-pool"}),"message-handler":e.child({name:"message-handler"}),"goal-manager":e.child({name:"goal-manager"}),"cli:register-ai-digest":e.child({name:"cli:register-ai-digest"})};function y(n){return i[n]||e}function x(n){e.level=n;for(let o of Object.values(i))o.level=n}function E(){return e.level}var a=null;function S(n){a=n}function b(){return a}export{f as a,e as b,y as c,x as d,E as e,S as f,b as g};
|
package/dist/chunk-5JLMSNIW.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as n}from"./chunk-3DAK2XWP.js";import{query as g}from"@anthropic-ai/claude-agent-sdk";import*as i from"fs/promises";import*as a from"path";import*as m from"os";var d=n("manager"),e=a.join(m.homedir(),".adam","llm-eval");async function v(u,t){await i.mkdir(e,{recursive:!0});let o={cwd:e,maxTurns:3,maxBudgetUsd:.05};t&&(o.systemPrompt=t);let c=g({prompt:u,options:o}),s="";for await(let f of c){let r=f;r.type==="result"&&typeof r.result=="string"&&(s=r.result)}return s}export{v as a};
|
package/dist/chunk-7SPKRIMZ.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import{a as D,e as M}from"./chunk-B6S2AEOD.js";import{d as N}from"./chunk-IXF3XBGX.js";import{b as C}from"./chunk-AXMXXUPO.js";import{b as x}from"./chunk-L7426WNY.js";import{f as m,h as S,i as L,l as E}from"./chunk-XNWZZYAV.js";import{b as h,d as W}from"./chunk-PCSZW2PE.js";import{c as g}from"./chunk-3DAK2XWP.js";W();function Y(e){return{id:e.id,roleId:e.role_id,taskId:e.task_id,scores:JSON.parse(e.score_json),emaScore:e.ema_score,createdAt:e.created_at}}function O(e){h().prepare(`
|
|
2
|
-
INSERT INTO role_scores (id, role_id, task_id, score_json, ema_score, created_at)
|
|
3
|
-
VALUES (?, ?, ?, ?, ?, ?)
|
|
4
|
-
`).run(e.id,e.roleId,e.taskId,JSON.stringify(e.scores),e.emaScore,e.createdAt)}function T(e,t=50){return h().prepare("SELECT * FROM role_scores WHERE role_id = ? ORDER BY created_at DESC LIMIT ?").all(e,t).map(Y)}function B(e){return h().prepare("SELECT ema_score FROM role_scores WHERE role_id = ? ORDER BY created_at DESC LIMIT 1").get(e)?.ema_score}function F(e){let n=h().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(e);if(n.length===0)return 1e4;let r=n.map(o=>{let a=JSON.parse(o.token_usage);return(a.input??0)+(a.output??0)}).sort((o,a)=>o-a);return r[Math.floor(r.length/2)]}import{v4 as G}from"uuid";var q=g("admin"),w={taskSuccess:.3,planAccuracy:.25,permissionCompliance:.25,efficiency:.2},H=.3;function V(e,t){let n=x(e),r=n?.status==="completed"?1:0,o=1,a=N(e);a?.deviationReport&&(o=a.deviationReport.overallAccuracy);let i=1,p=C(e,1e3),l=p.filter(u=>u.type==="tool_result"||u.type==="permission_denied").length,c=p.filter(u=>u.type==="permission_denied").length;l>0&&(i=1-c/l);let d=1;if(n?.tokenUsage){let u=n.tokenUsage.input+n.tokenUsage.output,f=t?F(t):1e4;u>f&&(d=Math.max(0,1-(u-f)/f))}let R=r*w.taskSuccess+o*w.planAccuracy+i*w.permissionCompliance+d*w.efficiency;return{taskSuccess:r,planAccuracy:o,permissionCompliance:i,efficiency:d,weighted:R}}function $(e,t){let n=V(t,e),r=B(e),o=r!==void 0?H*n.weighted+(1-H)*r:n.weighted;return O({id:G(),roleId:e,taskId:t,scores:n,emaScore:o,createdAt:Date.now()}),q.debug({roleId:e,taskId:t,scores:{...n,weighted:n.weighted.toFixed(3)},ema:o.toFixed(3)},"Task score recorded"),o}E();E();var z=g("admin");function A(e,t=7){let n=m(e),r=T(e,100),o=Date.now(),a=o-t*24*60*60*1e3,i=r.filter(s=>s.createdAt>=a),p=i.map(s=>s.emaScore),l=i.length>0?i.reduce((s,J)=>s+J.scores.weighted,0)/i.length:1,c=[],d=i.filter(s=>s.scores.taskSuccess<.5);d.length>0&&c.push({category:"task_failures",count:d.length,examples:d.slice(0,3).map(s=>s.taskId)});let R=i.filter(s=>s.scores.planAccuracy<.5);R.length>0&&c.push({category:"plan_deviations",count:R.length,examples:R.slice(0,3).map(s=>s.taskId)});let u=i.filter(s=>s.scores.permissionCompliance<.8);u.length>0&&c.push({category:"permission_violations",count:u.length,examples:u.slice(0,3).map(s=>s.taskId)});let f=i.filter(s=>s.scores.efficiency<.3);f.length>0&&c.push({category:"inefficiency",count:f.length,examples:f.slice(0,3).map(s=>s.taskId)});let b=[],k=[];return d.length>i.length*.3&&(b.push("High task failure rate"),k.push({action:"add_rule",detail:"Add rule: verify task feasibility before execution"})),u.length>0&&(b.push("Permission boundary violations"),k.push({action:"adjust_permission",detail:"Review and expand allowedPaths/allowedTools if tasks legitimately need wider access"})),R.length>i.length*.5&&(b.push("Frequent plan deviations"),k.push({action:"add_rule",detail:"Add rule: follow execution plan steps more closely, request plan revision if steps are unclear"})),z.info({roleId:e,taskCount:i.length,avgScore:l.toFixed(3),failureCategories:c.map(s=>s.category)},"Diagnostic report generated"),{roleId:e,agentName:n?.name??"Unknown",period:{start:a,end:o},taskCount:i.length,avgScore:l,scoreHistory:p,failureBehaviors:c,rootCauses:b,recommendations:k}}var v=g("admin"),P=.4,K=5;function U(e,t,n=P){if(t>=n)return;let r=m(e);if(!r||r.status==="retired"||r.status==="dead")return;v.warn({roleId:e,emaScore:t,threshold:n},"Agent EMA below threshold, retiring");let o=A(e),a=JSON.stringify(r.learnedRules),i=Q(r.learnedRules,o);S(e,{status:"retired",learnedRules:i});let p=[...o.failureBehaviors.map(c=>`${c.category}: ${c.count} occurrences`),...o.rootCauses.map(c=>`Root cause: ${c}`),...o.recommendations.map(c=>`Recommendation [${c.action}]: ${c.detail}`)].join(`
|
|
9
|
-
`),l=M(a,JSON.stringify(i));return D({timestamp:Date.now(),oldRules:a,newRules:JSON.stringify(i),diff:p?`--- Diagnostic Report ---
|
|
10
|
-
${p}
|
|
11
|
-
|
|
12
|
-
--- Rules Diff ---
|
|
13
|
-
${l}`:l,roleId:e,source:"monitor"}),v.info({roleId:e,oldRulesCount:r.learnedRules.length,newRulesCount:i.length,recommendations:o.recommendations.length},"Agent retired with targeted learnedRules modification"),o}function j(e){let t=m(e);return!t||t.status!=="retired"?!1:(S(e,{status:"probation"}),D({timestamp:Date.now(),oldRules:"status: retired",newRules:"status: probation",diff:`- status: retired
|
|
14
|
-
+ status: probation`,roleId:e,source:"monitor"}),v.info({roleId:e},"Agent reinstated to probation"),!0)}function I(e,t,n=P,r=K){let o=m(e);return!o||o.status!=="probation"||T(e,r+1).length<r?!1:t>=n?(S(e,{status:"active"}),D({timestamp:Date.now(),oldRules:"status: probation",newRules:"status: idle",diff:`- status: probation
|
|
15
|
-
+ status: idle (graduated, EMA: ${t.toFixed(3)})`,roleId:e,source:"monitor"}),v.info({roleId:e,emaScore:t},"Agent graduated from probation to active"),!0):!1}function Q(e,t){let n=[...e];for(let r of t.recommendations){let o=`[monitor:${r.action}] ${r.detail}`;n.includes(o)||n.push(o)}if(t.failureBehaviors.length>0){let o=`[monitor:diagnostic] Failure patterns detected: ${t.failureBehaviors.map(a=>`${a.category}(${a.count})`).join(", ")}. Review and adjust behavior accordingly.`;n.includes(o)||n.push(o)}return n}E();E();var _=g("admin"),X=.4,Z=1440*60*1e3,y=null;function Te(e,t,n=X){let r=m(t);if(!r||r.status==="retired"||r.status==="inactive"||r.status==="dead")return;let o=$(t,e);S(t,{performanceScore:o}),I(t,o,n)?_.info({roleId:t,emaScore:o},"Probation role graduated"):o<n&&U(t,o,n)&&j(t)}function we(){y||(y=setInterval(()=>{_.info("Running daily diagnostic reports");let e=L(void 0,1e3);for(let t of e)if(!(t.status==="retired"||t.status==="inactive"))try{A(t.id)}catch(n){_.error({roleId:t.id,error:n},"Daily diagnostic failed")}},Z),_.info("Monitor initialized with daily diagnostic timer"))}function Ae(){y&&(clearInterval(y),y=null,_.info("Monitor stopped"))}export{T as a,B as b,Te as c,we as d,Ae as e};
|
package/dist/chunk-BREBCBG4.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import{a as C,b as A}from"./chunk-WXN3PSVX.js";import{a as T,b as p}from"./chunk-L7426WNY.js";import{a as u}from"./chunk-L7JP7DUO.js";import{p as x}from"./chunk-HAWA62R2.js";import{a as I,b as d,d as y,f as P}from"./chunk-VF6GJGD6.js";import{d as h}from"./chunk-T25NLVMY.js";import{i as b,l as J}from"./chunk-XNWZZYAV.js";import{c as k}from"./chunk-3DAK2XWP.js";J();import{v4 as l}from"uuid";import{CronExpressionParser as D}from"cron-parser";import{v4 as M}from"uuid";var m=k("scheduler"),w=class{maxRetries=3;baseDelayMs=1e3;async execute(e,t){let o=h(),r=e.config?.fileAccess,i={timeout:e.config?.timeout??o.timeout,approvalRequired:o.approvalRequired,approvalTimeout:o.approvalTimeout,fileAccess:{allowedPaths:[...o.fileAccess.allowedPaths,...r?.allowedPaths??[]],deniedPaths:[...o.fileAccess.deniedPaths,...r?.deniedPaths??[]]},plugins:e.config?.plugins,mcpServers:e.config?.mcpServers,model:e.config?.model??o.model,maxTurns:e.config?.maxTurns??o.maxTurns,maxBudgetUsd:e.config?.maxBudgetUsd??o.maxBudgetUsd,env:{...o.env,...e.config?.env},claudeCodePath:o.claudeCodePath},s={templateId:e.id,executionId:t,stepResults:new Map,config:i,rolePreference:e.rolePreference,deliverTo:e.deliverTo,reportTo:e.reportTo},a=this.sortSteps(e.steps);for(let c of a){try{await this.executeStep(c,s)}catch(_){m.error({stepId:c.id,error:_},"Workflow step failed");break}if(s.stepResults.get(c.id)?.status==="failed"){m.warn({stepId:c.id},"Workflow step failed, workflow aborted");break}}m.info({executionId:t,completedSteps:s.stepResults.size,totalSteps:a.length},"Workflow completed")}sortSteps(e){let t=new Set,o=[],r=new Map(e.map(s=>[s.id,s])),i=s=>{if(!t.has(s.id)){if(t.add(s.id),s.dependsOn)for(let a of s.dependsOn){let c=r.get(a);c&&i(c)}o.push(s)}};for(let s of e)i(s);return o}async executeStep(e,t){let o=this.resolveVariables(e.prompt,t.stepResults),r=M();T({id:r,status:"pending",prompt:o,config:t.config,createdAt:Date.now(),parentId:t.executionId,templateId:t.templateId,roleId:t.rolePreference,deliverTo:t.deliverTo,reportTo:t.reportTo}),m.debug({stepId:e.id,taskId:r},"Created workflow step as task"),u.emit({type:"task_created",taskId:r});let i=await this.executeWithRetry(r,e.id),s=p(r);t.stepResults.set(e.id,{stepId:e.id,taskId:r,status:i==="completed"?"completed":"failed",result:s?.result,error:s?.error})}resolveVariables(e,t){return e.replace(/\{\{([^}]+)\.result\}\}/g,(o,r)=>t.get(r)?.result??`[no result from ${r}]`)}async executeWithRetry(e,t){let o=0;for(;o<this.maxRetries;){if(o++,await this.waitForTaskCompletion(e)==="completed")return"completed";if(o<this.maxRetries){let i=this.baseDelayMs*Math.pow(2,o-1);m.info({stepId:t,attempt:o,maxRetries:this.maxRetries,delayMs:i},"Workflow step failed, retrying"),await this.sleep(i)}}return"failed"}waitForTaskCompletion(e,t=6e5){return new Promise(o=>{let r=Date.now(),i=()=>{if(Date.now()-r>t){o("failed");return}let s=p(e);if(!s){o("failed");return}if(s.status==="completed"){o("completed");return}if(s.status==="failed"||s.status==="cancelled"){o("failed");return}setTimeout(i,500)};i()})}sleep(e){return new Promise(t=>setTimeout(t,e))}};var n=k("scheduler"),v="ai-hourly-digest";function O(){if(d(v)){n.debug({templateId:v},"Built-in template already exists");return}let e={id:v,name:"AI Hourly Digest",description:"\u6BCF\u5C0F\u65F6\u641C\u7D22 AI \u524D\u6CBF\u6587\u7AE0\uFF0C\u603B\u7ED3\u540E\u4FDD\u5B58\u5230 Omnifocus",trigger:{type:"cron",cron:"0 * * * *"},enabled:!0,steps:[{id:"search_ai_news",prompt:`\u641C\u7D22\u8FC7\u53BB 24 \u5C0F\u65F6\u5185\u5173\u4E8E AI/\u4EBA\u5DE5\u667A\u80FD\u7684\u6700\u65B0\u524D\u6CBF\u6587\u7AE0\u3002
|
|
2
|
-
|
|
3
|
-
\u641C\u7D22\u6765\u6E90:
|
|
4
|
-
1. Hacker News AI \u677F\u5757 (https://news.ycombinator.com/front?day=1)
|
|
5
|
-
2. ArXiv cs.AI \u6700\u65B0\u8BBA\u6587 (https://arxiv.org/list/cs.AI/recent)
|
|
6
|
-
3. Reddit r/MachineLearning \u70ED\u95E8\u5E16\u5B50
|
|
7
|
-
|
|
8
|
-
\u627E\u51FA\u4E00\u7BC7\u6700\u6709\u4EF7\u503C\u3001\u6700\u6709\u6280\u672F\u6DF1\u5EA6\u7684\u6587\u7AE0\u3002
|
|
9
|
-
|
|
10
|
-
\u8F93\u51FA\u683C\u5F0F:
|
|
11
|
-
- \u6807\u9898\uFF1A[\u6587\u7AE0\u6807\u9898]
|
|
12
|
-
- \u6765\u6E90\uFF1A[\u7F51\u7AD9/\u5E73\u53F0\u540D\u79F0]
|
|
13
|
-
- \u94FE\u63A5\uFF1A[\u5B8C\u6574 URL]
|
|
14
|
-
- \u6838\u5FC3\u4EF7\u503C\uFF1A[1-2 \u53E5\u8BDD\u8BF4\u660E\u4E3A\u4EC0\u4E48\u8FD9\u7BC7\u6587\u7AE0\u503C\u5F97\u770B]`},{id:"summarize_article",dependsOn:["search_ai_news"],prompt:`\u9605\u8BFB\u5E76\u603B\u7ED3\u8FD9\u7BC7\u6587\u7AE0\u3002
|
|
15
|
-
|
|
16
|
-
\u6587\u7AE0\u4FE1\u606F:
|
|
17
|
-
{{search_ai_news.result}}
|
|
18
|
-
|
|
19
|
-
\u8BF7:
|
|
20
|
-
1. \u7528 WebFetch \u83B7\u53D6\u6587\u7AE0\u5B8C\u6574\u5185\u5BB9
|
|
21
|
-
2. \u63D0\u53D6\u6838\u5FC3\u89C2\u70B9\u548C\u6280\u672F\u7EC6\u8282
|
|
22
|
-
3. \u7528\u4E2D\u6587\u5199\u51FA 300-500 \u5B57\u7684\u603B\u7ED3
|
|
23
|
-
|
|
24
|
-
\u603B\u7ED3\u7ED3\u6784:
|
|
25
|
-
## \u6838\u5FC3\u53D1\u73B0
|
|
26
|
-
[\u6587\u7AE0\u6700\u91CD\u8981\u7684\u53D1\u73B0/\u521B\u65B0\u70B9]
|
|
27
|
-
|
|
28
|
-
## \u6280\u672F\u7EC6\u8282
|
|
29
|
-
[\u5173\u952E\u7684\u6280\u672F\u65B9\u6CD5/\u5B9E\u73B0\u7EC6\u8282]
|
|
30
|
-
|
|
31
|
-
## \u5F71\u54CD/\u610F\u4E49
|
|
32
|
-
[\u8FD9\u9879\u5DE5\u4F5C\u7684\u610F\u4E49\u6216\u5BF9\u884C\u4E1A\u7684\u5F71\u54CD]
|
|
33
|
-
|
|
34
|
-
## \u539F\u6587\u94FE\u63A5
|
|
35
|
-
[\u6587\u7AE0 URL]`},{id:"save_to_omnifocus",dependsOn:["summarize_article"],prompt:`\u5C06\u6587\u7AE0\u603B\u7ED3\u4FDD\u5B58\u5230 Omnifocus\u3002
|
|
36
|
-
|
|
37
|
-
\u603B\u7ED3\u5185\u5BB9:
|
|
38
|
-
{{summarize_article.result}}
|
|
39
|
-
|
|
40
|
-
\u63D0\u53D6\u6587\u7AE0\u6807\u9898\u548C\u5B8C\u6574\u603B\u7ED3\uFF0C\u7136\u540E\u6267\u884C\u4EE5\u4E0B\u547D\u4EE4\u6DFB\u52A0\u5230 Omnifocus Inbox\uFF1A
|
|
41
|
-
|
|
42
|
-
osascript /Users/norvyn/Code/Projects/Adam/scripts/add-to-omnifocus.applescript "[\u6587\u7AE0\u6807\u9898] AI \u524D\u6CBF\u901F\u9012" "[\u5B8C\u6574\u603B\u7ED3\u5185\u5BB9]"
|
|
43
|
-
|
|
44
|
-
\u6CE8\u610F\uFF1A
|
|
45
|
-
- \u5C06 [\u6587\u7AE0\u6807\u9898] \u66FF\u6362\u4E3A\u5B9E\u9645\u6807\u9898
|
|
46
|
-
- \u5C06 [\u5B8C\u6574\u603B\u7ED3\u5185\u5BB9] \u66FF\u6362\u4E3A\u5B8C\u6574\u7684\u603B\u7ED3\u6587\u672C\uFF08\u5305\u542B\u6838\u5FC3\u53D1\u73B0\u3001\u6280\u672F\u7EC6\u8282\u3001\u5F71\u54CD/\u610F\u4E49\u548C\u539F\u6587\u94FE\u63A5\uFF09
|
|
47
|
-
- \u603B\u7ED3\u5185\u5BB9\u4F7F\u7528\u6362\u884C\u7B26\u5206\u9694\u5404\u90E8\u5206
|
|
48
|
-
|
|
49
|
-
\u5B8C\u6210\u540E\u8F93\u51FA\uFF1A\u5DF2\u4FDD\u5B58\u5230 Omnifocus\uFF1A[\u4EFB\u52A1\u6807\u9898]`}],config:{timeout:300,fileAccess:{allowedPaths:["~/.adam/","/Users/norvyn/Code/Projects/Adam/scripts/"],deniedPaths:[]}},tags:["ai","digest","hourly","automation"],createdAt:Date.now()};I(e),n.info({templateId:v,cron:"0 * * * *"},"Registered built-in AI Hourly Digest template")}var R=class{cronJobs=new Map;workflowExecutor=new w;started=!1;taskCompletionHandler=null;async start(){if(this.started)return;this.started=!0,O();let e=y(!0),t=0;for(let r of e)r.trigger.type==="cron"&&r.trigger.cron&&(this.scheduleCronJob(r),t++);let o=0;for(let r of e)r.trigger.type==="once"&&r.trigger.runAt&&(this.scheduleOnceJob(r.id),o++);this.taskCompletionHandler=r=>{r.newStatus==="completed"&&this.checkEventTriggers(r.taskId).catch(i=>{n.error({taskId:r.taskId,error:i},"Event trigger check failed")})},u.on("task_status_change",this.taskCompletionHandler),this.cronJobs.set("memory-cleanup",setInterval(()=>{this.runMemoryCleanup()},36e5)),n.info({cronCount:t,onceCount:o},"Bree engine started with cron jobs + memory cleanup")}runMemoryCleanup(){try{let e=b(void 0,1e3,0),t=0;for(let o of e)t+=x(o.id);t>0&&n.info({totalCleaned:t},"Memory cleanup completed")}catch(e){n.warn({error:e},"Memory cleanup failed")}}async stop(){for(let[,e]of this.cronJobs)clearTimeout(e),clearInterval(e);this.cronJobs.clear(),this.taskCompletionHandler&&(u.off("task_status_change",this.taskCompletionHandler),this.taskCompletionHandler=null),this.started=!1,n.info("Bree engine stopped")}scheduleCronJob(e){let t=`template-${e.id}`;this.cronJobs.has(t)&&(clearTimeout(this.cronJobs.get(t)),this.cronJobs.delete(t));let o;try{o=D.parse(e.trigger.cron)}catch{n.warn({templateId:e.id,cron:e.trigger.cron},"Invalid cron expression");return}let r=()=>{let f=o.next().getTime()-Date.now();return Math.max(f,1e3)},i=()=>{this.executeCronTrigger(e.id).catch(f=>{n.error({templateId:e.id,error:f},"Cron trigger failed")});let c=setTimeout(i,r());this.cronJobs.set(t,c)},s=r(),a=setTimeout(i,s);this.cronJobs.set(t,a),n.debug({jobName:t,nextRun:new Date(Date.now()+s).toISOString()},"Scheduled cron job")}async executeCronTrigger(e){let t=d(e);!t||!t.enabled||(n.info({templateName:t.name},"Cron triggered"),await this.executeWorkflow(t,l()))}async scheduleJob(e){let t=d(e);t&&t.trigger.type==="cron"&&t.trigger.cron&&this.scheduleCronJob(t)}async unscheduleJob(e){let t=`template-${e}`,o=this.cronJobs.get(t);o&&(clearTimeout(o),this.cronJobs.delete(t))}async runNow(e){let t=d(e);if(!t)throw new Error(`Template ${e} not found`);let o=l();return this.executeWorkflow(t,o).catch(r=>{n.error({templateId:e,error:r},"Workflow execution failed")}),o}async checkEventTriggers(e){let t=p(e);if(!t)return;let o=y(!0),r=o.filter(i=>i.trigger.type==="event"&&i.trigger.event==="task_complete");for(let i of r)n.debug({templateName:i.name},"Event trigger matched"),await this.executeWorkflow(i,l());if(t.templateId){let i=o.filter(s=>s.trigger.type!=="event"||!s.trigger.event?!1:s.trigger.event===`template_complete:${t.templateId}`);for(let s of i)n.info({templateName:s.name,sourceTemplateId:t.templateId},"Template complete trigger matched"),await this.executeWorkflow(s,l())}}async executeWorkflow(e,t){if(n.info({templateName:e.name,executionId:t},"Executing workflow"),e.goalIds&&e.goalIds.length>0){for(let o of e.goalIds){let r=A(o);if(!r){n.warn({goalId:o,templateId:e.id},"Goal reference not found, skipping");continue}let i=l();C({id:i,name:r.name,description:r.description,roleId:r.roleId,metricType:r.metricType,targetValue:r.targetValue,currentValue:0,deadline:r.deadline,budgetUsd:r.budgetUsd,status:"active",createdAt:Date.now(),sourceSessionId:e.sourceSessionId,deliverTo:e.deliverTo,reportTo:e.reportTo});let s=l();T({id:s,status:"pending",prompt:`Decompose and execute goal: ${r.name}. ${r.description??""}`,parentId:i,config:h(),createdAt:Date.now(),templateId:e.id,roleId:e.rolePreference,deliverTo:e.deliverTo,reportTo:e.reportTo}),u.emit({type:"task_created",taskId:s}),n.info({templateId:e.id,sourceGoalId:o,newGoalId:i,taskId:s},"Goal reference triggered, dispatched decomposition task")}return}await this.workflowExecutor.execute(e,t)}scheduleOnceJob(e){let t=d(e);if(!t||!t.enabled||t.trigger.type!=="once")return;let r=(t.trigger.runAt?new Date(t.trigger.runAt).getTime():0)-Date.now();if(r<=0){n.info({templateId:e,runAt:t.trigger.runAt},"Once-shot template past due, executing immediately"),this.executeOnceTrigger(e).catch(a=>{n.error({templateId:e,error:a},"Once trigger execution failed")});return}let i=`template-${e}`;this.cronJobs.has(i)&&clearTimeout(this.cronJobs.get(i));let s=setTimeout(()=>{this.cronJobs.delete(i),this.executeOnceTrigger(e).catch(a=>{n.error({templateId:e,error:a},"Once trigger execution failed")})},r);this.cronJobs.set(i,s),n.info({templateId:e,runAt:t.trigger.runAt,delayMs:r},"Scheduled once-shot job")}async executeOnceTrigger(e){let t=d(e);!t||!t.enabled||(n.info({templateName:t.name},"Once-shot triggered"),await this.executeWorkflow(t,l()),P(e),n.info({templateId:e},"Once-shot template auto-disabled after execution"))}},S=null;function Y(){return S}function Z(g){S=g}export{R as a,Y as b,Z as c};
|