PageSourceSearch

https://lexapar.com/static/js/7976.910e7c9a-bundle.js

js lexapar.com collected 2026-10-05 11:32:52 UTC 27,354 bytes, 2 lines download raw bytes

1/*! For license information please see 7976.910e7c9a-bundle.js.LICENSE.txt */
2"use strict";(self.webpackChunkwebapp=self.webpackChunkwebapp||[]).push([[7976],{47976(e,t,n){n.r(t),n.d(t,{default:()=>me});var r=n(88327),a=n(17933),s=n(70870),o=n(81897),i=n(96540),c=n(35570),l=n(41469);function u(e,t){var n=t.filter(function(e){return e.is_active}).length,r=new Date;r.setHours(0,0,0,0);var a=e.filter(function(e){return new Date(e.created)>=r}).length;return 0===t.length?"Nothing watched yet":0===n?1===t.length?"Your watch is paused":"All watches paused":0===a?"Nothing today, ".concat(n," watching"):"".concat(a," ").concat(1===a?"run":"runs"," today, ").concat(n," watching")}var d=n(74848);const f=function(e){var t=e.firstName,n=e.runs,r=e.watches,a=e.children;return(0,d.jsxs)("div",{className:"grid gap-8 lg:grid-cols-[minmax(0,240px)_minmax(0,1fr)]",children:[(0,d.jsxs)("aside",{className:"lg:sticky lg:top-0",children:[(0,d.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Hello, ",t]}),(0,d.jsx)("h2",{className:"mt-1.5 text-2xl leading-tight font-bold tracking-tight text-foreground",children:u(n,r)})]}),(0,d.jsx)("div",{className:"flex flex-col gap-3",children:a})]})};var h=n(46369),m=n(90733);function x(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,s,o,i=[],c=!0,l=!1;try{if(s=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=s.call(n)).done)&&(i.push(r.value),i.length!==t);c=!0);}catch(e){l=!0,a=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return p(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const v=function(e){var t=e.onSubmit,n=e.placeholder,r=x((0,i.useState)(""),2),a=r[0],s=r[1],o=(0,i.useCallback)(function(e){var n=e.trim();n&&(s(""),t(n))},[t]);return(0,d.jsxs)("div",{className:"mx-auto flex h-full w-full max-w-2xl flex-col items-center justify-center px-6 pb-16 text-center",children:[(0,d.jsx)("h1",{className:"text-3xl font-bold tracking-tight text-foreground",children:"What do you want to run?"}),(0,d.jsx)("div",{className:"mt-7 w-full",children:(0,d.jsx)(m.A,{variant:"chat",value:a,onChange:s,onSubmit:o,mode:h.LG.DEFAULT,placeholder:null!=n?n:"e.g. ".concat("Every Monday at 9, check Acme's contract renewals and tell me what changed.")})}),(0,d.jsx)("p",{className:"mt-3 text-sm text-muted-foreground",children:"Say what to check and how often — Aether works out the rest."})]})};var b=n(5559),g=n(25560),y=n(53655),j=n(28343),w=n(6335);function N(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,s,o,i=[],c=!0,l=!1;try{if(s=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=s.call(n)).done)&&(i.push(r.value),i.length!==t);c=!0);}catch(e){l=!0,a=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return k(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function S(e){var t=e.children;return(0,d.jsx)("div",{className:"text-xs font-medium text-muted-foreground",children:t})}const A=function(e){var t,n=e.watch,a=e.runCount,s=e.onToggleActive,o=e.onToggleSendEmail,c=e.onDelete,l=N((0,i.useState)(!1),2),u=l[0],f=l[1];return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"space-y-6",children:[(0,d.jsxs)("section",{className:"space-y-3",children:[(0,d.jsx)(S,{children:"What you asked for"}),(0,d.jsxs)("p",{className:"border-l-2 border-border pl-3 text-sm leading-relaxed text-muted-foreground italic",children:["“",n.task_args.message_content,"”"]}),(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 rounded-xl border border-border p-3.5",children:[(0,d.jsx)("span",{className:"text-sm text-foreground",children:(0,g.vY)(n.expression)}),(0,d.jsx)("span",{className:"text-tertiary",children:"·"}),(0,d.jsx)("span",{className:"text-sm text-muted-foreground",children:n.is_active?"Next ".concat((0,g.xf)(n.next_run)):"Paused"})]}),(0,d.jsxs)("p",{className:"text-xs text-muted-foreground",children:[a," ",1===a?"run":"runs"," · ",n.timezone]})]}),(0,d.jsxs)("section",{className:"space-y-2.5 border-t border-border pt-5",children:[(0,d.jsx)(S,{children:"Settings"}),(0,d.jsxs)("div",{className:"divide-y divide-border overflow-hidden rounded-xl border border-border",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between gap-3 px-3.5 py-2.5",children:[(0,d.jsx)("span",{className:"text-sm text-foreground",children:"Run on schedule"}),(0,d.jsx)(w.d,{checked:n.is_active,onCheckedChange:function(e){return s(n.uuid,e)}
2,"aria-label":n.is_active?"Turn off this watch":"Turn on this watch"})]}),(0,d.jsxs)("div",{className:"flex items-center justify-between gap-3 px-3.5 py-2.5",children:[(0,d.jsx)("span",{className:(0,b.cn)("text-sm text-foreground",!n.is_active&&"opacity-50"),children:"Email me each run"}),(0,d.jsx)(w.d,{checked:null!==(t=n.task_args.send_email)&&void 0!==t&&t,disabled:!n.is_active,onCheckedChange:function(e){return o(n.uuid,e)},"aria-label":n.task_args.send_email?"Stop emailing this watch's runs":"Email this watch's runs"})]})]})]}),(0,d.jsx)("section",{className:"flex flex-wrap gap-2 border-t border-border pt-5",children:(0,d.jsxs)(j.$,{variant:"outline",size:"sm",onClick:function(){return f(!0)},children:[(0,d.jsx)(r.WFf,{}),"Delete"]})})]}),(0,d.jsx)(y.Lt,{open:u,onOpenChange:f,children:(0,d.jsxs)(y.EO,{children:[(0,d.jsxs)(y.wd,{children:[(0,d.jsx)(y.r7,{children:"Delete this watch?"}),(0,d.jsxs)(y.$v,{children:["It stops running immediately. The ",a," ",1===a?"run it has":"runs it has"," already produced stay in your results, labelled Removed."]})]}),(0,d.jsxs)(y.ck,{children:[(0,d.jsx)(y.Zr,{children:"Cancel"}),(0,d.jsx)(y.Rx,{onClick:function(){return c(n.uuid)},className:(0,b.cn)((0,j.r)(),"bg-destructive text-white hover:bg-destructive/90"),children:"Delete"})]})]})})]})};var _=n(94144),C=n(23544);const E=function(e){var t=e.watch,n=e.isSelected,r=e.onSelect;return(0,d.jsxs)("div",{onClick:r,className:(0,b.cn)("flex w-full cursor-pointer items-center gap-2 rounded-md px-3 py-1.5 text-left text-sm transition-colors",n?"bg-muted font-medium text-foreground":"text-foreground hover:bg-muted/60"),children:[(0,d.jsx)("button",{type:"button","aria-current":n,className:(0,b.cn)("min-w-0 flex-1 truncate bg-transparent p-0 text-left",!t.is_active&&"text-muted-foreground"),children:t.task_args.message_content}),(0,d.jsx)(C.A,{isShared:t.organization_resource_access_shared}),!t.is_active&&(0,d.jsx)("span",{className:"shrink-0 rounded bg-muted px-1.5 py-0.5 text-xs font-medium text-muted-foreground",children:"Off"})]})};const O=function(e){var t=e.watches,n=e.selectedUuid,a=e.onSelect;return(0,d.jsxs)("div",{className:"flex h-full min-w-0 flex-col",children:[(0,d.jsx)("div",{className:"px-3 py-2",children:(0,d.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:"Watches"})}),(0,d.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto",children:0===t.length?(0,d.jsx)(_.Sv,{className:"border-0 py-8",children:(0,d.jsxs)(_.FT,{children:[(0,d.jsx)(_.Kr,{variant:"icon",children:(0,d.jsx)(r.tLq,{})}),(0,d.jsx)(_.cz,{className:"text-sm",children:"Nothing watched yet"}),(0,d.jsx)(_.Ou,{children:"Describe what to keep an eye on — Aether works out the schedule."})]})}):(0,d.jsx)("div",{className:"space-y-0.5 p-2",children:t.map(function(e){return(0,d.jsx)(E,{watch:e,isSelected:e.uuid===n,onSelect:function(){return a(e.uuid)}},e.uuid)})})})]})};var T=n(85657),P=n(62234),R=n(38993);const F=function(e){var t=e.writtenFiles,n=e.readPaths,a=e.read,s=e.onDownload;return 0===t.length&&0===n.length?null:(0,d.jsxs)("section",{className:"mt-8 border-t border-border pt-5",children:[(0,d.jsx)("p",{className:"text-xs font-medium text-muted-foreground",children:"Files"}),(0,d.jsx)("div",{className:"mt-3",children:(0,d.jsx)(P.A,{items:t,variant:"compact",read:a,onDownload:s,emptyTitle:"Nothing was written",emptyDescription:"This run didn't create or change any files."})}),n.length>0&&(0,d.jsx)(R.nD,{type:"single",collapsible:!0,className:"mt-2",children:(0,d.jsxs)(R.As,{value:"read",className:"border-b-0",children:[(0,d.jsxs)(R.$m,{className:"py-3 text-sm font-normal text-muted-foreground hover:no-underline",children:[n.length," ",1===n.length?"file":"files"," ","read"]}),(0,d.jsx)(R.ub,{children:(0,d.jsx)("ul",{className:"space-y-1",children:n.map(function(e){return(0,d.jsxs)("li",{className:"flex items-center gap-2 px-2 py-1 text-sm text-muted-foreground",children:[(0,d.jsx)(r.HKL,{className:"size-3.5 shrink-0 text-tertiary"}),(0,d.jsx)("span",{className:"truncate",children:e})]},e)})})})]})})]})};var I=n(19746);function D(e){var t=e.isLoading,n=e.markdown;return t?(0,d.jsxs)("div",{className:"space-y-3",children:[(0,d.jsx)(I.E,{className:"h-4 w-full"}),(0,d.jsx)(I.E,{className:"h-4 w-11/12"}),(0,d.jsx)(I.E,{className:"h-4 w-8/12"})]}):n?(0,d.jsx)(T.A,{content:n,className:"text-sm leading-relaxed"}):(0,d.jsxs)(_.Sv,{children:[(0,d.jsx)(_.cz,{children:"Nothing to report"}),(0,d.jsx)(_.Ou,{children:"This run finished without producing an answer."})]})}const L=function(e){var t=e.watchLabel,n=e.created,r=e.markdown,a=e.writtenFiles,s=e.readPaths,o=e.read,i=e.onDownload,c=e.isLoading;return(0,d.jsx)("section",{children:(0,d.jsxs)("article",{children:[c?(0,d.jsx)(I.E,{className:"h-4 w-56"}):(0,d.jsxs)("p",{className:"text-xs text-muted-foreground",children:[(0,d.jsx)("span",{className:"font-medium text-foreground",children:t})," · ",(0,b.r6)(n)]}),(0,d.jsx)("div",{className:"mt-4",children:(0,d.jsx)(D,{isLoading:c,markdown:r})}),(0,d.jsx)(F,{writtenFiles:a,readPaths:s,read:o,onDownload:i})]})})};var U=n(90083);function W(e){return function(e){if(Array.isArray(e))return z(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return z(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?z(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function z(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var M=[h.jX.WRITE,h.jX.EDIT],H=[h.jX.READ,h.jX.GLOB,h.jX.GREP];function $(e){var t=e.run,n=e.watchLabel,r=e.onSelect;return(0,d.jsxs)("button",{type:"button",onClick:r,className:"flex w-full items-center gap-4 px-4 py-3 text-left transition-colors hover:bg-muted/40",children:[(0,d.jsx)("span",{className:(0,b.cn)("w-32 shrink-0 truncate text-sm font-medium",n?"text-foreground":"text-tertiary"),children:null!=n?n:"Removed"}),(0,d.jsxs)("span",{className:"min-w-0 flex-1 truncate text-sm",children:[(0,d.jsx)("span",{className:"text-foreground",children:t.title}),t.description&&(0,d.jsxs)("span",{className:"text-muted-foreground",children:["  —  ",t.description]})]}),(0,d.jsx)("span",{className:"shrink-0 text-xs text-muted-foreground",children:(0,b.r6)(t.created)})]})}const G=function(e){var t=e.runs,n=e.watchLabels,r=e.onSelectRun;return 0===t.length?(0,d.jsxs)(_.Sv,{children:[(0,d.jsx)(_.cz,{children:"Nothing has run yet"}),(0,d.jsx)(_.Ou,{children:"Add a watch and its results will appear here."})]}):(0,d.jsx)("section",{className:"overflow-hidden rounded-2xl border border-border bg-card",children:(0,d.jsx)("ul",{className:"divide-y divide-border",children:t.map(function(e){return(0,d.jsx)("li",{children:(0,d.jsx)($,{run:e,watchLabel:e.cron_uuid?n[e.cron_uuid]:void 0,onSelect:function(){return r(e.uuid)}})},e.uuid)})})})};var X=n(40111),B=n(86791),Y=n(96509),K=n(19043),Q=function(e){return e.BR
vendor: 4,525 bytes, line 2
2IEF="brief",e.WATCHES="watches",e}({}),q=function(e){return e.AETHER_RUN="aether_run",e.DYNAMIC="dynamic",e}({}),V=n(69521),Z=n(24311),J=n(44166),ee=n(53387),te=n(87426);function ne(e){return ne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ne(e)}function re(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ae(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?re(Object(n),!0).forEach(function(t){se(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):re(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function se(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=ne(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=ne(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ne(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oe(e){return function(e){if(Array.isArray(e))return he(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||fe(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ie(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function s(n,r,a,s){var c=r&&r.prototype instanceof i?r:i,l=Object.create(c.prototype);return ce(l,"_invoke",function(n,r,a){var s,i,c,l=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return s=t,i=0,c=e,f.n=n,o}};function h(n,r){for(i=n,c=r,t=0;!d&&l&&!a&&t<u.length;t++){var a,s=u[t],h=f.p,m=s[2];n>3?(a=m===r)&&(c=s[(i=s[4])?5:(i=3,3)],s[4]=s[5]=e):s[0]<=h&&((a=n<2&&h<s[1])?(i=0,f.v=r,f.n=s[1]):h<m&&(a=n<3||s[0]>r||r>m)&&(s[4]=n,s[5]=r,f.n=m,i=0))}if(a||n>1)return o;throw d=!0,r}return function(a,u,m){if(l>1)throw TypeError("Generator is already running");for(d&&1===u&&h(u,m),i=u,c=m;(t=i<2?e:c)||!d;){s||(i?i<3?(i>1&&(f.n=-1),h(i,c)):f.n=c:f.v=c);try{if(l=2,s){if(i||(a="next"),t=s[a]){if(!(t=t.call(s,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,i<2&&(i=0)}else 1===i&&(t=s.return)&&t.call(s),i<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),i=1);s=e}else if((t=(d=f.n<0)?c:n.call(r,f))!==o)break}catch(t){s=e,i=1,c=t}finally{l=1}}return{value:t,done:d}}}(n,a,s),!0),l}var o={};function i(){}function c(){}function l(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(ce(t={},r,function(){return this}),t),d=l.prototype=i.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,ce(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=l,ce(d,"constructor",l),ce(l,"constructor",c),c.displayName="GeneratorFunction",ce(l,a,"GeneratorFunction"),ce(d),ce(d,a,"Generator"),ce(d,r,function(){return this}),ce(d,"toString",function(){return"[object Generator]"}),(ie=function(){return{w:s,m:f}})()}function ce(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}ce=function(e,t,n,r){function s(t,n){ce(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(s("next",0),s("throw",1),s("return",2))},ce(e,t,n,r)}function le(e,t,n,r,a,s,o){try{var i=e[s](o),c=i.value}catch(e){return void n(e)}i.done?t(c):Promise.resolve(c).then(r,a)}function ue(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var s=e.apply(t,n);function o(e){le(s,r,a,o,i,"next",e)}function i(e){le(s,r,a,o,i,"throw",e)}o(void 0)})}}function de(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,s,o,i=[],c=!0,l=!1;try{if(s=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=s.call(n)).done)&&(i.push(r.value),i.length!==t);c=!0);}catch(e){l=!0,a=e}
2finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw a}}return i}}(e,t)||fe(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fe(e,t){if(e){if("string"==typeof e)return he(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?he(e,t):void 0}}function he(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const me=function(){var e,t,n=(0,ee.Us)(),u=de((0,c.ok)(),2),m=u[0],x=u[1],p=de((0,i.useState)([]),2),b=p[0],g=p[1],y=de((0,i.useState)([]),2),w=y[0],N=y[1],k=de((0,i.useState)(null),2),S=k[0],_=k[1],C=de((0,i.useState)(!1),2),E=C[0],T=C[1],P=m.get("tab")===Q.WATCHES?Q.WATCHES:Q.BRIEF,R=m.get("run"),F=m.get("watch"),I="new"===F,D=I?null:F,z=(0,Y.kQ)(),$=z.items,ne=z.operations,re=z.setContextSessionUuid;(0,i.useEffect)(function(){re(null!=R?R:void 0)},[R,re]),(0,i.useEffect)(function(){return function(){return re(void 0)}},[re]);var se=(0,i.useCallback)(function(e){var t=new URLSearchParams(m);Object.entries(e).forEach(function(e){var n=de(e,2),r=n[0],a=n[1];null===a?t.delete(r):t.set(r,a)}),x(t)},[m,x]),ce=(0,i.useCallback)(ue(ie().m(function e(){var t;return ie().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,t=g,e.n=1,(0,a.n7)([s.H.CRON]);case 1:t(e.v),e.n=3;break;case 2:e.p=2,e.v,l.oR.error("Failed to load runs");case 3:return e.a(2)}},e,null,[[0,2]])})),[]),le=!!(0,V.Up)(),fe=de((0,i.useState)([]),2),he=fe[0],me=fe[1],xe=de((0,i.useState)(null),2),pe=xe[0],ve=xe[1];(0,i.useEffect)(function(){le&&(0,J.rF)().then(me).catch(function(){})},[le]);var be=(0,i.useCallback)(ue(ie().m(function e(){var t;return ie().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,(0,Z.Qs)();case 1:t=e.v,N(t.filter(function(e){return e.task_args.name===q.AETHER_RUN})),e.n=3;break;case 2:e.p=2,e.v,l.oR.error("Failed to load watches");case 3:return e.a(2)}},e,null,[[0,2]])})),[]);(0,i.useEffect)(function(){ce(),be()},[ce,be]),(0,i.useEffect)(function(){var e=!1;return R?(T(!0),(0,a.gT)(R).then(function(t){e||_(t)}).catch(function(){e||l.oR.error("Failed to open run")}).finally(function(){e||T(!1)})):_(null),function(){e=!0}},[R]);var ge,ye,je,we,Ne,ke,Se,Ae=(0,i.useMemo)(function(){return Object.fromEntries(w.map(function(e){return[e.uuid,e.task_args.message_content]}))},[w]),_e=(0,i.useMemo)(function(){var e={};return b.forEach(function(t){var n;t.cron_uuid&&(e[t.cron_uuid]=(null!==(n=e[t.cron_uuid])&&void 0!==n?n:0)+1)}),e},[b]),Ce=b.findIndex(function(e){return e.uuid===R}),Ee=Ce>=0?b[Ce]:null,Oe=(0,i.useMemo)(function(){return S?function(e){for(var t="",n=null,r=0,a=Object.values(e.agents);r<a.length;r++){var s=a[r];if(null===s.parent_uuid){n=s;break}}if(n)for(var o=n.messages.length-1;o>=0;o-=1){var i=n.messages[o];if("model_response"===i.type){t=i.blocks.filter(function(e){return"text"===e.type}).map(function(e){return e.content}).join("");break}}return t}(S):""},[S]),Te=(0,i.useMemo)(function(){return S?(e=S,t=new Set,n=new Set,Object.values(e.agents).forEach(function(e){e.messages.forEach(function(e){(0,h.XP)(e)&&e.blocks.forEach(function(e){if("tool_call"===e.type){var r,a,s=null===(r=e.metadata)||void 0===r?void 0:r.icon_name,o=("string"==typeof e.tool_args?(0,U.d)(e.tool_args):null!==(a=e.tool_args)&&void 0!==a?a:{}).file_path;"string"==typeof s&&"string"==typeof o&&o&&(M.some(function(e){return e===s})?t.add(o):H.some(function(e){return e===s})&&n.add(o))}})})}),t.forEach(function(e){return n.delete(e)}),{writtenPaths:W(t),readPaths:W(n)}):{writtenPaths:[],readPaths:[]};var e,t,n},[S]),Pe=(0,i.useMemo)(function(){var e=[],t=oe(Te.readPaths);return Te.writtenPaths.forEach(function(n){var r=$.find(function(e){return e.path===n});void 0===r?t.push(n):e.push(r)}),{writtenFiles:e,accessedPaths:t}},[Te,$]),Re=(0,i.useCallback)(function(e){var t;null===(t=ne.download)||void 0===t||t.call(ne,e.uuid,o.A.ORIGINAL).catch(function(){})},[ne]),Fe=(0,i.useCallback)(function(){var e=ue(ie().m(function e(t){var n,r;return ie().w(function(e){for(;;)if(0===e.n)return e.a(2,null!==(n=null===(r=ne.read)||void 0===r?void 0:r.call(ne,t))&&void 0!==n?n:null)},e)}));return function(t){return e.apply(this,arguments)}}(),[ne]),Ie=(0,i.useCallback)(function(){var e=ue(ie().m(function e(t,n){return ie().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,(0,Z.cT)(t,{is_active:n});case 1:return e.n=2,be();case 2:e.n=4;break;case 3:e.p=3,e.v,l.oR.error("Failed to update watch");case 4:return e.a(2)}},e,null,[[0,3]])}
2));return function(t,n){return e.apply(this,arguments)}}(),[be]),De=(0,i.useCallback)(function(){var e=ue(ie().m(function e(t,n){var r;return ie().w(function(e){for(;;)switch(e.p=e.n){case 0:if(void 0!==(r=w.find(function(e){return e.uuid===t}))){e.n=1;break}l.oR.error("Watch not found"),e.n=5;break;case 1:return e.p=1,e.n=2,(0,Z.cT)(t,{task_args:ae(ae({},r.task_args),{},{send_email:n})});case 2:return e.n=3,be();case 3:e.n=5;break;case 4:e.p=4,e.v,l.oR.error("Failed to update email delivery");case 5:return e.a(2)}},e,null,[[1,4]])}));return function(t,n){return e.apply(this,arguments)}}(),[w,be]),Le=(0,i.useCallback)(function(){var e=ue(ie().m(function e(t){return ie().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,(0,Z.Cr)(t);case 1:return se({watch:null}),e.n=2,Promise.all([be(),ce()]);case 2:e.n=4;break;case 3:e.p=3,e.v,l.oR.error("Failed to delete watch");case 4:return e.a(2)}},e,null,[[0,3]])}));return function(t){return e.apply(this,arguments)}}(),[be,ce,se]),Ue=w.find(function(e){return e.uuid===D}),We=(0,i.useCallback)(function(){return se({run:null,watch:null})},[se]),ze=(0,i.useCallback)(function(e){return se({watch:e,run:null})},[se]),Me=(0,i.useCallback)(function(e){return se({run:e,watch:null})},[se]),He=(0,i.useCallback)(function(){return se({watch:"new",run:null})},[se]),$e=(0,i.useCallback)(function(e){return se({tab:e===Q.BRIEF?null:e,run:null,watch:null})},[se]),Ge=(0,i.useCallback)(function(e){return(0,K.xs)(function(e){return"".concat(e,"\n\n").concat("— Sent from Aether Watch: set this up as a recurring watch, using the create-watch skill.")}(e))},[]),Xe=(0,i.useMemo)(function(){return I?void 0:null!==R?(0,d.jsxs)(d.Fragment,{children:[Ce>=0&&(0,d.jsxs)("span",{className:"mr-1 text-xs text-muted-foreground",children:[Ce+1," of ",b.length]}),(0,d.jsx)(j.$,{variant:"ghost",size:"icon","aria-label":"Previous run",disabled:Ce<=0,onClick:function(){return se({run:b[Ce-1].uuid})},children:(0,d.jsx)(r.vMW,{className:"size-[18px]"})}),(0,d.jsx)(j.$,{variant:"ghost",size:"icon","aria-label":"Next run",disabled:Ce<0||Ce>=b.length-1,onClick:function(){return se({run:b[Ce+1].uuid})},children:(0,d.jsx)(r.ye6,{className:"size-[18px]"})}),(0,d.jsx)(j.$,{variant:"outline",size:"sm",className:"shadow-none",onClick:function(){return(0,K.pi)(R)},children:"Open in Aether"})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(B.tU,{value:P,onValueChange:$e,children:(0,d.jsxs)(B.j7,{className:"h-8 bg-muted p-0.5",children:[(0,d.jsx)(B.Xi,{value:Q.BRIEF,className:"h-7 px-3 text-xs",children:"Brief"}),(0,d.jsx)(B.Xi,{value:Q.WATCHES,className:"h-7 px-3 text-xs",children:"Watches"})]})}),(0,d.jsxs)(j.$,{variant:"outline",size:"sm",className:"shadow-none",onClick:He,children:[(0,d.jsx)(r.Ld_,{className:"size-4"}),"New watch"]})]})},[I,R,Ce,b,P,$e,He,se]);(ge=I?[{label:"Aether Watch",onClick:We},{label:"New watch"}]:null!==R?[{label:"Aether Watch",onClick:We},Ee?{label:Ee.title}:{kind:"skeleton"}]:Ue?[{label:"Aether Watch",onClick:We},{label:Ue.task_args.message_content}]:[{label:"Aether Watch"}],(0,te.si)({breadcrumbs:ge,headerChildren:Xe,size:"compact"}),null!==R)?ye=(0,d.jsx)(L,{watchLabel:null!==(je=null!=Ee&&Ee.cron_uuid?Ae[Ee.cron_uuid]:void 0)&&void 0!==je?je:"Removed",created:null!==(we=null==Ee?void 0:Ee.created)&&void 0!==we?we:"",markdown:Oe,writtenFiles:Pe.writtenFiles,readPaths:Pe.accessedPaths,read:Fe,onDownload:Re,isLoading:E||null===Ee}):ye=(0,d.jsx)(G,{runs:b,watchLabels:Ae,onSelectRun:Me});Ue?Ne=(0,d.jsxs)(d.Fragment,{children:[le&&(0,d.jsx)("div",{className:"mb-4 flex justify-end",children:(0,d.jsxs)(j.$,{variant:"outline",size:"sm",onClick:function(){return ve(Ue.uuid)},children:[(0,d.jsx)(r.t_i,{className:"size-4"}),"Share"]})}),(0,d.jsx)(A,{watch:Ue,runCount:null!==(ke=_e[Ue.uuid])&&void 0!==ke?ke:0,onToggleActive:Ie,onToggleSendEmail:De,onDelete:Le})]}):Ne=(0,d.jsx)("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:0===w.length?"No watches yet — add one to get started.":"Select a watch."});if(I)Se=(0,d.jsx)(v,{onSubmit:Ge});else if(P===Q.WATCHES)Se=(0,d.jsxs)("div",{className:"flex h-full min-h-0",children:[(0,d.jsx)("aside",{className:"w-[212px] shrink-0 border-r border-border",children:(0,d.jsx)(O,{watches:w,selectedUuid:D,onSelect:ze})}),(0,d.jsx)("div",{className:"min-w-0 flex-1 overflow-y-auto px-6 py-5",children:Ne})]});else{var Be;Se=(0,d.jsx)("div",{className:"h-full overflow-y-auto",children:(0,d.jsx)("div",{className:"mt-2 flex flex-col gap-6",children:(0,d.jsx)(f,{firstName:null!==(Be=n.first_name)&&void 0!==Be?Be:"",runs:b,watches:w,children:ye})})})}return(0,d.jsxs)("div",{className:"h-full min-h-0",children:[Se,pe&&(0,d.jsx)(X.A,{open:!!pe,onOpenChange:function(e){return!e&&ve(null)},resourceUuid:pe,resourceName:null!==(e=null===(t=w.find(function(e){return e.uuid===pe}))||void 0===t?void 0:t.task_args.message_content)&&void 0!==e?e:"Untitled",members:he,currentUserUuid:n.uuid,listResourceAccess:Z.RH,updateResourceAccess:Z.Ee,onAccessUpdated:be})]})}}}]);

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.