PageSourceSearch

https://mindtrip.ai/_next/static/chunks/pages/agents/manage-1055bcd1494c3ba9.js

js mindtrip.ai collected 2026-09-24 17:10:56 UTC 15,389 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6548],{5684:(e,t,s)=>{"use strict";s.d(t,{X:()=>d,_:()=>u});var n=s(27964),r=s(14232),a=s(52181),i=s(32516),l=s(29274),c=s(39132);let o=[];function d(e){let t,s,c=(0,n.c)(5),o=function(){let e,t,s=(0,n.c)(2),l=(0,i.GV)(a.qH),c=(0,i.GV)(a.D$),o=(0,i.GV)(a.mG),[d,u]=(0,r.useState)(!1);return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=()=>{let e=setTimeout(()=>u(!0),6e3);return()=>clearTimeout(e)},t=[],s[0]=e,s[1]=t):(e=s[0],t=s[1]),(0,r.useEffect)(e,t),!!l||"denied"===c||"error"===o||d}(),d=!(void 0===e||e)||!o;c[0]!==d?(t={skip:d},c[0]=d,c[1]=t):t=c[1];let u=(0,l.hR)(void 0,t);return c[2]!==o||c[3]!==u?(s={...u,locationSettled:o},c[2]=o,c[3]=u,c[4]=s):s=c[4],s}function u(e){let t,s,a,i,u,x=(0,n.c)(19),{data:p,isFetching:f,locationSettled:g}=d(e),[j,y]=(0,l.n7)(),{isUninitialized:b}=y,v=(0,r.useSyncExternalStore)(l.Et,l.WP,h),N=!!p?.pending_generation,w=p?.suggestions??o;x[0]!==w?(t=w.map(m),x[0]=w,x[1]=t):t=x[1];let _=(0,c.qf)(t);if(x[2]!==j||x[3]!==b||x[4]!==N?(s=()=>{!N||!b||(0,l.WP)()||j()},x[2]=j,x[3]=b,x[4]=N,x[5]=s):s=x[5],x[6]!==j||x[7]!==v||x[8]!==b||x[9]!==N?(a=[N,b,v,j],x[6]=j,x[7]=v,x[8]=b,x[9]=N,x[10]=a):a=x[10],(0,r.useEffect)(s,a),x[11]!==_||x[12]!==w){let e;x[14]!==_?(e=e=>"top-cards"===e.section&&!(0,c.R6)(e.expires_at,_),x[14]=_,x[15]=e):e=x[15],i=w.filter(e),x[11]=_,x[12]=w,x[13]=i}else i=x[13];let k=i,C=e&&!g||f||v||N&&b;return x[16]!==k||x[17]!==C?(u={suggestions:k,awaitingCards:C},x[16]=k,x[17]=C,x[18]=u):u=x[18],u}function m(e){return e.expires_at}function h(){return!1}},47625:(e,t,s)=>{"use strict";s.d(t,{IC:()=>d,Ob:()=>o});var n=s(3604),r=s(77934);let a=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],i={first:1,"1st":1,second:2,"2nd":2,third:3,"3rd":3,fourth:4,"4th":4};function l(e){let t=e??"",s=t.match(/\b(sunday|monday|tuesday|wednesday|thursday|friday|saturday)s?\b/i),n=t.match(/\b(\d{1,2})(?::(\d{2}))?\s*(am|pm)\b/i),r=t.match(/\b(1st|first|2nd|second|3rd|third|4th|fourth)\b/i),l=null,c=0;n&&(l=Number(n[1])%12,"pm"===n[3].toLowerCase()&&(l+=12),c=n[2]?Number(n[2]):0);let o=s?s[1].toLowerCase():null;return{weekdayName:o,weekdayNumber:o?a.indexOf(o)+1:null,hour:l,minute:c,ordinal:r?i[r[1].toLowerCase()]:null}}let c={1:"1st",2:"2nd",3:"3rd",4:"4th"};function o(e,t){if(!e)return null;let s=l(t),n=s.weekdayName?s.weekdayName.charAt(0).toUpperCase()+s.weekdayName.slice(1):null;return"daily"===e?"Daily":"weekly"===e?n?`${n}s`:"Weekly":"monthly"===e?n&&s.ordinal?`${c[s.ordinal]} ${n}`:"Monthly":e.charAt(0).toUpperCase()+e.slice(1)}function d(e){let t=(0,n.r)(e)?.context,s=l(t?.schedule_hint??null),a=(0,r.fi)((0,r.O4)(),1),i=a;if(t?.cadence==="monthly")i=s.ordinal&&s.weekdayNumber?function(e,t,s){for(let n of[(0,r.wH)(e),(0,r.wH)((0,r.PS)(e,1))]){let a=n,i=0;for(;a.month===n.month;){if((0,r.jr)(a)===s&&++i===t){if(!(0,r.Tw)(a,e))return a;break}a=(0,r.PV)(a)}}return(0,r.PS)(e,1)}(a,s.ordinal,s.weekdayNumber):(0,r.PS)(a,1);else if(t?.cadence==="weekly")if(s.weekdayNumber)for(;(0,r.jr)(i)!==s.weekdayNumber;)i=(0,r.PV)(i);else i=(0,r.fi)(a,6);return(0,r._R)((0,r.lg)(i,{hour:7,minute:0},(0,r.ol)()))}},85539:(e,t,s)=>{"use strict";s.d(t,{u:()=>o});var n=s(37876),r=s(27964),a=s(14232),i=s(74302),l=s(42512),c=s(32516);function o(e){let t,s,o,d,u,m,h,x,p,f,g,j,y,b=(0,r.c)(27);b[0]!==e?({children:t,className:s,bg:d,spacer:u,border:m,...o}=e,b[0]=e,b[1]=t,b[2]=s,b[3]=o,b[4]=d,b[5]=u,b[6]=m):(t=b[1],s=b[2],o=b[3],d=b[4],u=b[5],m=b[6]);let v=void 0===d||d,N=void 0===u||u,w=void 0===m||m,_=(0,c.GV)(l.tB),[k,C]=(0,a.useState)(!1);b[7]!==w?(h=()=>
1{if(w)return void C(!1);let e=()=>{C(window.scrollY>0)};return e(),window.addEventListener("scroll",e,{passive:!0}),()=>window.removeEventListener("scroll",e)},x=[w],b[7]=w,b[8]=h,b[9]=x):(h=b[8],x=b[9]),(0,a.useEffect)(h,x);let A=!k&&!w&&"border-transparent",S=(v||k)&&"bg-background/80 backdrop-blur-md",$=_&&"pr-(--embed-close-spacer)! pl-(--nav-width-collapsed)";return b[10]!==s||b[11]!==A||b[12]!==S||b[13]!==$?(p=(0,i.cn)("fixed inset-x-0 top-(--banner-height,0px) z-2 flex h-(--header-height) items-center gap-2 border-b px-(--container-pad) transition-[left,border-color,background-color] duration-drawer ease-drawer sm:left-(--nav-width) sm:px-7",A,S,s,$),b[10]=s,b[11]=A,b[12]=S,b[13]=$,b[14]=p):p=b[14],b[15]!==t||b[16]!==k?(f="function"==typeof t?t({scrolled:k}):t,b[15]=t,b[16]=k,b[17]=f):f=b[17],b[18]!==o||b[19]!==f||b[20]!==p?(g=(0,n.jsx)("div",{className:p,...o,children:f}),b[18]=o,b[19]=f,b[20]=p,b[21]=g):g=b[21],b[22]!==N?(j=N&&(0,n.jsx)("div",{className:"h-(--header-height) shrink-0"}),b[22]=N,b[23]=j):j=b[23],b[24]!==g||b[25]!==j?(y=(0,n.jsxs)(n.Fragment,{children:[g,j]}),b[24]=g,b[25]=j,b[26]=y):y=b[26],y}},89263:(e,t,s)=>{"use strict";s.d(t,{q:()=>u});var n=s(37876),r=s(27964),a=s(14e3),i=s(74269),l=s(2692),c=s(76052),o=s(85539),d=s(20658);function u(e){let t,s,u,m,h,x,p,f,g,j,y=(0,r.c)(20),{title:b,onCreateAgent:v,children:N}=e,w=(0,a.usePathname)();y[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,n.jsx)(l.K,{href:"/home",variant:"outline",size:"sm",icon:{name:"chevronLeft"},label:"Home",tooltip:!0}),y[0]=t):t=y[0],y[1]===Symbol.for("react.memo_cache_sentinel")?(s={name:"plus"},y[1]=s):s=y[1],y[2]!==v?(u=(0,n.jsxs)(o.u,{border:!1,children:[t,(0,n.jsx)(d.$,{variant:"primary",size:"sm",iconBefore:s,onClick:v,className:"ml-auto",children:"Create"})]}),y[2]=v,y[3]=u):u=y[3],y[4]===Symbol.for("react.memo_cache_sentinel")?(m=(0,n.jsx)("h1",{className:"mb-2 text-2xl font-semibold tracking-tight sm:mb-3 sm:text-3xl",children:"Your agents"}),h=(0,n.jsx)("p",{className:"mb-7 text-xs text-pretty sm:mb-9 sm:text-sm",children:"Watching what matters to you, on a schedule you set."}),y[4]=m,y[5]=h):(m=y[4],h=y[5]);let _="/agents"===w?"page":void 0;y[6]!==_?(x=(0,n.jsx)(c.dO,{href:"/agents","aria-current":_,children:"Results"}),y[6]=_,y[7]=x):x=y[7];let k="/agents/manage"===w?"page":void 0;return y[8]!==k?(p=(0,n.jsx)(c.dO,{href:"/agents/manage","aria-current":k,children:"Manage"}),y[8]=k,y[9]=p):p=y[9],y[10]!==x||y[11]!==p?(f=(0,n.jsx)(c.tU,{children:(0,n.jsxs)(c.j7,{"aria-label":"Agents views",className:"mb-6 border-b-0 text-md",children:[x,p]})}),y[10]=x,y[11]=p,y[12]=f):f=y[12],y[13]!==N||y[14]!==f?(g=(0,n.jsxs)("div",{className:"mx-auto flex w-full max-w-xl flex-1 flex-col px-(--container-pad) pt-6 pb-[calc(var(--bottom-nav-height)+theme(space.6))] sm:pb-16 md:px-0",children:[m,h,f,N]}),y[13]=N,y[14]=f,y[15]=g):g=y[15],y[16]!==g||y[17]!==u||y[18]!==b?(j=(0,n.jsxs)(i.A,{title:b,children:[u,g]}),y[16]=g,y[17]=u,y[18]=b,y[19]=j):j=y[19],j}},90148:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/agents/manage",function(){return s(90509)}])},90509:(e,t,s)=>{"use strict";s.r(t),s.d(t,{__N_SSP:()=>D,default:()=>F});var n=s(37876),r=s(14232),a=s(5684),i=s(22836);function l(e){return"custom_agent"===e.agent_type}var c=s(50436),o=s(26579),d=s(3604),u=s(4294),m=s(85343),h=s(77934),x=s(95059),p=s(29734),f=s(29274),g=s(12159),j=s(32516),y=s(25834),b=s(89263),v=s(27964),N=s(74302),w=s(61836),_=s(47625),k=s(55631),C=s(84525),A=s(34265),S=s(33084),$=s(44546),E=s(85983),R=s(20658),O=s(73273),P=s(2692);function L(e){var t,s;let{agent:a,now:i,onEdit:l}=e,d=(0,j.jL)(),u=A.h.useLocale(),m=A.h.useFormatMessageDate(),[x,f]=(0,r.useState)(!1),[g,b]=(0,r.useState)(!1),[v,{isLoading:$,data:L}]=(0,p.TT)(),[I]=(0,p.FT)(),[T]=(0,p.Hi)(),D="active"===a.status,F=a.last_run,U=(t=L&&L.run.ref!==F?.ref?L.run:F,s=i,t?.status==="running"&&s-t.created_at.epoch_millis<72e5),V=!!F||!!a.last_run_at,{data:H,isLoading:M}=(0,p.UO)(a.ref,{skip:!x}),G=H?.runs,J=async()=>{(0,o.$)({name:"CustomAgentInteraction",properties:{type:"run_now",source:"agents",agent_ref:a.ref}});try{await v(a.ref).unwrap(),(0,o.$)({name:"CustomAgentRunNow",properties:{agent_ref:a.ref}}),f(!0)}catch(e){y.J.add({type:"error",description:(0,k.gJ)(e,"Couldn’t start the run")})}},W=async()=>{(0,o.$)({name:"CustomAgentInteraction",properties:{type:D?"pause":"turn_on",source:"agents",agent_ref:a.ref}});try{await I({ref:a.ref,status:D?"paused":"active"}).unwrap()}catch{y.J.add({type:"error",description:"Couldn’t update"})}},Y=async()=>{(0,o.$)({name:"CustomAgentInteraction",properties:{type:"delete",source:"agents",agent_ref:a.ref}});try{await T(a.ref).unwrap()}catch{y.J.add({type:"error",description:"Couldn’t delete"})}},q=(0,_.Ob)(a.cadence,a.schedule_hint);return(0,n.jsxs)("div",{className:(0,N.cn)("flex flex-col rounded-2xl border p-4",!D&&"bg-gray-2"),children:[(0,n.jsxs)("div",{className:"mb-3 flex items-center justify-between gap-2",children:[(0,n.jsx)("div",{className:(0,N.cn)("rounded-full border px-3 py-1.5 text-2xs empty:hidden",!D&&"bg-background"),children:D?q:"Paused"}),(0,n.jsxs)(O.rI,{children:[(0,n.jsx)(O.ty,{render:(0,n.jsx)(P.K,{icon:{name:"ellipsis"},label:"Agent actions",size:"sm",variant:"ghost"})}),(0,n.jsxs)(O.SQ,{children:[(0,n.jsx)(O._2,{iconName:"pencil",onClick:l,children:"Edit"}),(0,n.jsx)(O._2,{iconName:D?"pause":"play",onClick:()=>void W(),children:D?(0,n.jsx)("span",{children:"Pause"}):(0,n.jsx)("span",{children:"Resume"})}),(0,n.jsx)(O.mB,{}),(0,n.jsx)(O._2,{variant:"destructive",iconName:"trash",onClick:()=>b(!0),children:"Delete"})]})]})]}),(0,n.jsxs)("p",{className:"font-semibold text-pretty",children:[(0,n.jsx)("span",{className:"font-emoji",children:(0,w.Fn)(a.name,a.output_type)})," ",(0,n.jsx)("span",{className:"no-translate",children:(0,w.mC)(a.name)})]}),(0,n.jsx)("p",{className:"no-translate mt-1.5 text-pretty",children:a.idea_string}),(0,n.jsxs)("div",{className:"mt-4 border-t pt-2",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[V?(0,n.jsx)(R.$,{variant:"none",size:"xs",onClick:()=>{x||(0,o.$)({name:"CustomAgentInteraction",properties:{type:"history",source:"agents",agent_ref:a.ref}}),f(!x)},iconAfter:{name:x?"chevronUp":"chevronDown"},className:"-ml-(--button-xs-px) transition-colors hover:text-muted",children:"History"}):(0,n.jsx)("span",{className:"text-2xs text-muted",children:function(e,t,s,r){if(!r||!e.next_run_at)return(0,n.jsx)("span",{children:"No runs yet"});let a=e.next_run_at.epoch_millis;return a<=s?(0,n.jsx)("span",{children:"First run shortly"}):(0,n.jsxs)("span",{children:["First run ",(0,C.fw)(t,a,s)]})}(a,u,i,D)}),(0,n.jsx)(R.$,{size:"xs",variant:"subtle",disabled:$||U,onClick:()=>void(D?J():W()),children:U?(0,n.jsx)("span",{children:"Running…"}):D?(0,n.jsx)("span",{children:"Run now"}):(0,n.jsx)("span",{children:"Resume"})})]}),x&&(0,n.jsx)("div",{className:"mt-2 border-t",children:M&&!G?(0,n.jsx)("div",{className:"flex justify-center py-2",children:(0,n.jsx)(c.R,{})}):G?.length?(0,n.jsx)("ul",{className:"pt-2 text-2xs",children:G.map(e=>(0,n.jsx)(z,{run:e,label:m(e.created_at,(0,h.ol)()),onOpen:()=>{(0,o.$)({name:"CustomAgentInteraction",properties:{type:"view_results",source:"agents",agent_ref:a.ref,run_ref:e.ref}}),d((0,S.Ut)({runRef:e.ref,agentName:a.name}))}},e.ref))}):(0,n.jsx)("p",{className:"py-2 text-sm text-muted",children:"No runs yet."})})]}),g&&(0,n.jsx)(E.Lt,{open:!0,onOpenChange:()=>b(!1),children:(0,n.jsxs)(E.EO,{children:[(0,n.jsx)(E.wd,{children:(0,n.jsx)(E.r7,{children:"Delete this agent?"})}),(0,n.jsxs)(E.$v,{children:[a.name," and its run history will be removed. This can't be und
1one."]}),(0,n.jsxs)(E.ck,{children:[(0,n.jsx)(E.Zr,{children:"Cancel"}),(0,n.jsx)(E.Rx,{onClick:()=>void Y(),children:"Delete"})]})]})})]})}function z(e){let t,s,r,a,i,l,c=(0,v.c)(18),{run:o,label:d,onOpen:u}=e,m="complete"===o.status,h=!m;return c[0]!==o.status?(t="complete"!==o.status&&(0,n.jsx)("span",{className:"running"===o.status?"size-2 shrink-0 animate-pulse rounded-full bg-amber-9":"size-2 shrink-0 rounded-full bg-red-9"}),c[0]=o.status,c[1]=t):t=c[1],c[2]!==d?(s=(0,n.jsx)("span",{className:"flex-1 truncate",children:d}),c[2]=d,c[3]=s):s=c[3],c[4]!==o.status?(r="running"===o.status&&(0,n.jsx)("span",{className:"shrink-0 text-xs text-muted",children:"Running…"}),c[4]=o.status,c[5]=r):r=c[5],c[6]!==o.status?(a="error"===o.status&&(0,n.jsx)("span",{className:"shrink-0 text-xs text-red-10",children:"Failed"}),c[6]=o.status,c[7]=a):a=c[7],c[8]!==m?(i=m&&(0,n.jsx)($.A,{className:"size-3 shrink-0 stroke-2 text-muted"}),c[8]=m,c[9]=i):i=c[9],c[10]!==u||c[11]!==h||c[12]!==t||c[13]!==s||c[14]!==r||c[15]!==a||c[16]!==i?(l=(0,n.jsx)("li",{className:"-mx-2",children:(0,n.jsxs)("button",{className:"flex w-full items-center gap-2 rounded-lg px-2 py-2 text-left not-disabled:hover:bg-gray-2 disabled:text-muted",disabled:h,onClick:u,children:[t,s,r,a,i]})}),c[10]=u,c[11]=h,c[12]=t,c[13]=s,c[14]=r,c[15]=a,c[16]=i,c[17]=l):l=c[17],l}var I=s(12357),T=s(21533),D=!0;function F(e){let t=(0,j.jL)(),[s]=(0,r.useState)(()=>new m.W((0,u.Q)())),[v,N]=(0,r.useState)(()=>(0,h.ZY)()),{data:w,isLoading:_}=(0,p.QM)({agent_type:"custom_agent"},{refetchOnMountOrArgChange:60}),k=w?.agents.filter(l),{data:C,isLoading:A,locationSettled:S}=(0,a.X)(),$=A||!S,[E]=(0,f.$c)(),[O,P]=(0,r.useState)(!1);(0,r.useEffect)(()=>{let e=setInterval(()=>N((0,h.ZY)()),3e4);return()=>clearInterval(e)},[]),(0,r.useEffect)(()=>{(0,o.$)({name:"AgentsPageView",properties:{}})},[]),(0,r.useEffect)(()=>(0,x.Y)(()=>{t(p.x0.util.invalidateTags(["Agent","AgentRuns"]))}),[t]);let z=(C?.suggestions??[]).filter(e=>(0,d.r)(e)&&"active"===e.status),D=e=>{(0,o.$)({name:"CustomAgentInteraction",properties:{type:"create"===e.kind?"create":"edit",source:"agents",agent_ref:"agent"===e.kind?e.agent.ref:void 0,suggestion_ref:"suggestion"===e.kind?e.suggestion.ref:void 0}}),t((0,g.B$)({mode:e,source:"agents"}))},{turnOn:F,isTurningOn:U}=(0,i.ni)("agents"),V=async e=>{(0,o.$)({name:"CustomAgentInteraction",properties:{type:"dismiss",source:"agents",suggestion_ref:e}});try{await E({ref:e,reason:"not_interested"}).unwrap()}catch{y.J.add({type:"error",description:"Couldn't dismiss"})}},H=z.length>0||O||!$&&0===z.length;return(0,n.jsx)(b.q,{title:"Manage agents | mindtrip",onCreateAgent:()=>D({kind:"create"}),children:(0,n.jsxs)("div",{className:"flex flex-1 flex-col gap-6",children:[_&&!k?(0,n.jsx)(c.R,{className:"m-auto"}):k?.length?(0,n.jsx)("div",{className:"flex flex-col gap-4",children:[...k].sort((e,t)=>e.status===t.status?0:"active"===e.status?-1:1).map(e=>(0,n.jsx)(L,{agent:e,now:v,onEdit:()=>D({kind:"agent",agent:e})},e.ref))}):null,H&&(0,n.jsxs)("div",{className:"flex flex-col gap-4",children:[z.length>0&&(0,n.jsx)("h2",{className:"text-sm font-medium text-muted",children:"Suggestions"}),$&&!C?(0,n.jsx)(c.R,{className:"m-auto"}):0!==z.length||O?(0,n.jsxs)("div",{className:"space-y-4",children:[z.map(e=>(0,n.jsx)(I.D,{suggestion:e,isNew:!1,busy:U(e.ref),onActivate:()=>void F(e),onCustomize:()=>D({kind:"suggestion",suggestion:e}),onDismiss:()=>void V(e.ref)},e.ref)),O&&(0,n.jsx)(T.E,{className:"h-48 rounded-2xl"})]}):(0,n.jsxs)("div",{className:"rounded-2xl border border-dashed p-8 text-center",children:[(0,n.jsx)("div",{className:"mb-4 font-emoji text-4xl",children:"\uD83D\uDCA1"}),(0,n.jsx)("p",{className:"mb-4 text-pretty",children:"Nothing to suggest right now. Try creating your own."}),(0,n.jsx)(R.$,{variant:"primary",size:"sm",onClick:()=>D({kind:"create"}),children:"Create"})]}),!1]})]})})}}},e=>{e.O(0,[770,8901,9117,929,7117,7142,8404,5254,9811,9e3,6477,3022,4269,3472,3458,6593,636,8792],()=>e(e.s=90148)),_N_E=e.O()}]);
2//# sourceMappingURL=manage-1055bcd1494c3ba9.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.